@kong-ui-public/analytics-chart 10.7.13 → 10.7.14-pr.2603.7ce4d8bd2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vitals-chart.umd.js +10 -10
- package/package.json +2 -2
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
(function(ot,d){typeof exports=="object"&&typeof module<"u"?d(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"],d):(ot=typeof globalThis<"u"?globalThis:ot||self,d(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,d,zn,Js){"use strict";var kC=Object.defineProperty;var DC=(ot,d,zn)=>d in ot?kC(ot,d,{enumerable:!0,configurable:!0,writable:!0,value:zn}):ot[d]=zn;var P=(ot,d,zn)=>DC(ot,typeof d!="symbol"?d+"":d,zn);var Rn;const Ym={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:{dataError:"Error loading data",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.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",ai_plugin:"AI plugin",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)",response_source:"Response source",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",control_plane_group:"Control plane group",consumer:"Consumer",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",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-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count"},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",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function Vm(){const n=zn.createI18n("en-us",Ym);return{i18n:n,i18nT:zn.i18nTComponent(n)}}/*!
|
|
1
|
+
(function(ot,d){typeof exports=="object"&&typeof module<"u"?d(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"],d):(ot=typeof globalThis<"u"?globalThis:ot||self,d(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,d,zn,Js){"use strict";var kC=Object.defineProperty;var TC=(ot,d,zn)=>d in ot?kC(ot,d,{enumerable:!0,configurable:!0,writable:!0,value:zn}):ot[d]=zn;var P=(ot,d,zn)=>TC(ot,typeof d!="symbol"?d+"":d,zn);var Rn;const Ym={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:{dataError:"Error loading data",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.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",ai_plugin:"AI plugin",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)",response_source:"Response source",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",control_plane_group:"Control plane group",consumer:"Consumer",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",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-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count"},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",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function Vm(){const n=zn.createI18n("en-us",Ym);return{i18n:n,i18nT:zn.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 Yi(n){return n+.5|0}const yn=(n,t,e)=>Math.max(Math.min(n,e),t);function Vi(n){return yn(Yi(n*2.55),0,255)}function bn(n){return yn(Yi(n*255),0,255)}function Ke(n){return yn(Yi(n/2.55)/100,0,1)}function wc(n){return yn(Yi(n*100),0,100)}const Ee={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},Oa=[..."0123456789ABCDEF"],jm=n=>Oa[n&15],$m=n=>Oa[(n&240)>>4]+Oa[n&15],tr=n=>(n&240)>>4===(n&15),Um=n=>tr(n.r)&&tr(n.g)&&tr(n.b)&&tr(n.a);function qm(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Ee[n[1]]*17,g:255&Ee[n[2]]*17,b:255&Ee[n[3]]*17,a:t===5?Ee[n[4]]*17:255}:(t===7||t===9)&&(e={r:Ee[n[1]]<<4|Ee[n[2]],g:Ee[n[3]]<<4|Ee[n[4]],b:Ee[n[5]]<<4|Ee[n[6]],a:t===9?Ee[n[7]]<<4|Ee[n[8]]:255})),e}const Xm=(n,t)=>n<255?t(n):"";function Gm(n){var t=Um(n)?jm:$m;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Xm(n.a,t):void 0}const Km=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function vc(n,t,e){const i=t*Math.min(e,1-e),s=(r,a=(r+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Zm(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 Qm(n,t,e){const i=vc(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 Jm(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 Pa(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),a=Math.min(e,i,s),o=(r+a)/2;let l,c,u;return r!==a&&(u=r-a,c=o>.5?u/(2-r-a):u/(r+a),l=Jm(e,i,s,u,r),l=l*60+.5),[l|0,c||0,o]}function Aa(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(bn)}function Ra(n,t,e){return Aa(vc,n,t,e)}function tg(n,t,e){return Aa(Qm,n,t,e)}function eg(n,t,e){return Aa(Zm,n,t,e)}function Mc(n){return(n%360+360)%360}function ng(n){const t=Km.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Vi(+t[5]):bn(+t[5]));const s=Mc(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=tg(s,r,a):t[1]==="hsv"?i=eg(s,r,a):i=Ra(s,r,a),{r:i[0],g:i[1],b:i[2],a:e}}function ig(n,t){var e=Pa(n);e[0]=Mc(e[0]+t),e=Ra(e),n.r=e[0],n.g=e[1],n.b=e[2]}function sg(n){if(!n)return;const t=Pa(n),e=t[0],i=wc(t[1]),s=wc(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ke(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Sc={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"},kc={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 rg(){const n={},t=Object.keys(kc),e=Object.keys(Sc);let i,s,r,a,o;for(i=0;i<t.length;i++){for(a=o=t[i],s=0;s<e.length;s++)r=e[s],o=o.replace(r,Sc[r]);r=parseInt(kc[a],16),n[o]=[r>>16&255,r>>8&255,r&255]}return n}let er;function ag(n){er||(er=rg(),er.transparent=[0,0,0,0]);const t=er[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const og=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function lg(n){const t=og.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Vi(a):yn(a*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Vi(i):yn(i,0,255)),s=255&(t[4]?Vi(s):yn(s,0,255)),r=255&(t[6]?Vi(r):yn(r,0,255)),{r:i,g:s,b:r,a:e}}}function cg(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ke(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Ia=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function ug(n,t,e){const i=hi(Ke(n.r)),s=hi(Ke(n.g)),r=hi(Ke(n.b));return{r:bn(Ia(i+e*(hi(Ke(t.r))-i))),g:bn(Ia(s+e*(hi(Ke(t.g))-s))),b:bn(Ia(r+e*(hi(Ke(t.b))-r))),a:n.a+e*(t.a-n.a)}}function nr(n,t,e){if(n){let i=Pa(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Ra(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function
|
|
6
|
+
*/function Yi(n){return n+.5|0}const yn=(n,t,e)=>Math.max(Math.min(n,e),t);function Vi(n){return yn(Yi(n*2.55),0,255)}function bn(n){return yn(Yi(n*255),0,255)}function Ke(n){return yn(Yi(n/2.55)/100,0,1)}function wc(n){return yn(Yi(n*100),0,100)}const Ee={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},Oa=[..."0123456789ABCDEF"],jm=n=>Oa[n&15],$m=n=>Oa[(n&240)>>4]+Oa[n&15],tr=n=>(n&240)>>4===(n&15),Um=n=>tr(n.r)&&tr(n.g)&&tr(n.b)&&tr(n.a);function qm(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Ee[n[1]]*17,g:255&Ee[n[2]]*17,b:255&Ee[n[3]]*17,a:t===5?Ee[n[4]]*17:255}:(t===7||t===9)&&(e={r:Ee[n[1]]<<4|Ee[n[2]],g:Ee[n[3]]<<4|Ee[n[4]],b:Ee[n[5]]<<4|Ee[n[6]],a:t===9?Ee[n[7]]<<4|Ee[n[8]]:255})),e}const Xm=(n,t)=>n<255?t(n):"";function Gm(n){var t=Um(n)?jm:$m;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Xm(n.a,t):void 0}const Km=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function vc(n,t,e){const i=t*Math.min(e,1-e),s=(r,a=(r+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Zm(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 Qm(n,t,e){const i=vc(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 Jm(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 Pa(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),a=Math.min(e,i,s),o=(r+a)/2;let l,c,u;return r!==a&&(u=r-a,c=o>.5?u/(2-r-a):u/(r+a),l=Jm(e,i,s,u,r),l=l*60+.5),[l|0,c||0,o]}function Aa(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(bn)}function Ra(n,t,e){return Aa(vc,n,t,e)}function tg(n,t,e){return Aa(Qm,n,t,e)}function eg(n,t,e){return Aa(Zm,n,t,e)}function Mc(n){return(n%360+360)%360}function ng(n){const t=Km.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Vi(+t[5]):bn(+t[5]));const s=Mc(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=tg(s,r,a):t[1]==="hsv"?i=eg(s,r,a):i=Ra(s,r,a),{r:i[0],g:i[1],b:i[2],a:e}}function ig(n,t){var e=Pa(n);e[0]=Mc(e[0]+t),e=Ra(e),n.r=e[0],n.g=e[1],n.b=e[2]}function sg(n){if(!n)return;const t=Pa(n),e=t[0],i=wc(t[1]),s=wc(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ke(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Sc={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"},kc={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 rg(){const n={},t=Object.keys(kc),e=Object.keys(Sc);let i,s,r,a,o;for(i=0;i<t.length;i++){for(a=o=t[i],s=0;s<e.length;s++)r=e[s],o=o.replace(r,Sc[r]);r=parseInt(kc[a],16),n[o]=[r>>16&255,r>>8&255,r&255]}return n}let er;function ag(n){er||(er=rg(),er.transparent=[0,0,0,0]);const t=er[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const og=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function lg(n){const t=og.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Vi(a):yn(a*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Vi(i):yn(i,0,255)),s=255&(t[4]?Vi(s):yn(s,0,255)),r=255&(t[6]?Vi(r):yn(r,0,255)),{r:i,g:s,b:r,a:e}}}function cg(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ke(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Ia=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function ug(n,t,e){const i=hi(Ke(n.r)),s=hi(Ke(n.g)),r=hi(Ke(n.b));return{r:bn(Ia(i+e*(hi(Ke(t.r))-i))),g:bn(Ia(s+e*(hi(Ke(t.g))-s))),b:bn(Ia(r+e*(hi(Ke(t.b))-r))),a:n.a+e*(t.a-n.a)}}function nr(n,t,e){if(n){let i=Pa(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Ra(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Tc(n,t){return n&&Object.assign(t||{},n)}function Dc(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=bn(n[3]))):(t=Tc(n,{r:0,g:0,b:0,a:1}),t.a=bn(t.a)),t}function dg(n){return n.charAt(0)==="r"?lg(n):ng(n)}class ji{constructor(t){if(t instanceof ji)return t;const e=typeof t;let i;e==="object"?i=Dc(t):e==="string"&&(i=qm(t)||ag(t)||dg(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Tc(this._rgb);return t&&(t.a=Ke(t.a)),t}set rgb(t){this._rgb=Dc(t)}rgbString(){return this._valid?cg(this._rgb):void 0}hexString(){return this._valid?Gm(this._rgb):void 0}hslString(){return this._valid?sg(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const a=e===r?.5:e,o=2*a-1,l=i.a-s.a,c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=ug(this._rgb,t._rgb,e)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=bn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Yi(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 nr(this._rgb,2,t),this}darken(t){return nr(this._rgb,2,-t),this}saturate(t){return nr(this._rgb,1,t),this}desaturate(t){return nr(this._rgb,1,-t),this}rotate(t){return ig(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 Ze(){}const hg=(()=>{let n=0;return()=>n++})();function rt(n){return n==null}function St(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 ft(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function De(n,t){return Rt(n)?n:t}function at(n,t){return typeof n>"u"?t:n}const fg=(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 kt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,i){let s,r,a;if(St(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ft(n))for(a=Object.keys(n),r=a.length,s=0;s<r;s++)t.call(e,n[a[s]],a[s])}function ir(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 sr(n){if(St(n))return n.map(sr);if(ft(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=sr(n[e[s]]);return t}return n}function Ec(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function mg(n,t,e,i){if(!Ec(n))return;const s=t[n],r=e[n];ft(s)&&ft(r)?$i(s,r,i):t[n]=sr(r)}function $i(n,t,e){const i=St(t)?t:[t],s=i.length;if(!ft(n))return n;e=e||{};const r=e.merger||mg;let a;for(let o=0;o<s;++o){if(a=i[o],!ft(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)r(l[c],n,a,e)}return n}function Ui(n,t){return $i(n,t,{merger:gg})}function gg(n,t,e){if(!Ec(n))return;const i=t[n],s=e[n];ft(i)&&ft(s)?Ui(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=sr(s))}const Oc={"":n=>n,x:n=>n.x,y:n=>n.y};function pg(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=pg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function _n(n,t){return(Oc[t]||(Oc[t]=yg(t)))(n)}function La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const pe=n=>typeof n<"u",ye=n=>typeof n=="function",Pc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function bg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const dt=Math.PI,Ot=2*dt,_g=Ot+dt,rr=Number.POSITIVE_INFINITY,Na=dt/180,Pt=dt/2,Oe=dt/4,ar=dt*2/3,xn=Math.log10,Ye=Math.sign;function qi(n,t,e){return Math.abs(n-t)<e}function Ac(n){const t=Math.round(n);n=qi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function xg(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 wg(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function wn(n){return!wg(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function vg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Rc(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 $t(n){return n*(dt/180)}function or(n){return n*(180/dt)}function Ic(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function lr(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*dt&&(r+=Ot),{angle:r,distance:s}}function fi(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Mg(n,t){return(n-t+_g)%Ot-dt}function se(n){return(n%Ot+Ot)%Ot}function Xi(n,t,e,i){const s=se(n),r=se(t),a=se(e),o=se(r-s),l=se(a-s),c=se(s-r),u=se(s-a);return s===r||s===a||i&&r===a||o>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function Sg(n){return Qt(n,-32768,32767)}function Qe(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Fa(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Je=(n,t,e,i)=>Fa(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)=>Fa(n,e,i=>n[i][t]>=e);function Dg(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 Lc=["push","pop","shift","splice","unshift"];function Tg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Lc.forEach(e=>{const i="_onData"+La(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const a=s.apply(this,r);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...r)}),a}})})}function Nc(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)&&(Lc.forEach(r=>{delete n[r]}),delete n._chartjs)}function Fc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Bc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function zc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Bc.call(window,()=>{i=!1,n.apply(t,e)}))}}function Cg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Ba=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Eg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Hc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:a,vScale:o,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:g}=a.getUserBounds();if(m){if(s=Math.min(Je(l,u,h).lo,e?i:Je(t,u,a.getPixelForValue(h)).lo),c){const p=l.slice(0,s+1).reverse().findIndex(x=>!rt(x[o.axis]));s-=Math.max(0,p)}s=Qt(s,0,i-1)}if(g){let p=Math.max(Je(l,a.axis,f,!0).hi+1,e?0:Je(t,u,a.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(p-1).findIndex(v=>!rt(v[o.axis]));p+=Math.max(0,x)}r=Qt(p,s,i)-s}else r=i-s}return{start:s,count:r}}function Wc(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 cr=n=>n===0||n===1,Yc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),Vc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Gi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Pt)+1,easeOutSine:n=>Math.sin(n*Pt),easeInOutSine:n=>-.5*(Math.cos(dt*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=>cr(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=>cr(n)?n:Yc(n,.075,.3),easeOutElastic:n=>cr(n)?n:Vc(n,.075,.3),easeInOutElastic(n){return cr(n)?n:n<.5?.5*Yc(n*2,.1125,.45):.5+.5*Vc(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-Gi.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?Gi.easeInBounce(n*2)*.5:Gi.easeOutBounce(n*2-1)*.5+.5};function za(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function jc(n){return za(n)?n:new ji(n)}function Ha(n){return za(n)?n:new ji(n).saturate(.5).darken(.1).hexString()}const Og=["x","y","borderWidth","radius","tension"],Pg=["color","borderColor","backgroundColor"];function Ag(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:Pg},numbers:{type:"number",properties:Og}}),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 Rg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $c=new Map;function Ig(n,t){t=t||{};const e=n+JSON.stringify(t);let i=$c.get(e);return i||(i=new Intl.NumberFormat(n,t),$c.set(e,i)),i}function Ki(n,t,e){return Ig(t,e).format(n)}const Uc={values(n){return St(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=Lg(n,e)}const a=xn(Math.abs(r)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Ki(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Uc.numeric.call(this,n,t,e):""}};function Lg(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 ur={formatters:Uc};function Ng(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:ur.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Hn=Object.create(null),Wa=Object.create(null);function Zi(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 Ya(n,t,e){return typeof t=="string"?$i(Zi(n,t),e):$i(Zi(n,""),t)}class Fg{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)=>Ha(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ha(s.borderColor),this.hoverColor=(i,s)=>Ha(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 Ya(this,t,e)}get(t){return Zi(this,t)}describe(t,e){return Ya(Wa,t,e)}override(t,e){return Ya(Hn,t,e)}route(t,e,i,s){const r=Zi(this,t),a=Zi(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=a[s];return ft(l)?Object.assign({},c,l):at(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new Fg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ag,Rg,Ng]);function Bg(n){return!n||rt(n.size)||rt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function dr(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 zg(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const o=e.length;let l,c,u,h,f;for(l=0;l<o;l++)if(h=e[l],h!=null&&!St(h))a=dr(n,s,r,a,h);else if(St(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!St(f)&&(a=dr(n,s,r,a,f));n.restore();const m=r.length/2;if(m>e.length){for(l=0;l<m;l++)delete s[r[l]];r.splice(0,m)}return a}function Wn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function qc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Va(n,t,e,i){Xc(n,t,e,i,null)}function Xc(n,t,e,i,s){let r,a,o,l,c,u,h,f;const m=t.pointStyle,g=t.rotation,p=t.radius;let x=(g||0)*Na;if(m&&typeof m=="object"&&(r=m.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(p)||p<=0)){switch(n.beginPath(),m){default:s?n.ellipse(e,i,s/2,p,0,0,Ot):n.arc(e,i,p,0,Ot),n.closePath();break;case"triangle":u=s?s/2:p,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*p),x+=ar,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*p),x+=ar,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*p),n.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(x+Oe)*l,h=Math.cos(x+Oe)*(s?s/2-c:l),o=Math.sin(x+Oe)*l,f=Math.sin(x+Oe)*(s?s/2-c:l),n.arc(e-h,i-o,c,x-dt,x-Pt),n.arc(e+f,i-a,c,x-Pt,x),n.arc(e+h,i+o,c,x,x+Pt),n.arc(e-f,i+a,c,x+Pt,x+dt),n.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Oe;case"rectRot":h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+f,i-a),n.lineTo(e+h,i+o),n.lineTo(e-f,i+a),n.closePath();break;case"crossRot":x+=Oe;case"cross":h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"star":h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a),x+=Oe,h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"line":a=s?s/2:Math.cos(x)*p,o=Math.sin(x)*p,n.moveTo(e-a,i-o),n.lineTo(e+a,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:p),i+Math.sin(x)*p);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function tn(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 Qi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ji(n){n.restore()}function Hg(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 Wg(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Yg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),rt(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 Vg(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),a=t-r.actualBoundingBoxLeft,o=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,u),n.lineTo(o,u),n.stroke()}}function jg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Yn(n,t,e,i,s,r={}){const a=St(t)?t:[t],o=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,Yg(n,r),l=0;l<a.length;++l)c=a[l],r.backdrop&&jg(n,r.backdrop),o&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),rt(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),Vg(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function mi(n,t){const{x:e,y:i,w:s,h:r,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*dt,dt,!0),n.lineTo(e,i+r-a.bottomLeft),n.arc(e+a.bottomLeft,i+r-a.bottomLeft,a.bottomLeft,dt,Pt,!0),n.lineTo(e+s-a.bottomRight,i+r),n.arc(e+s-a.bottomRight,i+r-a.bottomRight,a.bottomRight,Pt,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-Pt,!0),n.lineTo(e+a.topLeft,i)}const $g=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ug=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function qg(n,t){const e=(""+n).match($g);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 Xg=n=>+n||0;function ja(n,t){const e={},i=ft(t),s=i?Object.keys(t):t,r=ft(n)?i?a=>at(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=Xg(r(a));return e}function Gc(n){return ja(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(n){return ja(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=Gc(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=at(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=at(n.style,t.style);i&&!(""+i).match(Ug)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(n.family,t.family),lineHeight:qg(at(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:at(n.weight,t.weight),string:""};return s.string=Bg(s),s}function ts(n,t,e,i){let s,r,a;for(s=0,r=n.length;s<r;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function Gg(n,t,e){const{min:i,max:s}=n,r=Cc(t,(s-i)/2),a=(o,l)=>e&&o===0?0:o+l;return{min:a(i,-Math.abs(r)),max:a(s,r)}}function Mn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=tu("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:o=>$a([o,...n],t,r,i)};return new Proxy(a,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Zc(o,l,()=>ip(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return eu(o).includes(l)},ownKeys(o){return eu(o)},set(o,l,c){const u=o._storage||(o._storage=s());return o[l]=u[l]=c,delete o._keys,!0}})}function gi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Kc(n,i),setContext:r=>gi(n,r,e,i),override:r=>gi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,a){return delete r[a],delete n[a],!0},get(r,a,o){return Zc(r,a,()=>Zg(r,a,o))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(r,a,o){return n[a]=o,delete r[a],!0}})}function Kc(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:ye(e)?e:()=>e,isIndexable:ye(i)?i:()=>i}}const Kg=(n,t)=>n?n+La(t):t,Ua=(n,t)=>ft(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Zg(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:a}=n;let o=i[t];return ye(o)&&a.isScriptable(t)&&(o=Qg(t,o,n,e)),St(o)&&o.length&&(o=Jg(t,o,n,a.isIndexable)),Ua(t,o)&&(o=gi(o,s,r&&r[t],a)),o}function Qg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(r,a||i);return o.delete(n),Ua(n,l)&&(l=qa(s._scopes,s,n,l)),l}function Jg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_descriptors:o}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ft(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=qa(c,s,n,u);t.push(gi(h,r,a&&a[n],o))}}return t}function Qc(n,t,e){return ye(n)?n(t,e):n}const tp=(n,t)=>n===!0?t:typeof n=="string"?_n(t,n):void 0;function ep(n,t,e,i,s){for(const r of t){const a=tp(e,r);if(a){n.add(a);const o=Qc(a._fallback,e,s);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function qa(n,t,e,i){const s=t._rootScopes,r=Qc(t._fallback,e,i),a=[...n,...s],o=new Set;o.add(i);let l=Jc(o,a,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Jc(o,a,r,l,i),l===null)?!1:$a(Array.from(o),[""],s,r,()=>np(t,e,i))}function Jc(n,t,e,i,s){for(;e;)e=ep(n,t,e,i,s);return e}function np(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return St(s)&&ft(e)?e:s||{}}function ip(n,t,e,i){let s;for(const r of t)if(s=tu(Kg(r,n),e),typeof s<"u")return Ua(n,s)?qa(e,i,n,s):s}function tu(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function eu(n){let t=n._keys;return t||(t=n._keys=sp(n._scopes)),t}function sp(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 nu(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,a=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],a[o]={r:s.parse(_n(u,r),c)};return a}const rp=Number.EPSILON||1e-14,pi=(n,t)=>t<n.length&&!n[t].skip&&n[t],iu=n=>n==="x"?"y":"x";function ap(n,t,e,i){const s=n.skip?t:n,r=t,a=e.skip?t:e,o=fi(r,s),l=fi(a,r);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:r.x-h*(a.x-s.x),y:r.y-h*(a.y-s.y)},next:{x:r.x+f*(a.x-s.x),y:r.y+f*(a.y-s.y)}}}function op(n,t,e){const i=n.length;let s,r,a,o,l,c=pi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=pi(n,u+1),!(!l||!c)){if(qi(t[u],0,rp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],o=Math.pow(s,2)+Math.pow(r,2),!(o<=9)&&(a=3/Math.sqrt(o),e[u]=s*a*t[u],e[u+1]=r*a*t[u])}}function lp(n,t,e="x"){const i=iu(e),s=n.length;let r,a,o,l=pi(n,0);for(let c=0;c<s;++c){if(a=o,o=l,l=pi(n,c+1),!o)continue;const u=o[e],h=o[i];a&&(r=(u-a[e])/3,o[`cp1${e}`]=u-r,o[`cp1${i}`]=h-r*t[c]),l&&(r=(l[e]-u)/3,o[`cp2${e}`]=u+r,o[`cp2${i}`]=h+r*t[c])}}function cp(n,t="x"){const e=iu(t),i=n.length,s=Array(i).fill(0),r=Array(i);let a,o,l,c=pi(n,0);for(a=0;a<i;++a)if(o=l,l=c,c=pi(n,a+1),!!l){if(c){const u=c[t]-l[t];s[a]=u!==0?(c[e]-l[e])/u:0}r[a]=o?c?Ye(s[a-1])!==Ye(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}op(n,s,r),lp(n,r,t)}function hr(n,t,e){return Math.max(Math.min(n,e),t)}function up(n,t){let e,i,s,r,a,o=tn(n[0],t);for(e=0,i=n.length;e<i;++e)a=r,r=o,o=e<i-1&&tn(n[e+1],t),r&&(s=n[e],a&&(s.cp1x=hr(s.cp1x,t.left,t.right),s.cp1y=hr(s.cp1y,t.top,t.bottom)),o&&(s.cp2x=hr(s.cp2x,t.left,t.right),s.cp2y=hr(s.cp2y,t.top,t.bottom)))}function dp(n,t,e,i,s){let r,a,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")cp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,a=n.length;r<a;++r)o=n[r],l=ap(c,o,n[Math.min(r+1,a-(i?0:1))%a],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&up(n,e)}function Xa(){return typeof window<"u"&&typeof document<"u"}function Ga(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function fr(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 mr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function hp(n,t){return mr(n).getPropertyValue(t)}const fp=["top","right","bottom","left"];function Vn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=fp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const mp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function gp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let a=!1,o,l;if(mp(s,r,n.target))o=s,l=r;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:o,y:l,box:a}}function Sn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=mr(e),r=s.boxSizing==="border-box",a=Vn(s,"padding"),o=Vn(s,"border","width"),{x:l,y:c,box:u}=gp(n,e),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:g}=t;return r&&(m-=a.width+o.width,g-=a.height+o.height),{x:Math.round((l-h)/m*e.width/i),y:Math.round((c-f)/g*e.height/i)}}function pp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Ga(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const a=r.getBoundingClientRect(),o=mr(r),l=Vn(o,"border","width"),c=Vn(o,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=fr(o.maxWidth,r,"clientWidth"),s=fr(o.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||rr,maxHeight:s||rr}}const gr=n=>Math.round(n*10)/10;function yp(n,t,e,i){const s=mr(n),r=Vn(s,"margin"),a=fr(s.maxWidth,n,"clientWidth")||rr,o=fr(s.maxHeight,n,"clientHeight")||rr,l=pp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Vn(s,"border","width"),m=Vn(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=gr(Math.min(c,a,l.maxWidth)),u=gr(Math.min(u,o,l.maxHeight)),c&&!u&&(u=gr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=gr(Math.floor(u*i))),{width:c,height:u}}function su(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==r?(n.currentDevicePixelRatio=i,a.height=s,a.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const bp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Xa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function ru(n,t){const e=hp(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function jn(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 xp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},a=jn(n,s,e),o=jn(s,r,e),l=jn(r,t,e),c=jn(a,o,e),u=jn(o,l,e);return jn(c,u,e)}const wp=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}}},vp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function yi(n,t,e){return n?wp(t,e):vp()}function au(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 ou(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lu(n){return n==="angle"?{between:Xi,compare:Mg,normalize:se}:{between:Qe,compare:(t,e)=>t-e,normalize:t=>t}}function cu({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 Mp(n,t,e){const{property:i,start:s,end:r}=e,{between:a,normalize:o}=lu(i),l=t.length;let{start:c,end:u,loop:h}=n,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&a(o(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:n.style}}function uu(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,a=t.length,{compare:o,between:l,normalize:c}=lu(i),{start:u,end:h,loop:f,style:m}=Mp(n,t,e),g=[];let p=!1,x=null,v,M,D;const k=()=>l(s,D,v)&&o(s,D)!==0,E=()=>o(r,v)===0||l(r,D,v),R=()=>p||k(),C=()=>!p||E();for(let b=u,_=u;b<=h;++b)M=t[b%a],!M.skip&&(v=c(M[i]),v!==D&&(p=l(v,s,r),x===null&&R()&&(x=o(v,s)===0?b:_),x!==null&&C()&&(g.push(cu({start:x,end:b,loop:f,count:a,style:m})),x=null),_=b,D=v));return x!==null&&g.push(cu({start:x,end:h,loop:f,count:a,style:m})),g}function du(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=uu(i[s],n.points,t);r.length&&e.push(...r)}return e}function Sp(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 a=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?o.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,o.skip&&(t=l)),o=c}return a!==null&&r.push({start:t%s,end:a%s,loop:i}),r}function Dp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:a,end:o}=Sp(e,s,r,i);if(i===!0)return hu(n,[{start:a,end:o,loop:r}],e,t);const l=o<a?o+s:o,c=!!n._fullLoop&&a===0&&o===s-1;return hu(n,kp(e,a,l,c),e,t)}function hu(n,t,e,i){return!i||!i.setContext||!e?t:Tp(n,t,e,i)}function Tp(n,t,e,i){const s=n._chart.getContext(),r=fu(n.options),{_datasetIndex:a,options:{spanGaps:o}}=n,l=e.length,c=[];let u=r,h=t[0].start,f=h;function m(g,p,x,v){const M=o?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=M;for(;e[p%l].skip;)p+=M;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:x,style:v}),u=v,h=p%l)}}for(const g of t){h=o?h:g.start;let p=e[h%l],x;for(f=h+1;f<=g.end;f++){const v=e[f%l];x=fu(i.setContext(Mn(s,{type:"segment",p0:p,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),Cp(x,u)&&m(h,f-1,g.loop,u),p=v,u=x}h<f-1&&m(h,f-1,g.loop,u)}return c}function fu(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Cp(n,t){if(!t)return!1;const e=[],i=function(s,r){return za(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function pr(n,t,e){return n.options.clip?n[e]:t[e]}function Ep(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:pr(e,t,"left"),right:pr(e,t,"right"),top:pr(i,t,"top"),bottom:pr(i,t,"bottom")}:t}function mu(n,t){const e=t._clip;if(e.disabled)return!1;const i=Ep(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 Ze(){}const hg=(()=>{let n=0;return()=>n++})();function rt(n){return n==null}function St(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 ft(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Te(n,t){return Rt(n)?n:t}function at(n,t){return typeof n>"u"?t:n}const fg=(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 kt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Tt(n,t,e,i){let s,r,a;if(St(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ft(n))for(a=Object.keys(n),r=a.length,s=0;s<r;s++)t.call(e,n[a[s]],a[s])}function ir(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 sr(n){if(St(n))return n.map(sr);if(ft(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=sr(n[e[s]]);return t}return n}function Ec(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function mg(n,t,e,i){if(!Ec(n))return;const s=t[n],r=e[n];ft(s)&&ft(r)?$i(s,r,i):t[n]=sr(r)}function $i(n,t,e){const i=St(t)?t:[t],s=i.length;if(!ft(n))return n;e=e||{};const r=e.merger||mg;let a;for(let o=0;o<s;++o){if(a=i[o],!ft(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)r(l[c],n,a,e)}return n}function Ui(n,t){return $i(n,t,{merger:gg})}function gg(n,t,e){if(!Ec(n))return;const i=t[n],s=e[n];ft(i)&&ft(s)?Ui(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=sr(s))}const Oc={"":n=>n,x:n=>n.x,y:n=>n.y};function pg(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=pg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function _n(n,t){return(Oc[t]||(Oc[t]=yg(t)))(n)}function La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const pe=n=>typeof n<"u",ye=n=>typeof n=="function",Pc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function bg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const dt=Math.PI,Ot=2*dt,_g=Ot+dt,rr=Number.POSITIVE_INFINITY,Na=dt/180,Pt=dt/2,Oe=dt/4,ar=dt*2/3,xn=Math.log10,Ye=Math.sign;function qi(n,t,e){return Math.abs(n-t)<e}function Ac(n){const t=Math.round(n);n=qi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function xg(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 wg(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function wn(n){return!wg(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function vg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Rc(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 $t(n){return n*(dt/180)}function or(n){return n*(180/dt)}function Ic(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function lr(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*dt&&(r+=Ot),{angle:r,distance:s}}function fi(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Mg(n,t){return(n-t+_g)%Ot-dt}function se(n){return(n%Ot+Ot)%Ot}function Xi(n,t,e,i){const s=se(n),r=se(t),a=se(e),o=se(r-s),l=se(a-s),c=se(s-r),u=se(s-a);return s===r||s===a||i&&r===a||o>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function Sg(n){return Qt(n,-32768,32767)}function Qe(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Fa(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Je=(n,t,e,i)=>Fa(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)=>Fa(n,e,i=>n[i][t]>=e);function Tg(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 Lc=["push","pop","shift","splice","unshift"];function Dg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Lc.forEach(e=>{const i="_onData"+La(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const a=s.apply(this,r);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...r)}),a}})})}function Nc(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)&&(Lc.forEach(r=>{delete n[r]}),delete n._chartjs)}function Fc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Bc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function zc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Bc.call(window,()=>{i=!1,n.apply(t,e)}))}}function Cg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Ba=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Eg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Hc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:a,vScale:o,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:g}=a.getUserBounds();if(m){if(s=Math.min(Je(l,u,h).lo,e?i:Je(t,u,a.getPixelForValue(h)).lo),c){const p=l.slice(0,s+1).reverse().findIndex(x=>!rt(x[o.axis]));s-=Math.max(0,p)}s=Qt(s,0,i-1)}if(g){let p=Math.max(Je(l,a.axis,f,!0).hi+1,e?0:Je(t,u,a.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(p-1).findIndex(v=>!rt(v[o.axis]));p+=Math.max(0,x)}r=Qt(p,s,i)-s}else r=i-s}return{start:s,count:r}}function Wc(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 cr=n=>n===0||n===1,Yc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),Vc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Gi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Pt)+1,easeOutSine:n=>Math.sin(n*Pt),easeInOutSine:n=>-.5*(Math.cos(dt*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=>cr(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=>cr(n)?n:Yc(n,.075,.3),easeOutElastic:n=>cr(n)?n:Vc(n,.075,.3),easeInOutElastic(n){return cr(n)?n:n<.5?.5*Yc(n*2,.1125,.45):.5+.5*Vc(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-Gi.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?Gi.easeInBounce(n*2)*.5:Gi.easeOutBounce(n*2-1)*.5+.5};function za(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function jc(n){return za(n)?n:new ji(n)}function Ha(n){return za(n)?n:new ji(n).saturate(.5).darken(.1).hexString()}const Og=["x","y","borderWidth","radius","tension"],Pg=["color","borderColor","backgroundColor"];function Ag(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:Pg},numbers:{type:"number",properties:Og}}),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 Rg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $c=new Map;function Ig(n,t){t=t||{};const e=n+JSON.stringify(t);let i=$c.get(e);return i||(i=new Intl.NumberFormat(n,t),$c.set(e,i)),i}function Ki(n,t,e){return Ig(t,e).format(n)}const Uc={values(n){return St(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=Lg(n,e)}const a=xn(Math.abs(r)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Ki(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Uc.numeric.call(this,n,t,e):""}};function Lg(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 ur={formatters:Uc};function Ng(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:ur.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Hn=Object.create(null),Wa=Object.create(null);function Zi(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 Ya(n,t,e){return typeof t=="string"?$i(Zi(n,t),e):$i(Zi(n,""),t)}class Fg{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)=>Ha(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ha(s.borderColor),this.hoverColor=(i,s)=>Ha(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 Ya(this,t,e)}get(t){return Zi(this,t)}describe(t,e){return Ya(Wa,t,e)}override(t,e){return Ya(Hn,t,e)}route(t,e,i,s){const r=Zi(this,t),a=Zi(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=a[s];return ft(l)?Object.assign({},c,l):at(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new Fg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ag,Rg,Ng]);function Bg(n){return!n||rt(n.size)||rt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function dr(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 zg(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const o=e.length;let l,c,u,h,f;for(l=0;l<o;l++)if(h=e[l],h!=null&&!St(h))a=dr(n,s,r,a,h);else if(St(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!St(f)&&(a=dr(n,s,r,a,f));n.restore();const m=r.length/2;if(m>e.length){for(l=0;l<m;l++)delete s[r[l]];r.splice(0,m)}return a}function Wn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function qc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Va(n,t,e,i){Xc(n,t,e,i,null)}function Xc(n,t,e,i,s){let r,a,o,l,c,u,h,f;const m=t.pointStyle,g=t.rotation,p=t.radius;let x=(g||0)*Na;if(m&&typeof m=="object"&&(r=m.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(p)||p<=0)){switch(n.beginPath(),m){default:s?n.ellipse(e,i,s/2,p,0,0,Ot):n.arc(e,i,p,0,Ot),n.closePath();break;case"triangle":u=s?s/2:p,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*p),x+=ar,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*p),x+=ar,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*p),n.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(x+Oe)*l,h=Math.cos(x+Oe)*(s?s/2-c:l),o=Math.sin(x+Oe)*l,f=Math.sin(x+Oe)*(s?s/2-c:l),n.arc(e-h,i-o,c,x-dt,x-Pt),n.arc(e+f,i-a,c,x-Pt,x),n.arc(e+h,i+o,c,x,x+Pt),n.arc(e-f,i+a,c,x+Pt,x+dt),n.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Oe;case"rectRot":h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+f,i-a),n.lineTo(e+h,i+o),n.lineTo(e-f,i+a),n.closePath();break;case"crossRot":x+=Oe;case"cross":h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"star":h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a),x+=Oe,h=Math.cos(x)*(s?s/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(s?s/2:p),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"line":a=s?s/2:Math.cos(x)*p,o=Math.sin(x)*p,n.moveTo(e-a,i-o),n.lineTo(e+a,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:p),i+Math.sin(x)*p);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function tn(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 Qi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ji(n){n.restore()}function Hg(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 Wg(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Yg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),rt(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 Vg(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),a=t-r.actualBoundingBoxLeft,o=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,u),n.lineTo(o,u),n.stroke()}}function jg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Yn(n,t,e,i,s,r={}){const a=St(t)?t:[t],o=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,Yg(n,r),l=0;l<a.length;++l)c=a[l],r.backdrop&&jg(n,r.backdrop),o&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),rt(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),Vg(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function mi(n,t){const{x:e,y:i,w:s,h:r,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*dt,dt,!0),n.lineTo(e,i+r-a.bottomLeft),n.arc(e+a.bottomLeft,i+r-a.bottomLeft,a.bottomLeft,dt,Pt,!0),n.lineTo(e+s-a.bottomRight,i+r),n.arc(e+s-a.bottomRight,i+r-a.bottomRight,a.bottomRight,Pt,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-Pt,!0),n.lineTo(e+a.topLeft,i)}const $g=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ug=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function qg(n,t){const e=(""+n).match($g);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 Xg=n=>+n||0;function ja(n,t){const e={},i=ft(t),s=i?Object.keys(t):t,r=ft(n)?i?a=>at(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=Xg(r(a));return e}function Gc(n){return ja(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(n){return ja(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=Gc(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=at(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=at(n.style,t.style);i&&!(""+i).match(Ug)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(n.family,t.family),lineHeight:qg(at(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:at(n.weight,t.weight),string:""};return s.string=Bg(s),s}function ts(n,t,e,i){let s,r,a;for(s=0,r=n.length;s<r;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function Gg(n,t,e){const{min:i,max:s}=n,r=Cc(t,(s-i)/2),a=(o,l)=>e&&o===0?0:o+l;return{min:a(i,-Math.abs(r)),max:a(s,r)}}function Mn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=tu("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:o=>$a([o,...n],t,r,i)};return new Proxy(a,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Zc(o,l,()=>ip(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return eu(o).includes(l)},ownKeys(o){return eu(o)},set(o,l,c){const u=o._storage||(o._storage=s());return o[l]=u[l]=c,delete o._keys,!0}})}function gi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Kc(n,i),setContext:r=>gi(n,r,e,i),override:r=>gi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,a){return delete r[a],delete n[a],!0},get(r,a,o){return Zc(r,a,()=>Zg(r,a,o))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(r,a,o){return n[a]=o,delete r[a],!0}})}function Kc(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:ye(e)?e:()=>e,isIndexable:ye(i)?i:()=>i}}const Kg=(n,t)=>n?n+La(t):t,Ua=(n,t)=>ft(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Zg(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:a}=n;let o=i[t];return ye(o)&&a.isScriptable(t)&&(o=Qg(t,o,n,e)),St(o)&&o.length&&(o=Jg(t,o,n,a.isIndexable)),Ua(t,o)&&(o=gi(o,s,r&&r[t],a)),o}function Qg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(r,a||i);return o.delete(n),Ua(n,l)&&(l=qa(s._scopes,s,n,l)),l}function Jg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_descriptors:o}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ft(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=qa(c,s,n,u);t.push(gi(h,r,a&&a[n],o))}}return t}function Qc(n,t,e){return ye(n)?n(t,e):n}const tp=(n,t)=>n===!0?t:typeof n=="string"?_n(t,n):void 0;function ep(n,t,e,i,s){for(const r of t){const a=tp(e,r);if(a){n.add(a);const o=Qc(a._fallback,e,s);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function qa(n,t,e,i){const s=t._rootScopes,r=Qc(t._fallback,e,i),a=[...n,...s],o=new Set;o.add(i);let l=Jc(o,a,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Jc(o,a,r,l,i),l===null)?!1:$a(Array.from(o),[""],s,r,()=>np(t,e,i))}function Jc(n,t,e,i,s){for(;e;)e=ep(n,t,e,i,s);return e}function np(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return St(s)&&ft(e)?e:s||{}}function ip(n,t,e,i){let s;for(const r of t)if(s=tu(Kg(r,n),e),typeof s<"u")return Ua(n,s)?qa(e,i,n,s):s}function tu(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function eu(n){let t=n._keys;return t||(t=n._keys=sp(n._scopes)),t}function sp(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 nu(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,a=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],a[o]={r:s.parse(_n(u,r),c)};return a}const rp=Number.EPSILON||1e-14,pi=(n,t)=>t<n.length&&!n[t].skip&&n[t],iu=n=>n==="x"?"y":"x";function ap(n,t,e,i){const s=n.skip?t:n,r=t,a=e.skip?t:e,o=fi(r,s),l=fi(a,r);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:r.x-h*(a.x-s.x),y:r.y-h*(a.y-s.y)},next:{x:r.x+f*(a.x-s.x),y:r.y+f*(a.y-s.y)}}}function op(n,t,e){const i=n.length;let s,r,a,o,l,c=pi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=pi(n,u+1),!(!l||!c)){if(qi(t[u],0,rp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],o=Math.pow(s,2)+Math.pow(r,2),!(o<=9)&&(a=3/Math.sqrt(o),e[u]=s*a*t[u],e[u+1]=r*a*t[u])}}function lp(n,t,e="x"){const i=iu(e),s=n.length;let r,a,o,l=pi(n,0);for(let c=0;c<s;++c){if(a=o,o=l,l=pi(n,c+1),!o)continue;const u=o[e],h=o[i];a&&(r=(u-a[e])/3,o[`cp1${e}`]=u-r,o[`cp1${i}`]=h-r*t[c]),l&&(r=(l[e]-u)/3,o[`cp2${e}`]=u+r,o[`cp2${i}`]=h+r*t[c])}}function cp(n,t="x"){const e=iu(t),i=n.length,s=Array(i).fill(0),r=Array(i);let a,o,l,c=pi(n,0);for(a=0;a<i;++a)if(o=l,l=c,c=pi(n,a+1),!!l){if(c){const u=c[t]-l[t];s[a]=u!==0?(c[e]-l[e])/u:0}r[a]=o?c?Ye(s[a-1])!==Ye(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}op(n,s,r),lp(n,r,t)}function hr(n,t,e){return Math.max(Math.min(n,e),t)}function up(n,t){let e,i,s,r,a,o=tn(n[0],t);for(e=0,i=n.length;e<i;++e)a=r,r=o,o=e<i-1&&tn(n[e+1],t),r&&(s=n[e],a&&(s.cp1x=hr(s.cp1x,t.left,t.right),s.cp1y=hr(s.cp1y,t.top,t.bottom)),o&&(s.cp2x=hr(s.cp2x,t.left,t.right),s.cp2y=hr(s.cp2y,t.top,t.bottom)))}function dp(n,t,e,i,s){let r,a,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")cp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,a=n.length;r<a;++r)o=n[r],l=ap(c,o,n[Math.min(r+1,a-(i?0:1))%a],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&up(n,e)}function Xa(){return typeof window<"u"&&typeof document<"u"}function Ga(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function fr(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 mr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function hp(n,t){return mr(n).getPropertyValue(t)}const fp=["top","right","bottom","left"];function Vn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=fp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const mp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function gp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let a=!1,o,l;if(mp(s,r,n.target))o=s,l=r;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:o,y:l,box:a}}function Sn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=mr(e),r=s.boxSizing==="border-box",a=Vn(s,"padding"),o=Vn(s,"border","width"),{x:l,y:c,box:u}=gp(n,e),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:g}=t;return r&&(m-=a.width+o.width,g-=a.height+o.height),{x:Math.round((l-h)/m*e.width/i),y:Math.round((c-f)/g*e.height/i)}}function pp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Ga(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const a=r.getBoundingClientRect(),o=mr(r),l=Vn(o,"border","width"),c=Vn(o,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=fr(o.maxWidth,r,"clientWidth"),s=fr(o.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||rr,maxHeight:s||rr}}const gr=n=>Math.round(n*10)/10;function yp(n,t,e,i){const s=mr(n),r=Vn(s,"margin"),a=fr(s.maxWidth,n,"clientWidth")||rr,o=fr(s.maxHeight,n,"clientHeight")||rr,l=pp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Vn(s,"border","width"),m=Vn(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=gr(Math.min(c,a,l.maxWidth)),u=gr(Math.min(u,o,l.maxHeight)),c&&!u&&(u=gr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=gr(Math.floor(u*i))),{width:c,height:u}}function su(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==r?(n.currentDevicePixelRatio=i,a.height=s,a.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const bp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Xa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function ru(n,t){const e=hp(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function jn(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 xp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},a=jn(n,s,e),o=jn(s,r,e),l=jn(r,t,e),c=jn(a,o,e),u=jn(o,l,e);return jn(c,u,e)}const wp=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}}},vp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function yi(n,t,e){return n?wp(t,e):vp()}function au(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 ou(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lu(n){return n==="angle"?{between:Xi,compare:Mg,normalize:se}:{between:Qe,compare:(t,e)=>t-e,normalize:t=>t}}function cu({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 Mp(n,t,e){const{property:i,start:s,end:r}=e,{between:a,normalize:o}=lu(i),l=t.length;let{start:c,end:u,loop:h}=n,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&a(o(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:n.style}}function uu(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,a=t.length,{compare:o,between:l,normalize:c}=lu(i),{start:u,end:h,loop:f,style:m}=Mp(n,t,e),g=[];let p=!1,x=null,v,M,T;const k=()=>l(s,T,v)&&o(s,T)!==0,E=()=>o(r,v)===0||l(r,T,v),R=()=>p||k(),C=()=>!p||E();for(let b=u,_=u;b<=h;++b)M=t[b%a],!M.skip&&(v=c(M[i]),v!==T&&(p=l(v,s,r),x===null&&R()&&(x=o(v,s)===0?b:_),x!==null&&C()&&(g.push(cu({start:x,end:b,loop:f,count:a,style:m})),x=null),_=b,T=v));return x!==null&&g.push(cu({start:x,end:h,loop:f,count:a,style:m})),g}function du(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=uu(i[s],n.points,t);r.length&&e.push(...r)}return e}function Sp(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 a=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?o.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,o.skip&&(t=l)),o=c}return a!==null&&r.push({start:t%s,end:a%s,loop:i}),r}function Tp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:a,end:o}=Sp(e,s,r,i);if(i===!0)return hu(n,[{start:a,end:o,loop:r}],e,t);const l=o<a?o+s:o,c=!!n._fullLoop&&a===0&&o===s-1;return hu(n,kp(e,a,l,c),e,t)}function hu(n,t,e,i){return!i||!i.setContext||!e?t:Dp(n,t,e,i)}function Dp(n,t,e,i){const s=n._chart.getContext(),r=fu(n.options),{_datasetIndex:a,options:{spanGaps:o}}=n,l=e.length,c=[];let u=r,h=t[0].start,f=h;function m(g,p,x,v){const M=o?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=M;for(;e[p%l].skip;)p+=M;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:x,style:v}),u=v,h=p%l)}}for(const g of t){h=o?h:g.start;let p=e[h%l],x;for(f=h+1;f<=g.end;f++){const v=e[f%l];x=fu(i.setContext(Mn(s,{type:"segment",p0:p,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),Cp(x,u)&&m(h,f-1,g.loop,u),p=v,u=x}h<f-1&&m(h,f-1,g.loop,u)}return c}function fu(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Cp(n,t){if(!t)return!1;const e=[],i=function(s,r){return za(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function pr(n,t,e){return n.options.clip?n[e]:t[e]}function Ep(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:pr(e,t,"left"),right:pr(e,t,"right"),top:pr(i,t,"top"),bottom:pr(i,t,"bottom")}:t}function mu(n,t){const e=t._clip;if(e.disabled)return!1;const i=Ep(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 Op{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Bc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var en=new Op;const gu="transparent",Pp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=jc(n||gu),s=i.valid&&jc(t||gu);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Ap{constructor(t,e,i,s){const r=e[i];s=ts([t.to,s,r,t.from]);const a=ts([t.from,r,s]);this._active=!0,this._fn=t.fn||Pp[t.type||typeof a],this._easing=Gi[t.easing]||Gi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ts([t.to,e,s,t.from]),this._from=ts([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Ka{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ft(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ft(r))return;const a={};for(const o of e)a[o]=r[o];(St(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=Ip(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Rp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=r[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,o);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=h=new Ap(f,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return en.add(this._chart,i),!0}}function Rp(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 Ip(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 pu(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 Lp(n,t,e){if(e===!1)return!1;const i=pu(n,e),s=pu(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Np(n){let t,e,i,s;return ft(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function yu(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 bu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t===null)return;let u=!1;for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||Ye(t)===Ye(c))&&(t+=c)}return!u&&!i.all?0:t}function Fp(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function Za(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Bp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function zp(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 Hp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function _u(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 xu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Bp(r,a,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[l]:p,[c]:x}=g,v=g._stacks||(g._stacks={});f=v[c]=Hp(s,u,p),f[o]=x,f._top=_u(f,a,!0,i.type),f._bottom=_u(f,a,!1,i.type);const M=f._visualValues||(f._visualValues={});M[o]=x}}function Qa(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Wp(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Yp(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function es(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 Ja=n=>n==="reset"||n==="none",wu=(n,t)=>t?n:Object.assign({},n),Vp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yu(e,!0),values:null};class Fe{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=Za(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&&es(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,r=e.xAxisID=at(i.xAxisID,Qa(t,"x")),a=e.yAxisID=at(i.yAxisID,Qa(t,"y")),o=e.rAxisID=at(i.rAxisID,Qa(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Nc(this._data,this),t._stacked&&es(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ft(e)){const s=this._cachedMeta;this._data=Fp(e,s)}else if(i!==e){if(i){Nc(i,this);const s=this._cachedMeta;es(s),s._parsed=[]}e&&Object.isExtensible(e)&&Tg(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=Za(e.vScale,e),e.stack!==i.stack&&(s=!0,es(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(xu(this,e._parsed),e._stacked=Za(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:a}=i,o=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{St(s[t])?f=this.parseArrayData(i,s,t,e):ft(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[o]===null||c&&h[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&xu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,h=new Array(s);let f,m,g;for(f=0,m=s;f<m;++f)g=f+i,h[f]={[o]:u||r.parse(c[g],g),[l]:a.parse(e[g],g)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],o[l]={x:r.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],c[u]={x:r.parse(_n(m,o),f),y:a.parse(_n(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,a=e[t.axis],o={keys:yu(s,!0),values:e._stacks[t.axis]._visualValues};return bu(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=bu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=Vp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=zp(o);let f,m;function g(){m=s[f];const p=m[o.axis];return!Rt(m[t.axis])||u>p||h<p}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],Rt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Np(at(this.options.clip,Lp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const h=s[u];h.hidden||(h.active&&c?a.push(h):h.draw(t,r))}for(u=0;u<a.length;++u)a[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];r=a.$context||(a.$context=Yp(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Wp(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&pe(i);if(o)return wu(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(At.elements[t]),g=()=>this.getContext(i,s,e),p=c.resolveNamedOptions(f,m,g,h);return p.$shared&&(p.$shared=l,r[a]=Object.freeze(wu(p,l))),p}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Ka(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ja(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){Ja(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ja(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&es(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(Fe,"defaults",{}),P(Fe,"datasetElementType",null),P(Fe,"dataElementType",null);function jp(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=Fc(i.sort((s,r)=>s-r))}return n._cache.$bar}function $p(n){const t=n.iScale,e=jp(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(pe(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function Up(n,t,e,i){const s=e.barThickness;let r,a;return rt(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function qp(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function Xp(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function vu(n,t,e,i){return St(n)?Xp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Mu(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=o||s.parse(a[c],c),l.push(vu(f,h,r,c));return l}function to(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Gp(n,t,e){return n!==0?Ye(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Kp(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 Zp(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:l,top:c,bottom:u}=Kp(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[Su(u,a,o,l)]=!0,s=c)),r[Su(s,a,o,l)]=!0,n.borderSkipped=r}function Su(n,t,e,i){return i?(n=Qp(n,t,e),n=ku(n,e,t)):n=ku(n,t,e),n}function Qp(n,t,e){return n===t?e:n===e?t:n}function ku(n,t,e){return n==="start"?t:n==="end"?e:n}function Jp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class ns extends Fe{parsePrimitiveData(t,e,i,s){return Mu(t,e,i,s)}parseArrayData(t,e,i,s){return Mu(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,h=[];let f,m,g,p;for(f=i,m=i+s;f<m;++f)p=e[f],g={},g[r.axis]=r.parse(_n(p,c),f),h.push(vu(_n(p,u),g,a,f));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),a=r._custom,o=to(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const g=this.getParsed(m),p=r||rt(g[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),v=(g._stacks||{})[o.axis],M={horizontal:c,base:p.base,enableBorderRadius:!v||to(g._custom)||a===v._top||a===v._bottom,x:c?p.head:x.center,y:c?x.center:p.head,height:c?x.size:Math.abs(p.size),width:c?Math.abs(p.size):x.size};f&&(M.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const D=M.options||t[m].options;Zp(M,D,v,a),Jp(M,D,u.ratio),this.updateElement(t[m],m,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),l=o&&o[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(rt(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[at(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||$p(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=to(c);let h=l[e.axis],f=0,m=i?this.applyStack(e,l,i):h,g,p;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&Ye(h)!==Ye(c.barEnd)&&(f=0),f+=h);const x=!rt(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+m):g=v,p=g-v,Math.abs(p)<a){p=Gp(p,e,o)*a,h===o&&(v-=p/2);const M=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),k=Math.min(M,D),E=Math.max(M,D);v=Math.max(Math.min(v,E),k),g=v+p,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const M=Ye(p)*e.getLineWidthForValue(o)/2;v+=M,p-=M}return{size:p,base:v,head:g,center:g+p/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=at(s.maxBarThickness,1/0);let o,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?qp(t,e,s,u*c):Up(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(at(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;o=h.start+h.chunk*g+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}P(ns,"id","bar"),P(ns,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(ns,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class yr extends Fe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=at(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=at(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,h=o.axis;for(let f=e;f<e+i;f++){const m=t[f],g=!r&&this.getParsed(f),p={},x=p[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(g[u]),v=p[h]=r?o.getBasePixel():o.getPixelForValue(g[h]);p.skip=isNaN(x)||isNaN(v),c&&(p.options=l||this.resolveDataElementOptions(f,m.active?"active":s),r&&(p.options.radius=0)),this.updateElement(m,f,p,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+=at(i&&i._custom,r),s}}P(yr,"id","bubble"),P(yr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(yr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function ty(n,t,e){let i=1,s=1,r=0,a=0;if(t<Ot){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),h=Math.cos(l),f=Math.sin(l),m=(D,k,E)=>Xi(D,o,l,!0)?1:Math.max(k,k*e,E,E*e),g=(D,k,E)=>Xi(D,o,l,!0)?-1:Math.min(k,k*e,E,E*e),p=m(0,c,h),x=m(Pt,u,f),v=g(dt,c,h),M=g(dt+Pt,u,f);i=(p-v)/2,s=(x-M)/2,r=-(p+v)/2,a=-(x+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class nn extends Fe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(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(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(fg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:p}=ty(h,u,l),x=(i.width-a)/f,v=(i.height-a)/m,M=Math.max(Math.min(x,v)/2,0),D=Cc(this.options.radius,M),k=Math.max(D*l,0),E=(D-k)/this._getVisibleDatasetWeightTotal();this.offsetX=g*D,this.offsetY=p*D,s.total=this.calculateTotal(),this.outerRadius=D-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*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",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:p,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),M;for(M=0;M<e;++M)v+=this._circumference(M,r);for(M=e;M<e+i;++M){const D=this._circumference(M,r),k=t[M],E={x:u+this.offsetX,y:h+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:g,innerRadius:m};x&&(E.options=p||this.resolveDataElementOptions(M,k.active?"active":s)),v+=D,this.updateElement(k,M,E,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=Ki(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(nn,"id","doughnut"),P(nn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(nn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(nn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class is extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=Hc(e,s,a);this._drawStart=o,this._drawCount=l,Wc(e)&&(o=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=a.axis,m=o.axis,{spanGaps:g,segment:p}=this.options,x=wn(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",M=e+i,D=t.length;let k=e>0&&this.getParsed(e-1);for(let E=0;E<D;++E){const R=t[E],C=v?R:{};if(E<e||E>=M){C.skip=!0;continue}const b=this.getParsed(E),_=rt(b[m]),S=C[f]=a.getPixelForValue(b[f],E),O=C[m]=r||_?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,b,l):b[m],E);C.skip=isNaN(S)||isNaN(O)||_,C.stop=E>0&&Math.abs(b[f]-k[f])>x,p&&(C.parsed=b,C.raw=c.data[E]),h&&(C.options=u||this.resolveDataElementOptions(E,R.active?"active":s)),v||this.updateElement(R,E,C,s),k=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)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(is,"id","line"),P(is,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(is,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ss extends Fe{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=Ki(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return nu.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let m=f,g;const p=360/this.countVisibleElements();for(g=0;g<e;++g)m+=this._computeAngle(g,s,p);for(g=e;g<e+i;g++){const x=t[g];let v=m,M=m+this._computeAngle(g,s,p),D=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=M,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=M=f));const k={x:u,y:h,innerRadius:0,outerRadius:D,startAngle:v,endAngle:M,options:this.resolveDataElementOptions(g,x.active?"active":s)};this.updateElement(x,g,k,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,e).angle||i):0}}P(ss,"id","polarArea"),P(ss,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(ss,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class eo extends nn{}P(eo,"id","pie"),P(eo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class br extends Fe{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 nu.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),h=a?r.xCenter:u.x,f=a?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,o,m,s)}}}P(br,"id","radar"),P(br,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(br,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class _r extends Fe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=Hc(e,i,s);if(this._drawStart=r,this._drawCount=a,Wc(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=a.axis,g=o.axis,{spanGaps:p,segment:x}=this.options,v=wn(p)?p:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const E=t[k],R=this.getParsed(k),C=M?E:{},b=rt(R[g]),_=C[m]=a.getPixelForValue(R[m],k),S=C[g]=r||b?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,R,l):R[g],k);C.skip=isNaN(_)||isNaN(S)||b,C.stop=k>0&&Math.abs(R[m]-D[m])>v,x&&(C.parsed=R,C.raw=c.data[k]),f&&(C.options=h||this.resolveDataElementOptions(k,E.active?"active":s)),M||this.updateElement(E,k,C,s),D=R}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}P(_r,"id","scatter"),P(_r,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(_r,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var ey=Object.freeze({__proto__:null,BarController:ns,BubbleController:yr,DoughnutController:nn,LineController:is,PieController:eo,PolarAreaController:ss,RadarController:br,ScatterController:_r});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class no{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(no.prototype,t)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var Du={_date:no};function ny(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const c=o._reversePixels?kg:Je;if(i){if(s._sharedOptions){const u=r[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(r,t,e-h),m=c(r,t,e+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(p=>!rt(p[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(p=>!rt(p[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:r.length-1}}function rs(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:h,hi:f}=ny(r[o],t,a,s);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,c,m)}}}function iy(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function io(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||rs(n,e,t,function(o,l,c){!s&&!tn(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function sy(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=lr(a,{x:t.x,y:t.y});Xi(h,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return rs(n,e,t,r),s}function ry(n,t,e,i,s,r){let a=[];const o=iy(e);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const g=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(g))&&!m)return;const x=o(t,g);x<l?(a=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&a.push({element:u,datasetIndex:h,index:f})}return rs(n,e,t,c),a}function so(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?sy(n,t,e,s):ry(n,t,e,i,s,r)}function Tu(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return rs(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var ro={evaluateInteractionItems:rs,modes:{index(n,t,e,i){const s=Sn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?io(n,s,r,i,a):so(n,s,r,!1,i,a),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?io(n,s,r,i,a):so(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return io(n,s,r,i,a)},nearest(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return so(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=Sn(t,n);return Tu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Sn(t,n);return Tu(n,s,"y",e.intersect,i)}}};const Cu=["left","top","right","bottom"];function as(n,t){return n.filter(e=>e.pos===t)}function Eu(n,t){return n.filter(e=>Cu.indexOf(e.pos)===-1&&e.box.axis===t)}function os(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 ay(n){const t=[];let e,i,s,r,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function oy(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Cu.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function ly(n,t){const e=oy(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function cy(n){const t=ay(n),e=os(t.filter(c=>c.box.fullSize),!0),i=os(as(t,"left"),!0),s=os(as(t,"right")),r=os(as(t,"top"),!0),a=os(as(t,"bottom")),o=Eu(t,"x"),l=Eu(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:as(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function Ou(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Pu(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 uy(n,t,e,i){const{pos:s,box:r}=e,a=n.maxPadding;if(!ft(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?r.height:r.width),e.size=h.size/h.count,n[s]+=e.size}r.getPadding&&Pu(a,r.getPadding());const o=Math.max(0,t.outerWidth-Ou(a,n,"left","right")),l=Math.max(0,t.outerHeight-Ou(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function dy(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 hy(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function ls(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,hy(o.horizontal,t));const{same:h,other:f}=uy(t,e,o,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(o)}return c&&ls(s,t,e,i)||u}function xr(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 Au(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){const l=o.box,c=i[o.stack]||{placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const h=t.w*u,f=c.size||l.height;pe(c.start)&&(a=c.start),l.fullSize?xr(l,s.left,a,e.outerWidth-s.right-s.left,f):xr(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*u,f=c.size||l.width;pe(c.start)&&(r=c.start),l.fullSize?xr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):xr(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=a}var ae={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),a=Math.max(e-s.height,0),o=cy(n.boxes),l=o.vertical,c=o.horizontal;Dt(n.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=l.reduce((p,x)=>x.box.options&&x.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},s);Pu(f,Ut(i));const m=Object.assign({maxPadding:f,w:r,h:a,x:s.left,y:s.top},s),g=ly(l.concat(c),h);ls(o.fullSize,m,h,g),ls(l,m,h,g),ls(c,m,h,g)&&ls(l,m,h,g),dy(m),Au(o.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Au(o.rightAndBottom,m,h,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Dt(o.chartArea,p=>{const x=p.box;Object.assign(x,n.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Ru{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 fy extends Ru{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const wr="$chartjs",my={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Iu=n=>n===null||n==="";function gy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[wr]={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",Iu(s)){const r=ru(n,"width");r!==void 0&&(n.width=r)}if(Iu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=ru(n,"height");r!==void 0&&(n.height=r)}return n}const Lu=bp?{passive:!0}:!1;function py(n,t,e){n&&n.addEventListener(t,e,Lu)}function yy(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Lu)}function by(n,t){const e=my[n.type]||n.type,{x:i,y:s}=Sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function _y(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||vr(o.addedNodes,i),a=a&&!vr(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function xy(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||vr(o.removedNodes,i),a=a&&!vr(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const cs=new Map;let Nu=0;function Fu(){const n=window.devicePixelRatio;n!==Nu&&(Nu=n,cs.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function wy(n,t){cs.size||window.addEventListener("resize",Fu),cs.set(n,t)}function vy(n){cs.delete(n),cs.size||window.removeEventListener("resize",Fu)}function My(n,t,e){const i=n.canvas,s=i&&Ga(i);if(!s)return;const r=zc((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),wy(n,r),a}function ao(n,t,e){e&&e.disconnect(),t==="resize"&&vy(n)}function Sy(n,t,e){const i=n.canvas,s=zc(r=>{n.ctx!==null&&e(by(r,n))},n);return py(i,t,s),s}class ky extends Ru{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(gy(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[wr])return!1;const i=e[wr].initial;["height","width"].forEach(r=>{const a=i[r];rt(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[wr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:_y,detach:xy,resize:My}[e]||Sy;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ao,detach:ao,resize:ao}[e]||yy)(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&&Ga(t);return!!(e&&e.isConnected)}}function Dy(n){return!Xa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?fy:ky}class Jt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}P(Jt,"defaults",{}),P(Jt,"defaultRoutes");function Ty(n,t){const e=n.options.ticks,i=Cy(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Oy(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return Py(t,c,r,a/s),c;const u=Ey(r,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-o)/(a-1)):null;for(Mr(t,c,u,rt(m)?0:o-m,o),h=0,f=a-1;h<f;h++)Mr(t,c,u,r[h],r[h+1]);return Mr(t,c,u,l,rt(m)?t.length:l+m),c}return Mr(t,c,u),c}function Cy(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=Ay(n),s=t.length/e;if(!i)return Math.max(s,1);const r=xg(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function Oy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Py(n,t,e,i){let s=0,r=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function Mr(n,t,e,i,s){const r=at(i,0),a=Math.min(at(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*e))}function Ay(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,Bu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,zu=(n,t)=>Math.min(t||n,n);function Hu(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 Iy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function Ly(n,t){Dt(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 us(n){return n.drawTicks?n.tickLength:0}function Wu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(St(n.text)?n.text.length:1)*e.lineHeight+i.height}function Ny(n,t){return Mn(n,{scale:t,type:"scale"})}function Fy(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function By(n,t,e){let i=Ba(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Ry(i)),i}function zy(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,g;const p=a-s,x=o-r;if(n.isHorizontal()){if(m=re(i,r,o),ft(e)){const v=Object.keys(e)[0],M=e[v];g=u[v].getPixelForValue(M)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=Bu(n,e,t);f=o-r}else{if(ft(e)){const v=Object.keys(e)[0],M=e[v];m=u[v].getPixelForValue(M)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Bu(n,e,t);g=re(i,a,s),h=e==="left"?-Pt:Pt}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class Un 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=De(t,Number.POSITIVE_INFINITY),e=De(e,Number.NEGATIVE_INFINITY),i=De(i,Number.POSITIVE_INFINITY),s=De(s,Number.NEGATIVE_INFINITY),{min:De(t,i),max:De(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:De(e,De(i,e)),max:De(i,De(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Gg(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Hu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Ty(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){kt(this.options.afterUpdate,[this])}beforeSetDimensions(){kt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){kt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=kt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=zu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Qt(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:m/(i-1),h+6>o&&(o=m/(i-(t.offset?.5:1)),l=this.maxHeight-us(t.grid)-e.padding-Wu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=or(Math.min(Math.asin(Qt((u.highest.height+6)/o,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=Wu(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=us(r)+l):(t.height=this.maxHeight,t.width=us(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=$t(this.labelRotation),p=Math.cos(g),x=Math.sin(g);if(o){const v=i.mirror?0:x*h.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=i.mirror?0:p*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(c,u,x,p)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:a},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):r==="start"?m=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,m=e.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=e.height,h=0),this.paddingTop=u+a,this.paddingBottom=h+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){kt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)rt(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=Hu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,a=[],o=[],l=Math.floor(e/zu(e,i));let c=0,u=0,h,f,m,g,p,x,v,M,D,k,E;for(h=0;h<e;h+=l){if(g=t[h].label,p=this._resolveTickFontOptions(h),s.font=x=p.string,v=r[x]=r[x]||{data:{},gc:[]},M=p.lineHeight,D=k=0,!rt(g)&&!St(g))D=dr(s,v.data,v.gc,D,g),k=M;else if(St(g))for(f=0,m=g.length;f<m;++f)E=g[f],!rt(E)&&!St(E)&&(D=dr(s,v.data,v.gc,D,E),k+=M);a.push(D),o.push(k),c=Math.max(D,c),u=Math.max(k,u)}Ly(r,e);const R=a.indexOf(c),C=o.indexOf(u),b=_=>({width:a[_]||0,height:o[_]||0});return{first:b(0),last:b(e-1),widest:b(R),highest:b(C),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Sg(this._alignToPixels?Wn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Fy(this.getContext(),t,i))}return this.$context||(this.$context=Ny(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=$t(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:a,border:o}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=us(r),m=[],g=o.setContext(this.getContext()),p=g.display?g.width:0,x=p/2,v=function(G){return Wn(i,G,p)};let M,D,k,E,R,C,b,_,S,O,A,L;if(a==="top")M=v(this.bottom),C=this.bottom-f,_=M-x,O=v(t.top)+x,L=t.bottom;else if(a==="bottom")M=v(this.top),O=t.top,L=v(t.bottom)-x,C=M+x,_=this.top+f;else if(a==="left")M=v(this.right),R=this.right-f,b=M-x,S=v(t.left)+x,A=t.right;else if(a==="right")M=v(this.left),S=t.left,A=v(t.right)-x,R=M+x,b=this.left+f;else if(e==="x"){if(a==="center")M=v((t.top+t.bottom)/2+.5);else if(ft(a)){const G=Object.keys(a)[0],j=a[G];M=v(this.chart.scales[G].getPixelForValue(j))}O=t.top,L=t.bottom,C=M+x,_=C+f}else if(e==="y"){if(a==="center")M=v((t.left+t.right)/2);else if(ft(a)){const G=Object.keys(a)[0],j=a[G];M=v(this.chart.scales[G].getPixelForValue(j))}R=M-x,b=R-f,S=t.left,A=t.right}const B=at(s.ticks.maxTicksLimit,h),X=Math.max(1,Math.ceil(h/B));for(D=0;D<h;D+=X){const G=this.getContext(D),j=r.setContext(G),lt=o.setContext(G),q=j.lineWidth,Q=j.color,H=lt.dash||[],U=lt.dashOffset,Y=j.tickWidth,xt=j.tickColor,yt=j.tickBorderDash||[],vt=j.tickBorderDashOffset;k=Iy(this,D,l),k!==void 0&&(E=Wn(i,k,q),c?R=b=S=A=E:C=_=O=L=E,m.push({tx1:R,ty1:C,tx2:b,ty2:_,x1:S,y1:O,x2:A,y2:L,width:q,color:Q,borderDash:H,borderDashOffset:U,tickWidth:Y,tickColor:xt,tickBorderDash:yt,tickBorderDashOffset:vt}))}return this._ticksLength=h,this._borderValue=M,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=us(i.grid),m=f+u,g=h?-u:m,p=-$t(this.labelRotation),x=[];let v,M,D,k,E,R,C,b,_,S,O,A,L="middle";if(s==="top")R=this.bottom-g,C=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+g,C=this._getXAxisLabelAlignment();else if(s==="left"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,E=X.x}else if(s==="right"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,E=X.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+m;else if(ft(s)){const X=Object.keys(s)[0],G=s[X];R=this.chart.scales[X].getPixelForValue(G)+m}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")E=(t.left+t.right)/2-m;else if(ft(s)){const X=Object.keys(s)[0],G=s[X];E=this.chart.scales[X].getPixelForValue(G)}C=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const B=this._getLabelSizes();for(v=0,M=o.length;v<M;++v){D=o[v],k=D.label;const X=r.setContext(this.getContext(v));b=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),S=_.lineHeight,O=St(k)?k.length:1;const G=O/2,j=X.color,lt=X.textStrokeColor,q=X.textStrokeWidth;let Q=C;a?(E=b,C==="inner"&&(v===M-1?Q=this.options.reverse?"left":"right":v===0?Q=this.options.reverse?"right":"left":Q="center"),s==="top"?c==="near"||p!==0?A=-O*S+S/2:c==="center"?A=-B.highest.height/2-G*S+S:A=-B.highest.height+S/2:c==="near"||p!==0?A=S/2:c==="center"?A=B.highest.height/2-G*S:A=B.highest.height-O*S,h&&(A*=-1),p!==0&&!X.showLabelBackdrop&&(E+=S/2*Math.sin(p))):(R=b,A=(1-O)*S/2);let H;if(X.showLabelBackdrop){const U=Ut(X.backdropPadding),Y=B.heights[v],xt=B.widths[v];let yt=A-U.top,vt=0-U.left;switch(L){case"middle":yt-=Y/2;break;case"bottom":yt-=Y;break}switch(C){case"center":vt-=xt/2;break;case"right":vt-=xt;break;case"inner":v===M-1?vt-=xt:v>0&&(vt-=xt/2);break}H={left:vt,top:yt,width:xt+U.width,height:Y+U.height,color:X.backdropColor}}x.push({label:k,font:_,textOffset:A,options:{rotation:p,color:j,strokeColor:lt,strokeWidth:q,textAlign:Q,textBaseline:L,translation:[E,R],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,a=this._getLabelSizes(),o=t+r,l=a.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,a;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Wn(t,this.left,a)-a/2,u=Wn(t,this.right,o)+o/2,h=f=l):(h=Wn(t,this.top,a)-a/2,f=Wn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Qi(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;Yn(i,c,0,u,l,o)}s&&Ji(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),a=Ut(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ft(e)?(l+=a.bottom,St(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=zy(this,l,e,o);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:By(o,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=at(t.grid&&t.grid.z,-1),s=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Sr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Yy(e)&&(i=this.register(e));const s=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Hy(t,a,i),this.override&&At.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in At[s]&&(delete At[s][i],this.override&&delete Hn[i])}}function Hy(n,t,e){const i=$i(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&Wy(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function Wy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),a=t[e].split("."),o=a.pop(),l=a.join(".");At.route(r,s,l,o)})}function Yy(n){return"id"in n&&"defaults"in n}class Vy{constructor(){this.controllers=new Sr(Fe,"datasets",!0),this.elements=new Sr(Jt,"elements"),this.plugins=new Sr(Object,"plugins"),this.scales=new Sr(Un,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Dt(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=La(t);kt(i["before"+s],[],i),e[t](i),kt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ve=new Vy;class jy{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(kt(o,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){rt(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=at(i.options&&i.options.plugins,{}),r=$y(i);return s===!1&&!e?[]:qy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function $y(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Uy(n,t){return!t&&n===!1?null:n===!0?{}:n}function qy(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=Uy(i[l],s);c!==null&&r.push({plugin:o,options:Xy(n.config,{plugin:o,local:e[l]},c,a)})}return r}function Xy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function oo(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Gy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Ky(n,t){return n===t?"_index_":"_value_"}function Yu(n){if(n==="x"||n==="y"||n==="r")return n}function Zy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function lo(n,...t){if(Yu(n))return n;for(const e of t){const i=e.axis||Zy(e.position)||n.length>1&&Yu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Vu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Qy(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 Vu(n,"x",e[0])||Vu(n,"y",e[0])}return{}}function Jy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=oo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!ft(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=lo(a,o,Qy(a,n),At.scales[o.type]),c=Ky(l,s),u=e.scales||{};r[a]=Ui(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||oo(o,t),u=(Hn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Gy(h,l),m=a[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),Ui(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(a=>{const o=r[a];Ui(o,[At.scales[o.type],At.scale])}),r}function ju(n){const t=n.options||(n.options={});t.plugins=at(t.plugins,{}),t.scales=Jy(n,t)}function $u(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function tb(n){return n=n||{},n.data=$u(n.data),ju(n),n}const Uu=new Map,qu=new Set;function kr(n,t){let e=Uu.get(n);return e||(e=t(),Uu.set(n,e),qu.add(e)),e}const ds=(n,t,e)=>{const i=_n(t,e);i!==void 0&&n.add(i)};class eb{constructor(t){this._config=tb(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$u(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ju(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return kr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return kr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return kr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>ds(l,t,h))),u.forEach(h=>ds(l,s,h)),u.forEach(h=>ds(l,Hn[r]||{},h)),u.forEach(h=>ds(l,At,h)),u.forEach(h=>ds(l,Wa,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qu.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},At.datasets[e]||{},{type:e},At,Wa]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=Xu(this._resolverCache,t,s);let l=a;if(ib(a,e)){r.$shared=!1,i=ye(i)?i():i;const c=this.createResolver(t,i,o);l=gi(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Xu(this._resolverCache,t,i);return ft(e)?gi(r,e,void 0,s):r}}function Xu(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:$a(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const nb=n=>ft(n)&&Object.getOwnPropertyNames(n).some(t=>ye(n[t]));function ib(n,t){const{isScriptable:e,isIndexable:i}=Kc(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(ye(o)||nb(o))||a&&St(o))return!0}return!1}var sb="4.5.0";const rb=["top","bottom","left","right","chartArea"];function Gu(n,t){return n==="top"||n==="bottom"||rb.indexOf(n)===-1&&t==="x"}function Ku(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Zu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),kt(e&&e.onComplete,[n],t)}function ab(n){const t=n.chart,e=t.options.animation;kt(e&&e.onProgress,[n],t)}function Qu(n){return Xa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Dr={},Ju=n=>{const t=Qu(n);return Object.values(Dr).filter(e=>e.canvas===t).pop()};function ob(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function lb(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let be=(Rn=class{static register(...t){Ve.add(...t),td()}static unregister(...t){Ve.remove(...t),td()}constructor(t,e){const i=this.config=new eb(e),s=Qu(t),r=Ju(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Dy(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=hg(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new jy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Cg(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Dr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Zu),en.listen(this,"progress",ab),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return rt(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():su(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return qc(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,e){en.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,su(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),kt(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=lo(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Dt(r,a=>{const o=a.options,l=o.id,c=lo(l,o),u=at(o.type,a.dtype);(o.position===void 0||Gu(o.position,c)!==Gu(a.dposition))&&(o.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ve.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),Dt(s,(a,o)=>{a||delete i[o]}),Dt(i,a=>{ae.configure(this,a,a.options),ae.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ku("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||oo(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Ve.getController(o),{datasetElementType:c,dataElementType:u}=At.datasets[o];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&r.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||Dt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ku("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Dt(this.scales,t=>{ae.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Pc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const a=i==="_removeElements"?-r:r;ob(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Pc(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;ae.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Dt(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,ye(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Zu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const a=e[s];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=mu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Qi(e,s),t.controller.draw(),s&&Ji(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return tn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=ro.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Mn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);pe(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),en.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),qc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Dr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};Dt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!ir(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,a=e,o=this._getActiveElements(t,s,i,a),l=bg(t),c=lb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,kt(r.onHover,[t,o,this],this),l&&kt(r.onClick,[t,o,this],this));const u=!ir(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},P(Rn,"defaults",At),P(Rn,"instances",Dr),P(Rn,"overrides",Hn),P(Rn,"registry",Ve),P(Rn,"version",sb),P(Rn,"getChart",Ju),Rn);function td(){return Dt(be.instances,n=>n._plugins.invalidate())}function cb(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:a,innerRadius:o,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,se(i-e));if(n.beginPath(),n.arc(s,r,a-c/2,i+h/2,e-h/2),o>0){const f=Math.min(c/o,se(i-e));n.arc(s,r,o+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*se(i-e));if(u==="round")n.arc(s,r,f,e-dt/2,i+dt/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(e+dt/2)+s,p=-m*Math.sin(e+dt/2)+r,x=m*Math.cos(i+dt/2)+s,v=m*Math.sin(i+dt/2)+r;n.lineTo(g,p),n.lineTo(x,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function ub(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+Pt,i-Pt),n.closePath(),n.clip()}function db(n){return ja(n,["outerStart","outerEnd","innerStart","innerEnd"])}function hb(n,t,e,i){const s=db(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Qt(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Qt(s.innerStart,0,a),innerEnd:Qt(s.innerEnd,0,a)}}function bi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Tr(n,t,e,i,s,r){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let m=0;const g=s-l;if(i){const X=u>0?u-i:0,G=h>0?h-i:0,j=(X+G)/2,lt=j!==0?g*j/(j+i):g;m=(g-lt)/2}const p=Math.max(.001,g*h-e/dt)/h,x=(g-p)/2,v=l+x+m,M=s-x-m,{outerStart:D,outerEnd:k,innerStart:E,innerEnd:R}=hb(t,f,h,M-v),C=h-D,b=h-k,_=v+D/C,S=M-k/b,O=f+E,A=f+R,L=v+E/O,B=M-R/A;if(n.beginPath(),r){const X=(_+S)/2;if(n.arc(a,o,h,_,X),n.arc(a,o,h,X,S),k>0){const q=bi(b,S,a,o);n.arc(q.x,q.y,k,S,M+Pt)}const G=bi(A,M,a,o);if(n.lineTo(G.x,G.y),R>0){const q=bi(A,B,a,o);n.arc(q.x,q.y,R,M+Pt,B+Math.PI)}const j=(M-R/f+(v+E/f))/2;if(n.arc(a,o,f,M-R/f,j,!0),n.arc(a,o,f,j,v+E/f,!0),E>0){const q=bi(O,L,a,o);n.arc(q.x,q.y,E,L+Math.PI,v-Pt)}const lt=bi(C,v,a,o);if(n.lineTo(lt.x,lt.y),D>0){const q=bi(C,_,a,o);n.arc(q.x,q.y,D,v-Pt,_)}}else{n.moveTo(a,o);const X=Math.cos(_)*h+a,G=Math.sin(_)*h+o;n.lineTo(X,G);const j=Math.cos(S)*h+a,lt=Math.sin(S)*h+o;n.lineTo(j,lt)}n.closePath()}function fb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Tr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%Ot||Ot))}return Tr(n,t,e,i,l,s),n.fill(),l}function mb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){Tr(n,t,e,i,p,s);for(let x=0;x<r;++x)n.stroke();isNaN(o)||(p=a+(o%Ot||Ot))}g&&ub(n,t,p),l.selfJoin&&p-a>=dt&&m===0&&u!=="miter"&&cb(n,t,p),r||(Tr(n,t,e,i,p,s),n.stroke())}class hs extends Jt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:a,distance:o}=lr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,g=at(f,c-l),p=Xi(a,l,c)&&l!==c,x=g>=Ot||p,v=Qe(o,u+m,h+m);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+a)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>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(dt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,fb(e,this,u,a,o),mb(e,this,u,a,o),e.restore()}}P(hs,"id","arc"),P(hs,"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}),P(hs,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(hs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function ed(n,t,e=t){n.lineCap=at(e.borderCapStyle,t.borderCapStyle),n.setLineDash(at(e.borderDash,t.borderDash)),n.lineDashOffset=at(e.borderDashOffset,t.borderDashOffset),n.lineJoin=at(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=at(e.borderWidth,t.borderWidth),n.strokeStyle=at(e.borderColor,t.borderColor)}function gb(n,t,e){n.lineTo(e.x,e.y)}function pb(n){return n.stepped?Hg:n.tension||n.cubicInterpolationMode==="monotone"?Wg:gb}function nd(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function yb(n,t,e,i){const{points:s,options:r}=t,{count:a,start:o,loop:l,ilen:c}=nd(s,e,i),u=pb(r);let{move:h=!0,reverse:f}=i||{},m,g,p;for(m=0;m<=c;++m)g=s[(o+(f?c-m:m))%a],!g.skip&&(h?(n.moveTo(g.x,g.y),h=!1):u(n,p,g,f,r.stepped),p=g);return l&&(g=s[(o+(f?c:0))%a],u(n,p,g,f,r.stepped)),!!l}function bb(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=nd(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,g,p,x,v;const M=k=>(a+(c?o-k:k))%r,D=()=>{p!==x&&(n.lineTo(u,x),n.lineTo(u,p),n.lineTo(u,v))};for(l&&(m=s[M(0)],n.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=s[M(f)],m.skip)continue;const k=m.x,E=m.y,R=k|0;R===g?(E<p?p=E:E>x&&(x=E),u=(h*u+k)/++h):(D(),n.lineTo(k,E),g=R,h=0,p=x=E),v=E}D()}function co(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?bb:yb}function _b(n){return n.stepped?_p:n.tension||n.cubicInterpolationMode==="monotone"?xp:jn}function xb(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),ed(n,t.options),n.stroke(s)}function wb(n,t,e,i){const{segments:s,options:r}=t,a=co(t);for(const o of s)ed(n,r,o.style),n.beginPath(),a(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const vb=typeof Path2D=="function";function Mb(n,t,e,i){vb&&!t.options.segment?xb(n,t,e,i):wb(n,t,e,i)}class kn 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;dp(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=Dp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,a=du(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=_b(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:h,end:f}=a[c],m=r[h],g=r[f];if(m===g){o.push(m);continue}const p=Math.abs((s-m[e])/(g[e]-m[e])),x=l(m,g,p,i.stepped);x[e]=t[e],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,e,i){return co(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=co(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Mb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(kn,"id","line"),P(kn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(kn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(kn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function id(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Cr extends Jt{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return id(this,e,"x",i)}inYRange(e,i){return id(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!tn(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Va(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(Cr,"id","point"),P(Cr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(Cr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function sd(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,h;return n.horizontal?(h=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,o=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function Dn(n,t,e,i){return n?0:Qt(t,e,i)}function Sb(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Gc(i);return{t:Dn(s.top,r.top,0,e),r:Dn(s.right,r.right,0,t),b:Dn(s.bottom,r.bottom,0,e),l:Dn(s.left,r.left,0,t)}}function kb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),a=Math.min(t,e),o=n.borderSkipped,l=i||ft(s);return{topLeft:Dn(!l||o.top||o.left,r.topLeft,0,a),topRight:Dn(!l||o.top||o.right,r.topRight,0,a),bottomLeft:Dn(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:Dn(!l||o.bottom||o.right,r.bottomRight,0,a)}}function Db(n){const t=sd(n),e=t.right-t.left,i=t.bottom-t.top,s=Sb(n,e/2,i/2),r=kb(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 uo(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&sd(n,i);return o&&(s||Qe(t,o.left,o.right))&&(r||Qe(e,o.top,o.bottom))}function Tb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Cb(n,t){n.rect(t.x,t.y,t.w,t.h)}function ho(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+a,radius:n.radius}}class Er 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:a}=Db(this),o=Tb(a.radius)?mi:Cb;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,ho(a,e,r)),t.clip(),o(t,ho(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,ho(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return uo(this,t,e,i)}inXRange(t,e){return uo(this,t,null,e)}inYRange(t,e){return uo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(Er,"id","bar"),P(Er,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(Er,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Eb=Object.freeze({__proto__:null,ArcElement:hs,BarElement:Er,LineElement:kn,PointElement:Cr});const fo=["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)"],rd=fo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ad(n){return fo[n%fo.length]}function od(n){return rd[n%rd.length]}function Ob(n,t){return n.borderColor=ad(t),n.backgroundColor=od(t),++t}function Pb(n,t){return n.backgroundColor=n.data.map(()=>ad(t++)),t}function Ab(n,t){return n.backgroundColor=n.data.map(()=>od(t++)),t}function Rb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof nn?t=Pb(e,t):s instanceof ss?t=Ab(e,t):s&&(t=Ob(e,t))}}function ld(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Ib(n){return n&&(n.borderColor||n.backgroundColor)}function Lb(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var Nb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,a=ld(i)||Ib(s)||r&&ld(r)||Lb();if(!e.forceOverride&&a)return;const o=Rb(n);i.forEach(o)}};function Fb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,g,p;for(a[l++]=n[u],h=0;h<r-2;h++){let x=0,v=0,M;const D=Math.floor((h+1)*o)+1+t,k=Math.min(Math.floor((h+2)*o)+1,e)+t,E=k-D;for(M=D;M<k;M++)x+=n[M].x,v+=n[M].y;x/=E,v/=E;const R=Math.floor(h*o)+1+t,C=Math.min(Math.floor((h+1)*o)+1,e)+t,{x:b,y:_}=n[u];for(m=g=-1,M=R;M<C;M++)g=.5*Math.abs((b-x)*(n[M].y-_)-(b-n[M].x)*(v-_)),g>m&&(m=g,f=n[M],p=M);a[l++]=f,u=p}return a[l++]=n[c],a}function Bb(n,t,e,i){let s=0,r=0,a,o,l,c,u,h,f,m,g,p;const x=[],v=t+e-1,M=n[t].x,k=n[v].x-M;for(a=t;a<t+e;++a){o=n[a],l=(o.x-M)/k*i,c=o.y;const E=l|0;if(E===u)c<g?(g=c,h=a):c>p&&(p=c,f=a),s=(r*s+o.x)/++r;else{const R=a-1;if(!rt(h)&&!rt(f)){const C=Math.min(h,f),b=Math.max(h,f);C!==m&&C!==R&&x.push({...n[C],x:s}),b!==m&&b!==R&&x.push({...n[b],x:s})}a>0&&R!==m&&x.push(n[R]),x.push(o),u=E,r=0,g=p=c,h=f=m=a}}return x}function cd(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 ud(n){n.data.datasets.forEach(t=>{cd(t)})}function zb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Qt(Je(t,r.axis,a).lo,0,e-1)),c?s=Qt(Je(t,r.axis,o).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){ud(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(ts([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=zb(l,c);const m=e.threshold||4*i;if(f<=m){cd(s);return}rt(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(e.algorithm){case"lttb":g=Fb(c,h,f,i,e);break;case"min-max":g=Bb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){ud(n)}};function Wb(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=Or(l,c,s);const u=mo(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const h=du(t,u);for(const f of h){const m=mo(e,r[f.start],r[f.end],f.loop),g=uu(o,s,m);for(const p of g)a.push({source:p,target:f,start:{[e]:dd(u,m,"start",Math.max)},end:{[e]:dd(u,m,"end",Math.min)}})}}return a}function mo(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 Yb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:o})=>{o=Or(a,o,s);const l=s[a],c=s[o];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Or(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function dd(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function hd(n,t){let e=[],i=!1;return St(n)?(i=!0,e=n):e=Yb(n,t),e.length?new kn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function fd(n){return n&&n.fill!==!1}function Vb(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function jb(n,t,e){const i=Xb(n);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?$b(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function $b(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Ub(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ft(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function qb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ft(n)?i=n.value:i=t.getBaseValue(),i}function Xb(n){const t=n.options,e=t.fill;let i=at(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Gb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=Kb(t,e);o.push(hd({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++)Zb(s,a[u],o)}return new kn({points:s,options:{}})}function Kb(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 Zb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:a,last:o,point:l}=Qb(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function Qb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=a[u.start][e],f=a[u.end][e];if(Qe(s,h,f)){o=s===h,l=s===f;break}}return{first:o,last:l,point:i}}class md{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:Ot},t.arc(s,r,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function Jb(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return t0(t,e);if(e==="stack")return Gb(n);if(e==="shape")return!0;const s=e0(n);return s instanceof md?s:hd(s,i)}function t0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function e0(n){return(n.scale||{}).getPointPositionForValue?i0(n):n0(n)}function n0(n){const{scale:t={},fill:e}=n,i=Ub(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function i0(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=qb(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new md({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function go(n,t,e){const i=Jb(t),{chart:s,index:r,line:a,scale:o,axis:l}=t,c=a.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},g=s.getDatasetMeta(r),p=mu(s,g);i&&a.points.length&&(Qi(n,e),s0(n,{line:a,target:i,above:f,below:m,area:e,scale:o,axis:l,clip:p}),Ji(n))}function s0(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(gd(n,i,a.top),po(n,{line:e,target:i,color:s,scale:o,property:c,clip:l}),n.restore(),n.save(),gd(n,i,a.bottom)):c==="y"&&(pd(n,i,a.left),po(n,{line:e,target:i,color:r,scale:o,property:c,clip:l}),n.restore(),n.save(),pd(n,i,a.right),u=s)),po(n,{line:e,target:i,color:u,scale:o,property:c,clip:l}),n.restore()}function gd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Or(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function pd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Or(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function po(n,t){const{line:e,target:i,property:s,color:r,scale:a,clip:o}=t,l=Wb(e,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=r}={}}=c,g=i!==!0;n.save(),n.fillStyle=m,r0(n,a,o,g&&mo(s,h,f)),n.beginPath();const p=!!e.pathSegment(n,c);let x;if(g){p?n.closePath():yd(n,i,f,s);const v=!!i.pathSegment(n,u,{move:p,reverse:!0});x=p&&v,x||yd(n,i,h,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function r0(n,t,e,i){const s=t.chart.chartArea,{property:r,start:a,end:o}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=a,c=s.top,u=o,h=s.bottom):(l=s.left,c=a,u=s.right,h=o),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function yd(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var a0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof kn&&(l={visible:n.isDatasetVisible(a),index:a,fill:jb(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Vb(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&go(n.ctx,o,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;fd(r)&&go(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!fd(i)||e.drawTime!=="beforeDatasetDraw"||go(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bd=(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)}},o0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class _d 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=kt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=It(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=bd(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,p)=>{const x=i+e/2+r.measureText(g.text).width;(p===0||c[c.length-1]+x+2*o>a)&&(h+=u,c[c.length-(p>0?0:1)]=0,m+=u,f++),l[p]={left:0,top:m,row:f,width:x,height:s},c[c.length-1]+=x+o}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,g=0,p=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:M,itemHeight:D}=l0(i,e,r,x,s);v>0&&m+D+2*o>u&&(h+=f+o,c.push({width:f,height:m}),g+=f+o,p++,f=m=0),l[v]={left:g,top:m,col:p,width:M,height:D},f=Math.max(f,M),m+=D+o}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,a=yi(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=re(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=re(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Qi(t,this),this._draw(),Ji(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=At.color,l=yi(t.rtl,this.left,this.width),c=It(a.font),{padding:u}=a,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:x}=bd(a,h),v=function(R,C,b){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const _=at(b.lineWidth,1);if(s.fillStyle=at(b.fillStyle,o),s.lineCap=at(b.lineCap,"butt"),s.lineDashOffset=at(b.lineDashOffset,0),s.lineJoin=at(b.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=at(b.strokeStyle,o),s.setLineDash(at(b.lineDash,[])),a.usePointStyle){const S={radius:p*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},O=l.xPlus(R,g/2),A=C+f;Xc(s,S,O,A,a.pointStyleWidth&&g)}else{const S=C+Math.max((h-p)/2,0),O=l.leftForLtr(R,g),A=vn(b.borderRadius);s.beginPath(),Object.values(A).some(L=>L!==0)?mi(s,{x:O,y:S,w:g,h:p,radius:A}):s.rect(O,S,g,p),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(R,C,b){Yn(s,b.text,R,C+x/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},D=this.isHorizontal(),k=this._computeTitleHeight();D?m={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+k,line:0}:m={x:this.left+u,y:re(r,this.top+k+u,this.bottom-e[0].height),line:0},au(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach((R,C)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const b=s.measureText(R.text).width,_=l.textAlign(R.textAlign||(R.textAlign=a.textAlign)),S=g+f+b;let O=m.x,A=m.y;l.setWidth(this.width),D?C>0&&O+S+u>this.right&&(A=m.y+=E,m.line++,O=m.x=re(r,this.left+u,this.right-i[m.line])):C>0&&A+E>this.bottom&&(O=m.x=O+e[m.line].width+u,m.line++,A=m.y=re(r,this.top+k+u,this.bottom-e[m.line].height));const L=l.x(O);if(v(L,A,R),O=Eg(_,O+g+f,D?O+S:this.right,t.rtl),M(l.x(O),A,R),D)m.x+=S+u;else if(typeof R.text!="string"){const B=c.lineHeight;m.y+=xd(R,B)+u}else m.y+=E}),ou(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=yi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=re(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((p,x)=>Math.max(p,x.height),0);u=c+re(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=re(o,h,h+f);a.textAlign=r.textAlign(Ba(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Yn(a,e.text,m,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(Qe(t,this.left,this.right)&&Qe(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Qe(t,s.left,s.left+s.width)&&Qe(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!d0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=o0(s,i);s&&!r&&kt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&kt(e.onHover,[t,i,this],this)}else i&&kt(e.onClick,[t,i,this],this)}}function l0(n,t,e,i,s){const r=c0(i,n,t,e),a=u0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function c0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function u0(n,t,e){let i=n;return typeof t.text!="string"&&(i=xd(t,e)),i}function xd(n,t){const e=n.text?n.text.length:0;return t*e}function d0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var h0={id:"legend",_element:_d,start(n,t,e){const i=n.legend=new _d({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i)},stop(n){ae.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ae.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=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:a&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class yo 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=St(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:a}=this,o=a.align;let l=0,c,u,h;return this.isHorizontal()?(u=re(o,i,r),h=e+t,c=r-i):(a.position==="left"?(u=i+t,h=re(o,s,e),l=dt*-.5):(u=r-t,h=re(o,e,s),l=dt*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Ba(e.align),textBaseline:"middle",translation:[a,o]})}}function f0(n,t){const e=new yo({ctx:n.ctx,options:t,chart:n});ae.configure(n,e,t),ae.addBox(n,e),n.titleBlock=e}var m0={id:"title",_element:yo,start(n,t,e){f0(n,e)},stop(n){const t=n.titleBlock;ae.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ae.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 Pr=new WeakMap;var g0={id:"subtitle",start(n,t,e){const i=new yo({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i),Pr.set(n,i)},stop(n){ae.removeBox(n,Pr.get(n)),Pr.delete(n)},beforeUpdate(n,t,e){const i=Pr.get(n);ae.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 fs={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=fi(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function je(n,t){return t&&(St(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function sn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class Op{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Bc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var en=new Op;const gu="transparent",Pp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=jc(n||gu),s=i.valid&&jc(t||gu);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Ap{constructor(t,e,i,s){const r=e[i];s=ts([t.to,s,r,t.from]);const a=ts([t.from,r,s]);this._active=!0,this._fn=t.fn||Pp[t.type||typeof a],this._easing=Gi[t.easing]||Gi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ts([t.to,e,s,t.from]),this._from=ts([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Ka{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ft(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ft(r))return;const a={};for(const o of e)a[o]=r[o];(St(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=Ip(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Rp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=r[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,o);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=h=new Ap(f,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return en.add(this._chart,i),!0}}function Rp(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 Ip(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 pu(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 Lp(n,t,e){if(e===!1)return!1;const i=pu(n,e),s=pu(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Np(n){let t,e,i,s;return ft(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function yu(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 bu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t===null)return;let u=!1;for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||Ye(t)===Ye(c))&&(t+=c)}return!u&&!i.all?0:t}function Fp(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function Za(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Bp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function zp(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 Hp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function _u(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 xu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Bp(r,a,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[l]:p,[c]:x}=g,v=g._stacks||(g._stacks={});f=v[c]=Hp(s,u,p),f[o]=x,f._top=_u(f,a,!0,i.type),f._bottom=_u(f,a,!1,i.type);const M=f._visualValues||(f._visualValues={});M[o]=x}}function Qa(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Wp(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Yp(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function es(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 Ja=n=>n==="reset"||n==="none",wu=(n,t)=>t?n:Object.assign({},n),Vp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yu(e,!0),values:null};class Fe{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=Za(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&&es(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,r=e.xAxisID=at(i.xAxisID,Qa(t,"x")),a=e.yAxisID=at(i.yAxisID,Qa(t,"y")),o=e.rAxisID=at(i.rAxisID,Qa(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Nc(this._data,this),t._stacked&&es(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ft(e)){const s=this._cachedMeta;this._data=Fp(e,s)}else if(i!==e){if(i){Nc(i,this);const s=this._cachedMeta;es(s),s._parsed=[]}e&&Object.isExtensible(e)&&Dg(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=Za(e.vScale,e),e.stack!==i.stack&&(s=!0,es(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(xu(this,e._parsed),e._stacked=Za(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:a}=i,o=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{St(s[t])?f=this.parseArrayData(i,s,t,e):ft(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[o]===null||c&&h[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&xu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,h=new Array(s);let f,m,g;for(f=0,m=s;f<m;++f)g=f+i,h[f]={[o]:u||r.parse(c[g],g),[l]:a.parse(e[g],g)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],o[l]={x:r.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],c[u]={x:r.parse(_n(m,o),f),y:a.parse(_n(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,a=e[t.axis],o={keys:yu(s,!0),values:e._stacks[t.axis]._visualValues};return bu(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=bu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=Vp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=zp(o);let f,m;function g(){m=s[f];const p=m[o.axis];return!Rt(m[t.axis])||u>p||h<p}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],Rt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Np(at(this.options.clip,Lp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const h=s[u];h.hidden||(h.active&&c?a.push(h):h.draw(t,r))}for(u=0;u<a.length;++u)a[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];r=a.$context||(a.$context=Yp(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Wp(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&pe(i);if(o)return wu(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(At.elements[t]),g=()=>this.getContext(i,s,e),p=c.resolveNamedOptions(f,m,g,h);return p.$shared&&(p.$shared=l,r[a]=Object.freeze(wu(p,l))),p}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Ka(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ja(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){Ja(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ja(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&es(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(Fe,"defaults",{}),P(Fe,"datasetElementType",null),P(Fe,"dataElementType",null);function jp(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=Fc(i.sort((s,r)=>s-r))}return n._cache.$bar}function $p(n){const t=n.iScale,e=jp(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(pe(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function Up(n,t,e,i){const s=e.barThickness;let r,a;return rt(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function qp(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function Xp(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function vu(n,t,e,i){return St(n)?Xp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Mu(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=o||s.parse(a[c],c),l.push(vu(f,h,r,c));return l}function to(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Gp(n,t,e){return n!==0?Ye(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Kp(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 Zp(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:l,top:c,bottom:u}=Kp(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[Su(u,a,o,l)]=!0,s=c)),r[Su(s,a,o,l)]=!0,n.borderSkipped=r}function Su(n,t,e,i){return i?(n=Qp(n,t,e),n=ku(n,e,t)):n=ku(n,t,e),n}function Qp(n,t,e){return n===t?e:n===e?t:n}function ku(n,t,e){return n==="start"?t:n==="end"?e:n}function Jp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class ns extends Fe{parsePrimitiveData(t,e,i,s){return Mu(t,e,i,s)}parseArrayData(t,e,i,s){return Mu(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,h=[];let f,m,g,p;for(f=i,m=i+s;f<m;++f)p=e[f],g={},g[r.axis]=r.parse(_n(p,c),f),h.push(vu(_n(p,u),g,a,f));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),a=r._custom,o=to(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const g=this.getParsed(m),p=r||rt(g[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),v=(g._stacks||{})[o.axis],M={horizontal:c,base:p.base,enableBorderRadius:!v||to(g._custom)||a===v._top||a===v._bottom,x:c?p.head:x.center,y:c?x.center:p.head,height:c?x.size:Math.abs(p.size),width:c?Math.abs(p.size):x.size};f&&(M.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const T=M.options||t[m].options;Zp(M,T,v,a),Jp(M,T,u.ratio),this.updateElement(t[m],m,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),l=o&&o[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(rt(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[at(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||$p(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=to(c);let h=l[e.axis],f=0,m=i?this.applyStack(e,l,i):h,g,p;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&Ye(h)!==Ye(c.barEnd)&&(f=0),f+=h);const x=!rt(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+m):g=v,p=g-v,Math.abs(p)<a){p=Gp(p,e,o)*a,h===o&&(v-=p/2);const M=e.getPixelForDecimal(0),T=e.getPixelForDecimal(1),k=Math.min(M,T),E=Math.max(M,T);v=Math.max(Math.min(v,E),k),g=v+p,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const M=Ye(p)*e.getLineWidthForValue(o)/2;v+=M,p-=M}return{size:p,base:v,head:g,center:g+p/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=at(s.maxBarThickness,1/0);let o,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?qp(t,e,s,u*c):Up(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(at(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;o=h.start+h.chunk*g+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}P(ns,"id","bar"),P(ns,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(ns,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class yr extends Fe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=at(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=at(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,h=o.axis;for(let f=e;f<e+i;f++){const m=t[f],g=!r&&this.getParsed(f),p={},x=p[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(g[u]),v=p[h]=r?o.getBasePixel():o.getPixelForValue(g[h]);p.skip=isNaN(x)||isNaN(v),c&&(p.options=l||this.resolveDataElementOptions(f,m.active?"active":s),r&&(p.options.radius=0)),this.updateElement(m,f,p,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+=at(i&&i._custom,r),s}}P(yr,"id","bubble"),P(yr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(yr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function ty(n,t,e){let i=1,s=1,r=0,a=0;if(t<Ot){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),h=Math.cos(l),f=Math.sin(l),m=(T,k,E)=>Xi(T,o,l,!0)?1:Math.max(k,k*e,E,E*e),g=(T,k,E)=>Xi(T,o,l,!0)?-1:Math.min(k,k*e,E,E*e),p=m(0,c,h),x=m(Pt,u,f),v=g(dt,c,h),M=g(dt+Pt,u,f);i=(p-v)/2,s=(x-M)/2,r=-(p+v)/2,a=-(x+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class nn extends Fe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(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(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(fg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:p}=ty(h,u,l),x=(i.width-a)/f,v=(i.height-a)/m,M=Math.max(Math.min(x,v)/2,0),T=Cc(this.options.radius,M),k=Math.max(T*l,0),E=(T-k)/this._getVisibleDatasetWeightTotal();this.offsetX=g*T,this.offsetY=p*T,s.total=this.calculateTotal(),this.outerRadius=T-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*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",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:p,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),M;for(M=0;M<e;++M)v+=this._circumference(M,r);for(M=e;M<e+i;++M){const T=this._circumference(M,r),k=t[M],E={x:u+this.offsetX,y:h+this.offsetY,startAngle:v,endAngle:v+T,circumference:T,outerRadius:g,innerRadius:m};x&&(E.options=p||this.resolveDataElementOptions(M,k.active?"active":s)),v+=T,this.updateElement(k,M,E,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=Ki(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(nn,"id","doughnut"),P(nn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(nn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(nn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class is extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=Hc(e,s,a);this._drawStart=o,this._drawCount=l,Wc(e)&&(o=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=a.axis,m=o.axis,{spanGaps:g,segment:p}=this.options,x=wn(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",M=e+i,T=t.length;let k=e>0&&this.getParsed(e-1);for(let E=0;E<T;++E){const R=t[E],C=v?R:{};if(E<e||E>=M){C.skip=!0;continue}const b=this.getParsed(E),_=rt(b[m]),S=C[f]=a.getPixelForValue(b[f],E),O=C[m]=r||_?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,b,l):b[m],E);C.skip=isNaN(S)||isNaN(O)||_,C.stop=E>0&&Math.abs(b[f]-k[f])>x,p&&(C.parsed=b,C.raw=c.data[E]),h&&(C.options=u||this.resolveDataElementOptions(E,R.active?"active":s)),v||this.updateElement(R,E,C,s),k=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)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(is,"id","line"),P(is,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(is,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ss extends Fe{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=Ki(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return nu.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let m=f,g;const p=360/this.countVisibleElements();for(g=0;g<e;++g)m+=this._computeAngle(g,s,p);for(g=e;g<e+i;g++){const x=t[g];let v=m,M=m+this._computeAngle(g,s,p),T=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=M,r&&(l.animateScale&&(T=0),l.animateRotate&&(v=M=f));const k={x:u,y:h,innerRadius:0,outerRadius:T,startAngle:v,endAngle:M,options:this.resolveDataElementOptions(g,x.active?"active":s)};this.updateElement(x,g,k,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,e).angle||i):0}}P(ss,"id","polarArea"),P(ss,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(ss,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class eo extends nn{}P(eo,"id","pie"),P(eo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class br extends Fe{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 nu.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),h=a?r.xCenter:u.x,f=a?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,o,m,s)}}}P(br,"id","radar"),P(br,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(br,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class _r extends Fe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=Hc(e,i,s);if(this._drawStart=r,this._drawCount=a,Wc(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=a.axis,g=o.axis,{spanGaps:p,segment:x}=this.options,v=wn(p)?p:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let T=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const E=t[k],R=this.getParsed(k),C=M?E:{},b=rt(R[g]),_=C[m]=a.getPixelForValue(R[m],k),S=C[g]=r||b?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,R,l):R[g],k);C.skip=isNaN(_)||isNaN(S)||b,C.stop=k>0&&Math.abs(R[m]-T[m])>v,x&&(C.parsed=R,C.raw=c.data[k]),f&&(C.options=h||this.resolveDataElementOptions(k,E.active?"active":s)),M||this.updateElement(E,k,C,s),T=R}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}P(_r,"id","scatter"),P(_r,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(_r,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var ey=Object.freeze({__proto__:null,BarController:ns,BubbleController:yr,DoughnutController:nn,LineController:is,PieController:eo,PolarAreaController:ss,RadarController:br,ScatterController:_r});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class no{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(no.prototype,t)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var Tu={_date:no};function ny(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const c=o._reversePixels?kg:Je;if(i){if(s._sharedOptions){const u=r[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(r,t,e-h),m=c(r,t,e+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(p=>!rt(p[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(p=>!rt(p[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:r.length-1}}function rs(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:h,hi:f}=ny(r[o],t,a,s);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,c,m)}}}function iy(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function io(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||rs(n,e,t,function(o,l,c){!s&&!tn(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function sy(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=lr(a,{x:t.x,y:t.y});Xi(h,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return rs(n,e,t,r),s}function ry(n,t,e,i,s,r){let a=[];const o=iy(e);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const g=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(g))&&!m)return;const x=o(t,g);x<l?(a=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&a.push({element:u,datasetIndex:h,index:f})}return rs(n,e,t,c),a}function so(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?sy(n,t,e,s):ry(n,t,e,i,s,r)}function Du(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return rs(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var ro={evaluateInteractionItems:rs,modes:{index(n,t,e,i){const s=Sn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?io(n,s,r,i,a):so(n,s,r,!1,i,a),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?io(n,s,r,i,a):so(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return io(n,s,r,i,a)},nearest(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return so(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=Sn(t,n);return Du(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Sn(t,n);return Du(n,s,"y",e.intersect,i)}}};const Cu=["left","top","right","bottom"];function as(n,t){return n.filter(e=>e.pos===t)}function Eu(n,t){return n.filter(e=>Cu.indexOf(e.pos)===-1&&e.box.axis===t)}function os(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 ay(n){const t=[];let e,i,s,r,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function oy(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Cu.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function ly(n,t){const e=oy(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function cy(n){const t=ay(n),e=os(t.filter(c=>c.box.fullSize),!0),i=os(as(t,"left"),!0),s=os(as(t,"right")),r=os(as(t,"top"),!0),a=os(as(t,"bottom")),o=Eu(t,"x"),l=Eu(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:as(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function Ou(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Pu(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 uy(n,t,e,i){const{pos:s,box:r}=e,a=n.maxPadding;if(!ft(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?r.height:r.width),e.size=h.size/h.count,n[s]+=e.size}r.getPadding&&Pu(a,r.getPadding());const o=Math.max(0,t.outerWidth-Ou(a,n,"left","right")),l=Math.max(0,t.outerHeight-Ou(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function dy(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 hy(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function ls(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,hy(o.horizontal,t));const{same:h,other:f}=uy(t,e,o,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(o)}return c&&ls(s,t,e,i)||u}function xr(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 Au(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){const l=o.box,c=i[o.stack]||{placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const h=t.w*u,f=c.size||l.height;pe(c.start)&&(a=c.start),l.fullSize?xr(l,s.left,a,e.outerWidth-s.right-s.left,f):xr(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*u,f=c.size||l.width;pe(c.start)&&(r=c.start),l.fullSize?xr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):xr(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=a}var ae={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),a=Math.max(e-s.height,0),o=cy(n.boxes),l=o.vertical,c=o.horizontal;Tt(n.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=l.reduce((p,x)=>x.box.options&&x.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},s);Pu(f,Ut(i));const m=Object.assign({maxPadding:f,w:r,h:a,x:s.left,y:s.top},s),g=ly(l.concat(c),h);ls(o.fullSize,m,h,g),ls(l,m,h,g),ls(c,m,h,g)&&ls(l,m,h,g),dy(m),Au(o.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Au(o.rightAndBottom,m,h,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Tt(o.chartArea,p=>{const x=p.box;Object.assign(x,n.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Ru{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 fy extends Ru{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const wr="$chartjs",my={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Iu=n=>n===null||n==="";function gy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[wr]={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",Iu(s)){const r=ru(n,"width");r!==void 0&&(n.width=r)}if(Iu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=ru(n,"height");r!==void 0&&(n.height=r)}return n}const Lu=bp?{passive:!0}:!1;function py(n,t,e){n&&n.addEventListener(t,e,Lu)}function yy(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Lu)}function by(n,t){const e=my[n.type]||n.type,{x:i,y:s}=Sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function _y(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||vr(o.addedNodes,i),a=a&&!vr(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function xy(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||vr(o.removedNodes,i),a=a&&!vr(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const cs=new Map;let Nu=0;function Fu(){const n=window.devicePixelRatio;n!==Nu&&(Nu=n,cs.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function wy(n,t){cs.size||window.addEventListener("resize",Fu),cs.set(n,t)}function vy(n){cs.delete(n),cs.size||window.removeEventListener("resize",Fu)}function My(n,t,e){const i=n.canvas,s=i&&Ga(i);if(!s)return;const r=zc((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),wy(n,r),a}function ao(n,t,e){e&&e.disconnect(),t==="resize"&&vy(n)}function Sy(n,t,e){const i=n.canvas,s=zc(r=>{n.ctx!==null&&e(by(r,n))},n);return py(i,t,s),s}class ky extends Ru{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(gy(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[wr])return!1;const i=e[wr].initial;["height","width"].forEach(r=>{const a=i[r];rt(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[wr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:_y,detach:xy,resize:My}[e]||Sy;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ao,detach:ao,resize:ao}[e]||yy)(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&&Ga(t);return!!(e&&e.isConnected)}}function Ty(n){return!Xa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?fy:ky}class Jt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}P(Jt,"defaults",{}),P(Jt,"defaultRoutes");function Dy(n,t){const e=n.options.ticks,i=Cy(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Oy(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return Py(t,c,r,a/s),c;const u=Ey(r,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-o)/(a-1)):null;for(Mr(t,c,u,rt(m)?0:o-m,o),h=0,f=a-1;h<f;h++)Mr(t,c,u,r[h],r[h+1]);return Mr(t,c,u,l,rt(m)?t.length:l+m),c}return Mr(t,c,u),c}function Cy(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=Ay(n),s=t.length/e;if(!i)return Math.max(s,1);const r=xg(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function Oy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Py(n,t,e,i){let s=0,r=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function Mr(n,t,e,i,s){const r=at(i,0),a=Math.min(at(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*e))}function Ay(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,Bu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,zu=(n,t)=>Math.min(t||n,n);function Hu(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 Iy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function Ly(n,t){Tt(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 us(n){return n.drawTicks?n.tickLength:0}function Wu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(St(n.text)?n.text.length:1)*e.lineHeight+i.height}function Ny(n,t){return Mn(n,{scale:t,type:"scale"})}function Fy(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function By(n,t,e){let i=Ba(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Ry(i)),i}function zy(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,g;const p=a-s,x=o-r;if(n.isHorizontal()){if(m=re(i,r,o),ft(e)){const v=Object.keys(e)[0],M=e[v];g=u[v].getPixelForValue(M)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=Bu(n,e,t);f=o-r}else{if(ft(e)){const v=Object.keys(e)[0],M=e[v];m=u[v].getPixelForValue(M)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Bu(n,e,t);g=re(i,a,s),h=e==="left"?-Pt:Pt}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class Un 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=Te(t,Number.POSITIVE_INFINITY),e=Te(e,Number.NEGATIVE_INFINITY),i=Te(i,Number.POSITIVE_INFINITY),s=Te(s,Number.NEGATIVE_INFINITY),{min:Te(t,i),max:Te(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Te(e,Te(i,e)),max:Te(i,Te(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Gg(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Hu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Dy(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){kt(this.options.afterUpdate,[this])}beforeSetDimensions(){kt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){kt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=kt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=zu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Qt(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:m/(i-1),h+6>o&&(o=m/(i-(t.offset?.5:1)),l=this.maxHeight-us(t.grid)-e.padding-Wu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=or(Math.min(Math.asin(Qt((u.highest.height+6)/o,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=Wu(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=us(r)+l):(t.height=this.maxHeight,t.width=us(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=$t(this.labelRotation),p=Math.cos(g),x=Math.sin(g);if(o){const v=i.mirror?0:x*h.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=i.mirror?0:p*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(c,u,x,p)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:a},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):r==="start"?m=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,m=e.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=e.height,h=0),this.paddingTop=u+a,this.paddingBottom=h+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){kt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)rt(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=Hu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,a=[],o=[],l=Math.floor(e/zu(e,i));let c=0,u=0,h,f,m,g,p,x,v,M,T,k,E;for(h=0;h<e;h+=l){if(g=t[h].label,p=this._resolveTickFontOptions(h),s.font=x=p.string,v=r[x]=r[x]||{data:{},gc:[]},M=p.lineHeight,T=k=0,!rt(g)&&!St(g))T=dr(s,v.data,v.gc,T,g),k=M;else if(St(g))for(f=0,m=g.length;f<m;++f)E=g[f],!rt(E)&&!St(E)&&(T=dr(s,v.data,v.gc,T,E),k+=M);a.push(T),o.push(k),c=Math.max(T,c),u=Math.max(k,u)}Ly(r,e);const R=a.indexOf(c),C=o.indexOf(u),b=_=>({width:a[_]||0,height:o[_]||0});return{first:b(0),last:b(e-1),widest:b(R),highest:b(C),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Sg(this._alignToPixels?Wn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Fy(this.getContext(),t,i))}return this.$context||(this.$context=Ny(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=$t(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:a,border:o}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=us(r),m=[],g=o.setContext(this.getContext()),p=g.display?g.width:0,x=p/2,v=function(G){return Wn(i,G,p)};let M,T,k,E,R,C,b,_,S,O,A,L;if(a==="top")M=v(this.bottom),C=this.bottom-f,_=M-x,O=v(t.top)+x,L=t.bottom;else if(a==="bottom")M=v(this.top),O=t.top,L=v(t.bottom)-x,C=M+x,_=this.top+f;else if(a==="left")M=v(this.right),R=this.right-f,b=M-x,S=v(t.left)+x,A=t.right;else if(a==="right")M=v(this.left),S=t.left,A=v(t.right)-x,R=M+x,b=this.left+f;else if(e==="x"){if(a==="center")M=v((t.top+t.bottom)/2+.5);else if(ft(a)){const G=Object.keys(a)[0],j=a[G];M=v(this.chart.scales[G].getPixelForValue(j))}O=t.top,L=t.bottom,C=M+x,_=C+f}else if(e==="y"){if(a==="center")M=v((t.left+t.right)/2);else if(ft(a)){const G=Object.keys(a)[0],j=a[G];M=v(this.chart.scales[G].getPixelForValue(j))}R=M-x,b=R-f,S=t.left,A=t.right}const B=at(s.ticks.maxTicksLimit,h),X=Math.max(1,Math.ceil(h/B));for(T=0;T<h;T+=X){const G=this.getContext(T),j=r.setContext(G),lt=o.setContext(G),q=j.lineWidth,Q=j.color,H=lt.dash||[],U=lt.dashOffset,Y=j.tickWidth,xt=j.tickColor,yt=j.tickBorderDash||[],vt=j.tickBorderDashOffset;k=Iy(this,T,l),k!==void 0&&(E=Wn(i,k,q),c?R=b=S=A=E:C=_=O=L=E,m.push({tx1:R,ty1:C,tx2:b,ty2:_,x1:S,y1:O,x2:A,y2:L,width:q,color:Q,borderDash:H,borderDashOffset:U,tickWidth:Y,tickColor:xt,tickBorderDash:yt,tickBorderDashOffset:vt}))}return this._ticksLength=h,this._borderValue=M,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=us(i.grid),m=f+u,g=h?-u:m,p=-$t(this.labelRotation),x=[];let v,M,T,k,E,R,C,b,_,S,O,A,L="middle";if(s==="top")R=this.bottom-g,C=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+g,C=this._getXAxisLabelAlignment();else if(s==="left"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,E=X.x}else if(s==="right"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,E=X.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+m;else if(ft(s)){const X=Object.keys(s)[0],G=s[X];R=this.chart.scales[X].getPixelForValue(G)+m}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")E=(t.left+t.right)/2-m;else if(ft(s)){const X=Object.keys(s)[0],G=s[X];E=this.chart.scales[X].getPixelForValue(G)}C=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const B=this._getLabelSizes();for(v=0,M=o.length;v<M;++v){T=o[v],k=T.label;const X=r.setContext(this.getContext(v));b=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),S=_.lineHeight,O=St(k)?k.length:1;const G=O/2,j=X.color,lt=X.textStrokeColor,q=X.textStrokeWidth;let Q=C;a?(E=b,C==="inner"&&(v===M-1?Q=this.options.reverse?"left":"right":v===0?Q=this.options.reverse?"right":"left":Q="center"),s==="top"?c==="near"||p!==0?A=-O*S+S/2:c==="center"?A=-B.highest.height/2-G*S+S:A=-B.highest.height+S/2:c==="near"||p!==0?A=S/2:c==="center"?A=B.highest.height/2-G*S:A=B.highest.height-O*S,h&&(A*=-1),p!==0&&!X.showLabelBackdrop&&(E+=S/2*Math.sin(p))):(R=b,A=(1-O)*S/2);let H;if(X.showLabelBackdrop){const U=Ut(X.backdropPadding),Y=B.heights[v],xt=B.widths[v];let yt=A-U.top,vt=0-U.left;switch(L){case"middle":yt-=Y/2;break;case"bottom":yt-=Y;break}switch(C){case"center":vt-=xt/2;break;case"right":vt-=xt;break;case"inner":v===M-1?vt-=xt:v>0&&(vt-=xt/2);break}H={left:vt,top:yt,width:xt+U.width,height:Y+U.height,color:X.backdropColor}}x.push({label:k,font:_,textOffset:A,options:{rotation:p,color:j,strokeColor:lt,strokeWidth:q,textAlign:Q,textBaseline:L,translation:[E,R],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,a=this._getLabelSizes(),o=t+r,l=a.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,a;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Wn(t,this.left,a)-a/2,u=Wn(t,this.right,o)+o/2,h=f=l):(h=Wn(t,this.top,a)-a/2,f=Wn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Qi(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;Yn(i,c,0,u,l,o)}s&&Ji(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),a=Ut(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ft(e)?(l+=a.bottom,St(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=zy(this,l,e,o);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:By(o,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=at(t.grid&&t.grid.z,-1),s=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Sr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Yy(e)&&(i=this.register(e));const s=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Hy(t,a,i),this.override&&At.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in At[s]&&(delete At[s][i],this.override&&delete Hn[i])}}function Hy(n,t,e){const i=$i(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&Wy(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function Wy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),a=t[e].split("."),o=a.pop(),l=a.join(".");At.route(r,s,l,o)})}function Yy(n){return"id"in n&&"defaults"in n}class Vy{constructor(){this.controllers=new Sr(Fe,"datasets",!0),this.elements=new Sr(Jt,"elements"),this.plugins=new Sr(Object,"plugins"),this.scales=new Sr(Un,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Tt(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=La(t);kt(i["before"+s],[],i),e[t](i),kt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ve=new Vy;class jy{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(kt(o,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){rt(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=at(i.options&&i.options.plugins,{}),r=$y(i);return s===!1&&!e?[]:qy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function $y(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Uy(n,t){return!t&&n===!1?null:n===!0?{}:n}function qy(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=Uy(i[l],s);c!==null&&r.push({plugin:o,options:Xy(n.config,{plugin:o,local:e[l]},c,a)})}return r}function Xy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function oo(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Gy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Ky(n,t){return n===t?"_index_":"_value_"}function Yu(n){if(n==="x"||n==="y"||n==="r")return n}function Zy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function lo(n,...t){if(Yu(n))return n;for(const e of t){const i=e.axis||Zy(e.position)||n.length>1&&Yu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Vu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Qy(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 Vu(n,"x",e[0])||Vu(n,"y",e[0])}return{}}function Jy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=oo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!ft(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=lo(a,o,Qy(a,n),At.scales[o.type]),c=Ky(l,s),u=e.scales||{};r[a]=Ui(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||oo(o,t),u=(Hn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Gy(h,l),m=a[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),Ui(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(a=>{const o=r[a];Ui(o,[At.scales[o.type],At.scale])}),r}function ju(n){const t=n.options||(n.options={});t.plugins=at(t.plugins,{}),t.scales=Jy(n,t)}function $u(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function tb(n){return n=n||{},n.data=$u(n.data),ju(n),n}const Uu=new Map,qu=new Set;function kr(n,t){let e=Uu.get(n);return e||(e=t(),Uu.set(n,e),qu.add(e)),e}const ds=(n,t,e)=>{const i=_n(t,e);i!==void 0&&n.add(i)};class eb{constructor(t){this._config=tb(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$u(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ju(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return kr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return kr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return kr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>ds(l,t,h))),u.forEach(h=>ds(l,s,h)),u.forEach(h=>ds(l,Hn[r]||{},h)),u.forEach(h=>ds(l,At,h)),u.forEach(h=>ds(l,Wa,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qu.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},At.datasets[e]||{},{type:e},At,Wa]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=Xu(this._resolverCache,t,s);let l=a;if(ib(a,e)){r.$shared=!1,i=ye(i)?i():i;const c=this.createResolver(t,i,o);l=gi(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Xu(this._resolverCache,t,i);return ft(e)?gi(r,e,void 0,s):r}}function Xu(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:$a(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const nb=n=>ft(n)&&Object.getOwnPropertyNames(n).some(t=>ye(n[t]));function ib(n,t){const{isScriptable:e,isIndexable:i}=Kc(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(ye(o)||nb(o))||a&&St(o))return!0}return!1}var sb="4.5.0";const rb=["top","bottom","left","right","chartArea"];function Gu(n,t){return n==="top"||n==="bottom"||rb.indexOf(n)===-1&&t==="x"}function Ku(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Zu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),kt(e&&e.onComplete,[n],t)}function ab(n){const t=n.chart,e=t.options.animation;kt(e&&e.onProgress,[n],t)}function Qu(n){return Xa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Tr={},Ju=n=>{const t=Qu(n);return Object.values(Tr).filter(e=>e.canvas===t).pop()};function ob(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function lb(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let be=(Rn=class{static register(...t){Ve.add(...t),td()}static unregister(...t){Ve.remove(...t),td()}constructor(t,e){const i=this.config=new eb(e),s=Qu(t),r=Ju(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Ty(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=hg(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new jy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Cg(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Tr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Zu),en.listen(this,"progress",ab),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return rt(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():su(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return qc(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,e){en.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,su(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),kt(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Tt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=lo(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Tt(r,a=>{const o=a.options,l=o.id,c=lo(l,o),u=at(o.type,a.dtype);(o.position===void 0||Gu(o.position,c)!==Gu(a.dposition))&&(o.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ve.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),Tt(s,(a,o)=>{a||delete i[o]}),Tt(i,a=>{ae.configure(this,a,a.options),ae.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ku("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||oo(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Ve.getController(o),{datasetElementType:c,dataElementType:u}=At.datasets[o];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Tt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&r.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||Tt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ku("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Tt(this.scales,t=>{ae.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Pc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const a=i==="_removeElements"?-r:r;ob(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Pc(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;ae.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Tt(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,ye(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Zu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const a=e[s];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=mu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Qi(e,s),t.controller.draw(),s&&Ji(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return tn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=ro.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Mn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);pe(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),en.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),qc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Tr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};Tt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){Tt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Tt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!ir(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,a=e,o=this._getActiveElements(t,s,i,a),l=bg(t),c=lb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,kt(r.onHover,[t,o,this],this),l&&kt(r.onClick,[t,o,this],this));const u=!ir(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},P(Rn,"defaults",At),P(Rn,"instances",Tr),P(Rn,"overrides",Hn),P(Rn,"registry",Ve),P(Rn,"version",sb),P(Rn,"getChart",Ju),Rn);function td(){return Tt(be.instances,n=>n._plugins.invalidate())}function cb(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:a,innerRadius:o,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,se(i-e));if(n.beginPath(),n.arc(s,r,a-c/2,i+h/2,e-h/2),o>0){const f=Math.min(c/o,se(i-e));n.arc(s,r,o+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*se(i-e));if(u==="round")n.arc(s,r,f,e-dt/2,i+dt/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(e+dt/2)+s,p=-m*Math.sin(e+dt/2)+r,x=m*Math.cos(i+dt/2)+s,v=m*Math.sin(i+dt/2)+r;n.lineTo(g,p),n.lineTo(x,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function ub(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+Pt,i-Pt),n.closePath(),n.clip()}function db(n){return ja(n,["outerStart","outerEnd","innerStart","innerEnd"])}function hb(n,t,e,i){const s=db(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Qt(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Qt(s.innerStart,0,a),innerEnd:Qt(s.innerEnd,0,a)}}function bi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Dr(n,t,e,i,s,r){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let m=0;const g=s-l;if(i){const X=u>0?u-i:0,G=h>0?h-i:0,j=(X+G)/2,lt=j!==0?g*j/(j+i):g;m=(g-lt)/2}const p=Math.max(.001,g*h-e/dt)/h,x=(g-p)/2,v=l+x+m,M=s-x-m,{outerStart:T,outerEnd:k,innerStart:E,innerEnd:R}=hb(t,f,h,M-v),C=h-T,b=h-k,_=v+T/C,S=M-k/b,O=f+E,A=f+R,L=v+E/O,B=M-R/A;if(n.beginPath(),r){const X=(_+S)/2;if(n.arc(a,o,h,_,X),n.arc(a,o,h,X,S),k>0){const q=bi(b,S,a,o);n.arc(q.x,q.y,k,S,M+Pt)}const G=bi(A,M,a,o);if(n.lineTo(G.x,G.y),R>0){const q=bi(A,B,a,o);n.arc(q.x,q.y,R,M+Pt,B+Math.PI)}const j=(M-R/f+(v+E/f))/2;if(n.arc(a,o,f,M-R/f,j,!0),n.arc(a,o,f,j,v+E/f,!0),E>0){const q=bi(O,L,a,o);n.arc(q.x,q.y,E,L+Math.PI,v-Pt)}const lt=bi(C,v,a,o);if(n.lineTo(lt.x,lt.y),T>0){const q=bi(C,_,a,o);n.arc(q.x,q.y,T,v-Pt,_)}}else{n.moveTo(a,o);const X=Math.cos(_)*h+a,G=Math.sin(_)*h+o;n.lineTo(X,G);const j=Math.cos(S)*h+a,lt=Math.sin(S)*h+o;n.lineTo(j,lt)}n.closePath()}function fb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Dr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%Ot||Ot))}return Dr(n,t,e,i,l,s),n.fill(),l}function mb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){Dr(n,t,e,i,p,s);for(let x=0;x<r;++x)n.stroke();isNaN(o)||(p=a+(o%Ot||Ot))}g&&ub(n,t,p),l.selfJoin&&p-a>=dt&&m===0&&u!=="miter"&&cb(n,t,p),r||(Dr(n,t,e,i,p,s),n.stroke())}class hs extends Jt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:a,distance:o}=lr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,g=at(f,c-l),p=Xi(a,l,c)&&l!==c,x=g>=Ot||p,v=Qe(o,u+m,h+m);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+a)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>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(dt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,fb(e,this,u,a,o),mb(e,this,u,a,o),e.restore()}}P(hs,"id","arc"),P(hs,"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}),P(hs,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(hs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function ed(n,t,e=t){n.lineCap=at(e.borderCapStyle,t.borderCapStyle),n.setLineDash(at(e.borderDash,t.borderDash)),n.lineDashOffset=at(e.borderDashOffset,t.borderDashOffset),n.lineJoin=at(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=at(e.borderWidth,t.borderWidth),n.strokeStyle=at(e.borderColor,t.borderColor)}function gb(n,t,e){n.lineTo(e.x,e.y)}function pb(n){return n.stepped?Hg:n.tension||n.cubicInterpolationMode==="monotone"?Wg:gb}function nd(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function yb(n,t,e,i){const{points:s,options:r}=t,{count:a,start:o,loop:l,ilen:c}=nd(s,e,i),u=pb(r);let{move:h=!0,reverse:f}=i||{},m,g,p;for(m=0;m<=c;++m)g=s[(o+(f?c-m:m))%a],!g.skip&&(h?(n.moveTo(g.x,g.y),h=!1):u(n,p,g,f,r.stepped),p=g);return l&&(g=s[(o+(f?c:0))%a],u(n,p,g,f,r.stepped)),!!l}function bb(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=nd(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,g,p,x,v;const M=k=>(a+(c?o-k:k))%r,T=()=>{p!==x&&(n.lineTo(u,x),n.lineTo(u,p),n.lineTo(u,v))};for(l&&(m=s[M(0)],n.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=s[M(f)],m.skip)continue;const k=m.x,E=m.y,R=k|0;R===g?(E<p?p=E:E>x&&(x=E),u=(h*u+k)/++h):(T(),n.lineTo(k,E),g=R,h=0,p=x=E),v=E}T()}function co(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?bb:yb}function _b(n){return n.stepped?_p:n.tension||n.cubicInterpolationMode==="monotone"?xp:jn}function xb(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),ed(n,t.options),n.stroke(s)}function wb(n,t,e,i){const{segments:s,options:r}=t,a=co(t);for(const o of s)ed(n,r,o.style),n.beginPath(),a(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const vb=typeof Path2D=="function";function Mb(n,t,e,i){vb&&!t.options.segment?xb(n,t,e,i):wb(n,t,e,i)}class kn 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;dp(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=Tp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,a=du(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=_b(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:h,end:f}=a[c],m=r[h],g=r[f];if(m===g){o.push(m);continue}const p=Math.abs((s-m[e])/(g[e]-m[e])),x=l(m,g,p,i.stepped);x[e]=t[e],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,e,i){return co(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=co(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Mb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(kn,"id","line"),P(kn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(kn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(kn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function id(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Cr extends Jt{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return id(this,e,"x",i)}inYRange(e,i){return id(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!tn(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Va(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(Cr,"id","point"),P(Cr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(Cr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function sd(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,h;return n.horizontal?(h=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,o=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function Tn(n,t,e,i){return n?0:Qt(t,e,i)}function Sb(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Gc(i);return{t:Tn(s.top,r.top,0,e),r:Tn(s.right,r.right,0,t),b:Tn(s.bottom,r.bottom,0,e),l:Tn(s.left,r.left,0,t)}}function kb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),a=Math.min(t,e),o=n.borderSkipped,l=i||ft(s);return{topLeft:Tn(!l||o.top||o.left,r.topLeft,0,a),topRight:Tn(!l||o.top||o.right,r.topRight,0,a),bottomLeft:Tn(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:Tn(!l||o.bottom||o.right,r.bottomRight,0,a)}}function Tb(n){const t=sd(n),e=t.right-t.left,i=t.bottom-t.top,s=Sb(n,e/2,i/2),r=kb(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 uo(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&sd(n,i);return o&&(s||Qe(t,o.left,o.right))&&(r||Qe(e,o.top,o.bottom))}function Db(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Cb(n,t){n.rect(t.x,t.y,t.w,t.h)}function ho(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+a,radius:n.radius}}class Er 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:a}=Tb(this),o=Db(a.radius)?mi:Cb;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,ho(a,e,r)),t.clip(),o(t,ho(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,ho(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return uo(this,t,e,i)}inXRange(t,e){return uo(this,t,null,e)}inYRange(t,e){return uo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(Er,"id","bar"),P(Er,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(Er,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Eb=Object.freeze({__proto__:null,ArcElement:hs,BarElement:Er,LineElement:kn,PointElement:Cr});const fo=["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)"],rd=fo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ad(n){return fo[n%fo.length]}function od(n){return rd[n%rd.length]}function Ob(n,t){return n.borderColor=ad(t),n.backgroundColor=od(t),++t}function Pb(n,t){return n.backgroundColor=n.data.map(()=>ad(t++)),t}function Ab(n,t){return n.backgroundColor=n.data.map(()=>od(t++)),t}function Rb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof nn?t=Pb(e,t):s instanceof ss?t=Ab(e,t):s&&(t=Ob(e,t))}}function ld(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Ib(n){return n&&(n.borderColor||n.backgroundColor)}function Lb(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var Nb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,a=ld(i)||Ib(s)||r&&ld(r)||Lb();if(!e.forceOverride&&a)return;const o=Rb(n);i.forEach(o)}};function Fb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,g,p;for(a[l++]=n[u],h=0;h<r-2;h++){let x=0,v=0,M;const T=Math.floor((h+1)*o)+1+t,k=Math.min(Math.floor((h+2)*o)+1,e)+t,E=k-T;for(M=T;M<k;M++)x+=n[M].x,v+=n[M].y;x/=E,v/=E;const R=Math.floor(h*o)+1+t,C=Math.min(Math.floor((h+1)*o)+1,e)+t,{x:b,y:_}=n[u];for(m=g=-1,M=R;M<C;M++)g=.5*Math.abs((b-x)*(n[M].y-_)-(b-n[M].x)*(v-_)),g>m&&(m=g,f=n[M],p=M);a[l++]=f,u=p}return a[l++]=n[c],a}function Bb(n,t,e,i){let s=0,r=0,a,o,l,c,u,h,f,m,g,p;const x=[],v=t+e-1,M=n[t].x,k=n[v].x-M;for(a=t;a<t+e;++a){o=n[a],l=(o.x-M)/k*i,c=o.y;const E=l|0;if(E===u)c<g?(g=c,h=a):c>p&&(p=c,f=a),s=(r*s+o.x)/++r;else{const R=a-1;if(!rt(h)&&!rt(f)){const C=Math.min(h,f),b=Math.max(h,f);C!==m&&C!==R&&x.push({...n[C],x:s}),b!==m&&b!==R&&x.push({...n[b],x:s})}a>0&&R!==m&&x.push(n[R]),x.push(o),u=E,r=0,g=p=c,h=f=m=a}}return x}function cd(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 ud(n){n.data.datasets.forEach(t=>{cd(t)})}function zb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Qt(Je(t,r.axis,a).lo,0,e-1)),c?s=Qt(Je(t,r.axis,o).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){ud(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(ts([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=zb(l,c);const m=e.threshold||4*i;if(f<=m){cd(s);return}rt(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(e.algorithm){case"lttb":g=Fb(c,h,f,i,e);break;case"min-max":g=Bb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){ud(n)}};function Wb(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=Or(l,c,s);const u=mo(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const h=du(t,u);for(const f of h){const m=mo(e,r[f.start],r[f.end],f.loop),g=uu(o,s,m);for(const p of g)a.push({source:p,target:f,start:{[e]:dd(u,m,"start",Math.max)},end:{[e]:dd(u,m,"end",Math.min)}})}}return a}function mo(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 Yb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:o})=>{o=Or(a,o,s);const l=s[a],c=s[o];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Or(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function dd(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function hd(n,t){let e=[],i=!1;return St(n)?(i=!0,e=n):e=Yb(n,t),e.length?new kn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function fd(n){return n&&n.fill!==!1}function Vb(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function jb(n,t,e){const i=Xb(n);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?$b(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function $b(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Ub(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ft(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function qb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ft(n)?i=n.value:i=t.getBaseValue(),i}function Xb(n){const t=n.options,e=t.fill;let i=at(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Gb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=Kb(t,e);o.push(hd({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++)Zb(s,a[u],o)}return new kn({points:s,options:{}})}function Kb(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 Zb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:a,last:o,point:l}=Qb(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function Qb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=a[u.start][e],f=a[u.end][e];if(Qe(s,h,f)){o=s===h,l=s===f;break}}return{first:o,last:l,point:i}}class md{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:Ot},t.arc(s,r,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function Jb(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return t0(t,e);if(e==="stack")return Gb(n);if(e==="shape")return!0;const s=e0(n);return s instanceof md?s:hd(s,i)}function t0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function e0(n){return(n.scale||{}).getPointPositionForValue?i0(n):n0(n)}function n0(n){const{scale:t={},fill:e}=n,i=Ub(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function i0(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=qb(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new md({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function go(n,t,e){const i=Jb(t),{chart:s,index:r,line:a,scale:o,axis:l}=t,c=a.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},g=s.getDatasetMeta(r),p=mu(s,g);i&&a.points.length&&(Qi(n,e),s0(n,{line:a,target:i,above:f,below:m,area:e,scale:o,axis:l,clip:p}),Ji(n))}function s0(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(gd(n,i,a.top),po(n,{line:e,target:i,color:s,scale:o,property:c,clip:l}),n.restore(),n.save(),gd(n,i,a.bottom)):c==="y"&&(pd(n,i,a.left),po(n,{line:e,target:i,color:r,scale:o,property:c,clip:l}),n.restore(),n.save(),pd(n,i,a.right),u=s)),po(n,{line:e,target:i,color:u,scale:o,property:c,clip:l}),n.restore()}function gd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Or(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function pd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Or(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function po(n,t){const{line:e,target:i,property:s,color:r,scale:a,clip:o}=t,l=Wb(e,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=r}={}}=c,g=i!==!0;n.save(),n.fillStyle=m,r0(n,a,o,g&&mo(s,h,f)),n.beginPath();const p=!!e.pathSegment(n,c);let x;if(g){p?n.closePath():yd(n,i,f,s);const v=!!i.pathSegment(n,u,{move:p,reverse:!0});x=p&&v,x||yd(n,i,h,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function r0(n,t,e,i){const s=t.chart.chartArea,{property:r,start:a,end:o}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=a,c=s.top,u=o,h=s.bottom):(l=s.left,c=a,u=s.right,h=o),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function yd(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var a0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof kn&&(l={visible:n.isDatasetVisible(a),index:a,fill:jb(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Vb(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&go(n.ctx,o,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;fd(r)&&go(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!fd(i)||e.drawTime!=="beforeDatasetDraw"||go(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bd=(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)}},o0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class _d 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=kt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=It(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=bd(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,p)=>{const x=i+e/2+r.measureText(g.text).width;(p===0||c[c.length-1]+x+2*o>a)&&(h+=u,c[c.length-(p>0?0:1)]=0,m+=u,f++),l[p]={left:0,top:m,row:f,width:x,height:s},c[c.length-1]+=x+o}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,g=0,p=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:M,itemHeight:T}=l0(i,e,r,x,s);v>0&&m+T+2*o>u&&(h+=f+o,c.push({width:f,height:m}),g+=f+o,p++,f=m=0),l[v]={left:g,top:m,col:p,width:M,height:T},f=Math.max(f,M),m+=T+o}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,a=yi(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=re(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=re(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Qi(t,this),this._draw(),Ji(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=At.color,l=yi(t.rtl,this.left,this.width),c=It(a.font),{padding:u}=a,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:x}=bd(a,h),v=function(R,C,b){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const _=at(b.lineWidth,1);if(s.fillStyle=at(b.fillStyle,o),s.lineCap=at(b.lineCap,"butt"),s.lineDashOffset=at(b.lineDashOffset,0),s.lineJoin=at(b.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=at(b.strokeStyle,o),s.setLineDash(at(b.lineDash,[])),a.usePointStyle){const S={radius:p*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},O=l.xPlus(R,g/2),A=C+f;Xc(s,S,O,A,a.pointStyleWidth&&g)}else{const S=C+Math.max((h-p)/2,0),O=l.leftForLtr(R,g),A=vn(b.borderRadius);s.beginPath(),Object.values(A).some(L=>L!==0)?mi(s,{x:O,y:S,w:g,h:p,radius:A}):s.rect(O,S,g,p),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(R,C,b){Yn(s,b.text,R,C+x/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},T=this.isHorizontal(),k=this._computeTitleHeight();T?m={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+k,line:0}:m={x:this.left+u,y:re(r,this.top+k+u,this.bottom-e[0].height),line:0},au(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach((R,C)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const b=s.measureText(R.text).width,_=l.textAlign(R.textAlign||(R.textAlign=a.textAlign)),S=g+f+b;let O=m.x,A=m.y;l.setWidth(this.width),T?C>0&&O+S+u>this.right&&(A=m.y+=E,m.line++,O=m.x=re(r,this.left+u,this.right-i[m.line])):C>0&&A+E>this.bottom&&(O=m.x=O+e[m.line].width+u,m.line++,A=m.y=re(r,this.top+k+u,this.bottom-e[m.line].height));const L=l.x(O);if(v(L,A,R),O=Eg(_,O+g+f,T?O+S:this.right,t.rtl),M(l.x(O),A,R),T)m.x+=S+u;else if(typeof R.text!="string"){const B=c.lineHeight;m.y+=xd(R,B)+u}else m.y+=E}),ou(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=yi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=re(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((p,x)=>Math.max(p,x.height),0);u=c+re(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=re(o,h,h+f);a.textAlign=r.textAlign(Ba(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Yn(a,e.text,m,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(Qe(t,this.left,this.right)&&Qe(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Qe(t,s.left,s.left+s.width)&&Qe(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!d0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=o0(s,i);s&&!r&&kt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&kt(e.onHover,[t,i,this],this)}else i&&kt(e.onClick,[t,i,this],this)}}function l0(n,t,e,i,s){const r=c0(i,n,t,e),a=u0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function c0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function u0(n,t,e){let i=n;return typeof t.text!="string"&&(i=xd(t,e)),i}function xd(n,t){const e=n.text?n.text.length:0;return t*e}function d0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var h0={id:"legend",_element:_d,start(n,t,e){const i=n.legend=new _d({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i)},stop(n){ae.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ae.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=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:a&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class yo 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=St(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:a}=this,o=a.align;let l=0,c,u,h;return this.isHorizontal()?(u=re(o,i,r),h=e+t,c=r-i):(a.position==="left"?(u=i+t,h=re(o,s,e),l=dt*-.5):(u=r-t,h=re(o,e,s),l=dt*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Ba(e.align),textBaseline:"middle",translation:[a,o]})}}function f0(n,t){const e=new yo({ctx:n.ctx,options:t,chart:n});ae.configure(n,e,t),ae.addBox(n,e),n.titleBlock=e}var m0={id:"title",_element:yo,start(n,t,e){f0(n,e)},stop(n){const t=n.titleBlock;ae.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ae.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 Pr=new WeakMap;var g0={id:"subtitle",start(n,t,e){const i=new yo({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i),Pr.set(n,i)},stop(n){ae.removeBox(n,Pr.get(n)),Pr.delete(n)},beforeUpdate(n,t,e){const i=Pr.get(n);ae.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 fs={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=fi(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function je(n,t){return t&&(St(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function sn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function p0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function wd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),h=r.length,f=s.length,m=i.length,g=Ut(t.padding);let p=g.height,x=0,v=i.reduce((k,E)=>k+E.before.length+E.lines.length+E.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,h&&(p+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;p+=m*k+(v-m)*l.lineHeight+(v-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const D=function(k){x=Math.max(x,e.measureText(k).width+M)};return e.save(),e.font=c.string,Dt(n.title,D),e.font=l.string,Dt(n.beforeBody.concat(n.afterBody),D),M=t.displayColors?a+2+t.boxPadding:0,Dt(i,k=>{Dt(k.before,D),Dt(k.lines,D),Dt(k.after,D)}),M=0,e.font=u.string,Dt(n.footer,D),e.restore(),x+=g.width,{width:x,height:p}}function y0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function b0(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function _0(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),b0(c,n,t,e)&&(c="center"),c}function vd(n,t,e){const i=e.yAlign||t.yAlign||y0(n,e);return{xAlign:e.xAlign||t.xAlign||_0(n,t,e,i),yAlign:i}}function x0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function w0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Md(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=vn(a);let g=x0(t,o);const p=w0(t,l,c);return l==="center"?o==="left"?g+=c:o==="right"&&(g-=c):o==="left"?g-=Math.max(u,f)+s:o==="right"&&(g+=Math.max(h,m)+s),{x:Qt(g,0,i.width-t.width),y:Qt(p,0,i.height-t.height)}}function Ar(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 Sd(n){return je([],sn(n))}function v0(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function kd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Dd={beforeTitle:Ze,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ze,beforeBody:Ze,beforeLabel:Ze,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return rt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ze,afterBody:Ze,beforeFooter:Ze,footer:Ze,afterFooter:Ze};function _e(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Dd[t].call(e,i):s}class bo 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 Ka(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=v0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=_e(i,"beforeTitle",this,t),r=_e(i,"title",this,t),a=_e(i,"afterTitle",this,t);let o=[];return o=je(o,sn(s)),o=je(o,sn(r)),o=je(o,sn(a)),o}getBeforeBody(t,e){return Sd(_e(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Dt(t,r=>{const a={before:[],lines:[],after:[]},o=kd(i,r);je(a.before,sn(_e(o,"beforeLabel",this,r))),je(a.lines,_e(o,"label",this,r)),je(a.after,sn(_e(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Sd(_e(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=_e(i,"beforeFooter",this,t),r=_e(i,"footer",this,t),a=_e(i,"afterFooter",this,t);let o=[];return o=je(o,sn(s)),o=je(o,sn(r)),o=je(o,sn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(p0(this.chart,e[l]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),Dt(o,u=>{const h=kd(t.callbacks,u);s.push(_e(h,"labelColor",this,u)),r.push(_e(h,"labelPointStyle",this,u)),a.push(_e(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=fs[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=wd(this,i),c=Object.assign({},o,l),u=vd(this.chart,i,c),h=Md(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=vn(o),{x:f,y:m}=t,{width:g,height:p}=e;let x,v,M,D,k,E;return r==="center"?(k=m+p/2,s==="left"?(x=f,v=x-a,D=k+a,E=k-a):(x=f+g,v=x+a,D=k-a,E=k+a),M=x):(s==="left"?v=f+Math.max(l,u)+a:s==="right"?v=f+g-Math.max(c,h)-a:v=this.caretX,r==="top"?(D=m,k=D-a,x=v-a,M=v+a):(D=m+p,k=D+a,x=v+a,M=v-a),E=D),{x1:x,x2:v,x3:M,y1:D,y2:k,y3:E}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=yi(i.rtl,this.x,this.width);for(t.x=Ar(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=It(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),h=Ar(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Va(t,p,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Va(t,p,x,v)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=vn(a.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,mi(t,{x:p,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),mi(t,{x,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=It(i.bodyFont);let f=h.lineHeight,m=0;const g=yi(i.rtl,this.x,this.width),p=function(b){e.fillText(b,g.x(t.x+m),t.y+f/2),t.y+=f+r},x=g.textAlign(a);let v,M,D,k,E,R,C;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Ar(this,x,i),e.fillStyle=i.bodyColor,Dt(this.beforeBody,p),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,k=0,R=s.length;k<R;++k){for(v=s[k],M=this.labelTextColors[k],e.fillStyle=M,Dt(v.before,p),D=v.lines,o&&D.length&&(this._drawColorBox(e,t,k,g,i),f=Math.max(h.lineHeight,l)),E=0,C=D.length;E<C;++E)p(D[E]),f=h.lineHeight;Dt(v.after,p)}m=0,f=h.lineHeight,Dt(this.afterBody,p),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=yi(i.rtl,this.x,this.width);for(t.x=Ar(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=It(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+h,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-g),e.quadraticCurveTo(o+c,l+u,o+c-g,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+m,l+u),e.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+h),e.quadraticCurveTo(o,l,o+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const a=fs[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=wd(this,t),l=Object.assign({},a,this._size),c=vd(e,t,l),u=Md(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ut(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),au(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ou(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!ir(i,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!ir(a,r)||o;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=fs[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}P(bo,"positioners",fs);var Te={id:"tooltip",_element:bo,positioners:fs,afterInit(n,t,e){e&&(n.tooltip=new bo({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:Dd},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"]},M0=Object.freeze({__proto__:null,Colors:Nb,Decimation:Hb,Filler:a0,Legend:h0,SubTitle:g0,Title:m0,Tooltip:Te});const S0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function k0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return S0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const D0=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function Td(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class _o extends Un{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(rt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:k0(i,t,at(e,t),this._addedLabels),D0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Td.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(_o,"id","category"),P(_o,"defaults",{ticks:{callback:Td}});function T0(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,g=u-1,{min:p,max:x}=t,v=!rt(a),M=!rt(o),D=!rt(c),k=(x-p)/(h+1);let E=Ac((x-p)/g/m)*m,R,C,b,_;if(E<1e-14&&!v&&!M)return[{value:p},{value:x}];_=Math.ceil(x/E)-Math.floor(p/E),_>g&&(E=Ac(_*E/g/m)*m),rt(l)||(R=Math.pow(10,l),E=Math.ceil(E*R)/R),s==="ticks"?(C=Math.floor(p/E)*E,b=Math.ceil(x/E)*E):(C=p,b=x),v&&M&&r&&vg((o-a)/r,E/1e3)?(_=Math.round(Math.min((o-a)/E,u)),E=(o-a)/_,C=a,b=o):D?(C=v?a:C,b=M?o:b,_=c-1,E=(b-C)/_):(_=(b-C)/E,qi(_,Math.round(_),E/1e3)?_=Math.round(_):_=Math.ceil(_));const S=Math.max(Ic(E),Ic(C));R=Math.pow(10,rt(l)?S:l),C=Math.round(C*R)/R,b=Math.round(b*R)/R;let O=0;for(v&&(f&&C!==a?(e.push({value:a}),C<a&&O++,qi(Math.round((C+O*E)*R)/R,a,Cd(a,k,n))&&O++):C<a&&O++);O<_;++O){const A=Math.round((C+O*E)*R)/R;if(M&&A>o)break;e.push({value:A})}return M&&f&&b!==o?e.length&&qi(e[e.length-1].value,o,Cd(o,k,n))?e[e.length-1].value=o:e.push({value:o}):(!M||b===o)&&e.push({value:b}),e}function Cd(n,t,{horizontal:e,minRotation:i}){const s=$t(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Rr extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=Ye(s),c=Ye(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=T0(s,r);return t.bounds==="ticks"&&Rc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ki(t,this.chart.options.locale,this.options.ticks.format)}}class xo extends Rr{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=$t(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(xo,"id","linear"),P(xo,"defaults",{ticks:{callback:ur.formatters.numeric}});const ms=n=>Math.floor(xn(n)),qn=(n,t)=>Math.pow(10,ms(n)+t);function Ed(n){return n/Math.pow(10,ms(n))===1}function Od(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function C0(n,t){const e=t-n;let i=ms(e);for(;Od(n,t,i)>10;)i++;for(;Od(n,t,i)<10;)i--;return Math.min(i,ms(n))}function E0(n,{min:t,max:e}){t=De(n.min,t);const i=[],s=ms(t);let r=C0(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=De(n.min,Math.round((l+u+h*Math.pow(10,r))*a)/a);for(;f<e;)i.push({value:f,major:Ed(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,a=r>=0?1:a),f=Math.round((l+u+h*Math.pow(10,r))*a)/a;const m=De(n.max,f);return i.push({value:m,major:Ed(m),significand:h}),i}class wo extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Rr.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===qn(this.min,0)?qn(this.min,-1):qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(qn(i,-1)),a(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&a(qn(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"&&Rc(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":Ki(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(wo,"id","logarithmic"),P(wo,"defaults",{ticks:{callback:ur.formatters.logarithmic,major:{enabled:!0}}});function vo(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return at(t.font&&t.font.size,At.font.size)+e.height}return 0}function O0(n,t,e){return e=St(e)?e:[e],{w:zg(n,t.string,e),h:e.length*t.lineHeight}}function Pd(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 P0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,a=n.options.pointLabels,o=a.centerPointLabels?dt/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),h=It(c.font),f=O0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=se(n.getIndexAngle(l)+o),g=Math.round(or(m)),p=Pd(g,u.x,f.w,0,180),x=Pd(g,u.y,f.h,90,270);A0(e,t,m,p,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=L0(n,i,s)}function A0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function R0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(or(se(l.angle+Pt))),u=B0(l.y,o.h,c),h=N0(c),f=F0(l.x,o.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function I0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(tn({x:e,y:i},t)||tn({x:e,y:r},t)||tn({x:s,y:i},t)||tn({x:s,y:r},t))}function L0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:vo(r)/2,additionalAngle:a?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=R0(n,u,l);i.push(h),o==="auto"&&(h.visible=I0(h,c),h.visible&&(c=h))}return i}function N0(n){return n===0||n===180?"center":n<180?"left":"right"}function F0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function B0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function z0(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!rt(o)){const l=vn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=o;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),mi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}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 a=i.setContext(n.getPointLabelContext(s));z0(e,a,r);const o=It(a.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Ad(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 a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function W0(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Ad(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function Y0(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class gs extends Rr{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(vo(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/vo(this.options))}generateTickLabels(t){Rr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=kt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?P0(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+$t(i))}getDistanceFromCenterForValue(t){if(rt(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(rt(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 Y0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Pt+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(),Ad(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&H0(this,a),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=r.setContext(f);W0(this,m,l,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=Ut(c.backdropPadding);t.fillRect(-a/2-h.left,-r-u.size/2-h.top,a+h.width,u.size+h.height)}Yn(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(gs,"id","radialLinear"),P(gs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ur.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(gs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(gs,"descriptors",{angleLines:{_fallback:"grid"}});const Ir={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}},xe=Object.keys(Ir);function Rd(n,t){return n-t}function Id(n,t){if(rt(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),Rt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(wn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Ld(n,t,e,i){const s=xe.length;for(let r=xe.indexOf(n);r<s-1;++r){const a=Ir[xe[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return xe[r]}return xe[s-1]}function V0(n,t,e,i,s){for(let r=xe.length-1;r>=xe.indexOf(e);r--){const a=xe[r];if(Ir[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return xe[e?xe.indexOf(e):0]}function j0(n){for(let t=xe.indexOf(n)+1,e=xe.length;t<e;++t)if(Ir[xe[t]].common)return xe[t]}function Nd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Fa(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function $0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Fd(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:$0(n,i,s,e)}class ps extends Un{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Du._date(t.adapters.date);s.init(e),Ui(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:Id(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=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,a=this.max,o=Dg(s,r,a);return this._unit=e.unit||(i.autoSkip?Ld(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):V0(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:j0(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),Fd(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Qt(e,0,a),i=Qt(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||Ld(r.minUnit,e,i,this._getLabelCapacity(e)),o=at(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)Nd(u,f,g);return(f===i||s.bounds==="ticks"||m===1)&&Nd(u,f,g),Object.keys(u).sort(Rd).map(p=>+p)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return kt(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=$t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Fd(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Id(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fc(t.sort(Rd))}}P(ps,"id","time"),P(ps,"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 Lr(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Je(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Je(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class Mo extends ps{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=Lr(e,this.min),this._tableRange=Lr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Lr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Lr(this._table,i*this._tableRange+this._minPos,!0)}}P(Mo,"id","timeseries"),P(Mo,"defaults",ps.defaults);var U0=Object.freeze({__proto__:null,CategoryScale:_o,LinearScale:xo,LogarithmicScale:wo,RadialLinearScale:gs,TimeScale:ps,TimeSeriesScale:Mo});const q0=[ey,Eb,M0,U0],Bd=6048e5,X0=864e5,ys=6e4,_i=36e5,G0=1e3,zd=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&zd in n?n[zd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ut(n,t){return Ft(t||n,n)}function Nr(n,t,e){const i=ut(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 So(n,t,e){const i=ut(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 a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ko(n,t,e){return Ft(n,+ut(n)+t)}function K0(n,t,e){return ko(n,t*_i)}let Z0={};function Xn(){return Z0}function $e(n,t){var o,l,c,u;const e=Xn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ut(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function xi(n,t){return $e(n,{...t,weekStartsOn:1})}function Hd(n,t){const e=ut(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=xi(s),a=Ft(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=xi(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Fr(n){const t=ut(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Gn(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Do(n,t){const e=ut(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Wd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=Do(i),a=Do(s),o=+r-Fr(r),l=+a-Fr(a);return Math.round((o-l)/X0)}function Q0(n,t){const e=Hd(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),xi(i)}function J0(n,t,e){const i=ut(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ys),i}function t_(n,t,e){return So(n,t*3,e)}function e_(n,t,e){return ko(n,t*1e3)}function n_(n,t,e){return Nr(n,t*7,e)}function i_(n,t,e){return So(n,t*12,e)}function bs(n,t){const e=+ut(n)-+ut(t);return e<0?-1:e>0?1:e}function s_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function To(n){return!(!s_(n)&&typeof n!="number"||isNaN(+ut(n)))}function r_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function a_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Yd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=Vd(i,s),a=Math.abs(Wd(i,s));i.setDate(i.getDate()-r*a);const o=+(Vd(i,s)===-r),l=r*(a-o);return l===0?0:l}function Vd(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 _s(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function o_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/_i;return _s(e==null?void 0:e.roundingMethod)(r)}function Co(n,t){return+ut(n)-+ut(t)}function l_(n,t,e){const i=Co(n,t)/ys;return _s(e==null?void 0:e.roundingMethod)(i)}function jd(n,t){const e=ut(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function $d(n,t){const e=ut(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 c_(n,t){const e=ut(n,t==null?void 0:t.in);return+jd(e,t)==+$d(e,t)}function Ud(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),a=bs(s,r),o=Math.abs(r_(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=bs(s,r)===-a;c_(i)&&o===1&&bs(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function u_(n,t,e){const i=Ud(n,t,e)/3;return _s(e==null?void 0:e.roundingMethod)(i)}function d_(n,t,e){const i=Co(n,t)/1e3;return _s(e==null?void 0:e.roundingMethod)(i)}function h_(n,t,e){const i=Yd(n,t,e)/7;return _s(e==null?void 0:e.roundingMethod)(i)}function f_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=bs(i,s),a=Math.abs(a_(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=bs(i,s)===-r,l=r*(a-+o);return l===0?0:l}function m_(n,t){const e=ut(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 g_(n,t){const e=ut(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function p_(n,t){const e=ut(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 qd(n,t){const e=ut(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function y_(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function b_(n,t){var o,l;const e=Xn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=ut(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function __(n,t){const e=ut(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function x_(n,t){const e=ut(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 w_(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const v_={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"}},M_=(n,t,e)=>{let i;const s=v_[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 Eo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const S_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},k_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},D_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},T_={date:Eo({formats:S_,defaultWidth:"full"}),time:Eo({formats:k_,defaultWidth:"full"}),dateTime:Eo({formats:D_,defaultWidth:"full"})},C_={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)=>C_[n];function xs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const O_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},P_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},A_={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"]},I_={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"}},L_={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"}},N_={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:xs({values:O_,defaultWidth:"wide"}),quarter:xs({values:P_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:xs({values:A_,defaultWidth:"wide"}),day:xs({values:R_,defaultWidth:"wide"}),dayPeriod:xs({values:I_,defaultWidth:"wide",formattingValues:L_,defaultFormattingWidth:"wide"})};function ws(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?B_(o,h=>h.test(a)):F_(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function F_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function B_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function z_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const H_=/^(\d+)(th|st|nd|rd)?/i,W_=/\d+/i,Y_={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},V_={any:[/^b/i,/^(a|c)/i]},j_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$_={any:[/1/i,/2/i,/3/i,/4/i]},U_={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},q_={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},G_={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]},K_={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},Z_={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}},Q_={ordinalNumber:z_({matchPattern:H_,parsePattern:W_,valueCallback:n=>parseInt(n,10)}),era:ws({matchPatterns:Y_,defaultMatchWidth:"wide",parsePatterns:V_,defaultParseWidth:"any"}),quarter:ws({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:$_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ws({matchPatterns:U_,defaultMatchWidth:"wide",parsePatterns:q_,defaultParseWidth:"any"}),day:ws({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:G_,defaultParseWidth:"any"}),dayPeriod:ws({matchPatterns:K_,defaultMatchWidth:"any",parsePatterns:Z_,defaultParseWidth:"any"})},Xd={code:"en-US",formatDistance:M_,formatLong:T_,formatRelative:E_,localize:N_,match:Q_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function J_(n,t){const e=ut(n,t==null?void 0:t.in);return Wd(e,qd(e))+1}function Gd(n,t){const e=ut(n,t==null?void 0:t.in),i=+xi(e)-+Q0(e);return Math.round(i/Bd)+1}function Oo(n,t){var u,h,f,m;const e=ut(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Ft((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=$e(a,t),l=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>=+o?i+1:+e>=+c?i:i-1}function tx(n,t){var o,l,c,u;const e=Xn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Oo(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 Kd(n,t){const e=ut(n,t==null?void 0:t.in),i=+$e(e,t)-+tx(e,t);return Math.round(i/Bd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Tn={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)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zd={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 Tn.y(n,t)},Y:function(n,t,e,i){const s=Oo(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Tt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Hd(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 Tn.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=Kd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Gd(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"}):Tn.d(n,t)},D:function(n,t,e){const i=J_(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=wi.noon:i===0?s=wi.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=wi.evening:i>=12?s=wi.afternoon:i>=4?s=wi.morning:s=wi.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 Tn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Tn.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"}):Tn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Tn.s(n,t)},S:function(n,t){return Tn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Jd(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 Jd(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"+Qd(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"+Qd(i,":");case"zzzz":default:return"GMT"+Kn(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 Qd(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 Jd(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Kn(n,t)}function Kn(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 th=(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"})}},eh=(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"})}},Po={p:eh,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return th(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}}",th(i,t)).replace("{{time}}",eh(s,t))}},ex=/^D+$/,nx=/^Y+$/,ix=["D","DD","YY","YYYY"];function nh(n){return ex.test(n)}function ih(n){return nx.test(n)}function Ao(n,t,e){const i=sx(n,t,e);if(console.warn(i),ix.includes(n))throw new RangeError(i)}function sx(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 rx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ax=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,lx=/''/g,cx=/[a-zA-Z]/;function Br(n,t,e){var u,h,f,m,g,p,x,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??Xd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=(e==null?void 0:e.weekStartsOn)??((p=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ut(n,e==null?void 0:e.in);if(!To(o))throw new RangeError("Invalid time value");let l=t.match(ax).map(M=>{const D=M[0];if(D==="p"||D==="P"){const k=Po[D];return k(M,s.formatLong)}return M}).join("").match(rx).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:ux(M)};if(Zd[D])return{isToken:!0,value:M};if(D.match(cx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ih(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&nh(D))&&Ao(D,t,String(n));const k=Zd[D[0]];return k(o,D,s.localize,c)}).join("")}function ux(n){const t=n.match(ox);return t?t[1].replace(lx,"'"):n}function sh(){return Object.assign({},Xn())}function dx(n,t){const e=ut(n,t==null?void 0:t.in).getDay();return e===0?7:e}function hx(n,t){const e=fx(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 fx(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const mx=10;class rh{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class gx extends rh{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 px extends rh{constructor(e,i){super();P(this,"priority",mx);P(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,hx(e,this.context))}}class wt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new gx(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class yx extends wt{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const 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}/},Ue={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function qe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*_i+r*ys+a*G0),rest:t.slice(e[0].length)}}function ah(n){return Lt(Yt.anyDigitsSigned,n)}function Bt(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 zr(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 Ro(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 oh(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function lh(n){return n%400===0||n%4===0&&n%100!==0}class bx extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Vt(Bt(4,e),r);case"yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const o=oh(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class _x extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Vt(Bt(4,e),r);case"Yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Oo(e,r);if(s.isTwoDigitYear){const l=oh(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}}class xx extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return zr(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),xi(r)}}class wx extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return zr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class vx extends wt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Bt(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 Mx extends wt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Bt(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 Sx extends wt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return Vt(Lt(Yt.month,e),r);case"MM":return Vt(Bt(2,e),r);case"Mo":return Vt(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 kx extends wt{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return Vt(Lt(Yt.month,e),r);case"LL":return Vt(Bt(2,e),r);case"Lo":return Vt(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 Dx(n,t,e){const i=ut(n,e==null?void 0:e.in),s=Kd(i,e)-t;return i.setDate(i.getDate()-s*7),ut(i,e==null?void 0:e.in)}class Tx extends wt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Yt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return $e(Dx(e,s,r),r)}}function Cx(n,t,e){const i=ut(n,e==null?void 0:e.in),s=Gd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Ex extends wt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Yt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return xi(Cx(e,s))}}const Ox=[31,28,31,30,31,30,31,31,30,31,30,31],Px=[31,29,31,30,31,30,31,31,30,31,30,31];class Ax extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Yt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=lh(s),a=e.getMonth();return r?i>=1&&i<=Px[a]:i>=1&&i<=Ox[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Rx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Yt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear();return lh(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 Io(n,t,e){var h,f,m,g;const i=Xn(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,r=ut(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Nr(r,u,e)}class Ix extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Io(e,s,r),e.setHours(0,0,0,0),e}}class Lx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Vt(Bt(i.length,e),a);case"eo":return Vt(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Io(e,s,r),e.setHours(0,0,0,0),e}}class Nx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Vt(Bt(i.length,e),a);case"co":return Vt(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Io(e,s,r),e.setHours(0,0,0,0),e}}function Fx(n,t,e){const i=ut(n,e==null?void 0:e.in),s=dx(i,e),r=t-s;return Nr(i,r,e)}class Bx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Bt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Vt(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 Vt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Vt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Vt(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=Fx(e,s),e.setHours(0,0,0,0),e}}class zx extends wt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ro(s),0,0,0),e}}class Hx extends wt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ro(s),0,0,0),e}}class Wx extends wt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ro(s),0,0,0),e}}class Yx extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Yt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(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 Vx extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Yt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class jx extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Yt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(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 $x extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Yt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(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 Ux extends wt{constructor(){super(...arguments);P(this,"priority",60);P(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 Bt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class qx extends wt{constructor(){super(...arguments);P(this,"priority",50);P(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 Bt(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);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Vt(Bt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class Gx extends wt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return qe(Ue.basicOptionalMinutes,e);case"XX":return qe(Ue.basic,e);case"XXXX":return qe(Ue.basicOptionalSeconds,e);case"XXXXX":return qe(Ue.extendedOptionalSeconds,e);case"XXX":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Fr(e)-s)}}class Kx extends wt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return qe(Ue.basicOptionalMinutes,e);case"xx":return qe(Ue.basic,e);case"xxxx":return qe(Ue.basicOptionalSeconds,e);case"xxxxx":return qe(Ue.extendedOptionalSeconds,e);case"xxx":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Fr(e)-s)}}class Zx extends wt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return ah(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class Qx extends wt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return ah(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const Jx={G:new yx,y:new bx,Y:new _x,R:new xx,u:new wx,Q:new vx,q:new Mx,M:new Sx,L:new kx,w:new Tx,I:new Ex,d:new Ax,D:new Rx,E:new Ix,e:new Lx,c:new Nx,i:new Bx,a:new zx,b:new Hx,B:new Wx,h:new Yx,H:new Vx,K:new jx,k:new $x,m:new Ux,s:new qx,S:new Xx,X:new Gx,x:new Kx,t:new Zx,T:new Qx},tw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ew=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nw=/^'([^]*?)'?$/,iw=/''/g,sw=/\S/,rw=/[a-zA-Z]/;function aw(n,t,e,i){var x,v,M,D,k,E,R,C;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=sh(),a=(i==null?void 0:i.locale)??r.locale??Xd,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(M=r.locale)==null?void 0:M.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((E=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:E.weekStartsOn)??r.weekStartsOn??((C=(R=r.locale)==null?void 0:R.options)==null?void 0:C.weekStartsOn)??0;if(!t)return n?s():ut(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new px(i==null?void 0:i.in,e)],h=t.match(ew).map(b=>{const _=b[0];if(_ in Po){const S=Po[_];return S(b,a.formatLong)}return b}).join("").match(tw),f=[];for(let b of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&ih(b)&&Ao(b,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&nh(b)&&Ao(b,t,n);const _=b[0],S=Jx[_];if(S){const{incompatibleTokens:O}=S;if(Array.isArray(O)){const L=f.find(B=>O.includes(B.token)||B.token===_);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${b}\` at the same time`)}else if(S.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:_,fullToken:b});const A=S.run(n,b,a.match,c);if(!A)return s();u.push(A.setter),n=A.rest}else{if(_.match(rw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(b==="''"?b="'":_==="'"&&(b=ow(b)),n.indexOf(b)===0)n=n.slice(b.length);else return s()}}if(n.length>0&&sw.test(n))return s();const m=u.map(b=>b.priority).sort((b,_)=>_-b).filter((b,_,S)=>S.indexOf(b)===_).map(b=>u.filter(_=>_.priority===b).sort((_,S)=>S.subPriority-_.subPriority)).map(b=>b[0]);let g=ut(e,i==null?void 0:i.in);if(isNaN(+g))return s();const p={};for(const b of m){if(!b.validate(g,c))return s();const _=b.set(g,p,c);Array.isArray(_)?(g=_[0],Object.assign(p,_[1])):g=_}return g}function ow(n){return n.match(nw)[1].replace(iw,"'")}function lw(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function cw(n,t){const e=ut(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function uw(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function dw(n){const t=n/_i;return Math.trunc(t)}function ch(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=gw(n);let r;if(s.date){const c=pw(s.date,i);r=yw(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=bw(s.time),isNaN(o)))return e();if(s.timezone){if(l=_w(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=ut(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 ut(a+o+l,t==null?void 0:t.in)}const Hr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},hw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,fw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,mw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gw(n){const t={},e=n.split(Hr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Hr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Hr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Hr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function pw(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 yw(n,t){if(t===null)return new Date(NaN);const e=n.match(hw);if(!e)return new Date(NaN);const i=!!e[4],s=vs(e[1]),r=vs(e[2])-1,a=vs(e[3]),o=vs(e[4]),l=vs(e[5])-1;if(i)return Sw(t,o,l)?xw(t,o,l):new Date(NaN);{const c=new Date(0);return!vw(t,r,a)||!Mw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function vs(n){return n?parseInt(n):1}function bw(n){const t=n.match(fw);if(!t)return NaN;const e=Lo(t[1]),i=Lo(t[2]),s=Lo(t[3]);return kw(e,i,s)?e*_i+i*ys+s*1e3:NaN}function Lo(n){return n&&parseFloat(n.replace(",","."))||0}function _w(n){if(n==="Z")return 0;const t=n.match(mw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Dw(i,s)?e*(i*_i+s*ys):NaN}function xw(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 ww=[31,null,31,30,31,30,31,31,30,31,30,31];function uh(n){return n%400===0||n%4===0&&n%100!==0}function vw(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(ww[t]||(uh(n)?29:28))}function Mw(n,t){return t>=1&&t<=(uh(n)?366:365)}function Sw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function kw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Dw(n,t){return t>=0&&t<=59}var Tw=Object.defineProperty,Cw=(n,t,e)=>t in n?Tw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Cw(n,typeof t!="symbol"?t+"":t,e);const Ew=1e3;var tt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(tt||{});const Ow=["in","not_in","selector"],Pw=["empty","not_empty"],Aw=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Rw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ms=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"],hh=Ms(dh),Iw=[...dh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],fh=Ms(Iw),Lw=["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"],mh=Ms(Lw);Ms(["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","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"]),Ms(["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(hh),new Set(fh),new Set(mh);const gh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];gh.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Ow},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:Pw}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...fh,...hh,...mh])]);const Nw={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"}},Fw=(n,t,e)=>{let i;const s=Nw[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 No(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Bw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ww={date:No({formats:Bw,defaultWidth:"full"}),time:No({formats:zw,defaultWidth:"full"}),dateTime:No({formats:Hw,defaultWidth:"full"})},Yw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vw=(n,t,e,i)=>Yw[n];function Ss(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const jw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$w={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Uw={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"]},qw={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"]},Xw={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"}},Gw={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"}},Kw=(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"},Zw={ordinalNumber:Kw,era:Ss({values:jw,defaultWidth:"wide"}),quarter:Ss({values:$w,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:Uw,defaultWidth:"wide"}),day:Ss({values:qw,defaultWidth:"wide"}),dayPeriod:Ss({values:Xw,defaultWidth:"wide",formattingValues:Gw,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Jw(o,h=>h.test(a)):Qw(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function Qw(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Jw(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function tv(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const ev=/^(\d+)(th|st|nd|rd)?/i,nv=/\d+/i,iv={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},sv={any:[/^b/i,/^(a|c)/i]},rv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},av={any:[/1/i,/2/i,/3/i,/4/i]},ov={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},lv={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]},cv={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},uv={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]},dv={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},hv={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}},fv={ordinalNumber:tv({matchPattern:ev,parsePattern:nv,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:sv,defaultParseWidth:"any"}),quarter:ks({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:ov,defaultMatchWidth:"wide",parsePatterns:lv,defaultParseWidth:"any"}),day:ks({matchPatterns:cv,defaultMatchWidth:"wide",parsePatterns:uv,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:dv,defaultMatchWidth:"any",parsePatterns:hv,defaultParseWidth:"any"})},mv={code:"en-US",formatDistance:Fw,formatLong:Ww,formatRelative:Vw,localize:Zw,match:fv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let gv={};function Ds(){return gv}const ph=6048e5,pv=864e5,yv=60,bv=3600,yh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&yh in n?n[yh](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Ae(t||n,n)}function bh(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 _v(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ts(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function xv(n,t,e){const[i,s]=_v(void 0,n,t),r=Ts(i),a=Ts(s),o=+r-bh(r),l=+a-bh(a);return Math.round((o-l)/pv)}function wv(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function vv(n,t){const e=de(n,void 0);return xv(e,wv(e))+1}function rn(n,t){var e,i,s,r;const a=Ds(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=de(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Wr(n,t){return rn(n,{...t,weekStartsOn:1})}function _h(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Wr(s),a=Ae(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Wr(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Mv(n,t){const e=_h(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Wr(i)}function Sv(n,t){const e=de(n,void 0),i=+Wr(e)-+Mv(e);return Math.round(i/ph)+1}function xh(n,t){var e,i,s,r;const a=de(n,t==null?void 0:t.in),o=a.getFullYear(),l=Ds(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const h=rn(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=rn(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function kv(n,t){var e,i,s,r;const a=Ds(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=xh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),rn(c,t)}function Dv(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+kv(e,t);return Math.round(i/ph)+1}function Ct(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return 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"},wh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Cn.y(n,t)},Y:function(n,t,e,i){const s=xh(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Ct(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=_h(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 Cn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return 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=Dv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=Sv(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"}):Cn.d(n,t)},D:function(n,t,e){const i=vv(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 Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):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"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Mh(i);case"XXXX":case"XX":return Zn(i);case"XXXXX":case"XXX":default:return Zn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Mh(i);case"xxxx":case"xx":return Zn(i);case"xxxxx":case"xxx":default:return Zn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+vh(i,":");case"OOOO":default:return"GMT"+Zn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+vh(i,":");case"zzzz":default:return"GMT"+Zn(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 vh(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 Mh(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Zn(n,t)}function Zn(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 Sh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Tv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Sh(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}}",Sh(i,t)).replace("{{time}}",kh(s,t))},Cv={p:kh,P:Tv},Ev=/^D+$/,Ov=/^Y+$/,Pv=["D","DD","YY","YYYY"];function Av(n){return Ev.test(n)}function Rv(n){return Ov.test(n)}function Iv(n,t,e){const i=Lv(n,t,e);if(console.warn(i),Pv.includes(n))throw new RangeError(i)}function Lv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Nv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Fv(n){return!(!Nv(n)&&typeof n!="number"||isNaN(+de(n)))}const Bv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hv=/^'([^]*?)'?$/,Wv=/''/g,Yv=/[a-zA-Z]/;function Vv(n,t,e){var i,s,r,a,o,l,c,u;const h=Ds(),f=(e==null?void 0:e.locale)??h.locale??mv,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(r=h.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,g=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,p=de(n,e==null?void 0:e.in);if(!Fv(p))throw new RangeError("Invalid time value");let x=t.match(zv).map(M=>{const D=M[0];if(D==="p"||D==="P"){const k=Cv[D];return k(M,f.formatLong)}return M}).join("").match(Bv).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:jv(M)};if(wh[D])return{isToken:!0,value:M};if(D.match(Yv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(x=f.localize.preprocessor(p,x));const v={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Rv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Av(D))&&Iv(D,t,String(n));const k=wh[D[0]];return k(p,D,f.localize,v)}).join("")}function jv(n){const t=n.match(Hv);return t?t[1].replace(Wv,"'"):n}function Fo(n,t,e){const i=de(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function $v(n,t,e){const i=de(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function Mi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function Uv(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function qv(){return Object.assign({},Ds())}function Dh(n){return Math.trunc(n*bv)}function Xv(n){const t=n/yv;return Math.trunc(t)}function Th(n,t,e){return $v(n,-1)}function Ch(n,t,e){const i=qv(),s=Zv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Gv(s,t):Kv(s,t)}function Gv(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 Kv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Zv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Qv(n,t){const e=i1(t);return"formatToParts"in e?t1(e,n):e1(e,n)}const Jv={year:0,month:1,day:2,hour:3,minute:4,second:5};function t1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Jv[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 e1(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 Bo={},Eh=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")),n1=Eh==="06/25/2014, 00:00:00"||Eh==="06/25/2014 00:00:00";function i1(n){return Bo[n]||(Bo[n]=n1?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"})),Bo[n]}function zo(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Oh=36e5,s1=6e4,Ho={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Cs(n,t,e){if(!n)return 0;let i=Ho.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ho.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ph(s)?-(s*Oh):NaN;if(i=Ho.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Ph(s,a)?(r=Math.abs(s)*Oh+a*s1,i[1]==="+"?-r:r):NaN}if(o1(n)){t=new Date(t||Date.now());const a=e?t:r1(t),o=Wo(a,n);return-(e?o:a1(t,o,n))}return NaN}function r1(n){return zo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Wo(n,t){const e=Qv(n,t),i=zo(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 a1(n,t,e){let i=n.getTime()-t;const s=Wo(new Date(i),e);if(t===s)return t;i-=s-t;const r=Wo(new Date(i),e);return s===r?s:Math.max(s,r)}function Ph(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Ah={};function o1(n){if(Ah[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Ah[n]=!0,!0}catch{return!1}}const l1=60*1e3,c1={X:function(n,t,e){const i=Yo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Rh(i);case"XXXX":case"XX":return Si(i);case"XXXXX":case"XXX":default:return Si(i,":")}},x:function(n,t,e){const i=Yo(e.timeZone,n);switch(t){case"x":return Rh(i);case"xxxx":case"xx":return Si(i);case"xxxxx":case"xxx":default:return Si(i,":")}},O:function(n,t,e){const i=Yo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+u1(i,":");case"OOOO":default:return"GMT"+Si(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ch("short",n,e);case"zzzz":default:return Ch("long",n,e)}}};function Yo(n,t){const e=n?Cs(n,t,!0)/l1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Yr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Si(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Yr(Math.floor(i/60),2),r=Yr(Math.floor(i%60),2);return e+s+t+r}function Rh(n,t){return n%60===0?(n>0?"-":"+")+Yr(Math.abs(n)/60,2):Si(n,t)}function u1(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+Yr(r,2)}function Ih(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 Lh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Vo=36e5,Nh=6e4,d1=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:Lh};function Vr(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?d1: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=h1(n),{year:s,restDateString:r}=f1(i.date,e),a=m1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=g1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Cs(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Ih(new Date(o+l)),c=Ih(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function h1(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 f1(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 m1(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,zh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return b1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return zh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Hh(s)?Fh(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Hh(s,a)?Fh(t,s,a):new Date(NaN)}return null}function g1(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),jo(t)?t%24*Vo:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),jo(t,e)?t%24*Vo+e*Nh: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 jo(t,e,s)?t%24*Vo+e*Nh+s*1e3:NaN}return null}function Fh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const p1=[31,28,31,30,31,30,31,31,30,31,30,31],y1=[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 zh(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>y1[t]||!i&&e>p1[t])return!1}return!0}function b1(n,t){if(t<1)return!1;const e=Bh(n);return!(e&&t>366||!e&&t>365)}function Hh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function jo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const _1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function x1(n,t,e={}){t=String(t);const i=t.match(_1);if(i){const s=Vr(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+c1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Vv(n,t,e)}function Wh(n,t,e){n=Vr(n,e);const i=Cs(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 w1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},x1(Wh(n,t,{timeZone:i.timeZone}),e,i)}function v1(n,t,e){if(typeof n=="string"&&!n.match(Lh))return Vr(n,{...e,timeZone:t});n=Vr(n,e);const i=zo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Cs(t,new Date(i));return new Date(i+s)}function M1(n,t){return-Cs(n,t)}function $o(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 w1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const S1={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 Uo(n){return n&&Rw.find(t=>n<=S1[t])||null}var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function k1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $r={exports:{}};$r.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",p="[object Promise]",x="[object RegExp]",v="[object Set]",M="[object String]",D="[object Symbol]",k="[object WeakMap]",E="[object ArrayBuffer]",R="[object DataView]",C="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",L="[object Uint8ClampedArray]",B="[object Uint16Array]",X="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,j=/\w*$/,lt=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,Q={};Q[r]=Q[a]=Q[E]=Q[R]=Q[o]=Q[l]=Q[C]=Q[b]=Q[_]=Q[S]=Q[O]=Q[f]=Q[m]=Q[g]=Q[x]=Q[v]=Q[M]=Q[D]=Q[A]=Q[L]=Q[B]=Q[X]=!0,Q[c]=Q[u]=Q[k]=!1;var H=typeof jr=="object"&&jr&&jr.Object===Object&&jr,U=typeof self=="object"&&self&&self.Object===Object&&self,Y=H||U||Function("return this")(),xt=t&&!t.nodeType&&t,yt=xt&&!0&&n&&!n.nodeType&&n,vt=yt&&yt.exports===xt;function mt(w,I){return w.set(I[0],I[1]),w}function gt(w,I){return w.add(I),w}function z(w,I){for(var F=-1,K=w?w.length:0;++F<K&&I(w[F],F,w)!==!1;);return w}function $(w,I){for(var F=-1,K=I.length,jt=w.length;++F<K;)w[jt+F]=I[F];return w}function V(w,I,F,K){for(var jt=-1,Kt=w?w.length:0;++jt<Kt;)F=I(F,w[jt],jt,w);return F}function J(w,I){for(var F=-1,K=Array(w);++F<w;)K[F]=I(F);return K}function et(w,I){return w==null?void 0:w[I]}function nt(w){var I=!1;if(w!=null&&typeof w.toString!="function")try{I=!!(w+"")}catch{}return I}function st(w){var I=-1,F=Array(w.size);return w.forEach(function(K,jt){F[++I]=[jt,K]}),F}function it(w,I){return function(F){return w(I(F))}}function _t(w){var I=-1,F=Array(w.size);return w.forEach(function(K){F[++I]=K}),F}var ct=Array.prototype,Et=Function.prototype,te=Object.prototype,le=Y["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Re=Et.toString,Mt=te.hasOwnProperty,Xt=te.toString,zt=RegExp("^"+Re.call(Mt).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?Y.Buffer:void 0,ie=Y.Symbol,Xe=Y.Uint8Array,si=it(Object.getPrototypeOf,Object),Be=Object.create,Ht=te.propertyIsEnumerable,ve=ct.splice,ri=Object.getOwnPropertySymbols,fa=Gt?Gt.isBuffer:void 0,ma=it(Object.keys,Object),Ys=Nn(Y,"DataView"),ai=Nn(Y,"Map"),Vs=Nn(Y,"Promise"),oi=Nn(Y,"Set"),cn=Nn(Y,"WeakMap"),un=Nn(Object,"create"),js=ce(Ys),$s=ce(ai),li=ce(Vs),Bl=ce(oi),zl=ce(cn),ga=ie?ie.prototype:void 0,pa=ga?ga.valueOf:void 0;function dn(w){var I=-1,F=w?w.length:0;for(this.clear();++I<F;){var K=w[I];this.set(K[0],K[1])}}function Ri(){this.__data__=un?un(null):{}}function Us(w){return this.has(w)&&delete this.__data__[w]}function ya(w){var I=this.__data__;if(un){var F=I[w];return F===i?void 0:F}return Mt.call(I,w)?I[w]:void 0}function hn(w){var I=this.__data__;return un?I[w]!==void 0:Mt.call(I,w)}function Hl(w,I){var F=this.__data__;return F[w]=un&&I===void 0?i:I,this}dn.prototype.clear=Ri,dn.prototype.delete=Us,dn.prototype.get=ya,dn.prototype.has=hn,dn.prototype.set=Hl;function ze(w){var I=-1,F=w?w.length:0;for(this.clear();++I<F;){var K=w[I];this.set(K[0],K[1])}}function Wl(){this.__data__=[]}function Yl(w){var I=this.__data__,F=Li(I,w);if(F<0)return!1;var K=I.length-1;return F==K?I.pop():ve.call(I,F,1),!0}function Vl(w){var I=this.__data__,F=Li(I,w);return F<0?void 0:I[F][1]}function He(w){return Li(this.__data__,w)>-1}function jl(w,I){var F=this.__data__,K=Li(F,w);return K<0?F.push([w,I]):F[K][1]=I,this}ze.prototype.clear=Wl,ze.prototype.delete=Yl,ze.prototype.get=Vl,ze.prototype.has=He,ze.prototype.set=jl;function In(w){var I=-1,F=w?w.length:0;for(this.clear();++I<F;){var K=w[I];this.set(K[0],K[1])}}function $l(){this.__data__={hash:new dn,map:new(ai||ze),string:new dn}}function Ul(w){return Bi(this,w).delete(w)}function ql(w){return Bi(this,w).get(w)}function We(w){return Bi(this,w).has(w)}function Xl(w,I){return Bi(this,w).set(w,I),this}In.prototype.clear=$l,In.prototype.delete=Ul,In.prototype.get=ql,In.prototype.has=We,In.prototype.set=Xl;function Ln(w){this.__data__=new ze(w)}function Gl(){this.__data__=new ze}function Kl(w){return this.__data__.delete(w)}function Zl(w){return this.__data__.get(w)}function Ii(w){return this.__data__.has(w)}function Ql(w,I){var F=this.__data__;if(F instanceof ze){var K=F.__data__;if(!ai||K.length<e-1)return K.push([w,I]),this;F=this.__data__=new In(K)}return F.set(w,I),this}Ln.prototype.clear=Gl,Ln.prototype.delete=Kl,Ln.prototype.get=Zl,Ln.prototype.has=Ii,Ln.prototype.set=Ql;function Jl(w,I){var F=Ks(w)||Hi(w)?J(w.length,String):[],K=F.length,jt=!!K;for(var Kt in w)Mt.call(w,Kt)&&!(jt&&(Kt=="length"||pc(Kt,K)))&&F.push(Kt);return F}function Ie(w,I,F){var K=w[I];(!(Mt.call(w,I)&&Gs(K,F))||F===void 0&&!(I in w))&&(w[I]=F)}function Li(w,I){for(var F=w.length;F--;)if(Gs(w[F][0],I))return F;return-1}function tc(w,I){return w&&ba(I,ci(I),w)}function qs(w,I,F,K,jt,Kt,Me){var ee;if(K&&(ee=Kt?K(w,jt,Kt,Me):K(w)),ee!==void 0)return ee;if(!mn(w))return w;var ka=Ks(w);if(ka){if(ee=mc(w),!I)return dc(w,ee)}else{var Fn=Ge(w),Da=Fn==u||Fn==h;if(va(w))return rc(w,I);if(Fn==g||Fn==r||Da&&!Kt){if(nt(w))return Kt?w:{};if(ee=xa(Da?{}:w),!I)return hc(w,tc(ee,w))}else{if(!Q[Fn])return Kt?w:{};ee=gc(w,Fn,qs,I)}}Me||(Me=new Ln);var Ta=Me.get(w);if(Ta)return Ta;if(Me.set(w,ee),!ka)var ui=F?fc(w):ci(w);return z(ui||w,function(Qs,Wi){ui&&(Wi=Qs,Qs=w[Wi]),Ie(ee,Wi,qs(Qs,I,F,K,Wi,w,Me))}),ee}function ec(w){return mn(w)?Be(w):{}}function nc(w,I,F){var K=I(w);return Ks(w)?K:$(K,F(w))}function ic(w){return Xt.call(w)}function Ni(w){if(!mn(w)||yc(w))return!1;var I=Zs(w)||nt(w)?zt:lt;return I.test(ce(w))}function sc(w){if(!fn(w))return ma(w);var I=[];for(var F in Object(w))Mt.call(w,F)&&F!="constructor"&&I.push(F);return I}function rc(w,I){if(I)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function Fi(w){var I=new w.constructor(w.byteLength);return new Xe(I).set(new Xe(w)),I}function ac(w,I){var F=I?Fi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function oc(w,I,F){var K=I?F(st(w),!0):st(w);return V(K,mt,new w.constructor)}function Xs(w){var I=new w.constructor(w.source,j.exec(w));return I.lastIndex=w.lastIndex,I}function lc(w,I,F){var K=I?F(_t(w),!0):_t(w);return V(K,gt,new w.constructor)}function cc(w){return pa?Object(pa.call(w)):{}}function uc(w,I){var F=I?Fi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function dc(w,I){var F=-1,K=w.length;for(I||(I=Array(K));++F<K;)I[F]=w[F];return I}function ba(w,I,F,K){F||(F={});for(var jt=-1,Kt=I.length;++jt<Kt;){var Me=I[jt],ee=void 0;Ie(F,Me,ee===void 0?w[Me]:ee)}return F}function hc(w,I){return ba(w,_a(w),I)}function fc(w){return nc(w,ci,_a)}function Bi(w,I){var F=w.__data__;return zi(I)?F[typeof I=="string"?"string":"hash"]:F.map}function Nn(w,I){var F=et(w,I);return Ni(F)?F:void 0}var _a=ri?it(ri,Object):Ma,Ge=ic;(Ys&&Ge(new Ys(new ArrayBuffer(1)))!=R||ai&&Ge(new ai)!=f||Vs&&Ge(Vs.resolve())!=p||oi&&Ge(new oi)!=v||cn&&Ge(new cn)!=k)&&(Ge=function(w){var I=Xt.call(w),F=I==g?w.constructor:void 0,K=F?ce(F):void 0;if(K)switch(K){case js:return R;case $s:return f;case li:return p;case Bl:return v;case zl:return k}return I});function mc(w){var I=w.length,F=w.constructor(I);return I&&typeof w[0]=="string"&&Mt.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function xa(w){return typeof w.constructor=="function"&&!fn(w)?ec(si(w)):{}}function gc(w,I,F,K){var jt=w.constructor;switch(I){case E:return Fi(w);case o:case l:return new jt(+w);case R:return ac(w,K);case C:case b:case _:case S:case O:case A:case L:case B:case X:return uc(w,K);case f:return oc(w,K,F);case m:case M:return new jt(w);case x:return Xs(w);case v:return lc(w,K,F);case D:return cc(w)}}function pc(w,I){return I=I??s,!!I&&(typeof w=="number"||q.test(w))&&w>-1&&w%1==0&&w<I}function zi(w){var I=typeof w;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?w!=="__proto__":w===null}function yc(w){return!!qt&&qt in w}function fn(w){var I=w&&w.constructor,F=typeof I=="function"&&I.prototype||te;return w===F}function ce(w){if(w!=null){try{return Re.call(w)}catch{}try{return w+""}catch{}}return""}function bc(w){return qs(w,!0,!0)}function Gs(w,I){return w===I||w!==w&&I!==I}function Hi(w){return _c(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==r)}var Ks=Array.isArray;function wa(w){return w!=null&&xc(w.length)&&!Zs(w)}function _c(w){return gn(w)&&wa(w)}var va=fa||Sa;function Zs(w){var I=mn(w)?Xt.call(w):"";return I==u||I==h}function xc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function mn(w){var I=typeof w;return!!w&&(I=="object"||I=="function")}function gn(w){return!!w&&typeof w=="object"}function ci(w){return wa(w)?Jl(w):sc(w)}function Ma(){return[]}function Sa(){return!1}n.exports=bc}($r,$r.exports),$r.exports;const an=(n,t)=>new Date(n.getTime()-M1(t,n));class oe{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(Aw.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const e=v1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Wh(e,t)}}class D1 extends oe{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class T1 extends oe{rawStart(t){let e=Mi(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class C1 extends oe{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*366}}class E1 extends oe{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=an(i,t)),i}}class O1 extends oe{rawEnd(t){let e=Mi(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}rawStart(t){let e=Mi(Th(this.tzAdjustedDate(t)));return t&&(e=an(e,t)),e}}class P1 extends oe{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=an(e,t)),e}}tt.FIFTEEN_MIN,new oe({key:tt.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"]}),tt.ONE_HOUR,new oe({key:tt.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"]}),tt.SIX_HOUR,new oe({key:tt.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"]}),tt.TWELVE_HOUR,new oe({key:tt.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"]}),tt.ONE_DAY,new oe({key:tt.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"]}),tt.SEVEN_DAY,new oe({key:tt.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"]}),tt.THIRTY_DAY,new oe({key:tt.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"]}),tt.NINETY_DAY,new oe({key:tt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_HUNDRED_EIGHTY_DAY,new oe({key:tt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_YEAR,new oe({key:tt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.CURRENT_WEEK,new D1({key:tt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Ts(Fo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.CURRENT_MONTH,new T1({key:tt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Mi(new Date);return(Ts(Fo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_YEAR,new C1({key:tt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Ts(Fo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_WEEK,new E1({key:tt.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"]}),tt.PREVIOUS_MONTH,new O1({key:tt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Mi(new Date),e=Mi(Th(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Yh(t,e)),60*60*24*Uv(new Date().setMonth(new Date().getMonth()-1))+Dh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_YEAR,new P1({key:tt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Yh(n,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Dh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Yh(n,t){return Xv(n.getTimezoneOffset()-t.getTimezoneOffset())}tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.THIRTY_DAY,tt.NINETY_DAY,tt.ONE_HUNDRED_EIGHTY_DAY,tt.ONE_YEAR,tt.CURRENT_WEEK,tt.CURRENT_MONTH,tt.CURRENT_YEAR,tt.PREVIOUS_WEEK,tt.PREVIOUS_MONTH,tt.PREVIOUS_YEAR;const A1=new Map(gh.map(n=>[n.code,{code:n.code,name:n.name}])),qo=n=>{var t;return((t=A1.get(n))==null?void 0:t.name)||n};var Vh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(Vh);var R1=Vh.exports;const Xo=k1(R1);var jh;const Ur=new Intl.NumberFormat(((jh=document==null?void 0:document.documentElement)==null?void 0:jh.lang)||"en-US");function Es({i18n:n}){const t=(i,s)=>{if(isNaN(i))return"0 B";const r=s?Math.pow(2,50):1e15,a=s?Math.pow(2,40):1e12,o=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=r?u=n.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=n.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},e=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?n.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:r=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,r);case"usd":return e(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${Xo(i,{capital:!0})} ${c}`:i>=.01?`${Ur.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:e,formatRange:(i,s,r,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(r,s);switch(r){case"bytes":return`${t(i,a)} - ${t(s,a)}`;case"usd":return`${e(i,o)} - ${e(s,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${Xo(i,{capital:!0})} - ${Xo(s,{capital:!0})} ${u}`}const h=i>=.01?`${Ur.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${Ur.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const qr=n=>["interactive","zoom-interactive"].includes(n),$h=(n,t,e,i)=>{var l,c;const{tooltip:s}=t;if(s.opacity===0&&!qr(n.interactionMode)){n.showTooltip=!1;return}const{i18n:r}=pt.useI18n(),{formatUnit:a}=Es({i18n:r}),o=n.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(s.body&&!qr(n.interactionMode)){const u=s.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y";n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(s.dataPoints[0].parsed.x,e):As({tickValue:new Date(s.dataPoints[0].parsed.x),granularity:e}),n.tooltipSeries=s.dataPoints.map((f,m)=>{const g=f.parsed[h],p=a(g,n.units,{translateUnit:n.translateUnit}),x=f.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:x,value:p,rawValue:g,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(o),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},Uh=(n,t)=>{var a,o;const{tooltip:e}=t,{i18n:i}=pt.useI18n(),{formatUnit:s}=Es({i18n:i});if(e.opacity===0&&!qr(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(e.body&&!qr(n.interactionMode)){const l=e.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[c],g=s(m,n.units,{translateUnit:n.translateUnit});let p;return u?p=h.dataset.labels[h.dataIndex]:p=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:p,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},I1=n=>n&&n.datasets&&n.datasets.length,L1=n=>I1(n)&&n.datasets.some(t=>t.data.length),N1=n=>n.datasets.some(t=>t.data[0]&&To(t.data[0].x)),F1=n=>!!L1(n)&&n.datasets.some(t=>t.data.length==1),B1=n=>N1(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Go=(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)},z1=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ko(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const qh=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},H1=2,Xh=10,Gh=12,Xr=10,Kh="#6c7489",W1="#d60027",Zo="#6c7489",Y1="#995c00",V1="#ffc400",Qo="16px",j1="20px",$1="'Inter', Roboto, Helvetica, sans-serif",Zh="24px",U1="40px",q1="48px",Qh={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Gr=(n,t)=>(t||on)[n%on.length],Jh=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},tf="#6f7787",ef={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},X1=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=ef[t])==null?void 0:e.background)||"#fafafa"},G1={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},K1={"4XX":"#FFBA81","5XX":"#FF8484"},Z1={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},Q1="#dad4c7",nf="#afb7c5",J1=n=>{const t=Object.entries(Qh).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Qh.standard},Jo=(n,t,e,i)=>{let s;return e?s=nf:Array.isArray(i)?s=Gr(n,i):s=i[t],s||Gr(n)},Kr=n=>{switch(n){case"error":return W1;case"warning":return V1;case"neutral":return Kh;default:return Kh}},tM={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},eM=2,nM=0,tl=new Map,el=(n,t)=>{const{i18n:e}=pt.useI18n(),{formatBytes:i}=Es({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):Ur.format(n)},sf=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},iM=()=>{const n="label_height";if(!tl.has(n)){const t=It({});tl.set(n,t.lineHeight)}return tl.get(n)},sM=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),rf=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),af=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,nl="#e0e4ea",rM={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},Os=(n,t)=>{let e=1;const i=rM[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},of=new Map([[100,Os("100",[100,101,102,103])],[200,Os("200",[200,201,202,203,204,205,206,207,208,226])],[300,Os("300",[300,301,302,303,304,305,307,308])],[400,Os("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,Os("500",[500,501,502,503,504,505,506,507,508,510,511])]]),il=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=of.get(e);return i===void 0?nl:i.get(t)??i.get(-1)??nl},aM=n=>{const t=il(n);return{solid:t,light:t}},Zr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=il(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function lf(n,t,e){const i=sh(),s=cM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?oM(s,t):lM(s,t)}function oM(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function lM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function cM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function uM(n,t){const e=gM(t);return"formatToParts"in e?hM(e,n):fM(e,n)}const dM={year:0,month:1,day:2,hour:3,minute:4,second:5};function hM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=dM[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function fM(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const sl={},cf=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),mM=cf==="06/25/2014, 00:00:00"||cf==="06/25/2014 00:00:00";function gM(n){return sl[n]||(sl[n]=mM?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),sl[n]}function uf(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const df=36e5,pM=6e4,rl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function al(n,t,e){if(!n)return 0;let i=rl.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=rl.timezoneHH.exec(n),i)return s=parseInt(i[1],10),hf(s)?-(s*df):NaN;if(i=rl.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return hf(s,a)?(r=Math.abs(s)*df+a*pM,i[1]==="+"?-r:r):NaN}if(_M(n)){t=new Date(t||Date.now());const a=e?t:yM(t),o=ol(a,n);return-(e?o:bM(t,o,n))}return NaN}function yM(n){return uf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function ol(n,t){const e=uM(n,t),i=uf(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function bM(n,t,e){let s=n.getTime()-t;const r=ol(new Date(s),e);if(t===r)return t;s-=r-t;const a=ol(new Date(s),e);return r===a?r:Math.max(r,a)}function hf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const ff={};function _M(n){if(ff[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),ff[n]=!0,!0}catch{return!1}}const xM=60*1e3,wM={X:function(n,t,e){const i=ll(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return mf(i);case"XXXX":case"XX":return ki(i);case"XXXXX":case"XXX":default:return ki(i,":")}},x:function(n,t,e){const i=ll(e.timeZone,n);switch(t){case"x":return mf(i);case"xxxx":case"xx":return ki(i);case"xxxxx":case"xxx":default:return ki(i,":")}},O:function(n,t,e){const i=ll(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+vM(i,":");case"OOOO":default:return"GMT"+ki(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return lf("short",n,e);case"zzzz":default:return lf("long",n,e)}}};function ll(n,t){const e=n?al(n,t,!0)/xM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Qr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function ki(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Qr(Math.floor(i/60),2),r=Qr(Math.floor(i%60),2);return e+s+t+r}function mf(n,t){return n%60===0?(n>0?"-":"+")+Qr(Math.abs(n)/60,2):ki(n,t)}function vM(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Qr(r,2)}function gf(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const MM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,cl=36e5,pf=6e4,SM=2,fe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:MM};function yf(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?SM: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=kM(n),{year:s,restDateString:r}=DM(i.date,e),a=TM(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=CM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=al(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=gf(new Date(o+l)),c=gf(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function kM(n){const t={};let e=fe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=fe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=fe.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function DM(n,t){if(n){const e=fe.YYY[t],i=fe.YYYYY[t];let s=fe.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=fe.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 TM(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=fe.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,xf(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=fe.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return PM(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=fe.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return xf(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=fe.Www.exec(n),r)return s=parseInt(r[1],10)-1,wf(s)?bf(t,s):new Date(NaN);if(r=fe.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return wf(s,a)?bf(t,s,a):new Date(NaN)}return null}function CM(n){let t,e,i=fe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ul(t)?t%24*cl:NaN;if(i=fe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ul(t,e)?t%24*cl+e*pf:NaN;if(i=fe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ul(t,e,s)?t%24*cl+e*pf+s*1e3:NaN}return null}function bf(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const EM=[31,28,31,30,31,30,31,31,30,31,30,31],OM=[31,29,31,30,31,30,31,31,30,31,30,31];function _f(n){return n%400===0||n%4===0&&n%100!==0}function xf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=_f(n);if(i&&e>OM[t]||!i&&e>EM[t])return!1}return!0}function PM(n,t){if(t<1)return!1;const e=_f(n);return!(e&&t>366||!e&&t>365)}function wf(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ul(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const AM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function dl(n,t,e={}){t=String(t);const i=t.match(AM);if(i){const s=yf(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+wM[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Br(n,t,e)}function RM(n,t,e){n=yf(n,e);const i=al(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 Ps(n,t,e,i){return i={...i,timeZone:t,originalDate:n},dl(RM(n,t,{timeZone:i.timeZone}),e,i)}const IM=(n,t)=>`${Ps(n,t,"yyyy")} W${Ps(n,t,"II")}`,hl="yyyy-MM-dd h:mm:ss a",fl="h:mm:ss a",Qn="yyyy-MM-dd h:mm a",Di="h:mm a",LM="yyyy-MM-dd",ml="MMM dd, yyyy h:mm:ss a",En="MMM dd, yyyy h:mm a",NM={secondly:n=>n?hl:fl,tenSecondly:n=>n?hl:fl,thirtySecondly:n=>n?hl:fl,minutely:n=>n?Qn:Di,fiveMinutely:n=>n?Qn:Di,tenMinutely:n=>n?Qn:Di,thirtyMinutely:n=>n?Qn:Di,hourly:n=>n?Qn:Di,twoHourly:n=>n?Qn:Di,twelveHourly:()=>Qn,daily:()=>LM},FM={secondly:()=>ml,tenSecondly:()=>ml,thirtySecondly:()=>ml,minutely:()=>En,fiveMinutely:()=>En,tenMinutely:()=>En,thirtyMinutely:()=>En,hourly:()=>En,twoHourly:()=>En,twelveHourly:()=>En,daily:()=>En};function vf({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:a}){const o=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return IM(n,o);if(s&&s[t]){const l=s[t](i);return Ps(n,o,l)}if(r&&r[t]){const l=r[t]();return Ps(n,o,l)}return Ps(n,o,a)}const BM=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>vf({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:NM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),As=({tickValue:n,granularity:t,timezone:e})=>vf({tickValue:n,granularity:t,timezone:e,tooltipMap:FM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),zM=n=>{var e,i,s,r,a;const{i18n:t}=pt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(n==null?void 0:n.message)}};function HM(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Te.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=Go(c,h,f),g=c.y,p=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:g-n.tooltipState.offsetY,xAlign:p}},ro.modes.customInteractionMode=function(l,c){const u=Sn(c,l),h=[];return ro.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,g)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const s=n.numLabels.value>25?Xh:Gh,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[c]?"italic":"normal"}},a=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Xr?c.slice(0,Xr)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,g,p;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(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="y"?!rt((l=n.metricAxesTitle)==null?void 0:l.value):!rt((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="x"?!rt((f=n.metricAxesTitle)==null?void 0:f.value):!rt((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(g=n.metricAxesTitle)==null?void 0:g.value:(p=n.dimensionAxesTitle)==null?void 0:p.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{Uh(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return d.getCurrentInstance()&&d.onUnmounted(()=>{Te.positioners[e]&&delete Te.positioners[e]}),o}be.register(...q0);const WM=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function YM(n,t,e,i,s){const r=d.shallowRef(null),a=(o,l)=>{if(t.value)return new be(t.value,{type:n,data:o,plugins:i,options:l})};return d.onMounted(()=>{r.value=a(e.value,s.value)}),d.onBeforeUnmount(()=>{rt(r.value)||r.value.destroy()}),d.watch(e,(o,l)=>{if(WM(l,o)&&!rt(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else rt(r.value)||r.value.destroy(),r.value=a(o,s.value)}),d.watch(t,()=>{rt(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),d.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(rt(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mf={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(Mf);var VM=Mf.exports;const Rs=gl(VM);function jM(n,t,e){const{i18n:i}=pt.useI18n(),{formatBytes:s}=Es({i18n:i}),{translateUnit:r}=pt.useTranslatedUnits();return{legendValues:d.computed(()=>n.value.datasets.reduce((o,l)=>{const c=l.total?l.total:l.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(e.value==="bytes")u=s(c);else{const h=r(e.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Rs(c,{capital:!0}),unit:h})||`${Rs(c,{capital:!0})} ${e.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function $M(n){return d.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${$o(e)} - ${$o(i,{includeTZ:!0})}`:""})}function UM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};Te.positioners[e]=function(r,a){if(!r.length)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=o.width/2,u=Go(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{Uh(n.tooltipState,r)}}}}));return d.onUnmounted(()=>{Te.positioners[e]&&delete Te.positioners[e]}),{options:s}}function qM(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return BM({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!rt((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=d.computed(()=>{var l,c;return{title:{display:!rt((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};Te.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,g=u.height/2,p=Go(c,h,m);let x=z1(c,f,g);const v=c.y<g?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(x=0),{x:p,y:x,xAlign:M,yAlign:v}};const a=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return dw(l)>24||u.getDate()!==c.getDate()}),o=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:u=>{$h(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1}}});return d.onUnmounted(()=>{Te.positioners[s]&&delete Te.positioners[s]}),{options:o}}function XM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=pt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Gr(i.indexOf(u),on),data:a.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Jo(h,u.name,u.id==="empty",o);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function GM(n,t){const{i18n:e}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0,u=c&&o.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?s.flatMap(_=>a.map((S,O)=>{const A=_.event[f],L=c?`${A},${S}`:`${O},${S}`,B=_.event[S];return[L,B]})):s.map(_=>{const S=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,O=_.event[a[0]];return[S,O]})),p=Object.keys(g).reduce((_,S)=>{const[O]=S.split(","),A=g[S];return _[O]?_[O]+=A:_[O]=A,_},{}),x=Object.entries(p).sort(([,_],[,S])=>Number(S)-Number(_)).map(([_])=>_),v=r[f],M=r[m];let D=c&&v&&Object.entries(v).map(([_,S])=>({id:_,name:S.name}))||a.map(_=>({id:_,name:_})),k=c&&M&&Object.entries(M).map(([_,S])=>({id:_,name:S.name}))||a.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(D=D.map(_=>({..._,name:qo(_.id)||_.name}))),c&&m==="country_code"&&(k=k.map(_=>({..._,name:qo(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((_,S)=>x.indexOf(_.id)-x.indexOf(S.id)),k.sort((_,S)=>x.indexOf(_.id)-x.indexOf(S.id))),!D||!k)return{labels:[],datasets:[]};const E=XM({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:k,pivotRecords:g,rowLabels:D,colorPalette:n.colorPalette||on}),R=c?D.map(_=>e&&e.te(`chartLabels.${_.name}`)&&e.t(`chartLabels.${_.name}`)||_.name):a.map(_=>e&&e.te(`chartLabels.${_}`)&&e.t(`chartLabels.${_}`)||_),C=D.map(_=>_.id==="empty");return{labels:R,datasets:E,isLabelEmpty:C,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const KM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),ZM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return ch(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},QM=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return KM(o,l,e)};function JM(n,t){const{i18n:e}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],h=r[u];let f=r&&h&&Object.keys(h).map(k=>({id:k,name:h[k].name}))||a.map(k=>({id:k,name:k}));u==="country_code"&&(f=f.map(k=>({...k,name:qo(k.id)||k.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const g=ZM(o),p=QM(o,l,m,g,s),x=new Set,v=s!=null&&s.length?s.reduce((k,E)=>{const R=new Date(E.timestamp).valueOf(),C=E.event;for(const b of a)x.add(b),R in k||(k[R]={}),b in k[R]||(k[R][b]={});for(const b of a)f.forEach(_=>{C[u]===_.id||b===_.id?(k[R][b]||(k[R][b]={}),k[R][b][_.name]=Math.round(Number(C[b])*1e3)/1e3):c.length||(k[R][b]||(k[R][b]={}),k[R][b][_.name]=Math.round(Number(C[_.id])*1e3)/1e3)});return k},{}):{},D=[...a.length===1?a.flatMap(k=>f.map(E=>[k,E.name,E.id==="empty"])):f.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,E,R],C)=>{const b=p.map(A=>A in v&&k in v[A]?{x:A,y:v[A][k][E]||0}:{x:A,y:0});let{colorPalette:_,fill:S}=n;rt(_)&&(_=on);const O=Jo(C,E,R,_);return{rawDimension:E,rawMetric:k,label:e&&e.te(`chartLabels.${E}`)&&e.t(`chartLabels.${E}`)||E,borderColor:O,backgroundColor:O,data:b,total:b.reduce((A,{y:L})=>A+Number(L),0),...tM,fill:S,borderWidth:S?nM:eM,isSegmentEmpty:R}});return u==="status_code"||u==="status_code_grouped"?D.sort((k,E)=>(k.label??"")<(E.label??"")?-1:1):D.sort((k,E)=>Number(k.total)<Number(E.total)?-1:1),{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const tS=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function eS(){const{i18n:n}=pt.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 nS="analytics-query-provider",Sf=2;function iS(){const n=d.inject(nS);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function pl(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const kf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sS=n=>n!=null,rS=Object.prototype.toString,aS=n=>rS.call(n)==="[object Object]";function Jr(n){return Array.isArray(n)?n:[n]}function oS(n){return d.getCurrentInstance()}function lS(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const o=[...n.value];o[i]=s,n.value=o}else{const o={...n.value,[i]:s};Object.setPrototypeOf(o,Object.getPrototypeOf(n.value)),n.value=o}else n.value[i]=s}}));return e}function cS(n,t=!0,e){oS()?d.onMounted(n,e):t?n():d.nextTick(n)}function uS(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const ta=kf?window:void 0;function Ti(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Is(...n){const t=[],e=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),s=d.computed(()=>{const o=Jr(d.toValue(n[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),r=uS(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(c=>Ti(c)))!=null?l:[ta].filter(c=>c!=null),Jr(d.toValue(s.value?n[1]:n[0])),Jr(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([o,l,c,u])=>{if(e(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=aS(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{r(),e()};return pl(e),a}function dS(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function Df(n){const t=dS();return d.computed(()=>(t.value,!!n()))}function hS(n,t,e={}){const{window:i=ta,...s}=e;let r;const a=Df(()=>i&&"MutationObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=Jr(f).map(Ti).filter(sS);return new Set(m)}),c=d.watch(()=>l.value,f=>{o(),a.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),o()};return pl(h),{isSupported:a,stop:h,takeRecords:u}}function fS(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=ta,containerElement:m,handle:g=n,buttons:p=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),v=d.ref(),M=C=>i?i.includes(C.pointerType):!0,D=C=>{d.toValue(s)&&C.preventDefault(),d.toValue(r)&&C.stopPropagation()},k=C=>{var b;if(!d.toValue(p).includes(C.button)||d.toValue(t.disabled)||!M(C)||d.toValue(a)&&C.target!==d.toValue(n))return;const _=d.toValue(m),S=(b=_==null?void 0:_.getBoundingClientRect)==null?void 0:b.call(_),O=d.toValue(n).getBoundingClientRect(),A={x:C.clientX-(_?O.left-S.left+_.scrollLeft:O.left),y:C.clientY-(_?O.top-S.top+_.scrollTop:O.top)};(c==null?void 0:c(A,C))!==!1&&(v.value=A,D(C))},E=C=>{if(d.toValue(t.disabled)||!M(C)||!v.value)return;const b=d.toValue(m),_=d.toValue(n).getBoundingClientRect();let{x:S,y:O}=x.value;(h==="x"||h==="both")&&(S=C.clientX-v.value.x,b&&(S=Math.min(Math.max(0,S),b.scrollWidth-_.width))),(h==="y"||h==="both")&&(O=C.clientY-v.value.y,b&&(O=Math.min(Math.max(0,O),b.scrollHeight-_.height))),x.value={x:S,y:O},o==null||o(x.value,C),D(C)},R=C=>{d.toValue(t.disabled)||!M(C)||v.value&&(v.value=void 0,l==null||l(x.value,C),D(C))};if(kf){const C=()=>{var b;return{capture:(b=t.capture)!=null?b:!0,passive:!d.toValue(s)}};Is(g,"pointerdown",k,C),Is(f,"pointermove",E,C),Is(f,"pointerup",R,C)}return{...lS(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function mS(n,t,e={}){const{window:i=ta,...s}=e;let r;const a=Df(()=>i&&"ResizeObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Ti(f)):[Ti(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return pl(u),{isSupported:a,stop:u}}function gS(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:a="sync"}=t,o=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function p(){const v=Ti(n);if(!v){e&&(o.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const M=v.getBoundingClientRect();o.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,g.value=M.y}function x(){a==="sync"?p():a==="next-frame"&&requestAnimationFrame(()=>p())}return mS(n,x),d.watch(()=>Ti(n),v=>!v&&x()),hS(n,x,{attributeFilter:["style","class"]}),s&&Is("scroll",x,{capture:!0,passive:!0}),i&&Is("resize",x,{passive:!0}),cS(()=>{r&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function pS(n,t){const{top:e,left:i}=gS(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const yS=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=e).sort((l,c)=>l-c),r=[];if(e-t<n-2)return[];const a=(e-t)/n;let o=0;for(let l=0;l<n;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<s.length&&s[o]>=c&&s[o]<=u;)h++,o++;r.push([Math.ceil(c),h])}return r},Tf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Ls=d.ref({}),bS=n=>(Ls.value[n]||(Ls.value[n]=Tf()),Ls.value[n]),_S=(n,t)=>{const e=Ls.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete Ls.value[t])};function xS({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=e!==void 0&&n!==void 0?bS(e):Tf(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((S,{timestamps:O})=>[...S,...O],[])),m=d.computed(()=>i||f.value.reduce((S,O)=>S===0?O:Math.min(S,O),0)),g=d.computed(()=>s||f.value.reduce((S,O)=>Math.max(S,O),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const p=d.computed(()=>Object.values(u.minStamps).reduce((S,O)=>S===0?O:Math.min(S,O),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((S,O)=>Math.max(S,O),0)),v=d.computed(()=>{const S=Object.values(u.renderPoints);return S.length===0?24:S.reduce((O,A)=>Math.max(O,A),2)}),M=d.computed(()=>{const S=x.value-p.value;return Math.ceil(S/v.value)}),D=d.computed(()=>t.length>1),k=d.computed(()=>t.map(({timestamps:S,color:O,label:A})=>({data:yS({bucketCount:v.value,minStamp:p.value,maxStamp:x.value,timestamps:S}).map(([X,G])=>({x:X,y:G})),label:A,...(l==="sparkline_bar"||D.value)&&O&&{backgroundColor:O},...l!=="sparkline_bar"&&O&&{borderColor:O},...D.value&&l!=="sparkline_bar"&&{fill:!0}}))),E=d.computed(()=>{var A,L;const S=((L=(A=k.value[0])==null?void 0:A.data)==null?void 0:L.length)??0,O=[];for(let B=0;B<S;B++){let X=0;for(let G=0;G<k.value.length;G++)X+=k.value[G].data[B].y;O.push(X)}return O}),R=d.computed(()=>{const S=E.value.reduce((O,A)=>Math.max(O,A),0);return Math.max(S,a??0)}),C=d.computed(()=>{const S=k.value.reduce((L,{data:B})=>[...L,...B.map(({y:X})=>X)],[]),O=S.length?S[0]:0,A=S.reduce((L,B)=>Math.min(L,B),O);return r===void 0?A:Math.min(A,r)});d.watchEffect(()=>{u.maxCounts[h]=R.value,u.minCounts[h]=C.value});const b=d.computed(()=>{const S=Object.values(u.minCounts),O=S.length?S[0]:0;return S.reduce((A,L)=>Math.min(A,L),O)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((S,O)=>Math.max(S,O),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&_S(n,e)}),{syncedMinStamp:p,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:k,syncedGroupSizeMs:M,syncedMinCount:b,syncedMaxCount:_}}const pt={useBarChartOptions:HM,useChartJSCommon:YM,useChartLegendValues:jM,useChartSelectedRange:$M,useExploreResultToDatasets:GM,useExploreResultToTimeDataset:JM,useDonutChartOptions:UM,useLineChartOptions:qM,useI18n:Vm,useReportChartDataForSynthetics:tS,useTranslatedUnits:eS,useEvaluateFeatureFlag:iS,useTooltipAbsolutePosition:pS,useSparklineSync:xS};var Nt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Nt||{});/*!
|
|
18
|
+
`):n}function p0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function wd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),h=r.length,f=s.length,m=i.length,g=Ut(t.padding);let p=g.height,x=0,v=i.reduce((k,E)=>k+E.before.length+E.lines.length+E.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,h&&(p+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;p+=m*k+(v-m)*l.lineHeight+(v-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const T=function(k){x=Math.max(x,e.measureText(k).width+M)};return e.save(),e.font=c.string,Tt(n.title,T),e.font=l.string,Tt(n.beforeBody.concat(n.afterBody),T),M=t.displayColors?a+2+t.boxPadding:0,Tt(i,k=>{Tt(k.before,T),Tt(k.lines,T),Tt(k.after,T)}),M=0,e.font=u.string,Tt(n.footer,T),e.restore(),x+=g.width,{width:x,height:p}}function y0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function b0(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function _0(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),b0(c,n,t,e)&&(c="center"),c}function vd(n,t,e){const i=e.yAlign||t.yAlign||y0(n,e);return{xAlign:e.xAlign||t.xAlign||_0(n,t,e,i),yAlign:i}}function x0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function w0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Md(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=vn(a);let g=x0(t,o);const p=w0(t,l,c);return l==="center"?o==="left"?g+=c:o==="right"&&(g-=c):o==="left"?g-=Math.max(u,f)+s:o==="right"&&(g+=Math.max(h,m)+s),{x:Qt(g,0,i.width-t.width),y:Qt(p,0,i.height-t.height)}}function Ar(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 Sd(n){return je([],sn(n))}function v0(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function kd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Td={beforeTitle:Ze,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ze,beforeBody:Ze,beforeLabel:Ze,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return rt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ze,afterBody:Ze,beforeFooter:Ze,footer:Ze,afterFooter:Ze};function _e(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Td[t].call(e,i):s}class bo 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 Ka(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=v0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=_e(i,"beforeTitle",this,t),r=_e(i,"title",this,t),a=_e(i,"afterTitle",this,t);let o=[];return o=je(o,sn(s)),o=je(o,sn(r)),o=je(o,sn(a)),o}getBeforeBody(t,e){return Sd(_e(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Tt(t,r=>{const a={before:[],lines:[],after:[]},o=kd(i,r);je(a.before,sn(_e(o,"beforeLabel",this,r))),je(a.lines,_e(o,"label",this,r)),je(a.after,sn(_e(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Sd(_e(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=_e(i,"beforeFooter",this,t),r=_e(i,"footer",this,t),a=_e(i,"afterFooter",this,t);let o=[];return o=je(o,sn(s)),o=je(o,sn(r)),o=je(o,sn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(p0(this.chart,e[l]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),Tt(o,u=>{const h=kd(t.callbacks,u);s.push(_e(h,"labelColor",this,u)),r.push(_e(h,"labelPointStyle",this,u)),a.push(_e(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=fs[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=wd(this,i),c=Object.assign({},o,l),u=vd(this.chart,i,c),h=Md(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=vn(o),{x:f,y:m}=t,{width:g,height:p}=e;let x,v,M,T,k,E;return r==="center"?(k=m+p/2,s==="left"?(x=f,v=x-a,T=k+a,E=k-a):(x=f+g,v=x+a,T=k-a,E=k+a),M=x):(s==="left"?v=f+Math.max(l,u)+a:s==="right"?v=f+g-Math.max(c,h)-a:v=this.caretX,r==="top"?(T=m,k=T-a,x=v-a,M=v+a):(T=m+p,k=T+a,x=v+a,M=v-a),E=T),{x1:x,x2:v,x3:M,y1:T,y2:k,y3:E}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=yi(i.rtl,this.x,this.width);for(t.x=Ar(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=It(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),h=Ar(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Va(t,p,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Va(t,p,x,v)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=vn(a.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,mi(t,{x:p,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),mi(t,{x,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=It(i.bodyFont);let f=h.lineHeight,m=0;const g=yi(i.rtl,this.x,this.width),p=function(b){e.fillText(b,g.x(t.x+m),t.y+f/2),t.y+=f+r},x=g.textAlign(a);let v,M,T,k,E,R,C;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Ar(this,x,i),e.fillStyle=i.bodyColor,Tt(this.beforeBody,p),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,k=0,R=s.length;k<R;++k){for(v=s[k],M=this.labelTextColors[k],e.fillStyle=M,Tt(v.before,p),T=v.lines,o&&T.length&&(this._drawColorBox(e,t,k,g,i),f=Math.max(h.lineHeight,l)),E=0,C=T.length;E<C;++E)p(T[E]),f=h.lineHeight;Tt(v.after,p)}m=0,f=h.lineHeight,Tt(this.afterBody,p),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=yi(i.rtl,this.x,this.width);for(t.x=Ar(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=It(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+h,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-g),e.quadraticCurveTo(o+c,l+u,o+c-g,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+m,l+u),e.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+h),e.quadraticCurveTo(o,l,o+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const a=fs[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=wd(this,t),l=Object.assign({},a,this._size),c=vd(e,t,l),u=Md(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ut(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),au(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ou(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!ir(i,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!ir(a,r)||o;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=fs[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}P(bo,"positioners",fs);var De={id:"tooltip",_element:bo,positioners:fs,afterInit(n,t,e){e&&(n.tooltip=new bo({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:Td},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"]},M0=Object.freeze({__proto__:null,Colors:Nb,Decimation:Hb,Filler:a0,Legend:h0,SubTitle:g0,Title:m0,Tooltip:De});const S0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function k0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return S0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const T0=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function Dd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class _o extends Un{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(rt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:k0(i,t,at(e,t),this._addedLabels),T0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Dd.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(_o,"id","category"),P(_o,"defaults",{ticks:{callback:Dd}});function D0(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,g=u-1,{min:p,max:x}=t,v=!rt(a),M=!rt(o),T=!rt(c),k=(x-p)/(h+1);let E=Ac((x-p)/g/m)*m,R,C,b,_;if(E<1e-14&&!v&&!M)return[{value:p},{value:x}];_=Math.ceil(x/E)-Math.floor(p/E),_>g&&(E=Ac(_*E/g/m)*m),rt(l)||(R=Math.pow(10,l),E=Math.ceil(E*R)/R),s==="ticks"?(C=Math.floor(p/E)*E,b=Math.ceil(x/E)*E):(C=p,b=x),v&&M&&r&&vg((o-a)/r,E/1e3)?(_=Math.round(Math.min((o-a)/E,u)),E=(o-a)/_,C=a,b=o):T?(C=v?a:C,b=M?o:b,_=c-1,E=(b-C)/_):(_=(b-C)/E,qi(_,Math.round(_),E/1e3)?_=Math.round(_):_=Math.ceil(_));const S=Math.max(Ic(E),Ic(C));R=Math.pow(10,rt(l)?S:l),C=Math.round(C*R)/R,b=Math.round(b*R)/R;let O=0;for(v&&(f&&C!==a?(e.push({value:a}),C<a&&O++,qi(Math.round((C+O*E)*R)/R,a,Cd(a,k,n))&&O++):C<a&&O++);O<_;++O){const A=Math.round((C+O*E)*R)/R;if(M&&A>o)break;e.push({value:A})}return M&&f&&b!==o?e.length&&qi(e[e.length-1].value,o,Cd(o,k,n))?e[e.length-1].value=o:e.push({value:o}):(!M||b===o)&&e.push({value:b}),e}function Cd(n,t,{horizontal:e,minRotation:i}){const s=$t(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Rr extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=Ye(s),c=Ye(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=D0(s,r);return t.bounds==="ticks"&&Rc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ki(t,this.chart.options.locale,this.options.ticks.format)}}class xo extends Rr{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=$t(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(xo,"id","linear"),P(xo,"defaults",{ticks:{callback:ur.formatters.numeric}});const ms=n=>Math.floor(xn(n)),qn=(n,t)=>Math.pow(10,ms(n)+t);function Ed(n){return n/Math.pow(10,ms(n))===1}function Od(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function C0(n,t){const e=t-n;let i=ms(e);for(;Od(n,t,i)>10;)i++;for(;Od(n,t,i)<10;)i--;return Math.min(i,ms(n))}function E0(n,{min:t,max:e}){t=Te(n.min,t);const i=[],s=ms(t);let r=C0(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=Te(n.min,Math.round((l+u+h*Math.pow(10,r))*a)/a);for(;f<e;)i.push({value:f,major:Ed(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,a=r>=0?1:a),f=Math.round((l+u+h*Math.pow(10,r))*a)/a;const m=Te(n.max,f);return i.push({value:m,major:Ed(m),significand:h}),i}class wo extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Rr.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===qn(this.min,0)?qn(this.min,-1):qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(qn(i,-1)),a(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&a(qn(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"&&Rc(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":Ki(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(wo,"id","logarithmic"),P(wo,"defaults",{ticks:{callback:ur.formatters.logarithmic,major:{enabled:!0}}});function vo(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return at(t.font&&t.font.size,At.font.size)+e.height}return 0}function O0(n,t,e){return e=St(e)?e:[e],{w:zg(n,t.string,e),h:e.length*t.lineHeight}}function Pd(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 P0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,a=n.options.pointLabels,o=a.centerPointLabels?dt/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),h=It(c.font),f=O0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=se(n.getIndexAngle(l)+o),g=Math.round(or(m)),p=Pd(g,u.x,f.w,0,180),x=Pd(g,u.y,f.h,90,270);A0(e,t,m,p,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=L0(n,i,s)}function A0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function R0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(or(se(l.angle+Pt))),u=B0(l.y,o.h,c),h=N0(c),f=F0(l.x,o.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function I0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(tn({x:e,y:i},t)||tn({x:e,y:r},t)||tn({x:s,y:i},t)||tn({x:s,y:r},t))}function L0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:vo(r)/2,additionalAngle:a?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=R0(n,u,l);i.push(h),o==="auto"&&(h.visible=I0(h,c),h.visible&&(c=h))}return i}function N0(n){return n===0||n===180?"center":n<180?"left":"right"}function F0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function B0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function z0(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!rt(o)){const l=vn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=o;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),mi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}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 a=i.setContext(n.getPointLabelContext(s));z0(e,a,r);const o=It(a.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Ad(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 a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function W0(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Ad(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function Y0(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class gs extends Rr{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(vo(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/vo(this.options))}generateTickLabels(t){Rr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=kt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?P0(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+$t(i))}getDistanceFromCenterForValue(t){if(rt(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(rt(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 Y0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Pt+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(),Ad(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&H0(this,a),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=r.setContext(f);W0(this,m,l,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=Ut(c.backdropPadding);t.fillRect(-a/2-h.left,-r-u.size/2-h.top,a+h.width,u.size+h.height)}Yn(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(gs,"id","radialLinear"),P(gs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ur.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(gs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(gs,"descriptors",{angleLines:{_fallback:"grid"}});const Ir={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}},xe=Object.keys(Ir);function Rd(n,t){return n-t}function Id(n,t){if(rt(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),Rt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(wn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Ld(n,t,e,i){const s=xe.length;for(let r=xe.indexOf(n);r<s-1;++r){const a=Ir[xe[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return xe[r]}return xe[s-1]}function V0(n,t,e,i,s){for(let r=xe.length-1;r>=xe.indexOf(e);r--){const a=xe[r];if(Ir[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return xe[e?xe.indexOf(e):0]}function j0(n){for(let t=xe.indexOf(n)+1,e=xe.length;t<e;++t)if(Ir[xe[t]].common)return xe[t]}function Nd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Fa(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function $0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Fd(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:$0(n,i,s,e)}class ps extends Un{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Tu._date(t.adapters.date);s.init(e),Ui(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:Id(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=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,a=this.max,o=Tg(s,r,a);return this._unit=e.unit||(i.autoSkip?Ld(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):V0(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:j0(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),Fd(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Qt(e,0,a),i=Qt(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||Ld(r.minUnit,e,i,this._getLabelCapacity(e)),o=at(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)Nd(u,f,g);return(f===i||s.bounds==="ticks"||m===1)&&Nd(u,f,g),Object.keys(u).sort(Rd).map(p=>+p)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return kt(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=$t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Fd(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Id(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fc(t.sort(Rd))}}P(ps,"id","time"),P(ps,"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 Lr(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Je(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Je(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class Mo extends ps{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=Lr(e,this.min),this._tableRange=Lr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Lr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Lr(this._table,i*this._tableRange+this._minPos,!0)}}P(Mo,"id","timeseries"),P(Mo,"defaults",ps.defaults);var U0=Object.freeze({__proto__:null,CategoryScale:_o,LinearScale:xo,LogarithmicScale:wo,RadialLinearScale:gs,TimeScale:ps,TimeSeriesScale:Mo});const q0=[ey,Eb,M0,U0],Bd=6048e5,X0=864e5,ys=6e4,_i=36e5,G0=1e3,zd=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&zd in n?n[zd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ut(n,t){return Ft(t||n,n)}function Nr(n,t,e){const i=ut(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 So(n,t,e){const i=ut(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 a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ko(n,t,e){return Ft(n,+ut(n)+t)}function K0(n,t,e){return ko(n,t*_i)}let Z0={};function Xn(){return Z0}function $e(n,t){var o,l,c,u;const e=Xn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ut(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function xi(n,t){return $e(n,{...t,weekStartsOn:1})}function Hd(n,t){const e=ut(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=xi(s),a=Ft(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=xi(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Fr(n){const t=ut(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Gn(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function To(n,t){const e=ut(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Wd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=To(i),a=To(s),o=+r-Fr(r),l=+a-Fr(a);return Math.round((o-l)/X0)}function Q0(n,t){const e=Hd(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),xi(i)}function J0(n,t,e){const i=ut(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ys),i}function t_(n,t,e){return So(n,t*3,e)}function e_(n,t,e){return ko(n,t*1e3)}function n_(n,t,e){return Nr(n,t*7,e)}function i_(n,t,e){return So(n,t*12,e)}function bs(n,t){const e=+ut(n)-+ut(t);return e<0?-1:e>0?1:e}function s_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Do(n){return!(!s_(n)&&typeof n!="number"||isNaN(+ut(n)))}function r_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function a_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Yd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=Vd(i,s),a=Math.abs(Wd(i,s));i.setDate(i.getDate()-r*a);const o=+(Vd(i,s)===-r),l=r*(a-o);return l===0?0:l}function Vd(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 _s(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function o_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/_i;return _s(e==null?void 0:e.roundingMethod)(r)}function Co(n,t){return+ut(n)-+ut(t)}function l_(n,t,e){const i=Co(n,t)/ys;return _s(e==null?void 0:e.roundingMethod)(i)}function jd(n,t){const e=ut(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function $d(n,t){const e=ut(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 c_(n,t){const e=ut(n,t==null?void 0:t.in);return+jd(e,t)==+$d(e,t)}function Ud(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),a=bs(s,r),o=Math.abs(r_(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=bs(s,r)===-a;c_(i)&&o===1&&bs(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function u_(n,t,e){const i=Ud(n,t,e)/3;return _s(e==null?void 0:e.roundingMethod)(i)}function d_(n,t,e){const i=Co(n,t)/1e3;return _s(e==null?void 0:e.roundingMethod)(i)}function h_(n,t,e){const i=Yd(n,t,e)/7;return _s(e==null?void 0:e.roundingMethod)(i)}function f_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=bs(i,s),a=Math.abs(a_(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=bs(i,s)===-r,l=r*(a-+o);return l===0?0:l}function m_(n,t){const e=ut(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 g_(n,t){const e=ut(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function p_(n,t){const e=ut(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 qd(n,t){const e=ut(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function y_(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function b_(n,t){var o,l;const e=Xn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=ut(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function __(n,t){const e=ut(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function x_(n,t){const e=ut(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 w_(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const v_={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"}},M_=(n,t,e)=>{let i;const s=v_[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 Eo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const S_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},k_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},T_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},D_={date:Eo({formats:S_,defaultWidth:"full"}),time:Eo({formats:k_,defaultWidth:"full"}),dateTime:Eo({formats:T_,defaultWidth:"full"})},C_={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)=>C_[n];function xs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const O_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},P_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},A_={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"]},I_={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"}},L_={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"}},N_={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:xs({values:O_,defaultWidth:"wide"}),quarter:xs({values:P_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:xs({values:A_,defaultWidth:"wide"}),day:xs({values:R_,defaultWidth:"wide"}),dayPeriod:xs({values:I_,defaultWidth:"wide",formattingValues:L_,defaultFormattingWidth:"wide"})};function ws(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?B_(o,h=>h.test(a)):F_(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function F_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function B_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function z_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const H_=/^(\d+)(th|st|nd|rd)?/i,W_=/\d+/i,Y_={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},V_={any:[/^b/i,/^(a|c)/i]},j_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$_={any:[/1/i,/2/i,/3/i,/4/i]},U_={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},q_={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},G_={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]},K_={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},Z_={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}},Q_={ordinalNumber:z_({matchPattern:H_,parsePattern:W_,valueCallback:n=>parseInt(n,10)}),era:ws({matchPatterns:Y_,defaultMatchWidth:"wide",parsePatterns:V_,defaultParseWidth:"any"}),quarter:ws({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:$_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ws({matchPatterns:U_,defaultMatchWidth:"wide",parsePatterns:q_,defaultParseWidth:"any"}),day:ws({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:G_,defaultParseWidth:"any"}),dayPeriod:ws({matchPatterns:K_,defaultMatchWidth:"any",parsePatterns:Z_,defaultParseWidth:"any"})},Xd={code:"en-US",formatDistance:M_,formatLong:D_,formatRelative:E_,localize:N_,match:Q_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function J_(n,t){const e=ut(n,t==null?void 0:t.in);return Wd(e,qd(e))+1}function Gd(n,t){const e=ut(n,t==null?void 0:t.in),i=+xi(e)-+Q0(e);return Math.round(i/Bd)+1}function Oo(n,t){var u,h,f,m;const e=ut(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Ft((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=$e(a,t),l=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>=+o?i+1:+e>=+c?i:i-1}function tx(n,t){var o,l,c,u;const e=Xn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Oo(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 Kd(n,t){const e=ut(n,t==null?void 0:t.in),i=+$e(e,t)-+tx(e,t);return Math.round(i/Bd)+1}function Dt(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 Dt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Dt(e+1,2)},d(n,t){return Dt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Dt(n.getHours()%12||12,t.length)},H(n,t){return Dt(n.getHours(),t.length)},m(n,t){return Dt(n.getMinutes(),t.length)},s(n,t){return Dt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Dt(s,t.length)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zd={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=Oo(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Dt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Dt(r,t.length)},R:function(n,t){const e=Hd(n);return Dt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Dt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Dt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Dt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return 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 Dt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Kd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Dt(s,t.length)},I:function(n,t,e){const i=Gd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Dn.d(n,t)},D:function(n,t,e){const i=J_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Dt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Dt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Dt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Dt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const 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=wi.noon:i===0?s=wi.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=wi.evening:i>=12?s=wi.afternoon:i>=4?s=wi.morning:s=wi.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"}):Dt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):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 Jd(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 Jd(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"+Qd(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"+Qd(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Dt(i,t.length)},T:function(n,t,e){return Dt(+n,t.length)}};function Qd(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Dt(r,2)}function Jd(n,t){return n%60===0?(n>0?"-":"+")+Dt(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Dt(Math.trunc(i/60),2),r=Dt(i%60,2);return e+s+t+r}const th=(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"})}},eh=(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"})}},Po={p:eh,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return th(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}}",th(i,t)).replace("{{time}}",eh(s,t))}},ex=/^D+$/,nx=/^Y+$/,ix=["D","DD","YY","YYYY"];function nh(n){return ex.test(n)}function ih(n){return nx.test(n)}function Ao(n,t,e){const i=sx(n,t,e);if(console.warn(i),ix.includes(n))throw new RangeError(i)}function sx(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 rx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ax=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,lx=/''/g,cx=/[a-zA-Z]/;function Br(n,t,e){var u,h,f,m,g,p,x,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??Xd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=(e==null?void 0:e.weekStartsOn)??((p=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ut(n,e==null?void 0:e.in);if(!Do(o))throw new RangeError("Invalid time value");let l=t.match(ax).map(M=>{const T=M[0];if(T==="p"||T==="P"){const k=Po[T];return k(M,s.formatLong)}return M}).join("").match(rx).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const T=M[0];if(T==="'")return{isToken:!1,value:ux(M)};if(Zd[T])return{isToken:!0,value:M};if(T.match(cx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const T=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ih(T)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&nh(T))&&Ao(T,t,String(n));const k=Zd[T[0]];return k(o,T,s.localize,c)}).join("")}function ux(n){const t=n.match(ox);return t?t[1].replace(lx,"'"):n}function sh(){return Object.assign({},Xn())}function dx(n,t){const e=ut(n,t==null?void 0:t.in).getDay();return e===0?7:e}function hx(n,t){const e=fx(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 fx(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const mx=10;class rh{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class gx extends rh{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 px extends rh{constructor(e,i){super();P(this,"priority",mx);P(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,hx(e,this.context))}}class wt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new gx(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class yx extends wt{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const 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}/},Ue={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function qe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*_i+r*ys+a*G0),rest:t.slice(e[0].length)}}function ah(n){return Lt(Yt.anyDigitsSigned,n)}function Bt(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 zr(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 Ro(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 oh(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function lh(n){return n%400===0||n%4===0&&n%100!==0}class bx extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Vt(Bt(4,e),r);case"yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const o=oh(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class _x extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Vt(Bt(4,e),r);case"Yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Oo(e,r);if(s.isTwoDigitYear){const l=oh(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}}class xx extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return zr(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),xi(r)}}class wx extends wt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return zr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class vx extends wt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Bt(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 Mx extends wt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Bt(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 Sx extends wt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return Vt(Lt(Yt.month,e),r);case"MM":return Vt(Bt(2,e),r);case"Mo":return Vt(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 kx extends wt{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return Vt(Lt(Yt.month,e),r);case"LL":return Vt(Bt(2,e),r);case"Lo":return Vt(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 Tx(n,t,e){const i=ut(n,e==null?void 0:e.in),s=Kd(i,e)-t;return i.setDate(i.getDate()-s*7),ut(i,e==null?void 0:e.in)}class Dx extends wt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Yt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return $e(Tx(e,s,r),r)}}function Cx(n,t,e){const i=ut(n,e==null?void 0:e.in),s=Gd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Ex extends wt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Yt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return xi(Cx(e,s))}}const Ox=[31,28,31,30,31,30,31,31,30,31,30,31],Px=[31,29,31,30,31,30,31,31,30,31,30,31];class Ax extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Yt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=lh(s),a=e.getMonth();return r?i>=1&&i<=Px[a]:i>=1&&i<=Ox[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Rx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Yt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear();return lh(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 Io(n,t,e){var h,f,m,g;const i=Xn(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,r=ut(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Nr(r,u,e)}class Ix extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Io(e,s,r),e.setHours(0,0,0,0),e}}class Lx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Vt(Bt(i.length,e),a);case"eo":return Vt(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Io(e,s,r),e.setHours(0,0,0,0),e}}class Nx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Vt(Bt(i.length,e),a);case"co":return Vt(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Io(e,s,r),e.setHours(0,0,0,0),e}}function Fx(n,t,e){const i=ut(n,e==null?void 0:e.in),s=dx(i,e),r=t-s;return Nr(i,r,e)}class Bx extends wt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Bt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Vt(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 Vt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Vt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Vt(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=Fx(e,s),e.setHours(0,0,0,0),e}}class zx extends wt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ro(s),0,0,0),e}}class Hx extends wt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ro(s),0,0,0),e}}class Wx extends wt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ro(s),0,0,0),e}}class Yx extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Yt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(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 Vx extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Yt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class jx extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Yt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(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 $x extends wt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Yt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(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 Ux extends wt{constructor(){super(...arguments);P(this,"priority",60);P(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 Bt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class qx extends wt{constructor(){super(...arguments);P(this,"priority",50);P(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 Bt(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);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Vt(Bt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class Gx extends wt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return qe(Ue.basicOptionalMinutes,e);case"XX":return qe(Ue.basic,e);case"XXXX":return qe(Ue.basicOptionalSeconds,e);case"XXXXX":return qe(Ue.extendedOptionalSeconds,e);case"XXX":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Fr(e)-s)}}class Kx extends wt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return qe(Ue.basicOptionalMinutes,e);case"xx":return qe(Ue.basic,e);case"xxxx":return qe(Ue.basicOptionalSeconds,e);case"xxxxx":return qe(Ue.extendedOptionalSeconds,e);case"xxx":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Fr(e)-s)}}class Zx extends wt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return ah(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class Qx extends wt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return ah(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const Jx={G:new yx,y:new bx,Y:new _x,R:new xx,u:new wx,Q:new vx,q:new Mx,M:new Sx,L:new kx,w:new Dx,I:new Ex,d:new Ax,D:new Rx,E:new Ix,e:new Lx,c:new Nx,i:new Bx,a:new zx,b:new Hx,B:new Wx,h:new Yx,H:new Vx,K:new jx,k:new $x,m:new Ux,s:new qx,S:new Xx,X:new Gx,x:new Kx,t:new Zx,T:new Qx},tw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ew=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nw=/^'([^]*?)'?$/,iw=/''/g,sw=/\S/,rw=/[a-zA-Z]/;function aw(n,t,e,i){var x,v,M,T,k,E,R,C;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=sh(),a=(i==null?void 0:i.locale)??r.locale??Xd,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((T=(M=r.locale)==null?void 0:M.options)==null?void 0:T.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((E=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:E.weekStartsOn)??r.weekStartsOn??((C=(R=r.locale)==null?void 0:R.options)==null?void 0:C.weekStartsOn)??0;if(!t)return n?s():ut(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new px(i==null?void 0:i.in,e)],h=t.match(ew).map(b=>{const _=b[0];if(_ in Po){const S=Po[_];return S(b,a.formatLong)}return b}).join("").match(tw),f=[];for(let b of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&ih(b)&&Ao(b,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&nh(b)&&Ao(b,t,n);const _=b[0],S=Jx[_];if(S){const{incompatibleTokens:O}=S;if(Array.isArray(O)){const L=f.find(B=>O.includes(B.token)||B.token===_);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${b}\` at the same time`)}else if(S.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:_,fullToken:b});const A=S.run(n,b,a.match,c);if(!A)return s();u.push(A.setter),n=A.rest}else{if(_.match(rw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(b==="''"?b="'":_==="'"&&(b=ow(b)),n.indexOf(b)===0)n=n.slice(b.length);else return s()}}if(n.length>0&&sw.test(n))return s();const m=u.map(b=>b.priority).sort((b,_)=>_-b).filter((b,_,S)=>S.indexOf(b)===_).map(b=>u.filter(_=>_.priority===b).sort((_,S)=>S.subPriority-_.subPriority)).map(b=>b[0]);let g=ut(e,i==null?void 0:i.in);if(isNaN(+g))return s();const p={};for(const b of m){if(!b.validate(g,c))return s();const _=b.set(g,p,c);Array.isArray(_)?(g=_[0],Object.assign(p,_[1])):g=_}return g}function ow(n){return n.match(nw)[1].replace(iw,"'")}function lw(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function cw(n,t){const e=ut(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function uw(n,t){const e=ut(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function dw(n){const t=n/_i;return Math.trunc(t)}function ch(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=gw(n);let r;if(s.date){const c=pw(s.date,i);r=yw(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=bw(s.time),isNaN(o)))return e();if(s.timezone){if(l=_w(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=ut(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 ut(a+o+l,t==null?void 0:t.in)}const Hr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},hw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,fw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,mw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gw(n){const t={},e=n.split(Hr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Hr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Hr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Hr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function pw(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 yw(n,t){if(t===null)return new Date(NaN);const e=n.match(hw);if(!e)return new Date(NaN);const i=!!e[4],s=vs(e[1]),r=vs(e[2])-1,a=vs(e[3]),o=vs(e[4]),l=vs(e[5])-1;if(i)return Sw(t,o,l)?xw(t,o,l):new Date(NaN);{const c=new Date(0);return!vw(t,r,a)||!Mw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function vs(n){return n?parseInt(n):1}function bw(n){const t=n.match(fw);if(!t)return NaN;const e=Lo(t[1]),i=Lo(t[2]),s=Lo(t[3]);return kw(e,i,s)?e*_i+i*ys+s*1e3:NaN}function Lo(n){return n&&parseFloat(n.replace(",","."))||0}function _w(n){if(n==="Z")return 0;const t=n.match(mw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Tw(i,s)?e*(i*_i+s*ys):NaN}function xw(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 ww=[31,null,31,30,31,30,31,31,30,31,30,31];function uh(n){return n%400===0||n%4===0&&n%100!==0}function vw(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(ww[t]||(uh(n)?29:28))}function Mw(n,t){return t>=1&&t<=(uh(n)?366:365)}function Sw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function kw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Tw(n,t){return t>=0&&t<=59}var Dw=Object.defineProperty,Cw=(n,t,e)=>t in n?Dw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Cw(n,typeof t!="symbol"?t+"":t,e);const Ew=1e3;var tt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(tt||{});const Ow=["in","not_in","selector"],Pw=["empty","not_empty"],Aw=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Rw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ms=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"],hh=Ms(dh),Iw=[...dh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],fh=Ms(Iw),Lw=["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"],mh=Ms(Lw);Ms(["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","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"]),Ms(["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(hh),new Set(fh),new Set(mh);const gh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];gh.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Ow},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:Pw}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...fh,...hh,...mh])]);const Nw={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"}},Fw=(n,t,e)=>{let i;const s=Nw[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 No(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Bw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ww={date:No({formats:Bw,defaultWidth:"full"}),time:No({formats:zw,defaultWidth:"full"}),dateTime:No({formats:Hw,defaultWidth:"full"})},Yw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vw=(n,t,e,i)=>Yw[n];function Ss(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const jw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$w={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Uw={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"]},qw={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"]},Xw={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"}},Gw={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"}},Kw=(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"},Zw={ordinalNumber:Kw,era:Ss({values:jw,defaultWidth:"wide"}),quarter:Ss({values:$w,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:Uw,defaultWidth:"wide"}),day:Ss({values:qw,defaultWidth:"wide"}),dayPeriod:Ss({values:Xw,defaultWidth:"wide",formattingValues:Gw,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Jw(o,h=>h.test(a)):Qw(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function Qw(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Jw(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function tv(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const ev=/^(\d+)(th|st|nd|rd)?/i,nv=/\d+/i,iv={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},sv={any:[/^b/i,/^(a|c)/i]},rv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},av={any:[/1/i,/2/i,/3/i,/4/i]},ov={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},lv={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]},cv={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},uv={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]},dv={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},hv={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}},fv={ordinalNumber:tv({matchPattern:ev,parsePattern:nv,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:sv,defaultParseWidth:"any"}),quarter:ks({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:ov,defaultMatchWidth:"wide",parsePatterns:lv,defaultParseWidth:"any"}),day:ks({matchPatterns:cv,defaultMatchWidth:"wide",parsePatterns:uv,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:dv,defaultMatchWidth:"any",parsePatterns:hv,defaultParseWidth:"any"})},mv={code:"en-US",formatDistance:Fw,formatLong:Ww,formatRelative:Vw,localize:Zw,match:fv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let gv={};function Ts(){return gv}const ph=6048e5,pv=864e5,yv=60,bv=3600,yh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&yh in n?n[yh](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Ae(t||n,n)}function bh(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 _v(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ds(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function xv(n,t,e){const[i,s]=_v(void 0,n,t),r=Ds(i),a=Ds(s),o=+r-bh(r),l=+a-bh(a);return Math.round((o-l)/pv)}function wv(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function vv(n,t){const e=de(n,void 0);return xv(e,wv(e))+1}function rn(n,t){var e,i,s,r;const a=Ts(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=de(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Wr(n,t){return rn(n,{...t,weekStartsOn:1})}function _h(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Wr(s),a=Ae(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Wr(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Mv(n,t){const e=_h(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Wr(i)}function Sv(n,t){const e=de(n,void 0),i=+Wr(e)-+Mv(e);return Math.round(i/ph)+1}function xh(n,t){var e,i,s,r;const a=de(n,t==null?void 0:t.in),o=a.getFullYear(),l=Ts(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const h=rn(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=rn(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function kv(n,t){var e,i,s,r;const a=Ts(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=xh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),rn(c,t)}function Tv(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+kv(e,t);return Math.round(i/ph)+1}function Ct(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return 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"},wh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Cn.y(n,t)},Y:function(n,t,e,i){const s=xh(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Ct(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=_h(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 Cn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return 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=Tv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=Sv(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"}):Cn.d(n,t)},D:function(n,t,e){const i=vv(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 Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):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"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Mh(i);case"XXXX":case"XX":return Zn(i);case"XXXXX":case"XXX":default:return Zn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Mh(i);case"xxxx":case"xx":return Zn(i);case"xxxxx":case"xxx":default:return Zn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+vh(i,":");case"OOOO":default:return"GMT"+Zn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+vh(i,":");case"zzzz":default:return"GMT"+Zn(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 vh(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 Mh(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Zn(n,t)}function Zn(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 Sh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Dv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Sh(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}}",Sh(i,t)).replace("{{time}}",kh(s,t))},Cv={p:kh,P:Dv},Ev=/^D+$/,Ov=/^Y+$/,Pv=["D","DD","YY","YYYY"];function Av(n){return Ev.test(n)}function Rv(n){return Ov.test(n)}function Iv(n,t,e){const i=Lv(n,t,e);if(console.warn(i),Pv.includes(n))throw new RangeError(i)}function Lv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Nv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Fv(n){return!(!Nv(n)&&typeof n!="number"||isNaN(+de(n)))}const Bv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hv=/^'([^]*?)'?$/,Wv=/''/g,Yv=/[a-zA-Z]/;function Vv(n,t,e){var i,s,r,a,o,l,c,u;const h=Ts(),f=(e==null?void 0:e.locale)??h.locale??mv,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(r=h.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,g=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,p=de(n,e==null?void 0:e.in);if(!Fv(p))throw new RangeError("Invalid time value");let x=t.match(zv).map(M=>{const T=M[0];if(T==="p"||T==="P"){const k=Cv[T];return k(M,f.formatLong)}return M}).join("").match(Bv).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const T=M[0];if(T==="'")return{isToken:!1,value:jv(M)};if(wh[T])return{isToken:!0,value:M};if(T.match(Yv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(x=f.localize.preprocessor(p,x));const v={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(M=>{if(!M.isToken)return M.value;const T=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Rv(T)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Av(T))&&Iv(T,t,String(n));const k=wh[T[0]];return k(p,T,f.localize,v)}).join("")}function jv(n){const t=n.match(Hv);return t?t[1].replace(Wv,"'"):n}function Fo(n,t,e){const i=de(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function $v(n,t,e){const i=de(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function Mi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function Uv(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function qv(){return Object.assign({},Ts())}function Th(n){return Math.trunc(n*bv)}function Xv(n){const t=n/yv;return Math.trunc(t)}function Dh(n,t,e){return $v(n,-1)}function Ch(n,t,e){const i=qv(),s=Zv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Gv(s,t):Kv(s,t)}function Gv(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 Kv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Zv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Qv(n,t){const e=i1(t);return"formatToParts"in e?t1(e,n):e1(e,n)}const Jv={year:0,month:1,day:2,hour:3,minute:4,second:5};function t1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Jv[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 e1(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 Bo={},Eh=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")),n1=Eh==="06/25/2014, 00:00:00"||Eh==="06/25/2014 00:00:00";function i1(n){return Bo[n]||(Bo[n]=n1?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"})),Bo[n]}function zo(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Oh=36e5,s1=6e4,Ho={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Cs(n,t,e){if(!n)return 0;let i=Ho.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ho.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ph(s)?-(s*Oh):NaN;if(i=Ho.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Ph(s,a)?(r=Math.abs(s)*Oh+a*s1,i[1]==="+"?-r:r):NaN}if(o1(n)){t=new Date(t||Date.now());const a=e?t:r1(t),o=Wo(a,n);return-(e?o:a1(t,o,n))}return NaN}function r1(n){return zo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Wo(n,t){const e=Qv(n,t),i=zo(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 a1(n,t,e){let i=n.getTime()-t;const s=Wo(new Date(i),e);if(t===s)return t;i-=s-t;const r=Wo(new Date(i),e);return s===r?s:Math.max(s,r)}function Ph(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Ah={};function o1(n){if(Ah[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Ah[n]=!0,!0}catch{return!1}}const l1=60*1e3,c1={X:function(n,t,e){const i=Yo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Rh(i);case"XXXX":case"XX":return Si(i);case"XXXXX":case"XXX":default:return Si(i,":")}},x:function(n,t,e){const i=Yo(e.timeZone,n);switch(t){case"x":return Rh(i);case"xxxx":case"xx":return Si(i);case"xxxxx":case"xxx":default:return Si(i,":")}},O:function(n,t,e){const i=Yo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+u1(i,":");case"OOOO":default:return"GMT"+Si(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ch("short",n,e);case"zzzz":default:return Ch("long",n,e)}}};function Yo(n,t){const e=n?Cs(n,t,!0)/l1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Yr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Si(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Yr(Math.floor(i/60),2),r=Yr(Math.floor(i%60),2);return e+s+t+r}function Rh(n,t){return n%60===0?(n>0?"-":"+")+Yr(Math.abs(n)/60,2):Si(n,t)}function u1(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+Yr(r,2)}function Ih(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 Lh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Vo=36e5,Nh=6e4,d1=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:Lh};function Vr(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?d1: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=h1(n),{year:s,restDateString:r}=f1(i.date,e),a=m1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=g1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Cs(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Ih(new Date(o+l)),c=Ih(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function h1(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 f1(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 m1(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,zh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return b1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return zh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Hh(s)?Fh(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Hh(s,a)?Fh(t,s,a):new Date(NaN)}return null}function g1(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),jo(t)?t%24*Vo:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),jo(t,e)?t%24*Vo+e*Nh: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 jo(t,e,s)?t%24*Vo+e*Nh+s*1e3:NaN}return null}function Fh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const p1=[31,28,31,30,31,30,31,31,30,31,30,31],y1=[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 zh(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>y1[t]||!i&&e>p1[t])return!1}return!0}function b1(n,t){if(t<1)return!1;const e=Bh(n);return!(e&&t>366||!e&&t>365)}function Hh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function jo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const _1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function x1(n,t,e={}){t=String(t);const i=t.match(_1);if(i){const s=Vr(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+c1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Vv(n,t,e)}function Wh(n,t,e){n=Vr(n,e);const i=Cs(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 w1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},x1(Wh(n,t,{timeZone:i.timeZone}),e,i)}function v1(n,t,e){if(typeof n=="string"&&!n.match(Lh))return Vr(n,{...e,timeZone:t});n=Vr(n,e);const i=zo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Cs(t,new Date(i));return new Date(i+s)}function M1(n,t){return-Cs(n,t)}function $o(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 w1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const S1={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 Uo(n){return n&&Rw.find(t=>n<=S1[t])||null}var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function k1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $r={exports:{}};$r.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",p="[object Promise]",x="[object RegExp]",v="[object Set]",M="[object String]",T="[object Symbol]",k="[object WeakMap]",E="[object ArrayBuffer]",R="[object DataView]",C="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",L="[object Uint8ClampedArray]",B="[object Uint16Array]",X="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,j=/\w*$/,lt=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,Q={};Q[r]=Q[a]=Q[E]=Q[R]=Q[o]=Q[l]=Q[C]=Q[b]=Q[_]=Q[S]=Q[O]=Q[f]=Q[m]=Q[g]=Q[x]=Q[v]=Q[M]=Q[T]=Q[A]=Q[L]=Q[B]=Q[X]=!0,Q[c]=Q[u]=Q[k]=!1;var H=typeof jr=="object"&&jr&&jr.Object===Object&&jr,U=typeof self=="object"&&self&&self.Object===Object&&self,Y=H||U||Function("return this")(),xt=t&&!t.nodeType&&t,yt=xt&&!0&&n&&!n.nodeType&&n,vt=yt&&yt.exports===xt;function mt(w,I){return w.set(I[0],I[1]),w}function gt(w,I){return w.add(I),w}function z(w,I){for(var F=-1,K=w?w.length:0;++F<K&&I(w[F],F,w)!==!1;);return w}function $(w,I){for(var F=-1,K=I.length,jt=w.length;++F<K;)w[jt+F]=I[F];return w}function V(w,I,F,K){for(var jt=-1,Kt=w?w.length:0;++jt<Kt;)F=I(F,w[jt],jt,w);return F}function J(w,I){for(var F=-1,K=Array(w);++F<w;)K[F]=I(F);return K}function et(w,I){return w==null?void 0:w[I]}function nt(w){var I=!1;if(w!=null&&typeof w.toString!="function")try{I=!!(w+"")}catch{}return I}function st(w){var I=-1,F=Array(w.size);return w.forEach(function(K,jt){F[++I]=[jt,K]}),F}function it(w,I){return function(F){return w(I(F))}}function _t(w){var I=-1,F=Array(w.size);return w.forEach(function(K){F[++I]=K}),F}var ct=Array.prototype,Et=Function.prototype,te=Object.prototype,le=Y["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Re=Et.toString,Mt=te.hasOwnProperty,Xt=te.toString,zt=RegExp("^"+Re.call(Mt).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?Y.Buffer:void 0,ie=Y.Symbol,Xe=Y.Uint8Array,si=it(Object.getPrototypeOf,Object),Be=Object.create,Ht=te.propertyIsEnumerable,ve=ct.splice,ri=Object.getOwnPropertySymbols,fa=Gt?Gt.isBuffer:void 0,ma=it(Object.keys,Object),Ys=Nn(Y,"DataView"),ai=Nn(Y,"Map"),Vs=Nn(Y,"Promise"),oi=Nn(Y,"Set"),cn=Nn(Y,"WeakMap"),un=Nn(Object,"create"),js=ce(Ys),$s=ce(ai),li=ce(Vs),Bl=ce(oi),zl=ce(cn),ga=ie?ie.prototype:void 0,pa=ga?ga.valueOf:void 0;function dn(w){var I=-1,F=w?w.length:0;for(this.clear();++I<F;){var K=w[I];this.set(K[0],K[1])}}function Ri(){this.__data__=un?un(null):{}}function Us(w){return this.has(w)&&delete this.__data__[w]}function ya(w){var I=this.__data__;if(un){var F=I[w];return F===i?void 0:F}return Mt.call(I,w)?I[w]:void 0}function hn(w){var I=this.__data__;return un?I[w]!==void 0:Mt.call(I,w)}function Hl(w,I){var F=this.__data__;return F[w]=un&&I===void 0?i:I,this}dn.prototype.clear=Ri,dn.prototype.delete=Us,dn.prototype.get=ya,dn.prototype.has=hn,dn.prototype.set=Hl;function ze(w){var I=-1,F=w?w.length:0;for(this.clear();++I<F;){var K=w[I];this.set(K[0],K[1])}}function Wl(){this.__data__=[]}function Yl(w){var I=this.__data__,F=Li(I,w);if(F<0)return!1;var K=I.length-1;return F==K?I.pop():ve.call(I,F,1),!0}function Vl(w){var I=this.__data__,F=Li(I,w);return F<0?void 0:I[F][1]}function He(w){return Li(this.__data__,w)>-1}function jl(w,I){var F=this.__data__,K=Li(F,w);return K<0?F.push([w,I]):F[K][1]=I,this}ze.prototype.clear=Wl,ze.prototype.delete=Yl,ze.prototype.get=Vl,ze.prototype.has=He,ze.prototype.set=jl;function In(w){var I=-1,F=w?w.length:0;for(this.clear();++I<F;){var K=w[I];this.set(K[0],K[1])}}function $l(){this.__data__={hash:new dn,map:new(ai||ze),string:new dn}}function Ul(w){return Bi(this,w).delete(w)}function ql(w){return Bi(this,w).get(w)}function We(w){return Bi(this,w).has(w)}function Xl(w,I){return Bi(this,w).set(w,I),this}In.prototype.clear=$l,In.prototype.delete=Ul,In.prototype.get=ql,In.prototype.has=We,In.prototype.set=Xl;function Ln(w){this.__data__=new ze(w)}function Gl(){this.__data__=new ze}function Kl(w){return this.__data__.delete(w)}function Zl(w){return this.__data__.get(w)}function Ii(w){return this.__data__.has(w)}function Ql(w,I){var F=this.__data__;if(F instanceof ze){var K=F.__data__;if(!ai||K.length<e-1)return K.push([w,I]),this;F=this.__data__=new In(K)}return F.set(w,I),this}Ln.prototype.clear=Gl,Ln.prototype.delete=Kl,Ln.prototype.get=Zl,Ln.prototype.has=Ii,Ln.prototype.set=Ql;function Jl(w,I){var F=Ks(w)||Hi(w)?J(w.length,String):[],K=F.length,jt=!!K;for(var Kt in w)Mt.call(w,Kt)&&!(jt&&(Kt=="length"||pc(Kt,K)))&&F.push(Kt);return F}function Ie(w,I,F){var K=w[I];(!(Mt.call(w,I)&&Gs(K,F))||F===void 0&&!(I in w))&&(w[I]=F)}function Li(w,I){for(var F=w.length;F--;)if(Gs(w[F][0],I))return F;return-1}function tc(w,I){return w&&ba(I,ci(I),w)}function qs(w,I,F,K,jt,Kt,Me){var ee;if(K&&(ee=Kt?K(w,jt,Kt,Me):K(w)),ee!==void 0)return ee;if(!mn(w))return w;var ka=Ks(w);if(ka){if(ee=mc(w),!I)return dc(w,ee)}else{var Fn=Ge(w),Ta=Fn==u||Fn==h;if(va(w))return rc(w,I);if(Fn==g||Fn==r||Ta&&!Kt){if(nt(w))return Kt?w:{};if(ee=xa(Ta?{}:w),!I)return hc(w,tc(ee,w))}else{if(!Q[Fn])return Kt?w:{};ee=gc(w,Fn,qs,I)}}Me||(Me=new Ln);var Da=Me.get(w);if(Da)return Da;if(Me.set(w,ee),!ka)var ui=F?fc(w):ci(w);return z(ui||w,function(Qs,Wi){ui&&(Wi=Qs,Qs=w[Wi]),Ie(ee,Wi,qs(Qs,I,F,K,Wi,w,Me))}),ee}function ec(w){return mn(w)?Be(w):{}}function nc(w,I,F){var K=I(w);return Ks(w)?K:$(K,F(w))}function ic(w){return Xt.call(w)}function Ni(w){if(!mn(w)||yc(w))return!1;var I=Zs(w)||nt(w)?zt:lt;return I.test(ce(w))}function sc(w){if(!fn(w))return ma(w);var I=[];for(var F in Object(w))Mt.call(w,F)&&F!="constructor"&&I.push(F);return I}function rc(w,I){if(I)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function Fi(w){var I=new w.constructor(w.byteLength);return new Xe(I).set(new Xe(w)),I}function ac(w,I){var F=I?Fi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function oc(w,I,F){var K=I?F(st(w),!0):st(w);return V(K,mt,new w.constructor)}function Xs(w){var I=new w.constructor(w.source,j.exec(w));return I.lastIndex=w.lastIndex,I}function lc(w,I,F){var K=I?F(_t(w),!0):_t(w);return V(K,gt,new w.constructor)}function cc(w){return pa?Object(pa.call(w)):{}}function uc(w,I){var F=I?Fi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function dc(w,I){var F=-1,K=w.length;for(I||(I=Array(K));++F<K;)I[F]=w[F];return I}function ba(w,I,F,K){F||(F={});for(var jt=-1,Kt=I.length;++jt<Kt;){var Me=I[jt],ee=void 0;Ie(F,Me,ee===void 0?w[Me]:ee)}return F}function hc(w,I){return ba(w,_a(w),I)}function fc(w){return nc(w,ci,_a)}function Bi(w,I){var F=w.__data__;return zi(I)?F[typeof I=="string"?"string":"hash"]:F.map}function Nn(w,I){var F=et(w,I);return Ni(F)?F:void 0}var _a=ri?it(ri,Object):Ma,Ge=ic;(Ys&&Ge(new Ys(new ArrayBuffer(1)))!=R||ai&&Ge(new ai)!=f||Vs&&Ge(Vs.resolve())!=p||oi&&Ge(new oi)!=v||cn&&Ge(new cn)!=k)&&(Ge=function(w){var I=Xt.call(w),F=I==g?w.constructor:void 0,K=F?ce(F):void 0;if(K)switch(K){case js:return R;case $s:return f;case li:return p;case Bl:return v;case zl:return k}return I});function mc(w){var I=w.length,F=w.constructor(I);return I&&typeof w[0]=="string"&&Mt.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function xa(w){return typeof w.constructor=="function"&&!fn(w)?ec(si(w)):{}}function gc(w,I,F,K){var jt=w.constructor;switch(I){case E:return Fi(w);case o:case l:return new jt(+w);case R:return ac(w,K);case C:case b:case _:case S:case O:case A:case L:case B:case X:return uc(w,K);case f:return oc(w,K,F);case m:case M:return new jt(w);case x:return Xs(w);case v:return lc(w,K,F);case T:return cc(w)}}function pc(w,I){return I=I??s,!!I&&(typeof w=="number"||q.test(w))&&w>-1&&w%1==0&&w<I}function zi(w){var I=typeof w;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?w!=="__proto__":w===null}function yc(w){return!!qt&&qt in w}function fn(w){var I=w&&w.constructor,F=typeof I=="function"&&I.prototype||te;return w===F}function ce(w){if(w!=null){try{return Re.call(w)}catch{}try{return w+""}catch{}}return""}function bc(w){return qs(w,!0,!0)}function Gs(w,I){return w===I||w!==w&&I!==I}function Hi(w){return _c(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==r)}var Ks=Array.isArray;function wa(w){return w!=null&&xc(w.length)&&!Zs(w)}function _c(w){return gn(w)&&wa(w)}var va=fa||Sa;function Zs(w){var I=mn(w)?Xt.call(w):"";return I==u||I==h}function xc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function mn(w){var I=typeof w;return!!w&&(I=="object"||I=="function")}function gn(w){return!!w&&typeof w=="object"}function ci(w){return wa(w)?Jl(w):sc(w)}function Ma(){return[]}function Sa(){return!1}n.exports=bc}($r,$r.exports),$r.exports;const an=(n,t)=>new Date(n.getTime()-M1(t,n));class oe{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(Aw.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const e=v1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Wh(e,t)}}class T1 extends oe{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class D1 extends oe{rawStart(t){let e=Mi(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class C1 extends oe{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*366}}class E1 extends oe{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=an(i,t)),i}}class O1 extends oe{rawEnd(t){let e=Mi(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}rawStart(t){let e=Mi(Dh(this.tzAdjustedDate(t)));return t&&(e=an(e,t)),e}}class P1 extends oe{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=an(e,t)),e}}tt.FIFTEEN_MIN,new oe({key:tt.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"]}),tt.ONE_HOUR,new oe({key:tt.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"]}),tt.SIX_HOUR,new oe({key:tt.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"]}),tt.TWELVE_HOUR,new oe({key:tt.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"]}),tt.ONE_DAY,new oe({key:tt.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"]}),tt.SEVEN_DAY,new oe({key:tt.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"]}),tt.THIRTY_DAY,new oe({key:tt.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"]}),tt.NINETY_DAY,new oe({key:tt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_HUNDRED_EIGHTY_DAY,new oe({key:tt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_YEAR,new oe({key:tt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.CURRENT_WEEK,new T1({key:tt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Ds(Fo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.CURRENT_MONTH,new D1({key:tt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Mi(new Date);return(Ds(Fo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_YEAR,new C1({key:tt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Ds(Fo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_WEEK,new E1({key:tt.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"]}),tt.PREVIOUS_MONTH,new O1({key:tt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Mi(new Date),e=Mi(Dh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Yh(t,e)),60*60*24*Uv(new Date().setMonth(new Date().getMonth()-1))+Th(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_YEAR,new P1({key:tt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Yh(n,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Th(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Yh(n,t){return Xv(n.getTimezoneOffset()-t.getTimezoneOffset())}tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.THIRTY_DAY,tt.NINETY_DAY,tt.ONE_HUNDRED_EIGHTY_DAY,tt.ONE_YEAR,tt.CURRENT_WEEK,tt.CURRENT_MONTH,tt.CURRENT_YEAR,tt.PREVIOUS_WEEK,tt.PREVIOUS_MONTH,tt.PREVIOUS_YEAR;const A1=new Map(gh.map(n=>[n.code,{code:n.code,name:n.name}])),qo=n=>{var t;return((t=A1.get(n))==null?void 0:t.name)||n};var Vh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(Vh);var R1=Vh.exports;const Xo=k1(R1);var jh;const Ur=new Intl.NumberFormat(((jh=document==null?void 0:document.documentElement)==null?void 0:jh.lang)||"en-US");function Es({i18n:n}){const t=(i,s)=>{if(isNaN(i))return"0 B";const r=s?Math.pow(2,50):1e15,a=s?Math.pow(2,40):1e12,o=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=r?u=n.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=n.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},e=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?n.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:r=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,r);case"usd":return e(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${Xo(i,{capital:!0})} ${c}`:i>=.01?`${Ur.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:e,formatRange:(i,s,r,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(r,s);switch(r){case"bytes":return`${t(i,a)} - ${t(s,a)}`;case"usd":return`${e(i,o)} - ${e(s,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${Xo(i,{capital:!0})} - ${Xo(s,{capital:!0})} ${u}`}const h=i>=.01?`${Ur.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${Ur.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const qr=n=>["interactive","zoom-interactive"].includes(n),$h=(n,t,e,i)=>{var l,c;const{tooltip:s}=t;if(s.opacity===0&&!qr(n.interactionMode)){n.showTooltip=!1;return}const{i18n:r}=pt.useI18n(),{formatUnit:a}=Es({i18n:r}),o=n.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(s.body&&!qr(n.interactionMode)){const u=s.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y";n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(s.dataPoints[0].parsed.x,e):As({tickValue:new Date(s.dataPoints[0].parsed.x),granularity:e}),n.tooltipSeries=s.dataPoints.map((f,m)=>{const g=f.parsed[h],p=a(g,n.units,{translateUnit:n.translateUnit}),x=f.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:x,value:p,rawValue:g,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(o),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},Uh=(n,t)=>{var a,o;const{tooltip:e}=t,{i18n:i}=pt.useI18n(),{formatUnit:s}=Es({i18n:i});if(e.opacity===0&&!qr(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(e.body&&!qr(n.interactionMode)){const l=e.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[c],g=s(m,n.units,{translateUnit:n.translateUnit});let p;return u?p=h.dataset.labels[h.dataIndex]:p=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:p,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},I1=n=>n&&n.datasets&&n.datasets.length,L1=n=>I1(n)&&n.datasets.some(t=>t.data.length),N1=n=>n.datasets.some(t=>t.data[0]&&Do(t.data[0].x)),F1=n=>!!L1(n)&&n.datasets.some(t=>t.data.length==1),B1=n=>N1(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Go=(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)},z1=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ko(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const qh=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},H1=2,Xh=10,Gh=12,Xr=10,Kh="#6c7489",W1="#d60027",Zo="#6c7489",Y1="#995c00",V1="#ffc400",Qo="16px",j1="20px",$1="'Inter', Roboto, Helvetica, sans-serif",Zh="24px",U1="40px",q1="48px",Qh={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Gr=(n,t)=>(t||on)[n%on.length],Jh=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},tf="#6f7787",ef={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},X1=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=ef[t])==null?void 0:e.background)||"#fafafa"},G1={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},K1={"4XX":"#FFBA81","5XX":"#FF8484"},Z1={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},Q1="#dad4c7",nf="#afb7c5",J1=n=>{const t=Object.entries(Qh).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Qh.standard},Jo=(n,t,e,i)=>{let s;return e?s=nf:Array.isArray(i)?s=Gr(n,i):s=i[t],s||Gr(n)},Kr=n=>{switch(n){case"error":return W1;case"warning":return V1;case"neutral":return Kh;default:return Kh}},tM={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},eM=2,nM=0,tl=new Map,el=(n,t)=>{const{i18n:e}=pt.useI18n(),{formatBytes:i}=Es({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):Ur.format(n)},sf=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},iM=()=>{const n="label_height";if(!tl.has(n)){const t=It({});tl.set(n,t.lineHeight)}return tl.get(n)},sM=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),rf=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),af=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,nl="#e0e4ea",rM={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},Os=(n,t)=>{let e=1;const i=rM[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},of=new Map([[100,Os("100",[100,101,102,103])],[200,Os("200",[200,201,202,203,204,205,206,207,208,226])],[300,Os("300",[300,301,302,303,304,305,307,308])],[400,Os("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,Os("500",[500,501,502,503,504,505,506,507,508,510,511])]]),il=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=of.get(e);return i===void 0?nl:i.get(t)??i.get(-1)??nl},aM=n=>{const t=il(n);return{solid:t,light:t}},Zr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=il(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function lf(n,t,e){const i=sh(),s=cM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?oM(s,t):lM(s,t)}function oM(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function lM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function cM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function uM(n,t){const e=gM(t);return"formatToParts"in e?hM(e,n):fM(e,n)}const dM={year:0,month:1,day:2,hour:3,minute:4,second:5};function hM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=dM[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function fM(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const sl={},cf=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),mM=cf==="06/25/2014, 00:00:00"||cf==="06/25/2014 00:00:00";function gM(n){return sl[n]||(sl[n]=mM?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),sl[n]}function uf(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const df=36e5,pM=6e4,rl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function al(n,t,e){if(!n)return 0;let i=rl.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=rl.timezoneHH.exec(n),i)return s=parseInt(i[1],10),hf(s)?-(s*df):NaN;if(i=rl.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return hf(s,a)?(r=Math.abs(s)*df+a*pM,i[1]==="+"?-r:r):NaN}if(_M(n)){t=new Date(t||Date.now());const a=e?t:yM(t),o=ol(a,n);return-(e?o:bM(t,o,n))}return NaN}function yM(n){return uf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function ol(n,t){const e=uM(n,t),i=uf(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function bM(n,t,e){let s=n.getTime()-t;const r=ol(new Date(s),e);if(t===r)return t;s-=r-t;const a=ol(new Date(s),e);return r===a?r:Math.max(r,a)}function hf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const ff={};function _M(n){if(ff[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),ff[n]=!0,!0}catch{return!1}}const xM=60*1e3,wM={X:function(n,t,e){const i=ll(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return mf(i);case"XXXX":case"XX":return ki(i);case"XXXXX":case"XXX":default:return ki(i,":")}},x:function(n,t,e){const i=ll(e.timeZone,n);switch(t){case"x":return mf(i);case"xxxx":case"xx":return ki(i);case"xxxxx":case"xxx":default:return ki(i,":")}},O:function(n,t,e){const i=ll(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+vM(i,":");case"OOOO":default:return"GMT"+ki(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return lf("short",n,e);case"zzzz":default:return lf("long",n,e)}}};function ll(n,t){const e=n?al(n,t,!0)/xM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Qr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function ki(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Qr(Math.floor(i/60),2),r=Qr(Math.floor(i%60),2);return e+s+t+r}function mf(n,t){return n%60===0?(n>0?"-":"+")+Qr(Math.abs(n)/60,2):ki(n,t)}function vM(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Qr(r,2)}function gf(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const MM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,cl=36e5,pf=6e4,SM=2,fe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:MM};function yf(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?SM: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=kM(n),{year:s,restDateString:r}=TM(i.date,e),a=DM(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=CM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=al(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=gf(new Date(o+l)),c=gf(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function kM(n){const t={};let e=fe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=fe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=fe.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function TM(n,t){if(n){const e=fe.YYY[t],i=fe.YYYYY[t];let s=fe.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=fe.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function DM(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=fe.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,xf(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=fe.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return PM(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=fe.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return xf(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=fe.Www.exec(n),r)return s=parseInt(r[1],10)-1,wf(s)?bf(t,s):new Date(NaN);if(r=fe.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return wf(s,a)?bf(t,s,a):new Date(NaN)}return null}function CM(n){let t,e,i=fe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ul(t)?t%24*cl:NaN;if(i=fe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ul(t,e)?t%24*cl+e*pf:NaN;if(i=fe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ul(t,e,s)?t%24*cl+e*pf+s*1e3:NaN}return null}function bf(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const EM=[31,28,31,30,31,30,31,31,30,31,30,31],OM=[31,29,31,30,31,30,31,31,30,31,30,31];function _f(n){return n%400===0||n%4===0&&n%100!==0}function xf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=_f(n);if(i&&e>OM[t]||!i&&e>EM[t])return!1}return!0}function PM(n,t){if(t<1)return!1;const e=_f(n);return!(e&&t>366||!e&&t>365)}function wf(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ul(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const AM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function dl(n,t,e={}){t=String(t);const i=t.match(AM);if(i){const s=yf(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+wM[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Br(n,t,e)}function RM(n,t,e){n=yf(n,e);const i=al(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 Ps(n,t,e,i){return i={...i,timeZone:t,originalDate:n},dl(RM(n,t,{timeZone:i.timeZone}),e,i)}const IM=(n,t)=>`${Ps(n,t,"yyyy")} W${Ps(n,t,"II")}`,hl="yyyy-MM-dd h:mm:ss a",fl="h:mm:ss a",Qn="yyyy-MM-dd h:mm a",Ti="h:mm a",LM="yyyy-MM-dd",ml="MMM dd, yyyy h:mm:ss a",En="MMM dd, yyyy h:mm a",NM={secondly:n=>n?hl:fl,tenSecondly:n=>n?hl:fl,thirtySecondly:n=>n?hl:fl,minutely:n=>n?Qn:Ti,fiveMinutely:n=>n?Qn:Ti,tenMinutely:n=>n?Qn:Ti,thirtyMinutely:n=>n?Qn:Ti,hourly:n=>n?Qn:Ti,twoHourly:n=>n?Qn:Ti,twelveHourly:()=>Qn,daily:()=>LM},FM={secondly:()=>ml,tenSecondly:()=>ml,thirtySecondly:()=>ml,minutely:()=>En,fiveMinutely:()=>En,tenMinutely:()=>En,thirtyMinutely:()=>En,hourly:()=>En,twoHourly:()=>En,twelveHourly:()=>En,daily:()=>En};function vf({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:a}){const o=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return IM(n,o);if(s&&s[t]){const l=s[t](i);return Ps(n,o,l)}if(r&&r[t]){const l=r[t]();return Ps(n,o,l)}return Ps(n,o,a)}const BM=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>vf({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:NM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),As=({tickValue:n,granularity:t,timezone:e})=>vf({tickValue:n,granularity:t,timezone:e,tooltipMap:FM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),zM=n=>{var e,i,s,r,a;const{i18n:t}=pt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(n==null?void 0:n.message)}};function HM(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};De.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=Go(c,h,f),g=c.y,p=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:g-n.tooltipState.offsetY,xAlign:p}},ro.modes.customInteractionMode=function(l,c){const u=Sn(c,l),h=[];return ro.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,g)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const s=n.numLabels.value>25?Xh:Gh,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[c]?"italic":"normal"}},a=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Xr?c.slice(0,Xr)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,g,p;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(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="y"?!rt((l=n.metricAxesTitle)==null?void 0:l.value):!rt((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="x"?!rt((f=n.metricAxesTitle)==null?void 0:f.value):!rt((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(g=n.metricAxesTitle)==null?void 0:g.value:(p=n.dimensionAxesTitle)==null?void 0:p.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{Uh(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return d.getCurrentInstance()&&d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),o}be.register(...q0);const WM=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function YM(n,t,e,i,s){const r=d.shallowRef(null),a=(o,l)=>{if(t.value)return new be(t.value,{type:n,data:o,plugins:i,options:l})};return d.onMounted(()=>{r.value=a(e.value,s.value)}),d.onBeforeUnmount(()=>{rt(r.value)||r.value.destroy()}),d.watch(e,(o,l)=>{if(WM(l,o)&&!rt(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else rt(r.value)||r.value.destroy(),r.value=a(o,s.value)}),d.watch(t,()=>{rt(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),d.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(rt(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mf={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(Mf);var VM=Mf.exports;const Rs=gl(VM);function jM(n,t,e){const{i18n:i}=pt.useI18n(),{formatBytes:s}=Es({i18n:i}),{translateUnit:r}=pt.useTranslatedUnits();return{legendValues:d.computed(()=>n.value.datasets.reduce((o,l)=>{const c=l.total?l.total:l.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(e.value==="bytes")u=s(c);else{const h=r(e.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Rs(c,{capital:!0}),unit:h})||`${Rs(c,{capital:!0})} ${e.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function $M(n){return d.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${$o(e)} - ${$o(i,{includeTZ:!0})}`:""})}function UM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};De.positioners[e]=function(r,a){if(!r.length)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=o.width/2,u=Go(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{Uh(n.tooltipState,r)}}}}));return d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),{options:s}}function qM(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return BM({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!rt((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=d.computed(()=>{var l,c;return{title:{display:!rt((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};De.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,g=u.height/2,p=Go(c,h,m);let x=z1(c,f,g);const v=c.y<g?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(x=0),{x:p,y:x,xAlign:M,yAlign:v}};const a=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return dw(l)>24||u.getDate()!==c.getDate()}),o=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:u=>{$h(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1}}});return d.onUnmounted(()=>{De.positioners[s]&&delete De.positioners[s]}),{options:o}}function XM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=pt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Gr(i.indexOf(u),on),data:a.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Jo(h,u.name,u.id==="empty",o);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function GM(n,t){const{i18n:e}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0,u=c&&o.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?s.flatMap(_=>a.map((S,O)=>{const A=_.event[f],L=c?`${A},${S}`:`${O},${S}`,B=_.event[S];return[L,B]})):s.map(_=>{const S=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,O=_.event[a[0]];return[S,O]})),p=Object.keys(g).reduce((_,S)=>{const[O]=S.split(","),A=g[S];return _[O]?_[O]+=A:_[O]=A,_},{}),x=Object.entries(p).sort(([,_],[,S])=>Number(S)-Number(_)).map(([_])=>_),v=r[f],M=r[m];let T=c&&v&&Object.entries(v).map(([_,S])=>({id:_,name:S.name}))||a.map(_=>({id:_,name:_})),k=c&&M&&Object.entries(M).map(([_,S])=>({id:_,name:S.name}))||a.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(T=T.map(_=>({..._,name:qo(_.id)||_.name}))),c&&m==="country_code"&&(k=k.map(_=>({..._,name:qo(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(T.sort((_,S)=>x.indexOf(_.id)-x.indexOf(S.id)),k.sort((_,S)=>x.indexOf(_.id)-x.indexOf(S.id))),!T||!k)return{labels:[],datasets:[]};const E=XM({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:k,pivotRecords:g,rowLabels:T,colorPalette:n.colorPalette||on}),R=c?T.map(_=>e&&e.te(`chartLabels.${_.name}`)&&e.t(`chartLabels.${_.name}`)||_.name):a.map(_=>e&&e.te(`chartLabels.${_}`)&&e.t(`chartLabels.${_}`)||_),C=T.map(_=>_.id==="empty");return{labels:R,datasets:E,isLabelEmpty:C,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const KM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),ZM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return ch(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},QM=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return KM(o,l,e)};function JM(n,t){const{i18n:e}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],h=r[u];let f=r&&h&&Object.keys(h).map(k=>({id:k,name:h[k].name}))||a.map(k=>({id:k,name:k}));u==="country_code"&&(f=f.map(k=>({...k,name:qo(k.id)||k.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const g=ZM(o),p=QM(o,l,m,g,s),x=new Set,v=s!=null&&s.length?s.reduce((k,E)=>{const R=new Date(E.timestamp).valueOf(),C=E.event;for(const b of a)x.add(b),R in k||(k[R]={}),b in k[R]||(k[R][b]={});for(const b of a)f.forEach(_=>{C[u]===_.id||b===_.id?(k[R][b]||(k[R][b]={}),k[R][b][_.name]=Math.round(Number(C[b])*1e3)/1e3):c.length||(k[R][b]||(k[R][b]={}),k[R][b][_.name]=Math.round(Number(C[_.id])*1e3)/1e3)});return k},{}):{},T=[...a.length===1?a.flatMap(k=>f.map(E=>[k,E.name,E.id==="empty"])):f.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,E,R],C)=>{const b=p.map(A=>A in v&&k in v[A]?{x:A,y:v[A][k][E]||0}:{x:A,y:0});let{colorPalette:_,fill:S}=n;rt(_)&&(_=on);const O=Jo(C,E,R,_);return{rawDimension:E,rawMetric:k,label:e&&e.te(`chartLabels.${E}`)&&e.t(`chartLabels.${E}`)||E,borderColor:O,backgroundColor:O,data:b,total:b.reduce((A,{y:L})=>A+Number(L),0),...tM,fill:S,borderWidth:S?nM:eM,isSegmentEmpty:R}});return u==="status_code"||u==="status_code_grouped"?T.sort((k,E)=>(k.label??"")<(E.label??"")?-1:1):T.sort((k,E)=>Number(k.total)<Number(E.total)?-1:1),{datasets:T}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const tS=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function eS(){const{i18n:n}=pt.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 nS="analytics-query-provider",Sf=2;function iS(){const n=d.inject(nS);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function pl(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const kf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sS=n=>n!=null,rS=Object.prototype.toString,aS=n=>rS.call(n)==="[object Object]";function Jr(n){return Array.isArray(n)?n:[n]}function oS(n){return d.getCurrentInstance()}function lS(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const o=[...n.value];o[i]=s,n.value=o}else{const o={...n.value,[i]:s};Object.setPrototypeOf(o,Object.getPrototypeOf(n.value)),n.value=o}else n.value[i]=s}}));return e}function cS(n,t=!0,e){oS()?d.onMounted(n,e):t?n():d.nextTick(n)}function uS(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const ta=kf?window:void 0;function Di(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Is(...n){const t=[],e=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),s=d.computed(()=>{const o=Jr(d.toValue(n[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),r=uS(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(c=>Di(c)))!=null?l:[ta].filter(c=>c!=null),Jr(d.toValue(s.value?n[1]:n[0])),Jr(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([o,l,c,u])=>{if(e(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=aS(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{r(),e()};return pl(e),a}function dS(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function Tf(n){const t=dS();return d.computed(()=>(t.value,!!n()))}function hS(n,t,e={}){const{window:i=ta,...s}=e;let r;const a=Tf(()=>i&&"MutationObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=Jr(f).map(Di).filter(sS);return new Set(m)}),c=d.watch(()=>l.value,f=>{o(),a.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),o()};return pl(h),{isSupported:a,stop:h,takeRecords:u}}function fS(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=ta,containerElement:m,handle:g=n,buttons:p=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),v=d.ref(),M=C=>i?i.includes(C.pointerType):!0,T=C=>{d.toValue(s)&&C.preventDefault(),d.toValue(r)&&C.stopPropagation()},k=C=>{var b;if(!d.toValue(p).includes(C.button)||d.toValue(t.disabled)||!M(C)||d.toValue(a)&&C.target!==d.toValue(n))return;const _=d.toValue(m),S=(b=_==null?void 0:_.getBoundingClientRect)==null?void 0:b.call(_),O=d.toValue(n).getBoundingClientRect(),A={x:C.clientX-(_?O.left-S.left+_.scrollLeft:O.left),y:C.clientY-(_?O.top-S.top+_.scrollTop:O.top)};(c==null?void 0:c(A,C))!==!1&&(v.value=A,T(C))},E=C=>{if(d.toValue(t.disabled)||!M(C)||!v.value)return;const b=d.toValue(m),_=d.toValue(n).getBoundingClientRect();let{x:S,y:O}=x.value;(h==="x"||h==="both")&&(S=C.clientX-v.value.x,b&&(S=Math.min(Math.max(0,S),b.scrollWidth-_.width))),(h==="y"||h==="both")&&(O=C.clientY-v.value.y,b&&(O=Math.min(Math.max(0,O),b.scrollHeight-_.height))),x.value={x:S,y:O},o==null||o(x.value,C),T(C)},R=C=>{d.toValue(t.disabled)||!M(C)||v.value&&(v.value=void 0,l==null||l(x.value,C),T(C))};if(kf){const C=()=>{var b;return{capture:(b=t.capture)!=null?b:!0,passive:!d.toValue(s)}};Is(g,"pointerdown",k,C),Is(f,"pointermove",E,C),Is(f,"pointerup",R,C)}return{...lS(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function mS(n,t,e={}){const{window:i=ta,...s}=e;let r;const a=Tf(()=>i&&"ResizeObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Di(f)):[Di(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return pl(u),{isSupported:a,stop:u}}function gS(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:a="sync"}=t,o=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function p(){const v=Di(n);if(!v){e&&(o.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const M=v.getBoundingClientRect();o.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,g.value=M.y}function x(){a==="sync"?p():a==="next-frame"&&requestAnimationFrame(()=>p())}return mS(n,x),d.watch(()=>Di(n),v=>!v&&x()),hS(n,x,{attributeFilter:["style","class"]}),s&&Is("scroll",x,{capture:!0,passive:!0}),i&&Is("resize",x,{passive:!0}),cS(()=>{r&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function pS(n,t){const{top:e,left:i}=gS(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const yS=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=e).sort((l,c)=>l-c),r=[];if(e-t<n-2)return[];const a=(e-t)/n;let o=0;for(let l=0;l<n;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<s.length&&s[o]>=c&&s[o]<=u;)h++,o++;r.push([Math.ceil(c),h])}return r},Df=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Ls=d.ref({}),bS=n=>(Ls.value[n]||(Ls.value[n]=Df()),Ls.value[n]),_S=(n,t)=>{const e=Ls.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete Ls.value[t])};function xS({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=e!==void 0&&n!==void 0?bS(e):Df(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((S,{timestamps:O})=>[...S,...O],[])),m=d.computed(()=>i||f.value.reduce((S,O)=>S===0?O:Math.min(S,O),0)),g=d.computed(()=>s||f.value.reduce((S,O)=>Math.max(S,O),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const p=d.computed(()=>Object.values(u.minStamps).reduce((S,O)=>S===0?O:Math.min(S,O),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((S,O)=>Math.max(S,O),0)),v=d.computed(()=>{const S=Object.values(u.renderPoints);return S.length===0?24:S.reduce((O,A)=>Math.max(O,A),2)}),M=d.computed(()=>{const S=x.value-p.value;return Math.ceil(S/v.value)}),T=d.computed(()=>t.length>1),k=d.computed(()=>t.map(({timestamps:S,color:O,label:A})=>({data:yS({bucketCount:v.value,minStamp:p.value,maxStamp:x.value,timestamps:S}).map(([X,G])=>({x:X,y:G})),label:A,...(l==="sparkline_bar"||T.value)&&O&&{backgroundColor:O},...l!=="sparkline_bar"&&O&&{borderColor:O},...T.value&&l!=="sparkline_bar"&&{fill:!0}}))),E=d.computed(()=>{var A,L;const S=((L=(A=k.value[0])==null?void 0:A.data)==null?void 0:L.length)??0,O=[];for(let B=0;B<S;B++){let X=0;for(let G=0;G<k.value.length;G++)X+=k.value[G].data[B].y;O.push(X)}return O}),R=d.computed(()=>{const S=E.value.reduce((O,A)=>Math.max(O,A),0);return Math.max(S,a??0)}),C=d.computed(()=>{const S=k.value.reduce((L,{data:B})=>[...L,...B.map(({y:X})=>X)],[]),O=S.length?S[0]:0,A=S.reduce((L,B)=>Math.min(L,B),O);return r===void 0?A:Math.min(A,r)});d.watchEffect(()=>{u.maxCounts[h]=R.value,u.minCounts[h]=C.value});const b=d.computed(()=>{const S=Object.values(u.minCounts),O=S.length?S[0]:0;return S.reduce((A,L)=>Math.min(A,L),O)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((S,O)=>Math.max(S,O),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&_S(n,e)}),{syncedMinStamp:p,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:k,syncedGroupSizeMs:M,syncedMinCount:b,syncedMaxCount:_}}const pt={useBarChartOptions:HM,useChartJSCommon:YM,useChartLegendValues:jM,useChartSelectedRange:$M,useExploreResultToDatasets:GM,useExploreResultToTimeDataset:JM,useDonutChartOptions:UM,useLineChartOptions:qM,useI18n:Vm,useReportChartDataForSynthetics:tS,useTranslatedUnits:eS,useEvaluateFeatureFlag:iS,useTooltipAbsolutePosition:pS,useSparklineSync:xS};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 Cf={modes:{point(n,t){return ea(n,t,{intersect:!0})},nearest(n,t,e){return MS(n,t,e)},x(n,t,e){return ea(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return ea(n,t,{intersect:e.intersect,axis:"y"})}}};function yl(n,t,e){return(Cf.modes[e.mode]||Cf.modes.nearest)(n,t,e)}function wS(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 vS(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function ea(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):wS(i,t,e.axis))}function MS(n,t,e){let i=Number.POSITIVE_INFINITY;return ea(n,t,e).reduce((s,r)=>{const a=r.getCenterPoint(),o=vS(t,a,e.axis),l=fi(t,o);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Jn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,a=t.y;return{x:r+i*(n.x-r)-s*(n.y-a),y:a+s*(n.x-r)+i*(n.y-a)}}const SS=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,na=(n,t,e)=>Math.min(e,Math.max(t,n)),Ef=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function kS(n,t,e){for(const i of Object.keys(n))n[i]=na(n[i],t,e);return n}function DS(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 Of(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:a,hitTolerance:o}){const l=(a+o)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function Pf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:a}){const o=Jn(n,e,$t(-s));return Of(o,t,i,{borderWidth:r,hitTolerance:a})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function TS(n,t,e,i=!0){const s=e.split(".");let r=0;for(const a of t.split(".")){const o=s[r++];if(parseInt(a,10)<parseInt(o,10))break;if(SS(o,a)){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("%"),Rf=n=>parseFloat(n)/100,If=n=>na(Rf(n),0,1),Ns=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),CS={box:n=>Ns(n.centerX,n.centerY),doughnutLabel:n=>Ns(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ns(n.centerX,n.centerY),line:n=>Ns(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ns(n.centerX,n.centerY)};function bl(n,t){return t==="start"?0:t==="end"?n:Af(t)?If(t)*n:n/2}function On(n,t,e=!0){return typeof t=="number"?t:Af(t)?(e?If(t):Rf(t))*n:n}function ES(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 Lf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},a){const o=ft(a),l=t.width+(o?a.width:0)+e,c=t.height+(o?a.height:0)+e,u=_l(i),h=zf(n.x,l,s,u.x),f=zf(n.y,c,r,u.y);return{x:h,y:f,x2:h+l,y2:f+c,width:l,height:c,centerX:h+l/2,centerY:f+c/2}}function _l(n,t="center"){return ft(n)?{x:at(n.x,t),y:at(n.y,t)}:(n=at(n,t),{x:n,y:n})}const Nf=(n,t)=>n&&n.autoFit&&t<1;function Ff(n,t){const e=n.font,i=St(e)?e:[e];return Nf(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 Bf(n){return n&&(pe(n.xValue)||pe(n.yValue))}function zf(n,t,e=0,i){return n-bl(t,i)+e}function Ci(n,t,e){const i=e.init;if(i){if(i===!0)return Wf(t,e)}else return;return OS(n,t,e)}function Hf(n,t,e){let i=!1;return t.forEach(s=>{ye(n[s])?(i=!0,e[s]=n[s]):pe(e[s])&&delete e[s]}),i}function Wf(n,t){const e=t.type||"line";return CS[e](n)}function OS(n,t,e){const i=kt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Wf(t,e);if(ft(i))return i}const xl=new Map,PS=n=>isNaN(n)||n<=0,AS=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ia(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function sa(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate($t(i)),n.translate(-t,-e))}function ln(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ei(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function ra(n,t){const e=t.content;if(ia(e))return{width:On(e.width,t.width),height:On(e.height,t.height)};const i=Ff(t),s=t.textStrokeWidth,r=St(e)?e:[e],a=r.join()+AS(i)+s+(n._measureText?"-spriting":"");return xl.has(a)||xl.set(a,NS(n,r,i,s)),xl.get(a)}function Yf(n,t,e){const{x:i,y:s,width:r,height:a}=t;n.save(),Ei(n,e);const o=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),mi(n,{x:i,y:s,w:r,h:a,radius:kS(vn(e.borderRadius),0,Math.min(r,a)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Vf(n,t,e,i){const s=e.content;if(ia(s)){n.save(),n.globalAlpha=zS(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=St(s)?s:[s],a=Ff(e,i),o=e.color,l=St(o)?o:[o],c=ES(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,RS(n,e)&&FS(n,{x:c,y:u},r,a),BS(n,{x:c,y:u},r,{fonts:a,colors:l}),n.restore()}function RS(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function IS(n,t,e,i){const{radius:s,options:r}=t,a=r.pointStyle,o=r.rotation;let l=(o||0)*Na;if(ia(a)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}PS(s)||LS(n,{x:e,y:i,radius:s,rotation:o,style:a,rad:l})}function LS(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:a}){let o,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ar,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ar,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(a+Oe)*c,l=Math.sin(a+Oe)*c,n.arc(t-o,e-l,u,a-dt,a-Pt),n.arc(t+l,e-o,u,a-Pt,a),n.arc(t+o,e+l,u,a,a+Pt),n.arc(t-l,e+o,u,a+Pt,a+dt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}a+=Oe;case"rectRot":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":a+=Oe;case"cross":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),a+=Oe,o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function NS(n,t,e,i){n.save();const s=t.length;let r=0,a=i;for(let o=0;o<s;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];r=Math.max(r,n.measureText(c).width+i),a+=l.lineHeight}return n.restore(),{width:r,height:a}}function FS(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(a,o){const l=s[Math.min(o,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(a,t,e+c/2+r),r+=c}),n.stroke()}function BS(n,{x:t,y:e},i,{fonts:s,colors:r}){let a=0;i.forEach(function(o,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+h/2+a),a+=h,n.fill()})}function zS(n,t){const e=wn(n)?n:t;return wn(e)?na(e,0,1):1}const jf=["left","bottom","top","right"];function HS(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,a=r&&r.display&&$S(t,r);if(!a||qS(t,r,a))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=WS(t,a),{sideStart:u,sideEnd:h}=VS(t,a,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(h.x,h.y);const f=Jn({x:e,y:i},t.getCenterPoint(),$t(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function WS(n,t){const{x:e,y:i,x2:s,y2:r}=n,a=YS(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+a,y:i},l={x:o.x,y:r}):(o={x:e,y:i+a},l={x:s,y:o.y}),{separatorStart:o,separatorEnd:l}}function YS(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 VS(n,t,e){const{y:i,width:s,height:r,options:a}=n,o=a.callout.start,l=jS(t,a.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+On(r,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+On(s,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function jS(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function $S(n,t){const e=t.position;return jf.includes(e)?e:US(n,t)}function US(n,t){const{x:e,y:i,x2:s,y2:r,width:a,height:o,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=n,m={x:u,y:h},g=t.start,p=On(a,g),x=On(o,g),v=[e,e+p,e+p,s],M=[i+x,r,i,r],D=[];for(let k=0;k<4;k++){const E=Jn({x:v[k],y:M[k]},m,$t(f));D.push({position:jf[k],distance:fi(E,{x:l,y:c})})}return D.sort((k,E)=>k.distance-E.distance)[0].position}function qS(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let a=i,o=s;return e==="left"?a+=r:e==="right"?a-=r:e==="top"?o+=r:e==="bottom"&&(o-=r),n.inRange(a,o)}const $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 Oi(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ni(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(a=>a.axis&&a.axis===s);return r.length?r[0].id:s}function Uf(n,t){if(n){const e=n.options.reverse,i=Oi(n,t.min,e?t.end:t.start),s=Oi(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function qf(n,t){const{chartArea:e,scales:i}=n,s=i[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let a=e.width/2,o=e.height/2;return s&&(a=Oi(s,t.xValue,s.left+s.width/2)),r&&(o=Oi(r,t.yValue,r.top+r.height/2)),{x:a,y:o}}function wl(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:a}=i||n.chartArea,{top:o,bottom:l}=s||n.chartArea;const c=Kf(i,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;const u=Kf(s,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:r,y:o,x2:a,y2:l,width:a-r,height:l-o,centerX:r+(a-r)/2,centerY:o+(l-o)/2}}function Xf(n,t){if(!Bf(t)){const e=wl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:r-i,y:a-i,x2:r+i,y2:a+i,centerX:r,centerY:a,width:s,height:s,radius:i}}return GS(n,t)}function XS(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?KS(s,r,t):ZS(e,r,t),r}function Gf(n,t){const e=wl(n,t);return e.initProperties=Ci(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:tk(n,e,t),initProperties:e.initProperties}],e}function GS(n,t){const e=qf(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=Uf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function KS(n,t,e){const i=Oi(n,e.value,NaN),s=Oi(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function ZS(n,t,e){for(const i of Object.keys($f)){const s=n[ni(n,e,i)];if(s){const{min:r,max:a,start:o,end:l,startProp:c,endProp:u}=$f[i],h=Uf(s,{min:e[r],max:e[a],start:s[o],end:s[l]});t[c]=h.start,t[u]=h.end}}}function QS({properties:n,options:t},e,i,s){const{x:r,x2:a,width:o}=n;return Zf({start:r,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function JS({properties:n,options:t},e,i,s){const{y:r,y2:a,height:o}=n;return Zf({start:r,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Zf(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:a,end:o},adjust:l}=t,c=i-s-e-a-o-t.size;return e+s/2+l+bl(c,r)}function tk(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=_l(i.position),r=Ut(i.padding),a=ra(n.ctx,i),o=QS({properties:t,options:e},a,s,r),l=JS({properties:t,options:e},a,s,r),c=a.width+r.width,u=a.height+r.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}const vl=["enter","leave"],Ml=vl.concat("click");function ek(n,t,e){t.listened=Hf(e,Ml,t.listeners),t.moveListened=!1,vl.forEach(i=>{ye(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&ye(i.click)&&(t.listened=!0),t.moveListened||vl.forEach(s=>{ye(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function nk(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ik(n,t,e);case"click":return sk(n,t,e)}}function ik(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=yl(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let a=Qf(r,"leave",s,i);return Qf(r,"enter",i,s)||a}function Qf({state:n,event:t},e,i,s){let r;for(const a of i)s.indexOf(a)<0&&(r=Jf(a.options[e]||n.listeners[e],a,t)||r);return r}function sk(n,t,e){const i=n.listeners,s=yl(n.visibleElements,t,e.interaction);let r;for(const a of s)r=Jf(a.options.click||i.click,a,t)||r;return r}function Jf(n,t,e){return kt(n,[t.$context,e])===!0}const aa=["afterDraw","beforeDraw"];function rk(n,t,e){const i=t.visibleElements;t.hooked=Hf(e,aa,t.hooks),t.hooked||i.forEach(s=>{t.hooked||aa.forEach(r=>{ye(s.options[r])&&(t.hooked=!0)})})}function tm(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return kt(i,[t.$context])}}function ak(n,t,e){const i=dk(n.scales,t,e);let s=em(t,i,"min","suggestedMin");s=em(t,i,"max","suggestedMax")||s,s&&ye(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function ok(n,t){for(const e of n)ck(e,t)}function em(n,t,e,i){if(Rt(t[e])&&!lk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function lk(n,t,e){return pe(n[t])||pe(n[e])}function ck(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&uk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function uk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(pe(n[e+i]))return!0;return!1}function dk(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",a={min:at(t.min,Number.NEGATIVE_INFINITY),max:at(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===s?nm(o,t,["value","endValue"],a):ni(n,o,r)===s&&nm(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function nm(n,t,e,i){for(const s of e){const r=n[s];if(pe(r)){const a=t.parse(r);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Pi extends Jt{inRange(t,e,i,s){const{x:r,y:a}=Jn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation));return Of({x:r,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),sa(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 Gf(t,e)}}Pi.id="boxAnnotation",Pi.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},Pi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Pi.descriptors={label:{_fallback:!0}};class oa extends Jt{inRange(t,e,i,s){return Pf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(yk(t,this),t.save(),sa(t,this.getCenterPoint(),this.rotation),Vf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=hk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:a}=mk(t,e,i);let o=ra(t.ctx,e);const l=gk(o,a);Nf(e,l)&&(o={width:o.width*l,height:o.height*l});const{position:c,xAdjust:u,yAdjust:h}=e,f=Lf(r,o,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ci(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}oa.id="doughnutLabelAnnotation",oa.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},oa.defaultRoutes={};function hk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof nn&&fk(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function fk(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 mk({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:a}=n,{innerRadius:o,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,h=(s+a)/2+c,f={left:Math.max(u-o,i),right:Math.min(u+o,r),top:Math.max(h-o,s),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,p=o-g,x=m.y>h,v=x?s+g:a-g,M=pk(v,u,h,p);return{controllerMeta:{_centerX:u,_centerY:h,_radius:p,_counterclockwise:x,...M},point:m,radius:Math.min(o,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),a=t*-2,o=Math.pow(t,2)+s-r,l=Math.pow(a,2)-4*o;if(l<=0)return{_startAngle:0,_endAngle:Ot};const c=(-a-Math.sqrt(l))/2,u=(-a+Math.sqrt(l))/2;return{_startAngle:lr({x:t,y:e},{x:c,y:n}).angle,_endAngle:lr({x:t,y:e},{x:u,y:n}).angle}}function yk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:a,_counterclockwise:o,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,a,o),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Fs extends Jt{inRange(t,e,i,s){return Pf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=!pe(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),sa(t,this.getCenterPoint(),this.rotation),HS(t,this),Yf(t,this,e),Vf(t,bk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Bf(e))i=qf(t,e);else{const{centerX:o,centerY:l}=wl(t,e);i={x:o,y:l}}const s=Ut(e.padding),r=ra(t.ctx,e),a=Lf(i,r,e,s);return{initProperties:Ci(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}Fs.id="labelAnnotation",Fs.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},Fs.defaultRoutes={borderColor:"color"};function bk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,a=Ut(s.padding);return{x:n+a.left+r,y:t+a.top+r,width:e-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const Sl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),kl=(n,t,e)=>Sl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,im=(n,t,e)=>Sl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Bs=n=>n*n,_k=(n,t,{x:e,y:i,x2:s,y2:r},a)=>a==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},sm=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Dl=(n,t,e,i)=>({x:sm(n.x,t.x,e.x,i),y:sm(n.y,t.y,e.y,i)}),rm=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),am=(n,t,e,i)=>-Math.atan2(rm(n.x,t.x,e.x,i),rm(n.y,t.y,e.y,i))+.5*dt;class zs extends Jt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,m=l.isPointInStroke(o,h,f)||Tl(this,a,s);return l.restore(),m}const c=Bs(r);return Mk(this,a,c,s)||Tl(this,a,s)}return xk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:a,options:o}=this;if(t.save(),!ln(t,o))return t.restore();Ei(t,o);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(o.curve&&a)return Pk(t,this,a,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=dm(this),m=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Cl(t,0,h,c),Cl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=XS(t,e),{x:s,y:r,x2:a,y2:o}=i,l=wk(i,t.chartArea),c=l?vk({x:s,y:r},{x:a,y:o},t.chartArea):{x:s,y:r,x2:a,y2:o,width:Math.abs(a-s),height:Math.abs(o-r)};if(c.centerX=(a+s)/2,c.centerY=(o+r)/2,c.initProperties=Ci(t,c,e),e.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Ok(c,e,fi(h,f))}const u=Sk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}zs.id="lineAnnotation";const om={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};zs.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},om),fill:!1,length:12,start:Object.assign({},om),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({},Fs.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},zs.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},zs.defaultRoutes={borderColor:"color"};function xk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const a=_k(t,e,n.getProps(["x","y","x2","y2"],r),i);return Ef(a,s)||Tl(n,{mouseX:t,mouseY:e},r,i)}function wk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:a,left:o}){return!(n<o&&e<o||n>r&&e>r||t<s&&i<s||t>a&&i>a)}function lm({x:n,y:t},e,{top:i,right:s,bottom:r,left:a}){return n<a&&(t=im(a,{x:n,y:t},e),n=a),n>s&&(t=im(s,{x:n,y:t},e),n=s),t<i&&(n=kl(i,{x:n,y:t},e),t=i),t>r&&(n=kl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function vk(n,t,e){const{x:i,y:s}=lm(n,t,e),{x:r,y:a}=lm(t,n,e);return{x:i,y:s,x2:r,y2:a,width:Math.abs(r-i),height:Math.abs(a-s)}}function Mk(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:a,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],s),c=o-r,u=l-a,h=Bs(c)+Bs(u),f=h===0?-1:((t-r)*c+(e-a)*u)/h;let m,g;return f<0?(m=r,g=a):f>1?(m=o,g=l):(m=r+f*c,g=a+f*u),Bs(t-m)+Bs(e-g)<=i}function Tl(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function Sk(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=ra(n.ctx,e),a=r.width+s.width+i,o=r.height+s.height+i;return Dk(t,e,{width:a,height:o,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>dt/2?r-dt:r<dt/-2?r+dt:r}function Dk(n,t,e,i){const{width:s,height:r,padding:a}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},h=t.rotation==="auto"?kk(n):$t(t.rotation),f=Tk(s,r,h),m=Ck(n,t,{labelSize:f,padding:a},i),g=n.cp?Dl(c,n.cp,u,m):Sl(c,u,m),p={size:f.w,min:i.left,max:i.right,padding:a.left},x={size:f.h,min:i.top,max:i.bottom,padding:a.top},v=um(g.x,p)+o,M=um(g.y,x)+l;return{x:v-s/2,y:M-r/2,x2:v+s/2,y2:M+r/2,centerX:v,centerY:M,pointX:g.x,pointY:g.y,width:s,height:r,rotation:or(h)}}function Tk(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 Ck(n,t,e,i){let s;const r=Ek(n,i);return t.position==="start"?s=cm({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-cm({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=bl(1,t.position),s}function cm(n,t,e,i){const{labelSize:s,padding:r}=t,a=n.w*i.dx,o=n.h*i.dy,l=a>0&&(s.w/2+r.left-i.x)/a,c=o>0&&(s.h/2+r.top-i.y)/o;return na(Math.max(l,c),0,.25)}function Ek(n,t){const{x:e,x2:i,y:s,y2:r}=n,a=Math.min(s,r)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(a,l),dx:o<=c?1:-1,dy:a<=l?1:-1}}function um(n,t){const{size:e,min:i,max:s,padding:r}=t,a=e/2;return e>s-i?(s+i)/2:(i>=n-r-a&&(n=i+r+a),s<=n+r+a&&(n=s-r-a),n)}function dm(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:hm(n,e),endAdjust:hm(n,i)}}function hm(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(kl(0,r,{x:0,y:s}))}function Cl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:a,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ei(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),a===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Ok(n,t,e){const{x:i,y:s,x2:r,y2:a,centerX:o,centerY:l}=n,c=Math.atan2(a-s,r-i),u=_l(t.controlPoint,0),h={x:o+On(e,u.x,!1),y:l+On(e,u.y,!1)};return Jn(h,{x:o,y:l},c)}function fm(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 Pk(n,t,e,i){const{x:s,y:r,x2:a,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=dm(t),m={x:s,y:r},g={x:a,y:o},p=am(m,e,g,0),x=am(m,e,g,1)-dt,v=Dl(m,e,g,h/i),M=Dl(m,e,g,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,fm(n,v,{angle:p,adjust:h},c),fm(n,M,{angle:x,adjust:f},u)}class Hs extends Jt{inRange(t,e,i,s){const r=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Ak({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,a);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:o,end:c},f=Jn({x:t,y:e},this.getCenterPoint(s),$t(-r));return f[i]>=h.start-a-ti&&f[i]<=h.end+a+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:a}=this;t.save(),sa(t,this.getCenterPoint(),a.rotation),Ei(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=ln(t,a);t.ellipse(s,r,i/2,e/2,dt/2,0,2*dt),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Gf(t,e)}}Hs.id="ellipseAnnotation",Hs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Pi.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},Hs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Hs.descriptors={label:{_fallback:!0}};function Ak(n,t,e,i){const{width:s,height:r,centerX:a,centerY:o}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=$t(e||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(n.x-a)+f*(n.y-o),2),g=Math.pow(f*(n.x-a)-h*(n.y-o),2);return m/Math.pow(l+i,2)+g/Math.pow(c+i,2)<=1.0001}class la extends Jt{inRange(t,e,i,s){const{x:r,y:a,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?DS({x:t,y:e},this.getCenterPoint(s),c/2,u):Ef(i==="y"?{start:a,end:l,value:e}:{start:r,end:o,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ei(t,e);const s=ln(t,e);IS(t,this,this.centerX,this.centerY),s&&!ia(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Xf(t,e);return i.initProperties=Ci(t,i,e),i}}la.id="pointAnnotation",la.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},la.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ca extends Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Ik(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...a),l=Math.max(...a);return r[i]>=o&&r[i]<=l}getCenterPoint(t){return ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ei(t,i);const s=ln(t,i);let r=!0;for(const a of e)r?(t.moveTo(a.x,a.y),r=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Xf(t,e),{sides:s,rotation:r}=e,a=[],o=2*dt/s;let l=r*Na;for(let c=0;c<s;c++,l+=o){const u=Rk(i,e,l);u.initProperties=Ci(t,i,e),a.push(u)}return i.elements=a,i}}ca.id="polygonAnnotation",ca.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},ca.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Rk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const a=(i+s)/2,o=Math.sin(r),l=Math.cos(r),c={x:n+o*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+o*(e+a),bY:t-l*(e+a)}}}function Ik(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const o=a.getProps(["bX","bY"],i);o.bY>e!=r.bY>e&&t<(r.bX-o.bX)*(e-o.bY)/(r.bY-o.bY)+o.bX&&(s=!s),r=o}return s}const Pn={box:Pi,doughnutLabel:oa,ellipse:Hs,label:Fs,line:zs,point:la,polygon:ca};Object.keys(Pn).forEach(n=>{At.describe(`elements.${Pn[n].id}`,{_fallback:"plugins.annotation.common"})});const Lk={update:Object.assign},Nk=Ml.concat(aa),mm=(n,t)=>ft(t)?Pl(n,t):n,El=n=>n==="color"||n==="font";function Ol(n="line"){return Pn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Fk(n,t,e,i){const s=zk(n,e.animations,i),r=t.annotations,a=Yk(t.elements,r);for(let o=0;o<r.length;o++){const l=r[o],c=gm(a,o,l.type),u=l.setContext(Wk(n,c,a,l)),h=c.resolveElementProperties(n,u);h.skip=Bk(h),"elements"in h&&(Hk(c,h.elements,u,s),delete h.elements),pe(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=pm(u),s.update(c,h)}}function Bk(n){return isNaN(n.x)||isNaN(n.y)}function zk(n,t,e){return e==="reset"||e==="none"||e==="resize"?Lk:new Ka(n,t)}function Hk(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const a=t[r],o=a.properties,l=gm(s,r,a.type,a.initProperties),c=e[a.optionScope].override(a);o.options=pm(c),i.update(l,o)}}function gm(n,t,e,i){const s=Pn[Ol(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function pm(n){const t=Pn[Ol(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Pl(n,t.defaults),Pl(n,t.defaultRoutes));for(const i of Nk)e[i]=n[i];return e}function Pl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];El(i)&&St(r)?e[i]=r.map(a=>mm(a,s)):e[i]=mm(r,s)}return e}function Wk(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 Yk(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 Vk="3.1.0";const An=new Map,ym=n=>n.type!=="doughnutLabel",jk=Ml.concat(aa);var bm={id:"annotation",version:Vk,beforeRegister(){TS("chart.js","4.0",be.version)},afterRegister(){be.register(Pn)},afterUnregister(){be.unregister(Pn)},beforeInit(n){An.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=An.get(n),s=i.annotations=[];let r=e.annotations;ft(r)?Object.keys(r).forEach(a=>{const o=r[a];ft(o)&&(o.id=a,s.push(o))}):St(r)&&s.push(...r),ok(s.filter(ym),n.scales)},afterDataLimits(n,t){const e=An.get(n);ak(n,t.scale,e.annotations.filter(ym).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=An.get(n);ek(n,i,e),Fk(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),rk(n,i,e)},beforeDatasetsDraw(n,t,e){Ws(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Ws(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Ws(n,t.index,e.clip)},beforeDraw(n,t,e){Ws(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Ws(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=An.get(n);nk(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){An.delete(n)},getAnnotations(n){const t=An.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return yl(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[Ol(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:El,_fallback:!0},_indexable:El}},additionalOptionScopes:[""]};function Ws(n,t,e){const{ctx:i,chartArea:s}=n,r=An.get(n);e&&Qi(i,s);const a=$k(r.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of a)Uk(i,s,r,o);e&&Ji(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 Uk(n,t,e,i){const s=i.element;i.main?(tm(e,s,"beforeDraw"),s.draw(n,t),tm(e,s,"afterDraw")):s.draw(n,t)}const qk={class:"zoom-timerange-container"},Xk={class:"zoom-timerange-details"},Gk={class:"label","data-testid":"zoom-timerange-from"},Kk={class:"label","data-testid":"zoom-timerange-to"},Zk=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=pt.useI18n(),i=d.ref(As({tickValue:t.start,granularity:t.granularity})),s=d.ref(As({tickValue:t.end,granularity:t.granularity})),r=(a,o)=>{Ko(()=>{i.value=As({tickValue:a,granularity:t.granularity}),s.value=As({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{r(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",qk,[d.createElementVNode("div",Xk,[d.createElementVNode("div",Gk,d.toDisplayString(d.unref(e).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",Kk,d.toDisplayString(d.unref(e).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),Ce=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},_m=Ce(Zk,[["__scopeId","data-v-0e972e3c"]]),Qk={class:"zoom-actions-container"},Jk={class:"zoom-actions-heading"},tD={class:"zoom-action-select"},eD=["data-testid"],nD=["aria-disabled","href"],iD=["onClick"],sD=Ce(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,a)=>(d.openBlock(),d.createElementBlock("div",Qk,[d.createElementVNode("div",Jk,[d.createVNode(_m,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Js.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(Zo),size:d.unref(Qo),onClick:a[0]||(a[0]=o=>r.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",tD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.zoomActionItems,o=>(d.openBlock(),d.createElementBlock("div",{key:o.key,class:d.normalizeClass(["zoom-action-item",{disabled:o.disabled}]),"data-testid":`zoom-action-item-${o.key}`},[o.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":o.disabled,class:"zoom-action-link",href:o.href,onClick:a[1]||(a[1]=l=>r.$emit("onAction"))},d.toDisplayString(o.label),9,nD)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(o)},d.toDisplayString(o.label),9,iD))],10,eD))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),rD={key:2},aD={class:"tooltip-title"},oD={class:"title"},lD={key:0,class:"subtitle"},cD={class:"context"},uD={class:"metric"},dD={class:"tooltip"},hD={key:0},fD={class:"display-value"},ua=Ce(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,s=d.ref(null),{x:r,y:a,isDragging:o}=fS(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${a.value}px`),c=d.computed(()=>`${r.value}px`),u=d.computed(()=>i.state.tooltipContext),h=d.computed(()=>i.state.metricDisplay),f=d.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return d.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,g])=>{o.value||(r.value=parseFloat(m),a.value=parseFloat(g))}),d.watch(o,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:g,height:p}=m.getBoundingClientRect();e("dimensions",{width:g,height:p})}}),(m,g)=>{var p,x;return n.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity?(d.openBlock(),d.createBlock(_m,{key:0,end:(p=n.zoomTimeRange)==null?void 0:p.end,granularity:n.granularity,start:(x=n.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(d.openBlock(),d.createBlock(sD,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:g[0]||(g[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",rD,[d.createElementVNode("div",aD,[d.createElementVNode("div",oD,[d.createElementVNode("div",null,d.toDisplayString(n.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Js.DragIcon),{key:0,class:"drag-icon",color:d.unref(Zo),size:d.unref(Qo)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",lD,[d.createElementVNode("div",cD,d.toDisplayString(u.value),1),d.createElementVNode("div",uD,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",dD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:M,label:D,value:k,isSegmentEmpty:E},R)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:D+R},[n.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",hD,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:v,"border-color":M})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:E}])},d.toDisplayString(D),3),d.createElementVNode("span",fD,d.toDisplayString(k),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),mD=["onClick"],gD={key:0,class:"sub-label"},pD={class:"tooltip-content"},Al=Ce(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){d.useCssVars(k=>({v6d3f1170:l.value}));const t=n,{i18n:e}=pt.useI18n(),i=d.ref(),s=d.ref([]),r=d.inject("showLegendValues",!0),a=d.inject("legendPosition",d.ref(Nt.Right)),o=d.ref([]),l=d.ref(Zh),c=()=>{const k=i.value;if(!k||!s.value||k.children.length===0)return 0;const E=k.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>E)return!0;return!1},u=d.computed(()=>t.items.length>2||a.value===Nt.Right),h=()=>{i.value&&a.value===Nt.Bottom&&(c()?l.value=q1:l.value=Zh)},f=()=>{if(i.value&&a.value===Nt.Bottom){let k=0;s.value.forEach(R=>{const C=Array.from(R.children).reduce((b,_)=>b+_.offsetWidth,0);C>k&&(k=C)});const E=parseInt(U1,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${k+E}px)`}h()},m=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let k=0;k<t.items.length;k++)if(t.items[k].text!==o.value[k].text)return o.value=t.items,!0;return!1};d.watch(()=>t.items,()=>{m()&&f()},{immediate:!0,flush:"post"});const g=d.ref(0),p=d.ref(0),x=new ResizeObserver(Ko(k=>{const E=k[0],R=E.contentRect.width,C=E.contentRect.height;R!==g.value&&C===p.value&&f(),g.value=R,p.value=C},100));d.watch(()=>a.value,()=>{f()}),d.onMounted(()=>{o.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),d.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const v=(k=0,E)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof be?t.chartInstance:t.chartInstance.chart;M(k,E)?R.hide(k,E):R.show(k,E),R.update()},M=(k=0,E)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof be?t.chartInstance:t.chartInstance.chart,C=R.getDatasetMeta(k);return C.dataset||E===void 0?R.isDatasetVisible(k):!(C.data.length&&C.data[E].hidden)},D=k=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[k];return(k,E)=>{const R=d.resolveComponent("KTooltip");return d.unref(a)!==d.unref(Nt).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:d.normalizeClass(["legend-container",D(d.unref(a))]),"data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.items,({fillStyle:C,strokeStyle:b,text:_,datasetIndex:S,index:O,value:A,isSegmentEmpty:L})=>(d.openBlock(),d.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:B=>v(S,O)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:C,"border-color":b})},null,4),d.createVNode(R,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!M(S,O)}])},[d.createElementVNode("div",{class:d.normalizeClass(["label",{"truncate-label":u.value,empty:L}])},d.toDisplayString(_),3),A&&d.unref(r)?(d.openBlock(),d.createElementBlock("div",gD,d.toDisplayString(A.formatted),1)):d.createCommentVNode("",!0)],2)]),_:2},[L?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",pD,d.toDisplayString(d.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,mD))),128))],2)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function yD(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 Rl;const bD=new Uint8Array(16);function _D(){if(!Rl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Rl=crypto.getRandomValues.bind(crypto)}return Rl(bD)}const xm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function da(n,t,e){var s;if(xm.randomUUID&&!n)return xm.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??_D();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,yD(i)}const wm=(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 vm{constructor(){P(this,"id","highlightPlugin");P(this,"_clickedElements");P(this,"_previousHoverOption");P(this,"_clicked",!1);P(this,"_pause",!1);P(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&wm(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,wm(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"},Mm=6,MD="100%",SD="100%",kD=20,DD=20,Sm=6,TD=0,CD=10,ED=10,OD=1,PD=Ce(d.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}=pt.useI18n(),{translateUnit:i}=pt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),a=new vm,o=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:z},$)=>{var et;const V=z.data,J=(et=V.labels)==null?void 0:et.indexOf($);return V.datasets.reduce((nt,st,it)=>{if(z.isDatasetVisible(it)){const _t=st.data[J];return isNaN(_t)?nt:nt+_t}else return nt},0)},u=(z,$,V,J)=>{const et=J==="horizontal";$===null&&($=e.t("entityNoName"));const nt={type:"label",yValue:_t=>et?$:c(_t,$),xValue:_t=>et?c(_t,$):$},st={...nt,position:et?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>et?0:-Math.abs(iM()),content:_t=>el(c(_t,$),V)},it={...nt,content:_t=>af(c(_t,$),rf(_t.chart,z)),position:et?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:_t=>et?sf(el(c(_t,$),V)):0,color:tf};return{[`${$}-value`]:st,[`${$}-percent`]:it}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=da(),g=da(),p=da(),x=d.ref([]),v=d.inject("legendPosition",Nt.Right),M=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),D=d.toRef(t,"metricUnit"),k=d.computed(()=>t.orientation==="horizontal"),E=d.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:k.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:C}=pt.useTooltipAbsolutePosition(l,E),b=d.ref(0),_=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce(($,V)=>Object.assign($,u(t.chartData,V,D.value,t.orientation)),{}))},S={id:m,afterUpdate(z){b.value+=1,x.value=qh(z,t.legendValues,t.chartLegendSortFn)}},O={id:g,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?_():{}}},B=[S,{id:"axisHover",afterEvent(z,$){var V;if(M.show=!1,$.event.type==="mousemove"){const J=$.event,et=z.options.indexAxis,nt=z.scales,st=z.scales[et].getLabelForValue(Number(z.scales[et].getValueForPixel(J[et]))),_t=z.scales[et].getLabels().indexOf(st),ct=(V=t.chartData.isLabelEmpty)==null?void 0:V[_t];if((te=>te==="x"?J.y>nt.x.top:J.x<nt.y.right)(et)){E.interactionMode!=="interactive"&&(E.showTooltip=!1);const le=z.canvas.getContext("2d").measureText(st).width,qt=Math.abs(Math.round(J.x-le*.5)),Re=Math.round(J.x+le*.5),Mt=z.canvas.getBoundingClientRect(),Xt=40;M.left=et==="x"?`${(qt>0?qt:Re)-M.offset+Mt.left}px`:`${J.x-le*.5-M.offset+Mt.left}px`,M.top=`${J.y-Xt+Mt.top}px`,st.length>Xr?(M.show=!0,M.text=st):ct?(M.text=e.t("emptyEntityInfo"),M.show=!0):M.show=!1}else M.show=!1}}},{id:p,afterUpdate(z){z.options.layout.padding.right=k.value?Y.value:0}},a,...t.annotations?[O]:[]],X=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),G=d.ref(0),j=d.ref(0),lt=new ResizeObserver(Ko(z=>{G.value=z[0].contentRect.width,j.value=z[0].contentRect.height},100)),q=d.computed(()=>{var $,V;const z=(V=($=t.chartData)==null?void 0:$.labels)==null?void 0:V.length;return h.value&&z&&!k.value?`${Math.max(z*(kD+Sm),G.value)}px`:MD}),Q=d.computed(()=>{var $,V;const z=(V=($=t.chartData)==null?void 0:$.labels)==null?void 0:V.length;return h.value&&z&&k.value?`${Math.max(z*(DD+Sm),j.value)}px`:SD});pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&be.register(bm),o.value&&(G.value=o.value.offsetWidth,j.value=o.value.offsetHeight,lt.observe(o.value))}),d.onUnmounted(()=>{o.value&<.unobserve(o.value)});const H=d.computed(()=>{const z=pt.useBarChartOptions({tooltipState:E,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:k.value?"y":"x",numLabels:X});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Mm}}}}),U=pt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),B,H),Y=d.computed(()=>{b.value;const z=t.chartData.labels,$=t.chartData.datasets,V=z.map((nt,st)=>$.reduce((it,_t)=>isNaN(Number(_t.data[st]))?it:it+Number(_t.data[st]),0)),J=U.value?rf(U.value,t.chartData):sM(t.chartData);return V.map(nt=>sf(el(nt,D.value)+af(nt,J))).reduce((nt,st)=>Math.max(nt,st),0)+Mm});d.onBeforeUnmount(()=>{be.unregister(bm)});const xt={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},yt=d.computed(()=>{if(f.value&&U.value){const z=window.devicePixelRatio,$=U.value,V=$.scales.y.width*z+OD,J=($.scales.y.height+$.scales.y.top+$.scales.x.height)*z,et=f.value.getContext("2d");return et.scale(z,z),et.canvas.width=V,et.canvas.height=J,et.canvas.style.width=`${V/z}px`,et.canvas.style.height=`${J/z}px`,{scale:z,width:V*z,height:J*z,targetCtx:et}}return null}),vt=z=>{const $=z.target;if(yt.value&&U.value&&!k.value){const V=yt.value.scale,J=yt.value.targetCtx,et=yt.value.width,nt=yt.value.height,st=U.value,it=st.canvas;J.fillStyle="white",$.scrollLeft>=TD&&$.scrollLeft<=CD?(J.globalCompositeOperation="source-over",J.clearRect(0,0,et,nt),J.drawImage(it,0,0,et,nt,0,0,et,nt),J.globalCompositeOperation="destination-over",J.fillRect(0,0,et,nt)):(J.globalCompositeOperation="source-over",J.fillRect(0,(st.scales.y.height+st.scales.y.top+ED)*V,et,st.scales.x.height*V))}E.offsetY=$.scrollTop,E.offsetX=$.scrollLeft,M.offset=$.scrollLeft},mt=({width:z,height:$})=>{E.width=z,E.height=$};d.watch(()=>t.orientation,()=>{var z;if(f.value&&yt.value){const $=yt.value.width,V=yt.value.height;((z=f.value)==null?void 0:z.getContext("2d")).clearRect(0,0,$,V)}E.showTooltip=!1,E.interactionMode="idle"}),d.watch(()=>t.annotations,z=>{U.value&&(z?U.value.options.plugins.annotation.annotations=_(t.chartData):delete U.value.options.plugins.annotation.annotations)});const gt=()=>{E.showTooltip&&(E.interactionMode!=="idle"?E.interactionMode="idle":E.interactionMode="interactive")};return(z,$)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",xt[d.unref(v)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,xD),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:$[0]||($[0]=V=>gt()),onScroll:vt},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:q.value,height:Q.value})},[d.createElementVNode("canvas",{id:d.unref(r),ref:"canvas",class:"chart-canvas"},null,8,wD)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[M.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:M.top,left:M.left}),width:"auto"},[d.createElementVNode("div",vD,d.toDisplayString(M.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(ua,{"absolute-left":d.unref(R),"absolute-top":d.unref(C),"chart-parent-ref":l.value,state:E,"tooltip-title":n.tooltipTitle,onDimensions:mt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Al,{id:d.unref(m),"chart-instance":d.unref(U),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
23
|
+
*/const Cf={modes:{point(n,t){return ea(n,t,{intersect:!0})},nearest(n,t,e){return MS(n,t,e)},x(n,t,e){return ea(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return ea(n,t,{intersect:e.intersect,axis:"y"})}}};function yl(n,t,e){return(Cf.modes[e.mode]||Cf.modes.nearest)(n,t,e)}function wS(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 vS(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function ea(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):wS(i,t,e.axis))}function MS(n,t,e){let i=Number.POSITIVE_INFINITY;return ea(n,t,e).reduce((s,r)=>{const a=r.getCenterPoint(),o=vS(t,a,e.axis),l=fi(t,o);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Jn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,a=t.y;return{x:r+i*(n.x-r)-s*(n.y-a),y:a+s*(n.x-r)+i*(n.y-a)}}const SS=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,na=(n,t,e)=>Math.min(e,Math.max(t,n)),Ef=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function kS(n,t,e){for(const i of Object.keys(n))n[i]=na(n[i],t,e);return n}function TS(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 Of(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:a,hitTolerance:o}){const l=(a+o)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function Pf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:a}){const o=Jn(n,e,$t(-s));return Of(o,t,i,{borderWidth:r,hitTolerance:a})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function DS(n,t,e,i=!0){const s=e.split(".");let r=0;for(const a of t.split(".")){const o=s[r++];if(parseInt(a,10)<parseInt(o,10))break;if(SS(o,a)){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("%"),Rf=n=>parseFloat(n)/100,If=n=>na(Rf(n),0,1),Ns=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),CS={box:n=>Ns(n.centerX,n.centerY),doughnutLabel:n=>Ns(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ns(n.centerX,n.centerY),line:n=>Ns(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ns(n.centerX,n.centerY)};function bl(n,t){return t==="start"?0:t==="end"?n:Af(t)?If(t)*n:n/2}function On(n,t,e=!0){return typeof t=="number"?t:Af(t)?(e?If(t):Rf(t))*n:n}function ES(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 Lf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},a){const o=ft(a),l=t.width+(o?a.width:0)+e,c=t.height+(o?a.height:0)+e,u=_l(i),h=zf(n.x,l,s,u.x),f=zf(n.y,c,r,u.y);return{x:h,y:f,x2:h+l,y2:f+c,width:l,height:c,centerX:h+l/2,centerY:f+c/2}}function _l(n,t="center"){return ft(n)?{x:at(n.x,t),y:at(n.y,t)}:(n=at(n,t),{x:n,y:n})}const Nf=(n,t)=>n&&n.autoFit&&t<1;function Ff(n,t){const e=n.font,i=St(e)?e:[e];return Nf(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 Bf(n){return n&&(pe(n.xValue)||pe(n.yValue))}function zf(n,t,e=0,i){return n-bl(t,i)+e}function Ci(n,t,e){const i=e.init;if(i){if(i===!0)return Wf(t,e)}else return;return OS(n,t,e)}function Hf(n,t,e){let i=!1;return t.forEach(s=>{ye(n[s])?(i=!0,e[s]=n[s]):pe(e[s])&&delete e[s]}),i}function Wf(n,t){const e=t.type||"line";return CS[e](n)}function OS(n,t,e){const i=kt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Wf(t,e);if(ft(i))return i}const xl=new Map,PS=n=>isNaN(n)||n<=0,AS=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ia(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function sa(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate($t(i)),n.translate(-t,-e))}function ln(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ei(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function ra(n,t){const e=t.content;if(ia(e))return{width:On(e.width,t.width),height:On(e.height,t.height)};const i=Ff(t),s=t.textStrokeWidth,r=St(e)?e:[e],a=r.join()+AS(i)+s+(n._measureText?"-spriting":"");return xl.has(a)||xl.set(a,NS(n,r,i,s)),xl.get(a)}function Yf(n,t,e){const{x:i,y:s,width:r,height:a}=t;n.save(),Ei(n,e);const o=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),mi(n,{x:i,y:s,w:r,h:a,radius:kS(vn(e.borderRadius),0,Math.min(r,a)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Vf(n,t,e,i){const s=e.content;if(ia(s)){n.save(),n.globalAlpha=zS(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=St(s)?s:[s],a=Ff(e,i),o=e.color,l=St(o)?o:[o],c=ES(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,RS(n,e)&&FS(n,{x:c,y:u},r,a),BS(n,{x:c,y:u},r,{fonts:a,colors:l}),n.restore()}function RS(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function IS(n,t,e,i){const{radius:s,options:r}=t,a=r.pointStyle,o=r.rotation;let l=(o||0)*Na;if(ia(a)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}PS(s)||LS(n,{x:e,y:i,radius:s,rotation:o,style:a,rad:l})}function LS(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:a}){let o,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ar,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ar,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(a+Oe)*c,l=Math.sin(a+Oe)*c,n.arc(t-o,e-l,u,a-dt,a-Pt),n.arc(t+l,e-o,u,a-Pt,a),n.arc(t+o,e+l,u,a,a+Pt),n.arc(t-l,e+o,u,a+Pt,a+dt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}a+=Oe;case"rectRot":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":a+=Oe;case"cross":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),a+=Oe,o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function NS(n,t,e,i){n.save();const s=t.length;let r=0,a=i;for(let o=0;o<s;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];r=Math.max(r,n.measureText(c).width+i),a+=l.lineHeight}return n.restore(),{width:r,height:a}}function FS(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(a,o){const l=s[Math.min(o,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(a,t,e+c/2+r),r+=c}),n.stroke()}function BS(n,{x:t,y:e},i,{fonts:s,colors:r}){let a=0;i.forEach(function(o,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+h/2+a),a+=h,n.fill()})}function zS(n,t){const e=wn(n)?n:t;return wn(e)?na(e,0,1):1}const jf=["left","bottom","top","right"];function HS(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,a=r&&r.display&&$S(t,r);if(!a||qS(t,r,a))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=WS(t,a),{sideStart:u,sideEnd:h}=VS(t,a,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(h.x,h.y);const f=Jn({x:e,y:i},t.getCenterPoint(),$t(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function WS(n,t){const{x:e,y:i,x2:s,y2:r}=n,a=YS(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+a,y:i},l={x:o.x,y:r}):(o={x:e,y:i+a},l={x:s,y:o.y}),{separatorStart:o,separatorEnd:l}}function YS(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 VS(n,t,e){const{y:i,width:s,height:r,options:a}=n,o=a.callout.start,l=jS(t,a.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+On(r,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+On(s,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function jS(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function $S(n,t){const e=t.position;return jf.includes(e)?e:US(n,t)}function US(n,t){const{x:e,y:i,x2:s,y2:r,width:a,height:o,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=n,m={x:u,y:h},g=t.start,p=On(a,g),x=On(o,g),v=[e,e+p,e+p,s],M=[i+x,r,i,r],T=[];for(let k=0;k<4;k++){const E=Jn({x:v[k],y:M[k]},m,$t(f));T.push({position:jf[k],distance:fi(E,{x:l,y:c})})}return T.sort((k,E)=>k.distance-E.distance)[0].position}function qS(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let a=i,o=s;return e==="left"?a+=r:e==="right"?a-=r:e==="top"?o+=r:e==="bottom"&&(o-=r),n.inRange(a,o)}const $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 Oi(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ni(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(a=>a.axis&&a.axis===s);return r.length?r[0].id:s}function Uf(n,t){if(n){const e=n.options.reverse,i=Oi(n,t.min,e?t.end:t.start),s=Oi(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function qf(n,t){const{chartArea:e,scales:i}=n,s=i[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let a=e.width/2,o=e.height/2;return s&&(a=Oi(s,t.xValue,s.left+s.width/2)),r&&(o=Oi(r,t.yValue,r.top+r.height/2)),{x:a,y:o}}function wl(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:a}=i||n.chartArea,{top:o,bottom:l}=s||n.chartArea;const c=Kf(i,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;const u=Kf(s,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:r,y:o,x2:a,y2:l,width:a-r,height:l-o,centerX:r+(a-r)/2,centerY:o+(l-o)/2}}function Xf(n,t){if(!Bf(t)){const e=wl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:r-i,y:a-i,x2:r+i,y2:a+i,centerX:r,centerY:a,width:s,height:s,radius:i}}return GS(n,t)}function XS(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?KS(s,r,t):ZS(e,r,t),r}function Gf(n,t){const e=wl(n,t);return e.initProperties=Ci(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:tk(n,e,t),initProperties:e.initProperties}],e}function GS(n,t){const e=qf(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=Uf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function KS(n,t,e){const i=Oi(n,e.value,NaN),s=Oi(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function ZS(n,t,e){for(const i of Object.keys($f)){const s=n[ni(n,e,i)];if(s){const{min:r,max:a,start:o,end:l,startProp:c,endProp:u}=$f[i],h=Uf(s,{min:e[r],max:e[a],start:s[o],end:s[l]});t[c]=h.start,t[u]=h.end}}}function QS({properties:n,options:t},e,i,s){const{x:r,x2:a,width:o}=n;return Zf({start:r,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function JS({properties:n,options:t},e,i,s){const{y:r,y2:a,height:o}=n;return Zf({start:r,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Zf(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:a,end:o},adjust:l}=t,c=i-s-e-a-o-t.size;return e+s/2+l+bl(c,r)}function tk(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=_l(i.position),r=Ut(i.padding),a=ra(n.ctx,i),o=QS({properties:t,options:e},a,s,r),l=JS({properties:t,options:e},a,s,r),c=a.width+r.width,u=a.height+r.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}const vl=["enter","leave"],Ml=vl.concat("click");function ek(n,t,e){t.listened=Hf(e,Ml,t.listeners),t.moveListened=!1,vl.forEach(i=>{ye(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&ye(i.click)&&(t.listened=!0),t.moveListened||vl.forEach(s=>{ye(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function nk(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ik(n,t,e);case"click":return sk(n,t,e)}}function ik(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=yl(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let a=Qf(r,"leave",s,i);return Qf(r,"enter",i,s)||a}function Qf({state:n,event:t},e,i,s){let r;for(const a of i)s.indexOf(a)<0&&(r=Jf(a.options[e]||n.listeners[e],a,t)||r);return r}function sk(n,t,e){const i=n.listeners,s=yl(n.visibleElements,t,e.interaction);let r;for(const a of s)r=Jf(a.options.click||i.click,a,t)||r;return r}function Jf(n,t,e){return kt(n,[t.$context,e])===!0}const aa=["afterDraw","beforeDraw"];function rk(n,t,e){const i=t.visibleElements;t.hooked=Hf(e,aa,t.hooks),t.hooked||i.forEach(s=>{t.hooked||aa.forEach(r=>{ye(s.options[r])&&(t.hooked=!0)})})}function tm(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return kt(i,[t.$context])}}function ak(n,t,e){const i=dk(n.scales,t,e);let s=em(t,i,"min","suggestedMin");s=em(t,i,"max","suggestedMax")||s,s&&ye(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function ok(n,t){for(const e of n)ck(e,t)}function em(n,t,e,i){if(Rt(t[e])&&!lk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function lk(n,t,e){return pe(n[t])||pe(n[e])}function ck(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&uk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function uk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(pe(n[e+i]))return!0;return!1}function dk(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",a={min:at(t.min,Number.NEGATIVE_INFINITY),max:at(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===s?nm(o,t,["value","endValue"],a):ni(n,o,r)===s&&nm(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function nm(n,t,e,i){for(const s of e){const r=n[s];if(pe(r)){const a=t.parse(r);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Pi extends Jt{inRange(t,e,i,s){const{x:r,y:a}=Jn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation));return Of({x:r,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),sa(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 Gf(t,e)}}Pi.id="boxAnnotation",Pi.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},Pi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Pi.descriptors={label:{_fallback:!0}};class oa extends Jt{inRange(t,e,i,s){return Pf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(yk(t,this),t.save(),sa(t,this.getCenterPoint(),this.rotation),Vf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=hk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:a}=mk(t,e,i);let o=ra(t.ctx,e);const l=gk(o,a);Nf(e,l)&&(o={width:o.width*l,height:o.height*l});const{position:c,xAdjust:u,yAdjust:h}=e,f=Lf(r,o,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ci(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}oa.id="doughnutLabelAnnotation",oa.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},oa.defaultRoutes={};function hk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof nn&&fk(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function fk(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 mk({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:a}=n,{innerRadius:o,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,h=(s+a)/2+c,f={left:Math.max(u-o,i),right:Math.min(u+o,r),top:Math.max(h-o,s),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,p=o-g,x=m.y>h,v=x?s+g:a-g,M=pk(v,u,h,p);return{controllerMeta:{_centerX:u,_centerY:h,_radius:p,_counterclockwise:x,...M},point:m,radius:Math.min(o,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),a=t*-2,o=Math.pow(t,2)+s-r,l=Math.pow(a,2)-4*o;if(l<=0)return{_startAngle:0,_endAngle:Ot};const c=(-a-Math.sqrt(l))/2,u=(-a+Math.sqrt(l))/2;return{_startAngle:lr({x:t,y:e},{x:c,y:n}).angle,_endAngle:lr({x:t,y:e},{x:u,y:n}).angle}}function yk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:a,_counterclockwise:o,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,a,o),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Fs extends Jt{inRange(t,e,i,s){return Pf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=!pe(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),sa(t,this.getCenterPoint(),this.rotation),HS(t,this),Yf(t,this,e),Vf(t,bk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Bf(e))i=qf(t,e);else{const{centerX:o,centerY:l}=wl(t,e);i={x:o,y:l}}const s=Ut(e.padding),r=ra(t.ctx,e),a=Lf(i,r,e,s);return{initProperties:Ci(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}Fs.id="labelAnnotation",Fs.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},Fs.defaultRoutes={borderColor:"color"};function bk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,a=Ut(s.padding);return{x:n+a.left+r,y:t+a.top+r,width:e-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const Sl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),kl=(n,t,e)=>Sl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,im=(n,t,e)=>Sl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Bs=n=>n*n,_k=(n,t,{x:e,y:i,x2:s,y2:r},a)=>a==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},sm=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Tl=(n,t,e,i)=>({x:sm(n.x,t.x,e.x,i),y:sm(n.y,t.y,e.y,i)}),rm=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),am=(n,t,e,i)=>-Math.atan2(rm(n.x,t.x,e.x,i),rm(n.y,t.y,e.y,i))+.5*dt;class zs extends Jt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,m=l.isPointInStroke(o,h,f)||Dl(this,a,s);return l.restore(),m}const c=Bs(r);return Mk(this,a,c,s)||Dl(this,a,s)}return xk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:a,options:o}=this;if(t.save(),!ln(t,o))return t.restore();Ei(t,o);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(o.curve&&a)return Pk(t,this,a,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=dm(this),m=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Cl(t,0,h,c),Cl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=XS(t,e),{x:s,y:r,x2:a,y2:o}=i,l=wk(i,t.chartArea),c=l?vk({x:s,y:r},{x:a,y:o},t.chartArea):{x:s,y:r,x2:a,y2:o,width:Math.abs(a-s),height:Math.abs(o-r)};if(c.centerX=(a+s)/2,c.centerY=(o+r)/2,c.initProperties=Ci(t,c,e),e.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Ok(c,e,fi(h,f))}const u=Sk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}zs.id="lineAnnotation";const om={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};zs.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},om),fill:!1,length:12,start:Object.assign({},om),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({},Fs.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},zs.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},zs.defaultRoutes={borderColor:"color"};function xk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const a=_k(t,e,n.getProps(["x","y","x2","y2"],r),i);return Ef(a,s)||Dl(n,{mouseX:t,mouseY:e},r,i)}function wk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:a,left:o}){return!(n<o&&e<o||n>r&&e>r||t<s&&i<s||t>a&&i>a)}function lm({x:n,y:t},e,{top:i,right:s,bottom:r,left:a}){return n<a&&(t=im(a,{x:n,y:t},e),n=a),n>s&&(t=im(s,{x:n,y:t},e),n=s),t<i&&(n=kl(i,{x:n,y:t},e),t=i),t>r&&(n=kl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function vk(n,t,e){const{x:i,y:s}=lm(n,t,e),{x:r,y:a}=lm(t,n,e);return{x:i,y:s,x2:r,y2:a,width:Math.abs(r-i),height:Math.abs(a-s)}}function Mk(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:a,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],s),c=o-r,u=l-a,h=Bs(c)+Bs(u),f=h===0?-1:((t-r)*c+(e-a)*u)/h;let m,g;return f<0?(m=r,g=a):f>1?(m=o,g=l):(m=r+f*c,g=a+f*u),Bs(t-m)+Bs(e-g)<=i}function Dl(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function Sk(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=ra(n.ctx,e),a=r.width+s.width+i,o=r.height+s.height+i;return Tk(t,e,{width:a,height:o,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>dt/2?r-dt:r<dt/-2?r+dt:r}function Tk(n,t,e,i){const{width:s,height:r,padding:a}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},h=t.rotation==="auto"?kk(n):$t(t.rotation),f=Dk(s,r,h),m=Ck(n,t,{labelSize:f,padding:a},i),g=n.cp?Tl(c,n.cp,u,m):Sl(c,u,m),p={size:f.w,min:i.left,max:i.right,padding:a.left},x={size:f.h,min:i.top,max:i.bottom,padding:a.top},v=um(g.x,p)+o,M=um(g.y,x)+l;return{x:v-s/2,y:M-r/2,x2:v+s/2,y2:M+r/2,centerX:v,centerY:M,pointX:g.x,pointY:g.y,width:s,height:r,rotation:or(h)}}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 Ck(n,t,e,i){let s;const r=Ek(n,i);return t.position==="start"?s=cm({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-cm({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=bl(1,t.position),s}function cm(n,t,e,i){const{labelSize:s,padding:r}=t,a=n.w*i.dx,o=n.h*i.dy,l=a>0&&(s.w/2+r.left-i.x)/a,c=o>0&&(s.h/2+r.top-i.y)/o;return na(Math.max(l,c),0,.25)}function Ek(n,t){const{x:e,x2:i,y:s,y2:r}=n,a=Math.min(s,r)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(a,l),dx:o<=c?1:-1,dy:a<=l?1:-1}}function um(n,t){const{size:e,min:i,max:s,padding:r}=t,a=e/2;return e>s-i?(s+i)/2:(i>=n-r-a&&(n=i+r+a),s<=n+r+a&&(n=s-r-a),n)}function dm(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:hm(n,e),endAdjust:hm(n,i)}}function hm(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(kl(0,r,{x:0,y:s}))}function Cl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:a,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ei(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),a===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Ok(n,t,e){const{x:i,y:s,x2:r,y2:a,centerX:o,centerY:l}=n,c=Math.atan2(a-s,r-i),u=_l(t.controlPoint,0),h={x:o+On(e,u.x,!1),y:l+On(e,u.y,!1)};return Jn(h,{x:o,y:l},c)}function fm(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 Pk(n,t,e,i){const{x:s,y:r,x2:a,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=dm(t),m={x:s,y:r},g={x:a,y:o},p=am(m,e,g,0),x=am(m,e,g,1)-dt,v=Tl(m,e,g,h/i),M=Tl(m,e,g,1-f/i),T=new Path2D;n.beginPath(),T.moveTo(v.x,v.y),T.quadraticCurveTo(e.x,e.y,M.x,M.y),n.shadowColor=l.borderShadowColor,n.stroke(T),t.path=T,t.ctx=n,fm(n,v,{angle:p,adjust:h},c),fm(n,M,{angle:x,adjust:f},u)}class Hs extends Jt{inRange(t,e,i,s){const r=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Ak({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,a);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:o,end:c},f=Jn({x:t,y:e},this.getCenterPoint(s),$t(-r));return f[i]>=h.start-a-ti&&f[i]<=h.end+a+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:a}=this;t.save(),sa(t,this.getCenterPoint(),a.rotation),Ei(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=ln(t,a);t.ellipse(s,r,i/2,e/2,dt/2,0,2*dt),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Gf(t,e)}}Hs.id="ellipseAnnotation",Hs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Pi.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},Hs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Hs.descriptors={label:{_fallback:!0}};function Ak(n,t,e,i){const{width:s,height:r,centerX:a,centerY:o}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=$t(e||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(n.x-a)+f*(n.y-o),2),g=Math.pow(f*(n.x-a)-h*(n.y-o),2);return m/Math.pow(l+i,2)+g/Math.pow(c+i,2)<=1.0001}class la extends Jt{inRange(t,e,i,s){const{x:r,y:a,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?TS({x:t,y:e},this.getCenterPoint(s),c/2,u):Ef(i==="y"?{start:a,end:l,value:e}:{start:r,end:o,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ei(t,e);const s=ln(t,e);IS(t,this,this.centerX,this.centerY),s&&!ia(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Xf(t,e);return i.initProperties=Ci(t,i,e),i}}la.id="pointAnnotation",la.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},la.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ca extends Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Ik(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...a),l=Math.max(...a);return r[i]>=o&&r[i]<=l}getCenterPoint(t){return ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ei(t,i);const s=ln(t,i);let r=!0;for(const a of e)r?(t.moveTo(a.x,a.y),r=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Xf(t,e),{sides:s,rotation:r}=e,a=[],o=2*dt/s;let l=r*Na;for(let c=0;c<s;c++,l+=o){const u=Rk(i,e,l);u.initProperties=Ci(t,i,e),a.push(u)}return i.elements=a,i}}ca.id="polygonAnnotation",ca.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},ca.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Rk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const a=(i+s)/2,o=Math.sin(r),l=Math.cos(r),c={x:n+o*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+o*(e+a),bY:t-l*(e+a)}}}function Ik(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const o=a.getProps(["bX","bY"],i);o.bY>e!=r.bY>e&&t<(r.bX-o.bX)*(e-o.bY)/(r.bY-o.bY)+o.bX&&(s=!s),r=o}return s}const Pn={box:Pi,doughnutLabel:oa,ellipse:Hs,label:Fs,line:zs,point:la,polygon:ca};Object.keys(Pn).forEach(n=>{At.describe(`elements.${Pn[n].id}`,{_fallback:"plugins.annotation.common"})});const Lk={update:Object.assign},Nk=Ml.concat(aa),mm=(n,t)=>ft(t)?Pl(n,t):n,El=n=>n==="color"||n==="font";function Ol(n="line"){return Pn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Fk(n,t,e,i){const s=zk(n,e.animations,i),r=t.annotations,a=Yk(t.elements,r);for(let o=0;o<r.length;o++){const l=r[o],c=gm(a,o,l.type),u=l.setContext(Wk(n,c,a,l)),h=c.resolveElementProperties(n,u);h.skip=Bk(h),"elements"in h&&(Hk(c,h.elements,u,s),delete h.elements),pe(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=pm(u),s.update(c,h)}}function Bk(n){return isNaN(n.x)||isNaN(n.y)}function zk(n,t,e){return e==="reset"||e==="none"||e==="resize"?Lk:new Ka(n,t)}function Hk(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const a=t[r],o=a.properties,l=gm(s,r,a.type,a.initProperties),c=e[a.optionScope].override(a);o.options=pm(c),i.update(l,o)}}function gm(n,t,e,i){const s=Pn[Ol(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function pm(n){const t=Pn[Ol(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Pl(n,t.defaults),Pl(n,t.defaultRoutes));for(const i of Nk)e[i]=n[i];return e}function Pl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];El(i)&&St(r)?e[i]=r.map(a=>mm(a,s)):e[i]=mm(r,s)}return e}function Wk(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 Yk(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 Vk="3.1.0";const An=new Map,ym=n=>n.type!=="doughnutLabel",jk=Ml.concat(aa);var bm={id:"annotation",version:Vk,beforeRegister(){DS("chart.js","4.0",be.version)},afterRegister(){be.register(Pn)},afterUnregister(){be.unregister(Pn)},beforeInit(n){An.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=An.get(n),s=i.annotations=[];let r=e.annotations;ft(r)?Object.keys(r).forEach(a=>{const o=r[a];ft(o)&&(o.id=a,s.push(o))}):St(r)&&s.push(...r),ok(s.filter(ym),n.scales)},afterDataLimits(n,t){const e=An.get(n);ak(n,t.scale,e.annotations.filter(ym).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=An.get(n);ek(n,i,e),Fk(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),rk(n,i,e)},beforeDatasetsDraw(n,t,e){Ws(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Ws(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Ws(n,t.index,e.clip)},beforeDraw(n,t,e){Ws(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Ws(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=An.get(n);nk(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){An.delete(n)},getAnnotations(n){const t=An.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return yl(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[Ol(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:El,_fallback:!0},_indexable:El}},additionalOptionScopes:[""]};function Ws(n,t,e){const{ctx:i,chartArea:s}=n,r=An.get(n);e&&Qi(i,s);const a=$k(r.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of a)Uk(i,s,r,o);e&&Ji(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 Uk(n,t,e,i){const s=i.element;i.main?(tm(e,s,"beforeDraw"),s.draw(n,t),tm(e,s,"afterDraw")):s.draw(n,t)}const qk={class:"zoom-timerange-container"},Xk={class:"zoom-timerange-details"},Gk={class:"label","data-testid":"zoom-timerange-from"},Kk={class:"label","data-testid":"zoom-timerange-to"},Zk=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=pt.useI18n(),i=d.ref(As({tickValue:t.start,granularity:t.granularity})),s=d.ref(As({tickValue:t.end,granularity:t.granularity})),r=(a,o)=>{Ko(()=>{i.value=As({tickValue:a,granularity:t.granularity}),s.value=As({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{r(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",qk,[d.createElementVNode("div",Xk,[d.createElementVNode("div",Gk,d.toDisplayString(d.unref(e).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",Kk,d.toDisplayString(d.unref(e).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),Ce=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},_m=Ce(Zk,[["__scopeId","data-v-0e972e3c"]]),Qk={class:"zoom-actions-container"},Jk={class:"zoom-actions-heading"},tT={class:"zoom-action-select"},eT=["data-testid"],nT=["aria-disabled","href"],iT=["onClick"],sT=Ce(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,a)=>(d.openBlock(),d.createElementBlock("div",Qk,[d.createElementVNode("div",Jk,[d.createVNode(_m,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Js.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(Zo),size:d.unref(Qo),onClick:a[0]||(a[0]=o=>r.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",tT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.zoomActionItems,o=>(d.openBlock(),d.createElementBlock("div",{key:o.key,class:d.normalizeClass(["zoom-action-item",{disabled:o.disabled}]),"data-testid":`zoom-action-item-${o.key}`},[o.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":o.disabled,class:"zoom-action-link",href:o.href,onClick:a[1]||(a[1]=l=>r.$emit("onAction"))},d.toDisplayString(o.label),9,nT)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(o)},d.toDisplayString(o.label),9,iT))],10,eT))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),rT={key:2},aT={class:"tooltip-title"},oT={class:"title"},lT={key:0,class:"subtitle"},cT={class:"context"},uT={class:"metric"},dT={class:"tooltip"},hT={key:0},fT={class:"display-value"},ua=Ce(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,s=d.ref(null),{x:r,y:a,isDragging:o}=fS(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${a.value}px`),c=d.computed(()=>`${r.value}px`),u=d.computed(()=>i.state.tooltipContext),h=d.computed(()=>i.state.metricDisplay),f=d.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return d.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,g])=>{o.value||(r.value=parseFloat(m),a.value=parseFloat(g))}),d.watch(o,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:g,height:p}=m.getBoundingClientRect();e("dimensions",{width:g,height:p})}}),(m,g)=>{var p,x;return n.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity?(d.openBlock(),d.createBlock(_m,{key:0,end:(p=n.zoomTimeRange)==null?void 0:p.end,granularity:n.granularity,start:(x=n.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(d.openBlock(),d.createBlock(sT,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:g[0]||(g[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",rT,[d.createElementVNode("div",aT,[d.createElementVNode("div",oT,[d.createElementVNode("div",null,d.toDisplayString(n.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Js.DragIcon),{key:0,class:"drag-icon",color:d.unref(Zo),size:d.unref(Qo)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",lT,[d.createElementVNode("div",cT,d.toDisplayString(u.value),1),d.createElementVNode("div",uT,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",dT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:M,label:T,value:k,isSegmentEmpty:E},R)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:T+R},[n.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",hT,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:v,"border-color":M})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:E}])},d.toDisplayString(T),3),d.createElementVNode("span",fT,d.toDisplayString(k),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),mT=["onClick"],gT={key:0,class:"sub-label"},pT={class:"tooltip-content"},Al=Ce(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){d.useCssVars(k=>({v6d3f1170:l.value}));const t=n,{i18n:e}=pt.useI18n(),i=d.ref(),s=d.ref([]),r=d.inject("showLegendValues",!0),a=d.inject("legendPosition",d.ref(Nt.Right)),o=d.ref([]),l=d.ref(Zh),c=()=>{const k=i.value;if(!k||!s.value||k.children.length===0)return 0;const E=k.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>E)return!0;return!1},u=d.computed(()=>t.items.length>2||a.value===Nt.Right),h=()=>{i.value&&a.value===Nt.Bottom&&(c()?l.value=q1:l.value=Zh)},f=()=>{if(i.value&&a.value===Nt.Bottom){let k=0;s.value.forEach(R=>{const C=Array.from(R.children).reduce((b,_)=>b+_.offsetWidth,0);C>k&&(k=C)});const E=parseInt(U1,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${k+E}px)`}h()},m=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let k=0;k<t.items.length;k++)if(t.items[k].text!==o.value[k].text)return o.value=t.items,!0;return!1};d.watch(()=>t.items,()=>{m()&&f()},{immediate:!0,flush:"post"});const g=d.ref(0),p=d.ref(0),x=new ResizeObserver(Ko(k=>{const E=k[0],R=E.contentRect.width,C=E.contentRect.height;R!==g.value&&C===p.value&&f(),g.value=R,p.value=C},100));d.watch(()=>a.value,()=>{f()}),d.onMounted(()=>{o.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),d.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const v=(k=0,E)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof be?t.chartInstance:t.chartInstance.chart;M(k,E)?R.hide(k,E):R.show(k,E),R.update()},M=(k=0,E)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof be?t.chartInstance:t.chartInstance.chart,C=R.getDatasetMeta(k);return C.dataset||E===void 0?R.isDatasetVisible(k):!(C.data.length&&C.data[E].hidden)},T=k=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[k];return(k,E)=>{const R=d.resolveComponent("KTooltip");return d.unref(a)!==d.unref(Nt).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:d.normalizeClass(["legend-container",T(d.unref(a))]),"data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.items,({fillStyle:C,strokeStyle:b,text:_,datasetIndex:S,index:O,value:A,isSegmentEmpty:L})=>(d.openBlock(),d.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:B=>v(S,O)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:C,"border-color":b})},null,4),d.createVNode(R,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!M(S,O)}])},[d.createElementVNode("div",{class:d.normalizeClass(["label",{"truncate-label":u.value,empty:L}])},d.toDisplayString(_),3),A&&d.unref(r)?(d.openBlock(),d.createElementBlock("div",gT,d.toDisplayString(A.formatted),1)):d.createCommentVNode("",!0)],2)]),_:2},[L?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",pT,d.toDisplayString(d.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,mT))),128))],2)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function yT(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 Rl;const bT=new Uint8Array(16);function _T(){if(!Rl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Rl=crypto.getRandomValues.bind(crypto)}return Rl(bT)}const xm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function da(n,t,e){var s;if(xm.randomUUID&&!n)return xm.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??_T();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,yT(i)}const wm=(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 vm{constructor(){P(this,"id","highlightPlugin");P(this,"_clickedElements");P(this,"_previousHoverOption");P(this,"_clicked",!1);P(this,"_pause",!1);P(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&wm(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,wm(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 xT=["id"],wT=["id"],vT={class:"axis-tooltip-content"},Mm=6,MT="100%",ST="100%",kT=20,TT=20,Sm=6,DT=0,CT=10,ET=10,OT=1,PT=Ce(d.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}=pt.useI18n(),{translateUnit:i}=pt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),a=new vm,o=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:z},$)=>{var et;const V=z.data,J=(et=V.labels)==null?void 0:et.indexOf($);return V.datasets.reduce((nt,st,it)=>{if(z.isDatasetVisible(it)){const _t=st.data[J];return isNaN(_t)?nt:nt+_t}else return nt},0)},u=(z,$,V,J)=>{const et=J==="horizontal";$===null&&($=e.t("entityNoName"));const nt={type:"label",yValue:_t=>et?$:c(_t,$),xValue:_t=>et?c(_t,$):$},st={...nt,position:et?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>et?0:-Math.abs(iM()),content:_t=>el(c(_t,$),V)},it={...nt,content:_t=>af(c(_t,$),rf(_t.chart,z)),position:et?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:_t=>et?sf(el(c(_t,$),V)):0,color:tf};return{[`${$}-value`]:st,[`${$}-percent`]:it}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=da(),g=da(),p=da(),x=d.ref([]),v=d.inject("legendPosition",Nt.Right),M=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),T=d.toRef(t,"metricUnit"),k=d.computed(()=>t.orientation==="horizontal"),E=d.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:k.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:C}=pt.useTooltipAbsolutePosition(l,E),b=d.ref(0),_=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce(($,V)=>Object.assign($,u(t.chartData,V,T.value,t.orientation)),{}))},S={id:m,afterUpdate(z){b.value+=1,x.value=qh(z,t.legendValues,t.chartLegendSortFn)}},O={id:g,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?_():{}}},B=[S,{id:"axisHover",afterEvent(z,$){var V;if(M.show=!1,$.event.type==="mousemove"){const J=$.event,et=z.options.indexAxis,nt=z.scales,st=z.scales[et].getLabelForValue(Number(z.scales[et].getValueForPixel(J[et]))),_t=z.scales[et].getLabels().indexOf(st),ct=(V=t.chartData.isLabelEmpty)==null?void 0:V[_t];if((te=>te==="x"?J.y>nt.x.top:J.x<nt.y.right)(et)){E.interactionMode!=="interactive"&&(E.showTooltip=!1);const le=z.canvas.getContext("2d").measureText(st).width,qt=Math.abs(Math.round(J.x-le*.5)),Re=Math.round(J.x+le*.5),Mt=z.canvas.getBoundingClientRect(),Xt=40;M.left=et==="x"?`${(qt>0?qt:Re)-M.offset+Mt.left}px`:`${J.x-le*.5-M.offset+Mt.left}px`,M.top=`${J.y-Xt+Mt.top}px`,st.length>Xr?(M.show=!0,M.text=st):ct?(M.text=e.t("emptyEntityInfo"),M.show=!0):M.show=!1}else M.show=!1}}},{id:p,afterUpdate(z){z.options.layout.padding.right=k.value?Y.value:0}},a,...t.annotations?[O]:[]],X=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),G=d.ref(0),j=d.ref(0),lt=new ResizeObserver(Ko(z=>{G.value=z[0].contentRect.width,j.value=z[0].contentRect.height},100)),q=d.computed(()=>{var $,V;const z=(V=($=t.chartData)==null?void 0:$.labels)==null?void 0:V.length;return h.value&&z&&!k.value?`${Math.max(z*(kT+Sm),G.value)}px`:MT}),Q=d.computed(()=>{var $,V;const z=(V=($=t.chartData)==null?void 0:$.labels)==null?void 0:V.length;return h.value&&z&&k.value?`${Math.max(z*(TT+Sm),j.value)}px`:ST});pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&be.register(bm),o.value&&(G.value=o.value.offsetWidth,j.value=o.value.offsetHeight,lt.observe(o.value))}),d.onUnmounted(()=>{o.value&<.unobserve(o.value)});const H=d.computed(()=>{const z=pt.useBarChartOptions({tooltipState:E,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:k.value?"y":"x",numLabels:X});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Mm}}}}),U=pt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),B,H),Y=d.computed(()=>{b.value;const z=t.chartData.labels,$=t.chartData.datasets,V=z.map((nt,st)=>$.reduce((it,_t)=>isNaN(Number(_t.data[st]))?it:it+Number(_t.data[st]),0)),J=U.value?rf(U.value,t.chartData):sM(t.chartData);return V.map(nt=>sf(el(nt,T.value)+af(nt,J))).reduce((nt,st)=>Math.max(nt,st),0)+Mm});d.onBeforeUnmount(()=>{be.unregister(bm)});const xt={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},yt=d.computed(()=>{if(f.value&&U.value){const z=window.devicePixelRatio,$=U.value,V=$.scales.y.width*z+OT,J=($.scales.y.height+$.scales.y.top+$.scales.x.height)*z,et=f.value.getContext("2d");return et.scale(z,z),et.canvas.width=V,et.canvas.height=J,et.canvas.style.width=`${V/z}px`,et.canvas.style.height=`${J/z}px`,{scale:z,width:V*z,height:J*z,targetCtx:et}}return null}),vt=z=>{const $=z.target;if(yt.value&&U.value&&!k.value){const V=yt.value.scale,J=yt.value.targetCtx,et=yt.value.width,nt=yt.value.height,st=U.value,it=st.canvas;J.fillStyle="white",$.scrollLeft>=DT&&$.scrollLeft<=CT?(J.globalCompositeOperation="source-over",J.clearRect(0,0,et,nt),J.drawImage(it,0,0,et,nt,0,0,et,nt),J.globalCompositeOperation="destination-over",J.fillRect(0,0,et,nt)):(J.globalCompositeOperation="source-over",J.fillRect(0,(st.scales.y.height+st.scales.y.top+ET)*V,et,st.scales.x.height*V))}E.offsetY=$.scrollTop,E.offsetX=$.scrollLeft,M.offset=$.scrollLeft},mt=({width:z,height:$})=>{E.width=z,E.height=$};d.watch(()=>t.orientation,()=>{var z;if(f.value&&yt.value){const $=yt.value.width,V=yt.value.height;((z=f.value)==null?void 0:z.getContext("2d")).clearRect(0,0,$,V)}E.showTooltip=!1,E.interactionMode="idle"}),d.watch(()=>t.annotations,z=>{U.value&&(z?U.value.options.plugins.annotation.annotations=_(t.chartData):delete U.value.options.plugins.annotation.annotations)});const gt=()=>{E.showTooltip&&(E.interactionMode!=="idle"?E.interactionMode="idle":E.interactionMode="interactive")};return(z,$)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",xt[d.unref(v)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,xT),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:$[0]||($[0]=V=>gt()),onScroll:vt},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:q.value,height:Q.value})},[d.createElementVNode("canvas",{id:d.unref(r),ref:"canvas",class:"chart-canvas"},null,8,wT)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[M.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:M.top,left:M.left}),width:"auto"},[d.createElementVNode("div",vT,d.toDisplayString(M.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(ua,{"absolute-left":d.unref(R),"absolute-top":d.unref(C),"chart-parent-ref":l.value,state:E,"tooltip-title":n.tooltipTitle,onDimensions:mt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Al,{id:d.unref(m),"chart-instance":d.unref(U),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
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"};Du._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=ut(n):e==="string"&&(typeof t=="string"?n=aw(n,t,new Date,this.options):n=ch(n,this.options)),To(n)?n.getTime():null},format:function(n,t){return Br(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ko(n,t);case"second":return e_(n,t);case"minute":return J0(n,t);case"hour":return K0(n,t);case"day":return Nr(n,t);case"week":return n_(n,t);case"month":return So(n,t);case"quarter":return t_(n,t);case"year":return i_(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Co(n,t);case"second":return d_(n,t);case"minute":return l_(n,t);case"hour":return o_(n,t);case"day":return Yd(n,t);case"week":return h_(n,t);case"month":return Ud(n,t);case"quarter":return u_(n,t);case"year":return f_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return uw(n);case"minute":return cw(n);case"hour":return lw(n);case"day":return Do(n);case"week":return $e(n);case"isoWeek":return $e(n,{weekStartsOn:+e});case"month":return g_(n);case"quarter":return m_(n);case"year":return qd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return w_(n);case"minute":return __(n);case"hour":return y_(n);case"day":return jd(n);case"week":return b_(n);case"month":return $d(n);case"quarter":return x_(n);case"year":return p_(n);default:return n}}});const km={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},...km,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},ID=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ai(n){return d.isProxy(n)?d.toRaw(n):n}function LD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function ND(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Dm(n,t){n.labels=t}function Tm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(a=>a[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function FD(n,t){const e={labels:[],datasets:[]};return Dm(e,n.labels),Tm(e,n.datasets,t),e}const BD=d.defineComponent({props:RD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const a=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,g=FD(u,m),p=LD(g,u);r.value=new be(s.value,{type:c,data:p,options:{...h},plugins:f})},o=()=>{const c=d.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 d.onMounted(a),d.onUnmounted(o),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,g]=u;const p=d.toRaw(r.value);if(!p)return;let x=!1;if(h){const v=Ai(h),M=Ai(m);v&&v!==M&&(ND(p,v),x=!0)}if(f){const v=Ai(f.labels),M=Ai(g.labels),D=Ai(f.datasets),k=Ai(g.datasets);v!==M&&(Dm(p.config.data,v),x=!0),D&&D!==k&&(Tm(p.config.data,D,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(p)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function Il(n,t){return be.register(t),d.defineComponent({props:km,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),a=o=>{r.value=o==null?void 0:o.chart};return s({chart:r}),()=>d.h(BD,ID({ref:a},{type:n,...e}))}})}const Cm=Il("bar",ns),Em=Il("doughnut",nn),Om=Il("line",is),zD={class:"chart-container"},HD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>on},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=pt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),a=d.useTemplateRef("chartParent"),o=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=pt.useTooltipAbsolutePosition(a,o),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}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((D,k)=>(D.labels.push(k.label),D.backgroundColor.push(k.backgroundColor),D.borderColor.push(Jh(k.backgroundColor,50)),D.data.push(k.data.reduce((E,R)=>E+R,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=pt.useDonutChartOptions({tooltipState:o,legendID:i}),p=d.ref(),x=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],v=({width:M,height:D})=>{o.width=M,o.height=D};return(M,D)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(n.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",zD,[d.createVNode(d.unref(Em),{ref_key:"chartInstance",ref:p,"chart-id":d.unref(s),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(ua,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:o,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Al,{id:d.unref(i),"chart-instance":p.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),WD=Ce(HD,[["__scopeId","data-v-f3942f91"]]),Ll=(n,t,e,i,s="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=s,n.stroke(),n.restore()},me={},YD=()=>{me.x=void 0,me.chart=void 0,me.strategy=void 0,me.group=void 0},VD=10;class Pm{constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){P(this,"id","verticalLinePlugin");P(this,"_clickedSegment");P(this,"_pause",!1);P(this,"_useBrushingState",!1);P(this,"_brushStrategy");P(this,"_brushGroup");P(this,"_lastMouseBrushEvent",0);let s=!1;e==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<VD)return;const s=()=>{me.chart=e,me.strategy=this._brushStrategy,me.group=this._brushGroup;for(const r of Object.values(be.instances))r!==e&&r.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(me.x=e.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(me.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;Ll(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:s}=t.tooltip.dataPoints[0].element;Ll(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(me.x===void 0)return;const e=me.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&me.group===this._brushGroup&&Ll(t.ctx,me.x,t.scales.y.top,t.scales.y.bottom,e)}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(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&me.chart===t){const e=me.x!==void 0;if(YD(),e)for(const i of Object.values(be.instances))i!==t&&i.update("none")}}}const jD=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},$D=(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()},Am=(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(){P(this,"id","dragSelectPlugin");P(this,"_isDragging",!1);P(this,"_startX",0);P(this,"_endX",0);P(this,"_dragTimeout");P(this,"_clearSelectionArea",!0);P(this,"_chart",null);P(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=o=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-l.left},150)},r=o=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-l.left,Am("dragSelectMove",t,this))},a=o=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-l.left,Am("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:a}}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)&&($D(t,this._startX,this._endX),jD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const qD=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const XD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],GD=["gauge","top_n","single_value"],KD=20,ZD="rgba(255, 171, 171, 0.4)",QD="rgba(255, 196, 0, 0.2)",Rm=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},JD=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const o=r.map(c=>({ts:c.x,aboveThreshold:c.y>=a.value}));let l=o[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<o.length;c++)!o[c-1].aboveThreshold&&o[c].aboveThreshold?l=Rm(r[c-1],r[c],a.value):o[c-1].aboveThreshold&&!o[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:Rm(r[c-1],r[c],a.value),type:a.type}),l=void 0);l!==void 0&&e.push({start:l,end:o[o.length-1].ts,type:a.type})})}),e},tT=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class eT{constructor(t){P(this,"id","thresholdPlugin");P(this,"_thresholds");P(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(a=>({...a,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=a=>{var o;if(t){const l=a.clientY,c=t.scales.y,u=s.getBoundingClientRect(),h=c.getValueForPixel(l-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(o=this._thresholds)==null?void 0:o[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<KD})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const a=(s=this._thresholds)==null?void 0:s[r];if(a){a.forEach(c=>{const h=t.scales.y.getPixelForValue(c.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Kr(c.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";c.label?f=`${c.label}: ${c.value}`:c.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:c.value}):c.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:c.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:c.value}),c.hovered&&(i.save(),i.fillStyle=Kr(c.type),i.font=$1,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=JD(t,a);tT(o).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?ZD:QD,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Kr(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const nT=Ce(d.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},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=pt.useI18n(),r=new Pm,a=new vm,o=new UD,l=new eT(s),{translateUnit:c}=pt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),p=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),v=d.ref(void 0),M=d.ref(!1),D=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:k,tooltipAbsoluteTop:E}=pt.useTooltipAbsolutePosition(x,D),R={id:h,afterUpdate(H){m.value=qh(H,e.legendValues,e.chartLegendSortFn)}},C=d.computed(()=>[R,a,...e.brush?[o]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),b=d.computed(()=>`line-${C.value.map(H=>H.id).join("-")}`),_=d.computed(()=>`bar-${C.value.map(H=>H.id).join("-")}`),S=d.computed(()=>e.chartData&&F1(e.chartData)),{options:O}=pt.useLineChartOptions({tooltipState:D,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:S,threshold:d.toRef(e,"threshold")});pt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const A=H=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[H],L=({width:H,height:U})=>{D.width=H,D.height=U},B=(H=!0)=>{D.interactionMode="idle",D.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(H),r.isPaused&&r.resume()},X=()=>{D.interactionMode="interactive"},G=()=>{var H,U;!u.value||!((U=(H=u.value.chart.tooltip)==null?void 0:H.dataPoints)!=null&&U.length)||(D.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},j=()=>{if(M.value){M.value=!1;return}D.interactionMode!=="idle"?B():X(),G()};d.watch(()=>e.type,()=>{D.interactionMode="idle",D.showTooltip=!1,r.destroyClickedSegment()});const lt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(v.value={start:new Date(U),end:new Date(Y),type:"absolute"},D.interactionMode="zoom-interactive",i("select-chart-range",v.value))},q=H=>{D.interactionMode="selecting-chart-area",M.value=!0,r.pause(),a.pause();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(v.value={start:new Date(U),end:new Date(Y),type:"absolute"})},Q=H=>{if(!x.value||D.interactionMode==="idle")return;const U=H.target;U&&x.value.contains(U)||M.value||B(!1)};return d.watch(()=>{var H;return(H=u.value)==null?void 0:H.chart},()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q),u.value.chart.canvas.addEventListener("dragSelect",lt),u.value.chart.canvas.addEventListener("dragSelectMove",q))}),d.onMounted(()=>{document.addEventListener("click",Q,!0)}),d.onUnmounted(()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q)),document.removeEventListener("click",Q,!0)}),(H,U)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",A(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:U[0]||(U[0]=Y=>j())},[n.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Om),{key:b.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:d.unref(O),plugins:C.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Cm),{key:_.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:d.unref(O),plugins:C.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(ua,{ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(k),"absolute-top":d.unref(E),"data-testid":"tooltip",granularity:n.granularity,state:D,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":v.value,onDimensions:L,onOnAction:U[1]||(U[1]=()=>B(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(Al,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-45406bb2"]]),iT={class:"analytics-chart-shell"},sT={key:0,class:"chart-header"},rT={class:"tooltip-content"},aT={key:2,class:"analytics-chart-parent"},oT=d.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},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=pt.useI18n(),r=d.computed(()=>p.value?pt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zr},d.toRef(i,"chartData")).value:pt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zr},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=d.computed(()=>{var L;return(L=i.chartData)!=null&&L.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),l=d.computed(()=>{var L;return(L=i.chartData.meta)!=null&&L.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),c=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=pt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var L,B,X;return((X=(B=(L=i.chartData)==null?void 0:L.meta)==null?void 0:B.limit)==null?void 0:X.toString())||null}),f=d.computed(()=>{var L,B;return((B=(L=i.chartData)==null?void 0:L.meta)==null?void 0:B.truncated)||!1}),m=s.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=d.computed(()=>["timeseries_bar","timeseries_line"].some(L=>L===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),v=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),M=d.computed(()=>{var X,G;if(!((X=i.chartData)!=null&&X.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const L=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[L];if(i.chartData.meta.metric_names.length>1){if(L.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(L.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}if(L)return s.te(`chartLabels.${L}`)?s.t(`chartLabels.${L}`):L}),D=d.computed(()=>{var X,G,j,lt;if((X=i.chartOptions)!=null&&X.metricAxesTitle)return(G=i.chartOptions)==null?void 0:G.metricAxesTitle;if(!((j=i.chartData)!=null&&j.meta.metric_names)||!((lt=i.chartData)!=null&<.meta.metric_units))return;const L=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[L];if(i.chartData.meta.metric_names.length>1){if(L.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(L.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return s.te(`metricAxisTitles.${L}`)&&s.te(`chartUnits.${B}`)?s.t(`metricAxisTitles.${L}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0:L||void 0}),k=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const L=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(L)return s.te(`chartLabels.${L}`)?s.t(`chartLabels.${L}`):L}),E=d.computed(()=>{const L=Uo(Number(i.chartData.meta.granularity_ms));if(L)return s.te(`granularityAxisTitles.${L}`)?s.t(`granularityAxisTitles.${L}`):L}),R=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),C=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),b=d.computed(()=>p.value?B1(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?Uo(i.chartData.meta.granularity_ms)||"hourly":Uo(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),S=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(L,B)=>L.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.text,10))&&!isNaN(parseInt(B.text,10))?L.text<B.text?-1:1:L.value&&B.value?B.value.raw-L.value.raw:0),O=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(L,B)=>L.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.label,10))&&!isNaN(parseInt(B.label,10))?L.label<B.label?-1:1:L.value&&B.value?B.rawValue-L.rawValue:0),A=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:L=>e("zoom-time-range",L)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",c),d.provide("legendPosition",d.toRef(i,"legendPosition")),(L,B)=>{const X=d.resolveComponent("KTooltip"),G=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",iT,[b.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",sT,[d.createVNode(X,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",rT,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Js.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(Y1)})`,size:d.unref(j1)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),b.value?(d.openBlock(),d.createElementBlock("div",aT,[p.value?(d.openBlock(),d.createBlock(nT,{key:0,brush:a.value,"chart-data":r.value,"chart-legend-sort-fn":S.value,"chart-tooltip-sort-fn":O.value,"dimension-axes-title":E.value,fill:n.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":D.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":M.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":A.value,onSelectChartRange:B[0]||(B[0]=j=>e("select-chart-range",j)),onZoomTimeRange:B[1]||(B[1]=j=>e("zoom-time-range",j))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(PD,{key:1,annotations:n.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":S.value,"chart-tooltip-sort-fn":O.value,"data-testid":"bar-chart-container","dimension-axes-title":k.value,"legend-values":d.unref(u),"metric-axes-title":D.value,"metric-unit":l.value,orientation:v.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":M.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(WD,{key:2,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors||d.unref(Zr),"legend-position":n.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":k.value,"tooltip-metric-display":M.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(G,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(R.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(C.value),1)]),_:1}))])}}}),lT=Ce(oT,[["__scopeId","data-v-01aae525"]]),cT={class:"chart-parent","data-testid":"gauge-chart-parent"},uT={class:"chart-totals-flex"},dT={key:1,class:"metric-small","data-testid":"gauge-chart-total"},hT=Ce(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=pt.useI18n(),i=d.ref(da()),s=d.computed(()=>[t.chartData.datasets.reduce((g,p)=>(g.labels.push(p.label),g.borderColor.push(p.backgroundColor),g.backgroundColor.push(p.backgroundColor),g.data.push(p.data.reduce((x,v)=>x+v,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=d.ref(),l=d.computed(()=>{var m;return Rs((m=s==null?void 0:s.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return Rs(((m=s==null?void 0:s.value[0])==null?void 0:m.data[0])+((g=s==null?void 0:s.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=s==null?void 0:s.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",cT,[d.createElementVNode("div",uT,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(l.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",dT,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(Em),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:r.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),fT={class:"chart-parent","data-testid":"single-value-parent"},mT={key:1,class:"single-value-wrapper"},gT={class:"single-value","data-testid":"single-value-chart"},pT={key:0,class:"single-value-unit"},yT=Ce(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Sf}},setup(n){const{i18n:t}=pt.useI18n(),{formatBytes:e}=Es({i18n:t}),i=n,s=d.computed(()=>i.data.data[0]),r=d.computed(()=>{var u,h;return(h=(u=i.data.meta)==null?void 0:u.metric_names)==null?void 0:h[0]}),a=d.computed(()=>{var h,f;const u=r.value?(f=(h=i.data.meta)==null?void 0:h.metric_units)==null?void 0:f[r.value]:void 0;if(u)return t.t(`chartUnits.${u}`,{plural:""})}),o=d.computed(()=>{var u;return r.value==="request_per_minute"||!!((u=r.value)!=null&&u.includes("_latency_"))}),l=d.computed(()=>!s.value||!r.value||typeof s.value.event[r.value]!="number"?null:s.value.event[r.value]),c=d.computed(()=>{var f;const u=l.value;if(u===null)return"";if((f=r.value)!=null&&f.includes("_size_"))return e(u);if(u>=1e9){const m=(u/1e9).toFixed(1);return m.endsWith(".0")?`${Math.floor(u/1e9)}B`:`${m}B`}if(u>=1e7){const m=(u/1e6).toFixed(1);return m.endsWith(".0")?`${Math.floor(u/1e6)}M`:`${m}M`}const h=i.decimalPoints&&typeof i.decimalPoints=="number"?i.decimalPoints:Sf;return u.toLocaleString("en-US",{maximumFractionDigits:h})});return d.onMounted(()=>{var u,h;((h=(u=i.data)==null?void 0:u.data)==null?void 0:h.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",i.data.data.length)}),(u,h)=>{const f=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",fT,[l.value===null?(d.openBlock(),d.createBlock(f,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t).t("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",mT,[d.createElementVNode("span",gT,d.toDisplayString(c.value),1),o.value?(d.openBlock(),d.createElementBlock("span",pT," "+d.toDisplayString(a.value),1)):d.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-8fd9e5ef"]]),bT={class:"simple-chart-shell"},_T={key:1,class:"analytics-chart-parent"},xT=Ce(d.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}=pt.useI18n(),i=d.computed(()=>{var u;const c=pt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=d.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=d.computed(()=>{var u,h;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",bT,[l.value?(d.openBlock(),d.createElementBlock("div",_T,[r.value?(d.openBlock(),d.createBlock(hT,{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"])):d.createCommentVNode("",!0),a.value?(d.openBlock(),d.createBlock(yT,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),wT={class:"top-n-card-title","data-testid":"top-n-card-title"},vT={class:"top-n-card-description","data-testid":"top-n-card-description"},MT={key:3,class:"top-n-table","data-testid":"top-n-table"},ST={class:"table-headings"},kT={class:"table-row"},DT={class:"column-1"},TT={class:"column-2"},CT={class:"table-body","data-testid":"top-n-data"},ET=["data-testid"],OT={class:"column-1"},PT={class:"column-2"},AT=Ce(d.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}=pt.useI18n(),i=d.computed(()=>t.data.data),s=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),r=d.computed(()=>{var g,p;return(g=t.data.meta)!=null&&g.display&&((p=Object.keys(t.data.meta.display))==null?void 0:p[0])||""}),a=d.computed(()=>r.value?t.data.meta.display[r.value]:{}),o=d.computed(()=>{var g,p;return(p=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&p.length?t.data.meta.metric_names[0]:""}),l=d.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=d.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value&&!Object.keys(a.value).length)return e.t("topNTable.errors.display");if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=g=>{const p=g.event;return String(p[r.value])},h=g=>{const p=u(g),x=a.value&&a.value[p];return x?x.name:"-"},f=g=>{const p=u(g),x=a.value&&a.value[p];return x?!!x.deleted:!1},m=g=>{if(!o.value)return"–";const x=g.event[o.value];return x?Rs(x,{capital:!0,round:!0}):"–"};return(g,p)=>{const x=d.resolveComponent("KEmptyState"),v=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},d.createSlots({default:d.withCtx(()=>[c.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c.value),1)]),_:1})):n.isLoading?(d.openBlock(),d.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(d.openBlock(),d.createElementBlock("div",MT,[d.createElementVNode("div",ST,[d.createElementVNode("div",kT,[d.createElementVNode("div",DT,d.toDisplayString(d.unref(e).t("topNTable.nameLabel")),1),d.createElementVNode("div",TT,d.toDisplayString(l.value),1)])]),d.createElementVNode("div",CT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(D,k)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${k}`,class:"table-row","data-testid":`row-${u(D)}`},[d.createElementVNode("div",OT,[d.renderSlot(g.$slots,"name",{record:{id:u(D),name:h(D),deleted:f(D),dimension:r.value}},()=>[d.createTextVNode(d.toDisplayString(h(D)),1)],!0)]),d.createElementVNode("div",PT," "+d.toDisplayString(m(D)),1)],8,ET))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(n.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",wT,d.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",vT,d.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var ha={exports:{}};ha.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,a=2,o=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",p="[object Map]",x="[object Number]",v="[object Object]",M="[object Promise]",D="[object RegExp]",k="[object Set]",E="[object String]",R="[object Symbol]",C="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",S="[object Float32Array]",O="[object Float64Array]",A="[object Int8Array]",L="[object Int16Array]",B="[object Int32Array]",X="[object Uint8Array]",G="[object Uint8ClampedArray]",j="[object Uint16Array]",lt="[object Uint32Array]",q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,H=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,xt=/\\(\\)?/g,yt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,mt={};mt[S]=mt[O]=mt[A]=mt[L]=mt[B]=mt[X]=mt[G]=mt[j]=mt[lt]=!0,mt[l]=mt[c]=mt[b]=mt[u]=mt[_]=mt[h]=mt[f]=mt[m]=mt[p]=mt[x]=mt[v]=mt[D]=mt[k]=mt[E]=mt[C]=!1;var gt=typeof we=="object"&&we&&we.Object===Object&&we,z=typeof self=="object"&&self&&self.Object===Object&&self,$=gt||z||Function("return this")(),V=t&&!t.nodeType&&t,J=V&&!0&&n&&!n.nodeType&&n,et=J&&J.exports===V,nt=et&>.process,st=function(){try{return nt&&nt.binding("util")}catch{}}(),it=st&&st.isTypedArray;function _t(y,T){for(var N=-1,W=y?y.length:0;++N<W;)if(T(y[N],N,y))return!0;return!1}function ct(y){return function(T){return T==null?void 0:T[y]}}function Et(y,T){for(var N=-1,W=Array(y);++N<y;)W[N]=T(N);return W}function te(y){return function(T){return y(T)}}function le(y,T){return y==null?void 0:y[T]}function qt(y){var T=!1;if(y!=null&&typeof y.toString!="function")try{T=!!(y+"")}catch{}return T}function Re(y){var T=-1,N=Array(y.size);return y.forEach(function(W,ht){N[++T]=[ht,W]}),N}function Mt(y,T){return function(N){return y(T(N))}}function Xt(y){var T=-1,N=Array(y.size);return y.forEach(function(W){N[++T]=W}),N}var zt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,Xe=$["__core-js_shared__"],si=function(){var y=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),Be=Gt.toString,Ht=ie.hasOwnProperty,ve=ie.toString,ri=RegExp("^"+Be.call(Ht).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fa=$.Symbol,ma=$.Uint8Array,Ys=ie.propertyIsEnumerable,ai=zt.splice,Vs=Mt(Object.keys,Object),oi=fn($,"DataView"),cn=fn($,"Map"),un=fn($,"Promise"),js=fn($,"Set"),$s=fn($,"WeakMap"),li=fn(Object,"create"),Bl=gn(oi),zl=gn(cn),ga=gn(un),pa=gn(js),dn=gn($s),Ri=fa?fa.prototype:void 0,Us=Ri?Ri.valueOf:void 0,ya=Ri?Ri.toString:void 0;function hn(y){var T=-1,N=y?y.length:0;for(this.clear();++T<N;){var W=y[T];this.set(W[0],W[1])}}function Hl(){this.__data__=li?li(null):{}}function ze(y){return this.has(y)&&delete this.__data__[y]}function Wl(y){var T=this.__data__;if(li){var N=T[y];return N===s?void 0:N}return Ht.call(T,y)?T[y]:void 0}function Yl(y){var T=this.__data__;return li?T[y]!==void 0:Ht.call(T,y)}function Vl(y,T){var N=this.__data__;return N[y]=li&&T===void 0?s:T,this}hn.prototype.clear=Hl,hn.prototype.delete=ze,hn.prototype.get=Wl,hn.prototype.has=Yl,hn.prototype.set=Vl;function He(y){var T=-1,N=y?y.length:0;for(this.clear();++T<N;){var W=y[T];this.set(W[0],W[1])}}function jl(){this.__data__=[]}function In(y){var T=this.__data__,N=Ni(T,y);if(N<0)return!1;var W=T.length-1;return N==W?T.pop():ai.call(T,N,1),!0}function $l(y){var T=this.__data__,N=Ni(T,y);return N<0?void 0:T[N][1]}function Ul(y){return Ni(this.__data__,y)>-1}function ql(y,T){var N=this.__data__,W=Ni(N,y);return W<0?N.push([y,T]):N[W][1]=T,this}He.prototype.clear=jl,He.prototype.delete=In,He.prototype.get=$l,He.prototype.has=Ul,He.prototype.set=ql;function We(y){var T=-1,N=y?y.length:0;for(this.clear();++T<N;){var W=y[T];this.set(W[0],W[1])}}function Xl(){this.__data__={hash:new hn,map:new(cn||He),string:new hn}}function Ln(y){return zi(this,y).delete(y)}function Gl(y){return zi(this,y).get(y)}function Kl(y){return zi(this,y).has(y)}function Zl(y,T){return zi(this,y).set(y,T),this}We.prototype.clear=Xl,We.prototype.delete=Ln,We.prototype.get=Gl,We.prototype.has=Kl,We.prototype.set=Zl;function Ii(y){var T=-1,N=y?y.length:0;for(this.__data__=new We;++T<N;)this.add(y[T])}function Ql(y){return this.__data__.set(y,s),this}function Jl(y){return this.__data__.has(y)}Ii.prototype.add=Ii.prototype.push=Ql,Ii.prototype.has=Jl;function Ie(y){this.__data__=new He(y)}function Li(){this.__data__=new He}function tc(y){return this.__data__.delete(y)}function qs(y){return this.__data__.get(y)}function ec(y){return this.__data__.has(y)}function nc(y,T){var N=this.__data__;if(N instanceof He){var W=N.__data__;if(!cn||W.length<e-1)return W.push([y,T]),this;N=this.__data__=new We(W)}return N.set(y,T),this}Ie.prototype.clear=Li,Ie.prototype.delete=tc,Ie.prototype.get=qs,Ie.prototype.has=ec,Ie.prototype.set=nc;function ic(y,T){var N=w(y)||Sa(y)?Et(y.length,String):[],W=N.length,ht=!!W;for(var Z in y)Ht.call(y,Z)&&!(ht&&(Z=="length"||Gs(Z,W)))&&N.push(Z);return N}function Ni(y,T){for(var N=y.length;N--;)if(Ma(y[N][0],T))return N;return-1}var sc=mc();function rc(y,T){return y&&sc(y,T,ui)}function Fi(y,T){T=Hi(T,y)?[T]:Ge(T);for(var N=0,W=T.length;y!=null&&N<W;)y=y[mn(T[N++])];return N&&N==W?y:void 0}function ac(y){return ve.call(y)}function oc(y,T){return y!=null&&T in Object(y)}function Xs(y,T,N,W,ht){return y===T?!0:y==null||T==null||!Kt(y)&&!Me(T)?y!==y&&T!==T:lc(y,T,Xs,N,W,ht)}function lc(y,T,N,W,ht,Z){var bt=w(y),Zt=w(T),Wt=c,ue=c;bt||(Wt=ce(y),Wt=Wt==l?v:Wt),Zt||(ue=ce(T),ue=ue==l?v:ue);var Se=Wt==v&&!qt(y),ke=ue==v&&!qt(T),ge=Wt==ue;if(ge&&!Se)return Z||(Z=new Ie),bt||ka(y)?xa(y,T,N,W,ht,Z):gc(y,T,Wt,N,W,ht,Z);if(!(ht&a)){var Le=Se&&Ht.call(y,"__wrapped__"),Ne=ke&&Ht.call(T,"__wrapped__");if(Le||Ne){var Bn=Le?y.value():y,pn=Ne?T.value():T;return Z||(Z=new Ie),N(Bn,pn,W,ht,Z)}}return ge?(Z||(Z=new Ie),pc(y,T,N,W,ht,Z)):!1}function cc(y,T,N,W){var ht=N.length,Z=ht;if(y==null)return!Z;for(y=Object(y);ht--;){var bt=N[ht];if(bt[2]?bt[1]!==y[bt[0]]:!(bt[0]in y))return!1}for(;++ht<Z;){bt=N[ht];var Zt=bt[0],Wt=y[Zt],ue=bt[1];if(bt[2]){if(Wt===void 0&&!(Zt in y))return!1}else{var Se=new Ie,ke;if(!(ke===void 0?Xs(ue,Wt,W,r|a,Se):ke))return!1}}return!0}function uc(y){if(!Kt(y)||wa(y))return!1;var T=K(y)||qt(y)?ri:yt;return T.test(gn(y))}function dc(y){return Me(y)&&jt(y.length)&&!!mt[ve.call(y)]}function ba(y){return typeof y=="function"?y:y==null?Wi:typeof y=="object"?w(y)?Bi(y[0],y[1]):fc(y):SC(y)}function hc(y){if(!_c(y))return Vs(y);var T=[];for(var N in Object(y))Ht.call(y,N)&&N!="constructor"&&T.push(N);return T}function fc(y){var T=yc(y);return T.length==1&&T[0][2]?Zs(T[0][0],T[0][1]):function(N){return N===y||cc(N,y,T)}}function Bi(y,T){return Hi(y)&&va(T)?Zs(mn(y),T):function(N){var W=Da(N,y);return W===void 0&&W===T?Ta(N,y):Xs(T,W,void 0,r|a)}}function Nn(y){return function(T){return Fi(T,y)}}function _a(y){if(typeof y=="string")return y;if(ee(y))return ya?ya.call(y):"";var T=y+"";return T=="0"&&1/y==-1/0?"-0":T}function Ge(y){return w(y)?y:xc(y)}function mc(y){return function(T,N,W){for(var ht=-1,Z=Object(T),bt=W(T),Zt=bt.length;Zt--;){var Wt=bt[++ht];if(N(Z[Wt],Wt,Z)===!1)break}return T}}function xa(y,T,N,W,ht,Z){var bt=ht&a,Zt=y.length,Wt=T.length;if(Zt!=Wt&&!(bt&&Wt>Zt))return!1;var ue=Z.get(y);if(ue&&Z.get(T))return ue==T;var Se=-1,ke=!0,ge=ht&r?new Ii:void 0;for(Z.set(y,T),Z.set(T,y);++Se<Zt;){var Le=y[Se],Ne=T[Se];if(W)var Bn=bt?W(Ne,Le,Se,T,y,Z):W(Le,Ne,Se,y,T,Z);if(Bn!==void 0){if(Bn)continue;ke=!1;break}if(ge){if(!_t(T,function(pn,di){if(!ge.has(di)&&(Le===pn||N(Le,pn,W,ht,Z)))return ge.add(di)})){ke=!1;break}}else if(!(Le===Ne||N(Le,Ne,W,ht,Z))){ke=!1;break}}return Z.delete(y),Z.delete(T),ke}function gc(y,T,N,W,ht,Z,bt){switch(N){case _:if(y.byteLength!=T.byteLength||y.byteOffset!=T.byteOffset)return!1;y=y.buffer,T=T.buffer;case b:return!(y.byteLength!=T.byteLength||!W(new ma(y),new ma(T)));case u:case h:case x:return Ma(+y,+T);case f:return y.name==T.name&&y.message==T.message;case D:case E:return y==T+"";case p:var Zt=Re;case k:var Wt=Z&a;if(Zt||(Zt=Xt),y.size!=T.size&&!Wt)return!1;var ue=bt.get(y);if(ue)return ue==T;Z|=r,bt.set(y,T);var Se=xa(Zt(y),Zt(T),W,ht,Z,bt);return bt.delete(y),Se;case R:if(Us)return Us.call(y)==Us.call(T)}return!1}function pc(y,T,N,W,ht,Z){var bt=ht&a,Zt=ui(y),Wt=Zt.length,ue=ui(T),Se=ue.length;if(Wt!=Se&&!bt)return!1;for(var ke=Wt;ke--;){var ge=Zt[ke];if(!(bt?ge in T:Ht.call(T,ge)))return!1}var Le=Z.get(y);if(Le&&Z.get(T))return Le==T;var Ne=!0;Z.set(y,T),Z.set(T,y);for(var Bn=bt;++ke<Wt;){ge=Zt[ke];var pn=y[ge],di=T[ge];if(W)var Wm=bt?W(di,pn,ge,T,y,Z):W(pn,di,ge,y,T,Z);if(!(Wm===void 0?pn===di||N(pn,di,W,ht,Z):Wm)){Ne=!1;break}Bn||(Bn=ge=="constructor")}if(Ne&&!Bn){var Ca=y.constructor,Ea=T.constructor;Ca!=Ea&&"constructor"in y&&"constructor"in T&&!(typeof Ca=="function"&&Ca instanceof Ca&&typeof Ea=="function"&&Ea instanceof Ea)&&(Ne=!1)}return Z.delete(y),Z.delete(T),Ne}function zi(y,T){var N=y.__data__;return Ks(T)?N[typeof T=="string"?"string":"hash"]:N.map}function yc(y){for(var T=ui(y),N=T.length;N--;){var W=T[N],ht=y[W];T[N]=[W,ht,va(ht)]}return T}function fn(y,T){var N=le(y,T);return uc(N)?N:void 0}var ce=ac;(oi&&ce(new oi(new ArrayBuffer(1)))!=_||cn&&ce(new cn)!=p||un&&ce(un.resolve())!=M||js&&ce(new js)!=k||$s&&ce(new $s)!=C)&&(ce=function(y){var T=ve.call(y),N=T==v?y.constructor:void 0,W=N?gn(N):void 0;if(W)switch(W){case Bl:return _;case zl:return p;case ga:return M;case pa:return k;case dn:return C}return T});function bc(y,T,N){T=Hi(T,y)?[T]:Ge(T);for(var W,ht=-1,bt=T.length;++ht<bt;){var Z=mn(T[ht]);if(!(W=y!=null&&N(y,Z)))break;y=y[Z]}if(W)return W;var bt=y?y.length:0;return!!bt&&jt(bt)&&Gs(Z,bt)&&(w(y)||Sa(y))}function Gs(y,T){return T=T??o,!!T&&(typeof y=="number"||vt.test(y))&&y>-1&&y%1==0&&y<T}function Hi(y,T){if(w(y))return!1;var N=typeof y;return N=="number"||N=="symbol"||N=="boolean"||y==null||ee(y)?!0:Q.test(y)||!q.test(y)||T!=null&&y in Object(T)}function Ks(y){var T=typeof y;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?y!=="__proto__":y===null}function wa(y){return!!si&&si in y}function _c(y){var T=y&&y.constructor,N=typeof T=="function"&&T.prototype||ie;return y===N}function va(y){return y===y&&!Kt(y)}function Zs(y,T){return function(N){return N==null?!1:N[y]===T&&(T!==void 0||y in Object(N))}}var xc=ci(function(y){y=Fn(y);var T=[];return H.test(y)&&T.push(""),y.replace(U,function(N,W,ht,Z){T.push(ht?Z.replace(xt,"$1"):W||N)}),T});function mn(y){if(typeof y=="string"||ee(y))return y;var T=y+"";return T=="0"&&1/y==-1/0?"-0":T}function gn(y){if(y!=null){try{return Be.call(y)}catch{}try{return y+""}catch{}}return""}function ci(y,T){if(typeof y!="function"||T&&typeof T!="function")throw new TypeError(i);var N=function(){var W=arguments,ht=T?T.apply(this,W):W[0],Z=N.cache;if(Z.has(ht))return Z.get(ht);var bt=y.apply(this,W);return N.cache=Z.set(ht,bt),bt};return N.cache=new(ci.Cache||We),N}ci.Cache=We;function Ma(y,T){return y===T||y!==y&&T!==T}function Sa(y){return F(y)&&Ht.call(y,"callee")&&(!Ys.call(y,"callee")||ve.call(y)==l)}var w=Array.isArray;function I(y){return y!=null&&jt(y.length)&&!K(y)}function F(y){return Me(y)&&I(y)}function K(y){var T=Kt(y)?ve.call(y):"";return T==m||T==g}function jt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=o}function Kt(y){var T=typeof y;return!!y&&(T=="object"||T=="function")}function Me(y){return!!y&&typeof y=="object"}function ee(y){return typeof y=="symbol"||Me(y)&&ve.call(y)==R}var ka=it?te(it):dc;function Fn(y){return y==null?"":_a(y)}function Da(y,T,N){var W=y==null?void 0:Fi(y,T);return W===void 0?N:W}function Ta(y,T){return y!=null&&bc(y,T,oc)}function ui(y){return I(y)?ic(y):hc(y)}function Qs(y,T){var N={};return T=ba(T),rc(y,function(W,ht,Z){N[T(W,ht,Z)]=W}),N}function Wi(y){return y}function SC(y){return Hi(y)?ct(mn(y)):Nn(y)}n.exports=Qs}(ha,ha.exports);var RT=ha.exports;const IT=gl(RT);var LT=9007199254740991,NT="[object Arguments]",FT="[object Function]",BT="[object GeneratorFunction]",zT="[object Symbol]",HT=typeof we=="object"&&we&&we.Object===Object&&we,WT=typeof self=="object"&&self&&self.Object===Object&&self,YT=HT||WT||Function("return this")();function VT(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 jT(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 $T(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var Nl=Object.prototype,UT=Nl.hasOwnProperty,Fl=Nl.toString,Im=YT.Symbol,qT=Nl.propertyIsEnumerable,Lm=Im?Im.isConcatSpreadable:void 0,Nm=Math.max;function XT(n,t,e,i,s){var r=-1,a=n.length;for(e||(e=QT),s||(s=[]);++r<a;){var o=n[r];e(o)?$T(s,o):s[s.length]=o}return s}function GT(n,t){return n=Object(n),KT(n,t,function(e,i){return i in n})}function KT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var a=t[i],o=n[a];e(o,a)&&(r[a]=o)}return r}function ZT(n,t){return t=Nm(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Nm(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=e[i];return a[t]=r,VT(n,this,a)}}function QT(n){return eC(n)||tC(n)||!!(Lm&&n&&n[Lm])}function JT(n){if(typeof n=="string"||oC(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function tC(n){return iC(n)&&UT.call(n,"callee")&&(!qT.call(n,"callee")||Fl.call(n)==NT)}var eC=Array.isArray;function nC(n){return n!=null&&rC(n.length)&&!sC(n)}function iC(n){return Fm(n)&&nC(n)}function sC(n){var t=aC(n)?Fl.call(n):"";return t==FT||t==BT}function rC(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=LT}function aC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Fm(n){return!!n&&typeof n=="object"}function oC(n){return typeof n=="symbol"||Fm(n)&&Fl.call(n)==zT}var lC=ZT(function(n,t){return n==null?{}:GT(n,jT(XT(t),JT))}),cC=lC;const uC=gl(cC);var Bm={exports:{}};(function(n,t){(function(e,i){i()})(we,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,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},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 a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof we=="object"&&we.global===we?we:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,h){var f=a.URL||a.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||m&&g||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var D=x.result;D=p?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},x.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,M=v.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){v.revokeObjectURL(M)},4e4)}});a.saveAs=l.saveAs=l,n.exports=l})})(Bm);var dC=Bm.exports,zm={exports:{}};/* @license
|
|
28
|
+
*/const AT={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"};Tu._date.override({_id:"date-fns",formats:function(){return AT},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=ut(n):e==="string"&&(typeof t=="string"?n=aw(n,t,new Date,this.options):n=ch(n,this.options)),Do(n)?n.getTime():null},format:function(n,t){return Br(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ko(n,t);case"second":return e_(n,t);case"minute":return J0(n,t);case"hour":return K0(n,t);case"day":return Nr(n,t);case"week":return n_(n,t);case"month":return So(n,t);case"quarter":return t_(n,t);case"year":return i_(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Co(n,t);case"second":return d_(n,t);case"minute":return l_(n,t);case"hour":return o_(n,t);case"day":return Yd(n,t);case"week":return h_(n,t);case"month":return Ud(n,t);case"quarter":return u_(n,t);case"year":return f_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return uw(n);case"minute":return cw(n);case"hour":return lw(n);case"day":return To(n);case"week":return $e(n);case"isoWeek":return $e(n,{weekStartsOn:+e});case"month":return g_(n);case"quarter":return m_(n);case"year":return qd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return w_(n);case"minute":return __(n);case"hour":return y_(n);case"day":return jd(n);case"week":return b_(n);case"month":return $d(n);case"quarter":return x_(n);case"year":return p_(n);default:return n}}});const km={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},RT={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...km,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},IT=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ai(n){return d.isProxy(n)?d.toRaw(n):n}function LT(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function NT(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Tm(n,t){n.labels=t}function Dm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(a=>a[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function FT(n,t){const e={labels:[],datasets:[]};return Tm(e,n.labels),Dm(e,n.datasets,t),e}const BT=d.defineComponent({props:RT,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const a=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,g=FT(u,m),p=LT(g,u);r.value=new be(s.value,{type:c,data:p,options:{...h},plugins:f})},o=()=>{const c=d.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 d.onMounted(a),d.onUnmounted(o),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,g]=u;const p=d.toRaw(r.value);if(!p)return;let x=!1;if(h){const v=Ai(h),M=Ai(m);v&&v!==M&&(NT(p,v),x=!0)}if(f){const v=Ai(f.labels),M=Ai(g.labels),T=Ai(f.datasets),k=Ai(g.datasets);v!==M&&(Tm(p.config.data,v),x=!0),T&&T!==k&&(Dm(p.config.data,T,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(p)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function Il(n,t){return be.register(t),d.defineComponent({props:km,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),a=o=>{r.value=o==null?void 0:o.chart};return s({chart:r}),()=>d.h(BT,IT({ref:a},{type:n,...e}))}})}const Cm=Il("bar",ns),Em=Il("doughnut",nn),Om=Il("line",is),zT={class:"chart-container"},HT=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>on},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=pt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),a=d.useTemplateRef("chartParent"),o=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=pt.useTooltipAbsolutePosition(a,o),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((T,k)=>(T.labels.push(k.label),T.backgroundColor.push(k.backgroundColor),T.borderColor.push(Jh(k.backgroundColor,50)),T.data.push(k.data.reduce((E,R)=>E+R,0)),T),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=pt.useDonutChartOptions({tooltipState:o,legendID:i}),p=d.ref(),x=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],v=({width:M,height:T})=>{o.width=M,o.height=T};return(M,T)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(n.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",zT,[d.createVNode(d.unref(Em),{ref_key:"chartInstance",ref:p,"chart-id":d.unref(s),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(ua,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:o,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Al,{id:d.unref(i),"chart-instance":p.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),WT=Ce(HT,[["__scopeId","data-v-f3942f91"]]),Ll=(n,t,e,i,s="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=s,n.stroke(),n.restore()},me={},YT=()=>{me.x=void 0,me.chart=void 0,me.strategy=void 0,me.group=void 0},VT=10;class Pm{constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){P(this,"id","verticalLinePlugin");P(this,"_clickedSegment");P(this,"_pause",!1);P(this,"_useBrushingState",!1);P(this,"_brushStrategy");P(this,"_brushGroup");P(this,"_lastMouseBrushEvent",0);let s=!1;e==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<VT)return;const s=()=>{me.chart=e,me.strategy=this._brushStrategy,me.group=this._brushGroup;for(const r of Object.values(be.instances))r!==e&&r.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(me.x=e.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(me.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;Ll(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:s}=t.tooltip.dataPoints[0].element;Ll(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(me.x===void 0)return;const e=me.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&me.group===this._brushGroup&&Ll(t.ctx,me.x,t.scales.y.top,t.scales.y.bottom,e)}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(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&me.chart===t){const e=me.x!==void 0;if(YT(),e)for(const i of Object.values(be.instances))i!==t&&i.update("none")}}}const jT=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},$T=(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()},Am=(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 UT{constructor(){P(this,"id","dragSelectPlugin");P(this,"_isDragging",!1);P(this,"_startX",0);P(this,"_endX",0);P(this,"_dragTimeout");P(this,"_clearSelectionArea",!0);P(this,"_chart",null);P(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=o=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-l.left},150)},r=o=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-l.left,Am("dragSelectMove",t,this))},a=o=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-l.left,Am("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:a}}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)&&($T(t,this._startX,this._endX),jT(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const qT=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const XT=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],GT=["gauge","top_n","single_value"],KT=20,ZT="rgba(255, 171, 171, 0.4)",QT="rgba(255, 196, 0, 0.2)",Rm=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},JT=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const o=r.map(c=>({ts:c.x,aboveThreshold:c.y>=a.value}));let l=o[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<o.length;c++)!o[c-1].aboveThreshold&&o[c].aboveThreshold?l=Rm(r[c-1],r[c],a.value):o[c-1].aboveThreshold&&!o[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:Rm(r[c-1],r[c],a.value),type:a.type}),l=void 0);l!==void 0&&e.push({start:l,end:o[o.length-1].ts,type:a.type})})}),e},tD=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class eD{constructor(t){P(this,"id","thresholdPlugin");P(this,"_thresholds");P(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(a=>({...a,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=a=>{var o;if(t){const l=a.clientY,c=t.scales.y,u=s.getBoundingClientRect(),h=c.getValueForPixel(l-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(o=this._thresholds)==null?void 0:o[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<KT})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const a=(s=this._thresholds)==null?void 0:s[r];if(a){a.forEach(c=>{const h=t.scales.y.getPixelForValue(c.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Kr(c.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";c.label?f=`${c.label}: ${c.value}`:c.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:c.value}):c.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:c.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:c.value}),c.hovered&&(i.save(),i.fillStyle=Kr(c.type),i.font=$1,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=JT(t,a);tD(o).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?ZT:QT,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Kr(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const nD=Ce(d.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},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=pt.useI18n(),r=new Pm,a=new vm,o=new UT,l=new eD(s),{translateUnit:c}=pt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),p=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),v=d.ref(void 0),M=d.ref(!1),T=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:k,tooltipAbsoluteTop:E}=pt.useTooltipAbsolutePosition(x,T),R={id:h,afterUpdate(H){m.value=qh(H,e.legendValues,e.chartLegendSortFn)}},C=d.computed(()=>[R,a,...e.brush?[o]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),b=d.computed(()=>`line-${C.value.map(H=>H.id).join("-")}`),_=d.computed(()=>`bar-${C.value.map(H=>H.id).join("-")}`),S=d.computed(()=>e.chartData&&F1(e.chartData)),{options:O}=pt.useLineChartOptions({tooltipState:T,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:S,threshold:d.toRef(e,"threshold")});pt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const A=H=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[H],L=({width:H,height:U})=>{T.width=H,T.height=U},B=(H=!0)=>{T.interactionMode="idle",T.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(H),r.isPaused&&r.resume()},X=()=>{T.interactionMode="interactive"},G=()=>{var H,U;!u.value||!((U=(H=u.value.chart.tooltip)==null?void 0:H.dataPoints)!=null&&U.length)||(T.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},j=()=>{if(M.value){M.value=!1;return}T.interactionMode!=="idle"?B():X(),G()};d.watch(()=>e.type,()=>{T.interactionMode="idle",T.showTooltip=!1,r.destroyClickedSegment()});const lt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(v.value={start:new Date(U),end:new Date(Y),type:"absolute"},T.interactionMode="zoom-interactive",i("select-chart-range",v.value))},q=H=>{T.interactionMode="selecting-chart-area",M.value=!0,r.pause(),a.pause();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(v.value={start:new Date(U),end:new Date(Y),type:"absolute"})},Q=H=>{if(!x.value||T.interactionMode==="idle")return;const U=H.target;U&&x.value.contains(U)||M.value||B(!1)};return d.watch(()=>{var H;return(H=u.value)==null?void 0:H.chart},()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q),u.value.chart.canvas.addEventListener("dragSelect",lt),u.value.chart.canvas.addEventListener("dragSelectMove",q))}),d.onMounted(()=>{document.addEventListener("click",Q,!0)}),d.onUnmounted(()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q)),document.removeEventListener("click",Q,!0)}),(H,U)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",A(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:U[0]||(U[0]=Y=>j())},[n.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Om),{key:b.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:d.unref(O),plugins:C.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Cm),{key:_.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:d.unref(O),plugins:C.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(ua,{ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(k),"absolute-top":d.unref(E),"data-testid":"tooltip",granularity:n.granularity,state:T,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":v.value,onDimensions:L,onOnAction:U[1]||(U[1]=()=>B(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(Al,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-45406bb2"]]),iD={class:"analytics-chart-shell"},sD={key:0,class:"chart-header"},rD={class:"tooltip-content"},aD={key:2,class:"analytics-chart-parent"},oD=d.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},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=pt.useI18n(),r=d.computed(()=>p.value?pt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zr},d.toRef(i,"chartData")).value:pt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zr},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=d.computed(()=>{var L;return(L=i.chartData)!=null&&L.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),l=d.computed(()=>{var L;return(L=i.chartData.meta)!=null&&L.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),c=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=pt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var L,B,X;return((X=(B=(L=i.chartData)==null?void 0:L.meta)==null?void 0:B.limit)==null?void 0:X.toString())||null}),f=d.computed(()=>{var L,B;return((B=(L=i.chartData)==null?void 0:L.meta)==null?void 0:B.truncated)||!1}),m=s.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=d.computed(()=>["timeseries_bar","timeseries_line"].some(L=>L===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),v=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),M=d.computed(()=>{var X,G;if(!((X=i.chartData)!=null&&X.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const L=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[L];if(i.chartData.meta.metric_names.length>1){if(L.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(L.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}if(L)return s.te(`chartLabels.${L}`)?s.t(`chartLabels.${L}`):L}),T=d.computed(()=>{var X,G,j,lt;if((X=i.chartOptions)!=null&&X.metricAxesTitle)return(G=i.chartOptions)==null?void 0:G.metricAxesTitle;if(!((j=i.chartData)!=null&&j.meta.metric_names)||!((lt=i.chartData)!=null&<.meta.metric_units))return;const L=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[L];if(i.chartData.meta.metric_names.length>1){if(L.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(L.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return s.te(`metricAxisTitles.${L}`)&&s.te(`chartUnits.${B}`)?s.t(`metricAxisTitles.${L}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0:L||void 0}),k=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const L=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(L)return s.te(`chartLabels.${L}`)?s.t(`chartLabels.${L}`):L}),E=d.computed(()=>{const L=Uo(Number(i.chartData.meta.granularity_ms));if(L)return s.te(`granularityAxisTitles.${L}`)?s.t(`granularityAxisTitles.${L}`):L}),R=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),C=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),b=d.computed(()=>p.value?B1(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?Uo(i.chartData.meta.granularity_ms)||"hourly":Uo(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),S=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(L,B)=>L.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.text,10))&&!isNaN(parseInt(B.text,10))?L.text<B.text?-1:1:L.value&&B.value?B.value.raw-L.value.raw:0),O=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(L,B)=>L.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.label,10))&&!isNaN(parseInt(B.label,10))?L.label<B.label?-1:1:L.value&&B.value?B.rawValue-L.rawValue:0),A=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:L=>e("zoom-time-range",L)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",c),d.provide("legendPosition",d.toRef(i,"legendPosition")),(L,B)=>{const X=d.resolveComponent("KTooltip"),G=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",iD,[b.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",sD,[d.createVNode(X,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",rD,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Js.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(Y1)})`,size:d.unref(j1)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),b.value?(d.openBlock(),d.createElementBlock("div",aD,[p.value?(d.openBlock(),d.createBlock(nD,{key:0,brush:a.value,"chart-data":r.value,"chart-legend-sort-fn":S.value,"chart-tooltip-sort-fn":O.value,"dimension-axes-title":E.value,fill:n.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":M.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":A.value,onSelectChartRange:B[0]||(B[0]=j=>e("select-chart-range",j)),onZoomTimeRange:B[1]||(B[1]=j=>e("zoom-time-range",j))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(PT,{key:1,annotations:n.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":S.value,"chart-tooltip-sort-fn":O.value,"data-testid":"bar-chart-container","dimension-axes-title":k.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,orientation:v.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":M.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(WT,{key:2,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors||d.unref(Zr),"legend-position":n.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":k.value,"tooltip-metric-display":M.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(G,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(R.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(C.value),1)]),_:1}))])}}}),lD=Ce(oD,[["__scopeId","data-v-01aae525"]]),cD={class:"chart-parent","data-testid":"gauge-chart-parent"},uD={class:"chart-totals-flex"},dD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},hD=Ce(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=pt.useI18n(),i=d.ref(da()),s=d.computed(()=>[t.chartData.datasets.reduce((g,p)=>(g.labels.push(p.label),g.borderColor.push(p.backgroundColor),g.backgroundColor.push(p.backgroundColor),g.data.push(p.data.reduce((x,v)=>x+v,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=d.ref(),l=d.computed(()=>{var m;return Rs((m=s==null?void 0:s.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return Rs(((m=s==null?void 0:s.value[0])==null?void 0:m.data[0])+((g=s==null?void 0:s.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=s==null?void 0:s.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",cD,[d.createElementVNode("div",uD,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(l.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",dD,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(Em),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:r.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),fD={class:"chart-parent","data-testid":"single-value-parent"},mD={key:1,class:"single-value-wrapper"},gD={class:"single-value","data-testid":"single-value-chart"},pD={key:0,class:"single-value-unit"},yD=Ce(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Sf}},setup(n){const{i18n:t}=pt.useI18n(),{formatBytes:e}=Es({i18n:t}),i=n,s=d.computed(()=>i.data.data[0]),r=d.computed(()=>{var u,h;return(h=(u=i.data.meta)==null?void 0:u.metric_names)==null?void 0:h[0]}),a=d.computed(()=>{var h,f;const u=r.value?(f=(h=i.data.meta)==null?void 0:h.metric_units)==null?void 0:f[r.value]:void 0;if(u)return t.t(`chartUnits.${u}`,{plural:""})}),o=d.computed(()=>{var u;return r.value==="request_per_minute"||!!((u=r.value)!=null&&u.includes("_latency_"))}),l=d.computed(()=>!s.value||!r.value||typeof s.value.event[r.value]!="number"?null:s.value.event[r.value]),c=d.computed(()=>{var f;const u=l.value;if(u===null)return"";if((f=r.value)!=null&&f.includes("_size_"))return e(u);if(u>=1e9){const m=(u/1e9).toFixed(1);return m.endsWith(".0")?`${Math.floor(u/1e9)}B`:`${m}B`}if(u>=1e7){const m=(u/1e6).toFixed(1);return m.endsWith(".0")?`${Math.floor(u/1e6)}M`:`${m}M`}const h=i.decimalPoints&&typeof i.decimalPoints=="number"?i.decimalPoints:Sf;return u.toLocaleString("en-US",{maximumFractionDigits:h})});return d.onMounted(()=>{var u,h;((h=(u=i.data)==null?void 0:u.data)==null?void 0:h.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",i.data.data.length)}),(u,h)=>{const f=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",fD,[l.value===null?(d.openBlock(),d.createBlock(f,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t).t("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",mD,[d.createElementVNode("span",gD,d.toDisplayString(c.value),1),o.value?(d.openBlock(),d.createElementBlock("span",pD," "+d.toDisplayString(a.value),1)):d.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-8fd9e5ef"]]),bD={class:"simple-chart-shell"},_D={key:1,class:"analytics-chart-parent"},xD=Ce(d.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}=pt.useI18n(),i=d.computed(()=>{var u;const c=pt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=d.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=d.computed(()=>{var u,h;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",bD,[l.value?(d.openBlock(),d.createElementBlock("div",_D,[r.value?(d.openBlock(),d.createBlock(hD,{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"])):d.createCommentVNode("",!0),a.value?(d.openBlock(),d.createBlock(yD,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),wD={class:"top-n-card-title","data-testid":"top-n-card-title"},vD={class:"top-n-card-description","data-testid":"top-n-card-description"},MD={key:3,class:"top-n-table","data-testid":"top-n-table"},SD={class:"table-headings"},kD={class:"table-row"},TD={class:"column-1"},DD={class:"column-2"},CD={class:"table-body","data-testid":"top-n-data"},ED=["data-testid"],OD={class:"column-1"},PD={class:"column-2"},AD=Ce(d.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}=pt.useI18n(),i=d.computed(()=>t.data.data),s=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),r=d.computed(()=>{var g,p;return(g=t.data.meta)!=null&&g.display&&((p=Object.keys(t.data.meta.display))==null?void 0:p[0])||""}),a=d.computed(()=>r.value?t.data.meta.display[r.value]:{}),o=d.computed(()=>{var g,p;return(p=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&p.length?t.data.meta.metric_names[0]:""}),l=d.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=d.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value&&!Object.keys(a.value).length)return e.t("topNTable.errors.display");if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=g=>{const p=g.event;return String(p[r.value])},h=g=>{const p=u(g),x=a.value&&a.value[p];return x?x.name:"-"},f=g=>{const p=u(g),x=a.value&&a.value[p];return x?!!x.deleted:!1},m=g=>{if(!o.value)return"–";const x=g.event[o.value];return x?Rs(x,{capital:!0,round:!0}):"–"};return(g,p)=>{const x=d.resolveComponent("KEmptyState"),v=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},d.createSlots({default:d.withCtx(()=>[c.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c.value),1)]),_:1})):n.isLoading?(d.openBlock(),d.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(d.openBlock(),d.createElementBlock("div",MD,[d.createElementVNode("div",SD,[d.createElementVNode("div",kD,[d.createElementVNode("div",TD,d.toDisplayString(d.unref(e).t("topNTable.nameLabel")),1),d.createElementVNode("div",DD,d.toDisplayString(l.value),1)])]),d.createElementVNode("div",CD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(T,k)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${k}`,class:"table-row","data-testid":`row-${u(T)}`},[d.createElementVNode("div",OD,[d.renderSlot(g.$slots,"name",{record:{id:u(T),name:h(T),deleted:f(T),dimension:r.value}},()=>[d.createTextVNode(d.toDisplayString(h(T)),1)],!0)]),d.createElementVNode("div",PD," "+d.toDisplayString(m(T)),1)],8,ED))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(n.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",wD,d.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",vD,d.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var ha={exports:{}};ha.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,a=2,o=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",p="[object Map]",x="[object Number]",v="[object Object]",M="[object Promise]",T="[object RegExp]",k="[object Set]",E="[object String]",R="[object Symbol]",C="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",S="[object Float32Array]",O="[object Float64Array]",A="[object Int8Array]",L="[object Int16Array]",B="[object Int32Array]",X="[object Uint8Array]",G="[object Uint8ClampedArray]",j="[object Uint16Array]",lt="[object Uint32Array]",q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,H=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,xt=/\\(\\)?/g,yt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,mt={};mt[S]=mt[O]=mt[A]=mt[L]=mt[B]=mt[X]=mt[G]=mt[j]=mt[lt]=!0,mt[l]=mt[c]=mt[b]=mt[u]=mt[_]=mt[h]=mt[f]=mt[m]=mt[p]=mt[x]=mt[v]=mt[T]=mt[k]=mt[E]=mt[C]=!1;var gt=typeof we=="object"&&we&&we.Object===Object&&we,z=typeof self=="object"&&self&&self.Object===Object&&self,$=gt||z||Function("return this")(),V=t&&!t.nodeType&&t,J=V&&!0&&n&&!n.nodeType&&n,et=J&&J.exports===V,nt=et&>.process,st=function(){try{return nt&&nt.binding("util")}catch{}}(),it=st&&st.isTypedArray;function _t(y,D){for(var N=-1,W=y?y.length:0;++N<W;)if(D(y[N],N,y))return!0;return!1}function ct(y){return function(D){return D==null?void 0:D[y]}}function Et(y,D){for(var N=-1,W=Array(y);++N<y;)W[N]=D(N);return W}function te(y){return function(D){return y(D)}}function le(y,D){return y==null?void 0:y[D]}function qt(y){var D=!1;if(y!=null&&typeof y.toString!="function")try{D=!!(y+"")}catch{}return D}function Re(y){var D=-1,N=Array(y.size);return y.forEach(function(W,ht){N[++D]=[ht,W]}),N}function Mt(y,D){return function(N){return y(D(N))}}function Xt(y){var D=-1,N=Array(y.size);return y.forEach(function(W){N[++D]=W}),N}var zt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,Xe=$["__core-js_shared__"],si=function(){var y=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),Be=Gt.toString,Ht=ie.hasOwnProperty,ve=ie.toString,ri=RegExp("^"+Be.call(Ht).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fa=$.Symbol,ma=$.Uint8Array,Ys=ie.propertyIsEnumerable,ai=zt.splice,Vs=Mt(Object.keys,Object),oi=fn($,"DataView"),cn=fn($,"Map"),un=fn($,"Promise"),js=fn($,"Set"),$s=fn($,"WeakMap"),li=fn(Object,"create"),Bl=gn(oi),zl=gn(cn),ga=gn(un),pa=gn(js),dn=gn($s),Ri=fa?fa.prototype:void 0,Us=Ri?Ri.valueOf:void 0,ya=Ri?Ri.toString:void 0;function hn(y){var D=-1,N=y?y.length:0;for(this.clear();++D<N;){var W=y[D];this.set(W[0],W[1])}}function Hl(){this.__data__=li?li(null):{}}function ze(y){return this.has(y)&&delete this.__data__[y]}function Wl(y){var D=this.__data__;if(li){var N=D[y];return N===s?void 0:N}return Ht.call(D,y)?D[y]:void 0}function Yl(y){var D=this.__data__;return li?D[y]!==void 0:Ht.call(D,y)}function Vl(y,D){var N=this.__data__;return N[y]=li&&D===void 0?s:D,this}hn.prototype.clear=Hl,hn.prototype.delete=ze,hn.prototype.get=Wl,hn.prototype.has=Yl,hn.prototype.set=Vl;function He(y){var D=-1,N=y?y.length:0;for(this.clear();++D<N;){var W=y[D];this.set(W[0],W[1])}}function jl(){this.__data__=[]}function In(y){var D=this.__data__,N=Ni(D,y);if(N<0)return!1;var W=D.length-1;return N==W?D.pop():ai.call(D,N,1),!0}function $l(y){var D=this.__data__,N=Ni(D,y);return N<0?void 0:D[N][1]}function Ul(y){return Ni(this.__data__,y)>-1}function ql(y,D){var N=this.__data__,W=Ni(N,y);return W<0?N.push([y,D]):N[W][1]=D,this}He.prototype.clear=jl,He.prototype.delete=In,He.prototype.get=$l,He.prototype.has=Ul,He.prototype.set=ql;function We(y){var D=-1,N=y?y.length:0;for(this.clear();++D<N;){var W=y[D];this.set(W[0],W[1])}}function Xl(){this.__data__={hash:new hn,map:new(cn||He),string:new hn}}function Ln(y){return zi(this,y).delete(y)}function Gl(y){return zi(this,y).get(y)}function Kl(y){return zi(this,y).has(y)}function Zl(y,D){return zi(this,y).set(y,D),this}We.prototype.clear=Xl,We.prototype.delete=Ln,We.prototype.get=Gl,We.prototype.has=Kl,We.prototype.set=Zl;function Ii(y){var D=-1,N=y?y.length:0;for(this.__data__=new We;++D<N;)this.add(y[D])}function Ql(y){return this.__data__.set(y,s),this}function Jl(y){return this.__data__.has(y)}Ii.prototype.add=Ii.prototype.push=Ql,Ii.prototype.has=Jl;function Ie(y){this.__data__=new He(y)}function Li(){this.__data__=new He}function tc(y){return this.__data__.delete(y)}function qs(y){return this.__data__.get(y)}function ec(y){return this.__data__.has(y)}function nc(y,D){var N=this.__data__;if(N instanceof He){var W=N.__data__;if(!cn||W.length<e-1)return W.push([y,D]),this;N=this.__data__=new We(W)}return N.set(y,D),this}Ie.prototype.clear=Li,Ie.prototype.delete=tc,Ie.prototype.get=qs,Ie.prototype.has=ec,Ie.prototype.set=nc;function ic(y,D){var N=w(y)||Sa(y)?Et(y.length,String):[],W=N.length,ht=!!W;for(var Z in y)Ht.call(y,Z)&&!(ht&&(Z=="length"||Gs(Z,W)))&&N.push(Z);return N}function Ni(y,D){for(var N=y.length;N--;)if(Ma(y[N][0],D))return N;return-1}var sc=mc();function rc(y,D){return y&&sc(y,D,ui)}function Fi(y,D){D=Hi(D,y)?[D]:Ge(D);for(var N=0,W=D.length;y!=null&&N<W;)y=y[mn(D[N++])];return N&&N==W?y:void 0}function ac(y){return ve.call(y)}function oc(y,D){return y!=null&&D in Object(y)}function Xs(y,D,N,W,ht){return y===D?!0:y==null||D==null||!Kt(y)&&!Me(D)?y!==y&&D!==D:lc(y,D,Xs,N,W,ht)}function lc(y,D,N,W,ht,Z){var bt=w(y),Zt=w(D),Wt=c,ue=c;bt||(Wt=ce(y),Wt=Wt==l?v:Wt),Zt||(ue=ce(D),ue=ue==l?v:ue);var Se=Wt==v&&!qt(y),ke=ue==v&&!qt(D),ge=Wt==ue;if(ge&&!Se)return Z||(Z=new Ie),bt||ka(y)?xa(y,D,N,W,ht,Z):gc(y,D,Wt,N,W,ht,Z);if(!(ht&a)){var Le=Se&&Ht.call(y,"__wrapped__"),Ne=ke&&Ht.call(D,"__wrapped__");if(Le||Ne){var Bn=Le?y.value():y,pn=Ne?D.value():D;return Z||(Z=new Ie),N(Bn,pn,W,ht,Z)}}return ge?(Z||(Z=new Ie),pc(y,D,N,W,ht,Z)):!1}function cc(y,D,N,W){var ht=N.length,Z=ht;if(y==null)return!Z;for(y=Object(y);ht--;){var bt=N[ht];if(bt[2]?bt[1]!==y[bt[0]]:!(bt[0]in y))return!1}for(;++ht<Z;){bt=N[ht];var Zt=bt[0],Wt=y[Zt],ue=bt[1];if(bt[2]){if(Wt===void 0&&!(Zt in y))return!1}else{var Se=new Ie,ke;if(!(ke===void 0?Xs(ue,Wt,W,r|a,Se):ke))return!1}}return!0}function uc(y){if(!Kt(y)||wa(y))return!1;var D=K(y)||qt(y)?ri:yt;return D.test(gn(y))}function dc(y){return Me(y)&&jt(y.length)&&!!mt[ve.call(y)]}function ba(y){return typeof y=="function"?y:y==null?Wi:typeof y=="object"?w(y)?Bi(y[0],y[1]):fc(y):SC(y)}function hc(y){if(!_c(y))return Vs(y);var D=[];for(var N in Object(y))Ht.call(y,N)&&N!="constructor"&&D.push(N);return D}function fc(y){var D=yc(y);return D.length==1&&D[0][2]?Zs(D[0][0],D[0][1]):function(N){return N===y||cc(N,y,D)}}function Bi(y,D){return Hi(y)&&va(D)?Zs(mn(y),D):function(N){var W=Ta(N,y);return W===void 0&&W===D?Da(N,y):Xs(D,W,void 0,r|a)}}function Nn(y){return function(D){return Fi(D,y)}}function _a(y){if(typeof y=="string")return y;if(ee(y))return ya?ya.call(y):"";var D=y+"";return D=="0"&&1/y==-1/0?"-0":D}function Ge(y){return w(y)?y:xc(y)}function mc(y){return function(D,N,W){for(var ht=-1,Z=Object(D),bt=W(D),Zt=bt.length;Zt--;){var Wt=bt[++ht];if(N(Z[Wt],Wt,Z)===!1)break}return D}}function xa(y,D,N,W,ht,Z){var bt=ht&a,Zt=y.length,Wt=D.length;if(Zt!=Wt&&!(bt&&Wt>Zt))return!1;var ue=Z.get(y);if(ue&&Z.get(D))return ue==D;var Se=-1,ke=!0,ge=ht&r?new Ii:void 0;for(Z.set(y,D),Z.set(D,y);++Se<Zt;){var Le=y[Se],Ne=D[Se];if(W)var Bn=bt?W(Ne,Le,Se,D,y,Z):W(Le,Ne,Se,y,D,Z);if(Bn!==void 0){if(Bn)continue;ke=!1;break}if(ge){if(!_t(D,function(pn,di){if(!ge.has(di)&&(Le===pn||N(Le,pn,W,ht,Z)))return ge.add(di)})){ke=!1;break}}else if(!(Le===Ne||N(Le,Ne,W,ht,Z))){ke=!1;break}}return Z.delete(y),Z.delete(D),ke}function gc(y,D,N,W,ht,Z,bt){switch(N){case _:if(y.byteLength!=D.byteLength||y.byteOffset!=D.byteOffset)return!1;y=y.buffer,D=D.buffer;case b:return!(y.byteLength!=D.byteLength||!W(new ma(y),new ma(D)));case u:case h:case x:return Ma(+y,+D);case f:return y.name==D.name&&y.message==D.message;case T:case E:return y==D+"";case p:var Zt=Re;case k:var Wt=Z&a;if(Zt||(Zt=Xt),y.size!=D.size&&!Wt)return!1;var ue=bt.get(y);if(ue)return ue==D;Z|=r,bt.set(y,D);var Se=xa(Zt(y),Zt(D),W,ht,Z,bt);return bt.delete(y),Se;case R:if(Us)return Us.call(y)==Us.call(D)}return!1}function pc(y,D,N,W,ht,Z){var bt=ht&a,Zt=ui(y),Wt=Zt.length,ue=ui(D),Se=ue.length;if(Wt!=Se&&!bt)return!1;for(var ke=Wt;ke--;){var ge=Zt[ke];if(!(bt?ge in D:Ht.call(D,ge)))return!1}var Le=Z.get(y);if(Le&&Z.get(D))return Le==D;var Ne=!0;Z.set(y,D),Z.set(D,y);for(var Bn=bt;++ke<Wt;){ge=Zt[ke];var pn=y[ge],di=D[ge];if(W)var Wm=bt?W(di,pn,ge,D,y,Z):W(pn,di,ge,y,D,Z);if(!(Wm===void 0?pn===di||N(pn,di,W,ht,Z):Wm)){Ne=!1;break}Bn||(Bn=ge=="constructor")}if(Ne&&!Bn){var Ca=y.constructor,Ea=D.constructor;Ca!=Ea&&"constructor"in y&&"constructor"in D&&!(typeof Ca=="function"&&Ca instanceof Ca&&typeof Ea=="function"&&Ea instanceof Ea)&&(Ne=!1)}return Z.delete(y),Z.delete(D),Ne}function zi(y,D){var N=y.__data__;return Ks(D)?N[typeof D=="string"?"string":"hash"]:N.map}function yc(y){for(var D=ui(y),N=D.length;N--;){var W=D[N],ht=y[W];D[N]=[W,ht,va(ht)]}return D}function fn(y,D){var N=le(y,D);return uc(N)?N:void 0}var ce=ac;(oi&&ce(new oi(new ArrayBuffer(1)))!=_||cn&&ce(new cn)!=p||un&&ce(un.resolve())!=M||js&&ce(new js)!=k||$s&&ce(new $s)!=C)&&(ce=function(y){var D=ve.call(y),N=D==v?y.constructor:void 0,W=N?gn(N):void 0;if(W)switch(W){case Bl:return _;case zl:return p;case ga:return M;case pa:return k;case dn:return C}return D});function bc(y,D,N){D=Hi(D,y)?[D]:Ge(D);for(var W,ht=-1,bt=D.length;++ht<bt;){var Z=mn(D[ht]);if(!(W=y!=null&&N(y,Z)))break;y=y[Z]}if(W)return W;var bt=y?y.length:0;return!!bt&&jt(bt)&&Gs(Z,bt)&&(w(y)||Sa(y))}function Gs(y,D){return D=D??o,!!D&&(typeof y=="number"||vt.test(y))&&y>-1&&y%1==0&&y<D}function Hi(y,D){if(w(y))return!1;var N=typeof y;return N=="number"||N=="symbol"||N=="boolean"||y==null||ee(y)?!0:Q.test(y)||!q.test(y)||D!=null&&y in Object(D)}function Ks(y){var D=typeof y;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?y!=="__proto__":y===null}function wa(y){return!!si&&si in y}function _c(y){var D=y&&y.constructor,N=typeof D=="function"&&D.prototype||ie;return y===N}function va(y){return y===y&&!Kt(y)}function Zs(y,D){return function(N){return N==null?!1:N[y]===D&&(D!==void 0||y in Object(N))}}var xc=ci(function(y){y=Fn(y);var D=[];return H.test(y)&&D.push(""),y.replace(U,function(N,W,ht,Z){D.push(ht?Z.replace(xt,"$1"):W||N)}),D});function mn(y){if(typeof y=="string"||ee(y))return y;var D=y+"";return D=="0"&&1/y==-1/0?"-0":D}function gn(y){if(y!=null){try{return Be.call(y)}catch{}try{return y+""}catch{}}return""}function ci(y,D){if(typeof y!="function"||D&&typeof D!="function")throw new TypeError(i);var N=function(){var W=arguments,ht=D?D.apply(this,W):W[0],Z=N.cache;if(Z.has(ht))return Z.get(ht);var bt=y.apply(this,W);return N.cache=Z.set(ht,bt),bt};return N.cache=new(ci.Cache||We),N}ci.Cache=We;function Ma(y,D){return y===D||y!==y&&D!==D}function Sa(y){return F(y)&&Ht.call(y,"callee")&&(!Ys.call(y,"callee")||ve.call(y)==l)}var w=Array.isArray;function I(y){return y!=null&&jt(y.length)&&!K(y)}function F(y){return Me(y)&&I(y)}function K(y){var D=Kt(y)?ve.call(y):"";return D==m||D==g}function jt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=o}function Kt(y){var D=typeof y;return!!y&&(D=="object"||D=="function")}function Me(y){return!!y&&typeof y=="object"}function ee(y){return typeof y=="symbol"||Me(y)&&ve.call(y)==R}var ka=it?te(it):dc;function Fn(y){return y==null?"":_a(y)}function Ta(y,D,N){var W=y==null?void 0:Fi(y,D);return W===void 0?N:W}function Da(y,D){return y!=null&&bc(y,D,oc)}function ui(y){return I(y)?ic(y):hc(y)}function Qs(y,D){var N={};return D=ba(D),rc(y,function(W,ht,Z){N[D(W,ht,Z)]=W}),N}function Wi(y){return y}function SC(y){return Hi(y)?ct(mn(y)):Nn(y)}n.exports=Qs}(ha,ha.exports);var RD=ha.exports;const ID=gl(RD);var LD=9007199254740991,ND="[object Arguments]",FD="[object Function]",BD="[object GeneratorFunction]",zD="[object Symbol]",HD=typeof we=="object"&&we&&we.Object===Object&&we,WD=typeof self=="object"&&self&&self.Object===Object&&self,YD=HD||WD||Function("return this")();function VD(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 jD(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 $D(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var Nl=Object.prototype,UD=Nl.hasOwnProperty,Fl=Nl.toString,Im=YD.Symbol,qD=Nl.propertyIsEnumerable,Lm=Im?Im.isConcatSpreadable:void 0,Nm=Math.max;function XD(n,t,e,i,s){var r=-1,a=n.length;for(e||(e=QD),s||(s=[]);++r<a;){var o=n[r];e(o)?$D(s,o):s[s.length]=o}return s}function GD(n,t){return n=Object(n),KD(n,t,function(e,i){return i in n})}function KD(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var a=t[i],o=n[a];e(o,a)&&(r[a]=o)}return r}function ZD(n,t){return t=Nm(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Nm(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=e[i];return a[t]=r,VD(n,this,a)}}function QD(n){return eC(n)||tC(n)||!!(Lm&&n&&n[Lm])}function JD(n){if(typeof n=="string"||oC(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function tC(n){return iC(n)&&UD.call(n,"callee")&&(!qD.call(n,"callee")||Fl.call(n)==ND)}var eC=Array.isArray;function nC(n){return n!=null&&rC(n.length)&&!sC(n)}function iC(n){return Fm(n)&&nC(n)}function sC(n){var t=aC(n)?Fl.call(n):"";return t==FD||t==BD}function rC(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=LD}function aC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Fm(n){return!!n&&typeof n=="object"}function oC(n){return typeof n=="symbol"||Fm(n)&&Fl.call(n)==zD}var lC=ZD(function(n,t){return n==null?{}:GD(n,jD(XD(t),JD))}),cC=lC;const uC=gl(cC);var Bm={exports:{}};(function(n,t){(function(e,i){i()})(we,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,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},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 a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof we=="object"&&we.global===we?we:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,h){var f=a.URL||a.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||m&&g||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var T=x.result;T=p?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=T:location=T,f=null},x.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,M=v.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){v.revokeObjectURL(M)},4e4)}});a.saveAs=l.saveAs=l,n.exports=l})})(Bm);var dC=Bm.exports,zm={exports:{}};/* @license
|
|
29
29
|
Papa Parse
|
|
30
30
|
v5.5.3
|
|
31
31
|
https://github.com/mholt/PapaParse
|
|
@@ -37,7 +37,7 @@ License: MIT
|
|
|
37
37
|
`:"\r"}}function x(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(b){var _=(b=b||{}).delimiter,S=b.newline,O=b.comments,A=b.step,L=b.preview,B=b.fastMode,X=null,G=!1,j=b.quoteChar==null?'"':b.quoteChar,lt=j;if(b.escapeChar!==void 0&&(lt=b.escapeChar),(typeof _!="string"||-1<c.BAD_DELIMITERS.indexOf(_))&&(_=","),O===_)throw new Error("Comment character same as delimiter");O===!0?O="#":(typeof O!="string"||-1<c.BAD_DELIMITERS.indexOf(O))&&(O=!1),S!==`
|
|
38
38
|
`&&S!=="\r"&&S!==`\r
|
|
39
39
|
`&&(S=`
|
|
40
|
-
`);var q=0,Q=!1;this.parse=function(H,U,Y){if(typeof H!="string")throw new Error("Input must be a string");var xt=H.length,yt=_.length,vt=S.length,mt=O.length,gt=C(A),z=[],$=[],V=[],J=q=0;if(!H)return Mt();if(B||B!==!1&&H.indexOf(j)===-1){for(var et=H.split(S),nt=0;nt<et.length;nt++){if(V=et[nt],q+=V.length,nt!==et.length-1)q+=S.length;else if(Y)return Mt();if(!O||V.substring(0,mt)!==O){if(gt){if(z=[],te(V.split(_)),Xt(),Q)return Mt()}else te(V.split(_));if(L&&L<=nt)return z=z.slice(0,L),Mt(!0)}}return Mt()}for(var st=H.indexOf(_,q),it=H.indexOf(S,q),_t=new RegExp(x(lt)+x(j),"g"),ct=H.indexOf(j,q);;)if(H[q]===j)for(ct=q,q++;;){if((ct=H.indexOf(j,ct+1))===-1)return Y||$.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:q}),qt();if(ct===xt-1)return qt(H.substring(q,ct).replace(_t,j));if(j===lt&&H[ct+1]===lt)ct++;else if(j===lt||ct===0||H[ct-1]!==lt){st!==-1&&st<ct+1&&(st=H.indexOf(_,ct+1));var Et=le((it=it!==-1&&it<ct+1?H.indexOf(S,ct+1):it)===-1?st:Math.min(st,it));if(H.substr(ct+1+Et,yt)===_){V.push(H.substring(q,ct).replace(_t,j)),H[q=ct+1+Et+yt]!==j&&(ct=H.indexOf(j,q)),st=H.indexOf(_,q),it=H.indexOf(S,q);break}if(Et=le(it),H.substring(ct+1+Et,ct+1+Et+vt)===S){if(V.push(H.substring(q,ct).replace(_t,j)),Re(ct+1+Et+vt),st=H.indexOf(_,q),ct=H.indexOf(j,q),gt&&(Xt(),Q))return Mt();if(L&&z.length>=L)return Mt(!0);break}$.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:q}),ct++}}else if(O&&V.length===0&&H.substring(q,q+mt)===O){if(it===-1)return Mt();q=it+vt,it=H.indexOf(S,q),st=H.indexOf(_,q)}else if(st!==-1&&(st<it||it===-1))V.push(H.substring(q,st)),q=st+yt,st=H.indexOf(_,q);else{if(it===-1)break;if(V.push(H.substring(q,it)),Re(it+vt),gt&&(Xt(),Q))return Mt();if(L&&z.length>=L)return Mt(!0)}return qt();function te(zt){z.push(zt),J=q}function le(zt){var Gt=0;return Gt=zt!==-1&&(zt=H.substring(ct+1,zt))&&zt.trim()===""?zt.length:Gt}function qt(zt){return Y||(zt===void 0&&(zt=H.substring(q)),V.push(zt),q=xt,te(V),gt&&Xt()),Mt()}function Re(zt){q=zt,te(V),V=[],it=H.indexOf(S,q)}function Mt(zt){if(b.header&&!U&&z.length&&!G){var Gt=z[0],ie=Object.create(null),Xe=new Set(Gt);let si=!1;for(let Be=0;Be<Gt.length;Be++){let Ht=Gt[Be];if(ie[Ht=C(b.transformHeader)?b.transformHeader(Ht,Be):Ht]){let ve,ri=ie[Ht];for(;ve=Ht+"_"+ri,ri++,Xe.has(ve););Xe.add(ve),Gt[Be]=ve,ie[Ht]++,si=!0,(X=X===null?{}:X)[ve]=Ht}else ie[Ht]=1,Gt[Be]=Ht;Xe.add(Ht)}si&&console.warn("Duplicate headers found and renamed."),G=!0}return{data:z,errors:$,meta:{delimiter:_,linebreak:S,aborted:Q,truncated:!!zt,cursor:J+(U||0),renamedHeaders:X}}}function Xt(){A(Mt()),z=[],$=[]}},this.abort=function(){Q=!0},this.getCharIndex=function(){return q}}function M(b){var _=b.data,S=o[_.workerId],O=!1;if(_.error)S.userError(_.error,_.file);else if(_.results&&_.results.data){var A={abort:function(){O=!0,
|
|
40
|
+
`);var q=0,Q=!1;this.parse=function(H,U,Y){if(typeof H!="string")throw new Error("Input must be a string");var xt=H.length,yt=_.length,vt=S.length,mt=O.length,gt=C(A),z=[],$=[],V=[],J=q=0;if(!H)return Mt();if(B||B!==!1&&H.indexOf(j)===-1){for(var et=H.split(S),nt=0;nt<et.length;nt++){if(V=et[nt],q+=V.length,nt!==et.length-1)q+=S.length;else if(Y)return Mt();if(!O||V.substring(0,mt)!==O){if(gt){if(z=[],te(V.split(_)),Xt(),Q)return Mt()}else te(V.split(_));if(L&&L<=nt)return z=z.slice(0,L),Mt(!0)}}return Mt()}for(var st=H.indexOf(_,q),it=H.indexOf(S,q),_t=new RegExp(x(lt)+x(j),"g"),ct=H.indexOf(j,q);;)if(H[q]===j)for(ct=q,q++;;){if((ct=H.indexOf(j,ct+1))===-1)return Y||$.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:q}),qt();if(ct===xt-1)return qt(H.substring(q,ct).replace(_t,j));if(j===lt&&H[ct+1]===lt)ct++;else if(j===lt||ct===0||H[ct-1]!==lt){st!==-1&&st<ct+1&&(st=H.indexOf(_,ct+1));var Et=le((it=it!==-1&&it<ct+1?H.indexOf(S,ct+1):it)===-1?st:Math.min(st,it));if(H.substr(ct+1+Et,yt)===_){V.push(H.substring(q,ct).replace(_t,j)),H[q=ct+1+Et+yt]!==j&&(ct=H.indexOf(j,q)),st=H.indexOf(_,q),it=H.indexOf(S,q);break}if(Et=le(it),H.substring(ct+1+Et,ct+1+Et+vt)===S){if(V.push(H.substring(q,ct).replace(_t,j)),Re(ct+1+Et+vt),st=H.indexOf(_,q),ct=H.indexOf(j,q),gt&&(Xt(),Q))return Mt();if(L&&z.length>=L)return Mt(!0);break}$.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:q}),ct++}}else if(O&&V.length===0&&H.substring(q,q+mt)===O){if(it===-1)return Mt();q=it+vt,it=H.indexOf(S,q),st=H.indexOf(_,q)}else if(st!==-1&&(st<it||it===-1))V.push(H.substring(q,st)),q=st+yt,st=H.indexOf(_,q);else{if(it===-1)break;if(V.push(H.substring(q,it)),Re(it+vt),gt&&(Xt(),Q))return Mt();if(L&&z.length>=L)return Mt(!0)}return qt();function te(zt){z.push(zt),J=q}function le(zt){var Gt=0;return Gt=zt!==-1&&(zt=H.substring(ct+1,zt))&&zt.trim()===""?zt.length:Gt}function qt(zt){return Y||(zt===void 0&&(zt=H.substring(q)),V.push(zt),q=xt,te(V),gt&&Xt()),Mt()}function Re(zt){q=zt,te(V),V=[],it=H.indexOf(S,q)}function Mt(zt){if(b.header&&!U&&z.length&&!G){var Gt=z[0],ie=Object.create(null),Xe=new Set(Gt);let si=!1;for(let Be=0;Be<Gt.length;Be++){let Ht=Gt[Be];if(ie[Ht=C(b.transformHeader)?b.transformHeader(Ht,Be):Ht]){let ve,ri=ie[Ht];for(;ve=Ht+"_"+ri,ri++,Xe.has(ve););Xe.add(ve),Gt[Be]=ve,ie[Ht]++,si=!0,(X=X===null?{}:X)[ve]=Ht}else ie[Ht]=1,Gt[Be]=Ht;Xe.add(Ht)}si&&console.warn("Duplicate headers found and renamed."),G=!0}return{data:z,errors:$,meta:{delimiter:_,linebreak:S,aborted:Q,truncated:!!zt,cursor:J+(U||0),renamedHeaders:X}}}function Xt(){A(Mt()),z=[],$=[]}},this.abort=function(){Q=!0},this.getCharIndex=function(){return q}}function M(b){var _=b.data,S=o[_.workerId],O=!1;if(_.error)S.userError(_.error,_.file);else if(_.results&&_.results.data){var A={abort:function(){O=!0,T(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(C(S.userStep)){for(var L=0;L<_.results.data.length&&(S.userStep({data:_.results.data[L],errors:_.results.errors,meta:_.results.meta},A),!O);L++);delete _.results}else C(S.userChunk)&&(S.userChunk(_.results,A,_.file),delete _.results)}_.finished&&!O&&T(_.workerId,_.results)}function T(b,_){var S=o[b];C(S.userComplete)&&S.userComplete(_),S.terminate(),delete o[b]}function k(){throw new Error("Not implemented.")}function E(b){if(typeof b!="object"||b===null)return b;var _,S=Array.isArray(b)?[]:{};for(_ in b)S[_]=E(b[_]);return S}function R(b,_){return function(){b.apply(_,arguments)}}function C(b){return typeof b=="function"}return c.parse=function(b,_){var S=(_=_||{}).dynamicTyping||!1;if(C(S)&&(_.dynamicTypingFunction=S,S={}),_.dynamicTyping=S,_.transform=!!C(_.transform)&&_.transform,!_.worker||!c.WORKERS_SUPPORTED)return S=null,c.NODE_STREAM_INPUT,typeof b=="string"?(b=(O=>O.charCodeAt(0)!==65279?O:O.slice(1))(b),S=new(_.download?h:m)(_)):b.readable===!0&&C(b.read)&&C(b.on)?S=new g(_):(i.File&&b instanceof File||b instanceof Object)&&(S=new f(_)),S.stream(b);(S=(()=>{var O;return!!c.WORKERS_SUPPORTED&&(O=(()=>{var A=i.URL||i.webkitURL||null,L=e.toString();return c.BLOB_URL||(c.BLOB_URL=A.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; ","(",L,")();"],{type:"text/javascript"})))})(),(O=new i.Worker(O)).onmessage=M,O.id=l++,o[O.id]=O)})()).userStep=_.step,S.userChunk=_.chunk,S.userComplete=_.complete,S.userError=_.error,_.step=C(_.step),_.chunk=C(_.chunk),_.complete=C(_.complete),_.error=C(_.error),delete _.worker,S.postMessage({input:b,config:_,workerId:S.id})},c.unparse=function(b,_){var S=!1,O=!0,A=",",L=`\r
|
|
41
41
|
`,B='"',X=B+B,G=!1,j=null,lt=!1,q=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||c.BAD_DELIMITERS.filter(function(U){return _.delimiter.indexOf(U)!==-1}).length||(A=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(S=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(G=_.skipEmptyLines),typeof _.newline=="string"&&(L=_.newline),typeof _.quoteChar=="string"&&(B=_.quoteChar),typeof _.header=="boolean"&&(O=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");j=_.columns}_.escapeChar!==void 0&&(X=_.escapeChar+B),_.escapeFormulae instanceof RegExp?lt=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(lt=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(B),"g"));if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return Q(null,b,G);if(typeof b[0]=="object")return Q(j||Object.keys(b[0]),b,G)}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||j),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])),Q(b.fields||[],b.data||[],G);throw new Error("Unable to serialize unrecognized input");function Q(U,Y,xt){var yt="",vt=(typeof U=="string"&&(U=JSON.parse(U)),typeof Y=="string"&&(Y=JSON.parse(Y)),Array.isArray(U)&&0<U.length),mt=!Array.isArray(Y[0]);if(vt&&O){for(var gt=0;gt<U.length;gt++)0<gt&&(yt+=A),yt+=H(U[gt],gt);0<Y.length&&(yt+=L)}for(var z=0;z<Y.length;z++){var $=(vt?U:Y[z]).length,V=!1,J=vt?Object.keys(Y[z]).length===0:Y[z].length===0;if(xt&&!vt&&(V=xt==="greedy"?Y[z].join("").trim()==="":Y[z].length===1&&Y[z][0].length===0),xt==="greedy"&&vt){for(var et=[],nt=0;nt<$;nt++){var st=mt?U[nt]:nt;et.push(Y[z][st])}V=et.join("").trim()===""}if(!V){for(var it=0;it<$;it++){0<it&&!J&&(yt+=A);var _t=vt&&mt?U[it]:it;yt+=H(Y[z][_t],it)}z<Y.length-1&&(!xt||0<$&&!J)&&(yt+=L)}}return yt}function H(U,Y){var xt,yt;return U==null?"":U.constructor===Date?JSON.stringify(U).slice(1,25):(yt=!1,lt&&typeof U=="string"&<.test(U)&&(U="'"+U,yt=!0),xt=U.toString().replace(q,X),(yt=yt||S===!0||typeof S=="function"&&S(U,Y)||Array.isArray(S)&&S[Y]||((vt,mt)=>{for(var gt=0;gt<mt.length;gt++)if(-1<vt.indexOf(mt[gt]))return!0;return!1})(xt,c.BAD_DELIMITERS)||-1<xt.indexOf(A)||xt.charAt(0)===" "||xt.charAt(xt.length-1)===" ")?B+xt+B: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=p,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=g,i.jQuery&&((s=i.jQuery).fn.parse=function(b){var _=b.config||{},S=[];return this.each(function(L){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 B=0;B<this.files.length;B++)S.push({file:this.files[B],inputElem:this,instanceConfig:s.extend({},_)})}),O(),this;function O(){if(S.length===0)C(b.complete)&&b.complete();else{var L,B,X,G,j=S[0];if(C(b.before)){var lt=b.before(j.file,j.inputElem);if(typeof lt=="object"){if(lt.action==="abort")return L="AbortError",B=j.file,X=j.inputElem,G=lt.reason,void(C(b.error)&&b.error({name:L},B,X,G));if(lt.action==="skip")return void A();typeof lt.config=="object"&&(j.instanceConfig=s.extend(j.instanceConfig,lt.config))}else if(lt==="skip")return void A()}var q=j.instanceConfig.complete;j.instanceConfig.complete=function(Q){C(q)&&q(Q,j.file,j.inputElem),A()},c.parse(j.file,j.instanceConfig)}}function A(){S.splice(0,1),O()}}),a&&(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})}),(h.prototype=Object.create(u.prototype)).constructor=h,(f.prototype=Object.create(u.prototype)).constructor=f,(m.prototype=Object.create(m.prototype)).constructor=m,(g.prototype=Object.create(u.prototype)).constructor=g,c})})(zm);var hC=zm.exports;const fC=["id"],mC=d.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=d.computed(()=>`export_${new Date().getTime()}`),r=d.computed(()=>{const u=l();return u.length?u:null}),a=()=>{const u=i.labels;if(typeof i.fields!==ii.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ii.Object?h=>
|
|
43
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});dC.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(n.filename),1)])],8,fC))}}),gC=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(mC,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),pC={class:"kong-ui-public-csv-export-modal"},yC={key:0,class:"selected-range"},bC={key:4,class:"text-muted",tag:"span"},Hm=3,_C=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=pt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=d.ref(1),o=d.computed(()=>f.value.rows.length),l=d.computed(()=>{var g,p;return i.exportState.status==="success"&&!!((p=(g=i.exportState.chartData)==null?void 0:g.data)!=null&&p.length)}),c=d.computed(()=>i.exportState.status!=="success"?"":pt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(Hm,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{var E,R,C;if(i.exportState.status!=="success"||!l.value||!((E=i.exportState.chartData)!=null&&E.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,p=g.data.some(b=>b.timestamp!==g.data[0].timestamp),x=g.data.map(b=>{const _=new Date(b.timestamp);return{...Object.keys(b.event).reduce((O,A)=>{if(A in g.meta.display){const L=b.event[A],B=g.meta.display[A];O[A]=L&&B&&B[L].name||b.event[A]}else O[A]=b.event[A];return O},{}),...p?{timestamp:dl(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:dl(_,"XXX")}:{}}});let v=[];p&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.exportState.chartData.meta&&((R=i.exportState.chartData.meta)!=null&&R.display)?(C=i.exportState.chartData.meta)==null?void 0:C.display:{},D=[...v,...Object.keys(M).map(b=>({label:e.t(`chartLabels.${b}`),key:b})),...i.exportState.chartData.meta.metric_names.map(b=>({label:e.t(`chartLabels.${b}`),key:b}))],k=D.reduce((b,_)=>(b[_.key]=_.label,b),{});return{headers:D,csvHeaders:k,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:g}=f.value;return{total:Number(g.length)||0,data:g.slice(0,Hm)}};return d.watch(f,()=>{a.value++}),(g,p)=>{const x=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KEmptyState"),M=d.resolveComponent("KTableData"),D=d.resolveComponent("KTooltip"),k=d.resolveComponent("KButton"),E=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",pC,[d.createVNode(E,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var R;return[d.createElementVNode("div",null,[n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",yC,[d.createElementVNode("p",null,d.toDisplayString(n.modalDescription?n.modalDescription:d.unref(e).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),n.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(d.openBlock(),d.createBlock(M,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((R=f.value)==null?void 0:R.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(v,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(d.openBlock(),d.createBlock(v,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",bC,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(D,{class:"preview-tooltip",placement:"right",text:d.unref(e).t("csvExport.maximumRecordAmount",{value:d.unref(Ew)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Js.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Zo)})`,size:d.unref(Qo)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(k,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(gC,{class:"vitals-report-export-button",filename:r,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(k,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),xC={class:"container"},wC={key:0,class:"no-data","data-testId":"sparkline-empty"},vC=["title"],MC=Ce(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=pt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:r,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:l,syncedChartDatasets:c}=pt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:C,height:b})=>{u.width=C,u.height=b},f=d.computed(()=>n.disableTooltip?[]:[new Pm({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),m=d.computed(()=>c.value.reduce((C,{data:b,label:_})=>({...C,[_]:b.reduce((S,{y:O})=>S+O,0)}),{})),g=d.computed(()=>c.value.map(({label:C})=>[m.value[C],`${C}: ${m.value[C]}`]).sort(([C],[b])=>b-C).map(([,C])=>C).join(", ")),p=d.computed(()=>Object.keys(m.value).map(C=>m.value[C]).reduce((C,b)=>C+b,0)),x=d.computed(()=>p.value>0),v=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),M=d.computed(()=>n.datasets.length>1),D=`SparklineTooltipPosition-${t}`,k=d.computed(()=>{const C=n.type==="sparkline_bar",b=C?s.value-1:s.value,_=C?r.value:r.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:C?0:2,right:C?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:D,external:S=>{$h(u,S,"minutely",{contextFormatter:O=>{const A=O+i.value;let L="";return i.value>24*60*60*1e3?L=Br(new Date(A),"MMM dd, yyy hh:mm a"):L=Br(new Date(A),"hh:mm a"),`${$o(O)} - ${L}`}})}}},scales:{x:{min:b,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:M.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:M.value}}}}),E=d.ref("0"),R=d.ref("0");return d.onMounted(()=>{Te.positioners[D]=function(C,b){if(!C.length||u.interactionMode==="interactive")return!1;const _=10,S=this.chart.canvas.getBoundingClientRect(),O=u.width||this.width,A=u.height||this.height,L=S.top-A>0,B=L?S.top-A-_:S.top+S.height+_,X=S.left>O/2-b.x,G=Math.max(_,window.innerWidth-_-O),j=Math.min(G,X?Math.floor(S.left-O/2)+b.x:0+_);return E.value=`${B}px`,R.value=`${j}px`,{x:j,y:B,xAlign:"center",yAlign:L?"top":"bottom"}}}),d.onUnmounted(()=>{Te.positioners[D]&&delete Te.positioners[D]}),(C,b)=>(d.openBlock(),d.createElementBlock("div",xC,[x.value?n.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Cm),{key:1,"chart-id":d.unref(t),data:v.value,"data-testId":"sparkline-bar",options:k.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Om),{key:2,"chart-id":d.unref(t),data:v.value,"data-testId":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:k.value,plugins:f.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",wC,[d.renderSlot(C.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(ua,{key:3,"absolute-left":R.value,"absolute-top":E.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":n.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&n.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:C.$slots.label?"":g.value},[d.renderSlot(C.$slots,"label",{total:p.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(g.value),1)],!0)],8,vC)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e18e899f"]]);ot.AnalyticsChart=lT,ot.ChartLegendPosition=Nt,ot.CsvExportModal=_C,ot.DECIMAL_DISPLAY=H1,ot.EMPTY_COLOR=nf,ot.FONT_SIZE_REGULAR=Gh,ot.FONT_SIZE_SMALL=Xh,ot.MAX_LABEL_LENGTH=Xr,ot.OTHERS_COLOR=Q1,ot.SimpleChart=xT,ot.SparklineChart=MC,ot.TopNTable=AT,ot.ValidType=ii,ot.accessibleGrey=tf,ot.apiRequestStatusCodeColors=ef,ot.chartTypes=XD,ot.codesInSpec=of,ot.darkenColor=Jh,ot.datavisPalette=on,ot.defaultStatusCodeColors=Zr,ot.determineBaseColor=Jo,ot.errorRateColors=K1,ot.handleQueryError=zM,ot.latencyColors=Z1,ot.lightGrey=nl,ot.lookupColor=J1,ot.lookupDatavisColor=Gr,ot.lookupStatusCodeCategoryColor=aM,ot.lookupStatusCodeColor=il,ot.simpleChartMetricDisplay=qD,ot.simpleChartTypes=GD,ot.statusCodeBadgeBackgroundColor=X1,ot.thresholdColor=Kr,ot.trafficColors=G1,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=p,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=g,i.jQuery&&((s=i.jQuery).fn.parse=function(b){var _=b.config||{},S=[];return this.each(function(L){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 B=0;B<this.files.length;B++)S.push({file:this.files[B],inputElem:this,instanceConfig:s.extend({},_)})}),O(),this;function O(){if(S.length===0)C(b.complete)&&b.complete();else{var L,B,X,G,j=S[0];if(C(b.before)){var lt=b.before(j.file,j.inputElem);if(typeof lt=="object"){if(lt.action==="abort")return L="AbortError",B=j.file,X=j.inputElem,G=lt.reason,void(C(b.error)&&b.error({name:L},B,X,G));if(lt.action==="skip")return void A();typeof lt.config=="object"&&(j.instanceConfig=s.extend(j.instanceConfig,lt.config))}else if(lt==="skip")return void A()}var q=j.instanceConfig.complete;j.instanceConfig.complete=function(Q){C(q)&&q(Q,j.file,j.inputElem),A()},c.parse(j.file,j.instanceConfig)}}function A(){S.splice(0,1),O()}}),a&&(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})}),(h.prototype=Object.create(u.prototype)).constructor=h,(f.prototype=Object.create(u.prototype)).constructor=f,(m.prototype=Object.create(m.prototype)).constructor=m,(g.prototype=Object.create(u.prototype)).constructor=g,c})})(zm);var hC=zm.exports;const fC=["id"],mC=d.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=d.computed(()=>`export_${new Date().getTime()}`),r=d.computed(()=>{const u=l();return u.length?u:null}),a=()=>{const u=i.labels;if(typeof i.fields!==ii.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ii.Object?h=>ID(h,(f,m)=>u[m]||m):h=>h},o=()=>{const u=i.fields;if(typeof i.fields!==ii.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>uC(h,u):h=>h},l=()=>{if(typeof i.fields===ii.Undefined&&typeof i.labels===ii.Undefined)return i.data;const u=a(),h=o();return i.data.map(f=>u(h(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=hC.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 h=new Blob([u],{type:"text/csv;charset="+i.encoding});dC.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(n.filename),1)])],8,fC))}}),gC=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(mC,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),pC={class:"kong-ui-public-csv-export-modal"},yC={key:0,class:"selected-range"},bC={key:4,class:"text-muted",tag:"span"},Hm=3,_C=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=pt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=d.ref(1),o=d.computed(()=>f.value.rows.length),l=d.computed(()=>{var g,p;return i.exportState.status==="success"&&!!((p=(g=i.exportState.chartData)==null?void 0:g.data)!=null&&p.length)}),c=d.computed(()=>i.exportState.status!=="success"?"":pt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(Hm,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{var E,R,C;if(i.exportState.status!=="success"||!l.value||!((E=i.exportState.chartData)!=null&&E.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,p=g.data.some(b=>b.timestamp!==g.data[0].timestamp),x=g.data.map(b=>{const _=new Date(b.timestamp);return{...Object.keys(b.event).reduce((O,A)=>{if(A in g.meta.display){const L=b.event[A],B=g.meta.display[A];O[A]=L&&B&&B[L].name||b.event[A]}else O[A]=b.event[A];return O},{}),...p?{timestamp:dl(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:dl(_,"XXX")}:{}}});let v=[];p&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.exportState.chartData.meta&&((R=i.exportState.chartData.meta)!=null&&R.display)?(C=i.exportState.chartData.meta)==null?void 0:C.display:{},T=[...v,...Object.keys(M).map(b=>({label:e.t(`chartLabels.${b}`),key:b})),...i.exportState.chartData.meta.metric_names.map(b=>({label:e.t(`chartLabels.${b}`),key:b}))],k=T.reduce((b,_)=>(b[_.key]=_.label,b),{});return{headers:T,csvHeaders:k,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:g}=f.value;return{total:Number(g.length)||0,data:g.slice(0,Hm)}};return d.watch(f,()=>{a.value++}),(g,p)=>{const x=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KEmptyState"),M=d.resolveComponent("KTableData"),T=d.resolveComponent("KTooltip"),k=d.resolveComponent("KButton"),E=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",pC,[d.createVNode(E,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var R;return[d.createElementVNode("div",null,[n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",yC,[d.createElementVNode("p",null,d.toDisplayString(n.modalDescription?n.modalDescription:d.unref(e).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),n.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(d.openBlock(),d.createBlock(M,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((R=f.value)==null?void 0:R.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(v,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(d.openBlock(),d.createBlock(v,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",bC,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(T,{class:"preview-tooltip",placement:"right",text:d.unref(e).t("csvExport.maximumRecordAmount",{value:d.unref(Ew)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Js.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Zo)})`,size:d.unref(Qo)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(k,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(gC,{class:"vitals-report-export-button",filename:r,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(k,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),xC={class:"container"},wC={key:0,class:"no-data","data-testId":"sparkline-empty"},vC=["title"],MC=Ce(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=pt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:r,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:l,syncedChartDatasets:c}=pt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:C,height:b})=>{u.width=C,u.height=b},f=d.computed(()=>n.disableTooltip?[]:[new Pm({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),m=d.computed(()=>c.value.reduce((C,{data:b,label:_})=>({...C,[_]:b.reduce((S,{y:O})=>S+O,0)}),{})),g=d.computed(()=>c.value.map(({label:C})=>[m.value[C],`${C}: ${m.value[C]}`]).sort(([C],[b])=>b-C).map(([,C])=>C).join(", ")),p=d.computed(()=>Object.keys(m.value).map(C=>m.value[C]).reduce((C,b)=>C+b,0)),x=d.computed(()=>p.value>0),v=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),M=d.computed(()=>n.datasets.length>1),T=`SparklineTooltipPosition-${t}`,k=d.computed(()=>{const C=n.type==="sparkline_bar",b=C?s.value-1:s.value,_=C?r.value:r.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:C?0:2,right:C?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:T,external:S=>{$h(u,S,"minutely",{contextFormatter:O=>{const A=O+i.value;let L="";return i.value>24*60*60*1e3?L=Br(new Date(A),"MMM dd, yyy hh:mm a"):L=Br(new Date(A),"hh:mm a"),`${$o(O)} - ${L}`}})}}},scales:{x:{min:b,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:M.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:M.value}}}}),E=d.ref("0"),R=d.ref("0");return d.onMounted(()=>{De.positioners[T]=function(C,b){if(!C.length||u.interactionMode==="interactive")return!1;const _=10,S=this.chart.canvas.getBoundingClientRect(),O=u.width||this.width,A=u.height||this.height,L=S.top-A>0,B=L?S.top-A-_:S.top+S.height+_,X=S.left>O/2-b.x,G=Math.max(_,window.innerWidth-_-O),j=Math.min(G,X?Math.floor(S.left-O/2)+b.x:0+_);return E.value=`${B}px`,R.value=`${j}px`,{x:j,y:B,xAlign:"center",yAlign:L?"top":"bottom"}}}),d.onUnmounted(()=>{De.positioners[T]&&delete De.positioners[T]}),(C,b)=>(d.openBlock(),d.createElementBlock("div",xC,[x.value?n.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Cm),{key:1,"chart-id":d.unref(t),data:v.value,"data-testId":"sparkline-bar",options:k.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Om),{key:2,"chart-id":d.unref(t),data:v.value,"data-testId":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:k.value,plugins:f.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",wC,[d.renderSlot(C.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(ua,{key:3,"absolute-left":R.value,"absolute-top":E.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":n.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&n.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:C.$slots.label?"":g.value},[d.renderSlot(C.$slots,"label",{total:p.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(g.value),1)],!0)],8,vC)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e18e899f"]]);ot.AnalyticsChart=lD,ot.ChartLegendPosition=Nt,ot.CsvExportModal=_C,ot.DECIMAL_DISPLAY=H1,ot.EMPTY_COLOR=nf,ot.FONT_SIZE_REGULAR=Gh,ot.FONT_SIZE_SMALL=Xh,ot.MAX_LABEL_LENGTH=Xr,ot.OTHERS_COLOR=Q1,ot.SimpleChart=xD,ot.SparklineChart=MC,ot.TopNTable=AD,ot.ValidType=ii,ot.accessibleGrey=tf,ot.apiRequestStatusCodeColors=ef,ot.chartTypes=XT,ot.codesInSpec=of,ot.darkenColor=Jh,ot.datavisPalette=on,ot.defaultStatusCodeColors=Zr,ot.determineBaseColor=Jo,ot.errorRateColors=K1,ot.handleQueryError=zM,ot.latencyColors=Z1,ot.lightGrey=nl,ot.lookupColor=J1,ot.lookupDatavisColor=Gr,ot.lookupStatusCodeCategoryColor=aM,ot.lookupStatusCodeColor=il,ot.simpleChartMetricDisplay=qT,ot.simpleChartTypes=GT,ot.statusCodeBadgeBackgroundColor=X1,ot.thresholdColor=Kr,ot.trafficColors=G1,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
|