@kong-ui-public/analytics-chart 6.0.3 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +1,43 @@
1
- (function(Z,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons"],f):(Z=typeof globalThis<"u"?globalThis:Z||self,f(Z["kong-ui-publicvitals-chart"]={},Z.Vue,Z["kong-ui-public-i18n"],Z.KongIcons))})(this,function(Z,f,yn,Eo){"use strict";var jD=Object.defineProperty;var VD=(Z,f,yn)=>f in Z?jD(Z,f,{enumerable:!0,configurable:!0,writable:!0,value:yn}):Z[f]=yn;var C=(Z,f,yn)=>VD(Z,typeof f!="symbol"?f+"":f,yn);var fn,Bh;const Jh={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",jumpToExplore:"Open in Explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{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",exportAsCsv:"Export as CSV",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",UtcOffset:"UTC Offset",Timestamp:"Timestamp"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_provider:"Provider",ai_request_model:"Request Model",ai_response_model:"Response Model",request_count:"Request Count",request_per_minute:"Requests per Minute",requests_per_minute:"Requests per Minute",response_latency_p99:"Response Latency (p99)",response_latency_p95:"Response Latency (p95)",response_latency_p50:"Response Latency (p50)",kong_latency_p99:"Kong Latency (p99)",kong_latency_p95:"Kong Latency (p95)",kong_latency_p50:"Kong Latency (p50)",llm_cache_status:"Cache Status",llm_embeddings_model:"Embeddings Model",llm_embeddings_provider:"Embeddings Provider",upstream_latency_p99:"Upstream Latency (p99)",upstream_latency_p95:"Upstream Latency (p95)",upstream_latency_p50:"Upstream Latency (p50)",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",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",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","3XX":"3xx","2XX":"2xx","1XX":"1xx",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",____OTHER____:"Others",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)",threshold:"Alert threshold"},metricAxisTitles:{request_count:"Request Count",requests_per_minute:"Requests per Minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_p99:"Response Latency (p99) in {unit}",response_latency_p95:"Response Latency (p95) in {unit}",response_latency_p50:"Response Latency (p50) in {unit}",upstream_latency_p99:"Upstream Latency (p99) in {unit}",upstream_latency_p95:"Upstream Latency (p95) in {unit}",upstream_latency_p50:"Upstream Latency (p50) in {unit}",kong_latency_p99:"Kong Latency (p99) in {unit}",kong_latency_p95:"Kong Latency (p95) in {unit}",kong_latency_p50:"Kong 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}",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}",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",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 tf(){const n=yn.createI18n("en-us",Jh);return{i18n:n,i18nT:yn.i18nTComponent(n)}}/*!
1
+ (function(nt,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons"],f):(nt=typeof globalThis<"u"?globalThis:nt||self,f(nt["kong-ui-publicvitals-chart"]={},nt.Vue,nt["kong-ui-public-i18n"],nt.KongIcons))})(this,function(nt,f,Bn,Zl){"use strict";var $D=Object.defineProperty;var UD=(nt,f,Bn)=>f in nt?$D(nt,f,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):nt[f]=Bn;var P=(nt,f,Bn)=>UD(nt,typeof f!="symbol"?f+"":f,Bn);var Pn,og;const lg={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",jumpToExplore:"Open in Explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{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",exportAsCsv:"Export as CSV",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",UtcOffset:"UTC Offset",Timestamp:"Timestamp"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_provider:"Provider",ai_request_model:"Request Model",ai_response_model:"Response Model",request_count:"Request Count",request_per_minute:"Requests per Minute",requests_per_minute:"Requests per Minute",response_latency_p99:"Response Latency (p99)",response_latency_p95:"Response Latency (p95)",response_latency_p50:"Response Latency (p50)",kong_latency_p99:"Kong Latency (p99)",kong_latency_p95:"Kong Latency (p95)",kong_latency_p50:"Kong Latency (p50)",llm_cache_status:"Cache Status",llm_embeddings_model:"Embeddings Model",llm_embeddings_provider:"Embeddings Provider",upstream_latency_p99:"Upstream Latency (p99)",upstream_latency_p95:"Upstream Latency (p95)",upstream_latency_p50:"Upstream Latency (p50)",response_size_p99:"Response Size (p99)",response_size_p95:"Response Size (p95)",response_size_p50:"Response Size (p50)",response_size_average:"Response Size (avg)",response_size_sum:"Response Size (sum)",request_size_p99:"Request Size (p99)",request_size_p95:"Request Size (p95)",request_size_p50:"Request Size (p50)",request_size_average:"Request Size (avg)",request_size_sum:"Request Size (sum)",control_plane:"Control Plane",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",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","3XX":"3xx","2XX":"2xx","1XX":"1xx",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",____OTHER____:"Others",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)",threshold:"Alert threshold"},metricAxisTitles:{request_count:"Request Count",requests_per_minute:"Requests per Minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_p99:"Response Latency (p99) in {unit}",response_latency_p95:"Response Latency (p95) in {unit}",response_latency_p50:"Response Latency (p50) in {unit}",upstream_latency_p99:"Upstream Latency (p99) in {unit}",upstream_latency_p95:"Upstream Latency (p95) in {unit}",upstream_latency_p50:"Upstream Latency (p50) in {unit}",kong_latency_p99:"Kong Latency (p99) in {unit}",kong_latency_p95:"Kong Latency (p95) in {unit}",kong_latency_p50:"Kong 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}",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}",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",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 cg(){const n=Bn.createI18n("en-us",lg);return{i18n:n,i18nT:Bn.i18nTComponent(n)}}/*!
2
2
  * @kurkle/color v0.3.2
3
3
  * https://github.com/kurkle/color#readme
4
4
  * (c) 2023 Jukka Kurkela
5
5
  * Released under the MIT License
6
- */function li(n){return n+.5|0}const Ke=(n,t,e)=>Math.max(Math.min(n,e),t);function ci(n){return Ke(li(n*2.55),0,255)}function Ze(n){return Ke(li(n*255),0,255)}function Re(n){return Ke(li(n/2.55)/100,0,1)}function Ro(n){return Ke(li(n*100),0,100)}const he={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Mr=[..."0123456789ABCDEF"],ef=n=>Mr[n&15],nf=n=>Mr[(n&240)>>4]+Mr[n&15],rs=n=>(n&240)>>4===(n&15),sf=n=>rs(n.r)&&rs(n.g)&&rs(n.b)&&rs(n.a);function rf(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&he[n[1]]*17,g:255&he[n[2]]*17,b:255&he[n[3]]*17,a:t===5?he[n[4]]*17:255}:(t===7||t===9)&&(e={r:he[n[1]]<<4|he[n[2]],g:he[n[3]]<<4|he[n[4]],b:he[n[5]]<<4|he[n[6]],a:t===9?he[n[7]]<<4|he[n[8]]:255})),e}const af=(n,t)=>n<255?t(n):"";function of(n){var t=sf(n)?ef:nf;return n?"#"+t(n.r)+t(n.g)+t(n.b)+af(n.a,t):void 0}const lf=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ao(n,t,e){const i=t*Math.min(e,1-e),s=(r,a=(r+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function cf(n,t,e){const i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function uf(n,t,e){const i=Ao(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function df(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function kr(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),a=Math.min(e,i,s),o=(r+a)/2;let l,c,u;return r!==a&&(u=r-a,c=o>.5?u/(2-r-a):u/(r+a),l=df(e,i,s,u,r),l=l*60+.5),[l|0,c||0,o]}function Sr(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ze)}function Dr(n,t,e){return Sr(Ao,n,t,e)}function hf(n,t,e){return Sr(uf,n,t,e)}function ff(n,t,e){return Sr(cf,n,t,e)}function Lo(n){return(n%360+360)%360}function gf(n){const t=lf.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?ci(+t[5]):Ze(+t[5]));const s=Lo(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=hf(s,r,a):t[1]==="hsv"?i=ff(s,r,a):i=Dr(s,r,a),{r:i[0],g:i[1],b:i[2],a:e}}function pf(n,t){var e=kr(n);e[0]=Lo(e[0]+t),e=Dr(e),n.r=e[0],n.g=e[1],n.b=e[2]}function mf(n){if(!n)return;const t=kr(n),e=t[0],i=Ro(t[1]),s=Ro(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Re(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Io={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},No={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function yf(){const n={},t=Object.keys(No),e=Object.keys(Io);let i,s,r,a,o;for(i=0;i<t.length;i++){for(a=o=t[i],s=0;s<e.length;s++)r=e[s],o=o.replace(r,Io[r]);r=parseInt(No[a],16),n[o]=[r>>16&255,r>>8&255,r&255]}return n}let as;function bf(n){as||(as=yf(),as.transparent=[0,0,0,0]);const t=as[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const xf=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _f(n){const t=xf.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?ci(a):Ke(a*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?ci(i):Ke(i,0,255)),s=255&(t[4]?ci(s):Ke(s,0,255)),r=255&(t[6]?ci(r):Ke(r,0,255)),{r:i,g:s,b:r,a:e}}}function wf(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Re(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Tr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Hn=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function vf(n,t,e){const i=Hn(Re(n.r)),s=Hn(Re(n.g)),r=Hn(Re(n.b));return{r:Ze(Tr(i+e*(Hn(Re(t.r))-i))),g:Ze(Tr(s+e*(Hn(Re(t.g))-s))),b:Ze(Tr(r+e*(Hn(Re(t.b))-r))),a:n.a+e*(t.a-n.a)}}function os(n,t,e){if(n){let i=kr(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Dr(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Fo(n,t){return n&&Object.assign(t||{},n)}function zo(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ze(n[3]))):(t=Fo(n,{r:0,g:0,b:0,a:1}),t.a=Ze(t.a)),t}function Mf(n){return n.charAt(0)==="r"?_f(n):gf(n)}class ui{constructor(t){if(t instanceof ui)return t;const e=typeof t;let i;e==="object"?i=zo(t):e==="string"&&(i=rf(t)||bf(t)||Mf(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Fo(this._rgb);return t&&(t.a=Re(t.a)),t}set rgb(t){this._rgb=zo(t)}rgbString(){return this._valid?wf(this._rgb):void 0}hexString(){return this._valid?of(this._rgb):void 0}hslString(){return this._valid?mf(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const a=e===r?.5:e,o=2*a-1,l=i.a-s.a,c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=vf(this._rgb,t._rgb,e)),this}clone(){return new ui(this.rgb)}alpha(t){return this._rgb.a=Ze(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=li(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return os(this._rgb,2,t),this}darken(t){return os(this._rgb,2,-t),this}saturate(t){return os(this._rgb,1,t),this}desaturate(t){return os(this._rgb,1,-t),this}rotate(t){return pf(this._rgb,t),this}}/*!
6
+ */function Bi(n){return n+.5|0}const gn=(n,t,e)=>Math.max(Math.min(n,e),t);function Hi(n){return gn(Bi(n*2.55),0,255)}function pn(n){return gn(Bi(n*255),0,255)}function Ze(n){return gn(Bi(n/2.55)/100,0,1)}function Ql(n){return gn(Bi(n*100),0,100)}const Ce={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},xo=[..."0123456789ABCDEF"],ug=n=>xo[n&15],dg=n=>xo[(n&240)>>4]+xo[n&15],$s=n=>(n&240)>>4===(n&15),hg=n=>$s(n.r)&&$s(n.g)&&$s(n.b)&&$s(n.a);function fg(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Ce[n[1]]*17,g:255&Ce[n[2]]*17,b:255&Ce[n[3]]*17,a:t===5?Ce[n[4]]*17:255}:(t===7||t===9)&&(e={r:Ce[n[1]]<<4|Ce[n[2]],g:Ce[n[3]]<<4|Ce[n[4]],b:Ce[n[5]]<<4|Ce[n[6]],a:t===9?Ce[n[7]]<<4|Ce[n[8]]:255})),e}const gg=(n,t)=>n<255?t(n):"";function pg(n){var t=hg(n)?ug:dg;return n?"#"+t(n.r)+t(n.g)+t(n.b)+gg(n.a,t):void 0}const mg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Jl(n,t,e){const i=t*Math.min(e,1-e),s=(r,o=(r+n/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function yg(n,t,e){const i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function bg(n,t,e){const i=Jl(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function _g(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function wo(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),o=Math.min(e,i,s),a=(r+o)/2;let l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=_g(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function vo(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(pn)}function Mo(n,t,e){return vo(Jl,n,t,e)}function xg(n,t,e){return vo(bg,n,t,e)}function wg(n,t,e){return vo(yg,n,t,e)}function tc(n){return(n%360+360)%360}function vg(n){const t=mg.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Hi(+t[5]):pn(+t[5]));const s=tc(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=xg(s,r,o):t[1]==="hsv"?i=wg(s,r,o):i=Mo(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Mg(n,t){var e=wo(n);e[0]=tc(e[0]+t),e=Mo(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Sg(n){if(!n)return;const t=wo(n),e=t[0],i=Ql(t[1]),s=Ql(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ze(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const ec={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},nc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function kg(){const n={},t=Object.keys(nc),e=Object.keys(ec);let i,s,r,o,a;for(i=0;i<t.length;i++){for(o=a=t[i],s=0;s<e.length;s++)r=e[s],a=a.replace(r,ec[r]);r=parseInt(nc[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let Us;function Dg(n){Us||(Us=kg(),Us.transparent=[0,0,0,0]);const t=Us[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Tg=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Cg(n){const t=Tg.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?Hi(o):gn(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Hi(i):gn(i,0,255)),s=255&(t[4]?Hi(s):gn(s,0,255)),r=255&(t[6]?Hi(r):gn(r,0,255)),{r:i,g:s,b:r,a:e}}}function Og(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ze(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const So=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,li=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Pg(n,t,e){const i=li(Ze(n.r)),s=li(Ze(n.g)),r=li(Ze(n.b));return{r:pn(So(i+e*(li(Ze(t.r))-i))),g:pn(So(s+e*(li(Ze(t.g))-s))),b:pn(So(r+e*(li(Ze(t.b))-r))),a:n.a+e*(t.a-n.a)}}function qs(n,t,e){if(n){let i=wo(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Mo(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ic(n,t){return n&&Object.assign(t||{},n)}function sc(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=pn(n[3]))):(t=ic(n,{r:0,g:0,b:0,a:1}),t.a=pn(t.a)),t}function Eg(n){return n.charAt(0)==="r"?Cg(n):vg(n)}class Wi{constructor(t){if(t instanceof Wi)return t;const e=typeof t;let i;e==="object"?i=sc(t):e==="string"&&(i=fg(t)||Dg(t)||Eg(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ic(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=sc(t)}rgbString(){return this._valid?Og(this._rgb):void 0}hexString(){return this._valid?pg(this._rgb):void 0}hslString(){return this._valid?Sg(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Pg(this._rgb,t._rgb,e)),this}clone(){return new Wi(this.rgb)}alpha(t){return this._rgb.a=pn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Bi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return qs(this._rgb,2,t),this}darken(t){return qs(this._rgb,2,-t),this}saturate(t){return qs(this._rgb,1,t),this}desaturate(t){return qs(this._rgb,1,-t),this}rotate(t){return Mg(this._rgb,t),this}}/*!
7
7
  * Chart.js v4.4.5
8
8
  * https://www.chartjs.org
9
9
  * (c) 2024 Chart.js Contributors
10
10
  * Released under the MIT License
11
- */function Ae(){}const kf=(()=>{let n=0;return()=>n++})();function J(n){return n===null||typeof n>"u"}function ut(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 nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Mt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ce(n,t){return Mt(n)?n:t}function Q(n,t){return typeof n>"u"?t:n}const Sf=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Bo=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function ht(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function ft(n,t,e,i){let s,r,a;if(ut(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(nt(n))for(a=Object.keys(n),r=a.length,s=0;s<r;s++)t.call(e,n[a[s]],a[s])}function ls(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function cs(n){if(ut(n))return n.map(cs);if(nt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=cs(n[e[s]]);return t}return n}function Ho(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Df(n,t,e,i){if(!Ho(n))return;const s=t[n],r=e[n];nt(s)&&nt(r)?di(s,r,i):t[n]=cs(r)}function di(n,t,e){const i=ut(t)?t:[t],s=i.length;if(!nt(n))return n;e=e||{};const r=e.merger||Df;let a;for(let o=0;o<s;++o){if(a=i[o],!nt(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)r(l[c],n,a,e)}return n}function hi(n,t){return di(n,t,{merger:Tf})}function Tf(n,t,e){if(!Ho(n))return;const i=t[n],s=e[n];nt(i)&&nt(s)?hi(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=cs(s))}const Wo={"":n=>n,x:n=>n.x,y:n=>n.y};function Cf(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Pf(n){const t=Cf(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Qe(n,t){return(Wo[t]||(Wo[t]=Pf(t)))(n)}function Cr(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Jt=n=>typeof n<"u",te=n=>typeof n=="function",Yo=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Of(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const rt=Math.PI,bt=2*rt,Ef=bt+rt,us=Number.POSITIVE_INFINITY,Pr=rt/180,xt=rt/2,fe=rt/4,ds=rt*2/3,Je=Math.log10,De=Math.sign;function fi(n,t,e){return Math.abs(n-t)<e}function jo(n){const t=Math.round(n);n=fi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Je(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Rf(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((s,r)=>s-r).pop(),t}function tn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Af(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Vo(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Ft(n){return n*(rt/180)}function hs(n){return n*(180/rt)}function $o(n){if(!Mt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function fs(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*rt&&(r+=bt),{angle:r,distance:s}}function Wn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Lf(n,t){return(n-t+Ef)%bt-rt}function ue(n){return(n%bt+bt)%bt}function gi(n,t,e,i){const s=ue(n),r=ue(t),a=ue(e),o=ue(r-s),l=ue(a-s),c=ue(s-r),u=ue(s-a);return s===r||s===a||i&&r===a||o>l&&c<u}function Wt(n,t,e){return Math.max(t,Math.min(e,n))}function If(n){return Wt(n,-32768,32767)}function Le(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Or(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Ie=(n,t,e,i)=>Or(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Nf=(n,t,e)=>Or(n,e,i=>n[i][t]>=e);function Ff(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Uo=["push","pop","shift","splice","unshift"];function zf(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Uo.forEach(e=>{const i="_onData"+Cr(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const a=s.apply(this,r);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...r)}),a}})})}function qo(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Uo.forEach(r=>{delete n[r]}),delete n._chartjs)}function Xo(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Go=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ko(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Go.call(window,()=>{i=!1,n.apply(t,e)}))}}function Bf(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Er=n=>n==="start"?"left":n==="end"?"right":"center",Vt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Hf=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Zo(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:a,_parsed:o}=n,l=a.axis,{min:c,max:u,minDefined:d,maxDefined:h}=a.getUserBounds();d&&(s=Wt(Math.min(Ie(o,l,c).lo,e?i:Ie(t,l,a.getPixelForValue(c)).lo),0,i-1)),h?r=Wt(Math.max(Ie(o,a.axis,u,!0).hi+1,e?0:Ie(t,l,a.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function Qo(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const gs=n=>n===0||n===1,Jo=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*bt/e)),tl=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*bt/e)+1,pi={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*xt)+1,easeOutSine:n=>Math.sin(n*xt),easeInOutSine:n=>-.5*(Math.cos(rt*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=>gs(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=>gs(n)?n:Jo(n,.075,.3),easeOutElastic:n=>gs(n)?n:tl(n,.075,.3),easeInOutElastic(n){return gs(n)?n:n<.5?.5*Jo(n*2,.1125,.45):.5+.5*tl(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-pi.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?pi.easeInBounce(n*2)*.5:pi.easeOutBounce(n*2-1)*.5+.5};function Rr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function el(n){return Rr(n)?n:new ui(n)}function Ar(n){return Rr(n)?n:new ui(n).saturate(.5).darken(.1).hexString()}const Wf=["x","y","borderWidth","radius","tension"],Yf=["color","borderColor","backgroundColor"];function jf(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:Yf},numbers:{type:"number",properties:Wf}}),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 Vf(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const nl=new Map;function $f(n,t){t=t||{};const e=n+JSON.stringify(t);let i=nl.get(e);return i||(i=new Intl.NumberFormat(n,t),nl.set(e,i)),i}function mi(n,t,e){return $f(t,e).format(n)}const il={values(n){return ut(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=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)&&(s="scientific"),r=Uf(n,e)}const a=Je(Math.abs(r)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),mi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Je(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?il.numeric.call(this,n,t,e):""}};function Uf(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 ps={formatters:il};function qf(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:ps.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 bn=Object.create(null),Lr=Object.create(null);function yi(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Ir(n,t,e){return typeof t=="string"?di(yi(n,t),e):di(yi(n,""),t)}class Xf{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,s)=>Ar(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ar(s.borderColor),this.hoverColor=(i,s)=>Ar(s.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 Ir(this,t,e)}get(t){return yi(this,t)}describe(t,e){return Ir(Lr,t,e)}override(t,e){return Ir(bn,t,e)}route(t,e,i,s){const r=yi(this,t),a=yi(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=a[s];return nt(l)?Object.assign({},c,l):Q(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var _t=new Xf({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[jf,Vf,qf]);function Gf(n){return!n||J(n.size)||J(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ms(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function Kf(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const o=e.length;let l,c,u,d,h;for(l=0;l<o;l++)if(d=e[l],d!=null&&!ut(d))a=ms(n,s,r,a,d);else if(ut(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!ut(h)&&(a=ms(n,s,r,a,h));n.restore();const g=r.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return a}function xn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function sl(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Nr(n,t,e,i){rl(n,t,e,i,null)}function rl(n,t,e,i,s){let r,a,o,l,c,u,d,h;const g=t.pointStyle,m=t.rotation,b=t.radius;let _=(m||0)*Pr;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(_),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(b)||b<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,b,0,0,bt):n.arc(e,i,b,0,bt),n.closePath();break;case"triangle":u=s?s/2:b,n.moveTo(e+Math.sin(_)*u,i-Math.cos(_)*b),_+=ds,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*b),_+=ds,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*b),n.closePath();break;case"rectRounded":c=b*.516,l=b-c,a=Math.cos(_+fe)*l,d=Math.cos(_+fe)*(s?s/2-c:l),o=Math.sin(_+fe)*l,h=Math.sin(_+fe)*(s?s/2-c:l),n.arc(e-d,i-o,c,_-rt,_-xt),n.arc(e+h,i-a,c,_-xt,_),n.arc(e+d,i+o,c,_,_+xt),n.arc(e-h,i+a,c,_+xt,_+rt),n.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*b,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}_+=fe;case"rectRot":d=Math.cos(_)*(s?s/2:b),a=Math.cos(_)*b,o=Math.sin(_)*b,h=Math.sin(_)*(s?s/2:b),n.moveTo(e-d,i-o),n.lineTo(e+h,i-a),n.lineTo(e+d,i+o),n.lineTo(e-h,i+a),n.closePath();break;case"crossRot":_+=fe;case"cross":d=Math.cos(_)*(s?s/2:b),a=Math.cos(_)*b,o=Math.sin(_)*b,h=Math.sin(_)*(s?s/2:b),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-a),n.lineTo(e-h,i+a);break;case"star":d=Math.cos(_)*(s?s/2:b),a=Math.cos(_)*b,o=Math.sin(_)*b,h=Math.sin(_)*(s?s/2:b),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-a),n.lineTo(e-h,i+a),_+=fe,d=Math.cos(_)*(s?s/2:b),a=Math.cos(_)*b,o=Math.sin(_)*b,h=Math.sin(_)*(s?s/2:b),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-a),n.lineTo(e-h,i+a);break;case"line":a=s?s/2:Math.cos(_)*b,o=Math.sin(_)*b,n.moveTo(e-a,i-o),n.lineTo(e+a,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(_)*(s?s/2:b),i+Math.sin(_)*b);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ne(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 bi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function xi(n){n.restore()}function Zf(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Qf(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 Jf(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),J(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 tg(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),a=t-r.actualBoundingBoxLeft,o=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,u),n.lineTo(o,u),n.stroke()}}function eg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function _n(n,t,e,i,s,r={}){const a=ut(t)?t:[t],o=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,Jf(n,r),l=0;l<a.length;++l)c=a[l],r.backdrop&&eg(n,r.backdrop),o&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),J(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),tg(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function Yn(n,t){const{x:e,y:i,w:s,h:r,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*rt,rt,!0),n.lineTo(e,i+r-a.bottomLeft),n.arc(e+a.bottomLeft,i+r-a.bottomLeft,a.bottomLeft,rt,xt,!0),n.lineTo(e+s-a.bottomRight,i+r),n.arc(e+s-a.bottomRight,i+r-a.bottomRight,a.bottomRight,xt,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-xt,!0),n.lineTo(e+a.topLeft,i)}const ng=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ig=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function sg(n,t){const e=(""+n).match(ng);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 rg=n=>+n||0;function Fr(n,t){const e={},i=nt(t),s=i?Object.keys(t):t,r=nt(n)?i?a=>Q(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=rg(r(a));return e}function al(n){return Fr(n,{top:"y",right:"x",bottom:"y",left:"x"})}function en(n){return Fr(n,["topLeft","topRight","bottomLeft","bottomRight"])}function zt(n){const t=al(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function kt(n,t){n=n||{},t=t||_t.font;let e=Q(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Q(n.style,t.style);i&&!(""+i).match(ig)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Q(n.family,t.family),lineHeight:sg(Q(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Q(n.weight,t.weight),string:""};return s.string=Gf(s),s}function _i(n,t,e,i){let s,r,a;for(s=0,r=n.length;s<r;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function ag(n,t,e){const{min:i,max:s}=n,r=Bo(t,(s-i)/2),a=(o,l)=>e&&o===0?0:o+l;return{min:a(i,-Math.abs(r)),max:a(s,r)}}function nn(n,t){return Object.assign(Object.create(n),t)}function zr(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=dl("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:o=>zr([o,...n],t,r,i)};return new Proxy(a,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return ll(o,l,()=>gg(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return hl(o).includes(l)},ownKeys(o){return hl(o)},set(o,l,c){const u=o._storage||(o._storage=s());return o[l]=u[l]=c,delete o._keys,!0}})}function jn(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:ol(n,i),setContext:r=>jn(n,r,e,i),override:r=>jn(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,a){return delete r[a],delete n[a],!0},get(r,a,o){return ll(r,a,()=>lg(r,a,o))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(r,a,o){return n[a]=o,delete r[a],!0}})}function ol(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:te(e)?e:()=>e,isIndexable:te(i)?i:()=>i}}const og=(n,t)=>n?n+Cr(t):t,Br=(n,t)=>nt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ll(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function lg(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:a}=n;let o=i[t];return te(o)&&a.isScriptable(t)&&(o=cg(t,o,n,e)),ut(o)&&o.length&&(o=ug(t,o,n,a.isIndexable)),Br(t,o)&&(o=jn(o,s,r&&r[t],a)),o}function cg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(r,a||i);return o.delete(n),Br(n,l)&&(l=Hr(s._scopes,s,n,l)),l}function ug(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_descriptors:o}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(nt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Hr(c,s,n,u);t.push(jn(d,r,a&&a[n],o))}}return t}function cl(n,t,e){return te(n)?n(t,e):n}const dg=(n,t)=>n===!0?t:typeof n=="string"?Qe(t,n):void 0;function hg(n,t,e,i,s){for(const r of t){const a=dg(e,r);if(a){n.add(a);const o=cl(a._fallback,e,s);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function Hr(n,t,e,i){const s=t._rootScopes,r=cl(t._fallback,e,i),a=[...n,...s],o=new Set;o.add(i);let l=ul(o,a,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=ul(o,a,r,l,i),l===null)?!1:zr(Array.from(o),[""],s,r,()=>fg(t,e,i))}function ul(n,t,e,i,s){for(;e;)e=hg(n,t,e,i,s);return e}function fg(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return ut(s)&&nt(e)?e:s||{}}function gg(n,t,e,i){let s;for(const r of t)if(s=dl(og(r,n),e),typeof s<"u")return Br(n,s)?Hr(e,i,n,s):s}function dl(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function hl(n){let t=n._keys;return t||(t=n._keys=pg(n._scopes)),t}function pg(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function fl(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,a=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],a[o]={r:s.parse(Qe(u,r),c)};return a}const mg=Number.EPSILON||1e-14,Vn=(n,t)=>t<n.length&&!n[t].skip&&n[t],gl=n=>n==="x"?"y":"x";function yg(n,t,e,i){const s=n.skip?t:n,r=t,a=e.skip?t:e,o=Wn(r,s),l=Wn(a,r);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(a.x-s.x),y:r.y-d*(a.y-s.y)},next:{x:r.x+h*(a.x-s.x),y:r.y+h*(a.y-s.y)}}}function bg(n,t,e){const i=n.length;let s,r,a,o,l,c=Vn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Vn(n,u+1),!(!l||!c)){if(fi(t[u],0,mg)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],o=Math.pow(s,2)+Math.pow(r,2),!(o<=9)&&(a=3/Math.sqrt(o),e[u]=s*a*t[u],e[u+1]=r*a*t[u])}}function xg(n,t,e="x"){const i=gl(e),s=n.length;let r,a,o,l=Vn(n,0);for(let c=0;c<s;++c){if(a=o,o=l,l=Vn(n,c+1),!o)continue;const u=o[e],d=o[i];a&&(r=(u-a[e])/3,o[`cp1${e}`]=u-r,o[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,o[`cp2${e}`]=u+r,o[`cp2${i}`]=d+r*t[c])}}function _g(n,t="x"){const e=gl(t),i=n.length,s=Array(i).fill(0),r=Array(i);let a,o,l,c=Vn(n,0);for(a=0;a<i;++a)if(o=l,l=c,c=Vn(n,a+1),!!l){if(c){const u=c[t]-l[t];s[a]=u!==0?(c[e]-l[e])/u:0}r[a]=o?c?De(s[a-1])!==De(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}bg(n,s,r),xg(n,r,t)}function ys(n,t,e){return Math.max(Math.min(n,e),t)}function wg(n,t){let e,i,s,r,a,o=Ne(n[0],t);for(e=0,i=n.length;e<i;++e)a=r,r=o,o=e<i-1&&Ne(n[e+1],t),r&&(s=n[e],a&&(s.cp1x=ys(s.cp1x,t.left,t.right),s.cp1y=ys(s.cp1y,t.top,t.bottom)),o&&(s.cp2x=ys(s.cp2x,t.left,t.right),s.cp2y=ys(s.cp2y,t.top,t.bottom)))}function vg(n,t,e,i,s){let r,a,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")_g(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,a=n.length;r<a;++r)o=n[r],l=yg(c,o,n[Math.min(r+1,a-(i?0:1))%a],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&&wg(n,e)}function Wr(){return typeof window<"u"&&typeof document<"u"}function Yr(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function bs(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 xs=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Mg(n,t){return xs(n).getPropertyValue(t)}const kg=["top","right","bottom","left"];function wn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=kg[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Sg=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Dg(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let a=!1,o,l;if(Sg(s,r,n.target))o=s,l=r;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:o,y:l,box:a}}function sn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=xs(e),r=s.boxSizing==="border-box",a=wn(s,"padding"),o=wn(s,"border","width"),{x:l,y:c,box:u}=Dg(n,e),d=a.left+(u&&o.left),h=a.top+(u&&o.top);let{width:g,height:m}=t;return r&&(g-=a.width+o.width,m-=a.height+o.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-h)/m*e.height/i)}}function Tg(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Yr(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const a=r.getBoundingClientRect(),o=xs(r),l=wn(o,"border","width"),c=wn(o,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=bs(o.maxWidth,r,"clientWidth"),s=bs(o.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||us,maxHeight:s||us}}const _s=n=>Math.round(n*10)/10;function Cg(n,t,e,i){const s=xs(n),r=wn(s,"margin"),a=bs(s.maxWidth,n,"clientWidth")||us,o=bs(s.maxHeight,n,"clientHeight")||us,l=Tg(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=wn(s,"border","width"),g=wn(s,"padding");c-=g.width+h.width,u-=g.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=_s(Math.min(c,a,l.maxWidth)),u=_s(Math.min(u,o,l.maxHeight)),c&&!u&&(u=_s(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=_s(Math.floor(u*i))),{width:c,height:u}}function pl(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==r?(n.currentDevicePixelRatio=i,a.height=s,a.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Pg=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Wr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function ml(n,t){const e=Mg(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Og(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 Eg(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},a=vn(n,s,e),o=vn(s,r,e),l=vn(r,t,e),c=vn(a,o,e),u=vn(o,l,e);return vn(c,u,e)}const Rg=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}}},Ag=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function $n(n,t,e){return n?Rg(t,e):Ag()}function yl(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 bl(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function xl(n){return n==="angle"?{between:gi,compare:Lf,normalize:ue}:{between:Le,compare:(t,e)=>t-e,normalize:t=>t}}function _l({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Lg(n,t,e){const{property:i,start:s,end:r}=e,{between:a,normalize:o}=xl(i),l=t.length;let{start:c,end:u,loop:d}=n,h,g;if(d){for(c+=l,u+=l,h=0,g=l;h<g&&a(o(t[c%l][i]),s,r);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function wl(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,a=t.length,{compare:o,between:l,normalize:c}=xl(i),{start:u,end:d,loop:h,style:g}=Lg(n,t,e),m=[];let b=!1,_=null,w,M,S;const k=()=>l(s,S,w)&&o(s,S)!==0,D=()=>o(r,w)===0||l(r,S,w),O=()=>b||k(),P=()=>!b||D();for(let p=u,x=u;p<=d;++p)M=t[p%a],!M.skip&&(w=c(M[i]),w!==S&&(b=l(w,s,r),_===null&&O()&&(_=o(w,s)===0?p:x),_!==null&&P()&&(m.push(_l({start:_,end:p,loop:h,count:a,style:g})),_=null),x=p,S=w));return _!==null&&m.push(_l({start:_,end:d,loop:h,count:a,style:g})),m}function vl(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=wl(i[s],n.points,t);r.length&&e.push(...r)}return e}function Ig(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Ng(n,t,e,i){const s=n.length,r=[];let a=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?o.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,o.skip&&(t=l)),o=c}return a!==null&&r.push({start:t%s,end:a%s,loop:i}),r}function Fg(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:a,end:o}=Ig(e,s,r,i);if(i===!0)return Ml(n,[{start:a,end:o,loop:r}],e,t);const l=o<a?o+s:o,c=!!n._fullLoop&&a===0&&o===s-1;return Ml(n,Ng(e,a,l,c),e,t)}function Ml(n,t,e,i){return!i||!i.setContext||!e?t:zg(n,t,e,i)}function zg(n,t,e,i){const s=n._chart.getContext(),r=kl(n.options),{_datasetIndex:a,options:{spanGaps:o}}=n,l=e.length,c=[];let u=r,d=t[0].start,h=d;function g(m,b,_,w){const M=o?-1:1;if(m!==b){for(m+=l;e[m%l].skip;)m-=M;for(;e[b%l].skip;)b+=M;m%l!==b%l&&(c.push({start:m%l,end:b%l,loop:_,style:w}),u=w,d=b%l)}}for(const m of t){d=o?d:m.start;let b=e[d%l],_;for(h=d+1;h<=m.end;h++){const w=e[h%l];_=kl(i.setContext(nn(s,{type:"segment",p0:b,p1:w,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:a}))),Bg(_,u)&&g(d,h-1,m.loop,u),b=w,u=_}d<h-1&&g(d,h-1,m.loop,u)}return c}function kl(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Bg(n,t){if(!t)return!1;const e=[],i=function(s,r){return Rr(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
11
+ */function Qe(){}const Ag=(()=>{let n=0;return()=>n++})();function st(n){return n===null||typeof n>"u"}function bt(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 Pt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ke(n,t){return Pt(n)?n:t}function it(n,t){return typeof n>"u"?t:n}const Rg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,rc=(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 xt(n,t,e,i){let s,r,o;if(bt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(lt(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Xs(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Gs(n){if(bt(n))return n.map(Gs);if(lt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Gs(n[e[s]]);return t}return n}function oc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Lg(n,t,e,i){if(!oc(n))return;const s=t[n],r=e[n];lt(s)&&lt(r)?Yi(s,r,i):t[n]=Gs(r)}function Yi(n,t,e){const i=bt(t)?t:[t],s=i.length;if(!lt(n))return n;e=e||{};const r=e.merger||Lg;let o;for(let a=0;a<s;++a){if(o=i[a],!lt(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function ji(n,t){return Yi(n,t,{merger:Ig})}function Ig(n,t,e){if(!oc(n))return;const i=t[n],s=e[n];lt(i)&&lt(s)?ji(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Gs(s))}const ac={"":n=>n,x:n=>n.x,y:n=>n.y};function Ng(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Fg(n){const t=Ng(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function mn(n,t){return(ac[t]||(ac[t]=Fg(t)))(n)}function ko(n){return n.charAt(0).toUpperCase()+n.slice(1)}const he=n=>typeof n<"u",fe=n=>typeof n=="function",lc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function zg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ut=Math.PI,St=2*ut,Bg=St+ut,Ks=Number.POSITIVE_INFINITY,Do=ut/180,Ct=ut/2,Oe=ut/4,Zs=ut*2/3,yn=Math.log10,je=Math.sign;function Vi(n,t,e){return Math.abs(n-t)<e}function cc(n){const t=Math.round(n);n=Vi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(yn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Hg(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((s,r)=>s-r).pop(),t}function bn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Wg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function uc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Yt(n){return n*(ut/180)}function Qs(n){return n*(180/ut)}function dc(n){if(!Pt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Js(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*ut&&(r+=St),{angle:r,distance:s}}function ci(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Yg(n,t){return(n-t+Bg)%St-ut}function De(n){return(n%St+St)%St}function $i(n,t,e,i){const s=De(n),r=De(t),o=De(e),a=De(r-s),l=De(o-s),c=De(s-r),u=De(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Xt(n,t,e){return Math.max(t,Math.min(e,n))}function jg(n){return Xt(n,-32768,32767)}function Je(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function To(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const tn=(n,t,e,i)=>To(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Vg=(n,t,e)=>To(n,e,i=>n[i][t]>=e);function $g(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const hc=["push","pop","shift","splice","unshift"];function Ug(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),hc.forEach(e=>{const i="_onData"+ko(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function fc(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(hc.forEach(r=>{delete n[r]}),delete n._chartjs)}function gc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const pc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function mc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,pc.call(window,()=>{i=!1,n.apply(t,e)}))}}function qg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Co=n=>n==="start"?"left":n==="end"?"right":"center",ee=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Xg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function yc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,_parsed:a}=n,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=Xt(Math.min(tn(a,l,c).lo,e?i:tn(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=Xt(Math.max(tn(a,o.axis,u,!0).hi+1,e?0:tn(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function bc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const tr=n=>n===0||n===1,_c=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*St/e)),xc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*St/e)+1,Ui={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*Ct)+1,easeOutSine:n=>Math.sin(n*Ct),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=>tr(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=>tr(n)?n:_c(n,.075,.3),easeOutElastic:n=>tr(n)?n:xc(n,.075,.3),easeInOutElastic(n){return tr(n)?n:n<.5?.5*_c(n*2,.1125,.45):.5+.5*xc(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-Ui.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?Ui.easeInBounce(n*2)*.5:Ui.easeOutBounce(n*2-1)*.5+.5};function Oo(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function wc(n){return Oo(n)?n:new Wi(n)}function Po(n){return Oo(n)?n:new Wi(n).saturate(.5).darken(.1).hexString()}const Gg=["x","y","borderWidth","radius","tension"],Kg=["color","borderColor","backgroundColor"];function Zg(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:Kg},numbers:{type:"number",properties:Gg}}),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 Qg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const vc=new Map;function Jg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=vc.get(e);return i||(i=new Intl.NumberFormat(n,t),vc.set(e,i)),i}function qi(n,t,e){return Jg(t,e).format(n)}const Mc={values(n){return bt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=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)&&(s="scientific"),r=tp(n,e)}const o=yn(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),qi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(yn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Mc.numeric.call(this,n,t,e):""}};function tp(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 er={formatters:Mc};function ep(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:er.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 Hn=Object.create(null),Eo=Object.create(null);function Xi(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Ao(n,t,e){return typeof t=="string"?Yi(Xi(n,t),e):Yi(Xi(n,""),t)}class np{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,s)=>Po(s.backgroundColor),this.hoverBorderColor=(i,s)=>Po(s.borderColor),this.hoverColor=(i,s)=>Po(s.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 Ao(this,t,e)}get(t){return Xi(this,t)}describe(t,e){return Ao(Eo,t,e)}override(t,e){return Ao(Hn,t,e)}route(t,e,i,s){const r=Xi(this,t),o=Xi(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return lt(l)?Object.assign({},c,l):it(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ot=new np({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Zg,Qg,ep]);function ip(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function nr(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function sp(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,d,h;for(l=0;l<a;l++)if(d=e[l],d!=null&&!bt(d))o=nr(n,s,r,o,d);else if(bt(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!bt(h)&&(o=nr(n,s,r,o,h));n.restore();const g=r.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return o}function Wn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Sc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Ro(n,t,e,i){kc(n,t,e,i,null)}function kc(n,t,e,i,s){let r,o,a,l,c,u,d,h;const g=t.pointStyle,m=t.rotation,b=t.radius;let w=(m||0)*Do;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(w),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(b)||b<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,b,0,0,St):n.arc(e,i,b,0,St),n.closePath();break;case"triangle":u=s?s/2:b,n.moveTo(e+Math.sin(w)*u,i-Math.cos(w)*b),w+=Zs,n.lineTo(e+Math.sin(w)*u,i-Math.cos(w)*b),w+=Zs,n.lineTo(e+Math.sin(w)*u,i-Math.cos(w)*b),n.closePath();break;case"rectRounded":c=b*.516,l=b-c,o=Math.cos(w+Oe)*l,d=Math.cos(w+Oe)*(s?s/2-c:l),a=Math.sin(w+Oe)*l,h=Math.sin(w+Oe)*(s?s/2-c:l),n.arc(e-d,i-a,c,w-ut,w-Ct),n.arc(e+h,i-o,c,w-Ct,w),n.arc(e+d,i+a,c,w,w+Ct),n.arc(e-h,i+o,c,w+Ct,w+ut),n.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*b,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}w+=Oe;case"rectRot":d=Math.cos(w)*(s?s/2:b),o=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(s?s/2:b),n.moveTo(e-d,i-a),n.lineTo(e+h,i-o),n.lineTo(e+d,i+a),n.lineTo(e-h,i+o),n.closePath();break;case"crossRot":w+=Oe;case"cross":d=Math.cos(w)*(s?s/2:b),o=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(s?s/2:b),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o);break;case"star":d=Math.cos(w)*(s?s/2:b),o=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(s?s/2:b),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o),w+=Oe,d=Math.cos(w)*(s?s/2:b),o=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(s?s/2:b),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o);break;case"line":o=s?s/2:Math.cos(w)*b,a=Math.sin(w)*b,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(w)*(s?s/2:b),i+Math.sin(w)*b);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function en(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 Gi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ki(n){n.restore()}function rp(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function op(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 ap(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),st(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 lp(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function cp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Yn(n,t,e,i,s,r={}){const o=bt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,ap(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&cp(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),st(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),lp(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function ui(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*ut,ut,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ut,Ct,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Ct,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Ct,!0),n.lineTo(e+o.topLeft,i)}const up=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,dp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function hp(n,t){const e=(""+n).match(up);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 fp=n=>+n||0;function Lo(n,t){const e={},i=lt(t),s=i?Object.keys(t):t,r=lt(n)?i?o=>it(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=fp(r(o));return e}function Dc(n){return Lo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function _n(n){return Lo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function jt(n){const t=Dc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Et(n,t){n=n||{},t=t||Ot.font;let e=it(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=it(n.style,t.style);i&&!(""+i).match(dp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:it(n.family,t.family),lineHeight:hp(it(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:it(n.weight,t.weight),string:""};return s.string=ip(s),s}function Zi(n,t,e,i){let s,r,o;for(s=0,r=n.length;s<r;++s)if(o=n[s],o!==void 0&&o!==void 0)return o}function gp(n,t,e){const{min:i,max:s}=n,r=rc(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function xn(n,t){return Object.assign(Object.create(n),t)}function Io(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Ec("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Io([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return Cc(a,l,()=>vp(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Ac(a).includes(l)},ownKeys(a){return Ac(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function di(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Tc(n,i),setContext:r=>di(n,r,e,i),override:r=>di(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return Cc(r,o,()=>mp(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Tc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:fe(e)?e:()=>e,isIndexable:fe(i)?i:()=>i}}const pp=(n,t)=>n?n+ko(t):t,No=(n,t)=>lt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Cc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function mp(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return fe(a)&&o.isScriptable(t)&&(a=yp(t,a,n,e)),bt(a)&&a.length&&(a=bp(t,a,n,o.isIndexable)),No(t,a)&&(a=di(a,s,r&&r[t],o)),a}function yp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),No(n,l)&&(l=Fo(s._scopes,s,n,l)),l}function bp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(lt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Fo(c,s,n,u);t.push(di(d,r,o&&o[n],a))}}return t}function Oc(n,t,e){return fe(n)?n(t,e):n}const _p=(n,t)=>n===!0?t:typeof n=="string"?mn(t,n):void 0;function xp(n,t,e,i,s){for(const r of t){const o=_p(e,r);if(o){n.add(o);const a=Oc(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Fo(n,t,e,i){const s=t._rootScopes,r=Oc(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Pc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Pc(a,o,r,l,i),l===null)?!1:Io(Array.from(a),[""],s,r,()=>wp(t,e,i))}function Pc(n,t,e,i,s){for(;e;)e=xp(n,t,e,i,s);return e}function wp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return bt(s)&&lt(e)?e:s||{}}function vp(n,t,e,i){let s;for(const r of t)if(s=Ec(pp(r,n),e),typeof s<"u")return No(n,s)?Fo(e,i,n,s):s}function Ec(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Ac(n){let t=n._keys;return t||(t=n._keys=Mp(n._scopes)),t}function Mp(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Rc(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(mn(u,r),c)};return o}const Sp=Number.EPSILON||1e-14,hi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Lc=n=>n==="x"?"y":"x";function kp(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=ci(r,s),l=ci(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function Dp(n,t,e){const i=n.length;let s,r,o,a,l,c=hi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=hi(n,u+1),!(!l||!c)){if(Vi(t[u],0,Sp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function Tp(n,t,e="x"){const i=Lc(e),s=n.length;let r,o,a,l=hi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=hi(n,c+1),!a)continue;const u=a[e],d=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=d+r*t[c])}}function Cp(n,t="x"){const e=Lc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=hi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=hi(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?je(s[o-1])!==je(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Dp(n,s,r),Tp(n,r,t)}function ir(n,t,e){return Math.max(Math.min(n,e),t)}function Op(n,t){let e,i,s,r,o,a=en(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&en(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=ir(s.cp1x,t.left,t.right),s.cp1y=ir(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=ir(s.cp2x,t.left,t.right),s.cp2y=ir(s.cp2y,t.top,t.bottom)))}function Pp(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Cp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=kp(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Op(n,e)}function zo(){return typeof window<"u"&&typeof document<"u"}function Bo(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function sr(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 rr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Ep(n,t){return rr(n).getPropertyValue(t)}const Ap=["top","right","bottom","left"];function jn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Ap[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Rp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Lp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Rp(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function wn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=rr(e),r=s.boxSizing==="border-box",o=jn(s,"padding"),a=jn(s,"border","width"),{x:l,y:c,box:u}=Lp(n,e),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:g,height:m}=t;return r&&(g-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-h)/m*e.height/i)}}function Ip(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Bo(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=rr(r),l=jn(a,"border","width"),c=jn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=sr(a.maxWidth,r,"clientWidth"),s=sr(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Ks,maxHeight:s||Ks}}const or=n=>Math.round(n*10)/10;function Np(n,t,e,i){const s=rr(n),r=jn(s,"margin"),o=sr(s.maxWidth,n,"clientWidth")||Ks,a=sr(s.maxHeight,n,"clientHeight")||Ks,l=Ip(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=jn(s,"border","width"),g=jn(s,"padding");c-=g.width+h.width,u-=g.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=or(Math.min(c,o,l.maxWidth)),u=or(Math.min(u,a,l.maxHeight)),c&&!u&&(u=or(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=or(Math.floor(u*i))),{width:c,height:u}}function Ic(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Fp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};zo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Nc(n,t){const e=Ep(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function zp(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 Bp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Vn(n,s,e),a=Vn(s,r,e),l=Vn(r,t,e),c=Vn(o,a,e),u=Vn(a,l,e);return Vn(c,u,e)}const Hp=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}}},Wp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function fi(n,t,e){return n?Hp(t,e):Wp()}function Fc(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 zc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Bc(n){return n==="angle"?{between:$i,compare:Yg,normalize:De}:{between:Je,compare:(t,e)=>t-e,normalize:t=>t}}function Hc({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Yp(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=Bc(i),l=t.length;let{start:c,end:u,loop:d}=n,h,g;if(d){for(c+=l,u+=l,h=0,g=l;h<g&&o(a(t[c%l][i]),s,r);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Wc(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=Bc(i),{start:u,end:d,loop:h,style:g}=Yp(n,t,e),m=[];let b=!1,w=null,v,S,D;const k=()=>l(s,D,v)&&a(s,D)!==0,T=()=>a(r,v)===0||l(r,D,v),A=()=>b||k(),E=()=>!b||T();for(let p=u,_=u;p<=d;++p)S=t[p%o],!S.skip&&(v=c(S[i]),v!==D&&(b=l(v,s,r),w===null&&A()&&(w=a(v,s)===0?p:_),w!==null&&E()&&(m.push(Hc({start:w,end:p,loop:h,count:o,style:g})),w=null),_=p,D=v));return w!==null&&m.push(Hc({start:w,end:d,loop:h,count:o,style:g})),m}function Yc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=Wc(i[s],n.points,t);r.length&&e.push(...r)}return e}function jp(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Vp(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function $p(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=jp(e,s,r,i);if(i===!0)return jc(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return jc(n,Vp(e,o,l,c),e,t)}function jc(n,t,e,i){return!i||!i.setContext||!e?t:Up(n,t,e,i)}function Up(n,t,e,i){const s=n._chart.getContext(),r=Vc(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,h=d;function g(m,b,w,v){const S=a?-1:1;if(m!==b){for(m+=l;e[m%l].skip;)m-=S;for(;e[b%l].skip;)b+=S;m%l!==b%l&&(c.push({start:m%l,end:b%l,loop:w,style:v}),u=v,d=b%l)}}for(const m of t){d=a?d:m.start;let b=e[d%l],w;for(h=d+1;h<=m.end;h++){const v=e[h%l];w=Vc(i.setContext(xn(s,{type:"segment",p0:b,p1:v,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),qp(w,u)&&g(d,h-1,m.loop,u),b=v,u=w}d<h-1&&g(d,h-1,m.loop,u)}return c}function Vc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function qp(n,t){if(!t)return!1;const e=[],i=function(s,r){return Oo(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
12
12
  * Chart.js v4.4.5
13
13
  * https://www.chartjs.org
14
14
  * (c) 2024 Chart.js Contributors
15
15
  * Released under the MIT License
16
- */class Hg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Go.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Fe=new Hg;const Sl="transparent",Wg={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=el(n||Sl),s=i.valid&&el(t||Sl);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Yg{constructor(t,e,i,s){const r=e[i];s=_i([t.to,s,r,t.from]);const a=_i([t.from,r,s]);this._active=!0,this._fn=t.fn||Wg[t.type||typeof a],this._easing=pi[t.easing]||pi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=_i([t.to,e,s,t.from]),this._from=_i([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class jr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!nt(t))return;const e=Object.keys(_t.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!nt(r))return;const a={};for(const o of e)a[o]=r[o];(ut(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=Vg(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&jg(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,o);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new Yg(h,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Fe.add(this._chart,i),!0}}function jg(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Vg(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 Dl(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function $g(n,t,e){if(e===!1)return!1;const i=Dl(n,e),s=Dl(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Ug(n){let t,e,i,s;return nt(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function Tl(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function Cl(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t!==null){for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(i.all)continue;break}c=n.values[l],Mt(c)&&(r||t===0||De(t)===De(c))&&(t+=c)}return t}}function qg(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function Vr(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Xg(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Gg(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Kg(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Pl(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function Ol(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Xg(r,a,i),d=t.length;let h;for(let g=0;g<d;++g){const m=t[g],{[l]:b,[c]:_}=m,w=m._stacks||(m._stacks={});h=w[c]=Kg(s,u,b),h[o]=_,h._top=Pl(h,a,!0,i.type),h._bottom=Pl(h,a,!1,i.type);const M=h._visualValues||(h._visualValues={});M[o]=_}}function $r(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Zg(n,t){return nn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Qg(n,t,e){return nn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function wi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const Ur=n=>n==="reset"||n==="none",El=(n,t)=>t?n:Object.assign({},n),Jg=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Tl(e,!0),values:null};class we{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=Vr(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&&wi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,h,g,m)=>d==="x"?h:d==="r"?m:g,r=e.xAxisID=Q(i.xAxisID,$r(t,"x")),a=e.yAxisID=Q(i.yAxisID,$r(t,"y")),o=e.rAxisID=Q(i.rAxisID,$r(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&qo(this._data,this),t._stacked&&wi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(nt(e)){const s=this._cachedMeta;this._data=qg(e,s)}else if(i!==e){if(i){qo(i,this);const s=this._cachedMeta;wi(s),s._parsed=[]}e&&Object.isExtensible(e)&&zf(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Vr(e.vScale,e),e.stack!==i.stack&&(s=!0,wi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Ol(this,e._parsed),e._stacked=Vr(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:a}=i,o=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{ut(s[t])?h=this.parseArrayData(i,s,t,e):nt(s[t])?h=this.parseObjectData(i,s,t,e):h=this.parsePrimitiveData(i,s,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=h[u],l&&(g()&&(l=!1),c=d);i._sorted=l}a&&Ol(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,d=new Array(s);let h,g,m;for(h=0,g=s;h<g;++h)m=h+i,d[h]={[o]:u||r.parse(c[m],m),[l]:a.parse(e[m],m)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],o[l]={x:r.parse(d[0],u),y:a.parse(d[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,h,g;for(u=0,d=s;u<d;++u)h=u+i,g=e[h],c[u]={x:r.parse(Qe(g,o),h),y:a.parse(Qe(g,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,a=e[t.axis],o={keys:Tl(s,!0),values:e._stacks[t.axis]._visualValues};return Cl(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=Cl(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=Jg(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Gg(o);let h,g;function m(){g=s[h];const b=g[o.axis];return!Mt(g[t.axis])||u>b||d<b}for(h=0;h<a&&!(!m()&&(this.updateRangeFromParsed(c,t,g,l),r));++h);if(r){for(h=a-1;h>=0;--h)if(!m()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],Mt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Ug(Q(this.options.clip,$g(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const d=s[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,r))}for(u=0;u<a.length;++u)a[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];r=a.$context||(a.$context=Qg(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Zg(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&Jt(i);if(o)return El(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(_t.elements[t]),m=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(h,g,m,d);return b.$shared&&(b.$shared=l,r[a]=Object.freeze(El(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new jr(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ur(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){Ur(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ur(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&wi(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}C(we,"defaults",{}),C(we,"datasetElementType",null),C(we,"dataElementType",null);function tp(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Xo(i.sort((s,r)=>s-r))}return n._cache.$bar}function ep(n){const t=n.iScale,e=tp(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(Jt(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function np(n,t,e,i){const s=e.barThickness;let r,a;return J(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function ip(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function sp(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function Rl(n,t,e,i){return ut(n)?sp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Al(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[s.axis]=o||s.parse(a[c],c),l.push(Rl(h,d,r,c));return l}function qr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function rp(n,t,e){return n!==0?De(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function ap(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function op(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:l,top:c,bottom:u}=ap(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[Ll(u,a,o,l)]=!0,s=c)),r[Ll(s,a,o,l)]=!0,n.borderSkipped=r}function Ll(n,t,e,i){return i?(n=lp(n,t,e),n=Il(n,e,t)):n=Il(n,t,e),n}function lp(n,t,e){return n===t?e:n===e?t:n}function Il(n,t,e){return n==="start"?t:n==="end"?e:n}function cp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class vi extends we{parsePrimitiveData(t,e,i,s){return Al(t,e,i,s)}parseArrayData(t,e,i,s){return Al(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,d=[];let h,g,m,b;for(h=i,g=i+s;h<g;++h)b=e[h],m={},m[r.axis]=r.parse(Qe(b,c),h),d.push(Rl(Qe(b,u),m,a,h));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),a=r._custom,o=qr(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const m=this.getParsed(g),b=r||J(m[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),_=this._calculateBarIndexPixels(g,u),w=(m._stacks||{})[o.axis],M={horizontal:c,base:b.base,enableBorderRadius:!w||qr(m._custom)||a===w._top||a===w._bottom,x:c?b.head:_.center,y:c?_.center:b.head,height:c?_.size:Math.abs(b.size),width:c?Math.abs(b.size):_.size};h&&(M.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const S=M.options||t[g].options;op(M,S,w,a),cp(M,S,u.ratio),this.updateElement(t[g],g,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),l=o&&o[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),h=d&&d[u.vScale.axis];if(J(h)||isNaN(h))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||ep(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=qr(c);let d=l[e.axis],h=0,g=i?this.applyStack(e,l,i):d,m,b;g!==d&&(h=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&De(d)!==De(c.barEnd)&&(h=0),h+=d);const _=!J(r)&&!u?r:h;let w=e.getPixelForValue(_);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(h+g):m=w,b=m-w,Math.abs(b)<a){b=rp(b,e,o)*a,d===o&&(w-=b/2);const M=e.getPixelForDecimal(0),S=e.getPixelForDecimal(1),k=Math.min(M,S),D=Math.max(M,S);w=Math.max(Math.min(w,D),k),m=w+b,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(m)-e.getValueForPixel(w))}if(w===e.getPixelForValue(o)){const M=De(b)*e.getLineWidthForValue(o)/2;w+=M,b-=M}return{size:b,base:w,head:m,center:m+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=Q(s.maxBarThickness,1/0);let o,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?ip(t,e,s,c):np(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}C(vi,"id","bar"),C(vi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),C(vi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ws extends we{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=Q(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=Q(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,d=o.axis;for(let h=e;h<e+i;h++){const g=t[h],m=!r&&this.getParsed(h),b={},_=b[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(m[u]),w=b[d]=r?o.getBasePixel():o.getPixelForValue(m[d]);b.skip=isNaN(_)||isNaN(w),c&&(b.options=l||this.resolveDataElementOptions(h,g.active?"active":s),r&&(b.options.radius=0)),this.updateElement(g,h,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=Q(i&&i._custom,r),s}}C(ws,"id","bubble"),C(ws,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),C(ws,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function up(n,t,e){let i=1,s=1,r=0,a=0;if(t<bt){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),h=Math.sin(l),g=(S,k,D)=>gi(S,o,l,!0)?1:Math.max(k,k*e,D,D*e),m=(S,k,D)=>gi(S,o,l,!0)?-1:Math.min(k,k*e,D,D*e),b=g(0,c,d),_=g(xt,u,h),w=m(rt,c,d),M=m(rt+xt,u,h);i=(b-w)/2,s=(_-M)/2,r=-(b+w)/2,a=-(_+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class ze extends we{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(nt(i[t])){const{key:l="value"}=this._parsing;r=c=>+Qe(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return Ft(this.options.rotation-90)}_getCircumference(){return Ft(this.options.circumference)}_getRotationExtents(){let t=bt,e=-bt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(Sf(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:m,offsetY:b}=up(d,u,l),_=(i.width-a)/h,w=(i.height-a)/g,M=Math.max(Math.min(_,w)/2,0),S=Bo(this.options.radius,M),k=Math.max(S*l,0),D=(S-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*S,this.offsetY=b*S,s.total=this.calculateTotal(),this.outerRadius=S-D*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-D*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/bt)}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,h=r&&c.animateScale,g=h?0:this.innerRadius,m=h?0:this.outerRadius,{sharedOptions:b,includeOptions:_}=this._getSharedOptions(e,s);let w=this._getRotation(),M;for(M=0;M<e;++M)w+=this._circumference(M,r);for(M=e;M<e+i;++M){const S=this._circumference(M,r),k=t[M],D={x:u+this.offsetX,y:d+this.offsetY,startAngle:w,endAngle:w+S,circumference:S,outerRadius:m,innerRadius:g};_&&(D.options=b||this.resolveDataElementOptions(M,k.active?"active":s)),w+=S,this.updateElement(k,M,D,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?bt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=mi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Q(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}C(ze,"id","doughnut"),C(ze,"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"}),C(ze,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),C(ze,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Mi extends we{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=Zo(e,s,a);this._drawStart=o,this._drawCount=l,Qo(e)&&(o=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),h=a.axis,g=o.axis,{spanGaps:m,segment:b}=this.options,_=tn(m)?m:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||r||s==="none",M=e+i,S=t.length;let k=e>0&&this.getParsed(e-1);for(let D=0;D<S;++D){const O=t[D],P=w?O:{};if(D<e||D>=M){P.skip=!0;continue}const p=this.getParsed(D),x=J(p[g]),T=P[h]=a.getPixelForValue(p[h],D),E=P[g]=r||x?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,p,l):p[g],D);P.skip=isNaN(T)||isNaN(E)||x,P.stop=D>0&&Math.abs(p[h]-k[h])>_,b&&(P.parsed=p,P.raw=c.data[D]),d&&(P.options=u||this.resolveDataElementOptions(D,O.active?"active":s)),w||this.updateElement(O,D,P,s),k=p}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}C(Mi,"id","line"),C(Mi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),C(Mi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ki extends we{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=mi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return fl.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*rt;let g=h,m;const b=360/this.countVisibleElements();for(m=0;m<e;++m)g+=this._computeAngle(m,s,b);for(m=e;m<e+i;m++){const _=t[m];let w=g,M=g+this._computeAngle(m,s,b),S=a.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;g=M,r&&(l.animateScale&&(S=0),l.animateRotate&&(w=M=h));const k={x:u,y:d,innerRadius:0,outerRadius:S,startAngle:w,endAngle:M,options:this.resolveDataElementOptions(m,_.active?"active":s)};this.updateElement(_,m,k,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ft(this.resolveDataElementOptions(t,e).angle||i):0}}C(ki,"id","polarArea"),C(ki,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),C(ki,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Xr extends ze{}C(Xr,"id","pie"),C(Xr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class vs extends we{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return fl.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),d=a?r.xCenter:u.x,h=a?r.yCenter:u.y,g={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,o,g,s)}}}C(vs,"id","radar"),C(vs,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),C(vs,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ms extends we{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=Zo(e,i,s);if(this._drawStart=r,this._drawCount=a,Qo(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),h=this.includeOptions(s,d),g=a.axis,m=o.axis,{spanGaps:b,segment:_}=this.options,w=tn(b)?b:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let S=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const D=t[k],O=this.getParsed(k),P=M?D:{},p=J(O[m]),x=P[g]=a.getPixelForValue(O[g],k),T=P[m]=r||p?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,O,l):O[m],k);P.skip=isNaN(x)||isNaN(T)||p,P.stop=k>0&&Math.abs(O[g]-S[g])>w,_&&(P.parsed=O,P.raw=c.data[k]),h&&(P.options=d||this.resolveDataElementOptions(k,D.active?"active":s)),M||this.updateElement(D,k,P,s),S=O}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}C(Ms,"id","scatter"),C(Ms,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),C(Ms,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var dp=Object.freeze({__proto__:null,BarController:vi,BubbleController:ws,DoughnutController:ze,LineController:Mi,PieController:Xr,PolarAreaController:ki,RadarController:vs,ScatterController:Ms});function Mn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gr{constructor(t){C(this,"options");this.options=t||{}}static override(t){Object.assign(Gr.prototype,t)}init(){}formats(){return Mn()}parse(){return Mn()}format(){return Mn()}add(){return Mn()}diff(){return Mn()}startOf(){return Mn()}endOf(){return Mn()}}var Nl={_date:Gr};function hp(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const l=o._reversePixels?Nf:Ie;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),h=l(r,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Si(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:d,hi:h}=hp(r[o],t,a,s);for(let g=d;g<=h;++g){const m=u[g];m.skip||i(m,c,g)}}}function fp(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function Kr(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||Si(n,e,t,function(o,l,c){!s&&!Ne(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function gp(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:d}=fs(a,{x:t.x,y:t.y});gi(d,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return Si(n,e,t,r),s}function pp(n,t,e,i,s,r){let a=[];const o=fp(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const m=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(m))&&!g)return;const _=o(t,m);_<l?(a=[{element:u,datasetIndex:d,index:h}],l=_):_===l&&a.push({element:u,datasetIndex:d,index:h})}return Si(n,e,t,c),a}function Zr(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?gp(n,t,e,s):pp(n,t,e,i,s,r)}function Fl(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return Si(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var Qr={evaluateInteractionItems:Si,modes:{index(n,t,e,i){const s=sn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?Kr(n,s,r,i,a):Zr(n,s,r,!1,i,a),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 s=sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?Kr(n,s,r,i,a):Zr(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return Kr(n,s,r,i,a)},nearest(n,t,e,i){const s=sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return Zr(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=sn(t,n);return Fl(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=sn(t,n);return Fl(n,s,"y",e.intersect,i)}}};const zl=["left","top","right","bottom"];function Di(n,t){return n.filter(e=>e.pos===t)}function Bl(n,t){return n.filter(e=>zl.indexOf(e.pos)===-1&&e.box.axis===t)}function Ti(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function mp(n){const t=[];let e,i,s,r,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function yp(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!zl.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function bp(n,t){const e=yp(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function xp(n){const t=mp(n),e=Ti(t.filter(c=>c.box.fullSize),!0),i=Ti(Di(t,"left"),!0),s=Ti(Di(t,"right")),r=Ti(Di(t,"top"),!0),a=Ti(Di(t,"bottom")),o=Bl(t,"x"),l=Bl(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:Di(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function Hl(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Wl(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:s,box:r}=e,a=n.maxPadding;if(!nt(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&Wl(a,r.getPadding());const o=Math.max(0,t.outerWidth-Hl(a,n,"left","right")),l=Math.max(0,t.outerHeight-Hl(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function wp(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function vp(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function Ci(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,vp(o.horizontal,t));const{same:d,other:h}=_p(t,e,o,i);c|=d&&s.length,u=u||h,l.fullSize||s.push(o)}return c&&Ci(s,t,e,i)||u}function ks(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Yl(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,h=c.size||l.height;Jt(c.start)&&(a=c.start),l.fullSize?ks(l,s.left,a,e.outerWidth-s.right-s.left,h):ks(l,t.left+c.placed,a,d,h),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,h=c.size||l.width;Jt(c.start)&&(r=c.start),l.fullSize?ks(l,r,s.top,h,e.outerHeight-s.bottom-s.top):ks(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=a}var $t={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=zt(n.options.layout.padding),r=Math.max(t-s.width,0),a=Math.max(e-s.height,0),o=xp(n.boxes),l=o.vertical,c=o.horizontal;ft(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,_)=>_.box.options&&_.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},s);Wl(h,zt(i));const g=Object.assign({maxPadding:h,w:r,h:a,x:s.left,y:s.top},s),m=bp(l.concat(c),d);Ci(o.fullSize,g,d,m),Ci(l,g,d,m),Ci(c,g,d,m)&&Ci(l,g,d,m),wp(g),Yl(o.leftAndTop,g,d,m),g.x+=g.w,g.y+=g.h,Yl(o.rightAndBottom,g,d,m),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},ft(o.chartArea,b=>{const _=b.box;Object.assign(_,n.chartArea),_.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class jl{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Mp extends jl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ss="$chartjs",kp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vl=n=>n===null||n==="";function Sp(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Ss]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Vl(s)){const r=ml(n,"width");r!==void 0&&(n.width=r)}if(Vl(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=ml(n,"height");r!==void 0&&(n.height=r)}return n}const $l=Pg?{passive:!0}:!1;function Dp(n,t,e){n&&n.addEventListener(t,e,$l)}function Tp(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,$l)}function Cp(n,t){const e=kp[n.type]||n.type,{x:i,y:s}=sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Ds(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Pp(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Ds(o.addedNodes,i),a=a&&!Ds(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Op(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Ds(o.removedNodes,i),a=a&&!Ds(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Pi=new Map;let Ul=0;function ql(){const n=window.devicePixelRatio;n!==Ul&&(Ul=n,Pi.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Ep(n,t){Pi.size||window.addEventListener("resize",ql),Pi.set(n,t)}function Rp(n){Pi.delete(n),Pi.size||window.removeEventListener("resize",ql)}function Ap(n,t,e){const i=n.canvas,s=i&&Yr(i);if(!s)return;const r=Ko((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),Ep(n,r),a}function Jr(n,t,e){e&&e.disconnect(),t==="resize"&&Rp(n)}function Lp(n,t,e){const i=n.canvas,s=Ko(r=>{n.ctx!==null&&e(Cp(r,n))},n);return Dp(i,t,s),s}class Ip extends jl{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Sp(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ss])return!1;const i=e[Ss].initial;["height","width"].forEach(r=>{const a=i[r];J(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Ss],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Pp,detach:Op,resize:Ap}[e]||Lp;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Jr,detach:Jr,resize:Jr}[e]||Tp)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Cg(t,e,i,s)}isAttached(t){const e=t&&Yr(t);return!!(e&&e.isConnected)}}function Np(n){return!Wr()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Mp:Ip}class Yt{constructor(){C(this,"x");C(this,"y");C(this,"active",!1);C(this,"options");C(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return tn(this.x)&&tn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}C(Yt,"defaults",{}),C(Yt,"defaultRoutes");function Fp(n,t){const e=n.options.ticks,i=zp(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Hp(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return Wp(t,c,r,a/s),c;const u=Bp(r,t,s);if(a>0){let d,h;const g=a>1?Math.round((l-o)/(a-1)):null;for(Ts(t,c,u,J(g)?0:o-g,o),d=0,h=a-1;d<h;d++)Ts(t,c,u,r[d],r[d+1]);return Ts(t,c,u,l,J(g)?t.length:l+g),c}return Ts(t,c,u),c}function zp(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Bp(n,t,e){const i=Yp(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Rf(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function Hp(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Wp(n,t,e,i){let s=0,r=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function Ts(n,t,e,i,s){const r=Q(i,0),a=Math.min(Q(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*e))}function Yp(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 jp=n=>n==="left"?"right":n==="right"?"left":n,Xl=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Gl=(n,t)=>Math.min(t||n,n);function Kl(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function Vp(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function $p(n,t){ft(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function Oi(n){return n.drawTicks?n.tickLength:0}function Zl(n,t){if(!n.display)return 0;const e=kt(n.font,t),i=zt(n.padding);return(ut(n.text)?n.text.length:1)*e.lineHeight+i.height}function Up(n,t){return nn(n,{scale:t,type:"scale"})}function qp(n,t,e){return nn(n,{tick:e,index:t,type:"tick"})}function Xp(n,t,e){let i=Er(n);return(e&&t!=="right"||!e&&t==="right")&&(i=jp(i)),i}function Gp(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,g,m;const b=a-s,_=o-r;if(n.isHorizontal()){if(g=Vt(i,r,o),nt(e)){const w=Object.keys(e)[0],M=e[w];m=u[w].getPixelForValue(M)+b-t}else e==="center"?m=(c.bottom+c.top)/2+b-t:m=Xl(n,e,t);h=o-r}else{if(nt(e)){const w=Object.keys(e)[0],M=e[w];g=u[w].getPixelForValue(M)-_+t}else e==="center"?g=(c.left+c.right)/2-_+t:g=Xl(n,e,t);m=Vt(i,a,s),d=e==="left"?-xt:xt}return{titleX:g,titleY:m,maxWidth:h,rotation:d}}class kn extends Yt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=ce(t,Number.POSITIVE_INFINITY),e=ce(e,Number.NEGATIVE_INFINITY),i=ce(i,Number.POSITIVE_INFINITY),s=ce(s,Number.NEGATIVE_INFINITY),{min:ce(t,i),max:ce(e,s),minDefined:Mt(t),maxDefined:Mt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:ce(e,ce(i,e)),max:ce(i,ce(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(){ht(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ag(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Kl(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Fp(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(){ht(this.options.afterUpdate,[this])}beforeSetDimensions(){ht(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(){ht(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ht(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ht(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=ht(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Gl(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=Wt(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-Oi(t.grid)-e.padding-Zl(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),a=hs(Math.min(Math.asin(Wt((u.highest.height+6)/o,-1,1)),Math.asin(Wt(l/c,-1,1))-Math.asin(Wt(h/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ht(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=Zl(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=Oi(r)+l):(t.height=this.maxHeight,t.width=Oi(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=i.padding*2,m=Ft(this.labelRotation),b=Math.cos(m),_=Math.sin(m);if(o){const w=i.mirror?0:_*d.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+w+g)}else{const w=i.mirror?0:b*d.width+_*h.height;t.width=Math.min(this.maxWidth,t.width+w+g)}this._calculatePadding(c,u,_,b)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:a},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,g=0;l?c?(h=s*t.width,g=i*e.height):(h=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,g=e.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+a)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ht(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++)J(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=Kl(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,a=[],o=[],l=Math.floor(e/Gl(e,i));let c=0,u=0,d,h,g,m,b,_,w,M,S,k,D;for(d=0;d<e;d+=l){if(m=t[d].label,b=this._resolveTickFontOptions(d),s.font=_=b.string,w=r[_]=r[_]||{data:{},gc:[]},M=b.lineHeight,S=k=0,!J(m)&&!ut(m))S=ms(s,w.data,w.gc,S,m),k=M;else if(ut(m))for(h=0,g=m.length;h<g;++h)D=m[h],!J(D)&&!ut(D)&&(S=ms(s,w.data,w.gc,S,D),k+=M);a.push(S),o.push(k),c=Math.max(S,c),u=Math.max(k,u)}$p(r,e);const O=a.indexOf(c),P=o.indexOf(u),p=x=>({width:a[x]||0,height:o[x]||0});return{first:p(0),last:p(e-1),widest:p(O),highest:p(P),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return If(this._alignToPixels?xn(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=qp(this.getContext(),t,i))}return this.$context||(this.$context=Up(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ft(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:a,border:o}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=Oi(r),g=[],m=o.setContext(this.getContext()),b=m.display?m.width:0,_=b/2,w=function(j){return xn(i,j,b)};let M,S,k,D,O,P,p,x,T,E,A,L;if(a==="top")M=w(this.bottom),P=this.bottom-h,x=M-_,E=w(t.top)+_,L=t.bottom;else if(a==="bottom")M=w(this.top),E=t.top,L=w(t.bottom)-_,P=M+_,x=this.top+h;else if(a==="left")M=w(this.right),O=this.right-h,p=M-_,T=w(t.left)+_,A=t.right;else if(a==="right")M=w(this.left),T=t.left,A=w(t.right)-_,O=M+_,p=this.left+h;else if(e==="x"){if(a==="center")M=w((t.top+t.bottom)/2+.5);else if(nt(a)){const j=Object.keys(a)[0],N=a[j];M=w(this.chart.scales[j].getPixelForValue(N))}E=t.top,L=t.bottom,P=M+_,x=P+h}else if(e==="y"){if(a==="center")M=w((t.left+t.right)/2);else if(nt(a)){const j=Object.keys(a)[0],N=a[j];M=w(this.chart.scales[j].getPixelForValue(N))}O=M-_,p=O-h,T=t.left,A=t.right}const F=Q(s.ticks.maxTicksLimit,d),U=Math.max(1,Math.ceil(d/F));for(S=0;S<d;S+=U){const j=this.getContext(S),N=r.setContext(j),st=o.setContext(j),B=N.lineWidth,Rt=N.color,wt=st.dash||[],Y=st.dashOffset,I=N.tickWidth,W=N.tickColor,$=N.tickBorderDash||[],X=N.tickBorderDashOffset;k=Vp(this,S,l),k!==void 0&&(D=xn(i,k,B),c?O=p=T=A=D:P=x=E=L=D,g.push({tx1:O,ty1:P,tx2:p,ty2:x,x1:T,y1:E,x2:A,y2:L,width:B,color:Rt,borderDash:wt,borderDashOffset:Y,tickWidth:I,tickColor:W,tickBorderDash:$,tickBorderDashOffset:X}))}return this._ticksLength=d,this._borderValue=M,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,h=Oi(i.grid),g=h+u,m=d?-u:g,b=-Ft(this.labelRotation),_=[];let w,M,S,k,D,O,P,p,x,T,E,A,L="middle";if(s==="top")O=this.bottom-m,P=this._getXAxisLabelAlignment();else if(s==="bottom")O=this.top+m,P=this._getXAxisLabelAlignment();else if(s==="left"){const U=this._getYAxisLabelAlignment(h);P=U.textAlign,D=U.x}else if(s==="right"){const U=this._getYAxisLabelAlignment(h);P=U.textAlign,D=U.x}else if(e==="x"){if(s==="center")O=(t.top+t.bottom)/2+g;else if(nt(s)){const U=Object.keys(s)[0],j=s[U];O=this.chart.scales[U].getPixelForValue(j)+g}P=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")D=(t.left+t.right)/2-g;else if(nt(s)){const U=Object.keys(s)[0],j=s[U];D=this.chart.scales[U].getPixelForValue(j)}P=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const F=this._getLabelSizes();for(w=0,M=o.length;w<M;++w){S=o[w],k=S.label;const U=r.setContext(this.getContext(w));p=this.getPixelForTick(w)+r.labelOffset,x=this._resolveTickFontOptions(w),T=x.lineHeight,E=ut(k)?k.length:1;const j=E/2,N=U.color,st=U.textStrokeColor,B=U.textStrokeWidth;let Rt=P;a?(D=p,P==="inner"&&(w===M-1?Rt=this.options.reverse?"left":"right":w===0?Rt=this.options.reverse?"right":"left":Rt="center"),s==="top"?c==="near"||b!==0?A=-E*T+T/2:c==="center"?A=-F.highest.height/2-j*T+T:A=-F.highest.height+T/2:c==="near"||b!==0?A=T/2:c==="center"?A=F.highest.height/2-j*T:A=F.highest.height-E*T,d&&(A*=-1),b!==0&&!U.showLabelBackdrop&&(D+=T/2*Math.sin(b))):(O=p,A=(1-E)*T/2);let wt;if(U.showLabelBackdrop){const Y=zt(U.backdropPadding),I=F.heights[w],W=F.widths[w];let $=A-Y.top,X=0-Y.left;switch(L){case"middle":$-=I/2;break;case"bottom":$-=I;break}switch(P){case"center":X-=W/2;break;case"right":X-=W;break;case"inner":w===M-1?X-=W:w>0&&(X-=W/2);break}wt={left:X,top:$,width:W+Y.width,height:I+Y.height,color:U.backdropColor}}_.push({label:k,font:x,textOffset:A,options:{rotation:b,color:N,strokeColor:st,strokeWidth:B,textAlign:Rt,textBaseline:L,translation:[D,O],backdrop:wt}})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,a=this._getLabelSizes(),o=t+r,l=a.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,a;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=xn(t,this.left,a)-a/2,u=xn(t,this.right,o)+o/2,d=h=l):(d=xn(t,this.top,a)-a/2,h=xn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&bi(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;_n(i,c,0,u,l,o)}s&&xi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=kt(i.font),a=zt(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||nt(e)?(l+=a.bottom,ut(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=Gp(this,l,e,o);_n(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:h,textAlign:Xp(o,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Q(t.grid&&t.grid.z,-1),s=Q(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==kn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return kt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Cs{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;Qp(e)&&(i=this.register(e));const s=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Kp(t,a,i),this.override&&_t.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in _t[s]&&(delete _t[s][i],this.override&&delete bn[i])}}function Kp(n,t,e){const i=di(Object.create(null),[e?_t.get(e):{},_t.get(t),n.defaults]);_t.set(t,i),n.defaultRoutes&&Zp(t,n.defaultRoutes),n.descriptors&&_t.describe(t,n.descriptors)}function Zp(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),a=t[e].split("."),o=a.pop(),l=a.join(".");_t.route(r,s,l,o)})}function Qp(n){return"id"in n&&"defaults"in n}class Jp{constructor(){this.controllers=new Cs(we,"datasets",!0),this.elements=new Cs(Yt,"elements"),this.plugins=new Cs(Object,"plugins"),this.scales=new Cs(kn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):ft(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=Cr(t);ht(i["before"+s],[],i),e[t](i),ht(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Te=new Jp;class tm{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(ht(o,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){J(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=Q(i.options&&i.options.plugins,{}),r=em(i);return s===!1&&!e?[]:im(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function em(n){const t={},e=[],i=Object.keys(Te.plugins.items);for(let r=0;r<i.length;r++)e.push(Te.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function nm(n,t){return!t&&n===!1?null:n===!0?{}:n}function im(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=nm(i[l],s);c!==null&&r.push({plugin:o,options:sm(n.config,{plugin:o,local:e[l]},c,a)})}return r}function sm(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ta(n,t){const e=_t.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function rm(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function am(n,t){return n===t?"_index_":"_value_"}function Ql(n){if(n==="x"||n==="y"||n==="r")return n}function om(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ea(n,...t){if(Ql(n))return n;for(const e of t){const i=e.axis||om(e.position)||n.length>1&&Ql(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Jl(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function lm(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 Jl(n,"x",e[0])||Jl(n,"y",e[0])}return{}}function cm(n,t){const e=bn[n.type]||{scales:{}},i=t.scales||{},s=ta(n.type,t),r=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!nt(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=ea(a,o,lm(a,n),_t.scales[o.type]),c=am(l,s),u=e.scales||{};r[a]=hi(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||ta(o,t),u=(bn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const h=rm(d,l),g=a[h+"AxisID"]||h;r[g]=r[g]||Object.create(null),hi(r[g],[{axis:h},i[g],u[d]])})}),Object.keys(r).forEach(a=>{const o=r[a];hi(o,[_t.scales[o.type],_t.scale])}),r}function tc(n){const t=n.options||(n.options={});t.plugins=Q(t.plugins,{}),t.scales=cm(n,t)}function ec(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function um(n){return n=n||{},n.data=ec(n.data),tc(n),n}const nc=new Map,ic=new Set;function Ps(n,t){let e=nc.get(n);return e||(e=t(),nc.set(n,e),ic.add(e)),e}const Ei=(n,t,e)=>{const i=Qe(t,e);i!==void 0&&n.add(i)};class dm{constructor(t){this._config=um(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=ec(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(),tc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ps(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ps(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ps(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ps(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ei(l,t,d))),u.forEach(d=>Ei(l,s,d)),u.forEach(d=>Ei(l,bn[r]||{},d)),u.forEach(d=>Ei(l,_t,d)),u.forEach(d=>Ei(l,Lr,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ic.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,bn[e]||{},_t.datasets[e]||{},{type:e},_t,Lr]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=sc(this._resolverCache,t,s);let l=a;if(fm(a,e)){r.$shared=!1,i=te(i)?i():i;const c=this.createResolver(t,i,o);l=jn(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=sc(this._resolverCache,t,i);return nt(e)?jn(r,e,void 0,s):r}}function sc(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:zr(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const hm=n=>nt(n)&&Object.getOwnPropertyNames(n).some(t=>te(n[t]));function fm(n,t){const{isScriptable:e,isIndexable:i}=ol(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(te(o)||hm(o))||a&&ut(o))return!0}return!1}var gm="4.4.5";const pm=["top","bottom","left","right","chartArea"];function rc(n,t){return n==="top"||n==="bottom"||pm.indexOf(n)===-1&&t==="x"}function ac(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function oc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),ht(e&&e.onComplete,[n],t)}function mm(n){const t=n.chart,e=t.options.animation;ht(e&&e.onProgress,[n],t)}function lc(n){return Wr()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Os={},cc=n=>{const t=lc(n);return Object.values(Os).filter(e=>e.canvas===t).pop()};function ym(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function bm(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Es(n,t,e){return n.options.clip?n[e]:t[e]}function xm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Es(e,t,"left"),right:Es(e,t,"right"),top:Es(i,t,"top"),bottom:Es(i,t,"bottom")}:t}let ge=(fn=class{static register(...t){Te.add(...t),uc()}static unregister(...t){Te.remove(...t),uc()}constructor(t,e){const i=this.config=new dm(e),s=lc(t),r=cc(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Np(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=kf(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new tm,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Bf(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Os[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Fe.listen(this,"complete",oc),Fe.listen(this,"progress",mm),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return J(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Te}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return sl(this.canvas,this.ctx),this}stop(){return Fe.stop(this),this}resize(t,e){Fe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,pl(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),ht(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};ft(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=ea(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),ft(r,a=>{const o=a.options,l=o.id,c=ea(l,o),u=Q(o.type,a.dtype);(o.position===void 0||rc(o.position,c)!==rc(a.dposition))&&(o.position=a.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=Te.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),ft(s,(a,o)=>{a||delete i[o]}),ft(i,a=>{$t.configure(this,a,a.options),$t.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(ac("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||ta(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Te.getController(o),{datasetElementType:c,dataElementType:u}=_t.datasets[o];Object.assign(l,{dataElementType:Te.getElement(u),datasetElementType:c&&Te.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){ft(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||ft(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ac("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){ft(this.scales,t=>{$t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Yo(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const a=i==="_removeElements"?-r:r;ym(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Yo(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$t.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],ft(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,te(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Fe.has(this)?this.attached&&!Fe.running(this)&&Fe.start(this):(this.draw(),oc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const a=e[s];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=xm(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&bi(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&xi(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Ne(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Qr.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=nn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);Jt(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Fe.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(),sl(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Os[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};ft(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){ft(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},ft(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!ls(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,a=e,o=this._getActiveElements(t,s,i,a),l=Of(t),c=bm(t,this._lastEvent,i,l);i&&(this._lastEvent=null,ht(r.onHover,[t,o,this],this),l&&ht(r.onClick,[t,o,this],this));const u=!ls(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},C(fn,"defaults",_t),C(fn,"instances",Os),C(fn,"overrides",bn),C(fn,"registry",Te),C(fn,"version",gm),C(fn,"getChart",cc),fn);function uc(){return ft(ge.instances,n=>n._plugins.invalidate())}function _m(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+xt,i-xt),n.closePath(),n.clip()}function wm(n){return Fr(n,["outerStart","outerEnd","innerStart","innerEnd"])}function vm(n,t,e,i){const s=wm(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Wt(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Wt(s.innerStart,0,a),innerEnd:Wt(s.innerEnd,0,a)}}function Un(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Rs(n,t,e,i,s,r){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),h=u>0?u+i+e+c:0;let g=0;const m=s-l;if(i){const U=u>0?u-i:0,j=d>0?d-i:0,N=(U+j)/2,st=N!==0?m*N/(N+i):m;g=(m-st)/2}const b=Math.max(.001,m*d-e/rt)/d,_=(m-b)/2,w=l+_+g,M=s-_-g,{outerStart:S,outerEnd:k,innerStart:D,innerEnd:O}=vm(t,h,d,M-w),P=d-S,p=d-k,x=w+S/P,T=M-k/p,E=h+D,A=h+O,L=w+D/E,F=M-O/A;if(n.beginPath(),r){const U=(x+T)/2;if(n.arc(a,o,d,x,U),n.arc(a,o,d,U,T),k>0){const B=Un(p,T,a,o);n.arc(B.x,B.y,k,T,M+xt)}const j=Un(A,M,a,o);if(n.lineTo(j.x,j.y),O>0){const B=Un(A,F,a,o);n.arc(B.x,B.y,O,M+xt,F+Math.PI)}const N=(M-O/h+(w+D/h))/2;if(n.arc(a,o,h,M-O/h,N,!0),n.arc(a,o,h,N,w+D/h,!0),D>0){const B=Un(E,L,a,o);n.arc(B.x,B.y,D,L+Math.PI,w-xt)}const st=Un(P,w,a,o);if(n.lineTo(st.x,st.y),S>0){const B=Un(P,x,a,o);n.arc(B.x,B.y,S,w-xt,x)}}else{n.moveTo(a,o);const U=Math.cos(x)*d+a,j=Math.sin(x)*d+o;n.lineTo(U,j);const N=Math.cos(T)*d+a,st=Math.sin(T)*d+o;n.lineTo(N,st)}n.closePath()}function Mm(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Rs(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%bt||bt))}return Rs(n,t,e,i,l,s),n.fill(),l}function km(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let m=t.endAngle;if(r){Rs(n,t,e,i,m,s);for(let b=0;b<r;++b)n.stroke();isNaN(o)||(m=a+(o%bt||bt))}g&&_m(n,t,m),r||(Rs(n,t,e,i,m,s),n.stroke())}class Ri extends Yt{constructor(e){super();C(this,"circumference");C(this,"endAngle");C(this,"fullCircles");C(this,"innerRadius");C(this,"outerRadius");C(this,"pixelMargin");C(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:a,distance:o}=fs(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,m=Q(h,c-l),b=gi(a,l,c)&&l!==c,_=m>=bt||b,w=Le(o,u+g,d+g);return _&&w}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+a)/2,h=(o+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>bt?Math.floor(s/bt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(rt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Mm(e,this,u,a,o),km(e,this,u,a,o),e.restore()}}C(Ri,"id","arc"),C(Ri,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),C(Ri,"defaultRoutes",{backgroundColor:"backgroundColor"}),C(Ri,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function dc(n,t,e=t){n.lineCap=Q(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Q(e.borderDash,t.borderDash)),n.lineDashOffset=Q(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Q(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Q(e.borderWidth,t.borderWidth),n.strokeStyle=Q(e.borderColor,t.borderColor)}function Sm(n,t,e){n.lineTo(e.x,e.y)}function Dm(n){return n.stepped?Zf:n.tension||n.cubicInterpolationMode==="monotone"?Qf:Sm}function hc(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Tm(n,t,e,i){const{points:s,options:r}=t,{count:a,start:o,loop:l,ilen:c}=hc(s,e,i),u=Dm(r);let{move:d=!0,reverse:h}=i||{},g,m,b;for(g=0;g<=c;++g)m=s[(o+(h?c-g:g))%a],!m.skip&&(d?(n.moveTo(m.x,m.y),d=!1):u(n,b,m,h,r.stepped),b=m);return l&&(m=s[(o+(h?c:0))%a],u(n,b,m,h,r.stepped)),!!l}function Cm(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=hc(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,g,m,b,_,w;const M=k=>(a+(c?o-k:k))%r,S=()=>{b!==_&&(n.lineTo(u,_),n.lineTo(u,b),n.lineTo(u,w))};for(l&&(g=s[M(0)],n.moveTo(g.x,g.y)),h=0;h<=o;++h){if(g=s[M(h)],g.skip)continue;const k=g.x,D=g.y,O=k|0;O===m?(D<b?b=D:D>_&&(_=D),u=(d*u+k)/++d):(S(),n.lineTo(k,D),m=O,d=0,b=_=D),w=D}S()}function na(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Cm:Tm}function Pm(n){return n.stepped?Og:n.tension||n.cubicInterpolationMode==="monotone"?Eg:vn}function Om(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),dc(n,t.options),n.stroke(s)}function Em(n,t,e,i){const{segments:s,options:r}=t,a=na(t);for(const o of s)dc(n,r,o.style),n.beginPath(),a(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Rm=typeof Path2D=="function";function Am(n,t,e,i){Rm&&!t.options.segment?Om(n,t,e,i):Em(n,t,e,i)}class rn extends Yt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;vg(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Fg(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,a=vl(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=Pm(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:h}=a[c],g=r[d],m=r[h];if(g===m){o.push(g);continue}const b=Math.abs((s-g[e])/(m[e]-g[e])),_=l(g,m,b,i.stepped);_[e]=t[e],o.push(_)}return o.length===1?o[0]:o}pathSegment(t,e,i){return na(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=na(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Am(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}C(rn,"id","line"),C(rn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),C(rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),C(rn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function fc(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class As extends Yt{constructor(e){super();C(this,"parsed");C(this,"skip");C(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return fc(this,e,"x",i)}inYRange(e,i){return fc(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Ne(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Nr(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}C(As,"id","point"),C(As,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),C(As,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function gc(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,o=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function an(n,t,e,i){return n?0:Wt(t,e,i)}function Lm(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=al(i);return{t:an(s.top,r.top,0,e),r:an(s.right,r.right,0,t),b:an(s.bottom,r.bottom,0,e),l:an(s.left,r.left,0,t)}}function Im(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=en(s),a=Math.min(t,e),o=n.borderSkipped,l=i||nt(s);return{topLeft:an(!l||o.top||o.left,r.topLeft,0,a),topRight:an(!l||o.top||o.right,r.topRight,0,a),bottomLeft:an(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:an(!l||o.bottom||o.right,r.bottomRight,0,a)}}function Nm(n){const t=gc(n),e=t.right-t.left,i=t.bottom-t.top,s=Lm(n,e/2,i/2),r=Im(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function ia(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&gc(n,i);return o&&(s||Le(t,o.left,o.right))&&(r||Le(e,o.top,o.bottom))}function Fm(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function zm(n,t){n.rect(t.x,t.y,t.w,t.h)}function sa(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+a,radius:n.radius}}class Ls extends Yt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:a}=Nm(this),o=Fm(a.radius)?Yn:zm;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,sa(a,e,r)),t.clip(),o(t,sa(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,sa(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ia(this,t,e,i)}inXRange(t,e){return ia(this,t,null,e)}inYRange(t,e){return ia(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}C(Ls,"id","bar"),C(Ls,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),C(Ls,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Bm=Object.freeze({__proto__:null,ArcElement:Ri,BarElement:Ls,LineElement:rn,PointElement:As});const ra=["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)"],pc=ra.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function mc(n){return ra[n%ra.length]}function yc(n){return pc[n%pc.length]}function Hm(n,t){return n.borderColor=mc(t),n.backgroundColor=yc(t),++t}function Wm(n,t){return n.backgroundColor=n.data.map(()=>mc(t++)),t}function Ym(n,t){return n.backgroundColor=n.data.map(()=>yc(t++)),t}function jm(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof ze?t=Wm(e,t):s instanceof ki?t=Ym(e,t):s&&(t=Hm(e,t))}}function bc(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Vm(n){return n&&(n.borderColor||n.backgroundColor)}function $m(){return _t.borderColor!=="rgba(0,0,0,0.1)"||_t.backgroundColor!=="rgba(0,0,0,0.1)"}var Um={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,a=bc(i)||Vm(s)||r&&bc(r)||$m();if(!e.forceOverride&&a)return;const o=jm(n);i.forEach(o)}};function qm(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,h,g,m,b;for(a[l++]=n[u],d=0;d<r-2;d++){let _=0,w=0,M;const S=Math.floor((d+1)*o)+1+t,k=Math.min(Math.floor((d+2)*o)+1,e)+t,D=k-S;for(M=S;M<k;M++)_+=n[M].x,w+=n[M].y;_/=D,w/=D;const O=Math.floor(d*o)+1+t,P=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:p,y:x}=n[u];for(g=m=-1,M=O;M<P;M++)m=.5*Math.abs((p-_)*(n[M].y-x)-(p-n[M].x)*(w-x)),m>g&&(g=m,h=n[M],b=M);a[l++]=h,u=b}return a[l++]=n[c],a}function Xm(n,t,e,i){let s=0,r=0,a,o,l,c,u,d,h,g,m,b;const _=[],w=t+e-1,M=n[t].x,k=n[w].x-M;for(a=t;a<t+e;++a){o=n[a],l=(o.x-M)/k*i,c=o.y;const D=l|0;if(D===u)c<m?(m=c,d=a):c>b&&(b=c,h=a),s=(r*s+o.x)/++r;else{const O=a-1;if(!J(d)&&!J(h)){const P=Math.min(d,h),p=Math.max(d,h);P!==g&&P!==O&&_.push({...n[P],x:s}),p!==g&&p!==O&&_.push({...n[p],x:s})}a>0&&O!==g&&_.push(n[O]),_.push(o),u=D,r=0,m=b=c,d=h=g=a}}return _}function xc(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 _c(n){n.data.datasets.forEach(t=>{xc(t)})}function Gm(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Wt(Ie(t,r.axis,a).lo,0,e-1)),c?s=Wt(Ie(t,r.axis,o).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Km={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){_c(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(_i([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:h}=Gm(l,c);const g=e.threshold||4*i;if(h<=g){xc(s);return}J(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let m;switch(e.algorithm){case"lttb":m=qm(c,d,h,i,e);break;case"min-max":m=Xm(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=m})},destroy(n){_c(n)}};function Zm(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=oa(l,c,s);const u=aa(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const d=vl(t,u);for(const h of d){const g=aa(e,r[h.start],r[h.end],h.loop),m=wl(o,s,g);for(const b of m)a.push({source:b,target:h,start:{[e]:wc(u,g,"start",Math.max)},end:{[e]:wc(u,g,"end",Math.min)}})}}return a}function aa(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=ue(s),r=ue(r)),{property:n,start:s,end:r}}function Qm(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:o})=>{o=oa(a,o,s);const l=s[a],c=s[o];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function oa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function wc(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function vc(n,t){let e=[],i=!1;return ut(n)?(i=!0,e=n):e=Qm(n,t),e.length?new rn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Mc(n){return n&&n.fill!==!1}function Jm(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Mt(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function ty(n,t,e){const i=sy(n);if(nt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Mt(s)&&Math.floor(s)===s?ey(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function ey(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function ny(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:nt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function iy(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:nt(n)?i=n.value:i=t.getBaseValue(),i}function sy(n){const t=n.options,e=t.fill;let i=Q(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function ry(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=ay(t,e);o.push(vc({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)oy(s,a[u],o)}return new rn({points:s,options:{}})}function ay(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function oy(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:a,last:o,point:l}=ly(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function ly(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=a[u.start][e],h=a[u.end][e];if(Le(s,d,h)){o=s===d,l=s===h;break}}return{first:o,last:l,point:i}}class kc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:bt},t.arc(s,r,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function cy(n){const{chart:t,fill:e,line:i}=n;if(Mt(e))return uy(t,e);if(e==="stack")return ry(n);if(e==="shape")return!0;const s=dy(n);return s instanceof kc?s:vc(s,i)}function uy(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function dy(n){return(n.scale||{}).getPointPositionForValue?fy(n):hy(n)}function hy(n){const{scale:t={},fill:e}=n,i=ny(e,t);if(Mt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function fy(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=iy(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new kc({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function la(n,t,e){const i=cy(t),{line:s,scale:r,axis:a}=t,o=s.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(bi(n,e),gy(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:a}),xi(n))}function gy(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&(Sc(n,i,a.top),Dc(n,{line:e,target:i,color:s,scale:o,property:l}),n.restore(),n.save(),Sc(n,i,a.bottom)),Dc(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore()}function Sc(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],d=s[oa(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Dc(n,t){const{line:e,target:i,property:s,color:r,scale:a}=t,o=Zm(e,i,s);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:h=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=h,py(n,a,g&&aa(s,u,d)),n.beginPath();const m=!!e.pathSegment(n,l);let b;if(g){m?n.closePath():Tc(n,i,d,s);const _=!!i.pathSegment(n,c,{move:m,reverse:!0});b=m&&_,b||Tc(n,i,u,s)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function py(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:a,end:o}=e||{};r==="x"&&(n.beginPath(),n.rect(a,i,o-a,s-i),n.clip())}function Tc(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var my={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof rn&&(l={visible:n.isDatasetVisible(a),index:a,fill:ty(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Jm(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&la(n.ctx,o,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Mc(r)&&la(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Mc(i)||e.drawTime!=="beforeDatasetDraw"||la(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Cc=(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)}},yy=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Pc extends Yt{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=ht(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=kt(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=Cc(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,g=-u;return this.legendItems.forEach((m,b)=>{const _=i+e/2+r.measureText(m.text).width;(b===0||c[c.length-1]+_+2*o>a)&&(d+=u,c[c.length-(b>0?0:1)]=0,g+=u,h++),l[b]={left:0,top:g,row:h,width:_,height:s},c[c.length-1]+=_+o}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=o,h=0,g=0,m=0,b=0;return this.legendItems.forEach((_,w)=>{const{itemWidth:M,itemHeight:S}=by(i,e,r,_,s);w>0&&g+S+2*o>u&&(d+=h+o,c.push({width:h,height:g}),m+=h+o,b++,h=g=0),l[w]={left:m,top:g,col:b,width:M,height:S},h=Math.max(h,M),g+=S+o}),d+=h,c.push({width:h,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,a=$n(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=Vt(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=Vt(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=Vt(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=Vt(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;bi(t,this),this._draw(),xi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=_t.color,l=$n(t.rtl,this.left,this.width),c=kt(a.font),{padding:u}=a,d=c.size,h=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:_}=Cc(a,d),w=function(O,P,p){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;s.save();const x=Q(p.lineWidth,1);if(s.fillStyle=Q(p.fillStyle,o),s.lineCap=Q(p.lineCap,"butt"),s.lineDashOffset=Q(p.lineDashOffset,0),s.lineJoin=Q(p.lineJoin,"miter"),s.lineWidth=x,s.strokeStyle=Q(p.strokeStyle,o),s.setLineDash(Q(p.lineDash,[])),a.usePointStyle){const T={radius:b*Math.SQRT2/2,pointStyle:p.pointStyle,rotation:p.rotation,borderWidth:x},E=l.xPlus(O,m/2),A=P+h;rl(s,T,E,A,a.pointStyleWidth&&m)}else{const T=P+Math.max((d-b)/2,0),E=l.leftForLtr(O,m),A=en(p.borderRadius);s.beginPath(),Object.values(A).some(L=>L!==0)?Yn(s,{x:E,y:T,w:m,h:b,radius:A}):s.rect(E,T,m,b),s.fill(),x!==0&&s.stroke()}s.restore()},M=function(O,P,p){_n(s,p.text,O,P+_/2,c,{strikethrough:p.hidden,textAlign:l.textAlign(p.textAlign)})},S=this.isHorizontal(),k=this._computeTitleHeight();S?g={x:Vt(r,this.left+u,this.right-i[0]),y:this.top+u+k,line:0}:g={x:this.left+u,y:Vt(r,this.top+k+u,this.bottom-e[0].height),line:0},yl(this.ctx,t.textDirection);const D=_+u;this.legendItems.forEach((O,P)=>{s.strokeStyle=O.fontColor,s.fillStyle=O.fontColor;const p=s.measureText(O.text).width,x=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),T=m+h+p;let E=g.x,A=g.y;l.setWidth(this.width),S?P>0&&E+T+u>this.right&&(A=g.y+=D,g.line++,E=g.x=Vt(r,this.left+u,this.right-i[g.line])):P>0&&A+D>this.bottom&&(E=g.x=E+e[g.line].width+u,g.line++,A=g.y=Vt(r,this.top+k+u,this.bottom-e[g.line].height));const L=l.x(E);if(w(L,A,O),E=Hf(x,E+m+h,S?E+T:this.right,t.rtl),M(l.x(E),A,O),S)g.x+=T+u;else if(typeof O.text!="string"){const F=c.lineHeight;g.y+=Oc(O,F)+u}else g.y+=D}),bl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=kt(e.font),s=zt(e.padding);if(!e.display)return;const r=$n(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Vt(t.align,d,this.right-h);else{const m=this.columnSizes.reduce((b,_)=>Math.max(b,_.height),0);u=c+Vt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const g=Vt(o,d,d+h);a.textAlign=r.textAlign(Er(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,_n(a,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=kt(t.font),i=zt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Le(t,this.left,this.right)&&Le(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Le(t,s.left,s.left+s.width)&&Le(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!wy(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=yy(s,i);s&&!r&&ht(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&ht(e.onHover,[t,i,this],this)}else i&&ht(e.onClick,[t,i,this],this)}}function by(n,t,e,i,s){const r=xy(i,n,t,e),a=_y(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function xy(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function _y(n,t,e){let i=n;return typeof t.text!="string"&&(i=Oc(t,e)),i}function Oc(n,t){const e=n.text?n.text.length:0;return t*e}function wy(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var vy={id:"legend",_element:Pc,start(n,t,e){const i=n.legend=new Pc({ctx:n.ctx,options:e,chart:n});$t.configure(n,i,e),$t.addBox(n,i)},stop(n){$t.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;$t.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=zt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ca extends Yt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=ut(i.text)?i.text.length:1;this._padding=zt(i.padding);const r=s*kt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:a}=this,o=a.align;let l=0,c,u,d;return this.isHorizontal()?(u=Vt(o,i,r),d=e+t,c=r-i):(a.position==="left"?(u=i+t,d=Vt(o,s,e),l=rt*-.5):(u=r-t,d=Vt(o,e,s),l=rt*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=kt(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);_n(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Er(e.align),textBaseline:"middle",translation:[a,o]})}}function My(n,t){const e=new ca({ctx:n.ctx,options:t,chart:n});$t.configure(n,e,t),$t.addBox(n,e),n.titleBlock=e}var ky={id:"title",_element:ca,start(n,t,e){My(n,e)},stop(n){const t=n.titleBlock;$t.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;$t.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 Is=new WeakMap;var Sy={id:"subtitle",start(n,t,e){const i=new ca({ctx:n.ctx,options:e,chart:n});$t.configure(n,i,e),$t.addBox(n,i),Is.set(n,i)},stop(n){$t.removeBox(n,Is.get(n)),Is.delete(n)},beforeUpdate(n,t,e){const i=Is.get(n);$t.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 Ai={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Wn(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ce(n,t){return t&&(ut(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Be(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
16
+ */class Xp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=pc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nn=new Xp;const $c="transparent",Gp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=wc(n||$c),s=i.valid&&wc(t||$c);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Kp{constructor(t,e,i,s){const r=e[i];s=Zi([t.to,s,r,t.from]);const o=Zi([t.from,r,s]);this._active=!0,this._fn=t.fn||Gp[t.type||typeof o],this._easing=Ui[t.easing]||Ui.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Zi([t.to,e,s,t.from]),this._from=Zi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Ho{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!lt(t))return;const e=Object.keys(Ot.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!lt(r))return;const o={};for(const a of e)o[a]=r[a];(bt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=Qp(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Zp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new Kp(h,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return nn.add(this._chart,i),!0}}function Zp(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Qp(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Uc(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function Jp(n,t,e){if(e===!1)return!1;const i=Uc(n,e),s=Uc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function tm(n){let t,e,i,s;return lt(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function qc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function Xc(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(i.all)continue;break}c=n.values[l],Pt(c)&&(r||t===0||je(t)===je(c))&&(t+=c)}return t}}function em(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function Wo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function nm(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function im(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function sm(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Gc(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function Kc(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=nm(r,o,i),d=t.length;let h;for(let g=0;g<d;++g){const m=t[g],{[l]:b,[c]:w}=m,v=m._stacks||(m._stacks={});h=v[c]=sm(s,u,b),h[a]=w,h._top=Gc(h,o,!0,i.type),h._bottom=Gc(h,o,!1,i.type);const S=h._visualValues||(h._visualValues={});S[a]=w}}function Yo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function rm(n,t){return xn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function om(n,t,e){return xn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Qi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const jo=n=>n==="reset"||n==="none",Zc=(n,t)=>t?n:Object.assign({},n),am=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:qc(e,!0),values:null};class Ne{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Wo(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Qi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,h,g,m)=>d==="x"?h:d==="r"?m:g,r=e.xAxisID=it(i.xAxisID,Yo(t,"x")),o=e.yAxisID=it(i.yAxisID,Yo(t,"y")),a=e.rAxisID=it(i.rAxisID,Yo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&fc(this._data,this),t._stacked&&Qi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(lt(e)){const s=this._cachedMeta;this._data=em(e,s)}else if(i!==e){if(i){fc(i,this);const s=this._cachedMeta;Qi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Ug(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Wo(e.vScale,e),e.stack!==i.stack&&(s=!0,Qi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Kc(this,e._parsed),e._stacked=Wo(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{bt(s[t])?h=this.parseArrayData(i,s,t,e):lt(s[t])?h=this.parseObjectData(i,s,t,e):h=this.parsePrimitiveData(i,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=h[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&Kc(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let h,g,m;for(h=0,g=s;h<g;++h)m=h+i,d[h]={[a]:u||r.parse(c[m],m),[l]:o.parse(e[m],m)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,h,g;for(u=0,d=s;u<d;++u)h=u+i,g=e[h],c[u]={x:r.parse(mn(g,a),h),y:o.parse(mn(g,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:qc(s,!0),values:e._stacks[t.axis]._visualValues};return Xc(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=Xc(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=am(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=im(a);let h,g;function m(){g=s[h];const b=g[a.axis];return!Pt(g[t.axis])||u>b||d<b}for(h=0;h<o&&!(!m()&&(this.updateRangeFromParsed(c,t,g,l),r));++h);if(r){for(h=o-1;h>=0;--h)if(!m()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Pt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=tm(it(this.options.clip,Jp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=om(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=rm(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&he(i);if(a)return Zc(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ot.elements[t]),m=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(h,g,m,d);return b.$shared&&(b.$shared=l,r[o]=Object.freeze(Zc(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new Ho(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||jo(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){jo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!jo(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Qi(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(Ne,"defaults",{}),P(Ne,"datasetElementType",null),P(Ne,"dataElementType",null);function lm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=gc(i.sort((s,r)=>s-r))}return n._cache.$bar}function cm(n){const t=n.iScale,e=lm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(he(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function um(n,t,e,i){const s=e.barThickness;let r,o;return st(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function dm(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function hm(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function Qc(n,t,e,i){return bt(n)?hm(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Jc(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(Qc(h,d,r,c));return l}function Vo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function fm(n,t,e){return n!==0?je(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function gm(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function pm(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=gm(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[tu(u,o,a,l)]=!0,s=c)),r[tu(s,o,a,l)]=!0,n.borderSkipped=r}function tu(n,t,e,i){return i?(n=mm(n,t,e),n=eu(n,e,t)):n=eu(n,t,e),n}function mm(n,t,e){return n===t?e:n===e?t:n}function eu(n,t,e){return n==="start"?t:n==="end"?e:n}function ym(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ji extends Ne{parsePrimitiveData(t,e,i,s){return Jc(t,e,i,s)}parseArrayData(t,e,i,s){return Jc(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let h,g,m,b;for(h=i,g=i+s;h<g;++h)b=e[h],m={},m[r.axis]=r.parse(mn(b,c),h),d.push(Qc(mn(b,u),m,o,h));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Vo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const m=this.getParsed(g),b=r||st(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,u),v=(m._stacks||{})[a.axis],S={horizontal:c,base:b.base,enableBorderRadius:!v||Vo(m._custom)||o===v._top||o===v._bottom,x:c?b.head:w.center,y:c?w.center:b.head,height:c?w.size:Math.abs(b.size),width:c?Math.abs(b.size):w.size};h&&(S.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=S.options||t[g].options;pm(S,D,v,o),ym(S,D,u.ratio),this.updateElement(t[g],g,S,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),h=d&&d[u.vScale.axis];if(st(h)||isNaN(h))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||cm(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Vo(c);let d=l[e.axis],h=0,g=i?this.applyStack(e,l,i):d,m,b;g!==d&&(h=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&je(d)!==je(c.barEnd)&&(h=0),h+=d);const w=!st(r)&&!u?r:h;let v=e.getPixelForValue(w);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(h+g):m=v,b=m-v,Math.abs(b)<o){b=fm(b,e,a)*o,d===a&&(v-=b/2);const S=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),k=Math.min(S,D),T=Math.max(S,D);v=Math.max(Math.min(v,T),k),m=v+b,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(m)-e.getValueForPixel(v))}if(v===e.getPixelForValue(a)){const S=je(b)*e.getLineWidthForValue(a)/2;v+=S,b-=S}return{size:b,base:v,head:m,center:m+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=it(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?dm(t,e,s,c):um(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}P(Ji,"id","bar"),P(Ji,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Ji,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ar extends Ne{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let h=e;h<e+i;h++){const g=t[h],m=!r&&this.getParsed(h),b={},w=b[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(m[u]),v=b[d]=r?a.getBasePixel():a.getPixelForValue(m[d]);b.skip=isNaN(w)||isNaN(v),c&&(b.options=l||this.resolveDataElementOptions(h,g.active?"active":s),r&&(b.options.radius=0)),this.updateElement(g,h,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=it(i&&i._custom,r),s}}P(ar,"id","bubble"),P(ar,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(ar,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function bm(n,t,e){let i=1,s=1,r=0,o=0;if(t<St){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),g=(D,k,T)=>$i(D,a,l,!0)?1:Math.max(k,k*e,T,T*e),m=(D,k,T)=>$i(D,a,l,!0)?-1:Math.min(k,k*e,T,T*e),b=g(0,c,d),w=g(Ct,u,h),v=m(ut,c,d),S=m(ut+Ct,u,h);i=(b-v)/2,s=(w-S)/2,r=-(b+v)/2,o=-(w+S)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class sn extends Ne{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(lt(i[t])){const{key:l="value"}=this._parsing;r=c=>+mn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Yt(this.options.rotation-90)}_getCircumference(){return Yt(this.options.circumference)}_getRotationExtents(){let t=St,e=-St;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(Rg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:m,offsetY:b}=bm(d,u,l),w=(i.width-o)/h,v=(i.height-o)/g,S=Math.max(Math.min(w,v)/2,0),D=rc(this.options.radius,S),k=Math.max(D*l,0),T=(D-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*D,this.offsetY=b*D,s.total=this.calculateTotal(),this.outerRadius=D-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/St)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,h=r&&c.animateScale,g=h?0:this.innerRadius,m=h?0:this.outerRadius,{sharedOptions:b,includeOptions:w}=this._getSharedOptions(e,s);let v=this._getRotation(),S;for(S=0;S<e;++S)v+=this._circumference(S,r);for(S=e;S<e+i;++S){const D=this._circumference(S,r),k=t[S],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:m,innerRadius:g};w&&(T.options=b||this.resolveDataElementOptions(S,k.active?"active":s)),v+=D,this.updateElement(k,S,T,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?St*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(sn,"id","doughnut"),P(sn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(sn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ts extends Ne{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=yc(e,s,o);this._drawStart=a,this._drawCount=l,bc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),h=o.axis,g=a.axis,{spanGaps:m,segment:b}=this.options,w=bn(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",S=e+i,D=t.length;let k=e>0&&this.getParsed(e-1);for(let T=0;T<D;++T){const A=t[T],E=v?A:{};if(T<e||T>=S){E.skip=!0;continue}const p=this.getParsed(T),_=st(p[g]),C=E[h]=o.getPixelForValue(p[h],T),R=E[g]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,p,l):p[g],T);E.skip=isNaN(C)||isNaN(R)||_,E.stop=T>0&&Math.abs(p[h]-k[h])>w,b&&(E.parsed=p,E.raw=c.data[T]),d&&(E.options=u||this.resolveDataElementOptions(T,A.active?"active":s)),v||this.updateElement(A,T,E,s),k=p}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(ts,"id","line"),P(ts,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(ts,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class es extends Ne{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Rc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*ut;let g=h,m;const b=360/this.countVisibleElements();for(m=0;m<e;++m)g+=this._computeAngle(m,s,b);for(m=e;m<e+i;m++){const w=t[m];let v=g,S=g+this._computeAngle(m,s,b),D=o.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;g=S,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=S=h));const k={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:v,endAngle:S,options:this.resolveDataElementOptions(m,w.active?"active":s)};this.updateElement(w,m,k,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Yt(this.resolveDataElementOptions(t,e).angle||i):0}}P(es,"id","polarArea"),P(es,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(es,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class $o extends sn{}P($o,"id","pie"),P($o,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class lr extends Ne{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Rc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,h=o?r.yCenter:u.y,g={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,g,s)}}}P(lr,"id","radar"),P(lr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(lr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class cr extends Ne{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=yc(e,i,s);if(this._drawStart=r,this._drawCount=o,bc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),h=this.includeOptions(s,d),g=o.axis,m=a.axis,{spanGaps:b,segment:w}=this.options,v=bn(b)?b:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const T=t[k],A=this.getParsed(k),E=S?T:{},p=st(A[m]),_=E[g]=o.getPixelForValue(A[g],k),C=E[m]=r||p?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[m],k);E.skip=isNaN(_)||isNaN(C)||p,E.stop=k>0&&Math.abs(A[g]-D[g])>v,w&&(E.parsed=A,E.raw=c.data[k]),h&&(E.options=d||this.resolveDataElementOptions(k,T.active?"active":s)),S||this.updateElement(T,k,E,s),D=A}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}P(cr,"id","scatter"),P(cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _m=Object.freeze({__proto__:null,BarController:Ji,BubbleController:ar,DoughnutController:sn,LineController:ts,PieController:$o,PolarAreaController:es,RadarController:lr,ScatterController:cr});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Uo{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(Uo.prototype,t)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var nu={_date:Uo};function xm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Vg:tn;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),h=l(r,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function ns(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:h}=xm(r[a],t,o,s);for(let g=d;g<=h;++g){const m=u[g];m.skip||i(m,c,g)}}}function wm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function qo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ns(n,e,t,function(a,l,c){!s&&!en(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function vm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Js(o,{x:t.x,y:t.y});$i(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ns(n,e,t,r),s}function Mm(n,t,e,i,s,r){let o=[];const a=wm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const m=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(m))&&!g)return;const w=a(t,m);w<l?(o=[{element:u,datasetIndex:d,index:h}],l=w):w===l&&o.push({element:u,datasetIndex:d,index:h})}return ns(n,e,t,c),o}function Xo(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?vm(n,t,e,s):Mm(n,t,e,i,s,r)}function iu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return ns(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Go={evaluateInteractionItems:ns,modes:{index(n,t,e,i){const s=wn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?qo(n,s,r,i,o):Xo(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?qo(n,s,r,i,o):Xo(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return qo(n,s,r,i,o)},nearest(n,t,e,i){const s=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Xo(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=wn(t,n);return iu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=wn(t,n);return iu(n,s,"y",e.intersect,i)}}};const su=["left","top","right","bottom"];function is(n,t){return n.filter(e=>e.pos===t)}function ru(n,t){return n.filter(e=>su.indexOf(e.pos)===-1&&e.box.axis===t)}function ss(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Sm(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function km(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!su.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Dm(n,t){const e=km(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function Tm(n){const t=Sm(n),e=ss(t.filter(c=>c.box.fullSize),!0),i=ss(is(t,"left"),!0),s=ss(is(t,"right")),r=ss(is(t,"top"),!0),o=ss(is(t,"bottom")),a=ru(t,"x"),l=ru(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:is(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function ou(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function au(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Cm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!lt(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&au(o,r.getPadding());const a=Math.max(0,t.outerWidth-ou(o,n,"left","right")),l=Math.max(0,t.outerHeight-ou(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Om(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Pm(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function rs(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Pm(a.horizontal,t));const{same:d,other:h}=Cm(t,e,a,i);c|=d&&s.length,u=u||h,l.fullSize||s.push(a)}return c&&rs(s,t,e,i)||u}function ur(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function lu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,h=c.size||l.height;he(c.start)&&(o=c.start),l.fullSize?ur(l,s.left,o,e.outerWidth-s.right-s.left,h):ur(l,t.left+c.placed,o,d,h),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,h=c.size||l.width;he(c.start)&&(r=c.start),l.fullSize?ur(l,r,s.top,h,e.outerHeight-s.bottom-s.top):ur(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var ne={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=jt(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Tm(n.boxes),l=a.vertical,c=a.horizontal;xt(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,w)=>w.box.options&&w.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);au(h,jt(i));const g=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),m=Dm(l.concat(c),d);rs(a.fullSize,g,d,m),rs(l,g,d,m),rs(c,g,d,m)&&rs(l,g,d,m),Om(g),lu(a.leftAndTop,g,d,m),g.x+=g.w,g.y+=g.h,lu(a.rightAndBottom,g,d,m),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},xt(a.chartArea,b=>{const w=b.box;Object.assign(w,n.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class cu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Em extends cu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const dr="$chartjs",Am={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},uu=n=>n===null||n==="";function Rm(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[dr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",uu(s)){const r=Nc(n,"width");r!==void 0&&(n.width=r)}if(uu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Nc(n,"height");r!==void 0&&(n.height=r)}return n}const du=Fp?{passive:!0}:!1;function Lm(n,t,e){n&&n.addEventListener(t,e,du)}function Im(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,du)}function Nm(n,t){const e=Am[n.type]||n.type,{x:i,y:s}=wn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function hr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Fm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hr(a.addedNodes,i),o=o&&!hr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function zm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hr(a.removedNodes,i),o=o&&!hr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const os=new Map;let hu=0;function fu(){const n=window.devicePixelRatio;n!==hu&&(hu=n,os.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Bm(n,t){os.size||window.addEventListener("resize",fu),os.set(n,t)}function Hm(n){os.delete(n),os.size||window.removeEventListener("resize",fu)}function Wm(n,t,e){const i=n.canvas,s=i&&Bo(i);if(!s)return;const r=mc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),Bm(n,r),o}function Ko(n,t,e){e&&e.disconnect(),t==="resize"&&Hm(n)}function Ym(n,t,e){const i=n.canvas,s=mc(r=>{n.ctx!==null&&e(Nm(r,n))},n);return Lm(i,t,s),s}class jm extends cu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Rm(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[dr])return!1;const i=e[dr].initial;["height","width"].forEach(r=>{const o=i[r];st(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[dr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Fm,detach:zm,resize:Wm}[e]||Ym;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Ko,detach:Ko,resize:Ko}[e]||Im)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Np(t,e,i,s)}isAttached(t){const e=t&&Bo(t);return!!(e&&e.isConnected)}}function Vm(n){return!zo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Em:jm}class Gt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return bn(this.x)&&bn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}P(Gt,"defaults",{}),P(Gt,"defaultRoutes");function $m(n,t){const e=n.options.ticks,i=Um(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Xm(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return Gm(t,c,r,o/s),c;const u=qm(r,t,s);if(o>0){let d,h;const g=o>1?Math.round((l-a)/(o-1)):null;for(fr(t,c,u,st(g)?0:a-g,a),d=0,h=o-1;d<h;d++)fr(t,c,u,r[d],r[d+1]);return fr(t,c,u,l,st(g)?t.length:l+g),c}return fr(t,c,u),c}function Um(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function qm(n,t,e){const i=Km(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Hg(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Xm(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Gm(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function fr(n,t,e,i,s){const r=it(i,0),o=Math.min(it(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function Km(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Zm=n=>n==="left"?"right":n==="right"?"left":n,gu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,pu=(n,t)=>Math.min(t||n,n);function mu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function Qm(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function Jm(n,t){xt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function as(n){return n.drawTicks?n.tickLength:0}function yu(n,t){if(!n.display)return 0;const e=Et(n.font,t),i=jt(n.padding);return(bt(n.text)?n.text.length:1)*e.lineHeight+i.height}function ty(n,t){return xn(n,{scale:t,type:"scale"})}function ey(n,t,e){return xn(n,{tick:e,index:t,type:"tick"})}function ny(n,t,e){let i=Co(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Zm(i)),i}function iy(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,g,m;const b=o-s,w=a-r;if(n.isHorizontal()){if(g=ee(i,r,a),lt(e)){const v=Object.keys(e)[0],S=e[v];m=u[v].getPixelForValue(S)+b-t}else e==="center"?m=(c.bottom+c.top)/2+b-t:m=gu(n,e,t);h=a-r}else{if(lt(e)){const v=Object.keys(e)[0],S=e[v];g=u[v].getPixelForValue(S)-w+t}else e==="center"?g=(c.left+c.right)/2-w+t:g=gu(n,e,t);m=ee(i,o,s),d=e==="left"?-Ct:Ct}return{titleX:g,titleY:m,maxWidth:h,rotation:d}}class Un extends Gt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=ke(t,Number.POSITIVE_INFINITY),e=ke(e,Number.NEGATIVE_INFINITY),i=ke(i,Number.POSITIVE_INFINITY),s=ke(s,Number.NEGATIVE_INFINITY),{min:ke(t,i),max:ke(e,s),minDefined:Pt(t),maxDefined:Pt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:ke(e,ke(i,e)),max:ke(i,ke(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){_t(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?mu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=$m(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){_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,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=_t(e.callback,[r.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=pu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=Xt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-as(t.grid)-e.padding-yu(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=Qs(Math.min(Math.asin(Xt((u.highest.height+6)/a,-1,1)),Math.asin(Xt(l/c,-1,1))-Math.asin(Xt(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){_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:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=yu(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=as(r)+l):(t.height=this.maxHeight,t.width=as(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=i.padding*2,m=Yt(this.labelRotation),b=Math.cos(m),w=Math.sin(m);if(a){const v=i.mirror?0:w*d.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:b*d.width+w*h.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,w,b)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,g=0;l?c?(h=s*t.width,g=i*e.height):(h=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,g=e.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){_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++)st(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=mu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/pu(e,i));let c=0,u=0,d,h,g,m,b,w,v,S,D,k,T;for(d=0;d<e;d+=l){if(m=t[d].label,b=this._resolveTickFontOptions(d),s.font=w=b.string,v=r[w]=r[w]||{data:{},gc:[]},S=b.lineHeight,D=k=0,!st(m)&&!bt(m))D=nr(s,v.data,v.gc,D,m),k=S;else if(bt(m))for(h=0,g=m.length;h<g;++h)T=m[h],!st(T)&&!bt(T)&&(D=nr(s,v.data,v.gc,D,T),k+=S);o.push(D),a.push(k),c=Math.max(D,c),u=Math.max(k,u)}Jm(r,e);const A=o.indexOf(c),E=a.indexOf(u),p=_=>({width:o[_]||0,height:a[_]||0});return{first:p(0),last:p(e-1),widest:p(A),highest:p(E),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return jg(this._alignToPixels?Wn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=ey(this.getContext(),t,i))}return this.$context||(this.$context=ty(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Yt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=as(r),g=[],m=a.setContext(this.getContext()),b=m.display?m.width:0,w=b/2,v=function(U){return Wn(i,U,b)};let S,D,k,T,A,E,p,_,C,R,L,N;if(o==="top")S=v(this.bottom),E=this.bottom-h,_=S-w,R=v(t.top)+w,N=t.bottom;else if(o==="bottom")S=v(this.top),R=t.top,N=v(t.bottom)-w,E=S+w,_=this.top+h;else if(o==="left")S=v(this.right),A=this.right-h,p=S-w,C=v(t.left)+w,L=t.right;else if(o==="right")S=v(this.left),C=t.left,L=v(t.right)-w,A=S+w,p=this.left+h;else if(e==="x"){if(o==="center")S=v((t.top+t.bottom)/2+.5);else if(lt(o)){const U=Object.keys(o)[0],H=o[U];S=v(this.chart.scales[U].getPixelForValue(H))}R=t.top,N=t.bottom,E=S+w,_=E+h}else if(e==="y"){if(o==="center")S=v((t.left+t.right)/2);else if(lt(o)){const U=Object.keys(o)[0],H=o[U];S=v(this.chart.scales[U].getPixelForValue(H))}A=S-w,p=A-h,C=t.left,L=t.right}const B=it(s.ticks.maxTicksLimit,d),G=Math.max(1,Math.ceil(d/B));for(D=0;D<d;D+=G){const U=this.getContext(D),H=r.setContext(U),ct=a.setContext(U),Y=H.lineWidth,et=H.color,kt=ct.dash||[],$=ct.dashOffset,z=H.tickWidth,j=H.tickColor,X=H.tickBorderDash||[],Z=H.tickBorderDashOffset;k=Qm(this,D,l),k!==void 0&&(T=Wn(i,k,Y),c?A=p=C=L=T:E=_=R=N=T,g.push({tx1:A,ty1:E,tx2:p,ty2:_,x1:C,y1:R,x2:L,y2:N,width:Y,color:et,borderDash:kt,borderDashOffset:$,tickWidth:z,tickColor:j,tickBorderDash:X,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=S,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,h=as(i.grid),g=h+u,m=d?-u:g,b=-Yt(this.labelRotation),w=[];let v,S,D,k,T,A,E,p,_,C,R,L,N="middle";if(s==="top")A=this.bottom-m,E=this._getXAxisLabelAlignment();else if(s==="bottom")A=this.top+m,E=this._getXAxisLabelAlignment();else if(s==="left"){const G=this._getYAxisLabelAlignment(h);E=G.textAlign,T=G.x}else if(s==="right"){const G=this._getYAxisLabelAlignment(h);E=G.textAlign,T=G.x}else if(e==="x"){if(s==="center")A=(t.top+t.bottom)/2+g;else if(lt(s)){const G=Object.keys(s)[0],U=s[G];A=this.chart.scales[G].getPixelForValue(U)+g}E=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")T=(t.left+t.right)/2-g;else if(lt(s)){const G=Object.keys(s)[0],U=s[G];T=this.chart.scales[G].getPixelForValue(U)}E=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const B=this._getLabelSizes();for(v=0,S=a.length;v<S;++v){D=a[v],k=D.label;const G=r.setContext(this.getContext(v));p=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),C=_.lineHeight,R=bt(k)?k.length:1;const U=R/2,H=G.color,ct=G.textStrokeColor,Y=G.textStrokeWidth;let et=E;o?(T=p,E==="inner"&&(v===S-1?et=this.options.reverse?"left":"right":v===0?et=this.options.reverse?"right":"left":et="center"),s==="top"?c==="near"||b!==0?L=-R*C+C/2:c==="center"?L=-B.highest.height/2-U*C+C:L=-B.highest.height+C/2:c==="near"||b!==0?L=C/2:c==="center"?L=B.highest.height/2-U*C:L=B.highest.height-R*C,d&&(L*=-1),b!==0&&!G.showLabelBackdrop&&(T+=C/2*Math.sin(b))):(A=p,L=(1-R)*C/2);let kt;if(G.showLabelBackdrop){const $=jt(G.backdropPadding),z=B.heights[v],j=B.widths[v];let X=L-$.top,Z=0-$.left;switch(N){case"middle":X-=z/2;break;case"bottom":X-=z;break}switch(E){case"center":Z-=j/2;break;case"right":Z-=j;break;case"inner":v===S-1?Z-=j:v>0&&(Z-=j/2);break}kt={left:Z,top:X,width:j+$.width,height:z+$.height,color:G.backdropColor}}w.push({label:k,font:_,textOffset:L,options:{rotation:b,color:H,strokeColor:ct,strokeWidth:Y,textAlign:et,textBaseline:N,translation:[T,A],backdrop:kt}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=Wn(t,this.left,o)-o/2,u=Wn(t,this.right,a)+a/2,d=h=l):(d=Wn(t,this.top,o)-o/2,h=Wn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Gi(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Yn(i,c,0,u,l,a)}s&&Ki(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=Et(i.font),o=jt(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||lt(e)?(l+=o.bottom,bt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=iy(this,l,e,a);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:h,textAlign:ny(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=it(t.grid&&t.grid.z,-1),s=it(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;oy(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,sy(t,o,i),this.override&&Ot.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Ot[s]&&(delete Ot[s][i],this.override&&delete Hn[i])}}function sy(n,t,e){const i=Yi(Object.create(null),[e?Ot.get(e):{},Ot.get(t),n.defaults]);Ot.set(t,i),n.defaultRoutes&&ry(t,n.defaultRoutes),n.descriptors&&Ot.describe(t,n.descriptors)}function ry(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");Ot.route(r,s,l,a)})}function oy(n){return"id"in n&&"defaults"in n}class ay{constructor(){this.controllers=new gr(Ne,"datasets",!0),this.elements=new gr(Gt,"elements"),this.plugins=new gr(Object,"plugins"),this.scales=new gr(Un,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):xt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=ko(t);_t(i["before"+s],[],i),e[t](i),_t(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ve=new ay;class ly{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(_t(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=it(i.options&&i.options.plugins,{}),r=cy(i);return s===!1&&!e?[]:dy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function cy(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function uy(n,t){return!t&&n===!1?null:n===!0?{}:n}function dy(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=uy(i[l],s);c!==null&&r.push({plugin:a,options:hy(n.config,{plugin:a,local:e[l]},c,o)})}return r}function hy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zo(n,t){const e=Ot.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function fy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function gy(n,t){return n===t?"_index_":"_value_"}function bu(n){if(n==="x"||n==="y"||n==="r")return n}function py(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Qo(n,...t){if(bu(n))return n;for(const e of t){const i=e.axis||py(e.position)||n.length>1&&bu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function _u(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function my(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return _u(n,"x",e[0])||_u(n,"y",e[0])}return{}}function yy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=Zo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!lt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Qo(o,a,my(o,n),Ot.scales[a.type]),c=gy(l,s),u=e.scales||{};r[o]=ji(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||Zo(a,t),u=(Hn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=fy(d,l),g=o[h+"AxisID"]||h;r[g]=r[g]||Object.create(null),ji(r[g],[{axis:h},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ji(a,[Ot.scales[a.type],Ot.scale])}),r}function xu(n){const t=n.options||(n.options={});t.plugins=it(t.plugins,{}),t.scales=yy(n,t)}function wu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function by(n){return n=n||{},n.data=wu(n.data),xu(n),n}const vu=new Map,Mu=new Set;function pr(n,t){let e=vu.get(n);return e||(e=t(),vu.set(n,e),Mu.add(e)),e}const ls=(n,t,e)=>{const i=mn(t,e);i!==void 0&&n.add(i)};class _y{constructor(t){this._config=by(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=wu(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),xu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return pr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return pr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return pr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>ls(l,t,d))),u.forEach(d=>ls(l,s,d)),u.forEach(d=>ls(l,Hn[r]||{},d)),u.forEach(d=>ls(l,Ot,d)),u.forEach(d=>ls(l,Eo,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Mu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},Ot.datasets[e]||{},{type:e},Ot,Eo]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Su(this._resolverCache,t,s);let l=o;if(wy(o,e)){r.$shared=!1,i=fe(i)?i():i;const c=this.createResolver(t,i,a);l=di(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Su(this._resolverCache,t,i);return lt(e)?di(r,e,void 0,s):r}}function Su(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Io(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const xy=n=>lt(n)&&Object.getOwnPropertyNames(n).some(t=>fe(n[t]));function wy(n,t){const{isScriptable:e,isIndexable:i}=Tc(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(fe(a)||xy(a))||o&&bt(a))return!0}return!1}var vy="4.4.5";const My=["top","bottom","left","right","chartArea"];function ku(n,t){return n==="top"||n==="bottom"||My.indexOf(n)===-1&&t==="x"}function Du(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Tu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),_t(e&&e.onComplete,[n],t)}function Sy(n){const t=n.chart,e=t.options.animation;_t(e&&e.onProgress,[n],t)}function Cu(n){return zo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const mr={},Ou=n=>{const t=Cu(n);return Object.values(mr).filter(e=>e.canvas===t).pop()};function ky(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Dy(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function yr(n,t,e){return n.options.clip?n[e]:t[e]}function Ty(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:yr(e,t,"left"),right:yr(e,t,"right"),top:yr(i,t,"top"),bottom:yr(i,t,"bottom")}:t}let Pe=(Pn=class{static register(...t){Ve.add(...t),Pu()}static unregister(...t){Ve.remove(...t),Pu()}constructor(t,e){const i=this.config=new _y(e),s=Cu(t),r=Ou(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Vm(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ag(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ly,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qg(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],mr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nn.listen(this,"complete",Tu),nn.listen(this,"progress",Sy),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return st(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ic(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Sc(this.canvas,this.ctx),this}stop(){return nn.stop(this),this}resize(t,e){nn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ic(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),_t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};xt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Qo(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),xt(r,o=>{const a=o.options,l=a.id,c=Qo(l,a),u=it(a.type,o.dtype);(a.position===void 0||ku(a.position,c)!==ku(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=Ve.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),xt(s,(o,a)=>{o||delete i[a]}),xt(i,o=>{ne.configure(this,o,o.options),ne.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Du("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Zo(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=Ve.getController(a),{datasetElementType:c,dataElementType:u}=Ot.datasets[a];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){xt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||xt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Du("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){xt(this.scales,t=>{ne.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!lc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;ky(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!lc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ne.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],xt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,fe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nn.has(this)?this.attached&&!nn.running(this)&&nn.start(this):(this.draw(),Tu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=Ty(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Gi(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ki(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Go.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=xn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);he(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Sc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete mr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};xt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){xt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},xt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Xs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=zg(t),c=Dy(t,this._lastEvent,i,l);i&&(this._lastEvent=null,_t(r.onHover,[t,a,this],this),l&&_t(r.onClick,[t,a,this],this));const u=!Xs(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},P(Pn,"defaults",Ot),P(Pn,"instances",mr),P(Pn,"overrides",Hn),P(Pn,"registry",Ve),P(Pn,"version",vy),P(Pn,"getChart",Ou),Pn);function Pu(){return xt(Pe.instances,n=>n._plugins.invalidate())}function Cy(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Ct,i-Ct),n.closePath(),n.clip()}function Oy(n){return Lo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Py(n,t,e,i){const s=Oy(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Xt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Xt(s.innerStart,0,o),innerEnd:Xt(s.innerEnd,0,o)}}function gi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function br(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),h=u>0?u+i+e+c:0;let g=0;const m=s-l;if(i){const G=u>0?u-i:0,U=d>0?d-i:0,H=(G+U)/2,ct=H!==0?m*H/(H+i):m;g=(m-ct)/2}const b=Math.max(.001,m*d-e/ut)/d,w=(m-b)/2,v=l+w+g,S=s-w-g,{outerStart:D,outerEnd:k,innerStart:T,innerEnd:A}=Py(t,h,d,S-v),E=d-D,p=d-k,_=v+D/E,C=S-k/p,R=h+T,L=h+A,N=v+T/R,B=S-A/L;if(n.beginPath(),r){const G=(_+C)/2;if(n.arc(o,a,d,_,G),n.arc(o,a,d,G,C),k>0){const Y=gi(p,C,o,a);n.arc(Y.x,Y.y,k,C,S+Ct)}const U=gi(L,S,o,a);if(n.lineTo(U.x,U.y),A>0){const Y=gi(L,B,o,a);n.arc(Y.x,Y.y,A,S+Ct,B+Math.PI)}const H=(S-A/h+(v+T/h))/2;if(n.arc(o,a,h,S-A/h,H,!0),n.arc(o,a,h,H,v+T/h,!0),T>0){const Y=gi(R,N,o,a);n.arc(Y.x,Y.y,T,N+Math.PI,v-Ct)}const ct=gi(E,v,o,a);if(n.lineTo(ct.x,ct.y),D>0){const Y=gi(E,_,o,a);n.arc(Y.x,Y.y,D,v-Ct,_)}}else{n.moveTo(o,a);const G=Math.cos(_)*d+o,U=Math.sin(_)*d+a;n.lineTo(G,U);const H=Math.cos(C)*d+o,ct=Math.sin(C)*d+a;n.lineTo(H,ct)}n.closePath()}function Ey(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){br(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%St||St))}return br(n,t,e,i,l,s),n.fill(),l}function Ay(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let m=t.endAngle;if(r){br(n,t,e,i,m,s);for(let b=0;b<r;++b)n.stroke();isNaN(a)||(m=o+(a%St||St))}g&&Cy(n,t,m),r||(br(n,t,e,i,m,s),n.stroke())}class cs extends Gt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=Js(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,m=it(h,c-l),b=$i(o,l,c)&&l!==c,w=m>=St||b,v=Je(a,u+g,d+g);return w&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>St?Math.floor(s/St):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(ut,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Ey(e,this,u,o,a),Ay(e,this,u,o,a),e.restore()}}P(cs,"id","arc"),P(cs,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(cs,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(cs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Eu(n,t,e=t){n.lineCap=it(e.borderCapStyle,t.borderCapStyle),n.setLineDash(it(e.borderDash,t.borderDash)),n.lineDashOffset=it(e.borderDashOffset,t.borderDashOffset),n.lineJoin=it(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=it(e.borderWidth,t.borderWidth),n.strokeStyle=it(e.borderColor,t.borderColor)}function Ry(n,t,e){n.lineTo(e.x,e.y)}function Ly(n){return n.stepped?rp:n.tension||n.cubicInterpolationMode==="monotone"?op:Ry}function Au(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Iy(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Au(s,e,i),u=Ly(r);let{move:d=!0,reverse:h}=i||{},g,m,b;for(g=0;g<=c;++g)m=s[(a+(h?c-g:g))%o],!m.skip&&(d?(n.moveTo(m.x,m.y),d=!1):u(n,b,m,h,r.stepped),b=m);return l&&(m=s[(a+(h?c:0))%o],u(n,b,m,h,r.stepped)),!!l}function Ny(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Au(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,g,m,b,w,v;const S=k=>(o+(c?a-k:k))%r,D=()=>{b!==w&&(n.lineTo(u,w),n.lineTo(u,b),n.lineTo(u,v))};for(l&&(g=s[S(0)],n.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=s[S(h)],g.skip)continue;const k=g.x,T=g.y,A=k|0;A===m?(T<b?b=T:T>w&&(w=T),u=(d*u+k)/++d):(D(),n.lineTo(k,T),m=A,d=0,b=w=T),v=T}D()}function Jo(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ny:Iy}function Fy(n){return n.stepped?zp:n.tension||n.cubicInterpolationMode==="monotone"?Bp:Vn}function zy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Eu(n,t.options),n.stroke(s)}function By(n,t,e,i){const{segments:s,options:r}=t,o=Jo(t);for(const a of s)Eu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Hy=typeof Path2D=="function";function Wy(n,t,e,i){Hy&&!t.options.segment?zy(n,t,e,i):By(n,t,e,i)}class vn extends Gt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Pp(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=$p(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=Yc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Fy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:h}=o[c],g=r[d],m=r[h];if(g===m){a.push(g);continue}const b=Math.abs((s-g[e])/(m[e]-g[e])),w=l(g,m,b,i.stepped);w[e]=t[e],a.push(w)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Jo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Jo(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Wy(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(vn,"id","line"),P(vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(vn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ru(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class _r extends Gt{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Ru(this,e,"x",i)}inYRange(e,i){return Ru(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!en(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Ro(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(_r,"id","point"),P(_r,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(_r,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Lu(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Mn(n,t,e,i){return n?0:Xt(t,e,i)}function Yy(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Dc(i);return{t:Mn(s.top,r.top,0,e),r:Mn(s.right,r.right,0,t),b:Mn(s.bottom,r.bottom,0,e),l:Mn(s.left,r.left,0,t)}}function jy(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=_n(s),o=Math.min(t,e),a=n.borderSkipped,l=i||lt(s);return{topLeft:Mn(!l||a.top||a.left,r.topLeft,0,o),topRight:Mn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Mn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Mn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Vy(n){const t=Lu(n),e=t.right-t.left,i=t.bottom-t.top,s=Yy(n,e/2,i/2),r=jy(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function ta(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Lu(n,i);return a&&(s||Je(t,a.left,a.right))&&(r||Je(e,a.top,a.bottom))}function $y(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Uy(n,t){n.rect(t.x,t.y,t.w,t.h)}function ea(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class xr extends Gt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=Vy(this),a=$y(o.radius)?ui:Uy;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ea(o,e,r)),t.clip(),a(t,ea(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ea(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ta(this,t,e,i)}inXRange(t,e){return ta(this,t,null,e)}inYRange(t,e){return ta(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(xr,"id","bar"),P(xr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var qy=Object.freeze({__proto__:null,ArcElement:cs,BarElement:xr,LineElement:vn,PointElement:_r});const na=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Iu=na.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Nu(n){return na[n%na.length]}function Fu(n){return Iu[n%Iu.length]}function Xy(n,t){return n.borderColor=Nu(t),n.backgroundColor=Fu(t),++t}function Gy(n,t){return n.backgroundColor=n.data.map(()=>Nu(t++)),t}function Ky(n,t){return n.backgroundColor=n.data.map(()=>Fu(t++)),t}function Zy(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=Gy(e,t):s instanceof es?t=Ky(e,t):s&&(t=Xy(e,t))}}function zu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Qy(n){return n&&(n.borderColor||n.backgroundColor)}function Jy(){return Ot.borderColor!=="rgba(0,0,0,0.1)"||Ot.backgroundColor!=="rgba(0,0,0,0.1)"}var tb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=zu(i)||Qy(s)||r&&zu(r)||Jy();if(!e.forceOverride&&o)return;const a=Zy(n);i.forEach(a)}};function eb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,h,g,m,b;for(o[l++]=n[u],d=0;d<r-2;d++){let w=0,v=0,S;const D=Math.floor((d+1)*a)+1+t,k=Math.min(Math.floor((d+2)*a)+1,e)+t,T=k-D;for(S=D;S<k;S++)w+=n[S].x,v+=n[S].y;w/=T,v/=T;const A=Math.floor(d*a)+1+t,E=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:p,y:_}=n[u];for(g=m=-1,S=A;S<E;S++)m=.5*Math.abs((p-w)*(n[S].y-_)-(p-n[S].x)*(v-_)),m>g&&(g=m,h=n[S],b=S);o[l++]=h,u=b}return o[l++]=n[c],o}function nb(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,h,g,m,b;const w=[],v=t+e-1,S=n[t].x,k=n[v].x-S;for(o=t;o<t+e;++o){a=n[o],l=(a.x-S)/k*i,c=a.y;const T=l|0;if(T===u)c<m?(m=c,d=o):c>b&&(b=c,h=o),s=(r*s+a.x)/++r;else{const A=o-1;if(!st(d)&&!st(h)){const E=Math.min(d,h),p=Math.max(d,h);E!==g&&E!==A&&w.push({...n[E],x:s}),p!==g&&p!==A&&w.push({...n[p],x:s})}o>0&&A!==g&&w.push(n[A]),w.push(a),u=T,r=0,m=b=c,d=h=g=o}}return w}function Bu(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Hu(n){n.data.datasets.forEach(t=>{Bu(t)})}function ib(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Xt(tn(t,r.axis,o).lo,0,e-1)),c?s=Xt(tn(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var sb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Hu(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Zi([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:h}=ib(l,c);const g=e.threshold||4*i;if(h<=g){Bu(s);return}st(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let m;switch(e.algorithm){case"lttb":m=eb(c,d,h,i,e);break;case"min-max":m=nb(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=m})},destroy(n){Hu(n)}};function rb(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=sa(l,c,s);const u=ia(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=Yc(t,u);for(const h of d){const g=ia(e,r[h.start],r[h.end],h.loop),m=Wc(a,s,g);for(const b of m)o.push({source:b,target:h,start:{[e]:Wu(u,g,"start",Math.max)},end:{[e]:Wu(u,g,"end",Math.min)}})}}return o}function ia(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=De(s),r=De(r)),{property:n,start:s,end:r}}function ob(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=sa(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function sa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Yu(n,t){let e=[],i=!1;return bt(n)?(i=!0,e=n):e=ob(n,t),e.length?new vn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ju(n){return n&&n.fill!==!1}function ab(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Pt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function lb(n,t,e){const i=hb(n);if(lt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Pt(s)&&Math.floor(s)===s?cb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function cb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function ub(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:lt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function db(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:lt(n)?i=n.value:i=t.getBaseValue(),i}function hb(n){const t=n.options,e=t.fill;let i=it(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function fb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=gb(t,e);a.push(Yu({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)pb(s,o[u],a)}return new vn({points:s,options:{}})}function gb(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function pb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=mb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function mb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],h=o[u.end][e];if(Je(s,d,h)){a=s===d,l=s===h;break}}return{first:a,last:l,point:i}}class Vu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:St},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function yb(n){const{chart:t,fill:e,line:i}=n;if(Pt(e))return bb(t,e);if(e==="stack")return fb(n);if(e==="shape")return!0;const s=_b(n);return s instanceof Vu?s:Yu(s,i)}function bb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function _b(n){return(n.scale||{}).getPointPositionForValue?wb(n):xb(n)}function xb(n){const{scale:t={},fill:e}=n,i=ub(e,t);if(Pt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function wb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=db(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Vu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function ra(n,t,e){const i=yb(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(Gi(n,e),vb(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),Ki(n))}function vb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&($u(n,i,o.top),Uu(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),$u(n,i,o.bottom)),Uu(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function $u(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[sa(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Uu(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=rb(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:h=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=h,Mb(n,o,g&&ia(s,u,d)),n.beginPath();const m=!!e.pathSegment(n,l);let b;if(g){m?n.closePath():qu(n,i,d,s);const w=!!i.pathSegment(n,c,{move:m,reverse:!0});b=m&&w,b||qu(n,i,u,s)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function Mb(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(n.beginPath(),n.rect(o,i,a-o,s-i),n.clip())}function qu(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Sb={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof vn&&(l={visible:n.isDatasetVisible(o),index:o,fill:lb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=ab(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&ra(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;ju(r)&&ra(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ju(i)||e.drawTime!=="beforeDatasetDraw"||ra(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Xu=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},kb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Gu extends Gt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=_t(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=Et(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Xu(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,g=-u;return this.legendItems.forEach((m,b)=>{const w=i+e/2+r.measureText(m.text).width;(b===0||c[c.length-1]+w+2*a>o)&&(d+=u,c[c.length-(b>0?0:1)]=0,g+=u,h++),l[b]={left:0,top:g,row:h,width:w,height:s},c[c.length-1]+=w+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,g=0,m=0,b=0;return this.legendItems.forEach((w,v)=>{const{itemWidth:S,itemHeight:D}=Db(i,e,r,w,s);v>0&&g+D+2*a>u&&(d+=h+a,c.push({width:h,height:g}),m+=h+a,b++,h=g=0),l[v]={left:m,top:g,col:b,width:S,height:D},h=Math.max(h,S),g+=D+a}),d+=h,c.push({width:h,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=fi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ee(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ee(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=ee(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ee(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Gi(t,this),this._draw(),Ki(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=Ot.color,l=fi(t.rtl,this.left,this.width),c=Et(o.font),{padding:u}=o,d=c.size,h=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:w}=Xu(o,d),v=function(A,E,p){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;s.save();const _=it(p.lineWidth,1);if(s.fillStyle=it(p.fillStyle,a),s.lineCap=it(p.lineCap,"butt"),s.lineDashOffset=it(p.lineDashOffset,0),s.lineJoin=it(p.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=it(p.strokeStyle,a),s.setLineDash(it(p.lineDash,[])),o.usePointStyle){const C={radius:b*Math.SQRT2/2,pointStyle:p.pointStyle,rotation:p.rotation,borderWidth:_},R=l.xPlus(A,m/2),L=E+h;kc(s,C,R,L,o.pointStyleWidth&&m)}else{const C=E+Math.max((d-b)/2,0),R=l.leftForLtr(A,m),L=_n(p.borderRadius);s.beginPath(),Object.values(L).some(N=>N!==0)?ui(s,{x:R,y:C,w:m,h:b,radius:L}):s.rect(R,C,m,b),s.fill(),_!==0&&s.stroke()}s.restore()},S=function(A,E,p){Yn(s,p.text,A,E+w/2,c,{strikethrough:p.hidden,textAlign:l.textAlign(p.textAlign)})},D=this.isHorizontal(),k=this._computeTitleHeight();D?g={x:ee(r,this.left+u,this.right-i[0]),y:this.top+u+k,line:0}:g={x:this.left+u,y:ee(r,this.top+k+u,this.bottom-e[0].height),line:0},Fc(this.ctx,t.textDirection);const T=w+u;this.legendItems.forEach((A,E)=>{s.strokeStyle=A.fontColor,s.fillStyle=A.fontColor;const p=s.measureText(A.text).width,_=l.textAlign(A.textAlign||(A.textAlign=o.textAlign)),C=m+h+p;let R=g.x,L=g.y;l.setWidth(this.width),D?E>0&&R+C+u>this.right&&(L=g.y+=T,g.line++,R=g.x=ee(r,this.left+u,this.right-i[g.line])):E>0&&L+T>this.bottom&&(R=g.x=R+e[g.line].width+u,g.line++,L=g.y=ee(r,this.top+k+u,this.bottom-e[g.line].height));const N=l.x(R);if(v(N,L,A),R=Xg(_,R+m+h,D?R+C:this.right,t.rtl),S(l.x(R),L,A),D)g.x+=C+u;else if(typeof A.text!="string"){const B=c.lineHeight;g.y+=Ku(A,B)+u}else g.y+=T}),zc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Et(e.font),s=jt(e.padding);if(!e.display)return;const r=fi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=ee(t.align,d,this.right-h);else{const m=this.columnSizes.reduce((b,w)=>Math.max(b,w.height),0);u=c+ee(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const g=ee(a,d,d+h);o.textAlign=r.textAlign(Co(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Yn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=Et(t.font),i=jt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Je(t,this.left,this.right)&&Je(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Je(t,s.left,s.left+s.width)&&Je(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Ob(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=kb(s,i);s&&!r&&_t(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&_t(e.onHover,[t,i,this],this)}else i&&_t(e.onClick,[t,i,this],this)}}function Db(n,t,e,i,s){const r=Tb(i,n,t,e),o=Cb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Tb(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function Cb(n,t,e){let i=n;return typeof t.text!="string"&&(i=Ku(t,e)),i}function Ku(n,t){const e=n.text?n.text.length:0;return t*e}function Ob(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Pb={id:"legend",_element:Gu,start(n,t,e){const i=n.legend=new Gu({ctx:n.ctx,options:e,chart:n});ne.configure(n,i,e),ne.addBox(n,i)},stop(n){ne.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ne.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=jt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class oa extends Gt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=bt(i.text)?i.text.length:1;this._padding=jt(i.padding);const r=s*Et(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=ee(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=ee(a,s,e),l=ut*-.5):(u=r-t,d=ee(a,e,s),l=ut*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Et(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Co(e.align),textBaseline:"middle",translation:[o,a]})}}function Eb(n,t){const e=new oa({ctx:n.ctx,options:t,chart:n});ne.configure(n,e,t),ne.addBox(n,e),n.titleBlock=e}var Ab={id:"title",_element:oa,start(n,t,e){Eb(n,e)},stop(n){const t=n.titleBlock;ne.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ne.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const wr=new WeakMap;var Rb={id:"subtitle",start(n,t,e){const i=new oa({ctx:n.ctx,options:e,chart:n});ne.configure(n,i,e),ne.addBox(n,i),wr.set(n,i)},stop(n){ne.removeBox(n,wr.get(n)),wr.delete(n)},beforeUpdate(n,t,e){const i=wr.get(n);ne.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const us={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ci(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function $e(n,t){return t&&(bt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function rn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function Dy(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Ec(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=kt(t.bodyFont),c=kt(t.titleFont),u=kt(t.footerFont),d=r.length,h=s.length,g=i.length,m=zt(t.padding);let b=m.height,_=0,w=i.reduce((k,D)=>k+D.before.length+D.lines.length+D.after.length,0);if(w+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){const k=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;b+=g*k+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let M=0;const S=function(k){_=Math.max(_,e.measureText(k).width+M)};return e.save(),e.font=c.string,ft(n.title,S),e.font=l.string,ft(n.beforeBody.concat(n.afterBody),S),M=t.displayColors?a+2+t.boxPadding:0,ft(i,k=>{ft(k.before,S),ft(k.lines,S),ft(k.after,S)}),M=0,e.font=u.string,ft(n.footer,S),e.restore(),_+=m.width,{width:_,height:b}}function Ty(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Cy(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function Py(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),Cy(c,n,t,e)&&(c="center"),c}function Rc(n,t,e){const i=e.yAlign||t.yAlign||Ty(n,e);return{xAlign:e.xAlign||t.xAlign||Py(n,t,e,i),yAlign:i}}function Oy(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Ey(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ac(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=en(a);let m=Oy(t,o);const b=Ey(t,l,c);return l==="center"?o==="left"?m+=c:o==="right"&&(m-=c):o==="left"?m-=Math.max(u,h)+s:o==="right"&&(m+=Math.max(d,g)+s),{x:Wt(m,0,i.width-t.width),y:Wt(b,0,i.height-t.height)}}function Ns(n,t,e){const i=zt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Lc(n){return Ce([],Be(n))}function Ry(n,t,e){return nn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ic(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Nc={beforeTitle:Ae,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:Ae,beforeBody:Ae,beforeLabel:Ae,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 J(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:Ae,afterBody:Ae,beforeFooter:Ae,footer:Ae,afterFooter:Ae};function ee(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Nc[t].call(e,i):s}class ua extends Yt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new jr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Ry(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ee(i,"beforeTitle",this,t),r=ee(i,"title",this,t),a=ee(i,"afterTitle",this,t);let o=[];return o=Ce(o,Be(s)),o=Ce(o,Be(r)),o=Ce(o,Be(a)),o}getBeforeBody(t,e){return Lc(ee(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return ft(t,r=>{const a={before:[],lines:[],after:[]},o=Ic(i,r);Ce(a.before,Be(ee(o,"beforeLabel",this,r))),Ce(a.lines,ee(o,"label",this,r)),Ce(a.after,Be(ee(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Lc(ee(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ee(i,"beforeFooter",this,t),r=ee(i,"footer",this,t),a=ee(i,"afterFooter",this,t);let o=[];return o=Ce(o,Be(s)),o=Ce(o,Be(r)),o=Ce(o,Be(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(Dy(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),ft(o,u=>{const d=Ic(t.callbacks,u);s.push(ee(d,"labelColor",this,u)),r.push(ee(d,"labelPointStyle",this,u)),a.push(ee(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=Ai[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=Ec(this,i),c=Object.assign({},o,l),u=Rc(this.chart,i,c),d=Ac(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=en(o),{x:h,y:g}=t,{width:m,height:b}=e;let _,w,M,S,k,D;return r==="center"?(k=g+b/2,s==="left"?(_=h,w=_-a,S=k+a,D=k-a):(_=h+m,w=_+a,S=k-a,D=k+a),M=_):(s==="left"?w=h+Math.max(l,u)+a:s==="right"?w=h+m-Math.max(c,d)-a:w=this.caretX,r==="top"?(S=g,k=S-a,_=w-a,M=w+a):(S=g+b,k=S+a,_=w+a,M=w-a),D=S),{x1:_,x2:w,x3:M,y1:S,y2:k,y3:D}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=$n(i.rtl,this.x,this.width);for(t.x=Ns(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=kt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=kt(r.bodyFont),d=Ns(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,m=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},_=s.leftForLtr(h,c)+c/2,w=m+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Nr(t,b,_,w),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Nr(t,b,_,w)}else{t.lineWidth=nt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const b=s.leftForLtr(h,c),_=s.leftForLtr(s.xPlus(h,1),c-2),w=en(a.borderRadius);Object.values(w).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Yn(t,{x:b,y:m,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Yn(t,{x:_,y:m+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,m,c,l),t.strokeRect(b,m,c,l),t.fillStyle=a.backgroundColor,t.fillRect(_,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=kt(i.bodyFont);let h=d.lineHeight,g=0;const m=$n(i.rtl,this.x,this.width),b=function(p){e.fillText(p,m.x(t.x+g),t.y+h/2),t.y+=h+r},_=m.textAlign(a);let w,M,S,k,D,O,P;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=Ns(this,_,i),e.fillStyle=i.bodyColor,ft(this.beforeBody,b),g=o&&_!=="right"?a==="center"?c/2+u:c+2+u:0,k=0,O=s.length;k<O;++k){for(w=s[k],M=this.labelTextColors[k],e.fillStyle=M,ft(w.before,b),S=w.lines,o&&S.length&&(this._drawColorBox(e,t,k,m,i),h=Math.max(d.lineHeight,l)),D=0,P=S.length;D<P;++D)b(S[D]),h=d.lineHeight;ft(w.after,b)}g=0,h=d.lineHeight,ft(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=$n(i.rtl,this.x,this.width);for(t.x=Ns(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=kt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:g,bottomRight:m}=en(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+d,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-h,l),e.quadraticCurveTo(o+c,l,o+c,l+h),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-m),e.quadraticCurveTo(o+c,l+u,o+c-m,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const a=Ai[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Ec(this,t),l=Object.assign({},a,this._size),c=Rc(e,t,l),u=Ac(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=zt(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),yl(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),bl(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!ls(i,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!ls(a,r)||o;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=Ai[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}C(ua,"positioners",Ai);var Fs={id:"tooltip",_element:ua,positioners:Ai,afterInit(n,t,e){e&&(n.tooltip=new ua({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:Nc},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"]},Ay=Object.freeze({__proto__:null,Colors:Um,Decimation:Km,Filler:my,Legend:vy,SubTitle:Sy,Title:ky,Tooltip:Fs});const Ly=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Iy(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Ly(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Ny=(n,t)=>n===null?null:Wt(Math.round(n),0,t);function Fc(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class da extends kn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(J(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Iy(i,t,Q(e,t),this._addedLabels),Ny(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Fc.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}}C(da,"id","category"),C(da,"defaults",{ticks:{callback:Fc}});function Fy(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,m=u-1,{min:b,max:_}=t,w=!J(a),M=!J(o),S=!J(c),k=(_-b)/(d+1);let D=jo((_-b)/m/g)*g,O,P,p,x;if(D<1e-14&&!w&&!M)return[{value:b},{value:_}];x=Math.ceil(_/D)-Math.floor(b/D),x>m&&(D=jo(x*D/m/g)*g),J(l)||(O=Math.pow(10,l),D=Math.ceil(D*O)/O),s==="ticks"?(P=Math.floor(b/D)*D,p=Math.ceil(_/D)*D):(P=b,p=_),w&&M&&r&&Af((o-a)/r,D/1e3)?(x=Math.round(Math.min((o-a)/D,u)),D=(o-a)/x,P=a,p=o):S?(P=w?a:P,p=M?o:p,x=c-1,D=(p-P)/x):(x=(p-P)/D,fi(x,Math.round(x),D/1e3)?x=Math.round(x):x=Math.ceil(x));const T=Math.max($o(D),$o(P));O=Math.pow(10,J(l)?T:l),P=Math.round(P*O)/O,p=Math.round(p*O)/O;let E=0;for(w&&(h&&P!==a?(e.push({value:a}),P<a&&E++,fi(Math.round((P+E*D)*O)/O,a,zc(a,k,n))&&E++):P<a&&E++);E<x;++E){const A=Math.round((P+E*D)*O)/O;if(M&&A>o)break;e.push({value:A})}return M&&h&&p!==o?e.length&&fi(e[e.length-1].value,o,zc(o,k,n))?e[e.length-1].value=o:e.push({value:o}):(!M||p===o)&&e.push({value:p}),e}function zc(n,t,{horizontal:e,minRotation:i}){const s=Ft(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class zs extends kn{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 J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=De(s),c=De(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=Fy(s,r);return t.bounds==="ticks"&&Vo(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return mi(t,this.chart.options.locale,this.options.ticks.format)}}class ha extends zs{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?t:0,this.max=Mt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ft(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}C(ha,"id","linear"),C(ha,"defaults",{ticks:{callback:ps.formatters.numeric}});const Li=n=>Math.floor(Je(n)),Sn=(n,t)=>Math.pow(10,Li(n)+t);function Bc(n){return n/Math.pow(10,Li(n))===1}function Hc(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function zy(n,t){const e=t-n;let i=Li(e);for(;Hc(n,t,i)>10;)i++;for(;Hc(n,t,i)<10;)i--;return Math.min(i,Li(n))}function By(n,{min:t,max:e}){t=ce(n.min,t);const i=[],s=Li(t);let r=zy(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=ce(n.min,Math.round((l+u+d*Math.pow(10,r))*a)/a);for(;h<e;)i.push({value:h,major:Bc(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,a=r>=0?1:a),h=Math.round((l+u+d*Math.pow(10,r))*a)/a;const g=ce(n.max,h);return i.push({value:g,major:Bc(g),significand:d}),i}class fa extends kn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=zs.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Mt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?Math.max(0,t):null,this.max=Mt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Mt(this._userMin)&&(this.min=t===Sn(this.min,0)?Sn(this.min,-1):Sn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(Sn(i,-1)),a(Sn(s,1)))),i<=0&&r(Sn(s,-1)),s<=0&&a(Sn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=By(e,this);return t.bounds==="ticks"&&Vo(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":mi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Je(t),this._valueRange=Je(this.max)-Je(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Je(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}C(fa,"id","logarithmic"),C(fa,"defaults",{ticks:{callback:ps.formatters.logarithmic,major:{enabled:!0}}});function ga(n){const t=n.ticks;if(t.display&&n.display){const e=zt(t.backdropPadding);return Q(t.font&&t.font.size,_t.font.size)+e.height}return 0}function Hy(n,t,e){return e=ut(e)?e:[e],{w:Kf(n,t.string,e),h:e.length*t.lineHeight}}function Wc(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Wy(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,a=n.options.pointLabels,o=a.centerPointLabels?rt/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),d=kt(c.font),h=Hy(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=ue(n.getIndexAngle(l)+o),m=Math.round(hs(g)),b=Wc(m,u.x,h.w,0,180),_=Wc(m,u.y,h.h,90,270);Yy(e,t,g,b,_)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=$y(n,i,s)}function Yy(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function jy(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(hs(ue(l.angle+xt))),u=Xy(l.y,o.h,c),d=Uy(c),h=qy(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+o.w,bottom:u+o.h}}function Vy(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Ne({x:e,y:i},t)||Ne({x:e,y:r},t)||Ne({x:s,y:i},t)||Ne({x:s,y:r},t))}function $y(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:ga(r)/2,additionalAngle:a?rt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=jy(n,u,l);i.push(d),o==="auto"&&(d.visible=Vy(d,c),d.visible&&(c=d))}return i}function Uy(n){return n===0||n===180?"center":n<180?"left":"right"}function qy(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Xy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Gy(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!J(o)){const l=en(t.borderRadius),c=zt(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=a-s+c.height;Object.values(l).some(m=>m!==0)?(n.beginPath(),Yn(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function Ky(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const a=i.setContext(n.getPointLabelContext(s));Gy(e,a,r);const o=kt(a.font),{x:l,y:c,textAlign:u}=r;_n(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Yc(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,bt);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function Zy(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Yc(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function Qy(n,t,e){return nn(n,{label:e,index:t,type:"pointLabel"})}class Ii extends zs{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=zt(ga(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=Mt(t)&&!isNaN(t)?t:0,this.max=Mt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ga(this.options))}generateTickLabels(t){zs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=ht(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Wy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=bt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ue(t*e+Ft(i))}getDistanceFromCenterForValue(t){if(J(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(J(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 Qy(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-xt+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Yc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&Ky(this,a),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),m=r.setContext(h);Zy(this,g,l,a,m)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=kt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=zt(c.backdropPadding);t.fillRect(-a/2-d.left,-r-u.size/2-d.top,a+d.width,u.size+d.height)}_n(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}C(Ii,"id","radialLinear"),C(Ii,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ps.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),C(Ii,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),C(Ii,"descriptors",{angleLines:{_fallback:"grid"}});const Bs={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}},ne=Object.keys(Bs);function jc(n,t){return n-t}function Vc(n,t){if(J(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),Mt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(tn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function $c(n,t,e,i){const s=ne.length;for(let r=ne.indexOf(n);r<s-1;++r){const a=Bs[ne[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return ne[r]}return ne[s-1]}function Jy(n,t,e,i,s){for(let r=ne.length-1;r>=ne.indexOf(e);r--){const a=ne[r];if(Bs[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return ne[e?ne.indexOf(e):0]}function tb(n){for(let t=ne.indexOf(n)+1,e=ne.length;t<e;++t)if(Bs[ne[t]].common)return ne[t]}function Uc(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Or(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function eb(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function qc(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:eb(n,i,s,e)}class Ni extends kn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Nl._date(t.adapters.date);s.init(e),hi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Vc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Mt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Mt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,a=this.max,o=Ff(s,r,a);return this._unit=e.unit||(i.autoSkip?$c(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Jy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:tb(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),qc(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Wt(e,0,a),i=Wt(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||$c(r.minUnit,e,i,this._getLabelCapacity(e)),o=Q(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=tn(l)||l===!0,u={};let d=e,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h<i;h=+t.add(h,o,a),g++)Uc(u,h,m);return(h===i||s.bounds==="ticks"||g===1)&&Uc(u,h,m),Object.keys(u).sort(jc).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return ht(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],h=i[e],g=c&&d&&h&&h.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Ft(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,qc(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Vc(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xo(t.sort(jc))}}C(Ni,"id","time"),C(Ni,"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 Hs(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Ie(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Ie(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class pa extends Ni{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=Hs(e,this.min),this._tableRange=Hs(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Hs(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Hs(this._table,i*this._tableRange+this._minPos,!0)}}C(pa,"id","timeseries"),C(pa,"defaults",Ni.defaults);var nb=Object.freeze({__proto__:null,CategoryScale:da,LinearScale:ha,LogarithmicScale:fa,RadialLinearScale:Ii,TimeScale:Ni,TimeSeriesScale:pa});const ib=[dp,Bm,Ay,nb],sb=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],rb=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],ab=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],ob=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Xc=(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 ma(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?ob:ab:t.binary?rb:sb,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let a;if(t.minimumFractionDigits!==void 0&&(a={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(a={maximumFractionDigits:t.maximumFractionDigits,...a}),n<1){const u=Xc(n,t.locale,a);return r+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,a||(n=n.toPrecision(3));const l=Xc(Number(n),t.locale,a),c=e[o];return r+l+i+c}const Gc=6048e5,lb=864e5,Fi=6e4,qn=36e5,cb=1e3,Kc=Symbol.for("constructDateFrom");function Ot(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Kc in n?n[Kc](t):n instanceof Date?new n.constructor(t):new Date(t)}function tt(n,t){return Ot(t||n,n)}function Ws(n,t,e){const i=tt(n,e==null?void 0:e.in);return isNaN(t)?Ot((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ya(n,t,e){const i=tt(n,e==null?void 0:e.in);if(isNaN(t))return Ot(n,NaN);if(!t)return i;const s=i.getDate(),r=Ot(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ba(n,t,e){return Ot(n,+tt(n)+t)}function ub(n,t,e){return ba(n,t*qn)}let db={};function Dn(){return db}function Pe(n,t){var o,l,c,u;const e=Dn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=tt(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Xn(n,t){return Pe(n,{...t,weekStartsOn:1})}function Zc(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ot(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Xn(s),a=Ot(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Xn(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Ys(n){const t=tt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Tn(n,...t){const e=Ot.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function xa(n,t){const e=tt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Qc(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=xa(i),a=xa(s),o=+r-Ys(r),l=+a-Ys(a);return Math.round((o-l)/lb)}function hb(n,t){const e=Zc(n,t),i=Ot(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Xn(i)}function fb(n,t,e){const i=tt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*Fi),i}function gb(n,t,e){return ya(n,t*3,e)}function pb(n,t,e){return ba(n,t*1e3)}function mb(n,t,e){return Ws(n,t*7,e)}function yb(n,t,e){return ya(n,t*12,e)}function zi(n,t){const e=+tt(n)-+tt(t);return e<0?-1:e>0?1:e}function bb(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function _a(n){return!(!bb(n)&&typeof n!="number"||isNaN(+tt(n)))}function xb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function _b(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Jc(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=tu(i,s),a=Math.abs(Qc(i,s));i.setDate(i.getDate()-r*a);const o=+(tu(i,s)===-r),l=r*(a-o);return l===0?0:l}function tu(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Bi(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function wb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=(+i-+s)/qn;return Bi(e==null?void 0:e.roundingMethod)(r)}function wa(n,t){return+tt(n)-+tt(t)}function vb(n,t,e){const i=wa(n,t)/Fi;return Bi(e==null?void 0:e.roundingMethod)(i)}function eu(n,t){const e=tt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function nu(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Mb(n,t){const e=tt(n,t==null?void 0:t.in);return+eu(e,t)==+nu(e,t)}function iu(n,t,e){const[i,s,r]=Tn(e==null?void 0:e.in,n,n,t),a=zi(s,r),o=Math.abs(xb(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=zi(s,r)===-a;Mb(i)&&o===1&&zi(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function kb(n,t,e){const i=iu(n,t,e)/3;return Bi(e==null?void 0:e.roundingMethod)(i)}function Sb(n,t,e){const i=wa(n,t)/1e3;return Bi(e==null?void 0:e.roundingMethod)(i)}function Db(n,t,e){const i=Jc(n,t,e)/7;return Bi(e==null?void 0:e.roundingMethod)(i)}function Tb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=zi(i,s),a=Math.abs(_b(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=zi(i,s)===-r,l=r*(a-+o);return l===0?0:l}function Cb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function Pb(n,t){const e=tt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Ob(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function su(n,t){const e=tt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Eb(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function Rb(n,t){var o,l;const e=Dn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=tt(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Ab(n,t){const e=tt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Lb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function Ib(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const Nb={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"}},Fb=(n,t,e)=>{let i;const s=Nb[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function va(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const zb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Wb={date:va({formats:zb,defaultWidth:"full"}),time:va({formats:Bb,defaultWidth:"full"}),dateTime:va({formats:Hb,defaultWidth:"full"})},Yb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jb=(n,t,e,i)=>Yb[n];function Hi(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Vb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$b={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ub={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"]},qb={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"]},Xb={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"}},Gb={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"}},Kb={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Hi({values:Vb,defaultWidth:"wide"}),quarter:Hi({values:$b,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Hi({values:Ub,defaultWidth:"wide"}),day:Hi({values:qb,defaultWidth:"wide"}),dayPeriod:Hi({values:Xb,defaultWidth:"wide",formattingValues:Gb,defaultFormattingWidth:"wide"})};function Wi(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Qb(o,d=>d.test(a)):Zb(o,d=>d.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function Zb(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Qb(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Jb(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const t0=/^(\d+)(th|st|nd|rd)?/i,e0=/\d+/i,n0={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},i0={any:[/^b/i,/^(a|c)/i]},s0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},r0={any:[/1/i,/2/i,/3/i,/4/i]},a0={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},o0={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]},l0={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},c0={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]},u0={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},d0={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}},h0={ordinalNumber:Jb({matchPattern:t0,parsePattern:e0,valueCallback:n=>parseInt(n,10)}),era:Wi({matchPatterns:n0,defaultMatchWidth:"wide",parsePatterns:i0,defaultParseWidth:"any"}),quarter:Wi({matchPatterns:s0,defaultMatchWidth:"wide",parsePatterns:r0,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Wi({matchPatterns:a0,defaultMatchWidth:"wide",parsePatterns:o0,defaultParseWidth:"any"}),day:Wi({matchPatterns:l0,defaultMatchWidth:"wide",parsePatterns:c0,defaultParseWidth:"any"}),dayPeriod:Wi({matchPatterns:u0,defaultMatchWidth:"any",parsePatterns:d0,defaultParseWidth:"any"})},ru={code:"en-US",formatDistance:Fb,formatLong:Wb,formatRelative:jb,localize:Kb,match:h0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function f0(n,t){const e=tt(n,t==null?void 0:t.in);return Qc(e,su(e))+1}function au(n,t){const e=tt(n,t==null?void 0:t.in),i=+Xn(e)-+hb(e);return Math.round(i/Gc)+1}function Ma(n,t){var u,d,h,g;const e=tt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Dn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,a=Ot((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=Pe(a,t),l=Ot((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Pe(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function g0(n,t){var o,l,c,u;const e=Dn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Ma(n,t),r=Ot((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Pe(r,t)}function ou(n,t){const e=tt(n,t==null?void 0:t.in),i=+Pe(e,t)-+g0(e,t);return Math.round(i/Gc)+1}function gt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const on={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return gt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):gt(e+1,2)},d(n,t){return gt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return gt(n.getHours()%12||12,t.length)},H(n,t){return gt(n.getHours(),t.length)},m(n,t){return gt(n.getMinutes(),t.length)},s(n,t){return gt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return gt(s,t.length)}},Gn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lu={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return on.y(n,t)},Y:function(n,t,e,i){const s=Ma(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return gt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):gt(r,t.length)},R:function(n,t){const e=Zc(n);return gt(e,t.length)},u:function(n,t){const e=n.getFullYear();return gt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return gt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return gt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return on.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return gt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ou(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):gt(s,t.length)},I:function(n,t,e){const i=au(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):gt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):on.d(n,t)},D:function(n,t,e){const i=f0(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):gt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return gt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return gt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return gt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Gn.noon:i===0?s=Gn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Gn.evening:i>=12?s=Gn.afternoon:i>=4?s=Gn.morning:s=Gn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return on.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):on.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):gt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):gt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):on.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):on.s(n,t)},S:function(n,t){return on.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return uu(i);case"XXXX":case"XX":return Cn(i);case"XXXXX":case"XXX":default:return Cn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return uu(i);case"xxxx":case"xx":return Cn(i);case"xxxxx":case"xxx":default:return Cn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cu(i,":");case"OOOO":default:return"GMT"+Cn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cu(i,":");case"zzzz":default:return"GMT"+Cn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return gt(i,t.length)},T:function(n,t,e){return gt(+n,t.length)}};function cu(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+gt(r,2)}function uu(n,t){return n%60===0?(n>0?"-":"+")+gt(Math.abs(n)/60,2):Cn(n,t)}function Cn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=gt(Math.trunc(i/60),2),r=gt(i%60,2);return e+s+t+r}const du=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},hu=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ka={p:hu,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return du(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",du(i,t)).replace("{{time}}",hu(s,t))}},p0=/^D+$/,m0=/^Y+$/,y0=["D","DD","YY","YYYY"];function fu(n){return p0.test(n)}function gu(n){return m0.test(n)}function Sa(n,t,e){const i=b0(n,t,e);if(console.warn(i),y0.includes(n))throw new RangeError(i)}function b0(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const x0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,w0=/^'([^]*?)'?$/,v0=/''/g,M0=/[a-zA-Z]/;function pu(n,t,e){var u,d,h,g,m,b,_,w;const i=Dn(),s=(e==null?void 0:e.locale)??i.locale??ru,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,a=(e==null?void 0:e.weekStartsOn)??((b=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((w=(_=i.locale)==null?void 0:_.options)==null?void 0:w.weekStartsOn)??0,o=tt(n,e==null?void 0:e.in);if(!_a(o))throw new RangeError("Invalid time value");let l=t.match(_0).map(M=>{const S=M[0];if(S==="p"||S==="P"){const k=ka[S];return k(M,s.formatLong)}return M}).join("").match(x0).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const S=M[0];if(S==="'")return{isToken:!1,value:k0(M)};if(lu[S])return{isToken:!0,value:M};if(S.match(M0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const S=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&gu(S)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&fu(S))&&Sa(S,t,String(n));const k=lu[S[0]];return k(o,S,s.localize,c)}).join("")}function k0(n){const t=n.match(w0);return t?t[1].replace(v0,"'"):n}function mu(){return Object.assign({},Dn())}function S0(n,t){const e=tt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function D0(n,t){const e=T0(t)?new t(0):Ot(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function T0(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const C0=10;class yu{constructor(){C(this,"subPriority",0)}validate(t,e){return!0}}class P0 extends yu{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class O0 extends yu{constructor(e,i){super();C(this,"priority",C0);C(this,"subPriority",-1);this.context=e||(s=>Ot(i,s))}set(e,i){return i.timestampIsSet?e:Ot(e,D0(e,this.context))}}class ot{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new P0(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class E0 extends ot{constructor(){super(...arguments);C(this,"priority",140);C(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Lt={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}/},Oe={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 It(n,t){return n&&{value:t(n.value),rest:n.rest}}function Tt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ee(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*qn+r*Fi+a*cb),rest:t.slice(e[0].length)}}function bu(n){return Tt(Lt.anyDigitsSigned,n)}function Et(n,t){switch(n){case 1:return Tt(Lt.singleDigit,t);case 2:return Tt(Lt.twoDigits,t);case 3:return Tt(Lt.threeDigits,t);case 4:return Tt(Lt.fourDigits,t);default:return Tt(new RegExp("^\\d{1,"+n+"}"),t)}}function js(n,t){switch(n){case 1:return Tt(Lt.singleDigitSigned,t);case 2:return Tt(Lt.twoDigitsSigned,t);case 3:return Tt(Lt.threeDigitsSigned,t);case 4:return Tt(Lt.fourDigitsSigned,t);default:return Tt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Da(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 xu(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function _u(n){return n%400===0||n%4===0&&n%100!==0}class R0 extends ot{constructor(){super(...arguments);C(this,"priority",130);C(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return It(Et(4,e),r);case"yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Et(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const o=xu(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class A0 extends ot{constructor(){super(...arguments);C(this,"priority",130);C(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return It(Et(4,e),r);case"Yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Et(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Ma(e,r);if(s.isTwoDigitYear){const l=xu(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Pe(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Pe(e,r)}}class L0 extends ot{constructor(){super(...arguments);C(this,"priority",130);C(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return js(i==="R"?4:i.length,e)}set(e,i,s){const r=Ot(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Xn(r)}}class I0 extends ot{constructor(){super(...arguments);C(this,"priority",130);C(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return js(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class N0 extends ot{constructor(){super(...arguments);C(this,"priority",120);C(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Et(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class F0 extends ot{constructor(){super(...arguments);C(this,"priority",120);C(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Et(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class z0 extends ot{constructor(){super(...arguments);C(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);C(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return It(Tt(Lt.month,e),r);case"MM":return It(Et(2,e),r);case"Mo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class B0 extends ot{constructor(){super(...arguments);C(this,"priority",110);C(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return It(Tt(Lt.month,e),r);case"LL":return It(Et(2,e),r);case"Lo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function H0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=ou(i,e)-t;return i.setDate(i.getDate()-s*7),tt(i,e==null?void 0:e.in)}class W0 extends ot{constructor(){super(...arguments);C(this,"priority",100);C(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Tt(Lt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Pe(H0(e,s,r),r)}}function Y0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=au(i,e)-t;return i.setDate(i.getDate()-s*7),i}class j0 extends ot{constructor(){super(...arguments);C(this,"priority",100);C(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Tt(Lt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return Xn(Y0(e,s))}}const V0=[31,28,31,30,31,30,31,31,30,31,30,31],$0=[31,29,31,30,31,30,31,31,30,31,30,31];class U0 extends ot{constructor(){super(...arguments);C(this,"priority",90);C(this,"subPriority",1);C(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Tt(Lt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Et(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=_u(s),a=e.getMonth();return r?i>=1&&i<=$0[a]:i>=1&&i<=V0[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class q0 extends ot{constructor(){super(...arguments);C(this,"priority",90);C(this,"subpriority",1);C(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Tt(Lt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Et(i.length,e)}}validate(e,i){const s=e.getFullYear();return _u(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Ta(n,t,e){var d,h,g,m;const i=Dn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.weekStartsOn)??0,r=tt(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Ws(r,u,e)}class X0 extends ot{constructor(){super(...arguments);C(this,"priority",90);C(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}class G0 extends ot{constructor(){super(...arguments);C(this,"priority",90);C(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return It(Et(i.length,e),a);case"eo":return It(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}class K0 extends ot{constructor(){super(...arguments);C(this,"priority",90);C(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return It(Et(i.length,e),a);case"co":return It(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}function Z0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=S0(i,e),r=t-s;return Ws(i,r,e)}class Q0 extends ot{constructor(){super(...arguments);C(this,"priority",90);C(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Et(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return It(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return It(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return It(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return It(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=Z0(e,s),e.setHours(0,0,0,0),e}}class J0 extends ot{constructor(){super(...arguments);C(this,"priority",80);C(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class tx extends ot{constructor(){super(...arguments);C(this,"priority",80);C(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class ex extends ot{constructor(){super(...arguments);C(this,"priority",80);C(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class nx extends ot{constructor(){super(...arguments);C(this,"priority",70);C(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Tt(Lt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class ix extends ot{constructor(){super(...arguments);C(this,"priority",70);C(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Tt(Lt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class sx extends ot{constructor(){super(...arguments);C(this,"priority",70);C(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Tt(Lt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class rx extends ot{constructor(){super(...arguments);C(this,"priority",70);C(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Tt(Lt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class ax extends ot{constructor(){super(...arguments);C(this,"priority",60);C(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Tt(Lt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class ox extends ot{constructor(){super(...arguments);C(this,"priority",50);C(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Tt(Lt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class lx extends ot{constructor(){super(...arguments);C(this,"priority",30);C(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return It(Et(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class cx extends ot{constructor(){super(...arguments);C(this,"priority",10);C(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ee(Oe.basicOptionalMinutes,e);case"XX":return Ee(Oe.basic,e);case"XXXX":return Ee(Oe.basicOptionalSeconds,e);case"XXXXX":return Ee(Oe.extendedOptionalSeconds,e);case"XXX":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ot(e,e.getTime()-Ys(e)-s)}}class ux extends ot{constructor(){super(...arguments);C(this,"priority",10);C(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ee(Oe.basicOptionalMinutes,e);case"xx":return Ee(Oe.basic,e);case"xxxx":return Ee(Oe.basicOptionalSeconds,e);case"xxxxx":return Ee(Oe.extendedOptionalSeconds,e);case"xxx":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ot(e,e.getTime()-Ys(e)-s)}}class dx extends ot{constructor(){super(...arguments);C(this,"priority",40);C(this,"incompatibleTokens","*")}parse(e){return bu(e)}set(e,i,s){return[Ot(e,s*1e3),{timestampIsSet:!0}]}}class hx extends ot{constructor(){super(...arguments);C(this,"priority",20);C(this,"incompatibleTokens","*")}parse(e){return bu(e)}set(e,i,s){return[Ot(e,s),{timestampIsSet:!0}]}}const fx={G:new E0,y:new R0,Y:new A0,R:new L0,u:new I0,Q:new N0,q:new F0,M:new z0,L:new B0,w:new W0,I:new j0,d:new U0,D:new q0,E:new X0,e:new G0,c:new K0,i:new Q0,a:new J0,b:new tx,B:new ex,h:new nx,H:new ix,K:new sx,k:new rx,m:new ax,s:new ox,S:new lx,X:new cx,x:new ux,t:new dx,T:new hx},gx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,px=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mx=/^'([^]*?)'?$/,yx=/''/g,bx=/\S/,xx=/[a-zA-Z]/;function _x(n,t,e,i){var _,w,M,S,k,D,O,P;const s=()=>Ot((i==null?void 0:i.in)||e,NaN),r=mu(),a=(i==null?void 0:i.locale)??r.locale??ru,o=(i==null?void 0:i.firstWeekContainsDate)??((w=(_=i==null?void 0:i.locale)==null?void 0:_.options)==null?void 0:w.firstWeekContainsDate)??r.firstWeekContainsDate??((S=(M=r.locale)==null?void 0:M.options)==null?void 0:S.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((D=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:D.weekStartsOn)??r.weekStartsOn??((P=(O=r.locale)==null?void 0:O.options)==null?void 0:P.weekStartsOn)??0;if(!t)return n?s():tt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new O0(i==null?void 0:i.in,e)],d=t.match(px).map(p=>{const x=p[0];if(x in ka){const T=ka[x];return T(p,a.formatLong)}return p}).join("").match(gx),h=[];for(let p of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&gu(p)&&Sa(p,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&fu(p)&&Sa(p,t,n);const x=p[0],T=fx[x];if(T){const{incompatibleTokens:E}=T;if(Array.isArray(E)){const L=h.find(F=>E.includes(F.token)||F.token===x);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${p}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);h.push({token:x,fullToken:p});const A=T.run(n,p,a.match,c);if(!A)return s();u.push(A.setter),n=A.rest}else{if(x.match(xx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");if(p==="''"?p="'":x==="'"&&(p=wx(p)),n.indexOf(p)===0)n=n.slice(p.length);else return s()}}if(n.length>0&&bx.test(n))return s();const g=u.map(p=>p.priority).sort((p,x)=>x-p).filter((p,x,T)=>T.indexOf(p)===x).map(p=>u.filter(x=>x.priority===p).sort((x,T)=>T.subPriority-x.subPriority)).map(p=>p[0]);let m=tt(e,i==null?void 0:i.in);if(isNaN(+m))return s();const b={};for(const p of g){if(!p.validate(m,c))return s();const x=p.set(m,b,c);Array.isArray(x)?(m=x[0],Object.assign(b,x[1])):m=x}return m}function wx(n){return n.match(mx)[1].replace(yx,"'")}function vx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Mx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function kx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Sx(n){const t=n/qn;return Math.trunc(t)}function wu(n,t){const e=()=>Ot(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Px(n);let r;if(s.date){const c=Ox(s.date,i);r=Ex(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=Rx(s.time),isNaN(o)))return e();if(s.timezone){if(l=Ax(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=tt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return tt(a+o+l,t==null?void 0:t.in)}const Vs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Dx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Cx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Px(n){const t={},e=n.split(Vs.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Vs.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Vs.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Vs.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Ox(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Ex(n,t){if(t===null)return new Date(NaN);const e=n.match(Dx);if(!e)return new Date(NaN);const i=!!e[4],s=Yi(e[1]),r=Yi(e[2])-1,a=Yi(e[3]),o=Yi(e[4]),l=Yi(e[5])-1;if(i)return zx(t,o,l)?Lx(t,o,l):new Date(NaN);{const c=new Date(0);return!Nx(t,r,a)||!Fx(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Yi(n){return n?parseInt(n):1}function Rx(n){const t=n.match(Tx);if(!t)return NaN;const e=Ca(t[1]),i=Ca(t[2]),s=Ca(t[3]);return Bx(e,i,s)?e*qn+i*Fi+s*1e3:NaN}function Ca(n){return n&&parseFloat(n.replace(",","."))||0}function Ax(n){if(n==="Z")return 0;const t=n.match(Cx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Hx(i,s)?e*(i*qn+s*Fi):NaN}function Lx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Ix=[31,null,31,30,31,30,31,31,30,31,30,31];function vu(n){return n%400===0||n%4===0&&n%100!==0}function Nx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Ix[t]||(vu(n)?29:28))}function Fx(n,t){return t>=1&&t<=(vu(n)?366:365)}function zx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Bx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Hx(n,t){return t>=0&&t<=59}const Pa=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((a,o)=>o.rawValue-a.rawValue);if(e.body&&!n.locked){const a=e.labelColors,o=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","doughnut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(h)?h:ma(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?$s.format(h):$s.format(Number(h.toFixed(Su)))} ${b}`}let m;return l&&u.dataset.label!==u.label?m=u.dataset.label:c?m=u.dataset.labels[u.dataIndex]:m=u.dataset.label,{backgroundColor:a[d].backgroundColor,borderColor:a[d].borderColor,label:m,value:g,rawValue:h,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Wx=n=>n&&n.datasets&&n.datasets.length,Yx=n=>Wx(n)&&n.datasets.some(t=>t.data.length),jx=n=>Yx(n)&&n.datasets.some(t=>t.data.length>1),Vx=n=>jx(n)&&n.datasets.some(t=>t.data[0]&&_a(t.data[0].x)),$x=n=>Vx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Oa=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},Ux=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Mu(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const ku=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},Su=2,Du=10,Tu=12,$s=new Intl.NumberFormat(((Bh=document==null?void 0:document.documentElement)==null?void 0:Bh.lang)||"en-US"),Us=10,Cu={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},He=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],qs=(n,t)=>(t||He)[n%He.length],Pu=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},Ou="#6f7787",Eu={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},qx=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Eu[t])==null?void 0:e.background)||"#fafafa"},Xx={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},Gx={"4XX":"#FFBA81","5XX":"#FF8484"},Kx={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},Zx="#dad4c7",Ru="#afb7c5",Qx=n=>{const t=Object.entries(Cu).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Cu.standard},Ea=(n,t,e,i)=>{let s;return e?s=Ru:Array.isArray(i)?s=qs(n,i):s=i[t],s||qs(n)},Jx={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},t_=2,e_=0,Ra=new Map,Aa=(n,t)=>t==="bytes"?ma(n):t==="count/minute"?n.toFixed(2):$s.format(n),Au=n=>{const e=document.createElement("canvas").getContext("2d"),i=kt({});return e.font=i.string,e.measureText(n).width},n_=()=>{const n="label_height";if(!Ra.has(n)){const t=kt({});Ra.set(n,t.lineHeight)}return Ra.get(n)},i_=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),Lu=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),Iu=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,La="#e0e4ea",s_={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"]},ji=(n,t)=>{let e=1;const i=s_[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},Nu=new Map([[100,ji("100",[100,101,102,103])],[200,ji("200",[200,201,202,203,204,205,206,207,208,226])],[300,ji("300",[300,301,302,303,304,305,307,308])],[400,ji("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,ji("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Ia=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=Nu.get(e);return i===void 0?La:i.get(t)??i.get(-1)??La},r_=n=>{const t=Ia(n);return{solid:t,light:t}},Xs={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Ia(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function Fu(n,t,e){const i=mu(),s=l_(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?a_(s,t):o_(s,t)}function a_(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function o_(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function l_(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function c_(n,t){const e=g_(t);return"formatToParts"in e?d_(e,n):h_(e,n)}const u_={year:0,month:1,day:2,hour:3,minute:4,second:5};function d_(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=u_[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function h_(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Na={},zu=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),f_=zu==="06/25/2014, 00:00:00"||zu==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function g_(n){return Na[n]||(Na[n]=f_?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Na[n]}function Bu(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Hu=36e5,p_=6e4,Fa={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function za(n,t,e){if(!n)return 0;let i=Fa.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Fa.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Wu(s)?-(s*Hu):NaN;if(i=Fa.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Wu(s,a)?(r=Math.abs(s)*Hu+a*p_,i[1]==="+"?-r:r):NaN}if(b_(n)){t=new Date(t||Date.now());const a=e?t:m_(t),o=Ba(a,n);return-(e?o:y_(t,o,n))}return NaN}function m_(n){return Bu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ba(n,t){const e=c_(n,t),i=Bu(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function y_(n,t,e){let s=n.getTime()-t;const r=Ba(new Date(s),e);if(t===r)return t;s-=r-t;const a=Ba(new Date(s),e);return r===a?r:Math.max(r,a)}function Wu(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Yu={};function b_(n){if(Yu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Yu[n]=!0,!0}catch{return!1}}const x_=60*1e3,__={X:function(n,t,e){const i=Ha(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return ju(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=Ha(e.timeZone,n);switch(t){case"x":return ju(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=Ha(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+w_(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Fu("short",n,e);case"zzzz":default:return Fu("long",n,e)}}};function Ha(n,t){const e=n?za(n,t,!0)/x_:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Gs(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Gs(Math.floor(i/60),2),r=Gs(Math.floor(i%60),2);return e+s+t+r}function ju(n,t){return n%60===0?(n>0?"-":"+")+Gs(Math.abs(n)/60,2):Kn(n,t)}function w_(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Gs(r,2)}function Vu(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const v_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Wa=36e5,$u=6e4,M_=2,Xt={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:v_};function Uu(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?M_:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=k_(n),{year:s,restDateString:r}=S_(i.date,e),a=D_(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=T_(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=za(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Vu(new Date(o+l)),c=Vu(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function k_(n){const t={};let e=Xt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Xt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function S_(n,t){if(n){const e=Xt.YYY[t],i=Xt.YYYYY[t];let s=Xt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Xt.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function D_(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=Xt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Gu(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Xt.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return O_(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=Xt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return Gu(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=Xt.Www.exec(n),r)return s=parseInt(r[1],10)-1,Ku(s)?qu(t,s):new Date(NaN);if(r=Xt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Ku(s,a)?qu(t,s,a):new Date(NaN)}return null}function T_(n){let t,e,i=Xt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ya(t)?t%24*Wa:NaN;if(i=Xt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ya(t,e)?t%24*Wa+e*$u:NaN;if(i=Xt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ya(t,e,s)?t%24*Wa+e*$u+s*1e3:NaN}return null}function qu(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const C_=[31,28,31,30,31,30,31,31,30,31,30,31],P_=[31,29,31,30,31,30,31,31,30,31,30,31];function Xu(n){return n%400===0||n%4===0&&n%100!==0}function Gu(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Xu(n);if(i&&e>P_[t]||!i&&e>C_[t])return!1}return!0}function O_(n,t){if(t<1)return!1;const e=Xu(n);return!(e&&t>366||!e&&t>365)}function Ku(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ya(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const E_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ja(n,t,e={}){t=String(t);const i=t.match(E_);if(i){const s=Uu(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+__[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return pu(n,t,e)}function R_(n,t,e){n=Uu(n,e);const i=za(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Pn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},ja(R_(n,t,{timeZone:i.timeZone}),e,i)}const A_=Intl.DateTimeFormat().resolvedOptions().timeZone,Zu=(n,t,e,i=A_)=>["secondly","tenSecondly","thirtySecondly"].includes(t)?Pn(n,i,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a"):["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly"].includes(t)?Pn(n,i,e?"yyyy-MM-dd h:mm a":"h:mm a"):t==="twelveHourly"?Pn(n,i,"yyyy-MM-dd h:mm a"):t==="daily"?Pn(n,i,"yyyy-MM-dd"):t==="weekly"?`${Pn(n,i,"yyyy")} W${Pn(n,i,"II")}`:Pn(n,i,"yyyy-MM-dd h:mm:ss a");function L_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:a=>({label:a.dataset.label,value:a.label})}};Fs.positioners.barChartTooltipPosition=function(a,o){if(!a.length)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=l.width/2,d=Oa(o,c,u),h=o.y,g=o.x<u?"left":"center";return{x:d-n.tooltipState.offsetX,y:h-n.tooltipState.offsetY,xAlign:g}},Qr.modes.customInteractionMode=function(a,o){const l=sn(o,a),c=[];return Qr.evaluateInteractionItems(a,a.options.indexAxis||"x",l,(u,d,h)=>{a.options.indexAxis==="y"&&u.inYRange(l.y,!0)&&a.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h}),a.options.indexAxis==="x"&&u.inXRange(l.x,!0)&&a.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h})}),c};const e=n.numLabels.value>25?Du:Tu,i=({chart:a,index:o})=>{var c;const l=a.data;return{size:e,style:(c=l==null?void 0:l.isLabelEmpty)!=null&&c[o]?"italic":"normal"}},s=(a,o,l)=>a.chart.options.indexAxis===a.axis?(o=a.getLabelForValue(l),o&&o.length>Us?o.slice(0,Us)+"...":o):a.getLabelForValue(Number(o));return f.computed(()=>{var a,o,l,c,u,d,h,g;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:i,callback:function(m,b){return s(this,m,b)}},title:{display:n.indexAxis==="y"?!J((a=n.metricAxesTitle)==null?void 0:a.value):!J((o=n.dimensionAxesTitle)==null?void 0:o.value),text:n.indexAxis==="y"?(l=n.metricAxesTitle)==null?void 0:l.value:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:i,callback:function(m,b){return s(this,m,b)}},title:{display:n.indexAxis==="x"?!J((u=n.metricAxesTitle)==null?void 0:u.value):!J((d=n.dimensionAxesTitle)==null?void 0:d.value),text:n.indexAxis==="x"?(h=n.metricAxesTitle)==null?void 0:h.value:(g=n.dimensionAxesTitle)==null?void 0:g.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:m=>{Pa(n.tooltipState,m)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}ge.register(...ib);const I_=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function N_(n,t,e,i,s){const r=f.shallowRef(null),a=(o,l)=>{if(t.value)return new ge(t.value,{type:n,data:o,plugins:i,options:l})};return f.onMounted(()=>{r.value=a(e.value,s.value)}),f.onBeforeUnmount(()=>{J(r.value)||r.value.destroy()}),f.watch(e,(o,l)=>{if(I_(l,o)&&!J(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else J(r.value)||r.value.destroy(),r.value=a(o,s.value)}),f.watch(t,()=>{J(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),f.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(J(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var ie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Va(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Qu={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(m,b){b&&b%3===0&&h.push(d),h.push(m)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<a?d=e(c,r,u)+"m":c<o?d=t(e(c,a,u),u)+"b":d=t(e(c,o,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Qu);var F_=Qu.exports;const Vi=Va(F_);function z_(n,t,e){const{i18n:i}=lt.useI18n(),{translateUnit:s}=lt.useTranslatedUnits();return{legendValues:f.computed(()=>n.value.datasets.reduce((a,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":ma(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:Vi(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${Vi(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...a,[o.label]:{raw:l,formatted:c,isThreshold:o.isThreshold}}},{}))}}var B_=Object.defineProperty,H_=(n,t,e)=>t in n?B_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,pe=(n,t,e)=>H_(n,typeof t!="symbol"?t+"":t,e),Ct=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(Ct||{});const W_=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],$i=n=>n.filter(t=>t!=="time"),Ju=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],Y_=$i(Ju),j_=[...Ju,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version"],V_=$i(j_),$_=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],U_=$i($_);$i(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),$i(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Y_),new Set(V_),new Set(U_);const td=6048e5,q_=864e5,X_=60,G_=3600,ed=Symbol.for("constructDateFrom");function me(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ed in n?n[ed](t):n instanceof Date?new n.constructor(t):new Date(t)}function Gt(n,t){return me(t||n,n)}function nd(n,t,e){const i=Gt(n,void 0);return isNaN(t)?me(n,NaN):(i.setDate(i.getDate()+t),i)}function K_(n,t,e){const i=Gt(n,void 0);if(isNaN(t))return me(n,NaN);const s=i.getDate(),r=me(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let Z_={};function Ui(){return Z_}function We(n,t){var e,i,s,r;const a=Ui(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=Gt(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Ks(n,t){return We(n,{...t,weekStartsOn:1})}function id(n,t){const e=Gt(n,void 0),i=e.getFullYear(),s=me(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Ks(s),a=me(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Ks(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function sd(n){const t=Gt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Q_(n,...t){const e=me.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Zs(n,t){const e=Gt(n,void 0);return e.setHours(0,0,0,0),e}function J_(n,t,e){const[i,s]=Q_(void 0,n,t),r=Zs(i),a=Zs(s),o=+r-sd(r),l=+a-sd(a);return Math.round((o-l)/q_)}function tw(n,t){const e=id(n),i=me(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ks(i)}function ew(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function nw(n){return!(!ew(n)&&typeof n!="number"||isNaN(+Gt(n)))}function Zn(n,t){const e=Gt(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function iw(n,t){const e=Gt(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const sw={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"}},rw=(n,t,e)=>{let i;const s=sw[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function $a(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const aw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ow={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cw={date:$a({formats:aw,defaultWidth:"full"}),time:$a({formats:ow,defaultWidth:"full"}),dateTime:$a({formats:lw,defaultWidth:"full"})},uw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dw=(n,t,e,i)=>uw[n];function qi(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const hw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},fw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gw={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"]},pw={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"]},mw={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"}},yw={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"}},bw=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},xw={ordinalNumber:bw,era:qi({values:hw,defaultWidth:"wide"}),quarter:qi({values:fw,defaultWidth:"wide",argumentCallback:n=>n-1}),month:qi({values:gw,defaultWidth:"wide"}),day:qi({values:pw,defaultWidth:"wide"}),dayPeriod:qi({values:mw,defaultWidth:"wide",formattingValues:yw,defaultFormattingWidth:"wide"})};function Xi(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?ww(o,d=>d.test(a)):_w(o,d=>d.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function _w(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function ww(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function vw(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const Mw=/^(\d+)(th|st|nd|rd)?/i,kw=/\d+/i,Sw={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},Dw={any:[/^b/i,/^(a|c)/i]},Tw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Cw={any:[/1/i,/2/i,/3/i,/4/i]},Pw={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},Ow={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]},Ew={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},Rw={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]},Aw={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},Lw={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}},Iw={ordinalNumber:vw({matchPattern:Mw,parsePattern:kw,valueCallback:n=>parseInt(n,10)}),era:Xi({matchPatterns:Sw,defaultMatchWidth:"wide",parsePatterns:Dw,defaultParseWidth:"any"}),quarter:Xi({matchPatterns:Tw,defaultMatchWidth:"wide",parsePatterns:Cw,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Xi({matchPatterns:Pw,defaultMatchWidth:"wide",parsePatterns:Ow,defaultParseWidth:"any"}),day:Xi({matchPatterns:Ew,defaultMatchWidth:"wide",parsePatterns:Rw,defaultParseWidth:"any"}),dayPeriod:Xi({matchPatterns:Aw,defaultMatchWidth:"any",parsePatterns:Lw,defaultParseWidth:"any"})},Nw={code:"en-US",formatDistance:rw,formatLong:cw,formatRelative:dw,localize:xw,match:Iw,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Fw(n,t){const e=Gt(n,void 0);return J_(e,iw(e))+1}function zw(n,t){const e=Gt(n,void 0),i=+Ks(e)-+tw(e);return Math.round(i/td)+1}function rd(n,t){var e,i,s,r;const a=Gt(n,t==null?void 0:t.in),o=a.getFullYear(),l=Ui(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=me((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=We(u,t),h=me((t==null?void 0:t.in)||n,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const g=We(h,t);return+a>=+d?o+1:+a>=+g?o:o-1}function Bw(n,t){var e,i,s,r;const a=Ui(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=rd(n,t),c=me((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),We(c,t)}function Hw(n,t){const e=Gt(n,t==null?void 0:t.in),i=+We(e,t)-+Bw(e,t);return Math.round(i/td)+1}function pt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const ln={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return pt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):pt(e+1,2)},d(n,t){return pt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return pt(n.getHours()%12||12,t.length)},H(n,t){return pt(n.getHours(),t.length)},m(n,t){return pt(n.getMinutes(),t.length)},s(n,t){return pt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return pt(s,t.length)}},Qn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ad={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return ln.y(n,t)},Y:function(n,t,e,i){const s=rd(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return pt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):pt(r,t.length)},R:function(n,t){const e=id(n);return pt(e,t.length)},u:function(n,t){const e=n.getFullYear();return pt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return pt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return pt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return ln.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return pt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Hw(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):pt(s,t.length)},I:function(n,t,e){const i=zw(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):pt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):ln.d(n,t)},D:function(n,t,e){const i=Fw(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):pt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return pt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return pt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return pt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Qn.noon:i===0?s=Qn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Qn.evening:i>=12?s=Qn.afternoon:i>=4?s=Qn.morning:s=Qn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return ln.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):ln.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):pt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):pt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):ln.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):ln.s(n,t)},S:function(n,t){return ln.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ld(i);case"XXXX":case"XX":return On(i);case"XXXXX":case"XXX":default:return On(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return ld(i);case"xxxx":case"xx":return On(i);case"xxxxx":case"xxx":default:return On(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+od(i,":");case"OOOO":default:return"GMT"+On(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+od(i,":");case"zzzz":default:return"GMT"+On(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return pt(i,t.length)},T:function(n,t,e){return pt(+n,t.length)}};function od(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+pt(r,2)}function ld(n,t){return n%60===0?(n>0?"-":"+")+pt(Math.abs(n)/60,2):On(n,t)}function On(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=pt(Math.trunc(i/60),2),r=pt(i%60,2);return e+s+t+r}const cd=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ud=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ww=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return cd(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",cd(i,t)).replace("{{time}}",ud(s,t))},Yw={p:ud,P:Ww},jw=/^D+$/,Vw=/^Y+$/,$w=["D","DD","YY","YYYY"];function Uw(n){return jw.test(n)}function qw(n){return Vw.test(n)}function Xw(n,t,e){const i=Gw(n,t,e);if(console.warn(i),$w.includes(n))throw new RangeError(i)}function Gw(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Kw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qw=/^'([^]*?)'?$/,Jw=/''/g,t1=/[a-zA-Z]/;function e1(n,t,e){var i,s,r,a,o,l,c,u;const d=Ui(),h=(e==null?void 0:e.locale)??d.locale??Nw,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(r=d.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,m=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,b=Gt(n,e==null?void 0:e.in);if(!nw(b))throw new RangeError("Invalid time value");let _=t.match(Zw).map(M=>{const S=M[0];if(S==="p"||S==="P"){const k=Yw[S];return k(M,h.formatLong)}return M}).join("").match(Kw).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const S=M[0];if(S==="'")return{isToken:!1,value:n1(M)};if(ad[S])return{isToken:!0,value:M};if(S.match(t1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:M}});h.localize.preprocessor&&(_=h.localize.preprocessor(b,_));const w={firstWeekContainsDate:g,weekStartsOn:m,locale:h};return _.map(M=>{if(!M.isToken)return M.value;const S=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&qw(S)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Uw(S))&&Xw(S,t,String(n));const k=ad[S[0]];return k(b,S,h.localize,w)}).join("")}function n1(n){const t=n.match(Qw);return t?t[1].replace(Jw,"'"):n}function i1(n,t){const e=Gt(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=me(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function s1(){return Object.assign({},Ui())}function r1(n){return Math.trunc(n*G_)}function a1(n){const t=n/X_;return Math.trunc(t)}function dd(n,t,e){return K_(n,-t)}function hd(n,t,e){const i=s1(),s=c1(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?o1(s,t):l1(s,t)}function o1(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function l1(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function c1(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function u1(n,t){const e=p1(t);return"formatToParts"in e?h1(e,n):f1(e,n)}const d1={year:0,month:1,day:2,hour:3,minute:4,second:5};function h1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=d1[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function f1(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Ua={},fd=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),g1=fd==="06/25/2014, 00:00:00"||fd==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function p1(n){return Ua[n]||(Ua[n]=g1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ua[n]}function qa(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const gd=36e5,m1=6e4,Xa={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Gi(n,t,e){if(!n)return 0;let i=Xa.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Xa.timezoneHH.exec(n),i)return s=parseInt(i[1],10),pd(s)?-(s*gd):NaN;if(i=Xa.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return pd(s,a)?(r=Math.abs(s)*gd+a*m1,i[1]==="+"?-r:r):NaN}if(x1(n)){t=new Date(t||Date.now());const a=e?t:y1(t),o=Ga(a,n);return-(e?o:b1(t,o,n))}return NaN}function y1(n){return qa(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ga(n,t){const e=u1(n,t),i=qa(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function b1(n,t,e){let i=n.getTime()-t;const s=Ga(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ga(new Date(i),e);return s===r?s:Math.max(s,r)}function pd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const md={};function x1(n){if(md[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),md[n]=!0,!0}catch{return!1}}const _1=60*1e3,w1={X:function(n,t,e){const i=Ka(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return yd(i);case"XXXX":case"XX":return Jn(i);case"XXXXX":case"XXX":default:return Jn(i,":")}},x:function(n,t,e){const i=Ka(e.timeZone,n);switch(t){case"x":return yd(i);case"xxxx":case"xx":return Jn(i);case"xxxxx":case"xxx":default:return Jn(i,":")}},O:function(n,t,e){const i=Ka(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+v1(i,":");case"OOOO":default:return"GMT"+Jn(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return hd("short",n,e);case"zzzz":default:return hd("long",n,e)}}};function Ka(n,t){const e=n?Gi(n,t,!0)/_1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Qs(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Jn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Qs(Math.floor(i/60),2),r=Qs(Math.floor(i%60),2);return e+s+t+r}function yd(n,t){return n%60===0?(n>0?"-":"+")+Qs(Math.abs(n)/60,2):Jn(n,t)}function v1(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Qs(r,2)}function bd(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const xd=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Za=36e5,_d=6e4,M1=2,Kt={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:xd};function Js(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?M1:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=k1(n),{year:s,restDateString:r}=S1(i.date,e),a=D1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=T1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Gi(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=bd(new Date(o+l)),c=bd(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function k1(n){const t={};let e=Kt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Kt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Kt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function S1(n,t){if(n){const e=Kt.YYY[t],i=Kt.YYYYY[t];let s=Kt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Kt.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function D1(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=Kt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Md(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Kt.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return O1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=Kt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return Md(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=Kt.Www.exec(n),r)return s=parseInt(r[1],10)-1,kd(s)?wd(t,s):new Date(NaN);if(r=Kt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return kd(s,a)?wd(t,s,a):new Date(NaN)}return null}function T1(n){let t,e,i=Kt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Qa(t)?t%24*Za:NaN;if(i=Kt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Qa(t,e)?t%24*Za+e*_d:NaN;if(i=Kt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Qa(t,e,s)?t%24*Za+e*_d+s*1e3:NaN}return null}function wd(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const C1=[31,28,31,30,31,30,31,31,30,31,30,31],P1=[31,29,31,30,31,30,31,31,30,31,30,31];function vd(n){return n%400===0||n%4===0&&n%100!==0}function Md(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=vd(n);if(i&&e>P1[t]||!i&&e>C1[t])return!1}return!0}function O1(n,t){if(t<1)return!1;const e=vd(n);return!(e&&t>366||!e&&t>365)}function kd(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Qa(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const E1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function R1(n,t,e={}){t=String(t);const i=t.match(E1);if(i){const s=Js(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+w1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return e1(n,t,e)}function Sd(n,t,e){n=Js(n,e);const i=Gi(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function A1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},R1(Sd(n,t,{timeZone:i.timeZone}),e,i)}function L1(n,t,e){if(typeof n=="string"&&!n.match(xd))return Js(n,{...e,timeZone:t});n=Js(n,e);const i=qa(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Gi(t,new Date(i));return new Date(i+s)}function I1(n,t){return-Gi(n,t)}function Dd(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return A1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const N1={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Ja(n){return n&&W_.find(t=>n<=N1[t])||null}const ti=(n,t)=>new Date(n.getTime()-I1(t,n));class ve{constructor(t){pe(this,"timeframeText"),pe(this,"key"),pe(this,"display"),pe(this,"timeframeLength"),pe(this,"allowedTiers"),pe(this,"defaultResponseGranularity"),pe(this,"dataGranularity"),pe(this,"isRelative"),pe(this,"fineGrainedDefaultGranularity"),pe(this,"_startCustom"),pe(this,"_endCustom"),pe(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=L1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Sd(e,t)}}class F1 extends ve{rawStart(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ti(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class z1 extends ve{rawStart(t){let e=Zn(this.tzAdjustedDate(t));return t&&(e=ti(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class B1 extends ve{rawEnd(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ti(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=We(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=ti(i,t)),i}}class H1 extends ve{rawEnd(t){let e=Zn(this.tzAdjustedDate(t));return t&&(e=ti(e,t)),e}rawStart(t){let e=Zn(dd(this.tzAdjustedDate(t),1));return t&&(e=ti(e,t)),e}}Ct.FIFTEEN_MIN,new ve({key:Ct.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),Ct.ONE_HOUR,new ve({key:Ct.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),Ct.SIX_HOUR,new ve({key:Ct.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.TWELVE_HOUR,new ve({key:Ct.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.ONE_DAY,new ve({key:Ct.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.SEVEN_DAY,new ve({key:Ct.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Ct.THIRTY_DAY,new ve({key:Ct.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Ct.CURRENT_WEEK,new F1({key:Ct.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=We(new Date,{weekStartsOn:1});return(Zs(nd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Ct.CURRENT_MONTH,new z1({key:Ct.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Zn(new Date);return(Zs(nd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Ct.PREVIOUS_WEEK,new B1({key:Ct.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Ct.PREVIOUS_MONTH,new H1({key:Ct.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Zn(new Date),e=Zn(dd(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=W1(t,e)),60*60*24*i1(new Date().setMonth(new Date().getMonth()-1))+r1(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function W1(n,t){return a1(n.getTimezoneOffset()-t.getTimezoneOffset())}function Y1(n){return f.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Dd(e)} - ${Dd(i,{includeTZ:!0})}`:""})}function j1(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Fs.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),a=n.tooltipState.width||this.width,o=r.width/2,l=Oa(s,a,o),c=s.y,u=s.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Pa(n.tooltipState,i)}}}}))}}function V1(n){const t=f.computed(()=>{var a,o;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return Zu(c,n.granularity.value,s.value)}},title:{display:!J((a=n.dimensionAxesTitle)==null?void 0:a.value),text:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=f.computed(()=>{var a,o;return{title:{display:!J((a=n.metricAxesTitle)==null?void 0:a.value),text:(o=n.metricAxesTitle)==null?void 0:o.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),i={enabled:!1,position:"lineChartTooltipPosition"};Fs.positioners.lineChartTooltipPosition=function(a,o){if(!a.length||n.tooltipState.locked)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=n.tooltipState.height||this.height,d=l.width/2,h=l.height/2,g=Oa(o,c,d);let m=Ux(o,u,h);const b=o.y<h?"top":"bottom",_=o.x<d?"left":"center";return u>l.height&&(m=0),{x:g,y:m,xAlign:_,yAlign:b}};const s=f.computed(()=>{const a=Number(n.timeRangeMs.value),o=new Date,l=new Date(o.getTime()-a);return Sx(a)>24||l.getDate()!==o.getDate()});return{options:f.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:a=>{Pa(n.tooltipState,a)}}},interaction:{mode:"index",intersect:!1}}))}}function $1(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=lt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:qs(i.indexOf(u),He),data:a.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h=Ea(d,u.name,u.id==="empty",o);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:h,data:a.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function U1(n,t){const{i18n:e}=lt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0;if(!s.length||!a)return{datasets:[],labels:[]};const u=c&&o||a,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(p=>a.map((x,T)=>{const E=p.event[d],A=c?`${E},${x}`:`${T},${x}`,L=p.event[x];return[A,L]})):s.map(p=>{const x=c?`${p.event[d]},${p.event[h]}`:`${d},${h}`,T=p.event[a[0]];return[x,T]})),m=Object.keys(g).reduce((p,x)=>{const[T]=x.split(","),E=g[x];return p[T]?p[T]+=E:p[T]=E,p},{}),b=Object.entries(m).sort(([,p],[,x])=>Number(x)-Number(p)).map(([p])=>p),_=r[d],w=r[h],M=c&&_&&Object.entries(_).map(([p,x])=>({id:p,name:x.name}))||a.map(p=>({id:p,name:p})),S=c&&w&&Object.entries(w).map(([p,x])=>({id:p,name:x.name}))||a.map(p=>({id:p,name:p}));if(d!=="status_code"&&d!=="status_code_grouped"&&(M.sort((p,x)=>b.indexOf(p.id)-b.indexOf(x.id)),S.sort((p,x)=>b.indexOf(p.id)-b.indexOf(x.id))),!M||!S)return{labels:[],datasets:[]};const k=$1({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:u,barSegmentLabels:S,pivotRecords:g,rowLabels:M,colorPalette:n.colorPalette||He}),D=c?M.map(p=>e&&e.te(`chartLabels.${p.name}`)&&e.t(`chartLabels.${p.name}`)||p.name):a.map(p=>e&&e.te(`chartLabels.${p}`)&&e.t(`chartLabels.${p}`)||p),O=M.map(p=>p.id==="empty");return{labels:D,datasets:k,isLabelEmpty:O}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const q1="#6c7489",X1="#6c7489",G1="#995c00",K1="20px",Td="24px",Z1="40px",Q1="48px",J1=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),tv=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return wu(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},ev=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return J1(o,l,e)};function nv(n,t){const{i18n:e}=lt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],d=r[u],h=r&&d&&Object.keys(d).map(k=>({id:k,name:d[k].name}))||a.map(k=>({id:k,name:k})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const m=tv(o),b=ev(o,l,g,m,s),_=new Set,w=s!=null&&s.length?s.reduce((k,D)=>{const O=new Date(D.timestamp).valueOf(),P=D.event;for(const p of a)_.add(p),O in k||(k[O]={}),p in k[O]||(k[O][p]={});for(const p of a)h.forEach(x=>{P[u]===x.id||p===x.id?(k[O][p]||(k[O][p]={}),k[O][p][x.name]=Math.round(Number(P[p])*1e3)/1e3):c.length||(k[O][p]||(k[O][p]={}),k[O][p][x.name]=Math.round(Number(P[x.id])*1e3)/1e3)});return k},{}):{},S=[...a.length===1?a.flatMap(k=>h.map(D=>[k,D.name,D.id==="empty"])):h.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,D,O],P)=>{const p=b.map(A=>A in w&&k in w[A]?{x:A,y:w[A][k][D]||0}:{x:A,y:0});let{colorPalette:x,fill:T}=n;J(x)&&(x=He);const E=Ea(P,D,O,x);return{rawDimension:D,rawMetric:k,label:e&&e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||D,borderColor:E,backgroundColor:E,data:p,total:p.reduce((A,{y:L})=>A+Number(L),0),...Jx,fill:T,borderWidth:T?e_:t_,isSegmentEmpty:O}});if(u==="status_code"||u==="status_code_grouped"?S.sort((k,D)=>(k.label??"")<(D.label??"")?-1:1):S.sort((k,D)=>Number(k.total)<Number(D.total)?-1:1),n.threshold)for(const k of Object.keys(n.threshold)){const D=n.threshold[k];D&&S.push({type:"line",rawMetric:k,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:q1,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(O=>({x:O,y:D}))})}return{datasets:S}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const iv=(n,t)=>{f.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function sv(){const{i18n:n}=lt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const rv="analytics-query-provider";function av(){const n=f.inject(rv);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const lt={useBarChartOptions:L_,useChartJSCommon:N_,useChartLegendValues:z_,useChartSelectedRange:Y1,useExploreResultToDatasets:U1,useExploreResultToTimeDataset:nv,useDoughnutChartOptions:j1,useLinechartOptions:V1,useI18n:tf,useReportChartDataForSynthetics:iv,useTranslatedUnits:sv,useEvaluateFeatureFlag:av};var Pt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Pt||{});/*!
18
+ `):n}function Lb(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Zu(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=Et(t.bodyFont),c=Et(t.titleFont),u=Et(t.footerFont),d=r.length,h=s.length,g=i.length,m=jt(t.padding);let b=m.height,w=0,v=i.reduce((k,T)=>k+T.before.length+T.lines.length+T.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*k+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let S=0;const D=function(k){w=Math.max(w,e.measureText(k).width+S)};return e.save(),e.font=c.string,xt(n.title,D),e.font=l.string,xt(n.beforeBody.concat(n.afterBody),D),S=t.displayColors?o+2+t.boxPadding:0,xt(i,k=>{xt(k.before,D),xt(k.lines,D),xt(k.after,D)}),S=0,e.font=u.string,xt(n.footer,D),e.restore(),w+=m.width,{width:w,height:b}}function Ib(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Nb(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Fb(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Nb(c,n,t,e)&&(c="center"),c}function Qu(n,t,e){const i=e.yAlign||t.yAlign||Ib(n,e);return{xAlign:e.xAlign||t.xAlign||Fb(n,t,e,i),yAlign:i}}function zb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Bb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ju(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=_n(o);let m=zb(t,a);const b=Bb(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,h)+s:a==="right"&&(m+=Math.max(d,g)+s),{x:Xt(m,0,i.width-t.width),y:Xt(b,0,i.height-t.height)}}function vr(n,t,e){const i=jt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function td(n){return $e([],rn(n))}function Hb(n,t,e){return xn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ed(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const nd={beforeTitle:Qe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Qe,beforeBody:Qe,beforeLabel:Qe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return st(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function ge(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?nd[t].call(e,i):s}class aa extends Gt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Ho(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Hb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ge(i,"beforeTitle",this,t),r=ge(i,"title",this,t),o=ge(i,"afterTitle",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}getBeforeBody(t,e){return td(ge(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return xt(t,r=>{const o={before:[],lines:[],after:[]},a=ed(i,r);$e(o.before,rn(ge(a,"beforeLabel",this,r))),$e(o.lines,ge(a,"label",this,r)),$e(o.after,rn(ge(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return td(ge(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ge(i,"beforeFooter",this,t),r=ge(i,"footer",this,t),o=ge(i,"afterFooter",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Lb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),xt(a,u=>{const d=ed(t.callbacks,u);s.push(ge(d,"labelColor",this,u)),r.push(ge(d,"labelPointStyle",this,u)),o.push(ge(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=us[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=Zu(this,i),c=Object.assign({},a,l),u=Qu(this.chart,i,c),d=Ju(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=_n(a),{x:h,y:g}=t,{width:m,height:b}=e;let w,v,S,D,k,T;return r==="center"?(k=g+b/2,s==="left"?(w=h,v=w-o,D=k+o,T=k-o):(w=h+m,v=w+o,D=k-o,T=k+o),S=w):(s==="left"?v=h+Math.max(l,u)+o:s==="right"?v=h+m-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,k=D-o,w=v-o,S=v+o):(D=g+b,k=D+o,w=v+o,S=v-o),T=D),{x1:w,x2:v,x3:S,y1:D,y2:k,y3:T}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=Et(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=Et(r.bodyFont),d=vr(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,m=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=s.leftForLtr(h,c)+c/2,v=m+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ro(t,b,w,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ro(t,b,w,v)}else{t.lineWidth=lt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(h,c),w=s.leftForLtr(s.xPlus(h,1),c-2),v=_n(o.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ui(t,{x:b,y:m,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ui(t,{x:w,y:m+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,m,c,l),t.strokeRect(b,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(w,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=Et(i.bodyFont);let h=d.lineHeight,g=0;const m=fi(i.rtl,this.x,this.width),b=function(p){e.fillText(p,m.x(t.x+g),t.y+h/2),t.y+=h+r},w=m.textAlign(o);let v,S,D,k,T,A,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=vr(this,w,i),e.fillStyle=i.bodyColor,xt(this.beforeBody,b),g=a&&w!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,A=s.length;k<A;++k){for(v=s[k],S=this.labelTextColors[k],e.fillStyle=S,xt(v.before,b),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,k,m,i),h=Math.max(d.lineHeight,l)),T=0,E=D.length;T<E;++T)b(D[T]),h=d.lineHeight;xt(v.after,b)}g=0,h=d.lineHeight,xt(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=Et(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:g,bottomRight:m}=_n(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-h,l),e.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-m),e.quadraticCurveTo(a+c,l+u,a+c-m,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zu(this,t),l=Object.assign({},o,this._size),c=Qu(e,t,l),u=Ju(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=jt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),Fc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),zc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Xs(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Xs(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=us[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}P(aa,"positioners",us);var Mr={id:"tooltip",_element:aa,positioners:us,afterInit(n,t,e){e&&(n.tooltip=new aa({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Wb=Object.freeze({__proto__:null,Colors:tb,Decimation:sb,Filler:Sb,Legend:Pb,SubTitle:Rb,Title:Ab,Tooltip:Mr});const Yb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function jb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Yb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Vb=(n,t)=>n===null?null:Xt(Math.round(n),0,t);function id(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class la extends Un{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:jb(i,t,it(e,t),this._addedLabels),Vb(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return id.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(la,"id","category"),P(la,"defaults",{ticks:{callback:id}});function $b(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,m=u-1,{min:b,max:w}=t,v=!st(o),S=!st(a),D=!st(c),k=(w-b)/(d+1);let T=cc((w-b)/m/g)*g,A,E,p,_;if(T<1e-14&&!v&&!S)return[{value:b},{value:w}];_=Math.ceil(w/T)-Math.floor(b/T),_>m&&(T=cc(_*T/m/g)*g),st(l)||(A=Math.pow(10,l),T=Math.ceil(T*A)/A),s==="ticks"?(E=Math.floor(b/T)*T,p=Math.ceil(w/T)*T):(E=b,p=w),v&&S&&r&&Wg((a-o)/r,T/1e3)?(_=Math.round(Math.min((a-o)/T,u)),T=(a-o)/_,E=o,p=a):D?(E=v?o:E,p=S?a:p,_=c-1,T=(p-E)/_):(_=(p-E)/T,Vi(_,Math.round(_),T/1e3)?_=Math.round(_):_=Math.ceil(_));const C=Math.max(dc(T),dc(E));A=Math.pow(10,st(l)?C:l),E=Math.round(E*A)/A,p=Math.round(p*A)/A;let R=0;for(v&&(h&&E!==o?(e.push({value:o}),E<o&&R++,Vi(Math.round((E+R*T)*A)/A,o,sd(o,k,n))&&R++):E<o&&R++);R<_;++R){const L=Math.round((E+R*T)*A)/A;if(S&&L>a)break;e.push({value:L})}return S&&h&&p!==a?e.length&&Vi(e[e.length-1].value,a,sd(a,k,n))?e[e.length-1].value=a:e.push({value:a}):(!S||p===a)&&e.push({value:p}),e}function sd(n,t,{horizontal:e,minRotation:i}){const s=Yt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Sr extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=je(s),c=je(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=$b(s,r);return t.bounds==="ticks"&&uc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return qi(t,this.chart.options.locale,this.options.ticks.format)}}class ca extends Sr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?t:0,this.max=Pt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(ca,"id","linear"),P(ca,"defaults",{ticks:{callback:er.formatters.numeric}});const ds=n=>Math.floor(yn(n)),qn=(n,t)=>Math.pow(10,ds(n)+t);function rd(n){return n/Math.pow(10,ds(n))===1}function od(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Ub(n,t){const e=t-n;let i=ds(e);for(;od(n,t,i)>10;)i++;for(;od(n,t,i)<10;)i--;return Math.min(i,ds(n))}function qb(n,{min:t,max:e}){t=ke(n.min,t);const i=[],s=ds(t);let r=Ub(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=ke(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<e;)i.push({value:h,major:rd(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=ke(n.max,h);return i.push({value:g,major:rd(g),significand:d}),i}class ua extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Sr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Pt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?Math.max(0,t):null,this.max=Pt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pt(this._userMin)&&(this.min=t===qn(this.min,0)?qn(this.min,-1):qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(qn(i,-1)),o(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&o(qn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=qb(e,this);return t.bounds==="ticks"&&uc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=yn(t),this._valueRange=yn(this.max)-yn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(yn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(ua,"id","logarithmic"),P(ua,"defaults",{ticks:{callback:er.formatters.logarithmic,major:{enabled:!0}}});function da(n){const t=n.ticks;if(t.display&&n.display){const e=jt(t.backdropPadding);return it(t.font&&t.font.size,Ot.font.size)+e.height}return 0}function Xb(n,t,e){return e=bt(e)?e:[e],{w:sp(n,t.string,e),h:e.length*t.lineHeight}}function ad(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Gb(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?ut/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=Et(c.font),h=Xb(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=De(n.getIndexAngle(l)+a),m=Math.round(Qs(g)),b=ad(m,u.x,h.w,0,180),w=ad(m,u.y,h.h,90,270);Kb(e,t,g,b,w)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Jb(n,i,s)}function Kb(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function Zb(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Qs(De(l.angle+Ct))),u=n0(l.y,a.h,c),d=t0(c),h=e0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function Qb(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function Jb(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:da(r)/2,additionalAngle:o?ut/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=Zb(n,u,l);i.push(d),a==="auto"&&(d.visible=Qb(d,c),d.visible&&(c=d))}return i}function t0(n){return n===0||n===180?"center":n<180?"left":"right"}function e0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function n0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function i0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=_n(t.borderRadius),c=jt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=o-s+c.height;Object.values(l).some(m=>m!==0)?(n.beginPath(),ui(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function s0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));i0(e,o,r);const a=Et(o.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function ld(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,St);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function r0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),ld(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function o0(n,t,e){return xn(n,{label:e,index:t,type:"pointLabel"})}class hs extends Sr{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=jt(da(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pt(t)&&!isNaN(t)?t:0,this.max=Pt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){Sr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=_t(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Gb(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=St/(this._pointLabels.length||1),i=this.options.startAngle||0;return De(t*e+Yt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return o0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ct+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),ld(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&s0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),m=r.setContext(h);r0(this,g,l,o,m)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Et(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=jt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Yn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(hs,"id","radialLinear"),P(hs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:er.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(hs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(hs,"descriptors",{angleLines:{_fallback:"grid"}});const kr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},pe=Object.keys(kr);function cd(n,t){return n-t}function ud(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Pt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(bn(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function dd(n,t,e,i){const s=pe.length;for(let r=pe.indexOf(n);r<s-1;++r){const o=kr[pe[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return pe[r]}return pe[s-1]}function a0(n,t,e,i,s){for(let r=pe.length-1;r>=pe.indexOf(e);r--){const o=pe[r];if(kr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return pe[e?pe.indexOf(e):0]}function l0(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(kr[pe[t]].common)return pe[t]}function hd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=To(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function c0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function fd(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:c0(n,i,s,e)}class fs extends Un{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new nu._date(t.adapters.date);s.init(e),ji(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ud(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Pt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Pt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=$g(s,r,o);return this._unit=e.unit||(i.autoSkip?dd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):a0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:l0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),fd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Xt(e,0,o),i=Xt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||dd(r.minUnit,e,i,this._getLabelCapacity(e)),a=it(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=bn(l)||l===!0,u={};let d=e,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h<i;h=+t.add(h,a,o),g++)hd(u,h,m);return(h===i||s.bounds==="ticks"||g===1)&&hd(u,h,m),Object.keys(u).sort(cd).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return _t(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[e],g=c&&d&&h&&h.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Yt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,fd(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(ud(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gc(t.sort(cd))}}P(fs,"id","time"),P(fs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Dr(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tn(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tn(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class ha extends fs{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Dr(e,this.min),this._tableRange=Dr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Dr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Dr(this._table,i*this._tableRange+this._minPos,!0)}}P(ha,"id","timeseries"),P(ha,"defaults",fs.defaults);var u0=Object.freeze({__proto__:null,CategoryScale:la,LinearScale:ca,LogarithmicScale:ua,RadialLinearScale:hs,TimeScale:fs,TimeSeriesScale:ha});const d0=[_m,qy,Wb,u0],h0=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],f0=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],g0=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],p0=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],gd=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function fa(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?p0:g0:t.binary?f0:h0,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),n<1){const u=gd(n,t.locale,o);return r+u+i+e[0]}const a=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**a,o||(n=n.toPrecision(3));const l=gd(Number(n),t.locale,o),c=e[a];return r+l+i+c}const pd=6048e5,m0=864e5,gs=6e4,pi=36e5,y0=1e3,md=Symbol.for("constructDateFrom");function Nt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&md in n?n[md](t):n instanceof Date?new n.constructor(t):new Date(t)}function rt(n,t){return Nt(t||n,n)}function Tr(n,t,e){const i=rt(n,e==null?void 0:e.in);return isNaN(t)?Nt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ga(n,t,e){const i=rt(n,e==null?void 0:e.in);if(isNaN(t))return Nt(n,NaN);if(!t)return i;const s=i.getDate(),r=Nt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function pa(n,t,e){return Nt(n,+rt(n)+t)}function b0(n,t,e){return pa(n,t*pi)}let _0={};function Xn(){return _0}function Ue(n,t){var a,l,c,u;const e=Xn(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=rt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function mi(n,t){return Ue(n,{...t,weekStartsOn:1})}function yd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Nt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=mi(s),o=Nt(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=mi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Cr(n){const t=rt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Gn(n,...t){const e=Nt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ma(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function bd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ma(i),o=ma(s),a=+r-Cr(r),l=+o-Cr(o);return Math.round((a-l)/m0)}function x0(n,t){const e=yd(n,t),i=Nt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),mi(i)}function w0(n,t,e){const i=rt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*gs),i}function v0(n,t,e){return ga(n,t*3,e)}function M0(n,t,e){return pa(n,t*1e3)}function S0(n,t,e){return Tr(n,t*7,e)}function k0(n,t,e){return ga(n,t*12,e)}function ps(n,t){const e=+rt(n)-+rt(t);return e<0?-1:e>0?1:e}function D0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ya(n){return!(!D0(n)&&typeof n!="number"||isNaN(+rt(n)))}function T0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function C0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function _d(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=xd(i,s),o=Math.abs(bd(i,s));i.setDate(i.getDate()-r*o);const a=+(xd(i,s)===-r),l=r*(o-a);return l===0?0:l}function xd(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function ms(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function O0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/pi;return ms(e==null?void 0:e.roundingMethod)(r)}function ba(n,t){return+rt(n)-+rt(t)}function P0(n,t,e){const i=ba(n,t)/gs;return ms(e==null?void 0:e.roundingMethod)(i)}function wd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function vd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function E0(n,t){const e=rt(n,t==null?void 0:t.in);return+wd(e,t)==+vd(e,t)}function Md(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),o=ps(s,r),a=Math.abs(T0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ps(s,r)===-o;E0(i)&&a===1&&ps(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function A0(n,t,e){const i=Md(n,t,e)/3;return ms(e==null?void 0:e.roundingMethod)(i)}function R0(n,t,e){const i=ba(n,t)/1e3;return ms(e==null?void 0:e.roundingMethod)(i)}function L0(n,t,e){const i=_d(n,t,e)/7;return ms(e==null?void 0:e.roundingMethod)(i)}function I0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ps(i,s),o=Math.abs(C0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-r,l=r*(o-+a);return l===0?0:l}function N0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function F0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function z0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Sd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function B0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function H0(n,t){var a,l;const e=Xn(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=rt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function W0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Y0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function j0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const V0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$0=(n,t,e)=>{let i;const s=V0[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function _a(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const U0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},X0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G0={date:_a({formats:U0,defaultWidth:"full"}),time:_a({formats:q0,defaultWidth:"full"}),dateTime:_a({formats:X0,defaultWidth:"full"})},K0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z0=(n,t,e,i)=>K0[n];function ys(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Q0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},J0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},t_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},e_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},n_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},i_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},s_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ys({values:Q0,defaultWidth:"wide"}),quarter:ys({values:J0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ys({values:t_,defaultWidth:"wide"}),day:ys({values:e_,defaultWidth:"wide"}),dayPeriod:ys({values:n_,defaultWidth:"wide",formattingValues:i_,defaultFormattingWidth:"wide"})};function bs(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?o_(a,d=>d.test(o)):r_(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function r_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function o_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function a_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const l_=/^(\d+)(th|st|nd|rd)?/i,c_=/\d+/i,u_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},d_={any:[/^b/i,/^(a|c)/i]},h_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},f_={any:[/1/i,/2/i,/3/i,/4/i]},g_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},p_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},m_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},y_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},b_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},__={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},x_={ordinalNumber:a_({matchPattern:l_,parsePattern:c_,valueCallback:n=>parseInt(n,10)}),era:bs({matchPatterns:u_,defaultMatchWidth:"wide",parsePatterns:d_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:h_,defaultMatchWidth:"wide",parsePatterns:f_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bs({matchPatterns:g_,defaultMatchWidth:"wide",parsePatterns:p_,defaultParseWidth:"any"}),day:bs({matchPatterns:m_,defaultMatchWidth:"wide",parsePatterns:y_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:b_,defaultMatchWidth:"any",parsePatterns:__,defaultParseWidth:"any"})},kd={code:"en-US",formatDistance:$0,formatLong:G0,formatRelative:Z0,localize:s_,match:x_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function w_(n,t){const e=rt(n,t==null?void 0:t.in);return bd(e,Sd(e))+1}function Dd(n,t){const e=rt(n,t==null?void 0:t.in),i=+mi(e)-+x0(e);return Math.round(i/pd)+1}function xa(n,t){var u,d,h,g;const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=Nt((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ue(o,t),l=Nt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ue(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function v_(n,t){var a,l,c,u;const e=Xn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=xa(n,t),r=Nt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ue(r,t)}function Td(n,t){const e=rt(n,t==null?void 0:t.in),i=+Ue(e,t)-+v_(e,t);return Math.round(i/pd)+1}function wt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Sn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return wt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):wt(e+1,2)},d(n,t){return wt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return wt(n.getHours()%12||12,t.length)},H(n,t){return wt(n.getHours(),t.length)},m(n,t){return wt(n.getMinutes(),t.length)},s(n,t){return wt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return wt(s,t.length)}},yi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cd={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Sn.y(n,t)},Y:function(n,t,e,i){const s=xa(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return wt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):wt(r,t.length)},R:function(n,t){const e=yd(n);return wt(e,t.length)},u:function(n,t){const e=n.getFullYear();return wt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return wt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return wt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Sn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return wt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Td(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):wt(s,t.length)},I:function(n,t,e){const i=Dd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):wt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Sn.d(n,t)},D:function(n,t,e){const i=w_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):wt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return wt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return wt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return wt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=yi.noon:i===0?s=yi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=yi.evening:i>=12?s=yi.afternoon:i>=4?s=yi.morning:s=yi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Sn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Sn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):wt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):wt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Sn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Sn.s(n,t)},S:function(n,t){return Sn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Pd(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Pd(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Od(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Od(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return wt(i,t.length)},T:function(n,t,e){return wt(+n,t.length)}};function Od(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+wt(r,2)}function Pd(n,t){return n%60===0?(n>0?"-":"+")+wt(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=wt(Math.trunc(i/60),2),r=wt(i%60,2);return e+s+t+r}const Ed=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ad=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},wa={p:Ad,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ed(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Ed(i,t)).replace("{{time}}",Ad(s,t))}},M_=/^D+$/,S_=/^Y+$/,k_=["D","DD","YY","YYYY"];function Rd(n){return M_.test(n)}function Ld(n){return S_.test(n)}function va(n,t,e){const i=D_(n,t,e);if(console.warn(i),k_.includes(n))throw new RangeError(i)}function D_(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const T_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O_=/^'([^]*?)'?$/,P_=/''/g,E_=/[a-zA-Z]/;function Id(n,t,e){var u,d,h,g,m,b,w,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??kd,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((b=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((v=(w=i.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??0,a=rt(n,e==null?void 0:e.in);if(!ya(a))throw new RangeError("Invalid time value");let l=t.match(C_).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=wa[D];return k(S,s.formatLong)}return S}).join("").match(T_).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:A_(S)};if(Cd[D])return{isToken:!0,value:S};if(D.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Ld(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Rd(D))&&va(D,t,String(n));const k=Cd[D[0]];return k(a,D,s.localize,c)}).join("")}function A_(n){const t=n.match(O_);return t?t[1].replace(P_,"'"):n}function Nd(){return Object.assign({},Xn())}function R_(n,t){const e=rt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function L_(n,t){const e=I_(t)?new t(0):Nt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function I_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const N_=10;class Fd{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class F_ extends Fd{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class z_ extends Fd{constructor(e,i){super();P(this,"priority",N_);P(this,"subPriority",-1);this.context=e||(s=>Nt(i,s))}set(e,i){return i.timestampIsSet?e:Nt(e,L_(e,this.context))}}class pt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new F_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class B_ extends pt{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Ht={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},qe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Wt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Rt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Xe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*pi+r*gs+o*y0),rest:t.slice(e[0].length)}}function zd(n){return Rt(Ht.anyDigitsSigned,n)}function Ft(n,t){switch(n){case 1:return Rt(Ht.singleDigit,t);case 2:return Rt(Ht.twoDigits,t);case 3:return Rt(Ht.threeDigits,t);case 4:return Rt(Ht.fourDigits,t);default:return Rt(new RegExp("^\\d{1,"+n+"}"),t)}}function Or(n,t){switch(n){case 1:return Rt(Ht.singleDigitSigned,t);case 2:return Rt(Ht.twoDigitsSigned,t);case 3:return Rt(Ht.threeDigitsSigned,t);case 4:return Rt(Ht.fourDigitsSigned,t);default:return Rt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ma(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Bd(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function Hd(n){return n%400===0||n%4===0&&n%100!==0}class H_ extends pt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Ft(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=Bd(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class W_ extends pt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Ft(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=xa(e,r);if(s.isTwoDigitYear){const l=Bd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}}class Y_ extends pt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Or(i==="R"?4:i.length,e)}set(e,i,s){const r=Nt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),mi(r)}}class j_ extends pt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Or(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class V_ extends pt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Ft(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class $_ extends pt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Ft(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class U_ extends pt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Wt(Rt(Ht.month,e),r);case"MM":return Wt(Ft(2,e),r);case"Mo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class q_ extends pt{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return Wt(Rt(Ht.month,e),r);case"LL":return Wt(Ft(2,e),r);case"Lo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function X_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Td(i,e)-t;return i.setDate(i.getDate()-s*7),rt(i,e==null?void 0:e.in)}class G_ extends pt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Rt(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ue(X_(e,s,r),r)}}function K_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Dd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Z_ extends pt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Rt(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return mi(K_(e,s))}}const Q_=[31,28,31,30,31,30,31,31,30,31,30,31],J_=[31,29,31,30,31,30,31,31,30,31,30,31];class tx extends pt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Rt(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Hd(s),o=e.getMonth();return r?i>=1&&i<=J_[o]:i>=1&&i<=Q_[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class ex extends pt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Rt(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear();return Hd(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Sa(n,t,e){var d,h,g,m;const i=Xn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.weekStartsOn)??0,r=rt(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Tr(r,u,e)}class nx extends pt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}class ix extends pt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Ft(i.length,e),o);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}class sx extends pt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Ft(i.length,e),o);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}function rx(n,t,e){const i=rt(n,e==null?void 0:e.in),s=R_(i,e),r=t-s;return Tr(i,r,e)}class ox extends pt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return Ft(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=rx(e,s),e.setHours(0,0,0,0),e}}class ax extends pt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class lx extends pt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class cx extends pt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class ux extends pt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Rt(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class dx extends pt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Rt(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class hx extends pt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Rt(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class fx extends pt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Rt(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class gx extends pt{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Rt(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class px extends pt{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Rt(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class mx extends pt{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Ft(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class yx extends pt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Xe(qe.basicOptionalMinutes,e);case"XX":return Xe(qe.basic,e);case"XXXX":return Xe(qe.basicOptionalSeconds,e);case"XXXXX":return Xe(qe.extendedOptionalSeconds,e);case"XXX":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class bx extends pt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Xe(qe.basicOptionalMinutes,e);case"xx":return Xe(qe.basic,e);case"xxxx":return Xe(qe.basicOptionalSeconds,e);case"xxxxx":return Xe(qe.extendedOptionalSeconds,e);case"xxx":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class _x extends pt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s*1e3),{timestampIsSet:!0}]}}class xx extends pt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s),{timestampIsSet:!0}]}}const wx={G:new B_,y:new H_,Y:new W_,R:new Y_,u:new j_,Q:new V_,q:new $_,M:new U_,L:new q_,w:new G_,I:new Z_,d:new tx,D:new ex,E:new nx,e:new ix,c:new sx,i:new ox,a:new ax,b:new lx,B:new cx,h:new ux,H:new dx,K:new hx,k:new fx,m:new gx,s:new px,S:new mx,X:new yx,x:new bx,t:new _x,T:new xx},vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sx=/^'([^]*?)'?$/,kx=/''/g,Dx=/\S/,Tx=/[a-zA-Z]/;function Cx(n,t,e,i){var w,v,S,D,k,T,A,E;const s=()=>Nt((i==null?void 0:i.in)||e,NaN),r=Nd(),o=(i==null?void 0:i.locale)??r.locale??kd,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(w=i==null?void 0:i.locale)==null?void 0:w.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(S=r.locale)==null?void 0:S.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((T=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((E=(A=r.locale)==null?void 0:A.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():rt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new z_(i==null?void 0:i.in,e)],d=t.match(Mx).map(p=>{const _=p[0];if(_ in wa){const C=wa[_];return C(p,o.formatLong)}return p}).join("").match(vx),h=[];for(let p of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Ld(p)&&va(p,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Rd(p)&&va(p,t,n);const _=p[0],C=wx[_];if(C){const{incompatibleTokens:R}=C;if(Array.isArray(R)){const N=h.find(B=>R.includes(B.token)||B.token===_);if(N)throw new RangeError(`The format string mustn't contain \`${N.fullToken}\` and \`${p}\` at the same time`)}else if(C.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);h.push({token:_,fullToken:p});const L=C.run(n,p,o.match,c);if(!L)return s();u.push(L.setter),n=L.rest}else{if(_.match(Tx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(p==="''"?p="'":_==="'"&&(p=Ox(p)),n.indexOf(p)===0)n=n.slice(p.length);else return s()}}if(n.length>0&&Dx.test(n))return s();const g=u.map(p=>p.priority).sort((p,_)=>_-p).filter((p,_,C)=>C.indexOf(p)===_).map(p=>u.filter(_=>_.priority===p).sort((_,C)=>C.subPriority-_.subPriority)).map(p=>p[0]);let m=rt(e,i==null?void 0:i.in);if(isNaN(+m))return s();const b={};for(const p of g){if(!p.validate(m,c))return s();const _=p.set(m,b,c);Array.isArray(_)?(m=_[0],Object.assign(b,_[1])):m=_}return m}function Ox(n){return n.match(Sx)[1].replace(kx,"'")}function Px(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ex(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Ax(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Rx(n){const t=n/pi;return Math.trunc(t)}function Wd(n,t){const e=()=>Nt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Fx(n);let r;if(s.date){const c=zx(s.date,i);r=Bx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Hx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Wx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=rt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return rt(o+a+l,t==null?void 0:t.in)}const Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ix=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Fx(n){const t={},e=n.split(Pr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Pr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Pr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Pr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function zx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Bx(n,t){if(t===null)return new Date(NaN);const e=n.match(Lx);if(!e)return new Date(NaN);const i=!!e[4],s=_s(e[1]),r=_s(e[2])-1,o=_s(e[3]),a=_s(e[4]),l=_s(e[5])-1;if(i)return Ux(t,a,l)?Yx(t,a,l):new Date(NaN);{const c=new Date(0);return!Vx(t,r,o)||!$x(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function _s(n){return n?parseInt(n):1}function Hx(n){const t=n.match(Ix);if(!t)return NaN;const e=ka(t[1]),i=ka(t[2]),s=ka(t[3]);return qx(e,i,s)?e*pi+i*gs+s*1e3:NaN}function ka(n){return n&&parseFloat(n.replace(",","."))||0}function Wx(n){if(n==="Z")return 0;const t=n.match(Nx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Xx(i,s)?e*(i*pi+s*gs):NaN}function Yx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const jx=[31,null,31,30,31,30,31,31,30,31,30,31];function Yd(n){return n%400===0||n%4===0&&n%100!==0}function Vx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(jx[t]||(Yd(n)?29:28))}function $x(n,t){return t>=1&&t<=(Yd(n)?366:365)}function Ux(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function qx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Xx(n,t){return t>=0&&t<=59}const Da=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!n.locked){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","doughnut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[a];let g;if(n.units==="bytes")g=isNaN(h)?h:fa(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?Er.format(h):Er.format(Number(h.toFixed($d)))} ${b}`}let m;return l&&u.dataset.label!==u.label?m=u.dataset.label:c?m=u.dataset.labels[u.dataIndex]:m=u.dataset.label,{backgroundColor:o[d].backgroundColor,borderColor:o[d].borderColor,label:m,value:g,rawValue:h,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Gx=n=>n&&n.datasets&&n.datasets.length,Kx=n=>Gx(n)&&n.datasets.some(t=>t.data.length),Zx=n=>Kx(n)&&n.datasets.some(t=>t.data.length>1),Qx=n=>Zx(n)&&n.datasets.some(t=>t.data[0]&&ya(t.data[0].x)),Jx=n=>Qx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ta=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},tw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function jd(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Vd=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},$d=2,Ud=10,qd=12,Er=new Intl.NumberFormat(((og=document==null?void 0:document.documentElement)==null?void 0:og.lang)||"en-US"),Ar=10,Xd={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Rr=(n,t)=>(t||on)[n%on.length],Gd=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},Kd="#6f7787",Zd={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},ew=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Zd[t])==null?void 0:e.background)||"#fafafa"},nw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},iw={"4XX":"#FFBA81","5XX":"#FF8484"},sw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},rw="#dad4c7",Qd="#afb7c5",ow=n=>{const t=Object.entries(Xd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Xd.standard},Ca=(n,t,e,i)=>{let s;return e?s=Qd:Array.isArray(i)?s=Rr(n,i):s=i[t],s||Rr(n)},aw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},lw=2,cw=0,Oa=new Map,Pa=(n,t)=>t==="bytes"?fa(n):t==="count/minute"?n.toFixed(2):Er.format(n),Jd=n=>{const e=document.createElement("canvas").getContext("2d"),i=Et({});return e.font=i.string,e.measureText(n).width},uw=()=>{const n="label_height";if(!Oa.has(n)){const t=Et({});Oa.set(n,t.lineHeight)}return Oa.get(n)},dw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),th=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),eh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ea="#e0e4ea",hw={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},xs=(n,t)=>{let e=1;const i=hw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},nh=new Map([[100,xs("100",[100,101,102,103])],[200,xs("200",[200,201,202,203,204,205,206,207,208,226])],[300,xs("300",[300,301,302,303,304,305,307,308])],[400,xs("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,xs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Aa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=nh.get(e);return i===void 0?Ea:i.get(t)??i.get(-1)??Ea},fw=n=>{const t=Aa(n);return{solid:t,light:t}},Lr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Aa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function ih(n,t,e){const i=Nd(),s=mw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?gw(s,t):pw(s,t)}function gw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function pw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function mw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function yw(n,t){const e=vw(t);return"formatToParts"in e?_w(e,n):xw(e,n)}const bw={year:0,month:1,day:2,hour:3,minute:4,second:5};function _w(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=bw[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function xw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Ra={},sh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),ww=sh==="06/25/2014, 00:00:00"||sh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function vw(n){return Ra[n]||(Ra[n]=ww?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ra[n]}function rh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const oh=36e5,Mw=6e4,La={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ia(n,t,e){if(!n)return 0;let i=La.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=La.timezoneHH.exec(n),i)return s=parseInt(i[1],10),ah(s)?-(s*oh):NaN;if(i=La.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return ah(s,o)?(r=Math.abs(s)*oh+o*Mw,i[1]==="+"?-r:r):NaN}if(Dw(n)){t=new Date(t||Date.now());const o=e?t:Sw(t),a=Na(o,n);return-(e?a:kw(t,a,n))}return NaN}function Sw(n){return rh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Na(n,t){const e=yw(n,t),i=rh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function kw(n,t,e){let s=n.getTime()-t;const r=Na(new Date(s),e);if(t===r)return t;s-=r-t;const o=Na(new Date(s),e);return r===o?r:Math.max(r,o)}function ah(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const lh={};function Dw(n){if(lh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lh[n]=!0,!0}catch{return!1}}const Tw=60*1e3,Cw={X:function(n,t,e){const i=Fa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return ch(i);case"XXXX":case"XX":return bi(i);case"XXXXX":case"XXX":default:return bi(i,":")}},x:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"x":return ch(i);case"xxxx":case"xx":return bi(i);case"xxxxx":case"xxx":default:return bi(i,":")}},O:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ow(i,":");case"OOOO":default:return"GMT"+bi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ih("short",n,e);case"zzzz":default:return ih("long",n,e)}}};function Fa(n,t){const e=n?Ia(n,t,!0)/Tw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ir(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function bi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ir(Math.floor(i/60),2),r=Ir(Math.floor(i%60),2);return e+s+t+r}function ch(n,t){return n%60===0?(n>0?"-":"+")+Ir(Math.abs(n)/60,2):bi(n,t)}function Ow(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ir(r,2)}function uh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Pw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,za=36e5,dh=6e4,Ew=2,le={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Pw};function hh(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Ew:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Aw(n),{year:s,restDateString:r}=Rw(i.date,e),o=Lw(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Iw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ia(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=uh(new Date(a+l)),c=uh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Aw(n){const t={};let e=le.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=le.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=le.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rw(n,t){if(n){const e=le.YYY[t],i=le.YYYYY[t];let s=le.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=le.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=le.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,ph(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=le.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return zw(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=le.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return ph(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=le.Www.exec(n),r)return s=parseInt(r[1],10)-1,mh(s)?fh(t,s):new Date(NaN);if(r=le.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return mh(s,o)?fh(t,s,o):new Date(NaN)}return null}function Iw(n){let t,e,i=le.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ba(t)?t%24*za:NaN;if(i=le.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ba(t,e)?t%24*za+e*dh:NaN;if(i=le.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ba(t,e,s)?t%24*za+e*dh+s*1e3:NaN}return null}function fh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Nw=[31,28,31,30,31,30,31,31,30,31,30,31],Fw=[31,29,31,30,31,30,31,31,30,31,30,31];function gh(n){return n%400===0||n%4===0&&n%100!==0}function ph(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gh(n);if(i&&e>Fw[t]||!i&&e>Nw[t])return!1}return!0}function zw(n,t){if(t<1)return!1;const e=gh(n);return!(e&&t>366||!e&&t>365)}function mh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ba(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ha(n,t,e={}){t=String(t);const i=t.match(Bw);if(i){const s=hh(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Cw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Id(n,t,e)}function Hw(n,t,e){n=hh(n,e);const i=Ia(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Zn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ha(Hw(n,t,{timeZone:i.timeZone}),e,i)}const Ww=Intl.DateTimeFormat().resolvedOptions().timeZone,yh=(n,t,e,i=Ww)=>["secondly","tenSecondly","thirtySecondly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a"):["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm a":"h:mm a"):t==="twelveHourly"?Zn(n,i,"yyyy-MM-dd h:mm a"):t==="daily"?Zn(n,i,"yyyy-MM-dd"):t==="weekly"?`${Zn(n,i,"yyyy")} W${Zn(n,i,"II")}`:Zn(n,i,"yyyy-MM-dd h:mm:ss a");function Yw(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Mr.positioners.barChartTooltipPosition=function(o,a){if(!o.length)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=l.width/2,d=Ta(a,c,u),h=a.y,g=a.x<u?"left":"center";return{x:d-n.tooltipState.offsetX,y:h-n.tooltipState.offsetY,xAlign:g}},Go.modes.customInteractionMode=function(o,a){const l=wn(a,o),c=[];return Go.evaluateInteractionItems(o,o.options.indexAxis||"x",l,(u,d,h)=>{o.options.indexAxis==="y"&&u.inYRange(l.y,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h}),o.options.indexAxis==="x"&&u.inXRange(l.x,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h})}),c};const e=n.numLabels.value>25?Ud:qd,i=({chart:o,index:a})=>{var c;const l=o.data;return{size:e,style:(c=l==null?void 0:l.isLabelEmpty)!=null&&c[a]?"italic":"normal"}},s=(o,a,l)=>o.chart.options.indexAxis===o.axis?(a=o.getLabelForValue(l),a&&a.length>Ar?a.slice(0,Ar)+"...":a):o.getLabelForValue(Number(a));return f.computed(()=>{var o,a,l,c,u,d,h,g;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:i,callback:function(m,b){return s(this,m,b)}},title:{display:n.indexAxis==="y"?!st((o=n.metricAxesTitle)==null?void 0:o.value):!st((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(l=n.metricAxesTitle)==null?void 0:l.value:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:i,callback:function(m,b){return s(this,m,b)}},title:{display:n.indexAxis==="x"?!st((u=n.metricAxesTitle)==null?void 0:u.value):!st((d=n.dimensionAxesTitle)==null?void 0:d.value),text:n.indexAxis==="x"?(h=n.metricAxesTitle)==null?void 0:h.value:(g=n.dimensionAxesTitle)==null?void 0:g.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:m=>{Da(n.tooltipState,m)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Pe.register(...d0);const jw=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function Vw(n,t,e,i,s){const r=f.shallowRef(null),o=(a,l)=>{if(t.value)return new Pe(t.value,{type:n,data:a,plugins:i,options:l})};return f.onMounted(()=>{r.value=o(e.value,s.value)}),f.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),f.watch(e,(a,l)=>{if(jw(l,a)&&!st(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=o(a,s.value)}),f.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),f.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(m,b){b&&b%3===0&&h.push(d),h.push(m)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(bh);var $w=bh.exports;const ws=Wa($w);function Uw(n,t,e){const{i18n:i}=mt.useI18n(),{translateUnit:s}=mt.useTranslatedUnits();return{legendValues:f.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":fa(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var qw=Object.defineProperty,Xw=(n,t,e)=>t in n?qw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ee=(n,t,e)=>Xw(n,typeof t!="symbol"?t+"":t,e),Lt=(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))(Lt||{});const Gw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],vs=n=>n.filter(t=>t!=="time"),_h=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],Kw=vs(_h),Zw=[..._h,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version"],Qw=vs(Zw),Jw=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],t1=vs(Jw);vs(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),vs(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Kw),new Set(Qw),new Set(t1);const xh=6048e5,e1=864e5,n1=60,i1=3600,wh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wh in n?n[wh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ce(n,t){return Ae(t||n,n)}function vh(n,t,e){const i=ce(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function s1(n,t,e){const i=ce(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let r1={};function Ms(){return r1}function an(n,t){var e,i,s,r;const o=Ms(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=ce(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Nr(n,t){return an(n,{...t,weekStartsOn:1})}function Mh(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Nr(s),o=Ae(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=Nr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Sh(n){const t=ce(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function o1(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Fr(n,t){const e=ce(n,void 0);return e.setHours(0,0,0,0),e}function a1(n,t,e){const[i,s]=o1(void 0,n,t),r=Fr(i),o=Fr(s),a=+r-Sh(r),l=+o-Sh(o);return Math.round((a-l)/e1)}function l1(n,t){const e=Mh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Nr(i)}function c1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function u1(n){return!(!c1(n)&&typeof n!="number"||isNaN(+ce(n)))}function _i(n,t){const e=ce(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function d1(n,t){const e=ce(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const h1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},f1=(n,t,e)=>{let i;const s=h1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ya(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const g1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},p1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y1={date:Ya({formats:g1,defaultWidth:"full"}),time:Ya({formats:p1,defaultWidth:"full"}),dateTime:Ya({formats:m1,defaultWidth:"full"})},b1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_1=(n,t,e,i)=>b1[n];function Ss(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const x1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},w1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},v1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},M1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},S1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},k1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},D1=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},T1={ordinalNumber:D1,era:Ss({values:x1,defaultWidth:"wide"}),quarter:Ss({values:w1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:v1,defaultWidth:"wide"}),day:Ss({values:M1,defaultWidth:"wide"}),dayPeriod:Ss({values:S1,defaultWidth:"wide",formattingValues:k1,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?O1(a,d=>d.test(o)):C1(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function C1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function O1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function P1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const E1=/^(\d+)(th|st|nd|rd)?/i,A1=/\d+/i,R1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},L1={any:[/^b/i,/^(a|c)/i]},I1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},N1={any:[/1/i,/2/i,/3/i,/4/i]},F1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},z1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},B1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},H1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},W1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Y1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},j1={ordinalNumber:P1({matchPattern:E1,parsePattern:A1,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:ks({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:N1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),day:ks({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:W1,defaultMatchWidth:"any",parsePatterns:Y1,defaultParseWidth:"any"})},V1={code:"en-US",formatDistance:f1,formatLong:y1,formatRelative:_1,localize:T1,match:j1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $1(n,t){const e=ce(n,void 0);return a1(e,d1(e))+1}function U1(n,t){const e=ce(n,void 0),i=+Nr(e)-+l1(e);return Math.round(i/xh)+1}function kh(n,t){var e,i,s,r;const o=ce(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ms(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=an(u,t),h=Ae((t==null?void 0:t.in)||n,0);h.setFullYear(a,0,c),h.setHours(0,0,0,0);const g=an(h,t);return+o>=+d?a+1:+o>=+g?a:a-1}function q1(n,t){var e,i,s,r;const o=Ms(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=kh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),an(c,t)}function X1(n,t){const e=ce(n,t==null?void 0:t.in),i=+an(e,t)-+q1(e,t);return Math.round(i/xh)+1}function vt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const kn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return vt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):vt(e+1,2)},d(n,t){return vt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return vt(n.getHours()%12||12,t.length)},H(n,t){return vt(n.getHours(),t.length)},m(n,t){return vt(n.getMinutes(),t.length)},s(n,t){return vt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return vt(s,t.length)}},xi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return kn.y(n,t)},Y:function(n,t,e,i){const s=kh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return vt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):vt(r,t.length)},R:function(n,t){const e=Mh(n);return vt(e,t.length)},u:function(n,t){const e=n.getFullYear();return vt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return vt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return vt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return kn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return vt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=X1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(n,t,e){const i=U1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):vt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):kn.d(n,t)},D:function(n,t,e){const i=$1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):vt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return vt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return vt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return vt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=xi.noon:i===0?s=xi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=xi.evening:i>=12?s=xi.afternoon:i>=4?s=xi.morning:s=xi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return kn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):kn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):kn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):kn.s(n,t)},S:function(n,t){return kn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ch(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Th(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Th(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return vt(i,t.length)},T:function(n,t,e){return vt(+n,t.length)}};function Th(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+vt(r,2)}function Ch(n,t){return n%60===0?(n>0?"-":"+")+vt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=vt(Math.trunc(i/60),2),r=vt(i%60,2);return e+s+t+r}const Oh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ph=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},G1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Oh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Oh(i,t)).replace("{{time}}",Ph(s,t))},K1={p:Ph,P:G1},Z1=/^D+$/,Q1=/^Y+$/,J1=["D","DD","YY","YYYY"];function tv(n){return Z1.test(n)}function ev(n){return Q1.test(n)}function nv(n,t,e){const i=iv(n,t,e);if(console.warn(i),J1.includes(n))throw new RangeError(i)}function iv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ov=/^'([^]*?)'?$/,av=/''/g,lv=/[a-zA-Z]/;function cv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ms(),h=(e==null?void 0:e.locale)??d.locale??V1,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,m=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,b=ce(n,e==null?void 0:e.in);if(!u1(b))throw new RangeError("Invalid time value");let w=t.match(rv).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=K1[D];return k(S,h.formatLong)}return S}).join("").match(sv).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:uv(S)};if(Dh[D])return{isToken:!0,value:S};if(D.match(lv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});h.localize.preprocessor&&(w=h.localize.preprocessor(b,w));const v={firstWeekContainsDate:g,weekStartsOn:m,locale:h};return w.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ev(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&tv(D))&&nv(D,t,String(n));const k=Dh[D[0]];return k(b,D,h.localize,v)}).join("")}function uv(n){const t=n.match(ov);return t?t[1].replace(av,"'"):n}function dv(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function hv(){return Object.assign({},Ms())}function fv(n){return Math.trunc(n*i1)}function gv(n){const t=n/n1;return Math.trunc(t)}function Eh(n,t,e){return s1(n,-t)}function Ah(n,t,e){const i=hv(),s=yv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?pv(s,t):mv(s,t)}function pv(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function mv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function yv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function bv(n,t){const e=Mv(t);return"formatToParts"in e?xv(e,n):wv(e,n)}const _v={year:0,month:1,day:2,hour:3,minute:4,second:5};function xv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=_v[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function wv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ja={},Rh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),vv=Rh==="06/25/2014, 00:00:00"||Rh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Mv(n){return ja[n]||(ja[n]=vv?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ja[n]}function Va(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Lh=36e5,Sv=6e4,$a={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ds(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ih(s)?-(s*Lh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Ih(s,o)?(r=Math.abs(s)*Lh+o*Sv,i[1]==="+"?-r:r):NaN}if(Tv(n)){t=new Date(t||Date.now());const o=e?t:kv(t),a=Ua(o,n);return-(e?a:Dv(t,a,n))}return NaN}function kv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=bv(n,t),i=Va(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Dv(n,t,e){let i=n.getTime()-t;const s=Ua(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ua(new Date(i),e);return s===r?s:Math.max(s,r)}function Ih(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Nh={};function Tv(n){if(Nh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Nh[n]=!0,!0}catch{return!1}}const Cv=60*1e3,Ov={X:function(n,t,e){const i=qa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return wi(i);case"XXXXX":case"XXX":default:return wi(i,":")}},x:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return wi(i);case"xxxxx":case"xxx":default:return wi(i,":")}},O:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Pv(i,":");case"OOOO":default:return"GMT"+wi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ah("short",n,e);case"zzzz":default:return Ah("long",n,e)}}};function qa(n,t){const e=n?Ds(n,t,!0)/Cv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function zr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function wi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=zr(Math.floor(i/60),2),r=zr(Math.floor(i%60),2);return e+s+t+r}function Fh(n,t){return n%60===0?(n>0?"-":"+")+zr(Math.abs(n)/60,2):wi(n,t)}function Pv(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+zr(r,2)}function zh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Bh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Xa=36e5,Hh=6e4,Ev=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Bh};function Br(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Ev:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Av(n),{year:s,restDateString:r}=Rv(i.date,e),o=Lv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Iv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ds(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=zh(new Date(a+l)),c=zh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Av(n){const t={};let e=ue.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ue.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rv(n,t){if(n){const e=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ue.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ue.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,jh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ue.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return zv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ue.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return jh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ue.Www.exec(n),r)return s=parseInt(r[1],10)-1,Vh(s)?Wh(t,s):new Date(NaN);if(r=ue.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Vh(s,o)?Wh(t,s,o):new Date(NaN)}return null}function Iv(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*Xa:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*Xa+e*Hh:NaN;if(i=ue.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,e,s)?t%24*Xa+e*Hh+s*1e3:NaN}return null}function Wh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Nv=[31,28,31,30,31,30,31,31,30,31,30,31],Fv=[31,29,31,30,31,30,31,31,30,31,30,31];function Yh(n){return n%400===0||n%4===0&&n%100!==0}function jh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Yh(n);if(i&&e>Fv[t]||!i&&e>Nv[t])return!1}return!0}function zv(n,t){if(t<1)return!1;const e=Yh(n);return!(e&&t>366||!e&&t>365)}function Vh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Hv(n,t,e={}){t=String(t);const i=t.match(Bv);if(i){const s=Br(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ov[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return cv(n,t,e)}function $h(n,t,e){n=Br(n,e);const i=Ds(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Wv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Hv($h(n,t,{timeZone:i.timeZone}),e,i)}function Yv(n,t,e){if(typeof n=="string"&&!n.match(Bh))return Br(n,{...e,timeZone:t});n=Br(n,e);const i=Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ds(t,new Date(i));return new Date(i+s)}function jv(n,t){return-Ds(n,t)}function Uh(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Wv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Vv={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Ka(n){return n&&Gw.find(t=>n<=Vv[t])||null}var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wr={exports:{}};Wr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",h="[object Map]",g="[object Number]",m="[object Object]",b="[object Promise]",w="[object RegExp]",v="[object Set]",S="[object String]",D="[object Symbol]",k="[object WeakMap]",T="[object ArrayBuffer]",A="[object DataView]",E="[object Float32Array]",p="[object Float64Array]",_="[object Int8Array]",C="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",B="[object Uint16Array]",G="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,H=/\w*$/,ct=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,et={};et[r]=et[o]=et[T]=et[A]=et[a]=et[l]=et[E]=et[p]=et[_]=et[C]=et[R]=et[h]=et[g]=et[m]=et[w]=et[v]=et[S]=et[D]=et[L]=et[N]=et[B]=et[G]=!0,et[c]=et[u]=et[k]=!1;var kt=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,$=typeof self=="object"&&self&&self.Object===Object&&self,z=kt||$||Function("return this")(),j=t&&!t.nodeType&&t,X=j&&!0&&n&&!n.nodeType&&n,Z=X&&X.exports===j;function tt(x,O){return x.set(O[0],O[1]),x}function q(x,O){return x.add(O),x}function V(x,O){for(var F=-1,K=x?x.length:0;++F<K&&O(x[F],F,x)!==!1;);return x}function ot(x,O){for(var F=-1,K=O.length,Vt=x.length;++F<K;)x[Vt+F]=O[F];return x}function J(x,O,F,K){for(var Vt=-1,Qt=x?x.length:0;++Vt<Qt;)F=O(F,x[Vt],Vt,x);return F}function Tt(x,O){for(var F=-1,K=Array(x);++F<x;)K[F]=O(F);return K}function gt(x,O){return x==null?void 0:x[O]}function At(x){var O=!1;if(x!=null&&typeof x.toString!="function")try{O=!!(x+"")}catch{}return O}function yt(x){var O=-1,F=Array(x.size);return x.forEach(function(K,Vt){F[++O]=[Vt,K]}),F}function ht(x,O){return function(F){return x(O(F))}}function $t(x){var O=-1,F=Array(x.size);return x.forEach(function(K){F[++O]=K}),F}var ie=Array.prototype,ye=Function.prototype,se=Object.prototype,Kt=z["__core-js_shared__"],Mt=function(){var x=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||"");return x?"Symbol(src)_1."+x:""}(),Dt=ye.toString,Zt=se.hasOwnProperty,ft=se.toString,Ge=RegExp("^"+Dt.call(Zt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Z?z.Buffer:void 0,Re=z.Symbol,re=z.Uint8Array,_e=ht(Object.getPrototypeOf,Object),Te=Object.create,te=se.propertyIsEnumerable,oe=ie.splice,zt=Object.getOwnPropertySymbols,Ci=be?be.isBuffer:void 0,En=ht(Object.keys,Object),Oi=Ln(z,"DataView"),si=Ln(z,"Map"),Ls=Ln(z,"Promise"),Is=Ln(z,"Set"),ri=Ln(z,"WeakMap"),ze=Ln(Object,"create"),Ns=we(Oi),Fs=we(si),zs=we(Ls),oi=we(Is),bl=we(ri),Jr=Re?Re.prototype:void 0,to=Jr?Jr.valueOf:void 0;function un(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function _l(){this.__data__=ze?ze(null):{}}function Pi(x){return this.has(x)&&delete this.__data__[x]}function Bs(x){var O=this.__data__;if(ze){var F=O[x];return F===i?void 0:F}return Zt.call(O,x)?O[x]:void 0}function eo(x){var O=this.__data__;return ze?O[x]!==void 0:Zt.call(O,x)}function dn(x,O){var F=this.__data__;return F[x]=ze&&O===void 0?i:O,this}un.prototype.clear=_l,un.prototype.delete=Pi,un.prototype.get=Bs,un.prototype.has=eo,un.prototype.set=dn;function Be(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function xl(){this.__data__=[]}function wl(x){var O=this.__data__,F=xe(O,x);if(F<0)return!1;var K=O.length-1;return F==K?O.pop():oe.call(O,F,1),!0}function vl(x){var O=this.__data__,F=xe(O,x);return F<0?void 0:O[F][1]}function Ml(x){return xe(this.__data__,x)>-1}function He(x,O){var F=this.__data__,K=xe(F,x);return K<0?F.push([x,O]):F[K][1]=O,this}Be.prototype.clear=xl,Be.prototype.delete=wl,Be.prototype.get=vl,Be.prototype.has=Ml,Be.prototype.set=He;function An(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function Sl(){this.__data__={hash:new un,map:new(si||Be),string:new un}}function kl(x){return Ri(this,x).delete(x)}function Dl(x){return Ri(this,x).get(x)}function Tl(x){return Ri(this,x).has(x)}function We(x,O){return Ri(this,x).set(x,O),this}An.prototype.clear=Sl,An.prototype.delete=kl,An.prototype.get=Dl,An.prototype.has=Tl,An.prototype.set=We;function Rn(x){this.__data__=new Be(x)}function Cl(){this.__data__=new Be}function Ol(x){return this.__data__.delete(x)}function Pl(x){return this.__data__.get(x)}function El(x){return this.__data__.has(x)}function Ei(x,O){var F=this.__data__;if(F instanceof Be){var K=F.__data__;if(!si||K.length<e-1)return K.push([x,O]),this;F=this.__data__=new An(K)}return F.set(x,O),this}Rn.prototype.clear=Cl,Rn.prototype.delete=Ol,Rn.prototype.get=Pl,Rn.prototype.has=El,Rn.prototype.set=Ei;function Al(x,O){var F=In(x)||uo(x)?Tt(x.length,String):[],K=F.length,Vt=!!K;for(var Qt in x)Zt.call(x,Qt)&&!(Vt&&(Qt=="length"||ql(Qt,K)))&&F.push(Qt);return F}function no(x,O,F){var K=x[O];(!(Zt.call(x,O)&&co(K,F))||F===void 0&&!(O in x))&&(x[O]=F)}function xe(x,O){for(var F=x.length;F--;)if(co(x[F][0],O))return F;return-1}function Rl(x,O){return x&&so(O,Ye(O),x)}function Hs(x,O,F,K,Vt,Qt,ve){var Ut;if(K&&(Ut=Qt?K(x,Vt,Qt,ve):K(x)),Ut!==void 0)return Ut;if(!Ii(x))return x;var Fi=In(x);if(Fi){if(Ut=oo(x),!O)return jl(x,Ut)}else{var Nn=hn(x),po=Nn==u||Nn==d;if(Kl(x))return zl(x,O);if(Nn==m||Nn==r||po&&!Qt){if(At(x))return Qt?x:{};if(Ut=Ul(po?{}:x),!O)return Vl(x,Rl(Ut,x))}else{if(!et[Nn])return Qt?x:{};Ut=ao(x,Nn,Hs,O)}}ve||(ve=new Rn);var mo=ve.get(x);if(mo)return mo;if(ve.set(x,Ut),!Fi)var yo=F?$l(x):Ye(x);return V(yo||x,function(Fn,zi){yo&&(zi=Fn,Fn=x[zi]),no(Ut,zi,Hs(Fn,O,F,K,zi,x,ve))}),Ut}function Ll(x){return Ii(x)?Te(x):{}}function Il(x,O,F){var K=O(x);return In(x)?K:ot(K,F(x))}function Nl(x){return ft.call(x)}function Fl(x){if(!Ii(x)||Li(x))return!1;var O=js(x)||At(x)?Ge:ct;return O.test(we(x))}function Ai(x){if(!lo(x))return En(x);var O=[];for(var F in Object(x))Zt.call(x,F)&&F!="constructor"&&O.push(F);return O}function zl(x,O){if(O)return x.slice();var F=new x.constructor(x.length);return x.copy(F),F}function Ws(x){var O=new x.constructor(x.byteLength);return new re(O).set(new re(x)),O}function io(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.byteLength)}function Bl(x,O,F){var K=O?F(yt(x),!0):yt(x);return J(K,tt,new x.constructor)}function Hl(x){var O=new x.constructor(x.source,H.exec(x));return O.lastIndex=x.lastIndex,O}function Ys(x,O,F){var K=O?F($t(x),!0):$t(x);return J(K,q,new x.constructor)}function Wl(x){return to?Object(to.call(x)):{}}function Yl(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.length)}function jl(x,O){var F=-1,K=x.length;for(O||(O=Array(K));++F<K;)O[F]=x[F];return O}function so(x,O,F,K){F||(F={});for(var Vt=-1,Qt=O.length;++Vt<Qt;){var ve=O[Vt],Ut=void 0;no(F,ve,Ut===void 0?x[ve]:Ut)}return F}function Vl(x,O){return so(x,ro(x),O)}function $l(x){return Il(x,Ye,ro)}function Ri(x,O){var F=x.__data__;return Xl(O)?F[typeof O=="string"?"string":"hash"]:F.map}function Ln(x,O){var F=gt(x,O);return Fl(F)?F:void 0}var ro=zt?ht(zt,Object):Vs,hn=Nl;(Oi&&hn(new Oi(new ArrayBuffer(1)))!=A||si&&hn(new si)!=h||Ls&&hn(Ls.resolve())!=b||Is&&hn(new Is)!=v||ri&&hn(new ri)!=k)&&(hn=function(x){var O=ft.call(x),F=O==m?x.constructor:void 0,K=F?we(F):void 0;if(K)switch(K){case Ns:return A;case Fs:return h;case zs:return b;case oi:return v;case bl:return k}return O});function oo(x){var O=x.length,F=x.constructor(O);return O&&typeof x[0]=="string"&&Zt.call(x,"index")&&(F.index=x.index,F.input=x.input),F}function Ul(x){return typeof x.constructor=="function"&&!lo(x)?Ll(_e(x)):{}}function ao(x,O,F,K){var Vt=x.constructor;switch(O){case T:return Ws(x);case a:case l:return new Vt(+x);case A:return io(x,K);case E:case p:case _:case C:case R:case L:case N:case B:case G:return Yl(x,K);case h:return Bl(x,K,F);case g:case S:return new Vt(x);case w:return Hl(x);case v:return Ys(x,K,F);case D:return Wl(x)}}function ql(x,O){return O=O??s,!!O&&(typeof x=="number"||Y.test(x))&&x>-1&&x%1==0&&x<O}function Xl(x){var O=typeof x;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?x!=="__proto__":x===null}function Li(x){return!!Mt&&Mt in x}function lo(x){var O=x&&x.constructor,F=typeof O=="function"&&O.prototype||se;return x===F}function we(x){if(x!=null){try{return Dt.call(x)}catch{}try{return x+""}catch{}}return""}function Ke(x){return Hs(x,!0,!0)}function co(x,O){return x===O||x!==x&&O!==O}function uo(x){return Gl(x)&&Zt.call(x,"callee")&&(!te.call(x,"callee")||ft.call(x)==r)}var In=Array.isArray;function ho(x){return x!=null&&fo(x.length)&&!js(x)}function Gl(x){return Ni(x)&&ho(x)}var Kl=Ci||go;function js(x){var O=Ii(x)?ft.call(x):"";return O==u||O==d}function fo(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=s}function Ii(x){var O=typeof x;return!!x&&(O=="object"||O=="function")}function Ni(x){return!!x&&typeof x=="object"}function Ye(x){return ho(x)?Al(x):Ai(x)}function Vs(){return[]}function go(){return!1}n.exports=Ke}(Wr,Wr.exports),Wr.exports;const vi=(n,t)=>new Date(n.getTime()-jv(t,n));class Fe{constructor(t){Ee(this,"timeframeText"),Ee(this,"key"),Ee(this,"display"),Ee(this,"timeframeLength"),Ee(this,"allowedTiers"),Ee(this,"defaultResponseGranularity"),Ee(this,"dataGranularity"),Ee(this,"isRelative"),Ee(this,"fineGrainedDefaultGranularity"),Ee(this,"_startCustom"),Ee(this,"_endCustom"),Ee(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=Yv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return $h(e,t)}}class $v extends Fe{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Uv extends Fe{rawStart(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class qv extends Fe{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=vi(i,t)),i}}class Xv extends Fe{rawEnd(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}rawStart(t){let e=_i(Eh(this.tzAdjustedDate(t),1));return t&&(e=vi(e,t)),e}}Lt.FIFTEEN_MIN,new Fe({key:Lt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),Lt.ONE_HOUR,new Fe({key:Lt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),Lt.SIX_HOUR,new Fe({key:Lt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Lt.TWELVE_HOUR,new Fe({key:Lt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Lt.ONE_DAY,new Fe({key:Lt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Lt.SEVEN_DAY,new Fe({key:Lt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Lt.THIRTY_DAY,new Fe({key:Lt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Lt.CURRENT_WEEK,new $v({key:Lt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Lt.CURRENT_MONTH,new Uv({key:Lt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=_i(new Date);return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Lt.PREVIOUS_WEEK,new qv({key:Lt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Lt.PREVIOUS_MONTH,new Xv({key:Lt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=_i(new Date),e=_i(Eh(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Gv(t,e)),60*60*24*dv(new Date().setMonth(new Date().getMonth()-1))+fv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gv(n,t){return gv(n.getTimezoneOffset()-t.getTimezoneOffset())}function Kv(n){return f.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Uh(e)} - ${Uh(i,{includeTZ:!0})}`:""})}function Zv(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Mr.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,a=r.width/2,l=Ta(s,o,a),c=s.y,u=s.x<a?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Da(n.tooltipState,i)}}}}))}}function Qv(n){const t=f.computed(()=>{var o,a;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return yh(c,n.granularity.value,s.value)}},title:{display:!st((o=n.dimensionAxesTitle)==null?void 0:o.value),text:(a=n.dimensionAxesTitle)==null?void 0:a.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=f.computed(()=>{var o,a;return{title:{display:!st((o=n.metricAxesTitle)==null?void 0:o.value),text:(a=n.metricAxesTitle)==null?void 0:a.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),i={enabled:!1,position:"lineChartTooltipPosition"};Mr.positioners.lineChartTooltipPosition=function(o,a){if(!o.length||n.tooltipState.locked)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=n.tooltipState.height||this.height,d=l.width/2,h=l.height/2,g=Ta(a,c,d);let m=tw(a,u,h);const b=a.y<h?"top":"bottom",w=a.x<d?"left":"center";return u>l.height&&(m=0),{x:g,y:m,xAlign:w,yAlign:b}};const s=f.computed(()=>{const o=Number(n.timeRangeMs.value),a=new Date,l=new Date(a.getTime()-o);return Rx(o)>24||l.getDate()!==a.getDate()});return{options:f.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:o=>{Da(n.tooltipState,o)}}},interaction:{mode:"index",intersect:!1}}))}}function Jv(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Rr(i.indexOf(u),on),data:o.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h=Ca(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:h,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function tM(n,t){const{i18n:e}=mt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0;if(!s.length||!o)return{datasets:[],labels:[]};const u=c&&a||o,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(p=>o.map((_,C)=>{const R=p.event[d],L=c?`${R},${_}`:`${C},${_}`,N=p.event[_];return[L,N]})):s.map(p=>{const _=c?`${p.event[d]},${p.event[h]}`:`${d},${h}`,C=p.event[o[0]];return[_,C]})),m=Object.keys(g).reduce((p,_)=>{const[C]=_.split(","),R=g[_];return p[C]?p[C]+=R:p[C]=R,p},{}),b=Object.entries(m).sort(([,p],[,_])=>Number(_)-Number(p)).map(([p])=>p),w=r[d],v=r[h],S=c&&w&&Object.entries(w).map(([p,_])=>({id:p,name:_.name}))||o.map(p=>({id:p,name:p})),D=c&&v&&Object.entries(v).map(([p,_])=>({id:p,name:_.name}))||o.map(p=>({id:p,name:p}));if(d!=="status_code"&&d!=="status_code_grouped"&&(S.sort((p,_)=>b.indexOf(p.id)-b.indexOf(_.id)),D.sort((p,_)=>b.indexOf(p.id)-b.indexOf(_.id))),!S||!D)return{labels:[],datasets:[]};const k=Jv({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:u,barSegmentLabels:D,pivotRecords:g,rowLabels:S,colorPalette:n.colorPalette||on}),T=c?S.map(p=>e&&e.te(`chartLabels.${p.name}`)&&e.t(`chartLabels.${p.name}`)||p.name):o.map(p=>e&&e.te(`chartLabels.${p}`)&&e.t(`chartLabels.${p}`)||p),A=S.map(p=>p.id==="empty");return{labels:T,datasets:k,isLabelEmpty:A}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const eM="#6c7489",nM="#6c7489",iM="#995c00",sM="20px",qh="24px",rM="40px",oM="48px",aM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),lM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Wd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},cM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return aM(a,l,e)};function uM(n,t){const{i18n:e}=mt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],h=r&&d&&Object.keys(d).map(k=>({id:k,name:d[k].name}))||o.map(k=>({id:k,name:k})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const m=lM(a),b=cM(a,l,g,m,s),w=new Set,v=s!=null&&s.length?s.reduce((k,T)=>{const A=new Date(T.timestamp).valueOf(),E=T.event;for(const p of o)w.add(p),A in k||(k[A]={}),p in k[A]||(k[A][p]={});for(const p of o)h.forEach(_=>{E[u]===_.id||p===_.id?(k[A][p]||(k[A][p]={}),k[A][p][_.name]=Math.round(Number(E[p])*1e3)/1e3):c.length||(k[A][p]||(k[A][p]={}),k[A][p][_.name]=Math.round(Number(E[_.id])*1e3)/1e3)});return k},{}):{},D=[...o.length===1?o.flatMap(k=>h.map(T=>[k,T.name,T.id==="empty"])):h.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,T,A],E)=>{const p=b.map(L=>L in v&&k in v[L]?{x:L,y:v[L][k][T]||0}:{x:L,y:0});let{colorPalette:_,fill:C}=n;st(_)&&(_=on);const R=Ca(E,T,A,_);return{rawDimension:T,rawMetric:k,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:R,backgroundColor:R,data:p,total:p.reduce((L,{y:N})=>L+Number(N),0),...aw,fill:C,borderWidth:C?cw:lw,isSegmentEmpty:A}});if(u==="status_code"||u==="status_code_grouped"?D.sort((k,T)=>(k.label??"")<(T.label??"")?-1:1):D.sort((k,T)=>Number(k.total)<Number(T.total)?-1:1),n.threshold)for(const k of Object.keys(n.threshold)){const T=n.threshold[k];T&&D.push({type:"line",rawMetric:k,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:eM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(A=>({x:A,y:T}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const dM=(n,t)=>{f.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function hM(){const{i18n:n}=mt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const fM="analytics-query-provider";function gM(){const n=f.inject(fM);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const mt={useBarChartOptions:Yw,useChartJSCommon:Vw,useChartLegendValues:Uw,useChartSelectedRange:Kv,useExploreResultToDatasets:tM,useExploreResultToTimeDataset:uM,useDoughnutChartOptions:Zv,useLinechartOptions:Qv,useI18n:cg,useReportChartDataForSynthetics:dM,useTranslatedUnits:hM,useEvaluateFeatureFlag:gM};var It=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(It||{});/*!
19
19
  * chartjs-plugin-annotation v3.1.0
20
20
  * https://www.chartjs.org/chartjs-plugin-annotation/index
21
21
  * (c) 2024 chartjs-plugin-annotation Contributors
22
22
  * Released under the MIT License
23
- */const Cd={modes:{point(n,t){return tr(n,t,{intersect:!0})},nearest(n,t,e){return cv(n,t,e)},x(n,t,e){return tr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return tr(n,t,{intersect:e.intersect,axis:"y"})}}};function to(n,t,e){return(Cd.modes[e.mode]||Cd.modes.nearest)(n,t,e)}function ov(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 lv(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function tr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):ov(i,t,e.axis))}function cv(n,t,e){let i=Number.POSITIVE_INFINITY;return tr(n,t,e).reduce((s,r)=>{const a=r.getCenterPoint(),o=lv(t,a,e.axis),l=Wn(t,o);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function En(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,a=t.y;return{x:r+i*(n.x-r)-s*(n.y-a),y:a+s*(n.x-r)+i*(n.y-a)}}const uv=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Rn=.001,er=(n,t,e)=>Math.min(e,Math.max(t,n)),Pd=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function dv(n,t,e){for(const i of Object.keys(n))n[i]=er(n[i],t,e);return n}function hv(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Od(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:a,hitTolerance:o}){const l=(a+o)/2,c=n.x>=t-l-Rn&&n.x<=i+l+Rn,u=n.y>=e-l-Rn&&n.y<=s+l+Rn;return r==="x"?c:(r==="y"||c)&&u}function Ed(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:a}){const o=En(n,e,Ft(-s));return Od(o,t,i,{borderWidth:r,hitTolerance:a})}function An(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function fv(n,t,e,i=!0){const s=e.split(".");let r=0;for(const a of t.split(".")){const o=s[r++];if(parseInt(a,10)<parseInt(o,10))break;if(uv(o,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Rd=n=>typeof n=="string"&&n.endsWith("%"),Ad=n=>parseFloat(n)/100,Ld=n=>er(Ad(n),0,1),Ki=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),gv={box:n=>Ki(n.centerX,n.centerY),doughnutLabel:n=>Ki(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ki(n.centerX,n.centerY),line:n=>Ki(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ki(n.centerX,n.centerY)};function eo(n,t){return t==="start"?0:t==="end"?n:Rd(t)?Ld(t)*n:n/2}function cn(n,t,e=!0){return typeof t=="number"?t:Rd(t)?(e?Ld(t):Ad(t))*n:n}function pv(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function Id(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},a){const o=nt(a),l=t.width+(o?a.width:0)+e,c=t.height+(o?a.height:0)+e,u=no(i),d=Bd(n.x,l,s,u.x),h=Bd(n.y,c,r,u.y);return{x:d,y:h,x2:d+l,y2:h+c,width:l,height:c,centerX:d+l/2,centerY:h+c/2}}function no(n,t="center"){return nt(n)?{x:Q(n.x,t),y:Q(n.y,t)}:(n=Q(n,t),{x:n,y:n})}const Nd=(n,t)=>n&&n.autoFit&&t<1;function Fd(n,t){const e=n.font,i=ut(e)?e:[e];return Nd(n,t)?i.map(function(s){const r=kt(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,kt(r)}):i.map(s=>kt(s))}function zd(n){return n&&(Jt(n.xValue)||Jt(n.yValue))}function Bd(n,t,e=0,i){return n-eo(t,i)+e}function ei(n,t,e){const i=e.init;if(i){if(i===!0)return Wd(t,e)}else return;return mv(n,t,e)}function Hd(n,t,e){let i=!1;return t.forEach(s=>{te(n[s])?(i=!0,e[s]=n[s]):Jt(e[s])&&delete e[s]}),i}function Wd(n,t){const e=t.type||"line";return gv[e](n)}function mv(n,t,e){const i=ht(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Wd(t,e);if(nt(i))return i}const io=new Map,yv=n=>isNaN(n)||n<=0,bv=n=>n.reduce(function(t,e){return t+=e.string,t},"");function nr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function ir(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Ft(i)),n.translate(-t,-e))}function Ye(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function ni(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function sr(n,t){const e=t.content;if(nr(e))return{width:cn(e.width,t.width),height:cn(e.height,t.height)};const i=Fd(t),s=t.textStrokeWidth,r=ut(e)?e:[e],a=r.join()+bv(i)+s+(n._measureText?"-spriting":"");return io.has(a)||io.set(a,vv(n,r,i,s)),io.get(a)}function Yd(n,t,e){const{x:i,y:s,width:r,height:a}=t;n.save(),ni(n,e);const o=Ye(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Yn(n,{x:i,y:s,w:r,h:a,radius:dv(en(e.borderRadius),0,Math.min(r,a)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function jd(n,t,e,i){const s=e.content;if(nr(s)){n.save(),n.globalAlpha=Sv(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=ut(s)?s:[s],a=Fd(e,i),o=e.color,l=ut(o)?o:[o],c=pv(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,xv(n,e)&&Mv(n,{x:c,y:u},r,a),kv(n,{x:c,y:u},r,{fonts:a,colors:l}),n.restore()}function xv(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function _v(n,t,e,i){const{radius:s,options:r}=t,a=r.pointStyle,o=r.rotation;let l=(o||0)*Pr;if(nr(a)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}yv(s)||wv(n,{x:e,y:i,radius:s,rotation:o,style:a,rad:l})}function wv(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:a}){let o,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,bt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ds,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ds,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(a+fe)*c,l=Math.sin(a+fe)*c,n.arc(t-o,e-l,u,a-rt,a-xt),n.arc(t+l,e-o,u,a-xt,a),n.arc(t+o,e+l,u,a,a+xt),n.arc(t-l,e+o,u,a+xt,a+rt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}a+=fe;case"rectRot":o=Math.cos(a)*i,l=Math.sin(a)*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":a+=fe;case"cross":o=Math.cos(a)*i,l=Math.sin(a)*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(a)*i,l=Math.sin(a)*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),a+=fe,o=Math.cos(a)*i,l=Math.sin(a)*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(a)*i,l=Math.sin(a)*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(a)*i,e+Math.sin(a)*i);break}n.fill()}function vv(n,t,e,i){n.save();const s=t.length;let r=0,a=i;for(let o=0;o<s;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];r=Math.max(r,n.measureText(c).width+i),a+=l.lineHeight}return n.restore(),{width:r,height:a}}function Mv(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(a,o){const l=s[Math.min(o,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(a,t,e+c/2+r),r+=c}),n.stroke()}function kv(n,{x:t,y:e},i,{fonts:s,colors:r}){let a=0;i.forEach(function(o,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+a),a+=d,n.fill()})}function Sv(n,t){const e=tn(n)?n:t;return tn(e)?er(e,0,1):1}const Vd=["left","bottom","top","right"];function Dv(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,a=r&&r.display&&Ev(t,r);if(!a||Av(t,r,a))return;if(n.save(),n.beginPath(),!Ye(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=Tv(t,a),{sideStart:u,sideEnd:d}=Pv(t,a,l);(r.margin>0||s.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 h=En({x:e,y:i},t.getCenterPoint(),Ft(-t.rotation));n.lineTo(h.x,h.y),n.stroke(),n.restore()}function Tv(n,t){const{x:e,y:i,x2:s,y2:r}=n,a=Cv(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+a,y:i},l={x:o.x,y:r}):(o={x:e,y:i+a},l={x:s,y:o.y}),{separatorStart:o,separatorEnd:l}}function Cv(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function Pv(n,t,e){const{y:i,width:s,height:r,options:a}=n,o=a.callout.start,l=Ov(t,a.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+cn(r,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+cn(s,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Ov(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function Ev(n,t){const e=t.position;return Vd.includes(e)?e:Rv(n,t)}function Rv(n,t){const{x:e,y:i,x2:s,y2:r,width:a,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:h}=n,g={x:u,y:d},m=t.start,b=cn(a,m),_=cn(o,m),w=[e,e+b,e+b,s],M=[i+_,r,i,r],S=[];for(let k=0;k<4;k++){const D=En({x:w[k],y:M[k]},g,Ft(h));S.push({position:Vd[k],distance:Wn(D,{x:l,y:c})})}return S.sort((k,D)=>k.distance-D.distance)[0].position}function Av(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let a=i,o=s;return e==="left"?a+=r:e==="right"?a-=r:e==="top"?o+=r:e==="bottom"&&(o-=r),n.inRange(a,o)}const $d={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 ii(n,t,e){return t=typeof t=="number"?t:n.parse(t),Mt(t)?n.getPixelForValue(t):e}function Ln(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(a=>a.axis&&a.axis===s);return r.length?r[0].id:s}function Ud(n,t){if(n){const e=n.options.reverse,i=ii(n,t.min,e?t.end:t.start),s=ii(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function qd(n,t){const{chartArea:e,scales:i}=n,s=i[Ln(i,t,"xScaleID")],r=i[Ln(i,t,"yScaleID")];let a=e.width/2,o=e.height/2;return s&&(a=ii(s,t.xValue,s.left+s.width/2)),r&&(o=ii(r,t.yValue,r.top+r.height/2)),{x:a,y:o}}function so(n,t){const e=n.scales,i=e[Ln(e,t,"xScaleID")],s=e[Ln(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:a}=i||n.chartArea,{top:o,bottom:l}=s||n.chartArea;const c=Kd(i,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;const u=Kd(s,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:r,y:o,x2:a,y2:l,width:a-r,height:l-o,centerX:r+(a-r)/2,centerY:o+(l-o)/2}}function Xd(n,t){if(!zd(t)){const e=so(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:r-i,y:a-i,x2:r+i,y2:a+i,centerX:r,centerY:a,width:s,height:s,radius:i}}return Iv(n,t)}function Lv(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?Nv(s,r,t):Fv(e,r,t),r}function Gd(n,t){const e=so(n,t);return e.initProperties=ei(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:Hv(n,e,t),initProperties:e.initProperties}],e}function Iv(n,t){const e=qd(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 Kd(n,t){const e=Ud(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function Nv(n,t,e){const i=ii(n,e.value,NaN),s=ii(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function Fv(n,t,e){for(const i of Object.keys($d)){const s=n[Ln(n,e,i)];if(s){const{min:r,max:a,start:o,end:l,startProp:c,endProp:u}=$d[i],d=Ud(s,{min:e[r],max:e[a],start:s[o],end:s[l]});t[c]=d.start,t[u]=d.end}}}function zv({properties:n,options:t},e,i,s){const{x:r,x2:a,width:o}=n;return Zd({start:r,end:a,size:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function Bv({properties:n,options:t},e,i,s){const{y:r,y2:a,height:o}=n;return Zd({start:r,end:a,size:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Zd(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:a,end:o},adjust:l}=t,c=i-s-e-a-o-t.size;return e+s/2+l+eo(c,r)}function Hv(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=no(i.position),r=zt(i.padding),a=sr(n.ctx,i),o=zv({properties:t,options:e},a,s,r),l=Bv({properties:t,options:e},a,s,r),c=a.width+r.width,u=a.height+r.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}}const ro=["enter","leave"],ao=ro.concat("click");function Wv(n,t,e){t.listened=Hd(e,ao,t.listeners),t.moveListened=!1,ro.forEach(i=>{te(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&te(i.click)&&(t.listened=!0),t.moveListened||ro.forEach(s=>{te(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function Yv(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return jv(n,t,e);case"click":return Vv(n,t,e)}}function jv(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=to(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let a=Qd(r,"leave",s,i);return Qd(r,"enter",i,s)||a}function Qd({state:n,event:t},e,i,s){let r;for(const a of i)s.indexOf(a)<0&&(r=Jd(a.options[e]||n.listeners[e],a,t)||r);return r}function Vv(n,t,e){const i=n.listeners,s=to(n.visibleElements,t,e.interaction);let r;for(const a of s)r=Jd(a.options.click||i.click,a,t)||r;return r}function Jd(n,t,e){return ht(n,[t.$context,e])===!0}const rr=["afterDraw","beforeDraw"];function $v(n,t,e){const i=t.visibleElements;t.hooked=Hd(e,rr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||rr.forEach(r=>{te(s.options[r])&&(t.hooked=!0)})})}function th(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return ht(i,[t.$context])}}function Uv(n,t,e){const i=Zv(n.scales,t,e);let s=eh(t,i,"min","suggestedMin");s=eh(t,i,"max","suggestedMax")||s,s&&te(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function qv(n,t){for(const e of n)Gv(e,t)}function eh(n,t,e,i){if(Mt(t[e])&&!Xv(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Xv(n,t,e){return Jt(n[t])||Jt(n[e])}function Gv(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Ln(t,n,e);i&&!t[i]&&Kv(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Kv(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(Jt(n[e+i]))return!0;return!1}function Zv(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",a={min:Q(t.min,Number.NEGATIVE_INFINITY),max:Q(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===s?nh(o,t,["value","endValue"],a):Ln(n,o,r)===s&&nh(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function nh(n,t,e,i){for(const s of e){const r=n[s];if(Jt(r)){const a=t.parse(r);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class si extends Yt{inRange(t,e,i,s){const{x:r,y:a}=En({x:t,y:e},this.getCenterPoint(s),Ft(-this.options.rotation));return Od({x:r,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return An(this,t)}draw(t){t.save(),ir(t,this.getCenterPoint(),this.options.rotation),Yd(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Gd(t,e)}}si.id="boxAnnotation",si.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance: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,hitTolerance: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},si.defaultRoutes={borderColor:"color",backgroundColor:"color"},si.descriptors={label:{_fallback:!0}};class ar extends Yt{inRange(t,e,i,s){return Ed({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return An(this,t)}draw(t){const e=this.options;!e.display||!e.content||(iM(t,this),t.save(),ir(t,this.getCenterPoint(),this.rotation),jd(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=Qv(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:a}=tM(t,e,i);let o=sr(t.ctx,e);const l=eM(o,a);Nd(e,l)&&(o={width:o.width*l,height:o.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,h=Id(r,o,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:ei(t,h,e),...h,...s,rotation:e.rotation,_fitRatio:l}}}ar.id="doughnutLabelAnnotation",ar.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,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,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},ar.defaultRoutes={};function Qv(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof ze&&Jv(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function Jv(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function tM({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:a}=n,{innerRadius:o,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,d=(s+a)/2+c,h={left:Math.max(u-o,i),right:Math.min(u+o,r),top:Math.max(d-o,s),bottom:Math.min(d+o,a)},g={x:(h.left+h.right)/2,y:(h.top+h.bottom)/2},m=t.spacing+t.borderWidth/2,b=o-m,_=g.y>d,w=_?s+m:a-m,M=nM(w,u,d,b);return{controllerMeta:{_centerX:u,_centerY:d,_radius:b,_counterclockwise:_,...M},point:g,radius:Math.min(o,Math.min(h.right-h.left,h.bottom-h.top)/2)}}function eM({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function nM(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),a=t*-2,o=Math.pow(t,2)+s-r,l=Math.pow(a,2)-4*o;if(l<=0)return{_startAngle:0,_endAngle:bt};const c=(-a-Math.sqrt(l))/2,u=(-a+Math.sqrt(l))/2;return{_startAngle:fs({x:t,y:e},{x:c,y:n}).angle,_endAngle:fs({x:t,y:e},{x:u,y:n}).angle}}function iM(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:a,_counterclockwise:o,options:l}=t;n.save();const c=Ye(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,a,o),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Zi extends Yt{inRange(t,e,i,s){return Ed({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return An(this,t)}draw(t){const e=this.options,i=!Jt(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),ir(t,this.getCenterPoint(),this.rotation),Dv(t,this),Yd(t,this,e),jd(t,sM(this),e),t.restore())}resolveElementProperties(t,e){let i;if(zd(e))i=qd(t,e);else{const{centerX:o,centerY:l}=so(t,e);i={x:o,y:l}}const s=zt(e.padding),r=sr(t.ctx,e),a=Id(i,r,e,s);return{initProperties:ei(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}Zi.id="labelAnnotation",Zi.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,hitTolerance: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},Zi.defaultRoutes={borderColor:"color"};function sM({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,a=zt(s.padding);return{x:n+a.left+r,y:t+a.top+r,width:e-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const oo=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),lo=(n,t,e)=>oo(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,ih=(n,t,e)=>oo(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Qi=n=>n*n,rM=(n,t,{x:e,y:i,x2:s,y2:r},a)=>a==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},sh=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,co=(n,t,e,i)=>({x:sh(n.x,t.x,e.x,i),y:sh(n.y,t.y,e.y,i)}),rh=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),ah=(n,t,e,i)=>-Math.atan2(rh(n.x,t.x,e.x,i),rh(n.y,t.y,e.y,i))+.5*rt;class Ji extends Yt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){Ye(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,h=e*u.currentDevicePixelRatio,g=l.isPointInStroke(o,d,h)||uo(this,a,s);return l.restore(),g}const c=Qi(r);return cM(this,a,c,s)||uo(this,a,s)}return aM(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return An(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:a,options:o}=this;if(t.save(),!Ye(t,o))return t.restore();ni(t,o);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(o.curve&&a)return yM(t,this,a,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=dh(this),g=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-h,0),t.shadowColor=o.borderShadowColor,t.stroke(),ho(t,0,d,c),ho(t,l,-h,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=Lv(t,e),{x:s,y:r,x2:a,y2:o}=i,l=oM(i,t.chartArea),c=l?lM({x:s,y:r},{x:a,y:o},t.chartArea):{x:s,y:r,x2:a,y2:o,width:Math.abs(a-s),height:Math.abs(o-r)};if(c.centerX=(a+s)/2,c.centerY=(o+r)/2,c.initProperties=ei(t,c,e),e.curve){const d={x:c.x,y:c.y},h={x:c.x2,y:c.y2};c.cp=mM(c,e,Wn(d,h))}const u=uM(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ji.id="lineAnnotation";const oh={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};Ji.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},oh),fill:!1,length:12,start:Object.assign({},oh),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance: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({},Zi.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,hitTolerance: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},Ji.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ji.defaultRoutes={borderColor:"color"};function aM(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const a=rM(t,e,n.getProps(["x","y","x2","y2"],r),i);return Pd(a,s)||uo(n,{mouseX:t,mouseY:e},r,i)}function oM({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:a,left:o}){return!(n<o&&e<o||n>r&&e>r||t<s&&i<s||t>a&&i>a)}function lh({x:n,y:t},e,{top:i,right:s,bottom:r,left:a}){return n<a&&(t=ih(a,{x:n,y:t},e),n=a),n>s&&(t=ih(s,{x:n,y:t},e),n=s),t<i&&(n=lo(i,{x:n,y:t},e),t=i),t>r&&(n=lo(r,{x:n,y:t},e),t=r),{x:n,y:t}}function lM(n,t,e){const{x:i,y:s}=lh(n,t,e),{x:r,y:a}=lh(t,n,e);return{x:i,y:s,x2:r,y2:a,width:Math.abs(r-i),height:Math.abs(a-s)}}function cM(n,{mouseX:t,mouseY:e},i=Rn,s){const{x:r,y:a,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],s),c=o-r,u=l-a,d=Qi(c)+Qi(u),h=d===0?-1:((t-r)*c+(e-a)*u)/d;let g,m;return h<0?(g=r,m=a):h>1?(g=o,m=l):(g=r+h*c,m=a+h*u),Qi(t-g)+Qi(e-m)<=i}function uo(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function uM(n,t,e){const i=e.borderWidth,s=zt(e.padding),r=sr(n.ctx,e),a=r.width+s.width+i,o=r.height+s.height+i;return hM(t,e,{width:a,height:o,padding:s},n.chartArea)}function dM(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>rt/2?r-rt:r<rt/-2?r+rt:r}function hM(n,t,e,i){const{width:s,height:r,padding:a}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?dM(n):Ft(t.rotation),h=fM(s,r,d),g=gM(n,t,{labelSize:h,padding:a},i),m=n.cp?co(c,n.cp,u,g):oo(c,u,g),b={size:h.w,min:i.left,max:i.right,padding:a.left},_={size:h.h,min:i.top,max:i.bottom,padding:a.top},w=uh(m.x,b)+o,M=uh(m.y,_)+l;return{x:w-s/2,y:M-r/2,x2:w+s/2,y2:M+r/2,centerX:w,centerY:M,pointX:m.x,pointY:m.y,width:s,height:r,rotation:hs(d)}}function fM(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function gM(n,t,e,i){let s;const r=pM(n,i);return t.position==="start"?s=ch({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-ch({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=eo(1,t.position),s}function ch(n,t,e,i){const{labelSize:s,padding:r}=t,a=n.w*i.dx,o=n.h*i.dy,l=a>0&&(s.w/2+r.left-i.x)/a,c=o>0&&(s.h/2+r.top-i.y)/o;return er(Math.max(l,c),0,.25)}function pM(n,t){const{x:e,x2:i,y:s,y2:r}=n,a=Math.min(s,r)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(a,l),dx:o<=c?1:-1,dy:a<=l?1:-1}}function uh(n,t){const{size:e,min:i,max:s,padding:r}=t,a=e/2;return e>s-i?(s+i)/2:(i>=n-r-a&&(n=i+r+a),s<=n+r+a&&(n=s-r-a),n)}function dh(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:hh(n,e),endAdjust:hh(n,i)}}function hh(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(lo(0,r,{x:0,y:s}))}function ho(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:a,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),ni(n,i),Ye(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),a===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function mM(n,t,e){const{x:i,y:s,x2:r,y2:a,centerX:o,centerY:l}=n,c=Math.atan2(a-s,r-i),u=no(t.controlPoint,0),d={x:o+cn(e,u.x,!1),y:l+cn(e,u.y,!1)};return En(d,{x:o,y:l},c)}function fh(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),ho(n,0,-s,r),n.restore())}function yM(n,t,e,i){const{x:s,y:r,x2:a,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=dh(t),g={x:s,y:r},m={x:a,y:o},b=ah(g,e,m,0),_=ah(g,e,m,1)-rt,w=co(g,e,m,d/i),M=co(g,e,m,1-h/i),S=new Path2D;n.beginPath(),S.moveTo(w.x,w.y),S.quadraticCurveTo(e.x,e.y,M.x,M.y),n.shadowColor=l.borderShadowColor,n.stroke(S),t.path=S,t.ctx=n,fh(n,w,{angle:b,adjust:d},c),fh(n,M,{angle:_,adjust:h},u)}class ts extends Yt{inRange(t,e,i,s){const r=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return bM({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,a);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),d=i==="y"?{start:l,end:u}:{start:o,end:c},h=En({x:t,y:e},this.getCenterPoint(s),Ft(-r));return h[i]>=d.start-a-Rn&&h[i]<=d.end+a+Rn}getCenterPoint(t){return An(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:a}=this;t.save(),ir(t,this.getCenterPoint(),a.rotation),ni(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=Ye(t,a);t.ellipse(s,r,i/2,e/2,rt/2,0,2*rt),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Gd(t,e)}}ts.id="ellipseAnnotation",ts.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},si.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},ts.defaultRoutes={borderColor:"color",backgroundColor:"color"},ts.descriptors={label:{_fallback:!0}};function bM(n,t,e,i){const{width:s,height:r,centerX:a,centerY:o}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Ft(e||0),d=Math.cos(u),h=Math.sin(u),g=Math.pow(d*(n.x-a)+h*(n.y-o),2),m=Math.pow(h*(n.x-a)-d*(n.y-o),2);return g/Math.pow(l+i,2)+m/Math.pow(c+i,2)<=1.0001}class or extends Yt{inRange(t,e,i,s){const{x:r,y:a,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?hv({x:t,y:e},this.getCenterPoint(s),c/2,u):Pd(i==="y"?{start:a,end:l,value:e}:{start:r,end:o,value:t},u)}getCenterPoint(t){return An(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,ni(t,e);const s=Ye(t,e);_v(t,this,this.centerX,this.centerY),s&&!nr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Xd(t,e);return i.initProperties=ei(t,i,e),i}}or.id="pointAnnotation",or.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},or.defaultRoutes={borderColor:"color",backgroundColor:"color"};class lr extends Yt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&_M(this.elements,t,e,s);const r=En({x:t,y:e},this.getCenterPoint(s),Ft(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...a),l=Math.max(...a);return r[i]>=o&&r[i]<=l}getCenterPoint(t){return An(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,ni(t,i);const s=Ye(t,i);let r=!0;for(const a of e)r?(t.moveTo(a.x,a.y),r=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Xd(t,e),{sides:s,rotation:r}=e,a=[],o=2*rt/s;let l=r*Pr;for(let c=0;c<s;c++,l+=o){const u=xM(i,e,l);u.initProperties=ei(t,i,e),a.push(u)}return i.elements=a,i}}lr.id="polygonAnnotation",lr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},lr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function xM({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const a=(i+s)/2,o=Math.sin(r),l=Math.cos(r),c={x:n+o*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+o*(e+a),bY:t-l*(e+a)}}}function _M(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const o=a.getProps(["bX","bY"],i);o.bY>e!=r.bY>e&&t<(r.bX-o.bX)*(e-o.bY)/(r.bY-o.bY)+o.bX&&(s=!s),r=o}return s}const un={box:si,doughnutLabel:ar,ellipse:ts,label:Zi,line:Ji,point:or,polygon:lr};Object.keys(un).forEach(n=>{_t.describe(`elements.${un[n].id}`,{_fallback:"plugins.annotation.common"})});const wM={update:Object.assign},vM=ao.concat(rr),gh=(n,t)=>nt(t)?po(n,t):n,fo=n=>n==="color"||n==="font";function go(n="line"){return un[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function MM(n,t,e,i){const s=SM(n,e.animations,i),r=t.annotations,a=CM(t.elements,r);for(let o=0;o<r.length;o++){const l=r[o],c=ph(a,o,l.type),u=l.setContext(TM(n,c,a,l)),d=c.resolveElementProperties(n,u);d.skip=kM(d),"elements"in d&&(DM(c,d.elements,u,s),delete d.elements),Jt(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=mh(u),s.update(c,d)}}function kM(n){return isNaN(n.x)||isNaN(n.y)}function SM(n,t,e){return e==="reset"||e==="none"||e==="resize"?wM:new jr(n,t)}function DM(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const a=t[r],o=a.properties,l=ph(s,r,a.type,a.initProperties),c=e[a.optionScope].override(a);o.options=mh(c),i.update(l,o)}}function ph(n,t,e,i){const s=un[go(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function mh(n){const t=un[go(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,po(n,t.defaults),po(n,t.defaultRoutes));for(const i of vM)e[i]=n[i];return e}function po(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];fo(i)&&ut(r)?e[i]=r.map(a=>gh(a,s)):e[i]=gh(r,s)}return e}function TM(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function CM(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var PM="3.1.0";const dn=new Map,yh=n=>n.type!=="doughnutLabel",OM=ao.concat(rr);var bh={id:"annotation",version:PM,beforeRegister(){fv("chart.js","4.0",ge.version)},afterRegister(){ge.register(un)},afterUnregister(){ge.unregister(un)},beforeInit(n){dn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=dn.get(n),s=i.annotations=[];let r=e.annotations;nt(r)?Object.keys(r).forEach(a=>{const o=r[a];nt(o)&&(o.id=a,s.push(o))}):ut(r)&&s.push(...r),qv(s.filter(yh),n.scales)},afterDataLimits(n,t){const e=dn.get(n);Uv(n,t.scale,e.annotations.filter(yh).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=dn.get(n);Wv(n,i,e),MM(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),$v(n,i,e)},beforeDatasetsDraw(n,t,e){es(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){es(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){es(n,t.index,e.clip)},beforeDraw(n,t,e){es(n,"beforeDraw",e.clip)},afterDraw(n,t,e){es(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=dn.get(n);Yv(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){dn.delete(n)},getAnnotations(n){const t=dn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return to(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!OM.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${un[go(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:fo,_fallback:!0},_indexable:fo}},additionalOptionScopes:[""]};function es(n,t,e){const{ctx:i,chartArea:s}=n,r=dn.get(n);e&&bi(i,s);const a=EM(r.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of a)RM(i,s,r,o);e&&xi(i)}function EM(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 s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function RM(n,t,e,i){const s=i.element;i.main?(th(e,s,"beforeDraw"),s.draw(n,t),th(e,s,"afterDraw")):s.draw(n,t)}const AM={class:"tooltip-title"},LM={class:"title font-bold"},IM={key:1,class:"subtitle"},NM={class:"tooltip"},FM={key:0},zM={class:"display-value"},BM=f.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,s=f.ref(null),r=f.ref(!1),a=f.ref({x:0,y:0}),o=f.ref({x:0,y:0}),l=f.ref({left:i.left,top:i.top});f.watch(s,g=>{if(g){const{width:m,height:b}=g.getBoundingClientRect();e("dimensions",{width:m,height:b})}}),f.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(s.value){r.value=!0;const m=window.getComputedStyle(s.value),b=m.transform||m.webkitTransform||m.mozTransform,_=new DOMMatrix(b),w=_.m41,M=_.m42;a.value={x:w,y:M},o.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",h)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),r.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const m=g.clientX-o.value.x,b=g.clientY-o.value.y;l.value.left=`${a.value.x+m}px`,l.value.top=`${a.value.y+b}px`}))}function h(){r.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",h)}return(g,m)=>n.showTooltip?(f.openBlock(),f.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:f.normalizeClass(["tooltip-container",{locked:n.locked}]),style:f.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},[f.createElementVNode("div",AM,[f.createElementVNode("span",LM,f.toDisplayString(n.tooltipTitle),1),n.locked?(f.openBlock(),f.createBlock(f.unref(Eo.DragIcon),{key:0,class:"drag-icon",color:f.unref(X1)},null,8,["color"])):f.createCommentVNode("",!0),n.context?(f.openBlock(),f.createElementBlock("span",IM,f.toDisplayString(n.context),1)):f.createCommentVNode("",!0)]),f.createElementVNode("ul",NM,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.series,({backgroundColor:b,borderColor:_,label:w,value:M,isSegmentEmpty:S})=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:w},[n.series.length?(f.openBlock(),f.createElementBlock("li",FM,[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:b,"border-color":_})},null,4),f.createElementVNode("span",{class:f.normalizeClass(["display-label",{empty:S}])},f.toDisplayString(w),3),f.createElementVNode("span",zM,f.toDisplayString(M),1)])):f.createCommentVNode("",!0)],64))),128))])],38)):f.createCommentVNode("",!0)}}),je=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},mo=je(BM,[["__scopeId","data-v-fcce9589"]]),HM=["onClick"],WM={key:0,class:"sub-label"},YM={class:"tooltip-content"},yo=je(f.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){f.useCssVars(k=>({"05011806":l.value}));const t=n,{i18n:e}=lt.useI18n(),i=f.ref(),s=f.ref([]),r=f.inject("showLegendValues",!0),a=f.inject("legendPosition",f.ref(Pt.Right)),o=f.ref([]),l=f.ref(Td),c=()=>{const k=i.value;if(!k||!s.value||k.children.length===0)return 0;const D=k.children[0].getBoundingClientRect().top;for(const O of s.value)if(O.getBoundingClientRect().top>D)return!0;return!1},u=f.computed(()=>t.items.length>2||a.value===Pt.Right),d=()=>{i.value&&a.value===Pt.Bottom&&(c()?l.value=Q1:l.value=Td)},h=()=>{if(i.value&&a.value===Pt.Bottom){let k=0;s.value.forEach(O=>{const P=Array.from(O.children).reduce((p,x)=>p+x.offsetWidth,0);P>k&&(k=P)});const D=parseInt(Z1,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${k+D}px)`}d()},g=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let k=0;k<t.items.length;k++)if(t.items[k].text!==o.value[k].text)return o.value=t.items,!0;return!1};f.watch(()=>t.items,()=>{g()&&h()},{immediate:!0,flush:"post"});const m=f.ref(0),b=f.ref(0),_=new ResizeObserver(Mu(k=>{const D=k[0],O=D.contentRect.width,P=D.contentRect.height;O!==m.value&&P===b.value&&h(),m.value=O,b.value=P},100));f.watch(()=>a.value,()=>{h()}),f.onMounted(()=>{o.value=t.items,i.value&&_.observe(i.value),window.requestAnimationFrame(()=>{h()})}),f.onBeforeUnmount(()=>{i.value&&_.unobserve(i.value)});const w=(k=0,D)=>{if(t.chartInstance===null)return;const O=t.chartInstance instanceof ge?t.chartInstance:t.chartInstance.chart;M(k,D)?O.hide(k,D):O.show(k,D),O.update()},M=(k=0,D)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const O=t.chartInstance instanceof ge?t.chartInstance:t.chartInstance.chart,P=O.getDatasetMeta(k);return P.dataset||D===void 0?O.isDatasetVisible(k):!(P.data.length&&P.data[D].hidden)},S=k=>({[Pt.Right]:"vertical",[Pt.Bottom]:"horizontal",[Pt.Hidden]:"hidden"})[k];return(k,D)=>{const O=f.resolveComponent("KTooltip");return f.unref(a)!==f.unref(Pt).Hidden?(f.openBlock(),f.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:f.normalizeClass(["legend-container",S(f.unref(a))]),"data-testid":"legend"},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.items,({fillStyle:P,strokeStyle:p,text:x,datasetIndex:T,index:E,value:A,isSegmentEmpty:L})=>(f.openBlock(),f.createElementBlock("li",{key:x,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:F=>w(T,E)},[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:P,"border-color":p})},null,4),f.createVNode(O,null,f.createSlots({default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["label-container",{"strike-through":!M(T,E)}])},[f.createElementVNode("div",{class:f.normalizeClass(["label",{"truncate-label":u.value,empty:L}])},f.toDisplayString(x),3),A&&f.unref(r)?(f.openBlock(),f.createElementBlock("div",WM,f.toDisplayString(A.formatted),1)):f.createCommentVNode("",!0)],2)]),_:2},[L?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",YM,f.toDisplayString(f.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,HM))),128))],2)):f.createCommentVNode("",!0)}}}),[["__scopeId","data-v-57146e87"]]);for(var jt=[],bo=0;bo<256;++bo)jt.push((bo+256).toString(16).slice(1));function jM(n,t=0){return(jt[n[t+0]]+jt[n[t+1]]+jt[n[t+2]]+jt[n[t+3]]+"-"+jt[n[t+4]]+jt[n[t+5]]+"-"+jt[n[t+6]]+jt[n[t+7]]+"-"+jt[n[t+8]]+jt[n[t+9]]+"-"+jt[n[t+10]]+jt[n[t+11]]+jt[n[t+12]]+jt[n[t+13]]+jt[n[t+14]]+jt[n[t+15]]).toLowerCase()}var cr,VM=new Uint8Array(16);function $M(){if(!cr&&(cr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cr(VM)}var UM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const xh={randomUUID:UM};function hn(n,t,e){if(xh.randomUUID&&!t&&!n)return xh.randomUUID();n=n||{};var i=n.random||(n.rng||$M)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,jM(i)}const _h=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()},wh={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&_h(n,this.clickedElements)},afterEvent:function(n,{event:t}){var s;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((s=n.options.interaction)==null?void 0:s.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,_h(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}},qM={class:"axis-tooltip-content"},vh=6,XM="100%",GM="100%",KM=20,ZM=20,Mh=6,QM=0,JM=10,tk=10,ek=1,nk=je(f.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}=lt.useI18n(),{translateUnit:i}=lt.useTranslatedUnits(),s=f.ref(null),r=({chart:I},W)=>{var G;const $=I.data,X=(G=$.labels)==null?void 0:G.indexOf(W);return $.datasets.reduce((V,H,it)=>{if(I.isDatasetVisible(it)){const K=H.data[X];return isNaN(K)?V:V+K}else return V},0)},a=(I,W,$,X)=>{const G=X==="horizontal";W===null&&(W=e.t("entityNoName"));const V={type:"label",yValue:K=>G?W:r(K,W),xValue:K=>G?r(K,W):W},H={...V,position:G?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>G?0:-Math.abs(n_()),content:K=>Aa(r(K,W),$)},it={...V,content:K=>Iu(r(K,W),Lu(K.chart,I)),position:G?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:K=>G?Au(Aa(r(K,W),$)):0,color:Ou};return{[`${W}-value`]:H,[`${W}-percent`]:it}},o=f.ref(null),l=f.ref(),c=f.ref(hn()),u=hn(),d=hn(),h=f.ref([]),g=f.ref(f.inject("legendPosition",Pt.Right)),m=f.ref({show:!1,top:"0px",left:"0px",text:"",offset:-50}),b=f.toRef(t,"metricUnit"),_=f.computed(()=>f.toRef(t,"orientation").value==="horizontal"),w=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:b,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:_.value?"horizontal_bar":"vertical_bar",chartTooltipSortFn:t.chartTooltipSortFn}),M=f.ref(0),S=()=>{var I;return t.annotations&&((I=t.chartData.labels)==null?void 0:I.reduce((W,$)=>Object.assign(W,a(t.chartData,$,b.value,t.orientation)),{}))},k={id:c.value,afterUpdate(I){M.value+=1,h.value=ku(I,t.legendValues,t.chartLegendSortFn)}},D={id:u,afterUpdate(I){I.options.plugins.annotation.annotations=t.annotations?S():{}}},p=[k,{id:"axisHover",afterEvent(I,W){var $;if(m.value.show=!1,W.event.type==="mousemove"){const X=W.event,G=I.options.indexAxis,V=I.scales,H=I.scales[G].getLabelForValue(Number(I.scales[G].getValueForPixel(X[G]))),K=I.scales[G].getLabels().indexOf(H),St=($=t.chartData.isLabelEmpty)==null?void 0:$[K];if((Nt=>Nt==="x"?X.y>V.x.top:X.x<V.y.right)(G)){w.locked||(w.showTooltip=!1);const yt=I.canvas.getContext("2d").measureText(H).width,ct=Math.abs(Math.round(X.x-yt*.5)),Ut=Math.round(X.x+yt*.5);m.value.left=G==="x"?`${(ct>0?ct:Ut)-m.value.offset}px`:`${X.x-yt*.5-m.value.offset}px`,m.value.top=`${X.y-50}px`,H.length>Us?(m.value.show=!0,m.value.text=H):St?(m.value.text=e.t("emptyEntityInfo"),m.value.show=!0):m.value.show=!1}else m.value.show=!1}}},{id:d,afterUpdate(I){I.options.layout.padding.right=_.value?N.value:0}},wh,...t.annotations?[D]:[]],x=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),T=f.ref(0),E=f.ref(0),A=new ResizeObserver(Mu(I=>{T.value=I[0].contentRect.width,E.value=I[0].contentRect.height},100)),L=f.computed(()=>{var W,$;const I=($=(W=t.chartData)==null?void 0:W.labels)==null?void 0:$.length;return o.value&&I&&!_.value?`${Math.max(I*(KM+Mh),T.value)}px`:XM}),F=f.computed(()=>{var W,$;const I=($=(W=t.chartData)==null?void 0:W.labels)==null?void 0:$.length;return o.value&&I&&_.value?`${Math.max(I*(ZM+Mh),E.value)}px`:GM});lt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&ge.register(bh),s.value&&(T.value=s.value.offsetWidth,E.value=s.value.offsetHeight,A.observe(s.value))}),f.onUnmounted(()=>{s.value&&A.unobserve(s.value)});const U=f.computed(()=>{const I=lt.useBarChartOptions({tooltipState:w,legendID:c.value,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:_.value?"y":"x",numLabels:x});return{...I.value,plugins:{...I.value.plugins,annotation:{annotations:S(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*vh}}}}),j=lt.useChartJSCommon("bar",o,f.toRef(t,"chartData"),p,U),N=f.computed(()=>{M.value;const I=t.chartData.labels,W=t.chartData.datasets,$=I.map((V,H)=>W.reduce((it,K)=>isNaN(Number(K.data[H]))?it:it+Number(K.data[H]),0)),X=j.value?Lu(j.value,t.chartData):i_(t.chartData);return $.map(V=>Au(Aa(V,b.value)+Iu(V,X))).reduce((V,H)=>Math.max(V,H),0)+vh});f.onBeforeUnmount(()=>{ge.unregister(bh)});const st={[Pt.Right]:"legend-row",[Pt.Bottom]:"column"},B=f.computed(()=>{if(l.value&&j.value){const I=window.devicePixelRatio,W=j.value,$=W.scales.y.width*I+ek,X=(W.scales.y.height+W.scales.y.top+W.scales.x.height)*I,G=l.value.getContext("2d");return G.scale(I,I),G.canvas.width=$,G.canvas.height=X,G.canvas.style.width=`${$/I}px`,G.canvas.style.height=`${X/I}px`,{scale:I,width:$*I,height:X*I,targetCtx:G}}return null}),Rt=I=>{const W=I.target;if(B.value&&j.value&&!_.value){const $=B.value.scale,X=B.value.targetCtx,G=B.value.width,V=B.value.height,H=j.value,it=H.canvas;X.fillStyle="white",W.scrollLeft>=QM&&W.scrollLeft<=JM?(X.globalCompositeOperation="source-over",X.clearRect(0,0,G,V),X.drawImage(it,0,0,G,V,0,0,G,V),X.globalCompositeOperation="destination-over",X.fillRect(0,0,G,V)):(X.globalCompositeOperation="source-over",X.fillRect(0,(H.scales.y.height+H.scales.y.top+tk)*$,G,H.scales.x.height*$))}w.offsetY=W.scrollTop,w.offsetX=W.scrollLeft,m.value.offset=W.scrollLeft},wt=({width:I,height:W})=>{w.width=I,w.height=W};f.watch(()=>t.orientation,()=>{var I;if(l.value&&B.value){const W=B.value.width,$=B.value.height;((I=l.value)==null?void 0:I.getContext("2d")).clearRect(0,0,W,$)}w.showTooltip=!1,w.locked=!1}),f.watch(()=>t.annotations,I=>{j.value&&(I?j.value.options.plugins.annotation.annotations=S(t.chartData):delete j.value.options.plugins.annotation.annotations)});const Y=()=>{w.showTooltip&&(w.locked=!w.locked)};return(I,W)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",st[g.value]])},[f.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),f.createElementVNode("div",{ref_key:"chartContainerRef",ref:s,class:"chart-container","on:scroll":Rt,onClick:W[0]||(W[0]=$=>Y())},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:L.value,height:F.value})},[f.createElementVNode("canvas",{ref_key:"canvas",ref:o,class:"chart-canvas"},null,512)],4)],544),m.value.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:m.value.top,left:m.value.left}),width:"auto"},[f.createElementVNode("div",qM,f.toDisplayString(m.value.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(mo,{context:w.tooltipContext,left:w.left,locked:w.locked,series:w.tooltipSeries,"show-tooltip":w.showTooltip,"tooltip-title":n.tooltipTitle,top:w.top,onDimensions:wt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),f.createVNode(yo,{id:c.value,"chart-instance":f.unref(j),items:h.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-e3a7d88f"]]);/*!
23
+ */const Xh={modes:{point(n,t){return Yr(n,t,{intersect:!0})},nearest(n,t,e){return yM(n,t,e)},x(n,t,e){return Yr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Yr(n,t,{intersect:e.intersect,axis:"y"})}}};function Za(n,t,e){return(Xh.modes[e.mode]||Xh.modes.nearest)(n,t,e)}function pM(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 mM(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Yr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):pM(i,t,e.axis))}function yM(n,t,e){let i=Number.POSITIVE_INFINITY;return Yr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=mM(t,o,e.axis),l=ci(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Jn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const bM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,jr=(n,t,e)=>Math.min(e,Math.max(t,n)),Gh=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function _M(n,t,e){for(const i of Object.keys(n))n[i]=jr(n[i],t,e);return n}function xM(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Kh(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function Zh(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Jn(n,e,Yt(-s));return Kh(a,t,i,{borderWidth:r,hitTolerance:o})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function wM(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(bM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Qh=n=>typeof n=="string"&&n.endsWith("%"),Jh=n=>parseFloat(n)/100,tf=n=>jr(Jh(n),0,1),Ts=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),vM={box:n=>Ts(n.centerX,n.centerY),doughnutLabel:n=>Ts(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ts(n.centerX,n.centerY),line:n=>Ts(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ts(n.centerX,n.centerY)};function Qa(n,t){return t==="start"?0:t==="end"?n:Qh(t)?tf(t)*n:n/2}function Dn(n,t,e=!0){return typeof t=="number"?t:Qh(t)?(e?tf(t):Jh(t))*n:n}function MM(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function ef(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=lt(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=Ja(i),d=of(n.x,l,s,u.x),h=of(n.y,c,r,u.y);return{x:d,y:h,x2:d+l,y2:h+c,width:l,height:c,centerX:d+l/2,centerY:h+c/2}}function Ja(n,t="center"){return lt(n)?{x:it(n.x,t),y:it(n.y,t)}:(n=it(n,t),{x:n,y:n})}const nf=(n,t)=>n&&n.autoFit&&t<1;function sf(n,t){const e=n.font,i=bt(e)?e:[e];return nf(n,t)?i.map(function(s){const r=Et(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,Et(r)}):i.map(s=>Et(s))}function rf(n){return n&&(he(n.xValue)||he(n.yValue))}function of(n,t,e=0,i){return n-Qa(t,i)+e}function Mi(n,t,e){const i=e.init;if(i){if(i===!0)return lf(t,e)}else return;return SM(n,t,e)}function af(n,t,e){let i=!1;return t.forEach(s=>{fe(n[s])?(i=!0,e[s]=n[s]):he(e[s])&&delete e[s]}),i}function lf(n,t){const e=t.type||"line";return vM[e](n)}function SM(n,t,e){const i=_t(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return lf(t,e);if(lt(i))return i}const tl=new Map,kM=n=>isNaN(n)||n<=0,DM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function Vr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function $r(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Yt(i)),n.translate(-t,-e))}function ln(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Si(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Ur(n,t){const e=t.content;if(Vr(e))return{width:Dn(e.width,t.width),height:Dn(e.height,t.height)};const i=sf(t),s=t.textStrokeWidth,r=bt(e)?e:[e],o=r.join()+DM(i)+s+(n._measureText?"-spriting":"");return tl.has(o)||tl.set(o,PM(n,r,i,s)),tl.get(o)}function cf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Si(n,e);const a=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),ui(n,{x:i,y:s,w:r,h:o,radius:_M(_n(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function uf(n,t,e,i){const s=e.content;if(Vr(s)){n.save(),n.globalAlpha=RM(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=bt(s)?s:[s],o=sf(e,i),a=e.color,l=bt(a)?a:[a],c=MM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,TM(n,e)&&EM(n,{x:c,y:u},r,o),AM(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function TM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function CM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Do;if(Vr(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}kM(s)||OM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function OM(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,St),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Zs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Zs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+Oe)*c,l=Math.sin(o+Oe)*c,n.arc(t-a,e-l,u,o-ut,o-Ct),n.arc(t+l,e-a,u,o-Ct,o),n.arc(t+a,e+l,u,o,o+Ct),n.arc(t-l,e+a,u,o+Ct,o+ut),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Oe;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=Oe;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=Oe,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function PM(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function EM(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function AM(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+d/2+o),o+=d,n.fill()})}function RM(n,t){const e=bn(n)?n:t;return bn(e)?jr(e,0,1):1}const df=["left","bottom","top","right"];function LM(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&BM(t,r);if(!o||WM(t,r,o))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=IM(t,o),{sideStart:u,sideEnd:d}=FM(t,o,l);(r.margin>0||s.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 h=Jn({x:e,y:i},t.getCenterPoint(),Yt(-t.rotation));n.lineTo(h.x,h.y),n.stroke(),n.restore()}function IM(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=NM(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function NM(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function FM(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=zM(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Dn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Dn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function zM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function BM(n,t){const e=t.position;return df.includes(e)?e:HM(n,t)}function HM(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:h}=n,g={x:u,y:d},m=t.start,b=Dn(o,m),w=Dn(a,m),v=[e,e+b,e+b,s],S=[i+w,r,i,r],D=[];for(let k=0;k<4;k++){const T=Jn({x:v[k],y:S[k]},g,Yt(h));D.push({position:df[k],distance:ci(T,{x:l,y:c})})}return D.sort((k,T)=>k.distance-T.distance)[0].position}function WM(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}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 ki(n,t,e){return t=typeof t=="number"?t:n.parse(t),Pt(t)?n.getPixelForValue(t):e}function ni(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function ff(n,t){if(n){const e=n.options.reverse,i=ki(n,t.min,e?t.end:t.start),s=ki(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function gf(n,t){const{chartArea:e,scales:i}=n,s=i[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=ki(s,t.xValue,s.left+s.width/2)),r&&(a=ki(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function el(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=yf(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=yf(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function pf(n,t){if(!rf(t)){const e=el(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return jM(n,t)}function YM(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?VM(s,r,t):$M(e,r,t),r}function mf(n,t){const e=el(n,t);return e.initProperties=Mi(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:XM(n,e,t),initProperties:e.initProperties}],e}function jM(n,t){const e=gf(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 yf(n,t){const e=ff(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function VM(n,t,e){const i=ki(n,e.value,NaN),s=ki(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function $M(n,t,e){for(const i of Object.keys(hf)){const s=n[ni(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=hf[i],d=ff(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function UM({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return bf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function qM({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return bf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function bf(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+Qa(c,r)}function XM(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=Ja(i.position),r=jt(i.padding),o=Ur(n.ctx,i),a=UM({properties:t,options:e},o,s,r),l=qM({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const nl=["enter","leave"],il=nl.concat("click");function GM(n,t,e){t.listened=af(e,il,t.listeners),t.moveListened=!1,nl.forEach(i=>{fe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&fe(i.click)&&(t.listened=!0),t.moveListened||nl.forEach(s=>{fe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function KM(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ZM(n,t,e);case"click":return QM(n,t,e)}}function ZM(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Za(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=_f(r,"leave",s,i);return _f(r,"enter",i,s)||o}function _f({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=xf(o.options[e]||n.listeners[e],o,t)||r);return r}function QM(n,t,e){const i=n.listeners,s=Za(n.visibleElements,t,e.interaction);let r;for(const o of s)r=xf(o.options.click||i.click,o,t)||r;return r}function xf(n,t,e){return _t(n,[t.$context,e])===!0}const qr=["afterDraw","beforeDraw"];function JM(n,t,e){const i=t.visibleElements;t.hooked=af(e,qr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||qr.forEach(r=>{fe(s.options[r])&&(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 tS(n,t,e){const i=rS(n.scales,t,e);let s=vf(t,i,"min","suggestedMin");s=vf(t,i,"max","suggestedMax")||s,s&&fe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function eS(n,t){for(const e of n)iS(e,t)}function vf(n,t,e,i){if(Pt(t[e])&&!nS(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function nS(n,t,e){return he(n[t])||he(n[e])}function iS(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&sS(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function sS(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(he(n[e+i]))return!0;return!1}function rS(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:it(t.min,Number.NEGATIVE_INFINITY),max:it(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Mf(a,t,["value","endValue"],o):ni(n,a,r)===s&&Mf(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Mf(n,t,e,i){for(const s of e){const r=n[s];if(he(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Di extends Gt{inRange(t,e,i,s){const{x:r,y:o}=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-this.options.rotation));return Kh({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),$r(t,this.getCenterPoint(),this.options.rotation),cf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return mf(t,e)}}Di.id="boxAnnotation",Di.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance: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,hitTolerance: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},Di.defaultRoutes={borderColor:"color",backgroundColor:"color"},Di.descriptors={label:{_fallback:!0}};class Xr extends Gt{inRange(t,e,i,s){return Zh({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(dS(t,this),t.save(),$r(t,this.getCenterPoint(),this.rotation),uf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=oS(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=lS(t,e,i);let a=Ur(t.ctx,e);const l=cS(a,o);nf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,h=ef(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Mi(t,h,e),...h,...s,rotation:e.rotation,_fitRatio:l}}}Xr.id="doughnutLabelAnnotation",Xr.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,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,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},Xr.defaultRoutes={};function oS(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof sn&&aS(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function aS(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function lS({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:o}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,d=(s+o)/2+c,h={left:Math.max(u-a,i),right:Math.min(u+a,r),top:Math.max(d-a,s),bottom:Math.min(d+a,o)},g={x:(h.left+h.right)/2,y:(h.top+h.bottom)/2},m=t.spacing+t.borderWidth/2,b=a-m,w=g.y>d,v=w?s+m:o-m,S=uS(v,u,d,b);return{controllerMeta:{_centerX:u,_centerY:d,_radius:b,_counterclockwise:w,...S},point:g,radius:Math.min(a,Math.min(h.right-h.left,h.bottom-h.top)/2)}}function cS({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function uS(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),o=t*-2,a=Math.pow(t,2)+s-r,l=Math.pow(o,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:St};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:Js({x:t,y:e},{x:c,y:n}).angle,_endAngle:Js({x:t,y:e},{x:u,y:n}).angle}}function dS(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,o,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Cs extends Gt{inRange(t,e,i,s){return Zh({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=!he(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),$r(t,this.getCenterPoint(),this.rotation),LM(t,this),cf(t,this,e),uf(t,hS(this),e),t.restore())}resolveElementProperties(t,e){let i;if(rf(e))i=gf(t,e);else{const{centerX:a,centerY:l}=el(t,e);i={x:a,y:l}}const s=jt(e.padding),r=Ur(t.ctx,e),o=ef(i,r,e,s);return{initProperties:Mi(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Cs.id="labelAnnotation",Cs.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,hitTolerance: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},Cs.defaultRoutes={borderColor:"color"};function hS({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=jt(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}const sl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),rl=(n,t,e)=>sl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Sf=(n,t,e)=>sl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Os=n=>n*n,fS=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},kf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ol=(n,t,e,i)=>({x:kf(n.x,t.x,e.x,i),y:kf(n.y,t.y,e.y,i)}),Df=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Tf=(n,t,e,i)=>-Math.atan2(Df(n.x,t.x,e.x,i),Df(n.y,t.y,e.y,i))+.5*ut;class Ps extends Gt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,h=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,h)||al(this,o,s);return l.restore(),g}const c=Os(r);return yS(this,o,c,s)||al(this,o,s)}return gS(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!ln(t,a))return t.restore();Si(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return kS(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Af(this),g=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-h,0),t.shadowColor=a.borderShadowColor,t.stroke(),ll(t,0,d,c),ll(t,l,-h,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=YM(t,e),{x:s,y:r,x2:o,y2:a}=i,l=pS(i,t.chartArea),c=l?mS({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Mi(t,c,e),e.curve){const d={x:c.x,y:c.y},h={x:c.x2,y:c.y2};c.cp=SS(c,e,ci(d,h))}const u=bS(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ps.id="lineAnnotation";const Cf={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};Ps.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Cf),fill:!1,length:12,start:Object.assign({},Cf),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance: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({},Cs.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,hitTolerance: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},Ps.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ps.defaultRoutes={borderColor:"color"};function gS(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=fS(t,e,n.getProps(["x","y","x2","y2"],r),i);return Gh(o,s)||al(n,{mouseX:t,mouseY:e},r,i)}function pS({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function Of({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Sf(o,{x:n,y:t},e),n=o),n>s&&(t=Sf(s,{x:n,y:t},e),n=s),t<i&&(n=rl(i,{x:n,y:t},e),t=i),t>r&&(n=rl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function mS(n,t,e){const{x:i,y:s}=Of(n,t,e),{x:r,y:o}=Of(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function yS(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Os(c)+Os(u),h=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,m;return h<0?(g=r,m=o):h>1?(g=a,m=l):(g=r+h*c,m=o+h*u),Os(t-g)+Os(e-m)<=i}function al(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function bS(n,t,e){const i=e.borderWidth,s=jt(e.padding),r=Ur(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return xS(t,e,{width:o,height:a,padding:s},n.chartArea)}function _S(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ut/2?r-ut:r<ut/-2?r+ut:r}function xS(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?_S(n):Yt(t.rotation),h=wS(s,r,d),g=vS(n,t,{labelSize:h,padding:o},i),m=n.cp?ol(c,n.cp,u,g):sl(c,u,g),b={size:h.w,min:i.left,max:i.right,padding:o.left},w={size:h.h,min:i.top,max:i.bottom,padding:o.top},v=Ef(m.x,b)+a,S=Ef(m.y,w)+l;return{x:v-s/2,y:S-r/2,x2:v+s/2,y2:S+r/2,centerX:v,centerY:S,pointX:m.x,pointY:m.y,width:s,height:r,rotation:Qs(d)}}function wS(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function vS(n,t,e,i){let s;const r=MS(n,i);return t.position==="start"?s=Pf({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Pf({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Qa(1,t.position),s}function Pf(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return jr(Math.max(l,c),0,.25)}function MS(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function Ef(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function Af(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Rf(n,e),endAdjust:Rf(n,i)}}function Rf(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(rl(0,r,{x:0,y:s}))}function ll(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Si(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function SS(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=Ja(t.controlPoint,0),d={x:a+Dn(e,u.x,!1),y:l+Dn(e,u.y,!1)};return Jn(d,{x:a,y:l},c)}function Lf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),ll(n,0,-s,r),n.restore())}function kS(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Af(t),g={x:s,y:r},m={x:o,y:a},b=Tf(g,e,m,0),w=Tf(g,e,m,1)-ut,v=ol(g,e,m,d/i),S=ol(g,e,m,1-h/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,S.x,S.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Lf(n,v,{angle:b,adjust:d},c),Lf(n,S,{angle:w,adjust:h},u)}class Es extends Gt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return DS({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),d=i==="y"?{start:l,end:u}:{start:a,end:c},h=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-r));return h[i]>=d.start-o-ti&&h[i]<=d.end+o+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),$r(t,this.getCenterPoint(),o.rotation),Si(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=ln(t,o);t.ellipse(s,r,i/2,e/2,ut/2,0,2*ut),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return mf(t,e)}}Es.id="ellipseAnnotation",Es.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Di.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},Es.defaultRoutes={borderColor:"color",backgroundColor:"color"},Es.descriptors={label:{_fallback:!0}};function DS(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Yt(e||0),d=Math.cos(u),h=Math.sin(u),g=Math.pow(d*(n.x-o)+h*(n.y-a),2),m=Math.pow(h*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+m/Math.pow(c+i,2)<=1.0001}class Gr extends Gt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?xM({x:t,y:e},this.getCenterPoint(s),c/2,u):Gh(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Si(t,e);const s=ln(t,e);CM(t,this,this.centerX,this.centerY),s&&!Vr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=pf(t,e);return i.initProperties=Mi(t,i,e),i}}Gr.id="pointAnnotation",Gr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},Gr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class Kr extends Gt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&CS(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Si(t,i);const s=ln(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=pf(t,e),{sides:s,rotation:r}=e,o=[],a=2*ut/s;let l=r*Do;for(let c=0;c<s;c++,l+=a){const u=TS(i,e,l);u.initProperties=Mi(t,i,e),o.push(u)}return i.elements=o,i}}Kr.id="polygonAnnotation",Kr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},Kr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function TS({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const o=(i+s)/2,a=Math.sin(r),l=Math.cos(r),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+o),bY:t-l*(e+o)}}}function CS(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const Tn={box:Di,doughnutLabel:Xr,ellipse:Es,label:Cs,line:Ps,point:Gr,polygon:Kr};Object.keys(Tn).forEach(n=>{Ot.describe(`elements.${Tn[n].id}`,{_fallback:"plugins.annotation.common"})});const OS={update:Object.assign},PS=il.concat(qr),If=(n,t)=>lt(t)?dl(n,t):n,cl=n=>n==="color"||n==="font";function ul(n="line"){return Tn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function ES(n,t,e,i){const s=RS(n,e.animations,i),r=t.annotations,o=NS(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=Nf(o,a,l.type),u=l.setContext(IS(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=AS(d),"elements"in d&&(LS(c,d.elements,u,s),delete d.elements),he(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Ff(u),s.update(c,d)}}function AS(n){return isNaN(n.x)||isNaN(n.y)}function RS(n,t,e){return e==="reset"||e==="none"||e==="resize"?OS:new Ho(n,t)}function LS(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=Nf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Ff(c),i.update(l,a)}}function Nf(n,t,e,i){const s=Tn[ul(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Ff(n){const t=Tn[ul(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,dl(n,t.defaults),dl(n,t.defaultRoutes));for(const i of PS)e[i]=n[i];return e}function dl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];cl(i)&&bt(r)?e[i]=r.map(o=>If(o,s)):e[i]=If(r,s)}return e}function IS(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function NS(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var FS="3.1.0";const Cn=new Map,zf=n=>n.type!=="doughnutLabel",zS=il.concat(qr);var Bf={id:"annotation",version:FS,beforeRegister(){wM("chart.js","4.0",Pe.version)},afterRegister(){Pe.register(Tn)},afterUnregister(){Pe.unregister(Tn)},beforeInit(n){Cn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Cn.get(n),s=i.annotations=[];let r=e.annotations;lt(r)?Object.keys(r).forEach(o=>{const a=r[o];lt(a)&&(a.id=o,s.push(a))}):bt(r)&&s.push(...r),eS(s.filter(zf),n.scales)},afterDataLimits(n,t){const e=Cn.get(n);tS(n,t.scale,e.annotations.filter(zf).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Cn.get(n);GM(n,i,e),ES(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),JM(n,i,e)},beforeDatasetsDraw(n,t,e){As(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){As(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){As(n,t.index,e.clip)},beforeDraw(n,t,e){As(n,"beforeDraw",e.clip)},afterDraw(n,t,e){As(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Cn.get(n);KM(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Cn.delete(n)},getAnnotations(n){const t=Cn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Za(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!zS.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Tn[ul(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:cl,_fallback:!0},_indexable:cl}},additionalOptionScopes:[""]};function As(n,t,e){const{ctx:i,chartArea:s}=n,r=Cn.get(n);e&&Gi(i,s);const o=BS(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)HS(i,s,r,a);e&&Ki(i)}function BS(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 s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function HS(n,t,e,i){const s=i.element;i.main?(wf(e,s,"beforeDraw"),s.draw(n,t),wf(e,s,"afterDraw")):s.draw(n,t)}const WS={class:"tooltip-title"},YS={class:"title font-bold"},jS={key:1,class:"subtitle"},VS={class:"tooltip"},$S={key:0},US={class:"display-value"},qS=f.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,s=f.ref(null),r=f.ref(!1),o=f.ref({x:0,y:0}),a=f.ref({x:0,y:0}),l=f.ref({left:i.left,top:i.top});f.watch(s,g=>{if(g){const{width:m,height:b}=g.getBoundingClientRect();e("dimensions",{width:m,height:b})}}),f.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(s.value){r.value=!0;const m=window.getComputedStyle(s.value),b=m.transform||m.webkitTransform||m.mozTransform,w=new DOMMatrix(b),v=w.m41,S=w.m42;o.value={x:v,y:S},a.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",h)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),r.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const m=g.clientX-a.value.x,b=g.clientY-a.value.y;l.value.left=`${o.value.x+m}px`,l.value.top=`${o.value.y+b}px`}))}function h(){r.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",h)}return(g,m)=>n.showTooltip?(f.openBlock(),f.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:f.normalizeClass(["tooltip-container",{locked:n.locked}]),style:f.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},[f.createElementVNode("div",WS,[f.createElementVNode("span",YS,f.toDisplayString(n.tooltipTitle),1),n.locked?(f.openBlock(),f.createBlock(f.unref(Zl.DragIcon),{key:0,class:"drag-icon",color:f.unref(nM)},null,8,["color"])):f.createCommentVNode("",!0),n.context?(f.openBlock(),f.createElementBlock("span",jS,f.toDisplayString(n.context),1)):f.createCommentVNode("",!0)]),f.createElementVNode("ul",VS,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.series,({backgroundColor:b,borderColor:w,label:v,value:S,isSegmentEmpty:D})=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:v},[n.series.length?(f.openBlock(),f.createElementBlock("li",$S,[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:b,"border-color":w})},null,4),f.createElementVNode("span",{class:f.normalizeClass(["display-label",{empty:D}])},f.toDisplayString(v),3),f.createElementVNode("span",US,f.toDisplayString(S),1)])):f.createCommentVNode("",!0)],64))),128))])],38)):f.createCommentVNode("",!0)}}),cn=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},hl=cn(qS,[["__scopeId","data-v-fcce9589"]]),XS=["onClick"],GS={key:0,class:"sub-label"},KS={class:"tooltip-content"},fl=cn(f.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){f.useCssVars(k=>({"05011806":l.value}));const t=n,{i18n:e}=mt.useI18n(),i=f.ref(),s=f.ref([]),r=f.inject("showLegendValues",!0),o=f.inject("legendPosition",f.ref(It.Right)),a=f.ref([]),l=f.ref(qh),c=()=>{const k=i.value;if(!k||!s.value||k.children.length===0)return 0;const T=k.children[0].getBoundingClientRect().top;for(const A of s.value)if(A.getBoundingClientRect().top>T)return!0;return!1},u=f.computed(()=>t.items.length>2||o.value===It.Right),d=()=>{i.value&&o.value===It.Bottom&&(c()?l.value=oM:l.value=qh)},h=()=>{if(i.value&&o.value===It.Bottom){let k=0;s.value.forEach(A=>{const E=Array.from(A.children).reduce((p,_)=>p+_.offsetWidth,0);E>k&&(k=E)});const T=parseInt(rM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${k+T}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let k=0;k<t.items.length;k++)if(t.items[k].text!==a.value[k].text)return a.value=t.items,!0;return!1};f.watch(()=>t.items,()=>{g()&&h()},{immediate:!0,flush:"post"});const m=f.ref(0),b=f.ref(0),w=new ResizeObserver(jd(k=>{const T=k[0],A=T.contentRect.width,E=T.contentRect.height;A!==m.value&&E===b.value&&h(),m.value=A,b.value=E},100));f.watch(()=>o.value,()=>{h()}),f.onMounted(()=>{a.value=t.items,i.value&&w.observe(i.value),window.requestAnimationFrame(()=>{h()})}),f.onBeforeUnmount(()=>{i.value&&w.unobserve(i.value)});const v=(k=0,T)=>{if(t.chartInstance===null)return;const A=t.chartInstance instanceof Pe?t.chartInstance:t.chartInstance.chart;S(k,T)?A.hide(k,T):A.show(k,T),A.update()},S=(k=0,T)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const A=t.chartInstance instanceof Pe?t.chartInstance:t.chartInstance.chart,E=A.getDatasetMeta(k);return E.dataset||T===void 0?A.isDatasetVisible(k):!(E.data.length&&E.data[T].hidden)},D=k=>({[It.Right]:"vertical",[It.Bottom]:"horizontal",[It.Hidden]:"hidden"})[k];return(k,T)=>{const A=f.resolveComponent("KTooltip");return f.unref(o)!==f.unref(It).Hidden?(f.openBlock(),f.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:f.normalizeClass(["legend-container",D(f.unref(o))]),"data-testid":"legend"},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.items,({fillStyle:E,strokeStyle:p,text:_,datasetIndex:C,index:R,value:L,isSegmentEmpty:N})=>(f.openBlock(),f.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:B=>v(C,R)},[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:E,"border-color":p})},null,4),f.createVNode(A,null,f.createSlots({default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["label-container",{"strike-through":!S(C,R)}])},[f.createElementVNode("div",{class:f.normalizeClass(["label",{"truncate-label":u.value,empty:N}])},f.toDisplayString(_),3),L&&f.unref(r)?(f.openBlock(),f.createElementBlock("div",GS,f.toDisplayString(L.formatted),1)):f.createCommentVNode("",!0)],2)]),_:2},[N?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",KS,f.toDisplayString(f.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,XS))),128))],2)):f.createCommentVNode("",!0)}}}),[["__scopeId","data-v-57146e87"]]);for(var Jt=[],gl=0;gl<256;++gl)Jt.push((gl+256).toString(16).slice(1));function ZS(n,t=0){return(Jt[n[t+0]]+Jt[n[t+1]]+Jt[n[t+2]]+Jt[n[t+3]]+"-"+Jt[n[t+4]]+Jt[n[t+5]]+"-"+Jt[n[t+6]]+Jt[n[t+7]]+"-"+Jt[n[t+8]]+Jt[n[t+9]]+"-"+Jt[n[t+10]]+Jt[n[t+11]]+Jt[n[t+12]]+Jt[n[t+13]]+Jt[n[t+14]]+Jt[n[t+15]]).toLowerCase()}var Zr,QS=new Uint8Array(16);function JS(){if(!Zr&&(Zr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zr(QS)}var tk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:tk};function On(n,t,e){if(Hf.randomUUID&&!t&&!n)return Hf.randomUUID();n=n||{};var i=n.random||(n.rng||JS)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,ZS(i)}const Wf=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()},Yf={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&Wf(n,this.clickedElements)},afterEvent:function(n,{event:t}){var s;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((s=n.options.interaction)==null?void 0:s.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,Wf(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}},ek={class:"axis-tooltip-content"},jf=6,nk="100%",ik="100%",sk=20,rk=20,Vf=6,ok=0,ak=10,lk=10,ck=1,uk=cn(f.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}=mt.useI18n(),{translateUnit:i}=mt.useTranslatedUnits(),s=f.ref(null),r=({chart:z},j)=>{var tt;const X=z.data,Z=(tt=X.labels)==null?void 0:tt.indexOf(j);return X.datasets.reduce((q,V,ot)=>{if(z.isDatasetVisible(ot)){const J=V.data[Z];return isNaN(J)?q:q+J}else return q},0)},o=(z,j,X,Z)=>{const tt=Z==="horizontal";j===null&&(j=e.t("entityNoName"));const q={type:"label",yValue:J=>tt?j:r(J,j),xValue:J=>tt?r(J,j):j},V={...q,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(uw()),content:J=>Pa(r(J,j),X)},ot={...q,content:J=>eh(r(J,j),th(J.chart,z)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:J=>tt?Jd(Pa(r(J,j),X)):0,color:Kd};return{[`${j}-value`]:V,[`${j}-percent`]:ot}},a=f.ref(null),l=f.ref(),c=f.ref(On()),u=On(),d=On(),h=f.ref([]),g=f.ref(f.inject("legendPosition",It.Right)),m=f.ref({show:!1,top:"0px",left:"0px",text:"",offset:-50}),b=f.toRef(t,"metricUnit"),w=f.computed(()=>f.toRef(t,"orientation").value==="horizontal"),v=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:b,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:w.value?"horizontal_bar":"vertical_bar",chartTooltipSortFn:t.chartTooltipSortFn}),S=f.ref(0),D=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce((j,X)=>Object.assign(j,o(t.chartData,X,b.value,t.orientation)),{}))},k={id:c.value,afterUpdate(z){S.value+=1,h.value=Vd(z,t.legendValues,t.chartLegendSortFn)}},T={id:u,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?D():{}}},p=[k,{id:"axisHover",afterEvent(z,j){var X;if(m.value.show=!1,j.event.type==="mousemove"){const Z=j.event,tt=z.options.indexAxis,q=z.scales,V=z.scales[tt].getLabelForValue(Number(z.scales[tt].getValueForPixel(Z[tt]))),J=z.scales[tt].getLabels().indexOf(V),Tt=(X=t.chartData.isLabelEmpty)==null?void 0:X[J];if((At=>At==="x"?Z.y>q.x.top:Z.x<q.y.right)(tt)){v.locked||(v.showTooltip=!1);const yt=z.canvas.getContext("2d").measureText(V).width,ht=Math.abs(Math.round(Z.x-yt*.5)),$t=Math.round(Z.x+yt*.5);m.value.left=tt==="x"?`${(ht>0?ht:$t)-m.value.offset}px`:`${Z.x-yt*.5-m.value.offset}px`,m.value.top=`${Z.y-50}px`,V.length>Ar?(m.value.show=!0,m.value.text=V):Tt?(m.value.text=e.t("emptyEntityInfo"),m.value.show=!0):m.value.show=!1}else m.value.show=!1}}},{id:d,afterUpdate(z){z.options.layout.padding.right=w.value?H.value:0}},Yf,...t.annotations?[T]:[]],_=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),C=f.ref(0),R=f.ref(0),L=new ResizeObserver(jd(z=>{C.value=z[0].contentRect.width,R.value=z[0].contentRect.height},100)),N=f.computed(()=>{var j,X;const z=(X=(j=t.chartData)==null?void 0:j.labels)==null?void 0:X.length;return a.value&&z&&!w.value?`${Math.max(z*(sk+Vf),C.value)}px`:nk}),B=f.computed(()=>{var j,X;const z=(X=(j=t.chartData)==null?void 0:j.labels)==null?void 0:X.length;return a.value&&z&&w.value?`${Math.max(z*(rk+Vf),R.value)}px`:ik});mt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&Pe.register(Bf),s.value&&(C.value=s.value.offsetWidth,R.value=s.value.offsetHeight,L.observe(s.value))}),f.onUnmounted(()=>{s.value&&L.unobserve(s.value)});const G=f.computed(()=>{const z=mt.useBarChartOptions({tooltipState:v,legendID:c.value,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:w.value?"y":"x",numLabels:_});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:D(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*jf}}}}),U=mt.useChartJSCommon("bar",a,f.toRef(t,"chartData"),p,G),H=f.computed(()=>{S.value;const z=t.chartData.labels,j=t.chartData.datasets,X=z.map((q,V)=>j.reduce((ot,J)=>isNaN(Number(J.data[V]))?ot:ot+Number(J.data[V]),0)),Z=U.value?th(U.value,t.chartData):dw(t.chartData);return X.map(q=>Jd(Pa(q,b.value)+eh(q,Z))).reduce((q,V)=>Math.max(q,V),0)+jf});f.onBeforeUnmount(()=>{Pe.unregister(Bf)});const ct={[It.Right]:"legend-row",[It.Bottom]:"column"},Y=f.computed(()=>{if(l.value&&U.value){const z=window.devicePixelRatio,j=U.value,X=j.scales.y.width*z+ck,Z=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*z,tt=l.value.getContext("2d");return tt.scale(z,z),tt.canvas.width=X,tt.canvas.height=Z,tt.canvas.style.width=`${X/z}px`,tt.canvas.style.height=`${Z/z}px`,{scale:z,width:X*z,height:Z*z,targetCtx:tt}}return null}),et=z=>{const j=z.target;if(Y.value&&U.value&&!w.value){const X=Y.value.scale,Z=Y.value.targetCtx,tt=Y.value.width,q=Y.value.height,V=U.value,ot=V.canvas;Z.fillStyle="white",j.scrollLeft>=ok&&j.scrollLeft<=ak?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,tt,q),Z.drawImage(ot,0,0,tt,q,0,0,tt,q),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,tt,q)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(V.scales.y.height+V.scales.y.top+lk)*X,tt,V.scales.x.height*X))}v.offsetY=j.scrollTop,v.offsetX=j.scrollLeft,m.value.offset=j.scrollLeft},kt=({width:z,height:j})=>{v.width=z,v.height=j};f.watch(()=>t.orientation,()=>{var z;if(l.value&&Y.value){const j=Y.value.width,X=Y.value.height;((z=l.value)==null?void 0:z.getContext("2d")).clearRect(0,0,j,X)}v.showTooltip=!1,v.locked=!1}),f.watch(()=>t.annotations,z=>{U.value&&(z?U.value.options.plugins.annotation.annotations=D(t.chartData):delete U.value.options.plugins.annotation.annotations)});const $=()=>{v.showTooltip&&(v.locked=!v.locked)};return(z,j)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",ct[g.value]])},[f.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),f.createElementVNode("div",{ref_key:"chartContainerRef",ref:s,class:"chart-container","on:scroll":et,onClick:j[0]||(j[0]=X=>$())},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:N.value,height:B.value})},[f.createElementVNode("canvas",{ref_key:"canvas",ref:a,class:"chart-canvas"},null,512)],4)],544),m.value.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:m.value.top,left:m.value.left}),width:"auto"},[f.createElementVNode("div",ek,f.toDisplayString(m.value.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(hl,{context:v.tooltipContext,left:v.left,locked:v.locked,series:v.tooltipSeries,"show-tooltip":v.showTooltip,"tooltip-title":n.tooltipTitle,top:v.top,onDimensions:kt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),f.createVNode(fl,{id:c.value,"chart-instance":f.unref(U),items:h.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-e3a7d88f"]]);/*!
24
24
  * chartjs-adapter-date-fns v3.0.0
25
25
  * https://www.chartjs.org
26
26
  * (c) 2022 chartjs-adapter-date-fns Contributors
27
27
  * Released under the MIT license
28
- */const ik={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"};Nl._date.override({_id:"date-fns",formats:function(){return ik},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=tt(n):e==="string"&&(typeof t=="string"?n=_x(n,t,new Date,this.options):n=wu(n,this.options)),_a(n)?n.getTime():null},format:function(n,t){return pu(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ba(n,t);case"second":return pb(n,t);case"minute":return fb(n,t);case"hour":return ub(n,t);case"day":return Ws(n,t);case"week":return mb(n,t);case"month":return ya(n,t);case"quarter":return gb(n,t);case"year":return yb(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return wa(n,t);case"second":return Sb(n,t);case"minute":return vb(n,t);case"hour":return wb(n,t);case"day":return Jc(n,t);case"week":return Db(n,t);case"month":return iu(n,t);case"quarter":return kb(n,t);case"year":return Tb(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return kx(n);case"minute":return Mx(n);case"hour":return vx(n);case"day":return xa(n);case"week":return Pe(n);case"isoWeek":return Pe(n,{weekStartsOn:+e});case"month":return Pb(n);case"quarter":return Cb(n);case"year":return su(n);default:return n}},endOf:function(n,t){switch(t){case"second":return Ib(n);case"minute":return Ab(n);case"hour":return Eb(n);case"day":return eu(n);case"week":return Rb(n);case"month":return nu(n);case"quarter":return Lb(n);case"year":return Ob(n);default:return n}}});const kh={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},sk={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...kh,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},rk=f.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function ri(n){return f.isProxy(n)?f.toRaw(n):n}function ak(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return f.isProxy(t)?new Proxy(n,{}):n}function ok(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Sh(n,t){n.labels=t}function Dh(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(a=>a[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function lk(n,t){const e={labels:[],datasets:[]};return Sh(e,n.labels),Dh(e,n.datasets,t),e}const ck=f.defineComponent({props:sk,setup(n,t){let{expose:e,slots:i}=t;const s=f.ref(null),r=f.shallowRef(null);e({chart:r});const a=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:g}=n,m=lk(u,g),b=ak(m,u);r.value=new ge(s.value,{type:c,data:b,options:{...d},plugins:h})},o=()=>{const c=f.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return f.onMounted(a),f.onUnmounted(o),f.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,h]=c,[g,m]=u;const b=f.toRaw(r.value);if(!b)return;let _=!1;if(d){const w=ri(d),M=ri(g);w&&w!==M&&(ok(b,w),_=!0)}if(h){const w=ri(h.labels),M=ri(m.labels),S=ri(h.datasets),k=ri(m.datasets);w!==M&&(Sh(b.config.data,w),_=!0),S&&S!==k&&(Dh(b.config.data,S,n.datasetIdKey),_=!0)}_&&f.nextTick(()=>{l(b)})},{deep:!0}),()=>f.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[f.h("p",{},[i.default?i.default():""])])}});function xo(n,t){return ge.register(t),f.defineComponent({props:kh,setup(e,i){let{expose:s}=i;const r=f.shallowRef(null),a=o=>{r.value=o==null?void 0:o.chart};return s({chart:r}),()=>f.h(ck,rk({ref:a},{type:n,...e}))}})}const uk=xo("bar",vi),Th=xo("doughnut",ze),dk=xo("line",Mi),hk={class:"chart-container"},fk=f.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Pt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:He}},setup(n){const t=n,{translateUnit:e}=lt.useTranslatedUnits(),i=f.ref(hn()),s=f.ref(hn()),r=f.ref([]),a=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:"doughnut"}),o={id:i.value,afterUpdate(b){r.value=b.options.plugins.legend.labels.generateLabels(b).map(_=>({..._,value:t.legendValues&&t.legendValues[_.text],hidden:!1}))}},l=f.computed(()=>[o]),c=f.computed(()=>[t.chartData.datasets.reduce((_,w)=>(_.labels.push(w.label),_.backgroundColor.push(w.backgroundColor),_.borderColor.push(Pu(w.backgroundColor,50)),_.data.push(w.data.reduce((M,S)=>M+S,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=f.computed(()=>({...t.chartData,datasets:c.value}));lt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:d}=lt.useDoughnutChartOptions({tooltipState:a,legendID:i.value}),h=f.ref(),g=b=>({[Pt.Right]:"legend-row",[Pt.Bottom]:"column",[Pt.Hidden]:"hidden"})[b],m=({width:b,height:_})=>{a.width=b,a.height=_};return(b,_)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[f.createElementVNode("div",hk,[f.createVNode(f.unref(Th),{ref_key:"chartInstance",ref:h,"chart-id":s.value,data:u.value,options:f.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),f.createVNode(mo,{left:a.left,series:a.tooltipSeries,"show-tooltip":a.showTooltip,"tooltip-title":n.tooltipTitle,top:a.top,unit:n.metricUnit,onDimensions:m},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),f.createVNode(yo,{id:i.value,"chart-instance":h.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),gk=je(fk,[["__scopeId","data-v-5cc0c740"]]),Ch=(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()},ns={id:"linePlugin",afterDatasetsDraw:function(n){if(!this.pause&&n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;Ch(e,t,n.scales.y.top,n.scales.y.bottom)}if(!this.pause&&this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Ch(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},pk=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(200, 200, 200, 0.5)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Ph=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:i,xEnd:s}}))},mk={id:"dragSelectPlugin",isDragging:!1,startX:0,endX:0,beforeInit:function(n){const t=n.canvas,e=t.getBoundingClientRect();let i=!1;const s=o=>{this.dragTimeout=window.setTimeout(()=>{this.isDragging=!0,i=!0,this.startX=o.clientX-e.left},150)},r=o=>{i&&this.isDragging&&(this.endX=o.clientX-e.left,Ph("dragSelectMove",n,this),n.update())},a=o=>{clearTimeout(this.dragTimeout),i&&this.isDragging&&(this.endX=o.clientX-e.left,Ph("dragSelect",n,this),n.update(),this.isDragging=!1,i=!1)};t.addEventListener("mousedown",s),t.addEventListener("mousemove",r),t.addEventListener("mouseup",a),this.dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:a}},beforeDestroy(n){const t=n.canvas;if(this.dragSelectHandlers){const{onMouseDown:e,onMouseMove:i,onMouseUp:s}=this.dragSelectHandlers;t.removeEventListener("mousedown",e),t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",s)}this.isDragging=!1},afterDatasetsDraw:function(n){this.isDragging&&pk(n,this.startX,this.endX)}},yk=je(f.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:"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},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:""},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},zoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{translateUnit:s}=lt.useTranslatedUnits(),r=f.ref(),a=f.ref(hn()),o=f.ref(hn()),l=f.ref([]),c=f.ref(),u=f.ref(f.inject("legendPosition",Pt.Right)),d=f.ref(!1),h=f.reactive({showTooltip:!1,tooltipContext:0,tooltipSeries:[],left:"",top:"",units:f.toRef(e,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,locked:!1,chartTooltipSortFn:e.chartTooltipSortFn}),g={id:a.value,afterUpdate(p){l.value=ku(p,e.legendValues,e.chartLegendSortFn)}},m=f.computed(()=>[g,wh,...e.zoom?[mk]:[],...e.type==="timeseries_line"?[ns]:[]]),b=f.computed(()=>`line-${m.value.map(p=>p.id).join("-")}`),_=f.computed(()=>`bar-${m.value.map(p=>p.id).join("-")}`),{options:w}=lt.useLinechartOptions({tooltipState:h,timeRangeMs:f.toRef(e,"timeRangeMs"),granularity:f.toRef(e,"granularity"),legendID:a.value,stacked:f.toRef(e,"stacked"),metricAxesTitle:f.toRef(e,"metricAxesTitle"),dimensionAxesTitle:f.toRef(e,"dimensionAxesTitle")});lt.useReportChartDataForSynthetics(f.toRef(e,"chartData"),f.toRef(e,"syntheticsDataKey"));const M=p=>Zu(new Date(p),e.granularity,!0),S=p=>({[Pt.Right]:"legend-row",[Pt.Bottom]:"column",[Pt.Hidden]:"hidden"})[p],k=({width:p,height:x})=>{h.width=p,h.height=x},D=()=>{var p,x,T;h.locked=!h.locked,r.value&&((x=(p=r.value.chart.tooltip)==null?void 0:p.dataPoints)!=null&&x.length)&&(ns.clickedSegment=h.locked?(T=r.value.chart.tooltip)==null?void 0:T.dataPoints[0]:void 0)};f.watch(()=>e.type,()=>{h.locked=!1,h.showTooltip=!1,delete ns.clickedSegment});const O=p=>{const{xStart:x,xEnd:T}=p.detail;x&&T&&i("zoom-time-range",{start:new Date(x),end:new Date(T),type:"absolute"}),d.value=!1,D(),ns.pause=!1},P=()=>{d.value=!0,ns.pause=!0};return f.watch(()=>{var p;return(p=r.value)==null?void 0:p.chart},()=>{var p;(p=r.value)!=null&&p.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",O),r.value.chart.canvas.removeEventListener("dragSelectMove",P),r.value.chart.canvas.addEventListener("dragSelect",O),r.value.chart.canvas.addEventListener("dragSelectMove",P))}),f.onUnmounted(()=>{var p;(p=r.value)!=null&&p.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",O),r.value.chart.canvas.removeEventListener("dragSelectMove",P))}),(p,x)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",S(u.value)]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:x[0]||(x[0]=T=>D())},[n.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(dk),{key:b.value,ref_key:"chartInstance",ref:r,"chart-id":o.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:f.unref(w),plugins:m.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(uk),{key:_.value,ref_key:"chartInstance",ref:r,"chart-id":o.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:f.unref(w),plugins:m.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),d.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(mo,{key:0,ref_key:"tooltipElement",ref:c,context:M(h.tooltipContext),"data-testid":"tooltip",left:h.left,locked:h.locked,series:h.tooltipSeries,"show-tooltip":h.showTooltip,"tooltip-title":n.tooltipTitle,top:h.top,unit:n.metricUnit,onDimensions:k,onLeft:x[1]||(x[1]=T=>h.left=T),onTop:x[2]||(x[2]=T=>h.top=T)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"])),f.createVNode(yo,{id:a.value,"chart-instance":r.value,"data-testid":"legend",items:l.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-9b7839b1"]]),bk=["hidden","single","full"];var In=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(In||{});const xk=["doughnut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],_k=["gauge","top_n"];var ur={exports:{}};ur.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,a=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",h="[object Date]",g="[object Error]",m="[object Function]",b="[object GeneratorFunction]",_="[object Map]",w="[object Number]",M="[object Object]",S="[object Promise]",k="[object RegExp]",D="[object Set]",O="[object String]",P="[object Symbol]",p="[object WeakMap]",x="[object ArrayBuffer]",T="[object DataView]",E="[object Float32Array]",A="[object Float64Array]",L="[object Int8Array]",F="[object Int16Array]",U="[object Int32Array]",j="[object Uint8Array]",N="[object Uint8ClampedArray]",st="[object Uint16Array]",B="[object Uint32Array]",Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wt=/^\w*$/,Y=/^\./,I=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,X=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,V={};V[E]=V[A]=V[L]=V[F]=V[U]=V[j]=V[N]=V[st]=V[B]=!0,V[c]=V[u]=V[x]=V[d]=V[T]=V[h]=V[g]=V[m]=V[_]=V[w]=V[M]=V[k]=V[D]=V[O]=V[p]=!1;var H=typeof ie=="object"&&ie&&ie.Object===Object&&ie,it=typeof self=="object"&&self&&self.Object===Object&&self,K=H||it||Function("return this")(),St=t&&!t.nodeType&&t,dt=St&&!0&&n&&!n.nodeType&&n,Nt=dt&&dt.exports===St,yt=Nt&&H.process,ct=function(){try{return yt&&yt.binding("util")}catch{}}(),Ut=ct&&ct.isTypedArray;function se(y,v){for(var R=-1,z=y?y.length:0;++R<z;)if(v(y[R],R,y))return!0;return!1}function ye(y){return function(v){return v==null?void 0:v[y]}}function Me(y,v){for(var R=-1,z=Array(y);++R<y;)z[R]=v(R);return z}function re(y){return function(v){return y(v)}}function vt(y,v){return y==null?void 0:y[v]}function Dt(y){var v=!1;if(y!=null&&typeof y.toString!="function")try{v=!!(y+"")}catch{}return v}function Ve(y){var v=-1,R=Array(y.size);return y.forEach(function(z,et){R[++v]=[et,z]}),R}function mt(y,v){return function(R){return y(v(R))}}function gn(y){var v=-1,R=Array(y.size);return y.forEach(function(z){R[++v]=z}),R}var ke=Array.prototype,$e=Function.prototype,de=Object.prototype,be=K["__core-js_shared__"],Se=function(){var y=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),Zt=$e.toString,ae=de.hasOwnProperty,Bt=de.toString,dr=RegExp("^"+Zt.call(ae).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ai=K.Symbol,Hh=K.Uint8Array,IS=de.propertyIsEnumerable,NS=ke.splice,FS=mt(Object.keys,Object),vo=oi(K,"DataView"),is=oi(K,"Map"),Mo=oi(K,"Promise"),ko=oi(K,"Set"),So=oi(K,"WeakMap"),ss=oi(Object,"create"),zS=Fn(vo),BS=Fn(is),HS=Fn(Mo),WS=Fn(ko),YS=Fn(So),hr=ai?ai.prototype:void 0,Do=hr?hr.valueOf:void 0,Wh=hr?hr.toString:void 0;function Nn(y){var v=-1,R=y?y.length:0;for(this.clear();++v<R;){var z=y[v];this.set(z[0],z[1])}}function jS(){this.__data__=ss?ss(null):{}}function VS(y){return this.has(y)&&delete this.__data__[y]}function $S(y){var v=this.__data__;if(ss){var R=v[y];return R===s?void 0:R}return ae.call(v,y)?v[y]:void 0}function US(y){var v=this.__data__;return ss?v[y]!==void 0:ae.call(v,y)}function qS(y,v){var R=this.__data__;return R[y]=ss&&v===void 0?s:v,this}Nn.prototype.clear=jS,Nn.prototype.delete=VS,Nn.prototype.get=$S,Nn.prototype.has=US,Nn.prototype.set=qS;function Ue(y){var v=-1,R=y?y.length:0;for(this.clear();++v<R;){var z=y[v];this.set(z[0],z[1])}}function XS(){this.__data__=[]}function GS(y){var v=this.__data__,R=gr(v,y);if(R<0)return!1;var z=v.length-1;return R==z?v.pop():NS.call(v,R,1),!0}function KS(y){var v=this.__data__,R=gr(v,y);return R<0?void 0:v[R][1]}function ZS(y){return gr(this.__data__,y)>-1}function QS(y,v){var R=this.__data__,z=gr(R,y);return z<0?R.push([y,v]):R[z][1]=v,this}Ue.prototype.clear=XS,Ue.prototype.delete=GS,Ue.prototype.get=KS,Ue.prototype.has=ZS,Ue.prototype.set=QS;function qe(y){var v=-1,R=y?y.length:0;for(this.clear();++v<R;){var z=y[v];this.set(z[0],z[1])}}function JS(){this.__data__={hash:new Nn,map:new(is||Ue),string:new Nn}}function tD(y){return pr(this,y).delete(y)}function eD(y){return pr(this,y).get(y)}function nD(y){return pr(this,y).has(y)}function iD(y,v){return pr(this,y).set(y,v),this}qe.prototype.clear=JS,qe.prototype.delete=tD,qe.prototype.get=eD,qe.prototype.has=nD,qe.prototype.set=iD;function fr(y){var v=-1,R=y?y.length:0;for(this.__data__=new qe;++v<R;)this.add(y[v])}function sD(y){return this.__data__.set(y,s),this}function rD(y){return this.__data__.has(y)}fr.prototype.add=fr.prototype.push=sD,fr.prototype.has=rD;function Xe(y){this.__data__=new Ue(y)}function aD(){this.__data__=new Ue}function oD(y){return this.__data__.delete(y)}function lD(y){return this.__data__.get(y)}function cD(y){return this.__data__.has(y)}function uD(y,v){var R=this.__data__;if(R instanceof Ue){var z=R.__data__;if(!is||z.length<e-1)return z.push([y,v]),this;R=this.__data__=new qe(z)}return R.set(y,v),this}Xe.prototype.clear=aD,Xe.prototype.delete=oD,Xe.prototype.get=lD,Xe.prototype.has=cD,Xe.prototype.set=uD;function dD(y,v){var R=zn(y)||Gh(y)?Me(y.length,String):[],z=R.length,et=!!z;for(var q in y)ae.call(y,q)&&!(et&&(q=="length"||$h(q,z)))&&R.push(q);return R}function gr(y,v){for(var R=y.length;R--;)if(Xh(y[R][0],v))return R;return-1}var hD=DD();function fD(y,v){return y&&hD(y,v,_r)}function Yh(y,v){v=mr(v,y)?[v]:jh(v);for(var R=0,z=v.length;y!=null&&R<z;)y=y[yr(v[R++])];return R&&R==z?y:void 0}function gD(y){return Bt.call(y)}function pD(y,v){return y!=null&&v in Object(y)}function To(y,v,R,z,et){return y===v?!0:y==null||v==null||!br(y)&&!xr(v)?y!==y&&v!==v:mD(y,v,To,R,z,et)}function mD(y,v,R,z,et,q){var at=zn(y),Ht=zn(v),At=u,qt=u;at||(At=pn(y),At=At==c?M:At),Ht||(qt=pn(v),qt=qt==c?M:qt);var oe=At==M&&!Dt(y),le=qt==M&&!Dt(v),Qt=At==qt;if(Qt&&!oe)return q||(q=new Xe),at||ND(y)?Vh(y,v,R,z,et,q):TD(y,v,At,R,z,et,q);if(!(et&a)){var xe=oe&&ae.call(y,"__wrapped__"),_e=le&&ae.call(v,"__wrapped__");if(xe||_e){var mn=xe?y.value():y,Ge=_e?v.value():v;return q||(q=new Xe),R(mn,Ge,z,et,q)}}return Qt?(q||(q=new Xe),CD(y,v,R,z,et,q)):!1}function yD(y,v,R,z){var et=R.length,q=et;if(y==null)return!q;for(y=Object(y);et--;){var at=R[et];if(at[2]?at[1]!==y[at[0]]:!(at[0]in y))return!1}for(;++et<q;){at=R[et];var Ht=at[0],At=y[Ht],qt=at[1];if(at[2]){if(At===void 0&&!(Ht in y))return!1}else{var oe=new Xe,le;if(!(le===void 0?To(qt,At,z,r|a,oe):le))return!1}}return!0}function bD(y){if(!br(y)||RD(y))return!1;var v=Zh(y)||Dt(y)?dr:X;return v.test(Fn(y))}function xD(y){return xr(y)&&Po(y.length)&&!!V[Bt.call(y)]}function _D(y){return typeof y=="function"?y:y==null?WD:typeof y=="object"?zn(y)?MD(y[0],y[1]):vD(y):YD(y)}function wD(y){if(!AD(y))return FS(y);var v=[];for(var R in Object(y))ae.call(y,R)&&R!="constructor"&&v.push(R);return v}function vD(y){var v=PD(y);return v.length==1&&v[0][2]?qh(v[0][0],v[0][1]):function(R){return R===y||yD(R,y,v)}}function MD(y,v){return mr(y)&&Uh(v)?qh(yr(y),v):function(R){var z=zD(R,y);return z===void 0&&z===v?BD(R,y):To(v,z,void 0,r|a)}}function kD(y){return function(v){return Yh(v,y)}}function SD(y){if(typeof y=="string")return y;if(Oo(y))return Wh?Wh.call(y):"";var v=y+"";return v=="0"&&1/y==-o?"-0":v}function jh(y){return zn(y)?y:LD(y)}function DD(y){return function(v,R,z){for(var et=-1,q=Object(v),at=z(v),Ht=at.length;Ht--;){var At=at[++et];if(R(q[At],At,q)===!1)break}return v}}function Vh(y,v,R,z,et,q){var at=et&a,Ht=y.length,At=v.length;if(Ht!=At&&!(at&&At>Ht))return!1;var qt=q.get(y);if(qt&&q.get(v))return qt==v;var oe=-1,le=!0,Qt=et&r?new fr:void 0;for(q.set(y,v),q.set(v,y);++oe<Ht;){var xe=y[oe],_e=v[oe];if(z)var mn=at?z(_e,xe,oe,v,y,q):z(xe,_e,oe,y,v,q);if(mn!==void 0){if(mn)continue;le=!1;break}if(Qt){if(!se(v,function(Ge,Bn){if(!Qt.has(Bn)&&(xe===Ge||R(xe,Ge,z,et,q)))return Qt.add(Bn)})){le=!1;break}}else if(!(xe===_e||R(xe,_e,z,et,q))){le=!1;break}}return q.delete(y),q.delete(v),le}function TD(y,v,R,z,et,q,at){switch(R){case T:if(y.byteLength!=v.byteLength||y.byteOffset!=v.byteOffset)return!1;y=y.buffer,v=v.buffer;case x:return!(y.byteLength!=v.byteLength||!z(new Hh(y),new Hh(v)));case d:case h:case w:return Xh(+y,+v);case g:return y.name==v.name&&y.message==v.message;case k:case O:return y==v+"";case _:var Ht=Ve;case D:var At=q&a;if(Ht||(Ht=gn),y.size!=v.size&&!At)return!1;var qt=at.get(y);if(qt)return qt==v;q|=r,at.set(y,v);var oe=Vh(Ht(y),Ht(v),z,et,q,at);return at.delete(y),oe;case P:if(Do)return Do.call(y)==Do.call(v)}return!1}function CD(y,v,R,z,et,q){var at=et&a,Ht=_r(y),At=Ht.length,qt=_r(v),oe=qt.length;if(At!=oe&&!at)return!1;for(var le=At;le--;){var Qt=Ht[le];if(!(at?Qt in v:ae.call(v,Qt)))return!1}var xe=q.get(y);if(xe&&q.get(v))return xe==v;var _e=!0;q.set(y,v),q.set(v,y);for(var mn=at;++le<At;){Qt=Ht[le];var Ge=y[Qt],Bn=v[Qt];if(z)var Qh=at?z(Bn,Ge,Qt,v,y,q):z(Ge,Bn,Qt,y,v,q);if(!(Qh===void 0?Ge===Bn||R(Ge,Bn,z,et,q):Qh)){_e=!1;break}mn||(mn=Qt=="constructor")}if(_e&&!mn){var wr=y.constructor,vr=v.constructor;wr!=vr&&"constructor"in y&&"constructor"in v&&!(typeof wr=="function"&&wr instanceof wr&&typeof vr=="function"&&vr instanceof vr)&&(_e=!1)}return q.delete(y),q.delete(v),_e}function pr(y,v){var R=y.__data__;return ED(v)?R[typeof v=="string"?"string":"hash"]:R.map}function PD(y){for(var v=_r(y),R=v.length;R--;){var z=v[R],et=y[z];v[R]=[z,et,Uh(et)]}return v}function oi(y,v){var R=vt(y,v);return bD(R)?R:void 0}var pn=gD;(vo&&pn(new vo(new ArrayBuffer(1)))!=T||is&&pn(new is)!=_||Mo&&pn(Mo.resolve())!=S||ko&&pn(new ko)!=D||So&&pn(new So)!=p)&&(pn=function(y){var v=Bt.call(y),R=v==M?y.constructor:void 0,z=R?Fn(R):void 0;if(z)switch(z){case zS:return T;case BS:return _;case HS:return S;case WS:return D;case YS:return p}return v});function OD(y,v,R){v=mr(v,y)?[v]:jh(v);for(var z,et=-1,at=v.length;++et<at;){var q=yr(v[et]);if(!(z=y!=null&&R(y,q)))break;y=y[q]}if(z)return z;var at=y?y.length:0;return!!at&&Po(at)&&$h(q,at)&&(zn(y)||Gh(y))}function $h(y,v){return v=v??l,!!v&&(typeof y=="number"||G.test(y))&&y>-1&&y%1==0&&y<v}function mr(y,v){if(zn(y))return!1;var R=typeof y;return R=="number"||R=="symbol"||R=="boolean"||y==null||Oo(y)?!0:wt.test(y)||!Rt.test(y)||v!=null&&y in Object(v)}function ED(y){var v=typeof y;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?y!=="__proto__":y===null}function RD(y){return!!Se&&Se in y}function AD(y){var v=y&&y.constructor,R=typeof v=="function"&&v.prototype||de;return y===R}function Uh(y){return y===y&&!br(y)}function qh(y,v){return function(R){return R==null?!1:R[y]===v&&(v!==void 0||y in Object(R))}}var LD=Co(function(y){y=FD(y);var v=[];return Y.test(y)&&v.push(""),y.replace(I,function(R,z,et,q){v.push(et?q.replace($,"$1"):z||R)}),v});function yr(y){if(typeof y=="string"||Oo(y))return y;var v=y+"";return v=="0"&&1/y==-o?"-0":v}function Fn(y){if(y!=null){try{return Zt.call(y)}catch{}try{return y+""}catch{}}return""}function Co(y,v){if(typeof y!="function"||v&&typeof v!="function")throw new TypeError(i);var R=function(){var z=arguments,et=v?v.apply(this,z):z[0],q=R.cache;if(q.has(et))return q.get(et);var at=y.apply(this,z);return R.cache=q.set(et,at),at};return R.cache=new(Co.Cache||qe),R}Co.Cache=qe;function Xh(y,v){return y===v||y!==y&&v!==v}function Gh(y){return ID(y)&&ae.call(y,"callee")&&(!IS.call(y,"callee")||Bt.call(y)==c)}var zn=Array.isArray;function Kh(y){return y!=null&&Po(y.length)&&!Zh(y)}function ID(y){return xr(y)&&Kh(y)}function Zh(y){var v=br(y)?Bt.call(y):"";return v==m||v==b}function Po(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=l}function br(y){var v=typeof y;return!!y&&(v=="object"||v=="function")}function xr(y){return!!y&&typeof y=="object"}function Oo(y){return typeof y=="symbol"||xr(y)&&Bt.call(y)==P}var ND=Ut?re(Ut):xD;function FD(y){return y==null?"":SD(y)}function zD(y,v,R){var z=y==null?void 0:Yh(y,v);return z===void 0?R:z}function BD(y,v){return y!=null&&OD(y,v,pD)}function _r(y){return Kh(y)?dD(y):wD(y)}function HD(y,v){var R={};return v=_D(v),fD(y,function(z,et,q){R[v(z,et,q)]=z}),R}function WD(y){return y}function YD(y){return mr(y)?ye(yr(y)):kD(y)}n.exports=HD}(ur,ur.exports);var wk=ur.exports;const vk=Va(wk);var Mk=1/0,kk=9007199254740991,Sk="[object Arguments]",Dk="[object Function]",Tk="[object GeneratorFunction]",Ck="[object Symbol]",Pk=typeof ie=="object"&&ie&&ie.Object===Object&&ie,Ok=typeof self=="object"&&self&&self.Object===Object&&self,Ek=Pk||Ok||Function("return this")();function Rk(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 Ak(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function Lk(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var _o=Object.prototype,Ik=_o.hasOwnProperty,wo=_o.toString,Oh=Ek.Symbol,Nk=_o.propertyIsEnumerable,Eh=Oh?Oh.isConcatSpreadable:void 0,Rh=Math.max;function Fk(n,t,e,i,s){var r=-1,a=n.length;for(e||(e=Wk),s||(s=[]);++r<a;){var o=n[r];e(o)?Lk(s,o):s[s.length]=o}return s}function zk(n,t){return n=Object(n),Bk(n,t,function(e,i){return i in n})}function Bk(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var a=t[i],o=n[a];e(o,a)&&(r[a]=o)}return r}function Hk(n,t){return t=Rh(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Rh(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=e[i];return a[t]=r,Rk(n,this,a)}}function Wk(n){return Vk(n)||jk(n)||!!(Eh&&n&&n[Eh])}function Yk(n){if(typeof n=="string"||Kk(n))return n;var t=n+"";return t=="0"&&1/n==-Mk?"-0":t}function jk(n){return Uk(n)&&Ik.call(n,"callee")&&(!Nk.call(n,"callee")||wo.call(n)==Sk)}var Vk=Array.isArray;function $k(n){return n!=null&&Xk(n.length)&&!qk(n)}function Uk(n){return Ah(n)&&$k(n)}function qk(n){var t=Gk(n)?wo.call(n):"";return t==Dk||t==Tk}function Xk(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=kk}function Gk(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Ah(n){return!!n&&typeof n=="object"}function Kk(n){return typeof n=="symbol"||Ah(n)&&wo.call(n)==Ck}var Zk=Hk(function(n,t){return n==null?{}:zk(n,Ak(Fk(t),Yk))}),Qk=Zk;const Jk=Va(Qk);var Lh={exports:{}};(function(n,t){(function(e,i){i()})(ie,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 h=new XMLHttpRequest;h.open("GET",c),h.responseType="blob",h.onload=function(){l(h.response,u,d)},h.onerror=function(){console.error("could not download file")},h.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(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 a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ie=="object"&&ie.global===ie?ie:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var h=a.URL||a.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?r(g):s(g.href)?i(c,u,d):r(g,g.target="_blank")):(g.href=h.createObjectURL(c),setTimeout(function(){h.revokeObjectURL(g.href)},4e4),setTimeout(function(){r(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(s(c))i(c,u,d);else{var h=document.createElement("a");h.href=c,h.target="_blank",setTimeout(function(){r(h)})}}:function(c,u,d,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",m=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||g&&m||o)&&typeof FileReader<"u"){var _=new FileReader;_.onloadend=function(){var S=_.result;S=b?S:S.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=S:location=S,h=null},_.readAsDataURL(c)}else{var w=a.URL||a.webkitURL,M=w.createObjectURL(c);h?h.location=M:location.href=M,h=null,setTimeout(function(){w.revokeObjectURL(M)},4e4)}});a.saveAs=l.saveAs=l,n.exports=l})})(Lh);var tS=Lh.exports,Ih={exports:{}};/* @license
28
+ */const dk={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"};nu._date.override({_id:"date-fns",formats:function(){return dk},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=rt(n):e==="string"&&(typeof t=="string"?n=Cx(n,t,new Date,this.options):n=Wd(n,this.options)),ya(n)?n.getTime():null},format:function(n,t){return Id(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return pa(n,t);case"second":return M0(n,t);case"minute":return w0(n,t);case"hour":return b0(n,t);case"day":return Tr(n,t);case"week":return S0(n,t);case"month":return ga(n,t);case"quarter":return v0(n,t);case"year":return k0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return ba(n,t);case"second":return R0(n,t);case"minute":return P0(n,t);case"hour":return O0(n,t);case"day":return _d(n,t);case"week":return L0(n,t);case"month":return Md(n,t);case"quarter":return A0(n,t);case"year":return I0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Ax(n);case"minute":return Ex(n);case"hour":return Px(n);case"day":return ma(n);case"week":return Ue(n);case"isoWeek":return Ue(n,{weekStartsOn:+e});case"month":return F0(n);case"quarter":return N0(n);case"year":return Sd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return j0(n);case"minute":return W0(n);case"hour":return B0(n);case"day":return wd(n);case"week":return H0(n);case"month":return vd(n);case"quarter":return Y0(n);case"year":return z0(n);default:return n}}});const $f={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},hk={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...$f,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},fk=f.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ti(n){return f.isProxy(n)?f.toRaw(n):n}function gk(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return f.isProxy(t)?new Proxy(n,{}):n}function pk(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Uf(n,t){n.labels=t}function qf(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function mk(n,t){const e={labels:[],datasets:[]};return Uf(e,n.labels),qf(e,n.datasets,t),e}const yk=f.defineComponent({props:hk,setup(n,t){let{expose:e,slots:i}=t;const s=f.ref(null),r=f.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:g}=n,m=mk(u,g),b=gk(m,u);r.value=new Pe(s.value,{type:c,data:b,options:{...d},plugins:h})},a=()=>{const c=f.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return f.onMounted(o),f.onUnmounted(a),f.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,h]=c,[g,m]=u;const b=f.toRaw(r.value);if(!b)return;let w=!1;if(d){const v=Ti(d),S=Ti(g);v&&v!==S&&(pk(b,v),w=!0)}if(h){const v=Ti(h.labels),S=Ti(m.labels),D=Ti(h.datasets),k=Ti(m.datasets);v!==S&&(Uf(b.config.data,v),w=!0),D&&D!==k&&(qf(b.config.data,D,n.datasetIdKey),w=!0)}w&&f.nextTick(()=>{l(b)})},{deep:!0}),()=>f.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[f.h("p",{},[i.default?i.default():""])])}});function pl(n,t){return Pe.register(t),f.defineComponent({props:$f,setup(e,i){let{expose:s}=i;const r=f.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>f.h(yk,fk({ref:o},{type:n,...e}))}})}const bk=pl("bar",Ji),Xf=pl("doughnut",sn),_k=pl("line",ts),xk={class:"chart-container"},wk=f.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:It.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on}},setup(n){const t=n,{translateUnit:e}=mt.useTranslatedUnits(),i=f.ref(On()),s=f.ref(On()),r=f.ref([]),o=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:"doughnut"}),a={id:i.value,afterUpdate(b){r.value=b.options.plugins.legend.labels.generateLabels(b).map(w=>({...w,value:t.legendValues&&t.legendValues[w.text],hidden:!1}))}},l=f.computed(()=>[a]),c=f.computed(()=>[t.chartData.datasets.reduce((w,v)=>(w.labels.push(v.label),w.backgroundColor.push(v.backgroundColor),w.borderColor.push(Gd(v.backgroundColor,50)),w.data.push(v.data.reduce((S,D)=>S+D,0)),w),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=f.computed(()=>({...t.chartData,datasets:c.value}));mt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:d}=mt.useDoughnutChartOptions({tooltipState:o,legendID:i.value}),h=f.ref(),g=b=>({[It.Right]:"legend-row",[It.Bottom]:"column",[It.Hidden]:"hidden"})[b],m=({width:b,height:w})=>{o.width=b,o.height=w};return(b,w)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[f.createElementVNode("div",xk,[f.createVNode(f.unref(Xf),{ref_key:"chartInstance",ref:h,"chart-id":s.value,data:u.value,options:f.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),f.createVNode(hl,{left:o.left,series:o.tooltipSeries,"show-tooltip":o.showTooltip,"tooltip-title":n.tooltipTitle,top:o.top,unit:n.metricUnit,onDimensions:m},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),f.createVNode(fl,{id:i.value,"chart-instance":h.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),vk=cn(wk,[["__scopeId","data-v-5cc0c740"]]),Gf=(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()},Rs={id:"linePlugin",afterDatasetsDraw:function(n){if(!this.pause&&n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;Gf(e,t,n.scales.y.top,n.scales.y.bottom)}if(!this.pause&&this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Gf(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},Mk=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(200, 200, 200, 0.5)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Kf=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:i,xEnd:s}}))},Sk={id:"dragSelectPlugin",isDragging:!1,startX:0,endX:0,beforeInit:function(n){const t=n.canvas,e=t.getBoundingClientRect();let i=!1;const s=a=>{this.dragTimeout=window.setTimeout(()=>{this.isDragging=!0,i=!0,this.startX=a.clientX-e.left},150)},r=a=>{i&&this.isDragging&&(this.endX=a.clientX-e.left,Kf("dragSelectMove",n,this),n.update())},o=a=>{clearTimeout(this.dragTimeout),i&&this.isDragging&&(this.endX=a.clientX-e.left,Kf("dragSelect",n,this),n.update(),this.isDragging=!1,i=!1)};t.addEventListener("mousedown",s),t.addEventListener("mousemove",r),t.addEventListener("mouseup",o),this.dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}},beforeDestroy(n){const t=n.canvas;if(this.dragSelectHandlers){const{onMouseDown:e,onMouseMove:i,onMouseUp:s}=this.dragSelectHandlers;t.removeEventListener("mousedown",e),t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",s)}this.isDragging=!1},afterDatasetsDraw:function(n){this.isDragging&&Mk(n,this.startX,this.endX)}},kk=cn(f.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:"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},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:""},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},zoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{translateUnit:s}=mt.useTranslatedUnits(),r=f.ref(),o=f.ref(On()),a=f.ref(On()),l=f.ref([]),c=f.ref(),u=f.ref(f.inject("legendPosition",It.Right)),d=f.ref(!1),h=f.reactive({showTooltip:!1,tooltipContext:0,tooltipSeries:[],left:"",top:"",units:f.toRef(e,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,locked:!1,chartTooltipSortFn:e.chartTooltipSortFn}),g={id:o.value,afterUpdate(p){l.value=Vd(p,e.legendValues,e.chartLegendSortFn)}},m=f.computed(()=>[g,Yf,...e.zoom?[Sk]:[],...e.type==="timeseries_line"?[Rs]:[]]),b=f.computed(()=>`line-${m.value.map(p=>p.id).join("-")}`),w=f.computed(()=>`bar-${m.value.map(p=>p.id).join("-")}`),{options:v}=mt.useLinechartOptions({tooltipState:h,timeRangeMs:f.toRef(e,"timeRangeMs"),granularity:f.toRef(e,"granularity"),legendID:o.value,stacked:f.toRef(e,"stacked"),metricAxesTitle:f.toRef(e,"metricAxesTitle"),dimensionAxesTitle:f.toRef(e,"dimensionAxesTitle")});mt.useReportChartDataForSynthetics(f.toRef(e,"chartData"),f.toRef(e,"syntheticsDataKey"));const S=p=>yh(new Date(p),e.granularity,!0),D=p=>({[It.Right]:"legend-row",[It.Bottom]:"column",[It.Hidden]:"hidden"})[p],k=({width:p,height:_})=>{h.width=p,h.height=_},T=()=>{var p,_,C;h.locked=!h.locked,r.value&&((_=(p=r.value.chart.tooltip)==null?void 0:p.dataPoints)!=null&&_.length)&&(Rs.clickedSegment=h.locked?(C=r.value.chart.tooltip)==null?void 0:C.dataPoints[0]:void 0)};f.watch(()=>e.type,()=>{h.locked=!1,h.showTooltip=!1,delete Rs.clickedSegment});const A=p=>{const{xStart:_,xEnd:C}=p.detail;_&&C&&i("zoom-time-range",{start:new Date(_),end:new Date(C),type:"absolute"}),d.value=!1,T(),Rs.pause=!1},E=()=>{d.value=!0,Rs.pause=!0};return f.watch(()=>{var p;return(p=r.value)==null?void 0:p.chart},()=>{var p;(p=r.value)!=null&&p.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",A),r.value.chart.canvas.removeEventListener("dragSelectMove",E),r.value.chart.canvas.addEventListener("dragSelect",A),r.value.chart.canvas.addEventListener("dragSelectMove",E))}),f.onUnmounted(()=>{var p;(p=r.value)!=null&&p.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",A),r.value.chart.canvas.removeEventListener("dragSelectMove",E))}),(p,_)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",D(u.value)]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:_[0]||(_[0]=C=>T())},[n.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(_k),{key:b.value,ref_key:"chartInstance",ref:r,"chart-id":a.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:f.unref(v),plugins:m.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(bk),{key:w.value,ref_key:"chartInstance",ref:r,"chart-id":a.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:f.unref(v),plugins:m.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),d.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(hl,{key:0,ref_key:"tooltipElement",ref:c,context:S(h.tooltipContext),"data-testid":"tooltip",left:h.left,locked:h.locked,series:h.tooltipSeries,"show-tooltip":h.showTooltip,"tooltip-title":n.tooltipTitle,top:h.top,unit:n.metricUnit,onDimensions:k,onLeft:_[1]||(_[1]=C=>h.left=C),onTop:_[2]||(_[2]=C=>h.top=C)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"])),f.createVNode(fl,{id:o.value,"chart-instance":r.value,"data-testid":"legend",items:l.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-9b7839b1"]]),Dk=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const Tk=["doughnut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],Ck=["gauge","top_n"];var Qr={exports:{}};Qr.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",h="[object Date]",g="[object Error]",m="[object Function]",b="[object GeneratorFunction]",w="[object Map]",v="[object Number]",S="[object Object]",D="[object Promise]",k="[object RegExp]",T="[object Set]",A="[object String]",E="[object Symbol]",p="[object WeakMap]",_="[object ArrayBuffer]",C="[object DataView]",R="[object Float32Array]",L="[object Float64Array]",N="[object Int8Array]",B="[object Int16Array]",G="[object Int32Array]",U="[object Uint8Array]",H="[object Uint8ClampedArray]",ct="[object Uint16Array]",Y="[object Uint32Array]",et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kt=/^\w*$/,$=/^\./,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,X=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,tt=/^(?:0|[1-9]\d*)$/,q={};q[R]=q[L]=q[N]=q[B]=q[G]=q[U]=q[H]=q[ct]=q[Y]=!0,q[c]=q[u]=q[_]=q[d]=q[C]=q[h]=q[g]=q[m]=q[w]=q[v]=q[S]=q[k]=q[T]=q[A]=q[p]=!1;var V=typeof me=="object"&&me&&me.Object===Object&&me,ot=typeof self=="object"&&self&&self.Object===Object&&self,J=V||ot||Function("return this")(),Tt=t&&!t.nodeType&&t,gt=Tt&&!0&&n&&!n.nodeType&&n,At=gt&&gt.exports===Tt,yt=At&&V.process,ht=function(){try{return yt&&yt.binding("util")}catch{}}(),$t=ht&&ht.isTypedArray;function ie(y,M){for(var I=-1,W=y?y.length:0;++I<W;)if(M(y[I],I,y))return!0;return!1}function ye(y){return function(M){return M==null?void 0:M[y]}}function se(y,M){for(var I=-1,W=Array(y);++I<y;)W[I]=M(I);return W}function Kt(y){return function(M){return y(M)}}function Mt(y,M){return y==null?void 0:y[M]}function Dt(y){var M=!1;if(y!=null&&typeof y.toString!="function")try{M=!!(y+"")}catch{}return M}function Zt(y){var M=-1,I=Array(y.size);return y.forEach(function(W,at){I[++M]=[at,W]}),I}function ft(y,M){return function(I){return y(M(I))}}function Ge(y){var M=-1,I=Array(y.size);return y.forEach(function(W){I[++M]=W}),I}var be=Array.prototype,Re=Function.prototype,re=Object.prototype,_e=J["__core-js_shared__"],Te=function(){var y=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),te=Re.toString,oe=re.hasOwnProperty,zt=re.toString,Ci=RegExp("^"+te.call(oe).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),En=J.Symbol,Oi=J.Uint8Array,si=re.propertyIsEnumerable,Ls=be.splice,Is=ft(Object.keys,Object),ri=we(J,"DataView"),ze=we(J,"Map"),Ns=we(J,"Promise"),Fs=we(J,"Set"),zs=we(J,"WeakMap"),oi=we(Object,"create"),bl=Ye(ri),Jr=Ye(ze),to=Ye(Ns),un=Ye(Fs),_l=Ye(zs),Pi=En?En.prototype:void 0,Bs=Pi?Pi.valueOf:void 0,eo=Pi?Pi.toString:void 0;function dn(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function Be(){this.__data__=oi?oi(null):{}}function xl(y){return this.has(y)&&delete this.__data__[y]}function wl(y){var M=this.__data__;if(oi){var I=M[y];return I===s?void 0:I}return oe.call(M,y)?M[y]:void 0}function vl(y){var M=this.__data__;return oi?M[y]!==void 0:oe.call(M,y)}function Ml(y,M){var I=this.__data__;return I[y]=oi&&M===void 0?s:M,this}dn.prototype.clear=Be,dn.prototype.delete=xl,dn.prototype.get=wl,dn.prototype.has=vl,dn.prototype.set=Ml;function He(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function An(){this.__data__=[]}function Sl(y){var M=this.__data__,I=Ai(M,y);if(I<0)return!1;var W=M.length-1;return I==W?M.pop():Ls.call(M,I,1),!0}function kl(y){var M=this.__data__,I=Ai(M,y);return I<0?void 0:M[I][1]}function Dl(y){return Ai(this.__data__,y)>-1}function Tl(y,M){var I=this.__data__,W=Ai(I,y);return W<0?I.push([y,M]):I[W][1]=M,this}He.prototype.clear=An,He.prototype.delete=Sl,He.prototype.get=kl,He.prototype.has=Dl,He.prototype.set=Tl;function We(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function Rn(){this.__data__={hash:new dn,map:new(ze||He),string:new dn}}function Cl(y){return Li(this,y).delete(y)}function Ol(y){return Li(this,y).get(y)}function Pl(y){return Li(this,y).has(y)}function El(y,M){return Li(this,y).set(y,M),this}We.prototype.clear=Rn,We.prototype.delete=Cl,We.prototype.get=Ol,We.prototype.has=Pl,We.prototype.set=El;function Ei(y){var M=-1,I=y?y.length:0;for(this.__data__=new We;++M<I;)this.add(y[M])}function Al(y){return this.__data__.set(y,s),this}function no(y){return this.__data__.has(y)}Ei.prototype.add=Ei.prototype.push=Al,Ei.prototype.has=no;function xe(y){this.__data__=new He(y)}function Rl(){this.__data__=new He}function Hs(y){return this.__data__.delete(y)}function Ll(y){return this.__data__.get(y)}function Il(y){return this.__data__.has(y)}function Nl(y,M){var I=this.__data__;if(I instanceof He){var W=I.__data__;if(!ze||W.length<e-1)return W.push([y,M]),this;I=this.__data__=new We(W)}return I.set(y,M),this}xe.prototype.clear=Rl,xe.prototype.delete=Hs,xe.prototype.get=Ll,xe.prototype.has=Il,xe.prototype.set=Nl;function Fl(y,M){var I=O(y)||x(y)?se(y.length,String):[],W=I.length,at=!!W;for(var Q in y)oe.call(y,Q)&&!(at&&(Q=="length"||uo(Q,W)))&&I.push(Q);return I}function Ai(y,M){for(var I=y.length;I--;)if(go(y[I][0],M))return I;return-1}var zl=Ul();function Ws(y,M){return y&&zl(y,M,Fn)}function io(y,M){M=In(M,y)?[M]:oo(M);for(var I=0,W=M.length;y!=null&&I<W;)y=y[Ni(M[I++])];return I&&I==W?y:void 0}function Bl(y){return zt.call(y)}function Hl(y,M){return y!=null&&M in Object(y)}function Ys(y,M,I,W,at){return y===M?!0:y==null||M==null||!ve(y)&&!Ut(M)?y!==y&&M!==M:Wl(y,M,Ys,I,W,at)}function Wl(y,M,I,W,at,Q){var dt=O(y),qt=O(M),Bt=u,ae=u;dt||(Bt=Ke(y),Bt=Bt==c?S:Bt),qt||(ae=Ke(M),ae=ae==c?S:ae);var Me=Bt==S&&!Dt(y),Se=ae==S&&!Dt(M),de=Bt==ae;if(de&&!Me)return Q||(Q=new xe),dt||Nn(y)?ao(y,M,I,W,at,Q):ql(y,M,Bt,I,W,at,Q);if(!(at&o)){var Le=Me&&oe.call(y,"__wrapped__"),Ie=Se&&oe.call(M,"__wrapped__");if(Le||Ie){var zn=Le?y.value():y,fn=Ie?M.value():M;return Q||(Q=new xe),I(zn,fn,W,at,Q)}}return de?(Q||(Q=new xe),Xl(y,M,I,W,at,Q)):!1}function Yl(y,M,I,W){var at=I.length,Q=at;if(y==null)return!Q;for(y=Object(y);at--;){var dt=I[at];if(dt[2]?dt[1]!==y[dt[0]]:!(dt[0]in y))return!1}for(;++at<Q;){dt=I[at];var qt=dt[0],Bt=y[qt],ae=dt[1];if(dt[2]){if(Bt===void 0&&!(qt in y))return!1}else{var Me=new xe,Se;if(!(Se===void 0?Ys(ae,Bt,W,r|o,Me):Se))return!1}}return!0}function jl(y){if(!ve(y)||Gl(y))return!1;var M=Vt(y)||Dt(y)?Ci:Z;return M.test(Ye(y))}function so(y){return Ut(y)&&Qt(y.length)&&!!q[zt.call(y)]}function Vl(y){return typeof y=="function"?y:y==null?jD:typeof y=="object"?O(y)?Ln(y[0],y[1]):Ri(y):VD(y)}function $l(y){if(!Kl(y))return Is(y);var M=[];for(var I in Object(y))oe.call(y,I)&&I!="constructor"&&M.push(I);return M}function Ri(y){var M=lo(y);return M.length==1&&M[0][2]?fo(M[0][0],M[0][1]):function(I){return I===y||Yl(I,y,M)}}function Ln(y,M){return In(y)&&js(M)?fo(Ni(y),M):function(I){var W=mo(I,y);return W===void 0&&W===M?yo(I,y):Ys(M,W,void 0,r|o)}}function ro(y){return function(M){return io(M,y)}}function hn(y){if(typeof y=="string")return y;if(Fi(y))return eo?eo.call(y):"";var M=y+"";return M=="0"&&1/y==-a?"-0":M}function oo(y){return O(y)?y:Ii(y)}function Ul(y){return function(M,I,W){for(var at=-1,Q=Object(M),dt=W(M),qt=dt.length;qt--;){var Bt=dt[++at];if(I(Q[Bt],Bt,Q)===!1)break}return M}}function ao(y,M,I,W,at,Q){var dt=at&o,qt=y.length,Bt=M.length;if(qt!=Bt&&!(dt&&Bt>qt))return!1;var ae=Q.get(y);if(ae&&Q.get(M))return ae==M;var Me=-1,Se=!0,de=at&r?new Ei:void 0;for(Q.set(y,M),Q.set(M,y);++Me<qt;){var Le=y[Me],Ie=M[Me];if(W)var zn=dt?W(Ie,Le,Me,M,y,Q):W(Le,Ie,Me,y,M,Q);if(zn!==void 0){if(zn)continue;Se=!1;break}if(de){if(!ie(M,function(fn,ai){if(!de.has(ai)&&(Le===fn||I(Le,fn,W,at,Q)))return de.add(ai)})){Se=!1;break}}else if(!(Le===Ie||I(Le,Ie,W,at,Q))){Se=!1;break}}return Q.delete(y),Q.delete(M),Se}function ql(y,M,I,W,at,Q,dt){switch(I){case C:if(y.byteLength!=M.byteLength||y.byteOffset!=M.byteOffset)return!1;y=y.buffer,M=M.buffer;case _:return!(y.byteLength!=M.byteLength||!W(new Oi(y),new Oi(M)));case d:case h:case v:return go(+y,+M);case g:return y.name==M.name&&y.message==M.message;case k:case A:return y==M+"";case w:var qt=Zt;case T:var Bt=Q&o;if(qt||(qt=Ge),y.size!=M.size&&!Bt)return!1;var ae=dt.get(y);if(ae)return ae==M;Q|=r,dt.set(y,M);var Me=ao(qt(y),qt(M),W,at,Q,dt);return dt.delete(y),Me;case E:if(Bs)return Bs.call(y)==Bs.call(M)}return!1}function Xl(y,M,I,W,at,Q){var dt=at&o,qt=Fn(y),Bt=qt.length,ae=Fn(M),Me=ae.length;if(Bt!=Me&&!dt)return!1;for(var Se=Bt;Se--;){var de=qt[Se];if(!(dt?de in M:oe.call(M,de)))return!1}var Le=Q.get(y);if(Le&&Q.get(M))return Le==M;var Ie=!0;Q.set(y,M),Q.set(M,y);for(var zn=dt;++Se<Bt;){de=qt[Se];var fn=y[de],ai=M[de];if(W)var ag=dt?W(ai,fn,de,M,y,Q):W(fn,ai,de,y,M,Q);if(!(ag===void 0?fn===ai||I(fn,ai,W,at,Q):ag)){Ie=!1;break}zn||(zn=de=="constructor")}if(Ie&&!zn){var bo=y.constructor,_o=M.constructor;bo!=_o&&"constructor"in y&&"constructor"in M&&!(typeof bo=="function"&&bo instanceof bo&&typeof _o=="function"&&_o instanceof _o)&&(Ie=!1)}return Q.delete(y),Q.delete(M),Ie}function Li(y,M){var I=y.__data__;return ho(M)?I[typeof M=="string"?"string":"hash"]:I.map}function lo(y){for(var M=Fn(y),I=M.length;I--;){var W=M[I],at=y[W];M[I]=[W,at,js(at)]}return M}function we(y,M){var I=Mt(y,M);return jl(I)?I:void 0}var Ke=Bl;(ri&&Ke(new ri(new ArrayBuffer(1)))!=C||ze&&Ke(new ze)!=w||Ns&&Ke(Ns.resolve())!=D||Fs&&Ke(new Fs)!=T||zs&&Ke(new zs)!=p)&&(Ke=function(y){var M=zt.call(y),I=M==S?y.constructor:void 0,W=I?Ye(I):void 0;if(W)switch(W){case bl:return C;case Jr:return w;case to:return D;case un:return T;case _l:return p}return M});function co(y,M,I){M=In(M,y)?[M]:oo(M);for(var W,at=-1,dt=M.length;++at<dt;){var Q=Ni(M[at]);if(!(W=y!=null&&I(y,Q)))break;y=y[Q]}if(W)return W;var dt=y?y.length:0;return!!dt&&Qt(dt)&&uo(Q,dt)&&(O(y)||x(y))}function uo(y,M){return M=M??l,!!M&&(typeof y=="number"||tt.test(y))&&y>-1&&y%1==0&&y<M}function In(y,M){if(O(y))return!1;var I=typeof y;return I=="number"||I=="symbol"||I=="boolean"||y==null||Fi(y)?!0:kt.test(y)||!et.test(y)||M!=null&&y in Object(M)}function ho(y){var M=typeof y;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?y!=="__proto__":y===null}function Gl(y){return!!Te&&Te in y}function Kl(y){var M=y&&y.constructor,I=typeof M=="function"&&M.prototype||re;return y===I}function js(y){return y===y&&!ve(y)}function fo(y,M){return function(I){return I==null?!1:I[y]===M&&(M!==void 0||y in Object(I))}}var Ii=Vs(function(y){y=po(y);var M=[];return $.test(y)&&M.push(""),y.replace(z,function(I,W,at,Q){M.push(at?Q.replace(X,"$1"):W||I)}),M});function Ni(y){if(typeof y=="string"||Fi(y))return y;var M=y+"";return M=="0"&&1/y==-a?"-0":M}function Ye(y){if(y!=null){try{return te.call(y)}catch{}try{return y+""}catch{}}return""}function Vs(y,M){if(typeof y!="function"||M&&typeof M!="function")throw new TypeError(i);var I=function(){var W=arguments,at=M?M.apply(this,W):W[0],Q=I.cache;if(Q.has(at))return Q.get(at);var dt=y.apply(this,W);return I.cache=Q.set(at,dt),dt};return I.cache=new(Vs.Cache||We),I}Vs.Cache=We;function go(y,M){return y===M||y!==y&&M!==M}function x(y){return K(y)&&oe.call(y,"callee")&&(!si.call(y,"callee")||zt.call(y)==c)}var O=Array.isArray;function F(y){return y!=null&&Qt(y.length)&&!Vt(y)}function K(y){return Ut(y)&&F(y)}function Vt(y){var M=ve(y)?zt.call(y):"";return M==m||M==b}function Qt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=l}function ve(y){var M=typeof y;return!!y&&(M=="object"||M=="function")}function Ut(y){return!!y&&typeof y=="object"}function Fi(y){return typeof y=="symbol"||Ut(y)&&zt.call(y)==E}var Nn=$t?Kt($t):so;function po(y){return y==null?"":hn(y)}function mo(y,M,I){var W=y==null?void 0:io(y,M);return W===void 0?I:W}function yo(y,M){return y!=null&&co(y,M,Hl)}function Fn(y){return F(y)?Fl(y):$l(y)}function zi(y,M){var I={};return M=Vl(M),Ws(y,function(W,at,Q){I[M(W,at,Q)]=W}),I}function jD(y){return y}function VD(y){return In(y)?ye(Ni(y)):ro(y)}n.exports=zi}(Qr,Qr.exports);var Ok=Qr.exports;const Pk=Wa(Ok);var Ek=1/0,Ak=9007199254740991,Rk="[object Arguments]",Lk="[object Function]",Ik="[object GeneratorFunction]",Nk="[object Symbol]",Fk=typeof me=="object"&&me&&me.Object===Object&&me,zk=typeof self=="object"&&self&&self.Object===Object&&self,Bk=Fk||zk||Function("return this")();function Hk(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 Wk(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function Yk(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var ml=Object.prototype,jk=ml.hasOwnProperty,yl=ml.toString,Zf=Bk.Symbol,Vk=ml.propertyIsEnumerable,Qf=Zf?Zf.isConcatSpreadable:void 0,Jf=Math.max;function $k(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=Gk),s||(s=[]);++r<o;){var a=n[r];e(a)?Yk(s,a):s[s.length]=a}return s}function Uk(n,t){return n=Object(n),qk(n,t,function(e,i){return i in n})}function qk(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function Xk(n,t){return t=Jf(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Jf(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,Hk(n,this,o)}}function Gk(n){return Qk(n)||Zk(n)||!!(Qf&&n&&n[Qf])}function Kk(n){if(typeof n=="string"||sD(n))return n;var t=n+"";return t=="0"&&1/n==-Ek?"-0":t}function Zk(n){return tD(n)&&jk.call(n,"callee")&&(!Vk.call(n,"callee")||yl.call(n)==Rk)}var Qk=Array.isArray;function Jk(n){return n!=null&&nD(n.length)&&!eD(n)}function tD(n){return tg(n)&&Jk(n)}function eD(n){var t=iD(n)?yl.call(n):"";return t==Lk||t==Ik}function nD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Ak}function iD(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function tg(n){return!!n&&typeof n=="object"}function sD(n){return typeof n=="symbol"||tg(n)&&yl.call(n)==Nk}var rD=Xk(function(n,t){return n==null?{}:Uk(n,Wk($k(t),Kk))}),oD=rD;const aD=Wa(oD);var eg={exports:{}};(function(n,t){(function(e,i){i()})(me,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 h=new XMLHttpRequest;h.open("GET",c),h.responseType="blob",h.onload=function(){l(h.response,u,d)},h.onerror=function(){console.error("could not download file")},h.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(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 o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof me=="object"&&me.global===me?me:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,d){var h=o.URL||o.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?r(g):s(g.href)?i(c,u,d):r(g,g.target="_blank")):(g.href=h.createObjectURL(c),setTimeout(function(){h.revokeObjectURL(g.href)},4e4),setTimeout(function(){r(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(s(c))i(c,u,d);else{var h=document.createElement("a");h.href=c,h.target="_blank",setTimeout(function(){r(h)})}}:function(c,u,d,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",m=/constructor/i.test(o.HTMLElement)||o.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||g&&m||a)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var D=w.result;D=b?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=D:location=D,h=null},w.readAsDataURL(c)}else{var v=o.URL||o.webkitURL,S=v.createObjectURL(c);h?h.location=S:location.href=S,h=null,setTimeout(function(){v.revokeObjectURL(S)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(eg);var lD=eg.exports,ng={exports:{}};/* @license
29
29
  Papa Parse
30
30
  v5.4.1
31
31
  https://github.com/mholt/PapaParse
32
32
  License: MIT
33
- */(function(n,t){(function(e,i){n.exports=i()})(ie,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,a={},o=0,l={parse:function(p,x){var T=(x=x||{}).dynamicTyping||!1;if(P(T)&&(x.dynamicTypingFunction=T,T={}),x.dynamicTyping=T,x.transform=!!P(x.transform)&&x.transform,x.worker&&l.WORKERS_SUPPORTED){var E=function(){if(!l.WORKERS_SUPPORTED)return!1;var L=(U=i.URL||i.webkitURL||null,j=e.toString(),l.BLOB_URL||(l.BLOB_URL=U.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; ","(",j,")();"],{type:"text/javascript"})))),F=new i.Worker(L),U,j;return F.onmessage=M,F.id=o++,a[F.id]=F}();return E.userStep=x.step,E.userChunk=x.chunk,E.userComplete=x.complete,E.userError=x.error,x.step=P(x.step),x.chunk=P(x.chunk),x.complete=P(x.complete),x.error=P(x.error),delete x.worker,void E.postMessage({input:p,config:x,workerId:E.id})}var A=null;return l.NODE_STREAM_INPUT,typeof p=="string"?(p=function(L){return L.charCodeAt(0)===65279?L.slice(1):L}(p),A=x.download?new d(x):new g(x)):p.readable===!0&&P(p.read)&&P(p.on)?A=new m(x):(i.File&&p instanceof File||p instanceof Object)&&(A=new h(x)),A.stream(p)},unparse:function(p,x){var T=!1,E=!0,A=",",L=`\r
34
- `,F='"',U=F+F,j=!1,N=null,st=!1;(function(){if(typeof x=="object"){if(typeof x.delimiter!="string"||l.BAD_DELIMITERS.filter(function(Y){return x.delimiter.indexOf(Y)!==-1}).length||(A=x.delimiter),(typeof x.quotes=="boolean"||typeof x.quotes=="function"||Array.isArray(x.quotes))&&(T=x.quotes),typeof x.skipEmptyLines!="boolean"&&typeof x.skipEmptyLines!="string"||(j=x.skipEmptyLines),typeof x.newline=="string"&&(L=x.newline),typeof x.quoteChar=="string"&&(F=x.quoteChar),typeof x.header=="boolean"&&(E=x.header),Array.isArray(x.columns)){if(x.columns.length===0)throw new Error("Option columns is empty");N=x.columns}x.escapeChar!==void 0&&(U=x.escapeChar+F),(typeof x.escapeFormulae=="boolean"||x.escapeFormulae instanceof RegExp)&&(st=x.escapeFormulae instanceof RegExp?x.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var B=new RegExp(_(F),"g");if(typeof p=="string"&&(p=JSON.parse(p)),Array.isArray(p)){if(!p.length||Array.isArray(p[0]))return Rt(null,p,j);if(typeof p[0]=="object")return Rt(N||Object.keys(p[0]),p,j)}else if(typeof p=="object")return typeof p.data=="string"&&(p.data=JSON.parse(p.data)),Array.isArray(p.data)&&(p.fields||(p.fields=p.meta&&p.meta.fields||N),p.fields||(p.fields=Array.isArray(p.data[0])?p.fields:typeof p.data[0]=="object"?Object.keys(p.data[0]):[]),Array.isArray(p.data[0])||typeof p.data[0]=="object"||(p.data=[p.data])),Rt(p.fields||[],p.data||[],j);throw new Error("Unable to serialize unrecognized input");function Rt(Y,I,W){var $="";typeof Y=="string"&&(Y=JSON.parse(Y)),typeof I=="string"&&(I=JSON.parse(I));var X=Array.isArray(Y)&&0<Y.length,G=!Array.isArray(I[0]);if(X&&E){for(var V=0;V<Y.length;V++)0<V&&($+=A),$+=wt(Y[V],V);0<I.length&&($+=L)}for(var H=0;H<I.length;H++){var it=X?Y.length:I[H].length,K=!1,St=X?Object.keys(I[H]).length===0:I[H].length===0;if(W&&!X&&(K=W==="greedy"?I[H].join("").trim()==="":I[H].length===1&&I[H][0].length===0),W==="greedy"&&X){for(var dt=[],Nt=0;Nt<it;Nt++){var yt=G?Y[Nt]:Nt;dt.push(I[H][yt])}K=dt.join("").trim()===""}if(!K){for(var ct=0;ct<it;ct++){0<ct&&!St&&($+=A);var Ut=X&&G?Y[ct]:ct;$+=wt(I[H][Ut],ct)}H<I.length-1&&(!W||0<it&&!St)&&($+=L)}}return $}function wt(Y,I){if(Y==null)return"";if(Y.constructor===Date)return JSON.stringify(Y).slice(1,25);var W=!1;st&&typeof Y=="string"&&st.test(Y)&&(Y="'"+Y,W=!0);var $=Y.toString().replace(B,U);return(W=W||T===!0||typeof T=="function"&&T(Y,I)||Array.isArray(T)&&T[I]||function(X,G){for(var V=0;V<G.length;V++)if(-1<X.indexOf(G[V]))return!0;return!1}($,l.BAD_DELIMITERS)||-1<$.indexOf(A)||$.charAt(0)===" "||$.charAt($.length-1)===" ")?F+$+F:$}}};if(l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
35
- `,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!s&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=w,l.ParserHandle=b,l.NetworkStreamer=d,l.FileStreamer=h,l.StringStreamer=g,l.ReadableStreamStreamer=m,i.jQuery){var c=i.jQuery;c.fn.parse=function(p){var x=p.config||{},T=[];return this.each(function(L){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 F=0;F<this.files.length;F++)T.push({file:this.files[F],inputElem:this,instanceConfig:c.extend({},x)})}),E(),this;function E(){if(T.length!==0){var L,F,U,j,N=T[0];if(P(p.before)){var st=p.before(N.file,N.inputElem);if(typeof st=="object"){if(st.action==="abort")return L="AbortError",F=N.file,U=N.inputElem,j=st.reason,void(P(p.error)&&p.error({name:L},F,U,j));if(st.action==="skip")return void A();typeof st.config=="object"&&(N.instanceConfig=c.extend(N.instanceConfig,st.config))}else if(st==="skip")return void A()}var B=N.instanceConfig.complete;N.instanceConfig.complete=function(Rt){P(B)&&B(Rt,N.file,N.inputElem),A()},l.parse(N.file,N.instanceConfig)}else P(p.complete)&&p.complete()}function A(){T.splice(0,1),E()}}}function u(p){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(x){var T=D(x);T.chunkSize=parseInt(T.chunkSize),x.step||x.chunk||(T.chunkSize=null),this._handle=new b(T),(this._handle.streamer=this)._config=T}).call(this,p),this.parseChunk=function(x,T){if(this.isFirstChunk&&P(this._config.beforeFirstChunk)){var E=this._config.beforeFirstChunk(x);E!==void 0&&(x=E)}this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+x;this._partialLine="";var L=this._handle.parse(A,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var F=L.meta.cursor;this._finished||(this._partialLine=A.substring(F-this._baseIndex),this._baseIndex=F),L&&L.data&&(this._rowCount+=L.data.length);var U=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)i.postMessage({results:L,workerId:l.WORKER_ID,finished:U});else if(P(this._config.chunk)&&!T){if(this._config.chunk(L,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);L=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(L.data),this._completeResults.errors=this._completeResults.errors.concat(L.errors),this._completeResults.meta=L.meta),this._completed||!U||!P(this._config.complete)||L&&L.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),U||L&&L.meta.paused||this._nextChunk(),L}this._halted=!0},this._sendError=function(x){P(this._config.error)?this._config.error(x):r&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:x,finished:!1})}}function d(p){var x;(p=p||{}).chunkSize||(p.chunkSize=l.RemoteChunkSize),u.call(this,p),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(T){this._input=T,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(x=new XMLHttpRequest,this._config.withCredentials&&(x.withCredentials=this._config.withCredentials),s||(x.onload=O(this._chunkLoaded,this),x.onerror=O(this._chunkError,this)),x.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var T=this._config.downloadRequestHeaders;for(var E in T)x.setRequestHeader(E,T[E])}if(this._config.chunkSize){var A=this._start+this._config.chunkSize-1;x.setRequestHeader("Range","bytes="+this._start+"-"+A)}try{x.send(this._config.downloadRequestBody)}catch(L){this._chunkError(L.message)}s&&x.status===0&&this._chunkError()}},this._chunkLoaded=function(){x.readyState===4&&(x.status<200||400<=x.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:x.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(T){var E=T.getResponseHeader("Content-Range");return E===null?-1:parseInt(E.substring(E.lastIndexOf("/")+1))}(x),this.parseChunk(x.responseText)))},this._chunkError=function(T){var E=x.statusText||T;this._sendError(new Error(E))}}function h(p){var x,T;(p=p||{}).chunkSize||(p.chunkSize=l.LocalChunkSize),u.call(this,p);var E=typeof FileReader<"u";this.stream=function(A){this._input=A,T=A.slice||A.webkitSlice||A.mozSlice,E?((x=new FileReader).onload=O(this._chunkLoaded,this),x.onerror=O(this._chunkError,this)):x=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 L=Math.min(this._start+this._config.chunkSize,this._input.size);A=T.call(A,this._start,L)}var F=x.readAsText(A,this._config.encoding);E||this._chunkLoaded({target:{result:F}})},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(x.error)}}function g(p){var x;u.call(this,p=p||{}),this.stream=function(T){return x=T,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var T,E=this._config.chunkSize;return E?(T=x.substring(0,E),x=x.substring(E)):(T=x,x=""),this._finished=!x,this.parseChunk(T)}}}function m(p){u.call(this,p=p||{});var x=[],T=!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&&x.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),x.length?this.parseChunk(x.shift()):T=!0},this._streamData=O(function(A){try{x.push(typeof A=="string"?A:A.toString(this._config.encoding)),T&&(T=!1,this._checkIsFinished(),this.parseChunk(x.shift()))}catch(L){this._streamError(L)}},this),this._streamError=O(function(A){this._streamCleanUp(),this._sendError(A)},this),this._streamEnd=O(function(){this._streamCleanUp(),E=!0,this._streamData("")},this),this._streamCleanUp=O(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function b(p){var x,T,E,A=Math.pow(2,53),L=-A,F=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,U=/^((\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)))$/,j=this,N=0,st=0,B=!1,Rt=!1,wt=[],Y={data:[],errors:[],meta:{}};if(P(p.step)){var I=p.step;p.step=function(H){if(Y=H,X())$();else{if($(),Y.data.length===0)return;N+=H.data.length,p.preview&&N>p.preview?T.abort():(Y.data=Y.data[0],I(Y,j))}}}function W(H){return p.skipEmptyLines==="greedy"?H.join("").trim()==="":H.length===1&&H[0].length===0}function $(){return Y&&E&&(V("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),E=!1),p.skipEmptyLines&&(Y.data=Y.data.filter(function(H){return!W(H)})),X()&&function(){if(!Y)return;function H(K,St){P(p.transformHeader)&&(K=p.transformHeader(K,St)),wt.push(K)}if(Array.isArray(Y.data[0])){for(var it=0;X()&&it<Y.data.length;it++)Y.data[it].forEach(H);Y.data.splice(0,1)}else Y.data.forEach(H)}(),function(){if(!Y||!p.header&&!p.dynamicTyping&&!p.transform)return Y;function H(K,St){var dt,Nt=p.header?{}:[];for(dt=0;dt<K.length;dt++){var yt=dt,ct=K[dt];p.header&&(yt=dt>=wt.length?"__parsed_extra":wt[dt]),p.transform&&(ct=p.transform(ct,yt)),ct=G(yt,ct),yt==="__parsed_extra"?(Nt[yt]=Nt[yt]||[],Nt[yt].push(ct)):Nt[yt]=ct}return p.header&&(dt>wt.length?V("FieldMismatch","TooManyFields","Too many fields: expected "+wt.length+" fields but parsed "+dt,st+St):dt<wt.length&&V("FieldMismatch","TooFewFields","Too few fields: expected "+wt.length+" fields but parsed "+dt,st+St)),Nt}var it=1;return!Y.data.length||Array.isArray(Y.data[0])?(Y.data=Y.data.map(H),it=Y.data.length):Y.data=H(Y.data,0),p.header&&Y.meta&&(Y.meta.fields=wt),st+=it,Y}()}function X(){return p.header&&wt.length===0}function G(H,it){return K=H,p.dynamicTypingFunction&&p.dynamicTyping[K]===void 0&&(p.dynamicTyping[K]=p.dynamicTypingFunction(K)),(p.dynamicTyping[K]||p.dynamicTyping)===!0?it==="true"||it==="TRUE"||it!=="false"&&it!=="FALSE"&&(function(St){if(F.test(St)){var dt=parseFloat(St);if(L<dt&&dt<A)return!0}return!1}(it)?parseFloat(it):U.test(it)?new Date(it):it===""?null:it):it;var K}function V(H,it,K,St){var dt={type:H,code:it,message:K};St!==void 0&&(dt.row=St),Y.errors.push(dt)}this.parse=function(H,it,K){var St=p.quoteChar||'"';if(p.newline||(p.newline=function(yt,ct){yt=yt.substring(0,1048576);var Ut=new RegExp(_(ct)+"([^]*?)"+_(ct),"gm"),se=(yt=yt.replace(Ut,"")).split("\r"),ye=yt.split(`
36
- `),Me=1<ye.length&&ye[0].length<se[0].length;if(se.length===1||Me)return`
37
- `;for(var re=0,vt=0;vt<se.length;vt++)se[vt][0]===`
38
- `&&re++;return re>=se.length/2?`\r
39
- `:"\r"}(H,St)),E=!1,p.delimiter)P(p.delimiter)&&(p.delimiter=p.delimiter(H),Y.meta.delimiter=p.delimiter);else{var dt=function(yt,ct,Ut,se,ye){var Me,re,vt,Dt;ye=ye||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Ve=0;Ve<ye.length;Ve++){var mt=ye[Ve],gn=0,ke=0,$e=0;vt=void 0;for(var de=new w({comments:se,delimiter:mt,newline:ct,preview:10}).parse(yt),be=0;be<de.data.length;be++)if(Ut&&W(de.data[be]))$e++;else{var Se=de.data[be].length;ke+=Se,vt!==void 0?0<Se&&(gn+=Math.abs(Se-vt),vt=Se):vt=Se}0<de.data.length&&(ke/=de.data.length-$e),(re===void 0||gn<=re)&&(Dt===void 0||Dt<ke)&&1.99<ke&&(re=gn,Me=mt,Dt=ke)}return{successful:!!(p.delimiter=Me),bestDelimiter:Me}}(H,p.newline,p.skipEmptyLines,p.comments,p.delimitersToGuess);dt.successful?p.delimiter=dt.bestDelimiter:(E=!0,p.delimiter=l.DefaultDelimiter),Y.meta.delimiter=p.delimiter}var Nt=D(p);return p.preview&&p.header&&Nt.preview++,x=H,T=new w(Nt),Y=T.parse(x,it,K),$(),B?{meta:{paused:!0}}:Y||{meta:{paused:!1}}},this.paused=function(){return B},this.pause=function(){B=!0,T.abort(),x=P(p.chunk)?"":x.substring(T.getCharIndex())},this.resume=function(){j.streamer._halted?(B=!1,j.streamer.parseChunk(x,!0)):setTimeout(j.resume,3)},this.aborted=function(){return Rt},this.abort=function(){Rt=!0,T.abort(),Y.meta.aborted=!0,P(p.complete)&&p.complete(Y),x=""}}function _(p){return p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(p){var x,T=(p=p||{}).delimiter,E=p.newline,A=p.comments,L=p.step,F=p.preview,U=p.fastMode,j=x=p.quoteChar===void 0||p.quoteChar===null?'"':p.quoteChar;if(p.escapeChar!==void 0&&(j=p.escapeChar),(typeof T!="string"||-1<l.BAD_DELIMITERS.indexOf(T))&&(T=","),A===T)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<l.BAD_DELIMITERS.indexOf(A))&&(A=!1),E!==`
40
- `&&E!=="\r"&&E!==`\r
41
- `&&(E=`
42
- `);var N=0,st=!1;this.parse=function(B,Rt,wt){if(typeof B!="string")throw new Error("Input must be a string");var Y=B.length,I=T.length,W=E.length,$=A.length,X=P(L),G=[],V=[],H=[],it=N=0;if(!B)return Zt();if(p.header&&!Rt){var K=B.split(E)[0].split(T),St=[],dt={},Nt=!1;for(var yt in K){var ct=K[yt];P(p.transformHeader)&&(ct=p.transformHeader(ct,yt));var Ut=ct,se=dt[ct]||0;for(0<se&&(Nt=!0,Ut=ct+"_"+se),dt[ct]=se+1;St.includes(Ut);)Ut=Ut+"_"+se;St.push(Ut)}if(Nt){var ye=B.split(E);ye[0]=St.join(T),B=ye.join(E)}}if(U||U!==!1&&B.indexOf(x)===-1){for(var Me=B.split(E),re=0;re<Me.length;re++){if(H=Me[re],N+=H.length,re!==Me.length-1)N+=E.length;else if(wt)return Zt();if(!A||H.substring(0,$)!==A){if(X){if(G=[],$e(H.split(T)),ae(),st)return Zt()}else $e(H.split(T));if(F&&F<=re)return G=G.slice(0,F),Zt(!0)}}return Zt()}for(var vt=B.indexOf(T,N),Dt=B.indexOf(E,N),Ve=new RegExp(_(j)+_(x),"g"),mt=B.indexOf(x,N);;)if(B[N]!==x)if(A&&H.length===0&&B.substring(N,N+$)===A){if(Dt===-1)return Zt();N=Dt+W,Dt=B.indexOf(E,N),vt=B.indexOf(T,N)}else if(vt!==-1&&(vt<Dt||Dt===-1))H.push(B.substring(N,vt)),N=vt+I,vt=B.indexOf(T,N);else{if(Dt===-1)break;if(H.push(B.substring(N,Dt)),Se(Dt+W),X&&(ae(),st))return Zt();if(F&&G.length>=F)return Zt(!0)}else for(mt=N,N++;;){if((mt=B.indexOf(x,mt+1))===-1)return wt||V.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:G.length,index:N}),be();if(mt===Y-1)return be(B.substring(N,mt).replace(Ve,x));if(x!==j||B[mt+1]!==j){if(x===j||mt===0||B[mt-1]!==j){vt!==-1&&vt<mt+1&&(vt=B.indexOf(T,mt+1)),Dt!==-1&&Dt<mt+1&&(Dt=B.indexOf(E,mt+1));var gn=de(Dt===-1?vt:Math.min(vt,Dt));if(B.substr(mt+1+gn,I)===T){H.push(B.substring(N,mt).replace(Ve,x)),B[N=mt+1+gn+I]!==x&&(mt=B.indexOf(x,N)),vt=B.indexOf(T,N),Dt=B.indexOf(E,N);break}var ke=de(Dt);if(B.substring(mt+1+ke,mt+1+ke+W)===E){if(H.push(B.substring(N,mt).replace(Ve,x)),Se(mt+1+ke+W),vt=B.indexOf(T,N),mt=B.indexOf(x,N),X&&(ae(),st))return Zt();if(F&&G.length>=F)return Zt(!0);break}V.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:G.length,index:N}),mt++}}else mt++}return be();function $e(Bt){G.push(Bt),it=N}function de(Bt){var dr=0;if(Bt!==-1){var ai=B.substring(mt+1,Bt);ai&&ai.trim()===""&&(dr=ai.length)}return dr}function be(Bt){return wt||(Bt===void 0&&(Bt=B.substring(N)),H.push(Bt),N=Y,$e(H),X&&ae()),Zt()}function Se(Bt){N=Bt,$e(H),H=[],Dt=B.indexOf(E,N)}function Zt(Bt){return{data:G,errors:V,meta:{delimiter:T,linebreak:E,aborted:st,truncated:!!Bt,cursor:it+(Rt||0)}}}function ae(){L(Zt()),G=[],V=[]}},this.abort=function(){st=!0},this.getCharIndex=function(){return N}}function M(p){var x=p.data,T=a[x.workerId],E=!1;if(x.error)T.userError(x.error,x.file);else if(x.results&&x.results.data){var A={abort:function(){E=!0,S(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(P(T.userStep)){for(var L=0;L<x.results.data.length&&(T.userStep({data:x.results.data[L],errors:x.results.errors,meta:x.results.meta},A),!E);L++);delete x.results}else P(T.userChunk)&&(T.userChunk(x.results,A,x.file),delete x.results)}x.finished&&!E&&S(x.workerId,x.results)}function S(p,x){var T=a[p];P(T.userComplete)&&T.userComplete(x),T.terminate(),delete a[p]}function k(){throw new Error("Not implemented.")}function D(p){if(typeof p!="object"||p===null)return p;var x=Array.isArray(p)?[]:{};for(var T in p)x[T]=D(p[T]);return x}function O(p,x){return function(){p.apply(x,arguments)}}function P(p){return typeof p=="function"}return r&&(i.onmessage=function(p){var x=p.data;if(l.WORKER_ID===void 0&&x&&(l.WORKER_ID=x.workerId),typeof x.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(x.input,x.config),finished:!0});else if(i.File&&x.input instanceof File||x.input instanceof Object){var T=l.parse(x.input,x.config);T&&i.postMessage({workerId:l.WORKER_ID,results:T,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(h.prototype=Object.create(u.prototype)).constructor=h,(g.prototype=Object.create(g.prototype)).constructor=g,(m.prototype=Object.create(u.prototype)).constructor=m,l})})(Ih);var eS=Ih.exports;const nS=["id"],iS=f.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,s=f.computed(()=>`export_${new Date().getTime()}`),r=f.computed(()=>{const u=l();return u.length?u:null}),a=()=>{const u=i.labels;if(typeof i.fields!==In.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===In.Object?d=>vk(d,(h,g)=>u[g]||g):d=>d},o=()=>{const u=i.fields;if(typeof i.fields!==In.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>Jk(d,u):d=>d},l=()=>{if(typeof i.fields===In.Undefined&&typeof i.labels===In.Undefined)return i.data;const u=a(),d=o();return i.data.map(h=>u(d(h)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=eS.unparse(r.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
43
- `+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});tS.saveAs(d,i.filename)}};return(u,d)=>(f.openBlock(),f.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[f.renderSlot(u.$slots,"default",{},()=>[f.createTextVNode("Download "+f.toDisplayString(n.filename),1)])],8,nS))}}),sS=f.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=f.computed(()=>Object.keys(t.headers));return(i,s)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(iS,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),rS={class:"kong-ui-public-csv-export-modal"},aS={key:0,class:"selected-range"},oS={key:1,class:"text-muted",tag:"span"},Nh=3,Fh=f.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=lt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=f.ref(!0),o=f.computed(()=>{var b,_;return!!((_=(b=i.chartData)==null?void 0:b.data)!=null&&_.length)}),l=f.ref(1),c=f.computed(()=>g.value.rows.length),u=lt.useChartSelectedRange(f.toRef(i,"chartData")),d=f.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(Nh,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),h=()=>{s("toggleModal",!1)},g=f.computed(()=>{var D,O,P;if(!o.value||!((D=i.chartData)!=null&&D.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const b=i.chartData.data.some(p=>p.timestamp!==i.chartData.data[0].timestamp),_=i.chartData.data.map(p=>{const x=new Date(p.timestamp);return{...Object.keys(p.event).reduce((E,A)=>{if(A in i.chartData.meta.display){const L=p.event[A],F=i.chartData.meta.display[A];E[A]=L&&F&&F[L].name||p.event[A]}else E[A]=p.event[A];return E},{}),...b?{timestamp:ja(x,"yyyy-MM-dd HH:mm:ss"),tzOffset:ja(x,"XXX")}:{}}});let w=[];b&&(w=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.chartData.meta&&((O=i.chartData.meta)!=null&&O.display)?(P=i.chartData.meta)==null?void 0:P.display:{},S=[...w,...Object.keys(M).map(p=>({label:e.t(`chartLabels.${p}`),key:p})),...i.chartData.meta.metric_names.map(p=>({label:e.t(`chartLabels.${p}`),key:p}))],k=S.reduce((p,x)=>(p[x.key]=x.label,p),{});return{headers:S,csvHeaders:k,rows:_}}),m=async()=>{const{rows:b}=g.value;return a.value=!1,{total:Number(b.length)||0,data:b.slice(0,Nh)}};return f.watch(g,()=>{l.value++}),(b,_)=>{const w=f.resolveComponent("KEmptyState"),M=f.resolveComponent("KTableData"),S=f.resolveComponent("KButton"),k=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",rS,[f.createVNode(k,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:f.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:f.withKeys(h,["esc"])},{default:f.withCtx(()=>{var D;return[f.createElementVNode("div",null,[o.value?(f.openBlock(),f.createElementBlock("div",aS,[f.createElementVNode("p",null,f.toDisplayString(b.modalDescription?b.modalDescription:f.unref(e).t("csvExport.exportDescription")),1),f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.exportTimeRange"))+": "+f.toDisplayString(f.unref(u)),1)])):f.createCommentVNode("",!0),f.createVNode(M,{class:"vitals-table",fetcher:m,"fetcher-cache-key":String(l.value),headers:((D=g.value)==null?void 0:D.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(w,{"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRange")),1)]),default:f.withCtx(()=>[f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!a.value&&o.value?(f.openBlock(),f.createElementBlock("div",oS,f.toDisplayString(d.value),1)):f.createCommentVNode("",!0)])]}),"footer-actions":f.withCtx(()=>[f.createVNode(S,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(sS,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(S,{appearance:"primary","data-testid":"csv-download-button",disabled:a.value||!o.value},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),zh=f.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=lt.useI18n(),i=f.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),s=f.ref(!1),r=o=>{s.value=o},a=()=>{r(!0)};return(o,l)=>{const c=f.resolveComponent("KButton");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:f.withModifiers(a,["prevent"])},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.text||f.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),s.value?(f.openBlock(),f.createBlock(Fh,{key:0,"chart-data":n.data,filename:i.value,onToggleModal:r},null,8,["chart-data","filename"])):f.createCommentVNode("",!0)],64)}}}),lS={class:"analytics-chart-shell"},cS={key:0,class:"chart-header"},uS=["title"],dS={key:1,class:"chart-header-icons-wrapper"},hS={key:2,class:"chart-export-button"},fS={key:2,class:"analytics-chart-parent"},gS=f.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:""},legendPosition:{type:String,required:!1,default:Pt.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0},threshold:{type:Object,required:!1,default:void 0},timeseriesZoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=lt.useI18n(),{evaluateFeatureFlag:r}=lt.useEvaluateFeatureFlag(),a=r("ma-3043-analytics-chart-kebab-menu",!1),o=f.toRef(e,"chartData"),l=f.computed(()=>w.value?lt.useExploreResultToTimeDataset({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Xs,threshold:e.chartOptions.threshold||void 0},f.toRef(e,"chartData")).value:lt.useExploreResultToDatasets({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Xs},f.toRef(e,"chartData")).value),c=f.computed(()=>{var L;return(L=e.chartData)!=null&&L.meta?"start_ms"in e.chartData.meta?e.chartData.meta.end_ms-e.chartData.meta.start_ms:void 0:0}),u=f.computed(()=>{var L;return(L=e.chartData.meta)!=null&&L.metric_units?Object.values(e.chartData.meta.metric_units)[0]:""}),d=f.computed(()=>e.showLegendValues&&e.legendPosition!==Pt.Bottom),{legendValues:h}=lt.useChartLegendValues(l,e.chartOptions.type,u),g=f.computed(()=>{var L,F,U;return((U=(F=(L=e.chartData)==null?void 0:L.meta)==null?void 0:F.limit)==null?void 0:U.toString())||null}),m=f.computed(()=>{var L,F;return((F=(L=e.chartData)==null?void 0:L.meta)==null?void 0:F.truncated)||!1}),b=s.t("limitedResultsShown",{maxReturned:g.value}),_=f.computed(()=>["vertical_bar","horizontal_bar"].includes(e.chartOptions.type)),w=f.computed(()=>["timeseries_bar","timeseries_line"].some(L=>L===e.chartOptions.type)),M=f.computed(()=>e.chartOptions.type==="doughnut"),S=f.computed(()=>e.chartOptions.type.includes("vertical")?"vertical":"horizontal"),k=f.computed(()=>{var U,j,N;if(!((U=e.chartData)!=null&&U.meta.metric_names)||!((j=e.chartData)!=null&&j.meta.metric_units))return;const L=e.chartData.meta.metric_names[0],F=e.chartData.meta.metric_units[L];if(e.chartData.meta.metric_names.length>1){if(L.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(L.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return((N=e.chartOptions)==null?void 0:N.metricAxesTitle)||s.te(`metricAxisTitles.${L}`)&&s.te(`chartUnits.${F}`)&&s.t(`metricAxisTitles.${L}`,{unit:s.t(`chartUnits.${F}`,{plural:"s"})})||void 0}),D=f.computed(()=>{const L=w.value?"Time":Object.keys(e.chartData.meta.display||e.chartData.meta.metric_names)[0];return e.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${L}`)&&s.t(`chartLabels.${L}`)||void 0}),O=f.computed(()=>{const L=Ja(Number(e.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${L}`)}),P=f.computed(()=>e.emptyStateTitle||s.t("noDataAvailableTitle")),p=f.computed(()=>e.emptyStateDescription||s.t("noDataAvailableDescription")),x=f.computed(()=>w.value?$x(l.value):e.chartData&&e.chartData.meta&&e.chartData.data.length),T=f.computed(()=>e.chartData.meta.granularity_ms?Ja(e.chartData.meta.granularity_ms)||"hourly":Ja(new Date(e.chartData.data[1].timestamp).getTime()-new Date(e.chartData.data[0].timestamp).getTime())||"hourly"),E=f.computed(()=>e.chartOptions.chartLegendSortFn?e.chartOptions.chartLegendSortFn:(L,F)=>L.text===s.t("chartLabels.____OTHER____")?1:F.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.text,10))&&!isNaN(parseInt(F.text,10))?L.text<F.text?-1:1:L.value&&F.value?F.value.raw-L.value.raw:0),A=f.computed(()=>e.chartOptions.chartTooltipSortFn?e.chartOptions.chartTooltipSortFn:(L,F)=>L.label===s.t("chartLabels.____OTHER____")?1:F.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.label,10))&&!isNaN(parseInt(F.label,10))?L.label<F.label?-1:1:L.value&&F.value?F.rawValue-L.rawValue:0);return f.provide("showLegendValues",d),f.provide("legendPosition",f.toRef(e,"legendPosition")),(L,F)=>{const U=f.resolveComponent("KTooltip"),j=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",lS,[x.value&&m.value&&g.value||!f.unref(a)&&(n.allowCsvExport||e.chartTitle)?(f.openBlock(),f.createElementBlock("div",cS,[n.chartTitle?(f.openBlock(),f.createElementBlock("div",{key:0,class:"chart-title",title:n.chartTitle},f.toDisplayString(n.chartTitle),9,uS)):f.createCommentVNode("",!0),x.value&&m.value&&g.value?(f.openBlock(),f.createElementBlock("div",dS,[f.createVNode(U,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(b)),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(Eo.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(G1)})`,decorative:"",size:f.unref(K1)},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),!f.unref(a)&&n.allowCsvExport&&x.value?(f.openBlock(),f.createElementBlock("div",hS,[f.createVNode(zh,{data:o.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),x.value?(f.openBlock(),f.createElementBlock("div",fS,[w.value?(f.openBlock(),f.createBlock(yk,{key:0,"chart-data":l.value,"chart-legend-sort-fn":E.value,"chart-tooltip-sort-fn":A.value,"dimension-axes-title":O.value,fill:n.chartOptions.stacked,granularity:T.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.threshold,"time-range-ms":c.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,zoom:n.timeseriesZoom,onZoomTimeRange:F[0]||(F[0]=N=>i("zoom-time-range",N))},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-title","type","zoom"])):_.value?(f.openBlock(),f.createBlock(nk,{key:1,annotations:n.showAnnotations,"chart-data":l.value,"chart-legend-sort-fn":E.value,"chart-tooltip-sort-fn":A.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,orientation:S.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?(f.openBlock(),f.createBlock(gk,{key:2,"chart-data":l.value,"dataset-colors":n.chartOptions.chartDatasetColors||f.unref(Xs),"legend-position":n.legendPosition,"legend-values":f.unref(h),"metric-unit":u.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(j,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(P.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.value),1)]),_:1}))])}}}),pS=je(gS,[["__scopeId","data-v-19cd92bf"]]),mS={class:"chart-parent","data-testid":"doughnut-chart-parent"},yS={class:"chart-totals-flex"},bS={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},xS=je(f.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:He},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}=lt.useI18n(),i=f.ref(hn()),s=f.computed(()=>[t.chartData.datasets.reduce((m,b)=>(m.labels.push(b.label),m.borderColor.push(b.backgroundColor),m.backgroundColor.push(b.backgroundColor),m.data.push(b.data.reduce((_,w)=>_+w,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=f.computed(()=>({...t.chartData,datasets:s.value}));lt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=f.ref(),l=f.computed(()=>{var g;return Vi((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=f.computed(()=>{var g,m;return Vi(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((m=s==null?void 0:s.value[0])==null?void 0:m.data[1]),{capital:!0})}),u=f.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=f.computed(()=>["full","single"].includes(t.metricDisplay)),h=f.computed(()=>t.metricDisplay==="full");return(g,m)=>(f.openBlock(),f.createElementBlock("div",mS,[f.createElementVNode("div",yS,[d.value?(f.openBlock(),f.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:f.normalizeStyle(u.value)},f.toDisplayString(l.value),5)):f.createCommentVNode("",!0),h.value?(f.openBlock(),f.createElementBlock("div",bS,f.toDisplayString(f.unref(e).t("total"))+": "+f.toDisplayString(c.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:"chart-container",style:f.normalizeStyle({height:n.height,width:n.width})},[f.createVNode(f.unref(Th),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:r.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-6596329c"]]),_S={class:"simple-chart-shell"},wS={key:1,class:"analytics-chart-parent"},vS=je(f.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}=lt.useI18n(),i=f.computed(()=>{var c;const l=lt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||He},f.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),s=f.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=f.computed(()=>t.chartOptions.type==="gauge"),a=f.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=f.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",_S,[o.value?(f.openBlock(),f.createElementBlock("div",wS,[r.value?(f.openBlock(),f.createBlock(xS,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.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"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(u,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-9d13f2fd"]]),MS={class:"top-n-card-title","data-testid":"top-n-card-title"},kS={class:"top-n-card-description","data-testid":"top-n-card-description"},SS={key:3,class:"top-n-table","data-testid":"top-n-table"},DS={class:"table-headings"},TS={class:"table-row"},CS={class:"column-1"},PS={class:"column-2"},OS={class:"table-body","data-testid":"top-n-data"},ES=["data-testid"],RS={class:"column-1"},AS={class:"column-2"},LS=je(f.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},titleTag:{type:String,default:"h2"}},setup(n){const t=n,{i18n:e}=lt.useI18n(),i=f.computed(()=>t.data.data),s=f.computed(()=>{var m;return!!((m=i.value)!=null&&m.length)}),r=f.computed(()=>{var m,b;return(m=t.data.meta)!=null&&m.display&&((b=Object.keys(t.data.meta.display))==null?void 0:b[0])||""}),a=f.computed(()=>r.value?t.data.meta.display[r.value]:{}),o=f.computed(()=>{var m,b;return(b=(m=t.data.meta)==null?void 0:m.metric_names)!=null&&b.length?t.data.meta.metric_names[0]:""}),l=f.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value&&!Object.keys(a.value).length)return e.t("topNTable.errors.display");if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=m=>{const b=m.event;return String(b[r.value])},d=m=>{const b=u(m),_=a.value&&a.value[b];return _?_.name:"-"},h=m=>{const b=u(m),_=a.value&&a.value[b];return _?!!_.deleted:!1},g=m=>{if(!o.value)return"–";const _=m.event[o.value];return _?Vi(_,{capital:!0,round:!0}):"–"};return(m,b)=>{const _=f.resolveComponent("KEmptyState"),w=f.resolveComponent("KSkeleton"),M=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},f.createSlots({default:f.withCtx(()=>[c.value?(f.openBlock(),f.createBlock(_,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.value),1)]),_:1})):n.isLoading?(f.openBlock(),f.createBlock(w,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",SS,[f.createElementVNode("div",DS,[f.createElementVNode("div",TS,[f.createElementVNode("div",CS,f.toDisplayString(f.unref(e).t("topNTable.nameLabel")),1),f.createElementVNode("div",PS,f.toDisplayString(l.value),1)])]),f.createElementVNode("div",OS,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,(S,k)=>(f.openBlock(),f.createElementBlock("div",{key:`entry-${k}`,class:"table-row","data-testid":`row-${u(S)}`},[f.createElementVNode("div",RS,[f.renderSlot(m.$slots,"name",{record:{id:u(S),name:d(S),deleted:h(S),dimension:r.value}},()=>[f.createTextVNode(f.toDisplayString(d(S)),1)],!0)]),f.createElementVNode("div",AS,"   "+f.toDisplayString(g(S)),1)],8,ES))),128))])])):(f.openBlock(),f.createBlock(_,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.emptyStateTitle||f.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",MS,f.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",kS,f.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-27a707ed"]]);Z.AnalyticsChart=pS,Z.ChartLegendPosition=Pt,Z.CsvExportButton=zh,Z.CsvExportModal=Fh,Z.DECIMAL_DISPLAY=Su,Z.EMPTY_COLOR=Ru,Z.FONT_SIZE_REGULAR=Tu,Z.FONT_SIZE_SMALL=Du,Z.MAX_LABEL_LENGTH=Us,Z.OTHERS_COLOR=Zx,Z.SimpleChart=vS,Z.TopNTable=LS,Z.ValidType=In,Z.accessibleGrey=Ou,Z.apiRequestStatusCodeColors=Eu,Z.chartTypes=xk,Z.codesInSpec=Nu,Z.darkenColor=Pu,Z.datavisPalette=He,Z.defaultStatusCodeColors=Xs,Z.determineBaseColor=Ea,Z.errorRateColors=Gx,Z.latencyColors=Kx,Z.lightGrey=La,Z.lookupColor=Qx,Z.lookupDatavisColor=qs,Z.lookupStatusCodeCategoryColor=r_,Z.lookupStatusCodeColor=Ia,Z.numberFormatter=$s,Z.simpleChartMetricDisplay=bk,Z.simpleChartTypes=_k,Z.statusCodeBadgeBackgroundColor=qx,Z.trafficColors=Xx,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
33
+ */(function(n,t){(function(e,i){n.exports=i()})(me,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,o={},a=0,l={parse:function(p,_){var C=(_=_||{}).dynamicTyping||!1;if(E(C)&&(_.dynamicTypingFunction=C,C={}),_.dynamicTyping=C,_.transform=!!E(_.transform)&&_.transform,_.worker&&l.WORKERS_SUPPORTED){var R=function(){if(!l.WORKERS_SUPPORTED)return!1;var N=(G=i.URL||i.webkitURL||null,U=e.toString(),l.BLOB_URL||(l.BLOB_URL=G.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; ","(",U,")();"],{type:"text/javascript"})))),B=new i.Worker(N),G,U;return B.onmessage=S,B.id=a++,o[B.id]=B}();return R.userStep=_.step,R.userChunk=_.chunk,R.userComplete=_.complete,R.userError=_.error,_.step=E(_.step),_.chunk=E(_.chunk),_.complete=E(_.complete),_.error=E(_.error),delete _.worker,void R.postMessage({input:p,config:_,workerId:R.id})}var L=null;return l.NODE_STREAM_INPUT,typeof p=="string"?(p=function(N){return N.charCodeAt(0)===65279?N.slice(1):N}(p),L=_.download?new d(_):new g(_)):p.readable===!0&&E(p.read)&&E(p.on)?L=new m(_):(i.File&&p instanceof File||p instanceof Object)&&(L=new h(_)),L.stream(p)},unparse:function(p,_){var C=!1,R=!0,L=",",N=`\r
34
+ `,B='"',G=B+B,U=!1,H=null,ct=!1;(function(){if(typeof _=="object"){if(typeof _.delimiter!="string"||l.BAD_DELIMITERS.filter(function($){return _.delimiter.indexOf($)!==-1}).length||(L=_.delimiter),(typeof _.quotes=="boolean"||typeof _.quotes=="function"||Array.isArray(_.quotes))&&(C=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(U=_.skipEmptyLines),typeof _.newline=="string"&&(N=_.newline),typeof _.quoteChar=="string"&&(B=_.quoteChar),typeof _.header=="boolean"&&(R=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");H=_.columns}_.escapeChar!==void 0&&(G=_.escapeChar+B),(typeof _.escapeFormulae=="boolean"||_.escapeFormulae instanceof RegExp)&&(ct=_.escapeFormulae instanceof RegExp?_.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var Y=new RegExp(w(B),"g");if(typeof p=="string"&&(p=JSON.parse(p)),Array.isArray(p)){if(!p.length||Array.isArray(p[0]))return et(null,p,U);if(typeof p[0]=="object")return et(H||Object.keys(p[0]),p,U)}else if(typeof p=="object")return typeof p.data=="string"&&(p.data=JSON.parse(p.data)),Array.isArray(p.data)&&(p.fields||(p.fields=p.meta&&p.meta.fields||H),p.fields||(p.fields=Array.isArray(p.data[0])?p.fields:typeof p.data[0]=="object"?Object.keys(p.data[0]):[]),Array.isArray(p.data[0])||typeof p.data[0]=="object"||(p.data=[p.data])),et(p.fields||[],p.data||[],U);throw new Error("Unable to serialize unrecognized input");function et($,z,j){var X="";typeof $=="string"&&($=JSON.parse($)),typeof z=="string"&&(z=JSON.parse(z));var Z=Array.isArray($)&&0<$.length,tt=!Array.isArray(z[0]);if(Z&&R){for(var q=0;q<$.length;q++)0<q&&(X+=L),X+=kt($[q],q);0<z.length&&(X+=N)}for(var V=0;V<z.length;V++){var ot=Z?$.length:z[V].length,J=!1,Tt=Z?Object.keys(z[V]).length===0:z[V].length===0;if(j&&!Z&&(J=j==="greedy"?z[V].join("").trim()==="":z[V].length===1&&z[V][0].length===0),j==="greedy"&&Z){for(var gt=[],At=0;At<ot;At++){var yt=tt?$[At]:At;gt.push(z[V][yt])}J=gt.join("").trim()===""}if(!J){for(var ht=0;ht<ot;ht++){0<ht&&!Tt&&(X+=L);var $t=Z&&tt?$[ht]:ht;X+=kt(z[V][$t],ht)}V<z.length-1&&(!j||0<ot&&!Tt)&&(X+=N)}}return X}function kt($,z){if($==null)return"";if($.constructor===Date)return JSON.stringify($).slice(1,25);var j=!1;ct&&typeof $=="string"&&ct.test($)&&($="'"+$,j=!0);var X=$.toString().replace(Y,G);return(j=j||C===!0||typeof C=="function"&&C($,z)||Array.isArray(C)&&C[z]||function(Z,tt){for(var q=0;q<tt.length;q++)if(-1<Z.indexOf(tt[q]))return!0;return!1}(X,l.BAD_DELIMITERS)||-1<X.indexOf(L)||X.charAt(0)===" "||X.charAt(X.length-1)===" ")?B+X+B:X}}};if(l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
35
+ `,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!s&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=v,l.ParserHandle=b,l.NetworkStreamer=d,l.FileStreamer=h,l.StringStreamer=g,l.ReadableStreamStreamer=m,i.jQuery){var c=i.jQuery;c.fn.parse=function(p){var _=p.config||{},C=[];return this.each(function(N){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 B=0;B<this.files.length;B++)C.push({file:this.files[B],inputElem:this,instanceConfig:c.extend({},_)})}),R(),this;function R(){if(C.length!==0){var N,B,G,U,H=C[0];if(E(p.before)){var ct=p.before(H.file,H.inputElem);if(typeof ct=="object"){if(ct.action==="abort")return N="AbortError",B=H.file,G=H.inputElem,U=ct.reason,void(E(p.error)&&p.error({name:N},B,G,U));if(ct.action==="skip")return void L();typeof ct.config=="object"&&(H.instanceConfig=c.extend(H.instanceConfig,ct.config))}else if(ct==="skip")return void L()}var Y=H.instanceConfig.complete;H.instanceConfig.complete=function(et){E(Y)&&Y(et,H.file,H.inputElem),L()},l.parse(H.file,H.instanceConfig)}else E(p.complete)&&p.complete()}function L(){C.splice(0,1),R()}}}function u(p){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(_){var C=T(_);C.chunkSize=parseInt(C.chunkSize),_.step||_.chunk||(C.chunkSize=null),this._handle=new b(C),(this._handle.streamer=this)._config=C}).call(this,p),this.parseChunk=function(_,C){if(this.isFirstChunk&&E(this._config.beforeFirstChunk)){var R=this._config.beforeFirstChunk(_);R!==void 0&&(_=R)}this.isFirstChunk=!1,this._halted=!1;var L=this._partialLine+_;this._partialLine="";var N=this._handle.parse(L,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var B=N.meta.cursor;this._finished||(this._partialLine=L.substring(B-this._baseIndex),this._baseIndex=B),N&&N.data&&(this._rowCount+=N.data.length);var G=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)i.postMessage({results:N,workerId:l.WORKER_ID,finished:G});else if(E(this._config.chunk)&&!C){if(this._config.chunk(N,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);N=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(N.data),this._completeResults.errors=this._completeResults.errors.concat(N.errors),this._completeResults.meta=N.meta),this._completed||!G||!E(this._config.complete)||N&&N.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),G||N&&N.meta.paused||this._nextChunk(),N}this._halted=!0},this._sendError=function(_){E(this._config.error)?this._config.error(_):r&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:_,finished:!1})}}function d(p){var _;(p=p||{}).chunkSize||(p.chunkSize=l.RemoteChunkSize),u.call(this,p),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(C){this._input=C,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),s||(_.onload=A(this._chunkLoaded,this),_.onerror=A(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var C=this._config.downloadRequestHeaders;for(var R in C)_.setRequestHeader(R,C[R])}if(this._config.chunkSize){var L=this._start+this._config.chunkSize-1;_.setRequestHeader("Range","bytes="+this._start+"-"+L)}try{_.send(this._config.downloadRequestBody)}catch(N){this._chunkError(N.message)}s&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:_.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(C){var R=C.getResponseHeader("Content-Range");return R===null?-1:parseInt(R.substring(R.lastIndexOf("/")+1))}(_),this.parseChunk(_.responseText)))},this._chunkError=function(C){var R=_.statusText||C;this._sendError(new Error(R))}}function h(p){var _,C;(p=p||{}).chunkSize||(p.chunkSize=l.LocalChunkSize),u.call(this,p);var R=typeof FileReader<"u";this.stream=function(L){this._input=L,C=L.slice||L.webkitSlice||L.mozSlice,R?((_=new FileReader).onload=A(this._chunkLoaded,this),_.onerror=A(this._chunkError,this)):_=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var L=this._input;if(this._config.chunkSize){var N=Math.min(this._start+this._config.chunkSize,this._input.size);L=C.call(L,this._start,N)}var B=_.readAsText(L,this._config.encoding);R||this._chunkLoaded({target:{result:B}})},this._chunkLoaded=function(L){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(L.target.result)},this._chunkError=function(){this._sendError(_.error)}}function g(p){var _;u.call(this,p=p||{}),this.stream=function(C){return _=C,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var C,R=this._config.chunkSize;return R?(C=_.substring(0,R),_=_.substring(R)):(C=_,_=""),this._finished=!_,this.parseChunk(C)}}}function m(p){u.call(this,p=p||{});var _=[],C=!0,R=!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(L){this._input=L,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){R&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):C=!0},this._streamData=A(function(L){try{_.push(typeof L=="string"?L:L.toString(this._config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(N){this._streamError(N)}},this),this._streamError=A(function(L){this._streamCleanUp(),this._sendError(L)},this),this._streamEnd=A(function(){this._streamCleanUp(),R=!0,this._streamData("")},this),this._streamCleanUp=A(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function b(p){var _,C,R,L=Math.pow(2,53),N=-L,B=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,G=/^((\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)))$/,U=this,H=0,ct=0,Y=!1,et=!1,kt=[],$={data:[],errors:[],meta:{}};if(E(p.step)){var z=p.step;p.step=function(V){if($=V,Z())X();else{if(X(),$.data.length===0)return;H+=V.data.length,p.preview&&H>p.preview?C.abort():($.data=$.data[0],z($,U))}}}function j(V){return p.skipEmptyLines==="greedy"?V.join("").trim()==="":V.length===1&&V[0].length===0}function X(){return $&&R&&(q("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),R=!1),p.skipEmptyLines&&($.data=$.data.filter(function(V){return!j(V)})),Z()&&function(){if(!$)return;function V(J,Tt){E(p.transformHeader)&&(J=p.transformHeader(J,Tt)),kt.push(J)}if(Array.isArray($.data[0])){for(var ot=0;Z()&&ot<$.data.length;ot++)$.data[ot].forEach(V);$.data.splice(0,1)}else $.data.forEach(V)}(),function(){if(!$||!p.header&&!p.dynamicTyping&&!p.transform)return $;function V(J,Tt){var gt,At=p.header?{}:[];for(gt=0;gt<J.length;gt++){var yt=gt,ht=J[gt];p.header&&(yt=gt>=kt.length?"__parsed_extra":kt[gt]),p.transform&&(ht=p.transform(ht,yt)),ht=tt(yt,ht),yt==="__parsed_extra"?(At[yt]=At[yt]||[],At[yt].push(ht)):At[yt]=ht}return p.header&&(gt>kt.length?q("FieldMismatch","TooManyFields","Too many fields: expected "+kt.length+" fields but parsed "+gt,ct+Tt):gt<kt.length&&q("FieldMismatch","TooFewFields","Too few fields: expected "+kt.length+" fields but parsed "+gt,ct+Tt)),At}var ot=1;return!$.data.length||Array.isArray($.data[0])?($.data=$.data.map(V),ot=$.data.length):$.data=V($.data,0),p.header&&$.meta&&($.meta.fields=kt),ct+=ot,$}()}function Z(){return p.header&&kt.length===0}function tt(V,ot){return J=V,p.dynamicTypingFunction&&p.dynamicTyping[J]===void 0&&(p.dynamicTyping[J]=p.dynamicTypingFunction(J)),(p.dynamicTyping[J]||p.dynamicTyping)===!0?ot==="true"||ot==="TRUE"||ot!=="false"&&ot!=="FALSE"&&(function(Tt){if(B.test(Tt)){var gt=parseFloat(Tt);if(N<gt&&gt<L)return!0}return!1}(ot)?parseFloat(ot):G.test(ot)?new Date(ot):ot===""?null:ot):ot;var J}function q(V,ot,J,Tt){var gt={type:V,code:ot,message:J};Tt!==void 0&&(gt.row=Tt),$.errors.push(gt)}this.parse=function(V,ot,J){var Tt=p.quoteChar||'"';if(p.newline||(p.newline=function(yt,ht){yt=yt.substring(0,1048576);var $t=new RegExp(w(ht)+"([^]*?)"+w(ht),"gm"),ie=(yt=yt.replace($t,"")).split("\r"),ye=yt.split(`
36
+ `),se=1<ye.length&&ye[0].length<ie[0].length;if(ie.length===1||se)return`
37
+ `;for(var Kt=0,Mt=0;Mt<ie.length;Mt++)ie[Mt][0]===`
38
+ `&&Kt++;return Kt>=ie.length/2?`\r
39
+ `:"\r"}(V,Tt)),R=!1,p.delimiter)E(p.delimiter)&&(p.delimiter=p.delimiter(V),$.meta.delimiter=p.delimiter);else{var gt=function(yt,ht,$t,ie,ye){var se,Kt,Mt,Dt;ye=ye||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Zt=0;Zt<ye.length;Zt++){var ft=ye[Zt],Ge=0,be=0,Re=0;Mt=void 0;for(var re=new v({comments:ie,delimiter:ft,newline:ht,preview:10}).parse(yt),_e=0;_e<re.data.length;_e++)if($t&&j(re.data[_e]))Re++;else{var Te=re.data[_e].length;be+=Te,Mt!==void 0?0<Te&&(Ge+=Math.abs(Te-Mt),Mt=Te):Mt=Te}0<re.data.length&&(be/=re.data.length-Re),(Kt===void 0||Ge<=Kt)&&(Dt===void 0||Dt<be)&&1.99<be&&(Kt=Ge,se=ft,Dt=be)}return{successful:!!(p.delimiter=se),bestDelimiter:se}}(V,p.newline,p.skipEmptyLines,p.comments,p.delimitersToGuess);gt.successful?p.delimiter=gt.bestDelimiter:(R=!0,p.delimiter=l.DefaultDelimiter),$.meta.delimiter=p.delimiter}var At=T(p);return p.preview&&p.header&&At.preview++,_=V,C=new v(At),$=C.parse(_,ot,J),X(),Y?{meta:{paused:!0}}:$||{meta:{paused:!1}}},this.paused=function(){return Y},this.pause=function(){Y=!0,C.abort(),_=E(p.chunk)?"":_.substring(C.getCharIndex())},this.resume=function(){U.streamer._halted?(Y=!1,U.streamer.parseChunk(_,!0)):setTimeout(U.resume,3)},this.aborted=function(){return et},this.abort=function(){et=!0,C.abort(),$.meta.aborted=!0,E(p.complete)&&p.complete($),_=""}}function w(p){return p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(p){var _,C=(p=p||{}).delimiter,R=p.newline,L=p.comments,N=p.step,B=p.preview,G=p.fastMode,U=_=p.quoteChar===void 0||p.quoteChar===null?'"':p.quoteChar;if(p.escapeChar!==void 0&&(U=p.escapeChar),(typeof C!="string"||-1<l.BAD_DELIMITERS.indexOf(C))&&(C=","),L===C)throw new Error("Comment character same as delimiter");L===!0?L="#":(typeof L!="string"||-1<l.BAD_DELIMITERS.indexOf(L))&&(L=!1),R!==`
40
+ `&&R!=="\r"&&R!==`\r
41
+ `&&(R=`
42
+ `);var H=0,ct=!1;this.parse=function(Y,et,kt){if(typeof Y!="string")throw new Error("Input must be a string");var $=Y.length,z=C.length,j=R.length,X=L.length,Z=E(N),tt=[],q=[],V=[],ot=H=0;if(!Y)return te();if(p.header&&!et){var J=Y.split(R)[0].split(C),Tt=[],gt={},At=!1;for(var yt in J){var ht=J[yt];E(p.transformHeader)&&(ht=p.transformHeader(ht,yt));var $t=ht,ie=gt[ht]||0;for(0<ie&&(At=!0,$t=ht+"_"+ie),gt[ht]=ie+1;Tt.includes($t);)$t=$t+"_"+ie;Tt.push($t)}if(At){var ye=Y.split(R);ye[0]=Tt.join(C),Y=ye.join(R)}}if(G||G!==!1&&Y.indexOf(_)===-1){for(var se=Y.split(R),Kt=0;Kt<se.length;Kt++){if(V=se[Kt],H+=V.length,Kt!==se.length-1)H+=R.length;else if(kt)return te();if(!L||V.substring(0,X)!==L){if(Z){if(tt=[],Re(V.split(C)),oe(),ct)return te()}else Re(V.split(C));if(B&&B<=Kt)return tt=tt.slice(0,B),te(!0)}}return te()}for(var Mt=Y.indexOf(C,H),Dt=Y.indexOf(R,H),Zt=new RegExp(w(U)+w(_),"g"),ft=Y.indexOf(_,H);;)if(Y[H]!==_)if(L&&V.length===0&&Y.substring(H,H+X)===L){if(Dt===-1)return te();H=Dt+j,Dt=Y.indexOf(R,H),Mt=Y.indexOf(C,H)}else if(Mt!==-1&&(Mt<Dt||Dt===-1))V.push(Y.substring(H,Mt)),H=Mt+z,Mt=Y.indexOf(C,H);else{if(Dt===-1)break;if(V.push(Y.substring(H,Dt)),Te(Dt+j),Z&&(oe(),ct))return te();if(B&&tt.length>=B)return te(!0)}else for(ft=H,H++;;){if((ft=Y.indexOf(_,ft+1))===-1)return kt||q.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:tt.length,index:H}),_e();if(ft===$-1)return _e(Y.substring(H,ft).replace(Zt,_));if(_!==U||Y[ft+1]!==U){if(_===U||ft===0||Y[ft-1]!==U){Mt!==-1&&Mt<ft+1&&(Mt=Y.indexOf(C,ft+1)),Dt!==-1&&Dt<ft+1&&(Dt=Y.indexOf(R,ft+1));var Ge=re(Dt===-1?Mt:Math.min(Mt,Dt));if(Y.substr(ft+1+Ge,z)===C){V.push(Y.substring(H,ft).replace(Zt,_)),Y[H=ft+1+Ge+z]!==_&&(ft=Y.indexOf(_,H)),Mt=Y.indexOf(C,H),Dt=Y.indexOf(R,H);break}var be=re(Dt);if(Y.substring(ft+1+be,ft+1+be+j)===R){if(V.push(Y.substring(H,ft).replace(Zt,_)),Te(ft+1+be+j),Mt=Y.indexOf(C,H),ft=Y.indexOf(_,H),Z&&(oe(),ct))return te();if(B&&tt.length>=B)return te(!0);break}q.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:tt.length,index:H}),ft++}}else ft++}return _e();function Re(zt){tt.push(zt),ot=H}function re(zt){var Ci=0;if(zt!==-1){var En=Y.substring(ft+1,zt);En&&En.trim()===""&&(Ci=En.length)}return Ci}function _e(zt){return kt||(zt===void 0&&(zt=Y.substring(H)),V.push(zt),H=$,Re(V),Z&&oe()),te()}function Te(zt){H=zt,Re(V),V=[],Dt=Y.indexOf(R,H)}function te(zt){return{data:tt,errors:q,meta:{delimiter:C,linebreak:R,aborted:ct,truncated:!!zt,cursor:ot+(et||0)}}}function oe(){N(te()),tt=[],q=[]}},this.abort=function(){ct=!0},this.getCharIndex=function(){return H}}function S(p){var _=p.data,C=o[_.workerId],R=!1;if(_.error)C.userError(_.error,_.file);else if(_.results&&_.results.data){var L={abort:function(){R=!0,D(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(E(C.userStep)){for(var N=0;N<_.results.data.length&&(C.userStep({data:_.results.data[N],errors:_.results.errors,meta:_.results.meta},L),!R);N++);delete _.results}else E(C.userChunk)&&(C.userChunk(_.results,L,_.file),delete _.results)}_.finished&&!R&&D(_.workerId,_.results)}function D(p,_){var C=o[p];E(C.userComplete)&&C.userComplete(_),C.terminate(),delete o[p]}function k(){throw new Error("Not implemented.")}function T(p){if(typeof p!="object"||p===null)return p;var _=Array.isArray(p)?[]:{};for(var C in p)_[C]=T(p[C]);return _}function A(p,_){return function(){p.apply(_,arguments)}}function E(p){return typeof p=="function"}return r&&(i.onmessage=function(p){var _=p.data;if(l.WORKER_ID===void 0&&_&&(l.WORKER_ID=_.workerId),typeof _.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(_.input,_.config),finished:!0});else if(i.File&&_.input instanceof File||_.input instanceof Object){var C=l.parse(_.input,_.config);C&&i.postMessage({workerId:l.WORKER_ID,results:C,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(h.prototype=Object.create(u.prototype)).constructor=h,(g.prototype=Object.create(g.prototype)).constructor=g,(m.prototype=Object.create(u.prototype)).constructor=m,l})})(ng);var cD=ng.exports;const uD=["id"],dD=f.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,s=f.computed(()=>`export_${new Date().getTime()}`),r=f.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==ii.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ii.Object?d=>Pk(d,(h,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==ii.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>aD(d,u):d=>d},l=()=>{if(typeof i.fields===ii.Undefined&&typeof i.labels===ii.Undefined)return i.data;const u=o(),d=a();return i.data.map(h=>u(d(h)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=cD.unparse(r.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
43
+ `+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});lD.saveAs(d,i.filename)}};return(u,d)=>(f.openBlock(),f.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[f.renderSlot(u.$slots,"default",{},()=>[f.createTextVNode("Download "+f.toDisplayString(n.filename),1)])],8,uD))}}),hD=f.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=f.computed(()=>Object.keys(t.headers));return(i,s)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(dD,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),fD={class:"kong-ui-public-csv-export-modal"},gD={key:0,class:"selected-range"},pD={key:1,class:"text-muted",tag:"span"},ig=3,sg=f.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=mt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=f.ref(!0),a=f.computed(()=>{var b,w;return!!((w=(b=i.chartData)==null?void 0:b.data)!=null&&w.length)}),l=f.ref(1),c=f.computed(()=>g.value.rows.length),u=mt.useChartSelectedRange(f.toRef(i,"chartData")),d=f.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ig,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),h=()=>{s("toggleModal",!1)},g=f.computed(()=>{var T,A,E;if(!a.value||!((T=i.chartData)!=null&&T.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const b=i.chartData.data.some(p=>p.timestamp!==i.chartData.data[0].timestamp),w=i.chartData.data.map(p=>{const _=new Date(p.timestamp);return{...Object.keys(p.event).reduce((R,L)=>{if(L in i.chartData.meta.display){const N=p.event[L],B=i.chartData.meta.display[L];R[L]=N&&B&&B[N].name||p.event[L]}else R[L]=p.event[L];return R},{}),...b?{timestamp:Ha(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ha(_,"XXX")}:{}}});let v=[];b&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const S="display"in i.chartData.meta&&((A=i.chartData.meta)!=null&&A.display)?(E=i.chartData.meta)==null?void 0:E.display:{},D=[...v,...Object.keys(S).map(p=>({label:e.t(`chartLabels.${p}`),key:p})),...i.chartData.meta.metric_names.map(p=>({label:e.t(`chartLabels.${p}`),key:p}))],k=D.reduce((p,_)=>(p[_.key]=_.label,p),{});return{headers:D,csvHeaders:k,rows:w}}),m=async()=>{const{rows:b}=g.value;return o.value=!1,{total:Number(b.length)||0,data:b.slice(0,ig)}};return f.watch(g,()=>{l.value++}),(b,w)=>{const v=f.resolveComponent("KEmptyState"),S=f.resolveComponent("KTableData"),D=f.resolveComponent("KButton"),k=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",fD,[f.createVNode(k,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:f.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:f.withKeys(h,["esc"])},{default:f.withCtx(()=>{var T;return[f.createElementVNode("div",null,[a.value?(f.openBlock(),f.createElementBlock("div",gD,[f.createElementVNode("p",null,f.toDisplayString(b.modalDescription?b.modalDescription:f.unref(e).t("csvExport.exportDescription")),1),f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.exportTimeRange"))+": "+f.toDisplayString(f.unref(u)),1)])):f.createCommentVNode("",!0),f.createVNode(S,{class:"vitals-table",fetcher:m,"fetcher-cache-key":String(l.value),headers:((T=g.value)==null?void 0:T.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(v,{"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRange")),1)]),default:f.withCtx(()=>[f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(f.openBlock(),f.createElementBlock("div",pD,f.toDisplayString(d.value),1)):f.createCommentVNode("",!0)])]}),"footer-actions":f.withCtx(()=>[f.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(hD,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),rg=f.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=f.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),s=f.ref(!1),r=a=>{s.value=a},o=()=>{r(!0)};return(a,l)=>{const c=f.resolveComponent("KButton");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:f.withModifiers(o,["prevent"])},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.text||f.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),s.value?(f.openBlock(),f.createBlock(sg,{key:0,"chart-data":n.data,filename:i.value,onToggleModal:r},null,8,["chart-data","filename"])):f.createCommentVNode("",!0)],64)}}}),mD={class:"analytics-chart-shell"},yD={key:0,class:"chart-header"},bD=["title"],_D={key:1,class:"chart-header-icons-wrapper"},xD={key:2,class:"chart-export-button"},wD={key:2,class:"analytics-chart-parent"},vD=f.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:""},legendPosition:{type:String,required:!1,default:It.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0},threshold:{type:Object,required:!1,default:void 0},timeseriesZoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=mt.useI18n(),{evaluateFeatureFlag:r}=mt.useEvaluateFeatureFlag(),o=r("ma-3043-analytics-chart-kebab-menu",!1),a=f.toRef(e,"chartData"),l=f.computed(()=>v.value?mt.useExploreResultToTimeDataset({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Lr,threshold:e.chartOptions.threshold||void 0},f.toRef(e,"chartData")).value:mt.useExploreResultToDatasets({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Lr},f.toRef(e,"chartData")).value),c=f.computed(()=>{var N;return(N=e.chartData)!=null&&N.meta?"start_ms"in e.chartData.meta?e.chartData.meta.end_ms-e.chartData.meta.start_ms:void 0:0}),u=f.computed(()=>{var N;return(N=e.chartData.meta)!=null&&N.metric_units?Object.values(e.chartData.meta.metric_units)[0]:""}),d=f.computed(()=>e.showLegendValues&&e.legendPosition!==It.Bottom),{legendValues:h}=mt.useChartLegendValues(l,e.chartOptions.type,u),g=f.computed(()=>{var N,B,G;return((G=(B=(N=e.chartData)==null?void 0:N.meta)==null?void 0:B.limit)==null?void 0:G.toString())||null}),m=f.computed(()=>{var N,B;return((B=(N=e.chartData)==null?void 0:N.meta)==null?void 0:B.truncated)||!1}),b=s.t("limitedResultsShown",{maxReturned:g.value}),w=f.computed(()=>["vertical_bar","horizontal_bar"].includes(e.chartOptions.type)),v=f.computed(()=>["timeseries_bar","timeseries_line"].some(N=>N===e.chartOptions.type)),S=f.computed(()=>e.chartOptions.type==="doughnut"),D=f.computed(()=>e.chartOptions.type.includes("vertical")?"vertical":"horizontal"),k=f.computed(()=>{var G,U,H;if(!((G=e.chartData)!=null&&G.meta.metric_names)||!((U=e.chartData)!=null&&U.meta.metric_units))return;const N=e.chartData.meta.metric_names[0],B=e.chartData.meta.metric_units[N];if(e.chartData.meta.metric_names.length>1){if(N.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(N.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return((H=e.chartOptions)==null?void 0:H.metricAxesTitle)||s.te(`metricAxisTitles.${N}`)&&s.te(`chartUnits.${B}`)&&s.t(`metricAxisTitles.${N}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0}),T=f.computed(()=>{const N=v.value?"Time":Object.keys(e.chartData.meta.display||e.chartData.meta.metric_names)[0];return e.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${N}`)&&s.t(`chartLabels.${N}`)||void 0}),A=f.computed(()=>{const N=Ka(Number(e.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${N}`)}),E=f.computed(()=>e.emptyStateTitle||s.t("noDataAvailableTitle")),p=f.computed(()=>e.emptyStateDescription||s.t("noDataAvailableDescription")),_=f.computed(()=>v.value?Jx(l.value):e.chartData&&e.chartData.meta&&e.chartData.data.length),C=f.computed(()=>e.chartData.meta.granularity_ms?Ka(e.chartData.meta.granularity_ms)||"hourly":Ka(new Date(e.chartData.data[1].timestamp).getTime()-new Date(e.chartData.data[0].timestamp).getTime())||"hourly"),R=f.computed(()=>e.chartOptions.chartLegendSortFn?e.chartOptions.chartLegendSortFn:(N,B)=>N.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(N.text,10))&&!isNaN(parseInt(B.text,10))?N.text<B.text?-1:1:N.value&&B.value?B.value.raw-N.value.raw:0),L=f.computed(()=>e.chartOptions.chartTooltipSortFn?e.chartOptions.chartTooltipSortFn:(N,B)=>N.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(N.label,10))&&!isNaN(parseInt(B.label,10))?N.label<B.label?-1:1:N.value&&B.value?B.rawValue-N.rawValue:0);return f.provide("showLegendValues",d),f.provide("legendPosition",f.toRef(e,"legendPosition")),(N,B)=>{const G=f.resolveComponent("KTooltip"),U=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",mD,[_.value&&m.value&&g.value||!f.unref(o)&&(n.allowCsvExport||e.chartTitle)?(f.openBlock(),f.createElementBlock("div",yD,[n.chartTitle?(f.openBlock(),f.createElementBlock("div",{key:0,class:"chart-title",title:n.chartTitle},f.toDisplayString(n.chartTitle),9,bD)):f.createCommentVNode("",!0),_.value&&m.value&&g.value?(f.openBlock(),f.createElementBlock("div",_D,[f.createVNode(G,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(b)),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(Zl.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(iM)})`,decorative:"",size:f.unref(sM)},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),!f.unref(o)&&n.allowCsvExport&&_.value?(f.openBlock(),f.createElementBlock("div",xD,[f.createVNode(rg,{data:a.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),_.value?(f.openBlock(),f.createElementBlock("div",wD,[v.value?(f.openBlock(),f.createBlock(kk,{key:0,"chart-data":l.value,"chart-legend-sort-fn":R.value,"chart-tooltip-sort-fn":L.value,"dimension-axes-title":A.value,fill:n.chartOptions.stacked,granularity:C.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.threshold,"time-range-ms":c.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,zoom:n.timeseriesZoom,onZoomTimeRange:B[0]||(B[0]=H=>i("zoom-time-range",H))},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-title","type","zoom"])):w.value?(f.openBlock(),f.createBlock(uk,{key:1,annotations:n.showAnnotations,"chart-data":l.value,"chart-legend-sort-fn":R.value,"chart-tooltip-sort-fn":L.value,"data-testid":"bar-chart-container","dimension-axes-title":T.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,orientation:D.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"])):S.value?(f.openBlock(),f.createBlock(vk,{key:2,"chart-data":l.value,"dataset-colors":n.chartOptions.chartDatasetColors||f.unref(Lr),"legend-position":n.legendPosition,"legend-values":f.unref(h),"metric-unit":u.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(U,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(E.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.value),1)]),_:1}))])}}}),MD=cn(vD,[["__scopeId","data-v-19cd92bf"]]),SD={class:"chart-parent","data-testid":"doughnut-chart-parent"},kD={class:"chart-totals-flex"},DD={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},TD=cn(f.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on},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}=mt.useI18n(),i=f.ref(On()),s=f.computed(()=>[t.chartData.datasets.reduce((m,b)=>(m.labels.push(b.label),m.borderColor.push(b.backgroundColor),m.backgroundColor.push(b.backgroundColor),m.data.push(b.data.reduce((w,v)=>w+v,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=f.computed(()=>({...t.chartData,datasets:s.value}));mt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=f.ref(),l=f.computed(()=>{var g;return ws((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=f.computed(()=>{var g,m;return ws(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((m=s==null?void 0:s.value[0])==null?void 0:m.data[1]),{capital:!0})}),u=f.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=f.computed(()=>["full","single"].includes(t.metricDisplay)),h=f.computed(()=>t.metricDisplay==="full");return(g,m)=>(f.openBlock(),f.createElementBlock("div",SD,[f.createElementVNode("div",kD,[d.value?(f.openBlock(),f.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:f.normalizeStyle(u.value)},f.toDisplayString(l.value),5)):f.createCommentVNode("",!0),h.value?(f.openBlock(),f.createElementBlock("div",DD,f.toDisplayString(f.unref(e).t("total"))+": "+f.toDisplayString(c.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:"chart-container",style:f.normalizeStyle({height:n.height,width:n.width})},[f.createVNode(f.unref(Xf),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-6596329c"]]),CD={class:"simple-chart-shell"},OD={key:1,class:"analytics-chart-parent"},PD=cn(f.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}=mt.useI18n(),i=f.computed(()=>{var c;const l=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},f.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),s=f.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=f.computed(()=>t.chartOptions.type==="gauge"),o=f.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),a=f.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",CD,[a.value?(f.openBlock(),f.createElementBlock("div",OD,[r.value?(f.openBlock(),f.createBlock(TD,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.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"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(u,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-9d13f2fd"]]),ED={class:"top-n-card-title","data-testid":"top-n-card-title"},AD={class:"top-n-card-description","data-testid":"top-n-card-description"},RD={key:3,class:"top-n-table","data-testid":"top-n-table"},LD={class:"table-headings"},ID={class:"table-row"},ND={class:"column-1"},FD={class:"column-2"},zD={class:"table-body","data-testid":"top-n-data"},BD=["data-testid"],HD={class:"column-1"},WD={class:"column-2"},YD=cn(f.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},titleTag:{type:String,default:"h2"}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=f.computed(()=>t.data.data),s=f.computed(()=>{var m;return!!((m=i.value)!=null&&m.length)}),r=f.computed(()=>{var m,b;return(m=t.data.meta)!=null&&m.display&&((b=Object.keys(t.data.meta.display))==null?void 0:b[0])||""}),o=f.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=f.computed(()=>{var m,b;return(b=(m=t.data.meta)==null?void 0:m.metric_names)!=null&&b.length?t.data.meta.metric_names[0]:""}),l=f.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=m=>{const b=m.event;return String(b[r.value])},d=m=>{const b=u(m),w=o.value&&o.value[b];return w?w.name:"-"},h=m=>{const b=u(m),w=o.value&&o.value[b];return w?!!w.deleted:!1},g=m=>{if(!a.value)return"–";const w=m.event[a.value];return w?ws(w,{capital:!0,round:!0}):"–"};return(m,b)=>{const w=f.resolveComponent("KEmptyState"),v=f.resolveComponent("KSkeleton"),S=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(S,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},f.createSlots({default:f.withCtx(()=>[c.value?(f.openBlock(),f.createBlock(w,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.value),1)]),_:1})):n.isLoading?(f.openBlock(),f.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",RD,[f.createElementVNode("div",LD,[f.createElementVNode("div",ID,[f.createElementVNode("div",ND,f.toDisplayString(f.unref(e).t("topNTable.nameLabel")),1),f.createElementVNode("div",FD,f.toDisplayString(l.value),1)])]),f.createElementVNode("div",zD,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,(D,k)=>(f.openBlock(),f.createElementBlock("div",{key:`entry-${k}`,class:"table-row","data-testid":`row-${u(D)}`},[f.createElementVNode("div",HD,[f.renderSlot(m.$slots,"name",{record:{id:u(D),name:d(D),deleted:h(D),dimension:r.value}},()=>[f.createTextVNode(f.toDisplayString(d(D)),1)],!0)]),f.createElementVNode("div",WD,"   "+f.toDisplayString(g(D)),1)],8,BD))),128))])])):(f.openBlock(),f.createBlock(w,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.emptyStateTitle||f.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",ED,f.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",AD,f.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-27a707ed"]]);nt.AnalyticsChart=MD,nt.ChartLegendPosition=It,nt.CsvExportButton=rg,nt.CsvExportModal=sg,nt.DECIMAL_DISPLAY=$d,nt.EMPTY_COLOR=Qd,nt.FONT_SIZE_REGULAR=qd,nt.FONT_SIZE_SMALL=Ud,nt.MAX_LABEL_LENGTH=Ar,nt.OTHERS_COLOR=rw,nt.SimpleChart=PD,nt.TopNTable=YD,nt.ValidType=ii,nt.accessibleGrey=Kd,nt.apiRequestStatusCodeColors=Zd,nt.chartTypes=Tk,nt.codesInSpec=nh,nt.darkenColor=Gd,nt.datavisPalette=on,nt.defaultStatusCodeColors=Lr,nt.determineBaseColor=Ca,nt.errorRateColors=iw,nt.latencyColors=sw,nt.lightGrey=Ea,nt.lookupColor=ow,nt.lookupDatavisColor=Rr,nt.lookupStatusCodeCategoryColor=fw,nt.lookupStatusCodeColor=Aa,nt.numberFormatter=Er,nt.simpleChartMetricDisplay=Dk,nt.simpleChartTypes=Ck,nt.statusCodeBadgeBackgroundColor=ew,nt.trafficColors=nw,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});