@kong-ui-public/analytics-chart 10.0.1 → 10.0.3

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,31 +1,31 @@
1
- (function(ot,h){typeof exports=="object"&&typeof module<"u"?h(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"],h):(ot=typeof globalThis<"u"?globalThis:ot||self,h(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,h,Fn,nc){"use strict";var pT=Object.defineProperty;var mT=(ot,h,Fn)=>h in ot?pT(ot,h,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):ot[h]=Fn;var O=(ot,h,Fn)=>mT(ot,typeof h!="symbol"?h+"":h,Fn);var En,hg;const gg={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",exportPreview:"Export preview",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_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",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_average:"Upstream latency (avg)",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",api:"API"},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)",api:"API"},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)"}},singleValue:{valueError:"Invalid configuration"},new_timerange_label:"Time range",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel"}};function pg(){const n=Fn.createI18n("en-us",gg);return{i18n:n,i18nT:Fn.i18nTComponent(n)}}/*!
1
+ (function(ot,h){typeof exports=="object"&&typeof module<"u"?h(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"],h):(ot=typeof globalThis<"u"?globalThis:ot||self,h(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,h,Fn,ec){"use strict";var fT=Object.defineProperty;var gT=(ot,h,Fn)=>h in ot?fT(ot,h,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):ot[h]=Fn;var O=(ot,h,Fn)=>gT(ot,typeof h!="symbol"?h+"":h,Fn);var En,dg;const fg={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",exportPreview:"Export preview",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_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",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_average:"Upstream latency (avg)",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",api:"API"},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)",api:"API"},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)"}},singleValue:{valueError:"Invalid configuration"},new_timerange_label:"Time range",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel"}};function gg(){const n=Fn.createI18n("en-us",fg);return{i18n:n,i18nT:Fn.i18nTComponent(n)}}/*!
2
2
  * @kurkle/color v0.3.4
3
3
  * https://github.com/kurkle/color#readme
4
4
  * (c) 2024 Jukka Kurkela
5
5
  * Released under the MIT License
6
- */function Bi(n){return n+.5|0}const pn=(n,t,e)=>Math.max(Math.min(n,e),t);function Hi(n){return pn(Bi(n*2.55),0,255)}function mn(n){return pn(Bi(n*255),0,255)}function Ge(n){return pn(Bi(n/2.55)/100,0,1)}function ic(n){return pn(Bi(n*100),0,100)}const ke={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},bo=[..."0123456789ABCDEF"],mg=n=>bo[n&15],yg=n=>bo[(n&240)>>4]+bo[n&15],$s=n=>(n&240)>>4===(n&15),bg=n=>$s(n.r)&&$s(n.g)&&$s(n.b)&&$s(n.a);function _g(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&ke[n[1]]*17,g:255&ke[n[2]]*17,b:255&ke[n[3]]*17,a:t===5?ke[n[4]]*17:255}:(t===7||t===9)&&(e={r:ke[n[1]]<<4|ke[n[2]],g:ke[n[3]]<<4|ke[n[4]],b:ke[n[5]]<<4|ke[n[6]],a:t===9?ke[n[7]]<<4|ke[n[8]]:255})),e}const xg=(n,t)=>n<255?t(n):"";function wg(n){var t=bg(n)?mg:yg;return n?"#"+t(n.r)+t(n.g)+t(n.b)+xg(n.a,t):void 0}const vg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function sc(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 Mg(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 kg(n,t,e){const i=sc(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 Dg(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 _o(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=Dg(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function xo(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(mn)}function wo(n,t,e){return xo(sc,n,t,e)}function Sg(n,t,e){return xo(kg,n,t,e)}function Tg(n,t,e){return xo(Mg,n,t,e)}function rc(n){return(n%360+360)%360}function Cg(n){const t=vg.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Hi(+t[5]):mn(+t[5]));const s=rc(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Sg(s,r,o):t[1]==="hsv"?i=Tg(s,r,o):i=wo(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Pg(n,t){var e=_o(n);e[0]=rc(e[0]+t),e=wo(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Og(n){if(!n)return;const t=_o(n),e=t[0],i=ic(t[1]),s=ic(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ge(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const oc={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"},ac={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 Eg(){const n={},t=Object.keys(ac),e=Object.keys(oc);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,oc[r]);r=parseInt(ac[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let Vs;function Ag(n){Vs||(Vs=Eg(),Vs.transparent=[0,0,0,0]);const t=Vs[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Rg=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ig(n){const t=Rg.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?Hi(o):pn(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Hi(i):pn(i,0,255)),s=255&(t[4]?Hi(s):pn(s,0,255)),r=255&(t[6]?Hi(r):pn(r,0,255)),{r:i,g:s,b:r,a:e}}}function Lg(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ge(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const vo=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ui=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Ng(n,t,e){const i=ui(Ge(n.r)),s=ui(Ge(n.g)),r=ui(Ge(n.b));return{r:mn(vo(i+e*(ui(Ge(t.r))-i))),g:mn(vo(s+e*(ui(Ge(t.g))-s))),b:mn(vo(r+e*(ui(Ge(t.b))-r))),a:n.a+e*(t.a-n.a)}}function Us(n,t,e){if(n){let i=_o(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=wo(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function lc(n,t){return n&&Object.assign(t||{},n)}function cc(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=mn(n[3]))):(t=lc(n,{r:0,g:0,b:0,a:1}),t.a=mn(t.a)),t}function Fg(n){return n.charAt(0)==="r"?Ig(n):Cg(n)}class Wi{constructor(t){if(t instanceof Wi)return t;const e=typeof t;let i;e==="object"?i=cc(t):e==="string"&&(i=_g(t)||Ag(t)||Fg(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=lc(this._rgb);return t&&(t.a=Ge(t.a)),t}set rgb(t){this._rgb=cc(t)}rgbString(){return this._valid?Lg(this._rgb):void 0}hexString(){return this._valid?wg(this._rgb):void 0}hslString(){return this._valid?Og(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=Ng(this._rgb,t._rgb,e)),this}clone(){return new Wi(this.rgb)}alpha(t){return this._rgb.a=mn(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 Us(this._rgb,2,t),this}darken(t){return Us(this._rgb,2,-t),this}saturate(t){return Us(this._rgb,1,t),this}desaturate(t){return Us(this._rgb,1,-t),this}rotate(t){return Pg(this._rgb,t),this}}/*!
6
+ */function Bi(n){return n+.5|0}const pn=(n,t,e)=>Math.max(Math.min(n,e),t);function Hi(n){return pn(Bi(n*2.55),0,255)}function mn(n){return pn(Bi(n*255),0,255)}function Ge(n){return pn(Bi(n/2.55)/100,0,1)}function nc(n){return pn(Bi(n*100),0,100)}const ke={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},yo=[..."0123456789ABCDEF"],pg=n=>yo[n&15],mg=n=>yo[(n&240)>>4]+yo[n&15],$s=n=>(n&240)>>4===(n&15),yg=n=>$s(n.r)&&$s(n.g)&&$s(n.b)&&$s(n.a);function bg(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&ke[n[1]]*17,g:255&ke[n[2]]*17,b:255&ke[n[3]]*17,a:t===5?ke[n[4]]*17:255}:(t===7||t===9)&&(e={r:ke[n[1]]<<4|ke[n[2]],g:ke[n[3]]<<4|ke[n[4]],b:ke[n[5]]<<4|ke[n[6]],a:t===9?ke[n[7]]<<4|ke[n[8]]:255})),e}const _g=(n,t)=>n<255?t(n):"";function xg(n){var t=yg(n)?pg:mg;return n?"#"+t(n.r)+t(n.g)+t(n.b)+_g(n.a,t):void 0}const wg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ic(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 vg(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 Mg(n,t,e){const i=ic(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 kg(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 bo(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=kg(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function _o(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(mn)}function xo(n,t,e){return _o(ic,n,t,e)}function Dg(n,t,e){return _o(Mg,n,t,e)}function Sg(n,t,e){return _o(vg,n,t,e)}function sc(n){return(n%360+360)%360}function Tg(n){const t=wg.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Hi(+t[5]):mn(+t[5]));const s=sc(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Dg(s,r,o):t[1]==="hsv"?i=Sg(s,r,o):i=xo(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Cg(n,t){var e=bo(n);e[0]=sc(e[0]+t),e=xo(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Pg(n){if(!n)return;const t=bo(n),e=t[0],i=nc(t[1]),s=nc(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ge(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const rc={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"},oc={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 Og(){const n={},t=Object.keys(oc),e=Object.keys(rc);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,rc[r]);r=parseInt(oc[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let Vs;function Eg(n){Vs||(Vs=Og(),Vs.transparent=[0,0,0,0]);const t=Vs[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ag=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Rg(n){const t=Ag.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?Hi(o):pn(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Hi(i):pn(i,0,255)),s=255&(t[4]?Hi(s):pn(s,0,255)),r=255&(t[6]?Hi(r):pn(r,0,255)),{r:i,g:s,b:r,a:e}}}function Ig(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ge(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const wo=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ui=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Lg(n,t,e){const i=ui(Ge(n.r)),s=ui(Ge(n.g)),r=ui(Ge(n.b));return{r:mn(wo(i+e*(ui(Ge(t.r))-i))),g:mn(wo(s+e*(ui(Ge(t.g))-s))),b:mn(wo(r+e*(ui(Ge(t.b))-r))),a:n.a+e*(t.a-n.a)}}function Us(n,t,e){if(n){let i=bo(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=xo(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ac(n,t){return n&&Object.assign(t||{},n)}function lc(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=mn(n[3]))):(t=ac(n,{r:0,g:0,b:0,a:1}),t.a=mn(t.a)),t}function Ng(n){return n.charAt(0)==="r"?Rg(n):Tg(n)}class Wi{constructor(t){if(t instanceof Wi)return t;const e=typeof t;let i;e==="object"?i=lc(t):e==="string"&&(i=bg(t)||Eg(t)||Ng(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ac(this._rgb);return t&&(t.a=Ge(t.a)),t}set rgb(t){this._rgb=lc(t)}rgbString(){return this._valid?Ig(this._rgb):void 0}hexString(){return this._valid?xg(this._rgb):void 0}hslString(){return this._valid?Pg(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=Lg(this._rgb,t._rgb,e)),this}clone(){return new Wi(this.rgb)}alpha(t){return this._rgb.a=mn(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 Us(this._rgb,2,t),this}darken(t){return Us(this._rgb,2,-t),this}saturate(t){return Us(this._rgb,1,t),this}desaturate(t){return Us(this._rgb,1,-t),this}rotate(t){return Cg(this._rgb,t),this}}/*!
7
7
  * Chart.js v4.5.0
8
8
  * https://www.chartjs.org
9
9
  * (c) 2025 Chart.js Contributors
10
10
  * Released under the MIT License
11
- */function Ke(){}const zg=(()=>{let n=0;return()=>n++})();function st(n){return n==null}function kt(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 ht(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const Bg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,uc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Dt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function St(n,t,e,i){let s,r,o;if(kt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ht(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function qs(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 Xs(n){if(kt(n))return n.map(Xs);if(ht(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Xs(n[e[s]]);return t}return n}function dc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Hg(n,t,e,i){if(!dc(n))return;const s=t[n],r=e[n];ht(s)&&ht(r)?Yi(s,r,i):t[n]=Xs(r)}function Yi(n,t,e){const i=kt(t)?t:[t],s=i.length;if(!ht(n))return n;e=e||{};const r=e.merger||Hg;let o;for(let a=0;a<s;++a){if(o=i[a],!ht(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:Wg})}function Wg(n,t,e){if(!dc(n))return;const i=t[n],s=e[n];ht(i)&&ht(s)?ji(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Xs(s))}const hc={"":n=>n,x:n=>n.x,y:n=>n.y};function Yg(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 jg(n){const t=Yg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function yn(n,t){return(hc[t]||(hc[t]=jg(t)))(n)}function Mo(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=n=>typeof n=="function",fc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function $g(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ct=Math.PI,Ot=2*ct,Vg=Ot+ct,Gs=Number.POSITIVE_INFINITY,ko=ct/180,Et=ct/2,De=ct/4,Ks=ct*2/3,bn=Math.log10,He=Math.sign;function $i(n,t,e){return Math.abs(n-t)<e}function gc(n){const t=Math.round(n);n=$i(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(bn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Ug(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 qg(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function _n(n){return!qg(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function Xg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function pc(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 Vt(n){return n*(ct/180)}function Zs(n){return n*(180/ct)}function mc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Qs(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*ct&&(r+=Ot),{angle:r,distance:s}}function di(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Gg(n,t){return(n-t+Vg)%Ot-ct}function se(n){return(n%Ot+Ot)%Ot}function Vi(n,t,e,i){const s=se(n),r=se(t),o=se(e),a=se(r-s),l=se(o-s),c=se(s-r),u=se(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function Kg(n){return Qt(n,-32768,32767)}function Ze(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Do(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 Qe=(n,t,e,i)=>Do(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Zg=(n,t,e)=>Do(n,e,i=>n[i][t]>=e);function Qg(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 yc=["push","pop","shift","splice","unshift"];function Jg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),yc.forEach(e=>{const i="_onData"+Mo(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 bc(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)&&(yc.forEach(r=>{delete n[r]}),delete n._chartjs)}function _c(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const xc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function wc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,xc.call(window,()=>{i=!1,n.apply(t,e)}))}}function tp(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const So=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ep=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function vc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:g,maxDefined:p}=o.getUserBounds();if(g){if(s=Math.min(Qe(l,u,d).lo,e?i:Qe(t,u,o.getPixelForValue(d)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(_=>!st(_[a.axis]));s-=Math.max(0,y)}s=Qt(s,0,i-1)}if(p){let y=Math.max(Qe(l,o.axis,f,!0).hi+1,e?0:Qe(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const _=l.slice(y-1).findIndex(v=>!st(v[a.axis]));y+=Math.max(0,_)}r=Qt(y,s,i)-s}else r=i-s}return{start:s,count:r}}function Mc(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 Js=n=>n===0||n===1,kc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),Dc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/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*Et)+1,easeOutSine:n=>Math.sin(n*Et),easeInOutSine:n=>-.5*(Math.cos(ct*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=>Js(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=>Js(n)?n:kc(n,.075,.3),easeOutElastic:n=>Js(n)?n:Dc(n,.075,.3),easeInOutElastic(n){return Js(n)?n:n<.5?.5*kc(n*2,.1125,.45):.5+.5*Dc(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 To(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Sc(n){return To(n)?n:new Wi(n)}function Co(n){return To(n)?n:new Wi(n).saturate(.5).darken(.1).hexString()}const np=["x","y","borderWidth","radius","tension"],ip=["color","borderColor","backgroundColor"];function sp(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:ip},numbers:{type:"number",properties:np}}),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 rp(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Tc=new Map;function op(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Tc.get(e);return i||(i=new Intl.NumberFormat(n,t),Tc.set(e,i)),i}function qi(n,t,e){return op(t,e).format(n)}const Cc={values(n){return kt(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=ap(n,e)}const o=bn(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(bn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Cc.numeric.call(this,n,t,e):""}};function ap(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 tr={formatters:Cc};function lp(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:tr.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 zn=Object.create(null),Po=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 Oo(n,t,e){return typeof t=="string"?Yi(Xi(n,t),e):Yi(Xi(n,""),t)}class cp{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)=>Co(s.backgroundColor),this.hoverBorderColor=(i,s)=>Co(s.borderColor),this.hoverColor=(i,s)=>Co(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 Oo(this,t,e)}get(t){return Xi(this,t)}describe(t,e){return Oo(Po,t,e)}override(t,e){return Oo(zn,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 ht(l)?Object.assign({},c,l):rt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new cp({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sp,rp,lp]);function up(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function er(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 dp(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,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!kt(d))o=er(n,s,r,o,d);else if(kt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!kt(f)&&(o=er(n,s,r,o,f));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 Bn(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 Pc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Eo(n,t,e,i){Oc(n,t,e,i,null)}function Oc(n,t,e,i,s){let r,o,a,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,y=t.radius;let _=(p||0)*ko;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(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,Ot):n.arc(e,i,y,0,Ot),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(_)*u,i-Math.cos(_)*y),_+=Ks,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*y),_+=Ks,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(_+De)*l,d=Math.cos(_+De)*(s?s/2-c:l),a=Math.sin(_+De)*l,f=Math.sin(_+De)*(s?s/2-c:l),n.arc(e-d,i-a,c,_-ct,_-Et),n.arc(e+f,i-o,c,_-Et,_),n.arc(e+d,i+a,c,_,_+Et),n.arc(e-f,i+o,c,_+Et,_+ct),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}_+=De;case"rectRot":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+f,i-o),n.lineTo(e+d,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":_+=De;case"cross":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),_+=De,d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(_)*y,a=Math.sin(_)*y,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(_)*(s?s/2:y),i+Math.sin(_)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Je(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 hp(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 fp(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 gp(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 pp(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 mp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Hn(n,t,e,i,s,r={}){const o=kt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,gp(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&mp(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),pp(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function hi(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*ct,ct,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ct,Et,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Et,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Et,!0),n.lineTo(e+o.topLeft,i)}const yp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,bp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _p(n,t){const e=(""+n).match(yp);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 xp=n=>+n||0;function Ao(n,t){const e={},i=ht(t),s=i?Object.keys(t):t,r=ht(n)?i?o=>rt(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=xp(r(o));return e}function Ec(n){return Ao(n,{top:"y",right:"x",bottom:"y",left:"x"})}function xn(n){return Ao(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=Ec(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||At.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=rt(n.style,t.style);i&&!(""+i).match(bp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:rt(n.family,t.family),lineHeight:_p(rt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:rt(n.weight,t.weight),string:""};return s.string=up(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 wp(n,t,e){const{min:i,max:s}=n,r=uc(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 wn(n,t){return Object.assign(Object.create(n),t)}function Ro(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Nc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Ro([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 Rc(a,l,()=>Pp(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Fc(a).includes(l)},ownKeys(a){return Fc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function fi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ac(n,i),setContext:r=>fi(n,r,e,i),override:r=>fi(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 Rc(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 Ac(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:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const vp=(n,t)=>n?n+Mo(t):t,Io=(n,t)=>ht(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rc(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 pe(a)&&o.isScriptable(t)&&(a=kp(t,a,n,e)),kt(a)&&a.length&&(a=Dp(t,a,n,o.isIndexable)),Io(t,a)&&(a=fi(a,s,r&&r[t],o)),a}function kp(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),Io(n,l)&&(l=Lo(s._scopes,s,n,l)),l}function Dp(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(ht(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Lo(c,s,n,u);t.push(fi(d,r,o&&o[n],a))}}return t}function Ic(n,t,e){return pe(n)?n(t,e):n}const Sp=(n,t)=>n===!0?t:typeof n=="string"?yn(t,n):void 0;function Tp(n,t,e,i,s){for(const r of t){const o=Sp(e,r);if(o){n.add(o);const a=Ic(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 Lo(n,t,e,i){const s=t._rootScopes,r=Ic(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Lc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Lc(a,o,r,l,i),l===null)?!1:Ro(Array.from(a),[""],s,r,()=>Cp(t,e,i))}function Lc(n,t,e,i,s){for(;e;)e=Tp(n,t,e,i,s);return e}function Cp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return kt(s)&&ht(e)?e:s||{}}function Pp(n,t,e,i){let s;for(const r of t)if(s=Nc(vp(r,n),e),typeof s<"u")return Io(n,s)?Lo(e,i,n,s):s}function Nc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Fc(n){let t=n._keys;return t||(t=n._keys=Op(n._scopes)),t}function Op(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 zc(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(yn(u,r),c)};return o}const Ep=Number.EPSILON||1e-14,gi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Bc=n=>n==="x"?"y":"x";function Ap(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=di(r,s),l=di(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,f=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function Rp(n,t,e){const i=n.length;let s,r,o,a,l,c=gi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=gi(n,u+1),!(!l||!c)){if($i(t[u],0,Ep)){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 Ip(n,t,e="x"){const i=Bc(e),s=n.length;let r,o,a,l=gi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=gi(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 Lp(n,t="x"){const e=Bc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=gi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=gi(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?He(s[o-1])!==He(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Rp(n,s,r),Ip(n,r,t)}function nr(n,t,e){return Math.max(Math.min(n,e),t)}function Np(n,t){let e,i,s,r,o,a=Je(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Je(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=nr(s.cp1x,t.left,t.right),s.cp1y=nr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=nr(s.cp2x,t.left,t.right),s.cp2y=nr(s.cp2y,t.top,t.bottom)))}function Fp(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Lp(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=Ap(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&&Np(n,e)}function No(){return typeof window<"u"&&typeof document<"u"}function Fo(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ir(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 sr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function zp(n,t){return sr(n).getPropertyValue(t)}const Bp=["top","right","bottom","left"];function Wn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Bp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Hp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Wp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Hp(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 vn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=sr(e),r=s.boxSizing==="border-box",o=Wn(s,"padding"),a=Wn(s,"border","width"),{x:l,y:c,box:u}=Wp(n,e),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:g,height:p}=t;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Yp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Fo(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=sr(r),l=Wn(a,"border","width"),c=Wn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=ir(a.maxWidth,r,"clientWidth"),s=ir(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Gs,maxHeight:s||Gs}}const rr=n=>Math.round(n*10)/10;function jp(n,t,e,i){const s=sr(n),r=Wn(s,"margin"),o=ir(s.maxWidth,n,"clientWidth")||Gs,a=ir(s.maxHeight,n,"clientHeight")||Gs,l=Yp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Wn(s,"border","width"),g=Wn(s,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=rr(Math.min(c,o,l.maxWidth)),u=rr(Math.min(u,a,l.maxHeight)),c&&!u&&(u=rr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=rr(Math.floor(u*i))),{width:c,height:u}}function Hc(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 $p=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};No()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Wc(n,t){const e=zp(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Yn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Vp(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 Up(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Yn(n,s,e),a=Yn(s,r,e),l=Yn(r,t,e),c=Yn(o,a,e),u=Yn(a,l,e);return Yn(c,u,e)}const qp=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}}},Xp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function pi(n,t,e){return n?qp(t,e):Xp()}function Yc(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 jc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function $c(n){return n==="angle"?{between:Vi,compare:Gg,normalize:se}:{between:Ze,compare:(t,e)=>t-e,normalize:t=>t}}function Vc({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 Gp(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=$c(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&o(a(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Uc(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=$c(i),{start:u,end:d,loop:f,style:g}=Gp(n,t,e),p=[];let y=!1,_=null,v,M,D;const S=()=>l(s,D,v)&&a(s,D)!==0,T=()=>a(r,v)===0||l(r,D,v),R=()=>y||S(),E=()=>!y||T();for(let b=u,x=u;b<=d;++b)M=t[b%o],!M.skip&&(v=c(M[i]),v!==D&&(y=l(v,s,r),_===null&&R()&&(_=a(v,s)===0?b:x),_!==null&&E()&&(p.push(Vc({start:_,end:b,loop:f,count:o,style:g})),_=null),x=b,D=v));return _!==null&&p.push(Vc({start:_,end:d,loop:f,count:o,style:g})),p}function qc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=Uc(i[s],n.points,t);r.length&&e.push(...r)}return e}function Kp(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 Zp(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 Qp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=Kp(e,s,r,i);if(i===!0)return Xc(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 Xc(n,Zp(e,o,l,c),e,t)}function Xc(n,t,e,i){return!i||!i.setContext||!e?t:Jp(n,t,e,i)}function Jp(n,t,e,i){const s=n._chart.getContext(),r=Gc(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,f=d;function g(p,y,_,v){const M=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=M;for(;e[y%l].skip;)y+=M;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:_,style:v}),u=v,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],_;for(f=d+1;f<=p.end;f++){const v=e[f%l];_=Gc(i.setContext(wn(s,{type:"segment",p0:y,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),tm(_,u)&&g(d,f-1,p.loop,u),y=v,u=_}d<f-1&&g(d,f-1,p.loop,u)}return c}function Gc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function tm(n,t){if(!t)return!1;const e=[],i=function(s,r){return To(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function or(n,t,e){return n.options.clip?n[e]:t[e]}function em(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:or(e,t,"left"),right:or(e,t,"right"),top:or(i,t,"top"),bottom:or(i,t,"bottom")}:t}function Kc(n,t){const e=t._clip;if(e.disabled)return!1;const i=em(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
11
+ */function Ke(){}const Fg=(()=>{let n=0;return()=>n++})();function st(n){return n==null}function kt(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 ht(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const zg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,cc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Dt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function St(n,t,e,i){let s,r,o;if(kt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ht(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function qs(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 Xs(n){if(kt(n))return n.map(Xs);if(ht(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Xs(n[e[s]]);return t}return n}function uc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Bg(n,t,e,i){if(!uc(n))return;const s=t[n],r=e[n];ht(s)&&ht(r)?Yi(s,r,i):t[n]=Xs(r)}function Yi(n,t,e){const i=kt(t)?t:[t],s=i.length;if(!ht(n))return n;e=e||{};const r=e.merger||Bg;let o;for(let a=0;a<s;++a){if(o=i[a],!ht(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:Hg})}function Hg(n,t,e){if(!uc(n))return;const i=t[n],s=e[n];ht(i)&&ht(s)?ji(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Xs(s))}const dc={"":n=>n,x:n=>n.x,y:n=>n.y};function Wg(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 Yg(n){const t=Wg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function yn(n,t){return(dc[t]||(dc[t]=Yg(t)))(n)}function vo(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=n=>typeof n=="function",hc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function jg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ct=Math.PI,Ot=2*ct,$g=Ot+ct,Gs=Number.POSITIVE_INFINITY,Mo=ct/180,Et=ct/2,De=ct/4,Ks=ct*2/3,bn=Math.log10,He=Math.sign;function $i(n,t,e){return Math.abs(n-t)<e}function fc(n){const t=Math.round(n);n=$i(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(bn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Vg(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 Ug(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function _n(n){return!Ug(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function qg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function gc(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 Vt(n){return n*(ct/180)}function Zs(n){return n*(180/ct)}function pc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Qs(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*ct&&(r+=Ot),{angle:r,distance:s}}function di(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Xg(n,t){return(n-t+$g)%Ot-ct}function se(n){return(n%Ot+Ot)%Ot}function Vi(n,t,e,i){const s=se(n),r=se(t),o=se(e),a=se(r-s),l=se(o-s),c=se(s-r),u=se(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function Gg(n){return Qt(n,-32768,32767)}function Ze(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function ko(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 Qe=(n,t,e,i)=>ko(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Kg=(n,t,e)=>ko(n,e,i=>n[i][t]>=e);function Zg(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 mc=["push","pop","shift","splice","unshift"];function Qg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),mc.forEach(e=>{const i="_onData"+vo(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 yc(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)&&(mc.forEach(r=>{delete n[r]}),delete n._chartjs)}function bc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const _c=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function xc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,_c.call(window,()=>{i=!1,n.apply(t,e)}))}}function Jg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Do=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,tp=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function wc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:g,maxDefined:p}=o.getUserBounds();if(g){if(s=Math.min(Qe(l,u,d).lo,e?i:Qe(t,u,o.getPixelForValue(d)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(_=>!st(_[a.axis]));s-=Math.max(0,y)}s=Qt(s,0,i-1)}if(p){let y=Math.max(Qe(l,o.axis,f,!0).hi+1,e?0:Qe(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const _=l.slice(y-1).findIndex(v=>!st(v[a.axis]));y+=Math.max(0,_)}r=Qt(y,s,i)-s}else r=i-s}return{start:s,count:r}}function vc(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 Js=n=>n===0||n===1,Mc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),kc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/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*Et)+1,easeOutSine:n=>Math.sin(n*Et),easeInOutSine:n=>-.5*(Math.cos(ct*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=>Js(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=>Js(n)?n:Mc(n,.075,.3),easeOutElastic:n=>Js(n)?n:kc(n,.075,.3),easeInOutElastic(n){return Js(n)?n:n<.5?.5*Mc(n*2,.1125,.45):.5+.5*kc(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 So(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Dc(n){return So(n)?n:new Wi(n)}function To(n){return So(n)?n:new Wi(n).saturate(.5).darken(.1).hexString()}const ep=["x","y","borderWidth","radius","tension"],np=["color","borderColor","backgroundColor"];function ip(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:np},numbers:{type:"number",properties:ep}}),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 sp(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Sc=new Map;function rp(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Sc.get(e);return i||(i=new Intl.NumberFormat(n,t),Sc.set(e,i)),i}function qi(n,t,e){return rp(t,e).format(n)}const Tc={values(n){return kt(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=op(n,e)}const o=bn(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(bn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Tc.numeric.call(this,n,t,e):""}};function op(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 tr={formatters:Tc};function ap(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:tr.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 zn=Object.create(null),Co=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 Po(n,t,e){return typeof t=="string"?Yi(Xi(n,t),e):Yi(Xi(n,""),t)}class lp{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)=>To(s.backgroundColor),this.hoverBorderColor=(i,s)=>To(s.borderColor),this.hoverColor=(i,s)=>To(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 Po(this,t,e)}get(t){return Xi(this,t)}describe(t,e){return Po(Co,t,e)}override(t,e){return Po(zn,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 ht(l)?Object.assign({},c,l):rt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new lp({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ip,sp,ap]);function cp(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function er(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 up(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,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!kt(d))o=er(n,s,r,o,d);else if(kt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!kt(f)&&(o=er(n,s,r,o,f));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 Bn(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 Cc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Oo(n,t,e,i){Pc(n,t,e,i,null)}function Pc(n,t,e,i,s){let r,o,a,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,y=t.radius;let _=(p||0)*Mo;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(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,Ot):n.arc(e,i,y,0,Ot),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(_)*u,i-Math.cos(_)*y),_+=Ks,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*y),_+=Ks,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(_+De)*l,d=Math.cos(_+De)*(s?s/2-c:l),a=Math.sin(_+De)*l,f=Math.sin(_+De)*(s?s/2-c:l),n.arc(e-d,i-a,c,_-ct,_-Et),n.arc(e+f,i-o,c,_-Et,_),n.arc(e+d,i+a,c,_,_+Et),n.arc(e-f,i+o,c,_+Et,_+ct),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}_+=De;case"rectRot":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+f,i-o),n.lineTo(e+d,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":_+=De;case"cross":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),_+=De,d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(_)*y,a=Math.sin(_)*y,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(_)*(s?s/2:y),i+Math.sin(_)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Je(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 dp(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 hp(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 fp(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 gp(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 pp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Hn(n,t,e,i,s,r={}){const o=kt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,fp(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&pp(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),gp(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function hi(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*ct,ct,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ct,Et,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Et,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Et,!0),n.lineTo(e+o.topLeft,i)}const mp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,yp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function bp(n,t){const e=(""+n).match(mp);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 _p=n=>+n||0;function Eo(n,t){const e={},i=ht(t),s=i?Object.keys(t):t,r=ht(n)?i?o=>rt(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=_p(r(o));return e}function Oc(n){return Eo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function xn(n){return Eo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=Oc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||At.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=rt(n.style,t.style);i&&!(""+i).match(yp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:rt(n.family,t.family),lineHeight:bp(rt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:rt(n.weight,t.weight),string:""};return s.string=cp(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 xp(n,t,e){const{min:i,max:s}=n,r=cc(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 wn(n,t){return Object.assign(Object.create(n),t)}function Ao(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Lc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Ao([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 Ac(a,l,()=>Cp(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Nc(a).includes(l)},ownKeys(a){return Nc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function fi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ec(n,i),setContext:r=>fi(n,r,e,i),override:r=>fi(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 Ac(r,o,()=>vp(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 Ec(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:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const wp=(n,t)=>n?n+vo(t):t,Ro=(n,t)=>ht(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ac(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function vp(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return pe(a)&&o.isScriptable(t)&&(a=Mp(t,a,n,e)),kt(a)&&a.length&&(a=kp(t,a,n,o.isIndexable)),Ro(t,a)&&(a=fi(a,s,r&&r[t],o)),a}function Mp(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),Ro(n,l)&&(l=Io(s._scopes,s,n,l)),l}function kp(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(ht(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Io(c,s,n,u);t.push(fi(d,r,o&&o[n],a))}}return t}function Rc(n,t,e){return pe(n)?n(t,e):n}const Dp=(n,t)=>n===!0?t:typeof n=="string"?yn(t,n):void 0;function Sp(n,t,e,i,s){for(const r of t){const o=Dp(e,r);if(o){n.add(o);const a=Rc(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 Io(n,t,e,i){const s=t._rootScopes,r=Rc(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Ic(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Ic(a,o,r,l,i),l===null)?!1:Ao(Array.from(a),[""],s,r,()=>Tp(t,e,i))}function Ic(n,t,e,i,s){for(;e;)e=Sp(n,t,e,i,s);return e}function Tp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return kt(s)&&ht(e)?e:s||{}}function Cp(n,t,e,i){let s;for(const r of t)if(s=Lc(wp(r,n),e),typeof s<"u")return Ro(n,s)?Io(e,i,n,s):s}function Lc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Nc(n){let t=n._keys;return t||(t=n._keys=Pp(n._scopes)),t}function Pp(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 Fc(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(yn(u,r),c)};return o}const Op=Number.EPSILON||1e-14,gi=(n,t)=>t<n.length&&!n[t].skip&&n[t],zc=n=>n==="x"?"y":"x";function Ep(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=di(r,s),l=di(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,f=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function Ap(n,t,e){const i=n.length;let s,r,o,a,l,c=gi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=gi(n,u+1),!(!l||!c)){if($i(t[u],0,Op)){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 Rp(n,t,e="x"){const i=zc(e),s=n.length;let r,o,a,l=gi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=gi(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 Ip(n,t="x"){const e=zc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=gi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=gi(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?He(s[o-1])!==He(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Ap(n,s,r),Rp(n,r,t)}function nr(n,t,e){return Math.max(Math.min(n,e),t)}function Lp(n,t){let e,i,s,r,o,a=Je(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Je(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=nr(s.cp1x,t.left,t.right),s.cp1y=nr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=nr(s.cp2x,t.left,t.right),s.cp2y=nr(s.cp2y,t.top,t.bottom)))}function Np(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Ip(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=Ep(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&&Lp(n,e)}function Lo(){return typeof window<"u"&&typeof document<"u"}function No(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ir(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 sr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Fp(n,t){return sr(n).getPropertyValue(t)}const zp=["top","right","bottom","left"];function Wn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=zp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Bp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Hp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Bp(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 vn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=sr(e),r=s.boxSizing==="border-box",o=Wn(s,"padding"),a=Wn(s,"border","width"),{x:l,y:c,box:u}=Hp(n,e),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:g,height:p}=t;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Wp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&No(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=sr(r),l=Wn(a,"border","width"),c=Wn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=ir(a.maxWidth,r,"clientWidth"),s=ir(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Gs,maxHeight:s||Gs}}const rr=n=>Math.round(n*10)/10;function Yp(n,t,e,i){const s=sr(n),r=Wn(s,"margin"),o=ir(s.maxWidth,n,"clientWidth")||Gs,a=ir(s.maxHeight,n,"clientHeight")||Gs,l=Wp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Wn(s,"border","width"),g=Wn(s,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=rr(Math.min(c,o,l.maxWidth)),u=rr(Math.min(u,a,l.maxHeight)),c&&!u&&(u=rr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=rr(Math.floor(u*i))),{width:c,height:u}}function Bc(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 jp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Lo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Hc(n,t){const e=Fp(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Yn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function $p(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 Vp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Yn(n,s,e),a=Yn(s,r,e),l=Yn(r,t,e),c=Yn(o,a,e),u=Yn(a,l,e);return Yn(c,u,e)}const Up=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}}},qp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function pi(n,t,e){return n?Up(t,e):qp()}function Wc(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 Yc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function jc(n){return n==="angle"?{between:Vi,compare:Xg,normalize:se}:{between:Ze,compare:(t,e)=>t-e,normalize:t=>t}}function $c({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 Xp(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=jc(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&o(a(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Vc(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=jc(i),{start:u,end:d,loop:f,style:g}=Xp(n,t,e),p=[];let y=!1,_=null,v,M,D;const S=()=>l(s,D,v)&&a(s,D)!==0,T=()=>a(r,v)===0||l(r,D,v),R=()=>y||S(),E=()=>!y||T();for(let b=u,x=u;b<=d;++b)M=t[b%o],!M.skip&&(v=c(M[i]),v!==D&&(y=l(v,s,r),_===null&&R()&&(_=a(v,s)===0?b:x),_!==null&&E()&&(p.push($c({start:_,end:b,loop:f,count:o,style:g})),_=null),x=b,D=v));return _!==null&&p.push($c({start:_,end:d,loop:f,count:o,style:g})),p}function Uc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=Vc(i[s],n.points,t);r.length&&e.push(...r)}return e}function Gp(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 Kp(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 Zp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=Gp(e,s,r,i);if(i===!0)return qc(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 qc(n,Kp(e,o,l,c),e,t)}function qc(n,t,e,i){return!i||!i.setContext||!e?t:Qp(n,t,e,i)}function Qp(n,t,e,i){const s=n._chart.getContext(),r=Xc(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,f=d;function g(p,y,_,v){const M=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=M;for(;e[y%l].skip;)y+=M;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:_,style:v}),u=v,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],_;for(f=d+1;f<=p.end;f++){const v=e[f%l];_=Xc(i.setContext(wn(s,{type:"segment",p0:y,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Jp(_,u)&&g(d,f-1,p.loop,u),y=v,u=_}d<f-1&&g(d,f-1,p.loop,u)}return c}function Xc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Jp(n,t){if(!t)return!1;const e=[],i=function(s,r){return So(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function or(n,t,e){return n.options.clip?n[e]:t[e]}function tm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:or(e,t,"left"),right:or(e,t,"right"),top:or(i,t,"top"),bottom:or(i,t,"bottom")}:t}function Gc(n,t){const e=t._clip;if(e.disabled)return!1;const i=tm(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
12
12
  * Chart.js v4.5.0
13
13
  * https://www.chartjs.org
14
14
  * (c) 2025 Chart.js Contributors
15
15
  * Released under the MIT License
16
- */class nm{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=xc.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 tn=new nm;const Zc="transparent",im={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Sc(n||Zc),s=i.valid&&Sc(t||Zc);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class sm{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||im[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 zo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ht(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ht(r))return;const o={};for(const a of e)o[a]=r[a];(kt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=om(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&rm(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 f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=d=new sm(f,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 tn.add(this._chart,i),!0}}function rm(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 om(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 Qc(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 am(n,t,e){if(e===!1)return!1;const i=Qc(n,e),s=Qc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function lm(n){let t,e,i,s;return ht(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 Jc(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 tu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||He(t)===He(c))&&(t+=c)}return!u&&!i.all?0:t}function cm(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 Bo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function um(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function dm(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 hm(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function eu(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 nu(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=um(r,o,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:_}=p,v=p._stacks||(p._stacks={});f=v[c]=hm(s,u,y),f[a]=_,f._top=eu(f,o,!0,i.type),f._bottom=eu(f,o,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=_}}function Ho(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function fm(n,t){return wn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function gm(n,t,e){return wn(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 Wo=n=>n==="reset"||n==="none",iu=(n,t)=>t?n:Object.assign({},n),pm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Jc(e,!0),values:null};class Ie{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=Bo(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,f,g,p)=>d==="x"?f:d==="r"?p:g,r=e.xAxisID=rt(i.xAxisID,Ho(t,"x")),o=e.yAxisID=rt(i.yAxisID,Ho(t,"y")),a=e.rAxisID=rt(i.rAxisID,Ho(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&&bc(this._data,this),t._stacked&&Qi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ht(e)){const s=this._cachedMeta;this._data=cm(e,s)}else if(i!==e){if(i){bc(i,this);const s=this._cachedMeta;Qi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Jg(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=Bo(e.vScale,e),e.stack!==i.stack&&(s=!0,Qi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(nu(this,e._parsed),e._stacked=Bo(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,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{kt(s[t])?f=this.parseArrayData(i,s,t,e):ht(s[t])?f=this.parseObjectData(i,s,t,e):f=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=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&nu(this,f)}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 f,g,p;for(f=0,g=s;f<g;++f)p=f+i,d[f]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,f,g;for(u=0,d=s;u<d;++u)f=u+i,g=e[f],c[u]={x:r.parse(yn(g,a),f),y:o.parse(yn(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Jc(s,!0),values:e._stacks[t.axis]._visualValues};return tu(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=tu(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=pm(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=dm(a);let f,g;function p(){g=s[f];const y=g[a.axis];return!Rt(g[t.axis])||u>y||d<y}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(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=lm(rt(this.options.clip,am(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=gm(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=fm(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&&ge(i);if(a)return iu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(At.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(f,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(iu(y,l))),y}_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),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new zo(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||Wo(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){Wo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Wo(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])}}O(Ie,"defaults",{}),O(Ie,"datasetElementType",null),O(Ie,"dataElementType",null);function mm(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=_c(i.sort((s,r)=>s-r))}return n._cache.$bar}function ym(n){const t=n.iScale,e=mm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(ge(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 bm(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 _m(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 xm(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 su(n,t,e,i){return kt(n)?xm(n,t,e,i):t[e.axis]=e.parse(n,i),t}function ru(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(su(f,d,r,c));return l}function Yo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function wm(n,t,e){return n!==0?He(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function vm(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 Mm(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}=vm(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[ou(u,o,a,l)]=!0,s=c)),r[ou(s,o,a,l)]=!0,n.borderSkipped=r}function ou(n,t,e,i){return i?(n=km(n,t,e),n=au(n,e,t)):n=au(n,t,e),n}function km(n,t,e){return n===t?e:n===e?t:n}function au(n,t,e){return n==="start"?t:n==="end"?e:n}function Dm(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ji extends Ie{parsePrimitiveData(t,e,i,s){return ru(t,e,i,s)}parseArrayData(t,e,i,s){return ru(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 f,g,p,y;for(f=i,g=i+s;f<g;++f)y=e[f],p={},p[r.axis]=r.parse(yn(y,c),f),d.push(su(yn(y,u),p,o,f));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=Yo(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:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),y=r||st(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),_=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[a.axis],M={horizontal:c,base:y.base,enableBorderRadius:!v||Yo(p._custom)||o===v._top||o===v._bottom,x:c?y.head:_.center,y:c?_.center:y.head,height:c?_.size:Math.abs(y.size),width:c?Math.abs(y.size):_.size};f&&(M.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=M.options||t[g].options;Mm(M,D,v,o),Dm(M,D,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,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),f=d&&d[u.vScale.axis];if(st(f)||isNaN(f))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}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,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||ym(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=Yo(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&He(d)!==He(c.barEnd)&&(f=0),f+=d);const _=!st(r)&&!u?r:f;let v=e.getPixelForValue(_);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=v,y=p-v,Math.abs(y)<o){y=wm(y,e,a)*o,d===a&&(v-=y/2);const M=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),S=Math.min(M,D),T=Math.max(M,D);v=Math.max(Math.min(v,T),S),p=v+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(a)){const M=He(y)*e.getLineWidthForValue(a)/2;v+=M,y-=M}return{size:y,base:v,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=rt(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,d=s.barThickness==="flex"?_m(t,e,s,u*c):bm(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+g;a=d.start+d.chunk*p+d.chunk/2,l=Math.min(o,d.chunk*d.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)}}O(Ji,"id","bar"),O(Ji,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),O(Ji,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ar extends Ie{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=rt(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=rt(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 f=e;f<e+i;f++){const g=t[f],p=!r&&this.getParsed(f),y={},_=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),v=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(_)||isNaN(v),c&&(y.options=l||this.resolveDataElementOptions(f,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,f,y,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=rt(i&&i._custom,r),s}}O(ar,"id","bubble"),O(ar,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),O(ar,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Sm(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ot){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(D,S,T)=>Vi(D,a,l,!0)?1:Math.max(S,S*e,T,T*e),p=(D,S,T)=>Vi(D,a,l,!0)?-1:Math.min(S,S*e,T,T*e),y=g(0,c,d),_=g(Et,u,f),v=p(ct,c,d),M=p(ct+Et,u,f);i=(y-v)/2,s=(_-M)/2,r=-(y+v)/2,o=-(_+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class en extends Ie{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(ht(i[t])){const{key:l="value"}=this._parsing;r=c=>+yn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;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(Bg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=Sm(d,u,l),_=(i.width-o)/f,v=(i.height-o)/g,M=Math.max(Math.min(_,v)/2,0),D=uc(this.options.radius,M),S=Math.max(D*l,0),T=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=y*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/Ot)}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,f=r&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:_}=this._getSharedOptions(e,s);let v=this._getRotation(),M;for(M=0;M<e;++M)v+=this._circumference(M,r);for(M=e;M<e+i;++M){const D=this._circumference(M,r),S=t[M],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:p,innerRadius:g};_&&(T.options=y||this.resolveDataElementOptions(M,S.active?"active":s)),v+=D,this.updateElement(S,M,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)?Ot*(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(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}O(en,"id","doughnut"),O(en,"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"}),O(en,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(en,"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 Ie{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}=vc(e,s,o);this._drawStart=a,this._drawCount=l,Mc(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),f=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,_=_n(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",M=e+i,D=t.length;let S=e>0&&this.getParsed(e-1);for(let T=0;T<D;++T){const R=t[T],E=v?R:{};if(T<e||T>=M){E.skip=!0;continue}const b=this.getParsed(T),x=st(b[g]),P=E[f]=o.getPixelForValue(b[f],T),I=E[g]=r||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,b,l):b[g],T);E.skip=isNaN(P)||isNaN(I)||x,E.stop=T>0&&Math.abs(b[f]-S[f])>_,y&&(E.parsed=b,E.raw=c.data[T]),d&&(E.options=u||this.resolveDataElementOptions(T,R.active?"active":s)),v||this.updateElement(R,T,E,s),S=b}}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()}}O(ts,"id","line"),O(ts,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(ts,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class es extends Ie{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 zc.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,f=c.getIndexAngle(0)-.5*ct;let g=f,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,y);for(p=e;p<e+i;p++){const _=t[p];let v=g,M=g+this._computeAngle(p,s,y),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=M,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=M=f));const S={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:v,endAngle:M,options:this.resolveDataElementOptions(p,_.active?"active":s)};this.updateElement(_,p,S,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Vt(this.resolveDataElementOptions(t,e).angle||i):0}}O(es,"id","polarArea"),O(es,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(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 jo extends en{}O(jo,"id","pie"),O(jo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class lr extends Ie{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 zc.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,f=o?r.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,g,s)}}}O(lr,"id","radar"),O(lr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),O(lr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class cr extends Ie{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}=vc(e,i,s);if(this._drawStart=r,this._drawCount=o,Mc(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),f=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:_}=this.options,v=_n(y)?y:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let S=e;S<e+i;++S){const T=t[S],R=this.getParsed(S),E=M?T:{},b=st(R[p]),x=E[g]=o.getPixelForValue(R[g],S),P=E[p]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[p],S);E.skip=isNaN(x)||isNaN(P)||b,E.stop=S>0&&Math.abs(R[g]-D[g])>v,_&&(E.parsed=R,E.raw=c.data[S]),f&&(E.options=d||this.resolveDataElementOptions(S,T.active?"active":s)),M||this.updateElement(T,S,E,s),D=R}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}O(cr,"id","scatter"),O(cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Tm=Object.freeze({__proto__:null,BarController:Ji,BubbleController:ar,DoughnutController:en,LineController:ts,PieController:jo,PolarAreaController:es,RadarController:lr,ScatterController:cr});function jn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class $o{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign($o.prototype,t)}init(){}formats(){return jn()}parse(){return jn()}format(){return jn()}add(){return jn()}diff(){return jn()}startOf(){return jn()}endOf(){return jn()}}var lu={_date:$o};function Cm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?Zg:Qe;if(i){if(s._sharedOptions){const u=r[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(r,t,e-d),g=c(r,t,e+d);return{lo:f.lo,hi:g.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:d}=s._cachedMeta,{_parsed:f}=n,g=f.slice(0,u.lo+1).reverse().findIndex(y=>!st(y[d.axis]));u.lo-=Math.max(0,g);const p=f.slice(u.hi).findIndex(y=>!st(y[d.axis]));u.hi+=Math.max(0,p)}return u}}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:f}=Cm(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Pm(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 Vo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ns(n,e,t,function(a,l,c){!s&&!Je(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Om(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Qs(o,{x:t.x,y:t.y});Vi(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ns(n,e,t,r),s}function Em(n,t,e,i,s,r){let o=[];const a=Pm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const _=a(t,p);_<l?(o=[{element:u,datasetIndex:d,index:f}],l=_):_===l&&o.push({element:u,datasetIndex:d,index:f})}return ns(n,e,t,c),o}function Uo(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Om(n,t,e,s):Em(n,t,e,i,s,r)}function cu(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 qo={evaluateInteractionItems:ns,modes:{index(n,t,e,i){const s=vn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Vo(n,s,r,i,o):Uo(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=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Vo(n,s,r,i,o):Uo(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=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Vo(n,s,r,i,o)},nearest(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Uo(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=vn(t,n);return cu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=vn(t,n);return cu(n,s,"y",e.intersect,i)}}};const uu=["left","top","right","bottom"];function is(n,t){return n.filter(e=>e.pos===t)}function du(n,t){return n.filter(e=>uu.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 Am(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 Rm(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!uu.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 Im(n,t){const e=Rm(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 Lm(n){const t=Am(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=du(t,"x"),l=du(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 hu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function fu(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 Nm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!ht(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&&fu(o,r.getPadding());const a=Math.max(0,t.outerWidth-hu(o,n,"left","right")),l=Math.max(0,t.outerHeight-hu(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 Fm(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 zm(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,zm(a.horizontal,t));const{same:d,other:f}=Nm(t,e,a,i);c|=d&&s.length,u=u||f,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 gu(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]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;ge(c.start)&&(o=c.start),l.fullSize?ur(l,s.left,o,e.outerWidth-s.right-s.left,f):ur(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?ur(l,r,s.top,f,e.outerHeight-s.bottom-s.top):ur(l,r,t.top+c.placed,f,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var oe={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=Ut(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Lm(n.boxes),l=a.vertical,c=a.horizontal;St(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,_)=>_.box.options&&_.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);fu(f,Ut(i));const g=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),p=Im(l.concat(c),d);rs(a.fullSize,g,d,p),rs(l,g,d,p),rs(c,g,d,p)&&rs(l,g,d,p),Fm(g),gu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,gu(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},St(a.chartArea,y=>{const _=y.box;Object.assign(_,n.chartArea),_.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class pu{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 Bm extends pu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const dr="$chartjs",Hm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mu=n=>n===null||n==="";function Wm(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",mu(s)){const r=Wc(n,"width");r!==void 0&&(n.width=r)}if(mu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Wc(n,"height");r!==void 0&&(n.height=r)}return n}const yu=$p?{passive:!0}:!1;function Ym(n,t,e){n&&n.addEventListener(t,e,yu)}function jm(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,yu)}function $m(n,t){const e=Hm[n.type]||n.type,{x:i,y:s}=vn(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 Vm(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 Um(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 bu=0;function _u(){const n=window.devicePixelRatio;n!==bu&&(bu=n,os.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function qm(n,t){os.size||window.addEventListener("resize",_u),os.set(n,t)}function Xm(n){os.delete(n),os.size||window.removeEventListener("resize",_u)}function Gm(n,t,e){const i=n.canvas,s=i&&Fo(i);if(!s)return;const r=wc((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),qm(n,r),o}function Xo(n,t,e){e&&e.disconnect(),t==="resize"&&Xm(n)}function Km(n,t,e){const i=n.canvas,s=wc(r=>{n.ctx!==null&&e($m(r,n))},n);return Ym(i,t,s),s}class Zm extends pu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Wm(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:Vm,detach:Um,resize:Gm}[e]||Km;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Xo,detach:Xo,resize:Xo}[e]||jm)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return jp(t,e,i,s)}isAttached(t){const e=t&&Fo(t);return!!(e&&e.isConnected)}}function Qm(n){return!No()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Bm:Zm}class Jt{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _n(this.x)&&_n(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}}O(Jt,"defaults",{}),O(Jt,"defaultRoutes");function Jm(n,t){const e=n.options.ticks,i=ty(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?ny(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return iy(t,c,r,o/s),c;const u=ey(r,t,s);if(o>0){let d,f;const g=o>1?Math.round((l-a)/(o-1)):null;for(fr(t,c,u,st(g)?0:a-g,a),d=0,f=o-1;d<f;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 ty(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 ey(n,t,e){const i=sy(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Ug(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 ny(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function iy(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=rt(i,0),o=Math.min(rt(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 sy(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 ry=n=>n==="left"?"right":n==="right"?"left":n,xu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,wu=(n,t)=>Math.min(t||n,n);function vu(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 oy(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 ay(n,t){St(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function as(n){return n.drawTicks?n.tickLength:0}function Mu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(kt(n.text)?n.text.length:1)*e.lineHeight+i.height}function ly(n,t){return wn(n,{scale:t,type:"scale"})}function cy(n,t,e){return wn(n,{tick:e,index:t,type:"tick"})}function uy(n,t,e){let i=So(n);return(e&&t!=="right"||!e&&t==="right")&&(i=ry(i)),i}function dy(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const y=o-s,_=a-r;if(n.isHorizontal()){if(g=re(i,r,a),ht(e)){const v=Object.keys(e)[0],M=e[v];p=u[v].getPixelForValue(M)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=xu(n,e,t);f=a-r}else{if(ht(e)){const v=Object.keys(e)[0],M=e[v];g=u[v].getPixelForValue(M)-_+t}else e==="center"?g=(c.left+c.right)/2-_+t:g=xu(n,e,t);p=re(i,o,s),d=e==="left"?-Et:Et}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class $n extends Jt{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=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(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:Me(e,Me(i,e)),max:Me(i,Me(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(){Dt(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=wp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?vu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Jm(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(){Dt(this.options.afterUpdate,[this])}beforeSetDimensions(){Dt(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(){Dt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Dt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Dt(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=Dt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){Dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=wu(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,f=u.highest.height,g=Qt(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-Mu(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Zs(Math.min(Math.asin(Qt((u.highest.height+6)/a,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Dt(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=Mu(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:f}=this._getLabelSizes(),g=i.padding*2,p=Vt(this.labelRotation),y=Math.cos(p),_=Math.sin(p);if(a){const v=i.mirror?0:_*d.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:y*d.width+_*f.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,_,y)}}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 f=0,g=0;l?c?(f=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-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(){Dt(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=vu(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/wu(e,i));let c=0,u=0,d,f,g,p,y,_,v,M,D,S,T;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=_=y.string,v=r[_]=r[_]||{data:{},gc:[]},M=y.lineHeight,D=S=0,!st(p)&&!kt(p))D=er(s,v.data,v.gc,D,p),S=M;else if(kt(p))for(f=0,g=p.length;f<g;++f)T=p[f],!st(T)&&!kt(T)&&(D=er(s,v.data,v.gc,D,T),S+=M);o.push(D),a.push(S),c=Math.max(D,c),u=Math.max(S,u)}ay(r,e);const R=o.indexOf(c),E=a.indexOf(u),b=x=>({width:o[x]||0,height:a[x]||0});return{first:b(0),last:b(e-1),widest:b(R),highest:b(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 Kg(this._alignToPixels?Bn(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=cy(this.getContext(),t,i))}return this.$context||(this.$context=ly(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Vt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),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),f=as(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,_=y/2,v=function(J){return Bn(i,J,y)};let M,D,S,T,R,E,b,x,P,I,C,F;if(o==="top")M=v(this.bottom),E=this.bottom-f,x=M-_,I=v(t.top)+_,F=t.bottom;else if(o==="bottom")M=v(this.top),I=t.top,F=v(t.bottom)-_,E=M+_,x=this.top+f;else if(o==="left")M=v(this.right),R=this.right-f,b=M-_,P=v(t.left)+_,C=t.right;else if(o==="right")M=v(this.left),P=t.left,C=v(t.right)-_,R=M+_,b=this.left+f;else if(e==="x"){if(o==="center")M=v((t.top+t.bottom)/2+.5);else if(ht(o)){const J=Object.keys(o)[0],U=o[J];M=v(this.chart.scales[J].getPixelForValue(U))}I=t.top,F=t.bottom,E=M+_,x=E+f}else if(e==="y"){if(o==="center")M=v((t.left+t.right)/2);else if(ht(o)){const J=Object.keys(o)[0],U=o[J];M=v(this.chart.scales[J].getPixelForValue(U))}R=M-_,b=R-f,P=t.left,C=t.right}const q=rt(s.ticks.maxTicksLimit,d),G=Math.max(1,Math.ceil(d/q));for(D=0;D<d;D+=G){const J=this.getContext(D),U=r.setContext(J),ut=a.setContext(J),V=U.lineWidth,K=U.color,B=ut.dash||[],j=ut.dashOffset,H=U.tickWidth,xt=U.tickColor,mt=U.tickBorderDash||[],vt=U.tickBorderDashOffset;S=oy(this,D,l),S!==void 0&&(T=Bn(i,S,V),c?R=b=P=C=T:E=x=I=F=T,g.push({tx1:R,ty1:E,tx2:b,ty2:x,x1:P,y1:I,x2:C,y2:F,width:V,color:K,borderDash:B,borderDashOffset:j,tickWidth:H,tickColor:xt,tickBorderDash:mt,tickBorderDashOffset:vt}))}return this._ticksLength=d,this._borderValue=M,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,f=as(i.grid),g=f+u,p=d?-u:g,y=-Vt(this.labelRotation),_=[];let v,M,D,S,T,R,E,b,x,P,I,C,F="middle";if(s==="top")R=this.bottom-p,E=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+p,E=this._getXAxisLabelAlignment();else if(s==="left"){const G=this._getYAxisLabelAlignment(f);E=G.textAlign,T=G.x}else if(s==="right"){const G=this._getYAxisLabelAlignment(f);E=G.textAlign,T=G.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+g;else if(ht(s)){const G=Object.keys(s)[0],J=s[G];R=this.chart.scales[G].getPixelForValue(J)+g}E=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")T=(t.left+t.right)/2-g;else if(ht(s)){const G=Object.keys(s)[0],J=s[G];T=this.chart.scales[G].getPixelForValue(J)}E=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const q=this._getLabelSizes();for(v=0,M=a.length;v<M;++v){D=a[v],S=D.label;const G=r.setContext(this.getContext(v));b=this.getPixelForTick(v)+r.labelOffset,x=this._resolveTickFontOptions(v),P=x.lineHeight,I=kt(S)?S.length:1;const J=I/2,U=G.color,ut=G.textStrokeColor,V=G.textStrokeWidth;let K=E;o?(T=b,E==="inner"&&(v===M-1?K=this.options.reverse?"left":"right":v===0?K=this.options.reverse?"right":"left":K="center"),s==="top"?c==="near"||y!==0?C=-I*P+P/2:c==="center"?C=-q.highest.height/2-J*P+P:C=-q.highest.height+P/2:c==="near"||y!==0?C=P/2:c==="center"?C=q.highest.height/2-J*P:C=q.highest.height-I*P,d&&(C*=-1),y!==0&&!G.showLabelBackdrop&&(T+=P/2*Math.sin(y))):(R=b,C=(1-I)*P/2);let B;if(G.showLabelBackdrop){const j=Ut(G.backdropPadding),H=q.heights[v],xt=q.widths[v];let mt=C-j.top,vt=0-j.left;switch(F){case"middle":mt-=H/2;break;case"bottom":mt-=H;break}switch(E){case"center":vt-=xt/2;break;case"right":vt-=xt;break;case"inner":v===M-1?vt-=xt:v>0&&(vt-=xt/2);break}B={left:vt,top:mt,width:xt+j.width,height:H+j.height,color:G.backdropColor}}_.push({label:S,font:x,textOffset:C,options:{rotation:y,color:U,strokeColor:ut,strokeWidth:V,textAlign:K,textBaseline:F,translation:[T,R],backdrop:B}})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Vt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,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,f;this.isHorizontal()?(c=Bn(t,this.left,o)-o/2,u=Bn(t,this.right,a)+a/2,d=f=l):(d=Bn(t,this.top,o)-o/2,f=Bn(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,f),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;Hn(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=It(i.font),o=Ut(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ht(e)?(l+=o.bottom,kt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=dy(this,l,e,a);Hn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:uy(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=rt(t.grid&&t.grid.z,-1),s=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$n.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 It(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;gy(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,hy(t,o,i),this.override&&At.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 At[s]&&(delete At[s][i],this.override&&delete zn[i])}}function hy(n,t,e){const i=Yi(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&fy(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function fy(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(".");At.route(r,s,l,a)})}function gy(n){return"id"in n&&"defaults"in n}class py{constructor(){this.controllers=new gr(Ie,"datasets",!0),this.elements=new gr(Jt,"elements"),this.plugins=new gr(Object,"plugins"),this.scales=new gr($n,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):St(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=Mo(t);Dt(i["before"+s],[],i),e[t](i),Dt(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 We=new py;class my{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(Dt(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=rt(i.options&&i.options.plugins,{}),r=yy(i);return s===!1&&!e?[]:_y(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,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 yy(n){const t={},e=[],i=Object.keys(We.plugins.items);for(let r=0;r<i.length;r++)e.push(We.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 by(n,t){return!t&&n===!1?null:n===!0?{}:n}function _y(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=by(i[l],s);c!==null&&r.push({plugin:a,options:xy(n.config,{plugin:a,local:e[l]},c,o)})}return r}function xy(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 Go(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function wy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function vy(n,t){return n===t?"_index_":"_value_"}function ku(n){if(n==="x"||n==="y"||n==="r")return n}function My(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Ko(n,...t){if(ku(n))return n;for(const e of t){const i=e.axis||My(e.position)||n.length>1&&ku(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Du(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function ky(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 Du(n,"x",e[0])||Du(n,"y",e[0])}return{}}function Dy(n,t){const e=zn[n.type]||{scales:{}},i=t.scales||{},s=Go(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ht(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=Ko(o,a,ky(o,n),At.scales[a.type]),c=vy(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||Go(a,t),u=(zn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=wy(d,l),g=o[f+"AxisID"]||f;r[g]=r[g]||Object.create(null),ji(r[g],[{axis:f},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ji(a,[At.scales[a.type],At.scale])}),r}function Su(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=Dy(n,t)}function Tu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Sy(n){return n=n||{},n.data=Tu(n.data),Su(n),n}const Cu=new Map,Pu=new Set;function pr(n,t){let e=Cu.get(n);return e||(e=t(),Cu.set(n,e),Pu.add(e)),e}const ls=(n,t,e)=>{const i=yn(t,e);i!==void 0&&n.add(i)};class Ty{constructor(t){this._config=Sy(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=Tu(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(),Su(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,zn[r]||{},d)),u.forEach(d=>ls(l,At,d)),u.forEach(d=>ls(l,Po,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Pu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,zn[e]||{},At.datasets[e]||{},{type:e},At,Po]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Ou(this._resolverCache,t,s);let l=o;if(Py(o,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,a);l=fi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Ou(this._resolverCache,t,i);return ht(e)?fi(r,e,void 0,s):r}}function Ou(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:Ro(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Cy=n=>ht(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function Py(n,t){const{isScriptable:e,isIndexable:i}=Ac(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(pe(a)||Cy(a))||o&&kt(a))return!0}return!1}var Oy="4.5.0";const Ey=["top","bottom","left","right","chartArea"];function Eu(n,t){return n==="top"||n==="bottom"||Ey.indexOf(n)===-1&&t==="x"}function Au(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Ru(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Dt(e&&e.onComplete,[n],t)}function Ay(n){const t=n.chart,e=t.options.animation;Dt(e&&e.onProgress,[n],t)}function Iu(n){return No()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const mr={},Lu=n=>{const t=Iu(n);return Object.values(mr).filter(e=>e.canvas===t).pop()};function Ry(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 Iy(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let Se=(En=class{static register(...t){We.add(...t),Nu()}static unregister(...t){We.remove(...t),Nu()}constructor(t,e){const i=this.config=new Ty(e),s=Iu(t),r=Lu(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||Qm(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=zg(),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 my,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=tp(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}tn.listen(this,"complete",Ru),tn.listen(this,"progress",Ay),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 We}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Pc(this.canvas,this.ctx),this}stop(){return tn.stop(this),this}resize(t,e){tn.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,Hc(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Dt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};St(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Ko(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(r,o=>{const a=o.options,l=a.id,c=Ko(l,a),u=rt(a.type,o.dtype);(a.position===void 0||Eu(a.position,c)!==Eu(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 f=We.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),St(s,(o,a)=>{o||delete i[a]}),St(i,o=>{oe.configure(this,o,o.options),oe.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(Au("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||Go(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=We.getController(a),{datasetElementType:c,dataElementType:u}=At.datasets[a];Object.assign(l,{dataElementType:We.getElement(u),datasetElementType:c&&We.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){St(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||St(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Au("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){St(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!fc(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;Ry(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(!fc(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;oe.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],St(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(tn.has(this)?this.attached&&!tn.running(this)&&tn.start(this):(this.draw(),Ru({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={meta:t,index:t.index,cancelable:!0},s=Kc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Gi(e,s),t.controller.draw(),s&&Ki(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=qo.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=wn(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);ge(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(),tn.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(),Pc(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)};St(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let 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(){St(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},St(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,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}});!qs(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=$g(t),c=Iy(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Dt(r.onHover,[t,a,this],this),l&&Dt(r.onClick,[t,a,this],this));const u=!qs(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)}},O(En,"defaults",At),O(En,"instances",mr),O(En,"overrides",zn),O(En,"registry",We),O(En,"version",Oy),O(En,"getChart",Lu),En);function Nu(){return St(Se.instances,n=>n._plugins.invalidate())}function Ly(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/o,se(i-e));if(n.beginPath(),n.arc(s,r,o-c/2,i+d/2,e-d/2),a>0){const f=Math.min(c/a,se(i-e));n.arc(s,r,a+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,o*se(i-e));if(u==="round")n.arc(s,r,f,e-ct/2,i+ct/2,!0);else if(u==="bevel"){const g=2*f*f,p=-g*Math.cos(e+ct/2)+s,y=-g*Math.sin(e+ct/2)+r,_=g*Math.cos(i+ct/2)+s,v=g*Math.sin(i+ct/2)+r;n.lineTo(p,y),n.lineTo(_,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function Ny(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+Et,i-Et),n.closePath(),n.clip()}function Fy(n){return Ao(n,["outerStart","outerEnd","innerStart","innerEnd"])}function zy(n,t,e,i){const s=Fy(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 Qt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Qt(s.innerStart,0,o),innerEnd:Qt(s.innerEnd,0,o)}}function mi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function yr(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),f=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const G=u>0?u-i:0,J=d>0?d-i:0,U=(G+J)/2,ut=U!==0?p*U/(U+i):p;g=(p-ut)/2}const y=Math.max(.001,p*d-e/ct)/d,_=(p-y)/2,v=l+_+g,M=s-_-g,{outerStart:D,outerEnd:S,innerStart:T,innerEnd:R}=zy(t,f,d,M-v),E=d-D,b=d-S,x=v+D/E,P=M-S/b,I=f+T,C=f+R,F=v+T/I,q=M-R/C;if(n.beginPath(),r){const G=(x+P)/2;if(n.arc(o,a,d,x,G),n.arc(o,a,d,G,P),S>0){const V=mi(b,P,o,a);n.arc(V.x,V.y,S,P,M+Et)}const J=mi(C,M,o,a);if(n.lineTo(J.x,J.y),R>0){const V=mi(C,q,o,a);n.arc(V.x,V.y,R,M+Et,q+Math.PI)}const U=(M-R/f+(v+T/f))/2;if(n.arc(o,a,f,M-R/f,U,!0),n.arc(o,a,f,U,v+T/f,!0),T>0){const V=mi(I,F,o,a);n.arc(V.x,V.y,T,F+Math.PI,v-Et)}const ut=mi(E,v,o,a);if(n.lineTo(ut.x,ut.y),D>0){const V=mi(E,x,o,a);n.arc(V.x,V.y,D,v-Et,x)}}else{n.moveTo(o,a);const G=Math.cos(x)*d+o,J=Math.sin(x)*d+a;n.lineTo(G,J);const U=Math.cos(P)*d+o,ut=Math.sin(P)*d+a;n.lineTo(U,ut)}n.closePath()}function By(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){yr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ot||Ot))}return yr(n,t,e,i,l,s),n.fill(),l}function Hy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let y=t.endAngle;if(r){yr(n,t,e,i,y,s);for(let _=0;_<r;++_)n.stroke();isNaN(a)||(y=o+(a%Ot||Ot))}p&&Ny(n,t,y),l.selfJoin&&y-o>=ct&&g===0&&u!=="miter"&&Ly(n,t,y),r||(yr(n,t,e,i,y,s),n.stroke())}class cs extends Jt{constructor(e){super();O(this,"circumference");O(this,"endAngle");O(this,"fullCircles");O(this,"innerRadius");O(this,"outerRadius");O(this,"pixelMargin");O(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}=Qs(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=rt(f,c-l),y=Vi(o,l,c)&&l!==c,_=p>=Ot||y,v=Ze(a,u+g,d+g);return _&&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,f=(a+l+u+c)/2;return{x:i+Math.cos(d)*f,y:s+Math.sin(d)*f}}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>Ot?Math.floor(s/Ot):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(ct,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,By(e,this,u,o,a),Hy(e,this,u,o,a),e.restore()}}O(cs,"id","arc"),O(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,selfJoin:!1}),O(cs,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(cs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Fu(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function Wy(n,t,e){n.lineTo(e.x,e.y)}function Yy(n){return n.stepped?hp:n.tension||n.cubicInterpolationMode==="monotone"?fp:Wy}function zu(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 jy(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=zu(s,e,i),u=Yy(r);let{move:d=!0,reverse:f}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,f,r.stepped),y=p);return l&&(p=s[(a+(f?c:0))%o],u(n,y,p,f,r.stepped)),!!l}function $y(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=zu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,y,_,v;const M=S=>(o+(c?a-S:S))%r,D=()=>{y!==_&&(n.lineTo(u,_),n.lineTo(u,y),n.lineTo(u,v))};for(l&&(g=s[M(0)],n.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[M(f)],g.skip)continue;const S=g.x,T=g.y,R=S|0;R===p?(T<y?y=T:T>_&&(_=T),u=(d*u+S)/++d):(D(),n.lineTo(S,T),p=R,d=0,y=_=T),v=T}D()}function Zo(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?$y:jy}function Vy(n){return n.stepped?Vp:n.tension||n.cubicInterpolationMode==="monotone"?Up:Yn}function Uy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Fu(n,t.options),n.stroke(s)}function qy(n,t,e,i){const{segments:s,options:r}=t,o=Zo(t);for(const a of s)Fu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Xy=typeof Path2D=="function";function Gy(n,t,e,i){Xy&&!t.options.segment?Uy(n,t,e,i):qy(n,t,e,i)}class Mn extends Jt{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;Fp(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=Qp(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=qc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Vy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],g=r[d],p=r[f];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),_=l(g,p,y,i.stepped);_[e]=t[e],a.push(_)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Zo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Zo(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(),Gy(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}O(Mn,"id","line"),O(Mn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),O(Mn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),O(Mn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Bu(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class br extends Jt{constructor(e){super();O(this,"parsed");O(this,"skip");O(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 Bu(this,e,"x",i)}inYRange(e,i){return Bu(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||!Je(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Eo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}O(br,"id","point"),O(br,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),O(br,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hu(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 kn(n,t,e,i){return n?0:Qt(t,e,i)}function Ky(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Ec(i);return{t:kn(s.top,r.top,0,e),r:kn(s.right,r.right,0,t),b:kn(s.bottom,r.bottom,0,e),l:kn(s.left,r.left,0,t)}}function Zy(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=xn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||ht(s);return{topLeft:kn(!l||a.top||a.left,r.topLeft,0,o),topRight:kn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:kn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:kn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Qy(n){const t=Hu(n),e=t.right-t.left,i=t.bottom-t.top,s=Ky(n,e/2,i/2),r=Zy(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 Qo(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Hu(n,i);return a&&(s||Ze(t,a.left,a.right))&&(r||Ze(e,a.top,a.bottom))}function Jy(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function tb(n,t){n.rect(t.x,t.y,t.w,t.h)}function Jo(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 _r extends Jt{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}=Qy(this),a=Jy(o.radius)?hi:tb;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Jo(o,e,r)),t.clip(),a(t,Jo(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Jo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Qo(this,t,e,i)}inXRange(t,e){return Qo(this,t,null,e)}inYRange(t,e){return Qo(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}}O(_r,"id","bar"),O(_r,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),O(_r,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var eb=Object.freeze({__proto__:null,ArcElement:cs,BarElement:_r,LineElement:Mn,PointElement:br});const ta=["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)"],Wu=ta.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Yu(n){return ta[n%ta.length]}function ju(n){return Wu[n%Wu.length]}function nb(n,t){return n.borderColor=Yu(t),n.backgroundColor=ju(t),++t}function ib(n,t){return n.backgroundColor=n.data.map(()=>Yu(t++)),t}function sb(n,t){return n.backgroundColor=n.data.map(()=>ju(t++)),t}function rb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof en?t=ib(e,t):s instanceof es?t=sb(e,t):s&&(t=nb(e,t))}}function $u(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function ob(n){return n&&(n.borderColor||n.backgroundColor)}function ab(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var lb={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=$u(i)||ob(s)||r&&$u(r)||ab();if(!e.forceOverride&&o)return;const a=rb(n);i.forEach(a)}};function cb(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,f,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let _=0,v=0,M;const D=Math.floor((d+1)*a)+1+t,S=Math.min(Math.floor((d+2)*a)+1,e)+t,T=S-D;for(M=D;M<S;M++)_+=n[M].x,v+=n[M].y;_/=T,v/=T;const R=Math.floor(d*a)+1+t,E=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:b,y:x}=n[u];for(g=p=-1,M=R;M<E;M++)p=.5*Math.abs((b-_)*(n[M].y-x)-(b-n[M].x)*(v-x)),p>g&&(g=p,f=n[M],y=M);o[l++]=f,u=y}return o[l++]=n[c],o}function ub(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,f,g,p,y;const _=[],v=t+e-1,M=n[t].x,S=n[v].x-M;for(o=t;o<t+e;++o){a=n[o],l=(a.x-M)/S*i,c=a.y;const T=l|0;if(T===u)c<p?(p=c,d=o):c>y&&(y=c,f=o),s=(r*s+a.x)/++r;else{const R=o-1;if(!st(d)&&!st(f)){const E=Math.min(d,f),b=Math.max(d,f);E!==g&&E!==R&&_.push({...n[E],x:s}),b!==g&&b!==R&&_.push({...n[b],x:s})}o>0&&R!==g&&_.push(n[R]),_.push(a),u=T,r=0,p=y=c,d=f=g=o}}return _}function Vu(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Uu(n){n.data.datasets.forEach(t=>{Vu(t)})}function db(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=Qt(Qe(t,r.axis,o).lo,0,e-1)),c?s=Qt(Qe(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var hb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Uu(n);return}const i=n.width;n.data.datasets.forEach((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:f}=db(l,c);const g=e.threshold||4*i;if(f<=g){Vu(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(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=cb(c,d,f,i,e);break;case"min-max":p=ub(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Uu(n)}};function fb(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=xr(l,c,s);const u=ea(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=qc(t,u);for(const f of d){const g=ea(e,r[f.start],r[f.end],f.loop),p=Uc(a,s,g);for(const y of p)o.push({source:y,target:f,start:{[e]:qu(u,g,"start",Math.max)},end:{[e]:qu(u,g,"end",Math.min)}})}}return o}function ea(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function gb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=xr(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 xr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function qu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Xu(n,t){let e=[],i=!1;return kt(n)?(i=!0,e=n):e=gb(n,t),e.length?new Mn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Gu(n){return n&&n.fill!==!1}function pb(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(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function mb(n,t,e){const i=xb(n);if(ht(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?yb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function yb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function bb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ht(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function _b(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ht(n)?i=n.value:i=t.getBaseValue(),i}function xb(n){const t=n.options,e=t.fill;let i=rt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=vb(t,e);a.push(Xu({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++)Mb(s,o[u],a)}return new Mn({points:s,options:{}})}function vb(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 Mb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=kb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function kb(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],f=o[u.end][e];if(Ze(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:i}}class Ku{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:Ot},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 Db(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Sb(t,e);if(e==="stack")return wb(n);if(e==="shape")return!0;const s=Tb(n);return s instanceof Ku?s:Xu(s,i)}function Sb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Tb(n){return(n.scale||{}).getPointPositionForValue?Pb(n):Cb(n)}function Cb(n){const{scale:t={},fill:e}=n,i=bb(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Pb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=_b(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Ku({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 na(n,t,e){const i=Db(t),{chart:s,index:r,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:g=d}=u||{},p=s.getDatasetMeta(r),y=Kc(s,p);i&&o.points.length&&(Gi(n,e),Ob(n,{line:o,target:i,above:f,below:g,area:e,scale:a,axis:l,clip:y}),Ki(n))}function Ob(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(Zu(n,i,o.top),ia(n,{line:e,target:i,color:s,scale:a,property:c,clip:l}),n.restore(),n.save(),Zu(n,i,o.bottom)):c==="y"&&(Qu(n,i,o.left),ia(n,{line:e,target:i,color:r,scale:a,property:c,clip:l}),n.restore(),n.save(),Qu(n,i,o.right),u=s)),ia(n,{line:e,target:i,color:u,scale:a,property:c,clip:l}),n.restore()}function Zu(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[xr(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 Qu(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[xr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(e,d.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function ia(n,t){const{line:e,target:i,property:s,color:r,scale:o,clip:a}=t,l=fb(e,i,s);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:g=r}={}}=c,p=i!==!0;n.save(),n.fillStyle=g,Eb(n,o,a,p&&ea(s,d,f)),n.beginPath();const y=!!e.pathSegment(n,c);let _;if(p){y?n.closePath():Ju(n,i,f,s);const v=!!i.pathSegment(n,u,{move:y,reverse:!0});_=y&&v,_||Ju(n,i,d,s)}n.closePath(),n.fill(_?"evenodd":"nonzero"),n.restore()}}function Eb(n,t,e,i){const s=t.chart.chartArea,{property:r,start:o,end:a}=i||{};if(r==="x"||r==="y"){let l,c,u,d;r==="x"?(l=o,c=s.top,u=a,d=s.bottom):(l=s.left,c=o,u=s.right,d=a),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),n.rect(l,c,u-l,d-c),n.clip()}}function Ju(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Ab={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 Mn&&(l={visible:n.isDatasetVisible(o),index:o,fill:mb(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=pb(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&&na(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;Gu(r)&&na(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Gu(i)||e.drawTime!=="beforeDatasetDraw"||na(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const td=(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)}},Rb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class ed extends Jt{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=Dt(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=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=td(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 f=-1,g=-u;return this.legendItems.forEach((p,y)=>{const _=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+_+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,f++),l[y]={left:0,top:g,row:f,width:_,height:s},c[c.length-1]+=_+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,f=0,g=0,p=0,y=0;return this.legendItems.forEach((_,v)=>{const{itemWidth:M,itemHeight:D}=Ib(i,e,r,_,s);v>0&&g+D+2*a>u&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,y++,f=g=0),l[v]={left:p,top:g,col:y,width:M,height:D},f=Math.max(f,M),g+=D+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=pi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=re(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=re(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=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=re(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=At.color,l=pi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:_}=td(o,d),v=function(R,E,b){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const x=rt(b.lineWidth,1);if(s.fillStyle=rt(b.fillStyle,a),s.lineCap=rt(b.lineCap,"butt"),s.lineDashOffset=rt(b.lineDashOffset,0),s.lineJoin=rt(b.lineJoin,"miter"),s.lineWidth=x,s.strokeStyle=rt(b.strokeStyle,a),s.setLineDash(rt(b.lineDash,[])),o.usePointStyle){const P={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:x},I=l.xPlus(R,p/2),C=E+f;Oc(s,P,I,C,o.pointStyleWidth&&p)}else{const P=E+Math.max((d-y)/2,0),I=l.leftForLtr(R,p),C=xn(b.borderRadius);s.beginPath(),Object.values(C).some(F=>F!==0)?hi(s,{x:I,y:P,w:p,h:y,radius:C}):s.rect(I,P,p,y),s.fill(),x!==0&&s.stroke()}s.restore()},M=function(R,E,b){Hn(s,b.text,R,E+_/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?g={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+S,line:0}:g={x:this.left+u,y:re(r,this.top+S+u,this.bottom-e[0].height),line:0},Yc(this.ctx,t.textDirection);const T=_+u;this.legendItems.forEach((R,E)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const b=s.measureText(R.text).width,x=l.textAlign(R.textAlign||(R.textAlign=o.textAlign)),P=p+f+b;let I=g.x,C=g.y;l.setWidth(this.width),D?E>0&&I+P+u>this.right&&(C=g.y+=T,g.line++,I=g.x=re(r,this.left+u,this.right-i[g.line])):E>0&&C+T>this.bottom&&(I=g.x=I+e[g.line].width+u,g.line++,C=g.y=re(r,this.top+S+u,this.bottom-e[g.line].height));const F=l.x(I);if(v(F,C,R),I=ep(x,I+p+f,D?I+P:this.right,t.rtl),M(l.x(I),C,R),D)g.x+=P+u;else if(typeof R.text!="string"){const q=c.lineHeight;g.y+=nd(R,q)+u}else g.y+=T}),jc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Ut(e.padding);if(!e.display)return;const r=pi(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,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=re(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((y,_)=>Math.max(y,_.height),0);u=c+re(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=re(a,d,d+f);o.textAlign=r.textAlign(So(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Hn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Ut(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ze(t,this.left,this.right)&&Ze(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ze(t,s.left,s.left+s.width)&&Ze(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Fb(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Rb(s,i);s&&!r&&Dt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&Dt(e.onHover,[t,i,this],this)}else i&&Dt(e.onClick,[t,i,this],this)}}function Ib(n,t,e,i,s){const r=Lb(i,n,t,e),o=Nb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Lb(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 Nb(n,t,e){let i=n;return typeof t.text!="string"&&(i=nd(t,e)),i}function nd(n,t){const e=n.text?n.text.length:0;return t*e}function Fb(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var zb={id:"legend",_element:ed,start(n,t,e){const i=n.legend=new ed({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i)},stop(n){oe.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;oe.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=Ut(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 sa extends Jt{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=kt(i.text)?i.text.length:1;this._padding=Ut(i.padding);const r=s*It(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=re(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=re(a,s,e),l=ct*-.5):(u=r-t,d=re(a,e,s),l=ct*.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=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Hn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:So(e.align),textBaseline:"middle",translation:[o,a]})}}function Bb(n,t){const e=new sa({ctx:n.ctx,options:t,chart:n});oe.configure(n,e,t),oe.addBox(n,e),n.titleBlock=e}var Hb={id:"title",_element:sa,start(n,t,e){Bb(n,e)},stop(n){const t=n.titleBlock;oe.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;oe.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 Wb={id:"subtitle",start(n,t,e){const i=new sa({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i),wr.set(n,i)},stop(n){oe.removeBox(n,wr.get(n)),wr.delete(n)},beforeUpdate(n,t,e){const i=wr.get(n);oe.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=di(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 Ye(n,t){return t&&(kt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function nn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
16
+ */class em{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=_c.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 tn=new em;const Kc="transparent",nm={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Dc(n||Kc),s=i.valid&&Dc(t||Kc);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class im{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||nm[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 Fo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ht(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ht(r))return;const o={};for(const a of e)o[a]=r[a];(kt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=rm(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&sm(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 f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=d=new im(f,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 tn.add(this._chart,i),!0}}function sm(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 rm(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 Zc(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 om(n,t,e){if(e===!1)return!1;const i=Zc(n,e),s=Zc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function am(n){let t,e,i,s;return ht(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 Jc(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||He(t)===He(c))&&(t+=c)}return!u&&!i.all?0:t}function lm(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 zo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function cm(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function um(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 dm(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function tu(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 eu(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=cm(r,o,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:_}=p,v=p._stacks||(p._stacks={});f=v[c]=dm(s,u,y),f[a]=_,f._top=tu(f,o,!0,i.type),f._bottom=tu(f,o,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=_}}function Bo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function hm(n,t){return wn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function fm(n,t,e){return wn(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 Ho=n=>n==="reset"||n==="none",nu=(n,t)=>t?n:Object.assign({},n),gm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Qc(e,!0),values:null};class Ie{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=zo(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,f,g,p)=>d==="x"?f:d==="r"?p:g,r=e.xAxisID=rt(i.xAxisID,Bo(t,"x")),o=e.yAxisID=rt(i.yAxisID,Bo(t,"y")),a=e.rAxisID=rt(i.rAxisID,Bo(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&&yc(this._data,this),t._stacked&&Qi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ht(e)){const s=this._cachedMeta;this._data=lm(e,s)}else if(i!==e){if(i){yc(i,this);const s=this._cachedMeta;Qi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Qg(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=zo(e.vScale,e),e.stack!==i.stack&&(s=!0,Qi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(eu(this,e._parsed),e._stacked=zo(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,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{kt(s[t])?f=this.parseArrayData(i,s,t,e):ht(s[t])?f=this.parseObjectData(i,s,t,e):f=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=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&eu(this,f)}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 f,g,p;for(f=0,g=s;f<g;++f)p=f+i,d[f]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,f,g;for(u=0,d=s;u<d;++u)f=u+i,g=e[f],c[u]={x:r.parse(yn(g,a),f),y:o.parse(yn(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Qc(s,!0),values:e._stacks[t.axis]._visualValues};return Jc(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=Jc(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=gm(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=um(a);let f,g;function p(){g=s[f];const y=g[a.axis];return!Rt(g[t.axis])||u>y||d<y}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(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=am(rt(this.options.clip,om(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=fm(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=hm(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&&ge(i);if(a)return nu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(At.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(f,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(nu(y,l))),y}_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),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Fo(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||Ho(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){Ho(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ho(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])}}O(Ie,"defaults",{}),O(Ie,"datasetElementType",null),O(Ie,"dataElementType",null);function pm(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=bc(i.sort((s,r)=>s-r))}return n._cache.$bar}function mm(n){const t=n.iScale,e=pm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(ge(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 ym(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 bm(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 _m(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 iu(n,t,e,i){return kt(n)?_m(n,t,e,i):t[e.axis]=e.parse(n,i),t}function su(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(iu(f,d,r,c));return l}function Wo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function xm(n,t,e){return n!==0?He(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function wm(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 vm(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}=wm(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[ru(u,o,a,l)]=!0,s=c)),r[ru(s,o,a,l)]=!0,n.borderSkipped=r}function ru(n,t,e,i){return i?(n=Mm(n,t,e),n=ou(n,e,t)):n=ou(n,t,e),n}function Mm(n,t,e){return n===t?e:n===e?t:n}function ou(n,t,e){return n==="start"?t:n==="end"?e:n}function km(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ji extends Ie{parsePrimitiveData(t,e,i,s){return su(t,e,i,s)}parseArrayData(t,e,i,s){return su(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 f,g,p,y;for(f=i,g=i+s;f<g;++f)y=e[f],p={},p[r.axis]=r.parse(yn(y,c),f),d.push(iu(yn(y,u),p,o,f));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=Wo(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:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),y=r||st(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),_=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[a.axis],M={horizontal:c,base:y.base,enableBorderRadius:!v||Wo(p._custom)||o===v._top||o===v._bottom,x:c?y.head:_.center,y:c?_.center:y.head,height:c?_.size:Math.abs(y.size),width:c?Math.abs(y.size):_.size};f&&(M.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=M.options||t[g].options;vm(M,D,v,o),km(M,D,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,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),f=d&&d[u.vScale.axis];if(st(f)||isNaN(f))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}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,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||mm(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=Wo(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&He(d)!==He(c.barEnd)&&(f=0),f+=d);const _=!st(r)&&!u?r:f;let v=e.getPixelForValue(_);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=v,y=p-v,Math.abs(y)<o){y=xm(y,e,a)*o,d===a&&(v-=y/2);const M=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),S=Math.min(M,D),T=Math.max(M,D);v=Math.max(Math.min(v,T),S),p=v+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(a)){const M=He(y)*e.getLineWidthForValue(a)/2;v+=M,y-=M}return{size:y,base:v,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=rt(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,d=s.barThickness==="flex"?bm(t,e,s,u*c):ym(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+g;a=d.start+d.chunk*p+d.chunk/2,l=Math.min(o,d.chunk*d.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)}}O(Ji,"id","bar"),O(Ji,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),O(Ji,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ar extends Ie{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=rt(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=rt(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 f=e;f<e+i;f++){const g=t[f],p=!r&&this.getParsed(f),y={},_=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),v=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(_)||isNaN(v),c&&(y.options=l||this.resolveDataElementOptions(f,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,f,y,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=rt(i&&i._custom,r),s}}O(ar,"id","bubble"),O(ar,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),O(ar,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Dm(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ot){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(D,S,T)=>Vi(D,a,l,!0)?1:Math.max(S,S*e,T,T*e),p=(D,S,T)=>Vi(D,a,l,!0)?-1:Math.min(S,S*e,T,T*e),y=g(0,c,d),_=g(Et,u,f),v=p(ct,c,d),M=p(ct+Et,u,f);i=(y-v)/2,s=(_-M)/2,r=-(y+v)/2,o=-(_+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class en extends Ie{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(ht(i[t])){const{key:l="value"}=this._parsing;r=c=>+yn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;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(zg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=Dm(d,u,l),_=(i.width-o)/f,v=(i.height-o)/g,M=Math.max(Math.min(_,v)/2,0),D=cc(this.options.radius,M),S=Math.max(D*l,0),T=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=y*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/Ot)}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,f=r&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:_}=this._getSharedOptions(e,s);let v=this._getRotation(),M;for(M=0;M<e;++M)v+=this._circumference(M,r);for(M=e;M<e+i;++M){const D=this._circumference(M,r),S=t[M],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:p,innerRadius:g};_&&(T.options=y||this.resolveDataElementOptions(M,S.active?"active":s)),v+=D,this.updateElement(S,M,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)?Ot*(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(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}O(en,"id","doughnut"),O(en,"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"}),O(en,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(en,"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 Ie{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}=wc(e,s,o);this._drawStart=a,this._drawCount=l,vc(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),f=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,_=_n(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",M=e+i,D=t.length;let S=e>0&&this.getParsed(e-1);for(let T=0;T<D;++T){const R=t[T],E=v?R:{};if(T<e||T>=M){E.skip=!0;continue}const b=this.getParsed(T),x=st(b[g]),P=E[f]=o.getPixelForValue(b[f],T),I=E[g]=r||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,b,l):b[g],T);E.skip=isNaN(P)||isNaN(I)||x,E.stop=T>0&&Math.abs(b[f]-S[f])>_,y&&(E.parsed=b,E.raw=c.data[T]),d&&(E.options=u||this.resolveDataElementOptions(T,R.active?"active":s)),v||this.updateElement(R,T,E,s),S=b}}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()}}O(ts,"id","line"),O(ts,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(ts,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class es extends Ie{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 Fc.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,f=c.getIndexAngle(0)-.5*ct;let g=f,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,y);for(p=e;p<e+i;p++){const _=t[p];let v=g,M=g+this._computeAngle(p,s,y),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=M,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=M=f));const S={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:v,endAngle:M,options:this.resolveDataElementOptions(p,_.active?"active":s)};this.updateElement(_,p,S,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Vt(this.resolveDataElementOptions(t,e).angle||i):0}}O(es,"id","polarArea"),O(es,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(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 Yo extends en{}O(Yo,"id","pie"),O(Yo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class lr extends Ie{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 Fc.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,f=o?r.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,g,s)}}}O(lr,"id","radar"),O(lr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),O(lr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class cr extends Ie{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}=wc(e,i,s);if(this._drawStart=r,this._drawCount=o,vc(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),f=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:_}=this.options,v=_n(y)?y:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let S=e;S<e+i;++S){const T=t[S],R=this.getParsed(S),E=M?T:{},b=st(R[p]),x=E[g]=o.getPixelForValue(R[g],S),P=E[p]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[p],S);E.skip=isNaN(x)||isNaN(P)||b,E.stop=S>0&&Math.abs(R[g]-D[g])>v,_&&(E.parsed=R,E.raw=c.data[S]),f&&(E.options=d||this.resolveDataElementOptions(S,T.active?"active":s)),M||this.updateElement(T,S,E,s),D=R}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}O(cr,"id","scatter"),O(cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Sm=Object.freeze({__proto__:null,BarController:Ji,BubbleController:ar,DoughnutController:en,LineController:ts,PieController:Yo,PolarAreaController:es,RadarController:lr,ScatterController:cr});function jn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class jo{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(jo.prototype,t)}init(){}formats(){return jn()}parse(){return jn()}format(){return jn()}add(){return jn()}diff(){return jn()}startOf(){return jn()}endOf(){return jn()}}var au={_date:jo};function Tm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?Kg:Qe;if(i){if(s._sharedOptions){const u=r[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(r,t,e-d),g=c(r,t,e+d);return{lo:f.lo,hi:g.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:d}=s._cachedMeta,{_parsed:f}=n,g=f.slice(0,u.lo+1).reverse().findIndex(y=>!st(y[d.axis]));u.lo-=Math.max(0,g);const p=f.slice(u.hi).findIndex(y=>!st(y[d.axis]));u.hi+=Math.max(0,p)}return u}}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:f}=Tm(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Cm(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 $o(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ns(n,e,t,function(a,l,c){!s&&!Je(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Pm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Qs(o,{x:t.x,y:t.y});Vi(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ns(n,e,t,r),s}function Om(n,t,e,i,s,r){let o=[];const a=Cm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const _=a(t,p);_<l?(o=[{element:u,datasetIndex:d,index:f}],l=_):_===l&&o.push({element:u,datasetIndex:d,index:f})}return ns(n,e,t,c),o}function Vo(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Pm(n,t,e,s):Om(n,t,e,i,s,r)}function lu(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 Uo={evaluateInteractionItems:ns,modes:{index(n,t,e,i){const s=vn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?$o(n,s,r,i,o):Vo(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=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?$o(n,s,r,i,o):Vo(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=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return $o(n,s,r,i,o)},nearest(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Vo(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=vn(t,n);return lu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=vn(t,n);return lu(n,s,"y",e.intersect,i)}}};const cu=["left","top","right","bottom"];function is(n,t){return n.filter(e=>e.pos===t)}function uu(n,t){return n.filter(e=>cu.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 Em(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 Am(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!cu.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 Rm(n,t){const e=Am(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 Im(n){const t=Em(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=uu(t,"x"),l=uu(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 du(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function hu(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 Lm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!ht(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&&hu(o,r.getPadding());const a=Math.max(0,t.outerWidth-du(o,n,"left","right")),l=Math.max(0,t.outerHeight-du(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 Nm(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 Fm(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,Fm(a.horizontal,t));const{same:d,other:f}=Lm(t,e,a,i);c|=d&&s.length,u=u||f,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 fu(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]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;ge(c.start)&&(o=c.start),l.fullSize?ur(l,s.left,o,e.outerWidth-s.right-s.left,f):ur(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?ur(l,r,s.top,f,e.outerHeight-s.bottom-s.top):ur(l,r,t.top+c.placed,f,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var oe={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=Ut(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Im(n.boxes),l=a.vertical,c=a.horizontal;St(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,_)=>_.box.options&&_.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);hu(f,Ut(i));const g=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),p=Rm(l.concat(c),d);rs(a.fullSize,g,d,p),rs(l,g,d,p),rs(c,g,d,p)&&rs(l,g,d,p),Nm(g),fu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,fu(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},St(a.chartArea,y=>{const _=y.box;Object.assign(_,n.chartArea),_.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class gu{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 zm extends gu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const dr="$chartjs",Bm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},pu=n=>n===null||n==="";function Hm(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",pu(s)){const r=Hc(n,"width");r!==void 0&&(n.width=r)}if(pu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Hc(n,"height");r!==void 0&&(n.height=r)}return n}const mu=jp?{passive:!0}:!1;function Wm(n,t,e){n&&n.addEventListener(t,e,mu)}function Ym(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,mu)}function jm(n,t){const e=Bm[n.type]||n.type,{x:i,y:s}=vn(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 $m(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 Vm(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 yu=0;function bu(){const n=window.devicePixelRatio;n!==yu&&(yu=n,os.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Um(n,t){os.size||window.addEventListener("resize",bu),os.set(n,t)}function qm(n){os.delete(n),os.size||window.removeEventListener("resize",bu)}function Xm(n,t,e){const i=n.canvas,s=i&&No(i);if(!s)return;const r=xc((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),Um(n,r),o}function qo(n,t,e){e&&e.disconnect(),t==="resize"&&qm(n)}function Gm(n,t,e){const i=n.canvas,s=xc(r=>{n.ctx!==null&&e(jm(r,n))},n);return Wm(i,t,s),s}class Km extends gu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Hm(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:$m,detach:Vm,resize:Xm}[e]||Gm;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:qo,detach:qo,resize:qo}[e]||Ym)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Yp(t,e,i,s)}isAttached(t){const e=t&&No(t);return!!(e&&e.isConnected)}}function Zm(n){return!Lo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?zm:Km}class Jt{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _n(this.x)&&_n(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}}O(Jt,"defaults",{}),O(Jt,"defaultRoutes");function Qm(n,t){const e=n.options.ticks,i=Jm(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?ey(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return ny(t,c,r,o/s),c;const u=ty(r,t,s);if(o>0){let d,f;const g=o>1?Math.round((l-a)/(o-1)):null;for(fr(t,c,u,st(g)?0:a-g,a),d=0,f=o-1;d<f;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 Jm(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function ty(n,t,e){const i=iy(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Vg(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 ey(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function ny(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=rt(i,0),o=Math.min(rt(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 iy(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 sy=n=>n==="left"?"right":n==="right"?"left":n,_u=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,xu=(n,t)=>Math.min(t||n,n);function wu(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 ry(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 oy(n,t){St(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function as(n){return n.drawTicks?n.tickLength:0}function vu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(kt(n.text)?n.text.length:1)*e.lineHeight+i.height}function ay(n,t){return wn(n,{scale:t,type:"scale"})}function ly(n,t,e){return wn(n,{tick:e,index:t,type:"tick"})}function cy(n,t,e){let i=Do(n);return(e&&t!=="right"||!e&&t==="right")&&(i=sy(i)),i}function uy(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const y=o-s,_=a-r;if(n.isHorizontal()){if(g=re(i,r,a),ht(e)){const v=Object.keys(e)[0],M=e[v];p=u[v].getPixelForValue(M)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=_u(n,e,t);f=a-r}else{if(ht(e)){const v=Object.keys(e)[0],M=e[v];g=u[v].getPixelForValue(M)-_+t}else e==="center"?g=(c.left+c.right)/2-_+t:g=_u(n,e,t);p=re(i,o,s),d=e==="left"?-Et:Et}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class $n extends Jt{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=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(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:Me(e,Me(i,e)),max:Me(i,Me(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(){Dt(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=xp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?wu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Qm(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(){Dt(this.options.afterUpdate,[this])}beforeSetDimensions(){Dt(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(){Dt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Dt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Dt(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=Dt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){Dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=xu(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,f=u.highest.height,g=Qt(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-vu(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Zs(Math.min(Math.asin(Qt((u.highest.height+6)/a,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Dt(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=vu(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:f}=this._getLabelSizes(),g=i.padding*2,p=Vt(this.labelRotation),y=Math.cos(p),_=Math.sin(p);if(a){const v=i.mirror?0:_*d.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:y*d.width+_*f.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,_,y)}}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 f=0,g=0;l?c?(f=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-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(){Dt(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=wu(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/xu(e,i));let c=0,u=0,d,f,g,p,y,_,v,M,D,S,T;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=_=y.string,v=r[_]=r[_]||{data:{},gc:[]},M=y.lineHeight,D=S=0,!st(p)&&!kt(p))D=er(s,v.data,v.gc,D,p),S=M;else if(kt(p))for(f=0,g=p.length;f<g;++f)T=p[f],!st(T)&&!kt(T)&&(D=er(s,v.data,v.gc,D,T),S+=M);o.push(D),a.push(S),c=Math.max(D,c),u=Math.max(S,u)}oy(r,e);const R=o.indexOf(c),E=a.indexOf(u),b=x=>({width:o[x]||0,height:a[x]||0});return{first:b(0),last:b(e-1),widest:b(R),highest:b(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 Gg(this._alignToPixels?Bn(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=ly(this.getContext(),t,i))}return this.$context||(this.$context=ay(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Vt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),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),f=as(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,_=y/2,v=function(J){return Bn(i,J,y)};let M,D,S,T,R,E,b,x,P,I,C,F;if(o==="top")M=v(this.bottom),E=this.bottom-f,x=M-_,I=v(t.top)+_,F=t.bottom;else if(o==="bottom")M=v(this.top),I=t.top,F=v(t.bottom)-_,E=M+_,x=this.top+f;else if(o==="left")M=v(this.right),R=this.right-f,b=M-_,P=v(t.left)+_,C=t.right;else if(o==="right")M=v(this.left),P=t.left,C=v(t.right)-_,R=M+_,b=this.left+f;else if(e==="x"){if(o==="center")M=v((t.top+t.bottom)/2+.5);else if(ht(o)){const J=Object.keys(o)[0],U=o[J];M=v(this.chart.scales[J].getPixelForValue(U))}I=t.top,F=t.bottom,E=M+_,x=E+f}else if(e==="y"){if(o==="center")M=v((t.left+t.right)/2);else if(ht(o)){const J=Object.keys(o)[0],U=o[J];M=v(this.chart.scales[J].getPixelForValue(U))}R=M-_,b=R-f,P=t.left,C=t.right}const q=rt(s.ticks.maxTicksLimit,d),G=Math.max(1,Math.ceil(d/q));for(D=0;D<d;D+=G){const J=this.getContext(D),U=r.setContext(J),ut=a.setContext(J),V=U.lineWidth,K=U.color,B=ut.dash||[],j=ut.dashOffset,H=U.tickWidth,xt=U.tickColor,mt=U.tickBorderDash||[],vt=U.tickBorderDashOffset;S=ry(this,D,l),S!==void 0&&(T=Bn(i,S,V),c?R=b=P=C=T:E=x=I=F=T,g.push({tx1:R,ty1:E,tx2:b,ty2:x,x1:P,y1:I,x2:C,y2:F,width:V,color:K,borderDash:B,borderDashOffset:j,tickWidth:H,tickColor:xt,tickBorderDash:mt,tickBorderDashOffset:vt}))}return this._ticksLength=d,this._borderValue=M,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,f=as(i.grid),g=f+u,p=d?-u:g,y=-Vt(this.labelRotation),_=[];let v,M,D,S,T,R,E,b,x,P,I,C,F="middle";if(s==="top")R=this.bottom-p,E=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+p,E=this._getXAxisLabelAlignment();else if(s==="left"){const G=this._getYAxisLabelAlignment(f);E=G.textAlign,T=G.x}else if(s==="right"){const G=this._getYAxisLabelAlignment(f);E=G.textAlign,T=G.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+g;else if(ht(s)){const G=Object.keys(s)[0],J=s[G];R=this.chart.scales[G].getPixelForValue(J)+g}E=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")T=(t.left+t.right)/2-g;else if(ht(s)){const G=Object.keys(s)[0],J=s[G];T=this.chart.scales[G].getPixelForValue(J)}E=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const q=this._getLabelSizes();for(v=0,M=a.length;v<M;++v){D=a[v],S=D.label;const G=r.setContext(this.getContext(v));b=this.getPixelForTick(v)+r.labelOffset,x=this._resolveTickFontOptions(v),P=x.lineHeight,I=kt(S)?S.length:1;const J=I/2,U=G.color,ut=G.textStrokeColor,V=G.textStrokeWidth;let K=E;o?(T=b,E==="inner"&&(v===M-1?K=this.options.reverse?"left":"right":v===0?K=this.options.reverse?"right":"left":K="center"),s==="top"?c==="near"||y!==0?C=-I*P+P/2:c==="center"?C=-q.highest.height/2-J*P+P:C=-q.highest.height+P/2:c==="near"||y!==0?C=P/2:c==="center"?C=q.highest.height/2-J*P:C=q.highest.height-I*P,d&&(C*=-1),y!==0&&!G.showLabelBackdrop&&(T+=P/2*Math.sin(y))):(R=b,C=(1-I)*P/2);let B;if(G.showLabelBackdrop){const j=Ut(G.backdropPadding),H=q.heights[v],xt=q.widths[v];let mt=C-j.top,vt=0-j.left;switch(F){case"middle":mt-=H/2;break;case"bottom":mt-=H;break}switch(E){case"center":vt-=xt/2;break;case"right":vt-=xt;break;case"inner":v===M-1?vt-=xt:v>0&&(vt-=xt/2);break}B={left:vt,top:mt,width:xt+j.width,height:H+j.height,color:G.backdropColor}}_.push({label:S,font:x,textOffset:C,options:{rotation:y,color:U,strokeColor:ut,strokeWidth:V,textAlign:K,textBaseline:F,translation:[T,R],backdrop:B}})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Vt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,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,f;this.isHorizontal()?(c=Bn(t,this.left,o)-o/2,u=Bn(t,this.right,a)+a/2,d=f=l):(d=Bn(t,this.top,o)-o/2,f=Bn(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,f),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;Hn(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=It(i.font),o=Ut(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ht(e)?(l+=o.bottom,kt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=uy(this,l,e,a);Hn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:cy(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=rt(t.grid&&t.grid.z,-1),s=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$n.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 It(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;fy(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,dy(t,o,i),this.override&&At.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 At[s]&&(delete At[s][i],this.override&&delete zn[i])}}function dy(n,t,e){const i=Yi(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&hy(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function hy(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(".");At.route(r,s,l,a)})}function fy(n){return"id"in n&&"defaults"in n}class gy{constructor(){this.controllers=new gr(Ie,"datasets",!0),this.elements=new gr(Jt,"elements"),this.plugins=new gr(Object,"plugins"),this.scales=new gr($n,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):St(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=vo(t);Dt(i["before"+s],[],i),e[t](i),Dt(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 We=new gy;class py{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(Dt(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=rt(i.options&&i.options.plugins,{}),r=my(i);return s===!1&&!e?[]:by(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 my(n){const t={},e=[],i=Object.keys(We.plugins.items);for(let r=0;r<i.length;r++)e.push(We.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 yy(n,t){return!t&&n===!1?null:n===!0?{}:n}function by(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=yy(i[l],s);c!==null&&r.push({plugin:a,options:_y(n.config,{plugin:a,local:e[l]},c,o)})}return r}function _y(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 Xo(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function xy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function wy(n,t){return n===t?"_index_":"_value_"}function Mu(n){if(n==="x"||n==="y"||n==="r")return n}function vy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Go(n,...t){if(Mu(n))return n;for(const e of t){const i=e.axis||vy(e.position)||n.length>1&&Mu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function ku(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 ku(n,"x",e[0])||ku(n,"y",e[0])}return{}}function ky(n,t){const e=zn[n.type]||{scales:{}},i=t.scales||{},s=Xo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ht(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=Go(o,a,My(o,n),At.scales[a.type]),c=wy(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||Xo(a,t),u=(zn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=xy(d,l),g=o[f+"AxisID"]||f;r[g]=r[g]||Object.create(null),ji(r[g],[{axis:f},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ji(a,[At.scales[a.type],At.scale])}),r}function Du(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=ky(n,t)}function Su(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Dy(n){return n=n||{},n.data=Su(n.data),Du(n),n}const Tu=new Map,Cu=new Set;function pr(n,t){let e=Tu.get(n);return e||(e=t(),Tu.set(n,e),Cu.add(e)),e}const ls=(n,t,e)=>{const i=yn(t,e);i!==void 0&&n.add(i)};class Sy{constructor(t){this._config=Dy(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=Su(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(),Du(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,zn[r]||{},d)),u.forEach(d=>ls(l,At,d)),u.forEach(d=>ls(l,Co,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Cu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,zn[e]||{},At.datasets[e]||{},{type:e},At,Co]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Pu(this._resolverCache,t,s);let l=o;if(Cy(o,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,a);l=fi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Pu(this._resolverCache,t,i);return ht(e)?fi(r,e,void 0,s):r}}function Pu(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:Ao(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Ty=n=>ht(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function Cy(n,t){const{isScriptable:e,isIndexable:i}=Ec(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(pe(a)||Ty(a))||o&&kt(a))return!0}return!1}var Py="4.5.0";const Oy=["top","bottom","left","right","chartArea"];function Ou(n,t){return n==="top"||n==="bottom"||Oy.indexOf(n)===-1&&t==="x"}function Eu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Au(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Dt(e&&e.onComplete,[n],t)}function Ey(n){const t=n.chart,e=t.options.animation;Dt(e&&e.onProgress,[n],t)}function Ru(n){return Lo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const mr={},Iu=n=>{const t=Ru(n);return Object.values(mr).filter(e=>e.canvas===t).pop()};function Ay(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 Ry(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let Se=(En=class{static register(...t){We.add(...t),Lu()}static unregister(...t){We.remove(...t),Lu()}constructor(t,e){const i=this.config=new Sy(e),s=Ru(t),r=Iu(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||Zm(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=Fg(),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 py,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Jg(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}tn.listen(this,"complete",Au),tn.listen(this,"progress",Ey),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 We}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Bc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Cc(this.canvas,this.ctx),this}stop(){return tn.stop(this),this}resize(t,e){tn.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,Bc(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Dt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};St(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Go(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(r,o=>{const a=o.options,l=a.id,c=Go(l,a),u=rt(a.type,o.dtype);(a.position===void 0||Ou(a.position,c)!==Ou(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 f=We.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),St(s,(o,a)=>{o||delete i[a]}),St(i,o=>{oe.configure(this,o,o.options),oe.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(Eu("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||Xo(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=We.getController(a),{datasetElementType:c,dataElementType:u}=At.datasets[a];Object.assign(l,{dataElementType:We.getElement(u),datasetElementType:c&&We.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){St(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||St(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Eu("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){St(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!hc(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;Ay(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(!hc(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;oe.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],St(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(tn.has(this)?this.attached&&!tn.running(this)&&tn.start(this):(this.draw(),Au({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={meta:t,index:t.index,cancelable:!0},s=Gc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Gi(e,s),t.controller.draw(),s&&Ki(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Uo.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=wn(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);ge(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(),tn.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(),Cc(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)};St(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let 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(){St(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},St(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,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}});!qs(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=jg(t),c=Ry(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Dt(r.onHover,[t,a,this],this),l&&Dt(r.onClick,[t,a,this],this));const u=!qs(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)}},O(En,"defaults",At),O(En,"instances",mr),O(En,"overrides",zn),O(En,"registry",We),O(En,"version",Py),O(En,"getChart",Iu),En);function Lu(){return St(Se.instances,n=>n._plugins.invalidate())}function Iy(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/o,se(i-e));if(n.beginPath(),n.arc(s,r,o-c/2,i+d/2,e-d/2),a>0){const f=Math.min(c/a,se(i-e));n.arc(s,r,a+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,o*se(i-e));if(u==="round")n.arc(s,r,f,e-ct/2,i+ct/2,!0);else if(u==="bevel"){const g=2*f*f,p=-g*Math.cos(e+ct/2)+s,y=-g*Math.sin(e+ct/2)+r,_=g*Math.cos(i+ct/2)+s,v=g*Math.sin(i+ct/2)+r;n.lineTo(p,y),n.lineTo(_,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function Ly(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+Et,i-Et),n.closePath(),n.clip()}function Ny(n){return Eo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Fy(n,t,e,i){const s=Ny(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 Qt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Qt(s.innerStart,0,o),innerEnd:Qt(s.innerEnd,0,o)}}function mi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function yr(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),f=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const G=u>0?u-i:0,J=d>0?d-i:0,U=(G+J)/2,ut=U!==0?p*U/(U+i):p;g=(p-ut)/2}const y=Math.max(.001,p*d-e/ct)/d,_=(p-y)/2,v=l+_+g,M=s-_-g,{outerStart:D,outerEnd:S,innerStart:T,innerEnd:R}=Fy(t,f,d,M-v),E=d-D,b=d-S,x=v+D/E,P=M-S/b,I=f+T,C=f+R,F=v+T/I,q=M-R/C;if(n.beginPath(),r){const G=(x+P)/2;if(n.arc(o,a,d,x,G),n.arc(o,a,d,G,P),S>0){const V=mi(b,P,o,a);n.arc(V.x,V.y,S,P,M+Et)}const J=mi(C,M,o,a);if(n.lineTo(J.x,J.y),R>0){const V=mi(C,q,o,a);n.arc(V.x,V.y,R,M+Et,q+Math.PI)}const U=(M-R/f+(v+T/f))/2;if(n.arc(o,a,f,M-R/f,U,!0),n.arc(o,a,f,U,v+T/f,!0),T>0){const V=mi(I,F,o,a);n.arc(V.x,V.y,T,F+Math.PI,v-Et)}const ut=mi(E,v,o,a);if(n.lineTo(ut.x,ut.y),D>0){const V=mi(E,x,o,a);n.arc(V.x,V.y,D,v-Et,x)}}else{n.moveTo(o,a);const G=Math.cos(x)*d+o,J=Math.sin(x)*d+a;n.lineTo(G,J);const U=Math.cos(P)*d+o,ut=Math.sin(P)*d+a;n.lineTo(U,ut)}n.closePath()}function zy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){yr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ot||Ot))}return yr(n,t,e,i,l,s),n.fill(),l}function By(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let y=t.endAngle;if(r){yr(n,t,e,i,y,s);for(let _=0;_<r;++_)n.stroke();isNaN(a)||(y=o+(a%Ot||Ot))}p&&Ly(n,t,y),l.selfJoin&&y-o>=ct&&g===0&&u!=="miter"&&Iy(n,t,y),r||(yr(n,t,e,i,y,s),n.stroke())}class cs extends Jt{constructor(e){super();O(this,"circumference");O(this,"endAngle");O(this,"fullCircles");O(this,"innerRadius");O(this,"outerRadius");O(this,"pixelMargin");O(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}=Qs(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=rt(f,c-l),y=Vi(o,l,c)&&l!==c,_=p>=Ot||y,v=Ze(a,u+g,d+g);return _&&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,f=(a+l+u+c)/2;return{x:i+Math.cos(d)*f,y:s+Math.sin(d)*f}}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>Ot?Math.floor(s/Ot):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(ct,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,zy(e,this,u,o,a),By(e,this,u,o,a),e.restore()}}O(cs,"id","arc"),O(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,selfJoin:!1}),O(cs,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(cs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Nu(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function Hy(n,t,e){n.lineTo(e.x,e.y)}function Wy(n){return n.stepped?dp:n.tension||n.cubicInterpolationMode==="monotone"?hp:Hy}function Fu(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 Yy(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Fu(s,e,i),u=Wy(r);let{move:d=!0,reverse:f}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,f,r.stepped),y=p);return l&&(p=s[(a+(f?c:0))%o],u(n,y,p,f,r.stepped)),!!l}function jy(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Fu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,y,_,v;const M=S=>(o+(c?a-S:S))%r,D=()=>{y!==_&&(n.lineTo(u,_),n.lineTo(u,y),n.lineTo(u,v))};for(l&&(g=s[M(0)],n.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[M(f)],g.skip)continue;const S=g.x,T=g.y,R=S|0;R===p?(T<y?y=T:T>_&&(_=T),u=(d*u+S)/++d):(D(),n.lineTo(S,T),p=R,d=0,y=_=T),v=T}D()}function Ko(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?jy:Yy}function $y(n){return n.stepped?$p:n.tension||n.cubicInterpolationMode==="monotone"?Vp:Yn}function Vy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Nu(n,t.options),n.stroke(s)}function Uy(n,t,e,i){const{segments:s,options:r}=t,o=Ko(t);for(const a of s)Nu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const qy=typeof Path2D=="function";function Xy(n,t,e,i){qy&&!t.options.segment?Vy(n,t,e,i):Uy(n,t,e,i)}class Mn extends Jt{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;Np(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=Zp(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=Uc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=$y(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],g=r[d],p=r[f];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),_=l(g,p,y,i.stepped);_[e]=t[e],a.push(_)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Ko(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Ko(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(),Xy(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}O(Mn,"id","line"),O(Mn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),O(Mn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),O(Mn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function zu(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class br extends Jt{constructor(e){super();O(this,"parsed");O(this,"skip");O(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 zu(this,e,"x",i)}inYRange(e,i){return zu(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||!Je(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Oo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}O(br,"id","point"),O(br,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),O(br,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Bu(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 kn(n,t,e,i){return n?0:Qt(t,e,i)}function Gy(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Oc(i);return{t:kn(s.top,r.top,0,e),r:kn(s.right,r.right,0,t),b:kn(s.bottom,r.bottom,0,e),l:kn(s.left,r.left,0,t)}}function Ky(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=xn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||ht(s);return{topLeft:kn(!l||a.top||a.left,r.topLeft,0,o),topRight:kn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:kn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:kn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Zy(n){const t=Bu(n),e=t.right-t.left,i=t.bottom-t.top,s=Gy(n,e/2,i/2),r=Ky(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 Zo(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Bu(n,i);return a&&(s||Ze(t,a.left,a.right))&&(r||Ze(e,a.top,a.bottom))}function Qy(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Jy(n,t){n.rect(t.x,t.y,t.w,t.h)}function Qo(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 _r extends Jt{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}=Zy(this),a=Qy(o.radius)?hi:Jy;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Qo(o,e,r)),t.clip(),a(t,Qo(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Qo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Zo(this,t,e,i)}inXRange(t,e){return Zo(this,t,null,e)}inYRange(t,e){return Zo(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}}O(_r,"id","bar"),O(_r,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),O(_r,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var tb=Object.freeze({__proto__:null,ArcElement:cs,BarElement:_r,LineElement:Mn,PointElement:br});const Jo=["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)"],Hu=Jo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Wu(n){return Jo[n%Jo.length]}function Yu(n){return Hu[n%Hu.length]}function eb(n,t){return n.borderColor=Wu(t),n.backgroundColor=Yu(t),++t}function nb(n,t){return n.backgroundColor=n.data.map(()=>Wu(t++)),t}function ib(n,t){return n.backgroundColor=n.data.map(()=>Yu(t++)),t}function sb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof en?t=nb(e,t):s instanceof es?t=ib(e,t):s&&(t=eb(e,t))}}function ju(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function rb(n){return n&&(n.borderColor||n.backgroundColor)}function ob(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var ab={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=ju(i)||rb(s)||r&&ju(r)||ob();if(!e.forceOverride&&o)return;const a=sb(n);i.forEach(a)}};function lb(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,f,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let _=0,v=0,M;const D=Math.floor((d+1)*a)+1+t,S=Math.min(Math.floor((d+2)*a)+1,e)+t,T=S-D;for(M=D;M<S;M++)_+=n[M].x,v+=n[M].y;_/=T,v/=T;const R=Math.floor(d*a)+1+t,E=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:b,y:x}=n[u];for(g=p=-1,M=R;M<E;M++)p=.5*Math.abs((b-_)*(n[M].y-x)-(b-n[M].x)*(v-x)),p>g&&(g=p,f=n[M],y=M);o[l++]=f,u=y}return o[l++]=n[c],o}function cb(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,f,g,p,y;const _=[],v=t+e-1,M=n[t].x,S=n[v].x-M;for(o=t;o<t+e;++o){a=n[o],l=(a.x-M)/S*i,c=a.y;const T=l|0;if(T===u)c<p?(p=c,d=o):c>y&&(y=c,f=o),s=(r*s+a.x)/++r;else{const R=o-1;if(!st(d)&&!st(f)){const E=Math.min(d,f),b=Math.max(d,f);E!==g&&E!==R&&_.push({...n[E],x:s}),b!==g&&b!==R&&_.push({...n[b],x:s})}o>0&&R!==g&&_.push(n[R]),_.push(a),u=T,r=0,p=y=c,d=f=g=o}}return _}function $u(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 Vu(n){n.data.datasets.forEach(t=>{$u(t)})}function ub(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=Qt(Qe(t,r.axis,o).lo,0,e-1)),c?s=Qt(Qe(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var db={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Vu(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:f}=ub(l,c);const g=e.threshold||4*i;if(f<=g){$u(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(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=lb(c,d,f,i,e);break;case"min-max":p=cb(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Vu(n)}};function hb(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=xr(l,c,s);const u=ta(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=Uc(t,u);for(const f of d){const g=ta(e,r[f.start],r[f.end],f.loop),p=Vc(a,s,g);for(const y of p)o.push({source:y,target:f,start:{[e]:Uu(u,g,"start",Math.max)},end:{[e]:Uu(u,g,"end",Math.min)}})}}return o}function ta(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function fb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=xr(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 xr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Uu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function qu(n,t){let e=[],i=!1;return kt(n)?(i=!0,e=n):e=fb(n,t),e.length?new Mn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Xu(n){return n&&n.fill!==!1}function gb(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(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function pb(n,t,e){const i=_b(n);if(ht(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?mb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function mb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function yb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ht(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function bb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ht(n)?i=n.value:i=t.getBaseValue(),i}function _b(n){const t=n.options,e=t.fill;let i=rt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function xb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=wb(t,e);a.push(qu({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++)vb(s,o[u],a)}return new Mn({points:s,options:{}})}function wb(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 vb(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],f=o[u.end][e];if(Ze(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:i}}class Gu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:Ot},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 kb(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Db(t,e);if(e==="stack")return xb(n);if(e==="shape")return!0;const s=Sb(n);return s instanceof Gu?s:qu(s,i)}function Db(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Sb(n){return(n.scale||{}).getPointPositionForValue?Cb(n):Tb(n)}function Tb(n){const{scale:t={},fill:e}=n,i=yb(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Cb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=bb(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Gu({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 ea(n,t,e){const i=kb(t),{chart:s,index:r,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:g=d}=u||{},p=s.getDatasetMeta(r),y=Gc(s,p);i&&o.points.length&&(Gi(n,e),Pb(n,{line:o,target:i,above:f,below:g,area:e,scale:a,axis:l,clip:y}),Ki(n))}function Pb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(Ku(n,i,o.top),na(n,{line:e,target:i,color:s,scale:a,property:c,clip:l}),n.restore(),n.save(),Ku(n,i,o.bottom)):c==="y"&&(Zu(n,i,o.left),na(n,{line:e,target:i,color:r,scale:a,property:c,clip:l}),n.restore(),n.save(),Zu(n,i,o.right),u=s)),na(n,{line:e,target:i,color:u,scale:a,property:c,clip:l}),n.restore()}function Ku(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[xr(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 Zu(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[xr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(e,d.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function na(n,t){const{line:e,target:i,property:s,color:r,scale:o,clip:a}=t,l=hb(e,i,s);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:g=r}={}}=c,p=i!==!0;n.save(),n.fillStyle=g,Ob(n,o,a,p&&ta(s,d,f)),n.beginPath();const y=!!e.pathSegment(n,c);let _;if(p){y?n.closePath():Qu(n,i,f,s);const v=!!i.pathSegment(n,u,{move:y,reverse:!0});_=y&&v,_||Qu(n,i,d,s)}n.closePath(),n.fill(_?"evenodd":"nonzero"),n.restore()}}function Ob(n,t,e,i){const s=t.chart.chartArea,{property:r,start:o,end:a}=i||{};if(r==="x"||r==="y"){let l,c,u,d;r==="x"?(l=o,c=s.top,u=a,d=s.bottom):(l=s.left,c=o,u=s.right,d=a),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),n.rect(l,c,u-l,d-c),n.clip()}}function Qu(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Eb={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 Mn&&(l={visible:n.isDatasetVisible(o),index:o,fill:pb(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=gb(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&&ea(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;Xu(r)&&ea(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Xu(i)||e.drawTime!=="beforeDatasetDraw"||ea(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ju=(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)}},Ab=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class td extends Jt{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=Dt(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=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ju(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 f=-1,g=-u;return this.legendItems.forEach((p,y)=>{const _=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+_+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,f++),l[y]={left:0,top:g,row:f,width:_,height:s},c[c.length-1]+=_+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,f=0,g=0,p=0,y=0;return this.legendItems.forEach((_,v)=>{const{itemWidth:M,itemHeight:D}=Rb(i,e,r,_,s);v>0&&g+D+2*a>u&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,y++,f=g=0),l[v]={left:p,top:g,col:y,width:M,height:D},f=Math.max(f,M),g+=D+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=pi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=re(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=re(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=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=re(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=At.color,l=pi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:_}=Ju(o,d),v=function(R,E,b){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const x=rt(b.lineWidth,1);if(s.fillStyle=rt(b.fillStyle,a),s.lineCap=rt(b.lineCap,"butt"),s.lineDashOffset=rt(b.lineDashOffset,0),s.lineJoin=rt(b.lineJoin,"miter"),s.lineWidth=x,s.strokeStyle=rt(b.strokeStyle,a),s.setLineDash(rt(b.lineDash,[])),o.usePointStyle){const P={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:x},I=l.xPlus(R,p/2),C=E+f;Pc(s,P,I,C,o.pointStyleWidth&&p)}else{const P=E+Math.max((d-y)/2,0),I=l.leftForLtr(R,p),C=xn(b.borderRadius);s.beginPath(),Object.values(C).some(F=>F!==0)?hi(s,{x:I,y:P,w:p,h:y,radius:C}):s.rect(I,P,p,y),s.fill(),x!==0&&s.stroke()}s.restore()},M=function(R,E,b){Hn(s,b.text,R,E+_/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?g={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+S,line:0}:g={x:this.left+u,y:re(r,this.top+S+u,this.bottom-e[0].height),line:0},Wc(this.ctx,t.textDirection);const T=_+u;this.legendItems.forEach((R,E)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const b=s.measureText(R.text).width,x=l.textAlign(R.textAlign||(R.textAlign=o.textAlign)),P=p+f+b;let I=g.x,C=g.y;l.setWidth(this.width),D?E>0&&I+P+u>this.right&&(C=g.y+=T,g.line++,I=g.x=re(r,this.left+u,this.right-i[g.line])):E>0&&C+T>this.bottom&&(I=g.x=I+e[g.line].width+u,g.line++,C=g.y=re(r,this.top+S+u,this.bottom-e[g.line].height));const F=l.x(I);if(v(F,C,R),I=tp(x,I+p+f,D?I+P:this.right,t.rtl),M(l.x(I),C,R),D)g.x+=P+u;else if(typeof R.text!="string"){const q=c.lineHeight;g.y+=ed(R,q)+u}else g.y+=T}),Yc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Ut(e.padding);if(!e.display)return;const r=pi(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,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=re(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((y,_)=>Math.max(y,_.height),0);u=c+re(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=re(a,d,d+f);o.textAlign=r.textAlign(Do(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Hn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Ut(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ze(t,this.left,this.right)&&Ze(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ze(t,s.left,s.left+s.width)&&Ze(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Nb(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Ab(s,i);s&&!r&&Dt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&Dt(e.onHover,[t,i,this],this)}else i&&Dt(e.onClick,[t,i,this],this)}}function Rb(n,t,e,i,s){const r=Ib(i,n,t,e),o=Lb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Ib(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 Lb(n,t,e){let i=n;return typeof t.text!="string"&&(i=ed(t,e)),i}function ed(n,t){const e=n.text?n.text.length:0;return t*e}function Nb(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Fb={id:"legend",_element:td,start(n,t,e){const i=n.legend=new td({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i)},stop(n){oe.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;oe.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=Ut(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 ia extends Jt{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=kt(i.text)?i.text.length:1;this._padding=Ut(i.padding);const r=s*It(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=re(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=re(a,s,e),l=ct*-.5):(u=r-t,d=re(a,e,s),l=ct*.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=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Hn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Do(e.align),textBaseline:"middle",translation:[o,a]})}}function zb(n,t){const e=new ia({ctx:n.ctx,options:t,chart:n});oe.configure(n,e,t),oe.addBox(n,e),n.titleBlock=e}var Bb={id:"title",_element:ia,start(n,t,e){zb(n,e)},stop(n){const t=n.titleBlock;oe.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;oe.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 Hb={id:"subtitle",start(n,t,e){const i=new ia({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i),wr.set(n,i)},stop(n){oe.removeBox(n,wr.get(n)),wr.delete(n)},beforeUpdate(n,t,e){const i=wr.get(n);oe.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=di(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 Ye(n,t){return t&&(kt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function nn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function Yb(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 id(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),d=r.length,f=s.length,g=i.length,p=Ut(t.padding);let y=p.height,_=0,v=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*S+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const D=function(S){_=Math.max(_,e.measureText(S).width+M)};return e.save(),e.font=c.string,St(n.title,D),e.font=l.string,St(n.beforeBody.concat(n.afterBody),D),M=t.displayColors?o+2+t.boxPadding:0,St(i,S=>{St(S.before,D),St(S.lines,D),St(S.after,D)}),M=0,e.font=u.string,St(n.footer,D),e.restore(),_+=p.width,{width:_,height:y}}function jb(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function $b(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 Vb(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"),$b(c,n,t,e)&&(c="center"),c}function sd(n,t,e){const i=e.yAlign||t.yAlign||jb(n,e);return{xAlign:e.xAlign||t.xAlign||Vb(n,t,e,i),yAlign:i}}function Ub(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function qb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function rd(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:f,bottomRight:g}=xn(o);let p=Ub(t,a);const y=qb(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Qt(p,0,i.width-t.width),y:Qt(y,0,i.height-t.height)}}function vr(n,t,e){const i=Ut(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function od(n){return Ye([],nn(n))}function Xb(n,t,e){return wn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ad(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ld={beforeTitle:Ke,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:Ke,beforeBody:Ke,beforeLabel:Ke,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:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function me(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?ld[t].call(e,i):s}class ra extends Jt{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 zo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Xb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=me(i,"beforeTitle",this,t),r=me(i,"title",this,t),o=me(i,"afterTitle",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}getBeforeBody(t,e){return od(me(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return St(t,r=>{const o={before:[],lines:[],after:[]},a=ad(i,r);Ye(o.before,nn(me(a,"beforeLabel",this,r))),Ye(o.lines,me(a,"label",this,r)),Ye(o.after,nn(me(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return od(me(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=me(i,"beforeFooter",this,t),r=me(i,"footer",this,t),o=me(i,"afterFooter",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(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(Yb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),St(a,u=>{const d=ad(t.callbacks,u);s.push(me(d,"labelColor",this,u)),r.push(me(d,"labelPointStyle",this,u)),o.push(me(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=id(this,i),c=Object.assign({},a,l),u=sd(this.chart,i,c),d=rd(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}=xn(a),{x:f,y:g}=t,{width:p,height:y}=e;let _,v,M,D,S,T;return r==="center"?(S=g+y/2,s==="left"?(_=f,v=_-o,D=S+o,T=S-o):(_=f+p,v=_+o,D=S-o,T=S+o),M=_):(s==="left"?v=f+Math.max(l,u)+o:s==="right"?v=f+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,S=D-o,_=v-o,M=v+o):(D=g+y,S=D+o,_=v+o,M=v-o),T=D),{x1:_,x2:v,x3:M,y1:D,y2:S,y3:T}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=pi(i.rtl,this.x,this.width);for(t.x=vr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(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=It(r.bodyFont),d=vr(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},_=s.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Eo(t,y,_,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Eo(t,y,_,v)}else{t.lineWidth=ht(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 y=s.leftForLtr(f,c),_=s.leftForLtr(s.xPlus(f,1),c-2),v=xn(o.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,hi(t,{x:y,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),hi(t,{x:_,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(_,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=It(i.bodyFont);let f=d.lineHeight,g=0;const p=pi(i.rtl,this.x,this.width),y=function(b){e.fillText(b,p.x(t.x+g),t.y+f/2),t.y+=f+r},_=p.textAlign(o);let v,M,D,S,T,R,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=vr(this,_,i),e.fillStyle=i.bodyColor,St(this.beforeBody,y),g=a&&_!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,R=s.length;S<R;++S){for(v=s[S],M=this.labelTextColors[S],e.fillStyle=M,St(v.before,y),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,S,p,i),f=Math.max(d.lineHeight,l)),T=0,E=D.length;T<E;++T)y(D[T]),f=d.lineHeight;St(v.after,y)}g=0,f=d.lineHeight,St(this.afterBody,y),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=pi(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=It(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:f,bottomLeft:g,bottomRight:p}=xn(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-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=id(this,t),l=Object.assign({},o,this._size),c=sd(e,t,l),u=rd(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=Ut(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),Yc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),jc(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=!qs(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||!qs(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)}}O(ra,"positioners",us);var je={id:"tooltip",_element:ra,positioners:us,afterInit(n,t,e){e&&(n.tooltip=new ra({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:ld},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"]},Gb=Object.freeze({__proto__:null,Colors:lb,Decimation:hb,Filler:Ab,Legend:zb,SubTitle:Wb,Title:Hb,Tooltip:je});const Kb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Zb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Kb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Qb=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function cd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class oa extends $n{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:Zb(i,t,rt(e,t),this._addedLabels),Qb(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 cd.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}}O(oa,"id","category"),O(oa,"defaults",{ticks:{callback:cd}});function Jb(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=r||1,p=u-1,{min:y,max:_}=t,v=!st(o),M=!st(a),D=!st(c),S=(_-y)/(d+1);let T=gc((_-y)/p/g)*g,R,E,b,x;if(T<1e-14&&!v&&!M)return[{value:y},{value:_}];x=Math.ceil(_/T)-Math.floor(y/T),x>p&&(T=gc(x*T/p/g)*g),st(l)||(R=Math.pow(10,l),T=Math.ceil(T*R)/R),s==="ticks"?(E=Math.floor(y/T)*T,b=Math.ceil(_/T)*T):(E=y,b=_),v&&M&&r&&Xg((a-o)/r,T/1e3)?(x=Math.round(Math.min((a-o)/T,u)),T=(a-o)/x,E=o,b=a):D?(E=v?o:E,b=M?a:b,x=c-1,T=(b-E)/x):(x=(b-E)/T,$i(x,Math.round(x),T/1e3)?x=Math.round(x):x=Math.ceil(x));const P=Math.max(mc(T),mc(E));R=Math.pow(10,st(l)?P:l),E=Math.round(E*R)/R,b=Math.round(b*R)/R;let I=0;for(v&&(f&&E!==o?(e.push({value:o}),E<o&&I++,$i(Math.round((E+I*T)*R)/R,o,ud(o,S,n))&&I++):E<o&&I++);I<x;++I){const C=Math.round((E+I*T)*R)/R;if(M&&C>a)break;e.push({value:C})}return M&&f&&b!==a?e.length&&$i(e[e.length-1].value,a,ud(a,S,n))?e[e.length-1].value=a:e.push({value:a}):(!M||b===a)&&e.push({value:b}),e}function ud(n,t,{horizontal:e,minRotation:i}){const s=Vt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Mr extends $n{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=He(s),c=He(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=Jb(s,r);return t.bounds==="ticks"&&pc(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 aa extends Mr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Vt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(aa,"id","linear"),O(aa,"defaults",{ticks:{callback:tr.formatters.numeric}});const ds=n=>Math.floor(bn(n)),Vn=(n,t)=>Math.pow(10,ds(n)+t);function dd(n){return n/Math.pow(10,ds(n))===1}function hd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function t0(n,t){const e=t-n;let i=ds(e);for(;hd(n,t,i)>10;)i++;for(;hd(n,t,i)<10;)i--;return Math.min(i,ds(n))}function e0(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=ds(t);let r=t0(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)),f=Me(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:dd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),f=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=Me(n.max,f);return i.push({value:g,major:dd(g),significand:d}),i}class la extends $n{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Mr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===Vn(this.min,0)?Vn(this.min,-1):Vn(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(Vn(i,-1)),o(Vn(s,1)))),i<=0&&r(Vn(s,-1)),s<=0&&o(Vn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=e0(e,this);return t.bounds==="ticks"&&pc(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=bn(t),this._valueRange=bn(this.max)-bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}O(la,"id","logarithmic"),O(la,"defaults",{ticks:{callback:tr.formatters.logarithmic,major:{enabled:!0}}});function ca(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return rt(t.font&&t.font.size,At.font.size)+e.height}return 0}function n0(n,t,e){return e=kt(e)?e:[e],{w:dp(n,t.string,e),h:e.length*t.lineHeight}}function fd(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 i0(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?ct/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=It(c.font),f=n0(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=se(n.getIndexAngle(l)+a),p=Math.round(Zs(g)),y=fd(p,u.x,f.w,0,180),_=fd(p,u.y,f.h,90,270);s0(e,t,g,y,_)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=a0(n,i,s)}function s0(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 r0(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(Zs(se(l.angle+Et))),u=u0(l.y,a.h,c),d=l0(c),f=c0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function o0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Je({x:e,y:i},t)||Je({x:e,y:r},t)||Je({x:s,y:i},t)||Je({x:s,y:r},t))}function a0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:ca(r)/2,additionalAngle:o?ct/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=r0(n,u,l);i.push(d),a==="auto"&&(d.visible=o0(d,c),d.visible&&(c=d))}return i}function l0(n){return n===0||n===180?"center":n<180?"left":"right"}function c0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function u0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function d0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=xn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,f=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),hi(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function h0(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));d0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Hn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function gd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ot);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 f0(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(),gd(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function g0(n,t,e){return wn(n,{label:e,index:t,type:"pointLabel"})}class hs extends Mr{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=Ut(ca(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=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ca(this.options))}generateTickLabels(t){Mr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=Dt(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?i0(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=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+Vt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return g0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+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(),gd(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&&h0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=s.setContext(f),p=r.setContext(f);f0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,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=It(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=Ut(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Hn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}O(hs,"id","radialLinear"),O(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:tr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(hs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(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}},ye=Object.keys(kr);function pd(n,t){return n-t}function md(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)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(_n(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function yd(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=kr[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function p0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(kr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function m0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(kr[ye[t]].common)return ye[t]}function bd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Do(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function y0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),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 _d(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:y0(n,i,s,e)}class fs extends $n{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 lu._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:md(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=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(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=Qg(s,r,o);return this._unit=e.unit||(i.autoSkip?yd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):p0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:m0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),_d(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=Qt(e,0,o),i=Qt(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||yd(r.minUnit,e,i,this._getLabelCapacity(e)),a=rt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=_n(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,a,o),g++)bd(u,f,p);return(f===i||s.bounds==="ticks"||g===1)&&bd(u,f,p),Object.keys(u).sort(pd).map(y=>+y)}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 Dt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[e],g=c&&d&&f&&f.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=Vt(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,_d(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(md(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return _c(t.sort(pd))}}O(fs,"id","time"),O(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}=Qe(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}=Qe(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 ua 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)}}O(ua,"id","timeseries"),O(ua,"defaults",fs.defaults);var b0=Object.freeze({__proto__:null,CategoryScale:oa,LinearScale:aa,LogarithmicScale:la,RadialLinearScale:hs,TimeScale:fs,TimeSeriesScale:ua});const _0=[Tm,eb,Gb,b0],xd=6048e5,x0=864e5,gs=6e4,yi=36e5,w0=1e3,wd=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wd in n?n[wd](t):n instanceof Date?new n.constructor(t):new Date(t)}function lt(n,t){return Ft(t||n,n)}function Sr(n,t,e){const i=lt(n,e==null?void 0:e.in);return isNaN(t)?Ft((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function da(n,t,e){const i=lt(n,e==null?void 0:e.in);if(isNaN(t))return Ft(n,NaN);if(!t)return i;const s=i.getDate(),r=Ft(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 ha(n,t,e){return Ft(n,+lt(n)+t)}function v0(n,t,e){return ha(n,t*yi)}let M0={};function Un(){return M0}function $e(n,t){var a,l,c,u;const e=Un(),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=lt(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 bi(n,t){return $e(n,{...t,weekStartsOn:1})}function vd(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ft(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=bi(s),o=Ft(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=bi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Tr(n){const t=lt(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 qn(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function fa(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Md(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=fa(i),o=fa(s),a=+r-Tr(r),l=+o-Tr(o);return Math.round((a-l)/x0)}function k0(n,t){const e=vd(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),bi(i)}function D0(n,t,e){const i=lt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*gs),i}function S0(n,t,e){return da(n,t*3,e)}function T0(n,t,e){return ha(n,t*1e3)}function C0(n,t,e){return Sr(n,t*7,e)}function P0(n,t,e){return da(n,t*12,e)}function ps(n,t){const e=+lt(n)-+lt(t);return e<0?-1:e>0?1:e}function O0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ga(n){return!(!O0(n)&&typeof n!="number"||isNaN(+lt(n)))}function E0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function A0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function kd(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=Dd(i,s),o=Math.abs(Md(i,s));i.setDate(i.getDate()-r*o);const a=+(Dd(i,s)===-r),l=r*(o-a);return l===0?0:l}function Dd(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 R0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=(+i-+s)/yi;return ms(e==null?void 0:e.roundingMethod)(r)}function pa(n,t){return+lt(n)-+lt(t)}function I0(n,t,e){const i=pa(n,t)/gs;return ms(e==null?void 0:e.roundingMethod)(i)}function Sd(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Td(n,t){const e=lt(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 L0(n,t){const e=lt(n,t==null?void 0:t.in);return+Sd(e,t)==+Td(e,t)}function Cd(n,t,e){const[i,s,r]=qn(e==null?void 0:e.in,n,n,t),o=ps(s,r),a=Math.abs(E0(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;L0(i)&&a===1&&ps(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function N0(n,t,e){const i=Cd(n,t,e)/3;return ms(e==null?void 0:e.roundingMethod)(i)}function F0(n,t,e){const i=pa(n,t)/1e3;return ms(e==null?void 0:e.roundingMethod)(i)}function z0(n,t,e){const i=kd(n,t,e)/7;return ms(e==null?void 0:e.roundingMethod)(i)}function B0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=ps(i,s),o=Math.abs(A0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-r,l=r*(o-+a);return l===0?0:l}function H0(n,t){const e=lt(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 W0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Y0(n,t){const e=lt(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 Pd(n,t){const e=lt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function j0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function $0(n,t){var a,l;const e=Un(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=lt(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 V0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function U0(n,t){const e=lt(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 q0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const X0={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"}},G0=(n,t,e)=>{let i;const s=X0[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 ma(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const K0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Z0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Q0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},J0={date:ma({formats:K0,defaultWidth:"full"}),time:ma({formats:Z0,defaultWidth:"full"}),dateTime:ma({formats:Q0,defaultWidth:"full"})},t_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},e_=(n,t,e,i)=>t_[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 n_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},i_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},r_={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"]},o_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},a_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},l_={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:n_,defaultWidth:"wide"}),quarter:ys({values:i_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ys({values:s_,defaultWidth:"wide"}),day:ys({values:r_,defaultWidth:"wide"}),dayPeriod:ys({values:o_,defaultWidth:"wide",formattingValues:a_,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)?u_(a,d=>d.test(o)):c_(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 c_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function u_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function d_(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 h_=/^(\d+)(th|st|nd|rd)?/i,f_=/\d+/i,g_={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},p_={any:[/^b/i,/^(a|c)/i]},m_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},y_={any:[/1/i,/2/i,/3/i,/4/i]},b_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},__={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},x_={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},w_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},v_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},M_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},k_={ordinalNumber:d_({matchPattern:h_,parsePattern:f_,valueCallback:n=>parseInt(n,10)}),era:bs({matchPatterns:g_,defaultMatchWidth:"wide",parsePatterns:p_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:m_,defaultMatchWidth:"wide",parsePatterns:y_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bs({matchPatterns:b_,defaultMatchWidth:"wide",parsePatterns:__,defaultParseWidth:"any"}),day:bs({matchPatterns:x_,defaultMatchWidth:"wide",parsePatterns:w_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:v_,defaultMatchWidth:"any",parsePatterns:M_,defaultParseWidth:"any"})},Od={code:"en-US",formatDistance:G0,formatLong:J0,formatRelative:e_,localize:l_,match:k_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function D_(n,t){const e=lt(n,t==null?void 0:t.in);return Md(e,Pd(e))+1}function Ed(n,t){const e=lt(n,t==null?void 0:t.in),i=+bi(e)-+k0(e);return Math.round(i/xd)+1}function ya(n,t){var u,d,f,g;const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Un(),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=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=Ft((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=$e(o,t),l=Ft((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=$e(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function S_(n,t){var a,l,c,u;const e=Un(),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=ya(n,t),r=Ft((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),$e(r,t)}function Ad(n,t){const e=lt(n,t==null?void 0:t.in),i=+$e(e,t)-+S_(e,t);return Math.round(i/xd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Dn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Rd={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 Dn.y(n,t)},Y:function(n,t,e,i){const s=ya(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=vd(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Dn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Ad(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Ed(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Dn.d(n,t)},D:function(n,t,e){const i=D_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=_i.noon:i===0?s=_i.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=_i.evening:i>=12?s=_i.afternoon:i>=4?s=_i.morning:s=_i.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 Dn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Dn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Dn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Dn.s(n,t)},S:function(n,t){return Dn.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 Xn(i);case"XXXXX":case"XXX":default:return Xn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ld(i);case"xxxx":case"xx":return Xn(i);case"xxxxx":case"xxx":default:return Xn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Id(i,":");case"OOOO":default:return"GMT"+Xn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Id(i,":");case"zzzz":default:return"GMT"+Xn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Id(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Ld(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Xn(n,t)}function Xn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Nd=(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"})}},Fd=(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"})}},ba={p:Fd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Nd(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}}",Nd(i,t)).replace("{{time}}",Fd(s,t))}},T_=/^D+$/,C_=/^Y+$/,P_=["D","DD","YY","YYYY"];function zd(n){return T_.test(n)}function Bd(n){return C_.test(n)}function _a(n,t,e){const i=O_(n,t,e);if(console.warn(i),P_.includes(n))throw new RangeError(i)}function O_(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 E_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,R_=/^'([^]*?)'?$/,I_=/''/g,L_=/[a-zA-Z]/;function Hd(n,t,e){var u,d,f,g,p,y,_,v;const i=Un(),s=(e==null?void 0:e.locale)??i.locale??Od,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=(f=i.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((y=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((v=(_=i.locale)==null?void 0:_.options)==null?void 0:v.weekStartsOn)??0,a=lt(n,e==null?void 0:e.in);if(!ga(a))throw new RangeError("Invalid time value");let l=t.match(A_).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=ba[D];return S(M,s.formatLong)}return M}).join("").match(E_).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:N_(M)};if(Rd[D])return{isToken:!0,value:M};if(D.match(L_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Bd(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&zd(D))&&_a(D,t,String(n));const S=Rd[D[0]];return S(a,D,s.localize,c)}).join("")}function N_(n){const t=n.match(R_);return t?t[1].replace(I_,"'"):n}function Wd(){return Object.assign({},Un())}function F_(n,t){const e=lt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function z_(n,t){const e=B_(t)?new t(0):Ft(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function B_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const H_=10;class Yd{constructor(){O(this,"subPriority",0)}validate(t,e){return!0}}class W_ extends Yd{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 Y_ extends Yd{constructor(e,i){super();O(this,"priority",H_);O(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,z_(e,this.context))}}class wt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new W_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class j_ extends wt{constructor(){super(...arguments);O(this,"priority",140);O(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 Yt={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}/},Ve={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 jt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*yi+r*gs+o*w0),rest:t.slice(e[0].length)}}function jd(n){return Lt(Yt.anyDigitsSigned,n)}function zt(n,t){switch(n){case 1:return Lt(Yt.singleDigit,t);case 2:return Lt(Yt.twoDigits,t);case 3:return Lt(Yt.threeDigits,t);case 4:return Lt(Yt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Cr(n,t){switch(n){case 1:return Lt(Yt.singleDigitSigned,t);case 2:return Lt(Yt.twoDigitsSigned,t);case 3:return Lt(Yt.threeDigitsSigned,t);case 4:return Lt(Yt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function xa(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 $d(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 Vd(n){return n%400===0||n%4===0&&n%100!==0}class $_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(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 jt(zt(4,e),r);case"yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(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=$d(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 V_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(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 jt(zt(4,e),r);case"Yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=ya(e,r);if(s.isTwoDigitYear){const l=$d(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(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),$e(e,r)}}class U_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Cr(i==="R"?4:i.length,e)}set(e,i,s){const r=Ft(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),bi(r)}}class q_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Cr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class X_ extends wt{constructor(){super(...arguments);O(this,"priority",120);O(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 zt(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 G_ extends wt{constructor(){super(...arguments);O(this,"priority",120);O(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 zt(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 K_ extends wt{constructor(){super(...arguments);O(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);O(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return jt(Lt(Yt.month,e),r);case"MM":return jt(zt(2,e),r);case"Mo":return jt(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 Z_ extends wt{constructor(){super(...arguments);O(this,"priority",110);O(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 jt(Lt(Yt.month,e),r);case"LL":return jt(zt(2,e),r);case"Lo":return jt(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 Q_(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Ad(i,e)-t;return i.setDate(i.getDate()-s*7),lt(i,e==null?void 0:e.in)}class J_ extends wt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Yt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return $e(Q_(e,s,r),r)}}function tx(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Ed(i,e)-t;return i.setDate(i.getDate()-s*7),i}class ex extends wt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Yt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return bi(tx(e,s))}}const nx=[31,28,31,30,31,30,31,31,30,31,30,31],ix=[31,29,31,30,31,30,31,31,30,31,30,31];class sx extends wt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subPriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Yt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Vd(s),o=e.getMonth();return r?i>=1&&i<=ix[o]:i>=1&&i<=nx[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class rx extends wt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subpriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Yt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear();return Vd(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 wa(n,t,e){var d,f,g,p;const i=Un(),s=(e==null?void 0:e.weekStartsOn)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=lt(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 Sr(r,u,e)}class ox extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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=wa(e,s,r),e.setHours(0,0,0,0),e}}class ax extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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 jt(zt(i.length,e),o);case"eo":return jt(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=wa(e,s,r),e.setHours(0,0,0,0),e}}class lx extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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 jt(zt(i.length,e),o);case"co":return jt(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=wa(e,s,r),e.setHours(0,0,0,0),e}}function cx(n,t,e){const i=lt(n,e==null?void 0:e.in),s=F_(i,e),r=t-s;return Sr(i,r,e)}class ux extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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 zt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return jt(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 jt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return jt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return jt(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=cx(e,s),e.setHours(0,0,0,0),e}}class dx extends wt{constructor(){super(...arguments);O(this,"priority",80);O(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(xa(s),0,0,0),e}}class hx extends wt{constructor(){super(...arguments);O(this,"priority",80);O(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(xa(s),0,0,0),e}}class fx extends wt{constructor(){super(...arguments);O(this,"priority",80);O(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(xa(s),0,0,0),e}}class gx extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Yt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(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 px extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Yt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class mx extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Yt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class yx extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Yt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(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 bx extends wt{constructor(){super(...arguments);O(this,"priority",60);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Yt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class _x extends wt{constructor(){super(...arguments);O(this,"priority",50);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Yt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class xx extends wt{constructor(){super(...arguments);O(this,"priority",30);O(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return jt(zt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class wx extends wt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue(Ve.basicOptionalMinutes,e);case"XX":return Ue(Ve.basic,e);case"XXXX":return Ue(Ve.basicOptionalSeconds,e);case"XXXXX":return Ue(Ve.extendedOptionalSeconds,e);case"XXX":default:return Ue(Ve.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Tr(e)-s)}}class vx extends wt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue(Ve.basicOptionalMinutes,e);case"xx":return Ue(Ve.basic,e);case"xxxx":return Ue(Ve.basicOptionalSeconds,e);case"xxxxx":return Ue(Ve.extendedOptionalSeconds,e);case"xxx":default:return Ue(Ve.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Tr(e)-s)}}class Mx extends wt{constructor(){super(...arguments);O(this,"priority",40);O(this,"incompatibleTokens","*")}parse(e){return jd(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class kx extends wt{constructor(){super(...arguments);O(this,"priority",20);O(this,"incompatibleTokens","*")}parse(e){return jd(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const Dx={G:new j_,y:new $_,Y:new V_,R:new U_,u:new q_,Q:new X_,q:new G_,M:new K_,L:new Z_,w:new J_,I:new ex,d:new sx,D:new rx,E:new ox,e:new ax,c:new lx,i:new ux,a:new dx,b:new hx,B:new fx,h:new gx,H:new px,K:new mx,k:new yx,m:new bx,s:new _x,S:new xx,X:new wx,x:new vx,t:new Mx,T:new kx},Sx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cx=/^'([^]*?)'?$/,Px=/''/g,Ox=/\S/,Ex=/[a-zA-Z]/;function Ax(n,t,e,i){var _,v,M,D,S,T,R,E;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=Wd(),o=(i==null?void 0:i.locale)??r.locale??Od,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(_=i==null?void 0:i.locale)==null?void 0:_.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(M=r.locale)==null?void 0:M.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((T=(S=i==null?void 0:i.locale)==null?void 0:S.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((E=(R=r.locale)==null?void 0:R.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():lt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new Y_(i==null?void 0:i.in,e)],d=t.match(Tx).map(b=>{const x=b[0];if(x in ba){const P=ba[x];return P(b,o.formatLong)}return b}).join("").match(Sx),f=[];for(let b of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Bd(b)&&_a(b,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&zd(b)&&_a(b,t,n);const x=b[0],P=Dx[x];if(P){const{incompatibleTokens:I}=P;if(Array.isArray(I)){const F=f.find(q=>I.includes(q.token)||q.token===x);if(F)throw new RangeError(`The format string mustn't contain \`${F.fullToken}\` and \`${b}\` at the same time`)}else if(P.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:x,fullToken:b});const C=P.run(n,b,o.match,c);if(!C)return s();u.push(C.setter),n=C.rest}else{if(x.match(Ex))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");if(b==="''"?b="'":x==="'"&&(b=Rx(b)),n.indexOf(b)===0)n=n.slice(b.length);else return s()}}if(n.length>0&&Ox.test(n))return s();const g=u.map(b=>b.priority).sort((b,x)=>x-b).filter((b,x,P)=>P.indexOf(b)===x).map(b=>u.filter(x=>x.priority===b).sort((x,P)=>P.subPriority-x.subPriority)).map(b=>b[0]);let p=lt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const y={};for(const b of g){if(!b.validate(p,c))return s();const x=b.set(p,y,c);Array.isArray(x)?(p=x[0],Object.assign(y,x[1])):p=x}return p}function Rx(n){return n.match(Cx)[1].replace(Px,"'")}function Ix(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Lx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Nx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Fx(n){const t=n/yi;return Math.trunc(t)}function Ud(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Wx(n);let r;if(s.date){const c=Yx(s.date,i);r=jx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=$x(s.time),isNaN(a)))return e();if(s.timezone){if(l=Vx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=lt(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 lt(o+a+l,t==null?void 0:t.in)}const Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},zx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Bx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Hx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Wx(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 Yx(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 jx(n,t){if(t===null)return new Date(NaN);const e=n.match(zx);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 Kx(t,a,l)?Ux(t,a,l):new Date(NaN);{const c=new Date(0);return!Xx(t,r,o)||!Gx(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function _s(n){return n?parseInt(n):1}function $x(n){const t=n.match(Bx);if(!t)return NaN;const e=va(t[1]),i=va(t[2]),s=va(t[3]);return Zx(e,i,s)?e*yi+i*gs+s*1e3:NaN}function va(n){return n&&parseFloat(n.replace(",","."))||0}function Vx(n){if(n==="Z")return 0;const t=n.match(Hx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Qx(i,s)?e*(i*yi+s*gs):NaN}function Ux(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 qx=[31,null,31,30,31,30,31,31,30,31,30,31];function qd(n){return n%400===0||n%4===0&&n%100!==0}function Xx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(qx[t]||(qd(n)?29:28))}function Gx(n,t){return t>=1&&t<=(qd(n)?366:365)}function Kx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Zx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Qx(n,t){return t>=0&&t<=59}const Or=n=>["interactive","zoom-interactive"].includes(n),Jx=(n,t,e)=>{var r,o;const{tooltip:i}=t;if(i.opacity===0&&!Or(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(i.body&&!Or(n.interactionMode)){const a=i.labelColors,l=((o=(r=t.chart.config)==null?void 0:r.options)==null?void 0:o.indexAxis)==="y"?"x":"y";n.tooltipContext=wh(new Date(i.dataPoints[0].parsed.x),e,!0),n.tooltipSeries=i.dataPoints.map((c,u)=>{const d=c.parsed[l],f=vh(d,n.units,{translateUnit:n.translateUnit}),g=c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(s),n.left=`${i.x}px`,n.top=`${i.y}px`,n.showTooltip=!0}},Xd=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!Or(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!Or(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[a],f=vh(d,n.units,{translateUnit:n.translateUnit});let g;return l?g=c.dataset.labels[c.dataIndex]:g=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},tw=n=>n&&n.datasets&&n.datasets.length,ew=n=>tw(n)&&n.datasets.some(t=>t.data.length),nw=n=>n.datasets.some(t=>t.data[0]&&ga(t.data[0].x)),iw=n=>!!ew(n)&&n.datasets.some(t=>t.data.length==1),sw=n=>nw(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ma=(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)},rw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function ka(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Gd=(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)},ow=2,Kd=10,Zd=12,Da=new Intl.NumberFormat(((hg=document==null?void 0:document.documentElement)==null?void 0:hg.lang)||"en-US"),Er=10,Qd={"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"}},sn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ar=(n,t)=>(t||sn)[n%sn.length],Jd=(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}`},th="#6f7787",eh={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"}},aw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=eh[t])==null?void 0:e.background)||"#fafafa"},lw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},cw={"4XX":"#FFBA81","5XX":"#FF8484"},uw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},dw="#dad4c7",nh="#afb7c5",hw=n=>{const t=Object.entries(Qd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Qd.standard},Sa=(n,t,e,i)=>{let s;return e?s=nh:Array.isArray(i)?s=Ar(n,i):s=i[t],s||Ar(n)},fw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},gw=2,pw=0,Ta=new Map,Ca=(n,t)=>t==="bytes"?Lr(n):t==="count/minute"?n.toFixed(2):Da.format(n),ih=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},mw=()=>{const n="label_height";if(!Ta.has(n)){const t=It({});Ta.set(n,t.lineHeight)}return Ta.get(n)},yw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),sh=(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),rh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Pa="#e0e4ea",bw={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=bw[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},oh=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])]]),Oa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=oh.get(e);return i===void 0?Pa:i.get(t)??i.get(-1)??Pa},_w=n=>{const t=Oa(n);return{solid:t,light:t}},Rr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Oa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function ah(n,t,e){const i=Wd(),s=vw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?xw(s,t):ww(s,t)}function xw(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 ww(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function vw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Mw(n,t){const e=Cw(t);return"formatToParts"in e?Dw(e,n):Sw(e,n)}const kw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Dw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=kw[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 Sw(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 Ea={},lh=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")),Tw=lh==="06/25/2014, 00:00:00"||lh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Cw(n){return Ea[n]||(Ea[n]=Tw?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"})),Ea[n]}function ch(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 uh=36e5,Pw=6e4,Aa={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ra(n,t,e){if(!n)return 0;let i=Aa.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Aa.timezoneHH.exec(n),i)return s=parseInt(i[1],10),dh(s)?-(s*uh):NaN;if(i=Aa.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return dh(s,o)?(r=Math.abs(s)*uh+o*Pw,i[1]==="+"?-r:r):NaN}if(Aw(n)){t=new Date(t||Date.now());const o=e?t:Ow(t),a=Ia(o,n);return-(e?a:Ew(t,a,n))}return NaN}function Ow(n){return ch(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ia(n,t){const e=Mw(n,t),i=ch(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 Ew(n,t,e){let s=n.getTime()-t;const r=Ia(new Date(s),e);if(t===r)return t;s-=r-t;const o=Ia(new Date(s),e);return r===o?r:Math.max(r,o)}function dh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const hh={};function Aw(n){if(hh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),hh[n]=!0,!0}catch{return!1}}const Rw=60*1e3,Iw={X:function(n,t,e){const i=La(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return fh(i);case"XXXX":case"XX":return xi(i);case"XXXXX":case"XXX":default:return xi(i,":")}},x:function(n,t,e){const i=La(e.timeZone,n);switch(t){case"x":return fh(i);case"xxxx":case"xx":return xi(i);case"xxxxx":case"xxx":default:return xi(i,":")}},O:function(n,t,e){const i=La(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Lw(i,":");case"OOOO":default:return"GMT"+xi(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 La(n,t){const e=n?Ra(n,t,!0)/Rw:(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 xi(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 fh(n,t){return n%60===0?(n>0?"-":"+")+Ir(Math.abs(n)/60,2):xi(n,t)}function Lw(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 gh(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 Nw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Na=36e5,ph=6e4,Fw=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Nw};function mh(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?Fw: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=zw(n),{year:s,restDateString:r}=Bw(i.date,e),o=Hw(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=Ww(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ra(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=gh(new Date(a+l)),c=gh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function zw(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 Bw(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 Hw(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,_h(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 $w(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 _h(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,xh(s)?yh(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 xh(s,o)?yh(t,s,o):new Date(NaN)}return null}function Ww(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Fa(t)?t%24*Na:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Fa(t,e)?t%24*Na+e*ph: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 Fa(t,e,s)?t%24*Na+e*ph+s*1e3:NaN}return null}function yh(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 Yw=[31,28,31,30,31,30,31,31,30,31,30,31],jw=[31,29,31,30,31,30,31,31,30,31,30,31];function bh(n){return n%400===0||n%4===0&&n%100!==0}function _h(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=bh(n);if(i&&e>jw[t]||!i&&e>Yw[t])return!1}return!0}function $w(n,t){if(t<1)return!1;const e=bh(n);return!(e&&t>366||!e&&t>365)}function xh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Fa(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Vw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function za(n,t,e={}){t=String(t);const i=t.match(Vw);if(i){const s=mh(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,"'"+Iw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Hd(n,t,e)}function Uw(n,t,e){n=mh(n,e);const i=Ra(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 Gn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},za(Uw(n,t,{timeZone:i.timeZone}),e,i)}const wh=(n,t,e,i)=>{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;switch(t){case"secondly":case"tenSecondly":case"thirtySecondly":return Gn(n,s,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a");case"minutely":case"fiveMinutely":case"tenMinutely":case"thirtyMinutely":case"hourly":case"twoHourly":return Gn(n,s,e?"yyyy-MM-dd h:mm a":"h:mm a");case"twelveHourly":return Gn(n,s,"yyyy-MM-dd h:mm a");case"daily":return Gn(n,s,"yyyy-MM-dd");case"weekly":return`${Gn(n,s,"yyyy")} W${Gn(n,s,"II")}`;default:return Gn(n,s,"yyyy-MM-dd h:mm:ss a")}},Lr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=yt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},qw=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=yt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},vh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return Lr(n,e);case"usd":return qw(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${Da.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}};function Xw(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};je.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=u.width/2,g=Ma(c,d,f),p=c.y,y=c.x<f?"left":"center";return{x:g-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:y}},qo.modes.customInteractionMode=function(l,c){const u=vn(c,l),d=[];return qo.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,g,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p})}),d};const s=n.numLabels.value>25?Kd:Zd,r=({chart:l,index:c})=>{var d;const u=l.data;return{size:s,style:(d=u==null?void 0:u.isLabelEmpty)!=null&&d[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Er?c.slice(0,Er)+"...":c):l.getLabelForValue(Number(c)),a=h.computed(()=>{var l,c,u,d,f,g,p,y;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:r,callback:function(_,v){return o(this,_,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(_,v){return o(this,_,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((g=n.dimensionAxesTitle)==null?void 0:g.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(y=n.dimensionAxesTitle)==null?void 0:y.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:_=>{Xd(n.tooltipState,_)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),a}Se.register(..._0);const Gw=(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 Kw(n,t,e,i,s){const r=h.shallowRef(null),o=(a,l)=>{if(t.value)return new Se(t.value,{type:n,data:a,plugins:i,options:l})};return h.onMounted(()=>{r.value=o(e.value,s.value)}),h.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),h.watch(e,(a,l)=>{if(Gw(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)}),h.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),h.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 be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ba(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,y){y&&y%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?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",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Mh);var Zw=Mh.exports;const ws=Ba(Zw);function Qw(n,t,e){const{i18n:i}=yt.useI18n(),{translateUnit:s}=yt.useTranslatedUnits();return{legendValues:h.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=Lr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ws(l,{capital:!0}),unit:u})||`${ws(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var Jw=Object.defineProperty,t1=(n,t,e)=>t in n?Jw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Te=(n,t,e)=>t1(n,typeof t!="symbol"?t+"":t,e),pt=(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))(pt||{});const kh=["in","not_in","selector"],Dh=["empty","not_empty"],e1=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],vs=n=>n.filter(t=>t!=="time"),Sh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Ha=vs(Sh),n1=["active_services","request_count","request_per_minute","response_latency_average"],i1=[...Sh,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Wa=vs(i1);[...n1];const s1=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Ya=vs(s1);vs(["api","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","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),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(Ha),new Set(Wa),new Set(Ya),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Dh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Wa,...Ha,...Ya])]),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Dh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Wa,...Ha,...Ya])]);const Th=6048e5,r1=864e5,o1=60,a1=3600,Ch=Symbol.for("constructDateFrom");function Ce(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Ch in n?n[Ch](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Ce(t||n,n)}function Ph(n,t,e){const i=de(n,void 0);return isNaN(t)?Ce(n,NaN):(i.setDate(i.getDate()+t),i)}function l1(n,t,e){const i=de(n,void 0);if(isNaN(t))return Ce(n,NaN);const s=i.getDate(),r=Ce(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 c1={};function Ms(){return c1}function rn(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=de(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 rn(n,{...t,weekStartsOn:1})}function Oh(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Ce(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Nr(s),o=Ce(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 Eh(n){const t=de(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 u1(n,...t){const e=Ce.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Fr(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function d1(n,t,e){const[i,s]=u1(void 0,n,t),r=Fr(i),o=Fr(s),a=+r-Eh(r),l=+o-Eh(o);return Math.round((a-l)/r1)}function h1(n,t){const e=Oh(n),i=Ce(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Nr(i)}function f1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function g1(n){return!(!f1(n)&&typeof n!="number"||isNaN(+de(n)))}function wi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function p1(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const m1={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"}},y1=(n,t,e)=>{let i;const s=m1[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 ja(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const b1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},x1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},w1={date:ja({formats:b1,defaultWidth:"full"}),time:ja({formats:_1,defaultWidth:"full"}),dateTime:ja({formats:x1,defaultWidth:"full"})},v1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},M1=(n,t,e,i)=>v1[n];function ks(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const 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 k1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},D1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},S1={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"]},T1={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"]},C1={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"}},P1={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"}},O1=(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"},E1={ordinalNumber:O1,era:ks({values:k1,defaultWidth:"wide"}),quarter:ks({values:D1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ks({values:S1,defaultWidth:"wide"}),day:ks({values:T1,defaultWidth:"wide"}),dayPeriod:ks({values:C1,defaultWidth:"wide",formattingValues:P1,defaultFormattingWidth:"wide"})};function Ds(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)?R1(a,d=>d.test(o)):A1(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 A1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function R1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function I1(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 L1=/^(\d+)(th|st|nd|rd)?/i,N1=/\d+/i,F1={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},z1={any:[/^b/i,/^(a|c)/i]},B1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},H1={any:[/1/i,/2/i,/3/i,/4/i]},W1={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},Y1={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]},j1={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},$1={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]},V1={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},U1={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}},q1={ordinalNumber:I1({matchPattern:L1,parsePattern:N1,valueCallback:n=>parseInt(n,10)}),era:Ds({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),quarter:Ds({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ds({matchPatterns:W1,defaultMatchWidth:"wide",parsePatterns:Y1,defaultParseWidth:"any"}),day:Ds({matchPatterns:j1,defaultMatchWidth:"wide",parsePatterns:$1,defaultParseWidth:"any"}),dayPeriod:Ds({matchPatterns:V1,defaultMatchWidth:"any",parsePatterns:U1,defaultParseWidth:"any"})},X1={code:"en-US",formatDistance:y1,formatLong:w1,formatRelative:M1,localize:E1,match:q1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function G1(n,t){const e=de(n,void 0);return d1(e,p1(e))+1}function K1(n,t){const e=de(n,void 0),i=+Nr(e)-+h1(e);return Math.round(i/Th)+1}function Ah(n,t){var e,i,s,r;const o=de(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=Ce((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=rn(u,t),f=Ce((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const g=rn(f,t);return+o>=+d?a+1:+o>=+g?a:a-1}function Z1(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=Ah(n,t),c=Ce((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),rn(c,t)}function Q1(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+Z1(e,t);return Math.round(i/Th)+1}function Ct(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 Ct(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Ct(e+1,2)},d(n,t){return Ct(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 Ct(n.getHours()%12||12,t.length)},H(n,t){return Ct(n.getHours(),t.length)},m(n,t){return Ct(n.getMinutes(),t.length)},s(n,t){return Ct(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Ct(s,t.length)}},vi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Rh={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=Ah(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Ct(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=Oh(n);return Ct(e,t.length)},u:function(n,t){const e=n.getFullYear();return Ct(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 Ct(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 Ct(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 Ct(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=Q1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=K1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Ct(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=G1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Ct(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 Ct(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 Ct(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 Ct(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=vi.noon:i===0?s=vi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=vi.evening:i>=12?s=vi.afternoon:i>=4?s=vi.morning:s=vi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return 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"}):Ct(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(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 Lh(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 Lh(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"+Ih(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"+Ih(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Ct(i,t.length)},T:function(n,t,e){return Ct(+n,t.length)}};function Ih(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+Ct(r,2)}function Lh(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ct(Math.trunc(i/60),2),r=Ct(i%60,2);return e+s+t+r}const Nh=(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"})}},Fh=(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"})}},J1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Nh(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}}",Nh(i,t)).replace("{{time}}",Fh(s,t))},tv={p:Fh,P:J1},ev=/^D+$/,nv=/^Y+$/,iv=["D","DD","YY","YYYY"];function sv(n){return ev.test(n)}function rv(n){return nv.test(n)}function ov(n,t,e){const i=av(n,t,e);if(console.warn(i),iv.includes(n))throw new RangeError(i)}function av(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const lv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uv=/^'([^]*?)'?$/,dv=/''/g,hv=/[a-zA-Z]/;function fv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ms(),f=(e==null?void 0:e.locale)??d.locale??X1,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,y=de(n,e==null?void 0:e.in);if(!g1(y))throw new RangeError("Invalid time value");let _=t.match(cv).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=tv[D];return S(M,f.formatLong)}return M}).join("").match(lv).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:gv(M)};if(Rh[D])return{isToken:!0,value:M};if(D.match(hv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(_=f.localize.preprocessor(y,_));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:f};return _.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&rv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&sv(D))&&ov(D,t,String(n));const S=Rh[D[0]];return S(y,D,f.localize,v)}).join("")}function gv(n){const t=n.match(uv);return t?t[1].replace(dv,"'"):n}function pv(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ce(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function mv(){return Object.assign({},Ms())}function yv(n){return Math.trunc(n*a1)}function bv(n){const t=n/o1;return Math.trunc(t)}function zh(n,t,e){return l1(n,-1)}function Bh(n,t,e){const i=mv(),s=wv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?_v(s,t):xv(s,t)}function _v(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 xv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function wv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function vv(n,t){const e=Tv(t);return"formatToParts"in e?kv(e,n):Dv(e,n)}const Mv={year:0,month:1,day:2,hour:3,minute:4,second:5};function kv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Mv[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 Dv(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 $a={},Hh=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")),Sv=Hh==="06/25/2014, 00:00:00"||Hh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Tv(n){return $a[n]||($a[n]=Sv?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"})),$a[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 Wh=36e5,Cv=6e4,Ua={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ss(n,t,e){if(!n)return 0;let i=Ua.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ua.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Yh(s)?-(s*Wh):NaN;if(i=Ua.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Yh(s,o)?(r=Math.abs(s)*Wh+o*Cv,i[1]==="+"?-r:r):NaN}if(Ev(n)){t=new Date(t||Date.now());const o=e?t:Pv(t),a=qa(o,n);return-(e?a:Ov(t,a,n))}return NaN}function Pv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function qa(n,t){const e=vv(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 Ov(n,t,e){let i=n.getTime()-t;const s=qa(new Date(i),e);if(t===s)return t;i-=s-t;const r=qa(new Date(i),e);return s===r?s:Math.max(s,r)}function Yh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const jh={};function Ev(n){if(jh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),jh[n]=!0,!0}catch{return!1}}const Av=60*1e3,Rv={X:function(n,t,e){const i=Xa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return $h(i);case"XXXX":case"XX":return Mi(i);case"XXXXX":case"XXX":default:return Mi(i,":")}},x:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"x":return $h(i);case"xxxx":case"xx":return Mi(i);case"xxxxx":case"xxx":default:return Mi(i,":")}},O:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Iv(i,":");case"OOOO":default:return"GMT"+Mi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Bh("short",n,e);case"zzzz":default:return Bh("long",n,e)}}};function Xa(n,t){const e=n?Ss(n,t,!0)/Av:(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 Mi(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 $h(n,t){return n%60===0?(n>0?"-":"+")+zr(Math.abs(n)/60,2):Mi(n,t)}function Iv(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 Vh(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 Uh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ga=36e5,qh=6e4,Lv=2,he={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Uh};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?Lv: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=Nv(n),{year:s,restDateString:r}=Fv(i.date,e),o=zv(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=Bv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ss(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Vh(new Date(a+l)),c=Vh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Nv(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Fv(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function zv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Kh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Yv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Kh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Zh(s)?Xh(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Zh(s,o)?Xh(t,s,o):new Date(NaN)}return null}function Bv(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ka(t)?t%24*Ga:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ka(t,e)?t%24*Ga+e*qh:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ka(t,e,s)?t%24*Ga+e*qh+s*1e3:NaN}return null}function Xh(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 Hv=[31,28,31,30,31,30,31,31,30,31,30,31],Wv=[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 Kh(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>Wv[t]||!i&&e>Hv[t])return!1}return!0}function Yv(n,t){if(t<1)return!1;const e=Gh(n);return!(e&&t>366||!e&&t>365)}function Zh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ka(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const jv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function $v(n,t,e={}){t=String(t);const i=t.match(jv);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,"'"+Rv[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return fv(n,t,e)}function Qh(n,t,e){n=Br(n,e);const i=Ss(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 Vv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},$v(Qh(n,t,{timeZone:i.timeZone}),e,i)}function Uv(n,t,e){if(typeof n=="string"&&!n.match(Uh))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=Ss(t,new Date(i));return new Date(i+s)}function qv(n,t){return-Ss(n,t)}function Tn(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 Vv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Xv={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 Za(n){return n&&e1.find(t=>n<=Xv[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]",f="[object Map]",g="[object Number]",p="[object Object]",y="[object Promise]",_="[object RegExp]",v="[object Set]",M="[object String]",D="[object Symbol]",S="[object WeakMap]",T="[object ArrayBuffer]",R="[object DataView]",E="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",P="[object Int16Array]",I="[object Int32Array]",C="[object Uint8Array]",F="[object Uint8ClampedArray]",q="[object Uint16Array]",G="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,U=/\w*$/,ut=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,K={};K[r]=K[o]=K[T]=K[R]=K[a]=K[l]=K[E]=K[b]=K[x]=K[P]=K[I]=K[f]=K[g]=K[p]=K[_]=K[v]=K[M]=K[D]=K[C]=K[F]=K[q]=K[G]=!0,K[c]=K[u]=K[S]=!1;var B=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,j=typeof self=="object"&&self&&self.Object===Object&&self,H=B||j||Function("return this")(),xt=t&&!t.nodeType&&t,mt=xt&&!0&&n&&!n.nodeType&&n,vt=mt&&mt.exports===xt;function ft(w,A){return w.set(A[0],A[1]),w}function gt(w,A){return w.add(A),w}function z(w,A){for(var N=-1,X=w?w.length:0;++N<X&&A(w[N],N,w)!==!1;);return w}function $(w,A){for(var N=-1,X=A.length,$t=w.length;++N<X;)w[$t+N]=A[N];return w}function Y(w,A,N,X){for(var $t=-1,Kt=w?w.length:0;++$t<Kt;)N=A(N,w[$t],$t,w);return N}function Q(w,A){for(var N=-1,X=Array(w);++N<w;)X[N]=A(N);return X}function tt(w,A){return w==null?void 0:w[A]}function et(w){var A=!1;if(w!=null&&typeof w.toString!="function")try{A=!!(w+"")}catch{}return A}function it(w){var A=-1,N=Array(w.size);return w.forEach(function(X,$t){N[++A]=[$t,X]}),N}function nt(w,A){return function(N){return w(A(N))}}function _t(w){var A=-1,N=Array(w.size);return w.forEach(function(X){N[++A]=X}),N}var at=Array.prototype,Pt=Function.prototype,te=Object.prototype,ae=H["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Oe=Pt.toString,Mt=te.hasOwnProperty,Xt=te.toString,Bt=RegExp("^"+Oe.call(Mt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?H.Buffer:void 0,ie=H.Symbol,qe=H.Uint8Array,ni=nt(Object.getPrototypeOf,Object),Ne=Object.create,Ht=te.propertyIsEnumerable,_e=at.splice,ii=Object.getOwnPropertySymbols,to=Gt?Gt.isBuffer:void 0,eo=nt(Object.keys,Object),Rs=In(H,"DataView"),si=In(H,"Map"),Is=In(H,"Promise"),ri=In(H,"Set"),an=In(H,"WeakMap"),ln=In(Object,"create"),Ls=le(Rs),Ns=le(si),oi=le(Is),_l=le(ri),xl=le(an),no=ie?ie.prototype:void 0,io=no?no.valueOf:void 0;function cn(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var X=w[A];this.set(X[0],X[1])}}function Oi(){this.__data__=ln?ln(null):{}}function Fs(w){return this.has(w)&&delete this.__data__[w]}function so(w){var A=this.__data__;if(ln){var N=A[w];return N===i?void 0:N}return Mt.call(A,w)?A[w]:void 0}function un(w){var A=this.__data__;return ln?A[w]!==void 0:Mt.call(A,w)}function wl(w,A){var N=this.__data__;return N[w]=ln&&A===void 0?i:A,this}cn.prototype.clear=Oi,cn.prototype.delete=Fs,cn.prototype.get=so,cn.prototype.has=un,cn.prototype.set=wl;function Fe(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var X=w[A];this.set(X[0],X[1])}}function vl(){this.__data__=[]}function Ml(w){var A=this.__data__,N=Ai(A,w);if(N<0)return!1;var X=A.length-1;return N==X?A.pop():_e.call(A,N,1),!0}function kl(w){var A=this.__data__,N=Ai(A,w);return N<0?void 0:A[N][1]}function ze(w){return Ai(this.__data__,w)>-1}function Dl(w,A){var N=this.__data__,X=Ai(N,w);return X<0?N.push([w,A]):N[X][1]=A,this}Fe.prototype.clear=vl,Fe.prototype.delete=Ml,Fe.prototype.get=kl,Fe.prototype.has=ze,Fe.prototype.set=Dl;function An(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var X=w[A];this.set(X[0],X[1])}}function Sl(){this.__data__={hash:new cn,map:new(si||Fe),string:new cn}}function Tl(w){return Li(this,w).delete(w)}function Cl(w){return Li(this,w).get(w)}function Be(w){return Li(this,w).has(w)}function Pl(w,A){return Li(this,w).set(w,A),this}An.prototype.clear=Sl,An.prototype.delete=Tl,An.prototype.get=Cl,An.prototype.has=Be,An.prototype.set=Pl;function Rn(w){this.__data__=new Fe(w)}function Ol(){this.__data__=new Fe}function El(w){return this.__data__.delete(w)}function Al(w){return this.__data__.get(w)}function Ei(w){return this.__data__.has(w)}function Rl(w,A){var N=this.__data__;if(N instanceof Fe){var X=N.__data__;if(!si||X.length<e-1)return X.push([w,A]),this;N=this.__data__=new An(X)}return N.set(w,A),this}Rn.prototype.clear=Ol,Rn.prototype.delete=El,Rn.prototype.get=Al,Rn.prototype.has=Ei,Rn.prototype.set=Rl;function Il(w,A){var N=Ws(w)||Fi(w)?Q(w.length,String):[],X=N.length,$t=!!X;for(var Kt in w)Mt.call(w,Kt)&&!($t&&(Kt=="length"||Zl(Kt,X)))&&N.push(Kt);return N}function Ee(w,A,N){var X=w[A];(!(Mt.call(w,A)&&Hs(X,N))||N===void 0&&!(A in w))&&(w[A]=N)}function Ai(w,A){for(var N=w.length;N--;)if(Hs(w[N][0],A))return N;return-1}function Ll(w,A){return w&&ro(A,ai(A),w)}function zs(w,A,N,X,$t,Kt,xe){var ee;if(X&&(ee=Kt?X(w,$t,Kt,xe):X(w)),ee!==void 0)return ee;if(!hn(w))return w;var fo=Ws(w);if(fo){if(ee=Gl(w),!A)return Ul(w,ee)}else{var Ln=Xe(w),go=Ln==u||Ln==d;if(co(w))return Hl(w,A);if(Ln==p||Ln==r||go&&!Kt){if(et(w))return Kt?w:{};if(ee=ao(go?{}:w),!A)return ql(w,Ll(ee,w))}else{if(!K[Ln])return Kt?w:{};ee=Kl(w,Ln,zs,A)}}xe||(xe=new Rn);var po=xe.get(w);if(po)return po;if(xe.set(w,ee),!fo)var li=N?Xl(w):ai(w);return z(li||w,function(js,zi){li&&(zi=js,js=w[zi]),Ee(ee,zi,zs(js,A,N,X,zi,w,xe))}),ee}function Nl(w){return hn(w)?Ne(w):{}}function Fl(w,A,N){var X=A(w);return Ws(w)?X:$(X,N(w))}function zl(w){return Xt.call(w)}function Ri(w){if(!hn(w)||Ql(w))return!1;var A=Ys(w)||et(w)?Bt:ut;return A.test(le(w))}function Bl(w){if(!dn(w))return eo(w);var A=[];for(var N in Object(w))Mt.call(w,N)&&N!="constructor"&&A.push(N);return A}function Hl(w,A){if(A)return w.slice();var N=new w.constructor(w.length);return w.copy(N),N}function Ii(w){var A=new w.constructor(w.byteLength);return new qe(A).set(new qe(w)),A}function Wl(w,A){var N=A?Ii(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.byteLength)}function Yl(w,A,N){var X=A?N(it(w),!0):it(w);return Y(X,ft,new w.constructor)}function Bs(w){var A=new w.constructor(w.source,U.exec(w));return A.lastIndex=w.lastIndex,A}function jl(w,A,N){var X=A?N(_t(w),!0):_t(w);return Y(X,gt,new w.constructor)}function $l(w){return io?Object(io.call(w)):{}}function Vl(w,A){var N=A?Ii(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.length)}function Ul(w,A){var N=-1,X=w.length;for(A||(A=Array(X));++N<X;)A[N]=w[N];return A}function ro(w,A,N,X){N||(N={});for(var $t=-1,Kt=A.length;++$t<Kt;){var xe=A[$t],ee=void 0;Ee(N,xe,ee===void 0?w[xe]:ee)}return N}function ql(w,A){return ro(w,oo(w),A)}function Xl(w){return Fl(w,ai,oo)}function Li(w,A){var N=w.__data__;return Ni(A)?N[typeof A=="string"?"string":"hash"]:N.map}function In(w,A){var N=tt(w,A);return Ri(N)?N:void 0}var oo=ii?nt(ii,Object):uo,Xe=zl;(Rs&&Xe(new Rs(new ArrayBuffer(1)))!=R||si&&Xe(new si)!=f||Is&&Xe(Is.resolve())!=y||ri&&Xe(new ri)!=v||an&&Xe(new an)!=S)&&(Xe=function(w){var A=Xt.call(w),N=A==p?w.constructor:void 0,X=N?le(N):void 0;if(X)switch(X){case Ls:return R;case Ns:return f;case oi:return y;case _l:return v;case xl:return S}return A});function Gl(w){var A=w.length,N=w.constructor(A);return A&&typeof w[0]=="string"&&Mt.call(w,"index")&&(N.index=w.index,N.input=w.input),N}function ao(w){return typeof w.constructor=="function"&&!dn(w)?Nl(ni(w)):{}}function Kl(w,A,N,X){var $t=w.constructor;switch(A){case T:return Ii(w);case a:case l:return new $t(+w);case R:return Wl(w,X);case E:case b:case x:case P:case I:case C:case F:case q:case G:return Vl(w,X);case f:return Yl(w,X,N);case g:case M:return new $t(w);case _:return Bs(w);case v:return jl(w,X,N);case D:return $l(w)}}function Zl(w,A){return A=A??s,!!A&&(typeof w=="number"||V.test(w))&&w>-1&&w%1==0&&w<A}function Ni(w){var A=typeof w;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?w!=="__proto__":w===null}function Ql(w){return!!qt&&qt in w}function dn(w){var A=w&&w.constructor,N=typeof A=="function"&&A.prototype||te;return w===N}function le(w){if(w!=null){try{return Oe.call(w)}catch{}try{return w+""}catch{}}return""}function Jl(w){return zs(w,!0,!0)}function Hs(w,A){return w===A||w!==w&&A!==A}function Fi(w){return tc(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==r)}var Ws=Array.isArray;function lo(w){return w!=null&&ec(w.length)&&!Ys(w)}function tc(w){return fn(w)&&lo(w)}var co=to||ho;function Ys(w){var A=hn(w)?Xt.call(w):"";return A==u||A==d}function ec(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function hn(w){var A=typeof w;return!!w&&(A=="object"||A=="function")}function fn(w){return!!w&&typeof w=="object"}function ai(w){return lo(w)?Il(w):Bl(w)}function uo(){return[]}function ho(){return!1}n.exports=Jl}(Wr,Wr.exports),Wr.exports;const ki=(n,t)=>new Date(n.getTime()-qv(t,n));class Le{constructor(t){Te(this,"timeframeText"),Te(this,"key"),Te(this,"display"),Te(this,"timeframeLength"),Te(this,"allowedTiers"),Te(this,"defaultResponseGranularity"),Te(this,"dataGranularity"),Te(this,"isRelative"),Te(this,"fineGrainedDefaultGranularity"),Te(this,"_startCustom"),Te(this,"_endCustom"),Te(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=Uv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Qh(e,t)}}class Gv extends Le{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Kv extends Le{rawStart(t){let e=wi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class Zv extends Le{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=ki(i,t)),i}}class Qv extends Le{rawEnd(t){let e=wi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}rawStart(t){let e=wi(zh(this.tzAdjustedDate(t)));return t&&(e=ki(e,t)),e}}pt.FIFTEEN_MIN,new Le({key:pt.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"]}),pt.ONE_HOUR,new Le({key:pt.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"]}),pt.SIX_HOUR,new Le({key:pt.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"]}),pt.TWELVE_HOUR,new Le({key:pt.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"]}),pt.ONE_DAY,new Le({key:pt.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"]}),pt.SEVEN_DAY,new Le({key:pt.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"]}),pt.THIRTY_DAY,new Le({key:pt.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"]}),pt.CURRENT_WEEK,new Gv({key:pt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Fr(Ph(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),pt.CURRENT_MONTH,new Kv({key:pt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=wi(new Date);return(Fr(Ph(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),pt.PREVIOUS_WEEK,new Zv({key:pt.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"]}),pt.PREVIOUS_MONTH,new Qv({key:pt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=wi(new Date),e=wi(zh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Jv(t,e)),60*60*24*pv(new Date().setMonth(new Date().getMonth()-1))+yv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Jv(n,t){return bv(n.getTimezoneOffset()-t.getTimezoneOffset())}pt.FIFTEEN_MIN,pt.ONE_HOUR,pt.SIX_HOUR,pt.TWELVE_HOUR,pt.ONE_DAY,pt.SEVEN_DAY,pt.FIFTEEN_MIN,pt.ONE_HOUR,pt.SIX_HOUR,pt.TWELVE_HOUR,pt.ONE_DAY,pt.SEVEN_DAY,pt.THIRTY_DAY,pt.CURRENT_WEEK,pt.CURRENT_MONTH,pt.PREVIOUS_WEEK,pt.PREVIOUS_MONTH;function tM(n){return h.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?`${Tn(e)} - ${Tn(i,{includeTZ:!0})}`:""})}function eM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};je.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=Ma(o,l,c),d=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:d,xAlign:f}};const s=h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{Xd(n.tooltipState,r)}}}}));return h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),{options:s}}function nM(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return wh(d,n.granularity.value,o.value)}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=h.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};je.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=Ma(c,d,g);let _=rw(c,f,p);const v=c.y<p?"top":"bottom",M=c.x<g?"left":"center";return f>u.height&&(_=0),{x:y,y:_,xAlign:M,yAlign:v}};const o=h.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Fx(l)>24||u.getDate()!==c.getDate()}),a=h.computed(()=>{var l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:c=>{Jx(n.tooltipState,c,n.granularity.value)}}},interaction:{mode:"index",intersect:!1}}});return h.onUnmounted(()=>{je.positioners[s]&&delete je.positioners[s]}),{options:a}}function iM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=yt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Ar(i.indexOf(u),sn),data:o.map((d,f)=>e?r[`${d.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const f=Sa(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function sM(n,t){const{i18n:e}=yt.useI18n();return h.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,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const d=c&&a||o,f=d[0],g=d.length>1?d[1]:d[0],p=Object.fromEntries(l?s.flatMap(x=>o.map((P,I)=>{const C=x.event[f],F=c?`${C},${P}`:`${I},${P}`,q=x.event[P];return[F,q]})):s.map(x=>{const P=c?`${x.event[f]},${x.event[g]}`:`${f},${g}`,I=x.event[o[0]];return[P,I]})),y=Object.keys(p).reduce((x,P)=>{const[I]=P.split(","),C=p[P];return x[I]?x[I]+=C:x[I]=C,x},{}),_=Object.entries(y).sort(([,x],[,P])=>Number(P)-Number(x)).map(([x])=>x),v=r[f],M=r[g],D=c&&v&&Object.entries(v).map(([x,P])=>({id:x,name:P.name}))||o.map(x=>({id:x,name:x})),S=c&&M&&Object.entries(M).map(([x,P])=>({id:x,name:P.name}))||o.map(x=>({id:x,name:x}));if(f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((x,P)=>_.indexOf(x.id)-_.indexOf(P.id)),S.sort((x,P)=>_.indexOf(x.id)-_.indexOf(P.id))),!D||!S)return{labels:[],datasets:[]};const T=iM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:d,barSegmentLabels:S,pivotRecords:p,rowLabels:D,colorPalette:n.colorPalette||sn}),R=c?D.map(x=>e&&e.te(`chartLabels.${x.name}`)&&e.t(`chartLabels.${x.name}`)||x.name):o.map(x=>e&&e.te(`chartLabels.${x}`)&&e.t(`chartLabels.${x}`)||x),E=D.map(x=>x.id==="empty");return{labels:R,datasets:T,isLabelEmpty:E,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const rM="#6c7489",oM="#6c7489",aM="#995c00",lM="16px",cM="20px",Jh="24px",uM="40px",dM="48px",hM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),fM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Ud(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},gM=(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 hM(a,l,e)};function pM(n,t){const{i18n:e}=yt.useI18n();return h.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],f=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||o.map(S=>({id:S,name:S})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=fM(a),y=gM(a,l,g,p,s),_=new Set,v=s!=null&&s.length?s.reduce((S,T)=>{const R=new Date(T.timestamp).valueOf(),E=T.event;for(const b of o)_.add(b),R in S||(S[R]={}),b in S[R]||(S[R][b]={});for(const b of o)f.forEach(x=>{E[u]===x.id||b===x.id?(S[R][b]||(S[R][b]={}),S[R][b][x.name]=Math.round(Number(E[b])*1e3)/1e3):c.length||(S[R][b]||(S[R][b]={}),S[R][b][x.name]=Math.round(Number(E[x.id])*1e3)/1e3)});return S},{}):{},D=[...o.length===1?o.flatMap(S=>f.map(T=>[S,T.name,T.id==="empty"])):f.map(S=>[S.name,S.name,S.id==="empty"])].map(([S,T,R],E)=>{const b=y.map(C=>C in v&&S in v[C]?{x:C,y:v[C][S][T]||0}:{x:C,y:0});let{colorPalette:x,fill:P}=n;st(x)&&(x=sn);const I=Sa(E,T,R,x);return{rawDimension:T,rawMetric:S,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:I,backgroundColor:I,data:b,total:b.reduce((C,{y:F})=>C+Number(F),0),...fw,fill:P,borderWidth:P?pw:gw,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((S,T)=>(S.label??"")<(T.label??"")?-1:1):D.sort((S,T)=>Number(S.total)<Number(T.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const T=n.threshold[S];T&&D.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:rM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:y.map(R=>({x:R,y:T}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const mM=(n,t)=>{h.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 yM(){const{i18n:n}=yt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const tf="analytics-query-provider",ef=2;function bM(){const n=h.inject(tf);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function _M(n,t){const e=h.computed(()=>{if(!n.value)return t.left;const s=n.value.getBoundingClientRect();return`${parseFloat(t.left)+s.left+window.scrollX}px`}),i=h.computed(()=>{if(!n.value)return t.top;const s=n.value.getBoundingClientRect();return`${parseFloat(t.top)+s.top+window.scrollY}px`});return{tooltipAbsoluteLeft:e,tooltipAbsoluteTop:i}}const yt={useBarChartOptions:Xw,useChartJSCommon:Kw,useChartLegendValues:Qw,useChartSelectedRange:tM,useExploreResultToDatasets:sM,useExploreResultToTimeDataset:pM,useDonutChartOptions:eM,useLineChartOptions:nM,useI18n:pg,useReportChartDataForSynthetics:mM,useTranslatedUnits:yM,useEvaluateFeatureFlag:bM,useTooltipAbsolutePosition:_M};var Nt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Nt||{});/*!
18
+ `):n}function Wb(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 nd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),d=r.length,f=s.length,g=i.length,p=Ut(t.padding);let y=p.height,_=0,v=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*S+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const D=function(S){_=Math.max(_,e.measureText(S).width+M)};return e.save(),e.font=c.string,St(n.title,D),e.font=l.string,St(n.beforeBody.concat(n.afterBody),D),M=t.displayColors?o+2+t.boxPadding:0,St(i,S=>{St(S.before,D),St(S.lines,D),St(S.after,D)}),M=0,e.font=u.string,St(n.footer,D),e.restore(),_+=p.width,{width:_,height:y}}function Yb(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function jb(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 $b(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"),jb(c,n,t,e)&&(c="center"),c}function id(n,t,e){const i=e.yAlign||t.yAlign||Yb(n,e);return{xAlign:e.xAlign||t.xAlign||$b(n,t,e,i),yAlign:i}}function Vb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Ub(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function sd(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:f,bottomRight:g}=xn(o);let p=Vb(t,a);const y=Ub(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Qt(p,0,i.width-t.width),y:Qt(y,0,i.height-t.height)}}function vr(n,t,e){const i=Ut(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function rd(n){return Ye([],nn(n))}function qb(n,t,e){return wn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function od(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ad={beforeTitle:Ke,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:Ke,beforeBody:Ke,beforeLabel:Ke,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:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function me(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?ad[t].call(e,i):s}class sa extends Jt{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 Fo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=qb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=me(i,"beforeTitle",this,t),r=me(i,"title",this,t),o=me(i,"afterTitle",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}getBeforeBody(t,e){return rd(me(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return St(t,r=>{const o={before:[],lines:[],after:[]},a=od(i,r);Ye(o.before,nn(me(a,"beforeLabel",this,r))),Ye(o.lines,me(a,"label",this,r)),Ye(o.after,nn(me(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return rd(me(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=me(i,"beforeFooter",this,t),r=me(i,"footer",this,t),o=me(i,"afterFooter",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(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(Wb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),St(a,u=>{const d=od(t.callbacks,u);s.push(me(d,"labelColor",this,u)),r.push(me(d,"labelPointStyle",this,u)),o.push(me(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=nd(this,i),c=Object.assign({},a,l),u=id(this.chart,i,c),d=sd(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}=xn(a),{x:f,y:g}=t,{width:p,height:y}=e;let _,v,M,D,S,T;return r==="center"?(S=g+y/2,s==="left"?(_=f,v=_-o,D=S+o,T=S-o):(_=f+p,v=_+o,D=S-o,T=S+o),M=_):(s==="left"?v=f+Math.max(l,u)+o:s==="right"?v=f+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,S=D-o,_=v-o,M=v+o):(D=g+y,S=D+o,_=v+o,M=v-o),T=D),{x1:_,x2:v,x3:M,y1:D,y2:S,y3:T}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=pi(i.rtl,this.x,this.width);for(t.x=vr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(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=It(r.bodyFont),d=vr(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},_=s.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Oo(t,y,_,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Oo(t,y,_,v)}else{t.lineWidth=ht(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 y=s.leftForLtr(f,c),_=s.leftForLtr(s.xPlus(f,1),c-2),v=xn(o.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,hi(t,{x:y,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),hi(t,{x:_,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(_,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=It(i.bodyFont);let f=d.lineHeight,g=0;const p=pi(i.rtl,this.x,this.width),y=function(b){e.fillText(b,p.x(t.x+g),t.y+f/2),t.y+=f+r},_=p.textAlign(o);let v,M,D,S,T,R,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=vr(this,_,i),e.fillStyle=i.bodyColor,St(this.beforeBody,y),g=a&&_!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,R=s.length;S<R;++S){for(v=s[S],M=this.labelTextColors[S],e.fillStyle=M,St(v.before,y),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,S,p,i),f=Math.max(d.lineHeight,l)),T=0,E=D.length;T<E;++T)y(D[T]),f=d.lineHeight;St(v.after,y)}g=0,f=d.lineHeight,St(this.afterBody,y),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=pi(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=It(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:f,bottomLeft:g,bottomRight:p}=xn(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-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=nd(this,t),l=Object.assign({},o,this._size),c=id(e,t,l),u=sd(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=Ut(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),Wc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Yc(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=!qs(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||!qs(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)}}O(sa,"positioners",us);var je={id:"tooltip",_element:sa,positioners:us,afterInit(n,t,e){e&&(n.tooltip=new sa({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:ad},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"]},Xb=Object.freeze({__proto__:null,Colors:ab,Decimation:db,Filler:Eb,Legend:Fb,SubTitle:Hb,Title:Bb,Tooltip:je});const Gb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Kb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Gb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Zb=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function ld(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ra extends $n{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:Kb(i,t,rt(e,t),this._addedLabels),Zb(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 ld.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}}O(ra,"id","category"),O(ra,"defaults",{ticks:{callback:ld}});function Qb(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=r||1,p=u-1,{min:y,max:_}=t,v=!st(o),M=!st(a),D=!st(c),S=(_-y)/(d+1);let T=fc((_-y)/p/g)*g,R,E,b,x;if(T<1e-14&&!v&&!M)return[{value:y},{value:_}];x=Math.ceil(_/T)-Math.floor(y/T),x>p&&(T=fc(x*T/p/g)*g),st(l)||(R=Math.pow(10,l),T=Math.ceil(T*R)/R),s==="ticks"?(E=Math.floor(y/T)*T,b=Math.ceil(_/T)*T):(E=y,b=_),v&&M&&r&&qg((a-o)/r,T/1e3)?(x=Math.round(Math.min((a-o)/T,u)),T=(a-o)/x,E=o,b=a):D?(E=v?o:E,b=M?a:b,x=c-1,T=(b-E)/x):(x=(b-E)/T,$i(x,Math.round(x),T/1e3)?x=Math.round(x):x=Math.ceil(x));const P=Math.max(pc(T),pc(E));R=Math.pow(10,st(l)?P:l),E=Math.round(E*R)/R,b=Math.round(b*R)/R;let I=0;for(v&&(f&&E!==o?(e.push({value:o}),E<o&&I++,$i(Math.round((E+I*T)*R)/R,o,cd(o,S,n))&&I++):E<o&&I++);I<x;++I){const C=Math.round((E+I*T)*R)/R;if(M&&C>a)break;e.push({value:C})}return M&&f&&b!==a?e.length&&$i(e[e.length-1].value,a,cd(a,S,n))?e[e.length-1].value=a:e.push({value:a}):(!M||b===a)&&e.push({value:b}),e}function cd(n,t,{horizontal:e,minRotation:i}){const s=Vt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Mr extends $n{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=He(s),c=He(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=Qb(s,r);return t.bounds==="ticks"&&gc(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 oa extends Mr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Vt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(oa,"id","linear"),O(oa,"defaults",{ticks:{callback:tr.formatters.numeric}});const ds=n=>Math.floor(bn(n)),Vn=(n,t)=>Math.pow(10,ds(n)+t);function ud(n){return n/Math.pow(10,ds(n))===1}function dd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Jb(n,t){const e=t-n;let i=ds(e);for(;dd(n,t,i)>10;)i++;for(;dd(n,t,i)<10;)i--;return Math.min(i,ds(n))}function t0(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=ds(t);let r=Jb(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)),f=Me(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:ud(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),f=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=Me(n.max,f);return i.push({value:g,major:ud(g),significand:d}),i}class aa extends $n{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Mr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===Vn(this.min,0)?Vn(this.min,-1):Vn(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(Vn(i,-1)),o(Vn(s,1)))),i<=0&&r(Vn(s,-1)),s<=0&&o(Vn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=t0(e,this);return t.bounds==="ticks"&&gc(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=bn(t),this._valueRange=bn(this.max)-bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}O(aa,"id","logarithmic"),O(aa,"defaults",{ticks:{callback:tr.formatters.logarithmic,major:{enabled:!0}}});function la(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return rt(t.font&&t.font.size,At.font.size)+e.height}return 0}function e0(n,t,e){return e=kt(e)?e:[e],{w:up(n,t.string,e),h:e.length*t.lineHeight}}function hd(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 n0(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?ct/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=It(c.font),f=e0(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=se(n.getIndexAngle(l)+a),p=Math.round(Zs(g)),y=hd(p,u.x,f.w,0,180),_=hd(p,u.y,f.h,90,270);i0(e,t,g,y,_)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=o0(n,i,s)}function i0(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 s0(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(Zs(se(l.angle+Et))),u=c0(l.y,a.h,c),d=a0(c),f=l0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function r0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Je({x:e,y:i},t)||Je({x:e,y:r},t)||Je({x:s,y:i},t)||Je({x:s,y:r},t))}function o0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:la(r)/2,additionalAngle:o?ct/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=s0(n,u,l);i.push(d),a==="auto"&&(d.visible=r0(d,c),d.visible&&(c=d))}return i}function a0(n){return n===0||n===180?"center":n<180?"left":"right"}function l0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function c0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function u0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=xn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,f=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),hi(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function d0(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));u0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Hn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function fd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ot);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 h0(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(),fd(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function f0(n,t,e){return wn(n,{label:e,index:t,type:"pointLabel"})}class hs extends Mr{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=Ut(la(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=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/la(this.options))}generateTickLabels(t){Mr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=Dt(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?n0(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=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+Vt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return f0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+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(),fd(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&&d0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=s.setContext(f),p=r.setContext(f);h0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,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=It(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=Ut(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Hn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}O(hs,"id","radialLinear"),O(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:tr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(hs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(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}},ye=Object.keys(kr);function gd(n,t){return n-t}function pd(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)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(_n(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function md(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=kr[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function g0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(kr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function p0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(kr[ye[t]].common)return ye[t]}function yd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ko(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function m0(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 bd(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:m0(n,i,s,e)}class fs extends $n{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 au._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:pd(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=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(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=Zg(s,r,o);return this._unit=e.unit||(i.autoSkip?md(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):g0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:p0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),bd(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=Qt(e,0,o),i=Qt(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||md(r.minUnit,e,i,this._getLabelCapacity(e)),a=rt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=_n(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,a,o),g++)yd(u,f,p);return(f===i||s.bounds==="ticks"||g===1)&&yd(u,f,p),Object.keys(u).sort(gd).map(y=>+y)}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 Dt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[e],g=c&&d&&f&&f.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=Vt(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,bd(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(pd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return bc(t.sort(gd))}}O(fs,"id","time"),O(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}=Qe(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}=Qe(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 ca 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)}}O(ca,"id","timeseries"),O(ca,"defaults",fs.defaults);var y0=Object.freeze({__proto__:null,CategoryScale:ra,LinearScale:oa,LogarithmicScale:aa,RadialLinearScale:hs,TimeScale:fs,TimeSeriesScale:ca});const b0=[Sm,tb,Xb,y0],_d=6048e5,_0=864e5,gs=6e4,yi=36e5,x0=1e3,xd=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&xd in n?n[xd](t):n instanceof Date?new n.constructor(t):new Date(t)}function lt(n,t){return Ft(t||n,n)}function Sr(n,t,e){const i=lt(n,e==null?void 0:e.in);return isNaN(t)?Ft((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ua(n,t,e){const i=lt(n,e==null?void 0:e.in);if(isNaN(t))return Ft(n,NaN);if(!t)return i;const s=i.getDate(),r=Ft(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 da(n,t,e){return Ft(n,+lt(n)+t)}function w0(n,t,e){return da(n,t*yi)}let v0={};function Un(){return v0}function $e(n,t){var a,l,c,u;const e=Un(),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=lt(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 bi(n,t){return $e(n,{...t,weekStartsOn:1})}function wd(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ft(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=bi(s),o=Ft(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=bi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Tr(n){const t=lt(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 qn(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ha(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function vd(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=ha(i),o=ha(s),a=+r-Tr(r),l=+o-Tr(o);return Math.round((a-l)/_0)}function M0(n,t){const e=wd(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),bi(i)}function k0(n,t,e){const i=lt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*gs),i}function D0(n,t,e){return ua(n,t*3,e)}function S0(n,t,e){return da(n,t*1e3)}function T0(n,t,e){return Sr(n,t*7,e)}function C0(n,t,e){return ua(n,t*12,e)}function ps(n,t){const e=+lt(n)-+lt(t);return e<0?-1:e>0?1:e}function P0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function fa(n){return!(!P0(n)&&typeof n!="number"||isNaN(+lt(n)))}function O0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function E0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Md(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=kd(i,s),o=Math.abs(vd(i,s));i.setDate(i.getDate()-r*o);const a=+(kd(i,s)===-r),l=r*(o-a);return l===0?0:l}function kd(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 A0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=(+i-+s)/yi;return ms(e==null?void 0:e.roundingMethod)(r)}function ga(n,t){return+lt(n)-+lt(t)}function R0(n,t,e){const i=ga(n,t)/gs;return ms(e==null?void 0:e.roundingMethod)(i)}function Dd(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Sd(n,t){const e=lt(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 I0(n,t){const e=lt(n,t==null?void 0:t.in);return+Dd(e,t)==+Sd(e,t)}function Td(n,t,e){const[i,s,r]=qn(e==null?void 0:e.in,n,n,t),o=ps(s,r),a=Math.abs(O0(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;I0(i)&&a===1&&ps(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function L0(n,t,e){const i=Td(n,t,e)/3;return ms(e==null?void 0:e.roundingMethod)(i)}function N0(n,t,e){const i=ga(n,t)/1e3;return ms(e==null?void 0:e.roundingMethod)(i)}function F0(n,t,e){const i=Md(n,t,e)/7;return ms(e==null?void 0:e.roundingMethod)(i)}function z0(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=ps(i,s),o=Math.abs(E0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-r,l=r*(o-+a);return l===0?0:l}function B0(n,t){const e=lt(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 H0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function W0(n,t){const e=lt(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 Cd(n,t){const e=lt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Y0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function j0(n,t){var a,l;const e=Un(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=lt(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 $0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function V0(n,t){const e=lt(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 U0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const q0={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"}},X0=(n,t,e)=>{let i;const s=q0[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 pa(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const G0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},K0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Z0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q0={date:pa({formats:G0,defaultWidth:"full"}),time:pa({formats:K0,defaultWidth:"full"}),dateTime:pa({formats:Z0,defaultWidth:"full"})},J0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},t_=(n,t,e,i)=>J0[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 e_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},n_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},i_={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"]},s_={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"]},r_={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"}},o_={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"}},a_={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:e_,defaultWidth:"wide"}),quarter:ys({values:n_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ys({values:i_,defaultWidth:"wide"}),day:ys({values:s_,defaultWidth:"wide"}),dayPeriod:ys({values:r_,defaultWidth:"wide",formattingValues:o_,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)?c_(a,d=>d.test(o)):l_(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 l_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function c_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function u_(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 d_=/^(\d+)(th|st|nd|rd)?/i,h_=/\d+/i,f_={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},g_={any:[/^b/i,/^(a|c)/i]},p_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},m_={any:[/1/i,/2/i,/3/i,/4/i]},y_={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},b_={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]},__={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},x_={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]},w_={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},v_={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}},M_={ordinalNumber:u_({matchPattern:d_,parsePattern:h_,valueCallback:n=>parseInt(n,10)}),era:bs({matchPatterns:f_,defaultMatchWidth:"wide",parsePatterns:g_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:p_,defaultMatchWidth:"wide",parsePatterns:m_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bs({matchPatterns:y_,defaultMatchWidth:"wide",parsePatterns:b_,defaultParseWidth:"any"}),day:bs({matchPatterns:__,defaultMatchWidth:"wide",parsePatterns:x_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:w_,defaultMatchWidth:"any",parsePatterns:v_,defaultParseWidth:"any"})},Pd={code:"en-US",formatDistance:X0,formatLong:Q0,formatRelative:t_,localize:a_,match:M_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function k_(n,t){const e=lt(n,t==null?void 0:t.in);return vd(e,Cd(e))+1}function Od(n,t){const e=lt(n,t==null?void 0:t.in),i=+bi(e)-+M0(e);return Math.round(i/_d)+1}function ma(n,t){var u,d,f,g;const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Un(),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=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=Ft((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=$e(o,t),l=Ft((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=$e(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function D_(n,t){var a,l,c,u;const e=Un(),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=ma(n,t),r=Ft((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),$e(r,t)}function Ed(n,t){const e=lt(n,t==null?void 0:t.in),i=+$e(e,t)-+D_(e,t);return Math.round(i/_d)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Dn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},_i={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 Dn.y(n,t)},Y:function(n,t,e,i){const s=ma(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=wd(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Dn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Ed(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Od(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Dn.d(n,t)},D:function(n,t,e){const i=k_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=_i.noon:i===0?s=_i.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=_i.evening:i>=12?s=_i.afternoon:i>=4?s=_i.morning:s=_i.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 Dn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Dn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Dn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Dn.s(n,t)},S:function(n,t){return Dn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Id(i);case"XXXX":case"XX":return Xn(i);case"XXXXX":case"XXX":default:return Xn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Id(i);case"xxxx":case"xx":return Xn(i);case"xxxxx":case"xxx":default:return Xn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rd(i,":");case"OOOO":default:return"GMT"+Xn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rd(i,":");case"zzzz":default:return"GMT"+Xn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Rd(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Id(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Xn(n,t)}function Xn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Ld=(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"})}},Nd=(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"})}},ya={p:Nd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ld(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}}",Ld(i,t)).replace("{{time}}",Nd(s,t))}},S_=/^D+$/,T_=/^Y+$/,C_=["D","DD","YY","YYYY"];function Fd(n){return S_.test(n)}function zd(n){return T_.test(n)}function ba(n,t,e){const i=P_(n,t,e);if(console.warn(i),C_.includes(n))throw new RangeError(i)}function P_(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 O_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,E_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,A_=/^'([^]*?)'?$/,R_=/''/g,I_=/[a-zA-Z]/;function Bd(n,t,e){var u,d,f,g,p,y,_,v;const i=Un(),s=(e==null?void 0:e.locale)??i.locale??Pd,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=(f=i.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((y=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((v=(_=i.locale)==null?void 0:_.options)==null?void 0:v.weekStartsOn)??0,a=lt(n,e==null?void 0:e.in);if(!fa(a))throw new RangeError("Invalid time value");let l=t.match(E_).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=ya[D];return S(M,s.formatLong)}return M}).join("").match(O_).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:L_(M)};if(Ad[D])return{isToken:!0,value:M};if(D.match(I_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&zd(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Fd(D))&&ba(D,t,String(n));const S=Ad[D[0]];return S(a,D,s.localize,c)}).join("")}function L_(n){const t=n.match(A_);return t?t[1].replace(R_,"'"):n}function Hd(){return Object.assign({},Un())}function N_(n,t){const e=lt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function F_(n,t){const e=z_(t)?new t(0):Ft(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function z_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const B_=10;class Wd{constructor(){O(this,"subPriority",0)}validate(t,e){return!0}}class H_ extends Wd{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 W_ extends Wd{constructor(e,i){super();O(this,"priority",B_);O(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,F_(e,this.context))}}class wt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new H_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class Y_ extends wt{constructor(){super(...arguments);O(this,"priority",140);O(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 Yt={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}/},Ve={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 jt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*yi+r*gs+o*x0),rest:t.slice(e[0].length)}}function Yd(n){return Lt(Yt.anyDigitsSigned,n)}function zt(n,t){switch(n){case 1:return Lt(Yt.singleDigit,t);case 2:return Lt(Yt.twoDigits,t);case 3:return Lt(Yt.threeDigits,t);case 4:return Lt(Yt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Cr(n,t){switch(n){case 1:return Lt(Yt.singleDigitSigned,t);case 2:return Lt(Yt.twoDigitsSigned,t);case 3:return Lt(Yt.threeDigitsSigned,t);case 4:return Lt(Yt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function _a(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 jd(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 $d(n){return n%400===0||n%4===0&&n%100!==0}class j_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(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 jt(zt(4,e),r);case"yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(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=jd(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 $_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(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 jt(zt(4,e),r);case"Yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=ma(e,r);if(s.isTwoDigitYear){const l=jd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(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),$e(e,r)}}class V_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Cr(i==="R"?4:i.length,e)}set(e,i,s){const r=Ft(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),bi(r)}}class U_ extends wt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Cr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class q_ extends wt{constructor(){super(...arguments);O(this,"priority",120);O(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 zt(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 X_ extends wt{constructor(){super(...arguments);O(this,"priority",120);O(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 zt(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 G_ extends wt{constructor(){super(...arguments);O(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);O(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return jt(Lt(Yt.month,e),r);case"MM":return jt(zt(2,e),r);case"Mo":return jt(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 K_ extends wt{constructor(){super(...arguments);O(this,"priority",110);O(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 jt(Lt(Yt.month,e),r);case"LL":return jt(zt(2,e),r);case"Lo":return jt(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 Z_(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Ed(i,e)-t;return i.setDate(i.getDate()-s*7),lt(i,e==null?void 0:e.in)}class Q_ extends wt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Yt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return $e(Z_(e,s,r),r)}}function J_(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Od(i,e)-t;return i.setDate(i.getDate()-s*7),i}class tx extends wt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Yt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return bi(J_(e,s))}}const ex=[31,28,31,30,31,30,31,31,30,31,30,31],nx=[31,29,31,30,31,30,31,31,30,31,30,31];class ix extends wt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subPriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Yt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=$d(s),o=e.getMonth();return r?i>=1&&i<=nx[o]:i>=1&&i<=ex[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class sx extends wt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subpriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Yt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear();return $d(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 xa(n,t,e){var d,f,g,p;const i=Un(),s=(e==null?void 0:e.weekStartsOn)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=lt(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 Sr(r,u,e)}class rx extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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=xa(e,s,r),e.setHours(0,0,0,0),e}}class ox extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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 jt(zt(i.length,e),o);case"eo":return jt(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=xa(e,s,r),e.setHours(0,0,0,0),e}}class ax extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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 jt(zt(i.length,e),o);case"co":return jt(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=xa(e,s,r),e.setHours(0,0,0,0),e}}function lx(n,t,e){const i=lt(n,e==null?void 0:e.in),s=N_(i,e),r=t-s;return Sr(i,r,e)}class cx extends wt{constructor(){super(...arguments);O(this,"priority",90);O(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 zt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return jt(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 jt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return jt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return jt(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=lx(e,s),e.setHours(0,0,0,0),e}}class ux extends wt{constructor(){super(...arguments);O(this,"priority",80);O(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(_a(s),0,0,0),e}}class dx extends wt{constructor(){super(...arguments);O(this,"priority",80);O(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(_a(s),0,0,0),e}}class hx extends wt{constructor(){super(...arguments);O(this,"priority",80);O(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(_a(s),0,0,0),e}}class fx extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Yt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(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 gx extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Yt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class px extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Yt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(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 mx extends wt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Yt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(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 yx extends wt{constructor(){super(...arguments);O(this,"priority",60);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Yt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class bx extends wt{constructor(){super(...arguments);O(this,"priority",50);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Yt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class _x extends wt{constructor(){super(...arguments);O(this,"priority",30);O(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return jt(zt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class xx extends wt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue(Ve.basicOptionalMinutes,e);case"XX":return Ue(Ve.basic,e);case"XXXX":return Ue(Ve.basicOptionalSeconds,e);case"XXXXX":return Ue(Ve.extendedOptionalSeconds,e);case"XXX":default:return Ue(Ve.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Tr(e)-s)}}class wx extends wt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue(Ve.basicOptionalMinutes,e);case"xx":return Ue(Ve.basic,e);case"xxxx":return Ue(Ve.basicOptionalSeconds,e);case"xxxxx":return Ue(Ve.extendedOptionalSeconds,e);case"xxx":default:return Ue(Ve.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Tr(e)-s)}}class vx extends wt{constructor(){super(...arguments);O(this,"priority",40);O(this,"incompatibleTokens","*")}parse(e){return Yd(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class Mx extends wt{constructor(){super(...arguments);O(this,"priority",20);O(this,"incompatibleTokens","*")}parse(e){return Yd(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const kx={G:new Y_,y:new j_,Y:new $_,R:new V_,u:new U_,Q:new q_,q:new X_,M:new G_,L:new K_,w:new Q_,I:new tx,d:new ix,D:new sx,E:new rx,e:new ox,c:new ax,i:new cx,a:new ux,b:new dx,B:new hx,h:new fx,H:new gx,K:new px,k:new mx,m:new yx,s:new bx,S:new _x,X:new xx,x:new wx,t:new vx,T:new Mx},Dx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tx=/^'([^]*?)'?$/,Cx=/''/g,Px=/\S/,Ox=/[a-zA-Z]/;function Ex(n,t,e,i){var _,v,M,D,S,T,R,E;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=Hd(),o=(i==null?void 0:i.locale)??r.locale??Pd,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(_=i==null?void 0:i.locale)==null?void 0:_.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(M=r.locale)==null?void 0:M.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((T=(S=i==null?void 0:i.locale)==null?void 0:S.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((E=(R=r.locale)==null?void 0:R.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():lt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new W_(i==null?void 0:i.in,e)],d=t.match(Sx).map(b=>{const x=b[0];if(x in ya){const P=ya[x];return P(b,o.formatLong)}return b}).join("").match(Dx),f=[];for(let b of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&zd(b)&&ba(b,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Fd(b)&&ba(b,t,n);const x=b[0],P=kx[x];if(P){const{incompatibleTokens:I}=P;if(Array.isArray(I)){const F=f.find(q=>I.includes(q.token)||q.token===x);if(F)throw new RangeError(`The format string mustn't contain \`${F.fullToken}\` and \`${b}\` at the same time`)}else if(P.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:x,fullToken:b});const C=P.run(n,b,o.match,c);if(!C)return s();u.push(C.setter),n=C.rest}else{if(x.match(Ox))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");if(b==="''"?b="'":x==="'"&&(b=Ax(b)),n.indexOf(b)===0)n=n.slice(b.length);else return s()}}if(n.length>0&&Px.test(n))return s();const g=u.map(b=>b.priority).sort((b,x)=>x-b).filter((b,x,P)=>P.indexOf(b)===x).map(b=>u.filter(x=>x.priority===b).sort((x,P)=>P.subPriority-x.subPriority)).map(b=>b[0]);let p=lt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const y={};for(const b of g){if(!b.validate(p,c))return s();const x=b.set(p,y,c);Array.isArray(x)?(p=x[0],Object.assign(y,x[1])):p=x}return p}function Ax(n){return n.match(Tx)[1].replace(Cx,"'")}function Rx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ix(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Lx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Nx(n){const t=n/yi;return Math.trunc(t)}function Vd(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Hx(n);let r;if(s.date){const c=Wx(s.date,i);r=Yx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=jx(s.time),isNaN(a)))return e();if(s.timezone){if(l=$x(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=lt(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 lt(o+a+l,t==null?void 0:t.in)}const Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,zx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Bx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Hx(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 Wx(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 Yx(n,t){if(t===null)return new Date(NaN);const e=n.match(Fx);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 Gx(t,a,l)?Vx(t,a,l):new Date(NaN);{const c=new Date(0);return!qx(t,r,o)||!Xx(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function _s(n){return n?parseInt(n):1}function jx(n){const t=n.match(zx);if(!t)return NaN;const e=wa(t[1]),i=wa(t[2]),s=wa(t[3]);return Kx(e,i,s)?e*yi+i*gs+s*1e3:NaN}function wa(n){return n&&parseFloat(n.replace(",","."))||0}function $x(n){if(n==="Z")return 0;const t=n.match(Bx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Zx(i,s)?e*(i*yi+s*gs):NaN}function Vx(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 Ux=[31,null,31,30,31,30,31,31,30,31,30,31];function Ud(n){return n%400===0||n%4===0&&n%100!==0}function qx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Ux[t]||(Ud(n)?29:28))}function Xx(n,t){return t>=1&&t<=(Ud(n)?366:365)}function Gx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Kx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Zx(n,t){return t>=0&&t<=59}const Or=n=>["interactive","zoom-interactive"].includes(n),Qx=(n,t,e)=>{var r,o;const{tooltip:i}=t;if(i.opacity===0&&!Or(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(i.body&&!Or(n.interactionMode)){const a=i.labelColors,l=((o=(r=t.chart.config)==null?void 0:r.options)==null?void 0:o.indexAxis)==="y"?"x":"y";n.tooltipContext=xh(new Date(i.dataPoints[0].parsed.x),e,!0),n.tooltipSeries=i.dataPoints.map((c,u)=>{const d=c.parsed[l],f=wh(d,n.units,{translateUnit:n.translateUnit}),g=c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(s),n.left=`${i.x}px`,n.top=`${i.y}px`,n.showTooltip=!0}},qd=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!Or(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!Or(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[a],f=wh(d,n.units,{translateUnit:n.translateUnit});let g;return l?g=c.dataset.labels[c.dataIndex]:g=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Jx=n=>n&&n.datasets&&n.datasets.length,tw=n=>Jx(n)&&n.datasets.some(t=>t.data.length),ew=n=>n.datasets.some(t=>t.data[0]&&fa(t.data[0].x)),nw=n=>!!tw(n)&&n.datasets.some(t=>t.data.length==1),iw=n=>ew(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),va=(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)},sw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ma(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Xd=(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)},rw=2,Gd=10,Kd=12,ka=new Intl.NumberFormat(((dg=document==null?void 0:document.documentElement)==null?void 0:dg.lang)||"en-US"),Er=10,Zd={"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"}},sn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ar=(n,t)=>(t||sn)[n%sn.length],Qd=(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}`},Jd="#6f7787",th={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"}},ow=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=th[t])==null?void 0:e.background)||"#fafafa"},aw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},lw={"4XX":"#FFBA81","5XX":"#FF8484"},cw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},uw="#dad4c7",eh="#afb7c5",dw=n=>{const t=Object.entries(Zd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Zd.standard},Da=(n,t,e,i)=>{let s;return e?s=eh:Array.isArray(i)?s=Ar(n,i):s=i[t],s||Ar(n)},hw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},fw=2,gw=0,Sa=new Map,Ta=(n,t)=>t==="bytes"?Lr(n):t==="count/minute"?n.toFixed(2):ka.format(n),nh=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},pw=()=>{const n="label_height";if(!Sa.has(n)){const t=It({});Sa.set(n,t.lineHeight)}return Sa.get(n)},mw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),ih=(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),sh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ca="#e0e4ea",yw={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=yw[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},rh=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])]]),Pa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=rh.get(e);return i===void 0?Ca:i.get(t)??i.get(-1)??Ca},bw=n=>{const t=Pa(n);return{solid:t,light:t}},Rr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Pa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function oh(n,t,e){const i=Hd(),s=ww(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?_w(s,t):xw(s,t)}function _w(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 xw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function ww(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function vw(n,t){const e=Tw(t);return"formatToParts"in e?kw(e,n):Dw(e,n)}const Mw={year:0,month:1,day:2,hour:3,minute:4,second:5};function kw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Mw[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 Dw(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 Oa={},ah=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")),Sw=ah==="06/25/2014, 00:00:00"||ah==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Tw(n){return Oa[n]||(Oa[n]=Sw?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"})),Oa[n]}function lh(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 ch=36e5,Cw=6e4,Ea={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Aa(n,t,e){if(!n)return 0;let i=Ea.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ea.timezoneHH.exec(n),i)return s=parseInt(i[1],10),uh(s)?-(s*ch):NaN;if(i=Ea.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return uh(s,o)?(r=Math.abs(s)*ch+o*Cw,i[1]==="+"?-r:r):NaN}if(Ew(n)){t=new Date(t||Date.now());const o=e?t:Pw(t),a=Ra(o,n);return-(e?a:Ow(t,a,n))}return NaN}function Pw(n){return lh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ra(n,t){const e=vw(n,t),i=lh(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 Ow(n,t,e){let s=n.getTime()-t;const r=Ra(new Date(s),e);if(t===r)return t;s-=r-t;const o=Ra(new Date(s),e);return r===o?r:Math.max(r,o)}function uh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const dh={};function Ew(n){if(dh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),dh[n]=!0,!0}catch{return!1}}const Aw=60*1e3,Rw={X:function(n,t,e){const i=Ia(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return hh(i);case"XXXX":case"XX":return xi(i);case"XXXXX":case"XXX":default:return xi(i,":")}},x:function(n,t,e){const i=Ia(e.timeZone,n);switch(t){case"x":return hh(i);case"xxxx":case"xx":return xi(i);case"xxxxx":case"xxx":default:return xi(i,":")}},O:function(n,t,e){const i=Ia(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Iw(i,":");case"OOOO":default:return"GMT"+xi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return oh("short",n,e);case"zzzz":default:return oh("long",n,e)}}};function Ia(n,t){const e=n?Aa(n,t,!0)/Aw:(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 xi(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 hh(n,t){return n%60===0?(n>0?"-":"+")+Ir(Math.abs(n)/60,2):xi(n,t)}function Iw(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 fh(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 Lw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,La=36e5,gh=6e4,Nw=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Lw};function ph(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?Nw: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=Fw(n),{year:s,restDateString:r}=zw(i.date,e),o=Bw(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=Hw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Aa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=fh(new Date(a+l)),c=fh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Fw(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 zw(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 Bw(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,bh(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 jw(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 bh(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,_h(s)?mh(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 _h(s,o)?mh(t,s,o):new Date(NaN)}return null}function Hw(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Na(t)?t%24*La:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Na(t,e)?t%24*La+e*gh: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 Na(t,e,s)?t%24*La+e*gh+s*1e3:NaN}return null}function mh(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 Ww=[31,28,31,30,31,30,31,31,30,31,30,31],Yw=[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 bh(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>Yw[t]||!i&&e>Ww[t])return!1}return!0}function jw(n,t){if(t<1)return!1;const e=yh(n);return!(e&&t>366||!e&&t>365)}function _h(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Na(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const $w=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Fa(n,t,e={}){t=String(t);const i=t.match($w);if(i){const s=ph(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,"'"+Rw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Bd(n,t,e)}function Vw(n,t,e){n=ph(n,e);const i=Aa(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 Gn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Fa(Vw(n,t,{timeZone:i.timeZone}),e,i)}const xh=(n,t,e,i)=>{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;switch(t){case"secondly":case"tenSecondly":case"thirtySecondly":return Gn(n,s,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a");case"minutely":case"fiveMinutely":case"tenMinutely":case"thirtyMinutely":case"hourly":case"twoHourly":return Gn(n,s,e?"yyyy-MM-dd h:mm a":"h:mm a");case"twelveHourly":return Gn(n,s,"yyyy-MM-dd h:mm a");case"daily":return Gn(n,s,"yyyy-MM-dd");case"weekly":return`${Gn(n,s,"yyyy")} W${Gn(n,s,"II")}`;default:return Gn(n,s,"yyyy-MM-dd h:mm:ss a")}},Lr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=yt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},Uw=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=yt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},wh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return Lr(n,e);case"usd":return Uw(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${ka.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}};function qw(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};je.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=u.width/2,g=va(c,d,f),p=c.y,y=c.x<f?"left":"center";return{x:g-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:y}},Uo.modes.customInteractionMode=function(l,c){const u=vn(c,l),d=[];return Uo.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,g,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p})}),d};const s=n.numLabels.value>25?Gd:Kd,r=({chart:l,index:c})=>{var d;const u=l.data;return{size:s,style:(d=u==null?void 0:u.isLabelEmpty)!=null&&d[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Er?c.slice(0,Er)+"...":c):l.getLabelForValue(Number(c)),a=h.computed(()=>{var l,c,u,d,f,g,p,y;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:r,callback:function(_,v){return o(this,_,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(_,v){return o(this,_,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((g=n.dimensionAxesTitle)==null?void 0:g.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(y=n.dimensionAxesTitle)==null?void 0:y.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:_=>{qd(n.tooltipState,_)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),a}Se.register(...b0);const Xw=(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 Gw(n,t,e,i,s){const r=h.shallowRef(null),o=(a,l)=>{if(t.value)return new Se(t.value,{type:n,data:a,plugins:i,options:l})};return h.onMounted(()=>{r.value=o(e.value,s.value)}),h.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),h.watch(e,(a,l)=>{if(Xw(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)}),h.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),h.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 be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function za(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,y){y&&y%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?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",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(vh);var Kw=vh.exports;const ws=za(Kw);function Zw(n,t,e){const{i18n:i}=yt.useI18n(),{translateUnit:s}=yt.useTranslatedUnits();return{legendValues:h.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=Lr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ws(l,{capital:!0}),unit:u})||`${ws(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var Qw=Object.defineProperty,Jw=(n,t,e)=>t in n?Qw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Te=(n,t,e)=>Jw(n,typeof t!="symbol"?t+"":t,e),pt=(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))(pt||{});const Mh=["in","not_in","selector"],kh=["empty","not_empty"],t1=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],vs=n=>n.filter(t=>t!=="time"),Dh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Ba=vs(Dh),e1=["active_services","request_count","request_per_minute","response_latency_average"],n1=[...Dh,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Ha=vs(n1);[...e1];const i1=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Wa=vs(i1);vs(["api","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","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),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(Ba),new Set(Ha),new Set(Wa),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Mh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Ha,...Ba,...Wa])]),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Mh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Ha,...Ba,...Wa])]);const Sh=6048e5,s1=864e5,r1=60,o1=3600,Th=Symbol.for("constructDateFrom");function Ce(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Th in n?n[Th](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Ce(t||n,n)}function Ch(n,t,e){const i=de(n,void 0);return isNaN(t)?Ce(n,NaN):(i.setDate(i.getDate()+t),i)}function a1(n,t,e){const i=de(n,void 0);if(isNaN(t))return Ce(n,NaN);const s=i.getDate(),r=Ce(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 l1={};function Ms(){return l1}function rn(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=de(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 rn(n,{...t,weekStartsOn:1})}function Ph(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Ce(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Nr(s),o=Ce(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 Oh(n){const t=de(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 c1(n,...t){const e=Ce.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Fr(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function u1(n,t,e){const[i,s]=c1(void 0,n,t),r=Fr(i),o=Fr(s),a=+r-Oh(r),l=+o-Oh(o);return Math.round((a-l)/s1)}function d1(n,t){const e=Ph(n),i=Ce(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Nr(i)}function h1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function f1(n){return!(!h1(n)&&typeof n!="number"||isNaN(+de(n)))}function wi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function g1(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const p1={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"}},m1=(n,t,e)=>{let i;const s=p1[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 y1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},b1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},x1={date:Ya({formats:y1,defaultWidth:"full"}),time:Ya({formats:b1,defaultWidth:"full"}),dateTime:Ya({formats:_1,defaultWidth:"full"})},w1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},v1=(n,t,e,i)=>w1[n];function ks(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const 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 M1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},k1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},D1={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"]},S1={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"]},T1={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"}},C1={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"}},P1=(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"},O1={ordinalNumber:P1,era:ks({values:M1,defaultWidth:"wide"}),quarter:ks({values:k1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ks({values:D1,defaultWidth:"wide"}),day:ks({values:S1,defaultWidth:"wide"}),dayPeriod:ks({values:T1,defaultWidth:"wide",formattingValues:C1,defaultFormattingWidth:"wide"})};function Ds(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)?A1(a,d=>d.test(o)):E1(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 E1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function A1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function R1(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 I1=/^(\d+)(th|st|nd|rd)?/i,L1=/\d+/i,N1={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},F1={any:[/^b/i,/^(a|c)/i]},z1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},B1={any:[/1/i,/2/i,/3/i,/4/i]},H1={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},W1={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]},Y1={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},j1={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]},$1={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},V1={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}},U1={ordinalNumber:R1({matchPattern:I1,parsePattern:L1,valueCallback:n=>parseInt(n,10)}),era:Ds({matchPatterns:N1,defaultMatchWidth:"wide",parsePatterns:F1,defaultParseWidth:"any"}),quarter:Ds({matchPatterns:z1,defaultMatchWidth:"wide",parsePatterns:B1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ds({matchPatterns:H1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any"}),day:Ds({matchPatterns:Y1,defaultMatchWidth:"wide",parsePatterns:j1,defaultParseWidth:"any"}),dayPeriod:Ds({matchPatterns:$1,defaultMatchWidth:"any",parsePatterns:V1,defaultParseWidth:"any"})},q1={code:"en-US",formatDistance:m1,formatLong:x1,formatRelative:v1,localize:O1,match:U1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function X1(n,t){const e=de(n,void 0);return u1(e,g1(e))+1}function G1(n,t){const e=de(n,void 0),i=+Nr(e)-+d1(e);return Math.round(i/Sh)+1}function Eh(n,t){var e,i,s,r;const o=de(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=Ce((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=rn(u,t),f=Ce((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const g=rn(f,t);return+o>=+d?a+1:+o>=+g?a:a-1}function K1(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=Eh(n,t),c=Ce((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),rn(c,t)}function Z1(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+K1(e,t);return Math.round(i/Sh)+1}function Ct(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 Ct(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Ct(e+1,2)},d(n,t){return Ct(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 Ct(n.getHours()%12||12,t.length)},H(n,t){return Ct(n.getHours(),t.length)},m(n,t){return Ct(n.getMinutes(),t.length)},s(n,t){return Ct(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Ct(s,t.length)}},vi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ah={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=Eh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Ct(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=Ph(n);return Ct(e,t.length)},u:function(n,t){const e=n.getFullYear();return Ct(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 Ct(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 Ct(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 Ct(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=Z1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=G1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Ct(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=X1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Ct(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 Ct(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 Ct(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 Ct(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=vi.noon:i===0?s=vi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=vi.evening:i>=12?s=vi.afternoon:i>=4?s=vi.morning:s=vi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return 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"}):Ct(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(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 Ih(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 Ih(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"+Rh(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"+Rh(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Ct(i,t.length)},T:function(n,t,e){return Ct(+n,t.length)}};function Rh(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+Ct(r,2)}function Ih(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ct(Math.trunc(i/60),2),r=Ct(i%60,2);return e+s+t+r}const Lh=(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"})}},Nh=(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"})}},Q1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Lh(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}}",Lh(i,t)).replace("{{time}}",Nh(s,t))},J1={p:Nh,P:Q1},tv=/^D+$/,ev=/^Y+$/,nv=["D","DD","YY","YYYY"];function iv(n){return tv.test(n)}function sv(n){return ev.test(n)}function rv(n,t,e){const i=ov(n,t,e);if(console.warn(i),nv.includes(n))throw new RangeError(i)}function ov(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 av=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cv=/^'([^]*?)'?$/,uv=/''/g,dv=/[a-zA-Z]/;function hv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ms(),f=(e==null?void 0:e.locale)??d.locale??q1,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,y=de(n,e==null?void 0:e.in);if(!f1(y))throw new RangeError("Invalid time value");let _=t.match(lv).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=J1[D];return S(M,f.formatLong)}return M}).join("").match(av).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:fv(M)};if(Ah[D])return{isToken:!0,value:M};if(D.match(dv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(_=f.localize.preprocessor(y,_));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:f};return _.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&sv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&iv(D))&&rv(D,t,String(n));const S=Ah[D[0]];return S(y,D,f.localize,v)}).join("")}function fv(n){const t=n.match(cv);return t?t[1].replace(uv,"'"):n}function gv(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ce(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function pv(){return Object.assign({},Ms())}function mv(n){return Math.trunc(n*o1)}function yv(n){const t=n/r1;return Math.trunc(t)}function Fh(n,t,e){return a1(n,-1)}function zh(n,t,e){const i=pv(),s=xv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?bv(s,t):_v(s,t)}function bv(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 _v(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function xv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function wv(n,t){const e=Sv(t);return"formatToParts"in e?Mv(e,n):kv(e,n)}const vv={year:0,month:1,day:2,hour:3,minute:4,second:5};function Mv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=vv[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 kv(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={},Bh=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")),Dv=Bh==="06/25/2014, 00:00:00"||Bh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Sv(n){return ja[n]||(ja[n]=Dv?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 $a(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 Hh=36e5,Tv=6e4,Va={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ss(n,t,e){if(!n)return 0;let i=Va.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Va.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Wh(s)?-(s*Hh):NaN;if(i=Va.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Wh(s,o)?(r=Math.abs(s)*Hh+o*Tv,i[1]==="+"?-r:r):NaN}if(Ov(n)){t=new Date(t||Date.now());const o=e?t:Cv(t),a=Ua(o,n);return-(e?a:Pv(t,a,n))}return NaN}function Cv(n){return $a(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=wv(n,t),i=$a(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 Pv(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 Wh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Yh={};function Ov(n){if(Yh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Yh[n]=!0,!0}catch{return!1}}const Ev=60*1e3,Av={X:function(n,t,e){const i=qa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return jh(i);case"XXXX":case"XX":return Mi(i);case"XXXXX":case"XXX":default:return Mi(i,":")}},x:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"x":return jh(i);case"xxxx":case"xx":return Mi(i);case"xxxxx":case"xxx":default:return Mi(i,":")}},O:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Rv(i,":");case"OOOO":default:return"GMT"+Mi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return zh("short",n,e);case"zzzz":default:return zh("long",n,e)}}};function qa(n,t){const e=n?Ss(n,t,!0)/Ev:(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 Mi(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 jh(n,t){return n%60===0?(n>0?"-":"+")+zr(Math.abs(n)/60,2):Mi(n,t)}function Rv(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 $h(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 Vh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Xa=36e5,Uh=6e4,Iv=2,he={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Vh};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?Iv: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=Lv(n),{year:s,restDateString:r}=Nv(i.date,e),o=Fv(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=zv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ss(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=$h(new Date(a+l)),c=$h(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Lv(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Nv(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Fv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Gh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Wv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Gh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Kh(s)?qh(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Kh(s,o)?qh(t,s,o):new Date(NaN)}return null}function zv(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*Xa:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*Xa+e*Uh:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,e,s)?t%24*Xa+e*Uh+s*1e3:NaN}return null}function qh(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 Bv=[31,28,31,30,31,30,31,31,30,31,30,31],Hv=[31,29,31,30,31,30,31,31,30,31,30,31];function Xh(n){return n%400===0||n%4===0&&n%100!==0}function Gh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Xh(n);if(i&&e>Hv[t]||!i&&e>Bv[t])return!1}return!0}function Wv(n,t){if(t<1)return!1;const e=Xh(n);return!(e&&t>366||!e&&t>365)}function Kh(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 Yv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function jv(n,t,e={}){t=String(t);const i=t.match(Yv);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,"'"+Av[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return hv(n,t,e)}function Zh(n,t,e){n=Br(n,e);const i=Ss(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 $v(n,t,e,i){return i={...i,timeZone:t,originalDate:n},jv(Zh(n,t,{timeZone:i.timeZone}),e,i)}function Vv(n,t,e){if(typeof n=="string"&&!n.match(Vh))return Br(n,{...e,timeZone:t});n=Br(n,e);const i=$a(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ss(t,new Date(i));return new Date(i+s)}function Uv(n,t){return-Ss(n,t)}function Tn(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 $v(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const qv={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&&t1.find(t=>n<=qv[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]",f="[object Map]",g="[object Number]",p="[object Object]",y="[object Promise]",_="[object RegExp]",v="[object Set]",M="[object String]",D="[object Symbol]",S="[object WeakMap]",T="[object ArrayBuffer]",R="[object DataView]",E="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",P="[object Int16Array]",I="[object Int32Array]",C="[object Uint8Array]",F="[object Uint8ClampedArray]",q="[object Uint16Array]",G="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,U=/\w*$/,ut=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,K={};K[r]=K[o]=K[T]=K[R]=K[a]=K[l]=K[E]=K[b]=K[x]=K[P]=K[I]=K[f]=K[g]=K[p]=K[_]=K[v]=K[M]=K[D]=K[C]=K[F]=K[q]=K[G]=!0,K[c]=K[u]=K[S]=!1;var B=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,j=typeof self=="object"&&self&&self.Object===Object&&self,H=B||j||Function("return this")(),xt=t&&!t.nodeType&&t,mt=xt&&!0&&n&&!n.nodeType&&n,vt=mt&&mt.exports===xt;function ft(w,A){return w.set(A[0],A[1]),w}function gt(w,A){return w.add(A),w}function z(w,A){for(var N=-1,X=w?w.length:0;++N<X&&A(w[N],N,w)!==!1;);return w}function $(w,A){for(var N=-1,X=A.length,$t=w.length;++N<X;)w[$t+N]=A[N];return w}function Y(w,A,N,X){for(var $t=-1,Kt=w?w.length:0;++$t<Kt;)N=A(N,w[$t],$t,w);return N}function Q(w,A){for(var N=-1,X=Array(w);++N<w;)X[N]=A(N);return X}function tt(w,A){return w==null?void 0:w[A]}function et(w){var A=!1;if(w!=null&&typeof w.toString!="function")try{A=!!(w+"")}catch{}return A}function it(w){var A=-1,N=Array(w.size);return w.forEach(function(X,$t){N[++A]=[$t,X]}),N}function nt(w,A){return function(N){return w(A(N))}}function _t(w){var A=-1,N=Array(w.size);return w.forEach(function(X){N[++A]=X}),N}var at=Array.prototype,Pt=Function.prototype,te=Object.prototype,ae=H["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Oe=Pt.toString,Mt=te.hasOwnProperty,Xt=te.toString,Bt=RegExp("^"+Oe.call(Mt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?H.Buffer:void 0,ie=H.Symbol,qe=H.Uint8Array,ni=nt(Object.getPrototypeOf,Object),Ne=Object.create,Ht=te.propertyIsEnumerable,_e=at.splice,ii=Object.getOwnPropertySymbols,Jr=Gt?Gt.isBuffer:void 0,to=nt(Object.keys,Object),Rs=In(H,"DataView"),si=In(H,"Map"),Is=In(H,"Promise"),ri=In(H,"Set"),an=In(H,"WeakMap"),ln=In(Object,"create"),Ls=le(Rs),Ns=le(si),oi=le(Is),bl=le(ri),_l=le(an),eo=ie?ie.prototype:void 0,no=eo?eo.valueOf:void 0;function cn(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var X=w[A];this.set(X[0],X[1])}}function Oi(){this.__data__=ln?ln(null):{}}function Fs(w){return this.has(w)&&delete this.__data__[w]}function io(w){var A=this.__data__;if(ln){var N=A[w];return N===i?void 0:N}return Mt.call(A,w)?A[w]:void 0}function un(w){var A=this.__data__;return ln?A[w]!==void 0:Mt.call(A,w)}function xl(w,A){var N=this.__data__;return N[w]=ln&&A===void 0?i:A,this}cn.prototype.clear=Oi,cn.prototype.delete=Fs,cn.prototype.get=io,cn.prototype.has=un,cn.prototype.set=xl;function Fe(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var X=w[A];this.set(X[0],X[1])}}function wl(){this.__data__=[]}function vl(w){var A=this.__data__,N=Ai(A,w);if(N<0)return!1;var X=A.length-1;return N==X?A.pop():_e.call(A,N,1),!0}function Ml(w){var A=this.__data__,N=Ai(A,w);return N<0?void 0:A[N][1]}function ze(w){return Ai(this.__data__,w)>-1}function kl(w,A){var N=this.__data__,X=Ai(N,w);return X<0?N.push([w,A]):N[X][1]=A,this}Fe.prototype.clear=wl,Fe.prototype.delete=vl,Fe.prototype.get=Ml,Fe.prototype.has=ze,Fe.prototype.set=kl;function An(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var X=w[A];this.set(X[0],X[1])}}function Dl(){this.__data__={hash:new cn,map:new(si||Fe),string:new cn}}function Sl(w){return Li(this,w).delete(w)}function Tl(w){return Li(this,w).get(w)}function Be(w){return Li(this,w).has(w)}function Cl(w,A){return Li(this,w).set(w,A),this}An.prototype.clear=Dl,An.prototype.delete=Sl,An.prototype.get=Tl,An.prototype.has=Be,An.prototype.set=Cl;function Rn(w){this.__data__=new Fe(w)}function Pl(){this.__data__=new Fe}function Ol(w){return this.__data__.delete(w)}function El(w){return this.__data__.get(w)}function Ei(w){return this.__data__.has(w)}function Al(w,A){var N=this.__data__;if(N instanceof Fe){var X=N.__data__;if(!si||X.length<e-1)return X.push([w,A]),this;N=this.__data__=new An(X)}return N.set(w,A),this}Rn.prototype.clear=Pl,Rn.prototype.delete=Ol,Rn.prototype.get=El,Rn.prototype.has=Ei,Rn.prototype.set=Al;function Rl(w,A){var N=Ws(w)||Fi(w)?Q(w.length,String):[],X=N.length,$t=!!X;for(var Kt in w)Mt.call(w,Kt)&&!($t&&(Kt=="length"||Kl(Kt,X)))&&N.push(Kt);return N}function Ee(w,A,N){var X=w[A];(!(Mt.call(w,A)&&Hs(X,N))||N===void 0&&!(A in w))&&(w[A]=N)}function Ai(w,A){for(var N=w.length;N--;)if(Hs(w[N][0],A))return N;return-1}function Il(w,A){return w&&so(A,ai(A),w)}function zs(w,A,N,X,$t,Kt,xe){var ee;if(X&&(ee=Kt?X(w,$t,Kt,xe):X(w)),ee!==void 0)return ee;if(!hn(w))return w;var ho=Ws(w);if(ho){if(ee=Xl(w),!A)return Vl(w,ee)}else{var Ln=Xe(w),fo=Ln==u||Ln==d;if(lo(w))return Bl(w,A);if(Ln==p||Ln==r||fo&&!Kt){if(et(w))return Kt?w:{};if(ee=oo(fo?{}:w),!A)return Ul(w,Il(ee,w))}else{if(!K[Ln])return Kt?w:{};ee=Gl(w,Ln,zs,A)}}xe||(xe=new Rn);var go=xe.get(w);if(go)return go;if(xe.set(w,ee),!ho)var li=N?ql(w):ai(w);return z(li||w,function(js,zi){li&&(zi=js,js=w[zi]),Ee(ee,zi,zs(js,A,N,X,zi,w,xe))}),ee}function Ll(w){return hn(w)?Ne(w):{}}function Nl(w,A,N){var X=A(w);return Ws(w)?X:$(X,N(w))}function Fl(w){return Xt.call(w)}function Ri(w){if(!hn(w)||Zl(w))return!1;var A=Ys(w)||et(w)?Bt:ut;return A.test(le(w))}function zl(w){if(!dn(w))return to(w);var A=[];for(var N in Object(w))Mt.call(w,N)&&N!="constructor"&&A.push(N);return A}function Bl(w,A){if(A)return w.slice();var N=new w.constructor(w.length);return w.copy(N),N}function Ii(w){var A=new w.constructor(w.byteLength);return new qe(A).set(new qe(w)),A}function Hl(w,A){var N=A?Ii(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.byteLength)}function Wl(w,A,N){var X=A?N(it(w),!0):it(w);return Y(X,ft,new w.constructor)}function Bs(w){var A=new w.constructor(w.source,U.exec(w));return A.lastIndex=w.lastIndex,A}function Yl(w,A,N){var X=A?N(_t(w),!0):_t(w);return Y(X,gt,new w.constructor)}function jl(w){return no?Object(no.call(w)):{}}function $l(w,A){var N=A?Ii(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.length)}function Vl(w,A){var N=-1,X=w.length;for(A||(A=Array(X));++N<X;)A[N]=w[N];return A}function so(w,A,N,X){N||(N={});for(var $t=-1,Kt=A.length;++$t<Kt;){var xe=A[$t],ee=void 0;Ee(N,xe,ee===void 0?w[xe]:ee)}return N}function Ul(w,A){return so(w,ro(w),A)}function ql(w){return Nl(w,ai,ro)}function Li(w,A){var N=w.__data__;return Ni(A)?N[typeof A=="string"?"string":"hash"]:N.map}function In(w,A){var N=tt(w,A);return Ri(N)?N:void 0}var ro=ii?nt(ii,Object):co,Xe=Fl;(Rs&&Xe(new Rs(new ArrayBuffer(1)))!=R||si&&Xe(new si)!=f||Is&&Xe(Is.resolve())!=y||ri&&Xe(new ri)!=v||an&&Xe(new an)!=S)&&(Xe=function(w){var A=Xt.call(w),N=A==p?w.constructor:void 0,X=N?le(N):void 0;if(X)switch(X){case Ls:return R;case Ns:return f;case oi:return y;case bl:return v;case _l:return S}return A});function Xl(w){var A=w.length,N=w.constructor(A);return A&&typeof w[0]=="string"&&Mt.call(w,"index")&&(N.index=w.index,N.input=w.input),N}function oo(w){return typeof w.constructor=="function"&&!dn(w)?Ll(ni(w)):{}}function Gl(w,A,N,X){var $t=w.constructor;switch(A){case T:return Ii(w);case a:case l:return new $t(+w);case R:return Hl(w,X);case E:case b:case x:case P:case I:case C:case F:case q:case G:return $l(w,X);case f:return Wl(w,X,N);case g:case M:return new $t(w);case _:return Bs(w);case v:return Yl(w,X,N);case D:return jl(w)}}function Kl(w,A){return A=A??s,!!A&&(typeof w=="number"||V.test(w))&&w>-1&&w%1==0&&w<A}function Ni(w){var A=typeof w;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?w!=="__proto__":w===null}function Zl(w){return!!qt&&qt in w}function dn(w){var A=w&&w.constructor,N=typeof A=="function"&&A.prototype||te;return w===N}function le(w){if(w!=null){try{return Oe.call(w)}catch{}try{return w+""}catch{}}return""}function Ql(w){return zs(w,!0,!0)}function Hs(w,A){return w===A||w!==w&&A!==A}function Fi(w){return Jl(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==r)}var Ws=Array.isArray;function ao(w){return w!=null&&tc(w.length)&&!Ys(w)}function Jl(w){return fn(w)&&ao(w)}var lo=Jr||uo;function Ys(w){var A=hn(w)?Xt.call(w):"";return A==u||A==d}function tc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function hn(w){var A=typeof w;return!!w&&(A=="object"||A=="function")}function fn(w){return!!w&&typeof w=="object"}function ai(w){return ao(w)?Rl(w):zl(w)}function co(){return[]}function uo(){return!1}n.exports=Ql}(Wr,Wr.exports),Wr.exports;const ki=(n,t)=>new Date(n.getTime()-Uv(t,n));class Le{constructor(t){Te(this,"timeframeText"),Te(this,"key"),Te(this,"display"),Te(this,"timeframeLength"),Te(this,"allowedTiers"),Te(this,"defaultResponseGranularity"),Te(this,"dataGranularity"),Te(this,"isRelative"),Te(this,"fineGrainedDefaultGranularity"),Te(this,"_startCustom"),Te(this,"_endCustom"),Te(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=Vv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Zh(e,t)}}class Xv extends Le{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Gv extends Le{rawStart(t){let e=wi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class Kv extends Le{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=ki(i,t)),i}}class Zv extends Le{rawEnd(t){let e=wi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}rawStart(t){let e=wi(Fh(this.tzAdjustedDate(t)));return t&&(e=ki(e,t)),e}}pt.FIFTEEN_MIN,new Le({key:pt.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"]}),pt.ONE_HOUR,new Le({key:pt.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"]}),pt.SIX_HOUR,new Le({key:pt.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"]}),pt.TWELVE_HOUR,new Le({key:pt.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"]}),pt.ONE_DAY,new Le({key:pt.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"]}),pt.SEVEN_DAY,new Le({key:pt.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"]}),pt.THIRTY_DAY,new Le({key:pt.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"]}),pt.CURRENT_WEEK,new Xv({key:pt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Fr(Ch(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),pt.CURRENT_MONTH,new Gv({key:pt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=wi(new Date);return(Fr(Ch(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),pt.PREVIOUS_WEEK,new Kv({key:pt.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"]}),pt.PREVIOUS_MONTH,new Zv({key:pt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=wi(new Date),e=wi(Fh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Qv(t,e)),60*60*24*gv(new Date().setMonth(new Date().getMonth()-1))+mv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Qv(n,t){return yv(n.getTimezoneOffset()-t.getTimezoneOffset())}pt.FIFTEEN_MIN,pt.ONE_HOUR,pt.SIX_HOUR,pt.TWELVE_HOUR,pt.ONE_DAY,pt.SEVEN_DAY,pt.FIFTEEN_MIN,pt.ONE_HOUR,pt.SIX_HOUR,pt.TWELVE_HOUR,pt.ONE_DAY,pt.SEVEN_DAY,pt.THIRTY_DAY,pt.CURRENT_WEEK,pt.CURRENT_MONTH,pt.PREVIOUS_WEEK,pt.PREVIOUS_MONTH;function Jv(n){return h.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?`${Tn(e)} - ${Tn(i,{includeTZ:!0})}`:""})}function tM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};je.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=va(o,l,c),d=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:d,xAlign:f}};const s=h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{qd(n.tooltipState,r)}}}}));return h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),{options:s}}function eM(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return xh(d,n.granularity.value,o.value)}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=h.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};je.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=va(c,d,g);let _=sw(c,f,p);const v=c.y<p?"top":"bottom",M=c.x<g?"left":"center";return f>u.height&&(_=0),{x:y,y:_,xAlign:M,yAlign:v}};const o=h.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Nx(l)>24||u.getDate()!==c.getDate()}),a=h.computed(()=>{var l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:c=>{Qx(n.tooltipState,c,n.granularity.value)}}},interaction:{mode:"index",intersect:!1}}});return h.onUnmounted(()=>{je.positioners[s]&&delete je.positioners[s]}),{options:a}}function nM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=yt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Ar(i.indexOf(u),sn),data:o.map((d,f)=>e?r[`${d.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const f=Da(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function iM(n,t){const{i18n:e}=yt.useI18n();return h.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,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const d=c&&a||o,f=d[0],g=d.length>1?d[1]:d[0],p=Object.fromEntries(l?s.flatMap(x=>o.map((P,I)=>{const C=x.event[f],F=c?`${C},${P}`:`${I},${P}`,q=x.event[P];return[F,q]})):s.map(x=>{const P=c?`${x.event[f]},${x.event[g]}`:`${f},${g}`,I=x.event[o[0]];return[P,I]})),y=Object.keys(p).reduce((x,P)=>{const[I]=P.split(","),C=p[P];return x[I]?x[I]+=C:x[I]=C,x},{}),_=Object.entries(y).sort(([,x],[,P])=>Number(P)-Number(x)).map(([x])=>x),v=r[f],M=r[g],D=c&&v&&Object.entries(v).map(([x,P])=>({id:x,name:P.name}))||o.map(x=>({id:x,name:x})),S=c&&M&&Object.entries(M).map(([x,P])=>({id:x,name:P.name}))||o.map(x=>({id:x,name:x}));if(f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((x,P)=>_.indexOf(x.id)-_.indexOf(P.id)),S.sort((x,P)=>_.indexOf(x.id)-_.indexOf(P.id))),!D||!S)return{labels:[],datasets:[]};const T=nM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:d,barSegmentLabels:S,pivotRecords:p,rowLabels:D,colorPalette:n.colorPalette||sn}),R=c?D.map(x=>e&&e.te(`chartLabels.${x.name}`)&&e.t(`chartLabels.${x.name}`)||x.name):o.map(x=>e&&e.te(`chartLabels.${x}`)&&e.t(`chartLabels.${x}`)||x),E=D.map(x=>x.id==="empty");return{labels:R,datasets:T,isLabelEmpty:E,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const sM="#6c7489",rM="#6c7489",oM="#995c00",aM="16px",lM="20px",Qh="24px",cM="40px",uM="48px",dM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),hM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Vd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},fM=(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 dM(a,l,e)};function gM(n,t){const{i18n:e}=yt.useI18n();return h.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],f=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||o.map(S=>({id:S,name:S})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=hM(a),y=fM(a,l,g,p,s),_=new Set,v=s!=null&&s.length?s.reduce((S,T)=>{const R=new Date(T.timestamp).valueOf(),E=T.event;for(const b of o)_.add(b),R in S||(S[R]={}),b in S[R]||(S[R][b]={});for(const b of o)f.forEach(x=>{E[u]===x.id||b===x.id?(S[R][b]||(S[R][b]={}),S[R][b][x.name]=Math.round(Number(E[b])*1e3)/1e3):c.length||(S[R][b]||(S[R][b]={}),S[R][b][x.name]=Math.round(Number(E[x.id])*1e3)/1e3)});return S},{}):{},D=[...o.length===1?o.flatMap(S=>f.map(T=>[S,T.name,T.id==="empty"])):f.map(S=>[S.name,S.name,S.id==="empty"])].map(([S,T,R],E)=>{const b=y.map(C=>C in v&&S in v[C]?{x:C,y:v[C][S][T]||0}:{x:C,y:0});let{colorPalette:x,fill:P}=n;st(x)&&(x=sn);const I=Da(E,T,R,x);return{rawDimension:T,rawMetric:S,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:I,backgroundColor:I,data:b,total:b.reduce((C,{y:F})=>C+Number(F),0),...hw,fill:P,borderWidth:P?gw:fw,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((S,T)=>(S.label??"")<(T.label??"")?-1:1):D.sort((S,T)=>Number(S.total)<Number(T.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const T=n.threshold[S];T&&D.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:sM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:y.map(R=>({x:R,y:T}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const pM=(n,t)=>{h.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 mM(){const{i18n:n}=yt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const Jh="analytics-query-provider",tf=2;function yM(){const n=h.inject(Jh);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function bM(n,t){const e=h.computed(()=>{if(!n.value)return t.left;const s=n.value.getBoundingClientRect();return`${parseFloat(t.left)+s.left+window.scrollX}px`}),i=h.computed(()=>{if(!n.value)return t.top;const s=n.value.getBoundingClientRect();return`${parseFloat(t.top)+s.top+window.scrollY}px`});return{tooltipAbsoluteLeft:e,tooltipAbsoluteTop:i}}const yt={useBarChartOptions:qw,useChartJSCommon:Gw,useChartLegendValues:Zw,useChartSelectedRange:Jv,useExploreResultToDatasets:iM,useExploreResultToTimeDataset:gM,useDonutChartOptions:tM,useLineChartOptions:eM,useI18n:gg,useReportChartDataForSynthetics:pM,useTranslatedUnits:mM,useEvaluateFeatureFlag:yM,useTooltipAbsolutePosition:bM};var Nt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Nt||{});/*!
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 nf={modes:{point(n,t){return Yr(n,t,{intersect:!0})},nearest(n,t,e){return vM(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 Qa(n,t,e){return(nf.modes[e.mode]||nf.modes.nearest)(n,t,e)}function xM(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 wM(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):xM(i,t,e.axis))}function vM(n,t,e){let i=Number.POSITIVE_INFINITY;return Yr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=wM(t,o,e.axis),l=di(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 Zn(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 MM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Qn=.001,jr=(n,t,e)=>Math.min(e,Math.max(t,n)),sf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function kM(n,t,e){for(const i of Object.keys(n))n[i]=jr(n[i],t,e);return n}function DM(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 rf(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-Qn&&n.x<=i+l+Qn,u=n.y>=e-l-Qn&&n.y<=s+l+Qn;return r==="x"?c:(r==="y"||c)&&u}function of(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Zn(n,e,Vt(-s));return rf(a,t,i,{borderWidth:r,hitTolerance:o})}function Jn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function SM(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(MM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const af=n=>typeof n=="string"&&n.endsWith("%"),lf=n=>parseFloat(n)/100,cf=n=>jr(lf(n),0,1),Ts=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),TM={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 Ja(n,t){return t==="start"?0:t==="end"?n:af(t)?cf(t)*n:n/2}function Cn(n,t,e=!0){return typeof t=="number"?t:af(t)?(e?cf(t):lf(t))*n:n}function CM(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 uf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=ht(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=tl(i),d=gf(n.x,l,s,u.x),f=gf(n.y,c,r,u.y);return{x:d,y:f,x2:d+l,y2:f+c,width:l,height:c,centerX:d+l/2,centerY:f+c/2}}function tl(n,t="center"){return ht(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}const df=(n,t)=>n&&n.autoFit&&t<1;function hf(n,t){const e=n.font,i=kt(e)?e:[e];return df(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function ff(n){return n&&(ge(n.xValue)||ge(n.yValue))}function gf(n,t,e=0,i){return n-Ja(t,i)+e}function Di(n,t,e){const i=e.init;if(i){if(i===!0)return mf(t,e)}else return;return PM(n,t,e)}function pf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function mf(n,t){const e=t.type||"line";return TM[e](n)}function PM(n,t,e){const i=Dt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return mf(t,e);if(ht(i))return i}const el=new Map,OM=n=>isNaN(n)||n<=0,EM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function $r(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Vr(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Vt(i)),n.translate(-t,-e))}function on(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($r(e))return{width:Cn(e.width,t.width),height:Cn(e.height,t.height)};const i=hf(t),s=t.textStrokeWidth,r=kt(e)?e:[e],o=r.join()+EM(i)+s+(n._measureText?"-spriting":"");return el.has(o)||el.set(o,LM(n,r,i,s)),el.get(o)}function yf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Si(n,e);const a=on(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),hi(n,{x:i,y:s,w:r,h:o,radius:kM(xn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function bf(n,t,e,i){const s=e.content;if($r(s)){n.save(),n.globalAlpha=zM(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=kt(s)?s:[s],o=hf(e,i),a=e.color,l=kt(a)?a:[a],c=CM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,AM(n,e)&&NM(n,{x:c,y:u},r,o),FM(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function AM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function RM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*ko;if($r(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}OM(s)||IM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function IM(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,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Ks,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Ks,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+De)*c,l=Math.sin(o+De)*c,n.arc(t-a,e-l,u,o-ct,o-Et),n.arc(t+l,e-a,u,o-Et,o),n.arc(t+a,e+l,u,o,o+Et),n.arc(t-l,e+a,u,o+Et,o+ct),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=De;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+=De;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+=De,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 LM(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 NM(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 FM(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 zM(n,t){const e=_n(n)?n:t;return _n(e)?jr(e,0,1):1}const _f=["left","bottom","top","right"];function BM(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&$M(t,r);if(!o||UM(t,r,o))return;if(n.save(),n.beginPath(),!on(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=HM(t,o),{sideStart:u,sideEnd:d}=YM(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 f=Zn({x:e,y:i},t.getCenterPoint(),Vt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function HM(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=WM(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 WM(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 YM(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=jM(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Cn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Cn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function jM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function $M(n,t){const e=t.position;return _f.includes(e)?e:VM(n,t)}function VM(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,y=Cn(o,p),_=Cn(a,p),v=[e,e+y,e+y,s],M=[i+_,r,i,r],D=[];for(let S=0;S<4;S++){const T=Zn({x:v[S],y:M[S]},g,Vt(f));D.push({position:_f[S],distance:di(T,{x:l,y:c})})}return D.sort((S,T)=>S.distance-T.distance)[0].position}function UM(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 xf={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 Ti(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ti(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 wf(n,t){if(n){const e=n.options.reverse,i=Ti(n,t.min,e?t.end:t.start),s=Ti(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function vf(n,t){const{chartArea:e,scales:i}=n,s=i[ti(i,t,"xScaleID")],r=i[ti(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Ti(s,t.xValue,s.left+s.width/2)),r&&(a=Ti(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function nl(n,t){const e=n.scales,i=e[ti(e,t,"xScaleID")],s=e[ti(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=Df(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=Df(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 Mf(n,t){if(!ff(t)){const e=nl(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 XM(n,t)}function qM(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?GM(s,r,t):KM(e,r,t),r}function kf(n,t){const e=nl(n,t);return e.initProperties=Di(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:JM(n,e,t),initProperties:e.initProperties}],e}function XM(n,t){const e=vf(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 Df(n,t){const e=wf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function GM(n,t,e){const i=Ti(n,e.value,NaN),s=Ti(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function KM(n,t,e){for(const i of Object.keys(xf)){const s=n[ti(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=xf[i],d=wf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function ZM({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Sf({start:r,end:o,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 Sf({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Sf(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+Ja(c,r)}function JM(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=tl(i.position),r=Ut(i.padding),o=Ur(n.ctx,i),a=ZM({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 il=["enter","leave"],sl=il.concat("click");function tk(n,t,e){t.listened=pf(e,sl,t.listeners),t.moveListened=!1,il.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||il.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function ek(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return nk(n,t,e);case"click":return ik(n,t,e)}}function nk(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Qa(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=Tf(r,"leave",s,i);return Tf(r,"enter",i,s)||o}function Tf({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=Cf(o.options[e]||n.listeners[e],o,t)||r);return r}function ik(n,t,e){const i=n.listeners,s=Qa(n.visibleElements,t,e.interaction);let r;for(const o of s)r=Cf(o.options.click||i.click,o,t)||r;return r}function Cf(n,t,e){return Dt(n,[t.$context,e])===!0}const qr=["afterDraw","beforeDraw"];function sk(n,t,e){const i=t.visibleElements;t.hooked=pf(e,qr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||qr.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function Pf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Dt(i,[t.$context])}}function rk(n,t,e){const i=uk(n.scales,t,e);let s=Of(t,i,"min","suggestedMin");s=Of(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function ok(n,t){for(const e of n)lk(e,t)}function Of(n,t,e,i){if(Rt(t[e])&&!ak(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function ak(n,t,e){return ge(n[t])||ge(n[e])}function lk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ti(t,n,e);i&&!t[i]&&ck(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function ck(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function uk(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Ef(a,t,["value","endValue"],o):ti(n,a,r)===s&&Ef(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Ef(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Ci extends Jt{inRange(t,e,i,s){const{x:r,y:o}=Zn({x:t,y:e},this.getCenterPoint(s),Vt(-this.options.rotation));return rf({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Jn(this,t)}draw(t){t.save(),Vr(t,this.getCenterPoint(),this.options.rotation),yf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return kf(t,e)}}Ci.id="boxAnnotation",Ci.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},Ci.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ci.descriptors={label:{_fallback:!0}};class Xr extends Jt{inRange(t,e,i,s){return of({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 Jn(this,t)}draw(t){const e=this.options;!e.display||!e.content||(mk(t,this),t.save(),Vr(t,this.getCenterPoint(),this.rotation),bf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=dk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=fk(t,e,i);let a=Ur(t.ctx,e);const l=gk(a,o);df(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,f=uf(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Di(t,f,e),...f,...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 dk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof en&&hk(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function hk(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 fk({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,f={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:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,_=g.y>d,v=_?s+p:o-p,M=pk(v,u,d,y);return{controllerMeta:{_centerX:u,_centerY:d,_radius:y,_counterclockwise:_,...M},point:g,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function gk({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function pk(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:Ot};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:Qs({x:t,y:e},{x:c,y:n}).angle,_endAngle:Qs({x:t,y:e},{x:u,y:n}).angle}}function mk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=on(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 Jt{inRange(t,e,i,s){return of({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 Jn(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Vr(t,this.getCenterPoint(),this.rotation),BM(t,this),yf(t,this,e),bf(t,yk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(ff(e))i=vf(t,e);else{const{centerX:a,centerY:l}=nl(t,e);i={x:a,y:l}}const s=Ut(e.padding),r=Ur(t.ctx,e),o=uf(i,r,e,s);return{initProperties:Di(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 yk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Ut(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 rl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ol=(n,t,e)=>rl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Af=(n,t,e)=>rl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Ps=n=>n*n,bk=(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},Rf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,al=(n,t,e,i)=>({x:Rf(n.x,t.x,e.x,i),y:Rf(n.y,t.y,e.y,i)}),If=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Lf=(n,t,e,i)=>-Math.atan2(If(n.x,t.x,e.x,i),If(n.y,t.y,e.y,i))+.5*ct;class Os extends Jt{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){on(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,f)||ll(this,o,s);return l.restore(),g}const c=Ps(r);return vk(this,o,c,s)||ll(this,o,s)}return _k(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return Jn(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!on(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 Ok(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Hf(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-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),cl(t,0,d,c),cl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=qM(t,e),{x:s,y:r,x2:o,y2:a}=i,l=xk(i,t.chartArea),c=l?wk({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=Di(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Pk(c,e,di(d,f))}const u=Mk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Os.id="lineAnnotation";const Nf={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};Os.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Nf),fill:!1,length:12,start:Object.assign({},Nf),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},Os.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Os.defaultRoutes={borderColor:"color"};function _k(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=bk(t,e,n.getProps(["x","y","x2","y2"],r),i);return sf(o,s)||ll(n,{mouseX:t,mouseY:e},r,i)}function xk({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 Ff({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Af(o,{x:n,y:t},e),n=o),n>s&&(t=Af(s,{x:n,y:t},e),n=s),t<i&&(n=ol(i,{x:n,y:t},e),t=i),t>r&&(n=ol(r,{x:n,y:t},e),t=r),{x:n,y:t}}function wk(n,t,e){const{x:i,y:s}=Ff(n,t,e),{x:r,y:o}=Ff(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function vk(n,{mouseX:t,mouseY:e},i=Qn,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Ps(c)+Ps(u),f=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return f<0?(g=r,p=o):f>1?(g=a,p=l):(g=r+f*c,p=o+f*u),Ps(t-g)+Ps(e-p)<=i}function ll(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function Mk(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=Ur(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return Dk(t,e,{width:o,height:a,padding:s},n.chartArea)}function kk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ct/2?r-ct:r<ct/-2?r+ct:r}function Dk(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"?kk(n):Vt(t.rotation),f=Sk(s,r,d),g=Tk(n,t,{labelSize:f,padding:o},i),p=n.cp?al(c,n.cp,u,g):rl(c,u,g),y={size:f.w,min:i.left,max:i.right,padding:o.left},_={size:f.h,min:i.top,max:i.bottom,padding:o.top},v=Bf(p.x,y)+a,M=Bf(p.y,_)+l;return{x:v-s/2,y:M-r/2,x2:v+s/2,y2:M+r/2,centerX:v,centerY:M,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Zs(d)}}function Sk(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 Tk(n,t,e,i){let s;const r=Ck(n,i);return t.position==="start"?s=zf({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-zf({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Ja(1,t.position),s}function zf(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 Ck(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 Bf(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 Hf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Wf(n,e),endAdjust:Wf(n,i)}}function Wf(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(ol(0,r,{x:0,y:s}))}function cl(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),on(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 Pk(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=tl(t.controlPoint,0),d={x:a+Cn(e,u.x,!1),y:l+Cn(e,u.y,!1)};return Zn(d,{x:a,y:l},c)}function Yf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),cl(n,0,-s,r),n.restore())}function Ok(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Hf(t),g={x:s,y:r},p={x:o,y:a},y=Lf(g,e,p,0),_=Lf(g,e,p,1)-ct,v=al(g,e,p,d/i),M=al(g,e,p,1-f/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,M.x,M.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Yf(n,v,{angle:y,adjust:d},c),Yf(n,M,{angle:_,adjust:f},u)}class Es extends Jt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Ek({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},f=Zn({x:t,y:e},this.getCenterPoint(s),Vt(-r));return f[i]>=d.start-o-Qn&&f[i]<=d.end+o+Qn}getCenterPoint(t){return Jn(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Vr(t,this.getCenterPoint(),o.rotation),Si(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=on(t,o);t.ellipse(s,r,i/2,e/2,ct/2,0,2*ct),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return kf(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({},Ci.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 Ek(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=Vt(e||0),d=Math.cos(u),f=Math.sin(u),g=Math.pow(d*(n.x-o)+f*(n.y-a),2),p=Math.pow(f*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Gr extends Jt{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"?DM({x:t,y:e},this.getCenterPoint(s),c/2,u):sf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return Jn(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=on(t,e);RM(t,this,this.centerX,this.centerY),s&&!$r(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Mf(t,e);return i.initProperties=Di(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 Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Rk(this.elements,t,e,s);const r=Zn({x:t,y:e},this.getCenterPoint(s),Vt(-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 Jn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Si(t,i);const s=on(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=Mf(t,e),{sides:s,rotation:r}=e,o=[],a=2*ct/s;let l=r*ko;for(let c=0;c<s;c++,l+=a){const u=Ak(i,e,l);u.initProperties=Di(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 Ak({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 Rk(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 Pn={box:Ci,doughnutLabel:Xr,ellipse:Es,label:Cs,line:Os,point:Gr,polygon:Kr};Object.keys(Pn).forEach(n=>{At.describe(`elements.${Pn[n].id}`,{_fallback:"plugins.annotation.common"})});const Ik={update:Object.assign},Lk=sl.concat(qr),jf=(n,t)=>ht(t)?hl(n,t):n,ul=n=>n==="color"||n==="font";function dl(n="line"){return Pn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Nk(n,t,e,i){const s=zk(n,e.animations,i),r=t.annotations,o=Wk(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=$f(o,a,l.type),u=l.setContext(Hk(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=Fk(d),"elements"in d&&(Bk(c,d.elements,u,s),delete d.elements),ge(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Vf(u),s.update(c,d)}}function Fk(n){return isNaN(n.x)||isNaN(n.y)}function zk(n,t,e){return e==="reset"||e==="none"||e==="resize"?Ik:new zo(n,t)}function Bk(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=$f(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Vf(c),i.update(l,a)}}function $f(n,t,e,i){const s=Pn[dl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Vf(n){const t=Pn[dl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,hl(n,t.defaults),hl(n,t.defaultRoutes));for(const i of Lk)e[i]=n[i];return e}function hl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];ul(i)&&kt(r)?e[i]=r.map(o=>jf(o,s)):e[i]=jf(r,s)}return e}function Hk(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 Wk(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 Yk="3.1.0";const On=new Map,Uf=n=>n.type!=="doughnutLabel",jk=sl.concat(qr);var qf={id:"annotation",version:Yk,beforeRegister(){SM("chart.js","4.0",Se.version)},afterRegister(){Se.register(Pn)},afterUnregister(){Se.unregister(Pn)},beforeInit(n){On.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=On.get(n),s=i.annotations=[];let r=e.annotations;ht(r)?Object.keys(r).forEach(o=>{const a=r[o];ht(a)&&(a.id=o,s.push(a))}):kt(r)&&s.push(...r),ok(s.filter(Uf),n.scales)},afterDataLimits(n,t){const e=On.get(n);rk(n,t.scale,e.annotations.filter(Uf).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=On.get(n);tk(n,i,e),Nk(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),sk(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=On.get(n);ek(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){On.delete(n)},getAnnotations(n){const t=On.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Qa(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=>!jk.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Pn[dl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ul,_fallback:!0},_indexable:ul}},additionalOptionScopes:[""]};function As(n,t,e){const{ctx:i,chartArea:s}=n,r=On.get(n);e&&Gi(i,s);const o=$k(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)Vk(i,s,r,a);e&&Ki(i)}function $k(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 Vk(n,t,e,i){const s=i.element;i.main?(Pf(e,s,"beforeDraw"),s.draw(n,t),Pf(e,s,"afterDraw")):s.draw(n,t)}const Uk={class:"zoom-actions-container"},qk={class:"zoom-actions-heading"},Xk={class:"subtitle"},Gk=["aria-disabled","href"],Kk=["onClick"],Zk=h.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=yt.useI18n(),r=h.computed(()=>Tn(e.newTimeRange.start.getTime())),o=h.computed(()=>Tn(e.newTimeRange.end.getTime())),a=l=>{l.action&&(l.action(e.newTimeRange),i("onAction"))};return(l,c)=>(h.openBlock(),h.createElementBlock("div",Uk,[h.createElementVNode("div",qk,[h.createElementVNode("div",Xk,h.toDisplayString(r.value)+" - "+h.toDisplayString(o.value),1)]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(l.zoomActionItems,u=>(h.openBlock(),h.createElementBlock("div",{key:u.label,class:h.normalizeClass(["zoom-action-item",{disabled:u.disabled}])},[u.href?(h.openBlock(),h.createElementBlock("a",{key:0,"aria-disabled":u.disabled,class:"zoom-action-link",href:u.href,onClick:c[0]||(c[0]=d=>l.$emit("onAction"))},h.toDisplayString(u.label),9,Gk)):(h.openBlock(),h.createElementBlock("div",{key:1,onClick:d=>a(u)},h.toDisplayString(u.label),9,Kk))],2))),128)),h.createElementVNode("div",{class:"zoom-action-item",onClick:c[1]||(c[1]=u=>l.$emit("onAction"))},h.toDisplayString(h.unref(s).t("zoom_action_items.cancel")),1)]))}}),Pe=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},Qk=Pe(Zk,[["__scopeId","data-v-d7bfbe03"]]),Jk={class:"zoom-timerange-container"},tD={class:"zoom-timerange-heading"},eD={class:"title"},nD={class:"zoom-timerange-details"},iD=Pe(h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=h.ref(Tn(t.start.getTime())),s=h.ref(Tn(t.end.getTime())),r=(o,a)=>{ka(()=>{i.value=Tn(o.getTime()),s.value=Tn(a.getTime())},100)()};return h.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(h.openBlock(),h.createElementBlock("div",Jk,[h.createElementVNode("div",tD,[h.createElementVNode("div",eD,h.toDisplayString(h.unref(e).t("new_timerange_label")),1)]),h.createElementVNode("div",nD,h.toDisplayString(i.value)+" - "+h.toDisplayString(s.value),1)]))}}),[["__scopeId","data-v-c0aa4efd"]]),sD={key:2},rD={class:"tooltip-title"},oD={class:"title"},aD={key:0,class:"subtitle"},lD={class:"context"},cD={class:"metric"},uD={class:"tooltip"},dD={key:0},hD={class:"display-value"},fl=Pe(h.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0}},emits:["dimensions","top","left","onAction"],setup(n,{emit:t}){const e=t,i=n,s=h.ref(null),r=h.ref(!1),o=h.ref({x:0,y:0}),a=h.ref({x:0,y:0}),l=h.ref({left:i.absoluteLeft,top:i.absoluteTop}),c=h.computed(()=>i.state.tooltipContext),u=h.computed(()=>i.state.metricDisplay),d=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));h.watch(s,_=>{if(_){const{width:v,height:M}=_.getBoundingClientRect();e("dimensions",{width:v,height:M})}}),h.watch(()=>i.state.interactionMode,_=>{["interactive","zoom-interactive"].includes(_)&&(l.value.left=i.absoluteLeft,l.value.top=i.absoluteTop)});function f(_){if(s.value){r.value=!0,document.body.classList.add("no-select");const v=window.getComputedStyle(s.value),M=v.transform||v.webkitTransform||v.mozTransform,D=new DOMMatrix(M),S=D.m41,T=D.m42;o.value={x:S,y:T},a.value={x:_.clientX,y:_.clientY},window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)}}let g=null;function p(_){_.preventDefault(),_.stopPropagation(),r.value&&(g!==null&&window.cancelAnimationFrame(g),g=window.requestAnimationFrame(()=>{const v=_.clientX-a.value.x,M=_.clientY-a.value.y;l.value.left=`${o.value.x+v}px`,l.value.top=`${o.value.y+M}px`}))}function y(){r.value=!1,document.body.classList.remove("no-select"),g!==null&&window.cancelAnimationFrame(g),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)}return(_,v)=>{var M,D;return _.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:h.normalizeClass(["tooltip-container",{locked:_.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:d.value?`translate(${l.value.left}, ${l.value.top})`:`translate(${_.absoluteLeft}, ${_.absoluteTop})`,left:"0",top:"0",pointerEvents:d.value?"all":"none"}),onMousedown:f},[_.state.interactionMode==="selecting-chart-area"?(h.openBlock(),h.createBlock(iD,{key:0,end:(M=_.zoomTimeRange)==null?void 0:M.end,start:(D=_.zoomTimeRange)==null?void 0:D.start},null,8,["end","start"])):_.state.interactionMode==="zoom-interactive"&&_.zoomTimeRange&&_.zoomActionItems?(h.openBlock(),h.createBlock(Qk,{key:1,"new-time-range":_.zoomTimeRange,"zoom-action-items":_.zoomActionItems,onOnAction:v[0]||(v[0]=S=>e("onAction"))},null,8,["new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",sD,[h.createElementVNode("div",rD,[h.createElementVNode("div",oD,[h.createElementVNode("div",null,h.toDisplayString(_.tooltipTitle),1),d.value?(h.openBlock(),h.createBlock(h.unref(nc.DragIcon),{key:0,class:"drag-icon",color:h.unref(oM),size:h.unref(lM)},null,8,["color","size"])):h.createCommentVNode("",!0)]),c.value||u.value?(h.openBlock(),h.createElementBlock("div",aD,[h.createElementVNode("div",lD,h.toDisplayString(c.value),1),h.createElementVNode("div",cD,h.toDisplayString(u.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",uD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(_.state.tooltipSeries,({backgroundColor:S,borderColor:T,label:R,value:E,isSegmentEmpty:b})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:R},[_.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",dD,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:S,"border-color":T})},null,4),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:b}])},h.toDisplayString(R),3),h.createElementVNode("span",hD,h.toDisplayString(E),1)])):h.createCommentVNode("",!0)],64))),128))])]))],38)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-252c5332"]]),fD=["onClick"],gD={key:0,class:"sub-label"},pD={class:"tooltip-content"},gl=Pe(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(S=>({c25a8106:l.value}));const t=n,{i18n:e}=yt.useI18n(),i=h.ref(),s=h.ref([]),r=h.inject("showLegendValues",!0),o=h.inject("legendPosition",h.ref(Nt.Right)),a=h.ref([]),l=h.ref(Jh),c=()=>{const S=i.value;if(!S||!s.value||S.children.length===0)return 0;const T=S.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>T)return!0;return!1},u=h.computed(()=>t.items.length>2||o.value===Nt.Right),d=()=>{i.value&&o.value===Nt.Bottom&&(c()?l.value=dM:l.value=Jh)},f=()=>{if(i.value&&o.value===Nt.Bottom){let S=0;s.value.forEach(R=>{const E=Array.from(R.children).reduce((b,x)=>b+x.offsetWidth,0);E>S&&(S=E)});const T=parseInt(uM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${S+T}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let S=0;S<t.items.length;S++)if(t.items[S].text!==a.value[S].text)return a.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{g()&&f()},{immediate:!0,flush:"post"});const p=h.ref(0),y=h.ref(0),_=new ResizeObserver(ka(S=>{const T=S[0],R=T.contentRect.width,E=T.contentRect.height;R!==p.value&&E===y.value&&f(),p.value=R,y.value=E},100));h.watch(()=>o.value,()=>{f()}),h.onMounted(()=>{a.value=t.items,i.value&&_.observe(i.value),window.requestAnimationFrame(()=>{f()})}),h.onBeforeUnmount(()=>{i.value&&_.unobserve(i.value)});const v=(S=0,T)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart;M(S,T)?R.hide(S,T):R.show(S,T),R.update()},M=(S=0,T)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart,E=R.getDatasetMeta(S);return E.dataset||T===void 0?R.isDatasetVisible(S):!(E.data.length&&E.data[T].hidden)},D=S=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[S];return(S,T)=>{const R=h.resolveComponent("KTooltip");return h.unref(o)!==h.unref(Nt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:h.normalizeClass(["legend-container",D(h.unref(o))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:E,strokeStyle:b,text:x,datasetIndex:P,index:I,value:C,isSegmentEmpty:F})=>(h.openBlock(),h.createElementBlock("li",{key:x,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:q=>v(P,I)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:E,"border-color":b})},null,4),h.createVNode(R,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!M(P,I)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":u.value,empty:F}])},h.toDisplayString(x),3),C&&h.unref(r)?(h.openBlock(),h.createElementBlock("div",gD,h.toDisplayString(C.formatted),1)):h.createCommentVNode("",!0)],2)]),_:2},[F?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",pD,h.toDisplayString(h.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,fD))),128))],2)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-afbe6cec"]]);for(var ne=[],pl=0;pl<256;++pl)ne.push((pl+256).toString(16).slice(1));function mD(n,t=0){return(ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]).toLowerCase()}var Zr,yD=new Uint8Array(16);function bD(){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(yD)}var _D=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Xf={randomUUID:_D};function Qr(n,t,e){if(Xf.randomUUID&&!n)return Xf.randomUUID();n=n||{};var i=n.random||(n.rng||bD)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,mD(i)}const Gf=(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()};class Kf{constructor(){O(this,"id","highlightPlugin");O(this,"_clickedElements");O(this,"_previousHoverOption");O(this,"_clicked",!1);O(this,"_pause",!1);O(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Gf(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,Gf(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const xD=["id"],wD=["id"],vD={class:"axis-tooltip-content"},Zf=6,MD="100%",kD="100%",DD=20,SD=20,Qf=6,TD=0,CD=10,PD=10,OD=1,ED=Pe(h.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=yt.useI18n(),{translateUnit:i}=yt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new Kf,a=h.ref(null),l=h.useTemplateRef("chartParentRef"),c=({chart:z},$)=>{var tt;const Y=z.data,Q=(tt=Y.labels)==null?void 0:tt.indexOf($);return Y.datasets.reduce((et,it,nt)=>{if(z.isDatasetVisible(nt)){const _t=it.data[Q];return isNaN(_t)?et:et+_t}else return et},0)},u=(z,$,Y,Q)=>{const tt=Q==="horizontal";$===null&&($=e.t("entityNoName"));const et={type:"label",yValue:_t=>tt?$:c(_t,$),xValue:_t=>tt?c(_t,$):$},it={...et,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(mw()),content:_t=>Ca(c(_t,$),Y)},nt={...et,content:_t=>rh(c(_t,$),sh(_t.chart,z)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:_t=>tt?ih(Ca(c(_t,$),Y)):0,color:th};return{[`${$}-value`]:it,[`${$}-percent`]:nt}},d=h.ref(null),f=h.ref(),g=h.ref(Qr()),p=Qr(),y=Qr(),_=h.ref([]),v=h.ref(h.inject("legendPosition",Nt.Right)),M=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),D=h.toRef(t,"metricUnit"),S=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),T=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:S.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:E}=yt.useTooltipAbsolutePosition(l,T),b=h.ref(0),x=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce(($,Y)=>Object.assign($,u(t.chartData,Y,D.value,t.orientation)),{}))},P={id:g.value,afterUpdate(z){b.value+=1,_.value=Gd(z,t.legendValues,t.chartLegendSortFn)}},I={id:p,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?x():{}}},q=[P,{id:"axisHover",afterEvent(z,$){var Y;if(M.show=!1,$.event.type==="mousemove"){const Q=$.event,tt=z.options.indexAxis,et=z.scales,it=z.scales[tt].getLabelForValue(Number(z.scales[tt].getValueForPixel(Q[tt]))),_t=z.scales[tt].getLabels().indexOf(it),at=(Y=t.chartData.isLabelEmpty)==null?void 0:Y[_t];if((te=>te==="x"?Q.y>et.x.top:Q.x<et.y.right)(tt)){T.interactionMode!=="interactive"&&(T.showTooltip=!1);const ae=z.canvas.getContext("2d").measureText(it).width,qt=Math.abs(Math.round(Q.x-ae*.5)),Oe=Math.round(Q.x+ae*.5),Mt=z.canvas.getBoundingClientRect(),Xt=40;M.left=tt==="x"?`${(qt>0?qt:Oe)-M.offset+Mt.left}px`:`${Q.x-ae*.5-M.offset+Mt.left}px`,M.top=`${Q.y-Xt+Mt.top}px`,it.length>Er?(M.show=!0,M.text=it):at?(M.text=e.t("emptyEntityInfo"),M.show=!0):M.show=!1}else M.show=!1}}},{id:y,afterUpdate(z){z.options.layout.padding.right=S.value?H.value:0}},o,...t.annotations?[I]:[]],G=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),J=h.ref(0),U=h.ref(0),ut=new ResizeObserver(ka(z=>{J.value=z[0].contentRect.width,U.value=z[0].contentRect.height},100)),V=h.computed(()=>{var $,Y;const z=(Y=($=t.chartData)==null?void 0:$.labels)==null?void 0:Y.length;return d.value&&z&&!S.value?`${Math.max(z*(DD+Qf),J.value)}px`:MD}),K=h.computed(()=>{var $,Y;const z=(Y=($=t.chartData)==null?void 0:$.labels)==null?void 0:Y.length;return d.value&&z&&S.value?`${Math.max(z*(SD+Qf),U.value)}px`:kD});yt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Se.register(qf),a.value&&(J.value=a.value.offsetWidth,U.value=a.value.offsetHeight,ut.observe(a.value))}),h.onUnmounted(()=>{a.value&&ut.unobserve(a.value)});const B=h.computed(()=>{const z=yt.useBarChartOptions({tooltipState:T,legendID:g.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:S.value?"y":"x",numLabels:G});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:x(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Zf}}}}),j=yt.useChartJSCommon("bar",d,h.toRef(t,"chartData"),q,B),H=h.computed(()=>{b.value;const z=t.chartData.labels,$=t.chartData.datasets,Y=z.map((et,it)=>$.reduce((nt,_t)=>isNaN(Number(_t.data[it]))?nt:nt+Number(_t.data[it]),0)),Q=j.value?sh(j.value,t.chartData):yw(t.chartData);return Y.map(et=>ih(Ca(et,D.value)+rh(et,Q))).reduce((et,it)=>Math.max(et,it),0)+Zf});h.onBeforeUnmount(()=>{Se.unregister(qf)});const xt={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},mt=h.computed(()=>{if(f.value&&j.value){const z=window.devicePixelRatio,$=j.value,Y=$.scales.y.width*z+OD,Q=($.scales.y.height+$.scales.y.top+$.scales.x.height)*z,tt=f.value.getContext("2d");return tt.scale(z,z),tt.canvas.width=Y,tt.canvas.height=Q,tt.canvas.style.width=`${Y/z}px`,tt.canvas.style.height=`${Q/z}px`,{scale:z,width:Y*z,height:Q*z,targetCtx:tt}}return null}),vt=z=>{const $=z.target;if(mt.value&&j.value&&!S.value){const Y=mt.value.scale,Q=mt.value.targetCtx,tt=mt.value.width,et=mt.value.height,it=j.value,nt=it.canvas;Q.fillStyle="white",$.scrollLeft>=TD&&$.scrollLeft<=CD?(Q.globalCompositeOperation="source-over",Q.clearRect(0,0,tt,et),Q.drawImage(nt,0,0,tt,et,0,0,tt,et),Q.globalCompositeOperation="destination-over",Q.fillRect(0,0,tt,et)):(Q.globalCompositeOperation="source-over",Q.fillRect(0,(it.scales.y.height+it.scales.y.top+PD)*Y,tt,it.scales.x.height*Y))}T.offsetY=$.scrollTop,T.offsetX=$.scrollLeft,M.offset=$.scrollLeft},ft=({width:z,height:$})=>{T.width=z,T.height=$};h.watch(()=>t.orientation,()=>{var z;if(f.value&&mt.value){const $=mt.value.width,Y=mt.value.height;((z=f.value)==null?void 0:z.getContext("2d")).clearRect(0,0,$,Y)}T.showTooltip=!1,T.interactionMode="idle"}),h.watch(()=>t.annotations,z=>{j.value&&(z?j.value.options.plugins.annotation.annotations=x(t.chartData):delete j.value.options.plugins.annotation.annotations)});const gt=()=>{T.showTooltip&&(T.interactionMode!=="idle"?T.interactionMode="idle":T.interactionMode="interactive")};return(z,$)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:l,class:h.normalizeClass(["chart-parent",xt[v.value]])},[h.createElementVNode("canvas",{id:h.unref(s),ref_key:"axis",ref:f,class:"axis"},null,8,xD),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:a,class:"chart-container","on:scroll":vt,onClick:$[0]||($[0]=Y=>gt())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:V.value,height:K.value})},[h.createElementVNode("canvas",{id:h.unref(r),ref_key:"canvas",ref:d,class:"chart-canvas"},null,8,wD)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[M.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:M.top,left:M.left}),width:"auto"},[h.createElementVNode("div",vD,h.toDisplayString(M.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(fl,{"absolute-left":h.unref(R),"absolute-top":h.unref(E),state:T,"tooltip-title":z.tooltipTitle,onDimensions:ft},null,8,["absolute-left","absolute-top","state","tooltip-title"])])),h.createVNode(gl,{id:g.value,"chart-instance":h.unref(j),items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-13a1a6c4"]]);/*!
23
+ */const ef={modes:{point(n,t){return Yr(n,t,{intersect:!0})},nearest(n,t,e){return wM(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(ef.modes[e.mode]||ef.modes.nearest)(n,t,e)}function _M(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 xM(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):_M(i,t,e.axis))}function wM(n,t,e){let i=Number.POSITIVE_INFINITY;return Yr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=xM(t,o,e.axis),l=di(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 Zn(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 vM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Qn=.001,jr=(n,t,e)=>Math.min(e,Math.max(t,n)),nf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function MM(n,t,e){for(const i of Object.keys(n))n[i]=jr(n[i],t,e);return n}function kM(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 sf(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-Qn&&n.x<=i+l+Qn,u=n.y>=e-l-Qn&&n.y<=s+l+Qn;return r==="x"?c:(r==="y"||c)&&u}function rf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Zn(n,e,Vt(-s));return sf(a,t,i,{borderWidth:r,hitTolerance:o})}function Jn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function DM(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(vM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const of=n=>typeof n=="string"&&n.endsWith("%"),af=n=>parseFloat(n)/100,lf=n=>jr(af(n),0,1),Ts=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),SM={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:of(t)?lf(t)*n:n/2}function Cn(n,t,e=!0){return typeof t=="number"?t:of(t)?(e?lf(t):af(t))*n:n}function TM(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 cf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=ht(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=Ja(i),d=ff(n.x,l,s,u.x),f=ff(n.y,c,r,u.y);return{x:d,y:f,x2:d+l,y2:f+c,width:l,height:c,centerX:d+l/2,centerY:f+c/2}}function Ja(n,t="center"){return ht(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}const uf=(n,t)=>n&&n.autoFit&&t<1;function df(n,t){const e=n.font,i=kt(e)?e:[e];return uf(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function hf(n){return n&&(ge(n.xValue)||ge(n.yValue))}function ff(n,t,e=0,i){return n-Qa(t,i)+e}function Di(n,t,e){const i=e.init;if(i){if(i===!0)return pf(t,e)}else return;return CM(n,t,e)}function gf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function pf(n,t){const e=t.type||"line";return SM[e](n)}function CM(n,t,e){const i=Dt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return pf(t,e);if(ht(i))return i}const tl=new Map,PM=n=>isNaN(n)||n<=0,OM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function $r(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Vr(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Vt(i)),n.translate(-t,-e))}function on(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($r(e))return{width:Cn(e.width,t.width),height:Cn(e.height,t.height)};const i=df(t),s=t.textStrokeWidth,r=kt(e)?e:[e],o=r.join()+OM(i)+s+(n._measureText?"-spriting":"");return tl.has(o)||tl.set(o,IM(n,r,i,s)),tl.get(o)}function mf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Si(n,e);const a=on(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),hi(n,{x:i,y:s,w:r,h:o,radius:MM(xn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function yf(n,t,e,i){const s=e.content;if($r(s)){n.save(),n.globalAlpha=FM(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=kt(s)?s:[s],o=df(e,i),a=e.color,l=kt(a)?a:[a],c=TM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,EM(n,e)&&LM(n,{x:c,y:u},r,o),NM(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function EM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function AM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Mo;if($r(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}PM(s)||RM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function RM(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,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Ks,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Ks,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+De)*c,l=Math.sin(o+De)*c,n.arc(t-a,e-l,u,o-ct,o-Et),n.arc(t+l,e-a,u,o-Et,o),n.arc(t+a,e+l,u,o,o+Et),n.arc(t-l,e+a,u,o+Et,o+ct),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=De;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+=De;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+=De,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 IM(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 LM(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 NM(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 FM(n,t){const e=_n(n)?n:t;return _n(e)?jr(e,0,1):1}const bf=["left","bottom","top","right"];function zM(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&jM(t,r);if(!o||VM(t,r,o))return;if(n.save(),n.beginPath(),!on(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=BM(t,o),{sideStart:u,sideEnd:d}=WM(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 f=Zn({x:e,y:i},t.getCenterPoint(),Vt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function BM(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=HM(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 HM(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 WM(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=YM(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Cn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Cn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function YM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function jM(n,t){const e=t.position;return bf.includes(e)?e:$M(n,t)}function $M(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,y=Cn(o,p),_=Cn(a,p),v=[e,e+y,e+y,s],M=[i+_,r,i,r],D=[];for(let S=0;S<4;S++){const T=Zn({x:v[S],y:M[S]},g,Vt(f));D.push({position:bf[S],distance:di(T,{x:l,y:c})})}return D.sort((S,T)=>S.distance-T.distance)[0].position}function VM(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 _f={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 Ti(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ti(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 xf(n,t){if(n){const e=n.options.reverse,i=Ti(n,t.min,e?t.end:t.start),s=Ti(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function wf(n,t){const{chartArea:e,scales:i}=n,s=i[ti(i,t,"xScaleID")],r=i[ti(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Ti(s,t.xValue,s.left+s.width/2)),r&&(a=Ti(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function el(n,t){const e=n.scales,i=e[ti(e,t,"xScaleID")],s=e[ti(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=kf(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=kf(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 vf(n,t){if(!hf(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 qM(n,t)}function UM(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?XM(s,r,t):GM(e,r,t),r}function Mf(n,t){const e=el(n,t);return e.initProperties=Di(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:QM(n,e,t),initProperties:e.initProperties}],e}function qM(n,t){const e=wf(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 kf(n,t){const e=xf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function XM(n,t,e){const i=Ti(n,e.value,NaN),s=Ti(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function GM(n,t,e){for(const i of Object.keys(_f)){const s=n[ti(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=_f[i],d=xf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function KM({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Df({start:r,end:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function ZM({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return Df({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Df(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 QM(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=Ja(i.position),r=Ut(i.padding),o=Ur(n.ctx,i),a=KM({properties:t,options:e},o,s,r),l=ZM({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 JM(n,t,e){t.listened=gf(e,il,t.listeners),t.moveListened=!1,nl.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||nl.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function tk(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ek(n,t,e);case"click":return nk(n,t,e)}}function ek(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=Sf(r,"leave",s,i);return Sf(r,"enter",i,s)||o}function Sf({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=Tf(o.options[e]||n.listeners[e],o,t)||r);return r}function nk(n,t,e){const i=n.listeners,s=Za(n.visibleElements,t,e.interaction);let r;for(const o of s)r=Tf(o.options.click||i.click,o,t)||r;return r}function Tf(n,t,e){return Dt(n,[t.$context,e])===!0}const qr=["afterDraw","beforeDraw"];function ik(n,t,e){const i=t.visibleElements;t.hooked=gf(e,qr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||qr.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function Cf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Dt(i,[t.$context])}}function sk(n,t,e){const i=ck(n.scales,t,e);let s=Pf(t,i,"min","suggestedMin");s=Pf(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function rk(n,t){for(const e of n)ak(e,t)}function Pf(n,t,e,i){if(Rt(t[e])&&!ok(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function ok(n,t,e){return ge(n[t])||ge(n[e])}function ak(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ti(t,n,e);i&&!t[i]&&lk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function lk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function ck(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Of(a,t,["value","endValue"],o):ti(n,a,r)===s&&Of(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Of(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Ci extends Jt{inRange(t,e,i,s){const{x:r,y:o}=Zn({x:t,y:e},this.getCenterPoint(s),Vt(-this.options.rotation));return sf({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Jn(this,t)}draw(t){t.save(),Vr(t,this.getCenterPoint(),this.options.rotation),mf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Mf(t,e)}}Ci.id="boxAnnotation",Ci.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},Ci.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ci.descriptors={label:{_fallback:!0}};class Xr extends Jt{inRange(t,e,i,s){return rf({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 Jn(this,t)}draw(t){const e=this.options;!e.display||!e.content||(pk(t,this),t.save(),Vr(t,this.getCenterPoint(),this.rotation),yf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=uk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=hk(t,e,i);let a=Ur(t.ctx,e);const l=fk(a,o);uf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,f=cf(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Di(t,f,e),...f,...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 uk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof en&&dk(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function dk(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 hk({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,f={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:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,_=g.y>d,v=_?s+p:o-p,M=gk(v,u,d,y);return{controllerMeta:{_centerX:u,_centerY:d,_radius:y,_counterclockwise:_,...M},point:g,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function fk({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function gk(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:Ot};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:Qs({x:t,y:e},{x:c,y:n}).angle,_endAngle:Qs({x:t,y:e},{x:u,y:n}).angle}}function pk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=on(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 Jt{inRange(t,e,i,s){return rf({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 Jn(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Vr(t,this.getCenterPoint(),this.rotation),zM(t,this),mf(t,this,e),yf(t,mk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(hf(e))i=wf(t,e);else{const{centerX:a,centerY:l}=el(t,e);i={x:a,y:l}}const s=Ut(e.padding),r=Ur(t.ctx,e),o=cf(i,r,e,s);return{initProperties:Di(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 mk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Ut(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,Ef=(n,t,e)=>sl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Ps=n=>n*n,yk=(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},Af=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ol=(n,t,e,i)=>({x:Af(n.x,t.x,e.x,i),y:Af(n.y,t.y,e.y,i)}),Rf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),If=(n,t,e,i)=>-Math.atan2(Rf(n.x,t.x,e.x,i),Rf(n.y,t.y,e.y,i))+.5*ct;class Os extends Jt{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){on(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,f)||al(this,o,s);return l.restore(),g}const c=Ps(r);return wk(this,o,c,s)||al(this,o,s)}return bk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return Jn(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!on(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 Pk(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Bf(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-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),ll(t,0,d,c),ll(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=UM(t,e),{x:s,y:r,x2:o,y2:a}=i,l=_k(i,t.chartArea),c=l?xk({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=Di(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Ck(c,e,di(d,f))}const u=vk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Os.id="lineAnnotation";const Lf={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};Os.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Lf),fill:!1,length:12,start:Object.assign({},Lf),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},Os.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Os.defaultRoutes={borderColor:"color"};function bk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=yk(t,e,n.getProps(["x","y","x2","y2"],r),i);return nf(o,s)||al(n,{mouseX:t,mouseY:e},r,i)}function _k({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 Nf({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Ef(o,{x:n,y:t},e),n=o),n>s&&(t=Ef(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 xk(n,t,e){const{x:i,y:s}=Nf(n,t,e),{x:r,y:o}=Nf(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function wk(n,{mouseX:t,mouseY:e},i=Qn,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Ps(c)+Ps(u),f=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return f<0?(g=r,p=o):f>1?(g=a,p=l):(g=r+f*c,p=o+f*u),Ps(t-g)+Ps(e-p)<=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 vk(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=Ur(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return kk(t,e,{width:o,height:a,padding:s},n.chartArea)}function Mk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ct/2?r-ct:r<ct/-2?r+ct:r}function kk(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"?Mk(n):Vt(t.rotation),f=Dk(s,r,d),g=Sk(n,t,{labelSize:f,padding:o},i),p=n.cp?ol(c,n.cp,u,g):sl(c,u,g),y={size:f.w,min:i.left,max:i.right,padding:o.left},_={size:f.h,min:i.top,max:i.bottom,padding:o.top},v=zf(p.x,y)+a,M=zf(p.y,_)+l;return{x:v-s/2,y:M-r/2,x2:v+s/2,y2:M+r/2,centerX:v,centerY:M,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Zs(d)}}function Dk(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 Sk(n,t,e,i){let s;const r=Tk(n,i);return t.position==="start"?s=Ff({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Ff({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Qa(1,t.position),s}function Ff(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 Tk(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 zf(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 Bf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Hf(n,e),endAdjust:Hf(n,i)}}function Hf(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),on(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 Ck(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+Cn(e,u.x,!1),y:l+Cn(e,u.y,!1)};return Zn(d,{x:a,y:l},c)}function Wf(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 Pk(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Bf(t),g={x:s,y:r},p={x:o,y:a},y=If(g,e,p,0),_=If(g,e,p,1)-ct,v=ol(g,e,p,d/i),M=ol(g,e,p,1-f/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,M.x,M.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Wf(n,v,{angle:y,adjust:d},c),Wf(n,M,{angle:_,adjust:f},u)}class Es extends Jt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Ok({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},f=Zn({x:t,y:e},this.getCenterPoint(s),Vt(-r));return f[i]>=d.start-o-Qn&&f[i]<=d.end+o+Qn}getCenterPoint(t){return Jn(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Vr(t,this.getCenterPoint(),o.rotation),Si(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=on(t,o);t.ellipse(s,r,i/2,e/2,ct/2,0,2*ct),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({},Ci.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 Ok(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=Vt(e||0),d=Math.cos(u),f=Math.sin(u),g=Math.pow(d*(n.x-o)+f*(n.y-a),2),p=Math.pow(f*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Gr extends Jt{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"?kM({x:t,y:e},this.getCenterPoint(s),c/2,u):nf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return Jn(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=on(t,e);AM(t,this,this.centerX,this.centerY),s&&!$r(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=vf(t,e);return i.initProperties=Di(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 Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Ak(this.elements,t,e,s);const r=Zn({x:t,y:e},this.getCenterPoint(s),Vt(-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 Jn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Si(t,i);const s=on(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=vf(t,e),{sides:s,rotation:r}=e,o=[],a=2*ct/s;let l=r*Mo;for(let c=0;c<s;c++,l+=a){const u=Ek(i,e,l);u.initProperties=Di(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 Ek({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 Ak(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 Pn={box:Ci,doughnutLabel:Xr,ellipse:Es,label:Cs,line:Os,point:Gr,polygon:Kr};Object.keys(Pn).forEach(n=>{At.describe(`elements.${Pn[n].id}`,{_fallback:"plugins.annotation.common"})});const Rk={update:Object.assign},Ik=il.concat(qr),Yf=(n,t)=>ht(t)?dl(n,t):n,cl=n=>n==="color"||n==="font";function ul(n="line"){return Pn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Lk(n,t,e,i){const s=Fk(n,e.animations,i),r=t.annotations,o=Hk(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=jf(o,a,l.type),u=l.setContext(Bk(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=Nk(d),"elements"in d&&(zk(c,d.elements,u,s),delete d.elements),ge(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=$f(u),s.update(c,d)}}function Nk(n){return isNaN(n.x)||isNaN(n.y)}function Fk(n,t,e){return e==="reset"||e==="none"||e==="resize"?Rk:new Fo(n,t)}function zk(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=jf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=$f(c),i.update(l,a)}}function jf(n,t,e,i){const s=Pn[ul(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function $f(n){const t=Pn[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 Ik)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)&&kt(r)?e[i]=r.map(o=>Yf(o,s)):e[i]=Yf(r,s)}return e}function Bk(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 Hk(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 Wk="3.1.0";const On=new Map,Vf=n=>n.type!=="doughnutLabel",Yk=il.concat(qr);var Uf={id:"annotation",version:Wk,beforeRegister(){DM("chart.js","4.0",Se.version)},afterRegister(){Se.register(Pn)},afterUnregister(){Se.unregister(Pn)},beforeInit(n){On.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=On.get(n),s=i.annotations=[];let r=e.annotations;ht(r)?Object.keys(r).forEach(o=>{const a=r[o];ht(a)&&(a.id=o,s.push(a))}):kt(r)&&s.push(...r),rk(s.filter(Vf),n.scales)},afterDataLimits(n,t){const e=On.get(n);sk(n,t.scale,e.annotations.filter(Vf).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=On.get(n);JM(n,i,e),Lk(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),ik(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=On.get(n);tk(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){On.delete(n)},getAnnotations(n){const t=On.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=>!Yk.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Pn[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=On.get(n);e&&Gi(i,s);const o=jk(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)$k(i,s,r,a);e&&Ki(i)}function jk(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 $k(n,t,e,i){const s=i.element;i.main?(Cf(e,s,"beforeDraw"),s.draw(n,t),Cf(e,s,"afterDraw")):s.draw(n,t)}const Vk={class:"zoom-actions-container"},Uk={class:"zoom-actions-heading"},qk={class:"subtitle"},Xk=["aria-disabled","href"],Gk=["onClick"],Kk=h.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=yt.useI18n(),r=h.computed(()=>Tn(e.newTimeRange.start.getTime())),o=h.computed(()=>Tn(e.newTimeRange.end.getTime())),a=l=>{l.action&&(l.action(e.newTimeRange),i("onAction"))};return(l,c)=>(h.openBlock(),h.createElementBlock("div",Vk,[h.createElementVNode("div",Uk,[h.createElementVNode("div",qk,h.toDisplayString(r.value)+" - "+h.toDisplayString(o.value),1)]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(l.zoomActionItems,u=>(h.openBlock(),h.createElementBlock("div",{key:u.label,class:h.normalizeClass(["zoom-action-item",{disabled:u.disabled}])},[u.href?(h.openBlock(),h.createElementBlock("a",{key:0,"aria-disabled":u.disabled,class:"zoom-action-link",href:u.href,onClick:c[0]||(c[0]=d=>l.$emit("onAction"))},h.toDisplayString(u.label),9,Xk)):(h.openBlock(),h.createElementBlock("div",{key:1,onClick:d=>a(u)},h.toDisplayString(u.label),9,Gk))],2))),128)),h.createElementVNode("div",{class:"zoom-action-item",onClick:c[1]||(c[1]=u=>l.$emit("onAction"))},h.toDisplayString(h.unref(s).t("zoom_action_items.cancel")),1)]))}}),Pe=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},Zk=Pe(Kk,[["__scopeId","data-v-d7bfbe03"]]),Qk={class:"zoom-timerange-container"},Jk={class:"zoom-timerange-heading"},tD={class:"title"},eD={class:"zoom-timerange-details"},nD=Pe(h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=h.ref(Tn(t.start.getTime())),s=h.ref(Tn(t.end.getTime())),r=(o,a)=>{Ma(()=>{i.value=Tn(o.getTime()),s.value=Tn(a.getTime())},100)()};return h.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(h.openBlock(),h.createElementBlock("div",Qk,[h.createElementVNode("div",Jk,[h.createElementVNode("div",tD,h.toDisplayString(h.unref(e).t("new_timerange_label")),1)]),h.createElementVNode("div",eD,h.toDisplayString(i.value)+" - "+h.toDisplayString(s.value),1)]))}}),[["__scopeId","data-v-c0aa4efd"]]),iD={key:2},sD={class:"tooltip-title"},rD={class:"title"},oD={key:0,class:"subtitle"},aD={class:"context"},lD={class:"metric"},cD={class:"tooltip"},uD={key:0},dD={class:"display-value"},hl=Pe(h.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0}},emits:["dimensions","top","left","onAction"],setup(n,{emit:t}){const e=t,i=n,s=h.ref(null),r=h.ref(!1),o=h.ref({x:0,y:0}),a=h.ref({x:0,y:0}),l=h.ref({left:i.absoluteLeft,top:i.absoluteTop}),c=h.computed(()=>i.state.tooltipContext),u=h.computed(()=>i.state.metricDisplay),d=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));h.watch(s,_=>{if(_){const{width:v,height:M}=_.getBoundingClientRect();e("dimensions",{width:v,height:M})}}),h.watch(()=>i.state.interactionMode,_=>{["interactive","zoom-interactive"].includes(_)&&(l.value.left=i.absoluteLeft,l.value.top=i.absoluteTop)});function f(_){if(s.value){r.value=!0,document.body.classList.add("no-select");const v=window.getComputedStyle(s.value),M=v.transform||v.webkitTransform||v.mozTransform,D=new DOMMatrix(M),S=D.m41,T=D.m42;o.value={x:S,y:T},a.value={x:_.clientX,y:_.clientY},window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)}}let g=null;function p(_){_.preventDefault(),_.stopPropagation(),r.value&&(g!==null&&window.cancelAnimationFrame(g),g=window.requestAnimationFrame(()=>{const v=_.clientX-a.value.x,M=_.clientY-a.value.y;l.value.left=`${o.value.x+v}px`,l.value.top=`${o.value.y+M}px`}))}function y(){r.value=!1,document.body.classList.remove("no-select"),g!==null&&window.cancelAnimationFrame(g),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)}return(_,v)=>{var M,D;return _.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:h.normalizeClass(["tooltip-container",{locked:_.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:d.value?`translate(${l.value.left}, ${l.value.top})`:`translate(${_.absoluteLeft}, ${_.absoluteTop})`,left:"0",top:"0",pointerEvents:d.value?"all":"none"}),onMousedown:f},[_.state.interactionMode==="selecting-chart-area"?(h.openBlock(),h.createBlock(nD,{key:0,end:(M=_.zoomTimeRange)==null?void 0:M.end,start:(D=_.zoomTimeRange)==null?void 0:D.start},null,8,["end","start"])):_.state.interactionMode==="zoom-interactive"&&_.zoomTimeRange&&_.zoomActionItems?(h.openBlock(),h.createBlock(Zk,{key:1,"new-time-range":_.zoomTimeRange,"zoom-action-items":_.zoomActionItems,onOnAction:v[0]||(v[0]=S=>e("onAction"))},null,8,["new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",iD,[h.createElementVNode("div",sD,[h.createElementVNode("div",rD,[h.createElementVNode("div",null,h.toDisplayString(_.tooltipTitle),1),d.value?(h.openBlock(),h.createBlock(h.unref(ec.DragIcon),{key:0,class:"drag-icon",color:h.unref(rM),size:h.unref(aM)},null,8,["color","size"])):h.createCommentVNode("",!0)]),c.value||u.value?(h.openBlock(),h.createElementBlock("div",oD,[h.createElementVNode("div",aD,h.toDisplayString(c.value),1),h.createElementVNode("div",lD,h.toDisplayString(u.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",cD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(_.state.tooltipSeries,({backgroundColor:S,borderColor:T,label:R,value:E,isSegmentEmpty:b})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:R},[_.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",uD,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:S,"border-color":T})},null,4),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:b}])},h.toDisplayString(R),3),h.createElementVNode("span",dD,h.toDisplayString(E),1)])):h.createCommentVNode("",!0)],64))),128))])]))],38)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-252c5332"]]),hD=["onClick"],fD={key:0,class:"sub-label"},gD={class:"tooltip-content"},fl=Pe(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(S=>({c25a8106:l.value}));const t=n,{i18n:e}=yt.useI18n(),i=h.ref(),s=h.ref([]),r=h.inject("showLegendValues",!0),o=h.inject("legendPosition",h.ref(Nt.Right)),a=h.ref([]),l=h.ref(Qh),c=()=>{const S=i.value;if(!S||!s.value||S.children.length===0)return 0;const T=S.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>T)return!0;return!1},u=h.computed(()=>t.items.length>2||o.value===Nt.Right),d=()=>{i.value&&o.value===Nt.Bottom&&(c()?l.value=uM:l.value=Qh)},f=()=>{if(i.value&&o.value===Nt.Bottom){let S=0;s.value.forEach(R=>{const E=Array.from(R.children).reduce((b,x)=>b+x.offsetWidth,0);E>S&&(S=E)});const T=parseInt(cM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${S+T}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let S=0;S<t.items.length;S++)if(t.items[S].text!==a.value[S].text)return a.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{g()&&f()},{immediate:!0,flush:"post"});const p=h.ref(0),y=h.ref(0),_=new ResizeObserver(Ma(S=>{const T=S[0],R=T.contentRect.width,E=T.contentRect.height;R!==p.value&&E===y.value&&f(),p.value=R,y.value=E},100));h.watch(()=>o.value,()=>{f()}),h.onMounted(()=>{a.value=t.items,i.value&&_.observe(i.value),window.requestAnimationFrame(()=>{f()})}),h.onBeforeUnmount(()=>{i.value&&_.unobserve(i.value)});const v=(S=0,T)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart;M(S,T)?R.hide(S,T):R.show(S,T),R.update()},M=(S=0,T)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart,E=R.getDatasetMeta(S);return E.dataset||T===void 0?R.isDatasetVisible(S):!(E.data.length&&E.data[T].hidden)},D=S=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[S];return(S,T)=>{const R=h.resolveComponent("KTooltip");return h.unref(o)!==h.unref(Nt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:h.normalizeClass(["legend-container",D(h.unref(o))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:E,strokeStyle:b,text:x,datasetIndex:P,index:I,value:C,isSegmentEmpty:F})=>(h.openBlock(),h.createElementBlock("li",{key:x,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:q=>v(P,I)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:E,"border-color":b})},null,4),h.createVNode(R,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!M(P,I)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":u.value,empty:F}])},h.toDisplayString(x),3),C&&h.unref(r)?(h.openBlock(),h.createElementBlock("div",fD,h.toDisplayString(C.formatted),1)):h.createCommentVNode("",!0)],2)]),_:2},[F?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",gD,h.toDisplayString(h.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,hD))),128))],2)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-afbe6cec"]]),ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function pD(n,t=0){return(ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]).toLowerCase()}let gl;const mD=new Uint8Array(16);function yD(){if(!gl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");gl=crypto.getRandomValues.bind(crypto)}return gl(mD)}const qf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Zr(n,t,e){var s;if(qf.randomUUID&&!n)return qf.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??yD();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,pD(i)}const Xf=(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()};class Gf{constructor(){O(this,"id","highlightPlugin");O(this,"_clickedElements");O(this,"_previousHoverOption");O(this,"_clicked",!1);O(this,"_pause",!1);O(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Xf(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,Xf(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const bD=["id"],_D=["id"],xD={class:"axis-tooltip-content"},Kf=6,wD="100%",vD="100%",MD=20,kD=20,Zf=6,DD=0,SD=10,TD=10,CD=1,PD=Pe(h.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=yt.useI18n(),{translateUnit:i}=yt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new Gf,a=h.ref(null),l=h.useTemplateRef("chartParentRef"),c=({chart:z},$)=>{var tt;const Y=z.data,Q=(tt=Y.labels)==null?void 0:tt.indexOf($);return Y.datasets.reduce((et,it,nt)=>{if(z.isDatasetVisible(nt)){const _t=it.data[Q];return isNaN(_t)?et:et+_t}else return et},0)},u=(z,$,Y,Q)=>{const tt=Q==="horizontal";$===null&&($=e.t("entityNoName"));const et={type:"label",yValue:_t=>tt?$:c(_t,$),xValue:_t=>tt?c(_t,$):$},it={...et,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(pw()),content:_t=>Ta(c(_t,$),Y)},nt={...et,content:_t=>sh(c(_t,$),ih(_t.chart,z)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:_t=>tt?nh(Ta(c(_t,$),Y)):0,color:Jd};return{[`${$}-value`]:it,[`${$}-percent`]:nt}},d=h.ref(null),f=h.ref(),g=h.ref(Zr()),p=Zr(),y=Zr(),_=h.ref([]),v=h.ref(h.inject("legendPosition",Nt.Right)),M=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),D=h.toRef(t,"metricUnit"),S=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),T=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:S.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:E}=yt.useTooltipAbsolutePosition(l,T),b=h.ref(0),x=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce(($,Y)=>Object.assign($,u(t.chartData,Y,D.value,t.orientation)),{}))},P={id:g.value,afterUpdate(z){b.value+=1,_.value=Xd(z,t.legendValues,t.chartLegendSortFn)}},I={id:p,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?x():{}}},q=[P,{id:"axisHover",afterEvent(z,$){var Y;if(M.show=!1,$.event.type==="mousemove"){const Q=$.event,tt=z.options.indexAxis,et=z.scales,it=z.scales[tt].getLabelForValue(Number(z.scales[tt].getValueForPixel(Q[tt]))),_t=z.scales[tt].getLabels().indexOf(it),at=(Y=t.chartData.isLabelEmpty)==null?void 0:Y[_t];if((te=>te==="x"?Q.y>et.x.top:Q.x<et.y.right)(tt)){T.interactionMode!=="interactive"&&(T.showTooltip=!1);const ae=z.canvas.getContext("2d").measureText(it).width,qt=Math.abs(Math.round(Q.x-ae*.5)),Oe=Math.round(Q.x+ae*.5),Mt=z.canvas.getBoundingClientRect(),Xt=40;M.left=tt==="x"?`${(qt>0?qt:Oe)-M.offset+Mt.left}px`:`${Q.x-ae*.5-M.offset+Mt.left}px`,M.top=`${Q.y-Xt+Mt.top}px`,it.length>Er?(M.show=!0,M.text=it):at?(M.text=e.t("emptyEntityInfo"),M.show=!0):M.show=!1}else M.show=!1}}},{id:y,afterUpdate(z){z.options.layout.padding.right=S.value?H.value:0}},o,...t.annotations?[I]:[]],G=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),J=h.ref(0),U=h.ref(0),ut=new ResizeObserver(Ma(z=>{J.value=z[0].contentRect.width,U.value=z[0].contentRect.height},100)),V=h.computed(()=>{var $,Y;const z=(Y=($=t.chartData)==null?void 0:$.labels)==null?void 0:Y.length;return d.value&&z&&!S.value?`${Math.max(z*(MD+Zf),J.value)}px`:wD}),K=h.computed(()=>{var $,Y;const z=(Y=($=t.chartData)==null?void 0:$.labels)==null?void 0:Y.length;return d.value&&z&&S.value?`${Math.max(z*(kD+Zf),U.value)}px`:vD});yt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Se.register(Uf),a.value&&(J.value=a.value.offsetWidth,U.value=a.value.offsetHeight,ut.observe(a.value))}),h.onUnmounted(()=>{a.value&&ut.unobserve(a.value)});const B=h.computed(()=>{const z=yt.useBarChartOptions({tooltipState:T,legendID:g.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:S.value?"y":"x",numLabels:G});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:x(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Kf}}}}),j=yt.useChartJSCommon("bar",d,h.toRef(t,"chartData"),q,B),H=h.computed(()=>{b.value;const z=t.chartData.labels,$=t.chartData.datasets,Y=z.map((et,it)=>$.reduce((nt,_t)=>isNaN(Number(_t.data[it]))?nt:nt+Number(_t.data[it]),0)),Q=j.value?ih(j.value,t.chartData):mw(t.chartData);return Y.map(et=>nh(Ta(et,D.value)+sh(et,Q))).reduce((et,it)=>Math.max(et,it),0)+Kf});h.onBeforeUnmount(()=>{Se.unregister(Uf)});const xt={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},mt=h.computed(()=>{if(f.value&&j.value){const z=window.devicePixelRatio,$=j.value,Y=$.scales.y.width*z+CD,Q=($.scales.y.height+$.scales.y.top+$.scales.x.height)*z,tt=f.value.getContext("2d");return tt.scale(z,z),tt.canvas.width=Y,tt.canvas.height=Q,tt.canvas.style.width=`${Y/z}px`,tt.canvas.style.height=`${Q/z}px`,{scale:z,width:Y*z,height:Q*z,targetCtx:tt}}return null}),vt=z=>{const $=z.target;if(mt.value&&j.value&&!S.value){const Y=mt.value.scale,Q=mt.value.targetCtx,tt=mt.value.width,et=mt.value.height,it=j.value,nt=it.canvas;Q.fillStyle="white",$.scrollLeft>=DD&&$.scrollLeft<=SD?(Q.globalCompositeOperation="source-over",Q.clearRect(0,0,tt,et),Q.drawImage(nt,0,0,tt,et,0,0,tt,et),Q.globalCompositeOperation="destination-over",Q.fillRect(0,0,tt,et)):(Q.globalCompositeOperation="source-over",Q.fillRect(0,(it.scales.y.height+it.scales.y.top+TD)*Y,tt,it.scales.x.height*Y))}T.offsetY=$.scrollTop,T.offsetX=$.scrollLeft,M.offset=$.scrollLeft},ft=({width:z,height:$})=>{T.width=z,T.height=$};h.watch(()=>t.orientation,()=>{var z;if(f.value&&mt.value){const $=mt.value.width,Y=mt.value.height;((z=f.value)==null?void 0:z.getContext("2d")).clearRect(0,0,$,Y)}T.showTooltip=!1,T.interactionMode="idle"}),h.watch(()=>t.annotations,z=>{j.value&&(z?j.value.options.plugins.annotation.annotations=x(t.chartData):delete j.value.options.plugins.annotation.annotations)});const gt=()=>{T.showTooltip&&(T.interactionMode!=="idle"?T.interactionMode="idle":T.interactionMode="interactive")};return(z,$)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:l,class:h.normalizeClass(["chart-parent",xt[v.value]])},[h.createElementVNode("canvas",{id:h.unref(s),ref_key:"axis",ref:f,class:"axis"},null,8,bD),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:a,class:"chart-container","on:scroll":vt,onClick:$[0]||($[0]=Y=>gt())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:V.value,height:K.value})},[h.createElementVNode("canvas",{id:h.unref(r),ref_key:"canvas",ref:d,class:"chart-canvas"},null,8,_D)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[M.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:M.top,left:M.left}),width:"auto"},[h.createElementVNode("div",xD,h.toDisplayString(M.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(hl,{"absolute-left":h.unref(R),"absolute-top":h.unref(E),state:T,"tooltip-title":z.tooltipTitle,onDimensions:ft},null,8,["absolute-left","absolute-top","state","tooltip-title"])])),h.createVNode(fl,{id:g.value,"chart-instance":h.unref(j),items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-13a1a6c4"]]);/*!
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 AD={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"};lu._date.override({_id:"date-fns",formats:function(){return AD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=lt(n):e==="string"&&(typeof t=="string"?n=Ax(n,t,new Date,this.options):n=Ud(n,this.options)),ga(n)?n.getTime():null},format:function(n,t){return Hd(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ha(n,t);case"second":return T0(n,t);case"minute":return D0(n,t);case"hour":return v0(n,t);case"day":return Sr(n,t);case"week":return C0(n,t);case"month":return da(n,t);case"quarter":return S0(n,t);case"year":return P0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return pa(n,t);case"second":return F0(n,t);case"minute":return I0(n,t);case"hour":return R0(n,t);case"day":return kd(n,t);case"week":return z0(n,t);case"month":return Cd(n,t);case"quarter":return N0(n,t);case"year":return B0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Nx(n);case"minute":return Lx(n);case"hour":return Ix(n);case"day":return fa(n);case"week":return $e(n);case"isoWeek":return $e(n,{weekStartsOn:+e});case"month":return W0(n);case"quarter":return H0(n);case"year":return Pd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return q0(n);case"minute":return V0(n);case"hour":return j0(n);case"day":return Sd(n);case"week":return $0(n);case"month":return Td(n);case"quarter":return U0(n);case"year":return Y0(n);default:return n}}});const Jf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},RD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Jf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},ID=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Pi(n){return h.isProxy(n)?h.toRaw(n):n}function LD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function ND(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function tg(n,t){n.labels=t}function eg(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 FD(n,t){const e={labels:[],datasets:[]};return tg(e,n.labels),eg(e,n.datasets,t),e}const zD=h.defineComponent({props:RD,setup(n,t){let{expose:e,slots:i}=t;const s=h.ref(null),r=h.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=FD(u,g),y=LD(p,u);r.value=new Se(s.value,{type:c,data:y,options:{...d},plugins:f})},a=()=>{const c=h.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 h.onMounted(o),h.onUnmounted(a),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const y=h.toRaw(r.value);if(!y)return;let _=!1;if(d){const v=Pi(d),M=Pi(g);v&&v!==M&&(ND(y,v),_=!0)}if(f){const v=Pi(f.labels),M=Pi(p.labels),D=Pi(f.datasets),S=Pi(p.datasets);v!==M&&(tg(y.config.data,v),_=!0),D&&D!==S&&(eg(y.config.data,D,n.datasetIdKey),_=!0)}_&&h.nextTick(()=>{l(y)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[h.h("p",{},[i.default?i.default():""])])}});function ml(n,t){return Se.register(t),h.defineComponent({props:Jf,setup(e,i){let{expose:s}=i;const r=h.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>h.h(zD,ID({ref:o},{type:n,...e}))}})}const BD=ml("bar",Ji),ng=ml("doughnut",en),HD=ml("line",ts),WD={class:"chart-container"},YD=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=yt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=h.ref([]),o=h.useTemplateRef("chartParentRef"),a=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=yt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},d=h.computed(()=>[u]),f=h.computed(()=>[t.chartData.datasets.reduce((D,S)=>(D.labels.push(S.label),D.backgroundColor.push(S.backgroundColor),D.borderColor.push(Jd(S.backgroundColor,50)),D.data.push(S.data.reduce((T,R)=>T+R,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),g=h.computed(()=>({...t.chartData,datasets:f.value}));yt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:p}=yt.useDonutChartOptions({tooltipState:a,legendID:i}),y=h.ref(),_=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],v=({width:M,height:D})=>{a.width=M,a.height=D};return(M,D)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:o,class:h.normalizeClass(["chart-parent",_(M.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",WD,[h.createVNode(h.unref(ng),{ref_key:"chartInstance",ref:y,"chart-id":h.unref(s),data:g.value,options:h.unref(p),plugins:d.value},null,8,["chart-id","data","options","plugins"]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(fl,{"absolute-left":h.unref(l),"absolute-top":h.unref(c),state:a,"tooltip-title":M.tooltipTitle,unit:M.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(gl,{id:h.unref(i),"chart-instance":y.value,items:r.value,position:M.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),jD=Pe(YD,[["__scopeId","data-v-b61e8182"]]),ig=(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()};class $D{constructor(){O(this,"id","verticalLinePlugin");O(this,"_clickedSegment");O(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;ig(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;ig(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const VD=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},sg=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class UD{constructor(){O(this,"id","dragSelectPlugin");O(this,"_isDragging",!1);O(this,"_startX",0);O(this,"_endX",0);O(this,"_dragTimeout");O(this,"_clearSelectionArea",!1);O(this,"_chart",null);O(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,sg("dragSelectMove",t,this),t.update())},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,sg("dragSelect",t,this),t.update(),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&VD(t,this._startX,this._endX)}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const qD=["hidden","single","full"];var ei=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ei||{});const XD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],GD=["gauge","top_n","single_value"],KD=Pe(h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,s=new $D,r=new Kf,o=new UD,{translateUnit:a}=yt.useTranslatedUnits(),l=h.ref(),c=crypto.randomUUID(),u=crypto.randomUUID(),d=h.ref([]),f=h.ref(),g=h.ref(h.inject("legendPosition",Nt.Right)),p=h.ref(null),y=h.ref(void 0),_=h.ref(!1),v=h.inject(tf),M=v==null?void 0:v.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),D=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:a,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:u,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:S,tooltipAbsoluteTop:T}=yt.useTooltipAbsolutePosition(p,D),R={id:c,afterUpdate(B){d.value=Gd(B,e.legendValues,e.chartLegendSortFn)}},E=h.computed(()=>[R,r,...e.zoom?[o]:[],...e.type==="timeseries_line"?[s]:[]]),b=h.computed(()=>`line-${E.value.map(B=>B.id).join("-")}`),x=h.computed(()=>`bar-${E.value.map(B=>B.id).join("-")}`),P=h.computed(()=>e.chartData&&iw(e.chartData)),I=h.computed(()=>M?!1:_.value),{options:C}=yt.useLineChartOptions({tooltipState:D,timeRangeMs:h.toRef(e,"timeRangeMs"),granularity:h.toRef(e,"granularity"),legendID:c,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:P});yt.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey"));const F=B=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[B],q=({width:B,height:j})=>{D.width=B,D.height=j},G=(B=!0)=>{D.interactionMode="idle",o.clearSelectionArea(),r.isPaused&&r.resume(B),s.isPaused&&s.resume()},J=()=>{D.interactionMode="interactive"},U=()=>{var B,j;!l.value||!((j=(B=l.value.chart.tooltip)==null?void 0:B.dataPoints)!=null&&j.length)||(D.interactionMode==="interactive"?s.clickedSegment=l.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(_.value){_.value=!1;return}D.interactionMode!=="idle"?G():J(),U()};h.watch(()=>e.type,()=>{D.interactionMode="idle",D.showTooltip=!1,s.destroyClickedSegment()});const V=B=>{B.preventDefault(),B.stopPropagation();const{xStart:j,xEnd:H}=B.detail;j&&H&&(y.value={start:new Date(j),end:new Date(H),type:"absolute"},M?D.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(j),end:new Date(H),type:"absolute"}),G()),i("select-chart-range",y.value))},K=B=>{M&&(D.interactionMode="selecting-chart-area"),_.value=!0,s.pause(),r.pause();const{xStart:j,xEnd:H}=B.detail;j&&H&&(y.value={start:new Date(j),end:new Date(H),type:"absolute"})};return h.watch(()=>{var B;return(B=l.value)==null?void 0:B.chart},()=>{var B;(B=l.value)!=null&&B.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",K),l.value.chart.canvas.addEventListener("dragSelect",V),l.value.chart.canvas.addEventListener("dragSelectMove",K))}),h.onUnmounted(()=>{var B;(B=l.value)!=null&&B.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",K))}),(B,j)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:p,class:h.normalizeClass(["chart-parent",F(g.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:j[0]||(j[0]=H=>ut())},[B.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(HD),{key:b.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:B.chartData,"data-testid":"time-series-line-chart",options:h.unref(C),plugins:E.value},null,8,["chart-id","data","options","plugins"])):B.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(BD),{key:x.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:B.chartData,"data-testid":"time-series-bar-chart",options:h.unref(C),plugins:E.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[I.value?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(fl,{key:0,ref_key:"tooltipElement",ref:f,"absolute-left":h.unref(S),"absolute-top":h.unref(T),"data-testid":"tooltip",state:D,"tooltip-title":B.tooltipTitle,"zoom-action-items":B.zoomActionItems,"zoom-time-range":y.value,onDimensions:q,onLeft:j[1]||(j[1]=H=>D.left=H),onOnAction:j[2]||(j[2]=()=>G(!1)),onTop:j[3]||(j[3]=H=>D.top=H)},null,8,["absolute-left","absolute-top","state","tooltip-title","zoom-action-items","zoom-time-range"]))])),h.createVNode(gl,{id:h.unref(c),"chart-instance":l.value,"data-testid":"legend",items:d.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3be99be5"]]),ZD={class:"analytics-chart-shell"},QD={key:0,class:"chart-header"},JD={class:"tooltip-content"},tS={key:2,class:"analytics-chart-parent"},eS=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=yt.useI18n(),r=h.computed(()=>p.value?yt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Rr,threshold:i.chartOptions.threshold||void 0},h.toRef(i,"chartData")).value:yt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Rr},h.toRef(i,"chartData")).value),o=h.computed(()=>{var C;return(C=i.chartData)!=null&&C.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),a=h.computed(()=>{var C;return(C=i.chartData.meta)!=null&&C.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),l=h.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:c}=yt.useChartLegendValues(r,i.chartOptions.type,a),u=h.computed(()=>{var C,F,q;return((q=(F=(C=i.chartData)==null?void 0:C.meta)==null?void 0:F.limit)==null?void 0:q.toString())||null}),d=h.computed(()=>{var C,F;return((F=(C=i.chartData)==null?void 0:C.meta)==null?void 0:F.truncated)||!1}),f=s.t("limitedResultsShown",{maxReturned:u.value}),g=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=h.computed(()=>["timeseries_bar","timeseries_line"].some(C=>C===i.chartOptions.type)),y=h.computed(()=>i.chartOptions.type==="donut"),_=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),v=h.computed(()=>{var q,G;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const C=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[C];if(i.chartData.meta.metric_names.length>1){if(C.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(C.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return s.t(`chartLabels.${C}`)}),M=h.computed(()=>{var q,G,J;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const C=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[C];if(i.chartData.meta.metric_names.length>1){if(C.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(C.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return((J=i.chartOptions)==null?void 0:J.metricAxesTitle)||s.te(`metricAxisTitles.${C}`)&&s.te(`chartUnits.${F}`)&&s.t(`metricAxisTitles.${C}`,{unit:s.t(`chartUnits.${F}`,{plural:"s"})})||void 0}),D=h.computed(()=>{const C=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];return i.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${C}`)&&s.t(`chartLabels.${C}`)||void 0}),S=h.computed(()=>{const C=Za(Number(i.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${C}`)}),T=h.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),R=h.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),E=h.computed(()=>p.value?sw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),b=h.computed(()=>i.chartData.meta.granularity_ms?Za(i.chartData.meta.granularity_ms)||"hourly":Za(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),x=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(C,F)=>C.text===s.t("chartLabels.____OTHER____")?1:F.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(C.text,10))&&!isNaN(parseInt(F.text,10))?C.text<F.text?-1:1:C.value&&F.value?F.value.raw-C.value.raw:0),P=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(C,F)=>C.label===s.t("chartLabels.____OTHER____")?1:F.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(C.label,10))&&!isNaN(parseInt(F.label,10))?C.label<F.label?-1:1:C.value&&F.value?F.rawValue-C.rawValue:0),I=h.computed(()=>[{label:s.t("zoom_action_items.zoom"),action:C=>e("zoom-time-range",C)},...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),href:i.requestsLink.href}]:[]]);return h.provide("showLegendValues",l),h.provide("legendPosition",h.toRef(i,"legendPosition")),(C,F)=>{const q=h.resolveComponent("KTooltip"),G=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",ZD,[E.value&&d.value&&u.value?(h.openBlock(),h.createElementBlock("div",QD,[h.createVNode(q,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",JD,h.toDisplayString(h.unref(f)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(nc.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(aM)})`,size:h.unref(cM)},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),E.value?(h.openBlock(),h.createElementBlock("div",tS,[p.value?(h.openBlock(),h.createBlock(KD,{key:0,"chart-data":r.value,"chart-legend-sort-fn":x.value,"chart-tooltip-sort-fn":P.value,"dimension-axes-title":S.value,fill:C.chartOptions.stacked,granularity:b.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,stacked:C.chartOptions.stacked,"synthetics-data-key":C.syntheticsDataKey,"time-range-ms":o.value,"tooltip-metric-display":v.value,"tooltip-title":C.tooltipTitle,type:C.chartOptions.type,zoom:C.timeseriesZoom,"zoom-action-items":I.value,onSelectChartRange:F[0]||(F[0]=J=>e("select-chart-range",J)),onZoomTimeRange:F[1]||(F[1]=J=>e("zoom-time-range",J))},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","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom","zoom-action-items"])):g.value?(h.openBlock(),h.createBlock(ED,{key:1,annotations:C.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":x.value,"chart-tooltip-sort-fn":P.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,orientation:_.value,stacked:C.chartOptions.stacked,"synthetics-data-key":C.syntheticsDataKey,"tooltip-metric-display":v.value,"tooltip-title":C.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-metric-display","tooltip-title"])):y.value?(h.openBlock(),h.createBlock(jD,{key:2,"chart-data":r.value,"dataset-colors":C.chartOptions.chartDatasetColors||h.unref(Rr),"legend-position":C.legendPosition,"legend-values":h.unref(c),"metric-unit":a.value,"synthetics-data-key":C.syntheticsDataKey,"tooltip-dimension-display":D.value,"tooltip-metric-display":v.value,"tooltip-title":C.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(G,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(T.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.value),1)]),_:1}))])}}}),nS=Pe(eS,[["__scopeId","data-v-40a496fa"]]),iS={class:"chart-parent","data-testid":"gauge-chart-parent"},sS={class:"chart-totals-flex"},rS={key:1,class:"metric-small","data-testid":"gauge-chart-total"},oS=Pe(h.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:sn},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}=yt.useI18n(),i=h.ref(Qr()),s=h.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((_,v)=>_+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=h.computed(()=>({...t.chartData,datasets:s.value}));yt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=h.ref(),l=h.computed(()=>{var g;return ws((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return ws(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((p=s==null?void 0:s.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>["full","single"].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay==="full");return(g,p)=>(h.openBlock(),h.createElementBlock("div",iS,[h.createElementVNode("div",sS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",rS,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(ng),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-4f4e5b76"]]),aS={class:"chart-parent","data-testid":"single-value-parent"},lS={key:1,class:"single-value-wrapper"},cS={class:"single-value","data-testid":"single-value-chart"},uS={key:0,class:"single-value-unit"},dS=Pe(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:ef}},setup(n){const{i18n:{t}}=yt.useI18n(),e=n,i=h.computed(()=>e.data.data[0]),s=h.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=h.computed(()=>{var u,d;const c=s.value?(d=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:d[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=h.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=h.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=h.computed(()=>{var d;const c=a.value;if(c===null)return"";if((d=s.value)!=null&&d.includes("_size_"))return Lr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:ef;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return h.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",aS,[a.value===null?(h.openBlock(),h.createBlock(d,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t)("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",lS,[h.createElementVNode("span",cS,h.toDisplayString(l.value),1),o.value?(h.openBlock(),h.createElementBlock("span",uS,"  "+h.toDisplayString(r.value),1)):h.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),hS={class:"simple-chart-shell"},fS={key:1,class:"analytics-chart-parent"},gS=Pe(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=h.computed(()=>{var u;const c=yt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},h.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=h.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=h.computed(()=>t.chartOptions.type==="gauge"),o=h.computed(()=>t.chartOptions.type==="single_value"),a=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=h.computed(()=>{var u,d;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(d=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:d[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",hS,[l.value?(h.openBlock(),h.createElementBlock("div",fS,[r.value?(h.openBlock(),h.createBlock(oS,{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"])):h.createCommentVNode("",!0),o.value?(h.openBlock(),h.createBlock(dS,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(d,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),pS={class:"top-n-card-title","data-testid":"top-n-card-title"},mS={class:"top-n-card-description","data-testid":"top-n-card-description"},yS={key:3,class:"top-n-table","data-testid":"top-n-table"},bS={class:"table-headings"},_S={class:"table-row"},xS={class:"column-1"},wS={class:"column-2"},vS={class:"table-body","data-testid":"top-n-data"},MS=["data-testid"],kS={class:"column-1"},DS={class:"column-2"},SS=Pe(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=h.computed(()=>t.data.data),s=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=h.computed(()=>{var p,y;return(p=t.data.meta)!=null&&p.display&&((y=Object.keys(t.data.meta.display))==null?void 0:y[0])||""}),o=h.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=h.computed(()=>{var p,y;return(y=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&y.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=h.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=p=>{const y=p.event;return String(y[r.value])},d=p=>{const y=u(p),_=o.value&&o.value[y];return _?_.name:"-"},f=p=>{const y=u(p),_=o.value&&o.value[y];return _?!!_.deleted:!1},g=p=>{if(!a.value)return"–";const _=p.event[a.value];return _?ws(_,{capital:!0,round:!0}):"–"};return(p,y)=>{const _=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KSkeleton"),M=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":p.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(_,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):p.isLoading?(h.openBlock(),h.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",yS,[h.createElementVNode("div",bS,[h.createElementVNode("div",_S,[h.createElementVNode("div",xS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",wS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",vS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(D,S)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${S}`,class:"table-row","data-testid":`row-${u(D)}`},[h.createElementVNode("div",kS,[h.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:f(D),dimension:r.value}},()=>[h.createTextVNode(h.toDisplayString(d(D)),1)],!0)]),h.createElementVNode("div",DS,"   "+h.toDisplayString(g(D)),1)],8,MS))),128))])])):(h.openBlock(),h.createBlock(_,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[p.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",pS,h.toDisplayString(p.title),1)]),key:"0"}:void 0,p.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",mS,h.toDisplayString(p.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var Jr={exports:{}};Jr.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",d="[object Date]",f="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",_="[object Number]",v="[object Object]",M="[object Promise]",D="[object RegExp]",S="[object Set]",T="[object String]",R="[object Symbol]",E="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",P="[object Float32Array]",I="[object Float64Array]",C="[object Int8Array]",F="[object Int16Array]",q="[object Int32Array]",G="[object Uint8Array]",J="[object Uint8ClampedArray]",U="[object Uint16Array]",ut="[object Uint32Array]",V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/,B=/^\./,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,xt=/\\(\\)?/g,mt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,ft={};ft[P]=ft[I]=ft[C]=ft[F]=ft[q]=ft[G]=ft[J]=ft[U]=ft[ut]=!0,ft[l]=ft[c]=ft[b]=ft[u]=ft[x]=ft[d]=ft[f]=ft[g]=ft[y]=ft[_]=ft[v]=ft[D]=ft[S]=ft[T]=ft[E]=!1;var gt=typeof be=="object"&&be&&be.Object===Object&&be,z=typeof self=="object"&&self&&self.Object===Object&&self,$=gt||z||Function("return this")(),Y=t&&!t.nodeType&&t,Q=Y&&!0&&n&&!n.nodeType&&n,tt=Q&&Q.exports===Y,et=tt&&gt.process,it=function(){try{return et&&et.binding("util")}catch{}}(),nt=it&&it.isTypedArray;function _t(m,k){for(var L=-1,W=m?m.length:0;++L<W;)if(k(m[L],L,m))return!0;return!1}function at(m){return function(k){return k==null?void 0:k[m]}}function Pt(m,k){for(var L=-1,W=Array(m);++L<m;)W[L]=k(L);return W}function te(m){return function(k){return m(k)}}function ae(m,k){return m==null?void 0:m[k]}function qt(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function Oe(m){var k=-1,L=Array(m.size);return m.forEach(function(W,dt){L[++k]=[dt,W]}),L}function Mt(m,k){return function(L){return m(k(L))}}function Xt(m){var k=-1,L=Array(m.size);return m.forEach(function(W){L[++k]=W}),L}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,qe=$["__core-js_shared__"],ni=function(){var m=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Ne=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ii=RegExp("^"+Ne.call(Ht).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),to=$.Symbol,eo=$.Uint8Array,Rs=ie.propertyIsEnumerable,si=Bt.splice,Is=Mt(Object.keys,Object),ri=dn($,"DataView"),an=dn($,"Map"),ln=dn($,"Promise"),Ls=dn($,"Set"),Ns=dn($,"WeakMap"),oi=dn(Object,"create"),_l=fn(ri),xl=fn(an),no=fn(ln),io=fn(Ls),cn=fn(Ns),Oi=to?to.prototype:void 0,Fs=Oi?Oi.valueOf:void 0,so=Oi?Oi.toString:void 0;function un(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function wl(){this.__data__=oi?oi(null):{}}function Fe(m){return this.has(m)&&delete this.__data__[m]}function vl(m){var k=this.__data__;if(oi){var L=k[m];return L===s?void 0:L}return Ht.call(k,m)?k[m]:void 0}function Ml(m){var k=this.__data__;return oi?k[m]!==void 0:Ht.call(k,m)}function kl(m,k){var L=this.__data__;return L[m]=oi&&k===void 0?s:k,this}un.prototype.clear=wl,un.prototype.delete=Fe,un.prototype.get=vl,un.prototype.has=Ml,un.prototype.set=kl;function ze(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function Dl(){this.__data__=[]}function An(m){var k=this.__data__,L=Ri(k,m);if(L<0)return!1;var W=k.length-1;return L==W?k.pop():si.call(k,L,1),!0}function Sl(m){var k=this.__data__,L=Ri(k,m);return L<0?void 0:k[L][1]}function Tl(m){return Ri(this.__data__,m)>-1}function Cl(m,k){var L=this.__data__,W=Ri(L,m);return W<0?L.push([m,k]):L[W][1]=k,this}ze.prototype.clear=Dl,ze.prototype.delete=An,ze.prototype.get=Sl,ze.prototype.has=Tl,ze.prototype.set=Cl;function Be(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function Pl(){this.__data__={hash:new un,map:new(an||ze),string:new un}}function Rn(m){return Ni(this,m).delete(m)}function Ol(m){return Ni(this,m).get(m)}function El(m){return Ni(this,m).has(m)}function Al(m,k){return Ni(this,m).set(m,k),this}Be.prototype.clear=Pl,Be.prototype.delete=Rn,Be.prototype.get=Ol,Be.prototype.has=El,Be.prototype.set=Al;function Ei(m){var k=-1,L=m?m.length:0;for(this.__data__=new Be;++k<L;)this.add(m[k])}function Rl(m){return this.__data__.set(m,s),this}function Il(m){return this.__data__.has(m)}Ei.prototype.add=Ei.prototype.push=Rl,Ei.prototype.has=Il;function Ee(m){this.__data__=new ze(m)}function Ai(){this.__data__=new ze}function Ll(m){return this.__data__.delete(m)}function zs(m){return this.__data__.get(m)}function Nl(m){return this.__data__.has(m)}function Fl(m,k){var L=this.__data__;if(L instanceof ze){var W=L.__data__;if(!an||W.length<e-1)return W.push([m,k]),this;L=this.__data__=new Be(W)}return L.set(m,k),this}Ee.prototype.clear=Ai,Ee.prototype.delete=Ll,Ee.prototype.get=zs,Ee.prototype.has=Nl,Ee.prototype.set=Fl;function zl(m,k){var L=w(m)||ho(m)?Pt(m.length,String):[],W=L.length,dt=!!W;for(var Z in m)Ht.call(m,Z)&&!(dt&&(Z=="length"||Hs(Z,W)))&&L.push(Z);return L}function Ri(m,k){for(var L=m.length;L--;)if(uo(m[L][0],k))return L;return-1}var Bl=Gl();function Hl(m,k){return m&&Bl(m,k,li)}function Ii(m,k){k=Fi(k,m)?[k]:Xe(k);for(var L=0,W=k.length;m!=null&&L<W;)m=m[hn(k[L++])];return L&&L==W?m:void 0}function Wl(m){return _e.call(m)}function Yl(m,k){return m!=null&&k in Object(m)}function Bs(m,k,L,W,dt){return m===k?!0:m==null||k==null||!Kt(m)&&!xe(k)?m!==m&&k!==k:jl(m,k,Bs,L,W,dt)}function jl(m,k,L,W,dt,Z){var bt=w(m),Zt=w(k),Wt=c,ce=c;bt||(Wt=le(m),Wt=Wt==l?v:Wt),Zt||(ce=le(k),ce=ce==l?v:ce);var we=Wt==v&&!qt(m),ve=ce==v&&!qt(k),fe=Wt==ce;if(fe&&!we)return Z||(Z=new Ee),bt||fo(m)?ao(m,k,L,W,dt,Z):Kl(m,k,Wt,L,W,dt,Z);if(!(dt&o)){var Ae=we&&Ht.call(m,"__wrapped__"),Re=ve&&Ht.call(k,"__wrapped__");if(Ae||Re){var Nn=Ae?m.value():m,gn=Re?k.value():k;return Z||(Z=new Ee),L(Nn,gn,W,dt,Z)}}return fe?(Z||(Z=new Ee),Zl(m,k,L,W,dt,Z)):!1}function $l(m,k,L,W){var dt=L.length,Z=dt;if(m==null)return!Z;for(m=Object(m);dt--;){var bt=L[dt];if(bt[2]?bt[1]!==m[bt[0]]:!(bt[0]in m))return!1}for(;++dt<Z;){bt=L[dt];var Zt=bt[0],Wt=m[Zt],ce=bt[1];if(bt[2]){if(Wt===void 0&&!(Zt in m))return!1}else{var we=new Ee,ve;if(!(ve===void 0?Bs(ce,Wt,W,r|o,we):ve))return!1}}return!0}function Vl(m){if(!Kt(m)||lo(m))return!1;var k=X(m)||qt(m)?ii:mt;return k.test(fn(m))}function Ul(m){return xe(m)&&$t(m.length)&&!!ft[_e.call(m)]}function ro(m){return typeof m=="function"?m:m==null?zi:typeof m=="object"?w(m)?Li(m[0],m[1]):Xl(m):gT(m)}function ql(m){if(!tc(m))return Is(m);var k=[];for(var L in Object(m))Ht.call(m,L)&&L!="constructor"&&k.push(L);return k}function Xl(m){var k=Ql(m);return k.length==1&&k[0][2]?Ys(k[0][0],k[0][1]):function(L){return L===m||$l(L,m,k)}}function Li(m,k){return Fi(m)&&co(k)?Ys(hn(m),k):function(L){var W=go(L,m);return W===void 0&&W===k?po(L,m):Bs(k,W,void 0,r|o)}}function In(m){return function(k){return Ii(k,m)}}function oo(m){if(typeof m=="string")return m;if(ee(m))return so?so.call(m):"";var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function Xe(m){return w(m)?m:ec(m)}function Gl(m){return function(k,L,W){for(var dt=-1,Z=Object(k),bt=W(k),Zt=bt.length;Zt--;){var Wt=bt[++dt];if(L(Z[Wt],Wt,Z)===!1)break}return k}}function ao(m,k,L,W,dt,Z){var bt=dt&o,Zt=m.length,Wt=k.length;if(Zt!=Wt&&!(bt&&Wt>Zt))return!1;var ce=Z.get(m);if(ce&&Z.get(k))return ce==k;var we=-1,ve=!0,fe=dt&r?new Ei:void 0;for(Z.set(m,k),Z.set(k,m);++we<Zt;){var Ae=m[we],Re=k[we];if(W)var Nn=bt?W(Re,Ae,we,k,m,Z):W(Ae,Re,we,m,k,Z);if(Nn!==void 0){if(Nn)continue;ve=!1;break}if(fe){if(!_t(k,function(gn,ci){if(!fe.has(ci)&&(Ae===gn||L(Ae,gn,W,dt,Z)))return fe.add(ci)})){ve=!1;break}}else if(!(Ae===Re||L(Ae,Re,W,dt,Z))){ve=!1;break}}return Z.delete(m),Z.delete(k),ve}function Kl(m,k,L,W,dt,Z,bt){switch(L){case x:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case b:return!(m.byteLength!=k.byteLength||!W(new eo(m),new eo(k)));case u:case d:case _:return uo(+m,+k);case f:return m.name==k.name&&m.message==k.message;case D:case T:return m==k+"";case y:var Zt=Oe;case S:var Wt=Z&o;if(Zt||(Zt=Xt),m.size!=k.size&&!Wt)return!1;var ce=bt.get(m);if(ce)return ce==k;Z|=r,bt.set(m,k);var we=ao(Zt(m),Zt(k),W,dt,Z,bt);return bt.delete(m),we;case R:if(Fs)return Fs.call(m)==Fs.call(k)}return!1}function Zl(m,k,L,W,dt,Z){var bt=dt&o,Zt=li(m),Wt=Zt.length,ce=li(k),we=ce.length;if(Wt!=we&&!bt)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(bt?fe in k:Ht.call(k,fe)))return!1}var Ae=Z.get(m);if(Ae&&Z.get(k))return Ae==k;var Re=!0;Z.set(m,k),Z.set(k,m);for(var Nn=bt;++ve<Wt;){fe=Zt[ve];var gn=m[fe],ci=k[fe];if(W)var fg=bt?W(ci,gn,fe,k,m,Z):W(gn,ci,fe,m,k,Z);if(!(fg===void 0?gn===ci||L(gn,ci,W,dt,Z):fg)){Re=!1;break}Nn||(Nn=fe=="constructor")}if(Re&&!Nn){var mo=m.constructor,yo=k.constructor;mo!=yo&&"constructor"in m&&"constructor"in k&&!(typeof mo=="function"&&mo instanceof mo&&typeof yo=="function"&&yo instanceof yo)&&(Re=!1)}return Z.delete(m),Z.delete(k),Re}function Ni(m,k){var L=m.__data__;return Ws(k)?L[typeof k=="string"?"string":"hash"]:L.map}function Ql(m){for(var k=li(m),L=k.length;L--;){var W=k[L],dt=m[W];k[L]=[W,dt,co(dt)]}return k}function dn(m,k){var L=ae(m,k);return Vl(L)?L:void 0}var le=Wl;(ri&&le(new ri(new ArrayBuffer(1)))!=x||an&&le(new an)!=y||ln&&le(ln.resolve())!=M||Ls&&le(new Ls)!=S||Ns&&le(new Ns)!=E)&&(le=function(m){var k=_e.call(m),L=k==v?m.constructor:void 0,W=L?fn(L):void 0;if(W)switch(W){case _l:return x;case xl:return y;case no:return M;case io:return S;case cn:return E}return k});function Jl(m,k,L){k=Fi(k,m)?[k]:Xe(k);for(var W,dt=-1,bt=k.length;++dt<bt;){var Z=hn(k[dt]);if(!(W=m!=null&&L(m,Z)))break;m=m[Z]}if(W)return W;var bt=m?m.length:0;return!!bt&&$t(bt)&&Hs(Z,bt)&&(w(m)||ho(m))}function Hs(m,k){return k=k??a,!!k&&(typeof m=="number"||vt.test(m))&&m>-1&&m%1==0&&m<k}function Fi(m,k){if(w(m))return!1;var L=typeof m;return L=="number"||L=="symbol"||L=="boolean"||m==null||ee(m)?!0:K.test(m)||!V.test(m)||k!=null&&m in Object(k)}function Ws(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function lo(m){return!!ni&&ni in m}function tc(m){var k=m&&m.constructor,L=typeof k=="function"&&k.prototype||ie;return m===L}function co(m){return m===m&&!Kt(m)}function Ys(m,k){return function(L){return L==null?!1:L[m]===k&&(k!==void 0||m in Object(L))}}var ec=ai(function(m){m=Ln(m);var k=[];return B.test(m)&&k.push(""),m.replace(j,function(L,W,dt,Z){k.push(dt?Z.replace(xt,"$1"):W||L)}),k});function hn(m){if(typeof m=="string"||ee(m))return m;var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function fn(m){if(m!=null){try{return Ne.call(m)}catch{}try{return m+""}catch{}}return""}function ai(m,k){if(typeof m!="function"||k&&typeof k!="function")throw new TypeError(i);var L=function(){var W=arguments,dt=k?k.apply(this,W):W[0],Z=L.cache;if(Z.has(dt))return Z.get(dt);var bt=m.apply(this,W);return L.cache=Z.set(dt,bt),bt};return L.cache=new(ai.Cache||Be),L}ai.Cache=Be;function uo(m,k){return m===k||m!==m&&k!==k}function ho(m){return N(m)&&Ht.call(m,"callee")&&(!Rs.call(m,"callee")||_e.call(m)==l)}var w=Array.isArray;function A(m){return m!=null&&$t(m.length)&&!X(m)}function N(m){return xe(m)&&A(m)}function X(m){var k=Kt(m)?_e.call(m):"";return k==g||k==p}function $t(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=a}function Kt(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function xe(m){return!!m&&typeof m=="object"}function ee(m){return typeof m=="symbol"||xe(m)&&_e.call(m)==R}var fo=nt?te(nt):Ul;function Ln(m){return m==null?"":oo(m)}function go(m,k,L){var W=m==null?void 0:Ii(m,k);return W===void 0?L:W}function po(m,k){return m!=null&&Jl(m,k,Yl)}function li(m){return A(m)?zl(m):ql(m)}function js(m,k){var L={};return k=ro(k),Hl(m,function(W,dt,Z){L[k(W,dt,Z)]=W}),L}function zi(m){return m}function gT(m){return Fi(m)?at(hn(m)):In(m)}n.exports=js}(Jr,Jr.exports);var TS=Jr.exports;const CS=Ba(TS);var PS=9007199254740991,OS="[object Arguments]",ES="[object Function]",AS="[object GeneratorFunction]",RS="[object Symbol]",IS=typeof be=="object"&&be&&be.Object===Object&&be,LS=typeof self=="object"&&self&&self.Object===Object&&self,NS=IS||LS||Function("return this")();function FS(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 zS(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 BS(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var yl=Object.prototype,HS=yl.hasOwnProperty,bl=yl.toString,rg=NS.Symbol,WS=yl.propertyIsEnumerable,og=rg?rg.isConcatSpreadable:void 0,ag=Math.max;function YS(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=US),s||(s=[]);++r<o;){var a=n[r];e(a)?BS(s,a):s[s.length]=a}return s}function jS(n,t){return n=Object(n),$S(n,t,function(e,i){return i in n})}function $S(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 VS(n,t){return t=ag(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=ag(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,FS(n,this,o)}}function US(n){return GS(n)||XS(n)||!!(og&&n&&n[og])}function qS(n){if(typeof n=="string"||eT(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function XS(n){return ZS(n)&&HS.call(n,"callee")&&(!WS.call(n,"callee")||bl.call(n)==OS)}var GS=Array.isArray;function KS(n){return n!=null&&JS(n.length)&&!QS(n)}function ZS(n){return lg(n)&&KS(n)}function QS(n){var t=tT(n)?bl.call(n):"";return t==ES||t==AS}function JS(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=PS}function tT(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function lg(n){return!!n&&typeof n=="object"}function eT(n){return typeof n=="symbol"||lg(n)&&bl.call(n)==RS}var nT=VS(function(n,t){return n==null?{}:jS(n,zS(YS(t),qS))}),iT=nT;const sT=Ba(iT);var cg={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function 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 be=="object"&&be.global===be?be: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 f=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=f.createObjectURL(c),setTimeout(function(){f.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 f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||g&&p||a)&&typeof FileReader<"u"){var _=new FileReader;_.onloadend=function(){var D=_.result;D=y?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},_.readAsDataURL(c)}else{var v=o.URL||o.webkitURL,M=v.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){v.revokeObjectURL(M)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(cg);var rT=cg.exports,ug={exports:{}};/* @license
28
+ */const OD={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"};au._date.override({_id:"date-fns",formats:function(){return OD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=lt(n):e==="string"&&(typeof t=="string"?n=Ex(n,t,new Date,this.options):n=Vd(n,this.options)),fa(n)?n.getTime():null},format:function(n,t){return Bd(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return da(n,t);case"second":return S0(n,t);case"minute":return k0(n,t);case"hour":return w0(n,t);case"day":return Sr(n,t);case"week":return T0(n,t);case"month":return ua(n,t);case"quarter":return D0(n,t);case"year":return C0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return ga(n,t);case"second":return N0(n,t);case"minute":return R0(n,t);case"hour":return A0(n,t);case"day":return Md(n,t);case"week":return F0(n,t);case"month":return Td(n,t);case"quarter":return L0(n,t);case"year":return z0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Lx(n);case"minute":return Ix(n);case"hour":return Rx(n);case"day":return ha(n);case"week":return $e(n);case"isoWeek":return $e(n,{weekStartsOn:+e});case"month":return H0(n);case"quarter":return B0(n);case"year":return Cd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return U0(n);case"minute":return $0(n);case"hour":return Y0(n);case"day":return Dd(n);case"week":return j0(n);case"month":return Sd(n);case"quarter":return V0(n);case"year":return W0(n);default:return n}}});const Qf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},ED={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Qf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},AD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Pi(n){return h.isProxy(n)?h.toRaw(n):n}function RD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function ID(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Jf(n,t){n.labels=t}function tg(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 LD(n,t){const e={labels:[],datasets:[]};return Jf(e,n.labels),tg(e,n.datasets,t),e}const ND=h.defineComponent({props:ED,setup(n,t){let{expose:e,slots:i}=t;const s=h.ref(null),r=h.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=LD(u,g),y=RD(p,u);r.value=new Se(s.value,{type:c,data:y,options:{...d},plugins:f})},a=()=>{const c=h.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 h.onMounted(o),h.onUnmounted(a),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const y=h.toRaw(r.value);if(!y)return;let _=!1;if(d){const v=Pi(d),M=Pi(g);v&&v!==M&&(ID(y,v),_=!0)}if(f){const v=Pi(f.labels),M=Pi(p.labels),D=Pi(f.datasets),S=Pi(p.datasets);v!==M&&(Jf(y.config.data,v),_=!0),D&&D!==S&&(tg(y.config.data,D,n.datasetIdKey),_=!0)}_&&h.nextTick(()=>{l(y)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[h.h("p",{},[i.default?i.default():""])])}});function pl(n,t){return Se.register(t),h.defineComponent({props:Qf,setup(e,i){let{expose:s}=i;const r=h.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>h.h(ND,AD({ref:o},{type:n,...e}))}})}const FD=pl("bar",Ji),eg=pl("doughnut",en),zD=pl("line",ts),BD={class:"chart-container"},HD=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=yt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=h.ref([]),o=h.useTemplateRef("chartParentRef"),a=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=yt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},d=h.computed(()=>[u]),f=h.computed(()=>[t.chartData.datasets.reduce((D,S)=>(D.labels.push(S.label),D.backgroundColor.push(S.backgroundColor),D.borderColor.push(Qd(S.backgroundColor,50)),D.data.push(S.data.reduce((T,R)=>T+R,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),g=h.computed(()=>({...t.chartData,datasets:f.value}));yt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:p}=yt.useDonutChartOptions({tooltipState:a,legendID:i}),y=h.ref(),_=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],v=({width:M,height:D})=>{a.width=M,a.height=D};return(M,D)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:o,class:h.normalizeClass(["chart-parent",_(M.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",BD,[h.createVNode(h.unref(eg),{ref_key:"chartInstance",ref:y,"chart-id":h.unref(s),data:g.value,options:h.unref(p),plugins:d.value},null,8,["chart-id","data","options","plugins"]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(hl,{"absolute-left":h.unref(l),"absolute-top":h.unref(c),state:a,"tooltip-title":M.tooltipTitle,unit:M.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(fl,{id:h.unref(i),"chart-instance":y.value,items:r.value,position:M.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),WD=Pe(HD,[["__scopeId","data-v-b61e8182"]]),ng=(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()};class YD{constructor(){O(this,"id","verticalLinePlugin");O(this,"_clickedSegment");O(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;ng(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;ng(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const jD=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},ig=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class $D{constructor(){O(this,"id","dragSelectPlugin");O(this,"_isDragging",!1);O(this,"_startX",0);O(this,"_endX",0);O(this,"_dragTimeout");O(this,"_clearSelectionArea",!1);O(this,"_chart",null);O(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,ig("dragSelectMove",t,this),t.update())},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,ig("dragSelect",t,this),t.update(),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&jD(t,this._startX,this._endX)}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const VD=["hidden","single","full"];var ei=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ei||{});const UD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],qD=["gauge","top_n","single_value"],XD=Pe(h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,s=new YD,r=new Gf,o=new $D,{translateUnit:a}=yt.useTranslatedUnits(),l=h.ref(),c=crypto.randomUUID(),u=crypto.randomUUID(),d=h.ref([]),f=h.ref(),g=h.ref(h.inject("legendPosition",Nt.Right)),p=h.ref(null),y=h.ref(void 0),_=h.ref(!1),v=h.inject(Jh),M=v==null?void 0:v.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),D=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:a,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:u,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:S,tooltipAbsoluteTop:T}=yt.useTooltipAbsolutePosition(p,D),R={id:c,afterUpdate(B){d.value=Xd(B,e.legendValues,e.chartLegendSortFn)}},E=h.computed(()=>[R,r,...e.zoom?[o]:[],...e.type==="timeseries_line"?[s]:[]]),b=h.computed(()=>`line-${E.value.map(B=>B.id).join("-")}`),x=h.computed(()=>`bar-${E.value.map(B=>B.id).join("-")}`),P=h.computed(()=>e.chartData&&nw(e.chartData)),I=h.computed(()=>M?!1:_.value),{options:C}=yt.useLineChartOptions({tooltipState:D,timeRangeMs:h.toRef(e,"timeRangeMs"),granularity:h.toRef(e,"granularity"),legendID:c,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:P});yt.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey"));const F=B=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[B],q=({width:B,height:j})=>{D.width=B,D.height=j},G=(B=!0)=>{D.interactionMode="idle",o.clearSelectionArea(),r.isPaused&&r.resume(B),s.isPaused&&s.resume()},J=()=>{D.interactionMode="interactive"},U=()=>{var B,j;!l.value||!((j=(B=l.value.chart.tooltip)==null?void 0:B.dataPoints)!=null&&j.length)||(D.interactionMode==="interactive"?s.clickedSegment=l.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(_.value){_.value=!1;return}D.interactionMode!=="idle"?G():J(),U()};h.watch(()=>e.type,()=>{D.interactionMode="idle",D.showTooltip=!1,s.destroyClickedSegment()});const V=B=>{B.preventDefault(),B.stopPropagation();const{xStart:j,xEnd:H}=B.detail;j&&H&&(y.value={start:new Date(j),end:new Date(H),type:"absolute"},M?D.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(j),end:new Date(H),type:"absolute"}),G()),i("select-chart-range",y.value))},K=B=>{M&&(D.interactionMode="selecting-chart-area"),_.value=!0,s.pause(),r.pause();const{xStart:j,xEnd:H}=B.detail;j&&H&&(y.value={start:new Date(j),end:new Date(H),type:"absolute"})};return h.watch(()=>{var B;return(B=l.value)==null?void 0:B.chart},()=>{var B;(B=l.value)!=null&&B.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",K),l.value.chart.canvas.addEventListener("dragSelect",V),l.value.chart.canvas.addEventListener("dragSelectMove",K))}),h.onUnmounted(()=>{var B;(B=l.value)!=null&&B.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",K))}),(B,j)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:p,class:h.normalizeClass(["chart-parent",F(g.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:j[0]||(j[0]=H=>ut())},[B.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(zD),{key:b.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:B.chartData,"data-testid":"time-series-line-chart",options:h.unref(C),plugins:E.value},null,8,["chart-id","data","options","plugins"])):B.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(FD),{key:x.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:B.chartData,"data-testid":"time-series-bar-chart",options:h.unref(C),plugins:E.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[I.value?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(hl,{key:0,ref_key:"tooltipElement",ref:f,"absolute-left":h.unref(S),"absolute-top":h.unref(T),"data-testid":"tooltip",state:D,"tooltip-title":B.tooltipTitle,"zoom-action-items":B.zoomActionItems,"zoom-time-range":y.value,onDimensions:q,onLeft:j[1]||(j[1]=H=>D.left=H),onOnAction:j[2]||(j[2]=()=>G(!1)),onTop:j[3]||(j[3]=H=>D.top=H)},null,8,["absolute-left","absolute-top","state","tooltip-title","zoom-action-items","zoom-time-range"]))])),h.createVNode(fl,{id:h.unref(c),"chart-instance":l.value,"data-testid":"legend",items:d.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3be99be5"]]),GD={class:"analytics-chart-shell"},KD={key:0,class:"chart-header"},ZD={class:"tooltip-content"},QD={key:2,class:"analytics-chart-parent"},JD=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=yt.useI18n(),r=h.computed(()=>p.value?yt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Rr,threshold:i.chartOptions.threshold||void 0},h.toRef(i,"chartData")).value:yt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Rr},h.toRef(i,"chartData")).value),o=h.computed(()=>{var C;return(C=i.chartData)!=null&&C.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),a=h.computed(()=>{var C;return(C=i.chartData.meta)!=null&&C.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),l=h.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:c}=yt.useChartLegendValues(r,i.chartOptions.type,a),u=h.computed(()=>{var C,F,q;return((q=(F=(C=i.chartData)==null?void 0:C.meta)==null?void 0:F.limit)==null?void 0:q.toString())||null}),d=h.computed(()=>{var C,F;return((F=(C=i.chartData)==null?void 0:C.meta)==null?void 0:F.truncated)||!1}),f=s.t("limitedResultsShown",{maxReturned:u.value}),g=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=h.computed(()=>["timeseries_bar","timeseries_line"].some(C=>C===i.chartOptions.type)),y=h.computed(()=>i.chartOptions.type==="donut"),_=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),v=h.computed(()=>{var q,G;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const C=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[C];if(i.chartData.meta.metric_names.length>1){if(C.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(C.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return s.t(`chartLabels.${C}`)}),M=h.computed(()=>{var q,G,J;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const C=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[C];if(i.chartData.meta.metric_names.length>1){if(C.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(C.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return((J=i.chartOptions)==null?void 0:J.metricAxesTitle)||s.te(`metricAxisTitles.${C}`)&&s.te(`chartUnits.${F}`)&&s.t(`metricAxisTitles.${C}`,{unit:s.t(`chartUnits.${F}`,{plural:"s"})})||void 0}),D=h.computed(()=>{const C=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];return i.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${C}`)&&s.t(`chartLabels.${C}`)||void 0}),S=h.computed(()=>{const C=Ka(Number(i.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${C}`)}),T=h.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),R=h.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),E=h.computed(()=>p.value?iw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),b=h.computed(()=>i.chartData.meta.granularity_ms?Ka(i.chartData.meta.granularity_ms)||"hourly":Ka(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),x=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(C,F)=>C.text===s.t("chartLabels.____OTHER____")?1:F.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(C.text,10))&&!isNaN(parseInt(F.text,10))?C.text<F.text?-1:1:C.value&&F.value?F.value.raw-C.value.raw:0),P=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(C,F)=>C.label===s.t("chartLabels.____OTHER____")?1:F.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(C.label,10))&&!isNaN(parseInt(F.label,10))?C.label<F.label?-1:1:C.value&&F.value?F.rawValue-C.rawValue:0),I=h.computed(()=>[{label:s.t("zoom_action_items.zoom"),action:C=>e("zoom-time-range",C)},...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),href:i.requestsLink.href}]:[]]);return h.provide("showLegendValues",l),h.provide("legendPosition",h.toRef(i,"legendPosition")),(C,F)=>{const q=h.resolveComponent("KTooltip"),G=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",GD,[E.value&&d.value&&u.value?(h.openBlock(),h.createElementBlock("div",KD,[h.createVNode(q,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",ZD,h.toDisplayString(h.unref(f)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(ec.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(oM)})`,size:h.unref(lM)},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),E.value?(h.openBlock(),h.createElementBlock("div",QD,[p.value?(h.openBlock(),h.createBlock(XD,{key:0,"chart-data":r.value,"chart-legend-sort-fn":x.value,"chart-tooltip-sort-fn":P.value,"dimension-axes-title":S.value,fill:C.chartOptions.stacked,granularity:b.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,stacked:C.chartOptions.stacked,"synthetics-data-key":C.syntheticsDataKey,"time-range-ms":o.value,"tooltip-metric-display":v.value,"tooltip-title":C.tooltipTitle,type:C.chartOptions.type,zoom:C.timeseriesZoom,"zoom-action-items":I.value,onSelectChartRange:F[0]||(F[0]=J=>e("select-chart-range",J)),onZoomTimeRange:F[1]||(F[1]=J=>e("zoom-time-range",J))},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","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom","zoom-action-items"])):g.value?(h.openBlock(),h.createBlock(PD,{key:1,annotations:C.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":x.value,"chart-tooltip-sort-fn":P.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,orientation:_.value,stacked:C.chartOptions.stacked,"synthetics-data-key":C.syntheticsDataKey,"tooltip-metric-display":v.value,"tooltip-title":C.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-metric-display","tooltip-title"])):y.value?(h.openBlock(),h.createBlock(WD,{key:2,"chart-data":r.value,"dataset-colors":C.chartOptions.chartDatasetColors||h.unref(Rr),"legend-position":C.legendPosition,"legend-values":h.unref(c),"metric-unit":a.value,"synthetics-data-key":C.syntheticsDataKey,"tooltip-dimension-display":D.value,"tooltip-metric-display":v.value,"tooltip-title":C.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(G,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(T.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.value),1)]),_:1}))])}}}),tS=Pe(JD,[["__scopeId","data-v-40a496fa"]]),eS={class:"chart-parent","data-testid":"gauge-chart-parent"},nS={class:"chart-totals-flex"},iS={key:1,class:"metric-small","data-testid":"gauge-chart-total"},sS=Pe(h.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:sn},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}=yt.useI18n(),i=h.ref(Zr()),s=h.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((_,v)=>_+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=h.computed(()=>({...t.chartData,datasets:s.value}));yt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=h.ref(),l=h.computed(()=>{var g;return ws((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return ws(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((p=s==null?void 0:s.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>["full","single"].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay==="full");return(g,p)=>(h.openBlock(),h.createElementBlock("div",eS,[h.createElementVNode("div",nS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",iS,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(eg),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-4f4e5b76"]]),rS={class:"chart-parent","data-testid":"single-value-parent"},oS={key:1,class:"single-value-wrapper"},aS={class:"single-value","data-testid":"single-value-chart"},lS={key:0,class:"single-value-unit"},cS=Pe(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:tf}},setup(n){const{i18n:{t}}=yt.useI18n(),e=n,i=h.computed(()=>e.data.data[0]),s=h.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=h.computed(()=>{var u,d;const c=s.value?(d=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:d[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=h.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=h.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=h.computed(()=>{var d;const c=a.value;if(c===null)return"";if((d=s.value)!=null&&d.includes("_size_"))return Lr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:tf;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return h.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",rS,[a.value===null?(h.openBlock(),h.createBlock(d,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t)("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",oS,[h.createElementVNode("span",aS,h.toDisplayString(l.value),1),o.value?(h.openBlock(),h.createElementBlock("span",lS,"  "+h.toDisplayString(r.value),1)):h.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),uS={class:"simple-chart-shell"},dS={key:1,class:"analytics-chart-parent"},hS=Pe(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=h.computed(()=>{var u;const c=yt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},h.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=h.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=h.computed(()=>t.chartOptions.type==="gauge"),o=h.computed(()=>t.chartOptions.type==="single_value"),a=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=h.computed(()=>{var u,d;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(d=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:d[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",uS,[l.value?(h.openBlock(),h.createElementBlock("div",dS,[r.value?(h.openBlock(),h.createBlock(sS,{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"])):h.createCommentVNode("",!0),o.value?(h.openBlock(),h.createBlock(cS,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(d,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),fS={class:"top-n-card-title","data-testid":"top-n-card-title"},gS={class:"top-n-card-description","data-testid":"top-n-card-description"},pS={key:3,class:"top-n-table","data-testid":"top-n-table"},mS={class:"table-headings"},yS={class:"table-row"},bS={class:"column-1"},_S={class:"column-2"},xS={class:"table-body","data-testid":"top-n-data"},wS=["data-testid"],vS={class:"column-1"},MS={class:"column-2"},kS=Pe(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=h.computed(()=>t.data.data),s=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=h.computed(()=>{var p,y;return(p=t.data.meta)!=null&&p.display&&((y=Object.keys(t.data.meta.display))==null?void 0:y[0])||""}),o=h.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=h.computed(()=>{var p,y;return(y=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&y.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=h.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=p=>{const y=p.event;return String(y[r.value])},d=p=>{const y=u(p),_=o.value&&o.value[y];return _?_.name:"-"},f=p=>{const y=u(p),_=o.value&&o.value[y];return _?!!_.deleted:!1},g=p=>{if(!a.value)return"–";const _=p.event[a.value];return _?ws(_,{capital:!0,round:!0}):"–"};return(p,y)=>{const _=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KSkeleton"),M=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":p.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(_,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):p.isLoading?(h.openBlock(),h.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",pS,[h.createElementVNode("div",mS,[h.createElementVNode("div",yS,[h.createElementVNode("div",bS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",_S,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",xS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(D,S)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${S}`,class:"table-row","data-testid":`row-${u(D)}`},[h.createElementVNode("div",vS,[h.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:f(D),dimension:r.value}},()=>[h.createTextVNode(h.toDisplayString(d(D)),1)],!0)]),h.createElementVNode("div",MS,"   "+h.toDisplayString(g(D)),1)],8,wS))),128))])])):(h.openBlock(),h.createBlock(_,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[p.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",fS,h.toDisplayString(p.title),1)]),key:"0"}:void 0,p.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",gS,h.toDisplayString(p.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var Qr={exports:{}};Qr.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",d="[object Date]",f="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",_="[object Number]",v="[object Object]",M="[object Promise]",D="[object RegExp]",S="[object Set]",T="[object String]",R="[object Symbol]",E="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",P="[object Float32Array]",I="[object Float64Array]",C="[object Int8Array]",F="[object Int16Array]",q="[object Int32Array]",G="[object Uint8Array]",J="[object Uint8ClampedArray]",U="[object Uint16Array]",ut="[object Uint32Array]",V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/,B=/^\./,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,xt=/\\(\\)?/g,mt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,ft={};ft[P]=ft[I]=ft[C]=ft[F]=ft[q]=ft[G]=ft[J]=ft[U]=ft[ut]=!0,ft[l]=ft[c]=ft[b]=ft[u]=ft[x]=ft[d]=ft[f]=ft[g]=ft[y]=ft[_]=ft[v]=ft[D]=ft[S]=ft[T]=ft[E]=!1;var gt=typeof be=="object"&&be&&be.Object===Object&&be,z=typeof self=="object"&&self&&self.Object===Object&&self,$=gt||z||Function("return this")(),Y=t&&!t.nodeType&&t,Q=Y&&!0&&n&&!n.nodeType&&n,tt=Q&&Q.exports===Y,et=tt&&gt.process,it=function(){try{return et&&et.binding("util")}catch{}}(),nt=it&&it.isTypedArray;function _t(m,k){for(var L=-1,W=m?m.length:0;++L<W;)if(k(m[L],L,m))return!0;return!1}function at(m){return function(k){return k==null?void 0:k[m]}}function Pt(m,k){for(var L=-1,W=Array(m);++L<m;)W[L]=k(L);return W}function te(m){return function(k){return m(k)}}function ae(m,k){return m==null?void 0:m[k]}function qt(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function Oe(m){var k=-1,L=Array(m.size);return m.forEach(function(W,dt){L[++k]=[dt,W]}),L}function Mt(m,k){return function(L){return m(k(L))}}function Xt(m){var k=-1,L=Array(m.size);return m.forEach(function(W){L[++k]=W}),L}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,qe=$["__core-js_shared__"],ni=function(){var m=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Ne=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ii=RegExp("^"+Ne.call(Ht).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jr=$.Symbol,to=$.Uint8Array,Rs=ie.propertyIsEnumerable,si=Bt.splice,Is=Mt(Object.keys,Object),ri=dn($,"DataView"),an=dn($,"Map"),ln=dn($,"Promise"),Ls=dn($,"Set"),Ns=dn($,"WeakMap"),oi=dn(Object,"create"),bl=fn(ri),_l=fn(an),eo=fn(ln),no=fn(Ls),cn=fn(Ns),Oi=Jr?Jr.prototype:void 0,Fs=Oi?Oi.valueOf:void 0,io=Oi?Oi.toString:void 0;function un(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function xl(){this.__data__=oi?oi(null):{}}function Fe(m){return this.has(m)&&delete this.__data__[m]}function wl(m){var k=this.__data__;if(oi){var L=k[m];return L===s?void 0:L}return Ht.call(k,m)?k[m]:void 0}function vl(m){var k=this.__data__;return oi?k[m]!==void 0:Ht.call(k,m)}function Ml(m,k){var L=this.__data__;return L[m]=oi&&k===void 0?s:k,this}un.prototype.clear=xl,un.prototype.delete=Fe,un.prototype.get=wl,un.prototype.has=vl,un.prototype.set=Ml;function ze(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function kl(){this.__data__=[]}function An(m){var k=this.__data__,L=Ri(k,m);if(L<0)return!1;var W=k.length-1;return L==W?k.pop():si.call(k,L,1),!0}function Dl(m){var k=this.__data__,L=Ri(k,m);return L<0?void 0:k[L][1]}function Sl(m){return Ri(this.__data__,m)>-1}function Tl(m,k){var L=this.__data__,W=Ri(L,m);return W<0?L.push([m,k]):L[W][1]=k,this}ze.prototype.clear=kl,ze.prototype.delete=An,ze.prototype.get=Dl,ze.prototype.has=Sl,ze.prototype.set=Tl;function Be(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function Cl(){this.__data__={hash:new un,map:new(an||ze),string:new un}}function Rn(m){return Ni(this,m).delete(m)}function Pl(m){return Ni(this,m).get(m)}function Ol(m){return Ni(this,m).has(m)}function El(m,k){return Ni(this,m).set(m,k),this}Be.prototype.clear=Cl,Be.prototype.delete=Rn,Be.prototype.get=Pl,Be.prototype.has=Ol,Be.prototype.set=El;function Ei(m){var k=-1,L=m?m.length:0;for(this.__data__=new Be;++k<L;)this.add(m[k])}function Al(m){return this.__data__.set(m,s),this}function Rl(m){return this.__data__.has(m)}Ei.prototype.add=Ei.prototype.push=Al,Ei.prototype.has=Rl;function Ee(m){this.__data__=new ze(m)}function Ai(){this.__data__=new ze}function Il(m){return this.__data__.delete(m)}function zs(m){return this.__data__.get(m)}function Ll(m){return this.__data__.has(m)}function Nl(m,k){var L=this.__data__;if(L instanceof ze){var W=L.__data__;if(!an||W.length<e-1)return W.push([m,k]),this;L=this.__data__=new Be(W)}return L.set(m,k),this}Ee.prototype.clear=Ai,Ee.prototype.delete=Il,Ee.prototype.get=zs,Ee.prototype.has=Ll,Ee.prototype.set=Nl;function Fl(m,k){var L=w(m)||uo(m)?Pt(m.length,String):[],W=L.length,dt=!!W;for(var Z in m)Ht.call(m,Z)&&!(dt&&(Z=="length"||Hs(Z,W)))&&L.push(Z);return L}function Ri(m,k){for(var L=m.length;L--;)if(co(m[L][0],k))return L;return-1}var zl=Xl();function Bl(m,k){return m&&zl(m,k,li)}function Ii(m,k){k=Fi(k,m)?[k]:Xe(k);for(var L=0,W=k.length;m!=null&&L<W;)m=m[hn(k[L++])];return L&&L==W?m:void 0}function Hl(m){return _e.call(m)}function Wl(m,k){return m!=null&&k in Object(m)}function Bs(m,k,L,W,dt){return m===k?!0:m==null||k==null||!Kt(m)&&!xe(k)?m!==m&&k!==k:Yl(m,k,Bs,L,W,dt)}function Yl(m,k,L,W,dt,Z){var bt=w(m),Zt=w(k),Wt=c,ce=c;bt||(Wt=le(m),Wt=Wt==l?v:Wt),Zt||(ce=le(k),ce=ce==l?v:ce);var we=Wt==v&&!qt(m),ve=ce==v&&!qt(k),fe=Wt==ce;if(fe&&!we)return Z||(Z=new Ee),bt||ho(m)?oo(m,k,L,W,dt,Z):Gl(m,k,Wt,L,W,dt,Z);if(!(dt&o)){var Ae=we&&Ht.call(m,"__wrapped__"),Re=ve&&Ht.call(k,"__wrapped__");if(Ae||Re){var Nn=Ae?m.value():m,gn=Re?k.value():k;return Z||(Z=new Ee),L(Nn,gn,W,dt,Z)}}return fe?(Z||(Z=new Ee),Kl(m,k,L,W,dt,Z)):!1}function jl(m,k,L,W){var dt=L.length,Z=dt;if(m==null)return!Z;for(m=Object(m);dt--;){var bt=L[dt];if(bt[2]?bt[1]!==m[bt[0]]:!(bt[0]in m))return!1}for(;++dt<Z;){bt=L[dt];var Zt=bt[0],Wt=m[Zt],ce=bt[1];if(bt[2]){if(Wt===void 0&&!(Zt in m))return!1}else{var we=new Ee,ve;if(!(ve===void 0?Bs(ce,Wt,W,r|o,we):ve))return!1}}return!0}function $l(m){if(!Kt(m)||ao(m))return!1;var k=X(m)||qt(m)?ii:mt;return k.test(fn(m))}function Vl(m){return xe(m)&&$t(m.length)&&!!ft[_e.call(m)]}function so(m){return typeof m=="function"?m:m==null?zi:typeof m=="object"?w(m)?Li(m[0],m[1]):ql(m):hT(m)}function Ul(m){if(!Jl(m))return Is(m);var k=[];for(var L in Object(m))Ht.call(m,L)&&L!="constructor"&&k.push(L);return k}function ql(m){var k=Zl(m);return k.length==1&&k[0][2]?Ys(k[0][0],k[0][1]):function(L){return L===m||jl(L,m,k)}}function Li(m,k){return Fi(m)&&lo(k)?Ys(hn(m),k):function(L){var W=fo(L,m);return W===void 0&&W===k?go(L,m):Bs(k,W,void 0,r|o)}}function In(m){return function(k){return Ii(k,m)}}function ro(m){if(typeof m=="string")return m;if(ee(m))return io?io.call(m):"";var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function Xe(m){return w(m)?m:tc(m)}function Xl(m){return function(k,L,W){for(var dt=-1,Z=Object(k),bt=W(k),Zt=bt.length;Zt--;){var Wt=bt[++dt];if(L(Z[Wt],Wt,Z)===!1)break}return k}}function oo(m,k,L,W,dt,Z){var bt=dt&o,Zt=m.length,Wt=k.length;if(Zt!=Wt&&!(bt&&Wt>Zt))return!1;var ce=Z.get(m);if(ce&&Z.get(k))return ce==k;var we=-1,ve=!0,fe=dt&r?new Ei:void 0;for(Z.set(m,k),Z.set(k,m);++we<Zt;){var Ae=m[we],Re=k[we];if(W)var Nn=bt?W(Re,Ae,we,k,m,Z):W(Ae,Re,we,m,k,Z);if(Nn!==void 0){if(Nn)continue;ve=!1;break}if(fe){if(!_t(k,function(gn,ci){if(!fe.has(ci)&&(Ae===gn||L(Ae,gn,W,dt,Z)))return fe.add(ci)})){ve=!1;break}}else if(!(Ae===Re||L(Ae,Re,W,dt,Z))){ve=!1;break}}return Z.delete(m),Z.delete(k),ve}function Gl(m,k,L,W,dt,Z,bt){switch(L){case x:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case b:return!(m.byteLength!=k.byteLength||!W(new to(m),new to(k)));case u:case d:case _:return co(+m,+k);case f:return m.name==k.name&&m.message==k.message;case D:case T:return m==k+"";case y:var Zt=Oe;case S:var Wt=Z&o;if(Zt||(Zt=Xt),m.size!=k.size&&!Wt)return!1;var ce=bt.get(m);if(ce)return ce==k;Z|=r,bt.set(m,k);var we=oo(Zt(m),Zt(k),W,dt,Z,bt);return bt.delete(m),we;case R:if(Fs)return Fs.call(m)==Fs.call(k)}return!1}function Kl(m,k,L,W,dt,Z){var bt=dt&o,Zt=li(m),Wt=Zt.length,ce=li(k),we=ce.length;if(Wt!=we&&!bt)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(bt?fe in k:Ht.call(k,fe)))return!1}var Ae=Z.get(m);if(Ae&&Z.get(k))return Ae==k;var Re=!0;Z.set(m,k),Z.set(k,m);for(var Nn=bt;++ve<Wt;){fe=Zt[ve];var gn=m[fe],ci=k[fe];if(W)var hg=bt?W(ci,gn,fe,k,m,Z):W(gn,ci,fe,m,k,Z);if(!(hg===void 0?gn===ci||L(gn,ci,W,dt,Z):hg)){Re=!1;break}Nn||(Nn=fe=="constructor")}if(Re&&!Nn){var po=m.constructor,mo=k.constructor;po!=mo&&"constructor"in m&&"constructor"in k&&!(typeof po=="function"&&po instanceof po&&typeof mo=="function"&&mo instanceof mo)&&(Re=!1)}return Z.delete(m),Z.delete(k),Re}function Ni(m,k){var L=m.__data__;return Ws(k)?L[typeof k=="string"?"string":"hash"]:L.map}function Zl(m){for(var k=li(m),L=k.length;L--;){var W=k[L],dt=m[W];k[L]=[W,dt,lo(dt)]}return k}function dn(m,k){var L=ae(m,k);return $l(L)?L:void 0}var le=Hl;(ri&&le(new ri(new ArrayBuffer(1)))!=x||an&&le(new an)!=y||ln&&le(ln.resolve())!=M||Ls&&le(new Ls)!=S||Ns&&le(new Ns)!=E)&&(le=function(m){var k=_e.call(m),L=k==v?m.constructor:void 0,W=L?fn(L):void 0;if(W)switch(W){case bl:return x;case _l:return y;case eo:return M;case no:return S;case cn:return E}return k});function Ql(m,k,L){k=Fi(k,m)?[k]:Xe(k);for(var W,dt=-1,bt=k.length;++dt<bt;){var Z=hn(k[dt]);if(!(W=m!=null&&L(m,Z)))break;m=m[Z]}if(W)return W;var bt=m?m.length:0;return!!bt&&$t(bt)&&Hs(Z,bt)&&(w(m)||uo(m))}function Hs(m,k){return k=k??a,!!k&&(typeof m=="number"||vt.test(m))&&m>-1&&m%1==0&&m<k}function Fi(m,k){if(w(m))return!1;var L=typeof m;return L=="number"||L=="symbol"||L=="boolean"||m==null||ee(m)?!0:K.test(m)||!V.test(m)||k!=null&&m in Object(k)}function Ws(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function ao(m){return!!ni&&ni in m}function Jl(m){var k=m&&m.constructor,L=typeof k=="function"&&k.prototype||ie;return m===L}function lo(m){return m===m&&!Kt(m)}function Ys(m,k){return function(L){return L==null?!1:L[m]===k&&(k!==void 0||m in Object(L))}}var tc=ai(function(m){m=Ln(m);var k=[];return B.test(m)&&k.push(""),m.replace(j,function(L,W,dt,Z){k.push(dt?Z.replace(xt,"$1"):W||L)}),k});function hn(m){if(typeof m=="string"||ee(m))return m;var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function fn(m){if(m!=null){try{return Ne.call(m)}catch{}try{return m+""}catch{}}return""}function ai(m,k){if(typeof m!="function"||k&&typeof k!="function")throw new TypeError(i);var L=function(){var W=arguments,dt=k?k.apply(this,W):W[0],Z=L.cache;if(Z.has(dt))return Z.get(dt);var bt=m.apply(this,W);return L.cache=Z.set(dt,bt),bt};return L.cache=new(ai.Cache||Be),L}ai.Cache=Be;function co(m,k){return m===k||m!==m&&k!==k}function uo(m){return N(m)&&Ht.call(m,"callee")&&(!Rs.call(m,"callee")||_e.call(m)==l)}var w=Array.isArray;function A(m){return m!=null&&$t(m.length)&&!X(m)}function N(m){return xe(m)&&A(m)}function X(m){var k=Kt(m)?_e.call(m):"";return k==g||k==p}function $t(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=a}function Kt(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function xe(m){return!!m&&typeof m=="object"}function ee(m){return typeof m=="symbol"||xe(m)&&_e.call(m)==R}var ho=nt?te(nt):Vl;function Ln(m){return m==null?"":ro(m)}function fo(m,k,L){var W=m==null?void 0:Ii(m,k);return W===void 0?L:W}function go(m,k){return m!=null&&Ql(m,k,Wl)}function li(m){return A(m)?Fl(m):Ul(m)}function js(m,k){var L={};return k=so(k),Bl(m,function(W,dt,Z){L[k(W,dt,Z)]=W}),L}function zi(m){return m}function hT(m){return Fi(m)?at(hn(m)):In(m)}n.exports=js}(Qr,Qr.exports);var DS=Qr.exports;const SS=za(DS);var TS=9007199254740991,CS="[object Arguments]",PS="[object Function]",OS="[object GeneratorFunction]",ES="[object Symbol]",AS=typeof be=="object"&&be&&be.Object===Object&&be,RS=typeof self=="object"&&self&&self.Object===Object&&self,IS=AS||RS||Function("return this")();function LS(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 NS(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 FS(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,zS=ml.hasOwnProperty,yl=ml.toString,sg=IS.Symbol,BS=ml.propertyIsEnumerable,rg=sg?sg.isConcatSpreadable:void 0,og=Math.max;function HS(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=$S),s||(s=[]);++r<o;){var a=n[r];e(a)?FS(s,a):s[s.length]=a}return s}function WS(n,t){return n=Object(n),YS(n,t,function(e,i){return i in n})}function YS(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 jS(n,t){return t=og(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=og(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,LS(n,this,o)}}function $S(n){return qS(n)||US(n)||!!(rg&&n&&n[rg])}function VS(n){if(typeof n=="string"||JS(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function US(n){return GS(n)&&zS.call(n,"callee")&&(!BS.call(n,"callee")||yl.call(n)==CS)}var qS=Array.isArray;function XS(n){return n!=null&&ZS(n.length)&&!KS(n)}function GS(n){return ag(n)&&XS(n)}function KS(n){var t=QS(n)?yl.call(n):"";return t==PS||t==OS}function ZS(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=TS}function QS(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function ag(n){return!!n&&typeof n=="object"}function JS(n){return typeof n=="symbol"||ag(n)&&yl.call(n)==ES}var tT=jS(function(n,t){return n==null?{}:WS(n,NS(HS(t),VS))}),eT=tT;const nT=za(eT);var lg={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function 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 be=="object"&&be.global===be?be: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 f=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=f.createObjectURL(c),setTimeout(function(){f.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 f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||g&&p||a)&&typeof FileReader<"u"){var _=new FileReader;_.onloadend=function(){var D=_.result;D=y?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},_.readAsDataURL(c)}else{var v=o.URL||o.webkitURL,M=v.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){v.revokeObjectURL(M)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(lg);var iT=lg.exports,cg={exports:{}};/* @license
29
29
  Papa Parse
30
30
  v5.5.3
31
31
  https://github.com/mholt/PapaParse
@@ -39,5 +39,5 @@ License: MIT
39
39
  `&&(P=`
40
40
  `);var V=0,K=!1;this.parse=function(B,j,H){if(typeof B!="string")throw new Error("Input must be a string");var xt=B.length,mt=x.length,vt=P.length,ft=I.length,gt=E(C),z=[],$=[],Y=[],Q=V=0;if(!B)return Mt();if(q||q!==!1&&B.indexOf(U)===-1){for(var tt=B.split(P),et=0;et<tt.length;et++){if(Y=tt[et],V+=Y.length,et!==tt.length-1)V+=P.length;else if(H)return Mt();if(!I||Y.substring(0,ft)!==I){if(gt){if(z=[],te(Y.split(x)),Xt(),K)return Mt()}else te(Y.split(x));if(F&&F<=et)return z=z.slice(0,F),Mt(!0)}}return Mt()}for(var it=B.indexOf(x,V),nt=B.indexOf(P,V),_t=new RegExp(_(ut)+_(U),"g"),at=B.indexOf(U,V);;)if(B[V]===U)for(at=V,V++;;){if((at=B.indexOf(U,at+1))===-1)return H||$.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:V}),qt();if(at===xt-1)return qt(B.substring(V,at).replace(_t,U));if(U===ut&&B[at+1]===ut)at++;else if(U===ut||at===0||B[at-1]!==ut){it!==-1&&it<at+1&&(it=B.indexOf(x,at+1));var Pt=ae((nt=nt!==-1&&nt<at+1?B.indexOf(P,at+1):nt)===-1?it:Math.min(it,nt));if(B.substr(at+1+Pt,mt)===x){Y.push(B.substring(V,at).replace(_t,U)),B[V=at+1+Pt+mt]!==U&&(at=B.indexOf(U,V)),it=B.indexOf(x,V),nt=B.indexOf(P,V);break}if(Pt=ae(nt),B.substring(at+1+Pt,at+1+Pt+vt)===P){if(Y.push(B.substring(V,at).replace(_t,U)),Oe(at+1+Pt+vt),it=B.indexOf(x,V),at=B.indexOf(U,V),gt&&(Xt(),K))return Mt();if(F&&z.length>=F)return Mt(!0);break}$.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:V}),at++}}else if(I&&Y.length===0&&B.substring(V,V+ft)===I){if(nt===-1)return Mt();V=nt+vt,nt=B.indexOf(P,V),it=B.indexOf(x,V)}else if(it!==-1&&(it<nt||nt===-1))Y.push(B.substring(V,it)),V=it+mt,it=B.indexOf(x,V);else{if(nt===-1)break;if(Y.push(B.substring(V,nt)),Oe(nt+vt),gt&&(Xt(),K))return Mt();if(F&&z.length>=F)return Mt(!0)}return qt();function te(Bt){z.push(Bt),Q=V}function ae(Bt){var Gt=0;return Gt=Bt!==-1&&(Bt=B.substring(at+1,Bt))&&Bt.trim()===""?Bt.length:Gt}function qt(Bt){return H||(Bt===void 0&&(Bt=B.substring(V)),Y.push(Bt),V=xt,te(Y),gt&&Xt()),Mt()}function Oe(Bt){V=Bt,te(Y),Y=[],nt=B.indexOf(P,V)}function Mt(Bt){if(b.header&&!j&&z.length&&!J){var Gt=z[0],ie=Object.create(null),qe=new Set(Gt);let ni=!1;for(let Ne=0;Ne<Gt.length;Ne++){let Ht=Gt[Ne];if(ie[Ht=E(b.transformHeader)?b.transformHeader(Ht,Ne):Ht]){let _e,ii=ie[Ht];for(;_e=Ht+"_"+ii,ii++,qe.has(_e););qe.add(_e),Gt[Ne]=_e,ie[Ht]++,ni=!0,(G=G===null?{}:G)[_e]=Ht}else ie[Ht]=1,Gt[Ne]=Ht;qe.add(Ht)}ni&&console.warn("Duplicate headers found and renamed."),J=!0}return{data:z,errors:$,meta:{delimiter:x,linebreak:P,aborted:K,truncated:!!Bt,cursor:Q+(j||0),renamedHeaders:G}}}function Xt(){C(Mt()),z=[],$=[]}},this.abort=function(){K=!0},this.getCharIndex=function(){return V}}function M(b){var x=b.data,P=a[x.workerId],I=!1;if(x.error)P.userError(x.error,x.file);else if(x.results&&x.results.data){var C={abort:function(){I=!0,D(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(E(P.userStep)){for(var F=0;F<x.results.data.length&&(P.userStep({data:x.results.data[F],errors:x.results.errors,meta:x.results.meta},C),!I);F++);delete x.results}else E(P.userChunk)&&(P.userChunk(x.results,C,x.file),delete x.results)}x.finished&&!I&&D(x.workerId,x.results)}function D(b,x){var P=a[b];E(P.userComplete)&&P.userComplete(x),P.terminate(),delete a[b]}function S(){throw new Error("Not implemented.")}function T(b){if(typeof b!="object"||b===null)return b;var x,P=Array.isArray(b)?[]:{};for(x in b)P[x]=T(b[x]);return P}function R(b,x){return function(){b.apply(x,arguments)}}function E(b){return typeof b=="function"}return c.parse=function(b,x){var P=(x=x||{}).dynamicTyping||!1;if(E(P)&&(x.dynamicTypingFunction=P,P={}),x.dynamicTyping=P,x.transform=!!E(x.transform)&&x.transform,!x.worker||!c.WORKERS_SUPPORTED)return P=null,c.NODE_STREAM_INPUT,typeof b=="string"?(b=(I=>I.charCodeAt(0)!==65279?I:I.slice(1))(b),P=new(x.download?d:g)(x)):b.readable===!0&&E(b.read)&&E(b.on)?P=new p(x):(i.File&&b instanceof File||b instanceof Object)&&(P=new f(x)),P.stream(b);(P=(()=>{var I;return!!c.WORKERS_SUPPORTED&&(I=(()=>{var C=i.URL||i.webkitURL||null,F=e.toString();return c.BLOB_URL||(c.BLOB_URL=C.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; ","(",F,")();"],{type:"text/javascript"})))})(),(I=new i.Worker(I)).onmessage=M,I.id=l++,a[I.id]=I)})()).userStep=x.step,P.userChunk=x.chunk,P.userComplete=x.complete,P.userError=x.error,x.step=E(x.step),x.chunk=E(x.chunk),x.complete=E(x.complete),x.error=E(x.error),delete x.worker,P.postMessage({input:b,config:x,workerId:P.id})},c.unparse=function(b,x){var P=!1,I=!0,C=",",F=`\r
41
41
  `,q='"',G=q+q,J=!1,U=null,ut=!1,V=((()=>{if(typeof x=="object"){if(typeof x.delimiter!="string"||c.BAD_DELIMITERS.filter(function(j){return x.delimiter.indexOf(j)!==-1}).length||(C=x.delimiter),typeof x.quotes!="boolean"&&typeof x.quotes!="function"&&!Array.isArray(x.quotes)||(P=x.quotes),typeof x.skipEmptyLines!="boolean"&&typeof x.skipEmptyLines!="string"||(J=x.skipEmptyLines),typeof x.newline=="string"&&(F=x.newline),typeof x.quoteChar=="string"&&(q=x.quoteChar),typeof x.header=="boolean"&&(I=x.header),Array.isArray(x.columns)){if(x.columns.length===0)throw new Error("Option columns is empty");U=x.columns}x.escapeChar!==void 0&&(G=x.escapeChar+q),x.escapeFormulae instanceof RegExp?ut=x.escapeFormulae:typeof x.escapeFormulae=="boolean"&&x.escapeFormulae&&(ut=/^[=+\-@\t\r].*$/)}})(),new RegExp(_(q),"g"));if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return K(null,b,J);if(typeof b[0]=="object")return K(U||Object.keys(b[0]),b,J)}else if(typeof b=="object")return typeof b.data=="string"&&(b.data=JSON.parse(b.data)),Array.isArray(b.data)&&(b.fields||(b.fields=b.meta&&b.meta.fields||U),b.fields||(b.fields=Array.isArray(b.data[0])?b.fields:typeof b.data[0]=="object"?Object.keys(b.data[0]):[]),Array.isArray(b.data[0])||typeof b.data[0]=="object"||(b.data=[b.data])),K(b.fields||[],b.data||[],J);throw new Error("Unable to serialize unrecognized input");function K(j,H,xt){var mt="",vt=(typeof j=="string"&&(j=JSON.parse(j)),typeof H=="string"&&(H=JSON.parse(H)),Array.isArray(j)&&0<j.length),ft=!Array.isArray(H[0]);if(vt&&I){for(var gt=0;gt<j.length;gt++)0<gt&&(mt+=C),mt+=B(j[gt],gt);0<H.length&&(mt+=F)}for(var z=0;z<H.length;z++){var $=(vt?j:H[z]).length,Y=!1,Q=vt?Object.keys(H[z]).length===0:H[z].length===0;if(xt&&!vt&&(Y=xt==="greedy"?H[z].join("").trim()==="":H[z].length===1&&H[z][0].length===0),xt==="greedy"&&vt){for(var tt=[],et=0;et<$;et++){var it=ft?j[et]:et;tt.push(H[z][it])}Y=tt.join("").trim()===""}if(!Y){for(var nt=0;nt<$;nt++){0<nt&&!Q&&(mt+=C);var _t=vt&&ft?j[nt]:nt;mt+=B(H[z][_t],nt)}z<H.length-1&&(!xt||0<$&&!Q)&&(mt+=F)}}return mt}function B(j,H){var xt,mt;return j==null?"":j.constructor===Date?JSON.stringify(j).slice(1,25):(mt=!1,ut&&typeof j=="string"&&ut.test(j)&&(j="'"+j,mt=!0),xt=j.toString().replace(V,G),(mt=mt||P===!0||typeof P=="function"&&P(j,H)||Array.isArray(P)&&P[H]||((vt,ft)=>{for(var gt=0;gt<ft.length;gt++)if(-1<vt.indexOf(ft[gt]))return!0;return!1})(xt,c.BAD_DELIMITERS)||-1<xt.indexOf(C)||xt.charAt(0)===" "||xt.charAt(xt.length-1)===" ")?q+xt+q:xt)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
42
- `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=y,c.NetworkStreamer=d,c.FileStreamer=f,c.StringStreamer=g,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(b){var x=b.config||{},P=[];return this.each(function(F){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var q=0;q<this.files.length;q++)P.push({file:this.files[q],inputElem:this,instanceConfig:s.extend({},x)})}),I(),this;function I(){if(P.length===0)E(b.complete)&&b.complete();else{var F,q,G,J,U=P[0];if(E(b.before)){var ut=b.before(U.file,U.inputElem);if(typeof ut=="object"){if(ut.action==="abort")return F="AbortError",q=U.file,G=U.inputElem,J=ut.reason,void(E(b.error)&&b.error({name:F},q,G,J));if(ut.action==="skip")return void C();typeof ut.config=="object"&&(U.instanceConfig=s.extend(U.instanceConfig,ut.config))}else if(ut==="skip")return void C()}var V=U.instanceConfig.complete;U.instanceConfig.complete=function(K){E(V)&&V(K,U.file,U.inputElem),C()},c.parse(U.file,U.instanceConfig)}}function C(){P.splice(0,1),I()}}),o&&(i.onmessage=function(b){b=b.data,c.WORKER_ID===void 0&&b&&(c.WORKER_ID=b.workerId),typeof b.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(b.input,b.config),finished:!0}):(i.File&&b.input instanceof File||b.input instanceof Object)&&(b=c.parse(b.input,b.config))&&i.postMessage({workerId:c.WORKER_ID,results:b,finished:!0})}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,c})})(ug);var oT=ug.exports;const aT=["id"],lT=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,s=h.computed(()=>`export_${new Date().getTime()}`),r=h.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==ei.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ei.Object?d=>CS(d,(f,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==ei.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>sT(d,u):d=>d},l=()=>{if(typeof i.fields===ei.Undefined&&typeof i.labels===ei.Undefined)return i.data;const u=o(),d=a();return i.data.map(f=>u(d(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=oT.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});rT.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,aT))}}),cT=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,s)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(lT,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),uT={class:"kong-ui-public-csv-export-modal"},dT={key:0,class:"selected-range"},hT={key:1,class:"text-muted",tag:"span"},dg=3,fT=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=yt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=h.ref(!0),a=h.computed(()=>{var y,_;return!!((_=(y=i.chartData)==null?void 0:y.data)!=null&&_.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=yt.useChartSelectedRange(h.toRef(i,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(dg,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{s("toggleModal",!1)},g=h.computed(()=>{var T,R,E;if(!a.value||!((T=i.chartData)!=null&&T.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const y=i.chartData.data.some(b=>b.timestamp!==i.chartData.data[0].timestamp),_=i.chartData.data.map(b=>{const x=new Date(b.timestamp);return{...Object.keys(b.event).reduce((I,C)=>{if(C in i.chartData.meta.display){const F=b.event[C],q=i.chartData.meta.display[C];I[C]=F&&q&&q[F].name||b.event[C]}else I[C]=b.event[C];return I},{}),...y?{timestamp:za(x,"yyyy-MM-dd HH:mm:ss"),tzOffset:za(x,"XXX")}:{}}});let v=[];y&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.chartData.meta&&((R=i.chartData.meta)!=null&&R.display)?(E=i.chartData.meta)==null?void 0:E.display:{},D=[...v,...Object.keys(M).map(b=>({label:e.t(`chartLabels.${b}`),key:b})),...i.chartData.meta.metric_names.map(b=>({label:e.t(`chartLabels.${b}`),key:b}))],S=D.reduce((b,x)=>(b[x.key]=x.label,b),{});return{headers:D,csvHeaders:S,rows:_}}),p=async()=>{const{rows:y}=g.value;return o.value=!1,{total:Number(y.length)||0,data:y.slice(0,dg)}};return h.watch(g,()=>{l.value++}),(y,_)=>{const v=h.resolveComponent("KEmptyState"),M=h.resolveComponent("KTableData"),D=h.resolveComponent("KButton"),S=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",uT,[h.createVNode(S,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:h.withKeys(f,["esc"])},{default:h.withCtx(()=>{var T;return[h.createElementVNode("div",null,[a.value?(h.openBlock(),h.createElementBlock("div",dT,[h.createElementVNode("p",null,h.toDisplayString(y.modalDescription?y.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(h.unref(u)),1)])):h.createCommentVNode("",!0),h.createVNode(M,{class:"vitals-table",fetcher:p,"fetcher-cache-key":String(l.value),headers:((T=g.value)==null?void 0:T.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":h.withCtx(()=>[h.createVNode(v,{"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),default:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(h.openBlock(),h.createElementBlock("div",hT,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(cT,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});ot.AnalyticsChart=nS,ot.ChartLegendPosition=Nt,ot.CsvExportModal=fT,ot.DECIMAL_DISPLAY=ow,ot.EMPTY_COLOR=nh,ot.FONT_SIZE_REGULAR=Zd,ot.FONT_SIZE_SMALL=Kd,ot.MAX_LABEL_LENGTH=Er,ot.OTHERS_COLOR=dw,ot.SimpleChart=gS,ot.TopNTable=SS,ot.ValidType=ei,ot.accessibleGrey=th,ot.apiRequestStatusCodeColors=eh,ot.chartTypes=XD,ot.codesInSpec=oh,ot.darkenColor=Jd,ot.datavisPalette=sn,ot.defaultStatusCodeColors=Rr,ot.determineBaseColor=Sa,ot.errorRateColors=cw,ot.latencyColors=uw,ot.lightGrey=Pa,ot.lookupColor=hw,ot.lookupDatavisColor=Ar,ot.lookupStatusCodeCategoryColor=_w,ot.lookupStatusCodeColor=Oa,ot.numberFormatter=Da,ot.simpleChartMetricDisplay=qD,ot.simpleChartTypes=GD,ot.statusCodeBadgeBackgroundColor=aw,ot.trafficColors=lw,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
42
+ `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=y,c.NetworkStreamer=d,c.FileStreamer=f,c.StringStreamer=g,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(b){var x=b.config||{},P=[];return this.each(function(F){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var q=0;q<this.files.length;q++)P.push({file:this.files[q],inputElem:this,instanceConfig:s.extend({},x)})}),I(),this;function I(){if(P.length===0)E(b.complete)&&b.complete();else{var F,q,G,J,U=P[0];if(E(b.before)){var ut=b.before(U.file,U.inputElem);if(typeof ut=="object"){if(ut.action==="abort")return F="AbortError",q=U.file,G=U.inputElem,J=ut.reason,void(E(b.error)&&b.error({name:F},q,G,J));if(ut.action==="skip")return void C();typeof ut.config=="object"&&(U.instanceConfig=s.extend(U.instanceConfig,ut.config))}else if(ut==="skip")return void C()}var V=U.instanceConfig.complete;U.instanceConfig.complete=function(K){E(V)&&V(K,U.file,U.inputElem),C()},c.parse(U.file,U.instanceConfig)}}function C(){P.splice(0,1),I()}}),o&&(i.onmessage=function(b){b=b.data,c.WORKER_ID===void 0&&b&&(c.WORKER_ID=b.workerId),typeof b.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(b.input,b.config),finished:!0}):(i.File&&b.input instanceof File||b.input instanceof Object)&&(b=c.parse(b.input,b.config))&&i.postMessage({workerId:c.WORKER_ID,results:b,finished:!0})}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,c})})(cg);var sT=cg.exports;const rT=["id"],oT=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,s=h.computed(()=>`export_${new Date().getTime()}`),r=h.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==ei.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ei.Object?d=>SS(d,(f,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==ei.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>nT(d,u):d=>d},l=()=>{if(typeof i.fields===ei.Undefined&&typeof i.labels===ei.Undefined)return i.data;const u=o(),d=a();return i.data.map(f=>u(d(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=sT.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});iT.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,rT))}}),aT=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,s)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(oT,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),lT={class:"kong-ui-public-csv-export-modal"},cT={key:0,class:"selected-range"},uT={key:1,class:"text-muted",tag:"span"},ug=3,dT=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=yt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=h.ref(!0),a=h.computed(()=>{var y,_;return!!((_=(y=i.chartData)==null?void 0:y.data)!=null&&_.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=yt.useChartSelectedRange(h.toRef(i,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ug,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{s("toggleModal",!1)},g=h.computed(()=>{var T,R,E;if(!a.value||!((T=i.chartData)!=null&&T.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const y=i.chartData.data.some(b=>b.timestamp!==i.chartData.data[0].timestamp),_=i.chartData.data.map(b=>{const x=new Date(b.timestamp);return{...Object.keys(b.event).reduce((I,C)=>{if(C in i.chartData.meta.display){const F=b.event[C],q=i.chartData.meta.display[C];I[C]=F&&q&&q[F].name||b.event[C]}else I[C]=b.event[C];return I},{}),...y?{timestamp:Fa(x,"yyyy-MM-dd HH:mm:ss"),tzOffset:Fa(x,"XXX")}:{}}});let v=[];y&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.chartData.meta&&((R=i.chartData.meta)!=null&&R.display)?(E=i.chartData.meta)==null?void 0:E.display:{},D=[...v,...Object.keys(M).map(b=>({label:e.t(`chartLabels.${b}`),key:b})),...i.chartData.meta.metric_names.map(b=>({label:e.t(`chartLabels.${b}`),key:b}))],S=D.reduce((b,x)=>(b[x.key]=x.label,b),{});return{headers:D,csvHeaders:S,rows:_}}),p=async()=>{const{rows:y}=g.value;return o.value=!1,{total:Number(y.length)||0,data:y.slice(0,ug)}};return h.watch(g,()=>{l.value++}),(y,_)=>{const v=h.resolveComponent("KEmptyState"),M=h.resolveComponent("KTableData"),D=h.resolveComponent("KButton"),S=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",lT,[h.createVNode(S,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:h.withKeys(f,["esc"])},{default:h.withCtx(()=>{var T;return[h.createElementVNode("div",null,[a.value?(h.openBlock(),h.createElementBlock("div",cT,[h.createElementVNode("p",null,h.toDisplayString(y.modalDescription?y.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(h.unref(u)),1)])):h.createCommentVNode("",!0),h.createVNode(M,{class:"vitals-table",fetcher:p,"fetcher-cache-key":String(l.value),headers:((T=g.value)==null?void 0:T.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":h.withCtx(()=>[h.createVNode(v,{"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),default:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(h.openBlock(),h.createElementBlock("div",uT,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(aT,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});ot.AnalyticsChart=tS,ot.ChartLegendPosition=Nt,ot.CsvExportModal=dT,ot.DECIMAL_DISPLAY=rw,ot.EMPTY_COLOR=eh,ot.FONT_SIZE_REGULAR=Kd,ot.FONT_SIZE_SMALL=Gd,ot.MAX_LABEL_LENGTH=Er,ot.OTHERS_COLOR=uw,ot.SimpleChart=hS,ot.TopNTable=kS,ot.ValidType=ei,ot.accessibleGrey=Jd,ot.apiRequestStatusCodeColors=th,ot.chartTypes=UD,ot.codesInSpec=rh,ot.darkenColor=Qd,ot.datavisPalette=sn,ot.defaultStatusCodeColors=Rr,ot.determineBaseColor=Da,ot.errorRateColors=lw,ot.latencyColors=cw,ot.lightGrey=Ca,ot.lookupColor=dw,ot.lookupDatavisColor=Ar,ot.lookupStatusCodeCategoryColor=bw,ot.lookupStatusCodeColor=Pa,ot.numberFormatter=ka,ot.simpleChartMetricDisplay=VD,ot.simpleChartTypes=qD,ot.statusCodeBadgeBackgroundColor=ow,ot.trafficColors=aw,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});