@kong-ui-public/analytics-chart 10.40.4-pr.3904.d8d2397ff.0 → 10.41.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/README.md +8 -0
- package/dist/style.css +1 -1
- package/dist/types/components/CsvExportModal.vue.d.ts +16 -0
- package/dist/types/components/CsvExportModal.vue.d.ts.map +1 -0
- package/dist/types/components/DownloadCsv.vue.d.ts +20 -0
- package/dist/types/components/DownloadCsv.vue.d.ts.map +1 -0
- package/dist/types/components/vue-json-csv/VueJsonCsv.vue.d.ts +166 -0
- package/dist/types/components/vue-json-csv/VueJsonCsv.vue.d.ts.map +1 -0
- package/dist/types/composables/index.d.ts +2 -0
- package/dist/types/composables/index.d.ts.map +1 -1
- package/dist/types/composables/useChartSelectedRange.d.ts +4 -0
- package/dist/types/composables/useChartSelectedRange.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/chart-export.d.ts +20 -0
- package/dist/types/types/chart-export.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/vitals-chart.es.js +13603 -9111
- package/dist/vitals-chart.umd.js +35 -6
- package/package.json +8 -3
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
(function(ot,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong/kongponents"],u):(ot=typeof globalThis<"u"?globalThis:ot||self,u(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot.KongIcons,ot["kong-ui-public-i18n"],ot["kong-ui-public-analytics-metric-provider"],ot.Kongponents))})(this,(function(ot,u,Tt,Or,We,Kn){"use strict";var Y=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(Y||{});const Lf=["in","not_in","selector"],Nf=["empty","not_empty"],Bf=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],je=e=>e.filter(t=>t!=="time"),Ar=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],po=je(Ar),Ff=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Pr=[...Ar,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],go=je(Pr),zf=[...Ff,"share_of_requests","cache_hit_rate","response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Uf=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","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","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node","upstream_status_code","upstream_status_code_grouped","response_source"],yo=je(Uf),Vf=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","cache_status","client_ip","consumer","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","oidc_credential","portal","principal","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"],Hf=je(Vf),$f=["auth_type","cache_status","client_ip","data_plane_node_version","header_host","header_user_agent","http_method","oidc_credential","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Yf=$f,Wf=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],jf=je(Wf),qf=["platform","platform_usage"],Gf=e=>qf.includes(e),Xf=[...Pr.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],bo=je(Xf);[...zf];const Kf=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],_o=je(Kf);new Set(po),new Set(go),new Set(yo),new Set(bo),new Set(_o);const Er=[{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"}],Me=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Lf},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Nf}},required:["field","operator"],additionalProperties:!1}]}});({...Me()},Er.map(e=>e.code));const Zf=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Me(go),Me(po),Me(yo),Me(bo),Me(_o),Me(Array.from(new Set([...Hf,...Yf,...jf]))),Me([...new Set([...go,...po,...yo,...bo,...Zf,..._o])]);const Qf={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"}},Jf=(e,t,n)=>{let i;const s=Qf[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function xo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const tm={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},em={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nm={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},im={date:xo({formats:tm,defaultWidth:"full"}),time:xo({formats:em,defaultWidth:"full"}),dateTime:xo({formats:nm,defaultWidth:"full"})},sm={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},om=(e,t,n,i)=>sm[e];function Zn(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):a;s=e.formattingValues[r]||e.formattingValues[a]}else{const a=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;s=e.values[r]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const am={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rm={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lm={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"]},cm={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"]},um={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"}},dm={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"}},hm=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},fm={ordinalNumber:hm,era:Zn({values:am,defaultWidth:"wide"}),quarter:Zn({values:rm,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Zn({values:lm,defaultWidth:"wide"}),day:Zn({values:cm,defaultWidth:"wide"}),dayPeriod:Zn({values:um,defaultWidth:"wide",formattingValues:dm,defaultFormattingWidth:"wide"})};function Qn(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?pm(r,h=>h.test(a)):mm(r,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function mm(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function pm(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function gm(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const r=t.slice(s.length);return{value:a,rest:r}}}const ym=/^(\d+)(th|st|nd|rd)?/i,bm=/\d+/i,_m={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},xm={any:[/^b/i,/^(a|c)/i]},wm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},km={any:[/1/i,/2/i,/3/i,/4/i]},Tm={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},Sm={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]},vm={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},Mm={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]},Dm={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},Cm={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}},Om={ordinalNumber:gm({matchPattern:ym,parsePattern:bm,valueCallback:e=>parseInt(e,10)}),era:Qn({matchPatterns:_m,defaultMatchWidth:"wide",parsePatterns:xm,defaultParseWidth:"any"}),quarter:Qn({matchPatterns:wm,defaultMatchWidth:"wide",parsePatterns:km,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Qn({matchPatterns:Tm,defaultMatchWidth:"wide",parsePatterns:Sm,defaultParseWidth:"any"}),day:Qn({matchPatterns:vm,defaultMatchWidth:"wide",parsePatterns:Mm,defaultParseWidth:"any"}),dayPeriod:Qn({matchPatterns:Dm,defaultMatchWidth:"any",parsePatterns:Cm,defaultParseWidth:"any"})},Am={code:"en-US",formatDistance:Jf,formatLong:im,formatRelative:om,localize:fm,match:Om,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Pm={};function Jn(){return Pm}const Rr=6048e5,Em=864e5,Rm=60,Im=3600,Ir=Symbol.for("constructDateFrom");function ee(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ir in e?e[Ir](t):e instanceof Date?new e.constructor(t):new Date(t)}function Bt(e,t){return ee(t||e,e)}function Lr(e){const t=Bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Lm(e,...t){const n=ee.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function bn(e,t){const n=Bt(e,t?.in);return n.setHours(0,0,0,0),n}function Nm(e,t,n){const[i,s]=Lm(n?.in,e,t),o=bn(i),a=bn(s),r=+o-Lr(o),l=+a-Lr(a);return Math.round((r-l)/Em)}function Bm(e,t){const n=Bt(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Fm(e,t){const n=Bt(e,t?.in);return Nm(n,Bm(n))+1}function me(e,t){const n=Jn(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Bt(e,t?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Xi(e,t){return me(e,{...t,weekStartsOn:1})}function Nr(e,t){const n=Bt(e,t?.in),i=n.getFullYear(),s=ee(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Xi(s),a=ee(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const r=Xi(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=r.getTime()?i:i-1}function zm(e,t){const n=Nr(e,t),i=ee(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Xi(i)}function Um(e,t){const n=Bt(e,t?.in),i=+Xi(n)-+zm(n);return Math.round(i/Rr)+1}function Br(e,t){const n=Bt(e,t?.in),i=n.getFullYear(),s=Jn(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=ee(t?.in||e,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const r=me(a,t),l=ee(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=me(l,t);return+n>=+r?i+1:+n>=+c?i:i-1}function Vm(e,t){const n=Jn(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Br(e,t),o=ee(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),me(o,t)}function Hm(e,t){const n=Bt(e,t?.in),i=+me(n,t)-+Vm(n,t);return Math.round(i/Rr)+1}function ht(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const De={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return ht(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ht(n+1,2)},d(e,t){return ht(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ht(e.getHours()%12||12,t.length)},H(e,t){return ht(e.getHours(),t.length)},m(e,t){return ht(e.getMinutes(),t.length)},s(e,t){return ht(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ht(s,t.length)}},_n={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fr={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return De.y(e,t)},Y:function(e,t,n,i){const s=Br(e,i),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return ht(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ht(o,t.length)},R:function(e,t){const n=Nr(e);return ht(n,t.length)},u:function(e,t){const n=e.getFullYear();return ht(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ht(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ht(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return De.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return ht(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Hm(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ht(s,t.length)},I:function(e,t,n){const i=Um(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):ht(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):De.d(e,t)},D:function(e,t,n){const i=Fm(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ht(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ht(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ht(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ht(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=_n.noon:i===0?s=_n.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=_n.evening:i>=12?s=_n.afternoon:i>=4?s=_n.morning:s=_n.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return De.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):De.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):De.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):De.s(e,t)},S:function(e,t){return De.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ur(i);case"XXXX":case"XX":return qe(i);default:return qe(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Ur(i);case"xxxx":case"xx":return qe(i);default:return qe(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zr(i,":");default:return"GMT"+qe(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zr(i,":");default:return"GMT"+qe(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return ht(i,t.length)},T:function(e,t,n){return ht(+e,t.length)}};function zr(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+ht(o,2)}function Ur(e,t){return e%60===0?(e>0?"-":"+")+ht(Math.abs(e)/60,2):qe(e,t)}function qe(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=ht(Math.trunc(i/60),2),o=ht(i%60,2);return n+s+t+o}const Vr=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Hr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},$m=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Vr(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Vr(i,t)).replace("{{time}}",Hr(s,t))},Ym={p:Hr,P:$m},Wm=/^D+$/,jm=/^Y+$/,qm=["D","DD","YY","YYYY"];function Gm(e){return Wm.test(e)}function Xm(e){return jm.test(e)}function Km(e,t,n){const i=Zm(e,t,n);if(console.warn(i),qm.includes(e))throw new RangeError(i)}function Zm(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Qm(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Jm(e){return!(!Qm(e)&&typeof e!="number"||isNaN(+Bt(e)))}const tp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ep=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,np=/^'([^]*?)'?$/,ip=/''/g,sp=/[a-zA-Z]/;function op(e,t,n){const i=Jn(),s=n?.locale??i.locale??Am,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=Bt(e,n?.in);if(!Jm(r))throw new RangeError("Invalid time value");let l=t.match(ep).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=Ym[h];return f(d,s.formatLong)}return d}).join("").match(tp).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:ap(d)};if(Fr[h])return{isToken:!0,value:d};if(h.match(sp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(l=s.localize.preprocessor(r,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!n?.useAdditionalWeekYearTokens&&Xm(h)||!n?.useAdditionalDayOfYearTokens&&Gm(h))&&Km(h,t,String(e));const f=Fr[h[0]];return f(r,h,s.localize,c)}).join("")}function ap(e){const t=e.match(np);return t?t[1].replace(ip,"'"):e}function Ki(e,t,n){const i=Bt(e,n?.in);return isNaN(t)?ee(e,NaN):(i.setDate(i.getDate()+t),i)}function $r(e,t,n){const i=Bt(e,n?.in);if(isNaN(t))return ee(e,NaN);if(!t)return i;const s=i.getDate(),o=ee(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function rp(e,t,n){return $r(e,t*3,n)}function xn(e,t){const n=Bt(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function wn(e,t){const n=Bt(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function lp(e,t){const n=Bt(e,t?.in),i=n.getFullYear(),s=n.getMonth(),o=ee(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function cp(){return Object.assign({},Jn())}function Yr(e){return Math.trunc(e*Im)}function up(e){const t=e/Rm;return Math.trunc(t)}function Wr(e,t,n){return $r(e,-1,n)}function jr(e,t,n){return rp(e,-1,n)}function qr(e,t,n){const i=cp(),s=fp(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?dp(s,t):hp(s,t)}function dp(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function hp(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function fp(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function mp(e,t){const n=_p(t);return"formatToParts"in n?gp(n,e):yp(n,e)}const pp={year:0,month:1,day:2,hour:3,minute:4,second:5};function gp(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=pp[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function yp(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 wo={},Gr=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")),bp=Gr==="06/25/2014, 00:00:00"||Gr==="06/25/2014 00:00:00";function _p(e){return wo[e]||(wo[e]=bp?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),wo[e]}function ko(e,t,n,i,s,o,a){const r=new Date(0);return r.setUTCFullYear(e,t,n),r.setUTCHours(i,s,o,a),r}const Xr=36e5,xp=6e4,To={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ti(e,t,n){if(!e)return 0;let i=To.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=To.timezoneHH.exec(e),i)return s=parseInt(i[1],10),Kr(s)?-(s*Xr):NaN;if(i=To.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Kr(s,a)?(o=Math.abs(s)*Xr+a*xp,i[1]==="+"?-o:o):NaN}if(Tp(e)){t=new Date(t||Date.now());const a=n?t:wp(t),r=So(a,e);return-(n?r:kp(t,r,e))}return NaN}function wp(e){return ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function So(e,t){const n=mp(e,t),i=ko(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function kp(e,t,n){let i=e.getTime()-t;const s=So(new Date(i),n);if(t===s)return t;i-=s-t;const o=So(new Date(i),n);return s===o?s:Math.max(s,o)}function Kr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Zr={};function Tp(e){if(Zr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Zr[e]=!0,!0}catch{return!1}}const Sp=60*1e3,vp={X:function(e,t,n){const i=vo(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Qr(i);case"XXXX":case"XX":return kn(i);default:return kn(i,":")}},x:function(e,t,n){const i=vo(n.timeZone,e);switch(t){case"x":return Qr(i);case"xxxx":case"xx":return kn(i);default:return kn(i,":")}},O:function(e,t,n){const i=vo(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Mp(i,":");default:return"GMT"+kn(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return qr("short",e,n);default:return qr("long",e,n)}}};function vo(e,t){const n=e?ti(e,t,!0)/Sp:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Zi(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function kn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Zi(Math.floor(i/60),2),o=Zi(Math.floor(i%60),2);return n+s+t+o}function Qr(e,t){return e%60===0?(e>0?"-":"+")+Zi(Math.abs(e)/60,2):kn(e,t)}function Mp(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Zi(o,2)}function Jr(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const tl=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Mo=36e5,el=6e4,Dp=2,Yt={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:tl};function Qi(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?Dp:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=Cp(e),{year:s,restDateString:o}=Op(i.date,n),a=Ap(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const r=a.getTime();let l=0,c;if(i.time&&(l=Pp(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=ti(i.timeZone||t.timeZone,new Date(r+l)),isNaN(c))return new Date(NaN)}else c=Jr(new Date(r+l)),c=Jr(new Date(r+l+c));return new Date(r+l+c)}else return new Date(NaN)}function Cp(e){const t={};let n=Yt.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Yt.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=Yt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Op(e,t){if(e){const n=Yt.YYY[t],i=Yt.YYYYY[t];let s=Yt.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=Yt.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Ap(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=Yt.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,sl(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=Yt.DDD.exec(e),o){n=new Date(0);const a=parseInt(o[1],10);return Ip(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(o=Yt.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return sl(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(o=Yt.Www.exec(e),o)return s=parseInt(o[1],10)-1,ol(s)?nl(t,s):new Date(NaN);if(o=Yt.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return ol(s,a)?nl(t,s,a):new Date(NaN)}return null}function Pp(e){let t,n,i=Yt.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Do(t)?t%24*Mo:NaN;if(i=Yt.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Do(t,n)?t%24*Mo+n*el:NaN;if(i=Yt.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Do(t,n,s)?t%24*Mo+n*el+s*1e3:NaN}return null}function nl(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Ep=[31,28,31,30,31,30,31,31,30,31,30,31],Rp=[31,29,31,30,31,30,31,31,30,31,30,31];function il(e){return e%400===0||e%4===0&&e%100!==0}function sl(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=il(e);if(i&&n>Rp[t]||!i&&n>Ep[t])return!1}return!0}function Ip(e,t){if(t<1)return!1;const n=il(e);return!(n&&t>366||!n&&t>365)}function ol(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Do(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Lp=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Np(e,t,n={}){t=String(t);const i=t.match(Lp);if(i){const s=Qi(n.originalDate||e,n);t=i.reduce(function(o,a){if(a[0]==="'")return o;const r=o.indexOf(a),l=o[r-1]==="'",c=o.replace(a,"'"+vp[a[0]](s,a,n)+"'");return l?c.substring(0,r-1)+c.substring(r+1):c},t)}return op(e,t,n)}function al(e,t,n){e=Qi(e,n);const i=ti(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Bp(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Np(al(e,t,{timeZone:i.timeZone}),n,i)}function Fp(e,t,n){if(typeof e=="string"&&!e.match(tl))return Qi(e,{...n,timeZone:t});e=Qi(e,n);const i=ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),s=ti(t,new Date(i));return new Date(i+s)}function zp(e,t){return-ti(e,t)}function Up(e,t={}){if(!e)return e;const n=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(e);return Bp(s,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const Vp={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function Ji(e){return e&&Bf.find(t=>e<=Vp[t])||null}var ts=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},es={exports:{}};es.exports;var rl;function Hp(){return rl||(rl=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",a="[object Array]",r="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object Promise]",y="[object RegExp]",_="[object Set]",x="[object String]",T="[object Symbol]",v="[object WeakMap]",w="[object ArrayBuffer]",M="[object DataView]",D="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",S="[object Int16Array]",A="[object Int32Array]",L="[object Uint8Array]",R="[object Uint8ClampedArray]",H="[object Uint16Array]",W="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,K=/\w*$/,lt=/^\[object .+?Constructor\]$/,rt=/^(?:0|[1-9]\d*)$/,X={};X[o]=X[a]=X[w]=X[M]=X[r]=X[l]=X[D]=X[P]=X[k]=X[S]=X[A]=X[f]=X[m]=X[p]=X[y]=X[_]=X[x]=X[T]=X[L]=X[R]=X[H]=X[W]=!0,X[c]=X[d]=X[v]=!1;var z=typeof ts=="object"&&ts&&ts.Object===Object&&ts,C=typeof self=="object"&&self&&self.Object===Object&&self,E=z||C||Function("return this")(),N=t&&!t.nodeType&&t,V=N&&!0&&e&&!e.nodeType&&e,tt=V&&V.exports===N;function Z(b,O){return b.set(O[0],O[1]),b}function F(b,O){return b.add(O),b}function nt(b,O){for(var I=-1,j=b?b.length:0;++I<j&&O(b[I],I,b)!==!1;);return b}function gt(b,O){for(var I=-1,j=O.length,Nt=b.length;++I<j;)b[Nt+I]=O[I];return b}function ct(b,O,I,j){for(var Nt=-1,Qt=b?b.length:0;++Nt<Qt;)I=O(I,b[Nt],Nt,b);return I}function at(b,O){for(var I=-1,j=Array(b);++I<b;)j[I]=O(I);return j}function Ct(b,O){return b?.[O]}function B(b){var O=!1;if(b!=null&&typeof b.toString!="function")try{O=!!(b+"")}catch{}return O}function U(b){var O=-1,I=Array(b.size);return b.forEach(function(j,Nt){I[++O]=[Nt,j]}),I}function J(b,O){return function(I){return b(O(I))}}function $t(b){var O=-1,I=Array(b.size);return b.forEach(function(j){I[++O]=j}),I}var fe=Array.prototype,fn=Function.prototype,Te=Object.prototype,mn=E["__core-js_shared__"],Wn=(function(){var b=/[^.]+$/.exec(mn&&mn.keys&&mn.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""})(),lo=fn.toString,Ye=Te.hasOwnProperty,co=Te.toString,lP=RegExp("^"+lo.call(Ye).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bf=tt?E.Buffer:void 0,_f=E.Symbol,xf=E.Uint8Array,cP=J(Object.getPrototypeOf,Object),uP=Object.create,dP=Te.propertyIsEnumerable,hP=fe.splice,wf=Object.getOwnPropertySymbols,fP=bf?bf.isBuffer:void 0,mP=J(Object.keys,Object),xr=Gn(E,"DataView"),qi=Gn(E,"Map"),wr=Gn(E,"Promise"),kr=Gn(E,"Set"),Tr=Gn(E,"WeakMap"),Gi=Gn(Object,"create"),pP=yn(xr),gP=yn(qi),yP=yn(wr),bP=yn(kr),_P=yn(Tr),kf=_f?_f.prototype:void 0,Tf=kf?kf.valueOf:void 0;function pn(b){var O=-1,I=b?b.length:0;for(this.clear();++O<I;){var j=b[O];this.set(j[0],j[1])}}function xP(){this.__data__=Gi?Gi(null):{}}function wP(b){return this.has(b)&&delete this.__data__[b]}function kP(b){var O=this.__data__;if(Gi){var I=O[b];return I===i?void 0:I}return Ye.call(O,b)?O[b]:void 0}function TP(b){var O=this.__data__;return Gi?O[b]!==void 0:Ye.call(O,b)}function SP(b,O){var I=this.__data__;return I[b]=Gi&&O===void 0?i:O,this}pn.prototype.clear=xP,pn.prototype.delete=wP,pn.prototype.get=kP,pn.prototype.has=TP,pn.prototype.set=SP;function Se(b){var O=-1,I=b?b.length:0;for(this.clear();++O<I;){var j=b[O];this.set(j[0],j[1])}}function vP(){this.__data__=[]}function MP(b){var O=this.__data__,I=uo(O,b);if(I<0)return!1;var j=O.length-1;return I==j?O.pop():hP.call(O,I,1),!0}function DP(b){var O=this.__data__,I=uo(O,b);return I<0?void 0:O[I][1]}function CP(b){return uo(this.__data__,b)>-1}function OP(b,O){var I=this.__data__,j=uo(I,b);return j<0?I.push([b,O]):I[j][1]=O,this}Se.prototype.clear=vP,Se.prototype.delete=MP,Se.prototype.get=DP,Se.prototype.has=CP,Se.prototype.set=OP;function jn(b){var O=-1,I=b?b.length:0;for(this.clear();++O<I;){var j=b[O];this.set(j[0],j[1])}}function AP(){this.__data__={hash:new pn,map:new(qi||Se),string:new pn}}function PP(b){return ho(this,b).delete(b)}function EP(b){return ho(this,b).get(b)}function RP(b){return ho(this,b).has(b)}function IP(b,O){return ho(this,b).set(b,O),this}jn.prototype.clear=AP,jn.prototype.delete=PP,jn.prototype.get=EP,jn.prototype.has=RP,jn.prototype.set=IP;function qn(b){this.__data__=new Se(b)}function LP(){this.__data__=new Se}function NP(b){return this.__data__.delete(b)}function BP(b){return this.__data__.get(b)}function FP(b){return this.__data__.has(b)}function zP(b,O){var I=this.__data__;if(I instanceof Se){var j=I.__data__;if(!qi||j.length<n-1)return j.push([b,O]),this;I=this.__data__=new jn(j)}return I.set(b,O),this}qn.prototype.clear=LP,qn.prototype.delete=NP,qn.prototype.get=BP,qn.prototype.has=FP,qn.prototype.set=zP;function UP(b,O){var I=Mr(b)||uE(b)?at(b.length,String):[],j=I.length,Nt=!!j;for(var Qt in b)Ye.call(b,Qt)&&!(Nt&&(Qt=="length"||aE(Qt,j)))&&I.push(Qt);return I}function Sf(b,O,I){var j=b[O];(!(Ye.call(b,O)&&Cf(j,I))||I===void 0&&!(O in b))&&(b[O]=I)}function uo(b,O){for(var I=b.length;I--;)if(Cf(b[I][0],O))return I;return-1}function VP(b,O){return b&&vf(O,Dr(O),b)}function Sr(b,O,I,j,Nt,Qt,ve){var Jt;if(j&&(Jt=Qt?j(b,Nt,Qt,ve):j(b)),Jt!==void 0)return Jt;if(!fo(b))return b;var Pf=Mr(b);if(Pf){if(Jt=iE(b),!O)return tE(b,Jt)}else{var Xn=gn(b),Ef=Xn==d||Xn==h;if(hE(b))return qP(b,O);if(Xn==p||Xn==o||Ef&&!Qt){if(B(b))return Qt?b:{};if(Jt=sE(Ef?{}:b),!O)return eE(b,VP(Jt,b))}else{if(!X[Xn])return Qt?b:{};Jt=oE(b,Xn,Sr,O)}}ve||(ve=new qn);var Rf=ve.get(b);if(Rf)return Rf;if(ve.set(b,Jt),!Pf)var If=I?nE(b):Dr(b);return nt(If||b,function(Cr,mo){If&&(mo=Cr,Cr=b[mo]),Sf(Jt,mo,Sr(Cr,O,I,j,mo,b,ve))}),Jt}function HP(b){return fo(b)?uP(b):{}}function $P(b,O,I){var j=O(b);return Mr(b)?j:gt(j,I(b))}function YP(b){return co.call(b)}function WP(b){if(!fo(b)||lE(b))return!1;var O=Af(b)||B(b)?lP:lt;return O.test(yn(b))}function jP(b){if(!Df(b))return mP(b);var O=[];for(var I in Object(b))Ye.call(b,I)&&I!="constructor"&&O.push(I);return O}function qP(b,O){if(O)return b.slice();var I=new b.constructor(b.length);return b.copy(I),I}function vr(b){var O=new b.constructor(b.byteLength);return new xf(O).set(new xf(b)),O}function GP(b,O){var I=O?vr(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.byteLength)}function XP(b,O,I){var j=O?I(U(b),!0):U(b);return ct(j,Z,new b.constructor)}function KP(b){var O=new b.constructor(b.source,K.exec(b));return O.lastIndex=b.lastIndex,O}function ZP(b,O,I){var j=O?I($t(b),!0):$t(b);return ct(j,F,new b.constructor)}function QP(b){return Tf?Object(Tf.call(b)):{}}function JP(b,O){var I=O?vr(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.length)}function tE(b,O){var I=-1,j=b.length;for(O||(O=Array(j));++I<j;)O[I]=b[I];return O}function vf(b,O,I,j){I||(I={});for(var Nt=-1,Qt=O.length;++Nt<Qt;){var ve=O[Nt],Jt=void 0;Sf(I,ve,Jt===void 0?b[ve]:Jt)}return I}function eE(b,O){return vf(b,Mf(b),O)}function nE(b){return $P(b,Dr,Mf)}function ho(b,O){var I=b.__data__;return rE(O)?I[typeof O=="string"?"string":"hash"]:I.map}function Gn(b,O){var I=Ct(b,O);return WP(I)?I:void 0}var Mf=wf?J(wf,Object):pE,gn=YP;(xr&&gn(new xr(new ArrayBuffer(1)))!=M||qi&&gn(new qi)!=f||wr&&gn(wr.resolve())!=g||kr&&gn(new kr)!=_||Tr&&gn(new Tr)!=v)&&(gn=function(b){var O=co.call(b),I=O==p?b.constructor:void 0,j=I?yn(I):void 0;if(j)switch(j){case pP:return M;case gP:return f;case yP:return g;case bP:return _;case _P:return v}return O});function iE(b){var O=b.length,I=b.constructor(O);return O&&typeof b[0]=="string"&&Ye.call(b,"index")&&(I.index=b.index,I.input=b.input),I}function sE(b){return typeof b.constructor=="function"&&!Df(b)?HP(cP(b)):{}}function oE(b,O,I,j){var Nt=b.constructor;switch(O){case w:return vr(b);case r:case l:return new Nt(+b);case M:return GP(b,j);case D:case P:case k:case S:case A:case L:case R:case H:case W:return JP(b,j);case f:return XP(b,j,I);case m:case x:return new Nt(b);case y:return KP(b);case _:return ZP(b,j,I);case T:return QP(b)}}function aE(b,O){return O=O??s,!!O&&(typeof b=="number"||rt.test(b))&&b>-1&&b%1==0&&b<O}function rE(b){var O=typeof b;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?b!=="__proto__":b===null}function lE(b){return!!Wn&&Wn in b}function Df(b){var O=b&&b.constructor,I=typeof O=="function"&&O.prototype||Te;return b===I}function yn(b){if(b!=null){try{return lo.call(b)}catch{}try{return b+""}catch{}}return""}function cE(b){return Sr(b,!0,!0)}function Cf(b,O){return b===O||b!==b&&O!==O}function uE(b){return dE(b)&&Ye.call(b,"callee")&&(!dP.call(b,"callee")||co.call(b)==o)}var Mr=Array.isArray;function Of(b){return b!=null&&fE(b.length)&&!Af(b)}function dE(b){return mE(b)&&Of(b)}var hE=fP||gE;function Af(b){var O=fo(b)?co.call(b):"";return O==d||O==h}function fE(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=s}function fo(b){var O=typeof b;return!!b&&(O=="object"||O=="function")}function mE(b){return!!b&&typeof b=="object"}function Dr(b){return Of(b)?UP(b):jP(b)}function pE(){return[]}function gE(){return!1}e.exports=cE})(es,es.exports)),es.exports}Hp();const ne=(e,t)=>new Date(e.getTime()-zp(t,e));class Et{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){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 n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=Fp(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return al(n,t)}}class $p extends Et{rawStart(t){let n=me(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class Yp extends Et{rawStart(t){let n=wn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Wp extends Et{rawStart(t){let n=xn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class jp extends Et{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class qp extends Et{rawEnd(t){let n=me(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=ne(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=me(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=ne(i,t)),i}}class Gp extends Et{rawEnd(t){let n=xn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}rawStart(t){let n=xn(jr(this.tzAdjustedDate(t)));return t&&(n=ne(n,t)),n}}class Xp extends Et{rawEnd(t){let n=wn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}rawStart(t){let n=wn(Wr(this.tzAdjustedDate(t)));return t&&(n=ne(n,t)),n}}class Kp extends Et{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=ne(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=ne(n,t)),n}}Y.FIFTEEN_MIN,new Et({key:Y.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),Y.ONE_HOUR,new Et({key:Y.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),Y.SIX_HOUR,new Et({key:Y.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Y.TWELVE_HOUR,new Et({key:Y.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Y.ONE_DAY,new Et({key:Y.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Y.SEVEN_DAY,new Et({key:Y.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Y.THIRTY_DAY,new Et({key:Y.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.NINETY_DAY,new Et({key:Y.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.ONE_HUNDRED_EIGHTY_DAY,new Et({key:Y.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.ONE_YEAR,new Et({key:Y.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.CURRENT_WEEK,new $p({key:Y.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=me(new Date,{weekStartsOn:1});return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Y.CURRENT_MONTH,new Yp({key:Y.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=wn(new Date);return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.CURRENT_QUARTER,new Wp({key:Y.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=xn(new Date);return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.CURRENT_YEAR,new jp({key:Y.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.PREVIOUS_WEEK,new qp({key:Y.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Y.PREVIOUS_MONTH,new Xp({key:Y.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=wn(new Date),n=wn(Wr(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=ll(t,n)),3600*24*lp(new Date().setMonth(new Date().getMonth()-1))+Yr(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.PREVIOUS_QUARTER,new Gp({key:Y.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=xn(new Date),t=xn(jr(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.PREVIOUS_YEAR,new Kp({key:Y.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=ll(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Yr(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function ll(e,t){return up(e.getTimezoneOffset()-t.getTimezoneOffset())}Y.FIFTEEN_MIN,Y.ONE_HOUR,Y.SIX_HOUR,Y.TWELVE_HOUR,Y.ONE_DAY,Y.SEVEN_DAY,Y.FIFTEEN_MIN,Y.ONE_HOUR,Y.SIX_HOUR,Y.TWELVE_HOUR,Y.ONE_DAY,Y.SEVEN_DAY,Y.THIRTY_DAY,Y.NINETY_DAY,Y.ONE_HUNDRED_EIGHTY_DAY,Y.ONE_YEAR,Y.CURRENT_WEEK,Y.CURRENT_MONTH,Y.CURRENT_QUARTER,Y.CURRENT_YEAR,Y.PREVIOUS_WEEK,Y.PREVIOUS_MONTH,Y.PREVIOUS_QUARTER,Y.PREVIOUS_YEAR;const Zp=new Map(Er.map(e=>[e.code,{code:e.code,name:e.name}])),Co=e=>Zp.get(e)?.name||e,cl=1e3,Qp=1e4,ul=1e6,dl=1e9,hl=1e12,ns=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,o)=>{o&&o%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},ei=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let a=o.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function is(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?Qp:cl;return e<s||t.precision&&t.precision>Math.log10(e)?n=ns(ei(e,1,t),t):e<ul?n=`${ei(e,cl,t)}k`:e<dl?n=`${ei(e,ul,t)}m`:e<hl?n=`${ns(ei(e,dl,t),t)}b`:n=`${ns(ei(e,hl,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}is.addCommas=ns;const Jp=typeof document<"u"&&document.documentElement?.lang||"en-US",ss=new Intl.NumberFormat(Jp),tg=new Set(["%"]),eg=e=>tg.has(e)?"flush":"spaced";function oe({i18n:e}){const t=(s,o)=>{if(isNaN(s))return"0 B";const a=o?Math.pow(2,50):1e15,r=o?Math.pow(2,40):1e12,l=o?Math.pow(2,30):1e9,c=o?Math.pow(2,20):1e6,d=o?Math.pow(2,10):1e3;let h;return s>=a?h=e.formatNumber(Number.parseFloat((s/a).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):s>=r?h=e.formatNumber(Number.parseFloat((s/r).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):s>=l?h=e.formatNumber(Number.parseFloat((s/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):s>=c?h=e.formatNumber(Number.parseFloat((s/c).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):s>=d?h=e.formatNumber(Number.parseFloat((s/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=e.formatNumber(Number.parseFloat(s.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},n=(s,o="USD")=>isNaN(s)?o==="USD"?"$0.00":`${s}`:s>=.01||o!=="USD"?e.formatNumber(s,{style:"currency",currency:o}):s<1e-4?"< $0.0001":`$${Number.parseFloat(s.toPrecision(4))}`,i=(s,o,a)=>{if(!a)return s;const r=eg(o)==="flush"?"":" ";return`${s}${r}${a}`};return{formatUnit:(s,o,{isBytes1024:a=!1,currency:r="USD",approximate:l=!1,translateUnit:c=d=>d}={})=>{const d=c(o,s);switch(o){case"bytes":return t(s,a);case"usd":return n(s,r);default:return isNaN(s)?`${s}`:l?i(is(s,{capital:!0}),o,d):s<.01?i(`${Number.parseFloat(s.toPrecision(4))}`,o,d):i(ss.format(Number.parseFloat(s.toFixed(2))),o,d)}},formatBytes:t,formatCost:n,formatRange:(s,o,a,{isBytes1024:r=!1,currency:l="USD",approximate:c=!1,translateUnit:d=h=>h}={})=>{const h=d(a,o);switch(a){case"bytes":return`${t(s,r)} - ${t(o,r)}`;case"usd":return`${n(s,l)} - ${n(o,l)}`;default:if(isNaN(s)||isNaN(o))return`${s} - ${o}`;if(c)return i(`${is(s,{capital:!0})} - ${is(o,{capital:!0})}`,a,h)}const f=s>=.01?`${ss.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`,m=o>=.01?`${ss.format(Number.parseFloat(o.toFixed(2)))}`:`${Number.parseFloat(o.toPrecision(4))}`;return i(`${f} - ${m}`,a,h)}}}const ng=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},ig="#0044f4",fl="#6c7489",sg="#d60027",og="#ffc400",ag="#bee2ff",rg="#8fc1ff",lg="#5f9aff",cg="#306fff",ug="#b5ffee",dg="#00fabe",hg="#00d6a4",fg="#00a17b",mg="#007d60",pg="#005944",gg="#b5ffee",yg="#00fabe",bg="#b5ffee",_g="#00a17b",xg="#fff296",wg="#ffe04b",kg="#ffc400",Tg="#b37600",Sg="#995c00",vg="#804400",Mg="#fff296",Dg="#ffe04b",Cg="#ffc2b3",Og="#ff9877",Ag="#ff723c",Pg="#f75008",Eg="#d13500",Rg="#a31f00",Ig="#ffc2b3",Lg="#ff9877",Ng="#ff723c",Bg="#f75008",Fg="#d13500",zg="#a31f00",Ug="#ffc2b3",Vg="#ff9877",Hg="#ff723c",$g="#f75008",Yg="#d13500",Wg="#a31f00",jg="#ffc2b3",qg="#ff9877",Gg="#ff723c",Xg="#f75008",Kg="#d13500",Zg="#a31f00",Qg="#ffc2b3",Jg="#ff9877",ty="#ff723c",ey="#f75008",ny="#d13500",iy="#ffabab",sy="#ff7272",oy="#ff3954",ay="#f50045",ry="#d60027",ly="#ad000e",cy="#ffabab",uy="#ff7272",dy="#ff3954",hy="#f50045",fy="#d60027",my="#eefaff",py="#ecfffb",gy="#fffce0",yy="#fff1ef",by="#ffe5e5",_y="#5f9aff",xy="#00d6a4",wy="#ffc400",ky="#ff723c",Ty="#ff3954",Sy={100:ag,101:rg,102:lg,103:cg,200:ug,201:dg,202:hg,203:fg,204:mg,205:pg,206:gg,207:yg,208:bg,226:_g,300:xg,301:wg,302:kg,303:Tg,304:Sg,305:vg,307:Mg,308:Dg,400:Cg,401:Og,402:Ag,403:Pg,404:Eg,405:Rg,406:Ig,407:Lg,408:Ng,409:Bg,410:Fg,411:zg,412:Ug,413:Vg,414:Hg,415:$g,416:Yg,417:Wg,418:jg,421:qg,422:Gg,423:Xg,424:Kg,425:Zg,426:Qg,428:Jg,429:ty,431:ey,451:ny,500:iy,501:sy,502:oy,503:ay,504:ry,505:ly,506:cy,507:uy,508:dy,510:hy,511:fy},vy={100:my,200:py,300:gy,400:yy,500:by},ml={"1XX":_y,"2XX":xy,"3XX":wy,"4XX":ky,"5XX":Ty},My={error:sg,warning:og,empty:"#9DA99D",neutral:fl,____OTHER____:ig},pl=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],gl=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],Dy=e=>ng(e),yl=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?gl[i%gl.length]:pl[i%pl.length]},ni=({state:e})=>My[e]??fl,Cy=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return Sy[n]??vy[i]??ni({state:"neutral"})},Oy=({group:e})=>ml[e]?ml[e]:ni({state:"neutral"}),ii=({discriminator:e=void 0,state:t=void 0,dimension:n=void 0,dimensionValue:i=void 0,metric:s=void 0,customPalette:o=void 0})=>{let a="light";if(u.hasInjectionContext()&&(a=u.inject("app:konnectColorMode",u.computed(()=>"light")).value),e!==void 0)return yl({discriminator:e,theme:a,customPalette:o});if(t!==void 0)return ni({state:t});if(i&&["empty","____OTHER____"].includes(i))return ni({state:i});if(n!==void 0&&i!==void 0){if(n==="status_code")return Cy({statusCode:i});if(n==="status_code_grouped")return Oy({group:i})}return n||i||s?yl({discriminator:Dy(`${n??""}${i??""}${s??""}`),theme:a,customPalette:o}):ni({state:"neutral"})},bl="#d60027",_l="#ffe5e5",Ay="#f1f0ff",Py="#e0e4ea",xl="#6c7489",Ey="#afb7c5",wl="#0d0e14",Ry="#d60027",Iy="#ad000e",kl="#6c7489",Tl="#52596e",Ly="#007d60",Ny="#995c00",By="#ffc400",Fy="'Inter', Roboto, Helvetica, sans-serif",Tn="16px",zy="20px",Uy="#bee2ff",Vy="#8fc1ff",Hy="#5f9aff",$y="#306fff",Yy="#b5ffee",Wy="#00fabe",jy="#00d6a4",qy="#00a17b",Gy="#007d60",Xy="#005944",Ky="#b5ffee",Zy="#00fabe",Qy="#b5ffee",Jy="#00a17b",t0="#fff296",e0="#ffe04b",n0="#ffc400",i0="#b37600",s0="#995c00",o0="#804400",a0="#fff296",r0="#ffe04b",l0="#ffc2b3",c0="#ff9877",u0="#ff723c",d0="#f75008",h0="#d13500",f0="#a31f00",m0="#ffc2b3",p0="#ff9877",g0="#ff723c",y0="#f75008",b0="#d13500",_0="#a31f00",x0="#ffc2b3",w0="#ff9877",k0="#ff723c",T0="#f75008",S0="#d13500",v0="#a31f00",M0="#ffc2b3",D0="#ff9877",C0="#ff723c",O0="#f75008",A0="#d13500",P0="#a31f00",E0="#ffc2b3",R0="#ff9877",I0="#ff723c",L0="#f75008",N0="#d13500",B0="#ffabab",F0="#ff7272",z0="#ff3954",U0="#f50045",V0="#d60027",H0="#ad000e",$0="#ffabab",Y0="#ff7272",W0="#ff3954",j0="#f50045",q0="#d60027",G0="#eefaff",X0="#ecfffb",K0="#fffce0",Z0="#fff1ef",Q0="#ffe5e5",J0="#5f9aff",tb="#00d6a4",eb="#ffc400",nb="#ff723c",ib="#ff3954",Sl=6048e5,sb=864e5,si=6e4,Sn=36e5,ob=1e3,vl=Symbol.for("constructDateFrom");function St(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&vl in e?e[vl](t):e instanceof Date?new e.constructor(t):new Date(t)}function et(e,t){return St(t||e,e)}function os(e,t,n){const i=et(e,n?.in);return isNaN(t)?St(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Oo(e,t,n){const i=et(e,n?.in);if(isNaN(t))return St(e,NaN);if(!t)return i;const s=i.getDate(),o=St(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function Ao(e,t,n){return St(e,+et(e)+t)}function ab(e,t,n){return Ao(e,t*Sn)}let rb={};function Ge(){return rb}function ae(e,t){const n=Ge(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=et(e,t?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function vn(e,t){return ae(e,{...t,weekStartsOn:1})}function Ml(e,t){const n=et(e,t?.in),i=n.getFullYear(),s=St(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=vn(s),a=St(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const r=vn(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=r.getTime()?i:i-1}function as(e){const t=et(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Xe(e,...t){const n=St.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Po(e,t){const n=et(e,t?.in);return n.setHours(0,0,0,0),n}function Dl(e,t,n){const[i,s]=Xe(n?.in,e,t),o=Po(i),a=Po(s),r=+o-as(o),l=+a-as(a);return Math.round((r-l)/sb)}function lb(e,t){const n=Ml(e,t),i=St(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),vn(i)}function cb(e,t,n){const i=et(e,n?.in);return i.setTime(i.getTime()+t*si),i}function ub(e,t,n){return Oo(e,t*3,n)}function db(e,t,n){return Ao(e,t*1e3)}function hb(e,t,n){return os(e,t*7,n)}function fb(e,t,n){return Oo(e,t*12,n)}function oi(e,t){const n=+et(e)-+et(t);return n<0?-1:n>0?1:n}function mb(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Eo(e){return!(!mb(e)&&typeof e!="number"||isNaN(+et(e)))}function pb(e,t,n){const[i,s]=Xe(n?.in,e,t),o=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return o*12+a}function gb(e,t,n){const[i,s]=Xe(n?.in,e,t);return i.getFullYear()-s.getFullYear()}function Cl(e,t,n){const[i,s]=Xe(n?.in,e,t),o=Ol(i,s),a=Math.abs(Dl(i,s));i.setDate(i.getDate()-o*a);const r=+(Ol(i,s)===-o),l=o*(a-r);return l===0?0:l}function Ol(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function ai(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function yb(e,t,n){const[i,s]=Xe(n?.in,e,t),o=(+i-+s)/Sn;return ai(n?.roundingMethod)(o)}function Ro(e,t){return+et(e)-+et(t)}function bb(e,t,n){const i=Ro(e,t)/si;return ai(n?.roundingMethod)(i)}function Al(e,t){const n=et(e,t?.in);return n.setHours(23,59,59,999),n}function Pl(e,t){const n=et(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function _b(e,t){const n=et(e,t?.in);return+Al(n,t)==+Pl(n,t)}function El(e,t,n){const[i,s,o]=Xe(n?.in,e,e,t),a=oi(s,o),r=Math.abs(pb(s,o));if(r<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*r);let l=oi(s,o)===-a;_b(i)&&r===1&&oi(i,o)===1&&(l=!1);const c=a*(r-+l);return c===0?0:c}function xb(e,t,n){const i=El(e,t,n)/3;return ai(n?.roundingMethod)(i)}function wb(e,t,n){const i=Ro(e,t)/1e3;return ai(n?.roundingMethod)(i)}function kb(e,t,n){const i=Cl(e,t,n)/7;return ai(n?.roundingMethod)(i)}function Tb(e,t,n){const[i,s]=Xe(n?.in,e,t),o=oi(i,s),a=Math.abs(gb(i,s));i.setFullYear(1584),s.setFullYear(1584);const r=oi(i,s)===-o,l=o*(a-+r);return l===0?0:l}function Sb(e,t){const n=et(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function vb(e,t){const n=et(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Mb(e,t){const n=et(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function Rl(e,t){const n=et(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Db(e,t){const n=et(e,t?.in);return n.setMinutes(59,59,999),n}function Cb(e,t){const n=Ge(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=et(e,t?.in),o=s.getDay(),a=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Ob(e,t){const n=et(e,t?.in);return n.setSeconds(59,999),n}function Ab(e,t){const n=et(e,t?.in),i=n.getMonth(),s=i-i%3+3;return n.setMonth(s,0),n.setHours(23,59,59,999),n}function Pb(e,t){const n=et(e,t?.in);return n.setMilliseconds(999),n}const Eb={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"}},Rb=(e,t,n)=>{let i;const s=Eb[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Io(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ib={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bb={date:Io({formats:Ib,defaultWidth:"full"}),time:Io({formats:Lb,defaultWidth:"full"}),dateTime:Io({formats:Nb,defaultWidth:"full"})},Fb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zb=(e,t,n,i)=>Fb[e];function ri(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):a;s=e.formattingValues[r]||e.formattingValues[a]}else{const a=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;s=e.values[r]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const Ub={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Hb={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"]},$b={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"]},Yb={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"}},Wb={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"}},jb={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ri({values:Ub,defaultWidth:"wide"}),quarter:ri({values:Vb,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ri({values:Hb,defaultWidth:"wide"}),day:ri({values:$b,defaultWidth:"wide"}),dayPeriod:ri({values:Yb,defaultWidth:"wide",formattingValues:Wb,defaultFormattingWidth:"wide"})};function li(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?Gb(r,h=>h.test(a)):qb(r,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function qb(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Gb(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xb(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const r=t.slice(s.length);return{value:a,rest:r}}}const Kb=/^(\d+)(th|st|nd|rd)?/i,Zb=/\d+/i,Qb={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},Jb={any:[/^b/i,/^(a|c)/i]},t_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},e_={any:[/1/i,/2/i,/3/i,/4/i]},n_={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},i_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},s_={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},o_={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]},a_={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},r_={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}},l_={ordinalNumber:Xb({matchPattern:Kb,parsePattern:Zb,valueCallback:e=>parseInt(e,10)}),era:li({matchPatterns:Qb,defaultMatchWidth:"wide",parsePatterns:Jb,defaultParseWidth:"any"}),quarter:li({matchPatterns:t_,defaultMatchWidth:"wide",parsePatterns:e_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:li({matchPatterns:n_,defaultMatchWidth:"wide",parsePatterns:i_,defaultParseWidth:"any"}),day:li({matchPatterns:s_,defaultMatchWidth:"wide",parsePatterns:o_,defaultParseWidth:"any"}),dayPeriod:li({matchPatterns:a_,defaultMatchWidth:"any",parsePatterns:r_,defaultParseWidth:"any"})},Il={code:"en-US",formatDistance:Rb,formatLong:Bb,formatRelative:zb,localize:jb,match:l_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function c_(e,t){const n=et(e,t?.in);return Dl(n,Rl(n))+1}function Ll(e,t){const n=et(e,t?.in),i=+vn(n)-+lb(n);return Math.round(i/Sl)+1}function Lo(e,t){const n=et(e,t?.in),i=n.getFullYear(),s=Ge(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=St(t?.in||e,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const r=ae(a,t),l=St(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=ae(l,t);return+n>=+r?i+1:+n>=+c?i:i-1}function u_(e,t){const n=Ge(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Lo(e,t),o=St(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),ae(o,t)}function Nl(e,t){const n=et(e,t?.in),i=+ae(n,t)-+u_(n,t);return Math.round(i/Sl)+1}function ft(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Ce={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return ft(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ft(n+1,2)},d(e,t){return ft(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ft(e.getHours()%12||12,t.length)},H(e,t){return ft(e.getHours(),t.length)},m(e,t){return ft(e.getMinutes(),t.length)},s(e,t){return ft(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ft(s,t.length)}},Mn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bl={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Ce.y(e,t)},Y:function(e,t,n,i){const s=Lo(e,i),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return ft(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ft(o,t.length)},R:function(e,t){const n=Ml(e);return ft(n,t.length)},u:function(e,t){const n=e.getFullYear();return ft(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ft(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ft(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Ce.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return ft(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Nl(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ft(s,t.length)},I:function(e,t,n){const i=Ll(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):ft(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ce.d(e,t)},D:function(e,t,n){const i=c_(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ft(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ft(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ft(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ft(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=Mn.noon:i===0?s=Mn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=Mn.evening:i>=12?s=Mn.afternoon:i>=4?s=Mn.morning:s=Mn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ce.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ce.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ce.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ce.s(e,t)},S:function(e,t){return Ce.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return zl(i);case"XXXX":case"XX":return Ke(i);default:return Ke(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return zl(i);case"xxxx":case"xx":return Ke(i);default:return Ke(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Fl(i,":");default:return"GMT"+Ke(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Fl(i,":");default:return"GMT"+Ke(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return ft(i,t.length)},T:function(e,t,n){return ft(+e,t.length)}};function Fl(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+ft(o,2)}function zl(e,t){return e%60===0?(e>0?"-":"+")+ft(Math.abs(e)/60,2):Ke(e,t)}function Ke(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=ft(Math.trunc(i/60),2),o=ft(i%60,2);return n+s+t+o}const Ul=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Vl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},No={p:Vl,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ul(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ul(i,t)).replace("{{time}}",Vl(s,t))}},d_=/^D+$/,h_=/^Y+$/,f_=["D","DD","YY","YYYY"];function Hl(e){return d_.test(e)}function $l(e){return h_.test(e)}function Bo(e,t,n){const i=m_(e,t,n);if(console.warn(i),f_.includes(e))throw new RangeError(i)}function m_(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const p_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,g_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y_=/^'([^]*?)'?$/,b_=/''/g,__=/[a-zA-Z]/;function rs(e,t,n){const i=Ge(),s=n?.locale??i.locale??Il,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=et(e,n?.in);if(!Eo(r))throw new RangeError("Invalid time value");let l=t.match(g_).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=No[h];return f(d,s.formatLong)}return d}).join("").match(p_).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:x_(d)};if(Bl[h])return{isToken:!0,value:d};if(h.match(__))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(l=s.localize.preprocessor(r,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!n?.useAdditionalWeekYearTokens&&$l(h)||!n?.useAdditionalDayOfYearTokens&&Hl(h))&&Bo(h,t,String(e));const f=Bl[h[0]];return f(r,h,s.localize,c)}).join("")}function x_(e){const t=e.match(y_);return t?t[1].replace(b_,"'"):e}function Yl(){return Object.assign({},Ge())}function w_(e,t){const n=et(e,t?.in).getDay();return n===0?7:n}function k_(e,t){const n=T_(t)?new t(0):St(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function T_(e){return typeof e=="function"&&e.prototype?.constructor===e}const S_=10;class Wl{subPriority=0;validate(t,n){return!0}}class v_ extends Wl{constructor(t,n,i,s,o){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class M_ extends Wl{priority=S_;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>St(n,i))}set(t,n){return n.timestampIsSet?t:St(t,k_(t,this.context))}}class ut{run(t,n,i,s){const o=this.parse(t,n,i,s);return o?{setter:new v_(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,i){return!0}}class D_ extends ut{priority=140;parse(t,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Mt={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}/},re={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 Dt(e,t){return e&&{value:t(e.value),rest:e.rest}}function kt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function le(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(s*Sn+o*si+a*ob),rest:t.slice(n[0].length)}}function jl(e){return kt(Mt.anyDigitsSigned,e)}function vt(e,t){switch(e){case 1:return kt(Mt.singleDigit,t);case 2:return kt(Mt.twoDigits,t);case 3:return kt(Mt.threeDigits,t);case 4:return kt(Mt.fourDigits,t);default:return kt(new RegExp("^\\d{1,"+e+"}"),t)}}function ls(e,t){switch(e){case 1:return kt(Mt.singleDigitSigned,t);case 2:return kt(Mt.twoDigitsSigned,t);case 3:return kt(Mt.threeDigitsSigned,t);case 4:return kt(Mt.fourDigitsSigned,t);default:return kt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Fo(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function ql(e,t){const n=t>0,i=n?t:1-t;let s;if(i<=50)s=e||100;else{const o=i+50,a=Math.trunc(o/100)*100,r=e>=o%100;s=e+a-(r?100:0)}return n?s:1-s}function Gl(e){return e%400===0||e%4===0&&e%100!==0}class C_ extends ut{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Dt(vt(4,t),s);case"yo":return Dt(i.ordinalNumber(t,{unit:"year"}),s);default:return Dt(vt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const s=t.getFullYear();if(i.isTwoDigitYear){const a=ql(i.year,s);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class O_ extends ut{priority=130;parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Dt(vt(4,t),s);case"Yo":return Dt(i.ordinalNumber(t,{unit:"year"}),s);default:return Dt(vt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,s){const o=Lo(t,s);if(i.isTwoDigitYear){const r=ql(i.year,o);return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ae(t,s)}const a=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ae(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class A_ extends ut{priority=130;parse(t,n){return ls(n==="R"?4:n.length,t)}set(t,n,i){const s=St(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),vn(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class P_ extends ut{priority=130;parse(t,n){return ls(n==="u"?4:n.length,t)}set(t,n,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class E_ extends ut{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return vt(n.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class R_ extends ut{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return vt(n.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class I_ extends ut{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"M":return Dt(kt(Mt.month,t),s);case"MM":return Dt(vt(2,t),s);case"Mo":return Dt(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class L_ extends ut{priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"L":return Dt(kt(Mt.month,t),s);case"LL":return Dt(vt(2,t),s);case"Lo":return Dt(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function N_(e,t,n){const i=et(e,n?.in),s=Nl(i,n)-t;return i.setDate(i.getDate()-s*7),et(i,n?.in)}class B_ extends ut{priority=100;parse(t,n,i){switch(n){case"w":return kt(Mt.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,s){return ae(N_(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function F_(e,t,n){const i=et(e,n?.in),s=Ll(i,n)-t;return i.setDate(i.getDate()-s*7),i}class z_ extends ut{priority=100;parse(t,n,i){switch(n){case"I":return kt(Mt.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return vn(F_(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const U_=[31,28,31,30,31,30,31,31,30,31,30,31],V_=[31,29,31,30,31,30,31,31,30,31,30,31];class H_ extends ut{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return kt(Mt.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return vt(n.length,t)}}validate(t,n){const i=t.getFullYear(),s=Gl(i),o=t.getMonth();return s?n>=1&&n<=V_[o]:n>=1&&n<=U_[o]}set(t,n,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class $_ extends ut{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return kt(Mt.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return vt(n.length,t)}}validate(t,n){const i=t.getFullYear();return Gl(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function zo(e,t,n){const i=Ge(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=et(e,n?.in),a=o.getDay(),l=(t%7+7)%7,c=7-s,d=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return os(o,d,n)}class Y_ extends ut{priority=90;parse(t,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=zo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class W_ extends ut{priority=90;parse(t,n,i,s){const o=a=>{const r=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+r};switch(n){case"e":case"ee":return Dt(vt(n.length,t),o);case"eo":return Dt(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=zo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class j_ extends ut{priority=90;parse(t,n,i,s){const o=a=>{const r=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+r};switch(n){case"c":case"cc":return Dt(vt(n.length,t),o);case"co":return Dt(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=zo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function q_(e,t,n){const i=et(e,n?.in),s=w_(i,n),o=t-s;return os(i,o,n)}class G_ extends ut{priority=90;parse(t,n,i){const s=o=>o===0?7:o;switch(n){case"i":case"ii":return vt(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Dt(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return Dt(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Dt(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);default:return Dt(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,n){return n>=1&&n<=7}set(t,n,i){return t=q_(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class X_ extends ut{priority=80;parse(t,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Fo(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class K_ extends ut{priority=80;parse(t,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Fo(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Z_ extends ut{priority=80;parse(t,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Fo(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Q_ extends ut{priority=70;parse(t,n,i){switch(n){case"h":return kt(Mt.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,i){const s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class J_ extends ut{priority=70;parse(t,n,i){switch(n){case"H":return kt(Mt.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class tx extends ut{priority=70;parse(t,n,i){switch(n){case"K":return kt(Mt.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class ex extends ut{priority=70;parse(t,n,i){switch(n){case"k":return kt(Mt.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,i){const s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class nx extends ut{priority=60;parse(t,n,i){switch(n){case"m":return kt(Mt.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class ix extends ut{priority=50;parse(t,n,i){switch(n){case"s":return kt(Mt.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class sx extends ut{priority=30;parse(t,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return Dt(vt(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class ox extends ut{priority=10;parse(t,n){switch(n){case"X":return le(re.basicOptionalMinutes,t);case"XX":return le(re.basic,t);case"XXXX":return le(re.basicOptionalSeconds,t);case"XXXXX":return le(re.extendedOptionalSeconds,t);default:return le(re.extended,t)}}set(t,n,i){return n.timestampIsSet?t:St(t,t.getTime()-as(t)-i)}incompatibleTokens=["t","T","x"]}class ax extends ut{priority=10;parse(t,n){switch(n){case"x":return le(re.basicOptionalMinutes,t);case"xx":return le(re.basic,t);case"xxxx":return le(re.basicOptionalSeconds,t);case"xxxxx":return le(re.extendedOptionalSeconds,t);default:return le(re.extended,t)}}set(t,n,i){return n.timestampIsSet?t:St(t,t.getTime()-as(t)-i)}incompatibleTokens=["t","T","X"]}class rx extends ut{priority=40;parse(t){return jl(t)}set(t,n,i){return[St(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class lx extends ut{priority=20;parse(t){return jl(t)}set(t,n,i){return[St(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const cx={G:new D_,y:new C_,Y:new O_,R:new A_,u:new P_,Q:new E_,q:new R_,M:new I_,L:new L_,w:new B_,I:new z_,d:new H_,D:new $_,E:new Y_,e:new W_,c:new j_,i:new G_,a:new X_,b:new K_,B:new Z_,h:new Q_,H:new J_,K:new tx,k:new ex,m:new nx,s:new ix,S:new sx,X:new ox,x:new ax,t:new rx,T:new lx},ux=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hx=/^'([^]*?)'?$/,fx=/''/g,mx=/\S/,px=/[a-zA-Z]/;function gx(e,t,n,i){const s=()=>St(i?.in||n,NaN),o=Yl(),a=i?.locale??o.locale??Il,r=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?s():et(n,i?.in);const c={firstWeekContainsDate:r,weekStartsOn:l,locale:a},d=[new M_(i?.in,n)],h=t.match(dx).map(y=>{const _=y[0];if(_ in No){const x=No[_];return x(y,a.formatLong)}return y}).join("").match(ux),f=[];for(let y of h){!i?.useAdditionalWeekYearTokens&&$l(y)&&Bo(y,t,e),!i?.useAdditionalDayOfYearTokens&&Hl(y)&&Bo(y,t,e);const _=y[0],x=cx[_];if(x){const{incompatibleTokens:T}=x;if(Array.isArray(T)){const w=f.find(M=>T.includes(M.token)||M.token===_);if(w)throw new RangeError(`The format string mustn't contain \`${w.fullToken}\` and \`${y}\` at the same time`)}else if(x.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);f.push({token:_,fullToken:y});const v=x.run(e,y,a.match,c);if(!v)return s();d.push(v.setter),e=v.rest}else{if(_.match(px))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(y==="''"?y="'":_==="'"&&(y=yx(y)),e.indexOf(y)===0)e=e.slice(y.length);else return s()}}if(e.length>0&&mx.test(e))return s();const m=d.map(y=>y.priority).sort((y,_)=>_-y).filter((y,_,x)=>x.indexOf(y)===_).map(y=>d.filter(_=>_.priority===y).sort((_,x)=>x.subPriority-_.subPriority)).map(y=>y[0]);let p=et(n,i?.in);if(isNaN(+p))return s();const g={};for(const y of m){if(!y.validate(p,c))return s();const _=y.set(p,g,c);Array.isArray(_)?(p=_[0],Object.assign(g,_[1])):p=_}return p}function yx(e){return e.match(hx)[1].replace(fx,"'")}function bx(e,t){const n=et(e,t?.in);return n.setMinutes(0,0,0),n}function _x(e,t){const n=et(e,t?.in);return n.setSeconds(0,0),n}function xx(e,t){const n=et(e,t?.in);return n.setMilliseconds(0),n}function Xl(e){const t=e/Sn;return Math.trunc(t)}function Kl(e,t){const n=()=>St(t?.in,NaN),i=t?.additionalDigits??2,s=Sx(e);let o;if(s.date){const c=vx(s.date,i);o=Mx(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const a=+o;let r=0,l;if(s.time&&(r=Dx(s.time),isNaN(r)))return n();if(s.timezone){if(l=Cx(s.timezone),isNaN(l))return n()}else{const c=new Date(a+r),d=et(0,t?.in);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return et(a+r+l,t?.in)}const cs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},wx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,kx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Tx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Sx(e){const t={},n=e.split(cs.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],cs.timeZoneDelimiter.test(t.date)&&(t.date=e.split(cs.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const s=cs.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function vx(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((i[1]||i[2]).length)}}function Mx(e,t){if(t===null)return new Date(NaN);const n=e.match(wx);if(!n)return new Date(NaN);const i=!!n[4],s=ci(n[1]),o=ci(n[2])-1,a=ci(n[3]),r=ci(n[4]),l=ci(n[5])-1;if(i)return Rx(t,r,l)?Ox(t,r,l):new Date(NaN);{const c=new Date(0);return!Px(t,o,a)||!Ex(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,a)),c)}}function ci(e){return e?parseInt(e):1}function Dx(e){const t=e.match(kx);if(!t)return NaN;const n=Uo(t[1]),i=Uo(t[2]),s=Uo(t[3]);return Ix(n,i,s)?n*Sn+i*si+s*1e3:NaN}function Uo(e){return e&&parseFloat(e.replace(",","."))||0}function Cx(e){if(e==="Z")return 0;const t=e.match(Tx);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Lx(i,s)?n*(i*Sn+s*si):NaN}function Ox(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Ax=[31,null,31,30,31,30,31,31,30,31,30,31];function Zl(e){return e%400===0||e%4===0&&e%100!==0}function Px(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Ax[t]||(Zl(e)?29:28))}function Ex(e,t){return t>=1&&t<=(Zl(e)?366:365)}function Rx(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Ix(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Lx(e,t){return t>=0&&t<=59}const Ql={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",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",scatter:{median:"Median",percentile:"p{value}",outlier:"Outlier (> {label})"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},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."},canceled:{message:"Request canceled"},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",share_of_requests:"Share of requests",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)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal 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",consumer_group:"Consumer group",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",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)",total_tokens_per_minute:"Total tokens per minute",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",cost_per_request_average:"Request cost (avg per million)",share_of_cost:"Share of cost",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",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",share_of_requests:"Share of requests",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) 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}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal 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_size_sum:"Request size (sum) 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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)",total_tokens_per_minute:"Total tokens per minute"},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"},timestampAxisTitles:{platform:"@timestamp created at"},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)"}},topTalkers:{total:"{value} total",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong"},singleValue:{valueError:"Invalid configuration",trend:{not_available:"Not available"}},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 Jl(){const e=Or.createI18n("en-us",Ql);return{i18n:e,i18nT:Or.i18nTComponent(e)}}function ui(e){return e+.5|0}const Oe=(e,t,n)=>Math.max(Math.min(e,n),t);function di(e){return Oe(ui(e*2.55),0,255)}function Ae(e){return Oe(ui(e*255),0,255)}function pe(e){return Oe(ui(e/2.55)/100,0,1)}function tc(e){return Oe(ui(e*100),0,100)}const ie={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},Vo=[..."0123456789ABCDEF"],Nx=e=>Vo[e&15],Bx=e=>Vo[(e&240)>>4]+Vo[e&15],us=e=>(e&240)>>4===(e&15),Fx=e=>us(e.r)&&us(e.g)&&us(e.b)&&us(e.a);function zx(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&ie[e[1]]*17,g:255&ie[e[2]]*17,b:255&ie[e[3]]*17,a:t===5?ie[e[4]]*17:255}:(t===7||t===9)&&(n={r:ie[e[1]]<<4|ie[e[2]],g:ie[e[3]]<<4|ie[e[4]],b:ie[e[5]]<<4|ie[e[6]],a:t===9?ie[e[7]]<<4|ie[e[8]]:255})),n}const Ux=(e,t)=>e<255?t(e):"";function Vx(e){var t=Fx(e)?Nx:Bx;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Ux(e.a,t):void 0}const Hx=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ec(e,t,n){const i=t*Math.min(n,1-n),s=(o,a=(o+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function $x(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Yx(e,t,n){const i=ec(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function Wx(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Ho(e){const n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),a=Math.min(n,i,s),r=(o+a)/2;let l,c,d;return o!==a&&(d=o-a,c=r>.5?d/(2-o-a):d/(o+a),l=Wx(n,i,s,d,o),l=l*60+.5),[l|0,c||0,r]}function $o(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Ae)}function Yo(e,t,n){return $o(ec,e,t,n)}function jx(e,t,n){return $o(Yx,e,t,n)}function qx(e,t,n){return $o($x,e,t,n)}function nc(e){return(e%360+360)%360}function Gx(e){const t=Hx.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?di(+t[5]):Ae(+t[5]));const s=nc(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=jx(s,o,a):t[1]==="hsv"?i=qx(s,o,a):i=Yo(s,o,a),{r:i[0],g:i[1],b:i[2],a:n}}function Xx(e,t){var n=Ho(e);n[0]=nc(n[0]+t),n=Yo(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Kx(e){if(!e)return;const t=Ho(e),n=t[0],i=tc(t[1]),s=tc(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${pe(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const ic={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"},sc={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 Zx(){const e={},t=Object.keys(sc),n=Object.keys(ic);let i,s,o,a,r;for(i=0;i<t.length;i++){for(a=r=t[i],s=0;s<n.length;s++)o=n[s],r=r.replace(o,ic[o]);o=parseInt(sc[a],16),e[r]=[o>>16&255,o>>8&255,o&255]}return e}let ds;function Qx(e){ds||(ds=Zx(),ds.transparent=[0,0,0,0]);const t=ds[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Jx=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function tw(e){const t=Jx.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?di(a):Oe(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?di(i):Oe(i,0,255)),s=255&(t[4]?di(s):Oe(s,0,255)),o=255&(t[6]?di(o):Oe(o,0,255)),{r:i,g:s,b:o,a:n}}}function ew(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${pe(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Wo=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Dn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function nw(e,t,n){const i=Dn(pe(e.r)),s=Dn(pe(e.g)),o=Dn(pe(e.b));return{r:Ae(Wo(i+n*(Dn(pe(t.r))-i))),g:Ae(Wo(s+n*(Dn(pe(t.g))-s))),b:Ae(Wo(o+n*(Dn(pe(t.b))-o))),a:e.a+n*(t.a-e.a)}}function hs(e,t,n){if(e){let i=Ho(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Yo(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function oc(e,t){return e&&Object.assign(t||{},e)}function ac(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ae(e[3]))):(t=oc(e,{r:0,g:0,b:0,a:1}),t.a=Ae(t.a)),t}function iw(e){return e.charAt(0)==="r"?tw(e):Gx(e)}class hi{constructor(t){if(t instanceof hi)return t;const n=typeof t;let i;n==="object"?i=ac(t):n==="string"&&(i=zx(t)||Qx(t)||iw(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=oc(this._rgb);return t&&(t.a=pe(t.a)),t}set rgb(t){this._rgb=ac(t)}rgbString(){return this._valid?ew(this._rgb):void 0}hexString(){return this._valid?Vx(this._rgb):void 0}hslString(){return this._valid?Kx(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const a=n===o?.5:n,r=2*a-1,l=i.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=nw(this._rgb,t._rgb,n)),this}clone(){return new hi(this.rgb)}alpha(t){return this._rgb.a=Ae(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=ui(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 hs(this._rgb,2,t),this}darken(t){return hs(this._rgb,2,-t),this}saturate(t){return hs(this._rgb,1,t),this}desaturate(t){return hs(this._rgb,1,-t),this}rotate(t){return Xx(this._rgb,t),this}}function ge(){}const sw=(()=>{let e=0;return()=>e++})();function G(e){return e==null}function dt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function st(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function xt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function te(e,t){return xt(e)?e:t}function Q(e,t){return typeof e>"u"?t:e}const ow=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,rc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function mt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function pt(e,t,n,i){let s,o,a;if(dt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(st(e))for(a=Object.keys(e),o=a.length,s=0;s<o;s++)t.call(n,e[a[s]],a[s])}function fs(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ms(e){if(dt(e))return e.map(ms);if(st(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=ms(e[n[s]]);return t}return e}function lc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function aw(e,t,n,i){if(!lc(e))return;const s=t[e],o=n[e];st(s)&&st(o)?fi(s,o,i):t[e]=ms(o)}function fi(e,t,n){const i=dt(t)?t:[t],s=i.length;if(!st(e))return e;n=n||{};const o=n.merger||aw;let a;for(let r=0;r<s;++r){if(a=i[r],!st(a))continue;const l=Object.keys(a);for(let c=0,d=l.length;c<d;++c)o(l[c],e,a,n)}return e}function mi(e,t){return fi(e,t,{merger:rw})}function rw(e,t,n){if(!lc(e))return;const i=t[e],s=n[e];st(i)&&st(s)?mi(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ms(s))}const cc={"":e=>e,x:e=>e.x,y:e=>e.y};function lw(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function cw(e){const t=lw(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Pe(e,t){return(cc[t]||(cc[t]=cw(t)))(e)}function jo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qt=e=>typeof e<"u",Gt=e=>typeof e=="function",uc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function uw(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const it=Math.PI,yt=2*it,dw=yt+it,ps=Number.POSITIVE_INFINITY,qo=it/180,bt=it/2,se=it/4,gs=it*2/3,Ee=Math.log10,ce=Math.sign;function pi(e,t,n){return Math.abs(e-t)<n}function dc(e){const t=Math.round(e);e=pi(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ee(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function hw(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function fw(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Re(e){return!fw(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function mw(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function hc(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ot(e){return e*(it/180)}function ys(e){return e*(180/it)}function fc(e){if(!xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function bs(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*it&&(o+=yt),{angle:o,distance:s}}function Cn(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pw(e,t){return(e-t+dw)%yt-it}function Ft(e){return(e%yt+yt)%yt}function gi(e,t,n,i){const s=Ft(e),o=Ft(t),a=Ft(n),r=Ft(o-s),l=Ft(a-s),c=Ft(s-o),d=Ft(s-a);return s===o||s===a||i&&o===a||r>l&&c<d}function Rt(e,t,n){return Math.max(t,Math.min(n,e))}function gw(e){return Rt(e,-32768,32767)}function ye(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Go(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const be=(e,t,n,i)=>Go(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),yw=(e,t,n)=>Go(e,n,i=>e[i][t]>=n);function bw(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const mc=["push","pop","shift","splice","unshift"];function _w(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),mc.forEach(n=>{const i="_onData"+jo(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return e._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...o)}),a}})})}function pc(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(mc.forEach(o=>{delete e[o]}),delete e._chartjs)}function gc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const yc=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function bc(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,yc.call(window,()=>{i=!1,e.apply(t,n)}))}}function xw(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Xo=e=>e==="start"?"left":e==="end"?"right":"center",zt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ww=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function _c(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:a,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=a.axis,{min:h,max:f,minDefined:m,maxDefined:p}=a.getUserBounds();if(m){if(s=Math.min(be(l,d,h).lo,n?i:be(t,d,a.getPixelForValue(h)).lo),c){const g=l.slice(0,s+1).reverse().findIndex(y=>!G(y[r.axis]));s-=Math.max(0,g)}s=Rt(s,0,i-1)}if(p){let g=Math.max(be(l,a.axis,f,!0).hi+1,n?0:be(t,d,a.getPixelForValue(f),!0).hi+1);if(c){const y=l.slice(g-1).findIndex(_=>!G(_[r.axis]));g+=Math.max(0,y)}o=Rt(g,s,i)-s}else o=i-s}return{start:s,count:o}}function xc(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const _s=e=>e===0||e===1,wc=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*yt/n)),kc=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*yt/n)+1,yi={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*bt)+1,easeOutSine:e=>Math.sin(e*bt),easeInOutSine:e=>-.5*(Math.cos(it*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>_s(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>_s(e)?e:wc(e,.075,.3),easeOutElastic:e=>_s(e)?e:kc(e,.075,.3),easeInOutElastic(e){return _s(e)?e:e<.5?.5*wc(e*2,.1125,.45):.5+.5*kc(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-yi.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?yi.easeInBounce(e*2)*.5:yi.easeOutBounce(e*2-1)*.5+.5};function Ko(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xs(e){return Ko(e)?e:new hi(e)}function Zo(e){return Ko(e)?e:new hi(e).saturate(.5).darken(.1).hexString()}const kw=["x","y","borderWidth","radius","tension"],Tw=["color","borderColor","backgroundColor"];function Sw(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Tw},numbers:{type:"number",properties:kw}}),e.describe("animations",{_fallback:"animation"}),e.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 vw(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Tc=new Map;function Mw(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Tc.get(n);return i||(i=new Intl.NumberFormat(e,t),Tc.set(n,i)),i}function bi(e,t,n){return Mw(t,n).format(e)}const Sc={values(e){return dt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Dw(e,n)}const a=Ee(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),bi(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ee(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Sc.numeric.call(this,e,t,n):""}};function Dw(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ws={formatters:Sc};function Cw(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:ws.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ze=Object.create(null),Qo=Object.create(null);function _i(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Jo(e,t,n){return typeof t=="string"?fi(_i(e,t),n):fi(_i(e,""),t)}class Ow{constructor(t,n){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)=>Zo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Zo(s.borderColor),this.hoverColor=(i,s)=>Zo(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(n)}set(t,n){return Jo(this,t,n)}get(t){return _i(this,t)}describe(t,n){return Jo(Qo,t,n)}override(t,n){return Jo(Ze,t,n)}route(t,n,i,s){const o=_i(this,t),a=_i(this,i),r="_"+n;Object.defineProperties(o,{[r]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[r],c=a[s];return st(l)?Object.assign({},c,l):Q(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(n=>n(this))}}var _t=new Ow({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Sw,vw,Cw]);function Aw(e){return!e||G(e.size)||G(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ks(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function Pw(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const r=n.length;let l,c,d,h,f;for(l=0;l<r;l++)if(h=n[l],h!=null&&!dt(h))a=ks(e,s,o,a,h);else if(dt(h))for(c=0,d=h.length;c<d;c++)f=h[c],f!=null&&!dt(f)&&(a=ks(e,s,o,a,f));e.restore();const m=o.length/2;if(m>n.length){for(l=0;l<m;l++)delete s[o[l]];o.splice(0,m)}return a}function Qe(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function vc(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ta(e,t,n,i){Mc(e,t,n,i,null)}function Mc(e,t,n,i,s){let o,a,r,l,c,d,h,f;const m=t.pointStyle,p=t.rotation,g=t.radius;let y=(p||0)*qo;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),m){default:s?e.ellipse(n,i,s/2,g,0,0,yt):e.arc(n,i,g,0,yt),e.closePath();break;case"triangle":d=s?s/2:g,e.moveTo(n+Math.sin(y)*d,i-Math.cos(y)*g),y+=gs,e.lineTo(n+Math.sin(y)*d,i-Math.cos(y)*g),y+=gs,e.lineTo(n+Math.sin(y)*d,i-Math.cos(y)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(y+se)*l,h=Math.cos(y+se)*(s?s/2-c:l),r=Math.sin(y+se)*l,f=Math.sin(y+se)*(s?s/2-c:l),e.arc(n-h,i-r,c,y-it,y-bt),e.arc(n+f,i-a,c,y-bt,y),e.arc(n+h,i+r,c,y,y+bt),e.arc(n-f,i+a,c,y+bt,y+it),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,d=s?s/2:l,e.rect(n-d,i-l,2*d,2*l);break}y+=se;case"rectRot":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+f,i-a),e.lineTo(n+h,i+r),e.lineTo(n-f,i+a),e.closePath();break;case"crossRot":y+=se;case"cross":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"star":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a),y+=se,h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"line":a=s?s/2:Math.cos(y)*g,r=Math.sin(y)*g,e.moveTo(n-a,i-r),e.lineTo(n+a,i+r);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function _e(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function xi(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function wi(e){e.restore()}function Ew(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Rw(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Iw(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),G(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Lw(e,t,n,i,s){if(s.strikethrough||s.underline){const o=e.measureText(i),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(a,d),e.lineTo(r,d),e.stroke()}}function Nw(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Je(e,t,n,i,s,o={}){const a=dt(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,Iw(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Nw(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),G(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Lw(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function On(e,t){const{x:n,y:i,w:s,h:o,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*it,it,!0),e.lineTo(n,i+o-a.bottomLeft),e.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,it,bt,!0),e.lineTo(n+s-a.bottomRight,i+o),e.arc(n+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,bt,0,!0),e.lineTo(n+s,i+a.topRight),e.arc(n+s-a.topRight,i+a.topRight,a.topRight,0,-bt,!0),e.lineTo(n+a.topLeft,i)}const Bw=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Fw=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zw(e,t){const n=(""+e).match(Bw);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const Uw=e=>+e||0;function ea(e,t){const n={},i=st(t),s=i?Object.keys(t):t,o=st(e)?i?a=>Q(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of s)n[a]=Uw(o(a));return n}function Dc(e){return ea(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ie(e){return ea(e,["topLeft","topRight","bottomLeft","bottomRight"])}function At(e){const t=Dc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function wt(e,t){e=e||{},t=t||_t.font;let n=Q(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Q(e.style,t.style);i&&!(""+i).match(Fw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Q(e.family,t.family),lineHeight:zw(Q(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Q(e.weight,t.weight),string:""};return s.string=Aw(s),s}function ki(e,t,n,i){let s,o,a;for(s=0,o=e.length;s<o;++s)if(a=e[s],a!==void 0&&a!==void 0)return a}function Vw(e,t,n){const{min:i,max:s}=e,o=rc(t,(s-i)/2),a=(r,l)=>n&&r===0?0:r+l;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function Le(e,t){return Object.assign(Object.create(e),t)}function na(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Ec("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>na([r,...e],t,o,i)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete e[0][l],!0},get(r,l){return Oc(r,l,()=>Xw(l,t,e,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,l){return Rc(r).includes(l)},ownKeys(r){return Rc(r)},set(r,l,c){const d=r._storage||(r._storage=s());return r[l]=d[l]=c,delete r._keys,!0}})}function An(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Cc(e,i),setContext:o=>An(e,o,n,i),override:o=>An(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete e[a],!0},get(o,a,r){return Oc(o,a,()=>$w(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(o,a,r){return e[a]=r,delete o[a],!0}})}function Cc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Gt(n)?n:()=>n,isIndexable:Gt(i)?i:()=>i}}const Hw=(e,t)=>e?e+jo(t):t,ia=(e,t)=>st(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Oc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function $w(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=e;let r=i[t];return Gt(r)&&a.isScriptable(t)&&(r=Yw(t,r,e,n)),dt(r)&&r.length&&(r=Ww(t,r,e,a.isIndexable)),ia(t,r)&&(r=An(r,s,o&&o[t],a)),r}function Yw(e,t,n,i){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=n;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=t(o,a||i);return r.delete(e),ia(e,l)&&(l=sa(s._scopes,s,e,l)),l}function Ww(e,t,n,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(st(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const h=sa(c,s,e,d);t.push(An(h,o,a&&a[e],r))}}return t}function Ac(e,t,n){return Gt(e)?e(t,n):e}const jw=(e,t)=>e===!0?t:typeof e=="string"?Pe(t,e):void 0;function qw(e,t,n,i,s){for(const o of t){const a=jw(n,o);if(a){e.add(a);const r=Ac(a._fallback,n,s);if(typeof r<"u"&&r!==n&&r!==i)return r}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function sa(e,t,n,i){const s=t._rootScopes,o=Ac(t._fallback,n,i),a=[...e,...s],r=new Set;r.add(i);let l=Pc(r,a,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Pc(r,a,o,l,i),l===null)?!1:na(Array.from(r),[""],s,o,()=>Gw(t,n,i))}function Pc(e,t,n,i,s){for(;n;)n=qw(e,t,n,i,s);return n}function Gw(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return dt(s)&&st(n)?n:s||{}}function Xw(e,t,n,i){let s;for(const o of t)if(s=Ec(Hw(o,e),n),typeof s<"u")return ia(e,s)?sa(n,i,e,s):s}function Ec(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Rc(e){let t=e._keys;return t||(t=e._keys=Kw(e._scopes)),t}function Kw(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Ic(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,a=new Array(i);let r,l,c,d;for(r=0,l=i;r<l;++r)c=r+n,d=t[c],a[r]={r:s.parse(Pe(d,o),c)};return a}const Zw=Number.EPSILON||1e-14,Pn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Lc=e=>e==="x"?"y":"x";function Qw(e,t,n,i){const s=e.skip?t:e,o=t,a=n.skip?t:n,r=Cn(o,s),l=Cn(a,o);let c=r/(r+l),d=l/(r+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const h=i*c,f=i*d;return{previous:{x:o.x-h*(a.x-s.x),y:o.y-h*(a.y-s.y)},next:{x:o.x+f*(a.x-s.x),y:o.y+f*(a.y-s.y)}}}function Jw(e,t,n){const i=e.length;let s,o,a,r,l,c=Pn(e,0);for(let d=0;d<i-1;++d)if(l=c,c=Pn(e,d+1),!(!l||!c)){if(pi(t[d],0,Zw)){n[d]=n[d+1]=0;continue}s=n[d]/t[d],o=n[d+1]/t[d],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),n[d]=s*a*t[d],n[d+1]=o*a*t[d])}}function tk(e,t,n="x"){const i=Lc(n),s=e.length;let o,a,r,l=Pn(e,0);for(let c=0;c<s;++c){if(a=r,r=l,l=Pn(e,c+1),!r)continue;const d=r[n],h=r[i];a&&(o=(d-a[n])/3,r[`cp1${n}`]=d-o,r[`cp1${i}`]=h-o*t[c]),l&&(o=(l[n]-d)/3,r[`cp2${n}`]=d+o,r[`cp2${i}`]=h+o*t[c])}}function ek(e,t="x"){const n=Lc(t),i=e.length,s=Array(i).fill(0),o=Array(i);let a,r,l,c=Pn(e,0);for(a=0;a<i;++a)if(r=l,l=c,c=Pn(e,a+1),!!l){if(c){const d=c[t]-l[t];s[a]=d!==0?(c[n]-l[n])/d:0}o[a]=r?c?ce(s[a-1])!==ce(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Jw(e,s,o),tk(e,o,t)}function Ts(e,t,n){return Math.max(Math.min(e,n),t)}function nk(e,t){let n,i,s,o,a,r=_e(e[0],t);for(n=0,i=e.length;n<i;++n)a=o,o=r,r=n<i-1&&_e(e[n+1],t),o&&(s=e[n],a&&(s.cp1x=Ts(s.cp1x,t.left,t.right),s.cp1y=Ts(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=Ts(s.cp2x,t.left,t.right),s.cp2y=Ts(s.cp2y,t.top,t.bottom)))}function ik(e,t,n,i,s){let o,a,r,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ek(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=Qw(c,r,e[Math.min(o+1,a-(i?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&nk(e,n)}function oa(){return typeof window<"u"&&typeof document<"u"}function aa(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ss(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const vs=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function sk(e,t){return vs(e).getPropertyValue(t)}const ok=["top","right","bottom","left"];function tn(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=ok[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const ak=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function rk(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(ak(s,o,e.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Ne(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=vs(n),o=s.boxSizing==="border-box",a=tn(s,"padding"),r=tn(s,"border","width"),{x:l,y:c,box:d}=rk(e,n),h=a.left+(d&&r.left),f=a.top+(d&&r.top);let{width:m,height:p}=t;return o&&(m-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-h)/m*n.width/i),y:Math.round((c-f)/p*n.height/i)}}function lk(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&aa(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const a=o.getBoundingClientRect(),r=vs(o),l=tn(r,"border","width"),c=tn(r,"padding");t=a.width-c.width-l.width,n=a.height-c.height-l.height,i=Ss(r.maxWidth,o,"clientWidth"),s=Ss(r.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||ps,maxHeight:s||ps}}const Be=e=>Math.round(e*10)/10;function ck(e,t,n,i){const s=vs(e),o=tn(s,"margin"),a=Ss(s.maxWidth,e,"clientWidth")||ps,r=Ss(s.maxHeight,e,"clientHeight")||ps,l=lk(e,t,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const f=tn(s,"border","width"),m=tn(s,"padding");c-=m.width+f.width,d-=m.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,i?c/i:d-o.height),c=Be(Math.min(c,a,l.maxWidth)),d=Be(Math.min(d,r,l.maxHeight)),c&&!d&&(d=Be(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&d>l.height&&(d=l.height,c=Be(Math.floor(d*i))),{width:c,height:d}}function Nc(e,t,n){const i=t||1,s=Be(e.height*i),o=Be(e.width*i);e.height=Be(e.height),e.width=Be(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(e.currentDevicePixelRatio=i,a.height=s,a.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const uk=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};oa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Bc(e,t){const n=sk(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function en(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function dk(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function hk(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},a=en(e,s,n),r=en(s,o,n),l=en(o,t,n),c=en(a,r,n),d=en(r,l,n);return en(c,d,n)}const fk=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},mk=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function En(e,t,n){return e?fk(t,n):mk()}function Fc(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function zc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Uc(e){return e==="angle"?{between:gi,compare:pw,normalize:Ft}:{between:ye,compare:(t,n)=>t-n,normalize:t=>t}}function Vc({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function pk(e,t,n){const{property:i,start:s,end:o}=n,{between:a,normalize:r}=Uc(i),l=t.length;let{start:c,end:d,loop:h}=e,f,m;if(h){for(c+=l,d+=l,f=0,m=l;f<m&&a(r(t[c%l][i]),s,o);++f)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:h,style:e.style}}function Hc(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,a=t.length,{compare:r,between:l,normalize:c}=Uc(i),{start:d,end:h,loop:f,style:m}=pk(e,t,n),p=[];let g=!1,y=null,_,x,T;const v=()=>l(s,T,_)&&r(s,T)!==0,w=()=>r(o,_)===0||l(o,T,_),M=()=>g||v(),D=()=>!g||w();for(let P=d,k=d;P<=h;++P)x=t[P%a],!x.skip&&(_=c(x[i]),_!==T&&(g=l(_,s,o),y===null&&M()&&(y=r(_,s)===0?P:k),y!==null&&D()&&(p.push(Vc({start:y,end:P,loop:f,count:a,style:m})),y=null),k=P,T=_));return y!==null&&p.push(Vc({start:y,end:h,loop:f,count:a,style:m})),p}function $c(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=Hc(i[s],e.points,t);o.length&&n.push(...o)}return n}function gk(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function yk(e,t,n,i){const s=e.length,o=[];let a=t,r=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?r.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function bk(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:a,end:r}=gk(n,s,o,i);if(i===!0)return Yc(e,[{start:a,end:r,loop:o}],n,t);const l=r<a?r+s:r,c=!!e._fullLoop&&a===0&&r===s-1;return Yc(e,yk(n,a,l,c),n,t)}function Yc(e,t,n,i){return!i||!i.setContext||!n?t:_k(e,t,n,i)}function _k(e,t,n,i){const s=e._chart.getContext(),o=Wc(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=n.length,c=[];let d=o,h=t[0].start,f=h;function m(p,g,y,_){const x=r?-1:1;if(p!==g){for(p+=l;n[p%l].skip;)p-=x;for(;n[g%l].skip;)g+=x;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:y,style:_}),d=_,h=g%l)}}for(const p of t){h=r?h:p.start;let g=n[h%l],y;for(f=h+1;f<=p.end;f++){const _=n[f%l];y=Wc(i.setContext(Le(s,{type:"segment",p0:g,p1:_,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),xk(y,d)&&m(h,f-1,p.loop,d),g=_,d=y}h<f-1&&m(h,f-1,p.loop,d)}return c}function Wc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function xk(e,t){if(!t)return!1;const n=[],i=function(s,o){return Ko(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Ms(e,t,n){return e.options.clip?e[n]:t[n]}function wk(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Ms(n,t,"left"),right:Ms(n,t,"right"),top:Ms(i,t,"top"),bottom:Ms(i,t,"bottom")}:t}function jc(e,t){const n=t._clip;if(n.disabled)return!1;const i=wk(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class kk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],a=n.duration;o.forEach(r=>r({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=yc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var xe=new kk;const qc="transparent",Tk={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=xs(e||qc),s=i.valid&&xs(t||qc);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Sk{constructor(t,n,i,s){const o=n[i];s=ki([t.to,s,o,t.from]);const a=ki([t.from,o,s]);this._active=!0,this._fn=t.fn||Tk[t.type||typeof a],this._easing=yi[t.easing]||yi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ki([t.to,n,s,t.from]),this._from=ki([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||n<i),!this._active){this._target[s]=r,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class ra{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!st(t))return;const n=Object.keys(_t.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!st(o))return;const a={};for(const r of n)a[r]=o[r];(dt(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,n){const i=n.options,s=Mk(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&vk(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),r=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,n));continue}const d=n[c];let h=o[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,d,r);continue}else h.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=h=new Sk(f,t,c,d),s.push(h)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return xe.add(this._chart,i),!0}}function vk(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Mk(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Gc(e,t){const n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Dk(e,t,n){if(n===!1)return!1;const i=Gc(e,n),s=Gc(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Ck(e){let t,n,i,s;return st(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function Xc(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function Kc(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let a,r,l,c;if(t===null)return;let d=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===n){if(d=!0,i.all)continue;break}c=e.values[l],xt(c)&&(o||t===0||ce(t)===ce(c))&&(t+=c)}return!d&&!i.all?0:t}function Ok(e,t){const{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(e),r=new Array(a.length);let l,c,d;for(l=0,c=a.length;l<c;++l)d=a[l],r[l]={[s]:d,[o]:e[d]};return r}function la(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Ak(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Pk(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Ek(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Zc(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Qc(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,d=Ak(o,a,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:g,[c]:y}=p,_=p._stacks||(p._stacks={});f=_[c]=Ek(s,d,g),f[r]=y,f._top=Zc(f,a,!0,i.type),f._bottom=Zc(f,a,!1,i.type);const x=f._visualValues||(f._visualValues={});x[r]=y}}function ca(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Rk(e,t){return Le(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ik(e,t,n){return Le(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ti(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const ua=e=>e==="reset"||e==="none",Jc=(e,t)=>t?e:Object.assign({},e),Lk=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Xc(n,!0),values:null};class Fe{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=la(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&&Ti(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,o=n.xAxisID=Q(i.xAxisID,ca(t,"x")),a=n.yAxisID=Q(i.yAxisID,ca(t,"y")),r=n.rAxisID=Q(i.rAxisID,ca(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,a,r),d=n.vAxisID=s(l,a,o,r);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(r),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&pc(this._data,this),t._stacked&&Ti(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(st(n)){const s=this._cachedMeta;this._data=Ok(n,s)}else if(i!==n){if(i){pc(i,this);const s=this._cachedMeta;Ti(s),s._parsed=[]}n&&Object.isExtensible(n)&&_w(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=la(n.vScale,n),n.stack!==i.stack&&(s=!0,Ti(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(Qc(this,n._parsed),n._stacked=la(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],d,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{dt(s[t])?f=this.parseArrayData(i,s,t,n):st(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);const m=()=>h[r]===null||c&&h[r]<c[r];for(d=0;d<n;++d)i._parsed[d+t]=h=f[d],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&Qc(this,f)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),d=o===a,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[r]:d||o.parse(c[p],p),[l]:a.parse(n[p],p)};return h}parseArrayData(t,n,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,d,h;for(l=0,c=s;l<c;++l)d=l+i,h=n[d],r[l]={x:o.parse(h[0],d),y:a.parse(h[1],d)};return r}parseObjectData(t,n,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,h,f,m;for(d=0,h=s;d<h;++d)f=d+i,m=n[f],c[d]={x:o.parse(Pe(m,r),f),y:a.parse(Pe(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,a=n[t.axis],r={keys:Xc(s,!0),values:n._stacks[t.axis]._visualValues};return Kc(r,a,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let a=o===null?NaN:o;const r=s&&i._stacks[n.axis];s&&r&&(s.values=r,a=Kc(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=Lk(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=Pk(r);let f,m;function p(){m=s[f];const g=m[r.axis];return!xt(m[t.axis])||d>g||h<g}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=n.length;s<o;++s)a=n[s][t.axis],xt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Ck(Q(this.options.clip,Dk(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(t,o,r,l),d=r;d<r+l;++d){const h=s[d];h.hidden||(h.active&&c?a.push(h):h.draw(t,o))}for(d=0;d<a.length;++d)a[d].draw(t,o)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Ik(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Rk(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const s=n==="active",o=this._cachedDataOpts,a=t+"-"+n,r=o[a],l=this.enableOptionSharing&&qt(i);if(r)return Jc(r,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),d),m=Object.keys(_t.elements[t]),p=()=>this.getContext(i,s,n),g=c.resolveNamedOptions(f,m,p,h);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(Jc(g,l))),g}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(f,this.getContext(t,i,n))}const c=new ra(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||ua(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:a}}updateElement(t,n,i,s){ua(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!ua(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,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 n=this._data,i=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=i.length,o=n.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,a=t+n;let r;const l=c=>{for(c.length+=n,r=c.length-1;r>=a;r--)c[r]=c[r-n]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&Ti(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](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,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Nk(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=gc(i.sort((s,o)=>s-o))}return e._cache.$bar}function Bk(e){const t=e.iScale,n=Nk(t,e.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(qt(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(s=0,o=n.length;s<o;++s)a=t.getPixelForValue(n[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return i}function Fk(e,t,n,i){const s=n.barThickness;let o,a;return G(s)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[e]-o/2}}function zk(e,t,n,i){const s=t.pixels,o=s[e];let a=e>0?s[e-1]:null,r=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:n.barPercentage,start:c}}function Uk(e,t,n,i){const s=n.parse(e[0],i),o=n.parse(e[1],i),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function tu(e,t,n,i){return dt(e)?Uk(e,t,n,i):t[n.axis]=n.parse(e,i),t}function eu(e,t,n,i){const s=e.iScale,o=e.vScale,a=s.getLabels(),r=s===o,l=[];let c,d,h,f;for(c=n,d=n+i;c<d;++c)f=t[c],h={},h[s.axis]=r||s.parse(a[c],c),l.push(tu(f,h,o,c));return l}function da(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Vk(e,t,n){return e!==0?ce(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Hk(e){let t,n,i,s,o;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:t,top:s,bottom:o}}function $k(e,t,n,i){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:d}=Hk(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?s=c:(n._bottom||0)===i?s=d:(o[nu(d,a,r,l)]=!0,s=c)),o[nu(s,a,r,l)]=!0,e.borderSkipped=o}function nu(e,t,n,i){return i?(e=Yk(e,t,n),e=iu(e,n,t)):e=iu(e,t,n),e}function Yk(e,t,n){return e===t?n:e===n?t:e}function iu(e,t,n){return e==="start"?t:e==="end"?n:e}function Wk(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class su extends Fe{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,s){return eu(t,n,i,s)}parseArrayData(t,n,i,s){return eu(t,n,i,s)}parseObjectData(t,n,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,d=a.axis==="x"?r:l,h=[];let f,m,p,g;for(f=i,m=i+s;f<m;++f)g=n[f],p={},p[o.axis]=o.parse(Pe(g,c),f),h.push(tu(Pe(g,d),p,a,f));return h}updateRangeFromParsed(t,n,i,s){super.updateRangeFromParsed(t,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(t),a=o._custom,r=da(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),g=o||G(p[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,d),_=(p._stacks||{})[r.axis],x={horizontal:c,base:g.base,enableBorderRadius:!_||da(p._custom)||a===_._top||a===_._bottom,x:c?g.head:y.center,y:c?y.center:g.head,height:c?y.size:Math.abs(g.size),width:c?Math.abs(g.size):y.size};f&&(x.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const T=x.options||t[m].options;$k(x,T,_,a),Wk(x,T,d.ratio),this.updateElement(t[m],m,x,s)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(n),l=r&&r[i.axis],c=d=>{const h=d._parsed.find(m=>m[i.axis]===l),f=h&&h[d.vScale.axis];if(G(f)||isNaN(f))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((o===!1||a.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&a.push(d.stack),d.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,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Q(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const s=this._getStacks(t,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,a;for(o=0,a=n.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||Bk(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,d=da(c);let h=l[n.axis],f=0,m=i?this.applyStack(n,l,i):h,p,g;m!==h&&(f=m-h,m=h),d&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&ce(h)!==ce(c.barEnd)&&(f=0),f+=h);const y=!G(o)&&!d?o:f;let _=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+m):p=_,g=p-_,Math.abs(g)<a){g=Vk(g,n,r)*a,h===r&&(_-=g/2);const x=n.getPixelForDecimal(0),T=n.getPixelForDecimal(1),v=Math.min(x,T),w=Math.max(x,T);_=Math.max(Math.min(_,w),v),p=_+g,i&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(_))}if(_===n.getPixelForValue(r)){const x=ce(g)*n.getLineWidthForValue(r)/2;_+=x,g-=x}return{size:g,base:_,head:p,center:p+g/2}}_calculateBarIndexPixels(t,n){const i=n.scale,s=this.options,o=s.skipNull,a=Q(s.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(n.grouped){const d=o?this._getStackCount(t):n.stackCount,h=s.barThickness==="flex"?zk(t,n,s,d*c):Fk(t,n,s,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Q(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;r=h.start+h.chunk*p+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,n.min*n.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class jk extends Fe{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,s){const o=super.parsePrimitiveData(t,n,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(t,n,i,s){const o=super.parseArrayData(t,n,i,s);for(let a=0;a<o.length;a++){const r=n[i+a];o[a]._custom=Q(r[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(t,n,i,s){const o=super.parseObjectData(t,n,i,s);for(let a=0;a<o.length;a++){const r=n[i+a];o[a]._custom=Q(r&&r.r&&+r.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),d=a.axis,h=r.axis;for(let f=n;f<n+i;f++){const m=t[f],p=!o&&this.getParsed(f),g={},y=g[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[d]),_=g[h]=o?r.getBasePixel():r.getPixelForValue(p[h]);g.skip=isNaN(y)||isNaN(_),c&&(g.options=l||this.resolveDataElementOptions(f,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,f,g,s)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=Q(i&&i._custom,o),s}}function qk(e,t,n){let i=1,s=1,o=0,a=0;if(t<yt){const r=e,l=r+t,c=Math.cos(r),d=Math.sin(r),h=Math.cos(l),f=Math.sin(l),m=(T,v,w)=>gi(T,r,l,!0)?1:Math.max(v,v*n,w,w*n),p=(T,v,w)=>gi(T,r,l,!0)?-1:Math.min(v,v*n,w,w*n),g=m(0,c,h),y=m(bt,d,f),_=p(it,c,h),x=p(it+bt,d,f);i=(g-_)/2,s=(y-x)/2,o=-(g+_)/2,a=-(y+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class Si extends Fe{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:a&&(r||h.borderRadius),index:c}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(st(i[t])){const{key:l="value"}=this._parsing;o=c=>+Pe(i[c],l)}let a,r;for(a=t,r=t+n;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return Ot(this.options.rotation-90)}_getCircumference(){return Ot(this.options.circumference)}_getRotationExtents(){let t=yt,n=-yt;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,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(ow(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:g}=qk(h,d,l),y=(i.width-a)/f,_=(i.height-a)/m,x=Math.max(Math.min(y,_)/2,0),T=rc(this.options.radius,x),v=Math.max(T*l,0),w=(T-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*T,this.offsetY=g*T,s.total=this.calculateTotal(),this.outerRadius=T-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/yt)}updateElements(t,n,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,d=(r.left+r.right)/2,h=(r.top+r.bottom)/2,f=o&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(n,s);let _=this._getRotation(),x;for(x=0;x<n;++x)_+=this._circumference(x,o);for(x=n;x<n+i;++x){const T=this._circumference(x,o),v=t[x],w={x:d+this.offsetX,y:h+this.offsetY,startAngle:_,endAngle:_+T,circumference:T,outerRadius:p,innerRadius:m};y&&(w.options=g||this.resolveDataElementOptions(x,v.active?"active":s)),_+=T,this.updateElement(v,x,w,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?yt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=bi(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Q(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class ou extends Fe{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:r,count:l}=_c(n,s,a);this._drawStart=r,this._drawCount=l,xc(n)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._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,r,l,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,s),f=a.axis,m=r.axis,{spanGaps:p,segment:g}=this.options,y=Re(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",x=n+i,T=t.length;let v=n>0&&this.getParsed(n-1);for(let w=0;w<T;++w){const M=t[w],D=_?M:{};if(w<n||w>=x){D.skip=!0;continue}const P=this.getParsed(w),k=G(P[m]),S=D[f]=a.getPixelForValue(P[f],w),A=D[m]=o||k?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,P,l):P[m],w);D.skip=isNaN(S)||isNaN(A)||k,D.stop=w>0&&Math.abs(P[f]-v[f])>y,g&&(D.parsed=P,D.raw=c.data[w]),h&&(D.options=d||this.resolveDataElementOptions(w,M.active?"active":s)),_||this.updateElement(M,w,D,s),v=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class au extends Fe{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=bi(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return Ic.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,n,i,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*it;let m=f,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,g);for(p=n;p<n+i;p++){const y=t[p];let _=m,x=m+this._computeAngle(p,s,g),T=a.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=x,o&&(l.animateScale&&(T=0),l.animateRotate&&(_=x=f));const v={x:d,y:h,innerRadius:0,outerRadius:T,startAngle:_,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,v,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Ot(this.resolveDataElementOptions(t,n).angle||i):0}}class Gk extends Si{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Xk extends Fe{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return Ic.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=n;r<n+i;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),d=o.getPointPositionForValue(r,this.getParsed(r).r),h=a?o.xCenter:d.x,f=a?o.yCenter:d.y,m={x:h,y:f,angle:d.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,r,m,s)}}}class ru extends Fe{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+l+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:a}=_c(n,i,s);if(this._drawStart=o,this._drawCount=a,xc(n)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=n;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,s),h=this.getSharedOptions(d),f=this.includeOptions(s,h),m=a.axis,p=r.axis,{spanGaps:g,segment:y}=this.options,_=Re(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let T=n>0&&this.getParsed(n-1);for(let v=n;v<n+i;++v){const w=t[v],M=this.getParsed(v),D=x?w:{},P=G(M[p]),k=D[m]=a.getPixelForValue(M[m],v),S=D[p]=o||P?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,M,l):M[p],v);D.skip=isNaN(k)||isNaN(S)||P,D.stop=v>0&&Math.abs(M[m]-T[m])>_,y&&(D.parsed=M,D.raw=c.data[v]),f&&(D.options=h||this.resolveDataElementOptions(v,w.active?"active":s)),x||this.updateElement(w,v,D,s),T=M}this.updateSharedOptions(h,s,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let r=0;for(let l=n.length-1;l>=0;--l)r=Math.max(r,n[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}}var Kk=Object.freeze({__proto__:null,BarController:su,BubbleController:jk,DoughnutController:Si,LineController:ou,PieController:Gk,PolarAreaController:au,RadarController:Xk,ScatterController:ru});function nn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ha{static override(t){Object.assign(ha.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return nn()}parse(){return nn()}format(){return nn()}add(){return nn()}diff(){return nn()}startOf(){return nn()}endOf(){return nn()}}var lu={_date:ha};function Zk(e,t,n,i){const{controller:s,data:o,_sorted:a}=e,r=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?yw:be;if(i){if(s._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(o,t,n-h),m=c(o,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const d=c(o,t,n);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=e,m=f.slice(0,d.lo+1).reverse().findIndex(g=>!G(g[h.axis]));d.lo-=Math.max(0,m);const p=f.slice(d.hi).findIndex(g=>!G(g[h.axis]));d.hi+=Math.max(0,p)}return d}}return{lo:0,hi:o.length-1}}function vi(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:d}=o[r],{lo:h,hi:f}=Zk(o[r],t,a,s);for(let m=h;m<=f;++m){const p=d[m];p.skip||i(p,c,m)}}}function Qk(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,a=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function fa(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||vi(e,n,t,function(r,l,c){!s&&!_e(r,e.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Jk(e,t,n,i){let s=[];function o(a,r,l){const{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:h}=bs(a,{x:t.x,y:t.y});gi(h,c,d)&&s.push({element:a,datasetIndex:r,index:l})}return vi(e,n,t,o),s}function tT(e,t,n,i,s,o){let a=[];const r=Qk(n);let l=Number.POSITIVE_INFINITY;function c(d,h,f){const m=d.inRange(t.x,t.y,s);if(i&&!m)return;const p=d.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!m)return;const y=r(t,p);y<l?(a=[{element:d,datasetIndex:h,index:f}],l=y):y===l&&a.push({element:d,datasetIndex:h,index:f})}return vi(e,n,t,c),a}function ma(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Jk(e,t,n,s):tT(e,t,n,i,s,o)}function cu(e,t,n,i,s){const o=[],a=n==="x"?"inXRange":"inYRange";let r=!1;return vi(e,n,t,(l,c,d)=>{l[a]&&l[a](t[n],s)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var pa={evaluateInteractionItems:vi,modes:{index(e,t,n,i){const s=Ne(t,e),o=n.axis||"x",a=n.includeInvisible||!1,r=n.intersect?fa(e,s,o,i,a):ma(e,s,o,!1,i,a),l=[];return r.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,h=c.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,i){const s=Ne(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let r=n.intersect?fa(e,s,o,i,a):ma(e,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=e.getDatasetMeta(l).data;r=[];for(let d=0;d<c.length;++d)r.push({element:c[d],datasetIndex:l,index:d})}return r},point(e,t,n,i){const s=Ne(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return fa(e,s,o,i,a)},nearest(e,t,n,i){const s=Ne(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return ma(e,s,o,n.intersect,i,a)},x(e,t,n,i){const s=Ne(t,e);return cu(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=Ne(t,e);return cu(e,s,"y",n.intersect,i)}}};const uu=["left","top","right","bottom"];function Mi(e,t){return e.filter(n=>n.pos===t)}function du(e,t){return e.filter(n=>uu.indexOf(n.pos)===-1&&n.box.axis===t)}function Di(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function eT(e){const t=[];let n,i,s,o,a,r;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function nT(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!uu.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function iT(e,t){const n=nT(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=e.length;o<a;++o){r=e[o];const{fullSize:l}=r.box,c=n[r.stack],d=c&&r.stackWeight/c.weight;r.horizontal?(r.width=d?d*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=d?d*s:l&&t.availableHeight)}return n}function sT(e){const t=eT(e),n=Di(t.filter(c=>c.box.fullSize),!0),i=Di(Mi(t,"left"),!0),s=Di(Mi(t,"right")),o=Di(Mi(t,"top"),!0),a=Di(Mi(t,"bottom")),r=du(t,"x"),l=du(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Mi(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function hu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function fu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function oT(e,t,n,i){const{pos:s,box:o}=n,a=e.maxPadding;if(!st(s)){n.size&&(e[s]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[s]+=n.size}o.getPadding&&fu(a,o.getPadding());const r=Math.max(0,t.outerWidth-hu(a,e,"left","right")),l=Math.max(0,t.outerHeight-hu(a,e,"top","bottom")),c=r!==e.w,d=l!==e.h;return e.w=r,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function aT(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function rT(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return i(e?["left","right"]:["top","bottom"])}function Ci(e,t,n,i){const s=[];let o,a,r,l,c,d;for(o=0,a=e.length,c=0;o<a;++o){r=e[o],l=r.box,l.update(r.width||t.w,r.height||t.h,rT(r.horizontal,t));const{same:h,other:f}=oT(t,n,r,i);c|=h&&s.length,d=d||f,l.fullSize||s.push(r)}return c&&Ci(s,t,n,i)||d}function Ds(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function mu(e,t,n,i){const s=n.padding;let{x:o,y:a}=t;for(const r of e){const l=r.box,c=i[r.stack]||{placed:0,weight:1},d=r.stackWeight/c.weight||1;if(r.horizontal){const h=t.w*d,f=c.size||l.height;qt(c.start)&&(a=c.start),l.fullSize?Ds(l,s.left,a,n.outerWidth-s.right-s.left,f):Ds(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*d,f=c.size||l.width;qt(c.start)&&(o=c.start),l.fullSize?Ds(l,o,s.top,f,n.outerHeight-s.bottom-s.top):Ds(l,o,t.top+c.placed,f,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=a}var Ut={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const s=At(e.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(n-s.height,0),r=sT(e.boxes),l=r.vertical,c=r.horizontal;pt(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const d=l.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},s);fu(f,At(i));const m=Object.assign({maxPadding:f,w:o,h:a,x:s.left,y:s.top},s),p=iT(l.concat(c),h);Ci(r.fullSize,m,h,p),Ci(l,m,h,p),Ci(c,m,h,p)&&Ci(l,m,h,p),aT(m),mu(r.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,mu(r.rightAndBottom,m,h,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},pt(r.chartArea,g=>{const y=g.box;Object.assign(y,e.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class pu{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class lT extends pu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Cs="$chartjs",cT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gu=e=>e===null||e==="";function uT(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Cs]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",gu(s)){const o=Bc(e,"width");o!==void 0&&(e.width=o)}if(gu(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Bc(e,"height");o!==void 0&&(e.height=o)}return e}const yu=uk?{passive:!0}:!1;function dT(e,t,n){e&&e.addEventListener(t,n,yu)}function hT(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,yu)}function fT(e,t){const n=cT[e.type]||e.type,{x:i,y:s}=Ne(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Os(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function mT(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Os(r.addedNodes,i),a=a&&!Os(r.removedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function pT(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Os(r.removedNodes,i),a=a&&!Os(r.addedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oi=new Map;let bu=0;function _u(){const e=window.devicePixelRatio;e!==bu&&(bu=e,Oi.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function gT(e,t){Oi.size||window.addEventListener("resize",_u),Oi.set(e,t)}function yT(e){Oi.delete(e),Oi.size||window.removeEventListener("resize",_u)}function bT(e,t,n){const i=e.canvas,s=i&&aa(i);if(!s)return;const o=bc((r,l)=>{const c=s.clientWidth;n(r,l),c<s.clientWidth&&n()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(s),gT(e,o),a}function ga(e,t,n){n&&n.disconnect(),t==="resize"&&yT(e)}function _T(e,t,n){const i=e.canvas,s=bc(o=>{e.ctx!==null&&n(fT(o,e))},e);return dT(i,t,s),s}class xT extends pu{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(uT(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Cs])return!1;const i=n[Cs].initial;["height","width"].forEach(o=>{const a=i[o];G(a)?n.removeAttribute(o):n.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Cs],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),a={attach:mT,detach:pT,resize:bT}[n]||_T;s[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ga,detach:ga,resize:ga}[n]||hT)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return ck(t,n,i,s)}isAttached(t){const n=t&&aa(t);return!!(n&&n.isConnected)}}function wT(e){return!oa()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?lT:xT}class Vt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Re(this.x)&&Re(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function kT(e,t){const n=e.options.ticks,i=TT(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?vT(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return MT(t,c,o,a/s),c;const d=ST(o,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-r)/(a-1)):null;for(As(t,c,d,G(m)?0:r-m,r),h=0,f=a-1;h<f;h++)As(t,c,d,o[h],o[h+1]);return As(t,c,d,l,G(m)?t.length:l+m),c}return As(t,c,d),c}function TT(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function ST(e,t,n){const i=DT(e),s=t.length/n;if(!i)return Math.max(s,1);const o=hw(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function vT(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function MT(e,t,n,i){let s=0,o=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===o&&(t.push(e[a]),s++,o=n[s*i])}function As(e,t,n,i,s){const o=Q(i,0),a=Math.min(Q(s,e.length),e.length);let r=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),d=o;d<0;)r++,d=Math.round(o+r*n);for(c=Math.max(o,0);c<a;c++)c===d&&(t.push(e[c]),r++,d=Math.round(o+r*n))}function DT(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const CT=e=>e==="left"?"right":e==="right"?"left":e,xu=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,wu=(e,t)=>Math.min(t||e,e);function ku(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function OT(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,a=e._endPixel,r=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function AT(e,t){pt(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ai(e){return e.drawTicks?e.tickLength:0}function Tu(e,t){if(!e.display)return 0;const n=wt(e.font,t),i=At(e.padding);return(dt(e.text)?e.text.length:1)*n.lineHeight+i.height}function PT(e,t){return Le(e,{scale:t,type:"scale"})}function ET(e,t,n){return Le(e,{tick:n,index:t,type:"tick"})}function RT(e,t,n){let i=Xo(e);return(n&&t!=="right"||!n&&t==="right")&&(i=CT(i)),i}function IT(e,t,n,i){const{top:s,left:o,bottom:a,right:r,chart:l}=e,{chartArea:c,scales:d}=l;let h=0,f,m,p;const g=a-s,y=r-o;if(e.isHorizontal()){if(m=zt(i,o,r),st(n)){const _=Object.keys(n)[0],x=n[_];p=d[_].getPixelForValue(x)+g-t}else n==="center"?p=(c.bottom+c.top)/2+g-t:p=xu(e,n,t);f=r-o}else{if(st(n)){const _=Object.keys(n)[0],x=n[_];m=d[_].getPixelForValue(x)-y+t}else n==="center"?m=(c.left+c.right)/2-y+t:m=xu(e,n,t);p=zt(i,a,s),h=n==="left"?-bt:bt}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class sn extends Vt{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=te(t,Number.POSITIVE_INFINITY),n=te(n,Number.NEGATIVE_INFINITY),i=te(i,Number.POSITIVE_INFINITY),s=te(s,Number.NEGATIVE_INFINITY),{min:te(t,i),max:te(n,s),minDefined:xt(t),maxDefined:xt(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:n,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(n=Math.min(n,a.min)),o||(i=Math.max(i,a.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:te(n,te(i,n)),max:te(i,te(n,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(){mt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,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=Vw(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?ku(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=kT(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,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){mt(this.options.afterUpdate,[this])}beforeSetDimensions(){mt(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(){mt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),mt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){mt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=mt(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){mt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){mt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=wu(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),h=d.widest.width,f=d.highest.height,m=Rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:m/(i-1),h+6>r&&(r=m/(i-(t.offset?.5:1)),l=this.maxHeight-Ai(t.grid)-n.padding-Tu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=ys(Math.min(Math.asin(Rt((d.highest.height+6)/r,-1,1)),Math.asin(Rt(l/c,-1,1))-Math.asin(Rt(f/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){mt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){mt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Tu(s,n.options.font);if(r?(t.width=this.maxWidth,t.height=Ai(o)+l):(t.height=this.maxHeight,t.width=Ai(o)+l),i.display&&this.ticks.length){const{first:c,last:d,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Ot(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(r){const _=i.mirror?0:y*h.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+_+m)}else{const _=i.mirror?0:g*h.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+_+m)}this._calculatePadding(c,d,y,g)}}this._handleMargins(),r?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=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*n.height):(f=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let d=n.height/2,h=t.height/2;o==="start"?(d=0,h=t.height):o==="end"&&(d=n.height,h=0),this.paddingTop=d+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(){mt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)G(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=ku(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(n/wu(n,i));let c=0,d=0,h,f,m,p,g,y,_,x,T,v,w;for(h=0;h<n;h+=l){if(p=t[h].label,g=this._resolveTickFontOptions(h),s.font=y=g.string,_=o[y]=o[y]||{data:{},gc:[]},x=g.lineHeight,T=v=0,!G(p)&&!dt(p))T=ks(s,_.data,_.gc,T,p),v=x;else if(dt(p))for(f=0,m=p.length;f<m;++f)w=p[f],!G(w)&&!dt(w)&&(T=ks(s,_.data,_.gc,T,w),v+=x);a.push(T),r.push(v),c=Math.max(T,c),d=Math.max(v,d)}AT(o,n);const M=a.indexOf(c),D=r.indexOf(d),P=k=>({width:a[k]||0,height:r[k]||0});return{first:P(0),last:P(n-1),widest:P(M),highest:P(D),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return gw(this._alignToPixels?Qe(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=ET(this.getContext(),t,i))}return this.$context||(this.$context=PT(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ot(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=Ai(o),m=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,_=function($){return Qe(i,$,g)};let x,T,v,w,M,D,P,k,S,A,L,R;if(a==="top")x=_(this.bottom),D=this.bottom-f,k=x-y,A=_(t.top)+y,R=t.bottom;else if(a==="bottom")x=_(this.top),A=t.top,R=_(t.bottom)-y,D=x+y,k=this.top+f;else if(a==="left")x=_(this.right),M=this.right-f,P=x-y,S=_(t.left)+y,L=t.right;else if(a==="right")x=_(this.left),S=t.left,L=_(t.right)-y,M=x+y,P=this.left+f;else if(n==="x"){if(a==="center")x=_((t.top+t.bottom)/2+.5);else if(st(a)){const $=Object.keys(a)[0],K=a[$];x=_(this.chart.scales[$].getPixelForValue(K))}A=t.top,R=t.bottom,D=x+y,k=D+f}else if(n==="y"){if(a==="center")x=_((t.left+t.right)/2);else if(st(a)){const $=Object.keys(a)[0],K=a[$];x=_(this.chart.scales[$].getPixelForValue(K))}M=x-y,P=M-f,S=t.left,L=t.right}const H=Q(s.ticks.maxTicksLimit,h),W=Math.max(1,Math.ceil(h/H));for(T=0;T<h;T+=W){const $=this.getContext(T),K=o.setContext($),lt=r.setContext($),rt=K.lineWidth,X=K.color,z=lt.dash||[],C=lt.dashOffset,E=K.tickWidth,N=K.tickColor,V=K.tickBorderDash||[],tt=K.tickBorderDashOffset;v=OT(this,T,l),v!==void 0&&(w=Qe(i,v,rt),c?M=P=S=L=w:D=k=A=R=w,m.push({tx1:M,ty1:D,tx2:P,ty2:k,x1:S,y1:A,x2:L,y2:R,width:rt,color:X,borderDash:z,borderDashOffset:C,tickWidth:E,tickColor:N,tickBorderDash:V,tickBorderDashOffset:tt}))}return this._ticksLength=h,this._borderValue=x,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:d,mirror:h}=o,f=Ai(i.grid),m=f+d,p=h?-d:m,g=-Ot(this.labelRotation),y=[];let _,x,T,v,w,M,D,P,k,S,A,L,R="middle";if(s==="top")M=this.bottom-p,D=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+p,D=this._getXAxisLabelAlignment();else if(s==="left"){const W=this._getYAxisLabelAlignment(f);D=W.textAlign,w=W.x}else if(s==="right"){const W=this._getYAxisLabelAlignment(f);D=W.textAlign,w=W.x}else if(n==="x"){if(s==="center")M=(t.top+t.bottom)/2+m;else if(st(s)){const W=Object.keys(s)[0],$=s[W];M=this.chart.scales[W].getPixelForValue($)+m}D=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")w=(t.left+t.right)/2-m;else if(st(s)){const W=Object.keys(s)[0],$=s[W];w=this.chart.scales[W].getPixelForValue($)}D=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?R="top":l==="end"&&(R="bottom"));const H=this._getLabelSizes();for(_=0,x=r.length;_<x;++_){T=r[_],v=T.label;const W=o.setContext(this.getContext(_));P=this.getPixelForTick(_)+o.labelOffset,k=this._resolveTickFontOptions(_),S=k.lineHeight,A=dt(v)?v.length:1;const $=A/2,K=W.color,lt=W.textStrokeColor,rt=W.textStrokeWidth;let X=D;a?(w=P,D==="inner"&&(_===x-1?X=this.options.reverse?"left":"right":_===0?X=this.options.reverse?"right":"left":X="center"),s==="top"?c==="near"||g!==0?L=-A*S+S/2:c==="center"?L=-H.highest.height/2-$*S+S:L=-H.highest.height+S/2:c==="near"||g!==0?L=S/2:c==="center"?L=H.highest.height/2-$*S:L=H.highest.height-A*S,h&&(L*=-1),g!==0&&!W.showLabelBackdrop&&(w+=S/2*Math.sin(g))):(M=P,L=(1-A)*S/2);let z;if(W.showLabelBackdrop){const C=At(W.backdropPadding),E=H.heights[_],N=H.widths[_];let V=L-C.top,tt=0-C.left;switch(R){case"middle":V-=E/2;break;case"bottom":V-=E;break}switch(D){case"center":tt-=N/2;break;case"right":tt-=N;break;case"inner":_===x-1?tt-=N:_>0&&(tt-=N/2);break}z={left:tt,top:V,width:N+C.width,height:E+C.height,color:W.backdropColor}}y.push({label:v,font:k,textOffset:L,options:{rotation:g,color:K,strokeColor:lt,strokeWidth:rt,textAlign:X,textBaseline:R,translation:[w,M],backdrop:z}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ot(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,d;return n==="left"?s?(d=this.right+o,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+o,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,a=s.length;o<a;++o){const l=s[o];n.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&r({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:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,h,f;this.isHorizontal()?(c=Qe(t,this.left,a)-a/2,d=Qe(t,this.right,r)+r/2,h=f=l):(h=Qe(t,this.top,a)-a/2,f=Qe(t,this.bottom,r)+r/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,h),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&xi(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,d=a.textOffset;Je(i,c,0,d,l,r)}s&&wi(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=wt(i.font),a=At(i.padding),r=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||st(n)?(l+=a.bottom,dt(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:d,maxWidth:h,rotation:f}=IT(this,l,n,r);Je(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:f,textAlign:RT(r,n,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=Q(t.grid&&t.grid.z,-1),s=Q(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==sn.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=n.length;o<a;++o){const r=n[o];r[i]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return wt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ps{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;BT(n)&&(i=this.register(n));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,LT(t,a,i),this.override&&_t.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in _t[s]&&(delete _t[s][i],this.override&&delete Ze[i])}}function LT(e,t,n){const i=fi(Object.create(null),[n?_t.get(n):{},_t.get(t),e.defaults]);_t.set(t,i),e.defaultRoutes&&NT(t,e.defaultRoutes),e.descriptors&&_t.describe(t,e.descriptors)}function NT(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),a=t[n].split("."),r=a.pop(),l=a.join(".");_t.route(o,s,l,r)})}function BT(e){return"id"in e&&"defaults"in e}class FT{constructor(){this.controllers=new Ps(Fe,"datasets",!0),this.elements=new Ps(Vt,"elements"),this.plugins=new Ps(Object,"plugins"),this.scales=new Ps(sn,"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,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):pt(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,n,i){const s=jo(t);mt(i["before"+s],[],i),n[t](i),mt(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var ue=new FT;class zT{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,n,i,s){s=s||{};for(const o of t){const a=o.plugin,r=a[i],l=[n,s,o.options];if(mt(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){G(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=Q(i.options&&i.options.plugins,{}),o=UT(i);return s===!1&&!n?[]:HT(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function UT(e){const t={},n=[],i=Object.keys(ue.plugins.items);for(let o=0;o<i.length;o++)n.push(ue.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function VT(e,t){return!t&&e===!1?null:e===!0?{}:e}function HT(e,{plugins:t,localIds:n},i,s){const o=[],a=e.getContext();for(const r of t){const l=r.id,c=VT(i[l],s);c!==null&&o.push({plugin:r,options:$T(e.config,{plugin:r,local:n[l]},c,a)})}return o}function $T(e,{plugin:t,local:n},i,s){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(i,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ya(e,t){const n=_t.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function YT(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function WT(e,t){return e===t?"_index_":"_value_"}function Su(e){if(e==="x"||e==="y"||e==="r")return e}function jT(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function ba(e,...t){if(Su(e))return e;for(const n of t){const i=n.axis||jT(n.position)||e.length>1&&Su(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function vu(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function qT(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return vu(e,"x",n[0])||vu(e,"y",n[0])}return{}}function GT(e,t){const n=Ze[e.type]||{scales:{}},i=t.scales||{},s=ya(e.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!st(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=ba(a,r,qT(a,e),_t.scales[r.type]),c=WT(l,s),d=n.scales||{};o[a]=mi(Object.create(null),[{axis:l},r,d[l],d[c]])}),e.data.datasets.forEach(a=>{const r=a.type||e.type,l=a.indexAxis||ya(r,t),d=(Ze[r]||{}).scales||{};Object.keys(d).forEach(h=>{const f=YT(h,l),m=a[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),mi(o[m],[{axis:f},i[m],d[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];mi(r,[_t.scales[r.type],_t.scale])}),o}function Mu(e){const t=e.options||(e.options={});t.plugins=Q(t.plugins,{}),t.scales=GT(e,t)}function Du(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function XT(e){return e=e||{},e.data=Du(e.data),Mu(e),e}const Cu=new Map,Ou=new Set;function Es(e,t){let n=Cu.get(e);return n||(n=t(),Cu.set(e,n),Ou.add(n)),n}const Pi=(e,t,n)=>{const i=Pe(t,n);i!==void 0&&e.add(i)};class KT{constructor(t){this._config=XT(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=Du(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(),Mu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Es(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Es(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Es(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Es(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(n);if(r)return r;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(h=>Pi(l,t,h))),d.forEach(h=>Pi(l,s,h)),d.forEach(h=>Pi(l,Ze[o]||{},h)),d.forEach(h=>Pi(l,_t,h)),d.forEach(h=>Pi(l,Qo,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ou.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ze[n]||{},_t.datasets[n]||{},{type:n},_t,Qo]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Au(this._resolverCache,t,s);let l=a;if(QT(a,n)){o.$shared=!1,i=Gt(i)?i():i;const c=this.createResolver(t,i,r);l=An(a,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Au(this._resolverCache,t,i);return st(n)?An(o,n,void 0,s):o}}function Au(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:na(t,n),subPrefixes:n.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const ZT=e=>st(e)&&Object.getOwnPropertyNames(e).some(t=>Gt(e[t]));function QT(e,t){const{isScriptable:n,isIndexable:i}=Cc(e);for(const s of t){const o=n(s),a=i(s),r=(a||o)&&e[s];if(o&&(Gt(r)||ZT(r))||a&&dt(r))return!0}return!1}var JT="4.5.1";const tS=["top","bottom","left","right","chartArea"];function Pu(e,t){return e==="top"||e==="bottom"||tS.indexOf(e)===-1&&t==="x"}function Eu(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Ru(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),mt(n&&n.onComplete,[e],t)}function eS(e){const t=e.chart,n=t.options.animation;mt(n&&n.onProgress,[e],t)}function Iu(e){return oa()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Rs={},Lu=e=>{const t=Iu(e);return Object.values(Rs).filter(n=>n.canvas===t).pop()};function nS(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const a=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=a)}}}function iS(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let Xt=class{static defaults=_t;static instances=Rs;static overrides=Ze;static registry=ue;static version=JT;static getChart=Lu;static register(...t){ue.add(...t),Nu()}static unregister(...t){ue.remove(...t),Nu()}constructor(t,n){const i=this.config=new KT(n),s=Iu(t),o=Lu(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||wT(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=sw(),this.ctx=r,this.canvas=l,this.width=d,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 zT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=xw(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Rs[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}xe.listen(this,"complete",Ru),xe.listen(this,"progress",eS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return G(t)?n&&o?o: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 ue}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return vc(this.canvas,this.ctx),this}stop(){return xe.stop(this),this}resize(t,n){xe.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,n,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Nc(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),mt(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};pt(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const r=n[a],l=ba(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),pt(o,a=>{const r=a.options,l=r.id,c=ba(l,r),d=Q(r.type,a.dtype);(r.position===void 0||Pu(r.position,c)!==Pu(a.dposition))&&(r.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===d)h=i[l];else{const f=ue.getScale(d);h=new f({id:l,type:d,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(r,t)}),pt(s,(a,r)=>{a||delete i[r]}),pt(i,a=>{Ut.configure(this,a,a.options),Ut.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Eu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||ya(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=ue.getController(r),{datasetElementType:c,dataElementType:d}=_t.datasets[r];Object.assign(l,{dataElementType:ue.getElement(d),datasetElementType:c&&ue.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){pt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.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 o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||pt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Eu("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){pt(this.scales,t=>{Ut.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!uc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const a=i==="_removeElements"?-o:o;nS(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!uc(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ut.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],pt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Gt(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(xe.has(this)?this.attached&&!xe.running(this)&&xe.start(this):(this.draw(),Ru({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[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 n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=jc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&xi(n,s),t.controller.draw(),s&&wi(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return _e(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=pa.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Le(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);qt(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),xe.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),vc(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Rs[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,n=this.platform,i=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};pt(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",r)},n.isAttached(this.canvas)?r():a()}unbindEvents(){pt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},pt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,a,r,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];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 n=this._active||[],i=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!fs(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),a=o(n,t),r=i?t:o(t,n);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,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 o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,a=n,r=this._getActiveElements(t,s,i,a),l=uw(t),c=iS(t,this._lastEvent,i,l);i&&(this._lastEvent=null,mt(o.onHover,[t,r,this],this),l&&mt(o.onClick,[t,r,this],this));const d=!fs(r,s);return(d||n)&&(this._active=r,this._updateHoverStyles(r,s,n)),this._lastEvent=c,d}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Nu(){return pt(Xt.instances,e=>e._plugins.invalidate())}function sS(e,t,n){const{startAngle:i,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,h=Math.min(c/a,Ft(i-n));if(e.beginPath(),e.arc(s,o,a-c/2,i+h/2,n-h/2),r>0){const f=Math.min(c/r,Ft(i-n));e.arc(s,o,r+c/2,n-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*Ft(i-n));if(d==="round")e.arc(s,o,f,n-it/2,i+it/2,!0);else if(d==="bevel"){const m=2*f*f,p=-m*Math.cos(n+it/2)+s,g=-m*Math.sin(n+it/2)+o,y=m*Math.cos(i+it/2)+s,_=m*Math.sin(i+it/2)+o;e.lineTo(p,g),e.lineTo(y,_)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function oS(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;e.beginPath(),e.arc(o,a,r,i-c,n+c),l>s?(c=s/l,e.arc(o,a,l,n+c,i-c,!0)):e.arc(o,a,s,n+bt,i-bt),e.closePath(),e.clip()}function aS(e){return ea(e,["outerStart","outerEnd","innerStart","innerEnd"])}function rS(e,t,n,i){const s=aS(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,i*t/2),r=l=>{const c=(n-Math.min(o,l))*i/2;return Rt(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Rt(s.innerStart,0,a),innerEnd:Rt(s.innerEnd,0,a)}}function Rn(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Is(e,t,n,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:d}=t,h=Math.max(t.outerRadius+i+n-c,0),f=d>0?d+i+n+c:0;let m=0;const p=s-l;if(i){const W=d>0?d-i:0,$=h>0?h-i:0,K=(W+$)/2,lt=K!==0?p*K/(K+i):p;m=(p-lt)/2}const g=Math.max(.001,p*h-n/it)/h,y=(p-g)/2,_=l+y+m,x=s-y-m,{outerStart:T,outerEnd:v,innerStart:w,innerEnd:M}=rS(t,f,h,x-_),D=h-T,P=h-v,k=_+T/D,S=x-v/P,A=f+w,L=f+M,R=_+w/A,H=x-M/L;if(e.beginPath(),o){const W=(k+S)/2;if(e.arc(a,r,h,k,W),e.arc(a,r,h,W,S),v>0){const rt=Rn(P,S,a,r);e.arc(rt.x,rt.y,v,S,x+bt)}const $=Rn(L,x,a,r);if(e.lineTo($.x,$.y),M>0){const rt=Rn(L,H,a,r);e.arc(rt.x,rt.y,M,x+bt,H+Math.PI)}const K=(x-M/f+(_+w/f))/2;if(e.arc(a,r,f,x-M/f,K,!0),e.arc(a,r,f,K,_+w/f,!0),w>0){const rt=Rn(A,R,a,r);e.arc(rt.x,rt.y,w,R+Math.PI,_-bt)}const lt=Rn(D,_,a,r);if(e.lineTo(lt.x,lt.y),T>0){const rt=Rn(D,k,a,r);e.arc(rt.x,rt.y,T,_-bt,k)}}else{e.moveTo(a,r);const W=Math.cos(k)*h+a,$=Math.sin(k)*h+r;e.lineTo(W,$);const K=Math.cos(S)*h+a,lt=Math.sin(S)*h+r;e.lineTo(K,lt)}e.closePath()}function lS(e,t,n,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Is(e,t,n,i,l,s);for(let c=0;c<o;++c)e.fill();isNaN(r)||(l=a+(r%yt||yt))}return Is(e,t,n,i,l,s),e.fill(),l}function cS(e,t,n,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=f,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let g=t.endAngle;if(o){Is(e,t,n,i,g,s);for(let y=0;y<o;++y)e.stroke();isNaN(r)||(g=a+(r%yt||yt))}p&&oS(e,t,g),l.selfJoin&&g-a>=it&&m===0&&d!=="miter"&&sS(e,t,g),o||(Is(e,t,n,i,g,s),e.stroke())}class uS extends Vt{static id="arc";static 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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=bs(s,{x:t,y:n}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,m=Q(h,l-r),p=gi(o,r,l)&&r!==l,g=m>=yt||p,y=ye(a,c+f,d+f);return g&&y}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,d=(s+o)/2,h=(a+r+c+l)/2;return{x:n+Math.cos(d)*h,y:i+Math.sin(d)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>yt?Math.floor(i/yt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(it,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,lS(t,this,c,o,a),cS(t,this,c,o,a),t.restore()}}function Bu(e,t,n=t){e.lineCap=Q(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Q(n.borderDash,t.borderDash)),e.lineDashOffset=Q(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Q(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Q(n.borderWidth,t.borderWidth),e.strokeStyle=Q(n.borderColor,t.borderColor)}function dS(e,t,n){e.lineTo(n.x,n.y)}function hS(e){return e.stepped?Ew:e.tension||e.cubicInterpolationMode==="monotone"?Rw:dS}function Fu(e,t,n={}){const i=e.length,{start:s=0,end:o=i-1}=n,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),d=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!d?i+c-l:c-l}}function fS(e,t,n,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=Fu(s,n,i),d=hS(o);let{move:h=!0,reverse:f}=i||{},m,p,g;for(m=0;m<=c;++m)p=s[(r+(f?c-m:m))%a],!p.skip&&(h?(e.moveTo(p.x,p.y),h=!1):d(e,g,p,f,o.stepped),g=p);return l&&(p=s[(r+(f?c:0))%a],d(e,g,p,f,o.stepped)),!!l}function mS(e,t,n,i){const s=t.points,{count:o,start:a,ilen:r}=Fu(s,n,i),{move:l=!0,reverse:c}=i||{};let d=0,h=0,f,m,p,g,y,_;const x=v=>(a+(c?r-v:v))%o,T=()=>{g!==y&&(e.lineTo(d,y),e.lineTo(d,g),e.lineTo(d,_))};for(l&&(m=s[x(0)],e.moveTo(m.x,m.y)),f=0;f<=r;++f){if(m=s[x(f)],m.skip)continue;const v=m.x,w=m.y,M=v|0;M===p?(w<g?g=w:w>y&&(y=w),d=(h*d+v)/++h):(T(),e.lineTo(v,w),p=M,h=0,g=y=w),_=w}T()}function _a(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?mS:fS}function pS(e){return e.stepped?dk:e.tension||e.cubicInterpolationMode==="monotone"?hk:en}function gS(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Bu(e,t.options),e.stroke(s)}function yS(e,t,n,i){const{segments:s,options:o}=t,a=_a(t);for(const r of s)Bu(e,o,r.style),e.beginPath(),a(e,t,r,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const bS=typeof Path2D=="function";function _S(e,t,n,i){bS&&!t.options.segment?gS(e,t,n,i):yS(e,t,n,i)}class Ls extends Vt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;ik(this._points,i,t,s,n),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=bk(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],o=this.points,a=$c(this,{property:n,start:s,end:s});if(!a.length)return;const r=[],l=pS(i);let c,d;for(c=0,d=a.length;c<d;++c){const{start:h,end:f}=a[c],m=o[h],p=o[f];if(m===p){r.push(m);continue}const g=Math.abs((s-m[n])/(p[n]-m[n])),y=l(m,p,g,i.stepped);y[n]=t[n],r.push(y)}return r.length===1?r[0]:r}pathSegment(t,n,i){return _a(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=_a(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const r of s)a&=o(t,this,r,{start:n,end:n+i-1});return!!a}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),_S(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function zu(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class xS extends Vt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return zu(this,t,"x",n)}inYRange(t,n){return zu(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!_e(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ta(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Uu(e,t){const{x:n,y:i,base:s,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let r,l,c,d,h;return e.horizontal?(h=a/2,r=Math.min(n,s),l=Math.max(n,s),c=i-h,d=i+h):(h=o/2,r=n-h,l=n+h,c=Math.min(i,s),d=Math.max(i,s)),{left:r,top:c,right:l,bottom:d}}function ze(e,t,n,i){return e?0:Rt(t,n,i)}function wS(e,t,n){const i=e.options.borderWidth,s=e.borderSkipped,o=Dc(i);return{t:ze(s.top,o.top,0,n),r:ze(s.right,o.right,0,t),b:ze(s.bottom,o.bottom,0,n),l:ze(s.left,o.left,0,t)}}function kS(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Ie(s),a=Math.min(t,n),r=e.borderSkipped,l=i||st(s);return{topLeft:ze(!l||r.top||r.left,o.topLeft,0,a),topRight:ze(!l||r.top||r.right,o.topRight,0,a),bottomLeft:ze(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:ze(!l||r.bottom||r.right,o.bottomRight,0,a)}}function TS(e){const t=Uu(e),n=t.right-t.left,i=t.bottom-t.top,s=wS(e,n/2,i/2),o=kS(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function xa(e,t,n,i){const s=t===null,o=n===null,r=e&&!(s&&o)&&Uu(e,i);return r&&(s||ye(t,r.left,r.right))&&(o||ye(n,r.top,r.bottom))}function SS(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function vS(e,t){e.rect(t.x,t.y,t.w,t.h)}function wa(e,t,n={}){const i=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+i,y:e.y+s,w:e.w+o,h:e.h+a,radius:e.radius}}class MS extends Vt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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:n,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=TS(this),r=SS(a.radius)?On:vS;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,wa(a,n,o)),t.clip(),r(t,wa(o,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,wa(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,i){return xa(this,t,n,i)}inXRange(t,n){return xa(this,t,null,n)}inYRange(t,n){return xa(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var DS=Object.freeze({__proto__:null,ArcElement:uS,BarElement:MS,LineElement:Ls,PointElement:xS});const ka=["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)"],Vu=ka.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Hu(e){return ka[e%ka.length]}function $u(e){return Vu[e%Vu.length]}function CS(e,t){return e.borderColor=Hu(t),e.backgroundColor=$u(t),++t}function OS(e,t){return e.backgroundColor=e.data.map(()=>Hu(t++)),t}function AS(e,t){return e.backgroundColor=e.data.map(()=>$u(t++)),t}function PS(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof Si?t=OS(n,t):s instanceof au?t=AS(n,t):s&&(t=CS(n,t))}}function Yu(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function ES(e){return e&&(e.borderColor||e.backgroundColor)}function RS(){return _t.borderColor!=="rgba(0,0,0,0.1)"||_t.backgroundColor!=="rgba(0,0,0,0.1)"}var IS={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s,a=Yu(i)||ES(s)||o&&Yu(o)||RS();if(!n.forceOverride&&a)return;const r=PS(e);i.forEach(r)}};function LS(e,t,n,i,s){const o=s.samples||i;if(o>=n)return e.slice(t,t+n);const a=[],r=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,h,f,m,p,g;for(a[l++]=e[d],h=0;h<o-2;h++){let y=0,_=0,x;const T=Math.floor((h+1)*r)+1+t,v=Math.min(Math.floor((h+2)*r)+1,n)+t,w=v-T;for(x=T;x<v;x++)y+=e[x].x,_+=e[x].y;y/=w,_/=w;const M=Math.floor(h*r)+1+t,D=Math.min(Math.floor((h+1)*r)+1,n)+t,{x:P,y:k}=e[d];for(m=p=-1,x=M;x<D;x++)p=.5*Math.abs((P-y)*(e[x].y-k)-(P-e[x].x)*(_-k)),p>m&&(m=p,f=e[x],g=x);a[l++]=f,d=g}return a[l++]=e[c],a}function NS(e,t,n,i){let s=0,o=0,a,r,l,c,d,h,f,m,p,g;const y=[],_=t+n-1,x=e[t].x,v=e[_].x-x;for(a=t;a<t+n;++a){r=e[a],l=(r.x-x)/v*i,c=r.y;const w=l|0;if(w===d)c<p?(p=c,h=a):c>g&&(g=c,f=a),s=(o*s+r.x)/++o;else{const M=a-1;if(!G(h)&&!G(f)){const D=Math.min(h,f),P=Math.max(h,f);D!==m&&D!==M&&y.push({...e[D],x:s}),P!==m&&P!==M&&y.push({...e[P],x:s})}a>0&&M!==m&&y.push(e[M]),y.push(r),d=w,o=0,p=g=c,h=f=m=a}}return y}function Wu(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ju(e){e.data.datasets.forEach(t=>{Wu(t)})}function BS(e,t){const n=t.length;let i=0,s;const{iScale:o}=e,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Rt(be(t,o.axis,a).lo,0,n-1)),c?s=Rt(be(t,o.axis,r).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var FS={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){ju(e);return}const i=e.width;e.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=e.getDatasetMeta(o),c=a||s.data;if(ki([r,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:h,count:f}=BS(l,c);const m=n.threshold||4*i;if(f<=m){Wu(s);return}G(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=LS(c,h,f,i,n);break;case"min-max":p=NS(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){ju(e)}};function zS(e,t,n){const i=e.segments,s=e.points,o=t.points,a=[];for(const r of i){let{start:l,end:c}=r;c=Ns(l,c,s);const d=Ta(n,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:d,start:s[l],end:s[c]});continue}const h=$c(t,d);for(const f of h){const m=Ta(n,o[f.start],o[f.end],f.loop),p=Hc(r,s,m);for(const g of p)a.push({source:g,target:f,start:{[n]:qu(d,m,"start",Math.max)},end:{[n]:qu(d,m,"end",Math.min)}})}}return a}function Ta(e,t,n,i){if(i)return;let s=t[e],o=n[e];return e==="angle"&&(s=Ft(s),o=Ft(o)),{property:e,start:s,end:o}}function US(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Ns(a,r,s);const l=s[a],c=s[r];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function Ns(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function qu(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Gu(e,t){let n=[],i=!1;return dt(e)?(i=!0,n=e):n=US(e,t),n.length?new Ls({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Xu(e){return e&&e.fill!==!1}function VS(e,t,n){let s=e[t].fill;const o=[t];let a;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!xt(s))return s;if(a=e[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function HS(e,t,n){const i=jS(e);if(st(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return xt(s)&&Math.floor(s)===s?$S(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function $S(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function YS(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:st(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function WS(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:st(e)?i=e.value:i=t.getBaseValue(),i}function jS(e){const t=e.options,n=t.fill;let i=Q(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function qS(e){const{scale:t,index:n,line:i}=e,s=[],o=i.segments,a=i.points,r=GS(t,n);r.push(Gu({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)XS(s,a[d],r)}return new Ls({points:s,options:{}})}function GS(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function XS(e,t,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:a,last:r,point:l}=KS(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(e.push(l),!r)break}}e.push(...i)}function KS(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const s=i[n],o=e.segments,a=e.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],h=a[d.start][n],f=a[d.end][n];if(ye(s,h,f)){r=s===h,l=s===f;break}}return{first:r,last:l,point:i}}class Ku{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:s,y:o,radius:a}=this;return n=n||{start:0,end:yt},t.arc(s,o,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function ZS(e){const{chart:t,fill:n,line:i}=e;if(xt(n))return QS(t,n);if(n==="stack")return qS(e);if(n==="shape")return!0;const s=JS(e);return s instanceof Ku?s:Gu(s,i)}function QS(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function JS(e){return(e.scale||{}).getPointPositionForValue?ev(e):tv(e)}function tv(e){const{scale:t={},fill:n}=e,i=YS(n,t);if(xt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function ev(e){const{scale:t,fill:n}=e,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=WS(n,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Ku({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function Sa(e,t,n){const i=ZS(t),{chart:s,index:o,line:a,scale:r,axis:l}=t,c=a.options,d=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=d||{},p=s.getDatasetMeta(o),g=jc(s,p);i&&a.points.length&&(xi(e,n),nv(e,{line:a,target:i,above:f,below:m,area:n,scale:r,axis:l,clip:g}),wi(e))}function nv(e,t){const{line:n,target:i,above:s,below:o,area:a,scale:r,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let d=o;o!==s&&(c==="x"?(Zu(e,i,a.top),va(e,{line:n,target:i,color:s,scale:r,property:c,clip:l}),e.restore(),e.save(),Zu(e,i,a.bottom)):c==="y"&&(Qu(e,i,a.left),va(e,{line:n,target:i,color:o,scale:r,property:c,clip:l}),e.restore(),e.save(),Qu(e,i,a.right),d=s)),va(e,{line:n,target:i,color:d,scale:r,property:c,clip:l}),e.restore()}function Zu(e,t,n){const{segments:i,points:s}=t;let o=!0,a=!1;e.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],h=s[Ns(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Qu(e,t,n){const{segments:i,points:s}=t;let o=!0,a=!1;e.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],h=s[Ns(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(n,d.y),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function va(e,t){const{line:n,target:i,property:s,color:o,scale:a,clip:r}=t,l=zS(n,i,s);for(const{source:c,target:d,start:h,end:f}of l){const{style:{backgroundColor:m=o}={}}=c,p=i!==!0;e.save(),e.fillStyle=m,iv(e,a,r,p&&Ta(s,h,f)),e.beginPath();const g=!!n.pathSegment(e,c);let y;if(p){g?e.closePath():Ju(e,i,f,s);const _=!!i.pathSegment(e,d,{move:g,reverse:!0});y=g&&_,y||Ju(e,i,h,s)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function iv(e,t,n,i){const s=t.chart.chartArea,{property:o,start:a,end:r}=i||{};if(o==="x"||o==="y"){let l,c,d,h;o==="x"?(l=a,c=s.top,d=r,h=s.bottom):(l=s.left,c=a,d=s.right,h=r),e.beginPath(),n&&(l=Math.max(l,n.left),d=Math.min(d,n.right),c=Math.max(c,n.top),h=Math.min(h,n.bottom)),e.rect(l,c,d-l,h-c),e.clip()}}function Ju(e,t,n,i){const s=t.interpolate(n,i);s&&e.lineTo(s.x,s.y)}var sv={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<i;++a)o=e.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Ls&&(l={visible:e.isDatasetVisible(a),index:a,fill:HS(r,a,i),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=VS(s,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),i&&r.fill&&Sa(e.ctx,r,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Xu(o)&&Sa(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Xu(i)||n.drawTime!=="beforeDatasetDraw"||Sa(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const td=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},ov=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class ed extends Vt{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,n,i){this.maxWidth=t,this.maxHeight=n,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 n=mt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=wt(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=td(i,o);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+r;let h=t;o.textAlign="left",o.textBaseline="middle";let f=-1,m=-d;return this.legendItems.forEach((p,g)=>{const y=i+n/2+o.measureText(p.text).width;(g===0||c[c.length-1]+y+2*r>a)&&(h+=d,c[c.length-(g>0?0:1)]=0,m+=d,f++),l[g]={left:0,top:m,row:f,width:y,height:s},c[c.length-1]+=y+r}),h}_fitCols(t,n,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let h=r,f=0,m=0,p=0,g=0;return this.legendItems.forEach((y,_)=>{const{itemWidth:x,itemHeight:T}=av(i,n,o,y,s);_>0&&m+T+2*r>d&&(h+=f+r,c.push({width:f,height:m}),p+=f+r,g++,f=m=0),l[_]={left:p,top:m,col:g,width:x,height:T},f=Math.max(f,x),m+=T+r}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,a=En(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=zt(i,this.left+s,this.right-this.lineWidths[r]);for(const c of n)r!==c.row&&(r=c.row,l=zt(i,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=zt(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of n)c.col!==r&&(r=c.col,l=zt(i,this.top+t+s,this.bottom-this.columnSizes[r].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;xi(t,this),this._draw(),wi(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=_t.color,l=En(t.rtl,this.left,this.width),c=wt(a.font),{padding:d}=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:p,boxHeight:g,itemHeight:y}=td(a,h),_=function(M,D,P){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const k=Q(P.lineWidth,1);if(s.fillStyle=Q(P.fillStyle,r),s.lineCap=Q(P.lineCap,"butt"),s.lineDashOffset=Q(P.lineDashOffset,0),s.lineJoin=Q(P.lineJoin,"miter"),s.lineWidth=k,s.strokeStyle=Q(P.strokeStyle,r),s.setLineDash(Q(P.lineDash,[])),a.usePointStyle){const S={radius:g*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:k},A=l.xPlus(M,p/2),L=D+f;Mc(s,S,A,L,a.pointStyleWidth&&p)}else{const S=D+Math.max((h-g)/2,0),A=l.leftForLtr(M,p),L=Ie(P.borderRadius);s.beginPath(),Object.values(L).some(R=>R!==0)?On(s,{x:A,y:S,w:p,h:g,radius:L}):s.rect(A,S,p,g),s.fill(),k!==0&&s.stroke()}s.restore()},x=function(M,D,P){Je(s,P.text,M,D+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},T=this.isHorizontal(),v=this._computeTitleHeight();T?m={x:zt(o,this.left+d,this.right-i[0]),y:this.top+d+v,line:0}:m={x:this.left+d,y:zt(o,this.top+v+d,this.bottom-n[0].height),line:0},Fc(this.ctx,t.textDirection);const w=y+d;this.legendItems.forEach((M,D)=>{s.strokeStyle=M.fontColor,s.fillStyle=M.fontColor;const P=s.measureText(M.text).width,k=l.textAlign(M.textAlign||(M.textAlign=a.textAlign)),S=p+f+P;let A=m.x,L=m.y;l.setWidth(this.width),T?D>0&&A+S+d>this.right&&(L=m.y+=w,m.line++,A=m.x=zt(o,this.left+d,this.right-i[m.line])):D>0&&L+w>this.bottom&&(A=m.x=A+n[m.line].width+d,m.line++,L=m.y=zt(o,this.top+v+d,this.bottom-n[m.line].height));const R=l.x(A);if(_(R,L,M),A=ww(k,A+p+f,T?A+S:this.right,t.rtl),x(l.x(A),L,M),T)m.x+=S+d;else if(typeof M.text!="string"){const H=c.lineHeight;m.y+=nd(M,H)+d}else m.y+=w}),zc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=wt(n.font),s=At(n.padding);if(!n.display)return;const o=En(t.rtl,this.left,this.width),a=this.ctx,r=n.position,l=i.size/2,c=s.top+l;let d,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,h=zt(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);d=c+zt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=zt(r,h,h+f);a.textAlign=o.textAlign(Xo(r)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,Je(a,n.text,m,d,i)}_computeTitleHeight(){const t=this.options.title,n=wt(t.font),i=At(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(ye(t,this.left,this.right)&&ye(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],ye(t,s.left,s.left+s.width)&&ye(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!cv(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=ov(s,i);s&&!o&&mt(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&mt(n.onHover,[t,i,this],this)}else i&&mt(n.onClick,[t,i,this],this)}}function av(e,t,n,i,s){const o=rv(i,e,t,n),a=lv(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function rv(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+i.measureText(s).width}function lv(e,t,n){let i=e;return typeof t.text!="string"&&(i=nd(t,n)),i}function nd(e,t){const n=e.text?e.text.length:0;return t*n}function cv(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var uv={id:"legend",_element:ed,start(e,t,n){const i=e.legend=new ed({ctx:e.ctx,options:n,chart:e});Ut.configure(e,i,n),Ut.addBox(e,i)},stop(e){Ut.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Ut.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=At(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Ma extends Vt{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,n){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=n;const s=dt(i.text)?i.text.length:1;this._padding=At(i.padding);const o=s*wt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,d,h;return this.isHorizontal()?(d=zt(r,i,o),h=n+t,c=o-i):(a.position==="left"?(d=i+t,h=zt(r,s,n),l=it*-.5):(d=o-t,h=zt(r,n,s),l=it*.5),c=s-n),{titleX:d,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=wt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Je(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Xo(n.align),textBaseline:"middle",translation:[a,r]})}}function dv(e,t){const n=new Ma({ctx:e.ctx,options:t,chart:e});Ut.configure(e,n,t),Ut.addBox(e,n),e.titleBlock=n}var hv={id:"title",_element:Ma,start(e,t,n){dv(e,n)},stop(e){const t=e.titleBlock;Ut.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Ut.configure(e,i,n),i.options=n},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 Bs=new WeakMap;var fv={id:"subtitle",start(e,t,n){const i=new Ma({ctx:e.ctx,options:n,chart:e});Ut.configure(e,i,n),Ut.addBox(e,i),Bs.set(e,i)},stop(e){Ut.removeBox(e,Bs.get(e)),Bs.delete(e)},beforeUpdate(e,t,n){const i=Bs.get(e);Ut.configure(e,i,n),i.options=n},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 Ei={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const r=e[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((r,l)=>r+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=e.length;o<a;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Cn(t,c);d<s&&(s=d,r=l)}}if(r){const l=r.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function de(e,t){return t&&(dt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function we(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
1
|
+
(function(Lt,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong/kongponents"],f):(Lt=typeof globalThis<"u"?globalThis:Lt||self,f(Lt["kong-ui-publicvitals-chart"]={},Lt.Vue,Lt.KongIcons,Lt["kong-ui-public-i18n"],Lt["kong-ui-public-analytics-metric-provider"],Lt.Kongponents))})(this,(function(Lt,f,fe,mh,er,As){"use strict";var yt=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(yt||{});const mx=["in","not_in","selector"],gx=["empty","not_empty"],_x=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],nr=e=>e.filter(t=>t!=="time"),gh=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Tc=nr(gh),yx=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],_h=[...gh,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],kc=nr(_h),bx=[...yx,"share_of_requests","cache_hit_rate","response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],xx=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","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","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node","upstream_status_code","upstream_status_code_grouped","response_source"],Mc=nr(xx),wx=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","cache_status","client_ip","consumer","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","oidc_credential","portal","principal","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"],vx=nr(wx),Sx=["auth_type","cache_status","client_ip","data_plane_node_version","header_host","header_user_agent","http_method","oidc_credential","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Tx=Sx,kx=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],Mx=nr(kx),Dx=["platform","platform_usage"],Cx=e=>Dx.includes(e),Ox=[..._h.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Dc=nr(Ox);[...bx];const Ax=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Cc=nr(Ax);new Set(Tc),new Set(kc),new Set(Mc),new Set(Dc),new Set(Cc);const yh=[{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"}],Si=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:mx},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:gx}},required:["field","operator"],additionalProperties:!1}]}});({...Si()},yh.map(e=>e.code));const Ex=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Si(kc),Si(Tc),Si(Mc),Si(Dc),Si(Cc),Si(Array.from(new Set([...vx,...Tx,...Mx]))),Si([...new Set([...kc,...Tc,...Mc,...Dc,...Ex,...Cc])]);const Rx={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"}},Px=(e,t,n)=>{let i;const r=Rx[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Oc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ix={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bx={date:Oc({formats:Ix,defaultWidth:"full"}),time:Oc({formats:Lx,defaultWidth:"full"}),dateTime:Oc({formats:Nx,defaultWidth:"full"})},Fx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zx=(e,t,n,i)=>Fx[e];function Es(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):a;r=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const Ux={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wx={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"]},$x={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"]},Vx={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"}},Yx={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"}},qx=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},jx={ordinalNumber:qx,era:Es({values:Ux,defaultWidth:"wide"}),quarter:Es({values:Hx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Es({values:Wx,defaultWidth:"wide"}),day:Es({values:$x,defaultWidth:"wide"}),dayPeriod:Es({values:Vx,defaultWidth:"wide",formattingValues:Yx,defaultFormattingWidth:"wide"})};function Rs(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Kx(l,m=>m.test(a)):Gx(l,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function Gx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Kx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xx(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Zx=/^(\d+)(th|st|nd|rd)?/i,Qx=/\d+/i,Jx={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},tw={any:[/^b/i,/^(a|c)/i]},ew={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nw={any:[/1/i,/2/i,/3/i,/4/i]},iw={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},rw={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]},sw={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},ow={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},aw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},lw={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cw={ordinalNumber:Xx({matchPattern:Zx,parsePattern:Qx,valueCallback:e=>parseInt(e,10)}),era:Rs({matchPatterns:Jx,defaultMatchWidth:"wide",parsePatterns:tw,defaultParseWidth:"any"}),quarter:Rs({matchPatterns:ew,defaultMatchWidth:"wide",parsePatterns:nw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rs({matchPatterns:iw,defaultMatchWidth:"wide",parsePatterns:rw,defaultParseWidth:"any"}),day:Rs({matchPatterns:sw,defaultMatchWidth:"wide",parsePatterns:ow,defaultParseWidth:"any"}),dayPeriod:Rs({matchPatterns:aw,defaultMatchWidth:"any",parsePatterns:lw,defaultParseWidth:"any"})},uw={code:"en-US",formatDistance:Px,formatLong:Bx,formatRelative:zx,localize:jx,match:cw,options:{weekStartsOn:0,firstWeekContainsDate:1}};let dw={};function Ps(){return dw}const bh=6048e5,fw=864e5,hw=60,pw=3600,xh=Symbol.for("constructDateFrom");function Tn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&xh in e?e[xh](t):e instanceof Date?new e.constructor(t):new Date(t)}function He(e,t){return Tn(t||e,e)}function wh(e){const t=He(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function mw(e,...t){const n=Tn.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Nr(e,t){const n=He(e,t?.in);return n.setHours(0,0,0,0),n}function gw(e,t,n){const[i,r]=mw(n?.in,e,t),s=Nr(i),a=Nr(r),l=+s-wh(s),u=+a-wh(a);return Math.round((l-u)/fw)}function _w(e,t){const n=He(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function yw(e,t){const n=He(e,t?.in);return gw(n,_w(n))+1}function ni(e,t){const n=Ps(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=He(e,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function sa(e,t){return ni(e,{...t,weekStartsOn:1})}function vh(e,t){const n=He(e,t?.in),i=n.getFullYear(),r=Tn(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=sa(r),a=Tn(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=sa(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function bw(e,t){const n=vh(e,t),i=Tn(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),sa(i)}function xw(e,t){const n=He(e,t?.in),i=+sa(n)-+bw(n);return Math.round(i/bh)+1}function Sh(e,t){const n=He(e,t?.in),i=n.getFullYear(),r=Ps(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Tn(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=ni(a,t),u=Tn(t?.in||e,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=ni(u,t);return+n>=+l?i+1:+n>=+d?i:i-1}function ww(e,t){const n=Ps(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Sh(e,t),s=Tn(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ni(s,t)}function vw(e,t){const n=He(e,t?.in),i=+ni(n,t)-+ww(n,t);return Math.round(i/bh)+1}function Zt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Ti={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Zt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Zt(n+1,2)},d(e,t){return Zt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Zt(e.getHours()%12||12,t.length)},H(e,t){return Zt(e.getHours(),t.length)},m(e,t){return Zt(e.getMinutes(),t.length)},s(e,t){return Zt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Zt(r,t.length)}},Br={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Th={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Ti.y(e,t)},Y:function(e,t,n,i){const r=Sh(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(e,t){const n=vh(e);return Zt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Zt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Ti.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=vw(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(e,t,n){const i=xw(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ti.d(e,t)},D:function(e,t,n){const i=yw(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Zt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Br.noon:i===0?r=Br.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Br.evening:i>=12?r=Br.afternoon:i>=4?r=Br.morning:r=Br.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ti.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ti.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ti.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ti.s(e,t)},S:function(e,t){return Ti.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Mh(i);case"XXXX":case"XX":return ir(i);default:return ir(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Mh(i);case"xxxx":case"xx":return ir(i);default:return ir(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+kh(i,":");default:return"GMT"+ir(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+kh(i,":");default:return"GMT"+ir(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Zt(i,t.length)},T:function(e,t,n){return Zt(+e,t.length)}};function kh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Zt(s,2)}function Mh(e,t){return e%60===0?(e>0?"-":"+")+Zt(Math.abs(e)/60,2):ir(e,t)}function ir(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return n+r+t+s}const Dh=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Ch=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Sw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Dh(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Dh(i,t)).replace("{{time}}",Ch(r,t))},Tw={p:Ch,P:Sw},kw=/^D+$/,Mw=/^Y+$/,Dw=["D","DD","YY","YYYY"];function Cw(e){return kw.test(e)}function Ow(e){return Mw.test(e)}function Aw(e,t,n){const i=Ew(e,t,n);if(console.warn(i),Dw.includes(e))throw new RangeError(i)}function Ew(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Rw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Pw(e){return!(!Rw(e)&&typeof e!="number"||isNaN(+He(e)))}const Iw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Nw=/^'([^]*?)'?$/,Bw=/''/g,Fw=/[a-zA-Z]/;function zw(e,t,n){const i=Ps(),r=n?.locale??i.locale??uw,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=He(e,n?.in);if(!Pw(l))throw new RangeError("Invalid time value");let u=t.match(Lw).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Tw[m];return g(h,r.formatLong)}return h}).join("").match(Iw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Uw(h)};if(Th[m])return{isToken:!0,value:h};if(m.match(Fw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const m=h.value;(!n?.useAdditionalWeekYearTokens&&Ow(m)||!n?.useAdditionalDayOfYearTokens&&Cw(m))&&Aw(m,t,String(e));const g=Th[m[0]];return g(l,m,r.localize,d)}).join("")}function Uw(e){const t=e.match(Nw);return t?t[1].replace(Bw,"'"):e}function oa(e,t,n){const i=He(e,n?.in);return isNaN(t)?Tn(e,NaN):(i.setDate(i.getDate()+t),i)}function Oh(e,t,n){const i=He(e,n?.in);if(isNaN(t))return Tn(e,NaN);if(!t)return i;const r=i.getDate(),s=Tn(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Hw(e,t,n){return Oh(e,t*3,n)}function Fr(e,t){const n=He(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function zr(e,t){const n=He(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Ww(e,t){const n=He(e,t?.in),i=n.getFullYear(),r=n.getMonth(),s=Tn(n,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function $w(){return Object.assign({},Ps())}function Ah(e){return Math.trunc(e*pw)}function Vw(e){const t=e/hw;return Math.trunc(t)}function Eh(e,t,n){return Oh(e,-1,n)}function Rh(e,t,n){return Hw(e,-1,n)}function Ph(e,t,n){const i=$w(),r=jw(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?Yw(r,t):qw(r,t)}function Yw(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function qw(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function jw(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Gw(e,t){const n=Jw(t);return"formatToParts"in n?Xw(n,e):Zw(n,e)}const Kw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Xw(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=Kw[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function Zw(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 Ac={},Ih=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")),Qw=Ih==="06/25/2014, 00:00:00"||Ih==="06/25/2014 00:00:00";function Jw(e){return Ac[e]||(Ac[e]=Qw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ac[e]}function Ec(e,t,n,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(i,r,s,a),l}const Lh=36e5,tv=6e4,Rc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(e,t,n){if(!e)return 0;let i=Rc.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Rc.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Nh(r)?-(r*Lh):NaN;if(i=Rc.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Nh(r,a)?(s=Math.abs(r)*Lh+a*tv,i[1]==="+"?-s:s):NaN}if(iv(e)){t=new Date(t||Date.now());const a=n?t:ev(t),l=Pc(a,e);return-(n?l:nv(t,l,e))}return NaN}function ev(e){return Ec(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Pc(e,t){const n=Gw(e,t),i=Ec(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function nv(e,t,n){let i=e.getTime()-t;const r=Pc(new Date(i),n);if(t===r)return t;i-=r-t;const s=Pc(new Date(i),n);return r===s?r:Math.max(r,s)}function Nh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Bh={};function iv(e){if(Bh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Bh[e]=!0,!0}catch{return!1}}const rv=60*1e3,sv={X:function(e,t,n){const i=Ic(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return Ur(i);default:return Ur(i,":")}},x:function(e,t,n){const i=Ic(n.timeZone,e);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return Ur(i);default:return Ur(i,":")}},O:function(e,t,n){const i=Ic(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ov(i,":");default:return"GMT"+Ur(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Ph("short",e,n);default:return Ph("long",e,n)}}};function Ic(e,t){const n=e?Is(e,t,!0)/rv:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function aa(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Ur(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=aa(Math.floor(i/60),2),s=aa(Math.floor(i%60),2);return n+r+t+s}function Fh(e,t){return e%60===0?(e>0?"-":"+")+aa(Math.abs(e)/60,2):Ur(e,t)}function ov(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+aa(s,2)}function zh(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Uh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Lc=36e5,Hh=6e4,av=2,Qe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Uh};function la(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?av:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=lv(e),{year:r,restDateString:s}=cv(i.date,n),a=uv(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=dv(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Is(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=zh(new Date(l+u)),d=zh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function lv(e){const t={};let n=Qe.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Qe.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Qe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function cv(e,t){if(e){const n=Qe.YYY[t],i=Qe.YYYYY[t];let r=Qe.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Qe.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function uv(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=Qe.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Vh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Qe.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return pv(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Qe.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Vh(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Qe.Www.exec(e),s)return r=parseInt(s[1],10)-1,Yh(r)?Wh(t,r):new Date(NaN);if(s=Qe.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Yh(r,a)?Wh(t,r,a):new Date(NaN)}return null}function dv(e){let t,n,i=Qe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Nc(t)?t%24*Lc:NaN;if(i=Qe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Nc(t,n)?t%24*Lc+n*Hh:NaN;if(i=Qe.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Nc(t,n,r)?t%24*Lc+n*Hh+r*1e3:NaN}return null}function Wh(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const fv=[31,28,31,30,31,30,31,31,30,31,30,31],hv=[31,29,31,30,31,30,31,31,30,31,30,31];function $h(e){return e%400===0||e%4===0&&e%100!==0}function Vh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=$h(e);if(i&&n>hv[t]||!i&&n>fv[t])return!1}return!0}function pv(e,t){if(t<1)return!1;const n=$h(e);return!(n&&t>366||!n&&t>365)}function Yh(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Nc(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const mv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function gv(e,t,n={}){t=String(t);const i=t.match(mv);if(i){const r=la(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+sv[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return zw(e,t,n)}function qh(e,t,n){e=la(e,n);const i=Is(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function jh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},gv(qh(e,t,{timeZone:i.timeZone}),n,i)}function _v(e,t,n){if(typeof e=="string"&&!e.match(Uh))return la(e,{...n,timeZone:t});e=la(e,n);const i=Ec(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),r=Is(t,new Date(i));return new Date(i+r)}function yv(e,t){return-Is(e,t)}function Gh(e,t={}){const n=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),jh(e,n,i)}function bv(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(e);return jh(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const xv={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function ca(e){return e&&_x.find(t=>e<=xv[t])||null}var ua=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},da={exports:{}};da.exports;var Kh;function wv(){return Kh||(Kh=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",m="[object GeneratorFunction]",g="[object Map]",y="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",O="[object Set]",A="[object String]",P="[object Symbol]",L="[object WeakMap]",R="[object ArrayBuffer]",F="[object DataView]",U="[object Float32Array]",D="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",$="[object Uint8Array]",V="[object Uint8ClampedArray]",st="[object Uint16Array]",dt="[object Uint32Array]",ut=/[\\^$.*+?()[\]{}|]/g,ct=/\w*$/,Tt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,pt={};pt[s]=pt[a]=pt[R]=pt[F]=pt[l]=pt[u]=pt[U]=pt[D]=pt[w]=pt[C]=pt[N]=pt[g]=pt[y]=pt[x]=pt[S]=pt[O]=pt[A]=pt[P]=pt[$]=pt[V]=pt[st]=pt[dt]=!0,pt[d]=pt[h]=pt[L]=!1;var G=typeof ua=="object"&&ua&&ua.Object===Object&&ua,B=typeof self=="object"&&self&&self.Object===Object&&self,z=G||B||Function("return this")(),Z=t&&!t.nodeType&&t,it=Z&&!0&&e&&!e.nodeType&&e,ht=it&&it.exports===Z;function mt(M,Y){return M.set(Y[0],Y[1]),M}function X(M,Y){return M.add(Y),M}function ot(M,Y){for(var tt=-1,xt=M?M.length:0;++tt<xt&&Y(M[tt],tt,M)!==!1;);return M}function vt(M,Y){for(var tt=-1,xt=Y.length,Ce=M.length;++tt<xt;)M[Ce+tt]=Y[tt];return M}function lt(M,Y,tt,xt){for(var Ce=-1,Ke=M?M.length:0;++Ce<Ke;)tt=Y(tt,M[Ce],Ce,M);return tt}function bt(M,Y){for(var tt=-1,xt=Array(M);++tt<M;)xt[tt]=Y(tt);return xt}function Rt(M,Y){return M?.[Y]}function j(M){var Y=!1;if(M!=null&&typeof M.toString!="function")try{Y=!!(M+"")}catch{}return Y}function et(M){var Y=-1,tt=Array(M.size);return M.forEach(function(xt,Ce){tt[++Y]=[Ce,xt]}),tt}function rt(M,Y){return function(tt){return M(Y(tt))}}function Gt(M){var Y=-1,tt=Array(M.size);return M.forEach(function(xt){tt[++Y]=xt}),tt}var _t=Array.prototype,$t=Function.prototype,Me=Object.prototype,Te=z["__core-js_shared__"],ee=(function(){var M=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return M?"Symbol(src)_1."+M:""})(),je=$t.toString,Yt=Me.hasOwnProperty,Be=Me.toString,se=RegExp("^"+je.call(Yt).replace(ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=ht?z.Buffer:void 0,Pe=z.Symbol,gn=z.Uint8Array,Wi=rt(Object.getPrototypeOf,Object),Cn=Object.create,Ge=Me.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,Oo=De?De.isBuffer:void 0,Ao=rt(Object.keys,Object),Tr=Zn(z,"DataView"),fi=Zn(z,"Map"),Eo=Zn(z,"Promise"),Ro=Zn(z,"Set"),Po=Zn(z,"WeakMap"),$i=Zn(Object,"create"),xl=pi(Tr),Ed=pi(fi),Rd=pi(Eo),Pd=pi(Ro),Id=pi(Po),Io=Pe?Pe.prototype:void 0,wl=Io?Io.valueOf:void 0;function hi(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Ld(){this.__data__=$i?$i(null):{}}function Lo(M){return this.has(M)&&delete this.__data__[M]}function Nd(M){var Y=this.__data__;if($i){var tt=Y[M];return tt===i?void 0:tt}return Yt.call(Y,M)?Y[M]:void 0}function No(M){var Y=this.__data__;return $i?Y[M]!==void 0:Yt.call(Y,M)}function Bd(M,Y){var tt=this.__data__;return tt[M]=$i&&Y===void 0?i:Y,this}hi.prototype.clear=Ld,hi.prototype.delete=Lo,hi.prototype.get=Nd,hi.prototype.has=No,hi.prototype.set=Bd;function Nn(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Fd(){this.__data__=[]}function zd(M){var Y=this.__data__,tt=kr(Y,M);if(tt<0)return!1;var xt=Y.length-1;return tt==xt?Y.pop():Ln.call(Y,tt,1),!0}function Ud(M){var Y=this.__data__,tt=kr(Y,M);return tt<0?void 0:Y[tt][1]}function vl(M){return kr(this.__data__,M)>-1}function Hd(M,Y){var tt=this.__data__,xt=kr(tt,M);return xt<0?tt.push([M,Y]):tt[xt][1]=Y,this}Nn.prototype.clear=Fd,Nn.prototype.delete=zd,Nn.prototype.get=Ud,Nn.prototype.has=vl,Nn.prototype.set=Hd;function Vi(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Sl(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function Wd(M){return Mr(this,M).delete(M)}function $d(M){return Mr(this,M).get(M)}function Vd(M){return Mr(this,M).has(M)}function Yd(M,Y){return Mr(this,M).set(M,Y),this}Vi.prototype.clear=Sl,Vi.prototype.delete=Wd,Vi.prototype.get=$d,Vi.prototype.has=Vd,Vi.prototype.set=Yd;function Yi(M){this.__data__=new Nn(M)}function qd(){this.__data__=new Nn}function ls(M){return this.__data__.delete(M)}function jd(M){return this.__data__.get(M)}function cs(M){return this.__data__.has(M)}function Gd(M,Y){var tt=this.__data__;if(tt instanceof Nn){var xt=tt.__data__;if(!fi||xt.length<n-1)return xt.push([M,Y]),this;tt=this.__data__=new Vi(xt)}return tt.set(M,Y),this}Yi.prototype.clear=qd,Yi.prototype.delete=ls,Yi.prototype.get=jd,Yi.prototype.has=cs,Yi.prototype.set=Gd;function Kd(M,Y){var tt=Ho(M)||Bl(M)?bt(M.length,String):[],xt=tt.length,Ce=!!xt;for(var Ke in M)Yt.call(M,Ke)&&!(Ce&&(Ke=="length"||Pl(Ke,xt)))&&tt.push(Ke);return tt}function Tl(M,Y,tt){var xt=M[Y];(!(Yt.call(M,Y)&&Nl(xt,tt))||tt===void 0&&!(Y in M))&&(M[Y]=tt)}function kr(M,Y){for(var tt=M.length;tt--;)if(Nl(M[tt][0],Y))return tt;return-1}function kl(M,Y){return M&&Fo(Y,Wo(Y),M)}function us(M,Y,tt,xt,Ce,Ke,Bn){var Fe;if(xt&&(Fe=Ke?xt(M,Ce,Ke,Bn):xt(M)),Fe!==void 0)return Fe;if(!ms(M))return M;var zl=Ho(M);if(zl){if(Fe=El(M),!Y)return Al(M,Fe)}else{var ue=un(M),gs=ue==h||ue==m;if(af(M))return Dl(M,Y);if(ue==x||ue==s||gs&&!Ke){if(j(M))return Ke?M:{};if(Fe=Rl(gs?{}:M),!Y)return zo(M,kl(Fe,M))}else{if(!pt[ue])return Ke?M:{};Fe=rf(M,ue,us,Y)}}Bn||(Bn=new Yi);var Qn=Bn.get(M);if(Qn)return Qn;if(Bn.set(M,Fe),!zl)var $o=tt?nf(M):Wo(M);return ot($o||M,function(Dr,ze){$o&&(ze=Dr,Dr=M[ze]),Tl(Fe,ze,us(Dr,Y,tt,xt,ze,M,Bn))}),Fe}function Xd(M){return ms(M)?Cn(M):{}}function Zd(M,Y,tt){var xt=Y(M);return Ho(M)?xt:vt(xt,tt(M))}function Qd(M){return Be.call(M)}function Jd(M){if(!ms(M)||Ll(M))return!1;var Y=ps(M)||j(M)?se:Tt;return Y.test(pi(M))}function Ml(M){if(!Uo(M))return Ao(M);var Y=[];for(var tt in Object(M))Yt.call(M,tt)&&tt!="constructor"&&Y.push(tt);return Y}function Dl(M,Y){if(Y)return M.slice();var tt=new M.constructor(M.length);return M.copy(tt),tt}function ds(M){var Y=new M.constructor(M.byteLength);return new gn(Y).set(new gn(M)),Y}function Bo(M,Y){var tt=Y?ds(M.buffer):M.buffer;return new M.constructor(tt,M.byteOffset,M.byteLength)}function tf(M,Y,tt){var xt=Y?tt(et(M),!0):et(M);return lt(xt,mt,new M.constructor)}function Cl(M){var Y=new M.constructor(M.source,ct.exec(M));return Y.lastIndex=M.lastIndex,Y}function fs(M,Y,tt){var xt=Y?tt(Gt(M),!0):Gt(M);return lt(xt,X,new M.constructor)}function Ol(M){return wl?Object(wl.call(M)):{}}function ef(M,Y){var tt=Y?ds(M.buffer):M.buffer;return new M.constructor(tt,M.byteOffset,M.length)}function Al(M,Y){var tt=-1,xt=M.length;for(Y||(Y=Array(xt));++tt<xt;)Y[tt]=M[tt];return Y}function Fo(M,Y,tt,xt){tt||(tt={});for(var Ce=-1,Ke=Y.length;++Ce<Ke;){var Bn=Y[Ce],Fe=void 0;Tl(tt,Bn,Fe===void 0?M[Bn]:Fe)}return tt}function zo(M,Y){return Fo(M,hs(M),Y)}function nf(M){return Zd(M,Wo,hs)}function Mr(M,Y){var tt=M.__data__;return Il(Y)?tt[typeof Y=="string"?"string":"hash"]:tt.map}function Zn(M,Y){var tt=Rt(M,Y);return Jd(tt)?tt:void 0}var hs=di?rt(di,Object):uf,un=Qd;(Tr&&un(new Tr(new ArrayBuffer(1)))!=F||fi&&un(new fi)!=g||Eo&&un(Eo.resolve())!=v||Ro&&un(new Ro)!=O||Po&&un(new Po)!=L)&&(un=function(M){var Y=Be.call(M),tt=Y==x?M.constructor:void 0,xt=tt?pi(tt):void 0;if(xt)switch(xt){case xl:return F;case Ed:return g;case Rd:return v;case Pd:return O;case Id:return L}return Y});function El(M){var Y=M.length,tt=M.constructor(Y);return Y&&typeof M[0]=="string"&&Yt.call(M,"index")&&(tt.index=M.index,tt.input=M.input),tt}function Rl(M){return typeof M.constructor=="function"&&!Uo(M)?Xd(Wi(M)):{}}function rf(M,Y,tt,xt){var Ce=M.constructor;switch(Y){case R:return ds(M);case l:case u:return new Ce(+M);case F:return Bo(M,xt);case U:case D:case w:case C:case N:case $:case V:case st:case dt:return ef(M,xt);case g:return tf(M,xt,tt);case y:case A:return new Ce(M);case S:return Cl(M);case O:return fs(M,xt,tt);case P:return Ol(M)}}function Pl(M,Y){return Y=Y??r,!!Y&&(typeof M=="number"||at.test(M))&&M>-1&&M%1==0&&M<Y}function Il(M){var Y=typeof M;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?M!=="__proto__":M===null}function Ll(M){return!!ee&&ee in M}function Uo(M){var Y=M&&M.constructor,tt=typeof Y=="function"&&Y.prototype||Me;return M===tt}function pi(M){if(M!=null){try{return je.call(M)}catch{}try{return M+""}catch{}}return""}function sf(M){return us(M,!0,!0)}function Nl(M,Y){return M===Y||M!==M&&Y!==Y}function Bl(M){return of(M)&&Yt.call(M,"callee")&&(!Ge.call(M,"callee")||Be.call(M)==s)}var Ho=Array.isArray;function Fl(M){return M!=null&&lf(M.length)&&!ps(M)}function of(M){return cf(M)&&Fl(M)}var af=Oo||ie;function ps(M){var Y=ms(M)?Be.call(M):"";return Y==h||Y==m}function lf(M){return typeof M=="number"&&M>-1&&M%1==0&&M<=r}function ms(M){var Y=typeof M;return!!M&&(Y=="object"||Y=="function")}function cf(M){return!!M&&typeof M=="object"}function Wo(M){return Fl(M)?Kd(M):Ml(M)}function uf(){return[]}function ie(){return!1}e.exports=sf})(da,da.exports)),da.exports}wv();const kn=(e,t)=>new Date(e.getTime()-yv(t,e));class Ee{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){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 n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=_v(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return qh(n,t)}}class vv extends Ee{rawStart(t){let n=ni(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class Sv extends Ee{rawStart(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Tv extends Ee{rawStart(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class kv extends Ee{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class Mv extends Ee{rawEnd(t){let n=ni(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=kn(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=ni(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=kn(i,t)),i}}class Dv extends Ee{rawEnd(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=Fr(Rh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Cv extends Ee{rawEnd(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=zr(Eh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Ov extends Ee{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=kn(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=kn(n,t)),n}}yt.FIFTEEN_MIN,new Ee({key:yt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),yt.ONE_HOUR,new Ee({key:yt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),yt.SIX_HOUR,new Ee({key:yt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),yt.TWELVE_HOUR,new Ee({key:yt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),yt.ONE_DAY,new Ee({key:yt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),yt.SEVEN_DAY,new Ee({key:yt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),yt.THIRTY_DAY,new Ee({key:yt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),yt.NINETY_DAY,new Ee({key:yt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),yt.ONE_HUNDRED_EIGHTY_DAY,new Ee({key:yt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),yt.ONE_YEAR,new Ee({key:yt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),yt.CURRENT_WEEK,new vv({key:yt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=ni(new Date,{weekStartsOn:1});return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),yt.CURRENT_MONTH,new Sv({key:yt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=zr(new Date);return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.CURRENT_QUARTER,new Tv({key:yt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date);return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.CURRENT_YEAR,new kv({key:yt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.PREVIOUS_WEEK,new Mv({key:yt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),yt.PREVIOUS_MONTH,new Cv({key:yt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=zr(new Date),n=zr(Eh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Xh(t,n)),3600*24*Ww(new Date().setMonth(new Date().getMonth()-1))+Ah(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.PREVIOUS_QUARTER,new Dv({key:yt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date),t=Fr(Rh(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.PREVIOUS_YEAR,new Ov({key:yt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=Xh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Ah(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Xh(e,t){return Vw(e.getTimezoneOffset()-t.getTimezoneOffset())}yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.THIRTY_DAY,yt.NINETY_DAY,yt.ONE_HUNDRED_EIGHTY_DAY,yt.ONE_YEAR,yt.CURRENT_WEEK,yt.CURRENT_MONTH,yt.CURRENT_QUARTER,yt.CURRENT_YEAR,yt.PREVIOUS_WEEK,yt.PREVIOUS_MONTH,yt.PREVIOUS_QUARTER,yt.PREVIOUS_YEAR;const Av=new Map(yh.map(e=>[e.code,{code:e.code,name:e.name}])),Bc=e=>Av.get(e)?.name||e,Zh=1e3,Ev=1e4,Qh=1e6,Jh=1e9,tp=1e12,fa=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(n),i.push(r)}),i.reverse().join("")},Ls=(e,t,n)=>{const i=e/t,r=n.round?"round":"floor";if(n.decimal===!1)return Math[r](i).toString();let s;n.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function ha(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const r=t.min10k?Ev:Zh;return e<r||t.precision&&t.precision>Math.log10(e)?n=fa(Ls(e,1,t),t):e<Qh?n=`${Ls(e,Zh,t)}k`:e<Jh?n=`${Ls(e,Qh,t)}m`:e<tp?n=`${fa(Ls(e,Jh,t),t)}b`:n=`${fa(Ls(e,tp,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}ha.addCommas=fa;const Rv=typeof document<"u"&&document.documentElement?.lang||"en-US",pa=new Intl.NumberFormat(Rv),Pv=new Set(["%"]),Iv=e=>Pv.has(e)?"flush":"spaced";function $n({i18n:e}){const t=(r,s)=>{if(isNaN(r))return"0 B";const a=s?Math.pow(2,50):1e15,l=s?Math.pow(2,40):1e12,u=s?Math.pow(2,30):1e9,d=s?Math.pow(2,20):1e6,h=s?Math.pow(2,10):1e3;let m;return r>=a?m=e.formatNumber(Number.parseFloat((r/a).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):r>=l?m=e.formatNumber(Number.parseFloat((r/l).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):r>=u?m=e.formatNumber(Number.parseFloat((r/u).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):r>=d?m=e.formatNumber(Number.parseFloat((r/d).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):r>=h?m=e.formatNumber(Number.parseFloat((r/h).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):m=e.formatNumber(Number.parseFloat(r.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),m.replace(/([a-zA-Z]*)$/," $1")},n=(r,s="USD")=>isNaN(r)?s==="USD"?"$0.00":`${r}`:r>=.01||s!=="USD"?e.formatNumber(r,{style:"currency",currency:s}):r<1e-4?"< $0.0001":`$${Number.parseFloat(r.toPrecision(4))}`,i=(r,s,a)=>{if(!a)return r;const l=Iv(s)==="flush"?"":" ";return`${r}${l}${a}`};return{formatUnit:(r,s,{isBytes1024:a=!1,currency:l="USD",approximate:u=!1,translateUnit:d=h=>h}={})=>{const h=d(s,r);switch(s){case"bytes":return t(r,a);case"usd":return n(r,l);default:return isNaN(r)?`${r}`:u?i(ha(r,{capital:!0}),s,h):r<.01?i(`${Number.parseFloat(r.toPrecision(4))}`,s,h):i(pa.format(Number.parseFloat(r.toFixed(2))),s,h)}},formatBytes:t,formatCost:n,formatRange:(r,s,a,{isBytes1024:l=!1,currency:u="USD",approximate:d=!1,translateUnit:h=m=>m}={})=>{const m=h(a,s);switch(a){case"bytes":return`${t(r,l)} - ${t(s,l)}`;case"usd":return`${n(r,u)} - ${n(s,u)}`;default:if(isNaN(r)||isNaN(s))return`${r} - ${s}`;if(d)return i(`${ha(r,{capital:!0})} - ${ha(s,{capital:!0})}`,a,m)}const g=r>=.01?`${pa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`,y=s>=.01?`${pa.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return i(`${g} - ${y}`,a,m)}}}const Lv=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Nv="#0044f4",ep="#6c7489",Bv="#d60027",Fv="#ffc400",zv="#bee2ff",Uv="#8fc1ff",Hv="#5f9aff",Wv="#306fff",$v="#b5ffee",Vv="#00fabe",Yv="#00d6a4",qv="#00a17b",jv="#007d60",Gv="#005944",Kv="#b5ffee",Xv="#00fabe",Zv="#b5ffee",Qv="#00a17b",Jv="#fff296",t1="#ffe04b",e1="#ffc400",n1="#b37600",i1="#995c00",r1="#804400",s1="#fff296",o1="#ffe04b",a1="#ffc2b3",l1="#ff9877",c1="#ff723c",u1="#f75008",d1="#d13500",f1="#a31f00",h1="#ffc2b3",p1="#ff9877",m1="#ff723c",g1="#f75008",_1="#d13500",y1="#a31f00",b1="#ffc2b3",x1="#ff9877",w1="#ff723c",v1="#f75008",S1="#d13500",T1="#a31f00",k1="#ffc2b3",M1="#ff9877",D1="#ff723c",C1="#f75008",O1="#d13500",A1="#a31f00",E1="#ffc2b3",R1="#ff9877",P1="#ff723c",I1="#f75008",L1="#d13500",N1="#ffabab",B1="#ff7272",F1="#ff3954",z1="#f50045",U1="#d60027",H1="#ad000e",W1="#ffabab",$1="#ff7272",V1="#ff3954",Y1="#f50045",q1="#d60027",j1="#eefaff",G1="#ecfffb",K1="#fffce0",X1="#fff1ef",Z1="#ffe5e5",Q1="#5f9aff",J1="#00d6a4",tS="#ffc400",eS="#ff723c",nS="#ff3954",iS={100:zv,101:Uv,102:Hv,103:Wv,200:$v,201:Vv,202:Yv,203:qv,204:jv,205:Gv,206:Kv,207:Xv,208:Zv,226:Qv,300:Jv,301:t1,302:e1,303:n1,304:i1,305:r1,307:s1,308:o1,400:a1,401:l1,402:c1,403:u1,404:d1,405:f1,406:h1,407:p1,408:m1,409:g1,410:_1,411:y1,412:b1,413:x1,414:w1,415:v1,416:S1,417:T1,418:k1,421:M1,422:D1,423:C1,424:O1,425:A1,426:E1,428:R1,429:P1,431:I1,451:L1,500:N1,501:B1,502:F1,503:z1,504:U1,505:H1,506:W1,507:$1,508:V1,510:Y1,511:q1},rS={100:j1,200:G1,300:K1,400:X1,500:Z1},np={"1XX":Q1,"2XX":J1,"3XX":tS,"4XX":eS,"5XX":nS},sS={error:Bv,warning:Fv,empty:"#9DA99D",neutral:ep,____OTHER____:Nv},ip=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],rp=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],oS=e=>Lv(e),sp=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?rp[i%rp.length]:ip[i%ip.length]},Ns=({state:e})=>sS[e]??ep,aS=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return iS[n]??rS[i]??Ns({state:"neutral"})},lS=({group:e})=>np[e]?np[e]:Ns({state:"neutral"}),Bs=({discriminator:e=void 0,state:t=void 0,dimension:n=void 0,dimensionValue:i=void 0,metric:r=void 0,customPalette:s=void 0})=>{let a="light";if(f.hasInjectionContext()&&(a=f.inject("app:konnectColorMode",f.computed(()=>"light")).value),e!==void 0)return sp({discriminator:e,theme:a,customPalette:s});if(t!==void 0)return Ns({state:t});if(i&&["empty","____OTHER____"].includes(i))return Ns({state:i});if(n!==void 0&&i!==void 0){if(n==="status_code")return aS({statusCode:i});if(n==="status_code_grouped")return lS({group:i})}return n||i||r?sp({discriminator:oS(`${n??""}${i??""}${r??""}`),theme:a,customPalette:s}):Ns({state:"neutral"})},op="#d60027",ap="#ffe5e5",cS="#f1f0ff",uS="#e0e4ea",lp="#6c7489",dS="#afb7c5",cp="#0d0e14",fS="#d60027",hS="#ad000e",Fc="#6c7489",up="#52596e",pS="#007d60",mS="#995c00",gS="#ffc400",_S="'Inter', Roboto, Helvetica, sans-serif",rr="16px",yS="20px",bS="#bee2ff",xS="#8fc1ff",wS="#5f9aff",vS="#306fff",SS="#b5ffee",TS="#00fabe",kS="#00d6a4",MS="#00a17b",DS="#007d60",CS="#005944",OS="#b5ffee",AS="#00fabe",ES="#b5ffee",RS="#00a17b",PS="#fff296",IS="#ffe04b",LS="#ffc400",NS="#b37600",BS="#995c00",FS="#804400",zS="#fff296",US="#ffe04b",HS="#ffc2b3",WS="#ff9877",$S="#ff723c",VS="#f75008",YS="#d13500",qS="#a31f00",jS="#ffc2b3",GS="#ff9877",KS="#ff723c",XS="#f75008",ZS="#d13500",QS="#a31f00",JS="#ffc2b3",tT="#ff9877",eT="#ff723c",nT="#f75008",iT="#d13500",rT="#a31f00",sT="#ffc2b3",oT="#ff9877",aT="#ff723c",lT="#f75008",cT="#d13500",uT="#a31f00",dT="#ffc2b3",fT="#ff9877",hT="#ff723c",pT="#f75008",mT="#d13500",gT="#ffabab",_T="#ff7272",yT="#ff3954",bT="#f50045",xT="#d60027",wT="#ad000e",vT="#ffabab",ST="#ff7272",TT="#ff3954",kT="#f50045",MT="#d60027",DT="#eefaff",CT="#ecfffb",OT="#fffce0",AT="#fff1ef",ET="#ffe5e5",RT="#5f9aff",PT="#00d6a4",IT="#ffc400",LT="#ff723c",NT="#ff3954",dp=6048e5,BT=864e5,Fs=6e4,Hr=36e5,FT=1e3,fp=Symbol.for("constructDateFrom");function me(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&fp in e?e[fp](t):e instanceof Date?new e.constructor(t):new Date(t)}function Et(e,t){return me(t||e,e)}function ma(e,t,n){const i=Et(e,n?.in);return isNaN(t)?me(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function zc(e,t,n){const i=Et(e,n?.in);if(isNaN(t))return me(e,NaN);if(!t)return i;const r=i.getDate(),s=me(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Uc(e,t,n){return me(e,+Et(e)+t)}function zT(e,t,n){return Uc(e,t*Hr)}let UT={};function sr(){return UT}function Vn(e,t){const n=sr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Et(e,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Wr(e,t){return Vn(e,{...t,weekStartsOn:1})}function hp(e,t){const n=Et(e,t?.in),i=n.getFullYear(),r=me(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Wr(r),a=me(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Wr(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function ga(e){const t=Et(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function or(e,...t){const n=me.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Hc(e,t){const n=Et(e,t?.in);return n.setHours(0,0,0,0),n}function pp(e,t,n){const[i,r]=or(n?.in,e,t),s=Hc(i),a=Hc(r),l=+s-ga(s),u=+a-ga(a);return Math.round((l-u)/BT)}function HT(e,t){const n=hp(e,t),i=me(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Wr(i)}function WT(e,t,n){const i=Et(e,n?.in);return i.setTime(i.getTime()+t*Fs),i}function $T(e,t,n){return zc(e,t*3,n)}function VT(e,t,n){return Uc(e,t*1e3)}function YT(e,t,n){return ma(e,t*7,n)}function qT(e,t,n){return zc(e,t*12,n)}function zs(e,t){const n=+Et(e)-+Et(t);return n<0?-1:n>0?1:n}function jT(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Wc(e){return!(!jT(e)&&typeof e!="number"||isNaN(+Et(e)))}function GT(e,t,n){const[i,r]=or(n?.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function KT(e,t,n){const[i,r]=or(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function mp(e,t,n){const[i,r]=or(n?.in,e,t),s=gp(i,r),a=Math.abs(pp(i,r));i.setDate(i.getDate()-s*a);const l=+(gp(i,r)===-s),u=s*(a-l);return u===0?0:u}function gp(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Us(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function XT(e,t,n){const[i,r]=or(n?.in,e,t),s=(+i-+r)/Hr;return Us(n?.roundingMethod)(s)}function $c(e,t){return+Et(e)-+Et(t)}function ZT(e,t,n){const i=$c(e,t)/Fs;return Us(n?.roundingMethod)(i)}function _p(e,t){const n=Et(e,t?.in);return n.setHours(23,59,59,999),n}function yp(e,t){const n=Et(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function QT(e,t){const n=Et(e,t?.in);return+_p(n,t)==+yp(n,t)}function bp(e,t,n){const[i,r,s]=or(n?.in,e,e,t),a=zs(r,s),l=Math.abs(GT(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=zs(r,s)===-a;QT(i)&&l===1&&zs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function JT(e,t,n){const i=bp(e,t,n)/3;return Us(n?.roundingMethod)(i)}function tk(e,t,n){const i=$c(e,t)/1e3;return Us(n?.roundingMethod)(i)}function ek(e,t,n){const i=mp(e,t,n)/7;return Us(n?.roundingMethod)(i)}function nk(e,t,n){const[i,r]=or(n?.in,e,t),s=zs(i,r),a=Math.abs(KT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=zs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function ik(e,t){const n=Et(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function rk(e,t){const n=Et(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function sk(e,t){const n=Et(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function xp(e,t){const n=Et(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ok(e,t){const n=Et(e,t?.in);return n.setMinutes(59,59,999),n}function ak(e,t){const n=sr(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Et(e,t?.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function lk(e,t){const n=Et(e,t?.in);return n.setSeconds(59,999),n}function ck(e,t){const n=Et(e,t?.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function uk(e,t){const n=Et(e,t?.in);return n.setMilliseconds(999),n}const dk={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"}},fk=(e,t,n)=>{let i;const r=dk[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Vc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const hk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gk={date:Vc({formats:hk,defaultWidth:"full"}),time:Vc({formats:pk,defaultWidth:"full"}),dateTime:Vc({formats:mk,defaultWidth:"full"})},_k={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yk=(e,t,n,i)=>_k[e];function Hs(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):a;r=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const bk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wk={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"]},vk={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"]},Sk={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"}},Tk={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"}},kk={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Hs({values:bk,defaultWidth:"wide"}),quarter:Hs({values:xk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hs({values:wk,defaultWidth:"wide"}),day:Hs({values:vk,defaultWidth:"wide"}),dayPeriod:Hs({values:Sk,defaultWidth:"wide",formattingValues:Tk,defaultFormattingWidth:"wide"})};function Ws(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Dk(l,m=>m.test(a)):Mk(l,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function Mk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Dk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ck(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Ok=/^(\d+)(th|st|nd|rd)?/i,Ak=/\d+/i,Ek={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},Rk={any:[/^b/i,/^(a|c)/i]},Pk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ik={any:[/1/i,/2/i,/3/i,/4/i]},Lk={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},Nk={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]},Bk={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},Fk={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]},zk={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},Uk={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}},Hk={ordinalNumber:Ck({matchPattern:Ok,parsePattern:Ak,valueCallback:e=>parseInt(e,10)}),era:Ws({matchPatterns:Ek,defaultMatchWidth:"wide",parsePatterns:Rk,defaultParseWidth:"any"}),quarter:Ws({matchPatterns:Pk,defaultMatchWidth:"wide",parsePatterns:Ik,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ws({matchPatterns:Lk,defaultMatchWidth:"wide",parsePatterns:Nk,defaultParseWidth:"any"}),day:Ws({matchPatterns:Bk,defaultMatchWidth:"wide",parsePatterns:Fk,defaultParseWidth:"any"}),dayPeriod:Ws({matchPatterns:zk,defaultMatchWidth:"any",parsePatterns:Uk,defaultParseWidth:"any"})},wp={code:"en-US",formatDistance:fk,formatLong:gk,formatRelative:yk,localize:kk,match:Hk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Wk(e,t){const n=Et(e,t?.in);return pp(n,xp(n))+1}function vp(e,t){const n=Et(e,t?.in),i=+Wr(n)-+HT(n);return Math.round(i/dp)+1}function Yc(e,t){const n=Et(e,t?.in),i=n.getFullYear(),r=sr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=me(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Vn(a,t),u=me(t?.in||e,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Vn(u,t);return+n>=+l?i+1:+n>=+d?i:i-1}function $k(e,t){const n=sr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Yc(e,t),s=me(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function Sp(e,t){const n=Et(e,t?.in),i=+Vn(n,t)-+$k(n,t);return Math.round(i/dp)+1}function Qt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const ki={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Qt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Qt(n+1,2)},d(e,t){return Qt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Qt(e.getHours()%12||12,t.length)},H(e,t){return Qt(e.getHours(),t.length)},m(e,t){return Qt(e.getMinutes(),t.length)},s(e,t){return Qt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Qt(r,t.length)}},$r={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Tp={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return ki.y(e,t)},Y:function(e,t,n,i){const r=Yc(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Qt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Qt(s,t.length)},R:function(e,t){const n=hp(e);return Qt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Qt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Qt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Qt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return ki.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Qt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=Sp(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(e,t,n){const i=vp(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Qt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ki.d(e,t)},D:function(e,t,n){const i=Wk(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Qt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Qt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=$r.noon:i===0?r=$r.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=$r.evening:i>=12?r=$r.afternoon:i>=4?r=$r.morning:r=$r.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return ki.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ki.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ki.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ki.s(e,t)},S:function(e,t){return ki.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Mp(i);case"XXXX":case"XX":return ar(i);default:return ar(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Mp(i);case"xxxx":case"xx":return ar(i);default:return ar(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+kp(i,":");default:return"GMT"+ar(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+kp(i,":");default:return"GMT"+ar(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Qt(i,t.length)},T:function(e,t,n){return Qt(+e,t.length)}};function kp(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Qt(s,2)}function Mp(e,t){return e%60===0?(e>0?"-":"+")+Qt(Math.abs(e)/60,2):ar(e,t)}function ar(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Qt(Math.trunc(i/60),2),s=Qt(i%60,2);return n+r+t+s}const Dp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Cp=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},qc={p:Cp,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Dp(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Dp(i,t)).replace("{{time}}",Cp(r,t))}},Vk=/^D+$/,Yk=/^Y+$/,qk=["D","DD","YY","YYYY"];function Op(e){return Vk.test(e)}function Ap(e){return Yk.test(e)}function jc(e,t,n){const i=jk(e,t,n);if(console.warn(i),qk.includes(e))throw new RangeError(i)}function jk(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xk=/^'([^]*?)'?$/,Zk=/''/g,Qk=/[a-zA-Z]/;function _a(e,t,n){const i=sr(),r=n?.locale??i.locale??wp,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=Et(e,n?.in);if(!Wc(l))throw new RangeError("Invalid time value");let u=t.match(Kk).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=qc[m];return g(h,r.formatLong)}return h}).join("").match(Gk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Jk(h)};if(Tp[m])return{isToken:!0,value:h};if(m.match(Qk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const m=h.value;(!n?.useAdditionalWeekYearTokens&&Ap(m)||!n?.useAdditionalDayOfYearTokens&&Op(m))&&jc(m,t,String(e));const g=Tp[m[0]];return g(l,m,r.localize,d)}).join("")}function Jk(e){const t=e.match(Xk);return t?t[1].replace(Zk,"'"):e}function Ep(){return Object.assign({},sr())}function tM(e,t){const n=Et(e,t?.in).getDay();return n===0?7:n}function eM(e,t){const n=nM(t)?new t(0):me(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function nM(e){return typeof e=="function"&&e.prototype?.constructor===e}const iM=10;class Rp{subPriority=0;validate(t,n){return!0}}class rM extends Rp{constructor(t,n,i,r,s){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class sM extends Rp{priority=iM;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>me(n,i))}set(t,n){return n.timestampIsSet?t:me(t,eM(t,this.context))}}class Vt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new rM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class oM extends Vt{priority=140;parse(t,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const ye={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}/},Yn={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 be(e,t){return e&&{value:t(e.value),rest:e.rest}}function he(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function qn(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(r*Hr+s*Fs+a*FT),rest:t.slice(n[0].length)}}function Pp(e){return he(ye.anyDigitsSigned,e)}function ge(e,t){switch(e){case 1:return he(ye.singleDigit,t);case 2:return he(ye.twoDigits,t);case 3:return he(ye.threeDigits,t);case 4:return he(ye.fourDigits,t);default:return he(new RegExp("^\\d{1,"+e+"}"),t)}}function ya(e,t){switch(e){case 1:return he(ye.singleDigitSigned,t);case 2:return he(ye.twoDigitsSigned,t);case 3:return he(ye.threeDigitsSigned,t);case 4:return he(ye.fourDigitsSigned,t);default:return he(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Gc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Ip(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=e>=s%100;r=e+a-(l?100:0)}return n?r:1-r}function Lp(e){return e%400===0||e%4===0&&e%100!==0}class aM extends Vt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const r=s=>({year:s,isTwoDigitYear:n==="yy"});switch(n){case"y":return be(ge(4,t),r);case"yo":return be(i.ordinalNumber(t,{unit:"year"}),r);default:return be(ge(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=Ip(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class lM extends Vt{priority=130;parse(t,n,i){const r=s=>({year:s,isTwoDigitYear:n==="YY"});switch(n){case"Y":return be(ge(4,t),r);case"Yo":return be(i.ordinalNumber(t,{unit:"year"}),r);default:return be(ge(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,r){const s=Yc(t,r);if(i.isTwoDigitYear){const l=Ip(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}const a=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class cM extends Vt{priority=130;parse(t,n){return ya(n==="R"?4:n.length,t)}set(t,n,i){const r=me(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Wr(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class uM extends Vt{priority=130;parse(t,n){return ya(n==="u"?4:n.length,t)}set(t,n,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class dM extends Vt{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return ge(n.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class fM extends Vt{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return ge(n.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class hM extends Vt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"M":return be(he(ye.month,t),r);case"MM":return be(ge(2,t),r);case"Mo":return be(i.ordinalNumber(t,{unit:"month"}),r);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class pM extends Vt{priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"L":return be(he(ye.month,t),r);case"LL":return be(ge(2,t),r);case"Lo":return be(i.ordinalNumber(t,{unit:"month"}),r);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function mM(e,t,n){const i=Et(e,n?.in),r=Sp(i,n)-t;return i.setDate(i.getDate()-r*7),Et(i,n?.in)}class gM extends Vt{priority=100;parse(t,n,i){switch(n){case"w":return he(ye.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,r){return Vn(mM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function _M(e,t,n){const i=Et(e,n?.in),r=vp(i,n)-t;return i.setDate(i.getDate()-r*7),i}class yM extends Vt{priority=100;parse(t,n,i){switch(n){case"I":return he(ye.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return Wr(_M(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const bM=[31,28,31,30,31,30,31,31,30,31,30,31],xM=[31,29,31,30,31,30,31,31,30,31,30,31];class wM extends Vt{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return he(ye.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear(),r=Lp(i),s=t.getMonth();return r?n>=1&&n<=xM[s]:n>=1&&n<=bM[s]}set(t,n,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class vM extends Vt{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return he(ye.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear();return Lp(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Kc(e,t,n){const i=sr(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Et(e,n?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,h=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return ma(s,h,n)}class SM extends Vt{priority=90;parse(t,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,r){return t=Kc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class TM extends Vt{priority=90;parse(t,n,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(n){case"e":case"ee":return be(ge(n.length,t),s);case"eo":return be(i.ordinalNumber(t,{unit:"day"}),s);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,r){return t=Kc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class kM extends Vt{priority=90;parse(t,n,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(n){case"c":case"cc":return be(ge(n.length,t),s);case"co":return be(i.ordinalNumber(t,{unit:"day"}),s);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,r){return t=Kc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function MM(e,t,n){const i=Et(e,n?.in),r=tM(i,n),s=t-r;return ma(i,s,n)}class DM extends Vt{priority=90;parse(t,n,i){const r=s=>s===0?7:s;switch(n){case"i":case"ii":return ge(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return be(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return be(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return be(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return be(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,n){return n>=1&&n<=7}set(t,n,i){return t=MM(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class CM extends Vt{priority=80;parse(t,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Gc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class OM extends Vt{priority=80;parse(t,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Gc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class AM extends Vt{priority=80;parse(t,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Gc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class EM extends Vt{priority=70;parse(t,n,i){switch(n){case"h":return he(ye.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class RM extends Vt{priority=70;parse(t,n,i){switch(n){case"H":return he(ye.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class PM extends Vt{priority=70;parse(t,n,i){switch(n){case"K":return he(ye.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class IM extends Vt{priority=70;parse(t,n,i){switch(n){case"k":return he(ye.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class LM extends Vt{priority=60;parse(t,n,i){switch(n){case"m":return he(ye.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class NM extends Vt{priority=50;parse(t,n,i){switch(n){case"s":return he(ye.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class BM extends Vt{priority=30;parse(t,n){const i=r=>Math.trunc(r*Math.pow(10,-n.length+3));return be(ge(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class FM extends Vt{priority=10;parse(t,n){switch(n){case"X":return qn(Yn.basicOptionalMinutes,t);case"XX":return qn(Yn.basic,t);case"XXXX":return qn(Yn.basicOptionalSeconds,t);case"XXXXX":return qn(Yn.extendedOptionalSeconds,t);default:return qn(Yn.extended,t)}}set(t,n,i){return n.timestampIsSet?t:me(t,t.getTime()-ga(t)-i)}incompatibleTokens=["t","T","x"]}class zM extends Vt{priority=10;parse(t,n){switch(n){case"x":return qn(Yn.basicOptionalMinutes,t);case"xx":return qn(Yn.basic,t);case"xxxx":return qn(Yn.basicOptionalSeconds,t);case"xxxxx":return qn(Yn.extendedOptionalSeconds,t);default:return qn(Yn.extended,t)}}set(t,n,i){return n.timestampIsSet?t:me(t,t.getTime()-ga(t)-i)}incompatibleTokens=["t","T","X"]}class UM extends Vt{priority=40;parse(t){return Pp(t)}set(t,n,i){return[me(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class HM extends Vt{priority=20;parse(t){return Pp(t)}set(t,n,i){return[me(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const WM={G:new oM,y:new aM,Y:new lM,R:new cM,u:new uM,Q:new dM,q:new fM,M:new hM,L:new pM,w:new gM,I:new yM,d:new wM,D:new vM,E:new SM,e:new TM,c:new kM,i:new DM,a:new CM,b:new OM,B:new AM,h:new EM,H:new RM,K:new PM,k:new IM,m:new LM,s:new NM,S:new BM,X:new FM,x:new zM,t:new UM,T:new HM},$M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YM=/^'([^]*?)'?$/,qM=/''/g,jM=/\S/,GM=/[a-zA-Z]/;function KM(e,t,n,i){const r=()=>me(i?.in||n,NaN),s=Ep(),a=i?.locale??s.locale??wp,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!t)return e?r():Et(n,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new sM(i?.in,n)],m=t.match(VM).map(S=>{const O=S[0];if(O in qc){const A=qc[O];return A(S,a.formatLong)}return S}).join("").match($M),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&Ap(S)&&jc(S,t,e),!i?.useAdditionalDayOfYearTokens&&Op(S)&&jc(S,t,e);const O=S[0],A=WM[O];if(A){const{incompatibleTokens:P}=A;if(Array.isArray(P)){const R=g.find(F=>P.includes(F.token)||F.token===O);if(R)throw new RangeError(`The format string mustn't contain \`${R.fullToken}\` and \`${S}\` at the same time`)}else if(A.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);g.push({token:O,fullToken:S});const L=A.run(e,S,a.match,d);if(!L)return r();h.push(L.setter),e=L.rest}else{if(O.match(GM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");if(S==="''"?S="'":O==="'"&&(S=XM(S)),e.indexOf(S)===0)e=e.slice(S.length);else return r()}}if(e.length>0&&jM.test(e))return r();const y=h.map(S=>S.priority).sort((S,O)=>O-S).filter((S,O,A)=>A.indexOf(S)===O).map(S=>h.filter(O=>O.priority===S).sort((O,A)=>A.subPriority-O.subPriority)).map(S=>S[0]);let x=Et(n,i?.in);if(isNaN(+x))return r();const v={};for(const S of y){if(!S.validate(x,d))return r();const O=S.set(x,v,d);Array.isArray(O)?(x=O[0],Object.assign(v,O[1])):x=O}return x}function XM(e){return e.match(YM)[1].replace(qM,"'")}function ZM(e,t){const n=Et(e,t?.in);return n.setMinutes(0,0,0),n}function QM(e,t){const n=Et(e,t?.in);return n.setSeconds(0,0),n}function JM(e,t){const n=Et(e,t?.in);return n.setMilliseconds(0),n}function Np(e){const t=e/Hr;return Math.trunc(t)}function Bp(e,t){const n=()=>me(t?.in,NaN),i=t?.additionalDigits??2,r=iD(e);let s;if(r.date){const d=rD(r.date,i);s=sD(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const a=+s;let l=0,u;if(r.time&&(l=oD(r.time),isNaN(l)))return n();if(r.timezone){if(u=aD(r.timezone),isNaN(u))return n()}else{const d=new Date(a+l),h=Et(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return Et(a+l+u,t?.in)}const ba={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tD=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,eD=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nD=/^([+-])(\d{2})(?::?(\d{2}))?$/;function iD(e){const t={},n=e.split(ba.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],ba.timeZoneDelimiter.test(t.date)&&(t.date=e.split(ba.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const r=ba.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function rD(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:e.slice((i[1]||i[2]).length)}}function sD(e,t){if(t===null)return new Date(NaN);const n=e.match(tD);if(!n)return new Date(NaN);const i=!!n[4],r=$s(n[1]),s=$s(n[2])-1,a=$s(n[3]),l=$s(n[4]),u=$s(n[5])-1;if(i)return fD(t,l,u)?lD(t,l,u):new Date(NaN);{const d=new Date(0);return!uD(t,s,a)||!dD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function $s(e){return e?parseInt(e):1}function oD(e){const t=e.match(eD);if(!t)return NaN;const n=Xc(t[1]),i=Xc(t[2]),r=Xc(t[3]);return hD(n,i,r)?n*Hr+i*Fs+r*1e3:NaN}function Xc(e){return e&&parseFloat(e.replace(",","."))||0}function aD(e){if(e==="Z")return 0;const t=e.match(nD);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return pD(i,r)?n*(i*Hr+r*Fs):NaN}function lD(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const cD=[31,null,31,30,31,30,31,31,30,31,30,31];function Fp(e){return e%400===0||e%4===0&&e%100!==0}function uD(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(cD[t]||(Fp(e)?29:28))}function dD(e,t){return t>=1&&t<=(Fp(e)?366:365)}function fD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function hD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function pD(e,t){return t>=0&&t<=59}const zp={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",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",scatter:{median:"Median",percentile:"p{value}",outlier:"Outlier (> {label})"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},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."},canceled:{message:"Request canceled"},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",share_of_requests:"Share of requests",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)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal 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",consumer_group:"Consumer group",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",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)",total_tokens_per_minute:"Total tokens per minute",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",cost_per_request_average:"Request cost (avg per million)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",share_of_requests:"Share of requests",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) 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}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal 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_size_sum:"Request size (sum) 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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)",api:"API",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)",total_tokens_per_minute:"Total tokens per minute"},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"},timestampAxisTitles:{platform:"@timestamp created at"},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)"}},topTalkers:{total:"{value} total",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong"},singleValue:{valueError:"Invalid configuration",trend:{not_available:"Not available"}},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 Up(){const e=mh.createI18n("en-us",zp);return{i18n:e,i18nT:mh.i18nTComponent(e)}}function Vs(e){return e+.5|0}const Mi=(e,t,n)=>Math.max(Math.min(e,n),t);function Ys(e){return Mi(Vs(e*2.55),0,255)}function Di(e){return Mi(Vs(e*255),0,255)}function ii(e){return Mi(Vs(e/2.55)/100,0,1)}function Hp(e){return Mi(Vs(e*100),0,100)}const Mn={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},Zc=[..."0123456789ABCDEF"],mD=e=>Zc[e&15],gD=e=>Zc[(e&240)>>4]+Zc[e&15],xa=e=>(e&240)>>4===(e&15),_D=e=>xa(e.r)&&xa(e.g)&&xa(e.b)&&xa(e.a);function yD(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Mn[e[1]]*17,g:255&Mn[e[2]]*17,b:255&Mn[e[3]]*17,a:t===5?Mn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Mn[e[1]]<<4|Mn[e[2]],g:Mn[e[3]]<<4|Mn[e[4]],b:Mn[e[5]]<<4|Mn[e[6]],a:t===9?Mn[e[7]]<<4|Mn[e[8]]:255})),n}const bD=(e,t)=>e<255?t(e):"";function xD(e){var t=_D(e)?mD:gD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+bD(e.a,t):void 0}const wD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wp(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function vD(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function SD(e,t,n){const i=Wp(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function TD(e,t,n,i,r){return e===r?(t-n)/i+(t<n?6:0):t===r?(n-e)/i+2:(e-t)/i+4}function Qc(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,i,r),l=(s+a)/2;let u,d,h;return s!==a&&(h=s-a,d=l>.5?h/(2-s-a):h/(s+a),u=TD(n,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Jc(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Di)}function tu(e,t,n){return Jc(Wp,e,t,n)}function kD(e,t,n){return Jc(SD,e,t,n)}function MD(e,t,n){return Jc(vD,e,t,n)}function $p(e){return(e%360+360)%360}function DD(e){const t=wD.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ys(+t[5]):Di(+t[5]));const r=$p(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=kD(r,s,a):t[1]==="hsv"?i=MD(r,s,a):i=tu(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function CD(e,t){var n=Qc(e);n[0]=$p(n[0]+t),n=tu(n),e.r=n[0],e.g=n[1],e.b=n[2]}function OD(e){if(!e)return;const t=Qc(e),n=t[0],i=Hp(t[1]),r=Hp(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${ii(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Vp={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"},Yp={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 AD(){const e={},t=Object.keys(Yp),n=Object.keys(Vp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<n.length;r++)s=n[r],l=l.replace(s,Vp[s]);s=parseInt(Yp[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let wa;function ED(e){wa||(wa=AD(),wa.transparent=[0,0,0,0]);const t=wa[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const RD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function PD(e){const t=RD.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?Ys(a):Mi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Ys(i):Mi(i,0,255)),r=255&(t[4]?Ys(r):Mi(r,0,255)),s=255&(t[6]?Ys(s):Mi(s,0,255)),{r:i,g:r,b:s,a:n}}}function ID(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const eu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Vr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function LD(e,t,n){const i=Vr(ii(e.r)),r=Vr(ii(e.g)),s=Vr(ii(e.b));return{r:Di(eu(i+n*(Vr(ii(t.r))-i))),g:Di(eu(r+n*(Vr(ii(t.g))-r))),b:Di(eu(s+n*(Vr(ii(t.b))-s))),a:e.a+n*(t.a-e.a)}}function va(e,t,n){if(e){let i=Qc(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=tu(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function qp(e,t){return e&&Object.assign(t||{},e)}function jp(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Di(e[3]))):(t=qp(e,{r:0,g:0,b:0,a:1}),t.a=Di(t.a)),t}function ND(e){return e.charAt(0)==="r"?PD(e):DD(e)}class qs{constructor(t){if(t instanceof qs)return t;const n=typeof t;let i;n==="object"?i=jp(t):n==="string"&&(i=yD(t)||ED(t)||ND(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=qp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=jp(t)}rgbString(){return this._valid?ID(this._rgb):void 0}hexString(){return this._valid?xD(this._rgb):void 0}hslString(){return this._valid?OD(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const a=n===s?.5:n,l=2*a-1,u=i.a-r.a,d=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-d,i.r=255&d*i.r+s*r.r+.5,i.g=255&d*i.g+s*r.g+.5,i.b=255&d*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=LD(this._rgb,t._rgb,n)),this}clone(){return new qs(this.rgb)}alpha(t){return this._rgb.a=Di(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Vs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 va(this._rgb,2,t),this}darken(t){return va(this._rgb,2,-t),this}saturate(t){return va(this._rgb,1,t),this}desaturate(t){return va(this._rgb,1,-t),this}rotate(t){return CD(this._rgb,t),this}}function ri(){}const BD=(()=>{let e=0;return()=>e++})();function kt(e){return e==null}function jt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Nt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function le(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mn(e,t){return le(e)?e:t}function Ot(e,t){return typeof e>"u"?t:e}const FD=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Gp=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Jt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function te(e,t,n,i){let r,s,a;if(jt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(Nt(e))for(a=Object.keys(e),s=a.length,r=0;r<s;r++)t.call(n,e[a[r]],a[r])}function Sa(e,t){let n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(r=e[n],s=t[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Ta(e){if(jt(e))return e.map(Ta);if(Nt(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let r=0;for(;r<i;++r)t[n[r]]=Ta(e[n[r]]);return t}return e}function Kp(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function zD(e,t,n,i){if(!Kp(e))return;const r=t[e],s=n[e];Nt(r)&&Nt(s)?js(r,s,i):t[e]=Ta(s)}function js(e,t,n){const i=jt(t)?t:[t],r=i.length;if(!Nt(e))return e;n=n||{};const s=n.merger||zD;let a;for(let l=0;l<r;++l){if(a=i[l],!Nt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],e,a,n)}return e}function Gs(e,t){return js(e,t,{merger:UD})}function UD(e,t,n){if(!Kp(e))return;const i=t[e],r=n[e];Nt(i)&&Nt(r)?Gs(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ta(r))}const Xp={"":e=>e,x:e=>e.x,y:e=>e.y};function HD(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function WD(e){const t=HD(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(Xp[t]||(Xp[t]=WD(t)))(e)}function nu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const sn=e=>typeof e<"u",on=e=>typeof e=="function",Zp=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function $D(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Pt=Math.PI,ne=2*Pt,VD=ne+Pt,ka=Number.POSITIVE_INFINITY,iu=Pt/180,oe=Pt/2,Dn=Pt/4,Ma=Pt*2/3,Oi=Math.log10,jn=Math.sign;function Ks(e,t,n){return Math.abs(e-t)<n}function Qp(e){const t=Math.round(e);e=Ks(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Oi(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function YD(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((r,s)=>r-s).pop(),t}function qD(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ai(e){return!qD(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function jD(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Jp(e,t,n){let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function ve(e){return e*(Pt/180)}function Da(e){return e*(180/Pt)}function tm(e){if(!le(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Ca(e,t){const n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*Pt&&(s+=ne),{angle:s,distance:r}}function Yr(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function GD(e,t){return(e-t+VD)%ne-Pt}function We(e){return(e%ne+ne)%ne}function Xs(e,t,n,i){const r=We(e),s=We(t),a=We(n),l=We(s-r),u=We(a-r),d=We(r-s),h=We(r-a);return r===s||r===a||i&&s===a||l>u&&d<h}function Re(e,t,n){return Math.max(t,Math.min(n,e))}function KD(e){return Re(e,-32768,32767)}function si(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function ru(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const oi=(e,t,n,i)=>ru(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),XD=(e,t,n)=>ru(e,n,i=>e[i][t]>=n);function ZD(e,t,n){let i=0,r=e.length;for(;i<r&&e[i]<t;)i++;for(;r>i&&e[r-1]>n;)r--;return i>0||r<e.length?e.slice(i,r):e}const em=["push","pop","shift","splice","unshift"];function QD(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),em.forEach(n=>{const i="_onData"+nu(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function nm(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(em.forEach(s=>{delete e[s]}),delete e._chartjs)}function im(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const rm=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function sm(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,rm.call(window,()=>{i=!1,e.apply(t,n)}))}}function JD(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const su=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,tC=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function om(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:l,_parsed:u}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=a.axis,{min:m,max:g,minDefined:y,maxDefined:x}=a.getUserBounds();if(y){if(r=Math.min(oi(u,h,m).lo,n?i:oi(t,h,a.getPixelForValue(m)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(S=>!kt(S[l.axis]));r-=Math.max(0,v)}r=Re(r,0,i-1)}if(x){let v=Math.max(oi(u,a.axis,g,!0).hi+1,n?0:oi(t,h,a.getPixelForValue(g),!0).hi+1);if(d){const S=u.slice(v-1).findIndex(O=>!kt(O[l.axis]));v+=Math.max(0,S)}s=Re(v,r,i)-r}else s=i-r}return{start:r,count:s}}function am(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const Oa=e=>e===0||e===1,lm=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ne/n)),cm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ne/n)+1,Zs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*oe)+1,easeOutSine:e=>Math.sin(e*oe),easeInOutSine:e=>-.5*(Math.cos(Pt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Oa(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Oa(e)?e:lm(e,.075,.3),easeOutElastic:e=>Oa(e)?e:cm(e,.075,.3),easeInOutElastic(e){return Oa(e)?e:e<.5?.5*lm(e*2,.1125,.45):.5+.5*cm(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Zs.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Zs.easeInBounce(e*2)*.5:Zs.easeOutBounce(e*2-1)*.5+.5};function ou(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Aa(e){return ou(e)?e:new qs(e)}function au(e){return ou(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const eC=["x","y","borderWidth","radius","tension"],nC=["color","borderColor","backgroundColor"];function iC(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:nC},numbers:{type:"number",properties:eC}}),e.describe("animations",{_fallback:"animation"}),e.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 rC(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const um=new Map;function sC(e,t){t=t||{};const n=e+JSON.stringify(t);let i=um.get(n);return i||(i=new Intl.NumberFormat(e,t),um.set(n,i)),i}function Qs(e,t,n){return sC(t,n).format(e)}const dm={values(e){return jt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=oC(e,n)}const a=Oi(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),Qs(e,i,u)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Oi(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?dm.numeric.call(this,e,t,n):""}};function oC(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Ea={formatters:dm};function aC(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:Ea.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const lr=Object.create(null),lu=Object.create(null);function Js(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];e=e[s]||(e[s]=Object.create(null))}return e}function cu(e,t,n){return typeof t=="string"?js(Js(e,t),n):js(Js(e,""),t)}class lC{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>au(r.backgroundColor),this.hoverBorderColor=(i,r)=>au(r.borderColor),this.hoverColor=(i,r)=>au(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return cu(this,t,n)}get(t){return Js(this,t)}describe(t,n){return cu(lu,t,n)}override(t,n){return cu(lr,t,n)}route(t,n,i,r){const s=Js(this,t),a=Js(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const u=this[l],d=a[r];return Nt(u)?Object.assign({},d,u):Ot(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var ae=new lC({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[iC,rC,aC]);function cC(e){return!e||kt(e.size)||kt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Ra(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function uC(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const l=n.length;let u,d,h,m,g;for(u=0;u<l;u++)if(m=n[u],m!=null&&!jt(m))a=Ra(e,r,s,a,m);else if(jt(m))for(d=0,h=m.length;d<h;d++)g=m[d],g!=null&&!jt(g)&&(a=Ra(e,r,s,a,g));e.restore();const y=s.length/2;if(y>n.length){for(u=0;u<y;u++)delete r[s[u]];s.splice(0,y)}return a}function cr(e,t,n){const i=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*i)/i+r}function fm(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function uu(e,t,n,i){hm(e,t,n,i,null)}function hm(e,t,n,i,r){let s,a,l,u,d,h,m,g;const y=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*iu;if(y&&typeof y=="object"&&(s=y.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(S),e.drawImage(y,-y.width/2,-y.height/2,y.width,y.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),y){default:r?e.ellipse(n,i,r/2,v,0,0,ne):e.arc(n,i,v,0,ne),e.closePath();break;case"triangle":h=r?r/2:v,e.moveTo(n+Math.sin(S)*h,i-Math.cos(S)*v),S+=Ma,e.lineTo(n+Math.sin(S)*h,i-Math.cos(S)*v),S+=Ma,e.lineTo(n+Math.sin(S)*h,i-Math.cos(S)*v),e.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(S+Dn)*u,m=Math.cos(S+Dn)*(r?r/2-d:u),l=Math.sin(S+Dn)*u,g=Math.sin(S+Dn)*(r?r/2-d:u),e.arc(n-m,i-l,d,S-Pt,S-oe),e.arc(n+g,i-a,d,S-oe,S),e.arc(n+m,i+l,d,S,S+oe),e.arc(n-g,i+a,d,S+oe,S+Pt),e.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,e.rect(n-h,i-u,2*h,2*u);break}S+=Dn;case"rectRot":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+g,i-a),e.lineTo(n+m,i+l),e.lineTo(n-g,i+a),e.closePath();break;case"crossRot":S+=Dn;case"cross":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a);break;case"star":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a),S+=Dn,m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a);break;case"line":a=r?r/2:Math.cos(S)*v,l=Math.sin(S)*v,e.moveTo(n-a,i-l),e.lineTo(n+a,i+l);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(S)*(r?r/2:v),i+Math.sin(S)*v);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ai(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function to(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function eo(e){e.restore()}function dC(e,t,n,i,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else r==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function fC(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function hC(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),kt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function pC(e,t,n,i,r){if(r.strikethrough||r.underline){const s=e.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=n-s.actualBoundingBoxAscent,d=n+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,h),e.lineTo(l,h),e.stroke()}}function mC(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ur(e,t,n,i,r,s={}){const a=jt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(e.save(),e.font=r.string,hC(e,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&mC(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),kt(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,i,s.maxWidth)),e.fillText(d,n,i,s.maxWidth),pC(e,n,i,d,s),i+=Number(r.lineHeight);e.restore()}function qr(e,t){const{x:n,y:i,w:r,h:s,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*Pt,Pt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Pt,oe,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,oe,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-oe,!0),e.lineTo(n+a.topLeft,i)}const gC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_C=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yC(e,t){const n=(""+e).match(gC);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const bC=e=>+e||0;function du(e,t){const n={},i=Nt(t),r=i?Object.keys(t):t,s=Nt(e)?i?a=>Ot(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=bC(s(a));return n}function pm(e){return du(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(e){return du(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(e){const t=pm(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(e,t){e=e||{},t=t||ae.font;let n=Ot(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ot(e.style,t.style);i&&!(""+i).match(_C)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ot(e.family,t.family),lineHeight:yC(Ot(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ot(e.weight,t.weight),string:""};return r.string=cC(r),r}function no(e,t,n,i){let r,s,a;for(r=0,s=e.length;r<s;++r)if(a=e[r],a!==void 0&&a!==void 0)return a}function xC(e,t,n){const{min:i,max:r}=e,s=Gp(t,(r-i)/2),a=(l,u)=>n&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ri(e,t){return Object.assign(Object.create(e),t)}function fu(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=bm("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>fu([l,...e],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete e[0][u],!0},get(l,u){return gm(l,u,()=>CC(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return xm(l).includes(u)},ownKeys(l){return xm(l)},set(l,u,d){const h=l._storage||(l._storage=r());return l[u]=h[u]=d,delete l._keys,!0}})}function jr(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:mm(e,i),setContext:s=>jr(e,s,n,i),override:s=>jr(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,l){return gm(s,a,()=>vC(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,l){return e[a]=l,delete s[a],!0}})}function mm(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:on(n)?n:()=>n,isIndexable:on(i)?i:()=>i}}const wC=(e,t)=>e?e+nu(t):t,hu=(e,t)=>Nt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gm(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function vC(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return on(l)&&a.isScriptable(t)&&(l=SC(t,l,e,n)),jt(l)&&l.length&&(l=TC(t,l,e,a.isIndexable)),hu(t,l)&&(l=jr(l,r,s&&s[t],a)),l}function SC(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let u=t(s,a||i);return l.delete(e),hu(e,u)&&(u=pu(r._scopes,r,e,u)),u}function TC(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(Nt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const m=pu(d,r,e,h);t.push(jr(m,s,a&&a[e],l))}}return t}function _m(e,t,n){return on(e)?e(t,n):e}const kC=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function MC(e,t,n,i,r){for(const s of t){const a=kC(n,s);if(a){e.add(a);const l=_m(a._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function pu(e,t,n,i){const r=t._rootScopes,s=_m(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=ym(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=ym(l,a,s,u,i),u===null)?!1:fu(Array.from(l),[""],r,s,()=>DC(t,n,i))}function ym(e,t,n,i,r){for(;n;)n=MC(e,t,n,i,r);return n}function DC(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return jt(r)&&Nt(n)?n:r||{}}function CC(e,t,n,i){let r;for(const s of t)if(r=bm(wC(s,e),n),typeof r<"u")return hu(e,r)?pu(n,i,e,r):r}function bm(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function xm(e){let t=e._keys;return t||(t=e._keys=OC(e._scopes)),t}function OC(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function wm(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,h;for(l=0,u=i;l<u;++l)d=l+n,h=t[d],a[l]={r:r.parse(Ci(h,s),d)};return a}const AC=Number.EPSILON||1e-14,Gr=(e,t)=>t<e.length&&!e[t].skip&&e[t],vm=e=>e==="x"?"y":"x";function EC(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,l=Yr(s,r),u=Yr(a,s);let d=l/(l+u),h=u/(l+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const m=i*d,g=i*h;return{previous:{x:s.x-m*(a.x-r.x),y:s.y-m*(a.y-r.y)},next:{x:s.x+g*(a.x-r.x),y:s.y+g*(a.y-r.y)}}}function RC(e,t,n){const i=e.length;let r,s,a,l,u,d=Gr(e,0);for(let h=0;h<i-1;++h)if(u=d,d=Gr(e,h+1),!(!u||!d)){if(Ks(t[h],0,AC)){n[h]=n[h+1]=0;continue}r=n[h]/t[h],s=n[h+1]/t[h],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),n[h]=r*a*t[h],n[h+1]=s*a*t[h])}}function PC(e,t,n="x"){const i=vm(n),r=e.length;let s,a,l,u=Gr(e,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Gr(e,d+1),!l)continue;const h=l[n],m=l[i];a&&(s=(h-a[n])/3,l[`cp1${n}`]=h-s,l[`cp1${i}`]=m-s*t[d]),u&&(s=(u[n]-h)/3,l[`cp2${n}`]=h+s,l[`cp2${i}`]=m+s*t[d])}}function IC(e,t="x"){const n=vm(t),i=e.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Gr(e,0);for(a=0;a<i;++a)if(l=u,u=d,d=Gr(e,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[n]-u[n])/h:0}s[a]=l?d?jn(r[a-1])!==jn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}RC(e,r,s),PC(e,s,t)}function Pa(e,t,n){return Math.max(Math.min(e,n),t)}function LC(e,t){let n,i,r,s,a,l=ai(e[0],t);for(n=0,i=e.length;n<i;++n)a=s,s=l,l=n<i-1&&ai(e[n+1],t),s&&(r=e[n],a&&(r.cp1x=Pa(r.cp1x,t.left,t.right),r.cp1y=Pa(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Pa(r.cp2x,t.left,t.right),r.cp2y=Pa(r.cp2y,t.top,t.bottom)))}function NC(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")IC(e,r);else{let d=i?e[e.length-1]:e[0];for(s=0,a=e.length;s<a;++s)l=e[s],u=EC(d,l,e[Math.min(s+1,a-(i?0:1))%a],t.tension),l.cp1x=u.previous.x,l.cp1y=u.previous.y,l.cp2x=u.next.x,l.cp2y=u.next.y,d=l}t.capBezierPoints&&LC(e,n)}function mu(){return typeof window<"u"&&typeof document<"u"}function gu(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ia(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const La=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function BC(e,t){return La(e).getPropertyValue(t)}const FC=["top","right","bottom","left"];function dr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=FC[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zC=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function UC(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(zC(r,s,e.target))l=r,u=s;else{const d=t.getBoundingClientRect();l=i.clientX-d.left,u=i.clientY-d.top,a=!0}return{x:l,y:u,box:a}}function Pi(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=La(n),s=r.boxSizing==="border-box",a=dr(r,"padding"),l=dr(r,"border","width"),{x:u,y:d,box:h}=UC(e,n),m=a.left+(h&&l.left),g=a.top+(h&&l.top);let{width:y,height:x}=t;return s&&(y-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-m)/y*n.width/i),y:Math.round((d-g)/x*n.height/i)}}function HC(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&gu(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),l=La(s),u=dr(l,"border","width"),d=dr(l,"padding");t=a.width-d.width-u.width,n=a.height-d.height-u.height,i=Ia(l.maxWidth,s,"clientWidth"),r=Ia(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||ka,maxHeight:r||ka}}const Ii=e=>Math.round(e*10)/10;function WC(e,t,n,i){const r=La(e),s=dr(r,"margin"),a=Ia(r.maxWidth,e,"clientWidth")||ka,l=Ia(r.maxHeight,e,"clientHeight")||ka,u=HC(e,t,n);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const g=dr(r,"border","width"),y=dr(r,"padding");d-=y.width+g.width,h-=y.height+g.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ii(Math.min(d,a,u.maxWidth)),h=Ii(Math.min(h,l,u.maxHeight)),d&&!h&&(h=Ii(d/2)),(t!==void 0||n!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ii(Math.floor(h*i))),{width:d,height:h}}function Sm(e,t,n){const i=t||1,r=Ii(e.height*i),s=Ii(e.width*i);e.height=Ii(e.height),e.width=Ii(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const $C=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};mu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Tm(e,t){const n=BC(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function fr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function VC(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function YC(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=fr(e,r,n),l=fr(r,s,n),u=fr(s,t,n),d=fr(a,l,n),h=fr(l,u,n);return fr(d,h,n)}const qC=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},jC=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Kr(e,t,n){return e?qC(t,n):jC()}function km(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Mm(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Dm(e){return e==="angle"?{between:Xs,compare:GD,normalize:We}:{between:si,compare:(t,n)=>t-n,normalize:t=>t}}function Cm({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function GC(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=Dm(i),u=t.length;let{start:d,end:h,loop:m}=e,g,y;if(m){for(d+=u,h+=u,g=0,y=u;g<y&&a(l(t[d%u][i]),r,s);++g)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:m,style:e.style}}function Om(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:d}=Dm(i),{start:h,end:m,loop:g,style:y}=GC(e,t,n),x=[];let v=!1,S=null,O,A,P;const L=()=>u(r,P,O)&&l(r,P)!==0,R=()=>l(s,O)===0||u(s,P,O),F=()=>v||L(),U=()=>!v||R();for(let D=h,w=h;D<=m;++D)A=t[D%a],!A.skip&&(O=d(A[i]),O!==P&&(v=u(O,r,s),S===null&&F()&&(S=l(O,r)===0?D:w),S!==null&&U()&&(x.push(Cm({start:S,end:D,loop:g,count:a,style:y})),S=null),w=D,P=O));return S!==null&&x.push(Cm({start:S,end:m,loop:g,count:a,style:y})),x}function Am(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Om(i[r],e.points,t);s.length&&n.push(...s)}return n}function KC(e,t,n,i){let r=0,s=t-1;if(n&&!i)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function XC(e,t,n,i){const r=e.length,s=[];let a=t,l=e[t],u;for(u=t+1;u<=n;++u){const d=e[u%r];d.skip||d.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=d.stop?u:null):(a=u,l.skip&&(t=u)),l=d}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function ZC(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=KC(n,r,s,i);if(i===!0)return Em(e,[{start:a,end:l,loop:s}],n,t);const u=l<a?l+r:l,d=!!e._fullLoop&&a===0&&l===r-1;return Em(e,XC(n,a,u,d),n,t)}function Em(e,t,n,i){return!i||!i.setContext||!n?t:QC(e,t,n,i)}function QC(e,t,n,i){const r=e._chart.getContext(),s=Rm(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,u=n.length,d=[];let h=s,m=t[0].start,g=m;function y(x,v,S,O){const A=l?-1:1;if(x!==v){for(x+=u;n[x%u].skip;)x-=A;for(;n[v%u].skip;)v+=A;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:S,style:O}),h=O,m=v%u)}}for(const x of t){m=l?m:x.start;let v=n[m%u],S;for(g=m+1;g<=x.end;g++){const O=n[g%u];S=Rm(i.setContext(Ri(r,{type:"segment",p0:v,p1:O,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),JC(S,h)&&y(m,g-1,x.loop,h),v=O,h=S}m<g-1&&y(m,g-1,x.loop,h)}return d}function Rm(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function JC(e,t){if(!t)return!1;const n=[],i=function(r,s){return ou(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Na(e,t,n){return e.options.clip?e[n]:t[n]}function tO(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Na(n,t,"left"),right:Na(n,t,"right"),top:Na(i,t,"top"),bottom:Na(i,t,"bottom")}:t}function Pm(e,t){const n=t._clip;if(n.disabled)return!1;const i=tO(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class eO{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],a=n.duration;s.forEach(l=>l({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=rm.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var li=new eO;const Im="transparent",nO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Aa(e||Im),r=i.valid&&Aa(t||Im);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class iO{constructor(t,n,i,r){const s=n[i];r=no([t.to,r,s,t.from]);const a=no([t.from,s,r]);this._active=!0,this._fn=t.fn||nO[t.type||typeof a],this._easing=Zs[t.easing]||Zs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=no([t.to,n,r,t.from]),this._from=no([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||n<i),!this._active){this._target[r]=l,this._notify(!0);return}if(n<0){this._target[r]=s;return}u=n/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class _u{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Nt(t))return;const n=Object.keys(ae.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Nt(s))return;const a={};for(const l of n)a[l]=s[l];(jt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=sO(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&rO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const d=a[u];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(t,n));continue}const h=n[d];let m=s[d];const g=i.get(d);if(m)if(g&&m.active()){m.update(g,h,l);continue}else m.cancel();if(!g||!g.duration){t[d]=h;continue}s[d]=m=new iO(g,t,d,h),r.push(m)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return li.add(this._chart,i),!0}}function rO(e,t){const n=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=e[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function sO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Lm(e,t){const n=e&&e.options||{},i=n.reverse,r=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function oO(e,t,n){if(n===!1)return!1;const i=Lm(e,n),r=Lm(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function aO(e){let t,n,i,r;return Nt(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:e===!1}}function Nm(e,t){const n=[],i=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function Bm(e,t,n,i={}){const r=e.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let h=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===n){if(h=!0,i.all)continue;break}d=e.values[u],le(d)&&(s||t===0||jn(t)===jn(d))&&(t+=d)}return!h&&!i.all?0:t}function lO(e,t){const{iScale:n,vScale:i}=t,r=n.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(e),l=new Array(a.length);let u,d,h;for(u=0,d=a.length;u<d;++u)h=a[u],l[u]={[r]:h,[s]:e[h]};return l}function yu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function cO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function uO(e){const{min:t,max:n,minDefined:i,maxDefined:r}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function dO(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Fm(e,t,n,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=e[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function zm(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,h=cO(s,a,i),m=t.length;let g;for(let y=0;y<m;++y){const x=t[y],{[u]:v,[d]:S}=x,O=x._stacks||(x._stacks={});g=O[d]=dO(r,h,v),g[l]=S,g._top=Fm(g,a,!0,i.type),g._bottom=Fm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function bu(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function fO(e,t){return Ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function hO(e,t,n){return Ri(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function io(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const xu=e=>e==="reset"||e==="none",Um=(e,t)=>t?e:Object.assign({},e),pO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Nm(n,!0),values:null};class Li{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=yu(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&&io(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(m,g,y,x)=>m==="x"?g:m==="r"?x:y,s=n.xAxisID=Ot(i.xAxisID,bu(t,"x")),a=n.yAxisID=Ot(i.yAxisID,bu(t,"y")),l=n.rAxisID=Ot(i.rAxisID,bu(t,"r")),u=n.indexAxis,d=n.iAxisID=r(u,s,a,l),h=n.vAxisID=r(u,a,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(h)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&nm(this._data,this),t._stacked&&io(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Nt(n)){const r=this._cachedMeta;this._data=lO(n,r)}else if(i!==n){if(i){nm(i,this);const r=this._cachedMeta;io(r),r._parsed=[]}n&&Object.isExtensible(n)&&QD(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=yu(n.vScale,n),n.stack!==i.stack&&(r=!0,io(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(zm(this,n._parsed),n._stacked=yu(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&n===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,m,g;if(this._parsing===!1)i._parsed=r,i._sorted=!0,g=r;else{jt(r[t])?g=this.parseArrayData(i,r,t,n):Nt(r[t])?g=this.parseObjectData(i,r,t,n):g=this.parsePrimitiveData(i,r,t,n);const y=()=>m[l]===null||d&&m[l]<d[l];for(h=0;h<n;++h)i._parsed[h+t]=m=g[h],u&&(y()&&(u=!1),d=m);i._sorted=u}a&&zm(this,g)}parsePrimitiveData(t,n,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),h=s===a,m=new Array(r);let g,y,x;for(g=0,y=r;g<y;++g)x=g+i,m[g]={[l]:h||s.parse(d[x],x),[u]:a.parse(n[x],x)};return m}parseArrayData(t,n,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,h,m;for(u=0,d=r;u<d;++u)h=u+i,m=n[h],l[u]={x:s.parse(m[0],h),y:a.parse(m[1],h)};return l}parseObjectData(t,n,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,m,g,y;for(h=0,m=r;h<m;++h)g=h+i,y=n[g],d[h]={x:s.parse(Ci(y,l),g),y:a.parse(Ci(y,u),g)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const r=this.chart,s=this._cachedMeta,a=n[t.axis],l={keys:Nm(r,!0),values:n._stacks[t.axis]._visualValues};return Bm(l,a,s.index,{mode:i})}updateRangeFromParsed(t,n,i,r){const s=i[n.axis];let a=s===null?NaN:s;const l=r&&i._stacks[n.axis];r&&l&&(r.values=l,a=Bm(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=pO(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:m}=uO(l);let g,y;function x(){y=r[g];const v=y[l.axis];return!le(y[t.axis])||h>v||m<v}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,y,u),s));++g);if(s){for(g=a-1;g>=0;--g)if(!x()){this.updateRangeFromParsed(d,t,y,u);break}}return d}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r<s;++r)a=n[r][t.axis],le(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=aO(Ot(this.options.clip,oO(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,l,u),h=l;h<l+u;++h){const m=r[h];m.hidden||(m.active&&d?a.push(m):m.draw(t,s))}for(h=0;h<a.length;++h)a[h].draw(t,s)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=hO(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=fO(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const r=n==="active",s=this._cachedDataOpts,a=t+"-"+n,l=s[a],u=this.enableOptionSharing&&sn(i);if(l)return Um(l,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),m=r?[`${t}Hover`,"hover",t,""]:[t,""],g=d.getOptionScopes(this.getDataset(),h),y=Object.keys(ae.elements[t]),x=()=>this.getContext(i,r,n),v=d.resolveNamedOptions(g,y,x,m);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(Um(v,u))),v}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const h=this.chart.config,m=h.datasetAnimationScopeKeys(this._type,n),g=h.getOptionScopes(this.getDataset(),m);u=h.createResolver(g,this.getContext(t,i,n))}const d=new _u(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||xu(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){xu(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!xu(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,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 n=this._data,i=this._cachedMeta.data;for(const[l,u,d]of this._syncList)this[l](u,d);this._syncList=[];const r=i.length,s=n.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,n,i=!0){const r=this._cachedMeta,s=r.data,a=t+n;let l;const u=d=>{for(d.length+=n,l=d.length-1;l>=a;l--)d[l]=d[l-n]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,n),i&&this.updateElements(s,t,n,"reset")}updateElements(t,n,i,r){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,n);i._stacked&&io(i,r)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,r]=t;this[n](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function mO(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=im(i.sort((r,s)=>r-s))}return e._cache.$bar}function gO(e){const t=e.iScale,n=mO(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(sn(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=n.length;r<s;++r)a=t.getPixelForValue(n[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function _O(e,t,n,i){const r=n.barThickness;let s,a;return kt(r)?(s=t.min*n.categoryPercentage,a=n.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[e]-s/2}}function yO(e,t,n,i){const r=t.pixels,s=r[e];let a=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const u=n.categoryPercentage;a===null&&(a=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-a);const d=s-(s-Math.min(a,l))/2*u;return{chunk:Math.abs(l-a)/2*u/i,ratio:n.barPercentage,start:d}}function bO(e,t,n,i){const r=n.parse(e[0],i),s=n.parse(e[1],i),a=Math.min(r,s),l=Math.max(r,s);let u=a,d=l;Math.abs(a)>Math.abs(l)&&(u=l,d=a),t[n.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function Hm(e,t,n,i){return jt(e)?bO(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Wm(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),l=r===s,u=[];let d,h,m,g;for(d=n,h=n+i;d<h;++d)g=t[d],m={},m[r.axis]=l||r.parse(a[d],d),u.push(Hm(g,m,s,d));return u}function wu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function xO(e,t,n){return e!==0?jn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function wO(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:t,top:r,bottom:s}}function vO(e,t,n,i){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:h}=wO(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=d:(n._bottom||0)===i?r=h:(s[$m(h,a,l,u)]=!0,r=d)),s[$m(r,a,l,u)]=!0,e.borderSkipped=s}function $m(e,t,n,i){return i?(e=SO(e,t,n),e=Vm(e,n,t)):e=Vm(e,t,n),e}function SO(e,t,n){return e===t?n:e===n?t:e}function Vm(e,t,n){return e==="start"?t:e==="end"?n:e}function TO(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Ym extends Li{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,r){return Wm(t,n,i,r)}parseArrayData(t,n,i,r){return Wm(t,n,i,r)}parseObjectData(t,n,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?l:u,h=a.axis==="x"?l:u,m=[];let g,y,x,v;for(g=i,y=i+r;g<y;++g)v=n[g],x={},x[s.axis]=s.parse(Ci(v,d),g),m.push(Hm(Ci(v,h),x,a,g));return m}updateRangeFromParsed(t,n,i,r){super.updateRangeFromParsed(t,n,i,r);const s=i._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(t),a=s._custom,l=wu(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:m,includeOptions:g}=this._getSharedOptions(n,r);for(let y=n;y<n+i;y++){const x=this.getParsed(y),v=s||kt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(y),S=this._calculateBarIndexPixels(y,h),O=(x._stacks||{})[l.axis],A={horizontal:d,base:v.base,enableBorderRadius:!O||wu(x._custom)||a===O._top||a===O._bottom,x:d?v.head:S.center,y:d?S.center:v.head,height:d?S.size:Math.abs(v.size),width:d?Math.abs(v.size):S.size};g&&(A.options=m||this.resolveDataElementOptions(y,t[y].active?"active":r));const P=A.options||t[y].options;vO(A,P,O,a),TO(A,P,h.ratio),this.updateElement(t[y],y,A,r)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),u=l&&l[i.axis],d=h=>{const m=h._parsed.find(y=>y[i.axis]===u),g=m&&m[h.vScale.axis];if(kt(g)||isNaN(g))return!0};for(const h of r)if(!(n!==void 0&&d(h))&&((s===!1||a.indexOf(h.stack)===-1||s===void 0&&h.stack===void 0)&&a.push(h.stack),h.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,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Ot(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||gO(n),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,h=wu(d);let m=u[n.axis],g=0,y=i?this.applyStack(n,u,i):m,x,v;y!==m&&(g=y-m,y=m),h&&(m=d.barStart,y=d.barEnd-d.barStart,m!==0&&jn(m)!==jn(d.barEnd)&&(g=0),g+=m);const S=!kt(s)&&!h?s:g;let O=n.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=n.getPixelForValue(g+y):x=O,v=x-O,Math.abs(v)<a){v=xO(v,n,l)*a,m===l&&(O-=v/2);const A=n.getPixelForDecimal(0),P=n.getPixelForDecimal(1),L=Math.min(A,P),R=Math.max(A,P);O=Math.max(Math.min(O,R),L),x=O+v,i&&!h&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(O))}if(O===n.getPixelForValue(l)){const A=jn(v)*n.getLineWidthForValue(l)/2;O+=A,v-=A}return{size:v,base:O,head:x,center:x+v/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Ot(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(n.grouped){const h=s?this._getStackCount(t):n.stackCount,m=r.barThickness==="flex"?yO(t,n,r,h*d):_O(t,n,r,h*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,y=this._getAxis().indexOf(Ot(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+y;l=m.start+m.chunk*x+m.chunk/2,u=Math.min(a,m.chunk*m.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,n.min*n.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class kO extends Li{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,r){const s=super.parsePrimitiveData(t,n,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,n,i,r){const s=super.parseArrayData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Ot(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,n,i,r){const s=super.parseObjectData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Ot(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(d?", "+d:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,r),h=a.axis,m=l.axis;for(let g=n;g<n+i;g++){const y=t[g],x=!s&&this.getParsed(g),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),O=v[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);v.skip=isNaN(S)||isNaN(O),d&&(v.options=u||this.resolveDataElementOptions(g,y.active?"active":r),s&&(v.options.radius=0)),this.updateElement(y,g,v,r)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=Ot(i&&i._custom,s),r}}function MO(e,t,n){let i=1,r=1,s=0,a=0;if(t<ne){const l=e,u=l+t,d=Math.cos(l),h=Math.sin(l),m=Math.cos(u),g=Math.sin(u),y=(P,L,R)=>Xs(P,l,u,!0)?1:Math.max(L,L*n,R,R*n),x=(P,L,R)=>Xs(P,l,u,!0)?-1:Math.min(L,L*n,R,R*n),v=y(0,d,m),S=y(oe,h,g),O=x(Pt,d,m),A=x(Pt+oe,h,g);i=(v-O)/2,r=(S-A)/2,s=-(v+O)/2,a=-(S+A)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class ro extends Li{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((u,d)=>{const m=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:m.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:m.borderDash,lineDashOffset:m.borderDashOffset,lineJoin:m.borderJoinStyle,lineWidth:m.borderWidth,strokeStyle:m.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||m.borderRadius),index:d}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Nt(i[t])){const{key:u="value"}=this._parsing;s=d=>+Ci(i[d],u)}let a,l;for(a=t,l=t+n;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return ve(this.options.rotation-90)}_getCircumference(){return ve(this.options.circumference)}_getRotationExtents(){let t=ne,n=-ne;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),n=Math.max(n,s+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(FD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:y,offsetX:x,offsetY:v}=MO(m,h,u),S=(i.width-a)/g,O=(i.height-a)/y,A=Math.max(Math.min(S,O)/2,0),P=Gp(this.options.radius,A),L=Math.max(P*u,0),R=(P-L)/this._getVisibleDatasetWeightTotal();this.offsetX=x*P,this.offsetY=v*P,r.total=this.calculateTotal(),this.outerRadius=P-R*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-R*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/ne)}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,m=(l.top+l.bottom)/2,g=s&&d.animateScale,y=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(n,r);let O=this._getRotation(),A;for(A=0;A<n;++A)O+=this._circumference(A,s);for(A=n;A<n+i;++A){const P=this._circumference(A,s),L=t[A],R={x:h+this.offsetX,y:m+this.offsetY,startAngle:O,endAngle:O+P,circumference:P,outerRadius:x,innerRadius:y};S&&(R.options=v||this.resolveDataElementOptions(A,L.active?"active":r)),O+=P,this.updateElement(L,A,R,r)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,r;for(r=0;r<n.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ne*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Qs(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=l.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(n=Math.max(n,u.borderWidth||0,u.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Ot(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class qm extends Li{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:l,count:u}=om(n,r,a);this._drawStart=l,this._drawCount=u,am(n)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(r,l,u,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:m}=this._getSharedOptions(n,r),g=a.axis,y=l.axis,{spanGaps:x,segment:v}=this.options,S=Ai(x)?x:Number.POSITIVE_INFINITY,O=this.chart._animationsDisabled||s||r==="none",A=n+i,P=t.length;let L=n>0&&this.getParsed(n-1);for(let R=0;R<P;++R){const F=t[R],U=O?F:{};if(R<n||R>=A){U.skip=!0;continue}const D=this.getParsed(R),w=kt(D[y]),C=U[g]=a.getPixelForValue(D[g],R),N=U[y]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,D,u):D[y],R);U.skip=isNaN(C)||isNaN(N)||w,U.stop=R>0&&Math.abs(D[g]-L[g])>S,v&&(U.parsed=D,U.raw=d.data[R]),m&&(U.options=h||this.resolveDataElementOptions(R,F.active?"active":r)),O||this.updateElement(F,R,U,r),L=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class jm extends Li{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Qs(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return wm.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,m=d.yCenter,g=d.getIndexAngle(0)-.5*Pt;let y=g,x;const v=360/this.countVisibleElements();for(x=0;x<n;++x)y+=this._computeAngle(x,r,v);for(x=n;x<n+i;x++){const S=t[x];let O=y,A=y+this._computeAngle(x,r,v),P=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;y=A,s&&(u.animateScale&&(P=0),u.animateRotate&&(O=A=g));const L={x:h,y:m,innerRadius:0,outerRadius:P,startAngle:O,endAngle:A,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,L,r)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?ve(this.resolveDataElementOptions(t,n).angle||i):0}}class DO extends ro{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class CO extends Li{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return wm.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=n;l<n+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),h=s.getPointPositionForValue(l,this.getParsed(l).r),m=a?s.xCenter:h.x,g=a?s.yCenter:h.y,y={x:m,y:g,angle:h.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,y,r)}}}class Gm extends Li{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:a}=om(n,i,r);if(this._drawStart=s,this._drawCount=a,am(n)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!u._decimated,l.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:d},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(n,r),m=this.getSharedOptions(h),g=this.includeOptions(r,m),y=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,O=Ai(v)?v:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let P=n>0&&this.getParsed(n-1);for(let L=n;L<n+i;++L){const R=t[L],F=this.getParsed(L),U=A?R:{},D=kt(F[x]),w=U[y]=a.getPixelForValue(F[y],L),C=U[x]=s||D?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,F,u):F[x],L);U.skip=isNaN(w)||isNaN(C)||D,U.stop=L>0&&Math.abs(F[y]-P[y])>O,S&&(U.parsed=F,U.raw=d.data[L]),g&&(U.options=m||this.resolveDataElementOptions(L,R.active?"active":r)),A||this.updateElement(R,L,U,r),P=F}this.updateSharedOptions(m,r,h)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let u=n.length-1;u>=0;--u)l=Math.max(l,n[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}var OO=Object.freeze({__proto__:null,BarController:Ym,BubbleController:kO,DoughnutController:ro,LineController:qm,PieController:DO,PolarAreaController:jm,RadarController:CO,ScatterController:Gm});function hr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vu{static override(t){Object.assign(vu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return hr()}parse(){return hr()}format(){return hr()}add(){return hr()}diff(){return hr()}startOf(){return hr()}endOf(){return hr()}}var Km={_date:vu};function AO(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,l=r._cachedMeta.iScale,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?XD:oi;if(i){if(r._sharedOptions){const h=s[0],m=typeof h.getRange=="function"&&h.getRange(t);if(m){const g=d(s,t,n-m),y=d(s,t,n+m);return{lo:g.lo,hi:y.hi}}}}else{const h=d(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=e,y=g.slice(0,h.lo+1).reverse().findIndex(v=>!kt(v[m.axis]));h.lo-=Math.max(0,y);const x=g.slice(h.hi).findIndex(v=>!kt(v[m.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function so(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:h}=s[l],{lo:m,hi:g}=AO(s[l],t,a,r);for(let y=m;y<=g;++y){const x=h[y];x.skip||i(x,d,y)}}}function EO(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function Su(e,t,n,i,r){const s=[];return!r&&!e.isPointInArea(t)||so(e,n,t,function(l,u,d){!r&&!ai(l,e.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function RO(e,t,n,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:m}=Ca(a,{x:t.x,y:t.y});Xs(m,d,h)&&r.push({element:a,datasetIndex:l,index:u})}return so(e,n,t,s),r}function PO(e,t,n,i,r,s){let a=[];const l=EO(n);let u=Number.POSITIVE_INFINITY;function d(h,m,g){const y=h.inRange(t.x,t.y,r);if(i&&!y)return;const x=h.getCenterPoint(r);if(!(!!s||e.isPointInArea(x))&&!y)return;const S=l(t,x);S<u?(a=[{element:h,datasetIndex:m,index:g}],u=S):S===u&&a.push({element:h,datasetIndex:m,index:g})}return so(e,n,t,d),a}function Tu(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?RO(e,t,n,r):PO(e,t,n,i,r,s)}function Xm(e,t,n,i,r){const s=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return so(e,n,t,(u,d,h)=>{u[a]&&u[a](t[n],r)&&(s.push({element:u,datasetIndex:d,index:h}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var ku={evaluateInteractionItems:so,modes:{index(e,t,n,i){const r=Pi(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Su(e,r,s,i,a):Tu(e,r,s,!1,i,a),u=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,m=d.data[h];m&&!m.skip&&u.push({element:m,datasetIndex:d.index,index:h})}),u):[]},dataset(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?Su(e,r,s,i,a):Tu(e,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=e.getDatasetMeta(u).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:u,index:h})}return l},point(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Su(e,r,s,i,a)},nearest(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Tu(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=Pi(t,e);return Xm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=Pi(t,e);return Xm(e,r,"y",n.intersect,i)}}};const Zm=["left","top","right","bottom"];function oo(e,t){return e.filter(n=>n.pos===t)}function Qm(e,t){return e.filter(n=>Zm.indexOf(n.pos)===-1&&n.box.axis===t)}function ao(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function IO(e){const t=[];let n,i,r,s,a,l;for(n=0,i=(e||[]).length;n<i;++n)r=e[n],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function LO(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!Zm.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function NO(e,t){const n=LO(e),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=e.length;s<a;++s){l=e[s];const{fullSize:u}=l.box,d=n[l.stack],h=d&&l.stackWeight/d.weight;l.horizontal?(l.width=h?h*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=h?h*r:u&&t.availableHeight)}return n}function BO(e){const t=IO(e),n=ao(t.filter(d=>d.box.fullSize),!0),i=ao(oo(t,"left"),!0),r=ao(oo(t,"right")),s=ao(oo(t,"top"),!0),a=ao(oo(t,"bottom")),l=Qm(t,"x"),u=Qm(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:oo(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Jm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function tg(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function FO(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Nt(r)){n.size&&(e[r]-=n.size);const m=i[n.stack]||{size:0,count:1};m.size=Math.max(m.size,n.horizontal?s.height:s.width),n.size=m.size/m.count,e[r]+=n.size}s.getPadding&&tg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Jm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Jm(a,e,"top","bottom")),d=l!==e.w,h=u!==e.h;return e.w=l,e.h=u,n.horizontal?{same:d,other:h}:{same:h,other:d}}function zO(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function UO(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function lo(e,t,n,i){const r=[];let s,a,l,u,d,h;for(s=0,a=e.length,d=0;s<a;++s){l=e[s],u=l.box,u.update(l.width||t.w,l.height||t.h,UO(l.horizontal,t));const{same:m,other:g}=FO(t,n,l,i);d|=m&&r.length,h=h||g,u.fullSize||r.push(l)}return d&&lo(r,t,n,i)||h}function Ba(e,t,n,i,r){e.top=n,e.left=t,e.right=t+i,e.bottom=n+r,e.width=i,e.height=r}function eg(e,t,n,i){const r=n.padding;let{x:s,y:a}=t;for(const l of e){const u=l.box,d=i[l.stack]||{placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const m=t.w*h,g=d.size||u.height;sn(d.start)&&(a=d.start),u.fullSize?Ba(u,r.left,a,n.outerWidth-r.right-r.left,g):Ba(u,t.left+d.placed,a,m,g),d.start=a,d.placed+=m,a=u.bottom}else{const m=t.h*h,g=d.size||u.width;sn(d.start)&&(s=d.start),u.fullSize?Ba(u,s,r.top,g,n.outerHeight-r.bottom-r.top):Ba(u,s,t.top+d.placed,g,m),d.start=s,d.placed+=m,s=u.right}}t.x=s,t.y=a}var Ve={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const r=Se(e.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(n-r.height,0),l=BO(e.boxes),u=l.vertical,d=l.horizontal;te(e.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const h=u.reduce((v,S)=>S.box.options&&S.box.options.display===!1?v:v+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),g=Object.assign({},r);tg(g,Se(i));const y=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=NO(u.concat(d),m);lo(l.fullSize,y,m,x),lo(u,y,m,x),lo(d,y,m,x)&&lo(u,y,m,x),zO(y),eg(l.leftAndTop,y,m,x),y.x+=y.w,y.y+=y.h,eg(l.rightAndBottom,y,m,x),e.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},te(l.chartArea,v=>{const S=v.box;Object.assign(S,e.chartArea),S.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class ng{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class HO extends ng{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fa="$chartjs",WO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ig=e=>e===null||e==="";function $O(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Fa]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ig(r)){const s=Tm(e,"width");s!==void 0&&(e.width=s)}if(ig(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Tm(e,"height");s!==void 0&&(e.height=s)}return e}const rg=$C?{passive:!0}:!1;function VO(e,t,n){e&&e.addEventListener(t,n,rg)}function YO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,rg)}function qO(e,t){const n=WO[e.type]||e.type,{x:i,y:r}=Pi(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function za(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function jO(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||za(l.addedNodes,i),a=a&&!za(l.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function GO(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||za(l.removedNodes,i),a=a&&!za(l.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const co=new Map;let sg=0;function og(){const e=window.devicePixelRatio;e!==sg&&(sg=e,co.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function KO(e,t){co.size||window.addEventListener("resize",og),co.set(e,t)}function XO(e){co.delete(e),co.size||window.removeEventListener("resize",og)}function ZO(e,t,n){const i=e.canvas,r=i&&gu(i);if(!r)return;const s=sm((l,u)=>{const d=r.clientWidth;n(l,u),d<r.clientWidth&&n()},window),a=new ResizeObserver(l=>{const u=l[0],d=u.contentRect.width,h=u.contentRect.height;d===0&&h===0||s(d,h)});return a.observe(r),KO(e,s),a}function Mu(e,t,n){n&&n.disconnect(),t==="resize"&&XO(e)}function QO(e,t,n){const i=e.canvas,r=sm(s=>{e.ctx!==null&&n(qO(s,e))},e);return VO(i,t,r),r}class JO extends ng{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?($O(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Fa])return!1;const i=n[Fa].initial;["height","width"].forEach(s=>{const a=i[s];kt(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Fa],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:jO,detach:GO,resize:ZO}[n]||QO;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:Mu,detach:Mu,resize:Mu}[n]||YO)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return WC(t,n,i,r)}isAttached(t){const n=t&&gu(t);return!!(n&&n.isConnected)}}function tA(e){return!mu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?HO:JO}class Ye{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Ai(this.x)&&Ai(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function eA(e,t){const n=e.options.ticks,i=nA(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?rA(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return sA(t,d,s,a/r),d;const h=iA(s,t,r);if(a>0){let m,g;const y=a>1?Math.round((u-l)/(a-1)):null;for(Ua(t,d,h,kt(y)?0:l-y,l),m=0,g=a-1;m<g;m++)Ua(t,d,h,s[m],s[m+1]);return Ua(t,d,h,u,kt(y)?t.length:u+y),d}return Ua(t,d,h),d}function nA(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(i,r))}function iA(e,t,n){const i=oA(e),r=t.length/n;if(!i)return Math.max(r,1);const s=YD(i);for(let a=0,l=s.length-1;a<l;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function rA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function sA(e,t,n,i){let r=0,s=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),r++,s=n[r*i])}function Ua(e,t,n,i,r){const s=Ot(i,0),a=Math.min(Ot(r,e.length),e.length);let l=0,u,d,h;for(n=Math.ceil(n),r&&(u=r-i,n=u/Math.floor(u/n)),h=s;h<0;)l++,h=Math.round(s+l*n);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(e[d]),l++,h=Math.round(s+l*n))}function oA(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const aA=e=>e==="left"?"right":e==="right"?"left":e,ag=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,lg=(e,t)=>Math.min(t||e,e);function cg(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;s<r;s+=i)n.push(e[Math.floor(s)]);return n}function lA(e,t,n){const i=e.ticks.length,r=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,l=1e-6;let u=e.getPixelForTick(r),d;if(!(n&&(i===1?d=Math.max(u-s,a-u):t===0?d=(e.getPixelForTick(1)-u)/2:d=(u-e.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function cA(e,t){te(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function uo(e){return e.drawTicks?e.tickLength:0}function ug(e,t){if(!e.display)return 0;const n=ce(e.font,t),i=Se(e.padding);return(jt(e.text)?e.text.length:1)*n.lineHeight+i.height}function uA(e,t){return Ri(e,{scale:t,type:"scale"})}function dA(e,t,n){return Ri(e,{tick:n,index:t,type:"tick"})}function fA(e,t,n){let i=su(e);return(n&&t!=="right"||!n&&t==="right")&&(i=aA(i)),i}function hA(e,t,n,i){const{top:r,left:s,bottom:a,right:l,chart:u}=e,{chartArea:d,scales:h}=u;let m=0,g,y,x;const v=a-r,S=l-s;if(e.isHorizontal()){if(y=$e(i,s,l),Nt(n)){const O=Object.keys(n)[0],A=n[O];x=h[O].getPixelForValue(A)+v-t}else n==="center"?x=(d.bottom+d.top)/2+v-t:x=ag(e,n,t);g=l-s}else{if(Nt(n)){const O=Object.keys(n)[0],A=n[O];y=h[O].getPixelForValue(A)-S+t}else n==="center"?y=(d.left+d.right)/2-S+t:y=ag(e,n,t);x=$e(i,a,r),m=n==="left"?-oe:oe}return{titleX:y,titleY:x,maxWidth:g,rotation:m}}class pr extends Ye{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:r}=this;return t=mn(t,Number.POSITIVE_INFINITY),n=mn(n,Number.NEGATIVE_INFINITY),i=mn(i,Number.POSITIVE_INFINITY),r=mn(r,Number.NEGATIVE_INFINITY),{min:mn(t,i),max:mn(n,r),minDefined:le(t),maxDefined:le(n)}}getMinMax(t){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),s||(i=Math.max(i,a.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,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(){Jt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,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=xC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?cg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=eA(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Jt(this.options.afterUpdate,[this])}beforeSetDimensions(){Jt(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(){Jt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Jt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Jt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Jt(n.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=lg(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),m=h.widest.width,g=h.highest.height,y=Re(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:y/(i-1),m+6>l&&(l=y/(i-(t.offset?.5:1)),u=this.maxHeight-uo(t.grid)-n.padding-ug(t.title,this.chart.options.font),d=Math.sqrt(m*m+g*g),a=Da(Math.min(Math.asin(Re((h.highest.height+6)/l,-1,1)),Math.asin(Re(u/d,-1,1))-Math.asin(Re(g/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Jt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=ug(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=uo(s)+u):(t.height=this.maxHeight,t.width=uo(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:m,highest:g}=this._getLabelSizes(),y=i.padding*2,x=ve(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const O=i.mirror?0:S*m.width+v*g.height;t.height=Math.min(this.maxHeight,t.height+O+y)}else{const O=i.mirror?0:v*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+O+y)}this._calculatePadding(d,h,S,v)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,y=0;u?d?(g=r*t.width,y=i*n.height):(g=i*t.height,y=r*n.width):s==="start"?y=n.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,y=n.width/2),this.paddingLeft=Math.max((g-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((y-m+a)*this.width/(this.width-m),0)}else{let h=n.height/2,m=t.height/2;s==="start"?(h=0,m=t.height):s==="end"&&(h=n.height,m=0),this.paddingTop=h+a,this.paddingBottom=m+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(){Jt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)kt(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=cg(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(n/lg(n,i));let d=0,h=0,m,g,y,x,v,S,O,A,P,L,R;for(m=0;m<n;m+=u){if(x=t[m].label,v=this._resolveTickFontOptions(m),r.font=S=v.string,O=s[S]=s[S]||{data:{},gc:[]},A=v.lineHeight,P=L=0,!kt(x)&&!jt(x))P=Ra(r,O.data,O.gc,P,x),L=A;else if(jt(x))for(g=0,y=x.length;g<y;++g)R=x[g],!kt(R)&&!jt(R)&&(P=Ra(r,O.data,O.gc,P,R),L+=A);a.push(P),l.push(L),d=Math.max(P,d),h=Math.max(L,h)}cA(s,n);const F=a.indexOf(d),U=l.indexOf(h),D=w=>({width:a[w]||0,height:l[w]||0});return{first:D(0),last:D(n-1),widest:D(F),highest:D(U),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return KD(this._alignToPixels?cr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=dA(this.getContext(),t,i))}return this.$context||(this.$context=uA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=ve(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,l=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>l*r?l/i:u/r:u*r<l*i?u/i:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),m=this.ticks.length+(u?1:0),g=uo(s),y=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,O=function(ut){return cr(i,ut,v)};let A,P,L,R,F,U,D,w,C,N,$,V;if(a==="top")A=O(this.bottom),U=this.bottom-g,w=A-S,N=O(t.top)+S,V=t.bottom;else if(a==="bottom")A=O(this.top),N=t.top,V=O(t.bottom)-S,U=A+S,w=this.top+g;else if(a==="left")A=O(this.right),F=this.right-g,D=A-S,C=O(t.left)+S,$=t.right;else if(a==="right")A=O(this.left),C=t.left,$=O(t.right)-S,F=A+S,D=this.left+g;else if(n==="x"){if(a==="center")A=O((t.top+t.bottom)/2+.5);else if(Nt(a)){const ut=Object.keys(a)[0],ct=a[ut];A=O(this.chart.scales[ut].getPixelForValue(ct))}N=t.top,V=t.bottom,U=A+S,w=U+g}else if(n==="y"){if(a==="center")A=O((t.left+t.right)/2);else if(Nt(a)){const ut=Object.keys(a)[0],ct=a[ut];A=O(this.chart.scales[ut].getPixelForValue(ct))}F=A-S,D=F-g,C=t.left,$=t.right}const st=Ot(r.ticks.maxTicksLimit,m),dt=Math.max(1,Math.ceil(m/st));for(P=0;P<m;P+=dt){const ut=this.getContext(P),ct=s.setContext(ut),Tt=l.setContext(ut),at=ct.lineWidth,pt=ct.color,G=Tt.dash||[],B=Tt.dashOffset,z=ct.tickWidth,Z=ct.tickColor,it=ct.tickBorderDash||[],ht=ct.tickBorderDashOffset;L=lA(this,P,u),L!==void 0&&(R=cr(i,L,at),d?F=D=C=$=R:U=w=N=V=R,y.push({tx1:F,ty1:U,tx2:D,ty2:w,x1:C,y1:N,x2:$,y2:V,width:at,color:pt,borderDash:G,borderDashOffset:B,tickWidth:z,tickColor:Z,tickBorderDash:it,tickBorderDashOffset:ht}))}return this._ticksLength=m,this._borderValue=A,y}_computeLabelItems(t){const n=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:h,mirror:m}=s,g=uo(i.grid),y=g+h,x=m?-h:y,v=-ve(this.labelRotation),S=[];let O,A,P,L,R,F,U,D,w,C,N,$,V="middle";if(r==="top")F=this.bottom-x,U=this._getXAxisLabelAlignment();else if(r==="bottom")F=this.top+x,U=this._getXAxisLabelAlignment();else if(r==="left"){const dt=this._getYAxisLabelAlignment(g);U=dt.textAlign,R=dt.x}else if(r==="right"){const dt=this._getYAxisLabelAlignment(g);U=dt.textAlign,R=dt.x}else if(n==="x"){if(r==="center")F=(t.top+t.bottom)/2+y;else if(Nt(r)){const dt=Object.keys(r)[0],ut=r[dt];F=this.chart.scales[dt].getPixelForValue(ut)+y}U=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")R=(t.left+t.right)/2-y;else if(Nt(r)){const dt=Object.keys(r)[0],ut=r[dt];R=this.chart.scales[dt].getPixelForValue(ut)}U=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(u==="start"?V="top":u==="end"&&(V="bottom"));const st=this._getLabelSizes();for(O=0,A=l.length;O<A;++O){P=l[O],L=P.label;const dt=s.setContext(this.getContext(O));D=this.getPixelForTick(O)+s.labelOffset,w=this._resolveTickFontOptions(O),C=w.lineHeight,N=jt(L)?L.length:1;const ut=N/2,ct=dt.color,Tt=dt.textStrokeColor,at=dt.textStrokeWidth;let pt=U;a?(R=D,U==="inner"&&(O===A-1?pt=this.options.reverse?"left":"right":O===0?pt=this.options.reverse?"right":"left":pt="center"),r==="top"?d==="near"||v!==0?$=-N*C+C/2:d==="center"?$=-st.highest.height/2-ut*C+C:$=-st.highest.height+C/2:d==="near"||v!==0?$=C/2:d==="center"?$=st.highest.height/2-ut*C:$=st.highest.height-N*C,m&&($*=-1),v!==0&&!dt.showLabelBackdrop&&(R+=C/2*Math.sin(v))):(F=D,$=(1-N)*C/2);let G;if(dt.showLabelBackdrop){const B=Se(dt.backdropPadding),z=st.heights[O],Z=st.widths[O];let it=$-B.top,ht=0-B.left;switch(V){case"middle":it-=z/2;break;case"bottom":it-=z;break}switch(U){case"center":ht-=Z/2;break;case"right":ht-=Z;break;case"inner":O===A-1?ht-=Z:O>0&&(ht-=Z/2);break}G={left:ht,top:it,width:Z+B.width,height:z+B.height,color:dt.backdropColor}}S.push({label:L,font:w,textOffset:$,options:{rotation:v,color:ct,strokeColor:Tt,strokeWidth:at,textAlign:pt,textBaseline:V,translation:[R,F],backdrop:G}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-ve(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,h;return n==="left"?r?(h=this.right+s,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h+=u)):(h=this.right-l,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h=this.left)):n==="right"?r?(h=this.left+s,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h-=u)):(h=this.left+l,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(n.display)for(s=0,a=r.length;s<a;++s){const u=r[s];n.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),n.drawTicks&&l({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const l=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let d,h,m,g;this.isHorizontal()?(d=cr(t,this.left,a)-a/2,h=cr(t,this.right,l)+l/2,m=g=u):(m=cr(t,this.top,a)-a/2,g=cr(t,this.bottom,l)+l/2,d=h=u),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,m),n.lineTo(h,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&to(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,h=a.textOffset;ur(i,d,0,h,u,l)}r&&eo(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=ce(i.font),a=Se(i.padding),l=i.align;let u=s.lineHeight/2;n==="bottom"||n==="center"||Nt(n)?(u+=a.bottom,jt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:m,rotation:g}=hA(this,u,n,l);ur(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:fA(l,n,r),textBaseline:"middle",translation:[d,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=Ot(t.grid&&t.grid.z,-1),r=Ot(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==pr.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s<a;++s){const l=n[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ce(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ha{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;gA(n)&&(i=this.register(n));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,pA(t,a,i),this.override&&ae.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,r=this.scope;i in n&&delete n[i],r&&i in ae[r]&&(delete ae[r][i],this.override&&delete lr[i])}}function pA(e,t,n){const i=js(Object.create(null),[n?ae.get(n):{},ae.get(t),e.defaults]);ae.set(t,i),e.defaultRoutes&&mA(t,e.defaultRoutes),e.descriptors&&ae.describe(t,e.descriptors)}function mA(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),l=a.pop(),u=a.join(".");ae.route(s,r,u,l)})}function gA(e){return"id"in e&&"defaults"in e}class _A{constructor(){this.controllers=new Ha(Li,"datasets",!0),this.elements=new Ha(Ye,"elements"),this.plugins=new Ha(Object,"plugins"),this.scales=new Ha(pr,"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,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):te(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,n,i){const r=nu(t);Jt(i["before"+r],[],i),n[t](i),Jt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Gn=new _A;class yA{constructor(){this._init=void 0}notify(t,n,i,r){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,n,i);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,n,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[n,r,s.options];if(Jt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){kt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,r=Ot(i.options&&i.options.plugins,{}),s=bA(i);return r===!1&&!n?[]:wA(t,s,r,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function bA(e){const t={},n=[],i=Object.keys(Gn.plugins.items);for(let s=0;s<i.length;s++)n.push(Gn.getPlugin(i[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function xA(e,t){return!t&&e===!1?null:e===!0?{}:e}function wA(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,d=xA(i[u],r);d!==null&&s.push({plugin:l,options:vA(e.config,{plugin:l,local:n[u]},d,a)})}return s}function vA(e,{plugin:t,local:n},i,r){const s=e.pluginScopeKeys(t),a=e.getOptionScopes(i,s);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Du(e,t){const n=ae.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function SA(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function TA(e,t){return e===t?"_index_":"_value_"}function dg(e){if(e==="x"||e==="y"||e==="r")return e}function kA(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Cu(e,...t){if(dg(e))return e;for(const n of t){const i=n.axis||kA(n.position)||e.length>1&&dg(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fg(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function MA(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return fg(e,"x",n[0])||fg(e,"y",n[0])}return{}}function DA(e,t){const n=lr[e.type]||{scales:{}},i=t.scales||{},r=Du(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Nt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=Cu(a,l,MA(a,e),ae.scales[l.type]),d=TA(u,r),h=n.scales||{};s[a]=Gs(Object.create(null),[{axis:u},l,h[u],h[d]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,u=a.indexAxis||Du(l,t),h=(lr[l]||{}).scales||{};Object.keys(h).forEach(m=>{const g=SA(m,u),y=a[g+"AxisID"]||g;s[y]=s[y]||Object.create(null),Gs(s[y],[{axis:g},i[y],h[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];Gs(l,[ae.scales[l.type],ae.scale])}),s}function hg(e){const t=e.options||(e.options={});t.plugins=Ot(t.plugins,{}),t.scales=DA(e,t)}function pg(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function CA(e){return e=e||{},e.data=pg(e.data),hg(e),e}const mg=new Map,gg=new Set;function Wa(e,t){let n=mg.get(e);return n||(n=t(),mg.set(e,n),gg.add(n)),n}const fo=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class OA{constructor(t){this._config=CA(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=pg(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(),hg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Wa(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Wa(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Wa(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Wa(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(n);if(l)return l;const u=new Set;n.forEach(h=>{t&&(u.add(t),h.forEach(m=>fo(u,t,m))),h.forEach(m=>fo(u,r,m)),h.forEach(m=>fo(u,lr[s]||{},m)),h.forEach(m=>fo(u,ae,m)),h.forEach(m=>fo(u,lu,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),gg.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,lr[n]||{},ae.datasets[n]||{},{type:n},ae,lu]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=_g(this._resolverCache,t,r);let u=a;if(EA(a,n)){s.$shared=!1,i=on(i)?i():i;const d=this.createResolver(t,i,l);u=jr(a,i,d)}for(const d of n)s[d]=u[d];return s}createResolver(t,n,i=[""],r){const{resolver:s}=_g(this._resolverCache,t,i);return Nt(n)?jr(s,n,void 0,r):s}}function _g(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:fu(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const AA=e=>Nt(e)&&Object.getOwnPropertyNames(e).some(t=>on(e[t]));function EA(e,t){const{isScriptable:n,isIndexable:i}=mm(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(on(l)||AA(l))||a&&jt(l))return!0}return!1}var RA="4.5.1";const PA=["top","bottom","left","right","chartArea"];function yg(e,t){return e==="top"||e==="bottom"||PA.indexOf(e)===-1&&t==="x"}function bg(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function xg(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Jt(n&&n.onComplete,[e],t)}function IA(e){const t=e.chart,n=t.options.animation;Jt(n&&n.onProgress,[e],t)}function wg(e){return mu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $a={},vg=e=>{const t=wg(e);return Object.values($a).filter(n=>n.canvas===t).pop()};function LA(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function NA(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let an=class{static defaults=ae;static instances=$a;static overrides=lr;static registry=Gn;static version=RA;static getChart=vg;static register(...t){Gn.add(...t),Sg()}static unregister(...t){Gn.remove(...t),Sg()}constructor(t,n){const i=this.config=new OA(n),r=wg(t),s=vg(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tA(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,h=u&&u.width;if(this.id=BD(),this.ctx=l,this.canvas=u,this.width=h,this.height=d,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 yA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JD(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],$a[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",xg),li.listen(this,"progress",IA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return kt(t)?n&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Gn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Sm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fm(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(t,n){li.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Sm(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Jt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};te(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const l=n[a],u=Cu(a,l),d=u==="r",h=u==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),te(s,a=>{const l=a.options,u=l.id,d=Cu(u,l),h=Ot(l.type,a.dtype);(l.position===void 0||yg(l.position,d)!==yg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===h)m=i[u];else{const g=Gn.getScale(h);m=new g({id:u,type:h,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(l,t)}),te(r,(a,l)=>{a||delete i[l]}),te(i,a=>{Ve.configure(this,a,a.options),Ve.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(bg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[i];let a=this.getDatasetMeta(i);const l=s.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=s.indexAxis||Du(l,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=Gn.getController(l),{datasetElementType:d,dataElementType:h}=ae.datasets[l];Object.assign(u,{dataElementType:Gn.getElement(h),datasetElementType:d&&Gn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){te(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,h=this.data.datasets.length;d<h;d++){const{controller:m}=this.getDatasetMeta(d),g=!r&&s.indexOf(m)===-1;m.buildOrUpdateElements(g),a=Math.max(+m.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||te(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(bg("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){te(this.scales,t=>{Ve.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Zp(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;LA(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<n;s++)if(!Zp(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ve.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],te(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,on(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),xg({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const a=n[r];(!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 n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=Pm(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&to(n,r),t.controller.draw(),r&&eo(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ai(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=ku.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Ri(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);sn(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),li.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),fm(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete $a[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,n=this.platform,i=(s,a)=>{n.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};te(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(u,d)=>{n.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(n.removeEventListener(this,u,d),delete t[u])},s=(u,d)=>{this.canvas&&this.resize(u,d)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){te(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},te(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,l,u;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l<u;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!Sa(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(u,d)=>u.filter(h=>!d.some(m=>h.datasetIndex===m.datasetIndex&&h.index===m.index)),a=s(n,t),l=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,l=this._getActiveElements(t,r,i,a),u=$D(t),d=NA(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Jt(s.onHover,[t,l,this],this),u&&Jt(s.onClick,[t,l,this],this));const h=!Sa(l,r);return(h||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=d,h}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function Sg(){return te(an.instances,e=>e._plugins.invalidate())}function BA(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,m=Math.min(d/a,We(i-n));if(e.beginPath(),e.arc(r,s,a-d/2,i+m/2,n-m/2),l>0){const g=Math.min(d/l,We(i-n));e.arc(r,s,l+d/2,n-g/2,i+g/2,!0)}else{const g=Math.min(d/2,a*We(i-n));if(h==="round")e.arc(r,s,g,n-Pt/2,i+Pt/2,!0);else if(h==="bevel"){const y=2*g*g,x=-y*Math.cos(n+Pt/2)+r,v=-y*Math.sin(n+Pt/2)+s,S=y*Math.cos(i+Pt/2)+r,O=y*Math.sin(i+Pt/2)+s;e.lineTo(x,v),e.lineTo(S,O)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function FA(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;e.beginPath(),e.arc(s,a,l,i-d,n+d),u>r?(d=r/u,e.arc(s,a,u,n+d,i-d,!0)):e.arc(s,a,r,n+oe,i-oe),e.closePath(),e.clip()}function zA(e){return du(e,["outerStart","outerEnd","innerStart","innerEnd"])}function UA(e,t,n,i){const r=zA(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(n-Math.min(s,u))*i/2;return Re(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Re(r.innerStart,0,a),innerEnd:Re(r.innerEnd,0,a)}}function Xr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Va(e,t,n,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:h}=t,m=Math.max(t.outerRadius+i+n-d,0),g=h>0?h+i+n+d:0;let y=0;const x=r-u;if(i){const dt=h>0?h-i:0,ut=m>0?m-i:0,ct=(dt+ut)/2,Tt=ct!==0?x*ct/(ct+i):x;y=(x-Tt)/2}const v=Math.max(.001,x*m-n/Pt)/m,S=(x-v)/2,O=u+S+y,A=r-S-y,{outerStart:P,outerEnd:L,innerStart:R,innerEnd:F}=UA(t,g,m,A-O),U=m-P,D=m-L,w=O+P/U,C=A-L/D,N=g+R,$=g+F,V=O+R/N,st=A-F/$;if(e.beginPath(),s){const dt=(w+C)/2;if(e.arc(a,l,m,w,dt),e.arc(a,l,m,dt,C),L>0){const at=Xr(D,C,a,l);e.arc(at.x,at.y,L,C,A+oe)}const ut=Xr($,A,a,l);if(e.lineTo(ut.x,ut.y),F>0){const at=Xr($,st,a,l);e.arc(at.x,at.y,F,A+oe,st+Math.PI)}const ct=(A-F/g+(O+R/g))/2;if(e.arc(a,l,g,A-F/g,ct,!0),e.arc(a,l,g,ct,O+R/g,!0),R>0){const at=Xr(N,V,a,l);e.arc(at.x,at.y,R,V+Math.PI,O-oe)}const Tt=Xr(U,O,a,l);if(e.lineTo(Tt.x,Tt.y),P>0){const at=Xr(U,w,a,l);e.arc(at.x,at.y,P,O-oe,w)}}else{e.moveTo(a,l);const dt=Math.cos(w)*m+a,ut=Math.sin(w)*m+l;e.lineTo(dt,ut);const ct=Math.cos(C)*m+a,Tt=Math.sin(C)*m+l;e.lineTo(ct,Tt)}e.closePath()}function HA(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Va(e,t,n,i,u,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(u=a+(l%ne||ne))}return Va(e,t,n,i,u,r),e.fill(),u}function WA(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:m,borderDashOffset:g,borderRadius:y}=u,x=u.borderAlign==="inner";if(!d)return;e.setLineDash(m||[]),e.lineDashOffset=g,x?(e.lineWidth=d*2,e.lineJoin=h||"round"):(e.lineWidth=d,e.lineJoin=h||"bevel");let v=t.endAngle;if(s){Va(e,t,n,i,v,r);for(let S=0;S<s;++S)e.stroke();isNaN(l)||(v=a+(l%ne||ne))}x&&FA(e,t,v),u.selfJoin&&v-a>=Pt&&y===0&&h!=="miter"&&BA(e,t,v),s||(Va(e,t,n,i,v,r),e.stroke())}class $A extends Ye{static id="arc";static 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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,n,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=Ca(r,{x:t,y:n}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),g=(this.options.spacing+this.options.borderWidth)/2,y=Ot(m,u-l),x=Xs(s,l,u)&&l!==u,v=y>=ne||x,S=si(a,d+g,h+g);return v&&S}getCenterPoint(t){const{x:n,y:i,startAngle:r,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:d}=this.options,h=(r+s)/2,m=(a+l+d+u)/2;return{x:n+Math.cos(h)*m,y:i+Math.sin(h)*m}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,r=(n.offset||0)/4,s=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>ne?Math.floor(i/ne):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*r,Math.sin(l)*r);const u=1-Math.sin(Math.min(Pt,i||0)),d=r*u;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,HA(t,this,d,s,a),WA(t,this,d,s,a),t.restore()}}function Tg(e,t,n=t){e.lineCap=Ot(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ot(n.borderDash,t.borderDash)),e.lineDashOffset=Ot(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ot(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ot(n.borderWidth,t.borderWidth),e.strokeStyle=Ot(n.borderColor,t.borderColor)}function VA(e,t,n){e.lineTo(n.x,n.y)}function YA(e){return e.stepped?dC:e.tension||e.cubicInterpolationMode==="monotone"?fC:VA}function kg(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:a,end:l}=t,u=Math.max(r,a),d=Math.min(s,l),h=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!h?i+d-u:d-u}}function qA(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=kg(r,n,i),h=YA(s);let{move:m=!0,reverse:g}=i||{},y,x,v;for(y=0;y<=d;++y)x=r[(l+(g?d-y:y))%a],!x.skip&&(m?(e.moveTo(x.x,x.y),m=!1):h(e,v,x,g,s.stepped),v=x);return u&&(x=r[(l+(g?d:0))%a],h(e,v,x,g,s.stepped)),!!u}function jA(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=kg(r,n,i),{move:u=!0,reverse:d}=i||{};let h=0,m=0,g,y,x,v,S,O;const A=L=>(a+(d?l-L:L))%s,P=()=>{v!==S&&(e.lineTo(h,S),e.lineTo(h,v),e.lineTo(h,O))};for(u&&(y=r[A(0)],e.moveTo(y.x,y.y)),g=0;g<=l;++g){if(y=r[A(g)],y.skip)continue;const L=y.x,R=y.y,F=L|0;F===x?(R<v?v=R:R>S&&(S=R),h=(m*h+L)/++m):(P(),e.lineTo(L,R),x=F,m=0,v=S=R),O=R}P()}function Ou(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?jA:qA}function GA(e){return e.stepped?VC:e.tension||e.cubicInterpolationMode==="monotone"?YC:fr}function KA(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),Tg(e,t.options),e.stroke(r)}function XA(e,t,n,i){const{segments:r,options:s}=t,a=Ou(t);for(const l of r)Tg(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const ZA=typeof Path2D=="function";function QA(e,t,n,i){ZA&&!t.options.segment?KA(e,t,n,i):XA(e,t,n,i)}class Ya extends Ye{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;NC(this._points,i,t,r,n),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=ZC(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=Am(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=GA(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:m,end:g}=a[d],y=s[m],x=s[g];if(y===x){l.push(y);continue}const v=Math.abs((r-y[n])/(x[n]-y[n])),S=u(y,x,v,i.stepped);S[n]=t[n],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,n,i){return Ou(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=Ou(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const l of r)a&=s(t,this,l,{start:n,end:n+i-1});return!!a}draw(t,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),QA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Mg(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class JA extends Ye{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(n-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,n){return Mg(this,t,"x",n)}inYRange(t,n){return Mg(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!ai(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,uu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Dg(e,t){const{x:n,y:i,base:r,width:s,height:a}=e.getProps(["x","y","base","width","height"],t);let l,u,d,h,m;return e.horizontal?(m=a/2,l=Math.min(n,r),u=Math.max(n,r),d=i-m,h=i+m):(m=s/2,l=n-m,u=n+m,d=Math.min(i,r),h=Math.max(i,r)),{left:l,top:d,right:u,bottom:h}}function Ni(e,t,n,i){return e?0:Re(t,n,i)}function tE(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=pm(i);return{t:Ni(r.top,s.top,0,n),r:Ni(r.right,s.right,0,t),b:Ni(r.bottom,s.bottom,0,n),l:Ni(r.left,s.left,0,t)}}function eE(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=Ei(r),a=Math.min(t,n),l=e.borderSkipped,u=i||Nt(r);return{topLeft:Ni(!u||l.top||l.left,s.topLeft,0,a),topRight:Ni(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Ni(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Ni(!u||l.bottom||l.right,s.bottomRight,0,a)}}function nE(e){const t=Dg(e),n=t.right-t.left,i=t.bottom-t.top,r=tE(e,n/2,i/2),s=eE(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function Au(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&Dg(e,i);return l&&(r||si(t,l.left,l.right))&&(s||si(n,l.top,l.bottom))}function iE(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function rE(e,t){e.rect(t.x,t.y,t.w,t.h)}function Eu(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+a,radius:e.radius}}class sE extends Ye{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=nE(this),l=iE(a.radius)?qr:rE;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Eu(a,n,s)),t.clip(),l(t,Eu(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Eu(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return Au(this,t,n,i)}inXRange(t,n){return Au(this,t,null,n)}inYRange(t,n){return Au(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var oE=Object.freeze({__proto__:null,ArcElement:$A,BarElement:sE,LineElement:Ya,PointElement:JA});const Ru=["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)"],Cg=Ru.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Og(e){return Ru[e%Ru.length]}function Ag(e){return Cg[e%Cg.length]}function aE(e,t){return e.borderColor=Og(t),e.backgroundColor=Ag(t),++t}function lE(e,t){return e.backgroundColor=e.data.map(()=>Og(t++)),t}function cE(e,t){return e.backgroundColor=e.data.map(()=>Ag(t++)),t}function uE(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof ro?t=lE(n,t):r instanceof jm?t=cE(n,t):r&&(t=aE(n,t))}}function Eg(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function dE(e){return e&&(e.borderColor||e.backgroundColor)}function fE(){return ae.borderColor!=="rgba(0,0,0,0.1)"||ae.backgroundColor!=="rgba(0,0,0,0.1)"}var hE={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=Eg(i)||dE(r)||s&&Eg(s)||fE();if(!n.forceOverride&&a)return;const l=uE(e);i.forEach(l)}};function pE(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],l=(n-2)/(s-2);let u=0;const d=t+n-1;let h=t,m,g,y,x,v;for(a[u++]=e[h],m=0;m<s-2;m++){let S=0,O=0,A;const P=Math.floor((m+1)*l)+1+t,L=Math.min(Math.floor((m+2)*l)+1,n)+t,R=L-P;for(A=P;A<L;A++)S+=e[A].x,O+=e[A].y;S/=R,O/=R;const F=Math.floor(m*l)+1+t,U=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:D,y:w}=e[h];for(y=x=-1,A=F;A<U;A++)x=.5*Math.abs((D-S)*(e[A].y-w)-(D-e[A].x)*(O-w)),x>y&&(y=x,g=e[A],v=A);a[u++]=g,h=v}return a[u++]=e[d],a}function mE(e,t,n,i){let r=0,s=0,a,l,u,d,h,m,g,y,x,v;const S=[],O=t+n-1,A=e[t].x,L=e[O].x-A;for(a=t;a<t+n;++a){l=e[a],u=(l.x-A)/L*i,d=l.y;const R=u|0;if(R===h)d<x?(x=d,m=a):d>v&&(v=d,g=a),r=(s*r+l.x)/++s;else{const F=a-1;if(!kt(m)&&!kt(g)){const U=Math.min(m,g),D=Math.max(m,g);U!==y&&U!==F&&S.push({...e[U],x:r}),D!==y&&D!==F&&S.push({...e[D],x:r})}a>0&&F!==y&&S.push(e[F]),S.push(l),h=R,s=0,x=v=d,m=g=y=a}}return S}function Rg(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Pg(e){e.data.datasets.forEach(t=>{Rg(t)})}function gE(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Re(oi(t,s.axis,a).lo,0,n-1)),d?r=Re(oi(t,s.axis,l).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var _E={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Pg(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=e.getDatasetMeta(s),d=a||r.data;if(no([l,e.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=e.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||e.options.parsing)return;let{start:m,count:g}=gE(u,d);const y=n.threshold||4*i;if(g<=y){Rg(r);return}kt(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let x;switch(n.algorithm){case"lttb":x=pE(d,m,g,i,n);break;case"min-max":x=mE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=x})},destroy(e){Pg(e)}};function yE(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=qa(u,d,r);const h=Pu(n,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:r[u],end:r[d]});continue}const m=Am(t,h);for(const g of m){const y=Pu(n,s[g.start],s[g.end],g.loop),x=Om(l,r,y);for(const v of x)a.push({source:v,target:g,start:{[n]:Ig(h,y,"start",Math.max)},end:{[n]:Ig(h,y,"end",Math.min)}})}}return a}function Pu(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=We(r),s=We(s)),{property:e,start:r,end:s}}function bE(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=qa(a,l,r);const u=r[a],d=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:d.x,y:i})):n!==null&&(s.push({x:n,y:u.y}),s.push({x:n,y:d.y}))}),s}function qa(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Ig(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Lg(e,t){let n=[],i=!1;return jt(e)?(i=!0,n=e):n=bE(e,t),n.length?new Ya({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ng(e){return e&&e.fill!==!1}function xE(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!le(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function wE(e,t,n){const i=kE(e);if(Nt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return le(r)&&Math.floor(r)===r?vE(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vE(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function SE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Nt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function TE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Nt(e)?i=e.value:i=t.getBaseValue(),i}function kE(e){const t=e.options,n=t.fill;let i=Ot(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function ME(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=DE(t,n);l.push(Lg({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let h=d.start;h<=d.end;h++)CE(r,a[h],l)}return new Ya({points:r,options:{}})}function DE(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function CE(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=OE(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function OE(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const r=i[n],s=e.segments,a=e.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],m=a[h.start][n],g=a[h.end][n];if(si(r,m,g)){l=r===m,u=r===g;break}}return{first:l,last:u,point:i}}class Bg{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:r,y:s,radius:a}=this;return n=n||{start:0,end:ne},t.arc(r,s,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:r}=this,s=t.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function AE(e){const{chart:t,fill:n,line:i}=e;if(le(n))return EE(t,n);if(n==="stack")return ME(e);if(n==="shape")return!0;const r=RE(e);return r instanceof Bg?r:Lg(r,i)}function EE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function RE(e){return(e.scale||{}).getPointPositionForValue?IE(e):PE(e)}function PE(e){const{scale:t={},fill:n}=e,i=SE(n,t);if(le(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function IE(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=TE(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Bg({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)l.push(t.getPointPositionForValue(u,a));return l}function Iu(e,t,n){const i=AE(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,h=d.fill,m=d.backgroundColor,{above:g=m,below:y=m}=h||{},x=r.getDatasetMeta(s),v=Pm(r,x);i&&a.points.length&&(to(e,n),LE(e,{line:a,target:i,above:g,below:y,area:n,scale:l,axis:u,clip:v}),eo(e))}function LE(e,t){const{line:n,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=n._loop?"angle":t.axis;e.save();let h=s;s!==r&&(d==="x"?(Fg(e,i,a.top),Lu(e,{line:n,target:i,color:r,scale:l,property:d,clip:u}),e.restore(),e.save(),Fg(e,i,a.bottom)):d==="y"&&(zg(e,i,a.left),Lu(e,{line:n,target:i,color:s,scale:l,property:d,clip:u}),e.restore(),e.save(),zg(e,i,a.right),h=r)),Lu(e,{line:n,target:i,color:h,scale:l,property:d,clip:u}),e.restore()}function Fg(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],m=r[qa(u,d,r)];s?(e.moveTo(h.x,h.y),s=!1):(e.lineTo(h.x,n),e.lineTo(h.x,h.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(m.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function zg(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],m=r[qa(u,d,r)];s?(e.moveTo(h.x,h.y),s=!1):(e.lineTo(n,h.y),e.lineTo(h.x,h.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(n,m.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Lu(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=yE(n,i,r);for(const{source:d,target:h,start:m,end:g}of u){const{style:{backgroundColor:y=s}={}}=d,x=i!==!0;e.save(),e.fillStyle=y,NE(e,a,l,x&&Pu(r,m,g)),e.beginPath();const v=!!n.pathSegment(e,d);let S;if(x){v?e.closePath():Ug(e,i,g,r);const O=!!i.pathSegment(e,h,{move:v,reverse:!0});S=v&&O,S||Ug(e,i,m,r)}e.closePath(),e.fill(S?"evenodd":"nonzero"),e.restore()}}function NE(e,t,n,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,h,m;s==="x"?(u=a,d=r.top,h=l,m=r.bottom):(u=r.left,d=a,h=r.right,m=l),e.beginPath(),n&&(u=Math.max(u,n.left),h=Math.min(h,n.right),d=Math.max(d,n.top),m=Math.min(m,n.bottom)),e.rect(u,d,h-u,m-d),e.clip()}}function Ug(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var BE={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=e.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof Ya&&(u={visible:e.isDatasetVisible(a),index:a,fill:wE(l,a,i),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=xE(r,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let a=r.length-1;a>=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&Iu(e.ctx,l,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Ng(s)&&Iu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Ng(i)||n.drawTime!=="beforeDatasetDraw"||Iu(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Hg=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},FE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Wg extends Ye{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,n,i){this.maxWidth=t,this.maxHeight=n,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 n=Jt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=ce(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=Hg(i,s);let d,h;n.font=r.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,s,l,u)+10):(h=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+l;let m=t;s.textAlign="left",s.textBaseline="middle";let g=-1,y=-h;return this.legendItems.forEach((x,v)=>{const S=i+n/2+s.measureText(x.text).width;(v===0||d[d.length-1]+S+2*l>a)&&(m+=h,d[d.length-(v>0?0:1)]=0,y+=h,g++),u[v]={left:0,top:y,row:g,width:S,height:r},d[d.length-1]+=S+l}),m}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let m=l,g=0,y=0,x=0,v=0;return this.legendItems.forEach((S,O)=>{const{itemWidth:A,itemHeight:P}=zE(i,n,s,S,r);O>0&&y+P+2*l>h&&(m+=g+l,d.push({width:g,height:y}),x+=g+l,v++,g=y=0),u[O]={left:x,top:y,col:v,width:A,height:P},g=Math.max(g,A),y+=P+l}),m+=g,d.push({width:g,height:y}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=Kr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=$e(i,this.left+r,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,u=$e(i,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=a.leftForLtr(a.x(u),d.width),u+=d.width+r}else{let l=0,u=$e(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,u=$e(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=u,d.left+=this.left+r,d.left=a.leftForLtr(a.x(d.left),d.width),u+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;to(t,this),this._draw(),eo(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=ae.color,u=Kr(t.rtl,this.left,this.width),d=ce(a.font),{padding:h}=a,m=d.size,g=m/2;let y;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:S}=Hg(a,m),O=function(F,U,D){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const w=Ot(D.lineWidth,1);if(r.fillStyle=Ot(D.fillStyle,l),r.lineCap=Ot(D.lineCap,"butt"),r.lineDashOffset=Ot(D.lineDashOffset,0),r.lineJoin=Ot(D.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Ot(D.strokeStyle,l),r.setLineDash(Ot(D.lineDash,[])),a.usePointStyle){const C={radius:v*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:w},N=u.xPlus(F,x/2),$=U+g;hm(r,C,N,$,a.pointStyleWidth&&x)}else{const C=U+Math.max((m-v)/2,0),N=u.leftForLtr(F,x),$=Ei(D.borderRadius);r.beginPath(),Object.values($).some(V=>V!==0)?qr(r,{x:N,y:C,w:x,h:v,radius:$}):r.rect(N,C,x,v),r.fill(),w!==0&&r.stroke()}r.restore()},A=function(F,U,D){ur(r,D.text,F,U+S/2,d,{strikethrough:D.hidden,textAlign:u.textAlign(D.textAlign)})},P=this.isHorizontal(),L=this._computeTitleHeight();P?y={x:$e(s,this.left+h,this.right-i[0]),y:this.top+h+L,line:0}:y={x:this.left+h,y:$e(s,this.top+L+h,this.bottom-n[0].height),line:0},km(this.ctx,t.textDirection);const R=S+h;this.legendItems.forEach((F,U)=>{r.strokeStyle=F.fontColor,r.fillStyle=F.fontColor;const D=r.measureText(F.text).width,w=u.textAlign(F.textAlign||(F.textAlign=a.textAlign)),C=x+g+D;let N=y.x,$=y.y;u.setWidth(this.width),P?U>0&&N+C+h>this.right&&($=y.y+=R,y.line++,N=y.x=$e(s,this.left+h,this.right-i[y.line])):U>0&&$+R>this.bottom&&(N=y.x=N+n[y.line].width+h,y.line++,$=y.y=$e(s,this.top+L+h,this.bottom-n[y.line].height));const V=u.x(N);if(O(V,$,F),N=tC(w,N+x+g,P?N+C:this.right,t.rtl),A(u.x(N),$,F),P)y.x+=C+h;else if(typeof F.text!="string"){const st=d.lineHeight;y.y+=$g(F,st)+h}else y.y+=R}),Mm(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ce(n.font),r=Se(n.padding);if(!n.display)return;const s=Kr(t.rtl,this.left,this.width),a=this.ctx,l=n.position,u=i.size/2,d=r.top+u;let h,m=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),h=this.top+d,m=$e(t.align,m,this.right-g);else{const x=this.columnSizes.reduce((v,S)=>Math.max(v,S.height),0);h=d+$e(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const y=$e(l,m,m+g);a.textAlign=s.textAlign(su(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,ur(a,n.text,y,h,i)}_computeTitleHeight(){const t=this.options.title,n=ce(t.font),i=Se(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(si(t,this.left,this.right)&&si(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],si(t,r.left,r.left+r.width)&&si(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!WE(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=FE(r,i);r&&!s&&Jt(n.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Jt(n.onHover,[t,i,this],this)}else i&&Jt(n.onClick,[t,i,this],this)}}function zE(e,t,n,i,r){const s=UE(i,e,t,n),a=HE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function UE(e,t,n,i){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function HE(e,t,n){let i=e;return typeof t.text!="string"&&(i=$g(t,n)),i}function $g(e,t){const n=e.text?e.text.length:0;return t*n}function WE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var $E={id:"legend",_element:Wg,start(e,t,n){const i=e.legend=new Wg({ctx:e.ctx,options:n,chart:e});Ve.configure(e,i,n),Ve.addBox(e,i)},stop(e){Ve.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Ve.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(n?0:void 0),h=Se(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:u.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Nu extends Ye{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,n){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=n;const r=jt(i.text)?i.text.length:1;this._padding=Se(i.padding);const s=r*ce(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,h,m;return this.isHorizontal()?(h=$e(l,i,s),m=n+t,d=s-i):(a.position==="left"?(h=i+t,m=$e(l,r,n),u=Pt*-.5):(h=s-t,m=$e(l,n,r),u=Pt*.5),d=r-n),{titleX:h,titleY:m,maxWidth:d,rotation:u}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ce(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);ur(t,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:su(n.align),textBaseline:"middle",translation:[a,l]})}}function VE(e,t){const n=new Nu({ctx:e.ctx,options:t,chart:e});Ve.configure(e,n,t),Ve.addBox(e,n),e.titleBlock=n}var YE={id:"title",_element:Nu,start(e,t,n){VE(e,n)},stop(e){const t=e.titleBlock;Ve.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Ve.configure(e,i,n),i.options=n},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 ja=new WeakMap;var qE={id:"subtitle",start(e,t,n){const i=new Nu({ctx:e.ctx,options:n,chart:e});Ve.configure(e,i,n),Ve.addBox(e,i),ja.set(e,i)},stop(e){Ve.removeBox(e,ja.get(e)),ja.delete(e)},beforeUpdate(e,t,n){const i=ja.get(e);Ve.configure(e,i,n),i.options=n},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 ho={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;t<n;++t){const l=e[t].element;if(l&&l.hasValue()){const u=l.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((l,u)=>l+u)/i.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=e.length;s<a;++s){const u=e[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Yr(t,d);h<r&&(r=h,l=u)}}if(l){const u=l.tooltipPosition();n=u.x,i=u.y}return{x:n,y:i}}};function Kn(e,t){return t&&(jt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ci(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
2
2
|
`)>-1?e.split(`
|
|
3
|
-
`):e}function mv(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:e,label:a,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function id(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:a,boxHeight:r}=t,l=wt(t.bodyFont),c=wt(t.titleFont),d=wt(t.footerFont),h=o.length,f=s.length,m=i.length,p=At(t.padding);let g=p.height,y=0,_=i.reduce((v,w)=>v+w.before.length+w.lines.length+w.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,h&&(g+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),_){const v=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=m*v+(_-m)*l.lineHeight+(_-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let x=0;const T=function(v){y=Math.max(y,n.measureText(v).width+x)};return n.save(),n.font=c.string,pt(e.title,T),n.font=l.string,pt(e.beforeBody.concat(e.afterBody),T),x=t.displayColors?a+2+t.boxPadding:0,pt(i,v=>{pt(v.before,T),pt(v.lines,T),pt(v.after,T)}),x=0,n.font=d.string,pt(e.footer,T),n.restore(),y+=p.width,{width:y,height:g}}function pv(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function gv(e,t,n,i){const{x:s,width:o}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&s+o+a>t.width||e==="right"&&s-o-a<0)return!0}function yv(e,t,n,i){const{x:s,width:o}=n,{width:a,chartArea:{left:r,right:l}}=e;let c="center";return i==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),gv(c,e,t,n)&&(c="center"),c}function sd(e,t,n){const i=n.yAlign||t.yAlign||pv(e,n);return{xAlign:n.xAlign||t.xAlign||yv(e,t,n,i),yAlign:i}}function bv(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function _v(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function od(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=e,{xAlign:r,yAlign:l}=n,c=s+o,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:m}=Ie(a);let p=bv(t,r);const g=_v(t,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(d,f)+s:r==="right"&&(p+=Math.max(h,m)+s),{x:Rt(p,0,i.width-t.width),y:Rt(g,0,i.height-t.height)}}function Fs(e,t,n){const i=At(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function ad(e){return de([],we(e))}function xv(e,t,n){return Le(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function rd(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const ld={beforeTitle:ge,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.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 n[t.dataIndex]}return""},afterTitle:ge,beforeBody:ge,beforeLabel:ge,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return G(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ge,afterBody:ge,beforeFooter:ge,footer:ge,afterFooter:ge};function Kt(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?ld[t].call(n,i):s}class cd extends Vt{static positioners=Ei;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 n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new ra(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=xv(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=Kt(i,"beforeTitle",this,t),o=Kt(i,"title",this,t),a=Kt(i,"afterTitle",this,t);let r=[];return r=de(r,we(s)),r=de(r,we(o)),r=de(r,we(a)),r}getBeforeBody(t,n){return ad(Kt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return pt(t,o=>{const a={before:[],lines:[],after:[]},r=rd(i,o);de(a.before,we(Kt(r,"beforeLabel",this,o))),de(a.lines,Kt(r,"label",this,o)),de(a.after,we(Kt(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,n){return ad(Kt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=Kt(i,"beforeFooter",this,t),o=Kt(i,"footer",this,t),a=Kt(i,"afterFooter",this,t);let r=[];return r=de(r,we(s)),r=de(r,we(o)),r=de(r,we(a)),r}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=n.length;l<c;++l)r.push(mv(this.chart,n[l]));return t.filter&&(r=r.filter((d,h,f)=>t.filter(d,h,f,i))),t.itemSort&&(r=r.sort((d,h)=>t.itemSort(d,h,i))),pt(r,d=>{const h=rd(t.callbacks,d);s.push(Kt(h,"labelColor",this,d)),o.push(Kt(h,"labelPointStyle",this,d)),a.push(Kt(h,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=Ei[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=id(this,i),c=Object.assign({},r,l),d=sd(this.chart,i,c),h=od(i,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:h}=Ie(r),{x:f,y:m}=t,{width:p,height:g}=n;let y,_,x,T,v,w;return o==="center"?(v=m+g/2,s==="left"?(y=f,_=y-a,T=v+a,w=v-a):(y=f+p,_=y+a,T=v-a,w=v+a),x=y):(s==="left"?_=f+Math.max(l,d)+a:s==="right"?_=f+p-Math.max(c,h)-a:_=this.caretX,o==="top"?(T=m,v=T-a,y=_-a,x=_+a):(T=m+g,v=T+a,y=_+a,x=_-a),w=T),{x1:y,x2:_,x3:x,y1:T,y2:v,y3:w}}drawTitle(t,n,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=En(i.rtl,this.x,this.width);for(t.x=Fs(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",a=wt(i.titleFont),r=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,n,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,d=wt(o.bodyFont),h=Fs(this,"left",o),f=s.x(h),m=l<d.lineHeight?(d.lineHeight-l)/2:0,p=n.y+m;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ta(t,g,y,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ta(t,g,y,_)}else{t.lineWidth=st(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 g=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),_=Ie(a.borderRadius);Object.values(_).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,On(t,{x:g,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),On(t,{x:y,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:d}=i,h=wt(i.bodyFont);let f=h.lineHeight,m=0;const p=En(i.rtl,this.x,this.width),g=function(P){n.fillText(P,p.x(t.x+m),t.y+f/2),t.y+=f+o},y=p.textAlign(a);let _,x,T,v,w,M,D;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,t.x=Fs(this,y,i),n.fillStyle=i.bodyColor,pt(this.beforeBody,g),m=r&&y!=="right"?a==="center"?c/2+d:c+2+d:0,v=0,M=s.length;v<M;++v){for(_=s[v],x=this.labelTextColors[v],n.fillStyle=x,pt(_.before,g),T=_.lines,r&&T.length&&(this._drawColorBox(n,t,v,p,i),f=Math.max(h.lineHeight,l)),w=0,D=T.length;w<D;++w)g(T[w]),f=h.lineHeight;pt(_.after,g)}m=0,f=h.lineHeight,pt(this.afterBody,g),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let a,r;if(o){const l=En(i.rtl,this.x,this.width);for(t.x=Fs(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",a=wt(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,r=0;r<o;++r)n.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:d}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=Ie(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(r+h,l),a==="top"&&this.drawCaret(t,n,i,s),n.lineTo(r+c-f,l),n.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(r+c,l+d-p),n.quadraticCurveTo(r+c,l+d,r+c-p,l+d),a==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(r+m,l+d),n.quadraticCurveTo(r,l+d,r,l+d-m),a==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(r,l+h),n.quadraticCurveTo(r,l,r+h,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Ei[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=id(this,t),l=Object.assign({},a,this._size),c=sd(n,t,l),d=od(t,l,c,n);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=At(n.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Fc(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),zc(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!fs(i,s),a=this._positionChanged(s,n);(o||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,i),r=this._positionChanged(a,t),l=n||!fs(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,a=Ei[o.position].call(this,t,n);return a!==!1&&(i!==a.x||s!==a.y)}}var Ht={id:"tooltip",_element:cd,positioners:Ei,afterInit(e,t,n){n&&(e.tooltip=new cd({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ld},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},wv=Object.freeze({__proto__:null,Colors:IS,Decimation:FS,Filler:sv,Legend:uv,SubTitle:fv,Title:hv,Tooltip:Ht});const kv=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Tv(e,t,n,i){const s=e.indexOf(t);if(s===-1)return kv(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const Sv=(e,t)=>e===null?null:Rt(Math.round(e),0,t);function ud(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class vv extends sn{static id="category";static defaults={ticks:{callback:ud}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(G(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:Tv(i,t,Q(n,t),this._addedLabels),Sv(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)s.push({value:a});return s}getLabelForValue(t){return ud.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Mv(e,t){const n=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:h,includeBounds:f}=e,m=o||1,p=d-1,{min:g,max:y}=t,_=!G(a),x=!G(r),T=!G(c),v=(y-g)/(h+1);let w=dc((y-g)/p/m)*m,M,D,P,k;if(w<1e-14&&!_&&!x)return[{value:g},{value:y}];k=Math.ceil(y/w)-Math.floor(g/w),k>p&&(w=dc(k*w/p/m)*m),G(l)||(M=Math.pow(10,l),w=Math.ceil(w*M)/M),s==="ticks"?(D=Math.floor(g/w)*w,P=Math.ceil(y/w)*w):(D=g,P=y),_&&x&&o&&mw((r-a)/o,w/1e3)?(k=Math.round(Math.min((r-a)/w,d)),w=(r-a)/k,D=a,P=r):T?(D=_?a:D,P=x?r:P,k=c-1,w=(P-D)/k):(k=(P-D)/w,pi(k,Math.round(k),w/1e3)?k=Math.round(k):k=Math.ceil(k));const S=Math.max(fc(w),fc(D));M=Math.pow(10,G(l)?S:l),D=Math.round(D*M)/M,P=Math.round(P*M)/M;let A=0;for(_&&(f&&D!==a?(n.push({value:a}),D<a&&A++,pi(Math.round((D+A*w)*M)/M,a,dd(a,v,e))&&A++):D<a&&A++);A<k;++A){const L=Math.round((D+A*w)*M)/M;if(x&&L>r)break;n.push({value:L})}return x&&f&&P!==r?n.length&&pi(n[n.length-1].value,r,dd(r,v,e))?n[n.length-1].value=r:n.push({value:r}):(!x||P===r)&&n.push({value:P}),n}function dd(e,t,{horizontal:n,minRotation:i}){const s=Ot(i),o=(n?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class zs extends sn{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,n){return G(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=n?s:l,r=l=>o=i?o:l;if(t){const l=ce(s),c=ce(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,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(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=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:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=Mv(s,o);return t.bounds==="ticks"&&hc(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 n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return bi(t,this.chart.options.locale,this.options.ticks.format)}}class Dv extends zs{static id="linear";static defaults={ticks:{callback:ws.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?t:0,this.max=xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Ot(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.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}}const Ri=e=>Math.floor(Ee(e)),on=(e,t)=>Math.pow(10,Ri(e)+t);function hd(e){return e/Math.pow(10,Ri(e))===1}function fd(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function Cv(e,t){const n=t-e;let i=Ri(n);for(;fd(e,t,i)>10;)i++;for(;fd(e,t,i)<10;)i--;return Math.min(i,Ri(e))}function Ov(e,{min:t,max:n}){t=te(e.min,t);const i=[],s=Ri(t);let o=Cv(t,n),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,d=Math.floor((t-l)/r/10)*r*10;let h=Math.floor((c-d)/Math.pow(10,o)),f=te(e.min,Math.round((l+d+h*Math.pow(10,o))*a)/a);for(;f<n;)i.push({value:f,major:hd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),f=Math.round((l+d+h*Math.pow(10,o))*a)/a;const m=te(e.max,f);return i.push({value:m,major:hd(m),significand:h}),i}class Av extends sn{static id="logarithmic";static defaults={ticks:{callback:ws.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=zs.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return xt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?Math.max(0,t):null,this.max=xt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!xt(this._userMin)&&(this.min=t===on(this.min,0)?on(this.min,-1):on(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=r=>i=t?i:r,a=r=>s=n?s:r;i===s&&(i<=0?(o(1),a(10)):(o(on(i,-1)),a(on(s,1)))),i<=0&&o(on(s,-1)),s<=0&&a(on(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=Ov(n,this);return t.bounds==="ticks"&&hc(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":bi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ee(t),this._valueRange=Ee(this.max)-Ee(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ee(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Da(e){const t=e.ticks;if(t.display&&e.display){const n=At(t.backdropPadding);return Q(t.font&&t.font.size,_t.font.size)+n.height}return 0}function Pv(e,t,n){return n=dt(n)?n:[n],{w:Pw(e,t.string,n),h:n.length*t.lineHeight}}function md(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function Ev(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,a=e.options.pointLabels,r=a.centerPointLabels?it/o:0;for(let l=0;l<o;l++){const c=a.setContext(e.getPointLabelContext(l));s[l]=c.padding;const d=e.getPointPosition(l,e.drawingArea+s[l],r),h=wt(c.font),f=Pv(e.ctx,h,e._pointLabels[l]);i[l]=f;const m=Ft(e.getIndexAngle(l)+r),p=Math.round(ys(m)),g=md(p,d.x,f.w,0,180),y=md(p,d.y,f.h,90,270);Rv(n,t,m,g,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Nv(e,i,s)}function Rv(e,t,n,i,s){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function Iv(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=n,l=e.getPointPosition(t,i+s+a,o),c=Math.round(ys(Ft(l.angle+bt))),d=zv(l.y,r.h,c),h=Bv(c),f=Fv(l.x,r.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:f,top:d,right:f+r.w,bottom:d+r.h}}function Lv(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:o}=e;return!(_e({x:n,y:i},t)||_e({x:n,y:o},t)||_e({x:s,y:i},t)||_e({x:s,y:o},t))}function Nv(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Da(o)/2,additionalAngle:a?it/s:0};let c;for(let d=0;d<s;d++){l.padding=n[d],l.size=t[d];const h=Iv(e,d,l);i.push(h),r==="auto"&&(h.visible=Lv(h,c),h.visible&&(c=h))}return i}function Bv(e){return e===0||e===180?"center":e<180?"left":"right"}function Fv(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function zv(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Uv(e,t,n){const{left:i,top:s,right:o,bottom:a}=n,{backdropColor:r}=t;if(!G(r)){const l=Ie(t.borderRadius),c=At(t.backdropPadding);e.fillStyle=r;const d=i-c.left,h=s-c.top,f=o-i+c.width,m=a-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),On(e,{x:d,y:h,w:f,h:m,radius:l}),e.fill()):e.fillRect(d,h,f,m)}}function Vv(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(e.getPointLabelContext(s));Uv(n,a,o);const r=wt(a.font),{x:l,y:c,textAlign:d}=o;Je(n,e._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:d,textBaseline:"middle"})}}function pd(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,yt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=e.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function Hv(e,t,n,i,s){const o=e.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!i||!r||!l||n<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),pd(e,n,a,i),o.closePath(),o.stroke(),o.restore())}function $v(e,t,n){return Le(e,{label:n,index:t,type:"pointLabel"})}class Yv extends zs{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ws.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=At(Da(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=xt(t)&&!isNaN(t)?t:0,this.max=xt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Da(this.options))}generateTickLabels(t){zs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const s=mt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Ev(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=yt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ft(t*n+Ot(i))}getDistanceFromCenterForValue(t){if(G(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(G(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return $v(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const s=this.getIndexAngle(t)-bt+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),pd(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,a=this._pointLabels.length;let r,l,c;if(n.pointLabels.display&&Vv(this,a),s.display&&this.ticks.forEach((d,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);const f=this.getContext(h),m=s.setContext(f),p=o.setContext(f);Hv(this,m,l,a,p)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const d=i.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:f}=d;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(r,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,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),d=wt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const h=At(c.backdropPadding);t.fillRect(-a/2-h.left,-o-d.size/2-h.top,a+h.width,d.size+h.height)}Je(t,r.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Us={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}},Zt=Object.keys(Us);function gd(e,t){return e-t}function yd(e,t){if(G(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),xt(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(Re(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,s)),+a)}function bd(e,t,n,i){const s=Zt.length;for(let o=Zt.indexOf(e);o<s-1;++o){const a=Us[Zt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(r*a.size))<=i)return Zt[o]}return Zt[s-1]}function Wv(e,t,n,i,s){for(let o=Zt.length-1;o>=Zt.indexOf(n);o--){const a=Zt[o];if(Us[a].common&&e._adapter.diff(s,i,a)>=t-1)return a}return Zt[n?Zt.indexOf(n):0]}function jv(e){for(let t=Zt.indexOf(e)+1,n=Zt.length;t<n;++t)if(Us[Zt[t]].common)return Zt[t]}function _d(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=Go(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function qv(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,i))l=n[r],l>=0&&(t[l].major=!0);return t}function xd(e,t,n){const i=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,i.push({value:r,major:!1});return o===0||!n?i:qv(e,i,s,n)}class Ca extends sn{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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,n={}){const i=t.time||(t.time={}),s=this._adapter=new lu._date(t.adapters.date);s.init(n),mi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:yd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=xt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=xt(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=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 o=this.min,a=this.max,r=bw(s,o,a);return this._unit=n.unit||(i.autoSkip?bd(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Wv(this,r.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:jv(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),xd(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Rt(n,0,a),i=Rt(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||bd(o.minUnit,n,i,this._getLabelCapacity(n)),r=Q(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Re(l)||l===!0,d={};let h=n,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,n,a)>1e5*r)throw new Error(n+" and "+i+" are too far apart with stepSize of "+r+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,r,a),m++)_d(d,f,p);return(f===i||s.bounds==="ticks"||m===1)&&_d(d,f,p),Object.keys(d).sort(gd).map(g=>+g)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,a=n||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,s){const o=this.options,a=o.ticks.callback;if(a)return mt(a,[t,n,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],h=c&&r[c],f=i[n],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:d))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,s=Ot(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,xd(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],n,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(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(yd(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gc(t.sort(gd))}}function Vs(e,t,n){let i=0,s=e.length-1,o,a,r,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=be(e,"pos",t)),{pos:o,time:r}=e[i],{pos:a,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=be(e,"time",t)),{time:o,pos:r}=e[i],{time:a,pos:l}=e[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class Gv extends Ca{static id="timeseries";static defaults=Ca.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Vs(n,this.min),this._tableRange=Vs(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let a,r,l,c,d;for(a=0,r=t.length;a<r;++a)c=t[a],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)d=s[a+1],l=s[a-1],c=s[a],Math.round((d+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Vs(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Vs(this._table,i*this._tableRange+this._minPos,!0)}}var Xv=Object.freeze({__proto__:null,CategoryScale:vv,LinearScale:Dv,LogarithmicScale:Av,RadialLinearScale:Yv,TimeScale:Ca,TimeSeriesScale:Gv});const Kv=[Kk,DS,wv,Xv];function Zv(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Ht.positioners[n]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const d=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=d.width/2,m=js(c,h,f),p=c.y,g=c.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:p-e.tooltipState.offsetY,xAlign:g}},pa.modes.customInteractionMode=function(l,c){const d=Ne(c,l),h=[];return pa.evaluateInteractionItems(l,l.options.indexAxis||"x",d,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(d.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&d.x!==null&&f.inXRange(d.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=e.numLabels.value>25?Bd:Fd,o=({chart:l,index:c})=>{const d=l.data;return{size:s,style:d?.isLabelEmpty?.[c]?"italic":"normal"}},a=(l,c,d)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(d),c&&c.length>qs?c.slice(0,qs)+"...":c):l.getLabelForValue(Number(c)),r=u.computed(()=>({indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:o,callback:function(l,c){return a(this,l,c)}},title:{display:e.indexAxis==="y"?!G(e.metricAxesTitle?.value):!G(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:o,callback:function(l,c){return a(this,l,c)}},title:{display:e.indexAxis==="x"?!G(e.metricAxesTitle?.value):!G(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:l=>{Id(e.tooltipState,l)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.getCurrentInstance()&&u.onUnmounted(()=>{Ht.positioners[n]&&delete Ht.positioners[n]}),r}Xt.register(...Kv);const Qv=(e,t)=>{const n=t.datasets.map(s=>s.label),i=e.datasets.map(s=>s.label);return e.datasets.length===t.datasets.length&&n.every((s,o)=>s===i[o])};function Jv(e,t,n,i,s){const o=u.shallowRef(null),a=(r,l)=>{if(t.value)return new Xt(t.value,{type:e,data:r,plugins:i,options:l})};return u.onMounted(()=>{o.value=a(n.value,s.value)}),u.onBeforeUnmount(()=>{G(o.value)||o.value.destroy()}),u.watch(n,(r,l)=>{if(Qv(l,r)&&!G(o.value)){for(const[c,d]of r.datasets.entries())Object.assign(o.value.data.datasets[c],d);o.value.data.labels=r.labels,o.value.update()}else G(o.value)||o.value.destroy(),o.value=a(r,s.value)}),u.watch(t,()=>{G(o.value)||o.value.destroy(),o.value=a(n.value,s.value)}),u.watch(s,(r,l)=>{(r.indexAxis!==l.indexAxis||JSON.stringify(r.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(r.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(G(o.value)||o.value.destroy(),o.value=a(n.value,r))}),o}const wd=1e3,t1=1e4,kd=1e6,Td=1e9,Sd=1e12,Ii=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((o,a)=>{a&&a%3===0&&i.push(n),i.push(o)}),i.reverse().join("")},In=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let a=o.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function Li(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?t1:wd;return e<s||t.precision&&t.precision>Math.log10(e)?n=Ii(In(e,1,t),t):e<kd?n=`${In(e,wd,t)}k`:e<Td?n=`${In(e,kd,t)}m`:e<Sd?n=`${Ii(In(e,Td,t),t)}b`:n=`${Ii(In(e,Sd,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Li.addCommas=Ii;function e1(e,t,n){const{i18n:i}=q.useI18n(),{formatBytes:s}=oe({i18n:i}),{translateUnit:o}=q.useTranslatedUnits();return{legendValues:u.computed(()=>e.value.datasets.reduce((r,l)=>{const c=l.total?l.total:l.data.reduce((f,m)=>f+(typeof m=="number"?Number(m)||0:Number(m&&m.y)||0),0);let d;const h=l.unit??n.value;if(h==="bytes")d=s(c);else{const f=o(h,c);d=i&&i.t("legend.datapointValueDisplay",{value:Li(c,{capital:!0}),unit:f})||`${Li(c,{capital:!0})} ${h}`}return{...r,[l.label]:{raw:c,formatted:d,isThreshold:l.isThreshold}}},{}))}}function n1(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Ht.positioners[n]=function(o,a){if(!o.length||a.x===null||a.y===null)return!1;const r=this.chart.canvas.getBoundingClientRect(),l=e.tooltipState.width||this.width,c=r.width/2,d=js(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:d-e.tooltipState.offsetX,y:h,xAlign:f}};const s=u.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:o=>{Id(e.tooltipState,o)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return u.onUnmounted(()=>{Ht.positioners[n]&&delete Ht.positioners[n]}),{options:s}}function i1(e){const t=u.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:10,source:"auto",maxRotation:0,callback:d=>{const h=new Date(d);return nh({tickValue:h,granularity:e.granularity.value,dayBoundaryCrossed:l.value})}},title:{display:!1},border:{display:!1},stacked:e.stacked.value})),n=u.computed(()=>!!e.rightYAxis?.value),i=u.computed(()=>({title:{display:!G(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,...e.leftYAxisGrid?.value===!1?{drawOnChartArea:!1}:{}},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value,...n.value?{display:"auto"}:{}})),s=u.computed(()=>{const d=e.rightYAxis?.value;if(d)return{display:"auto",position:"right",title:{display:!G(d.title),text:d.title,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,drawOnChartArea:d.showGrid??!1},beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),a=`lineChartTooltipPosition-${e.tooltipState.chartID}`,r={enabled:!1,position:a};Ht.positioners[a]=function(d,h){if(!d.length||e.tooltipState.interactionMode==="interactive"||h.x===null||h.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),m=e.tooltipState.width||this.width,p=e.tooltipState.height||this.height,g=f.width/2,y=f.height/2,_=js(h,m,g);let x=Ld(h,p,y);const T=h.y<y?"top":"bottom",v=h.x<g?"left":"center";return p>f.height&&(x=0),{x:_,y:x,xAlign:v,yAlign:T}};const l=u.computed(()=>{const d=Number(e.timeRangeMs.value),h=new Date,f=new Date(h.getTime()-d);return Xl(d)>24||f.getDate()!==h.getDate()}),c=u.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:i.value,...s.value?{[Na]:s.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:d=>{Ia(e.tooltipState,d,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.onUnmounted(()=>{Ht.positioners[a]&&delete Ht.positioners[a]}),{options:c}}const s1=["usd","bytes"],o1="usd";function a1(e){const{i18n:t}=q.useI18n(),{formatUnit:n}=oe({i18n:t}),i=(m,p)=>!p||!s1.includes(p)?m:m===0&&p===o1?t.formatNumber(0,{style:"currency",currency:"USD"}):n(m,p),s=u.computed(()=>{const m=Number(e.timeRangeMs.value),p=new Date,g=new Date(p.getTime()-m);return Xl(m)>24||g.getDate()!==p.getDate()}),o=u.computed(()=>({display:!G(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=u.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:m=>i(m,e.xMetricUnit?.value)},title:o.value,border:{display:!1}})),r=u.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:m=>nh({tickValue:new Date(m),granularity:e.granularity.value,dayBoundaryCrossed:s.value})},title:o.value,border:{display:!1}})),l=u.computed(()=>({title:{display:!G(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:m=>i(m,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),c=(m,p,g)=>{const y=g?.timestamp;return y===void 0?"":zn({tickValue:new Date(y),granularity:p})},h=`scatterChartTooltipPosition-${e.tooltipState.chartID}`;Ht.positioners[h]=function(m,p){if(!m.length||e.tooltipState.interactionMode==="interactive"||p.x===null||p.y===null)return!1;const g=this.chart.canvas.getBoundingClientRect(),y=e.tooltipState.width||this.width,_=e.tooltipState.height||this.height,x=g.width/2,T=g.height/2,v=js(p,y,x);let w=Ld(p,_,T);const M=p.y<T?"top":"bottom",D=p.x<x?"left":"center";return _>g.height&&(w=0),{x:v,y:w,xAlign:D,yAlign:M}};const f=u.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"point",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.xMetric?.value?a.value:r.value,y:l.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:h,external:m=>{Ia(e.tooltipState,m,e.granularity.value,{...e.xMetric?.value?{contextFormatter:c}:{}})}},outlierBandPlugin:{value:e.outlierValue?.value,color:e.themeColors.value.outlierBand},referenceLinePlugin:{lines:e.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.onUnmounted(()=>{Ht.positioners[h]&&delete Ht.positioners[h]}),{options:f}}function r1(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:s,pivotRecords:o,rowLabels:a,colorPalette:r,seriesDimension:l}=e,{i18n:c}=q.useI18n(),{evaluateFeatureFlag:d}=q.useEvaluateFeatureFlag(),h=d("analytics-color-updates",!1);return t?i.map(f=>({label:c&&c.te(`chartLabels.${f}`)&&c.t(`chartLabels.${f}`)||f,backgroundColor:h?ii({metric:f}):Ba(i.indexOf(f),he),data:a.map((m,p)=>n?o[`${m.id},${f}`]||0:o[`${p},${f}`]||null)})):Array.from(s).flatMap((f,m)=>f?{dimension:l,dimensionValue:f.id,label:c&&c.te(`chartLabels.${f.name}`)&&c.t(`chartLabels.${f.name}`)||f.name,backgroundColor:h?ii({dimension:l,dimensionValue:f.id}):Fa(m,f.name,f.id==="empty",r??he),data:a.map(p=>o[`${p.id},${f.id}`]||null),isSegmentEmpty:f.id==="empty"}:[])}function l1(e,t){const{i18n:n}=q.useI18n();return u.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:a}=t.value.meta,r=o&&Object.keys(o),l=a&&a.length>1,c=o&&r&&r.length>0,d=c&&r.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&r||a,f=h[0],m=h.length>1?h[1]:h[0],p=Object.fromEntries(l?s.flatMap(k=>a.map((S,A)=>{const L=k.event[f],R=c?`${L},${S}`:`${A},${S}`,H=k.event[S];return[R,H]})):s.map(k=>{const S=c?`${k.event[f]},${k.event[m]}`:`${f},${m}`,A=k.event[a[0]];return[S,A]})),g=Object.keys(p).reduce((k,S)=>{const[A]=S.split(","),L=p[S];return k[A]?k[A]+=L:k[A]=L,k},{}),y=Object.entries(g).sort(([,k],[,S])=>Number(S)-Number(k)).map(([k])=>k),_=o[f],x=o[m];let T=c&&_&&Object.entries(_).map(([k,S])=>({id:k,name:S.name}))||a.map(k=>({id:k,name:k})),v=c&&x&&Object.entries(x).map(([k,S])=>({id:k,name:S.name}))||a.map(k=>({id:k,name:k}));if(c&&f==="country_code"&&(T=T.map(k=>({...k,name:Co(k.id)||k.name}))),c&&m==="country_code"&&(v=v.map(k=>({...k,name:Co(k.id)||k.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(T.sort((k,S)=>y.indexOf(k.id)-y.indexOf(S.id)),v.sort((k,S)=>y.indexOf(k.id)-y.indexOf(S.id))),!T||!v)return{labels:[],datasets:[]};const w=r1({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:v,pivotRecords:p,rowLabels:T,seriesDimension:m,colorPalette:e.colorPalette||he}),M=c?T.map(k=>n&&n.te(`chartLabels.${k.name}`)&&n.t(`chartLabels.${k.name}`)||k.name):a.map(k=>n&&n.te(`chartLabels.${k}`)&&n.t(`chartLabels.${k}`)||k),D=T.map(k=>k.id==="empty");return{labels:M,datasets:w,isLabelEmpty:D,isMultiDimension:d}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const c1=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,s)=>i+s*n),u1=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Kl(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},d1=(e,t,n,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),r=Math.floor((e-i)/n)*n+i,l=Math.floor((a-i)/n)*n+i+n;return c1(r,l,n)};function h1(e,t){const{i18n:n}=q.useI18n(),{evaluateFeatureFlag:i}=q.useEvaluateFeatureFlag(),s=i("analytics-color-updates",!1);return u.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:r,metric_names:l,metric_units:c,start:d,end:h}=t.value.meta,f=new Date(d).getTime(),m=new Date(h).getTime();if(!l)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const p=r&&Object.keys(r)||l,g=p&&p[0],y=r?.[g],_=!!y&&l.length>1;let x=r&&y&&Object.keys(y).map(k=>({id:k,name:y[k].name}))||l.map(k=>({id:k,name:k}));g==="country_code"&&(x=x.map(k=>({...k,name:Co(k.id)||k.name})));const T=t.value.meta.granularity_ms;if(typeof T!="number"||isNaN(T)||!isFinite(T)||T===0)return console.error("Invalid step value:",T),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const v=u1(f),w=d1(f,m,T,v,a),M=a?.length?a.reduce((k,S)=>{const A=new Date(S.timestamp).valueOf(),L=S.event;for(const R of l)A in k||(k[A]={}),R in k[A]||(k[A][R]={});for(const R of l)x.forEach(H=>{(y?L[g]===H.id:R===H.id)?(k[A][R]||(k[A][R]={}),k[A][R][H.id]=Math.round(Number(L[R])*1e3)/1e3):p.length||(k[A][R]||(k[A][R]={}),k[A][R][H.id]=Math.round(Number(L[H.id])*1e3)/1e3)});return k},{}):{},P=[...y||l.length===1?l.flatMap(k=>x.map(S=>[k,S.id,S.name,S.id==="empty"])):x.map(k=>[k.name,k.id,k.name,k.id==="empty"])].map(([k,S,A,L],R)=>{const H=w.map(C=>C in M&&k in M[C]?{x:C,y:M[C][k][S]||0}:{x:C,y:0});let{colorPalette:W,fill:$}=e;G(W)&&(W=he);const K=s?ii({dimension:g,dimensionValue:S}):Fa(R,A,L,W),lt=lh(A)?n.t(`chartLabels.${A}`):A,rt=lh(k)?n.t(`chartLabels.${k}`):k,X=l.findIndex(C=>C===k),z=e.metricAxisMap?.[k]==="right";return{dimension:g,dimensionValue:S,rawDimension:A,rawMetric:k,label:_?`${lt} — ${rt}`:lt,borderColor:K,backgroundColor:K,data:H,total:H.reduce((C,{y:E})=>C+Number(E),0),...eM,..._?{borderDash:X===0?[]:[X*4,2]}:{},...!_&&z?{borderDash:[4,2]}:{},...z?{yAxisID:Na}:{},...e.metricAxisMap?{unit:c?.[k]??""}:{},fill:$,borderWidth:$?iM:nM,isSegmentEmpty:L}});return g==="status_code"||g==="status_code_grouped"?P.sort((k,S)=>(k.label??"")<(S.label??"")?-1:1):P.sort((k,S)=>Number(k.total)<Number(S.total)?-1:1),{datasets:P}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const f1=3,m1=.6,vd=2,p1=2,Md=50,g1=[6,4],y1=[2,3],b1=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function _1(e,t){const{i18n:n}=q.useI18n(),{evaluateFeatureFlag:i}=q.useEvaluateFeatureFlag(),s=i("analytics-color-updates",!1),o=(a,r)=>r||(a===Md?n.t("scatter.median"):n.t("scatter.percentile",{value:a}));return u.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:r,dimension:l,display:c,xMetric:d,xMetricUnit:h}=a,f=d?n.te(`chartLabels.${d}`)&&n.t(`chartLabels.${d}`)||d:"",m=e.scatter||{},p=m.jitterMs??0,g=m.pointRadius??f1,y=m.pointOpacity??m1,_=new Map,x=[];a.points.forEach(R=>{const H=R.group??r,W=_.get(H)||[];let $,K;R.x!==void 0?($={x:R.x,timestamp:R.timestamp},K=[{label:f,value:R.x,...h?{unit:h}:{}},...R.extras??[]]):($={x:R.timestamp+b1(p,R.timestamp+R.value)},K=R.extras??[]),W.push({...$,y:R.value,...K.length?{extras:K}:{}}),_.set(H,W),x.push(R.value)});const T=m.percentileLines||[],v=[...T.map(R=>R.percentile),...m.outlierPercentile!==void 0?[m.outlierPercentile]:[]],w=v.length?qM(x,v):new Map,M=m.outlierPercentile!==void 0?w.get(m.outlierPercentile):void 0,D=M!==void 0&&Number.isFinite(M),P=G(e.colorPalette)?he:e.colorPalette,k=e.themeColors?.value??Ja(),S=[],A=R=>{const H=R?.y;return D&&Number.isFinite(H)&&H>M};Array.from(_.entries()).forEach(([R,H],W)=>{const $=l&&c?.[R]?.name||R,K=R==="empty",lt=s?ii({dimension:l,dimensionValue:R}):Fa(W,$,K,P),rt=Qa(lt,y),X=n.te(`chartLabels.${$}`)&&n.t(`chartLabels.${$}`)||$;S.push({dimension:l,dimensionValue:R,type:"scatter",rawDimension:$,rawMetric:r,label:X,borderColor:z=>A(z.raw)?k.outlier:lt,backgroundColor:z=>A(z.raw)?k.outlier:rt,pointRadius:z=>A(z.raw)?g+vd:g,pointHoverRadius:z=>(A(z.raw)?g+vd:g)+p1,data:H,pointBorderWidth:0,showLine:!1,isSegmentEmpty:K})});const L=[];return T.forEach(R=>{const H=w.get(R.percentile);if(H===void 0||!Number.isFinite(H))return;const W=R.percentile===Md;L.push({percentile:R.percentile,label:o(R.percentile,R.label),value:H,color:R.color||(W?k.medianLine:k.outlier),borderDash:R.borderDash||(W?g1:y1)})}),{datasets:S,...D?{outlier:{value:M,label:n.t("scatter.outlier",{label:o(m.outlierPercentile)}),color:k.outlier}}:{},...L.length?{referenceLines:L}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const x1=(e,t)=>{u.watch([e,t],(n,i,s)=>{const[o,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,o),s(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function w1(){const{i18n:e}=q.useI18n();return{translateUnit:(n,i)=>{const s=i===1,o=`chartUnits.${n}`;return zi(n)?"":e.te(o)?e.t(o,{plural:s?"":"s"}):n}}}const k1="analytics-query-provider",Oa="analytics-dashboard-coordinator",Dd=2,Aa="____OTHER____",T1="empty";function S1(){const e=u.inject(k1);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function Cd(e,t){return u.getCurrentScope()?(u.onScopeDispose(e,t),!0):!1}const Od=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const v1=e=>e!=null,M1=Object.prototype.toString,D1=e=>M1.call(e)==="[object Object]";function Hs(e){return Array.isArray(e)?e:[e]}function C1(e){return u.getCurrentInstance()}function O1(e,t={}){if(!u.isRef(e))return u.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=u.customRef(()=>({get(){return e.value[i]},set(s){var o;if(!((o=u.toValue(t.replaceRef))!==null&&o!==void 0)||o)if(Array.isArray(e.value)){const a=[...e.value];a[i]=s,e.value=a}else{const a={...e.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[i]=s}}));return n}function A1(e,t=!0,n){C1()?u.onMounted(e,n):t?e():u.nextTick(e)}function P1(e,t,n){return u.watch(e,t,{...n,immediate:!0})}const $s=Od?window:void 0;function Ln(e){var t;const n=u.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Ni(...e){const t=(i,s,o,a)=>(i.addEventListener(s,o,a),()=>i.removeEventListener(s,o,a)),n=u.computed(()=>{const i=Hs(u.toValue(e[0])).filter(s=>s!=null);return i.every(s=>typeof s!="string")?i:void 0});return P1(()=>{var i,s;return[(i=(s=n.value)===null||s===void 0?void 0:s.map(o=>Ln(o)))!==null&&i!==void 0?i:[$s].filter(o=>o!=null),Hs(u.toValue(n.value?e[1]:e[0])),Hs(u.unref(n.value?e[2]:e[1])),u.toValue(n.value?e[3]:e[2])]},([i,s,o,a],r,l)=>{if(!i?.length||!s?.length||!o?.length)return;const c=D1(a)?{...a}:a,d=i.flatMap(h=>s.flatMap(f=>o.map(m=>t(h,f,m,c))));l(()=>{d.forEach(h=>h())})},{flush:"post"})}function E1(){const e=u.shallowRef(!1),t=u.getCurrentInstance();return t&&u.onMounted(()=>{e.value=!0},t),e}function Ad(e){const t=E1();return u.computed(()=>(t.value,!!e()))}function R1(e,t,n={}){const{window:i=$s,...s}=n;let o;const a=Ad(()=>i&&"MutationObserver"in i),r=()=>{o&&(o.disconnect(),o=void 0)},l=u.watch(u.computed(()=>{const h=Hs(u.toValue(e)).map(Ln).filter(v1);return new Set(h)}),h=>{r(),a.value&&h.size&&(o=new MutationObserver(t),h.forEach(f=>o.observe(f,s)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),d=()=>{l(),r()};return Cd(d),{isSupported:a,stop:d,takeRecords:c}}const Ys={speed:2,margin:30,direction:"both"};function I1(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function L1(e,t={}){var n,i,s,o;const{pointerTypes:a,preventDefault:r,stopPropagation:l,exact:c,onMove:d,onEnd:h,onStart:f,initialValue:m,axis:p="both",draggingElement:g=$s,containerElement:y,handle:_=e,buttons:x=[0],restrictInView:T,autoScroll:v=!1}=t,w=u.ref((n=u.toValue(m))!==null&&n!==void 0?n:{x:0,y:0}),M=u.ref(),D=z=>a?a.includes(z.pointerType):!0,P=z=>{u.toValue(r)&&z.preventDefault(),u.toValue(l)&&z.stopPropagation()},k=u.toValue(v),S=typeof k=="object"?{speed:(i=u.toValue(k.speed))!==null&&i!==void 0?i:Ys.speed,margin:(s=u.toValue(k.margin))!==null&&s!==void 0?s:Ys.margin,direction:(o=k.direction)!==null&&o!==void 0?o:Ys.direction}:Ys,A=z=>typeof z=="number"?[z,z]:[z.x,z.y],L=(z,C,E)=>{const{clientWidth:N,clientHeight:V,scrollLeft:tt,scrollTop:Z,scrollWidth:F,scrollHeight:nt}=z,[gt,ct]=A(S.margin),[at,Ct]=A(S.speed);let B=0,U=0;(S.direction==="x"||S.direction==="both")&&(E.x<gt&&tt>0?B=-at:E.x+C.width>N-gt&&tt<F-N&&(B=at)),(S.direction==="y"||S.direction==="both")&&(E.y<ct&&Z>0?U=-Ct:E.y+C.height>V-ct&&Z<nt-V&&(U=Ct)),(B||U)&&z.scrollBy({left:B,top:U,behavior:"auto"})};let R=null;const H=()=>{const z=u.toValue(y);z&&!R&&(R=setInterval(()=>{const C=u.toValue(e).getBoundingClientRect(),{x:E,y:N}=w.value,V={x:E-z.scrollLeft,y:N-z.scrollTop};V.x>=0&&V.y>=0&&(L(z,C,V),V.x+=z.scrollLeft,V.y+=z.scrollTop,w.value=V)},1e3/60))},W=()=>{R&&(clearInterval(R),R=null)},$=(z,C,E,N)=>{const[V,tt]=typeof E=="number"?[E,E]:[E.x,E.y],{clientWidth:Z,clientHeight:F}=C;return z.x<V||z.x+N.width>Z-V||z.y<tt||z.y+N.height>F-tt},K=()=>{if(u.toValue(t.disabled)||!M.value)return;const z=u.toValue(y);if(!z)return;const C=u.toValue(e).getBoundingClientRect(),{x:E,y:N}=w.value,V={x:E-z.scrollLeft,y:N-z.scrollTop};$(V,z,S.margin,C)?H():W()};u.toValue(v)&&u.watch(w,K);const lt=z=>{var C;if(!u.toValue(x).includes(z.button)||u.toValue(t.disabled)||!D(z)||u.toValue(c)&&z.target!==u.toValue(e))return;const E=u.toValue(y),N=E==null||(C=E.getBoundingClientRect)===null||C===void 0?void 0:C.call(E),V=u.toValue(e).getBoundingClientRect(),tt={x:z.clientX-(E?V.left-N.left+(v?0:E.scrollLeft):V.left),y:z.clientY-(E?V.top-N.top+(v?0:E.scrollTop):V.top)};f?.(tt,z)!==!1&&(M.value=tt,P(z))},rt=z=>{if(u.toValue(t.disabled)||!D(z)||!M.value)return;const C=u.toValue(y);C instanceof HTMLElement&&I1(C);const E=u.toValue(e).getBoundingClientRect();let{x:N,y:V}=w.value;if((p==="x"||p==="both")&&(N=z.clientX-M.value.x,C&&(N=Math.min(Math.max(0,N),C.scrollWidth-E.width))),(p==="y"||p==="both")&&(V=z.clientY-M.value.y,C&&(V=Math.min(Math.max(0,V),C.scrollHeight-E.height))),u.toValue(v)&&C&&(R===null&&L(C,E,{x:N,y:V}),N+=C.scrollLeft,V+=C.scrollTop),C&&(T||v)){if(p!=="y"){const tt=N-C.scrollLeft;tt<0?N=C.scrollLeft:tt>C.clientWidth-E.width&&(N=C.clientWidth-E.width+C.scrollLeft)}if(p!=="x"){const tt=V-C.scrollTop;tt<0?V=C.scrollTop:tt>C.clientHeight-E.height&&(V=C.clientHeight-E.height+C.scrollTop)}}w.value={x:N,y:V},d?.(w.value,z),P(z)},X=z=>{u.toValue(t.disabled)||!D(z)||M.value&&(M.value=void 0,v&&W(),h?.(w.value,z),P(z))};if(Od){const z=()=>{var C;return{capture:(C=t.capture)!==null&&C!==void 0?C:!0,passive:!u.toValue(r)}};Ni(_,"pointerdown",lt,z),Ni(g,"pointermove",rt,z),Ni(g,["pointerup","pointercancel"],X,z)}return{...O1(w),position:w,isDragging:u.computed(()=>!!M.value),style:u.computed(()=>`
|
|
4
|
-
left: ${
|
|
5
|
-
top: ${
|
|
6
|
-
${
|
|
7
|
-
`)}}function N1(e,t,n={}){const{window:i=$s,...s}=n;let o;const a=Ad(()=>i&&"ResizeObserver"in i),r=()=>{o&&(o.disconnect(),o=void 0)},l=u.watch(u.computed(()=>{const d=u.toValue(e);return Array.isArray(d)?d.map(h=>Ln(h)):[Ln(d)]}),d=>{if(r(),a.value&&i){o=new ResizeObserver(t);for(const h of d)h&&o.observe(h,s)}},{immediate:!0,flush:"post"}),c=()=>{r(),l()};return Cd(c),{isSupported:a,stop:c}}function B1(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:s=!0,immediate:o=!0,updateTiming:a="sync"}=t,r=u.shallowRef(0),l=u.shallowRef(0),c=u.shallowRef(0),d=u.shallowRef(0),h=u.shallowRef(0),f=u.shallowRef(0),m=u.shallowRef(0),p=u.shallowRef(0);function g(){const _=Ln(e);if(!_){n&&(r.value=0,l.value=0,c.value=0,d.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const x=_.getBoundingClientRect();r.value=x.height,l.value=x.bottom,c.value=x.left,d.value=x.right,h.value=x.top,f.value=x.width,m.value=x.x,p.value=x.y}function y(){a==="sync"?g():a==="next-frame"&&requestAnimationFrame(()=>g())}return N1(e,y),u.watch(()=>Ln(e),_=>!_&&y()),R1(e,y,{attributeFilter:["style","class"]}),s&&Ni("scroll",y,{capture:!0,passive:!0}),i&&Ni("resize",y,{passive:!0}),A1(()=>{o&&y()}),{height:r,bottom:l,left:c,right:d,top:h,width:f,x:m,y:p,update:y}}function F1(e,t){const{top:n,left:i}=B1(e),s=u.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),o=u.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:o}}const z1=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=n).sort((l,c)=>l-c),o=[];if(n-t<e-2)return[];const a=(n-t)/e;let r=0;for(let l=0;l<e;l++){const c=t+l*a,d=t+(l+1)*a;let h=0;for(;r<s.length&&s[r]>=c&&s[r]<=d;)h++,r++;o.push([Math.ceil(c),h])}return o},Pd=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Bi=u.ref({}),U1=e=>(Bi.value[e]||(Bi.value[e]=Pd()),Bi.value[e]),V1=(e,t)=>{const n=Bi.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete Bi.value[t])};function H1({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:s=void 0,minCount:o=void 0,maxCount:a=void 0,renderPoints:r=void 0,type:l}){const d=n!==void 0&&e!==void 0?U1(n):Pd(),h=e!==void 0?e:"static-chart-key",f=u.computed(()=>t.reduce((S,{timestamps:A})=>[...S,...A],[])),m=u.computed(()=>i||f.value.reduce((S,A)=>S===0?A:Math.min(S,A),0)),p=u.computed(()=>s||f.value.reduce((S,A)=>Math.max(S,A),0));u.watchEffect(()=>{d.minStamps[h]=m.value,d.maxStamps[h]=p.value,r!==void 0&&(d.renderPoints[h]=r)});const g=u.computed(()=>Object.values(d.minStamps).reduce((S,A)=>S===0?A:Math.min(S,A),0)),y=u.computed(()=>Object.values(d.maxStamps).reduce((S,A)=>Math.max(S,A),0)),_=u.computed(()=>{const S=Object.values(d.renderPoints);return S.length===0?24:S.reduce((A,L)=>Math.max(A,L),2)}),x=u.computed(()=>{const S=y.value-g.value;return Math.ceil(S/_.value)}),T=u.computed(()=>t.length>1),v=u.computed(()=>t.map(({timestamps:S,color:A,label:L})=>({data:z1({bucketCount:_.value,minStamp:g.value,maxStamp:y.value,timestamps:S}).map(([W,$])=>({x:W,y:$})),label:L,...(l==="sparkline_bar"||T.value)&&A&&{backgroundColor:A},...l!=="sparkline_bar"&&A&&{borderColor:A},...T.value&&l!=="sparkline_bar"&&{fill:!0}}))),w=u.computed(()=>{const S=v.value[0]?.data?.length??0,A=[];for(let L=0;L<S;L++){let R=0;for(let H=0;H<v.value.length;H++)R+=v.value[H].data[L].y;A.push(R)}return A}),M=u.computed(()=>{const S=w.value.reduce((A,L)=>Math.max(A,L),0);return Math.max(S,a??0)}),D=u.computed(()=>{const S=v.value.reduce((R,{data:H})=>[...R,...H.map(({y:W})=>W)],[]),A=S.length?S[0]:0,L=S.reduce((R,H)=>Math.min(R,H),A);return o===void 0?L:Math.min(L,o)});u.watchEffect(()=>{d.maxCounts[h]=M.value,d.minCounts[h]=D.value});const P=u.computed(()=>{const S=Object.values(d.minCounts),A=S.length?S[0]:0;return S.reduce((L,R)=>Math.min(L,R),A)}),k=u.computed(()=>Object.values(d.maxCounts).reduce((S,A)=>Math.max(S,A),0));return u.onUnmounted(()=>{e!==void 0&&n!==void 0&&V1(e,n)}),{syncedMinStamp:g,syncedMaxStamp:y,syncedRenderPoints:_,syncedChartDatasets:v,syncedGroupSizeMs:x,syncedMinCount:P,syncedMaxCount:k}}const an=(e,t)=>{if(!e||!t)return;const n=t.toLowerCase();return e[t]??Object.entries(e).find(([i])=>i.toLowerCase()===n)?.[1]},Nn=e=>{if(e==null||e==="")return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},Pa=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Ea=(e,t)=>t.sum>0?e/t.sum:null,Ed=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},Ra=(e,t)=>{const n=(t??[]).filter(o=>e>=o.value);if(!n.length)return;const i=Math.max(...n.map(o=>o.value));return n.filter(o=>o.value===i).some(o=>o.type==="error")?"error":"warning"},Rd=18,$1=85;function Y1(e,t,n,i){const{i18n:s}=Jl(),{formatUnit:o}=oe({i18n:s}),a=w=>w.map(M=>{const D=Math.min(M.ratio,.5)/.5;return{...M,color:ii({metric:n.value}),tint:`${Rd+D*($1-Rd)}%`}}),r=u.computed(()=>e.value?.data??[]),l=u.computed(()=>e.value?.meta?.metric_names??[]),c=u.computed(()=>{const w=n.value;return w&&l.value.includes(w)?w:l.value[0]}),d=u.computed(()=>l.value.filter(w=>w!==c.value)),h=u.computed(()=>e.value?.meta?.display?.[t.value]??{}),f=(w,M)=>{if(zi(w)||w==="count"||w==="requests")return"";const D=M===1?"":"s";return s.te(`chartUnits.${w}`)?s.t(`chartUnits.${w}`,{plural:D}):w},m=w=>{const M=D=>o(D,"%",{translateUnit:P=>f(P,D)});return w>0&&w<.01?`< ${M(.01)}`:M(w)},p=(w,M)=>{if(w===null)return"–";const D=e.value?.meta?.metric_units?.[M]||"count";return D==="%"?m(w):o(w,D,{isBytes1024:!0,translateUnit:P=>f(P,w)})},g=w=>s.te(`chartLabels.${w}`)?s.t(`chartLabels.${w}`):w,y=w=>an(i.value,w)?.label||g(w),_=u.computed(()=>Pa(r.value.map(w=>c.value?Nn(w.event[c.value]):null))),x=w=>d.value.flatMap(M=>{const D=Nn(w[M]);if(D===null)return[];const P=Ra(D,an(i.value,M)?.thresholds);return[{key:M,label:y(M),value:p(D,M),threshold:P}]}),T=u.computed(()=>{if(!c.value)return[];const w=r.value.map(M=>{const D=M.event,P=String(D[t.value]),k=Nn(D[c.value])??0,S=Ea(k,_.value),A=S??0,L=P===Aa;return{id:P,name:L?g(Aa):h.value[P]?.name||P,deleted:!!h.value[P]?.deleted,isOther:L,isEmpty:P===T1,value:k,ratio:A,display:p(k,c.value),relative:S===null?"":m(S*100),tooltipRows:x(D)}}).sort((M,D)=>Number(M.isOther)-Number(D.isOther)||D.value-M.value);return a(w)});return{column:u.computed(()=>({dimension:t.value,label:y(t.value),total:p(_.value.sum,c.value??"count"),cells:T.value})),cells:T,sizeKey:c}}const q={useBarChartOptions:Zv,useChartJSCommon:Jv,useChartLegendValues:e1,useExploreResultToDatasets:l1,useExploreResultToTimeDataset:h1,useScatterDatasets:_1,useDonutChartOptions:n1,useLineChartOptions:i1,useScatterChartOptions:a1,useI18n:Jl,useReportChartDataForSynthetics:x1,useTranslatedUnits:w1,useEvaluateFeatureFlag:S1,useTooltipAbsolutePosition:F1,useSparklineSync:H1,useTopTalkersData:Y1},Ws=e=>["interactive","zoom-interactive"].includes(e),Ia=(e,t,n,i)=>{const{tooltip:s}=t;if(s.opacity===0&&!Ws(e.interactionMode)){e.showTooltip=!1;return}const{i18n:o}=q.useI18n(),{formatUnit:a}=oe({i18n:o}),r=e.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!Ws(e.interactionMode)){const l=s.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",d=s.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(d,n,s.dataPoints[0].raw):zn({tickValue:new Date(d),granularity:n}),e.tooltipSeries=s.dataPoints.map((f,m)=>{const p=f.parsed[c],g=f.dataset.unit??e.units,y=a(p??0,g,{translateUnit:e.translateUnit}),_=f.raw?.tooltipLabel||f.dataset.label;return{backgroundColor:l[m].backgroundColor,borderColor:l[m].borderColor,label:_,value:y,rawValue:p,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(r);const h=s.dataPoints[0]?.raw?.extras??[];for(const f of h)e.tooltipSeries.push({label:f.label,value:f.unit?a(Number(f.value)||0,f.unit,{translateUnit:e.translateUnit}):String(f.value),rawValue:Number(f.value)||0,isExtra:!0});e.left=`${s.x}px`,e.top=`${s.y}px`,e.showTooltip=!0}},Id=(e,t)=>{const{tooltip:n}=t,{i18n:i}=q.useI18n(),{formatUnit:s}=oe({i18n:i});if(n.opacity===0&&!Ws(e.interactionMode)){e.showTooltip=!1;return}const o=e.chartTooltipSortFn||((a,r)=>r.rawValue-a.rawValue);if(n.body&&!Ws(e.interactionMode)){const a=n.labelColors,r=t.chart.config?.options?.indexAxis==="y"?"x":"y",l=["gauge","donut"].includes(e.chartType);l?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((c,d)=>{const h=l?c.parsed:c.parsed[r],f=s(h??0,e.units,{translateUnit:e.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:a[d].backgroundColor,borderColor:a[d].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(o),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},W1=e=>e&&e.datasets&&e.datasets.length,j1=e=>W1(e)&&e.datasets.some(t=>t.data.length),q1=e=>e.datasets.some(t=>t.data[0]&&Eo(t.data[0].x)),G1=e=>!!j1(e)&&e.datasets.some(t=>t.data.length==1),X1=e=>q1(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),js=(e,t,n)=>{const s=Math.min(t/1150,1),o=.15,a=1.15,r=e.x??0;return r<n?r+t*o*(1-s):r-t*a*(1-s)},Ld=(e,t,n)=>{const o=e.y??0;return o<n?o+t*.15:o-t*.5};function Nd(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const La=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(s=>!t?.[s.text]?.isThreshold).map(((s,o)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[o].isSegmentEmpty}))).sort(n)},K1=2,Bd=10,Fd=12,qs=10,Gs="y",Na="y1",he=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ba=(e,t)=>(t||he)[e%he.length],Z1="#6f7787",Q1={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"}},J1=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return Q1[t]?.background||"#fafafa"},tM=Ey,Fa=(e,t,n,i)=>{let s;return n?s=tM:Array.isArray(i)?s=Ba(e,i):s=i[t],s||Ba(e)},za=e=>{switch(e){case"error":return Ry;case"warning":return By;case"neutral":return xl;default:return xl}},eM={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},nM=2,iM=0,Ua=new Map,zd=(e,t)=>{const{i18n:n}=q.useI18n(),{formatBytes:i}=oe({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):ss.format(e)},sM=e=>{const n=document.createElement("canvas").getContext("2d"),i=wt({});return n.font=i.string,n.measureText(e).width},oM=()=>{const e="label_height";if(!Ua.has(e)){const t=wt({});Ua.set(e,t.lineHeight)}return Ua.get(e)},aM=(e,t)=>t.datasets.reduce((n,i,s)=>e.isDatasetVisible(s)?n+i.data.reduce((o,a)=>isNaN(a)?o:o+a,0):n,0),rM=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,lM=Py,cM={100:Uy,101:Vy,102:Hy,103:$y,200:Yy,201:Wy,202:jy,203:qy,204:Gy,205:Xy,206:Ky,207:Zy,208:Qy,226:Jy,300:t0,301:e0,302:n0,303:i0,304:s0,305:o0,307:a0,308:r0,400:l0,401:c0,402:u0,403:d0,404:h0,405:f0,406:m0,407:p0,408:g0,409:y0,410:b0,411:_0,412:x0,413:w0,414:k0,415:T0,416:S0,417:v0,418:M0,421:D0,422:C0,423:O0,424:A0,425:P0,426:E0,428:R0,429:I0,431:L0,451:N0,500:B0,501:F0,502:z0,503:U0,504:V0,505:H0,506:$0,507:Y0,508:W0,510:j0,511:q0},uM={100:G0,200:X0,300:K0,400:Z0,500:Q0},dM={"1XX":J0,"2XX":tb,"3XX":eb,"4XX":nb,"5XX":ib},Ud=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return cM[t]??uM[n]??lM},Va={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=Ud(`${t}`),e),{}),____OTHER____:Ay,...dM};function Vd(e,t,n){const i=Yl(),s=mM(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?hM(s,t):fM(s,t)}function hM(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function fM(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function mM(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function pM(e,t){const n=xM(t);return"formatToParts"in n?yM(n,e):bM(n,e)}const gM={year:0,month:1,day:2,hour:3,minute:4,second:5};function yM(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=gM[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function bM(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 Ha={},Hd=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")),_M=Hd==="06/25/2014, 00:00:00"||Hd==="06/25/2014 00:00:00";function xM(e){return Ha[e]||(Ha[e]=_M?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ha[e]}function $d(e,t,n,i,s,o,a){const r=new Date(0);return r.setUTCFullYear(e,t,n),r.setUTCHours(i,s,o,a),r}const Yd=36e5,wM=6e4,$a={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ya(e,t,n){if(!e)return 0;let i=$a.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=$a.timezoneHH.exec(e),i)return s=parseInt(i[1],10),Wd(s)?-(s*Yd):NaN;if(i=$a.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Wd(s,a)?(o=Math.abs(s)*Yd+a*wM,i[1]==="+"?-o:o):NaN}if(SM(e)){t=new Date(t||Date.now());const a=n?t:kM(t),r=Wa(a,e);return-(n?r:TM(t,r,e))}return NaN}function kM(e){return $d(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Wa(e,t){const n=pM(e,t),i=$d(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function TM(e,t,n){let s=e.getTime()-t;const o=Wa(new Date(s),n);if(t===o)return t;s-=o-t;const a=Wa(new Date(s),n);return o===a?o:Math.max(o,a)}function Wd(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const jd={};function SM(e){if(jd[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),jd[e]=!0,!0}catch{return!1}}const vM=60*1e3,MM={X:function(e,t,n){const i=ja(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return qd(i);case"XXXX":case"XX":return Bn(i);default:return Bn(i,":")}},x:function(e,t,n){const i=ja(n.timeZone,e);switch(t){case"x":return qd(i);case"xxxx":case"xx":return Bn(i);default:return Bn(i,":")}},O:function(e,t,n){const i=ja(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+DM(i,":");default:return"GMT"+Bn(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Vd("short",e,n);default:return Vd("long",e,n)}}};function ja(e,t){const n=e?Ya(e,t,!0)/vM:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Xs(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Bn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Xs(Math.floor(i/60),2),o=Xs(Math.floor(i%60),2);return n+s+t+o}function qd(e,t){return e%60===0?(e>0?"-":"+")+Xs(Math.abs(e)/60,2):Bn(e,t)}function DM(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Xs(o,2)}function Gd(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const CM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,qa=36e5,Xd=6e4,OM=2,Wt={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:CM};function Kd(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?OM:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=AM(e),{year:s,restDateString:o}=PM(i.date,n),a=EM(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const r=a.getTime();let l=0,c;if(i.time&&(l=RM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ya(i.timeZone||t.timeZone,new Date(r+l)),isNaN(c))return new Date(NaN)}else c=Gd(new Date(r+l)),c=Gd(new Date(r+l+c));return new Date(r+l+c)}else return new Date(NaN)}function AM(e){const t={};let n=Wt.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Wt.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=Wt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function PM(e,t){if(e){const n=Wt.YYY[t],i=Wt.YYYYY[t];let s=Wt.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=Wt.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function EM(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=Wt.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,Jd(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=Wt.DDD.exec(e),o){n=new Date(0);const a=parseInt(o[1],10);return NM(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(o=Wt.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return Jd(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(o=Wt.Www.exec(e),o)return s=parseInt(o[1],10)-1,th(s)?Zd(t,s):new Date(NaN);if(o=Wt.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return th(s,a)?Zd(t,s,a):new Date(NaN)}return null}function RM(e){let t,n,i=Wt.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*qa:NaN;if(i=Wt.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Ga(t,n)?t%24*qa+n*Xd:NaN;if(i=Wt.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,n,s)?t%24*qa+n*Xd+s*1e3:NaN}return null}function Zd(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const IM=[31,28,31,30,31,30,31,31,30,31,30,31],LM=[31,29,31,30,31,30,31,31,30,31,30,31];function Qd(e){return e%400===0||e%4===0&&e%100!==0}function Jd(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Qd(e);if(i&&n>LM[t]||!i&&n>IM[t])return!1}return!0}function NM(e,t){if(t<1)return!1;const n=Qd(e);return!(n&&t>366||!n&&t>365)}function th(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ga(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const BM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function FM(e,t,n={}){t=String(t);const i=t.match(BM);if(i){const s=Kd(n.originalDate||e,n);t=i.reduce(function(o,a){if(a[0]==="'")return o;const r=o.indexOf(a),l=o[r-1]==="'",c=o.replace(a,"'"+MM[a[0]](s,a,n)+"'");return l?c.substring(0,r-1)+c.substring(r+1):c},t)}return rs(e,t,n)}function zM(e,t,n){e=Kd(e,n);const i=Ya(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Fi(e,t,n,i){return i={...i,timeZone:t,originalDate:e},FM(zM(e,t,{timeZone:i.timeZone}),n,i)}const UM=(e,t)=>`${Fi(e,t,"yyyy")} W${Fi(e,t,"II")}`,Xa="MMM dd, h:mm:ss a",Ka="h:mm:ss a",rn="MMM dd, h:mm a",Fn="h:mm a",VM="MMM dd",Za="MMM dd, h:mm:ss a",Ue="MMM dd, h:mm a",HM={secondly:e=>e?Xa:Ka,tenSecondly:e=>e?Xa:Ka,thirtySecondly:e=>e?Xa:Ka,minutely:e=>e?rn:Fn,fiveMinutely:e=>e?rn:Fn,tenMinutely:e=>e?rn:Fn,thirtyMinutely:e=>e?rn:Fn,hourly:e=>e?rn:Fn,twoHourly:e=>e?rn:Fn,twelveHourly:()=>rn,daily:()=>VM},$M={secondly:()=>Za,tenSecondly:()=>Za,thirtySecondly:()=>Za,minutely:()=>Ue,fiveMinutely:()=>Ue,tenMinutely:()=>Ue,thirtyMinutely:()=>Ue,hourly:()=>Ue,twoHourly:()=>Ue,twelveHourly:()=>Ue,daily:()=>Ue};function eh({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:o,defaultFormat:a}){const r=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return UM(e,r);if(s&&s[t]){const l=s[t](i);return Fi(e,r,l)}if(o&&o[t]){const l=o[t]();return Fi(e,r,l)}return Fi(e,r,a)}const nh=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>eh({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:HM,defaultFormat:"MMM dd, h:mm:ss a"}),zn=({tickValue:e,granularity:t,timezone:n})=>eh({tickValue:e,granularity:t,timezone:n,tooltipMap:$M,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),ih=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",YM=e=>{const{i18n:t}=q.useI18n();return ih(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.message==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},zi=e=>e.toLocaleLowerCase().endsWith("count"),WM=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},jM=(e,t)=>{if(!e.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(e.length-1),s=Math.floor(i),o=Math.ceil(i);return s===o?e[s]:e[s]+(e[o]-e[s])*(i-s)},qM=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,s)=>i-s);return new Map(t.map(i=>[i,jM(n,i)]))},sh=.7,Qa=(e,t)=>{const n=xs(e.trim());return n.valid?n.alpha(t).rgbString():e},Ja=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:wl,outlier:bl,outlierBand:Qa(_l,sh)};const n=window.getComputedStyle(t),i=(s,o)=>n.getPropertyValue(s).trim()||o;return{medianLine:i("--kui-color-text",wl),outlier:i("--kui-color-background-danger",bl),outlierBand:Qa(i("--kui-color-background-danger-weakest",_l),sh)}},GM="empty",oh=e=>{if(!e||!("meta"in e)||!("data"in e))return;const{display:t,metric_names:n,metric_units:i,start:s,end:o,truncated:a,limit:r,datasource:l}=e.meta;if(!n?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const c=n.length>1?n[0]:void 0,d=c?n[1]:n[0],h=t&&Object.keys(t)[0]||void 0,f=e.data??[],m=[];for(const p of f){const g=rh(p.timestamp,p.event[d],h?p.event[h]:void 0);if(g){if(c){const y=ah(p.event[c]);if(y===void 0)continue;g.x=y}m.push(g)}}return{points:m,metric:d,metricUnit:i?.[d],...c?{xMetric:c,xMetricUnit:i?.[c]}:{},dimension:h,display:h?t?.[h]:void 0,start:s,end:o,truncated:a,limit:r,datasource:l}},ah=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},rh=(e,t,n,i)=>{const s=new Date(e).valueOf(),o=ah(t);if(!Number.isFinite(s)||o===void 0)return;const a=i?.length?{extras:i}:{};return n===void 0?{timestamp:s,value:o,...a}:{timestamp:s,value:o,group:n!==null&&n!==""?String(n):GM,...a}},XM=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:s,label:o,unit:a}of n){const r=ln(e,s)??ln(t,s);r==null||r===""||i.push({label:o??s,value:r,...a?{unit:a}:{}})}return i.length?i:void 0},KM=(e,t)=>{if(!e||!("meta"in e))return;const{metric:n,dimension:i,unroll:s,display:o,extraFields:a,metricUnit:r}=t,l=t.timestamp??"request_start";if(!n){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const c=[];for(const d of e.results??[]){const h=ln(d,l);for(const f of ZM(d,s)){const m=ln(f,n),p=i?ln(f,i)??ln(d,i):void 0,g=rh(h,m,i?p??null:void 0,XM(f,d,a));g&&c.push(g)}}return{points:c,metric:n,metricUnit:r,dimension:i,display:o,start:e.meta?.time_range?.start,end:e.meta?.time_range?.end,truncated:e.truncated,limit:e.limit,datasource:"requests"}},ZM=(e,t)=>{if(!t)return[e];const n=ln(e,t);return Array.isArray(n)?n:[]},ln=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},lh=e=>Object.hasOwn(Ql.chartLabels,e),QM=["hidden","single","full"],JM=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],tD=["gauge","top_n","single_value"],tr=e=>e===null||typeof e!="object"||!("points"in e)?!1:Array.isArray(e.points);var It=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(It||{});const ch={modes:{point(e,t){return Ks(e,t,{intersect:!0})},nearest(e,t,n){return iD(e,t,n)},x(e,t,n){return Ks(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return Ks(e,t,{intersect:n.intersect,axis:"y"})}}};function er(e,t,n){return(ch.modes[n.mode]||ch.modes.nearest)(e,t,n)}function eD(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function nD(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function Ks(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):eD(i,t,n.axis))}function iD(e,t,n){let i=Number.POSITIVE_INFINITY;return Ks(e,t,n).reduce((s,o)=>{const a=o.getCenterPoint(),r=nD(t,a,n.axis),l=Cn(t,r);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function cn(e,t,n){const i=Math.cos(n),s=Math.sin(n),o=t.x,a=t.y;return{x:o+i*(e.x-o)-s*(e.y-a),y:a+s*(e.x-o)+i*(e.y-a)}}const sD=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,un=.001,Zs=(e,t,n)=>Math.min(n,Math.max(t,e)),uh=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function oD(e,t,n){for(const i of Object.keys(e))e[i]=Zs(e[i],t,n);return e}function aD(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function dh(e,{x:t,y:n,x2:i,y2:s},o,{borderWidth:a,hitTolerance:r}){const l=(a+r)/2,c=e.x>=t-l-un&&e.x<=i+l+un,d=e.y>=n-l-un&&e.y<=s+l+un;return o==="x"?c:(o==="y"||c)&&d}function hh(e,{rect:t,center:n},i,{rotation:s,borderWidth:o,hitTolerance:a}){const r=cn(e,n,Ot(-s));return dh(r,t,i,{borderWidth:o,hitTolerance:a})}function dn(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function rD(e,t,n,i=!0){const s=n.split(".");let o=0;for(const a of t.split(".")){const r=s[o++];if(parseInt(a,10)<parseInt(r,10))break;if(sD(r,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const fh=e=>typeof e=="string"&&e.endsWith("%"),mh=e=>parseFloat(e)/100,ph=e=>Zs(mh(e),0,1),Ui=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),lD={box:e=>Ui(e.centerX,e.centerY),doughnutLabel:e=>Ui(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Ui(e.centerX,e.centerY),line:e=>Ui(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Ui(e.centerX,e.centerY)};function nr(e,t){return t==="start"?0:t==="end"?e:fh(t)?ph(t)*e:e/2}function Ve(e,t,n=!0){return typeof t=="number"?t:fh(t)?(n?ph(t):mh(t))*e:e}function cD(e,t){const{x:n,width:i}=e,s=t.textAlign;return s==="center"?n+i/2:s==="end"||s==="right"?n+i:n}function gh(e,t,{borderWidth:n,position:i,xAdjust:s,yAdjust:o},a){const r=st(a),l=t.width+(r?a.width:0)+n,c=t.height+(r?a.height:0)+n,d=ir(i),h=xh(e.x,l,s,d.x),f=xh(e.y,c,o,d.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 ir(e,t="center"){return st(e)?{x:Q(e.x,t),y:Q(e.y,t)}:(e=Q(e,t),{x:e,y:e})}const yh=(e,t)=>e&&e.autoFit&&t<1;function bh(e,t){const n=e.font,i=dt(n)?n:[n];return yh(e,t)?i.map(function(s){const o=wt(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,wt(o)}):i.map(s=>wt(s))}function _h(e){return e&&(qt(e.xValue)||qt(e.yValue))}function xh(e,t,n=0,i){return e-nr(t,i)+n}function Un(e,t,n){const i=n.init;if(i){if(i===!0)return kh(t,n)}else return;return uD(e,t,n)}function wh(e,t,n){let i=!1;return t.forEach(s=>{Gt(e[s])?(i=!0,n[s]=e[s]):qt(n[s])&&delete n[s]}),i}function kh(e,t){const n=t.type||"line";return lD[n](e)}function uD(e,t,n){const i=mt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return kh(t,n);if(st(i))return i}const sr=new Map,dD=e=>isNaN(e)||e<=0,hD=e=>e.reduce(function(t,n){return t+=n.string,t},"");function Qs(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Js(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(Ot(i)),e.translate(-t,-n))}function ke(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function Vn(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function to(e,t){const n=t.content;if(Qs(n))return{width:Ve(n.width,t.width),height:Ve(n.height,t.height)};const i=bh(t),s=t.textStrokeWidth,o=dt(n)?n:[n],a=o.join()+hD(i)+s+(e._measureText?"-spriting":"");return sr.has(a)||sr.set(a,gD(e,o,i,s)),sr.get(a)}function Th(e,t,n){const{x:i,y:s,width:o,height:a}=t;e.save(),Vn(e,n);const r=ke(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),On(e,{x:i,y:s,w:o,h:a,radius:oD(Ie(n.borderRadius),0,Math.min(o,a)/2)}),e.closePath(),e.fill(),r&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function Sh(e,t,n,i){const s=n.content;if(Qs(s)){e.save(),e.globalAlpha=_D(n.opacity,s.style.opacity),e.drawImage(s,t.x,t.y,t.width,t.height),e.restore();return}const o=dt(s)?s:[s],a=bh(n,i),r=n.color,l=dt(r)?r:[r],c=cD(t,n),d=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,fD(e,n)&&yD(e,{x:c,y:d},o,a),bD(e,{x:c,y:d},o,{fonts:a,colors:l}),e.restore()}function fD(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function mD(e,t,n,i){const{radius:s,options:o}=t,a=o.pointStyle,r=o.rotation;let l=(r||0)*qo;if(Qs(a)){e.save(),e.translate(n,i),e.rotate(l),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}dD(s)||pD(e,{x:n,y:i,radius:s,rotation:r,style:a,rad:l})}function pD(e,{x:t,y:n,radius:i,rotation:s,style:o,rad:a}){let r,l,c,d;switch(e.beginPath(),o){default:e.arc(t,n,i,0,yt),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":d=i*.516,c=i-d,r=Math.cos(a+se)*c,l=Math.sin(a+se)*c,e.arc(t-r,n-l,d,a-it,a-bt),e.arc(t+l,n-r,d,a-bt,a),e.arc(t+r,n+l,d,a,a+bt),e.arc(t-l,n+r,d,a+bt,a+it),e.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,e.rect(t-c,n-c,2*c,2*c);break}a+=se;case"rectRot":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+l,n-r),e.lineTo(t+r,n+l),e.lineTo(t-l,n+r),e.closePath();break;case"crossRot":a+=se;case"cross":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r);break;case"star":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r),a+=se,r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r);break;case"line":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function gD(e,t,n,i){e.save();const s=t.length;let o=0,a=i;for(let r=0;r<s;r++){const l=n[Math.min(r,n.length-1)];e.font=l.string;const c=t[r];o=Math.max(o,e.measureText(c).width+i),a+=l.lineHeight}return e.restore(),{width:o,height:a}}function yD(e,{x:t,y:n},i,s){e.beginPath();let o=0;i.forEach(function(a,r){const l=s[Math.min(r,s.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(a,t,n+c/2+o),o+=c}),e.stroke()}function bD(e,{x:t,y:n},i,{fonts:s,colors:o}){let a=0;i.forEach(function(r,l){const c=o[Math.min(l,o.length-1)],d=s[Math.min(l,s.length-1)],h=d.lineHeight;e.beginPath(),e.font=d.string,e.fillStyle=c,e.fillText(r,t,n+h/2+a),a+=h,e.fill()})}function _D(e,t){const n=Re(e)?e:t;return Re(n)?Zs(n,0,1):1}const vh=["left","bottom","top","right"];function xD(e,t){const{pointX:n,pointY:i,options:s}=t,o=s.callout,a=o&&o.display&&vD(t,o);if(!a||DD(t,o,a))return;if(e.save(),e.beginPath(),!ke(e,o))return e.restore();const{separatorStart:l,separatorEnd:c}=wD(t,a),{sideStart:d,sideEnd:h}=TD(t,a,l);(o.margin>0||s.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(d.x,d.y),e.lineTo(h.x,h.y);const f=cn({x:n,y:i},t.getCenterPoint(),Ot(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function wD(e,t){const{x:n,y:i,x2:s,y2:o}=e,a=kD(e,t);let r,l;return t==="left"||t==="right"?(r={x:n+a,y:i},l={x:r.x,y:o}):(r={x:n,y:i+a},l={x:s,y:r.y}),{separatorStart:r,separatorEnd:l}}function kD(e,t){const{width:n,height:i,options:s}=e,o=s.callout.margin+s.borderWidth/2;return t==="right"?n+o:t==="bottom"?i+o:-o}function TD(e,t,n){const{y:i,width:s,height:o,options:a}=e,r=a.callout.start,l=SD(t,a.callout);let c,d;return t==="left"||t==="right"?(c={x:n.x,y:i+Ve(o,r)},d={x:c.x+l,y:c.y}):(c={x:n.x+Ve(s,r),y:n.y},d={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:d}}function SD(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function vD(e,t){const n=t.position;return vh.includes(n)?n:MD(e,t)}function MD(e,t){const{x:n,y:i,x2:s,y2:o,width:a,height:r,pointX:l,pointY:c,centerX:d,centerY:h,rotation:f}=e,m={x:d,y:h},p=t.start,g=Ve(a,p),y=Ve(r,p),_=[n,n+g,n+g,s],x=[i+y,o,i,o],T=[];for(let v=0;v<4;v++){const w=cn({x:_[v],y:x[v]},m,Ot(f));T.push({position:vh[v],distance:Cn(w,{x:l,y:c})})}return T.sort((v,w)=>v.distance-w.distance)[0].position}function DD(e,t,n){const{pointX:i,pointY:s}=e,o=t.margin;let a=i,r=s;return n==="left"?a+=o:n==="right"?a-=o:n==="top"?r+=o:n==="bottom"&&(r-=o),e.inRange(a,r)}const Mh={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 Hn(e,t,n){return t=typeof t=="number"?t:e.parse(t),xt(t)?e.getPixelForValue(t):n}function hn(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const s=n.charAt(0),o=Object.values(e).filter(a=>a.axis&&a.axis===s);return o.length?o[0].id:s}function Dh(e,t){if(e){const n=e.options.reverse,i=Hn(e,t.min,n?t.end:t.start),s=Hn(e,t.max,n?t.start:t.end);return{start:i,end:s}}}function Ch(e,t){const{chartArea:n,scales:i}=e,s=i[hn(i,t,"xScaleID")],o=i[hn(i,t,"yScaleID")];let a=n.width/2,r=n.height/2;return s&&(a=Hn(s,t.xValue,s.left+s.width/2)),o&&(r=Hn(o,t.yValue,o.top+o.height/2)),{x:a,y:r}}function or(e,t){const n=e.scales,i=n[hn(n,t,"xScaleID")],s=n[hn(n,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:a}=i||e.chartArea,{top:r,bottom:l}=s||e.chartArea;const c=Ph(i,{min:t.xMin,max:t.xMax,start:o,end:a});o=c.start,a=c.end;const d=Ph(s,{min:t.yMin,max:t.yMax,start:l,end:r});return r=d.start,l=d.end,{x:o,y:r,x2:a,y2:l,width:a-o,height:l-r,centerX:o+(a-o)/2,centerY:r+(l-r)/2}}function Oh(e,t){if(!_h(t)){const n=or(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const s=i*2,o=n.centerX+t.xAdjust,a=n.centerY+t.yAdjust;return{x:o-i,y:a-i,x2:o+i,y2:a+i,centerX:o,centerY:a,width:s,height:s,radius:i}}return OD(e,t)}function CD(e,t){const{scales:n,chartArea:i}=e,s=n[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?AD(s,o,t):PD(n,o,t),o}function Ah(e,t){const n=or(e,t);return n.initProperties=Un(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:ID(e,n,t),initProperties:n.initProperties}],n}function OD(e,t){const n=Ch(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Ph(e,t){const n=Dh(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function AD(e,t,n){const i=Hn(e,n.value,NaN),s=Hn(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function PD(e,t,n){for(const i of Object.keys(Mh)){const s=e[hn(e,n,i)];if(s){const{min:o,max:a,start:r,end:l,startProp:c,endProp:d}=Mh[i],h=Dh(s,{min:n[o],max:n[a],start:s[r],end:s[l]});t[c]=h.start,t[d]=h.end}}}function ED({properties:e,options:t},n,i,s){const{x:o,x2:a,width:r}=e;return Eh({start:o,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:n.width})}function RD({properties:e,options:t},n,i,s){const{y:o,y2:a,height:r}=e;return Eh({start:o,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:n.height})}function Eh(e,t){const{start:n,end:i,borderWidth:s}=e,{position:o,padding:{start:a,end:r},adjust:l}=t,c=i-s-n-a-r-t.size;return n+s/2+l+nr(c,o)}function ID(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const s=ir(i.position),o=At(i.padding),a=to(e.ctx,i),r=ED({properties:t,options:n},a,s,o),l=RD({properties:t,options:n},a,s,o),c=a.width+o.width,d=a.height+o.height;return{x:r,y:l,x2:r+c,y2:l+d,width:c,height:d,centerX:r+c/2,centerY:l+d/2,rotation:i.rotation}}const ar=["enter","leave"],rr=ar.concat("click");function LD(e,t,n){t.listened=wh(n,rr,t.listeners),t.moveListened=!1,ar.forEach(i=>{Gt(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Gt(i.click)&&(t.listened=!0),t.moveListened||ar.forEach(s=>{Gt(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function ND(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return BD(e,t,n);case"click":return FD(e,t,n)}}function BD(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=er(e.visibleElements,t,n.interaction):i=[];const s=e.hovered;e.hovered=i;const o={state:e,event:t};let a=Rh(o,"leave",s,i);return Rh(o,"enter",i,s)||a}function Rh({state:e,event:t},n,i,s){let o;for(const a of i)s.indexOf(a)<0&&(o=Ih(a.options[n]||e.listeners[n],a,t)||o);return o}function FD(e,t,n){const i=e.listeners,s=er(e.visibleElements,t,n.interaction);let o;for(const a of s)o=Ih(a.options.click||i.click,a,t)||o;return o}function Ih(e,t,n){return mt(e,[t.$context,n])===!0}const eo=["afterDraw","beforeDraw"];function zD(e,t,n){const i=t.visibleElements;t.hooked=wh(n,eo,t.hooks),t.hooked||i.forEach(s=>{t.hooked||eo.forEach(o=>{Gt(s.options[o])&&(t.hooked=!0)})})}function Lh(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return mt(i,[t.$context])}}function UD(e,t,n){const i=WD(e.scales,t,n);let s=Nh(t,i,"min","suggestedMin");s=Nh(t,i,"max","suggestedMax")||s,s&&Gt(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function VD(e,t){for(const n of e)$D(n,t)}function Nh(e,t,n,i){if(xt(t[n])&&!HD(e.options,n,i)){const s=e[n]!==t[n];return e[n]=t[n],s}}function HD(e,t,n){return qt(e[t])||qt(e[n])}function $D(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=hn(t,e,n);i&&!t[i]&&YD(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function YD(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(qt(e[n+i]))return!0;return!1}function WD(e,t,n){const i=t.axis,s=t.id,o=i+"ScaleID",a={min:Q(t.min,Number.NEGATIVE_INFINITY),max:Q(t.max,Number.POSITIVE_INFINITY)};for(const r of n)r.scaleID===s?Bh(r,t,["value","endValue"],a):hn(e,r,o)===s&&Bh(r,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Bh(e,t,n,i){for(const s of n){const o=e[s];if(qt(o)){const a=t.parse(o);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class $n extends Vt{inRange(t,n,i,s){const{x:o,y:a}=cn({x:t,y:n},this.getCenterPoint(s),Ot(-this.options.rotation));return dh({x:o,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return dn(this,t)}draw(t){t.save(),Js(t,this.getCenterPoint(),this.options.rotation),Th(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return Ah(t,n)}}$n.id="boxAnnotation",$n.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},$n.defaultRoutes={borderColor:"color",backgroundColor:"color"},$n.descriptors={label:{_fallback:!0}};class no extends Vt{inRange(t,n,i,s){return hh({x:t,y:n},{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 dn(this,t)}draw(t){const n=this.options;!n.display||!n.content||(ZD(t,this),t.save(),Js(t,this.getCenterPoint(),this.rotation),Sh(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=jD(t,n);if(!i)return{};const{controllerMeta:s,point:o,radius:a}=GD(t,n,i);let r=to(t.ctx,n);const l=XD(r,a);yh(n,l)&&(r={width:r.width*l,height:r.height*l});const{position:c,xAdjust:d,yAdjust:h}=n,f=gh(o,r,{borderWidth:0,position:c,xAdjust:d,yAdjust:h});return{initProperties:Un(t,f,n),...f,...s,rotation:n.rotation,_fitRatio:l}}}no.id="doughnutLabelAnnotation",no.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},no.defaultRoutes={};function jD(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const s=i.controller;return s instanceof Si&&qD(e,t,i.data)&&(!n||s.innerRadius<n.controller.innerRadius)&&s.options.circumference>=90?i:n},void 0)}function qD(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function GD({chartArea:e},t,n){const{left:i,top:s,right:o,bottom:a}=e,{innerRadius:r,offsetX:l,offsetY:c}=n.controller,d=(i+o)/2+l,h=(s+a)/2+c,f={left:Math.max(d-r,i),right:Math.min(d+r,o),top:Math.max(h-r,s),bottom:Math.min(h+r,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,g=r-p,y=m.y>h,_=y?s+p:a-p,x=KD(_,d,h,g);return{controllerMeta:{_centerX:d,_centerY:h,_radius:g,_counterclockwise:y,...x},point:m,radius:Math.min(r,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function XD({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function KD(e,t,n,i){const s=Math.pow(n-e,2),o=Math.pow(i,2),a=t*-2,r=Math.pow(t,2)+s-o,l=Math.pow(a,2)-4*r;if(l<=0)return{_startAngle:0,_endAngle:yt};const c=(-a-Math.sqrt(l))/2,d=(-a+Math.sqrt(l))/2;return{_startAngle:bs({x:t,y:n},{x:c,y:e}).angle,_endAngle:bs({x:t,y:n},{x:d,y:e}).angle}}function ZD(e,t){const{_centerX:n,_centerY:i,_radius:s,_startAngle:o,_endAngle:a,_counterclockwise:r,options:l}=t;e.save();const c=ke(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,i,s,o,a,r),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class Vi extends Vt{inRange(t,n,i,s){return hh({x:t,y:n},{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 dn(this,t)}draw(t){const n=this.options,i=!qt(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),Js(t,this.getCenterPoint(),this.rotation),xD(t,this),Th(t,this,n),Sh(t,QD(this),n),t.restore())}resolveElementProperties(t,n){let i;if(_h(n))i=Ch(t,n);else{const{centerX:r,centerY:l}=or(t,n);i={x:r,y:l}}const s=At(n.padding),o=to(t.ctx,n),a=gh(i,o,n,s);return{initProperties:Un(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}Vi.id="labelAnnotation",Vi.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},Vi.defaultRoutes={borderColor:"color"};function QD({x:e,y:t,width:n,height:i,options:s}){const o=s.borderWidth/2,a=At(s.padding);return{x:e+a.left+o,y:t+a.top+o,width:n-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const lr=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),cr=(e,t,n)=>lr(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Fh=(e,t,n)=>lr(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Hi=e=>e*e,JD=(e,t,{x:n,y:i,x2:s,y2:o},a)=>a==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(n,s),end:Math.max(n,s),value:e},zh=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,ur=(e,t,n,i)=>({x:zh(e.x,t.x,n.x,i),y:zh(e.y,t.y,n.y,i)}),Uh=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),Vh=(e,t,n,i)=>-Math.atan2(Uh(e.x,t.x,n.x,i),Uh(e.y,t.y,n.y,i))+.5*it;class $i extends Vt{inRange(t,n,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:r,ctx:l}=this;if(r){ke(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:d}=this.$context,h=t*d.currentDevicePixelRatio,f=n*d.currentDevicePixelRatio,m=l.isPointInStroke(r,h,f)||dr(this,a,s);return l.restore(),m}const c=Hi(o);return iC(this,a,c,s)||dr(this,a,s)}return tC(this,{mouseX:t,mouseY:n},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return dn(this,t)}draw(t){const{x:n,y:i,x2:s,y2:o,cp:a,options:r}=this;if(t.save(),!ke(t,r))return t.restore();Vn(t,r);const l=Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2));if(r.curve&&a)return dC(t,this,a,l),t.restore();const{startOpts:c,endOpts:d,startAdjust:h,endAdjust:f}=jh(this),m=Math.atan2(o-i,s-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=r.borderShadowColor,t.stroke(),hr(t,0,h,c),hr(t,l,-f,d),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=CD(t,n),{x:s,y:o,x2:a,y2:r}=i,l=eC(i,t.chartArea),c=l?nC({x:s,y:o},{x:a,y:r},t.chartArea):{x:s,y:o,x2:a,y2:r,width:Math.abs(a-s),height:Math.abs(r-o)};if(c.centerX=(a+s)/2,c.centerY=(r+o)/2,c.initProperties=Un(t,c,n),n.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=uC(c,n,Cn(h,f))}const d=sC(t,c,n.label);return d._visible=l,c.elements=[{type:"label",optionScope:"label",properties:d,initProperties:c.initProperties}],c}}$i.id="lineAnnotation";const Hh={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};$i.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Hh),fill:!1,length:12,start:Object.assign({},Hh),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({},Vi.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},$i.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},$i.defaultRoutes={borderColor:"color"};function tC(e,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:o}){const a=JD(t,n,e.getProps(["x","y","x2","y2"],o),i);return uh(a,s)||dr(e,{mouseX:t,mouseY:n},o,i)}function eC({x:e,y:t,x2:n,y2:i},{top:s,right:o,bottom:a,left:r}){return!(e<r&&n<r||e>o&&n>o||t<s&&i<s||t>a&&i>a)}function $h({x:e,y:t},n,{top:i,right:s,bottom:o,left:a}){return e<a&&(t=Fh(a,{x:e,y:t},n),e=a),e>s&&(t=Fh(s,{x:e,y:t},n),e=s),t<i&&(e=cr(i,{x:e,y:t},n),t=i),t>o&&(e=cr(o,{x:e,y:t},n),t=o),{x:e,y:t}}function nC(e,t,n){const{x:i,y:s}=$h(e,t,n),{x:o,y:a}=$h(t,e,n);return{x:i,y:s,x2:o,y2:a,width:Math.abs(o-i),height:Math.abs(a-s)}}function iC(e,{mouseX:t,mouseY:n},i=un,s){const{x:o,y:a,x2:r,y2:l}=e.getProps(["x","y","x2","y2"],s),c=r-o,d=l-a,h=Hi(c)+Hi(d),f=h===0?-1:((t-o)*c+(n-a)*d)/h;let m,p;return f<0?(m=o,p=a):f>1?(m=r,p=l):(m=o+f*c,p=a+f*d),Hi(t-m)+Hi(n-p)<=i}function dr(e,{mouseX:t,mouseY:n},i,s){const o=e.label;return o.options.display&&o.inRange(t,n,s,i)}function sC(e,t,n){const i=n.borderWidth,s=At(n.padding),o=to(e.ctx,n),a=o.width+s.width+i,r=o.height+s.height+i;return aC(t,n,{width:a,height:r,padding:s},e.chartArea)}function oC(e){const{x:t,y:n,x2:i,y2:s}=e,o=Math.atan2(s-n,i-t);return o>it/2?o-it:o<it/-2?o+it:o}function aC(e,t,n,i){const{width:s,height:o,padding:a}=n,{xAdjust:r,yAdjust:l}=t,c={x:e.x,y:e.y},d={x:e.x2,y:e.y2},h=t.rotation==="auto"?oC(e):Ot(t.rotation),f=rC(s,o,h),m=lC(e,t,{labelSize:f,padding:a},i),p=e.cp?ur(c,e.cp,d,m):lr(c,d,m),g={size:f.w,min:i.left,max:i.right,padding:a.left},y={size:f.h,min:i.top,max:i.bottom,padding:a.top},_=Wh(p.x,g)+r,x=Wh(p.y,y)+l;return{x:_-s/2,y:x-o/2,x2:_+s/2,y2:x+o/2,centerX:_,centerY:x,pointX:p.x,pointY:p.y,width:s,height:o,rotation:ys(h)}}function rC(e,t,n){const i=Math.cos(n),s=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*s),h:Math.abs(e*s)+Math.abs(t*i)}}function lC(e,t,n,i){let s;const o=cC(e,i);return t.position==="start"?s=Yh({w:e.x2-e.x,h:e.y2-e.y},n,t,o):t.position==="end"?s=1-Yh({w:e.x-e.x2,h:e.y-e.y2},n,t,o):s=nr(1,t.position),s}function Yh(e,t,n,i){const{labelSize:s,padding:o}=t,a=e.w*i.dx,r=e.h*i.dy,l=a>0&&(s.w/2+o.left-i.x)/a,c=r>0&&(s.h/2+o.top-i.y)/r;return Zs(Math.max(l,c),0,.25)}function cC(e,t){const{x:n,x2:i,y:s,y2:o}=e,a=Math.min(s,o)-t.top,r=Math.min(n,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(n,i);return{x:Math.min(r,c),y:Math.min(a,l),dx:r<=c?1:-1,dy:a<=l?1:-1}}function Wh(e,t){const{size:n,min:i,max:s,padding:o}=t,a=n/2;return n>s-i?(s+i)/2:(i>=e-o-a&&(e=i+o+a),s<=e+o+a&&(e=s-o-a),e)}function jh(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:qh(e,n),endAdjust:qh(e,i)}}function qh(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,s=e.options.borderWidth/2,o={x:n,y:i+s};return Math.abs(cr(0,o,{x:0,y:s}))}function hr(e,t,n,i){if(!i||!i.display)return;const{length:s,width:o,fill:a,backgroundColor:r,borderColor:l}=i,c=Math.abs(t-s)+n;e.beginPath(),Vn(e,i),ke(e,i),e.moveTo(c,-o),e.lineTo(t+n,0),e.lineTo(c,o),a===!0?(e.fillStyle=r||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function uC(e,t,n){const{x:i,y:s,x2:o,y2:a,centerX:r,centerY:l}=e,c=Math.atan2(a-s,o-i),d=ir(t.controlPoint,0),h={x:r+Ve(n,d.x,!1),y:l+Ve(n,d.y,!1)};return cn(h,{x:r,y:l},c)}function Gh(e,{x:t,y:n},{angle:i,adjust:s},o){!o||!o.display||(e.save(),e.translate(t,n),e.rotate(i),hr(e,0,-s,o),e.restore())}function dC(e,t,n,i){const{x:s,y:o,x2:a,y2:r,options:l}=t,{startOpts:c,endOpts:d,startAdjust:h,endAdjust:f}=jh(t),m={x:s,y:o},p={x:a,y:r},g=Vh(m,n,p,0),y=Vh(m,n,p,1)-it,_=ur(m,n,p,h/i),x=ur(m,n,p,1-f/i),T=new Path2D;e.beginPath(),T.moveTo(_.x,_.y),T.quadraticCurveTo(n.x,n.y,x.x,x.y),e.shadowColor=l.borderShadowColor,e.stroke(T),t.path=T,t.ctx=e,Gh(e,_,{angle:g,adjust:h},c),Gh(e,x,{angle:y,adjust:f},d)}class Yi extends Vt{inRange(t,n,i,s){const o=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return hC({x:t,y:n},this.getProps(["width","height","centerX","centerY"],s),o,a);const{x:r,y:l,x2:c,y2:d}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:d}:{start:r,end:c},f=cn({x:t,y:n},this.getCenterPoint(s),Ot(-o));return f[i]>=h.start-a-un&&f[i]<=h.end+a+un}getCenterPoint(t){return dn(this,t)}draw(t){const{width:n,height:i,centerX:s,centerY:o,options:a}=this;t.save(),Js(t,this.getCenterPoint(),a.rotation),Vn(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const r=ke(t,a);t.ellipse(s,o,i/2,n/2,it/2,0,2*it),t.fill(),r&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return Ah(t,n)}}Yi.id="ellipseAnnotation",Yi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},$n.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},Yi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Yi.descriptors={label:{_fallback:!0}};function hC(e,t,n,i){const{width:s,height:o,centerX:a,centerY:r}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const d=Ot(n||0),h=Math.cos(d),f=Math.sin(d),m=Math.pow(h*(e.x-a)+f*(e.y-r),2),p=Math.pow(f*(e.x-a)-h*(e.y-r),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class io extends Vt{inRange(t,n,i,s){const{x:o,y:a,x2:r,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),d=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?aD({x:t,y:n},this.getCenterPoint(s),c/2,d):uh(i==="y"?{start:a,end:l,value:n}:{start:o,end:r,value:t},d)}getCenterPoint(t){return dn(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Vn(t,n);const s=ke(t,n);mD(t,this,this.centerX,this.centerY),s&&!Qs(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=Oh(t,n);return i.initProperties=Un(t,i,n),i}}io.id="pointAnnotation",io.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},io.defaultRoutes={borderColor:"color",backgroundColor:"color"};class so extends Vt{inRange(t,n,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&mC(this.elements,t,n,s);const o=cn({x:t,y:n},this.getCenterPoint(s),Ot(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),r=Math.min(...a),l=Math.max(...a);return o[i]>=r&&o[i]<=l}getCenterPoint(t){return dn(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Vn(t,i);const s=ke(t,i);let o=!0;for(const a of n)o?(t.moveTo(a.x,a.y),o=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=Oh(t,n),{sides:s,rotation:o}=n,a=[],r=2*it/s;let l=o*qo;for(let c=0;c<s;c++,l+=r){const d=fC(i,n,l);d.initProperties=Un(t,i,n),a.push(d)}return i.elements=a,i}}so.id="polygonAnnotation",so.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},so.defaultRoutes={borderColor:"color",backgroundColor:"color"};function fC({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:s},o){const a=(i+s)/2,r=Math.sin(o),l=Math.cos(o),c={x:e+r*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+r*(n+a),bY:t-l*(n+a)}}}function mC(e,t,n,i){let s=!1,o=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const r=a.getProps(["bX","bY"],i);r.bY>n!=o.bY>n&&t<(o.bX-r.bX)*(n-r.bY)/(o.bY-r.bY)+r.bX&&(s=!s),o=r}return s}const He={box:$n,doughnutLabel:no,ellipse:Yi,label:Vi,line:$i,point:io,polygon:so};Object.keys(He).forEach(e=>{_t.describe(`elements.${He[e].id}`,{_fallback:"plugins.annotation.common"})});const pC={update:Object.assign},gC=rr.concat(eo),Xh=(e,t)=>st(t)?pr(e,t):e,fr=e=>e==="color"||e==="font";function mr(e="line"){return He[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function yC(e,t,n,i){const s=_C(e,n.animations,i),o=t.annotations,a=kC(t.elements,o);for(let r=0;r<o.length;r++){const l=o[r],c=Kh(a,r,l.type),d=l.setContext(wC(e,c,a,l)),h=c.resolveElementProperties(e,d);h.skip=bC(h),"elements"in h&&(xC(c,h.elements,d,s),delete h.elements),qt(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=Zh(d),s.update(c,h)}}function bC(e){return isNaN(e.x)||isNaN(e.y)}function _C(e,t,n){return n==="reset"||n==="none"||n==="resize"?pC:new ra(e,t)}function xC(e,t,n,i){const s=e.elements||(e.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const a=t[o],r=a.properties,l=Kh(s,o,a.type,a.initProperties),c=n[a.optionScope].override(a);r.options=Zh(c),i.update(l,r)}}function Kh(e,t,n,i){const s=He[mr(n)];let o=e[t];return(!o||!(o instanceof s))&&(o=e[t]=new s,Object.assign(o,i)),o}function Zh(e){const t=He[mr(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,pr(e,t.defaults),pr(e,t.defaultRoutes));for(const i of gC)n[i]=e[i];return n}function pr(e,t){const n={};for(const i of Object.keys(t)){const s=t[i],o=e[i];fr(i)&&dt(o)?n[i]=o.map(a=>Xh(a,s)):n[i]=Xh(o,s)}return n}function wC(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function kC(e,t){const n=t.length,i=e.length;if(i<n){const s=n-i;e.splice(i,0,...new Array(s))}else i>n&&e.splice(n,i-n);return e}var TC="3.1.0";const $e=new Map,Qh=e=>e.type!=="doughnutLabel",SC=rr.concat(eo);var Jh={id:"annotation",version:TC,beforeRegister(){rD("chart.js","4.0",Xt.version)},afterRegister(){Xt.register(He)},afterUnregister(){Xt.unregister(He)},beforeInit(e){$e.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=$e.get(e),s=i.annotations=[];let o=n.annotations;st(o)?Object.keys(o).forEach(a=>{const r=o[a];st(r)&&(r.id=a,s.push(r))}):dt(o)&&s.push(...o),VD(s.filter(Qh),e.scales)},afterDataLimits(e,t){const n=$e.get(e);UD(e,t.scale,n.annotations.filter(Qh).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=$e.get(e);LD(e,i,n),yC(e,i,n,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),zD(e,i,n)},beforeDatasetsDraw(e,t,n){Wi(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Wi(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Wi(e,t.index,n.clip)},beforeDraw(e,t,n){Wi(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Wi(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=$e.get(e);ND(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){$e.delete(e)},getAnnotations(e){const t=$e.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return er(e,t,n)},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:e=>!SC.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${He[mr(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:fr,_fallback:!0},_indexable:fr}},additionalOptionScopes:[""]};function Wi(e,t,n){const{ctx:i,chartArea:s}=e,o=$e.get(e);n&&xi(i,s);const a=vC(o.visibleElements,t).sort((r,l)=>r.element.options.z-l.element.options.z);for(const r of a)MC(i,s,o,r);n&&wi(i)}function vC(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&n.push({element:s});return n}function MC(e,t,n,i){const s=i.element;i.main?(Lh(n,s,"beforeDraw"),s.draw(e,t),Lh(n,s,"afterDraw")):s.draw(e,t)}const DC={class:"zoom-timerange-container"},CC={class:"zoom-timerange-details"},OC={class:"label","data-testid":"zoom-timerange-from"},AC={class:"label","data-testid":"zoom-timerange-to"},PC=u.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.ref(zn({tickValue:t.start,granularity:t.granularity})),s=u.ref(zn({tickValue:t.end,granularity:t.granularity})),o=(a,r)=>{Nd(()=>{i.value=zn({tickValue:a,granularity:t.granularity}),s.value=zn({tickValue:r,granularity:t.granularity})},100)()};return u.watch(()=>[t.start,t.end],([a,r])=>{o(a,r)},{immediate:!0}),(a,r)=>(u.openBlock(),u.createElementBlock("div",DC,[u.createElementVNode("div",CC,[u.createElementVNode("div",OC,u.toDisplayString(u.unref(n).t("zoom_time_range.from")),1),u.createElementVNode("div",null,u.toDisplayString(i.value),1),u.createElementVNode("div",AC,u.toDisplayString(u.unref(n).t("zoom_time_range.to")),1),u.createElementVNode("div",null,u.toDisplayString(s.value),1)])]))}}),Pt=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},tf=Pt(PC,[["__scopeId","data-v-4fa681cf"]]),EC={class:"zoom-actions-container"},RC={class:"zoom-actions-heading"},IC={class:"zoom-action-select"},LC=["data-testid"],NC=["aria-disabled","href"],BC=["onClick"],FC=Pt(u.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,s=o=>{o.action&&(o.action(n.newTimeRange),i("onAction"))};return(o,a)=>(u.openBlock(),u.createElementBlock("div",EC,[u.createElementVNode("div",RC,[u.createVNode(tf,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),u.createVNode(u.unref(Tt.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${u.unref(kl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`,onClick:a[0]||(a[0]=r=>o.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=u.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),u.createElementVNode("div",IC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.zoomActionItems,r=>(u.openBlock(),u.createElementBlock("div",{key:r.key,class:u.normalizeClass(["zoom-action-item",{disabled:r.disabled}]),"data-testid":`zoom-action-item-${r.key}`},[r.href?(u.openBlock(),u.createElementBlock("a",{key:0,"aria-disabled":r.disabled,class:"zoom-action-link",href:r.href,onClick:a[1]||(a[1]=l=>o.$emit("onAction"))},u.toDisplayString(r.label),9,NC)):(u.openBlock(),u.createElementBlock("div",{key:1,onClick:l=>s(r)},u.toDisplayString(r.label),9,BC))],10,LC))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),zC={key:2},UC={class:"tooltip-title"},VC={class:"title"},HC={key:0,class:"subtitle"},$C={class:"context"},YC={class:"metric"},WC={class:"tooltip"},jC={key:0,class:"square-marker marker-placeholder"},qC={class:"display-value"},ji=Pt(u.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(e,{emit:t}){const n=t,i=e,s=u.ref(null),{x:o,y:a,isDragging:r}=L1(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=u.computed(()=>`${a.value}px`),c=u.computed(()=>`${o.value}px`),d=u.computed(()=>i.state.tooltipContext),h=u.computed(()=>i.state.metricDisplay),f=u.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return u.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,p])=>{r.value||(o.value=parseFloat(m),a.value=parseFloat(p))}),u.watch(r,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),u.watch(s,m=>{if(m){const{width:p,height:g}=m.getBoundingClientRect();n("dimensions",{width:p,height:g})}}),(m,p)=>e.state.showTooltip?(u.openBlock(),u.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:u.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:u.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(u.openBlock(),u.createBlock(tf,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(u.openBlock(),u.createBlock(FC,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:p[0]||(p[0]=g=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(u.openBlock(),u.createElementBlock("div",zC,[u.createElementVNode("div",UC,[u.createElementVNode("div",VC,[u.createElementVNode("div",null,u.toDisplayString(e.tooltipTitle),1),f.value?(u.openBlock(),u.createBlock(u.unref(Tt.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${u.unref(kl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])):u.createCommentVNode("",!0)]),d.value||h.value?(u.openBlock(),u.createElementBlock("div",HC,[u.createElementVNode("div",$C,u.toDisplayString(d.value),1),u.createElementVNode("div",YC,u.toDisplayString(h.value),1)])):u.createCommentVNode("",!0)]),u.createElementVNode("ul",WC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.state.tooltipSeries,({backgroundColor:g,borderColor:y,label:_,value:x,isSegmentEmpty:T,isExtra:v},w)=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:_+w},[e.state.tooltipSeries.length?(u.openBlock(),u.createElementBlock("li",{key:0,class:u.normalizeClass({"extra-row":v})},[v?(u.openBlock(),u.createElementBlock("div",jC)):(u.openBlock(),u.createElementBlock("div",{key:1,class:"square-marker",style:u.normalizeStyle({background:String(g),borderColor:String(y)})},null,4)),u.createElementVNode("span",{class:u.normalizeClass(["display-label",{empty:T}])},u.toDisplayString(_),3),u.createElementVNode("span",qC,u.toDisplayString(x),1)],2)):u.createCommentVNode("",!0)],64))),128))])]))],6)):u.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),GC={key:0,class:"legend-container","data-testid":"legend"},XC=["onClick"],KC={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},ZC=["stroke","stroke-dasharray"],QC=["title"],JC={class:"label truncate-label"},tO={key:0,class:"sub-label"},eO={key:0},nO={class:"tooltip-content"},oo=Pt(u.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.inject("showLegendValues",!1),s=u.inject("legendPosition",u.ref(It.Bottom)),o=({datasetIndex:l,index:c,isKey:d},h)=>d?`key-${h}`:`dataset-${l??0}-${c??0}`,a=(l=0,c)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart,h=r(l,c);!d.getDatasetMeta(l).dataset&&c!==void 0?d.toggleDataVisibility(c):h?d.hide(l,c):d.show(l,c),d.update()},r=(l=0,c)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||c===void 0?d.isDatasetVisible(l):d.getDataVisibility(c)};return(l,c)=>{const d=u.resolveComponent("KTooltip");return u.unref(s)!==u.unref(It).Hidden?(u.openBlock(),u.createElementBlock("ul",GC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.items,({fillStyle:h,strokeStyle:f,text:m,datasetIndex:p,index:g,value:y,isSegmentEmpty:_,isKey:x,lineDash:T},v)=>(u.openBlock(),u.createElementBlock("li",{key:o({datasetIndex:p,index:g,isKey:x},v),class:u.normalizeClass({"legend-key":x}),onClick:w=>x?void 0:a(p,g)},[T?.length?(u.openBlock(),u.createElementBlock("svg",KC,[u.createElementVNode("line",{stroke:f,"stroke-dasharray":T.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,ZC)])):(u.openBlock(),u.createElementBlock("div",{key:1,class:"square-marker",style:u.normalizeStyle({background:h,"border-color":f})},null,4)),u.createVNode(d,null,u.createSlots({default:u.withCtx(()=>[u.createElementVNode("div",{class:u.normalizeClass(["label-container",{"strike-through":!x&&!r(p,g),"inline-value":x}]),title:y&&(u.unref(i)||x)?`${m}: ${y.formatted}`:m},[u.createElementVNode("div",JC,u.toDisplayString(m),1),y&&(u.unref(i)||x)?(u.openBlock(),u.createElementBlock("div",tO,[x?(u.openBlock(),u.createElementBlock("span",eO,"-")):u.createCommentVNode("",!0),u.createTextVNode(" "+u.toDisplayString(y.formatted),1)])):u.createCommentVNode("",!0)],10,QC)]),_:2},[_?{name:"content",fn:u.withCtx(()=>[u.createElementVNode("div",nO,u.toDisplayString(u.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,XC))),128))])):u.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Lt=[];for(let e=0;e<256;++e)Lt.push((e+256).toString(16).slice(1));function iO(e,t=0){return(Lt[e[t+0]]+Lt[e[t+1]]+Lt[e[t+2]]+Lt[e[t+3]]+"-"+Lt[e[t+4]]+Lt[e[t+5]]+"-"+Lt[e[t+6]]+Lt[e[t+7]]+"-"+Lt[e[t+8]]+Lt[e[t+9]]+"-"+Lt[e[t+10]]+Lt[e[t+11]]+Lt[e[t+12]]+Lt[e[t+13]]+Lt[e[t+14]]+Lt[e[t+15]]).toLowerCase()}const sO=new Uint8Array(16);function oO(){return crypto.getRandomValues(sO)}function gr(e,t,n){return crypto.randomUUID?crypto.randomUUID():aO(e)}function aO(e,t,n){e=e||{};const i=e.random??e.rng?.()??oO();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,iO(i)}const ef=(e,t)=>{const n=e.ctx,i=e.scales.y,s=e.scales.x,o=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(o.x-o.width/2,o.y,o.width,i.bottom-o.y):n.strokeRect(s.left,o.y-o.height/2,o.x-s.left,o.height),n.restore()};class nf{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&ef(t,this._clickedElements)}afterEvent(t,{event:n}){if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",s=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,ef(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 rO=(e,t,n,i,s="#0275d8")=>{e&&(e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore())};class ao{id="coordinator";coordinator=null;instanceId="";stopWatcher=void 0;activeDimension=null;activeDimensionValue=null;requiresUpdate=!1;triggerOnSelf=!1;watchTimestamp=!1;watchDimension=!1;lastMouseBrushEvent=0;constructor({coordinator:t,requiresUpdate:n=!1,triggerOnSelf:i=!1,watchTimestamp:s=!1,watchDimension:o=!1}){this.instanceId=crypto.randomUUID(),this.coordinator=t,this.requiresUpdate=n,this.triggerOnSelf=i,this.watchTimestamp=s,this.watchDimension=o}afterInit(t){if(!this.coordinator)return;const n=this.requiresUpdate?()=>t.update("none"):()=>t.draw(),i=this._watchTimestamp(n),s=this._watchDimension(n);this.stopWatcher=()=>{i&&i(),s&&s()}}afterEvent(t,{event:n}){this.coordinator&&(n.type==="mousemove"||n.type==="mouseout")&&requestAnimationFrame(i=>this._onMouseBrush(n.native,t,i))}beforeDatasetDraw(t,n){if(!this.coordinator||!this.watchDimension||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;t.config.type==="doughnut"?this._highlightDimensionDonut(t):this._highlightDimensionDefault(t,n)}afterDatasetsDraw(t){if(t.ctx.globalAlpha=1,!this.coordinator||!this.watchTimestamp||!this.coordinator.activeTimestamp.value||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;const i=t.scales.x.getPixelForValue(this.coordinator.activeTimestamp.value),s=t.ctx;rO(s,i,t.scales.y.top,t.scales.y.bottom)}beforeDestroy(){this.stopWatcher&&this.stopWatcher()}_watchTimestamp(t){if(!this.coordinator)return;let n;return this.watchTimestamp&&(n=u.watch([this.coordinator.activeChart,this.coordinator.activeTimestamp],([i])=>{(i!==this.instanceId||this.triggerOnSelf)&&t()})),n}_watchDimension(t){if(!this.coordinator)return;let n;if(this.watchDimension){let i;n=u.watch([this.coordinator.activeChart,this.coordinator.activeDimension,this.coordinator.activeDimensionValue],([s,o,a])=>{clearTimeout(i),o===null&&(this.activeDimension=null),a===null&&(this.activeDimensionValue=null),i=setTimeout(()=>{this.activeDimension=o,this.activeDimensionValue=a,(s!==this.instanceId||this.triggerOnSelf)&&t()},this.coordinator?.DIMENSION_DEBOUNCE_MS??400),u.onWatcherCleanup(()=>{clearTimeout(i)})})}return n}_onMouseBrush(t,n,i){if(!this.coordinator)return;const s=t.type,o=Math.min(this.coordinator.TIMESTAMP_DEBOUNCE_MS,this.coordinator.DIMENSION_DEBOUNCE_MS);if(!(s==="mousemove"&&i-this.lastMouseBrushEvent<o)){if(s==="mousemove"){const a=this._getTimestamp(n,t),[r,l]=this._getDatasetDimension(n,t)??[];this.coordinator.activate({chartUuid:this.instanceId,timestamp:a,dimension:r,dimensionValue:l})}else s==="mouseout"&&this.coordinator.deactivate({chartUuid:this.instanceId});this.lastMouseBrushEvent=i}}_highlightDimensionDefault(t,n){if(this.activeDimension&&this.activeDimensionValue){const i=t.data.datasets.map((s,o)=>s?.dimension===this.activeDimension&&s?.dimensionValue===this.activeDimensionValue?o:-1).filter(s=>s>=0);i.length&&(t.ctx.globalAlpha=i.includes(n.index)?1:.3)}else t.ctx.globalAlpha=1}_highlightDimensionDonut(t){if(this.activeDimension&&this.activeDimensionValue){const{dimension:n,dimensionValue:i}=t.data.datasets[0];if(n===this.activeDimension){const s=i.findIndex(o=>o===this.activeDimensionValue);s>=0?t.setActiveElements([{datasetIndex:0,index:s}]):t.setActiveElements([])}else t.setActiveElements([])}else t.setActiveElements([])}_getDatasetDimension(t,n){const i=t.config.type,s=i!=="line",o=["doughnut","scatter"].includes(i)?"point":"dataset",a=t.getElementsAtEventForMode(n,o,{intersect:s},!1),[r]=a;if(!r)return;const{datasetIndex:l,index:c}=r,{dimension:d,dimensionValue:h}=t.data.datasets[l];return i==="doughnut"?[d,h[c]]:[d,h]}_getTimestamp(t,n){const[i]=t.getElementsAtEventForMode(n,"index",{intersect:!1},!1);if(i&&this.watchTimestamp){const{datasetIndex:s,index:o}=i,{x:a}=t.data.datasets[s].data[o];return a}}}const lO=["id"],cO=["id"],uO={class:"axis-tooltip-content"},dO="100%",hO="100%",fO=20,mO=20,sf=6,pO=0,gO=10,yO=10,bO=1,_O=Pt(u.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=q.useI18n(),{translateUnit:i}=q.useTranslatedUnits(),s=crypto.randomUUID(),o=crypto.randomUUID(),a=new nf,r=u.inject("analytics-dashboard-coordinator",null),l=new ao({coordinator:r,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),c=u.useTemplateRef("chartContainer"),d=u.useTemplateRef("chartParent"),h=({chart:F},nt)=>{const gt=F.data,ct=gt.labels?.indexOf(nt);return gt.datasets.reduce((at,Ct,B)=>{if(F.isDatasetVisible(B)){const U=Ct.data[ct];return isNaN(U)?at:at+U}else return at},0)},f=(F,nt,gt,ct)=>{const at=ct==="horizontal";nt===null&&(nt=n.t("entityNoName"));const Ct={type:"label",yValue:J=>at?nt:h(J,nt),xValue:J=>at?h(J,nt):nt},B={...Ct,position:at?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>at?0:-Math.abs(oM()),content:J=>zd(h(J,nt),gt)},U={...Ct,content:J=>rM(h(J,nt),aM(J.chart,F)),position:at?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:J=>at?sM(zd(h(J,nt),gt)):0,color:Z1};return{[`${nt}-value`]:B,[`${nt}-percent`]:U}},m=u.useTemplateRef("canvas"),p=u.useTemplateRef("axis"),g=gr(),y=gr(),_=u.ref([]),x=u.inject("legendPosition",It.Bottom),T=u.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),v=u.toRef(t,"metricUnit"),w=u.computed(()=>t.orientation==="horizontal"),M=u.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:u.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:u.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:w.value?"horizontal_bar":"vertical_bar",chartID:o,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:D,tooltipAbsoluteTop:P}=q.useTooltipAbsolutePosition(d,M),k=u.ref(0),S=()=>t.annotations&&t.chartData.labels?.reduce((F,nt)=>Object.assign(F,f(t.chartData,nt,v.value,t.orientation)),{}),A={id:g,afterUpdate(F){k.value+=1,_.value=La(F,t.legendValues,t.chartLegendSortFn)}},L={id:y,afterUpdate(F){F.options.plugins.annotation.annotations=t.annotations?S():{}}},H=[A,{id:"axisHover",afterEvent(F,nt){if(T.show=!1,nt.event.type==="mousemove"){const gt=nt.event,ct=F.options.indexAxis,at=F.scales,Ct=F.scales[ct].getLabelForValue(Number(F.scales[ct].getValueForPixel(gt[ct]))),U=F.scales[ct].getLabels().indexOf(Ct),J=t.chartData.isLabelEmpty?.[U];if((fe=>fe==="x"?gt.y>at.x.top:gt.x<at.y.right)(ct)){M.interactionMode!=="interactive"&&(M.showTooltip=!1);const fn=F.canvas.getContext("2d").measureText(Ct).width,Te=Math.abs(Math.round(gt.x-fn*.5)),mn=Math.round(gt.x+fn*.5),Wn=F.canvas.getBoundingClientRect(),lo=40;T.left=ct==="x"?`${(Te>0?Te:mn)-T.offset+Wn.left}px`:`${gt.x-fn*.5-T.offset+Wn.left}px`,T.top=`${gt.y-lo+Wn.top}px`,Ct.length>qs?(T.show=!0,T.text=Ct):J?(T.text=n.t("emptyEntityInfo"),T.show=!0):T.show=!1}else T.show=!1}}},a,l,...t.annotations?[L]:[]],W=u.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),$=u.ref(0),K=u.ref(0),lt=new ResizeObserver(Nd(F=>{$.value=F[0].contentRect.width,K.value=F[0].contentRect.height},100)),rt=u.computed(()=>{const F=t.chartData?.labels?.length;return m.value&&F&&!w.value?`${Math.max(F*(fO+sf),$.value)}px`:dO}),X=u.computed(()=>{const F=t.chartData?.labels?.length;return m.value&&F&&w.value?`${Math.max(F*(mO+sf),K.value)}px`:hO});q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey")),u.onMounted(()=>{t.annotations&&Xt.register(Jh),c.value&&($.value=c.value.offsetWidth,K.value=c.value.offsetHeight,lt.observe(c.value))}),u.onUnmounted(()=>{c.value&<.unobserve(c.value)});const z=u.computed(()=>{const F=q.useBarChartOptions({tooltipState:M,legendID:g,stacked:u.toRef(t,"stacked"),metricAxesTitle:u.toRef(t,"metricAxesTitle"),dimensionAxesTitle:u.toRef(t,"dimensionAxesTitle"),indexAxis:w.value?"y":"x",numLabels:W});return{...F.value,plugins:{...F.value.plugins,annotation:{annotations:S(),clip:!1}}}}),C=q.useChartJSCommon("bar",m,u.toRef(t,"chartData"),H,z);u.onBeforeUnmount(()=>{Xt.unregister(Jh)});const E={[It.Bottom]:"column"},N=u.computed(()=>{if(p.value&&C.value){const F=window.devicePixelRatio,nt=C.value,gt=nt.scales.y.width*F+bO,ct=(nt.scales.y.height+nt.scales.y.top+nt.scales.x.height)*F,at=p.value.getContext("2d");return at.scale(F,F),at.canvas.width=gt,at.canvas.height=ct,at.canvas.style.width=`${gt/F}px`,at.canvas.style.height=`${ct/F}px`,{scale:F,width:gt*F,height:ct*F,targetCtx:at}}return null}),V=F=>{const nt=F.target;if(N.value&&C.value&&!w.value){const gt=N.value.scale,ct=N.value.targetCtx,at=N.value.width,Ct=N.value.height,B=C.value,U=B.canvas;ct.fillStyle="white",nt.scrollLeft>=pO&&nt.scrollLeft<=gO?(ct.globalCompositeOperation="source-over",ct.clearRect(0,0,at,Ct),ct.drawImage(U,0,0,at,Ct,0,0,at,Ct),ct.globalCompositeOperation="destination-over",ct.fillRect(0,0,at,Ct)):(ct.globalCompositeOperation="source-over",ct.fillRect(0,(B.scales.y.height+B.scales.y.top+yO)*gt,at,B.scales.x.height*gt))}M.offsetY=nt.scrollTop,M.offsetX=nt.scrollLeft,T.offset=nt.scrollLeft},tt=({width:F,height:nt})=>{M.width=F,M.height=nt};u.watch(()=>t.orientation,()=>{if(p.value&&N.value){const F=N.value.width,nt=N.value.height;(p.value?.getContext("2d")).clearRect(0,0,F,nt)}M.showTooltip=!1,M.interactionMode="idle"}),u.watch(()=>t.annotations,F=>{C.value&&(F?C.value.options.plugins.annotation.annotations=S(t.chartData):delete C.value.options.plugins.annotation.annotations)});const Z=()=>{M.showTooltip&&(M.interactionMode!=="idle"?M.interactionMode="idle":M.interactionMode="interactive")};return(F,nt)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",E[u.unref(x)]])},[u.createElementVNode("canvas",{id:u.unref(s),ref:"axis",class:"axis"},null,8,lO),u.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:nt[0]||(nt[0]=gt=>Z()),onScroll:V},[u.createElementVNode("div",{class:"chart-body",style:u.normalizeStyle({width:rt.value,height:X.value})},[u.createElementVNode("canvas",{id:u.unref(o),ref:"canvas",class:"chart-canvas"},null,8,cO)],4)],544),(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[T.show?(u.openBlock(),u.createElementBlock("div",{key:0,class:"axis-tooltip",style:u.normalizeStyle({top:T.top,left:T.left}),width:"auto"},[u.createElementVNode("div",uO,u.toDisplayString(T.text),1)],4)):u.createCommentVNode("",!0),u.createVNode(ji,{"absolute-left":u.unref(D),"absolute-top":u.unref(P),"chart-parent-ref":d.value,state:M,"tooltip-title":e.tooltipTitle,onDimensions:tt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),u.createVNode(oo,{id:u.unref(g),"chart-instance":u.unref(C),items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6994dd8d"]]);const xO={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};lu._date.override({_id:"date-fns",formats:function(){return xO},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=et(e):n==="string"&&(typeof t=="string"?e=gx(e,t,new Date,this.options):e=Kl(e,this.options)),Eo(e)?e.getTime():null},format:function(e,t){return rs(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Ao(e,t);case"second":return db(e,t);case"minute":return cb(e,t);case"hour":return ab(e,t);case"day":return os(e,t);case"week":return hb(e,t);case"month":return Oo(e,t);case"quarter":return ub(e,t);case"year":return fb(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Ro(e,t);case"second":return wb(e,t);case"minute":return bb(e,t);case"hour":return yb(e,t);case"day":return Cl(e,t);case"week":return kb(e,t);case"month":return El(e,t);case"quarter":return xb(e,t);case"year":return Tb(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return xx(e);case"minute":return _x(e);case"hour":return bx(e);case"day":return Po(e);case"week":return ae(e);case"isoWeek":return ae(e,{weekStartsOn:+n});case"month":return vb(e);case"quarter":return Sb(e);case"year":return Rl(e);default:return e}},endOf:function(e,t){switch(t){case"second":return Pb(e);case"minute":return Ob(e);case"hour":return Db(e);case"day":return Al(e);case"week":return Cb(e);case"month":return Pl(e);case"quarter":return Ab(e);case"year":return Mb(e);default:return e}}});const of={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},wO={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...of,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},kO=u.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Yn(e){return u.isProxy(e)?u.toRaw(e):e}function TO(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return u.isProxy(t)?new Proxy(e,{}):e}function SO(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function af(e,t){e.labels=t}function rf(e,t,n){const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(a=>a[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function vO(e,t){const n={labels:[],datasets:[]};return af(n,e.labels),rf(n,e.datasets,t),n}const MO=u.defineComponent({props:wO,setup(e,t){let{expose:n,slots:i}=t;const s=u.ref(null),o=u.shallowRef(null);n({chart:o});const a=()=>{if(!s.value)return;const{type:c,data:d,options:h,plugins:f,datasetIdKey:m}=e,p=vO(d,m),g=TO(p,d);o.value=new Xt(s.value,{type:c,data:g,options:{...h},plugins:f})},r=()=>{const c=u.toRaw(o.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},e.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(e.updateMode)};return u.onMounted(a),u.onUnmounted(r),u.watch([()=>e.options,()=>e.data],(c,d)=>{let[h,f]=c,[m,p]=d;const g=u.toRaw(o.value);if(!g)return;let y=!1;if(h){const _=Yn(h),x=Yn(m);_&&_!==x&&(SO(g,_),y=!0)}if(f){const _=Yn(f.labels),x=Yn(p.labels),T=Yn(f.datasets),v=Yn(p.datasets);_!==x&&(af(g.config.data,_),y=!0),T&&T!==v&&(rf(g.config.data,T,e.datasetIdKey),y=!0)}y&&u.nextTick(()=>{l(g)})},{deep:!0}),()=>u.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:s},[u.h("p",{},[i.default?i.default():""])])}});function ro(e,t){return Xt.register(t),u.defineComponent({props:of,setup(n,i){let{expose:s}=i;const o=u.shallowRef(null),a=u.shallowRef(null);u.watch(()=>a.value?.chart??null,l=>{o.value=l},{flush:"sync"}),s({chart:o});const r=l=>{a.value=l};return()=>u.h(MO,kO({ref:r},{type:e,...n}))}})}const lf=ro("bar",su),cf=ro("doughnut",Si),uf=ro("line",ou),DO=ro("scatter",ru),CO={class:"chart-container"},OO={key:0,class:"chart-center-metric"},AO={class:"chart-center-total"},PO={key:0,class:"chart-center-unit"},EO=u.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:It.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=q.useTranslatedUnits(),{i18n:i}=q.useI18n(),s=crypto.randomUUID(),o=crypto.randomUUID(),a=u.ref([]),r=u.useTemplateRef("chartParent"),l=u.inject(Oa,null),c=new ao({coordinator:l,requiresUpdate:!0,triggerOnSelf:!1,watchTimestamp:!1,watchDimension:!0}),d=u.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:u.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:u.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:o,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:h,tooltipAbsoluteTop:f}=q.useTooltipAbsolutePosition(r,d),m={id:s,afterUpdate(k){a.value=k.options.plugins.legend.labels.generateLabels(k).map(S=>({...S,value:t.legendValues&&t.legendValues[S.text],hidden:!1}))}},p=u.computed(()=>[c,m]),g=u.computed(()=>[t.chartData.datasets.reduce((S,A)=>(S.dimension=A.dimension,S.dimensionValue.push(A.dimensionValue),S.labels.push(A.label),S.backgroundColor.push(A.backgroundColor),S.hoverBorderColor.push(xs(A.backgroundColor).saturate(.5).darken(.15).hexString()),S.data.push(A.data.reduce((L,R)=>L+R,0)),S),{dimension:"",dimensionValue:[],labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:y}=oe({i18n:i}),_=u.computed(()=>WM(t.metricName??"")),x=u.computed(()=>{const k=g.value[0]?.data.reduce((S,A)=>S+A,0)??0;return y(k,t.metricUnit,{approximate:!0,translateUnit:(S,A)=>n(S,A)}).trim()}),T=u.computed(()=>t.tooltipMetricDisplay||""),v=u.computed(()=>({...t.chartData,datasets:g.value}));q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const{options:w}=q.useDonutChartOptions({tooltipState:d,legendID:s}),M=u.ref(),D=k=>({[It.Bottom]:"column",[It.Hidden]:"hidden"})[k],P=({width:k,height:S})=>{d.width=k,d.height=S};return(k,S)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",D(e.legendPosition)]),"data-testid":"donut-chart-parent"},[u.createElementVNode("div",CO,[u.createVNode(u.unref(cf),{ref_key:"chartInstance",ref:M,"chart-id":u.unref(o),data:v.value,options:u.unref(w),plugins:p.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&_.value?(u.openBlock(),u.createElementBlock("div",OO,[u.createElementVNode("span",AO,u.toDisplayString(x.value),1),T.value?(u.openBlock(),u.createElementBlock("span",PO,u.toDisplayString(T.value),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0),(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[u.createVNode(ji,{"absolute-left":u.unref(h),"absolute-top":u.unref(f),state:d,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:P},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),u.createVNode(oo,{id:u.unref(s),"chart-instance":M.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),RO=Pt(EO,[["__scopeId","data-v-db23aff8"]]);class IO{id="outlierBandPlugin";beforeDatasetsDraw(t,n,i){const s=i?.value;if(s===void 0||!Number.isFinite(s)||!i?.color)return;const o=t.scales.y;if(!o||!t.chartArea)return;const{top:a,bottom:r,left:l,right:c}=t.chartArea,d=Math.min(Math.max(o.getPixelForValue(s),a),r);if(d<=a)return;const h=t.ctx;h.save(),h.fillStyle=i.color,h.fillRect(l,a,c-l,d-a),h.restore()}}const LO=1.5;class NO{id="referenceLinePlugin";afterDatasetsDraw(t,n,i){const s=i?.lines;if(!s?.length)return;const o=t.scales.y;if(!o||!t.chartArea)return;const{top:a,bottom:r,left:l,right:c}=t.chartArea,d=t.ctx;d.save(),d.lineWidth=LO;for(const{value:h,color:f,borderDash:m}of s){if(!Number.isFinite(h))continue;const p=o.getPixelForValue(h);p<a||p>r||(d.beginPath(),d.setLineDash(m),d.strokeStyle=f,d.moveTo(l,p),d.lineTo(c,p),d.stroke())}d.restore()}}const BO={class:"chart-container"},FO=Pt(u.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},xMetric:{default:void 0},xMetricUnit:{default:void 0},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>Ja()}},setup(e){const t=e,n=u.inject("legendPosition",It.Bottom),{i18n:i}=q.useI18n(),{formatUnit:s}=oe({i18n:i}),{translateUnit:o}=q.useTranslatedUnits(),a=u.useTemplateRef("chartParent"),r=new IO,l=new NO,c=crypto.randomUUID(),d=crypto.randomUUID(),h=u.inject(Oa,null),f=new ao({coordinator:h,requiresUpdate:!0,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),m=u.ref(),p=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:u.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:o,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:d,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:g,tooltipAbsoluteTop:y}=q.useTooltipAbsolutePosition(a,p);q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const _=u.computed(()=>t.chartData?.outlier),x=u.computed(()=>t.chartData?.referenceLines??[]),T=u.ref([]),v={id:c,afterUpdate(L){T.value=La(L,void 0,t.chartLegendSortFn)}},w=u.computed(()=>{const L=[];_.value&&L.push({text:_.value.label,fillStyle:_.value.color,strokeStyle:_.value.color,isKey:!0});for(const R of x.value)L.push({text:R.label,fillStyle:R.color,strokeStyle:R.color,lineDash:R.borderDash,isKey:!0,value:{raw:R.value,formatted:s(R.value,t.metricUnit,{translateUnit:o})}});return L}),M=u.computed(()=>[...T.value,...w.value]),D=u.computed(()=>t.shadeOutlierRegion?_.value?.value:void 0),P=u.computed(()=>[f,v,...D.value!==void 0?[r]:[],...x.value.length?[l]:[]]),k=u.computed(()=>`scatter-${P.value.map(L=>L.id).join("-")}`),{options:S}=q.useScatterChartOptions({tooltipState:p,legendID:c,granularity:u.toRef(t,"granularity"),timeRangeMs:u.toRef(t,"timeRangeMs"),metricAxesTitle:u.toRef(t,"metricAxesTitle"),dimensionAxesTitle:u.toRef(t,"dimensionAxesTitle"),metricUnit:u.toRef(t,"metricUnit"),xMetric:u.toRef(t,"xMetric"),xMetricUnit:u.toRef(t,"xMetricUnit"),outlierValue:D,referenceLines:x,themeColors:u.toRef(t,"themeColors")}),A=L=>({[It.Bottom]:"column",[It.Hidden]:"hidden"})[L];return(L,R)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",A(u.unref(n))]),"data-testid":"scatter-chart-parent"},[u.createElementVNode("div",BO,[(u.openBlock(),u.createBlock(u.unref(DO),{key:k.value,ref_key:"chartInstance",ref:m,"chart-id":u.unref(d),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:u.unref(S),plugins:P.value},null,8,["chart-id","data","options","plugins"]))]),u.createVNode(ji,{"absolute-left":u.unref(g),"absolute-top":u.unref(y),"data-testid":"tooltip",granularity:e.granularity,state:p,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),u.createVNode(oo,{id:u.unref(c),"chart-instance":m.value,"data-testid":"legend",items:M.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-a001076d"]]),yr=(e,t,n,i,s="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore()},jt={},zO=()=>{jt.x=void 0,jt.chart=void 0,jt.strategy=void 0,jt.group=void 0},UO=10;class df{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let s=!1;n==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<UO)return;const s=()=>{jt.chart=n,jt.strategy=this._brushStrategy,jt.group=this._brushGroup;for(const o of Object.values(Xt.instances))o!==n&&o.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(jt.x=n.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(jt.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;yr(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:s}=t.tooltip.dataPoints[0].element;yr(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(jt.x===void 0)return;const n=jt.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&jt.group===this._brushGroup&&yr(t.ctx,jt.x,t.scales.y.top,t.scales.y.bottom,n)}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&&jt.chart===t){const n=jt.x!==void 0;if(zO(),n)for(const i of Object.values(Xt.instances))i!==t&&i.update("none")}}}const VO=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},HO=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},hf=(e,t)=>{const n=e.scales.x.getValueForPixel(t.startX),i=e.scales.x.getValueForPixel(t.endX);if(!(n===void 0||i===void 0))return{xStart:Math.min(n,i),xEnd:Math.max(n,i)}},ff=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class $O{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const s=r=>{this._dragTimeout=window.setTimeout(()=>{const l=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=r.clientX-l.left,this._endX=this._startX},150)},o=r=>{const l=n.getBoundingClientRect();if(i&&this._isDragging){this._endX=r.clientX-l.left;const c=hf(t,this);c&&ff("dragSelectMove",t,c)}},a=r=>{const l=n.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=r.clientX-l.left,i=!1,this._isDragging=!1;const c=hf(t,this);c?ff("dragSelect",t,c):this.clearSelectionArea()}};n.addEventListener("mousedown",s),n.addEventListener("mousemove",o),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:o,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:o}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",s),n.removeEventListener("mouseup",o)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(HO(t,this._startX,this._endX),VO(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const YO=20,WO="rgba(255, 171, 171, 0.4)",jO="rgba(255, 196, 0, 0.2)",mf=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const s=(n-e.y)/i;return e.x+s*(t.x-e.x)},pf=e=>"yAxisID"in e&&e.yAxisID||Gs,gf=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?pf(n):Gs},qO=(e,t,n=Gs)=>{const i=[];return e.data.datasets.forEach(s=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(s)).visible||pf(s)!==n)return;const a=s.data;a?.length&&t.filter(r=>r.highlightIntersections).forEach(r=>{const l=a.map(d=>({ts:d.x,aboveThreshold:d.y>=r.value}));let c=l[0].aboveThreshold?a[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?c=mf(a[d-1],a[d],r.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&c!==void 0&&(i.push({start:c,end:mf(a[d-1],a[d],r.value),type:r.type}),c=void 0);c!==void 0&&i.push({start:c,end:l[l.length-1].ts,type:r.type})})}),i},GO=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:s})=>s===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class XO{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(s=>({...s,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const s=t.canvas;this._syncThresholds(i);const o=a=>{if(t){const r=a.clientY,l=s.getBoundingClientRect();for(const c of Object.keys(this._thresholds||{})){const h=(t.scales[gf(t,c)]??t.scales.y).getValueForPixel(r-l.top);if(h){const f=this._thresholds?.[c];f&&f.forEach(m=>{m.hovered=Math.abs(m.value-h)<YO})}}}};s.addEventListener("mousemove",o),this._mouseMoveHandler=o}afterDatasetsDraw(t,n){const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const o=this._thresholds?.[s];if(o){const a=gf(t,s),r=t.scales[a]??t.scales.y;o.forEach(d=>{const h=r.getPixelForValue(d.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=za(d.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";d.label?f=`${d.label}: ${d.value}`:d.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:d.value}):d.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:d.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:d.value}),d.hovered&&(i.save(),i.fillStyle=za(d.type),i.font=Fy,i.fillText(f,t.chartArea.left,h-4),i.restore())});const l=qO(t,o,a);GO(l).forEach(d=>{const h=t.scales.x.getPixelForValue(d.start),f=t.scales.x.getPixelForValue(d.end);i.save(),i.fillStyle=d.type==="error"?WO:jO,i.fillRect(h,t.chartArea.top,f-h,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(h,t.chartArea.bottom),i.lineTo(f,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=za(d.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const KO=Pt(u.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0},leftYAxisGrid:{type:Boolean,default:void 0},rightYAxis:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:s}=q.useI18n(),o=new df,a=new nf,r=new $O,l=new XO(s),{translateUnit:c}=q.useTranslatedUnits(),d=u.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=u.ref([]),p=u.inject("legendPosition",It.Bottom),g=u.useTemplateRef("chartParent"),y=u.ref(void 0),_=u.ref(!1),x=u.inject(Oa,null),T=new ao({coordinator:x,triggerOnSelf:!0,watchTimestamp:!0,watchDimension:!0}),v=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:u.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(n,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:w,tooltipAbsoluteTop:M}=q.useTooltipAbsolutePosition(g,v),D={id:h,afterUpdate(E){m.value=La(E,n.legendValues,n.chartLegendSortFn)}},P=u.computed(()=>[T,D,a,...n.brush?[r]:[],...n.type==="timeseries_line"?[o]:[],...n.threshold?[l]:[]]),k=u.computed(()=>`line-${P.value.map(E=>E.id).join("-")}`),S=u.computed(()=>`bar-${P.value.map(E=>E.id).join("-")}`),A=u.computed(()=>n.chartData&&G1(n.chartData)),{options:L}=q.useLineChartOptions({tooltipState:v,timeRangeMs:u.toRef(n,"timeRangeMs"),granularity:u.toRef(n,"granularity"),legendID:h,stacked:u.toRef(n,"stacked"),metricAxesTitle:u.toRef(n,"metricAxesTitle"),dimensionAxesTitle:u.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:A,threshold:u.toRef(n,"threshold"),leftYAxisGrid:u.toRef(n,"leftYAxisGrid"),rightYAxis:u.toRef(n,"rightYAxis")});q.useReportChartDataForSynthetics(u.toRef(n,"chartData"),u.toRef(n,"syntheticsDataKey"));const R=E=>E?E.end.getTime()>E.start.getTime():!1,H=E=>({[It.Bottom]:"column",[It.Hidden]:"hidden"})[E],W=({width:E,height:N})=>{v.width=E,v.height=N},$=(E=!0)=>{v.interactionMode="idle",v.showTooltip=!1,r.clearSelectionArea(),a.isPaused&&a.resume(E),o.isPaused&&o.resume()},K=()=>{v.interactionMode="interactive"},lt=()=>{!d.value||!d.value.chart.tooltip?.dataPoints?.length||(v.interactionMode==="interactive"?o.clickedSegment=d.value.chart.tooltip.dataPoints[0]:o.destroyClickedSegment())},rt=()=>{if(_.value){_.value=!1;return}v.interactionMode!=="idle"?$():K(),lt()};u.watch(()=>n.type,()=>{v.interactionMode="idle",v.showTooltip=!1,o.destroyClickedSegment()});const X=E=>{E.preventDefault(),E.stopPropagation();const{xStart:N,xEnd:V}=E.detail,tt={start:new Date(N),end:new Date(V),type:"absolute"};if(!R(tt)){y.value=void 0,$(!1);return}y.value=tt,v.interactionMode="zoom-interactive",tt&&i("select-chart-range",tt)},z=E=>{v.interactionMode="selecting-chart-area",_.value=!0,o.pause(),a.pause();const{xStart:N,xEnd:V}=E.detail;y.value={start:new Date(N),end:new Date(V),type:"absolute"}},C=E=>{if(!g.value||v.interactionMode==="idle")return;const N=E.target;N&&g.value.contains(N)||_.value||$(!1)};return u.watch(()=>d.value?.chart,()=>{d.value?.chart&&(d.value.chart.canvas.removeEventListener("dragSelect",X),d.value.chart.canvas.removeEventListener("dragSelectMove",z),d.value.chart.canvas.addEventListener("dragSelect",X),d.value.chart.canvas.addEventListener("dragSelectMove",z))}),u.onMounted(()=>{document.addEventListener("click",C,!0)}),u.onUnmounted(()=>{d.value?.chart&&(d.value.chart.canvas.removeEventListener("dragSelect",X),d.value.chart.canvas.removeEventListener("dragSelectMove",z)),document.removeEventListener("click",C,!0)}),(E,N)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",H(u.unref(p))]),"data-testid":"line-chart-parent"},[u.createElementVNode("div",{class:"chart-container",onClick:N[0]||(N[0]=V=>rt())},[e.type==="timeseries_line"?(u.openBlock(),u.createBlock(u.unref(uf),{key:k.value,ref_key:"chartInstance",ref:d,"chart-id":u.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:u.unref(L),plugins:P.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(u.openBlock(),u.createBlock(u.unref(lf),{key:S.value,ref_key:"chartInstance",ref:d,"chart-id":u.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:u.unref(L),plugins:P.value},null,8,["chart-id","data","options","plugins"])):u.createCommentVNode("",!0)]),u.createVNode(ji,{"absolute-left":u.unref(w),"absolute-top":u.unref(M),"data-testid":"tooltip",granularity:e.granularity,state:v,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":y.value,onDimensions:W,onOnAction:N[1]||(N[1]=()=>$(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),u.createVNode(oo,{id:u.unref(h),"chart-instance":d.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-344d87c4"]]),ZO={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},QO={class:"tooltip-content"},JO={key:2,class:"analytics-chart-parent"},tA=u.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:It.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},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(e,{emit:t}){const n=t,i=e,{i18n:s}=q.useI18n(),o=u.computed(()=>tr(i.chartData)?void 0:i.chartData),a=u.computed(()=>{const B=i.chartOptions.metricAxisMap,U=o.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!B||!U.some(J=>B[J]==="right")))return B}),r=u.computed(()=>!!a.value),l=(B,U)=>a.value?B.filter(J=>(a.value?.[J]??"left")===U):B,c=u.computed(()=>{const B=o.value?.meta,U=B?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!r.value&&U.length>1&&Object.keys(B?.display??{}).length>0?U:[]}),d=u.computed(()=>c.value.length>1),h=u.computed(()=>i.activeMetric&&c.value.includes(i.activeMetric)?i.activeMetric:c.value[0]),f=u.computed(()=>{const B=o.value;return!B||!d.value||!h.value?B:{...B,meta:{...B.meta,metric_names:[h.value]}}}),m=u.computed(()=>{const B=i.chartOptions.threshold;return!d.value||!B?B:{...B,...Object.fromEntries(Object.keys(B).filter(U=>U!==h.value).map(U=>[U,[]]))}}),p=u.computed(()=>{if($.value)return tr(i.chartData)?i.chartData:oh(i.chartData)}),g=u.inject("app:konnectColorMode",u.computed(()=>"light")),y=u.useTemplateRef("chartShell"),_=u.computed(()=>(g.value,Ja(y.value))),x=u.computed(()=>{if(p.value){const{start:U,end:J,metric:$t,metricUnit:fe,truncated:fn,limit:Te,datasource:mn}=p.value;return{start:U,end:J,metricNames:[$t],metricUnits:{[$t]:fe??""},truncated:fn,limit:Te,datasource:mn}}const B=f.value?.meta;return{start:B?.start,end:B?.end,metricNames:B?.metric_names,metricUnits:B?.metric_units,truncated:B?.truncated,limit:B?.limit,datasource:B?.datasource}}),T=u.computed(()=>$.value?q.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:_},p).value:o.value?H.value?q.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Va,metricAxisMap:a.value},f).value:q.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Va},o).value:{datasets:[]}),v=u.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),w=u.computed(()=>{if(!i.chartData||o.value&&!o.value.meta)return 0;const{start:B,end:U}=x.value;if(B&&U)return new Date(U).getTime()-new Date(B).getTime()}),M=u.computed(()=>x.value.metricUnits?d.value&&h.value?x.value.metricUnits[h.value]??"":Object.values(x.value.metricUnits)[0]??"":""),D=u.computed(()=>x.value.metricUnits?d.value&&h.value?h.value:Object.keys(x.value.metricUnits)[0]??"":""),P=u.computed(()=>i.showLegendValues&&i.legendPosition!==It.Hidden),{legendValues:k}=q.useChartLegendValues(T,i.chartOptions.type,M),S=u.computed(()=>x.value.limit?.toString()||null),A=u.computed(()=>i.chartOptions.hideTruncationWarning?!1:x.value.truncated||!1),L=u.computed(()=>s.t("limitedResultsShown",{maxReturned:S.value})),R=u.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),H=u.computed(()=>["timeseries_bar","timeseries_line"].some(B=>B===i.chartOptions.type)),W=u.computed(()=>i.chartOptions.type==="donut"),$=u.computed(()=>i.chartOptions.type==="scatter"),K=u.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),lt=u.computed(()=>{const{metricNames:B,metricUnits:U}=x.value;if(r.value||!B||!U)return;const J=B[0],$t=U[J]||"";if(B.length>1){if(J.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})});if(J.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})})}if(J)return zi($t)&&s.te(`metricAxisTitles.${J}`)?s.t(`metricAxisTitles.${J}`)||void 0:s.te(`chartLabels.${J}`)?s.t(`chartLabels.${J}`):J}),rt=u.computed(()=>{const B=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(B)return B;const{metricNames:U,metricUnits:J}=x.value;if(!(!U||!J))return z(l(U,"left"),J)}),X=u.computed(()=>{if(!r.value)return;const{metricNames:B,metricUnits:U}=x.value,J=B&&U?z(l(B,"right"),U):void 0;return{title:i.chartOptions.yAxes?.right?.title??J,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),z=(B,U)=>{const J=B[0];if(!J)return;const $t=U[J]||"";if(B.length>1){if(J.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})});if(J.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})})}return C(J,$t)},C=(B,U)=>{if(s.te(`metricAxisTitles.${B}`)){if(zi(U))return s.t(`metricAxisTitles.${B}`)||void 0;const J=s.te(`chartUnits.${U}`)?s.t(`chartUnits.${U}`,{plural:"s"}):U;return s.t(`metricAxisTitles.${B}`,{unit:J})||void 0}return B||void 0},E=u.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const B=o.value?.meta,U=H.value?"Time":Object.keys(B?.display||B?.metric_names||{})[0];if(U)return s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),N=u.computed(()=>{if(Gf(x.value.datasource))return s.t("timestampAxisTitles.platform");const B=Ji(o.value?.meta?.granularity_ms);if(B)return s.te(`granularityAxisTitles.${B}`)?s.t(`granularityAxisTitles.${B}`):B}),V=u.computed(()=>{const B=p.value?.xMetric;return B?C(B,p.value?.xMetricUnit??""):N.value}),tt=u.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),Z=u.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),F=u.computed(()=>$.value?!!p.value?.points.length:H.value?X1(T.value):!!(o.value&&o.value.meta&&o.value.data.length)),nt=u.computed(()=>{const B=o.value;return B?B.meta.granularity_ms?Ji(B.meta.granularity_ms)||"hourly":Ji(new Date(B.data[1].timestamp).getTime()-new Date(B.data[0].timestamp).getTime())||"hourly":"hourly"}),gt=u.computed(()=>Ji(o.value?.meta?.granularity_ms)||"secondly"),ct=u.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(B,U)=>B.text===s.t("chartLabels.____OTHER____")?1:U.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(B.text,10))&&!isNaN(parseInt(U.text,10))?B.text<U.text?-1:1:B.value&&U.value?U.value.raw-B.value.raw:0),at=u.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(B,U)=>B.label===s.t("chartLabels.____OTHER____")?1:U.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(B.label,10))&&!isNaN(parseInt(U.label,10))?B.label<U.label?-1:1:B.value&&U.value?U.rawValue-B.rawValue:0),Ct=u.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:B=>n("zoom-time-range",B)}]:[],...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 u.provide("showLegendValues",P),u.provide("legendPosition",u.toRef(i,"legendPosition")),(B,U)=>{const J=u.resolveComponent("KTooltip"),$t=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",{ref:"chartShell",class:u.normalizeClass(["analytics-chart-shell",{"show-values":P.value}])},[F.value&&A.value&&S.value?(u.openBlock(),u.createElementBlock("div",ZO,[u.createVNode(J,{class:"tooltip","max-width":"500",placement:"right"},{content:u.withCtx(()=>[u.createElementVNode("div",QO,u.toDisplayString(L.value),1)]),default:u.withCtx(()=>[u.createVNode(u.unref(Tt.WarningIcon),{color:`var(--kui-color-text-warning, ${u.unref(Ny)})`,size:`var(--kui-icon-size-40, ${u.unref(zy)})`},null,8,["color","size"])]),_:1})])):u.createCommentVNode("",!0),F.value?(u.openBlock(),u.createElementBlock("div",JO,[H.value?(u.openBlock(),u.createBlock(KO,{key:0,brush:v.value,"chart-data":T.value,"chart-legend-sort-fn":ct.value,"chart-tooltip-sort-fn":at.value,"dimension-axes-title":N.value,fill:e.chartOptions.stacked,granularity:nt.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":u.unref(k),"metric-axes-title":rt.value,"metric-unit":M.value,"right-y-axis":X.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:m.value,"time-range-ms":w.value,"tooltip-metric-display":lt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Ct.value,onSelectChartRange:U[0]||(U[0]=fe=>n("select-chart-range",fe)),onZoomTimeRange:U[1]||(U[1]=fe=>n("zoom-time-range",fe))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","left-y-axis-grid","legend-values","metric-axes-title","metric-unit","right-y-axis","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):R.value?(u.openBlock(),u.createBlock(_O,{key:1,annotations:e.showAnnotations,"chart-data":T.value,"chart-legend-sort-fn":ct.value,"chart-tooltip-sort-fn":at.value,"data-testid":"bar-chart-container","dimension-axes-title":E.value,"legend-values":u.unref(k),"metric-axes-title":rt.value,"metric-unit":M.value,orientation:K.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":lt.value,"tooltip-title":e.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"])):W.value?(u.openBlock(),u.createBlock(RO,{key:2,"chart-data":T.value,"dataset-colors":e.chartOptions.chartDatasetColors||u.unref(Va),"legend-position":e.legendPosition,"legend-values":u.unref(k),"metric-name":D.value,"metric-unit":M.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":E.value,"tooltip-metric-display":lt.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):$.value?(u.openBlock(),u.createBlock(FO,{key:3,"chart-data":T.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":at.value,"data-testid":"scatter-chart-container","dimension-axes-title":V.value,granularity:gt.value,"metric-axes-title":rt.value,"metric-unit":M.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":_.value,"time-range-ms":w.value,"tooltip-metric-display":lt.value,"tooltip-title":e.tooltipTitle,"x-metric":p.value?.xMetric,"x-metric-unit":p.value?.xMetricUnit},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","theme-colors","time-range-ms","tooltip-metric-display","tooltip-title","x-metric","x-metric-unit"])):u.createCommentVNode("",!0)])):(u.openBlock(),u.createBlock($t,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(tt.value),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(Z.value),1)]),_:1}))],2)}}}),eA=Pt(tA,[["__scopeId","data-v-c5c250ba"]]),nA={class:"chart-parent","data-testid":"gauge-chart-parent"},iA={class:"chart-totals-flex"},sA={key:1,class:"metric-small","data-testid":"gauge-chart-total"},oA=Pt(u.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:he},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.ref(gr()),s=u.computed(()=>[t.chartData.datasets.reduce((m,p)=>(m.labels.push(p.label),m.borderColor.push(p.backgroundColor),m.backgroundColor.push(p.backgroundColor),m.data.push(p.data.reduce((g,y)=>g+y,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),o=u.computed(()=>({...t.chartData,datasets:s.value}));q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},r=u.computed(()=>Li(s?.value[0]?.data[t.numerator],{capital:!0})),l=u.computed(()=>Li(s?.value[0]?.data[0]+s?.value[0]?.data[1],{capital:!0})),c=u.computed(()=>`color: ${s?.value[0]?.backgroundColor[t.numerator]}`),d=u.computed(()=>["full","single"].includes(t.metricDisplay)),h=u.computed(()=>t.metricDisplay==="full");return(f,m)=>(u.openBlock(),u.createElementBlock("div",nA,[u.createElementVNode("div",iA,[d.value?(u.openBlock(),u.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:u.normalizeStyle(c.value)},u.toDisplayString(r.value),5)):u.createCommentVNode("",!0),h.value?(u.openBlock(),u.createElementBlock("div",sA,u.toDisplayString(u.unref(n).t("total"))+": "+u.toDisplayString(l.value),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",{class:"chart-container",style:u.normalizeStyle({height:e.height,width:e.width})},[u.createVNode(u.unref(cf),{"chart-id":i.value,data:o.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),aA={key:1,class:"single-value-wrapper"},rA={class:"single-value-metric"},lA={class:"name-unit-alignment"},cA={class:"single-value","data-testid":"single-value-chart"},uA={key:0,class:"single-value-unit"},dA={class:"single-value-metric-name"},hA={key:0,class:"single-value-trend"},fA={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},br="t1",_r="t2",mA=Pt(u.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Dd},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(e){const{i18n:t}=q.useI18n(),{formatBytes:n,formatCost:i}=oe({i18n:t}),s=e,o=u.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),a=u.computed(()=>We.buildDeltaMapping(s.data,s.showTrend,{topLevelKey:br,secondLevelKey:_r})),r=u.computed(()=>a.value?.previous?.[br]?.[_r]),l=u.computed(()=>a.value?.current?.[br]?.[_r]),c=u.computed(()=>s.data.data),d=u.computed(()=>s.data.meta?.metric_names?.[0]),h=u.computed(()=>t.te(`chartLabels.${d.value}`)?t.t(`chartLabels.${d.value}`):""),f=u.computed(()=>{const S=d.value?s.data.meta?.metric_units?.[d.value]:void 0;if(S){const A=`chartUnits.${S}`;return t.te(A)?t.t(A,{plural:""}):""}}),m=u.computed(()=>!!d.value&&(d.value.includes("_per_minute")||d.value.includes("_latency_")||d.value==="error_rate")),p=u.computed(()=>s.showTrend&&r.value!==void 0?r.value:null),g=u.computed(()=>{if(s.showTrend)return l.value??null;if(c.value.length<1||!d.value)return null;const S=c.value[0].event[d.value];return typeof S!="number"||isNaN(S)?null:S}),y=u.computed(()=>s.data?.data?.length===void 0||s.data?.data?.length===0||!s.showTrend&&g.value===null||s.showTrend&&p.value===null&&g.value===null),_=u.computed(()=>{const S=g.value;if(S===null)return"-";const A=d.value?s.data.meta?.metric_units?.[d.value]:void 0;if(A==="usd")return i(S);if(A==="bytes")return n(S);if(S>=1e9){const R=(S/1e9).toFixed(1);return R.endsWith(".0")?`${Math.floor(S/1e9)}B`:`${R}B`}if(S>=1e7){const R=(S/1e6).toFixed(1);return R.endsWith(".0")?`${Math.floor(S/1e6)}M`:`${R}M`}const L=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:Dd;return S.toLocaleString("en-US",{maximumFractionDigits:L})}),x=u.computed(()=>s.showTrend&&s.data?.data?.length<2),T=u.computed(()=>We.calculateChange(g.value??0,p.value??0)||0),v=u.computed(()=>{if(!s.showTrend)return 0;if(s.data?.data?.length<2){if(r.value===void 0)return 0;if(l.value===void 0)return s.increaseIsBad?1:-1}return We.changePolarity(T.value,!0,s.increaseIsBad)}),w=u.computed(()=>We.defineIcon(v.value,s.increaseIsBad)),M=u.computed(()=>{if(s.showTrend&&s.data?.data?.length<2){if(r.value===void 0)return t.t("singleValue.trend.not_available");if(l.value===void 0)return We.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return We.metricChange(T.value,s.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),D=We.useTrendRange(u.computed(()=>s.showTrend),void 0,u.computed(()=>s.data.meta)),P=S=>S>0?"positive":S<0?"negative":"neutral",k=S=>S>0?Ly:S<0?Iy:Tl;return u.onMounted(()=>{!s.showTrend&&s.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&s.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",s.data.data.length)}),(S,A)=>{const L=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["chart-parent",o.value]),"data-testid":"single-value-parent"},[y.value?(u.openBlock(),u.createBlock(L,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:u.unref(t).t("singleValue.valueError")},null,8,["title"])):(u.openBlock(),u.createElementBlock("div",aA,[u.createElementVNode("div",rA,[u.createElementVNode("div",lA,[u.createElementVNode("span",cA,u.toDisplayString(_.value),1),m.value&&f.value?(u.openBlock(),u.createElementBlock("span",uA," "+u.toDisplayString(f.value),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",dA,u.toDisplayString(h.value),1)]),e.showTrend?(u.openBlock(),u.createElementBlock("div",hA,[u.createElementVNode("div",{class:u.normalizeClass(["trend-change",P(v.value)]),"data-testid":"single-value-trend"},[x.value||v.value!==0?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(w.value),{key:0,color:k(v.value),size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])):(u.openBlock(),u.createBlock(u.unref(Tt.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${u.unref(Tl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])),u.createElementVNode("div",null,u.toDisplayString(M.value),1)],2),u.unref(D)?(u.openBlock(),u.createElementBlock("div",fA,u.toDisplayString(u.unref(D)),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),pA={class:"simple-chart-shell"},gA={key:1,class:"analytics-chart-parent"},yA=Pt(u.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:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.computed(()=>{const c=q.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||he},u.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&c?.datasets.reverse(),c}),s=u.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),o=u.computed(()=>t.chartOptions.type==="gauge"),a=u.computed(()=>t.chartOptions.type==="single_value"),r=u.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),l=u.computed(()=>{const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const d=t.chartData.meta?.metric_names?.[0];return c&&t.chartData.data[0].event[d]!==null}return c});return(c,d)=>{const h=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",pA,[l.value?(u.openBlock(),u.createElementBlock("div",gA,[o.value?(u.openBlock(),u.createBlock(oA,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":s.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):u.createCommentVNode("",!0),a.value?(u.openBlock(),u.createBlock(mA,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):u.createCommentVNode("",!0)])):(u.openBlock(),u.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(r.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),bA={class:"container"},_A={key:0,class:"no-data","data-testid":"sparkline-empty"},xA=["title"],wA=Pt(u.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(e){const t=crypto.randomUUID(),{i18n:n}=q.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:o,syncedMinCount:a,syncedMaxCount:r,syncedRenderPoints:l,syncedChartDatasets:c}=q.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),d=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:D,height:P})=>{d.width=D,d.height=P},f=u.computed(()=>e.disableTooltip?[]:[new df({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=u.computed(()=>c.value.reduce((D,{data:P,label:k})=>({...D,[k]:P.reduce((S,{y:A})=>S+A,0)}),{})),p=u.computed(()=>c.value.map(({label:D})=>[m.value[D],`${D}: ${m.value[D]}`]).sort(([D],[P])=>P-D).map(([,D])=>D).join(", ")),g=u.computed(()=>Object.keys(m.value).map(D=>m.value[D]).reduce((D,P)=>D+P,0)),y=u.computed(()=>g.value>0),_=u.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),x=u.computed(()=>e.datasets.length>1),T=`SparklineTooltipPosition-${t}`,v=u.computed(()=>{const D=e.type==="sparkline_bar",P=D?s.value-1:s.value,k=D?o.value:o.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:D?0:2,right:D?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:T,external:S=>{Ia(d,S,"minutely",{contextFormatter:A=>{const L=A+i.value;let R="";return i.value>1440*60*1e3?R=rs(new Date(L),"MMM dd, yyy hh:mm a"):R=rs(new Date(L),"hh:mm a"),`${Up(A)} - ${R}`}})}}},scales:{x:{min:P,max:k,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:x.value},y:{min:Math.max(a.value-1,0),max:r.value,grid:{display:!1},display:!1,stacked:x.value}}}}),w=u.ref("0"),M=u.ref("0");return u.onMounted(()=>{Ht.positioners[T]=function(D,P){if(!D.length||d.interactionMode==="interactive"||P.x===null)return!1;const k=10,S=this.chart.canvas.getBoundingClientRect(),A=d.width||this.width,L=d.height||this.height,R=S.top-L>0,H=R?S.top-L-k:S.top+S.height+k,W=S.left>A/2-P.x,$=Math.max(k,window.innerWidth-k-A),K=Math.min($,W?Math.floor(S.left-A/2)+P.x:0+k);return w.value=`${H}px`,M.value=`${K}px`,{x:K,y:H,xAlign:"center",yAlign:R?"top":"bottom"}}}),u.onUnmounted(()=>{Ht.positioners[T]&&delete Ht.positioners[T]}),(D,P)=>(u.openBlock(),u.createElementBlock("div",bA,[y.value?e.type==="sparkline_bar"?(u.openBlock(),u.createBlock(u.unref(lf),{key:1,"chart-id":u.unref(t),data:_.value,"data-testid":"sparkline-bar",options:v.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(u.openBlock(),u.createBlock(u.unref(uf),{key:2,"chart-id":u.unref(t),data:_.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:v.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):u.createCommentVNode("",!0):(u.openBlock(),u.createElementBlock("div",_A,[u.renderSlot(D.$slots,"empty",{},()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?u.createCommentVNode("",!0):(u.openBlock(),u.createBlock(ji,{key:3,"absolute-left":M.value,"absolute-top":w.value,class:"tooltip","data-testid":"sparkline-tooltip",state:d,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),y.value&&e.showLabel?(u.openBlock(),u.createElementBlock("div",{key:4,class:"label",title:D.$slots.label?"":p.value},[u.renderSlot(D.$slots,"label",{total:g.value,totalByDataset:m.value},()=>[u.createTextVNode(u.toDisplayString(p.value),1)],!0)],8,xA)):u.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),kA=["data-value"],TA=["title"],SA={class:"top-talkers-cell-metric"},vA={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},MA={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},DA={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},CA={class:"top-talkers-tooltip-title"},OA={class:"top-talkers-tooltip-rows"},AA={class:"top-talkers-tooltip-label"},PA=["data-threshold"],EA=Pt(u.defineComponent({__name:"TopTalkersCell",props:{cell:{}},setup(e){return u.useCssVars(t=>({cecbd9f0:t.cell.color,v0d35e6b6:t.cell.tint})),(t,n)=>(u.openBlock(),u.createBlock(u.unref(Kn.KPop),{class:"top-talkers-cell-wrapper",disabled:!e.cell.tooltipRows.length,"hide-caret":"","hide-close-icon":"",placement:"right","popover-timeout":0,style:u.normalizeStyle({flexGrow:e.cell.ratio}),trigger:"hover"},{content:u.withCtx(()=>[u.createElementVNode("div",DA,[u.createElementVNode("div",CA,u.toDisplayString(e.cell.name),1),u.createElementVNode("dl",OA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.cell.tooltipRows,i=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:i.key},[u.createElementVNode("dt",AA,u.toDisplayString(i.label),1),u.createElementVNode("dd",{class:u.normalizeClass(["top-talkers-tooltip-value",i.threshold&&`top-talkers-tooltip-value--${i.threshold}`]),"data-threshold":i.threshold},u.toDisplayString(i.value),11,PA)],64))),128))])])]),default:u.withCtx(()=>[u.createElementVNode("div",{class:u.normalizeClass(["top-talkers-cell",{"top-talkers-cell--other":e.cell.isOther,"top-talkers-cell--empty":e.cell.isEmpty,"top-talkers-cell--deleted":e.cell.deleted}]),"data-testid":"top-talkers-cell","data-value":e.cell.id},[u.createElementVNode("span",{class:"top-talkers-cell-name","data-testid":"top-talkers-cell-name",title:e.cell.name},u.toDisplayString(e.cell.name),9,TA),u.createElementVNode("span",SA,[u.createElementVNode("span",vA,u.toDisplayString(e.cell.display),1),e.cell.relative?(u.openBlock(),u.createElementBlock("span",MA,"("+u.toDisplayString(e.cell.relative)+")",1)):u.createCommentVNode("",!0)])],10,kA)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),RA=["data-dimension"],IA={class:"top-talkers-column-header"},LA={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},NA={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},BA={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},FA={key:2,class:"top-talkers-column-cells"},yf=Pt(u.defineComponent({__name:"TopTalkersColumn",props:{dimension:{},label:{},data:{},sizeMetric:{},columnOptions:{},isLoading:{type:Boolean}},setup(e){const{i18n:t}=q.useI18n(),{column:n}=q.useTopTalkersData(u.toRef(()=>e.data),u.toRef(()=>e.dimension),u.toRef(()=>e.sizeMetric),u.toRef(()=>e.columnOptions)),i=u.computed(()=>e.label||n.value.label),s=u.computed(()=>t.t("topTalkers.total",{value:n.value.total}));return(o,a)=>(u.openBlock(),u.createElementBlock("div",{class:"top-talkers-column","data-dimension":e.dimension,"data-testid":"top-talkers-column"},[u.createElementVNode("div",IA,[u.createElementVNode("span",LA,u.toDisplayString(i.value),1),!e.isLoading&&u.unref(n).cells.length?(u.openBlock(),u.createElementBlock("span",NA,u.toDisplayString(s.value),1)):u.createCommentVNode("",!0)]),e.isLoading?(u.openBlock(),u.createBlock(u.unref(Kn.KSkeleton),{key:0,"delay-milliseconds":0,"table-columns":1,type:"table"})):u.unref(n).cells.length?(u.openBlock(),u.createElementBlock("div",FA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(u.unref(n).cells,r=>(u.openBlock(),u.createBlock(EA,{key:r.id,cell:r},null,8,["cell"]))),128))])):(u.openBlock(),u.createElementBlock("div",BA,u.toDisplayString(u.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,RA))}}),[["__scopeId","data-v-e1b08041"]]),zA={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},UA={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},VA=Pt(u.defineComponent({__name:"TopTalkersGrid",props:{title:{default:""},columns:{},sizeMetric:{default:void 0},columnOptions:{default:void 0},emptyStateTitle:{default:""},errorMessage:{default:""},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.useSlots(),s=u.computed(()=>!!i.column),o=u.computed(()=>s.value||t.columns.some(a=>!!a.data?.data?.length||a.isLoading));return(a,r)=>(u.openBlock(),u.createBlock(u.unref(Kn.KCard),{class:"kong-ui-public-top-talkers","title-tag":e.titleTag},u.createSlots({default:u.withCtx(()=>[e.errorMessage?(u.openBlock(),u.createBlock(u.unref(Kn.KEmptyState),{key:0,"action-button-visible":!1,"data-testid":"top-talkers-error-state","icon-variant":"error"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("topTalkers.defaultErrorStateTitle")),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.errorMessage),1)]),_:1})):o.value?(u.openBlock(),u.createElementBlock("div",UA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.columns,(l,c)=>u.renderSlot(a.$slots,"column",{key:`${l.dimension}-${c}`,column:l},()=>[u.createVNode(yf,{"column-options":e.columnOptions,data:l.data,dimension:l.dimension,"is-loading":l.isLoading,label:l.label,"size-metric":e.sizeMetric},null,8,["column-options","data","dimension","is-loading","label","size-metric"])],!0)),128))])):(u.openBlock(),u.createBlock(u.unref(Kn.KEmptyState),{key:1,"action-button-visible":!1,"data-testid":"top-talkers-empty-state"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.emptyStateTitle||u.unref(n).t("topTalkers.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:u.withCtx(()=>[u.createElementVNode("span",zA,u.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]),HA={ai_provider:{anthropic:Tt.AnthropicIcon,azure:Tt.AzureIcon,bedrock:Tt.AmazonBedrockIcon,cerebras:Tt.CerebrasIcon,cohere:Tt.CohereIcon,databricks:Tt.DatabricksIcon,deepseek:Tt.DeepseekIcon,gemini:Tt.GeminiIcon,huggingface:Tt.HuggingFaceIcon,llama2:Tt.MetaLlamaIcon,mistral:Tt.MistralIcon,moonshot:Tt.KimiIcon,nvidia:Tt.NvidiaIcon,ollama:Tt.OllamaIcon,openai:Tt.OpenAiIcon,vertex:Tt.GoogleVertexIcon,vllm:Tt.VllmIcon,xai:Tt.GrokIcon}},$A=(e,t)=>{if(!(!e||!t))return HA[e]?.[t.toLowerCase()]},YA=["data-threshold"],WA=Pt(u.defineComponent({__name:"TopNMetricBar",props:{ratio:{},threshold:{}},setup(e){u.useCssVars(n=>({v0394367e:u.unref(t)}));const t=he[1];return(n,i)=>(u.openBlock(),u.createElementBlock("span",{class:u.normalizeClass(["top-n-metric-cell-bar",{[`top-n-metric-cell--bar-${e.threshold}`]:!!e.threshold}]),"data-testid":"top-n-metric-cell-bar","data-threshold":e.threshold},[u.createElementVNode("span",{class:"top-n-metric-cell-bar-fill",style:u.normalizeStyle({width:`${e.ratio*100}%`})},null,4)],10,YA))}}),[["__scopeId","data-v-24eb60ef"]]),jA=["data-threshold"],qA={class:"top-n-metric-cell-value"},GA={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},XA=Pt(u.defineComponent({__name:"TopNMetricCell",props:{display:{},relative:{},threshold:{},hasBar:{type:Boolean}},setup(e){return(t,n)=>(u.openBlock(),u.createElementBlock("span",{class:u.normalizeClass(["top-n-metric-cell",{"top-n-metric-cell--bar":e.hasBar,[`top-n-metric-cell--text-${e.threshold}`]:!e.hasBar&&!!e.threshold}]),"data-threshold":e.threshold},[u.createElementVNode("span",qA,u.toDisplayString(e.display),1),e.relative?(u.openBlock(),u.createElementBlock("span",GA,"("+u.toDisplayString(e.relative)+")",1)):u.createCommentVNode("",!0)],10,jA))}}),[["__scopeId","data-v-17e7f860"]]),KA={class:"top-n-card-title","data-testid":"top-n-card-title"},ZA={class:"top-n-card-description","data-testid":"top-n-card-description"},QA={key:3,class:"top-n-table","data-testid":"top-n-table"},JA={"data-testid":"top-n-table-header"},tP={class:"top-n-table-header-row"},eP=["colspan"],nP={class:"table-header-label"},iP=["data-testid"],sP={class:"top-n-table-cell-label"},oP={key:0,class:"top-n-table-cell top-n-table-cell-bar"},aP=3,rP=Pt(u.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"},columnOptions:{default:void 0}},setup(e){const t=e,{i18n:n}=q.useI18n(),{formatUnit:i}=oe({i18n:n}),s=u.computed(()=>t.data.data),o=u.computed(()=>!!s.value?.length),a=u.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,aP):[]),r=u.computed(()=>a.value[0]||""),l=u.computed(()=>a.value.length>1),c=u.computed(()=>a.value[a.value.length-1]||""),d=u.computed(()=>r.value?t.data.meta.display[r.value]:{}),h=u.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),f=u.computed(()=>h.value[0]),m=u.computed(()=>f.value?X(f.value):""),p=u.computed(()=>{const C=a.value.map(E=>({key:E,columnKey:E,label:K(E,l.value?X(E):n.t("topNTable.nameLabel")),type:"dimension"}));return f.value&&C.push({key:"value",columnKey:f.value,label:K(f.value,m.value),type:"metric"}),h.value.forEach((E,N)=>{N!==0&&C.push({key:E,columnKey:E,label:K(E,X(E)),type:"metric"})}),C}),g=u.computed(()=>p.value.filter(C=>C.type==="metric")),y=u.computed(()=>p.value.filter(C=>C.type==="dimension").slice(1)),_=C=>C.type==="dimension"&&C.key===c.value,x=C=>C.type==="metric"&&!!an(t.columnOptions,C.columnKey)?.bar,T=C=>l.value&&C.type==="dimension"&&!_(C),v=C=>{const E=C.event;return String(E[r.value])},w=(C,E)=>{const N=String(C.event[E]),V=t.data.meta?.display?.[E]?.[N];return{dimension:E,id:N,name:V?.name||"-",deleted:!!V?.deleted}},M=C=>{const E=v(C),N=d.value&&d.value[E];return N?N.name:"-"},D=C=>{const E=v(C),N=d.value&&d.value[E];return N?!!N.deleted:!1},P=C=>{const E=N=>i(N,"%",{translateUnit:V=>z(V,N)});return C>0&&C<.01?`< ${E(.01)}`:E(C)},k=(C,E)=>{const N=C.event[E];if(N==null)return"–";const V=typeof N=="number"?N:Number(N);if(Number.isNaN(V))return"–";const tt=t.data.meta?.metric_units?.[E]||"count";if(tt==="%")return P(V);const Z=["count","count/minute","token count"].includes(tt);return i(V,tt,{approximate:Z,isBytes1024:!0,translateUnit:F=>z(F,V)})},S=u.computed(()=>Object.fromEntries(h.value.map(C=>[C,Pa(s.value.map(E=>Nn(E.event[C])))]))),A=(C,E)=>{const N=an(t.columnOptions,E),V=Nn(C.event[E]);if(!N||V===null)return{display:k(C,E)};const tt=S.value[E],Z=N.value==="relative"?Ea(V,tt):null;return{display:k(C,E),relative:Z===null?void 0:P(Z*100),barRatio:N.bar?Ed(V,tt,N.bar):void 0,threshold:Ra(V,N.thresholds)}},L=u.computed(()=>s.value?.length?s.value.map(C=>{const E=a.value.map(Z=>w(C,Z)),N=E[0],V=N?.id||v(C),tt={id:V,rowKey:E.map(Z=>`${Z.dimension}:${Z.id}`).join("|")||V,name:N?.name||M(C),deleted:D(C),dimensions:E,metrics:{},original:C};return h.value.forEach((Z,F)=>{tt.metrics[F===0?"value":Z]=A(C,Z)}),tt}):[]),R=u.computed(()=>{if(!o.value)return"";if(t.data.meta){if(a.value.some(C=>!Object.keys(t.data.meta.display[C]||{}).length))return n.t("topNTable.errors.display");if(!f.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),H=(C,E)=>C.metrics[E]??{display:"–"},W=(C,E)=>C.dimensions.find(N=>N.dimension===E)?.id||"",$=(C,E)=>$A(an(t.columnOptions,C)?.icon_set,E),K=(C,E)=>C&&an(t.columnOptions,C)?.label||E,lt=(C,E)=>C.dimensions.find(N=>N.dimension===E)?.name||"–",rt=(C,E)=>{const N=C.dimensions.find(V=>V.dimension===E);return{id:N?.id||"",name:N?.name||"–",deleted:N?.deleted||!1,dimension:E,dimensions:C.dimensions,isEmpty:N?.id==="empty"}},X=C=>n.te(`chartLabels.${C}`)?n.t(`chartLabels.${C}`):C,z=(C,E)=>{if(zi(C)||C==="count"||C==="requests")return"";const N=E===1?"":"s";return n.te(`chartUnits.${C}`)?n.t(`chartUnits.${C}`,{plural:N}):C};return(C,E)=>{const N=u.resolveComponent("KEmptyState"),V=u.resolveComponent("KSkeleton"),tt=u.resolveComponent("KCard");return u.openBlock(),u.createBlock(tt,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},u.createSlots({default:u.withCtx(()=>[R.value?(u.openBlock(),u.createBlock(N,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(R.value),1)]),_:1})):e.isLoading?(u.openBlock(),u.createBlock(V,{key:1,"table-columns":2,type:"table"})):o.value?(u.openBlock(),u.createElementBlock("div",QA,[u.createElementVNode("table",{class:u.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":l.value}])},[u.createElementVNode("thead",JA,[u.createElementVNode("tr",tP,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(p.value,Z=>(u.openBlock(),u.createElementBlock("th",{key:Z.key,class:u.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":Z.type==="metric","top-n-table-header-cell-dimension-compact":T(Z)}]),colspan:x(Z)?2:void 0,"data-testid":"top-n-table-header-column"},[u.createElementVNode("span",nP,u.toDisplayString(Z.label),1),E[0]||(E[0]=u.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,eP))),128))])]),u.createElementVNode("tbody",null,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(L.value,Z=>(u.openBlock(),u.createElementBlock("tr",{key:Z.rowKey,class:"top-n-table-row"},[a.value.length?(u.openBlock(),u.createElementBlock("td",{key:0,class:u.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":l.value}])},[u.createElementVNode("span",{class:"top-n-table-cell-label","data-testid":`row-${Z.id}`},[$(r.value,Z.id)?(u.openBlock(),u.createBlock(u.resolveDynamicComponent($(r.value,Z.id)),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["size"])):u.createCommentVNode("",!0),u.renderSlot(C.$slots,"name",{record:{id:Z.id,name:Z.name,deleted:Z.deleted,dimension:r.value,dimensions:Z.dimensions,isEmpty:Z.id==="empty"}},()=>[u.createTextVNode(u.toDisplayString(Z.name),1)],!0)],8,iP)],2)):u.createCommentVNode("",!0),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(y.value,F=>(u.openBlock(),u.createElementBlock("td",{key:F.key,class:u.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!_(F)}])},[u.createElementVNode("span",sP,[$(F.key,W(Z,F.key))?(u.openBlock(),u.createBlock(u.resolveDynamicComponent($(F.key,W(Z,F.key))),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["size"])):u.createCommentVNode("",!0),u.renderSlot(C.$slots,"name",{record:rt(Z,F.key)},()=>[u.createTextVNode(u.toDisplayString(lt(Z,F.key)),1)],!0)])],2))),128)),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(g.value,F=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:F.key},[u.createElementVNode("td",{class:u.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":x(F)}])},[u.createVNode(XA,{"data-testid":F.key==="value"?`row-${Z.id}`:`row-${Z.id}-${F.key}`,display:H(Z,F.key).display,"has-bar":x(F),relative:H(Z,F.key).relative,threshold:H(Z,F.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),x(F)?(u.openBlock(),u.createElementBlock("td",oP,[u.createVNode(WA,{ratio:H(Z,F.key).barRatio??0,threshold:H(Z,F.key).threshold},null,8,["ratio","threshold"])])):u.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(u.openBlock(),u.createBlock(N,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.emptyStateTitle||u.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:u.withCtx(()=>[u.createElementVNode("span",KA,u.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:u.withCtx(()=>[u.createElementVNode("div",ZA,u.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]);ot.AnalyticsChart=eA,ot.ChartLegendPosition=It,ot.DECIMAL_DISPLAY=K1,ot.FONT_SIZE_REGULAR=Fd,ot.FONT_SIZE_SMALL=Bd,ot.LEFT_Y_AXIS_ID=Gs,ot.MAX_LABEL_LENGTH=qs,ot.OTHER_DIMENSION_ID=Aa,ot.RIGHT_Y_AXIS_ID=Na,ot.SimpleChart=yA,ot.SparklineChart=wA,ot.TopNTable=rP,ot.TopTalkersColumn=yf,ot.TopTalkersGrid=VA,ot.chartTypes=JM,ot.exploreResultToScatterData=oh,ot.getBarRatio=Ed,ot.getColumnOptions=an,ot.getColumnStats=Pa,ot.getRelativeValue=Ea,ot.getThresholdType=Ra,ot.handleQueryError=YM,ot.isCancellationError=ih,ot.isScatterChartData=tr,ot.lookupStatusCodeColor=Ud,ot.requestsToScatterData=KM,ot.simpleChartMetricDisplay=QM,ot.simpleChartTypes=tD,ot.statusCodeBadgeBackgroundColor=J1,ot.toNumber=Nn,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})}));
|
|
3
|
+
`):e}function jE(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Vg(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:l}=t,u=ce(t.bodyFont),d=ce(t.titleFont),h=ce(t.footerFont),m=s.length,g=r.length,y=i.length,x=Se(t.padding);let v=x.height,S=0,O=i.reduce((L,R)=>L+R.before.length+R.lines.length+R.after.length,0);if(O+=e.beforeBody.length+e.afterBody.length,m&&(v+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),O){const L=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=y*L+(O-y)*u.lineHeight+(O-1)*t.bodySpacing}g&&(v+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let A=0;const P=function(L){S=Math.max(S,n.measureText(L).width+A)};return n.save(),n.font=d.string,te(e.title,P),n.font=u.string,te(e.beforeBody.concat(e.afterBody),P),A=t.displayColors?a+2+t.boxPadding:0,te(i,L=>{te(L.before,P),te(L.lines,P),te(L.after,P)}),A=0,n.font=h.string,te(e.footer,P),n.restore(),S+=x.width,{width:S,height:v}}function GE(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function KE(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function XE(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:l,right:u}}=e;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),KE(d,e,t,n)&&(d="center"),d}function Yg(e,t,n){const i=n.yAlign||t.yAlign||GE(e,n);return{xAlign:n.xAlign||t.xAlign||XE(e,t,n,i),yAlign:i}}function ZE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function QE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function qg(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:l,yAlign:u}=n,d=r+s,{topLeft:h,topRight:m,bottomLeft:g,bottomRight:y}=Ei(a);let x=ZE(t,l);const v=QE(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(h,g)+r:l==="right"&&(x+=Math.max(m,y)+r),{x:Re(x,0,i.width-t.width),y:Re(v,0,i.height-t.height)}}function Ga(e,t,n){const i=Se(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function jg(e){return Kn([],ci(e))}function JE(e,t,n){return Ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Kg={beforeTitle:ri,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.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 n[t.dataIndex]}return""},afterTitle:ri,beforeBody:ri,beforeLabel:ri,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return kt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri};function ln(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?Kg[t].call(n,i):r}class Xg extends Ye{static positioners=ho;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 n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new _u(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=JE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=ln(i,"beforeTitle",this,t),s=ln(i,"title",this,t),a=ln(i,"afterTitle",this,t);let l=[];return l=Kn(l,ci(r)),l=Kn(l,ci(s)),l=Kn(l,ci(a)),l}getBeforeBody(t,n){return jg(ln(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return te(t,s=>{const a={before:[],lines:[],after:[]},l=Gg(i,s);Kn(a.before,ci(ln(l,"beforeLabel",this,s))),Kn(a.lines,ln(l,"label",this,s)),Kn(a.after,ci(ln(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return jg(ln(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=ln(i,"beforeFooter",this,t),s=ln(i,"footer",this,t),a=ln(i,"afterFooter",this,t);let l=[];return l=Kn(l,ci(r)),l=Kn(l,ci(s)),l=Kn(l,ci(a)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=n.length;u<d;++u)l.push(jE(this.chart,n[u]));return t.filter&&(l=l.filter((h,m,g)=>t.filter(h,m,g,i))),t.itemSort&&(l=l.sort((h,m)=>t.itemSort(h,m,i))),te(l,h=>{const m=Gg(t.callbacks,h);r.push(ln(m,"labelColor",this,h)),s.push(ln(m,"labelPointStyle",this,h)),a.push(ln(m,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=ho[i.position].call(this,r,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 u=this._size=Vg(this,i),d=Object.assign({},l,u),h=Yg(this.chart,i,d),m=qg(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:m.x,y:m.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:m}=Ei(l),{x:g,y}=t,{width:x,height:v}=n;let S,O,A,P,L,R;return s==="center"?(L=y+v/2,r==="left"?(S=g,O=S-a,P=L+a,R=L-a):(S=g+x,O=S+a,P=L-a,R=L+a),A=S):(r==="left"?O=g+Math.max(u,h)+a:r==="right"?O=g+x-Math.max(d,m)-a:O=this.caretX,s==="top"?(P=y,L=P-a,S=O-a,A=O+a):(P=y+v,L=P+a,S=O+a,A=O-a),R=P),{x1:S,x2:O,x3:A,y1:P,y2:L,y3:R}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=Kr(i.rtl,this.x,this.width);for(t.x=Ga(this,i.titleAlign,i),n.textAlign=d.textAlign(i.titleAlign),n.textBaseline="middle",a=ce(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,u=0;u<s;++u)n.fillText(r[u],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,u+1===s&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,n,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=ce(s.bodyFont),m=Ga(this,"left",s),g=r.x(m),y=u<h.lineHeight?(h.lineHeight-u)/2:0,x=n.y+y;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},S=r.leftForLtr(g,d)+d/2,O=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,uu(t,v,S,O),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,uu(t,v,S,O)}else{t.lineWidth=Nt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const v=r.leftForLtr(g,d),S=r.leftForLtr(r.xPlus(g,1),d-2),O=Ei(a.borderRadius);Object.values(O).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,qr(t,{x:v,y:x,w:d,h:u,radius:O}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:O}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(v,x,d,u),t.strokeRect(v,x,d,u),t.fillStyle=a.backgroundColor,t.fillRect(S,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:h}=i,m=ce(i.bodyFont);let g=m.lineHeight,y=0;const x=Kr(i.rtl,this.x,this.width),v=function(D){n.fillText(D,x.x(t.x+y),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let O,A,P,L,R,F,U;for(n.textAlign=a,n.textBaseline="middle",n.font=m.string,t.x=Ga(this,S,i),n.fillStyle=i.bodyColor,te(this.beforeBody,v),y=l&&S!=="right"?a==="center"?d/2+h:d+2+h:0,L=0,F=r.length;L<F;++L){for(O=r[L],A=this.labelTextColors[L],n.fillStyle=A,te(O.before,v),P=O.lines,l&&P.length&&(this._drawColorBox(n,t,L,x,i),g=Math.max(m.lineHeight,u)),R=0,U=P.length;R<U;++R)v(P[R]),g=m.lineHeight;te(O.after,v)}y=0,g=m.lineHeight,te(this.afterBody,v),t.y-=s}drawFooter(t,n,i){const r=this.footer,s=r.length;let a,l;if(s){const u=Kr(i.rtl,this.x,this.width);for(t.x=Ga(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=u.textAlign(i.footerAlign),n.textBaseline="middle",a=ce(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,l=0;l<s;++l)n.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:h}=i,{topLeft:m,topRight:g,bottomLeft:y,bottomRight:x}=Ei(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(l+m,u),a==="top"&&this.drawCaret(t,n,i,r),n.lineTo(l+d-g,u),n.quadraticCurveTo(l+d,u,l+d,u+g),a==="center"&&s==="right"&&this.drawCaret(t,n,i,r),n.lineTo(l+d,u+h-x),n.quadraticCurveTo(l+d,u+h,l+d-x,u+h),a==="bottom"&&this.drawCaret(t,n,i,r),n.lineTo(l+y,u+h),n.quadraticCurveTo(l,u+h,l,u+h-y),a==="center"&&s==="left"&&this.drawCaret(t,n,i,r),n.lineTo(l,u+m),n.quadraticCurveTo(l,u,l+m,u),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=ho[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Vg(this,t),u=Object.assign({},a,this._size),d=Yg(n,t,u),h=qg(t,u,d,n);(r._to!==h.x||s._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Se(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),km(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Mm(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[u],index:u}}),s=!Sa(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),l=this._positionChanged(a,t),u=n||!Sa(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),u}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,a=ho[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}var qe={id:"tooltip",_element:Xg,positioners:ho,afterInit(e,t,n){n&&(e.tooltip=new Xg({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:Kg},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},tR=Object.freeze({__proto__:null,Colors:hE,Decimation:_E,Filler:BE,Legend:$E,SubTitle:qE,Title:YE,Tooltip:qe});const eR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function nR(e,t,n,i){const r=e.indexOf(t);if(r===-1)return eR(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const iR=(e,t)=>e===null?null:Re(Math.round(e),0,t);function Zg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class rR extends pr{static id="category";static defaults={ticks:{callback:Zg}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(kt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:nR(i,t,Ot(n,t),this._addedLabels),iR(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return Zg.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function sR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:m,includeBounds:g}=e,y=s||1,x=h-1,{min:v,max:S}=t,O=!kt(a),A=!kt(l),P=!kt(d),L=(S-v)/(m+1);let R=Qp((S-v)/x/y)*y,F,U,D,w;if(R<1e-14&&!O&&!A)return[{value:v},{value:S}];w=Math.ceil(S/R)-Math.floor(v/R),w>x&&(R=Qp(w*R/x/y)*y),kt(u)||(F=Math.pow(10,u),R=Math.ceil(R*F)/F),r==="ticks"?(U=Math.floor(v/R)*R,D=Math.ceil(S/R)*R):(U=v,D=S),O&&A&&s&&jD((l-a)/s,R/1e3)?(w=Math.round(Math.min((l-a)/R,h)),R=(l-a)/w,U=a,D=l):P?(U=O?a:U,D=A?l:D,w=d-1,R=(D-U)/w):(w=(D-U)/R,Ks(w,Math.round(w),R/1e3)?w=Math.round(w):w=Math.ceil(w));const C=Math.max(tm(R),tm(U));F=Math.pow(10,kt(u)?C:u),U=Math.round(U*F)/F,D=Math.round(D*F)/F;let N=0;for(O&&(g&&U!==a?(n.push({value:a}),U<a&&N++,Ks(Math.round((U+N*R)*F)/F,a,Qg(a,L,e))&&N++):U<a&&N++);N<w;++N){const $=Math.round((U+N*R)*F)/F;if(A&&$>l)break;n.push({value:$})}return A&&g&&D!==l?n.length&&Ks(n[n.length-1].value,l,Qg(l,L,e))?n[n.length-1].value=l:n.push({value:l}):(!A||D===l)&&n.push({value:D}),n}function Qg(e,t,{horizontal:n,minRotation:i}){const r=ve(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class Ka extends pr{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,n){return kt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=n?r:u,l=u=>s=i?s:u;if(t){const u=jn(r),d=jn(s);u<0&&d<0?l(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,a=sR(r,s);return t.bounds==="ticks"&&Jp(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 n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Qs(t,this.chart.options.locale,this.options.ticks.format)}}class oR extends Ka{static id="linear";static defaults={ticks:{callback:Ea.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=le(t)?t:0,this.max=le(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=ve(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const po=e=>Math.floor(Oi(e)),mr=(e,t)=>Math.pow(10,po(e)+t);function Jg(e){return e/Math.pow(10,po(e))===1}function t0(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function aR(e,t){const n=t-e;let i=po(n);for(;t0(e,t,i)>10;)i++;for(;t0(e,t,i)<10;)i--;return Math.min(i,po(e))}function lR(e,{min:t,max:n}){t=mn(e.min,t);const i=[],r=po(t);let s=aR(t,n),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,h=Math.floor((t-u)/l/10)*l*10;let m=Math.floor((d-h)/Math.pow(10,s)),g=mn(e.min,Math.round((u+h+m*Math.pow(10,s))*a)/a);for(;g<n;)i.push({value:g,major:Jg(g),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),g=Math.round((u+h+m*Math.pow(10,s))*a)/a;const y=mn(e.max,g);return i.push({value:y,major:Jg(y),significand:m}),i}class cR extends pr{static id="logarithmic";static defaults={ticks:{callback:Ea.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Ka.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return le(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=le(t)?Math.max(0,t):null,this.max=le(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!le(this._userMin)&&(this.min=t===mr(this.min,0)?mr(this.min,-1):mr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=n?r:l;i===r&&(i<=0?(s(1),a(10)):(s(mr(i,-1)),a(mr(r,1)))),i<=0&&s(mr(r,-1)),r<=0&&a(mr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=lR(n,this);return t.bounds==="ticks"&&Jp(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":Qs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oi(t),this._valueRange=Oi(this.max)-Oi(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oi(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Bu(e){const t=e.ticks;if(t.display&&e.display){const n=Se(t.backdropPadding);return Ot(t.font&&t.font.size,ae.font.size)+n.height}return 0}function uR(e,t,n){return n=jt(n)?n:[n],{w:uC(e,t.string,n),h:n.length*t.lineHeight}}function e0(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function dR(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,l=a.centerPointLabels?Pt/s:0;for(let u=0;u<s;u++){const d=a.setContext(e.getPointLabelContext(u));r[u]=d.padding;const h=e.getPointPosition(u,e.drawingArea+r[u],l),m=ce(d.font),g=uR(e.ctx,m,e._pointLabels[u]);i[u]=g;const y=We(e.getIndexAngle(u)+l),x=Math.round(Da(y)),v=e0(x,h.x,g.w,0,180),S=e0(x,h.y,g.h,90,270);fR(n,t,y,v,S)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=mR(e,i,r)}function fR(e,t,n,i,r){const s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,e.l=Math.min(e.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+u))}function hR(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=n,u=e.getPointPosition(t,i+r+a,s),d=Math.round(Da(We(u.angle+oe))),h=yR(u.y,l.h,d),m=gR(d),g=_R(u.x,l.w,m);return{visible:!0,x:u.x,y:h,textAlign:m,left:g,top:h,right:g+l.w,bottom:h+l.h}}function pR(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(ai({x:n,y:i},t)||ai({x:n,y:s},t)||ai({x:r,y:i},t)||ai({x:r,y:s},t))}function mR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Bu(s)/2,additionalAngle:a?Pt/r:0};let d;for(let h=0;h<r;h++){u.padding=n[h],u.size=t[h];const m=hR(e,h,u);i.push(m),l==="auto"&&(m.visible=pR(m,d),m.visible&&(d=m))}return i}function gR(e){return e===0||e===180?"center":e<180?"left":"right"}function _R(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function yR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function bR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!kt(l)){const u=Ei(t.borderRadius),d=Se(t.backdropPadding);e.fillStyle=l;const h=i-d.left,m=r-d.top,g=s-i+d.width,y=a-r+d.height;Object.values(u).some(x=>x!==0)?(e.beginPath(),qr(e,{x:h,y:m,w:g,h:y,radius:u}),e.fill()):e.fillRect(h,m,g,y)}}function xR(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));bR(n,a,s);const l=ce(a.font),{x:u,y:d,textAlign:h}=s;ur(n,e._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function n0(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ne);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=e.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function wR(e,t,n,i,r){const s=e.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||n<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),n0(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function vR(e,t,n){return Ri(e,{label:n,index:t,type:"pointLabel"})}class SR extends Ka{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ea.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=Se(Bu(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=le(t)&&!isNaN(t)?t:0,this.max=le(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Bu(this.options))}generateTickLabels(t){Ka.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const r=Jt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?dR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=ne/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+ve(i))}getDistanceFromCenterForValue(t){if(kt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(kt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return vR(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-oe+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),n0(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,a=this._pointLabels.length;let l,u,d;if(n.pointLabels.display&&xR(this,a),r.display&&this.ticks.forEach((h,m)=>{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const g=this.getContext(m),y=r.setContext(g),x=s.setContext(g);wR(this,y,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const h=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:g}=h;!g||!m||(t.lineWidth=g,t.strokeStyle=m,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),d=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!n.reverse)return;const d=i.setContext(this.getContext(u)),h=ce(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const m=Se(d.backdropPadding);t.fillRect(-a/2-m.left,-s-h.size/2-m.top,a+m.width,h.size+m.height)}ur(t,l.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Xa={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}},cn=Object.keys(Xa);function i0(e,t){return e-t}function r0(e,t){if(kt(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),le(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(Ai(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function s0(e,t,n,i){const r=cn.length;for(let s=cn.indexOf(e);s<r-1;++s){const a=Xa[cn[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return cn[s]}return cn[r-1]}function TR(e,t,n,i,r){for(let s=cn.length-1;s>=cn.indexOf(n);s--){const a=cn[s];if(Xa[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return cn[n?cn.indexOf(n):0]}function kR(e){for(let t=cn.indexOf(e)+1,n=cn.length;t<n;++t)if(Xa[cn[t]].common)return cn[t]}function o0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=ru(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function MR(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=n[l],u>=0&&(t[u].major=!0);return t}function a0(e,t,n){const i=[],r={},s=t.length;let a,l;for(a=0;a<s;++a)l=t[a],r[l]=a,i.push({value:l,major:!1});return s===0||!n?i:MR(e,i,r,n)}class Fu extends pr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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,n={}){const i=t.time||(t.time={}),r=this._adapter=new Km._date(t.adapters.date);r.init(n),Gs(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:r0(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:l}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!l)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=le(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=le(s)&&!isNaN(s)?s:+n.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,l=ZD(r,s,a);return this._unit=n.unit||(i.autoSkip?s0(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):TR(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:kR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),a0(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Re(n,0,a),i=Re(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||s0(s.minUnit,n,i,this._getLabelCapacity(n)),l=Ot(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ai(u)||u===!0,h={};let m=n,g,y;if(d&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,d?"day":a),t.diff(i,n,a)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(g=m,y=0;g<i;g=+t.add(g,l,a),y++)o0(h,g,x);return(g===i||r.bounds==="ticks"||y===1)&&o0(h,g,x),Object.keys(h).sort(i0).map(v=>+v)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return Jt(a,[t,n,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&l[u],m=d&&l[d],g=i[n],y=d&&m&&g&&g.major;return this._adapter.format(t,r||(y?m:h))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,r=ve(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:i*s+l*a,h:i*a+l*s}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(t,0,a0(this,[t],this._majorUnit),r),a=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n<i;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)t.push(r0(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return im(t.sort(i0))}}function Za(e,t,n){let i=0,r=e.length-1,s,a,l,u;n?(t>=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=oi(e,"pos",t)),{pos:s,time:l}=e[i],{pos:a,time:u}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=oi(e,"time",t)),{time:s,pos:l}=e[i],{time:a,pos:u}=e[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class DR extends Fu{static id="timeseries";static defaults=Fu.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Za(n,this.min),this._tableRange=Za(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,l,u,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=n&&d<=i&&r.push(d);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)h=r[a+1],u=r[a-1],d=r[a],Math.round((h+u)/2)!==d&&s.push({time:d,pos:a/(l-1)});return s}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Za(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Za(this._table,i*this._tableRange+this._minPos,!0)}}var CR=Object.freeze({__proto__:null,CategoryScale:rR,LinearScale:oR,LogarithmicScale:cR,RadialLinearScale:SR,TimeScale:Fu,TimeSeriesScale:DR});const OR=[OO,oE,tR,CR];function AR(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};qe.positioners[n]=function(u,d){if(!u.length||e.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),m=e.tooltipState.width||this.width,g=h.width/2,y=nl(d,m,g),x=d.y,v=d.x<g?"left":"center";return{x:y-e.tooltipState.offsetX,y:x-e.tooltipState.offsetY,xAlign:v}},ku.modes.customInteractionMode=function(u,d){const h=Pi(d,u),m=[];return ku.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(g,y,x)=>{u.options.indexAxis==="y"&&g.inYRange(h.y,!0)&&u.data.datasets[y].data[x]&&m.push({element:g,datasetIndex:y,index:x}),u.options.indexAxis==="x"&&h.x!==null&&g.inXRange(h.x,!0)&&u.data.datasets[y].data[x]&&m.push({element:g,datasetIndex:y,index:x})}),m};const r=e.numLabels.value>25?T0:k0,s=({chart:u,index:d})=>{const h=u.data;return{size:r,style:h?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,h)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(h),d&&d.length>il?d.slice(0,il)+"...":d):u.getLabelForValue(Number(d)),l=f.computed(()=>({indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:e.indexAxis==="y"?!kt(e.metricAxesTitle?.value):!kt(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:e.indexAxis==="x"?!kt(e.metricAxesTitle?.value):!kt(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:u=>{w0(e.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return f.getCurrentInstance()&&f.onUnmounted(()=>{qe.positioners[n]&&delete qe.positioners[n]}),l}an.register(...OR);const ER=(e,t)=>{const n=t.datasets.map(r=>r.label),i=e.datasets.map(r=>r.label);return e.datasets.length===t.datasets.length&&n.every((r,s)=>r===i[s])};function RR(e,t,n,i,r){const s=f.shallowRef(null),a=(l,u)=>{if(t.value)return new an(t.value,{type:e,data:l,plugins:i,options:u})};return f.onMounted(()=>{s.value=a(n.value,r.value)}),f.onBeforeUnmount(()=>{kt(s.value)||s.value.destroy()}),f.watch(n,(l,u)=>{if(ER(u,l)&&!kt(s.value)){for(const[d,h]of l.datasets.entries())Object.assign(s.value.data.datasets[d],h);s.value.data.labels=l.labels,s.value.update()}else kt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),f.watch(t,()=>{kt(s.value)||s.value.destroy(),s.value=a(n.value,r.value)}),f.watch(r,(l,u)=>{(l.indexAxis!==u.indexAxis||JSON.stringify(l.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(l.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(kt(s.value)||s.value.destroy(),s.value=a(n.value,l))}),s}const l0=1e3,PR=1e4,c0=1e6,u0=1e9,d0=1e12,mo=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},Zr=(e,t,n)=>{const i=e/t,r=n.round?"round":"floor";if(n.decimal===!1)return Math[r](i).toString();let s;n.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function go(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const r=t.min10k?PR:l0;return e<r||t.precision&&t.precision>Math.log10(e)?n=mo(Zr(e,1,t),t):e<c0?n=`${Zr(e,l0,t)}k`:e<u0?n=`${Zr(e,c0,t)}m`:e<d0?n=`${mo(Zr(e,u0,t),t)}b`:n=`${mo(Zr(e,d0,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}go.addCommas=mo;function IR(e,t,n){const{i18n:i}=St.useI18n(),{formatBytes:r}=$n({i18n:i}),{translateUnit:s}=St.useTranslatedUnits();return{legendValues:f.computed(()=>e.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,y)=>g+(typeof y=="number"?Number(y)||0:Number(y&&y.y)||0),0);let h;const m=u.unit??n.value;if(m==="bytes")h=r(d);else{const g=s(m,d);h=i&&i.t("legend.datapointValueDisplay",{value:go(d,{capital:!0}),unit:g})||`${go(d,{capital:!0})} ${m}`}return{...l,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function LR(e){return f.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${Gh(new Date(n))} - ${Gh(new Date(i),{includeTZ:!0})}`:""})}function NR(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};qe.positioners[n]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=e.tooltipState.width||this.width,d=l.width/2,h=nl(a,u,d),m=a.y,g=a.x<d?"left":"center";return{x:h-e.tooltipState.offsetX,y:m,xAlign:g}};const r=f.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:s=>{w0(e.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return f.onUnmounted(()=>{qe.positioners[n]&&delete qe.positioners[n]}),{options:r}}function BR(e){const t=f.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:10,source:"auto",maxRotation:0,callback:h=>{const m=new Date(h);return $0({tickValue:m,granularity:e.granularity.value,dayBoundaryCrossed:u.value})}},title:{display:!1},border:{display:!1},stacked:e.stacked.value})),n=f.computed(()=>!!e.rightYAxis?.value),i=f.computed(()=>({title:{display:!kt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,...e.leftYAxisGrid?.value===!1?{drawOnChartArea:!1}:{}},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value,...n.value?{display:"auto"}:{}})),r=f.computed(()=>{const h=e.rightYAxis?.value;if(h)return{display:"auto",position:"right",title:{display:!kt(h.title),text:h.title,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,drawOnChartArea:h.showGrid??!1},beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),a=`lineChartTooltipPosition-${e.tooltipState.chartID}`,l={enabled:!1,position:a};qe.positioners[a]=function(h,m){if(!h.length||e.tooltipState.interactionMode==="interactive"||m.x===null||m.y===null)return!1;const g=this.chart.canvas.getBoundingClientRect(),y=e.tooltipState.width||this.width,x=e.tooltipState.height||this.height,v=g.width/2,S=g.height/2,O=nl(m,y,v);let A=v0(m,x,S);const P=m.y<S?"top":"bottom",L=m.x<v?"left":"center";return x>g.height&&(A=0),{x:O,y:A,xAlign:L,yAlign:P}};const u=f.computed(()=>{const h=Number(e.timeRangeMs.value),m=new Date,g=new Date(m.getTime()-h);return Np(h)>24||g.getDate()!==m.getDate()}),d=f.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:i.value,...r.value?{[qu]:r.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...l,external:h=>{Vu(e.tooltipState,h,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return f.onUnmounted(()=>{qe.positioners[a]&&delete qe.positioners[a]}),{options:d}}const FR=["usd","bytes"],zR="usd";function UR(e){const{i18n:t}=St.useI18n(),{formatUnit:n}=$n({i18n:t}),i=(y,x)=>!x||!FR.includes(x)?y:y===0&&x===zR?t.formatNumber(0,{style:"currency",currency:"USD"}):n(y,x),r=f.computed(()=>{const y=Number(e.timeRangeMs.value),x=new Date,v=new Date(x.getTime()-y);return Np(y)>24||v.getDate()!==x.getDate()}),s=f.computed(()=>({display:!kt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=f.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:y=>i(y,e.xMetricUnit?.value)},title:s.value,border:{display:!1}})),l=f.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:y=>$0({tickValue:new Date(y),granularity:e.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=f.computed(()=>({title:{display:!kt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:y=>i(y,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(y,x,v)=>{const S=v?.timestamp;return S===void 0?"":ns({tickValue:new Date(S),granularity:x})},m=`scatterChartTooltipPosition-${e.tooltipState.chartID}`;qe.positioners[m]=function(y,x){if(!y.length||e.tooltipState.interactionMode==="interactive"||x.x===null||x.y===null)return!1;const v=this.chart.canvas.getBoundingClientRect(),S=e.tooltipState.width||this.width,O=e.tooltipState.height||this.height,A=v.width/2,P=v.height/2,L=nl(x,S,A);let R=v0(x,O,P);const F=x.y<P?"top":"bottom",U=x.x<A?"left":"center";return O>v.height&&(R=0),{x:L,y:R,xAlign:U,yAlign:F}};const g=f.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"point",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.xMetric?.value?a.value:l.value,y:u.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:m,external:y=>{Vu(e.tooltipState,y,e.granularity.value,{...e.xMetric?.value?{contextFormatter:d}:{}})}},outlierBandPlugin:{value:e.outlierValue?.value,color:e.themeColors.value.outlierBand},referenceLinePlugin:{lines:e.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return f.onUnmounted(()=>{qe.positioners[m]&&delete qe.positioners[m]}),{options:g}}function HR(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l,seriesDimension:u}=e,{i18n:d}=St.useI18n(),{evaluateFeatureFlag:h}=St.useEvaluateFeatureFlag(),m=h("analytics-color-updates",!1);return t?i.map(g=>({label:d&&d.te(`chartLabels.${g}`)&&d.t(`chartLabels.${g}`)||g,backgroundColor:m?Bs({metric:g}):ju(i.indexOf(g),Xn),data:a.map((y,x)=>n?s[`${y.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,y)=>g?{dimension:u,dimensionValue:g.id,label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?Bs({dimension:u,dimensionValue:g.id}):Gu(y,g.name,g.id==="empty",l??Xn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function WR(e,t){const{i18n:n}=St.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,l=s&&Object.keys(s),u=a&&a.length>1,d=s&&l&&l.length>0,h=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const m=d&&l||a,g=m[0],y=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(w=>a.map((C,N)=>{const $=w.event[g],V=d?`${$},${C}`:`${N},${C}`,st=w.event[C];return[V,st]})):r.map(w=>{const C=d?`${w.event[g]},${w.event[y]}`:`${g},${y}`,N=w.event[a[0]];return[C,N]})),v=Object.keys(x).reduce((w,C)=>{const[N]=C.split(","),$=x[C];return w[N]?w[N]+=$:w[N]=$,w},{}),S=Object.entries(v).sort(([,w],[,C])=>Number(C)-Number(w)).map(([w])=>w),O=s[g],A=s[y];let P=d&&O&&Object.entries(O).map(([w,C])=>({id:w,name:C.name}))||a.map(w=>({id:w,name:w})),L=d&&A&&Object.entries(A).map(([w,C])=>({id:w,name:C.name}))||a.map(w=>({id:w,name:w}));if(d&&g==="country_code"&&(P=P.map(w=>({...w,name:Bc(w.id)||w.name}))),d&&y==="country_code"&&(L=L.map(w=>({...w,name:Bc(w.id)||w.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(P.sort((w,C)=>S.indexOf(w.id)-S.indexOf(C.id)),L.sort((w,C)=>S.indexOf(w.id)-S.indexOf(C.id))),!P||!L)return{labels:[],datasets:[]};const R=HR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:L,pivotRecords:x,rowLabels:P,seriesDimension:y,colorPalette:e.colorPalette||Xn}),F=d?P.map(w=>n&&n.te(`chartLabels.${w.name}`)&&n.t(`chartLabels.${w.name}`)||w.name):a.map(w=>n&&n.te(`chartLabels.${w}`)&&n.t(`chartLabels.${w}`)||w),U=P.map(w=>w.id==="empty");return{labels:F,datasets:R,isLabelEmpty:U,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const $R=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),VR=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Bp(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},YR=(e,t,n,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((e-i)/n)*n+i,u=Math.floor((a-i)/n)*n+i+n;return $R(l,u,n)};function qR(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1);return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:l,metric_names:u,metric_units:d,start:h,end:m}=t.value.meta,g=new Date(h).getTime(),y=new Date(m).getTime();if(!u)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const x=l&&Object.keys(l)||u,v=x&&x[0],S=l?.[v],O=!!S&&u.length>1;let A=l&&S&&Object.keys(S).map(w=>({id:w,name:S[w].name}))||u.map(w=>({id:w,name:w}));v==="country_code"&&(A=A.map(w=>({...w,name:Bc(w.id)||w.name})));const P=t.value.meta.granularity_ms;if(typeof P!="number"||isNaN(P)||!isFinite(P)||P===0)return console.error("Invalid step value:",P),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const L=VR(g),R=YR(g,y,P,L,a),F=a?.length?a.reduce((w,C)=>{const N=new Date(C.timestamp).valueOf(),$=C.event;for(const V of u)N in w||(w[N]={}),V in w[N]||(w[N][V]={});for(const V of u)A.forEach(st=>{(S?$[v]===st.id:V===st.id)?(w[N][V]||(w[N][V]={}),w[N][V][st.id]=Math.round(Number($[V])*1e3)/1e3):x.length||(w[N][V]||(w[N][V]={}),w[N][V][st.id]=Math.round(Number($[st.id])*1e3)/1e3)});return w},{}):{},D=[...S||u.length===1?u.flatMap(w=>A.map(C=>[w,C.id,C.name,C.id==="empty"])):A.map(w=>[w.name,w.id,w.name,w.id==="empty"])].map(([w,C,N,$],V)=>{const st=R.map(B=>B in F&&w in F[B]?{x:B,y:F[B][w][C]||0}:{x:B,y:0});let{colorPalette:dt,fill:ut}=e;kt(dt)&&(dt=Xn);const ct=r?Bs({dimension:v,dimensionValue:C}):Gu(V,N,$,dt),Tt=K0(N)?n.t(`chartLabels.${N}`):N,at=K0(w)?n.t(`chartLabels.${w}`):w,pt=u.findIndex(B=>B===w),G=e.metricAxisMap?.[w]==="right";return{dimension:v,dimensionValue:C,rawDimension:N,rawMetric:w,label:O?`${Tt} — ${at}`:Tt,borderColor:ct,backgroundColor:ct,data:st,total:st.reduce((B,{y:z})=>B+Number(z),0),...LP,...O?{borderDash:pt===0?[]:[pt*4,2]}:{},...!O&&G?{borderDash:[4,2]}:{},...G?{yAxisID:qu}:{},...e.metricAxisMap?{unit:d?.[w]??""}:{},fill:ut,borderWidth:ut?BP:NP,isSegmentEmpty:$}});return v==="status_code"||v==="status_code_grouped"?D.sort((w,C)=>(w.label??"")<(C.label??"")?-1:1):D.sort((w,C)=>Number(w.total)<Number(C.total)?-1:1),{datasets:D}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const jR=3,GR=.6,f0=2,KR=2,h0=50,XR=[6,4],ZR=[2,3],QR=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function JR(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===h0?n.t("scatter.median"):n.t("scatter.percentile",{value:a}));return f.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:l,dimension:u,display:d,xMetric:h,xMetricUnit:m}=a,g=h?n.te(`chartLabels.${h}`)&&n.t(`chartLabels.${h}`)||h:"",y=e.scatter||{},x=y.jitterMs??0,v=y.pointRadius??jR,S=y.pointOpacity??GR,O=new Map,A=[];a.points.forEach(V=>{const st=V.group??l,dt=O.get(st)||[];let ut,ct;V.x!==void 0?(ut={x:V.x,timestamp:V.timestamp},ct=[{label:g,value:V.x,...m?{unit:m}:{}},...V.extras??[]]):(ut={x:V.timestamp+QR(x,V.timestamp+V.value)},ct=V.extras??[]),dt.push({...ut,y:V.value,...ct.length?{extras:ct}:{}}),O.set(st,dt),A.push(V.value)});const P=y.percentileLines||[],L=[...P.map(V=>V.percentile),...y.outlierPercentile!==void 0?[y.outlierPercentile]:[]],R=L.length?M2(A,L):new Map,F=y.outlierPercentile!==void 0?R.get(y.outlierPercentile):void 0,U=F!==void 0&&Number.isFinite(F),D=kt(e.colorPalette)?Xn:e.colorPalette,w=e.themeColors?.value??ud(),C=[],N=V=>{const st=V?.y;return U&&Number.isFinite(st)&&st>F};Array.from(O.entries()).forEach(([V,st],dt)=>{const ut=u&&d?.[V]?.name||V,ct=V==="empty",Tt=r?Bs({dimension:u,dimensionValue:V}):Gu(dt,ut,ct,D),at=cd(Tt,S),pt=n.te(`chartLabels.${ut}`)&&n.t(`chartLabels.${ut}`)||ut;C.push({dimension:u,dimensionValue:V,type:"scatter",rawDimension:ut,rawMetric:l,label:pt,borderColor:G=>N(G.raw)?w.outlier:Tt,backgroundColor:G=>N(G.raw)?w.outlier:at,pointRadius:G=>N(G.raw)?v+f0:v,pointHoverRadius:G=>(N(G.raw)?v+f0:v)+KR,data:st,pointBorderWidth:0,showLine:!1,isSegmentEmpty:ct})});const $=[];return P.forEach(V=>{const st=R.get(V.percentile);if(st===void 0||!Number.isFinite(st))return;const dt=V.percentile===h0;$.push({percentile:V.percentile,label:s(V.percentile,V.label),value:st,color:V.color||(dt?w.medianLine:w.outlier),borderDash:V.borderDash||(dt?XR:ZR)})}),{datasets:C,...U?{outlier:{value:F,label:n.t("scatter.outlier",{label:s(y.outlierPercentile)}),color:w.outlier}}:{},...$.length?{referenceLines:$}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const tP=(e,t)=>{f.watch([e,t],(n,i,r)=>{const[s,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function eP(){const{i18n:e}=St.useI18n();return{translateUnit:(n,i)=>{const r=i===1,s=`chartUnits.${n}`;return xo(n)?"":e.te(s)?e.t(s,{plural:r?"":"s"}):n}}}const nP="analytics-query-provider",zu="analytics-dashboard-coordinator",p0=2,Uu="____OTHER____",iP="empty";function rP(){const e=f.inject(nP);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function m0(e,t){return f.getCurrentScope()?(f.onScopeDispose(e,t),!0):!1}const g0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sP=e=>e!=null,oP=Object.prototype.toString,aP=e=>oP.call(e)==="[object Object]";function Qa(e){return Array.isArray(e)?e:[e]}function lP(e){return f.getCurrentInstance()}function cP(e,t={}){if(!f.isRef(e))return f.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=f.customRef(()=>({get(){return e.value[i]},set(r){var s;if(!((s=f.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(e.value)){const a=[...e.value];a[i]=r,e.value=a}else{const a={...e.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[i]=r}}));return n}function uP(e,t=!0,n){lP()?f.onMounted(e,n):t?e():f.nextTick(e)}function dP(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Ja=g0?window:void 0;function Qr(e){var t;const n=f.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function _o(...e){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),n=f.computed(()=>{const i=Qa(f.toValue(e[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return dP(()=>{var i,r;return[(i=(r=n.value)===null||r===void 0?void 0:r.map(s=>Qr(s)))!==null&&i!==void 0?i:[Ja].filter(s=>s!=null),Qa(f.toValue(n.value?e[1]:e[0])),Qa(f.unref(n.value?e[2]:e[1])),f.toValue(n.value?e[3]:e[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=aP(a)?{...a}:a,h=i.flatMap(m=>r.flatMap(g=>s.map(y=>t(m,g,y,d))));u(()=>{h.forEach(m=>m())})},{flush:"post"})}function fP(){const e=f.shallowRef(!1),t=f.getCurrentInstance();return t&&f.onMounted(()=>{e.value=!0},t),e}function _0(e){const t=fP();return f.computed(()=>(t.value,!!e()))}function hP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=_0(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=f.watch(f.computed(()=>{const m=Qa(f.toValue(e)).map(Qr).filter(sP);return new Set(m)}),m=>{l(),a.value&&m.size&&(s=new MutationObserver(t),m.forEach(g=>s.observe(g,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),l()};return m0(h),{isSupported:a,stop:h,takeRecords:d}}const tl={speed:2,margin:30,direction:"both"};function pP(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function mP(e,t={}){var n,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:m,onStart:g,initialValue:y,axis:x="both",draggingElement:v=Ja,containerElement:S,handle:O=e,buttons:A=[0],restrictInView:P,autoScroll:L=!1}=t,R=f.ref((n=f.toValue(y))!==null&&n!==void 0?n:{x:0,y:0}),F=f.ref(),U=G=>a?a.includes(G.pointerType):!0,D=G=>{f.toValue(l)&&G.preventDefault(),f.toValue(u)&&G.stopPropagation()},w=f.toValue(L),C=typeof w=="object"?{speed:(i=f.toValue(w.speed))!==null&&i!==void 0?i:tl.speed,margin:(r=f.toValue(w.margin))!==null&&r!==void 0?r:tl.margin,direction:(s=w.direction)!==null&&s!==void 0?s:tl.direction}:tl,N=G=>typeof G=="number"?[G,G]:[G.x,G.y],$=(G,B,z)=>{const{clientWidth:Z,clientHeight:it,scrollLeft:ht,scrollTop:mt,scrollWidth:X,scrollHeight:ot}=G,[vt,lt]=N(C.margin),[bt,Rt]=N(C.speed);let j=0,et=0;(C.direction==="x"||C.direction==="both")&&(z.x<vt&&ht>0?j=-bt:z.x+B.width>Z-vt&&ht<X-Z&&(j=bt)),(C.direction==="y"||C.direction==="both")&&(z.y<lt&&mt>0?et=-Rt:z.y+B.height>it-lt&&mt<ot-it&&(et=Rt)),(j||et)&&G.scrollBy({left:j,top:et,behavior:"auto"})};let V=null;const st=()=>{const G=f.toValue(S);G&&!V&&(V=setInterval(()=>{const B=f.toValue(e).getBoundingClientRect(),{x:z,y:Z}=R.value,it={x:z-G.scrollLeft,y:Z-G.scrollTop};it.x>=0&&it.y>=0&&($(G,B,it),it.x+=G.scrollLeft,it.y+=G.scrollTop,R.value=it)},1e3/60))},dt=()=>{V&&(clearInterval(V),V=null)},ut=(G,B,z,Z)=>{const[it,ht]=typeof z=="number"?[z,z]:[z.x,z.y],{clientWidth:mt,clientHeight:X}=B;return G.x<it||G.x+Z.width>mt-it||G.y<ht||G.y+Z.height>X-ht},ct=()=>{if(f.toValue(t.disabled)||!F.value)return;const G=f.toValue(S);if(!G)return;const B=f.toValue(e).getBoundingClientRect(),{x:z,y:Z}=R.value,it={x:z-G.scrollLeft,y:Z-G.scrollTop};ut(it,G,C.margin,B)?st():dt()};f.toValue(L)&&f.watch(R,ct);const Tt=G=>{var B;if(!f.toValue(A).includes(G.button)||f.toValue(t.disabled)||!U(G)||f.toValue(d)&&G.target!==f.toValue(e))return;const z=f.toValue(S),Z=z==null||(B=z.getBoundingClientRect)===null||B===void 0?void 0:B.call(z),it=f.toValue(e).getBoundingClientRect(),ht={x:G.clientX-(z?it.left-Z.left+(L?0:z.scrollLeft):it.left),y:G.clientY-(z?it.top-Z.top+(L?0:z.scrollTop):it.top)};g?.(ht,G)!==!1&&(F.value=ht,D(G))},at=G=>{if(f.toValue(t.disabled)||!U(G)||!F.value)return;const B=f.toValue(S);B instanceof HTMLElement&&pP(B);const z=f.toValue(e).getBoundingClientRect();let{x:Z,y:it}=R.value;if((x==="x"||x==="both")&&(Z=G.clientX-F.value.x,B&&(Z=Math.min(Math.max(0,Z),B.scrollWidth-z.width))),(x==="y"||x==="both")&&(it=G.clientY-F.value.y,B&&(it=Math.min(Math.max(0,it),B.scrollHeight-z.height))),f.toValue(L)&&B&&(V===null&&$(B,z,{x:Z,y:it}),Z+=B.scrollLeft,it+=B.scrollTop),B&&(P||L)){if(x!=="y"){const ht=Z-B.scrollLeft;ht<0?Z=B.scrollLeft:ht>B.clientWidth-z.width&&(Z=B.clientWidth-z.width+B.scrollLeft)}if(x!=="x"){const ht=it-B.scrollTop;ht<0?it=B.scrollTop:ht>B.clientHeight-z.height&&(it=B.clientHeight-z.height+B.scrollTop)}}R.value={x:Z,y:it},h?.(R.value,G),D(G)},pt=G=>{f.toValue(t.disabled)||!U(G)||F.value&&(F.value=void 0,L&&dt(),m?.(R.value,G),D(G))};if(g0){const G=()=>{var B;return{capture:(B=t.capture)!==null&&B!==void 0?B:!0,passive:!f.toValue(l)}};_o(O,"pointerdown",Tt,G),_o(v,"pointermove",at,G),_o(v,["pointerup","pointercancel"],pt,G)}return{...cP(R),position:R,isDragging:f.computed(()=>!!F.value),style:f.computed(()=>`
|
|
4
|
+
left: ${R.value.x}px;
|
|
5
|
+
top: ${R.value.y}px;
|
|
6
|
+
${L?"text-wrap: nowrap;":""}
|
|
7
|
+
`)}}function gP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=_0(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=f.watch(f.computed(()=>{const h=f.toValue(e);return Array.isArray(h)?h.map(m=>Qr(m)):[Qr(h)]}),h=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const m of h)m&&s.observe(m,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return m0(d),{isSupported:a,stop:d}}function _P(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=f.shallowRef(0),u=f.shallowRef(0),d=f.shallowRef(0),h=f.shallowRef(0),m=f.shallowRef(0),g=f.shallowRef(0),y=f.shallowRef(0),x=f.shallowRef(0);function v(){const O=Qr(e);if(!O){n&&(l.value=0,u.value=0,d.value=0,h.value=0,m.value=0,g.value=0,y.value=0,x.value=0);return}const A=O.getBoundingClientRect();l.value=A.height,u.value=A.bottom,d.value=A.left,h.value=A.right,m.value=A.top,g.value=A.width,y.value=A.x,x.value=A.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return gP(e,S),f.watch(()=>Qr(e),O=>!O&&S()),hP(e,S,{attributeFilter:["style","class"]}),r&&_o("scroll",S,{capture:!0,passive:!0}),i&&_o("resize",S,{passive:!0}),uP(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:m,width:g,x:y,y:x,update:S}}function yP(e,t){const{top:n,left:i}=_P(e),r=f.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),s=f.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const bP=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=n).sort((u,d)=>u-d),s=[];if(n-t<e-2)return[];const a=(n-t)/e;let l=0;for(let u=0;u<e;u++){const d=t+u*a,h=t+(u+1)*a;let m=0;for(;l<r.length&&r[l]>=d&&r[l]<=h;)m++,l++;s.push([Math.ceil(d),m])}return s},y0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),yo=f.ref({}),xP=e=>(yo.value[e]||(yo.value[e]=y0()),yo.value[e]),wP=(e,t)=>{const n=yo.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete yo.value[t])};function vP({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const h=n!==void 0&&e!==void 0?xP(n):y0(),m=e!==void 0?e:"static-chart-key",g=f.computed(()=>t.reduce((C,{timestamps:N})=>[...C,...N],[])),y=f.computed(()=>i||g.value.reduce((C,N)=>C===0?N:Math.min(C,N),0)),x=f.computed(()=>r||g.value.reduce((C,N)=>Math.max(C,N),0));f.watchEffect(()=>{h.minStamps[m]=y.value,h.maxStamps[m]=x.value,l!==void 0&&(h.renderPoints[m]=l)});const v=f.computed(()=>Object.values(h.minStamps).reduce((C,N)=>C===0?N:Math.min(C,N),0)),S=f.computed(()=>Object.values(h.maxStamps).reduce((C,N)=>Math.max(C,N),0)),O=f.computed(()=>{const C=Object.values(h.renderPoints);return C.length===0?24:C.reduce((N,$)=>Math.max(N,$),2)}),A=f.computed(()=>{const C=S.value-v.value;return Math.ceil(C/O.value)}),P=f.computed(()=>t.length>1),L=f.computed(()=>t.map(({timestamps:C,color:N,label:$})=>({data:bP({bucketCount:O.value,minStamp:v.value,maxStamp:S.value,timestamps:C}).map(([dt,ut])=>({x:dt,y:ut})),label:$,...(u==="sparkline_bar"||P.value)&&N&&{backgroundColor:N},...u!=="sparkline_bar"&&N&&{borderColor:N},...P.value&&u!=="sparkline_bar"&&{fill:!0}}))),R=f.computed(()=>{const C=L.value[0]?.data?.length??0,N=[];for(let $=0;$<C;$++){let V=0;for(let st=0;st<L.value.length;st++)V+=L.value[st].data[$].y;N.push(V)}return N}),F=f.computed(()=>{const C=R.value.reduce((N,$)=>Math.max(N,$),0);return Math.max(C,a??0)}),U=f.computed(()=>{const C=L.value.reduce((V,{data:st})=>[...V,...st.map(({y:dt})=>dt)],[]),N=C.length?C[0]:0,$=C.reduce((V,st)=>Math.min(V,st),N);return s===void 0?$:Math.min($,s)});f.watchEffect(()=>{h.maxCounts[m]=F.value,h.minCounts[m]=U.value});const D=f.computed(()=>{const C=Object.values(h.minCounts),N=C.length?C[0]:0;return C.reduce(($,V)=>Math.min($,V),N)}),w=f.computed(()=>Object.values(h.maxCounts).reduce((C,N)=>Math.max(C,N),0));return f.onUnmounted(()=>{e!==void 0&&n!==void 0&&wP(e,n)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:O,syncedChartDatasets:L,syncedGroupSizeMs:A,syncedMinCount:D,syncedMaxCount:w}}const gr=(e,t)=>{if(!e||!t)return;const n=t.toLowerCase();return e[t]??Object.entries(e).find(([i])=>i.toLowerCase()===n)?.[1]},Jr=e=>{if(e==null||e==="")return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},Hu=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Wu=(e,t)=>t.sum>0?e/t.sum:null,b0=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},$u=(e,t)=>{const n=(t??[]).filter(s=>e>=s.value);if(!n.length)return;const i=Math.max(...n.map(s=>s.value));return n.filter(s=>s.value===i).some(s=>s.type==="error")?"error":"warning"},x0=18,SP=85;function TP(e,t,n,i){const{i18n:r}=Up(),{formatUnit:s}=$n({i18n:r}),a=R=>R.map(F=>{const U=Math.min(F.ratio,.5)/.5;return{...F,color:Bs({metric:n.value}),tint:`${x0+U*(SP-x0)}%`}}),l=f.computed(()=>e.value?.data??[]),u=f.computed(()=>e.value?.meta?.metric_names??[]),d=f.computed(()=>{const R=n.value;return R&&u.value.includes(R)?R:u.value[0]}),h=f.computed(()=>u.value.filter(R=>R!==d.value)),m=f.computed(()=>e.value?.meta?.display?.[t.value]??{}),g=(R,F)=>{if(xo(R)||R==="count"||R==="requests")return"";const U=F===1?"":"s";return r.te(`chartUnits.${R}`)?r.t(`chartUnits.${R}`,{plural:U}):R},y=R=>{const F=U=>s(U,"%",{translateUnit:D=>g(D,U)});return R>0&&R<.01?`< ${F(.01)}`:F(R)},x=(R,F)=>{if(R===null)return"–";const U=e.value?.meta?.metric_units?.[F]||"count";return U==="%"?y(R):s(R,U,{isBytes1024:!0,translateUnit:D=>g(D,R)})},v=R=>r.te(`chartLabels.${R}`)?r.t(`chartLabels.${R}`):R,S=R=>gr(i.value,R)?.label||v(R),O=f.computed(()=>Hu(l.value.map(R=>d.value?Jr(R.event[d.value]):null))),A=R=>h.value.flatMap(F=>{const U=Jr(R[F]);if(U===null)return[];const D=$u(U,gr(i.value,F)?.thresholds);return[{key:F,label:S(F),value:x(U,F),threshold:D}]}),P=f.computed(()=>{if(!d.value)return[];const R=l.value.map(F=>{const U=F.event,D=String(U[t.value]),w=Jr(U[d.value])??0,C=Wu(w,O.value),N=C??0,$=D===Uu;return{id:D,name:$?v(Uu):m.value[D]?.name||D,deleted:!!m.value[D]?.deleted,isOther:$,isEmpty:D===iP,value:w,ratio:N,display:x(w,d.value),relative:C===null?"":y(C*100),tooltipRows:A(U)}}).sort((F,U)=>Number(F.isOther)-Number(U.isOther)||U.value-F.value);return a(R)});return{column:f.computed(()=>({dimension:t.value,label:S(t.value),total:x(O.value.sum,d.value??"count"),cells:P.value})),cells:P,sizeKey:d}}const St={useBarChartOptions:AR,useChartJSCommon:RR,useChartLegendValues:IR,useChartSelectedRange:LR,useExploreResultToDatasets:WR,useExploreResultToTimeDataset:qR,useScatterDatasets:JR,useDonutChartOptions:NR,useLineChartOptions:BR,useScatterChartOptions:UR,useI18n:Up,useReportChartDataForSynthetics:tP,useTranslatedUnits:eP,useEvaluateFeatureFlag:rP,useTooltipAbsolutePosition:yP,useSparklineSync:vP,useTopTalkersData:TP},el=e=>["interactive","zoom-interactive"].includes(e),Vu=(e,t,n,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!el(e.interactionMode)){e.showTooltip=!1;return}const{i18n:s}=St.useI18n(),{formatUnit:a}=$n({i18n:s}),l=e.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!el(e.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(h,n,r.dataPoints[0].raw):ns({tickValue:new Date(h),granularity:n}),e.tooltipSeries=r.dataPoints.map((g,y)=>{const x=g.parsed[d],v=g.dataset.unit??e.units,S=a(x??0,v,{translateUnit:e.translateUnit}),O=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[y].backgroundColor,borderColor:u[y].borderColor,label:O,value:S,rawValue:x,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l);const m=r.dataPoints[0]?.raw?.extras??[];for(const g of m)e.tooltipSeries.push({label:g.label,value:g.unit?a(Number(g.value)||0,g.unit,{translateUnit:e.translateUnit}):String(g.value),rawValue:Number(g.value)||0,isExtra:!0});e.left=`${r.x}px`,e.top=`${r.y}px`,e.showTooltip=!0}},w0=(e,t)=>{const{tooltip:n}=t,{i18n:i}=St.useI18n(),{formatUnit:r}=$n({i18n:i});if(n.opacity===0&&!el(e.interactionMode)){e.showTooltip=!1;return}const s=e.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(n.body&&!el(e.interactionMode)){const a=n.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(e.chartType);u?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((d,h)=>{const m=u?d.parsed:d.parsed[l],g=r(m??0,e.units,{translateUnit:e.translateUnit});let y;return u?y=d.dataset.labels[d.dataIndex]:y=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:y,value:g,rawValue:m,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},kP=e=>e&&e.datasets&&e.datasets.length,MP=e=>kP(e)&&e.datasets.some(t=>t.data.length),DP=e=>e.datasets.some(t=>t.data[0]&&Wc(t.data[0].x)),CP=e=>!!MP(e)&&e.datasets.some(t=>t.data.length==1),OP=e=>DP(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),nl=(e,t,n)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=e.x??0;return l<n?l+t*s*(1-r):l-t*a*(1-r)},v0=(e,t,n)=>{const s=e.y??0;return s<n?s+t*.15:s-t*.5};function S0(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const Yu=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(n)},AP=2,T0=10,k0=12,il=10,rl="y",qu="y1",Xn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ju=(e,t)=>(t||Xn)[e%Xn.length],EP="#6f7787",RP={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"}},PP=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return RP[t]?.background||"#fafafa"},IP=dS,Gu=(e,t,n,i)=>{let r;return n?r=IP:Array.isArray(i)?r=ju(e,i):r=i[t],r||ju(e)},Ku=e=>{switch(e){case"error":return fS;case"warning":return gS;case"neutral":return lp;default:return lp}},LP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},NP=2,BP=0,Xu=new Map,M0=(e,t)=>{const{i18n:n}=St.useI18n(),{formatBytes:i}=$n({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):pa.format(e)},FP=e=>{const n=document.createElement("canvas").getContext("2d"),i=ce({});return n.font=i.string,n.measureText(e).width},zP=()=>{const e="label_height";if(!Xu.has(e)){const t=ce({});Xu.set(e,t.lineHeight)}return Xu.get(e)},UP=(e,t)=>t.datasets.reduce((n,i,r)=>e.isDatasetVisible(r)?n+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):n,0),HP=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,WP=uS,$P={100:bS,101:xS,102:wS,103:vS,200:SS,201:TS,202:kS,203:MS,204:DS,205:CS,206:OS,207:AS,208:ES,226:RS,300:PS,301:IS,302:LS,303:NS,304:BS,305:FS,307:zS,308:US,400:HS,401:WS,402:$S,403:VS,404:YS,405:qS,406:jS,407:GS,408:KS,409:XS,410:ZS,411:QS,412:JS,413:tT,414:eT,415:nT,416:iT,417:rT,418:sT,421:oT,422:aT,423:lT,424:cT,425:uT,426:dT,428:fT,429:hT,431:pT,451:mT,500:gT,501:_T,502:yT,503:bT,504:xT,505:wT,506:vT,507:ST,508:TT,510:kT,511:MT},VP={100:DT,200:CT,300:OT,400:AT,500:ET},YP={"1XX":RT,"2XX":PT,"3XX":IT,"4XX":LT,"5XX":NT},D0=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return $P[t]??VP[n]??WP},Zu={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=D0(`${t}`),e),{}),____OTHER____:cS,...YP};function C0(e,t,n){const i=Ep(),r=GP(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?qP(r,t):jP(r,t)}function qP(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function jP(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function GP(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function KP(e,t){const n=t2(t);return"formatToParts"in n?ZP(n,e):QP(n,e)}const XP={year:0,month:1,day:2,hour:3,minute:4,second:5};function ZP(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=XP[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function QP(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 Qu={},O0=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")),JP=O0==="06/25/2014, 00:00:00"||O0==="06/25/2014 00:00:00";function t2(e){return Qu[e]||(Qu[e]=JP?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Qu[e]}function A0(e,t,n,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(i,r,s,a),l}const E0=36e5,e2=6e4,Ju={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function td(e,t,n){if(!e)return 0;let i=Ju.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Ju.timezoneHH.exec(e),i)return r=parseInt(i[1],10),R0(r)?-(r*E0):NaN;if(i=Ju.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return R0(r,a)?(s=Math.abs(r)*E0+a*e2,i[1]==="+"?-s:s):NaN}if(r2(e)){t=new Date(t||Date.now());const a=n?t:n2(t),l=ed(a,e);return-(n?l:i2(t,l,e))}return NaN}function n2(e){return A0(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ed(e,t){const n=KP(e,t),i=A0(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function i2(e,t,n){let r=e.getTime()-t;const s=ed(new Date(r),n);if(t===s)return t;r-=s-t;const a=ed(new Date(r),n);return s===a?s:Math.max(s,a)}function R0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const P0={};function r2(e){if(P0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),P0[e]=!0,!0}catch{return!1}}const s2=60*1e3,o2={X:function(e,t,n){const i=nd(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return I0(i);case"XXXX":case"XX":return ts(i);default:return ts(i,":")}},x:function(e,t,n){const i=nd(n.timeZone,e);switch(t){case"x":return I0(i);case"xxxx":case"xx":return ts(i);default:return ts(i,":")}},O:function(e,t,n){const i=nd(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+a2(i,":");default:return"GMT"+ts(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return C0("short",e,n);default:return C0("long",e,n)}}};function nd(e,t){const n=e?td(e,t,!0)/s2:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function sl(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function ts(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=sl(Math.floor(i/60),2),s=sl(Math.floor(i%60),2);return n+r+t+s}function I0(e,t){return e%60===0?(e>0?"-":"+")+sl(Math.abs(e)/60,2):ts(e,t)}function a2(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+sl(s,2)}function L0(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const l2=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,id=36e5,N0=6e4,c2=2,Je={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:l2};function B0(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?c2:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=u2(e),{year:r,restDateString:s}=d2(i.date,n),a=f2(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=h2(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=td(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=L0(new Date(l+u)),d=L0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function u2(e){const t={};let n=Je.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Je.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Je.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function d2(e,t){if(e){const n=Je.YYY[t],i=Je.YYYYY[t];let r=Je.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Je.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function f2(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=Je.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,U0(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Je.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return g2(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Je.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return U0(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Je.Www.exec(e),s)return r=parseInt(s[1],10)-1,H0(r)?F0(t,r):new Date(NaN);if(s=Je.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return H0(r,a)?F0(t,r,a):new Date(NaN)}return null}function h2(e){let t,n,i=Je.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),rd(t)?t%24*id:NaN;if(i=Je.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),rd(t,n)?t%24*id+n*N0:NaN;if(i=Je.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return rd(t,n,r)?t%24*id+n*N0+r*1e3:NaN}return null}function F0(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const p2=[31,28,31,30,31,30,31,31,30,31,30,31],m2=[31,29,31,30,31,30,31,31,30,31,30,31];function z0(e){return e%400===0||e%4===0&&e%100!==0}function U0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=z0(e);if(i&&n>m2[t]||!i&&n>p2[t])return!1}return!0}function g2(e,t){if(t<1)return!1;const n=z0(e);return!(n&&t>366||!n&&t>365)}function H0(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function rd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const _2=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function sd(e,t,n={}){t=String(t);const i=t.match(_2);if(i){const r=B0(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+o2[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return _a(e,t,n)}function y2(e,t,n){e=B0(e,n);const i=td(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function bo(e,t,n,i){return i={...i,timeZone:t,originalDate:e},sd(y2(e,t,{timeZone:i.timeZone}),n,i)}const b2=(e,t)=>`${bo(e,t,"yyyy")} W${bo(e,t,"II")}`,od="MMM dd, h:mm:ss a",ad="h:mm:ss a",_r="MMM dd, h:mm a",es="h:mm a",x2="MMM dd",ld="MMM dd, h:mm:ss a",Bi="MMM dd, h:mm a",w2={secondly:e=>e?od:ad,tenSecondly:e=>e?od:ad,thirtySecondly:e=>e?od:ad,minutely:e=>e?_r:es,fiveMinutely:e=>e?_r:es,tenMinutely:e=>e?_r:es,thirtyMinutely:e=>e?_r:es,hourly:e=>e?_r:es,twoHourly:e=>e?_r:es,twelveHourly:()=>_r,daily:()=>x2},v2={secondly:()=>ld,tenSecondly:()=>ld,thirtySecondly:()=>ld,minutely:()=>Bi,fiveMinutely:()=>Bi,tenMinutely:()=>Bi,thirtyMinutely:()=>Bi,hourly:()=>Bi,twoHourly:()=>Bi,twelveHourly:()=>Bi,daily:()=>Bi};function W0({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return b2(e,l);if(r&&r[t]){const u=r[t](i);return bo(e,l,u)}if(s&&s[t]){const u=s[t]();return bo(e,l,u)}return bo(e,l,a)}const $0=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>W0({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:w2,defaultFormat:"MMM dd, h:mm:ss a"}),ns=({tickValue:e,granularity:t,timezone:n})=>W0({tickValue:e,granularity:t,timezone:n,tooltipMap:v2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),V0=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",S2=e=>{const{i18n:t}=St.useI18n();return V0(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.message==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},xo=e=>e.toLocaleLowerCase().endsWith("count"),T2=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},k2=(e,t)=>{if(!e.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(e.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?e[r]:e[r]+(e[s]-e[r])*(i-r)},M2=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,k2(n,i)]))},Y0=.7,cd=(e,t)=>{const n=Aa(e.trim());return n.valid?n.alpha(t).rgbString():e},ud=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:cp,outlier:op,outlierBand:cd(ap,Y0)};const n=window.getComputedStyle(t),i=(r,s)=>n.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",cp),outlier:i("--kui-color-background-danger",op),outlierBand:cd(i("--kui-color-background-danger-weakest",ap),Y0)}},D2="empty",q0=e=>{if(!e||!("meta"in e)||!("data"in e))return;const{display:t,metric_names:n,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=e.meta;if(!n?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=n.length>1?n[0]:void 0,h=d?n[1]:n[0],m=t&&Object.keys(t)[0]||void 0,g=e.data??[],y=[];for(const x of g){const v=G0(x.timestamp,x.event[h],m?x.event[m]:void 0);if(v){if(d){const S=j0(x.event[d]);if(S===void 0)continue;v.x=S}y.push(v)}}return{points:y,metric:h,metricUnit:i?.[h],...d?{xMetric:d,xMetricUnit:i?.[d]}:{},dimension:m,display:m?t?.[m]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},j0=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},G0=(e,t,n,i)=>{const r=new Date(e).valueOf(),s=j0(t);if(!Number.isFinite(r)||s===void 0)return;const a=i?.length?{extras:i}:{};return n===void 0?{timestamp:r,value:s,...a}:{timestamp:r,value:s,group:n!==null&&n!==""?String(n):D2,...a}},C2=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:r,label:s,unit:a}of n){const l=yr(e,r)??yr(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},O2=(e,t)=>{if(!e||!("meta"in e))return;const{metric:n,dimension:i,unroll:r,display:s,extraFields:a,metricUnit:l}=t,u=t.timestamp??"request_start";if(!n){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const d=[];for(const h of e.results??[]){const m=yr(h,u);for(const g of A2(h,r)){const y=yr(g,n),x=i?yr(g,i)??yr(h,i):void 0,v=G0(m,y,i?x??null:void 0,C2(g,h,a));v&&d.push(v)}}return{points:d,metric:n,metricUnit:l,dimension:i,display:s,start:e.meta?.time_range?.start,end:e.meta?.time_range?.end,truncated:e.truncated,limit:e.limit,datasource:"requests"}},A2=(e,t)=>{if(!t)return[e];const n=yr(e,t);return Array.isArray(n)?n:[]},yr=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},K0=e=>Object.hasOwn(zp.chartLabels,e),E2=["hidden","single","full"];var br=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(br||{});const R2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],P2=["gauge","top_n","single_value"],dd=e=>e===null||typeof e!="object"||!("points"in e)?!1:Array.isArray(e.points);var Le=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(Le||{});const X0={modes:{point(e,t){return ol(e,t,{intersect:!0})},nearest(e,t,n){return N2(e,t,n)},x(e,t,n){return ol(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return ol(e,t,{intersect:n.intersect,axis:"y"})}}};function fd(e,t,n){return(X0.modes[n.mode]||X0.modes.nearest)(e,t,n)}function I2(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function L2(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function ol(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):I2(i,t,n.axis))}function N2(e,t,n){let i=Number.POSITIVE_INFINITY;return ol(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),l=L2(t,a,n.axis),u=Yr(t,l);return u<i?(r=[s],i=u):u===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function xr(e,t,n){const i=Math.cos(n),r=Math.sin(n),s=t.x,a=t.y;return{x:s+i*(e.x-s)-r*(e.y-a),y:a+r*(e.x-s)+i*(e.y-a)}}const B2=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,wr=.001,al=(e,t,n)=>Math.min(n,Math.max(t,e)),Z0=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function F2(e,t,n){for(const i of Object.keys(e))e[i]=al(e[i],t,n);return e}function z2(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function Q0(e,{x:t,y:n,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=e.x>=t-u-wr&&e.x<=i+u+wr,h=e.y>=n-u-wr&&e.y<=r+u+wr;return s==="x"?d:(s==="y"||d)&&h}function J0(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=xr(e,n,ve(-r));return Q0(l,t,i,{borderWidth:s,hitTolerance:a})}function vr(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function U2(e,t,n,i=!0){const r=n.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(B2(l,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const t_=e=>typeof e=="string"&&e.endsWith("%"),e_=e=>parseFloat(e)/100,n_=e=>al(e_(e),0,1),wo=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),H2={box:e=>wo(e.centerX,e.centerY),doughnutLabel:e=>wo(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>wo(e.centerX,e.centerY),line:e=>wo(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>wo(e.centerX,e.centerY)};function hd(e,t){return t==="start"?0:t==="end"?e:t_(t)?n_(t)*e:e/2}function Fi(e,t,n=!0){return typeof t=="number"?t:t_(t)?(n?n_(t):e_(t))*e:e}function W2(e,t){const{x:n,width:i}=e,r=t.textAlign;return r==="center"?n+i/2:r==="end"||r==="right"?n+i:n}function i_(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const l=Nt(a),u=t.width+(l?a.width:0)+n,d=t.height+(l?a.height:0)+n,h=pd(i),m=a_(e.x,u,r,h.x),g=a_(e.y,d,s,h.y);return{x:m,y:g,x2:m+u,y2:g+d,width:u,height:d,centerX:m+u/2,centerY:g+d/2}}function pd(e,t="center"){return Nt(e)?{x:Ot(e.x,t),y:Ot(e.y,t)}:(e=Ot(e,t),{x:e,y:e})}const r_=(e,t)=>e&&e.autoFit&&t<1;function s_(e,t){const n=e.font,i=jt(n)?n:[n];return r_(e,t)?i.map(function(r){const s=ce(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,ce(s)}):i.map(r=>ce(r))}function o_(e){return e&&(sn(e.xValue)||sn(e.yValue))}function a_(e,t,n=0,i){return e-hd(t,i)+n}function is(e,t,n){const i=n.init;if(i){if(i===!0)return c_(t,n)}else return;return $2(e,t,n)}function l_(e,t,n){let i=!1;return t.forEach(r=>{on(e[r])?(i=!0,n[r]=e[r]):sn(n[r])&&delete n[r]}),i}function c_(e,t){const n=t.type||"line";return H2[n](e)}function $2(e,t,n){const i=Jt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return c_(t,n);if(Nt(i))return i}const md=new Map,V2=e=>isNaN(e)||e<=0,Y2=e=>e.reduce(function(t,n){return t+=n.string,t},"");function ll(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function cl(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(ve(i)),e.translate(-t,-n))}function ui(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function rs(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function ul(e,t){const n=t.content;if(ll(n))return{width:Fi(n.width,t.width),height:Fi(n.height,t.height)};const i=s_(t),r=t.textStrokeWidth,s=jt(n)?n:[n],a=s.join()+Y2(i)+r+(e._measureText?"-spriting":"");return md.has(a)||md.set(a,K2(e,s,i,r)),md.get(a)}function u_(e,t,n){const{x:i,y:r,width:s,height:a}=t;e.save(),rs(e,n);const l=ui(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),qr(e,{x:i,y:r,w:s,h:a,radius:F2(Ei(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),l&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function d_(e,t,n,i){const r=n.content;if(ll(r)){e.save(),e.globalAlpha=Q2(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=jt(r)?r:[r],a=s_(n,i),l=n.color,u=jt(l)?l:[l],d=W2(t,n),h=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,q2(e,n)&&X2(e,{x:d,y:h},s,a),Z2(e,{x:d,y:h},s,{fonts:a,colors:u}),e.restore()}function q2(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function j2(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*iu;if(ll(a)){e.save(),e.translate(n,i),e.rotate(u),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}V2(r)||G2(e,{x:n,y:i,radius:r,rotation:l,style:a,rad:u})}function G2(e,{x:t,y:n,radius:i,rotation:r,style:s,rad:a}){let l,u,d,h;switch(e.beginPath(),s){default:e.arc(t,n,i,0,ne),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=Ma,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=Ma,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":h=i*.516,d=i-h,l=Math.cos(a+Dn)*d,u=Math.sin(a+Dn)*d,e.arc(t-l,n-u,h,a-Pt,a-oe),e.arc(t+u,n-l,h,a-oe,a),e.arc(t+l,n+u,h,a,a+oe),e.arc(t-u,n+l,h,a+oe,a+Pt),e.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,e.rect(t-d,n-d,2*d,2*d);break}a+=Dn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+u,n-l),e.lineTo(t+l,n+u),e.lineTo(t-u,n+l),e.closePath();break;case"crossRot":a+=Dn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l),a+=Dn,l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function K2(e,t,n,i){e.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=n[Math.min(l,n.length-1)];e.font=u.string;const d=t[l];s=Math.max(s,e.measureText(d).width+i),a+=u.lineHeight}return e.restore(),{width:s,height:a}}function X2(e,{x:t,y:n},i,r){e.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;e.font=u.string,e.strokeText(a,t,n+d/2+s),s+=d}),e.stroke()}function Z2(e,{x:t,y:n},i,{fonts:r,colors:s}){let a=0;i.forEach(function(l,u){const d=s[Math.min(u,s.length-1)],h=r[Math.min(u,r.length-1)],m=h.lineHeight;e.beginPath(),e.font=h.string,e.fillStyle=d,e.fillText(l,t,n+m/2+a),a+=m,e.fill()})}function Q2(e,t){const n=Ai(e)?e:t;return Ai(n)?al(n,0,1):1}const f_=["left","bottom","top","right"];function J2(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&rI(t,s);if(!a||oI(t,s,a))return;if(e.save(),e.beginPath(),!ui(e,s))return e.restore();const{separatorStart:u,separatorEnd:d}=tI(t,a),{sideStart:h,sideEnd:m}=nI(t,a,u);(s.margin>0||r.borderWidth===0)&&(e.moveTo(u.x,u.y),e.lineTo(d.x,d.y)),e.moveTo(h.x,h.y),e.lineTo(m.x,m.y);const g=xr({x:n,y:i},t.getCenterPoint(),ve(-t.rotation));e.lineTo(g.x,g.y),e.stroke(),e.restore()}function tI(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=eI(e,t);let l,u;return t==="left"||t==="right"?(l={x:n+a,y:i},u={x:l.x,y:s}):(l={x:n,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function eI(e,t){const{width:n,height:i,options:r}=e,s=r.callout.margin+r.borderWidth/2;return t==="right"?n+s:t==="bottom"?i+s:-s}function nI(e,t,n){const{y:i,width:r,height:s,options:a}=e,l=a.callout.start,u=iI(t,a.callout);let d,h;return t==="left"||t==="right"?(d={x:n.x,y:i+Fi(s,l)},h={x:d.x+u,y:d.y}):(d={x:n.x+Fi(r,l),y:n.y},h={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:h}}function iI(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function rI(e,t){const n=t.position;return f_.includes(n)?n:sI(e,t)}function sI(e,t){const{x:n,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:h,centerY:m,rotation:g}=e,y={x:h,y:m},x=t.start,v=Fi(a,x),S=Fi(l,x),O=[n,n+v,n+v,r],A=[i+S,s,i,s],P=[];for(let L=0;L<4;L++){const R=xr({x:O[L],y:A[L]},y,ve(g));P.push({position:f_[L],distance:Yr(R,{x:u,y:d})})}return P.sort((L,R)=>L.distance-R.distance)[0].position}function oI(e,t,n){const{pointX:i,pointY:r}=e,s=t.margin;let a=i,l=r;return n==="left"?a+=s:n==="right"?a-=s:n==="top"?l+=s:n==="bottom"&&(l-=s),e.inRange(a,l)}const h_={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 ss(e,t,n){return t=typeof t=="number"?t:e.parse(t),le(t)?e.getPixelForValue(t):n}function Sr(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const r=n.charAt(0),s=Object.values(e).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function p_(e,t){if(e){const n=e.options.reverse,i=ss(e,t.min,n?t.end:t.start),r=ss(e,t.max,n?t.start:t.end);return{start:i,end:r}}}function m_(e,t){const{chartArea:n,scales:i}=e,r=i[Sr(i,t,"xScaleID")],s=i[Sr(i,t,"yScaleID")];let a=n.width/2,l=n.height/2;return r&&(a=ss(r,t.xValue,r.left+r.width/2)),s&&(l=ss(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function gd(e,t){const n=e.scales,i=n[Sr(n,t,"xScaleID")],r=n[Sr(n,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||e.chartArea,{top:l,bottom:u}=r||e.chartArea;const d=y_(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=y_(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=h.start,u=h.end,{x:s,y:l,x2:a,y2:u,width:a-s,height:u-l,centerX:s+(a-s)/2,centerY:l+(u-l)/2}}function g_(e,t){if(!o_(t)){const n=gd(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const r=i*2,s=n.centerX+t.xAdjust,a=n.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return lI(e,t)}function aI(e,t){const{scales:n,chartArea:i}=e,r=n[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?cI(r,s,t):uI(n,s,t),s}function __(e,t){const n=gd(e,t);return n.initProperties=is(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:hI(e,n,t),initProperties:n.initProperties}],n}function lI(e,t){const n=m_(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function y_(e,t){const n=p_(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function cI(e,t,n){const i=ss(e,n.value,NaN),r=ss(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function uI(e,t,n){for(const i of Object.keys(h_)){const r=e[Sr(e,n,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=h_[i],m=p_(r,{min:n[s],max:n[a],start:r[l],end:r[u]});t[d]=m.start,t[h]=m.end}}}function dI({properties:e,options:t},n,i,r){const{x:s,x2:a,width:l}=e;return b_({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:n.width})}function fI({properties:e,options:t},n,i,r){const{y:s,y2:a,height:l}=e;return b_({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:n.height})}function b_(e,t){const{start:n,end:i,borderWidth:r}=e,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-n-a-l-t.size;return n+r/2+u+hd(d,s)}function hI(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=pd(i.position),s=Se(i.padding),a=ul(e.ctx,i),l=dI({properties:t,options:n},a,r,s),u=fI({properties:t,options:n},a,r,s),d=a.width+s.width,h=a.height+s.height;return{x:l,y:u,x2:l+d,y2:u+h,width:d,height:h,centerX:l+d/2,centerY:u+h/2,rotation:i.rotation}}const _d=["enter","leave"],yd=_d.concat("click");function pI(e,t,n){t.listened=l_(n,yd,t.listeners),t.moveListened=!1,_d.forEach(i=>{on(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&on(i.click)&&(t.listened=!0),t.moveListened||_d.forEach(r=>{on(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function mI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return gI(e,t,n);case"click":return _I(e,t,n)}}function gI(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=fd(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=x_(s,"leave",r,i);return x_(s,"enter",i,r)||a}function x_({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=w_(a.options[n]||e.listeners[n],a,t)||s);return s}function _I(e,t,n){const i=e.listeners,r=fd(e.visibleElements,t,n.interaction);let s;for(const a of r)s=w_(a.options.click||i.click,a,t)||s;return s}function w_(e,t,n){return Jt(e,[t.$context,n])===!0}const dl=["afterDraw","beforeDraw"];function yI(e,t,n){const i=t.visibleElements;t.hooked=l_(n,dl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||dl.forEach(s=>{on(r.options[s])&&(t.hooked=!0)})})}function v_(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Jt(i,[t.$context])}}function bI(e,t,n){const i=TI(e.scales,t,n);let r=S_(t,i,"min","suggestedMin");r=S_(t,i,"max","suggestedMax")||r,r&&on(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function xI(e,t){for(const n of e)vI(n,t)}function S_(e,t,n,i){if(le(t[n])&&!wI(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function wI(e,t,n){return sn(e[t])||sn(e[n])}function vI(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=Sr(t,e,n);i&&!t[i]&&SI(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function SI(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(sn(e[n+i]))return!0;return!1}function TI(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ot(t.min,Number.NEGATIVE_INFINITY),max:Ot(t.max,Number.POSITIVE_INFINITY)};for(const l of n)l.scaleID===r?T_(l,t,["value","endValue"],a):Sr(e,l,s)===r&&T_(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function T_(e,t,n,i){for(const r of n){const s=e[r];if(sn(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class os extends Ye{inRange(t,n,i,r){const{x:s,y:a}=xr({x:t,y:n},this.getCenterPoint(r),ve(-this.options.rotation));return Q0({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return vr(this,t)}draw(t){t.save(),cl(t,this.getCenterPoint(),this.options.rotation),u_(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return __(t,n)}}os.id="boxAnnotation",os.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},os.defaultRoutes={borderColor:"color",backgroundColor:"color"},os.descriptors={label:{_fallback:!0}};class fl extends Ye{inRange(t,n,i,r){return J0({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return vr(this,t)}draw(t){const n=this.options;!n.display||!n.content||(AI(t,this),t.save(),cl(t,this.getCenterPoint(),this.rotation),d_(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=kI(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=DI(t,n,i);let l=ul(t.ctx,n);const u=CI(l,a);r_(n,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:m}=n,g=i_(s,l,{borderWidth:0,position:d,xAdjust:h,yAdjust:m});return{initProperties:is(t,g,n),...g,...r,rotation:n.rotation,_fitRatio:u}}}fl.id="doughnutLabelAnnotation",fl.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},fl.defaultRoutes={};function kI(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof ro&&MI(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function MI(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function DI({chartArea:e},t,n){const{left:i,top:r,right:s,bottom:a}=e,{innerRadius:l,offsetX:u,offsetY:d}=n.controller,h=(i+s)/2+u,m=(r+a)/2+d,g={left:Math.max(h-l,i),right:Math.min(h+l,s),top:Math.max(m-l,r),bottom:Math.min(m+l,a)},y={x:(g.left+g.right)/2,y:(g.top+g.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=y.y>m,O=S?r+x:a-x,A=OI(O,h,m,v);return{controllerMeta:{_centerX:h,_centerY:m,_radius:v,_counterclockwise:S,...A},point:y,radius:Math.min(l,Math.min(g.right-g.left,g.bottom-g.top)/2)}}function CI({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function OI(e,t,n,i){const r=Math.pow(n-e,2),s=Math.pow(i,2),a=t*-2,l=Math.pow(t,2)+r-s,u=Math.pow(a,2)-4*l;if(u<=0)return{_startAngle:0,_endAngle:ne};const d=(-a-Math.sqrt(u))/2,h=(-a+Math.sqrt(u))/2;return{_startAngle:Ca({x:t,y:n},{x:d,y:e}).angle,_endAngle:Ca({x:t,y:n},{x:h,y:e}).angle}}function AI(e,t){const{_centerX:n,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;e.save();const d=ui(e,u);e.fillStyle=u.backgroundColor,e.beginPath(),e.arc(n,i,r,s,a,l),e.closePath(),e.fill(),d&&e.stroke(),e.restore()}class vo extends Ye{inRange(t,n,i,r){return J0({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return vr(this,t)}draw(t){const n=this.options,i=!sn(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),cl(t,this.getCenterPoint(),this.rotation),J2(t,this),u_(t,this,n),d_(t,EI(this),n),t.restore())}resolveElementProperties(t,n){let i;if(o_(n))i=m_(t,n);else{const{centerX:l,centerY:u}=gd(t,n);i={x:l,y:u}}const r=Se(n.padding),s=ul(t.ctx,n),a=i_(i,s,n,r);return{initProperties:is(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}vo.id="labelAnnotation",vo.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},vo.defaultRoutes={borderColor:"color"};function EI({x:e,y:t,width:n,height:i,options:r}){const s=r.borderWidth/2,a=Se(r.padding);return{x:e+a.left+s,y:t+a.top+s,width:n-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const bd=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),xd=(e,t,n)=>bd(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,k_=(e,t,n)=>bd(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,So=e=>e*e,RI=(e,t,{x:n,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(n,r),end:Math.max(n,r),value:e},M_=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,wd=(e,t,n,i)=>({x:M_(e.x,t.x,n.x,i),y:M_(e.y,t.y,n.y,i)}),D_=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),C_=(e,t,n,i)=>-Math.atan2(D_(e.x,t.x,n.x,i),D_(e.y,t.y,n.y,i))+.5*Pt;class To extends Ye{inRange(t,n,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:l,ctx:u}=this;if(l){ui(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,m=t*h.currentDevicePixelRatio,g=n*h.currentDevicePixelRatio,y=u.isPointInStroke(l,m,g)||vd(this,a,r);return u.restore(),y}const d=So(s);return NI(this,a,d,r)||vd(this,a,r)}return PI(this,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return vr(this,t)}draw(t){const{x:n,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!ui(t,l))return t.restore();rs(t,l);const u=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-i,2));if(l.curve&&a)return VI(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=P_(this),y=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(y),t.beginPath(),t.moveTo(0+m,0),t.lineTo(u-g,0),t.shadowColor=l.borderShadowColor,t.stroke(),Sd(t,0,m,d),Sd(t,u,-g,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=aI(t,n),{x:r,y:s,x2:a,y2:l}=i,u=II(i,t.chartArea),d=u?LI({x:r,y:s},{x:a,y:l},t.chartArea):{x:r,y:s,x2:a,y2:l,width:Math.abs(a-r),height:Math.abs(l-s)};if(d.centerX=(a+r)/2,d.centerY=(l+s)/2,d.initProperties=is(t,d,n),n.curve){const m={x:d.x,y:d.y},g={x:d.x2,y:d.y2};d.cp=$I(d,n,Yr(m,g))}const h=BI(t,d,n.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}To.id="lineAnnotation";const O_={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};To.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},O_),fill:!1,length:12,start:Object.assign({},O_),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({},vo.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},To.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},To.defaultRoutes={borderColor:"color"};function PI(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=RI(t,n,e.getProps(["x","y","x2","y2"],s),i);return Z0(a,r)||vd(e,{mouseX:t,mouseY:n},s,i)}function II({x:e,y:t,x2:n,y2:i},{top:r,right:s,bottom:a,left:l}){return!(e<l&&n<l||e>s&&n>s||t<r&&i<r||t>a&&i>a)}function A_({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=k_(a,{x:e,y:t},n),e=a),e>r&&(t=k_(r,{x:e,y:t},n),e=r),t<i&&(e=xd(i,{x:e,y:t},n),t=i),t>s&&(e=xd(s,{x:e,y:t},n),t=s),{x:e,y:t}}function LI(e,t,n){const{x:i,y:r}=A_(e,t,n),{x:s,y:a}=A_(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function NI(e,{mouseX:t,mouseY:n},i=wr,r){const{x:s,y:a,x2:l,y2:u}=e.getProps(["x","y","x2","y2"],r),d=l-s,h=u-a,m=So(d)+So(h),g=m===0?-1:((t-s)*d+(n-a)*h)/m;let y,x;return g<0?(y=s,x=a):g>1?(y=l,x=u):(y=s+g*d,x=a+g*h),So(t-y)+So(n-x)<=i}function vd(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function BI(e,t,n){const i=n.borderWidth,r=Se(n.padding),s=ul(e.ctx,n),a=s.width+r.width+i,l=s.height+r.height+i;return zI(t,n,{width:a,height:l,padding:r},e.chartArea)}function FI(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>Pt/2?s-Pt:s<Pt/-2?s+Pt:s}function zI(e,t,n,i){const{width:r,height:s,padding:a}=n,{xAdjust:l,yAdjust:u}=t,d={x:e.x,y:e.y},h={x:e.x2,y:e.y2},m=t.rotation==="auto"?FI(e):ve(t.rotation),g=UI(r,s,m),y=HI(e,t,{labelSize:g,padding:a},i),x=e.cp?wd(d,e.cp,h,y):bd(d,h,y),v={size:g.w,min:i.left,max:i.right,padding:a.left},S={size:g.h,min:i.top,max:i.bottom,padding:a.top},O=R_(x.x,v)+l,A=R_(x.y,S)+u;return{x:O-r/2,y:A-s/2,x2:O+r/2,y2:A+s/2,centerX:O,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:Da(m)}}function UI(e,t,n){const i=Math.cos(n),r=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*r),h:Math.abs(e*r)+Math.abs(t*i)}}function HI(e,t,n,i){let r;const s=WI(e,i);return t.position==="start"?r=E_({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-E_({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=hd(1,t.position),r}function E_(e,t,n,i){const{labelSize:r,padding:s}=t,a=e.w*i.dx,l=e.h*i.dy,u=a>0&&(r.w/2+s.left-i.x)/a,d=l>0&&(r.h/2+s.top-i.y)/l;return al(Math.max(u,d),0,.25)}function WI(e,t){const{x:n,x2:i,y:r,y2:s}=e,a=Math.min(r,s)-t.top,l=Math.min(n,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(n,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function R_(e,t){const{size:n,min:i,max:r,padding:s}=t,a=n/2;return n>r-i?(r+i)/2:(i>=e-s-a&&(e=i+s+a),r<=e+s+a&&(e=r-s-a),e)}function P_(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:I_(e,n),endAdjust:I_(e,i)}}function I_(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,r=e.options.borderWidth/2,s={x:n,y:i+r};return Math.abs(xd(0,s,{x:0,y:r}))}function Sd(e,t,n,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+n;e.beginPath(),rs(e,i),ui(e,i),e.moveTo(d,-s),e.lineTo(t+n,0),e.lineTo(d,s),a===!0?(e.fillStyle=l||u,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function $I(e,t,n){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=e,d=Math.atan2(a-r,s-i),h=pd(t.controlPoint,0),m={x:l+Fi(n,h.x,!1),y:u+Fi(n,h.y,!1)};return xr(m,{x:l,y:u},d)}function L_(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),Sd(e,0,-r,s),e.restore())}function VI(e,t,n,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=P_(t),y={x:r,y:s},x={x:a,y:l},v=C_(y,n,x,0),S=C_(y,n,x,1)-Pt,O=wd(y,n,x,m/i),A=wd(y,n,x,1-g/i),P=new Path2D;e.beginPath(),P.moveTo(O.x,O.y),P.quadraticCurveTo(n.x,n.y,A.x,A.y),e.shadowColor=u.borderShadowColor,e.stroke(P),t.path=P,t.ctx=e,L_(e,O,{angle:v,adjust:m},d),L_(e,A,{angle:S,adjust:g},h)}class ko extends Ye{inRange(t,n,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return YI({x:t,y:n},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:l,y:u,x2:d,y2:h}=this.getProps(["x","y","x2","y2"],r),m=i==="y"?{start:u,end:h}:{start:l,end:d},g=xr({x:t,y:n},this.getCenterPoint(r),ve(-s));return g[i]>=m.start-a-wr&&g[i]<=m.end+a+wr}getCenterPoint(t){return vr(this,t)}draw(t){const{width:n,height:i,centerX:r,centerY:s,options:a}=this;t.save(),cl(t,this.getCenterPoint(),a.rotation),rs(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=ui(t,a);t.ellipse(r,s,i/2,n/2,Pt/2,0,2*Pt),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return __(t,n)}}ko.id="ellipseAnnotation",ko.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},os.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},ko.defaultRoutes={borderColor:"color",backgroundColor:"color"},ko.descriptors={label:{_fallback:!0}};function YI(e,t,n,i){const{width:r,height:s,centerX:a,centerY:l}=t,u=r/2,d=s/2;if(u<=0||d<=0)return!1;const h=ve(n||0),m=Math.cos(h),g=Math.sin(h),y=Math.pow(m*(e.x-a)+g*(e.y-l),2),x=Math.pow(g*(e.x-a)-m*(e.y-l),2);return y/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class hl extends Ye{inRange(t,n,i,r){const{x:s,y:a,x2:l,y2:u,width:d}=this.getProps(["x","y","x2","y2","width"],r),h=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?z2({x:t,y:n},this.getCenterPoint(r),d/2,h):Z0(i==="y"?{start:a,end:u,value:n}:{start:s,end:l,value:t},h)}getCenterPoint(t){return vr(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,rs(t,n);const r=ui(t,n);j2(t,this,this.centerX,this.centerY),r&&!ll(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=g_(t,n);return i.initProperties=is(t,i,n),i}}hl.id="pointAnnotation",hl.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},hl.defaultRoutes={borderColor:"color",backgroundColor:"color"};class pl extends Ye{inRange(t,n,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&jI(this.elements,t,n,r);const s=xr({x:t,y:n},this.getCenterPoint(r),ve(-this.options.rotation)),a=this.elements.map(d=>i==="y"?d.bY:d.bX),l=Math.min(...a),u=Math.max(...a);return s[i]>=l&&s[i]<=u}getCenterPoint(t){return vr(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,rs(t,i);const r=ui(t,i);let s=!0;for(const a of n)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=g_(t,n),{sides:r,rotation:s}=n,a=[],l=2*Pt/r;let u=s*iu;for(let d=0;d<r;d++,u+=l){const h=qI(i,n,u);h.initProperties=is(t,i,n),a.push(h)}return i.elements=a,i}}pl.id="polygonAnnotation",pl.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},pl.defaultRoutes={borderColor:"color",backgroundColor:"color"};function qI({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:e+l*n,y:t-u*n};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:e+l*(n+a),bY:t-u*(n+a)}}}function jI(e,t,n,i){let r=!1,s=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const l=a.getProps(["bX","bY"],i);l.bY>n!=s.bY>n&&t<(s.bX-l.bX)*(n-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const zi={box:os,doughnutLabel:fl,ellipse:ko,label:vo,line:To,point:hl,polygon:pl};Object.keys(zi).forEach(e=>{ae.describe(`elements.${zi[e].id}`,{_fallback:"plugins.annotation.common"})});const GI={update:Object.assign},KI=yd.concat(dl),N_=(e,t)=>Nt(t)?Md(e,t):e,Td=e=>e==="color"||e==="font";function kd(e="line"){return zi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function XI(e,t,n,i){const r=QI(e,n.animations,i),s=t.annotations,a=eL(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=B_(a,l,u.type),h=u.setContext(tL(e,d,a,u)),m=d.resolveElementProperties(e,h);m.skip=ZI(m),"elements"in m&&(JI(d,m.elements,h,r),delete m.elements),sn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=F_(h),r.update(d,m)}}function ZI(e){return isNaN(e.x)||isNaN(e.y)}function QI(e,t,n){return n==="reset"||n==="none"||n==="resize"?GI:new _u(e,t)}function JI(e,t,n,i){const r=e.elements||(e.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=B_(r,s,a.type,a.initProperties),d=n[a.optionScope].override(a);l.options=F_(d),i.update(u,l)}}function B_(e,t,n,i){const r=zi[kd(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function F_(e){const t=zi[kd(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Md(e,t.defaults),Md(e,t.defaultRoutes));for(const i of KI)n[i]=e[i];return n}function Md(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];Td(i)&&jt(s)?n[i]=s.map(a=>N_(a,r)):n[i]=N_(s,r)}return n}function tL(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function eL(e,t){const n=t.length,i=e.length;if(i<n){const r=n-i;e.splice(i,0,...new Array(r))}else i>n&&e.splice(n,i-n);return e}var nL="3.1.0";const Ui=new Map,z_=e=>e.type!=="doughnutLabel",iL=yd.concat(dl);var U_={id:"annotation",version:nL,beforeRegister(){U2("chart.js","4.0",an.version)},afterRegister(){an.register(zi)},afterUnregister(){an.unregister(zi)},beforeInit(e){Ui.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=Ui.get(e),r=i.annotations=[];let s=n.annotations;Nt(s)?Object.keys(s).forEach(a=>{const l=s[a];Nt(l)&&(l.id=a,r.push(l))}):jt(s)&&r.push(...s),xI(r.filter(z_),e.scales)},afterDataLimits(e,t){const n=Ui.get(e);bI(e,t.scale,n.annotations.filter(z_).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Ui.get(e);pI(e,i,n),XI(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),yI(e,i,n)},beforeDatasetsDraw(e,t,n){Mo(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Mo(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Mo(e,t.index,n.clip)},beforeDraw(e,t,n){Mo(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Mo(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=Ui.get(e);mI(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){Ui.delete(e)},getAnnotations(e){const t=Ui.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return fd(e,t,n)},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:e=>!iL.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${zi[kd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Td,_fallback:!0},_indexable:Td}},additionalOptionScopes:[""]};function Mo(e,t,n){const{ctx:i,chartArea:r}=e,s=Ui.get(e);n&&to(i,r);const a=rL(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)sL(i,r,s,l);n&&eo(i)}function rL(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&n.push({element:r});return n}function sL(e,t,n,i){const r=i.element;i.main?(v_(n,r,"beforeDraw"),r.draw(e,t),v_(n,r,"afterDraw")):r.draw(e,t)}const oL={class:"zoom-timerange-container"},aL={class:"zoom-timerange-details"},lL={class:"label","data-testid":"zoom-timerange-from"},cL={class:"label","data-testid":"zoom-timerange-to"},uL=f.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.ref(ns({tickValue:t.start,granularity:t.granularity})),r=f.ref(ns({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{S0(()=>{i.value=ns({tickValue:a,granularity:t.granularity}),r.value=ns({tickValue:l,granularity:t.granularity})},100)()};return f.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(f.openBlock(),f.createElementBlock("div",oL,[f.createElementVNode("div",aL,[f.createElementVNode("div",lL,f.toDisplayString(f.unref(n).t("zoom_time_range.from")),1),f.createElementVNode("div",null,f.toDisplayString(i.value),1),f.createElementVNode("div",cL,f.toDisplayString(f.unref(n).t("zoom_time_range.to")),1),f.createElementVNode("div",null,f.toDisplayString(r.value),1)])]))}}),ke=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},H_=ke(uL,[["__scopeId","data-v-4fa681cf"]]),dL={class:"zoom-actions-container"},fL={class:"zoom-actions-heading"},hL={class:"zoom-action-select"},pL=["data-testid"],mL=["aria-disabled","href"],gL=["onClick"],_L=ke(f.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,r=s=>{s.action&&(s.action(n.newTimeRange),i("onAction"))};return(s,a)=>(f.openBlock(),f.createElementBlock("div",dL,[f.createElementVNode("div",fL,[f.createVNode(H_,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),f.createVNode(f.unref(fe.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${f.unref(Fc)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=f.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),f.createElementVNode("div",hL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.zoomActionItems,l=>(f.openBlock(),f.createElementBlock("div",{key:l.key,class:f.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(f.openBlock(),f.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},f.toDisplayString(l.label),9,mL)):(f.openBlock(),f.createElementBlock("div",{key:1,onClick:u=>r(l)},f.toDisplayString(l.label),9,gL))],10,pL))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),yL={key:2},bL={class:"tooltip-title"},xL={class:"title"},wL={key:0,class:"subtitle"},vL={class:"context"},SL={class:"metric"},TL={class:"tooltip"},kL={key:0,class:"square-marker marker-placeholder"},ML={class:"display-value"},Do=ke(f.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(e,{emit:t}){const n=t,i=e,r=f.ref(null),{x:s,y:a,isDragging:l}=mP(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=f.computed(()=>`${a.value}px`),d=f.computed(()=>`${s.value}px`),h=f.computed(()=>i.state.tooltipContext),m=f.computed(()=>i.state.metricDisplay),g=f.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return f.watch(()=>[i.absoluteLeft,i.absoluteTop],([y,x])=>{l.value||(s.value=parseFloat(y),a.value=parseFloat(x))}),f.watch(l,y=>{y?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),f.watch(r,y=>{if(y){const{width:x,height:v}=y.getBoundingClientRect();n("dimensions",{width:x,height:v})}}),(y,x)=>e.state.showTooltip?(f.openBlock(),f.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:f.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:f.normalizeStyle({transform:g.value?`translate(${d.value}, ${u.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:g.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(f.openBlock(),f.createBlock(H_,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(f.openBlock(),f.createBlock(_L,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:x[0]||(x[0]=v=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(f.openBlock(),f.createElementBlock("div",yL,[f.createElementVNode("div",bL,[f.createElementVNode("div",xL,[f.createElementVNode("div",null,f.toDisplayString(e.tooltipTitle),1),g.value?(f.openBlock(),f.createBlock(f.unref(fe.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${f.unref(Fc)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])):f.createCommentVNode("",!0)]),h.value||m.value?(f.openBlock(),f.createElementBlock("div",wL,[f.createElementVNode("div",vL,f.toDisplayString(h.value),1),f.createElementVNode("div",SL,f.toDisplayString(m.value),1)])):f.createCommentVNode("",!0)]),f.createElementVNode("ul",TL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:O,value:A,isSegmentEmpty:P,isExtra:L},R)=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:O+R},[e.state.tooltipSeries.length?(f.openBlock(),f.createElementBlock("li",{key:0,class:f.normalizeClass({"extra-row":L})},[L?(f.openBlock(),f.createElementBlock("div",kL)):(f.openBlock(),f.createElementBlock("div",{key:1,class:"square-marker",style:f.normalizeStyle({background:String(v),borderColor:String(S)})},null,4)),f.createElementVNode("span",{class:f.normalizeClass(["display-label",{empty:P}])},f.toDisplayString(O),3),f.createElementVNode("span",ML,f.toDisplayString(A),1)],2)):f.createCommentVNode("",!0)],64))),128))])]))],6)):f.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),DL={key:0,class:"legend-container","data-testid":"legend"},CL=["onClick"],OL={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},AL=["stroke","stroke-dasharray"],EL=["title"],RL={class:"label truncate-label"},PL={key:0,class:"sub-label"},IL={key:0},LL={class:"tooltip-content"},ml=ke(f.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.inject("showLegendValues",!1),r=f.inject("legendPosition",f.ref(Le.Bottom)),s=({datasetIndex:u,index:d,isKey:h},m)=>h?`key-${m}`:`dataset-${u??0}-${d??0}`,a=(u=0,d)=>{if(t.chartInstance===null)return;const h=t.chartInstance instanceof an?t.chartInstance:t.chartInstance.chart,m=l(u,d);!h.getDatasetMeta(u).dataset&&d!==void 0?h.toggleDataVisibility(d):m?h.hide(u,d):h.show(u,d),h.update()},l=(u=0,d)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const h=t.chartInstance instanceof an?t.chartInstance:t.chartInstance.chart;return h.getDatasetMeta(u).dataset||d===void 0?h.isDatasetVisible(u):h.getDataVisibility(d)};return(u,d)=>{const h=f.resolveComponent("KTooltip");return f.unref(r)!==f.unref(Le).Hidden?(f.openBlock(),f.createElementBlock("ul",DL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.items,({fillStyle:m,strokeStyle:g,text:y,datasetIndex:x,index:v,value:S,isSegmentEmpty:O,isKey:A,lineDash:P},L)=>(f.openBlock(),f.createElementBlock("li",{key:s({datasetIndex:x,index:v,isKey:A},L),class:f.normalizeClass({"legend-key":A}),onClick:R=>A?void 0:a(x,v)},[P?.length?(f.openBlock(),f.createElementBlock("svg",OL,[f.createElementVNode("line",{stroke:g,"stroke-dasharray":P.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,AL)])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"square-marker",style:f.normalizeStyle({background:m,"border-color":g})},null,4)),f.createVNode(h,null,f.createSlots({default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["label-container",{"strike-through":!A&&!l(x,v),"inline-value":A}]),title:S&&(f.unref(i)||A)?`${y}: ${S.formatted}`:y},[f.createElementVNode("div",RL,f.toDisplayString(y),1),S&&(f.unref(i)||A)?(f.openBlock(),f.createElementBlock("div",PL,[A?(f.openBlock(),f.createElementBlock("span",IL,"-")):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(S.formatted),1)])):f.createCommentVNode("",!0)],10,EL)]),_:2},[O?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",LL,f.toDisplayString(f.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,CL))),128))])):f.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Ne=[];for(let e=0;e<256;++e)Ne.push((e+256).toString(16).slice(1));function NL(e,t=0){return(Ne[e[t+0]]+Ne[e[t+1]]+Ne[e[t+2]]+Ne[e[t+3]]+"-"+Ne[e[t+4]]+Ne[e[t+5]]+"-"+Ne[e[t+6]]+Ne[e[t+7]]+"-"+Ne[e[t+8]]+Ne[e[t+9]]+"-"+Ne[e[t+10]]+Ne[e[t+11]]+Ne[e[t+12]]+Ne[e[t+13]]+Ne[e[t+14]]+Ne[e[t+15]]).toLowerCase()}const BL=new Uint8Array(16);function FL(){return crypto.getRandomValues(BL)}function Dd(e,t,n){return crypto.randomUUID?crypto.randomUUID():zL(e)}function zL(e,t,n){e=e||{};const i=e.random??e.rng?.()??FL();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,NL(i)}const W_=(e,t)=>{const n=e.ctx,i=e.scales.y,r=e.scales.x,s=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):n.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),n.restore()};class $_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&W_(t,this._clickedElements)}afterEvent(t,{event:n}){if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,W_(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 UL=(e,t,n,i,r="#0275d8")=>{e&&(e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore())};class gl{id="coordinator";coordinator=null;instanceId="";stopWatcher=void 0;activeDimension=null;activeDimensionValue=null;requiresUpdate=!1;triggerOnSelf=!1;watchTimestamp=!1;watchDimension=!1;lastMouseBrushEvent=0;constructor({coordinator:t,requiresUpdate:n=!1,triggerOnSelf:i=!1,watchTimestamp:r=!1,watchDimension:s=!1}){this.instanceId=crypto.randomUUID(),this.coordinator=t,this.requiresUpdate=n,this.triggerOnSelf=i,this.watchTimestamp=r,this.watchDimension=s}afterInit(t){if(!this.coordinator)return;const n=this.requiresUpdate?()=>t.update("none"):()=>t.draw(),i=this._watchTimestamp(n),r=this._watchDimension(n);this.stopWatcher=()=>{i&&i(),r&&r()}}afterEvent(t,{event:n}){this.coordinator&&(n.type==="mousemove"||n.type==="mouseout")&&requestAnimationFrame(i=>this._onMouseBrush(n.native,t,i))}beforeDatasetDraw(t,n){if(!this.coordinator||!this.watchDimension||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;t.config.type==="doughnut"?this._highlightDimensionDonut(t):this._highlightDimensionDefault(t,n)}afterDatasetsDraw(t){if(t.ctx.globalAlpha=1,!this.coordinator||!this.watchTimestamp||!this.coordinator.activeTimestamp.value||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;const i=t.scales.x.getPixelForValue(this.coordinator.activeTimestamp.value),r=t.ctx;UL(r,i,t.scales.y.top,t.scales.y.bottom)}beforeDestroy(){this.stopWatcher&&this.stopWatcher()}_watchTimestamp(t){if(!this.coordinator)return;let n;return this.watchTimestamp&&(n=f.watch([this.coordinator.activeChart,this.coordinator.activeTimestamp],([i])=>{(i!==this.instanceId||this.triggerOnSelf)&&t()})),n}_watchDimension(t){if(!this.coordinator)return;let n;if(this.watchDimension){let i;n=f.watch([this.coordinator.activeChart,this.coordinator.activeDimension,this.coordinator.activeDimensionValue],([r,s,a])=>{clearTimeout(i),s===null&&(this.activeDimension=null),a===null&&(this.activeDimensionValue=null),i=setTimeout(()=>{this.activeDimension=s,this.activeDimensionValue=a,(r!==this.instanceId||this.triggerOnSelf)&&t()},this.coordinator?.DIMENSION_DEBOUNCE_MS??400),f.onWatcherCleanup(()=>{clearTimeout(i)})})}return n}_onMouseBrush(t,n,i){if(!this.coordinator)return;const r=t.type,s=Math.min(this.coordinator.TIMESTAMP_DEBOUNCE_MS,this.coordinator.DIMENSION_DEBOUNCE_MS);if(!(r==="mousemove"&&i-this.lastMouseBrushEvent<s)){if(r==="mousemove"){const a=this._getTimestamp(n,t),[l,u]=this._getDatasetDimension(n,t)??[];this.coordinator.activate({chartUuid:this.instanceId,timestamp:a,dimension:l,dimensionValue:u})}else r==="mouseout"&&this.coordinator.deactivate({chartUuid:this.instanceId});this.lastMouseBrushEvent=i}}_highlightDimensionDefault(t,n){if(this.activeDimension&&this.activeDimensionValue){const i=t.data.datasets.map((r,s)=>r?.dimension===this.activeDimension&&r?.dimensionValue===this.activeDimensionValue?s:-1).filter(r=>r>=0);i.length&&(t.ctx.globalAlpha=i.includes(n.index)?1:.3)}else t.ctx.globalAlpha=1}_highlightDimensionDonut(t){if(this.activeDimension&&this.activeDimensionValue){const{dimension:n,dimensionValue:i}=t.data.datasets[0];if(n===this.activeDimension){const r=i.findIndex(s=>s===this.activeDimensionValue);r>=0?t.setActiveElements([{datasetIndex:0,index:r}]):t.setActiveElements([])}else t.setActiveElements([])}else t.setActiveElements([])}_getDatasetDimension(t,n){const i=t.config.type,r=i!=="line",s=["doughnut","scatter"].includes(i)?"point":"dataset",a=t.getElementsAtEventForMode(n,s,{intersect:r},!1),[l]=a;if(!l)return;const{datasetIndex:u,index:d}=l,{dimension:h,dimensionValue:m}=t.data.datasets[u];return i==="doughnut"?[h,m[d]]:[h,m]}_getTimestamp(t,n){const[i]=t.getElementsAtEventForMode(n,"index",{intersect:!1},!1);if(i&&this.watchTimestamp){const{datasetIndex:r,index:s}=i,{x:a}=t.data.datasets[r].data[s];return a}}}const HL=["id"],WL=["id"],$L={class:"axis-tooltip-content"},VL="100%",YL="100%",qL=20,jL=20,V_=6,GL=0,KL=10,XL=10,ZL=1,QL=ke(f.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=St.useI18n(),{translateUnit:i}=St.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new $_,l=f.inject("analytics-dashboard-coordinator",null),u=new gl({coordinator:l,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),d=f.useTemplateRef("chartContainer"),h=f.useTemplateRef("chartParent"),m=({chart:X},ot)=>{const vt=X.data,lt=vt.labels?.indexOf(ot);return vt.datasets.reduce((bt,Rt,j)=>{if(X.isDatasetVisible(j)){const et=Rt.data[lt];return isNaN(et)?bt:bt+et}else return bt},0)},g=(X,ot,vt,lt)=>{const bt=lt==="horizontal";ot===null&&(ot=n.t("entityNoName"));const Rt={type:"label",yValue:rt=>bt?ot:m(rt,ot),xValue:rt=>bt?m(rt,ot):ot},j={...Rt,position:bt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>bt?0:-Math.abs(zP()),content:rt=>M0(m(rt,ot),vt)},et={...Rt,content:rt=>HP(m(rt,ot),UP(rt.chart,X)),position:bt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:rt=>bt?FP(M0(m(rt,ot),vt)):0,color:EP};return{[`${ot}-value`]:j,[`${ot}-percent`]:et}},y=f.useTemplateRef("canvas"),x=f.useTemplateRef("axis"),v=Dd(),S=Dd(),O=f.ref([]),A=f.inject("legendPosition",Le.Bottom),P=f.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),L=f.toRef(t,"metricUnit"),R=f.computed(()=>t.orientation==="horizontal"),F=f.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:f.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:f.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:R.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:U,tooltipAbsoluteTop:D}=St.useTooltipAbsolutePosition(h,F),w=f.ref(0),C=()=>t.annotations&&t.chartData.labels?.reduce((X,ot)=>Object.assign(X,g(t.chartData,ot,L.value,t.orientation)),{}),N={id:v,afterUpdate(X){w.value+=1,O.value=Yu(X,t.legendValues,t.chartLegendSortFn)}},$={id:S,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?C():{}}},st=[N,{id:"axisHover",afterEvent(X,ot){if(P.show=!1,ot.event.type==="mousemove"){const vt=ot.event,lt=X.options.indexAxis,bt=X.scales,Rt=X.scales[lt].getLabelForValue(Number(X.scales[lt].getValueForPixel(vt[lt]))),et=X.scales[lt].getLabels().indexOf(Rt),rt=t.chartData.isLabelEmpty?.[et];if((_t=>_t==="x"?vt.y>bt.x.top:vt.x<bt.y.right)(lt)){F.interactionMode!=="interactive"&&(F.showTooltip=!1);const $t=X.canvas.getContext("2d").measureText(Rt).width,Me=Math.abs(Math.round(vt.x-$t*.5)),Te=Math.round(vt.x+$t*.5),ee=X.canvas.getBoundingClientRect(),je=40;P.left=lt==="x"?`${(Me>0?Me:Te)-P.offset+ee.left}px`:`${vt.x-$t*.5-P.offset+ee.left}px`,P.top=`${vt.y-je+ee.top}px`,Rt.length>il?(P.show=!0,P.text=Rt):rt?(P.text=n.t("emptyEntityInfo"),P.show=!0):P.show=!1}else P.show=!1}}},a,u,...t.annotations?[$]:[]],dt=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),ut=f.ref(0),ct=f.ref(0),Tt=new ResizeObserver(S0(X=>{ut.value=X[0].contentRect.width,ct.value=X[0].contentRect.height},100)),at=f.computed(()=>{const X=t.chartData?.labels?.length;return y.value&&X&&!R.value?`${Math.max(X*(qL+V_),ut.value)}px`:VL}),pt=f.computed(()=>{const X=t.chartData?.labels?.length;return y.value&&X&&R.value?`${Math.max(X*(jL+V_),ct.value)}px`:YL});St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&an.register(U_),d.value&&(ut.value=d.value.offsetWidth,ct.value=d.value.offsetHeight,Tt.observe(d.value))}),f.onUnmounted(()=>{d.value&&Tt.unobserve(d.value)});const G=f.computed(()=>{const X=St.useBarChartOptions({tooltipState:F,legendID:v,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:R.value?"y":"x",numLabels:dt});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:C(),clip:!1}}}}),B=St.useChartJSCommon("bar",y,f.toRef(t,"chartData"),st,G);f.onBeforeUnmount(()=>{an.unregister(U_)});const z={[Le.Bottom]:"column"},Z=f.computed(()=>{if(x.value&&B.value){const X=window.devicePixelRatio,ot=B.value,vt=ot.scales.y.width*X+ZL,lt=(ot.scales.y.height+ot.scales.y.top+ot.scales.x.height)*X,bt=x.value.getContext("2d");return bt.scale(X,X),bt.canvas.width=vt,bt.canvas.height=lt,bt.canvas.style.width=`${vt/X}px`,bt.canvas.style.height=`${lt/X}px`,{scale:X,width:vt*X,height:lt*X,targetCtx:bt}}return null}),it=X=>{const ot=X.target;if(Z.value&&B.value&&!R.value){const vt=Z.value.scale,lt=Z.value.targetCtx,bt=Z.value.width,Rt=Z.value.height,j=B.value,et=j.canvas;lt.fillStyle="white",ot.scrollLeft>=GL&&ot.scrollLeft<=KL?(lt.globalCompositeOperation="source-over",lt.clearRect(0,0,bt,Rt),lt.drawImage(et,0,0,bt,Rt,0,0,bt,Rt),lt.globalCompositeOperation="destination-over",lt.fillRect(0,0,bt,Rt)):(lt.globalCompositeOperation="source-over",lt.fillRect(0,(j.scales.y.height+j.scales.y.top+XL)*vt,bt,j.scales.x.height*vt))}F.offsetY=ot.scrollTop,F.offsetX=ot.scrollLeft,P.offset=ot.scrollLeft},ht=({width:X,height:ot})=>{F.width=X,F.height=ot};f.watch(()=>t.orientation,()=>{if(x.value&&Z.value){const X=Z.value.width,ot=Z.value.height;(x.value?.getContext("2d")).clearRect(0,0,X,ot)}F.showTooltip=!1,F.interactionMode="idle"}),f.watch(()=>t.annotations,X=>{B.value&&(X?B.value.options.plugins.annotation.annotations=C(t.chartData):delete B.value.options.plugins.annotation.annotations)});const mt=()=>{F.showTooltip&&(F.interactionMode!=="idle"?F.interactionMode="idle":F.interactionMode="interactive")};return(X,ot)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",z[f.unref(A)]])},[f.createElementVNode("canvas",{id:f.unref(r),ref:"axis",class:"axis"},null,8,HL),f.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ot[0]||(ot[0]=vt=>mt()),onScroll:it},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:at.value,height:pt.value})},[f.createElementVNode("canvas",{id:f.unref(s),ref:"canvas",class:"chart-canvas"},null,8,WL)],4)],544),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[P.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:P.top,left:P.left}),width:"auto"},[f.createElementVNode("div",$L,f.toDisplayString(P.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(Do,{"absolute-left":f.unref(U),"absolute-top":f.unref(D),"chart-parent-ref":h.value,state:F,"tooltip-title":e.tooltipTitle,onDimensions:ht},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),f.createVNode(ml,{id:f.unref(v),"chart-instance":f.unref(B),items:O.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6994dd8d"]]);const JL={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"};Km._date.override({_id:"date-fns",formats:function(){return JL},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=Et(e):n==="string"&&(typeof t=="string"?e=KM(e,t,new Date,this.options):e=Bp(e,this.options)),Wc(e)?e.getTime():null},format:function(e,t){return _a(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Uc(e,t);case"second":return VT(e,t);case"minute":return WT(e,t);case"hour":return zT(e,t);case"day":return ma(e,t);case"week":return YT(e,t);case"month":return zc(e,t);case"quarter":return $T(e,t);case"year":return qT(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return $c(e,t);case"second":return tk(e,t);case"minute":return ZT(e,t);case"hour":return XT(e,t);case"day":return mp(e,t);case"week":return ek(e,t);case"month":return bp(e,t);case"quarter":return JT(e,t);case"year":return nk(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return JM(e);case"minute":return QM(e);case"hour":return ZM(e);case"day":return Hc(e);case"week":return Vn(e);case"isoWeek":return Vn(e,{weekStartsOn:+n});case"month":return rk(e);case"quarter":return ik(e);case"year":return xp(e);default:return e}},endOf:function(e,t){switch(t){case"second":return uk(e);case"minute":return lk(e);case"hour":return ok(e);case"day":return _p(e);case"week":return ak(e);case"month":return yp(e);case"quarter":return ck(e);case"year":return sk(e);default:return e}}});const Y_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},tN={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Y_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},eN=f.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function as(e){return f.isProxy(e)?f.toRaw(e):e}function nN(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return f.isProxy(t)?new Proxy(e,{}):e}function iN(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function q_(e,t){e.labels=t}function j_(e,t,n){const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(a=>a[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function rN(e,t){const n={labels:[],datasets:[]};return q_(n,e.labels),j_(n,e.datasets,t),n}const sN=f.defineComponent({props:tN,setup(e,t){let{expose:n,slots:i}=t;const r=f.ref(null),s=f.shallowRef(null);n({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:h,options:m,plugins:g,datasetIdKey:y}=e,x=rN(h,y),v=nN(x,h);s.value=new an(r.value,{type:d,data:v,options:{...m},plugins:g})},l=()=>{const d=f.toRaw(s.value);d&&(e.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},e.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(e.updateMode)};return f.onMounted(a),f.onUnmounted(l),f.watch([()=>e.options,()=>e.data],(d,h)=>{let[m,g]=d,[y,x]=h;const v=f.toRaw(s.value);if(!v)return;let S=!1;if(m){const O=as(m),A=as(y);O&&O!==A&&(iN(v,O),S=!0)}if(g){const O=as(g.labels),A=as(x.labels),P=as(g.datasets),L=as(x.datasets);O!==A&&(q_(v.config.data,O),S=!0),P&&P!==L&&(j_(v.config.data,P,e.datasetIdKey),S=!0)}S&&f.nextTick(()=>{u(v)})},{deep:!0}),()=>f.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:r},[f.h("p",{},[i.default?i.default():""])])}});function _l(e,t){return an.register(t),f.defineComponent({props:Y_,setup(n,i){let{expose:r}=i;const s=f.shallowRef(null),a=f.shallowRef(null);f.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>f.h(sN,eN({ref:l},{type:e,...n}))}})}const G_=_l("bar",Ym),K_=_l("doughnut",ro),X_=_l("line",qm),oN=_l("scatter",Gm),aN={class:"chart-container"},lN={key:0,class:"chart-center-metric"},cN={class:"chart-center-total"},uN={key:0,class:"chart-center-unit"},dN=f.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Le.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=St.useTranslatedUnits(),{i18n:i}=St.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=f.ref([]),l=f.useTemplateRef("chartParent"),u=f.inject(zu,null),d=new gl({coordinator:u,requiresUpdate:!0,triggerOnSelf:!1,watchTimestamp:!1,watchDimension:!0}),h=f.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:f.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:f.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:m,tooltipAbsoluteTop:g}=St.useTooltipAbsolutePosition(l,h),y={id:r,afterUpdate(w){a.value=w.options.plugins.legend.labels.generateLabels(w).map(C=>({...C,value:t.legendValues&&t.legendValues[C.text],hidden:!1}))}},x=f.computed(()=>[d,y]),v=f.computed(()=>[t.chartData.datasets.reduce((C,N)=>(C.dimension=N.dimension,C.dimensionValue.push(N.dimensionValue),C.labels.push(N.label),C.backgroundColor.push(N.backgroundColor),C.hoverBorderColor.push(Aa(N.backgroundColor).saturate(.5).darken(.15).hexString()),C.data.push(N.data.reduce(($,V)=>$+V,0)),C),{dimension:"",dimensionValue:[],labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:S}=$n({i18n:i}),O=f.computed(()=>T2(t.metricName??"")),A=f.computed(()=>{const w=v.value[0]?.data.reduce((C,N)=>C+N,0)??0;return S(w,t.metricUnit,{approximate:!0,translateUnit:(C,N)=>n(C,N)}).trim()}),P=f.computed(()=>t.tooltipMetricDisplay||""),L=f.computed(()=>({...t.chartData,datasets:v.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:R}=St.useDonutChartOptions({tooltipState:h,legendID:r}),F=f.ref(),U=w=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[w],D=({width:w,height:C})=>{h.width=w,h.height=C};return(w,C)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",U(e.legendPosition)]),"data-testid":"donut-chart-parent"},[f.createElementVNode("div",aN,[f.createVNode(f.unref(K_),{ref_key:"chartInstance",ref:F,"chart-id":f.unref(s),data:L.value,options:f.unref(R),plugins:x.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&O.value?(f.openBlock(),f.createElementBlock("div",lN,[f.createElementVNode("span",cN,f.toDisplayString(A.value),1),P.value?(f.openBlock(),f.createElementBlock("span",uN,f.toDisplayString(P.value),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(Do,{"absolute-left":f.unref(m),"absolute-top":f.unref(g),state:h,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:D},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),f.createVNode(ml,{id:f.unref(r),"chart-instance":F.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),fN=ke(dN,[["__scopeId","data-v-db23aff8"]]);class hN{id="outlierBandPlugin";beforeDatasetsDraw(t,n,i){const r=i?.value;if(r===void 0||!Number.isFinite(r)||!i?.color)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,h=Math.min(Math.max(s.getPixelForValue(r),a),l);if(h<=a)return;const m=t.ctx;m.save(),m.fillStyle=i.color,m.fillRect(u,a,d-u,h-a),m.restore()}}const pN=1.5;class mN{id="referenceLinePlugin";afterDatasetsDraw(t,n,i){const r=i?.lines;if(!r?.length)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,h=t.ctx;h.save(),h.lineWidth=pN;for(const{value:m,color:g,borderDash:y}of r){if(!Number.isFinite(m))continue;const x=s.getPixelForValue(m);x<a||x>l||(h.beginPath(),h.setLineDash(y),h.strokeStyle=g,h.moveTo(u,x),h.lineTo(d,x),h.stroke())}h.restore()}}const gN={class:"chart-container"},_N=ke(f.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},xMetric:{default:void 0},xMetricUnit:{default:void 0},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>ud()}},setup(e){const t=e,n=f.inject("legendPosition",Le.Bottom),{i18n:i}=St.useI18n(),{formatUnit:r}=$n({i18n:i}),{translateUnit:s}=St.useTranslatedUnits(),a=f.useTemplateRef("chartParent"),l=new hN,u=new mN,d=crypto.randomUUID(),h=crypto.randomUUID(),m=f.inject(zu,null),g=new gl({coordinator:m,requiresUpdate:!0,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),y=f.ref(),x=f.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:f.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:h,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:v,tooltipAbsoluteTop:S}=St.useTooltipAbsolutePosition(a,x);St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const O=f.computed(()=>t.chartData?.outlier),A=f.computed(()=>t.chartData?.referenceLines??[]),P=f.ref([]),L={id:d,afterUpdate($){P.value=Yu($,void 0,t.chartLegendSortFn)}},R=f.computed(()=>{const $=[];O.value&&$.push({text:O.value.label,fillStyle:O.value.color,strokeStyle:O.value.color,isKey:!0});for(const V of A.value)$.push({text:V.label,fillStyle:V.color,strokeStyle:V.color,lineDash:V.borderDash,isKey:!0,value:{raw:V.value,formatted:r(V.value,t.metricUnit,{translateUnit:s})}});return $}),F=f.computed(()=>[...P.value,...R.value]),U=f.computed(()=>t.shadeOutlierRegion?O.value?.value:void 0),D=f.computed(()=>[g,L,...U.value!==void 0?[l]:[],...A.value.length?[u]:[]]),w=f.computed(()=>`scatter-${D.value.map($=>$.id).join("-")}`),{options:C}=St.useScatterChartOptions({tooltipState:x,legendID:d,granularity:f.toRef(t,"granularity"),timeRangeMs:f.toRef(t,"timeRangeMs"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),metricUnit:f.toRef(t,"metricUnit"),xMetric:f.toRef(t,"xMetric"),xMetricUnit:f.toRef(t,"xMetricUnit"),outlierValue:U,referenceLines:A,themeColors:f.toRef(t,"themeColors")}),N=$=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[$];return($,V)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",N(f.unref(n))]),"data-testid":"scatter-chart-parent"},[f.createElementVNode("div",gN,[(f.openBlock(),f.createBlock(f.unref(oN),{key:w.value,ref_key:"chartInstance",ref:y,"chart-id":f.unref(h),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:f.unref(C),plugins:D.value},null,8,["chart-id","data","options","plugins"]))]),f.createVNode(Do,{"absolute-left":f.unref(v),"absolute-top":f.unref(S),"data-testid":"tooltip",granularity:e.granularity,state:x,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),f.createVNode(ml,{id:f.unref(d),"chart-instance":y.value,"data-testid":"legend",items:F.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-a001076d"]]),Cd=(e,t,n,i,r="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore()},tn={},yN=()=>{tn.x=void 0,tn.chart=void 0,tn.strategy=void 0,tn.group=void 0},bN=10;class Z_{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let r=!1;n==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<bN)return;const r=()=>{tn.chart=n,tn.strategy=this._brushStrategy,tn.group=this._brushGroup;for(const s of Object.values(an.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(tn.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(tn.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;Cd(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:r}=t.tooltip.dataPoints[0].element;Cd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(tn.x===void 0)return;const n=tn.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&tn.group===this._brushGroup&&Cd(t.ctx,tn.x,t.scales.y.top,t.scales.y.bottom,n)}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&&tn.chart===t){const n=tn.x!==void 0;if(yN(),n)for(const i of Object.values(an.instances))i!==t&&i.update("none")}}}const xN=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},wN=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},Q_=(e,t)=>{const n=e.scales.x.getValueForPixel(t.startX),i=e.scales.x.getValueForPixel(t.endX);if(!(n===void 0||i===void 0))return{xStart:Math.min(n,i),xEnd:Math.max(n,i)}},J_=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class vN{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=n.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=Q_(t,this);d&&J_("dragSelectMove",t,d)}},a=l=>{const u=n.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=Q_(t,this);d?J_("dragSelect",t,d):this.clearSelectionArea()}};n.addEventListener("mousedown",r),n.addEventListener("mousemove",s),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",r),n.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(wN(t,this._startX,this._endX),xN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const SN=20,TN="rgba(255, 171, 171, 0.4)",kN="rgba(255, 196, 0, 0.2)",ty=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const r=(n-e.y)/i;return e.x+r*(t.x-e.x)},ey=e=>"yAxisID"in e&&e.yAxisID||rl,ny=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?ey(n):rl},MN=(e,t,n=rl)=>{const i=[];return e.data.datasets.forEach(r=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(r)).visible||ey(r)!==n)return;const a=r.data;a?.length&&t.filter(l=>l.highlightIntersections).forEach(l=>{const u=a.map(h=>({ts:h.x,aboveThreshold:h.y>=l.value}));let d=u[0].aboveThreshold?a[0].x:void 0;for(let h=1;h<u.length;h++)!u[h-1].aboveThreshold&&u[h].aboveThreshold?d=ty(a[h-1],a[h],l.value):u[h-1].aboveThreshold&&!u[h].aboveThreshold&&d!==void 0&&(i.push({start:d,end:ty(a[h-1],a[h],l.value),type:l.type}),d=void 0);d!==void 0&&i.push({start:d,end:u[u.length-1].ts,type:l.type})})}),i},DN=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:r})=>r===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class CN{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=r.getBoundingClientRect();for(const d of Object.keys(this._thresholds||{})){const m=(t.scales[ny(t,d)]??t.scales.y).getValueForPixel(l-u.top);if(m){const g=this._thresholds?.[d];g&&g.forEach(y=>{y.hovered=Math.abs(y.value-m)<SN})}}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,n){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){const a=ny(t,r),l=t.scales[a]??t.scales.y;s.forEach(h=>{const m=l.getPixelForValue(h.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,m),i.lineTo(t.chartArea.right,m),i.lineWidth=1,i.strokeStyle=Ku(h.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";h.label?g=`${h.label}: ${h.value}`:h.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:h.value}):h.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:h.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:h.value}),h.hovered&&(i.save(),i.fillStyle=Ku(h.type),i.font=_S,i.fillText(g,t.chartArea.left,m-4),i.restore())});const u=MN(t,s,a);DN(u).forEach(h=>{const m=t.scales.x.getPixelForValue(h.start),g=t.scales.x.getPixelForValue(h.end);i.save(),i.fillStyle=h.type==="error"?TN:kN,i.fillRect(m,t.chartArea.top,g-m,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(m,t.chartArea.bottom),i.lineTo(g,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ku(h.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const ON=ke(f.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0},leftYAxisGrid:{type:Boolean,default:void 0},rightYAxis:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:r}=St.useI18n(),s=new Z_,a=new $_,l=new vN,u=new CN(r),{translateUnit:d}=St.useTranslatedUnits(),h=f.ref(),m=crypto.randomUUID(),g=crypto.randomUUID(),y=f.ref([]),x=f.inject("legendPosition",Le.Bottom),v=f.useTemplateRef("chartParent"),S=f.ref(void 0),O=f.ref(!1),A=f.inject(zu,null),P=new gl({coordinator:A,triggerOnSelf:!0,watchTimestamp:!0,watchDimension:!0}),L=f.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:f.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:f.toRef(n,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:g,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:F}=St.useTooltipAbsolutePosition(v,L),U={id:m,afterUpdate(z){y.value=Yu(z,n.legendValues,n.chartLegendSortFn)}},D=f.computed(()=>[P,U,a,...n.brush?[l]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[u]:[]]),w=f.computed(()=>`line-${D.value.map(z=>z.id).join("-")}`),C=f.computed(()=>`bar-${D.value.map(z=>z.id).join("-")}`),N=f.computed(()=>n.chartData&&CP(n.chartData)),{options:$}=St.useLineChartOptions({tooltipState:L,timeRangeMs:f.toRef(n,"timeRangeMs"),granularity:f.toRef(n,"granularity"),legendID:m,stacked:f.toRef(n,"stacked"),metricAxesTitle:f.toRef(n,"metricAxesTitle"),dimensionAxesTitle:f.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:N,threshold:f.toRef(n,"threshold"),leftYAxisGrid:f.toRef(n,"leftYAxisGrid"),rightYAxis:f.toRef(n,"rightYAxis")});St.useReportChartDataForSynthetics(f.toRef(n,"chartData"),f.toRef(n,"syntheticsDataKey"));const V=z=>z?z.end.getTime()>z.start.getTime():!1,st=z=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[z],dt=({width:z,height:Z})=>{L.width=z,L.height=Z},ut=(z=!0)=>{L.interactionMode="idle",L.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(z),s.isPaused&&s.resume()},ct=()=>{L.interactionMode="interactive"},Tt=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(L.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},at=()=>{if(O.value){O.value=!1;return}L.interactionMode!=="idle"?ut():ct(),Tt()};f.watch(()=>n.type,()=>{L.interactionMode="idle",L.showTooltip=!1,s.destroyClickedSegment()});const pt=z=>{z.preventDefault(),z.stopPropagation();const{xStart:Z,xEnd:it}=z.detail,ht={start:new Date(Z),end:new Date(it),type:"absolute"};if(!V(ht)){S.value=void 0,ut(!1);return}S.value=ht,L.interactionMode="zoom-interactive",ht&&i("select-chart-range",ht)},G=z=>{L.interactionMode="selecting-chart-area",O.value=!0,s.pause(),a.pause();const{xStart:Z,xEnd:it}=z.detail;S.value={start:new Date(Z),end:new Date(it),type:"absolute"}},B=z=>{if(!v.value||L.interactionMode==="idle")return;const Z=z.target;Z&&v.value.contains(Z)||O.value||ut(!1)};return f.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",pt),h.value.chart.canvas.removeEventListener("dragSelectMove",G),h.value.chart.canvas.addEventListener("dragSelect",pt),h.value.chart.canvas.addEventListener("dragSelectMove",G))}),f.onMounted(()=>{document.addEventListener("click",B,!0)}),f.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",pt),h.value.chart.canvas.removeEventListener("dragSelectMove",G)),document.removeEventListener("click",B,!0)}),(z,Z)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",st(f.unref(x))]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:Z[0]||(Z[0]=it=>at())},[e.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(X_),{key:w.value,ref_key:"chartInstance",ref:h,"chart-id":f.unref(g),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:f.unref($),plugins:D.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(G_),{key:C.value,ref_key:"chartInstance",ref:h,"chart-id":f.unref(g),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:f.unref($),plugins:D.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),f.createVNode(Do,{"absolute-left":f.unref(R),"absolute-top":f.unref(F),"data-testid":"tooltip",granularity:e.granularity,state:L,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:dt,onOnAction:Z[1]||(Z[1]=()=>ut(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),f.createVNode(ml,{id:f.unref(m),"chart-instance":h.value,"data-testid":"legend",items:y.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-344d87c4"]]),AN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},EN={class:"tooltip-content"},RN={key:2,class:"analytics-chart-parent"},PN=f.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Le.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},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(e,{emit:t}){const n=t,i=e,{i18n:r}=St.useI18n(),s=f.computed(()=>dd(i.chartData)?void 0:i.chartData),a=f.computed(()=>{const j=i.chartOptions.metricAxisMap,et=s.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!j||!et.some(rt=>j[rt]==="right")))return j}),l=f.computed(()=>!!a.value),u=(j,et)=>a.value?j.filter(rt=>(a.value?.[rt]??"left")===et):j,d=f.computed(()=>{const j=s.value?.meta,et=j?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!l.value&&et.length>1&&Object.keys(j?.display??{}).length>0?et:[]}),h=f.computed(()=>d.value.length>1),m=f.computed(()=>i.activeMetric&&d.value.includes(i.activeMetric)?i.activeMetric:d.value[0]),g=f.computed(()=>{const j=s.value;return!j||!h.value||!m.value?j:{...j,meta:{...j.meta,metric_names:[m.value]}}}),y=f.computed(()=>{const j=i.chartOptions.threshold;return!h.value||!j?j:{...j,...Object.fromEntries(Object.keys(j).filter(et=>et!==m.value).map(et=>[et,[]]))}}),x=f.computed(()=>{if(ut.value)return dd(i.chartData)?i.chartData:q0(i.chartData)}),v=f.inject("app:konnectColorMode",f.computed(()=>"light")),S=f.useTemplateRef("chartShell"),O=f.computed(()=>(v.value,ud(S.value))),A=f.computed(()=>{if(x.value){const{start:et,end:rt,metric:Gt,metricUnit:_t,truncated:$t,limit:Me,datasource:Te}=x.value;return{start:et,end:rt,metricNames:[Gt],metricUnits:{[Gt]:_t??""},truncated:$t,limit:Me,datasource:Te}}const j=g.value?.meta;return{start:j?.start,end:j?.end,metricNames:j?.metric_names,metricUnits:j?.metric_units,truncated:j?.truncated,limit:j?.limit,datasource:j?.datasource}}),P=f.computed(()=>ut.value?St.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:O},x).value:s.value?st.value?St.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zu,metricAxisMap:a.value},g).value:St.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zu},s).value:{datasets:[]}),L=f.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),R=f.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:j,end:et}=A.value;if(j&&et)return new Date(et).getTime()-new Date(j).getTime()}),F=f.computed(()=>A.value.metricUnits?h.value&&m.value?A.value.metricUnits[m.value]??"":Object.values(A.value.metricUnits)[0]??"":""),U=f.computed(()=>A.value.metricUnits?h.value&&m.value?m.value:Object.keys(A.value.metricUnits)[0]??"":""),D=f.computed(()=>i.showLegendValues&&i.legendPosition!==Le.Hidden),{legendValues:w}=St.useChartLegendValues(P,i.chartOptions.type,F),C=f.computed(()=>A.value.limit?.toString()||null),N=f.computed(()=>i.chartOptions.hideTruncationWarning?!1:A.value.truncated||!1),$=f.computed(()=>r.t("limitedResultsShown",{maxReturned:C.value})),V=f.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),st=f.computed(()=>["timeseries_bar","timeseries_line"].some(j=>j===i.chartOptions.type)),dt=f.computed(()=>i.chartOptions.type==="donut"),ut=f.computed(()=>i.chartOptions.type==="scatter"),ct=f.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),Tt=f.computed(()=>{const{metricNames:j,metricUnits:et}=A.value;if(l.value||!j||!et)return;const rt=j[0],Gt=et[rt]||"";if(j.length>1){if(rt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})});if(rt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})})}if(rt)return xo(Gt)&&r.te(`metricAxisTitles.${rt}`)?r.t(`metricAxisTitles.${rt}`)||void 0:r.te(`chartLabels.${rt}`)?r.t(`chartLabels.${rt}`):rt}),at=f.computed(()=>{const j=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(j)return j;const{metricNames:et,metricUnits:rt}=A.value;if(!(!et||!rt))return G(u(et,"left"),rt)}),pt=f.computed(()=>{if(!l.value)return;const{metricNames:j,metricUnits:et}=A.value,rt=j&&et?G(u(j,"right"),et):void 0;return{title:i.chartOptions.yAxes?.right?.title??rt,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),G=(j,et)=>{const rt=j[0];if(!rt)return;const Gt=et[rt]||"";if(j.length>1){if(rt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})});if(rt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})})}return B(rt,Gt)},B=(j,et)=>{if(r.te(`metricAxisTitles.${j}`)){if(xo(et))return r.t(`metricAxisTitles.${j}`)||void 0;const rt=r.te(`chartUnits.${et}`)?r.t(`chartUnits.${et}`,{plural:"s"}):et;return r.t(`metricAxisTitles.${j}`,{unit:rt})||void 0}return j||void 0},z=f.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const j=s.value?.meta,et=st.value?"Time":Object.keys(j?.display||j?.metric_names||{})[0];if(et)return r.te(`chartLabels.${et}`)?r.t(`chartLabels.${et}`):et}),Z=f.computed(()=>{if(Cx(A.value.datasource))return r.t("timestampAxisTitles.platform");const j=ca(s.value?.meta?.granularity_ms);if(j)return r.te(`granularityAxisTitles.${j}`)?r.t(`granularityAxisTitles.${j}`):j}),it=f.computed(()=>{const j=x.value?.xMetric;return j?B(j,x.value?.xMetricUnit??""):Z.value}),ht=f.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),mt=f.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),X=f.computed(()=>ut.value?!!x.value?.points.length:st.value?OP(P.value):!!(s.value&&s.value.meta&&s.value.data.length)),ot=f.computed(()=>{const j=s.value;return j?j.meta.granularity_ms?ca(j.meta.granularity_ms)||"hourly":ca(new Date(j.data[1].timestamp).getTime()-new Date(j.data[0].timestamp).getTime())||"hourly":"hourly"}),vt=f.computed(()=>ca(s.value?.meta?.granularity_ms)||"secondly"),lt=f.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(j,et)=>j.text===r.t("chartLabels.____OTHER____")?1:et.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.text,10))&&!isNaN(parseInt(et.text,10))?j.text<et.text?-1:1:j.value&&et.value?et.value.raw-j.value.raw:0),bt=f.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(j,et)=>j.label===r.t("chartLabels.____OTHER____")?1:et.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.label,10))&&!isNaN(parseInt(et.label,10))?j.label<et.label?-1:1:j.value&&et.value?et.rawValue-j.rawValue:0),Rt=f.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:j=>n("zoom-time-range",j)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return f.provide("showLegendValues",D),f.provide("legendPosition",f.toRef(i,"legendPosition")),(j,et)=>{const rt=f.resolveComponent("KTooltip"),Gt=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{ref:"chartShell",class:f.normalizeClass(["analytics-chart-shell",{"show-values":D.value}])},[X.value&&N.value&&C.value?(f.openBlock(),f.createElementBlock("div",AN,[f.createVNode(rt,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createElementVNode("div",EN,f.toDisplayString($.value),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(fe.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(mS)})`,size:`var(--kui-icon-size-40, ${f.unref(yS)})`},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),X.value?(f.openBlock(),f.createElementBlock("div",RN,[st.value?(f.openBlock(),f.createBlock(ON,{key:0,brush:L.value,"chart-data":P.value,"chart-legend-sort-fn":lt.value,"chart-tooltip-sort-fn":bt.value,"dimension-axes-title":Z.value,fill:e.chartOptions.stacked,granularity:ot.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":F.value,"right-y-axis":pt.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:y.value,"time-range-ms":R.value,"tooltip-metric-display":Tt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Rt.value,onSelectChartRange:et[0]||(et[0]=_t=>n("select-chart-range",_t)),onZoomTimeRange:et[1]||(et[1]=_t=>n("zoom-time-range",_t))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","left-y-axis-grid","legend-values","metric-axes-title","metric-unit","right-y-axis","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):V.value?(f.openBlock(),f.createBlock(QL,{key:1,annotations:e.showAnnotations,"chart-data":P.value,"chart-legend-sort-fn":lt.value,"chart-tooltip-sort-fn":bt.value,"data-testid":"bar-chart-container","dimension-axes-title":z.value,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":F.value,orientation:ct.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":Tt.value,"tooltip-title":e.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"])):dt.value?(f.openBlock(),f.createBlock(fN,{key:2,"chart-data":P.value,"dataset-colors":e.chartOptions.chartDatasetColors||f.unref(Zu),"legend-position":e.legendPosition,"legend-values":f.unref(w),"metric-name":U.value,"metric-unit":F.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":z.value,"tooltip-metric-display":Tt.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):ut.value?(f.openBlock(),f.createBlock(_N,{key:3,"chart-data":P.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":bt.value,"data-testid":"scatter-chart-container","dimension-axes-title":it.value,granularity:vt.value,"metric-axes-title":at.value,"metric-unit":F.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":O.value,"time-range-ms":R.value,"tooltip-metric-display":Tt.value,"tooltip-title":e.tooltipTitle,"x-metric":x.value?.xMetric,"x-metric-unit":x.value?.xMetricUnit},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","theme-colors","time-range-ms","tooltip-metric-display","tooltip-title","x-metric","x-metric-unit"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(Gt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(ht.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(mt.value),1)]),_:1}))],2)}}}),IN=ke(PN,[["__scopeId","data-v-c5c250ba"]]),LN={class:"chart-parent","data-testid":"gauge-chart-parent"},NN={class:"chart-totals-flex"},BN={key:1,class:"metric-small","data-testid":"gauge-chart-total"},FN=ke(f.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Xn},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.ref(Dd()),r=f.computed(()=>[t.chartData.datasets.reduce((y,x)=>(y.labels.push(x.label),y.borderColor.push(x.backgroundColor),y.backgroundColor.push(x.backgroundColor),y.data.push(x.data.reduce((v,S)=>v+S,0)),y),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=f.computed(()=>({...t.chartData,datasets:r.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=f.computed(()=>go(r?.value[0]?.data[t.numerator],{capital:!0})),u=f.computed(()=>go(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=f.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),h=f.computed(()=>["full","single"].includes(t.metricDisplay)),m=f.computed(()=>t.metricDisplay==="full");return(g,y)=>(f.openBlock(),f.createElementBlock("div",LN,[f.createElementVNode("div",NN,[h.value?(f.openBlock(),f.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:f.normalizeStyle(d.value)},f.toDisplayString(l.value),5)):f.createCommentVNode("",!0),m.value?(f.openBlock(),f.createElementBlock("div",BN,f.toDisplayString(f.unref(n).t("total"))+": "+f.toDisplayString(u.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:"chart-container",style:f.normalizeStyle({height:e.height,width:e.width})},[f.createVNode(f.unref(K_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),zN={key:1,class:"single-value-wrapper"},UN={class:"single-value-metric"},HN={class:"name-unit-alignment"},WN={class:"single-value","data-testid":"single-value-chart"},$N={key:0,class:"single-value-unit"},VN={class:"single-value-metric-name"},YN={key:0,class:"single-value-trend"},qN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},Od="t1",Ad="t2",jN=ke(f.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:p0},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(e){const{i18n:t}=St.useI18n(),{formatBytes:n,formatCost:i}=$n({i18n:t}),r=e,s=f.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=f.computed(()=>er.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:Od,secondLevelKey:Ad})),l=f.computed(()=>a.value?.previous?.[Od]?.[Ad]),u=f.computed(()=>a.value?.current?.[Od]?.[Ad]),d=f.computed(()=>r.data.data),h=f.computed(()=>r.data.meta?.metric_names?.[0]),m=f.computed(()=>t.te(`chartLabels.${h.value}`)?t.t(`chartLabels.${h.value}`):""),g=f.computed(()=>{const C=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(C){const N=`chartUnits.${C}`;return t.te(N)?t.t(N,{plural:""}):""}}),y=f.computed(()=>!!h.value&&(h.value.includes("_per_minute")||h.value.includes("_latency_")||h.value==="error_rate")),x=f.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),v=f.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!h.value)return null;const C=d.value[0].event[h.value];return typeof C!="number"||isNaN(C)?null:C}),S=f.computed(()=>r.data?.data?.length===void 0||r.data?.data?.length===0||!r.showTrend&&v.value===null||r.showTrend&&x.value===null&&v.value===null),O=f.computed(()=>{const C=v.value;if(C===null)return"-";const N=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(N==="usd")return i(C);if(N==="bytes")return n(C);if(C>=1e9){const V=(C/1e9).toFixed(1);return V.endsWith(".0")?`${Math.floor(C/1e9)}B`:`${V}B`}if(C>=1e7){const V=(C/1e6).toFixed(1);return V.endsWith(".0")?`${Math.floor(C/1e6)}M`:`${V}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:p0;return C.toLocaleString("en-US",{maximumFractionDigits:$})}),A=f.computed(()=>r.showTrend&&r.data?.data?.length<2),P=f.computed(()=>er.calculateChange(v.value??0,x.value??0)||0),L=f.computed(()=>{if(!r.showTrend)return 0;if(r.data?.data?.length<2){if(l.value===void 0)return 0;if(u.value===void 0)return r.increaseIsBad?1:-1}return er.changePolarity(P.value,!0,r.increaseIsBad)}),R=f.computed(()=>er.defineIcon(L.value,r.increaseIsBad)),F=f.computed(()=>{if(r.showTrend&&r.data?.data?.length<2){if(l.value===void 0)return t.t("singleValue.trend.not_available");if(u.value===void 0)return er.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return er.metricChange(P.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),U=er.useTrendRange(f.computed(()=>r.showTrend),void 0,f.computed(()=>r.data.meta)),D=C=>C>0?"positive":C<0?"negative":"neutral",w=C=>C>0?pS:C<0?hS:up;return f.onMounted(()=>{!r.showTrend&&r.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",r.data.data.length):r.showTrend&&r.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",r.data.data.length)}),(C,N)=>{const $=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[S.value?(f.openBlock(),f.createBlock($,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:f.unref(t).t("singleValue.valueError")},null,8,["title"])):(f.openBlock(),f.createElementBlock("div",zN,[f.createElementVNode("div",UN,[f.createElementVNode("div",HN,[f.createElementVNode("span",WN,f.toDisplayString(O.value),1),y.value&&g.value?(f.openBlock(),f.createElementBlock("span",$N," "+f.toDisplayString(g.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",VN,f.toDisplayString(m.value),1)]),e.showTrend?(f.openBlock(),f.createElementBlock("div",YN,[f.createElementVNode("div",{class:f.normalizeClass(["trend-change",D(L.value)]),"data-testid":"single-value-trend"},[A.value||L.value!==0?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(R.value),{key:0,color:w(L.value),size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])):(f.openBlock(),f.createBlock(f.unref(fe.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${f.unref(up)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])),f.createElementVNode("div",null,f.toDisplayString(F.value),1)],2),f.unref(U)?(f.openBlock(),f.createElementBlock("div",qN,f.toDisplayString(f.unref(U)),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),GN={class:"simple-chart-shell"},KN={key:1,class:"analytics-chart-parent"},XN=ke(f.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.computed(()=>{const d=St.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Xn},f.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=f.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=f.computed(()=>t.chartOptions.type==="gauge"),a=f.computed(()=>t.chartOptions.type==="single_value"),l=f.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),u=f.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const h=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[h]!==null}return d});return(d,h)=>{const m=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",GN,[u.value?(f.openBlock(),f.createElementBlock("div",KN,[s.value?(f.openBlock(),f.createBlock(FN,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":r.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):f.createCommentVNode("",!0),a.value?(f.openBlock(),f.createBlock(jN,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(m,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),ZN={class:"container"},QN={key:0,class:"no-data","data-testid":"sparkline-empty"},JN=["title"],tB=ke(f.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(e){const t=crypto.randomUUID(),{i18n:n}=St.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=St.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),h=f.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),m=({width:U,height:D})=>{h.width=U,h.height=D},g=f.computed(()=>e.disableTooltip?[]:[new Z_({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),y=f.computed(()=>d.value.reduce((U,{data:D,label:w})=>({...U,[w]:D.reduce((C,{y:N})=>C+N,0)}),{})),x=f.computed(()=>d.value.map(({label:U})=>[y.value[U],`${U}: ${y.value[U]}`]).sort(([U],[D])=>D-U).map(([,U])=>U).join(", ")),v=f.computed(()=>Object.keys(y.value).map(U=>y.value[U]).reduce((U,D)=>U+D,0)),S=f.computed(()=>v.value>0),O=f.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=f.computed(()=>e.datasets.length>1),P=`SparklineTooltipPosition-${t}`,L=f.computed(()=>{const U=e.type==="sparkline_bar",D=U?r.value-1:r.value,w=U?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:U?0:2,right:U?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:P,external:C=>{Vu(h,C,"minutely",{contextFormatter:N=>{const $=N+i.value;let V="";return i.value>1440*60*1e3?V=_a(new Date($),"MMM dd, yyy hh:mm a"):V=_a(new Date($),"hh:mm a"),`${bv(N)} - ${V}`}})}}},scales:{x:{min:D,max:w,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:A.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:A.value}}}}),R=f.ref("0"),F=f.ref("0");return f.onMounted(()=>{qe.positioners[P]=function(U,D){if(!U.length||h.interactionMode==="interactive"||D.x===null)return!1;const w=10,C=this.chart.canvas.getBoundingClientRect(),N=h.width||this.width,$=h.height||this.height,V=C.top-$>0,st=V?C.top-$-w:C.top+C.height+w,dt=C.left>N/2-D.x,ut=Math.max(w,window.innerWidth-w-N),ct=Math.min(ut,dt?Math.floor(C.left-N/2)+D.x:0+w);return R.value=`${st}px`,F.value=`${ct}px`,{x:ct,y:st,xAlign:"center",yAlign:V?"top":"bottom"}}}),f.onUnmounted(()=>{qe.positioners[P]&&delete qe.positioners[P]}),(U,D)=>(f.openBlock(),f.createElementBlock("div",ZN,[S.value?e.type==="sparkline_bar"?(f.openBlock(),f.createBlock(f.unref(G_),{key:1,"chart-id":f.unref(t),data:O.value,"data-testid":"sparkline-bar",options:L.value,plugins:g.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(f.openBlock(),f.createBlock(f.unref(X_),{key:2,"chart-id":f.unref(t),data:O.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:L.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",QN,[f.renderSlot(U.$slots,"empty",{},()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(Do,{key:3,"absolute-left":F.value,"absolute-top":R.value,class:"tooltip","data-testid":"sparkline-tooltip",state:h,"tooltip-title":e.tooltipTitle,onDimensions:m},null,8,["absolute-left","absolute-top","state","tooltip-title"])),S.value&&e.showLabel?(f.openBlock(),f.createElementBlock("div",{key:4,class:"label",title:U.$slots.label?"":x.value},[f.renderSlot(U.$slots,"label",{total:v.value,totalByDataset:y.value},()=>[f.createTextVNode(f.toDisplayString(x.value),1)],!0)],8,JN)):f.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),eB=["data-value"],nB=["title"],iB={class:"top-talkers-cell-metric"},rB={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},sB={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},oB={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},aB={class:"top-talkers-tooltip-title"},lB={class:"top-talkers-tooltip-rows"},cB={class:"top-talkers-tooltip-label"},uB=["data-threshold"],dB=ke(f.defineComponent({__name:"TopTalkersCell",props:{cell:{}},setup(e){return f.useCssVars(t=>({cecbd9f0:t.cell.color,v0d35e6b6:t.cell.tint})),(t,n)=>(f.openBlock(),f.createBlock(f.unref(As.KPop),{class:"top-talkers-cell-wrapper",disabled:!e.cell.tooltipRows.length,"hide-caret":"","hide-close-icon":"",placement:"right","popover-timeout":0,style:f.normalizeStyle({flexGrow:e.cell.ratio}),trigger:"hover"},{content:f.withCtx(()=>[f.createElementVNode("div",oB,[f.createElementVNode("div",aB,f.toDisplayString(e.cell.name),1),f.createElementVNode("dl",lB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.cell.tooltipRows,i=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:i.key},[f.createElementVNode("dt",cB,f.toDisplayString(i.label),1),f.createElementVNode("dd",{class:f.normalizeClass(["top-talkers-tooltip-value",i.threshold&&`top-talkers-tooltip-value--${i.threshold}`]),"data-threshold":i.threshold},f.toDisplayString(i.value),11,uB)],64))),128))])])]),default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["top-talkers-cell",{"top-talkers-cell--other":e.cell.isOther,"top-talkers-cell--empty":e.cell.isEmpty,"top-talkers-cell--deleted":e.cell.deleted}]),"data-testid":"top-talkers-cell","data-value":e.cell.id},[f.createElementVNode("span",{class:"top-talkers-cell-name","data-testid":"top-talkers-cell-name",title:e.cell.name},f.toDisplayString(e.cell.name),9,nB),f.createElementVNode("span",iB,[f.createElementVNode("span",rB,f.toDisplayString(e.cell.display),1),e.cell.relative?(f.openBlock(),f.createElementBlock("span",sB,"("+f.toDisplayString(e.cell.relative)+")",1)):f.createCommentVNode("",!0)])],10,eB)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),fB=["data-dimension"],hB={class:"top-talkers-column-header"},pB={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},mB={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},gB={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},_B={key:2,class:"top-talkers-column-cells"},iy=ke(f.defineComponent({__name:"TopTalkersColumn",props:{dimension:{},label:{},data:{},sizeMetric:{},columnOptions:{},isLoading:{type:Boolean}},setup(e){const{i18n:t}=St.useI18n(),{column:n}=St.useTopTalkersData(f.toRef(()=>e.data),f.toRef(()=>e.dimension),f.toRef(()=>e.sizeMetric),f.toRef(()=>e.columnOptions)),i=f.computed(()=>e.label||n.value.label),r=f.computed(()=>t.t("topTalkers.total",{value:n.value.total}));return(s,a)=>(f.openBlock(),f.createElementBlock("div",{class:"top-talkers-column","data-dimension":e.dimension,"data-testid":"top-talkers-column"},[f.createElementVNode("div",hB,[f.createElementVNode("span",pB,f.toDisplayString(i.value),1),!e.isLoading&&f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("span",mB,f.toDisplayString(r.value),1)):f.createCommentVNode("",!0)]),e.isLoading?(f.openBlock(),f.createBlock(f.unref(As.KSkeleton),{key:0,"delay-milliseconds":0,"table-columns":1,type:"table"})):f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("div",_B,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(n).cells,l=>(f.openBlock(),f.createBlock(dB,{key:l.id,cell:l},null,8,["cell"]))),128))])):(f.openBlock(),f.createElementBlock("div",gB,f.toDisplayString(f.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,fB))}}),[["__scopeId","data-v-e1b08041"]]),yB={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},bB={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},xB=ke(f.defineComponent({__name:"TopTalkersGrid",props:{title:{default:""},columns:{},sizeMetric:{default:void 0},columnOptions:{default:void 0},emptyStateTitle:{default:""},errorMessage:{default:""},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.useSlots(),r=f.computed(()=>!!i.column),s=f.computed(()=>r.value||t.columns.some(a=>!!a.data?.data?.length||a.isLoading));return(a,l)=>(f.openBlock(),f.createBlock(f.unref(As.KCard),{class:"kong-ui-public-top-talkers","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[e.errorMessage?(f.openBlock(),f.createBlock(f.unref(As.KEmptyState),{key:0,"action-button-visible":!1,"data-testid":"top-talkers-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("topTalkers.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(e.errorMessage),1)]),_:1})):s.value?(f.openBlock(),f.createElementBlock("div",bB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.columns,(u,d)=>f.renderSlot(a.$slots,"column",{key:`${u.dimension}-${d}`,column:u},()=>[f.createVNode(iy,{"column-options":e.columnOptions,data:u.data,dimension:u.dimension,"is-loading":u.isLoading,label:u.label,"size-metric":e.sizeMetric},null,8,["column-options","data","dimension","is-loading","label","size-metric"])],!0)),128))])):(f.openBlock(),f.createBlock(f.unref(As.KEmptyState),{key:1,"action-button-visible":!1,"data-testid":"top-talkers-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(e.emptyStateTitle||f.unref(n).t("topTalkers.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",yB,f.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]),wB={ai_provider:{anthropic:fe.AnthropicIcon,azure:fe.AzureIcon,bedrock:fe.AmazonBedrockIcon,cerebras:fe.CerebrasIcon,cohere:fe.CohereIcon,databricks:fe.DatabricksIcon,deepseek:fe.DeepseekIcon,gemini:fe.GeminiIcon,huggingface:fe.HuggingFaceIcon,llama2:fe.MetaLlamaIcon,mistral:fe.MistralIcon,moonshot:fe.KimiIcon,nvidia:fe.NvidiaIcon,ollama:fe.OllamaIcon,openai:fe.OpenAiIcon,vertex:fe.GoogleVertexIcon,vllm:fe.VllmIcon,xai:fe.GrokIcon}},vB=(e,t)=>{if(!(!e||!t))return wB[e]?.[t.toLowerCase()]},SB=["data-threshold"],TB=ke(f.defineComponent({__name:"TopNMetricBar",props:{ratio:{},threshold:{}},setup(e){f.useCssVars(n=>({v0394367e:f.unref(t)}));const t=Xn[1];return(n,i)=>(f.openBlock(),f.createElementBlock("span",{class:f.normalizeClass(["top-n-metric-cell-bar",{[`top-n-metric-cell--bar-${e.threshold}`]:!!e.threshold}]),"data-testid":"top-n-metric-cell-bar","data-threshold":e.threshold},[f.createElementVNode("span",{class:"top-n-metric-cell-bar-fill",style:f.normalizeStyle({width:`${e.ratio*100}%`})},null,4)],10,SB))}}),[["__scopeId","data-v-24eb60ef"]]),kB=["data-threshold"],MB={class:"top-n-metric-cell-value"},DB={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},CB=ke(f.defineComponent({__name:"TopNMetricCell",props:{display:{},relative:{},threshold:{},hasBar:{type:Boolean}},setup(e){return(t,n)=>(f.openBlock(),f.createElementBlock("span",{class:f.normalizeClass(["top-n-metric-cell",{"top-n-metric-cell--bar":e.hasBar,[`top-n-metric-cell--text-${e.threshold}`]:!e.hasBar&&!!e.threshold}]),"data-threshold":e.threshold},[f.createElementVNode("span",MB,f.toDisplayString(e.display),1),e.relative?(f.openBlock(),f.createElementBlock("span",DB,"("+f.toDisplayString(e.relative)+")",1)):f.createCommentVNode("",!0)],10,kB))}}),[["__scopeId","data-v-17e7f860"]]),OB={class:"top-n-card-title","data-testid":"top-n-card-title"},AB={class:"top-n-card-description","data-testid":"top-n-card-description"},EB={key:3,class:"top-n-table","data-testid":"top-n-table"},RB={"data-testid":"top-n-table-header"},PB={class:"top-n-table-header-row"},IB=["colspan"],LB={class:"table-header-label"},NB=["data-testid"],BB={class:"top-n-table-cell-label"},FB={key:0,class:"top-n-table-cell top-n-table-cell-bar"},zB=3,UB=ke(f.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"},columnOptions:{default:void 0}},setup(e){const t=e,{i18n:n}=St.useI18n(),{formatUnit:i}=$n({i18n:n}),r=f.computed(()=>t.data.data),s=f.computed(()=>!!r.value?.length),a=f.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,zB):[]),l=f.computed(()=>a.value[0]||""),u=f.computed(()=>a.value.length>1),d=f.computed(()=>a.value[a.value.length-1]||""),h=f.computed(()=>l.value?t.data.meta.display[l.value]:{}),m=f.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),g=f.computed(()=>m.value[0]),y=f.computed(()=>g.value?pt(g.value):""),x=f.computed(()=>{const B=a.value.map(z=>({key:z,columnKey:z,label:ct(z,u.value?pt(z):n.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&B.push({key:"value",columnKey:g.value,label:ct(g.value,y.value),type:"metric"}),m.value.forEach((z,Z)=>{Z!==0&&B.push({key:z,columnKey:z,label:ct(z,pt(z)),type:"metric"})}),B}),v=f.computed(()=>x.value.filter(B=>B.type==="metric")),S=f.computed(()=>x.value.filter(B=>B.type==="dimension").slice(1)),O=B=>B.type==="dimension"&&B.key===d.value,A=B=>B.type==="metric"&&!!gr(t.columnOptions,B.columnKey)?.bar,P=B=>u.value&&B.type==="dimension"&&!O(B),L=B=>{const z=B.event;return String(z[l.value])},R=(B,z)=>{const Z=String(B.event[z]),it=t.data.meta?.display?.[z]?.[Z];return{dimension:z,id:Z,name:it?.name||"-",deleted:!!it?.deleted}},F=B=>{const z=L(B),Z=h.value&&h.value[z];return Z?Z.name:"-"},U=B=>{const z=L(B),Z=h.value&&h.value[z];return Z?!!Z.deleted:!1},D=B=>{const z=Z=>i(Z,"%",{translateUnit:it=>G(it,Z)});return B>0&&B<.01?`< ${z(.01)}`:z(B)},w=(B,z)=>{const Z=B.event[z];if(Z==null)return"–";const it=typeof Z=="number"?Z:Number(Z);if(Number.isNaN(it))return"–";const ht=t.data.meta?.metric_units?.[z]||"count";if(ht==="%")return D(it);const mt=["count","count/minute","token count"].includes(ht);return i(it,ht,{approximate:mt,isBytes1024:!0,translateUnit:X=>G(X,it)})},C=f.computed(()=>Object.fromEntries(m.value.map(B=>[B,Hu(r.value.map(z=>Jr(z.event[B])))]))),N=(B,z)=>{const Z=gr(t.columnOptions,z),it=Jr(B.event[z]);if(!Z||it===null)return{display:w(B,z)};const ht=C.value[z],mt=Z.value==="relative"?Wu(it,ht):null;return{display:w(B,z),relative:mt===null?void 0:D(mt*100),barRatio:Z.bar?b0(it,ht,Z.bar):void 0,threshold:$u(it,Z.thresholds)}},$=f.computed(()=>r.value?.length?r.value.map(B=>{const z=a.value.map(mt=>R(B,mt)),Z=z[0],it=Z?.id||L(B),ht={id:it,rowKey:z.map(mt=>`${mt.dimension}:${mt.id}`).join("|")||it,name:Z?.name||F(B),deleted:U(B),dimensions:z,metrics:{},original:B};return m.value.forEach((mt,X)=>{ht.metrics[X===0?"value":mt]=N(B,mt)}),ht}):[]),V=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(B=>!Object.keys(t.data.meta.display[B]||{}).length))return n.t("topNTable.errors.display");if(!g.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),st=(B,z)=>B.metrics[z]??{display:"–"},dt=(B,z)=>B.dimensions.find(Z=>Z.dimension===z)?.id||"",ut=(B,z)=>vB(gr(t.columnOptions,B)?.icon_set,z),ct=(B,z)=>B&&gr(t.columnOptions,B)?.label||z,Tt=(B,z)=>B.dimensions.find(Z=>Z.dimension===z)?.name||"–",at=(B,z)=>{const Z=B.dimensions.find(it=>it.dimension===z);return{id:Z?.id||"",name:Z?.name||"–",deleted:Z?.deleted||!1,dimension:z,dimensions:B.dimensions,isEmpty:Z?.id==="empty"}},pt=B=>n.te(`chartLabels.${B}`)?n.t(`chartLabels.${B}`):B,G=(B,z)=>{if(xo(B)||B==="count"||B==="requests")return"";const Z=z===1?"":"s";return n.te(`chartUnits.${B}`)?n.t(`chartUnits.${B}`,{plural:Z}):B};return(B,z)=>{const Z=f.resolveComponent("KEmptyState"),it=f.resolveComponent("KSkeleton"),ht=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(ht,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[V.value?(f.openBlock(),f.createBlock(Z,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(V.value),1)]),_:1})):e.isLoading?(f.openBlock(),f.createBlock(it,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",EB,[f.createElementVNode("table",{class:f.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[f.createElementVNode("thead",RB,[f.createElementVNode("tr",PB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,mt=>(f.openBlock(),f.createElementBlock("th",{key:mt.key,class:f.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":mt.type==="metric","top-n-table-header-cell-dimension-compact":P(mt)}]),colspan:A(mt)?2:void 0,"data-testid":"top-n-table-header-column"},[f.createElementVNode("span",LB,f.toDisplayString(mt.label),1),z[0]||(z[0]=f.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,IB))),128))])]),f.createElementVNode("tbody",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($.value,mt=>(f.openBlock(),f.createElementBlock("tr",{key:mt.rowKey,class:"top-n-table-row"},[a.value.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[f.createElementVNode("span",{class:"top-n-table-cell-label","data-testid":`row-${mt.id}`},[ut(l.value,mt.id)?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ut(l.value,mt.id)),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["size"])):f.createCommentVNode("",!0),f.renderSlot(B.$slots,"name",{record:{id:mt.id,name:mt.name,deleted:mt.deleted,dimension:l.value,dimensions:mt.dimensions,isEmpty:mt.id==="empty"}},()=>[f.createTextVNode(f.toDisplayString(mt.name),1)],!0)],8,NB)],2)):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(S.value,X=>(f.openBlock(),f.createElementBlock("td",{key:X.key,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!O(X)}])},[f.createElementVNode("span",BB,[ut(X.key,dt(mt,X.key))?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ut(X.key,dt(mt,X.key))),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["size"])):f.createCommentVNode("",!0),f.renderSlot(B.$slots,"name",{record:at(mt,X.key)},()=>[f.createTextVNode(f.toDisplayString(Tt(mt,X.key)),1)],!0)])],2))),128)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(v.value,X=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:X.key},[f.createElementVNode("td",{class:f.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":A(X)}])},[f.createVNode(CB,{"data-testid":X.key==="value"?`row-${mt.id}`:`row-${mt.id}-${X.key}`,display:st(mt,X.key).display,"has-bar":A(X),relative:st(mt,X.key).relative,threshold:st(mt,X.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),A(X)?(f.openBlock(),f.createElementBlock("td",FB,[f.createVNode(TB,{ratio:st(mt,X.key).barRatio??0,threshold:st(mt,X.key).threshold},null,8,["ratio","threshold"])])):f.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(f.openBlock(),f.createBlock(Z,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(e.emptyStateTitle||f.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",OB,f.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",AB,f.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]);var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={exports:{}};var HB=Co.exports,ry;function WB(){return ry||(ry=1,(function(e,t){(function(){var n,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="Invalid `imports` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",g=1,y=2,x=4,v=1,S=2,O=1,A=2,P=4,L=8,R=16,F=32,U=64,D=128,w=256,C=512,N=30,$="...",V=800,st=16,dt=1,ut=2,ct=3,Tt=1/0,at=9007199254740991,pt=17976931348623157e292,G=NaN,B=4294967295,z=B-1,Z=B>>>1,it=[["ary",D],["bind",O],["bindKey",A],["curry",L],["curryRight",R],["flip",C],["partial",F],["partialRight",U],["rearg",w]],ht="[object Arguments]",mt="[object Array]",X="[object AsyncFunction]",ot="[object Boolean]",vt="[object Date]",lt="[object DOMException]",bt="[object Error]",Rt="[object Function]",j="[object GeneratorFunction]",et="[object Map]",rt="[object Number]",Gt="[object Null]",_t="[object Object]",$t="[object Promise]",Me="[object Proxy]",Te="[object RegExp]",ee="[object Set]",je="[object String]",Yt="[object Symbol]",Be="[object Undefined]",se="[object WeakMap]",De="[object WeakSet]",Pe="[object ArrayBuffer]",gn="[object DataView]",Wi="[object Float32Array]",Cn="[object Float64Array]",Ge="[object Int8Array]",Ln="[object Int16Array]",di="[object Int32Array]",Oo="[object Uint8Array]",Ao="[object Uint8ClampedArray]",Tr="[object Uint16Array]",fi="[object Uint32Array]",Eo=/\b__p \+= '';/g,Ro=/\b(__p \+=) '' \+/g,Po=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$i=/&(?:amp|lt|gt|quot|#39);/g,xl=/[&<>"']/g,Ed=RegExp($i.source),Rd=RegExp(xl.source),Pd=/<%-([\s\S]+?)%>/g,Id=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,wl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,Ld=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lo=/[\\^$.*+?()[\]{}|]/g,Nd=RegExp(Lo.source),No=/^\s+/,Bd=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fd=/\{\n\/\* \[wrapped with (.+)\] \*/,zd=/,? & /,Ud=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vl=/[()=,{}\[\]\/\s]/,Hd=/\\(\\)?/g,Vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sl=/\w*$/,Wd=/^[-+]0x[0-9a-f]+$/i,$d=/^0b[01]+$/i,Vd=/^\[object .+?Constructor\]$/,Yd=/^0o[0-7]+$/i,Yi=/^(?:0|[1-9]\d*)$/,qd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ls=/($^)/,jd=/['\n\r\u2028\u2029\\]/g,cs="\\ud800-\\udfff",Gd="\\u0300-\\u036f",Kd="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",kr=Gd+Kd+Tl,kl="\\u2700-\\u27bf",us="a-z\\xdf-\\xf6\\xf8-\\xff",Xd="\\xac\\xb1\\xd7\\xf7",Zd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qd="\\u2000-\\u206f",Jd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ml="A-Z\\xc0-\\xd6\\xd8-\\xde",Dl="\\ufe0e\\ufe0f",ds=Xd+Zd+Qd+Jd,Bo="['’]",tf="["+cs+"]",Cl="["+ds+"]",fs="["+kr+"]",Ol="\\d+",ef="["+kl+"]",Al="["+us+"]",Fo="[^"+cs+ds+Ol+kl+us+Ml+"]",zo="\\ud83c[\\udffb-\\udfff]",nf="(?:"+fs+"|"+zo+")",Mr="[^"+cs+"]",Zn="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+Ml+"]",El="\\u200d",Rl="(?:"+Al+"|"+Fo+")",rf="(?:"+un+"|"+Fo+")",Pl="(?:"+Bo+"(?:d|ll|m|re|s|t|ve))?",Il="(?:"+Bo+"(?:D|LL|M|RE|S|T|VE))?",Ll=nf+"?",Uo="["+Dl+"]?",pi="(?:"+El+"(?:"+[Mr,Zn,hs].join("|")+")"+Uo+Ll+")*",sf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bl=Uo+Ll+pi,Ho="(?:"+[ef,Zn,hs].join("|")+")"+Bl,Fl="(?:"+[Mr+fs+"?",fs,Zn,hs,tf].join("|")+")",of=RegExp(Bo,"g"),af=RegExp(fs,"g"),ps=RegExp(zo+"(?="+zo+")|"+Fl+Bl,"g"),lf=RegExp([un+"?"+Al+"+"+Pl+"(?="+[Cl,un,"$"].join("|")+")",rf+"+"+Il+"(?="+[Cl,un+Rl,"$"].join("|")+")",un+"?"+Rl+"+"+Pl,un+"+"+Il,Nl,sf,Ol,Ho].join("|"),"g"),ms=RegExp("["+El+cs+kr+Dl+"]"),cf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],uf=-1,ie={};ie[Wi]=ie[Cn]=ie[Ge]=ie[Ln]=ie[di]=ie[Oo]=ie[Ao]=ie[Tr]=ie[fi]=!0,ie[ht]=ie[mt]=ie[Pe]=ie[ot]=ie[gn]=ie[vt]=ie[bt]=ie[Rt]=ie[et]=ie[rt]=ie[_t]=ie[Te]=ie[ee]=ie[je]=ie[se]=!1;var M={};M[ht]=M[mt]=M[Pe]=M[gn]=M[ot]=M[vt]=M[Wi]=M[Cn]=M[Ge]=M[Ln]=M[di]=M[et]=M[rt]=M[_t]=M[Te]=M[ee]=M[je]=M[Yt]=M[Oo]=M[Ao]=M[Tr]=M[fi]=!0,M[bt]=M[Rt]=M[se]=!1;var Y={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tt={"&":"&","<":"<",">":">",'"':""","'":"'"},xt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ke=parseFloat,Bn=parseInt,Fe=typeof Hi=="object"&&Hi&&Hi.Object===Object&&Hi,zl=typeof self=="object"&&self&&self.Object===Object&&self,ue=Fe||zl||Function("return this")(),gs=t&&!t.nodeType&&t,Qn=gs&&!0&&e&&!e.nodeType&&e,$o=Qn&&Qn.exports===gs,Dr=$o&&Fe.process,ze=(function(){try{var H=Qn&&Qn.require&&Qn.require("util").types;return H||Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),cy=ze&&ze.isArrayBuffer,uy=ze&&ze.isDate,dy=ze&&ze.isMap,fy=ze&&ze.isRegExp,hy=ze&&ze.isSet,py=ze&&ze.isTypedArray;function _n(H,K,q){switch(q.length){case 0:return H.call(K);case 1:return H.call(K,q[0]);case 2:return H.call(K,q[0],q[1]);case 3:return H.call(K,q[0],q[1],q[2])}return H.apply(K,q)}function nF(H,K,q,gt){for(var At=-1,qt=H==null?0:H.length;++At<qt;){var Oe=H[At];K(gt,Oe,q(Oe),H)}return gt}function yn(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt&&K(H[q],q,H)!==!1;);return H}function iF(H,K){for(var q=H==null?0:H.length;q--&&K(H[q],q,H)!==!1;);return H}function my(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt;)if(!K(H[q],q,H))return!1;return!0}function qi(H,K){for(var q=-1,gt=H==null?0:H.length,At=0,qt=[];++q<gt;){var Oe=H[q];K(Oe,q,H)&&(qt[At++]=Oe)}return qt}function Ul(H,K){var q=H==null?0:H.length;return!!q&&_s(H,K,0)>-1}function df(H,K,q){for(var gt=-1,At=H==null?0:H.length;++gt<At;)if(q(K,H[gt]))return!0;return!1}function de(H,K){for(var q=-1,gt=H==null?0:H.length,At=Array(gt);++q<gt;)At[q]=K(H[q],q,H);return At}function ji(H,K){for(var q=-1,gt=K.length,At=H.length;++q<gt;)H[At+q]=K[q];return H}function ff(H,K,q,gt){var At=-1,qt=H==null?0:H.length;for(gt&&qt&&(q=H[++At]);++At<qt;)q=K(q,H[At],At,H);return q}function rF(H,K,q,gt){var At=H==null?0:H.length;for(gt&&At&&(q=H[--At]);At--;)q=K(q,H[At],At,H);return q}function hf(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt;)if(K(H[q],q,H))return!0;return!1}var sF=pf("length");function oF(H){return H.split("")}function aF(H){return H.match(Ud)||[]}function gy(H,K,q){var gt;return q(H,function(At,qt,Oe){if(K(At,qt,Oe))return gt=qt,!1}),gt}function Hl(H,K,q,gt){for(var At=H.length,qt=q+(gt?1:-1);gt?qt--:++qt<At;)if(K(H[qt],qt,H))return qt;return-1}function _s(H,K,q){return K===K?bF(H,K,q):Hl(H,_y,q)}function lF(H,K,q,gt){for(var At=q-1,qt=H.length;++At<qt;)if(gt(H[At],K))return At;return-1}function _y(H){return H!==H}function yy(H,K){var q=H==null?0:H.length;return q?gf(H,K)/q:G}function pf(H){return function(K){return K==null?n:K[H]}}function mf(H){return function(K){return H==null?n:H[K]}}function by(H,K,q,gt,At){return At(H,function(qt,Oe,re){q=gt?(gt=!1,qt):K(q,qt,Oe,re)}),q}function cF(H,K){var q=H.length;for(H.sort(K);q--;)H[q]=H[q].value;return H}function gf(H,K){for(var q,gt=-1,At=H.length;++gt<At;){var qt=K(H[gt]);qt!==n&&(q=q===n?qt:q+qt)}return q}function _f(H,K){for(var q=-1,gt=Array(H);++q<H;)gt[q]=K(q);return gt}function uF(H,K){return de(K,function(q){return[q,H[q]]})}function xy(H){return H&&H.slice(0,Ty(H)+1).replace(No,"")}function bn(H){return function(K){return H(K)}}function yf(H,K){return de(K,function(q){return H[q]})}function Vo(H,K){return H.has(K)}function wy(H,K){for(var q=-1,gt=H.length;++q<gt&&_s(K,H[q],0)>-1;);return q}function vy(H,K){for(var q=H.length;q--&&_s(K,H[q],0)>-1;);return q}function dF(H,K){for(var q=H.length,gt=0;q--;)H[q]===K&&++gt;return gt}var fF=mf(Y),hF=mf(tt);function pF(H){return"\\"+Ce[H]}function mF(H,K){return H==null?n:H[K]}function ys(H){return ms.test(H)}function gF(H){return cf.test(H)}function _F(H){for(var K,q=[];!(K=H.next()).done;)q.push(K.value);return q}function bf(H){var K=-1,q=Array(H.size);return H.forEach(function(gt,At){q[++K]=[At,gt]}),q}function Sy(H,K){return function(q){return H(K(q))}}function Gi(H,K){for(var q=-1,gt=H.length,At=0,qt=[];++q<gt;){var Oe=H[q];(Oe===K||Oe===m)&&(H[q]=m,qt[At++]=q)}return qt}function Wl(H){var K=-1,q=Array(H.size);return H.forEach(function(gt){q[++K]=gt}),q}function yF(H){var K=-1,q=Array(H.size);return H.forEach(function(gt){q[++K]=[gt,gt]}),q}function bF(H,K,q){for(var gt=q-1,At=H.length;++gt<At;)if(H[gt]===K)return gt;return-1}function xF(H,K,q){for(var gt=q+1;gt--;)if(H[gt]===K)return gt;return gt}function bs(H){return ys(H)?vF(H):sF(H)}function Fn(H){return ys(H)?SF(H):oF(H)}function Ty(H){for(var K=H.length;K--&&Bd.test(H.charAt(K)););return K}var wF=mf(xt);function vF(H){for(var K=ps.lastIndex=0;ps.test(H);)++K;return K}function SF(H){return H.match(ps)||[]}function TF(H){return H.match(lf)||[]}var kF=(function H(K){K=K==null?ue:xs.defaults(ue.Object(),K,xs.pick(ue,Wo));var q=K.Array,gt=K.Date,At=K.Error,qt=K.Function,Oe=K.Math,re=K.Object,xf=K.RegExp,MF=K.String,On=K.TypeError,$l=q.prototype,DF=qt.prototype,ws=re.prototype,Vl=K["__core-js_shared__"],Yl=DF.toString,Kt=ws.hasOwnProperty,CF=0,ky=(function(){var o=/[^.]+$/.exec(Vl&&Vl.keys&&Vl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),ql=ws.toString,OF=Yl.call(re),AF=ue._,EF=xf("^"+Yl.call(Kt).replace(Lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jl=$o?K.Buffer:n,Ki=K.Symbol,Gl=K.Uint8Array,My=jl?jl.allocUnsafe:n,Kl=Sy(re.getPrototypeOf,re),Dy=re.create,Cy=ws.propertyIsEnumerable,Xl=$l.splice,Oy=Ki?Ki.isConcatSpreadable:n,Yo=Ki?Ki.iterator:n,Cr=Ki?Ki.toStringTag:n,Zl=(function(){try{var o=Pr(re,"defineProperty");return o({},"",{}),o}catch{}})(),RF=K.clearTimeout!==ue.clearTimeout&&K.clearTimeout,PF=gt&>.now!==ue.Date.now&>.now,IF=K.setTimeout!==ue.setTimeout&&K.setTimeout,Ql=Oe.ceil,Jl=Oe.floor,wf=re.getOwnPropertySymbols,LF=jl?jl.isBuffer:n,Ay=K.isFinite,NF=$l.join,BF=Sy(re.keys,re),Ae=Oe.max,Xe=Oe.min,FF=gt.now,zF=K.parseInt,Ey=Oe.random,UF=$l.reverse,vf=Pr(K,"DataView"),qo=Pr(K,"Map"),Sf=Pr(K,"Promise"),vs=Pr(K,"Set"),jo=Pr(K,"WeakMap"),Go=Pr(re,"create"),tc=jo&&new jo,Ss={},HF=Ir(vf),WF=Ir(qo),$F=Ir(Sf),VF=Ir(vs),YF=Ir(jo),ec=Ki?Ki.prototype:n,Ko=ec?ec.valueOf:n,Ry=ec?ec.toString:n;function T(o){if(_e(o)&&!It(o)&&!(o instanceof Ht)){if(o instanceof An)return o;if(Kt.call(o,"__wrapped__"))return Pb(o)}return new An(o)}var Ts=(function(){function o(){}return function(c){if(!pe(c))return{};if(Dy)return Dy(c);o.prototype=c;var p=new o;return o.prototype=n,p}})();function nc(){}function An(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}T.templateSettings={escape:Pd,evaluate:Id,interpolate:Io,variable:"",imports:{_:T}},T.prototype=nc.prototype,T.prototype.constructor=T,An.prototype=Ts(nc.prototype),An.prototype.constructor=An;function Ht(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function qF(){var o=new Ht(this.__wrapped__);return o.__actions__=dn(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=dn(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=dn(this.__views__),o}function jF(){if(this.__filtered__){var o=new Ht(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function GF(){var o=this.__wrapped__.value(),c=this.__dir__,p=It(o),_=c<0,b=p?o.length:0,k=oU(0,b,this.__views__),E=k.start,I=k.end,W=I-E,Q=_?I:E-1,J=this.__iteratees__,nt=J.length,ft=0,wt=Xe(W,this.__takeCount__);if(!p||!_&&b==W&&wt==W)return nb(o,this.__actions__);var Ct=[];t:for(;W--&&ft<wt;){Q+=c;for(var Ft=-1,Mt=o[Q];++Ft<nt;){var Ut=J[Ft],Wt=Ut.iteratee,vn=Ut.type,rn=Wt(Mt);if(vn==ut)Mt=rn;else if(!rn){if(vn==dt)continue t;break t}}Ct[ft++]=Mt}return Ct}Ht.prototype=Ts(nc.prototype),Ht.prototype.constructor=Ht;function Or(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function KF(){this.__data__=Go?Go(null):{},this.size=0}function XF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function ZF(o){var c=this.__data__;if(Go){var p=c[o];return p===d?n:p}return Kt.call(c,o)?c[o]:n}function QF(o){var c=this.__data__;return Go?c[o]!==n:Kt.call(c,o)}function JF(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=Go&&c===n?d:c,this}Or.prototype.clear=KF,Or.prototype.delete=XF,Or.prototype.get=ZF,Or.prototype.has=QF,Or.prototype.set=JF;function mi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function tz(){this.__data__=[],this.size=0}function ez(o){var c=this.__data__,p=ic(c,o);if(p<0)return!1;var _=c.length-1;return p==_?c.pop():Xl.call(c,p,1),--this.size,!0}function nz(o){var c=this.__data__,p=ic(c,o);return p<0?n:c[p][1]}function iz(o){return ic(this.__data__,o)>-1}function rz(o,c){var p=this.__data__,_=ic(p,o);return _<0?(++this.size,p.push([o,c])):p[_][1]=c,this}mi.prototype.clear=tz,mi.prototype.delete=ez,mi.prototype.get=nz,mi.prototype.has=iz,mi.prototype.set=rz;function gi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function sz(){this.size=0,this.__data__={hash:new Or,map:new(qo||mi),string:new Or}}function oz(o){var c=mc(this,o).delete(o);return this.size-=c?1:0,c}function az(o){return mc(this,o).get(o)}function lz(o){return mc(this,o).has(o)}function cz(o,c){var p=mc(this,o),_=p.size;return p.set(o,c),this.size+=p.size==_?0:1,this}gi.prototype.clear=sz,gi.prototype.delete=oz,gi.prototype.get=az,gi.prototype.has=lz,gi.prototype.set=cz;function Ar(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new gi;++c<p;)this.add(o[c])}function uz(o){return this.__data__.set(o,d),this}function dz(o){return this.__data__.has(o)}Ar.prototype.add=Ar.prototype.push=uz,Ar.prototype.has=dz;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function fz(){this.__data__=new mi,this.size=0}function hz(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function pz(o){return this.__data__.get(o)}function mz(o){return this.__data__.has(o)}function gz(o,c){var p=this.__data__;if(p instanceof mi){var _=p.__data__;if(!qo||_.length<r-1)return _.push([o,c]),this.size=++p.size,this;p=this.__data__=new gi(_)}return p.set(o,c),this.size=p.size,this}zn.prototype.clear=fz,zn.prototype.delete=hz,zn.prototype.get=pz,zn.prototype.has=mz,zn.prototype.set=gz;function Py(o,c){var p=It(o),_=!p&&Lr(o),b=!p&&!_&&tr(o),k=!p&&!_&&!b&&Cs(o),E=p||_||b||k,I=E?_f(o.length,MF):[],W=I.length;for(var Q in o)(c||Kt.call(o,Q))&&!(E&&(Q=="length"||b&&(Q=="offset"||Q=="parent")||k&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||bi(Q,W)))&&I.push(Q);return I}function Iy(o){var c=o.length;return c?o[If(0,c-1)]:n}function _z(o,c){return gc(dn(o),Er(c,0,o.length))}function yz(o){return gc(dn(o))}function Tf(o,c,p){(p!==n&&!Hn(o[c],p)||p===n&&!(c in o))&&Jn(o,c,p)}function Xo(o,c,p){var _=o[c];(!(Kt.call(o,c)&&Hn(_,p))||p===n&&!(c in o))&&Jn(o,c,p)}function ic(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function bz(o,c,p,_){return Xi(o,function(b,k,E){c(_,b,p(b),E)}),_}function Ly(o,c){return o&&ei(c,Ie(c),o)}function xz(o,c){return o&&ei(c,hn(c),o)}function Jn(o,c,p){c=="__proto__"&&Zl?Zl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function kf(o,c){for(var p=-1,_=c.length,b=q(_),k=o==null;++p<_;)b[p]=k?n:oh(o,c[p]);return b}function Er(o,c,p){return o===o&&(p!==n&&(o=o<=p?o:p),c!==n&&(o=o>=c?o:c)),o}function En(o,c,p,_,b,k){var E,I=c&g,W=c&y,Q=c&x;if(p&&(E=b?p(o,_,b,k):p(o)),E!==n)return E;if(!pe(o))return o;var J=It(o);if(J){if(E=lU(o),!I)return dn(o,E)}else{var nt=Ze(o),ft=nt==Rt||nt==j;if(tr(o))return sb(o,I);if(nt==_t||nt==ht||ft&&!b){if(E=W||ft?{}:Tb(o),!I)return W?Zz(o,xz(E,o)):Xz(o,Ly(E,o))}else{if(!M[nt])return b?o:{};E=cU(o,nt,I)}}k||(k=new zn);var wt=k.get(o);if(wt)return wt;k.set(o,E),Jb(o)?o.forEach(function(Mt){E.add(En(Mt,c,p,Mt,o,k))}):Zb(o)&&o.forEach(function(Mt,Ut){E.set(Ut,En(Mt,c,p,Ut,o,k))});var Ct=Q?W?Yf:Vf:W?hn:Ie,Ft=J?n:Ct(o);return yn(Ft||o,function(Mt,Ut){Ft&&(Ut=Mt,Mt=o[Ut]),Xo(E,Ut,En(Mt,c,p,Ut,o,k))}),E}function wz(o){var c=Ie(o);return function(p){return Ny(p,o,c)}}function Ny(o,c,p){var _=p.length;if(o==null)return!_;for(o=re(o);_--;){var b=p[_],k=c[b],E=o[b];if(E===n&&!(b in o)||!k(E))return!1}return!0}function By(o,c,p){if(typeof o!="function")throw new On(a);return ia(function(){o.apply(n,p)},c)}function Zo(o,c,p,_){var b=-1,k=Ul,E=!0,I=o.length,W=[],Q=c.length;if(!I)return W;p&&(c=de(c,bn(p))),_?(k=df,E=!1):c.length>=r&&(k=Vo,E=!1,c=new Ar(c));t:for(;++b<I;){var J=o[b],nt=p==null?J:p(J);if(J=_||J!==0?J:0,E&&nt===nt){for(var ft=Q;ft--;)if(c[ft]===nt)continue t;W.push(J)}else k(c,nt,_)||W.push(J)}return W}var Xi=ub(ti),Fy=ub(Df,!0);function vz(o,c){var p=!0;return Xi(o,function(_,b,k){return p=!!c(_,b,k),p}),p}function rc(o,c,p){for(var _=-1,b=o.length;++_<b;){var k=o[_],E=c(k);if(E!=null&&(I===n?E===E&&!wn(E):p(E,I)))var I=E,W=k}return W}function Sz(o,c,p,_){var b=o.length;for(p=Bt(p),p<0&&(p=-p>b?0:b+p),_=_===n||_>b?b:Bt(_),_<0&&(_+=b),_=p>_?0:ex(_);p<_;)o[p++]=c;return o}function zy(o,c){var p=[];return Xi(o,function(_,b,k){c(_,b,k)&&p.push(_)}),p}function Ue(o,c,p,_,b){var k=-1,E=o.length;for(p||(p=dU),b||(b=[]);++k<E;){var I=o[k];c>0&&p(I)?c>1?Ue(I,c-1,p,_,b):ji(b,I):_||(b[b.length]=I)}return b}var Mf=db(),Uy=db(!0);function ti(o,c){return o&&Mf(o,c,Ie)}function Df(o,c){return o&&Uy(o,c,Ie)}function sc(o,c){return qi(c,function(p){return xi(o[p])})}function Rr(o,c){c=Qi(c,o);for(var p=0,_=c.length;o!=null&&p<_;)o=o[Un(c[p++])];return p&&p==_?o:n}function Hy(o,c,p){var _=c(o);return It(o)?_:ji(_,p(o))}function en(o){return o==null?o===n?Be:Gt:Cr&&Cr in re(o)?sU(o):yU(o)}function Cf(o,c){return o>c}function Tz(o,c){return o!=null&&Kt.call(o,c)}function kz(o,c){return o!=null&&c in re(o)}function Mz(o,c,p){return o>=Xe(c,p)&&o<Ae(c,p)}function Of(o,c,p){for(var _=p?df:Ul,b=o[0].length,k=o.length,E=k,I=q(k),W=1/0,Q=[];E--;){var J=o[E];E&&c&&(J=de(J,bn(c))),W=Xe(J.length,W),I[E]=!p&&(c||b>=120&&J.length>=120)?new Ar(E&&J):n}J=o[0];var nt=-1,ft=I[0];t:for(;++nt<b&&Q.length<W;){var wt=J[nt],Ct=c?c(wt):wt;if(wt=p||wt!==0?wt:0,!(ft?Vo(ft,Ct):_(Q,Ct,p))){for(E=k;--E;){var Ft=I[E];if(!(Ft?Vo(Ft,Ct):_(o[E],Ct,p)))continue t}ft&&ft.push(Ct),Q.push(wt)}}return Q}function Dz(o,c,p,_){return ti(o,function(b,k,E){c(_,p(b),k,E)}),_}function Qo(o,c,p){c=Qi(c,o),o=Cb(o,c);var _=o==null?o:o[Un(Pn(c))];return _==null?n:_n(_,o,p)}function Wy(o){return _e(o)&&en(o)==ht}function Cz(o){return _e(o)&&en(o)==Pe}function Oz(o){return _e(o)&&en(o)==vt}function Jo(o,c,p,_,b){return o===c?!0:o==null||c==null||!_e(o)&&!_e(c)?o!==o&&c!==c:Az(o,c,p,_,Jo,b)}function Az(o,c,p,_,b,k){var E=It(o),I=It(c),W=E?mt:Ze(o),Q=I?mt:Ze(c);W=W==ht?_t:W,Q=Q==ht?_t:Q;var J=W==_t,nt=Q==_t,ft=W==Q;if(ft&&tr(o)){if(!tr(c))return!1;E=!0,J=!1}if(ft&&!J)return k||(k=new zn),E||Cs(o)?wb(o,c,p,_,b,k):iU(o,c,W,p,_,b,k);if(!(p&v)){var wt=J&&Kt.call(o,"__wrapped__"),Ct=nt&&Kt.call(c,"__wrapped__");if(wt||Ct){var Ft=wt?o.value():o,Mt=Ct?c.value():c;return k||(k=new zn),b(Ft,Mt,p,_,k)}}return ft?(k||(k=new zn),rU(o,c,p,_,b,k)):!1}function Ez(o){return _e(o)&&Ze(o)==et}function Af(o,c,p,_){var b=p.length,k=b,E=!_;if(o==null)return!k;for(o=re(o);b--;){var I=p[b];if(E&&I[2]?I[1]!==o[I[0]]:!(I[0]in o))return!1}for(;++b<k;){I=p[b];var W=I[0],Q=o[W],J=I[1];if(E&&I[2]){if(Q===n&&!(W in o))return!1}else{var nt=new zn;if(_)var ft=_(Q,J,W,o,c,nt);if(!(ft===n?Jo(J,Q,v|S,_,nt):ft))return!1}}return!0}function $y(o){if(!pe(o)||hU(o))return!1;var c=xi(o)?EF:Vd;return c.test(Ir(o))}function Rz(o){return _e(o)&&en(o)==Te}function Pz(o){return _e(o)&&Ze(o)==ee}function Iz(o){return _e(o)&&vc(o.length)&&!!ie[en(o)]}function Vy(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?It(o)?jy(o[0],o[1]):qy(o):hx(o)}function Ef(o){if(!na(o))return BF(o);var c=[];for(var p in re(o))Kt.call(o,p)&&p!="constructor"&&c.push(p);return c}function Lz(o){if(!pe(o))return _U(o);var c=na(o),p=[];for(var _ in o)_=="constructor"&&(c||!Kt.call(o,_))||p.push(_);return p}function Rf(o,c){return o<c}function Yy(o,c){var p=-1,_=fn(o)?q(o.length):[];return Xi(o,function(b,k,E){_[++p]=c(b,k,E)}),_}function qy(o){var c=jf(o);return c.length==1&&c[0][2]?Mb(c[0][0],c[0][1]):function(p){return p===o||Af(p,o,c)}}function jy(o,c){return Kf(o)&&kb(c)?Mb(Un(o),c):function(p){var _=oh(p,o);return _===n&&_===c?ah(p,o):Jo(c,_,v|S)}}function oc(o,c,p,_,b){o!==c&&Mf(c,function(k,E){if(b||(b=new zn),pe(k))Nz(o,c,E,p,oc,_,b);else{var I=_?_(Zf(o,E),k,E+"",o,c,b):n;I===n&&(I=k),Tf(o,E,I)}},hn)}function Nz(o,c,p,_,b,k,E){var I=Zf(o,p),W=Zf(c,p),Q=E.get(W);if(Q){Tf(o,p,Q);return}var J=k?k(I,W,p+"",o,c,E):n,nt=J===n;if(nt){var ft=It(W),wt=!ft&&tr(W),Ct=!ft&&!wt&&Cs(W);J=W,ft||wt||Ct?It(I)?J=I:xe(I)?J=dn(I):wt?(nt=!1,J=sb(W,!0)):Ct?(nt=!1,J=ob(W,!0)):J=[]:ra(W)||Lr(W)?(J=I,Lr(I)?J=nx(I):(!pe(I)||xi(I))&&(J=Tb(W))):nt=!1}nt&&(E.set(W,J),b(J,W,_,k,E),E.delete(W)),Tf(o,p,J)}function Gy(o,c){var p=o.length;if(p)return c+=c<0?p:0,bi(c,p)?o[c]:n}function Ky(o,c,p){c.length?c=de(c,function(k){return It(k)?function(E){return Rr(E,k.length===1?k[0]:k)}:k}):c=[pn];var _=-1;c=de(c,bn(Dt()));var b=Yy(o,function(k,E,I){var W=de(c,function(Q){return Q(k)});return{criteria:W,index:++_,value:k}});return cF(b,function(k,E){return Kz(k,E,p)})}function Bz(o,c){return Xy(o,c,function(p,_){return ah(o,_)})}function Xy(o,c,p){for(var _=-1,b=c.length,k={};++_<b;){var E=c[_],I=Rr(o,E);p(I,E)&&ta(k,Qi(E,o),I)}return k}function Fz(o){return function(c){return Rr(c,o)}}function Pf(o,c,p,_){var b=_?lF:_s,k=-1,E=c.length,I=o;for(o===c&&(c=dn(c)),p&&(I=de(o,bn(p)));++k<E;)for(var W=0,Q=c[k],J=p?p(Q):Q;(W=b(I,J,W,_))>-1;)I!==o&&Xl.call(I,W,1),Xl.call(o,W,1);return o}function Zy(o,c){for(var p=o?c.length:0,_=p-1;p--;){var b=c[p];if(p==_||b!==k){var k=b;bi(b)?Xl.call(o,b,1):Bf(o,b)}}return o}function If(o,c){return o+Jl(Ey()*(c-o+1))}function zz(o,c,p,_){for(var b=-1,k=Ae(Ql((c-o)/(p||1)),0),E=q(k);k--;)E[_?k:++b]=o,o+=p;return E}function Lf(o,c){var p="";if(!o||c<1||c>at)return p;do c%2&&(p+=o),c=Jl(c/2),c&&(o+=o);while(c);return p}function zt(o,c){return Qf(Db(o,c,pn),o+"")}function Uz(o){return Iy(Os(o))}function Hz(o,c){var p=Os(o);return gc(p,Er(c,0,p.length))}function ta(o,c,p,_){if(!pe(o))return o;c=Qi(c,o);for(var b=-1,k=c.length,E=k-1,I=o;I!=null&&++b<k;){var W=Un(c[b]),Q=p;if(W==="__proto__"||W==="constructor"||W==="prototype")return o;if(b!=E){var J=I[W];Q=_?_(J,W,I):n,Q===n&&(Q=pe(J)?J:bi(c[b+1])?[]:{})}Xo(I,W,Q),I=I[W]}return o}var Qy=tc?function(o,c){return tc.set(o,c),o}:pn,Wz=Zl?function(o,c){return Zl(o,"toString",{configurable:!0,enumerable:!1,value:ch(c),writable:!0})}:pn;function $z(o){return gc(Os(o))}function Rn(o,c,p){var _=-1,b=o.length;c<0&&(c=-c>b?0:b+c),p=p>b?b:p,p<0&&(p+=b),b=c>p?0:p-c>>>0,c>>>=0;for(var k=q(b);++_<b;)k[_]=o[_+c];return k}function Vz(o,c){var p;return Xi(o,function(_,b,k){return p=c(_,b,k),!p}),!!p}function ac(o,c,p){var _=0,b=o==null?_:o.length;if(typeof c=="number"&&c===c&&b<=Z){for(;_<b;){var k=_+b>>>1,E=o[k];E!==null&&!wn(E)&&(p?E<=c:E<c)?_=k+1:b=k}return b}return Nf(o,c,pn,p)}function Nf(o,c,p,_){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=p(c);for(var E=c!==c,I=c===null,W=wn(c),Q=c===n;b<k;){var J=Jl((b+k)/2),nt=p(o[J]),ft=nt!==n,wt=nt===null,Ct=nt===nt,Ft=wn(nt);if(E)var Mt=_||Ct;else Q?Mt=Ct&&(_||ft):I?Mt=Ct&&ft&&(_||!wt):W?Mt=Ct&&ft&&!wt&&(_||!Ft):wt||Ft?Mt=!1:Mt=_?nt<=c:nt<c;Mt?b=J+1:k=J}return Xe(k,z)}function Jy(o,c){for(var p=-1,_=o.length,b=0,k=[];++p<_;){var E=o[p],I=c?c(E):E;if(!p||!Hn(I,W)){var W=I;k[b++]=E===0?0:E}}return k}function tb(o){return typeof o=="number"?o:wn(o)?G:+o}function xn(o){if(typeof o=="string")return o;if(It(o))return de(o,xn)+"";if(wn(o))return Ry?Ry.call(o):"";var c=o+"";return c=="0"&&1/o==-Tt?"-0":c}function Zi(o,c,p){var _=-1,b=Ul,k=o.length,E=!0,I=[],W=I;if(p)E=!1,b=df;else if(k>=r){var Q=c?null:eU(o);if(Q)return Wl(Q);E=!1,b=Vo,W=new Ar}else W=c?[]:I;t:for(;++_<k;){var J=o[_],nt=c?c(J):J;if(J=p||J!==0?J:0,E&&nt===nt){for(var ft=W.length;ft--;)if(W[ft]===nt)continue t;c&&W.push(nt),I.push(J)}else b(W,nt,p)||(W!==I&&W.push(nt),I.push(J))}return I}function Bf(o,c){c=Qi(c,o);var p=-1,_=c.length;if(!_)return!0;for(;++p<_;){var b=Un(c[p]);if(b==="__proto__"&&!Kt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&p<_-1)return!1}var k=Cb(o,c);return k==null||delete k[Un(Pn(c))]}function eb(o,c,p,_){return ta(o,c,p(Rr(o,c)),_)}function lc(o,c,p,_){for(var b=o.length,k=_?b:-1;(_?k--:++k<b)&&c(o[k],k,o););return p?Rn(o,_?0:k,_?k+1:b):Rn(o,_?k+1:0,_?b:k)}function nb(o,c){var p=o;return p instanceof Ht&&(p=p.value()),ff(c,function(_,b){return b.func.apply(b.thisArg,ji([_],b.args))},p)}function Ff(o,c,p){var _=o.length;if(_<2)return _?Zi(o[0]):[];for(var b=-1,k=q(_);++b<_;)for(var E=o[b],I=-1;++I<_;)I!=b&&(k[b]=Zo(k[b]||E,o[I],c,p));return Zi(Ue(k,1),c,p)}function ib(o,c,p){for(var _=-1,b=o.length,k=c.length,E={};++_<b;){var I=_<k?c[_]:n;p(E,o[_],I)}return E}function zf(o){return xe(o)?o:[]}function Uf(o){return typeof o=="function"?o:pn}function Qi(o,c){return It(o)?o:Kf(o,c)?[o]:Rb(Xt(o))}var Yz=zt;function Ji(o,c,p){var _=o.length;return p=p===n?_:p,!c&&p>=_?o:Rn(o,c,p)}var rb=RF||function(o){return ue.clearTimeout(o)};function sb(o,c){if(c)return o.slice();var p=o.length,_=My?My(p):new o.constructor(p);return o.copy(_),_}function Hf(o){var c=new o.constructor(o.byteLength);return new Gl(c).set(new Gl(o)),c}function qz(o,c){var p=c?Hf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function jz(o){var c=new o.constructor(o.source,Sl.exec(o));return c.lastIndex=o.lastIndex,c}function Gz(o){return Ko?re(Ko.call(o)):{}}function ob(o,c){var p=c?Hf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function ab(o,c){if(o!==c){var p=o!==n,_=o===null,b=o===o,k=wn(o),E=c!==n,I=c===null,W=c===c,Q=wn(c);if(!I&&!Q&&!k&&o>c||k&&E&&W&&!I&&!Q||_&&E&&W||!p&&W||!b)return 1;if(!_&&!k&&!Q&&o<c||Q&&p&&b&&!_&&!k||I&&p&&b||!E&&b||!W)return-1}return 0}function Kz(o,c,p){for(var _=-1,b=o.criteria,k=c.criteria,E=b.length,I=p.length;++_<E;){var W=ab(b[_],k[_]);if(W){if(_>=I)return W;var Q=p[_];return W*(Q=="desc"?-1:1)}}return o.index-c.index}function lb(o,c,p,_){for(var b=-1,k=o.length,E=p.length,I=-1,W=c.length,Q=Ae(k-E,0),J=q(W+Q),nt=!_;++I<W;)J[I]=c[I];for(;++b<E;)(nt||b<k)&&(J[p[b]]=o[b]);for(;Q--;)J[I++]=o[b++];return J}function cb(o,c,p,_){for(var b=-1,k=o.length,E=-1,I=p.length,W=-1,Q=c.length,J=Ae(k-I,0),nt=q(J+Q),ft=!_;++b<J;)nt[b]=o[b];for(var wt=b;++W<Q;)nt[wt+W]=c[W];for(;++E<I;)(ft||b<k)&&(nt[wt+p[E]]=o[b++]);return nt}function dn(o,c){var p=-1,_=o.length;for(c||(c=q(_));++p<_;)c[p]=o[p];return c}function ei(o,c,p,_){var b=!p;p||(p={});for(var k=-1,E=c.length;++k<E;){var I=c[k],W=_?_(p[I],o[I],I,p,o):n;W===n&&(W=o[I]),b?Jn(p,I,W):Xo(p,I,W)}return p}function Xz(o,c){return ei(o,Gf(o),c)}function Zz(o,c){return ei(o,vb(o),c)}function cc(o,c){return function(p,_){var b=It(p)?nF:bz,k=c?c():{};return b(p,o,Dt(_,2),k)}}function ks(o){return zt(function(c,p){var _=-1,b=p.length,k=b>1?p[b-1]:n,E=b>2?p[2]:n;for(k=o.length>3&&typeof k=="function"?(b--,k):n,E&&nn(p[0],p[1],E)&&(k=b<3?n:k,b=1),c=re(c);++_<b;){var I=p[_];I&&o(c,I,_,k)}return c})}function ub(o,c){return function(p,_){if(p==null)return p;if(!fn(p))return o(p,_);for(var b=p.length,k=c?b:-1,E=re(p);(c?k--:++k<b)&&_(E[k],k,E)!==!1;);return p}}function db(o){return function(c,p,_){for(var b=-1,k=re(c),E=_(c),I=E.length;I--;){var W=E[o?I:++b];if(p(k[W],W,k)===!1)break}return c}}function Qz(o,c,p){var _=c&O,b=ea(o);function k(){var E=this&&this!==ue&&this instanceof k?b:o;return E.apply(_?p:this,arguments)}return k}function fb(o){return function(c){c=Xt(c);var p=ys(c)?Fn(c):n,_=p?p[0]:c.charAt(0),b=p?Ji(p,1).join(""):c.slice(1);return _[o]()+b}}function Ms(o){return function(c){return ff(dx(ux(c).replace(of,"")),o,"")}}function ea(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Ts(o.prototype),_=o.apply(p,c);return pe(_)?_:p}}function Jz(o,c,p){var _=ea(o);function b(){for(var k=arguments.length,E=q(k),I=k,W=Ds(b);I--;)E[I]=arguments[I];var Q=k<3&&E[0]!==W&&E[k-1]!==W?[]:Gi(E,W);if(k-=Q.length,k<p)return _b(o,c,uc,b.placeholder,n,E,Q,n,n,p-k);var J=this&&this!==ue&&this instanceof b?_:o;return _n(J,this,E)}return b}function hb(o){return function(c,p,_){var b=re(c);if(!fn(c)){var k=Dt(p,3);c=Ie(c),p=function(I){return k(b[I],I,b)}}var E=o(c,p,_);return E>-1?b[k?c[E]:E]:n}}function pb(o){return yi(function(c){var p=c.length,_=p,b=An.prototype.thru;for(o&&c.reverse();_--;){var k=c[_];if(typeof k!="function")throw new On(a);if(b&&!E&&pc(k)=="wrapper")var E=new An([],!0)}for(_=E?_:p;++_<p;){k=c[_];var I=pc(k),W=I=="wrapper"?qf(k):n;W&&Xf(W[0])&&W[1]==(D|L|F|w)&&!W[4].length&&W[9]==1?E=E[pc(W[0])].apply(E,W[3]):E=k.length==1&&Xf(k)?E[I]():E.thru(k)}return function(){var Q=arguments,J=Q[0];if(E&&Q.length==1&&It(J))return E.plant(J).value();for(var nt=0,ft=p?c[nt].apply(this,Q):J;++nt<p;)ft=c[nt].call(this,ft);return ft}})}function uc(o,c,p,_,b,k,E,I,W,Q){var J=c&D,nt=c&O,ft=c&A,wt=c&(L|R),Ct=c&C,Ft=ft?n:ea(o);function Mt(){for(var Ut=arguments.length,Wt=q(Ut),vn=Ut;vn--;)Wt[vn]=arguments[vn];if(wt)var rn=Ds(Mt),Sn=dF(Wt,rn);if(_&&(Wt=lb(Wt,_,b,wt)),k&&(Wt=cb(Wt,k,E,wt)),Ut-=Sn,wt&&Ut<Q){var we=Gi(Wt,rn);return _b(o,c,uc,Mt.placeholder,p,Wt,we,I,W,Q-Ut)}var Wn=nt?p:this,vi=ft?Wn[o]:o;return Ut=Wt.length,I?Wt=bU(Wt,I):Ct&&Ut>1&&Wt.reverse(),J&&W<Ut&&(Wt.length=W),this&&this!==ue&&this instanceof Mt&&(vi=Ft||ea(vi)),vi.apply(Wn,Wt)}return Mt}function mb(o,c){return function(p,_){return Dz(p,o,c(_),{})}}function dc(o,c){return function(p,_){var b;if(p===n&&_===n)return c;if(p!==n&&(b=p),_!==n){if(b===n)return _;typeof p=="string"||typeof _=="string"?(p=xn(p),_=xn(_)):(p=tb(p),_=tb(_)),b=o(p,_)}return b}}function Wf(o){return yi(function(c){return c=de(c,bn(Dt())),zt(function(p){var _=this;return o(c,function(b){return _n(b,_,p)})})})}function fc(o,c){c=c===n?" ":xn(c);var p=c.length;if(p<2)return p?Lf(c,o):c;var _=Lf(c,Ql(o/bs(c)));return ys(c)?Ji(Fn(_),0,o).join(""):_.slice(0,o)}function tU(o,c,p,_){var b=c&O,k=ea(o);function E(){for(var I=-1,W=arguments.length,Q=-1,J=_.length,nt=q(J+W),ft=this&&this!==ue&&this instanceof E?k:o;++Q<J;)nt[Q]=_[Q];for(;W--;)nt[Q++]=arguments[++I];return _n(ft,b?p:this,nt)}return E}function gb(o){return function(c,p,_){return _&&typeof _!="number"&&nn(c,p,_)&&(p=_=n),c=wi(c),p===n?(p=c,c=0):p=wi(p),_=_===n?c<p?1:-1:wi(_),zz(c,p,_,o)}}function hc(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=In(c),p=In(p)),o(c,p)}}function _b(o,c,p,_,b,k,E,I,W,Q){var J=c&L,nt=J?E:n,ft=J?n:E,wt=J?k:n,Ct=J?n:k;c|=J?F:U,c&=~(J?U:F),c&P||(c&=-4);var Ft=[o,c,b,wt,nt,Ct,ft,I,W,Q],Mt=p.apply(n,Ft);return Xf(o)&&Ob(Mt,Ft),Mt.placeholder=_,Ab(Mt,o,c)}function $f(o){var c=Oe[o];return function(p,_){if(p=In(p),_=_==null?0:Xe(Bt(_),292),_&&Ay(p)){var b=(Xt(p)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+_));return b=(Xt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-_))}return c(p)}}var eU=vs&&1/Wl(new vs([,-0]))[1]==Tt?function(o){return new vs(o)}:fh;function yb(o){return function(c){var p=Ze(c);return p==et?bf(c):p==ee?yF(c):uF(c,o(c))}}function _i(o,c,p,_,b,k,E,I){var W=c&A;if(!W&&typeof o!="function")throw new On(a);var Q=_?_.length:0;if(Q||(c&=-97,_=b=n),E=E===n?E:Ae(Bt(E),0),I=I===n?I:Bt(I),Q-=b?b.length:0,c&U){var J=_,nt=b;_=b=n}var ft=W?n:qf(o),wt=[o,c,p,_,b,J,nt,k,E,I];if(ft&&gU(wt,ft),o=wt[0],c=wt[1],p=wt[2],_=wt[3],b=wt[4],I=wt[9]=wt[9]===n?W?0:o.length:Ae(wt[9]-Q,0),!I&&c&(L|R)&&(c&=-25),!c||c==O)var Ct=Qz(o,c,p);else c==L||c==R?Ct=Jz(o,c,I):(c==F||c==(O|F))&&!b.length?Ct=tU(o,c,p,_):Ct=uc.apply(n,wt);var Ft=ft?Qy:Ob;return Ab(Ft(Ct,wt),o,c)}function bb(o,c,p,_){return o===n||Hn(o,ws[p])&&!Kt.call(_,p)?c:o}function xb(o,c,p,_,b,k){return pe(o)&&pe(c)&&(k.set(c,o),oc(o,c,n,xb,k),k.delete(c)),o}function nU(o){return ra(o)?n:o}function wb(o,c,p,_,b,k){var E=p&v,I=o.length,W=c.length;if(I!=W&&!(E&&W>I))return!1;var Q=k.get(o),J=k.get(c);if(Q&&J)return Q==c&&J==o;var nt=-1,ft=!0,wt=p&S?new Ar:n;for(k.set(o,c),k.set(c,o);++nt<I;){var Ct=o[nt],Ft=c[nt];if(_)var Mt=E?_(Ft,Ct,nt,c,o,k):_(Ct,Ft,nt,o,c,k);if(Mt!==n){if(Mt)continue;ft=!1;break}if(wt){if(!hf(c,function(Ut,Wt){if(!Vo(wt,Wt)&&(Ct===Ut||b(Ct,Ut,p,_,k)))return wt.push(Wt)})){ft=!1;break}}else if(!(Ct===Ft||b(Ct,Ft,p,_,k))){ft=!1;break}}return k.delete(o),k.delete(c),ft}function iU(o,c,p,_,b,k,E){switch(p){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Pe:return!(o.byteLength!=c.byteLength||!k(new Gl(o),new Gl(c)));case ot:case vt:case rt:return Hn(+o,+c);case bt:return o.name==c.name&&o.message==c.message;case Te:case je:return o==c+"";case et:var I=bf;case ee:var W=_&v;if(I||(I=Wl),o.size!=c.size&&!W)return!1;var Q=E.get(o);if(Q)return Q==c;_|=S,E.set(o,c);var J=wb(I(o),I(c),_,b,k,E);return E.delete(o),J;case Yt:if(Ko)return Ko.call(o)==Ko.call(c)}return!1}function rU(o,c,p,_,b,k){var E=p&v,I=Vf(o),W=I.length,Q=Vf(c),J=Q.length;if(W!=J&&!E)return!1;for(var nt=W;nt--;){var ft=I[nt];if(!(E?ft in c:Kt.call(c,ft)))return!1}var wt=k.get(o),Ct=k.get(c);if(wt&&Ct)return wt==c&&Ct==o;var Ft=!0;k.set(o,c),k.set(c,o);for(var Mt=E;++nt<W;){ft=I[nt];var Ut=o[ft],Wt=c[ft];if(_)var vn=E?_(Wt,Ut,ft,c,o,k):_(Ut,Wt,ft,o,c,k);if(!(vn===n?Ut===Wt||b(Ut,Wt,p,_,k):vn)){Ft=!1;break}Mt||(Mt=ft=="constructor")}if(Ft&&!Mt){var rn=o.constructor,Sn=c.constructor;rn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof rn=="function"&&rn instanceof rn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Ft=!1)}return k.delete(o),k.delete(c),Ft}function yi(o){return Qf(Db(o,n,Nb),o+"")}function Vf(o){return Hy(o,Ie,Gf)}function Yf(o){return Hy(o,hn,vb)}var qf=tc?function(o){return tc.get(o)}:fh;function pc(o){for(var c=o.name+"",p=Ss[c],_=Kt.call(Ss,c)?p.length:0;_--;){var b=p[_],k=b.func;if(k==null||k==o)return b.name}return c}function Ds(o){var c=Kt.call(T,"placeholder")?T:o;return c.placeholder}function Dt(){var o=T.iteratee||uh;return o=o===uh?Vy:o,arguments.length?o(arguments[0],arguments[1]):o}function mc(o,c){var p=o.__data__;return fU(c)?p[typeof c=="string"?"string":"hash"]:p.map}function jf(o){for(var c=Ie(o),p=c.length;p--;){var _=c[p],b=o[_];c[p]=[_,b,kb(b)]}return c}function Pr(o,c){var p=mF(o,c);return $y(p)?p:n}function sU(o){var c=Kt.call(o,Cr),p=o[Cr];try{o[Cr]=n;var _=!0}catch{}var b=ql.call(o);return _&&(c?o[Cr]=p:delete o[Cr]),b}var Gf=wf?function(o){return o==null?[]:(o=re(o),qi(wf(o),function(c){return Cy.call(o,c)}))}:hh,vb=wf?function(o){for(var c=[];o;)ji(c,Gf(o)),o=Kl(o);return c}:hh,Ze=en;(vf&&Ze(new vf(new ArrayBuffer(1)))!=gn||qo&&Ze(new qo)!=et||Sf&&Ze(Sf.resolve())!=$t||vs&&Ze(new vs)!=ee||jo&&Ze(new jo)!=se)&&(Ze=function(o){var c=en(o),p=c==_t?o.constructor:n,_=p?Ir(p):"";if(_)switch(_){case HF:return gn;case WF:return et;case $F:return $t;case VF:return ee;case YF:return se}return c});function oU(o,c,p){for(var _=-1,b=p.length;++_<b;){var k=p[_],E=k.size;switch(k.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=Xe(c,o+E);break;case"takeRight":o=Ae(o,c-E);break}}return{start:o,end:c}}function aU(o){var c=o.match(Fd);return c?c[1].split(zd):[]}function Sb(o,c,p){c=Qi(c,o);for(var _=-1,b=c.length,k=!1;++_<b;){var E=Un(c[_]);if(!(k=o!=null&&p(o,E)))break;o=o[E]}return k||++_!=b?k:(b=o==null?0:o.length,!!b&&vc(b)&&bi(E,b)&&(It(o)||Lr(o)))}function lU(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Kt.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function Tb(o){return typeof o.constructor=="function"&&!na(o)?Ts(Kl(o)):{}}function cU(o,c,p){var _=o.constructor;switch(c){case Pe:return Hf(o);case ot:case vt:return new _(+o);case gn:return qz(o,p);case Wi:case Cn:case Ge:case Ln:case di:case Oo:case Ao:case Tr:case fi:return ob(o,p);case et:return new _;case rt:case je:return new _(o);case Te:return jz(o);case ee:return new _;case Yt:return Gz(o)}}function uU(o,c){var p=c.length;if(!p)return o;var _=p-1;return c[_]=(p>1?"& ":"")+c[_],c=c.join(p>2?", ":" "),o.replace(Nn,`{
|
|
8
|
+
/* [wrapped with `+c+`] */
|
|
9
|
+
`)}function dU(o){return It(o)||Lr(o)||!!(Oy&&o&&o[Oy])}function bi(o,c){var p=typeof o;return c=c??at,!!c&&(p=="number"||p!="symbol"&&Yi.test(o))&&o>-1&&o%1==0&&o<c}function nn(o,c,p){if(!pe(p))return!1;var _=typeof c;return(_=="number"?fn(p)&&bi(c,p.length):_=="string"&&c in p)?Hn(p[c],o):!1}function Kf(o,c){if(It(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||wn(o)?!0:hi.test(o)||!wl.test(o)||c!=null&&o in re(c)}function fU(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Xf(o){var c=pc(o),p=T[c];if(typeof p!="function"||!(c in Ht.prototype))return!1;if(o===p)return!0;var _=qf(p);return!!_&&o===_[0]}function hU(o){return!!ky&&ky in o}var pU=Vl?xi:ph;function na(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||ws;return o===p}function kb(o){return o===o&&!pe(o)}function Mb(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in re(p))}}function mU(o){var c=xc(o,function(_){return p.size===h&&p.clear(),_}),p=c.cache;return c}function gU(o,c){var p=o[1],_=c[1],b=p|_,k=b<(O|A|D),E=_==D&&p==L||_==D&&p==w&&o[7].length<=c[8]||_==(D|w)&&c[7].length<=c[8]&&p==L;if(!(k||E))return o;_&O&&(o[2]=c[2],b|=p&O?0:P);var I=c[3];if(I){var W=o[3];o[3]=W?lb(W,I,c[4]):I,o[4]=W?Gi(o[3],m):c[4]}return I=c[5],I&&(W=o[5],o[5]=W?cb(W,I,c[6]):I,o[6]=W?Gi(o[5],m):c[6]),I=c[7],I&&(o[7]=I),_&D&&(o[8]=o[8]==null?c[8]:Xe(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function _U(o){var c=[];if(o!=null)for(var p in re(o))c.push(p);return c}function yU(o){return ql.call(o)}function Db(o,c,p){return c=Ae(c===n?o.length-1:c,0),function(){for(var _=arguments,b=-1,k=Ae(_.length-c,0),E=q(k);++b<k;)E[b]=_[c+b];b=-1;for(var I=q(c+1);++b<c;)I[b]=_[b];return I[c]=p(E),_n(o,this,I)}}function Cb(o,c){return c.length<2?o:Rr(o,Rn(c,0,-1))}function bU(o,c){for(var p=o.length,_=Xe(c.length,p),b=dn(o);_--;){var k=c[_];o[_]=bi(k,p)?b[k]:n}return o}function Zf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Ob=Eb(Qy),ia=IF||function(o,c){return ue.setTimeout(o,c)},Qf=Eb(Wz);function Ab(o,c,p){var _=c+"";return Qf(o,uU(_,xU(aU(_),p)))}function Eb(o){var c=0,p=0;return function(){var _=FF(),b=st-(_-p);if(p=_,b>0){if(++c>=V)return arguments[0]}else c=0;return o.apply(n,arguments)}}function gc(o,c){var p=-1,_=o.length,b=_-1;for(c=c===n?_:c;++p<c;){var k=If(p,b),E=o[k];o[k]=o[p],o[p]=E}return o.length=c,o}var Rb=mU(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Ld,function(p,_,b,k){c.push(b?k.replace(Hd,"$1"):_||p)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-Tt?"-0":c}function Ir(o){if(o!=null){try{return Yl.call(o)}catch{}try{return o+""}catch{}}return""}function xU(o,c){return yn(it,function(p){var _="_."+p[0];c&p[1]&&!Ul(o,_)&&o.push(_)}),o.sort()}function Pb(o){if(o instanceof Ht)return o.clone();var c=new An(o.__wrapped__,o.__chain__);return c.__actions__=dn(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function wU(o,c,p){(p?nn(o,c,p):c===n)?c=1:c=Ae(Bt(c),0);var _=o==null?0:o.length;if(!_||c<1)return[];for(var b=0,k=0,E=q(Ql(_/c));b<_;)E[k++]=Rn(o,b,b+=c);return E}function vU(o){for(var c=-1,p=o==null?0:o.length,_=0,b=[];++c<p;){var k=o[c];k&&(b[_++]=k)}return b}function SU(){var o=arguments.length;if(!o)return[];for(var c=q(o-1),p=arguments[0],_=o;_--;)c[_-1]=arguments[_];return ji(It(p)?dn(p):[p],Ue(c,1))}var TU=zt(function(o,c){return xe(o)?Zo(o,Ue(c,1,xe,!0)):[]}),kU=zt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),Dt(p,2)):[]}),MU=zt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),n,p):[]});function DU(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:Bt(c),Rn(o,c<0?0:c,_)):[]}function CU(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:Bt(c),c=_-c,Rn(o,0,c<0?0:c)):[]}function OU(o,c){return o&&o.length?lc(o,Dt(c,3),!0,!0):[]}function AU(o,c){return o&&o.length?lc(o,Dt(c,3),!0):[]}function EU(o,c,p,_){var b=o==null?0:o.length;return b?(p&&typeof p!="number"&&nn(o,c,p)&&(p=0,_=b),Sz(o,c,p,_)):[]}function Ib(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=p==null?0:Bt(p);return b<0&&(b=Ae(_+b,0)),Hl(o,Dt(c,3),b)}function Lb(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=_-1;return p!==n&&(b=Bt(p),b=p<0?Ae(_+b,0):Xe(b,_-1)),Hl(o,Dt(c,3),b,!0)}function Nb(o){var c=o==null?0:o.length;return c?Ue(o,1):[]}function RU(o){var c=o==null?0:o.length;return c?Ue(o,Tt):[]}function PU(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:Bt(c),Ue(o,c)):[]}function IU(o){for(var c=-1,p=o==null?0:o.length,_={};++c<p;){var b=o[c];Jn(_,b[0],b[1])}return _}function Bb(o){return o&&o.length?o[0]:n}function LU(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=p==null?0:Bt(p);return b<0&&(b=Ae(_+b,0)),_s(o,c,b)}function NU(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var BU=zt(function(o){var c=de(o,zf);return c.length&&c[0]===o[0]?Of(c):[]}),FU=zt(function(o){var c=Pn(o),p=de(o,zf);return c===Pn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?Of(p,Dt(c,2)):[]}),zU=zt(function(o){var c=Pn(o),p=de(o,zf);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?Of(p,n,c):[]});function UU(o,c){return o==null?"":NF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function HU(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=_;return p!==n&&(b=Bt(p),b=b<0?Ae(_+b,0):Xe(b,_-1)),c===c?xF(o,c,b):Hl(o,_y,b,!0)}function WU(o,c){return o&&o.length?Gy(o,Bt(c)):n}var $U=zt(Fb);function Fb(o,c){return o&&o.length&&c&&c.length?Pf(o,c):o}function VU(o,c,p){return o&&o.length&&c&&c.length?Pf(o,c,Dt(p,2)):o}function YU(o,c,p){return o&&o.length&&c&&c.length?Pf(o,c,n,p):o}var qU=yi(function(o,c){var p=o==null?0:o.length,_=kf(o,c);return Zy(o,de(c,function(b){return bi(b,p)?+b:b}).sort(ab)),_});function jU(o,c){var p=[];if(!(o&&o.length))return p;var _=-1,b=[],k=o.length;for(c=Dt(c,3);++_<k;){var E=o[_];c(E,_,o)&&(p.push(E),b.push(_))}return Zy(o,b),p}function Jf(o){return o==null?o:UF.call(o)}function GU(o,c,p){var _=o==null?0:o.length;return _?(p&&typeof p!="number"&&nn(o,c,p)?(c=0,p=_):(c=c==null?0:Bt(c),p=p===n?_:Bt(p)),Rn(o,c,p)):[]}function KU(o,c){return ac(o,c)}function XU(o,c,p){return Nf(o,c,Dt(p,2))}function ZU(o,c){var p=o==null?0:o.length;if(p){var _=ac(o,c);if(_<p&&Hn(o[_],c))return _}return-1}function QU(o,c){return ac(o,c,!0)}function JU(o,c,p){return Nf(o,c,Dt(p,2),!0)}function t5(o,c){var p=o==null?0:o.length;if(p){var _=ac(o,c,!0)-1;if(Hn(o[_],c))return _}return-1}function e5(o){return o&&o.length?Jy(o):[]}function n5(o,c){return o&&o.length?Jy(o,Dt(c,2)):[]}function i5(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function r5(o,c,p){return o&&o.length?(c=p||c===n?1:Bt(c),Rn(o,0,c<0?0:c)):[]}function s5(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:Bt(c),c=_-c,Rn(o,c<0?0:c,_)):[]}function o5(o,c){return o&&o.length?lc(o,Dt(c,3),!1,!0):[]}function a5(o,c){return o&&o.length?lc(o,Dt(c,3)):[]}var l5=zt(function(o){return Zi(Ue(o,1,xe,!0))}),c5=zt(function(o){var c=Pn(o);return xe(c)&&(c=n),Zi(Ue(o,1,xe,!0),Dt(c,2))}),u5=zt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Zi(Ue(o,1,xe,!0),n,c)});function d5(o){return o&&o.length?Zi(o):[]}function f5(o,c){return o&&o.length?Zi(o,Dt(c,2)):[]}function h5(o,c){return c=typeof c=="function"?c:n,o&&o.length?Zi(o,n,c):[]}function th(o){if(!(o&&o.length))return[];var c=0;return o=qi(o,function(p){if(xe(p))return c=Ae(p.length,c),!0}),_f(c,function(p){return de(o,pf(p))})}function zb(o,c){if(!(o&&o.length))return[];var p=th(o);return c==null?p:de(p,function(_){return _n(c,n,_)})}var p5=zt(function(o,c){return xe(o)?Zo(o,c):[]}),m5=zt(function(o){return Ff(qi(o,xe))}),g5=zt(function(o){var c=Pn(o);return xe(c)&&(c=n),Ff(qi(o,xe),Dt(c,2))}),_5=zt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Ff(qi(o,xe),n,c)}),y5=zt(th);function b5(o,c){return ib(o||[],c||[],Xo)}function x5(o,c){return ib(o||[],c||[],ta)}var w5=zt(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,zb(o,p)});function Ub(o){var c=T(o);return c.__chain__=!0,c}function v5(o,c){return c(o),o}function _c(o,c){return c(o)}var S5=yi(function(o){var c=o.length,p=c?o[0]:0,_=this.__wrapped__,b=function(k){return kf(k,o)};return c>1||this.__actions__.length||!(_ instanceof Ht)||!bi(p)?this.thru(b):(_=_.slice(p,+p+(c?1:0)),_.__actions__.push({func:_c,args:[b],thisArg:n}),new An(_,this.__chain__).thru(function(k){return c&&!k.length&&k.push(n),k}))});function T5(){return Ub(this)}function k5(){return new An(this.value(),this.__chain__)}function M5(){this.__values__===n&&(this.__values__=tx(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function D5(){return this}function C5(o){for(var c,p=this;p instanceof nc;){var _=Pb(p);_.__index__=0,_.__values__=n,c?b.__wrapped__=_:c=_;var b=_;p=p.__wrapped__}return b.__wrapped__=o,c}function O5(){var o=this.__wrapped__;if(o instanceof Ht){var c=o;return this.__actions__.length&&(c=new Ht(this)),c=c.reverse(),c.__actions__.push({func:_c,args:[Jf],thisArg:n}),new An(c,this.__chain__)}return this.thru(Jf)}function A5(){return nb(this.__wrapped__,this.__actions__)}var E5=cc(function(o,c,p){Kt.call(o,p)?++o[p]:Jn(o,p,1)});function R5(o,c,p){var _=It(o)?my:vz;return p&&nn(o,c,p)&&(c=n),_(o,Dt(c,3))}function P5(o,c){var p=It(o)?qi:zy;return p(o,Dt(c,3))}var I5=hb(Ib),L5=hb(Lb);function N5(o,c){return Ue(yc(o,c),1)}function B5(o,c){return Ue(yc(o,c),Tt)}function F5(o,c,p){return p=p===n?1:Bt(p),Ue(yc(o,c),p)}function Hb(o,c){var p=It(o)?yn:Xi;return p(o,Dt(c,3))}function Wb(o,c){var p=It(o)?iF:Fy;return p(o,Dt(c,3))}var z5=cc(function(o,c,p){Kt.call(o,p)?o[p].push(c):Jn(o,p,[c])});function U5(o,c,p,_){o=fn(o)?o:Os(o),p=p&&!_?Bt(p):0;var b=o.length;return p<0&&(p=Ae(b+p,0)),Sc(o)?p<=b&&o.indexOf(c,p)>-1:!!b&&_s(o,c,p)>-1}var H5=zt(function(o,c,p){var _=-1,b=typeof c=="function",k=fn(o)?q(o.length):[];return Xi(o,function(E){k[++_]=b?_n(c,E,p):Qo(E,c,p)}),k}),W5=cc(function(o,c,p){Jn(o,p,c)});function yc(o,c){var p=It(o)?de:Yy;return p(o,Dt(c,3))}function $5(o,c,p,_){return o==null?[]:(It(c)||(c=c==null?[]:[c]),p=_?n:p,It(p)||(p=p==null?[]:[p]),Ky(o,c,p))}var V5=cc(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function Y5(o,c,p){var _=It(o)?ff:by,b=arguments.length<3;return _(o,Dt(c,4),p,b,Xi)}function q5(o,c,p){var _=It(o)?rF:by,b=arguments.length<3;return _(o,Dt(c,4),p,b,Fy)}function j5(o,c){var p=It(o)?qi:zy;return p(o,wc(Dt(c,3)))}function G5(o){var c=It(o)?Iy:Uz;return c(o)}function K5(o,c,p){(p?nn(o,c,p):c===n)?c=1:c=Bt(c);var _=It(o)?_z:Hz;return _(o,c)}function X5(o){var c=It(o)?yz:$z;return c(o)}function Z5(o){if(o==null)return 0;if(fn(o))return Sc(o)?bs(o):o.length;var c=Ze(o);return c==et||c==ee?o.size:Ef(o).length}function Q5(o,c,p){var _=It(o)?hf:Vz;return p&&nn(o,c,p)&&(c=n),_(o,Dt(c,3))}var J5=zt(function(o,c){if(o==null)return[];var p=c.length;return p>1&&nn(o,c[0],c[1])?c=[]:p>2&&nn(c[0],c[1],c[2])&&(c=[c[0]]),Ky(o,Ue(c,1),[])}),bc=PF||function(){return ue.Date.now()};function tH(o,c){if(typeof c!="function")throw new On(a);return o=Bt(o),function(){if(--o<1)return c.apply(this,arguments)}}function $b(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,_i(o,D,n,n,n,n,c)}function Vb(o,c){var p;if(typeof c!="function")throw new On(a);return o=Bt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var eh=zt(function(o,c,p){var _=O;if(p.length){var b=Gi(p,Ds(eh));_|=F}return _i(o,_,c,p,b)}),Yb=zt(function(o,c,p){var _=O|A;if(p.length){var b=Gi(p,Ds(Yb));_|=F}return _i(c,_,o,p,b)});function qb(o,c,p){c=p?n:c;var _=_i(o,L,n,n,n,n,n,c);return _.placeholder=qb.placeholder,_}function jb(o,c,p){c=p?n:c;var _=_i(o,R,n,n,n,n,n,c);return _.placeholder=jb.placeholder,_}function Gb(o,c,p){var _,b,k,E,I,W,Q=0,J=!1,nt=!1,ft=!0;if(typeof o!="function")throw new On(a);c=In(c)||0,pe(p)&&(J=!!p.leading,nt="maxWait"in p,k=nt?Ae(In(p.maxWait)||0,c):k,ft="trailing"in p?!!p.trailing:ft);function wt(we){var Wn=_,vi=b;return _=b=n,Q=we,E=o.apply(vi,Wn),E}function Ct(we){return Q=we,I=ia(Ut,c),J?wt(we):E}function Ft(we){var Wn=we-W,vi=we-Q,px=c-Wn;return nt?Xe(px,k-vi):px}function Mt(we){var Wn=we-W,vi=we-Q;return W===n||Wn>=c||Wn<0||nt&&vi>=k}function Ut(){var we=bc();if(Mt(we))return Wt(we);I=ia(Ut,Ft(we))}function Wt(we){return I=n,ft&&_?wt(we):(_=b=n,E)}function vn(){I!==n&&rb(I),Q=0,_=W=b=I=n}function rn(){return I===n?E:Wt(bc())}function Sn(){var we=bc(),Wn=Mt(we);if(_=arguments,b=this,W=we,Wn){if(I===n)return Ct(W);if(nt)return rb(I),I=ia(Ut,c),wt(W)}return I===n&&(I=ia(Ut,c)),E}return Sn.cancel=vn,Sn.flush=rn,Sn}var eH=zt(function(o,c){return By(o,1,c)}),nH=zt(function(o,c,p){return By(o,In(c)||0,p)});function iH(o){return _i(o,C)}function xc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new On(a);var p=function(){var _=arguments,b=c?c.apply(this,_):_[0],k=p.cache;if(k.has(b))return k.get(b);var E=o.apply(this,_);return p.cache=k.set(b,E)||k,E};return p.cache=new(xc.Cache||gi),p}xc.Cache=gi;function wc(o){if(typeof o!="function")throw new On(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function rH(o){return Vb(2,o)}var sH=Yz(function(o,c){c=c.length==1&&It(c[0])?de(c[0],bn(Dt())):de(Ue(c,1),bn(Dt()));var p=c.length;return zt(function(_){for(var b=-1,k=Xe(_.length,p);++b<k;)_[b]=c[b].call(this,_[b]);return _n(o,this,_)})}),nh=zt(function(o,c){var p=Gi(c,Ds(nh));return _i(o,F,n,c,p)}),Kb=zt(function(o,c){var p=Gi(c,Ds(Kb));return _i(o,U,n,c,p)}),oH=yi(function(o,c){return _i(o,w,n,n,n,c)});function aH(o,c){if(typeof o!="function")throw new On(a);return c=c===n?c:Bt(c),zt(o,c)}function lH(o,c){if(typeof o!="function")throw new On(a);return c=c==null?0:Ae(Bt(c),0),zt(function(p){var _=p[c],b=Ji(p,0,c);return _&&ji(b,_),_n(o,this,b)})}function cH(o,c,p){var _=!0,b=!0;if(typeof o!="function")throw new On(a);return pe(p)&&(_="leading"in p?!!p.leading:_,b="trailing"in p?!!p.trailing:b),Gb(o,c,{leading:_,maxWait:c,trailing:b})}function uH(o){return $b(o,1)}function dH(o,c){return nh(Uf(c),o)}function fH(){if(!arguments.length)return[];var o=arguments[0];return It(o)?o:[o]}function hH(o){return En(o,x)}function pH(o,c){return c=typeof c=="function"?c:n,En(o,x,c)}function mH(o){return En(o,g|x)}function gH(o,c){return c=typeof c=="function"?c:n,En(o,g|x,c)}function _H(o,c){return c==null||Ny(o,c,Ie(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var yH=hc(Cf),bH=hc(function(o,c){return o>=c}),Lr=Wy((function(){return arguments})())?Wy:function(o){return _e(o)&&Kt.call(o,"callee")&&!Cy.call(o,"callee")},It=q.isArray,xH=cy?bn(cy):Cz;function fn(o){return o!=null&&vc(o.length)&&!xi(o)}function xe(o){return _e(o)&&fn(o)}function wH(o){return o===!0||o===!1||_e(o)&&en(o)==ot}var tr=LF||ph,vH=uy?bn(uy):Oz;function SH(o){return _e(o)&&o.nodeType===1&&!ra(o)}function TH(o){if(o==null)return!0;if(fn(o)&&(It(o)||typeof o=="string"||typeof o.splice=="function"||tr(o)||Cs(o)||Lr(o)))return!o.length;var c=Ze(o);if(c==et||c==ee)return!o.size;if(na(o))return!Ef(o).length;for(var p in o)if(Kt.call(o,p))return!1;return!0}function kH(o,c){return Jo(o,c)}function MH(o,c,p){p=typeof p=="function"?p:n;var _=p?p(o,c):n;return _===n?Jo(o,c,n,p):!!_}function ih(o){if(!_e(o))return!1;var c=en(o);return c==bt||c==lt||typeof o.message=="string"&&typeof o.name=="string"&&!ra(o)}function DH(o){return typeof o=="number"&&Ay(o)}function xi(o){if(!pe(o))return!1;var c=en(o);return c==Rt||c==j||c==X||c==Me}function Xb(o){return typeof o=="number"&&o==Bt(o)}function vc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=at}function pe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function _e(o){return o!=null&&typeof o=="object"}var Zb=dy?bn(dy):Ez;function CH(o,c){return o===c||Af(o,c,jf(c))}function OH(o,c,p){return p=typeof p=="function"?p:n,Af(o,c,jf(c),p)}function AH(o){return Qb(o)&&o!=+o}function EH(o){if(pU(o))throw new At(s);return $y(o)}function RH(o){return o===null}function PH(o){return o==null}function Qb(o){return typeof o=="number"||_e(o)&&en(o)==rt}function ra(o){if(!_e(o)||en(o)!=_t)return!1;var c=Kl(o);if(c===null)return!0;var p=Kt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Yl.call(p)==OF}var rh=fy?bn(fy):Rz;function IH(o){return Xb(o)&&o>=-at&&o<=at}var Jb=hy?bn(hy):Pz;function Sc(o){return typeof o=="string"||!It(o)&&_e(o)&&en(o)==je}function wn(o){return typeof o=="symbol"||_e(o)&&en(o)==Yt}var Cs=py?bn(py):Iz;function LH(o){return o===n}function NH(o){return _e(o)&&Ze(o)==se}function BH(o){return _e(o)&&en(o)==De}var FH=hc(Rf),zH=hc(function(o,c){return o<=c});function tx(o){if(!o)return[];if(fn(o))return Sc(o)?Fn(o):dn(o);if(Yo&&o[Yo])return _F(o[Yo]());var c=Ze(o),p=c==et?bf:c==ee?Wl:Os;return p(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===Tt||o===-Tt){var c=o<0?-1:1;return c*pt}return o===o?o:0}function Bt(o){var c=wi(o),p=c%1;return c===c?p?c-p:c:0}function ex(o){return o?Er(Bt(o),0,B):0}function In(o){if(typeof o=="number")return o;if(wn(o))return G;if(pe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=pe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=xy(o);var p=$d.test(o);return p||Yd.test(o)?Bn(o.slice(2),p?2:8):Wd.test(o)?G:+o}function nx(o){return ei(o,hn(o))}function UH(o){return o?Er(Bt(o),-at,at):o===0?o:0}function Xt(o){return o==null?"":xn(o)}var HH=ks(function(o,c){if(na(c)||fn(c)){ei(c,Ie(c),o);return}for(var p in c)Kt.call(c,p)&&Xo(o,p,c[p])}),ix=ks(function(o,c){ei(c,hn(c),o)}),rx=ks(function(o,c,p,_){ei(c,hn(c),o,_)}),sh=ks(function(o,c,p,_){ei(c,Ie(c),o,_)}),WH=yi(kf);function $H(o,c){var p=Ts(o);return c==null?p:Ly(p,c)}var VH=zt(function(o,c){o=re(o);var p=-1,_=c.length,b=_>2?c[2]:n;for(b&&nn(c[0],c[1],b)&&(_=1);++p<_;)for(var k=c[p],E=hn(k),I=-1,W=E.length;++I<W;){var Q=E[I],J=o[Q];(J===n||Hn(J,ws[Q])&&!Kt.call(o,Q))&&(o[Q]=k[Q])}return o}),YH=zt(function(o){return o.push(n,xb),_n(sx,n,o)});function qH(o,c){return gy(o,Dt(c,3),ti)}function jH(o,c){return gy(o,Dt(c,3),Df)}function GH(o,c){return o==null?o:Mf(o,Dt(c,3),hn)}function KH(o,c){return o==null?o:Uy(o,Dt(c,3),hn)}function XH(o,c){return o&&ti(o,Dt(c,3))}function ZH(o,c){return o&&Df(o,Dt(c,3))}function QH(o){return o==null?[]:sc(o,Ie(o))}function JH(o){return o==null?[]:sc(o,hn(o))}function oh(o,c,p){var _=o==null?n:Rr(o,c);return _===n?p:_}function tW(o,c){return o!=null&&Sb(o,c,Tz)}function ah(o,c){return o!=null&&Sb(o,c,kz)}var eW=mb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=ql.call(c)),o[c]=p},ch(pn)),nW=mb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=ql.call(c)),Kt.call(o,c)?o[c].push(p):o[c]=[p]},Dt),iW=zt(Qo);function Ie(o){return fn(o)?Py(o):Ef(o)}function hn(o){return fn(o)?Py(o,!0):Lz(o)}function rW(o,c){var p={};return c=Dt(c,3),ti(o,function(_,b,k){Jn(p,c(_,b,k),_)}),p}function sW(o,c){var p={};return c=Dt(c,3),ti(o,function(_,b,k){Jn(p,b,c(_,b,k))}),p}var oW=ks(function(o,c,p){oc(o,c,p)}),sx=ks(function(o,c,p,_){oc(o,c,p,_)}),aW=yi(function(o,c){var p={};if(o==null)return p;var _=!1;c=de(c,function(k){return k=Qi(k,o),_||(_=k.length>1),k}),ei(o,Yf(o),p),_&&(p=En(p,g|y|x,nU));for(var b=c.length;b--;)Bf(p,c[b]);return p});function lW(o,c){return ox(o,wc(Dt(c)))}var cW=yi(function(o,c){return o==null?{}:Bz(o,c)});function ox(o,c){if(o==null)return{};var p=de(Yf(o),function(_){return[_]});return c=Dt(c),Xy(o,p,function(_,b){return c(_,b[0])})}function uW(o,c,p){c=Qi(c,o);var _=-1,b=c.length;for(b||(b=1,o=n);++_<b;){var k=o==null?n:o[Un(c[_])];k===n&&(_=b,k=p),o=xi(k)?k.call(o):k}return o}function dW(o,c,p){return o==null?o:ta(o,c,p)}function fW(o,c,p,_){return _=typeof _=="function"?_:n,o==null?o:ta(o,c,p,_)}var ax=yb(Ie),lx=yb(hn);function hW(o,c,p){var _=It(o),b=_||tr(o)||Cs(o);if(c=Dt(c,4),p==null){var k=o&&o.constructor;b?p=_?new k:[]:pe(o)?p=xi(k)?Ts(Kl(o)):{}:p={}}return(b?yn:ti)(o,function(E,I,W){return c(p,E,I,W)}),p}function pW(o,c){return o==null?!0:Bf(o,c)}function mW(o,c,p){return o==null?o:eb(o,c,Uf(p))}function gW(o,c,p,_){return _=typeof _=="function"?_:n,o==null?o:eb(o,c,Uf(p),_)}function Os(o){return o==null?[]:yf(o,Ie(o))}function _W(o){return o==null?[]:yf(o,hn(o))}function yW(o,c,p){return p===n&&(p=c,c=n),p!==n&&(p=In(p),p=p===p?p:0),c!==n&&(c=In(c),c=c===c?c:0),Er(In(o),c,p)}function bW(o,c,p){return c=wi(c),p===n?(p=c,c=0):p=wi(p),o=In(o),Mz(o,c,p)}function xW(o,c,p){if(p&&typeof p!="boolean"&&nn(o,c,p)&&(c=p=n),p===n&&(typeof c=="boolean"?(p=c,c=n):typeof o=="boolean"&&(p=o,o=n)),o===n&&c===n?(o=0,c=1):(o=wi(o),c===n?(c=o,o=0):c=wi(c)),o>c){var _=o;o=c,c=_}if(p||o%1||c%1){var b=Ey();return Xe(o+b*(c-o+Ke("1e-"+((b+"").length-1))),c)}return If(o,c)}var wW=Ms(function(o,c,p){return c=c.toLowerCase(),o+(p?cx(c):c)});function cx(o){return lh(Xt(o).toLowerCase())}function ux(o){return o=Xt(o),o&&o.replace(qd,fF).replace(af,"")}function vW(o,c,p){o=Xt(o),c=xn(c);var _=o.length;p=p===n?_:Er(Bt(p),0,_);var b=p;return p-=c.length,p>=0&&o.slice(p,b)==c}function SW(o){return o=Xt(o),o&&Rd.test(o)?o.replace(xl,hF):o}function TW(o){return o=Xt(o),o&&Nd.test(o)?o.replace(Lo,"\\$&"):o}var kW=Ms(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),MW=Ms(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),DW=fb("toLowerCase");function CW(o,c,p){o=Xt(o),c=Bt(c);var _=c?bs(o):0;if(!c||_>=c)return o;var b=(c-_)/2;return fc(Jl(b),p)+o+fc(Ql(b),p)}function OW(o,c,p){o=Xt(o),c=Bt(c);var _=c?bs(o):0;return c&&_<c?o+fc(c-_,p):o}function AW(o,c,p){o=Xt(o),c=Bt(c);var _=c?bs(o):0;return c&&_<c?fc(c-_,p)+o:o}function EW(o,c,p){return p||c==null?c=0:c&&(c=+c),zF(Xt(o).replace(No,""),c||0)}function RW(o,c,p){return(p?nn(o,c,p):c===n)?c=1:c=Bt(c),Lf(Xt(o),c)}function PW(){var o=arguments,c=Xt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var IW=Ms(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function LW(o,c,p){return p&&typeof p!="number"&&nn(o,c,p)&&(c=p=n),p=p===n?B:p>>>0,p?(o=Xt(o),o&&(typeof c=="string"||c!=null&&!rh(c))&&(c=xn(c),!c&&ys(o))?Ji(Fn(o),0,p):o.split(c,p)):[]}var NW=Ms(function(o,c,p){return o+(p?" ":"")+lh(c)});function BW(o,c,p){return o=Xt(o),p=p==null?0:Er(Bt(p),0,o.length),c=xn(c),o.slice(p,p+c.length)==c}function FW(o,c,p){var _=T.templateSettings;p&&nn(o,c,p)&&(c=n),o=Xt(o),c=sh({},c,_,bb);var b=sh({},c.imports,_.imports,bb),k=Ie(b),E=yf(b,k);yn(k,function(Mt){if(vl.test(Mt))throw new At(u)});var I,W,Q=0,J=c.interpolate||ls,nt="__p += '",ft=xf((c.escape||ls).source+"|"+J.source+"|"+(J===Io?Vi:ls).source+"|"+(c.evaluate||ls).source+"|$","g"),wt="//# sourceURL="+(Kt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++uf+"]")+`
|
|
10
|
+
`;o.replace(ft,function(Mt,Ut,Wt,vn,rn,Sn){return Wt||(Wt=vn),nt+=o.slice(Q,Sn).replace(jd,pF),Ut&&(I=!0,nt+=`' +
|
|
11
|
+
__e(`+Ut+`) +
|
|
12
|
+
'`),rn&&(W=!0,nt+=`';
|
|
13
|
+
`+rn+`;
|
|
14
|
+
__p += '`),Wt&&(nt+=`' +
|
|
15
|
+
((__t = (`+Wt+`)) == null ? '' : __t) +
|
|
16
|
+
'`),Q=Sn+Mt.length,Mt}),nt+=`';
|
|
17
|
+
`;var Ct=Kt.call(c,"variable")&&c.variable;if(!Ct)nt=`with (obj) {
|
|
18
|
+
`+nt+`
|
|
19
|
+
}
|
|
20
|
+
`;else if(vl.test(Ct))throw new At(l);nt=(W?nt.replace(Eo,""):nt).replace(Ro,"$1").replace(Po,"$1;"),nt="function("+(Ct||"obj")+`) {
|
|
21
|
+
`+(Ct?"":`obj || (obj = {});
|
|
22
|
+
`)+"var __t, __p = ''"+(I?", __e = _.escape":"")+(W?`, __j = Array.prototype.join;
|
|
23
|
+
function print() { __p += __j.call(arguments, '') }
|
|
24
|
+
`:`;
|
|
25
|
+
`)+nt+`return __p
|
|
26
|
+
}`;var Ft=fx(function(){return qt(k,wt+"return "+nt).apply(n,E)});if(Ft.source=nt,ih(Ft))throw Ft;return Ft}function zW(o){return Xt(o).toLowerCase()}function UW(o){return Xt(o).toUpperCase()}function HW(o,c,p){if(o=Xt(o),o&&(p||c===n))return xy(o);if(!o||!(c=xn(c)))return o;var _=Fn(o),b=Fn(c),k=wy(_,b),E=vy(_,b)+1;return Ji(_,k,E).join("")}function WW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.slice(0,Ty(o)+1);if(!o||!(c=xn(c)))return o;var _=Fn(o),b=vy(_,Fn(c))+1;return Ji(_,0,b).join("")}function $W(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.replace(No,"");if(!o||!(c=xn(c)))return o;var _=Fn(o),b=wy(_,Fn(c));return Ji(_,b).join("")}function VW(o,c){var p=N,_=$;if(pe(c)){var b="separator"in c?c.separator:b;p="length"in c?Bt(c.length):p,_="omission"in c?xn(c.omission):_}o=Xt(o);var k=o.length;if(ys(o)){var E=Fn(o);k=E.length}if(p>=k)return o;var I=p-bs(_);if(I<1)return _;var W=E?Ji(E,0,I).join(""):o.slice(0,I);if(b===n)return W+_;if(E&&(I+=W.length-I),rh(b)){if(o.slice(I).search(b)){var Q,J=W;for(b.global||(b=xf(b.source,Xt(Sl.exec(b))+"g")),b.lastIndex=0;Q=b.exec(J);)var nt=Q.index;W=W.slice(0,nt===n?I:nt)}}else if(o.indexOf(xn(b),I)!=I){var ft=W.lastIndexOf(b);ft>-1&&(W=W.slice(0,ft))}return W+_}function YW(o){return o=Xt(o),o&&Ed.test(o)?o.replace($i,wF):o}var qW=Ms(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),lh=fb("toUpperCase");function dx(o,c,p){return o=Xt(o),c=p?n:c,c===n?gF(o)?TF(o):aF(o):o.match(c)||[]}var fx=zt(function(o,c){try{return _n(o,n,c)}catch(p){return ih(p)?p:new At(p)}}),jW=yi(function(o,c){return yn(c,function(p){p=Un(p),Jn(o,p,eh(o[p],o))}),o});function GW(o){var c=o==null?0:o.length,p=Dt();return o=c?de(o,function(_){if(typeof _[1]!="function")throw new On(a);return[p(_[0]),_[1]]}):[],zt(function(_){for(var b=-1;++b<c;){var k=o[b];if(_n(k[0],this,_))return _n(k[1],this,_)}})}function KW(o){return wz(En(o,g))}function ch(o){return function(){return o}}function XW(o,c){return o==null||o!==o?c:o}var ZW=pb(),QW=pb(!0);function pn(o){return o}function uh(o){return Vy(typeof o=="function"?o:En(o,g))}function JW(o){return qy(En(o,g))}function t3(o,c){return jy(o,En(c,g))}var e3=zt(function(o,c){return function(p){return Qo(p,o,c)}}),n3=zt(function(o,c){return function(p){return Qo(o,p,c)}});function dh(o,c,p){var _=Ie(c),b=sc(c,_);p==null&&!(pe(c)&&(b.length||!_.length))&&(p=c,c=o,o=this,b=sc(c,Ie(c)));var k=!(pe(p)&&"chain"in p)||!!p.chain,E=xi(o);return yn(b,function(I){var W=c[I];o[I]=W,E&&(o.prototype[I]=function(){var Q=this.__chain__;if(k||Q){var J=o(this.__wrapped__),nt=J.__actions__=dn(this.__actions__);return nt.push({func:W,args:arguments,thisArg:o}),J.__chain__=Q,J}return W.apply(o,ji([this.value()],arguments))})}),o}function i3(){return ue._===this&&(ue._=AF),this}function fh(){}function r3(o){return o=Bt(o),zt(function(c){return Gy(c,o)})}var s3=Wf(de),o3=Wf(my),a3=Wf(hf);function hx(o){return Kf(o)?pf(Un(o)):Fz(o)}function l3(o){return function(c){return o==null?n:Rr(o,c)}}var c3=gb(),u3=gb(!0);function hh(){return[]}function ph(){return!1}function d3(){return{}}function f3(){return""}function h3(){return!0}function p3(o,c){if(o=Bt(o),o<1||o>at)return[];var p=B,_=Xe(o,B);c=Dt(c),o-=B;for(var b=_f(_,c);++p<o;)c(p);return b}function m3(o){return It(o)?de(o,Un):wn(o)?[o]:dn(Rb(Xt(o)))}function g3(o){var c=++CF;return Xt(o)+c}var _3=dc(function(o,c){return o+c},0),y3=$f("ceil"),b3=dc(function(o,c){return o/c},1),x3=$f("floor");function w3(o){return o&&o.length?rc(o,pn,Cf):n}function v3(o,c){return o&&o.length?rc(o,Dt(c,2),Cf):n}function S3(o){return yy(o,pn)}function T3(o,c){return yy(o,Dt(c,2))}function k3(o){return o&&o.length?rc(o,pn,Rf):n}function M3(o,c){return o&&o.length?rc(o,Dt(c,2),Rf):n}var D3=dc(function(o,c){return o*c},1),C3=$f("round"),O3=dc(function(o,c){return o-c},0);function A3(o){return o&&o.length?gf(o,pn):0}function E3(o,c){return o&&o.length?gf(o,Dt(c,2)):0}return T.after=tH,T.ary=$b,T.assign=HH,T.assignIn=ix,T.assignInWith=rx,T.assignWith=sh,T.at=WH,T.before=Vb,T.bind=eh,T.bindAll=jW,T.bindKey=Yb,T.castArray=fH,T.chain=Ub,T.chunk=wU,T.compact=vU,T.concat=SU,T.cond=GW,T.conforms=KW,T.constant=ch,T.countBy=E5,T.create=$H,T.curry=qb,T.curryRight=jb,T.debounce=Gb,T.defaults=VH,T.defaultsDeep=YH,T.defer=eH,T.delay=nH,T.difference=TU,T.differenceBy=kU,T.differenceWith=MU,T.drop=DU,T.dropRight=CU,T.dropRightWhile=OU,T.dropWhile=AU,T.fill=EU,T.filter=P5,T.flatMap=N5,T.flatMapDeep=B5,T.flatMapDepth=F5,T.flatten=Nb,T.flattenDeep=RU,T.flattenDepth=PU,T.flip=iH,T.flow=ZW,T.flowRight=QW,T.fromPairs=IU,T.functions=QH,T.functionsIn=JH,T.groupBy=z5,T.initial=NU,T.intersection=BU,T.intersectionBy=FU,T.intersectionWith=zU,T.invert=eW,T.invertBy=nW,T.invokeMap=H5,T.iteratee=uh,T.keyBy=W5,T.keys=Ie,T.keysIn=hn,T.map=yc,T.mapKeys=rW,T.mapValues=sW,T.matches=JW,T.matchesProperty=t3,T.memoize=xc,T.merge=oW,T.mergeWith=sx,T.method=e3,T.methodOf=n3,T.mixin=dh,T.negate=wc,T.nthArg=r3,T.omit=aW,T.omitBy=lW,T.once=rH,T.orderBy=$5,T.over=s3,T.overArgs=sH,T.overEvery=o3,T.overSome=a3,T.partial=nh,T.partialRight=Kb,T.partition=V5,T.pick=cW,T.pickBy=ox,T.property=hx,T.propertyOf=l3,T.pull=$U,T.pullAll=Fb,T.pullAllBy=VU,T.pullAllWith=YU,T.pullAt=qU,T.range=c3,T.rangeRight=u3,T.rearg=oH,T.reject=j5,T.remove=jU,T.rest=aH,T.reverse=Jf,T.sampleSize=K5,T.set=dW,T.setWith=fW,T.shuffle=X5,T.slice=GU,T.sortBy=J5,T.sortedUniq=e5,T.sortedUniqBy=n5,T.split=LW,T.spread=lH,T.tail=i5,T.take=r5,T.takeRight=s5,T.takeRightWhile=o5,T.takeWhile=a5,T.tap=v5,T.throttle=cH,T.thru=_c,T.toArray=tx,T.toPairs=ax,T.toPairsIn=lx,T.toPath=m3,T.toPlainObject=nx,T.transform=hW,T.unary=uH,T.union=l5,T.unionBy=c5,T.unionWith=u5,T.uniq=d5,T.uniqBy=f5,T.uniqWith=h5,T.unset=pW,T.unzip=th,T.unzipWith=zb,T.update=mW,T.updateWith=gW,T.values=Os,T.valuesIn=_W,T.without=p5,T.words=dx,T.wrap=dH,T.xor=m5,T.xorBy=g5,T.xorWith=_5,T.zip=y5,T.zipObject=b5,T.zipObjectDeep=x5,T.zipWith=w5,T.entries=ax,T.entriesIn=lx,T.extend=ix,T.extendWith=rx,dh(T,T),T.add=_3,T.attempt=fx,T.camelCase=wW,T.capitalize=cx,T.ceil=y3,T.clamp=yW,T.clone=hH,T.cloneDeep=mH,T.cloneDeepWith=gH,T.cloneWith=pH,T.conformsTo=_H,T.deburr=ux,T.defaultTo=XW,T.divide=b3,T.endsWith=vW,T.eq=Hn,T.escape=SW,T.escapeRegExp=TW,T.every=R5,T.find=I5,T.findIndex=Ib,T.findKey=qH,T.findLast=L5,T.findLastIndex=Lb,T.findLastKey=jH,T.floor=x3,T.forEach=Hb,T.forEachRight=Wb,T.forIn=GH,T.forInRight=KH,T.forOwn=XH,T.forOwnRight=ZH,T.get=oh,T.gt=yH,T.gte=bH,T.has=tW,T.hasIn=ah,T.head=Bb,T.identity=pn,T.includes=U5,T.indexOf=LU,T.inRange=bW,T.invoke=iW,T.isArguments=Lr,T.isArray=It,T.isArrayBuffer=xH,T.isArrayLike=fn,T.isArrayLikeObject=xe,T.isBoolean=wH,T.isBuffer=tr,T.isDate=vH,T.isElement=SH,T.isEmpty=TH,T.isEqual=kH,T.isEqualWith=MH,T.isError=ih,T.isFinite=DH,T.isFunction=xi,T.isInteger=Xb,T.isLength=vc,T.isMap=Zb,T.isMatch=CH,T.isMatchWith=OH,T.isNaN=AH,T.isNative=EH,T.isNil=PH,T.isNull=RH,T.isNumber=Qb,T.isObject=pe,T.isObjectLike=_e,T.isPlainObject=ra,T.isRegExp=rh,T.isSafeInteger=IH,T.isSet=Jb,T.isString=Sc,T.isSymbol=wn,T.isTypedArray=Cs,T.isUndefined=LH,T.isWeakMap=NH,T.isWeakSet=BH,T.join=UU,T.kebabCase=kW,T.last=Pn,T.lastIndexOf=HU,T.lowerCase=MW,T.lowerFirst=DW,T.lt=FH,T.lte=zH,T.max=w3,T.maxBy=v3,T.mean=S3,T.meanBy=T3,T.min=k3,T.minBy=M3,T.stubArray=hh,T.stubFalse=ph,T.stubObject=d3,T.stubString=f3,T.stubTrue=h3,T.multiply=D3,T.nth=WU,T.noConflict=i3,T.noop=fh,T.now=bc,T.pad=CW,T.padEnd=OW,T.padStart=AW,T.parseInt=EW,T.random=xW,T.reduce=Y5,T.reduceRight=q5,T.repeat=RW,T.replace=PW,T.result=uW,T.round=C3,T.runInContext=H,T.sample=G5,T.size=Z5,T.snakeCase=IW,T.some=Q5,T.sortedIndex=KU,T.sortedIndexBy=XU,T.sortedIndexOf=ZU,T.sortedLastIndex=QU,T.sortedLastIndexBy=JU,T.sortedLastIndexOf=t5,T.startCase=NW,T.startsWith=BW,T.subtract=O3,T.sum=A3,T.sumBy=E3,T.template=FW,T.times=p3,T.toFinite=wi,T.toInteger=Bt,T.toLength=ex,T.toLower=zW,T.toNumber=In,T.toSafeInteger=UH,T.toString=Xt,T.toUpper=UW,T.trim=HW,T.trimEnd=WW,T.trimStart=$W,T.truncate=VW,T.unescape=YW,T.uniqueId=g3,T.upperCase=qW,T.upperFirst=lh,T.each=Hb,T.eachRight=Wb,T.first=Bb,dh(T,(function(){var o={};return ti(T,function(c,p){Kt.call(T.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),T.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),yn(["drop","take"],function(o,c){Ht.prototype[o]=function(p){p=p===n?1:Ae(Bt(p),0);var _=this.__filtered__&&!c?new Ht(this):this.clone();return _.__filtered__?_.__takeCount__=Xe(p,_.__takeCount__):_.__views__.push({size:Xe(p,B),type:o+(_.__dir__<0?"Right":"")}),_},Ht.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var p=c+1,_=p==dt||p==ct;Ht.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:Dt(b,3),type:p}),k.__filtered__=k.__filtered__||_,k}}),yn(["head","last"],function(o,c){var p="take"+(c?"Right":"");Ht.prototype[o]=function(){return this[p](1).value()[0]}}),yn(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");Ht.prototype[o]=function(){return this.__filtered__?new Ht(this):this[p](1)}}),Ht.prototype.compact=function(){return this.filter(pn)},Ht.prototype.find=function(o){return this.filter(o).head()},Ht.prototype.findLast=function(o){return this.reverse().find(o)},Ht.prototype.invokeMap=zt(function(o,c){return typeof o=="function"?new Ht(this):this.map(function(p){return Qo(p,o,c)})}),Ht.prototype.reject=function(o){return this.filter(wc(Dt(o)))},Ht.prototype.slice=function(o,c){o=Bt(o);var p=this;return p.__filtered__&&(o>0||c<0)?new Ht(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==n&&(c=Bt(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},Ht.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ht.prototype.toArray=function(){return this.take(B)},ti(Ht.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),_=/^(?:head|last)$/.test(c),b=T[_?"take"+(c=="last"?"Right":""):c],k=_||/^find/.test(c);b&&(T.prototype[c]=function(){var E=this.__wrapped__,I=_?[1]:arguments,W=E instanceof Ht,Q=I[0],J=W||It(E),nt=function(Ut){var Wt=b.apply(T,ji([Ut],I));return _&&ft?Wt[0]:Wt};J&&p&&typeof Q=="function"&&Q.length!=1&&(W=J=!1);var ft=this.__chain__,wt=!!this.__actions__.length,Ct=k&&!ft,Ft=W&&!wt;if(!k&&J){E=Ft?E:new Ht(this);var Mt=o.apply(E,I);return Mt.__actions__.push({func:_c,args:[nt],thisArg:n}),new An(Mt,ft)}return Ct&&Ft?o.apply(this,I):(Mt=this.thru(nt),Ct?_?Mt.value()[0]:Mt.value():Mt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=$l[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",_=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var b=arguments;if(_&&!this.__chain__){var k=this.value();return c.apply(It(k)?k:[],b)}return this[p](function(E){return c.apply(It(E)?E:[],b)})}}),ti(Ht.prototype,function(o,c){var p=T[c];if(p){var _=p.name+"";Kt.call(Ss,_)||(Ss[_]=[]),Ss[_].push({name:c,func:p})}}),Ss[uc(n,A).name]=[{name:"wrapper",func:n}],Ht.prototype.clone=qF,Ht.prototype.reverse=jF,Ht.prototype.value=GF,T.prototype.at=S5,T.prototype.chain=T5,T.prototype.commit=k5,T.prototype.next=M5,T.prototype.plant=C5,T.prototype.reverse=O5,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=A5,T.prototype.first=T.prototype.head,Yo&&(T.prototype[Yo]=D5),T}),xs=kF();Qn?((Qn.exports=xs)._=xs,gs._=xs):ue._=xs}).call(HB)})(Co,Co.exports)),Co.exports}var sy=WB(),yl={exports:{}},$B=yl.exports,oy;function VB(){return oy||(oy=1,(function(e,t){(function(n,i){i()})($B,function(){function n(d,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function i(d,h,m){var g=new XMLHttpRequest;g.open("GET",d),g.responseType="blob",g.onload=function(){u(g.response,h,m)},g.onerror=function(){console.error("could not download file")},g.send()}function r(d){var h=new XMLHttpRequest;h.open("HEAD",d,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(h)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Hi=="object"&&Hi.global===Hi?Hi:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(d,h,m){var g=a.URL||a.webkitURL,y=document.createElement("a");h=h||d.name||"download",y.download=h,y.rel="noopener",typeof d=="string"?(y.href=d,y.origin===location.origin?s(y):r(y.href)?i(d,h,m):s(y,y.target="_blank")):(y.href=g.createObjectURL(d),setTimeout(function(){g.revokeObjectURL(y.href)},4e4),setTimeout(function(){s(y)},0))}:"msSaveOrOpenBlob"in navigator?function(d,h,m){if(h=h||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(n(d,m),h);else if(r(d))i(d,h,m);else{var g=document.createElement("a");g.href=d,g.target="_blank",setTimeout(function(){s(g)})}}:function(d,h,m,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),typeof d=="string")return i(d,h,m);var y=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||y&&x||l)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var P=S.result;P=v?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=P:location=P,g=null},S.readAsDataURL(d)}else{var O=a.URL||a.webkitURL,A=O.createObjectURL(d);g?g.location=A:location.href=A,g=null,setTimeout(function(){O.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,e.exports=u})})(yl)),yl.exports}var YB=VB(),bl={exports:{}};var qB=bl.exports,ay;function jB(){return ay||(ay=1,(function(e,t){((n,i)=>{e.exports=i()})(qB,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,s=i.IS_PAPA_WORKER||!1,a={},l=0,u={};function d(D){return D.charCodeAt(0)===65279?D.slice(1):D}function h(D){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(w){var C=R(w);C.chunkSize=parseInt(C.chunkSize),w.step||w.chunk||(C.chunkSize=null),this._handle=new v(C),(this._handle.streamer=this)._config=C}).call(this,D),this.parseChunk=function(w,C){var N=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<N){let V=this._config.newline;V||($=this._config.quoteChar||'"',V=this._handle.guessLineEndings(w,$)),w=[...w.split(V).slice(N)].join(V)}this.isFirstChunk&&U(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(w))!==void 0&&(w=$),this.isFirstChunk=!1,this._halted=!1;var N=this._partialLine+w,$=(this._partialLine="",this._handle.parse(N,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=$.meta.cursor,N=(this._finished||(this._partialLine=N.substring(w-this._baseIndex),this._baseIndex=w),$&&$.data&&(this._rowCount+=$.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:$,workerId:u.WORKER_ID,finished:N});else if(U(this._config.chunk)&&!C){if(this._config.chunk($,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=$=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat($.data),this._completeResults.errors=this._completeResults.errors.concat($.errors),this._completeResults.meta=$.meta),this._completed||!N||!U(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),N||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(w){U(this._config.error)?this._config.error(w):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:w,finished:!1})}}function m(D){var w;(D=D||{}).chunkSize||(D.chunkSize=u.RemoteChunkSize),h.call(this,D),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(C){this._input=C,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),r||(w.onload=F(this._chunkLoaded,this),w.onerror=F(this._chunkError,this)),w.ontimeout=F(this._chunkTimeout,this),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(w.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var C,N=this._config.downloadRequestHeaders;for(C in N)w.setRequestHeader(C,N[C])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+$));try{w.send(this._config.downloadRequestBody)}catch(V){this._chunkError(V.message)}r&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(C=>(C=C.getResponseHeader("Content-Range"))!==null?parseInt(C.substring(C.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(C){C=w.statusText||C,this._sendError(new Error(C))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function g(D){(D=D||{}).chunkSize||(D.chunkSize=u.LocalChunkSize),h.call(this,D);var w,C,N=typeof FileReader<"u";this.stream=function($){this._input=$,C=$.slice||$.webkitSlice||$.mozSlice,N?((w=new FileReader).onload=F(this._chunkLoaded,this),w.onerror=F(this._chunkError,this)):w=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var $=this._input,V=(this._config.chunkSize&&(V=Math.min(this._start+this._config.chunkSize,this._input.size),$=C.call($,this._start,V)),w.readAsText($,this._config.encoding));N||this._chunkLoaded({target:{result:V}})},this._chunkLoaded=function($){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk($.target.result)},this._chunkError=function(){this._sendError(w.error)}}function y(D){var w;h.call(this,D=D||{}),this.stream=function(C){return w=C,this._nextChunk()},this._nextChunk=function(){var C,N;if(!this._finished)return C=this._config.chunkSize,w=C?(N=w.substring(0,C),w.substring(C)):(N=w,""),this._finished=!w,this.parseChunk(N)}}function x(D){h.call(this,D=D||{});var w=[],C=!0,N=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function($){this._input=$,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){N&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):C=!0},this._streamData=F(function($){try{w.push(typeof $=="string"?$:$.toString(this._config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(V){this._streamError(V)}},this),this._streamError=F(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=F(function(){this._streamCleanUp(),N=!0,this._streamData("")},this),this._streamCleanUp=F(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(D){var w,C,N,$,V=Math.pow(2,53),st=-V,dt=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ut=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,ct=this,Tt=0,at=0,pt=!1,G=!1,B=[],z={data:[],errors:[],meta:{}};function Z(X){return D.skipEmptyLines==="greedy"?X.join("").trim()==="":X.length===1&&X[0].length===0}function it(){if(z&&N&&(mt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),N=!1),D.skipEmptyLines&&(z.data=z.data.filter(function(lt){return!Z(lt)})),ht()){let lt=function(bt){B.push(bt)};if(z)if(Array.isArray(z.data[0])){for(var X=0;ht()&&X<z.data.length;X++)z.data[X].forEach(lt);z.data.splice(0,1)}else z.data.forEach(lt)}function ot(lt,bt){for(var Rt=D.header?{}:[],j=0;j<lt.length;j++){var et=j,rt=lt[j],rt=((Gt,_t)=>($t=>(D.dynamicTypingFunction&&D.dynamicTyping[$t]===void 0&&(D.dynamicTyping[$t]=D.dynamicTypingFunction($t)),(D.dynamicTyping[$t]||D.dynamicTyping)===!0))(Gt)?_t==="true"||_t==="TRUE"||_t!=="false"&&_t!=="FALSE"&&(($t=>{if(dt.test($t)&&($t=parseFloat($t),st<$t&&$t<V))return 1})(_t)?parseFloat(_t):ut.test(_t)?new Date(_t):_t===""?null:_t):_t)(et=D.header?j>=B.length?"__parsed_extra":B[j]:et,rt=D.transform?D.transform(rt,et):rt);et==="__parsed_extra"?(Rt[et]=Rt[et]||[],Rt[et].push(rt)):Rt[et]=rt}return D.header&&(j>B.length?mt("FieldMismatch","TooManyFields","Too many fields: expected "+B.length+" fields but parsed "+j,at+bt):j<B.length&&mt("FieldMismatch","TooFewFields","Too few fields: expected "+B.length+" fields but parsed "+j,at+bt)),Rt}var vt;z&&(D.header||D.dynamicTyping||D.transform)&&(vt=1,!z.data.length||Array.isArray(z.data[0])?(z.data=z.data.map(ot),vt=z.data.length):z.data=ot(z.data,0),D.header&&z.meta&&(z.meta.fields=B),at+=vt)}function ht(){return D.header&&B.length===0}function mt(X,ot,vt,lt){X={type:X,code:ot,message:vt},lt!==void 0&&(X.row=lt),z.errors.push(X)}U(D.step)&&($=D.step,D.step=function(X){z=X,ht()?it():(it(),z.data.length!==0&&(Tt+=X.data.length,D.preview&&Tt>D.preview?C.abort():(z.data=z.data[0],$(z,ct))))}),this.parse=function(X,ot,vt){var lt=D.quoteChar||'"',lt=(D.newline||(D.newline=this.guessLineEndings(X,lt)),N=!1,D.delimiter?U(D.delimiter)&&(D.delimiter=D.delimiter(X),z.meta.delimiter=D.delimiter):((lt=((bt,Rt,j,et,rt)=>{var Gt,_t,$t,Me;rt=rt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Te=0;Te<rt.length;Te++){for(var ee,je=rt[Te],Yt=0,Be=0,se=0,De=($t=void 0,new O({comments:et,delimiter:je,newline:Rt,preview:10}).parse(bt)),Pe=0;Pe<De.data.length;Pe++)j&&Z(De.data[Pe])?se++:(ee=De.data[Pe].length,Be+=ee,$t===void 0?$t=ee:0<ee&&(Yt+=Math.abs(ee-$t),$t=ee));0<De.data.length&&(Be/=De.data.length-se),1.99<Be&&(_t===void 0||Yt<_t||Yt===_t&&Me<Be)&&(_t=Yt,Gt=je,Me=Be)}return{successful:!!(D.delimiter=Gt),bestDelimiter:Gt}})(X,D.newline,D.skipEmptyLines,D.comments,D.delimitersToGuess)).successful?D.delimiter=lt.bestDelimiter:(N=!0,D.delimiter=u.DefaultDelimiter),z.meta.delimiter=D.delimiter),R(D));return lt.header=ht(),D.preview&&D.header&<.preview++,w=X,C=new O(lt),z=C.parse(w,ot,vt),it(),pt?{meta:{paused:!0}}:z||{meta:{paused:!1}}},this.paused=function(){return pt},this.pause=function(){pt=!0,C.abort(),w=U(D.chunk)?"":w.substring(C.getCharIndex())},this.resume=function(){ct.streamer._halted?(pt=!1,ct.streamer.parseChunk(w,!0)):setTimeout(ct.resume,3)},this.aborted=function(){return G},this.abort=function(){G=!0,C.abort(),z.meta.aborted=!0,U(D.complete)&&D.complete(z),w=""},this.guessLineEndings=function(bt,lt){bt=bt.substring(0,1048576);var lt=new RegExp(S(lt)+"([^]*?)"+S(lt),"gm"),vt=(bt=bt.replace(lt,"")).split("\r"),lt=bt.split(`
|
|
27
|
+
`),bt=1<lt.length&<[0].length<vt[0].length;if(vt.length===1||bt)return`
|
|
28
|
+
`;for(var Rt=0,j=0;j<vt.length;j++)vt[j][0]===`
|
|
29
|
+
`&&Rt++;return Rt>=vt.length/2?`\r
|
|
30
|
+
`:"\r"}}function S(D){return D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function O(D){var w=(D=D||{}).delimiter,C=D.newline,N=D.comments,$=D.step,V=D.preview,st=D.fastMode,dt=null,ut=!1,ct=D.quoteChar==null?'"':D.quoteChar,Tt=ct;if(D.escapeChar!==void 0&&(Tt=D.escapeChar),(typeof w!="string"||-1<u.BAD_DELIMITERS.indexOf(w))&&(w=","),N===w)throw new Error("Comment character same as delimiter");N===!0?N="#":(typeof N!="string"||-1<u.BAD_DELIMITERS.indexOf(N))&&(N=!1),C!==`
|
|
31
|
+
`&&C!=="\r"&&C!==`\r
|
|
32
|
+
`&&(C=`
|
|
33
|
+
`);var at=0,pt=!1;this.parse=function(G,B,z){if(typeof G!="string")throw new Error("Input must be a string");var Z=G.length,it=w.length,ht=C.length,mt=N.length,X=U($),ot=[],vt=[],lt=[],bt=at=0;if(!G)return Yt();if(st||st!==!1&&G.indexOf(ct)===-1){for(var Rt=G.split(C),j=0;j<Rt.length;j++){if(lt=Rt[j],at+=lt.length,j!==Rt.length-1)at+=C.length;else if(z)return Yt();if(!N||lt.substring(0,mt)!==N){if(X){if(ot=[],Me(lt.split(w)),Be(),pt)return Yt()}else Me(lt.split(w));if(V&&V<=j)return ot=ot.slice(0,V),Yt(!0)}}return Yt()}for(var et=G.indexOf(w,at),rt=G.indexOf(C,at),Gt=new RegExp(S(Tt)+S(ct),"g"),_t=G.indexOf(ct,at);;)if(G[at]===ct)for(_t=at,at++;;){if((_t=G.indexOf(ct,_t+1))===-1)return z||vt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ot.length,index:at}),ee();if(_t===Z-1)return ee(G.substring(at,_t).replace(Gt,ct));if(ct===Tt&&G[_t+1]===Tt)_t++;else if(ct===Tt||_t===0||G[_t-1]!==Tt){et!==-1&&et<_t+1&&(et=G.indexOf(w,_t+1));var $t=Te((rt=rt!==-1&&rt<_t+1?G.indexOf(C,_t+1):rt)===-1?et:Math.min(et,rt));if(G.substr(_t+1+$t,it)===w){lt.push(G.substring(at,_t).replace(Gt,ct)),G[at=_t+1+$t+it]!==ct&&(_t=G.indexOf(ct,at)),et=G.indexOf(w,at),rt=G.indexOf(C,at);break}if($t=Te(rt),G.substring(_t+1+$t,_t+1+$t+ht)===C){if(lt.push(G.substring(at,_t).replace(Gt,ct)),je(_t+1+$t+ht),et=G.indexOf(w,at),_t=G.indexOf(ct,at),X&&(Be(),pt))return Yt();if(V&&ot.length>=V)return Yt(!0);break}vt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ot.length,index:at}),_t++}}else if(N&<.length===0&&G.substring(at,at+mt)===N){if(rt===-1)return Yt();at=rt+ht,rt=G.indexOf(C,at),et=G.indexOf(w,at)}else if(et!==-1&&(et<rt||rt===-1))lt.push(G.substring(at,et)),at=et+it,et=G.indexOf(w,at);else{if(rt===-1)break;if(lt.push(G.substring(at,rt)),je(rt+ht),X&&(Be(),pt))return Yt();if(V&&ot.length>=V)return Yt(!0)}return ee();function Me(se){ot.push(se),bt=at}function Te(se){var De=0;return De=se!==-1&&(se=G.substring(_t+1,se))&&se.trim()===""?se.length:De}function ee(se){return z||(se===void 0&&(se=G.substring(at)),lt.push(se),at=Z,Me(lt),X&&Be()),Yt()}function je(se){at=se,Me(lt),lt=[],rt=G.indexOf(C,at)}function Yt(se){if(D.header&&!B&&ot.length&&!ut){var De=ot[0],Pe=Object.create(null),gn=new Set(De);let Wi=!1;for(let Cn=0;Cn<De.length;Cn++){let Ge=d(De[Cn]);if(Pe[Ge=U(D.transformHeader)?D.transformHeader(Ge,Cn):Ge]){let Ln,di=Pe[Ge];for(;Ln=Ge+"_"+di,di++,gn.has(Ln););gn.add(Ln),De[Cn]=Ln,Pe[Ge]++,Wi=!0,(dt=dt===null?{}:dt)[Ln]=Ge}else Pe[Ge]=1,De[Cn]=Ge;gn.add(Ge)}Wi&&console.warn("Duplicate headers found and renamed."),ut=!0}return{data:ot,errors:vt,meta:{delimiter:w,linebreak:C,aborted:pt,truncated:!!se,cursor:bt+(B||0),renamedHeaders:dt}}}function Be(){$(Yt()),ot=[],vt=[]}},this.abort=function(){pt=!0},this.getCharIndex=function(){return at}}function A(D){var w=D.data,C=a[w.workerId],N=!1;if(w.error)C.userError(w.error,w.file);else if(w.results&&w.results.data){var $={abort:function(){N=!0,P(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:L,resume:L};if(U(C.userStep)){for(var V=0;V<w.results.data.length&&(C.userStep({data:w.results.data[V],errors:w.results.errors,meta:w.results.meta},$),!N);V++);delete w.results}else U(C.userChunk)&&(C.userChunk(w.results,$,w.file),delete w.results)}w.finished&&!N&&P(w.workerId,w.results)}function P(D,w){var C=a[D];U(C.userComplete)&&C.userComplete(w),C.terminate(),delete a[D]}function L(){throw new Error("Not implemented.")}function R(D){if(typeof D!="object"||D===null)return D;var w,C=Array.isArray(D)?[]:{};for(w in D)C[w]=R(D[w]);return C}function F(D,w){return function(){D.apply(w,arguments)}}function U(D){return typeof D=="function"}return u.parse=function(D,w){var C=(w=w||{}).dynamicTyping||!1;if(U(C)&&(w.dynamicTypingFunction=C,C={}),w.dynamicTyping=C,w.transform=!!U(w.transform)&&w.transform,w.downloadTimeout!==void 0){var C=parseInt(w.downloadTimeout);if(isNaN(C))throw new Error("Config downloadTimeout value ("+w.downloadTimeout+") not parsable by parseInt(val).");w.downloadTimeout=C}if(!w.worker||!u.WORKERS_SUPPORTED)return C=null,u.NODE_STREAM_INPUT,typeof D=="string"?(D=d(D),C=new(w.download?m:y)(w)):D.readable===!0&&U(D.read)&&U(D.on)?C=new x(w):(i.File&&D instanceof File||D instanceof Object)&&(C=new g(w)),C.stream(D);(C=(()=>{var N;return!!u.WORKERS_SUPPORTED&&(N=(()=>{var $=i.URL||i.webkitURL||null,V=n.toString();return u.BLOB_URL||(u.BLOB_URL=$.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; ","(",V,")();"],{type:"text/javascript"})))})(),(N=new i.Worker(N)).onmessage=A,N.id=l++,a[N.id]=N)})()).userStep=w.step,C.userChunk=w.chunk,C.userComplete=w.complete,C.userError=w.error,w.step=U(w.step),w.chunk=U(w.chunk),w.complete=U(w.complete),w.error=U(w.error),delete w.worker,C.postMessage({input:D,config:w,workerId:C.id})},u.unparse=function(D,w){var C=!1,N=!0,$=",",V=`\r
|
|
34
|
+
`,st='"',dt=st+st,ut=!1,ct=null,Tt=!1,at=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||u.BAD_DELIMITERS.filter(function(B){return w.delimiter.indexOf(B)!==-1}).length||($=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(C=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(ut=w.skipEmptyLines),typeof w.newline=="string"&&(V=w.newline),typeof w.quoteChar=="string"&&(st=w.quoteChar,dt=st+st),typeof w.header=="boolean"&&(N=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");ct=w.columns}w.escapeChar!==void 0&&(dt=w.escapeChar+st),w.escapeFormulae instanceof RegExp?Tt=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(Tt=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(st),"g"));if(typeof D=="string"&&(D=JSON.parse(D)),Array.isArray(D)){if(!D.length||Array.isArray(D[0]))return pt(null,D,ut);if(typeof D[0]=="object")return pt(ct||Object.keys(D[0]),D,ut)}else if(typeof D=="object")return typeof D.data=="string"&&(D.data=JSON.parse(D.data)),Array.isArray(D.data)&&(D.fields||(D.fields=D.meta&&D.meta.fields||ct),D.fields||(D.fields=Array.isArray(D.data[0])?D.fields:typeof D.data[0]=="object"?Object.keys(D.data[0]):[]),Array.isArray(D.data[0])||typeof D.data[0]=="object"||(D.data=[D.data])),pt(D.fields||[],D.data||[],ut);throw new Error("Unable to serialize unrecognized input");function pt(B,z,Z){var it="",ht=(typeof B=="string"&&(B=JSON.parse(B)),typeof z=="string"&&(z=JSON.parse(z)),Array.isArray(B)&&0<B.length),mt=!Array.isArray(z[0]);if(ht&&N){for(var X=0;X<B.length;X++)0<X&&(it+=$),it+=G(B[X],X);0<z.length&&(it+=V)}for(var ot=0;ot<z.length;ot++){var vt=(ht?B:z[ot]).length,lt=!1,bt=ht?Object.keys(z[ot]).length===0:z[ot].length===0;if(Z&&!ht&&(lt=Z==="greedy"?z[ot].join("").trim()==="":z[ot].length===1&&z[ot][0].length===0),Z==="greedy"&&ht){for(var Rt=[],j=0;j<vt;j++){var et=mt?B[j]:j;Rt.push(z[ot][et])}lt=Rt.join("").trim()===""}if(!lt){for(var rt=0;rt<vt;rt++){0<rt&&!bt&&(it+=$);var Gt=ht&&mt?B[rt]:rt;it+=G(z[ot][Gt],rt)}ot<z.length-1&&(!Z||0<vt&&!bt)&&(it+=V)}}return it}function G(B,z){var Z,it,ht;return B==null?"":B.constructor===Date?isNaN(B.getTime())?"":B.toISOString():(ht=!1,Tt&&typeof B=="string"&&Tt.test(B)&&(B="'"+B,ht=!0),it=(Z=B.toString()).replace(at,dt),(ht=ht||C===!0||typeof C=="function"&&C(B,z)||Array.isArray(C)&&C[z]||((mt,X)=>{for(var ot=0;ot<X.length;ot++)if(-1<mt.indexOf(X[ot]))return!0;return!1})(it,u.BAD_DELIMITERS)||-1<it.indexOf($)||-1<Z.indexOf(st)||it.charAt(0)===" "||it.charAt(it.length-1)===" ")?st+it+st:it)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
35
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=O,u.ParserHandle=v,u.NetworkStreamer=m,u.FileStreamer=g,u.StringStreamer=y,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(D){D=D.data,u.WORKER_ID===void 0&&D&&(u.WORKER_ID=D.workerId),typeof D.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(D.input,D.config),finished:!0}):(i.File&&D.input instanceof File||D.input instanceof Object)&&(D=u.parse(D.input,D.config))&&i.postMessage({workerId:u.WORKER_ID,results:D,finished:!0})}),(m.prototype=Object.create(h.prototype)).constructor=m,(g.prototype=Object.create(h.prototype)).constructor=g,(y.prototype=Object.create(y.prototype)).constructor=y,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(bl)),bl.exports}var GB=jB();const KB=["id"],XB=f.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(e,{emit:t}){const n=t,i=e,r=f.computed(()=>`export_${new Date().getTime()}`),s=f.computed(()=>{const h=u();return h.length?h:null}),a=()=>{const h=i.labels;if(typeof i.fields!==br.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof h===br.Object?m=>sy.mapKeys(m,(g,y)=>h[y]||y):m=>m},l=()=>{const h=i.fields;if(typeof i.fields!==br.Object&&!Array.isArray(h))throw new Error("Fields needs to be an array of strings.");return Array.isArray(h)?m=>sy.pick(m,h):m=>m},u=()=>{if(typeof i.fields===br.Undefined&&typeof i.labels===br.Undefined)return i.data;const h=a(),m=l();return i.data.map(g=>h(m(g)))},d=()=>{if(!s?.value){console.warn("No data to export");return}n("export-started",s.value);let h=GB.unparse(s.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(h="SEP="+i.delimiter+`\r
|
|
36
|
+
`+h),i.encoding==="utf-8"&&(h="\uFEFF"+h),n("export-finished",i.filename),!i.testing){const m=new Blob([h],{type:"text/csv;charset="+i.encoding});YB.saveAs(m,i.filename)}};return(h,m)=>(f.openBlock(),f.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[f.renderSlot(h.$slots,"default",{},()=>[f.createTextVNode("Download "+f.toDisplayString(e.filename),1)])],8,KB))}}),ZB=f.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=f.computed(()=>Object.keys(t.headers));return(i,r)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(XB,{data:e.rows,fields:n.value,filename:e.filename,labels:e.headers},{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),QB={class:"kong-ui-public-csv-export-modal"},JB={key:0,class:"selected-range"},tF={key:4,class:"text-muted",tag:"span"},ly=3,eF=f.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=St.useI18n(),i=e,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=f.ref(1),l=f.computed(()=>g.value.rows.length),u=f.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=f.computed(()=>i.exportState.status!=="success"?"":St.useChartSelectedRange(f.toRef(i.exportState,"chartData"))),h=f.computed(()=>i.exportState.status!=="success"?"":n.t("csvExport.previewRows",{rowsMax:Math.min(ly,l.value),rowsTotal:l.value,plural:l.value===1?"":"s"})),m=()=>{r("closeModal")},g=f.computed(()=>{if(i.exportState.status!=="success"||!u.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const x=i.exportState.chartData,v=x.data.some(R=>R.timestamp!==x.data[0].timestamp),S=x.data.map(R=>{const F=new Date(R.timestamp);return{...Object.keys(R.event).reduce((D,w)=>{if(w in x.meta.display){const C=R.event[w],N=x.meta.display[w];D[w]=C&&N&&N[C].name||R.event[w]}else D[w]=R.event[w];return D},{}),...v?{timestamp:sd(F,"yyyy-MM-dd HH:mm:ss"),tzOffset:sd(F,"XXX")}:{}}});let O=[];v&&(O=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const A="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},P=[...O,...Object.keys(A).map(R=>({label:n.t(`chartLabels.${R}`),key:R})),...i.exportState.chartData.meta.metric_names.map(R=>({label:n.t(`chartLabels.${R}`),key:R}))],L=P.reduce((R,F)=>(R[F.key]=F.label,R),{});return{headers:P,csvHeaders:L,rows:S}}),y=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=g.value;return{total:Number(x.length)||0,data:x.slice(0,ly)}};return f.watch(g,()=>{a.value++}),(x,v)=>{const S=f.resolveComponent("KSkeleton"),O=f.resolveComponent("KEmptyState"),A=f.resolveComponent("KTableData"),P=f.resolveComponent("KTooltip"),L=f.resolveComponent("KButton"),R=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",QB,[f.createVNode(R,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:f.unref(n).t("csvExport.exportPreview"),visible:"",onCancel:m,onKeyup:f.withKeys(m,["esc"])},{default:f.withCtx(()=>[f.createElementVNode("div",null,[e.exportState.status==="success"&&u.value?(f.openBlock(),f.createElementBlock("div",JB,[f.createElementVNode("p",null,f.toDisplayString(e.modalDescription?e.modalDescription:f.unref(n).t("csvExport.exportDescription")),1),f.createElementVNode("p",null,f.toDisplayString(f.unref(n).t("csvExport.exportTimeRange"))+": "+f.toDisplayString(d.value),1)])):f.createCommentVNode("",!0),e.exportState.status==="loading"?(f.openBlock(),f.createBlock(S,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(f.openBlock(),f.createBlock(A,{key:2,class:"vitals-table",fetcher:y,"fetcher-cache-key":String(a.value),headers:g.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(O,{"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(n).t("csvExport.noDataRange")),1)]),default:f.withCtx(()=>[f.createElementVNode("p",null,f.toDisplayString(f.unref(n).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):e.exportState.status==="error"?(f.openBlock(),f.createBlock(O,{key:3,"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(n).t("csvExport.dataError")),1)]),_:1})):f.createCommentVNode("",!0),e.exportState.status==="success"&&u.value?(f.openBlock(),f.createElementBlock("div",tF,[f.createTextVNode(f.toDisplayString(h.value)+" ",1),f.createVNode(P,{class:"preview-tooltip",placement:"right",text:f.unref(n).t("csvExport.maximumRecordAmount",{value:f.unref(1e3)})},{default:f.withCtx(()=>[f.createVNode(f.unref(fe.InfoIcon),{color:`var(--kui-color-text-neutral, ${f.unref(Fc)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])]),_:1},8,["text"])])):f.createCommentVNode("",!0)])]),"footer-actions":f.withCtx(()=>[f.createVNode(L,{appearance:"tertiary",class:"cancel-btn",onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(ZB,{class:"vitals-report-export-button",filename:s,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(L,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!u.value},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});Lt.AnalyticsChart=IN,Lt.ChartLegendPosition=Le,Lt.CsvExportModal=eF,Lt.DECIMAL_DISPLAY=AP,Lt.FONT_SIZE_REGULAR=k0,Lt.FONT_SIZE_SMALL=T0,Lt.LEFT_Y_AXIS_ID=rl,Lt.MAX_LABEL_LENGTH=il,Lt.OTHER_DIMENSION_ID=Uu,Lt.RIGHT_Y_AXIS_ID=qu,Lt.SimpleChart=XN,Lt.SparklineChart=tB,Lt.TopNTable=UB,Lt.TopTalkersColumn=iy,Lt.TopTalkersGrid=xB,Lt.ValidType=br,Lt.chartTypes=R2,Lt.exploreResultToScatterData=q0,Lt.getBarRatio=b0,Lt.getColumnOptions=gr,Lt.getColumnStats=Hu,Lt.getRelativeValue=Wu,Lt.getThresholdType=$u,Lt.handleQueryError=S2,Lt.isCancellationError=V0,Lt.isScatterChartData=dd,Lt.lookupStatusCodeColor=D0,Lt.requestsToScatterData=O2,Lt.simpleChartMetricDisplay=E2,Lt.simpleChartTypes=P2,Lt.statusCodeBadgeBackgroundColor=PP,Lt.toNumber=Jr,Object.defineProperty(Lt,Symbol.toStringTag,{value:"Module"})}));
|