@kong-ui-public/analytics-chart 10.36.0 → 10.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vitals-chart.es.js +1576 -1581
- package/dist/vitals-chart.umd.js +8 -8
- package/package.json +3 -3
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(It,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):(It=typeof globalThis<"u"?globalThis:It||self,f(It["kong-ui-publicvitals-chart"]={},It.Vue,It.KongIcons,It["kong-ui-public-i18n"],It["kong-ui-public-analytics-metric-provider"],It.Kongponents))})(this,(function(It,f,fe,hh,er,As){"use strict";var bt=(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))(bt||{});const hx=["in","not_in","selector"],px=["empty","not_empty"],mx=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],nr=e=>e.filter(t=>t!=="time"),ph=["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"],Sc=nr(ph),gx=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],mh=[...ph,"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"],Tc=nr(mh),yx=[...gx,"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"],_x=["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"],kc=nr(_x),bx=["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"],xx=nr(bx),wx=["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"],vx=wx,Sx=["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"],Tx=nr(Sx),kx=["platform","platform_usage"],Mx=e=>kx.includes(e),Dx=[...mh.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"],Mc=nr(Dx);[...yx];const Cx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Dc=nr(Cx);new Set(Sc),new Set(Tc),new Set(kc),new Set(Mc),new Set(Dc);const gh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}],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:hx},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:px}},required:["field","operator"],additionalProperties:!1}]}});({...Si()},gh.map(e=>e.code));const Ox=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Si(Tc),Si(Sc),Si(kc),Si(Mc),Si(Dc),Si(Array.from(new Set([...xx,...vx,...Tx]))),Si([...new Set([...Tc,...Sc,...kc,...Mc,...Ox,...Dc])]);const Ax={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"}},Ex=(e,t,n)=>{let i;const r=Ax[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 Cc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Px={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ix={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Lx={date:Cc({formats:Rx,defaultWidth:"full"}),time:Cc({formats:Px,defaultWidth:"full"}),dateTime:Cc({formats:Ix,defaultWidth:"full"})},Nx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bx=(e,t,n,i)=>Nx[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 Fx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ux={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"]},Hx={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"]},Wx={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"}},$x={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"}},Vx=(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"},Yx={ordinalNumber:Vx,era:Es({values:Fx,defaultWidth:"wide"}),quarter:Es({values:zx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Es({values:Ux,defaultWidth:"wide"}),day:Es({values:Hx,defaultWidth:"wide"}),dayPeriod:Es({values:Wx,defaultWidth:"wide",formattingValues:$x,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)?jx(l,m=>m.test(a)):qx(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 qx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function jx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Gx(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 Kx=/^(\d+)(th|st|nd|rd)?/i,Xx=/\d+/i,Zx={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},Qx={any:[/^b/i,/^(a|c)/i]},Jx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tw={any:[/1/i,/2/i,/3/i,/4/i]},ew={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},nw={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]},iw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sw={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},ow={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}},aw={ordinalNumber:Gx({matchPattern:Kx,parsePattern:Xx,valueCallback:e=>parseInt(e,10)}),era:Rs({matchPatterns:Zx,defaultMatchWidth:"wide",parsePatterns:Qx,defaultParseWidth:"any"}),quarter:Rs({matchPatterns:Jx,defaultMatchWidth:"wide",parsePatterns:tw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rs({matchPatterns:ew,defaultMatchWidth:"wide",parsePatterns:nw,defaultParseWidth:"any"}),day:Rs({matchPatterns:iw,defaultMatchWidth:"wide",parsePatterns:rw,defaultParseWidth:"any"}),dayPeriod:Rs({matchPatterns:sw,defaultMatchWidth:"any",parsePatterns:ow,defaultParseWidth:"any"})},lw={code:"en-US",formatDistance:Ex,formatLong:Lx,formatRelative:Bx,localize:Yx,match:aw,options:{weekStartsOn:0,firstWeekContainsDate:1}};let cw={};function Ps(){return cw}const yh=6048e5,uw=864e5,dw=60,fw=3600,_h=Symbol.for("constructDateFrom");function Tn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&_h in e?e[_h](t):e instanceof Date?new e.constructor(t):new Date(t)}function He(e,t){return Tn(t||e,e)}function bh(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 hw(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 pw(e,t,n){const[i,r]=hw(n?.in,e,t),s=Nr(i),a=Nr(r),l=+s-bh(s),u=+a-bh(a);return Math.round((l-u)/uw)}function mw(e,t){const n=He(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function gw(e,t){const n=He(e,t?.in);return pw(n,mw(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 xh(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 yw(e,t){const n=xh(e,t),i=Tn(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),sa(i)}function _w(e,t){const n=He(e,t?.in),i=+sa(n)-+yw(n);return Math.round(i/yh)+1}function wh(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 bw(e,t){const n=Ps(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=wh(e,t),s=Tn(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ni(s,t)}function xw(e,t){const n=He(e,t?.in),i=+ni(n,t)-+bw(n,t);return Math.round(i/yh)+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"},vh={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=wh(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=xh(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=xw(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(e,t,n){const i=_w(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=gw(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 Th(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 Th(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"+Sh(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"+Sh(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 Sh(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 Th(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 kh=(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"})}},Mh=(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"})}},ww=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return kh(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}}",kh(i,t)).replace("{{time}}",Mh(r,t))},vw={p:Mh,P:ww},Sw=/^D+$/,Tw=/^Y+$/,kw=["D","DD","YY","YYYY"];function Mw(e){return Sw.test(e)}function Dw(e){return Tw.test(e)}function Cw(e,t,n){const i=Ow(e,t,n);if(console.warn(i),kw.includes(e))throw new RangeError(i)}function Ow(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 Aw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ew(e){return!(!Aw(e)&&typeof e!="number"||isNaN(+He(e)))}const Rw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Iw=/^'([^]*?)'?$/,Lw=/''/g,Nw=/[a-zA-Z]/;function Bw(e,t,n){const i=Ps(),r=n?.locale??i.locale??lw,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(!Ew(l))throw new RangeError("Invalid time value");let u=t.match(Pw).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=vw[m];return g(h,r.formatLong)}return h}).join("").match(Rw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Fw(h)};if(vh[m])return{isToken:!0,value:h};if(m.match(Nw))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&&Dw(m)||!n?.useAdditionalDayOfYearTokens&&Mw(m))&&Cw(m,t,String(e));const g=vh[m[0]];return g(l,m,r.localize,d)}).join("")}function Fw(e){const t=e.match(Iw);return t?t[1].replace(Lw,"'"):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 Dh(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 zw(e,t,n){return Dh(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 Uw(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 Hw(){return Object.assign({},Ps())}function Ch(e){return Math.trunc(e*fw)}function Ww(e){const t=e/dw;return Math.trunc(t)}function Oh(e,t,n){return Dh(e,-1,n)}function Ah(e,t,n){return zw(e,-1,n)}function Eh(e,t,n){const i=Hw(),r=Yw(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?$w(r,t):Vw(r,t)}function $w(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 Vw(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function Yw(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function qw(e,t){const n=Zw(t);return"formatToParts"in n?Gw(n,e):Kw(n,e)}const jw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Gw(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=jw[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 Kw(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 Oc={},Rh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Xw=Rh==="06/25/2014, 00:00:00"||Rh==="06/25/2014 00:00:00";function Zw(e){return Oc[e]||(Oc[e]=Xw?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"})),Oc[e]}function Ac(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 Ph=36e5,Qw=6e4,Ec={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(e,t,n){if(!e)return 0;let i=Ec.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Ec.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Ih(r)?-(r*Ph):NaN;if(i=Ec.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Ih(r,a)?(s=Math.abs(r)*Ph+a*Qw,i[1]==="+"?-s:s):NaN}if(ev(e)){t=new Date(t||Date.now());const a=n?t:Jw(t),l=Rc(a,e);return-(n?l:tv(t,l,e))}return NaN}function Jw(e){return Ac(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Rc(e,t){const n=qw(e,t),i=Ac(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 tv(e,t,n){let i=e.getTime()-t;const r=Rc(new Date(i),n);if(t===r)return t;i-=r-t;const s=Rc(new Date(i),n);return r===s?r:Math.max(r,s)}function Ih(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Lh={};function ev(e){if(Lh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Lh[e]=!0,!0}catch{return!1}}const nv=60*1e3,iv={X:function(e,t,n){const i=Pc(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Nh(i);case"XXXX":case"XX":return Ur(i);default:return Ur(i,":")}},x:function(e,t,n){const i=Pc(n.timeZone,e);switch(t){case"x":return Nh(i);case"xxxx":case"xx":return Ur(i);default:return Ur(i,":")}},O:function(e,t,n){const i=Pc(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+rv(i,":");default:return"GMT"+Ur(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Eh("short",e,n);default:return Eh("long",e,n)}}};function Pc(e,t){const n=e?Is(e,t,!0)/nv: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 Nh(e,t){return e%60===0?(e>0?"-":"+")+aa(Math.abs(e)/60,2):Ur(e,t)}function rv(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 Bh(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 Fh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ic=36e5,zh=6e4,sv=2,Ze={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:Fh};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?sv: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=ov(e),{year:r,restDateString:s}=av(i.date,n),a=lv(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=cv(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=Bh(new Date(l+u)),d=Bh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function ov(e){const t={};let n=Ze.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Ze.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Ze.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function av(e,t){if(e){const n=Ze.YYY[t],i=Ze.YYYYY[t];let r=Ze.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Ze.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 lv(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=Ze.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Wh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Ze.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return fv(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Ze.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Wh(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Ze.Www.exec(e),s)return r=parseInt(s[1],10)-1,$h(r)?Uh(t,r):new Date(NaN);if(s=Ze.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return $h(r,a)?Uh(t,r,a):new Date(NaN)}return null}function cv(e){let t,n,i=Ze.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Lc(t)?t%24*Ic:NaN;if(i=Ze.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Lc(t,n)?t%24*Ic+n*zh:NaN;if(i=Ze.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Lc(t,n,r)?t%24*Ic+n*zh+r*1e3:NaN}return null}function Uh(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 uv=[31,28,31,30,31,30,31,31,30,31,30,31],dv=[31,29,31,30,31,30,31,31,30,31,30,31];function Hh(e){return e%400===0||e%4===0&&e%100!==0}function Wh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Hh(e);if(i&&n>dv[t]||!i&&n>uv[t])return!1}return!0}function fv(e,t){if(t<1)return!1;const n=Hh(e);return!(n&&t>366||!n&&t>365)}function $h(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Lc(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const hv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function pv(e,t,n={}){t=String(t);const i=t.match(hv);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,"'"+iv[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return Bw(e,t,n)}function Vh(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 Yh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},pv(Vh(e,t,{timeZone:i.timeZone}),n,i)}function mv(e,t,n){if(typeof e=="string"&&!e.match(Fh))return la(e,{...n,timeZone:t});e=la(e,n);const i=Ac(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 gv(e,t){return-Is(e,t)}function qh(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)"),Yh(e,n,i)}function yv(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 Yh(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const _v={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&&mx.find(t=>e<=_v[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 jh;function bv(){return jh||(jh=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]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",A="[object String]",F="[object Symbol]",P="[object WeakMap]",B="[object ArrayBuffer]",N="[object DataView]",z="[object Float32Array]",k="[object Float64Array]",w="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",$="[object Uint8Array]",q="[object Uint8ClampedArray]",st="[object Uint16Array]",ct="[object Uint32Array]",ht=/[\\^$.*+?()[\]{}|]/g,ut=/\w*$/,vt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,dt={};dt[s]=dt[a]=dt[B]=dt[N]=dt[l]=dt[u]=dt[z]=dt[k]=dt[w]=dt[O]=dt[L]=dt[g]=dt[_]=dt[x]=dt[S]=dt[C]=dt[A]=dt[F]=dt[$]=dt[q]=dt[st]=dt[ct]=!0,dt[d]=dt[h]=dt[P]=!1;var V=typeof ua=="object"&&ua&&ua.Object===Object&&ua,I=typeof self=="object"&&self&&self.Object===Object&&self,W=V||I||Function("return this")(),nt=t&&!t.nodeType&&t,ot=nt&&!0&&e&&!e.nodeType&&e,X=ot&&ot.exports===nt;function tt(D,Y){return D.set(Y[0],Y[1]),D}function rt(D,Y){return D.add(Y),D}function pt(D,Y){for(var J=-1,xt=D?D.length:0;++J<xt&&Y(D[J],J,D)!==!1;);return D}function yt(D,Y){for(var J=-1,xt=Y.length,Ce=D.length;++J<xt;)D[Ce+J]=Y[J];return D}function mt(D,Y,J,xt){for(var Ce=-1,Ge=D?D.length:0;++Ce<Ge;)J=Y(J,D[Ce],Ce,D);return J}function Et(D,Y){for(var J=-1,xt=Array(D);++J<D;)xt[J]=Y(J);return xt}function zt(D,Y){return D?.[Y]}function G(D){var Y=!1;if(D!=null&&typeof D.toString!="function")try{Y=!!(D+"")}catch{}return Y}function it(D){var Y=-1,J=Array(D.size);return D.forEach(function(xt,Ce){J[++Y]=[Ce,xt]}),J}function lt(D,Y){return function(J){return D(Y(J))}}function $t(D){var Y=-1,J=Array(D.size);return D.forEach(function(xt){J[++Y]=xt}),J}var _t=Array.prototype,Vt=Function.prototype,Te=Object.prototype,ke=W["__core-js_shared__"],ae=(function(){var D=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),cn=Vt.toString,qt=Te.hasOwnProperty,Be=Te.toString,re=RegExp("^"+cn.call(qt).replace(ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=X?W.Buffer:void 0,Pe=W.Symbol,gn=W.Uint8Array,Wi=lt(Object.getPrototypeOf,Object),Cn=Object.create,je=Te.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,Oo=De?De.isBuffer:void 0,Ao=lt(Object.keys,Object),Tr=Zn(W,"DataView"),fi=Zn(W,"Map"),Eo=Zn(W,"Promise"),Ro=Zn(W,"Set"),Po=Zn(W,"WeakMap"),$i=Zn(Object,"create"),bl=pi(Tr),Od=pi(fi),Ad=pi(Eo),Ed=pi(Ro),Rd=pi(Po),Io=Pe?Pe.prototype:void 0,xl=Io?Io.valueOf:void 0;function hi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function Pd(){this.__data__=$i?$i(null):{}}function Lo(D){return this.has(D)&&delete this.__data__[D]}function Id(D){var Y=this.__data__;if($i){var J=Y[D];return J===i?void 0:J}return qt.call(Y,D)?Y[D]:void 0}function No(D){var Y=this.__data__;return $i?Y[D]!==void 0:qt.call(Y,D)}function Ld(D,Y){var J=this.__data__;return J[D]=$i&&Y===void 0?i:Y,this}hi.prototype.clear=Pd,hi.prototype.delete=Lo,hi.prototype.get=Id,hi.prototype.has=No,hi.prototype.set=Ld;function Nn(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function Nd(){this.__data__=[]}function Bd(D){var Y=this.__data__,J=kr(Y,D);if(J<0)return!1;var xt=Y.length-1;return J==xt?Y.pop():Ln.call(Y,J,1),!0}function Fd(D){var Y=this.__data__,J=kr(Y,D);return J<0?void 0:Y[J][1]}function wl(D){return kr(this.__data__,D)>-1}function zd(D,Y){var J=this.__data__,xt=kr(J,D);return xt<0?J.push([D,Y]):J[xt][1]=Y,this}Nn.prototype.clear=Nd,Nn.prototype.delete=Bd,Nn.prototype.get=Fd,Nn.prototype.has=wl,Nn.prototype.set=zd;function Vi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function vl(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function Ud(D){return Mr(this,D).delete(D)}function Hd(D){return Mr(this,D).get(D)}function Wd(D){return Mr(this,D).has(D)}function $d(D,Y){return Mr(this,D).set(D,Y),this}Vi.prototype.clear=vl,Vi.prototype.delete=Ud,Vi.prototype.get=Hd,Vi.prototype.has=Wd,Vi.prototype.set=$d;function Yi(D){this.__data__=new Nn(D)}function Vd(){this.__data__=new Nn}function ls(D){return this.__data__.delete(D)}function Yd(D){return this.__data__.get(D)}function cs(D){return this.__data__.has(D)}function qd(D,Y){var J=this.__data__;if(J instanceof Nn){var xt=J.__data__;if(!fi||xt.length<n-1)return xt.push([D,Y]),this;J=this.__data__=new Vi(xt)}return J.set(D,Y),this}Yi.prototype.clear=Vd,Yi.prototype.delete=ls,Yi.prototype.get=Yd,Yi.prototype.has=cs,Yi.prototype.set=qd;function jd(D,Y){var J=Ho(D)||Nl(D)?Et(D.length,String):[],xt=J.length,Ce=!!xt;for(var Ge in D)qt.call(D,Ge)&&!(Ce&&(Ge=="length"||Rl(Ge,xt)))&&J.push(Ge);return J}function Sl(D,Y,J){var xt=D[Y];(!(qt.call(D,Y)&&Ll(xt,J))||J===void 0&&!(Y in D))&&(D[Y]=J)}function kr(D,Y){for(var J=D.length;J--;)if(Ll(D[J][0],Y))return J;return-1}function Tl(D,Y){return D&&Fo(Y,Wo(Y),D)}function us(D,Y,J,xt,Ce,Ge,Bn){var Fe;if(xt&&(Fe=Ge?xt(D,Ce,Ge,Bn):xt(D)),Fe!==void 0)return Fe;if(!ms(D))return D;var Fl=Ho(D);if(Fl){if(Fe=Al(D),!Y)return Ol(D,Fe)}else{var ue=un(D),gs=ue==h||ue==m;if(sf(D))return Ml(D,Y);if(ue==x||ue==s||gs&&!Ge){if(G(D))return Ge?D:{};if(Fe=El(gs?{}:D),!Y)return zo(D,Tl(Fe,D))}else{if(!dt[ue])return Ge?D:{};Fe=ef(D,ue,us,Y)}}Bn||(Bn=new Yi);var Qn=Bn.get(D);if(Qn)return Qn;if(Bn.set(D,Fe),!Fl)var $o=J?tf(D):Wo(D);return pt($o||D,function(Dr,ze){$o&&(ze=Dr,Dr=D[ze]),Sl(Fe,ze,us(Dr,Y,J,xt,ze,D,Bn))}),Fe}function Gd(D){return ms(D)?Cn(D):{}}function Kd(D,Y,J){var xt=Y(D);return Ho(D)?xt:yt(xt,J(D))}function Xd(D){return Be.call(D)}function Zd(D){if(!ms(D)||Il(D))return!1;var Y=ps(D)||G(D)?re:vt;return Y.test(pi(D))}function kl(D){if(!Uo(D))return Ao(D);var Y=[];for(var J in Object(D))qt.call(D,J)&&J!="constructor"&&Y.push(J);return Y}function Ml(D,Y){if(Y)return D.slice();var J=new D.constructor(D.length);return D.copy(J),J}function ds(D){var Y=new D.constructor(D.byteLength);return new gn(Y).set(new gn(D)),Y}function Bo(D,Y){var J=Y?ds(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.byteLength)}function Qd(D,Y,J){var xt=Y?J(it(D),!0):it(D);return mt(xt,tt,new D.constructor)}function Dl(D){var Y=new D.constructor(D.source,ut.exec(D));return Y.lastIndex=D.lastIndex,Y}function fs(D,Y,J){var xt=Y?J($t(D),!0):$t(D);return mt(xt,rt,new D.constructor)}function Cl(D){return xl?Object(xl.call(D)):{}}function Jd(D,Y){var J=Y?ds(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.length)}function Ol(D,Y){var J=-1,xt=D.length;for(Y||(Y=Array(xt));++J<xt;)Y[J]=D[J];return Y}function Fo(D,Y,J,xt){J||(J={});for(var Ce=-1,Ge=Y.length;++Ce<Ge;){var Bn=Y[Ce],Fe=void 0;Sl(J,Bn,Fe===void 0?D[Bn]:Fe)}return J}function zo(D,Y){return Fo(D,hs(D),Y)}function tf(D){return Kd(D,Wo,hs)}function Mr(D,Y){var J=D.__data__;return Pl(Y)?J[typeof Y=="string"?"string":"hash"]:J.map}function Zn(D,Y){var J=zt(D,Y);return Zd(J)?J:void 0}var hs=di?lt(di,Object):lf,un=Xd;(Tr&&un(new Tr(new ArrayBuffer(1)))!=N||fi&&un(new fi)!=g||Eo&&un(Eo.resolve())!=v||Ro&&un(new Ro)!=C||Po&&un(new Po)!=P)&&(un=function(D){var Y=Be.call(D),J=Y==x?D.constructor:void 0,xt=J?pi(J):void 0;if(xt)switch(xt){case bl:return N;case Od:return g;case Ad:return v;case Ed:return C;case Rd:return P}return Y});function Al(D){var Y=D.length,J=D.constructor(Y);return Y&&typeof D[0]=="string"&&qt.call(D,"index")&&(J.index=D.index,J.input=D.input),J}function El(D){return typeof D.constructor=="function"&&!Uo(D)?Gd(Wi(D)):{}}function ef(D,Y,J,xt){var Ce=D.constructor;switch(Y){case B:return ds(D);case l:case u:return new Ce(+D);case N:return Bo(D,xt);case z:case k:case w:case O:case L:case $:case q:case st:case ct:return Jd(D,xt);case g:return Qd(D,xt,J);case _:case A:return new Ce(D);case S:return Dl(D);case C:return fs(D,xt,J);case F:return Cl(D)}}function Rl(D,Y){return Y=Y??r,!!Y&&(typeof D=="number"||at.test(D))&&D>-1&&D%1==0&&D<Y}function Pl(D){var Y=typeof D;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?D!=="__proto__":D===null}function Il(D){return!!ae&&ae in D}function Uo(D){var Y=D&&D.constructor,J=typeof Y=="function"&&Y.prototype||Te;return D===J}function pi(D){if(D!=null){try{return cn.call(D)}catch{}try{return D+""}catch{}}return""}function nf(D){return us(D,!0,!0)}function Ll(D,Y){return D===Y||D!==D&&Y!==Y}function Nl(D){return rf(D)&&qt.call(D,"callee")&&(!je.call(D,"callee")||Be.call(D)==s)}var Ho=Array.isArray;function Bl(D){return D!=null&&of(D.length)&&!ps(D)}function rf(D){return af(D)&&Bl(D)}var sf=Oo||ne;function ps(D){var Y=ms(D)?Be.call(D):"";return Y==h||Y==m}function of(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function ms(D){var Y=typeof D;return!!D&&(Y=="object"||Y=="function")}function af(D){return!!D&&typeof D=="object"}function Wo(D){return Bl(D)?jd(D):kl(D)}function lf(){return[]}function ne(){return!1}e.exports=nf})(da,da.exports)),da.exports}bv();const kn=(e,t)=>new Date(e.getTime()-gv(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=mv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Vh(n,t)}}class xv 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 wv extends Ee{rawStart(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class vv extends Ee{rawStart(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class Sv 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 Tv 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 kv extends Ee{rawEnd(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=Fr(Ah(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Mv extends Ee{rawEnd(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=zr(Oh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Dv 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}}bt.FIFTEEN_MIN,new Ee({key:bt.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"]}),bt.ONE_HOUR,new Ee({key:bt.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"]}),bt.SIX_HOUR,new Ee({key:bt.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"]}),bt.TWELVE_HOUR,new Ee({key:bt.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"]}),bt.ONE_DAY,new Ee({key:bt.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"]}),bt.SEVEN_DAY,new Ee({key:bt.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"]}),bt.THIRTY_DAY,new Ee({key:bt.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"]}),bt.NINETY_DAY,new Ee({key:bt.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"]}),bt.ONE_HUNDRED_EIGHTY_DAY,new Ee({key:bt.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"]}),bt.ONE_YEAR,new Ee({key:bt.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"]}),bt.CURRENT_WEEK,new xv({key:bt.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"]}),bt.CURRENT_MONTH,new wv({key:bt.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"]}),bt.CURRENT_QUARTER,new vv({key:bt.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"]}),bt.CURRENT_YEAR,new Sv({key:bt.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"]}),bt.PREVIOUS_WEEK,new Tv({key:bt.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"]}),bt.PREVIOUS_MONTH,new Mv({key:bt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=zr(new Date),n=zr(Oh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Gh(t,n)),3600*24*Uw(new Date().setMonth(new Date().getMonth()-1))+Ch(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_QUARTER,new kv({key:bt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date),t=Fr(Ah(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_YEAR,new Dv({key:bt.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=Gh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Ch(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gh(e,t){return Ww(e.getTimezoneOffset()-t.getTimezoneOffset())}bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.THIRTY_DAY,bt.NINETY_DAY,bt.ONE_HUNDRED_EIGHTY_DAY,bt.ONE_YEAR,bt.CURRENT_WEEK,bt.CURRENT_MONTH,bt.CURRENT_QUARTER,bt.CURRENT_YEAR,bt.PREVIOUS_WEEK,bt.PREVIOUS_MONTH,bt.PREVIOUS_QUARTER,bt.PREVIOUS_YEAR;const Cv=new Map(gh.map(e=>[e.code,{code:e.code,name:e.name}])),Nc=e=>Cv.get(e)?.name||e,Kh=1e3,Ov=1e4,Xh=1e6,Zh=1e9,Qh=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?Ov:Kh;return e<r||t.precision&&t.precision>Math.log10(e)?n=fa(Ls(e,1,t),t):e<Xh?n=`${Ls(e,Kh,t)}k`:e<Zh?n=`${Ls(e,Xh,t)}m`:e<Qh?n=`${fa(Ls(e,Zh,t),t)}b`:n=`${fa(Ls(e,Qh,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 Av=typeof document<"u"&&document.documentElement?.lang||"en-US",pa=new Intl.NumberFormat(Av);function $n({i18n:e}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,l=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let h;return i>=s?h=e.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?h=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=e.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=e.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},n=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?e.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:l=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return n(i,a);default:return isNaN(i)?`${i}`:l?`${ha(i,{capital:!0})} ${d}`:i>=.01?`${pa.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:n,formatRange:(i,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(i,a)} - ${t(r,a)}`;case"usd":return`${n(i,l)} - ${n(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${ha(i,{capital:!0})} - ${ha(r,{capital:!0})} ${h}`}const m=i>=.01?`${pa.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,g=r>=.01?`${pa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${m} - ${g} ${h}`}}}const Ev=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Rv="#0044f4",Jh="#6c7489",Pv="#afb7c5",Iv="#d60027",Lv="#ffc400",Nv="#bee2ff",Bv="#8fc1ff",Fv="#5f9aff",zv="#306fff",Uv="#b5ffee",Hv="#00fabe",Wv="#00d6a4",$v="#00a17b",Vv="#007d60",Yv="#005944",qv="#b5ffee",jv="#00fabe",Gv="#b5ffee",Kv="#00a17b",Xv="#fff296",Zv="#ffe04b",Qv="#ffc400",Jv="#b37600",t1="#995c00",e1="#804400",n1="#fff296",i1="#ffe04b",r1="#ffc2b3",s1="#ff9877",o1="#ff723c",a1="#f75008",l1="#d13500",c1="#a31f00",u1="#ffc2b3",d1="#ff9877",f1="#ff723c",h1="#f75008",p1="#d13500",m1="#a31f00",g1="#ffc2b3",y1="#ff9877",_1="#ff723c",b1="#f75008",x1="#d13500",w1="#a31f00",v1="#ffc2b3",S1="#ff9877",T1="#ff723c",k1="#f75008",M1="#d13500",D1="#a31f00",C1="#ffc2b3",O1="#ff9877",A1="#ff723c",E1="#f75008",R1="#d13500",P1="#ffabab",I1="#ff7272",L1="#ff3954",N1="#f50045",B1="#d60027",F1="#ad000e",z1="#ffabab",U1="#ff7272",H1="#ff3954",W1="#f50045",$1="#d60027",V1="#eefaff",Y1="#ecfffb",q1="#fffce0",j1="#fff1ef",G1="#ffe5e5",K1="#5f9aff",X1="#00d6a4",Z1="#ffc400",Q1="#ff723c",J1="#ff3954",tS={100:Nv,101:Bv,102:Fv,103:zv,200:Uv,201:Hv,202:Wv,203:$v,204:Vv,205:Yv,206:qv,207:jv,208:Gv,226:Kv,300:Xv,301:Zv,302:Qv,303:Jv,304:t1,305:e1,307:n1,308:i1,400:r1,401:s1,402:o1,403:a1,404:l1,405:c1,406:u1,407:d1,408:f1,409:h1,410:p1,411:m1,412:g1,413:y1,414:_1,415:b1,416:x1,417:w1,418:v1,421:S1,422:T1,423:k1,424:M1,425:D1,426:C1,428:O1,429:A1,431:E1,451:R1,500:P1,501:I1,502:L1,503:N1,504:B1,505:F1,506:z1,507:U1,508:H1,510:W1,511:$1},eS={100:V1,200:Y1,300:q1,400:j1,500:G1},tp={"1XX":K1,"2XX":X1,"3XX":Z1,"4XX":Q1,"5XX":J1},nS={error:Iv,warning:Lv,empty:Pv,neutral:Jh,____OTHER____:Rv},ep=["#1693AE","#2EA697","#5CB56C","#AD47F1","#7287F1","#4DA8DF","#DA5024","#EC4D87","#D771D5","#6C931E","#AC8E26","#DB8743"],np=["#006B74","#187C62","#538732","#7201DE","#1E63D3","#1E83A3","#B2001F","#BA107B","#A739D0","#5E6400","#8B620C","#BB5420"],iS=e=>Ev(e),ip=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?np[i%np.length]:ep[i%ep.length]},Ns=({state:e})=>nS[e]??Jh,rS=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return tS[n]??eS[i]??Ns({state:"neutral"})},sS=({group:e})=>tp[e]?tp[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,theme:s="light",customPalette:a=void 0})=>{if(e!==void 0)return ip({discriminator:e,theme:s,customPalette:a});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 rS({statusCode:i});if(n==="status_code_grouped")return sS({group:i})}return n||i||r?ip({discriminator:iS(`${n??""}${i??""}${r??""}`),theme:s,customPalette:a}):Ns({state:"neutral"})},rp="#d60027",sp="#ffe5e5",oS="#f1f0ff",aS="#e0e4ea",op="#6c7489",lS="#afb7c5",ap="#0d0e14",cS="#d60027",uS="#ad000e",Bc="#6c7489",lp="#52596e",dS="#007d60",fS="#995c00",hS="#ffc400",pS="'Inter', Roboto, Helvetica, sans-serif",rr="16px",mS="20px",gS="#bee2ff",yS="#8fc1ff",_S="#5f9aff",bS="#306fff",xS="#b5ffee",wS="#00fabe",vS="#00d6a4",SS="#00a17b",TS="#007d60",kS="#005944",MS="#b5ffee",DS="#00fabe",CS="#b5ffee",OS="#00a17b",AS="#fff296",ES="#ffe04b",RS="#ffc400",PS="#b37600",IS="#995c00",LS="#804400",NS="#fff296",BS="#ffe04b",FS="#ffc2b3",zS="#ff9877",US="#ff723c",HS="#f75008",WS="#d13500",$S="#a31f00",VS="#ffc2b3",YS="#ff9877",qS="#ff723c",jS="#f75008",GS="#d13500",KS="#a31f00",XS="#ffc2b3",ZS="#ff9877",QS="#ff723c",JS="#f75008",tT="#d13500",eT="#a31f00",nT="#ffc2b3",iT="#ff9877",rT="#ff723c",sT="#f75008",oT="#d13500",aT="#a31f00",lT="#ffc2b3",cT="#ff9877",uT="#ff723c",dT="#f75008",fT="#d13500",hT="#ffabab",pT="#ff7272",mT="#ff3954",gT="#f50045",yT="#d60027",_T="#ad000e",bT="#ffabab",xT="#ff7272",wT="#ff3954",vT="#f50045",ST="#d60027",TT="#eefaff",kT="#ecfffb",MT="#fffce0",DT="#fff1ef",CT="#ffe5e5",OT="#5f9aff",AT="#00d6a4",ET="#ffc400",RT="#ff723c",PT="#ff3954",cp=6048e5,IT=864e5,Fs=6e4,Hr=36e5,LT=1e3,up=Symbol.for("constructDateFrom");function me(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&up in e?e[up](t):e instanceof Date?new e.constructor(t):new Date(t)}function At(e,t){return me(t||e,e)}function ma(e,t,n){const i=At(e,n?.in);return isNaN(t)?me(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Fc(e,t,n){const i=At(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 zc(e,t,n){return me(e,+At(e)+t)}function NT(e,t,n){return zc(e,t*Hr)}let BT={};function sr(){return BT}function Vn(e,t){const n=sr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=At(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 dp(e,t){const n=At(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=At(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 Uc(e,t){const n=At(e,t?.in);return n.setHours(0,0,0,0),n}function fp(e,t,n){const[i,r]=or(n?.in,e,t),s=Uc(i),a=Uc(r),l=+s-ga(s),u=+a-ga(a);return Math.round((l-u)/IT)}function FT(e,t){const n=dp(e,t),i=me(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Wr(i)}function zT(e,t,n){const i=At(e,n?.in);return i.setTime(i.getTime()+t*Fs),i}function UT(e,t,n){return Fc(e,t*3,n)}function HT(e,t,n){return zc(e,t*1e3)}function WT(e,t,n){return ma(e,t*7,n)}function $T(e,t,n){return Fc(e,t*12,n)}function zs(e,t){const n=+At(e)-+At(t);return n<0?-1:n>0?1:n}function VT(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Hc(e){return!(!VT(e)&&typeof e!="number"||isNaN(+At(e)))}function YT(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 qT(e,t,n){const[i,r]=or(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function hp(e,t,n){const[i,r]=or(n?.in,e,t),s=pp(i,r),a=Math.abs(fp(i,r));i.setDate(i.getDate()-s*a);const l=+(pp(i,r)===-s),u=s*(a-l);return u===0?0:u}function pp(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 jT(e,t,n){const[i,r]=or(n?.in,e,t),s=(+i-+r)/Hr;return Us(n?.roundingMethod)(s)}function Wc(e,t){return+At(e)-+At(t)}function GT(e,t,n){const i=Wc(e,t)/Fs;return Us(n?.roundingMethod)(i)}function mp(e,t){const n=At(e,t?.in);return n.setHours(23,59,59,999),n}function gp(e,t){const n=At(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function KT(e,t){const n=At(e,t?.in);return+mp(n,t)==+gp(n,t)}function yp(e,t,n){const[i,r,s]=or(n?.in,e,e,t),a=zs(r,s),l=Math.abs(YT(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;KT(i)&&l===1&&zs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function XT(e,t,n){const i=yp(e,t,n)/3;return Us(n?.roundingMethod)(i)}function ZT(e,t,n){const i=Wc(e,t)/1e3;return Us(n?.roundingMethod)(i)}function QT(e,t,n){const i=hp(e,t,n)/7;return Us(n?.roundingMethod)(i)}function JT(e,t,n){const[i,r]=or(n?.in,e,t),s=zs(i,r),a=Math.abs(qT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=zs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function tk(e,t){const n=At(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function ek(e,t){const n=At(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function nk(e,t){const n=At(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function _p(e,t){const n=At(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ik(e,t){const n=At(e,t?.in);return n.setMinutes(59,59,999),n}function rk(e,t){const n=sr(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=At(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 sk(e,t){const n=At(e,t?.in);return n.setSeconds(59,999),n}function ok(e,t){const n=At(e,t?.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function ak(e,t){const n=At(e,t?.in);return n.setMilliseconds(999),n}const lk={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"}},ck=(e,t,n)=>{let i;const r=lk[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 $c(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hk={date:$c({formats:uk,defaultWidth:"full"}),time:$c({formats:dk,defaultWidth:"full"}),dateTime:$c({formats:fk,defaultWidth:"full"})},pk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mk=(e,t,n,i)=>pk[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 gk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_k={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"]},bk={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"]},xk={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"}},wk={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"}},vk={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:gk,defaultWidth:"wide"}),quarter:Hs({values:yk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hs({values:_k,defaultWidth:"wide"}),day:Hs({values:bk,defaultWidth:"wide"}),dayPeriod:Hs({values:xk,defaultWidth:"wide",formattingValues:wk,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)?Tk(l,m=>m.test(a)):Sk(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 Sk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Tk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function kk(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 Mk=/^(\d+)(th|st|nd|rd)?/i,Dk=/\d+/i,Ck={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},Ok={any:[/^b/i,/^(a|c)/i]},Ak={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ek={any:[/1/i,/2/i,/3/i,/4/i]},Rk={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},Pk={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]},Ik={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},Lk={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]},Nk={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},Bk={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}},Fk={ordinalNumber:kk({matchPattern:Mk,parsePattern:Dk,valueCallback:e=>parseInt(e,10)}),era:Ws({matchPatterns:Ck,defaultMatchWidth:"wide",parsePatterns:Ok,defaultParseWidth:"any"}),quarter:Ws({matchPatterns:Ak,defaultMatchWidth:"wide",parsePatterns:Ek,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ws({matchPatterns:Rk,defaultMatchWidth:"wide",parsePatterns:Pk,defaultParseWidth:"any"}),day:Ws({matchPatterns:Ik,defaultMatchWidth:"wide",parsePatterns:Lk,defaultParseWidth:"any"}),dayPeriod:Ws({matchPatterns:Nk,defaultMatchWidth:"any",parsePatterns:Bk,defaultParseWidth:"any"})},bp={code:"en-US",formatDistance:ck,formatLong:hk,formatRelative:mk,localize:vk,match:Fk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zk(e,t){const n=At(e,t?.in);return fp(n,_p(n))+1}function xp(e,t){const n=At(e,t?.in),i=+Wr(n)-+FT(n);return Math.round(i/cp)+1}function Vc(e,t){const n=At(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 Uk(e,t){const n=sr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Vc(e,t),s=me(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function wp(e,t){const n=At(e,t?.in),i=+Vn(n,t)-+Uk(n,t);return Math.round(i/cp)+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"},vp={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=Vc(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=dp(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=wp(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(e,t,n){const i=xp(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=zk(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 Tp(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 Tp(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"+Sp(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"+Sp(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 Sp(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 Tp(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 kp=(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"})}},Mp=(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"})}},Yc={p:Mp,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return kp(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}}",kp(i,t)).replace("{{time}}",Mp(r,t))}},Hk=/^D+$/,Wk=/^Y+$/,$k=["D","DD","YY","YYYY"];function Dp(e){return Hk.test(e)}function Cp(e){return Wk.test(e)}function qc(e,t,n){const i=Vk(e,t,n);if(console.warn(i),$k.includes(e))throw new RangeError(i)}function Vk(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 Yk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jk=/^'([^]*?)'?$/,Gk=/''/g,Kk=/[a-zA-Z]/;function ya(e,t,n){const i=sr(),r=n?.locale??i.locale??bp,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=At(e,n?.in);if(!Hc(l))throw new RangeError("Invalid time value");let u=t.match(qk).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Yc[m];return g(h,r.formatLong)}return h}).join("").match(Yk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Xk(h)};if(vp[m])return{isToken:!0,value:h};if(m.match(Kk))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&&Cp(m)||!n?.useAdditionalDayOfYearTokens&&Dp(m))&&qc(m,t,String(e));const g=vp[m[0]];return g(l,m,r.localize,d)}).join("")}function Xk(e){const t=e.match(jk);return t?t[1].replace(Gk,"'"):e}function Op(){return Object.assign({},sr())}function Zk(e,t){const n=At(e,t?.in).getDay();return n===0?7:n}function Qk(e,t){const n=Jk(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 Jk(e){return typeof e=="function"&&e.prototype?.constructor===e}const tM=10;class Ap{subPriority=0;validate(t,n){return!0}}class eM extends Ap{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 nM extends Ap{priority=tM;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>me(n,i))}set(t,n){return n.timestampIsSet?t:me(t,Qk(t,this.context))}}class Yt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new eM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class iM extends Yt{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 _e={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*LT),rest:t.slice(n[0].length)}}function Ep(e){return he(_e.anyDigitsSigned,e)}function ge(e,t){switch(e){case 1:return he(_e.singleDigit,t);case 2:return he(_e.twoDigits,t);case 3:return he(_e.threeDigits,t);case 4:return he(_e.fourDigits,t);default:return he(new RegExp("^\\d{1,"+e+"}"),t)}}function _a(e,t){switch(e){case 1:return he(_e.singleDigitSigned,t);case 2:return he(_e.twoDigitsSigned,t);case 3:return he(_e.threeDigitsSigned,t);case 4:return he(_e.fourDigitsSigned,t);default:return he(new RegExp("^-?\\d{1,"+e+"}"),t)}}function jc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Rp(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 Pp(e){return e%400===0||e%4===0&&e%100!==0}class rM extends Yt{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=Rp(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 sM extends Yt{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=Vc(t,r);if(i.isTwoDigitYear){const l=Rp(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 oM extends Yt{priority=130;parse(t,n){return _a(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 aM extends Yt{priority=130;parse(t,n){return _a(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 lM extends Yt{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 cM extends Yt{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 uM extends Yt{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(_e.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 dM extends Yt{priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"L":return be(he(_e.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 fM(e,t,n){const i=At(e,n?.in),r=wp(i,n)-t;return i.setDate(i.getDate()-r*7),At(i,n?.in)}class hM extends Yt{priority=100;parse(t,n,i){switch(n){case"w":return he(_e.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(fM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function pM(e,t,n){const i=At(e,n?.in),r=xp(i,n)-t;return i.setDate(i.getDate()-r*7),i}class mM extends Yt{priority=100;parse(t,n,i){switch(n){case"I":return he(_e.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(pM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const gM=[31,28,31,30,31,30,31,31,30,31,30,31],yM=[31,29,31,30,31,30,31,31,30,31,30,31];class _M extends Yt{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return he(_e.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear(),r=Pp(i),s=t.getMonth();return r?n>=1&&n<=yM[s]:n>=1&&n<=gM[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 bM extends Yt{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return he(_e.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear();return Pp(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 Gc(e,t,n){const i=sr(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(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 xM extends Yt{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=Gc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class wM extends Yt{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=Gc(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 vM extends Yt{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=Gc(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 SM(e,t,n){const i=At(e,n?.in),r=Zk(i,n),s=t-r;return ma(i,s,n)}class TM extends Yt{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=SM(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 kM extends Yt{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(jc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class MM extends Yt{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(jc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class DM extends Yt{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(jc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class CM extends Yt{priority=70;parse(t,n,i){switch(n){case"h":return he(_e.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 OM extends Yt{priority=70;parse(t,n,i){switch(n){case"H":return he(_e.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 AM extends Yt{priority=70;parse(t,n,i){switch(n){case"K":return he(_e.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 EM extends Yt{priority=70;parse(t,n,i){switch(n){case"k":return he(_e.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 RM extends Yt{priority=60;parse(t,n,i){switch(n){case"m":return he(_e.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 PM extends Yt{priority=50;parse(t,n,i){switch(n){case"s":return he(_e.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 IM extends Yt{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 LM extends Yt{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 NM extends Yt{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 BM extends Yt{priority=40;parse(t){return Ep(t)}set(t,n,i){return[me(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class FM extends Yt{priority=20;parse(t){return Ep(t)}set(t,n,i){return[me(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const zM={G:new iM,y:new rM,Y:new sM,R:new oM,u:new aM,Q:new lM,q:new cM,M:new uM,L:new dM,w:new hM,I:new mM,d:new _M,D:new bM,E:new xM,e:new wM,c:new vM,i:new TM,a:new kM,b:new MM,B:new DM,h:new CM,H:new OM,K:new AM,k:new EM,m:new RM,s:new PM,S:new IM,X:new LM,x:new NM,t:new BM,T:new FM},UM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,HM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,WM=/^'([^]*?)'?$/,$M=/''/g,VM=/\S/,YM=/[a-zA-Z]/;function qM(e,t,n,i){const r=()=>me(i?.in||n,NaN),s=Op(),a=i?.locale??s.locale??bp,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():At(n,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new nM(i?.in,n)],m=t.match(HM).map(S=>{const C=S[0];if(C in Yc){const A=Yc[C];return A(S,a.formatLong)}return S}).join("").match(UM),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&Cp(S)&&qc(S,t,e),!i?.useAdditionalDayOfYearTokens&&Dp(S)&&qc(S,t,e);const C=S[0],A=zM[C];if(A){const{incompatibleTokens:F}=A;if(Array.isArray(F)){const B=g.find(N=>F.includes(N.token)||N.token===C);if(B)throw new RangeError(`The format string mustn't contain \`${B.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:C,fullToken:S});const P=A.run(e,S,a.match,d);if(!P)return r();h.push(P.setter),e=P.rest}else{if(C.match(YM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=jM(S)),e.indexOf(S)===0)e=e.slice(S.length);else return r()}}if(e.length>0&&VM.test(e))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,A)=>A.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,A)=>A.subPriority-C.subPriority)).map(S=>S[0]);let x=At(n,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function jM(e){return e.match(WM)[1].replace($M,"'")}function GM(e,t){const n=At(e,t?.in);return n.setMinutes(0,0,0),n}function KM(e,t){const n=At(e,t?.in);return n.setSeconds(0,0),n}function XM(e,t){const n=At(e,t?.in);return n.setMilliseconds(0),n}function Ip(e){const t=e/Hr;return Math.trunc(t)}function Lp(e,t){const n=()=>me(t?.in,NaN),i=t?.additionalDigits??2,r=tD(e);let s;if(r.date){const d=eD(r.date,i);s=nD(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const a=+s;let l=0,u;if(r.time&&(l=iD(r.time),isNaN(l)))return n();if(r.timezone){if(u=rD(r.timezone),isNaN(u))return n()}else{const d=new Date(a+l),h=At(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return At(a+l+u,t?.in)}const ba={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ZM=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,QM=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,JM=/^([+-])(\d{2})(?::?(\d{2}))?$/;function tD(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 eD(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 nD(e,t){if(t===null)return new Date(NaN);const n=e.match(ZM);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 cD(t,l,u)?sD(t,l,u):new Date(NaN);{const d=new Date(0);return!aD(t,s,a)||!lD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function $s(e){return e?parseInt(e):1}function iD(e){const t=e.match(QM);if(!t)return NaN;const n=Kc(t[1]),i=Kc(t[2]),r=Kc(t[3]);return uD(n,i,r)?n*Hr+i*Fs+r*1e3:NaN}function Kc(e){return e&&parseFloat(e.replace(",","."))||0}function rD(e){if(e==="Z")return 0;const t=e.match(JM);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return dD(i,r)?n*(i*Hr+r*Fs):NaN}function sD(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 oD=[31,null,31,30,31,30,31,31,30,31,30,31];function Np(e){return e%400===0||e%4===0&&e%100!==0}function aD(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(oD[t]||(Np(e)?29:28))}function lD(e,t){return t>=1&&t<=(Np(e)?366:365)}function cD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function uD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function dD(e,t){return t>=0&&t<=59}const Bp={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:"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)","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 Fp(){const e=hh.createI18n("en-us",Bp);return{i18n:e,i18nT:hh.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 zp(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},Xc=[..."0123456789ABCDEF"],fD=e=>Xc[e&15],hD=e=>Xc[(e&240)>>4]+Xc[e&15],xa=e=>(e&240)>>4===(e&15),pD=e=>xa(e.r)&&xa(e.g)&&xa(e.b)&&xa(e.a);function mD(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 gD=(e,t)=>e<255?t(e):"";function yD(e){var t=pD(e)?fD:hD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+gD(e.a,t):void 0}const _D=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Up(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 bD(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 xD(e,t,n){const i=Up(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 wD(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 Zc(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=wD(n,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Qc(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Di)}function Jc(e,t,n){return Qc(Up,e,t,n)}function vD(e,t,n){return Qc(xD,e,t,n)}function SD(e,t,n){return Qc(bD,e,t,n)}function Hp(e){return(e%360+360)%360}function TD(e){const t=_D.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ys(+t[5]):Di(+t[5]));const r=Hp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=vD(r,s,a):t[1]==="hsv"?i=SD(r,s,a):i=Jc(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function kD(e,t){var n=Zc(e);n[0]=Hp(n[0]+t),n=Jc(n),e.r=n[0],e.g=n[1],e.b=n[2]}function MD(e){if(!e)return;const t=Zc(e),n=t[0],i=zp(t[1]),r=zp(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${ii(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Wp={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"},$p={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 DD(){const e={},t=Object.keys($p),n=Object.keys(Wp);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,Wp[s]);s=parseInt($p[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let wa;function CD(e){wa||(wa=DD(),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 OD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function AD(e){const t=OD.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 ED(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const tu=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 RD(e,t,n){const i=Vr(ii(e.r)),r=Vr(ii(e.g)),s=Vr(ii(e.b));return{r:Di(tu(i+n*(Vr(ii(t.r))-i))),g:Di(tu(r+n*(Vr(ii(t.g))-r))),b:Di(tu(s+n*(Vr(ii(t.b))-s))),a:e.a+n*(t.a-e.a)}}function va(e,t,n){if(e){let i=Zc(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Jc(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Vp(e,t){return e&&Object.assign(t||{},e)}function Yp(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=Vp(e,{r:0,g:0,b:0,a:1}),t.a=Di(t.a)),t}function PD(e){return e.charAt(0)==="r"?AD(e):TD(e)}class qs{constructor(t){if(t instanceof qs)return t;const n=typeof t;let i;n==="object"?i=Yp(t):n==="string"&&(i=mD(t)||CD(t)||PD(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Vp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=Yp(t)}rgbString(){return this._valid?ED(this._rgb):void 0}hexString(){return this._valid?yD(this._rgb):void 0}hslString(){return this._valid?MD(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=RD(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 kD(this._rgb,t),this}}function ri(){}const ID=(()=>{let e=0;return()=>e++})();function Tt(e){return e==null}function Gt(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 Lt(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 Ct(e,t){return typeof e>"u"?t:e}const LD=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qp=(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(Gt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(Lt(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(Gt(e))return e.map(Ta);if(Lt(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 jp(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function ND(e,t,n,i){if(!jp(e))return;const r=t[e],s=n[e];Lt(r)&&Lt(s)?js(r,s,i):t[e]=Ta(s)}function js(e,t,n){const i=Gt(t)?t:[t],r=i.length;if(!Lt(e))return e;n=n||{};const s=n.merger||ND;let a;for(let l=0;l<r;++l){if(a=i[l],!Lt(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:BD})}function BD(e,t,n){if(!jp(e))return;const i=t[e],r=n[e];Lt(i)&&Lt(r)?Gs(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ta(r))}const Gp={"":e=>e,x:e=>e.x,y:e=>e.y};function FD(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 zD(e){const t=FD(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(Gp[t]||(Gp[t]=zD(t)))(e)}function eu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const rn=e=>typeof e<"u",sn=e=>typeof e=="function",Kp=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function UD(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Rt=Math.PI,ee=2*Rt,HD=ee+Rt,ka=Number.POSITIVE_INFINITY,nu=Rt/180,se=Rt/2,Dn=Rt/4,Ma=Rt*2/3,Oi=Math.log10,jn=Math.sign;function Ks(e,t,n){return Math.abs(e-t)<n}function Xp(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 WD(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 $D(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ai(e){return!$D(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function VD(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Zp(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*(Rt/180)}function Da(e){return e*(180/Rt)}function Qp(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*Rt&&(s+=ee),{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 YD(e,t){return(e-t+HD)%ee-Rt}function We(e){return(e%ee+ee)%ee}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 qD(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 iu(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)=>iu(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),jD=(e,t,n)=>iu(e,n,i=>e[i][t]>=n);function GD(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 Jp=["push","pop","shift","splice","unshift"];function KD(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Jp.forEach(n=>{const i="_onData"+eu(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 tm(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)&&(Jp.forEach(s=>{delete e[s]}),delete e._chartjs)}function em(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const nm=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function im(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,nm.call(window,()=>{i=!1,e.apply(t,n)}))}}function XD(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const ru=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ZD=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function rm(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:_,maxDefined:x}=a.getUserBounds();if(_){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=>!Tt(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(C=>!Tt(C[l.axis]));v+=Math.max(0,S)}s=Re(v,r,i)-r}else s=i-r}return{start:r,count:s}}function sm(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,om=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ee/n)),am=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ee/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*se)+1,easeOutSine:e=>Math.sin(e*se),easeInOutSine:e=>-.5*(Math.cos(Rt*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:om(e,.075,.3),easeOutElastic:e=>Oa(e)?e:am(e,.075,.3),easeInOutElastic(e){return Oa(e)?e:e<.5?.5*om(e*2,.1125,.45):.5+.5*am(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 su(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Aa(e){return su(e)?e:new qs(e)}function ou(e){return su(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const QD=["x","y","borderWidth","radius","tension"],JD=["color","borderColor","backgroundColor"];function tC(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:JD},numbers:{type:"number",properties:QD}}),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 eC(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const lm=new Map;function nC(e,t){t=t||{};const n=e+JSON.stringify(t);let i=lm.get(n);return i||(i=new Intl.NumberFormat(e,t),lm.set(n,i)),i}function Qs(e,t,n){return nC(t,n).format(e)}const cm={values(e){return Gt(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=iC(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?cm.numeric.call(this,e,t,n):""}};function iC(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:cm};function rC(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),au=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 lu(e,t,n){return typeof t=="string"?js(Js(e,t),n):js(Js(e,""),t)}class sC{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)=>ou(r.backgroundColor),this.hoverBorderColor=(i,r)=>ou(r.borderColor),this.hoverColor=(i,r)=>ou(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 lu(this,t,n)}get(t){return Js(this,t)}describe(t,n){return lu(au,t,n)}override(t,n){return lu(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 Lt(u)?Object.assign({},d,u):Ct(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var oe=new sC({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[tC,eC,rC]);function oC(e){return!e||Tt(e.size)||Tt(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 aC(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&&!Gt(m))a=Ra(e,r,s,a,m);else if(Gt(m))for(d=0,h=m.length;d<h;d++)g=m[d],g!=null&&!Gt(g)&&(a=Ra(e,r,s,a,g));e.restore();const _=s.length/2;if(_>n.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}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 um(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function cu(e,t,n,i){dm(e,t,n,i,null)}function dm(e,t,n,i,r){let s,a,l,u,d,h,m,g;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*nu;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(S),e.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),_){default:r?e.ellipse(n,i,r/2,v,0,0,ee):e.arc(n,i,v,0,ee),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-Rt,S-se),e.arc(n+g,i-a,d,S-se,S),e.arc(n+m,i+l,d,S,S+se),e.arc(n-g,i+a,d,S+se,S+Rt),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 lC(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 cC(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 uC(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Tt(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 dC(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 fC(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=Gt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(e.save(),e.font=r.string,uC(e,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&fC(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Tt(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,i,s.maxWidth)),e.fillText(d,n,i,s.maxWidth),dC(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*Rt,Rt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Rt,se,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,se,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-se,!0),e.lineTo(n+a.topLeft,i)}const hC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pC=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function mC(e,t){const n=(""+e).match(hC);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 gC=e=>+e||0;function uu(e,t){const n={},i=Lt(t),r=i?Object.keys(t):t,s=Lt(e)?i?a=>Ct(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=gC(s(a));return n}function fm(e){return uu(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(e){return uu(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(e){const t=fm(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(e,t){e=e||{},t=t||oe.font;let n=Ct(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ct(e.style,t.style);i&&!(""+i).match(pC)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ct(e.family,t.family),lineHeight:mC(Ct(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ct(e.weight,t.weight),string:""};return r.string=oC(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 yC(e,t,n){const{min:i,max:r}=e,s=qp(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 du(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=ym("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>du([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 pm(l,u,()=>kC(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return _m(l).includes(u)},ownKeys(l){return _m(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:hm(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 pm(s,a,()=>bC(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 hm(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:sn(n)?n:()=>n,isIndexable:sn(i)?i:()=>i}}const _C=(e,t)=>e?e+eu(t):t,fu=(e,t)=>Lt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pm(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function bC(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return sn(l)&&a.isScriptable(t)&&(l=xC(t,l,e,n)),Gt(l)&&l.length&&(l=wC(t,l,e,a.isIndexable)),fu(t,l)&&(l=jr(l,r,s&&s[t],a)),l}function xC(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),fu(e,u)&&(u=hu(r._scopes,r,e,u)),u}function wC(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(Lt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const m=hu(d,r,e,h);t.push(jr(m,s,a&&a[e],l))}}return t}function mm(e,t,n){return sn(e)?e(t,n):e}const vC=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function SC(e,t,n,i,r){for(const s of t){const a=vC(n,s);if(a){e.add(a);const l=mm(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 hu(e,t,n,i){const r=t._rootScopes,s=mm(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=gm(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=gm(l,a,s,u,i),u===null)?!1:du(Array.from(l),[""],r,s,()=>TC(t,n,i))}function gm(e,t,n,i,r){for(;n;)n=SC(e,t,n,i,r);return n}function TC(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return Gt(r)&&Lt(n)?n:r||{}}function kC(e,t,n,i){let r;for(const s of t)if(r=ym(_C(s,e),n),typeof r<"u")return fu(e,r)?hu(n,i,e,r):r}function ym(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function _m(e){let t=e._keys;return t||(t=e._keys=MC(e._scopes)),t}function MC(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 bm(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 DC=Number.EPSILON||1e-14,Gr=(e,t)=>t<e.length&&!e[t].skip&&e[t],xm=e=>e==="x"?"y":"x";function CC(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 OC(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,DC)){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 AC(e,t,n="x"){const i=xm(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 EC(e,t="x"){const n=xm(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]}OC(e,r,s),AC(e,s,t)}function Pa(e,t,n){return Math.max(Math.min(e,n),t)}function RC(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 PC(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")EC(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=CC(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&&RC(e,n)}function pu(){return typeof window<"u"&&typeof document<"u"}function mu(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 IC(e,t){return La(e).getPropertyValue(t)}const LC=["top","right","bottom","left"];function dr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=LC[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const NC=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function BC(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(NC(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}=BC(e,n),m=a.left+(h&&l.left),g=a.top+(h&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-m)/_*n.width/i),y:Math.round((d-g)/x*n.height/i)}}function FC(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&mu(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 zC(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=FC(e,t,n);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const g=dr(r,"border","width"),_=dr(r,"padding");d-=_.width+g.width,h-=_.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 wm(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 UC=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};pu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function vm(e,t){const n=IC(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 HC(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 WC(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 $C=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}}},VC=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?$C(t,n):VC()}function Sm(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 Tm(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function km(e){return e==="angle"?{between:Xs,compare:YD,normalize:We}:{between:si,compare:(t,n)=>t-n,normalize:t=>t}}function Mm({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 YC(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=km(i),u=t.length;let{start:d,end:h,loop:m}=e,g,_;if(m){for(d+=u,h+=u,g=0,_=u;g<_&&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 Dm(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:d}=km(i),{start:h,end:m,loop:g,style:_}=YC(e,t,n),x=[];let v=!1,S=null,C,A,F;const P=()=>u(r,F,C)&&l(r,F)!==0,B=()=>l(s,C)===0||u(s,F,C),N=()=>v||P(),z=()=>!v||B();for(let k=h,w=h;k<=m;++k)A=t[k%a],!A.skip&&(C=d(A[i]),C!==F&&(v=u(C,r,s),S===null&&N()&&(S=l(C,r)===0?k:w),S!==null&&z()&&(x.push(Mm({start:S,end:k,loop:g,count:a,style:_})),S=null),w=k,F=C));return S!==null&&x.push(Mm({start:S,end:m,loop:g,count:a,style:_})),x}function Cm(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Dm(i[r],e.points,t);s.length&&n.push(...s)}return n}function qC(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 jC(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 GC(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=qC(n,r,s,i);if(i===!0)return Om(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 Om(e,jC(n,a,u,d),n,t)}function Om(e,t,n,i){return!i||!i.setContext||!n?t:KC(e,t,n,i)}function KC(e,t,n,i){const r=e._chart.getContext(),s=Am(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,u=n.length,d=[];let h=s,m=t[0].start,g=m;function _(x,v,S,C){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:C}),h=C,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 C=n[g%u];S=Am(i.setContext(Ri(r,{type:"segment",p0:v,p1:C,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),XC(S,h)&&_(m,g-1,x.loop,h),v=C,h=S}m<g-1&&_(m,g-1,x.loop,h)}return d}function Am(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function XC(e,t){if(!t)return!1;const n=[],i=function(r,s){return su(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 ZC(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 Em(e,t){const n=t._clip;if(n.disabled)return!1;const i=ZC(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 QC{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=nm.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 QC;const Rm="transparent",JC={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Aa(e||Rm),r=i.valid&&Aa(t||Rm);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class tO{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||JC[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 gu{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Lt(t))return;const n=Object.keys(oe.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Lt(s))return;const a={};for(const l of n)a[l]=s[l];(Gt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=nO(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&eO(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 tO(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 eO(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 nO(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 Pm(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 iO(e,t,n){if(n===!1)return!1;const i=Pm(e,n),r=Pm(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function rO(e){let t,n,i,r;return Lt(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 Im(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 Lm(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 sO(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 oO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function aO(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 lO(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Nm(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 Bm(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=oO(s,a,i),m=t.length;let g;for(let _=0;_<m;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});g=C[d]=lO(r,h,v),g[l]=S,g._top=Nm(g,a,!0,i.type),g._bottom=Nm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function _u(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function cO(e,t){return Ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function uO(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 bu=e=>e==="reset"||e==="none",Fm=(e,t)=>t?e:Object.assign({},e),dO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Im(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,_,x)=>m==="x"?g:m==="r"?x:_,s=n.xAxisID=Ct(i.xAxisID,_u(t,"x")),a=n.yAxisID=Ct(i.yAxisID,_u(t,"y")),l=n.rAxisID=Ct(i.rAxisID,_u(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&&tm(this._data,this),t._stacked&&io(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Lt(n)){const r=this._cachedMeta;this._data=sO(n,r)}else if(i!==n){if(i){tm(i,this);const r=this._cachedMeta;io(r),r._parsed=[]}n&&Object.isExtensible(n)&&KD(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)&&(Bm(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{Gt(r[t])?g=this.parseArrayData(i,r,t,n):Lt(r[t])?g=this.parseObjectData(i,r,t,n):g=this.parsePrimitiveData(i,r,t,n);const _=()=>m[l]===null||d&&m[l]<d[l];for(h=0;h<n;++h)i._parsed[h+t]=m=g[h],u&&(_()&&(u=!1),d=m);i._sorted=u}a&&Bm(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,_,x;for(g=0,_=r;g<_;++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,_;for(h=0,m=r;h<m;++h)g=h+i,_=n[g],d[h]={x:s.parse(Ci(_,l),g),y:a.parse(Ci(_,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:Im(r,!0),values:n._stacks[t.axis]._visualValues};return Lm(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=Lm(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=dO(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:m}=aO(l);let g,_;function x(){_=r[g];const v=_[l.axis];return!le(_[t.axis])||h>v||m<v}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++g);if(s){for(g=a-1;g>=0;--g)if(!x()){this.updateRangeFromParsed(d,t,_,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=rO(Ct(this.options.clip,iO(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=uO(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=cO(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&&rn(i);if(l)return Fm(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),_=Object.keys(oe.elements[t]),x=()=>this.getContext(i,r,n),v=d.resolveNamedOptions(g,_,x,m);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(Fm(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 gu(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||bu(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){bu(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!bu(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 fO(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=em(i.sort((r,s)=>r-s))}return e._cache.$bar}function hO(e){const t=e.iScale,n=fO(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(rn(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 pO(e,t,n,i){const r=n.barThickness;let s,a;return Tt(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 mO(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 gO(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 zm(e,t,n,i){return Gt(e)?gO(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Um(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(zm(g,m,s,d));return u}function xu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function yO(e,t,n){return e!==0?jn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function _O(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 bO(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}=_O(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=d:(n._bottom||0)===i?r=h:(s[Hm(h,a,l,u)]=!0,r=d)),s[Hm(r,a,l,u)]=!0,e.borderSkipped=s}function Hm(e,t,n,i){return i?(e=xO(e,t,n),e=Wm(e,n,t)):e=Wm(e,t,n),e}function xO(e,t,n){return e===t?n:e===n?t:e}function Wm(e,t,n){return e==="start"?t:e==="end"?n:e}function wO(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class $m 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 Um(t,n,i,r)}parseArrayData(t,n,i,r){return Um(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,_,x,v;for(g=i,_=i+r;g<_;++g)v=n[g],x={},x[s.axis]=s.parse(Ci(v,d),g),m.push(zm(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=xu(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 _=n;_<n+i;_++){const x=this.getParsed(_),v=s||Tt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[l.axis],A={horizontal:d,base:v.base,enableBorderRadius:!C||xu(x._custom)||a===C._top||a===C._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(_,t[_].active?"active":r));const F=A.options||t[_].options;bO(A,F,C,a),wO(A,F,h.ratio),this.updateElement(t[_],_,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(_=>_[i.axis]===u),g=m&&m[h.vScale.axis];if(Tt(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[Ct(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||hO(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=xu(d);let m=u[n.axis],g=0,_=i?this.applyStack(n,u,i):m,x,v;_!==m&&(g=_-m,_=m),h&&(m=d.barStart,_=d.barEnd-d.barStart,m!==0&&jn(m)!==jn(d.barEnd)&&(g=0),g+=m);const S=!Tt(s)&&!h?s:g;let C=n.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=n.getPixelForValue(g+_):x=C,v=x-C,Math.abs(v)<a){v=yO(v,n,l)*a,m===l&&(C-=v/2);const A=n.getPixelForDecimal(0),F=n.getPixelForDecimal(1),P=Math.min(A,F),B=Math.max(A,F);C=Math.max(Math.min(C,B),P),x=C+v,i&&!h&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(C))}if(C===n.getPixelForValue(l)){const A=jn(v)*n.getLineWidthForValue(l)/2;C+=A,v-=A}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Ct(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"?mO(t,n,r,h*d):pO(t,n,r,h*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ct(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;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 vO 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=Ct(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=Ct(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 _=t[g],x=!s&&this.getParsed(g),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(g,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,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+=Ct(i&&i._custom,s),r}}function SO(e,t,n){let i=1,r=1,s=0,a=0;if(t<ee){const l=e,u=l+t,d=Math.cos(l),h=Math.sin(l),m=Math.cos(u),g=Math.sin(u),_=(F,P,B)=>Xs(F,l,u,!0)?1:Math.max(P,P*n,B,B*n),x=(F,P,B)=>Xs(F,l,u,!0)?-1:Math.min(P,P*n,B,B*n),v=_(0,d,m),S=_(se,h,g),C=x(Rt,d,m),A=x(Rt+se,h,g);i=(v-C)/2,r=(S-A)/2,s=-(v+C)/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(Lt(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=ee,n=-ee;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(LD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:_,offsetX:x,offsetY:v}=SO(m,h,u),S=(i.width-a)/g,C=(i.height-a)/_,A=Math.max(Math.min(S,C)/2,0),F=qp(this.options.radius,A),P=Math.max(F*u,0),B=(F-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*F,this.offsetY=v*F,r.total=this.calculateTotal(),this.outerRadius=F-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*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/ee)}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,_=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(n,r);let C=this._getRotation(),A;for(A=0;A<n;++A)C+=this._circumference(A,s);for(A=n;A<n+i;++A){const F=this._circumference(A,s),P=t[A],B={x:h+this.offsetX,y:m+this.offsetY,startAngle:C,endAngle:C+F,circumference:F,outerRadius:x,innerRadius:_};S&&(B.options=v||this.resolveDataElementOptions(A,P.active?"active":r)),C+=F,this.updateElement(P,A,B,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)?ee*(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(Ct(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Vm 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}=rm(n,r,a);this._drawStart=l,this._drawCount=u,sm(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,_=l.axis,{spanGaps:x,segment:v}=this.options,S=Ai(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",A=n+i,F=t.length;let P=n>0&&this.getParsed(n-1);for(let B=0;B<F;++B){const N=t[B],z=C?N:{};if(B<n||B>=A){z.skip=!0;continue}const k=this.getParsed(B),w=Tt(k[_]),O=z[g]=a.getPixelForValue(k[g],B),L=z[_]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,k,u):k[_],B);z.skip=isNaN(O)||isNaN(L)||w,z.stop=B>0&&Math.abs(k[g]-P[g])>S,v&&(z.parsed=k,z.raw=d.data[B]),m&&(z.options=h||this.resolveDataElementOptions(B,N.active?"active":r)),C||this.updateElement(N,B,z,r),P=k}}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 Ym 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 bm.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*Rt;let _=g,x;const v=360/this.countVisibleElements();for(x=0;x<n;++x)_+=this._computeAngle(x,r,v);for(x=n;x<n+i;x++){const S=t[x];let C=_,A=_+this._computeAngle(x,r,v),F=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(F=0),u.animateRotate&&(C=A=g));const P={x:h,y:m,innerRadius:0,outerRadius:F,startAngle:C,endAngle:A,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,P,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 TO extends ro{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class kO 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 bm.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,_={x:m,y:g,angle:h.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,_,r)}}}class qm 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}=rm(n,i,r);if(this._drawStart=s,this._drawCount=a,sm(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),_=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,C=Ai(v)?v:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let F=n>0&&this.getParsed(n-1);for(let P=n;P<n+i;++P){const B=t[P],N=this.getParsed(P),z=A?B:{},k=Tt(N[x]),w=z[_]=a.getPixelForValue(N[_],P),O=z[x]=s||k?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,N,u):N[x],P);z.skip=isNaN(w)||isNaN(O)||k,z.stop=P>0&&Math.abs(N[_]-F[_])>C,S&&(z.parsed=N,z.raw=d.data[P]),g&&(z.options=m||this.resolveDataElementOptions(P,B.active?"active":r)),A||this.updateElement(B,P,z,r),F=N}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 MO=Object.freeze({__proto__:null,BarController:$m,BubbleController:vO,DoughnutController:ro,LineController:Vm,PieController:TO,PolarAreaController:Ym,RadarController:kO,ScatterController:qm});function hr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wu{static override(t){Object.assign(wu.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 jm={_date:wu};function DO(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?jD: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),_=d(s,t,n+m);return{lo:g.lo,hi:_.hi}}}}else{const h=d(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=e,_=g.slice(0,h.lo+1).reverse().findIndex(v=>!Tt(v[m.axis]));h.lo-=Math.max(0,_);const x=g.slice(h.hi).findIndex(v=>!Tt(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}=DO(s[l],t,a,r);for(let _=m;_<=g;++_){const x=h[_];x.skip||i(x,d,_)}}}function CO(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 vu(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 OO(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 AO(e,t,n,i,r,s){let a=[];const l=CO(n);let u=Number.POSITIVE_INFINITY;function d(h,m,g){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||e.isPointInArea(x))&&!_)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 Su(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?OO(e,t,n,r):AO(e,t,n,i,r,s)}function Gm(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 Tu={evaluateInteractionItems:so,modes:{index(e,t,n,i){const r=Pi(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?vu(e,r,s,i,a):Su(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?vu(e,r,s,i,a):Su(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 vu(e,r,s,i,a)},nearest(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Su(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=Pi(t,e);return Gm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=Pi(t,e);return Gm(e,r,"y",n.intersect,i)}}};const Km=["left","top","right","bottom"];function oo(e,t){return e.filter(n=>n.pos===t)}function Xm(e,t){return e.filter(n=>Km.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 EO(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 RO(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!Km.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 PO(e,t){const n=RO(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 IO(e){const t=EO(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=Xm(t,"x"),u=Xm(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 Zm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Qm(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 LO(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Lt(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&&Qm(a,s.getPadding());const l=Math.max(0,t.outerWidth-Zm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Zm(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 NO(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 BO(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,BO(l.horizontal,t));const{same:m,other:g}=LO(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 Jm(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;rn(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;rn(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=IO(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);Qm(g,Se(i));const _=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=PO(u.concat(d),m);lo(l.fullSize,_,m,x),lo(u,_,m,x),lo(d,_,m,x)&&lo(u,_,m,x),NO(_),Jm(l.leftAndTop,_,m,x),_.x+=_.w,_.y+=_.h,Jm(l.rightAndBottom,_,m,x),e.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},te(l.chartArea,v=>{const S=v.box;Object.assign(S,e.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class tg{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 FO extends tg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fa="$chartjs",zO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},eg=e=>e===null||e==="";function UO(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",eg(r)){const s=vm(e,"width");s!==void 0&&(e.width=s)}if(eg(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=vm(e,"height");s!==void 0&&(e.height=s)}return e}const ng=UC?{passive:!0}:!1;function HO(e,t,n){e&&e.addEventListener(t,n,ng)}function WO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ng)}function $O(e,t){const n=zO[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 VO(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 YO(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 ig=0;function rg(){const e=window.devicePixelRatio;e!==ig&&(ig=e,co.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function qO(e,t){co.size||window.addEventListener("resize",rg),co.set(e,t)}function jO(e){co.delete(e),co.size||window.removeEventListener("resize",rg)}function GO(e,t,n){const i=e.canvas,r=i&&mu(i);if(!r)return;const s=im((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),qO(e,s),a}function ku(e,t,n){n&&n.disconnect(),t==="resize"&&jO(e)}function KO(e,t,n){const i=e.canvas,r=im(s=>{e.ctx!==null&&n($O(s,e))},e);return HO(i,t,r),r}class XO extends tg{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(UO(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];Tt(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:VO,detach:YO,resize:GO}[n]||KO;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:ku,detach:ku,resize:ku}[n]||WO)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return zC(t,n,i,r)}isAttached(t){const n=t&&mu(t);return!!(n&&n.isConnected)}}function ZO(e){return!pu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?FO:XO}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 QO(e,t){const n=e.options.ticks,i=JO(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?eA(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return nA(t,d,s,a/r),d;const h=tA(s,t,r);if(a>0){let m,g;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ua(t,d,h,Tt(_)?0:l-_,l),m=0,g=a-1;m<g;m++)Ua(t,d,h,s[m],s[m+1]);return Ua(t,d,h,u,Tt(_)?t.length:u+_),d}return Ua(t,d,h),d}function JO(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 tA(e,t,n){const i=iA(e),r=t.length/n;if(!i)return Math.max(r,1);const s=WD(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 eA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function nA(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=Ct(i,0),a=Math.min(Ct(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 iA(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 rA=e=>e==="left"?"right":e==="right"?"left":e,sg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,og=(e,t)=>Math.min(t||e,e);function ag(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 sA(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 oA(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 lg(e,t){if(!e.display)return 0;const n=ce(e.font,t),i=Se(e.padding);return(Gt(e.text)?e.text.length:1)*n.lineHeight+i.height}function aA(e,t){return Ri(e,{scale:t,type:"scale"})}function lA(e,t,n){return Ri(e,{tick:n,index:t,type:"tick"})}function cA(e,t,n){let i=ru(e);return(n&&t!=="right"||!n&&t==="right")&&(i=rA(i)),i}function uA(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,_,x;const v=a-r,S=l-s;if(e.isHorizontal()){if(_=$e(i,s,l),Lt(n)){const C=Object.keys(n)[0],A=n[C];x=h[C].getPixelForValue(A)+v-t}else n==="center"?x=(d.bottom+d.top)/2+v-t:x=sg(e,n,t);g=l-s}else{if(Lt(n)){const C=Object.keys(n)[0],A=n[C];_=h[C].getPixelForValue(A)-S+t}else n==="center"?_=(d.left+d.right)/2-S+t:_=sg(e,n,t);x=$e(i,a,r),m=n==="left"?-se:se}return{titleX:_,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=yC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?ag(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=QO(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=og(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,_=Re(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),m+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-uo(t.grid)-n.padding-lg(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=lg(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(),_=i.padding*2,x=ve(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*m.width+v*g.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+C+_)}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,_=0;u?d?(g=r*t.width,_=i*n.height):(g=i*t.height,_=r*n.width):s==="start"?_=n.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,_=n.width/2),this.paddingLeft=Math.max((g-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-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++)Tt(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=ag(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/og(n,i));let d=0,h=0,m,g,_,x,v,S,C,A,F,P,B;for(m=0;m<n;m+=u){if(x=t[m].label,v=this._resolveTickFontOptions(m),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},A=v.lineHeight,F=P=0,!Tt(x)&&!Gt(x))F=Ra(r,C.data,C.gc,F,x),P=A;else if(Gt(x))for(g=0,_=x.length;g<_;++g)B=x[g],!Tt(B)&&!Gt(B)&&(F=Ra(r,C.data,C.gc,F,B),P+=A);a.push(F),l.push(P),d=Math.max(F,d),h=Math.max(P,h)}oA(s,n);const N=a.indexOf(d),z=l.indexOf(h),k=w=>({width:a[w]||0,height:l[w]||0});return{first:k(0),last:k(n-1),widest:k(N),highest:k(z),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 qD(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=lA(this.getContext(),t,i))}return this.$context||(this.$context=aA(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),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(ht){return cr(i,ht,v)};let A,F,P,B,N,z,k,w,O,L,$,q;if(a==="top")A=C(this.bottom),z=this.bottom-g,w=A-S,L=C(t.top)+S,q=t.bottom;else if(a==="bottom")A=C(this.top),L=t.top,q=C(t.bottom)-S,z=A+S,w=this.top+g;else if(a==="left")A=C(this.right),N=this.right-g,k=A-S,O=C(t.left)+S,$=t.right;else if(a==="right")A=C(this.left),O=t.left,$=C(t.right)-S,N=A+S,k=this.left+g;else if(n==="x"){if(a==="center")A=C((t.top+t.bottom)/2+.5);else if(Lt(a)){const ht=Object.keys(a)[0],ut=a[ht];A=C(this.chart.scales[ht].getPixelForValue(ut))}L=t.top,q=t.bottom,z=A+S,w=z+g}else if(n==="y"){if(a==="center")A=C((t.left+t.right)/2);else if(Lt(a)){const ht=Object.keys(a)[0],ut=a[ht];A=C(this.chart.scales[ht].getPixelForValue(ut))}N=A-S,k=N-g,O=t.left,$=t.right}const st=Ct(r.ticks.maxTicksLimit,m),ct=Math.max(1,Math.ceil(m/st));for(F=0;F<m;F+=ct){const ht=this.getContext(F),ut=s.setContext(ht),vt=l.setContext(ht),at=ut.lineWidth,dt=ut.color,V=vt.dash||[],I=vt.dashOffset,W=ut.tickWidth,nt=ut.tickColor,ot=ut.tickBorderDash||[],X=ut.tickBorderDashOffset;P=sA(this,F,u),P!==void 0&&(B=cr(i,P,at),d?N=k=O=$=B:z=w=L=q=B,_.push({tx1:N,ty1:z,tx2:k,ty2:w,x1:O,y1:L,x2:$,y2:q,width:at,color:dt,borderDash:V,borderDashOffset:I,tickWidth:W,tickColor:nt,tickBorderDash:ot,tickBorderDashOffset:X}))}return this._ticksLength=m,this._borderValue=A,_}_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),_=g+h,x=m?-h:_,v=-ve(this.labelRotation),S=[];let C,A,F,P,B,N,z,k,w,O,L,$,q="middle";if(r==="top")N=this.bottom-x,z=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+x,z=this._getXAxisLabelAlignment();else if(r==="left"){const ct=this._getYAxisLabelAlignment(g);z=ct.textAlign,B=ct.x}else if(r==="right"){const ct=this._getYAxisLabelAlignment(g);z=ct.textAlign,B=ct.x}else if(n==="x"){if(r==="center")N=(t.top+t.bottom)/2+_;else if(Lt(r)){const ct=Object.keys(r)[0],ht=r[ct];N=this.chart.scales[ct].getPixelForValue(ht)+_}z=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")B=(t.left+t.right)/2-_;else if(Lt(r)){const ct=Object.keys(r)[0],ht=r[ct];B=this.chart.scales[ct].getPixelForValue(ht)}z=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(u==="start"?q="top":u==="end"&&(q="bottom"));const st=this._getLabelSizes();for(C=0,A=l.length;C<A;++C){F=l[C],P=F.label;const ct=s.setContext(this.getContext(C));k=this.getPixelForTick(C)+s.labelOffset,w=this._resolveTickFontOptions(C),O=w.lineHeight,L=Gt(P)?P.length:1;const ht=L/2,ut=ct.color,vt=ct.textStrokeColor,at=ct.textStrokeWidth;let dt=z;a?(B=k,z==="inner"&&(C===A-1?dt=this.options.reverse?"left":"right":C===0?dt=this.options.reverse?"right":"left":dt="center"),r==="top"?d==="near"||v!==0?$=-L*O+O/2:d==="center"?$=-st.highest.height/2-ht*O+O:$=-st.highest.height+O/2:d==="near"||v!==0?$=O/2:d==="center"?$=st.highest.height/2-ht*O:$=st.highest.height-L*O,m&&($*=-1),v!==0&&!ct.showLabelBackdrop&&(B+=O/2*Math.sin(v))):(N=k,$=(1-L)*O/2);let V;if(ct.showLabelBackdrop){const I=Se(ct.backdropPadding),W=st.heights[C],nt=st.widths[C];let ot=$-I.top,X=0-I.left;switch(q){case"middle":ot-=W/2;break;case"bottom":ot-=W;break}switch(z){case"center":X-=nt/2;break;case"right":X-=nt;break;case"inner":C===A-1?X-=nt:C>0&&(X-=nt/2);break}V={left:X,top:ot,width:nt+I.width,height:W+I.height,color:ct.backdropColor}}S.push({label:P,font:w,textOffset:$,options:{rotation:v,color:ut,strokeColor:vt,strokeWidth:at,textAlign:dt,textBaseline:q,translation:[B,N],backdrop:V}})}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"||Lt(n)?(u+=a.bottom,Gt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:m,rotation:g}=uA(this,u,n,l);ur(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:cA(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=Ct(t.grid&&t.grid.z,-1),r=Ct(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;hA(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,dA(t,a,i),this.override&&oe.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 oe[r]&&(delete oe[r][i],this.override&&delete lr[i])}}function dA(e,t,n){const i=js(Object.create(null),[n?oe.get(n):{},oe.get(t),e.defaults]);oe.set(t,i),e.defaultRoutes&&fA(t,e.defaultRoutes),e.descriptors&&oe.describe(t,e.descriptors)}function fA(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(".");oe.route(s,r,u,l)})}function hA(e){return"id"in e&&"defaults"in e}class pA{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=eu(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 pA;class mA{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(){Tt(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=Ct(i.options&&i.options.plugins,{}),s=gA(i);return r===!1&&!n?[]:_A(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 gA(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 yA(e,t){return!t&&e===!1?null:e===!0?{}:e}function _A(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,d=yA(i[u],r);d!==null&&s.push({plugin:l,options:bA(e.config,{plugin:l,local:n[u]},d,a)})}return s}function bA(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 Mu(e,t){const n=oe.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function xA(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function wA(e,t){return e===t?"_index_":"_value_"}function cg(e){if(e==="x"||e==="y"||e==="r")return e}function vA(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Du(e,...t){if(cg(e))return e;for(const n of t){const i=n.axis||vA(n.position)||e.length>1&&cg(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ug(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function SA(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 ug(e,"x",n[0])||ug(e,"y",n[0])}return{}}function TA(e,t){const n=lr[e.type]||{scales:{}},i=t.scales||{},r=Mu(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Lt(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=Du(a,l,SA(a,e),oe.scales[l.type]),d=wA(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||Mu(l,t),h=(lr[l]||{}).scales||{};Object.keys(h).forEach(m=>{const g=xA(m,u),_=a[g+"AxisID"]||g;s[_]=s[_]||Object.create(null),Gs(s[_],[{axis:g},i[_],h[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];Gs(l,[oe.scales[l.type],oe.scale])}),s}function dg(e){const t=e.options||(e.options={});t.plugins=Ct(t.plugins,{}),t.scales=TA(e,t)}function fg(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function kA(e){return e=e||{},e.data=fg(e.data),dg(e),e}const hg=new Map,pg=new Set;function Wa(e,t){let n=hg.get(e);return n||(n=t(),hg.set(e,n),pg.add(n)),n}const fo=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class MA{constructor(t){this._config=kA(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=fg(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(),dg(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,oe,m)),h.forEach(m=>fo(u,au,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),pg.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,lr[n]||{},oe.datasets[n]||{},{type:n},oe,au]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=mg(this._resolverCache,t,r);let u=a;if(CA(a,n)){s.$shared=!1,i=sn(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}=mg(this._resolverCache,t,i);return Lt(n)?jr(s,n,void 0,r):s}}function mg(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:du(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const DA=e=>Lt(e)&&Object.getOwnPropertyNames(e).some(t=>sn(e[t]));function CA(e,t){const{isScriptable:n,isIndexable:i}=hm(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(sn(l)||DA(l))||a&&Gt(l))return!0}return!1}var OA="4.5.1";const AA=["top","bottom","left","right","chartArea"];function gg(e,t){return e==="top"||e==="bottom"||AA.indexOf(e)===-1&&t==="x"}function yg(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function _g(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Jt(n&&n.onComplete,[e],t)}function EA(e){const t=e.chart,n=t.options.animation;Jt(n&&n.onProgress,[e],t)}function bg(e){return pu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $a={},xg=e=>{const t=bg(e);return Object.values($a).filter(n=>n.canvas===t).pop()};function RA(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 PA(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let on=class{static defaults=oe;static instances=$a;static overrides=lr;static registry=Gn;static version=OA;static getChart=xg;static register(...t){Gn.add(...t),wg()}static unregister(...t){Gn.remove(...t),wg()}constructor(t,n){const i=this.config=new MA(n),r=bg(t),s=xg(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||ZO(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=ID(),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 mA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=XD(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",_g),li.listen(this,"progress",EA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return Tt(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():wm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return um(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,wm(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=Du(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=Du(u,l),h=Ct(l.type,a.dtype);(l.position===void 0||gg(l.position,d)!==gg(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(yg("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||Mu(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}=oe.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(yg("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);(!Kp(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;RA(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(!Kp(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,sn(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(),_g({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=Em(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=Tu.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);rn(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(),um(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=UD(t),d=PA(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 wg(){return te(on.instances,e=>e._plugins.invalidate())}function IA(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-Rt/2,i+Rt/2,!0);else if(h==="bevel"){const _=2*g*g,x=-_*Math.cos(n+Rt/2)+r,v=-_*Math.sin(n+Rt/2)+s,S=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;e.lineTo(x,v),e.lineTo(S,C)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function LA(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+se,i-se),e.closePath(),e.clip()}function NA(e){return uu(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BA(e,t,n,i){const r=NA(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 _=0;const x=r-u;if(i){const ct=h>0?h-i:0,ht=m>0?m-i:0,ut=(ct+ht)/2,vt=ut!==0?x*ut/(ut+i):x;_=(x-vt)/2}const v=Math.max(.001,x*m-n/Rt)/m,S=(x-v)/2,C=u+S+_,A=r-S-_,{outerStart:F,outerEnd:P,innerStart:B,innerEnd:N}=BA(t,g,m,A-C),z=m-F,k=m-P,w=C+F/z,O=A-P/k,L=g+B,$=g+N,q=C+B/L,st=A-N/$;if(e.beginPath(),s){const ct=(w+O)/2;if(e.arc(a,l,m,w,ct),e.arc(a,l,m,ct,O),P>0){const at=Xr(k,O,a,l);e.arc(at.x,at.y,P,O,A+se)}const ht=Xr($,A,a,l);if(e.lineTo(ht.x,ht.y),N>0){const at=Xr($,st,a,l);e.arc(at.x,at.y,N,A+se,st+Math.PI)}const ut=(A-N/g+(C+B/g))/2;if(e.arc(a,l,g,A-N/g,ut,!0),e.arc(a,l,g,ut,C+B/g,!0),B>0){const at=Xr(L,q,a,l);e.arc(at.x,at.y,B,q+Math.PI,C-se)}const vt=Xr(z,C,a,l);if(e.lineTo(vt.x,vt.y),F>0){const at=Xr(z,w,a,l);e.arc(at.x,at.y,F,C-se,w)}}else{e.moveTo(a,l);const ct=Math.cos(w)*m+a,ht=Math.sin(w)*m+l;e.lineTo(ct,ht);const ut=Math.cos(O)*m+a,vt=Math.sin(O)*m+l;e.lineTo(ut,vt)}e.closePath()}function FA(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%ee||ee))}return Va(e,t,n,i,u,r),e.fill(),u}function zA(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:m,borderDashOffset:g,borderRadius:_}=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%ee||ee))}x&&LA(e,t,v),u.selfJoin&&v-a>=Rt&&_===0&&h!=="miter"&&IA(e,t,v),s||(Va(e,t,n,i,v,r),e.stroke())}class UA 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,_=Ct(m,u-l),x=Xs(s,l,u)&&l!==u,v=_>=ee||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>ee?Math.floor(i/ee):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(Rt,i||0)),d=r*u;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,FA(t,this,d,s,a),zA(t,this,d,s,a),t.restore()}}function vg(e,t,n=t){e.lineCap=Ct(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ct(n.borderDash,t.borderDash)),e.lineDashOffset=Ct(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ct(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ct(n.borderWidth,t.borderWidth),e.strokeStyle=Ct(n.borderColor,t.borderColor)}function HA(e,t,n){e.lineTo(n.x,n.y)}function WA(e){return e.stepped?lC:e.tension||e.cubicInterpolationMode==="monotone"?cC:HA}function Sg(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 $A(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=Sg(r,n,i),h=WA(s);let{move:m=!0,reverse:g}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(g?d-_:_))%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 VA(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=Sg(r,n,i),{move:u=!0,reverse:d}=i||{};let h=0,m=0,g,_,x,v,S,C;const A=P=>(a+(d?l-P:P))%s,F=()=>{v!==S&&(e.lineTo(h,S),e.lineTo(h,v),e.lineTo(h,C))};for(u&&(_=r[A(0)],e.moveTo(_.x,_.y)),g=0;g<=l;++g){if(_=r[A(g)],_.skip)continue;const P=_.x,B=_.y,N=P|0;N===x?(B<v?v=B:B>S&&(S=B),h=(m*h+P)/++m):(F(),e.lineTo(P,B),x=N,m=0,v=S=B),C=B}F()}function Cu(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?VA:$A}function YA(e){return e.stepped?HC:e.tension||e.cubicInterpolationMode==="monotone"?WC:fr}function qA(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),vg(e,t.options),e.stroke(r)}function jA(e,t,n,i){const{segments:r,options:s}=t,a=Cu(t);for(const l of r)vg(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const GA=typeof Path2D=="function";function KA(e,t,n,i){GA&&!t.options.segment?qA(e,t,n,i):jA(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;PC(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=GC(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=Cm(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=YA(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:m,end:g}=a[d],_=s[m],x=s[g];if(_===x){l.push(_);continue}const v=Math.abs((r-_[n])/(x[n]-_[n])),S=u(_,x,v,i.stepped);S[n]=t[n],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,n,i){return Cu(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=Cu(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(),KA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Tg(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class XA 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 Tg(this,t,"x",n)}inYRange(t,n){return Tg(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,cu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function kg(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 ZA(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=fm(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 QA(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||Lt(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 JA(e){const t=kg(e),n=t.right-t.left,i=t.bottom-t.top,r=ZA(e,n/2,i/2),s=QA(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 Ou(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&kg(e,i);return l&&(r||si(t,l.left,l.right))&&(s||si(n,l.top,l.bottom))}function tE(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function eE(e,t){e.rect(t.x,t.y,t.w,t.h)}function Au(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 nE 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}=JA(this),l=tE(a.radius)?qr:eE;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Au(a,n,s)),t.clip(),l(t,Au(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Au(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return Ou(this,t,n,i)}inXRange(t,n){return Ou(this,t,null,n)}inYRange(t,n){return Ou(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 iE=Object.freeze({__proto__:null,ArcElement:UA,BarElement:nE,LineElement:Ya,PointElement:XA});const Eu=["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)"],Mg=Eu.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Dg(e){return Eu[e%Eu.length]}function Cg(e){return Mg[e%Mg.length]}function rE(e,t){return e.borderColor=Dg(t),e.backgroundColor=Cg(t),++t}function sE(e,t){return e.backgroundColor=e.data.map(()=>Dg(t++)),t}function oE(e,t){return e.backgroundColor=e.data.map(()=>Cg(t++)),t}function aE(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof ro?t=sE(n,t):r instanceof Ym?t=oE(n,t):r&&(t=rE(n,t))}}function Og(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lE(e){return e&&(e.borderColor||e.backgroundColor)}function cE(){return oe.borderColor!=="rgba(0,0,0,0.1)"||oe.backgroundColor!=="rgba(0,0,0,0.1)"}var uE={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=Og(i)||lE(r)||s&&Og(s)||cE();if(!n.forceOverride&&a)return;const l=aE(e);i.forEach(l)}};function dE(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,_,x,v;for(a[u++]=e[h],m=0;m<s-2;m++){let S=0,C=0,A;const F=Math.floor((m+1)*l)+1+t,P=Math.min(Math.floor((m+2)*l)+1,n)+t,B=P-F;for(A=F;A<P;A++)S+=e[A].x,C+=e[A].y;S/=B,C/=B;const N=Math.floor(m*l)+1+t,z=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:k,y:w}=e[h];for(_=x=-1,A=N;A<z;A++)x=.5*Math.abs((k-S)*(e[A].y-w)-(k-e[A].x)*(C-w)),x>_&&(_=x,g=e[A],v=A);a[u++]=g,h=v}return a[u++]=e[d],a}function fE(e,t,n,i){let r=0,s=0,a,l,u,d,h,m,g,_,x,v;const S=[],C=t+n-1,A=e[t].x,P=e[C].x-A;for(a=t;a<t+n;++a){l=e[a],u=(l.x-A)/P*i,d=l.y;const B=u|0;if(B===h)d<x?(x=d,m=a):d>v&&(v=d,g=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!Tt(m)&&!Tt(g)){const z=Math.min(m,g),k=Math.max(m,g);z!==_&&z!==N&&S.push({...e[z],x:r}),k!==_&&k!==N&&S.push({...e[k],x:r})}a>0&&N!==_&&S.push(e[N]),S.push(l),h=B,s=0,x=v=d,m=g=_=a}}return S}function Ag(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 Eg(e){e.data.datasets.forEach(t=>{Ag(t)})}function hE(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 pE={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Eg(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}=hE(u,d);const _=n.threshold||4*i;if(g<=_){Ag(r);return}Tt(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=dE(d,m,g,i,n);break;case"min-max":x=fE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=x})},destroy(e){Eg(e)}};function mE(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=Ru(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=Cm(t,h);for(const g of m){const _=Ru(n,s[g.start],s[g.end],g.loop),x=Dm(l,r,_);for(const v of x)a.push({source:v,target:g,start:{[n]:Rg(h,_,"start",Math.max)},end:{[n]:Rg(h,_,"end",Math.min)}})}}return a}function Ru(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 gE(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 Rg(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Pg(e,t){let n=[],i=!1;return Gt(e)?(i=!0,n=e):n=gE(e,t),n.length?new Ya({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ig(e){return e&&e.fill!==!1}function yE(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 _E(e,t,n){const i=vE(e);if(Lt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return le(r)&&Math.floor(r)===r?bE(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function bE(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Lt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function wE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Lt(e)?i=e.value:i=t.getBaseValue(),i}function vE(e){const t=e.options,n=t.fill;let i=Ct(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function SE(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=TE(t,n);l.push(Pg({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++)kE(r,a[h],l)}return new Ya({points:r,options:{}})}function TE(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 kE(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=ME(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function ME(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 Lg{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:ee},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 DE(e){const{chart:t,fill:n,line:i}=e;if(le(n))return CE(t,n);if(n==="stack")return SE(e);if(n==="shape")return!0;const r=OE(e);return r instanceof Lg?r:Pg(r,i)}function CE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function OE(e){return(e.scale||{}).getPointPositionForValue?EE(e):AE(e)}function AE(e){const{scale:t={},fill:n}=e,i=xE(n,t);if(le(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function EE(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=wE(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Lg({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 Pu(e,t,n){const i=DE(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:_=m}=h||{},x=r.getDatasetMeta(s),v=Em(r,x);i&&a.points.length&&(to(e,n),RE(e,{line:a,target:i,above:g,below:_,area:n,scale:l,axis:u,clip:v}),eo(e))}function RE(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"?(Ng(e,i,a.top),Iu(e,{line:n,target:i,color:r,scale:l,property:d,clip:u}),e.restore(),e.save(),Ng(e,i,a.bottom)):d==="y"&&(Bg(e,i,a.left),Iu(e,{line:n,target:i,color:s,scale:l,property:d,clip:u}),e.restore(),e.save(),Bg(e,i,a.right),h=r)),Iu(e,{line:n,target:i,color:h,scale:l,property:d,clip:u}),e.restore()}function Ng(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 Bg(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 Iu(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=mE(n,i,r);for(const{source:d,target:h,start:m,end:g}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;e.save(),e.fillStyle=_,PE(e,a,l,x&&Ru(r,m,g)),e.beginPath();const v=!!n.pathSegment(e,d);let S;if(x){v?e.closePath():Fg(e,i,g,r);const C=!!i.pathSegment(e,h,{move:v,reverse:!0});S=v&&C,S||Fg(e,i,m,r)}e.closePath(),e.fill(S?"evenodd":"nonzero"),e.restore()}}function PE(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 Fg(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var IE={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:_E(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=yE(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&&Pu(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;Ig(s)&&Pu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Ig(i)||n.drawTime!=="beforeDatasetDraw"||Pu(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const zg=(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)}},LE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Ug 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}=zg(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,_=-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,_+=h,g++),u[v]={left:0,top:_,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,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:A,itemHeight:F}=NE(i,n,s,S,r);C>0&&_+F+2*l>h&&(m+=g+l,d.push({width:g,height:_}),x+=g+l,v++,g=_=0),u[C]={left:x,top:_,col:v,width:A,height:F},g=Math.max(g,A),_+=F+l}),m+=g,d.push({width:g,height:_}),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=oe.color,u=Kr(t.rtl,this.left,this.width),d=ce(a.font),{padding:h}=a,m=d.size,g=m/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:S}=zg(a,m),C=function(N,z,k){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const w=Ct(k.lineWidth,1);if(r.fillStyle=Ct(k.fillStyle,l),r.lineCap=Ct(k.lineCap,"butt"),r.lineDashOffset=Ct(k.lineDashOffset,0),r.lineJoin=Ct(k.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Ct(k.strokeStyle,l),r.setLineDash(Ct(k.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:w},L=u.xPlus(N,x/2),$=z+g;dm(r,O,L,$,a.pointStyleWidth&&x)}else{const O=z+Math.max((m-v)/2,0),L=u.leftForLtr(N,x),$=Ei(k.borderRadius);r.beginPath(),Object.values($).some(q=>q!==0)?qr(r,{x:L,y:O,w:x,h:v,radius:$}):r.rect(L,O,x,v),r.fill(),w!==0&&r.stroke()}r.restore()},A=function(N,z,k){ur(r,k.text,N,z+S/2,d,{strikethrough:k.hidden,textAlign:u.textAlign(k.textAlign)})},F=this.isHorizontal(),P=this._computeTitleHeight();F?_={x:$e(s,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:_={x:this.left+h,y:$e(s,this.top+P+h,this.bottom-n[0].height),line:0},Sm(this.ctx,t.textDirection);const B=S+h;this.legendItems.forEach((N,z)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const k=r.measureText(N.text).width,w=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),O=x+g+k;let L=_.x,$=_.y;u.setWidth(this.width),F?z>0&&L+O+h>this.right&&($=_.y+=B,_.line++,L=_.x=$e(s,this.left+h,this.right-i[_.line])):z>0&&$+B>this.bottom&&(L=_.x=L+n[_.line].width+h,_.line++,$=_.y=$e(s,this.top+P+h,this.bottom-n[_.line].height));const q=u.x(L);if(C(q,$,N),L=ZD(w,L+x+g,F?L+O:this.right,t.rtl),A(u.x(L),$,N),F)_.x+=O+h;else if(typeof N.text!="string"){const st=d.lineHeight;_.y+=Hg(N,st)+h}else _.y+=B}),Tm(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 _=$e(l,m,m+g);a.textAlign=s.textAlign(ru(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,ur(a,n.text,_,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(!zE(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=LE(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 NE(e,t,n,i,r){const s=BE(i,e,t,n),a=FE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function BE(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 FE(e,t,n){let i=e;return typeof t.text!="string"&&(i=Hg(t,n)),i}function Hg(e,t){const n=e.text?e.text.length:0;return t*n}function zE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var UE={id:"legend",_element:Ug,start(e,t,n){const i=e.legend=new Ug({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 Lu 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=Gt(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=Rt*-.5):(h=s-t,m=$e(l,n,r),u=Rt*.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:ru(n.align),textBaseline:"middle",translation:[a,l]})}}function HE(e,t){const n=new Lu({ctx:e.ctx,options:t,chart:e});Ve.configure(e,n,t),Ve.addBox(e,n),e.titleBlock=n}var WE={id:"title",_element:Lu,start(e,t,n){HE(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 $E={id:"subtitle",start(e,t,n){const i=new Lu({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&&(Gt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ci(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
1
|
+
(function(It,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):(It=typeof globalThis<"u"?globalThis:It||self,f(It["kong-ui-publicvitals-chart"]={},It.Vue,It.KongIcons,It["kong-ui-public-i18n"],It["kong-ui-public-analytics-metric-provider"],It.Kongponents))})(this,(function(It,f,fe,hh,er,As){"use strict";var bt=(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))(bt||{});const hx=["in","not_in","selector"],px=["empty","not_empty"],mx=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],nr=e=>e.filter(t=>t!=="time"),ph=["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"],Sc=nr(ph),gx=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],mh=[...ph,"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"],Tc=nr(mh),yx=[...gx,"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"],_x=["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"],kc=nr(_x),bx=["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"],xx=nr(bx),wx=["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"],vx=wx,Sx=["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"],Tx=nr(Sx),kx=["platform","platform_usage"],Mx=e=>kx.includes(e),Dx=[...mh.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"],Mc=nr(Dx);[...yx];const Cx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Dc=nr(Cx);new Set(Sc),new Set(Tc),new Set(kc),new Set(Mc),new Set(Dc);const gh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}],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:hx},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:px}},required:["field","operator"],additionalProperties:!1}]}});({...Si()},gh.map(e=>e.code));const Ox=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Si(Tc),Si(Sc),Si(kc),Si(Mc),Si(Dc),Si(Array.from(new Set([...xx,...vx,...Tx]))),Si([...new Set([...Tc,...Sc,...kc,...Mc,...Ox,...Dc])]);const Ax={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"}},Ex=(e,t,n)=>{let i;const r=Ax[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 Cc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Px={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ix={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Lx={date:Cc({formats:Rx,defaultWidth:"full"}),time:Cc({formats:Px,defaultWidth:"full"}),dateTime:Cc({formats:Ix,defaultWidth:"full"})},Nx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bx=(e,t,n,i)=>Nx[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 Fx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ux={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"]},Hx={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"]},Wx={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"}},$x={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"}},Vx=(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"},Yx={ordinalNumber:Vx,era:Es({values:Fx,defaultWidth:"wide"}),quarter:Es({values:zx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Es({values:Ux,defaultWidth:"wide"}),day:Es({values:Hx,defaultWidth:"wide"}),dayPeriod:Es({values:Wx,defaultWidth:"wide",formattingValues:$x,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)?jx(l,m=>m.test(a)):qx(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 qx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function jx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Gx(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 Kx=/^(\d+)(th|st|nd|rd)?/i,Xx=/\d+/i,Zx={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},Qx={any:[/^b/i,/^(a|c)/i]},Jx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tw={any:[/1/i,/2/i,/3/i,/4/i]},ew={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},nw={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]},iw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sw={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},ow={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}},aw={ordinalNumber:Gx({matchPattern:Kx,parsePattern:Xx,valueCallback:e=>parseInt(e,10)}),era:Rs({matchPatterns:Zx,defaultMatchWidth:"wide",parsePatterns:Qx,defaultParseWidth:"any"}),quarter:Rs({matchPatterns:Jx,defaultMatchWidth:"wide",parsePatterns:tw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rs({matchPatterns:ew,defaultMatchWidth:"wide",parsePatterns:nw,defaultParseWidth:"any"}),day:Rs({matchPatterns:iw,defaultMatchWidth:"wide",parsePatterns:rw,defaultParseWidth:"any"}),dayPeriod:Rs({matchPatterns:sw,defaultMatchWidth:"any",parsePatterns:ow,defaultParseWidth:"any"})},lw={code:"en-US",formatDistance:Ex,formatLong:Lx,formatRelative:Bx,localize:Yx,match:aw,options:{weekStartsOn:0,firstWeekContainsDate:1}};let cw={};function Ps(){return cw}const yh=6048e5,uw=864e5,dw=60,fw=3600,_h=Symbol.for("constructDateFrom");function Tn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&_h in e?e[_h](t):e instanceof Date?new e.constructor(t):new Date(t)}function He(e,t){return Tn(t||e,e)}function bh(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 hw(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 pw(e,t,n){const[i,r]=hw(n?.in,e,t),s=Nr(i),a=Nr(r),l=+s-bh(s),u=+a-bh(a);return Math.round((l-u)/uw)}function mw(e,t){const n=He(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function gw(e,t){const n=He(e,t?.in);return pw(n,mw(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 xh(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 yw(e,t){const n=xh(e,t),i=Tn(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),sa(i)}function _w(e,t){const n=He(e,t?.in),i=+sa(n)-+yw(n);return Math.round(i/yh)+1}function wh(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 bw(e,t){const n=Ps(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=wh(e,t),s=Tn(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ni(s,t)}function xw(e,t){const n=He(e,t?.in),i=+ni(n,t)-+bw(n,t);return Math.round(i/yh)+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"},vh={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=wh(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=xh(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=xw(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(e,t,n){const i=_w(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=gw(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 Th(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 Th(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"+Sh(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"+Sh(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 Sh(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 Th(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 kh=(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"})}},Mh=(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"})}},ww=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return kh(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}}",kh(i,t)).replace("{{time}}",Mh(r,t))},vw={p:Mh,P:ww},Sw=/^D+$/,Tw=/^Y+$/,kw=["D","DD","YY","YYYY"];function Mw(e){return Sw.test(e)}function Dw(e){return Tw.test(e)}function Cw(e,t,n){const i=Ow(e,t,n);if(console.warn(i),kw.includes(e))throw new RangeError(i)}function Ow(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 Aw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ew(e){return!(!Aw(e)&&typeof e!="number"||isNaN(+He(e)))}const Rw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Iw=/^'([^]*?)'?$/,Lw=/''/g,Nw=/[a-zA-Z]/;function Bw(e,t,n){const i=Ps(),r=n?.locale??i.locale??lw,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(!Ew(l))throw new RangeError("Invalid time value");let u=t.match(Pw).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=vw[m];return g(h,r.formatLong)}return h}).join("").match(Rw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Fw(h)};if(vh[m])return{isToken:!0,value:h};if(m.match(Nw))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&&Dw(m)||!n?.useAdditionalDayOfYearTokens&&Mw(m))&&Cw(m,t,String(e));const g=vh[m[0]];return g(l,m,r.localize,d)}).join("")}function Fw(e){const t=e.match(Iw);return t?t[1].replace(Lw,"'"):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 Dh(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 zw(e,t,n){return Dh(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 Uw(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 Hw(){return Object.assign({},Ps())}function Ch(e){return Math.trunc(e*fw)}function Ww(e){const t=e/dw;return Math.trunc(t)}function Oh(e,t,n){return Dh(e,-1,n)}function Ah(e,t,n){return zw(e,-1,n)}function Eh(e,t,n){const i=Hw(),r=Yw(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?$w(r,t):Vw(r,t)}function $w(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 Vw(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function Yw(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function qw(e,t){const n=Zw(t);return"formatToParts"in n?Gw(n,e):Kw(n,e)}const jw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Gw(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=jw[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 Kw(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 Oc={},Rh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Xw=Rh==="06/25/2014, 00:00:00"||Rh==="06/25/2014 00:00:00";function Zw(e){return Oc[e]||(Oc[e]=Xw?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"})),Oc[e]}function Ac(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 Ph=36e5,Qw=6e4,Ec={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(e,t,n){if(!e)return 0;let i=Ec.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Ec.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Ih(r)?-(r*Ph):NaN;if(i=Ec.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Ih(r,a)?(s=Math.abs(r)*Ph+a*Qw,i[1]==="+"?-s:s):NaN}if(ev(e)){t=new Date(t||Date.now());const a=n?t:Jw(t),l=Rc(a,e);return-(n?l:tv(t,l,e))}return NaN}function Jw(e){return Ac(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Rc(e,t){const n=qw(e,t),i=Ac(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 tv(e,t,n){let i=e.getTime()-t;const r=Rc(new Date(i),n);if(t===r)return t;i-=r-t;const s=Rc(new Date(i),n);return r===s?r:Math.max(r,s)}function Ih(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Lh={};function ev(e){if(Lh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Lh[e]=!0,!0}catch{return!1}}const nv=60*1e3,iv={X:function(e,t,n){const i=Pc(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Nh(i);case"XXXX":case"XX":return Ur(i);default:return Ur(i,":")}},x:function(e,t,n){const i=Pc(n.timeZone,e);switch(t){case"x":return Nh(i);case"xxxx":case"xx":return Ur(i);default:return Ur(i,":")}},O:function(e,t,n){const i=Pc(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+rv(i,":");default:return"GMT"+Ur(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Eh("short",e,n);default:return Eh("long",e,n)}}};function Pc(e,t){const n=e?Is(e,t,!0)/nv: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 Nh(e,t){return e%60===0?(e>0?"-":"+")+aa(Math.abs(e)/60,2):Ur(e,t)}function rv(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 Bh(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 Fh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ic=36e5,zh=6e4,sv=2,Ze={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:Fh};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?sv: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=ov(e),{year:r,restDateString:s}=av(i.date,n),a=lv(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=cv(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=Bh(new Date(l+u)),d=Bh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function ov(e){const t={};let n=Ze.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Ze.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Ze.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function av(e,t){if(e){const n=Ze.YYY[t],i=Ze.YYYYY[t];let r=Ze.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Ze.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 lv(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=Ze.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Wh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Ze.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return fv(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Ze.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Wh(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Ze.Www.exec(e),s)return r=parseInt(s[1],10)-1,$h(r)?Uh(t,r):new Date(NaN);if(s=Ze.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return $h(r,a)?Uh(t,r,a):new Date(NaN)}return null}function cv(e){let t,n,i=Ze.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Lc(t)?t%24*Ic:NaN;if(i=Ze.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Lc(t,n)?t%24*Ic+n*zh:NaN;if(i=Ze.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Lc(t,n,r)?t%24*Ic+n*zh+r*1e3:NaN}return null}function Uh(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 uv=[31,28,31,30,31,30,31,31,30,31,30,31],dv=[31,29,31,30,31,30,31,31,30,31,30,31];function Hh(e){return e%400===0||e%4===0&&e%100!==0}function Wh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Hh(e);if(i&&n>dv[t]||!i&&n>uv[t])return!1}return!0}function fv(e,t){if(t<1)return!1;const n=Hh(e);return!(n&&t>366||!n&&t>365)}function $h(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Lc(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const hv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function pv(e,t,n={}){t=String(t);const i=t.match(hv);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,"'"+iv[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return Bw(e,t,n)}function Vh(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 Yh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},pv(Vh(e,t,{timeZone:i.timeZone}),n,i)}function mv(e,t,n){if(typeof e=="string"&&!e.match(Fh))return la(e,{...n,timeZone:t});e=la(e,n);const i=Ac(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 gv(e,t){return-Is(e,t)}function qh(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)"),Yh(e,n,i)}function yv(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 Yh(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const _v={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&&mx.find(t=>e<=_v[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 jh;function bv(){return jh||(jh=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]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",A="[object String]",F="[object Symbol]",P="[object WeakMap]",B="[object ArrayBuffer]",N="[object DataView]",z="[object Float32Array]",k="[object Float64Array]",w="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",$="[object Uint8Array]",q="[object Uint8ClampedArray]",st="[object Uint16Array]",ct="[object Uint32Array]",ht=/[\\^$.*+?()[\]{}|]/g,ut=/\w*$/,vt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,dt={};dt[s]=dt[a]=dt[B]=dt[N]=dt[l]=dt[u]=dt[z]=dt[k]=dt[w]=dt[O]=dt[L]=dt[g]=dt[_]=dt[x]=dt[S]=dt[C]=dt[A]=dt[F]=dt[$]=dt[q]=dt[st]=dt[ct]=!0,dt[d]=dt[h]=dt[P]=!1;var V=typeof ua=="object"&&ua&&ua.Object===Object&&ua,I=typeof self=="object"&&self&&self.Object===Object&&self,W=V||I||Function("return this")(),nt=t&&!t.nodeType&&t,ot=nt&&!0&&e&&!e.nodeType&&e,X=ot&&ot.exports===nt;function tt(D,Y){return D.set(Y[0],Y[1]),D}function rt(D,Y){return D.add(Y),D}function pt(D,Y){for(var J=-1,xt=D?D.length:0;++J<xt&&Y(D[J],J,D)!==!1;);return D}function yt(D,Y){for(var J=-1,xt=Y.length,Ce=D.length;++J<xt;)D[Ce+J]=Y[J];return D}function mt(D,Y,J,xt){for(var Ce=-1,Ge=D?D.length:0;++Ce<Ge;)J=Y(J,D[Ce],Ce,D);return J}function Et(D,Y){for(var J=-1,xt=Array(D);++J<D;)xt[J]=Y(J);return xt}function zt(D,Y){return D?.[Y]}function G(D){var Y=!1;if(D!=null&&typeof D.toString!="function")try{Y=!!(D+"")}catch{}return Y}function it(D){var Y=-1,J=Array(D.size);return D.forEach(function(xt,Ce){J[++Y]=[Ce,xt]}),J}function lt(D,Y){return function(J){return D(Y(J))}}function $t(D){var Y=-1,J=Array(D.size);return D.forEach(function(xt){J[++Y]=xt}),J}var _t=Array.prototype,Vt=Function.prototype,Te=Object.prototype,ke=W["__core-js_shared__"],ae=(function(){var D=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),cn=Vt.toString,qt=Te.hasOwnProperty,Be=Te.toString,re=RegExp("^"+cn.call(qt).replace(ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=X?W.Buffer:void 0,Pe=W.Symbol,gn=W.Uint8Array,Wi=lt(Object.getPrototypeOf,Object),Cn=Object.create,je=Te.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,Oo=De?De.isBuffer:void 0,Ao=lt(Object.keys,Object),Tr=Zn(W,"DataView"),fi=Zn(W,"Map"),Eo=Zn(W,"Promise"),Ro=Zn(W,"Set"),Po=Zn(W,"WeakMap"),$i=Zn(Object,"create"),bl=pi(Tr),Od=pi(fi),Ad=pi(Eo),Ed=pi(Ro),Rd=pi(Po),Io=Pe?Pe.prototype:void 0,xl=Io?Io.valueOf:void 0;function hi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function Pd(){this.__data__=$i?$i(null):{}}function Lo(D){return this.has(D)&&delete this.__data__[D]}function Id(D){var Y=this.__data__;if($i){var J=Y[D];return J===i?void 0:J}return qt.call(Y,D)?Y[D]:void 0}function No(D){var Y=this.__data__;return $i?Y[D]!==void 0:qt.call(Y,D)}function Ld(D,Y){var J=this.__data__;return J[D]=$i&&Y===void 0?i:Y,this}hi.prototype.clear=Pd,hi.prototype.delete=Lo,hi.prototype.get=Id,hi.prototype.has=No,hi.prototype.set=Ld;function Nn(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function Nd(){this.__data__=[]}function Bd(D){var Y=this.__data__,J=kr(Y,D);if(J<0)return!1;var xt=Y.length-1;return J==xt?Y.pop():Ln.call(Y,J,1),!0}function Fd(D){var Y=this.__data__,J=kr(Y,D);return J<0?void 0:Y[J][1]}function wl(D){return kr(this.__data__,D)>-1}function zd(D,Y){var J=this.__data__,xt=kr(J,D);return xt<0?J.push([D,Y]):J[xt][1]=Y,this}Nn.prototype.clear=Nd,Nn.prototype.delete=Bd,Nn.prototype.get=Fd,Nn.prototype.has=wl,Nn.prototype.set=zd;function Vi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function vl(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function Ud(D){return Mr(this,D).delete(D)}function Hd(D){return Mr(this,D).get(D)}function Wd(D){return Mr(this,D).has(D)}function $d(D,Y){return Mr(this,D).set(D,Y),this}Vi.prototype.clear=vl,Vi.prototype.delete=Ud,Vi.prototype.get=Hd,Vi.prototype.has=Wd,Vi.prototype.set=$d;function Yi(D){this.__data__=new Nn(D)}function Vd(){this.__data__=new Nn}function ls(D){return this.__data__.delete(D)}function Yd(D){return this.__data__.get(D)}function cs(D){return this.__data__.has(D)}function qd(D,Y){var J=this.__data__;if(J instanceof Nn){var xt=J.__data__;if(!fi||xt.length<n-1)return xt.push([D,Y]),this;J=this.__data__=new Vi(xt)}return J.set(D,Y),this}Yi.prototype.clear=Vd,Yi.prototype.delete=ls,Yi.prototype.get=Yd,Yi.prototype.has=cs,Yi.prototype.set=qd;function jd(D,Y){var J=Ho(D)||Nl(D)?Et(D.length,String):[],xt=J.length,Ce=!!xt;for(var Ge in D)qt.call(D,Ge)&&!(Ce&&(Ge=="length"||Rl(Ge,xt)))&&J.push(Ge);return J}function Sl(D,Y,J){var xt=D[Y];(!(qt.call(D,Y)&&Ll(xt,J))||J===void 0&&!(Y in D))&&(D[Y]=J)}function kr(D,Y){for(var J=D.length;J--;)if(Ll(D[J][0],Y))return J;return-1}function Tl(D,Y){return D&&Fo(Y,Wo(Y),D)}function us(D,Y,J,xt,Ce,Ge,Bn){var Fe;if(xt&&(Fe=Ge?xt(D,Ce,Ge,Bn):xt(D)),Fe!==void 0)return Fe;if(!ms(D))return D;var Fl=Ho(D);if(Fl){if(Fe=Al(D),!Y)return Ol(D,Fe)}else{var ue=un(D),gs=ue==h||ue==m;if(sf(D))return Ml(D,Y);if(ue==x||ue==s||gs&&!Ge){if(G(D))return Ge?D:{};if(Fe=El(gs?{}:D),!Y)return zo(D,Tl(Fe,D))}else{if(!dt[ue])return Ge?D:{};Fe=ef(D,ue,us,Y)}}Bn||(Bn=new Yi);var Qn=Bn.get(D);if(Qn)return Qn;if(Bn.set(D,Fe),!Fl)var $o=J?tf(D):Wo(D);return pt($o||D,function(Dr,ze){$o&&(ze=Dr,Dr=D[ze]),Sl(Fe,ze,us(Dr,Y,J,xt,ze,D,Bn))}),Fe}function Gd(D){return ms(D)?Cn(D):{}}function Kd(D,Y,J){var xt=Y(D);return Ho(D)?xt:yt(xt,J(D))}function Xd(D){return Be.call(D)}function Zd(D){if(!ms(D)||Il(D))return!1;var Y=ps(D)||G(D)?re:vt;return Y.test(pi(D))}function kl(D){if(!Uo(D))return Ao(D);var Y=[];for(var J in Object(D))qt.call(D,J)&&J!="constructor"&&Y.push(J);return Y}function Ml(D,Y){if(Y)return D.slice();var J=new D.constructor(D.length);return D.copy(J),J}function ds(D){var Y=new D.constructor(D.byteLength);return new gn(Y).set(new gn(D)),Y}function Bo(D,Y){var J=Y?ds(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.byteLength)}function Qd(D,Y,J){var xt=Y?J(it(D),!0):it(D);return mt(xt,tt,new D.constructor)}function Dl(D){var Y=new D.constructor(D.source,ut.exec(D));return Y.lastIndex=D.lastIndex,Y}function fs(D,Y,J){var xt=Y?J($t(D),!0):$t(D);return mt(xt,rt,new D.constructor)}function Cl(D){return xl?Object(xl.call(D)):{}}function Jd(D,Y){var J=Y?ds(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.length)}function Ol(D,Y){var J=-1,xt=D.length;for(Y||(Y=Array(xt));++J<xt;)Y[J]=D[J];return Y}function Fo(D,Y,J,xt){J||(J={});for(var Ce=-1,Ge=Y.length;++Ce<Ge;){var Bn=Y[Ce],Fe=void 0;Sl(J,Bn,Fe===void 0?D[Bn]:Fe)}return J}function zo(D,Y){return Fo(D,hs(D),Y)}function tf(D){return Kd(D,Wo,hs)}function Mr(D,Y){var J=D.__data__;return Pl(Y)?J[typeof Y=="string"?"string":"hash"]:J.map}function Zn(D,Y){var J=zt(D,Y);return Zd(J)?J:void 0}var hs=di?lt(di,Object):lf,un=Xd;(Tr&&un(new Tr(new ArrayBuffer(1)))!=N||fi&&un(new fi)!=g||Eo&&un(Eo.resolve())!=v||Ro&&un(new Ro)!=C||Po&&un(new Po)!=P)&&(un=function(D){var Y=Be.call(D),J=Y==x?D.constructor:void 0,xt=J?pi(J):void 0;if(xt)switch(xt){case bl:return N;case Od:return g;case Ad:return v;case Ed:return C;case Rd:return P}return Y});function Al(D){var Y=D.length,J=D.constructor(Y);return Y&&typeof D[0]=="string"&&qt.call(D,"index")&&(J.index=D.index,J.input=D.input),J}function El(D){return typeof D.constructor=="function"&&!Uo(D)?Gd(Wi(D)):{}}function ef(D,Y,J,xt){var Ce=D.constructor;switch(Y){case B:return ds(D);case l:case u:return new Ce(+D);case N:return Bo(D,xt);case z:case k:case w:case O:case L:case $:case q:case st:case ct:return Jd(D,xt);case g:return Qd(D,xt,J);case _:case A:return new Ce(D);case S:return Dl(D);case C:return fs(D,xt,J);case F:return Cl(D)}}function Rl(D,Y){return Y=Y??r,!!Y&&(typeof D=="number"||at.test(D))&&D>-1&&D%1==0&&D<Y}function Pl(D){var Y=typeof D;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?D!=="__proto__":D===null}function Il(D){return!!ae&&ae in D}function Uo(D){var Y=D&&D.constructor,J=typeof Y=="function"&&Y.prototype||Te;return D===J}function pi(D){if(D!=null){try{return cn.call(D)}catch{}try{return D+""}catch{}}return""}function nf(D){return us(D,!0,!0)}function Ll(D,Y){return D===Y||D!==D&&Y!==Y}function Nl(D){return rf(D)&&qt.call(D,"callee")&&(!je.call(D,"callee")||Be.call(D)==s)}var Ho=Array.isArray;function Bl(D){return D!=null&&of(D.length)&&!ps(D)}function rf(D){return af(D)&&Bl(D)}var sf=Oo||ne;function ps(D){var Y=ms(D)?Be.call(D):"";return Y==h||Y==m}function of(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function ms(D){var Y=typeof D;return!!D&&(Y=="object"||Y=="function")}function af(D){return!!D&&typeof D=="object"}function Wo(D){return Bl(D)?jd(D):kl(D)}function lf(){return[]}function ne(){return!1}e.exports=nf})(da,da.exports)),da.exports}bv();const kn=(e,t)=>new Date(e.getTime()-gv(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=mv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Vh(n,t)}}class xv 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 wv extends Ee{rawStart(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class vv extends Ee{rawStart(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class Sv 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 Tv 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 kv extends Ee{rawEnd(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=Fr(Ah(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Mv extends Ee{rawEnd(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=zr(Oh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Dv 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}}bt.FIFTEEN_MIN,new Ee({key:bt.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"]}),bt.ONE_HOUR,new Ee({key:bt.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"]}),bt.SIX_HOUR,new Ee({key:bt.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"]}),bt.TWELVE_HOUR,new Ee({key:bt.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"]}),bt.ONE_DAY,new Ee({key:bt.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"]}),bt.SEVEN_DAY,new Ee({key:bt.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"]}),bt.THIRTY_DAY,new Ee({key:bt.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"]}),bt.NINETY_DAY,new Ee({key:bt.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"]}),bt.ONE_HUNDRED_EIGHTY_DAY,new Ee({key:bt.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"]}),bt.ONE_YEAR,new Ee({key:bt.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"]}),bt.CURRENT_WEEK,new xv({key:bt.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"]}),bt.CURRENT_MONTH,new wv({key:bt.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"]}),bt.CURRENT_QUARTER,new vv({key:bt.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"]}),bt.CURRENT_YEAR,new Sv({key:bt.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"]}),bt.PREVIOUS_WEEK,new Tv({key:bt.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"]}),bt.PREVIOUS_MONTH,new Mv({key:bt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=zr(new Date),n=zr(Oh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Gh(t,n)),3600*24*Uw(new Date().setMonth(new Date().getMonth()-1))+Ch(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_QUARTER,new kv({key:bt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date),t=Fr(Ah(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_YEAR,new Dv({key:bt.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=Gh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Ch(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gh(e,t){return Ww(e.getTimezoneOffset()-t.getTimezoneOffset())}bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.THIRTY_DAY,bt.NINETY_DAY,bt.ONE_HUNDRED_EIGHTY_DAY,bt.ONE_YEAR,bt.CURRENT_WEEK,bt.CURRENT_MONTH,bt.CURRENT_QUARTER,bt.CURRENT_YEAR,bt.PREVIOUS_WEEK,bt.PREVIOUS_MONTH,bt.PREVIOUS_QUARTER,bt.PREVIOUS_YEAR;const Cv=new Map(gh.map(e=>[e.code,{code:e.code,name:e.name}])),Nc=e=>Cv.get(e)?.name||e,Kh=1e3,Ov=1e4,Xh=1e6,Zh=1e9,Qh=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?Ov:Kh;return e<r||t.precision&&t.precision>Math.log10(e)?n=fa(Ls(e,1,t),t):e<Xh?n=`${Ls(e,Kh,t)}k`:e<Zh?n=`${Ls(e,Xh,t)}m`:e<Qh?n=`${fa(Ls(e,Zh,t),t)}b`:n=`${fa(Ls(e,Qh,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 Av=typeof document<"u"&&document.documentElement?.lang||"en-US",pa=new Intl.NumberFormat(Av);function $n({i18n:e}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,l=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let h;return i>=s?h=e.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?h=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=e.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=e.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},n=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?e.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:l=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return n(i,a);default:return isNaN(i)?`${i}`:l?`${ha(i,{capital:!0})} ${d}`:i>=.01?`${pa.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:n,formatRange:(i,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(i,a)} - ${t(r,a)}`;case"usd":return`${n(i,l)} - ${n(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${ha(i,{capital:!0})} - ${ha(r,{capital:!0})} ${h}`}const m=i>=.01?`${pa.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,g=r>=.01?`${pa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${m} - ${g} ${h}`}}}const Ev=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Rv="#0044f4",Jh="#6c7489",Pv="#d60027",Iv="#ffc400",Lv="#bee2ff",Nv="#8fc1ff",Bv="#5f9aff",Fv="#306fff",zv="#b5ffee",Uv="#00fabe",Hv="#00d6a4",Wv="#00a17b",$v="#007d60",Vv="#005944",Yv="#b5ffee",qv="#00fabe",jv="#b5ffee",Gv="#00a17b",Kv="#fff296",Xv="#ffe04b",Zv="#ffc400",Qv="#b37600",Jv="#995c00",t1="#804400",e1="#fff296",n1="#ffe04b",i1="#ffc2b3",r1="#ff9877",s1="#ff723c",o1="#f75008",a1="#d13500",l1="#a31f00",c1="#ffc2b3",u1="#ff9877",d1="#ff723c",f1="#f75008",h1="#d13500",p1="#a31f00",m1="#ffc2b3",g1="#ff9877",y1="#ff723c",_1="#f75008",b1="#d13500",x1="#a31f00",w1="#ffc2b3",v1="#ff9877",S1="#ff723c",T1="#f75008",k1="#d13500",M1="#a31f00",D1="#ffc2b3",C1="#ff9877",O1="#ff723c",A1="#f75008",E1="#d13500",R1="#ffabab",P1="#ff7272",I1="#ff3954",L1="#f50045",N1="#d60027",B1="#ad000e",F1="#ffabab",z1="#ff7272",U1="#ff3954",H1="#f50045",W1="#d60027",$1="#eefaff",V1="#ecfffb",Y1="#fffce0",q1="#fff1ef",j1="#ffe5e5",G1="#5f9aff",K1="#00d6a4",X1="#ffc400",Z1="#ff723c",Q1="#ff3954",J1={100:Lv,101:Nv,102:Bv,103:Fv,200:zv,201:Uv,202:Hv,203:Wv,204:$v,205:Vv,206:Yv,207:qv,208:jv,226:Gv,300:Kv,301:Xv,302:Zv,303:Qv,304:Jv,305:t1,307:e1,308:n1,400:i1,401:r1,402:s1,403:o1,404:a1,405:l1,406:c1,407:u1,408:d1,409:f1,410:h1,411:p1,412:m1,413:g1,414:y1,415:_1,416:b1,417:x1,418:w1,421:v1,422:S1,423:T1,424:k1,425:M1,426:D1,428:C1,429:O1,431:A1,451:E1,500:R1,501:P1,502:I1,503:L1,504:N1,505:B1,506:F1,507:z1,508:U1,510:H1,511:W1},tS={100:$1,200:V1,300:Y1,400:q1,500:j1},tp={"1XX":G1,"2XX":K1,"3XX":X1,"4XX":Z1,"5XX":Q1},eS={error:Pv,warning:Iv,empty:"#9DA99D",neutral:Jh,____OTHER____:Rv},ep=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF395D","#FF6D3C","#B3A100","#4E594E"],np=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#953042","#BF5430","#B5A72C","#4E594E"],nS=e=>Ev(e),ip=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?np[i%np.length]:ep[i%ep.length]},Ns=({state:e})=>eS[e]??Jh,iS=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return J1[n]??tS[i]??Ns({state:"neutral"})},rS=({group:e})=>tp[e]?tp[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,theme:s="light",customPalette:a=void 0})=>{if(e!==void 0)return ip({discriminator:e,theme:s,customPalette:a});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 iS({statusCode:i});if(n==="status_code_grouped")return rS({group:i})}return n||i||r?ip({discriminator:nS(`${n??""}${i??""}${r??""}`),theme:s,customPalette:a}):Ns({state:"neutral"})},rp="#d60027",sp="#ffe5e5",sS="#f1f0ff",oS="#e0e4ea",op="#6c7489",aS="#afb7c5",ap="#0d0e14",lS="#d60027",cS="#ad000e",Bc="#6c7489",lp="#52596e",uS="#007d60",dS="#995c00",fS="#ffc400",hS="'Inter', Roboto, Helvetica, sans-serif",rr="16px",pS="20px",mS="#bee2ff",gS="#8fc1ff",yS="#5f9aff",_S="#306fff",bS="#b5ffee",xS="#00fabe",wS="#00d6a4",vS="#00a17b",SS="#007d60",TS="#005944",kS="#b5ffee",MS="#00fabe",DS="#b5ffee",CS="#00a17b",OS="#fff296",AS="#ffe04b",ES="#ffc400",RS="#b37600",PS="#995c00",IS="#804400",LS="#fff296",NS="#ffe04b",BS="#ffc2b3",FS="#ff9877",zS="#ff723c",US="#f75008",HS="#d13500",WS="#a31f00",$S="#ffc2b3",VS="#ff9877",YS="#ff723c",qS="#f75008",jS="#d13500",GS="#a31f00",KS="#ffc2b3",XS="#ff9877",ZS="#ff723c",QS="#f75008",JS="#d13500",tT="#a31f00",eT="#ffc2b3",nT="#ff9877",iT="#ff723c",rT="#f75008",sT="#d13500",oT="#a31f00",aT="#ffc2b3",lT="#ff9877",cT="#ff723c",uT="#f75008",dT="#d13500",fT="#ffabab",hT="#ff7272",pT="#ff3954",mT="#f50045",gT="#d60027",yT="#ad000e",_T="#ffabab",bT="#ff7272",xT="#ff3954",wT="#f50045",vT="#d60027",ST="#eefaff",TT="#ecfffb",kT="#fffce0",MT="#fff1ef",DT="#ffe5e5",CT="#5f9aff",OT="#00d6a4",AT="#ffc400",ET="#ff723c",RT="#ff3954",cp=6048e5,PT=864e5,Fs=6e4,Hr=36e5,IT=1e3,up=Symbol.for("constructDateFrom");function me(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&up in e?e[up](t):e instanceof Date?new e.constructor(t):new Date(t)}function At(e,t){return me(t||e,e)}function ma(e,t,n){const i=At(e,n?.in);return isNaN(t)?me(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Fc(e,t,n){const i=At(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 zc(e,t,n){return me(e,+At(e)+t)}function LT(e,t,n){return zc(e,t*Hr)}let NT={};function sr(){return NT}function Vn(e,t){const n=sr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=At(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 dp(e,t){const n=At(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=At(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 Uc(e,t){const n=At(e,t?.in);return n.setHours(0,0,0,0),n}function fp(e,t,n){const[i,r]=or(n?.in,e,t),s=Uc(i),a=Uc(r),l=+s-ga(s),u=+a-ga(a);return Math.round((l-u)/PT)}function BT(e,t){const n=dp(e,t),i=me(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Wr(i)}function FT(e,t,n){const i=At(e,n?.in);return i.setTime(i.getTime()+t*Fs),i}function zT(e,t,n){return Fc(e,t*3,n)}function UT(e,t,n){return zc(e,t*1e3)}function HT(e,t,n){return ma(e,t*7,n)}function WT(e,t,n){return Fc(e,t*12,n)}function zs(e,t){const n=+At(e)-+At(t);return n<0?-1:n>0?1:n}function $T(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Hc(e){return!(!$T(e)&&typeof e!="number"||isNaN(+At(e)))}function VT(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 YT(e,t,n){const[i,r]=or(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function hp(e,t,n){const[i,r]=or(n?.in,e,t),s=pp(i,r),a=Math.abs(fp(i,r));i.setDate(i.getDate()-s*a);const l=+(pp(i,r)===-s),u=s*(a-l);return u===0?0:u}function pp(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 qT(e,t,n){const[i,r]=or(n?.in,e,t),s=(+i-+r)/Hr;return Us(n?.roundingMethod)(s)}function Wc(e,t){return+At(e)-+At(t)}function jT(e,t,n){const i=Wc(e,t)/Fs;return Us(n?.roundingMethod)(i)}function mp(e,t){const n=At(e,t?.in);return n.setHours(23,59,59,999),n}function gp(e,t){const n=At(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function GT(e,t){const n=At(e,t?.in);return+mp(n,t)==+gp(n,t)}function yp(e,t,n){const[i,r,s]=or(n?.in,e,e,t),a=zs(r,s),l=Math.abs(VT(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;GT(i)&&l===1&&zs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function KT(e,t,n){const i=yp(e,t,n)/3;return Us(n?.roundingMethod)(i)}function XT(e,t,n){const i=Wc(e,t)/1e3;return Us(n?.roundingMethod)(i)}function ZT(e,t,n){const i=hp(e,t,n)/7;return Us(n?.roundingMethod)(i)}function QT(e,t,n){const[i,r]=or(n?.in,e,t),s=zs(i,r),a=Math.abs(YT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=zs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function JT(e,t){const n=At(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function tk(e,t){const n=At(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function ek(e,t){const n=At(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function _p(e,t){const n=At(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function nk(e,t){const n=At(e,t?.in);return n.setMinutes(59,59,999),n}function ik(e,t){const n=sr(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=At(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 rk(e,t){const n=At(e,t?.in);return n.setSeconds(59,999),n}function sk(e,t){const n=At(e,t?.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function ok(e,t){const n=At(e,t?.in);return n.setMilliseconds(999),n}const ak={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"}},lk=(e,t,n)=>{let i;const r=ak[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 $c(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ck={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fk={date:$c({formats:ck,defaultWidth:"full"}),time:$c({formats:uk,defaultWidth:"full"}),dateTime:$c({formats:dk,defaultWidth:"full"})},hk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pk=(e,t,n,i)=>hk[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 mk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yk={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"]},_k={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"]},bk={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"}},xk={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"}},wk={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:mk,defaultWidth:"wide"}),quarter:Hs({values:gk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hs({values:yk,defaultWidth:"wide"}),day:Hs({values:_k,defaultWidth:"wide"}),dayPeriod:Hs({values:bk,defaultWidth:"wide",formattingValues:xk,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)?Sk(l,m=>m.test(a)):vk(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 vk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Sk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Tk(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 kk=/^(\d+)(th|st|nd|rd)?/i,Mk=/\d+/i,Dk={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},Ck={any:[/^b/i,/^(a|c)/i]},Ok={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ak={any:[/1/i,/2/i,/3/i,/4/i]},Ek={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},Rk={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]},Pk={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},Ik={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]},Lk={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},Nk={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}},Bk={ordinalNumber:Tk({matchPattern:kk,parsePattern:Mk,valueCallback:e=>parseInt(e,10)}),era:Ws({matchPatterns:Dk,defaultMatchWidth:"wide",parsePatterns:Ck,defaultParseWidth:"any"}),quarter:Ws({matchPatterns:Ok,defaultMatchWidth:"wide",parsePatterns:Ak,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ws({matchPatterns:Ek,defaultMatchWidth:"wide",parsePatterns:Rk,defaultParseWidth:"any"}),day:Ws({matchPatterns:Pk,defaultMatchWidth:"wide",parsePatterns:Ik,defaultParseWidth:"any"}),dayPeriod:Ws({matchPatterns:Lk,defaultMatchWidth:"any",parsePatterns:Nk,defaultParseWidth:"any"})},bp={code:"en-US",formatDistance:lk,formatLong:fk,formatRelative:pk,localize:wk,match:Bk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Fk(e,t){const n=At(e,t?.in);return fp(n,_p(n))+1}function xp(e,t){const n=At(e,t?.in),i=+Wr(n)-+BT(n);return Math.round(i/cp)+1}function Vc(e,t){const n=At(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 zk(e,t){const n=sr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Vc(e,t),s=me(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function wp(e,t){const n=At(e,t?.in),i=+Vn(n,t)-+zk(n,t);return Math.round(i/cp)+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"},vp={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=Vc(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=dp(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=wp(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(e,t,n){const i=xp(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=Fk(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 Tp(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 Tp(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"+Sp(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"+Sp(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 Sp(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 Tp(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 kp=(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"})}},Mp=(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"})}},Yc={p:Mp,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return kp(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}}",kp(i,t)).replace("{{time}}",Mp(r,t))}},Uk=/^D+$/,Hk=/^Y+$/,Wk=["D","DD","YY","YYYY"];function Dp(e){return Uk.test(e)}function Cp(e){return Hk.test(e)}function qc(e,t,n){const i=$k(e,t,n);if(console.warn(i),Wk.includes(e))throw new RangeError(i)}function $k(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 Vk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qk=/^'([^]*?)'?$/,jk=/''/g,Gk=/[a-zA-Z]/;function ya(e,t,n){const i=sr(),r=n?.locale??i.locale??bp,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=At(e,n?.in);if(!Hc(l))throw new RangeError("Invalid time value");let u=t.match(Yk).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Yc[m];return g(h,r.formatLong)}return h}).join("").match(Vk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Kk(h)};if(vp[m])return{isToken:!0,value:h};if(m.match(Gk))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&&Cp(m)||!n?.useAdditionalDayOfYearTokens&&Dp(m))&&qc(m,t,String(e));const g=vp[m[0]];return g(l,m,r.localize,d)}).join("")}function Kk(e){const t=e.match(qk);return t?t[1].replace(jk,"'"):e}function Op(){return Object.assign({},sr())}function Xk(e,t){const n=At(e,t?.in).getDay();return n===0?7:n}function Zk(e,t){const n=Qk(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 Qk(e){return typeof e=="function"&&e.prototype?.constructor===e}const Jk=10;class Ap{subPriority=0;validate(t,n){return!0}}class tM extends Ap{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 eM extends Ap{priority=Jk;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>me(n,i))}set(t,n){return n.timestampIsSet?t:me(t,Zk(t,this.context))}}class Yt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new tM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class nM extends Yt{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 _e={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*IT),rest:t.slice(n[0].length)}}function Ep(e){return he(_e.anyDigitsSigned,e)}function ge(e,t){switch(e){case 1:return he(_e.singleDigit,t);case 2:return he(_e.twoDigits,t);case 3:return he(_e.threeDigits,t);case 4:return he(_e.fourDigits,t);default:return he(new RegExp("^\\d{1,"+e+"}"),t)}}function _a(e,t){switch(e){case 1:return he(_e.singleDigitSigned,t);case 2:return he(_e.twoDigitsSigned,t);case 3:return he(_e.threeDigitsSigned,t);case 4:return he(_e.fourDigitsSigned,t);default:return he(new RegExp("^-?\\d{1,"+e+"}"),t)}}function jc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Rp(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 Pp(e){return e%400===0||e%4===0&&e%100!==0}class iM extends Yt{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=Rp(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 rM extends Yt{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=Vc(t,r);if(i.isTwoDigitYear){const l=Rp(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 sM extends Yt{priority=130;parse(t,n){return _a(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 oM extends Yt{priority=130;parse(t,n){return _a(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 aM extends Yt{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 lM extends Yt{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 cM extends Yt{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(_e.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 uM extends Yt{priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"L":return be(he(_e.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 dM(e,t,n){const i=At(e,n?.in),r=wp(i,n)-t;return i.setDate(i.getDate()-r*7),At(i,n?.in)}class fM extends Yt{priority=100;parse(t,n,i){switch(n){case"w":return he(_e.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(dM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function hM(e,t,n){const i=At(e,n?.in),r=xp(i,n)-t;return i.setDate(i.getDate()-r*7),i}class pM extends Yt{priority=100;parse(t,n,i){switch(n){case"I":return he(_e.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(hM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const mM=[31,28,31,30,31,30,31,31,30,31,30,31],gM=[31,29,31,30,31,30,31,31,30,31,30,31];class yM extends Yt{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return he(_e.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear(),r=Pp(i),s=t.getMonth();return r?n>=1&&n<=gM[s]:n>=1&&n<=mM[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 _M extends Yt{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return he(_e.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear();return Pp(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 Gc(e,t,n){const i=sr(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(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 bM extends Yt{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=Gc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class xM extends Yt{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=Gc(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 wM extends Yt{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=Gc(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 vM(e,t,n){const i=At(e,n?.in),r=Xk(i,n),s=t-r;return ma(i,s,n)}class SM extends Yt{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=vM(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 TM extends Yt{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(jc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class kM extends Yt{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(jc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class MM extends Yt{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(jc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class DM extends Yt{priority=70;parse(t,n,i){switch(n){case"h":return he(_e.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 CM extends Yt{priority=70;parse(t,n,i){switch(n){case"H":return he(_e.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 OM extends Yt{priority=70;parse(t,n,i){switch(n){case"K":return he(_e.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 AM extends Yt{priority=70;parse(t,n,i){switch(n){case"k":return he(_e.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 EM extends Yt{priority=60;parse(t,n,i){switch(n){case"m":return he(_e.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 RM extends Yt{priority=50;parse(t,n,i){switch(n){case"s":return he(_e.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 PM extends Yt{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 IM extends Yt{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 LM extends Yt{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 NM extends Yt{priority=40;parse(t){return Ep(t)}set(t,n,i){return[me(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class BM extends Yt{priority=20;parse(t){return Ep(t)}set(t,n,i){return[me(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const FM={G:new nM,y:new iM,Y:new rM,R:new sM,u:new oM,Q:new aM,q:new lM,M:new cM,L:new uM,w:new fM,I:new pM,d:new yM,D:new _M,E:new bM,e:new xM,c:new wM,i:new SM,a:new TM,b:new kM,B:new MM,h:new DM,H:new CM,K:new OM,k:new AM,m:new EM,s:new RM,S:new PM,X:new IM,x:new LM,t:new NM,T:new BM},zM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,UM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HM=/^'([^]*?)'?$/,WM=/''/g,$M=/\S/,VM=/[a-zA-Z]/;function YM(e,t,n,i){const r=()=>me(i?.in||n,NaN),s=Op(),a=i?.locale??s.locale??bp,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():At(n,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new eM(i?.in,n)],m=t.match(UM).map(S=>{const C=S[0];if(C in Yc){const A=Yc[C];return A(S,a.formatLong)}return S}).join("").match(zM),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&Cp(S)&&qc(S,t,e),!i?.useAdditionalDayOfYearTokens&&Dp(S)&&qc(S,t,e);const C=S[0],A=FM[C];if(A){const{incompatibleTokens:F}=A;if(Array.isArray(F)){const B=g.find(N=>F.includes(N.token)||N.token===C);if(B)throw new RangeError(`The format string mustn't contain \`${B.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:C,fullToken:S});const P=A.run(e,S,a.match,d);if(!P)return r();h.push(P.setter),e=P.rest}else{if(C.match(VM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=qM(S)),e.indexOf(S)===0)e=e.slice(S.length);else return r()}}if(e.length>0&&$M.test(e))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,A)=>A.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,A)=>A.subPriority-C.subPriority)).map(S=>S[0]);let x=At(n,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function qM(e){return e.match(HM)[1].replace(WM,"'")}function jM(e,t){const n=At(e,t?.in);return n.setMinutes(0,0,0),n}function GM(e,t){const n=At(e,t?.in);return n.setSeconds(0,0),n}function KM(e,t){const n=At(e,t?.in);return n.setMilliseconds(0),n}function Ip(e){const t=e/Hr;return Math.trunc(t)}function Lp(e,t){const n=()=>me(t?.in,NaN),i=t?.additionalDigits??2,r=JM(e);let s;if(r.date){const d=tD(r.date,i);s=eD(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const a=+s;let l=0,u;if(r.time&&(l=nD(r.time),isNaN(l)))return n();if(r.timezone){if(u=iD(r.timezone),isNaN(u))return n()}else{const d=new Date(a+l),h=At(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return At(a+l+u,t?.in)}const ba={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},XM=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ZM=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,QM=/^([+-])(\d{2})(?::?(\d{2}))?$/;function JM(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 tD(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 eD(e,t){if(t===null)return new Date(NaN);const n=e.match(XM);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 lD(t,l,u)?rD(t,l,u):new Date(NaN);{const d=new Date(0);return!oD(t,s,a)||!aD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function $s(e){return e?parseInt(e):1}function nD(e){const t=e.match(ZM);if(!t)return NaN;const n=Kc(t[1]),i=Kc(t[2]),r=Kc(t[3]);return cD(n,i,r)?n*Hr+i*Fs+r*1e3:NaN}function Kc(e){return e&&parseFloat(e.replace(",","."))||0}function iD(e){if(e==="Z")return 0;const t=e.match(QM);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return uD(i,r)?n*(i*Hr+r*Fs):NaN}function rD(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 sD=[31,null,31,30,31,30,31,31,30,31,30,31];function Np(e){return e%400===0||e%4===0&&e%100!==0}function oD(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(sD[t]||(Np(e)?29:28))}function aD(e,t){return t>=1&&t<=(Np(e)?366:365)}function lD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function cD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function uD(e,t){return t>=0&&t<=59}const Bp={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:"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)","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 Fp(){const e=hh.createI18n("en-us",Bp);return{i18n:e,i18nT:hh.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 zp(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},Xc=[..."0123456789ABCDEF"],dD=e=>Xc[e&15],fD=e=>Xc[(e&240)>>4]+Xc[e&15],xa=e=>(e&240)>>4===(e&15),hD=e=>xa(e.r)&&xa(e.g)&&xa(e.b)&&xa(e.a);function pD(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 mD=(e,t)=>e<255?t(e):"";function gD(e){var t=hD(e)?dD:fD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+mD(e.a,t):void 0}const yD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Up(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 _D(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 bD(e,t,n){const i=Up(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 xD(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 Zc(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=xD(n,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Qc(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Di)}function Jc(e,t,n){return Qc(Up,e,t,n)}function wD(e,t,n){return Qc(bD,e,t,n)}function vD(e,t,n){return Qc(_D,e,t,n)}function Hp(e){return(e%360+360)%360}function SD(e){const t=yD.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ys(+t[5]):Di(+t[5]));const r=Hp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=wD(r,s,a):t[1]==="hsv"?i=vD(r,s,a):i=Jc(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function TD(e,t){var n=Zc(e);n[0]=Hp(n[0]+t),n=Jc(n),e.r=n[0],e.g=n[1],e.b=n[2]}function kD(e){if(!e)return;const t=Zc(e),n=t[0],i=zp(t[1]),r=zp(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${ii(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Wp={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"},$p={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 MD(){const e={},t=Object.keys($p),n=Object.keys(Wp);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,Wp[s]);s=parseInt($p[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let wa;function DD(e){wa||(wa=MD(),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 CD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function OD(e){const t=CD.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 AD(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const tu=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 ED(e,t,n){const i=Vr(ii(e.r)),r=Vr(ii(e.g)),s=Vr(ii(e.b));return{r:Di(tu(i+n*(Vr(ii(t.r))-i))),g:Di(tu(r+n*(Vr(ii(t.g))-r))),b:Di(tu(s+n*(Vr(ii(t.b))-s))),a:e.a+n*(t.a-e.a)}}function va(e,t,n){if(e){let i=Zc(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Jc(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Vp(e,t){return e&&Object.assign(t||{},e)}function Yp(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=Vp(e,{r:0,g:0,b:0,a:1}),t.a=Di(t.a)),t}function RD(e){return e.charAt(0)==="r"?OD(e):SD(e)}class qs{constructor(t){if(t instanceof qs)return t;const n=typeof t;let i;n==="object"?i=Yp(t):n==="string"&&(i=pD(t)||DD(t)||RD(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Vp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=Yp(t)}rgbString(){return this._valid?AD(this._rgb):void 0}hexString(){return this._valid?gD(this._rgb):void 0}hslString(){return this._valid?kD(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=ED(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 TD(this._rgb,t),this}}function ri(){}const PD=(()=>{let e=0;return()=>e++})();function Tt(e){return e==null}function Gt(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 Lt(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 Ct(e,t){return typeof e>"u"?t:e}const ID=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qp=(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(Gt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(Lt(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(Gt(e))return e.map(Ta);if(Lt(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 jp(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function LD(e,t,n,i){if(!jp(e))return;const r=t[e],s=n[e];Lt(r)&&Lt(s)?js(r,s,i):t[e]=Ta(s)}function js(e,t,n){const i=Gt(t)?t:[t],r=i.length;if(!Lt(e))return e;n=n||{};const s=n.merger||LD;let a;for(let l=0;l<r;++l){if(a=i[l],!Lt(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:ND})}function ND(e,t,n){if(!jp(e))return;const i=t[e],r=n[e];Lt(i)&&Lt(r)?Gs(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ta(r))}const Gp={"":e=>e,x:e=>e.x,y:e=>e.y};function BD(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 FD(e){const t=BD(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(Gp[t]||(Gp[t]=FD(t)))(e)}function eu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const rn=e=>typeof e<"u",sn=e=>typeof e=="function",Kp=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function zD(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Rt=Math.PI,ee=2*Rt,UD=ee+Rt,ka=Number.POSITIVE_INFINITY,nu=Rt/180,se=Rt/2,Dn=Rt/4,Ma=Rt*2/3,Oi=Math.log10,jn=Math.sign;function Ks(e,t,n){return Math.abs(e-t)<n}function Xp(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 HD(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 WD(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ai(e){return!WD(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function $D(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Zp(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*(Rt/180)}function Da(e){return e*(180/Rt)}function Qp(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*Rt&&(s+=ee),{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 VD(e,t){return(e-t+UD)%ee-Rt}function We(e){return(e%ee+ee)%ee}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 YD(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 iu(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)=>iu(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),qD=(e,t,n)=>iu(e,n,i=>e[i][t]>=n);function jD(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 Jp=["push","pop","shift","splice","unshift"];function GD(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Jp.forEach(n=>{const i="_onData"+eu(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 tm(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)&&(Jp.forEach(s=>{delete e[s]}),delete e._chartjs)}function em(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const nm=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function im(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,nm.call(window,()=>{i=!1,e.apply(t,n)}))}}function KD(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const ru=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,XD=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function rm(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:_,maxDefined:x}=a.getUserBounds();if(_){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=>!Tt(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(C=>!Tt(C[l.axis]));v+=Math.max(0,S)}s=Re(v,r,i)-r}else s=i-r}return{start:r,count:s}}function sm(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,om=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ee/n)),am=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ee/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*se)+1,easeOutSine:e=>Math.sin(e*se),easeInOutSine:e=>-.5*(Math.cos(Rt*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:om(e,.075,.3),easeOutElastic:e=>Oa(e)?e:am(e,.075,.3),easeInOutElastic(e){return Oa(e)?e:e<.5?.5*om(e*2,.1125,.45):.5+.5*am(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 su(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Aa(e){return su(e)?e:new qs(e)}function ou(e){return su(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const ZD=["x","y","borderWidth","radius","tension"],QD=["color","borderColor","backgroundColor"];function JD(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:QD},numbers:{type:"number",properties:ZD}}),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 tC(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const lm=new Map;function eC(e,t){t=t||{};const n=e+JSON.stringify(t);let i=lm.get(n);return i||(i=new Intl.NumberFormat(e,t),lm.set(n,i)),i}function Qs(e,t,n){return eC(t,n).format(e)}const cm={values(e){return Gt(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=nC(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?cm.numeric.call(this,e,t,n):""}};function nC(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:cm};function iC(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),au=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 lu(e,t,n){return typeof t=="string"?js(Js(e,t),n):js(Js(e,""),t)}class rC{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)=>ou(r.backgroundColor),this.hoverBorderColor=(i,r)=>ou(r.borderColor),this.hoverColor=(i,r)=>ou(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 lu(this,t,n)}get(t){return Js(this,t)}describe(t,n){return lu(au,t,n)}override(t,n){return lu(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 Lt(u)?Object.assign({},d,u):Ct(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var oe=new rC({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[JD,tC,iC]);function sC(e){return!e||Tt(e.size)||Tt(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 oC(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&&!Gt(m))a=Ra(e,r,s,a,m);else if(Gt(m))for(d=0,h=m.length;d<h;d++)g=m[d],g!=null&&!Gt(g)&&(a=Ra(e,r,s,a,g));e.restore();const _=s.length/2;if(_>n.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}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 um(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function cu(e,t,n,i){dm(e,t,n,i,null)}function dm(e,t,n,i,r){let s,a,l,u,d,h,m,g;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*nu;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(S),e.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),_){default:r?e.ellipse(n,i,r/2,v,0,0,ee):e.arc(n,i,v,0,ee),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-Rt,S-se),e.arc(n+g,i-a,d,S-se,S),e.arc(n+m,i+l,d,S,S+se),e.arc(n-g,i+a,d,S+se,S+Rt),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 aC(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 lC(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 cC(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Tt(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 uC(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 dC(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=Gt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(e.save(),e.font=r.string,cC(e,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&dC(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Tt(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,i,s.maxWidth)),e.fillText(d,n,i,s.maxWidth),uC(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*Rt,Rt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Rt,se,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,se,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-se,!0),e.lineTo(n+a.topLeft,i)}const fC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,hC=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pC(e,t){const n=(""+e).match(fC);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 mC=e=>+e||0;function uu(e,t){const n={},i=Lt(t),r=i?Object.keys(t):t,s=Lt(e)?i?a=>Ct(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=mC(s(a));return n}function fm(e){return uu(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(e){return uu(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(e){const t=fm(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(e,t){e=e||{},t=t||oe.font;let n=Ct(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ct(e.style,t.style);i&&!(""+i).match(hC)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ct(e.family,t.family),lineHeight:pC(Ct(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ct(e.weight,t.weight),string:""};return r.string=sC(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 gC(e,t,n){const{min:i,max:r}=e,s=qp(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 du(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=ym("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>du([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 pm(l,u,()=>TC(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return _m(l).includes(u)},ownKeys(l){return _m(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:hm(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 pm(s,a,()=>_C(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 hm(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:sn(n)?n:()=>n,isIndexable:sn(i)?i:()=>i}}const yC=(e,t)=>e?e+eu(t):t,fu=(e,t)=>Lt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pm(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function _C(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return sn(l)&&a.isScriptable(t)&&(l=bC(t,l,e,n)),Gt(l)&&l.length&&(l=xC(t,l,e,a.isIndexable)),fu(t,l)&&(l=jr(l,r,s&&s[t],a)),l}function bC(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),fu(e,u)&&(u=hu(r._scopes,r,e,u)),u}function xC(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(Lt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const m=hu(d,r,e,h);t.push(jr(m,s,a&&a[e],l))}}return t}function mm(e,t,n){return sn(e)?e(t,n):e}const wC=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function vC(e,t,n,i,r){for(const s of t){const a=wC(n,s);if(a){e.add(a);const l=mm(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 hu(e,t,n,i){const r=t._rootScopes,s=mm(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=gm(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=gm(l,a,s,u,i),u===null)?!1:du(Array.from(l),[""],r,s,()=>SC(t,n,i))}function gm(e,t,n,i,r){for(;n;)n=vC(e,t,n,i,r);return n}function SC(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return Gt(r)&&Lt(n)?n:r||{}}function TC(e,t,n,i){let r;for(const s of t)if(r=ym(yC(s,e),n),typeof r<"u")return fu(e,r)?hu(n,i,e,r):r}function ym(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function _m(e){let t=e._keys;return t||(t=e._keys=kC(e._scopes)),t}function kC(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 bm(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 MC=Number.EPSILON||1e-14,Gr=(e,t)=>t<e.length&&!e[t].skip&&e[t],xm=e=>e==="x"?"y":"x";function DC(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 CC(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,MC)){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 OC(e,t,n="x"){const i=xm(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 AC(e,t="x"){const n=xm(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]}CC(e,r,s),OC(e,s,t)}function Pa(e,t,n){return Math.max(Math.min(e,n),t)}function EC(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 RC(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")AC(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=DC(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&&EC(e,n)}function pu(){return typeof window<"u"&&typeof document<"u"}function mu(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 PC(e,t){return La(e).getPropertyValue(t)}const IC=["top","right","bottom","left"];function dr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=IC[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const LC=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function NC(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(LC(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}=NC(e,n),m=a.left+(h&&l.left),g=a.top+(h&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-m)/_*n.width/i),y:Math.round((d-g)/x*n.height/i)}}function BC(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&mu(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 FC(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=BC(e,t,n);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const g=dr(r,"border","width"),_=dr(r,"padding");d-=_.width+g.width,h-=_.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 wm(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 zC=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};pu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function vm(e,t){const n=PC(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 UC(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 HC(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 WC=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}}},$C=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?WC(t,n):$C()}function Sm(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 Tm(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function km(e){return e==="angle"?{between:Xs,compare:VD,normalize:We}:{between:si,compare:(t,n)=>t-n,normalize:t=>t}}function Mm({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 VC(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=km(i),u=t.length;let{start:d,end:h,loop:m}=e,g,_;if(m){for(d+=u,h+=u,g=0,_=u;g<_&&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 Dm(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:d}=km(i),{start:h,end:m,loop:g,style:_}=VC(e,t,n),x=[];let v=!1,S=null,C,A,F;const P=()=>u(r,F,C)&&l(r,F)!==0,B=()=>l(s,C)===0||u(s,F,C),N=()=>v||P(),z=()=>!v||B();for(let k=h,w=h;k<=m;++k)A=t[k%a],!A.skip&&(C=d(A[i]),C!==F&&(v=u(C,r,s),S===null&&N()&&(S=l(C,r)===0?k:w),S!==null&&z()&&(x.push(Mm({start:S,end:k,loop:g,count:a,style:_})),S=null),w=k,F=C));return S!==null&&x.push(Mm({start:S,end:m,loop:g,count:a,style:_})),x}function Cm(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Dm(i[r],e.points,t);s.length&&n.push(...s)}return n}function YC(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 qC(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 jC(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=YC(n,r,s,i);if(i===!0)return Om(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 Om(e,qC(n,a,u,d),n,t)}function Om(e,t,n,i){return!i||!i.setContext||!n?t:GC(e,t,n,i)}function GC(e,t,n,i){const r=e._chart.getContext(),s=Am(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,u=n.length,d=[];let h=s,m=t[0].start,g=m;function _(x,v,S,C){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:C}),h=C,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 C=n[g%u];S=Am(i.setContext(Ri(r,{type:"segment",p0:v,p1:C,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),KC(S,h)&&_(m,g-1,x.loop,h),v=C,h=S}m<g-1&&_(m,g-1,x.loop,h)}return d}function Am(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function KC(e,t){if(!t)return!1;const n=[],i=function(r,s){return su(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 XC(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 Em(e,t){const n=t._clip;if(n.disabled)return!1;const i=XC(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 ZC{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=nm.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 ZC;const Rm="transparent",QC={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Aa(e||Rm),r=i.valid&&Aa(t||Rm);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class JC{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||QC[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 gu{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Lt(t))return;const n=Object.keys(oe.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Lt(s))return;const a={};for(const l of n)a[l]=s[l];(Gt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=eO(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&tO(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 JC(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 tO(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 eO(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 Pm(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 nO(e,t,n){if(n===!1)return!1;const i=Pm(e,n),r=Pm(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function iO(e){let t,n,i,r;return Lt(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 Im(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 Lm(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 rO(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 sO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function oO(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 aO(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Nm(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 Bm(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=sO(s,a,i),m=t.length;let g;for(let _=0;_<m;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});g=C[d]=aO(r,h,v),g[l]=S,g._top=Nm(g,a,!0,i.type),g._bottom=Nm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function _u(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function lO(e,t){return Ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function cO(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 bu=e=>e==="reset"||e==="none",Fm=(e,t)=>t?e:Object.assign({},e),uO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Im(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,_,x)=>m==="x"?g:m==="r"?x:_,s=n.xAxisID=Ct(i.xAxisID,_u(t,"x")),a=n.yAxisID=Ct(i.yAxisID,_u(t,"y")),l=n.rAxisID=Ct(i.rAxisID,_u(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&&tm(this._data,this),t._stacked&&io(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Lt(n)){const r=this._cachedMeta;this._data=rO(n,r)}else if(i!==n){if(i){tm(i,this);const r=this._cachedMeta;io(r),r._parsed=[]}n&&Object.isExtensible(n)&&GD(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)&&(Bm(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{Gt(r[t])?g=this.parseArrayData(i,r,t,n):Lt(r[t])?g=this.parseObjectData(i,r,t,n):g=this.parsePrimitiveData(i,r,t,n);const _=()=>m[l]===null||d&&m[l]<d[l];for(h=0;h<n;++h)i._parsed[h+t]=m=g[h],u&&(_()&&(u=!1),d=m);i._sorted=u}a&&Bm(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,_,x;for(g=0,_=r;g<_;++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,_;for(h=0,m=r;h<m;++h)g=h+i,_=n[g],d[h]={x:s.parse(Ci(_,l),g),y:a.parse(Ci(_,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:Im(r,!0),values:n._stacks[t.axis]._visualValues};return Lm(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=Lm(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=uO(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:m}=oO(l);let g,_;function x(){_=r[g];const v=_[l.axis];return!le(_[t.axis])||h>v||m<v}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++g);if(s){for(g=a-1;g>=0;--g)if(!x()){this.updateRangeFromParsed(d,t,_,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=iO(Ct(this.options.clip,nO(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=cO(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=lO(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&&rn(i);if(l)return Fm(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),_=Object.keys(oe.elements[t]),x=()=>this.getContext(i,r,n),v=d.resolveNamedOptions(g,_,x,m);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(Fm(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 gu(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||bu(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){bu(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!bu(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 dO(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=em(i.sort((r,s)=>r-s))}return e._cache.$bar}function fO(e){const t=e.iScale,n=dO(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(rn(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 hO(e,t,n,i){const r=n.barThickness;let s,a;return Tt(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 pO(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 mO(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 zm(e,t,n,i){return Gt(e)?mO(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Um(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(zm(g,m,s,d));return u}function xu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function gO(e,t,n){return e!==0?jn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function yO(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 _O(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}=yO(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=d:(n._bottom||0)===i?r=h:(s[Hm(h,a,l,u)]=!0,r=d)),s[Hm(r,a,l,u)]=!0,e.borderSkipped=s}function Hm(e,t,n,i){return i?(e=bO(e,t,n),e=Wm(e,n,t)):e=Wm(e,t,n),e}function bO(e,t,n){return e===t?n:e===n?t:e}function Wm(e,t,n){return e==="start"?t:e==="end"?n:e}function xO(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class $m 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 Um(t,n,i,r)}parseArrayData(t,n,i,r){return Um(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,_,x,v;for(g=i,_=i+r;g<_;++g)v=n[g],x={},x[s.axis]=s.parse(Ci(v,d),g),m.push(zm(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=xu(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 _=n;_<n+i;_++){const x=this.getParsed(_),v=s||Tt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[l.axis],A={horizontal:d,base:v.base,enableBorderRadius:!C||xu(x._custom)||a===C._top||a===C._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(_,t[_].active?"active":r));const F=A.options||t[_].options;_O(A,F,C,a),xO(A,F,h.ratio),this.updateElement(t[_],_,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(_=>_[i.axis]===u),g=m&&m[h.vScale.axis];if(Tt(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[Ct(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||fO(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=xu(d);let m=u[n.axis],g=0,_=i?this.applyStack(n,u,i):m,x,v;_!==m&&(g=_-m,_=m),h&&(m=d.barStart,_=d.barEnd-d.barStart,m!==0&&jn(m)!==jn(d.barEnd)&&(g=0),g+=m);const S=!Tt(s)&&!h?s:g;let C=n.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=n.getPixelForValue(g+_):x=C,v=x-C,Math.abs(v)<a){v=gO(v,n,l)*a,m===l&&(C-=v/2);const A=n.getPixelForDecimal(0),F=n.getPixelForDecimal(1),P=Math.min(A,F),B=Math.max(A,F);C=Math.max(Math.min(C,B),P),x=C+v,i&&!h&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(C))}if(C===n.getPixelForValue(l)){const A=jn(v)*n.getLineWidthForValue(l)/2;C+=A,v-=A}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Ct(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"?pO(t,n,r,h*d):hO(t,n,r,h*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ct(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;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 wO 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=Ct(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=Ct(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 _=t[g],x=!s&&this.getParsed(g),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(g,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,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+=Ct(i&&i._custom,s),r}}function vO(e,t,n){let i=1,r=1,s=0,a=0;if(t<ee){const l=e,u=l+t,d=Math.cos(l),h=Math.sin(l),m=Math.cos(u),g=Math.sin(u),_=(F,P,B)=>Xs(F,l,u,!0)?1:Math.max(P,P*n,B,B*n),x=(F,P,B)=>Xs(F,l,u,!0)?-1:Math.min(P,P*n,B,B*n),v=_(0,d,m),S=_(se,h,g),C=x(Rt,d,m),A=x(Rt+se,h,g);i=(v-C)/2,r=(S-A)/2,s=-(v+C)/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(Lt(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=ee,n=-ee;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(ID(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:_,offsetX:x,offsetY:v}=vO(m,h,u),S=(i.width-a)/g,C=(i.height-a)/_,A=Math.max(Math.min(S,C)/2,0),F=qp(this.options.radius,A),P=Math.max(F*u,0),B=(F-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*F,this.offsetY=v*F,r.total=this.calculateTotal(),this.outerRadius=F-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*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/ee)}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,_=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(n,r);let C=this._getRotation(),A;for(A=0;A<n;++A)C+=this._circumference(A,s);for(A=n;A<n+i;++A){const F=this._circumference(A,s),P=t[A],B={x:h+this.offsetX,y:m+this.offsetY,startAngle:C,endAngle:C+F,circumference:F,outerRadius:x,innerRadius:_};S&&(B.options=v||this.resolveDataElementOptions(A,P.active?"active":r)),C+=F,this.updateElement(P,A,B,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)?ee*(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(Ct(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Vm 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}=rm(n,r,a);this._drawStart=l,this._drawCount=u,sm(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,_=l.axis,{spanGaps:x,segment:v}=this.options,S=Ai(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",A=n+i,F=t.length;let P=n>0&&this.getParsed(n-1);for(let B=0;B<F;++B){const N=t[B],z=C?N:{};if(B<n||B>=A){z.skip=!0;continue}const k=this.getParsed(B),w=Tt(k[_]),O=z[g]=a.getPixelForValue(k[g],B),L=z[_]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,k,u):k[_],B);z.skip=isNaN(O)||isNaN(L)||w,z.stop=B>0&&Math.abs(k[g]-P[g])>S,v&&(z.parsed=k,z.raw=d.data[B]),m&&(z.options=h||this.resolveDataElementOptions(B,N.active?"active":r)),C||this.updateElement(N,B,z,r),P=k}}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 Ym 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 bm.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*Rt;let _=g,x;const v=360/this.countVisibleElements();for(x=0;x<n;++x)_+=this._computeAngle(x,r,v);for(x=n;x<n+i;x++){const S=t[x];let C=_,A=_+this._computeAngle(x,r,v),F=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(F=0),u.animateRotate&&(C=A=g));const P={x:h,y:m,innerRadius:0,outerRadius:F,startAngle:C,endAngle:A,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,P,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 SO extends ro{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class TO 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 bm.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,_={x:m,y:g,angle:h.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,_,r)}}}class qm 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}=rm(n,i,r);if(this._drawStart=s,this._drawCount=a,sm(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),_=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,C=Ai(v)?v:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let F=n>0&&this.getParsed(n-1);for(let P=n;P<n+i;++P){const B=t[P],N=this.getParsed(P),z=A?B:{},k=Tt(N[x]),w=z[_]=a.getPixelForValue(N[_],P),O=z[x]=s||k?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,N,u):N[x],P);z.skip=isNaN(w)||isNaN(O)||k,z.stop=P>0&&Math.abs(N[_]-F[_])>C,S&&(z.parsed=N,z.raw=d.data[P]),g&&(z.options=m||this.resolveDataElementOptions(P,B.active?"active":r)),A||this.updateElement(B,P,z,r),F=N}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 kO=Object.freeze({__proto__:null,BarController:$m,BubbleController:wO,DoughnutController:ro,LineController:Vm,PieController:SO,PolarAreaController:Ym,RadarController:TO,ScatterController:qm});function hr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wu{static override(t){Object.assign(wu.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 jm={_date:wu};function MO(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?qD: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),_=d(s,t,n+m);return{lo:g.lo,hi:_.hi}}}}else{const h=d(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=e,_=g.slice(0,h.lo+1).reverse().findIndex(v=>!Tt(v[m.axis]));h.lo-=Math.max(0,_);const x=g.slice(h.hi).findIndex(v=>!Tt(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}=MO(s[l],t,a,r);for(let _=m;_<=g;++_){const x=h[_];x.skip||i(x,d,_)}}}function DO(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 vu(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 CO(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 OO(e,t,n,i,r,s){let a=[];const l=DO(n);let u=Number.POSITIVE_INFINITY;function d(h,m,g){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||e.isPointInArea(x))&&!_)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 Su(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?CO(e,t,n,r):OO(e,t,n,i,r,s)}function Gm(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 Tu={evaluateInteractionItems:so,modes:{index(e,t,n,i){const r=Pi(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?vu(e,r,s,i,a):Su(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?vu(e,r,s,i,a):Su(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 vu(e,r,s,i,a)},nearest(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Su(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=Pi(t,e);return Gm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=Pi(t,e);return Gm(e,r,"y",n.intersect,i)}}};const Km=["left","top","right","bottom"];function oo(e,t){return e.filter(n=>n.pos===t)}function Xm(e,t){return e.filter(n=>Km.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 AO(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 EO(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!Km.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 RO(e,t){const n=EO(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 PO(e){const t=AO(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=Xm(t,"x"),u=Xm(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 Zm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Qm(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 IO(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Lt(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&&Qm(a,s.getPadding());const l=Math.max(0,t.outerWidth-Zm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Zm(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 LO(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 NO(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,NO(l.horizontal,t));const{same:m,other:g}=IO(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 Jm(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;rn(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;rn(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=PO(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);Qm(g,Se(i));const _=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=RO(u.concat(d),m);lo(l.fullSize,_,m,x),lo(u,_,m,x),lo(d,_,m,x)&&lo(u,_,m,x),LO(_),Jm(l.leftAndTop,_,m,x),_.x+=_.w,_.y+=_.h,Jm(l.rightAndBottom,_,m,x),e.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},te(l.chartArea,v=>{const S=v.box;Object.assign(S,e.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class tg{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 BO extends tg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fa="$chartjs",FO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},eg=e=>e===null||e==="";function zO(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",eg(r)){const s=vm(e,"width");s!==void 0&&(e.width=s)}if(eg(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=vm(e,"height");s!==void 0&&(e.height=s)}return e}const ng=zC?{passive:!0}:!1;function UO(e,t,n){e&&e.addEventListener(t,n,ng)}function HO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ng)}function WO(e,t){const n=FO[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 $O(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 VO(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 ig=0;function rg(){const e=window.devicePixelRatio;e!==ig&&(ig=e,co.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function YO(e,t){co.size||window.addEventListener("resize",rg),co.set(e,t)}function qO(e){co.delete(e),co.size||window.removeEventListener("resize",rg)}function jO(e,t,n){const i=e.canvas,r=i&&mu(i);if(!r)return;const s=im((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),YO(e,s),a}function ku(e,t,n){n&&n.disconnect(),t==="resize"&&qO(e)}function GO(e,t,n){const i=e.canvas,r=im(s=>{e.ctx!==null&&n(WO(s,e))},e);return UO(i,t,r),r}class KO extends tg{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(zO(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];Tt(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:$O,detach:VO,resize:jO}[n]||GO;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:ku,detach:ku,resize:ku}[n]||HO)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return FC(t,n,i,r)}isAttached(t){const n=t&&mu(t);return!!(n&&n.isConnected)}}function XO(e){return!pu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?BO:KO}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 ZO(e,t){const n=e.options.ticks,i=QO(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?tA(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return eA(t,d,s,a/r),d;const h=JO(s,t,r);if(a>0){let m,g;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ua(t,d,h,Tt(_)?0:l-_,l),m=0,g=a-1;m<g;m++)Ua(t,d,h,s[m],s[m+1]);return Ua(t,d,h,u,Tt(_)?t.length:u+_),d}return Ua(t,d,h),d}function QO(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 JO(e,t,n){const i=nA(e),r=t.length/n;if(!i)return Math.max(r,1);const s=HD(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 tA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function eA(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=Ct(i,0),a=Math.min(Ct(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 nA(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 iA=e=>e==="left"?"right":e==="right"?"left":e,sg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,og=(e,t)=>Math.min(t||e,e);function ag(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 rA(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 sA(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 lg(e,t){if(!e.display)return 0;const n=ce(e.font,t),i=Se(e.padding);return(Gt(e.text)?e.text.length:1)*n.lineHeight+i.height}function oA(e,t){return Ri(e,{scale:t,type:"scale"})}function aA(e,t,n){return Ri(e,{tick:n,index:t,type:"tick"})}function lA(e,t,n){let i=ru(e);return(n&&t!=="right"||!n&&t==="right")&&(i=iA(i)),i}function cA(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,_,x;const v=a-r,S=l-s;if(e.isHorizontal()){if(_=$e(i,s,l),Lt(n)){const C=Object.keys(n)[0],A=n[C];x=h[C].getPixelForValue(A)+v-t}else n==="center"?x=(d.bottom+d.top)/2+v-t:x=sg(e,n,t);g=l-s}else{if(Lt(n)){const C=Object.keys(n)[0],A=n[C];_=h[C].getPixelForValue(A)-S+t}else n==="center"?_=(d.left+d.right)/2-S+t:_=sg(e,n,t);x=$e(i,a,r),m=n==="left"?-se:se}return{titleX:_,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=gC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?ag(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=ZO(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=og(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,_=Re(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),m+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-uo(t.grid)-n.padding-lg(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=lg(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(),_=i.padding*2,x=ve(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*m.width+v*g.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+C+_)}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,_=0;u?d?(g=r*t.width,_=i*n.height):(g=i*t.height,_=r*n.width):s==="start"?_=n.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,_=n.width/2),this.paddingLeft=Math.max((g-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-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++)Tt(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=ag(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/og(n,i));let d=0,h=0,m,g,_,x,v,S,C,A,F,P,B;for(m=0;m<n;m+=u){if(x=t[m].label,v=this._resolveTickFontOptions(m),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},A=v.lineHeight,F=P=0,!Tt(x)&&!Gt(x))F=Ra(r,C.data,C.gc,F,x),P=A;else if(Gt(x))for(g=0,_=x.length;g<_;++g)B=x[g],!Tt(B)&&!Gt(B)&&(F=Ra(r,C.data,C.gc,F,B),P+=A);a.push(F),l.push(P),d=Math.max(F,d),h=Math.max(P,h)}sA(s,n);const N=a.indexOf(d),z=l.indexOf(h),k=w=>({width:a[w]||0,height:l[w]||0});return{first:k(0),last:k(n-1),widest:k(N),highest:k(z),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 YD(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=aA(this.getContext(),t,i))}return this.$context||(this.$context=oA(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),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(ht){return cr(i,ht,v)};let A,F,P,B,N,z,k,w,O,L,$,q;if(a==="top")A=C(this.bottom),z=this.bottom-g,w=A-S,L=C(t.top)+S,q=t.bottom;else if(a==="bottom")A=C(this.top),L=t.top,q=C(t.bottom)-S,z=A+S,w=this.top+g;else if(a==="left")A=C(this.right),N=this.right-g,k=A-S,O=C(t.left)+S,$=t.right;else if(a==="right")A=C(this.left),O=t.left,$=C(t.right)-S,N=A+S,k=this.left+g;else if(n==="x"){if(a==="center")A=C((t.top+t.bottom)/2+.5);else if(Lt(a)){const ht=Object.keys(a)[0],ut=a[ht];A=C(this.chart.scales[ht].getPixelForValue(ut))}L=t.top,q=t.bottom,z=A+S,w=z+g}else if(n==="y"){if(a==="center")A=C((t.left+t.right)/2);else if(Lt(a)){const ht=Object.keys(a)[0],ut=a[ht];A=C(this.chart.scales[ht].getPixelForValue(ut))}N=A-S,k=N-g,O=t.left,$=t.right}const st=Ct(r.ticks.maxTicksLimit,m),ct=Math.max(1,Math.ceil(m/st));for(F=0;F<m;F+=ct){const ht=this.getContext(F),ut=s.setContext(ht),vt=l.setContext(ht),at=ut.lineWidth,dt=ut.color,V=vt.dash||[],I=vt.dashOffset,W=ut.tickWidth,nt=ut.tickColor,ot=ut.tickBorderDash||[],X=ut.tickBorderDashOffset;P=rA(this,F,u),P!==void 0&&(B=cr(i,P,at),d?N=k=O=$=B:z=w=L=q=B,_.push({tx1:N,ty1:z,tx2:k,ty2:w,x1:O,y1:L,x2:$,y2:q,width:at,color:dt,borderDash:V,borderDashOffset:I,tickWidth:W,tickColor:nt,tickBorderDash:ot,tickBorderDashOffset:X}))}return this._ticksLength=m,this._borderValue=A,_}_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),_=g+h,x=m?-h:_,v=-ve(this.labelRotation),S=[];let C,A,F,P,B,N,z,k,w,O,L,$,q="middle";if(r==="top")N=this.bottom-x,z=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+x,z=this._getXAxisLabelAlignment();else if(r==="left"){const ct=this._getYAxisLabelAlignment(g);z=ct.textAlign,B=ct.x}else if(r==="right"){const ct=this._getYAxisLabelAlignment(g);z=ct.textAlign,B=ct.x}else if(n==="x"){if(r==="center")N=(t.top+t.bottom)/2+_;else if(Lt(r)){const ct=Object.keys(r)[0],ht=r[ct];N=this.chart.scales[ct].getPixelForValue(ht)+_}z=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")B=(t.left+t.right)/2-_;else if(Lt(r)){const ct=Object.keys(r)[0],ht=r[ct];B=this.chart.scales[ct].getPixelForValue(ht)}z=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(u==="start"?q="top":u==="end"&&(q="bottom"));const st=this._getLabelSizes();for(C=0,A=l.length;C<A;++C){F=l[C],P=F.label;const ct=s.setContext(this.getContext(C));k=this.getPixelForTick(C)+s.labelOffset,w=this._resolveTickFontOptions(C),O=w.lineHeight,L=Gt(P)?P.length:1;const ht=L/2,ut=ct.color,vt=ct.textStrokeColor,at=ct.textStrokeWidth;let dt=z;a?(B=k,z==="inner"&&(C===A-1?dt=this.options.reverse?"left":"right":C===0?dt=this.options.reverse?"right":"left":dt="center"),r==="top"?d==="near"||v!==0?$=-L*O+O/2:d==="center"?$=-st.highest.height/2-ht*O+O:$=-st.highest.height+O/2:d==="near"||v!==0?$=O/2:d==="center"?$=st.highest.height/2-ht*O:$=st.highest.height-L*O,m&&($*=-1),v!==0&&!ct.showLabelBackdrop&&(B+=O/2*Math.sin(v))):(N=k,$=(1-L)*O/2);let V;if(ct.showLabelBackdrop){const I=Se(ct.backdropPadding),W=st.heights[C],nt=st.widths[C];let ot=$-I.top,X=0-I.left;switch(q){case"middle":ot-=W/2;break;case"bottom":ot-=W;break}switch(z){case"center":X-=nt/2;break;case"right":X-=nt;break;case"inner":C===A-1?X-=nt:C>0&&(X-=nt/2);break}V={left:X,top:ot,width:nt+I.width,height:W+I.height,color:ct.backdropColor}}S.push({label:P,font:w,textOffset:$,options:{rotation:v,color:ut,strokeColor:vt,strokeWidth:at,textAlign:dt,textBaseline:q,translation:[B,N],backdrop:V}})}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"||Lt(n)?(u+=a.bottom,Gt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:m,rotation:g}=cA(this,u,n,l);ur(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:lA(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=Ct(t.grid&&t.grid.z,-1),r=Ct(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;fA(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,uA(t,a,i),this.override&&oe.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 oe[r]&&(delete oe[r][i],this.override&&delete lr[i])}}function uA(e,t,n){const i=js(Object.create(null),[n?oe.get(n):{},oe.get(t),e.defaults]);oe.set(t,i),e.defaultRoutes&&dA(t,e.defaultRoutes),e.descriptors&&oe.describe(t,e.descriptors)}function dA(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(".");oe.route(s,r,u,l)})}function fA(e){return"id"in e&&"defaults"in e}class hA{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=eu(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 hA;class pA{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(){Tt(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=Ct(i.options&&i.options.plugins,{}),s=mA(i);return r===!1&&!n?[]:yA(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 mA(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 gA(e,t){return!t&&e===!1?null:e===!0?{}:e}function yA(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,d=gA(i[u],r);d!==null&&s.push({plugin:l,options:_A(e.config,{plugin:l,local:n[u]},d,a)})}return s}function _A(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 Mu(e,t){const n=oe.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function bA(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function xA(e,t){return e===t?"_index_":"_value_"}function cg(e){if(e==="x"||e==="y"||e==="r")return e}function wA(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Du(e,...t){if(cg(e))return e;for(const n of t){const i=n.axis||wA(n.position)||e.length>1&&cg(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ug(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function vA(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 ug(e,"x",n[0])||ug(e,"y",n[0])}return{}}function SA(e,t){const n=lr[e.type]||{scales:{}},i=t.scales||{},r=Mu(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Lt(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=Du(a,l,vA(a,e),oe.scales[l.type]),d=xA(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||Mu(l,t),h=(lr[l]||{}).scales||{};Object.keys(h).forEach(m=>{const g=bA(m,u),_=a[g+"AxisID"]||g;s[_]=s[_]||Object.create(null),Gs(s[_],[{axis:g},i[_],h[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];Gs(l,[oe.scales[l.type],oe.scale])}),s}function dg(e){const t=e.options||(e.options={});t.plugins=Ct(t.plugins,{}),t.scales=SA(e,t)}function fg(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TA(e){return e=e||{},e.data=fg(e.data),dg(e),e}const hg=new Map,pg=new Set;function Wa(e,t){let n=hg.get(e);return n||(n=t(),hg.set(e,n),pg.add(n)),n}const fo=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class kA{constructor(t){this._config=TA(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=fg(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(),dg(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,oe,m)),h.forEach(m=>fo(u,au,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),pg.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,lr[n]||{},oe.datasets[n]||{},{type:n},oe,au]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=mg(this._resolverCache,t,r);let u=a;if(DA(a,n)){s.$shared=!1,i=sn(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}=mg(this._resolverCache,t,i);return Lt(n)?jr(s,n,void 0,r):s}}function mg(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:du(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const MA=e=>Lt(e)&&Object.getOwnPropertyNames(e).some(t=>sn(e[t]));function DA(e,t){const{isScriptable:n,isIndexable:i}=hm(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(sn(l)||MA(l))||a&&Gt(l))return!0}return!1}var CA="4.5.1";const OA=["top","bottom","left","right","chartArea"];function gg(e,t){return e==="top"||e==="bottom"||OA.indexOf(e)===-1&&t==="x"}function yg(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function _g(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Jt(n&&n.onComplete,[e],t)}function AA(e){const t=e.chart,n=t.options.animation;Jt(n&&n.onProgress,[e],t)}function bg(e){return pu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $a={},xg=e=>{const t=bg(e);return Object.values($a).filter(n=>n.canvas===t).pop()};function EA(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 RA(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let on=class{static defaults=oe;static instances=$a;static overrides=lr;static registry=Gn;static version=CA;static getChart=xg;static register(...t){Gn.add(...t),wg()}static unregister(...t){Gn.remove(...t),wg()}constructor(t,n){const i=this.config=new kA(n),r=bg(t),s=xg(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||XO(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=PD(),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 pA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=KD(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",_g),li.listen(this,"progress",AA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return Tt(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():wm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return um(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,wm(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=Du(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=Du(u,l),h=Ct(l.type,a.dtype);(l.position===void 0||gg(l.position,d)!==gg(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(yg("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||Mu(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}=oe.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(yg("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);(!Kp(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;EA(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(!Kp(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,sn(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(),_g({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=Em(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=Tu.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);rn(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(),um(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=zD(t),d=RA(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 wg(){return te(on.instances,e=>e._plugins.invalidate())}function PA(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-Rt/2,i+Rt/2,!0);else if(h==="bevel"){const _=2*g*g,x=-_*Math.cos(n+Rt/2)+r,v=-_*Math.sin(n+Rt/2)+s,S=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;e.lineTo(x,v),e.lineTo(S,C)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function IA(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+se,i-se),e.closePath(),e.clip()}function LA(e){return uu(e,["outerStart","outerEnd","innerStart","innerEnd"])}function NA(e,t,n,i){const r=LA(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 _=0;const x=r-u;if(i){const ct=h>0?h-i:0,ht=m>0?m-i:0,ut=(ct+ht)/2,vt=ut!==0?x*ut/(ut+i):x;_=(x-vt)/2}const v=Math.max(.001,x*m-n/Rt)/m,S=(x-v)/2,C=u+S+_,A=r-S-_,{outerStart:F,outerEnd:P,innerStart:B,innerEnd:N}=NA(t,g,m,A-C),z=m-F,k=m-P,w=C+F/z,O=A-P/k,L=g+B,$=g+N,q=C+B/L,st=A-N/$;if(e.beginPath(),s){const ct=(w+O)/2;if(e.arc(a,l,m,w,ct),e.arc(a,l,m,ct,O),P>0){const at=Xr(k,O,a,l);e.arc(at.x,at.y,P,O,A+se)}const ht=Xr($,A,a,l);if(e.lineTo(ht.x,ht.y),N>0){const at=Xr($,st,a,l);e.arc(at.x,at.y,N,A+se,st+Math.PI)}const ut=(A-N/g+(C+B/g))/2;if(e.arc(a,l,g,A-N/g,ut,!0),e.arc(a,l,g,ut,C+B/g,!0),B>0){const at=Xr(L,q,a,l);e.arc(at.x,at.y,B,q+Math.PI,C-se)}const vt=Xr(z,C,a,l);if(e.lineTo(vt.x,vt.y),F>0){const at=Xr(z,w,a,l);e.arc(at.x,at.y,F,C-se,w)}}else{e.moveTo(a,l);const ct=Math.cos(w)*m+a,ht=Math.sin(w)*m+l;e.lineTo(ct,ht);const ut=Math.cos(O)*m+a,vt=Math.sin(O)*m+l;e.lineTo(ut,vt)}e.closePath()}function BA(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%ee||ee))}return Va(e,t,n,i,u,r),e.fill(),u}function FA(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:m,borderDashOffset:g,borderRadius:_}=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%ee||ee))}x&&IA(e,t,v),u.selfJoin&&v-a>=Rt&&_===0&&h!=="miter"&&PA(e,t,v),s||(Va(e,t,n,i,v,r),e.stroke())}class zA 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,_=Ct(m,u-l),x=Xs(s,l,u)&&l!==u,v=_>=ee||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>ee?Math.floor(i/ee):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(Rt,i||0)),d=r*u;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,BA(t,this,d,s,a),FA(t,this,d,s,a),t.restore()}}function vg(e,t,n=t){e.lineCap=Ct(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ct(n.borderDash,t.borderDash)),e.lineDashOffset=Ct(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ct(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ct(n.borderWidth,t.borderWidth),e.strokeStyle=Ct(n.borderColor,t.borderColor)}function UA(e,t,n){e.lineTo(n.x,n.y)}function HA(e){return e.stepped?aC:e.tension||e.cubicInterpolationMode==="monotone"?lC:UA}function Sg(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 WA(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=Sg(r,n,i),h=HA(s);let{move:m=!0,reverse:g}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(g?d-_:_))%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 $A(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=Sg(r,n,i),{move:u=!0,reverse:d}=i||{};let h=0,m=0,g,_,x,v,S,C;const A=P=>(a+(d?l-P:P))%s,F=()=>{v!==S&&(e.lineTo(h,S),e.lineTo(h,v),e.lineTo(h,C))};for(u&&(_=r[A(0)],e.moveTo(_.x,_.y)),g=0;g<=l;++g){if(_=r[A(g)],_.skip)continue;const P=_.x,B=_.y,N=P|0;N===x?(B<v?v=B:B>S&&(S=B),h=(m*h+P)/++m):(F(),e.lineTo(P,B),x=N,m=0,v=S=B),C=B}F()}function Cu(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?$A:WA}function VA(e){return e.stepped?UC:e.tension||e.cubicInterpolationMode==="monotone"?HC:fr}function YA(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),vg(e,t.options),e.stroke(r)}function qA(e,t,n,i){const{segments:r,options:s}=t,a=Cu(t);for(const l of r)vg(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const jA=typeof Path2D=="function";function GA(e,t,n,i){jA&&!t.options.segment?YA(e,t,n,i):qA(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;RC(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=jC(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=Cm(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=VA(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:m,end:g}=a[d],_=s[m],x=s[g];if(_===x){l.push(_);continue}const v=Math.abs((r-_[n])/(x[n]-_[n])),S=u(_,x,v,i.stepped);S[n]=t[n],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,n,i){return Cu(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=Cu(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(),GA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Tg(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class KA 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 Tg(this,t,"x",n)}inYRange(t,n){return Tg(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,cu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function kg(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 XA(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=fm(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 ZA(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||Lt(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 QA(e){const t=kg(e),n=t.right-t.left,i=t.bottom-t.top,r=XA(e,n/2,i/2),s=ZA(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 Ou(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&kg(e,i);return l&&(r||si(t,l.left,l.right))&&(s||si(n,l.top,l.bottom))}function JA(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function tE(e,t){e.rect(t.x,t.y,t.w,t.h)}function Au(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 eE 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}=QA(this),l=JA(a.radius)?qr:tE;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Au(a,n,s)),t.clip(),l(t,Au(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Au(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return Ou(this,t,n,i)}inXRange(t,n){return Ou(this,t,null,n)}inYRange(t,n){return Ou(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 nE=Object.freeze({__proto__:null,ArcElement:zA,BarElement:eE,LineElement:Ya,PointElement:KA});const Eu=["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)"],Mg=Eu.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Dg(e){return Eu[e%Eu.length]}function Cg(e){return Mg[e%Mg.length]}function iE(e,t){return e.borderColor=Dg(t),e.backgroundColor=Cg(t),++t}function rE(e,t){return e.backgroundColor=e.data.map(()=>Dg(t++)),t}function sE(e,t){return e.backgroundColor=e.data.map(()=>Cg(t++)),t}function oE(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof ro?t=rE(n,t):r instanceof Ym?t=sE(n,t):r&&(t=iE(n,t))}}function Og(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function aE(e){return e&&(e.borderColor||e.backgroundColor)}function lE(){return oe.borderColor!=="rgba(0,0,0,0.1)"||oe.backgroundColor!=="rgba(0,0,0,0.1)"}var cE={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=Og(i)||aE(r)||s&&Og(s)||lE();if(!n.forceOverride&&a)return;const l=oE(e);i.forEach(l)}};function uE(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,_,x,v;for(a[u++]=e[h],m=0;m<s-2;m++){let S=0,C=0,A;const F=Math.floor((m+1)*l)+1+t,P=Math.min(Math.floor((m+2)*l)+1,n)+t,B=P-F;for(A=F;A<P;A++)S+=e[A].x,C+=e[A].y;S/=B,C/=B;const N=Math.floor(m*l)+1+t,z=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:k,y:w}=e[h];for(_=x=-1,A=N;A<z;A++)x=.5*Math.abs((k-S)*(e[A].y-w)-(k-e[A].x)*(C-w)),x>_&&(_=x,g=e[A],v=A);a[u++]=g,h=v}return a[u++]=e[d],a}function dE(e,t,n,i){let r=0,s=0,a,l,u,d,h,m,g,_,x,v;const S=[],C=t+n-1,A=e[t].x,P=e[C].x-A;for(a=t;a<t+n;++a){l=e[a],u=(l.x-A)/P*i,d=l.y;const B=u|0;if(B===h)d<x?(x=d,m=a):d>v&&(v=d,g=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!Tt(m)&&!Tt(g)){const z=Math.min(m,g),k=Math.max(m,g);z!==_&&z!==N&&S.push({...e[z],x:r}),k!==_&&k!==N&&S.push({...e[k],x:r})}a>0&&N!==_&&S.push(e[N]),S.push(l),h=B,s=0,x=v=d,m=g=_=a}}return S}function Ag(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 Eg(e){e.data.datasets.forEach(t=>{Ag(t)})}function fE(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 hE={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Eg(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}=fE(u,d);const _=n.threshold||4*i;if(g<=_){Ag(r);return}Tt(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=uE(d,m,g,i,n);break;case"min-max":x=dE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=x})},destroy(e){Eg(e)}};function pE(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=Ru(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=Cm(t,h);for(const g of m){const _=Ru(n,s[g.start],s[g.end],g.loop),x=Dm(l,r,_);for(const v of x)a.push({source:v,target:g,start:{[n]:Rg(h,_,"start",Math.max)},end:{[n]:Rg(h,_,"end",Math.min)}})}}return a}function Ru(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 mE(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 Rg(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Pg(e,t){let n=[],i=!1;return Gt(e)?(i=!0,n=e):n=mE(e,t),n.length?new Ya({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ig(e){return e&&e.fill!==!1}function gE(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 yE(e,t,n){const i=wE(e);if(Lt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return le(r)&&Math.floor(r)===r?_E(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function _E(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function bE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Lt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function xE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Lt(e)?i=e.value:i=t.getBaseValue(),i}function wE(e){const t=e.options,n=t.fill;let i=Ct(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function vE(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=SE(t,n);l.push(Pg({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++)TE(r,a[h],l)}return new Ya({points:r,options:{}})}function SE(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 TE(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=kE(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function kE(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 Lg{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:ee},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 ME(e){const{chart:t,fill:n,line:i}=e;if(le(n))return DE(t,n);if(n==="stack")return vE(e);if(n==="shape")return!0;const r=CE(e);return r instanceof Lg?r:Pg(r,i)}function DE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function CE(e){return(e.scale||{}).getPointPositionForValue?AE(e):OE(e)}function OE(e){const{scale:t={},fill:n}=e,i=bE(n,t);if(le(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function AE(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=xE(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Lg({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 Pu(e,t,n){const i=ME(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:_=m}=h||{},x=r.getDatasetMeta(s),v=Em(r,x);i&&a.points.length&&(to(e,n),EE(e,{line:a,target:i,above:g,below:_,area:n,scale:l,axis:u,clip:v}),eo(e))}function EE(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"?(Ng(e,i,a.top),Iu(e,{line:n,target:i,color:r,scale:l,property:d,clip:u}),e.restore(),e.save(),Ng(e,i,a.bottom)):d==="y"&&(Bg(e,i,a.left),Iu(e,{line:n,target:i,color:s,scale:l,property:d,clip:u}),e.restore(),e.save(),Bg(e,i,a.right),h=r)),Iu(e,{line:n,target:i,color:h,scale:l,property:d,clip:u}),e.restore()}function Ng(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 Bg(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 Iu(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=pE(n,i,r);for(const{source:d,target:h,start:m,end:g}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;e.save(),e.fillStyle=_,RE(e,a,l,x&&Ru(r,m,g)),e.beginPath();const v=!!n.pathSegment(e,d);let S;if(x){v?e.closePath():Fg(e,i,g,r);const C=!!i.pathSegment(e,h,{move:v,reverse:!0});S=v&&C,S||Fg(e,i,m,r)}e.closePath(),e.fill(S?"evenodd":"nonzero"),e.restore()}}function RE(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 Fg(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var PE={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:yE(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=gE(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&&Pu(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;Ig(s)&&Pu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Ig(i)||n.drawTime!=="beforeDatasetDraw"||Pu(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const zg=(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)}},IE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Ug 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}=zg(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,_=-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,_+=h,g++),u[v]={left:0,top:_,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,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:A,itemHeight:F}=LE(i,n,s,S,r);C>0&&_+F+2*l>h&&(m+=g+l,d.push({width:g,height:_}),x+=g+l,v++,g=_=0),u[C]={left:x,top:_,col:v,width:A,height:F},g=Math.max(g,A),_+=F+l}),m+=g,d.push({width:g,height:_}),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=oe.color,u=Kr(t.rtl,this.left,this.width),d=ce(a.font),{padding:h}=a,m=d.size,g=m/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:S}=zg(a,m),C=function(N,z,k){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const w=Ct(k.lineWidth,1);if(r.fillStyle=Ct(k.fillStyle,l),r.lineCap=Ct(k.lineCap,"butt"),r.lineDashOffset=Ct(k.lineDashOffset,0),r.lineJoin=Ct(k.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Ct(k.strokeStyle,l),r.setLineDash(Ct(k.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:w},L=u.xPlus(N,x/2),$=z+g;dm(r,O,L,$,a.pointStyleWidth&&x)}else{const O=z+Math.max((m-v)/2,0),L=u.leftForLtr(N,x),$=Ei(k.borderRadius);r.beginPath(),Object.values($).some(q=>q!==0)?qr(r,{x:L,y:O,w:x,h:v,radius:$}):r.rect(L,O,x,v),r.fill(),w!==0&&r.stroke()}r.restore()},A=function(N,z,k){ur(r,k.text,N,z+S/2,d,{strikethrough:k.hidden,textAlign:u.textAlign(k.textAlign)})},F=this.isHorizontal(),P=this._computeTitleHeight();F?_={x:$e(s,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:_={x:this.left+h,y:$e(s,this.top+P+h,this.bottom-n[0].height),line:0},Sm(this.ctx,t.textDirection);const B=S+h;this.legendItems.forEach((N,z)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const k=r.measureText(N.text).width,w=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),O=x+g+k;let L=_.x,$=_.y;u.setWidth(this.width),F?z>0&&L+O+h>this.right&&($=_.y+=B,_.line++,L=_.x=$e(s,this.left+h,this.right-i[_.line])):z>0&&$+B>this.bottom&&(L=_.x=L+n[_.line].width+h,_.line++,$=_.y=$e(s,this.top+P+h,this.bottom-n[_.line].height));const q=u.x(L);if(C(q,$,N),L=XD(w,L+x+g,F?L+O:this.right,t.rtl),A(u.x(L),$,N),F)_.x+=O+h;else if(typeof N.text!="string"){const st=d.lineHeight;_.y+=Hg(N,st)+h}else _.y+=B}),Tm(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 _=$e(l,m,m+g);a.textAlign=s.textAlign(ru(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,ur(a,n.text,_,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(!FE(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=IE(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 LE(e,t,n,i,r){const s=NE(i,e,t,n),a=BE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function NE(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 BE(e,t,n){let i=e;return typeof t.text!="string"&&(i=Hg(t,n)),i}function Hg(e,t){const n=e.text?e.text.length:0;return t*n}function FE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var zE={id:"legend",_element:Ug,start(e,t,n){const i=e.legend=new Ug({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 Lu 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=Gt(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=Rt*-.5):(h=s-t,m=$e(l,n,r),u=Rt*.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:ru(n.align),textBaseline:"middle",translation:[a,l]})}}function UE(e,t){const n=new Lu({ctx:e.ctx,options:t,chart:e});Ve.configure(e,n,t),Ve.addBox(e,n),e.titleBlock=n}var HE={id:"title",_element:Lu,start(e,t,n){UE(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 WE={id:"subtitle",start(e,t,n){const i=new Lu({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&&(Gt(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 VE(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 Wg(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,_=i.length,x=Se(t.padding);let v=x.height,S=0,C=i.reduce((P,B)=>P+B.before.length+B.lines.length+B.after.length,0);if(C+=e.beforeBody.length+e.afterBody.length,m&&(v+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}g&&(v+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let A=0;const F=function(P){S=Math.max(S,n.measureText(P).width+A)};return n.save(),n.font=d.string,te(e.title,F),n.font=u.string,te(e.beforeBody.concat(e.afterBody),F),A=t.displayColors?a+2+t.boxPadding:0,te(i,P=>{te(P.before,F),te(P.lines,F),te(P.after,F)}),A=0,n.font=h.string,te(e.footer,F),n.restore(),S+=x.width,{width:S,height:v}}function YE(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function qE(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 jE(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"),qE(d,e,t,n)&&(d="center"),d}function $g(e,t,n){const i=n.yAlign||t.yAlign||YE(e,n);return{xAlign:n.xAlign||t.xAlign||jE(e,t,n,i),yAlign:i}}function GE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Vg(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:_}=Ei(a);let x=GE(t,l);const v=KE(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,_)+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 Yg(e){return Kn([],ci(e))}function XE(e,t,n){return Ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function qg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jg={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 Tt(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 an(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?jg[t].call(n,i):r}class Gg 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 gu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=XE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=an(i,"beforeTitle",this,t),s=an(i,"title",this,t),a=an(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 Yg(an(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return te(t,s=>{const a={before:[],lines:[],after:[]},l=qg(i,s);Kn(a.before,ci(an(l,"beforeLabel",this,s))),Kn(a.lines,an(l,"label",this,s)),Kn(a.after,ci(an(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return Yg(an(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=an(i,"beforeFooter",this,t),s=an(i,"footer",this,t),a=an(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(VE(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=qg(t.callbacks,h);r.push(an(m,"labelColor",this,h)),s.push(an(m,"labelPointStyle",this,h)),a.push(an(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=Wg(this,i),d=Object.assign({},l,u),h=$g(this.chart,i,d),m=Vg(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,C,A,F,P,B;return s==="center"?(P=_+v/2,r==="left"?(S=g,C=S-a,F=P+a,B=P-a):(S=g+x,C=S+a,F=P-a,B=P+a),A=S):(r==="left"?C=g+Math.max(u,h)+a:r==="right"?C=g+x-Math.max(d,m)-a:C=this.caretX,s==="top"?(F=_,P=F-a,S=C-a,A=C+a):(F=_+v,P=F+a,S=C+a,A=C-a),B=F),{x1:S,x2:C,x3:A,y1:F,y2:P,y3:B}}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),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=n.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,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,cu(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,cu(t,v,S,C)}else{t.lineWidth=Lt(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),C=Ei(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,qr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:C}),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,_=0;const x=Kr(i.rtl,this.x,this.width),v=function(k){n.fillText(k,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let C,A,F,P,B,N,z;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),_=l&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,N=r.length;P<N;++P){for(C=r[P],A=this.labelTextColors[P],n.fillStyle=A,te(C.before,v),F=C.lines,l&&F.length&&(this._drawColorBox(n,t,P,x,i),g=Math.max(m.lineHeight,u)),B=0,z=F.length;B<z;++B)v(F[B]),g=m.lineHeight;te(C.after,v)}_=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:_,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+_,u+h),n.quadraticCurveTo(l,u+h,l,u+h-_),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=Wg(this,t),u=Object.assign({},a,this._size),d=$g(n,t,u),h=Vg(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),Sm(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Tm(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:Gg,positioners:ho,afterInit(e,t,n){n&&(e.tooltip=new Gg({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:jg},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"]},ZE=Object.freeze({__proto__:null,Colors:uE,Decimation:pE,Filler:IE,Legend:UE,SubTitle:$E,Title:WE,Tooltip:qe});const QE=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JE(e,t,n,i){const r=e.indexOf(t);if(r===-1)return QE(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const tR=(e,t)=>e===null?null:Re(Math.round(e),0,t);function Kg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class eR extends pr{static id="category";static defaults={ticks:{callback:Kg}};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(Tt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:JE(i,t,Ct(n,t),this._addedLabels),tR(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 Kg.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 nR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:m,includeBounds:g}=e,_=s||1,x=h-1,{min:v,max:S}=t,C=!Tt(a),A=!Tt(l),F=!Tt(d),P=(S-v)/(m+1);let B=Xp((S-v)/x/_)*_,N,z,k,w;if(B<1e-14&&!C&&!A)return[{value:v},{value:S}];w=Math.ceil(S/B)-Math.floor(v/B),w>x&&(B=Xp(w*B/x/_)*_),Tt(u)||(N=Math.pow(10,u),B=Math.ceil(B*N)/N),r==="ticks"?(z=Math.floor(v/B)*B,k=Math.ceil(S/B)*B):(z=v,k=S),C&&A&&s&&VD((l-a)/s,B/1e3)?(w=Math.round(Math.min((l-a)/B,h)),B=(l-a)/w,z=a,k=l):F?(z=C?a:z,k=A?l:k,w=d-1,B=(k-z)/w):(w=(k-z)/B,Ks(w,Math.round(w),B/1e3)?w=Math.round(w):w=Math.ceil(w));const O=Math.max(Qp(B),Qp(z));N=Math.pow(10,Tt(u)?O:u),z=Math.round(z*N)/N,k=Math.round(k*N)/N;let L=0;for(C&&(g&&z!==a?(n.push({value:a}),z<a&&L++,Ks(Math.round((z+L*B)*N)/N,a,Xg(a,P,e))&&L++):z<a&&L++);L<w;++L){const $=Math.round((z+L*B)*N)/N;if(A&&$>l)break;n.push({value:$})}return A&&g&&k!==l?n.length&&Ks(n[n.length-1].value,l,Xg(l,P,e))?n[n.length-1].value=l:n.push({value:l}):(!A||k===l)&&n.push({value:k}),n}function Xg(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 Tt(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=nR(r,s);return t.bounds==="ticks"&&Zp(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 iR 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 Zg(e){return e/Math.pow(10,po(e))===1}function Qg(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function rR(e,t){const n=t-e;let i=po(n);for(;Qg(e,t,i)>10;)i++;for(;Qg(e,t,i)<10;)i--;return Math.min(i,po(e))}function sR(e,{min:t,max:n}){t=mn(e.min,t);const i=[],r=po(t);let s=rR(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:Zg(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 _=mn(e.max,g);return i.push({value:_,major:Zg(_),significand:m}),i}class oR 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=sR(n,this);return t.bounds==="ticks"&&Zp(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 Nu(e){const t=e.ticks;if(t.display&&e.display){const n=Se(t.backdropPadding);return Ct(t.font&&t.font.size,oe.font.size)+n.height}return 0}function aR(e,t,n){return n=Gt(n)?n:[n],{w:aC(e,t.string,n),h:n.length*t.lineHeight}}function Jg(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 lR(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?Rt/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=aR(e.ctx,m,e._pointLabels[u]);i[u]=g;const _=We(e.getIndexAngle(u)+l),x=Math.round(Da(_)),v=Jg(x,h.x,g.w,0,180),S=Jg(x,h.y,g.h,90,270);cR(n,t,_,v,S)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=fR(e,i,r)}function cR(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 uR(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+se))),h=mR(u.y,l.h,d),m=hR(d),g=pR(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 dR(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 fR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Nu(s)/2,additionalAngle:a?Rt/r:0};let d;for(let h=0;h<r;h++){u.padding=n[h],u.size=t[h];const m=uR(e,h,u);i.push(m),l==="auto"&&(m.visible=dR(m,d),m.visible&&(d=m))}return i}function hR(e){return e===0||e===180?"center":e<180?"left":"right"}function pR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function mR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function gR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!Tt(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,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(e.beginPath(),qr(e,{x:h,y:m,w:g,h:_,radius:u}),e.fill()):e.fillRect(h,m,g,_)}}function yR(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));gR(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 t0(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ee);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 _R(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(),t0(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function bR(e,t,n){return Ri(e,{label:n,index:t,type:"pointLabel"})}class xR 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(Nu(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/Nu(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?lR(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=ee/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+ve(i))}getDistanceFromCenterForValue(t){if(Tt(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(Tt(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 bR(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-se+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(),t0(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&&yR(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),_=r.setContext(g),x=s.setContext(g);_R(this,_,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}},ln=Object.keys(Xa);function e0(e,t){return e-t}function n0(e,t){if(Tt(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 i0(e,t,n,i){const r=ln.length;for(let s=ln.indexOf(e);s<r-1;++s){const a=Xa[ln[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return ln[s]}return ln[r-1]}function wR(e,t,n,i,r){for(let s=ln.length-1;s>=ln.indexOf(n);s--){const a=ln[s];if(Xa[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return ln[n?ln.indexOf(n):0]}function vR(e){for(let t=ln.indexOf(e)+1,n=ln.length;t<n;++t)if(Xa[ln[t]].common)return ln[t]}function r0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=iu(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function SR(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 s0(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:SR(e,i,r,n)}class Bu 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 jm._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:n0(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=GD(r,s,a);return this._unit=n.unit||(i.autoSkip?i0(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):wR(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:vR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),s0(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||i0(s.minUnit,n,i,this._getLabelCapacity(n)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ai(u)||u===!0,h={};let m=n,g,_;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,_=0;g<i;g=+t.add(g,l,a),_++)r0(h,g,x);return(g===i||r.bounds==="ticks"||_===1)&&r0(h,g,x),Object.keys(h).sort(e0).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],_=d&&m&&g&&g.major;return this._adapter.format(t,r||(_?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,s0(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(n0(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return em(t.sort(e0))}}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 TR extends Bu{static id="timeseries";static defaults=Bu.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 kR=Object.freeze({__proto__:null,CategoryScale:eR,LinearScale:iR,LogarithmicScale:oR,RadialLinearScale:xR,TimeScale:Bu,TimeSeriesScale:TR});const MR=[MO,iE,ZE,kR];function DR(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,_=nl(d,m,g),x=d.y,v=d.x<g?"left":"center";return{x:_-e.tooltipState.offsetX,y:x-e.tooltipState.offsetY,xAlign:v}},Tu.modes.customInteractionMode=function(u,d){const h=Pi(d,u),m=[];return Tu.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(g,_,x)=>{u.options.indexAxis==="y"&&g.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&g.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x})}),m};const r=e.numLabels.value>25?v0:S0,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"?!Tt(e.metricAxesTitle?.value):!Tt(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"?!Tt(e.metricAxesTitle?.value):!Tt(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=>{b0(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}on.register(...MR);const CR=(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 OR(e,t,n,i,r){const s=f.shallowRef(null),a=(l,u)=>{if(t.value)return new on(t.value,{type:e,data:l,plugins:i,options:u})};return f.onMounted(()=>{s.value=a(n.value,r.value)}),f.onBeforeUnmount(()=>{Tt(s.value)||s.value.destroy()}),f.watch(n,(l,u)=>{if(CR(u,l)&&!Tt(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 Tt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),f.watch(t,()=>{Tt(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))&&(Tt(s.value)||s.value.destroy(),s.value=a(n.value,l))}),s}const o0=1e3,AR=1e4,a0=1e6,l0=1e9,c0=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?AR:o0;return e<r||t.precision&&t.precision>Math.log10(e)?n=mo(Zr(e,1,t),t):e<a0?n=`${Zr(e,o0,t)}k`:e<l0?n=`${Zr(e,a0,t)}m`:e<c0?n=`${mo(Zr(e,l0,t),t)}b`:n=`${mo(Zr(e,c0,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 ER(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,_)=>g+(typeof _=="number"?Number(_)||0:Number(_&&_.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 RR(e){return f.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${qh(new Date(n))} - ${qh(new Date(i),{includeTZ:!0})}`:""})}function PR(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=>{b0(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 IR(e){const t=f.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:h=>{const m=new Date(h);return H0({tickValue:m,granularity:e.granularity.value,dayBoundaryCrossed:u.value})}},title:{display:!Tt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value})),n=f.computed(()=>!!e.rightYAxis?.value),i=f.computed(()=>({title:{display:!Tt(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:!Tt(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(),_=e.tooltipState.width||this.width,x=e.tooltipState.height||this.height,v=g.width/2,S=g.height/2,C=nl(m,_,v);let A=x0(m,x,S);const F=m.y<S?"top":"bottom",P=m.x<v?"left":"center";return x>g.height&&(A=0),{x:C,y:A,xAlign:P,yAlign:F}};const u=f.computed(()=>{const h=Number(e.timeRangeMs.value),m=new Date,g=new Date(m.getTime()-h);return Ip(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?{[Vu]:r.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...l,external:h=>{Wu(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 LR=["usd","bytes"],NR="usd";function BR(e){const{i18n:t}=St.useI18n(),{formatUnit:n}=$n({i18n:t}),i=(_,x)=>!x||!LR.includes(x)?_:_===0&&x===NR?t.formatNumber(0,{style:"currency",currency:"USD"}):n(_,x),r=f.computed(()=>{const _=Number(e.timeRangeMs.value),x=new Date,v=new Date(x.getTime()-_);return Ip(_)>24||v.getDate()!==x.getDate()}),s=f.computed(()=>({display:!Tt(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:_=>i(_,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:_=>H0({tickValue:new Date(_),granularity:e.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=f.computed(()=>({title:{display:!Tt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:_=>i(_,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(_,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(_,x){if(!_.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,C=e.tooltipState.height||this.height,A=v.width/2,F=v.height/2,P=nl(x,S,A);let B=x0(x,C,F);const N=x.y<F?"top":"bottom",z=x.x<A?"left":"center";return C>v.height&&(B=0),{x:P,y:B,xAlign:z,yAlign:N}};const g=f.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",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:_=>{Wu(e.tooltipState,_,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 FR(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}):Yu(i.indexOf(g),Xn),data:a.map((_,x)=>n?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?Bs({dimension:u,dimensionValue:g.id}):qu(_,g.name,g.id==="empty",l??Xn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function zR(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],_=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(w=>a.map((O,L)=>{const $=w.event[g],q=d?`${$},${O}`:`${L},${O}`,st=w.event[O];return[q,st]})):r.map(w=>{const O=d?`${w.event[g]},${w.event[_]}`:`${g},${_}`,L=w.event[a[0]];return[O,L]})),v=Object.keys(x).reduce((w,O)=>{const[L]=O.split(","),$=x[O];return w[L]?w[L]+=$:w[L]=$,w},{}),S=Object.entries(v).sort(([,w],[,O])=>Number(O)-Number(w)).map(([w])=>w),C=s[g],A=s[_];let F=d&&C&&Object.entries(C).map(([w,O])=>({id:w,name:O.name}))||a.map(w=>({id:w,name:w})),P=d&&A&&Object.entries(A).map(([w,O])=>({id:w,name:O.name}))||a.map(w=>({id:w,name:w}));if(d&&g==="country_code"&&(F=F.map(w=>({...w,name:Nc(w.id)||w.name}))),d&&_==="country_code"&&(P=P.map(w=>({...w,name:Nc(w.id)||w.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(F.sort((w,O)=>S.indexOf(w.id)-S.indexOf(O.id)),P.sort((w,O)=>S.indexOf(w.id)-S.indexOf(O.id))),!F||!P)return{labels:[],datasets:[]};const B=FR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:P,pivotRecords:x,rowLabels:F,seriesDimension:_,colorPalette:e.colorPalette||Xn}),N=d?F.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),z=F.map(w=>w.id==="empty");return{labels:N,datasets:B,isLabelEmpty:z,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const UR=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),HR=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Lp(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},WR=(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 UR(l,u,n)};function $R(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(),_=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],C=!!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:Nc(w.id)||w.name})));const F=t.value.meta.granularity_ms;if(typeof F!="number"||isNaN(F)||!isFinite(F)||F===0)return console.error("Invalid step value:",F),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const P=HR(g),B=WR(g,_,F,P,a),N=a?.length?a.reduce((w,O)=>{const L=new Date(O.timestamp).valueOf(),$=O.event;for(const q of u)L in w||(w[L]={}),q in w[L]||(w[L][q]={});for(const q of u)A.forEach(st=>{(S?$[v]===st.id:q===st.id)?(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[q])*1e3)/1e3):x.length||(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[st.id])*1e3)/1e3)});return w},{}):{},k=[...S||u.length===1?u.flatMap(w=>A.map(O=>[w,O.id,O.name,O.id==="empty"])):A.map(w=>[w.name,w.id,w.name,w.id==="empty"])].map(([w,O,L,$],q)=>{const st=B.map(I=>I in N&&w in N[I]?{x:I,y:N[I][w][O]||0}:{x:I,y:0});let{colorPalette:ct,fill:ht}=e;Tt(ct)&&(ct=Xn);const ut=r?Bs({dimension:v,dimensionValue:O}):qu(q,L,$,ct),vt=j0(L)?n.t(`chartLabels.${L}`):L,at=j0(w)?n.t(`chartLabels.${w}`):w,dt=u.findIndex(I=>I===w),V=e.metricAxisMap?.[w]==="right";return{rawDimension:L,rawMetric:w,label:C?`${vt} — ${at}`:vt,borderColor:ut,backgroundColor:ut,data:st,total:st.reduce((I,{y:W})=>I+Number(W),0),...RP,...C?{borderDash:dt===0?[]:[dt*4,2]}:{},...!C&&V?{borderDash:[4,2]}:{},...V?{yAxisID:Vu}:{},...e.metricAxisMap?{unit:d?.[w]??""}:{},fill:ht,borderWidth:ht?IP:PP,isSegmentEmpty:$}});return v==="status_code"||v==="status_code_grouped"?k.sort((w,O)=>(w.label??"")<(O.label??"")?-1:1):k.sort((w,O)=>Number(w.total)<Number(O.total)?-1:1),{datasets:k}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const VR=2,YR=.6,u0=1,qR=2,d0=50,jR=[6,4],GR=[2,3],KR=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function XR(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===d0?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:"",_=e.scatter||{},x=_.jitterMs??0,v=_.pointRadius??VR,S=_.pointOpacity??YR,C=new Map,A=[];a.points.forEach(q=>{const st=q.group??l,ct=C.get(st)||[];let ht,ut;q.x!==void 0?(ht={x:q.x,timestamp:q.timestamp},ut=[{label:g,value:q.x,...m?{unit:m}:{}},...q.extras??[]]):(ht={x:q.timestamp+KR(x,q.timestamp+q.value)},ut=q.extras??[]),ct.push({...ht,y:q.value,...ut.length?{extras:ut}:{}}),C.set(st,ct),A.push(q.value)});const F=_.percentileLines||[],P=[...F.map(q=>q.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],B=P.length?S2(A,P):new Map,N=_.outlierPercentile!==void 0?B.get(_.outlierPercentile):void 0,z=N!==void 0&&Number.isFinite(N),k=Tt(e.colorPalette)?Xn:e.colorPalette,w=e.themeColors?.value??ld(),O=[],L=q=>{const st=q?.y;return z&&Number.isFinite(st)&&st>N};Array.from(C.entries()).forEach(([q,st],ct)=>{const ht=u&&d?.[q]?.name||q,ut=q==="empty",vt=r?Bs({dimension:u,dimensionValue:q}):qu(ct,ht,ut,k),at=ad(vt,S),dt=n.te(`chartLabels.${ht}`)&&n.t(`chartLabels.${ht}`)||ht;O.push({type:"scatter",rawDimension:ht,rawMetric:l,label:dt,borderColor:V=>L(V.raw)?w.outlier:vt,backgroundColor:V=>L(V.raw)?w.outlier:at,pointRadius:V=>L(V.raw)?v+u0:v,pointHoverRadius:V=>(L(V.raw)?v+u0:v)+qR,data:st,pointBorderWidth:0,showLine:!1,isSegmentEmpty:ut})});const $=[];return F.forEach(q=>{const st=B.get(q.percentile);if(st===void 0||!Number.isFinite(st))return;const ct=q.percentile===d0;$.push({percentile:q.percentile,label:s(q.percentile,q.label),value:st,color:q.color||(ct?w.medianLine:w.outlier),borderDash:q.borderDash||(ct?jR:GR)})}),{datasets:O,...z?{outlier:{value:N,label:n.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:w.outlier}}:{},...$.length?{referenceLines:$}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const ZR=(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 QR(){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 JR="analytics-query-provider",f0=2,Fu="____OTHER____",tP="empty";function eP(){const e=f.inject(JR);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function h0(e,t){return f.getCurrentScope()?(f.onScopeDispose(e,t),!0):!1}const p0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const nP=e=>e!=null,iP=Object.prototype.toString,rP=e=>iP.call(e)==="[object Object]";function Qa(e){return Array.isArray(e)?e:[e]}function sP(e){return f.getCurrentInstance()}function oP(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 aP(e,t=!0,n){sP()?f.onMounted(e,n):t?e():f.nextTick(e)}function lP(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Ja=p0?window:void 0;function Qr(e){var t;const n=f.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function yo(...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 lP(()=>{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=rP(a)?{...a}:a,h=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{h.forEach(m=>m())})},{flush:"post"})}function cP(){const e=f.shallowRef(!1),t=f.getCurrentInstance();return t&&f.onMounted(()=>{e.value=!0},t),e}function m0(e){const t=cP();return f.computed(()=>(t.value,!!e()))}function uP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=m0(()=>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(nP);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 h0(h),{isSupported:a,stop:h,takeRecords:d}}const tl={speed:2,margin:30,direction:"both"};function dP(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 fP(e,t={}){var n,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:m,onStart:g,initialValue:_,axis:x="both",draggingElement:v=Ja,containerElement:S,handle:C=e,buttons:A=[0],restrictInView:F,autoScroll:P=!1}=t,B=f.ref((n=f.toValue(_))!==null&&n!==void 0?n:{x:0,y:0}),N=f.ref(),z=V=>a?a.includes(V.pointerType):!0,k=V=>{f.toValue(l)&&V.preventDefault(),f.toValue(u)&&V.stopPropagation()},w=f.toValue(P),O=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,L=V=>typeof V=="number"?[V,V]:[V.x,V.y],$=(V,I,W)=>{const{clientWidth:nt,clientHeight:ot,scrollLeft:X,scrollTop:tt,scrollWidth:rt,scrollHeight:pt}=V,[yt,mt]=L(O.margin),[Et,zt]=L(O.speed);let G=0,it=0;(O.direction==="x"||O.direction==="both")&&(W.x<yt&&X>0?G=-Et:W.x+I.width>nt-yt&&X<rt-nt&&(G=Et)),(O.direction==="y"||O.direction==="both")&&(W.y<mt&&tt>0?it=-zt:W.y+I.height>ot-mt&&tt<pt-ot&&(it=zt)),(G||it)&&V.scrollBy({left:G,top:it,behavior:"auto"})};let q=null;const st=()=>{const V=f.toValue(S);V&&!q&&(q=setInterval(()=>{const I=f.toValue(e).getBoundingClientRect(),{x:W,y:nt}=B.value,ot={x:W-V.scrollLeft,y:nt-V.scrollTop};ot.x>=0&&ot.y>=0&&($(V,I,ot),ot.x+=V.scrollLeft,ot.y+=V.scrollTop,B.value=ot)},1e3/60))},ct=()=>{q&&(clearInterval(q),q=null)},ht=(V,I,W,nt)=>{const[ot,X]=typeof W=="number"?[W,W]:[W.x,W.y],{clientWidth:tt,clientHeight:rt}=I;return V.x<ot||V.x+nt.width>tt-ot||V.y<X||V.y+nt.height>rt-X},ut=()=>{if(f.toValue(t.disabled)||!N.value)return;const V=f.toValue(S);if(!V)return;const I=f.toValue(e).getBoundingClientRect(),{x:W,y:nt}=B.value,ot={x:W-V.scrollLeft,y:nt-V.scrollTop};ht(ot,V,O.margin,I)?st():ct()};f.toValue(P)&&f.watch(B,ut);const vt=V=>{var I;if(!f.toValue(A).includes(V.button)||f.toValue(t.disabled)||!z(V)||f.toValue(d)&&V.target!==f.toValue(e))return;const W=f.toValue(S),nt=W==null||(I=W.getBoundingClientRect)===null||I===void 0?void 0:I.call(W),ot=f.toValue(e).getBoundingClientRect(),X={x:V.clientX-(W?ot.left-nt.left+(P?0:W.scrollLeft):ot.left),y:V.clientY-(W?ot.top-nt.top+(P?0:W.scrollTop):ot.top)};g?.(X,V)!==!1&&(N.value=X,k(V))},at=V=>{if(f.toValue(t.disabled)||!z(V)||!N.value)return;const I=f.toValue(S);I instanceof HTMLElement&&dP(I);const W=f.toValue(e).getBoundingClientRect();let{x:nt,y:ot}=B.value;if((x==="x"||x==="both")&&(nt=V.clientX-N.value.x,I&&(nt=Math.min(Math.max(0,nt),I.scrollWidth-W.width))),(x==="y"||x==="both")&&(ot=V.clientY-N.value.y,I&&(ot=Math.min(Math.max(0,ot),I.scrollHeight-W.height))),f.toValue(P)&&I&&(q===null&&$(I,W,{x:nt,y:ot}),nt+=I.scrollLeft,ot+=I.scrollTop),I&&(F||P)){if(x!=="y"){const X=nt-I.scrollLeft;X<0?nt=I.scrollLeft:X>I.clientWidth-W.width&&(nt=I.clientWidth-W.width+I.scrollLeft)}if(x!=="x"){const X=ot-I.scrollTop;X<0?ot=I.scrollTop:X>I.clientHeight-W.height&&(ot=I.clientHeight-W.height+I.scrollTop)}}B.value={x:nt,y:ot},h?.(B.value,V),k(V)},dt=V=>{f.toValue(t.disabled)||!z(V)||N.value&&(N.value=void 0,P&&ct(),m?.(B.value,V),k(V))};if(p0){const V=()=>{var I;return{capture:(I=t.capture)!==null&&I!==void 0?I:!0,passive:!f.toValue(l)}};yo(C,"pointerdown",vt,V),yo(v,"pointermove",at,V),yo(v,["pointerup","pointercancel"],dt,V)}return{...oP(B),position:B,isDragging:f.computed(()=>!!N.value),style:f.computed(()=>`
|
|
3
|
+
`):e}function $E(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 Wg(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,_=i.length,x=Se(t.padding);let v=x.height,S=0,C=i.reduce((P,B)=>P+B.before.length+B.lines.length+B.after.length,0);if(C+=e.beforeBody.length+e.afterBody.length,m&&(v+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}g&&(v+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let A=0;const F=function(P){S=Math.max(S,n.measureText(P).width+A)};return n.save(),n.font=d.string,te(e.title,F),n.font=u.string,te(e.beforeBody.concat(e.afterBody),F),A=t.displayColors?a+2+t.boxPadding:0,te(i,P=>{te(P.before,F),te(P.lines,F),te(P.after,F)}),A=0,n.font=h.string,te(e.footer,F),n.restore(),S+=x.width,{width:S,height:v}}function VE(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function YE(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 qE(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"),YE(d,e,t,n)&&(d="center"),d}function $g(e,t,n){const i=n.yAlign||t.yAlign||VE(e,n);return{xAlign:n.xAlign||t.xAlign||qE(e,t,n,i),yAlign:i}}function jE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function GE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Vg(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:_}=Ei(a);let x=jE(t,l);const v=GE(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,_)+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 Yg(e){return Kn([],ci(e))}function KE(e,t,n){return Ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function qg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jg={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 Tt(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 an(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?jg[t].call(n,i):r}class Gg 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 gu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=KE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=an(i,"beforeTitle",this,t),s=an(i,"title",this,t),a=an(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 Yg(an(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return te(t,s=>{const a={before:[],lines:[],after:[]},l=qg(i,s);Kn(a.before,ci(an(l,"beforeLabel",this,s))),Kn(a.lines,an(l,"label",this,s)),Kn(a.after,ci(an(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return Yg(an(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=an(i,"beforeFooter",this,t),s=an(i,"footer",this,t),a=an(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($E(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=qg(t.callbacks,h);r.push(an(m,"labelColor",this,h)),s.push(an(m,"labelPointStyle",this,h)),a.push(an(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=Wg(this,i),d=Object.assign({},l,u),h=$g(this.chart,i,d),m=Vg(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,C,A,F,P,B;return s==="center"?(P=_+v/2,r==="left"?(S=g,C=S-a,F=P+a,B=P-a):(S=g+x,C=S+a,F=P-a,B=P+a),A=S):(r==="left"?C=g+Math.max(u,h)+a:r==="right"?C=g+x-Math.max(d,m)-a:C=this.caretX,s==="top"?(F=_,P=F-a,S=C-a,A=C+a):(F=_+v,P=F+a,S=C+a,A=C-a),B=F),{x1:S,x2:C,x3:A,y1:F,y2:P,y3:B}}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),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=n.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,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,cu(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,cu(t,v,S,C)}else{t.lineWidth=Lt(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),C=Ei(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,qr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:C}),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,_=0;const x=Kr(i.rtl,this.x,this.width),v=function(k){n.fillText(k,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let C,A,F,P,B,N,z;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),_=l&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,N=r.length;P<N;++P){for(C=r[P],A=this.labelTextColors[P],n.fillStyle=A,te(C.before,v),F=C.lines,l&&F.length&&(this._drawColorBox(n,t,P,x,i),g=Math.max(m.lineHeight,u)),B=0,z=F.length;B<z;++B)v(F[B]),g=m.lineHeight;te(C.after,v)}_=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:_,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+_,u+h),n.quadraticCurveTo(l,u+h,l,u+h-_),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=Wg(this,t),u=Object.assign({},a,this._size),d=$g(n,t,u),h=Vg(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),Sm(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Tm(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:Gg,positioners:ho,afterInit(e,t,n){n&&(e.tooltip=new Gg({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:jg},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"]},XE=Object.freeze({__proto__:null,Colors:cE,Decimation:hE,Filler:PE,Legend:zE,SubTitle:WE,Title:HE,Tooltip:qe});const ZE=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function QE(e,t,n,i){const r=e.indexOf(t);if(r===-1)return ZE(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const JE=(e,t)=>e===null?null:Re(Math.round(e),0,t);function Kg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class tR extends pr{static id="category";static defaults={ticks:{callback:Kg}};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(Tt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:QE(i,t,Ct(n,t),this._addedLabels),JE(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 Kg.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 eR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:m,includeBounds:g}=e,_=s||1,x=h-1,{min:v,max:S}=t,C=!Tt(a),A=!Tt(l),F=!Tt(d),P=(S-v)/(m+1);let B=Xp((S-v)/x/_)*_,N,z,k,w;if(B<1e-14&&!C&&!A)return[{value:v},{value:S}];w=Math.ceil(S/B)-Math.floor(v/B),w>x&&(B=Xp(w*B/x/_)*_),Tt(u)||(N=Math.pow(10,u),B=Math.ceil(B*N)/N),r==="ticks"?(z=Math.floor(v/B)*B,k=Math.ceil(S/B)*B):(z=v,k=S),C&&A&&s&&$D((l-a)/s,B/1e3)?(w=Math.round(Math.min((l-a)/B,h)),B=(l-a)/w,z=a,k=l):F?(z=C?a:z,k=A?l:k,w=d-1,B=(k-z)/w):(w=(k-z)/B,Ks(w,Math.round(w),B/1e3)?w=Math.round(w):w=Math.ceil(w));const O=Math.max(Qp(B),Qp(z));N=Math.pow(10,Tt(u)?O:u),z=Math.round(z*N)/N,k=Math.round(k*N)/N;let L=0;for(C&&(g&&z!==a?(n.push({value:a}),z<a&&L++,Ks(Math.round((z+L*B)*N)/N,a,Xg(a,P,e))&&L++):z<a&&L++);L<w;++L){const $=Math.round((z+L*B)*N)/N;if(A&&$>l)break;n.push({value:$})}return A&&g&&k!==l?n.length&&Ks(n[n.length-1].value,l,Xg(l,P,e))?n[n.length-1].value=l:n.push({value:l}):(!A||k===l)&&n.push({value:k}),n}function Xg(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 Tt(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=eR(r,s);return t.bounds==="ticks"&&Zp(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 nR 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 Zg(e){return e/Math.pow(10,po(e))===1}function Qg(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function iR(e,t){const n=t-e;let i=po(n);for(;Qg(e,t,i)>10;)i++;for(;Qg(e,t,i)<10;)i--;return Math.min(i,po(e))}function rR(e,{min:t,max:n}){t=mn(e.min,t);const i=[],r=po(t);let s=iR(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:Zg(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 _=mn(e.max,g);return i.push({value:_,major:Zg(_),significand:m}),i}class sR 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=rR(n,this);return t.bounds==="ticks"&&Zp(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 Nu(e){const t=e.ticks;if(t.display&&e.display){const n=Se(t.backdropPadding);return Ct(t.font&&t.font.size,oe.font.size)+n.height}return 0}function oR(e,t,n){return n=Gt(n)?n:[n],{w:oC(e,t.string,n),h:n.length*t.lineHeight}}function Jg(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 aR(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?Rt/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=oR(e.ctx,m,e._pointLabels[u]);i[u]=g;const _=We(e.getIndexAngle(u)+l),x=Math.round(Da(_)),v=Jg(x,h.x,g.w,0,180),S=Jg(x,h.y,g.h,90,270);lR(n,t,_,v,S)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=dR(e,i,r)}function lR(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 cR(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+se))),h=pR(u.y,l.h,d),m=fR(d),g=hR(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 uR(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 dR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Nu(s)/2,additionalAngle:a?Rt/r:0};let d;for(let h=0;h<r;h++){u.padding=n[h],u.size=t[h];const m=cR(e,h,u);i.push(m),l==="auto"&&(m.visible=uR(m,d),m.visible&&(d=m))}return i}function fR(e){return e===0||e===180?"center":e<180?"left":"right"}function hR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function pR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function mR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!Tt(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,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(e.beginPath(),qr(e,{x:h,y:m,w:g,h:_,radius:u}),e.fill()):e.fillRect(h,m,g,_)}}function gR(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));mR(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 t0(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ee);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 yR(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(),t0(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function _R(e,t,n){return Ri(e,{label:n,index:t,type:"pointLabel"})}class bR 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(Nu(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/Nu(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?aR(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=ee/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+ve(i))}getDistanceFromCenterForValue(t){if(Tt(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(Tt(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 _R(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-se+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(),t0(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&&gR(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),_=r.setContext(g),x=s.setContext(g);yR(this,_,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}},ln=Object.keys(Xa);function e0(e,t){return e-t}function n0(e,t){if(Tt(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 i0(e,t,n,i){const r=ln.length;for(let s=ln.indexOf(e);s<r-1;++s){const a=Xa[ln[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return ln[s]}return ln[r-1]}function xR(e,t,n,i,r){for(let s=ln.length-1;s>=ln.indexOf(n);s--){const a=ln[s];if(Xa[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return ln[n?ln.indexOf(n):0]}function wR(e){for(let t=ln.indexOf(e)+1,n=ln.length;t<n;++t)if(Xa[ln[t]].common)return ln[t]}function r0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=iu(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function vR(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 s0(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:vR(e,i,r,n)}class Bu 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 jm._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:n0(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=jD(r,s,a);return this._unit=n.unit||(i.autoSkip?i0(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):xR(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:wR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),s0(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||i0(s.minUnit,n,i,this._getLabelCapacity(n)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ai(u)||u===!0,h={};let m=n,g,_;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,_=0;g<i;g=+t.add(g,l,a),_++)r0(h,g,x);return(g===i||r.bounds==="ticks"||_===1)&&r0(h,g,x),Object.keys(h).sort(e0).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],_=d&&m&&g&&g.major;return this._adapter.format(t,r||(_?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,s0(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(n0(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return em(t.sort(e0))}}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 SR extends Bu{static id="timeseries";static defaults=Bu.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 TR=Object.freeze({__proto__:null,CategoryScale:tR,LinearScale:nR,LogarithmicScale:sR,RadialLinearScale:bR,TimeScale:Bu,TimeSeriesScale:SR});const kR=[kO,nE,XE,TR];function MR(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,_=nl(d,m,g),x=d.y,v=d.x<g?"left":"center";return{x:_-e.tooltipState.offsetX,y:x-e.tooltipState.offsetY,xAlign:v}},Tu.modes.customInteractionMode=function(u,d){const h=Pi(d,u),m=[];return Tu.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(g,_,x)=>{u.options.indexAxis==="y"&&g.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&g.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x})}),m};const r=e.numLabels.value>25?v0:S0,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"?!Tt(e.metricAxesTitle?.value):!Tt(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"?!Tt(e.metricAxesTitle?.value):!Tt(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=>{b0(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}on.register(...kR);const DR=(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 CR(e,t,n,i,r){const s=f.shallowRef(null),a=(l,u)=>{if(t.value)return new on(t.value,{type:e,data:l,plugins:i,options:u})};return f.onMounted(()=>{s.value=a(n.value,r.value)}),f.onBeforeUnmount(()=>{Tt(s.value)||s.value.destroy()}),f.watch(n,(l,u)=>{if(DR(u,l)&&!Tt(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 Tt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),f.watch(t,()=>{Tt(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))&&(Tt(s.value)||s.value.destroy(),s.value=a(n.value,l))}),s}const o0=1e3,OR=1e4,a0=1e6,l0=1e9,c0=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?OR:o0;return e<r||t.precision&&t.precision>Math.log10(e)?n=mo(Zr(e,1,t),t):e<a0?n=`${Zr(e,o0,t)}k`:e<l0?n=`${Zr(e,a0,t)}m`:e<c0?n=`${mo(Zr(e,l0,t),t)}b`:n=`${mo(Zr(e,c0,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 AR(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,_)=>g+(typeof _=="number"?Number(_)||0:Number(_&&_.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 ER(e){return f.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${qh(new Date(n))} - ${qh(new Date(i),{includeTZ:!0})}`:""})}function RR(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=>{b0(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 PR(e){const t=f.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:h=>{const m=new Date(h);return H0({tickValue:m,granularity:e.granularity.value,dayBoundaryCrossed:u.value})}},title:{display:!Tt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value})),n=f.computed(()=>!!e.rightYAxis?.value),i=f.computed(()=>({title:{display:!Tt(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:!Tt(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(),_=e.tooltipState.width||this.width,x=e.tooltipState.height||this.height,v=g.width/2,S=g.height/2,C=nl(m,_,v);let A=x0(m,x,S);const F=m.y<S?"top":"bottom",P=m.x<v?"left":"center";return x>g.height&&(A=0),{x:C,y:A,xAlign:P,yAlign:F}};const u=f.computed(()=>{const h=Number(e.timeRangeMs.value),m=new Date,g=new Date(m.getTime()-h);return Ip(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?{[Vu]:r.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...l,external:h=>{Wu(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 IR=["usd","bytes"],LR="usd";function NR(e){const{i18n:t}=St.useI18n(),{formatUnit:n}=$n({i18n:t}),i=(_,x)=>!x||!IR.includes(x)?_:_===0&&x===LR?t.formatNumber(0,{style:"currency",currency:"USD"}):n(_,x),r=f.computed(()=>{const _=Number(e.timeRangeMs.value),x=new Date,v=new Date(x.getTime()-_);return Ip(_)>24||v.getDate()!==x.getDate()}),s=f.computed(()=>({display:!Tt(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:_=>i(_,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:_=>H0({tickValue:new Date(_),granularity:e.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=f.computed(()=>({title:{display:!Tt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:_=>i(_,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(_,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(_,x){if(!_.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,C=e.tooltipState.height||this.height,A=v.width/2,F=v.height/2,P=nl(x,S,A);let B=x0(x,C,F);const N=x.y<F?"top":"bottom",z=x.x<A?"left":"center";return C>v.height&&(B=0),{x:P,y:B,xAlign:z,yAlign:N}};const g=f.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",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:_=>{Wu(e.tooltipState,_,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 BR(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}):Yu(i.indexOf(g),Xn),data:a.map((_,x)=>n?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?Bs({dimension:u,dimensionValue:g.id}):qu(_,g.name,g.id==="empty",l??Xn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function FR(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],_=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(w=>a.map((O,L)=>{const $=w.event[g],q=d?`${$},${O}`:`${L},${O}`,st=w.event[O];return[q,st]})):r.map(w=>{const O=d?`${w.event[g]},${w.event[_]}`:`${g},${_}`,L=w.event[a[0]];return[O,L]})),v=Object.keys(x).reduce((w,O)=>{const[L]=O.split(","),$=x[O];return w[L]?w[L]+=$:w[L]=$,w},{}),S=Object.entries(v).sort(([,w],[,O])=>Number(O)-Number(w)).map(([w])=>w),C=s[g],A=s[_];let F=d&&C&&Object.entries(C).map(([w,O])=>({id:w,name:O.name}))||a.map(w=>({id:w,name:w})),P=d&&A&&Object.entries(A).map(([w,O])=>({id:w,name:O.name}))||a.map(w=>({id:w,name:w}));if(d&&g==="country_code"&&(F=F.map(w=>({...w,name:Nc(w.id)||w.name}))),d&&_==="country_code"&&(P=P.map(w=>({...w,name:Nc(w.id)||w.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(F.sort((w,O)=>S.indexOf(w.id)-S.indexOf(O.id)),P.sort((w,O)=>S.indexOf(w.id)-S.indexOf(O.id))),!F||!P)return{labels:[],datasets:[]};const B=BR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:P,pivotRecords:x,rowLabels:F,seriesDimension:_,colorPalette:e.colorPalette||Xn}),N=d?F.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),z=F.map(w=>w.id==="empty");return{labels:N,datasets:B,isLabelEmpty:z,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const zR=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),UR=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Lp(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},HR=(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 zR(l,u,n)};function WR(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(),_=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],C=!!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:Nc(w.id)||w.name})));const F=t.value.meta.granularity_ms;if(typeof F!="number"||isNaN(F)||!isFinite(F)||F===0)return console.error("Invalid step value:",F),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const P=UR(g),B=HR(g,_,F,P,a),N=a?.length?a.reduce((w,O)=>{const L=new Date(O.timestamp).valueOf(),$=O.event;for(const q of u)L in w||(w[L]={}),q in w[L]||(w[L][q]={});for(const q of u)A.forEach(st=>{(S?$[v]===st.id:q===st.id)?(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[q])*1e3)/1e3):x.length||(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[st.id])*1e3)/1e3)});return w},{}):{},k=[...S||u.length===1?u.flatMap(w=>A.map(O=>[w,O.id,O.name,O.id==="empty"])):A.map(w=>[w.name,w.id,w.name,w.id==="empty"])].map(([w,O,L,$],q)=>{const st=B.map(I=>I in N&&w in N[I]?{x:I,y:N[I][w][O]||0}:{x:I,y:0});let{colorPalette:ct,fill:ht}=e;Tt(ct)&&(ct=Xn);const ut=r?Bs({dimension:v,dimensionValue:O}):qu(q,L,$,ct),vt=j0(L)?n.t(`chartLabels.${L}`):L,at=j0(w)?n.t(`chartLabels.${w}`):w,dt=u.findIndex(I=>I===w),V=e.metricAxisMap?.[w]==="right";return{rawDimension:L,rawMetric:w,label:C?`${vt} — ${at}`:vt,borderColor:ut,backgroundColor:ut,data:st,total:st.reduce((I,{y:W})=>I+Number(W),0),...EP,...C?{borderDash:dt===0?[]:[dt*4,2]}:{},...!C&&V?{borderDash:[4,2]}:{},...V?{yAxisID:Vu}:{},...e.metricAxisMap?{unit:d?.[w]??""}:{},fill:ht,borderWidth:ht?PP:RP,isSegmentEmpty:$}});return v==="status_code"||v==="status_code_grouped"?k.sort((w,O)=>(w.label??"")<(O.label??"")?-1:1):k.sort((w,O)=>Number(w.total)<Number(O.total)?-1:1),{datasets:k}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const $R=2,VR=.6,u0=1,YR=2,d0=50,qR=[6,4],jR=[2,3],GR=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function KR(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===d0?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:"",_=e.scatter||{},x=_.jitterMs??0,v=_.pointRadius??$R,S=_.pointOpacity??VR,C=new Map,A=[];a.points.forEach(q=>{const st=q.group??l,ct=C.get(st)||[];let ht,ut;q.x!==void 0?(ht={x:q.x,timestamp:q.timestamp},ut=[{label:g,value:q.x,...m?{unit:m}:{}},...q.extras??[]]):(ht={x:q.timestamp+GR(x,q.timestamp+q.value)},ut=q.extras??[]),ct.push({...ht,y:q.value,...ut.length?{extras:ut}:{}}),C.set(st,ct),A.push(q.value)});const F=_.percentileLines||[],P=[...F.map(q=>q.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],B=P.length?v2(A,P):new Map,N=_.outlierPercentile!==void 0?B.get(_.outlierPercentile):void 0,z=N!==void 0&&Number.isFinite(N),k=Tt(e.colorPalette)?Xn:e.colorPalette,w=e.themeColors?.value??ld(),O=[],L=q=>{const st=q?.y;return z&&Number.isFinite(st)&&st>N};Array.from(C.entries()).forEach(([q,st],ct)=>{const ht=u&&d?.[q]?.name||q,ut=q==="empty",vt=r?Bs({dimension:u,dimensionValue:q}):qu(ct,ht,ut,k),at=ad(vt,S),dt=n.te(`chartLabels.${ht}`)&&n.t(`chartLabels.${ht}`)||ht;O.push({type:"scatter",rawDimension:ht,rawMetric:l,label:dt,borderColor:V=>L(V.raw)?w.outlier:vt,backgroundColor:V=>L(V.raw)?w.outlier:at,pointRadius:V=>L(V.raw)?v+u0:v,pointHoverRadius:V=>(L(V.raw)?v+u0:v)+YR,data:st,pointBorderWidth:0,showLine:!1,isSegmentEmpty:ut})});const $=[];return F.forEach(q=>{const st=B.get(q.percentile);if(st===void 0||!Number.isFinite(st))return;const ct=q.percentile===d0;$.push({percentile:q.percentile,label:s(q.percentile,q.label),value:st,color:q.color||(ct?w.medianLine:w.outlier),borderDash:q.borderDash||(ct?qR:jR)})}),{datasets:O,...z?{outlier:{value:N,label:n.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:w.outlier}}:{},...$.length?{referenceLines:$}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const XR=(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 ZR(){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 QR="analytics-query-provider",f0=2,Fu="____OTHER____",JR="empty";function tP(){const e=f.inject(QR);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function h0(e,t){return f.getCurrentScope()?(f.onScopeDispose(e,t),!0):!1}const p0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const eP=e=>e!=null,nP=Object.prototype.toString,iP=e=>nP.call(e)==="[object Object]";function Qa(e){return Array.isArray(e)?e:[e]}function rP(e){return f.getCurrentInstance()}function sP(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 oP(e,t=!0,n){rP()?f.onMounted(e,n):t?e():f.nextTick(e)}function aP(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Ja=p0?window:void 0;function Qr(e){var t;const n=f.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function yo(...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 aP(()=>{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=iP(a)?{...a}:a,h=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{h.forEach(m=>m())})},{flush:"post"})}function lP(){const e=f.shallowRef(!1),t=f.getCurrentInstance();return t&&f.onMounted(()=>{e.value=!0},t),e}function m0(e){const t=lP();return f.computed(()=>(t.value,!!e()))}function cP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=m0(()=>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(eP);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 h0(h),{isSupported:a,stop:h,takeRecords:d}}const tl={speed:2,margin:30,direction:"both"};function uP(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 dP(e,t={}){var n,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:m,onStart:g,initialValue:_,axis:x="both",draggingElement:v=Ja,containerElement:S,handle:C=e,buttons:A=[0],restrictInView:F,autoScroll:P=!1}=t,B=f.ref((n=f.toValue(_))!==null&&n!==void 0?n:{x:0,y:0}),N=f.ref(),z=V=>a?a.includes(V.pointerType):!0,k=V=>{f.toValue(l)&&V.preventDefault(),f.toValue(u)&&V.stopPropagation()},w=f.toValue(P),O=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,L=V=>typeof V=="number"?[V,V]:[V.x,V.y],$=(V,I,W)=>{const{clientWidth:nt,clientHeight:ot,scrollLeft:X,scrollTop:tt,scrollWidth:rt,scrollHeight:pt}=V,[yt,mt]=L(O.margin),[Et,zt]=L(O.speed);let G=0,it=0;(O.direction==="x"||O.direction==="both")&&(W.x<yt&&X>0?G=-Et:W.x+I.width>nt-yt&&X<rt-nt&&(G=Et)),(O.direction==="y"||O.direction==="both")&&(W.y<mt&&tt>0?it=-zt:W.y+I.height>ot-mt&&tt<pt-ot&&(it=zt)),(G||it)&&V.scrollBy({left:G,top:it,behavior:"auto"})};let q=null;const st=()=>{const V=f.toValue(S);V&&!q&&(q=setInterval(()=>{const I=f.toValue(e).getBoundingClientRect(),{x:W,y:nt}=B.value,ot={x:W-V.scrollLeft,y:nt-V.scrollTop};ot.x>=0&&ot.y>=0&&($(V,I,ot),ot.x+=V.scrollLeft,ot.y+=V.scrollTop,B.value=ot)},1e3/60))},ct=()=>{q&&(clearInterval(q),q=null)},ht=(V,I,W,nt)=>{const[ot,X]=typeof W=="number"?[W,W]:[W.x,W.y],{clientWidth:tt,clientHeight:rt}=I;return V.x<ot||V.x+nt.width>tt-ot||V.y<X||V.y+nt.height>rt-X},ut=()=>{if(f.toValue(t.disabled)||!N.value)return;const V=f.toValue(S);if(!V)return;const I=f.toValue(e).getBoundingClientRect(),{x:W,y:nt}=B.value,ot={x:W-V.scrollLeft,y:nt-V.scrollTop};ht(ot,V,O.margin,I)?st():ct()};f.toValue(P)&&f.watch(B,ut);const vt=V=>{var I;if(!f.toValue(A).includes(V.button)||f.toValue(t.disabled)||!z(V)||f.toValue(d)&&V.target!==f.toValue(e))return;const W=f.toValue(S),nt=W==null||(I=W.getBoundingClientRect)===null||I===void 0?void 0:I.call(W),ot=f.toValue(e).getBoundingClientRect(),X={x:V.clientX-(W?ot.left-nt.left+(P?0:W.scrollLeft):ot.left),y:V.clientY-(W?ot.top-nt.top+(P?0:W.scrollTop):ot.top)};g?.(X,V)!==!1&&(N.value=X,k(V))},at=V=>{if(f.toValue(t.disabled)||!z(V)||!N.value)return;const I=f.toValue(S);I instanceof HTMLElement&&uP(I);const W=f.toValue(e).getBoundingClientRect();let{x:nt,y:ot}=B.value;if((x==="x"||x==="both")&&(nt=V.clientX-N.value.x,I&&(nt=Math.min(Math.max(0,nt),I.scrollWidth-W.width))),(x==="y"||x==="both")&&(ot=V.clientY-N.value.y,I&&(ot=Math.min(Math.max(0,ot),I.scrollHeight-W.height))),f.toValue(P)&&I&&(q===null&&$(I,W,{x:nt,y:ot}),nt+=I.scrollLeft,ot+=I.scrollTop),I&&(F||P)){if(x!=="y"){const X=nt-I.scrollLeft;X<0?nt=I.scrollLeft:X>I.clientWidth-W.width&&(nt=I.clientWidth-W.width+I.scrollLeft)}if(x!=="x"){const X=ot-I.scrollTop;X<0?ot=I.scrollTop:X>I.clientHeight-W.height&&(ot=I.clientHeight-W.height+I.scrollTop)}}B.value={x:nt,y:ot},h?.(B.value,V),k(V)},dt=V=>{f.toValue(t.disabled)||!z(V)||N.value&&(N.value=void 0,P&&ct(),m?.(B.value,V),k(V))};if(p0){const V=()=>{var I;return{capture:(I=t.capture)!==null&&I!==void 0?I:!0,passive:!f.toValue(l)}};yo(C,"pointerdown",vt,V),yo(v,"pointermove",at,V),yo(v,["pointerup","pointercancel"],dt,V)}return{...sP(B),position:B,isDragging:f.computed(()=>!!N.value),style:f.computed(()=>`
|
|
4
4
|
left: ${B.value.x}px;
|
|
5
5
|
top: ${B.value.y}px;
|
|
6
6
|
${P?"text-wrap: nowrap;":""}
|
|
7
|
-
`)}}function hP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=m0(()=>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 h0(d),{isSupported:a,stop:d}}function pP(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),_=f.shallowRef(0),x=f.shallowRef(0);function v(){const C=Qr(e);if(!C){n&&(l.value=0,u.value=0,d.value=0,h.value=0,m.value=0,g.value=0,_.value=0,x.value=0);return}const A=C.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,_.value=A.x,x.value=A.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return hP(e,S),f.watch(()=>Qr(e),C=>!C&&S()),uP(e,S,{attributeFilter:["style","class"]}),r&&yo("scroll",S,{capture:!0,passive:!0}),i&&yo("resize",S,{passive:!0}),aP(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:m,width:g,x:_,y:x,update:S}}function mP(e,t){const{top:n,left:i}=pP(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 gP=({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},g0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),_o=f.ref({}),yP=e=>(_o.value[e]||(_o.value[e]=g0()),_o.value[e]),_P=(e,t)=>{const n=_o.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 _o.value[t])};function bP({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?yP(n):g0(),m=e!==void 0?e:"static-chart-key",g=f.computed(()=>t.reduce((O,{timestamps:L})=>[...O,...L],[])),_=f.computed(()=>i||g.value.reduce((O,L)=>O===0?L:Math.min(O,L),0)),x=f.computed(()=>r||g.value.reduce((O,L)=>Math.max(O,L),0));f.watchEffect(()=>{h.minStamps[m]=_.value,h.maxStamps[m]=x.value,l!==void 0&&(h.renderPoints[m]=l)});const v=f.computed(()=>Object.values(h.minStamps).reduce((O,L)=>O===0?L:Math.min(O,L),0)),S=f.computed(()=>Object.values(h.maxStamps).reduce((O,L)=>Math.max(O,L),0)),C=f.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((L,$)=>Math.max(L,$),2)}),A=f.computed(()=>{const O=S.value-v.value;return Math.ceil(O/C.value)}),F=f.computed(()=>t.length>1),P=f.computed(()=>t.map(({timestamps:O,color:L,label:$})=>({data:gP({bucketCount:C.value,minStamp:v.value,maxStamp:S.value,timestamps:O}).map(([ct,ht])=>({x:ct,y:ht})),label:$,...(u==="sparkline_bar"||F.value)&&L&&{backgroundColor:L},...u!=="sparkline_bar"&&L&&{borderColor:L},...F.value&&u!=="sparkline_bar"&&{fill:!0}}))),B=f.computed(()=>{const O=P.value[0]?.data?.length??0,L=[];for(let $=0;$<O;$++){let q=0;for(let st=0;st<P.value.length;st++)q+=P.value[st].data[$].y;L.push(q)}return L}),N=f.computed(()=>{const O=B.value.reduce((L,$)=>Math.max(L,$),0);return Math.max(O,a??0)}),z=f.computed(()=>{const O=P.value.reduce((q,{data:st})=>[...q,...st.map(({y:ct})=>ct)],[]),L=O.length?O[0]:0,$=O.reduce((q,st)=>Math.min(q,st),L);return s===void 0?$:Math.min($,s)});f.watchEffect(()=>{h.maxCounts[m]=N.value,h.minCounts[m]=z.value});const k=f.computed(()=>{const O=Object.values(h.minCounts),L=O.length?O[0]:0;return O.reduce(($,q)=>Math.min($,q),L)}),w=f.computed(()=>Object.values(h.maxCounts).reduce((O,L)=>Math.max(O,L),0));return f.onUnmounted(()=>{e!==void 0&&n!==void 0&&_P(e,n)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:A,syncedMinCount:k,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},zu=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Uu=(e,t)=>t.sum>0?e/t.sum:null,y0=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},Hu=(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"},_0=18,xP=85;function wP(e,t,n,i){const{i18n:r}=Fp(),{formatUnit:s}=$n({i18n:r}),a=N=>N.map(z=>{const k=Math.min(z.ratio,.5)/.5;return{...z,color:Bs({metric:n.value}),tint:`${_0+k*(xP-_0)}%`}}),l=f.computed(()=>e.value?.data??[]),u=f.computed(()=>e.value?.meta?.metric_names??[]),d=f.computed(()=>{const N=n.value;return N&&u.value.includes(N)?N:u.value[0]}),h=f.computed(()=>u.value.filter(N=>N!==d.value)),m=f.computed(()=>e.value?.meta?.display?.[t.value]??{}),g=(N,z)=>{if(xo(N)||N==="count"||N==="requests")return"";const k=z===1?"":"s";return r.te(`chartUnits.${N}`)?r.t(`chartUnits.${N}`,{plural:k}):N},_=N=>N.replace(/\s+%/,"%").trim(),x=N=>{const z=k=>_(s(k,"%",{translateUnit:w=>g(w,k)}));return N>0&&N<.01?`< ${z(.01)}`:z(N)},v=(N,z)=>{if(N===null)return"–";const k=e.value?.meta?.metric_units?.[z]||"count";return k==="%"?x(N):_(s(N,k,{isBytes1024:!0,translateUnit:w=>g(w,N)}))},S=N=>r.te(`chartLabels.${N}`)?r.t(`chartLabels.${N}`):N,C=N=>gr(i.value,N)?.label||S(N),A=f.computed(()=>zu(l.value.map(N=>d.value?Jr(N.event[d.value]):null))),F=N=>h.value.flatMap(z=>{const k=Jr(N[z]);if(k===null)return[];const w=Hu(k,gr(i.value,z)?.thresholds);return[{key:z,label:C(z),value:v(k,z),threshold:w}]}),P=f.computed(()=>{if(!d.value)return[];const N=l.value.map(z=>{const k=z.event,w=String(k[t.value]),O=Jr(k[d.value])??0,L=Uu(O,A.value),$=L??0,q=w===Fu;return{id:w,name:q?S(Fu):m.value[w]?.name||w,deleted:!!m.value[w]?.deleted,isOther:q,isEmpty:w===tP,value:O,ratio:$,display:v(O,d.value),relative:L===null?"":x(L*100),tooltipRows:F(k)}}).sort((z,k)=>Number(z.isOther)-Number(k.isOther)||k.value-z.value);return a(N)});return{column:f.computed(()=>({dimension:t.value,label:C(t.value),total:v(A.value.sum,d.value??"count"),cells:P.value})),cells:P,sizeKey:d}}const St={useBarChartOptions:DR,useChartJSCommon:OR,useChartLegendValues:ER,useChartSelectedRange:RR,useExploreResultToDatasets:zR,useExploreResultToTimeDataset:$R,useScatterDatasets:XR,useDonutChartOptions:PR,useLineChartOptions:IR,useScatterChartOptions:BR,useI18n:Fp,useReportChartDataForSynthetics:ZR,useTranslatedUnits:QR,useEvaluateFeatureFlag:eP,useTooltipAbsolutePosition:mP,useSparklineSync:bP,useTopTalkersData:wP},el=e=>["interactive","zoom-interactive"].includes(e),Wu=(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,_)=>{const x=g.parsed[d],v=g.dataset.unit??e.units,S=a(x??0,v,{translateUnit:e.translateUnit}),C=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:C,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}},b0=(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 _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},vP=e=>e&&e.datasets&&e.datasets.length,SP=e=>vP(e)&&e.datasets.some(t=>t.data.length),TP=e=>e.datasets.some(t=>t.data[0]&&Hc(t.data[0].x)),kP=e=>!!SP(e)&&e.datasets.some(t=>t.data.length==1),MP=e=>TP(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)},x0=(e,t,n)=>{const s=e.y??0;return s<n?s+t*.15:s-t*.5};function w0(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const $u=(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)},DP=2,v0=10,S0=12,il=10,rl="y",Vu="y1",Xn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Yu=(e,t)=>(t||Xn)[e%Xn.length],CP="#6f7787",OP={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"}},AP=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return OP[t]?.background||"#fafafa"},EP=lS,qu=(e,t,n,i)=>{let r;return n?r=EP:Array.isArray(i)?r=Yu(e,i):r=i[t],r||Yu(e)},ju=e=>{switch(e){case"error":return cS;case"warning":return hS;case"neutral":return op;default:return op}},RP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},PP=2,IP=0,Gu=new Map,T0=(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)},LP=e=>{const n=document.createElement("canvas").getContext("2d"),i=ce({});return n.font=i.string,n.measureText(e).width},NP=()=>{const e="label_height";if(!Gu.has(e)){const t=ce({});Gu.set(e,t.lineHeight)}return Gu.get(e)},BP=(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),FP=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,zP=aS,UP={100:gS,101:yS,102:_S,103:bS,200:xS,201:wS,202:vS,203:SS,204:TS,205:kS,206:MS,207:DS,208:CS,226:OS,300:AS,301:ES,302:RS,303:PS,304:IS,305:LS,307:NS,308:BS,400:FS,401:zS,402:US,403:HS,404:WS,405:$S,406:VS,407:YS,408:qS,409:jS,410:GS,411:KS,412:XS,413:ZS,414:QS,415:JS,416:tT,417:eT,418:nT,421:iT,422:rT,423:sT,424:oT,425:aT,426:lT,428:cT,429:uT,431:dT,451:fT,500:hT,501:pT,502:mT,503:gT,504:yT,505:_T,506:bT,507:xT,508:wT,510:vT,511:ST},HP={100:TT,200:kT,300:MT,400:DT,500:CT},WP={"1XX":OT,"2XX":AT,"3XX":ET,"4XX":RT,"5XX":PT},k0=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return UP[t]??HP[n]??zP},Ku={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=k0(`${t}`),e),{}),____OTHER____:oS,...WP};function M0(e,t,n){const i=Op(),r=YP(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?$P(r,t):VP(r,t)}function $P(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 VP(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function YP(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function qP(e,t){const n=ZP(t);return"formatToParts"in n?GP(n,e):KP(n,e)}const jP={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 r=0;r<n.length;r++){const s=jP[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 KP(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 Xu={},D0=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")),XP=D0==="06/25/2014, 00:00:00"||D0==="06/25/2014 00:00:00";function ZP(e){return Xu[e]||(Xu[e]=XP?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"})),Xu[e]}function C0(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 O0=36e5,QP=6e4,Zu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Qu(e,t,n){if(!e)return 0;let i=Zu.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Zu.timezoneHH.exec(e),i)return r=parseInt(i[1],10),A0(r)?-(r*O0):NaN;if(i=Zu.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return A0(r,a)?(s=Math.abs(r)*O0+a*QP,i[1]==="+"?-s:s):NaN}if(e2(e)){t=new Date(t||Date.now());const a=n?t:JP(t),l=Ju(a,e);return-(n?l:t2(t,l,e))}return NaN}function JP(e){return C0(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Ju(e,t){const n=qP(e,t),i=C0(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 t2(e,t,n){let r=e.getTime()-t;const s=Ju(new Date(r),n);if(t===s)return t;r-=s-t;const a=Ju(new Date(r),n);return s===a?s:Math.max(s,a)}function A0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const E0={};function e2(e){if(E0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),E0[e]=!0,!0}catch{return!1}}const n2=60*1e3,i2={X:function(e,t,n){const i=td(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return R0(i);case"XXXX":case"XX":return ts(i);default:return ts(i,":")}},x:function(e,t,n){const i=td(n.timeZone,e);switch(t){case"x":return R0(i);case"xxxx":case"xx":return ts(i);default:return ts(i,":")}},O:function(e,t,n){const i=td(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+r2(i,":");default:return"GMT"+ts(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return M0("short",e,n);default:return M0("long",e,n)}}};function td(e,t){const n=e?Qu(e,t,!0)/n2: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 R0(e,t){return e%60===0?(e>0?"-":"+")+sl(Math.abs(e)/60,2):ts(e,t)}function r2(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 P0(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 s2=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ed=36e5,I0=6e4,o2=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:s2};function L0(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?o2: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=a2(e),{year:r,restDateString:s}=l2(i.date,n),a=c2(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=u2(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Qu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=P0(new Date(l+u)),d=P0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function a2(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 l2(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 c2(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,F0(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 h2(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 F0(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,z0(r)?N0(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 z0(r,a)?N0(t,r,a):new Date(NaN)}return null}function u2(e){let t,n,i=Qe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),nd(t)?t%24*ed:NaN;if(i=Qe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),nd(t,n)?t%24*ed+n*I0: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 nd(t,n,r)?t%24*ed+n*I0+r*1e3:NaN}return null}function N0(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 d2=[31,28,31,30,31,30,31,31,30,31,30,31],f2=[31,29,31,30,31,30,31,31,30,31,30,31];function B0(e){return e%400===0||e%4===0&&e%100!==0}function F0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=B0(e);if(i&&n>f2[t]||!i&&n>d2[t])return!1}return!0}function h2(e,t){if(t<1)return!1;const n=B0(e);return!(n&&t>366||!n&&t>365)}function z0(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function nd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const p2=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function id(e,t,n={}){t=String(t);const i=t.match(p2);if(i){const r=L0(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,"'"+i2[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return ya(e,t,n)}function m2(e,t,n){e=L0(e,n);const i=Qu(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},id(m2(e,t,{timeZone:i.timeZone}),n,i)}const g2=(e,t)=>`${bo(e,t,"yyyy")} W${bo(e,t,"II")}`,rd="yyyy-MM-dd h:mm:ss a",sd="h:mm:ss a",yr="yyyy-MM-dd h:mm a",es="h:mm a",y2="yyyy-MM-dd",od="MMM dd, yyyy h:mm:ss a",Bi="MMM dd, yyyy h:mm a",_2={secondly:e=>e?rd:sd,tenSecondly:e=>e?rd:sd,thirtySecondly:e=>e?rd:sd,minutely:e=>e?yr:es,fiveMinutely:e=>e?yr:es,tenMinutely:e=>e?yr:es,thirtyMinutely:e=>e?yr:es,hourly:e=>e?yr:es,twoHourly:e=>e?yr:es,twelveHourly:()=>yr,daily:()=>y2},b2={secondly:()=>od,tenSecondly:()=>od,thirtySecondly:()=>od,minutely:()=>Bi,fiveMinutely:()=>Bi,tenMinutely:()=>Bi,thirtyMinutely:()=>Bi,hourly:()=>Bi,twoHourly:()=>Bi,twelveHourly:()=>Bi,daily:()=>Bi};function U0({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 g2(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 H0=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>U0({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:_2,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ns=({tickValue:e,granularity:t,timezone:n})=>U0({tickValue:e,granularity:t,timezone:n,tooltipMap:b2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),W0=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",x2=e=>{const{i18n:t}=St.useI18n();return W0(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"),w2=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},v2=(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)},S2=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,v2(n,i)]))},$0=.7,ad=(e,t)=>{const n=Aa(e.trim());return n.valid?n.alpha(t).rgbString():e},ld=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:ap,outlier:rp,outlierBand:ad(sp,$0)};const n=window.getComputedStyle(t),i=(r,s)=>n.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",ap),outlier:i("--kui-color-background-danger",rp),outlierBand:ad(i("--kui-color-background-danger-weakest",sp),$0)}},T2="empty",V0=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??[],_=[];for(const x of g){const v=q0(x.timestamp,x.event[h],m?x.event[m]:void 0);if(v){if(d){const S=Y0(x.event[d]);if(S===void 0)continue;v.x=S}_.push(v)}}return{points:_,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}},Y0=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},q0=(e,t,n,i)=>{const r=new Date(e).valueOf(),s=Y0(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):T2,...a}},k2=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:r,label:s,unit:a}of n){const l=_r(e,r)??_r(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},M2=(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=_r(h,u);for(const g of D2(h,r)){const _=_r(g,n),x=i?_r(g,i)??_r(h,i):void 0,v=q0(m,_,i?x??null:void 0,k2(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"}},D2=(e,t)=>{if(!t)return[e];const n=_r(e,t);return Array.isArray(n)?n:[]},_r=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},j0=e=>Object.hasOwn(Bp.chartLabels,e),C2=["hidden","single","full"];var br=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(br||{});const O2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],A2=["gauge","top_n","single_value"],cd=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 G0={modes:{point(e,t){return ol(e,t,{intersect:!0})},nearest(e,t,n){return P2(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 ud(e,t,n){return(G0.modes[n.mode]||G0.modes.nearest)(e,t,n)}function E2(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 R2(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):E2(i,t,n.axis))}function P2(e,t,n){let i=Number.POSITIVE_INFINITY;return ol(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),l=R2(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 I2=(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)),K0=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function L2(e,t,n){for(const i of Object.keys(e))e[i]=al(e[i],t,n);return e}function N2(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 X0(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 Z0(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=xr(e,n,ve(-r));return X0(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 B2(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(I2(l,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Q0=e=>typeof e=="string"&&e.endsWith("%"),J0=e=>parseFloat(e)/100,ty=e=>al(J0(e),0,1),wo=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),F2={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 dd(e,t){return t==="start"?0:t==="end"?e:Q0(t)?ty(t)*e:e/2}function Fi(e,t,n=!0){return typeof t=="number"?t:Q0(t)?(n?ty(t):J0(t))*e:e}function z2(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 ey(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const l=Lt(a),u=t.width+(l?a.width:0)+n,d=t.height+(l?a.height:0)+n,h=fd(i),m=sy(e.x,u,r,h.x),g=sy(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 fd(e,t="center"){return Lt(e)?{x:Ct(e.x,t),y:Ct(e.y,t)}:(e=Ct(e,t),{x:e,y:e})}const ny=(e,t)=>e&&e.autoFit&&t<1;function iy(e,t){const n=e.font,i=Gt(n)?n:[n];return ny(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 ry(e){return e&&(rn(e.xValue)||rn(e.yValue))}function sy(e,t,n=0,i){return e-dd(t,i)+n}function is(e,t,n){const i=n.init;if(i){if(i===!0)return ay(t,n)}else return;return U2(e,t,n)}function oy(e,t,n){let i=!1;return t.forEach(r=>{sn(e[r])?(i=!0,n[r]=e[r]):rn(n[r])&&delete n[r]}),i}function ay(e,t){const n=t.type||"line";return F2[n](e)}function U2(e,t,n){const i=Jt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return ay(t,n);if(Lt(i))return i}const hd=new Map,H2=e=>isNaN(e)||e<=0,W2=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=iy(t),r=t.textStrokeWidth,s=Gt(n)?n:[n],a=s.join()+W2(i)+r+(e._measureText?"-spriting":"");return hd.has(a)||hd.set(a,q2(e,s,i,r)),hd.get(a)}function ly(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:L2(Ei(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),l&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function cy(e,t,n,i){const r=n.content;if(ll(r)){e.save(),e.globalAlpha=K2(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=Gt(r)?r:[r],a=iy(n,i),l=n.color,u=Gt(l)?l:[l],d=z2(t,n),h=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,$2(e,n)&&j2(e,{x:d,y:h},s,a),G2(e,{x:d,y:h},s,{fonts:a,colors:u}),e.restore()}function $2(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function V2(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*nu;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}H2(r)||Y2(e,{x:n,y:i,radius:r,rotation:l,style:a,rad:u})}function Y2(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,ee),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-Rt,a-se),e.arc(t+u,n-l,h,a-se,a),e.arc(t+l,n+u,h,a,a+se),e.arc(t-u,n+l,h,a+se,a+Rt),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 q2(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 j2(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 G2(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 K2(e,t){const n=Ai(e)?e:t;return Ai(n)?al(n,0,1):1}const uy=["left","bottom","top","right"];function X2(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&eI(t,s);if(!a||iI(t,s,a))return;if(e.save(),e.beginPath(),!ui(e,s))return e.restore();const{separatorStart:u,separatorEnd:d}=Z2(t,a),{sideStart:h,sideEnd:m}=J2(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 Z2(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=Q2(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 Q2(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 J2(e,t,n){const{y:i,width:r,height:s,options:a}=e,l=a.callout.start,u=tI(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 tI(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function eI(e,t){const n=t.position;return uy.includes(n)?n:nI(e,t)}function nI(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,_={x:h,y:m},x=t.start,v=Fi(a,x),S=Fi(l,x),C=[n,n+v,n+v,r],A=[i+S,s,i,s],F=[];for(let P=0;P<4;P++){const B=xr({x:C[P],y:A[P]},_,ve(g));F.push({position:uy[P],distance:Yr(B,{x:u,y:d})})}return F.sort((P,B)=>P.distance-B.distance)[0].position}function iI(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 dy={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 fy(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 hy(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 pd(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=gy(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=gy(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 py(e,t){if(!ry(t)){const n=pd(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 sI(e,t)}function rI(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?oI(r,s,t):aI(n,s,t),s}function my(e,t){const n=pd(e,t);return n.initProperties=is(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:uI(e,n,t),initProperties:n.initProperties}],n}function sI(e,t){const n=hy(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 gy(e,t){const n=fy(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function oI(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 aI(e,t,n){for(const i of Object.keys(dy)){const r=e[Sr(e,n,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=dy[i],m=fy(r,{min:n[s],max:n[a],start:r[l],end:r[u]});t[d]=m.start,t[h]=m.end}}}function lI({properties:e,options:t},n,i,r){const{x:s,x2:a,width:l}=e;return yy({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 cI({properties:e,options:t},n,i,r){const{y:s,y2:a,height:l}=e;return yy({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 yy(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+dd(d,s)}function uI(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=fd(i.position),s=Se(i.padding),a=ul(e.ctx,i),l=lI({properties:t,options:n},a,r,s),u=cI({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 md=["enter","leave"],gd=md.concat("click");function dI(e,t,n){t.listened=oy(n,gd,t.listeners),t.moveListened=!1,md.forEach(i=>{sn(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&sn(i.click)&&(t.listened=!0),t.moveListened||md.forEach(r=>{sn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function fI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return hI(e,t,n);case"click":return pI(e,t,n)}}function hI(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=ud(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=_y(s,"leave",r,i);return _y(s,"enter",i,r)||a}function _y({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=by(a.options[n]||e.listeners[n],a,t)||s);return s}function pI(e,t,n){const i=e.listeners,r=ud(e.visibleElements,t,n.interaction);let s;for(const a of r)s=by(a.options.click||i.click,a,t)||s;return s}function by(e,t,n){return Jt(e,[t.$context,n])===!0}const dl=["afterDraw","beforeDraw"];function mI(e,t,n){const i=t.visibleElements;t.hooked=oy(n,dl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||dl.forEach(s=>{sn(r.options[s])&&(t.hooked=!0)})})}function xy(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Jt(i,[t.$context])}}function gI(e,t,n){const i=wI(e.scales,t,n);let r=wy(t,i,"min","suggestedMin");r=wy(t,i,"max","suggestedMax")||r,r&&sn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function yI(e,t){for(const n of e)bI(n,t)}function wy(e,t,n,i){if(le(t[n])&&!_I(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function _I(e,t,n){return rn(e[t])||rn(e[n])}function bI(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=Sr(t,e,n);i&&!t[i]&&xI(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function xI(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(rn(e[n+i]))return!0;return!1}function wI(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ct(t.min,Number.NEGATIVE_INFINITY),max:Ct(t.max,Number.POSITIVE_INFINITY)};for(const l of n)l.scaleID===r?vy(l,t,["value","endValue"],a):Sr(e,l,s)===r&&vy(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function vy(e,t,n,i){for(const r of n){const s=e[r];if(rn(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 X0({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),ly(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return my(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 Z0({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||(DI(t,this),t.save(),cl(t,this.getCenterPoint(),this.rotation),cy(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=vI(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=TI(t,n,i);let l=ul(t.ctx,n);const u=kI(l,a);ny(n,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:m}=n,g=ey(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 vI(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof ro&&SI(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function SI(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 TI({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)},_={x:(g.left+g.right)/2,y:(g.top+g.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=_.y>m,C=S?r+x:a-x,A=MI(C,h,m,v);return{controllerMeta:{_centerX:h,_centerY:m,_radius:v,_counterclockwise:S,...A},point:_,radius:Math.min(l,Math.min(g.right-g.left,g.bottom-g.top)/2)}}function kI({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function MI(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:ee};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 DI(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 Z0({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=!rn(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),cl(t,this.getCenterPoint(),this.rotation),X2(t,this),ly(t,this,n),cy(t,CI(this),n),t.restore())}resolveElementProperties(t,n){let i;if(ry(n))i=hy(t,n);else{const{centerX:l,centerY:u}=pd(t,n);i={x:l,y:u}}const r=Se(n.padding),s=ul(t.ctx,n),a=ey(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 CI({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 yd=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),_d=(e,t,n)=>yd(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Sy=(e,t,n)=>yd(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,So=e=>e*e,OI=(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},Ty=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,bd=(e,t,n,i)=>({x:Ty(e.x,t.x,n.x,i),y:Ty(e.y,t.y,n.y,i)}),ky=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),My=(e,t,n,i)=>-Math.atan2(ky(e.x,t.x,n.x,i),ky(e.y,t.y,n.y,i))+.5*Rt;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,_=u.isPointInStroke(l,m,g)||xd(this,a,r);return u.restore(),_}const d=So(s);return PI(this,a,d,r)||xd(this,a,r)}return AI(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 HI(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Ey(this),_=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(_),t.beginPath(),t.moveTo(0+m,0),t.lineTo(u-g,0),t.shadowColor=l.borderShadowColor,t.stroke(),wd(t,0,m,d),wd(t,u,-g,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=rI(t,n),{x:r,y:s,x2:a,y2:l}=i,u=EI(i,t.chartArea),d=u?RI({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=UI(d,n,Yr(m,g))}const h=II(t,d,n.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}To.id="lineAnnotation";const Dy={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({},Dy),fill:!1,length:12,start:Object.assign({},Dy),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 AI(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=OI(t,n,e.getProps(["x","y","x2","y2"],s),i);return K0(a,r)||xd(e,{mouseX:t,mouseY:n},s,i)}function EI({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 Cy({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=Sy(a,{x:e,y:t},n),e=a),e>r&&(t=Sy(r,{x:e,y:t},n),e=r),t<i&&(e=_d(i,{x:e,y:t},n),t=i),t>s&&(e=_d(s,{x:e,y:t},n),t=s),{x:e,y:t}}function RI(e,t,n){const{x:i,y:r}=Cy(e,t,n),{x:s,y:a}=Cy(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function PI(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 _,x;return g<0?(_=s,x=a):g>1?(_=l,x=u):(_=s+g*d,x=a+g*h),So(t-_)+So(n-x)<=i}function xd(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function II(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 NI(t,n,{width:a,height:l,padding:r},e.chartArea)}function LI(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>Rt/2?s-Rt:s<Rt/-2?s+Rt:s}function NI(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"?LI(e):ve(t.rotation),g=BI(r,s,m),_=FI(e,t,{labelSize:g,padding:a},i),x=e.cp?bd(d,e.cp,h,_):yd(d,h,_),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},C=Ay(x.x,v)+l,A=Ay(x.y,S)+u;return{x:C-r/2,y:A-s/2,x2:C+r/2,y2:A+s/2,centerX:C,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:Da(m)}}function BI(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 FI(e,t,n,i){let r;const s=zI(e,i);return t.position==="start"?r=Oy({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-Oy({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=dd(1,t.position),r}function Oy(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 zI(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 Ay(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 Ey(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Ry(e,n),endAdjust:Ry(e,i)}}function Ry(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(_d(0,s,{x:0,y:r}))}function wd(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 UI(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=fd(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 Py(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),wd(e,0,-r,s),e.restore())}function HI(e,t,n,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Ey(t),_={x:r,y:s},x={x:a,y:l},v=My(_,n,x,0),S=My(_,n,x,1)-Rt,C=bd(_,n,x,m/i),A=bd(_,n,x,1-g/i),F=new Path2D;e.beginPath(),F.moveTo(C.x,C.y),F.quadraticCurveTo(n.x,n.y,A.x,A.y),e.shadowColor=u.borderShadowColor,e.stroke(F),t.path=F,t.ctx=e,Py(e,C,{angle:v,adjust:m},d),Py(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 WI({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,Rt/2,0,2*Rt),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return my(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 WI(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),_=Math.pow(m*(e.x-a)+g*(e.y-l),2),x=Math.pow(g*(e.x-a)-m*(e.y-l),2);return _/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"?N2({x:t,y:n},this.getCenterPoint(r),d/2,h):K0(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);V2(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=py(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&&VI(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=py(t,n),{sides:r,rotation:s}=n,a=[],l=2*Rt/r;let u=s*nu;for(let d=0;d<r;d++,u+=l){const h=$I(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 $I({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 VI(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=>{oe.describe(`elements.${zi[e].id}`,{_fallback:"plugins.annotation.common"})});const YI={update:Object.assign},qI=gd.concat(dl),Iy=(e,t)=>Lt(t)?Td(e,t):e,vd=e=>e==="color"||e==="font";function Sd(e="line"){return zi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function jI(e,t,n,i){const r=KI(e,n.animations,i),s=t.annotations,a=QI(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=Ly(a,l,u.type),h=u.setContext(ZI(e,d,a,u)),m=d.resolveElementProperties(e,h);m.skip=GI(m),"elements"in m&&(XI(d,m.elements,h,r),delete m.elements),rn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=Ny(h),r.update(d,m)}}function GI(e){return isNaN(e.x)||isNaN(e.y)}function KI(e,t,n){return n==="reset"||n==="none"||n==="resize"?YI:new gu(e,t)}function XI(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=Ly(r,s,a.type,a.initProperties),d=n[a.optionScope].override(a);l.options=Ny(d),i.update(u,l)}}function Ly(e,t,n,i){const r=zi[Sd(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Ny(e){const t=zi[Sd(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Td(e,t.defaults),Td(e,t.defaultRoutes));for(const i of qI)n[i]=e[i];return n}function Td(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];vd(i)&&Gt(s)?n[i]=s.map(a=>Iy(a,r)):n[i]=Iy(s,r)}return n}function ZI(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 QI(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 JI="3.1.0";const Ui=new Map,By=e=>e.type!=="doughnutLabel",tL=gd.concat(dl);var Fy={id:"annotation",version:JI,beforeRegister(){B2("chart.js","4.0",on.version)},afterRegister(){on.register(zi)},afterUnregister(){on.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;Lt(s)?Object.keys(s).forEach(a=>{const l=s[a];Lt(l)&&(l.id=a,r.push(l))}):Gt(s)&&r.push(...s),yI(r.filter(By),e.scales)},afterDataLimits(e,t){const n=Ui.get(e);gI(e,t.scale,n.annotations.filter(By).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Ui.get(e);dI(e,i,n),jI(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),mI(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);fI(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 ud(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=>!tL.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${zi[Sd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:vd,_fallback:!0},_indexable:vd}},additionalOptionScopes:[""]};function Mo(e,t,n){const{ctx:i,chartArea:r}=e,s=Ui.get(e);n&&to(i,r);const a=eL(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)nL(i,r,s,l);n&&eo(i)}function eL(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 nL(e,t,n,i){const r=i.element;i.main?(xy(n,r,"beforeDraw"),r.draw(e,t),xy(n,r,"afterDraw")):r.draw(e,t)}const iL={class:"zoom-timerange-container"},rL={class:"zoom-timerange-details"},sL={class:"label","data-testid":"zoom-timerange-from"},oL={class:"label","data-testid":"zoom-timerange-to"},aL=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)=>{w0(()=>{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",iL,[f.createElementVNode("div",rL,[f.createElementVNode("div",sL,f.toDisplayString(f.unref(n).t("zoom_time_range.from")),1),f.createElementVNode("div",null,f.toDisplayString(i.value),1),f.createElementVNode("div",oL,f.toDisplayString(f.unref(n).t("zoom_time_range.to")),1),f.createElementVNode("div",null,f.toDisplayString(r.value),1)])]))}}),Me=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},zy=Me(aL,[["__scopeId","data-v-4fa681cf"]]),lL={class:"zoom-actions-container"},cL={class:"zoom-actions-heading"},uL={class:"zoom-action-select"},dL=["data-testid"],fL=["aria-disabled","href"],hL=["onClick"],pL=Me(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",lL,[f.createElementVNode("div",cL,[f.createVNode(zy,{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(Bc)})`,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",uL,[(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,fL)):(f.openBlock(),f.createElementBlock("div",{key:1,onClick:u=>r(l)},f.toDisplayString(l.label),9,hL))],10,dL))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),mL={key:2},gL={class:"tooltip-title"},yL={class:"title"},_L={key:0,class:"subtitle"},bL={class:"context"},xL={class:"metric"},wL={class:"tooltip"},vL={key:0,class:"square-marker marker-placeholder"},SL={class:"display-value"},Do=Me(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}=fP(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],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),f.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),f.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();n("dimensions",{width:x,height:v})}}),(_,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(zy,{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(pL,{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",mL,[f.createElementVNode("div",gL,[f.createElementVNode("div",yL,[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(Bc)})`,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",_L,[f.createElementVNode("div",bL,f.toDisplayString(h.value),1),f.createElementVNode("div",xL,f.toDisplayString(m.value),1)])):f.createCommentVNode("",!0)]),f.createElementVNode("ul",wL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:C,value:A,isSegmentEmpty:F,isExtra:P},B)=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:C+B},[e.state.tooltipSeries.length?(f.openBlock(),f.createElementBlock("li",{key:0,class:f.normalizeClass({"extra-row":P})},[P?(f.openBlock(),f.createElementBlock("div",vL)):(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:F}])},f.toDisplayString(C),3),f.createElementVNode("span",SL,f.toDisplayString(A),1)],2)):f.createCommentVNode("",!0)],64))),128))])]))],6)):f.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),TL={key:0,class:"legend-container","data-testid":"legend"},kL=["onClick"],ML={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},DL=["stroke","stroke-dasharray"],CL=["title"],OL={class:"label truncate-label"},AL={key:0,class:"sub-label"},EL={key:0},RL={class:"tooltip-content"},ml=Me(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 on?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 on?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",TL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.items,({fillStyle:m,strokeStyle:g,text:_,datasetIndex:x,index:v,value:S,isSegmentEmpty:C,isKey:A,lineDash:F},P)=>(f.openBlock(),f.createElementBlock("li",{key:s({datasetIndex:x,index:v,isKey:A},P),class:f.normalizeClass({"legend-key":A}),onClick:B=>A?void 0:a(x,v)},[F?.length?(f.openBlock(),f.createElementBlock("svg",ML,[f.createElementVNode("line",{stroke:g,"stroke-dasharray":F.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,DL)])):(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)?`${_}: ${S.formatted}`:_},[f.createElementVNode("div",OL,f.toDisplayString(_),1),S&&(f.unref(i)||A)?(f.openBlock(),f.createElementBlock("div",AL,[A?(f.openBlock(),f.createElementBlock("span",EL,"-")):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(S.formatted),1)])):f.createCommentVNode("",!0)],10,CL)]),_:2},[C?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",RL,f.toDisplayString(f.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,kL))),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 PL(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 IL=new Uint8Array(16);function LL(){return crypto.getRandomValues(IL)}function kd(e,t,n){return crypto.randomUUID?crypto.randomUUID():NL(e)}function NL(e,t,n){e=e||{};const i=e.random??e.rng?.()??LL();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,PL(i)}const Uy=(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 Hy{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Uy(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,Uy(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 BL=["id"],FL=["id"],zL={class:"axis-tooltip-content"},UL="100%",HL="100%",WL=20,$L=20,Wy=6,VL=0,YL=10,qL=10,jL=1,GL=Me(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 Hy,l=f.useTemplateRef("chartContainer"),u=f.useTemplateRef("chartParent"),d=({chart:X},tt)=>{const rt=X.data,pt=rt.labels?.indexOf(tt);return rt.datasets.reduce((yt,mt,Et)=>{if(X.isDatasetVisible(Et)){const zt=mt.data[pt];return isNaN(zt)?yt:yt+zt}else return yt},0)},h=(X,tt,rt,pt)=>{const yt=pt==="horizontal";tt===null&&(tt=n.t("entityNoName"));const mt={type:"label",yValue:G=>yt?tt:d(G,tt),xValue:G=>yt?d(G,tt):tt},Et={...mt,position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>yt?0:-Math.abs(NP()),content:G=>T0(d(G,tt),rt)},zt={...mt,content:G=>FP(d(G,tt),BP(G.chart,X)),position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:G=>yt?LP(T0(d(G,tt),rt)):0,color:CP};return{[`${tt}-value`]:Et,[`${tt}-percent`]:zt}},m=f.useTemplateRef("canvas"),g=f.useTemplateRef("axis"),_=kd(),x=kd(),v=f.ref([]),S=f.inject("legendPosition",Le.Bottom),C=f.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),A=f.toRef(t,"metricUnit"),F=f.computed(()=>t.orientation==="horizontal"),P=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:F.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:B,tooltipAbsoluteTop:N}=St.useTooltipAbsolutePosition(u,P),z=f.ref(0),k=()=>t.annotations&&t.chartData.labels?.reduce((X,tt)=>Object.assign(X,h(t.chartData,tt,A.value,t.orientation)),{}),w={id:_,afterUpdate(X){z.value+=1,v.value=$u(X,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?k():{}}},$=[w,{id:"axisHover",afterEvent(X,tt){if(C.show=!1,tt.event.type==="mousemove"){const rt=tt.event,pt=X.options.indexAxis,yt=X.scales,mt=X.scales[pt].getLabelForValue(Number(X.scales[pt].getValueForPixel(rt[pt]))),zt=X.scales[pt].getLabels().indexOf(mt),G=t.chartData.isLabelEmpty?.[zt];if((lt=>lt==="x"?rt.y>yt.x.top:rt.x<yt.y.right)(pt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const $t=X.canvas.getContext("2d").measureText(mt).width,_t=Math.abs(Math.round(rt.x-$t*.5)),Vt=Math.round(rt.x+$t*.5),Te=X.canvas.getBoundingClientRect(),ke=40;C.left=pt==="x"?`${(_t>0?_t:Vt)-C.offset+Te.left}px`:`${rt.x-$t*.5-C.offset+Te.left}px`,C.top=`${rt.y-ke+Te.top}px`,mt.length>il?(C.show=!0,C.text=mt):G?(C.text=n.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],q=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),st=f.ref(0),ct=f.ref(0),ht=new ResizeObserver(w0(X=>{st.value=X[0].contentRect.width,ct.value=X[0].contentRect.height},100)),ut=f.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&!F.value?`${Math.max(X*(WL+Wy),st.value)}px`:UL}),vt=f.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&F.value?`${Math.max(X*($L+Wy),ct.value)}px`:HL});St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&on.register(Fy),l.value&&(st.value=l.value.offsetWidth,ct.value=l.value.offsetHeight,ht.observe(l.value))}),f.onUnmounted(()=>{l.value&&ht.unobserve(l.value)});const at=f.computed(()=>{const X=St.useBarChartOptions({tooltipState:P,legendID:_,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:F.value?"y":"x",numLabels:q});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:k(),clip:!1}}}}),dt=St.useChartJSCommon("bar",m,f.toRef(t,"chartData"),$,at);f.onBeforeUnmount(()=>{on.unregister(Fy)});const V={[Le.Bottom]:"column"},I=f.computed(()=>{if(g.value&&dt.value){const X=window.devicePixelRatio,tt=dt.value,rt=tt.scales.y.width*X+jL,pt=(tt.scales.y.height+tt.scales.y.top+tt.scales.x.height)*X,yt=g.value.getContext("2d");return yt.scale(X,X),yt.canvas.width=rt,yt.canvas.height=pt,yt.canvas.style.width=`${rt/X}px`,yt.canvas.style.height=`${pt/X}px`,{scale:X,width:rt*X,height:pt*X,targetCtx:yt}}return null}),W=X=>{const tt=X.target;if(I.value&&dt.value&&!F.value){const rt=I.value.scale,pt=I.value.targetCtx,yt=I.value.width,mt=I.value.height,Et=dt.value,zt=Et.canvas;pt.fillStyle="white",tt.scrollLeft>=VL&&tt.scrollLeft<=YL?(pt.globalCompositeOperation="source-over",pt.clearRect(0,0,yt,mt),pt.drawImage(zt,0,0,yt,mt,0,0,yt,mt),pt.globalCompositeOperation="destination-over",pt.fillRect(0,0,yt,mt)):(pt.globalCompositeOperation="source-over",pt.fillRect(0,(Et.scales.y.height+Et.scales.y.top+qL)*rt,yt,Et.scales.x.height*rt))}P.offsetY=tt.scrollTop,P.offsetX=tt.scrollLeft,C.offset=tt.scrollLeft},nt=({width:X,height:tt})=>{P.width=X,P.height=tt};f.watch(()=>t.orientation,()=>{if(g.value&&I.value){const X=I.value.width,tt=I.value.height;(g.value?.getContext("2d")).clearRect(0,0,X,tt)}P.showTooltip=!1,P.interactionMode="idle"}),f.watch(()=>t.annotations,X=>{dt.value&&(X?dt.value.options.plugins.annotation.annotations=k(t.chartData):delete dt.value.options.plugins.annotation.annotations)});const ot=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(X,tt)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",V[f.unref(S)]])},[f.createElementVNode("canvas",{id:f.unref(r),ref:"axis",class:"axis"},null,8,BL),f.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:tt[0]||(tt[0]=rt=>ot()),onScroll:W},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:ut.value,height:vt.value})},[f.createElementVNode("canvas",{id:f.unref(s),ref:"canvas",class:"chart-canvas"},null,8,FL)],4)],544),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[C.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[f.createElementVNode("div",zL,f.toDisplayString(C.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(Do,{"absolute-left":f.unref(B),"absolute-top":f.unref(N),"chart-parent-ref":u.value,state:P,"tooltip-title":e.tooltipTitle,onDimensions:nt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),f.createVNode(ml,{id:f.unref(_),"chart-instance":f.unref(dt),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const KL={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"};jm._date.override({_id:"date-fns",formats:function(){return KL},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=At(e):n==="string"&&(typeof t=="string"?e=qM(e,t,new Date,this.options):e=Lp(e,this.options)),Hc(e)?e.getTime():null},format:function(e,t){return ya(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return zc(e,t);case"second":return HT(e,t);case"minute":return zT(e,t);case"hour":return NT(e,t);case"day":return ma(e,t);case"week":return WT(e,t);case"month":return Fc(e,t);case"quarter":return UT(e,t);case"year":return $T(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Wc(e,t);case"second":return ZT(e,t);case"minute":return GT(e,t);case"hour":return jT(e,t);case"day":return hp(e,t);case"week":return QT(e,t);case"month":return yp(e,t);case"quarter":return XT(e,t);case"year":return JT(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return XM(e);case"minute":return KM(e);case"hour":return GM(e);case"day":return Uc(e);case"week":return Vn(e);case"isoWeek":return Vn(e,{weekStartsOn:+n});case"month":return ek(e);case"quarter":return tk(e);case"year":return _p(e);default:return e}},endOf:function(e,t){switch(t){case"second":return ak(e);case"minute":return sk(e);case"hour":return ik(e);case"day":return mp(e);case"week":return rk(e);case"month":return gp(e);case"quarter":return ok(e);case"year":return nk(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}},XL={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...$y,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},ZL=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 QL(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return f.isProxy(t)?new Proxy(e,{}):e}function JL(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Vy(e,t){e.labels=t}function Yy(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 tN(e,t){const n={labels:[],datasets:[]};return Vy(n,e.labels),Yy(n,e.datasets,t),n}const eN=f.defineComponent({props:XL,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:_}=e,x=tN(h,_),v=QL(x,h);s.value=new on(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,[_,x]=h;const v=f.toRaw(s.value);if(!v)return;let S=!1;if(m){const C=as(m),A=as(_);C&&C!==A&&(JL(v,C),S=!0)}if(g){const C=as(g.labels),A=as(x.labels),F=as(g.datasets),P=as(x.datasets);C!==A&&(Vy(v.config.data,C),S=!0),F&&F!==P&&(Yy(v.config.data,F,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 gl(e,t){return on.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(eN,ZL({ref:l},{type:e,...n}))}})}const qy=gl("bar",$m),jy=gl("doughnut",ro),Gy=gl("line",Vm),nN=gl("scatter",qm),iN={class:"chart-container"},rN={key:0,class:"chart-center-metric"},sN={class:"chart-center-total"},oN={key:0,class:"chart-center-unit"},aN=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.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:d,tooltipAbsoluteTop:h}=St.useTooltipAbsolutePosition(l,u),m={id:r,afterUpdate(z){a.value=z.options.plugins.legend.labels.generateLabels(z).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},g=f.computed(()=>[m]),_=f.computed(()=>[t.chartData.datasets.reduce((k,w)=>(k.labels.push(w.label),k.backgroundColor.push(w.backgroundColor),k.hoverBorderColor.push(Aa(w.backgroundColor).saturate(.5).darken(.15).hexString()),k.data.push(w.data.reduce((O,L)=>O+L,0)),k),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=$n({i18n:i}),v=f.computed(()=>w2(t.metricName??"")),S=f.computed(()=>{const z=_.value[0]?.data.reduce((k,w)=>k+w,0)??0;return x(z,t.metricUnit,{approximate:!0,translateUnit:(k,w)=>n(k,w)}).trim()}),C=f.computed(()=>t.tooltipMetricDisplay||""),A=f.computed(()=>({...t.chartData,datasets:_.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:F}=St.useDonutChartOptions({tooltipState:u,legendID:r}),P=f.ref(),B=z=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[z],N=({width:z,height:k})=>{u.width=z,u.height=k};return(z,k)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",B(e.legendPosition)]),"data-testid":"donut-chart-parent"},[f.createElementVNode("div",iN,[f.createVNode(f.unref(jy),{ref_key:"chartInstance",ref:P,"chart-id":f.unref(s),data:A.value,options:f.unref(F),plugins:g.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&v.value?(f.openBlock(),f.createElementBlock("div",rN,[f.createElementVNode("span",sN,f.toDisplayString(S.value),1),C.value?(f.openBlock(),f.createElementBlock("span",oN,f.toDisplayString(C.value),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(Do,{"absolute-left":f.unref(d),"absolute-top":f.unref(h),state:u,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:N},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),f.createVNode(ml,{id:f.unref(r),"chart-instance":P.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),lN=Me(aN,[["__scopeId","data-v-ecbae072"]]);class cN{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 uN=1.5;class dN{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=uN;for(const{value:m,color:g,borderDash:_}of r){if(!Number.isFinite(m))continue;const x=s.getPixelForValue(m);x<a||x>l||(h.beginPath(),h.setLineDash(_),h.strokeStyle=g,h.moveTo(u,x),h.lineTo(d,x),h.stroke())}h.restore()}}const fN={class:"chart-container"},hN=Me(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:()=>ld()}},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 cN,u=new dN,d=crypto.randomUUID(),h=crypto.randomUUID(),m=f.ref(),g=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:_,tooltipAbsoluteTop:x}=St.useTooltipAbsolutePosition(a,g);St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const v=f.computed(()=>t.chartData?.outlier),S=f.computed(()=>t.chartData?.referenceLines??[]),C=f.ref([]),A={id:d,afterUpdate(O){C.value=$u(O,void 0,t.chartLegendSortFn)}},F=f.computed(()=>{const O=[];v.value&&O.push({text:v.value.label,fillStyle:v.value.color,strokeStyle:v.value.color,isKey:!0});for(const L of S.value)O.push({text:L.label,fillStyle:L.color,strokeStyle:L.color,lineDash:L.borderDash,isKey:!0,value:{raw:L.value,formatted:r(L.value,t.metricUnit,{translateUnit:s})}});return O}),P=f.computed(()=>[...C.value,...F.value]),B=f.computed(()=>t.shadeOutlierRegion?v.value?.value:void 0),N=f.computed(()=>[A,...B.value!==void 0?[l]:[],...S.value.length?[u]:[]]),z=f.computed(()=>`scatter-${N.value.map(O=>O.id).join("-")}`),{options:k}=St.useScatterChartOptions({tooltipState:g,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:B,referenceLines:S,themeColors:f.toRef(t,"themeColors")}),w=O=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[O];return(O,L)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",w(f.unref(n))]),"data-testid":"scatter-chart-parent"},[f.createElementVNode("div",fN,[(f.openBlock(),f.createBlock(f.unref(nN),{key:z.value,ref_key:"chartInstance",ref:m,"chart-id":f.unref(h),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:f.unref(k),plugins:N.value},null,8,["chart-id","data","options","plugins"]))]),f.createVNode(Do,{"absolute-left":f.unref(_),"absolute-top":f.unref(x),"data-testid":"tooltip",granularity:e.granularity,state:g,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),f.createVNode(ml,{id:f.unref(d),"chart-instance":m.value,"data-testid":"legend",items:P.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3bb682a5"]]),Md=(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()},Je={},pN=()=>{Je.x=void 0,Je.chart=void 0,Je.strategy=void 0,Je.group=void 0},mN=10;class Ky{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<mN)return;const r=()=>{Je.chart=n,Je.strategy=this._brushStrategy,Je.group=this._brushGroup;for(const s of Object.values(on.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(Je.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Je.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;Md(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;Md(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Je.x===void 0)return;const n=Je.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Je.group===this._brushGroup&&Md(t.ctx,Je.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&&Je.chart===t){const n=Je.x!==void 0;if(pN(),n)for(const i of Object.values(on.instances))i!==t&&i.update("none")}}}const gN=(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()},yN=(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()},Xy=(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)}},Zy=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class _N{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=Xy(t,this);d&&Zy("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=Xy(t,this);d?Zy("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)&&(yN(t,this._startX,this._endX),gN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const bN=20,xN="rgba(255, 171, 171, 0.4)",wN="rgba(255, 196, 0, 0.2)",Qy=(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)},Jy=e=>"yAxisID"in e&&e.yAxisID||rl,t_=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?Jy(n):rl},vN=(e,t,n=rl)=>{const i=[];return e.data.datasets.forEach(r=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(r)).visible||Jy(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=Qy(a[h-1],a[h],l.value):u[h-1].aboveThreshold&&!u[h].aboveThreshold&&d!==void 0&&(i.push({start:d,end:Qy(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},SN=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 TN{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[t_(t,d)]??t.scales.y).getValueForPixel(l-u.top);if(m){const g=this._thresholds?.[d];g&&g.forEach(_=>{_.hovered=Math.abs(_.value-m)<bN})}}}};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=t_(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=ju(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=ju(h.type),i.font=pS,i.fillText(g,t.chartArea.left,m-4),i.restore())});const u=vN(t,s,a);SN(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"?xN:wN,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=ju(h.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const kN=Me(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 Ky,a=new Hy,l=new _N,u=new TN(r),{translateUnit:d}=St.useTranslatedUnits(),h=f.ref(),m=crypto.randomUUID(),g=crypto.randomUUID(),_=f.ref([]),x=f.inject("legendPosition",Le.Bottom),v=f.useTemplateRef("chartParent"),S=f.ref(void 0),C=f.ref(!1),A=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:F,tooltipAbsoluteTop:P}=St.useTooltipAbsolutePosition(v,A),B={id:m,afterUpdate(V){_.value=$u(V,n.legendValues,n.chartLegendSortFn)}},N=f.computed(()=>[B,a,...n.brush?[l]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[u]:[]]),z=f.computed(()=>`line-${N.value.map(V=>V.id).join("-")}`),k=f.computed(()=>`bar-${N.value.map(V=>V.id).join("-")}`),w=f.computed(()=>n.chartData&&kP(n.chartData)),{options:O}=St.useLineChartOptions({tooltipState:A,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:w,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 L=V=>V?V.end.getTime()>V.start.getTime():!1,$=V=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[V],q=({width:V,height:I})=>{A.width=V,A.height=I},st=(V=!0)=>{A.interactionMode="idle",A.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(V),s.isPaused&&s.resume()},ct=()=>{A.interactionMode="interactive"},ht=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(A.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(C.value){C.value=!1;return}A.interactionMode!=="idle"?st():ct(),ht()};f.watch(()=>n.type,()=>{A.interactionMode="idle",A.showTooltip=!1,s.destroyClickedSegment()});const vt=V=>{V.preventDefault(),V.stopPropagation();const{xStart:I,xEnd:W}=V.detail,nt={start:new Date(I),end:new Date(W),type:"absolute"};if(!L(nt)){S.value=void 0,st(!1);return}S.value=nt,A.interactionMode="zoom-interactive",nt&&i("select-chart-range",nt)},at=V=>{A.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:I,xEnd:W}=V.detail;S.value={start:new Date(I),end:new Date(W),type:"absolute"}},dt=V=>{if(!v.value||A.interactionMode==="idle")return;const I=V.target;I&&v.value.contains(I)||C.value||st(!1)};return f.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",vt),h.value.chart.canvas.removeEventListener("dragSelectMove",at),h.value.chart.canvas.addEventListener("dragSelect",vt),h.value.chart.canvas.addEventListener("dragSelectMove",at))}),f.onMounted(()=>{document.addEventListener("click",dt,!0)}),f.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",vt),h.value.chart.canvas.removeEventListener("dragSelectMove",at)),document.removeEventListener("click",dt,!0)}),(V,I)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",$(f.unref(x))]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:I[0]||(I[0]=W=>ut())},[e.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(Gy),{key:z.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(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(qy),{key:k.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(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),f.createVNode(Do,{"absolute-left":f.unref(F),"absolute-top":f.unref(P),"data-testid":"tooltip",granularity:e.granularity,state:A,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:q,onOnAction:I[1]||(I[1]=()=>st(!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:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-28d026be"]]),MN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},DN={class:"tooltip-content"},CN={key:2,class:"analytics-chart-parent"},ON=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(()=>cd(i.chartData)?void 0:i.chartData),a=f.computed(()=>{const G=i.chartOptions.metricAxisMap,it=s.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!G||!it.some(lt=>G[lt]==="right")))return G}),l=f.computed(()=>!!a.value),u=(G,it)=>a.value?G.filter(lt=>(a.value?.[lt]??"left")===it):G,d=f.computed(()=>{const G=s.value?.meta,it=G?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!l.value&&it.length>1&&Object.keys(G?.display??{}).length>0?it:[]}),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 G=s.value;return!G||!h.value||!m.value?G:{...G,meta:{...G.meta,metric_names:[m.value]}}}),_=f.computed(()=>{const G=i.chartOptions.threshold;return!h.value||!G?G:{...G,...Object.fromEntries(Object.keys(G).filter(it=>it!==m.value).map(it=>[it,[]]))}}),x=f.computed(()=>{if(ht.value)return cd(i.chartData)?i.chartData:V0(i.chartData)}),v=f.inject("app:konnectColorMode",f.computed(()=>"light")),S=f.useTemplateRef("chartShell"),C=f.computed(()=>(v.value,ld(S.value))),A=f.computed(()=>{if(x.value){const{start:it,end:lt,metric:$t,metricUnit:_t,truncated:Vt,limit:Te,datasource:ke}=x.value;return{start:it,end:lt,metricNames:[$t],metricUnits:{[$t]:_t??""},truncated:Vt,limit:Te,datasource:ke}}const G=g.value?.meta;return{start:G?.start,end:G?.end,metricNames:G?.metric_names,metricUnits:G?.metric_units,truncated:G?.truncated,limit:G?.limit,datasource:G?.datasource}}),F=f.computed(()=>ht.value?St.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:C},x).value:s.value?st.value?St.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ku,metricAxisMap:a.value},g).value:St.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ku},s).value:{datasets:[]}),P=f.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),B=f.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:it}=A.value;if(G&&it)return new Date(it).getTime()-new Date(G).getTime()}),N=f.computed(()=>A.value.metricUnits?h.value&&m.value?A.value.metricUnits[m.value]??"":Object.values(A.value.metricUnits)[0]??"":""),z=f.computed(()=>A.value.metricUnits?h.value&&m.value?m.value:Object.keys(A.value.metricUnits)[0]??"":""),k=f.computed(()=>i.showLegendValues&&i.legendPosition!==Le.Hidden),{legendValues:w}=St.useChartLegendValues(F,i.chartOptions.type,N),O=f.computed(()=>A.value.limit?.toString()||null),L=f.computed(()=>i.chartOptions.hideTruncationWarning?!1:A.value.truncated||!1),$=f.computed(()=>r.t("limitedResultsShown",{maxReturned:O.value})),q=f.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),st=f.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),ct=f.computed(()=>i.chartOptions.type==="donut"),ht=f.computed(()=>i.chartOptions.type==="scatter"),ut=f.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),vt=f.computed(()=>{const{metricNames:G,metricUnits:it}=A.value;if(l.value||!G||!it)return;const lt=G[0],$t=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})})}if(lt)return xo($t)&&r.te(`metricAxisTitles.${lt}`)?r.t(`metricAxisTitles.${lt}`)||void 0:r.te(`chartLabels.${lt}`)?r.t(`chartLabels.${lt}`):lt}),at=f.computed(()=>{const G=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(G)return G;const{metricNames:it,metricUnits:lt}=A.value;if(!(!it||!lt))return V(u(it,"left"),lt)}),dt=f.computed(()=>{if(!l.value)return;const{metricNames:G,metricUnits:it}=A.value,lt=G&&it?V(u(G,"right"),it):void 0;return{title:i.chartOptions.yAxes?.right?.title??lt,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),V=(G,it)=>{const lt=G[0];if(!lt)return;const $t=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})})}return I(lt,$t)},I=(G,it)=>{if(r.te(`metricAxisTitles.${G}`)){if(xo(it))return r.t(`metricAxisTitles.${G}`)||void 0;const lt=r.te(`chartUnits.${it}`)?r.t(`chartUnits.${it}`,{plural:"s"}):it;return r.t(`metricAxisTitles.${G}`,{unit:lt})||void 0}return G||void 0},W=f.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,it=st.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if(it)return r.te(`chartLabels.${it}`)?r.t(`chartLabels.${it}`):it}),nt=f.computed(()=>{if(Mx(A.value.datasource))return r.t("timestampAxisTitles.platform");const G=ca(s.value?.meta?.granularity_ms);if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),ot=f.computed(()=>{const G=x.value?.xMetric;return G?I(G,x.value?.xMetricUnit??""):nt.value}),X=f.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),tt=f.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),rt=f.computed(()=>ht.value?!!x.value?.points.length:st.value?MP(F.value):!!(s.value&&s.value.meta&&s.value.data.length)),pt=f.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?ca(G.meta.granularity_ms)||"hourly":ca(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),yt=f.computed(()=>ca(s.value?.meta?.granularity_ms)||"secondly"),mt=f.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,it)=>G.text===r.t("chartLabels.____OTHER____")?1:it.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt(it.text,10))?G.text<it.text?-1:1:G.value&&it.value?it.value.raw-G.value.raw:0),Et=f.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,it)=>G.label===r.t("chartLabels.____OTHER____")?1:it.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt(it.label,10))?G.label<it.label?-1:1:G.value&&it.value?it.rawValue-G.rawValue:0),zt=f.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>n("zoom-time-range",G)}]:[],...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",k),f.provide("legendPosition",f.toRef(i,"legendPosition")),(G,it)=>{const lt=f.resolveComponent("KTooltip"),$t=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{ref:"chartShell",class:f.normalizeClass(["analytics-chart-shell",{"show-values":k.value}])},[rt.value&&L.value&&O.value?(f.openBlock(),f.createElementBlock("div",MN,[f.createVNode(lt,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createElementVNode("div",DN,f.toDisplayString($.value),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(fe.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(fS)})`,size:`var(--kui-icon-size-40, ${f.unref(mS)})`},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),rt.value?(f.openBlock(),f.createElementBlock("div",CN,[st.value?(f.openBlock(),f.createBlock(kN,{key:0,brush:P.value,"chart-data":F.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Et.value,"dimension-axes-title":nt.value,fill:e.chartOptions.stacked,granularity:pt.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":N.value,"right-y-axis":dt.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:_.value,"time-range-ms":B.value,"tooltip-metric-display":vt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":zt.value,onSelectChartRange:it[0]||(it[0]=_t=>n("select-chart-range",_t)),onZoomTimeRange:it[1]||(it[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"])):q.value?(f.openBlock(),f.createBlock(GL,{key:1,annotations:e.showAnnotations,"chart-data":F.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Et.value,"data-testid":"bar-chart-container","dimension-axes-title":W.value,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":N.value,orientation:ut.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":vt.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"])):ct.value?(f.openBlock(),f.createBlock(lN,{key:2,"chart-data":F.value,"dataset-colors":e.chartOptions.chartDatasetColors||f.unref(Ku),"legend-position":e.legendPosition,"legend-values":f.unref(w),"metric-name":z.value,"metric-unit":N.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":W.value,"tooltip-metric-display":vt.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"])):ht.value?(f.openBlock(),f.createBlock(hN,{key:3,"chart-data":F.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":Et.value,"data-testid":"scatter-chart-container","dimension-axes-title":ot.value,granularity:yt.value,"metric-axes-title":at.value,"metric-unit":N.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":C.value,"time-range-ms":B.value,"tooltip-metric-display":vt.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($t,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(X.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(tt.value),1)]),_:1}))],2)}}}),AN=Me(ON,[["__scopeId","data-v-c5c250ba"]]),EN={class:"chart-parent","data-testid":"gauge-chart-parent"},RN={class:"chart-totals-flex"},PN={key:1,class:"metric-small","data-testid":"gauge-chart-total"},IN=Me(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(kd()),r=f.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((v,S)=>v+S,0)),_),{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,_)=>(f.openBlock(),f.createElementBlock("div",EN,[f.createElementVNode("div",RN,[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",PN,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(jy),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),LN={key:1,class:"single-value-wrapper"},NN={class:"single-value-metric"},BN={class:"name-unit-alignment"},FN={class:"single-value","data-testid":"single-value-chart"},zN={key:0,class:"single-value-unit"},UN={class:"single-value-metric-name"},HN={key:0,class:"single-value-trend"},WN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},Dd="t1",Cd="t2",$N=Me(f.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:f0},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:Dd,secondLevelKey:Cd})),l=f.computed(()=>a.value?.previous?.[Dd]?.[Cd]),u=f.computed(()=>a.value?.current?.[Dd]?.[Cd]),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 O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const L=`chartUnits.${O}`;return t.te(L)?t.t(L,{plural:""}):""}}),_=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 O=d.value[0].event[h.value];return typeof O!="number"||isNaN(O)?null:O}),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),C=f.computed(()=>{const O=v.value;if(O===null)return"-";const L=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(L==="usd")return i(O);if(L==="bytes")return n(O);if(O>=1e9){const q=(O/1e9).toFixed(1);return q.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${q}B`}if(O>=1e7){const q=(O/1e6).toFixed(1);return q.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${q}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:f0;return O.toLocaleString("en-US",{maximumFractionDigits:$})}),A=f.computed(()=>r.showTrend&&r.data?.data?.length<2),F=f.computed(()=>er.calculateChange(v.value??0,x.value??0)||0),P=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(F.value,!0,r.increaseIsBad)}),B=f.computed(()=>er.defineIcon(P.value,r.increaseIsBad)),N=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(F.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),z=er.useTrendRange(f.computed(()=>r.showTrend),void 0,f.computed(()=>r.data.meta)),k=O=>O>0?"positive":O<0?"negative":"neutral",w=O=>O>0?dS:O<0?uS:lp;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)}),(O,L)=>{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",LN,[f.createElementVNode("div",NN,[f.createElementVNode("div",BN,[f.createElementVNode("span",FN,f.toDisplayString(C.value),1),_.value&&g.value?(f.openBlock(),f.createElementBlock("span",zN," "+f.toDisplayString(g.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",UN,f.toDisplayString(m.value),1)]),e.showTrend?(f.openBlock(),f.createElementBlock("div",HN,[f.createElementVNode("div",{class:f.normalizeClass(["trend-change",k(P.value)]),"data-testid":"single-value-trend"},[A.value||P.value!==0?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(B.value),{key:0,color:w(P.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(lp)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])),f.createElementVNode("div",null,f.toDisplayString(N.value),1)],2),f.unref(z)?(f.openBlock(),f.createElementBlock("div",WN,f.toDisplayString(f.unref(z)),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),VN={class:"simple-chart-shell"},YN={key:1,class:"analytics-chart-parent"},qN=Me(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",VN,[u.value?(f.openBlock(),f.createElementBlock("div",YN,[s.value?(f.openBlock(),f.createBlock(IN,{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($N,{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"]]),jN={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}},GN=(e,t)=>{if(!(!e||!t))return jN[e]?.[t.toLowerCase()]},KN=["data-threshold"],XN=Me(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,KN))}}),[["__scopeId","data-v-24eb60ef"]]),ZN=["data-threshold"],QN={class:"top-n-metric-cell-value"},JN={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},tB=Me(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",QN,f.toDisplayString(e.display),1),e.relative?(f.openBlock(),f.createElementBlock("span",JN,"("+f.toDisplayString(e.relative)+")",1)):f.createCommentVNode("",!0)],10,ZN))}}),[["__scopeId","data-v-17e7f860"]]),eB={class:"top-n-card-title","data-testid":"top-n-card-title"},nB={class:"top-n-card-description","data-testid":"top-n-card-description"},iB={key:3,class:"top-n-table","data-testid":"top-n-table"},rB={"data-testid":"top-n-table-header"},sB={class:"top-n-table-header-row"},oB=["colspan"],aB={class:"table-header-label"},lB=["data-testid"],cB={class:"top-n-table-cell-label"},uB={key:0,class:"top-n-table-cell top-n-table-cell-bar"},dB=3,fB=Me(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,dB):[]),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]),_=f.computed(()=>g.value?dt(g.value):""),x=f.computed(()=>{const I=a.value.map(W=>({key:W,columnKey:W,label:ut(W,u.value?dt(W):n.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&I.push({key:"value",columnKey:g.value,label:ut(g.value,_.value),type:"metric"}),m.value.forEach((W,nt)=>{nt!==0&&I.push({key:W,columnKey:W,label:ut(W,dt(W)),type:"metric"})}),I}),v=f.computed(()=>x.value.filter(I=>I.type==="metric")),S=f.computed(()=>x.value.filter(I=>I.type==="dimension").slice(1)),C=I=>I.type==="dimension"&&I.key===d.value,A=I=>I.type==="metric"&&!!gr(t.columnOptions,I.columnKey)?.bar,F=I=>u.value&&I.type==="dimension"&&!C(I),P=I=>{const W=I.event;return String(W[l.value])},B=(I,W)=>{const nt=String(I.event[W]),ot=t.data.meta?.display?.[W]?.[nt];return{dimension:W,id:nt,name:ot?.name||"-",deleted:!!ot?.deleted}},N=I=>{const W=P(I),nt=h.value&&h.value[W];return nt?nt.name:"-"},z=I=>{const W=P(I),nt=h.value&&h.value[W];return nt?!!nt.deleted:!1},k=I=>{const W=nt=>i(nt,"%",{translateUnit:ot=>V(ot,nt)});return I>0&&I<.01?`< ${W(.01)}`:W(I)},w=(I,W)=>{const nt=I.event[W];if(nt==null)return"–";const ot=typeof nt=="number"?nt:Number(nt);if(Number.isNaN(ot))return"–";const X=t.data.meta?.metric_units?.[W]||"count";if(X==="%")return k(ot);const tt=["count","count/minute","token count"].includes(X);return i(ot,X,{approximate:tt,isBytes1024:!0,translateUnit:rt=>V(rt,ot)})},O=f.computed(()=>Object.fromEntries(m.value.map(I=>[I,zu(r.value.map(W=>Jr(W.event[I])))]))),L=(I,W)=>{const nt=gr(t.columnOptions,W),ot=Jr(I.event[W]);if(!nt||ot===null)return{display:w(I,W)};const X=O.value[W],tt=nt.value==="relative"?Uu(ot,X):null;return{display:w(I,W),relative:tt===null?void 0:k(tt*100),barRatio:nt.bar?y0(ot,X,nt.bar):void 0,threshold:Hu(ot,nt.thresholds)}},$=f.computed(()=>r.value?.length?r.value.map(I=>{const W=a.value.map(tt=>B(I,tt)),nt=W[0],ot=nt?.id||P(I),X={id:ot,rowKey:W.map(tt=>`${tt.dimension}:${tt.id}`).join("|")||ot,name:nt?.name||N(I),deleted:z(I),dimensions:W,metrics:{},original:I};return m.value.forEach((tt,rt)=>{X.metrics[rt===0?"value":tt]=L(I,tt)}),X}):[]),q=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(I=>!Object.keys(t.data.meta.display[I]||{}).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=(I,W)=>I.metrics[W]??{display:"–"},ct=(I,W)=>I.dimensions.find(nt=>nt.dimension===W)?.id||"",ht=(I,W)=>GN(gr(t.columnOptions,I)?.icon_set,W),ut=(I,W)=>I&&gr(t.columnOptions,I)?.label||W,vt=(I,W)=>I.dimensions.find(nt=>nt.dimension===W)?.name||"–",at=(I,W)=>{const nt=I.dimensions.find(ot=>ot.dimension===W);return{id:nt?.id||"",name:nt?.name||"–",deleted:nt?.deleted||!1,dimension:W,dimensions:I.dimensions,isEmpty:nt?.id==="empty"}},dt=I=>n.te(`chartLabels.${I}`)?n.t(`chartLabels.${I}`):I,V=(I,W)=>{if(xo(I)||I==="count"||I==="requests")return"";const nt=W===1?"":"s";return n.te(`chartUnits.${I}`)?n.t(`chartUnits.${I}`,{plural:nt}):I};return(I,W)=>{const nt=f.resolveComponent("KEmptyState"),ot=f.resolveComponent("KSkeleton"),X=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(X,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[q.value?(f.openBlock(),f.createBlock(nt,{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(q.value),1)]),_:1})):e.isLoading?(f.openBlock(),f.createBlock(ot,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",iB,[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",sB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,tt=>(f.openBlock(),f.createElementBlock("th",{key:tt.key,class:f.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":tt.type==="metric","top-n-table-header-cell-dimension-compact":F(tt)}]),colspan:A(tt)?2:void 0,"data-testid":"top-n-table-header-column"},[f.createElementVNode("span",aB,f.toDisplayString(tt.label),1),W[0]||(W[0]=f.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,oB))),128))])]),f.createElementVNode("tbody",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($.value,tt=>(f.openBlock(),f.createElementBlock("tr",{key:tt.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-${tt.id}`},[ht(l.value,tt.id)?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ht(l.value,tt.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(I.$slots,"name",{record:{id:tt.id,name:tt.name,deleted:tt.deleted,dimension:l.value,dimensions:tt.dimensions,isEmpty:tt.id==="empty"}},()=>[f.createTextVNode(f.toDisplayString(tt.name),1)],!0)],8,lB)],2)):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(S.value,rt=>(f.openBlock(),f.createElementBlock("td",{key:rt.key,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(rt)}])},[f.createElementVNode("span",cB,[ht(rt.key,ct(tt,rt.key))?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ht(rt.key,ct(tt,rt.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(I.$slots,"name",{record:at(tt,rt.key)},()=>[f.createTextVNode(f.toDisplayString(vt(tt,rt.key)),1)],!0)])],2))),128)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(v.value,rt=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:rt.key},[f.createElementVNode("td",{class:f.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":A(rt)}])},[f.createVNode(tB,{"data-testid":rt.key==="value"?`row-${tt.id}`:`row-${tt.id}-${rt.key}`,display:st(tt,rt.key).display,"has-bar":A(rt),relative:st(tt,rt.key).relative,threshold:st(tt,rt.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),A(rt)?(f.openBlock(),f.createElementBlock("td",uB,[f.createVNode(XN,{ratio:st(tt,rt.key).barRatio??0,threshold:st(tt,rt.key).threshold},null,8,["ratio","threshold"])])):f.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(f.openBlock(),f.createBlock(nt,{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",eB,f.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",nB,f.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]),hB={class:"container"},pB={key:0,class:"no-data","data-testid":"sparkline-empty"},mB=["title"],gB=Me(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:z,height:k})=>{h.width=z,h.height=k},g=f.computed(()=>e.disableTooltip?[]:[new Ky({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),_=f.computed(()=>d.value.reduce((z,{data:k,label:w})=>({...z,[w]:k.reduce((O,{y:L})=>O+L,0)}),{})),x=f.computed(()=>d.value.map(({label:z})=>[_.value[z],`${z}: ${_.value[z]}`]).sort(([z],[k])=>k-z).map(([,z])=>z).join(", ")),v=f.computed(()=>Object.keys(_.value).map(z=>_.value[z]).reduce((z,k)=>z+k,0)),S=f.computed(()=>v.value>0),C=f.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=f.computed(()=>e.datasets.length>1),F=`SparklineTooltipPosition-${t}`,P=f.computed(()=>{const z=e.type==="sparkline_bar",k=z?r.value-1:r.value,w=z?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:z?0:2,right:z?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:F,external:O=>{Wu(h,O,"minutely",{contextFormatter:L=>{const $=L+i.value;let q="";return i.value>1440*60*1e3?q=ya(new Date($),"MMM dd, yyy hh:mm a"):q=ya(new Date($),"hh:mm a"),`${yv(L)} - ${q}`}})}}},scales:{x:{min:k,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}}}}),B=f.ref("0"),N=f.ref("0");return f.onMounted(()=>{qe.positioners[F]=function(z,k){if(!z.length||h.interactionMode==="interactive"||k.x===null)return!1;const w=10,O=this.chart.canvas.getBoundingClientRect(),L=h.width||this.width,$=h.height||this.height,q=O.top-$>0,st=q?O.top-$-w:O.top+O.height+w,ct=O.left>L/2-k.x,ht=Math.max(w,window.innerWidth-w-L),ut=Math.min(ht,ct?Math.floor(O.left-L/2)+k.x:0+w);return B.value=`${st}px`,N.value=`${ut}px`,{x:ut,y:st,xAlign:"center",yAlign:q?"top":"bottom"}}}),f.onUnmounted(()=>{qe.positioners[F]&&delete qe.positioners[F]}),(z,k)=>(f.openBlock(),f.createElementBlock("div",hB,[S.value?e.type==="sparkline_bar"?(f.openBlock(),f.createBlock(f.unref(qy),{key:1,"chart-id":f.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.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(Gy),{key:2,"chart-id":f.unref(t),data:C.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",pB,[f.renderSlot(z.$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":N.value,"absolute-top":B.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:z.$slots.label?"":x.value},[f.renderSlot(z.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[f.createTextVNode(f.toDisplayString(x.value),1)],!0)],8,mB)):f.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),yB=["data-value"],_B=["title"],bB={class:"top-talkers-cell-metric"},xB={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},wB={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},vB={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},SB={class:"top-talkers-tooltip-title"},TB={class:"top-talkers-tooltip-rows"},kB={class:"top-talkers-tooltip-label"},MB=["data-threshold"],DB=Me(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",vB,[f.createElementVNode("div",SB,f.toDisplayString(e.cell.name),1),f.createElementVNode("dl",TB,[(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",kB,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,MB)],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,_B),f.createElementVNode("span",bB,[f.createElementVNode("span",xB,f.toDisplayString(e.cell.display),1),e.cell.relative?(f.openBlock(),f.createElementBlock("span",wB,"("+f.toDisplayString(e.cell.relative)+")",1)):f.createCommentVNode("",!0)])],10,yB)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),CB=["data-dimension"],OB={class:"top-talkers-column-header"},AB={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},EB={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},RB={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},PB={key:2,class:"top-talkers-column-cells"},e_=Me(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",OB,[f.createElementVNode("span",AB,f.toDisplayString(i.value),1),!e.isLoading&&f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("span",EB,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",PB,[(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",RB,f.toDisplayString(f.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,CB))}}),[["__scopeId","data-v-e1b08041"]]),IB={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},LB={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},NB=Me(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",LB,[(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(e_,{"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",IB,f.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]);var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={exports:{}};var BB=Co.exports,n_;function FB(){return n_||(n_=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,_=2,x=4,v=1,S=2,C=1,A=2,F=4,P=8,B=16,N=32,z=64,k=128,w=256,O=512,L=30,$="...",q=800,st=16,ct=1,ht=2,ut=3,vt=1/0,at=9007199254740991,dt=17976931348623157e292,V=NaN,I=4294967295,W=I-1,nt=I>>>1,ot=[["ary",k],["bind",C],["bindKey",A],["curry",P],["curryRight",B],["flip",O],["partial",N],["partialRight",z],["rearg",w]],X="[object Arguments]",tt="[object Array]",rt="[object AsyncFunction]",pt="[object Boolean]",yt="[object Date]",mt="[object DOMException]",Et="[object Error]",zt="[object Function]",G="[object GeneratorFunction]",it="[object Map]",lt="[object Number]",$t="[object Null]",_t="[object Object]",Vt="[object Promise]",Te="[object Proxy]",ke="[object RegExp]",ae="[object Set]",cn="[object String]",qt="[object Symbol]",Be="[object Undefined]",re="[object WeakMap]",De="[object WeakSet]",Pe="[object ArrayBuffer]",gn="[object DataView]",Wi="[object Float32Array]",Cn="[object Float64Array]",je="[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,bl=/[&<>"']/g,Od=RegExp($i.source),Ad=RegExp(bl.source),Ed=/<%-([\s\S]+?)%>/g,Rd=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,xl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,Pd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lo=/[\\^$.*+?()[\]{}|]/g,Id=RegExp(Lo.source),No=/^\s+/,Ld=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nd=/\{\n\/\* \[wrapped with (.+)\] \*/,Bd=/,? & /,Fd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wl=/[()=,{}\[\]\/\s]/,zd=/\\(\\)?/g,Vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vl=/\w*$/,Ud=/^[-+]0x[0-9a-f]+$/i,Hd=/^0b[01]+$/i,Wd=/^\[object .+?Constructor\]$/,$d=/^0o[0-7]+$/i,Yi=/^(?:0|[1-9]\d*)$/,Vd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ls=/($^)/,Yd=/['\n\r\u2028\u2029\\]/g,cs="\\ud800-\\udfff",qd="\\u0300-\\u036f",jd="\\ufe20-\\ufe2f",Sl="\\u20d0-\\u20ff",kr=qd+jd+Sl,Tl="\\u2700-\\u27bf",us="a-z\\xdf-\\xf6\\xf8-\\xff",Gd="\\xac\\xb1\\xd7\\xf7",Kd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xd="\\u2000-\\u206f",Zd=" \\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",kl="A-Z\\xc0-\\xd6\\xd8-\\xde",Ml="\\ufe0e\\ufe0f",ds=Gd+Kd+Xd+Zd,Bo="['’]",Qd="["+cs+"]",Dl="["+ds+"]",fs="["+kr+"]",Cl="\\d+",Jd="["+Tl+"]",Ol="["+us+"]",Fo="[^"+cs+ds+Cl+Tl+us+kl+"]",zo="\\ud83c[\\udffb-\\udfff]",tf="(?:"+fs+"|"+zo+")",Mr="[^"+cs+"]",Zn="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+kl+"]",Al="\\u200d",El="(?:"+Ol+"|"+Fo+")",ef="(?:"+un+"|"+Fo+")",Rl="(?:"+Bo+"(?:d|ll|m|re|s|t|ve))?",Pl="(?:"+Bo+"(?:D|LL|M|RE|S|T|VE))?",Il=tf+"?",Uo="["+Ml+"]?",pi="(?:"+Al+"(?:"+[Mr,Zn,hs].join("|")+")"+Uo+Il+")*",nf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ll="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nl=Uo+Il+pi,Ho="(?:"+[Jd,Zn,hs].join("|")+")"+Nl,Bl="(?:"+[Mr+fs+"?",fs,Zn,hs,Qd].join("|")+")",rf=RegExp(Bo,"g"),sf=RegExp(fs,"g"),ps=RegExp(zo+"(?="+zo+")|"+Bl+Nl,"g"),of=RegExp([un+"?"+Ol+"+"+Rl+"(?="+[Dl,un,"$"].join("|")+")",ef+"+"+Pl+"(?="+[Dl,un+El,"$"].join("|")+")",un+"?"+El+"+"+Rl,un+"+"+Pl,Ll,nf,Cl,Ho].join("|"),"g"),ms=RegExp("["+Al+cs+kr+Ml+"]"),af=/[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"],lf=-1,ne={};ne[Wi]=ne[Cn]=ne[je]=ne[Ln]=ne[di]=ne[Oo]=ne[Ao]=ne[Tr]=ne[fi]=!0,ne[X]=ne[tt]=ne[Pe]=ne[pt]=ne[gn]=ne[yt]=ne[Et]=ne[zt]=ne[it]=ne[lt]=ne[_t]=ne[ke]=ne[ae]=ne[cn]=ne[re]=!1;var D={};D[X]=D[tt]=D[Pe]=D[gn]=D[pt]=D[yt]=D[Wi]=D[Cn]=D[je]=D[Ln]=D[di]=D[it]=D[lt]=D[_t]=D[ke]=D[ae]=D[cn]=D[qt]=D[Oo]=D[Ao]=D[Tr]=D[fi]=!0,D[Et]=D[zt]=D[re]=!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"},J={"&":"&","<":"<",">":">",'"':""","'":"'"},xt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,Bn=parseInt,Fe=typeof Hi=="object"&&Hi&&Hi.Object===Object&&Hi,Fl=typeof self=="object"&&self&&self.Object===Object&&self,ue=Fe||Fl||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 U=Qn&&Qn.require&&Qn.require("util").types;return U||Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),a_=ze&&ze.isArrayBuffer,l_=ze&&ze.isDate,c_=ze&&ze.isMap,u_=ze&&ze.isRegExp,d_=ze&&ze.isSet,f_=ze&&ze.isTypedArray;function yn(U,K,j){switch(j.length){case 0:return U.call(K);case 1:return U.call(K,j[0]);case 2:return U.call(K,j[0],j[1]);case 3:return U.call(K,j[0],j[1],j[2])}return U.apply(K,j)}function QB(U,K,j,gt){for(var Ot=-1,jt=U==null?0:U.length;++Ot<jt;){var Oe=U[Ot];K(gt,Oe,j(Oe),U)}return gt}function _n(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt&&K(U[j],j,U)!==!1;);return U}function JB(U,K){for(var j=U==null?0:U.length;j--&&K(U[j],j,U)!==!1;);return U}function h_(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt;)if(!K(U[j],j,U))return!1;return!0}function qi(U,K){for(var j=-1,gt=U==null?0:U.length,Ot=0,jt=[];++j<gt;){var Oe=U[j];K(Oe,j,U)&&(jt[Ot++]=Oe)}return jt}function zl(U,K){var j=U==null?0:U.length;return!!j&&ys(U,K,0)>-1}function cf(U,K,j){for(var gt=-1,Ot=U==null?0:U.length;++gt<Ot;)if(j(K,U[gt]))return!0;return!1}function de(U,K){for(var j=-1,gt=U==null?0:U.length,Ot=Array(gt);++j<gt;)Ot[j]=K(U[j],j,U);return Ot}function ji(U,K){for(var j=-1,gt=K.length,Ot=U.length;++j<gt;)U[Ot+j]=K[j];return U}function uf(U,K,j,gt){var Ot=-1,jt=U==null?0:U.length;for(gt&&jt&&(j=U[++Ot]);++Ot<jt;)j=K(j,U[Ot],Ot,U);return j}function tF(U,K,j,gt){var Ot=U==null?0:U.length;for(gt&&Ot&&(j=U[--Ot]);Ot--;)j=K(j,U[Ot],Ot,U);return j}function df(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt;)if(K(U[j],j,U))return!0;return!1}var eF=ff("length");function nF(U){return U.split("")}function iF(U){return U.match(Fd)||[]}function p_(U,K,j){var gt;return j(U,function(Ot,jt,Oe){if(K(Ot,jt,Oe))return gt=jt,!1}),gt}function Ul(U,K,j,gt){for(var Ot=U.length,jt=j+(gt?1:-1);gt?jt--:++jt<Ot;)if(K(U[jt],jt,U))return jt;return-1}function ys(U,K,j){return K===K?mF(U,K,j):Ul(U,m_,j)}function rF(U,K,j,gt){for(var Ot=j-1,jt=U.length;++Ot<jt;)if(gt(U[Ot],K))return Ot;return-1}function m_(U){return U!==U}function g_(U,K){var j=U==null?0:U.length;return j?pf(U,K)/j:V}function ff(U){return function(K){return K==null?n:K[U]}}function hf(U){return function(K){return U==null?n:U[K]}}function y_(U,K,j,gt,Ot){return Ot(U,function(jt,Oe,ie){j=gt?(gt=!1,jt):K(j,jt,Oe,ie)}),j}function sF(U,K){var j=U.length;for(U.sort(K);j--;)U[j]=U[j].value;return U}function pf(U,K){for(var j,gt=-1,Ot=U.length;++gt<Ot;){var jt=K(U[gt]);jt!==n&&(j=j===n?jt:j+jt)}return j}function mf(U,K){for(var j=-1,gt=Array(U);++j<U;)gt[j]=K(j);return gt}function oF(U,K){return de(K,function(j){return[j,U[j]]})}function __(U){return U&&U.slice(0,v_(U)+1).replace(No,"")}function bn(U){return function(K){return U(K)}}function gf(U,K){return de(K,function(j){return U[j]})}function Vo(U,K){return U.has(K)}function b_(U,K){for(var j=-1,gt=U.length;++j<gt&&ys(K,U[j],0)>-1;);return j}function x_(U,K){for(var j=U.length;j--&&ys(K,U[j],0)>-1;);return j}function aF(U,K){for(var j=U.length,gt=0;j--;)U[j]===K&&++gt;return gt}var lF=hf(Y),cF=hf(J);function uF(U){return"\\"+Ce[U]}function dF(U,K){return U==null?n:U[K]}function _s(U){return ms.test(U)}function fF(U){return af.test(U)}function hF(U){for(var K,j=[];!(K=U.next()).done;)j.push(K.value);return j}function yf(U){var K=-1,j=Array(U.size);return U.forEach(function(gt,Ot){j[++K]=[Ot,gt]}),j}function w_(U,K){return function(j){return U(K(j))}}function Gi(U,K){for(var j=-1,gt=U.length,Ot=0,jt=[];++j<gt;){var Oe=U[j];(Oe===K||Oe===m)&&(U[j]=m,jt[Ot++]=j)}return jt}function Hl(U){var K=-1,j=Array(U.size);return U.forEach(function(gt){j[++K]=gt}),j}function pF(U){var K=-1,j=Array(U.size);return U.forEach(function(gt){j[++K]=[gt,gt]}),j}function mF(U,K,j){for(var gt=j-1,Ot=U.length;++gt<Ot;)if(U[gt]===K)return gt;return-1}function gF(U,K,j){for(var gt=j+1;gt--;)if(U[gt]===K)return gt;return gt}function bs(U){return _s(U)?_F(U):eF(U)}function Fn(U){return _s(U)?bF(U):nF(U)}function v_(U){for(var K=U.length;K--&&Ld.test(U.charAt(K)););return K}var yF=hf(xt);function _F(U){for(var K=ps.lastIndex=0;ps.test(U);)++K;return K}function bF(U){return U.match(ps)||[]}function xF(U){return U.match(of)||[]}var wF=(function U(K){K=K==null?ue:xs.defaults(ue.Object(),K,xs.pick(ue,Wo));var j=K.Array,gt=K.Date,Ot=K.Error,jt=K.Function,Oe=K.Math,ie=K.Object,_f=K.RegExp,vF=K.String,On=K.TypeError,Wl=j.prototype,SF=jt.prototype,ws=ie.prototype,$l=K["__core-js_shared__"],Vl=SF.toString,Kt=ws.hasOwnProperty,TF=0,S_=(function(){var o=/[^.]+$/.exec($l&&$l.keys&&$l.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Yl=ws.toString,kF=Vl.call(ie),MF=ue._,DF=_f("^"+Vl.call(Kt).replace(Lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ql=$o?K.Buffer:n,Ki=K.Symbol,jl=K.Uint8Array,T_=ql?ql.allocUnsafe:n,Gl=w_(ie.getPrototypeOf,ie),k_=ie.create,M_=ws.propertyIsEnumerable,Kl=Wl.splice,D_=Ki?Ki.isConcatSpreadable:n,Yo=Ki?Ki.iterator:n,Cr=Ki?Ki.toStringTag:n,Xl=(function(){try{var o=Pr(ie,"defineProperty");return o({},"",{}),o}catch{}})(),CF=K.clearTimeout!==ue.clearTimeout&&K.clearTimeout,OF=gt&>.now!==ue.Date.now&>.now,AF=K.setTimeout!==ue.setTimeout&&K.setTimeout,Zl=Oe.ceil,Ql=Oe.floor,bf=ie.getOwnPropertySymbols,EF=ql?ql.isBuffer:n,C_=K.isFinite,RF=Wl.join,PF=w_(ie.keys,ie),Ae=Oe.max,Ke=Oe.min,IF=gt.now,LF=K.parseInt,O_=Oe.random,NF=Wl.reverse,xf=Pr(K,"DataView"),qo=Pr(K,"Map"),wf=Pr(K,"Promise"),vs=Pr(K,"Set"),jo=Pr(K,"WeakMap"),Go=Pr(ie,"create"),Jl=jo&&new jo,Ss={},BF=Ir(xf),FF=Ir(qo),zF=Ir(wf),UF=Ir(vs),HF=Ir(jo),tc=Ki?Ki.prototype:n,Ko=tc?tc.valueOf:n,A_=tc?tc.toString:n;function T(o){if(ye(o)&&!Pt(o)&&!(o instanceof Ht)){if(o instanceof An)return o;if(Kt.call(o,"__wrapped__"))return Eb(o)}return new An(o)}var Ts=(function(){function o(){}return function(c){if(!pe(c))return{};if(k_)return k_(c);o.prototype=c;var p=new o;return o.prototype=n,p}})();function ec(){}function An(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}T.templateSettings={escape:Ed,evaluate:Rd,interpolate:Io,variable:"",imports:{_:T}},T.prototype=ec.prototype,T.prototype.constructor=T,An.prototype=Ts(ec.prototype),An.prototype.constructor=An;function Ht(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=I,this.__views__=[]}function WF(){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 $F(){if(this.__filtered__){var o=new Ht(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function VF(){var o=this.__wrapped__.value(),c=this.__dir__,p=Pt(o),y=c<0,b=p?o.length:0,M=nU(0,b,this.__views__),E=M.start,R=M.end,H=R-E,Z=y?R:E-1,Q=this.__iteratees__,et=Q.length,ft=0,wt=Ke(H,this.__takeCount__);if(!p||!y&&b==H&&wt==H)return tb(o,this.__actions__);var Dt=[];t:for(;H--&&ft<wt;){Z+=c;for(var Bt=-1,kt=o[Z];++Bt<et;){var Ut=Q[Bt],Wt=Ut.iteratee,vn=Ut.type,nn=Wt(kt);if(vn==ht)kt=nn;else if(!nn){if(vn==ct)continue t;break t}}Dt[ft++]=kt}return Dt}Ht.prototype=Ts(ec.prototype),Ht.prototype.constructor=Ht;function Or(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function YF(){this.__data__=Go?Go(null):{},this.size=0}function qF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function jF(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 GF(o){var c=this.__data__;return Go?c[o]!==n:Kt.call(c,o)}function KF(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=YF,Or.prototype.delete=qF,Or.prototype.get=jF,Or.prototype.has=GF,Or.prototype.set=KF;function mi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function XF(){this.__data__=[],this.size=0}function ZF(o){var c=this.__data__,p=nc(c,o);if(p<0)return!1;var y=c.length-1;return p==y?c.pop():Kl.call(c,p,1),--this.size,!0}function QF(o){var c=this.__data__,p=nc(c,o);return p<0?n:c[p][1]}function JF(o){return nc(this.__data__,o)>-1}function tz(o,c){var p=this.__data__,y=nc(p,o);return y<0?(++this.size,p.push([o,c])):p[y][1]=c,this}mi.prototype.clear=XF,mi.prototype.delete=ZF,mi.prototype.get=QF,mi.prototype.has=JF,mi.prototype.set=tz;function gi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function ez(){this.size=0,this.__data__={hash:new Or,map:new(qo||mi),string:new Or}}function nz(o){var c=pc(this,o).delete(o);return this.size-=c?1:0,c}function iz(o){return pc(this,o).get(o)}function rz(o){return pc(this,o).has(o)}function sz(o,c){var p=pc(this,o),y=p.size;return p.set(o,c),this.size+=p.size==y?0:1,this}gi.prototype.clear=ez,gi.prototype.delete=nz,gi.prototype.get=iz,gi.prototype.has=rz,gi.prototype.set=sz;function Ar(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new gi;++c<p;)this.add(o[c])}function oz(o){return this.__data__.set(o,d),this}function az(o){return this.__data__.has(o)}Ar.prototype.add=Ar.prototype.push=oz,Ar.prototype.has=az;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function lz(){this.__data__=new mi,this.size=0}function cz(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function uz(o){return this.__data__.get(o)}function dz(o){return this.__data__.has(o)}function fz(o,c){var p=this.__data__;if(p instanceof mi){var y=p.__data__;if(!qo||y.length<r-1)return y.push([o,c]),this.size=++p.size,this;p=this.__data__=new gi(y)}return p.set(o,c),this.size=p.size,this}zn.prototype.clear=lz,zn.prototype.delete=cz,zn.prototype.get=uz,zn.prototype.has=dz,zn.prototype.set=fz;function E_(o,c){var p=Pt(o),y=!p&&Lr(o),b=!p&&!y&&tr(o),M=!p&&!y&&!b&&Cs(o),E=p||y||b||M,R=E?mf(o.length,vF):[],H=R.length;for(var Z in o)(c||Kt.call(o,Z))&&!(E&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||M&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||bi(Z,H)))&&R.push(Z);return R}function R_(o){var c=o.length;return c?o[Rf(0,c-1)]:n}function hz(o,c){return mc(dn(o),Er(c,0,o.length))}function pz(o){return mc(dn(o))}function vf(o,c,p){(p!==n&&!Hn(o[c],p)||p===n&&!(c in o))&&Jn(o,c,p)}function Xo(o,c,p){var y=o[c];(!(Kt.call(o,c)&&Hn(y,p))||p===n&&!(c in o))&&Jn(o,c,p)}function nc(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function mz(o,c,p,y){return Xi(o,function(b,M,E){c(y,b,p(b),E)}),y}function P_(o,c){return o&&ei(c,Ie(c),o)}function gz(o,c){return o&&ei(c,hn(c),o)}function Jn(o,c,p){c=="__proto__"&&Xl?Xl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function Sf(o,c){for(var p=-1,y=c.length,b=j(y),M=o==null;++p<y;)b[p]=M?n:rh(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,y,b,M){var E,R=c&g,H=c&_,Z=c&x;if(p&&(E=b?p(o,y,b,M):p(o)),E!==n)return E;if(!pe(o))return o;var Q=Pt(o);if(Q){if(E=rU(o),!R)return dn(o,E)}else{var et=Xe(o),ft=et==zt||et==G;if(tr(o))return ib(o,R);if(et==_t||et==X||ft&&!b){if(E=H||ft?{}:vb(o),!R)return H?jz(o,gz(E,o)):qz(o,P_(E,o))}else{if(!D[et])return b?o:{};E=sU(o,et,R)}}M||(M=new zn);var wt=M.get(o);if(wt)return wt;M.set(o,E),Zb(o)?o.forEach(function(kt){E.add(En(kt,c,p,kt,o,M))}):Kb(o)&&o.forEach(function(kt,Ut){E.set(Ut,En(kt,c,p,Ut,o,M))});var Dt=Z?H?$f:Wf:H?hn:Ie,Bt=Q?n:Dt(o);return _n(Bt||o,function(kt,Ut){Bt&&(Ut=kt,kt=o[Ut]),Xo(E,Ut,En(kt,c,p,Ut,o,M))}),E}function yz(o){var c=Ie(o);return function(p){return I_(p,o,c)}}function I_(o,c,p){var y=p.length;if(o==null)return!y;for(o=ie(o);y--;){var b=p[y],M=c[b],E=o[b];if(E===n&&!(b in o)||!M(E))return!1}return!0}function L_(o,c,p){if(typeof o!="function")throw new On(a);return ia(function(){o.apply(n,p)},c)}function Zo(o,c,p,y){var b=-1,M=zl,E=!0,R=o.length,H=[],Z=c.length;if(!R)return H;p&&(c=de(c,bn(p))),y?(M=cf,E=!1):c.length>=r&&(M=Vo,E=!1,c=new Ar(c));t:for(;++b<R;){var Q=o[b],et=p==null?Q:p(Q);if(Q=y||Q!==0?Q:0,E&&et===et){for(var ft=Z;ft--;)if(c[ft]===et)continue t;H.push(Q)}else M(c,et,y)||H.push(Q)}return H}var Xi=lb(ti),N_=lb(kf,!0);function _z(o,c){var p=!0;return Xi(o,function(y,b,M){return p=!!c(y,b,M),p}),p}function ic(o,c,p){for(var y=-1,b=o.length;++y<b;){var M=o[y],E=c(M);if(E!=null&&(R===n?E===E&&!wn(E):p(E,R)))var R=E,H=M}return H}function bz(o,c,p,y){var b=o.length;for(p=Nt(p),p<0&&(p=-p>b?0:b+p),y=y===n||y>b?b:Nt(y),y<0&&(y+=b),y=p>y?0:Jb(y);p<y;)o[p++]=c;return o}function B_(o,c){var p=[];return Xi(o,function(y,b,M){c(y,b,M)&&p.push(y)}),p}function Ue(o,c,p,y,b){var M=-1,E=o.length;for(p||(p=aU),b||(b=[]);++M<E;){var R=o[M];c>0&&p(R)?c>1?Ue(R,c-1,p,y,b):ji(b,R):y||(b[b.length]=R)}return b}var Tf=cb(),F_=cb(!0);function ti(o,c){return o&&Tf(o,c,Ie)}function kf(o,c){return o&&F_(o,c,Ie)}function rc(o,c){return qi(c,function(p){return xi(o[p])})}function Rr(o,c){c=Qi(c,o);for(var p=0,y=c.length;o!=null&&p<y;)o=o[Un(c[p++])];return p&&p==y?o:n}function z_(o,c,p){var y=c(o);return Pt(o)?y:ji(y,p(o))}function tn(o){return o==null?o===n?Be:$t:Cr&&Cr in ie(o)?eU(o):pU(o)}function Mf(o,c){return o>c}function xz(o,c){return o!=null&&Kt.call(o,c)}function wz(o,c){return o!=null&&c in ie(o)}function vz(o,c,p){return o>=Ke(c,p)&&o<Ae(c,p)}function Df(o,c,p){for(var y=p?cf:zl,b=o[0].length,M=o.length,E=M,R=j(M),H=1/0,Z=[];E--;){var Q=o[E];E&&c&&(Q=de(Q,bn(c))),H=Ke(Q.length,H),R[E]=!p&&(c||b>=120&&Q.length>=120)?new Ar(E&&Q):n}Q=o[0];var et=-1,ft=R[0];t:for(;++et<b&&Z.length<H;){var wt=Q[et],Dt=c?c(wt):wt;if(wt=p||wt!==0?wt:0,!(ft?Vo(ft,Dt):y(Z,Dt,p))){for(E=M;--E;){var Bt=R[E];if(!(Bt?Vo(Bt,Dt):y(o[E],Dt,p)))continue t}ft&&ft.push(Dt),Z.push(wt)}}return Z}function Sz(o,c,p,y){return ti(o,function(b,M,E){c(y,p(b),M,E)}),y}function Qo(o,c,p){c=Qi(c,o),o=Mb(o,c);var y=o==null?o:o[Un(Pn(c))];return y==null?n:yn(y,o,p)}function U_(o){return ye(o)&&tn(o)==X}function Tz(o){return ye(o)&&tn(o)==Pe}function kz(o){return ye(o)&&tn(o)==yt}function Jo(o,c,p,y,b){return o===c?!0:o==null||c==null||!ye(o)&&!ye(c)?o!==o&&c!==c:Mz(o,c,p,y,Jo,b)}function Mz(o,c,p,y,b,M){var E=Pt(o),R=Pt(c),H=E?tt:Xe(o),Z=R?tt:Xe(c);H=H==X?_t:H,Z=Z==X?_t:Z;var Q=H==_t,et=Z==_t,ft=H==Z;if(ft&&tr(o)){if(!tr(c))return!1;E=!0,Q=!1}if(ft&&!Q)return M||(M=new zn),E||Cs(o)?bb(o,c,p,y,b,M):Jz(o,c,H,p,y,b,M);if(!(p&v)){var wt=Q&&Kt.call(o,"__wrapped__"),Dt=et&&Kt.call(c,"__wrapped__");if(wt||Dt){var Bt=wt?o.value():o,kt=Dt?c.value():c;return M||(M=new zn),b(Bt,kt,p,y,M)}}return ft?(M||(M=new zn),tU(o,c,p,y,b,M)):!1}function Dz(o){return ye(o)&&Xe(o)==it}function Cf(o,c,p,y){var b=p.length,M=b,E=!y;if(o==null)return!M;for(o=ie(o);b--;){var R=p[b];if(E&&R[2]?R[1]!==o[R[0]]:!(R[0]in o))return!1}for(;++b<M;){R=p[b];var H=R[0],Z=o[H],Q=R[1];if(E&&R[2]){if(Z===n&&!(H in o))return!1}else{var et=new zn;if(y)var ft=y(Z,Q,H,o,c,et);if(!(ft===n?Jo(Q,Z,v|S,y,et):ft))return!1}}return!0}function H_(o){if(!pe(o)||cU(o))return!1;var c=xi(o)?DF:Wd;return c.test(Ir(o))}function Cz(o){return ye(o)&&tn(o)==ke}function Oz(o){return ye(o)&&Xe(o)==ae}function Az(o){return ye(o)&&wc(o.length)&&!!ne[tn(o)]}function W_(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?Pt(o)?Y_(o[0],o[1]):V_(o):dx(o)}function Of(o){if(!na(o))return PF(o);var c=[];for(var p in ie(o))Kt.call(o,p)&&p!="constructor"&&c.push(p);return c}function Ez(o){if(!pe(o))return hU(o);var c=na(o),p=[];for(var y in o)y=="constructor"&&(c||!Kt.call(o,y))||p.push(y);return p}function Af(o,c){return o<c}function $_(o,c){var p=-1,y=fn(o)?j(o.length):[];return Xi(o,function(b,M,E){y[++p]=c(b,M,E)}),y}function V_(o){var c=Yf(o);return c.length==1&&c[0][2]?Tb(c[0][0],c[0][1]):function(p){return p===o||Cf(p,o,c)}}function Y_(o,c){return jf(o)&&Sb(c)?Tb(Un(o),c):function(p){var y=rh(p,o);return y===n&&y===c?sh(p,o):Jo(c,y,v|S)}}function sc(o,c,p,y,b){o!==c&&Tf(c,function(M,E){if(b||(b=new zn),pe(M))Rz(o,c,E,p,sc,y,b);else{var R=y?y(Kf(o,E),M,E+"",o,c,b):n;R===n&&(R=M),vf(o,E,R)}},hn)}function Rz(o,c,p,y,b,M,E){var R=Kf(o,p),H=Kf(c,p),Z=E.get(H);if(Z){vf(o,p,Z);return}var Q=M?M(R,H,p+"",o,c,E):n,et=Q===n;if(et){var ft=Pt(H),wt=!ft&&tr(H),Dt=!ft&&!wt&&Cs(H);Q=H,ft||wt||Dt?Pt(R)?Q=R:xe(R)?Q=dn(R):wt?(et=!1,Q=ib(H,!0)):Dt?(et=!1,Q=rb(H,!0)):Q=[]:ra(H)||Lr(H)?(Q=R,Lr(R)?Q=tx(R):(!pe(R)||xi(R))&&(Q=vb(H))):et=!1}et&&(E.set(H,Q),b(Q,H,y,M,E),E.delete(H)),vf(o,p,Q)}function q_(o,c){var p=o.length;if(p)return c+=c<0?p:0,bi(c,p)?o[c]:n}function j_(o,c,p){c.length?c=de(c,function(M){return Pt(M)?function(E){return Rr(E,M.length===1?M[0]:M)}:M}):c=[pn];var y=-1;c=de(c,bn(Mt()));var b=$_(o,function(M,E,R){var H=de(c,function(Z){return Z(M)});return{criteria:H,index:++y,value:M}});return sF(b,function(M,E){return Yz(M,E,p)})}function Pz(o,c){return G_(o,c,function(p,y){return sh(o,y)})}function G_(o,c,p){for(var y=-1,b=c.length,M={};++y<b;){var E=c[y],R=Rr(o,E);p(R,E)&&ta(M,Qi(E,o),R)}return M}function Iz(o){return function(c){return Rr(c,o)}}function Ef(o,c,p,y){var b=y?rF:ys,M=-1,E=c.length,R=o;for(o===c&&(c=dn(c)),p&&(R=de(o,bn(p)));++M<E;)for(var H=0,Z=c[M],Q=p?p(Z):Z;(H=b(R,Q,H,y))>-1;)R!==o&&Kl.call(R,H,1),Kl.call(o,H,1);return o}function K_(o,c){for(var p=o?c.length:0,y=p-1;p--;){var b=c[p];if(p==y||b!==M){var M=b;bi(b)?Kl.call(o,b,1):Lf(o,b)}}return o}function Rf(o,c){return o+Ql(O_()*(c-o+1))}function Lz(o,c,p,y){for(var b=-1,M=Ae(Zl((c-o)/(p||1)),0),E=j(M);M--;)E[y?M:++b]=o,o+=p;return E}function Pf(o,c){var p="";if(!o||c<1||c>at)return p;do c%2&&(p+=o),c=Ql(c/2),c&&(o+=o);while(c);return p}function Ft(o,c){return Xf(kb(o,c,pn),o+"")}function Nz(o){return R_(Os(o))}function Bz(o,c){var p=Os(o);return mc(p,Er(c,0,p.length))}function ta(o,c,p,y){if(!pe(o))return o;c=Qi(c,o);for(var b=-1,M=c.length,E=M-1,R=o;R!=null&&++b<M;){var H=Un(c[b]),Z=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(b!=E){var Q=R[H];Z=y?y(Q,H,R):n,Z===n&&(Z=pe(Q)?Q:bi(c[b+1])?[]:{})}Xo(R,H,Z),R=R[H]}return o}var X_=Jl?function(o,c){return Jl.set(o,c),o}:pn,Fz=Xl?function(o,c){return Xl(o,"toString",{configurable:!0,enumerable:!1,value:ah(c),writable:!0})}:pn;function zz(o){return mc(Os(o))}function Rn(o,c,p){var y=-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 M=j(b);++y<b;)M[y]=o[y+c];return M}function Uz(o,c){var p;return Xi(o,function(y,b,M){return p=c(y,b,M),!p}),!!p}function oc(o,c,p){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=nt){for(;y<b;){var M=y+b>>>1,E=o[M];E!==null&&!wn(E)&&(p?E<=c:E<c)?y=M+1:b=M}return b}return If(o,c,pn,p)}function If(o,c,p,y){var b=0,M=o==null?0:o.length;if(M===0)return 0;c=p(c);for(var E=c!==c,R=c===null,H=wn(c),Z=c===n;b<M;){var Q=Ql((b+M)/2),et=p(o[Q]),ft=et!==n,wt=et===null,Dt=et===et,Bt=wn(et);if(E)var kt=y||Dt;else Z?kt=Dt&&(y||ft):R?kt=Dt&&ft&&(y||!wt):H?kt=Dt&&ft&&!wt&&(y||!Bt):wt||Bt?kt=!1:kt=y?et<=c:et<c;kt?b=Q+1:M=Q}return Ke(M,W)}function Z_(o,c){for(var p=-1,y=o.length,b=0,M=[];++p<y;){var E=o[p],R=c?c(E):E;if(!p||!Hn(R,H)){var H=R;M[b++]=E===0?0:E}}return M}function Q_(o){return typeof o=="number"?o:wn(o)?V:+o}function xn(o){if(typeof o=="string")return o;if(Pt(o))return de(o,xn)+"";if(wn(o))return A_?A_.call(o):"";var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Zi(o,c,p){var y=-1,b=zl,M=o.length,E=!0,R=[],H=R;if(p)E=!1,b=cf;else if(M>=r){var Z=c?null:Zz(o);if(Z)return Hl(Z);E=!1,b=Vo,H=new Ar}else H=c?[]:R;t:for(;++y<M;){var Q=o[y],et=c?c(Q):Q;if(Q=p||Q!==0?Q:0,E&&et===et){for(var ft=H.length;ft--;)if(H[ft]===et)continue t;c&&H.push(et),R.push(Q)}else b(H,et,p)||(H!==R&&H.push(et),R.push(Q))}return R}function Lf(o,c){c=Qi(c,o);var p=-1,y=c.length;if(!y)return!0;for(;++p<y;){var b=Un(c[p]);if(b==="__proto__"&&!Kt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&p<y-1)return!1}var M=Mb(o,c);return M==null||delete M[Un(Pn(c))]}function J_(o,c,p,y){return ta(o,c,p(Rr(o,c)),y)}function ac(o,c,p,y){for(var b=o.length,M=y?b:-1;(y?M--:++M<b)&&c(o[M],M,o););return p?Rn(o,y?0:M,y?M+1:b):Rn(o,y?M+1:0,y?b:M)}function tb(o,c){var p=o;return p instanceof Ht&&(p=p.value()),uf(c,function(y,b){return b.func.apply(b.thisArg,ji([y],b.args))},p)}function Nf(o,c,p){var y=o.length;if(y<2)return y?Zi(o[0]):[];for(var b=-1,M=j(y);++b<y;)for(var E=o[b],R=-1;++R<y;)R!=b&&(M[b]=Zo(M[b]||E,o[R],c,p));return Zi(Ue(M,1),c,p)}function eb(o,c,p){for(var y=-1,b=o.length,M=c.length,E={};++y<b;){var R=y<M?c[y]:n;p(E,o[y],R)}return E}function Bf(o){return xe(o)?o:[]}function Ff(o){return typeof o=="function"?o:pn}function Qi(o,c){return Pt(o)?o:jf(o,c)?[o]:Ab(Xt(o))}var Hz=Ft;function Ji(o,c,p){var y=o.length;return p=p===n?y:p,!c&&p>=y?o:Rn(o,c,p)}var nb=CF||function(o){return ue.clearTimeout(o)};function ib(o,c){if(c)return o.slice();var p=o.length,y=T_?T_(p):new o.constructor(p);return o.copy(y),y}function zf(o){var c=new o.constructor(o.byteLength);return new jl(c).set(new jl(o)),c}function Wz(o,c){var p=c?zf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function $z(o){var c=new o.constructor(o.source,vl.exec(o));return c.lastIndex=o.lastIndex,c}function Vz(o){return Ko?ie(Ko.call(o)):{}}function rb(o,c){var p=c?zf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function sb(o,c){if(o!==c){var p=o!==n,y=o===null,b=o===o,M=wn(o),E=c!==n,R=c===null,H=c===c,Z=wn(c);if(!R&&!Z&&!M&&o>c||M&&E&&H&&!R&&!Z||y&&E&&H||!p&&H||!b)return 1;if(!y&&!M&&!Z&&o<c||Z&&p&&b&&!y&&!M||R&&p&&b||!E&&b||!H)return-1}return 0}function Yz(o,c,p){for(var y=-1,b=o.criteria,M=c.criteria,E=b.length,R=p.length;++y<E;){var H=sb(b[y],M[y]);if(H){if(y>=R)return H;var Z=p[y];return H*(Z=="desc"?-1:1)}}return o.index-c.index}function ob(o,c,p,y){for(var b=-1,M=o.length,E=p.length,R=-1,H=c.length,Z=Ae(M-E,0),Q=j(H+Z),et=!y;++R<H;)Q[R]=c[R];for(;++b<E;)(et||b<M)&&(Q[p[b]]=o[b]);for(;Z--;)Q[R++]=o[b++];return Q}function ab(o,c,p,y){for(var b=-1,M=o.length,E=-1,R=p.length,H=-1,Z=c.length,Q=Ae(M-R,0),et=j(Q+Z),ft=!y;++b<Q;)et[b]=o[b];for(var wt=b;++H<Z;)et[wt+H]=c[H];for(;++E<R;)(ft||b<M)&&(et[wt+p[E]]=o[b++]);return et}function dn(o,c){var p=-1,y=o.length;for(c||(c=j(y));++p<y;)c[p]=o[p];return c}function ei(o,c,p,y){var b=!p;p||(p={});for(var M=-1,E=c.length;++M<E;){var R=c[M],H=y?y(p[R],o[R],R,p,o):n;H===n&&(H=o[R]),b?Jn(p,R,H):Xo(p,R,H)}return p}function qz(o,c){return ei(o,qf(o),c)}function jz(o,c){return ei(o,xb(o),c)}function lc(o,c){return function(p,y){var b=Pt(p)?QB:mz,M=c?c():{};return b(p,o,Mt(y,2),M)}}function ks(o){return Ft(function(c,p){var y=-1,b=p.length,M=b>1?p[b-1]:n,E=b>2?p[2]:n;for(M=o.length>3&&typeof M=="function"?(b--,M):n,E&&en(p[0],p[1],E)&&(M=b<3?n:M,b=1),c=ie(c);++y<b;){var R=p[y];R&&o(c,R,y,M)}return c})}function lb(o,c){return function(p,y){if(p==null)return p;if(!fn(p))return o(p,y);for(var b=p.length,M=c?b:-1,E=ie(p);(c?M--:++M<b)&&y(E[M],M,E)!==!1;);return p}}function cb(o){return function(c,p,y){for(var b=-1,M=ie(c),E=y(c),R=E.length;R--;){var H=E[o?R:++b];if(p(M[H],H,M)===!1)break}return c}}function Gz(o,c,p){var y=c&C,b=ea(o);function M(){var E=this&&this!==ue&&this instanceof M?b:o;return E.apply(y?p:this,arguments)}return M}function ub(o){return function(c){c=Xt(c);var p=_s(c)?Fn(c):n,y=p?p[0]:c.charAt(0),b=p?Ji(p,1).join(""):c.slice(1);return y[o]()+b}}function Ms(o){return function(c){return uf(cx(lx(c).replace(rf,"")),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),y=o.apply(p,c);return pe(y)?y:p}}function Kz(o,c,p){var y=ea(o);function b(){for(var M=arguments.length,E=j(M),R=M,H=Ds(b);R--;)E[R]=arguments[R];var Z=M<3&&E[0]!==H&&E[M-1]!==H?[]:Gi(E,H);if(M-=Z.length,M<p)return mb(o,c,cc,b.placeholder,n,E,Z,n,n,p-M);var Q=this&&this!==ue&&this instanceof b?y:o;return yn(Q,this,E)}return b}function db(o){return function(c,p,y){var b=ie(c);if(!fn(c)){var M=Mt(p,3);c=Ie(c),p=function(R){return M(b[R],R,b)}}var E=o(c,p,y);return E>-1?b[M?c[E]:E]:n}}function fb(o){return _i(function(c){var p=c.length,y=p,b=An.prototype.thru;for(o&&c.reverse();y--;){var M=c[y];if(typeof M!="function")throw new On(a);if(b&&!E&&hc(M)=="wrapper")var E=new An([],!0)}for(y=E?y:p;++y<p;){M=c[y];var R=hc(M),H=R=="wrapper"?Vf(M):n;H&&Gf(H[0])&&H[1]==(k|P|N|w)&&!H[4].length&&H[9]==1?E=E[hc(H[0])].apply(E,H[3]):E=M.length==1&&Gf(M)?E[R]():E.thru(M)}return function(){var Z=arguments,Q=Z[0];if(E&&Z.length==1&&Pt(Q))return E.plant(Q).value();for(var et=0,ft=p?c[et].apply(this,Z):Q;++et<p;)ft=c[et].call(this,ft);return ft}})}function cc(o,c,p,y,b,M,E,R,H,Z){var Q=c&k,et=c&C,ft=c&A,wt=c&(P|B),Dt=c&O,Bt=ft?n:ea(o);function kt(){for(var Ut=arguments.length,Wt=j(Ut),vn=Ut;vn--;)Wt[vn]=arguments[vn];if(wt)var nn=Ds(kt),Sn=aF(Wt,nn);if(y&&(Wt=ob(Wt,y,b,wt)),M&&(Wt=ab(Wt,M,E,wt)),Ut-=Sn,wt&&Ut<Z){var we=Gi(Wt,nn);return mb(o,c,cc,kt.placeholder,p,Wt,we,R,H,Z-Ut)}var Wn=et?p:this,vi=ft?Wn[o]:o;return Ut=Wt.length,R?Wt=mU(Wt,R):Dt&&Ut>1&&Wt.reverse(),Q&&H<Ut&&(Wt.length=H),this&&this!==ue&&this instanceof kt&&(vi=Bt||ea(vi)),vi.apply(Wn,Wt)}return kt}function hb(o,c){return function(p,y){return Sz(p,o,c(y),{})}}function uc(o,c){return function(p,y){var b;if(p===n&&y===n)return c;if(p!==n&&(b=p),y!==n){if(b===n)return y;typeof p=="string"||typeof y=="string"?(p=xn(p),y=xn(y)):(p=Q_(p),y=Q_(y)),b=o(p,y)}return b}}function Uf(o){return _i(function(c){return c=de(c,bn(Mt())),Ft(function(p){var y=this;return o(c,function(b){return yn(b,y,p)})})})}function dc(o,c){c=c===n?" ":xn(c);var p=c.length;if(p<2)return p?Pf(c,o):c;var y=Pf(c,Zl(o/bs(c)));return _s(c)?Ji(Fn(y),0,o).join(""):y.slice(0,o)}function Xz(o,c,p,y){var b=c&C,M=ea(o);function E(){for(var R=-1,H=arguments.length,Z=-1,Q=y.length,et=j(Q+H),ft=this&&this!==ue&&this instanceof E?M:o;++Z<Q;)et[Z]=y[Z];for(;H--;)et[Z++]=arguments[++R];return yn(ft,b?p:this,et)}return E}function pb(o){return function(c,p,y){return y&&typeof y!="number"&&en(c,p,y)&&(p=y=n),c=wi(c),p===n?(p=c,c=0):p=wi(p),y=y===n?c<p?1:-1:wi(y),Lz(c,p,y,o)}}function fc(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=In(c),p=In(p)),o(c,p)}}function mb(o,c,p,y,b,M,E,R,H,Z){var Q=c&P,et=Q?E:n,ft=Q?n:E,wt=Q?M:n,Dt=Q?n:M;c|=Q?N:z,c&=~(Q?z:N),c&F||(c&=-4);var Bt=[o,c,b,wt,et,Dt,ft,R,H,Z],kt=p.apply(n,Bt);return Gf(o)&&Db(kt,Bt),kt.placeholder=y,Cb(kt,o,c)}function Hf(o){var c=Oe[o];return function(p,y){if(p=In(p),y=y==null?0:Ke(Nt(y),292),y&&C_(p)){var b=(Xt(p)+"e").split("e"),M=c(b[0]+"e"+(+b[1]+y));return b=(Xt(M)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(p)}}var Zz=vs&&1/Hl(new vs([,-0]))[1]==vt?function(o){return new vs(o)}:uh;function gb(o){return function(c){var p=Xe(c);return p==it?yf(c):p==ae?pF(c):oF(c,o(c))}}function yi(o,c,p,y,b,M,E,R){var H=c&A;if(!H&&typeof o!="function")throw new On(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=n),E=E===n?E:Ae(Nt(E),0),R=R===n?R:Nt(R),Z-=b?b.length:0,c&z){var Q=y,et=b;y=b=n}var ft=H?n:Vf(o),wt=[o,c,p,y,b,Q,et,M,E,R];if(ft&&fU(wt,ft),o=wt[0],c=wt[1],p=wt[2],y=wt[3],b=wt[4],R=wt[9]=wt[9]===n?H?0:o.length:Ae(wt[9]-Z,0),!R&&c&(P|B)&&(c&=-25),!c||c==C)var Dt=Gz(o,c,p);else c==P||c==B?Dt=Kz(o,c,R):(c==N||c==(C|N))&&!b.length?Dt=Xz(o,c,p,y):Dt=cc.apply(n,wt);var Bt=ft?X_:Db;return Cb(Bt(Dt,wt),o,c)}function yb(o,c,p,y){return o===n||Hn(o,ws[p])&&!Kt.call(y,p)?c:o}function _b(o,c,p,y,b,M){return pe(o)&&pe(c)&&(M.set(c,o),sc(o,c,n,_b,M),M.delete(c)),o}function Qz(o){return ra(o)?n:o}function bb(o,c,p,y,b,M){var E=p&v,R=o.length,H=c.length;if(R!=H&&!(E&&H>R))return!1;var Z=M.get(o),Q=M.get(c);if(Z&&Q)return Z==c&&Q==o;var et=-1,ft=!0,wt=p&S?new Ar:n;for(M.set(o,c),M.set(c,o);++et<R;){var Dt=o[et],Bt=c[et];if(y)var kt=E?y(Bt,Dt,et,c,o,M):y(Dt,Bt,et,o,c,M);if(kt!==n){if(kt)continue;ft=!1;break}if(wt){if(!df(c,function(Ut,Wt){if(!Vo(wt,Wt)&&(Dt===Ut||b(Dt,Ut,p,y,M)))return wt.push(Wt)})){ft=!1;break}}else if(!(Dt===Bt||b(Dt,Bt,p,y,M))){ft=!1;break}}return M.delete(o),M.delete(c),ft}function Jz(o,c,p,y,b,M,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||!M(new jl(o),new jl(c)));case pt:case yt:case lt:return Hn(+o,+c);case Et:return o.name==c.name&&o.message==c.message;case ke:case cn:return o==c+"";case it:var R=yf;case ae:var H=y&v;if(R||(R=Hl),o.size!=c.size&&!H)return!1;var Z=E.get(o);if(Z)return Z==c;y|=S,E.set(o,c);var Q=bb(R(o),R(c),y,b,M,E);return E.delete(o),Q;case qt:if(Ko)return Ko.call(o)==Ko.call(c)}return!1}function tU(o,c,p,y,b,M){var E=p&v,R=Wf(o),H=R.length,Z=Wf(c),Q=Z.length;if(H!=Q&&!E)return!1;for(var et=H;et--;){var ft=R[et];if(!(E?ft in c:Kt.call(c,ft)))return!1}var wt=M.get(o),Dt=M.get(c);if(wt&&Dt)return wt==c&&Dt==o;var Bt=!0;M.set(o,c),M.set(c,o);for(var kt=E;++et<H;){ft=R[et];var Ut=o[ft],Wt=c[ft];if(y)var vn=E?y(Wt,Ut,ft,c,o,M):y(Ut,Wt,ft,o,c,M);if(!(vn===n?Ut===Wt||b(Ut,Wt,p,y,M):vn)){Bt=!1;break}kt||(kt=ft=="constructor")}if(Bt&&!kt){var nn=o.constructor,Sn=c.constructor;nn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof nn=="function"&&nn instanceof nn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Bt=!1)}return M.delete(o),M.delete(c),Bt}function _i(o){return Xf(kb(o,n,Ib),o+"")}function Wf(o){return z_(o,Ie,qf)}function $f(o){return z_(o,hn,xb)}var Vf=Jl?function(o){return Jl.get(o)}:uh;function hc(o){for(var c=o.name+"",p=Ss[c],y=Kt.call(Ss,c)?p.length:0;y--;){var b=p[y],M=b.func;if(M==null||M==o)return b.name}return c}function Ds(o){var c=Kt.call(T,"placeholder")?T:o;return c.placeholder}function Mt(){var o=T.iteratee||lh;return o=o===lh?W_:o,arguments.length?o(arguments[0],arguments[1]):o}function pc(o,c){var p=o.__data__;return lU(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Yf(o){for(var c=Ie(o),p=c.length;p--;){var y=c[p],b=o[y];c[p]=[y,b,Sb(b)]}return c}function Pr(o,c){var p=dF(o,c);return H_(p)?p:n}function eU(o){var c=Kt.call(o,Cr),p=o[Cr];try{o[Cr]=n;var y=!0}catch{}var b=Yl.call(o);return y&&(c?o[Cr]=p:delete o[Cr]),b}var qf=bf?function(o){return o==null?[]:(o=ie(o),qi(bf(o),function(c){return M_.call(o,c)}))}:dh,xb=bf?function(o){for(var c=[];o;)ji(c,qf(o)),o=Gl(o);return c}:dh,Xe=tn;(xf&&Xe(new xf(new ArrayBuffer(1)))!=gn||qo&&Xe(new qo)!=it||wf&&Xe(wf.resolve())!=Vt||vs&&Xe(new vs)!=ae||jo&&Xe(new jo)!=re)&&(Xe=function(o){var c=tn(o),p=c==_t?o.constructor:n,y=p?Ir(p):"";if(y)switch(y){case BF:return gn;case FF:return it;case zF:return Vt;case UF:return ae;case HF:return re}return c});function nU(o,c,p){for(var y=-1,b=p.length;++y<b;){var M=p[y],E=M.size;switch(M.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=Ke(c,o+E);break;case"takeRight":o=Ae(o,c-E);break}}return{start:o,end:c}}function iU(o){var c=o.match(Nd);return c?c[1].split(Bd):[]}function wb(o,c,p){c=Qi(c,o);for(var y=-1,b=c.length,M=!1;++y<b;){var E=Un(c[y]);if(!(M=o!=null&&p(o,E)))break;o=o[E]}return M||++y!=b?M:(b=o==null?0:o.length,!!b&&wc(b)&&bi(E,b)&&(Pt(o)||Lr(o)))}function rU(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 vb(o){return typeof o.constructor=="function"&&!na(o)?Ts(Gl(o)):{}}function sU(o,c,p){var y=o.constructor;switch(c){case Pe:return zf(o);case pt:case yt:return new y(+o);case gn:return Wz(o,p);case Wi:case Cn:case je:case Ln:case di:case Oo:case Ao:case Tr:case fi:return rb(o,p);case it:return new y;case lt:case cn:return new y(o);case ke:return $z(o);case ae:return new y;case qt:return Vz(o)}}function oU(o,c){var p=c.length;if(!p)return o;var y=p-1;return c[y]=(p>1?"& ":"")+c[y],c=c.join(p>2?", ":" "),o.replace(Nn,`{
|
|
7
|
+
`)}}function fP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=m0(()=>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 h0(d),{isSupported:a,stop:d}}function hP(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),_=f.shallowRef(0),x=f.shallowRef(0);function v(){const C=Qr(e);if(!C){n&&(l.value=0,u.value=0,d.value=0,h.value=0,m.value=0,g.value=0,_.value=0,x.value=0);return}const A=C.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,_.value=A.x,x.value=A.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return fP(e,S),f.watch(()=>Qr(e),C=>!C&&S()),cP(e,S,{attributeFilter:["style","class"]}),r&&yo("scroll",S,{capture:!0,passive:!0}),i&&yo("resize",S,{passive:!0}),oP(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:m,width:g,x:_,y:x,update:S}}function pP(e,t){const{top:n,left:i}=hP(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 mP=({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},g0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),_o=f.ref({}),gP=e=>(_o.value[e]||(_o.value[e]=g0()),_o.value[e]),yP=(e,t)=>{const n=_o.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 _o.value[t])};function _P({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?gP(n):g0(),m=e!==void 0?e:"static-chart-key",g=f.computed(()=>t.reduce((O,{timestamps:L})=>[...O,...L],[])),_=f.computed(()=>i||g.value.reduce((O,L)=>O===0?L:Math.min(O,L),0)),x=f.computed(()=>r||g.value.reduce((O,L)=>Math.max(O,L),0));f.watchEffect(()=>{h.minStamps[m]=_.value,h.maxStamps[m]=x.value,l!==void 0&&(h.renderPoints[m]=l)});const v=f.computed(()=>Object.values(h.minStamps).reduce((O,L)=>O===0?L:Math.min(O,L),0)),S=f.computed(()=>Object.values(h.maxStamps).reduce((O,L)=>Math.max(O,L),0)),C=f.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((L,$)=>Math.max(L,$),2)}),A=f.computed(()=>{const O=S.value-v.value;return Math.ceil(O/C.value)}),F=f.computed(()=>t.length>1),P=f.computed(()=>t.map(({timestamps:O,color:L,label:$})=>({data:mP({bucketCount:C.value,minStamp:v.value,maxStamp:S.value,timestamps:O}).map(([ct,ht])=>({x:ct,y:ht})),label:$,...(u==="sparkline_bar"||F.value)&&L&&{backgroundColor:L},...u!=="sparkline_bar"&&L&&{borderColor:L},...F.value&&u!=="sparkline_bar"&&{fill:!0}}))),B=f.computed(()=>{const O=P.value[0]?.data?.length??0,L=[];for(let $=0;$<O;$++){let q=0;for(let st=0;st<P.value.length;st++)q+=P.value[st].data[$].y;L.push(q)}return L}),N=f.computed(()=>{const O=B.value.reduce((L,$)=>Math.max(L,$),0);return Math.max(O,a??0)}),z=f.computed(()=>{const O=P.value.reduce((q,{data:st})=>[...q,...st.map(({y:ct})=>ct)],[]),L=O.length?O[0]:0,$=O.reduce((q,st)=>Math.min(q,st),L);return s===void 0?$:Math.min($,s)});f.watchEffect(()=>{h.maxCounts[m]=N.value,h.minCounts[m]=z.value});const k=f.computed(()=>{const O=Object.values(h.minCounts),L=O.length?O[0]:0;return O.reduce(($,q)=>Math.min($,q),L)}),w=f.computed(()=>Object.values(h.maxCounts).reduce((O,L)=>Math.max(O,L),0));return f.onUnmounted(()=>{e!==void 0&&n!==void 0&&yP(e,n)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:A,syncedMinCount:k,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},zu=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Uu=(e,t)=>t.sum>0?e/t.sum:null,y0=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},Hu=(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"},_0=18,bP=85;function xP(e,t,n,i){const{i18n:r}=Fp(),{formatUnit:s}=$n({i18n:r}),a=N=>N.map(z=>{const k=Math.min(z.ratio,.5)/.5;return{...z,color:Bs({metric:n.value}),tint:`${_0+k*(bP-_0)}%`}}),l=f.computed(()=>e.value?.data??[]),u=f.computed(()=>e.value?.meta?.metric_names??[]),d=f.computed(()=>{const N=n.value;return N&&u.value.includes(N)?N:u.value[0]}),h=f.computed(()=>u.value.filter(N=>N!==d.value)),m=f.computed(()=>e.value?.meta?.display?.[t.value]??{}),g=(N,z)=>{if(xo(N)||N==="count"||N==="requests")return"";const k=z===1?"":"s";return r.te(`chartUnits.${N}`)?r.t(`chartUnits.${N}`,{plural:k}):N},_=N=>N.replace(/\s+%/,"%").trim(),x=N=>{const z=k=>_(s(k,"%",{translateUnit:w=>g(w,k)}));return N>0&&N<.01?`< ${z(.01)}`:z(N)},v=(N,z)=>{if(N===null)return"–";const k=e.value?.meta?.metric_units?.[z]||"count";return k==="%"?x(N):_(s(N,k,{isBytes1024:!0,translateUnit:w=>g(w,N)}))},S=N=>r.te(`chartLabels.${N}`)?r.t(`chartLabels.${N}`):N,C=N=>gr(i.value,N)?.label||S(N),A=f.computed(()=>zu(l.value.map(N=>d.value?Jr(N.event[d.value]):null))),F=N=>h.value.flatMap(z=>{const k=Jr(N[z]);if(k===null)return[];const w=Hu(k,gr(i.value,z)?.thresholds);return[{key:z,label:C(z),value:v(k,z),threshold:w}]}),P=f.computed(()=>{if(!d.value)return[];const N=l.value.map(z=>{const k=z.event,w=String(k[t.value]),O=Jr(k[d.value])??0,L=Uu(O,A.value),$=L??0,q=w===Fu;return{id:w,name:q?S(Fu):m.value[w]?.name||w,deleted:!!m.value[w]?.deleted,isOther:q,isEmpty:w===JR,value:O,ratio:$,display:v(O,d.value),relative:L===null?"":x(L*100),tooltipRows:F(k)}}).sort((z,k)=>Number(z.isOther)-Number(k.isOther)||k.value-z.value);return a(N)});return{column:f.computed(()=>({dimension:t.value,label:C(t.value),total:v(A.value.sum,d.value??"count"),cells:P.value})),cells:P,sizeKey:d}}const St={useBarChartOptions:MR,useChartJSCommon:CR,useChartLegendValues:AR,useChartSelectedRange:ER,useExploreResultToDatasets:FR,useExploreResultToTimeDataset:WR,useScatterDatasets:KR,useDonutChartOptions:RR,useLineChartOptions:PR,useScatterChartOptions:NR,useI18n:Fp,useReportChartDataForSynthetics:XR,useTranslatedUnits:ZR,useEvaluateFeatureFlag:tP,useTooltipAbsolutePosition:pP,useSparklineSync:_P,useTopTalkersData:xP},el=e=>["interactive","zoom-interactive"].includes(e),Wu=(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,_)=>{const x=g.parsed[d],v=g.dataset.unit??e.units,S=a(x??0,v,{translateUnit:e.translateUnit}),C=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:C,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}},b0=(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 _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},wP=e=>e&&e.datasets&&e.datasets.length,vP=e=>wP(e)&&e.datasets.some(t=>t.data.length),SP=e=>e.datasets.some(t=>t.data[0]&&Hc(t.data[0].x)),TP=e=>!!vP(e)&&e.datasets.some(t=>t.data.length==1),kP=e=>SP(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)},x0=(e,t,n)=>{const s=e.y??0;return s<n?s+t*.15:s-t*.5};function w0(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const $u=(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)},MP=2,v0=10,S0=12,il=10,rl="y",Vu="y1",Xn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Yu=(e,t)=>(t||Xn)[e%Xn.length],DP="#6f7787",CP={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"}},OP=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return CP[t]?.background||"#fafafa"},AP=aS,qu=(e,t,n,i)=>{let r;return n?r=AP:Array.isArray(i)?r=Yu(e,i):r=i[t],r||Yu(e)},ju=e=>{switch(e){case"error":return lS;case"warning":return fS;case"neutral":return op;default:return op}},EP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},RP=2,PP=0,Gu=new Map,T0=(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)},IP=e=>{const n=document.createElement("canvas").getContext("2d"),i=ce({});return n.font=i.string,n.measureText(e).width},LP=()=>{const e="label_height";if(!Gu.has(e)){const t=ce({});Gu.set(e,t.lineHeight)}return Gu.get(e)},NP=(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),BP=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,FP=oS,zP={100:mS,101:gS,102:yS,103:_S,200:bS,201:xS,202:wS,203:vS,204:SS,205:TS,206:kS,207:MS,208:DS,226:CS,300:OS,301:AS,302:ES,303:RS,304:PS,305:IS,307:LS,308:NS,400:BS,401:FS,402:zS,403:US,404:HS,405:WS,406:$S,407:VS,408:YS,409:qS,410:jS,411:GS,412:KS,413:XS,414:ZS,415:QS,416:JS,417:tT,418:eT,421:nT,422:iT,423:rT,424:sT,425:oT,426:aT,428:lT,429:cT,431:uT,451:dT,500:fT,501:hT,502:pT,503:mT,504:gT,505:yT,506:_T,507:bT,508:xT,510:wT,511:vT},UP={100:ST,200:TT,300:kT,400:MT,500:DT},HP={"1XX":CT,"2XX":OT,"3XX":AT,"4XX":ET,"5XX":RT},k0=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return zP[t]??UP[n]??FP},Ku={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=k0(`${t}`),e),{}),____OTHER____:sS,...HP};function M0(e,t,n){const i=Op(),r=VP(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?WP(r,t):$P(r,t)}function WP(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 $P(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function VP(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function YP(e,t){const n=XP(t);return"formatToParts"in n?jP(n,e):GP(n,e)}const qP={year:0,month:1,day:2,hour:3,minute:4,second:5};function jP(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=qP[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 GP(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 Xu={},D0=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")),KP=D0==="06/25/2014, 00:00:00"||D0==="06/25/2014 00:00:00";function XP(e){return Xu[e]||(Xu[e]=KP?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"})),Xu[e]}function C0(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 O0=36e5,ZP=6e4,Zu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Qu(e,t,n){if(!e)return 0;let i=Zu.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Zu.timezoneHH.exec(e),i)return r=parseInt(i[1],10),A0(r)?-(r*O0):NaN;if(i=Zu.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return A0(r,a)?(s=Math.abs(r)*O0+a*ZP,i[1]==="+"?-s:s):NaN}if(t2(e)){t=new Date(t||Date.now());const a=n?t:QP(t),l=Ju(a,e);return-(n?l:JP(t,l,e))}return NaN}function QP(e){return C0(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Ju(e,t){const n=YP(e,t),i=C0(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 JP(e,t,n){let r=e.getTime()-t;const s=Ju(new Date(r),n);if(t===s)return t;r-=s-t;const a=Ju(new Date(r),n);return s===a?s:Math.max(s,a)}function A0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const E0={};function t2(e){if(E0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),E0[e]=!0,!0}catch{return!1}}const e2=60*1e3,n2={X:function(e,t,n){const i=td(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return R0(i);case"XXXX":case"XX":return ts(i);default:return ts(i,":")}},x:function(e,t,n){const i=td(n.timeZone,e);switch(t){case"x":return R0(i);case"xxxx":case"xx":return ts(i);default:return ts(i,":")}},O:function(e,t,n){const i=td(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+i2(i,":");default:return"GMT"+ts(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return M0("short",e,n);default:return M0("long",e,n)}}};function td(e,t){const n=e?Qu(e,t,!0)/e2: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 R0(e,t){return e%60===0?(e>0?"-":"+")+sl(Math.abs(e)/60,2):ts(e,t)}function i2(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 P0(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 r2=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ed=36e5,I0=6e4,s2=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:r2};function L0(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?s2: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=o2(e),{year:r,restDateString:s}=a2(i.date,n),a=l2(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=c2(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Qu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=P0(new Date(l+u)),d=P0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function o2(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 a2(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 l2(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,F0(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 f2(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 F0(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,z0(r)?N0(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 z0(r,a)?N0(t,r,a):new Date(NaN)}return null}function c2(e){let t,n,i=Qe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),nd(t)?t%24*ed:NaN;if(i=Qe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),nd(t,n)?t%24*ed+n*I0: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 nd(t,n,r)?t%24*ed+n*I0+r*1e3:NaN}return null}function N0(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 u2=[31,28,31,30,31,30,31,31,30,31,30,31],d2=[31,29,31,30,31,30,31,31,30,31,30,31];function B0(e){return e%400===0||e%4===0&&e%100!==0}function F0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=B0(e);if(i&&n>d2[t]||!i&&n>u2[t])return!1}return!0}function f2(e,t){if(t<1)return!1;const n=B0(e);return!(n&&t>366||!n&&t>365)}function z0(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function nd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const h2=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function id(e,t,n={}){t=String(t);const i=t.match(h2);if(i){const r=L0(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,"'"+n2[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return ya(e,t,n)}function p2(e,t,n){e=L0(e,n);const i=Qu(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},id(p2(e,t,{timeZone:i.timeZone}),n,i)}const m2=(e,t)=>`${bo(e,t,"yyyy")} W${bo(e,t,"II")}`,rd="yyyy-MM-dd h:mm:ss a",sd="h:mm:ss a",yr="yyyy-MM-dd h:mm a",es="h:mm a",g2="yyyy-MM-dd",od="MMM dd, yyyy h:mm:ss a",Bi="MMM dd, yyyy h:mm a",y2={secondly:e=>e?rd:sd,tenSecondly:e=>e?rd:sd,thirtySecondly:e=>e?rd:sd,minutely:e=>e?yr:es,fiveMinutely:e=>e?yr:es,tenMinutely:e=>e?yr:es,thirtyMinutely:e=>e?yr:es,hourly:e=>e?yr:es,twoHourly:e=>e?yr:es,twelveHourly:()=>yr,daily:()=>g2},_2={secondly:()=>od,tenSecondly:()=>od,thirtySecondly:()=>od,minutely:()=>Bi,fiveMinutely:()=>Bi,tenMinutely:()=>Bi,thirtyMinutely:()=>Bi,hourly:()=>Bi,twoHourly:()=>Bi,twelveHourly:()=>Bi,daily:()=>Bi};function U0({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 m2(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 H0=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>U0({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:y2,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ns=({tickValue:e,granularity:t,timezone:n})=>U0({tickValue:e,granularity:t,timezone:n,tooltipMap:_2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),W0=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",b2=e=>{const{i18n:t}=St.useI18n();return W0(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"),x2=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},w2=(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)},v2=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,w2(n,i)]))},$0=.7,ad=(e,t)=>{const n=Aa(e.trim());return n.valid?n.alpha(t).rgbString():e},ld=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:ap,outlier:rp,outlierBand:ad(sp,$0)};const n=window.getComputedStyle(t),i=(r,s)=>n.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",ap),outlier:i("--kui-color-background-danger",rp),outlierBand:ad(i("--kui-color-background-danger-weakest",sp),$0)}},S2="empty",V0=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??[],_=[];for(const x of g){const v=q0(x.timestamp,x.event[h],m?x.event[m]:void 0);if(v){if(d){const S=Y0(x.event[d]);if(S===void 0)continue;v.x=S}_.push(v)}}return{points:_,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}},Y0=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},q0=(e,t,n,i)=>{const r=new Date(e).valueOf(),s=Y0(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):S2,...a}},T2=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:r,label:s,unit:a}of n){const l=_r(e,r)??_r(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},k2=(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=_r(h,u);for(const g of M2(h,r)){const _=_r(g,n),x=i?_r(g,i)??_r(h,i):void 0,v=q0(m,_,i?x??null:void 0,T2(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"}},M2=(e,t)=>{if(!t)return[e];const n=_r(e,t);return Array.isArray(n)?n:[]},_r=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},j0=e=>Object.hasOwn(Bp.chartLabels,e),D2=["hidden","single","full"];var br=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(br||{});const C2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],O2=["gauge","top_n","single_value"],cd=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 G0={modes:{point(e,t){return ol(e,t,{intersect:!0})},nearest(e,t,n){return R2(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 ud(e,t,n){return(G0.modes[n.mode]||G0.modes.nearest)(e,t,n)}function A2(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 E2(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):A2(i,t,n.axis))}function R2(e,t,n){let i=Number.POSITIVE_INFINITY;return ol(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),l=E2(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 P2=(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)),K0=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function I2(e,t,n){for(const i of Object.keys(e))e[i]=al(e[i],t,n);return e}function L2(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 X0(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 Z0(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=xr(e,n,ve(-r));return X0(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 N2(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(P2(l,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Q0=e=>typeof e=="string"&&e.endsWith("%"),J0=e=>parseFloat(e)/100,ty=e=>al(J0(e),0,1),wo=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),B2={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 dd(e,t){return t==="start"?0:t==="end"?e:Q0(t)?ty(t)*e:e/2}function Fi(e,t,n=!0){return typeof t=="number"?t:Q0(t)?(n?ty(t):J0(t))*e:e}function F2(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 ey(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const l=Lt(a),u=t.width+(l?a.width:0)+n,d=t.height+(l?a.height:0)+n,h=fd(i),m=sy(e.x,u,r,h.x),g=sy(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 fd(e,t="center"){return Lt(e)?{x:Ct(e.x,t),y:Ct(e.y,t)}:(e=Ct(e,t),{x:e,y:e})}const ny=(e,t)=>e&&e.autoFit&&t<1;function iy(e,t){const n=e.font,i=Gt(n)?n:[n];return ny(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 ry(e){return e&&(rn(e.xValue)||rn(e.yValue))}function sy(e,t,n=0,i){return e-dd(t,i)+n}function is(e,t,n){const i=n.init;if(i){if(i===!0)return ay(t,n)}else return;return z2(e,t,n)}function oy(e,t,n){let i=!1;return t.forEach(r=>{sn(e[r])?(i=!0,n[r]=e[r]):rn(n[r])&&delete n[r]}),i}function ay(e,t){const n=t.type||"line";return B2[n](e)}function z2(e,t,n){const i=Jt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return ay(t,n);if(Lt(i))return i}const hd=new Map,U2=e=>isNaN(e)||e<=0,H2=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=iy(t),r=t.textStrokeWidth,s=Gt(n)?n:[n],a=s.join()+H2(i)+r+(e._measureText?"-spriting":"");return hd.has(a)||hd.set(a,Y2(e,s,i,r)),hd.get(a)}function ly(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:I2(Ei(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),l&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function cy(e,t,n,i){const r=n.content;if(ll(r)){e.save(),e.globalAlpha=G2(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=Gt(r)?r:[r],a=iy(n,i),l=n.color,u=Gt(l)?l:[l],d=F2(t,n),h=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,W2(e,n)&&q2(e,{x:d,y:h},s,a),j2(e,{x:d,y:h},s,{fonts:a,colors:u}),e.restore()}function W2(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function $2(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*nu;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}U2(r)||V2(e,{x:n,y:i,radius:r,rotation:l,style:a,rad:u})}function V2(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,ee),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-Rt,a-se),e.arc(t+u,n-l,h,a-se,a),e.arc(t+l,n+u,h,a,a+se),e.arc(t-u,n+l,h,a+se,a+Rt),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 Y2(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 q2(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 j2(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 G2(e,t){const n=Ai(e)?e:t;return Ai(n)?al(n,0,1):1}const uy=["left","bottom","top","right"];function K2(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&tI(t,s);if(!a||nI(t,s,a))return;if(e.save(),e.beginPath(),!ui(e,s))return e.restore();const{separatorStart:u,separatorEnd:d}=X2(t,a),{sideStart:h,sideEnd:m}=Q2(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 X2(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=Z2(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 Z2(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 Q2(e,t,n){const{y:i,width:r,height:s,options:a}=e,l=a.callout.start,u=J2(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 J2(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function tI(e,t){const n=t.position;return uy.includes(n)?n:eI(e,t)}function eI(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,_={x:h,y:m},x=t.start,v=Fi(a,x),S=Fi(l,x),C=[n,n+v,n+v,r],A=[i+S,s,i,s],F=[];for(let P=0;P<4;P++){const B=xr({x:C[P],y:A[P]},_,ve(g));F.push({position:uy[P],distance:Yr(B,{x:u,y:d})})}return F.sort((P,B)=>P.distance-B.distance)[0].position}function nI(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 dy={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 fy(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 hy(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 pd(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=gy(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=gy(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 py(e,t){if(!ry(t)){const n=pd(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 rI(e,t)}function iI(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?sI(r,s,t):oI(n,s,t),s}function my(e,t){const n=pd(e,t);return n.initProperties=is(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:cI(e,n,t),initProperties:n.initProperties}],n}function rI(e,t){const n=hy(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 gy(e,t){const n=fy(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function sI(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 oI(e,t,n){for(const i of Object.keys(dy)){const r=e[Sr(e,n,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=dy[i],m=fy(r,{min:n[s],max:n[a],start:r[l],end:r[u]});t[d]=m.start,t[h]=m.end}}}function aI({properties:e,options:t},n,i,r){const{x:s,x2:a,width:l}=e;return yy({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 lI({properties:e,options:t},n,i,r){const{y:s,y2:a,height:l}=e;return yy({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 yy(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+dd(d,s)}function cI(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=fd(i.position),s=Se(i.padding),a=ul(e.ctx,i),l=aI({properties:t,options:n},a,r,s),u=lI({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 md=["enter","leave"],gd=md.concat("click");function uI(e,t,n){t.listened=oy(n,gd,t.listeners),t.moveListened=!1,md.forEach(i=>{sn(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&sn(i.click)&&(t.listened=!0),t.moveListened||md.forEach(r=>{sn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function dI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return fI(e,t,n);case"click":return hI(e,t,n)}}function fI(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=ud(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=_y(s,"leave",r,i);return _y(s,"enter",i,r)||a}function _y({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=by(a.options[n]||e.listeners[n],a,t)||s);return s}function hI(e,t,n){const i=e.listeners,r=ud(e.visibleElements,t,n.interaction);let s;for(const a of r)s=by(a.options.click||i.click,a,t)||s;return s}function by(e,t,n){return Jt(e,[t.$context,n])===!0}const dl=["afterDraw","beforeDraw"];function pI(e,t,n){const i=t.visibleElements;t.hooked=oy(n,dl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||dl.forEach(s=>{sn(r.options[s])&&(t.hooked=!0)})})}function xy(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Jt(i,[t.$context])}}function mI(e,t,n){const i=xI(e.scales,t,n);let r=wy(t,i,"min","suggestedMin");r=wy(t,i,"max","suggestedMax")||r,r&&sn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function gI(e,t){for(const n of e)_I(n,t)}function wy(e,t,n,i){if(le(t[n])&&!yI(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function yI(e,t,n){return rn(e[t])||rn(e[n])}function _I(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=Sr(t,e,n);i&&!t[i]&&bI(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function bI(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(rn(e[n+i]))return!0;return!1}function xI(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ct(t.min,Number.NEGATIVE_INFINITY),max:Ct(t.max,Number.POSITIVE_INFINITY)};for(const l of n)l.scaleID===r?vy(l,t,["value","endValue"],a):Sr(e,l,s)===r&&vy(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function vy(e,t,n,i){for(const r of n){const s=e[r];if(rn(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 X0({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),ly(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return my(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 Z0({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||(MI(t,this),t.save(),cl(t,this.getCenterPoint(),this.rotation),cy(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=wI(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=SI(t,n,i);let l=ul(t.ctx,n);const u=TI(l,a);ny(n,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:m}=n,g=ey(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 wI(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof ro&&vI(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function vI(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 SI({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)},_={x:(g.left+g.right)/2,y:(g.top+g.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=_.y>m,C=S?r+x:a-x,A=kI(C,h,m,v);return{controllerMeta:{_centerX:h,_centerY:m,_radius:v,_counterclockwise:S,...A},point:_,radius:Math.min(l,Math.min(g.right-g.left,g.bottom-g.top)/2)}}function TI({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function kI(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:ee};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 MI(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 Z0({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=!rn(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),cl(t,this.getCenterPoint(),this.rotation),K2(t,this),ly(t,this,n),cy(t,DI(this),n),t.restore())}resolveElementProperties(t,n){let i;if(ry(n))i=hy(t,n);else{const{centerX:l,centerY:u}=pd(t,n);i={x:l,y:u}}const r=Se(n.padding),s=ul(t.ctx,n),a=ey(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 DI({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 yd=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),_d=(e,t,n)=>yd(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Sy=(e,t,n)=>yd(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,So=e=>e*e,CI=(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},Ty=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,bd=(e,t,n,i)=>({x:Ty(e.x,t.x,n.x,i),y:Ty(e.y,t.y,n.y,i)}),ky=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),My=(e,t,n,i)=>-Math.atan2(ky(e.x,t.x,n.x,i),ky(e.y,t.y,n.y,i))+.5*Rt;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,_=u.isPointInStroke(l,m,g)||xd(this,a,r);return u.restore(),_}const d=So(s);return RI(this,a,d,r)||xd(this,a,r)}return OI(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 UI(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Ey(this),_=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(_),t.beginPath(),t.moveTo(0+m,0),t.lineTo(u-g,0),t.shadowColor=l.borderShadowColor,t.stroke(),wd(t,0,m,d),wd(t,u,-g,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=iI(t,n),{x:r,y:s,x2:a,y2:l}=i,u=AI(i,t.chartArea),d=u?EI({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=zI(d,n,Yr(m,g))}const h=PI(t,d,n.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}To.id="lineAnnotation";const Dy={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({},Dy),fill:!1,length:12,start:Object.assign({},Dy),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 OI(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=CI(t,n,e.getProps(["x","y","x2","y2"],s),i);return K0(a,r)||xd(e,{mouseX:t,mouseY:n},s,i)}function AI({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 Cy({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=Sy(a,{x:e,y:t},n),e=a),e>r&&(t=Sy(r,{x:e,y:t},n),e=r),t<i&&(e=_d(i,{x:e,y:t},n),t=i),t>s&&(e=_d(s,{x:e,y:t},n),t=s),{x:e,y:t}}function EI(e,t,n){const{x:i,y:r}=Cy(e,t,n),{x:s,y:a}=Cy(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function RI(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 _,x;return g<0?(_=s,x=a):g>1?(_=l,x=u):(_=s+g*d,x=a+g*h),So(t-_)+So(n-x)<=i}function xd(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function PI(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 LI(t,n,{width:a,height:l,padding:r},e.chartArea)}function II(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>Rt/2?s-Rt:s<Rt/-2?s+Rt:s}function LI(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"?II(e):ve(t.rotation),g=NI(r,s,m),_=BI(e,t,{labelSize:g,padding:a},i),x=e.cp?bd(d,e.cp,h,_):yd(d,h,_),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},C=Ay(x.x,v)+l,A=Ay(x.y,S)+u;return{x:C-r/2,y:A-s/2,x2:C+r/2,y2:A+s/2,centerX:C,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:Da(m)}}function NI(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 BI(e,t,n,i){let r;const s=FI(e,i);return t.position==="start"?r=Oy({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-Oy({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=dd(1,t.position),r}function Oy(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 FI(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 Ay(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 Ey(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Ry(e,n),endAdjust:Ry(e,i)}}function Ry(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(_d(0,s,{x:0,y:r}))}function wd(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 zI(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=fd(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 Py(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),wd(e,0,-r,s),e.restore())}function UI(e,t,n,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Ey(t),_={x:r,y:s},x={x:a,y:l},v=My(_,n,x,0),S=My(_,n,x,1)-Rt,C=bd(_,n,x,m/i),A=bd(_,n,x,1-g/i),F=new Path2D;e.beginPath(),F.moveTo(C.x,C.y),F.quadraticCurveTo(n.x,n.y,A.x,A.y),e.shadowColor=u.borderShadowColor,e.stroke(F),t.path=F,t.ctx=e,Py(e,C,{angle:v,adjust:m},d),Py(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 HI({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,Rt/2,0,2*Rt),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return my(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 HI(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),_=Math.pow(m*(e.x-a)+g*(e.y-l),2),x=Math.pow(g*(e.x-a)-m*(e.y-l),2);return _/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"?L2({x:t,y:n},this.getCenterPoint(r),d/2,h):K0(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);$2(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=py(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&&$I(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=py(t,n),{sides:r,rotation:s}=n,a=[],l=2*Rt/r;let u=s*nu;for(let d=0;d<r;d++,u+=l){const h=WI(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 WI({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 $I(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=>{oe.describe(`elements.${zi[e].id}`,{_fallback:"plugins.annotation.common"})});const VI={update:Object.assign},YI=gd.concat(dl),Iy=(e,t)=>Lt(t)?Td(e,t):e,vd=e=>e==="color"||e==="font";function Sd(e="line"){return zi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function qI(e,t,n,i){const r=GI(e,n.animations,i),s=t.annotations,a=ZI(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=Ly(a,l,u.type),h=u.setContext(XI(e,d,a,u)),m=d.resolveElementProperties(e,h);m.skip=jI(m),"elements"in m&&(KI(d,m.elements,h,r),delete m.elements),rn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=Ny(h),r.update(d,m)}}function jI(e){return isNaN(e.x)||isNaN(e.y)}function GI(e,t,n){return n==="reset"||n==="none"||n==="resize"?VI:new gu(e,t)}function KI(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=Ly(r,s,a.type,a.initProperties),d=n[a.optionScope].override(a);l.options=Ny(d),i.update(u,l)}}function Ly(e,t,n,i){const r=zi[Sd(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Ny(e){const t=zi[Sd(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Td(e,t.defaults),Td(e,t.defaultRoutes));for(const i of YI)n[i]=e[i];return n}function Td(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];vd(i)&&Gt(s)?n[i]=s.map(a=>Iy(a,r)):n[i]=Iy(s,r)}return n}function XI(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 ZI(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 QI="3.1.0";const Ui=new Map,By=e=>e.type!=="doughnutLabel",JI=gd.concat(dl);var Fy={id:"annotation",version:QI,beforeRegister(){N2("chart.js","4.0",on.version)},afterRegister(){on.register(zi)},afterUnregister(){on.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;Lt(s)?Object.keys(s).forEach(a=>{const l=s[a];Lt(l)&&(l.id=a,r.push(l))}):Gt(s)&&r.push(...s),gI(r.filter(By),e.scales)},afterDataLimits(e,t){const n=Ui.get(e);mI(e,t.scale,n.annotations.filter(By).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Ui.get(e);uI(e,i,n),qI(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),pI(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);dI(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 ud(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=>!JI.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${zi[Sd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:vd,_fallback:!0},_indexable:vd}},additionalOptionScopes:[""]};function Mo(e,t,n){const{ctx:i,chartArea:r}=e,s=Ui.get(e);n&&to(i,r);const a=tL(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)eL(i,r,s,l);n&&eo(i)}function tL(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 eL(e,t,n,i){const r=i.element;i.main?(xy(n,r,"beforeDraw"),r.draw(e,t),xy(n,r,"afterDraw")):r.draw(e,t)}const nL={class:"zoom-timerange-container"},iL={class:"zoom-timerange-details"},rL={class:"label","data-testid":"zoom-timerange-from"},sL={class:"label","data-testid":"zoom-timerange-to"},oL=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)=>{w0(()=>{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",nL,[f.createElementVNode("div",iL,[f.createElementVNode("div",rL,f.toDisplayString(f.unref(n).t("zoom_time_range.from")),1),f.createElementVNode("div",null,f.toDisplayString(i.value),1),f.createElementVNode("div",sL,f.toDisplayString(f.unref(n).t("zoom_time_range.to")),1),f.createElementVNode("div",null,f.toDisplayString(r.value),1)])]))}}),Me=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},zy=Me(oL,[["__scopeId","data-v-4fa681cf"]]),aL={class:"zoom-actions-container"},lL={class:"zoom-actions-heading"},cL={class:"zoom-action-select"},uL=["data-testid"],dL=["aria-disabled","href"],fL=["onClick"],hL=Me(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",aL,[f.createElementVNode("div",lL,[f.createVNode(zy,{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(Bc)})`,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",cL,[(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,dL)):(f.openBlock(),f.createElementBlock("div",{key:1,onClick:u=>r(l)},f.toDisplayString(l.label),9,fL))],10,uL))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),pL={key:2},mL={class:"tooltip-title"},gL={class:"title"},yL={key:0,class:"subtitle"},_L={class:"context"},bL={class:"metric"},xL={class:"tooltip"},wL={key:0,class:"square-marker marker-placeholder"},vL={class:"display-value"},Do=Me(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}=dP(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],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),f.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),f.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();n("dimensions",{width:x,height:v})}}),(_,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(zy,{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(hL,{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",pL,[f.createElementVNode("div",mL,[f.createElementVNode("div",gL,[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(Bc)})`,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",yL,[f.createElementVNode("div",_L,f.toDisplayString(h.value),1),f.createElementVNode("div",bL,f.toDisplayString(m.value),1)])):f.createCommentVNode("",!0)]),f.createElementVNode("ul",xL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:C,value:A,isSegmentEmpty:F,isExtra:P},B)=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:C+B},[e.state.tooltipSeries.length?(f.openBlock(),f.createElementBlock("li",{key:0,class:f.normalizeClass({"extra-row":P})},[P?(f.openBlock(),f.createElementBlock("div",wL)):(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:F}])},f.toDisplayString(C),3),f.createElementVNode("span",vL,f.toDisplayString(A),1)],2)):f.createCommentVNode("",!0)],64))),128))])]))],6)):f.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),SL={key:0,class:"legend-container","data-testid":"legend"},TL=["onClick"],kL={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},ML=["stroke","stroke-dasharray"],DL=["title"],CL={class:"label truncate-label"},OL={key:0,class:"sub-label"},AL={key:0},EL={class:"tooltip-content"},ml=Me(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 on?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 on?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",SL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.items,({fillStyle:m,strokeStyle:g,text:_,datasetIndex:x,index:v,value:S,isSegmentEmpty:C,isKey:A,lineDash:F},P)=>(f.openBlock(),f.createElementBlock("li",{key:s({datasetIndex:x,index:v,isKey:A},P),class:f.normalizeClass({"legend-key":A}),onClick:B=>A?void 0:a(x,v)},[F?.length?(f.openBlock(),f.createElementBlock("svg",kL,[f.createElementVNode("line",{stroke:g,"stroke-dasharray":F.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,ML)])):(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)?`${_}: ${S.formatted}`:_},[f.createElementVNode("div",CL,f.toDisplayString(_),1),S&&(f.unref(i)||A)?(f.openBlock(),f.createElementBlock("div",OL,[A?(f.openBlock(),f.createElementBlock("span",AL,"-")):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(S.formatted),1)])):f.createCommentVNode("",!0)],10,DL)]),_:2},[C?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",EL,f.toDisplayString(f.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,TL))),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 RL(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 PL=new Uint8Array(16);function IL(){return crypto.getRandomValues(PL)}function kd(e,t,n){return crypto.randomUUID?crypto.randomUUID():LL(e)}function LL(e,t,n){e=e||{};const i=e.random??e.rng?.()??IL();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,RL(i)}const Uy=(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 Hy{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Uy(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,Uy(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 NL=["id"],BL=["id"],FL={class:"axis-tooltip-content"},zL="100%",UL="100%",HL=20,WL=20,Wy=6,$L=0,VL=10,YL=10,qL=1,jL=Me(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 Hy,l=f.useTemplateRef("chartContainer"),u=f.useTemplateRef("chartParent"),d=({chart:X},tt)=>{const rt=X.data,pt=rt.labels?.indexOf(tt);return rt.datasets.reduce((yt,mt,Et)=>{if(X.isDatasetVisible(Et)){const zt=mt.data[pt];return isNaN(zt)?yt:yt+zt}else return yt},0)},h=(X,tt,rt,pt)=>{const yt=pt==="horizontal";tt===null&&(tt=n.t("entityNoName"));const mt={type:"label",yValue:G=>yt?tt:d(G,tt),xValue:G=>yt?d(G,tt):tt},Et={...mt,position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>yt?0:-Math.abs(LP()),content:G=>T0(d(G,tt),rt)},zt={...mt,content:G=>BP(d(G,tt),NP(G.chart,X)),position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:G=>yt?IP(T0(d(G,tt),rt)):0,color:DP};return{[`${tt}-value`]:Et,[`${tt}-percent`]:zt}},m=f.useTemplateRef("canvas"),g=f.useTemplateRef("axis"),_=kd(),x=kd(),v=f.ref([]),S=f.inject("legendPosition",Le.Bottom),C=f.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),A=f.toRef(t,"metricUnit"),F=f.computed(()=>t.orientation==="horizontal"),P=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:F.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:B,tooltipAbsoluteTop:N}=St.useTooltipAbsolutePosition(u,P),z=f.ref(0),k=()=>t.annotations&&t.chartData.labels?.reduce((X,tt)=>Object.assign(X,h(t.chartData,tt,A.value,t.orientation)),{}),w={id:_,afterUpdate(X){z.value+=1,v.value=$u(X,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?k():{}}},$=[w,{id:"axisHover",afterEvent(X,tt){if(C.show=!1,tt.event.type==="mousemove"){const rt=tt.event,pt=X.options.indexAxis,yt=X.scales,mt=X.scales[pt].getLabelForValue(Number(X.scales[pt].getValueForPixel(rt[pt]))),zt=X.scales[pt].getLabels().indexOf(mt),G=t.chartData.isLabelEmpty?.[zt];if((lt=>lt==="x"?rt.y>yt.x.top:rt.x<yt.y.right)(pt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const $t=X.canvas.getContext("2d").measureText(mt).width,_t=Math.abs(Math.round(rt.x-$t*.5)),Vt=Math.round(rt.x+$t*.5),Te=X.canvas.getBoundingClientRect(),ke=40;C.left=pt==="x"?`${(_t>0?_t:Vt)-C.offset+Te.left}px`:`${rt.x-$t*.5-C.offset+Te.left}px`,C.top=`${rt.y-ke+Te.top}px`,mt.length>il?(C.show=!0,C.text=mt):G?(C.text=n.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],q=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),st=f.ref(0),ct=f.ref(0),ht=new ResizeObserver(w0(X=>{st.value=X[0].contentRect.width,ct.value=X[0].contentRect.height},100)),ut=f.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&!F.value?`${Math.max(X*(HL+Wy),st.value)}px`:zL}),vt=f.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&F.value?`${Math.max(X*(WL+Wy),ct.value)}px`:UL});St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&on.register(Fy),l.value&&(st.value=l.value.offsetWidth,ct.value=l.value.offsetHeight,ht.observe(l.value))}),f.onUnmounted(()=>{l.value&&ht.unobserve(l.value)});const at=f.computed(()=>{const X=St.useBarChartOptions({tooltipState:P,legendID:_,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:F.value?"y":"x",numLabels:q});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:k(),clip:!1}}}}),dt=St.useChartJSCommon("bar",m,f.toRef(t,"chartData"),$,at);f.onBeforeUnmount(()=>{on.unregister(Fy)});const V={[Le.Bottom]:"column"},I=f.computed(()=>{if(g.value&&dt.value){const X=window.devicePixelRatio,tt=dt.value,rt=tt.scales.y.width*X+qL,pt=(tt.scales.y.height+tt.scales.y.top+tt.scales.x.height)*X,yt=g.value.getContext("2d");return yt.scale(X,X),yt.canvas.width=rt,yt.canvas.height=pt,yt.canvas.style.width=`${rt/X}px`,yt.canvas.style.height=`${pt/X}px`,{scale:X,width:rt*X,height:pt*X,targetCtx:yt}}return null}),W=X=>{const tt=X.target;if(I.value&&dt.value&&!F.value){const rt=I.value.scale,pt=I.value.targetCtx,yt=I.value.width,mt=I.value.height,Et=dt.value,zt=Et.canvas;pt.fillStyle="white",tt.scrollLeft>=$L&&tt.scrollLeft<=VL?(pt.globalCompositeOperation="source-over",pt.clearRect(0,0,yt,mt),pt.drawImage(zt,0,0,yt,mt,0,0,yt,mt),pt.globalCompositeOperation="destination-over",pt.fillRect(0,0,yt,mt)):(pt.globalCompositeOperation="source-over",pt.fillRect(0,(Et.scales.y.height+Et.scales.y.top+YL)*rt,yt,Et.scales.x.height*rt))}P.offsetY=tt.scrollTop,P.offsetX=tt.scrollLeft,C.offset=tt.scrollLeft},nt=({width:X,height:tt})=>{P.width=X,P.height=tt};f.watch(()=>t.orientation,()=>{if(g.value&&I.value){const X=I.value.width,tt=I.value.height;(g.value?.getContext("2d")).clearRect(0,0,X,tt)}P.showTooltip=!1,P.interactionMode="idle"}),f.watch(()=>t.annotations,X=>{dt.value&&(X?dt.value.options.plugins.annotation.annotations=k(t.chartData):delete dt.value.options.plugins.annotation.annotations)});const ot=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(X,tt)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",V[f.unref(S)]])},[f.createElementVNode("canvas",{id:f.unref(r),ref:"axis",class:"axis"},null,8,NL),f.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:tt[0]||(tt[0]=rt=>ot()),onScroll:W},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:ut.value,height:vt.value})},[f.createElementVNode("canvas",{id:f.unref(s),ref:"canvas",class:"chart-canvas"},null,8,BL)],4)],544),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[C.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[f.createElementVNode("div",FL,f.toDisplayString(C.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(Do,{"absolute-left":f.unref(B),"absolute-top":f.unref(N),"chart-parent-ref":u.value,state:P,"tooltip-title":e.tooltipTitle,onDimensions:nt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),f.createVNode(ml,{id:f.unref(_),"chart-instance":f.unref(dt),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const GL={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"};jm._date.override({_id:"date-fns",formats:function(){return GL},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=At(e):n==="string"&&(typeof t=="string"?e=YM(e,t,new Date,this.options):e=Lp(e,this.options)),Hc(e)?e.getTime():null},format:function(e,t){return ya(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return zc(e,t);case"second":return UT(e,t);case"minute":return FT(e,t);case"hour":return LT(e,t);case"day":return ma(e,t);case"week":return HT(e,t);case"month":return Fc(e,t);case"quarter":return zT(e,t);case"year":return WT(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Wc(e,t);case"second":return XT(e,t);case"minute":return jT(e,t);case"hour":return qT(e,t);case"day":return hp(e,t);case"week":return ZT(e,t);case"month":return yp(e,t);case"quarter":return KT(e,t);case"year":return QT(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return KM(e);case"minute":return GM(e);case"hour":return jM(e);case"day":return Uc(e);case"week":return Vn(e);case"isoWeek":return Vn(e,{weekStartsOn:+n});case"month":return tk(e);case"quarter":return JT(e);case"year":return _p(e);default:return e}},endOf:function(e,t){switch(t){case"second":return ok(e);case"minute":return rk(e);case"hour":return nk(e);case"day":return mp(e);case"week":return ik(e);case"month":return gp(e);case"quarter":return sk(e);case"year":return ek(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}},KL={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...$y,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},XL=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 ZL(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return f.isProxy(t)?new Proxy(e,{}):e}function QL(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Vy(e,t){e.labels=t}function Yy(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 JL(e,t){const n={labels:[],datasets:[]};return Vy(n,e.labels),Yy(n,e.datasets,t),n}const tN=f.defineComponent({props:KL,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:_}=e,x=JL(h,_),v=ZL(x,h);s.value=new on(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,[_,x]=h;const v=f.toRaw(s.value);if(!v)return;let S=!1;if(m){const C=as(m),A=as(_);C&&C!==A&&(QL(v,C),S=!0)}if(g){const C=as(g.labels),A=as(x.labels),F=as(g.datasets),P=as(x.datasets);C!==A&&(Vy(v.config.data,C),S=!0),F&&F!==P&&(Yy(v.config.data,F,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 gl(e,t){return on.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(tN,XL({ref:l},{type:e,...n}))}})}const qy=gl("bar",$m),jy=gl("doughnut",ro),Gy=gl("line",Vm),eN=gl("scatter",qm),nN={class:"chart-container"},iN={key:0,class:"chart-center-metric"},rN={class:"chart-center-total"},sN={key:0,class:"chart-center-unit"},oN=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.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:d,tooltipAbsoluteTop:h}=St.useTooltipAbsolutePosition(l,u),m={id:r,afterUpdate(z){a.value=z.options.plugins.legend.labels.generateLabels(z).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},g=f.computed(()=>[m]),_=f.computed(()=>[t.chartData.datasets.reduce((k,w)=>(k.labels.push(w.label),k.backgroundColor.push(w.backgroundColor),k.hoverBorderColor.push(Aa(w.backgroundColor).saturate(.5).darken(.15).hexString()),k.data.push(w.data.reduce((O,L)=>O+L,0)),k),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=$n({i18n:i}),v=f.computed(()=>x2(t.metricName??"")),S=f.computed(()=>{const z=_.value[0]?.data.reduce((k,w)=>k+w,0)??0;return x(z,t.metricUnit,{approximate:!0,translateUnit:(k,w)=>n(k,w)}).trim()}),C=f.computed(()=>t.tooltipMetricDisplay||""),A=f.computed(()=>({...t.chartData,datasets:_.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:F}=St.useDonutChartOptions({tooltipState:u,legendID:r}),P=f.ref(),B=z=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[z],N=({width:z,height:k})=>{u.width=z,u.height=k};return(z,k)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",B(e.legendPosition)]),"data-testid":"donut-chart-parent"},[f.createElementVNode("div",nN,[f.createVNode(f.unref(jy),{ref_key:"chartInstance",ref:P,"chart-id":f.unref(s),data:A.value,options:f.unref(F),plugins:g.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&v.value?(f.openBlock(),f.createElementBlock("div",iN,[f.createElementVNode("span",rN,f.toDisplayString(S.value),1),C.value?(f.openBlock(),f.createElementBlock("span",sN,f.toDisplayString(C.value),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(Do,{"absolute-left":f.unref(d),"absolute-top":f.unref(h),state:u,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:N},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),f.createVNode(ml,{id:f.unref(r),"chart-instance":P.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),aN=Me(oN,[["__scopeId","data-v-ecbae072"]]);class lN{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 cN=1.5;class uN{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=cN;for(const{value:m,color:g,borderDash:_}of r){if(!Number.isFinite(m))continue;const x=s.getPixelForValue(m);x<a||x>l||(h.beginPath(),h.setLineDash(_),h.strokeStyle=g,h.moveTo(u,x),h.lineTo(d,x),h.stroke())}h.restore()}}const dN={class:"chart-container"},fN=Me(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:()=>ld()}},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 lN,u=new uN,d=crypto.randomUUID(),h=crypto.randomUUID(),m=f.ref(),g=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:_,tooltipAbsoluteTop:x}=St.useTooltipAbsolutePosition(a,g);St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const v=f.computed(()=>t.chartData?.outlier),S=f.computed(()=>t.chartData?.referenceLines??[]),C=f.ref([]),A={id:d,afterUpdate(O){C.value=$u(O,void 0,t.chartLegendSortFn)}},F=f.computed(()=>{const O=[];v.value&&O.push({text:v.value.label,fillStyle:v.value.color,strokeStyle:v.value.color,isKey:!0});for(const L of S.value)O.push({text:L.label,fillStyle:L.color,strokeStyle:L.color,lineDash:L.borderDash,isKey:!0,value:{raw:L.value,formatted:r(L.value,t.metricUnit,{translateUnit:s})}});return O}),P=f.computed(()=>[...C.value,...F.value]),B=f.computed(()=>t.shadeOutlierRegion?v.value?.value:void 0),N=f.computed(()=>[A,...B.value!==void 0?[l]:[],...S.value.length?[u]:[]]),z=f.computed(()=>`scatter-${N.value.map(O=>O.id).join("-")}`),{options:k}=St.useScatterChartOptions({tooltipState:g,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:B,referenceLines:S,themeColors:f.toRef(t,"themeColors")}),w=O=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[O];return(O,L)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",w(f.unref(n))]),"data-testid":"scatter-chart-parent"},[f.createElementVNode("div",dN,[(f.openBlock(),f.createBlock(f.unref(eN),{key:z.value,ref_key:"chartInstance",ref:m,"chart-id":f.unref(h),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:f.unref(k),plugins:N.value},null,8,["chart-id","data","options","plugins"]))]),f.createVNode(Do,{"absolute-left":f.unref(_),"absolute-top":f.unref(x),"data-testid":"tooltip",granularity:e.granularity,state:g,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),f.createVNode(ml,{id:f.unref(d),"chart-instance":m.value,"data-testid":"legend",items:P.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3bb682a5"]]),Md=(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()},Je={},hN=()=>{Je.x=void 0,Je.chart=void 0,Je.strategy=void 0,Je.group=void 0},pN=10;class Ky{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<pN)return;const r=()=>{Je.chart=n,Je.strategy=this._brushStrategy,Je.group=this._brushGroup;for(const s of Object.values(on.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(Je.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Je.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;Md(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;Md(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Je.x===void 0)return;const n=Je.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Je.group===this._brushGroup&&Md(t.ctx,Je.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&&Je.chart===t){const n=Je.x!==void 0;if(hN(),n)for(const i of Object.values(on.instances))i!==t&&i.update("none")}}}const mN=(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()},gN=(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()},Xy=(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)}},Zy=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class yN{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=Xy(t,this);d&&Zy("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=Xy(t,this);d?Zy("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)&&(gN(t,this._startX,this._endX),mN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const _N=20,bN="rgba(255, 171, 171, 0.4)",xN="rgba(255, 196, 0, 0.2)",Qy=(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)},Jy=e=>"yAxisID"in e&&e.yAxisID||rl,t_=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?Jy(n):rl},wN=(e,t,n=rl)=>{const i=[];return e.data.datasets.forEach(r=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(r)).visible||Jy(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=Qy(a[h-1],a[h],l.value):u[h-1].aboveThreshold&&!u[h].aboveThreshold&&d!==void 0&&(i.push({start:d,end:Qy(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},vN=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 SN{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[t_(t,d)]??t.scales.y).getValueForPixel(l-u.top);if(m){const g=this._thresholds?.[d];g&&g.forEach(_=>{_.hovered=Math.abs(_.value-m)<_N})}}}};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=t_(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=ju(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=ju(h.type),i.font=hS,i.fillText(g,t.chartArea.left,m-4),i.restore())});const u=wN(t,s,a);vN(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"?bN:xN,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=ju(h.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const TN=Me(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 Ky,a=new Hy,l=new yN,u=new SN(r),{translateUnit:d}=St.useTranslatedUnits(),h=f.ref(),m=crypto.randomUUID(),g=crypto.randomUUID(),_=f.ref([]),x=f.inject("legendPosition",Le.Bottom),v=f.useTemplateRef("chartParent"),S=f.ref(void 0),C=f.ref(!1),A=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:F,tooltipAbsoluteTop:P}=St.useTooltipAbsolutePosition(v,A),B={id:m,afterUpdate(V){_.value=$u(V,n.legendValues,n.chartLegendSortFn)}},N=f.computed(()=>[B,a,...n.brush?[l]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[u]:[]]),z=f.computed(()=>`line-${N.value.map(V=>V.id).join("-")}`),k=f.computed(()=>`bar-${N.value.map(V=>V.id).join("-")}`),w=f.computed(()=>n.chartData&&TP(n.chartData)),{options:O}=St.useLineChartOptions({tooltipState:A,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:w,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 L=V=>V?V.end.getTime()>V.start.getTime():!1,$=V=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[V],q=({width:V,height:I})=>{A.width=V,A.height=I},st=(V=!0)=>{A.interactionMode="idle",A.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(V),s.isPaused&&s.resume()},ct=()=>{A.interactionMode="interactive"},ht=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(A.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(C.value){C.value=!1;return}A.interactionMode!=="idle"?st():ct(),ht()};f.watch(()=>n.type,()=>{A.interactionMode="idle",A.showTooltip=!1,s.destroyClickedSegment()});const vt=V=>{V.preventDefault(),V.stopPropagation();const{xStart:I,xEnd:W}=V.detail,nt={start:new Date(I),end:new Date(W),type:"absolute"};if(!L(nt)){S.value=void 0,st(!1);return}S.value=nt,A.interactionMode="zoom-interactive",nt&&i("select-chart-range",nt)},at=V=>{A.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:I,xEnd:W}=V.detail;S.value={start:new Date(I),end:new Date(W),type:"absolute"}},dt=V=>{if(!v.value||A.interactionMode==="idle")return;const I=V.target;I&&v.value.contains(I)||C.value||st(!1)};return f.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",vt),h.value.chart.canvas.removeEventListener("dragSelectMove",at),h.value.chart.canvas.addEventListener("dragSelect",vt),h.value.chart.canvas.addEventListener("dragSelectMove",at))}),f.onMounted(()=>{document.addEventListener("click",dt,!0)}),f.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",vt),h.value.chart.canvas.removeEventListener("dragSelectMove",at)),document.removeEventListener("click",dt,!0)}),(V,I)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",$(f.unref(x))]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:I[0]||(I[0]=W=>ut())},[e.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(Gy),{key:z.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(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(qy),{key:k.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(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),f.createVNode(Do,{"absolute-left":f.unref(F),"absolute-top":f.unref(P),"data-testid":"tooltip",granularity:e.granularity,state:A,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:q,onOnAction:I[1]||(I[1]=()=>st(!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:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-28d026be"]]),kN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},MN={class:"tooltip-content"},DN={key:2,class:"analytics-chart-parent"},CN=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(()=>cd(i.chartData)?void 0:i.chartData),a=f.computed(()=>{const G=i.chartOptions.metricAxisMap,it=s.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!G||!it.some(lt=>G[lt]==="right")))return G}),l=f.computed(()=>!!a.value),u=(G,it)=>a.value?G.filter(lt=>(a.value?.[lt]??"left")===it):G,d=f.computed(()=>{const G=s.value?.meta,it=G?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!l.value&&it.length>1&&Object.keys(G?.display??{}).length>0?it:[]}),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 G=s.value;return!G||!h.value||!m.value?G:{...G,meta:{...G.meta,metric_names:[m.value]}}}),_=f.computed(()=>{const G=i.chartOptions.threshold;return!h.value||!G?G:{...G,...Object.fromEntries(Object.keys(G).filter(it=>it!==m.value).map(it=>[it,[]]))}}),x=f.computed(()=>{if(ht.value)return cd(i.chartData)?i.chartData:V0(i.chartData)}),v=f.inject("app:konnectColorMode",f.computed(()=>"light")),S=f.useTemplateRef("chartShell"),C=f.computed(()=>(v.value,ld(S.value))),A=f.computed(()=>{if(x.value){const{start:it,end:lt,metric:$t,metricUnit:_t,truncated:Vt,limit:Te,datasource:ke}=x.value;return{start:it,end:lt,metricNames:[$t],metricUnits:{[$t]:_t??""},truncated:Vt,limit:Te,datasource:ke}}const G=g.value?.meta;return{start:G?.start,end:G?.end,metricNames:G?.metric_names,metricUnits:G?.metric_units,truncated:G?.truncated,limit:G?.limit,datasource:G?.datasource}}),F=f.computed(()=>ht.value?St.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:C},x).value:s.value?st.value?St.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ku,metricAxisMap:a.value},g).value:St.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ku},s).value:{datasets:[]}),P=f.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),B=f.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:it}=A.value;if(G&&it)return new Date(it).getTime()-new Date(G).getTime()}),N=f.computed(()=>A.value.metricUnits?h.value&&m.value?A.value.metricUnits[m.value]??"":Object.values(A.value.metricUnits)[0]??"":""),z=f.computed(()=>A.value.metricUnits?h.value&&m.value?m.value:Object.keys(A.value.metricUnits)[0]??"":""),k=f.computed(()=>i.showLegendValues&&i.legendPosition!==Le.Hidden),{legendValues:w}=St.useChartLegendValues(F,i.chartOptions.type,N),O=f.computed(()=>A.value.limit?.toString()||null),L=f.computed(()=>i.chartOptions.hideTruncationWarning?!1:A.value.truncated||!1),$=f.computed(()=>r.t("limitedResultsShown",{maxReturned:O.value})),q=f.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),st=f.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),ct=f.computed(()=>i.chartOptions.type==="donut"),ht=f.computed(()=>i.chartOptions.type==="scatter"),ut=f.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),vt=f.computed(()=>{const{metricNames:G,metricUnits:it}=A.value;if(l.value||!G||!it)return;const lt=G[0],$t=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})})}if(lt)return xo($t)&&r.te(`metricAxisTitles.${lt}`)?r.t(`metricAxisTitles.${lt}`)||void 0:r.te(`chartLabels.${lt}`)?r.t(`chartLabels.${lt}`):lt}),at=f.computed(()=>{const G=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(G)return G;const{metricNames:it,metricUnits:lt}=A.value;if(!(!it||!lt))return V(u(it,"left"),lt)}),dt=f.computed(()=>{if(!l.value)return;const{metricNames:G,metricUnits:it}=A.value,lt=G&&it?V(u(G,"right"),it):void 0;return{title:i.chartOptions.yAxes?.right?.title??lt,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),V=(G,it)=>{const lt=G[0];if(!lt)return;const $t=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})})}return I(lt,$t)},I=(G,it)=>{if(r.te(`metricAxisTitles.${G}`)){if(xo(it))return r.t(`metricAxisTitles.${G}`)||void 0;const lt=r.te(`chartUnits.${it}`)?r.t(`chartUnits.${it}`,{plural:"s"}):it;return r.t(`metricAxisTitles.${G}`,{unit:lt})||void 0}return G||void 0},W=f.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,it=st.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if(it)return r.te(`chartLabels.${it}`)?r.t(`chartLabels.${it}`):it}),nt=f.computed(()=>{if(Mx(A.value.datasource))return r.t("timestampAxisTitles.platform");const G=ca(s.value?.meta?.granularity_ms);if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),ot=f.computed(()=>{const G=x.value?.xMetric;return G?I(G,x.value?.xMetricUnit??""):nt.value}),X=f.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),tt=f.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),rt=f.computed(()=>ht.value?!!x.value?.points.length:st.value?kP(F.value):!!(s.value&&s.value.meta&&s.value.data.length)),pt=f.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?ca(G.meta.granularity_ms)||"hourly":ca(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),yt=f.computed(()=>ca(s.value?.meta?.granularity_ms)||"secondly"),mt=f.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,it)=>G.text===r.t("chartLabels.____OTHER____")?1:it.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt(it.text,10))?G.text<it.text?-1:1:G.value&&it.value?it.value.raw-G.value.raw:0),Et=f.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,it)=>G.label===r.t("chartLabels.____OTHER____")?1:it.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt(it.label,10))?G.label<it.label?-1:1:G.value&&it.value?it.rawValue-G.rawValue:0),zt=f.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>n("zoom-time-range",G)}]:[],...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",k),f.provide("legendPosition",f.toRef(i,"legendPosition")),(G,it)=>{const lt=f.resolveComponent("KTooltip"),$t=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{ref:"chartShell",class:f.normalizeClass(["analytics-chart-shell",{"show-values":k.value}])},[rt.value&&L.value&&O.value?(f.openBlock(),f.createElementBlock("div",kN,[f.createVNode(lt,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createElementVNode("div",MN,f.toDisplayString($.value),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(fe.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(dS)})`,size:`var(--kui-icon-size-40, ${f.unref(pS)})`},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),rt.value?(f.openBlock(),f.createElementBlock("div",DN,[st.value?(f.openBlock(),f.createBlock(TN,{key:0,brush:P.value,"chart-data":F.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Et.value,"dimension-axes-title":nt.value,fill:e.chartOptions.stacked,granularity:pt.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":N.value,"right-y-axis":dt.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:_.value,"time-range-ms":B.value,"tooltip-metric-display":vt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":zt.value,onSelectChartRange:it[0]||(it[0]=_t=>n("select-chart-range",_t)),onZoomTimeRange:it[1]||(it[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"])):q.value?(f.openBlock(),f.createBlock(jL,{key:1,annotations:e.showAnnotations,"chart-data":F.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Et.value,"data-testid":"bar-chart-container","dimension-axes-title":W.value,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":N.value,orientation:ut.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":vt.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"])):ct.value?(f.openBlock(),f.createBlock(aN,{key:2,"chart-data":F.value,"dataset-colors":e.chartOptions.chartDatasetColors||f.unref(Ku),"legend-position":e.legendPosition,"legend-values":f.unref(w),"metric-name":z.value,"metric-unit":N.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":W.value,"tooltip-metric-display":vt.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"])):ht.value?(f.openBlock(),f.createBlock(fN,{key:3,"chart-data":F.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":Et.value,"data-testid":"scatter-chart-container","dimension-axes-title":ot.value,granularity:yt.value,"metric-axes-title":at.value,"metric-unit":N.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":C.value,"time-range-ms":B.value,"tooltip-metric-display":vt.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($t,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(X.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(tt.value),1)]),_:1}))],2)}}}),ON=Me(CN,[["__scopeId","data-v-c5c250ba"]]),AN={class:"chart-parent","data-testid":"gauge-chart-parent"},EN={class:"chart-totals-flex"},RN={key:1,class:"metric-small","data-testid":"gauge-chart-total"},PN=Me(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(kd()),r=f.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((v,S)=>v+S,0)),_),{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,_)=>(f.openBlock(),f.createElementBlock("div",AN,[f.createElementVNode("div",EN,[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",RN,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(jy),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),IN={key:1,class:"single-value-wrapper"},LN={class:"single-value-metric"},NN={class:"name-unit-alignment"},BN={class:"single-value","data-testid":"single-value-chart"},FN={key:0,class:"single-value-unit"},zN={class:"single-value-metric-name"},UN={key:0,class:"single-value-trend"},HN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},Dd="t1",Cd="t2",WN=Me(f.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:f0},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:Dd,secondLevelKey:Cd})),l=f.computed(()=>a.value?.previous?.[Dd]?.[Cd]),u=f.computed(()=>a.value?.current?.[Dd]?.[Cd]),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 O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const L=`chartUnits.${O}`;return t.te(L)?t.t(L,{plural:""}):""}}),_=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 O=d.value[0].event[h.value];return typeof O!="number"||isNaN(O)?null:O}),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),C=f.computed(()=>{const O=v.value;if(O===null)return"-";const L=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(L==="usd")return i(O);if(L==="bytes")return n(O);if(O>=1e9){const q=(O/1e9).toFixed(1);return q.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${q}B`}if(O>=1e7){const q=(O/1e6).toFixed(1);return q.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${q}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:f0;return O.toLocaleString("en-US",{maximumFractionDigits:$})}),A=f.computed(()=>r.showTrend&&r.data?.data?.length<2),F=f.computed(()=>er.calculateChange(v.value??0,x.value??0)||0),P=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(F.value,!0,r.increaseIsBad)}),B=f.computed(()=>er.defineIcon(P.value,r.increaseIsBad)),N=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(F.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),z=er.useTrendRange(f.computed(()=>r.showTrend),void 0,f.computed(()=>r.data.meta)),k=O=>O>0?"positive":O<0?"negative":"neutral",w=O=>O>0?uS:O<0?cS:lp;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)}),(O,L)=>{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",IN,[f.createElementVNode("div",LN,[f.createElementVNode("div",NN,[f.createElementVNode("span",BN,f.toDisplayString(C.value),1),_.value&&g.value?(f.openBlock(),f.createElementBlock("span",FN," "+f.toDisplayString(g.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",zN,f.toDisplayString(m.value),1)]),e.showTrend?(f.openBlock(),f.createElementBlock("div",UN,[f.createElementVNode("div",{class:f.normalizeClass(["trend-change",k(P.value)]),"data-testid":"single-value-trend"},[A.value||P.value!==0?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(B.value),{key:0,color:w(P.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(lp)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])),f.createElementVNode("div",null,f.toDisplayString(N.value),1)],2),f.unref(z)?(f.openBlock(),f.createElementBlock("div",HN,f.toDisplayString(f.unref(z)),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),$N={class:"simple-chart-shell"},VN={key:1,class:"analytics-chart-parent"},YN=Me(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",$N,[u.value?(f.openBlock(),f.createElementBlock("div",VN,[s.value?(f.openBlock(),f.createBlock(PN,{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(WN,{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"]]),qN={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}},jN=(e,t)=>{if(!(!e||!t))return qN[e]?.[t.toLowerCase()]},GN=["data-threshold"],KN=Me(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,GN))}}),[["__scopeId","data-v-24eb60ef"]]),XN=["data-threshold"],ZN={class:"top-n-metric-cell-value"},QN={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},JN=Me(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",ZN,f.toDisplayString(e.display),1),e.relative?(f.openBlock(),f.createElementBlock("span",QN,"("+f.toDisplayString(e.relative)+")",1)):f.createCommentVNode("",!0)],10,XN))}}),[["__scopeId","data-v-17e7f860"]]),tB={class:"top-n-card-title","data-testid":"top-n-card-title"},eB={class:"top-n-card-description","data-testid":"top-n-card-description"},nB={key:3,class:"top-n-table","data-testid":"top-n-table"},iB={"data-testid":"top-n-table-header"},rB={class:"top-n-table-header-row"},sB=["colspan"],oB={class:"table-header-label"},aB=["data-testid"],lB={class:"top-n-table-cell-label"},cB={key:0,class:"top-n-table-cell top-n-table-cell-bar"},uB=3,dB=Me(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,uB):[]),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]),_=f.computed(()=>g.value?dt(g.value):""),x=f.computed(()=>{const I=a.value.map(W=>({key:W,columnKey:W,label:ut(W,u.value?dt(W):n.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&I.push({key:"value",columnKey:g.value,label:ut(g.value,_.value),type:"metric"}),m.value.forEach((W,nt)=>{nt!==0&&I.push({key:W,columnKey:W,label:ut(W,dt(W)),type:"metric"})}),I}),v=f.computed(()=>x.value.filter(I=>I.type==="metric")),S=f.computed(()=>x.value.filter(I=>I.type==="dimension").slice(1)),C=I=>I.type==="dimension"&&I.key===d.value,A=I=>I.type==="metric"&&!!gr(t.columnOptions,I.columnKey)?.bar,F=I=>u.value&&I.type==="dimension"&&!C(I),P=I=>{const W=I.event;return String(W[l.value])},B=(I,W)=>{const nt=String(I.event[W]),ot=t.data.meta?.display?.[W]?.[nt];return{dimension:W,id:nt,name:ot?.name||"-",deleted:!!ot?.deleted}},N=I=>{const W=P(I),nt=h.value&&h.value[W];return nt?nt.name:"-"},z=I=>{const W=P(I),nt=h.value&&h.value[W];return nt?!!nt.deleted:!1},k=I=>{const W=nt=>i(nt,"%",{translateUnit:ot=>V(ot,nt)});return I>0&&I<.01?`< ${W(.01)}`:W(I)},w=(I,W)=>{const nt=I.event[W];if(nt==null)return"–";const ot=typeof nt=="number"?nt:Number(nt);if(Number.isNaN(ot))return"–";const X=t.data.meta?.metric_units?.[W]||"count";if(X==="%")return k(ot);const tt=["count","count/minute","token count"].includes(X);return i(ot,X,{approximate:tt,isBytes1024:!0,translateUnit:rt=>V(rt,ot)})},O=f.computed(()=>Object.fromEntries(m.value.map(I=>[I,zu(r.value.map(W=>Jr(W.event[I])))]))),L=(I,W)=>{const nt=gr(t.columnOptions,W),ot=Jr(I.event[W]);if(!nt||ot===null)return{display:w(I,W)};const X=O.value[W],tt=nt.value==="relative"?Uu(ot,X):null;return{display:w(I,W),relative:tt===null?void 0:k(tt*100),barRatio:nt.bar?y0(ot,X,nt.bar):void 0,threshold:Hu(ot,nt.thresholds)}},$=f.computed(()=>r.value?.length?r.value.map(I=>{const W=a.value.map(tt=>B(I,tt)),nt=W[0],ot=nt?.id||P(I),X={id:ot,rowKey:W.map(tt=>`${tt.dimension}:${tt.id}`).join("|")||ot,name:nt?.name||N(I),deleted:z(I),dimensions:W,metrics:{},original:I};return m.value.forEach((tt,rt)=>{X.metrics[rt===0?"value":tt]=L(I,tt)}),X}):[]),q=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(I=>!Object.keys(t.data.meta.display[I]||{}).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=(I,W)=>I.metrics[W]??{display:"–"},ct=(I,W)=>I.dimensions.find(nt=>nt.dimension===W)?.id||"",ht=(I,W)=>jN(gr(t.columnOptions,I)?.icon_set,W),ut=(I,W)=>I&&gr(t.columnOptions,I)?.label||W,vt=(I,W)=>I.dimensions.find(nt=>nt.dimension===W)?.name||"–",at=(I,W)=>{const nt=I.dimensions.find(ot=>ot.dimension===W);return{id:nt?.id||"",name:nt?.name||"–",deleted:nt?.deleted||!1,dimension:W,dimensions:I.dimensions,isEmpty:nt?.id==="empty"}},dt=I=>n.te(`chartLabels.${I}`)?n.t(`chartLabels.${I}`):I,V=(I,W)=>{if(xo(I)||I==="count"||I==="requests")return"";const nt=W===1?"":"s";return n.te(`chartUnits.${I}`)?n.t(`chartUnits.${I}`,{plural:nt}):I};return(I,W)=>{const nt=f.resolveComponent("KEmptyState"),ot=f.resolveComponent("KSkeleton"),X=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(X,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[q.value?(f.openBlock(),f.createBlock(nt,{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(q.value),1)]),_:1})):e.isLoading?(f.openBlock(),f.createBlock(ot,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",nB,[f.createElementVNode("table",{class:f.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[f.createElementVNode("thead",iB,[f.createElementVNode("tr",rB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,tt=>(f.openBlock(),f.createElementBlock("th",{key:tt.key,class:f.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":tt.type==="metric","top-n-table-header-cell-dimension-compact":F(tt)}]),colspan:A(tt)?2:void 0,"data-testid":"top-n-table-header-column"},[f.createElementVNode("span",oB,f.toDisplayString(tt.label),1),W[0]||(W[0]=f.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,sB))),128))])]),f.createElementVNode("tbody",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($.value,tt=>(f.openBlock(),f.createElementBlock("tr",{key:tt.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-${tt.id}`},[ht(l.value,tt.id)?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ht(l.value,tt.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(I.$slots,"name",{record:{id:tt.id,name:tt.name,deleted:tt.deleted,dimension:l.value,dimensions:tt.dimensions,isEmpty:tt.id==="empty"}},()=>[f.createTextVNode(f.toDisplayString(tt.name),1)],!0)],8,aB)],2)):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(S.value,rt=>(f.openBlock(),f.createElementBlock("td",{key:rt.key,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(rt)}])},[f.createElementVNode("span",lB,[ht(rt.key,ct(tt,rt.key))?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ht(rt.key,ct(tt,rt.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(I.$slots,"name",{record:at(tt,rt.key)},()=>[f.createTextVNode(f.toDisplayString(vt(tt,rt.key)),1)],!0)])],2))),128)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(v.value,rt=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:rt.key},[f.createElementVNode("td",{class:f.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":A(rt)}])},[f.createVNode(JN,{"data-testid":rt.key==="value"?`row-${tt.id}`:`row-${tt.id}-${rt.key}`,display:st(tt,rt.key).display,"has-bar":A(rt),relative:st(tt,rt.key).relative,threshold:st(tt,rt.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),A(rt)?(f.openBlock(),f.createElementBlock("td",cB,[f.createVNode(KN,{ratio:st(tt,rt.key).barRatio??0,threshold:st(tt,rt.key).threshold},null,8,["ratio","threshold"])])):f.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(f.openBlock(),f.createBlock(nt,{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",tB,f.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",eB,f.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]),fB={class:"container"},hB={key:0,class:"no-data","data-testid":"sparkline-empty"},pB=["title"],mB=Me(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:z,height:k})=>{h.width=z,h.height=k},g=f.computed(()=>e.disableTooltip?[]:[new Ky({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),_=f.computed(()=>d.value.reduce((z,{data:k,label:w})=>({...z,[w]:k.reduce((O,{y:L})=>O+L,0)}),{})),x=f.computed(()=>d.value.map(({label:z})=>[_.value[z],`${z}: ${_.value[z]}`]).sort(([z],[k])=>k-z).map(([,z])=>z).join(", ")),v=f.computed(()=>Object.keys(_.value).map(z=>_.value[z]).reduce((z,k)=>z+k,0)),S=f.computed(()=>v.value>0),C=f.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=f.computed(()=>e.datasets.length>1),F=`SparklineTooltipPosition-${t}`,P=f.computed(()=>{const z=e.type==="sparkline_bar",k=z?r.value-1:r.value,w=z?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:z?0:2,right:z?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:F,external:O=>{Wu(h,O,"minutely",{contextFormatter:L=>{const $=L+i.value;let q="";return i.value>1440*60*1e3?q=ya(new Date($),"MMM dd, yyy hh:mm a"):q=ya(new Date($),"hh:mm a"),`${yv(L)} - ${q}`}})}}},scales:{x:{min:k,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}}}}),B=f.ref("0"),N=f.ref("0");return f.onMounted(()=>{qe.positioners[F]=function(z,k){if(!z.length||h.interactionMode==="interactive"||k.x===null)return!1;const w=10,O=this.chart.canvas.getBoundingClientRect(),L=h.width||this.width,$=h.height||this.height,q=O.top-$>0,st=q?O.top-$-w:O.top+O.height+w,ct=O.left>L/2-k.x,ht=Math.max(w,window.innerWidth-w-L),ut=Math.min(ht,ct?Math.floor(O.left-L/2)+k.x:0+w);return B.value=`${st}px`,N.value=`${ut}px`,{x:ut,y:st,xAlign:"center",yAlign:q?"top":"bottom"}}}),f.onUnmounted(()=>{qe.positioners[F]&&delete qe.positioners[F]}),(z,k)=>(f.openBlock(),f.createElementBlock("div",fB,[S.value?e.type==="sparkline_bar"?(f.openBlock(),f.createBlock(f.unref(qy),{key:1,"chart-id":f.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.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(Gy),{key:2,"chart-id":f.unref(t),data:C.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",hB,[f.renderSlot(z.$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":N.value,"absolute-top":B.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:z.$slots.label?"":x.value},[f.renderSlot(z.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[f.createTextVNode(f.toDisplayString(x.value),1)],!0)],8,pB)):f.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),gB=["data-value"],yB=["title"],_B={class:"top-talkers-cell-metric"},bB={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},xB={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},wB={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},vB={class:"top-talkers-tooltip-title"},SB={class:"top-talkers-tooltip-rows"},TB={class:"top-talkers-tooltip-label"},kB=["data-threshold"],MB=Me(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",wB,[f.createElementVNode("div",vB,f.toDisplayString(e.cell.name),1),f.createElementVNode("dl",SB,[(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",TB,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,kB)],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,yB),f.createElementVNode("span",_B,[f.createElementVNode("span",bB,f.toDisplayString(e.cell.display),1),e.cell.relative?(f.openBlock(),f.createElementBlock("span",xB,"("+f.toDisplayString(e.cell.relative)+")",1)):f.createCommentVNode("",!0)])],10,gB)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),DB=["data-dimension"],CB={class:"top-talkers-column-header"},OB={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},AB={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},EB={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},RB={key:2,class:"top-talkers-column-cells"},e_=Me(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",CB,[f.createElementVNode("span",OB,f.toDisplayString(i.value),1),!e.isLoading&&f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("span",AB,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",RB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(n).cells,l=>(f.openBlock(),f.createBlock(MB,{key:l.id,cell:l},null,8,["cell"]))),128))])):(f.openBlock(),f.createElementBlock("div",EB,f.toDisplayString(f.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,DB))}}),[["__scopeId","data-v-e1b08041"]]),PB={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},IB={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},LB=Me(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",IB,[(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(e_,{"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",PB,f.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]);var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={exports:{}};var NB=Co.exports,n_;function BB(){return n_||(n_=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,_=2,x=4,v=1,S=2,C=1,A=2,F=4,P=8,B=16,N=32,z=64,k=128,w=256,O=512,L=30,$="...",q=800,st=16,ct=1,ht=2,ut=3,vt=1/0,at=9007199254740991,dt=17976931348623157e292,V=NaN,I=4294967295,W=I-1,nt=I>>>1,ot=[["ary",k],["bind",C],["bindKey",A],["curry",P],["curryRight",B],["flip",O],["partial",N],["partialRight",z],["rearg",w]],X="[object Arguments]",tt="[object Array]",rt="[object AsyncFunction]",pt="[object Boolean]",yt="[object Date]",mt="[object DOMException]",Et="[object Error]",zt="[object Function]",G="[object GeneratorFunction]",it="[object Map]",lt="[object Number]",$t="[object Null]",_t="[object Object]",Vt="[object Promise]",Te="[object Proxy]",ke="[object RegExp]",ae="[object Set]",cn="[object String]",qt="[object Symbol]",Be="[object Undefined]",re="[object WeakMap]",De="[object WeakSet]",Pe="[object ArrayBuffer]",gn="[object DataView]",Wi="[object Float32Array]",Cn="[object Float64Array]",je="[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,bl=/[&<>"']/g,Od=RegExp($i.source),Ad=RegExp(bl.source),Ed=/<%-([\s\S]+?)%>/g,Rd=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,xl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,Pd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lo=/[\\^$.*+?()[\]{}|]/g,Id=RegExp(Lo.source),No=/^\s+/,Ld=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nd=/\{\n\/\* \[wrapped with (.+)\] \*/,Bd=/,? & /,Fd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wl=/[()=,{}\[\]\/\s]/,zd=/\\(\\)?/g,Vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vl=/\w*$/,Ud=/^[-+]0x[0-9a-f]+$/i,Hd=/^0b[01]+$/i,Wd=/^\[object .+?Constructor\]$/,$d=/^0o[0-7]+$/i,Yi=/^(?:0|[1-9]\d*)$/,Vd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ls=/($^)/,Yd=/['\n\r\u2028\u2029\\]/g,cs="\\ud800-\\udfff",qd="\\u0300-\\u036f",jd="\\ufe20-\\ufe2f",Sl="\\u20d0-\\u20ff",kr=qd+jd+Sl,Tl="\\u2700-\\u27bf",us="a-z\\xdf-\\xf6\\xf8-\\xff",Gd="\\xac\\xb1\\xd7\\xf7",Kd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xd="\\u2000-\\u206f",Zd=" \\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",kl="A-Z\\xc0-\\xd6\\xd8-\\xde",Ml="\\ufe0e\\ufe0f",ds=Gd+Kd+Xd+Zd,Bo="['’]",Qd="["+cs+"]",Dl="["+ds+"]",fs="["+kr+"]",Cl="\\d+",Jd="["+Tl+"]",Ol="["+us+"]",Fo="[^"+cs+ds+Cl+Tl+us+kl+"]",zo="\\ud83c[\\udffb-\\udfff]",tf="(?:"+fs+"|"+zo+")",Mr="[^"+cs+"]",Zn="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+kl+"]",Al="\\u200d",El="(?:"+Ol+"|"+Fo+")",ef="(?:"+un+"|"+Fo+")",Rl="(?:"+Bo+"(?:d|ll|m|re|s|t|ve))?",Pl="(?:"+Bo+"(?:D|LL|M|RE|S|T|VE))?",Il=tf+"?",Uo="["+Ml+"]?",pi="(?:"+Al+"(?:"+[Mr,Zn,hs].join("|")+")"+Uo+Il+")*",nf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ll="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nl=Uo+Il+pi,Ho="(?:"+[Jd,Zn,hs].join("|")+")"+Nl,Bl="(?:"+[Mr+fs+"?",fs,Zn,hs,Qd].join("|")+")",rf=RegExp(Bo,"g"),sf=RegExp(fs,"g"),ps=RegExp(zo+"(?="+zo+")|"+Bl+Nl,"g"),of=RegExp([un+"?"+Ol+"+"+Rl+"(?="+[Dl,un,"$"].join("|")+")",ef+"+"+Pl+"(?="+[Dl,un+El,"$"].join("|")+")",un+"?"+El+"+"+Rl,un+"+"+Pl,Ll,nf,Cl,Ho].join("|"),"g"),ms=RegExp("["+Al+cs+kr+Ml+"]"),af=/[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"],lf=-1,ne={};ne[Wi]=ne[Cn]=ne[je]=ne[Ln]=ne[di]=ne[Oo]=ne[Ao]=ne[Tr]=ne[fi]=!0,ne[X]=ne[tt]=ne[Pe]=ne[pt]=ne[gn]=ne[yt]=ne[Et]=ne[zt]=ne[it]=ne[lt]=ne[_t]=ne[ke]=ne[ae]=ne[cn]=ne[re]=!1;var D={};D[X]=D[tt]=D[Pe]=D[gn]=D[pt]=D[yt]=D[Wi]=D[Cn]=D[je]=D[Ln]=D[di]=D[it]=D[lt]=D[_t]=D[ke]=D[ae]=D[cn]=D[qt]=D[Oo]=D[Ao]=D[Tr]=D[fi]=!0,D[Et]=D[zt]=D[re]=!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"},J={"&":"&","<":"<",">":">",'"':""","'":"'"},xt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,Bn=parseInt,Fe=typeof Hi=="object"&&Hi&&Hi.Object===Object&&Hi,Fl=typeof self=="object"&&self&&self.Object===Object&&self,ue=Fe||Fl||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 U=Qn&&Qn.require&&Qn.require("util").types;return U||Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),a_=ze&&ze.isArrayBuffer,l_=ze&&ze.isDate,c_=ze&&ze.isMap,u_=ze&&ze.isRegExp,d_=ze&&ze.isSet,f_=ze&&ze.isTypedArray;function yn(U,K,j){switch(j.length){case 0:return U.call(K);case 1:return U.call(K,j[0]);case 2:return U.call(K,j[0],j[1]);case 3:return U.call(K,j[0],j[1],j[2])}return U.apply(K,j)}function ZB(U,K,j,gt){for(var Ot=-1,jt=U==null?0:U.length;++Ot<jt;){var Oe=U[Ot];K(gt,Oe,j(Oe),U)}return gt}function _n(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt&&K(U[j],j,U)!==!1;);return U}function QB(U,K){for(var j=U==null?0:U.length;j--&&K(U[j],j,U)!==!1;);return U}function h_(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt;)if(!K(U[j],j,U))return!1;return!0}function qi(U,K){for(var j=-1,gt=U==null?0:U.length,Ot=0,jt=[];++j<gt;){var Oe=U[j];K(Oe,j,U)&&(jt[Ot++]=Oe)}return jt}function zl(U,K){var j=U==null?0:U.length;return!!j&&ys(U,K,0)>-1}function cf(U,K,j){for(var gt=-1,Ot=U==null?0:U.length;++gt<Ot;)if(j(K,U[gt]))return!0;return!1}function de(U,K){for(var j=-1,gt=U==null?0:U.length,Ot=Array(gt);++j<gt;)Ot[j]=K(U[j],j,U);return Ot}function ji(U,K){for(var j=-1,gt=K.length,Ot=U.length;++j<gt;)U[Ot+j]=K[j];return U}function uf(U,K,j,gt){var Ot=-1,jt=U==null?0:U.length;for(gt&&jt&&(j=U[++Ot]);++Ot<jt;)j=K(j,U[Ot],Ot,U);return j}function JB(U,K,j,gt){var Ot=U==null?0:U.length;for(gt&&Ot&&(j=U[--Ot]);Ot--;)j=K(j,U[Ot],Ot,U);return j}function df(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt;)if(K(U[j],j,U))return!0;return!1}var tF=ff("length");function eF(U){return U.split("")}function nF(U){return U.match(Fd)||[]}function p_(U,K,j){var gt;return j(U,function(Ot,jt,Oe){if(K(Ot,jt,Oe))return gt=jt,!1}),gt}function Ul(U,K,j,gt){for(var Ot=U.length,jt=j+(gt?1:-1);gt?jt--:++jt<Ot;)if(K(U[jt],jt,U))return jt;return-1}function ys(U,K,j){return K===K?pF(U,K,j):Ul(U,m_,j)}function iF(U,K,j,gt){for(var Ot=j-1,jt=U.length;++Ot<jt;)if(gt(U[Ot],K))return Ot;return-1}function m_(U){return U!==U}function g_(U,K){var j=U==null?0:U.length;return j?pf(U,K)/j:V}function ff(U){return function(K){return K==null?n:K[U]}}function hf(U){return function(K){return U==null?n:U[K]}}function y_(U,K,j,gt,Ot){return Ot(U,function(jt,Oe,ie){j=gt?(gt=!1,jt):K(j,jt,Oe,ie)}),j}function rF(U,K){var j=U.length;for(U.sort(K);j--;)U[j]=U[j].value;return U}function pf(U,K){for(var j,gt=-1,Ot=U.length;++gt<Ot;){var jt=K(U[gt]);jt!==n&&(j=j===n?jt:j+jt)}return j}function mf(U,K){for(var j=-1,gt=Array(U);++j<U;)gt[j]=K(j);return gt}function sF(U,K){return de(K,function(j){return[j,U[j]]})}function __(U){return U&&U.slice(0,v_(U)+1).replace(No,"")}function bn(U){return function(K){return U(K)}}function gf(U,K){return de(K,function(j){return U[j]})}function Vo(U,K){return U.has(K)}function b_(U,K){for(var j=-1,gt=U.length;++j<gt&&ys(K,U[j],0)>-1;);return j}function x_(U,K){for(var j=U.length;j--&&ys(K,U[j],0)>-1;);return j}function oF(U,K){for(var j=U.length,gt=0;j--;)U[j]===K&&++gt;return gt}var aF=hf(Y),lF=hf(J);function cF(U){return"\\"+Ce[U]}function uF(U,K){return U==null?n:U[K]}function _s(U){return ms.test(U)}function dF(U){return af.test(U)}function fF(U){for(var K,j=[];!(K=U.next()).done;)j.push(K.value);return j}function yf(U){var K=-1,j=Array(U.size);return U.forEach(function(gt,Ot){j[++K]=[Ot,gt]}),j}function w_(U,K){return function(j){return U(K(j))}}function Gi(U,K){for(var j=-1,gt=U.length,Ot=0,jt=[];++j<gt;){var Oe=U[j];(Oe===K||Oe===m)&&(U[j]=m,jt[Ot++]=j)}return jt}function Hl(U){var K=-1,j=Array(U.size);return U.forEach(function(gt){j[++K]=gt}),j}function hF(U){var K=-1,j=Array(U.size);return U.forEach(function(gt){j[++K]=[gt,gt]}),j}function pF(U,K,j){for(var gt=j-1,Ot=U.length;++gt<Ot;)if(U[gt]===K)return gt;return-1}function mF(U,K,j){for(var gt=j+1;gt--;)if(U[gt]===K)return gt;return gt}function bs(U){return _s(U)?yF(U):tF(U)}function Fn(U){return _s(U)?_F(U):eF(U)}function v_(U){for(var K=U.length;K--&&Ld.test(U.charAt(K)););return K}var gF=hf(xt);function yF(U){for(var K=ps.lastIndex=0;ps.test(U);)++K;return K}function _F(U){return U.match(ps)||[]}function bF(U){return U.match(of)||[]}var xF=(function U(K){K=K==null?ue:xs.defaults(ue.Object(),K,xs.pick(ue,Wo));var j=K.Array,gt=K.Date,Ot=K.Error,jt=K.Function,Oe=K.Math,ie=K.Object,_f=K.RegExp,wF=K.String,On=K.TypeError,Wl=j.prototype,vF=jt.prototype,ws=ie.prototype,$l=K["__core-js_shared__"],Vl=vF.toString,Kt=ws.hasOwnProperty,SF=0,S_=(function(){var o=/[^.]+$/.exec($l&&$l.keys&&$l.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Yl=ws.toString,TF=Vl.call(ie),kF=ue._,MF=_f("^"+Vl.call(Kt).replace(Lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ql=$o?K.Buffer:n,Ki=K.Symbol,jl=K.Uint8Array,T_=ql?ql.allocUnsafe:n,Gl=w_(ie.getPrototypeOf,ie),k_=ie.create,M_=ws.propertyIsEnumerable,Kl=Wl.splice,D_=Ki?Ki.isConcatSpreadable:n,Yo=Ki?Ki.iterator:n,Cr=Ki?Ki.toStringTag:n,Xl=(function(){try{var o=Pr(ie,"defineProperty");return o({},"",{}),o}catch{}})(),DF=K.clearTimeout!==ue.clearTimeout&&K.clearTimeout,CF=gt&>.now!==ue.Date.now&>.now,OF=K.setTimeout!==ue.setTimeout&&K.setTimeout,Zl=Oe.ceil,Ql=Oe.floor,bf=ie.getOwnPropertySymbols,AF=ql?ql.isBuffer:n,C_=K.isFinite,EF=Wl.join,RF=w_(ie.keys,ie),Ae=Oe.max,Ke=Oe.min,PF=gt.now,IF=K.parseInt,O_=Oe.random,LF=Wl.reverse,xf=Pr(K,"DataView"),qo=Pr(K,"Map"),wf=Pr(K,"Promise"),vs=Pr(K,"Set"),jo=Pr(K,"WeakMap"),Go=Pr(ie,"create"),Jl=jo&&new jo,Ss={},NF=Ir(xf),BF=Ir(qo),FF=Ir(wf),zF=Ir(vs),UF=Ir(jo),tc=Ki?Ki.prototype:n,Ko=tc?tc.valueOf:n,A_=tc?tc.toString:n;function T(o){if(ye(o)&&!Pt(o)&&!(o instanceof Ht)){if(o instanceof An)return o;if(Kt.call(o,"__wrapped__"))return Eb(o)}return new An(o)}var Ts=(function(){function o(){}return function(c){if(!pe(c))return{};if(k_)return k_(c);o.prototype=c;var p=new o;return o.prototype=n,p}})();function ec(){}function An(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}T.templateSettings={escape:Ed,evaluate:Rd,interpolate:Io,variable:"",imports:{_:T}},T.prototype=ec.prototype,T.prototype.constructor=T,An.prototype=Ts(ec.prototype),An.prototype.constructor=An;function Ht(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=I,this.__views__=[]}function HF(){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 WF(){if(this.__filtered__){var o=new Ht(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function $F(){var o=this.__wrapped__.value(),c=this.__dir__,p=Pt(o),y=c<0,b=p?o.length:0,M=eU(0,b,this.__views__),E=M.start,R=M.end,H=R-E,Z=y?R:E-1,Q=this.__iteratees__,et=Q.length,ft=0,wt=Ke(H,this.__takeCount__);if(!p||!y&&b==H&&wt==H)return tb(o,this.__actions__);var Dt=[];t:for(;H--&&ft<wt;){Z+=c;for(var Bt=-1,kt=o[Z];++Bt<et;){var Ut=Q[Bt],Wt=Ut.iteratee,vn=Ut.type,nn=Wt(kt);if(vn==ht)kt=nn;else if(!nn){if(vn==ct)continue t;break t}}Dt[ft++]=kt}return Dt}Ht.prototype=Ts(ec.prototype),Ht.prototype.constructor=Ht;function Or(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function VF(){this.__data__=Go?Go(null):{},this.size=0}function YF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function qF(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 jF(o){var c=this.__data__;return Go?c[o]!==n:Kt.call(c,o)}function GF(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=VF,Or.prototype.delete=YF,Or.prototype.get=qF,Or.prototype.has=jF,Or.prototype.set=GF;function mi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function KF(){this.__data__=[],this.size=0}function XF(o){var c=this.__data__,p=nc(c,o);if(p<0)return!1;var y=c.length-1;return p==y?c.pop():Kl.call(c,p,1),--this.size,!0}function ZF(o){var c=this.__data__,p=nc(c,o);return p<0?n:c[p][1]}function QF(o){return nc(this.__data__,o)>-1}function JF(o,c){var p=this.__data__,y=nc(p,o);return y<0?(++this.size,p.push([o,c])):p[y][1]=c,this}mi.prototype.clear=KF,mi.prototype.delete=XF,mi.prototype.get=ZF,mi.prototype.has=QF,mi.prototype.set=JF;function gi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function tz(){this.size=0,this.__data__={hash:new Or,map:new(qo||mi),string:new Or}}function ez(o){var c=pc(this,o).delete(o);return this.size-=c?1:0,c}function nz(o){return pc(this,o).get(o)}function iz(o){return pc(this,o).has(o)}function rz(o,c){var p=pc(this,o),y=p.size;return p.set(o,c),this.size+=p.size==y?0:1,this}gi.prototype.clear=tz,gi.prototype.delete=ez,gi.prototype.get=nz,gi.prototype.has=iz,gi.prototype.set=rz;function Ar(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new gi;++c<p;)this.add(o[c])}function sz(o){return this.__data__.set(o,d),this}function oz(o){return this.__data__.has(o)}Ar.prototype.add=Ar.prototype.push=sz,Ar.prototype.has=oz;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function az(){this.__data__=new mi,this.size=0}function lz(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function cz(o){return this.__data__.get(o)}function uz(o){return this.__data__.has(o)}function dz(o,c){var p=this.__data__;if(p instanceof mi){var y=p.__data__;if(!qo||y.length<r-1)return y.push([o,c]),this.size=++p.size,this;p=this.__data__=new gi(y)}return p.set(o,c),this.size=p.size,this}zn.prototype.clear=az,zn.prototype.delete=lz,zn.prototype.get=cz,zn.prototype.has=uz,zn.prototype.set=dz;function E_(o,c){var p=Pt(o),y=!p&&Lr(o),b=!p&&!y&&tr(o),M=!p&&!y&&!b&&Cs(o),E=p||y||b||M,R=E?mf(o.length,wF):[],H=R.length;for(var Z in o)(c||Kt.call(o,Z))&&!(E&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||M&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||bi(Z,H)))&&R.push(Z);return R}function R_(o){var c=o.length;return c?o[Rf(0,c-1)]:n}function fz(o,c){return mc(dn(o),Er(c,0,o.length))}function hz(o){return mc(dn(o))}function vf(o,c,p){(p!==n&&!Hn(o[c],p)||p===n&&!(c in o))&&Jn(o,c,p)}function Xo(o,c,p){var y=o[c];(!(Kt.call(o,c)&&Hn(y,p))||p===n&&!(c in o))&&Jn(o,c,p)}function nc(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function pz(o,c,p,y){return Xi(o,function(b,M,E){c(y,b,p(b),E)}),y}function P_(o,c){return o&&ei(c,Ie(c),o)}function mz(o,c){return o&&ei(c,hn(c),o)}function Jn(o,c,p){c=="__proto__"&&Xl?Xl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function Sf(o,c){for(var p=-1,y=c.length,b=j(y),M=o==null;++p<y;)b[p]=M?n:rh(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,y,b,M){var E,R=c&g,H=c&_,Z=c&x;if(p&&(E=b?p(o,y,b,M):p(o)),E!==n)return E;if(!pe(o))return o;var Q=Pt(o);if(Q){if(E=iU(o),!R)return dn(o,E)}else{var et=Xe(o),ft=et==zt||et==G;if(tr(o))return ib(o,R);if(et==_t||et==X||ft&&!b){if(E=H||ft?{}:vb(o),!R)return H?qz(o,mz(E,o)):Yz(o,P_(E,o))}else{if(!D[et])return b?o:{};E=rU(o,et,R)}}M||(M=new zn);var wt=M.get(o);if(wt)return wt;M.set(o,E),Zb(o)?o.forEach(function(kt){E.add(En(kt,c,p,kt,o,M))}):Kb(o)&&o.forEach(function(kt,Ut){E.set(Ut,En(kt,c,p,Ut,o,M))});var Dt=Z?H?$f:Wf:H?hn:Ie,Bt=Q?n:Dt(o);return _n(Bt||o,function(kt,Ut){Bt&&(Ut=kt,kt=o[Ut]),Xo(E,Ut,En(kt,c,p,Ut,o,M))}),E}function gz(o){var c=Ie(o);return function(p){return I_(p,o,c)}}function I_(o,c,p){var y=p.length;if(o==null)return!y;for(o=ie(o);y--;){var b=p[y],M=c[b],E=o[b];if(E===n&&!(b in o)||!M(E))return!1}return!0}function L_(o,c,p){if(typeof o!="function")throw new On(a);return ia(function(){o.apply(n,p)},c)}function Zo(o,c,p,y){var b=-1,M=zl,E=!0,R=o.length,H=[],Z=c.length;if(!R)return H;p&&(c=de(c,bn(p))),y?(M=cf,E=!1):c.length>=r&&(M=Vo,E=!1,c=new Ar(c));t:for(;++b<R;){var Q=o[b],et=p==null?Q:p(Q);if(Q=y||Q!==0?Q:0,E&&et===et){for(var ft=Z;ft--;)if(c[ft]===et)continue t;H.push(Q)}else M(c,et,y)||H.push(Q)}return H}var Xi=lb(ti),N_=lb(kf,!0);function yz(o,c){var p=!0;return Xi(o,function(y,b,M){return p=!!c(y,b,M),p}),p}function ic(o,c,p){for(var y=-1,b=o.length;++y<b;){var M=o[y],E=c(M);if(E!=null&&(R===n?E===E&&!wn(E):p(E,R)))var R=E,H=M}return H}function _z(o,c,p,y){var b=o.length;for(p=Nt(p),p<0&&(p=-p>b?0:b+p),y=y===n||y>b?b:Nt(y),y<0&&(y+=b),y=p>y?0:Jb(y);p<y;)o[p++]=c;return o}function B_(o,c){var p=[];return Xi(o,function(y,b,M){c(y,b,M)&&p.push(y)}),p}function Ue(o,c,p,y,b){var M=-1,E=o.length;for(p||(p=oU),b||(b=[]);++M<E;){var R=o[M];c>0&&p(R)?c>1?Ue(R,c-1,p,y,b):ji(b,R):y||(b[b.length]=R)}return b}var Tf=cb(),F_=cb(!0);function ti(o,c){return o&&Tf(o,c,Ie)}function kf(o,c){return o&&F_(o,c,Ie)}function rc(o,c){return qi(c,function(p){return xi(o[p])})}function Rr(o,c){c=Qi(c,o);for(var p=0,y=c.length;o!=null&&p<y;)o=o[Un(c[p++])];return p&&p==y?o:n}function z_(o,c,p){var y=c(o);return Pt(o)?y:ji(y,p(o))}function tn(o){return o==null?o===n?Be:$t:Cr&&Cr in ie(o)?tU(o):hU(o)}function Mf(o,c){return o>c}function bz(o,c){return o!=null&&Kt.call(o,c)}function xz(o,c){return o!=null&&c in ie(o)}function wz(o,c,p){return o>=Ke(c,p)&&o<Ae(c,p)}function Df(o,c,p){for(var y=p?cf:zl,b=o[0].length,M=o.length,E=M,R=j(M),H=1/0,Z=[];E--;){var Q=o[E];E&&c&&(Q=de(Q,bn(c))),H=Ke(Q.length,H),R[E]=!p&&(c||b>=120&&Q.length>=120)?new Ar(E&&Q):n}Q=o[0];var et=-1,ft=R[0];t:for(;++et<b&&Z.length<H;){var wt=Q[et],Dt=c?c(wt):wt;if(wt=p||wt!==0?wt:0,!(ft?Vo(ft,Dt):y(Z,Dt,p))){for(E=M;--E;){var Bt=R[E];if(!(Bt?Vo(Bt,Dt):y(o[E],Dt,p)))continue t}ft&&ft.push(Dt),Z.push(wt)}}return Z}function vz(o,c,p,y){return ti(o,function(b,M,E){c(y,p(b),M,E)}),y}function Qo(o,c,p){c=Qi(c,o),o=Mb(o,c);var y=o==null?o:o[Un(Pn(c))];return y==null?n:yn(y,o,p)}function U_(o){return ye(o)&&tn(o)==X}function Sz(o){return ye(o)&&tn(o)==Pe}function Tz(o){return ye(o)&&tn(o)==yt}function Jo(o,c,p,y,b){return o===c?!0:o==null||c==null||!ye(o)&&!ye(c)?o!==o&&c!==c:kz(o,c,p,y,Jo,b)}function kz(o,c,p,y,b,M){var E=Pt(o),R=Pt(c),H=E?tt:Xe(o),Z=R?tt:Xe(c);H=H==X?_t:H,Z=Z==X?_t:Z;var Q=H==_t,et=Z==_t,ft=H==Z;if(ft&&tr(o)){if(!tr(c))return!1;E=!0,Q=!1}if(ft&&!Q)return M||(M=new zn),E||Cs(o)?bb(o,c,p,y,b,M):Qz(o,c,H,p,y,b,M);if(!(p&v)){var wt=Q&&Kt.call(o,"__wrapped__"),Dt=et&&Kt.call(c,"__wrapped__");if(wt||Dt){var Bt=wt?o.value():o,kt=Dt?c.value():c;return M||(M=new zn),b(Bt,kt,p,y,M)}}return ft?(M||(M=new zn),Jz(o,c,p,y,b,M)):!1}function Mz(o){return ye(o)&&Xe(o)==it}function Cf(o,c,p,y){var b=p.length,M=b,E=!y;if(o==null)return!M;for(o=ie(o);b--;){var R=p[b];if(E&&R[2]?R[1]!==o[R[0]]:!(R[0]in o))return!1}for(;++b<M;){R=p[b];var H=R[0],Z=o[H],Q=R[1];if(E&&R[2]){if(Z===n&&!(H in o))return!1}else{var et=new zn;if(y)var ft=y(Z,Q,H,o,c,et);if(!(ft===n?Jo(Q,Z,v|S,y,et):ft))return!1}}return!0}function H_(o){if(!pe(o)||lU(o))return!1;var c=xi(o)?MF:Wd;return c.test(Ir(o))}function Dz(o){return ye(o)&&tn(o)==ke}function Cz(o){return ye(o)&&Xe(o)==ae}function Oz(o){return ye(o)&&wc(o.length)&&!!ne[tn(o)]}function W_(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?Pt(o)?Y_(o[0],o[1]):V_(o):dx(o)}function Of(o){if(!na(o))return RF(o);var c=[];for(var p in ie(o))Kt.call(o,p)&&p!="constructor"&&c.push(p);return c}function Az(o){if(!pe(o))return fU(o);var c=na(o),p=[];for(var y in o)y=="constructor"&&(c||!Kt.call(o,y))||p.push(y);return p}function Af(o,c){return o<c}function $_(o,c){var p=-1,y=fn(o)?j(o.length):[];return Xi(o,function(b,M,E){y[++p]=c(b,M,E)}),y}function V_(o){var c=Yf(o);return c.length==1&&c[0][2]?Tb(c[0][0],c[0][1]):function(p){return p===o||Cf(p,o,c)}}function Y_(o,c){return jf(o)&&Sb(c)?Tb(Un(o),c):function(p){var y=rh(p,o);return y===n&&y===c?sh(p,o):Jo(c,y,v|S)}}function sc(o,c,p,y,b){o!==c&&Tf(c,function(M,E){if(b||(b=new zn),pe(M))Ez(o,c,E,p,sc,y,b);else{var R=y?y(Kf(o,E),M,E+"",o,c,b):n;R===n&&(R=M),vf(o,E,R)}},hn)}function Ez(o,c,p,y,b,M,E){var R=Kf(o,p),H=Kf(c,p),Z=E.get(H);if(Z){vf(o,p,Z);return}var Q=M?M(R,H,p+"",o,c,E):n,et=Q===n;if(et){var ft=Pt(H),wt=!ft&&tr(H),Dt=!ft&&!wt&&Cs(H);Q=H,ft||wt||Dt?Pt(R)?Q=R:xe(R)?Q=dn(R):wt?(et=!1,Q=ib(H,!0)):Dt?(et=!1,Q=rb(H,!0)):Q=[]:ra(H)||Lr(H)?(Q=R,Lr(R)?Q=tx(R):(!pe(R)||xi(R))&&(Q=vb(H))):et=!1}et&&(E.set(H,Q),b(Q,H,y,M,E),E.delete(H)),vf(o,p,Q)}function q_(o,c){var p=o.length;if(p)return c+=c<0?p:0,bi(c,p)?o[c]:n}function j_(o,c,p){c.length?c=de(c,function(M){return Pt(M)?function(E){return Rr(E,M.length===1?M[0]:M)}:M}):c=[pn];var y=-1;c=de(c,bn(Mt()));var b=$_(o,function(M,E,R){var H=de(c,function(Z){return Z(M)});return{criteria:H,index:++y,value:M}});return rF(b,function(M,E){return Vz(M,E,p)})}function Rz(o,c){return G_(o,c,function(p,y){return sh(o,y)})}function G_(o,c,p){for(var y=-1,b=c.length,M={};++y<b;){var E=c[y],R=Rr(o,E);p(R,E)&&ta(M,Qi(E,o),R)}return M}function Pz(o){return function(c){return Rr(c,o)}}function Ef(o,c,p,y){var b=y?iF:ys,M=-1,E=c.length,R=o;for(o===c&&(c=dn(c)),p&&(R=de(o,bn(p)));++M<E;)for(var H=0,Z=c[M],Q=p?p(Z):Z;(H=b(R,Q,H,y))>-1;)R!==o&&Kl.call(R,H,1),Kl.call(o,H,1);return o}function K_(o,c){for(var p=o?c.length:0,y=p-1;p--;){var b=c[p];if(p==y||b!==M){var M=b;bi(b)?Kl.call(o,b,1):Lf(o,b)}}return o}function Rf(o,c){return o+Ql(O_()*(c-o+1))}function Iz(o,c,p,y){for(var b=-1,M=Ae(Zl((c-o)/(p||1)),0),E=j(M);M--;)E[y?M:++b]=o,o+=p;return E}function Pf(o,c){var p="";if(!o||c<1||c>at)return p;do c%2&&(p+=o),c=Ql(c/2),c&&(o+=o);while(c);return p}function Ft(o,c){return Xf(kb(o,c,pn),o+"")}function Lz(o){return R_(Os(o))}function Nz(o,c){var p=Os(o);return mc(p,Er(c,0,p.length))}function ta(o,c,p,y){if(!pe(o))return o;c=Qi(c,o);for(var b=-1,M=c.length,E=M-1,R=o;R!=null&&++b<M;){var H=Un(c[b]),Z=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(b!=E){var Q=R[H];Z=y?y(Q,H,R):n,Z===n&&(Z=pe(Q)?Q:bi(c[b+1])?[]:{})}Xo(R,H,Z),R=R[H]}return o}var X_=Jl?function(o,c){return Jl.set(o,c),o}:pn,Bz=Xl?function(o,c){return Xl(o,"toString",{configurable:!0,enumerable:!1,value:ah(c),writable:!0})}:pn;function Fz(o){return mc(Os(o))}function Rn(o,c,p){var y=-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 M=j(b);++y<b;)M[y]=o[y+c];return M}function zz(o,c){var p;return Xi(o,function(y,b,M){return p=c(y,b,M),!p}),!!p}function oc(o,c,p){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=nt){for(;y<b;){var M=y+b>>>1,E=o[M];E!==null&&!wn(E)&&(p?E<=c:E<c)?y=M+1:b=M}return b}return If(o,c,pn,p)}function If(o,c,p,y){var b=0,M=o==null?0:o.length;if(M===0)return 0;c=p(c);for(var E=c!==c,R=c===null,H=wn(c),Z=c===n;b<M;){var Q=Ql((b+M)/2),et=p(o[Q]),ft=et!==n,wt=et===null,Dt=et===et,Bt=wn(et);if(E)var kt=y||Dt;else Z?kt=Dt&&(y||ft):R?kt=Dt&&ft&&(y||!wt):H?kt=Dt&&ft&&!wt&&(y||!Bt):wt||Bt?kt=!1:kt=y?et<=c:et<c;kt?b=Q+1:M=Q}return Ke(M,W)}function Z_(o,c){for(var p=-1,y=o.length,b=0,M=[];++p<y;){var E=o[p],R=c?c(E):E;if(!p||!Hn(R,H)){var H=R;M[b++]=E===0?0:E}}return M}function Q_(o){return typeof o=="number"?o:wn(o)?V:+o}function xn(o){if(typeof o=="string")return o;if(Pt(o))return de(o,xn)+"";if(wn(o))return A_?A_.call(o):"";var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Zi(o,c,p){var y=-1,b=zl,M=o.length,E=!0,R=[],H=R;if(p)E=!1,b=cf;else if(M>=r){var Z=c?null:Xz(o);if(Z)return Hl(Z);E=!1,b=Vo,H=new Ar}else H=c?[]:R;t:for(;++y<M;){var Q=o[y],et=c?c(Q):Q;if(Q=p||Q!==0?Q:0,E&&et===et){for(var ft=H.length;ft--;)if(H[ft]===et)continue t;c&&H.push(et),R.push(Q)}else b(H,et,p)||(H!==R&&H.push(et),R.push(Q))}return R}function Lf(o,c){c=Qi(c,o);var p=-1,y=c.length;if(!y)return!0;for(;++p<y;){var b=Un(c[p]);if(b==="__proto__"&&!Kt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&p<y-1)return!1}var M=Mb(o,c);return M==null||delete M[Un(Pn(c))]}function J_(o,c,p,y){return ta(o,c,p(Rr(o,c)),y)}function ac(o,c,p,y){for(var b=o.length,M=y?b:-1;(y?M--:++M<b)&&c(o[M],M,o););return p?Rn(o,y?0:M,y?M+1:b):Rn(o,y?M+1:0,y?b:M)}function tb(o,c){var p=o;return p instanceof Ht&&(p=p.value()),uf(c,function(y,b){return b.func.apply(b.thisArg,ji([y],b.args))},p)}function Nf(o,c,p){var y=o.length;if(y<2)return y?Zi(o[0]):[];for(var b=-1,M=j(y);++b<y;)for(var E=o[b],R=-1;++R<y;)R!=b&&(M[b]=Zo(M[b]||E,o[R],c,p));return Zi(Ue(M,1),c,p)}function eb(o,c,p){for(var y=-1,b=o.length,M=c.length,E={};++y<b;){var R=y<M?c[y]:n;p(E,o[y],R)}return E}function Bf(o){return xe(o)?o:[]}function Ff(o){return typeof o=="function"?o:pn}function Qi(o,c){return Pt(o)?o:jf(o,c)?[o]:Ab(Xt(o))}var Uz=Ft;function Ji(o,c,p){var y=o.length;return p=p===n?y:p,!c&&p>=y?o:Rn(o,c,p)}var nb=DF||function(o){return ue.clearTimeout(o)};function ib(o,c){if(c)return o.slice();var p=o.length,y=T_?T_(p):new o.constructor(p);return o.copy(y),y}function zf(o){var c=new o.constructor(o.byteLength);return new jl(c).set(new jl(o)),c}function Hz(o,c){var p=c?zf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function Wz(o){var c=new o.constructor(o.source,vl.exec(o));return c.lastIndex=o.lastIndex,c}function $z(o){return Ko?ie(Ko.call(o)):{}}function rb(o,c){var p=c?zf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function sb(o,c){if(o!==c){var p=o!==n,y=o===null,b=o===o,M=wn(o),E=c!==n,R=c===null,H=c===c,Z=wn(c);if(!R&&!Z&&!M&&o>c||M&&E&&H&&!R&&!Z||y&&E&&H||!p&&H||!b)return 1;if(!y&&!M&&!Z&&o<c||Z&&p&&b&&!y&&!M||R&&p&&b||!E&&b||!H)return-1}return 0}function Vz(o,c,p){for(var y=-1,b=o.criteria,M=c.criteria,E=b.length,R=p.length;++y<E;){var H=sb(b[y],M[y]);if(H){if(y>=R)return H;var Z=p[y];return H*(Z=="desc"?-1:1)}}return o.index-c.index}function ob(o,c,p,y){for(var b=-1,M=o.length,E=p.length,R=-1,H=c.length,Z=Ae(M-E,0),Q=j(H+Z),et=!y;++R<H;)Q[R]=c[R];for(;++b<E;)(et||b<M)&&(Q[p[b]]=o[b]);for(;Z--;)Q[R++]=o[b++];return Q}function ab(o,c,p,y){for(var b=-1,M=o.length,E=-1,R=p.length,H=-1,Z=c.length,Q=Ae(M-R,0),et=j(Q+Z),ft=!y;++b<Q;)et[b]=o[b];for(var wt=b;++H<Z;)et[wt+H]=c[H];for(;++E<R;)(ft||b<M)&&(et[wt+p[E]]=o[b++]);return et}function dn(o,c){var p=-1,y=o.length;for(c||(c=j(y));++p<y;)c[p]=o[p];return c}function ei(o,c,p,y){var b=!p;p||(p={});for(var M=-1,E=c.length;++M<E;){var R=c[M],H=y?y(p[R],o[R],R,p,o):n;H===n&&(H=o[R]),b?Jn(p,R,H):Xo(p,R,H)}return p}function Yz(o,c){return ei(o,qf(o),c)}function qz(o,c){return ei(o,xb(o),c)}function lc(o,c){return function(p,y){var b=Pt(p)?ZB:pz,M=c?c():{};return b(p,o,Mt(y,2),M)}}function ks(o){return Ft(function(c,p){var y=-1,b=p.length,M=b>1?p[b-1]:n,E=b>2?p[2]:n;for(M=o.length>3&&typeof M=="function"?(b--,M):n,E&&en(p[0],p[1],E)&&(M=b<3?n:M,b=1),c=ie(c);++y<b;){var R=p[y];R&&o(c,R,y,M)}return c})}function lb(o,c){return function(p,y){if(p==null)return p;if(!fn(p))return o(p,y);for(var b=p.length,M=c?b:-1,E=ie(p);(c?M--:++M<b)&&y(E[M],M,E)!==!1;);return p}}function cb(o){return function(c,p,y){for(var b=-1,M=ie(c),E=y(c),R=E.length;R--;){var H=E[o?R:++b];if(p(M[H],H,M)===!1)break}return c}}function jz(o,c,p){var y=c&C,b=ea(o);function M(){var E=this&&this!==ue&&this instanceof M?b:o;return E.apply(y?p:this,arguments)}return M}function ub(o){return function(c){c=Xt(c);var p=_s(c)?Fn(c):n,y=p?p[0]:c.charAt(0),b=p?Ji(p,1).join(""):c.slice(1);return y[o]()+b}}function Ms(o){return function(c){return uf(cx(lx(c).replace(rf,"")),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),y=o.apply(p,c);return pe(y)?y:p}}function Gz(o,c,p){var y=ea(o);function b(){for(var M=arguments.length,E=j(M),R=M,H=Ds(b);R--;)E[R]=arguments[R];var Z=M<3&&E[0]!==H&&E[M-1]!==H?[]:Gi(E,H);if(M-=Z.length,M<p)return mb(o,c,cc,b.placeholder,n,E,Z,n,n,p-M);var Q=this&&this!==ue&&this instanceof b?y:o;return yn(Q,this,E)}return b}function db(o){return function(c,p,y){var b=ie(c);if(!fn(c)){var M=Mt(p,3);c=Ie(c),p=function(R){return M(b[R],R,b)}}var E=o(c,p,y);return E>-1?b[M?c[E]:E]:n}}function fb(o){return _i(function(c){var p=c.length,y=p,b=An.prototype.thru;for(o&&c.reverse();y--;){var M=c[y];if(typeof M!="function")throw new On(a);if(b&&!E&&hc(M)=="wrapper")var E=new An([],!0)}for(y=E?y:p;++y<p;){M=c[y];var R=hc(M),H=R=="wrapper"?Vf(M):n;H&&Gf(H[0])&&H[1]==(k|P|N|w)&&!H[4].length&&H[9]==1?E=E[hc(H[0])].apply(E,H[3]):E=M.length==1&&Gf(M)?E[R]():E.thru(M)}return function(){var Z=arguments,Q=Z[0];if(E&&Z.length==1&&Pt(Q))return E.plant(Q).value();for(var et=0,ft=p?c[et].apply(this,Z):Q;++et<p;)ft=c[et].call(this,ft);return ft}})}function cc(o,c,p,y,b,M,E,R,H,Z){var Q=c&k,et=c&C,ft=c&A,wt=c&(P|B),Dt=c&O,Bt=ft?n:ea(o);function kt(){for(var Ut=arguments.length,Wt=j(Ut),vn=Ut;vn--;)Wt[vn]=arguments[vn];if(wt)var nn=Ds(kt),Sn=oF(Wt,nn);if(y&&(Wt=ob(Wt,y,b,wt)),M&&(Wt=ab(Wt,M,E,wt)),Ut-=Sn,wt&&Ut<Z){var we=Gi(Wt,nn);return mb(o,c,cc,kt.placeholder,p,Wt,we,R,H,Z-Ut)}var Wn=et?p:this,vi=ft?Wn[o]:o;return Ut=Wt.length,R?Wt=pU(Wt,R):Dt&&Ut>1&&Wt.reverse(),Q&&H<Ut&&(Wt.length=H),this&&this!==ue&&this instanceof kt&&(vi=Bt||ea(vi)),vi.apply(Wn,Wt)}return kt}function hb(o,c){return function(p,y){return vz(p,o,c(y),{})}}function uc(o,c){return function(p,y){var b;if(p===n&&y===n)return c;if(p!==n&&(b=p),y!==n){if(b===n)return y;typeof p=="string"||typeof y=="string"?(p=xn(p),y=xn(y)):(p=Q_(p),y=Q_(y)),b=o(p,y)}return b}}function Uf(o){return _i(function(c){return c=de(c,bn(Mt())),Ft(function(p){var y=this;return o(c,function(b){return yn(b,y,p)})})})}function dc(o,c){c=c===n?" ":xn(c);var p=c.length;if(p<2)return p?Pf(c,o):c;var y=Pf(c,Zl(o/bs(c)));return _s(c)?Ji(Fn(y),0,o).join(""):y.slice(0,o)}function Kz(o,c,p,y){var b=c&C,M=ea(o);function E(){for(var R=-1,H=arguments.length,Z=-1,Q=y.length,et=j(Q+H),ft=this&&this!==ue&&this instanceof E?M:o;++Z<Q;)et[Z]=y[Z];for(;H--;)et[Z++]=arguments[++R];return yn(ft,b?p:this,et)}return E}function pb(o){return function(c,p,y){return y&&typeof y!="number"&&en(c,p,y)&&(p=y=n),c=wi(c),p===n?(p=c,c=0):p=wi(p),y=y===n?c<p?1:-1:wi(y),Iz(c,p,y,o)}}function fc(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=In(c),p=In(p)),o(c,p)}}function mb(o,c,p,y,b,M,E,R,H,Z){var Q=c&P,et=Q?E:n,ft=Q?n:E,wt=Q?M:n,Dt=Q?n:M;c|=Q?N:z,c&=~(Q?z:N),c&F||(c&=-4);var Bt=[o,c,b,wt,et,Dt,ft,R,H,Z],kt=p.apply(n,Bt);return Gf(o)&&Db(kt,Bt),kt.placeholder=y,Cb(kt,o,c)}function Hf(o){var c=Oe[o];return function(p,y){if(p=In(p),y=y==null?0:Ke(Nt(y),292),y&&C_(p)){var b=(Xt(p)+"e").split("e"),M=c(b[0]+"e"+(+b[1]+y));return b=(Xt(M)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(p)}}var Xz=vs&&1/Hl(new vs([,-0]))[1]==vt?function(o){return new vs(o)}:uh;function gb(o){return function(c){var p=Xe(c);return p==it?yf(c):p==ae?hF(c):sF(c,o(c))}}function yi(o,c,p,y,b,M,E,R){var H=c&A;if(!H&&typeof o!="function")throw new On(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=n),E=E===n?E:Ae(Nt(E),0),R=R===n?R:Nt(R),Z-=b?b.length:0,c&z){var Q=y,et=b;y=b=n}var ft=H?n:Vf(o),wt=[o,c,p,y,b,Q,et,M,E,R];if(ft&&dU(wt,ft),o=wt[0],c=wt[1],p=wt[2],y=wt[3],b=wt[4],R=wt[9]=wt[9]===n?H?0:o.length:Ae(wt[9]-Z,0),!R&&c&(P|B)&&(c&=-25),!c||c==C)var Dt=jz(o,c,p);else c==P||c==B?Dt=Gz(o,c,R):(c==N||c==(C|N))&&!b.length?Dt=Kz(o,c,p,y):Dt=cc.apply(n,wt);var Bt=ft?X_:Db;return Cb(Bt(Dt,wt),o,c)}function yb(o,c,p,y){return o===n||Hn(o,ws[p])&&!Kt.call(y,p)?c:o}function _b(o,c,p,y,b,M){return pe(o)&&pe(c)&&(M.set(c,o),sc(o,c,n,_b,M),M.delete(c)),o}function Zz(o){return ra(o)?n:o}function bb(o,c,p,y,b,M){var E=p&v,R=o.length,H=c.length;if(R!=H&&!(E&&H>R))return!1;var Z=M.get(o),Q=M.get(c);if(Z&&Q)return Z==c&&Q==o;var et=-1,ft=!0,wt=p&S?new Ar:n;for(M.set(o,c),M.set(c,o);++et<R;){var Dt=o[et],Bt=c[et];if(y)var kt=E?y(Bt,Dt,et,c,o,M):y(Dt,Bt,et,o,c,M);if(kt!==n){if(kt)continue;ft=!1;break}if(wt){if(!df(c,function(Ut,Wt){if(!Vo(wt,Wt)&&(Dt===Ut||b(Dt,Ut,p,y,M)))return wt.push(Wt)})){ft=!1;break}}else if(!(Dt===Bt||b(Dt,Bt,p,y,M))){ft=!1;break}}return M.delete(o),M.delete(c),ft}function Qz(o,c,p,y,b,M,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||!M(new jl(o),new jl(c)));case pt:case yt:case lt:return Hn(+o,+c);case Et:return o.name==c.name&&o.message==c.message;case ke:case cn:return o==c+"";case it:var R=yf;case ae:var H=y&v;if(R||(R=Hl),o.size!=c.size&&!H)return!1;var Z=E.get(o);if(Z)return Z==c;y|=S,E.set(o,c);var Q=bb(R(o),R(c),y,b,M,E);return E.delete(o),Q;case qt:if(Ko)return Ko.call(o)==Ko.call(c)}return!1}function Jz(o,c,p,y,b,M){var E=p&v,R=Wf(o),H=R.length,Z=Wf(c),Q=Z.length;if(H!=Q&&!E)return!1;for(var et=H;et--;){var ft=R[et];if(!(E?ft in c:Kt.call(c,ft)))return!1}var wt=M.get(o),Dt=M.get(c);if(wt&&Dt)return wt==c&&Dt==o;var Bt=!0;M.set(o,c),M.set(c,o);for(var kt=E;++et<H;){ft=R[et];var Ut=o[ft],Wt=c[ft];if(y)var vn=E?y(Wt,Ut,ft,c,o,M):y(Ut,Wt,ft,o,c,M);if(!(vn===n?Ut===Wt||b(Ut,Wt,p,y,M):vn)){Bt=!1;break}kt||(kt=ft=="constructor")}if(Bt&&!kt){var nn=o.constructor,Sn=c.constructor;nn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof nn=="function"&&nn instanceof nn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Bt=!1)}return M.delete(o),M.delete(c),Bt}function _i(o){return Xf(kb(o,n,Ib),o+"")}function Wf(o){return z_(o,Ie,qf)}function $f(o){return z_(o,hn,xb)}var Vf=Jl?function(o){return Jl.get(o)}:uh;function hc(o){for(var c=o.name+"",p=Ss[c],y=Kt.call(Ss,c)?p.length:0;y--;){var b=p[y],M=b.func;if(M==null||M==o)return b.name}return c}function Ds(o){var c=Kt.call(T,"placeholder")?T:o;return c.placeholder}function Mt(){var o=T.iteratee||lh;return o=o===lh?W_:o,arguments.length?o(arguments[0],arguments[1]):o}function pc(o,c){var p=o.__data__;return aU(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Yf(o){for(var c=Ie(o),p=c.length;p--;){var y=c[p],b=o[y];c[p]=[y,b,Sb(b)]}return c}function Pr(o,c){var p=uF(o,c);return H_(p)?p:n}function tU(o){var c=Kt.call(o,Cr),p=o[Cr];try{o[Cr]=n;var y=!0}catch{}var b=Yl.call(o);return y&&(c?o[Cr]=p:delete o[Cr]),b}var qf=bf?function(o){return o==null?[]:(o=ie(o),qi(bf(o),function(c){return M_.call(o,c)}))}:dh,xb=bf?function(o){for(var c=[];o;)ji(c,qf(o)),o=Gl(o);return c}:dh,Xe=tn;(xf&&Xe(new xf(new ArrayBuffer(1)))!=gn||qo&&Xe(new qo)!=it||wf&&Xe(wf.resolve())!=Vt||vs&&Xe(new vs)!=ae||jo&&Xe(new jo)!=re)&&(Xe=function(o){var c=tn(o),p=c==_t?o.constructor:n,y=p?Ir(p):"";if(y)switch(y){case NF:return gn;case BF:return it;case FF:return Vt;case zF:return ae;case UF:return re}return c});function eU(o,c,p){for(var y=-1,b=p.length;++y<b;){var M=p[y],E=M.size;switch(M.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=Ke(c,o+E);break;case"takeRight":o=Ae(o,c-E);break}}return{start:o,end:c}}function nU(o){var c=o.match(Nd);return c?c[1].split(Bd):[]}function wb(o,c,p){c=Qi(c,o);for(var y=-1,b=c.length,M=!1;++y<b;){var E=Un(c[y]);if(!(M=o!=null&&p(o,E)))break;o=o[E]}return M||++y!=b?M:(b=o==null?0:o.length,!!b&&wc(b)&&bi(E,b)&&(Pt(o)||Lr(o)))}function iU(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 vb(o){return typeof o.constructor=="function"&&!na(o)?Ts(Gl(o)):{}}function rU(o,c,p){var y=o.constructor;switch(c){case Pe:return zf(o);case pt:case yt:return new y(+o);case gn:return Hz(o,p);case Wi:case Cn:case je:case Ln:case di:case Oo:case Ao:case Tr:case fi:return rb(o,p);case it:return new y;case lt:case cn:return new y(o);case ke:return Wz(o);case ae:return new y;case qt:return $z(o)}}function sU(o,c){var p=c.length;if(!p)return o;var y=p-1;return c[y]=(p>1?"& ":"")+c[y],c=c.join(p>2?", ":" "),o.replace(Nn,`{
|
|
8
8
|
/* [wrapped with `+c+`] */
|
|
9
|
-
`)}function aU(o){return Pt(o)||Lr(o)||!!(D_&&o&&o[D_])}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 en(o,c,p){if(!pe(p))return!1;var y=typeof c;return(y=="number"?fn(p)&&bi(c,p.length):y=="string"&&c in p)?Hn(p[c],o):!1}function jf(o,c){if(Pt(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||wn(o)?!0:hi.test(o)||!xl.test(o)||c!=null&&o in ie(c)}function lU(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Gf(o){var c=hc(o),p=T[c];if(typeof p!="function"||!(c in Ht.prototype))return!1;if(o===p)return!0;var y=Vf(p);return!!y&&o===y[0]}function cU(o){return!!S_&&S_ in o}var uU=$l?xi:fh;function na(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||ws;return o===p}function Sb(o){return o===o&&!pe(o)}function Tb(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in ie(p))}}function dU(o){var c=bc(o,function(y){return p.size===h&&p.clear(),y}),p=c.cache;return c}function fU(o,c){var p=o[1],y=c[1],b=p|y,M=b<(C|A|k),E=y==k&&p==P||y==k&&p==w&&o[7].length<=c[8]||y==(k|w)&&c[7].length<=c[8]&&p==P;if(!(M||E))return o;y&C&&(o[2]=c[2],b|=p&C?0:F);var R=c[3];if(R){var H=o[3];o[3]=H?ob(H,R,c[4]):R,o[4]=H?Gi(o[3],m):c[4]}return R=c[5],R&&(H=o[5],o[5]=H?ab(H,R,c[6]):R,o[6]=H?Gi(o[5],m):c[6]),R=c[7],R&&(o[7]=R),y&k&&(o[8]=o[8]==null?c[8]:Ke(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function hU(o){var c=[];if(o!=null)for(var p in ie(o))c.push(p);return c}function pU(o){return Yl.call(o)}function kb(o,c,p){return c=Ae(c===n?o.length-1:c,0),function(){for(var y=arguments,b=-1,M=Ae(y.length-c,0),E=j(M);++b<M;)E[b]=y[c+b];b=-1;for(var R=j(c+1);++b<c;)R[b]=y[b];return R[c]=p(E),yn(o,this,R)}}function Mb(o,c){return c.length<2?o:Rr(o,Rn(c,0,-1))}function mU(o,c){for(var p=o.length,y=Ke(c.length,p),b=dn(o);y--;){var M=c[y];o[y]=bi(M,p)?b[M]:n}return o}function Kf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Db=Ob(X_),ia=AF||function(o,c){return ue.setTimeout(o,c)},Xf=Ob(Fz);function Cb(o,c,p){var y=c+"";return Xf(o,oU(y,gU(iU(y),p)))}function Ob(o){var c=0,p=0;return function(){var y=IF(),b=st-(y-p);if(p=y,b>0){if(++c>=q)return arguments[0]}else c=0;return o.apply(n,arguments)}}function mc(o,c){var p=-1,y=o.length,b=y-1;for(c=c===n?y:c;++p<c;){var M=Rf(p,b),E=o[M];o[M]=o[p],o[p]=E}return o.length=c,o}var Ab=dU(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Pd,function(p,y,b,M){c.push(b?M.replace(zd,"$1"):y||p)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Ir(o){if(o!=null){try{return Vl.call(o)}catch{}try{return o+""}catch{}}return""}function gU(o,c){return _n(ot,function(p){var y="_."+p[0];c&p[1]&&!zl(o,y)&&o.push(y)}),o.sort()}function Eb(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 yU(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Ae(Nt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,M=0,E=j(Zl(y/c));b<y;)E[M++]=Rn(o,b,b+=c);return E}function _U(o){for(var c=-1,p=o==null?0:o.length,y=0,b=[];++c<p;){var M=o[c];M&&(b[y++]=M)}return b}function bU(){var o=arguments.length;if(!o)return[];for(var c=j(o-1),p=arguments[0],y=o;y--;)c[y-1]=arguments[y];return ji(Pt(p)?dn(p):[p],Ue(c,1))}var xU=Ft(function(o,c){return xe(o)?Zo(o,Ue(c,1,xe,!0)):[]}),wU=Ft(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),Mt(p,2)):[]}),vU=Ft(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),n,p):[]});function SU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),Rn(o,c<0?0:c,y)):[]}function TU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),c=y-c,Rn(o,0,c<0?0:c)):[]}function kU(o,c){return o&&o.length?ac(o,Mt(c,3),!0,!0):[]}function MU(o,c){return o&&o.length?ac(o,Mt(c,3),!0):[]}function DU(o,c,p,y){var b=o==null?0:o.length;return b?(p&&typeof p!="number"&&en(o,c,p)&&(p=0,y=b),bz(o,c,p,y)):[]}function Rb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Nt(p);return b<0&&(b=Ae(y+b,0)),Ul(o,Mt(c,3),b)}function Pb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return p!==n&&(b=Nt(p),b=p<0?Ae(y+b,0):Ke(b,y-1)),Ul(o,Mt(c,3),b,!0)}function Ib(o){var c=o==null?0:o.length;return c?Ue(o,1):[]}function CU(o){var c=o==null?0:o.length;return c?Ue(o,vt):[]}function OU(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:Nt(c),Ue(o,c)):[]}function AU(o){for(var c=-1,p=o==null?0:o.length,y={};++c<p;){var b=o[c];Jn(y,b[0],b[1])}return y}function Lb(o){return o&&o.length?o[0]:n}function EU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Nt(p);return b<0&&(b=Ae(y+b,0)),ys(o,c,b)}function RU(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var PU=Ft(function(o){var c=de(o,Bf);return c.length&&c[0]===o[0]?Df(c):[]}),IU=Ft(function(o){var c=Pn(o),p=de(o,Bf);return c===Pn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?Df(p,Mt(c,2)):[]}),LU=Ft(function(o){var c=Pn(o),p=de(o,Bf);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?Df(p,n,c):[]});function NU(o,c){return o==null?"":RF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function BU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y;return p!==n&&(b=Nt(p),b=b<0?Ae(y+b,0):Ke(b,y-1)),c===c?gF(o,c,b):Ul(o,m_,b,!0)}function FU(o,c){return o&&o.length?q_(o,Nt(c)):n}var zU=Ft(Nb);function Nb(o,c){return o&&o.length&&c&&c.length?Ef(o,c):o}function UU(o,c,p){return o&&o.length&&c&&c.length?Ef(o,c,Mt(p,2)):o}function HU(o,c,p){return o&&o.length&&c&&c.length?Ef(o,c,n,p):o}var WU=_i(function(o,c){var p=o==null?0:o.length,y=Sf(o,c);return K_(o,de(c,function(b){return bi(b,p)?+b:b}).sort(sb)),y});function $U(o,c){var p=[];if(!(o&&o.length))return p;var y=-1,b=[],M=o.length;for(c=Mt(c,3);++y<M;){var E=o[y];c(E,y,o)&&(p.push(E),b.push(y))}return K_(o,b),p}function Zf(o){return o==null?o:NF.call(o)}function VU(o,c,p){var y=o==null?0:o.length;return y?(p&&typeof p!="number"&&en(o,c,p)?(c=0,p=y):(c=c==null?0:Nt(c),p=p===n?y:Nt(p)),Rn(o,c,p)):[]}function YU(o,c){return oc(o,c)}function qU(o,c,p){return If(o,c,Mt(p,2))}function jU(o,c){var p=o==null?0:o.length;if(p){var y=oc(o,c);if(y<p&&Hn(o[y],c))return y}return-1}function GU(o,c){return oc(o,c,!0)}function KU(o,c,p){return If(o,c,Mt(p,2),!0)}function XU(o,c){var p=o==null?0:o.length;if(p){var y=oc(o,c,!0)-1;if(Hn(o[y],c))return y}return-1}function ZU(o){return o&&o.length?Z_(o):[]}function QU(o,c){return o&&o.length?Z_(o,Mt(c,2)):[]}function JU(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function t5(o,c,p){return o&&o.length?(c=p||c===n?1:Nt(c),Rn(o,0,c<0?0:c)):[]}function e5(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),c=y-c,Rn(o,c<0?0:c,y)):[]}function n5(o,c){return o&&o.length?ac(o,Mt(c,3),!1,!0):[]}function i5(o,c){return o&&o.length?ac(o,Mt(c,3)):[]}var r5=Ft(function(o){return Zi(Ue(o,1,xe,!0))}),s5=Ft(function(o){var c=Pn(o);return xe(c)&&(c=n),Zi(Ue(o,1,xe,!0),Mt(c,2))}),o5=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Zi(Ue(o,1,xe,!0),n,c)});function a5(o){return o&&o.length?Zi(o):[]}function l5(o,c){return o&&o.length?Zi(o,Mt(c,2)):[]}function c5(o,c){return c=typeof c=="function"?c:n,o&&o.length?Zi(o,n,c):[]}function Qf(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}),mf(c,function(p){return de(o,ff(p))})}function Bb(o,c){if(!(o&&o.length))return[];var p=Qf(o);return c==null?p:de(p,function(y){return yn(c,n,y)})}var u5=Ft(function(o,c){return xe(o)?Zo(o,c):[]}),d5=Ft(function(o){return Nf(qi(o,xe))}),f5=Ft(function(o){var c=Pn(o);return xe(c)&&(c=n),Nf(qi(o,xe),Mt(c,2))}),h5=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Nf(qi(o,xe),n,c)}),p5=Ft(Qf);function m5(o,c){return eb(o||[],c||[],Xo)}function g5(o,c){return eb(o||[],c||[],ta)}var y5=Ft(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,Bb(o,p)});function Fb(o){var c=T(o);return c.__chain__=!0,c}function _5(o,c){return c(o),o}function gc(o,c){return c(o)}var b5=_i(function(o){var c=o.length,p=c?o[0]:0,y=this.__wrapped__,b=function(M){return Sf(M,o)};return c>1||this.__actions__.length||!(y instanceof Ht)||!bi(p)?this.thru(b):(y=y.slice(p,+p+(c?1:0)),y.__actions__.push({func:gc,args:[b],thisArg:n}),new An(y,this.__chain__).thru(function(M){return c&&!M.length&&M.push(n),M}))});function x5(){return Fb(this)}function w5(){return new An(this.value(),this.__chain__)}function v5(){this.__values__===n&&(this.__values__=Qb(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function S5(){return this}function T5(o){for(var c,p=this;p instanceof ec;){var y=Eb(p);y.__index__=0,y.__values__=n,c?b.__wrapped__=y:c=y;var b=y;p=p.__wrapped__}return b.__wrapped__=o,c}function k5(){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:gc,args:[Zf],thisArg:n}),new An(c,this.__chain__)}return this.thru(Zf)}function M5(){return tb(this.__wrapped__,this.__actions__)}var D5=lc(function(o,c,p){Kt.call(o,p)?++o[p]:Jn(o,p,1)});function C5(o,c,p){var y=Pt(o)?h_:_z;return p&&en(o,c,p)&&(c=n),y(o,Mt(c,3))}function O5(o,c){var p=Pt(o)?qi:B_;return p(o,Mt(c,3))}var A5=db(Rb),E5=db(Pb);function R5(o,c){return Ue(yc(o,c),1)}function P5(o,c){return Ue(yc(o,c),vt)}function I5(o,c,p){return p=p===n?1:Nt(p),Ue(yc(o,c),p)}function zb(o,c){var p=Pt(o)?_n:Xi;return p(o,Mt(c,3))}function Ub(o,c){var p=Pt(o)?JB:N_;return p(o,Mt(c,3))}var L5=lc(function(o,c,p){Kt.call(o,p)?o[p].push(c):Jn(o,p,[c])});function N5(o,c,p,y){o=fn(o)?o:Os(o),p=p&&!y?Nt(p):0;var b=o.length;return p<0&&(p=Ae(b+p,0)),vc(o)?p<=b&&o.indexOf(c,p)>-1:!!b&&ys(o,c,p)>-1}var B5=Ft(function(o,c,p){var y=-1,b=typeof c=="function",M=fn(o)?j(o.length):[];return Xi(o,function(E){M[++y]=b?yn(c,E,p):Qo(E,c,p)}),M}),F5=lc(function(o,c,p){Jn(o,p,c)});function yc(o,c){var p=Pt(o)?de:$_;return p(o,Mt(c,3))}function z5(o,c,p,y){return o==null?[]:(Pt(c)||(c=c==null?[]:[c]),p=y?n:p,Pt(p)||(p=p==null?[]:[p]),j_(o,c,p))}var U5=lc(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function H5(o,c,p){var y=Pt(o)?uf:y_,b=arguments.length<3;return y(o,Mt(c,4),p,b,Xi)}function W5(o,c,p){var y=Pt(o)?tF:y_,b=arguments.length<3;return y(o,Mt(c,4),p,b,N_)}function $5(o,c){var p=Pt(o)?qi:B_;return p(o,xc(Mt(c,3)))}function V5(o){var c=Pt(o)?R_:Nz;return c(o)}function Y5(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Nt(c);var y=Pt(o)?hz:Bz;return y(o,c)}function q5(o){var c=Pt(o)?pz:zz;return c(o)}function j5(o){if(o==null)return 0;if(fn(o))return vc(o)?bs(o):o.length;var c=Xe(o);return c==it||c==ae?o.size:Of(o).length}function G5(o,c,p){var y=Pt(o)?df:Uz;return p&&en(o,c,p)&&(c=n),y(o,Mt(c,3))}var K5=Ft(function(o,c){if(o==null)return[];var p=c.length;return p>1&&en(o,c[0],c[1])?c=[]:p>2&&en(c[0],c[1],c[2])&&(c=[c[0]]),j_(o,Ue(c,1),[])}),_c=OF||function(){return ue.Date.now()};function X5(o,c){if(typeof c!="function")throw new On(a);return o=Nt(o),function(){if(--o<1)return c.apply(this,arguments)}}function Hb(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,yi(o,k,n,n,n,n,c)}function Wb(o,c){var p;if(typeof c!="function")throw new On(a);return o=Nt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var Jf=Ft(function(o,c,p){var y=C;if(p.length){var b=Gi(p,Ds(Jf));y|=N}return yi(o,y,c,p,b)}),$b=Ft(function(o,c,p){var y=C|A;if(p.length){var b=Gi(p,Ds($b));y|=N}return yi(c,y,o,p,b)});function Vb(o,c,p){c=p?n:c;var y=yi(o,P,n,n,n,n,n,c);return y.placeholder=Vb.placeholder,y}function Yb(o,c,p){c=p?n:c;var y=yi(o,B,n,n,n,n,n,c);return y.placeholder=Yb.placeholder,y}function qb(o,c,p){var y,b,M,E,R,H,Z=0,Q=!1,et=!1,ft=!0;if(typeof o!="function")throw new On(a);c=In(c)||0,pe(p)&&(Q=!!p.leading,et="maxWait"in p,M=et?Ae(In(p.maxWait)||0,c):M,ft="trailing"in p?!!p.trailing:ft);function wt(we){var Wn=y,vi=b;return y=b=n,Z=we,E=o.apply(vi,Wn),E}function Dt(we){return Z=we,R=ia(Ut,c),Q?wt(we):E}function Bt(we){var Wn=we-H,vi=we-Z,fx=c-Wn;return et?Ke(fx,M-vi):fx}function kt(we){var Wn=we-H,vi=we-Z;return H===n||Wn>=c||Wn<0||et&&vi>=M}function Ut(){var we=_c();if(kt(we))return Wt(we);R=ia(Ut,Bt(we))}function Wt(we){return R=n,ft&&y?wt(we):(y=b=n,E)}function vn(){R!==n&&nb(R),Z=0,y=H=b=R=n}function nn(){return R===n?E:Wt(_c())}function Sn(){var we=_c(),Wn=kt(we);if(y=arguments,b=this,H=we,Wn){if(R===n)return Dt(H);if(et)return nb(R),R=ia(Ut,c),wt(H)}return R===n&&(R=ia(Ut,c)),E}return Sn.cancel=vn,Sn.flush=nn,Sn}var Z5=Ft(function(o,c){return L_(o,1,c)}),Q5=Ft(function(o,c,p){return L_(o,In(c)||0,p)});function J5(o){return yi(o,O)}function bc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new On(a);var p=function(){var y=arguments,b=c?c.apply(this,y):y[0],M=p.cache;if(M.has(b))return M.get(b);var E=o.apply(this,y);return p.cache=M.set(b,E)||M,E};return p.cache=new(bc.Cache||gi),p}bc.Cache=gi;function xc(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 tH(o){return Wb(2,o)}var eH=Hz(function(o,c){c=c.length==1&&Pt(c[0])?de(c[0],bn(Mt())):de(Ue(c,1),bn(Mt()));var p=c.length;return Ft(function(y){for(var b=-1,M=Ke(y.length,p);++b<M;)y[b]=c[b].call(this,y[b]);return yn(o,this,y)})}),th=Ft(function(o,c){var p=Gi(c,Ds(th));return yi(o,N,n,c,p)}),jb=Ft(function(o,c){var p=Gi(c,Ds(jb));return yi(o,z,n,c,p)}),nH=_i(function(o,c){return yi(o,w,n,n,n,c)});function iH(o,c){if(typeof o!="function")throw new On(a);return c=c===n?c:Nt(c),Ft(o,c)}function rH(o,c){if(typeof o!="function")throw new On(a);return c=c==null?0:Ae(Nt(c),0),Ft(function(p){var y=p[c],b=Ji(p,0,c);return y&&ji(b,y),yn(o,this,b)})}function sH(o,c,p){var y=!0,b=!0;if(typeof o!="function")throw new On(a);return pe(p)&&(y="leading"in p?!!p.leading:y,b="trailing"in p?!!p.trailing:b),qb(o,c,{leading:y,maxWait:c,trailing:b})}function oH(o){return Hb(o,1)}function aH(o,c){return th(Ff(c),o)}function lH(){if(!arguments.length)return[];var o=arguments[0];return Pt(o)?o:[o]}function cH(o){return En(o,x)}function uH(o,c){return c=typeof c=="function"?c:n,En(o,x,c)}function dH(o){return En(o,g|x)}function fH(o,c){return c=typeof c=="function"?c:n,En(o,g|x,c)}function hH(o,c){return c==null||I_(o,c,Ie(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var pH=fc(Mf),mH=fc(function(o,c){return o>=c}),Lr=U_((function(){return arguments})())?U_:function(o){return ye(o)&&Kt.call(o,"callee")&&!M_.call(o,"callee")},Pt=j.isArray,gH=a_?bn(a_):Tz;function fn(o){return o!=null&&wc(o.length)&&!xi(o)}function xe(o){return ye(o)&&fn(o)}function yH(o){return o===!0||o===!1||ye(o)&&tn(o)==pt}var tr=EF||fh,_H=l_?bn(l_):kz;function bH(o){return ye(o)&&o.nodeType===1&&!ra(o)}function xH(o){if(o==null)return!0;if(fn(o)&&(Pt(o)||typeof o=="string"||typeof o.splice=="function"||tr(o)||Cs(o)||Lr(o)))return!o.length;var c=Xe(o);if(c==it||c==ae)return!o.size;if(na(o))return!Of(o).length;for(var p in o)if(Kt.call(o,p))return!1;return!0}function wH(o,c){return Jo(o,c)}function vH(o,c,p){p=typeof p=="function"?p:n;var y=p?p(o,c):n;return y===n?Jo(o,c,n,p):!!y}function eh(o){if(!ye(o))return!1;var c=tn(o);return c==Et||c==mt||typeof o.message=="string"&&typeof o.name=="string"&&!ra(o)}function SH(o){return typeof o=="number"&&C_(o)}function xi(o){if(!pe(o))return!1;var c=tn(o);return c==zt||c==G||c==rt||c==Te}function Gb(o){return typeof o=="number"&&o==Nt(o)}function wc(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 ye(o){return o!=null&&typeof o=="object"}var Kb=c_?bn(c_):Dz;function TH(o,c){return o===c||Cf(o,c,Yf(c))}function kH(o,c,p){return p=typeof p=="function"?p:n,Cf(o,c,Yf(c),p)}function MH(o){return Xb(o)&&o!=+o}function DH(o){if(uU(o))throw new Ot(s);return H_(o)}function CH(o){return o===null}function OH(o){return o==null}function Xb(o){return typeof o=="number"||ye(o)&&tn(o)==lt}function ra(o){if(!ye(o)||tn(o)!=_t)return!1;var c=Gl(o);if(c===null)return!0;var p=Kt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Vl.call(p)==kF}var nh=u_?bn(u_):Cz;function AH(o){return Gb(o)&&o>=-at&&o<=at}var Zb=d_?bn(d_):Oz;function vc(o){return typeof o=="string"||!Pt(o)&&ye(o)&&tn(o)==cn}function wn(o){return typeof o=="symbol"||ye(o)&&tn(o)==qt}var Cs=f_?bn(f_):Az;function EH(o){return o===n}function RH(o){return ye(o)&&Xe(o)==re}function PH(o){return ye(o)&&tn(o)==De}var IH=fc(Af),LH=fc(function(o,c){return o<=c});function Qb(o){if(!o)return[];if(fn(o))return vc(o)?Fn(o):dn(o);if(Yo&&o[Yo])return hF(o[Yo]());var c=Xe(o),p=c==it?yf:c==ae?Hl:Os;return p(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===vt||o===-vt){var c=o<0?-1:1;return c*dt}return o===o?o:0}function Nt(o){var c=wi(o),p=c%1;return c===c?p?c-p:c:0}function Jb(o){return o?Er(Nt(o),0,I):0}function In(o){if(typeof o=="number")return o;if(wn(o))return V;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=__(o);var p=Hd.test(o);return p||$d.test(o)?Bn(o.slice(2),p?2:8):Ud.test(o)?V:+o}function tx(o){return ei(o,hn(o))}function NH(o){return o?Er(Nt(o),-at,at):o===0?o:0}function Xt(o){return o==null?"":xn(o)}var BH=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])}),ex=ks(function(o,c){ei(c,hn(c),o)}),nx=ks(function(o,c,p,y){ei(c,hn(c),o,y)}),ih=ks(function(o,c,p,y){ei(c,Ie(c),o,y)}),FH=_i(Sf);function zH(o,c){var p=Ts(o);return c==null?p:P_(p,c)}var UH=Ft(function(o,c){o=ie(o);var p=-1,y=c.length,b=y>2?c[2]:n;for(b&&en(c[0],c[1],b)&&(y=1);++p<y;)for(var M=c[p],E=hn(M),R=-1,H=E.length;++R<H;){var Z=E[R],Q=o[Z];(Q===n||Hn(Q,ws[Z])&&!Kt.call(o,Z))&&(o[Z]=M[Z])}return o}),HH=Ft(function(o){return o.push(n,_b),yn(ix,n,o)});function WH(o,c){return p_(o,Mt(c,3),ti)}function $H(o,c){return p_(o,Mt(c,3),kf)}function VH(o,c){return o==null?o:Tf(o,Mt(c,3),hn)}function YH(o,c){return o==null?o:F_(o,Mt(c,3),hn)}function qH(o,c){return o&&ti(o,Mt(c,3))}function jH(o,c){return o&&kf(o,Mt(c,3))}function GH(o){return o==null?[]:rc(o,Ie(o))}function KH(o){return o==null?[]:rc(o,hn(o))}function rh(o,c,p){var y=o==null?n:Rr(o,c);return y===n?p:y}function XH(o,c){return o!=null&&wb(o,c,xz)}function sh(o,c){return o!=null&&wb(o,c,wz)}var ZH=hb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Yl.call(c)),o[c]=p},ah(pn)),QH=hb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Yl.call(c)),Kt.call(o,c)?o[c].push(p):o[c]=[p]},Mt),JH=Ft(Qo);function Ie(o){return fn(o)?E_(o):Of(o)}function hn(o){return fn(o)?E_(o,!0):Ez(o)}function tW(o,c){var p={};return c=Mt(c,3),ti(o,function(y,b,M){Jn(p,c(y,b,M),y)}),p}function eW(o,c){var p={};return c=Mt(c,3),ti(o,function(y,b,M){Jn(p,b,c(y,b,M))}),p}var nW=ks(function(o,c,p){sc(o,c,p)}),ix=ks(function(o,c,p,y){sc(o,c,p,y)}),iW=_i(function(o,c){var p={};if(o==null)return p;var y=!1;c=de(c,function(M){return M=Qi(M,o),y||(y=M.length>1),M}),ei(o,$f(o),p),y&&(p=En(p,g|_|x,Qz));for(var b=c.length;b--;)Lf(p,c[b]);return p});function rW(o,c){return rx(o,xc(Mt(c)))}var sW=_i(function(o,c){return o==null?{}:Pz(o,c)});function rx(o,c){if(o==null)return{};var p=de($f(o),function(y){return[y]});return c=Mt(c),G_(o,p,function(y,b){return c(y,b[0])})}function oW(o,c,p){c=Qi(c,o);var y=-1,b=c.length;for(b||(b=1,o=n);++y<b;){var M=o==null?n:o[Un(c[y])];M===n&&(y=b,M=p),o=xi(M)?M.call(o):M}return o}function aW(o,c,p){return o==null?o:ta(o,c,p)}function lW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:ta(o,c,p,y)}var sx=gb(Ie),ox=gb(hn);function cW(o,c,p){var y=Pt(o),b=y||tr(o)||Cs(o);if(c=Mt(c,4),p==null){var M=o&&o.constructor;b?p=y?new M:[]:pe(o)?p=xi(M)?Ts(Gl(o)):{}:p={}}return(b?_n:ti)(o,function(E,R,H){return c(p,E,R,H)}),p}function uW(o,c){return o==null?!0:Lf(o,c)}function dW(o,c,p){return o==null?o:J_(o,c,Ff(p))}function fW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:J_(o,c,Ff(p),y)}function Os(o){return o==null?[]:gf(o,Ie(o))}function hW(o){return o==null?[]:gf(o,hn(o))}function pW(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 mW(o,c,p){return c=wi(c),p===n?(p=c,c=0):p=wi(p),o=In(o),vz(o,c,p)}function gW(o,c,p){if(p&&typeof p!="boolean"&&en(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 y=o;o=c,c=y}if(p||o%1||c%1){var b=O_();return Ke(o+b*(c-o+Ge("1e-"+((b+"").length-1))),c)}return Rf(o,c)}var yW=Ms(function(o,c,p){return c=c.toLowerCase(),o+(p?ax(c):c)});function ax(o){return oh(Xt(o).toLowerCase())}function lx(o){return o=Xt(o),o&&o.replace(Vd,lF).replace(sf,"")}function _W(o,c,p){o=Xt(o),c=xn(c);var y=o.length;p=p===n?y:Er(Nt(p),0,y);var b=p;return p-=c.length,p>=0&&o.slice(p,b)==c}function bW(o){return o=Xt(o),o&&Ad.test(o)?o.replace(bl,cF):o}function xW(o){return o=Xt(o),o&&Id.test(o)?o.replace(Lo,"\\$&"):o}var wW=Ms(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),vW=Ms(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),SW=ub("toLowerCase");function TW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return dc(Ql(b),p)+o+dc(Zl(b),p)}function kW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;return c&&y<c?o+dc(c-y,p):o}function MW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;return c&&y<c?dc(c-y,p)+o:o}function DW(o,c,p){return p||c==null?c=0:c&&(c=+c),LF(Xt(o).replace(No,""),c||0)}function CW(o,c,p){return(p?en(o,c,p):c===n)?c=1:c=Nt(c),Pf(Xt(o),c)}function OW(){var o=arguments,c=Xt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var AW=Ms(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function EW(o,c,p){return p&&typeof p!="number"&&en(o,c,p)&&(c=p=n),p=p===n?I:p>>>0,p?(o=Xt(o),o&&(typeof c=="string"||c!=null&&!nh(c))&&(c=xn(c),!c&&_s(o))?Ji(Fn(o),0,p):o.split(c,p)):[]}var RW=Ms(function(o,c,p){return o+(p?" ":"")+oh(c)});function PW(o,c,p){return o=Xt(o),p=p==null?0:Er(Nt(p),0,o.length),c=xn(c),o.slice(p,p+c.length)==c}function IW(o,c,p){var y=T.templateSettings;p&&en(o,c,p)&&(c=n),o=Xt(o),c=ih({},c,y,yb);var b=ih({},c.imports,y.imports,yb),M=Ie(b),E=gf(b,M);_n(M,function(kt){if(wl.test(kt))throw new Ot(u)});var R,H,Z=0,Q=c.interpolate||ls,et="__p += '",ft=_f((c.escape||ls).source+"|"+Q.source+"|"+(Q===Io?Vi:ls).source+"|"+(c.evaluate||ls).source+"|$","g"),wt="//# sourceURL="+(Kt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++lf+"]")+`
|
|
10
|
-
`;o.replace(ft,function(kt,Ut,Wt,vn,nn,Sn){return Wt||(Wt=vn),et+=o.slice(Z,Sn).replace(Yd,
|
|
9
|
+
`)}function oU(o){return Pt(o)||Lr(o)||!!(D_&&o&&o[D_])}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 en(o,c,p){if(!pe(p))return!1;var y=typeof c;return(y=="number"?fn(p)&&bi(c,p.length):y=="string"&&c in p)?Hn(p[c],o):!1}function jf(o,c){if(Pt(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||wn(o)?!0:hi.test(o)||!xl.test(o)||c!=null&&o in ie(c)}function aU(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Gf(o){var c=hc(o),p=T[c];if(typeof p!="function"||!(c in Ht.prototype))return!1;if(o===p)return!0;var y=Vf(p);return!!y&&o===y[0]}function lU(o){return!!S_&&S_ in o}var cU=$l?xi:fh;function na(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||ws;return o===p}function Sb(o){return o===o&&!pe(o)}function Tb(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in ie(p))}}function uU(o){var c=bc(o,function(y){return p.size===h&&p.clear(),y}),p=c.cache;return c}function dU(o,c){var p=o[1],y=c[1],b=p|y,M=b<(C|A|k),E=y==k&&p==P||y==k&&p==w&&o[7].length<=c[8]||y==(k|w)&&c[7].length<=c[8]&&p==P;if(!(M||E))return o;y&C&&(o[2]=c[2],b|=p&C?0:F);var R=c[3];if(R){var H=o[3];o[3]=H?ob(H,R,c[4]):R,o[4]=H?Gi(o[3],m):c[4]}return R=c[5],R&&(H=o[5],o[5]=H?ab(H,R,c[6]):R,o[6]=H?Gi(o[5],m):c[6]),R=c[7],R&&(o[7]=R),y&k&&(o[8]=o[8]==null?c[8]:Ke(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function fU(o){var c=[];if(o!=null)for(var p in ie(o))c.push(p);return c}function hU(o){return Yl.call(o)}function kb(o,c,p){return c=Ae(c===n?o.length-1:c,0),function(){for(var y=arguments,b=-1,M=Ae(y.length-c,0),E=j(M);++b<M;)E[b]=y[c+b];b=-1;for(var R=j(c+1);++b<c;)R[b]=y[b];return R[c]=p(E),yn(o,this,R)}}function Mb(o,c){return c.length<2?o:Rr(o,Rn(c,0,-1))}function pU(o,c){for(var p=o.length,y=Ke(c.length,p),b=dn(o);y--;){var M=c[y];o[y]=bi(M,p)?b[M]:n}return o}function Kf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Db=Ob(X_),ia=OF||function(o,c){return ue.setTimeout(o,c)},Xf=Ob(Bz);function Cb(o,c,p){var y=c+"";return Xf(o,sU(y,mU(nU(y),p)))}function Ob(o){var c=0,p=0;return function(){var y=PF(),b=st-(y-p);if(p=y,b>0){if(++c>=q)return arguments[0]}else c=0;return o.apply(n,arguments)}}function mc(o,c){var p=-1,y=o.length,b=y-1;for(c=c===n?y:c;++p<c;){var M=Rf(p,b),E=o[M];o[M]=o[p],o[p]=E}return o.length=c,o}var Ab=uU(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Pd,function(p,y,b,M){c.push(b?M.replace(zd,"$1"):y||p)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Ir(o){if(o!=null){try{return Vl.call(o)}catch{}try{return o+""}catch{}}return""}function mU(o,c){return _n(ot,function(p){var y="_."+p[0];c&p[1]&&!zl(o,y)&&o.push(y)}),o.sort()}function Eb(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 gU(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Ae(Nt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,M=0,E=j(Zl(y/c));b<y;)E[M++]=Rn(o,b,b+=c);return E}function yU(o){for(var c=-1,p=o==null?0:o.length,y=0,b=[];++c<p;){var M=o[c];M&&(b[y++]=M)}return b}function _U(){var o=arguments.length;if(!o)return[];for(var c=j(o-1),p=arguments[0],y=o;y--;)c[y-1]=arguments[y];return ji(Pt(p)?dn(p):[p],Ue(c,1))}var bU=Ft(function(o,c){return xe(o)?Zo(o,Ue(c,1,xe,!0)):[]}),xU=Ft(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),Mt(p,2)):[]}),wU=Ft(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),n,p):[]});function vU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),Rn(o,c<0?0:c,y)):[]}function SU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),c=y-c,Rn(o,0,c<0?0:c)):[]}function TU(o,c){return o&&o.length?ac(o,Mt(c,3),!0,!0):[]}function kU(o,c){return o&&o.length?ac(o,Mt(c,3),!0):[]}function MU(o,c,p,y){var b=o==null?0:o.length;return b?(p&&typeof p!="number"&&en(o,c,p)&&(p=0,y=b),_z(o,c,p,y)):[]}function Rb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Nt(p);return b<0&&(b=Ae(y+b,0)),Ul(o,Mt(c,3),b)}function Pb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return p!==n&&(b=Nt(p),b=p<0?Ae(y+b,0):Ke(b,y-1)),Ul(o,Mt(c,3),b,!0)}function Ib(o){var c=o==null?0:o.length;return c?Ue(o,1):[]}function DU(o){var c=o==null?0:o.length;return c?Ue(o,vt):[]}function CU(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:Nt(c),Ue(o,c)):[]}function OU(o){for(var c=-1,p=o==null?0:o.length,y={};++c<p;){var b=o[c];Jn(y,b[0],b[1])}return y}function Lb(o){return o&&o.length?o[0]:n}function AU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Nt(p);return b<0&&(b=Ae(y+b,0)),ys(o,c,b)}function EU(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var RU=Ft(function(o){var c=de(o,Bf);return c.length&&c[0]===o[0]?Df(c):[]}),PU=Ft(function(o){var c=Pn(o),p=de(o,Bf);return c===Pn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?Df(p,Mt(c,2)):[]}),IU=Ft(function(o){var c=Pn(o),p=de(o,Bf);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?Df(p,n,c):[]});function LU(o,c){return o==null?"":EF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function NU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y;return p!==n&&(b=Nt(p),b=b<0?Ae(y+b,0):Ke(b,y-1)),c===c?mF(o,c,b):Ul(o,m_,b,!0)}function BU(o,c){return o&&o.length?q_(o,Nt(c)):n}var FU=Ft(Nb);function Nb(o,c){return o&&o.length&&c&&c.length?Ef(o,c):o}function zU(o,c,p){return o&&o.length&&c&&c.length?Ef(o,c,Mt(p,2)):o}function UU(o,c,p){return o&&o.length&&c&&c.length?Ef(o,c,n,p):o}var HU=_i(function(o,c){var p=o==null?0:o.length,y=Sf(o,c);return K_(o,de(c,function(b){return bi(b,p)?+b:b}).sort(sb)),y});function WU(o,c){var p=[];if(!(o&&o.length))return p;var y=-1,b=[],M=o.length;for(c=Mt(c,3);++y<M;){var E=o[y];c(E,y,o)&&(p.push(E),b.push(y))}return K_(o,b),p}function Zf(o){return o==null?o:LF.call(o)}function $U(o,c,p){var y=o==null?0:o.length;return y?(p&&typeof p!="number"&&en(o,c,p)?(c=0,p=y):(c=c==null?0:Nt(c),p=p===n?y:Nt(p)),Rn(o,c,p)):[]}function VU(o,c){return oc(o,c)}function YU(o,c,p){return If(o,c,Mt(p,2))}function qU(o,c){var p=o==null?0:o.length;if(p){var y=oc(o,c);if(y<p&&Hn(o[y],c))return y}return-1}function jU(o,c){return oc(o,c,!0)}function GU(o,c,p){return If(o,c,Mt(p,2),!0)}function KU(o,c){var p=o==null?0:o.length;if(p){var y=oc(o,c,!0)-1;if(Hn(o[y],c))return y}return-1}function XU(o){return o&&o.length?Z_(o):[]}function ZU(o,c){return o&&o.length?Z_(o,Mt(c,2)):[]}function QU(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function JU(o,c,p){return o&&o.length?(c=p||c===n?1:Nt(c),Rn(o,0,c<0?0:c)):[]}function t5(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),c=y-c,Rn(o,c<0?0:c,y)):[]}function e5(o,c){return o&&o.length?ac(o,Mt(c,3),!1,!0):[]}function n5(o,c){return o&&o.length?ac(o,Mt(c,3)):[]}var i5=Ft(function(o){return Zi(Ue(o,1,xe,!0))}),r5=Ft(function(o){var c=Pn(o);return xe(c)&&(c=n),Zi(Ue(o,1,xe,!0),Mt(c,2))}),s5=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Zi(Ue(o,1,xe,!0),n,c)});function o5(o){return o&&o.length?Zi(o):[]}function a5(o,c){return o&&o.length?Zi(o,Mt(c,2)):[]}function l5(o,c){return c=typeof c=="function"?c:n,o&&o.length?Zi(o,n,c):[]}function Qf(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}),mf(c,function(p){return de(o,ff(p))})}function Bb(o,c){if(!(o&&o.length))return[];var p=Qf(o);return c==null?p:de(p,function(y){return yn(c,n,y)})}var c5=Ft(function(o,c){return xe(o)?Zo(o,c):[]}),u5=Ft(function(o){return Nf(qi(o,xe))}),d5=Ft(function(o){var c=Pn(o);return xe(c)&&(c=n),Nf(qi(o,xe),Mt(c,2))}),f5=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Nf(qi(o,xe),n,c)}),h5=Ft(Qf);function p5(o,c){return eb(o||[],c||[],Xo)}function m5(o,c){return eb(o||[],c||[],ta)}var g5=Ft(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,Bb(o,p)});function Fb(o){var c=T(o);return c.__chain__=!0,c}function y5(o,c){return c(o),o}function gc(o,c){return c(o)}var _5=_i(function(o){var c=o.length,p=c?o[0]:0,y=this.__wrapped__,b=function(M){return Sf(M,o)};return c>1||this.__actions__.length||!(y instanceof Ht)||!bi(p)?this.thru(b):(y=y.slice(p,+p+(c?1:0)),y.__actions__.push({func:gc,args:[b],thisArg:n}),new An(y,this.__chain__).thru(function(M){return c&&!M.length&&M.push(n),M}))});function b5(){return Fb(this)}function x5(){return new An(this.value(),this.__chain__)}function w5(){this.__values__===n&&(this.__values__=Qb(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function v5(){return this}function S5(o){for(var c,p=this;p instanceof ec;){var y=Eb(p);y.__index__=0,y.__values__=n,c?b.__wrapped__=y:c=y;var b=y;p=p.__wrapped__}return b.__wrapped__=o,c}function T5(){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:gc,args:[Zf],thisArg:n}),new An(c,this.__chain__)}return this.thru(Zf)}function k5(){return tb(this.__wrapped__,this.__actions__)}var M5=lc(function(o,c,p){Kt.call(o,p)?++o[p]:Jn(o,p,1)});function D5(o,c,p){var y=Pt(o)?h_:yz;return p&&en(o,c,p)&&(c=n),y(o,Mt(c,3))}function C5(o,c){var p=Pt(o)?qi:B_;return p(o,Mt(c,3))}var O5=db(Rb),A5=db(Pb);function E5(o,c){return Ue(yc(o,c),1)}function R5(o,c){return Ue(yc(o,c),vt)}function P5(o,c,p){return p=p===n?1:Nt(p),Ue(yc(o,c),p)}function zb(o,c){var p=Pt(o)?_n:Xi;return p(o,Mt(c,3))}function Ub(o,c){var p=Pt(o)?QB:N_;return p(o,Mt(c,3))}var I5=lc(function(o,c,p){Kt.call(o,p)?o[p].push(c):Jn(o,p,[c])});function L5(o,c,p,y){o=fn(o)?o:Os(o),p=p&&!y?Nt(p):0;var b=o.length;return p<0&&(p=Ae(b+p,0)),vc(o)?p<=b&&o.indexOf(c,p)>-1:!!b&&ys(o,c,p)>-1}var N5=Ft(function(o,c,p){var y=-1,b=typeof c=="function",M=fn(o)?j(o.length):[];return Xi(o,function(E){M[++y]=b?yn(c,E,p):Qo(E,c,p)}),M}),B5=lc(function(o,c,p){Jn(o,p,c)});function yc(o,c){var p=Pt(o)?de:$_;return p(o,Mt(c,3))}function F5(o,c,p,y){return o==null?[]:(Pt(c)||(c=c==null?[]:[c]),p=y?n:p,Pt(p)||(p=p==null?[]:[p]),j_(o,c,p))}var z5=lc(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function U5(o,c,p){var y=Pt(o)?uf:y_,b=arguments.length<3;return y(o,Mt(c,4),p,b,Xi)}function H5(o,c,p){var y=Pt(o)?JB:y_,b=arguments.length<3;return y(o,Mt(c,4),p,b,N_)}function W5(o,c){var p=Pt(o)?qi:B_;return p(o,xc(Mt(c,3)))}function $5(o){var c=Pt(o)?R_:Lz;return c(o)}function V5(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Nt(c);var y=Pt(o)?fz:Nz;return y(o,c)}function Y5(o){var c=Pt(o)?hz:Fz;return c(o)}function q5(o){if(o==null)return 0;if(fn(o))return vc(o)?bs(o):o.length;var c=Xe(o);return c==it||c==ae?o.size:Of(o).length}function j5(o,c,p){var y=Pt(o)?df:zz;return p&&en(o,c,p)&&(c=n),y(o,Mt(c,3))}var G5=Ft(function(o,c){if(o==null)return[];var p=c.length;return p>1&&en(o,c[0],c[1])?c=[]:p>2&&en(c[0],c[1],c[2])&&(c=[c[0]]),j_(o,Ue(c,1),[])}),_c=CF||function(){return ue.Date.now()};function K5(o,c){if(typeof c!="function")throw new On(a);return o=Nt(o),function(){if(--o<1)return c.apply(this,arguments)}}function Hb(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,yi(o,k,n,n,n,n,c)}function Wb(o,c){var p;if(typeof c!="function")throw new On(a);return o=Nt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var Jf=Ft(function(o,c,p){var y=C;if(p.length){var b=Gi(p,Ds(Jf));y|=N}return yi(o,y,c,p,b)}),$b=Ft(function(o,c,p){var y=C|A;if(p.length){var b=Gi(p,Ds($b));y|=N}return yi(c,y,o,p,b)});function Vb(o,c,p){c=p?n:c;var y=yi(o,P,n,n,n,n,n,c);return y.placeholder=Vb.placeholder,y}function Yb(o,c,p){c=p?n:c;var y=yi(o,B,n,n,n,n,n,c);return y.placeholder=Yb.placeholder,y}function qb(o,c,p){var y,b,M,E,R,H,Z=0,Q=!1,et=!1,ft=!0;if(typeof o!="function")throw new On(a);c=In(c)||0,pe(p)&&(Q=!!p.leading,et="maxWait"in p,M=et?Ae(In(p.maxWait)||0,c):M,ft="trailing"in p?!!p.trailing:ft);function wt(we){var Wn=y,vi=b;return y=b=n,Z=we,E=o.apply(vi,Wn),E}function Dt(we){return Z=we,R=ia(Ut,c),Q?wt(we):E}function Bt(we){var Wn=we-H,vi=we-Z,fx=c-Wn;return et?Ke(fx,M-vi):fx}function kt(we){var Wn=we-H,vi=we-Z;return H===n||Wn>=c||Wn<0||et&&vi>=M}function Ut(){var we=_c();if(kt(we))return Wt(we);R=ia(Ut,Bt(we))}function Wt(we){return R=n,ft&&y?wt(we):(y=b=n,E)}function vn(){R!==n&&nb(R),Z=0,y=H=b=R=n}function nn(){return R===n?E:Wt(_c())}function Sn(){var we=_c(),Wn=kt(we);if(y=arguments,b=this,H=we,Wn){if(R===n)return Dt(H);if(et)return nb(R),R=ia(Ut,c),wt(H)}return R===n&&(R=ia(Ut,c)),E}return Sn.cancel=vn,Sn.flush=nn,Sn}var X5=Ft(function(o,c){return L_(o,1,c)}),Z5=Ft(function(o,c,p){return L_(o,In(c)||0,p)});function Q5(o){return yi(o,O)}function bc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new On(a);var p=function(){var y=arguments,b=c?c.apply(this,y):y[0],M=p.cache;if(M.has(b))return M.get(b);var E=o.apply(this,y);return p.cache=M.set(b,E)||M,E};return p.cache=new(bc.Cache||gi),p}bc.Cache=gi;function xc(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 J5(o){return Wb(2,o)}var tH=Uz(function(o,c){c=c.length==1&&Pt(c[0])?de(c[0],bn(Mt())):de(Ue(c,1),bn(Mt()));var p=c.length;return Ft(function(y){for(var b=-1,M=Ke(y.length,p);++b<M;)y[b]=c[b].call(this,y[b]);return yn(o,this,y)})}),th=Ft(function(o,c){var p=Gi(c,Ds(th));return yi(o,N,n,c,p)}),jb=Ft(function(o,c){var p=Gi(c,Ds(jb));return yi(o,z,n,c,p)}),eH=_i(function(o,c){return yi(o,w,n,n,n,c)});function nH(o,c){if(typeof o!="function")throw new On(a);return c=c===n?c:Nt(c),Ft(o,c)}function iH(o,c){if(typeof o!="function")throw new On(a);return c=c==null?0:Ae(Nt(c),0),Ft(function(p){var y=p[c],b=Ji(p,0,c);return y&&ji(b,y),yn(o,this,b)})}function rH(o,c,p){var y=!0,b=!0;if(typeof o!="function")throw new On(a);return pe(p)&&(y="leading"in p?!!p.leading:y,b="trailing"in p?!!p.trailing:b),qb(o,c,{leading:y,maxWait:c,trailing:b})}function sH(o){return Hb(o,1)}function oH(o,c){return th(Ff(c),o)}function aH(){if(!arguments.length)return[];var o=arguments[0];return Pt(o)?o:[o]}function lH(o){return En(o,x)}function cH(o,c){return c=typeof c=="function"?c:n,En(o,x,c)}function uH(o){return En(o,g|x)}function dH(o,c){return c=typeof c=="function"?c:n,En(o,g|x,c)}function fH(o,c){return c==null||I_(o,c,Ie(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var hH=fc(Mf),pH=fc(function(o,c){return o>=c}),Lr=U_((function(){return arguments})())?U_:function(o){return ye(o)&&Kt.call(o,"callee")&&!M_.call(o,"callee")},Pt=j.isArray,mH=a_?bn(a_):Sz;function fn(o){return o!=null&&wc(o.length)&&!xi(o)}function xe(o){return ye(o)&&fn(o)}function gH(o){return o===!0||o===!1||ye(o)&&tn(o)==pt}var tr=AF||fh,yH=l_?bn(l_):Tz;function _H(o){return ye(o)&&o.nodeType===1&&!ra(o)}function bH(o){if(o==null)return!0;if(fn(o)&&(Pt(o)||typeof o=="string"||typeof o.splice=="function"||tr(o)||Cs(o)||Lr(o)))return!o.length;var c=Xe(o);if(c==it||c==ae)return!o.size;if(na(o))return!Of(o).length;for(var p in o)if(Kt.call(o,p))return!1;return!0}function xH(o,c){return Jo(o,c)}function wH(o,c,p){p=typeof p=="function"?p:n;var y=p?p(o,c):n;return y===n?Jo(o,c,n,p):!!y}function eh(o){if(!ye(o))return!1;var c=tn(o);return c==Et||c==mt||typeof o.message=="string"&&typeof o.name=="string"&&!ra(o)}function vH(o){return typeof o=="number"&&C_(o)}function xi(o){if(!pe(o))return!1;var c=tn(o);return c==zt||c==G||c==rt||c==Te}function Gb(o){return typeof o=="number"&&o==Nt(o)}function wc(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 ye(o){return o!=null&&typeof o=="object"}var Kb=c_?bn(c_):Mz;function SH(o,c){return o===c||Cf(o,c,Yf(c))}function TH(o,c,p){return p=typeof p=="function"?p:n,Cf(o,c,Yf(c),p)}function kH(o){return Xb(o)&&o!=+o}function MH(o){if(cU(o))throw new Ot(s);return H_(o)}function DH(o){return o===null}function CH(o){return o==null}function Xb(o){return typeof o=="number"||ye(o)&&tn(o)==lt}function ra(o){if(!ye(o)||tn(o)!=_t)return!1;var c=Gl(o);if(c===null)return!0;var p=Kt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Vl.call(p)==TF}var nh=u_?bn(u_):Dz;function OH(o){return Gb(o)&&o>=-at&&o<=at}var Zb=d_?bn(d_):Cz;function vc(o){return typeof o=="string"||!Pt(o)&&ye(o)&&tn(o)==cn}function wn(o){return typeof o=="symbol"||ye(o)&&tn(o)==qt}var Cs=f_?bn(f_):Oz;function AH(o){return o===n}function EH(o){return ye(o)&&Xe(o)==re}function RH(o){return ye(o)&&tn(o)==De}var PH=fc(Af),IH=fc(function(o,c){return o<=c});function Qb(o){if(!o)return[];if(fn(o))return vc(o)?Fn(o):dn(o);if(Yo&&o[Yo])return fF(o[Yo]());var c=Xe(o),p=c==it?yf:c==ae?Hl:Os;return p(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===vt||o===-vt){var c=o<0?-1:1;return c*dt}return o===o?o:0}function Nt(o){var c=wi(o),p=c%1;return c===c?p?c-p:c:0}function Jb(o){return o?Er(Nt(o),0,I):0}function In(o){if(typeof o=="number")return o;if(wn(o))return V;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=__(o);var p=Hd.test(o);return p||$d.test(o)?Bn(o.slice(2),p?2:8):Ud.test(o)?V:+o}function tx(o){return ei(o,hn(o))}function LH(o){return o?Er(Nt(o),-at,at):o===0?o:0}function Xt(o){return o==null?"":xn(o)}var NH=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])}),ex=ks(function(o,c){ei(c,hn(c),o)}),nx=ks(function(o,c,p,y){ei(c,hn(c),o,y)}),ih=ks(function(o,c,p,y){ei(c,Ie(c),o,y)}),BH=_i(Sf);function FH(o,c){var p=Ts(o);return c==null?p:P_(p,c)}var zH=Ft(function(o,c){o=ie(o);var p=-1,y=c.length,b=y>2?c[2]:n;for(b&&en(c[0],c[1],b)&&(y=1);++p<y;)for(var M=c[p],E=hn(M),R=-1,H=E.length;++R<H;){var Z=E[R],Q=o[Z];(Q===n||Hn(Q,ws[Z])&&!Kt.call(o,Z))&&(o[Z]=M[Z])}return o}),UH=Ft(function(o){return o.push(n,_b),yn(ix,n,o)});function HH(o,c){return p_(o,Mt(c,3),ti)}function WH(o,c){return p_(o,Mt(c,3),kf)}function $H(o,c){return o==null?o:Tf(o,Mt(c,3),hn)}function VH(o,c){return o==null?o:F_(o,Mt(c,3),hn)}function YH(o,c){return o&&ti(o,Mt(c,3))}function qH(o,c){return o&&kf(o,Mt(c,3))}function jH(o){return o==null?[]:rc(o,Ie(o))}function GH(o){return o==null?[]:rc(o,hn(o))}function rh(o,c,p){var y=o==null?n:Rr(o,c);return y===n?p:y}function KH(o,c){return o!=null&&wb(o,c,bz)}function sh(o,c){return o!=null&&wb(o,c,xz)}var XH=hb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Yl.call(c)),o[c]=p},ah(pn)),ZH=hb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Yl.call(c)),Kt.call(o,c)?o[c].push(p):o[c]=[p]},Mt),QH=Ft(Qo);function Ie(o){return fn(o)?E_(o):Of(o)}function hn(o){return fn(o)?E_(o,!0):Az(o)}function JH(o,c){var p={};return c=Mt(c,3),ti(o,function(y,b,M){Jn(p,c(y,b,M),y)}),p}function tW(o,c){var p={};return c=Mt(c,3),ti(o,function(y,b,M){Jn(p,b,c(y,b,M))}),p}var eW=ks(function(o,c,p){sc(o,c,p)}),ix=ks(function(o,c,p,y){sc(o,c,p,y)}),nW=_i(function(o,c){var p={};if(o==null)return p;var y=!1;c=de(c,function(M){return M=Qi(M,o),y||(y=M.length>1),M}),ei(o,$f(o),p),y&&(p=En(p,g|_|x,Zz));for(var b=c.length;b--;)Lf(p,c[b]);return p});function iW(o,c){return rx(o,xc(Mt(c)))}var rW=_i(function(o,c){return o==null?{}:Rz(o,c)});function rx(o,c){if(o==null)return{};var p=de($f(o),function(y){return[y]});return c=Mt(c),G_(o,p,function(y,b){return c(y,b[0])})}function sW(o,c,p){c=Qi(c,o);var y=-1,b=c.length;for(b||(b=1,o=n);++y<b;){var M=o==null?n:o[Un(c[y])];M===n&&(y=b,M=p),o=xi(M)?M.call(o):M}return o}function oW(o,c,p){return o==null?o:ta(o,c,p)}function aW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:ta(o,c,p,y)}var sx=gb(Ie),ox=gb(hn);function lW(o,c,p){var y=Pt(o),b=y||tr(o)||Cs(o);if(c=Mt(c,4),p==null){var M=o&&o.constructor;b?p=y?new M:[]:pe(o)?p=xi(M)?Ts(Gl(o)):{}:p={}}return(b?_n:ti)(o,function(E,R,H){return c(p,E,R,H)}),p}function cW(o,c){return o==null?!0:Lf(o,c)}function uW(o,c,p){return o==null?o:J_(o,c,Ff(p))}function dW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:J_(o,c,Ff(p),y)}function Os(o){return o==null?[]:gf(o,Ie(o))}function fW(o){return o==null?[]:gf(o,hn(o))}function hW(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 pW(o,c,p){return c=wi(c),p===n?(p=c,c=0):p=wi(p),o=In(o),wz(o,c,p)}function mW(o,c,p){if(p&&typeof p!="boolean"&&en(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 y=o;o=c,c=y}if(p||o%1||c%1){var b=O_();return Ke(o+b*(c-o+Ge("1e-"+((b+"").length-1))),c)}return Rf(o,c)}var gW=Ms(function(o,c,p){return c=c.toLowerCase(),o+(p?ax(c):c)});function ax(o){return oh(Xt(o).toLowerCase())}function lx(o){return o=Xt(o),o&&o.replace(Vd,aF).replace(sf,"")}function yW(o,c,p){o=Xt(o),c=xn(c);var y=o.length;p=p===n?y:Er(Nt(p),0,y);var b=p;return p-=c.length,p>=0&&o.slice(p,b)==c}function _W(o){return o=Xt(o),o&&Ad.test(o)?o.replace(bl,lF):o}function bW(o){return o=Xt(o),o&&Id.test(o)?o.replace(Lo,"\\$&"):o}var xW=Ms(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),wW=Ms(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),vW=ub("toLowerCase");function SW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return dc(Ql(b),p)+o+dc(Zl(b),p)}function TW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;return c&&y<c?o+dc(c-y,p):o}function kW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;return c&&y<c?dc(c-y,p)+o:o}function MW(o,c,p){return p||c==null?c=0:c&&(c=+c),IF(Xt(o).replace(No,""),c||0)}function DW(o,c,p){return(p?en(o,c,p):c===n)?c=1:c=Nt(c),Pf(Xt(o),c)}function CW(){var o=arguments,c=Xt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var OW=Ms(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function AW(o,c,p){return p&&typeof p!="number"&&en(o,c,p)&&(c=p=n),p=p===n?I:p>>>0,p?(o=Xt(o),o&&(typeof c=="string"||c!=null&&!nh(c))&&(c=xn(c),!c&&_s(o))?Ji(Fn(o),0,p):o.split(c,p)):[]}var EW=Ms(function(o,c,p){return o+(p?" ":"")+oh(c)});function RW(o,c,p){return o=Xt(o),p=p==null?0:Er(Nt(p),0,o.length),c=xn(c),o.slice(p,p+c.length)==c}function PW(o,c,p){var y=T.templateSettings;p&&en(o,c,p)&&(c=n),o=Xt(o),c=ih({},c,y,yb);var b=ih({},c.imports,y.imports,yb),M=Ie(b),E=gf(b,M);_n(M,function(kt){if(wl.test(kt))throw new Ot(u)});var R,H,Z=0,Q=c.interpolate||ls,et="__p += '",ft=_f((c.escape||ls).source+"|"+Q.source+"|"+(Q===Io?Vi:ls).source+"|"+(c.evaluate||ls).source+"|$","g"),wt="//# sourceURL="+(Kt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++lf+"]")+`
|
|
10
|
+
`;o.replace(ft,function(kt,Ut,Wt,vn,nn,Sn){return Wt||(Wt=vn),et+=o.slice(Z,Sn).replace(Yd,cF),Ut&&(R=!0,et+=`' +
|
|
11
11
|
__e(`+Ut+`) +
|
|
12
12
|
'`),nn&&(H=!0,et+=`';
|
|
13
13
|
`+nn+`;
|
|
@@ -23,7 +23,7 @@ __p += '`),Wt&&(et+=`' +
|
|
|
23
23
|
function print() { __p += __j.call(arguments, '') }
|
|
24
24
|
`:`;
|
|
25
25
|
`)+et+`return __p
|
|
26
|
-
}`;var Bt=ux(function(){return jt(M,wt+"return "+et).apply(n,E)});if(Bt.source=et,eh(Bt))throw Bt;return Bt}function LW(o){return Xt(o).toLowerCase()}function NW(o){return Xt(o).toUpperCase()}function BW(o,c,p){if(o=Xt(o),o&&(p||c===n))return __(o);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=Fn(c),M=b_(y,b),E=x_(y,b)+1;return Ji(y,M,E).join("")}function FW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.slice(0,v_(o)+1);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=x_(y,Fn(c))+1;return Ji(y,0,b).join("")}function zW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.replace(No,"");if(!o||!(c=xn(c)))return o;var y=Fn(o),b=b_(y,Fn(c));return Ji(y,b).join("")}function UW(o,c){var p=L,y=$;if(pe(c)){var b="separator"in c?c.separator:b;p="length"in c?Nt(c.length):p,y="omission"in c?xn(c.omission):y}o=Xt(o);var M=o.length;if(_s(o)){var E=Fn(o);M=E.length}if(p>=M)return o;var R=p-bs(y);if(R<1)return y;var H=E?Ji(E,0,R).join(""):o.slice(0,R);if(b===n)return H+y;if(E&&(R+=H.length-R),nh(b)){if(o.slice(R).search(b)){var Z,Q=H;for(b.global||(b=_f(b.source,Xt(vl.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var et=Z.index;H=H.slice(0,et===n?R:et)}}else if(o.indexOf(xn(b),R)!=R){var ft=H.lastIndexOf(b);ft>-1&&(H=H.slice(0,ft))}return H+y}function HW(o){return o=Xt(o),o&&Od.test(o)?o.replace($i,yF):o}var WW=Ms(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),oh=ub("toUpperCase");function cx(o,c,p){return o=Xt(o),c=p?n:c,c===n?fF(o)?xF(o):iF(o):o.match(c)||[]}var ux=Ft(function(o,c){try{return yn(o,n,c)}catch(p){return eh(p)?p:new Ot(p)}}),$W=_i(function(o,c){return _n(c,function(p){p=Un(p),Jn(o,p,Jf(o[p],o))}),o});function VW(o){var c=o==null?0:o.length,p=Mt();return o=c?de(o,function(y){if(typeof y[1]!="function")throw new On(a);return[p(y[0]),y[1]]}):[],Ft(function(y){for(var b=-1;++b<c;){var M=o[b];if(yn(M[0],this,y))return yn(M[1],this,y)}})}function YW(o){return yz(En(o,g))}function ah(o){return function(){return o}}function qW(o,c){return o==null||o!==o?c:o}var jW=fb(),GW=fb(!0);function pn(o){return o}function lh(o){return W_(typeof o=="function"?o:En(o,g))}function KW(o){return V_(En(o,g))}function XW(o,c){return Y_(o,En(c,g))}var ZW=Ft(function(o,c){return function(p){return Qo(p,o,c)}}),QW=Ft(function(o,c){return function(p){return Qo(o,p,c)}});function ch(o,c,p){var y=Ie(c),b=rc(c,y);p==null&&!(pe(c)&&(b.length||!y.length))&&(p=c,c=o,o=this,b=rc(c,Ie(c)));var M=!(pe(p)&&"chain"in p)||!!p.chain,E=xi(o);return _n(b,function(R){var H=c[R];o[R]=H,E&&(o.prototype[R]=function(){var Z=this.__chain__;if(M||Z){var Q=o(this.__wrapped__),et=Q.__actions__=dn(this.__actions__);return et.push({func:H,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return H.apply(o,ji([this.value()],arguments))})}),o}function JW(){return ue._===this&&(ue._=MF),this}function uh(){}function t3(o){return o=Nt(o),Ft(function(c){return q_(c,o)})}var e3=Uf(de),n3=Uf(h_),i3=Uf(df);function dx(o){return jf(o)?ff(Un(o)):Iz(o)}function r3(o){return function(c){return o==null?n:Rr(o,c)}}var s3=pb(),o3=pb(!0);function dh(){return[]}function fh(){return!1}function a3(){return{}}function l3(){return""}function c3(){return!0}function u3(o,c){if(o=Nt(o),o<1||o>at)return[];var p=I,y=Ke(o,I);c=Mt(c),o-=I;for(var b=mf(y,c);++p<o;)c(p);return b}function d3(o){return Pt(o)?de(o,Un):wn(o)?[o]:dn(Ab(Xt(o)))}function f3(o){var c=++TF;return Xt(o)+c}var h3=uc(function(o,c){return o+c},0),p3=Hf("ceil"),m3=uc(function(o,c){return o/c},1),g3=Hf("floor");function y3(o){return o&&o.length?ic(o,pn,Mf):n}function _3(o,c){return o&&o.length?ic(o,Mt(c,2),Mf):n}function b3(o){return g_(o,pn)}function x3(o,c){return g_(o,Mt(c,2))}function w3(o){return o&&o.length?ic(o,pn,Af):n}function v3(o,c){return o&&o.length?ic(o,Mt(c,2),Af):n}var S3=uc(function(o,c){return o*c},1),T3=Hf("round"),k3=uc(function(o,c){return o-c},0);function M3(o){return o&&o.length?pf(o,pn):0}function D3(o,c){return o&&o.length?pf(o,Mt(c,2)):0}return T.after=X5,T.ary=Hb,T.assign=BH,T.assignIn=ex,T.assignInWith=nx,T.assignWith=ih,T.at=FH,T.before=Wb,T.bind=Jf,T.bindAll=$W,T.bindKey=$b,T.castArray=lH,T.chain=Fb,T.chunk=yU,T.compact=_U,T.concat=bU,T.cond=VW,T.conforms=YW,T.constant=ah,T.countBy=D5,T.create=zH,T.curry=Vb,T.curryRight=Yb,T.debounce=qb,T.defaults=UH,T.defaultsDeep=HH,T.defer=Z5,T.delay=Q5,T.difference=xU,T.differenceBy=wU,T.differenceWith=vU,T.drop=SU,T.dropRight=TU,T.dropRightWhile=kU,T.dropWhile=MU,T.fill=DU,T.filter=O5,T.flatMap=R5,T.flatMapDeep=P5,T.flatMapDepth=I5,T.flatten=Ib,T.flattenDeep=CU,T.flattenDepth=OU,T.flip=J5,T.flow=jW,T.flowRight=GW,T.fromPairs=AU,T.functions=GH,T.functionsIn=KH,T.groupBy=L5,T.initial=RU,T.intersection=PU,T.intersectionBy=IU,T.intersectionWith=LU,T.invert=ZH,T.invertBy=QH,T.invokeMap=B5,T.iteratee=lh,T.keyBy=F5,T.keys=Ie,T.keysIn=hn,T.map=yc,T.mapKeys=tW,T.mapValues=eW,T.matches=KW,T.matchesProperty=XW,T.memoize=bc,T.merge=nW,T.mergeWith=ix,T.method=ZW,T.methodOf=QW,T.mixin=ch,T.negate=xc,T.nthArg=t3,T.omit=iW,T.omitBy=rW,T.once=tH,T.orderBy=z5,T.over=e3,T.overArgs=eH,T.overEvery=n3,T.overSome=i3,T.partial=th,T.partialRight=jb,T.partition=U5,T.pick=sW,T.pickBy=rx,T.property=dx,T.propertyOf=r3,T.pull=zU,T.pullAll=Nb,T.pullAllBy=UU,T.pullAllWith=HU,T.pullAt=WU,T.range=s3,T.rangeRight=o3,T.rearg=nH,T.reject=$5,T.remove=$U,T.rest=iH,T.reverse=Zf,T.sampleSize=Y5,T.set=aW,T.setWith=lW,T.shuffle=q5,T.slice=VU,T.sortBy=K5,T.sortedUniq=ZU,T.sortedUniqBy=QU,T.split=EW,T.spread=rH,T.tail=JU,T.take=t5,T.takeRight=e5,T.takeRightWhile=n5,T.takeWhile=i5,T.tap=_5,T.throttle=sH,T.thru=gc,T.toArray=Qb,T.toPairs=sx,T.toPairsIn=ox,T.toPath=d3,T.toPlainObject=tx,T.transform=cW,T.unary=oH,T.union=r5,T.unionBy=s5,T.unionWith=o5,T.uniq=a5,T.uniqBy=l5,T.uniqWith=c5,T.unset=uW,T.unzip=Qf,T.unzipWith=Bb,T.update=dW,T.updateWith=fW,T.values=Os,T.valuesIn=hW,T.without=u5,T.words=cx,T.wrap=aH,T.xor=d5,T.xorBy=f5,T.xorWith=h5,T.zip=p5,T.zipObject=m5,T.zipObjectDeep=g5,T.zipWith=y5,T.entries=sx,T.entriesIn=ox,T.extend=ex,T.extendWith=nx,ch(T,T),T.add=h3,T.attempt=ux,T.camelCase=yW,T.capitalize=ax,T.ceil=p3,T.clamp=pW,T.clone=cH,T.cloneDeep=dH,T.cloneDeepWith=fH,T.cloneWith=uH,T.conformsTo=hH,T.deburr=lx,T.defaultTo=qW,T.divide=m3,T.endsWith=_W,T.eq=Hn,T.escape=bW,T.escapeRegExp=xW,T.every=C5,T.find=A5,T.findIndex=Rb,T.findKey=WH,T.findLast=E5,T.findLastIndex=Pb,T.findLastKey=$H,T.floor=g3,T.forEach=zb,T.forEachRight=Ub,T.forIn=VH,T.forInRight=YH,T.forOwn=qH,T.forOwnRight=jH,T.get=rh,T.gt=pH,T.gte=mH,T.has=XH,T.hasIn=sh,T.head=Lb,T.identity=pn,T.includes=N5,T.indexOf=EU,T.inRange=mW,T.invoke=JH,T.isArguments=Lr,T.isArray=Pt,T.isArrayBuffer=gH,T.isArrayLike=fn,T.isArrayLikeObject=xe,T.isBoolean=yH,T.isBuffer=tr,T.isDate=_H,T.isElement=bH,T.isEmpty=xH,T.isEqual=wH,T.isEqualWith=vH,T.isError=eh,T.isFinite=SH,T.isFunction=xi,T.isInteger=Gb,T.isLength=wc,T.isMap=Kb,T.isMatch=TH,T.isMatchWith=kH,T.isNaN=MH,T.isNative=DH,T.isNil=OH,T.isNull=CH,T.isNumber=Xb,T.isObject=pe,T.isObjectLike=ye,T.isPlainObject=ra,T.isRegExp=nh,T.isSafeInteger=AH,T.isSet=Zb,T.isString=vc,T.isSymbol=wn,T.isTypedArray=Cs,T.isUndefined=EH,T.isWeakMap=RH,T.isWeakSet=PH,T.join=NU,T.kebabCase=wW,T.last=Pn,T.lastIndexOf=BU,T.lowerCase=vW,T.lowerFirst=SW,T.lt=IH,T.lte=LH,T.max=y3,T.maxBy=_3,T.mean=b3,T.meanBy=x3,T.min=w3,T.minBy=v3,T.stubArray=dh,T.stubFalse=fh,T.stubObject=a3,T.stubString=l3,T.stubTrue=c3,T.multiply=S3,T.nth=FU,T.noConflict=JW,T.noop=uh,T.now=_c,T.pad=TW,T.padEnd=kW,T.padStart=MW,T.parseInt=DW,T.random=gW,T.reduce=H5,T.reduceRight=W5,T.repeat=CW,T.replace=OW,T.result=oW,T.round=T3,T.runInContext=U,T.sample=V5,T.size=j5,T.snakeCase=AW,T.some=G5,T.sortedIndex=YU,T.sortedIndexBy=qU,T.sortedIndexOf=jU,T.sortedLastIndex=GU,T.sortedLastIndexBy=KU,T.sortedLastIndexOf=XU,T.startCase=RW,T.startsWith=PW,T.subtract=k3,T.sum=M3,T.sumBy=D3,T.template=IW,T.times=u3,T.toFinite=wi,T.toInteger=Nt,T.toLength=Jb,T.toLower=LW,T.toNumber=In,T.toSafeInteger=NH,T.toString=Xt,T.toUpper=NW,T.trim=BW,T.trimEnd=FW,T.trimStart=zW,T.truncate=UW,T.unescape=HW,T.uniqueId=f3,T.upperCase=WW,T.upperFirst=oh,T.each=zb,T.eachRight=Ub,T.first=Lb,ch(T,(function(){var o={};return ti(T,function(c,p){Kt.call(T.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),T.VERSION=i,_n(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),_n(["drop","take"],function(o,c){Ht.prototype[o]=function(p){p=p===n?1:Ae(Nt(p),0);var y=this.__filtered__&&!c?new Ht(this):this.clone();return y.__filtered__?y.__takeCount__=Ke(p,y.__takeCount__):y.__views__.push({size:Ke(p,I),type:o+(y.__dir__<0?"Right":"")}),y},Ht.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),_n(["filter","map","takeWhile"],function(o,c){var p=c+1,y=p==ct||p==ut;Ht.prototype[o]=function(b){var M=this.clone();return M.__iteratees__.push({iteratee:Mt(b,3),type:p}),M.__filtered__=M.__filtered__||y,M}}),_n(["head","last"],function(o,c){var p="take"+(c?"Right":"");Ht.prototype[o]=function(){return this[p](1).value()[0]}}),_n(["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=Ft(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(xc(Mt(o)))},Ht.prototype.slice=function(o,c){o=Nt(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=Nt(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(I)},ti(Ht.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=T[y?"take"+(c=="last"?"Right":""):c],M=y||/^find/.test(c);b&&(T.prototype[c]=function(){var E=this.__wrapped__,R=y?[1]:arguments,H=E instanceof Ht,Z=R[0],Q=H||Pt(E),et=function(Ut){var Wt=b.apply(T,ji([Ut],R));return y&&ft?Wt[0]:Wt};Q&&p&&typeof Z=="function"&&Z.length!=1&&(H=Q=!1);var ft=this.__chain__,wt=!!this.__actions__.length,Dt=M&&!ft,Bt=H&&!wt;if(!M&&Q){E=Bt?E:new Ht(this);var kt=o.apply(E,R);return kt.__actions__.push({func:gc,args:[et],thisArg:n}),new An(kt,ft)}return Dt&&Bt?o.apply(this,R):(kt=this.thru(et),Dt?y?kt.value()[0]:kt.value():kt)})}),_n(["pop","push","shift","sort","splice","unshift"],function(o){var c=Wl[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var M=this.value();return c.apply(Pt(M)?M:[],b)}return this[p](function(E){return c.apply(Pt(E)?E:[],b)})}}),ti(Ht.prototype,function(o,c){var p=T[c];if(p){var y=p.name+"";Kt.call(Ss,y)||(Ss[y]=[]),Ss[y].push({name:c,func:p})}}),Ss[cc(n,A).name]=[{name:"wrapper",func:n}],Ht.prototype.clone=WF,Ht.prototype.reverse=$F,Ht.prototype.value=VF,T.prototype.at=b5,T.prototype.chain=x5,T.prototype.commit=w5,T.prototype.next=v5,T.prototype.plant=T5,T.prototype.reverse=k5,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=M5,T.prototype.first=T.prototype.head,Yo&&(T.prototype[Yo]=S5),T}),xs=wF();Qn?((Qn.exports=xs)._=xs,gs._=xs):ue._=xs}).call(BB)})(Co,Co.exports)),Co.exports}var i_=FB(),yl={exports:{}},zB=yl.exports,r_;function UB(){return r_||(r_=1,(function(e,t){(function(n,i){i()})(zB,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,_=document.createElement("a");h=h||d.name||"download",_.download=h,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,h,m):s(_,_.target="_blank")):(_.href=g.createObjectURL(d),setTimeout(function(){g.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},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 _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||_&&x||l)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var F=S.result;F=v?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=F:location=F,g=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,A=C.createObjectURL(d);g?g.location=A:location.href=A,g=null,setTimeout(function(){C.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,e.exports=u})})(yl)),yl.exports}var HB=UB(),_l={exports:{}};var WB=_l.exports,s_;function $B(){return s_||(s_=1,(function(e,t){((n,i)=>{e.exports=i()})(WB,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(k){return k.charCodeAt(0)===65279?k.slice(1):k}function h(k){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 O=B(w);O.chunkSize=parseInt(O.chunkSize),w.step||w.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,k),this.parseChunk=function(w,O){var L=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<L){let q=this._config.newline;q||($=this._config.quoteChar||'"',q=this._handle.guessLineEndings(w,$)),w=[...w.split(q).slice(L)].join(q)}this.isFirstChunk&&z(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(w))!==void 0&&(w=$),this.isFirstChunk=!1,this._halted=!1;var L=this._partialLine+w,$=(this._partialLine="",this._handle.parse(L,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=$.meta.cursor,L=(this._finished||(this._partialLine=L.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:L});else if(z(this._config.chunk)&&!O){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||!L||!z(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),L||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(w){z(this._config.error)?this._config.error(w):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:w,finished:!1})}}function m(k){var w;(k=k||{}).chunkSize||(k.chunkSize=u.RemoteChunkSize),h.call(this,k),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),r||(w.onload=N(this._chunkLoaded,this),w.onerror=N(this._chunkError,this)),w.ontimeout=N(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 O,L=this._config.downloadRequestHeaders;for(O in L)w.setRequestHeader(O,L[O])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+$));try{w.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.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>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(O){O=w.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function g(k){(k=k||{}).chunkSize||(k.chunkSize=u.LocalChunkSize),h.call(this,k);var w,O,L=typeof FileReader<"u";this.stream=function($){this._input=$,O=$.slice||$.webkitSlice||$.mozSlice,L?((w=new FileReader).onload=N(this._chunkLoaded,this),w.onerror=N(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,q=(this._config.chunkSize&&(q=Math.min(this._start+this._config.chunkSize,this._input.size),$=O.call($,this._start,q)),w.readAsText($,this._config.encoding));L||this._chunkLoaded({target:{result:q}})},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 _(k){var w;h.call(this,k=k||{}),this.stream=function(O){return w=O,this._nextChunk()},this._nextChunk=function(){var O,L;if(!this._finished)return O=this._config.chunkSize,w=O?(L=w.substring(0,O),w.substring(O)):(L=w,""),this._finished=!w,this.parseChunk(L)}}function x(k){h.call(this,k=k||{});var w=[],O=!0,L=!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(){L&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):O=!0},this._streamData=N(function($){try{w.push(typeof $=="string"?$:$.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(q){this._streamError(q)}},this),this._streamError=N(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=N(function(){this._streamCleanUp(),L=!0,this._streamData("")},this),this._streamCleanUp=N(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(k){var w,O,L,$,q=Math.pow(2,53),st=-q,ct=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ht=/^((\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)))$/,ut=this,vt=0,at=0,dt=!1,V=!1,I=[],W={data:[],errors:[],meta:{}};function nt(rt){return k.skipEmptyLines==="greedy"?rt.join("").trim()==="":rt.length===1&&rt[0].length===0}function ot(){if(W&&L&&(tt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),L=!1),k.skipEmptyLines&&(W.data=W.data.filter(function(mt){return!nt(mt)})),X()){let mt=function(Et){I.push(Et)};if(W)if(Array.isArray(W.data[0])){for(var rt=0;X()&&rt<W.data.length;rt++)W.data[rt].forEach(mt);W.data.splice(0,1)}else W.data.forEach(mt)}function pt(mt,Et){for(var zt=k.header?{}:[],G=0;G<mt.length;G++){var it=G,lt=mt[G],lt=(($t,_t)=>(Vt=>(k.dynamicTypingFunction&&k.dynamicTyping[Vt]===void 0&&(k.dynamicTyping[Vt]=k.dynamicTypingFunction(Vt)),(k.dynamicTyping[Vt]||k.dynamicTyping)===!0))($t)?_t==="true"||_t==="TRUE"||_t!=="false"&&_t!=="FALSE"&&((Vt=>{if(ct.test(Vt)&&(Vt=parseFloat(Vt),st<Vt&&Vt<q))return 1})(_t)?parseFloat(_t):ht.test(_t)?new Date(_t):_t===""?null:_t):_t)(it=k.header?G>=I.length?"__parsed_extra":I[G]:it,lt=k.transform?k.transform(lt,it):lt);it==="__parsed_extra"?(zt[it]=zt[it]||[],zt[it].push(lt)):zt[it]=lt}return k.header&&(G>I.length?tt("FieldMismatch","TooManyFields","Too many fields: expected "+I.length+" fields but parsed "+G,at+Et):G<I.length&&tt("FieldMismatch","TooFewFields","Too few fields: expected "+I.length+" fields but parsed "+G,at+Et)),zt}var yt;W&&(k.header||k.dynamicTyping||k.transform)&&(yt=1,!W.data.length||Array.isArray(W.data[0])?(W.data=W.data.map(pt),yt=W.data.length):W.data=pt(W.data,0),k.header&&W.meta&&(W.meta.fields=I),at+=yt)}function X(){return k.header&&I.length===0}function tt(rt,pt,yt,mt){rt={type:rt,code:pt,message:yt},mt!==void 0&&(rt.row=mt),W.errors.push(rt)}z(k.step)&&($=k.step,k.step=function(rt){W=rt,X()?ot():(ot(),W.data.length!==0&&(vt+=rt.data.length,k.preview&&vt>k.preview?O.abort():(W.data=W.data[0],$(W,ut))))}),this.parse=function(rt,pt,yt){var mt=k.quoteChar||'"',mt=(k.newline||(k.newline=this.guessLineEndings(rt,mt)),L=!1,k.delimiter?z(k.delimiter)&&(k.delimiter=k.delimiter(rt),W.meta.delimiter=k.delimiter):((mt=((Et,zt,G,it,lt)=>{var $t,_t,Vt,Te;lt=lt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var ke=0;ke<lt.length;ke++){for(var ae,cn=lt[ke],qt=0,Be=0,re=0,De=(Vt=void 0,new C({comments:it,delimiter:cn,newline:zt,preview:10}).parse(Et)),Pe=0;Pe<De.data.length;Pe++)G&&nt(De.data[Pe])?re++:(ae=De.data[Pe].length,Be+=ae,Vt===void 0?Vt=ae:0<ae&&(qt+=Math.abs(ae-Vt),Vt=ae));0<De.data.length&&(Be/=De.data.length-re),1.99<Be&&(_t===void 0||qt<_t||qt===_t&&Te<Be)&&(_t=qt,$t=cn,Te=Be)}return{successful:!!(k.delimiter=$t),bestDelimiter:$t}})(rt,k.newline,k.skipEmptyLines,k.comments,k.delimitersToGuess)).successful?k.delimiter=mt.bestDelimiter:(L=!0,k.delimiter=u.DefaultDelimiter),W.meta.delimiter=k.delimiter),B(k));return mt.header=X(),k.preview&&k.header&&mt.preview++,w=rt,O=new C(mt),W=O.parse(w,pt,yt),ot(),dt?{meta:{paused:!0}}:W||{meta:{paused:!1}}},this.paused=function(){return dt},this.pause=function(){dt=!0,O.abort(),w=z(k.chunk)?"":w.substring(O.getCharIndex())},this.resume=function(){ut.streamer._halted?(dt=!1,ut.streamer.parseChunk(w,!0)):setTimeout(ut.resume,3)},this.aborted=function(){return V},this.abort=function(){V=!0,O.abort(),W.meta.aborted=!0,z(k.complete)&&k.complete(W),w=""},this.guessLineEndings=function(Et,mt){Et=Et.substring(0,1048576);var mt=new RegExp(S(mt)+"([^]*?)"+S(mt),"gm"),yt=(Et=Et.replace(mt,"")).split("\r"),mt=Et.split(`
|
|
26
|
+
}`;var Bt=ux(function(){return jt(M,wt+"return "+et).apply(n,E)});if(Bt.source=et,eh(Bt))throw Bt;return Bt}function IW(o){return Xt(o).toLowerCase()}function LW(o){return Xt(o).toUpperCase()}function NW(o,c,p){if(o=Xt(o),o&&(p||c===n))return __(o);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=Fn(c),M=b_(y,b),E=x_(y,b)+1;return Ji(y,M,E).join("")}function BW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.slice(0,v_(o)+1);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=x_(y,Fn(c))+1;return Ji(y,0,b).join("")}function FW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.replace(No,"");if(!o||!(c=xn(c)))return o;var y=Fn(o),b=b_(y,Fn(c));return Ji(y,b).join("")}function zW(o,c){var p=L,y=$;if(pe(c)){var b="separator"in c?c.separator:b;p="length"in c?Nt(c.length):p,y="omission"in c?xn(c.omission):y}o=Xt(o);var M=o.length;if(_s(o)){var E=Fn(o);M=E.length}if(p>=M)return o;var R=p-bs(y);if(R<1)return y;var H=E?Ji(E,0,R).join(""):o.slice(0,R);if(b===n)return H+y;if(E&&(R+=H.length-R),nh(b)){if(o.slice(R).search(b)){var Z,Q=H;for(b.global||(b=_f(b.source,Xt(vl.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var et=Z.index;H=H.slice(0,et===n?R:et)}}else if(o.indexOf(xn(b),R)!=R){var ft=H.lastIndexOf(b);ft>-1&&(H=H.slice(0,ft))}return H+y}function UW(o){return o=Xt(o),o&&Od.test(o)?o.replace($i,gF):o}var HW=Ms(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),oh=ub("toUpperCase");function cx(o,c,p){return o=Xt(o),c=p?n:c,c===n?dF(o)?bF(o):nF(o):o.match(c)||[]}var ux=Ft(function(o,c){try{return yn(o,n,c)}catch(p){return eh(p)?p:new Ot(p)}}),WW=_i(function(o,c){return _n(c,function(p){p=Un(p),Jn(o,p,Jf(o[p],o))}),o});function $W(o){var c=o==null?0:o.length,p=Mt();return o=c?de(o,function(y){if(typeof y[1]!="function")throw new On(a);return[p(y[0]),y[1]]}):[],Ft(function(y){for(var b=-1;++b<c;){var M=o[b];if(yn(M[0],this,y))return yn(M[1],this,y)}})}function VW(o){return gz(En(o,g))}function ah(o){return function(){return o}}function YW(o,c){return o==null||o!==o?c:o}var qW=fb(),jW=fb(!0);function pn(o){return o}function lh(o){return W_(typeof o=="function"?o:En(o,g))}function GW(o){return V_(En(o,g))}function KW(o,c){return Y_(o,En(c,g))}var XW=Ft(function(o,c){return function(p){return Qo(p,o,c)}}),ZW=Ft(function(o,c){return function(p){return Qo(o,p,c)}});function ch(o,c,p){var y=Ie(c),b=rc(c,y);p==null&&!(pe(c)&&(b.length||!y.length))&&(p=c,c=o,o=this,b=rc(c,Ie(c)));var M=!(pe(p)&&"chain"in p)||!!p.chain,E=xi(o);return _n(b,function(R){var H=c[R];o[R]=H,E&&(o.prototype[R]=function(){var Z=this.__chain__;if(M||Z){var Q=o(this.__wrapped__),et=Q.__actions__=dn(this.__actions__);return et.push({func:H,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return H.apply(o,ji([this.value()],arguments))})}),o}function QW(){return ue._===this&&(ue._=kF),this}function uh(){}function JW(o){return o=Nt(o),Ft(function(c){return q_(c,o)})}var t3=Uf(de),e3=Uf(h_),n3=Uf(df);function dx(o){return jf(o)?ff(Un(o)):Pz(o)}function i3(o){return function(c){return o==null?n:Rr(o,c)}}var r3=pb(),s3=pb(!0);function dh(){return[]}function fh(){return!1}function o3(){return{}}function a3(){return""}function l3(){return!0}function c3(o,c){if(o=Nt(o),o<1||o>at)return[];var p=I,y=Ke(o,I);c=Mt(c),o-=I;for(var b=mf(y,c);++p<o;)c(p);return b}function u3(o){return Pt(o)?de(o,Un):wn(o)?[o]:dn(Ab(Xt(o)))}function d3(o){var c=++SF;return Xt(o)+c}var f3=uc(function(o,c){return o+c},0),h3=Hf("ceil"),p3=uc(function(o,c){return o/c},1),m3=Hf("floor");function g3(o){return o&&o.length?ic(o,pn,Mf):n}function y3(o,c){return o&&o.length?ic(o,Mt(c,2),Mf):n}function _3(o){return g_(o,pn)}function b3(o,c){return g_(o,Mt(c,2))}function x3(o){return o&&o.length?ic(o,pn,Af):n}function w3(o,c){return o&&o.length?ic(o,Mt(c,2),Af):n}var v3=uc(function(o,c){return o*c},1),S3=Hf("round"),T3=uc(function(o,c){return o-c},0);function k3(o){return o&&o.length?pf(o,pn):0}function M3(o,c){return o&&o.length?pf(o,Mt(c,2)):0}return T.after=K5,T.ary=Hb,T.assign=NH,T.assignIn=ex,T.assignInWith=nx,T.assignWith=ih,T.at=BH,T.before=Wb,T.bind=Jf,T.bindAll=WW,T.bindKey=$b,T.castArray=aH,T.chain=Fb,T.chunk=gU,T.compact=yU,T.concat=_U,T.cond=$W,T.conforms=VW,T.constant=ah,T.countBy=M5,T.create=FH,T.curry=Vb,T.curryRight=Yb,T.debounce=qb,T.defaults=zH,T.defaultsDeep=UH,T.defer=X5,T.delay=Z5,T.difference=bU,T.differenceBy=xU,T.differenceWith=wU,T.drop=vU,T.dropRight=SU,T.dropRightWhile=TU,T.dropWhile=kU,T.fill=MU,T.filter=C5,T.flatMap=E5,T.flatMapDeep=R5,T.flatMapDepth=P5,T.flatten=Ib,T.flattenDeep=DU,T.flattenDepth=CU,T.flip=Q5,T.flow=qW,T.flowRight=jW,T.fromPairs=OU,T.functions=jH,T.functionsIn=GH,T.groupBy=I5,T.initial=EU,T.intersection=RU,T.intersectionBy=PU,T.intersectionWith=IU,T.invert=XH,T.invertBy=ZH,T.invokeMap=N5,T.iteratee=lh,T.keyBy=B5,T.keys=Ie,T.keysIn=hn,T.map=yc,T.mapKeys=JH,T.mapValues=tW,T.matches=GW,T.matchesProperty=KW,T.memoize=bc,T.merge=eW,T.mergeWith=ix,T.method=XW,T.methodOf=ZW,T.mixin=ch,T.negate=xc,T.nthArg=JW,T.omit=nW,T.omitBy=iW,T.once=J5,T.orderBy=F5,T.over=t3,T.overArgs=tH,T.overEvery=e3,T.overSome=n3,T.partial=th,T.partialRight=jb,T.partition=z5,T.pick=rW,T.pickBy=rx,T.property=dx,T.propertyOf=i3,T.pull=FU,T.pullAll=Nb,T.pullAllBy=zU,T.pullAllWith=UU,T.pullAt=HU,T.range=r3,T.rangeRight=s3,T.rearg=eH,T.reject=W5,T.remove=WU,T.rest=nH,T.reverse=Zf,T.sampleSize=V5,T.set=oW,T.setWith=aW,T.shuffle=Y5,T.slice=$U,T.sortBy=G5,T.sortedUniq=XU,T.sortedUniqBy=ZU,T.split=AW,T.spread=iH,T.tail=QU,T.take=JU,T.takeRight=t5,T.takeRightWhile=e5,T.takeWhile=n5,T.tap=y5,T.throttle=rH,T.thru=gc,T.toArray=Qb,T.toPairs=sx,T.toPairsIn=ox,T.toPath=u3,T.toPlainObject=tx,T.transform=lW,T.unary=sH,T.union=i5,T.unionBy=r5,T.unionWith=s5,T.uniq=o5,T.uniqBy=a5,T.uniqWith=l5,T.unset=cW,T.unzip=Qf,T.unzipWith=Bb,T.update=uW,T.updateWith=dW,T.values=Os,T.valuesIn=fW,T.without=c5,T.words=cx,T.wrap=oH,T.xor=u5,T.xorBy=d5,T.xorWith=f5,T.zip=h5,T.zipObject=p5,T.zipObjectDeep=m5,T.zipWith=g5,T.entries=sx,T.entriesIn=ox,T.extend=ex,T.extendWith=nx,ch(T,T),T.add=f3,T.attempt=ux,T.camelCase=gW,T.capitalize=ax,T.ceil=h3,T.clamp=hW,T.clone=lH,T.cloneDeep=uH,T.cloneDeepWith=dH,T.cloneWith=cH,T.conformsTo=fH,T.deburr=lx,T.defaultTo=YW,T.divide=p3,T.endsWith=yW,T.eq=Hn,T.escape=_W,T.escapeRegExp=bW,T.every=D5,T.find=O5,T.findIndex=Rb,T.findKey=HH,T.findLast=A5,T.findLastIndex=Pb,T.findLastKey=WH,T.floor=m3,T.forEach=zb,T.forEachRight=Ub,T.forIn=$H,T.forInRight=VH,T.forOwn=YH,T.forOwnRight=qH,T.get=rh,T.gt=hH,T.gte=pH,T.has=KH,T.hasIn=sh,T.head=Lb,T.identity=pn,T.includes=L5,T.indexOf=AU,T.inRange=pW,T.invoke=QH,T.isArguments=Lr,T.isArray=Pt,T.isArrayBuffer=mH,T.isArrayLike=fn,T.isArrayLikeObject=xe,T.isBoolean=gH,T.isBuffer=tr,T.isDate=yH,T.isElement=_H,T.isEmpty=bH,T.isEqual=xH,T.isEqualWith=wH,T.isError=eh,T.isFinite=vH,T.isFunction=xi,T.isInteger=Gb,T.isLength=wc,T.isMap=Kb,T.isMatch=SH,T.isMatchWith=TH,T.isNaN=kH,T.isNative=MH,T.isNil=CH,T.isNull=DH,T.isNumber=Xb,T.isObject=pe,T.isObjectLike=ye,T.isPlainObject=ra,T.isRegExp=nh,T.isSafeInteger=OH,T.isSet=Zb,T.isString=vc,T.isSymbol=wn,T.isTypedArray=Cs,T.isUndefined=AH,T.isWeakMap=EH,T.isWeakSet=RH,T.join=LU,T.kebabCase=xW,T.last=Pn,T.lastIndexOf=NU,T.lowerCase=wW,T.lowerFirst=vW,T.lt=PH,T.lte=IH,T.max=g3,T.maxBy=y3,T.mean=_3,T.meanBy=b3,T.min=x3,T.minBy=w3,T.stubArray=dh,T.stubFalse=fh,T.stubObject=o3,T.stubString=a3,T.stubTrue=l3,T.multiply=v3,T.nth=BU,T.noConflict=QW,T.noop=uh,T.now=_c,T.pad=SW,T.padEnd=TW,T.padStart=kW,T.parseInt=MW,T.random=mW,T.reduce=U5,T.reduceRight=H5,T.repeat=DW,T.replace=CW,T.result=sW,T.round=S3,T.runInContext=U,T.sample=$5,T.size=q5,T.snakeCase=OW,T.some=j5,T.sortedIndex=VU,T.sortedIndexBy=YU,T.sortedIndexOf=qU,T.sortedLastIndex=jU,T.sortedLastIndexBy=GU,T.sortedLastIndexOf=KU,T.startCase=EW,T.startsWith=RW,T.subtract=T3,T.sum=k3,T.sumBy=M3,T.template=PW,T.times=c3,T.toFinite=wi,T.toInteger=Nt,T.toLength=Jb,T.toLower=IW,T.toNumber=In,T.toSafeInteger=LH,T.toString=Xt,T.toUpper=LW,T.trim=NW,T.trimEnd=BW,T.trimStart=FW,T.truncate=zW,T.unescape=UW,T.uniqueId=d3,T.upperCase=HW,T.upperFirst=oh,T.each=zb,T.eachRight=Ub,T.first=Lb,ch(T,(function(){var o={};return ti(T,function(c,p){Kt.call(T.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),T.VERSION=i,_n(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),_n(["drop","take"],function(o,c){Ht.prototype[o]=function(p){p=p===n?1:Ae(Nt(p),0);var y=this.__filtered__&&!c?new Ht(this):this.clone();return y.__filtered__?y.__takeCount__=Ke(p,y.__takeCount__):y.__views__.push({size:Ke(p,I),type:o+(y.__dir__<0?"Right":"")}),y},Ht.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),_n(["filter","map","takeWhile"],function(o,c){var p=c+1,y=p==ct||p==ut;Ht.prototype[o]=function(b){var M=this.clone();return M.__iteratees__.push({iteratee:Mt(b,3),type:p}),M.__filtered__=M.__filtered__||y,M}}),_n(["head","last"],function(o,c){var p="take"+(c?"Right":"");Ht.prototype[o]=function(){return this[p](1).value()[0]}}),_n(["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=Ft(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(xc(Mt(o)))},Ht.prototype.slice=function(o,c){o=Nt(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=Nt(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(I)},ti(Ht.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=T[y?"take"+(c=="last"?"Right":""):c],M=y||/^find/.test(c);b&&(T.prototype[c]=function(){var E=this.__wrapped__,R=y?[1]:arguments,H=E instanceof Ht,Z=R[0],Q=H||Pt(E),et=function(Ut){var Wt=b.apply(T,ji([Ut],R));return y&&ft?Wt[0]:Wt};Q&&p&&typeof Z=="function"&&Z.length!=1&&(H=Q=!1);var ft=this.__chain__,wt=!!this.__actions__.length,Dt=M&&!ft,Bt=H&&!wt;if(!M&&Q){E=Bt?E:new Ht(this);var kt=o.apply(E,R);return kt.__actions__.push({func:gc,args:[et],thisArg:n}),new An(kt,ft)}return Dt&&Bt?o.apply(this,R):(kt=this.thru(et),Dt?y?kt.value()[0]:kt.value():kt)})}),_n(["pop","push","shift","sort","splice","unshift"],function(o){var c=Wl[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var M=this.value();return c.apply(Pt(M)?M:[],b)}return this[p](function(E){return c.apply(Pt(E)?E:[],b)})}}),ti(Ht.prototype,function(o,c){var p=T[c];if(p){var y=p.name+"";Kt.call(Ss,y)||(Ss[y]=[]),Ss[y].push({name:c,func:p})}}),Ss[cc(n,A).name]=[{name:"wrapper",func:n}],Ht.prototype.clone=HF,Ht.prototype.reverse=WF,Ht.prototype.value=$F,T.prototype.at=_5,T.prototype.chain=b5,T.prototype.commit=x5,T.prototype.next=w5,T.prototype.plant=S5,T.prototype.reverse=T5,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=k5,T.prototype.first=T.prototype.head,Yo&&(T.prototype[Yo]=v5),T}),xs=xF();Qn?((Qn.exports=xs)._=xs,gs._=xs):ue._=xs}).call(NB)})(Co,Co.exports)),Co.exports}var i_=BB(),yl={exports:{}},FB=yl.exports,r_;function zB(){return r_||(r_=1,(function(e,t){(function(n,i){i()})(FB,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,_=document.createElement("a");h=h||d.name||"download",_.download=h,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,h,m):s(_,_.target="_blank")):(_.href=g.createObjectURL(d),setTimeout(function(){g.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},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 _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||_&&x||l)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var F=S.result;F=v?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=F:location=F,g=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,A=C.createObjectURL(d);g?g.location=A:location.href=A,g=null,setTimeout(function(){C.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,e.exports=u})})(yl)),yl.exports}var UB=zB(),_l={exports:{}};var HB=_l.exports,s_;function WB(){return s_||(s_=1,(function(e,t){((n,i)=>{e.exports=i()})(HB,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(k){return k.charCodeAt(0)===65279?k.slice(1):k}function h(k){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 O=B(w);O.chunkSize=parseInt(O.chunkSize),w.step||w.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,k),this.parseChunk=function(w,O){var L=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<L){let q=this._config.newline;q||($=this._config.quoteChar||'"',q=this._handle.guessLineEndings(w,$)),w=[...w.split(q).slice(L)].join(q)}this.isFirstChunk&&z(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(w))!==void 0&&(w=$),this.isFirstChunk=!1,this._halted=!1;var L=this._partialLine+w,$=(this._partialLine="",this._handle.parse(L,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=$.meta.cursor,L=(this._finished||(this._partialLine=L.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:L});else if(z(this._config.chunk)&&!O){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||!L||!z(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),L||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(w){z(this._config.error)?this._config.error(w):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:w,finished:!1})}}function m(k){var w;(k=k||{}).chunkSize||(k.chunkSize=u.RemoteChunkSize),h.call(this,k),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),r||(w.onload=N(this._chunkLoaded,this),w.onerror=N(this._chunkError,this)),w.ontimeout=N(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 O,L=this._config.downloadRequestHeaders;for(O in L)w.setRequestHeader(O,L[O])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+$));try{w.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.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>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(O){O=w.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function g(k){(k=k||{}).chunkSize||(k.chunkSize=u.LocalChunkSize),h.call(this,k);var w,O,L=typeof FileReader<"u";this.stream=function($){this._input=$,O=$.slice||$.webkitSlice||$.mozSlice,L?((w=new FileReader).onload=N(this._chunkLoaded,this),w.onerror=N(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,q=(this._config.chunkSize&&(q=Math.min(this._start+this._config.chunkSize,this._input.size),$=O.call($,this._start,q)),w.readAsText($,this._config.encoding));L||this._chunkLoaded({target:{result:q}})},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 _(k){var w;h.call(this,k=k||{}),this.stream=function(O){return w=O,this._nextChunk()},this._nextChunk=function(){var O,L;if(!this._finished)return O=this._config.chunkSize,w=O?(L=w.substring(0,O),w.substring(O)):(L=w,""),this._finished=!w,this.parseChunk(L)}}function x(k){h.call(this,k=k||{});var w=[],O=!0,L=!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(){L&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):O=!0},this._streamData=N(function($){try{w.push(typeof $=="string"?$:$.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(q){this._streamError(q)}},this),this._streamError=N(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=N(function(){this._streamCleanUp(),L=!0,this._streamData("")},this),this._streamCleanUp=N(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(k){var w,O,L,$,q=Math.pow(2,53),st=-q,ct=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ht=/^((\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)))$/,ut=this,vt=0,at=0,dt=!1,V=!1,I=[],W={data:[],errors:[],meta:{}};function nt(rt){return k.skipEmptyLines==="greedy"?rt.join("").trim()==="":rt.length===1&&rt[0].length===0}function ot(){if(W&&L&&(tt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),L=!1),k.skipEmptyLines&&(W.data=W.data.filter(function(mt){return!nt(mt)})),X()){let mt=function(Et){I.push(Et)};if(W)if(Array.isArray(W.data[0])){for(var rt=0;X()&&rt<W.data.length;rt++)W.data[rt].forEach(mt);W.data.splice(0,1)}else W.data.forEach(mt)}function pt(mt,Et){for(var zt=k.header?{}:[],G=0;G<mt.length;G++){var it=G,lt=mt[G],lt=(($t,_t)=>(Vt=>(k.dynamicTypingFunction&&k.dynamicTyping[Vt]===void 0&&(k.dynamicTyping[Vt]=k.dynamicTypingFunction(Vt)),(k.dynamicTyping[Vt]||k.dynamicTyping)===!0))($t)?_t==="true"||_t==="TRUE"||_t!=="false"&&_t!=="FALSE"&&((Vt=>{if(ct.test(Vt)&&(Vt=parseFloat(Vt),st<Vt&&Vt<q))return 1})(_t)?parseFloat(_t):ht.test(_t)?new Date(_t):_t===""?null:_t):_t)(it=k.header?G>=I.length?"__parsed_extra":I[G]:it,lt=k.transform?k.transform(lt,it):lt);it==="__parsed_extra"?(zt[it]=zt[it]||[],zt[it].push(lt)):zt[it]=lt}return k.header&&(G>I.length?tt("FieldMismatch","TooManyFields","Too many fields: expected "+I.length+" fields but parsed "+G,at+Et):G<I.length&&tt("FieldMismatch","TooFewFields","Too few fields: expected "+I.length+" fields but parsed "+G,at+Et)),zt}var yt;W&&(k.header||k.dynamicTyping||k.transform)&&(yt=1,!W.data.length||Array.isArray(W.data[0])?(W.data=W.data.map(pt),yt=W.data.length):W.data=pt(W.data,0),k.header&&W.meta&&(W.meta.fields=I),at+=yt)}function X(){return k.header&&I.length===0}function tt(rt,pt,yt,mt){rt={type:rt,code:pt,message:yt},mt!==void 0&&(rt.row=mt),W.errors.push(rt)}z(k.step)&&($=k.step,k.step=function(rt){W=rt,X()?ot():(ot(),W.data.length!==0&&(vt+=rt.data.length,k.preview&&vt>k.preview?O.abort():(W.data=W.data[0],$(W,ut))))}),this.parse=function(rt,pt,yt){var mt=k.quoteChar||'"',mt=(k.newline||(k.newline=this.guessLineEndings(rt,mt)),L=!1,k.delimiter?z(k.delimiter)&&(k.delimiter=k.delimiter(rt),W.meta.delimiter=k.delimiter):((mt=((Et,zt,G,it,lt)=>{var $t,_t,Vt,Te;lt=lt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var ke=0;ke<lt.length;ke++){for(var ae,cn=lt[ke],qt=0,Be=0,re=0,De=(Vt=void 0,new C({comments:it,delimiter:cn,newline:zt,preview:10}).parse(Et)),Pe=0;Pe<De.data.length;Pe++)G&&nt(De.data[Pe])?re++:(ae=De.data[Pe].length,Be+=ae,Vt===void 0?Vt=ae:0<ae&&(qt+=Math.abs(ae-Vt),Vt=ae));0<De.data.length&&(Be/=De.data.length-re),1.99<Be&&(_t===void 0||qt<_t||qt===_t&&Te<Be)&&(_t=qt,$t=cn,Te=Be)}return{successful:!!(k.delimiter=$t),bestDelimiter:$t}})(rt,k.newline,k.skipEmptyLines,k.comments,k.delimitersToGuess)).successful?k.delimiter=mt.bestDelimiter:(L=!0,k.delimiter=u.DefaultDelimiter),W.meta.delimiter=k.delimiter),B(k));return mt.header=X(),k.preview&&k.header&&mt.preview++,w=rt,O=new C(mt),W=O.parse(w,pt,yt),ot(),dt?{meta:{paused:!0}}:W||{meta:{paused:!1}}},this.paused=function(){return dt},this.pause=function(){dt=!0,O.abort(),w=z(k.chunk)?"":w.substring(O.getCharIndex())},this.resume=function(){ut.streamer._halted?(dt=!1,ut.streamer.parseChunk(w,!0)):setTimeout(ut.resume,3)},this.aborted=function(){return V},this.abort=function(){V=!0,O.abort(),W.meta.aborted=!0,z(k.complete)&&k.complete(W),w=""},this.guessLineEndings=function(Et,mt){Et=Et.substring(0,1048576);var mt=new RegExp(S(mt)+"([^]*?)"+S(mt),"gm"),yt=(Et=Et.replace(mt,"")).split("\r"),mt=Et.split(`
|
|
27
27
|
`),Et=1<mt.length&&mt[0].length<yt[0].length;if(yt.length===1||Et)return`
|
|
28
28
|
`;for(var zt=0,G=0;G<yt.length;G++)yt[G][0]===`
|
|
29
29
|
`&&zt++;return zt>=yt.length/2?`\r
|
|
@@ -32,5 +32,5 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
32
32
|
`&&(O=`
|
|
33
33
|
`);var at=0,dt=!1;this.parse=function(V,I,W){if(typeof V!="string")throw new Error("Input must be a string");var nt=V.length,ot=w.length,X=O.length,tt=L.length,rt=z($),pt=[],yt=[],mt=[],Et=at=0;if(!V)return qt();if(st||st!==!1&&V.indexOf(ut)===-1){for(var zt=V.split(O),G=0;G<zt.length;G++){if(mt=zt[G],at+=mt.length,G!==zt.length-1)at+=O.length;else if(W)return qt();if(!L||mt.substring(0,tt)!==L){if(rt){if(pt=[],Te(mt.split(w)),Be(),dt)return qt()}else Te(mt.split(w));if(q&&q<=G)return pt=pt.slice(0,q),qt(!0)}}return qt()}for(var it=V.indexOf(w,at),lt=V.indexOf(O,at),$t=new RegExp(S(vt)+S(ut),"g"),_t=V.indexOf(ut,at);;)if(V[at]===ut)for(_t=at,at++;;){if((_t=V.indexOf(ut,_t+1))===-1)return W||yt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:pt.length,index:at}),ae();if(_t===nt-1)return ae(V.substring(at,_t).replace($t,ut));if(ut===vt&&V[_t+1]===vt)_t++;else if(ut===vt||_t===0||V[_t-1]!==vt){it!==-1&&it<_t+1&&(it=V.indexOf(w,_t+1));var Vt=ke((lt=lt!==-1&<<_t+1?V.indexOf(O,_t+1):lt)===-1?it:Math.min(it,lt));if(V.substr(_t+1+Vt,ot)===w){mt.push(V.substring(at,_t).replace($t,ut)),V[at=_t+1+Vt+ot]!==ut&&(_t=V.indexOf(ut,at)),it=V.indexOf(w,at),lt=V.indexOf(O,at);break}if(Vt=ke(lt),V.substring(_t+1+Vt,_t+1+Vt+X)===O){if(mt.push(V.substring(at,_t).replace($t,ut)),cn(_t+1+Vt+X),it=V.indexOf(w,at),_t=V.indexOf(ut,at),rt&&(Be(),dt))return qt();if(q&&pt.length>=q)return qt(!0);break}yt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:pt.length,index:at}),_t++}}else if(L&&mt.length===0&&V.substring(at,at+tt)===L){if(lt===-1)return qt();at=lt+X,lt=V.indexOf(O,at),it=V.indexOf(w,at)}else if(it!==-1&&(it<lt||lt===-1))mt.push(V.substring(at,it)),at=it+ot,it=V.indexOf(w,at);else{if(lt===-1)break;if(mt.push(V.substring(at,lt)),cn(lt+X),rt&&(Be(),dt))return qt();if(q&&pt.length>=q)return qt(!0)}return ae();function Te(re){pt.push(re),Et=at}function ke(re){var De=0;return De=re!==-1&&(re=V.substring(_t+1,re))&&re.trim()===""?re.length:De}function ae(re){return W||(re===void 0&&(re=V.substring(at)),mt.push(re),at=nt,Te(mt),rt&&Be()),qt()}function cn(re){at=re,Te(mt),mt=[],lt=V.indexOf(O,at)}function qt(re){if(k.header&&!I&&pt.length&&!ht){var De=pt[0],Pe=Object.create(null),gn=new Set(De);let Wi=!1;for(let Cn=0;Cn<De.length;Cn++){let je=d(De[Cn]);if(Pe[je=z(k.transformHeader)?k.transformHeader(je,Cn):je]){let Ln,di=Pe[je];for(;Ln=je+"_"+di,di++,gn.has(Ln););gn.add(Ln),De[Cn]=Ln,Pe[je]++,Wi=!0,(ct=ct===null?{}:ct)[Ln]=je}else Pe[je]=1,De[Cn]=je;gn.add(je)}Wi&&console.warn("Duplicate headers found and renamed."),ht=!0}return{data:pt,errors:yt,meta:{delimiter:w,linebreak:O,aborted:dt,truncated:!!re,cursor:Et+(I||0),renamedHeaders:ct}}}function Be(){$(qt()),pt=[],yt=[]}},this.abort=function(){dt=!0},this.getCharIndex=function(){return at}}function A(k){var w=k.data,O=a[w.workerId],L=!1;if(w.error)O.userError(w.error,w.file);else if(w.results&&w.results.data){var $={abort:function(){L=!0,F(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(z(O.userStep)){for(var q=0;q<w.results.data.length&&(O.userStep({data:w.results.data[q],errors:w.results.errors,meta:w.results.meta},$),!L);q++);delete w.results}else z(O.userChunk)&&(O.userChunk(w.results,$,w.file),delete w.results)}w.finished&&!L&&F(w.workerId,w.results)}function F(k,w){var O=a[k];z(O.userComplete)&&O.userComplete(w),O.terminate(),delete a[k]}function P(){throw new Error("Not implemented.")}function B(k){if(typeof k!="object"||k===null)return k;var w,O=Array.isArray(k)?[]:{};for(w in k)O[w]=B(k[w]);return O}function N(k,w){return function(){k.apply(w,arguments)}}function z(k){return typeof k=="function"}return u.parse=function(k,w){var O=(w=w||{}).dynamicTyping||!1;if(z(O)&&(w.dynamicTypingFunction=O,O={}),w.dynamicTyping=O,w.transform=!!z(w.transform)&&w.transform,w.downloadTimeout!==void 0){var O=parseInt(w.downloadTimeout);if(isNaN(O))throw new Error("Config downloadTimeout value ("+w.downloadTimeout+") not parsable by parseInt(val).");w.downloadTimeout=O}if(!w.worker||!u.WORKERS_SUPPORTED)return O=null,u.NODE_STREAM_INPUT,typeof k=="string"?(k=d(k),O=new(w.download?m:_)(w)):k.readable===!0&&z(k.read)&&z(k.on)?O=new x(w):(i.File&&k instanceof File||k instanceof Object)&&(O=new g(w)),O.stream(k);(O=(()=>{var L;return!!u.WORKERS_SUPPORTED&&(L=(()=>{var $=i.URL||i.webkitURL||null,q=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; ","(",q,")();"],{type:"text/javascript"})))})(),(L=new i.Worker(L)).onmessage=A,L.id=l++,a[L.id]=L)})()).userStep=w.step,O.userChunk=w.chunk,O.userComplete=w.complete,O.userError=w.error,w.step=z(w.step),w.chunk=z(w.chunk),w.complete=z(w.complete),w.error=z(w.error),delete w.worker,O.postMessage({input:k,config:w,workerId:O.id})},u.unparse=function(k,w){var O=!1,L=!0,$=",",q=`\r
|
|
34
34
|
`,st='"',ct=st+st,ht=!1,ut=null,vt=!1,at=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||u.BAD_DELIMITERS.filter(function(I){return w.delimiter.indexOf(I)!==-1}).length||($=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(O=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(ht=w.skipEmptyLines),typeof w.newline=="string"&&(q=w.newline),typeof w.quoteChar=="string"&&(st=w.quoteChar,ct=st+st),typeof w.header=="boolean"&&(L=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");ut=w.columns}w.escapeChar!==void 0&&(ct=w.escapeChar+st),w.escapeFormulae instanceof RegExp?vt=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(vt=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(st),"g"));if(typeof k=="string"&&(k=JSON.parse(k)),Array.isArray(k)){if(!k.length||Array.isArray(k[0]))return dt(null,k,ht);if(typeof k[0]=="object")return dt(ut||Object.keys(k[0]),k,ht)}else if(typeof k=="object")return typeof k.data=="string"&&(k.data=JSON.parse(k.data)),Array.isArray(k.data)&&(k.fields||(k.fields=k.meta&&k.meta.fields||ut),k.fields||(k.fields=Array.isArray(k.data[0])?k.fields:typeof k.data[0]=="object"?Object.keys(k.data[0]):[]),Array.isArray(k.data[0])||typeof k.data[0]=="object"||(k.data=[k.data])),dt(k.fields||[],k.data||[],ht);throw new Error("Unable to serialize unrecognized input");function dt(I,W,nt){var ot="",X=(typeof I=="string"&&(I=JSON.parse(I)),typeof W=="string"&&(W=JSON.parse(W)),Array.isArray(I)&&0<I.length),tt=!Array.isArray(W[0]);if(X&&L){for(var rt=0;rt<I.length;rt++)0<rt&&(ot+=$),ot+=V(I[rt],rt);0<W.length&&(ot+=q)}for(var pt=0;pt<W.length;pt++){var yt=(X?I:W[pt]).length,mt=!1,Et=X?Object.keys(W[pt]).length===0:W[pt].length===0;if(nt&&!X&&(mt=nt==="greedy"?W[pt].join("").trim()==="":W[pt].length===1&&W[pt][0].length===0),nt==="greedy"&&X){for(var zt=[],G=0;G<yt;G++){var it=tt?I[G]:G;zt.push(W[pt][it])}mt=zt.join("").trim()===""}if(!mt){for(var lt=0;lt<yt;lt++){0<lt&&!Et&&(ot+=$);var $t=X&&tt?I[lt]:lt;ot+=V(W[pt][$t],lt)}pt<W.length-1&&(!nt||0<yt&&!Et)&&(ot+=q)}}return ot}function V(I,W){var nt,ot,X;return I==null?"":I.constructor===Date?isNaN(I.getTime())?"":I.toISOString():(X=!1,vt&&typeof I=="string"&&vt.test(I)&&(I="'"+I,X=!0),ot=(nt=I.toString()).replace(at,ct),(X=X||O===!0||typeof O=="function"&&O(I,W)||Array.isArray(O)&&O[W]||((tt,rt)=>{for(var pt=0;pt<rt.length;pt++)if(-1<tt.indexOf(rt[pt]))return!0;return!1})(ot,u.BAD_DELIMITERS)||-1<ot.indexOf($)||-1<nt.indexOf(st)||ot.charAt(0)===" "||ot.charAt(ot.length-1)===" ")?st+ot+st:ot)}},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=C,u.ParserHandle=v,u.NetworkStreamer=m,u.FileStreamer=g,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(k){k=k.data,u.WORKER_ID===void 0&&k&&(u.WORKER_ID=k.workerId),typeof k.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(k.input,k.config),finished:!0}):(i.File&&k.input instanceof File||k.input instanceof Object)&&(k=u.parse(k.input,k.config))&&i.postMessage({workerId:u.WORKER_ID,results:k,finished:!0})}),(m.prototype=Object.create(h.prototype)).constructor=m,(g.prototype=Object.create(h.prototype)).constructor=g,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(_l)),_l.exports}var
|
|
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});
|
|
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=C,u.ParserHandle=v,u.NetworkStreamer=m,u.FileStreamer=g,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(k){k=k.data,u.WORKER_ID===void 0&&k&&(u.WORKER_ID=k.workerId),typeof k.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(k.input,k.config),finished:!0}):(i.File&&k.input instanceof File||k.input instanceof Object)&&(k=u.parse(k.input,k.config))&&i.postMessage({workerId:u.WORKER_ID,results:k,finished:!0})}),(m.prototype=Object.create(h.prototype)).constructor=m,(g.prototype=Object.create(h.prototype)).constructor=g,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(_l)),_l.exports}var $B=WB();const VB=["id"],YB=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=>i_.mapKeys(m,(g,_)=>h[_]||_):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=>i_.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=$B.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});UB.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,VB))}}),qB=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(YB,{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"])]))}}),jB={class:"kong-ui-public-csv-export-modal"},GB={key:0,class:"selected-range"},KB={key:4,class:"text-muted",tag:"span"},o_=3,XB=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(o_,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(B=>B.timestamp!==x.data[0].timestamp),S=x.data.map(B=>{const N=new Date(B.timestamp);return{...Object.keys(B.event).reduce((k,w)=>{if(w in x.meta.display){const O=B.event[w],L=x.meta.display[w];k[w]=O&&L&&L[O].name||B.event[w]}else k[w]=B.event[w];return k},{}),...v?{timestamp:id(N,"yyyy-MM-dd HH:mm:ss"),tzOffset:id(N,"XXX")}:{}}});let C=[];v&&(C=[{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:{},F=[...C,...Object.keys(A).map(B=>({label:n.t(`chartLabels.${B}`),key:B})),...i.exportState.chartData.meta.metric_names.map(B=>({label:n.t(`chartLabels.${B}`),key:B}))],P=F.reduce((B,N)=>(B[N.key]=N.label,B),{});return{headers:F,csvHeaders:P,rows:S}}),_=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,o_)}};return f.watch(g,()=>{a.value++}),(x,v)=>{const S=f.resolveComponent("KSkeleton"),C=f.resolveComponent("KEmptyState"),A=f.resolveComponent("KTableData"),F=f.resolveComponent("KTooltip"),P=f.resolveComponent("KButton"),B=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",jB,[f.createVNode(B,{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",GB,[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:_,"fetcher-cache-key":String(a.value),headers:g.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(C,{"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(C,{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",KB,[f.createTextVNode(f.toDisplayString(h.value)+" ",1),f.createVNode(F,{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(Bc)})`,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(P,{appearance:"tertiary",class:"cancel-btn",onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(qB,{class:"vitals-report-export-button",filename:s,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(P,{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"])])}}});It.AnalyticsChart=ON,It.ChartLegendPosition=Le,It.CsvExportModal=XB,It.DECIMAL_DISPLAY=MP,It.FONT_SIZE_REGULAR=S0,It.FONT_SIZE_SMALL=v0,It.LEFT_Y_AXIS_ID=rl,It.MAX_LABEL_LENGTH=il,It.OTHER_DIMENSION_ID=Fu,It.RIGHT_Y_AXIS_ID=Vu,It.SimpleChart=YN,It.SparklineChart=mB,It.TopNTable=dB,It.TopTalkersColumn=e_,It.TopTalkersGrid=LB,It.ValidType=br,It.chartTypes=C2,It.exploreResultToScatterData=V0,It.getBarRatio=y0,It.getColumnOptions=gr,It.getColumnStats=zu,It.getRelativeValue=Uu,It.getThresholdType=Hu,It.handleQueryError=b2,It.isCancellationError=W0,It.isScatterChartData=cd,It.lookupStatusCodeColor=k0,It.requestsToScatterData=k2,It.simpleChartMetricDisplay=D2,It.simpleChartTypes=O2,It.statusCodeBadgeBackgroundColor=OP,It.toNumber=Jr,Object.defineProperty(It,Symbol.toStringTag,{value:"Module"})}));
|