@kong-ui-public/analytics-chart 10.31.0 → 10.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- (function(Yt,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider"],p):(Yt=typeof globalThis<"u"?globalThis:Yt||self,p(Yt["kong-ui-publicvitals-chart"]={},Yt.Vue,Yt.KongIcons,Yt["kong-ui-public-i18n"],Yt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Yt,p,Ts,Xf,Qi){"use strict";var gt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(gt||{});const Vb=["in","not_in","selector"],$b=["empty","not_empty"],Yb=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ji=n=>n.filter(t=>t!=="time"),Zf=["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"],Qf=Ji(Zf),qb=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Jf=[...Zf,"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"],th=Ji(Jf),jb=[...qb,"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"],Gb=["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"],eh=Ji(Gb),Kb=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","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"],Xb=Ji(Kb),Zb=["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"],Qb=Zb,Jb=["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=Ji(Jb),ex=["platform","platform_usage"],nx=n=>ex.includes(n),ix=[...Jf.filter(n=>n!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],nh=Ji(ix);[...jb];const rx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],ih=Ji(rx);new Set(Qf),new Set(th),new Set(eh),new Set(nh),new Set(ih);const rh=[{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"}];rh.map(n=>n.code);const sh=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Vb},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:$b}},required:["field","operator"],additionalProperties:!1}]}}),sx=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];sh(Array.from(new Set([...Xb,...Qb,...tx]))),sh([...new Set([...th,...Qf,...eh,...nh,...sx,...ih])]);const ox={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"}},ax=(n,t,e)=>{let i;const r=ox[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function _c(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const lx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ux={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dx={date:_c({formats:lx,defaultWidth:"full"}),time:_c({formats:cx,defaultWidth:"full"}),dateTime:_c({formats:ux,defaultWidth:"full"})},fx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hx=(n,t,e,i)=>fx[n];function Ms(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const px={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mx={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"]},yx={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"]},_x={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"}},bx={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"}},xx=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},wx={ordinalNumber:xx,era:Ms({values:px,defaultWidth:"wide"}),quarter:Ms({values:gx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ms({values:mx,defaultWidth:"wide"}),day:Ms({values:yx,defaultWidth:"wide"}),dayPeriod:Ms({values:_x,defaultWidth:"wide",formattingValues:bx,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?Sx(l,g=>g.test(a)):vx(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function vx(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Sx(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Tx(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Mx=/^(\d+)(th|st|nd|rd)?/i,kx=/\d+/i,Dx={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},Cx={any:[/^b/i,/^(a|c)/i]},Ox={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ax={any:[/1/i,/2/i,/3/i,/4/i]},Rx={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},Ex={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]},Px={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},Ix={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]},Lx={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},Nx={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}},Bx={ordinalNumber:Tx({matchPattern:Mx,parsePattern:kx,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:Dx,defaultMatchWidth:"wide",parsePatterns:Cx,defaultParseWidth:"any"}),quarter:ks({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any"}),day:ks({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:Lx,defaultMatchWidth:"any",parsePatterns:Nx,defaultParseWidth:"any"})},Fx={code:"en-US",formatDistance:ax,formatLong:dx,formatRelative:hx,localize:wx,match:Bx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let zx={};function Ds(){return zx}const oh=6048e5,Ux=864e5,Hx=60,Wx=3600,ah=Symbol.for("constructDateFrom");function Sn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ah in n?n[ah](t):n instanceof Date?new n.constructor(t):new Date(t)}function ze(n,t){return Sn(t||n,n)}function lh(n){const t=ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Vx(n,...t){const e=Sn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Rr(n,t){const e=ze(n,t?.in);return e.setHours(0,0,0,0),e}function $x(n,t,e){const[i,r]=Vx(e?.in,n,t),s=Rr(i),a=Rr(r),l=+s-lh(s),u=+a-lh(a);return Math.round((l-u)/Ux)}function Yx(n,t){const e=ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function qx(n,t){const e=ze(n,t?.in);return $x(e,Yx(e))+1}function Jn(n,t){const e=Ds(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=ze(n,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 Jo(n,t){return Jn(n,{...t,weekStartsOn:1})}function ch(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Sn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Jo(r),a=Sn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Jo(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function jx(n,t){const e=ch(n,t),i=Sn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Jo(i)}function Gx(n,t){const e=ze(n,t?.in),i=+Jo(e)-+jx(e);return Math.round(i/oh)+1}function uh(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Ds(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Sn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Jn(a,t),u=Sn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Jn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function Kx(n,t){const e=Ds(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=uh(n,t),s=Sn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Jn(s,t)}function Xx(n,t){const e=ze(n,t?.in),i=+Jn(e,t)-+Kx(e,t);return Math.round(i/oh)+1}function Xt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const wi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Xt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Xt(e+1,2)},d(n,t){return Xt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Xt(n.getHours()%12||12,t.length)},H(n,t){return Xt(n.getHours(),t.length)},m(n,t){return Xt(n.getMinutes(),t.length)},s(n,t){return Xt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Xt(r,t.length)}},Er={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return wi.y(n,t)},Y:function(n,t,e,i){const r=uh(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Xt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Xt(s,t.length)},R:function(n,t){const e=ch(n);return Xt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Xt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Xt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Xt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return wi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Xt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=Xx(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=Gx(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Xt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):wi.d(n,t)},D:function(n,t,e){const i=qx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Xt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Xt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Xt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Xt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Er.noon:i===0?r=Er.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Er.evening:i>=12?r=Er.afternoon:i>=4?r=Er.morning:r=Er.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return wi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):wi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):wi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):wi.s(n,t)},S:function(n,t){return wi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return hh(i);case"XXXX":case"XX":return tr(i);default:return tr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return hh(i);case"xxxx":case"xx":return tr(i);default:return tr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+fh(i,":");default:return"GMT"+tr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+fh(i,":");default:return"GMT"+tr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Xt(i,t.length)},T:function(n,t,e){return Xt(+n,t.length)}};function fh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Xt(s,2)}function hh(n,t){return n%60===0?(n>0?"-":"+")+Xt(Math.abs(n)/60,2):tr(n,t)}function tr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Xt(Math.trunc(i/60),2),s=Xt(i%60,2);return e+r+t+s}const ph=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},gh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Zx=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return ph(n,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}}",ph(i,t)).replace("{{time}}",gh(r,t))},Qx={p:gh,P:Zx},Jx=/^D+$/,tw=/^Y+$/,ew=["D","DD","YY","YYYY"];function nw(n){return Jx.test(n)}function iw(n){return tw.test(n)}function rw(n,t,e){const i=sw(n,t,e);if(console.warn(i),ew.includes(n))throw new RangeError(i)}function sw(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function ow(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function aw(n){return!(!ow(n)&&typeof n!="number"||isNaN(+ze(n)))}const lw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uw=/^'([^]*?)'?$/,dw=/''/g,fw=/[a-zA-Z]/;function hw(n,t,e){const i=Ds(),r=e?.locale??i.locale??Fx,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ze(n,e?.in);if(!aw(l))throw new RangeError("Invalid time value");let u=t.match(cw).map(h=>{const g=h[0];if(g==="p"||g==="P"){const m=Qx[g];return m(h,r.formatLong)}return h}).join("").match(lw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:pw(h)};if(dh[g])return{isToken:!0,value:h};if(g.match(fw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");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 g=h.value;(!e?.useAdditionalWeekYearTokens&&iw(g)||!e?.useAdditionalDayOfYearTokens&&nw(g))&&rw(g,t,String(n));const m=dh[g[0]];return m(l,g,r.localize,d)}).join("")}function pw(n){const t=n.match(uw);return t?t[1].replace(dw,"'"):n}function ta(n,t,e){const i=ze(n,e?.in);return isNaN(t)?Sn(n,NaN):(i.setDate(i.getDate()+t),i)}function mh(n,t,e){const i=ze(n,e?.in);if(isNaN(t))return Sn(n,NaN);if(!t)return i;const r=i.getDate(),s=Sn(n,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 gw(n,t,e){return mh(n,t*3,e)}function Pr(n,t){const e=ze(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Ir(n,t){const e=ze(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function mw(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Sn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function yw(){return Object.assign({},Ds())}function yh(n){return Math.trunc(n*Wx)}function _w(n){const t=n/Hx;return Math.trunc(t)}function _h(n,t,e){return mh(n,-1,e)}function bh(n,t,e){return gw(n,-1,e)}function xh(n,t,e){const i=yw(),r=ww(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?bw(r,t):xw(r,t)}function bw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function xw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function ww(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function vw(n,t){const e=Dw(t);return"formatToParts"in e?Tw(e,n):Mw(e,n)}const Sw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Tw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Sw[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Mw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const bc={},wh=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")),kw=wh==="06/25/2014, 00:00:00"||wh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Dw(n){return bc[n]||(bc[n]=kw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),bc[n]}function xc(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const vh=36e5,Cw=6e4,wc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Cs(n,t,e){if(!n)return 0;let i=wc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=wc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Sh(r)?-(r*vh):NaN;if(i=wc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Sh(r,a)?(s=Math.abs(r)*vh+a*Cw,i[1]==="+"?-s:s):NaN}if(Rw(n)){t=new Date(t||Date.now());const a=e?t:Ow(t),l=vc(a,n);return-(e?l:Aw(t,l,n))}return NaN}function Ow(n){return xc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function vc(n,t){const e=vw(n,t),i=xc(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function Aw(n,t,e){let i=n.getTime()-t;const r=vc(new Date(i),e);if(t===r)return t;i-=r-t;const s=vc(new Date(i),e);return r===s?r:Math.max(r,s)}function Sh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Th={};function Rw(n){if(Th[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Th[n]=!0,!0}catch{return!1}}const Ew=60*1e3,Pw={X:function(n,t,e){const i=Sc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Mh(i);case"XXXX":case"XX":return Lr(i);default:return Lr(i,":")}},x:function(n,t,e){const i=Sc(e.timeZone,n);switch(t){case"x":return Mh(i);case"xxxx":case"xx":return Lr(i);default:return Lr(i,":")}},O:function(n,t,e){const i=Sc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Iw(i,":");default:return"GMT"+Lr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return xh("short",n,e);default:return xh("long",n,e)}}};function Sc(n,t){const e=n?Cs(n,t,!0)/Ew:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ea(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Lr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=ea(Math.floor(i/60),2),s=ea(Math.floor(i%60),2);return e+r+t+s}function Mh(n,t){return n%60===0?(n>0?"-":"+")+ea(Math.abs(n)/60,2):Lr(n,t)}function Iw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+ea(s,2)}function kh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Dh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Tc=36e5,Ch=6e4,Lw=2,Ke={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:Dh};function na(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Lw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Nw(n),{year:r,restDateString:s}=Bw(i.date,e),a=Fw(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=zw(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Cs(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=kh(new Date(l+u)),d=kh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function Nw(n){const t={};let e=Ke.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ke.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ke.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Bw(n,t){if(n){const e=Ke.YYY[t],i=Ke.YYYYY[t];let r=Ke.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ke.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function Fw(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ke.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Rh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ke.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return Ww(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ke.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Rh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ke.Www.exec(n),s)return r=parseInt(s[1],10)-1,Eh(r)?Oh(t,r):new Date(NaN);if(s=Ke.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Eh(r,a)?Oh(t,r,a):new Date(NaN)}return null}function zw(n){let t,e,i=Ke.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Mc(t)?t%24*Tc:NaN;if(i=Ke.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Mc(t,e)?t%24*Tc+e*Ch:NaN;if(i=Ke.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Mc(t,e,r)?t%24*Tc+e*Ch+r*1e3:NaN}return null}function Oh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Uw=[31,28,31,30,31,30,31,31,30,31,30,31],Hw=[31,29,31,30,31,30,31,31,30,31,30,31];function Ah(n){return n%400===0||n%4===0&&n%100!==0}function Rh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ah(n);if(i&&e>Hw[t]||!i&&e>Uw[t])return!1}return!0}function Ww(n,t){if(t<1)return!1;const e=Ah(n);return!(e&&t>366||!e&&t>365)}function Eh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Mc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Vw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function $w(n,t,e={}){t=String(t);const i=t.match(Vw);if(i){const r=na(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+Pw[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return hw(n,t,e)}function Ph(n,t,e){n=na(n,e);const i=Cs(t,n,!0),r=new Date(n.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 Ih(n,t,e,i){return i={...i,timeZone:t,originalDate:n},$w(Ph(n,t,{timeZone:i.timeZone}),e,i)}function Yw(n,t,e){if(typeof n=="string"&&!n.match(Dh))return na(n,{...e,timeZone:t});n=na(n,e);const i=xc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=Cs(t,new Date(i));return new Date(i+r)}function qw(n,t){return-Cs(n,t)}function Lh(n,t={}){const e=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)"),Ih(n,e,i)}function jw(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return Ih(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Gw={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 ia(n){return n&&Yb.find(t=>n<=Gw[t])||null}var ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sa={exports:{}};sa.exports;var Nh;function Kw(){return Nh||(Nh=1,(function(n,t){var e=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]",g="[object GeneratorFunction]",m="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",R="[object String]",B="[object Symbol]",P="[object WeakMap]",L="[object ArrayBuffer]",I="[object DataView]",N="[object Float32Array]",T="[object Float64Array]",M="[object Int8Array]",O="[object Int16Array]",z="[object Int32Array]",W="[object Uint8Array]",it="[object Uint8ClampedArray]",ut="[object Uint16Array]",ft="[object Uint32Array]",j=/[\\^$.*+?()[\]{}|]/g,tt=/\w*$/,nt=/^\[object .+?Constructor\]$/,et=/^(?:0|[1-9]\d*)$/,at={};at[s]=at[a]=at[L]=at[I]=at[l]=at[u]=at[N]=at[T]=at[M]=at[O]=at[z]=at[m]=at[_]=at[x]=at[S]=at[C]=at[R]=at[B]=at[W]=at[it]=at[ut]=at[ft]=!0,at[d]=at[h]=at[P]=!1;var H=typeof ra=="object"&&ra&&ra.Object===Object&&ra,q=typeof self=="object"&&self&&self.Object===Object&&self,X=H||q||Function("return this")(),_t=t&&!t.nodeType&&t,G=_t&&!0&&n&&!n.nodeType&&n,$=G&&G.exports===_t;function st(D,V){return D.set(V[0],V[1]),D}function ot(D,V){return D.add(V),D}function lt(D,V){for(var J=-1,mt=D?D.length:0;++J<mt&&V(D[J],J,D)!==!1;);return D}function pt(D,V){for(var J=-1,mt=V.length,Te=D.length;++J<mt;)D[Te+J]=V[J];return D}function dt(D,V,J,mt){for(var Te=-1,qe=D?D.length:0;++Te<qe;)J=V(J,D[Te],Te,D);return J}function It(D,V){for(var J=-1,mt=Array(D);++J<D;)mt[J]=V(J);return mt}function zt(D,V){return D?.[V]}function vt(D){var V=!1;if(D!=null&&typeof D.toString!="function")try{V=!!(D+"")}catch{}return V}function Ct(D){var V=-1,J=Array(D.size);return D.forEach(function(mt,Te){J[++V]=[Te,mt]}),J}function Dt(D,V){return function(J){return D(V(J))}}function ve(D){var V=-1,J=Array(D.size);return D.forEach(function(mt){J[++V]=mt}),J}var bt=Array.prototype,jt=Function.prototype,Oe=Object.prototype,Ae=X["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),ln=jt.toString,Vt=Oe.hasOwnProperty,Le=Oe.toString,ie=RegExp("^"+ln.call(Vt).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=$?X.Buffer:void 0,Re=X.Symbol,gn=X.Uint8Array,zi=Dt(Object.getPrototypeOf,Object),Dn=Object.create,Ye=Oe.propertyIsEnumerable,In=bt.splice,ci=Object.getOwnPropertySymbols,So=Se?Se.isBuffer:void 0,To=Dt(Object.keys,Object),br=Gn(X,"DataView"),ui=Gn(X,"Map"),Mo=Gn(X,"Promise"),ko=Gn(X,"Set"),Do=Gn(X,"WeakMap"),Ui=Gn(Object,"create"),pl=fi(br),fd=fi(ui),hd=fi(Mo),pd=fi(ko),gd=fi(Do),Co=Re?Re.prototype:void 0,gl=Co?Co.valueOf:void 0;function di(D){var V=-1,J=D?D.length:0;for(this.clear();++V<J;){var mt=D[V];this.set(mt[0],mt[1])}}function md(){this.__data__=Ui?Ui(null):{}}function Oo(D){return this.has(D)&&delete this.__data__[D]}function yd(D){var V=this.__data__;if(Ui){var J=V[D];return J===i?void 0:J}return Vt.call(V,D)?V[D]:void 0}function Ao(D){var V=this.__data__;return Ui?V[D]!==void 0:Vt.call(V,D)}function _d(D,V){var J=this.__data__;return J[D]=Ui&&V===void 0?i:V,this}di.prototype.clear=md,di.prototype.delete=Oo,di.prototype.get=yd,di.prototype.has=Ao,di.prototype.set=_d;function Ln(D){var V=-1,J=D?D.length:0;for(this.clear();++V<J;){var mt=D[V];this.set(mt[0],mt[1])}}function bd(){this.__data__=[]}function xd(D){var V=this.__data__,J=xr(V,D);if(J<0)return!1;var mt=V.length-1;return J==mt?V.pop():In.call(V,J,1),!0}function wd(D){var V=this.__data__,J=xr(V,D);return J<0?void 0:V[J][1]}function ml(D){return xr(this.__data__,D)>-1}function vd(D,V){var J=this.__data__,mt=xr(J,D);return mt<0?J.push([D,V]):J[mt][1]=V,this}Ln.prototype.clear=bd,Ln.prototype.delete=xd,Ln.prototype.get=wd,Ln.prototype.has=ml,Ln.prototype.set=vd;function Hi(D){var V=-1,J=D?D.length:0;for(this.clear();++V<J;){var mt=D[V];this.set(mt[0],mt[1])}}function yl(){this.__data__={hash:new di,map:new(ui||Ln),string:new di}}function Sd(D){return wr(this,D).delete(D)}function Td(D){return wr(this,D).get(D)}function Md(D){return wr(this,D).has(D)}function kd(D,V){return wr(this,D).set(D,V),this}Hi.prototype.clear=yl,Hi.prototype.delete=Sd,Hi.prototype.get=Td,Hi.prototype.has=Md,Hi.prototype.set=kd;function Wi(D){this.__data__=new Ln(D)}function Dd(){this.__data__=new Ln}function ns(D){return this.__data__.delete(D)}function Cd(D){return this.__data__.get(D)}function is(D){return this.__data__.has(D)}function Od(D,V){var J=this.__data__;if(J instanceof Ln){var mt=J.__data__;if(!ui||mt.length<e-1)return mt.push([D,V]),this;J=this.__data__=new Hi(mt)}return J.set(D,V),this}Wi.prototype.clear=Dd,Wi.prototype.delete=ns,Wi.prototype.get=Cd,Wi.prototype.has=is,Wi.prototype.set=Od;function Ad(D,V){var J=Lo(D)||Rl(D)?It(D.length,String):[],mt=J.length,Te=!!mt;for(var qe in D)Vt.call(D,qe)&&!(Te&&(qe=="length"||Dl(qe,mt)))&&J.push(qe);return J}function _l(D,V,J){var mt=D[V];(!(Vt.call(D,V)&&Al(mt,J))||J===void 0&&!(V in D))&&(D[V]=J)}function xr(D,V){for(var J=D.length;J--;)if(Al(D[J][0],V))return J;return-1}function bl(D,V){return D&&Eo(V,No(V),D)}function rs(D,V,J,mt,Te,qe,Nn){var Ne;if(mt&&(Ne=qe?mt(D,Te,qe,Nn):mt(D)),Ne!==void 0)return Ne;if(!cs(D))return D;var Pl=Lo(D);if(Pl){if(Ne=Ml(D),!V)return Tl(D,Ne)}else{var ce=cn(D),us=ce==h||ce==g;if(Hd(D))return wl(D,V);if(ce==x||ce==s||us&&!qe){if(vt(D))return qe?D:{};if(Ne=kl(us?{}:D),!V)return Po(D,bl(Ne,D))}else{if(!at[ce])return qe?D:{};Ne=Fd(D,ce,rs,V)}}Nn||(Nn=new Wi);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Ne),!Pl)var Bo=J?Bd(D):No(D);return lt(Bo||D,function(vr,Be){Bo&&(Be=vr,vr=D[Be]),_l(Ne,Be,rs(vr,V,J,mt,Be,D,Nn))}),Ne}function Rd(D){return cs(D)?Dn(D):{}}function Ed(D,V,J){var mt=V(D);return Lo(D)?mt:pt(mt,J(D))}function Pd(D){return Le.call(D)}function Id(D){if(!cs(D)||Ol(D))return!1;var V=ls(D)||vt(D)?ie:nt;return V.test(fi(D))}function xl(D){if(!Io(D))return To(D);var V=[];for(var J in Object(D))Vt.call(D,J)&&J!="constructor"&&V.push(J);return V}function wl(D,V){if(V)return D.slice();var J=new D.constructor(D.length);return D.copy(J),J}function ss(D){var V=new D.constructor(D.byteLength);return new gn(V).set(new gn(D)),V}function Ro(D,V){var J=V?ss(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.byteLength)}function Ld(D,V,J){var mt=V?J(Ct(D),!0):Ct(D);return dt(mt,st,new D.constructor)}function vl(D){var V=new D.constructor(D.source,tt.exec(D));return V.lastIndex=D.lastIndex,V}function os(D,V,J){var mt=V?J(ve(D),!0):ve(D);return dt(mt,ot,new D.constructor)}function Sl(D){return gl?Object(gl.call(D)):{}}function Nd(D,V){var J=V?ss(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.length)}function Tl(D,V){var J=-1,mt=D.length;for(V||(V=Array(mt));++J<mt;)V[J]=D[J];return V}function Eo(D,V,J,mt){J||(J={});for(var Te=-1,qe=V.length;++Te<qe;){var Nn=V[Te],Ne=void 0;_l(J,Nn,Ne===void 0?D[Nn]:Ne)}return J}function Po(D,V){return Eo(D,as(D),V)}function Bd(D){return Ed(D,No,as)}function wr(D,V){var J=D.__data__;return Cl(V)?J[typeof V=="string"?"string":"hash"]:J.map}function Gn(D,V){var J=zt(D,V);return Id(J)?J:void 0}var as=ci?Dt(ci,Object):$d,cn=Pd;(br&&cn(new br(new ArrayBuffer(1)))!=I||ui&&cn(new ui)!=m||Mo&&cn(Mo.resolve())!=v||ko&&cn(new ko)!=C||Do&&cn(new Do)!=P)&&(cn=function(D){var V=Le.call(D),J=V==x?D.constructor:void 0,mt=J?fi(J):void 0;if(mt)switch(mt){case pl:return I;case fd:return m;case hd:return v;case pd:return C;case gd:return P}return V});function Ml(D){var V=D.length,J=D.constructor(V);return V&&typeof D[0]=="string"&&Vt.call(D,"index")&&(J.index=D.index,J.input=D.input),J}function kl(D){return typeof D.constructor=="function"&&!Io(D)?Rd(zi(D)):{}}function Fd(D,V,J,mt){var Te=D.constructor;switch(V){case L:return ss(D);case l:case u:return new Te(+D);case I:return Ro(D,mt);case N:case T:case M:case O:case z:case W:case it:case ut:case ft:return Nd(D,mt);case m:return Ld(D,mt,J);case _:case R:return new Te(D);case S:return vl(D);case C:return os(D,mt,J);case B:return Sl(D)}}function Dl(D,V){return V=V??r,!!V&&(typeof D=="number"||et.test(D))&&D>-1&&D%1==0&&D<V}function Cl(D){var V=typeof D;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?D!=="__proto__":D===null}function Ol(D){return!!oe&&oe in D}function Io(D){var V=D&&D.constructor,J=typeof V=="function"&&V.prototype||Oe;return D===J}function fi(D){if(D!=null){try{return ln.call(D)}catch{}try{return D+""}catch{}}return""}function zd(D){return rs(D,!0,!0)}function Al(D,V){return D===V||D!==D&&V!==V}function Rl(D){return Ud(D)&&Vt.call(D,"callee")&&(!Ye.call(D,"callee")||Le.call(D)==s)}var Lo=Array.isArray;function El(D){return D!=null&&Wd(D.length)&&!ls(D)}function Ud(D){return Vd(D)&&El(D)}var Hd=So||ee;function ls(D){var V=cs(D)?Le.call(D):"";return V==h||V==g}function Wd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function cs(D){var V=typeof D;return!!D&&(V=="object"||V=="function")}function Vd(D){return!!D&&typeof D=="object"}function No(D){return El(D)?Ad(D):xl(D)}function $d(){return[]}function ee(){return!1}n.exports=zd})(sa,sa.exports)),sa.exports}Kw();const Tn=(n,t)=>new Date(n.getTime()-qw(t,n));class De{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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=Yw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ph(e,t)}}class Xw extends De{rawStart(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class Zw extends De{rawStart(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class Qw extends De{rawStart(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class Jw extends De{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class tv extends De{rawEnd(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=Jn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Tn(i,t)),i}}class ev extends De{rawEnd(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Pr(bh(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class nv extends De{rawEnd(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Ir(_h(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class iv extends De{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Tn(e,t)),e}}gt.FIFTEEN_MIN,new De({key:gt.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"]}),gt.ONE_HOUR,new De({key:gt.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"]}),gt.SIX_HOUR,new De({key:gt.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"]}),gt.TWELVE_HOUR,new De({key:gt.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"]}),gt.ONE_DAY,new De({key:gt.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"]}),gt.SEVEN_DAY,new De({key:gt.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"]}),gt.THIRTY_DAY,new De({key:gt.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"]}),gt.NINETY_DAY,new De({key:gt.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"]}),gt.ONE_HUNDRED_EIGHTY_DAY,new De({key:gt.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"]}),gt.ONE_YEAR,new De({key:gt.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"]}),gt.CURRENT_WEEK,new Xw({key:gt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Jn(new Date,{weekStartsOn:1});return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.CURRENT_MONTH,new Zw({key:gt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Ir(new Date);return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_QUARTER,new Qw({key:gt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date);return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_YEAR,new Jw({key:gt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_WEEK,new tv({key:gt.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"]}),gt.PREVIOUS_MONTH,new nv({key:gt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Ir(new Date),e=Ir(_h(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Bh(t,e)),3600*24*mw(new Date().setMonth(new Date().getMonth()-1))+yh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_QUARTER,new ev({key:gt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date),t=Pr(bh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_YEAR,new iv({key:gt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Bh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+yh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Bh(n,t){return _w(n.getTimezoneOffset()-t.getTimezoneOffset())}gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.THIRTY_DAY,gt.NINETY_DAY,gt.ONE_HUNDRED_EIGHTY_DAY,gt.ONE_YEAR,gt.CURRENT_WEEK,gt.CURRENT_MONTH,gt.CURRENT_QUARTER,gt.CURRENT_YEAR,gt.PREVIOUS_WEEK,gt.PREVIOUS_MONTH,gt.PREVIOUS_QUARTER,gt.PREVIOUS_YEAR;const rv=new Map(rh.map(n=>[n.code,{code:n.code,name:n.name}])),kc=n=>rv.get(n)?.name||n,Fh=1e3,sv=1e4,zh=1e6,Uh=1e9,Hh=1e12,oa=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},Os=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function aa(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?sv:Fh;return n<r||t.precision&&t.precision>Math.log10(n)?e=oa(Os(n,1,t),t):n<zh?e=`${Os(n,Fh,t)}k`:n<Uh?e=`${Os(n,zh,t)}m`:n<Hh?e=`${oa(Os(n,Uh,t),t)}b`:e=`${oa(Os(n,Hh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}aa.addCommas=oa;const ov=typeof document<"u"&&document.documentElement?.lang||"en-US",la=new Intl.NumberFormat(ov);function er({i18n:n}){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=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?h=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.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 e(i,a);default:return isNaN(i)?`${i}`:l?`${aa(i,{capital:!0})} ${d}`:i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,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`${e(i,l)} - ${e(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${aa(i,{capital:!0})} - ${aa(r,{capital:!0})} ${h}`}const g=i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,m=r>=.01?`${la.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${m} ${h}`}}}const Wh="#d60027",Vh="#ffe5e5",av="#f1f0ff",lv="#e0e4ea",$h="#6c7489",cv="#afb7c5",Yh="#0d0e14",uv="#d60027",dv="#ad000e",Dc="#6c7489",qh="#52596e",fv="#007d60",hv="#995c00",pv="#ffc400",gv="'Inter', Roboto, Helvetica, sans-serif",As="16px",mv="20px",yv="#bee2ff",_v="#8fc1ff",bv="#5f9aff",xv="#306fff",wv="#b5ffee",vv="#00fabe",Sv="#00d6a4",Tv="#00a17b",Mv="#007d60",kv="#005944",Dv="#b5ffee",Cv="#00fabe",Ov="#b5ffee",Av="#00a17b",Rv="#fff296",Ev="#ffe04b",Pv="#ffc400",Iv="#b37600",Lv="#995c00",Nv="#804400",Bv="#fff296",Fv="#ffe04b",zv="#ffc2b3",Uv="#ff9877",Hv="#ff723c",Wv="#f75008",Vv="#d13500",$v="#a31f00",Yv="#ffc2b3",qv="#ff9877",jv="#ff723c",Gv="#f75008",Kv="#d13500",Xv="#a31f00",Zv="#ffc2b3",Qv="#ff9877",Jv="#ff723c",t1="#f75008",e1="#d13500",n1="#a31f00",i1="#ffc2b3",r1="#ff9877",s1="#ff723c",o1="#f75008",a1="#d13500",l1="#a31f00",c1="#ffc2b3",u1="#ff9877",d1="#ff723c",f1="#f75008",h1="#d13500",p1="#ffabab",g1="#ff7272",m1="#ff3954",y1="#f50045",_1="#d60027",b1="#ad000e",x1="#ffabab",w1="#ff7272",v1="#ff3954",S1="#f50045",T1="#d60027",M1="#eefaff",k1="#ecfffb",D1="#fffce0",C1="#fff1ef",O1="#ffe5e5",A1="#5f9aff",R1="#00d6a4",E1="#ffc400",P1="#ff723c",I1="#ff3954",jh=6048e5,L1=864e5,Rs=6e4,Nr=36e5,N1=1e3,Gh=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Gh in n?n[Gh](t):n instanceof Date?new n.constructor(t):new Date(t)}function At(n,t){return he(t||n,n)}function ca(n,t,e){const i=At(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Cc(n,t,e){const i=At(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,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 Oc(n,t,e){return he(n,+At(n)+t)}function B1(n,t,e){return Oc(n,t*Nr)}let F1={};function nr(){return F1}function Wn(n,t){const e=nr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,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 Br(n,t){return Wn(n,{...t,weekStartsOn:1})}function Kh(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Br(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Br(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function ua(n){const t=At(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function ir(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ac(n,t){const e=At(n,t?.in);return e.setHours(0,0,0,0),e}function Xh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Ac(i),a=Ac(r),l=+s-ua(s),u=+a-ua(a);return Math.round((l-u)/L1)}function z1(n,t){const e=Kh(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Br(i)}function U1(n,t,e){const i=At(n,e?.in);return i.setTime(i.getTime()+t*Rs),i}function H1(n,t,e){return Cc(n,t*3,e)}function W1(n,t,e){return Oc(n,t*1e3)}function V1(n,t,e){return ca(n,t*7,e)}function $1(n,t,e){return Cc(n,t*12,e)}function Es(n,t){const e=+At(n)-+At(t);return e<0?-1:e>0?1:e}function Y1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Rc(n){return!(!Y1(n)&&typeof n!="number"||isNaN(+At(n)))}function q1(n,t,e){const[i,r]=ir(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function j1(n,t,e){const[i,r]=ir(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function Zh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Qh(i,r),a=Math.abs(Xh(i,r));i.setDate(i.getDate()-s*a);const l=+(Qh(i,r)===-s),u=s*(a-l);return u===0?0:u}function Qh(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Ps(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function G1(n,t,e){const[i,r]=ir(e?.in,n,t),s=(+i-+r)/Nr;return Ps(e?.roundingMethod)(s)}function Ec(n,t){return+At(n)-+At(t)}function K1(n,t,e){const i=Ec(n,t)/Rs;return Ps(e?.roundingMethod)(i)}function Jh(n,t){const e=At(n,t?.in);return e.setHours(23,59,59,999),e}function tp(n,t){const e=At(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function X1(n,t){const e=At(n,t?.in);return+Jh(e,t)==+tp(e,t)}function ep(n,t,e){const[i,r,s]=ir(e?.in,n,n,t),a=Es(r,s),l=Math.abs(q1(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Es(r,s)===-a;X1(i)&&l===1&&Es(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function Z1(n,t,e){const i=ep(n,t,e)/3;return Ps(e?.roundingMethod)(i)}function Q1(n,t,e){const i=Ec(n,t)/1e3;return Ps(e?.roundingMethod)(i)}function J1(n,t,e){const i=Zh(n,t,e)/7;return Ps(e?.roundingMethod)(i)}function tS(n,t,e){const[i,r]=ir(e?.in,n,t),s=Es(i,r),a=Math.abs(j1(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Es(i,r)===-s,u=s*(a-+l);return u===0?0:u}function eS(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function nS(n,t){const e=At(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function iS(n,t){const e=At(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function np(n,t){const e=At(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function rS(n,t){const e=At(n,t?.in);return e.setMinutes(59,59,999),e}function sS(n,t){const e=nr(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,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 oS(n,t){const e=At(n,t?.in);return e.setSeconds(59,999),e}function aS(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function lS(n,t){const e=At(n,t?.in);return e.setMilliseconds(999),e}const cS={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"}},uS=(n,t,e)=>{let i;const r=cS[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Pc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const dS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pS={date:Pc({formats:dS,defaultWidth:"full"}),time:Pc({formats:fS,defaultWidth:"full"}),dateTime:Pc({formats:hS,defaultWidth:"full"})},gS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mS=(n,t,e,i)=>gS[n];function Is(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const yS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_S={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bS={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"]},xS={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"]},wS={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"}},vS={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"}},SS={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Is({values:yS,defaultWidth:"wide"}),quarter:Is({values:_S,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Is({values:bS,defaultWidth:"wide"}),day:Is({values:xS,defaultWidth:"wide"}),dayPeriod:Is({values:wS,defaultWidth:"wide",formattingValues:vS,defaultFormattingWidth:"wide"})};function Ls(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?MS(l,g=>g.test(a)):TS(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function TS(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function MS(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function kS(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const DS=/^(\d+)(th|st|nd|rd)?/i,CS=/\d+/i,OS={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},AS={any:[/^b/i,/^(a|c)/i]},RS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ES={any:[/1/i,/2/i,/3/i,/4/i]},PS={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},IS={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]},LS={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},NS={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]},BS={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},FS={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}},zS={ordinalNumber:kS({matchPattern:DS,parsePattern:CS,valueCallback:n=>parseInt(n,10)}),era:Ls({matchPatterns:OS,defaultMatchWidth:"wide",parsePatterns:AS,defaultParseWidth:"any"}),quarter:Ls({matchPatterns:RS,defaultMatchWidth:"wide",parsePatterns:ES,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ls({matchPatterns:PS,defaultMatchWidth:"wide",parsePatterns:IS,defaultParseWidth:"any"}),day:Ls({matchPatterns:LS,defaultMatchWidth:"wide",parsePatterns:NS,defaultParseWidth:"any"}),dayPeriod:Ls({matchPatterns:BS,defaultMatchWidth:"any",parsePatterns:FS,defaultParseWidth:"any"})},ip={code:"en-US",formatDistance:uS,formatLong:pS,formatRelative:mS,localize:SS,match:zS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function US(n,t){const e=At(n,t?.in);return Xh(e,np(e))+1}function rp(n,t){const e=At(n,t?.in),i=+Br(e)-+z1(e);return Math.round(i/jh)+1}function Ic(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=nr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Wn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Wn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function HS(n,t){const e=nr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Ic(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Wn(s,t)}function sp(n,t){const e=At(n,t?.in),i=+Wn(e,t)-+HS(e,t);return Math.round(i/jh)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const vi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},Fr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},op={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return vi.y(n,t)},Y:function(n,t,e,i){const r=Ic(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=Kh(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return vi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=sp(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=rp(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):vi.d(n,t)},D:function(n,t,e){const i=US(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.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 e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Fr.noon:i===0?r=Fr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Fr.evening:i>=12?r=Fr.afternoon:i>=4?r=Fr.morning:r=Fr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):vi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):vi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):vi.s(n,t)},S:function(n,t){return vi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return lp(i);case"XXXX":case"XX":return rr(i);default:return rr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return lp(i);case"xxxx":case"xx":return rr(i);default:return rr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ap(i,":");default:return"GMT"+rr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ap(i,":");default:return"GMT"+rr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function ap(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function lp(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):rr(n,t)}function rr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const cp=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},up=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Lc={p:up,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return cp(n,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}}",cp(i,t)).replace("{{time}}",up(r,t))}},WS=/^D+$/,VS=/^Y+$/,$S=["D","DD","YY","YYYY"];function dp(n){return WS.test(n)}function fp(n){return VS.test(n)}function Nc(n,t,e){const i=YS(n,t,e);if(console.warn(i),$S.includes(n))throw new RangeError(i)}function YS(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,GS=/^'([^]*?)'?$/,KS=/''/g,XS=/[a-zA-Z]/;function da(n,t,e){const i=nr(),r=e?.locale??i.locale??ip,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=At(n,e?.in);if(!Rc(l))throw new RangeError("Invalid time value");let u=t.match(jS).map(h=>{const g=h[0];if(g==="p"||g==="P"){const m=Lc[g];return m(h,r.formatLong)}return h}).join("").match(qS).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:ZS(h)};if(op[g])return{isToken:!0,value:h};if(g.match(XS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");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 g=h.value;(!e?.useAdditionalWeekYearTokens&&fp(g)||!e?.useAdditionalDayOfYearTokens&&dp(g))&&Nc(g,t,String(n));const m=op[g[0]];return m(l,g,r.localize,d)}).join("")}function ZS(n){const t=n.match(GS);return t?t[1].replace(KS,"'"):n}function hp(){return Object.assign({},nr())}function QS(n,t){const e=At(n,t?.in).getDay();return e===0?7:e}function JS(n,t){const e=tT(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function tT(n){return typeof n=="function"&&n.prototype?.constructor===n}const eT=10;class pp{subPriority=0;validate(t,e){return!0}}class nT extends pp{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class iT extends pp{priority=eT;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,JS(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new nT(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class rT extends Wt{priority=140;parse(t,e,i){switch(e){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,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={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}/},Vn={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 ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function $n(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Nr+s*Rs+a*N1),rest:t.slice(e[0].length)}}function gp(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function fa(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Bc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function mp(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=n>=s%100;r=n+a-(l?100:0)}return e?r:1-r}function yp(n){return n%400===0||n%4===0&&n%100!==0}class sT extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=mp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class oT extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Ic(t,r);if(i.isTwoDigitYear){const l=mp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class aT extends Wt{priority=130;parse(t,e){return fa(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Br(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class lT extends Wt{priority=130;parse(t,e){return fa(e==="u"?4:e.length,t)}set(t,e,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 cT extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 uT extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 dT extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(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,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class fT extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(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,e){return e>=0&&e<=11}set(t,e,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 hT(n,t,e){const i=At(n,e?.in),r=sp(i,e)-t;return i.setDate(i.getDate()-r*7),At(i,e?.in)}class pT extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Wn(hT(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function gT(n,t,e){const i=At(n,e?.in),r=rp(i,e)-t;return i.setDate(i.getDate()-r*7),i}class mT extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Br(gT(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const yT=[31,28,31,30,31,30,31,31,30,31,30,31],_T=[31,29,31,30,31,30,31,31,30,31,30,31];class bT extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=yp(i),s=t.getMonth();return r?e>=1&&e<=_T[s]:e>=1&&e<=yT[s]}set(t,e,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 xT extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return yp(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,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 Fc(n,t,e){const i=nr(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(n,e?.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 ca(s,h,e)}class wT extends Wt{priority=90;parse(t,e,i){switch(e){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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class vT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(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 ST extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(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 TT(n,t,e){const i=At(n,e?.in),r=QS(i,e),s=t-r;return ca(i,s,e)}class MT extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(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 ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(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,e){return e>=1&&e<=7}set(t,e,i){return t=TT(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 kT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class DT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class CT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class OT extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,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 AT extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class RT extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,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 ET extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,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 PT extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class IT extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class LT extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class NT extends Wt{priority=10;parse(t,e){switch(e){case"X":return $n(Vn.basicOptionalMinutes,t);case"XX":return $n(Vn.basic,t);case"XXXX":return $n(Vn.basicOptionalSeconds,t);case"XXXXX":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","x"]}class BT extends Wt{priority=10;parse(t,e){switch(e){case"x":return $n(Vn.basicOptionalMinutes,t);case"xx":return $n(Vn.basic,t);case"xxxx":return $n(Vn.basicOptionalSeconds,t);case"xxxxx":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","X"]}class FT extends Wt{priority=40;parse(t){return gp(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class zT extends Wt{priority=20;parse(t){return gp(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const UT={G:new rT,y:new sT,Y:new oT,R:new aT,u:new lT,Q:new cT,q:new uT,M:new dT,L:new fT,w:new pT,I:new mT,d:new bT,D:new xT,E:new wT,e:new vT,c:new ST,i:new MT,a:new kT,b:new DT,B:new CT,h:new OT,H:new AT,K:new RT,k:new ET,m:new PT,s:new IT,S:new LT,X:new NT,x:new BT,t:new FT,T:new zT},HT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,VT=/^'([^]*?)'?$/,$T=/''/g,YT=/\S/,qT=/[a-zA-Z]/;function jT(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=hp(),a=i?.locale??s.locale??ip,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 n?r():At(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new iT(i?.in,e)],g=t.match(WT).map(S=>{const C=S[0];if(C in Lc){const R=Lc[C];return R(S,a.formatLong)}return S}).join("").match(HT),m=[];for(let S of g){!i?.useAdditionalWeekYearTokens&&fp(S)&&Nc(S,t,n),!i?.useAdditionalDayOfYearTokens&&dp(S)&&Nc(S,t,n);const C=S[0],R=UT[C];if(R){const{incompatibleTokens:B}=R;if(Array.isArray(B)){const L=m.find(I=>B.includes(I.token)||I.token===C);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${S}\` at the same time`)}else if(R.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);m.push({token:C,fullToken:S});const P=R.run(n,S,a.match,d);if(!P)return r();h.push(P.setter),n=P.rest}else{if(C.match(qT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=GT(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&YT.test(n))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,R)=>R.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,R)=>R.subPriority-C.subPriority)).map(S=>S[0]);let x=At(e,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 GT(n){return n.match(VT)[1].replace($T,"'")}function KT(n,t){const e=At(n,t?.in);return e.setMinutes(0,0,0),e}function XT(n,t){const e=At(n,t?.in);return e.setSeconds(0,0),e}function ZT(n,t){const e=At(n,t?.in);return e.setMilliseconds(0),e}function _p(n){const t=n/Nr;return Math.trunc(t)}function bp(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=eM(n);let s;if(r.date){const d=nM(r.date,i);s=iM(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=rM(r.time),isNaN(l)))return e();if(r.timezone){if(u=sM(r.timezone),isNaN(u))return e()}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 ha={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},QT=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,JT=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tM=/^([+-])(\d{2})(?::?(\d{2}))?$/;function eM(n){const t={},e=n.split(ha.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],ha.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ha.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=ha.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function nM(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function iM(n,t){if(t===null)return new Date(NaN);const e=n.match(QT);if(!e)return new Date(NaN);const i=!!e[4],r=Ns(e[1]),s=Ns(e[2])-1,a=Ns(e[3]),l=Ns(e[4]),u=Ns(e[5])-1;if(i)return uM(t,l,u)?oM(t,l,u):new Date(NaN);{const d=new Date(0);return!lM(t,s,a)||!cM(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Ns(n){return n?parseInt(n):1}function rM(n){const t=n.match(JT);if(!t)return NaN;const e=zc(t[1]),i=zc(t[2]),r=zc(t[3]);return dM(e,i,r)?e*Nr+i*Rs+r*1e3:NaN}function zc(n){return n&&parseFloat(n.replace(",","."))||0}function sM(n){if(n==="Z")return 0;const t=n.match(tM);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return fM(i,r)?e*(i*Nr+r*Rs):NaN}function oM(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const aM=[31,null,31,30,31,30,31,31,30,31,30,31];function xp(n){return n%400===0||n%4===0&&n%100!==0}function lM(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(aM[t]||(xp(n)?29:28))}function cM(n,t){return t>=1&&t<=(xp(n)?366:365)}function uM(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function dM(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function fM(n,t){return t>=0&&t<=59}const wp={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})",outlierTooltip:"{series} (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_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",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",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)",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",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)",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)"}},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 hM(){const n=Xf.createI18n("en-us",wp);return{i18n:n,i18nT:Xf.i18nTComponent(n)}}function Bs(n){return n+.5|0}const Si=(n,t,e)=>Math.max(Math.min(n,e),t);function Fs(n){return Si(Bs(n*2.55),0,255)}function Ti(n){return Si(Bs(n*255),0,255)}function ti(n){return Si(Bs(n/2.55)/100,0,1)}function vp(n){return Si(Bs(n*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},Uc=[..."0123456789ABCDEF"],pM=n=>Uc[n&15],gM=n=>Uc[(n&240)>>4]+Uc[n&15],pa=n=>(n&240)>>4===(n&15),mM=n=>pa(n.r)&&pa(n.g)&&pa(n.b)&&pa(n.a);function yM(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Mn[n[1]]*17,g:255&Mn[n[2]]*17,b:255&Mn[n[3]]*17,a:t===5?Mn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Mn[n[1]]<<4|Mn[n[2]],g:Mn[n[3]]<<4|Mn[n[4]],b:Mn[n[5]]<<4|Mn[n[6]],a:t===9?Mn[n[7]]<<4|Mn[n[8]]:255})),e}const _M=(n,t)=>n<255?t(n):"";function bM(n){var t=mM(n)?pM:gM;return n?"#"+t(n.r)+t(n.g)+t(n.b)+_M(n.a,t):void 0}const xM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Sp(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function wM(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function vM(n,t,e){const i=Sp(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function SM(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Hc(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,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=SM(e,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Wc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ti)}function Vc(n,t,e){return Wc(Sp,n,t,e)}function TM(n,t,e){return Wc(vM,n,t,e)}function MM(n,t,e){return Wc(wM,n,t,e)}function Tp(n){return(n%360+360)%360}function kM(n){const t=xM.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Fs(+t[5]):Ti(+t[5]));const r=Tp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=TM(r,s,a):t[1]==="hsv"?i=MM(r,s,a):i=Vc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function DM(n,t){var e=Hc(n);e[0]=Tp(e[0]+t),e=Vc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function CM(n){if(!n)return;const t=Hc(n),e=t[0],i=vp(t[1]),r=vp(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ti(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Mp={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"},kp={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 OM(){const n={},t=Object.keys(kp),e=Object.keys(Mp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<e.length;r++)s=e[r],l=l.replace(s,Mp[s]);s=parseInt(kp[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let ga;function AM(n){ga||(ga=OM(),ga.transparent=[0,0,0,0]);const t=ga[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const RM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function EM(n){const t=RM.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Fs(a):Si(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Fs(i):Si(i,0,255)),r=255&(t[4]?Fs(r):Si(r,0,255)),s=255&(t[6]?Fs(s):Si(s,0,255)),{r:i,g:r,b:s,a:e}}}function PM(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ti(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const $c=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,zr=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function IM(n,t,e){const i=zr(ti(n.r)),r=zr(ti(n.g)),s=zr(ti(n.b));return{r:Ti($c(i+e*(zr(ti(t.r))-i))),g:Ti($c(r+e*(zr(ti(t.g))-r))),b:Ti($c(s+e*(zr(ti(t.b))-s))),a:n.a+e*(t.a-n.a)}}function ma(n,t,e){if(n){let i=Hc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Vc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Dp(n,t){return n&&Object.assign(t||{},n)}function Cp(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ti(n[3]))):(t=Dp(n,{r:0,g:0,b:0,a:1}),t.a=Ti(t.a)),t}function LM(n){return n.charAt(0)==="r"?EM(n):kM(n)}class zs{constructor(t){if(t instanceof zs)return t;const e=typeof t;let i;e==="object"?i=Cp(t):e==="string"&&(i=yM(t)||AM(t)||LM(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Dp(this._rgb);return t&&(t.a=ti(t.a)),t}set rgb(t){this._rgb=Cp(t)}rgbString(){return this._valid?PM(this._rgb):void 0}hexString(){return this._valid?bM(this._rgb):void 0}hslString(){return this._valid?CM(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,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,e){return t&&(this._rgb=IM(this._rgb,t._rgb,e)),this}clone(){return new zs(this.rgb)}alpha(t){return this._rgb.a=Ti(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Bs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ma(this._rgb,2,t),this}darken(t){return ma(this._rgb,2,-t),this}saturate(t){return ma(this._rgb,1,t),this}desaturate(t){return ma(this._rgb,1,-t),this}rotate(t){return DM(this._rgb,t),this}}function ei(){}const NM=(()=>{let n=0;return()=>n++})();function xt(n){return n==null}function qt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pn(n,t){return ae(n)?n:t}function Mt(n,t){return typeof n>"u"?t:n}const BM=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Op=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Qt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Jt(n,t,e,i){let r,s,a;if(qt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(Pt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ya(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function _a(n){if(qt(n))return n.map(_a);if(Pt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=_a(n[e[r]]);return t}return n}function Ap(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function FM(n,t,e,i){if(!Ap(n))return;const r=t[n],s=e[n];Pt(r)&&Pt(s)?Us(r,s,i):t[n]=_a(s)}function Us(n,t,e){const i=qt(t)?t:[t],r=i.length;if(!Pt(n))return n;e=e||{};const s=e.merger||FM;let a;for(let l=0;l<r;++l){if(a=i[l],!Pt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],n,a,e)}return n}function Hs(n,t){return Us(n,t,{merger:zM})}function zM(n,t,e){if(!Ap(n))return;const i=t[n],r=e[n];Pt(i)&&Pt(r)?Hs(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=_a(r))}const Rp={"":n=>n,x:n=>n.x,y:n=>n.y};function UM(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function HM(n){const t=UM(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Mi(n,t){return(Rp[t]||(Rp[t]=HM(t)))(n)}function Yc(n){return n.charAt(0).toUpperCase()+n.slice(1)}const en=n=>typeof n<"u",nn=n=>typeof n=="function",Ep=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function WM(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Rt=Math.PI,te=2*Rt,VM=te+Rt,ba=Number.POSITIVE_INFINITY,qc=Rt/180,re=Rt/2,kn=Rt/4,xa=Rt*2/3,ki=Math.log10,Yn=Math.sign;function Ws(n,t,e){return Math.abs(n-t)<e}function Pp(n){const t=Math.round(n);n=Ws(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ki(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function $M(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function YM(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Di(n){return!YM(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function qM(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Ip(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(Rt/180)}function wa(n){return n*(180/Rt)}function Lp(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function va(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*Rt&&(s+=te),{angle:s,distance:r}}function Ur(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function jM(n,t){return(n-t+VM)%te-Rt}function Ue(n){return(n%te+te)%te}function Vs(n,t,e,i){const r=Ue(n),s=Ue(t),a=Ue(e),l=Ue(s-r),u=Ue(a-r),d=Ue(r-s),h=Ue(r-a);return r===s||r===a||i&&s===a||l>u&&d<h}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function GM(n){return Ce(n,-32768,32767)}function ni(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function jc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ii=(n,t,e,i)=>jc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),KM=(n,t,e)=>jc(n,e,i=>n[i][t]>=e);function XM(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Np=["push","pop","shift","splice","unshift"];function ZM(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Np.forEach(e=>{const i="_onData"+Yc(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function Bp(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Np.forEach(s=>{delete n[s]}),delete n._chartjs)}function Fp(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const zp=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Up(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,zp.call(window,()=>{i=!1,n.apply(t,e)}))}}function QM(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Gc=n=>n==="start"?"left":n==="end"?"right":"center",He=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,JM=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Hp(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:l,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=a.axis,{min:g,max:m,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ii(u,h,g).lo,e?i:ii(t,h,a.getPixelForValue(g)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(S=>!xt(S[l.axis]));r-=Math.max(0,v)}r=Ce(r,0,i-1)}if(x){let v=Math.max(ii(u,a.axis,m,!0).hi+1,e?0:ii(t,h,a.getPixelForValue(m),!0).hi+1);if(d){const S=u.slice(v-1).findIndex(C=>!xt(C[l.axis]));v+=Math.max(0,S)}s=Ce(v,r,i)-r}else s=i-r}return{start:r,count:s}}function Wp(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const Sa=n=>n===0||n===1,Vp=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),$p=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,$s={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*re)+1,easeOutSine:n=>Math.sin(n*re),easeInOutSine:n=>-.5*(Math.cos(Rt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Sa(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Sa(n)?n:Vp(n,.075,.3),easeOutElastic:n=>Sa(n)?n:$p(n,.075,.3),easeInOutElastic(n){return Sa(n)?n:n<.5?.5*Vp(n*2,.1125,.45):.5+.5*$p(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-$s.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?$s.easeInBounce(n*2)*.5:$s.easeOutBounce(n*2-1)*.5+.5};function Kc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ta(n){return Kc(n)?n:new zs(n)}function Xc(n){return Kc(n)?n:new zs(n).saturate(.5).darken(.1).hexString()}const tk=["x","y","borderWidth","radius","tension"],ek=["color","borderColor","backgroundColor"];function nk(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:ek},numbers:{type:"number",properties:tk}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ik(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Yp=new Map;function rk(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Yp.get(e);return i||(i=new Intl.NumberFormat(n,t),Yp.set(e,i)),i}function Ys(n,t,e){return rk(t,e).format(n)}const qp={values(n){return qt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=sk(n,e)}const a=ki(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),Ys(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ki(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?qp.numeric.call(this,n,t,e):""}};function sk(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ma={formatters:qp};function ok(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ma.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const sr=Object.create(null),Zc=Object.create(null);function qs(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function Qc(n,t,e){return typeof t=="string"?Us(qs(n,t),e):Us(qs(n,""),t)}class ak{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Xc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Xc(r.borderColor),this.hoverColor=(i,r)=>Xc(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(e)}set(t,e){return Qc(this,t,e)}get(t){return qs(this,t)}describe(t,e){return Qc(Zc,t,e)}override(t,e){return Qc(sr,t,e)}route(t,e,i,r){const s=qs(this,t),a=qs(this,i),l="_"+e;Object.defineProperties(s,{[l]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[l],d=a[r];return Pt(u)?Object.assign({},d,u):Mt(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new ak({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nk,ik,ok]);function lk(n){return!n||xt(n.size)||xt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ka(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function ck(n,t,e,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),n.save(),n.font=t;let a=0;const l=e.length;let u,d,h,g,m;for(u=0;u<l;u++)if(g=e[u],g!=null&&!qt(g))a=ka(n,r,s,a,g);else if(qt(g))for(d=0,h=g.length;d<h;d++)m=g[d],m!=null&&!qt(m)&&(a=ka(n,r,s,a,m));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function or(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function jp(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Jc(n,t,e,i){Gp(n,t,e,i,null)}function Gp(n,t,e,i,r){let s,a,l,u,d,h,g,m;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*qc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(S),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(v)||v<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,v,0,0,te):n.arc(e,i,v,0,te),n.closePath();break;case"triangle":h=r?r/2:v,n.moveTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=xa,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=xa,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),n.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(S+kn)*u,g=Math.cos(S+kn)*(r?r/2-d:u),l=Math.sin(S+kn)*u,m=Math.sin(S+kn)*(r?r/2-d:u),n.arc(e-g,i-l,d,S-Rt,S-re),n.arc(e+m,i-a,d,S-re,S),n.arc(e+g,i+l,d,S,S+re),n.arc(e-m,i+a,d,S+re,S+Rt),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,n.rect(e-h,i-u,2*h,2*u);break}S+=kn;case"rectRot":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+m,i-a),n.lineTo(e+g,i+l),n.lineTo(e-m,i+a),n.closePath();break;case"crossRot":S+=kn;case"cross":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"star":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a),S+=kn,g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"line":a=r?r/2:Math.cos(S)*v,l=Math.sin(S)*v,n.moveTo(e-a,i-l),n.lineTo(e+a,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(S)*(r?r/2:v),i+Math.sin(S)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ri(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function js(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Gs(n){n.restore()}function uk(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function dk(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function fk(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),xt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function hk(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function pk(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ar(n,t,e,i,r,s={}){const a=qt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,fk(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&pk(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),xt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),hk(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Hr(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*Rt,Rt,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Rt,re,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,re,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-re,!0),n.lineTo(e+a.topLeft,i)}const gk=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mk=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yk(n,t){const e=(""+n).match(gk);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const _k=n=>+n||0;function tu(n,t){const e={},i=Pt(t),r=i?Object.keys(t):t,s=Pt(n)?i?a=>Mt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=_k(s(a));return e}function Kp(n){return tu(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ci(n){return tu(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=Kp(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function le(n,t){n=n||{},t=t||se.font;let e=Mt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Mt(n.style,t.style);i&&!(""+i).match(mk)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:yk(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=lk(r),r}function Ks(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function bk(n,t,e){const{min:i,max:r}=n,s=Op(t,(r-i)/2),a=(l,u)=>e&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Oi(n,t){return Object.assign(Object.create(n),t)}function eu(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=tg("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>eu([l,...n],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete n[0][u],!0},get(l,u){return Zp(l,u,()=>Dk(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return eg(l).includes(u)},ownKeys(l){return eg(l)},set(l,u,d){const h=l._storage||(l._storage=r());return l[u]=h[u]=d,delete l._keys,!0}})}function Wr(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Xp(n,i),setContext:s=>Wr(n,s,e,i),override:s=>Wr(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,l){return Zp(s,a,()=>wk(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,l){return n[a]=l,delete s[a],!0}})}function Xp(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:nn(e)?e:()=>e,isIndexable:nn(i)?i:()=>i}}const xk=(n,t)=>n?n+Yc(t):t,nu=(n,t)=>Pt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zp(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function wk(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return nn(l)&&a.isScriptable(t)&&(l=vk(t,l,n,e)),qt(l)&&l.length&&(l=Sk(t,l,n,a.isIndexable)),nu(t,l)&&(l=Wr(l,r,s&&s[t],a)),l}function vk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let u=t(s,a||i);return l.delete(n),nu(n,u)&&(u=iu(r._scopes,r,n,u)),u}function Sk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(Pt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const g=iu(d,r,n,h);t.push(Wr(g,s,a&&a[n],l))}}return t}function Qp(n,t,e){return nn(n)?n(t,e):n}const Tk=(n,t)=>n===!0?t:typeof n=="string"?Mi(t,n):void 0;function Mk(n,t,e,i,r){for(const s of t){const a=Tk(e,s);if(a){n.add(a);const l=Qp(a._fallback,e,r);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function iu(n,t,e,i){const r=t._rootScopes,s=Qp(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=Jp(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=Jp(l,a,s,u,i),u===null)?!1:eu(Array.from(l),[""],r,s,()=>kk(t,e,i))}function Jp(n,t,e,i,r){for(;e;)e=Mk(n,t,e,i,r);return e}function kk(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return qt(r)&&Pt(e)?e:r||{}}function Dk(n,t,e,i){let r;for(const s of t)if(r=tg(xk(s,n),e),typeof r<"u")return nu(n,r)?iu(e,i,n,r):r}function tg(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function eg(n){let t=n._keys;return t||(t=n._keys=Ck(n._scopes)),t}function Ck(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ng(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,h;for(l=0,u=i;l<u;++l)d=l+e,h=t[d],a[l]={r:r.parse(Mi(h,s),d)};return a}const Ok=Number.EPSILON||1e-14,Vr=(n,t)=>t<n.length&&!n[t].skip&&n[t],ig=n=>n==="x"?"y":"x";function Ak(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=Ur(s,r),u=Ur(a,s);let d=l/(l+u),h=u/(l+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const g=i*d,m=i*h;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+m*(a.x-r.x),y:s.y+m*(a.y-r.y)}}}function Rk(n,t,e){const i=n.length;let r,s,a,l,u,d=Vr(n,0);for(let h=0;h<i-1;++h)if(u=d,d=Vr(n,h+1),!(!u||!d)){if(Ws(t[h],0,Ok)){e[h]=e[h+1]=0;continue}r=e[h]/t[h],s=e[h+1]/t[h],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=r*a*t[h],e[h+1]=s*a*t[h])}}function Ek(n,t,e="x"){const i=ig(e),r=n.length;let s,a,l,u=Vr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Vr(n,d+1),!l)continue;const h=l[e],g=l[i];a&&(s=(h-a[e])/3,l[`cp1${e}`]=h-s,l[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-h)/3,l[`cp2${e}`]=h+s,l[`cp2${i}`]=g+s*t[d])}}function Pk(n,t="x"){const e=ig(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Vr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=Vr(n,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[e]-u[e])/h:0}s[a]=l?d?Yn(r[a-1])!==Yn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Rk(n,r,s),Ek(n,s,t)}function Da(n,t,e){return Math.max(Math.min(n,e),t)}function Ik(n,t){let e,i,r,s,a,l=ri(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&ri(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=Da(r.cp1x,t.left,t.right),r.cp1y=Da(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Da(r.cp2x,t.left,t.right),r.cp2y=Da(r.cp2y,t.top,t.bottom)))}function Lk(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Pk(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)l=n[s],u=Ak(d,l,n[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&&Ik(n,e)}function ru(){return typeof window<"u"&&typeof document<"u"}function su(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ca(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Oa=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Nk(n,t){return Oa(n).getPropertyValue(t)}const Bk=["top","right","bottom","left"];function lr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Bk[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Fk=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function zk(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(Fk(r,s,n.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 Ai(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Oa(e),s=r.boxSizing==="border-box",a=lr(r,"padding"),l=lr(r,"border","width"),{x:u,y:d,box:h}=zk(n,e),g=a.left+(h&&l.left),m=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-g)/_*e.width/i),y:Math.round((d-m)/x*e.height/i)}}function Uk(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&su(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Oa(s),u=lr(l,"border","width"),d=lr(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Ca(l.maxWidth,s,"clientWidth"),r=Ca(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||ba,maxHeight:r||ba}}const Ri=n=>Math.round(n*10)/10;function Hk(n,t,e,i){const r=Oa(n),s=lr(r,"margin"),a=Ca(r.maxWidth,n,"clientWidth")||ba,l=Ca(r.maxHeight,n,"clientHeight")||ba,u=Uk(n,t,e);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const m=lr(r,"border","width"),_=lr(r,"padding");d-=_.width+m.width,h-=_.height+m.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ri(Math.min(d,a,u.maxWidth)),h=Ri(Math.min(h,l,u.maxHeight)),d&&!h&&(h=Ri(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ri(Math.floor(h*i))),{width:d,height:h}}function rg(n,t,e){const i=t||1,r=Ri(n.height*i),s=Ri(n.width*i);n.height=Ri(n.height),n.width=Ri(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Wk=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};ru()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function sg(n,t){const e=Nk(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function cr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Vk(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function $k(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=cr(n,r,e),l=cr(r,s,e),u=cr(s,t,e),d=cr(a,l,e),h=cr(l,u,e);return cr(d,h,e)}const Yk=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},qk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function $r(n,t,e){return n?Yk(t,e):qk()}function og(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function ag(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lg(n){return n==="angle"?{between:Vs,compare:jM,normalize:Ue}:{between:ni,compare:(t,e)=>t-e,normalize:t=>t}}function cg({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function jk(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=lg(i),u=t.length;let{start:d,end:h,loop:g}=n,m,_;if(g){for(d+=u,h+=u,m=0,_=u;m<_&&a(l(t[d%u][i]),r,s);++m)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:g,style:n.style}}function ug(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=lg(i),{start:h,end:g,loop:m,style:_}=jk(n,t,e),x=[];let v=!1,S=null,C,R,B;const P=()=>u(r,B,C)&&l(r,B)!==0,L=()=>l(s,C)===0||u(s,B,C),I=()=>v||P(),N=()=>!v||L();for(let T=h,M=h;T<=g;++T)R=t[T%a],!R.skip&&(C=d(R[i]),C!==B&&(v=u(C,r,s),S===null&&I()&&(S=l(C,r)===0?T:M),S!==null&&N()&&(x.push(cg({start:S,end:T,loop:m,count:a,style:_})),S=null),M=T,B=C));return S!==null&&x.push(cg({start:S,end:g,loop:m,count:a,style:_})),x}function dg(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=ug(i[r],n.points,t);s.length&&e.push(...s)}return e}function Gk(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Kk(n,t,e,i){const r=n.length,s=[];let a=t,l=n[t],u;for(u=t+1;u<=e;++u){const d=n[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 Xk(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=Gk(e,r,s,i);if(i===!0)return fg(n,[{start:a,end:l,loop:s}],e,t);const u=l<a?l+r:l,d=!!n._fullLoop&&a===0&&l===r-1;return fg(n,Kk(e,a,u,d),e,t)}function fg(n,t,e,i){return!i||!i.setContext||!e?t:Zk(n,t,e,i)}function Zk(n,t,e,i){const r=n._chart.getContext(),s=hg(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let h=s,g=t[0].start,m=g;function _(x,v,S,C){const R=l?-1:1;if(x!==v){for(x+=u;e[x%u].skip;)x-=R;for(;e[v%u].skip;)v+=R;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:S,style:C}),h=C,g=v%u)}}for(const x of t){g=l?g:x.start;let v=e[g%u],S;for(m=g+1;m<=x.end;m++){const C=e[m%u];S=hg(i.setContext(Oi(r,{type:"segment",p0:v,p1:C,p0DataIndex:(m-1)%u,p1DataIndex:m%u,datasetIndex:a}))),Qk(S,h)&&_(g,m-1,x.loop,h),v=C,h=S}g<m-1&&_(g,m-1,x.loop,h)}return d}function hg(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Qk(n,t){if(!t)return!1;const e=[],i=function(r,s){return Kc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Aa(n,t,e){return n.options.clip?n[e]:t[e]}function Jk(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Aa(e,t,"left"),right:Aa(e,t,"right"),top:Aa(i,t,"top"),bottom:Aa(i,t,"bottom")}:t}function pg(n,t){const e=t._clip;if(e.disabled)return!1;const i=Jk(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class tD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=zp.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=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),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var si=new tD;const gg="transparent",eD={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ta(n||gg),r=i.valid&&Ta(t||gg);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class nD{constructor(t,e,i,r){const s=e[i];r=Ks([t.to,r,s,t.from]);const a=Ks([t.from,s,r]);this._active=!0,this._fn=t.fn||eD[t.type||typeof a],this._easing=$s[t.easing]||$s.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,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=Ks([t.to,e,r,t.from]),this._from=Ks([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=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||e<i),!this._active){this._target[r]=l,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/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((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class ou{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Pt(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Pt(s))return;const a={};for(const l of e)a[l]=s[l];(qt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,r=rD(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&iD(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),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,e));continue}const h=e[d];let g=s[d];const m=i.get(d);if(g)if(m&&g.active()){g.update(m,h,l);continue}else g.cancel();if(!m||!m.duration){t[d]=h;continue}s[d]=g=new nD(m,t,d,h),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return si.add(this._chart,i),!0}}function iD(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function rD(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function mg(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function sD(n,t,e){if(e===!1)return!1;const i=mg(n,e),r=mg(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function oD(n){let t,e,i,r;return Pt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function yg(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function _g(n,t,e,i={}){const r=n.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===e){if(h=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Yn(t)===Yn(d))&&(t+=d)}return!h&&!i.all?0:t}function aD(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),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]:n[h]};return l}function au(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function lD(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function cD(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function uD(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function bg(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function xg(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,h=lD(s,a,i),g=t.length;let m;for(let _=0;_<g;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});m=C[d]=uD(r,h,v),m[l]=S,m._top=bg(m,a,!0,i.type),m._bottom=bg(m,a,!1,i.type);const R=m._visualValues||(m._visualValues={});R[l]=S}}function lu(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function dD(n,t){return Oi(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function fD(n,t,e){return Oi(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Xs(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const cu=n=>n==="reset"||n==="none",wg=(n,t)=>t?n:Object.assign({},n),hD=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yg(e,!0),values:null};class Ei{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=au(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&&Xs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,m,_,x)=>g==="x"?m:g==="r"?x:_,s=e.xAxisID=Mt(i.xAxisID,lu(t,"x")),a=e.yAxisID=Mt(i.yAxisID,lu(t,"y")),l=e.rAxisID=Mt(i.rAxisID,lu(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),h=e.vAxisID=r(u,a,s,l);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Bp(this._data,this),t._stacked&&Xs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Pt(e)){const r=this._cachedMeta;this._data=aD(e,r)}else if(i!==e){if(i){Bp(i,this);const r=this._cachedMeta;Xs(r),r._parsed=[]}e&&Object.isExtensible(e)&&ZM(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=au(e.vScale,e),e.stack!==i.stack&&(r=!0,Xs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(xg(this,e._parsed),e._stacked=au(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,g,m;if(this._parsing===!1)i._parsed=r,i._sorted=!0,m=r;else{qt(r[t])?m=this.parseArrayData(i,r,t,e):Pt(r[t])?m=this.parseObjectData(i,r,t,e):m=this.parsePrimitiveData(i,r,t,e);const _=()=>g[l]===null||d&&g[l]<d[l];for(h=0;h<e;++h)i._parsed[h+t]=g=m[h],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&xg(this,m)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),h=s===a,g=new Array(r);let m,_,x;for(m=0,_=r;m<_;++m)x=m+i,g[m]={[l]:h||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,h,g;for(u=0,d=r;u<d;++u)h=u+i,g=e[h],l[u]={x:s.parse(g[0],h),y:a.parse(g[1],h)};return l}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,g,m,_;for(h=0,g=r;h<g;++h)m=h+i,_=e[m],d[h]={x:s.parse(Mi(_,l),m),y:a.parse(Mi(_,u),m)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],l={keys:yg(r,!0),values:e._stacks[t.axis]._visualValues};return _g(l,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const l=r&&i._stacks[e.axis];r&&l&&(r.values=l,a=_g(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=hD(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=cD(l);let m,_;function x(){_=r[m];const v=_[l.axis];return!ae(_[t.axis])||h>v||g<v}for(m=0;m<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++m);if(s){for(m=a-1;m>=0;--m)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],ae(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=oD(Mt(this.options.clip,sD(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.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 g=r[h];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(h=0;h<a.length;++h)a[h].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=fD(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=dD(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,l=s[a],u=this.enableOptionSharing&&en(i);if(l)return wg(l,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],m=d.getOptionScopes(this.getDataset(),h),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),v=d.resolveNamedOptions(m,_,x,g);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(wg(v,u))),v}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const h=this.chart.config,g=h.datasetAnimationScopeKeys(this._type,e),m=h.getOptionScopes(this.getDataset(),g);u=h.createResolver(m,this.getContext(t,i,e))}const d=new ou(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,e){return!e||cu(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){cu(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!cu(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,u,d]of this._syncList)this[l](u,d);this._syncList=[];const r=i.length,s=e.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,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let l;const u=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Xs(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](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,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function pD(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Fp(i.sort((r,s)=>r-s))}return n._cache.$bar}function gD(n){const t=n.iScale,e=pD(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(en(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function mD(n,t,e,i){const r=e.barThickness;let s,a;return xt(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function yD(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,l=n<r.length-1?r[n+1]:null;const u=e.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:e.barPercentage,start:d}}function _D(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[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[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function vg(n,t,e,i){return qt(n)?_D(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Sg(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,h,g,m;for(d=e,h=e+i;d<h;++d)m=t[d],g={},g[r.axis]=l||r.parse(a[d],d),u.push(vg(m,g,s,d));return u}function uu(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function bD(n,t,e){return n!==0?Yn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function xD(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function wD(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:h}=xD(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=h:(s[Tg(h,a,l,u)]=!0,r=d)),s[Tg(r,a,l,u)]=!0,n.borderSkipped=s}function Tg(n,t,e,i){return i?(n=vD(n,t,e),n=Mg(n,e,t)):n=Mg(n,t,e),n}function vD(n,t,e){return n===t?e:n===e?t:n}function Mg(n,t,e){return n==="start"?t:n==="end"?e:n}function SD(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class kg extends Ei{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,e,i,r){return Sg(t,e,i,r)}parseArrayData(t,e,i,r){return Sg(t,e,i,r)}parseObjectData(t,e,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,g=[];let m,_,x,v;for(m=i,_=i+r;m<_;++m)v=e[m],x={},x[s.axis]=s.parse(Mi(v,d),m),g.push(vg(Mi(v,h),x,a,m));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===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 e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,l=uu(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 e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),v=s||xt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[l.axis],R={horizontal:d,base:v.base,enableBorderRadius:!C||uu(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};m&&(R.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const B=R.options||t[_].options;wD(R,B,C,a),SD(R,B,h.ratio),this.updateElement(t[_],_,R,r)}}_getStacks(t,e){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(e),u=l&&l[i.axis],d=h=>{const g=h._parsed.find(_=>_[i.axis]===u),m=g&&g[h.vScale.axis];if(xt(m)||isNaN(m))return!0};for(const h of r)if(!(e!==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,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Mt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||gD(e),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:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,h=uu(d);let g=u[e.axis],m=0,_=i?this.applyStack(e,u,i):g,x,v;_!==g&&(m=_-g,_=g),h&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Yn(g)!==Yn(d.barEnd)&&(m=0),m+=g);const S=!xt(s)&&!h?s:m;let C=e.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(m+_):x=C,v=x-C,Math.abs(v)<a){v=bD(v,e,l)*a,g===l&&(C-=v/2);const R=e.getPixelForDecimal(0),B=e.getPixelForDecimal(1),P=Math.min(R,B),L=Math.max(R,B);C=Math.max(Math.min(C,L),P),x=C+v,i&&!h&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const R=Yn(v)*e.getLineWidthForValue(l)/2;C+=R,v-=R}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Mt(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(e.grouped){const h=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?yD(t,e,r,h*d):mD(t,e,r,h*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Mt(m,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class TD extends Ei{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,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,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 e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=a.axis,g=l.axis;for(let m=e;m<e+i;m++){const _=t[m],x=!s&&this.getParsed(m),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[g]=s?l.getBasePixel():l.getPixelForValue(x[g]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(m,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,m,v,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Mt(i&&i._custom,s),r}}function MD(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const l=n,u=l+t,d=Math.cos(l),h=Math.sin(l),g=Math.cos(u),m=Math.sin(u),_=(B,P,L)=>Vs(B,l,u,!0)?1:Math.max(P,P*e,L,L*e),x=(B,P,L)=>Vs(B,l,u,!0)?-1:Math.min(P,P*e,L,L*e),v=_(0,d,g),S=_(re,h,m),C=x(Rt,d,g),R=x(Rt+re,h,m);i=(v-C)/2,r=(S-R)/2,s=-(v+C)/2,a=-(S+R)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Zs extends Ei{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 e=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Pt(i[t])){const{key:u="value"}=this._parsing;s=d=>+Mi(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;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),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,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(BM(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:m,ratioY:_,offsetX:x,offsetY:v}=MD(g,h,u),S=(i.width-a)/m,C=(i.height-a)/_,R=Math.max(Math.min(S,C)/2,0),B=Op(this.options.radius,R),P=Math.max(B*u,0),L=(B-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*B,this.offsetY=v*B,r.total=this.calculateTotal(),this.outerRadius=B-L*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-L*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/te)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,g=(l.top+l.bottom)/2,m=s&&d.animateScale,_=m?0:this.innerRadius,x=m?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(e,r);let C=this._getRotation(),R;for(R=0;R<e;++R)C+=this._circumference(R,s);for(R=e;R<e+i;++R){const B=this._circumference(R,s),P=t[R],L={x:h+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+B,circumference:B,outerRadius:x,innerRadius:_};S&&(L.options=v||this.resolveDataElementOptions(R,P.active?"active":r)),C+=B,this.updateElement(P,R,L,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?te*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Ys(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=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"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Mt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Dg extends Ei{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 e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:l,count:u}=Hp(e,r,a);this._drawStart=l,this._drawCount=u,Wp(e)&&(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,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(e,r),m=a.axis,_=l.axis,{spanGaps:x,segment:v}=this.options,S=Di(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",R=e+i,B=t.length;let P=e>0&&this.getParsed(e-1);for(let L=0;L<B;++L){const I=t[L],N=C?I:{};if(L<e||L>=R){N.skip=!0;continue}const T=this.getParsed(L),M=xt(T[_]),O=N[m]=a.getPixelForValue(T[m],L),z=N[_]=s||M?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,T,u):T[_],L);N.skip=isNaN(O)||isNaN(z)||M,N.stop=L>0&&Math.abs(T[m]-P[m])>S,v&&(N.parsed=T,N.raw=d.data[L]),g&&(N.options=h||this.resolveDataElementOptions(L,I.active?"active":r)),C||this.updateElement(I,L,N,r),P=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.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 Cg extends Ei{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 e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.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,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Ys(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.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,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,g=d.yCenter,m=d.getIndexAngle(0)-.5*Rt;let _=m,x;const v=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,v);for(x=e;x<e+i;x++){const S=t[x];let C=_,R=_+this._computeAngle(x,r,v),B=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=R,s&&(u.animateScale&&(B=0),u.animateRotate&&(C=R=m));const P={x:h,y:g,innerRadius:0,outerRadius:B,startAngle:C,endAngle:R,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,P,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class kD extends Zs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class DD extends Ei{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 e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.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,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=e;l<e+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),h=s.getPointPositionForValue(l,this.getParsed(l).r),g=a?s.xCenter:h.x,m=a?s.yCenter:h.y,_={x:g,y:m,angle:h.angle,skip:isNaN(g)||isNaN(m),options:d};this.updateElement(u,l,_,r)}}}class Og extends Ei{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 e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=Hp(e,i,r);if(this._drawStart=s,this._drawCount=a,Wp(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=e;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 e.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,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(h),m=this.includeOptions(r,g),_=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,C=Di(v)?v:Number.POSITIVE_INFINITY,R=this.chart._animationsDisabled||s||r==="none";let B=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const L=t[P],I=this.getParsed(P),N=R?L:{},T=xt(I[x]),M=N[_]=a.getPixelForValue(I[_],P),O=N[x]=s||T?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,I,u):I[x],P);N.skip=isNaN(M)||isNaN(O)||T,N.stop=P>0&&Math.abs(I[_]-B[_])>C,S&&(N.parsed=I,N.raw=d.data[P]),m&&(N.options=g||this.resolveDataElementOptions(P,L.active?"active":r)),R||this.updateElement(L,P,N,r),B=I}this.updateSharedOptions(g,r,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let u=e.length-1;u>=0;--u)l=Math.max(l,e[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}var CD=Object.freeze({__proto__:null,BarController:kg,BubbleController:TD,DoughnutController:Zs,LineController:Dg,PieController:kD,PolarAreaController:Cg,RadarController:DD,ScatterController:Og});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class du{static override(t){Object.assign(du.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ur()}parse(){return ur()}format(){return ur()}add(){return ur()}diff(){return ur()}startOf(){return ur()}endOf(){return ur()}}var Ag={_date:du};function OD(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,l=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?KM:ii;if(i){if(r._sharedOptions){const h=s[0],g=typeof h.getRange=="function"&&h.getRange(t);if(g){const m=d(s,t,e-g),_=d(s,t,e+g);return{lo:m.lo,hi:_.hi}}}}else{const h=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:m}=n,_=m.slice(0,h.lo+1).reverse().findIndex(v=>!xt(v[g.axis]));h.lo-=Math.max(0,_);const x=m.slice(h.hi).findIndex(v=>!xt(v[g.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function Qs(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:h}=s[l],{lo:g,hi:m}=OD(s[l],t,a,r);for(let _=g;_<=m;++_){const x=h[_];x.skip||i(x,d,_)}}}function AD(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function fu(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||Qs(n,e,t,function(l,u,d){!r&&!ri(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function RD(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:g}=va(a,{x:t.x,y:t.y});Vs(g,d,h)&&r.push({element:a,datasetIndex:l,index:u})}return Qs(n,e,t,s),r}function ED(n,t,e,i,r,s){let a=[];const l=AD(e);let u=Number.POSITIVE_INFINITY;function d(h,g,m){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const S=l(t,x);S<u?(a=[{element:h,datasetIndex:g,index:m}],u=S):S===u&&a.push({element:h,datasetIndex:g,index:m})}return Qs(n,e,t,d),a}function hu(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?RD(n,t,e,r):ED(n,t,e,i,r,s)}function Rg(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return Qs(n,e,t,(u,d,h)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:h}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var pu={evaluateInteractionItems:Qs,modes:{index(n,t,e,i){const r=Ai(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?fu(n,r,s,i,a):hu(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,g=d.data[h];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:h})}),u):[]},dataset(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?fu(n,r,s,i,a):hu(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:u,index:h})}return l},point(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return fu(n,r,s,i,a)},nearest(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return hu(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ai(t,n);return Rg(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ai(t,n);return Rg(n,r,"y",e.intersect,i)}}};const Eg=["left","top","right","bottom"];function Js(n,t){return n.filter(e=>e.pos===t)}function Pg(n,t){return n.filter(e=>Eg.indexOf(e.pos)===-1&&e.box.axis===t)}function to(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function PD(n){const t=[];let e,i,r,s,a,l;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function ID(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Eg.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 LD(n,t){const e=ID(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=n.length;s<a;++s){l=n[s];const{fullSize:u}=l.box,d=e[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 e}function ND(n){const t=PD(n),e=to(t.filter(d=>d.box.fullSize),!0),i=to(Js(t,"left"),!0),r=to(Js(t,"right")),s=to(Js(t,"top"),!0),a=to(Js(t,"bottom")),l=Pg(t,"x"),u=Pg(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:Js(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Ig(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Lg(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function BD(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!Pt(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&Lg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Ig(a,n,"left","right")),u=Math.max(0,t.outerHeight-Ig(a,n,"top","bottom")),d=l!==n.w,h=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:h}:{same:h,other:d}}function FD(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function zD(n,t){const e=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],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function eo(n,t,e,i){const r=[];let s,a,l,u,d,h;for(s=0,a=n.length,d=0;s<a;++s){l=n[s],u=l.box,u.update(l.width||t.w,l.height||t.h,zD(l.horizontal,t));const{same:g,other:m}=BD(t,e,l,i);d|=g&&r.length,h=h||m,u.fullSize||r.push(l)}return d&&eo(r,t,e,i)||h}function Ra(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Ng(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const l of n){const u=l.box,d=i[l.stack]||{placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const g=t.w*h,m=d.size||u.height;en(d.start)&&(a=d.start),u.fullSize?Ra(u,r.left,a,e.outerWidth-r.right-r.left,m):Ra(u,t.left+d.placed,a,g,m),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*h,m=d.size||u.width;en(d.start)&&(s=d.start),u.fullSize?Ra(u,s,r.top,m,e.outerHeight-r.bottom-r.top):Ra(u,s,t.top+d.placed,m,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var We={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=ND(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.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,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),m=Object.assign({},r);Lg(m,we(i));const _=Object.assign({maxPadding:m,w:s,h:a,x:r.left,y:r.top},r),x=LD(u.concat(d),g);eo(l.fullSize,_,g,x),eo(u,_,g,x),eo(d,_,g,x)&&eo(u,_,g,x),FD(_),Ng(l.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,Ng(l.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,v=>{const S=v.box;Object.assign(S,n.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Bg{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class UD extends Bg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ea="$chartjs",HD={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fg=n=>n===null||n==="";function WD(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ea]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Fg(r)){const s=sg(n,"width");s!==void 0&&(n.width=s)}if(Fg(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=sg(n,"height");s!==void 0&&(n.height=s)}return n}const zg=Wk?{passive:!0}:!1;function VD(n,t,e){n&&n.addEventListener(t,e,zg)}function $D(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,zg)}function YD(n,t){const e=HD[n.type]||n.type,{x:i,y:r}=Ai(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pa(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function qD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.addedNodes,i),a=a&&!Pa(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function jD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.removedNodes,i),a=a&&!Pa(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const no=new Map;let Ug=0;function Hg(){const n=window.devicePixelRatio;n!==Ug&&(Ug=n,no.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function GD(n,t){no.size||window.addEventListener("resize",Hg),no.set(n,t)}function KD(n){no.delete(n),no.size||window.removeEventListener("resize",Hg)}function XD(n,t,e){const i=n.canvas,r=i&&su(i);if(!r)return;const s=Up((l,u)=>{const d=r.clientWidth;e(l,u),d<r.clientWidth&&e()},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),GD(n,s),a}function gu(n,t,e){e&&e.disconnect(),t==="resize"&&KD(n)}function ZD(n,t,e){const i=n.canvas,r=Up(s=>{n.ctx!==null&&e(YD(s,n))},n);return VD(i,t,r),r}class QD extends Bg{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(WD(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ea])return!1;const i=e[Ea].initial;["height","width"].forEach(s=>{const a=i[s];xt(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[Ea],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:qD,detach:jD,resize:XD}[e]||ZD;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:gu,detach:gu,resize:gu}[e]||$D)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Hk(t,e,i,r)}isAttached(t){const e=t&&su(t);return!!(e&&e.isConnected)}}function JD(n){return!ru()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?UD:QD}class Ve{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Di(this.x)&&Di(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function tC(n,t){const e=n.options.ticks,i=eC(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?iC(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return rC(t,d,s,a/r),d;const h=nC(s,t,r);if(a>0){let g,m;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ia(t,d,h,xt(_)?0:l-_,l),g=0,m=a-1;g<m;g++)Ia(t,d,h,s[g],s[g+1]);return Ia(t,d,h,u,xt(_)?t.length:u+_),d}return Ia(t,d,h),d}function eC(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function nC(n,t,e){const i=sC(n),r=t.length/e;if(!i)return Math.max(r,1);const s=$M(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 iC(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function rC(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function Ia(n,t,e,i,r){const s=Mt(i,0),a=Math.min(Mt(r,n.length),n.length);let l=0,u,d,h;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),h=s;h<0;)l++,h=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(s+l*e))}function sC(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const oC=n=>n==="left"?"right":n==="right"?"left":n,Wg=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Vg=(n,t)=>Math.min(t||n,n);function $g(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function aC(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,l=1e-6;let u=n.getPixelForTick(r),d;if(!(e&&(i===1?d=Math.max(u-s,a-u):t===0?d=(n.getPixelForTick(1)-u)/2:d=(u-n.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function lC(n,t){Jt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function io(n){return n.drawTicks?n.tickLength:0}function Yg(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(qt(n.text)?n.text.length:1)*e.lineHeight+i.height}function cC(n,t){return Oi(n,{scale:t,type:"scale"})}function uC(n,t,e){return Oi(n,{tick:e,index:t,type:"tick"})}function dC(n,t,e){let i=Gc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=oC(i)),i}function fC(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:h}=u;let g=0,m,_,x;const v=a-r,S=l-s;if(n.isHorizontal()){if(_=He(i,s,l),Pt(e)){const C=Object.keys(e)[0],R=e[C];x=h[C].getPixelForValue(R)+v-t}else e==="center"?x=(d.bottom+d.top)/2+v-t:x=Wg(n,e,t);m=l-s}else{if(Pt(e)){const C=Object.keys(e)[0],R=e[C];_=h[C].getPixelForValue(R)-S+t}else e==="center"?_=(d.left+d.right)/2-S+t:_=Wg(n,e,t);x=He(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:m,rotation:g}}class dr extends Ve{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=pn(t,Number.POSITIVE_INFINITY),e=pn(e,Number.NEGATIVE_INFINITY),i=pn(i,Number.POSITIVE_INFINITY),r=pn(r,Number.NEGATIVE_INFINITY),{min:pn(t,i),max:pn(e,r),minDefined:ae(t),maxDefined:ae(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:pn(e,pn(i,e)),max:pn(i,pn(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=bk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?$g(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=tC(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,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Qt(this.options.afterUpdate,[this])}beforeSetDimensions(){Qt(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(){Qt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Qt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Qt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Qt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Qt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Qt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Vg(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),g=h.widest.width,m=h.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),g+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-io(t.grid)-e.padding-Yg(t.title,this.chart.options.font),d=Math.sqrt(g*g+m*m),a=wa(Math.min(Math.asin(Ce((h.highest.height+6)/l,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(m/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=Yg(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=io(s)+u):(t.height=this.maxHeight,t.width=io(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:g,highest:m}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*g.width+v*m.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*g.width+S*m.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,S,v)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,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,g=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,_=0;u?d?(m=r*t.width,_=i*e.height):(m=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?m=t.width:s!=="inner"&&(m=t.width/2,_=e.width/2),this.paddingLeft=Math.max((m-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let h=e.height/2,g=t.height/2;s==="start"?(h=0,g=t.height):s==="end"&&(h=e.height,g=0),this.paddingTop=h+a,this.paddingBottom=g+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(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)xt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=$g(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(e/Vg(e,i));let d=0,h=0,g,m,_,x,v,S,C,R,B,P,L;for(g=0;g<e;g+=u){if(x=t[g].label,v=this._resolveTickFontOptions(g),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},R=v.lineHeight,B=P=0,!xt(x)&&!qt(x))B=ka(r,C.data,C.gc,B,x),P=R;else if(qt(x))for(m=0,_=x.length;m<_;++m)L=x[m],!xt(L)&&!qt(L)&&(B=ka(r,C.data,C.gc,B,L),P+=R);a.push(B),l.push(P),d=Math.max(B,d),h=Math.max(P,h)}lC(s,e);const I=a.indexOf(d),N=l.indexOf(h),T=M=>({width:a[M]||0,height:l[M]||0});return{first:T(0),last:T(e-1),widest:T(I),highest:T(N),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return GM(this._alignToPixels?or(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=uC(this.getContext(),t,i))}return this.$context||(this.$context=cC(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),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 e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),m=io(s),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(j){return or(i,j,v)};let R,B,P,L,I,N,T,M,O,z,W,it;if(a==="top")R=C(this.bottom),N=this.bottom-m,M=R-S,z=C(t.top)+S,it=t.bottom;else if(a==="bottom")R=C(this.top),z=t.top,it=C(t.bottom)-S,N=R+S,M=this.top+m;else if(a==="left")R=C(this.right),I=this.right-m,T=R-S,O=C(t.left)+S,W=t.right;else if(a==="right")R=C(this.left),O=t.left,W=C(t.right)-S,I=R+S,T=this.left+m;else if(e==="x"){if(a==="center")R=C((t.top+t.bottom)/2+.5);else if(Pt(a)){const j=Object.keys(a)[0],tt=a[j];R=C(this.chart.scales[j].getPixelForValue(tt))}z=t.top,it=t.bottom,N=R+S,M=N+m}else if(e==="y"){if(a==="center")R=C((t.left+t.right)/2);else if(Pt(a)){const j=Object.keys(a)[0],tt=a[j];R=C(this.chart.scales[j].getPixelForValue(tt))}I=R-S,T=I-m,O=t.left,W=t.right}const ut=Mt(r.ticks.maxTicksLimit,g),ft=Math.max(1,Math.ceil(g/ut));for(B=0;B<g;B+=ft){const j=this.getContext(B),tt=s.setContext(j),nt=l.setContext(j),et=tt.lineWidth,at=tt.color,H=nt.dash||[],q=nt.dashOffset,X=tt.tickWidth,_t=tt.tickColor,G=tt.tickBorderDash||[],$=tt.tickBorderDashOffset;P=aC(this,B,u),P!==void 0&&(L=or(i,P,et),d?I=T=O=W=L:N=M=z=it=L,_.push({tx1:I,ty1:N,tx2:T,ty2:M,x1:O,y1:z,x2:W,y2:it,width:et,color:at,borderDash:H,borderDashOffset:q,tickWidth:X,tickColor:_t,tickBorderDash:G,tickBorderDashOffset:$}))}return this._ticksLength=g,this._borderValue=R,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:h,mirror:g}=s,m=io(i.grid),_=m+h,x=g?-h:_,v=-xe(this.labelRotation),S=[];let C,R,B,P,L,I,N,T,M,O,z,W,it="middle";if(r==="top")I=this.bottom-x,N=this._getXAxisLabelAlignment();else if(r==="bottom")I=this.top+x,N=this._getXAxisLabelAlignment();else if(r==="left"){const ft=this._getYAxisLabelAlignment(m);N=ft.textAlign,L=ft.x}else if(r==="right"){const ft=this._getYAxisLabelAlignment(m);N=ft.textAlign,L=ft.x}else if(e==="x"){if(r==="center")I=(t.top+t.bottom)/2+_;else if(Pt(r)){const ft=Object.keys(r)[0],j=r[ft];I=this.chart.scales[ft].getPixelForValue(j)+_}N=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")L=(t.left+t.right)/2-_;else if(Pt(r)){const ft=Object.keys(r)[0],j=r[ft];L=this.chart.scales[ft].getPixelForValue(j)}N=this._getYAxisLabelAlignment(m).textAlign}e==="y"&&(u==="start"?it="top":u==="end"&&(it="bottom"));const ut=this._getLabelSizes();for(C=0,R=l.length;C<R;++C){B=l[C],P=B.label;const ft=s.setContext(this.getContext(C));T=this.getPixelForTick(C)+s.labelOffset,M=this._resolveTickFontOptions(C),O=M.lineHeight,z=qt(P)?P.length:1;const j=z/2,tt=ft.color,nt=ft.textStrokeColor,et=ft.textStrokeWidth;let at=N;a?(L=T,N==="inner"&&(C===R-1?at=this.options.reverse?"left":"right":C===0?at=this.options.reverse?"right":"left":at="center"),r==="top"?d==="near"||v!==0?W=-z*O+O/2:d==="center"?W=-ut.highest.height/2-j*O+O:W=-ut.highest.height+O/2:d==="near"||v!==0?W=O/2:d==="center"?W=ut.highest.height/2-j*O:W=ut.highest.height-z*O,g&&(W*=-1),v!==0&&!ft.showLabelBackdrop&&(L+=O/2*Math.sin(v))):(I=T,W=(1-z)*O/2);let H;if(ft.showLabelBackdrop){const q=we(ft.backdropPadding),X=ut.heights[C],_t=ut.widths[C];let G=W-q.top,$=0-q.left;switch(it){case"middle":G-=X/2;break;case"bottom":G-=X;break}switch(N){case"center":$-=_t/2;break;case"right":$-=_t;break;case"inner":C===R-1?$-=_t:C>0&&($-=_t/2);break}H={left:$,top:G,width:_t+q.width,height:X+q.height,color:ft.backdropColor}}S.push({label:P,font:M,textOffset:W,options:{rotation:v,color:tt,strokeColor:nt,strokeWidth:et,textAlign:at,textBaseline:it,translation:[L,I],backdrop:H}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,h;return e==="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)):e==="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,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=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(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.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:e,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,g,m;this.isHorizontal()?(d=or(t,this.left,a)-a/2,h=or(t,this.right,l)+l/2,g=m=u):(g=or(t,this.top,a)-a/2,m=or(t,this.bottom,l)+l/2,d=h=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(h,m),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&js(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;ar(i,d,0,h,u,l)}r&&Gs(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||Pt(e)?(u+=a.bottom,qt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:g,rotation:m}=fC(this,u,e,l);ar(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:m,textAlign:dC(l,e,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,e=t.ticks&&t.ticks.z||0,i=Mt(t.grid&&t.grid.z,-1),r=Mt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==dr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const l=e[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class La{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;gC(e)&&(i=this.register(e));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,hC(t,a,i),this.override&&se.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in se[r]&&(delete se[r][i],this.override&&delete sr[i])}}function hC(n,t,e){const i=Us(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&pC(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function pC(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),l=a.pop(),u=a.join(".");se.route(s,r,u,l)})}function gC(n){return"id"in n&&"defaults"in n}class mC{constructor(){this.controllers=new La(Ei,"datasets",!0),this.elements=new La(Ve,"elements"),this.plugins=new La(Object,"plugins"),this.scales=new La(dr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Jt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const r=Yc(t);Qt(i["before"+r],[],i),e[t](i),Qt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var qn=new mC;class yC{constructor(){this._init=void 0}notify(t,e,i,r){if(e==="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,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[e,r,s.options];if(Qt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){xt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Mt(i.options&&i.options.plugins,{}),s=_C(i);return r===!1&&!e?[]:xC(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function _C(n){const t={},e=[],i=Object.keys(qn.plugins.items);for(let s=0;s<i.length;s++)e.push(qn.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function bC(n,t){return!t&&n===!1?null:n===!0?{}:n}function xC(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=bC(i[u],r);d!==null&&s.push({plugin:l,options:wC(n.config,{plugin:l,local:e[u]},d,a)})}return s}function wC(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function mu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function vC(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function SC(n,t){return n===t?"_index_":"_value_"}function qg(n){if(n==="x"||n==="y"||n==="r")return n}function TC(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function yu(n,...t){if(qg(n))return n;for(const e of t){const i=e.axis||TC(e.position)||n.length>1&&qg(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function jg(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function MC(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return jg(n,"x",e[0])||jg(n,"y",e[0])}return{}}function kC(n,t){const e=sr[n.type]||{scales:{}},i=t.scales||{},r=mu(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Pt(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=yu(a,l,MC(a,n),se.scales[l.type]),d=SC(u,r),h=e.scales||{};s[a]=Hs(Object.create(null),[{axis:u},l,h[u],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||mu(l,t),h=(sr[l]||{}).scales||{};Object.keys(h).forEach(g=>{const m=vC(g,u),_=a[m+"AxisID"]||m;s[_]=s[_]||Object.create(null),Hs(s[_],[{axis:m},i[_],h[g]])})}),Object.keys(s).forEach(a=>{const l=s[a];Hs(l,[se.scales[l.type],se.scale])}),s}function Gg(n){const t=n.options||(n.options={});t.plugins=Mt(t.plugins,{}),t.scales=kC(n,t)}function Kg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function DC(n){return n=n||{},n.data=Kg(n.data),Gg(n),n}const Xg=new Map,Zg=new Set;function Na(n,t){let e=Xg.get(n);return e||(e=t(),Xg.set(n,e),Zg.add(e)),e}const ro=(n,t,e)=>{const i=Mi(t,e);i!==void 0&&n.add(i)};class CC{constructor(t){this._config=DC(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=Kg(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(),Gg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Na(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Na(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Na(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Na(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const u=new Set;e.forEach(h=>{t&&(u.add(t),h.forEach(g=>ro(u,t,g))),h.forEach(g=>ro(u,r,g)),h.forEach(g=>ro(u,sr[s]||{},g)),h.forEach(g=>ro(u,se,g)),h.forEach(g=>ro(u,Zc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),Zg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,sr[e]||{},se.datasets[e]||{},{type:e},se,Zc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Qg(this._resolverCache,t,r);let u=a;if(AC(a,e)){s.$shared=!1,i=nn(i)?i():i;const d=this.createResolver(t,i,l);u=Wr(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=Qg(this._resolverCache,t,i);return Pt(e)?Wr(s,e,void 0,r):s}}function Qg(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:eu(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const OC=n=>Pt(n)&&Object.getOwnPropertyNames(n).some(t=>nn(n[t]));function AC(n,t){const{isScriptable:e,isIndexable:i}=Xp(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(nn(l)||OC(l))||a&&qt(l))return!0}return!1}var RC="4.5.1";const EC=["top","bottom","left","right","chartArea"];function Jg(n,t){return n==="top"||n==="bottom"||EC.indexOf(n)===-1&&t==="x"}function tm(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function em(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function PC(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function nm(n){return ru()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ba={},im=n=>{const t=nm(n);return Object.values(Ba).filter(e=>e.canvas===t).pop()};function IC(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function LC(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let rn=class{static defaults=se;static instances=Ba;static overrides=sr;static registry=qn;static version=RC;static getChart=im;static register(...t){qn.add(...t),rm()}static unregister(...t){qn.remove(...t),rm()}constructor(t,e){const i=this.config=new CC(e),r=nm(t),s=im(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||JD(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=NM(),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 yC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=QM(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}si.listen(this,"complete",em),si.listen(this,"progress",PC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return xt(t)?e&&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 qn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jp(this.canvas,this.ctx),this}stop(){return si.stop(this),this}resize(t,e){si.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,rg(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Qt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Jt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const l=e[a],u=yu(a,l),d=u==="r",h=u==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=yu(u,l),h=Mt(l.type,a.dtype);(l.position===void 0||Jg(l.position,d)!==Jg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===h)g=i[u];else{const m=qn.getScale(h);g=new m({id:u,type:h,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{We.configure(this,a,a.options),We.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(tm("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[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=qn.getController(l),{datasetElementType:d,dataElementType:h}=se.datasets[l];Object.assign(u,{dataElementType:qn.getElement(h),datasetElementType:d&&qn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),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:g}=this.getDatasetMeta(d),m=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(m),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Jt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tm("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Jt(this.scales,t=>{We.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ep(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;IC(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=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<e;s++)if(!Ep(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;We.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Jt(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 e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,nn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(si.has(this)?this.attached&&!si.running(this)&&si.start(this):(this.draw(),em({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 e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[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 e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=pg(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&js(e,r),t.controller.draw(),r&&Gs(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ri(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=pu.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Oi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);en(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),si.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),jp(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Jt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,d)=>{e.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(e.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)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Jt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Jt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,l,u;for(e==="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 e=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}});!ya(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,d)=>u.filter(h=>!d.some(g=>h.datasetIndex===g.datasetIndex&&h.index===g.index)),a=s(e,t),l=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,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,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,l=this._getActiveElements(t,r,i,a),u=WM(t),d=LC(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Qt(s.onHover,[t,l,this],this),u&&Qt(s.onClick,[t,l,this],this));const h=!ya(l,r);return(h||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,h}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function rm(){return Jt(rn.instances,n=>n._plugins.invalidate())}function NC(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,g=Math.min(d/a,Ue(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),l>0){const m=Math.min(d/l,Ue(i-e));n.arc(r,s,l+d/2,e-m/2,i+m/2,!0)}else{const m=Math.min(d/2,a*Ue(i-e));if(h==="round")n.arc(r,s,m,e-Rt/2,i+Rt/2,!0);else if(h==="bevel"){const _=2*m*m,x=-_*Math.cos(e+Rt/2)+r,v=-_*Math.sin(e+Rt/2)+s,S=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;n.lineTo(x,v),n.lineTo(S,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function BC(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;n.beginPath(),n.arc(s,a,l,i-d,e+d),u>r?(d=r/u,n.arc(s,a,u,e+d,i-d,!0)):n.arc(s,a,r,e+re,i-re),n.closePath(),n.clip()}function FC(n){return tu(n,["outerStart","outerEnd","innerStart","innerEnd"])}function zC(n,t,e,i){const r=FC(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function Yr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Fa(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:h}=t,g=Math.max(t.outerRadius+i+e-d,0),m=h>0?h+i+e+d:0;let _=0;const x=r-u;if(i){const ft=h>0?h-i:0,j=g>0?g-i:0,tt=(ft+j)/2,nt=tt!==0?x*tt/(tt+i):x;_=(x-nt)/2}const v=Math.max(.001,x*g-e/Rt)/g,S=(x-v)/2,C=u+S+_,R=r-S-_,{outerStart:B,outerEnd:P,innerStart:L,innerEnd:I}=zC(t,m,g,R-C),N=g-B,T=g-P,M=C+B/N,O=R-P/T,z=m+L,W=m+I,it=C+L/z,ut=R-I/W;if(n.beginPath(),s){const ft=(M+O)/2;if(n.arc(a,l,g,M,ft),n.arc(a,l,g,ft,O),P>0){const et=Yr(T,O,a,l);n.arc(et.x,et.y,P,O,R+re)}const j=Yr(W,R,a,l);if(n.lineTo(j.x,j.y),I>0){const et=Yr(W,ut,a,l);n.arc(et.x,et.y,I,R+re,ut+Math.PI)}const tt=(R-I/m+(C+L/m))/2;if(n.arc(a,l,m,R-I/m,tt,!0),n.arc(a,l,m,tt,C+L/m,!0),L>0){const et=Yr(z,it,a,l);n.arc(et.x,et.y,L,it+Math.PI,C-re)}const nt=Yr(N,C,a,l);if(n.lineTo(nt.x,nt.y),B>0){const et=Yr(N,M,a,l);n.arc(et.x,et.y,B,C-re,M)}}else{n.moveTo(a,l);const ft=Math.cos(M)*g+a,j=Math.sin(M)*g+l;n.lineTo(ft,j);const tt=Math.cos(O)*g+a,nt=Math.sin(O)*g+l;n.lineTo(tt,nt)}n.closePath()}function UC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Fa(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Fa(n,t,e,i,u,r),n.fill(),u}function HC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:g,borderDashOffset:m,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=m,x?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let v=t.endAngle;if(s){Fa(n,t,e,i,v,r);for(let S=0;S<s;++S)n.stroke();isNaN(l)||(v=a+(l%te||te))}x&&BC(n,t,v),u.selfJoin&&v-a>=Rt&&_===0&&h!=="miter"&&NC(n,t,v),s||(Fa(n,t,e,i,v,r),n.stroke())}class WC extends Ve{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,e,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=va(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),m=(this.options.spacing+this.options.borderWidth)/2,_=Mt(g,u-l),x=Vs(s,l,u)&&l!==u,v=_>=te||x,S=ni(a,d+m,h+m);return v&&S}getCenterPoint(t){const{x:e,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,g=(a+l+d+u)/2;return{x:e+Math.cos(h)*g,y:i+Math.sin(h)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):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=e.backgroundColor,t.strokeStyle=e.borderColor,UC(t,this,d,s,a),HC(t,this,d,s,a),t.restore()}}function sm(n,t,e=t){n.lineCap=Mt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Mt(e.borderDash,t.borderDash)),n.lineDashOffset=Mt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Mt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Mt(e.borderWidth,t.borderWidth),n.strokeStyle=Mt(e.borderColor,t.borderColor)}function VC(n,t,e){n.lineTo(e.x,e.y)}function $C(n){return n.stepped?uk:n.tension||n.cubicInterpolationMode==="monotone"?dk:VC}function om(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{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 YC(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=om(r,e,i),h=$C(s);let{move:g=!0,reverse:m}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(m?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):h(n,v,x,m,s.stepped),v=x);return u&&(x=r[(l+(m?d:0))%a],h(n,v,x,m,s.stepped)),!!u}function qC(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=om(r,e,i),{move:u=!0,reverse:d}=i||{};let h=0,g=0,m,_,x,v,S,C;const R=P=>(a+(d?l-P:P))%s,B=()=>{v!==S&&(n.lineTo(h,S),n.lineTo(h,v),n.lineTo(h,C))};for(u&&(_=r[R(0)],n.moveTo(_.x,_.y)),m=0;m<=l;++m){if(_=r[R(m)],_.skip)continue;const P=_.x,L=_.y,I=P|0;I===x?(L<v?v=L:L>S&&(S=L),h=(g*h+P)/++g):(B(),n.lineTo(P,L),x=I,g=0,v=S=L),C=L}B()}function _u(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?qC:YC}function jC(n){return n.stepped?Vk:n.tension||n.cubicInterpolationMode==="monotone"?$k:cr}function GC(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),sm(n,t.options),n.stroke(r)}function KC(n,t,e,i){const{segments:r,options:s}=t,a=_u(t);for(const l of r)sm(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const XC=typeof Path2D=="function";function ZC(n,t,e,i){XC&&!t.options.segment?GC(n,t,e,i):KC(n,t,e,i)}class za extends Ve{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,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Lk(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Xk(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=dg(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=jC(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:g,end:m}=a[d],_=s[g],x=s[m];if(_===x){l.push(_);continue}const v=Math.abs((r-_[e])/(x[e]-_[e])),S=u(_,x,v,i.stepped);S[e]=t[e],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,e,i){return _u(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=_u(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const l of r)a&=s(t,this,l,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),ZC(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function am(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class QC extends Ve{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,e,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return am(this,t,"x",e)}inYRange(t,e){return am(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ri(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Jc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function lm(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let l,u,d,h,g;return n.horizontal?(g=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-g,h=i+g):(g=s/2,l=e-g,u=e+g,d=Math.min(i,r),h=Math.max(i,r)),{left:l,top:d,right:u,bottom:h}}function Pi(n,t,e,i){return n?0:Ce(t,e,i)}function JC(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=Kp(i);return{t:Pi(r.top,s.top,0,e),r:Pi(r.right,s.right,0,t),b:Pi(r.bottom,s.bottom,0,e),l:Pi(r.left,s.left,0,t)}}function tO(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Ci(r),a=Math.min(t,e),l=n.borderSkipped,u=i||Pt(r);return{topLeft:Pi(!u||l.top||l.left,s.topLeft,0,a),topRight:Pi(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Pi(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Pi(!u||l.bottom||l.right,s.bottomRight,0,a)}}function eO(n){const t=lm(n),e=t.right-t.left,i=t.bottom-t.top,r=JC(n,e/2,i/2),s=tO(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-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 bu(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&lm(n,i);return l&&(r||ni(t,l.left,l.right))&&(s||ni(e,l.top,l.bottom))}function nO(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function iO(n,t){n.rect(t.x,t.y,t.w,t.h)}function xu(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class rO extends Ve{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:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=eO(this),l=nO(a.radius)?Hr:iO;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,xu(a,e,s)),t.clip(),l(t,xu(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,xu(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return bu(this,t,e,i)}inXRange(t,e){return bu(this,t,null,e)}inYRange(t,e){return bu(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var sO=Object.freeze({__proto__:null,ArcElement:WC,BarElement:rO,LineElement:za,PointElement:QC});const wu=["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)"],cm=wu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function um(n){return wu[n%wu.length]}function dm(n){return cm[n%cm.length]}function oO(n,t){return n.borderColor=um(t),n.backgroundColor=dm(t),++t}function aO(n,t){return n.backgroundColor=n.data.map(()=>um(t++)),t}function lO(n,t){return n.backgroundColor=n.data.map(()=>dm(t++)),t}function cO(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Zs?t=aO(e,t):r instanceof Cg?t=lO(e,t):r&&(t=oO(e,t))}}function fm(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function uO(n){return n&&(n.borderColor||n.backgroundColor)}function dO(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var fO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=fm(i)||uO(r)||s&&fm(s)||dO();if(!e.forceOverride&&a)return;const l=cO(n);i.forEach(l)}};function hO(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(s-2);let u=0;const d=t+e-1;let h=t,g,m,_,x,v;for(a[u++]=n[h],g=0;g<s-2;g++){let S=0,C=0,R;const B=Math.floor((g+1)*l)+1+t,P=Math.min(Math.floor((g+2)*l)+1,e)+t,L=P-B;for(R=B;R<P;R++)S+=n[R].x,C+=n[R].y;S/=L,C/=L;const I=Math.floor(g*l)+1+t,N=Math.min(Math.floor((g+1)*l)+1,e)+t,{x:T,y:M}=n[h];for(_=x=-1,R=I;R<N;R++)x=.5*Math.abs((T-S)*(n[R].y-M)-(T-n[R].x)*(C-M)),x>_&&(_=x,m=n[R],v=R);a[u++]=m,h=v}return a[u++]=n[d],a}function pO(n,t,e,i){let r=0,s=0,a,l,u,d,h,g,m,_,x,v;const S=[],C=t+e-1,R=n[t].x,P=n[C].x-R;for(a=t;a<t+e;++a){l=n[a],u=(l.x-R)/P*i,d=l.y;const L=u|0;if(L===h)d<x?(x=d,g=a):d>v&&(v=d,m=a),r=(s*r+l.x)/++s;else{const I=a-1;if(!xt(g)&&!xt(m)){const N=Math.min(g,m),T=Math.max(g,m);N!==_&&N!==I&&S.push({...n[N],x:r}),T!==_&&T!==I&&S.push({...n[T],x:r})}a>0&&I!==_&&S.push(n[I]),S.push(l),h=L,s=0,x=v=d,g=m=_=a}}return S}function hm(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function pm(n){n.data.datasets.forEach(t=>{hm(t)})}function gO(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ii(t,s.axis,a).lo,0,e-1)),d?r=Ce(ii(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var mO={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){pm(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Ks([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=n.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:g,count:m}=gO(u,d);const _=e.threshold||4*i;if(m<=_){hm(r);return}xt(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(e.algorithm){case"lttb":x=hO(d,g,m,i,e);break;case"min-max":x=pO(d,g,m,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){pm(n)}};function yO(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=Ua(u,d,r);const h=vu(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:r[u],end:r[d]});continue}const g=dg(t,h);for(const m of g){const _=vu(e,s[m.start],s[m.end],m.loop),x=ug(l,r,_);for(const v of x)a.push({source:v,target:m,start:{[e]:gm(h,_,"start",Math.max)},end:{[e]:gm(h,_,"end",Math.min)}})}}return a}function vu(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Ue(r),s=Ue(s)),{property:n,start:r,end:s}}function _O(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Ua(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})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:d.y}))}),s}function Ua(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function gm(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function mm(n,t){let e=[],i=!1;return qt(n)?(i=!0,e=n):e=_O(n,t),e.length?new za({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ym(n){return n&&n.fill!==!1}function bO(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ae(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function xO(n,t,e){const i=TO(n);if(Pt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?wO(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function wO(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function vO(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:Pt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function SO(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:Pt(n)?i=n.value:i=t.getBaseValue(),i}function TO(n){const t=n.options,e=t.fill;let i=Mt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function MO(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=kO(t,e);l.push(mm({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++)DO(r,a[h],l)}return new za({points:r,options:{}})}function kO(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function DO(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=CO(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function CO(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],g=a[h.start][e],m=a[h.end][e];if(ni(r,g,m)){l=r===g,u=r===m;break}}return{first:l,last:u,point:i}}class _m{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:te},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function OO(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return AO(t,e);if(e==="stack")return MO(n);if(e==="shape")return!0;const r=RO(n);return r instanceof _m?r:mm(r,i)}function AO(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function RO(n){return(n.scale||{}).getPointPositionForValue?PO(n):EO(n)}function EO(n){const{scale:t={},fill:e}=n,i=vO(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function PO(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=SO(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new _m({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 Su(n,t,e){const i=OO(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,h=d.fill,g=d.backgroundColor,{above:m=g,below:_=g}=h||{},x=r.getDatasetMeta(s),v=pg(r,x);i&&a.points.length&&(js(n,e),IO(n,{line:a,target:i,above:m,below:_,area:e,scale:l,axis:u,clip:v}),Gs(n))}function IO(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let h=s;s!==r&&(d==="x"?(bm(n,i,a.top),Tu(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),bm(n,i,a.bottom)):d==="y"&&(xm(n,i,a.left),Tu(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),xm(n,i,a.right),h=r)),Tu(n,{line:e,target:i,color:h,scale:l,property:d,clip:u}),n.restore()}function bm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function xm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(e,h.y),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Tu(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=yO(e,i,r);for(const{source:d,target:h,start:g,end:m}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,LO(n,a,l,x&&vu(r,g,m)),n.beginPath();const v=!!e.pathSegment(n,d);let S;if(x){v?n.closePath():wm(n,i,m,r);const C=!!i.pathSegment(n,h,{move:v,reverse:!0});S=v&&C,S||wm(n,i,g,r)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function LO(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,h,g;s==="x"?(u=a,d=r.top,h=l,g=r.bottom):(u=r.left,d=a,h=r.right,g=l),n.beginPath(),e&&(u=Math.max(u,e.left),h=Math.min(h,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,h-u,g-d),n.clip()}}function wm(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var NO={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof za&&(u={visible:n.isDatasetVisible(a),index:a,fill:xO(l,a,i),chart:n,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=bO(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.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&&Su(n.ctx,l,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;ym(s)&&Su(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ym(i)||e.drawTime!=="beforeDatasetDraw"||Su(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const vm=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},BO=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Sm extends Ve{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Qt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=le(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=vm(i,s);let d,h;e.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,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+l;let g=t;s.textAlign="left",s.textBaseline="middle";let m=-1,_=-h;return this.legendItems.forEach((x,v)=>{const S=i+e/2+s.measureText(x.text).width;(v===0||d[d.length-1]+S+2*l>a)&&(g+=h,d[d.length-(v>0?0:1)]=0,_+=h,m++),u[v]={left:0,top:_,row:m,width:S,height:r},d[d.length-1]+=S+l}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let g=l,m=0,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:R,itemHeight:B}=FO(i,e,s,S,r);C>0&&_+B+2*l>h&&(g+=m+l,d.push({width:m,height:_}),x+=m+l,v++,m=_=0),u[C]={left:x,top:_,col:v,width:R,height:B},m=Math.max(m,R),_+=B+l}),g+=m,d.push({width:m,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=$r(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=He(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=He(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=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=He(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;js(t,this),this._draw(),Gs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=$r(t.rtl,this.left,this.width),d=le(a.font),{padding:h}=a,g=d.size,m=g/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}=vm(a,g),C=function(I,N,T){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const M=Mt(T.lineWidth,1);if(r.fillStyle=Mt(T.fillStyle,l),r.lineCap=Mt(T.lineCap,"butt"),r.lineDashOffset=Mt(T.lineDashOffset,0),r.lineJoin=Mt(T.lineJoin,"miter"),r.lineWidth=M,r.strokeStyle=Mt(T.strokeStyle,l),r.setLineDash(Mt(T.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:M},z=u.xPlus(I,x/2),W=N+m;Gp(r,O,z,W,a.pointStyleWidth&&x)}else{const O=N+Math.max((g-v)/2,0),z=u.leftForLtr(I,x),W=Ci(T.borderRadius);r.beginPath(),Object.values(W).some(it=>it!==0)?Hr(r,{x:z,y:O,w:x,h:v,radius:W}):r.rect(z,O,x,v),r.fill(),M!==0&&r.stroke()}r.restore()},R=function(I,N,T){ar(r,T.text,I,N+S/2,d,{strikethrough:T.hidden,textAlign:u.textAlign(T.textAlign)})},B=this.isHorizontal(),P=this._computeTitleHeight();B?_={x:He(s,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:_={x:this.left+h,y:He(s,this.top+P+h,this.bottom-e[0].height),line:0},og(this.ctx,t.textDirection);const L=S+h;this.legendItems.forEach((I,N)=>{r.strokeStyle=I.fontColor,r.fillStyle=I.fontColor;const T=r.measureText(I.text).width,M=u.textAlign(I.textAlign||(I.textAlign=a.textAlign)),O=x+m+T;let z=_.x,W=_.y;u.setWidth(this.width),B?N>0&&z+O+h>this.right&&(W=_.y+=L,_.line++,z=_.x=He(s,this.left+h,this.right-i[_.line])):N>0&&W+L>this.bottom&&(z=_.x=z+e[_.line].width+h,_.line++,W=_.y=He(s,this.top+P+h,this.bottom-e[_.line].height));const it=u.x(z);if(C(it,W,I),z=JM(M,z+x+m,B?z+O:this.right,t.rtl),R(u.x(z),W,I),B)_.x+=O+h;else if(typeof I.text!="string"){const ut=d.lineHeight;_.y+=Tm(I,ut)+h}else _.y+=L}),ag(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=$r(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let h,g=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),h=this.top+d,g=He(t.align,g,this.right-m);else{const x=this.columnSizes.reduce((v,S)=>Math.max(v,S.height),0);h=d+He(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=He(l,g,g+m);a.textAlign=s.textAlign(Gc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,ar(a,e.text,_,h,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ni(t,this.left,this.right)&&ni(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ni(t,r.left,r.left+r.width)&&ni(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!HO(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=BO(r,i);r&&!s&&Qt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Qt(e.onHover,[t,i,this],this)}else i&&Qt(e.onClick,[t,i,this],this)}}function FO(n,t,e,i,r){const s=zO(i,n,t,e),a=UO(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function zO(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function UO(n,t,e){let i=n;return typeof t.text!="string"&&(i=Tm(t,e)),i}function Tm(n,t){const e=n.text?n.text.length:0;return t*e}function HO(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var WO={id:"legend",_element:Sm,start(n,t,e){const i=n.legend=new Sm({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i)},stop(n){We.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;We.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),h=we(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:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Mu extends Ve{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=qt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(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:e,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,h,g;return this.isHorizontal()?(h=He(l,i,s),g=e+t,d=s-i):(a.position==="left"?(h=i+t,g=He(l,r,e),u=Rt*-.5):(h=s-t,g=He(l,e,r),u=Rt*.5),d=r-e),{titleX:h,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);ar(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:Gc(e.align),textBaseline:"middle",translation:[a,l]})}}function VO(n,t){const e=new Mu({ctx:n.ctx,options:t,chart:n});We.configure(n,e,t),We.addBox(n,e),n.titleBlock=e}var $O={id:"title",_element:Mu,start(n,t,e){VO(n,e)},stop(n){const t=n.titleBlock;We.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ha=new WeakMap;var YO={id:"subtitle",start(n,t,e){const i=new Mu({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i),Ha.set(n,i)},stop(n){We.removeBox(n,Ha.get(n)),Ha.delete(n)},beforeUpdate(n,t,e){const i=Ha.get(n);We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const so={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const l=n[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(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Ur(t,d);h<r&&(r=h,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function jn(n,t){return t&&(qt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function oi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
1
+ (function(Yt,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider"],p):(Yt=typeof globalThis<"u"?globalThis:Yt||self,p(Yt["kong-ui-publicvitals-chart"]={},Yt.Vue,Yt.KongIcons,Yt["kong-ui-public-i18n"],Yt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Yt,p,Ts,Xf,Qi){"use strict";var gt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(gt||{});const Vb=["in","not_in","selector"],$b=["empty","not_empty"],Yb=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ji=n=>n.filter(t=>t!=="time"),Zf=["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"],Qf=Ji(Zf),qb=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Jf=[...Zf,"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"],th=Ji(Jf),jb=[...qb,"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"],Gb=["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"],eh=Ji(Gb),Kb=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","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"],Xb=Ji(Kb),Zb=["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"],Qb=Zb,Jb=["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=Ji(Jb),ex=["platform","platform_usage"],nx=n=>ex.includes(n),ix=[...Jf.filter(n=>n!=="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"],nh=Ji(ix);[...jb];const rx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],ih=Ji(rx);new Set(Qf),new Set(th),new Set(eh),new Set(nh),new Set(ih);const rh=[{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"}];rh.map(n=>n.code);const sh=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Vb},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:$b}},required:["field","operator"],additionalProperties:!1}]}}),sx=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];sh(Array.from(new Set([...Xb,...Qb,...tx]))),sh([...new Set([...th,...Qf,...eh,...nh,...sx,...ih])]);const ox={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"}},ax=(n,t,e)=>{let i;const r=ox[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function _c(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const lx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ux={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dx={date:_c({formats:lx,defaultWidth:"full"}),time:_c({formats:cx,defaultWidth:"full"}),dateTime:_c({formats:ux,defaultWidth:"full"})},fx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hx=(n,t,e,i)=>fx[n];function Ms(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const px={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mx={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"]},yx={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"]},_x={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"}},bx={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"}},xx=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},wx={ordinalNumber:xx,era:Ms({values:px,defaultWidth:"wide"}),quarter:Ms({values:gx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ms({values:mx,defaultWidth:"wide"}),day:Ms({values:yx,defaultWidth:"wide"}),dayPeriod:Ms({values:_x,defaultWidth:"wide",formattingValues:bx,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?Sx(l,g=>g.test(a)):vx(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function vx(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Sx(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Tx(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Mx=/^(\d+)(th|st|nd|rd)?/i,kx=/\d+/i,Dx={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},Cx={any:[/^b/i,/^(a|c)/i]},Ox={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ax={any:[/1/i,/2/i,/3/i,/4/i]},Ex={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},Rx={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]},Px={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},Ix={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]},Lx={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},Nx={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}},Bx={ordinalNumber:Tx({matchPattern:Mx,parsePattern:kx,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:Dx,defaultMatchWidth:"wide",parsePatterns:Cx,defaultParseWidth:"any"}),quarter:ks({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:Ex,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),day:ks({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:Lx,defaultMatchWidth:"any",parsePatterns:Nx,defaultParseWidth:"any"})},Fx={code:"en-US",formatDistance:ax,formatLong:dx,formatRelative:hx,localize:wx,match:Bx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let zx={};function Ds(){return zx}const oh=6048e5,Ux=864e5,Hx=60,Wx=3600,ah=Symbol.for("constructDateFrom");function Sn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ah in n?n[ah](t):n instanceof Date?new n.constructor(t):new Date(t)}function ze(n,t){return Sn(t||n,n)}function lh(n){const t=ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Vx(n,...t){const e=Sn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Er(n,t){const e=ze(n,t?.in);return e.setHours(0,0,0,0),e}function $x(n,t,e){const[i,r]=Vx(e?.in,n,t),s=Er(i),a=Er(r),l=+s-lh(s),u=+a-lh(a);return Math.round((l-u)/Ux)}function Yx(n,t){const e=ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function qx(n,t){const e=ze(n,t?.in);return $x(e,Yx(e))+1}function Jn(n,t){const e=Ds(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=ze(n,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 Jo(n,t){return Jn(n,{...t,weekStartsOn:1})}function ch(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Sn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Jo(r),a=Sn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Jo(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function jx(n,t){const e=ch(n,t),i=Sn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Jo(i)}function Gx(n,t){const e=ze(n,t?.in),i=+Jo(e)-+jx(e);return Math.round(i/oh)+1}function uh(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Ds(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Sn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Jn(a,t),u=Sn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Jn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function Kx(n,t){const e=Ds(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=uh(n,t),s=Sn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Jn(s,t)}function Xx(n,t){const e=ze(n,t?.in),i=+Jn(e,t)-+Kx(e,t);return Math.round(i/oh)+1}function Xt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const wi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Xt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Xt(e+1,2)},d(n,t){return Xt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Xt(n.getHours()%12||12,t.length)},H(n,t){return Xt(n.getHours(),t.length)},m(n,t){return Xt(n.getMinutes(),t.length)},s(n,t){return Xt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Xt(r,t.length)}},Rr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return wi.y(n,t)},Y:function(n,t,e,i){const r=uh(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Xt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Xt(s,t.length)},R:function(n,t){const e=ch(n);return Xt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Xt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Xt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Xt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return wi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Xt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=Xx(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=Gx(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Xt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):wi.d(n,t)},D:function(n,t,e){const i=qx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Xt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Xt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Xt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Xt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Rr.noon:i===0?r=Rr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Rr.evening:i>=12?r=Rr.afternoon:i>=4?r=Rr.morning:r=Rr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return wi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):wi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):wi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):wi.s(n,t)},S:function(n,t){return wi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return hh(i);case"XXXX":case"XX":return tr(i);default:return tr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return hh(i);case"xxxx":case"xx":return tr(i);default:return tr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+fh(i,":");default:return"GMT"+tr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+fh(i,":");default:return"GMT"+tr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Xt(i,t.length)},T:function(n,t,e){return Xt(+n,t.length)}};function fh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Xt(s,2)}function hh(n,t){return n%60===0?(n>0?"-":"+")+Xt(Math.abs(n)/60,2):tr(n,t)}function tr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Xt(Math.trunc(i/60),2),s=Xt(i%60,2);return e+r+t+s}const ph=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},gh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Zx=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return ph(n,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}}",ph(i,t)).replace("{{time}}",gh(r,t))},Qx={p:gh,P:Zx},Jx=/^D+$/,tw=/^Y+$/,ew=["D","DD","YY","YYYY"];function nw(n){return Jx.test(n)}function iw(n){return tw.test(n)}function rw(n,t,e){const i=sw(n,t,e);if(console.warn(i),ew.includes(n))throw new RangeError(i)}function sw(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function ow(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function aw(n){return!(!ow(n)&&typeof n!="number"||isNaN(+ze(n)))}const lw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uw=/^'([^]*?)'?$/,dw=/''/g,fw=/[a-zA-Z]/;function hw(n,t,e){const i=Ds(),r=e?.locale??i.locale??Fx,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ze(n,e?.in);if(!aw(l))throw new RangeError("Invalid time value");let u=t.match(cw).map(h=>{const g=h[0];if(g==="p"||g==="P"){const m=Qx[g];return m(h,r.formatLong)}return h}).join("").match(lw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:pw(h)};if(dh[g])return{isToken:!0,value:h};if(g.match(fw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");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 g=h.value;(!e?.useAdditionalWeekYearTokens&&iw(g)||!e?.useAdditionalDayOfYearTokens&&nw(g))&&rw(g,t,String(n));const m=dh[g[0]];return m(l,g,r.localize,d)}).join("")}function pw(n){const t=n.match(uw);return t?t[1].replace(dw,"'"):n}function ta(n,t,e){const i=ze(n,e?.in);return isNaN(t)?Sn(n,NaN):(i.setDate(i.getDate()+t),i)}function mh(n,t,e){const i=ze(n,e?.in);if(isNaN(t))return Sn(n,NaN);if(!t)return i;const r=i.getDate(),s=Sn(n,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 gw(n,t,e){return mh(n,t*3,e)}function Pr(n,t){const e=ze(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Ir(n,t){const e=ze(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function mw(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Sn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function yw(){return Object.assign({},Ds())}function yh(n){return Math.trunc(n*Wx)}function _w(n){const t=n/Hx;return Math.trunc(t)}function _h(n,t,e){return mh(n,-1,e)}function bh(n,t,e){return gw(n,-1,e)}function xh(n,t,e){const i=yw(),r=ww(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?bw(r,t):xw(r,t)}function bw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function xw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function ww(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function vw(n,t){const e=Dw(t);return"formatToParts"in e?Tw(e,n):Mw(e,n)}const Sw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Tw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Sw[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Mw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const bc={},wh=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")),kw=wh==="06/25/2014, 00:00:00"||wh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Dw(n){return bc[n]||(bc[n]=kw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),bc[n]}function xc(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const vh=36e5,Cw=6e4,wc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Cs(n,t,e){if(!n)return 0;let i=wc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=wc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Sh(r)?-(r*vh):NaN;if(i=wc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Sh(r,a)?(s=Math.abs(r)*vh+a*Cw,i[1]==="+"?-s:s):NaN}if(Ew(n)){t=new Date(t||Date.now());const a=e?t:Ow(t),l=vc(a,n);return-(e?l:Aw(t,l,n))}return NaN}function Ow(n){return xc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function vc(n,t){const e=vw(n,t),i=xc(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function Aw(n,t,e){let i=n.getTime()-t;const r=vc(new Date(i),e);if(t===r)return t;i-=r-t;const s=vc(new Date(i),e);return r===s?r:Math.max(r,s)}function Sh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Th={};function Ew(n){if(Th[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Th[n]=!0,!0}catch{return!1}}const Rw=60*1e3,Pw={X:function(n,t,e){const i=Sc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Mh(i);case"XXXX":case"XX":return Lr(i);default:return Lr(i,":")}},x:function(n,t,e){const i=Sc(e.timeZone,n);switch(t){case"x":return Mh(i);case"xxxx":case"xx":return Lr(i);default:return Lr(i,":")}},O:function(n,t,e){const i=Sc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Iw(i,":");default:return"GMT"+Lr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return xh("short",n,e);default:return xh("long",n,e)}}};function Sc(n,t){const e=n?Cs(n,t,!0)/Rw:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ea(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Lr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=ea(Math.floor(i/60),2),s=ea(Math.floor(i%60),2);return e+r+t+s}function Mh(n,t){return n%60===0?(n>0?"-":"+")+ea(Math.abs(n)/60,2):Lr(n,t)}function Iw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+ea(s,2)}function kh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Dh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Tc=36e5,Ch=6e4,Lw=2,Ke={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:Dh};function na(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Lw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Nw(n),{year:r,restDateString:s}=Bw(i.date,e),a=Fw(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=zw(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Cs(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=kh(new Date(l+u)),d=kh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function Nw(n){const t={};let e=Ke.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ke.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ke.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Bw(n,t){if(n){const e=Ke.YYY[t],i=Ke.YYYYY[t];let r=Ke.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ke.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function Fw(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ke.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Eh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ke.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return Ww(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ke.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Eh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ke.Www.exec(n),s)return r=parseInt(s[1],10)-1,Rh(r)?Oh(t,r):new Date(NaN);if(s=Ke.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Rh(r,a)?Oh(t,r,a):new Date(NaN)}return null}function zw(n){let t,e,i=Ke.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Mc(t)?t%24*Tc:NaN;if(i=Ke.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Mc(t,e)?t%24*Tc+e*Ch:NaN;if(i=Ke.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Mc(t,e,r)?t%24*Tc+e*Ch+r*1e3:NaN}return null}function Oh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Uw=[31,28,31,30,31,30,31,31,30,31,30,31],Hw=[31,29,31,30,31,30,31,31,30,31,30,31];function Ah(n){return n%400===0||n%4===0&&n%100!==0}function Eh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ah(n);if(i&&e>Hw[t]||!i&&e>Uw[t])return!1}return!0}function Ww(n,t){if(t<1)return!1;const e=Ah(n);return!(e&&t>366||!e&&t>365)}function Rh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Mc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Vw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function $w(n,t,e={}){t=String(t);const i=t.match(Vw);if(i){const r=na(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+Pw[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return hw(n,t,e)}function Ph(n,t,e){n=na(n,e);const i=Cs(t,n,!0),r=new Date(n.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 Ih(n,t,e,i){return i={...i,timeZone:t,originalDate:n},$w(Ph(n,t,{timeZone:i.timeZone}),e,i)}function Yw(n,t,e){if(typeof n=="string"&&!n.match(Dh))return na(n,{...e,timeZone:t});n=na(n,e);const i=xc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=Cs(t,new Date(i));return new Date(i+r)}function qw(n,t){return-Cs(n,t)}function Lh(n,t={}){const e=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)"),Ih(n,e,i)}function jw(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return Ih(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Gw={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 ia(n){return n&&Yb.find(t=>n<=Gw[t])||null}var ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sa={exports:{}};sa.exports;var Nh;function Kw(){return Nh||(Nh=1,(function(n,t){var e=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]",g="[object GeneratorFunction]",m="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",E="[object String]",B="[object Symbol]",P="[object WeakMap]",L="[object ArrayBuffer]",I="[object DataView]",N="[object Float32Array]",T="[object Float64Array]",M="[object Int8Array]",O="[object Int16Array]",z="[object Int32Array]",W="[object Uint8Array]",it="[object Uint8ClampedArray]",ut="[object Uint16Array]",ft="[object Uint32Array]",j=/[\\^$.*+?()[\]{}|]/g,tt=/\w*$/,nt=/^\[object .+?Constructor\]$/,et=/^(?:0|[1-9]\d*)$/,at={};at[s]=at[a]=at[L]=at[I]=at[l]=at[u]=at[N]=at[T]=at[M]=at[O]=at[z]=at[m]=at[_]=at[x]=at[S]=at[C]=at[E]=at[B]=at[W]=at[it]=at[ut]=at[ft]=!0,at[d]=at[h]=at[P]=!1;var H=typeof ra=="object"&&ra&&ra.Object===Object&&ra,q=typeof self=="object"&&self&&self.Object===Object&&self,X=H||q||Function("return this")(),_t=t&&!t.nodeType&&t,G=_t&&!0&&n&&!n.nodeType&&n,$=G&&G.exports===_t;function st(D,V){return D.set(V[0],V[1]),D}function ot(D,V){return D.add(V),D}function lt(D,V){for(var J=-1,mt=D?D.length:0;++J<mt&&V(D[J],J,D)!==!1;);return D}function pt(D,V){for(var J=-1,mt=V.length,Te=D.length;++J<mt;)D[Te+J]=V[J];return D}function dt(D,V,J,mt){for(var Te=-1,qe=D?D.length:0;++Te<qe;)J=V(J,D[Te],Te,D);return J}function It(D,V){for(var J=-1,mt=Array(D);++J<D;)mt[J]=V(J);return mt}function zt(D,V){return D?.[V]}function vt(D){var V=!1;if(D!=null&&typeof D.toString!="function")try{V=!!(D+"")}catch{}return V}function Ct(D){var V=-1,J=Array(D.size);return D.forEach(function(mt,Te){J[++V]=[Te,mt]}),J}function Dt(D,V){return function(J){return D(V(J))}}function ve(D){var V=-1,J=Array(D.size);return D.forEach(function(mt){J[++V]=mt}),J}var bt=Array.prototype,jt=Function.prototype,Oe=Object.prototype,Ae=X["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),ln=jt.toString,Vt=Oe.hasOwnProperty,Le=Oe.toString,ie=RegExp("^"+ln.call(Vt).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=$?X.Buffer:void 0,Ee=X.Symbol,gn=X.Uint8Array,zi=Dt(Object.getPrototypeOf,Object),Dn=Object.create,Ye=Oe.propertyIsEnumerable,In=bt.splice,ci=Object.getOwnPropertySymbols,So=Se?Se.isBuffer:void 0,To=Dt(Object.keys,Object),br=Gn(X,"DataView"),ui=Gn(X,"Map"),Mo=Gn(X,"Promise"),ko=Gn(X,"Set"),Do=Gn(X,"WeakMap"),Ui=Gn(Object,"create"),pl=fi(br),fd=fi(ui),hd=fi(Mo),pd=fi(ko),gd=fi(Do),Co=Ee?Ee.prototype:void 0,gl=Co?Co.valueOf:void 0;function di(D){var V=-1,J=D?D.length:0;for(this.clear();++V<J;){var mt=D[V];this.set(mt[0],mt[1])}}function md(){this.__data__=Ui?Ui(null):{}}function Oo(D){return this.has(D)&&delete this.__data__[D]}function yd(D){var V=this.__data__;if(Ui){var J=V[D];return J===i?void 0:J}return Vt.call(V,D)?V[D]:void 0}function Ao(D){var V=this.__data__;return Ui?V[D]!==void 0:Vt.call(V,D)}function _d(D,V){var J=this.__data__;return J[D]=Ui&&V===void 0?i:V,this}di.prototype.clear=md,di.prototype.delete=Oo,di.prototype.get=yd,di.prototype.has=Ao,di.prototype.set=_d;function Ln(D){var V=-1,J=D?D.length:0;for(this.clear();++V<J;){var mt=D[V];this.set(mt[0],mt[1])}}function bd(){this.__data__=[]}function xd(D){var V=this.__data__,J=xr(V,D);if(J<0)return!1;var mt=V.length-1;return J==mt?V.pop():In.call(V,J,1),!0}function wd(D){var V=this.__data__,J=xr(V,D);return J<0?void 0:V[J][1]}function ml(D){return xr(this.__data__,D)>-1}function vd(D,V){var J=this.__data__,mt=xr(J,D);return mt<0?J.push([D,V]):J[mt][1]=V,this}Ln.prototype.clear=bd,Ln.prototype.delete=xd,Ln.prototype.get=wd,Ln.prototype.has=ml,Ln.prototype.set=vd;function Hi(D){var V=-1,J=D?D.length:0;for(this.clear();++V<J;){var mt=D[V];this.set(mt[0],mt[1])}}function yl(){this.__data__={hash:new di,map:new(ui||Ln),string:new di}}function Sd(D){return wr(this,D).delete(D)}function Td(D){return wr(this,D).get(D)}function Md(D){return wr(this,D).has(D)}function kd(D,V){return wr(this,D).set(D,V),this}Hi.prototype.clear=yl,Hi.prototype.delete=Sd,Hi.prototype.get=Td,Hi.prototype.has=Md,Hi.prototype.set=kd;function Wi(D){this.__data__=new Ln(D)}function Dd(){this.__data__=new Ln}function ns(D){return this.__data__.delete(D)}function Cd(D){return this.__data__.get(D)}function is(D){return this.__data__.has(D)}function Od(D,V){var J=this.__data__;if(J instanceof Ln){var mt=J.__data__;if(!ui||mt.length<e-1)return mt.push([D,V]),this;J=this.__data__=new Hi(mt)}return J.set(D,V),this}Wi.prototype.clear=Dd,Wi.prototype.delete=ns,Wi.prototype.get=Cd,Wi.prototype.has=is,Wi.prototype.set=Od;function Ad(D,V){var J=Lo(D)||El(D)?It(D.length,String):[],mt=J.length,Te=!!mt;for(var qe in D)Vt.call(D,qe)&&!(Te&&(qe=="length"||Dl(qe,mt)))&&J.push(qe);return J}function _l(D,V,J){var mt=D[V];(!(Vt.call(D,V)&&Al(mt,J))||J===void 0&&!(V in D))&&(D[V]=J)}function xr(D,V){for(var J=D.length;J--;)if(Al(D[J][0],V))return J;return-1}function bl(D,V){return D&&Ro(V,No(V),D)}function rs(D,V,J,mt,Te,qe,Nn){var Ne;if(mt&&(Ne=qe?mt(D,Te,qe,Nn):mt(D)),Ne!==void 0)return Ne;if(!cs(D))return D;var Pl=Lo(D);if(Pl){if(Ne=Ml(D),!V)return Tl(D,Ne)}else{var ce=cn(D),us=ce==h||ce==g;if(Hd(D))return wl(D,V);if(ce==x||ce==s||us&&!qe){if(vt(D))return qe?D:{};if(Ne=kl(us?{}:D),!V)return Po(D,bl(Ne,D))}else{if(!at[ce])return qe?D:{};Ne=Fd(D,ce,rs,V)}}Nn||(Nn=new Wi);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Ne),!Pl)var Bo=J?Bd(D):No(D);return lt(Bo||D,function(vr,Be){Bo&&(Be=vr,vr=D[Be]),_l(Ne,Be,rs(vr,V,J,mt,Be,D,Nn))}),Ne}function Ed(D){return cs(D)?Dn(D):{}}function Rd(D,V,J){var mt=V(D);return Lo(D)?mt:pt(mt,J(D))}function Pd(D){return Le.call(D)}function Id(D){if(!cs(D)||Ol(D))return!1;var V=ls(D)||vt(D)?ie:nt;return V.test(fi(D))}function xl(D){if(!Io(D))return To(D);var V=[];for(var J in Object(D))Vt.call(D,J)&&J!="constructor"&&V.push(J);return V}function wl(D,V){if(V)return D.slice();var J=new D.constructor(D.length);return D.copy(J),J}function ss(D){var V=new D.constructor(D.byteLength);return new gn(V).set(new gn(D)),V}function Eo(D,V){var J=V?ss(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.byteLength)}function Ld(D,V,J){var mt=V?J(Ct(D),!0):Ct(D);return dt(mt,st,new D.constructor)}function vl(D){var V=new D.constructor(D.source,tt.exec(D));return V.lastIndex=D.lastIndex,V}function os(D,V,J){var mt=V?J(ve(D),!0):ve(D);return dt(mt,ot,new D.constructor)}function Sl(D){return gl?Object(gl.call(D)):{}}function Nd(D,V){var J=V?ss(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.length)}function Tl(D,V){var J=-1,mt=D.length;for(V||(V=Array(mt));++J<mt;)V[J]=D[J];return V}function Ro(D,V,J,mt){J||(J={});for(var Te=-1,qe=V.length;++Te<qe;){var Nn=V[Te],Ne=void 0;_l(J,Nn,Ne===void 0?D[Nn]:Ne)}return J}function Po(D,V){return Ro(D,as(D),V)}function Bd(D){return Rd(D,No,as)}function wr(D,V){var J=D.__data__;return Cl(V)?J[typeof V=="string"?"string":"hash"]:J.map}function Gn(D,V){var J=zt(D,V);return Id(J)?J:void 0}var as=ci?Dt(ci,Object):$d,cn=Pd;(br&&cn(new br(new ArrayBuffer(1)))!=I||ui&&cn(new ui)!=m||Mo&&cn(Mo.resolve())!=v||ko&&cn(new ko)!=C||Do&&cn(new Do)!=P)&&(cn=function(D){var V=Le.call(D),J=V==x?D.constructor:void 0,mt=J?fi(J):void 0;if(mt)switch(mt){case pl:return I;case fd:return m;case hd:return v;case pd:return C;case gd:return P}return V});function Ml(D){var V=D.length,J=D.constructor(V);return V&&typeof D[0]=="string"&&Vt.call(D,"index")&&(J.index=D.index,J.input=D.input),J}function kl(D){return typeof D.constructor=="function"&&!Io(D)?Ed(zi(D)):{}}function Fd(D,V,J,mt){var Te=D.constructor;switch(V){case L:return ss(D);case l:case u:return new Te(+D);case I:return Eo(D,mt);case N:case T:case M:case O:case z:case W:case it:case ut:case ft:return Nd(D,mt);case m:return Ld(D,mt,J);case _:case E:return new Te(D);case S:return vl(D);case C:return os(D,mt,J);case B:return Sl(D)}}function Dl(D,V){return V=V??r,!!V&&(typeof D=="number"||et.test(D))&&D>-1&&D%1==0&&D<V}function Cl(D){var V=typeof D;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?D!=="__proto__":D===null}function Ol(D){return!!oe&&oe in D}function Io(D){var V=D&&D.constructor,J=typeof V=="function"&&V.prototype||Oe;return D===J}function fi(D){if(D!=null){try{return ln.call(D)}catch{}try{return D+""}catch{}}return""}function zd(D){return rs(D,!0,!0)}function Al(D,V){return D===V||D!==D&&V!==V}function El(D){return Ud(D)&&Vt.call(D,"callee")&&(!Ye.call(D,"callee")||Le.call(D)==s)}var Lo=Array.isArray;function Rl(D){return D!=null&&Wd(D.length)&&!ls(D)}function Ud(D){return Vd(D)&&Rl(D)}var Hd=So||ee;function ls(D){var V=cs(D)?Le.call(D):"";return V==h||V==g}function Wd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function cs(D){var V=typeof D;return!!D&&(V=="object"||V=="function")}function Vd(D){return!!D&&typeof D=="object"}function No(D){return Rl(D)?Ad(D):xl(D)}function $d(){return[]}function ee(){return!1}n.exports=zd})(sa,sa.exports)),sa.exports}Kw();const Tn=(n,t)=>new Date(n.getTime()-qw(t,n));class De{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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=Yw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ph(e,t)}}class Xw extends De{rawStart(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class Zw extends De{rawStart(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class Qw extends De{rawStart(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class Jw extends De{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class tv extends De{rawEnd(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=Jn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Tn(i,t)),i}}class ev extends De{rawEnd(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Pr(bh(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class nv extends De{rawEnd(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Ir(_h(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class iv extends De{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Tn(e,t)),e}}gt.FIFTEEN_MIN,new De({key:gt.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"]}),gt.ONE_HOUR,new De({key:gt.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"]}),gt.SIX_HOUR,new De({key:gt.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"]}),gt.TWELVE_HOUR,new De({key:gt.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"]}),gt.ONE_DAY,new De({key:gt.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"]}),gt.SEVEN_DAY,new De({key:gt.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"]}),gt.THIRTY_DAY,new De({key:gt.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"]}),gt.NINETY_DAY,new De({key:gt.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"]}),gt.ONE_HUNDRED_EIGHTY_DAY,new De({key:gt.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"]}),gt.ONE_YEAR,new De({key:gt.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"]}),gt.CURRENT_WEEK,new Xw({key:gt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Jn(new Date,{weekStartsOn:1});return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.CURRENT_MONTH,new Zw({key:gt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Ir(new Date);return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_QUARTER,new Qw({key:gt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date);return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_YEAR,new Jw({key:gt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_WEEK,new tv({key:gt.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"]}),gt.PREVIOUS_MONTH,new nv({key:gt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Ir(new Date),e=Ir(_h(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Bh(t,e)),3600*24*mw(new Date().setMonth(new Date().getMonth()-1))+yh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_QUARTER,new ev({key:gt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date),t=Pr(bh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_YEAR,new iv({key:gt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Bh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+yh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Bh(n,t){return _w(n.getTimezoneOffset()-t.getTimezoneOffset())}gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.THIRTY_DAY,gt.NINETY_DAY,gt.ONE_HUNDRED_EIGHTY_DAY,gt.ONE_YEAR,gt.CURRENT_WEEK,gt.CURRENT_MONTH,gt.CURRENT_QUARTER,gt.CURRENT_YEAR,gt.PREVIOUS_WEEK,gt.PREVIOUS_MONTH,gt.PREVIOUS_QUARTER,gt.PREVIOUS_YEAR;const rv=new Map(rh.map(n=>[n.code,{code:n.code,name:n.name}])),kc=n=>rv.get(n)?.name||n,Fh=1e3,sv=1e4,zh=1e6,Uh=1e9,Hh=1e12,oa=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},Os=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function aa(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?sv:Fh;return n<r||t.precision&&t.precision>Math.log10(n)?e=oa(Os(n,1,t),t):n<zh?e=`${Os(n,Fh,t)}k`:n<Uh?e=`${Os(n,zh,t)}m`:n<Hh?e=`${oa(Os(n,Uh,t),t)}b`:e=`${oa(Os(n,Hh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}aa.addCommas=oa;const ov=typeof document<"u"&&document.documentElement?.lang||"en-US",la=new Intl.NumberFormat(ov);function er({i18n:n}){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=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?h=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.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 e(i,a);default:return isNaN(i)?`${i}`:l?`${aa(i,{capital:!0})} ${d}`:i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,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`${e(i,l)} - ${e(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${aa(i,{capital:!0})} - ${aa(r,{capital:!0})} ${h}`}const g=i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,m=r>=.01?`${la.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${m} ${h}`}}}const Wh="#d60027",Vh="#ffe5e5",av="#f1f0ff",lv="#e0e4ea",$h="#6c7489",cv="#afb7c5",Yh="#0d0e14",uv="#d60027",dv="#ad000e",Dc="#6c7489",qh="#52596e",fv="#007d60",hv="#995c00",pv="#ffc400",gv="'Inter', Roboto, Helvetica, sans-serif",As="16px",mv="20px",yv="#bee2ff",_v="#8fc1ff",bv="#5f9aff",xv="#306fff",wv="#b5ffee",vv="#00fabe",Sv="#00d6a4",Tv="#00a17b",Mv="#007d60",kv="#005944",Dv="#b5ffee",Cv="#00fabe",Ov="#b5ffee",Av="#00a17b",Ev="#fff296",Rv="#ffe04b",Pv="#ffc400",Iv="#b37600",Lv="#995c00",Nv="#804400",Bv="#fff296",Fv="#ffe04b",zv="#ffc2b3",Uv="#ff9877",Hv="#ff723c",Wv="#f75008",Vv="#d13500",$v="#a31f00",Yv="#ffc2b3",qv="#ff9877",jv="#ff723c",Gv="#f75008",Kv="#d13500",Xv="#a31f00",Zv="#ffc2b3",Qv="#ff9877",Jv="#ff723c",t1="#f75008",e1="#d13500",n1="#a31f00",i1="#ffc2b3",r1="#ff9877",s1="#ff723c",o1="#f75008",a1="#d13500",l1="#a31f00",c1="#ffc2b3",u1="#ff9877",d1="#ff723c",f1="#f75008",h1="#d13500",p1="#ffabab",g1="#ff7272",m1="#ff3954",y1="#f50045",_1="#d60027",b1="#ad000e",x1="#ffabab",w1="#ff7272",v1="#ff3954",S1="#f50045",T1="#d60027",M1="#eefaff",k1="#ecfffb",D1="#fffce0",C1="#fff1ef",O1="#ffe5e5",A1="#5f9aff",E1="#00d6a4",R1="#ffc400",P1="#ff723c",I1="#ff3954",jh=6048e5,L1=864e5,Es=6e4,Nr=36e5,N1=1e3,Gh=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Gh in n?n[Gh](t):n instanceof Date?new n.constructor(t):new Date(t)}function At(n,t){return he(t||n,n)}function ca(n,t,e){const i=At(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Cc(n,t,e){const i=At(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,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 Oc(n,t,e){return he(n,+At(n)+t)}function B1(n,t,e){return Oc(n,t*Nr)}let F1={};function nr(){return F1}function Wn(n,t){const e=nr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,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 Br(n,t){return Wn(n,{...t,weekStartsOn:1})}function Kh(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Br(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Br(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function ua(n){const t=At(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function ir(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ac(n,t){const e=At(n,t?.in);return e.setHours(0,0,0,0),e}function Xh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Ac(i),a=Ac(r),l=+s-ua(s),u=+a-ua(a);return Math.round((l-u)/L1)}function z1(n,t){const e=Kh(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Br(i)}function U1(n,t,e){const i=At(n,e?.in);return i.setTime(i.getTime()+t*Es),i}function H1(n,t,e){return Cc(n,t*3,e)}function W1(n,t,e){return Oc(n,t*1e3)}function V1(n,t,e){return ca(n,t*7,e)}function $1(n,t,e){return Cc(n,t*12,e)}function Rs(n,t){const e=+At(n)-+At(t);return e<0?-1:e>0?1:e}function Y1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ec(n){return!(!Y1(n)&&typeof n!="number"||isNaN(+At(n)))}function q1(n,t,e){const[i,r]=ir(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function j1(n,t,e){const[i,r]=ir(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function Zh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Qh(i,r),a=Math.abs(Xh(i,r));i.setDate(i.getDate()-s*a);const l=+(Qh(i,r)===-s),u=s*(a-l);return u===0?0:u}function Qh(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Ps(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function G1(n,t,e){const[i,r]=ir(e?.in,n,t),s=(+i-+r)/Nr;return Ps(e?.roundingMethod)(s)}function Rc(n,t){return+At(n)-+At(t)}function K1(n,t,e){const i=Rc(n,t)/Es;return Ps(e?.roundingMethod)(i)}function Jh(n,t){const e=At(n,t?.in);return e.setHours(23,59,59,999),e}function tp(n,t){const e=At(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function X1(n,t){const e=At(n,t?.in);return+Jh(e,t)==+tp(e,t)}function ep(n,t,e){const[i,r,s]=ir(e?.in,n,n,t),a=Rs(r,s),l=Math.abs(q1(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Rs(r,s)===-a;X1(i)&&l===1&&Rs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function Z1(n,t,e){const i=ep(n,t,e)/3;return Ps(e?.roundingMethod)(i)}function Q1(n,t,e){const i=Rc(n,t)/1e3;return Ps(e?.roundingMethod)(i)}function J1(n,t,e){const i=Zh(n,t,e)/7;return Ps(e?.roundingMethod)(i)}function tS(n,t,e){const[i,r]=ir(e?.in,n,t),s=Rs(i,r),a=Math.abs(j1(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Rs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function eS(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function nS(n,t){const e=At(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function iS(n,t){const e=At(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function np(n,t){const e=At(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function rS(n,t){const e=At(n,t?.in);return e.setMinutes(59,59,999),e}function sS(n,t){const e=nr(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,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 oS(n,t){const e=At(n,t?.in);return e.setSeconds(59,999),e}function aS(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function lS(n,t){const e=At(n,t?.in);return e.setMilliseconds(999),e}const cS={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"}},uS=(n,t,e)=>{let i;const r=cS[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Pc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const dS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pS={date:Pc({formats:dS,defaultWidth:"full"}),time:Pc({formats:fS,defaultWidth:"full"}),dateTime:Pc({formats:hS,defaultWidth:"full"})},gS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mS=(n,t,e,i)=>gS[n];function Is(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const yS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_S={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bS={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"]},xS={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"]},wS={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"}},vS={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"}},SS={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Is({values:yS,defaultWidth:"wide"}),quarter:Is({values:_S,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Is({values:bS,defaultWidth:"wide"}),day:Is({values:xS,defaultWidth:"wide"}),dayPeriod:Is({values:wS,defaultWidth:"wide",formattingValues:vS,defaultFormattingWidth:"wide"})};function Ls(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?MS(l,g=>g.test(a)):TS(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function TS(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function MS(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function kS(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const DS=/^(\d+)(th|st|nd|rd)?/i,CS=/\d+/i,OS={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},AS={any:[/^b/i,/^(a|c)/i]},ES={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},RS={any:[/1/i,/2/i,/3/i,/4/i]},PS={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},IS={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]},LS={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},NS={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]},BS={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},FS={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}},zS={ordinalNumber:kS({matchPattern:DS,parsePattern:CS,valueCallback:n=>parseInt(n,10)}),era:Ls({matchPatterns:OS,defaultMatchWidth:"wide",parsePatterns:AS,defaultParseWidth:"any"}),quarter:Ls({matchPatterns:ES,defaultMatchWidth:"wide",parsePatterns:RS,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ls({matchPatterns:PS,defaultMatchWidth:"wide",parsePatterns:IS,defaultParseWidth:"any"}),day:Ls({matchPatterns:LS,defaultMatchWidth:"wide",parsePatterns:NS,defaultParseWidth:"any"}),dayPeriod:Ls({matchPatterns:BS,defaultMatchWidth:"any",parsePatterns:FS,defaultParseWidth:"any"})},ip={code:"en-US",formatDistance:uS,formatLong:pS,formatRelative:mS,localize:SS,match:zS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function US(n,t){const e=At(n,t?.in);return Xh(e,np(e))+1}function rp(n,t){const e=At(n,t?.in),i=+Br(e)-+z1(e);return Math.round(i/jh)+1}function Ic(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=nr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Wn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Wn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function HS(n,t){const e=nr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Ic(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Wn(s,t)}function sp(n,t){const e=At(n,t?.in),i=+Wn(e,t)-+HS(e,t);return Math.round(i/jh)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const vi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},Fr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},op={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return vi.y(n,t)},Y:function(n,t,e,i){const r=Ic(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=Kh(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return vi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=sp(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=rp(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):vi.d(n,t)},D:function(n,t,e){const i=US(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.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 e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Fr.noon:i===0?r=Fr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Fr.evening:i>=12?r=Fr.afternoon:i>=4?r=Fr.morning:r=Fr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):vi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):vi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):vi.s(n,t)},S:function(n,t){return vi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return lp(i);case"XXXX":case"XX":return rr(i);default:return rr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return lp(i);case"xxxx":case"xx":return rr(i);default:return rr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ap(i,":");default:return"GMT"+rr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ap(i,":");default:return"GMT"+rr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function ap(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function lp(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):rr(n,t)}function rr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const cp=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},up=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Lc={p:up,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return cp(n,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}}",cp(i,t)).replace("{{time}}",up(r,t))}},WS=/^D+$/,VS=/^Y+$/,$S=["D","DD","YY","YYYY"];function dp(n){return WS.test(n)}function fp(n){return VS.test(n)}function Nc(n,t,e){const i=YS(n,t,e);if(console.warn(i),$S.includes(n))throw new RangeError(i)}function YS(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,GS=/^'([^]*?)'?$/,KS=/''/g,XS=/[a-zA-Z]/;function da(n,t,e){const i=nr(),r=e?.locale??i.locale??ip,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=At(n,e?.in);if(!Ec(l))throw new RangeError("Invalid time value");let u=t.match(jS).map(h=>{const g=h[0];if(g==="p"||g==="P"){const m=Lc[g];return m(h,r.formatLong)}return h}).join("").match(qS).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:ZS(h)};if(op[g])return{isToken:!0,value:h};if(g.match(XS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");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 g=h.value;(!e?.useAdditionalWeekYearTokens&&fp(g)||!e?.useAdditionalDayOfYearTokens&&dp(g))&&Nc(g,t,String(n));const m=op[g[0]];return m(l,g,r.localize,d)}).join("")}function ZS(n){const t=n.match(GS);return t?t[1].replace(KS,"'"):n}function hp(){return Object.assign({},nr())}function QS(n,t){const e=At(n,t?.in).getDay();return e===0?7:e}function JS(n,t){const e=tT(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function tT(n){return typeof n=="function"&&n.prototype?.constructor===n}const eT=10;class pp{subPriority=0;validate(t,e){return!0}}class nT extends pp{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class iT extends pp{priority=eT;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,JS(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new nT(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class rT extends Wt{priority=140;parse(t,e,i){switch(e){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,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={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}/},Vn={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 ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function $n(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Nr+s*Es+a*N1),rest:t.slice(e[0].length)}}function gp(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function fa(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Bc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function mp(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=n>=s%100;r=n+a-(l?100:0)}return e?r:1-r}function yp(n){return n%400===0||n%4===0&&n%100!==0}class sT extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=mp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class oT extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Ic(t,r);if(i.isTwoDigitYear){const l=mp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class aT extends Wt{priority=130;parse(t,e){return fa(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Br(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class lT extends Wt{priority=130;parse(t,e){return fa(e==="u"?4:e.length,t)}set(t,e,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 cT extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 uT extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 dT extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(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,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class fT extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(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,e){return e>=0&&e<=11}set(t,e,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 hT(n,t,e){const i=At(n,e?.in),r=sp(i,e)-t;return i.setDate(i.getDate()-r*7),At(i,e?.in)}class pT extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Wn(hT(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function gT(n,t,e){const i=At(n,e?.in),r=rp(i,e)-t;return i.setDate(i.getDate()-r*7),i}class mT extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Br(gT(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const yT=[31,28,31,30,31,30,31,31,30,31,30,31],_T=[31,29,31,30,31,30,31,31,30,31,30,31];class bT extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=yp(i),s=t.getMonth();return r?e>=1&&e<=_T[s]:e>=1&&e<=yT[s]}set(t,e,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 xT extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return yp(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,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 Fc(n,t,e){const i=nr(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(n,e?.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 ca(s,h,e)}class wT extends Wt{priority=90;parse(t,e,i){switch(e){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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class vT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(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 ST extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(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 TT(n,t,e){const i=At(n,e?.in),r=QS(i,e),s=t-r;return ca(i,s,e)}class MT extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(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 ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(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,e){return e>=1&&e<=7}set(t,e,i){return t=TT(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 kT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class DT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class CT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class OT extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,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 AT extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class ET extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,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 RT extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,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 PT extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class IT extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class LT extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class NT extends Wt{priority=10;parse(t,e){switch(e){case"X":return $n(Vn.basicOptionalMinutes,t);case"XX":return $n(Vn.basic,t);case"XXXX":return $n(Vn.basicOptionalSeconds,t);case"XXXXX":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","x"]}class BT extends Wt{priority=10;parse(t,e){switch(e){case"x":return $n(Vn.basicOptionalMinutes,t);case"xx":return $n(Vn.basic,t);case"xxxx":return $n(Vn.basicOptionalSeconds,t);case"xxxxx":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","X"]}class FT extends Wt{priority=40;parse(t){return gp(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class zT extends Wt{priority=20;parse(t){return gp(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const UT={G:new rT,y:new sT,Y:new oT,R:new aT,u:new lT,Q:new cT,q:new uT,M:new dT,L:new fT,w:new pT,I:new mT,d:new bT,D:new xT,E:new wT,e:new vT,c:new ST,i:new MT,a:new kT,b:new DT,B:new CT,h:new OT,H:new AT,K:new ET,k:new RT,m:new PT,s:new IT,S:new LT,X:new NT,x:new BT,t:new FT,T:new zT},HT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,VT=/^'([^]*?)'?$/,$T=/''/g,YT=/\S/,qT=/[a-zA-Z]/;function jT(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=hp(),a=i?.locale??s.locale??ip,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 n?r():At(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new iT(i?.in,e)],g=t.match(WT).map(S=>{const C=S[0];if(C in Lc){const E=Lc[C];return E(S,a.formatLong)}return S}).join("").match(HT),m=[];for(let S of g){!i?.useAdditionalWeekYearTokens&&fp(S)&&Nc(S,t,n),!i?.useAdditionalDayOfYearTokens&&dp(S)&&Nc(S,t,n);const C=S[0],E=UT[C];if(E){const{incompatibleTokens:B}=E;if(Array.isArray(B)){const L=m.find(I=>B.includes(I.token)||I.token===C);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${S}\` at the same time`)}else if(E.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);m.push({token:C,fullToken:S});const P=E.run(n,S,a.match,d);if(!P)return r();h.push(P.setter),n=P.rest}else{if(C.match(qT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=GT(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&YT.test(n))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,E)=>E.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,E)=>E.subPriority-C.subPriority)).map(S=>S[0]);let x=At(e,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 GT(n){return n.match(VT)[1].replace($T,"'")}function KT(n,t){const e=At(n,t?.in);return e.setMinutes(0,0,0),e}function XT(n,t){const e=At(n,t?.in);return e.setSeconds(0,0),e}function ZT(n,t){const e=At(n,t?.in);return e.setMilliseconds(0),e}function _p(n){const t=n/Nr;return Math.trunc(t)}function bp(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=eM(n);let s;if(r.date){const d=nM(r.date,i);s=iM(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=rM(r.time),isNaN(l)))return e();if(r.timezone){if(u=sM(r.timezone),isNaN(u))return e()}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 ha={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},QT=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,JT=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tM=/^([+-])(\d{2})(?::?(\d{2}))?$/;function eM(n){const t={},e=n.split(ha.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],ha.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ha.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=ha.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function nM(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function iM(n,t){if(t===null)return new Date(NaN);const e=n.match(QT);if(!e)return new Date(NaN);const i=!!e[4],r=Ns(e[1]),s=Ns(e[2])-1,a=Ns(e[3]),l=Ns(e[4]),u=Ns(e[5])-1;if(i)return uM(t,l,u)?oM(t,l,u):new Date(NaN);{const d=new Date(0);return!lM(t,s,a)||!cM(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Ns(n){return n?parseInt(n):1}function rM(n){const t=n.match(JT);if(!t)return NaN;const e=zc(t[1]),i=zc(t[2]),r=zc(t[3]);return dM(e,i,r)?e*Nr+i*Es+r*1e3:NaN}function zc(n){return n&&parseFloat(n.replace(",","."))||0}function sM(n){if(n==="Z")return 0;const t=n.match(tM);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return fM(i,r)?e*(i*Nr+r*Es):NaN}function oM(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const aM=[31,null,31,30,31,30,31,31,30,31,30,31];function xp(n){return n%400===0||n%4===0&&n%100!==0}function lM(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(aM[t]||(xp(n)?29:28))}function cM(n,t){return t>=1&&t<=(xp(n)?366:365)}function uM(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function dM(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function fM(n,t){return t>=0&&t<=59}const wp={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})",outlierTooltip:"{series} (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_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",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",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)",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",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)",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)"}},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 hM(){const n=Xf.createI18n("en-us",wp);return{i18n:n,i18nT:Xf.i18nTComponent(n)}}function Bs(n){return n+.5|0}const Si=(n,t,e)=>Math.max(Math.min(n,e),t);function Fs(n){return Si(Bs(n*2.55),0,255)}function Ti(n){return Si(Bs(n*255),0,255)}function ti(n){return Si(Bs(n/2.55)/100,0,1)}function vp(n){return Si(Bs(n*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},Uc=[..."0123456789ABCDEF"],pM=n=>Uc[n&15],gM=n=>Uc[(n&240)>>4]+Uc[n&15],pa=n=>(n&240)>>4===(n&15),mM=n=>pa(n.r)&&pa(n.g)&&pa(n.b)&&pa(n.a);function yM(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Mn[n[1]]*17,g:255&Mn[n[2]]*17,b:255&Mn[n[3]]*17,a:t===5?Mn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Mn[n[1]]<<4|Mn[n[2]],g:Mn[n[3]]<<4|Mn[n[4]],b:Mn[n[5]]<<4|Mn[n[6]],a:t===9?Mn[n[7]]<<4|Mn[n[8]]:255})),e}const _M=(n,t)=>n<255?t(n):"";function bM(n){var t=mM(n)?pM:gM;return n?"#"+t(n.r)+t(n.g)+t(n.b)+_M(n.a,t):void 0}const xM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Sp(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function wM(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function vM(n,t,e){const i=Sp(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function SM(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Hc(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,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=SM(e,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Wc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ti)}function Vc(n,t,e){return Wc(Sp,n,t,e)}function TM(n,t,e){return Wc(vM,n,t,e)}function MM(n,t,e){return Wc(wM,n,t,e)}function Tp(n){return(n%360+360)%360}function kM(n){const t=xM.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Fs(+t[5]):Ti(+t[5]));const r=Tp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=TM(r,s,a):t[1]==="hsv"?i=MM(r,s,a):i=Vc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function DM(n,t){var e=Hc(n);e[0]=Tp(e[0]+t),e=Vc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function CM(n){if(!n)return;const t=Hc(n),e=t[0],i=vp(t[1]),r=vp(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ti(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Mp={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"},kp={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 OM(){const n={},t=Object.keys(kp),e=Object.keys(Mp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<e.length;r++)s=e[r],l=l.replace(s,Mp[s]);s=parseInt(kp[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let ga;function AM(n){ga||(ga=OM(),ga.transparent=[0,0,0,0]);const t=ga[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const EM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function RM(n){const t=EM.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Fs(a):Si(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Fs(i):Si(i,0,255)),r=255&(t[4]?Fs(r):Si(r,0,255)),s=255&(t[6]?Fs(s):Si(s,0,255)),{r:i,g:r,b:s,a:e}}}function PM(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ti(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const $c=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,zr=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function IM(n,t,e){const i=zr(ti(n.r)),r=zr(ti(n.g)),s=zr(ti(n.b));return{r:Ti($c(i+e*(zr(ti(t.r))-i))),g:Ti($c(r+e*(zr(ti(t.g))-r))),b:Ti($c(s+e*(zr(ti(t.b))-s))),a:n.a+e*(t.a-n.a)}}function ma(n,t,e){if(n){let i=Hc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Vc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Dp(n,t){return n&&Object.assign(t||{},n)}function Cp(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ti(n[3]))):(t=Dp(n,{r:0,g:0,b:0,a:1}),t.a=Ti(t.a)),t}function LM(n){return n.charAt(0)==="r"?RM(n):kM(n)}class zs{constructor(t){if(t instanceof zs)return t;const e=typeof t;let i;e==="object"?i=Cp(t):e==="string"&&(i=yM(t)||AM(t)||LM(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Dp(this._rgb);return t&&(t.a=ti(t.a)),t}set rgb(t){this._rgb=Cp(t)}rgbString(){return this._valid?PM(this._rgb):void 0}hexString(){return this._valid?bM(this._rgb):void 0}hslString(){return this._valid?CM(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,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,e){return t&&(this._rgb=IM(this._rgb,t._rgb,e)),this}clone(){return new zs(this.rgb)}alpha(t){return this._rgb.a=Ti(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Bs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ma(this._rgb,2,t),this}darken(t){return ma(this._rgb,2,-t),this}saturate(t){return ma(this._rgb,1,t),this}desaturate(t){return ma(this._rgb,1,-t),this}rotate(t){return DM(this._rgb,t),this}}function ei(){}const NM=(()=>{let n=0;return()=>n++})();function xt(n){return n==null}function qt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pn(n,t){return ae(n)?n:t}function Mt(n,t){return typeof n>"u"?t:n}const BM=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Op=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Qt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Jt(n,t,e,i){let r,s,a;if(qt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(Pt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ya(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function _a(n){if(qt(n))return n.map(_a);if(Pt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=_a(n[e[r]]);return t}return n}function Ap(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function FM(n,t,e,i){if(!Ap(n))return;const r=t[n],s=e[n];Pt(r)&&Pt(s)?Us(r,s,i):t[n]=_a(s)}function Us(n,t,e){const i=qt(t)?t:[t],r=i.length;if(!Pt(n))return n;e=e||{};const s=e.merger||FM;let a;for(let l=0;l<r;++l){if(a=i[l],!Pt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],n,a,e)}return n}function Hs(n,t){return Us(n,t,{merger:zM})}function zM(n,t,e){if(!Ap(n))return;const i=t[n],r=e[n];Pt(i)&&Pt(r)?Hs(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=_a(r))}const Ep={"":n=>n,x:n=>n.x,y:n=>n.y};function UM(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function HM(n){const t=UM(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Mi(n,t){return(Ep[t]||(Ep[t]=HM(t)))(n)}function Yc(n){return n.charAt(0).toUpperCase()+n.slice(1)}const en=n=>typeof n<"u",nn=n=>typeof n=="function",Rp=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function WM(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Et=Math.PI,te=2*Et,VM=te+Et,ba=Number.POSITIVE_INFINITY,qc=Et/180,re=Et/2,kn=Et/4,xa=Et*2/3,ki=Math.log10,Yn=Math.sign;function Ws(n,t,e){return Math.abs(n-t)<e}function Pp(n){const t=Math.round(n);n=Ws(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ki(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function $M(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function YM(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Di(n){return!YM(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function qM(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Ip(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(Et/180)}function wa(n){return n*(180/Et)}function Lp(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function va(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*Et&&(s+=te),{angle:s,distance:r}}function Ur(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function jM(n,t){return(n-t+VM)%te-Et}function Ue(n){return(n%te+te)%te}function Vs(n,t,e,i){const r=Ue(n),s=Ue(t),a=Ue(e),l=Ue(s-r),u=Ue(a-r),d=Ue(r-s),h=Ue(r-a);return r===s||r===a||i&&s===a||l>u&&d<h}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function GM(n){return Ce(n,-32768,32767)}function ni(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function jc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ii=(n,t,e,i)=>jc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),KM=(n,t,e)=>jc(n,e,i=>n[i][t]>=e);function XM(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Np=["push","pop","shift","splice","unshift"];function ZM(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Np.forEach(e=>{const i="_onData"+Yc(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function Bp(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Np.forEach(s=>{delete n[s]}),delete n._chartjs)}function Fp(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const zp=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Up(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,zp.call(window,()=>{i=!1,n.apply(t,e)}))}}function QM(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Gc=n=>n==="start"?"left":n==="end"?"right":"center",He=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,JM=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Hp(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:l,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=a.axis,{min:g,max:m,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ii(u,h,g).lo,e?i:ii(t,h,a.getPixelForValue(g)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(S=>!xt(S[l.axis]));r-=Math.max(0,v)}r=Ce(r,0,i-1)}if(x){let v=Math.max(ii(u,a.axis,m,!0).hi+1,e?0:ii(t,h,a.getPixelForValue(m),!0).hi+1);if(d){const S=u.slice(v-1).findIndex(C=>!xt(C[l.axis]));v+=Math.max(0,S)}s=Ce(v,r,i)-r}else s=i-r}return{start:r,count:s}}function Wp(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const Sa=n=>n===0||n===1,Vp=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),$p=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,$s={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*re)+1,easeOutSine:n=>Math.sin(n*re),easeInOutSine:n=>-.5*(Math.cos(Et*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Sa(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Sa(n)?n:Vp(n,.075,.3),easeOutElastic:n=>Sa(n)?n:$p(n,.075,.3),easeInOutElastic(n){return Sa(n)?n:n<.5?.5*Vp(n*2,.1125,.45):.5+.5*$p(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-$s.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?$s.easeInBounce(n*2)*.5:$s.easeOutBounce(n*2-1)*.5+.5};function Kc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ta(n){return Kc(n)?n:new zs(n)}function Xc(n){return Kc(n)?n:new zs(n).saturate(.5).darken(.1).hexString()}const tk=["x","y","borderWidth","radius","tension"],ek=["color","borderColor","backgroundColor"];function nk(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:ek},numbers:{type:"number",properties:tk}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ik(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Yp=new Map;function rk(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Yp.get(e);return i||(i=new Intl.NumberFormat(n,t),Yp.set(e,i)),i}function Ys(n,t,e){return rk(t,e).format(n)}const qp={values(n){return qt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=sk(n,e)}const a=ki(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),Ys(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ki(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?qp.numeric.call(this,n,t,e):""}};function sk(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ma={formatters:qp};function ok(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ma.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const sr=Object.create(null),Zc=Object.create(null);function qs(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function Qc(n,t,e){return typeof t=="string"?Us(qs(n,t),e):Us(qs(n,""),t)}class ak{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Xc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Xc(r.borderColor),this.hoverColor=(i,r)=>Xc(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(e)}set(t,e){return Qc(this,t,e)}get(t){return qs(this,t)}describe(t,e){return Qc(Zc,t,e)}override(t,e){return Qc(sr,t,e)}route(t,e,i,r){const s=qs(this,t),a=qs(this,i),l="_"+e;Object.defineProperties(s,{[l]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[l],d=a[r];return Pt(u)?Object.assign({},d,u):Mt(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new ak({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nk,ik,ok]);function lk(n){return!n||xt(n.size)||xt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ka(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function ck(n,t,e,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),n.save(),n.font=t;let a=0;const l=e.length;let u,d,h,g,m;for(u=0;u<l;u++)if(g=e[u],g!=null&&!qt(g))a=ka(n,r,s,a,g);else if(qt(g))for(d=0,h=g.length;d<h;d++)m=g[d],m!=null&&!qt(m)&&(a=ka(n,r,s,a,m));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function or(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function jp(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Jc(n,t,e,i){Gp(n,t,e,i,null)}function Gp(n,t,e,i,r){let s,a,l,u,d,h,g,m;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*qc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(S),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(v)||v<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,v,0,0,te):n.arc(e,i,v,0,te),n.closePath();break;case"triangle":h=r?r/2:v,n.moveTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=xa,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=xa,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),n.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(S+kn)*u,g=Math.cos(S+kn)*(r?r/2-d:u),l=Math.sin(S+kn)*u,m=Math.sin(S+kn)*(r?r/2-d:u),n.arc(e-g,i-l,d,S-Et,S-re),n.arc(e+m,i-a,d,S-re,S),n.arc(e+g,i+l,d,S,S+re),n.arc(e-m,i+a,d,S+re,S+Et),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,n.rect(e-h,i-u,2*h,2*u);break}S+=kn;case"rectRot":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+m,i-a),n.lineTo(e+g,i+l),n.lineTo(e-m,i+a),n.closePath();break;case"crossRot":S+=kn;case"cross":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"star":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a),S+=kn,g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,m=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"line":a=r?r/2:Math.cos(S)*v,l=Math.sin(S)*v,n.moveTo(e-a,i-l),n.lineTo(e+a,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(S)*(r?r/2:v),i+Math.sin(S)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ri(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function js(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Gs(n){n.restore()}function uk(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function dk(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function fk(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),xt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function hk(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function pk(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ar(n,t,e,i,r,s={}){const a=qt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,fk(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&pk(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),xt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),hk(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Hr(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*Et,Et,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Et,re,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,re,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-re,!0),n.lineTo(e+a.topLeft,i)}const gk=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mk=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yk(n,t){const e=(""+n).match(gk);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const _k=n=>+n||0;function tu(n,t){const e={},i=Pt(t),r=i?Object.keys(t):t,s=Pt(n)?i?a=>Mt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=_k(s(a));return e}function Kp(n){return tu(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ci(n){return tu(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=Kp(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function le(n,t){n=n||{},t=t||se.font;let e=Mt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Mt(n.style,t.style);i&&!(""+i).match(mk)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:yk(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=lk(r),r}function Ks(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function bk(n,t,e){const{min:i,max:r}=n,s=Op(t,(r-i)/2),a=(l,u)=>e&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Oi(n,t){return Object.assign(Object.create(n),t)}function eu(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=tg("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>eu([l,...n],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete n[0][u],!0},get(l,u){return Zp(l,u,()=>Dk(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return eg(l).includes(u)},ownKeys(l){return eg(l)},set(l,u,d){const h=l._storage||(l._storage=r());return l[u]=h[u]=d,delete l._keys,!0}})}function Wr(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Xp(n,i),setContext:s=>Wr(n,s,e,i),override:s=>Wr(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,l){return Zp(s,a,()=>wk(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,l){return n[a]=l,delete s[a],!0}})}function Xp(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:nn(e)?e:()=>e,isIndexable:nn(i)?i:()=>i}}const xk=(n,t)=>n?n+Yc(t):t,nu=(n,t)=>Pt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zp(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function wk(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return nn(l)&&a.isScriptable(t)&&(l=vk(t,l,n,e)),qt(l)&&l.length&&(l=Sk(t,l,n,a.isIndexable)),nu(t,l)&&(l=Wr(l,r,s&&s[t],a)),l}function vk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let u=t(s,a||i);return l.delete(n),nu(n,u)&&(u=iu(r._scopes,r,n,u)),u}function Sk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(Pt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const g=iu(d,r,n,h);t.push(Wr(g,s,a&&a[n],l))}}return t}function Qp(n,t,e){return nn(n)?n(t,e):n}const Tk=(n,t)=>n===!0?t:typeof n=="string"?Mi(t,n):void 0;function Mk(n,t,e,i,r){for(const s of t){const a=Tk(e,s);if(a){n.add(a);const l=Qp(a._fallback,e,r);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function iu(n,t,e,i){const r=t._rootScopes,s=Qp(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=Jp(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=Jp(l,a,s,u,i),u===null)?!1:eu(Array.from(l),[""],r,s,()=>kk(t,e,i))}function Jp(n,t,e,i,r){for(;e;)e=Mk(n,t,e,i,r);return e}function kk(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return qt(r)&&Pt(e)?e:r||{}}function Dk(n,t,e,i){let r;for(const s of t)if(r=tg(xk(s,n),e),typeof r<"u")return nu(n,r)?iu(e,i,n,r):r}function tg(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function eg(n){let t=n._keys;return t||(t=n._keys=Ck(n._scopes)),t}function Ck(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ng(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,h;for(l=0,u=i;l<u;++l)d=l+e,h=t[d],a[l]={r:r.parse(Mi(h,s),d)};return a}const Ok=Number.EPSILON||1e-14,Vr=(n,t)=>t<n.length&&!n[t].skip&&n[t],ig=n=>n==="x"?"y":"x";function Ak(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=Ur(s,r),u=Ur(a,s);let d=l/(l+u),h=u/(l+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const g=i*d,m=i*h;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+m*(a.x-r.x),y:s.y+m*(a.y-r.y)}}}function Ek(n,t,e){const i=n.length;let r,s,a,l,u,d=Vr(n,0);for(let h=0;h<i-1;++h)if(u=d,d=Vr(n,h+1),!(!u||!d)){if(Ws(t[h],0,Ok)){e[h]=e[h+1]=0;continue}r=e[h]/t[h],s=e[h+1]/t[h],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=r*a*t[h],e[h+1]=s*a*t[h])}}function Rk(n,t,e="x"){const i=ig(e),r=n.length;let s,a,l,u=Vr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Vr(n,d+1),!l)continue;const h=l[e],g=l[i];a&&(s=(h-a[e])/3,l[`cp1${e}`]=h-s,l[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-h)/3,l[`cp2${e}`]=h+s,l[`cp2${i}`]=g+s*t[d])}}function Pk(n,t="x"){const e=ig(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Vr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=Vr(n,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[e]-u[e])/h:0}s[a]=l?d?Yn(r[a-1])!==Yn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Ek(n,r,s),Rk(n,s,t)}function Da(n,t,e){return Math.max(Math.min(n,e),t)}function Ik(n,t){let e,i,r,s,a,l=ri(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&ri(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=Da(r.cp1x,t.left,t.right),r.cp1y=Da(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Da(r.cp2x,t.left,t.right),r.cp2y=Da(r.cp2y,t.top,t.bottom)))}function Lk(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Pk(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)l=n[s],u=Ak(d,l,n[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&&Ik(n,e)}function ru(){return typeof window<"u"&&typeof document<"u"}function su(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ca(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Oa=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Nk(n,t){return Oa(n).getPropertyValue(t)}const Bk=["top","right","bottom","left"];function lr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Bk[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Fk=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function zk(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(Fk(r,s,n.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 Ai(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Oa(e),s=r.boxSizing==="border-box",a=lr(r,"padding"),l=lr(r,"border","width"),{x:u,y:d,box:h}=zk(n,e),g=a.left+(h&&l.left),m=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-g)/_*e.width/i),y:Math.round((d-m)/x*e.height/i)}}function Uk(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&su(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Oa(s),u=lr(l,"border","width"),d=lr(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Ca(l.maxWidth,s,"clientWidth"),r=Ca(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||ba,maxHeight:r||ba}}const Ei=n=>Math.round(n*10)/10;function Hk(n,t,e,i){const r=Oa(n),s=lr(r,"margin"),a=Ca(r.maxWidth,n,"clientWidth")||ba,l=Ca(r.maxHeight,n,"clientHeight")||ba,u=Uk(n,t,e);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const m=lr(r,"border","width"),_=lr(r,"padding");d-=_.width+m.width,h-=_.height+m.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ei(Math.min(d,a,u.maxWidth)),h=Ei(Math.min(h,l,u.maxHeight)),d&&!h&&(h=Ei(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ei(Math.floor(h*i))),{width:d,height:h}}function rg(n,t,e){const i=t||1,r=Ei(n.height*i),s=Ei(n.width*i);n.height=Ei(n.height),n.width=Ei(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Wk=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};ru()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function sg(n,t){const e=Nk(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function cr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Vk(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function $k(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=cr(n,r,e),l=cr(r,s,e),u=cr(s,t,e),d=cr(a,l,e),h=cr(l,u,e);return cr(d,h,e)}const Yk=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},qk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function $r(n,t,e){return n?Yk(t,e):qk()}function og(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function ag(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lg(n){return n==="angle"?{between:Vs,compare:jM,normalize:Ue}:{between:ni,compare:(t,e)=>t-e,normalize:t=>t}}function cg({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function jk(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=lg(i),u=t.length;let{start:d,end:h,loop:g}=n,m,_;if(g){for(d+=u,h+=u,m=0,_=u;m<_&&a(l(t[d%u][i]),r,s);++m)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:g,style:n.style}}function ug(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=lg(i),{start:h,end:g,loop:m,style:_}=jk(n,t,e),x=[];let v=!1,S=null,C,E,B;const P=()=>u(r,B,C)&&l(r,B)!==0,L=()=>l(s,C)===0||u(s,B,C),I=()=>v||P(),N=()=>!v||L();for(let T=h,M=h;T<=g;++T)E=t[T%a],!E.skip&&(C=d(E[i]),C!==B&&(v=u(C,r,s),S===null&&I()&&(S=l(C,r)===0?T:M),S!==null&&N()&&(x.push(cg({start:S,end:T,loop:m,count:a,style:_})),S=null),M=T,B=C));return S!==null&&x.push(cg({start:S,end:g,loop:m,count:a,style:_})),x}function dg(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=ug(i[r],n.points,t);s.length&&e.push(...s)}return e}function Gk(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Kk(n,t,e,i){const r=n.length,s=[];let a=t,l=n[t],u;for(u=t+1;u<=e;++u){const d=n[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 Xk(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=Gk(e,r,s,i);if(i===!0)return fg(n,[{start:a,end:l,loop:s}],e,t);const u=l<a?l+r:l,d=!!n._fullLoop&&a===0&&l===r-1;return fg(n,Kk(e,a,u,d),e,t)}function fg(n,t,e,i){return!i||!i.setContext||!e?t:Zk(n,t,e,i)}function Zk(n,t,e,i){const r=n._chart.getContext(),s=hg(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let h=s,g=t[0].start,m=g;function _(x,v,S,C){const E=l?-1:1;if(x!==v){for(x+=u;e[x%u].skip;)x-=E;for(;e[v%u].skip;)v+=E;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:S,style:C}),h=C,g=v%u)}}for(const x of t){g=l?g:x.start;let v=e[g%u],S;for(m=g+1;m<=x.end;m++){const C=e[m%u];S=hg(i.setContext(Oi(r,{type:"segment",p0:v,p1:C,p0DataIndex:(m-1)%u,p1DataIndex:m%u,datasetIndex:a}))),Qk(S,h)&&_(g,m-1,x.loop,h),v=C,h=S}g<m-1&&_(g,m-1,x.loop,h)}return d}function hg(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Qk(n,t){if(!t)return!1;const e=[],i=function(r,s){return Kc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Aa(n,t,e){return n.options.clip?n[e]:t[e]}function Jk(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Aa(e,t,"left"),right:Aa(e,t,"right"),top:Aa(i,t,"top"),bottom:Aa(i,t,"bottom")}:t}function pg(n,t){const e=t._clip;if(e.disabled)return!1;const i=Jk(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class tD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=zp.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=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),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var si=new tD;const gg="transparent",eD={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ta(n||gg),r=i.valid&&Ta(t||gg);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class nD{constructor(t,e,i,r){const s=e[i];r=Ks([t.to,r,s,t.from]);const a=Ks([t.from,s,r]);this._active=!0,this._fn=t.fn||eD[t.type||typeof a],this._easing=$s[t.easing]||$s.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,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=Ks([t.to,e,r,t.from]),this._from=Ks([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=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||e<i),!this._active){this._target[r]=l,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/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((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class ou{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Pt(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Pt(s))return;const a={};for(const l of e)a[l]=s[l];(qt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,r=rD(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&iD(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),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,e));continue}const h=e[d];let g=s[d];const m=i.get(d);if(g)if(m&&g.active()){g.update(m,h,l);continue}else g.cancel();if(!m||!m.duration){t[d]=h;continue}s[d]=g=new nD(m,t,d,h),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return si.add(this._chart,i),!0}}function iD(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function rD(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function mg(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function sD(n,t,e){if(e===!1)return!1;const i=mg(n,e),r=mg(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function oD(n){let t,e,i,r;return Pt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function yg(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function _g(n,t,e,i={}){const r=n.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===e){if(h=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Yn(t)===Yn(d))&&(t+=d)}return!h&&!i.all?0:t}function aD(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),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]:n[h]};return l}function au(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function lD(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function cD(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function uD(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function bg(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function xg(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,h=lD(s,a,i),g=t.length;let m;for(let _=0;_<g;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});m=C[d]=uD(r,h,v),m[l]=S,m._top=bg(m,a,!0,i.type),m._bottom=bg(m,a,!1,i.type);const E=m._visualValues||(m._visualValues={});E[l]=S}}function lu(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function dD(n,t){return Oi(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function fD(n,t,e){return Oi(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Xs(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const cu=n=>n==="reset"||n==="none",wg=(n,t)=>t?n:Object.assign({},n),hD=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yg(e,!0),values:null};class Ri{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=au(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&&Xs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,m,_,x)=>g==="x"?m:g==="r"?x:_,s=e.xAxisID=Mt(i.xAxisID,lu(t,"x")),a=e.yAxisID=Mt(i.yAxisID,lu(t,"y")),l=e.rAxisID=Mt(i.rAxisID,lu(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),h=e.vAxisID=r(u,a,s,l);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Bp(this._data,this),t._stacked&&Xs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Pt(e)){const r=this._cachedMeta;this._data=aD(e,r)}else if(i!==e){if(i){Bp(i,this);const r=this._cachedMeta;Xs(r),r._parsed=[]}e&&Object.isExtensible(e)&&ZM(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=au(e.vScale,e),e.stack!==i.stack&&(r=!0,Xs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(xg(this,e._parsed),e._stacked=au(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,g,m;if(this._parsing===!1)i._parsed=r,i._sorted=!0,m=r;else{qt(r[t])?m=this.parseArrayData(i,r,t,e):Pt(r[t])?m=this.parseObjectData(i,r,t,e):m=this.parsePrimitiveData(i,r,t,e);const _=()=>g[l]===null||d&&g[l]<d[l];for(h=0;h<e;++h)i._parsed[h+t]=g=m[h],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&xg(this,m)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),h=s===a,g=new Array(r);let m,_,x;for(m=0,_=r;m<_;++m)x=m+i,g[m]={[l]:h||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,h,g;for(u=0,d=r;u<d;++u)h=u+i,g=e[h],l[u]={x:s.parse(g[0],h),y:a.parse(g[1],h)};return l}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,g,m,_;for(h=0,g=r;h<g;++h)m=h+i,_=e[m],d[h]={x:s.parse(Mi(_,l),m),y:a.parse(Mi(_,u),m)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],l={keys:yg(r,!0),values:e._stacks[t.axis]._visualValues};return _g(l,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const l=r&&i._stacks[e.axis];r&&l&&(r.values=l,a=_g(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=hD(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=cD(l);let m,_;function x(){_=r[m];const v=_[l.axis];return!ae(_[t.axis])||h>v||g<v}for(m=0;m<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++m);if(s){for(m=a-1;m>=0;--m)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],ae(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=oD(Mt(this.options.clip,sD(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.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 g=r[h];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(h=0;h<a.length;++h)a[h].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=fD(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=dD(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,l=s[a],u=this.enableOptionSharing&&en(i);if(l)return wg(l,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],m=d.getOptionScopes(this.getDataset(),h),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),v=d.resolveNamedOptions(m,_,x,g);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(wg(v,u))),v}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const h=this.chart.config,g=h.datasetAnimationScopeKeys(this._type,e),m=h.getOptionScopes(this.getDataset(),g);u=h.createResolver(m,this.getContext(t,i,e))}const d=new ou(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,e){return!e||cu(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){cu(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!cu(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,u,d]of this._syncList)this[l](u,d);this._syncList=[];const r=i.length,s=e.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,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let l;const u=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Xs(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](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,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function pD(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Fp(i.sort((r,s)=>r-s))}return n._cache.$bar}function gD(n){const t=n.iScale,e=pD(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(en(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function mD(n,t,e,i){const r=e.barThickness;let s,a;return xt(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function yD(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,l=n<r.length-1?r[n+1]:null;const u=e.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:e.barPercentage,start:d}}function _D(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[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[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function vg(n,t,e,i){return qt(n)?_D(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Sg(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,h,g,m;for(d=e,h=e+i;d<h;++d)m=t[d],g={},g[r.axis]=l||r.parse(a[d],d),u.push(vg(m,g,s,d));return u}function uu(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function bD(n,t,e){return n!==0?Yn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function xD(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function wD(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:h}=xD(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=h:(s[Tg(h,a,l,u)]=!0,r=d)),s[Tg(r,a,l,u)]=!0,n.borderSkipped=s}function Tg(n,t,e,i){return i?(n=vD(n,t,e),n=Mg(n,e,t)):n=Mg(n,t,e),n}function vD(n,t,e){return n===t?e:n===e?t:n}function Mg(n,t,e){return n==="start"?t:n==="end"?e:n}function SD(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class kg extends Ri{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,e,i,r){return Sg(t,e,i,r)}parseArrayData(t,e,i,r){return Sg(t,e,i,r)}parseObjectData(t,e,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,g=[];let m,_,x,v;for(m=i,_=i+r;m<_;++m)v=e[m],x={},x[s.axis]=s.parse(Mi(v,d),m),g.push(vg(Mi(v,h),x,a,m));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===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 e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,l=uu(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 e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),v=s||xt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[l.axis],E={horizontal:d,base:v.base,enableBorderRadius:!C||uu(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};m&&(E.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const B=E.options||t[_].options;wD(E,B,C,a),SD(E,B,h.ratio),this.updateElement(t[_],_,E,r)}}_getStacks(t,e){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(e),u=l&&l[i.axis],d=h=>{const g=h._parsed.find(_=>_[i.axis]===u),m=g&&g[h.vScale.axis];if(xt(m)||isNaN(m))return!0};for(const h of r)if(!(e!==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,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Mt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||gD(e),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:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,h=uu(d);let g=u[e.axis],m=0,_=i?this.applyStack(e,u,i):g,x,v;_!==g&&(m=_-g,_=g),h&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Yn(g)!==Yn(d.barEnd)&&(m=0),m+=g);const S=!xt(s)&&!h?s:m;let C=e.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(m+_):x=C,v=x-C,Math.abs(v)<a){v=bD(v,e,l)*a,g===l&&(C-=v/2);const E=e.getPixelForDecimal(0),B=e.getPixelForDecimal(1),P=Math.min(E,B),L=Math.max(E,B);C=Math.max(Math.min(C,L),P),x=C+v,i&&!h&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const E=Yn(v)*e.getLineWidthForValue(l)/2;C+=E,v-=E}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Mt(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(e.grouped){const h=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?yD(t,e,r,h*d):mD(t,e,r,h*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Mt(m,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class TD extends Ri{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,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,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 e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=a.axis,g=l.axis;for(let m=e;m<e+i;m++){const _=t[m],x=!s&&this.getParsed(m),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[g]=s?l.getBasePixel():l.getPixelForValue(x[g]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(m,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,m,v,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Mt(i&&i._custom,s),r}}function MD(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const l=n,u=l+t,d=Math.cos(l),h=Math.sin(l),g=Math.cos(u),m=Math.sin(u),_=(B,P,L)=>Vs(B,l,u,!0)?1:Math.max(P,P*e,L,L*e),x=(B,P,L)=>Vs(B,l,u,!0)?-1:Math.min(P,P*e,L,L*e),v=_(0,d,g),S=_(re,h,m),C=x(Et,d,g),E=x(Et+re,h,m);i=(v-C)/2,r=(S-E)/2,s=-(v+C)/2,a=-(S+E)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Zs extends Ri{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 e=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Pt(i[t])){const{key:u="value"}=this._parsing;s=d=>+Mi(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;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),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,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(BM(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:m,ratioY:_,offsetX:x,offsetY:v}=MD(g,h,u),S=(i.width-a)/m,C=(i.height-a)/_,E=Math.max(Math.min(S,C)/2,0),B=Op(this.options.radius,E),P=Math.max(B*u,0),L=(B-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*B,this.offsetY=v*B,r.total=this.calculateTotal(),this.outerRadius=B-L*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-L*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/te)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,g=(l.top+l.bottom)/2,m=s&&d.animateScale,_=m?0:this.innerRadius,x=m?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(e,r);let C=this._getRotation(),E;for(E=0;E<e;++E)C+=this._circumference(E,s);for(E=e;E<e+i;++E){const B=this._circumference(E,s),P=t[E],L={x:h+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+B,circumference:B,outerRadius:x,innerRadius:_};S&&(L.options=v||this.resolveDataElementOptions(E,P.active?"active":r)),C+=B,this.updateElement(P,E,L,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?te*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Ys(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=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"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Mt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Dg extends Ri{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 e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:l,count:u}=Hp(e,r,a);this._drawStart=l,this._drawCount=u,Wp(e)&&(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,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(e,r),m=a.axis,_=l.axis,{spanGaps:x,segment:v}=this.options,S=Di(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",E=e+i,B=t.length;let P=e>0&&this.getParsed(e-1);for(let L=0;L<B;++L){const I=t[L],N=C?I:{};if(L<e||L>=E){N.skip=!0;continue}const T=this.getParsed(L),M=xt(T[_]),O=N[m]=a.getPixelForValue(T[m],L),z=N[_]=s||M?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,T,u):T[_],L);N.skip=isNaN(O)||isNaN(z)||M,N.stop=L>0&&Math.abs(T[m]-P[m])>S,v&&(N.parsed=T,N.raw=d.data[L]),g&&(N.options=h||this.resolveDataElementOptions(L,I.active?"active":r)),C||this.updateElement(I,L,N,r),P=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.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 Cg extends Ri{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 e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.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,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Ys(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.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,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,g=d.yCenter,m=d.getIndexAngle(0)-.5*Et;let _=m,x;const v=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,v);for(x=e;x<e+i;x++){const S=t[x];let C=_,E=_+this._computeAngle(x,r,v),B=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=E,s&&(u.animateScale&&(B=0),u.animateRotate&&(C=E=m));const P={x:h,y:g,innerRadius:0,outerRadius:B,startAngle:C,endAngle:E,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,P,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class kD extends Zs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class DD extends Ri{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 e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.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,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=e;l<e+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),h=s.getPointPositionForValue(l,this.getParsed(l).r),g=a?s.xCenter:h.x,m=a?s.yCenter:h.y,_={x:g,y:m,angle:h.angle,skip:isNaN(g)||isNaN(m),options:d};this.updateElement(u,l,_,r)}}}class Og extends Ri{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 e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=Hp(e,i,r);if(this._drawStart=s,this._drawCount=a,Wp(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=e;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 e.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,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(h),m=this.includeOptions(r,g),_=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,C=Di(v)?v:Number.POSITIVE_INFINITY,E=this.chart._animationsDisabled||s||r==="none";let B=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const L=t[P],I=this.getParsed(P),N=E?L:{},T=xt(I[x]),M=N[_]=a.getPixelForValue(I[_],P),O=N[x]=s||T?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,I,u):I[x],P);N.skip=isNaN(M)||isNaN(O)||T,N.stop=P>0&&Math.abs(I[_]-B[_])>C,S&&(N.parsed=I,N.raw=d.data[P]),m&&(N.options=g||this.resolveDataElementOptions(P,L.active?"active":r)),E||this.updateElement(L,P,N,r),B=I}this.updateSharedOptions(g,r,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let u=e.length-1;u>=0;--u)l=Math.max(l,e[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}var CD=Object.freeze({__proto__:null,BarController:kg,BubbleController:TD,DoughnutController:Zs,LineController:Dg,PieController:kD,PolarAreaController:Cg,RadarController:DD,ScatterController:Og});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class du{static override(t){Object.assign(du.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ur()}parse(){return ur()}format(){return ur()}add(){return ur()}diff(){return ur()}startOf(){return ur()}endOf(){return ur()}}var Ag={_date:du};function OD(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,l=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?KM:ii;if(i){if(r._sharedOptions){const h=s[0],g=typeof h.getRange=="function"&&h.getRange(t);if(g){const m=d(s,t,e-g),_=d(s,t,e+g);return{lo:m.lo,hi:_.hi}}}}else{const h=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:m}=n,_=m.slice(0,h.lo+1).reverse().findIndex(v=>!xt(v[g.axis]));h.lo-=Math.max(0,_);const x=m.slice(h.hi).findIndex(v=>!xt(v[g.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function Qs(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:h}=s[l],{lo:g,hi:m}=OD(s[l],t,a,r);for(let _=g;_<=m;++_){const x=h[_];x.skip||i(x,d,_)}}}function AD(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function fu(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||Qs(n,e,t,function(l,u,d){!r&&!ri(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function ED(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:g}=va(a,{x:t.x,y:t.y});Vs(g,d,h)&&r.push({element:a,datasetIndex:l,index:u})}return Qs(n,e,t,s),r}function RD(n,t,e,i,r,s){let a=[];const l=AD(e);let u=Number.POSITIVE_INFINITY;function d(h,g,m){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const S=l(t,x);S<u?(a=[{element:h,datasetIndex:g,index:m}],u=S):S===u&&a.push({element:h,datasetIndex:g,index:m})}return Qs(n,e,t,d),a}function hu(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?ED(n,t,e,r):RD(n,t,e,i,r,s)}function Eg(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return Qs(n,e,t,(u,d,h)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:h}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var pu={evaluateInteractionItems:Qs,modes:{index(n,t,e,i){const r=Ai(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?fu(n,r,s,i,a):hu(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,g=d.data[h];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:h})}),u):[]},dataset(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?fu(n,r,s,i,a):hu(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:u,index:h})}return l},point(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return fu(n,r,s,i,a)},nearest(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return hu(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ai(t,n);return Eg(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ai(t,n);return Eg(n,r,"y",e.intersect,i)}}};const Rg=["left","top","right","bottom"];function Js(n,t){return n.filter(e=>e.pos===t)}function Pg(n,t){return n.filter(e=>Rg.indexOf(e.pos)===-1&&e.box.axis===t)}function to(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function PD(n){const t=[];let e,i,r,s,a,l;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function ID(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Rg.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 LD(n,t){const e=ID(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=n.length;s<a;++s){l=n[s];const{fullSize:u}=l.box,d=e[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 e}function ND(n){const t=PD(n),e=to(t.filter(d=>d.box.fullSize),!0),i=to(Js(t,"left"),!0),r=to(Js(t,"right")),s=to(Js(t,"top"),!0),a=to(Js(t,"bottom")),l=Pg(t,"x"),u=Pg(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:Js(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Ig(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Lg(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function BD(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!Pt(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&Lg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Ig(a,n,"left","right")),u=Math.max(0,t.outerHeight-Ig(a,n,"top","bottom")),d=l!==n.w,h=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:h}:{same:h,other:d}}function FD(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function zD(n,t){const e=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],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function eo(n,t,e,i){const r=[];let s,a,l,u,d,h;for(s=0,a=n.length,d=0;s<a;++s){l=n[s],u=l.box,u.update(l.width||t.w,l.height||t.h,zD(l.horizontal,t));const{same:g,other:m}=BD(t,e,l,i);d|=g&&r.length,h=h||m,u.fullSize||r.push(l)}return d&&eo(r,t,e,i)||h}function Ea(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Ng(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const l of n){const u=l.box,d=i[l.stack]||{placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const g=t.w*h,m=d.size||u.height;en(d.start)&&(a=d.start),u.fullSize?Ea(u,r.left,a,e.outerWidth-r.right-r.left,m):Ea(u,t.left+d.placed,a,g,m),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*h,m=d.size||u.width;en(d.start)&&(s=d.start),u.fullSize?Ea(u,s,r.top,m,e.outerHeight-r.bottom-r.top):Ea(u,s,t.top+d.placed,m,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var We={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=ND(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.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,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),m=Object.assign({},r);Lg(m,we(i));const _=Object.assign({maxPadding:m,w:s,h:a,x:r.left,y:r.top},r),x=LD(u.concat(d),g);eo(l.fullSize,_,g,x),eo(u,_,g,x),eo(d,_,g,x)&&eo(u,_,g,x),FD(_),Ng(l.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,Ng(l.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,v=>{const S=v.box;Object.assign(S,n.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Bg{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class UD extends Bg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ra="$chartjs",HD={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fg=n=>n===null||n==="";function WD(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ra]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Fg(r)){const s=sg(n,"width");s!==void 0&&(n.width=s)}if(Fg(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=sg(n,"height");s!==void 0&&(n.height=s)}return n}const zg=Wk?{passive:!0}:!1;function VD(n,t,e){n&&n.addEventListener(t,e,zg)}function $D(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,zg)}function YD(n,t){const e=HD[n.type]||n.type,{x:i,y:r}=Ai(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pa(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function qD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.addedNodes,i),a=a&&!Pa(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function jD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.removedNodes,i),a=a&&!Pa(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const no=new Map;let Ug=0;function Hg(){const n=window.devicePixelRatio;n!==Ug&&(Ug=n,no.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function GD(n,t){no.size||window.addEventListener("resize",Hg),no.set(n,t)}function KD(n){no.delete(n),no.size||window.removeEventListener("resize",Hg)}function XD(n,t,e){const i=n.canvas,r=i&&su(i);if(!r)return;const s=Up((l,u)=>{const d=r.clientWidth;e(l,u),d<r.clientWidth&&e()},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),GD(n,s),a}function gu(n,t,e){e&&e.disconnect(),t==="resize"&&KD(n)}function ZD(n,t,e){const i=n.canvas,r=Up(s=>{n.ctx!==null&&e(YD(s,n))},n);return VD(i,t,r),r}class QD extends Bg{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(WD(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ra])return!1;const i=e[Ra].initial;["height","width"].forEach(s=>{const a=i[s];xt(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[Ra],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:qD,detach:jD,resize:XD}[e]||ZD;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:gu,detach:gu,resize:gu}[e]||$D)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Hk(t,e,i,r)}isAttached(t){const e=t&&su(t);return!!(e&&e.isConnected)}}function JD(n){return!ru()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?UD:QD}class Ve{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Di(this.x)&&Di(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function tC(n,t){const e=n.options.ticks,i=eC(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?iC(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return rC(t,d,s,a/r),d;const h=nC(s,t,r);if(a>0){let g,m;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ia(t,d,h,xt(_)?0:l-_,l),g=0,m=a-1;g<m;g++)Ia(t,d,h,s[g],s[g+1]);return Ia(t,d,h,u,xt(_)?t.length:u+_),d}return Ia(t,d,h),d}function eC(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function nC(n,t,e){const i=sC(n),r=t.length/e;if(!i)return Math.max(r,1);const s=$M(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 iC(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function rC(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function Ia(n,t,e,i,r){const s=Mt(i,0),a=Math.min(Mt(r,n.length),n.length);let l=0,u,d,h;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),h=s;h<0;)l++,h=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(s+l*e))}function sC(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const oC=n=>n==="left"?"right":n==="right"?"left":n,Wg=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Vg=(n,t)=>Math.min(t||n,n);function $g(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function aC(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,l=1e-6;let u=n.getPixelForTick(r),d;if(!(e&&(i===1?d=Math.max(u-s,a-u):t===0?d=(n.getPixelForTick(1)-u)/2:d=(u-n.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function lC(n,t){Jt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function io(n){return n.drawTicks?n.tickLength:0}function Yg(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(qt(n.text)?n.text.length:1)*e.lineHeight+i.height}function cC(n,t){return Oi(n,{scale:t,type:"scale"})}function uC(n,t,e){return Oi(n,{tick:e,index:t,type:"tick"})}function dC(n,t,e){let i=Gc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=oC(i)),i}function fC(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:h}=u;let g=0,m,_,x;const v=a-r,S=l-s;if(n.isHorizontal()){if(_=He(i,s,l),Pt(e)){const C=Object.keys(e)[0],E=e[C];x=h[C].getPixelForValue(E)+v-t}else e==="center"?x=(d.bottom+d.top)/2+v-t:x=Wg(n,e,t);m=l-s}else{if(Pt(e)){const C=Object.keys(e)[0],E=e[C];_=h[C].getPixelForValue(E)-S+t}else e==="center"?_=(d.left+d.right)/2-S+t:_=Wg(n,e,t);x=He(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:m,rotation:g}}class dr extends Ve{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=pn(t,Number.POSITIVE_INFINITY),e=pn(e,Number.NEGATIVE_INFINITY),i=pn(i,Number.POSITIVE_INFINITY),r=pn(r,Number.NEGATIVE_INFINITY),{min:pn(t,i),max:pn(e,r),minDefined:ae(t),maxDefined:ae(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:pn(e,pn(i,e)),max:pn(i,pn(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=bk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?$g(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=tC(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,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Qt(this.options.afterUpdate,[this])}beforeSetDimensions(){Qt(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(){Qt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Qt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Qt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Qt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Qt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Qt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Vg(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),g=h.widest.width,m=h.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),g+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-io(t.grid)-e.padding-Yg(t.title,this.chart.options.font),d=Math.sqrt(g*g+m*m),a=wa(Math.min(Math.asin(Ce((h.highest.height+6)/l,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(m/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=Yg(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=io(s)+u):(t.height=this.maxHeight,t.width=io(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:g,highest:m}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*g.width+v*m.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*g.width+S*m.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,S,v)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,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,g=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,_=0;u?d?(m=r*t.width,_=i*e.height):(m=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?m=t.width:s!=="inner"&&(m=t.width/2,_=e.width/2),this.paddingLeft=Math.max((m-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let h=e.height/2,g=t.height/2;s==="start"?(h=0,g=t.height):s==="end"&&(h=e.height,g=0),this.paddingTop=h+a,this.paddingBottom=g+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(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)xt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=$g(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(e/Vg(e,i));let d=0,h=0,g,m,_,x,v,S,C,E,B,P,L;for(g=0;g<e;g+=u){if(x=t[g].label,v=this._resolveTickFontOptions(g),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},E=v.lineHeight,B=P=0,!xt(x)&&!qt(x))B=ka(r,C.data,C.gc,B,x),P=E;else if(qt(x))for(m=0,_=x.length;m<_;++m)L=x[m],!xt(L)&&!qt(L)&&(B=ka(r,C.data,C.gc,B,L),P+=E);a.push(B),l.push(P),d=Math.max(B,d),h=Math.max(P,h)}lC(s,e);const I=a.indexOf(d),N=l.indexOf(h),T=M=>({width:a[M]||0,height:l[M]||0});return{first:T(0),last:T(e-1),widest:T(I),highest:T(N),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return GM(this._alignToPixels?or(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=uC(this.getContext(),t,i))}return this.$context||(this.$context=cC(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),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 e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),m=io(s),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(j){return or(i,j,v)};let E,B,P,L,I,N,T,M,O,z,W,it;if(a==="top")E=C(this.bottom),N=this.bottom-m,M=E-S,z=C(t.top)+S,it=t.bottom;else if(a==="bottom")E=C(this.top),z=t.top,it=C(t.bottom)-S,N=E+S,M=this.top+m;else if(a==="left")E=C(this.right),I=this.right-m,T=E-S,O=C(t.left)+S,W=t.right;else if(a==="right")E=C(this.left),O=t.left,W=C(t.right)-S,I=E+S,T=this.left+m;else if(e==="x"){if(a==="center")E=C((t.top+t.bottom)/2+.5);else if(Pt(a)){const j=Object.keys(a)[0],tt=a[j];E=C(this.chart.scales[j].getPixelForValue(tt))}z=t.top,it=t.bottom,N=E+S,M=N+m}else if(e==="y"){if(a==="center")E=C((t.left+t.right)/2);else if(Pt(a)){const j=Object.keys(a)[0],tt=a[j];E=C(this.chart.scales[j].getPixelForValue(tt))}I=E-S,T=I-m,O=t.left,W=t.right}const ut=Mt(r.ticks.maxTicksLimit,g),ft=Math.max(1,Math.ceil(g/ut));for(B=0;B<g;B+=ft){const j=this.getContext(B),tt=s.setContext(j),nt=l.setContext(j),et=tt.lineWidth,at=tt.color,H=nt.dash||[],q=nt.dashOffset,X=tt.tickWidth,_t=tt.tickColor,G=tt.tickBorderDash||[],$=tt.tickBorderDashOffset;P=aC(this,B,u),P!==void 0&&(L=or(i,P,et),d?I=T=O=W=L:N=M=z=it=L,_.push({tx1:I,ty1:N,tx2:T,ty2:M,x1:O,y1:z,x2:W,y2:it,width:et,color:at,borderDash:H,borderDashOffset:q,tickWidth:X,tickColor:_t,tickBorderDash:G,tickBorderDashOffset:$}))}return this._ticksLength=g,this._borderValue=E,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:h,mirror:g}=s,m=io(i.grid),_=m+h,x=g?-h:_,v=-xe(this.labelRotation),S=[];let C,E,B,P,L,I,N,T,M,O,z,W,it="middle";if(r==="top")I=this.bottom-x,N=this._getXAxisLabelAlignment();else if(r==="bottom")I=this.top+x,N=this._getXAxisLabelAlignment();else if(r==="left"){const ft=this._getYAxisLabelAlignment(m);N=ft.textAlign,L=ft.x}else if(r==="right"){const ft=this._getYAxisLabelAlignment(m);N=ft.textAlign,L=ft.x}else if(e==="x"){if(r==="center")I=(t.top+t.bottom)/2+_;else if(Pt(r)){const ft=Object.keys(r)[0],j=r[ft];I=this.chart.scales[ft].getPixelForValue(j)+_}N=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")L=(t.left+t.right)/2-_;else if(Pt(r)){const ft=Object.keys(r)[0],j=r[ft];L=this.chart.scales[ft].getPixelForValue(j)}N=this._getYAxisLabelAlignment(m).textAlign}e==="y"&&(u==="start"?it="top":u==="end"&&(it="bottom"));const ut=this._getLabelSizes();for(C=0,E=l.length;C<E;++C){B=l[C],P=B.label;const ft=s.setContext(this.getContext(C));T=this.getPixelForTick(C)+s.labelOffset,M=this._resolveTickFontOptions(C),O=M.lineHeight,z=qt(P)?P.length:1;const j=z/2,tt=ft.color,nt=ft.textStrokeColor,et=ft.textStrokeWidth;let at=N;a?(L=T,N==="inner"&&(C===E-1?at=this.options.reverse?"left":"right":C===0?at=this.options.reverse?"right":"left":at="center"),r==="top"?d==="near"||v!==0?W=-z*O+O/2:d==="center"?W=-ut.highest.height/2-j*O+O:W=-ut.highest.height+O/2:d==="near"||v!==0?W=O/2:d==="center"?W=ut.highest.height/2-j*O:W=ut.highest.height-z*O,g&&(W*=-1),v!==0&&!ft.showLabelBackdrop&&(L+=O/2*Math.sin(v))):(I=T,W=(1-z)*O/2);let H;if(ft.showLabelBackdrop){const q=we(ft.backdropPadding),X=ut.heights[C],_t=ut.widths[C];let G=W-q.top,$=0-q.left;switch(it){case"middle":G-=X/2;break;case"bottom":G-=X;break}switch(N){case"center":$-=_t/2;break;case"right":$-=_t;break;case"inner":C===E-1?$-=_t:C>0&&($-=_t/2);break}H={left:$,top:G,width:_t+q.width,height:X+q.height,color:ft.backdropColor}}S.push({label:P,font:M,textOffset:W,options:{rotation:v,color:tt,strokeColor:nt,strokeWidth:et,textAlign:at,textBaseline:it,translation:[L,I],backdrop:H}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,h;return e==="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)):e==="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,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=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(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.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:e,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,g,m;this.isHorizontal()?(d=or(t,this.left,a)-a/2,h=or(t,this.right,l)+l/2,g=m=u):(g=or(t,this.top,a)-a/2,m=or(t,this.bottom,l)+l/2,d=h=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(h,m),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&js(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;ar(i,d,0,h,u,l)}r&&Gs(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||Pt(e)?(u+=a.bottom,qt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:g,rotation:m}=fC(this,u,e,l);ar(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:m,textAlign:dC(l,e,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,e=t.ticks&&t.ticks.z||0,i=Mt(t.grid&&t.grid.z,-1),r=Mt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==dr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const l=e[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class La{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;gC(e)&&(i=this.register(e));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,hC(t,a,i),this.override&&se.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in se[r]&&(delete se[r][i],this.override&&delete sr[i])}}function hC(n,t,e){const i=Us(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&pC(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function pC(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),l=a.pop(),u=a.join(".");se.route(s,r,u,l)})}function gC(n){return"id"in n&&"defaults"in n}class mC{constructor(){this.controllers=new La(Ri,"datasets",!0),this.elements=new La(Ve,"elements"),this.plugins=new La(Object,"plugins"),this.scales=new La(dr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Jt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const r=Yc(t);Qt(i["before"+r],[],i),e[t](i),Qt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var qn=new mC;class yC{constructor(){this._init=void 0}notify(t,e,i,r){if(e==="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,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[e,r,s.options];if(Qt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){xt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Mt(i.options&&i.options.plugins,{}),s=_C(i);return r===!1&&!e?[]:xC(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function _C(n){const t={},e=[],i=Object.keys(qn.plugins.items);for(let s=0;s<i.length;s++)e.push(qn.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function bC(n,t){return!t&&n===!1?null:n===!0?{}:n}function xC(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=bC(i[u],r);d!==null&&s.push({plugin:l,options:wC(n.config,{plugin:l,local:e[u]},d,a)})}return s}function wC(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function mu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function vC(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function SC(n,t){return n===t?"_index_":"_value_"}function qg(n){if(n==="x"||n==="y"||n==="r")return n}function TC(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function yu(n,...t){if(qg(n))return n;for(const e of t){const i=e.axis||TC(e.position)||n.length>1&&qg(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function jg(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function MC(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return jg(n,"x",e[0])||jg(n,"y",e[0])}return{}}function kC(n,t){const e=sr[n.type]||{scales:{}},i=t.scales||{},r=mu(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Pt(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=yu(a,l,MC(a,n),se.scales[l.type]),d=SC(u,r),h=e.scales||{};s[a]=Hs(Object.create(null),[{axis:u},l,h[u],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||mu(l,t),h=(sr[l]||{}).scales||{};Object.keys(h).forEach(g=>{const m=vC(g,u),_=a[m+"AxisID"]||m;s[_]=s[_]||Object.create(null),Hs(s[_],[{axis:m},i[_],h[g]])})}),Object.keys(s).forEach(a=>{const l=s[a];Hs(l,[se.scales[l.type],se.scale])}),s}function Gg(n){const t=n.options||(n.options={});t.plugins=Mt(t.plugins,{}),t.scales=kC(n,t)}function Kg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function DC(n){return n=n||{},n.data=Kg(n.data),Gg(n),n}const Xg=new Map,Zg=new Set;function Na(n,t){let e=Xg.get(n);return e||(e=t(),Xg.set(n,e),Zg.add(e)),e}const ro=(n,t,e)=>{const i=Mi(t,e);i!==void 0&&n.add(i)};class CC{constructor(t){this._config=DC(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=Kg(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(),Gg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Na(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Na(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Na(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Na(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const u=new Set;e.forEach(h=>{t&&(u.add(t),h.forEach(g=>ro(u,t,g))),h.forEach(g=>ro(u,r,g)),h.forEach(g=>ro(u,sr[s]||{},g)),h.forEach(g=>ro(u,se,g)),h.forEach(g=>ro(u,Zc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),Zg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,sr[e]||{},se.datasets[e]||{},{type:e},se,Zc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Qg(this._resolverCache,t,r);let u=a;if(AC(a,e)){s.$shared=!1,i=nn(i)?i():i;const d=this.createResolver(t,i,l);u=Wr(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=Qg(this._resolverCache,t,i);return Pt(e)?Wr(s,e,void 0,r):s}}function Qg(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:eu(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const OC=n=>Pt(n)&&Object.getOwnPropertyNames(n).some(t=>nn(n[t]));function AC(n,t){const{isScriptable:e,isIndexable:i}=Xp(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(nn(l)||OC(l))||a&&qt(l))return!0}return!1}var EC="4.5.1";const RC=["top","bottom","left","right","chartArea"];function Jg(n,t){return n==="top"||n==="bottom"||RC.indexOf(n)===-1&&t==="x"}function tm(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function em(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function PC(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function nm(n){return ru()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ba={},im=n=>{const t=nm(n);return Object.values(Ba).filter(e=>e.canvas===t).pop()};function IC(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function LC(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let rn=class{static defaults=se;static instances=Ba;static overrides=sr;static registry=qn;static version=EC;static getChart=im;static register(...t){qn.add(...t),rm()}static unregister(...t){qn.remove(...t),rm()}constructor(t,e){const i=this.config=new CC(e),r=nm(t),s=im(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||JD(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=NM(),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 yC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=QM(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}si.listen(this,"complete",em),si.listen(this,"progress",PC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return xt(t)?e&&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 qn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jp(this.canvas,this.ctx),this}stop(){return si.stop(this),this}resize(t,e){si.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,rg(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Qt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Jt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const l=e[a],u=yu(a,l),d=u==="r",h=u==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=yu(u,l),h=Mt(l.type,a.dtype);(l.position===void 0||Jg(l.position,d)!==Jg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===h)g=i[u];else{const m=qn.getScale(h);g=new m({id:u,type:h,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{We.configure(this,a,a.options),We.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(tm("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[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=qn.getController(l),{datasetElementType:d,dataElementType:h}=se.datasets[l];Object.assign(u,{dataElementType:qn.getElement(h),datasetElementType:d&&qn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),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:g}=this.getDatasetMeta(d),m=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(m),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Jt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tm("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Jt(this.scales,t=>{We.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Rp(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;IC(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=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<e;s++)if(!Rp(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;We.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Jt(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 e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,nn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(si.has(this)?this.attached&&!si.running(this)&&si.start(this):(this.draw(),em({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 e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[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 e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=pg(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&js(e,r),t.controller.draw(),r&&Gs(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ri(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=pu.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Oi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);en(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),si.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),jp(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Jt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,d)=>{e.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(e.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)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Jt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Jt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,l,u;for(e==="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 e=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}});!ya(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,d)=>u.filter(h=>!d.some(g=>h.datasetIndex===g.datasetIndex&&h.index===g.index)),a=s(e,t),l=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,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,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,l=this._getActiveElements(t,r,i,a),u=WM(t),d=LC(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Qt(s.onHover,[t,l,this],this),u&&Qt(s.onClick,[t,l,this],this));const h=!ya(l,r);return(h||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,h}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function rm(){return Jt(rn.instances,n=>n._plugins.invalidate())}function NC(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,g=Math.min(d/a,Ue(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),l>0){const m=Math.min(d/l,Ue(i-e));n.arc(r,s,l+d/2,e-m/2,i+m/2,!0)}else{const m=Math.min(d/2,a*Ue(i-e));if(h==="round")n.arc(r,s,m,e-Et/2,i+Et/2,!0);else if(h==="bevel"){const _=2*m*m,x=-_*Math.cos(e+Et/2)+r,v=-_*Math.sin(e+Et/2)+s,S=_*Math.cos(i+Et/2)+r,C=_*Math.sin(i+Et/2)+s;n.lineTo(x,v),n.lineTo(S,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function BC(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;n.beginPath(),n.arc(s,a,l,i-d,e+d),u>r?(d=r/u,n.arc(s,a,u,e+d,i-d,!0)):n.arc(s,a,r,e+re,i-re),n.closePath(),n.clip()}function FC(n){return tu(n,["outerStart","outerEnd","innerStart","innerEnd"])}function zC(n,t,e,i){const r=FC(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function Yr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Fa(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:h}=t,g=Math.max(t.outerRadius+i+e-d,0),m=h>0?h+i+e+d:0;let _=0;const x=r-u;if(i){const ft=h>0?h-i:0,j=g>0?g-i:0,tt=(ft+j)/2,nt=tt!==0?x*tt/(tt+i):x;_=(x-nt)/2}const v=Math.max(.001,x*g-e/Et)/g,S=(x-v)/2,C=u+S+_,E=r-S-_,{outerStart:B,outerEnd:P,innerStart:L,innerEnd:I}=zC(t,m,g,E-C),N=g-B,T=g-P,M=C+B/N,O=E-P/T,z=m+L,W=m+I,it=C+L/z,ut=E-I/W;if(n.beginPath(),s){const ft=(M+O)/2;if(n.arc(a,l,g,M,ft),n.arc(a,l,g,ft,O),P>0){const et=Yr(T,O,a,l);n.arc(et.x,et.y,P,O,E+re)}const j=Yr(W,E,a,l);if(n.lineTo(j.x,j.y),I>0){const et=Yr(W,ut,a,l);n.arc(et.x,et.y,I,E+re,ut+Math.PI)}const tt=(E-I/m+(C+L/m))/2;if(n.arc(a,l,m,E-I/m,tt,!0),n.arc(a,l,m,tt,C+L/m,!0),L>0){const et=Yr(z,it,a,l);n.arc(et.x,et.y,L,it+Math.PI,C-re)}const nt=Yr(N,C,a,l);if(n.lineTo(nt.x,nt.y),B>0){const et=Yr(N,M,a,l);n.arc(et.x,et.y,B,C-re,M)}}else{n.moveTo(a,l);const ft=Math.cos(M)*g+a,j=Math.sin(M)*g+l;n.lineTo(ft,j);const tt=Math.cos(O)*g+a,nt=Math.sin(O)*g+l;n.lineTo(tt,nt)}n.closePath()}function UC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Fa(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Fa(n,t,e,i,u,r),n.fill(),u}function HC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:g,borderDashOffset:m,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=m,x?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let v=t.endAngle;if(s){Fa(n,t,e,i,v,r);for(let S=0;S<s;++S)n.stroke();isNaN(l)||(v=a+(l%te||te))}x&&BC(n,t,v),u.selfJoin&&v-a>=Et&&_===0&&h!=="miter"&&NC(n,t,v),s||(Fa(n,t,e,i,v,r),n.stroke())}class WC extends Ve{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,e,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=va(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),m=(this.options.spacing+this.options.borderWidth)/2,_=Mt(g,u-l),x=Vs(s,l,u)&&l!==u,v=_>=te||x,S=ni(a,d+m,h+m);return v&&S}getCenterPoint(t){const{x:e,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,g=(a+l+d+u)/2;return{x:e+Math.cos(h)*g,y:i+Math.sin(h)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):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(Et,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,UC(t,this,d,s,a),HC(t,this,d,s,a),t.restore()}}function sm(n,t,e=t){n.lineCap=Mt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Mt(e.borderDash,t.borderDash)),n.lineDashOffset=Mt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Mt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Mt(e.borderWidth,t.borderWidth),n.strokeStyle=Mt(e.borderColor,t.borderColor)}function VC(n,t,e){n.lineTo(e.x,e.y)}function $C(n){return n.stepped?uk:n.tension||n.cubicInterpolationMode==="monotone"?dk:VC}function om(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{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 YC(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=om(r,e,i),h=$C(s);let{move:g=!0,reverse:m}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(m?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):h(n,v,x,m,s.stepped),v=x);return u&&(x=r[(l+(m?d:0))%a],h(n,v,x,m,s.stepped)),!!u}function qC(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=om(r,e,i),{move:u=!0,reverse:d}=i||{};let h=0,g=0,m,_,x,v,S,C;const E=P=>(a+(d?l-P:P))%s,B=()=>{v!==S&&(n.lineTo(h,S),n.lineTo(h,v),n.lineTo(h,C))};for(u&&(_=r[E(0)],n.moveTo(_.x,_.y)),m=0;m<=l;++m){if(_=r[E(m)],_.skip)continue;const P=_.x,L=_.y,I=P|0;I===x?(L<v?v=L:L>S&&(S=L),h=(g*h+P)/++g):(B(),n.lineTo(P,L),x=I,g=0,v=S=L),C=L}B()}function _u(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?qC:YC}function jC(n){return n.stepped?Vk:n.tension||n.cubicInterpolationMode==="monotone"?$k:cr}function GC(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),sm(n,t.options),n.stroke(r)}function KC(n,t,e,i){const{segments:r,options:s}=t,a=_u(t);for(const l of r)sm(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const XC=typeof Path2D=="function";function ZC(n,t,e,i){XC&&!t.options.segment?GC(n,t,e,i):KC(n,t,e,i)}class za extends Ve{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,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Lk(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Xk(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=dg(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=jC(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:g,end:m}=a[d],_=s[g],x=s[m];if(_===x){l.push(_);continue}const v=Math.abs((r-_[e])/(x[e]-_[e])),S=u(_,x,v,i.stepped);S[e]=t[e],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,e,i){return _u(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=_u(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const l of r)a&=s(t,this,l,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),ZC(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function am(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class QC extends Ve{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,e,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return am(this,t,"x",e)}inYRange(t,e){return am(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ri(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Jc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function lm(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let l,u,d,h,g;return n.horizontal?(g=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-g,h=i+g):(g=s/2,l=e-g,u=e+g,d=Math.min(i,r),h=Math.max(i,r)),{left:l,top:d,right:u,bottom:h}}function Pi(n,t,e,i){return n?0:Ce(t,e,i)}function JC(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=Kp(i);return{t:Pi(r.top,s.top,0,e),r:Pi(r.right,s.right,0,t),b:Pi(r.bottom,s.bottom,0,e),l:Pi(r.left,s.left,0,t)}}function tO(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Ci(r),a=Math.min(t,e),l=n.borderSkipped,u=i||Pt(r);return{topLeft:Pi(!u||l.top||l.left,s.topLeft,0,a),topRight:Pi(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Pi(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Pi(!u||l.bottom||l.right,s.bottomRight,0,a)}}function eO(n){const t=lm(n),e=t.right-t.left,i=t.bottom-t.top,r=JC(n,e/2,i/2),s=tO(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-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 bu(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&lm(n,i);return l&&(r||ni(t,l.left,l.right))&&(s||ni(e,l.top,l.bottom))}function nO(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function iO(n,t){n.rect(t.x,t.y,t.w,t.h)}function xu(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class rO extends Ve{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:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=eO(this),l=nO(a.radius)?Hr:iO;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,xu(a,e,s)),t.clip(),l(t,xu(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,xu(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return bu(this,t,e,i)}inXRange(t,e){return bu(this,t,null,e)}inYRange(t,e){return bu(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var sO=Object.freeze({__proto__:null,ArcElement:WC,BarElement:rO,LineElement:za,PointElement:QC});const wu=["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)"],cm=wu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function um(n){return wu[n%wu.length]}function dm(n){return cm[n%cm.length]}function oO(n,t){return n.borderColor=um(t),n.backgroundColor=dm(t),++t}function aO(n,t){return n.backgroundColor=n.data.map(()=>um(t++)),t}function lO(n,t){return n.backgroundColor=n.data.map(()=>dm(t++)),t}function cO(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Zs?t=aO(e,t):r instanceof Cg?t=lO(e,t):r&&(t=oO(e,t))}}function fm(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function uO(n){return n&&(n.borderColor||n.backgroundColor)}function dO(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var fO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=fm(i)||uO(r)||s&&fm(s)||dO();if(!e.forceOverride&&a)return;const l=cO(n);i.forEach(l)}};function hO(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(s-2);let u=0;const d=t+e-1;let h=t,g,m,_,x,v;for(a[u++]=n[h],g=0;g<s-2;g++){let S=0,C=0,E;const B=Math.floor((g+1)*l)+1+t,P=Math.min(Math.floor((g+2)*l)+1,e)+t,L=P-B;for(E=B;E<P;E++)S+=n[E].x,C+=n[E].y;S/=L,C/=L;const I=Math.floor(g*l)+1+t,N=Math.min(Math.floor((g+1)*l)+1,e)+t,{x:T,y:M}=n[h];for(_=x=-1,E=I;E<N;E++)x=.5*Math.abs((T-S)*(n[E].y-M)-(T-n[E].x)*(C-M)),x>_&&(_=x,m=n[E],v=E);a[u++]=m,h=v}return a[u++]=n[d],a}function pO(n,t,e,i){let r=0,s=0,a,l,u,d,h,g,m,_,x,v;const S=[],C=t+e-1,E=n[t].x,P=n[C].x-E;for(a=t;a<t+e;++a){l=n[a],u=(l.x-E)/P*i,d=l.y;const L=u|0;if(L===h)d<x?(x=d,g=a):d>v&&(v=d,m=a),r=(s*r+l.x)/++s;else{const I=a-1;if(!xt(g)&&!xt(m)){const N=Math.min(g,m),T=Math.max(g,m);N!==_&&N!==I&&S.push({...n[N],x:r}),T!==_&&T!==I&&S.push({...n[T],x:r})}a>0&&I!==_&&S.push(n[I]),S.push(l),h=L,s=0,x=v=d,g=m=_=a}}return S}function hm(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function pm(n){n.data.datasets.forEach(t=>{hm(t)})}function gO(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ii(t,s.axis,a).lo,0,e-1)),d?r=Ce(ii(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var mO={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){pm(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Ks([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=n.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:g,count:m}=gO(u,d);const _=e.threshold||4*i;if(m<=_){hm(r);return}xt(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(e.algorithm){case"lttb":x=hO(d,g,m,i,e);break;case"min-max":x=pO(d,g,m,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){pm(n)}};function yO(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=Ua(u,d,r);const h=vu(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:r[u],end:r[d]});continue}const g=dg(t,h);for(const m of g){const _=vu(e,s[m.start],s[m.end],m.loop),x=ug(l,r,_);for(const v of x)a.push({source:v,target:m,start:{[e]:gm(h,_,"start",Math.max)},end:{[e]:gm(h,_,"end",Math.min)}})}}return a}function vu(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Ue(r),s=Ue(s)),{property:n,start:r,end:s}}function _O(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Ua(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})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:d.y}))}),s}function Ua(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function gm(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function mm(n,t){let e=[],i=!1;return qt(n)?(i=!0,e=n):e=_O(n,t),e.length?new za({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ym(n){return n&&n.fill!==!1}function bO(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ae(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function xO(n,t,e){const i=TO(n);if(Pt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?wO(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function wO(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function vO(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:Pt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function SO(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:Pt(n)?i=n.value:i=t.getBaseValue(),i}function TO(n){const t=n.options,e=t.fill;let i=Mt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function MO(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=kO(t,e);l.push(mm({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++)DO(r,a[h],l)}return new za({points:r,options:{}})}function kO(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function DO(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=CO(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function CO(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],g=a[h.start][e],m=a[h.end][e];if(ni(r,g,m)){l=r===g,u=r===m;break}}return{first:l,last:u,point:i}}class _m{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:te},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function OO(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return AO(t,e);if(e==="stack")return MO(n);if(e==="shape")return!0;const r=EO(n);return r instanceof _m?r:mm(r,i)}function AO(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function EO(n){return(n.scale||{}).getPointPositionForValue?PO(n):RO(n)}function RO(n){const{scale:t={},fill:e}=n,i=vO(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function PO(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=SO(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new _m({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 Su(n,t,e){const i=OO(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,h=d.fill,g=d.backgroundColor,{above:m=g,below:_=g}=h||{},x=r.getDatasetMeta(s),v=pg(r,x);i&&a.points.length&&(js(n,e),IO(n,{line:a,target:i,above:m,below:_,area:e,scale:l,axis:u,clip:v}),Gs(n))}function IO(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let h=s;s!==r&&(d==="x"?(bm(n,i,a.top),Tu(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),bm(n,i,a.bottom)):d==="y"&&(xm(n,i,a.left),Tu(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),xm(n,i,a.right),h=r)),Tu(n,{line:e,target:i,color:h,scale:l,property:d,clip:u}),n.restore()}function bm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function xm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(e,h.y),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Tu(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=yO(e,i,r);for(const{source:d,target:h,start:g,end:m}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,LO(n,a,l,x&&vu(r,g,m)),n.beginPath();const v=!!e.pathSegment(n,d);let S;if(x){v?n.closePath():wm(n,i,m,r);const C=!!i.pathSegment(n,h,{move:v,reverse:!0});S=v&&C,S||wm(n,i,g,r)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function LO(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,h,g;s==="x"?(u=a,d=r.top,h=l,g=r.bottom):(u=r.left,d=a,h=r.right,g=l),n.beginPath(),e&&(u=Math.max(u,e.left),h=Math.min(h,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,h-u,g-d),n.clip()}}function wm(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var NO={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof za&&(u={visible:n.isDatasetVisible(a),index:a,fill:xO(l,a,i),chart:n,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=bO(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.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&&Su(n.ctx,l,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;ym(s)&&Su(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ym(i)||e.drawTime!=="beforeDatasetDraw"||Su(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const vm=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},BO=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Sm extends Ve{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Qt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=le(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=vm(i,s);let d,h;e.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,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+l;let g=t;s.textAlign="left",s.textBaseline="middle";let m=-1,_=-h;return this.legendItems.forEach((x,v)=>{const S=i+e/2+s.measureText(x.text).width;(v===0||d[d.length-1]+S+2*l>a)&&(g+=h,d[d.length-(v>0?0:1)]=0,_+=h,m++),u[v]={left:0,top:_,row:m,width:S,height:r},d[d.length-1]+=S+l}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let g=l,m=0,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:E,itemHeight:B}=FO(i,e,s,S,r);C>0&&_+B+2*l>h&&(g+=m+l,d.push({width:m,height:_}),x+=m+l,v++,m=_=0),u[C]={left:x,top:_,col:v,width:E,height:B},m=Math.max(m,E),_+=B+l}),g+=m,d.push({width:m,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=$r(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=He(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=He(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=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=He(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;js(t,this),this._draw(),Gs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=$r(t.rtl,this.left,this.width),d=le(a.font),{padding:h}=a,g=d.size,m=g/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}=vm(a,g),C=function(I,N,T){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const M=Mt(T.lineWidth,1);if(r.fillStyle=Mt(T.fillStyle,l),r.lineCap=Mt(T.lineCap,"butt"),r.lineDashOffset=Mt(T.lineDashOffset,0),r.lineJoin=Mt(T.lineJoin,"miter"),r.lineWidth=M,r.strokeStyle=Mt(T.strokeStyle,l),r.setLineDash(Mt(T.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:M},z=u.xPlus(I,x/2),W=N+m;Gp(r,O,z,W,a.pointStyleWidth&&x)}else{const O=N+Math.max((g-v)/2,0),z=u.leftForLtr(I,x),W=Ci(T.borderRadius);r.beginPath(),Object.values(W).some(it=>it!==0)?Hr(r,{x:z,y:O,w:x,h:v,radius:W}):r.rect(z,O,x,v),r.fill(),M!==0&&r.stroke()}r.restore()},E=function(I,N,T){ar(r,T.text,I,N+S/2,d,{strikethrough:T.hidden,textAlign:u.textAlign(T.textAlign)})},B=this.isHorizontal(),P=this._computeTitleHeight();B?_={x:He(s,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:_={x:this.left+h,y:He(s,this.top+P+h,this.bottom-e[0].height),line:0},og(this.ctx,t.textDirection);const L=S+h;this.legendItems.forEach((I,N)=>{r.strokeStyle=I.fontColor,r.fillStyle=I.fontColor;const T=r.measureText(I.text).width,M=u.textAlign(I.textAlign||(I.textAlign=a.textAlign)),O=x+m+T;let z=_.x,W=_.y;u.setWidth(this.width),B?N>0&&z+O+h>this.right&&(W=_.y+=L,_.line++,z=_.x=He(s,this.left+h,this.right-i[_.line])):N>0&&W+L>this.bottom&&(z=_.x=z+e[_.line].width+h,_.line++,W=_.y=He(s,this.top+P+h,this.bottom-e[_.line].height));const it=u.x(z);if(C(it,W,I),z=JM(M,z+x+m,B?z+O:this.right,t.rtl),E(u.x(z),W,I),B)_.x+=O+h;else if(typeof I.text!="string"){const ut=d.lineHeight;_.y+=Tm(I,ut)+h}else _.y+=L}),ag(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=$r(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let h,g=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),h=this.top+d,g=He(t.align,g,this.right-m);else{const x=this.columnSizes.reduce((v,S)=>Math.max(v,S.height),0);h=d+He(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=He(l,g,g+m);a.textAlign=s.textAlign(Gc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,ar(a,e.text,_,h,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ni(t,this.left,this.right)&&ni(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ni(t,r.left,r.left+r.width)&&ni(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!HO(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=BO(r,i);r&&!s&&Qt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Qt(e.onHover,[t,i,this],this)}else i&&Qt(e.onClick,[t,i,this],this)}}function FO(n,t,e,i,r){const s=zO(i,n,t,e),a=UO(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function zO(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function UO(n,t,e){let i=n;return typeof t.text!="string"&&(i=Tm(t,e)),i}function Tm(n,t){const e=n.text?n.text.length:0;return t*e}function HO(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var WO={id:"legend",_element:Sm,start(n,t,e){const i=n.legend=new Sm({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i)},stop(n){We.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;We.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),h=we(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:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Mu extends Ve{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=qt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(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:e,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,h,g;return this.isHorizontal()?(h=He(l,i,s),g=e+t,d=s-i):(a.position==="left"?(h=i+t,g=He(l,r,e),u=Et*-.5):(h=s-t,g=He(l,e,r),u=Et*.5),d=r-e),{titleX:h,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);ar(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:Gc(e.align),textBaseline:"middle",translation:[a,l]})}}function VO(n,t){const e=new Mu({ctx:n.ctx,options:t,chart:n});We.configure(n,e,t),We.addBox(n,e),n.titleBlock=e}var $O={id:"title",_element:Mu,start(n,t,e){VO(n,e)},stop(n){const t=n.titleBlock;We.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ha=new WeakMap;var YO={id:"subtitle",start(n,t,e){const i=new Mu({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i),Ha.set(n,i)},stop(n){We.removeBox(n,Ha.get(n)),Ha.delete(n)},beforeUpdate(n,t,e){const i=Ha.get(n);We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const so={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const l=n[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(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Ur(t,d);h<r&&(r=h,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function jn(n,t){return t&&(qt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function oi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
2
2
  `)>-1?n.split(`
3
- `):n}function qO(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Mm(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:l}=t,u=le(t.bodyFont),d=le(t.titleFont),h=le(t.footerFont),g=s.length,m=r.length,_=i.length,x=we(t.padding);let v=x.height,S=0,C=i.reduce((P,L)=>P+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(v+=g*d.lineHeight+(g-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}m&&(v+=t.footerMarginTop+m*h.lineHeight+(m-1)*t.footerSpacing);let R=0;const B=function(P){S=Math.max(S,e.measureText(P).width+R)};return e.save(),e.font=d.string,Jt(n.title,B),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),B),R=t.displayColors?a+2+t.boxPadding:0,Jt(i,P=>{Jt(P.before,B),Jt(P.lines,B),Jt(P.after,B)}),R=0,e.font=h.string,Jt(n.footer,B),e.restore(),S+=x.width,{width:S,height:v}}function jO(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function GO(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function KO(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:l,right:u}}=n;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),GO(d,n,t,e)&&(d="center"),d}function km(n,t,e){const i=e.yAlign||t.yAlign||jO(n,e);return{xAlign:e.xAlign||t.xAlign||KO(n,t,e,i),yAlign:i}}function XO(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function ZO(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Dm(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:h,topRight:g,bottomLeft:m,bottomRight:_}=Ci(a);let x=XO(t,l);const v=ZO(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(h,m)+r:l==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(v,0,i.height-t.height)}}function Wa(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Cm(n){return jn([],oi(n))}function QO(n,t,e){return Oi(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Om(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Am={beforeTitle:ei,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ei,beforeBody:ei,beforeLabel:ei,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return xt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ei,afterBody:ei,beforeFooter:ei,footer:ei,afterFooter:ei};function sn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Am[t].call(e,i):r}class Rm extends Ve{static positioners=so;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new ou(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=QO(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=sn(i,"beforeTitle",this,t),s=sn(i,"title",this,t),a=sn(i,"afterTitle",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}getBeforeBody(t,e){return Cm(sn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Om(i,s);jn(a.before,oi(sn(l,"beforeLabel",this,s))),jn(a.lines,sn(l,"label",this,s)),jn(a.after,oi(sn(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Cm(sn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=sn(i,"beforeFooter",this,t),s=sn(i,"footer",this,t),a=sn(i,"afterFooter",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=e.length;u<d;++u)l.push(qO(this.chart,e[u]));return t.filter&&(l=l.filter((h,g,m)=>t.filter(h,g,m,i))),t.itemSort&&(l=l.sort((h,g)=>t.itemSort(h,g,i))),Jt(l,h=>{const g=Om(t.callbacks,h);r.push(sn(g,"labelColor",this,h)),s.push(sn(g,"labelPointStyle",this,h)),a.push(sn(g,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){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=so[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=Mm(this,i),d=Object.assign({},l,u),h=km(this.chart,i,d),g=Dm(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:g.x,y:g.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:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Ci(l),{x:m,y:_}=t,{width:x,height:v}=e;let S,C,R,B,P,L;return s==="center"?(P=_+v/2,r==="left"?(S=m,C=S-a,B=P+a,L=P-a):(S=m+x,C=S+a,B=P-a,L=P+a),R=S):(r==="left"?C=m+Math.max(u,h)+a:r==="right"?C=m+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(B=_,P=B-a,S=C-a,R=C+a):(B=_+v,P=B+a,S=C+a,R=C-a),L=B),{x1:S,x2:C,x3:R,y1:B,y2:P,y3:L}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=$r(i.rtl,this.x,this.width);for(t.x=Wa(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.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,e,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=le(s.bodyFont),g=Wa(this,"left",s),m=r.x(g),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},S=r.leftForLtr(m,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Jc(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Jc(t,v,S,C)}else{t.lineWidth=Pt(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(m,d),S=r.leftForLtr(r.xPlus(m,1),d-2),C=Ci(a.borderRadius);Object.values(C).some(R=>R!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Hr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Hr(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,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:h}=i,g=le(i.bodyFont);let m=g.lineHeight,_=0;const x=$r(i.rtl,this.x,this.width),v=function(T){e.fillText(T,x.x(t.x+_),t.y+m/2),t.y+=m+s},S=x.textAlign(a);let C,R,B,P,L,I,N;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Wa(this,S,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,v),_=l&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,I=r.length;P<I;++P){for(C=r[P],R=this.labelTextColors[P],e.fillStyle=R,Jt(C.before,v),B=C.lines,l&&B.length&&(this._drawColorBox(e,t,P,x,i),m=Math.max(g.lineHeight,u)),L=0,N=B.length;L<N;++L)v(B[L]),m=g.lineHeight;Jt(C.after,v)}_=0,m=g.lineHeight,Jt(this.afterBody,v),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=$r(i.rtl,this.x,this.width);for(t.x=Wa(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,l=0;l<s;++l)e.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:h}=i,{topLeft:g,topRight:m,bottomLeft:_,bottomRight:x}=Ci(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-m,u),e.quadraticCurveTo(l+d,u,l+d,u+m),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+h-x),e.quadraticCurveTo(l+d,u+h,l+d-x,u+h),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+h),e.quadraticCurveTo(l,u+h,l,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+g),e.quadraticCurveTo(l,u,l+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=so[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Mm(this,t),u=Object.assign({},a,this._size),d=km(e,t,u),h=Dm(t,u,d,e);(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 e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),og(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),ag(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){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=!ya(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),l=this._positionChanged(a,t),u=e||!ya(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.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,e){const{caretX:i,caretY:r,options:s}=this,a=so[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var $e={id:"tooltip",_element:Rm,positioners:so,afterInit(n,t,e){e&&(n.tooltip=new Rm({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Am},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},JO=Object.freeze({__proto__:null,Colors:fO,Decimation:mO,Filler:NO,Legend:WO,SubTitle:YO,Title:$O,Tooltip:$e});const tA=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function eA(n,t,e,i){const r=n.indexOf(t);if(r===-1)return tA(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const nA=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Em(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class iA extends dr{static id="category";static defaults={ticks:{callback:Em}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(xt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:eA(i,t,Mt(e,t),this._addedLabels),nA(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Em.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function rA(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:g,includeBounds:m}=n,_=s||1,x=h-1,{min:v,max:S}=t,C=!xt(a),R=!xt(l),B=!xt(d),P=(S-v)/(g+1);let L=Pp((S-v)/x/_)*_,I,N,T,M;if(L<1e-14&&!C&&!R)return[{value:v},{value:S}];M=Math.ceil(S/L)-Math.floor(v/L),M>x&&(L=Pp(M*L/x/_)*_),xt(u)||(I=Math.pow(10,u),L=Math.ceil(L*I)/I),r==="ticks"?(N=Math.floor(v/L)*L,T=Math.ceil(S/L)*L):(N=v,T=S),C&&R&&s&&qM((l-a)/s,L/1e3)?(M=Math.round(Math.min((l-a)/L,h)),L=(l-a)/M,N=a,T=l):B?(N=C?a:N,T=R?l:T,M=d-1,L=(T-N)/M):(M=(T-N)/L,Ws(M,Math.round(M),L/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max(Lp(L),Lp(N));I=Math.pow(10,xt(u)?O:u),N=Math.round(N*I)/I,T=Math.round(T*I)/I;let z=0;for(C&&(m&&N!==a?(e.push({value:a}),N<a&&z++,Ws(Math.round((N+z*L)*I)/I,a,Pm(a,P,n))&&z++):N<a&&z++);z<M;++z){const W=Math.round((N+z*L)*I)/I;if(R&&W>l)break;e.push({value:W})}return R&&m&&T!==l?e.length&&Ws(e[e.length-1].value,l,Pm(l,P,n))?e[e.length-1].value=l:e.push({value:l}):(!R||T===l)&&e.push({value:T}),e}function Pm(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Va extends dr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return xt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=Yn(r),d=Yn(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:e,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(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=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:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=rA(r,s);return t.bounds==="ticks"&&Ip(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ys(t,this.chart.options.locale,this.options.ticks.format)}}class sA extends Va{static id="linear";static defaults={ticks:{callback:Ma.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/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 oo=n=>Math.floor(ki(n)),fr=(n,t)=>Math.pow(10,oo(n)+t);function Im(n){return n/Math.pow(10,oo(n))===1}function Lm(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function oA(n,t){const e=t-n;let i=oo(e);for(;Lm(n,t,i)>10;)i++;for(;Lm(n,t,i)<10;)i--;return Math.min(i,oo(n))}function aA(n,{min:t,max:e}){t=pn(n.min,t);const i=[],r=oo(t);let s=oA(t,e),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 g=Math.floor((d-h)/Math.pow(10,s)),m=pn(n.min,Math.round((u+h+g*Math.pow(10,s))*a)/a);for(;m<e;)i.push({value:m,major:Im(m),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),m=Math.round((u+h+g*Math.pow(10,s))*a)/a;const _=pn(n.max,m);return i.push({value:_,major:Im(_),significand:g}),i}class lA extends dr{static id="logarithmic";static defaults={ticks:{callback:Ma.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,e){const i=Va.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===fr(this.min,0)?fr(this.min,-1):fr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=e?r:l;i===r&&(i<=0?(s(1),a(10)):(s(fr(i,-1)),a(fr(r,1)))),i<=0&&s(fr(r,-1)),r<=0&&a(fr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=aA(e,this);return t.bounds==="ticks"&&Ip(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":Ys(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ki(t),this._valueRange=ki(this.max)-ki(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ki(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ku(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Mt(t.font&&t.font.size,se.font.size)+e.height}return 0}function cA(n,t,e){return e=qt(e)?e:[e],{w:ck(n,t.string,e),h:e.length*t.lineHeight}}function Nm(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function uA(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?Rt/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const h=n.getPointPosition(u,n.drawingArea+r[u],l),g=le(d.font),m=cA(n.ctx,g,n._pointLabels[u]);i[u]=m;const _=Ue(n.getIndexAngle(u)+l),x=Math.round(wa(_)),v=Nm(x,h.x,m.w,0,180),S=Nm(x,h.y,m.h,90,270);dA(e,t,_,v,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=pA(n,i,r)}function dA(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function fA(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(wa(Ue(u.angle+re))),h=yA(u.y,l.h,d),g=gA(d),m=mA(u.x,l.w,g);return{visible:!0,x:u.x,y:h,textAlign:g,left:m,top:h,right:m+l.w,bottom:h+l.h}}function hA(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ri({x:e,y:i},t)||ri({x:e,y:s},t)||ri({x:r,y:i},t)||ri({x:r,y:s},t))}function pA(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:ku(s)/2,additionalAngle:a?Rt/r:0};let d;for(let h=0;h<r;h++){u.padding=e[h],u.size=t[h];const g=fA(n,h,u);i.push(g),l==="auto"&&(g.visible=hA(g,d),g.visible&&(d=g))}return i}function gA(n){return n===0||n===180?"center":n<180?"left":"right"}function mA(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function yA(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function _A(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!xt(l)){const u=Ci(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=l;const h=i-d.left,g=r-d.top,m=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Hr(n,{x:h,y:g,w:m,h:_,radius:u}),n.fill()):n.fillRect(h,g,m,_)}}function bA(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));_A(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:h}=s;ar(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Bm(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function xA(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||e<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Bm(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function wA(n,t,e){return Oi(n,{label:e,index:t,type:"pointLabel"})}class vA extends Va{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:Ma.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=we(ku(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ku(this.options))}generateTickLabels(t){Va.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Qt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uA(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ue(t*e+xe(i))}getDistanceFromCenterForValue(t){if(xt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(xt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return wA(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Bm(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let l,u,d;if(e.pointLabels.display&&bA(this,a),r.display&&this.ticks.forEach((h,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const m=this.getContext(g),_=r.setContext(m),x=s.setContext(m);xA(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const h=i.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:m}=h;!m||!g||(t.lineWidth=m,t.strokeStyle=g,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(e.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,e=this.options,i=e.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&&!e.reverse)return;const d=i.setContext(this.getContext(u)),h=le(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 g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-h.size/2-g.top,a+g.width,h.size+g.height)}ar(t,l.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const $a={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}},on=Object.keys($a);function Fm(n,t){return n-t}function zm(n,t){if(xt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Di(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Um(n,t,e,i){const r=on.length;for(let s=on.indexOf(n);s<r-1;++s){const a=$a[on[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return on[s]}return on[r-1]}function SA(n,t,e,i,r){for(let s=on.length-1;s>=on.indexOf(e);s--){const a=on[s];if($a[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return on[e?on.indexOf(e):0]}function TA(n){for(let t=on.indexOf(n)+1,e=on.length;t<e;++t)if($a[on[t]].common)return on[t]}function Hm(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=jc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function MA(n,t,e,i){const r=n._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=e[l],u>=0&&(t[u].major=!0);return t}function Wm(n,t,e){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||!e?i:MA(n,i,r,e)}class Du extends dr{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,e={}){const i=t.time||(t.time={}),r=this._adapter=new Ag._date(t.adapters.date);r.init(e),Hs(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:zm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min: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=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.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 e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,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=XM(r,s,a);return this._unit=e.unit||(i.autoSkip?Um(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):SA(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:TA(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Wm(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(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;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Um(s.minUnit,e,i,this._getLabelCapacity(e)),l=Mt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Di(u)||u===!0,h={};let g=e,m,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(m=g,_=0;m<i;m=+t.add(m,l,a),_++)Hm(h,m,x);return(m===i||r.bounds==="ticks"||_===1)&&Hm(h,m,x),Object.keys(h).sort(Fm).map(v=>+v)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Qt(a,[t,e,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&l[u],g=d&&l[d],m=i[e],_=d&&g&&m&&m.major;return this._adapter.format(t,r||(_?g:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.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 e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Wm(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||[],e,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(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(zm(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fp(t.sort(Fm))}}function Ya(n,t,e){let i=0,r=n.length-1,s,a,l,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ii(n,"pos",t)),{pos:s,time:l}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ii(n,"time",t)),{time:s,pos:l}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class kA extends Du{static id="timeseries";static defaults=Du.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ya(e,this.min),this._tableRange=Ya(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,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,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ya(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ya(this._table,i*this._tableRange+this._minPos,!0)}}var DA=Object.freeze({__proto__:null,CategoryScale:iA,LinearScale:sA,LogarithmicScale:lA,RadialLinearScale:vA,TimeScale:Du,TimeSeriesScale:kA});const CA=[CD,sO,JO,DA];function OA(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};$e.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=h.width/2,_=Xa(d,g,m),x=d.y,v=d.x<m?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:v}},pu.modes.customInteractionMode=function(u,d){const h=Ai(d,u),g=[];return pu.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(m,_,x)=>{u.options.indexAxis==="y"&&m.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&m.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?ny:iy,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>Za?d.slice(0,Za)+"...":d):u.getLabelForValue(Number(d)),l=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.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:n.indexAxis==="y"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.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:n.indexAxis==="x"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{Jm(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),l}rn.register(...CA);const AA=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function RA(n,t,e,i,r){const s=p.shallowRef(null),a=(l,u)=>{if(t.value)return new rn(t.value,{type:n,data:l,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{xt(s.value)||s.value.destroy()}),p.watch(e,(l,u)=>{if(AA(u,l)&&!xt(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 xt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),p.watch(t,()=>{xt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.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))&&(xt(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const Vm=1e3,EA=1e4,$m=1e6,Ym=1e9,qm=1e12,ao=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},qr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function lo(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?EA:Vm;return n<r||t.precision&&t.precision>Math.log10(n)?e=ao(qr(n,1,t),t):n<$m?e=`${qr(n,Vm,t)}k`:n<Ym?e=`${qr(n,$m,t)}m`:n<qm?e=`${ao(qr(n,Ym,t),t)}b`:e=`${ao(qr(n,qm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}lo.addCommas=ao;function PA(n,t,e){const{i18n:i}=kt.useI18n(),{formatBytes:r}=er({i18n:i}),{translateUnit:s}=kt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,m)=>g+(typeof m=="number"?Number(m)||0:Number(m&&m.y)||0),0);let h;if(e.value==="bytes")h=r(d);else{const g=s(e.value,d);h=i&&i.t("legend.datapointValueDisplay",{value:lo(d,{capital:!0}),unit:g})||`${lo(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function IA(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Lh(new Date(e))} - ${Lh(new Date(i),{includeTZ:!0})}`:""})}function LA(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};$e.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=l.width/2,h=Xa(a,u,d),g=a.y,m=a.x<d?"left":"center";return{x:h-n.tooltipState.offsetX,y:g,xAlign:m}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{Jm(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),{options:r}}function NA(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return wy({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};$e.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=n.tooltipState.height||this.height,_=h.width/2,x=h.height/2,v=Xa(d,g,_);let S=ty(d,m,x);const C=d.y<x?"top":"bottom",R=d.x<_?"left":"center";return m>h.height&&(S=0),{x:v,y:S,xAlign:R,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return _p(u)>24||h.getDate()!==d.getDate()}),l=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{Cu(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[r]&&delete $e.positioners[r]}),{options:l}}function BA(n){const t=p.computed(()=>{const l=Number(n.timeRangeMs.value),u=new Date,d=new Date(u.getTime()-l);return _p(l)>24||d.getDate()!==u.getDate()}),e=p.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>wy({tickValue:new Date(l),granularity:n.granularity.value,dayBoundaryCrossed:t.value})},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1}})),i=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),s=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;$e.positioners[s]=function(l,u){if(!l.length||n.tooltipState.interactionMode==="interactive"||u.x===null||u.y===null)return!1;const d=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,g=n.tooltipState.height||this.height,m=d.width/2,_=d.height/2,x=Xa(u,h,m);let v=ty(u,g,_);const S=u.y<_?"top":"bottom",C=u.x<m?"left":"center";return g>d.height&&(v=0),{x,y:v,xAlign:C,yAlign:S}};const a=p.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.value,y:i.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:s,external:l=>{Cu(n.tooltipState,l,n.granularity.value)}},outlierBandPlugin:{value:n.outlierValue?.value,color:n.themeColors.value.outlierBand}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[s]&&delete $e.positioners[s]}),{options:a}}function FA(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l}=n,{i18n:u}=kt.useI18n();return t?i.map(h=>({label:u&&u.te(`chartLabels.${h}`)&&u.t(`chartLabels.${h}`)||h,backgroundColor:Au(i.indexOf(h),ai),data:a.map((g,m)=>e?s[`${g.id},${h}`]||0:s[`${m},${h}`]||null)})):Array.from(r).flatMap((h,g)=>{if(!h)return[];const m=Ru(g,h.name,h.id==="empty",l);return{label:u&&u.te(`chartLabels.${h.name}`)&&u.t(`chartLabels.${h.name}`)||h.name,backgroundColor:m,data:a.map(_=>s[`${_.id},${h.id}`]||null),isSegmentEmpty:h.id==="empty"}})}function zA(n,t){const{i18n:e}=kt.useI18n();return p.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 g=d&&l||a,m=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(M=>a.map((O,z)=>{const W=M.event[m],it=d?`${W},${O}`:`${z},${O}`,ut=M.event[O];return[it,ut]})):r.map(M=>{const O=d?`${M.event[m]},${M.event[_]}`:`${m},${_}`,z=M.event[a[0]];return[O,z]})),v=Object.keys(x).reduce((M,O)=>{const[z]=O.split(","),W=x[O];return M[z]?M[z]+=W:M[z]=W,M},{}),S=Object.entries(v).sort(([,M],[,O])=>Number(O)-Number(M)).map(([M])=>M),C=s[m],R=s[_];let B=d&&C&&Object.entries(C).map(([M,O])=>({id:M,name:O.name}))||a.map(M=>({id:M,name:M})),P=d&&R&&Object.entries(R).map(([M,O])=>({id:M,name:O.name}))||a.map(M=>({id:M,name:M}));if(d&&m==="country_code"&&(B=B.map(M=>({...M,name:kc(M.id)||M.name}))),d&&_==="country_code"&&(P=P.map(M=>({...M,name:kc(M.id)||M.name}))),m!=="status_code"&&m!=="status_code_grouped"&&(B.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id)),P.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id))),!B||!P)return{labels:[],datasets:[]};const L=FA({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:B,colorPalette:n.colorPalette||ai}),I=d?B.map(M=>e&&e.te(`chartLabels.${M.name}`)&&e.t(`chartLabels.${M.name}`)||M.name):a.map(M=>e&&e.te(`chartLabels.${M}`)&&e.t(`chartLabels.${M}`)||M),N=B.map(M=>M.id==="empty");return{labels:I,datasets:L,isLabelEmpty:N,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const UA=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),HA=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return bp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},WA=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return UA(l,u,e)};function VA(n,t){const{i18n:e}=kt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:l,end:u}=t.value.meta,d=new Date(l).getTime(),h=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,m=g&&g[0],_=s?.[m],x=!!_&&a.length>1;let v=s&&_&&Object.keys(_).map(I=>({id:I,name:_[I].name}))||a.map(I=>({id:I,name:I}));m==="country_code"&&(v=v.map(I=>({...I,name:kc(I.id)||I.name})));const S=t.value.meta.granularity_ms;if(typeof S!="number"||isNaN(S)||!isFinite(S)||S===0)return console.error("Invalid step value:",S),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const C=HA(d),R=WA(d,h,S,C,r),B=r?.length?r.reduce((I,N)=>{const T=new Date(N.timestamp).valueOf(),M=N.event;for(const O of a)T in I||(I[T]={}),O in I[T]||(I[T][O]={});for(const O of a)v.forEach(z=>{(_?M[m]===z.id:O===z.id)?(I[T][O]||(I[T][O]={}),I[T][O][z.id]=Math.round(Number(M[O])*1e3)/1e3):g.length||(I[T][O]||(I[T][O]={}),I[T][O][z.id]=Math.round(Number(M[z.id])*1e3)/1e3)});return I},{}):{},L=[..._||a.length===1?a.flatMap(I=>v.map(N=>[I,N.id,N.name,N.id==="empty"])):v.map(I=>[I.name,I.id,I.name,I.id==="empty"])].map(([I,N,T,M],O)=>{const z=R.map(nt=>nt in B&&I in B[nt]?{x:nt,y:B[nt][I][N]||0}:{x:nt,y:0});let{colorPalette:W,fill:it}=n;xt(W)&&(W=ai);const ut=Ru(O,T,M,W),ft=ky(T)?e.t(`chartLabels.${T}`):T,j=ky(I)?e.t(`chartLabels.${I}`):I,tt=a.findIndex(nt=>nt===I);return{rawDimension:T,rawMetric:I,label:x?`${ft} — ${j}`:ft,borderColor:ut,backgroundColor:ut,data:z,total:z.reduce((nt,{y:et})=>nt+Number(et),0),...OR,...x?{borderDash:tt===0?[]:[tt*4,2]}:{},fill:it,borderWidth:it?RR:AR,isSegmentEmpty:M}});return m==="status_code"||m==="status_code_grouped"?L.sort((I,N)=>(I.label??"")<(N.label??"")?-1:1):L.sort((I,N)=>Number(I.total)<Number(N.total)?-1:1),{datasets:L}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const $A=2,YA=.6,qA=1.5,jm=50,jA=[6,4],GA=[2,3],KA=n=>n?Math.random()*n:0;function XA(n,t){const{i18n:e}=kt.useI18n(),i=(r,s)=>s||(r===jm?e.t("scatter.median"):e.t("scatter.percentile",{value:r}));return p.computed(()=>{try{const r=t.value;if(!r?.points?.length)return{datasets:[]};const{metric:s,dimension:a,display:l,start:u,end:d}=r,h=n.scatter||{},g=h.jitterMs??0,m=h.pointRadius??$A,_=h.pointOpacity??YA,x=new Map,v=[];r.points.forEach(j=>{const tt=j.group??s,nt=x.get(tt)||[];nt.push({x:j.timestamp+KA(g),y:j.value}),x.set(tt,nt),v.push(j.value)});const S=h.percentileLines||[],C=[...S.map(j=>j.percentile),...h.outlierPercentile!==void 0?[h.outlierPercentile]:[]],R=C.length?xE(v,C):new Map,B=h.outlierPercentile!==void 0?R.get(h.outlierPercentile):void 0,P=B!==void 0&&Number.isFinite(B),L=P?i(h.outlierPercentile):"",I=xt(n.colorPalette)?ai:n.colorPalette,N=n.themeColors?.value??Ja(),T=[],M=[],O=(j,tt)=>{if(!P)return j;const nt=[];for(const et of j){if(et.y<=B){nt.push(et);continue}M.push({...et,tooltipLabel:e.t("scatter.outlierTooltip",{series:tt,label:L})})}return nt};if(Array.from(x.entries()).forEach(([j,tt],nt)=>{const et=a&&l?.[j]?.name||j,at=j==="empty",H=Ru(nt,et,at,I),q=e.te(`chartLabels.${et}`)&&e.t(`chartLabels.${et}`)||et,X=O(tt,q);T.push({type:"scatter",rawDimension:et,rawMetric:s,label:q,borderColor:H,backgroundColor:qu(H,_),data:X,pointRadius:m,pointHoverRadius:m+2,pointBorderWidth:0,showLine:!1,isSegmentEmpty:at})}),P&&M.length){const j=N.outlier;T.push({type:"scatter",rawDimension:"outlier",rawMetric:s,label:e.t("scatter.outlier",{label:L}),borderColor:j,backgroundColor:j,data:M,pointRadius:m,pointHoverRadius:m+2,pointBorderWidth:0,showLine:!1})}const z=Array.from(x.values()).flat().map(j=>j.x),W=new Date(u).valueOf(),it=new Date(d).valueOf(),ut=Number.isFinite(W)?W:Math.min(...z),ft=Number.isFinite(it)?it:Math.max(...z);return S.forEach(j=>{const tt=R.get(j.percentile);if(tt===void 0||!Number.isFinite(tt))return;const nt=j.percentile===jm,et=j.color||(nt?N.medianLine:N.outlier);T.push({type:"line",rawDimension:`percentile-${j.percentile}`,rawMetric:s,label:i(j.percentile,j.label),data:[{x:ut,y:tt},{x:ft,y:tt}],borderColor:et,backgroundColor:et,borderDash:j.borderDash||(nt?jA:GA),borderWidth:qA,pointRadius:0,pointHitRadius:0,fill:!1,total:tt})}),{datasets:T,...P?{outlierValue:B}:{}}}catch(r){return console.warn(r),{datasets:[]}}})}const ZA=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function QA(){const{i18n:n}=kt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return po(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const JA="analytics-query-provider",Gm=2;function tR(){const n=p.inject(JA);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function Km(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const Xm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const eR=n=>n!=null,nR=Object.prototype.toString,iR=n=>nR.call(n)==="[object Object]";function qa(n){return Array.isArray(n)?n:[n]}function rR(n){return p.getCurrentInstance()}function sR(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function oR(n,t=!0,e){rR()?p.onMounted(n,e):t?n():p.nextTick(n)}function aR(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const ja=Xm?window:void 0;function jr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function co(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=qa(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return aR(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>jr(s)))!==null&&i!==void 0?i:[ja].filter(s=>s!=null),qa(p.toValue(e.value?n[1]:n[0])),qa(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=iR(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(m=>s.map(_=>t(g,m,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function lR(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function Zm(n){const t=lR();return p.computed(()=>(t.value,!!n()))}function cR(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Zm(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=qa(p.toValue(n)).map(jr).filter(eR);return new Set(g)}),g=>{l(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),l()};return Km(h),{isSupported:a,stop:h,takeRecords:d}}const Ga={speed:2,margin:30,direction:"both"};function uR(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function dR(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:g,onStart:m,initialValue:_,axis:x="both",draggingElement:v=ja,containerElement:S,handle:C=n,buttons:R=[0],restrictInView:B,autoScroll:P=!1}=t,L=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),I=p.ref(),N=H=>a?a.includes(H.pointerType):!0,T=H=>{p.toValue(l)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},M=p.toValue(P),O=typeof M=="object"?{speed:(i=p.toValue(M.speed))!==null&&i!==void 0?i:Ga.speed,margin:(r=p.toValue(M.margin))!==null&&r!==void 0?r:Ga.margin,direction:(s=M.direction)!==null&&s!==void 0?s:Ga.direction}:Ga,z=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,q,X)=>{const{clientWidth:_t,clientHeight:G,scrollLeft:$,scrollTop:st,scrollWidth:ot,scrollHeight:lt}=H,[pt,dt]=z(O.margin),[It,zt]=z(O.speed);let vt=0,Ct=0;(O.direction==="x"||O.direction==="both")&&(X.x<pt&&$>0?vt=-It:X.x+q.width>_t-pt&&$<ot-_t&&(vt=It)),(O.direction==="y"||O.direction==="both")&&(X.y<dt&&st>0?Ct=-zt:X.y+q.height>G-dt&&st<lt-G&&(Ct=zt)),(vt||Ct)&&H.scrollBy({left:vt,top:Ct,behavior:"auto"})};let it=null;const ut=()=>{const H=p.toValue(S);H&&!it&&(it=setInterval(()=>{const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=L.value,G={x:X-H.scrollLeft,y:_t-H.scrollTop};G.x>=0&&G.y>=0&&(W(H,q,G),G.x+=H.scrollLeft,G.y+=H.scrollTop,L.value=G)},1e3/60))},ft=()=>{it&&(clearInterval(it),it=null)},j=(H,q,X,_t)=>{const[G,$]=typeof X=="number"?[X,X]:[X.x,X.y],{clientWidth:st,clientHeight:ot}=q;return H.x<G||H.x+_t.width>st-G||H.y<$||H.y+_t.height>ot-$},tt=()=>{if(p.toValue(t.disabled)||!I.value)return;const H=p.toValue(S);if(!H)return;const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=L.value,G={x:X-H.scrollLeft,y:_t-H.scrollTop};j(G,H,O.margin,q)?ut():ft()};p.toValue(P)&&p.watch(L,tt);const nt=H=>{var q;if(!p.toValue(R).includes(H.button)||p.toValue(t.disabled)||!N(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const X=p.toValue(S),_t=X==null||(q=X.getBoundingClientRect)===null||q===void 0?void 0:q.call(X),G=p.toValue(n).getBoundingClientRect(),$={x:H.clientX-(X?G.left-_t.left+(P?0:X.scrollLeft):G.left),y:H.clientY-(X?G.top-_t.top+(P?0:X.scrollTop):G.top)};m?.($,H)!==!1&&(I.value=$,T(H))},et=H=>{if(p.toValue(t.disabled)||!N(H)||!I.value)return;const q=p.toValue(S);q instanceof HTMLElement&&uR(q);const X=p.toValue(n).getBoundingClientRect();let{x:_t,y:G}=L.value;if((x==="x"||x==="both")&&(_t=H.clientX-I.value.x,q&&(_t=Math.min(Math.max(0,_t),q.scrollWidth-X.width))),(x==="y"||x==="both")&&(G=H.clientY-I.value.y,q&&(G=Math.min(Math.max(0,G),q.scrollHeight-X.height))),p.toValue(P)&&q&&(it===null&&W(q,X,{x:_t,y:G}),_t+=q.scrollLeft,G+=q.scrollTop),q&&(B||P)){if(x!=="y"){const $=_t-q.scrollLeft;$<0?_t=q.scrollLeft:$>q.clientWidth-X.width&&(_t=q.clientWidth-X.width+q.scrollLeft)}if(x!=="x"){const $=G-q.scrollTop;$<0?G=q.scrollTop:$>q.clientHeight-X.height&&(G=q.clientHeight-X.height+q.scrollTop)}}L.value={x:_t,y:G},h?.(L.value,H),T(H)},at=H=>{p.toValue(t.disabled)||!N(H)||I.value&&(I.value=void 0,P&&ft(),g?.(L.value,H),T(H))};if(Xm){const H=()=>{var q;return{capture:(q=t.capture)!==null&&q!==void 0?q:!0,passive:!p.toValue(l)}};co(C,"pointerdown",nt,H),co(v,"pointermove",et,H),co(v,["pointerup","pointercancel"],at,H)}return{...sR(L),position:L,isDragging:p.computed(()=>!!I.value),style:p.computed(()=>`
3
+ `):n}function qO(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Mm(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:l}=t,u=le(t.bodyFont),d=le(t.titleFont),h=le(t.footerFont),g=s.length,m=r.length,_=i.length,x=we(t.padding);let v=x.height,S=0,C=i.reduce((P,L)=>P+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(v+=g*d.lineHeight+(g-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}m&&(v+=t.footerMarginTop+m*h.lineHeight+(m-1)*t.footerSpacing);let E=0;const B=function(P){S=Math.max(S,e.measureText(P).width+E)};return e.save(),e.font=d.string,Jt(n.title,B),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),B),E=t.displayColors?a+2+t.boxPadding:0,Jt(i,P=>{Jt(P.before,B),Jt(P.lines,B),Jt(P.after,B)}),E=0,e.font=h.string,Jt(n.footer,B),e.restore(),S+=x.width,{width:S,height:v}}function jO(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function GO(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function KO(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:l,right:u}}=n;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),GO(d,n,t,e)&&(d="center"),d}function km(n,t,e){const i=e.yAlign||t.yAlign||jO(n,e);return{xAlign:e.xAlign||t.xAlign||KO(n,t,e,i),yAlign:i}}function XO(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function ZO(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Dm(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:h,topRight:g,bottomLeft:m,bottomRight:_}=Ci(a);let x=XO(t,l);const v=ZO(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(h,m)+r:l==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(v,0,i.height-t.height)}}function Wa(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Cm(n){return jn([],oi(n))}function QO(n,t,e){return Oi(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Om(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Am={beforeTitle:ei,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ei,beforeBody:ei,beforeLabel:ei,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return xt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ei,afterBody:ei,beforeFooter:ei,footer:ei,afterFooter:ei};function sn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Am[t].call(e,i):r}class Em extends Ve{static positioners=so;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new ou(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=QO(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=sn(i,"beforeTitle",this,t),s=sn(i,"title",this,t),a=sn(i,"afterTitle",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}getBeforeBody(t,e){return Cm(sn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Om(i,s);jn(a.before,oi(sn(l,"beforeLabel",this,s))),jn(a.lines,sn(l,"label",this,s)),jn(a.after,oi(sn(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Cm(sn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=sn(i,"beforeFooter",this,t),s=sn(i,"footer",this,t),a=sn(i,"afterFooter",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=e.length;u<d;++u)l.push(qO(this.chart,e[u]));return t.filter&&(l=l.filter((h,g,m)=>t.filter(h,g,m,i))),t.itemSort&&(l=l.sort((h,g)=>t.itemSort(h,g,i))),Jt(l,h=>{const g=Om(t.callbacks,h);r.push(sn(g,"labelColor",this,h)),s.push(sn(g,"labelPointStyle",this,h)),a.push(sn(g,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){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=so[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=Mm(this,i),d=Object.assign({},l,u),h=km(this.chart,i,d),g=Dm(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:g.x,y:g.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:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Ci(l),{x:m,y:_}=t,{width:x,height:v}=e;let S,C,E,B,P,L;return s==="center"?(P=_+v/2,r==="left"?(S=m,C=S-a,B=P+a,L=P-a):(S=m+x,C=S+a,B=P-a,L=P+a),E=S):(r==="left"?C=m+Math.max(u,h)+a:r==="right"?C=m+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(B=_,P=B-a,S=C-a,E=C+a):(B=_+v,P=B+a,S=C+a,E=C-a),L=B),{x1:S,x2:C,x3:E,y1:B,y2:P,y3:L}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=$r(i.rtl,this.x,this.width);for(t.x=Wa(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.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,e,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=le(s.bodyFont),g=Wa(this,"left",s),m=r.x(g),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},S=r.leftForLtr(m,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Jc(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Jc(t,v,S,C)}else{t.lineWidth=Pt(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(m,d),S=r.leftForLtr(r.xPlus(m,1),d-2),C=Ci(a.borderRadius);Object.values(C).some(E=>E!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Hr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Hr(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,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:h}=i,g=le(i.bodyFont);let m=g.lineHeight,_=0;const x=$r(i.rtl,this.x,this.width),v=function(T){e.fillText(T,x.x(t.x+_),t.y+m/2),t.y+=m+s},S=x.textAlign(a);let C,E,B,P,L,I,N;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Wa(this,S,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,v),_=l&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,I=r.length;P<I;++P){for(C=r[P],E=this.labelTextColors[P],e.fillStyle=E,Jt(C.before,v),B=C.lines,l&&B.length&&(this._drawColorBox(e,t,P,x,i),m=Math.max(g.lineHeight,u)),L=0,N=B.length;L<N;++L)v(B[L]),m=g.lineHeight;Jt(C.after,v)}_=0,m=g.lineHeight,Jt(this.afterBody,v),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=$r(i.rtl,this.x,this.width);for(t.x=Wa(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,l=0;l<s;++l)e.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:h}=i,{topLeft:g,topRight:m,bottomLeft:_,bottomRight:x}=Ci(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-m,u),e.quadraticCurveTo(l+d,u,l+d,u+m),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+h-x),e.quadraticCurveTo(l+d,u+h,l+d-x,u+h),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+h),e.quadraticCurveTo(l,u+h,l,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+g),e.quadraticCurveTo(l,u,l+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=so[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Mm(this,t),u=Object.assign({},a,this._size),d=km(e,t,u),h=Dm(t,u,d,e);(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 e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),og(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),ag(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){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=!ya(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),l=this._positionChanged(a,t),u=e||!ya(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.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,e){const{caretX:i,caretY:r,options:s}=this,a=so[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var $e={id:"tooltip",_element:Em,positioners:so,afterInit(n,t,e){e&&(n.tooltip=new Em({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Am},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},JO=Object.freeze({__proto__:null,Colors:fO,Decimation:mO,Filler:NO,Legend:WO,SubTitle:YO,Title:$O,Tooltip:$e});const tA=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function eA(n,t,e,i){const r=n.indexOf(t);if(r===-1)return tA(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const nA=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Rm(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class iA extends dr{static id="category";static defaults={ticks:{callback:Rm}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(xt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:eA(i,t,Mt(e,t),this._addedLabels),nA(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Rm.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function rA(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:g,includeBounds:m}=n,_=s||1,x=h-1,{min:v,max:S}=t,C=!xt(a),E=!xt(l),B=!xt(d),P=(S-v)/(g+1);let L=Pp((S-v)/x/_)*_,I,N,T,M;if(L<1e-14&&!C&&!E)return[{value:v},{value:S}];M=Math.ceil(S/L)-Math.floor(v/L),M>x&&(L=Pp(M*L/x/_)*_),xt(u)||(I=Math.pow(10,u),L=Math.ceil(L*I)/I),r==="ticks"?(N=Math.floor(v/L)*L,T=Math.ceil(S/L)*L):(N=v,T=S),C&&E&&s&&qM((l-a)/s,L/1e3)?(M=Math.round(Math.min((l-a)/L,h)),L=(l-a)/M,N=a,T=l):B?(N=C?a:N,T=E?l:T,M=d-1,L=(T-N)/M):(M=(T-N)/L,Ws(M,Math.round(M),L/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max(Lp(L),Lp(N));I=Math.pow(10,xt(u)?O:u),N=Math.round(N*I)/I,T=Math.round(T*I)/I;let z=0;for(C&&(m&&N!==a?(e.push({value:a}),N<a&&z++,Ws(Math.round((N+z*L)*I)/I,a,Pm(a,P,n))&&z++):N<a&&z++);z<M;++z){const W=Math.round((N+z*L)*I)/I;if(E&&W>l)break;e.push({value:W})}return E&&m&&T!==l?e.length&&Ws(e[e.length-1].value,l,Pm(l,P,n))?e[e.length-1].value=l:e.push({value:l}):(!E||T===l)&&e.push({value:T}),e}function Pm(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Va extends dr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return xt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=Yn(r),d=Yn(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:e,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(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=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:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=rA(r,s);return t.bounds==="ticks"&&Ip(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ys(t,this.chart.options.locale,this.options.ticks.format)}}class sA extends Va{static id="linear";static defaults={ticks:{callback:Ma.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/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 oo=n=>Math.floor(ki(n)),fr=(n,t)=>Math.pow(10,oo(n)+t);function Im(n){return n/Math.pow(10,oo(n))===1}function Lm(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function oA(n,t){const e=t-n;let i=oo(e);for(;Lm(n,t,i)>10;)i++;for(;Lm(n,t,i)<10;)i--;return Math.min(i,oo(n))}function aA(n,{min:t,max:e}){t=pn(n.min,t);const i=[],r=oo(t);let s=oA(t,e),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 g=Math.floor((d-h)/Math.pow(10,s)),m=pn(n.min,Math.round((u+h+g*Math.pow(10,s))*a)/a);for(;m<e;)i.push({value:m,major:Im(m),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),m=Math.round((u+h+g*Math.pow(10,s))*a)/a;const _=pn(n.max,m);return i.push({value:_,major:Im(_),significand:g}),i}class lA extends dr{static id="logarithmic";static defaults={ticks:{callback:Ma.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,e){const i=Va.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===fr(this.min,0)?fr(this.min,-1):fr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=e?r:l;i===r&&(i<=0?(s(1),a(10)):(s(fr(i,-1)),a(fr(r,1)))),i<=0&&s(fr(r,-1)),r<=0&&a(fr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=aA(e,this);return t.bounds==="ticks"&&Ip(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":Ys(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ki(t),this._valueRange=ki(this.max)-ki(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ki(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ku(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Mt(t.font&&t.font.size,se.font.size)+e.height}return 0}function cA(n,t,e){return e=qt(e)?e:[e],{w:ck(n,t.string,e),h:e.length*t.lineHeight}}function Nm(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function uA(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?Et/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const h=n.getPointPosition(u,n.drawingArea+r[u],l),g=le(d.font),m=cA(n.ctx,g,n._pointLabels[u]);i[u]=m;const _=Ue(n.getIndexAngle(u)+l),x=Math.round(wa(_)),v=Nm(x,h.x,m.w,0,180),S=Nm(x,h.y,m.h,90,270);dA(e,t,_,v,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=pA(n,i,r)}function dA(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function fA(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(wa(Ue(u.angle+re))),h=yA(u.y,l.h,d),g=gA(d),m=mA(u.x,l.w,g);return{visible:!0,x:u.x,y:h,textAlign:g,left:m,top:h,right:m+l.w,bottom:h+l.h}}function hA(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ri({x:e,y:i},t)||ri({x:e,y:s},t)||ri({x:r,y:i},t)||ri({x:r,y:s},t))}function pA(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:ku(s)/2,additionalAngle:a?Et/r:0};let d;for(let h=0;h<r;h++){u.padding=e[h],u.size=t[h];const g=fA(n,h,u);i.push(g),l==="auto"&&(g.visible=hA(g,d),g.visible&&(d=g))}return i}function gA(n){return n===0||n===180?"center":n<180?"left":"right"}function mA(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function yA(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function _A(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!xt(l)){const u=Ci(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=l;const h=i-d.left,g=r-d.top,m=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Hr(n,{x:h,y:g,w:m,h:_,radius:u}),n.fill()):n.fillRect(h,g,m,_)}}function bA(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));_A(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:h}=s;ar(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Bm(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function xA(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||e<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Bm(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function wA(n,t,e){return Oi(n,{label:e,index:t,type:"pointLabel"})}class vA extends Va{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:Ma.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=we(ku(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ku(this.options))}generateTickLabels(t){Va.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Qt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uA(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ue(t*e+xe(i))}getDistanceFromCenterForValue(t){if(xt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(xt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return wA(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Bm(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let l,u,d;if(e.pointLabels.display&&bA(this,a),r.display&&this.ticks.forEach((h,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const m=this.getContext(g),_=r.setContext(m),x=s.setContext(m);xA(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const h=i.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:m}=h;!m||!g||(t.lineWidth=m,t.strokeStyle=g,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(e.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,e=this.options,i=e.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&&!e.reverse)return;const d=i.setContext(this.getContext(u)),h=le(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 g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-h.size/2-g.top,a+g.width,h.size+g.height)}ar(t,l.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const $a={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}},on=Object.keys($a);function Fm(n,t){return n-t}function zm(n,t){if(xt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Di(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Um(n,t,e,i){const r=on.length;for(let s=on.indexOf(n);s<r-1;++s){const a=$a[on[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return on[s]}return on[r-1]}function SA(n,t,e,i,r){for(let s=on.length-1;s>=on.indexOf(e);s--){const a=on[s];if($a[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return on[e?on.indexOf(e):0]}function TA(n){for(let t=on.indexOf(n)+1,e=on.length;t<e;++t)if($a[on[t]].common)return on[t]}function Hm(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=jc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function MA(n,t,e,i){const r=n._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=e[l],u>=0&&(t[u].major=!0);return t}function Wm(n,t,e){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||!e?i:MA(n,i,r,e)}class Du extends dr{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,e={}){const i=t.time||(t.time={}),r=this._adapter=new Ag._date(t.adapters.date);r.init(e),Hs(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:zm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min: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=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.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 e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,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=XM(r,s,a);return this._unit=e.unit||(i.autoSkip?Um(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):SA(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:TA(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Wm(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(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;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Um(s.minUnit,e,i,this._getLabelCapacity(e)),l=Mt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Di(u)||u===!0,h={};let g=e,m,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(m=g,_=0;m<i;m=+t.add(m,l,a),_++)Hm(h,m,x);return(m===i||r.bounds==="ticks"||_===1)&&Hm(h,m,x),Object.keys(h).sort(Fm).map(v=>+v)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Qt(a,[t,e,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&l[u],g=d&&l[d],m=i[e],_=d&&g&&m&&m.major;return this._adapter.format(t,r||(_?g:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.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 e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Wm(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||[],e,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(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(zm(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fp(t.sort(Fm))}}function Ya(n,t,e){let i=0,r=n.length-1,s,a,l,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ii(n,"pos",t)),{pos:s,time:l}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ii(n,"time",t)),{time:s,pos:l}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class kA extends Du{static id="timeseries";static defaults=Du.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ya(e,this.min),this._tableRange=Ya(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,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,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ya(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ya(this._table,i*this._tableRange+this._minPos,!0)}}var DA=Object.freeze({__proto__:null,CategoryScale:iA,LinearScale:sA,LogarithmicScale:lA,RadialLinearScale:vA,TimeScale:Du,TimeSeriesScale:kA});const CA=[CD,sO,JO,DA];function OA(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};$e.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=h.width/2,_=Xa(d,g,m),x=d.y,v=d.x<m?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:v}},pu.modes.customInteractionMode=function(u,d){const h=Ai(d,u),g=[];return pu.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(m,_,x)=>{u.options.indexAxis==="y"&&m.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&m.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?ny:iy,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>Za?d.slice(0,Za)+"...":d):u.getLabelForValue(Number(d)),l=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.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:n.indexAxis==="y"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.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:n.indexAxis==="x"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{Jm(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),l}rn.register(...CA);const AA=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function EA(n,t,e,i,r){const s=p.shallowRef(null),a=(l,u)=>{if(t.value)return new rn(t.value,{type:n,data:l,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{xt(s.value)||s.value.destroy()}),p.watch(e,(l,u)=>{if(AA(u,l)&&!xt(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 xt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),p.watch(t,()=>{xt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.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))&&(xt(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const Vm=1e3,RA=1e4,$m=1e6,Ym=1e9,qm=1e12,ao=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},qr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function lo(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?RA:Vm;return n<r||t.precision&&t.precision>Math.log10(n)?e=ao(qr(n,1,t),t):n<$m?e=`${qr(n,Vm,t)}k`:n<Ym?e=`${qr(n,$m,t)}m`:n<qm?e=`${ao(qr(n,Ym,t),t)}b`:e=`${ao(qr(n,qm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}lo.addCommas=ao;function PA(n,t,e){const{i18n:i}=kt.useI18n(),{formatBytes:r}=er({i18n:i}),{translateUnit:s}=kt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,m)=>g+(typeof m=="number"?Number(m)||0:Number(m&&m.y)||0),0);let h;if(e.value==="bytes")h=r(d);else{const g=s(e.value,d);h=i&&i.t("legend.datapointValueDisplay",{value:lo(d,{capital:!0}),unit:g})||`${lo(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function IA(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Lh(new Date(e))} - ${Lh(new Date(i),{includeTZ:!0})}`:""})}function LA(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};$e.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=l.width/2,h=Xa(a,u,d),g=a.y,m=a.x<d?"left":"center";return{x:h-n.tooltipState.offsetX,y:g,xAlign:m}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{Jm(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),{options:r}}function NA(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return wy({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};$e.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=n.tooltipState.height||this.height,_=h.width/2,x=h.height/2,v=Xa(d,g,_);let S=ty(d,m,x);const C=d.y<x?"top":"bottom",E=d.x<_?"left":"center";return m>h.height&&(S=0),{x:v,y:S,xAlign:E,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return _p(u)>24||h.getDate()!==d.getDate()}),l=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{Cu(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[r]&&delete $e.positioners[r]}),{options:l}}function BA(n){const t=p.computed(()=>{const l=Number(n.timeRangeMs.value),u=new Date,d=new Date(u.getTime()-l);return _p(l)>24||d.getDate()!==u.getDate()}),e=p.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>wy({tickValue:new Date(l),granularity:n.granularity.value,dayBoundaryCrossed:t.value})},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1}})),i=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),s=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;$e.positioners[s]=function(l,u){if(!l.length||n.tooltipState.interactionMode==="interactive"||u.x===null||u.y===null)return!1;const d=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,g=n.tooltipState.height||this.height,m=d.width/2,_=d.height/2,x=Xa(u,h,m);let v=ty(u,g,_);const S=u.y<_?"top":"bottom",C=u.x<m?"left":"center";return g>d.height&&(v=0),{x,y:v,xAlign:C,yAlign:S}};const a=p.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.value,y:i.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:s,external:l=>{Cu(n.tooltipState,l,n.granularity.value)}},outlierBandPlugin:{value:n.outlierValue?.value,color:n.themeColors.value.outlierBand}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[s]&&delete $e.positioners[s]}),{options:a}}function FA(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l}=n,{i18n:u}=kt.useI18n();return t?i.map(h=>({label:u&&u.te(`chartLabels.${h}`)&&u.t(`chartLabels.${h}`)||h,backgroundColor:Au(i.indexOf(h),ai),data:a.map((g,m)=>e?s[`${g.id},${h}`]||0:s[`${m},${h}`]||null)})):Array.from(r).flatMap((h,g)=>{if(!h)return[];const m=Eu(g,h.name,h.id==="empty",l);return{label:u&&u.te(`chartLabels.${h.name}`)&&u.t(`chartLabels.${h.name}`)||h.name,backgroundColor:m,data:a.map(_=>s[`${_.id},${h.id}`]||null),isSegmentEmpty:h.id==="empty"}})}function zA(n,t){const{i18n:e}=kt.useI18n();return p.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 g=d&&l||a,m=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(M=>a.map((O,z)=>{const W=M.event[m],it=d?`${W},${O}`:`${z},${O}`,ut=M.event[O];return[it,ut]})):r.map(M=>{const O=d?`${M.event[m]},${M.event[_]}`:`${m},${_}`,z=M.event[a[0]];return[O,z]})),v=Object.keys(x).reduce((M,O)=>{const[z]=O.split(","),W=x[O];return M[z]?M[z]+=W:M[z]=W,M},{}),S=Object.entries(v).sort(([,M],[,O])=>Number(O)-Number(M)).map(([M])=>M),C=s[m],E=s[_];let B=d&&C&&Object.entries(C).map(([M,O])=>({id:M,name:O.name}))||a.map(M=>({id:M,name:M})),P=d&&E&&Object.entries(E).map(([M,O])=>({id:M,name:O.name}))||a.map(M=>({id:M,name:M}));if(d&&m==="country_code"&&(B=B.map(M=>({...M,name:kc(M.id)||M.name}))),d&&_==="country_code"&&(P=P.map(M=>({...M,name:kc(M.id)||M.name}))),m!=="status_code"&&m!=="status_code_grouped"&&(B.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id)),P.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id))),!B||!P)return{labels:[],datasets:[]};const L=FA({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:B,colorPalette:n.colorPalette||ai}),I=d?B.map(M=>e&&e.te(`chartLabels.${M.name}`)&&e.t(`chartLabels.${M.name}`)||M.name):a.map(M=>e&&e.te(`chartLabels.${M}`)&&e.t(`chartLabels.${M}`)||M),N=B.map(M=>M.id==="empty");return{labels:I,datasets:L,isLabelEmpty:N,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const UA=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),HA=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return bp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},WA=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return UA(l,u,e)};function VA(n,t){const{i18n:e}=kt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:l,end:u}=t.value.meta,d=new Date(l).getTime(),h=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,m=g&&g[0],_=s?.[m],x=!!_&&a.length>1;let v=s&&_&&Object.keys(_).map(I=>({id:I,name:_[I].name}))||a.map(I=>({id:I,name:I}));m==="country_code"&&(v=v.map(I=>({...I,name:kc(I.id)||I.name})));const S=t.value.meta.granularity_ms;if(typeof S!="number"||isNaN(S)||!isFinite(S)||S===0)return console.error("Invalid step value:",S),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const C=HA(d),E=WA(d,h,S,C,r),B=r?.length?r.reduce((I,N)=>{const T=new Date(N.timestamp).valueOf(),M=N.event;for(const O of a)T in I||(I[T]={}),O in I[T]||(I[T][O]={});for(const O of a)v.forEach(z=>{(_?M[m]===z.id:O===z.id)?(I[T][O]||(I[T][O]={}),I[T][O][z.id]=Math.round(Number(M[O])*1e3)/1e3):g.length||(I[T][O]||(I[T][O]={}),I[T][O][z.id]=Math.round(Number(M[z.id])*1e3)/1e3)});return I},{}):{},L=[..._||a.length===1?a.flatMap(I=>v.map(N=>[I,N.id,N.name,N.id==="empty"])):v.map(I=>[I.name,I.id,I.name,I.id==="empty"])].map(([I,N,T,M],O)=>{const z=E.map(nt=>nt in B&&I in B[nt]?{x:nt,y:B[nt][I][N]||0}:{x:nt,y:0});let{colorPalette:W,fill:it}=n;xt(W)&&(W=ai);const ut=Eu(O,T,M,W),ft=ky(T)?e.t(`chartLabels.${T}`):T,j=ky(I)?e.t(`chartLabels.${I}`):I,tt=a.findIndex(nt=>nt===I);return{rawDimension:T,rawMetric:I,label:x?`${ft} — ${j}`:ft,borderColor:ut,backgroundColor:ut,data:z,total:z.reduce((nt,{y:et})=>nt+Number(et),0),...OE,...x?{borderDash:tt===0?[]:[tt*4,2]}:{},fill:it,borderWidth:it?EE:AE,isSegmentEmpty:M}});return m==="status_code"||m==="status_code_grouped"?L.sort((I,N)=>(I.label??"")<(N.label??"")?-1:1):L.sort((I,N)=>Number(I.total)<Number(N.total)?-1:1),{datasets:L}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const $A=2,YA=.6,qA=1.5,jm=50,jA=[6,4],GA=[2,3],KA=n=>n?Math.random()*n:0;function XA(n,t){const{i18n:e}=kt.useI18n(),i=(r,s)=>s||(r===jm?e.t("scatter.median"):e.t("scatter.percentile",{value:r}));return p.computed(()=>{try{const r=t.value;if(!r?.points?.length)return{datasets:[]};const{metric:s,dimension:a,display:l,start:u,end:d}=r,h=n.scatter||{},g=h.jitterMs??0,m=h.pointRadius??$A,_=h.pointOpacity??YA,x=new Map,v=[];r.points.forEach(j=>{const tt=j.group??s,nt=x.get(tt)||[];nt.push({x:j.timestamp+KA(g),y:j.value}),x.set(tt,nt),v.push(j.value)});const S=h.percentileLines||[],C=[...S.map(j=>j.percentile),...h.outlierPercentile!==void 0?[h.outlierPercentile]:[]],E=C.length?xR(v,C):new Map,B=h.outlierPercentile!==void 0?E.get(h.outlierPercentile):void 0,P=B!==void 0&&Number.isFinite(B),L=P?i(h.outlierPercentile):"",I=xt(n.colorPalette)?ai:n.colorPalette,N=n.themeColors?.value??Ja(),T=[],M=[],O=(j,tt)=>{if(!P)return j;const nt=[];for(const et of j){if(et.y<=B){nt.push(et);continue}M.push({...et,tooltipLabel:e.t("scatter.outlierTooltip",{series:tt,label:L})})}return nt};if(Array.from(x.entries()).forEach(([j,tt],nt)=>{const et=a&&l?.[j]?.name||j,at=j==="empty",H=Eu(nt,et,at,I),q=e.te(`chartLabels.${et}`)&&e.t(`chartLabels.${et}`)||et,X=O(tt,q);T.push({type:"scatter",rawDimension:et,rawMetric:s,label:q,borderColor:H,backgroundColor:qu(H,_),data:X,pointRadius:m,pointHoverRadius:m+2,pointBorderWidth:0,showLine:!1,isSegmentEmpty:at})}),P&&M.length){const j=N.outlier;T.push({type:"scatter",rawDimension:"outlier",rawMetric:s,label:e.t("scatter.outlier",{label:L}),borderColor:j,backgroundColor:j,data:M,pointRadius:m,pointHoverRadius:m+2,pointBorderWidth:0,showLine:!1})}const z=Array.from(x.values()).flat().map(j=>j.x),W=new Date(u).valueOf(),it=new Date(d).valueOf(),ut=Number.isFinite(W)?W:Math.min(...z),ft=Number.isFinite(it)?it:Math.max(...z);return S.forEach(j=>{const tt=E.get(j.percentile);if(tt===void 0||!Number.isFinite(tt))return;const nt=j.percentile===jm,et=j.color||(nt?N.medianLine:N.outlier);T.push({type:"line",rawDimension:`percentile-${j.percentile}`,rawMetric:s,label:i(j.percentile,j.label),data:[{x:ut,y:tt},{x:ft,y:tt}],borderColor:et,backgroundColor:et,borderDash:j.borderDash||(nt?jA:GA),borderWidth:qA,pointRadius:0,pointHitRadius:0,fill:!1,total:tt})}),{datasets:T,...P?{outlierValue:B}:{}}}catch(r){return console.warn(r),{datasets:[]}}})}const ZA=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function QA(){const{i18n:n}=kt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return po(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const JA="analytics-query-provider",Gm=2;function tE(){const n=p.inject(JA);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function Km(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const Xm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const eE=n=>n!=null,nE=Object.prototype.toString,iE=n=>nE.call(n)==="[object Object]";function qa(n){return Array.isArray(n)?n:[n]}function rE(n){return p.getCurrentInstance()}function sE(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function oE(n,t=!0,e){rE()?p.onMounted(n,e):t?n():p.nextTick(n)}function aE(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const ja=Xm?window:void 0;function jr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function co(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=qa(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return aE(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>jr(s)))!==null&&i!==void 0?i:[ja].filter(s=>s!=null),qa(p.toValue(e.value?n[1]:n[0])),qa(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=iE(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(m=>s.map(_=>t(g,m,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function lE(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function Zm(n){const t=lE();return p.computed(()=>(t.value,!!n()))}function cE(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Zm(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=qa(p.toValue(n)).map(jr).filter(eE);return new Set(g)}),g=>{l(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),l()};return Km(h),{isSupported:a,stop:h,takeRecords:d}}const Ga={speed:2,margin:30,direction:"both"};function uE(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function dE(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:g,onStart:m,initialValue:_,axis:x="both",draggingElement:v=ja,containerElement:S,handle:C=n,buttons:E=[0],restrictInView:B,autoScroll:P=!1}=t,L=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),I=p.ref(),N=H=>a?a.includes(H.pointerType):!0,T=H=>{p.toValue(l)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},M=p.toValue(P),O=typeof M=="object"?{speed:(i=p.toValue(M.speed))!==null&&i!==void 0?i:Ga.speed,margin:(r=p.toValue(M.margin))!==null&&r!==void 0?r:Ga.margin,direction:(s=M.direction)!==null&&s!==void 0?s:Ga.direction}:Ga,z=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,q,X)=>{const{clientWidth:_t,clientHeight:G,scrollLeft:$,scrollTop:st,scrollWidth:ot,scrollHeight:lt}=H,[pt,dt]=z(O.margin),[It,zt]=z(O.speed);let vt=0,Ct=0;(O.direction==="x"||O.direction==="both")&&(X.x<pt&&$>0?vt=-It:X.x+q.width>_t-pt&&$<ot-_t&&(vt=It)),(O.direction==="y"||O.direction==="both")&&(X.y<dt&&st>0?Ct=-zt:X.y+q.height>G-dt&&st<lt-G&&(Ct=zt)),(vt||Ct)&&H.scrollBy({left:vt,top:Ct,behavior:"auto"})};let it=null;const ut=()=>{const H=p.toValue(S);H&&!it&&(it=setInterval(()=>{const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=L.value,G={x:X-H.scrollLeft,y:_t-H.scrollTop};G.x>=0&&G.y>=0&&(W(H,q,G),G.x+=H.scrollLeft,G.y+=H.scrollTop,L.value=G)},1e3/60))},ft=()=>{it&&(clearInterval(it),it=null)},j=(H,q,X,_t)=>{const[G,$]=typeof X=="number"?[X,X]:[X.x,X.y],{clientWidth:st,clientHeight:ot}=q;return H.x<G||H.x+_t.width>st-G||H.y<$||H.y+_t.height>ot-$},tt=()=>{if(p.toValue(t.disabled)||!I.value)return;const H=p.toValue(S);if(!H)return;const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=L.value,G={x:X-H.scrollLeft,y:_t-H.scrollTop};j(G,H,O.margin,q)?ut():ft()};p.toValue(P)&&p.watch(L,tt);const nt=H=>{var q;if(!p.toValue(E).includes(H.button)||p.toValue(t.disabled)||!N(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const X=p.toValue(S),_t=X==null||(q=X.getBoundingClientRect)===null||q===void 0?void 0:q.call(X),G=p.toValue(n).getBoundingClientRect(),$={x:H.clientX-(X?G.left-_t.left+(P?0:X.scrollLeft):G.left),y:H.clientY-(X?G.top-_t.top+(P?0:X.scrollTop):G.top)};m?.($,H)!==!1&&(I.value=$,T(H))},et=H=>{if(p.toValue(t.disabled)||!N(H)||!I.value)return;const q=p.toValue(S);q instanceof HTMLElement&&uE(q);const X=p.toValue(n).getBoundingClientRect();let{x:_t,y:G}=L.value;if((x==="x"||x==="both")&&(_t=H.clientX-I.value.x,q&&(_t=Math.min(Math.max(0,_t),q.scrollWidth-X.width))),(x==="y"||x==="both")&&(G=H.clientY-I.value.y,q&&(G=Math.min(Math.max(0,G),q.scrollHeight-X.height))),p.toValue(P)&&q&&(it===null&&W(q,X,{x:_t,y:G}),_t+=q.scrollLeft,G+=q.scrollTop),q&&(B||P)){if(x!=="y"){const $=_t-q.scrollLeft;$<0?_t=q.scrollLeft:$>q.clientWidth-X.width&&(_t=q.clientWidth-X.width+q.scrollLeft)}if(x!=="x"){const $=G-q.scrollTop;$<0?G=q.scrollTop:$>q.clientHeight-X.height&&(G=q.clientHeight-X.height+q.scrollTop)}}L.value={x:_t,y:G},h?.(L.value,H),T(H)},at=H=>{p.toValue(t.disabled)||!N(H)||I.value&&(I.value=void 0,P&&ft(),g?.(L.value,H),T(H))};if(Xm){const H=()=>{var q;return{capture:(q=t.capture)!==null&&q!==void 0?q:!0,passive:!p.toValue(l)}};co(C,"pointerdown",nt,H),co(v,"pointermove",et,H),co(v,["pointerup","pointercancel"],at,H)}return{...sE(L),position:L,isDragging:p.computed(()=>!!I.value),style:p.computed(()=>`
4
4
  left: ${L.value.x}px;
5
5
  top: ${L.value.y}px;
6
6
  ${P?"text-wrap: nowrap;":""}
7
- `)}}function fR(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Zm(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const h=p.toValue(n);return Array.isArray(h)?h.map(g=>jr(g)):[jr(h)]}),h=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const g of h)g&&s.observe(g,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return Km(d),{isSupported:a,stop:d}}function hR(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=p.shallowRef(0),u=p.shallowRef(0),d=p.shallowRef(0),h=p.shallowRef(0),g=p.shallowRef(0),m=p.shallowRef(0),_=p.shallowRef(0),x=p.shallowRef(0);function v(){const C=jr(n);if(!C){e&&(l.value=0,u.value=0,d.value=0,h.value=0,g.value=0,m.value=0,_.value=0,x.value=0);return}const R=C.getBoundingClientRect();l.value=R.height,u.value=R.bottom,d.value=R.left,h.value=R.right,g.value=R.top,m.value=R.width,_.value=R.x,x.value=R.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return fR(n,S),p.watch(()=>jr(n),C=>!C&&S()),cR(n,S,{attributeFilter:["style","class"]}),r&&co("scroll",S,{capture:!0,passive:!0}),i&&co("resize",S,{passive:!0}),oR(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:g,width:m,x:_,y:x,update:S}}function pR(n,t){const{top:e,left:i}=hR(n),r=p.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=p.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const gR=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=e).sort((u,d)=>u-d),s=[];if(e-t<n-2)return[];const a=(e-t)/n;let l=0;for(let u=0;u<n;u++){const d=t+u*a,h=t+(u+1)*a;let g=0;for(;l<r.length&&r[l]>=d&&r[l]<=h;)g++,l++;s.push([Math.ceil(d),g])}return s},Qm=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),uo=p.ref({}),mR=n=>(uo.value[n]||(uo.value[n]=Qm()),uo.value[n]),yR=(n,t)=>{const e=uo.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete uo.value[t])};function _R({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const h=e!==void 0&&n!==void 0?mR(e):Qm(),g=n!==void 0?n:"static-chart-key",m=p.computed(()=>t.reduce((O,{timestamps:z})=>[...O,...z],[])),_=p.computed(()=>i||m.value.reduce((O,z)=>O===0?z:Math.min(O,z),0)),x=p.computed(()=>r||m.value.reduce((O,z)=>Math.max(O,z),0));p.watchEffect(()=>{h.minStamps[g]=_.value,h.maxStamps[g]=x.value,l!==void 0&&(h.renderPoints[g]=l)});const v=p.computed(()=>Object.values(h.minStamps).reduce((O,z)=>O===0?z:Math.min(O,z),0)),S=p.computed(()=>Object.values(h.maxStamps).reduce((O,z)=>Math.max(O,z),0)),C=p.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((z,W)=>Math.max(z,W),2)}),R=p.computed(()=>{const O=S.value-v.value;return Math.ceil(O/C.value)}),B=p.computed(()=>t.length>1),P=p.computed(()=>t.map(({timestamps:O,color:z,label:W})=>({data:gR({bucketCount:C.value,minStamp:v.value,maxStamp:S.value,timestamps:O}).map(([ft,j])=>({x:ft,y:j})),label:W,...(u==="sparkline_bar"||B.value)&&z&&{backgroundColor:z},...u!=="sparkline_bar"&&z&&{borderColor:z},...B.value&&u!=="sparkline_bar"&&{fill:!0}}))),L=p.computed(()=>{const O=P.value[0]?.data?.length??0,z=[];for(let W=0;W<O;W++){let it=0;for(let ut=0;ut<P.value.length;ut++)it+=P.value[ut].data[W].y;z.push(it)}return z}),I=p.computed(()=>{const O=L.value.reduce((z,W)=>Math.max(z,W),0);return Math.max(O,a??0)}),N=p.computed(()=>{const O=P.value.reduce((it,{data:ut})=>[...it,...ut.map(({y:ft})=>ft)],[]),z=O.length?O[0]:0,W=O.reduce((it,ut)=>Math.min(it,ut),z);return s===void 0?W:Math.min(W,s)});p.watchEffect(()=>{h.maxCounts[g]=I.value,h.minCounts[g]=N.value});const T=p.computed(()=>{const O=Object.values(h.minCounts),z=O.length?O[0]:0;return O.reduce((W,it)=>Math.min(W,it),z)}),M=p.computed(()=>Object.values(h.maxCounts).reduce((O,z)=>Math.max(O,z),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&yR(n,e)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:R,syncedMinCount:T,syncedMaxCount:M}}const kt={useBarChartOptions:OA,useChartJSCommon:RA,useChartLegendValues:PA,useChartSelectedRange:IA,useExploreResultToDatasets:zA,useExploreResultToTimeDataset:VA,useScatterDatasets:XA,useDonutChartOptions:LA,useLineChartOptions:NA,useScatterChartOptions:BA,useI18n:hM,useReportChartDataForSynthetics:ZA,useTranslatedUnits:QA,useEvaluateFeatureFlag:tR,useTooltipAbsolutePosition:pR,useSparklineSync:_R},Ka=n=>["interactive","zoom-interactive"].includes(n),Cu=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=kt.useI18n(),{formatUnit:a}=er({i18n:s}),l=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Ka(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(h,e):ho({tickValue:new Date(h),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,m)=>{const _=g.parsed[d],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l),n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},Jm=(n,t)=>{const{tooltip:e}=t,{i18n:i}=kt.useI18n(),{formatUnit:r}=er({i18n:i});if(e.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(e.body&&!Ka(n.interactionMode)){const a=e.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,h)=>{const g=u?d.parsed:d.parsed[l],m=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:m,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},bR=n=>n&&n.datasets&&n.datasets.length,xR=n=>bR(n)&&n.datasets.some(t=>t.data.length),wR=n=>n.datasets.some(t=>t.data[0]&&Rc(t.data[0].x)),vR=n=>!!xR(n)&&n.datasets.some(t=>t.data.length==1),SR=n=>wR(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Xa=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=n.x??0;return l<e?l+t*s*(1-r):l-t*a*(1-r)},ty=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function ey(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Ou=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},TR=2,ny=10,iy=12,Za=10,ai=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Au=(n,t)=>(t||ai)[n%ai.length],MR="#6f7787",kR={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"}},DR=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return kR[t]?.background||"#fafafa"},CR=cv,Ru=(n,t,e,i)=>{let r;return e?r=CR:Array.isArray(i)?r=Au(n,i):r=i[t],r||Au(n)},Eu=n=>{switch(n){case"error":return uv;case"warning":return pv;case"neutral":return $h;default:return $h}},OR={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},AR=2,RR=0,Pu=new Map,ry=(n,t)=>{const{i18n:e}=kt.useI18n(),{formatBytes:i}=er({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):la.format(n)},ER=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},PR=()=>{const n="label_height";if(!Pu.has(n)){const t=le({});Pu.set(n,t.lineHeight)}return Pu.get(n)},IR=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),LR=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,NR=lv,BR={100:yv,101:_v,102:bv,103:xv,200:wv,201:vv,202:Sv,203:Tv,204:Mv,205:kv,206:Dv,207:Cv,208:Ov,226:Av,300:Rv,301:Ev,302:Pv,303:Iv,304:Lv,305:Nv,307:Bv,308:Fv,400:zv,401:Uv,402:Hv,403:Wv,404:Vv,405:$v,406:Yv,407:qv,408:jv,409:Gv,410:Kv,411:Xv,412:Zv,413:Qv,414:Jv,415:t1,416:e1,417:n1,418:i1,421:r1,422:s1,423:o1,424:a1,425:l1,426:c1,428:u1,429:d1,431:f1,451:h1,500:p1,501:g1,502:m1,503:y1,504:_1,505:b1,506:x1,507:w1,508:v1,510:S1,511:T1},FR={100:M1,200:k1,300:D1,400:C1,500:O1},zR={"1XX":A1,"2XX":R1,"3XX":E1,"4XX":P1,"5XX":I1},sy=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return BR[t]??FR[e]??NR},Iu={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=sy(`${t}`),n),{}),____OTHER____:av,...zR};function oy(n,t,e){const i=hp(),r=WR(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?UR(r,t):HR(r,t)}function UR(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function HR(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function WR(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function VR(n,t){const e=GR(t);return"formatToParts"in e?YR(e,n):qR(e,n)}const $R={year:0,month:1,day:2,hour:3,minute:4,second:5};function YR(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=$R[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function qR(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Lu={},ay=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")),jR=ay==="06/25/2014, 00:00:00"||ay==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function GR(n){return Lu[n]||(Lu[n]=jR?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Lu[n]}function ly(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const cy=36e5,KR=6e4,Nu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Bu(n,t,e){if(!n)return 0;let i=Nu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Nu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),uy(r)?-(r*cy):NaN;if(i=Nu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return uy(r,a)?(s=Math.abs(r)*cy+a*KR,i[1]==="+"?-s:s):NaN}if(QR(n)){t=new Date(t||Date.now());const a=e?t:XR(t),l=Fu(a,n);return-(e?l:ZR(t,l,n))}return NaN}function XR(n){return ly(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Fu(n,t){const e=VR(n,t),i=ly(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function ZR(n,t,e){let r=n.getTime()-t;const s=Fu(new Date(r),e);if(t===s)return t;r-=s-t;const a=Fu(new Date(r),e);return s===a?s:Math.max(s,a)}function uy(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const dy={};function QR(n){if(dy[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),dy[n]=!0,!0}catch{return!1}}const JR=60*1e3,tE={X:function(n,t,e){const i=zu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return fy(i);case"XXXX":case"XX":return Gr(i);default:return Gr(i,":")}},x:function(n,t,e){const i=zu(e.timeZone,n);switch(t){case"x":return fy(i);case"xxxx":case"xx":return Gr(i);default:return Gr(i,":")}},O:function(n,t,e){const i=zu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+eE(i,":");default:return"GMT"+Gr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return oy("short",n,e);default:return oy("long",n,e)}}};function zu(n,t){const e=n?Bu(n,t,!0)/JR:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Qa(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Gr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Qa(Math.floor(i/60),2),s=Qa(Math.floor(i%60),2);return e+r+t+s}function fy(n,t){return n%60===0?(n>0?"-":"+")+Qa(Math.abs(n)/60,2):Gr(n,t)}function eE(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Qa(s,2)}function hy(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const nE=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Uu=36e5,py=6e4,iE=2,Xe={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:nE};function gy(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?iE:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=rE(n),{year:r,restDateString:s}=sE(i.date,e),a=oE(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=aE(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Bu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=hy(new Date(l+u)),d=hy(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function rE(n){const t={};let e=Xe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Xe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function sE(n,t){if(n){const e=Xe.YYY[t],i=Xe.YYYYY[t];let r=Xe.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Xe.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function oE(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Xe.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,_y(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Xe.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return uE(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Xe.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return _y(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Xe.Www.exec(n),s)return r=parseInt(s[1],10)-1,by(r)?my(t,r):new Date(NaN);if(s=Xe.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return by(r,a)?my(t,r,a):new Date(NaN)}return null}function aE(n){let t,e,i=Xe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Hu(t)?t%24*Uu:NaN;if(i=Xe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Hu(t,e)?t%24*Uu+e*py:NaN;if(i=Xe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Hu(t,e,r)?t%24*Uu+e*py+r*1e3:NaN}return null}function my(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const lE=[31,28,31,30,31,30,31,31,30,31,30,31],cE=[31,29,31,30,31,30,31,31,30,31,30,31];function yy(n){return n%400===0||n%4===0&&n%100!==0}function _y(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=yy(n);if(i&&e>cE[t]||!i&&e>lE[t])return!1}return!0}function uE(n,t){if(t<1)return!1;const e=yy(n);return!(e&&t>366||!e&&t>365)}function by(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Hu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const dE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Wu(n,t,e={}){t=String(t);const i=t.match(dE);if(i){const r=gy(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+tE[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return da(n,t,e)}function fE(n,t,e){n=gy(n,e);const i=Bu(t,n,!0),r=new Date(n.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 fo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Wu(fE(n,t,{timeZone:i.timeZone}),e,i)}const hE=(n,t)=>`${fo(n,t,"yyyy")} W${fo(n,t,"II")}`,Vu="yyyy-MM-dd h:mm:ss a",$u="h:mm:ss a",hr="yyyy-MM-dd h:mm a",Kr="h:mm a",pE="yyyy-MM-dd",Yu="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",gE={secondly:n=>n?Vu:$u,tenSecondly:n=>n?Vu:$u,thirtySecondly:n=>n?Vu:$u,minutely:n=>n?hr:Kr,fiveMinutely:n=>n?hr:Kr,tenMinutely:n=>n?hr:Kr,thirtyMinutely:n=>n?hr:Kr,hourly:n=>n?hr:Kr,twoHourly:n=>n?hr:Kr,twelveHourly:()=>hr,daily:()=>pE},mE={secondly:()=>Yu,tenSecondly:()=>Yu,thirtySecondly:()=>Yu,minutely:()=>Ii,fiveMinutely:()=>Ii,tenMinutely:()=>Ii,thirtyMinutely:()=>Ii,hourly:()=>Ii,twoHourly:()=>Ii,twelveHourly:()=>Ii,daily:()=>Ii};function xy({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return hE(n,l);if(r&&r[t]){const u=r[t](i);return fo(n,l,u)}if(s&&s[t]){const u=s[t]();return fo(n,l,u)}return fo(n,l,a)}const wy=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>xy({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:gE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ho=({tickValue:n,granularity:t,timezone:e})=>xy({tickValue:n,granularity:t,timezone:e,tooltipMap:mE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),vy=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",yE=n=>{const{i18n:t}=kt.useI18n();return vy(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},po=n=>n.toLocaleLowerCase().endsWith("count"),_E=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))},bE=(n,t)=>{if(!n.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(n.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?n[r]:n[r]+(n[s]-n[r])*(i-r)},xE=(n,t)=>{const e=n.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,bE(e,i)]))},Sy=.7,qu=(n,t)=>{const e=Ta(n.trim());return e.valid?e.alpha(t).rgbString():n},Ja=n=>{const t=n??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:Yh,outlier:Wh,outlierBand:qu(Vh,Sy)};const e=window.getComputedStyle(t),i=(r,s)=>e.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",Yh),outlier:i("--kui-color-background-danger",Wh),outlierBand:qu(i("--kui-color-background-danger-weakest",Vh),Sy)}},wE="empty",Ty=n=>{if(!n||!("meta"in n)||!("data"in n))return;const{display:t,metric_names:e,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=n.meta;if(!e?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=e[0],h=t&&Object.keys(t)[0]||void 0,g=n.data??[],m=[];for(const _ of g){const x=My(_.timestamp,_.event[d],h?_.event[h]:void 0);x&&m.push(x)}return{points:m,metric:d,metricUnit:i?.[d],dimension:h,display:h?t?.[h]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},My=(n,t,e)=>{if(t==null||t==="")return;const i=new Date(n).valueOf(),r=Number(t);return!Number.isFinite(i)||!Number.isFinite(r)?void 0:e===void 0?{timestamp:i,value:r}:{timestamp:i,value:r,group:e!==null&&e!==""?String(e):wE}},vE=(n,t)=>{if(!n||!("meta"in n))return;const{metric:e,dimension:i,unroll:r,display:s,metricUnit:a}=t,l=t.timestamp??"request_start";if(!e){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const u=[];for(const d of n.results??[]){const h=Xr(d,l);for(const g of SE(d,r)){const m=Xr(g,e)??Xr(d,e),_=i?Xr(g,i)??Xr(d,i):void 0,x=My(h,m,i?_??null:void 0);x&&u.push(x)}}return{points:u,metric:e,metricUnit:a,dimension:i,display:s,start:n.meta?.time_range?.start,end:n.meta?.time_range?.end,truncated:n.truncated,limit:n.limit,datasource:"requests"}},SE=(n,t)=>{if(!t)return[n];const e=Xr(n,t);return Array.isArray(e)?e:[]},Xr=(n,t)=>{let e=n;for(const i of t.split(".")){if(e===null||typeof e!="object")return;e=e[i]}return e},ky=n=>Object.hasOwn(wp.chartLabels,n),TE=["hidden","single","full"];var pr=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(pr||{});const ME=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],kE=["gauge","top_n","single_value"],tl=n=>n===null||typeof n!="object"||!("points"in n)?!1:Array.isArray(n.points);var Pe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(Pe||{});const Dy={modes:{point(n,t){return el(n,t,{intersect:!0})},nearest(n,t,e){return OE(n,t,e)},x(n,t,e){return el(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return el(n,t,{intersect:e.intersect,axis:"y"})}}};function ju(n,t,e){return(Dy.modes[e.mode]||Dy.modes.nearest)(n,t,e)}function DE(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function CE(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function el(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):DE(i,t,e.axis))}function OE(n,t,e){let i=Number.POSITIVE_INFINITY;return el(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),l=CE(t,a,e.axis),u=Ur(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 gr(n,t,e){const i=Math.cos(e),r=Math.sin(e),s=t.x,a=t.y;return{x:s+i*(n.x-s)-r*(n.y-a),y:a+r*(n.x-s)+i*(n.y-a)}}const AE=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,mr=.001,nl=(n,t,e)=>Math.min(e,Math.max(t,n)),Cy=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function RE(n,t,e){for(const i of Object.keys(n))n[i]=nl(n[i],t,e);return n}function EE(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Oy(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=n.x>=t-u-mr&&n.x<=i+u+mr,h=n.y>=e-u-mr&&n.y<=r+u+mr;return s==="x"?d:(s==="y"||d)&&h}function Ay(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=gr(n,e,xe(-r));return Oy(l,t,i,{borderWidth:s,hitTolerance:a})}function yr(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function PE(n,t,e,i=!0){const r=e.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(AE(l,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Ry=n=>typeof n=="string"&&n.endsWith("%"),Ey=n=>parseFloat(n)/100,Py=n=>nl(Ey(n),0,1),go=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),IE={box:n=>go(n.centerX,n.centerY),doughnutLabel:n=>go(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>go(n.centerX,n.centerY),line:n=>go(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>go(n.centerX,n.centerY)};function Gu(n,t){return t==="start"?0:t==="end"?n:Ry(t)?Py(t)*n:n/2}function Li(n,t,e=!0){return typeof t=="number"?t:Ry(t)?(e?Py(t):Ey(t))*n:n}function LE(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Iy(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const l=Pt(a),u=t.width+(l?a.width:0)+e,d=t.height+(l?a.height:0)+e,h=Ku(i),g=Fy(n.x,u,r,h.x),m=Fy(n.y,d,s,h.y);return{x:g,y:m,x2:g+u,y2:m+d,width:u,height:d,centerX:g+u/2,centerY:m+d/2}}function Ku(n,t="center"){return Pt(n)?{x:Mt(n.x,t),y:Mt(n.y,t)}:(n=Mt(n,t),{x:n,y:n})}const Ly=(n,t)=>n&&n.autoFit&&t<1;function Ny(n,t){const e=n.font,i=qt(e)?e:[e];return Ly(n,t)?i.map(function(r){const s=le(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,le(s)}):i.map(r=>le(r))}function By(n){return n&&(en(n.xValue)||en(n.yValue))}function Fy(n,t,e=0,i){return n-Gu(t,i)+e}function Zr(n,t,e){const i=e.init;if(i){if(i===!0)return Uy(t,e)}else return;return NE(n,t,e)}function zy(n,t,e){let i=!1;return t.forEach(r=>{nn(n[r])?(i=!0,e[r]=n[r]):en(e[r])&&delete e[r]}),i}function Uy(n,t){const e=t.type||"line";return IE[e](n)}function NE(n,t,e){const i=Qt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Uy(t,e);if(Pt(i))return i}const Xu=new Map,BE=n=>isNaN(n)||n<=0,FE=n=>n.reduce(function(t,e){return t+=e.string,t},"");function il(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function rl(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(xe(i)),n.translate(-t,-e))}function li(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Qr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function sl(n,t){const e=t.content;if(il(e))return{width:Li(e.width,t.width),height:Li(e.height,t.height)};const i=Ny(t),r=t.textStrokeWidth,s=qt(e)?e:[e],a=s.join()+FE(i)+r+(n._measureText?"-spriting":"");return Xu.has(a)||Xu.set(a,WE(n,s,i,r)),Xu.get(a)}function Hy(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),Qr(n,e);const l=li(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Hr(n,{x:i,y:r,w:s,h:a,radius:RE(Ci(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),l&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Wy(n,t,e,i){const r=e.content;if(il(r)){n.save(),n.globalAlpha=YE(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=qt(r)?r:[r],a=Ny(e,i),l=e.color,u=qt(l)?l:[l],d=LE(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,zE(n,e)&&VE(n,{x:d,y:h},s,a),$E(n,{x:d,y:h},s,{fonts:a,colors:u}),n.restore()}function zE(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function UE(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*qc;if(il(a)){n.save(),n.translate(e,i),n.rotate(u),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}BE(r)||HE(n,{x:e,y:i,radius:r,rotation:l,style:a,rad:u})}function HE(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let l,u,d,h;switch(n.beginPath(),s){default:n.arc(t,e,i,0,te),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":h=i*.516,d=i-h,l=Math.cos(a+kn)*d,u=Math.sin(a+kn)*d,n.arc(t-l,e-u,h,a-Rt,a-re),n.arc(t+u,e-l,h,a-re,a),n.arc(t+l,e+u,h,a,a+re),n.arc(t-u,e+l,h,a+re,a+Rt),n.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,n.rect(t-d,e-d,2*d,2*d);break}a+=kn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+u,e-l),n.lineTo(t+l,e+u),n.lineTo(t-u,e+l),n.closePath();break;case"crossRot":a+=kn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l),a+=kn,l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function WE(n,t,e,i){n.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=e[Math.min(l,e.length-1)];n.font=u.string;const d=t[l];s=Math.max(s,n.measureText(d).width+i),a+=u.lineHeight}return n.restore(),{width:s,height:a}}function VE(n,{x:t,y:e},i,r){n.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.font=u.string,n.strokeText(a,t,e+d/2+s),s+=d}),n.stroke()}function $E(n,{x:t,y:e},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)],g=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=d,n.fillText(l,t,e+g/2+a),a+=g,n.fill()})}function YE(n,t){const e=Di(n)?n:t;return Di(e)?nl(e,0,1):1}const Vy=["left","bottom","top","right"];function qE(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&ZE(t,s);if(!a||JE(t,s,a))return;if(n.save(),n.beginPath(),!li(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=jE(t,a),{sideStart:h,sideEnd:g}=KE(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(h.x,h.y),n.lineTo(g.x,g.y);const m=gr({x:e,y:i},t.getCenterPoint(),xe(-t.rotation));n.lineTo(m.x,m.y),n.stroke(),n.restore()}function jE(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=GE(n,t);let l,u;return t==="left"||t==="right"?(l={x:e+a,y:i},u={x:l.x,y:s}):(l={x:e,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function GE(n,t){const{width:e,height:i,options:r}=n,s=r.callout.margin+r.borderWidth/2;return t==="right"?e+s:t==="bottom"?i+s:-s}function KE(n,t,e){const{y:i,width:r,height:s,options:a}=n,l=a.callout.start,u=XE(t,a.callout);let d,h;return t==="left"||t==="right"?(d={x:e.x,y:i+Li(s,l)},h={x:d.x+u,y:d.y}):(d={x:e.x+Li(r,l),y:e.y},h={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:h}}function XE(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function ZE(n,t){const e=t.position;return Vy.includes(e)?e:QE(n,t)}function QE(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:h,centerY:g,rotation:m}=n,_={x:h,y:g},x=t.start,v=Li(a,x),S=Li(l,x),C=[e,e+v,e+v,r],R=[i+S,s,i,s],B=[];for(let P=0;P<4;P++){const L=gr({x:C[P],y:R[P]},_,xe(m));B.push({position:Vy[P],distance:Ur(L,{x:u,y:d})})}return B.sort((P,L)=>P.distance-L.distance)[0].position}function JE(n,t,e){const{pointX:i,pointY:r}=n,s=t.margin;let a=i,l=r;return e==="left"?a+=s:e==="right"?a-=s:e==="top"?l+=s:e==="bottom"&&(l-=s),n.inRange(a,l)}const $y={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 Jr(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function _r(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),s=Object.values(n).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function Yy(n,t){if(n){const e=n.options.reverse,i=Jr(n,t.min,e?t.end:t.start),r=Jr(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function qy(n,t){const{chartArea:e,scales:i}=n,r=i[_r(i,t,"xScaleID")],s=i[_r(i,t,"yScaleID")];let a=e.width/2,l=e.height/2;return r&&(a=Jr(r,t.xValue,r.left+r.width/2)),s&&(l=Jr(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function Zu(n,t){const e=n.scales,i=e[_r(e,t,"xScaleID")],r=e[_r(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:l,bottom:u}=r||n.chartArea;const d=Ky(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=Ky(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 jy(n,t){if(!By(t)){const e=Zu(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,s=e.centerX+t.xAdjust,a=e.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 eP(n,t)}function tP(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?nP(r,s,t):iP(e,s,t),s}function Gy(n,t){const e=Zu(n,t);return e.initProperties=Zr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:oP(n,e,t),initProperties:e.initProperties}],e}function eP(n,t){const e=qy(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Ky(n,t){const e=Yy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function nP(n,t,e){const i=Jr(n,e.value,NaN),r=Jr(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function iP(n,t,e){for(const i of Object.keys($y)){const r=n[_r(n,e,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=$y[i],g=Yy(r,{min:e[s],max:e[a],start:r[l],end:r[u]});t[d]=g.start,t[h]=g.end}}}function rP({properties:n,options:t},e,i,r){const{x:s,x2:a,width:l}=n;return Xy({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function sP({properties:n,options:t},e,i,r){const{y:s,y2:a,height:l}=n;return Xy({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Xy(n,t){const{start:e,end:i,borderWidth:r}=n,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-e-a-l-t.size;return e+r/2+u+Gu(d,s)}function oP(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ku(i.position),s=we(i.padding),a=sl(n.ctx,i),l=rP({properties:t,options:e},a,r,s),u=sP({properties:t,options:e},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 Qu=["enter","leave"],Ju=Qu.concat("click");function aP(n,t,e){t.listened=zy(e,Ju,t.listeners),t.moveListened=!1,Qu.forEach(i=>{nn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&nn(i.click)&&(t.listened=!0),t.moveListened||Qu.forEach(r=>{nn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function lP(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return cP(n,t,e);case"click":return uP(n,t,e)}}function cP(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=ju(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=Zy(s,"leave",r,i);return Zy(s,"enter",i,r)||a}function Zy({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=Qy(a.options[e]||n.listeners[e],a,t)||s);return s}function uP(n,t,e){const i=n.listeners,r=ju(n.visibleElements,t,e.interaction);let s;for(const a of r)s=Qy(a.options.click||i.click,a,t)||s;return s}function Qy(n,t,e){return Qt(n,[t.$context,e])===!0}const ol=["afterDraw","beforeDraw"];function dP(n,t,e){const i=t.visibleElements;t.hooked=zy(e,ol,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ol.forEach(s=>{nn(r.options[s])&&(t.hooked=!0)})})}function Jy(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Qt(i,[t.$context])}}function fP(n,t,e){const i=yP(n.scales,t,e);let r=t_(t,i,"min","suggestedMin");r=t_(t,i,"max","suggestedMax")||r,r&&nn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function hP(n,t){for(const e of n)gP(e,t)}function t_(n,t,e,i){if(ae(t[e])&&!pP(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function pP(n,t,e){return en(n[t])||en(n[e])}function gP(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=_r(t,n,e);i&&!t[i]&&mP(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function mP(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(en(n[e+i]))return!0;return!1}function yP(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Mt(t.min,Number.NEGATIVE_INFINITY),max:Mt(t.max,Number.POSITIVE_INFINITY)};for(const l of e)l.scaleID===r?e_(l,t,["value","endValue"],a):_r(n,l,s)===r&&e_(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function e_(n,t,e,i){for(const r of e){const s=n[r];if(en(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class ts extends Ve{inRange(t,e,i,r){const{x:s,y:a}=gr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation));return Oy({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return yr(this,t)}draw(t){t.save(),rl(t,this.getCenterPoint(),this.options.rotation),Hy(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Gy(t,e)}}ts.id="boxAnnotation",ts.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},ts.defaultRoutes={borderColor:"color",backgroundColor:"color"},ts.descriptors={label:{_fallback:!0}};class al extends Ve{inRange(t,e,i,r){return Ay({x:t,y:e},{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 yr(this,t)}draw(t){const e=this.options;!e.display||!e.content||(SP(t,this),t.save(),rl(t,this.getCenterPoint(),this.rotation),Wy(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=_P(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=xP(t,e,i);let l=sl(t.ctx,e);const u=wP(l,a);Ly(e,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:g}=e,m=Iy(s,l,{borderWidth:0,position:d,xAdjust:h,yAdjust:g});return{initProperties:Zr(t,m,e),...m,...r,rotation:e.rotation,_fitRatio:u}}}al.id="doughnutLabelAnnotation",al.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},al.defaultRoutes={};function _P(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Zs&&bP(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function bP(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function xP({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:l,offsetX:u,offsetY:d}=e.controller,h=(i+s)/2+u,g=(r+a)/2+d,m={left:Math.max(h-l,i),right:Math.min(h+l,s),top:Math.max(g-l,r),bottom:Math.min(g+l,a)},_={x:(m.left+m.right)/2,y:(m.top+m.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=_.y>g,C=S?r+x:a-x,R=vP(C,h,g,v);return{controllerMeta:{_centerX:h,_centerY:g,_radius:v,_counterclockwise:S,...R},point:_,radius:Math.min(l,Math.min(m.right-m.left,m.bottom-m.top)/2)}}function wP({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function vP(n,t,e,i){const r=Math.pow(e-n,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:te};const d=(-a-Math.sqrt(u))/2,h=(-a+Math.sqrt(u))/2;return{_startAngle:va({x:t,y:e},{x:d,y:n}).angle,_endAngle:va({x:t,y:e},{x:h,y:n}).angle}}function SP(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;n.save();const d=li(n,u);n.fillStyle=u.backgroundColor,n.beginPath(),n.arc(e,i,r,s,a,l),n.closePath(),n.fill(),d&&n.stroke(),n.restore()}class mo extends Ve{inRange(t,e,i,r){return Ay({x:t,y:e},{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 yr(this,t)}draw(t){const e=this.options,i=!en(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),rl(t,this.getCenterPoint(),this.rotation),qE(t,this),Hy(t,this,e),Wy(t,TP(this),e),t.restore())}resolveElementProperties(t,e){let i;if(By(e))i=qy(t,e);else{const{centerX:l,centerY:u}=Zu(t,e);i={x:l,y:u}}const r=we(e.padding),s=sl(t.ctx,e),a=Iy(i,s,e,r);return{initProperties:Zr(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}mo.id="labelAnnotation",mo.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},mo.defaultRoutes={borderColor:"color"};function TP({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=we(r.padding);return{x:n+a.left+s,y:t+a.top+s,width:e-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const td=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ed=(n,t,e)=>td(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,n_=(n,t,e)=>td(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,yo=n=>n*n,MP=(n,t,{x:e,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},i_=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,nd=(n,t,e,i)=>({x:i_(n.x,t.x,e.x,i),y:i_(n.y,t.y,e.y,i)}),r_=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),s_=(n,t,e,i)=>-Math.atan2(r_(n.x,t.x,e.x,i),r_(n.y,t.y,e.y,i))+.5*Rt;class _o extends Ve{inRange(t,e,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:l,ctx:u}=this;if(l){li(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,g=t*h.currentDevicePixelRatio,m=e*h.currentDevicePixelRatio,_=u.isPointInStroke(l,g,m)||id(this,a,r);return u.restore(),_}const d=yo(s);return OP(this,a,d,r)||id(this,a,r)}return kP(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return yr(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!li(t,l))return t.restore();Qr(t,l);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(l.curve&&a)return BP(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:g,endAdjust:m}=u_(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+g,0),t.lineTo(u-m,0),t.shadowColor=l.borderShadowColor,t.stroke(),rd(t,0,g,d),rd(t,u,-m,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=tP(t,e),{x:r,y:s,x2:a,y2:l}=i,u=DP(i,t.chartArea),d=u?CP({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=Zr(t,d,e),e.curve){const g={x:d.x,y:d.y},m={x:d.x2,y:d.y2};d.cp=NP(d,e,Ur(g,m))}const h=AP(t,d,e.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}_o.id="lineAnnotation";const o_={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};_o.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},o_),fill:!1,length:12,start:Object.assign({},o_),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},mo.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},_o.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},_o.defaultRoutes={borderColor:"color"};function kP(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=MP(t,e,n.getProps(["x","y","x2","y2"],s),i);return Cy(a,r)||id(n,{mouseX:t,mouseY:e},s,i)}function DP({x:n,y:t,x2:e,y2:i},{top:r,right:s,bottom:a,left:l}){return!(n<l&&e<l||n>s&&e>s||t<r&&i<r||t>a&&i>a)}function a_({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=n_(a,{x:n,y:t},e),n=a),n>r&&(t=n_(r,{x:n,y:t},e),n=r),t<i&&(n=ed(i,{x:n,y:t},e),t=i),t>s&&(n=ed(s,{x:n,y:t},e),t=s),{x:n,y:t}}function CP(n,t,e){const{x:i,y:r}=a_(n,t,e),{x:s,y:a}=a_(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function OP(n,{mouseX:t,mouseY:e},i=mr,r){const{x:s,y:a,x2:l,y2:u}=n.getProps(["x","y","x2","y2"],r),d=l-s,h=u-a,g=yo(d)+yo(h),m=g===0?-1:((t-s)*d+(e-a)*h)/g;let _,x;return m<0?(_=s,x=a):m>1?(_=l,x=u):(_=s+m*d,x=a+m*h),yo(t-_)+yo(e-x)<=i}function id(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function AP(n,t,e){const i=e.borderWidth,r=we(e.padding),s=sl(n.ctx,e),a=s.width+r.width+i,l=s.height+r.height+i;return EP(t,e,{width:a,height:l,padding:r},n.chartArea)}function RP(n){const{x:t,y:e,x2:i,y2:r}=n,s=Math.atan2(r-e,i-t);return s>Rt/2?s-Rt:s<Rt/-2?s+Rt:s}function EP(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:l,yAdjust:u}=t,d={x:n.x,y:n.y},h={x:n.x2,y:n.y2},g=t.rotation==="auto"?RP(n):xe(t.rotation),m=PP(r,s,g),_=IP(n,t,{labelSize:m,padding:a},i),x=n.cp?nd(d,n.cp,h,_):td(d,h,_),v={size:m.w,min:i.left,max:i.right,padding:a.left},S={size:m.h,min:i.top,max:i.bottom,padding:a.top},C=c_(x.x,v)+l,R=c_(x.y,S)+u;return{x:C-r/2,y:R-s/2,x2:C+r/2,y2:R+s/2,centerX:C,centerY:R,pointX:x.x,pointY:x.y,width:r,height:s,rotation:wa(g)}}function PP(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function IP(n,t,e,i){let r;const s=LP(n,i);return t.position==="start"?r=l_({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-l_({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=Gu(1,t.position),r}function l_(n,t,e,i){const{labelSize:r,padding:s}=t,a=n.w*i.dx,l=n.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 nl(Math.max(u,d),0,.25)}function LP(n,t){const{x:e,x2:i,y:r,y2:s}=n,a=Math.min(r,s)-t.top,l=Math.min(e,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(e,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function c_(n,t){const{size:e,min:i,max:r,padding:s}=t,a=e/2;return e>r-i?(r+i)/2:(i>=n-s-a&&(n=i+s+a),r<=n+s+a&&(n=r-s-a),n)}function u_(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:d_(n,e),endAdjust:d_(n,i)}}function d_(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,s={x:e,y:i+r};return Math.abs(ed(0,s,{x:0,y:r}))}function rd(n,t,e,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+e;n.beginPath(),Qr(n,i),li(n,i),n.moveTo(d,-s),n.lineTo(t+e,0),n.lineTo(d,s),a===!0?(n.fillStyle=l||u,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function NP(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=n,d=Math.atan2(a-r,s-i),h=Ku(t.controlPoint,0),g={x:l+Li(e,h.x,!1),y:u+Li(e,h.y,!1)};return gr(g,{x:l,y:u},d)}function f_(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),rd(n,0,-r,s),n.restore())}function BP(n,t,e,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:g,endAdjust:m}=u_(t),_={x:r,y:s},x={x:a,y:l},v=s_(_,e,x,0),S=s_(_,e,x,1)-Rt,C=nd(_,e,x,g/i),R=nd(_,e,x,1-m/i),B=new Path2D;n.beginPath(),B.moveTo(C.x,C.y),B.quadraticCurveTo(e.x,e.y,R.x,R.y),n.shadowColor=u.borderShadowColor,n.stroke(B),t.path=B,t.ctx=n,f_(n,C,{angle:v,adjust:g},d),f_(n,R,{angle:S,adjust:m},h)}class bo extends Ve{inRange(t,e,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return FP({x:t,y:e},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),g=i==="y"?{start:u,end:h}:{start:l,end:d},m=gr({x:t,y:e},this.getCenterPoint(r),xe(-s));return m[i]>=g.start-a-mr&&m[i]<=g.end+a+mr}getCenterPoint(t){return yr(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),rl(t,this.getCenterPoint(),a.rotation),Qr(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=li(t,a);t.ellipse(r,s,i/2,e/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,e){return Gy(t,e)}}bo.id="ellipseAnnotation",bo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},ts.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},bo.defaultRoutes={borderColor:"color",backgroundColor:"color"},bo.descriptors={label:{_fallback:!0}};function FP(n,t,e,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=xe(e||0),g=Math.cos(h),m=Math.sin(h),_=Math.pow(g*(n.x-a)+m*(n.y-l),2),x=Math.pow(m*(n.x-a)-g*(n.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class ll extends Ve{inRange(t,e,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"?EE({x:t,y:e},this.getCenterPoint(r),d/2,h):Cy(i==="y"?{start:a,end:u,value:e}:{start:s,end:l,value:t},h)}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Qr(t,e);const r=li(t,e);UE(t,this,this.centerX,this.centerY),r&&!il(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=jy(t,e);return i.initProperties=Zr(t,i,e),i}}ll.id="pointAnnotation",ll.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},ll.defaultRoutes={borderColor:"color",backgroundColor:"color"};class cl extends Ve{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&UP(this.elements,t,e,r);const s=gr({x:t,y:e},this.getCenterPoint(r),xe(-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 yr(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Qr(t,i);const r=li(t,i);let s=!0;for(const a of e)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,e){const i=jy(t,e),{sides:r,rotation:s}=e,a=[],l=2*Rt/r;let u=s*qc;for(let d=0;d<r;d++,u+=l){const h=zP(i,e,u);h.initProperties=Zr(t,i,e),a.push(h)}return i.elements=a,i}}cl.id="polygonAnnotation",cl.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},cl.defaultRoutes={borderColor:"color",backgroundColor:"color"};function zP({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:n+l*e,y:t-u*e};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:n+l*(e+a),bY:t-u*(e+a)}}}function UP(n,t,e,i){let r=!1,s=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const l=a.getProps(["bX","bY"],i);l.bY>e!=s.bY>e&&t<(s.bX-l.bX)*(e-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const Ni={box:ts,doughnutLabel:al,ellipse:bo,label:mo,line:_o,point:ll,polygon:cl};Object.keys(Ni).forEach(n=>{se.describe(`elements.${Ni[n].id}`,{_fallback:"plugins.annotation.common"})});const HP={update:Object.assign},WP=Ju.concat(ol),h_=(n,t)=>Pt(t)?ad(n,t):n,sd=n=>n==="color"||n==="font";function od(n="line"){return Ni[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function VP(n,t,e,i){const r=YP(n,e.animations,i),s=t.annotations,a=GP(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=p_(a,l,u.type),h=u.setContext(jP(n,d,a,u)),g=d.resolveElementProperties(n,h);g.skip=$P(g),"elements"in g&&(qP(d,g.elements,h,r),delete g.elements),en(d.x)||Object.assign(d,g),Object.assign(d,g.initProperties),g.options=g_(h),r.update(d,g)}}function $P(n){return isNaN(n.x)||isNaN(n.y)}function YP(n,t,e){return e==="reset"||e==="none"||e==="resize"?HP:new ou(n,t)}function qP(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=p_(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);l.options=g_(d),i.update(u,l)}}function p_(n,t,e,i){const r=Ni[od(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function g_(n){const t=Ni[od(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,ad(n,t.defaults),ad(n,t.defaultRoutes));for(const i of WP)e[i]=n[i];return e}function ad(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];sd(i)&&qt(s)?e[i]=s.map(a=>h_(a,r)):e[i]=h_(s,r)}return e}function jP(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function GP(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var KP="3.1.0";const Bi=new Map,m_=n=>n.type!=="doughnutLabel",XP=Ju.concat(ol);var y_={id:"annotation",version:KP,beforeRegister(){PE("chart.js","4.0",rn.version)},afterRegister(){rn.register(Ni)},afterUnregister(){rn.unregister(Ni)},beforeInit(n){Bi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Bi.get(n),r=i.annotations=[];let s=e.annotations;Pt(s)?Object.keys(s).forEach(a=>{const l=s[a];Pt(l)&&(l.id=a,r.push(l))}):qt(s)&&r.push(...s),hP(r.filter(m_),n.scales)},afterDataLimits(n,t){const e=Bi.get(n);fP(n,t.scale,e.annotations.filter(m_).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Bi.get(n);aP(n,i,e),VP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),dP(n,i,e)},beforeDatasetsDraw(n,t,e){xo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){xo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){xo(n,t.index,e.clip)},beforeDraw(n,t,e){xo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){xo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Bi.get(n);lP(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Bi.delete(n)},getAnnotations(n){const t=Bi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return ju(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!XP.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Ni[od(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:sd,_fallback:!0},_indexable:sd}},additionalOptionScopes:[""]};function xo(n,t,e){const{ctx:i,chartArea:r}=n,s=Bi.get(n);e&&js(i,r);const a=ZP(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)QP(i,r,s,l);e&&Gs(i)}function ZP(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function QP(n,t,e,i){const r=i.element;i.main?(Jy(e,r,"beforeDraw"),r.draw(n,t),Jy(e,r,"afterDraw")):r.draw(n,t)}const JP={class:"zoom-timerange-container"},t2={class:"zoom-timerange-details"},e2={class:"label","data-testid":"zoom-timerange-from"},n2={class:"label","data-testid":"zoom-timerange-to"},i2=p.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(ho({tickValue:t.start,granularity:t.granularity})),r=p.ref(ho({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{ey(()=>{i.value=ho({tickValue:a,granularity:t.granularity}),r.value=ho({tickValue:l,granularity:t.granularity})},100)()};return p.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(p.openBlock(),p.createElementBlock("div",JP,[p.createElementVNode("div",t2,[p.createElementVNode("div",e2,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",n2,p.toDisplayString(p.unref(e).t("zoom_time_range.to")),1),p.createElementVNode("div",null,p.toDisplayString(r.value),1)])]))}}),an=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},__=an(i2,[["__scopeId","data-v-4fa681cf"]]),r2={class:"zoom-actions-container"},s2={class:"zoom-actions-heading"},o2={class:"zoom-action-select"},a2=["data-testid"],l2=["aria-disabled","href"],c2=["onClick"],u2=an(p.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,r=s=>{s.action&&(s.action(e.newTimeRange),i("onAction"))};return(s,a)=>(p.openBlock(),p.createElementBlock("div",r2,[p.createElementVNode("div",s2,[p.createVNode(__,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),p.createVNode(p.unref(Ts.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=p.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),p.createElementVNode("div",o2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.zoomActionItems,l=>(p.openBlock(),p.createElementBlock("div",{key:l.key,class:p.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(p.openBlock(),p.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},p.toDisplayString(l.label),9,l2)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(l)},p.toDisplayString(l.label),9,c2))],10,a2))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),d2={key:2},f2={class:"tooltip-title"},h2={class:"title"},p2={key:0,class:"subtitle"},g2={class:"context"},m2={class:"metric"},y2={class:"tooltip"},_2={key:0},b2={class:"display-value"},wo=an(p.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,r=p.ref(null),{x:s,y:a,isDragging:l}=dR(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=p.computed(()=>`${a.value}px`),d=p.computed(()=>`${s.value}px`),h=p.computed(()=>i.state.tooltipContext),g=p.computed(()=>i.state.metricDisplay),m=p.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return p.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),p.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),p.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();e("dimensions",{width:x,height:v})}}),(_,x)=>n.state.showTooltip?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:p.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:p.normalizeStyle({transform:m.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:m.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(p.openBlock(),p.createBlock(__,{key:0,end:n.zoomTimeRange?.end,granularity:n.granularity,start:n.zoomTimeRange?.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(p.openBlock(),p.createBlock(u2,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(p.openBlock(),p.createElementBlock("div",d2,[p.createElementVNode("div",f2,[p.createElementVNode("div",h2,[p.createElementVNode("div",null,p.toDisplayString(n.tooltipTitle),1),m.value?(p.openBlock(),p.createBlock(p.unref(Ts.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])):p.createCommentVNode("",!0)]),h.value||g.value?(p.openBlock(),p.createElementBlock("div",p2,[p.createElementVNode("div",g2,p.toDisplayString(h.value),1),p.createElementVNode("div",m2,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",y2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:C,value:R,isSegmentEmpty:B},P)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:C+P},[n.state.tooltipSeries.length?(p.openBlock(),p.createElementBlock("li",_2,[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:String(v),borderColor:String(S)})},null,4),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:B}])},p.toDisplayString(C),3),p.createElementVNode("span",b2,p.toDisplayString(R),1)])):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),x2={key:0,class:"legend-container","data-testid":"legend"},w2=["onClick"],v2=["title"],S2={class:"label truncate-label"},T2={key:0,class:"sub-label"},M2={class:"tooltip-content"},ul=an(p.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.inject("showLegendValues",!1),r=p.inject("legendPosition",p.ref(Pe.Bottom)),s=(l=0,u)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart,h=a(l,u);!d.getDatasetMeta(l).dataset&&u!==void 0?d.toggleDataVisibility(u):h?d.hide(l,u):d.show(l,u),d.update()},a=(l=0,u)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||u===void 0?d.isDatasetVisible(l):d.getDataVisibility(u)};return(l,u)=>{const d=p.resolveComponent("KTooltip");return p.unref(r)!==p.unref(Pe).Hidden?(p.openBlock(),p.createElementBlock("ul",x2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:h,strokeStyle:g,text:m,datasetIndex:_,index:x,value:v,isSegmentEmpty:S})=>(p.openBlock(),p.createElementBlock("li",{key:m,onClick:C=>s(_,x)},[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:h,"border-color":g})},null,4),p.createVNode(d,null,p.createSlots({default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["label-container",{"strike-through":!a(_,x)}]),title:v&&p.unref(i)?`${m}: ${v.formatted}`:m},[p.createElementVNode("div",S2,p.toDisplayString(m),1),v&&p.unref(i)?(p.openBlock(),p.createElementBlock("div",T2,p.toDisplayString(v.formatted),1)):p.createCommentVNode("",!0)],10,v2)]),_:2},[S?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",M2,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,w2))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-388cf4f5"]]),Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));function k2(n,t=0){return(Ie[n[t+0]]+Ie[n[t+1]]+Ie[n[t+2]]+Ie[n[t+3]]+"-"+Ie[n[t+4]]+Ie[n[t+5]]+"-"+Ie[n[t+6]]+Ie[n[t+7]]+"-"+Ie[n[t+8]]+Ie[n[t+9]]+"-"+Ie[n[t+10]]+Ie[n[t+11]]+Ie[n[t+12]]+Ie[n[t+13]]+Ie[n[t+14]]+Ie[n[t+15]]).toLowerCase()}const D2=new Uint8Array(16);function C2(){return crypto.getRandomValues(D2)}function ld(n,t,e){return crypto.randomUUID?crypto.randomUUID():O2(n)}function O2(n,t,e){n=n||{};const i=n.random??n.rng?.()??C2();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,k2(i)}const b_=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,s=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):e.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),e.restore()};class x_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&b_(t,this._clickedElements)}afterEvent(t,{event:e}){if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,b_(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 A2=["id"],R2=["id"],E2={class:"axis-tooltip-content"},P2="100%",I2="100%",L2=20,N2=20,w_=6,B2=0,F2=10,z2=10,U2=1,H2=an(p.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{translateUnit:i}=kt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new x_,l=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:$},st)=>{const ot=$.data,lt=ot.labels?.indexOf(st);return ot.datasets.reduce((pt,dt,It)=>{if($.isDatasetVisible(It)){const zt=dt.data[lt];return isNaN(zt)?pt:pt+zt}else return pt},0)},h=($,st,ot,lt)=>{const pt=lt==="horizontal";st===null&&(st=e.t("entityNoName"));const dt={type:"label",yValue:vt=>pt?st:d(vt,st),xValue:vt=>pt?d(vt,st):st},It={...dt,position:pt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>pt?0:-Math.abs(PR()),content:vt=>ry(d(vt,st),ot)},zt={...dt,content:vt=>LR(d(vt,st),IR(vt.chart,$)),position:pt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:vt=>pt?ER(ry(d(vt,st),ot)):0,color:MR};return{[`${st}-value`]:It,[`${st}-percent`]:zt}},g=p.useTemplateRef("canvas"),m=p.useTemplateRef("axis"),_=ld(),x=ld(),v=p.ref([]),S=p.inject("legendPosition",Pe.Bottom),C=p.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),R=p.toRef(t,"metricUnit"),B=p.computed(()=>t.orientation==="horizontal"),P=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:B.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:L,tooltipAbsoluteTop:I}=kt.useTooltipAbsolutePosition(u,P),N=p.ref(0),T=()=>t.annotations&&t.chartData.labels?.reduce(($,st)=>Object.assign($,h(t.chartData,st,R.value,t.orientation)),{}),M={id:_,afterUpdate($){N.value+=1,v.value=Ou($,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate($){$.options.plugins.annotation.annotations=t.annotations?T():{}}},W=[M,{id:"axisHover",afterEvent($,st){if(C.show=!1,st.event.type==="mousemove"){const ot=st.event,lt=$.options.indexAxis,pt=$.scales,dt=$.scales[lt].getLabelForValue(Number($.scales[lt].getValueForPixel(ot[lt]))),zt=$.scales[lt].getLabels().indexOf(dt),vt=t.chartData.isLabelEmpty?.[zt];if((Dt=>Dt==="x"?ot.y>pt.x.top:ot.x<pt.y.right)(lt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ve=$.canvas.getContext("2d").measureText(dt).width,bt=Math.abs(Math.round(ot.x-ve*.5)),jt=Math.round(ot.x+ve*.5),Oe=$.canvas.getBoundingClientRect(),Ae=40;C.left=lt==="x"?`${(bt>0?bt:jt)-C.offset+Oe.left}px`:`${ot.x-ve*.5-C.offset+Oe.left}px`,C.top=`${ot.y-Ae+Oe.top}px`,dt.length>Za?(C.show=!0,C.text=dt):vt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],it=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),ut=p.ref(0),ft=p.ref(0),j=new ResizeObserver(ey($=>{ut.value=$[0].contentRect.width,ft.value=$[0].contentRect.height},100)),tt=p.computed(()=>{const $=t.chartData?.labels?.length;return g.value&&$&&!B.value?`${Math.max($*(L2+w_),ut.value)}px`:P2}),nt=p.computed(()=>{const $=t.chartData?.labels?.length;return g.value&&$&&B.value?`${Math.max($*(N2+w_),ft.value)}px`:I2});kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&rn.register(y_),l.value&&(ut.value=l.value.offsetWidth,ft.value=l.value.offsetHeight,j.observe(l.value))}),p.onUnmounted(()=>{l.value&&j.unobserve(l.value)});const et=p.computed(()=>{const $=kt.useBarChartOptions({tooltipState:P,legendID:_,stacked:p.toRef(t,"stacked"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),indexAxis:B.value?"y":"x",numLabels:it});return{...$.value,plugins:{...$.value.plugins,annotation:{annotations:T(),clip:!1}}}}),at=kt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),W,et);p.onBeforeUnmount(()=>{rn.unregister(y_)});const H={[Pe.Bottom]:"column"},q=p.computed(()=>{if(m.value&&at.value){const $=window.devicePixelRatio,st=at.value,ot=st.scales.y.width*$+U2,lt=(st.scales.y.height+st.scales.y.top+st.scales.x.height)*$,pt=m.value.getContext("2d");return pt.scale($,$),pt.canvas.width=ot,pt.canvas.height=lt,pt.canvas.style.width=`${ot/$}px`,pt.canvas.style.height=`${lt/$}px`,{scale:$,width:ot*$,height:lt*$,targetCtx:pt}}return null}),X=$=>{const st=$.target;if(q.value&&at.value&&!B.value){const ot=q.value.scale,lt=q.value.targetCtx,pt=q.value.width,dt=q.value.height,It=at.value,zt=It.canvas;lt.fillStyle="white",st.scrollLeft>=B2&&st.scrollLeft<=F2?(lt.globalCompositeOperation="source-over",lt.clearRect(0,0,pt,dt),lt.drawImage(zt,0,0,pt,dt,0,0,pt,dt),lt.globalCompositeOperation="destination-over",lt.fillRect(0,0,pt,dt)):(lt.globalCompositeOperation="source-over",lt.fillRect(0,(It.scales.y.height+It.scales.y.top+z2)*ot,pt,It.scales.x.height*ot))}P.offsetY=st.scrollTop,P.offsetX=st.scrollLeft,C.offset=st.scrollLeft},_t=({width:$,height:st})=>{P.width=$,P.height=st};p.watch(()=>t.orientation,()=>{if(m.value&&q.value){const $=q.value.width,st=q.value.height;(m.value?.getContext("2d")).clearRect(0,0,$,st)}P.showTooltip=!1,P.interactionMode="idle"}),p.watch(()=>t.annotations,$=>{at.value&&($?at.value.options.plugins.annotation.annotations=T(t.chartData):delete at.value.options.plugins.annotation.annotations)});const G=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return($,st)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",H[p.unref(S)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,A2),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:st[0]||(st[0]=ot=>G()),onScroll:X},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:tt.value,height:nt.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,R2)],4)],544),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[C.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:"axis-tooltip",style:p.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[p.createElementVNode("div",E2,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(wo,{"absolute-left":p.unref(L),"absolute-top":p.unref(I),"chart-parent-ref":u.value,state:P,"tooltip-title":n.tooltipTitle,onDimensions:_t},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),p.createVNode(ul,{id:p.unref(_),"chart-instance":p.unref(at),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const W2={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"};Ag._date.override({_id:"date-fns",formats:function(){return W2},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=At(n):e==="string"&&(typeof t=="string"?n=jT(n,t,new Date,this.options):n=bp(n,this.options)),Rc(n)?n.getTime():null},format:function(n,t){return da(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Oc(n,t);case"second":return W1(n,t);case"minute":return U1(n,t);case"hour":return B1(n,t);case"day":return ca(n,t);case"week":return V1(n,t);case"month":return Cc(n,t);case"quarter":return H1(n,t);case"year":return $1(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ec(n,t);case"second":return Q1(n,t);case"minute":return K1(n,t);case"hour":return G1(n,t);case"day":return Zh(n,t);case"week":return J1(n,t);case"month":return ep(n,t);case"quarter":return Z1(n,t);case"year":return tS(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return ZT(n);case"minute":return XT(n);case"hour":return KT(n);case"day":return Ac(n);case"week":return Wn(n);case"isoWeek":return Wn(n,{weekStartsOn:+e});case"month":return nS(n);case"quarter":return eS(n);case"year":return np(n);default:return n}},endOf:function(n,t){switch(t){case"second":return lS(n);case"minute":return oS(n);case"hour":return rS(n);case"day":return Jh(n);case"week":return sS(n);case"month":return tp(n);case"quarter":return aS(n);case"year":return iS(n);default:return n}}});const v_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},V2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...v_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},$2=p.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function es(n){return p.isProxy(n)?p.toRaw(n):n}function Y2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function q2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function S_(n,t){n.labels=t}function T_(n,t,e){const i=[];n.datasets=t.map(r=>{const s=n.datasets.find(a=>a[e]===r[e]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function j2(n,t){const e={labels:[],datasets:[]};return S_(e,n.labels),T_(e,n.datasets,t),e}const G2=p.defineComponent({props:V2,setup(n,t){let{expose:e,slots:i}=t;const r=p.ref(null),s=p.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:h,options:g,plugins:m,datasetIdKey:_}=n,x=j2(h,_),v=Y2(x,h);s.value=new rn(r.value,{type:d,data:v,options:{...g},plugins:m})},l=()=>{const d=p.toRaw(s.value);d&&(n.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},n.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(n.updateMode)};return p.onMounted(a),p.onUnmounted(l),p.watch([()=>n.options,()=>n.data],(d,h)=>{let[g,m]=d,[_,x]=h;const v=p.toRaw(s.value);if(!v)return;let S=!1;if(g){const C=es(g),R=es(_);C&&C!==R&&(q2(v,C),S=!0)}if(m){const C=es(m.labels),R=es(x.labels),B=es(m.datasets),P=es(x.datasets);C!==R&&(S_(v.config.data,C),S=!0),B&&B!==P&&(T_(v.config.data,B,n.datasetIdKey),S=!0)}S&&p.nextTick(()=>{u(v)})},{deep:!0}),()=>p.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[p.h("p",{},[i.default?i.default():""])])}});function dl(n,t){return rn.register(t),p.defineComponent({props:v_,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=p.shallowRef(null);p.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>p.h(G2,$2({ref:l},{type:n,...e}))}})}const M_=dl("bar",kg),k_=dl("doughnut",Zs),D_=dl("line",Dg),K2=dl("scatter",Og),X2={class:"chart-container"},Z2={key:0,class:"chart-center-metric"},Q2={class:"chart-center-total"},J2={key:0,class:"chart-center-unit"},tI=p.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Pe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>ai},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),{i18n:i}=kt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=p.ref([]),l=p.useTemplateRef("chartParent"),u=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:h}=kt.useTooltipAbsolutePosition(l,u),g={id:r,afterUpdate(N){a.value=N.options.plugins.legend.labels.generateLabels(N).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},m=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((T,M)=>(T.labels.push(M.label),T.backgroundColor.push(M.backgroundColor),T.hoverBorderColor.push(Ta(M.backgroundColor).saturate(.5).darken(.15).hexString()),T.data.push(M.data.reduce((O,z)=>O+z,0)),T),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=er({i18n:i}),v=p.computed(()=>_E(t.metricName??"")),S=p.computed(()=>{const N=_.value[0]?.data.reduce((T,M)=>T+M,0)??0;return x(N,t.metricUnit,{approximate:!0,translateUnit:(T,M)=>e(T,M)}).trim()}),C=p.computed(()=>t.tooltipMetricDisplay||""),R=p.computed(()=>({...t.chartData,datasets:_.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const{options:B}=kt.useDonutChartOptions({tooltipState:u,legendID:r}),P=p.ref(),L=N=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[N],I=({width:N,height:T})=>{u.width=N,u.height=T};return(N,T)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",X2,[p.createVNode(p.unref(k_),{ref_key:"chartInstance",ref:P,"chart-id":p.unref(s),data:R.value,options:p.unref(B),plugins:m.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&v.value?(p.openBlock(),p.createElementBlock("div",Z2,[p.createElementVNode("span",Q2,p.toDisplayString(S.value),1),C.value?(p.openBlock(),p.createElementBlock("span",J2,p.toDisplayString(C.value),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(wo,{"absolute-left":p.unref(d),"absolute-top":p.unref(h),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:I},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),p.createVNode(ul,{id:p.unref(r),"chart-instance":P.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),eI=an(tI,[["__scopeId","data-v-48b16272"]]);class nI{id="outlierBandPlugin";beforeDatasetsDraw(t,e,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 g=t.ctx;g.save(),g.fillStyle=i.color,g.fillRect(u,a,d-u,h-a),g.restore()}}const iI={class:"chart-container"},rI=an(p.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},granularity:{},timeRangeMs:{default:void 0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1}},setup(n){const t=n,e=p.inject("legendPosition",Pe.Bottom),i=p.inject("app:konnectColorMode",p.computed(()=>"light")),{translateUnit:r}=kt.useTranslatedUnits(),s=p.useTemplateRef("chartParent"),a=new nI,l=crypto.randomUUID(),u=crypto.randomUUID(),d=p.ref(Ja()),h=p.ref(),g=p.ref([]),m=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:r,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:u,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=kt.useTooltipAbsolutePosition(s,m);kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{d.value=Ja(s.value)}),p.watch(i,()=>{d.value=Ja(s.value)});const v=p.computed(()=>{const I=t.legendValues;if(!I)return;const N={};for(const{label:T,total:M}of t.chartData?.datasets||[])M!==void 0&&T&&T in I&&(N[T]=I[T]);return N}),S={id:l,afterUpdate(I){g.value=Ou(I,v.value,t.chartLegendSortFn)}},C=p.computed(()=>t.shadeOutlierRegion?t.chartData?.outlierValue:void 0),R=p.computed(()=>[S,...C.value!==void 0?[a]:[]]),B=p.computed(()=>`scatter-${R.value.map(I=>I.id).join("-")}`),{options:P}=kt.useScatterChartOptions({tooltipState:m,legendID:l,granularity:p.toRef(t,"granularity"),timeRangeMs:p.toRef(t,"timeRangeMs"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),outlierValue:C,themeColors:d}),L=I=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[I];return(I,N)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(p.unref(e))]),"data-testid":"scatter-chart-parent"},[p.createElementVNode("div",iI,[(p.openBlock(),p.createBlock(p.unref(K2),{key:B.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(u),class:"chart-canvas",data:n.chartData,"data-testid":"scatter-chart",options:p.unref(P),plugins:R.value},null,8,["chart-id","data","options","plugins"]))]),p.createVNode(wo,{"absolute-left":p.unref(_),"absolute-top":p.unref(x),"data-testid":"tooltip",granularity:n.granularity,state:m,"tooltip-title":n.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),p.createVNode(ul,{id:p.unref(l),"chart-instance":h.value,"data-testid":"legend",items:g.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-2f7608cd"]]),cd=(n,t,e,i,r="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=r,n.stroke(),n.restore()},Ze={},sI=()=>{Ze.x=void 0,Ze.chart=void 0,Ze.strategy=void 0,Ze.group=void 0},oI=10;class C_{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){let r=!1;e==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<oI)return;const r=()=>{Ze.chart=e,Ze.strategy=this._brushStrategy,Ze.group=this._brushGroup;for(const s of Object.values(rn.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Ze.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Ze.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:r}=t.tooltip.dataPoints[0].element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Ze.x===void 0)return;const e=Ze.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Ze.group===this._brushGroup&&cd(t.ctx,Ze.x,t.scales.y.top,t.scales.y.bottom,e)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Ze.chart===t){const e=Ze.x!==void 0;if(sI(),e)for(const i of Object.values(rn.instances))i!==t&&i.update("none")}}}const aI=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},lI=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},O_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},A_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class cI{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 e=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=O_(t,this);d&&A_("dragSelectMove",t,d)}},a=l=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=O_(t,this);d?A_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(lI(t,this._startX,this._endX),aI(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const uI=20,dI="rgba(255, 171, 171, 0.4)",fI="rgba(255, 196, 0, 0.2)",R_=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const r=(e-n.y)/i;return n.x+r*(t.x-n.x)},hI=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const s=i.data;s?.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const l=s.map(d=>({ts:d.x,aboveThreshold:d.y>=a.value}));let u=l[0].aboveThreshold?s[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?u=R_(s[d-1],s[d],a.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:R_(s[d-1],s[d],a.value),type:a.type}),u=void 0);u!==void 0&&e.push({start:u,end:l[l.length-1].ts,type:a.type})})}),e},pI=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:r})=>r===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class gI{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const e of Object.keys(t.threshold||{})){const i=t.threshold?.[e];i&&(this._thresholds={...this._thresholds,[e]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const e of Object.keys(this._thresholds))t.threshold?.[e]||delete this._thresholds[e]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=t.scales.y,d=r.getBoundingClientRect(),h=u.getValueForPixel(l-d.top);if(h)for(const g of Object.keys(this._thresholds||{})){const m=this._thresholds?.[g];m&&m.forEach(_=>{_.hovered=Math.abs(_.value-h)<uI})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,e){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){s.forEach(u=>{const h=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Eu(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";u.label?g=`${u.label}: ${u.value}`:u.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:u.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Eu(u.type),i.font=gv,i.fillText(g,t.chartArea.left,h-4),i.restore())});const a=hI(t,s);pI(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),h=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?dI:fI,i.fillRect(d,t.chartArea.top,h-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Eu(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const mI=an(p.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=kt.useI18n(),s=new C_,a=new x_,l=new cI,u=new gI(r),{translateUnit:d}=kt.useTranslatedUnits(),h=p.ref(),g=crypto.randomUUID(),m=crypto.randomUUID(),_=p.ref([]),x=p.inject("legendPosition",Pe.Bottom),v=p.useTemplateRef("chartParent"),S=p.ref(void 0),C=p.ref(!1),R=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:m,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:B,tooltipAbsoluteTop:P}=kt.useTooltipAbsolutePosition(v,R),L={id:g,afterUpdate(H){_.value=Ou(H,e.legendValues,e.chartLegendSortFn)}},I=p.computed(()=>[L,a,...e.brush?[l]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),N=p.computed(()=>`line-${I.value.map(H=>H.id).join("-")}`),T=p.computed(()=>`bar-${I.value.map(H=>H.id).join("-")}`),M=p.computed(()=>e.chartData&&vR(e.chartData)),{options:O}=kt.useLineChartOptions({tooltipState:R,timeRangeMs:p.toRef(e,"timeRangeMs"),granularity:p.toRef(e,"granularity"),legendID:g,stacked:p.toRef(e,"stacked"),metricAxesTitle:p.toRef(e,"metricAxesTitle"),dimensionAxesTitle:p.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:M,threshold:p.toRef(e,"threshold")});kt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const z=H=>H?H.end.getTime()>H.start.getTime():!1,W=H=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[H],it=({width:H,height:q})=>{R.width=H,R.height=q},ut=(H=!0)=>{R.interactionMode="idle",R.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},ft=()=>{R.interactionMode="interactive"},j=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(R.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},tt=()=>{if(C.value){C.value=!1;return}R.interactionMode!=="idle"?ut():ft(),j()};p.watch(()=>e.type,()=>{R.interactionMode="idle",R.showTooltip=!1,s.destroyClickedSegment()});const nt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:q,xEnd:X}=H.detail,_t={start:new Date(q),end:new Date(X),type:"absolute"};if(!z(_t)){S.value=void 0,ut(!1);return}S.value=_t,R.interactionMode="zoom-interactive",_t&&i("select-chart-range",_t)},et=H=>{R.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:q,xEnd:X}=H.detail;S.value={start:new Date(q),end:new Date(X),type:"absolute"}},at=H=>{if(!v.value||R.interactionMode==="idle")return;const q=H.target;q&&v.value.contains(q)||C.value||ut(!1)};return p.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",nt),h.value.chart.canvas.removeEventListener("dragSelectMove",et),h.value.chart.canvas.addEventListener("dragSelect",nt),h.value.chart.canvas.addEventListener("dragSelectMove",et))}),p.onMounted(()=>{document.addEventListener("click",at,!0)}),p.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",nt),h.value.chart.canvas.removeEventListener("dragSelectMove",et)),document.removeEventListener("click",at,!0)}),(H,q)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",W(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:q[0]||(q[0]=X=>tt())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(D_),{key:N.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:p.unref(O),plugins:I.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(M_),{key:T.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:p.unref(O),plugins:I.value},null,8,["chart-id","data","options","plugins"])):p.createCommentVNode("",!0)]),p.createVNode(wo,{"absolute-left":p.unref(B),"absolute-top":p.unref(P),"data-testid":"tooltip",granularity:n.granularity,state:R,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":S.value,onDimensions:it,onOnAction:q[1]||(q[1]=()=>ut(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),p.createVNode(ul,{id:p.unref(g),"chart-instance":h.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-399f4923"]]),yI={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},_I={class:"tooltip-content"},bI={key:2,class:"analytics-chart-parent"},xI=7,wI=p.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Pe.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(n,{emit:t}){const e=t,i=n,{i18n:r}=kt.useI18n(),s=p.computed(()=>tl(i.chartData)?void 0:i.chartData),a=p.computed(()=>{const G=s.value?.meta,$=G?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&$.length>1&&Object.keys(G?.display??{}).length>0?$:[]}),l=p.computed(()=>a.value.length>1),u=p.computed(()=>i.activeMetric&&a.value.includes(i.activeMetric)?i.activeMetric:a.value[0]),d=p.computed(()=>{const G=s.value;return!G||!l.value||!u.value?G:{...G,meta:{...G.meta,metric_names:[u.value]}}}),h=p.computed(()=>{const G=i.chartOptions.threshold;return!l.value||!G?G:{...G,...Object.fromEntries(Object.keys(G).filter($=>$!==u.value).map($=>[$,[]]))}}),g=p.computed(()=>{if(O.value)return tl(i.chartData)?i.chartData:Ty(i.chartData)}),m=p.computed(()=>{if(tl(i.chartData)){const{start:$,end:st,metric:ot,metricUnit:lt,truncated:pt,limit:dt,datasource:It}=i.chartData;return{start:$,end:st,metricNames:[ot],metricUnits:{[ot]:lt??""},truncated:pt,limit:dt,datasource:It}}const G=d.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}}),_=p.computed(()=>O.value?kt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter},g).value:s.value?T.value?kt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Iu},d).value:kt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Iu},s).value:{datasets:[]}),x=p.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),v=p.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:$}=m.value;if(G&&$)return new Date($).getTime()-new Date(G).getTime()}),S=p.computed(()=>m.value.metricUnits?l.value&&u.value?m.value.metricUnits[u.value]??"":Object.values(m.value.metricUnits)[0]??"":""),C=p.computed(()=>m.value.metricUnits?l.value&&u.value?u.value:Object.keys(m.value.metricUnits)[0]??"":""),R=p.computed(()=>i.showLegendValues&&i.legendPosition!==Pe.Hidden),{legendValues:B}=kt.useChartLegendValues(_,i.chartOptions.type,S),P=p.computed(()=>m.value.limit?.toString()||null),L=p.computed(()=>i.chartOptions.hideTruncationWarning?!1:m.value.truncated||!1),I=p.computed(()=>r.t("limitedResultsShown",{maxReturned:P.value})),N=p.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),T=p.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),M=p.computed(()=>i.chartOptions.type==="donut"),O=p.computed(()=>i.chartOptions.type==="scatter"),z=p.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),W=p.computed(()=>{const{metricNames:G,metricUnits:$}=m.value;if(!G||!$)return;const st=G[0],ot=$[st]||"";if(G.length>1){if(st.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})});if(st.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})}if(st)return po(ot)&&r.te(`metricAxisTitles.${st}`)?r.t(`metricAxisTitles.${st}`)||void 0:r.te(`chartLabels.${st}`)?r.t(`chartLabels.${st}`):st}),it=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;const{metricNames:G,metricUnits:$}=m.value;if(!G||!$)return;const st=G[0],ot=$[st]||"";if(G.length>1){if(st.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})});if(st.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})}return r.te(`metricAxisTitles.${st}`)&&(po(ot)||r.te(`chartUnits.${ot}`))?po(ot)?r.t(`metricAxisTitles.${st}`)||void 0:r.t(`metricAxisTitles.${st}`,{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})||void 0:st||void 0}),ut=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,$=T.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if($)return r.te(`chartLabels.${$}`)?r.t(`chartLabels.${$}`):$}),ft=p.computed(()=>O.value?H.value:ia(Number(s.value?.meta?.granularity_ms))),j=p.computed(()=>{if(nx(m.value.datasource))return r.t("timestampAxisTitles.platform");const G=ft.value;if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),tt=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),nt=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),et=p.computed(()=>O.value?!!g.value?.points.length:T.value?SR(_.value):!!(s.value&&s.value.meta&&s.value.data.length)),at=p.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?ia(G.meta.granularity_ms)||"hourly":ia(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),H=p.computed(()=>ia(Math.floor((v.value||0)/xI))||"hourly"),q=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,$)=>G.text===r.t("chartLabels.____OTHER____")?1:$.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt($.text,10))?G.text<$.text?-1:1:G.value&&$.value?$.value.raw-G.value.raw:0),X=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,$)=>G.label===r.t("chartLabels.____OTHER____")?1:$.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt($.label,10))?G.label<$.label?-1:1:G.value&&$.value?$.rawValue-G.rawValue:0),_t=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>e("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 p.provide("showLegendValues",R),p.provide("legendPosition",p.toRef(i,"legendPosition")),(G,$)=>{const st=p.resolveComponent("KTooltip"),ot=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":R.value}])},[et.value&&L.value&&P.value?(p.openBlock(),p.createElementBlock("div",yI,[p.createVNode(st,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",_I,p.toDisplayString(I.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ts.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(hv)})`,size:`var(--kui-icon-size-40, ${p.unref(mv)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),et.value?(p.openBlock(),p.createElementBlock("div",bI,[T.value?(p.openBlock(),p.createBlock(mI,{key:0,brush:x.value,"chart-data":_.value,"chart-legend-sort-fn":q.value,"chart-tooltip-sort-fn":X.value,"dimension-axes-title":j.value,fill:n.chartOptions.stacked,granularity:at.value,"legend-values":p.unref(B),"metric-axes-title":it.value,"metric-unit":S.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:h.value,"time-range-ms":v.value,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":_t.value,onSelectChartRange:$[0]||($[0]=lt=>e("select-chart-range",lt)),onZoomTimeRange:$[1]||($[1]=lt=>e("zoom-time-range",lt))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):N.value?(p.openBlock(),p.createBlock(H2,{key:1,annotations:n.showAnnotations,"chart-data":_.value,"chart-legend-sort-fn":q.value,"chart-tooltip-sort-fn":X.value,"data-testid":"bar-chart-container","dimension-axes-title":ut.value,"legend-values":p.unref(B),"metric-axes-title":it.value,"metric-unit":S.value,orientation:z.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):M.value?(p.openBlock(),p.createBlock(eI,{key:2,"chart-data":_.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(Iu),"legend-position":n.legendPosition,"legend-values":p.unref(B),"metric-name":C.value,"metric-unit":S.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":ut.value,"tooltip-metric-display":W.value,"tooltip-title":n.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"])):O.value?(p.openBlock(),p.createBlock(rI,{key:3,"chart-data":_.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":X.value,"data-testid":"scatter-chart-container","dimension-axes-title":j.value,granularity:H.value,"legend-values":p.unref(B),"metric-axes-title":it.value,"metric-unit":S.value,"shade-outlier-region":n.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":v.value,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","legend-values","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(ot,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(tt.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(nt.value),1)]),_:1}))],2)}}}),vI=an(wI,[["__scopeId","data-v-b0e3abb5"]]),SI={class:"chart-parent","data-testid":"gauge-chart-parent"},TI={class:"chart-totals-flex"},MI={key:1,class:"metric-small","data-testid":"gauge-chart-total"},kI=an(p.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:ai},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(ld()),r=p.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=p.computed(()=>({...t.chartData,datasets:r.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=p.computed(()=>lo(r?.value[0]?.data[t.numerator],{capital:!0})),u=p.computed(()=>lo(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=p.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),h=p.computed(()=>["full","single"].includes(t.metricDisplay)),g=p.computed(()=>t.metricDisplay==="full");return(m,_)=>(p.openBlock(),p.createElementBlock("div",SI,[p.createElementVNode("div",TI,[h.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:p.normalizeStyle(d.value)},p.toDisplayString(l.value),5)):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createElementBlock("div",MI,p.toDisplayString(p.unref(e).t("total"))+": "+p.toDisplayString(u.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",{class:"chart-container",style:p.normalizeStyle({height:n.height,width:n.width})},[p.createVNode(p.unref(k_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),DI={key:1,class:"single-value-wrapper"},CI={class:"single-value-metric"},OI={class:"name-unit-alignment"},AI={class:"single-value","data-testid":"single-value-chart"},RI={key:0,class:"single-value-unit"},EI={class:"single-value-metric-name"},PI={key:0,class:"single-value-trend"},II={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},ud="t1",dd="t2",LI=an(p.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Gm},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(n){const{i18n:t}=kt.useI18n(),{formatBytes:e,formatCost:i}=er({i18n:t}),r=n,s=p.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=p.computed(()=>Qi.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:ud,secondLevelKey:dd})),l=p.computed(()=>a.value?.previous?.[ud]?.[dd]),u=p.computed(()=>a.value?.current?.[ud]?.[dd]),d=p.computed(()=>r.data.data),h=p.computed(()=>r.data.meta?.metric_names?.[0]),g=p.computed(()=>t.te(`chartLabels.${h.value}`)?t.t(`chartLabels.${h.value}`):""),m=p.computed(()=>{const O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const z=`chartUnits.${O}`;return t.te(z)?t.t(z,{plural:""}):""}}),_=p.computed(()=>!!h.value&&(h.value.includes("_per_minute")||h.value.includes("_latency_")||h.value==="error_rate")),x=p.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),v=p.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=p.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=p.computed(()=>{const O=v.value;if(O===null)return"-";const z=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(z==="usd")return i(O);if(z==="bytes")return e(O);if(O>=1e9){const it=(O/1e9).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${it}B`}if(O>=1e7){const it=(O/1e6).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${it}M`}const W=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:Gm;return O.toLocaleString("en-US",{maximumFractionDigits:W})}),R=p.computed(()=>r.showTrend&&r.data?.data?.length<2),B=p.computed(()=>Qi.calculateChange(v.value??0,x.value??0)||0),P=p.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 Qi.changePolarity(B.value,!0,r.increaseIsBad)}),L=p.computed(()=>Qi.defineIcon(P.value,r.increaseIsBad)),I=p.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 Qi.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Qi.metricChange(B.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),N=Qi.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),T=O=>O>0?"positive":O<0?"negative":"neutral",M=O=>O>0?fv:O<0?dv:qh;return p.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,z)=>{const W=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[S.value?(p.openBlock(),p.createBlock(W,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:p.unref(t).t("singleValue.valueError")},null,8,["title"])):(p.openBlock(),p.createElementBlock("div",DI,[p.createElementVNode("div",CI,[p.createElementVNode("div",OI,[p.createElementVNode("span",AI,p.toDisplayString(C.value),1),_.value&&m.value?(p.openBlock(),p.createElementBlock("span",RI,"  "+p.toDisplayString(m.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",EI,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",PI,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",T(P.value)]),"data-testid":"single-value-trend"},[R.value||P.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(L.value),{key:0,color:M(P.value),size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])):(p.openBlock(),p.createBlock(p.unref(Ts.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${p.unref(qh)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])),p.createElementVNode("div",null,p.toDisplayString(I.value),1)],2),p.unref(N)?(p.openBlock(),p.createElementBlock("div",II,p.toDisplayString(p.unref(N)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-58f32282"]]),NI={class:"simple-chart-shell"},BI={key:1,class:"analytics-chart-parent"},FI=an(p.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.computed(()=>{const d=kt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||ai},p.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=p.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=p.computed(()=>t.chartOptions.type==="gauge"),a=p.computed(()=>t.chartOptions.type==="single_value"),l=p.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=p.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 g=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",NI,[u.value?(p.openBlock(),p.createElementBlock("div",BI,[s.value?(p.openBlock(),p.createBlock(kI,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):p.createCommentVNode("",!0),a.value?(p.openBlock(),p.createBlock(LI,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(g,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),zI={class:"top-n-card-title","data-testid":"top-n-card-title"},UI={class:"top-n-card-description","data-testid":"top-n-card-description"},HI={key:3,class:"top-n-table","data-testid":"top-n-table"},WI={"data-testid":"top-n-table-header"},VI={class:"top-n-table-header-row"},$I={class:"table-header-label"},YI=["data-testid"],qI=["data-testid"],jI=["data-testid"],GI=3,KI=an(p.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{formatUnit:i}=er({i18n:e}),r=p.computed(()=>t.data.data),s=p.computed(()=>!!r.value?.length),a=p.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,GI):[]),l=p.computed(()=>a.value[0]||""),u=p.computed(()=>a.value.length>1),d=p.computed(()=>a.value[a.value.length-1]||""),h=p.computed(()=>l.value?t.data.meta.display[l.value]:{}),g=p.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),m=p.computed(()=>g.value[0]),_=p.computed(()=>m.value?ut(m.value):""),x=p.computed(()=>{const j=a.value.map(tt=>({key:tt,label:u.value?ut(tt):e.t("topNTable.nameLabel"),type:"dimension"}));return m.value&&j.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((tt,nt)=>{nt!==0&&j.push({key:tt,label:ut(tt),type:"metric"})}),j}),v=p.computed(()=>x.value.filter(j=>j.type==="metric")),S=p.computed(()=>x.value.filter(j=>j.type==="dimension").slice(1)),C=j=>j.type==="dimension"&&j.key===d.value,R=j=>u.value&&j.type==="dimension"&&!C(j),B=j=>{const tt=j.event;return String(tt[l.value])},P=(j,tt)=>{const nt=String(j.event[tt]),et=t.data.meta?.display?.[tt]?.[nt];return{dimension:tt,id:nt,name:et?.name||"-",deleted:!!et?.deleted}},L=j=>{const tt=B(j),nt=h.value&&h.value[tt];return nt?nt.name:"-"},I=j=>{const tt=B(j),nt=h.value&&h.value[tt];return nt?!!nt.deleted:!1},N=(j,tt)=>{const nt=j.event[tt];if(nt==null)return"–";const et=typeof nt=="number"?nt:Number(nt);if(Number.isNaN(et))return"–";const at=t.data.meta?.metric_units?.[tt]||"count",H=["count","count/minute","token count"].includes(at);return i(et,at,{approximate:H,isBytes1024:!0,translateUnit:q=>ft(q,et)})},T=j=>m.value?N(j,m.value):"–",M=p.computed(()=>r.value?.length?r.value.map(j=>{const tt=a.value.map(H=>P(j,H)),nt=tt[0],et=nt?.id||B(j),at={id:et,rowKey:tt.map(H=>`${H.dimension}:${H.id}`).join("|")||et,name:nt?.name||L(j),deleted:I(j),dimensions:tt,original:j};return m.value&&(at.value=T(j)),g.value.forEach((H,q)=>{q!==0&&(at[H]=N(j,H))}),at}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(j=>!Object.keys(t.data.meta.display[j]||{}).length))return e.t("topNTable.errors.display");if(!m.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),z=(j,tt)=>{const nt=j[tt];return typeof nt=="string"?nt:nt==null?"–":String(nt)},W=(j,tt)=>j.dimensions.find(nt=>nt.dimension===tt)?.name||"–",it=(j,tt)=>{const nt=j.dimensions.find(et=>et.dimension===tt);return{id:nt?.id||"",name:nt?.name||"–",deleted:nt?.deleted||!1,dimension:tt,dimensions:j.dimensions,isEmpty:nt?.id==="empty"}},ut=j=>e.te(`chartLabels.${j}`)?e.t(`chartLabels.${j}`):j,ft=(j,tt)=>{if(po(j)||j==="count"||j==="requests")return"";const nt=tt===1?"":"s";return e.te(`chartUnits.${j}`)?e.t(`chartUnits.${j}`,{plural:nt}):j};return(j,tt)=>{const nt=p.resolveComponent("KEmptyState"),et=p.resolveComponent("KSkeleton"),at=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(at,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(nt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(et,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",HI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",WI,[p.createElementVNode("tr",VI,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(x.value,H=>(p.openBlock(),p.createElementBlock("th",{key:H.key,class:p.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":H.type==="metric","top-n-table-header-cell-dimension-compact":R(H)}]),"data-testid":"top-n-table-header-column"},[p.createElementVNode("span",$I,p.toDisplayString(H.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(M.value,H=>(p.openBlock(),p.createElementBlock("tr",{key:H.rowKey,class:"top-n-table-row"},[a.value.length?(p.openBlock(),p.createElementBlock("td",{key:0,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[p.createElementVNode("span",{"data-testid":`row-${H.id}`},[p.renderSlot(j.$slots,"name",{record:{id:H.id,name:H.name,deleted:H.deleted,dimension:l.value,dimensions:H.dimensions,isEmpty:H.id==="empty"}},()=>[p.createTextVNode(p.toDisplayString(H.name),1)],!0)],8,YI)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(S.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(q)}])},[p.renderSlot(j.$slots,"name",{record:it(H,q.key)},()=>[p.createTextVNode(p.toDisplayString(W(H,q.key)),1)],!0)],2))),128)),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(v.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:"top-n-table-cell top-n-table-cell-metric"},[q.key==="value"?(p.openBlock(),p.createElementBlock("span",{key:0,"data-testid":`row-${H.id}`},p.toDisplayString(z(H,q.key)),9,qI)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${H.id}-${q.key}`},p.toDisplayString(z(H,q.key)),9,jI))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(nt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",zI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",UI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-0dc897d6"]]),XI={class:"container"},ZI={key:0,class:"no-data","data-testid":"sparkline-empty"},QI=["title"],JI=an(p.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=kt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=kt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),h=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),g=({width:N,height:T})=>{h.width=N,h.height=T},m=p.computed(()=>n.disableTooltip?[]:[new C_({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((N,{data:T,label:M})=>({...N,[M]:T.reduce((O,{y:z})=>O+z,0)}),{})),x=p.computed(()=>d.value.map(({label:N})=>[_.value[N],`${N}: ${_.value[N]}`]).sort(([N],[T])=>T-N).map(([,N])=>N).join(", ")),v=p.computed(()=>Object.keys(_.value).map(N=>_.value[N]).reduce((N,T)=>N+T,0)),S=p.computed(()=>v.value>0),C=p.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),R=p.computed(()=>n.datasets.length>1),B=`SparklineTooltipPosition-${t}`,P=p.computed(()=>{const N=n.type==="sparkline_bar",T=N?r.value-1:r.value,M=N?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:N?0:2,right:N?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:B,external:O=>{Cu(h,O,"minutely",{contextFormatter:z=>{const W=z+i.value;let it="";return i.value>1440*60*1e3?it=da(new Date(W),"MMM dd, yyy hh:mm a"):it=da(new Date(W),"hh:mm a"),`${jw(z)} - ${it}`}})}}},scales:{x:{min:T,max:M,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:R.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:R.value}}}}),L=p.ref("0"),I=p.ref("0");return p.onMounted(()=>{$e.positioners[B]=function(N,T){if(!N.length||h.interactionMode==="interactive"||T.x===null)return!1;const M=10,O=this.chart.canvas.getBoundingClientRect(),z=h.width||this.width,W=h.height||this.height,it=O.top-W>0,ut=it?O.top-W-M:O.top+O.height+M,ft=O.left>z/2-T.x,j=Math.max(M,window.innerWidth-M-z),tt=Math.min(j,ft?Math.floor(O.left-z/2)+T.x:0+M);return L.value=`${ut}px`,I.value=`${tt}px`,{x:tt,y:ut,xAlign:"center",yAlign:it?"top":"bottom"}}}),p.onUnmounted(()=>{$e.positioners[B]&&delete $e.positioners[B]}),(N,T)=>(p.openBlock(),p.createElementBlock("div",XI,[S.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(M_),{key:1,"chart-id":p.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.value,plugins:m.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(p.openBlock(),p.createBlock(p.unref(D_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:m.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",ZI,[p.renderSlot(N.$slots,"empty",{},()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(wo,{key:3,"absolute-left":I.value,"absolute-top":L.value,class:"tooltip","data-testid":"sparkline-tooltip",state:h,"tooltip-title":n.tooltipTitle,onDimensions:g},null,8,["absolute-left","absolute-top","state","tooltip-title"])),S.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:N.$slots.label?"":x.value},[p.renderSlot(N.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,QI)):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vo={exports:{}};var tL=vo.exports,E_;function eL(){return E_||(E_=1,(function(n,t){(function(){var e,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,g="__lodash_placeholder__",m=1,_=2,x=4,v=1,S=2,C=1,R=2,B=4,P=8,L=16,I=32,N=64,T=128,M=256,O=512,z=30,W="...",it=800,ut=16,ft=1,j=2,tt=3,nt=1/0,et=9007199254740991,at=17976931348623157e292,H=NaN,q=4294967295,X=q-1,_t=q>>>1,G=[["ary",T],["bind",C],["bindKey",R],["curry",P],["curryRight",L],["flip",O],["partial",I],["partialRight",N],["rearg",M]],$="[object Arguments]",st="[object Array]",ot="[object AsyncFunction]",lt="[object Boolean]",pt="[object Date]",dt="[object DOMException]",It="[object Error]",zt="[object Function]",vt="[object GeneratorFunction]",Ct="[object Map]",Dt="[object Number]",ve="[object Null]",bt="[object Object]",jt="[object Promise]",Oe="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",ln="[object String]",Vt="[object Symbol]",Le="[object Undefined]",ie="[object WeakMap]",Se="[object WeakSet]",Re="[object ArrayBuffer]",gn="[object DataView]",zi="[object Float32Array]",Dn="[object Float64Array]",Ye="[object Int8Array]",In="[object Int16Array]",ci="[object Int32Array]",So="[object Uint8Array]",To="[object Uint8ClampedArray]",br="[object Uint16Array]",ui="[object Uint32Array]",Mo=/\b__p \+= '';/g,ko=/\b(__p \+=) '' \+/g,Do=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,pl=/[&<>"']/g,fd=RegExp(Ui.source),hd=RegExp(pl.source),pd=/<%-([\s\S]+?)%>/g,gd=/<%([\s\S]+?)%>/g,Co=/<%=([\s\S]+?)%>/g,gl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,di=/^\w*$/,md=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oo=/[\\^$.*+?()[\]{}|]/g,yd=RegExp(Oo.source),Ao=/^\s+/,_d=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bd=/\{\n\/\* \[wrapped with (.+)\] \*/,xd=/,? & /,wd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ml=/[()=,{}\[\]\/\s]/,vd=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yl=/\w*$/,Sd=/^[-+]0x[0-9a-f]+$/i,Td=/^0b[01]+$/i,Md=/^\[object .+?Constructor\]$/,kd=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,Dd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ns=/($^)/,Cd=/['\n\r\u2028\u2029\\]/g,is="\\ud800-\\udfff",Od="\\u0300-\\u036f",Ad="\\ufe20-\\ufe2f",_l="\\u20d0-\\u20ff",xr=Od+Ad+_l,bl="\\u2700-\\u27bf",rs="a-z\\xdf-\\xf6\\xf8-\\xff",Rd="\\xac\\xb1\\xd7\\xf7",Ed="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Pd="\\u2000-\\u206f",Id=" \\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",xl="A-Z\\xc0-\\xd6\\xd8-\\xde",wl="\\ufe0e\\ufe0f",ss=Rd+Ed+Pd+Id,Ro="['’]",Ld="["+is+"]",vl="["+ss+"]",os="["+xr+"]",Sl="\\d+",Nd="["+bl+"]",Tl="["+rs+"]",Eo="[^"+is+ss+Sl+bl+rs+xl+"]",Po="\\ud83c[\\udffb-\\udfff]",Bd="(?:"+os+"|"+Po+")",wr="[^"+is+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",as="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+xl+"]",Ml="\\u200d",kl="(?:"+Tl+"|"+Eo+")",Fd="(?:"+cn+"|"+Eo+")",Dl="(?:"+Ro+"(?:d|ll|m|re|s|t|ve))?",Cl="(?:"+Ro+"(?:D|LL|M|RE|S|T|VE))?",Ol=Bd+"?",Io="["+wl+"]?",fi="(?:"+Ml+"(?:"+[wr,Gn,as].join("|")+")"+Io+Ol+")*",zd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Al="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rl=Io+Ol+fi,Lo="(?:"+[Nd,Gn,as].join("|")+")"+Rl,El="(?:"+[wr+os+"?",os,Gn,as,Ld].join("|")+")",Ud=RegExp(Ro,"g"),Hd=RegExp(os,"g"),ls=RegExp(Po+"(?="+Po+")|"+El+Rl,"g"),Wd=RegExp([cn+"?"+Tl+"+"+Dl+"(?="+[vl,cn,"$"].join("|")+")",Fd+"+"+Cl+"(?="+[vl,cn+kl,"$"].join("|")+")",cn+"?"+kl+"+"+Dl,cn+"+"+Cl,Al,zd,Sl,Lo].join("|"),"g"),cs=RegExp("["+Ml+is+xr+wl+"]"),Vd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,No=["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"],$d=-1,ee={};ee[zi]=ee[Dn]=ee[Ye]=ee[In]=ee[ci]=ee[So]=ee[To]=ee[br]=ee[ui]=!0,ee[$]=ee[st]=ee[Re]=ee[lt]=ee[gn]=ee[pt]=ee[It]=ee[zt]=ee[Ct]=ee[Dt]=ee[bt]=ee[Ae]=ee[oe]=ee[ln]=ee[ie]=!1;var D={};D[$]=D[st]=D[Re]=D[gn]=D[lt]=D[pt]=D[zi]=D[Dn]=D[Ye]=D[In]=D[ci]=D[Ct]=D[Dt]=D[bt]=D[Ae]=D[oe]=D[ln]=D[Vt]=D[So]=D[To]=D[br]=D[ui]=!0,D[It]=D[zt]=D[ie]=!1;var V={À:"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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},mt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,Nn=parseInt,Ne=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi,Pl=typeof self=="object"&&self&&self.Object===Object&&self,ce=Ne||Pl||Function("return this")(),us=t&&!t.nodeType&&t,Kn=us&&!0&&n&&!n.nodeType&&n,Bo=Kn&&Kn.exports===us,vr=Bo&&Ne.process,Be=(function(){try{var F=Kn&&Kn.require&&Kn.require("util").types;return F||vr&&vr.binding&&vr.binding("util")}catch{}})(),B_=Be&&Be.isArrayBuffer,F_=Be&&Be.isDate,z_=Be&&Be.isMap,U_=Be&&Be.isRegExp,H_=Be&&Be.isSet,W_=Be&&Be.isTypedArray;function mn(F,K,Y){switch(Y.length){case 0:return F.call(K);case 1:return F.call(K,Y[0]);case 2:return F.call(K,Y[0],Y[1]);case 3:return F.call(K,Y[0],Y[1],Y[2])}return F.apply(K,Y)}function gL(F,K,Y,ht){for(var Ot=-1,$t=F==null?0:F.length;++Ot<$t;){var Me=F[Ot];K(ht,Me,Y(Me),F)}return ht}function yn(F,K){for(var Y=-1,ht=F==null?0:F.length;++Y<ht&&K(F[Y],Y,F)!==!1;);return F}function mL(F,K){for(var Y=F==null?0:F.length;Y--&&K(F[Y],Y,F)!==!1;);return F}function V_(F,K){for(var Y=-1,ht=F==null?0:F.length;++Y<ht;)if(!K(F[Y],Y,F))return!1;return!0}function Vi(F,K){for(var Y=-1,ht=F==null?0:F.length,Ot=0,$t=[];++Y<ht;){var Me=F[Y];K(Me,Y,F)&&($t[Ot++]=Me)}return $t}function Il(F,K){var Y=F==null?0:F.length;return!!Y&&ds(F,K,0)>-1}function Yd(F,K,Y){for(var ht=-1,Ot=F==null?0:F.length;++ht<Ot;)if(Y(K,F[ht]))return!0;return!1}function ue(F,K){for(var Y=-1,ht=F==null?0:F.length,Ot=Array(ht);++Y<ht;)Ot[Y]=K(F[Y],Y,F);return Ot}function $i(F,K){for(var Y=-1,ht=K.length,Ot=F.length;++Y<ht;)F[Ot+Y]=K[Y];return F}function qd(F,K,Y,ht){var Ot=-1,$t=F==null?0:F.length;for(ht&&$t&&(Y=F[++Ot]);++Ot<$t;)Y=K(Y,F[Ot],Ot,F);return Y}function yL(F,K,Y,ht){var Ot=F==null?0:F.length;for(ht&&Ot&&(Y=F[--Ot]);Ot--;)Y=K(Y,F[Ot],Ot,F);return Y}function jd(F,K){for(var Y=-1,ht=F==null?0:F.length;++Y<ht;)if(K(F[Y],Y,F))return!0;return!1}var _L=Gd("length");function bL(F){return F.split("")}function xL(F){return F.match(wd)||[]}function $_(F,K,Y){var ht;return Y(F,function(Ot,$t,Me){if(K(Ot,$t,Me))return ht=$t,!1}),ht}function Ll(F,K,Y,ht){for(var Ot=F.length,$t=Y+(ht?1:-1);ht?$t--:++$t<Ot;)if(K(F[$t],$t,F))return $t;return-1}function ds(F,K,Y){return K===K?EL(F,K,Y):Ll(F,Y_,Y)}function wL(F,K,Y,ht){for(var Ot=Y-1,$t=F.length;++Ot<$t;)if(ht(F[Ot],K))return Ot;return-1}function Y_(F){return F!==F}function q_(F,K){var Y=F==null?0:F.length;return Y?Xd(F,K)/Y:H}function Gd(F){return function(K){return K==null?e:K[F]}}function Kd(F){return function(K){return F==null?e:F[K]}}function j_(F,K,Y,ht,Ot){return Ot(F,function($t,Me,ne){Y=ht?(ht=!1,$t):K(Y,$t,Me,ne)}),Y}function vL(F,K){var Y=F.length;for(F.sort(K);Y--;)F[Y]=F[Y].value;return F}function Xd(F,K){for(var Y,ht=-1,Ot=F.length;++ht<Ot;){var $t=K(F[ht]);$t!==e&&(Y=Y===e?$t:Y+$t)}return Y}function Zd(F,K){for(var Y=-1,ht=Array(F);++Y<F;)ht[Y]=K(Y);return ht}function SL(F,K){return ue(K,function(Y){return[Y,F[Y]]})}function G_(F){return F&&F.slice(0,Q_(F)+1).replace(Ao,"")}function _n(F){return function(K){return F(K)}}function Qd(F,K){return ue(K,function(Y){return F[Y]})}function Fo(F,K){return F.has(K)}function K_(F,K){for(var Y=-1,ht=F.length;++Y<ht&&ds(K,F[Y],0)>-1;);return Y}function X_(F,K){for(var Y=F.length;Y--&&ds(K,F[Y],0)>-1;);return Y}function TL(F,K){for(var Y=F.length,ht=0;Y--;)F[Y]===K&&++ht;return ht}var ML=Kd(V),kL=Kd(J);function DL(F){return"\\"+Te[F]}function CL(F,K){return F==null?e:F[K]}function fs(F){return cs.test(F)}function OL(F){return Vd.test(F)}function AL(F){for(var K,Y=[];!(K=F.next()).done;)Y.push(K.value);return Y}function Jd(F){var K=-1,Y=Array(F.size);return F.forEach(function(ht,Ot){Y[++K]=[Ot,ht]}),Y}function Z_(F,K){return function(Y){return F(K(Y))}}function Yi(F,K){for(var Y=-1,ht=F.length,Ot=0,$t=[];++Y<ht;){var Me=F[Y];(Me===K||Me===g)&&(F[Y]=g,$t[Ot++]=Y)}return $t}function Nl(F){var K=-1,Y=Array(F.size);return F.forEach(function(ht){Y[++K]=ht}),Y}function RL(F){var K=-1,Y=Array(F.size);return F.forEach(function(ht){Y[++K]=[ht,ht]}),Y}function EL(F,K,Y){for(var ht=Y-1,Ot=F.length;++ht<Ot;)if(F[ht]===K)return ht;return-1}function PL(F,K,Y){for(var ht=Y+1;ht--;)if(F[ht]===K)return ht;return ht}function hs(F){return fs(F)?LL(F):_L(F)}function Bn(F){return fs(F)?NL(F):bL(F)}function Q_(F){for(var K=F.length;K--&&_d.test(F.charAt(K)););return K}var IL=Kd(mt);function LL(F){for(var K=ls.lastIndex=0;ls.test(F);)++K;return K}function NL(F){return F.match(ls)||[]}function BL(F){return F.match(Wd)||[]}var FL=(function F(K){K=K==null?ce:ps.defaults(ce.Object(),K,ps.pick(ce,No));var Y=K.Array,ht=K.Date,Ot=K.Error,$t=K.Function,Me=K.Math,ne=K.Object,tf=K.RegExp,zL=K.String,Cn=K.TypeError,Bl=Y.prototype,UL=$t.prototype,gs=ne.prototype,Fl=K["__core-js_shared__"],zl=UL.toString,Gt=gs.hasOwnProperty,HL=0,J_=(function(){var o=/[^.]+$/.exec(Fl&&Fl.keys&&Fl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Ul=gs.toString,WL=zl.call(ne),VL=ce._,$L=tf("^"+zl.call(Gt).replace(Oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hl=Bo?K.Buffer:e,qi=K.Symbol,Wl=K.Uint8Array,t0=Hl?Hl.allocUnsafe:e,Vl=Z_(ne.getPrototypeOf,ne),e0=ne.create,n0=gs.propertyIsEnumerable,$l=Bl.splice,i0=qi?qi.isConcatSpreadable:e,zo=qi?qi.iterator:e,Sr=qi?qi.toStringTag:e,Yl=(function(){try{var o=Cr(ne,"defineProperty");return o({},"",{}),o}catch{}})(),YL=K.clearTimeout!==ce.clearTimeout&&K.clearTimeout,qL=ht&&ht.now!==ce.Date.now&&ht.now,jL=K.setTimeout!==ce.setTimeout&&K.setTimeout,ql=Me.ceil,jl=Me.floor,ef=ne.getOwnPropertySymbols,GL=Hl?Hl.isBuffer:e,r0=K.isFinite,KL=Bl.join,XL=Z_(ne.keys,ne),ke=Me.max,je=Me.min,ZL=ht.now,QL=K.parseInt,s0=Me.random,JL=Bl.reverse,nf=Cr(K,"DataView"),Uo=Cr(K,"Map"),rf=Cr(K,"Promise"),ms=Cr(K,"Set"),Ho=Cr(K,"WeakMap"),Wo=Cr(ne,"create"),Gl=Ho&&new Ho,ys={},tN=Or(nf),eN=Or(Uo),nN=Or(rf),iN=Or(ms),rN=Or(Ho),Kl=qi?qi.prototype:e,Vo=Kl?Kl.valueOf:e,o0=Kl?Kl.toString:e;function w(o){if(ge(o)&&!Et(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(Gt.call(o,"__wrapped__"))return ab(o)}return new On(o)}var _s=(function(){function o(){}return function(c){if(!fe(c))return{};if(e0)return e0(c);o.prototype=c;var f=new o;return o.prototype=e,f}})();function Xl(){}function On(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}w.templateSettings={escape:pd,evaluate:gd,interpolate:Co,variable:"",imports:{_:w}},w.prototype=Xl.prototype,w.prototype.constructor=w,On.prototype=_s(Xl.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function sN(){var o=new Ut(this.__wrapped__);return o.__actions__=un(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=un(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=un(this.__views__),o}function oN(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function aN(){var o=this.__wrapped__.value(),c=this.__dir__,f=Et(o),y=c<0,b=f?o.length:0,k=bB(0,b,this.__views__),A=k.start,E=k.end,U=E-A,Z=y?E:A-1,Q=this.__iteratees__,rt=Q.length,ct=0,yt=je(U,this.__takeCount__);if(!f||!y&&b==U&&yt==U)return A0(o,this.__actions__);var Tt=[];t:for(;U--&&ct<yt;){Z+=c;for(var Nt=-1,wt=o[Z];++Nt<rt;){var Ft=Q[Nt],Ht=Ft.iteratee,wn=Ft.type,tn=Ht(wt);if(wn==j)wt=tn;else if(!tn){if(wn==ft)continue t;break t}}Tt[ct++]=wt}return Tt}Ut.prototype=_s(Xl.prototype),Ut.prototype.constructor=Ut;function Tr(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function lN(){this.__data__=Wo?Wo(null):{},this.size=0}function cN(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function uN(o){var c=this.__data__;if(Wo){var f=c[o];return f===d?e:f}return Gt.call(c,o)?c[o]:e}function dN(o){var c=this.__data__;return Wo?c[o]!==e:Gt.call(c,o)}function fN(o,c){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Wo&&c===e?d:c,this}Tr.prototype.clear=lN,Tr.prototype.delete=cN,Tr.prototype.get=uN,Tr.prototype.has=dN,Tr.prototype.set=fN;function hi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function hN(){this.__data__=[],this.size=0}function pN(o){var c=this.__data__,f=Zl(c,o);if(f<0)return!1;var y=c.length-1;return f==y?c.pop():$l.call(c,f,1),--this.size,!0}function gN(o){var c=this.__data__,f=Zl(c,o);return f<0?e:c[f][1]}function mN(o){return Zl(this.__data__,o)>-1}function yN(o,c){var f=this.__data__,y=Zl(f,o);return y<0?(++this.size,f.push([o,c])):f[y][1]=c,this}hi.prototype.clear=hN,hi.prototype.delete=pN,hi.prototype.get=gN,hi.prototype.has=mN,hi.prototype.set=yN;function pi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function _N(){this.size=0,this.__data__={hash:new Tr,map:new(Uo||hi),string:new Tr}}function bN(o){var c=cc(this,o).delete(o);return this.size-=c?1:0,c}function xN(o){return cc(this,o).get(o)}function wN(o){return cc(this,o).has(o)}function vN(o,c){var f=cc(this,o),y=f.size;return f.set(o,c),this.size+=f.size==y?0:1,this}pi.prototype.clear=_N,pi.prototype.delete=bN,pi.prototype.get=xN,pi.prototype.has=wN,pi.prototype.set=vN;function Mr(o){var c=-1,f=o==null?0:o.length;for(this.__data__=new pi;++c<f;)this.add(o[c])}function SN(o){return this.__data__.set(o,d),this}function TN(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=SN,Mr.prototype.has=TN;function Fn(o){var c=this.__data__=new hi(o);this.size=c.size}function MN(){this.__data__=new hi,this.size=0}function kN(o){var c=this.__data__,f=c.delete(o);return this.size=c.size,f}function DN(o){return this.__data__.get(o)}function CN(o){return this.__data__.has(o)}function ON(o,c){var f=this.__data__;if(f instanceof hi){var y=f.__data__;if(!Uo||y.length<r-1)return y.push([o,c]),this.size=++f.size,this;f=this.__data__=new pi(y)}return f.set(o,c),this.size=f.size,this}Fn.prototype.clear=MN,Fn.prototype.delete=kN,Fn.prototype.get=DN,Fn.prototype.has=CN,Fn.prototype.set=ON;function a0(o,c){var f=Et(o),y=!f&&Ar(o),b=!f&&!y&&Zi(o),k=!f&&!y&&!b&&vs(o),A=f||y||b||k,E=A?Zd(o.length,zL):[],U=E.length;for(var Z in o)(c||Gt.call(o,Z))&&!(A&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||k&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||yi(Z,U)))&&E.push(Z);return E}function l0(o){var c=o.length;return c?o[gf(0,c-1)]:e}function AN(o,c){return uc(un(o),kr(c,0,o.length))}function RN(o){return uc(un(o))}function sf(o,c,f){(f!==e&&!Un(o[c],f)||f===e&&!(c in o))&&Xn(o,c,f)}function $o(o,c,f){var y=o[c];(!(Gt.call(o,c)&&Un(y,f))||f===e&&!(c in o))&&Xn(o,c,f)}function Zl(o,c){for(var f=o.length;f--;)if(Un(o[f][0],c))return f;return-1}function EN(o,c,f,y){return ji(o,function(b,k,A){c(y,b,f(b),A)}),y}function c0(o,c){return o&&Qn(c,Ee(c),o)}function PN(o,c){return o&&Qn(c,fn(c),o)}function Xn(o,c,f){c=="__proto__"&&Yl?Yl(o,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[c]=f}function of(o,c){for(var f=-1,y=c.length,b=Y(y),k=o==null;++f<y;)b[f]=k?e:Hf(o,c[f]);return b}function kr(o,c,f){return o===o&&(f!==e&&(o=o<=f?o:f),c!==e&&(o=o>=c?o:c)),o}function An(o,c,f,y,b,k){var A,E=c&m,U=c&_,Z=c&x;if(f&&(A=b?f(o,y,b,k):f(o)),A!==e)return A;if(!fe(o))return o;var Q=Et(o);if(Q){if(A=wB(o),!E)return un(o,A)}else{var rt=Ge(o),ct=rt==zt||rt==vt;if(Zi(o))return P0(o,E);if(rt==bt||rt==$||ct&&!b){if(A=U||ct?{}:Q0(o),!E)return U?uB(o,PN(A,o)):cB(o,c0(A,o))}else{if(!D[rt])return b?o:{};A=vB(o,rt,E)}}k||(k=new Fn);var yt=k.get(o);if(yt)return yt;k.set(o,A),Db(o)?o.forEach(function(wt){A.add(An(wt,c,f,wt,o,k))}):Mb(o)&&o.forEach(function(wt,Ft){A.set(Ft,An(wt,c,f,Ft,o,k))});var Tt=Z?U?kf:Mf:U?fn:Ee,Nt=Q?e:Tt(o);return yn(Nt||o,function(wt,Ft){Nt&&(Ft=wt,wt=o[Ft]),$o(A,Ft,An(wt,c,f,Ft,o,k))}),A}function IN(o){var c=Ee(o);return function(f){return u0(f,o,c)}}function u0(o,c,f){var y=f.length;if(o==null)return!y;for(o=ne(o);y--;){var b=f[y],k=c[b],A=o[b];if(A===e&&!(b in o)||!k(A))return!1}return!0}function d0(o,c,f){if(typeof o!="function")throw new Cn(a);return Zo(function(){o.apply(e,f)},c)}function Yo(o,c,f,y){var b=-1,k=Il,A=!0,E=o.length,U=[],Z=c.length;if(!E)return U;f&&(c=ue(c,_n(f))),y?(k=Yd,A=!1):c.length>=r&&(k=Fo,A=!1,c=new Mr(c));t:for(;++b<E;){var Q=o[b],rt=f==null?Q:f(Q);if(Q=y||Q!==0?Q:0,A&&rt===rt){for(var ct=Z;ct--;)if(c[ct]===rt)continue t;U.push(Q)}else k(c,rt,y)||U.push(Q)}return U}var ji=F0(Zn),f0=F0(lf,!0);function LN(o,c){var f=!0;return ji(o,function(y,b,k){return f=!!c(y,b,k),f}),f}function Ql(o,c,f){for(var y=-1,b=o.length;++y<b;){var k=o[y],A=c(k);if(A!=null&&(E===e?A===A&&!xn(A):f(A,E)))var E=A,U=k}return U}function NN(o,c,f,y){var b=o.length;for(f=Lt(f),f<0&&(f=-f>b?0:b+f),y=y===e||y>b?b:Lt(y),y<0&&(y+=b),y=f>y?0:Ob(y);f<y;)o[f++]=c;return o}function h0(o,c){var f=[];return ji(o,function(y,b,k){c(y,b,k)&&f.push(y)}),f}function Fe(o,c,f,y,b){var k=-1,A=o.length;for(f||(f=TB),b||(b=[]);++k<A;){var E=o[k];c>0&&f(E)?c>1?Fe(E,c-1,f,y,b):$i(b,E):y||(b[b.length]=E)}return b}var af=z0(),p0=z0(!0);function Zn(o,c){return o&&af(o,c,Ee)}function lf(o,c){return o&&p0(o,c,Ee)}function Jl(o,c){return Vi(c,function(f){return _i(o[f])})}function Dr(o,c){c=Ki(c,o);for(var f=0,y=c.length;o!=null&&f<y;)o=o[zn(c[f++])];return f&&f==y?o:e}function g0(o,c,f){var y=c(o);return Et(o)?y:$i(y,f(o))}function Qe(o){return o==null?o===e?Le:ve:Sr&&Sr in ne(o)?_B(o):RB(o)}function cf(o,c){return o>c}function BN(o,c){return o!=null&&Gt.call(o,c)}function FN(o,c){return o!=null&&c in ne(o)}function zN(o,c,f){return o>=je(c,f)&&o<ke(c,f)}function uf(o,c,f){for(var y=f?Yd:Il,b=o[0].length,k=o.length,A=k,E=Y(k),U=1/0,Z=[];A--;){var Q=o[A];A&&c&&(Q=ue(Q,_n(c))),U=je(Q.length,U),E[A]=!f&&(c||b>=120&&Q.length>=120)?new Mr(A&&Q):e}Q=o[0];var rt=-1,ct=E[0];t:for(;++rt<b&&Z.length<U;){var yt=Q[rt],Tt=c?c(yt):yt;if(yt=f||yt!==0?yt:0,!(ct?Fo(ct,Tt):y(Z,Tt,f))){for(A=k;--A;){var Nt=E[A];if(!(Nt?Fo(Nt,Tt):y(o[A],Tt,f)))continue t}ct&&ct.push(Tt),Z.push(yt)}}return Z}function UN(o,c,f,y){return Zn(o,function(b,k,A){c(y,f(b),k,A)}),y}function qo(o,c,f){c=Ki(c,o),o=nb(o,c);var y=o==null?o:o[zn(En(c))];return y==null?e:mn(y,o,f)}function m0(o){return ge(o)&&Qe(o)==$}function HN(o){return ge(o)&&Qe(o)==Re}function WN(o){return ge(o)&&Qe(o)==pt}function jo(o,c,f,y,b){return o===c?!0:o==null||c==null||!ge(o)&&!ge(c)?o!==o&&c!==c:VN(o,c,f,y,jo,b)}function VN(o,c,f,y,b,k){var A=Et(o),E=Et(c),U=A?st:Ge(o),Z=E?st:Ge(c);U=U==$?bt:U,Z=Z==$?bt:Z;var Q=U==bt,rt=Z==bt,ct=U==Z;if(ct&&Zi(o)){if(!Zi(c))return!1;A=!0,Q=!1}if(ct&&!Q)return k||(k=new Fn),A||vs(o)?K0(o,c,f,y,b,k):mB(o,c,U,f,y,b,k);if(!(f&v)){var yt=Q&&Gt.call(o,"__wrapped__"),Tt=rt&&Gt.call(c,"__wrapped__");if(yt||Tt){var Nt=yt?o.value():o,wt=Tt?c.value():c;return k||(k=new Fn),b(Nt,wt,f,y,k)}}return ct?(k||(k=new Fn),yB(o,c,f,y,b,k)):!1}function $N(o){return ge(o)&&Ge(o)==Ct}function df(o,c,f,y){var b=f.length,k=b,A=!y;if(o==null)return!k;for(o=ne(o);b--;){var E=f[b];if(A&&E[2]?E[1]!==o[E[0]]:!(E[0]in o))return!1}for(;++b<k;){E=f[b];var U=E[0],Z=o[U],Q=E[1];if(A&&E[2]){if(Z===e&&!(U in o))return!1}else{var rt=new Fn;if(y)var ct=y(Z,Q,U,o,c,rt);if(!(ct===e?jo(Q,Z,v|S,y,rt):ct))return!1}}return!0}function y0(o){if(!fe(o)||kB(o))return!1;var c=_i(o)?$L:Md;return c.test(Or(o))}function YN(o){return ge(o)&&Qe(o)==Ae}function qN(o){return ge(o)&&Ge(o)==oe}function jN(o){return ge(o)&&mc(o.length)&&!!ee[Qe(o)]}function _0(o){return typeof o=="function"?o:o==null?hn:typeof o=="object"?Et(o)?w0(o[0],o[1]):x0(o):Hb(o)}function ff(o){if(!Xo(o))return XL(o);var c=[];for(var f in ne(o))Gt.call(o,f)&&f!="constructor"&&c.push(f);return c}function GN(o){if(!fe(o))return AB(o);var c=Xo(o),f=[];for(var y in o)y=="constructor"&&(c||!Gt.call(o,y))||f.push(y);return f}function hf(o,c){return o<c}function b0(o,c){var f=-1,y=dn(o)?Y(o.length):[];return ji(o,function(b,k,A){y[++f]=c(b,k,A)}),y}function x0(o){var c=Cf(o);return c.length==1&&c[0][2]?tb(c[0][0],c[0][1]):function(f){return f===o||df(f,o,c)}}function w0(o,c){return Af(o)&&J0(c)?tb(zn(o),c):function(f){var y=Hf(f,o);return y===e&&y===c?Wf(f,o):jo(c,y,v|S)}}function tc(o,c,f,y,b){o!==c&&af(c,function(k,A){if(b||(b=new Fn),fe(k))KN(o,c,A,f,tc,y,b);else{var E=y?y(Ef(o,A),k,A+"",o,c,b):e;E===e&&(E=k),sf(o,A,E)}},fn)}function KN(o,c,f,y,b,k,A){var E=Ef(o,f),U=Ef(c,f),Z=A.get(U);if(Z){sf(o,f,Z);return}var Q=k?k(E,U,f+"",o,c,A):e,rt=Q===e;if(rt){var ct=Et(U),yt=!ct&&Zi(U),Tt=!ct&&!yt&&vs(U);Q=U,ct||yt||Tt?Et(E)?Q=E:_e(E)?Q=un(E):yt?(rt=!1,Q=P0(U,!0)):Tt?(rt=!1,Q=I0(U,!0)):Q=[]:Qo(U)||Ar(U)?(Q=E,Ar(E)?Q=Ab(E):(!fe(E)||_i(E))&&(Q=Q0(U))):rt=!1}rt&&(A.set(U,Q),b(Q,U,y,k,A),A.delete(U)),sf(o,f,Q)}function v0(o,c){var f=o.length;if(f)return c+=c<0?f:0,yi(c,f)?o[c]:e}function S0(o,c,f){c.length?c=ue(c,function(k){return Et(k)?function(A){return Dr(A,k.length===1?k[0]:k)}:k}):c=[hn];var y=-1;c=ue(c,_n(St()));var b=b0(o,function(k,A,E){var U=ue(c,function(Z){return Z(k)});return{criteria:U,index:++y,value:k}});return vL(b,function(k,A){return lB(k,A,f)})}function XN(o,c){return T0(o,c,function(f,y){return Wf(o,y)})}function T0(o,c,f){for(var y=-1,b=c.length,k={};++y<b;){var A=c[y],E=Dr(o,A);f(E,A)&&Go(k,Ki(A,o),E)}return k}function ZN(o){return function(c){return Dr(c,o)}}function pf(o,c,f,y){var b=y?wL:ds,k=-1,A=c.length,E=o;for(o===c&&(c=un(c)),f&&(E=ue(o,_n(f)));++k<A;)for(var U=0,Z=c[k],Q=f?f(Z):Z;(U=b(E,Q,U,y))>-1;)E!==o&&$l.call(E,U,1),$l.call(o,U,1);return o}function M0(o,c){for(var f=o?c.length:0,y=f-1;f--;){var b=c[f];if(f==y||b!==k){var k=b;yi(b)?$l.call(o,b,1):_f(o,b)}}return o}function gf(o,c){return o+jl(s0()*(c-o+1))}function QN(o,c,f,y){for(var b=-1,k=ke(ql((c-o)/(f||1)),0),A=Y(k);k--;)A[y?k:++b]=o,o+=f;return A}function mf(o,c){var f="";if(!o||c<1||c>et)return f;do c%2&&(f+=o),c=jl(c/2),c&&(o+=o);while(c);return f}function Bt(o,c){return Pf(eb(o,c,hn),o+"")}function JN(o){return l0(Ss(o))}function tB(o,c){var f=Ss(o);return uc(f,kr(c,0,f.length))}function Go(o,c,f,y){if(!fe(o))return o;c=Ki(c,o);for(var b=-1,k=c.length,A=k-1,E=o;E!=null&&++b<k;){var U=zn(c[b]),Z=f;if(U==="__proto__"||U==="constructor"||U==="prototype")return o;if(b!=A){var Q=E[U];Z=y?y(Q,U,E):e,Z===e&&(Z=fe(Q)?Q:yi(c[b+1])?[]:{})}$o(E,U,Z),E=E[U]}return o}var k0=Gl?function(o,c){return Gl.set(o,c),o}:hn,eB=Yl?function(o,c){return Yl(o,"toString",{configurable:!0,enumerable:!1,value:$f(c),writable:!0})}:hn;function nB(o){return uc(Ss(o))}function Rn(o,c,f){var y=-1,b=o.length;c<0&&(c=-c>b?0:b+c),f=f>b?b:f,f<0&&(f+=b),b=c>f?0:f-c>>>0,c>>>=0;for(var k=Y(b);++y<b;)k[y]=o[y+c];return k}function iB(o,c){var f;return ji(o,function(y,b,k){return f=c(y,b,k),!f}),!!f}function ec(o,c,f){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=_t){for(;y<b;){var k=y+b>>>1,A=o[k];A!==null&&!xn(A)&&(f?A<=c:A<c)?y=k+1:b=k}return b}return yf(o,c,hn,f)}function yf(o,c,f,y){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=f(c);for(var A=c!==c,E=c===null,U=xn(c),Z=c===e;b<k;){var Q=jl((b+k)/2),rt=f(o[Q]),ct=rt!==e,yt=rt===null,Tt=rt===rt,Nt=xn(rt);if(A)var wt=y||Tt;else Z?wt=Tt&&(y||ct):E?wt=Tt&&ct&&(y||!yt):U?wt=Tt&&ct&&!yt&&(y||!Nt):yt||Nt?wt=!1:wt=y?rt<=c:rt<c;wt?b=Q+1:k=Q}return je(k,X)}function D0(o,c){for(var f=-1,y=o.length,b=0,k=[];++f<y;){var A=o[f],E=c?c(A):A;if(!f||!Un(E,U)){var U=E;k[b++]=A===0?0:A}}return k}function C0(o){return typeof o=="number"?o:xn(o)?H:+o}function bn(o){if(typeof o=="string")return o;if(Et(o))return ue(o,bn)+"";if(xn(o))return o0?o0.call(o):"";var c=o+"";return c=="0"&&1/o==-nt?"-0":c}function Gi(o,c,f){var y=-1,b=Il,k=o.length,A=!0,E=[],U=E;if(f)A=!1,b=Yd;else if(k>=r){var Z=c?null:pB(o);if(Z)return Nl(Z);A=!1,b=Fo,U=new Mr}else U=c?[]:E;t:for(;++y<k;){var Q=o[y],rt=c?c(Q):Q;if(Q=f||Q!==0?Q:0,A&&rt===rt){for(var ct=U.length;ct--;)if(U[ct]===rt)continue t;c&&U.push(rt),E.push(Q)}else b(U,rt,f)||(U!==E&&U.push(rt),E.push(Q))}return E}function _f(o,c){c=Ki(c,o);var f=-1,y=c.length;if(!y)return!0;for(;++f<y;){var b=zn(c[f]);if(b==="__proto__"&&!Gt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&f<y-1)return!1}var k=nb(o,c);return k==null||delete k[zn(En(c))]}function O0(o,c,f,y){return Go(o,c,f(Dr(o,c)),y)}function nc(o,c,f,y){for(var b=o.length,k=y?b:-1;(y?k--:++k<b)&&c(o[k],k,o););return f?Rn(o,y?0:k,y?k+1:b):Rn(o,y?k+1:0,y?b:k)}function A0(o,c){var f=o;return f instanceof Ut&&(f=f.value()),qd(c,function(y,b){return b.func.apply(b.thisArg,$i([y],b.args))},f)}function bf(o,c,f){var y=o.length;if(y<2)return y?Gi(o[0]):[];for(var b=-1,k=Y(y);++b<y;)for(var A=o[b],E=-1;++E<y;)E!=b&&(k[b]=Yo(k[b]||A,o[E],c,f));return Gi(Fe(k,1),c,f)}function R0(o,c,f){for(var y=-1,b=o.length,k=c.length,A={};++y<b;){var E=y<k?c[y]:e;f(A,o[y],E)}return A}function xf(o){return _e(o)?o:[]}function wf(o){return typeof o=="function"?o:hn}function Ki(o,c){return Et(o)?o:Af(o,c)?[o]:ob(Kt(o))}var rB=Bt;function Xi(o,c,f){var y=o.length;return f=f===e?y:f,!c&&f>=y?o:Rn(o,c,f)}var E0=YL||function(o){return ce.clearTimeout(o)};function P0(o,c){if(c)return o.slice();var f=o.length,y=t0?t0(f):new o.constructor(f);return o.copy(y),y}function vf(o){var c=new o.constructor(o.byteLength);return new Wl(c).set(new Wl(o)),c}function sB(o,c){var f=c?vf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function oB(o){var c=new o.constructor(o.source,yl.exec(o));return c.lastIndex=o.lastIndex,c}function aB(o){return Vo?ne(Vo.call(o)):{}}function I0(o,c){var f=c?vf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function L0(o,c){if(o!==c){var f=o!==e,y=o===null,b=o===o,k=xn(o),A=c!==e,E=c===null,U=c===c,Z=xn(c);if(!E&&!Z&&!k&&o>c||k&&A&&U&&!E&&!Z||y&&A&&U||!f&&U||!b)return 1;if(!y&&!k&&!Z&&o<c||Z&&f&&b&&!y&&!k||E&&f&&b||!A&&b||!U)return-1}return 0}function lB(o,c,f){for(var y=-1,b=o.criteria,k=c.criteria,A=b.length,E=f.length;++y<A;){var U=L0(b[y],k[y]);if(U){if(y>=E)return U;var Z=f[y];return U*(Z=="desc"?-1:1)}}return o.index-c.index}function N0(o,c,f,y){for(var b=-1,k=o.length,A=f.length,E=-1,U=c.length,Z=ke(k-A,0),Q=Y(U+Z),rt=!y;++E<U;)Q[E]=c[E];for(;++b<A;)(rt||b<k)&&(Q[f[b]]=o[b]);for(;Z--;)Q[E++]=o[b++];return Q}function B0(o,c,f,y){for(var b=-1,k=o.length,A=-1,E=f.length,U=-1,Z=c.length,Q=ke(k-E,0),rt=Y(Q+Z),ct=!y;++b<Q;)rt[b]=o[b];for(var yt=b;++U<Z;)rt[yt+U]=c[U];for(;++A<E;)(ct||b<k)&&(rt[yt+f[A]]=o[b++]);return rt}function un(o,c){var f=-1,y=o.length;for(c||(c=Y(y));++f<y;)c[f]=o[f];return c}function Qn(o,c,f,y){var b=!f;f||(f={});for(var k=-1,A=c.length;++k<A;){var E=c[k],U=y?y(f[E],o[E],E,f,o):e;U===e&&(U=o[E]),b?Xn(f,E,U):$o(f,E,U)}return f}function cB(o,c){return Qn(o,Of(o),c)}function uB(o,c){return Qn(o,X0(o),c)}function ic(o,c){return function(f,y){var b=Et(f)?gL:EN,k=c?c():{};return b(f,o,St(y,2),k)}}function bs(o){return Bt(function(c,f){var y=-1,b=f.length,k=b>1?f[b-1]:e,A=b>2?f[2]:e;for(k=o.length>3&&typeof k=="function"?(b--,k):e,A&&Je(f[0],f[1],A)&&(k=b<3?e:k,b=1),c=ne(c);++y<b;){var E=f[y];E&&o(c,E,y,k)}return c})}function F0(o,c){return function(f,y){if(f==null)return f;if(!dn(f))return o(f,y);for(var b=f.length,k=c?b:-1,A=ne(f);(c?k--:++k<b)&&y(A[k],k,A)!==!1;);return f}}function z0(o){return function(c,f,y){for(var b=-1,k=ne(c),A=y(c),E=A.length;E--;){var U=A[o?E:++b];if(f(k[U],U,k)===!1)break}return c}}function dB(o,c,f){var y=c&C,b=Ko(o);function k(){var A=this&&this!==ce&&this instanceof k?b:o;return A.apply(y?f:this,arguments)}return k}function U0(o){return function(c){c=Kt(c);var f=fs(c)?Bn(c):e,y=f?f[0]:c.charAt(0),b=f?Xi(f,1).join(""):c.slice(1);return y[o]()+b}}function xs(o){return function(c){return qd(zb(Fb(c).replace(Ud,"")),o,"")}}function Ko(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 f=_s(o.prototype),y=o.apply(f,c);return fe(y)?y:f}}function fB(o,c,f){var y=Ko(o);function b(){for(var k=arguments.length,A=Y(k),E=k,U=ws(b);E--;)A[E]=arguments[E];var Z=k<3&&A[0]!==U&&A[k-1]!==U?[]:Yi(A,U);if(k-=Z.length,k<f)return Y0(o,c,rc,b.placeholder,e,A,Z,e,e,f-k);var Q=this&&this!==ce&&this instanceof b?y:o;return mn(Q,this,A)}return b}function H0(o){return function(c,f,y){var b=ne(c);if(!dn(c)){var k=St(f,3);c=Ee(c),f=function(E){return k(b[E],E,b)}}var A=o(c,f,y);return A>-1?b[k?c[A]:A]:e}}function W0(o){return mi(function(c){var f=c.length,y=f,b=On.prototype.thru;for(o&&c.reverse();y--;){var k=c[y];if(typeof k!="function")throw new Cn(a);if(b&&!A&&lc(k)=="wrapper")var A=new On([],!0)}for(y=A?y:f;++y<f;){k=c[y];var E=lc(k),U=E=="wrapper"?Df(k):e;U&&Rf(U[0])&&U[1]==(T|P|I|M)&&!U[4].length&&U[9]==1?A=A[lc(U[0])].apply(A,U[3]):A=k.length==1&&Rf(k)?A[E]():A.thru(k)}return function(){var Z=arguments,Q=Z[0];if(A&&Z.length==1&&Et(Q))return A.plant(Q).value();for(var rt=0,ct=f?c[rt].apply(this,Z):Q;++rt<f;)ct=c[rt].call(this,ct);return ct}})}function rc(o,c,f,y,b,k,A,E,U,Z){var Q=c&T,rt=c&C,ct=c&R,yt=c&(P|L),Tt=c&O,Nt=ct?e:Ko(o);function wt(){for(var Ft=arguments.length,Ht=Y(Ft),wn=Ft;wn--;)Ht[wn]=arguments[wn];if(yt)var tn=ws(wt),vn=TL(Ht,tn);if(y&&(Ht=N0(Ht,y,b,yt)),k&&(Ht=B0(Ht,k,A,yt)),Ft-=vn,yt&&Ft<Z){var be=Yi(Ht,tn);return Y0(o,c,rc,wt.placeholder,f,Ht,be,E,U,Z-Ft)}var Hn=rt?f:this,xi=ct?Hn[o]:o;return Ft=Ht.length,E?Ht=EB(Ht,E):Tt&&Ft>1&&Ht.reverse(),Q&&U<Ft&&(Ht.length=U),this&&this!==ce&&this instanceof wt&&(xi=Nt||Ko(xi)),xi.apply(Hn,Ht)}return wt}function V0(o,c){return function(f,y){return UN(f,o,c(y),{})}}function sc(o,c){return function(f,y){var b;if(f===e&&y===e)return c;if(f!==e&&(b=f),y!==e){if(b===e)return y;typeof f=="string"||typeof y=="string"?(f=bn(f),y=bn(y)):(f=C0(f),y=C0(y)),b=o(f,y)}return b}}function Sf(o){return mi(function(c){return c=ue(c,_n(St())),Bt(function(f){var y=this;return o(c,function(b){return mn(b,y,f)})})})}function oc(o,c){c=c===e?" ":bn(c);var f=c.length;if(f<2)return f?mf(c,o):c;var y=mf(c,ql(o/hs(c)));return fs(c)?Xi(Bn(y),0,o).join(""):y.slice(0,o)}function hB(o,c,f,y){var b=c&C,k=Ko(o);function A(){for(var E=-1,U=arguments.length,Z=-1,Q=y.length,rt=Y(Q+U),ct=this&&this!==ce&&this instanceof A?k:o;++Z<Q;)rt[Z]=y[Z];for(;U--;)rt[Z++]=arguments[++E];return mn(ct,b?f:this,rt)}return A}function $0(o){return function(c,f,y){return y&&typeof y!="number"&&Je(c,f,y)&&(f=y=e),c=bi(c),f===e?(f=c,c=0):f=bi(f),y=y===e?c<f?1:-1:bi(y),QN(c,f,y,o)}}function ac(o){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Pn(c),f=Pn(f)),o(c,f)}}function Y0(o,c,f,y,b,k,A,E,U,Z){var Q=c&P,rt=Q?A:e,ct=Q?e:A,yt=Q?k:e,Tt=Q?e:k;c|=Q?I:N,c&=~(Q?N:I),c&B||(c&=-4);var Nt=[o,c,b,yt,rt,Tt,ct,E,U,Z],wt=f.apply(e,Nt);return Rf(o)&&ib(wt,Nt),wt.placeholder=y,rb(wt,o,c)}function Tf(o){var c=Me[o];return function(f,y){if(f=Pn(f),y=y==null?0:je(Lt(y),292),y&&r0(f)){var b=(Kt(f)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+y));return b=(Kt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(f)}}var pB=ms&&1/Nl(new ms([,-0]))[1]==nt?function(o){return new ms(o)}:jf;function q0(o){return function(c){var f=Ge(c);return f==Ct?Jd(c):f==oe?RL(c):SL(c,o(c))}}function gi(o,c,f,y,b,k,A,E){var U=c&R;if(!U&&typeof o!="function")throw new Cn(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=e),A=A===e?A:ke(Lt(A),0),E=E===e?E:Lt(E),Z-=b?b.length:0,c&N){var Q=y,rt=b;y=b=e}var ct=U?e:Df(o),yt=[o,c,f,y,b,Q,rt,k,A,E];if(ct&&OB(yt,ct),o=yt[0],c=yt[1],f=yt[2],y=yt[3],b=yt[4],E=yt[9]=yt[9]===e?U?0:o.length:ke(yt[9]-Z,0),!E&&c&(P|L)&&(c&=-25),!c||c==C)var Tt=dB(o,c,f);else c==P||c==L?Tt=fB(o,c,E):(c==I||c==(C|I))&&!b.length?Tt=hB(o,c,f,y):Tt=rc.apply(e,yt);var Nt=ct?k0:ib;return rb(Nt(Tt,yt),o,c)}function j0(o,c,f,y){return o===e||Un(o,gs[f])&&!Gt.call(y,f)?c:o}function G0(o,c,f,y,b,k){return fe(o)&&fe(c)&&(k.set(c,o),tc(o,c,e,G0,k),k.delete(c)),o}function gB(o){return Qo(o)?e:o}function K0(o,c,f,y,b,k){var A=f&v,E=o.length,U=c.length;if(E!=U&&!(A&&U>E))return!1;var Z=k.get(o),Q=k.get(c);if(Z&&Q)return Z==c&&Q==o;var rt=-1,ct=!0,yt=f&S?new Mr:e;for(k.set(o,c),k.set(c,o);++rt<E;){var Tt=o[rt],Nt=c[rt];if(y)var wt=A?y(Nt,Tt,rt,c,o,k):y(Tt,Nt,rt,o,c,k);if(wt!==e){if(wt)continue;ct=!1;break}if(yt){if(!jd(c,function(Ft,Ht){if(!Fo(yt,Ht)&&(Tt===Ft||b(Tt,Ft,f,y,k)))return yt.push(Ht)})){ct=!1;break}}else if(!(Tt===Nt||b(Tt,Nt,f,y,k))){ct=!1;break}}return k.delete(o),k.delete(c),ct}function mB(o,c,f,y,b,k,A){switch(f){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Re:return!(o.byteLength!=c.byteLength||!k(new Wl(o),new Wl(c)));case lt:case pt:case Dt:return Un(+o,+c);case It:return o.name==c.name&&o.message==c.message;case Ae:case ln:return o==c+"";case Ct:var E=Jd;case oe:var U=y&v;if(E||(E=Nl),o.size!=c.size&&!U)return!1;var Z=A.get(o);if(Z)return Z==c;y|=S,A.set(o,c);var Q=K0(E(o),E(c),y,b,k,A);return A.delete(o),Q;case Vt:if(Vo)return Vo.call(o)==Vo.call(c)}return!1}function yB(o,c,f,y,b,k){var A=f&v,E=Mf(o),U=E.length,Z=Mf(c),Q=Z.length;if(U!=Q&&!A)return!1;for(var rt=U;rt--;){var ct=E[rt];if(!(A?ct in c:Gt.call(c,ct)))return!1}var yt=k.get(o),Tt=k.get(c);if(yt&&Tt)return yt==c&&Tt==o;var Nt=!0;k.set(o,c),k.set(c,o);for(var wt=A;++rt<U;){ct=E[rt];var Ft=o[ct],Ht=c[ct];if(y)var wn=A?y(Ht,Ft,ct,c,o,k):y(Ft,Ht,ct,o,c,k);if(!(wn===e?Ft===Ht||b(Ft,Ht,f,y,k):wn)){Nt=!1;break}wt||(wt=ct=="constructor")}if(Nt&&!wt){var tn=o.constructor,vn=c.constructor;tn!=vn&&"constructor"in o&&"constructor"in c&&!(typeof tn=="function"&&tn instanceof tn&&typeof vn=="function"&&vn instanceof vn)&&(Nt=!1)}return k.delete(o),k.delete(c),Nt}function mi(o){return Pf(eb(o,e,ub),o+"")}function Mf(o){return g0(o,Ee,Of)}function kf(o){return g0(o,fn,X0)}var Df=Gl?function(o){return Gl.get(o)}:jf;function lc(o){for(var c=o.name+"",f=ys[c],y=Gt.call(ys,c)?f.length:0;y--;){var b=f[y],k=b.func;if(k==null||k==o)return b.name}return c}function ws(o){var c=Gt.call(w,"placeholder")?w:o;return c.placeholder}function St(){var o=w.iteratee||Yf;return o=o===Yf?_0:o,arguments.length?o(arguments[0],arguments[1]):o}function cc(o,c){var f=o.__data__;return MB(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Cf(o){for(var c=Ee(o),f=c.length;f--;){var y=c[f],b=o[y];c[f]=[y,b,J0(b)]}return c}function Cr(o,c){var f=CL(o,c);return y0(f)?f:e}function _B(o){var c=Gt.call(o,Sr),f=o[Sr];try{o[Sr]=e;var y=!0}catch{}var b=Ul.call(o);return y&&(c?o[Sr]=f:delete o[Sr]),b}var Of=ef?function(o){return o==null?[]:(o=ne(o),Vi(ef(o),function(c){return n0.call(o,c)}))}:Gf,X0=ef?function(o){for(var c=[];o;)$i(c,Of(o)),o=Vl(o);return c}:Gf,Ge=Qe;(nf&&Ge(new nf(new ArrayBuffer(1)))!=gn||Uo&&Ge(new Uo)!=Ct||rf&&Ge(rf.resolve())!=jt||ms&&Ge(new ms)!=oe||Ho&&Ge(new Ho)!=ie)&&(Ge=function(o){var c=Qe(o),f=c==bt?o.constructor:e,y=f?Or(f):"";if(y)switch(y){case tN:return gn;case eN:return Ct;case nN:return jt;case iN:return oe;case rN:return ie}return c});function bB(o,c,f){for(var y=-1,b=f.length;++y<b;){var k=f[y],A=k.size;switch(k.type){case"drop":o+=A;break;case"dropRight":c-=A;break;case"take":c=je(c,o+A);break;case"takeRight":o=ke(o,c-A);break}}return{start:o,end:c}}function xB(o){var c=o.match(bd);return c?c[1].split(xd):[]}function Z0(o,c,f){c=Ki(c,o);for(var y=-1,b=c.length,k=!1;++y<b;){var A=zn(c[y]);if(!(k=o!=null&&f(o,A)))break;o=o[A]}return k||++y!=b?k:(b=o==null?0:o.length,!!b&&mc(b)&&yi(A,b)&&(Et(o)||Ar(o)))}function wB(o){var c=o.length,f=new o.constructor(c);return c&&typeof o[0]=="string"&&Gt.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function Q0(o){return typeof o.constructor=="function"&&!Xo(o)?_s(Vl(o)):{}}function vB(o,c,f){var y=o.constructor;switch(c){case Re:return vf(o);case lt:case pt:return new y(+o);case gn:return sB(o,f);case zi:case Dn:case Ye:case In:case ci:case So:case To:case br:case ui:return I0(o,f);case Ct:return new y;case Dt:case ln:return new y(o);case Ae:return oB(o);case oe:return new y;case Vt:return aB(o)}}function SB(o,c){var f=c.length;if(!f)return o;var y=f-1;return c[y]=(f>1?"& ":"")+c[y],c=c.join(f>2?", ":" "),o.replace(Ln,`{
7
+ `)}}function fE(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Zm(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const h=p.toValue(n);return Array.isArray(h)?h.map(g=>jr(g)):[jr(h)]}),h=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const g of h)g&&s.observe(g,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return Km(d),{isSupported:a,stop:d}}function hE(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=p.shallowRef(0),u=p.shallowRef(0),d=p.shallowRef(0),h=p.shallowRef(0),g=p.shallowRef(0),m=p.shallowRef(0),_=p.shallowRef(0),x=p.shallowRef(0);function v(){const C=jr(n);if(!C){e&&(l.value=0,u.value=0,d.value=0,h.value=0,g.value=0,m.value=0,_.value=0,x.value=0);return}const E=C.getBoundingClientRect();l.value=E.height,u.value=E.bottom,d.value=E.left,h.value=E.right,g.value=E.top,m.value=E.width,_.value=E.x,x.value=E.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return fE(n,S),p.watch(()=>jr(n),C=>!C&&S()),cE(n,S,{attributeFilter:["style","class"]}),r&&co("scroll",S,{capture:!0,passive:!0}),i&&co("resize",S,{passive:!0}),oE(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:g,width:m,x:_,y:x,update:S}}function pE(n,t){const{top:e,left:i}=hE(n),r=p.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=p.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const gE=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=e).sort((u,d)=>u-d),s=[];if(e-t<n-2)return[];const a=(e-t)/n;let l=0;for(let u=0;u<n;u++){const d=t+u*a,h=t+(u+1)*a;let g=0;for(;l<r.length&&r[l]>=d&&r[l]<=h;)g++,l++;s.push([Math.ceil(d),g])}return s},Qm=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),uo=p.ref({}),mE=n=>(uo.value[n]||(uo.value[n]=Qm()),uo.value[n]),yE=(n,t)=>{const e=uo.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete uo.value[t])};function _E({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const h=e!==void 0&&n!==void 0?mE(e):Qm(),g=n!==void 0?n:"static-chart-key",m=p.computed(()=>t.reduce((O,{timestamps:z})=>[...O,...z],[])),_=p.computed(()=>i||m.value.reduce((O,z)=>O===0?z:Math.min(O,z),0)),x=p.computed(()=>r||m.value.reduce((O,z)=>Math.max(O,z),0));p.watchEffect(()=>{h.minStamps[g]=_.value,h.maxStamps[g]=x.value,l!==void 0&&(h.renderPoints[g]=l)});const v=p.computed(()=>Object.values(h.minStamps).reduce((O,z)=>O===0?z:Math.min(O,z),0)),S=p.computed(()=>Object.values(h.maxStamps).reduce((O,z)=>Math.max(O,z),0)),C=p.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((z,W)=>Math.max(z,W),2)}),E=p.computed(()=>{const O=S.value-v.value;return Math.ceil(O/C.value)}),B=p.computed(()=>t.length>1),P=p.computed(()=>t.map(({timestamps:O,color:z,label:W})=>({data:gE({bucketCount:C.value,minStamp:v.value,maxStamp:S.value,timestamps:O}).map(([ft,j])=>({x:ft,y:j})),label:W,...(u==="sparkline_bar"||B.value)&&z&&{backgroundColor:z},...u!=="sparkline_bar"&&z&&{borderColor:z},...B.value&&u!=="sparkline_bar"&&{fill:!0}}))),L=p.computed(()=>{const O=P.value[0]?.data?.length??0,z=[];for(let W=0;W<O;W++){let it=0;for(let ut=0;ut<P.value.length;ut++)it+=P.value[ut].data[W].y;z.push(it)}return z}),I=p.computed(()=>{const O=L.value.reduce((z,W)=>Math.max(z,W),0);return Math.max(O,a??0)}),N=p.computed(()=>{const O=P.value.reduce((it,{data:ut})=>[...it,...ut.map(({y:ft})=>ft)],[]),z=O.length?O[0]:0,W=O.reduce((it,ut)=>Math.min(it,ut),z);return s===void 0?W:Math.min(W,s)});p.watchEffect(()=>{h.maxCounts[g]=I.value,h.minCounts[g]=N.value});const T=p.computed(()=>{const O=Object.values(h.minCounts),z=O.length?O[0]:0;return O.reduce((W,it)=>Math.min(W,it),z)}),M=p.computed(()=>Object.values(h.maxCounts).reduce((O,z)=>Math.max(O,z),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&yE(n,e)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:E,syncedMinCount:T,syncedMaxCount:M}}const kt={useBarChartOptions:OA,useChartJSCommon:EA,useChartLegendValues:PA,useChartSelectedRange:IA,useExploreResultToDatasets:zA,useExploreResultToTimeDataset:VA,useScatterDatasets:XA,useDonutChartOptions:LA,useLineChartOptions:NA,useScatterChartOptions:BA,useI18n:hM,useReportChartDataForSynthetics:ZA,useTranslatedUnits:QA,useEvaluateFeatureFlag:tE,useTooltipAbsolutePosition:pE,useSparklineSync:_E},Ka=n=>["interactive","zoom-interactive"].includes(n),Cu=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=kt.useI18n(),{formatUnit:a}=er({i18n:s}),l=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Ka(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(h,e):ho({tickValue:new Date(h),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,m)=>{const _=g.parsed[d],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l),n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},Jm=(n,t)=>{const{tooltip:e}=t,{i18n:i}=kt.useI18n(),{formatUnit:r}=er({i18n:i});if(e.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(e.body&&!Ka(n.interactionMode)){const a=e.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,h)=>{const g=u?d.parsed:d.parsed[l],m=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:m,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},bE=n=>n&&n.datasets&&n.datasets.length,xE=n=>bE(n)&&n.datasets.some(t=>t.data.length),wE=n=>n.datasets.some(t=>t.data[0]&&Ec(t.data[0].x)),vE=n=>!!xE(n)&&n.datasets.some(t=>t.data.length==1),SE=n=>wE(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Xa=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=n.x??0;return l<e?l+t*s*(1-r):l-t*a*(1-r)},ty=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function ey(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Ou=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},TE=2,ny=10,iy=12,Za=10,ai=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Au=(n,t)=>(t||ai)[n%ai.length],ME="#6f7787",kE={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"}},DE=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return kE[t]?.background||"#fafafa"},CE=cv,Eu=(n,t,e,i)=>{let r;return e?r=CE:Array.isArray(i)?r=Au(n,i):r=i[t],r||Au(n)},Ru=n=>{switch(n){case"error":return uv;case"warning":return pv;case"neutral":return $h;default:return $h}},OE={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},AE=2,EE=0,Pu=new Map,ry=(n,t)=>{const{i18n:e}=kt.useI18n(),{formatBytes:i}=er({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):la.format(n)},RE=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},PE=()=>{const n="label_height";if(!Pu.has(n)){const t=le({});Pu.set(n,t.lineHeight)}return Pu.get(n)},IE=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),LE=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,NE=lv,BE={100:yv,101:_v,102:bv,103:xv,200:wv,201:vv,202:Sv,203:Tv,204:Mv,205:kv,206:Dv,207:Cv,208:Ov,226:Av,300:Ev,301:Rv,302:Pv,303:Iv,304:Lv,305:Nv,307:Bv,308:Fv,400:zv,401:Uv,402:Hv,403:Wv,404:Vv,405:$v,406:Yv,407:qv,408:jv,409:Gv,410:Kv,411:Xv,412:Zv,413:Qv,414:Jv,415:t1,416:e1,417:n1,418:i1,421:r1,422:s1,423:o1,424:a1,425:l1,426:c1,428:u1,429:d1,431:f1,451:h1,500:p1,501:g1,502:m1,503:y1,504:_1,505:b1,506:x1,507:w1,508:v1,510:S1,511:T1},FE={100:M1,200:k1,300:D1,400:C1,500:O1},zE={"1XX":A1,"2XX":E1,"3XX":R1,"4XX":P1,"5XX":I1},sy=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return BE[t]??FE[e]??NE},Iu={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=sy(`${t}`),n),{}),____OTHER____:av,...zE};function oy(n,t,e){const i=hp(),r=WE(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?UE(r,t):HE(r,t)}function UE(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function HE(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function WE(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function VE(n,t){const e=GE(t);return"formatToParts"in e?YE(e,n):qE(e,n)}const $E={year:0,month:1,day:2,hour:3,minute:4,second:5};function YE(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=$E[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function qE(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Lu={},ay=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")),jE=ay==="06/25/2014, 00:00:00"||ay==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function GE(n){return Lu[n]||(Lu[n]=jE?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Lu[n]}function ly(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const cy=36e5,KE=6e4,Nu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Bu(n,t,e){if(!n)return 0;let i=Nu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Nu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),uy(r)?-(r*cy):NaN;if(i=Nu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return uy(r,a)?(s=Math.abs(r)*cy+a*KE,i[1]==="+"?-s:s):NaN}if(QE(n)){t=new Date(t||Date.now());const a=e?t:XE(t),l=Fu(a,n);return-(e?l:ZE(t,l,n))}return NaN}function XE(n){return ly(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Fu(n,t){const e=VE(n,t),i=ly(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function ZE(n,t,e){let r=n.getTime()-t;const s=Fu(new Date(r),e);if(t===s)return t;r-=s-t;const a=Fu(new Date(r),e);return s===a?s:Math.max(s,a)}function uy(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const dy={};function QE(n){if(dy[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),dy[n]=!0,!0}catch{return!1}}const JE=60*1e3,tR={X:function(n,t,e){const i=zu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return fy(i);case"XXXX":case"XX":return Gr(i);default:return Gr(i,":")}},x:function(n,t,e){const i=zu(e.timeZone,n);switch(t){case"x":return fy(i);case"xxxx":case"xx":return Gr(i);default:return Gr(i,":")}},O:function(n,t,e){const i=zu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+eR(i,":");default:return"GMT"+Gr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return oy("short",n,e);default:return oy("long",n,e)}}};function zu(n,t){const e=n?Bu(n,t,!0)/JE:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Qa(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Gr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Qa(Math.floor(i/60),2),s=Qa(Math.floor(i%60),2);return e+r+t+s}function fy(n,t){return n%60===0?(n>0?"-":"+")+Qa(Math.abs(n)/60,2):Gr(n,t)}function eR(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Qa(s,2)}function hy(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const nR=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Uu=36e5,py=6e4,iR=2,Xe={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:nR};function gy(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?iR:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=rR(n),{year:r,restDateString:s}=sR(i.date,e),a=oR(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=aR(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Bu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=hy(new Date(l+u)),d=hy(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function rR(n){const t={};let e=Xe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Xe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function sR(n,t){if(n){const e=Xe.YYY[t],i=Xe.YYYYY[t];let r=Xe.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Xe.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function oR(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Xe.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,_y(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Xe.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return uR(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Xe.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return _y(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Xe.Www.exec(n),s)return r=parseInt(s[1],10)-1,by(r)?my(t,r):new Date(NaN);if(s=Xe.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return by(r,a)?my(t,r,a):new Date(NaN)}return null}function aR(n){let t,e,i=Xe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Hu(t)?t%24*Uu:NaN;if(i=Xe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Hu(t,e)?t%24*Uu+e*py:NaN;if(i=Xe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Hu(t,e,r)?t%24*Uu+e*py+r*1e3:NaN}return null}function my(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const lR=[31,28,31,30,31,30,31,31,30,31,30,31],cR=[31,29,31,30,31,30,31,31,30,31,30,31];function yy(n){return n%400===0||n%4===0&&n%100!==0}function _y(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=yy(n);if(i&&e>cR[t]||!i&&e>lR[t])return!1}return!0}function uR(n,t){if(t<1)return!1;const e=yy(n);return!(e&&t>366||!e&&t>365)}function by(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Hu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const dR=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Wu(n,t,e={}){t=String(t);const i=t.match(dR);if(i){const r=gy(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+tR[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return da(n,t,e)}function fR(n,t,e){n=gy(n,e);const i=Bu(t,n,!0),r=new Date(n.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 fo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Wu(fR(n,t,{timeZone:i.timeZone}),e,i)}const hR=(n,t)=>`${fo(n,t,"yyyy")} W${fo(n,t,"II")}`,Vu="yyyy-MM-dd h:mm:ss a",$u="h:mm:ss a",hr="yyyy-MM-dd h:mm a",Kr="h:mm a",pR="yyyy-MM-dd",Yu="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",gR={secondly:n=>n?Vu:$u,tenSecondly:n=>n?Vu:$u,thirtySecondly:n=>n?Vu:$u,minutely:n=>n?hr:Kr,fiveMinutely:n=>n?hr:Kr,tenMinutely:n=>n?hr:Kr,thirtyMinutely:n=>n?hr:Kr,hourly:n=>n?hr:Kr,twoHourly:n=>n?hr:Kr,twelveHourly:()=>hr,daily:()=>pR},mR={secondly:()=>Yu,tenSecondly:()=>Yu,thirtySecondly:()=>Yu,minutely:()=>Ii,fiveMinutely:()=>Ii,tenMinutely:()=>Ii,thirtyMinutely:()=>Ii,hourly:()=>Ii,twoHourly:()=>Ii,twelveHourly:()=>Ii,daily:()=>Ii};function xy({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return hR(n,l);if(r&&r[t]){const u=r[t](i);return fo(n,l,u)}if(s&&s[t]){const u=s[t]();return fo(n,l,u)}return fo(n,l,a)}const wy=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>xy({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:gR,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ho=({tickValue:n,granularity:t,timezone:e})=>xy({tickValue:n,granularity:t,timezone:e,tooltipMap:mR,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),vy=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",yR=n=>{const{i18n:t}=kt.useI18n();return vy(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},po=n=>n.toLocaleLowerCase().endsWith("count"),_R=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))},bR=(n,t)=>{if(!n.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(n.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?n[r]:n[r]+(n[s]-n[r])*(i-r)},xR=(n,t)=>{const e=n.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,bR(e,i)]))},Sy=.7,qu=(n,t)=>{const e=Ta(n.trim());return e.valid?e.alpha(t).rgbString():n},Ja=n=>{const t=n??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:Yh,outlier:Wh,outlierBand:qu(Vh,Sy)};const e=window.getComputedStyle(t),i=(r,s)=>e.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",Yh),outlier:i("--kui-color-background-danger",Wh),outlierBand:qu(i("--kui-color-background-danger-weakest",Vh),Sy)}},wR="empty",Ty=n=>{if(!n||!("meta"in n)||!("data"in n))return;const{display:t,metric_names:e,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=n.meta;if(!e?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=e[0],h=t&&Object.keys(t)[0]||void 0,g=n.data??[],m=[];for(const _ of g){const x=My(_.timestamp,_.event[d],h?_.event[h]:void 0);x&&m.push(x)}return{points:m,metric:d,metricUnit:i?.[d],dimension:h,display:h?t?.[h]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},My=(n,t,e)=>{if(t==null||t==="")return;const i=new Date(n).valueOf(),r=Number(t);return!Number.isFinite(i)||!Number.isFinite(r)?void 0:e===void 0?{timestamp:i,value:r}:{timestamp:i,value:r,group:e!==null&&e!==""?String(e):wR}},vR=(n,t)=>{if(!n||!("meta"in n))return;const{metric:e,dimension:i,unroll:r,display:s,metricUnit:a}=t,l=t.timestamp??"request_start";if(!e){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const u=[];for(const d of n.results??[]){const h=Xr(d,l);for(const g of SR(d,r)){const m=Xr(g,e)??Xr(d,e),_=i?Xr(g,i)??Xr(d,i):void 0,x=My(h,m,i?_??null:void 0);x&&u.push(x)}}return{points:u,metric:e,metricUnit:a,dimension:i,display:s,start:n.meta?.time_range?.start,end:n.meta?.time_range?.end,truncated:n.truncated,limit:n.limit,datasource:"requests"}},SR=(n,t)=>{if(!t)return[n];const e=Xr(n,t);return Array.isArray(e)?e:[]},Xr=(n,t)=>{let e=n;for(const i of t.split(".")){if(e===null||typeof e!="object")return;e=e[i]}return e},ky=n=>Object.hasOwn(wp.chartLabels,n),TR=["hidden","single","full"];var pr=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(pr||{});const MR=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],kR=["gauge","top_n","single_value"],tl=n=>n===null||typeof n!="object"||!("points"in n)?!1:Array.isArray(n.points);var Pe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(Pe||{});const Dy={modes:{point(n,t){return el(n,t,{intersect:!0})},nearest(n,t,e){return OR(n,t,e)},x(n,t,e){return el(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return el(n,t,{intersect:e.intersect,axis:"y"})}}};function ju(n,t,e){return(Dy.modes[e.mode]||Dy.modes.nearest)(n,t,e)}function DR(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function CR(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function el(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):DR(i,t,e.axis))}function OR(n,t,e){let i=Number.POSITIVE_INFINITY;return el(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),l=CR(t,a,e.axis),u=Ur(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 gr(n,t,e){const i=Math.cos(e),r=Math.sin(e),s=t.x,a=t.y;return{x:s+i*(n.x-s)-r*(n.y-a),y:a+r*(n.x-s)+i*(n.y-a)}}const AR=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,mr=.001,nl=(n,t,e)=>Math.min(e,Math.max(t,n)),Cy=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function ER(n,t,e){for(const i of Object.keys(n))n[i]=nl(n[i],t,e);return n}function RR(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Oy(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=n.x>=t-u-mr&&n.x<=i+u+mr,h=n.y>=e-u-mr&&n.y<=r+u+mr;return s==="x"?d:(s==="y"||d)&&h}function Ay(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=gr(n,e,xe(-r));return Oy(l,t,i,{borderWidth:s,hitTolerance:a})}function yr(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function PR(n,t,e,i=!0){const r=e.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(AR(l,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Ey=n=>typeof n=="string"&&n.endsWith("%"),Ry=n=>parseFloat(n)/100,Py=n=>nl(Ry(n),0,1),go=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),IR={box:n=>go(n.centerX,n.centerY),doughnutLabel:n=>go(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>go(n.centerX,n.centerY),line:n=>go(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>go(n.centerX,n.centerY)};function Gu(n,t){return t==="start"?0:t==="end"?n:Ey(t)?Py(t)*n:n/2}function Li(n,t,e=!0){return typeof t=="number"?t:Ey(t)?(e?Py(t):Ry(t))*n:n}function LR(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Iy(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const l=Pt(a),u=t.width+(l?a.width:0)+e,d=t.height+(l?a.height:0)+e,h=Ku(i),g=Fy(n.x,u,r,h.x),m=Fy(n.y,d,s,h.y);return{x:g,y:m,x2:g+u,y2:m+d,width:u,height:d,centerX:g+u/2,centerY:m+d/2}}function Ku(n,t="center"){return Pt(n)?{x:Mt(n.x,t),y:Mt(n.y,t)}:(n=Mt(n,t),{x:n,y:n})}const Ly=(n,t)=>n&&n.autoFit&&t<1;function Ny(n,t){const e=n.font,i=qt(e)?e:[e];return Ly(n,t)?i.map(function(r){const s=le(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,le(s)}):i.map(r=>le(r))}function By(n){return n&&(en(n.xValue)||en(n.yValue))}function Fy(n,t,e=0,i){return n-Gu(t,i)+e}function Zr(n,t,e){const i=e.init;if(i){if(i===!0)return Uy(t,e)}else return;return NR(n,t,e)}function zy(n,t,e){let i=!1;return t.forEach(r=>{nn(n[r])?(i=!0,e[r]=n[r]):en(e[r])&&delete e[r]}),i}function Uy(n,t){const e=t.type||"line";return IR[e](n)}function NR(n,t,e){const i=Qt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Uy(t,e);if(Pt(i))return i}const Xu=new Map,BR=n=>isNaN(n)||n<=0,FR=n=>n.reduce(function(t,e){return t+=e.string,t},"");function il(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function rl(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(xe(i)),n.translate(-t,-e))}function li(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Qr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function sl(n,t){const e=t.content;if(il(e))return{width:Li(e.width,t.width),height:Li(e.height,t.height)};const i=Ny(t),r=t.textStrokeWidth,s=qt(e)?e:[e],a=s.join()+FR(i)+r+(n._measureText?"-spriting":"");return Xu.has(a)||Xu.set(a,WR(n,s,i,r)),Xu.get(a)}function Hy(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),Qr(n,e);const l=li(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Hr(n,{x:i,y:r,w:s,h:a,radius:ER(Ci(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),l&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Wy(n,t,e,i){const r=e.content;if(il(r)){n.save(),n.globalAlpha=YR(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=qt(r)?r:[r],a=Ny(e,i),l=e.color,u=qt(l)?l:[l],d=LR(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,zR(n,e)&&VR(n,{x:d,y:h},s,a),$R(n,{x:d,y:h},s,{fonts:a,colors:u}),n.restore()}function zR(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function UR(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*qc;if(il(a)){n.save(),n.translate(e,i),n.rotate(u),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}BR(r)||HR(n,{x:e,y:i,radius:r,rotation:l,style:a,rad:u})}function HR(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let l,u,d,h;switch(n.beginPath(),s){default:n.arc(t,e,i,0,te),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":h=i*.516,d=i-h,l=Math.cos(a+kn)*d,u=Math.sin(a+kn)*d,n.arc(t-l,e-u,h,a-Et,a-re),n.arc(t+u,e-l,h,a-re,a),n.arc(t+l,e+u,h,a,a+re),n.arc(t-u,e+l,h,a+re,a+Et),n.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,n.rect(t-d,e-d,2*d,2*d);break}a+=kn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+u,e-l),n.lineTo(t+l,e+u),n.lineTo(t-u,e+l),n.closePath();break;case"crossRot":a+=kn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l),a+=kn,l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function WR(n,t,e,i){n.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=e[Math.min(l,e.length-1)];n.font=u.string;const d=t[l];s=Math.max(s,n.measureText(d).width+i),a+=u.lineHeight}return n.restore(),{width:s,height:a}}function VR(n,{x:t,y:e},i,r){n.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.font=u.string,n.strokeText(a,t,e+d/2+s),s+=d}),n.stroke()}function $R(n,{x:t,y:e},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)],g=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=d,n.fillText(l,t,e+g/2+a),a+=g,n.fill()})}function YR(n,t){const e=Di(n)?n:t;return Di(e)?nl(e,0,1):1}const Vy=["left","bottom","top","right"];function qR(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&ZR(t,s);if(!a||JR(t,s,a))return;if(n.save(),n.beginPath(),!li(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=jR(t,a),{sideStart:h,sideEnd:g}=KR(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(h.x,h.y),n.lineTo(g.x,g.y);const m=gr({x:e,y:i},t.getCenterPoint(),xe(-t.rotation));n.lineTo(m.x,m.y),n.stroke(),n.restore()}function jR(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=GR(n,t);let l,u;return t==="left"||t==="right"?(l={x:e+a,y:i},u={x:l.x,y:s}):(l={x:e,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function GR(n,t){const{width:e,height:i,options:r}=n,s=r.callout.margin+r.borderWidth/2;return t==="right"?e+s:t==="bottom"?i+s:-s}function KR(n,t,e){const{y:i,width:r,height:s,options:a}=n,l=a.callout.start,u=XR(t,a.callout);let d,h;return t==="left"||t==="right"?(d={x:e.x,y:i+Li(s,l)},h={x:d.x+u,y:d.y}):(d={x:e.x+Li(r,l),y:e.y},h={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:h}}function XR(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function ZR(n,t){const e=t.position;return Vy.includes(e)?e:QR(n,t)}function QR(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:h,centerY:g,rotation:m}=n,_={x:h,y:g},x=t.start,v=Li(a,x),S=Li(l,x),C=[e,e+v,e+v,r],E=[i+S,s,i,s],B=[];for(let P=0;P<4;P++){const L=gr({x:C[P],y:E[P]},_,xe(m));B.push({position:Vy[P],distance:Ur(L,{x:u,y:d})})}return B.sort((P,L)=>P.distance-L.distance)[0].position}function JR(n,t,e){const{pointX:i,pointY:r}=n,s=t.margin;let a=i,l=r;return e==="left"?a+=s:e==="right"?a-=s:e==="top"?l+=s:e==="bottom"&&(l-=s),n.inRange(a,l)}const $y={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 Jr(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function _r(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),s=Object.values(n).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function Yy(n,t){if(n){const e=n.options.reverse,i=Jr(n,t.min,e?t.end:t.start),r=Jr(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function qy(n,t){const{chartArea:e,scales:i}=n,r=i[_r(i,t,"xScaleID")],s=i[_r(i,t,"yScaleID")];let a=e.width/2,l=e.height/2;return r&&(a=Jr(r,t.xValue,r.left+r.width/2)),s&&(l=Jr(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function Zu(n,t){const e=n.scales,i=e[_r(e,t,"xScaleID")],r=e[_r(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:l,bottom:u}=r||n.chartArea;const d=Ky(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=Ky(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 jy(n,t){if(!By(t)){const e=Zu(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,s=e.centerX+t.xAdjust,a=e.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 eP(n,t)}function tP(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?nP(r,s,t):iP(e,s,t),s}function Gy(n,t){const e=Zu(n,t);return e.initProperties=Zr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:oP(n,e,t),initProperties:e.initProperties}],e}function eP(n,t){const e=qy(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Ky(n,t){const e=Yy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function nP(n,t,e){const i=Jr(n,e.value,NaN),r=Jr(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function iP(n,t,e){for(const i of Object.keys($y)){const r=n[_r(n,e,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=$y[i],g=Yy(r,{min:e[s],max:e[a],start:r[l],end:r[u]});t[d]=g.start,t[h]=g.end}}}function rP({properties:n,options:t},e,i,r){const{x:s,x2:a,width:l}=n;return Xy({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function sP({properties:n,options:t},e,i,r){const{y:s,y2:a,height:l}=n;return Xy({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Xy(n,t){const{start:e,end:i,borderWidth:r}=n,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-e-a-l-t.size;return e+r/2+u+Gu(d,s)}function oP(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ku(i.position),s=we(i.padding),a=sl(n.ctx,i),l=rP({properties:t,options:e},a,r,s),u=sP({properties:t,options:e},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 Qu=["enter","leave"],Ju=Qu.concat("click");function aP(n,t,e){t.listened=zy(e,Ju,t.listeners),t.moveListened=!1,Qu.forEach(i=>{nn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&nn(i.click)&&(t.listened=!0),t.moveListened||Qu.forEach(r=>{nn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function lP(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return cP(n,t,e);case"click":return uP(n,t,e)}}function cP(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=ju(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=Zy(s,"leave",r,i);return Zy(s,"enter",i,r)||a}function Zy({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=Qy(a.options[e]||n.listeners[e],a,t)||s);return s}function uP(n,t,e){const i=n.listeners,r=ju(n.visibleElements,t,e.interaction);let s;for(const a of r)s=Qy(a.options.click||i.click,a,t)||s;return s}function Qy(n,t,e){return Qt(n,[t.$context,e])===!0}const ol=["afterDraw","beforeDraw"];function dP(n,t,e){const i=t.visibleElements;t.hooked=zy(e,ol,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ol.forEach(s=>{nn(r.options[s])&&(t.hooked=!0)})})}function Jy(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Qt(i,[t.$context])}}function fP(n,t,e){const i=yP(n.scales,t,e);let r=t_(t,i,"min","suggestedMin");r=t_(t,i,"max","suggestedMax")||r,r&&nn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function hP(n,t){for(const e of n)gP(e,t)}function t_(n,t,e,i){if(ae(t[e])&&!pP(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function pP(n,t,e){return en(n[t])||en(n[e])}function gP(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=_r(t,n,e);i&&!t[i]&&mP(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function mP(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(en(n[e+i]))return!0;return!1}function yP(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Mt(t.min,Number.NEGATIVE_INFINITY),max:Mt(t.max,Number.POSITIVE_INFINITY)};for(const l of e)l.scaleID===r?e_(l,t,["value","endValue"],a):_r(n,l,s)===r&&e_(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function e_(n,t,e,i){for(const r of e){const s=n[r];if(en(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class ts extends Ve{inRange(t,e,i,r){const{x:s,y:a}=gr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation));return Oy({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return yr(this,t)}draw(t){t.save(),rl(t,this.getCenterPoint(),this.options.rotation),Hy(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Gy(t,e)}}ts.id="boxAnnotation",ts.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},ts.defaultRoutes={borderColor:"color",backgroundColor:"color"},ts.descriptors={label:{_fallback:!0}};class al extends Ve{inRange(t,e,i,r){return Ay({x:t,y:e},{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 yr(this,t)}draw(t){const e=this.options;!e.display||!e.content||(SP(t,this),t.save(),rl(t,this.getCenterPoint(),this.rotation),Wy(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=_P(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=xP(t,e,i);let l=sl(t.ctx,e);const u=wP(l,a);Ly(e,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:g}=e,m=Iy(s,l,{borderWidth:0,position:d,xAdjust:h,yAdjust:g});return{initProperties:Zr(t,m,e),...m,...r,rotation:e.rotation,_fitRatio:u}}}al.id="doughnutLabelAnnotation",al.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},al.defaultRoutes={};function _P(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Zs&&bP(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function bP(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function xP({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:l,offsetX:u,offsetY:d}=e.controller,h=(i+s)/2+u,g=(r+a)/2+d,m={left:Math.max(h-l,i),right:Math.min(h+l,s),top:Math.max(g-l,r),bottom:Math.min(g+l,a)},_={x:(m.left+m.right)/2,y:(m.top+m.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=_.y>g,C=S?r+x:a-x,E=vP(C,h,g,v);return{controllerMeta:{_centerX:h,_centerY:g,_radius:v,_counterclockwise:S,...E},point:_,radius:Math.min(l,Math.min(m.right-m.left,m.bottom-m.top)/2)}}function wP({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function vP(n,t,e,i){const r=Math.pow(e-n,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:te};const d=(-a-Math.sqrt(u))/2,h=(-a+Math.sqrt(u))/2;return{_startAngle:va({x:t,y:e},{x:d,y:n}).angle,_endAngle:va({x:t,y:e},{x:h,y:n}).angle}}function SP(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;n.save();const d=li(n,u);n.fillStyle=u.backgroundColor,n.beginPath(),n.arc(e,i,r,s,a,l),n.closePath(),n.fill(),d&&n.stroke(),n.restore()}class mo extends Ve{inRange(t,e,i,r){return Ay({x:t,y:e},{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 yr(this,t)}draw(t){const e=this.options,i=!en(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),rl(t,this.getCenterPoint(),this.rotation),qR(t,this),Hy(t,this,e),Wy(t,TP(this),e),t.restore())}resolveElementProperties(t,e){let i;if(By(e))i=qy(t,e);else{const{centerX:l,centerY:u}=Zu(t,e);i={x:l,y:u}}const r=we(e.padding),s=sl(t.ctx,e),a=Iy(i,s,e,r);return{initProperties:Zr(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}mo.id="labelAnnotation",mo.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},mo.defaultRoutes={borderColor:"color"};function TP({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=we(r.padding);return{x:n+a.left+s,y:t+a.top+s,width:e-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const td=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ed=(n,t,e)=>td(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,n_=(n,t,e)=>td(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,yo=n=>n*n,MP=(n,t,{x:e,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},i_=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,nd=(n,t,e,i)=>({x:i_(n.x,t.x,e.x,i),y:i_(n.y,t.y,e.y,i)}),r_=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),s_=(n,t,e,i)=>-Math.atan2(r_(n.x,t.x,e.x,i),r_(n.y,t.y,e.y,i))+.5*Et;class _o extends Ve{inRange(t,e,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:l,ctx:u}=this;if(l){li(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,g=t*h.currentDevicePixelRatio,m=e*h.currentDevicePixelRatio,_=u.isPointInStroke(l,g,m)||id(this,a,r);return u.restore(),_}const d=yo(s);return OP(this,a,d,r)||id(this,a,r)}return kP(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return yr(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!li(t,l))return t.restore();Qr(t,l);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(l.curve&&a)return BP(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:g,endAdjust:m}=u_(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+g,0),t.lineTo(u-m,0),t.shadowColor=l.borderShadowColor,t.stroke(),rd(t,0,g,d),rd(t,u,-m,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=tP(t,e),{x:r,y:s,x2:a,y2:l}=i,u=DP(i,t.chartArea),d=u?CP({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=Zr(t,d,e),e.curve){const g={x:d.x,y:d.y},m={x:d.x2,y:d.y2};d.cp=NP(d,e,Ur(g,m))}const h=AP(t,d,e.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}_o.id="lineAnnotation";const o_={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};_o.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},o_),fill:!1,length:12,start:Object.assign({},o_),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},mo.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},_o.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},_o.defaultRoutes={borderColor:"color"};function kP(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=MP(t,e,n.getProps(["x","y","x2","y2"],s),i);return Cy(a,r)||id(n,{mouseX:t,mouseY:e},s,i)}function DP({x:n,y:t,x2:e,y2:i},{top:r,right:s,bottom:a,left:l}){return!(n<l&&e<l||n>s&&e>s||t<r&&i<r||t>a&&i>a)}function a_({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=n_(a,{x:n,y:t},e),n=a),n>r&&(t=n_(r,{x:n,y:t},e),n=r),t<i&&(n=ed(i,{x:n,y:t},e),t=i),t>s&&(n=ed(s,{x:n,y:t},e),t=s),{x:n,y:t}}function CP(n,t,e){const{x:i,y:r}=a_(n,t,e),{x:s,y:a}=a_(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function OP(n,{mouseX:t,mouseY:e},i=mr,r){const{x:s,y:a,x2:l,y2:u}=n.getProps(["x","y","x2","y2"],r),d=l-s,h=u-a,g=yo(d)+yo(h),m=g===0?-1:((t-s)*d+(e-a)*h)/g;let _,x;return m<0?(_=s,x=a):m>1?(_=l,x=u):(_=s+m*d,x=a+m*h),yo(t-_)+yo(e-x)<=i}function id(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function AP(n,t,e){const i=e.borderWidth,r=we(e.padding),s=sl(n.ctx,e),a=s.width+r.width+i,l=s.height+r.height+i;return RP(t,e,{width:a,height:l,padding:r},n.chartArea)}function EP(n){const{x:t,y:e,x2:i,y2:r}=n,s=Math.atan2(r-e,i-t);return s>Et/2?s-Et:s<Et/-2?s+Et:s}function RP(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:l,yAdjust:u}=t,d={x:n.x,y:n.y},h={x:n.x2,y:n.y2},g=t.rotation==="auto"?EP(n):xe(t.rotation),m=PP(r,s,g),_=IP(n,t,{labelSize:m,padding:a},i),x=n.cp?nd(d,n.cp,h,_):td(d,h,_),v={size:m.w,min:i.left,max:i.right,padding:a.left},S={size:m.h,min:i.top,max:i.bottom,padding:a.top},C=c_(x.x,v)+l,E=c_(x.y,S)+u;return{x:C-r/2,y:E-s/2,x2:C+r/2,y2:E+s/2,centerX:C,centerY:E,pointX:x.x,pointY:x.y,width:r,height:s,rotation:wa(g)}}function PP(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function IP(n,t,e,i){let r;const s=LP(n,i);return t.position==="start"?r=l_({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-l_({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=Gu(1,t.position),r}function l_(n,t,e,i){const{labelSize:r,padding:s}=t,a=n.w*i.dx,l=n.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 nl(Math.max(u,d),0,.25)}function LP(n,t){const{x:e,x2:i,y:r,y2:s}=n,a=Math.min(r,s)-t.top,l=Math.min(e,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(e,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function c_(n,t){const{size:e,min:i,max:r,padding:s}=t,a=e/2;return e>r-i?(r+i)/2:(i>=n-s-a&&(n=i+s+a),r<=n+s+a&&(n=r-s-a),n)}function u_(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:d_(n,e),endAdjust:d_(n,i)}}function d_(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,s={x:e,y:i+r};return Math.abs(ed(0,s,{x:0,y:r}))}function rd(n,t,e,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+e;n.beginPath(),Qr(n,i),li(n,i),n.moveTo(d,-s),n.lineTo(t+e,0),n.lineTo(d,s),a===!0?(n.fillStyle=l||u,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function NP(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=n,d=Math.atan2(a-r,s-i),h=Ku(t.controlPoint,0),g={x:l+Li(e,h.x,!1),y:u+Li(e,h.y,!1)};return gr(g,{x:l,y:u},d)}function f_(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),rd(n,0,-r,s),n.restore())}function BP(n,t,e,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:g,endAdjust:m}=u_(t),_={x:r,y:s},x={x:a,y:l},v=s_(_,e,x,0),S=s_(_,e,x,1)-Et,C=nd(_,e,x,g/i),E=nd(_,e,x,1-m/i),B=new Path2D;n.beginPath(),B.moveTo(C.x,C.y),B.quadraticCurveTo(e.x,e.y,E.x,E.y),n.shadowColor=u.borderShadowColor,n.stroke(B),t.path=B,t.ctx=n,f_(n,C,{angle:v,adjust:g},d),f_(n,E,{angle:S,adjust:m},h)}class bo extends Ve{inRange(t,e,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return FP({x:t,y:e},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),g=i==="y"?{start:u,end:h}:{start:l,end:d},m=gr({x:t,y:e},this.getCenterPoint(r),xe(-s));return m[i]>=g.start-a-mr&&m[i]<=g.end+a+mr}getCenterPoint(t){return yr(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),rl(t,this.getCenterPoint(),a.rotation),Qr(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=li(t,a);t.ellipse(r,s,i/2,e/2,Et/2,0,2*Et),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Gy(t,e)}}bo.id="ellipseAnnotation",bo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},ts.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},bo.defaultRoutes={borderColor:"color",backgroundColor:"color"},bo.descriptors={label:{_fallback:!0}};function FP(n,t,e,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=xe(e||0),g=Math.cos(h),m=Math.sin(h),_=Math.pow(g*(n.x-a)+m*(n.y-l),2),x=Math.pow(m*(n.x-a)-g*(n.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class ll extends Ve{inRange(t,e,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"?RR({x:t,y:e},this.getCenterPoint(r),d/2,h):Cy(i==="y"?{start:a,end:u,value:e}:{start:s,end:l,value:t},h)}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Qr(t,e);const r=li(t,e);UR(t,this,this.centerX,this.centerY),r&&!il(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=jy(t,e);return i.initProperties=Zr(t,i,e),i}}ll.id="pointAnnotation",ll.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},ll.defaultRoutes={borderColor:"color",backgroundColor:"color"};class cl extends Ve{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&UP(this.elements,t,e,r);const s=gr({x:t,y:e},this.getCenterPoint(r),xe(-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 yr(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Qr(t,i);const r=li(t,i);let s=!0;for(const a of e)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,e){const i=jy(t,e),{sides:r,rotation:s}=e,a=[],l=2*Et/r;let u=s*qc;for(let d=0;d<r;d++,u+=l){const h=zP(i,e,u);h.initProperties=Zr(t,i,e),a.push(h)}return i.elements=a,i}}cl.id="polygonAnnotation",cl.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},cl.defaultRoutes={borderColor:"color",backgroundColor:"color"};function zP({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:n+l*e,y:t-u*e};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:n+l*(e+a),bY:t-u*(e+a)}}}function UP(n,t,e,i){let r=!1,s=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const l=a.getProps(["bX","bY"],i);l.bY>e!=s.bY>e&&t<(s.bX-l.bX)*(e-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const Ni={box:ts,doughnutLabel:al,ellipse:bo,label:mo,line:_o,point:ll,polygon:cl};Object.keys(Ni).forEach(n=>{se.describe(`elements.${Ni[n].id}`,{_fallback:"plugins.annotation.common"})});const HP={update:Object.assign},WP=Ju.concat(ol),h_=(n,t)=>Pt(t)?ad(n,t):n,sd=n=>n==="color"||n==="font";function od(n="line"){return Ni[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function VP(n,t,e,i){const r=YP(n,e.animations,i),s=t.annotations,a=GP(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=p_(a,l,u.type),h=u.setContext(jP(n,d,a,u)),g=d.resolveElementProperties(n,h);g.skip=$P(g),"elements"in g&&(qP(d,g.elements,h,r),delete g.elements),en(d.x)||Object.assign(d,g),Object.assign(d,g.initProperties),g.options=g_(h),r.update(d,g)}}function $P(n){return isNaN(n.x)||isNaN(n.y)}function YP(n,t,e){return e==="reset"||e==="none"||e==="resize"?HP:new ou(n,t)}function qP(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=p_(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);l.options=g_(d),i.update(u,l)}}function p_(n,t,e,i){const r=Ni[od(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function g_(n){const t=Ni[od(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,ad(n,t.defaults),ad(n,t.defaultRoutes));for(const i of WP)e[i]=n[i];return e}function ad(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];sd(i)&&qt(s)?e[i]=s.map(a=>h_(a,r)):e[i]=h_(s,r)}return e}function jP(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function GP(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var KP="3.1.0";const Bi=new Map,m_=n=>n.type!=="doughnutLabel",XP=Ju.concat(ol);var y_={id:"annotation",version:KP,beforeRegister(){PR("chart.js","4.0",rn.version)},afterRegister(){rn.register(Ni)},afterUnregister(){rn.unregister(Ni)},beforeInit(n){Bi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Bi.get(n),r=i.annotations=[];let s=e.annotations;Pt(s)?Object.keys(s).forEach(a=>{const l=s[a];Pt(l)&&(l.id=a,r.push(l))}):qt(s)&&r.push(...s),hP(r.filter(m_),n.scales)},afterDataLimits(n,t){const e=Bi.get(n);fP(n,t.scale,e.annotations.filter(m_).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Bi.get(n);aP(n,i,e),VP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),dP(n,i,e)},beforeDatasetsDraw(n,t,e){xo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){xo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){xo(n,t.index,e.clip)},beforeDraw(n,t,e){xo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){xo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Bi.get(n);lP(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Bi.delete(n)},getAnnotations(n){const t=Bi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return ju(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!XP.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Ni[od(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:sd,_fallback:!0},_indexable:sd}},additionalOptionScopes:[""]};function xo(n,t,e){const{ctx:i,chartArea:r}=n,s=Bi.get(n);e&&js(i,r);const a=ZP(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)QP(i,r,s,l);e&&Gs(i)}function ZP(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function QP(n,t,e,i){const r=i.element;i.main?(Jy(e,r,"beforeDraw"),r.draw(n,t),Jy(e,r,"afterDraw")):r.draw(n,t)}const JP={class:"zoom-timerange-container"},t2={class:"zoom-timerange-details"},e2={class:"label","data-testid":"zoom-timerange-from"},n2={class:"label","data-testid":"zoom-timerange-to"},i2=p.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(ho({tickValue:t.start,granularity:t.granularity})),r=p.ref(ho({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{ey(()=>{i.value=ho({tickValue:a,granularity:t.granularity}),r.value=ho({tickValue:l,granularity:t.granularity})},100)()};return p.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(p.openBlock(),p.createElementBlock("div",JP,[p.createElementVNode("div",t2,[p.createElementVNode("div",e2,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",n2,p.toDisplayString(p.unref(e).t("zoom_time_range.to")),1),p.createElementVNode("div",null,p.toDisplayString(r.value),1)])]))}}),an=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},__=an(i2,[["__scopeId","data-v-4fa681cf"]]),r2={class:"zoom-actions-container"},s2={class:"zoom-actions-heading"},o2={class:"zoom-action-select"},a2=["data-testid"],l2=["aria-disabled","href"],c2=["onClick"],u2=an(p.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,r=s=>{s.action&&(s.action(e.newTimeRange),i("onAction"))};return(s,a)=>(p.openBlock(),p.createElementBlock("div",r2,[p.createElementVNode("div",s2,[p.createVNode(__,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),p.createVNode(p.unref(Ts.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=p.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),p.createElementVNode("div",o2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.zoomActionItems,l=>(p.openBlock(),p.createElementBlock("div",{key:l.key,class:p.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(p.openBlock(),p.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},p.toDisplayString(l.label),9,l2)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(l)},p.toDisplayString(l.label),9,c2))],10,a2))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),d2={key:2},f2={class:"tooltip-title"},h2={class:"title"},p2={key:0,class:"subtitle"},g2={class:"context"},m2={class:"metric"},y2={class:"tooltip"},_2={key:0},b2={class:"display-value"},wo=an(p.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,r=p.ref(null),{x:s,y:a,isDragging:l}=dE(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=p.computed(()=>`${a.value}px`),d=p.computed(()=>`${s.value}px`),h=p.computed(()=>i.state.tooltipContext),g=p.computed(()=>i.state.metricDisplay),m=p.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return p.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),p.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),p.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();e("dimensions",{width:x,height:v})}}),(_,x)=>n.state.showTooltip?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:p.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:p.normalizeStyle({transform:m.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:m.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(p.openBlock(),p.createBlock(__,{key:0,end:n.zoomTimeRange?.end,granularity:n.granularity,start:n.zoomTimeRange?.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(p.openBlock(),p.createBlock(u2,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(p.openBlock(),p.createElementBlock("div",d2,[p.createElementVNode("div",f2,[p.createElementVNode("div",h2,[p.createElementVNode("div",null,p.toDisplayString(n.tooltipTitle),1),m.value?(p.openBlock(),p.createBlock(p.unref(Ts.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])):p.createCommentVNode("",!0)]),h.value||g.value?(p.openBlock(),p.createElementBlock("div",p2,[p.createElementVNode("div",g2,p.toDisplayString(h.value),1),p.createElementVNode("div",m2,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",y2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:C,value:E,isSegmentEmpty:B},P)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:C+P},[n.state.tooltipSeries.length?(p.openBlock(),p.createElementBlock("li",_2,[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:String(v),borderColor:String(S)})},null,4),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:B}])},p.toDisplayString(C),3),p.createElementVNode("span",b2,p.toDisplayString(E),1)])):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),x2={key:0,class:"legend-container","data-testid":"legend"},w2=["onClick"],v2=["title"],S2={class:"label truncate-label"},T2={key:0,class:"sub-label"},M2={class:"tooltip-content"},ul=an(p.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.inject("showLegendValues",!1),r=p.inject("legendPosition",p.ref(Pe.Bottom)),s=(l=0,u)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart,h=a(l,u);!d.getDatasetMeta(l).dataset&&u!==void 0?d.toggleDataVisibility(u):h?d.hide(l,u):d.show(l,u),d.update()},a=(l=0,u)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||u===void 0?d.isDatasetVisible(l):d.getDataVisibility(u)};return(l,u)=>{const d=p.resolveComponent("KTooltip");return p.unref(r)!==p.unref(Pe).Hidden?(p.openBlock(),p.createElementBlock("ul",x2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:h,strokeStyle:g,text:m,datasetIndex:_,index:x,value:v,isSegmentEmpty:S})=>(p.openBlock(),p.createElementBlock("li",{key:m,onClick:C=>s(_,x)},[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:h,"border-color":g})},null,4),p.createVNode(d,null,p.createSlots({default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["label-container",{"strike-through":!a(_,x)}]),title:v&&p.unref(i)?`${m}: ${v.formatted}`:m},[p.createElementVNode("div",S2,p.toDisplayString(m),1),v&&p.unref(i)?(p.openBlock(),p.createElementBlock("div",T2,p.toDisplayString(v.formatted),1)):p.createCommentVNode("",!0)],10,v2)]),_:2},[S?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",M2,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,w2))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-388cf4f5"]]),Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));function k2(n,t=0){return(Ie[n[t+0]]+Ie[n[t+1]]+Ie[n[t+2]]+Ie[n[t+3]]+"-"+Ie[n[t+4]]+Ie[n[t+5]]+"-"+Ie[n[t+6]]+Ie[n[t+7]]+"-"+Ie[n[t+8]]+Ie[n[t+9]]+"-"+Ie[n[t+10]]+Ie[n[t+11]]+Ie[n[t+12]]+Ie[n[t+13]]+Ie[n[t+14]]+Ie[n[t+15]]).toLowerCase()}const D2=new Uint8Array(16);function C2(){return crypto.getRandomValues(D2)}function ld(n,t,e){return crypto.randomUUID?crypto.randomUUID():O2(n)}function O2(n,t,e){n=n||{};const i=n.random??n.rng?.()??C2();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,k2(i)}const b_=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,s=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):e.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),e.restore()};class x_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&b_(t,this._clickedElements)}afterEvent(t,{event:e}){if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,b_(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 A2=["id"],E2=["id"],R2={class:"axis-tooltip-content"},P2="100%",I2="100%",L2=20,N2=20,w_=6,B2=0,F2=10,z2=10,U2=1,H2=an(p.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{translateUnit:i}=kt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new x_,l=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:$},st)=>{const ot=$.data,lt=ot.labels?.indexOf(st);return ot.datasets.reduce((pt,dt,It)=>{if($.isDatasetVisible(It)){const zt=dt.data[lt];return isNaN(zt)?pt:pt+zt}else return pt},0)},h=($,st,ot,lt)=>{const pt=lt==="horizontal";st===null&&(st=e.t("entityNoName"));const dt={type:"label",yValue:vt=>pt?st:d(vt,st),xValue:vt=>pt?d(vt,st):st},It={...dt,position:pt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>pt?0:-Math.abs(PE()),content:vt=>ry(d(vt,st),ot)},zt={...dt,content:vt=>LE(d(vt,st),IE(vt.chart,$)),position:pt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:vt=>pt?RE(ry(d(vt,st),ot)):0,color:ME};return{[`${st}-value`]:It,[`${st}-percent`]:zt}},g=p.useTemplateRef("canvas"),m=p.useTemplateRef("axis"),_=ld(),x=ld(),v=p.ref([]),S=p.inject("legendPosition",Pe.Bottom),C=p.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),E=p.toRef(t,"metricUnit"),B=p.computed(()=>t.orientation==="horizontal"),P=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:B.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:L,tooltipAbsoluteTop:I}=kt.useTooltipAbsolutePosition(u,P),N=p.ref(0),T=()=>t.annotations&&t.chartData.labels?.reduce(($,st)=>Object.assign($,h(t.chartData,st,E.value,t.orientation)),{}),M={id:_,afterUpdate($){N.value+=1,v.value=Ou($,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate($){$.options.plugins.annotation.annotations=t.annotations?T():{}}},W=[M,{id:"axisHover",afterEvent($,st){if(C.show=!1,st.event.type==="mousemove"){const ot=st.event,lt=$.options.indexAxis,pt=$.scales,dt=$.scales[lt].getLabelForValue(Number($.scales[lt].getValueForPixel(ot[lt]))),zt=$.scales[lt].getLabels().indexOf(dt),vt=t.chartData.isLabelEmpty?.[zt];if((Dt=>Dt==="x"?ot.y>pt.x.top:ot.x<pt.y.right)(lt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ve=$.canvas.getContext("2d").measureText(dt).width,bt=Math.abs(Math.round(ot.x-ve*.5)),jt=Math.round(ot.x+ve*.5),Oe=$.canvas.getBoundingClientRect(),Ae=40;C.left=lt==="x"?`${(bt>0?bt:jt)-C.offset+Oe.left}px`:`${ot.x-ve*.5-C.offset+Oe.left}px`,C.top=`${ot.y-Ae+Oe.top}px`,dt.length>Za?(C.show=!0,C.text=dt):vt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],it=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),ut=p.ref(0),ft=p.ref(0),j=new ResizeObserver(ey($=>{ut.value=$[0].contentRect.width,ft.value=$[0].contentRect.height},100)),tt=p.computed(()=>{const $=t.chartData?.labels?.length;return g.value&&$&&!B.value?`${Math.max($*(L2+w_),ut.value)}px`:P2}),nt=p.computed(()=>{const $=t.chartData?.labels?.length;return g.value&&$&&B.value?`${Math.max($*(N2+w_),ft.value)}px`:I2});kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&rn.register(y_),l.value&&(ut.value=l.value.offsetWidth,ft.value=l.value.offsetHeight,j.observe(l.value))}),p.onUnmounted(()=>{l.value&&j.unobserve(l.value)});const et=p.computed(()=>{const $=kt.useBarChartOptions({tooltipState:P,legendID:_,stacked:p.toRef(t,"stacked"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),indexAxis:B.value?"y":"x",numLabels:it});return{...$.value,plugins:{...$.value.plugins,annotation:{annotations:T(),clip:!1}}}}),at=kt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),W,et);p.onBeforeUnmount(()=>{rn.unregister(y_)});const H={[Pe.Bottom]:"column"},q=p.computed(()=>{if(m.value&&at.value){const $=window.devicePixelRatio,st=at.value,ot=st.scales.y.width*$+U2,lt=(st.scales.y.height+st.scales.y.top+st.scales.x.height)*$,pt=m.value.getContext("2d");return pt.scale($,$),pt.canvas.width=ot,pt.canvas.height=lt,pt.canvas.style.width=`${ot/$}px`,pt.canvas.style.height=`${lt/$}px`,{scale:$,width:ot*$,height:lt*$,targetCtx:pt}}return null}),X=$=>{const st=$.target;if(q.value&&at.value&&!B.value){const ot=q.value.scale,lt=q.value.targetCtx,pt=q.value.width,dt=q.value.height,It=at.value,zt=It.canvas;lt.fillStyle="white",st.scrollLeft>=B2&&st.scrollLeft<=F2?(lt.globalCompositeOperation="source-over",lt.clearRect(0,0,pt,dt),lt.drawImage(zt,0,0,pt,dt,0,0,pt,dt),lt.globalCompositeOperation="destination-over",lt.fillRect(0,0,pt,dt)):(lt.globalCompositeOperation="source-over",lt.fillRect(0,(It.scales.y.height+It.scales.y.top+z2)*ot,pt,It.scales.x.height*ot))}P.offsetY=st.scrollTop,P.offsetX=st.scrollLeft,C.offset=st.scrollLeft},_t=({width:$,height:st})=>{P.width=$,P.height=st};p.watch(()=>t.orientation,()=>{if(m.value&&q.value){const $=q.value.width,st=q.value.height;(m.value?.getContext("2d")).clearRect(0,0,$,st)}P.showTooltip=!1,P.interactionMode="idle"}),p.watch(()=>t.annotations,$=>{at.value&&($?at.value.options.plugins.annotation.annotations=T(t.chartData):delete at.value.options.plugins.annotation.annotations)});const G=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return($,st)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",H[p.unref(S)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,A2),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:st[0]||(st[0]=ot=>G()),onScroll:X},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:tt.value,height:nt.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,E2)],4)],544),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[C.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:"axis-tooltip",style:p.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[p.createElementVNode("div",R2,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(wo,{"absolute-left":p.unref(L),"absolute-top":p.unref(I),"chart-parent-ref":u.value,state:P,"tooltip-title":n.tooltipTitle,onDimensions:_t},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),p.createVNode(ul,{id:p.unref(_),"chart-instance":p.unref(at),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const W2={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"};Ag._date.override({_id:"date-fns",formats:function(){return W2},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=At(n):e==="string"&&(typeof t=="string"?n=jT(n,t,new Date,this.options):n=bp(n,this.options)),Ec(n)?n.getTime():null},format:function(n,t){return da(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Oc(n,t);case"second":return W1(n,t);case"minute":return U1(n,t);case"hour":return B1(n,t);case"day":return ca(n,t);case"week":return V1(n,t);case"month":return Cc(n,t);case"quarter":return H1(n,t);case"year":return $1(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Rc(n,t);case"second":return Q1(n,t);case"minute":return K1(n,t);case"hour":return G1(n,t);case"day":return Zh(n,t);case"week":return J1(n,t);case"month":return ep(n,t);case"quarter":return Z1(n,t);case"year":return tS(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return ZT(n);case"minute":return XT(n);case"hour":return KT(n);case"day":return Ac(n);case"week":return Wn(n);case"isoWeek":return Wn(n,{weekStartsOn:+e});case"month":return nS(n);case"quarter":return eS(n);case"year":return np(n);default:return n}},endOf:function(n,t){switch(t){case"second":return lS(n);case"minute":return oS(n);case"hour":return rS(n);case"day":return Jh(n);case"week":return sS(n);case"month":return tp(n);case"quarter":return aS(n);case"year":return iS(n);default:return n}}});const v_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},V2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...v_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},$2=p.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function es(n){return p.isProxy(n)?p.toRaw(n):n}function Y2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function q2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function S_(n,t){n.labels=t}function T_(n,t,e){const i=[];n.datasets=t.map(r=>{const s=n.datasets.find(a=>a[e]===r[e]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function j2(n,t){const e={labels:[],datasets:[]};return S_(e,n.labels),T_(e,n.datasets,t),e}const G2=p.defineComponent({props:V2,setup(n,t){let{expose:e,slots:i}=t;const r=p.ref(null),s=p.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:h,options:g,plugins:m,datasetIdKey:_}=n,x=j2(h,_),v=Y2(x,h);s.value=new rn(r.value,{type:d,data:v,options:{...g},plugins:m})},l=()=>{const d=p.toRaw(s.value);d&&(n.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},n.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(n.updateMode)};return p.onMounted(a),p.onUnmounted(l),p.watch([()=>n.options,()=>n.data],(d,h)=>{let[g,m]=d,[_,x]=h;const v=p.toRaw(s.value);if(!v)return;let S=!1;if(g){const C=es(g),E=es(_);C&&C!==E&&(q2(v,C),S=!0)}if(m){const C=es(m.labels),E=es(x.labels),B=es(m.datasets),P=es(x.datasets);C!==E&&(S_(v.config.data,C),S=!0),B&&B!==P&&(T_(v.config.data,B,n.datasetIdKey),S=!0)}S&&p.nextTick(()=>{u(v)})},{deep:!0}),()=>p.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[p.h("p",{},[i.default?i.default():""])])}});function dl(n,t){return rn.register(t),p.defineComponent({props:v_,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=p.shallowRef(null);p.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>p.h(G2,$2({ref:l},{type:n,...e}))}})}const M_=dl("bar",kg),k_=dl("doughnut",Zs),D_=dl("line",Dg),K2=dl("scatter",Og),X2={class:"chart-container"},Z2={key:0,class:"chart-center-metric"},Q2={class:"chart-center-total"},J2={key:0,class:"chart-center-unit"},tI=p.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Pe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>ai},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),{i18n:i}=kt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=p.ref([]),l=p.useTemplateRef("chartParent"),u=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:h}=kt.useTooltipAbsolutePosition(l,u),g={id:r,afterUpdate(N){a.value=N.options.plugins.legend.labels.generateLabels(N).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},m=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((T,M)=>(T.labels.push(M.label),T.backgroundColor.push(M.backgroundColor),T.hoverBorderColor.push(Ta(M.backgroundColor).saturate(.5).darken(.15).hexString()),T.data.push(M.data.reduce((O,z)=>O+z,0)),T),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=er({i18n:i}),v=p.computed(()=>_R(t.metricName??"")),S=p.computed(()=>{const N=_.value[0]?.data.reduce((T,M)=>T+M,0)??0;return x(N,t.metricUnit,{approximate:!0,translateUnit:(T,M)=>e(T,M)}).trim()}),C=p.computed(()=>t.tooltipMetricDisplay||""),E=p.computed(()=>({...t.chartData,datasets:_.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const{options:B}=kt.useDonutChartOptions({tooltipState:u,legendID:r}),P=p.ref(),L=N=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[N],I=({width:N,height:T})=>{u.width=N,u.height=T};return(N,T)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",X2,[p.createVNode(p.unref(k_),{ref_key:"chartInstance",ref:P,"chart-id":p.unref(s),data:E.value,options:p.unref(B),plugins:m.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&v.value?(p.openBlock(),p.createElementBlock("div",Z2,[p.createElementVNode("span",Q2,p.toDisplayString(S.value),1),C.value?(p.openBlock(),p.createElementBlock("span",J2,p.toDisplayString(C.value),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(wo,{"absolute-left":p.unref(d),"absolute-top":p.unref(h),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:I},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),p.createVNode(ul,{id:p.unref(r),"chart-instance":P.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),eI=an(tI,[["__scopeId","data-v-48b16272"]]);class nI{id="outlierBandPlugin";beforeDatasetsDraw(t,e,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 g=t.ctx;g.save(),g.fillStyle=i.color,g.fillRect(u,a,d-u,h-a),g.restore()}}const iI={class:"chart-container"},rI=an(p.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},granularity:{},timeRangeMs:{default:void 0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1}},setup(n){const t=n,e=p.inject("legendPosition",Pe.Bottom),i=p.inject("app:konnectColorMode",p.computed(()=>"light")),{translateUnit:r}=kt.useTranslatedUnits(),s=p.useTemplateRef("chartParent"),a=new nI,l=crypto.randomUUID(),u=crypto.randomUUID(),d=p.ref(Ja()),h=p.ref(),g=p.ref([]),m=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:r,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:u,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=kt.useTooltipAbsolutePosition(s,m);kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{d.value=Ja(s.value)}),p.watch(i,()=>{d.value=Ja(s.value)});const v=p.computed(()=>{const I=t.legendValues;if(!I)return;const N={};for(const{label:T,total:M}of t.chartData?.datasets||[])M!==void 0&&T&&T in I&&(N[T]=I[T]);return N}),S={id:l,afterUpdate(I){g.value=Ou(I,v.value,t.chartLegendSortFn)}},C=p.computed(()=>t.shadeOutlierRegion?t.chartData?.outlierValue:void 0),E=p.computed(()=>[S,...C.value!==void 0?[a]:[]]),B=p.computed(()=>`scatter-${E.value.map(I=>I.id).join("-")}`),{options:P}=kt.useScatterChartOptions({tooltipState:m,legendID:l,granularity:p.toRef(t,"granularity"),timeRangeMs:p.toRef(t,"timeRangeMs"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),outlierValue:C,themeColors:d}),L=I=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[I];return(I,N)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(p.unref(e))]),"data-testid":"scatter-chart-parent"},[p.createElementVNode("div",iI,[(p.openBlock(),p.createBlock(p.unref(K2),{key:B.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(u),class:"chart-canvas",data:n.chartData,"data-testid":"scatter-chart",options:p.unref(P),plugins:E.value},null,8,["chart-id","data","options","plugins"]))]),p.createVNode(wo,{"absolute-left":p.unref(_),"absolute-top":p.unref(x),"data-testid":"tooltip",granularity:n.granularity,state:m,"tooltip-title":n.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),p.createVNode(ul,{id:p.unref(l),"chart-instance":h.value,"data-testid":"legend",items:g.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-2f7608cd"]]),cd=(n,t,e,i,r="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=r,n.stroke(),n.restore()},Ze={},sI=()=>{Ze.x=void 0,Ze.chart=void 0,Ze.strategy=void 0,Ze.group=void 0},oI=10;class C_{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){let r=!1;e==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<oI)return;const r=()=>{Ze.chart=e,Ze.strategy=this._brushStrategy,Ze.group=this._brushGroup;for(const s of Object.values(rn.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Ze.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Ze.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:r}=t.tooltip.dataPoints[0].element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Ze.x===void 0)return;const e=Ze.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Ze.group===this._brushGroup&&cd(t.ctx,Ze.x,t.scales.y.top,t.scales.y.bottom,e)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Ze.chart===t){const e=Ze.x!==void 0;if(sI(),e)for(const i of Object.values(rn.instances))i!==t&&i.update("none")}}}const aI=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},lI=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},O_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},A_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class cI{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 e=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=O_(t,this);d&&A_("dragSelectMove",t,d)}},a=l=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=O_(t,this);d?A_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(lI(t,this._startX,this._endX),aI(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const uI=20,dI="rgba(255, 171, 171, 0.4)",fI="rgba(255, 196, 0, 0.2)",E_=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const r=(e-n.y)/i;return n.x+r*(t.x-n.x)},hI=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const s=i.data;s?.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const l=s.map(d=>({ts:d.x,aboveThreshold:d.y>=a.value}));let u=l[0].aboveThreshold?s[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?u=E_(s[d-1],s[d],a.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:E_(s[d-1],s[d],a.value),type:a.type}),u=void 0);u!==void 0&&e.push({start:u,end:l[l.length-1].ts,type:a.type})})}),e},pI=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:r})=>r===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class gI{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const e of Object.keys(t.threshold||{})){const i=t.threshold?.[e];i&&(this._thresholds={...this._thresholds,[e]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const e of Object.keys(this._thresholds))t.threshold?.[e]||delete this._thresholds[e]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=t.scales.y,d=r.getBoundingClientRect(),h=u.getValueForPixel(l-d.top);if(h)for(const g of Object.keys(this._thresholds||{})){const m=this._thresholds?.[g];m&&m.forEach(_=>{_.hovered=Math.abs(_.value-h)<uI})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,e){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){s.forEach(u=>{const h=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Ru(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";u.label?g=`${u.label}: ${u.value}`:u.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:u.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Ru(u.type),i.font=gv,i.fillText(g,t.chartArea.left,h-4),i.restore())});const a=hI(t,s);pI(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),h=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?dI:fI,i.fillRect(d,t.chartArea.top,h-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ru(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const mI=an(p.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=kt.useI18n(),s=new C_,a=new x_,l=new cI,u=new gI(r),{translateUnit:d}=kt.useTranslatedUnits(),h=p.ref(),g=crypto.randomUUID(),m=crypto.randomUUID(),_=p.ref([]),x=p.inject("legendPosition",Pe.Bottom),v=p.useTemplateRef("chartParent"),S=p.ref(void 0),C=p.ref(!1),E=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:m,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:B,tooltipAbsoluteTop:P}=kt.useTooltipAbsolutePosition(v,E),L={id:g,afterUpdate(H){_.value=Ou(H,e.legendValues,e.chartLegendSortFn)}},I=p.computed(()=>[L,a,...e.brush?[l]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),N=p.computed(()=>`line-${I.value.map(H=>H.id).join("-")}`),T=p.computed(()=>`bar-${I.value.map(H=>H.id).join("-")}`),M=p.computed(()=>e.chartData&&vE(e.chartData)),{options:O}=kt.useLineChartOptions({tooltipState:E,timeRangeMs:p.toRef(e,"timeRangeMs"),granularity:p.toRef(e,"granularity"),legendID:g,stacked:p.toRef(e,"stacked"),metricAxesTitle:p.toRef(e,"metricAxesTitle"),dimensionAxesTitle:p.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:M,threshold:p.toRef(e,"threshold")});kt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const z=H=>H?H.end.getTime()>H.start.getTime():!1,W=H=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[H],it=({width:H,height:q})=>{E.width=H,E.height=q},ut=(H=!0)=>{E.interactionMode="idle",E.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},ft=()=>{E.interactionMode="interactive"},j=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(E.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},tt=()=>{if(C.value){C.value=!1;return}E.interactionMode!=="idle"?ut():ft(),j()};p.watch(()=>e.type,()=>{E.interactionMode="idle",E.showTooltip=!1,s.destroyClickedSegment()});const nt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:q,xEnd:X}=H.detail,_t={start:new Date(q),end:new Date(X),type:"absolute"};if(!z(_t)){S.value=void 0,ut(!1);return}S.value=_t,E.interactionMode="zoom-interactive",_t&&i("select-chart-range",_t)},et=H=>{E.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:q,xEnd:X}=H.detail;S.value={start:new Date(q),end:new Date(X),type:"absolute"}},at=H=>{if(!v.value||E.interactionMode==="idle")return;const q=H.target;q&&v.value.contains(q)||C.value||ut(!1)};return p.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",nt),h.value.chart.canvas.removeEventListener("dragSelectMove",et),h.value.chart.canvas.addEventListener("dragSelect",nt),h.value.chart.canvas.addEventListener("dragSelectMove",et))}),p.onMounted(()=>{document.addEventListener("click",at,!0)}),p.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",nt),h.value.chart.canvas.removeEventListener("dragSelectMove",et)),document.removeEventListener("click",at,!0)}),(H,q)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",W(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:q[0]||(q[0]=X=>tt())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(D_),{key:N.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:p.unref(O),plugins:I.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(M_),{key:T.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:p.unref(O),plugins:I.value},null,8,["chart-id","data","options","plugins"])):p.createCommentVNode("",!0)]),p.createVNode(wo,{"absolute-left":p.unref(B),"absolute-top":p.unref(P),"data-testid":"tooltip",granularity:n.granularity,state:E,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":S.value,onDimensions:it,onOnAction:q[1]||(q[1]=()=>ut(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),p.createVNode(ul,{id:p.unref(g),"chart-instance":h.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-399f4923"]]),yI={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},_I={class:"tooltip-content"},bI={key:2,class:"analytics-chart-parent"},xI=7,wI=p.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Pe.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(n,{emit:t}){const e=t,i=n,{i18n:r}=kt.useI18n(),s=p.computed(()=>tl(i.chartData)?void 0:i.chartData),a=p.computed(()=>{const G=s.value?.meta,$=G?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&$.length>1&&Object.keys(G?.display??{}).length>0?$:[]}),l=p.computed(()=>a.value.length>1),u=p.computed(()=>i.activeMetric&&a.value.includes(i.activeMetric)?i.activeMetric:a.value[0]),d=p.computed(()=>{const G=s.value;return!G||!l.value||!u.value?G:{...G,meta:{...G.meta,metric_names:[u.value]}}}),h=p.computed(()=>{const G=i.chartOptions.threshold;return!l.value||!G?G:{...G,...Object.fromEntries(Object.keys(G).filter($=>$!==u.value).map($=>[$,[]]))}}),g=p.computed(()=>{if(O.value)return tl(i.chartData)?i.chartData:Ty(i.chartData)}),m=p.computed(()=>{if(tl(i.chartData)){const{start:$,end:st,metric:ot,metricUnit:lt,truncated:pt,limit:dt,datasource:It}=i.chartData;return{start:$,end:st,metricNames:[ot],metricUnits:{[ot]:lt??""},truncated:pt,limit:dt,datasource:It}}const G=d.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}}),_=p.computed(()=>O.value?kt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter},g).value:s.value?T.value?kt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Iu},d).value:kt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Iu},s).value:{datasets:[]}),x=p.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),v=p.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:$}=m.value;if(G&&$)return new Date($).getTime()-new Date(G).getTime()}),S=p.computed(()=>m.value.metricUnits?l.value&&u.value?m.value.metricUnits[u.value]??"":Object.values(m.value.metricUnits)[0]??"":""),C=p.computed(()=>m.value.metricUnits?l.value&&u.value?u.value:Object.keys(m.value.metricUnits)[0]??"":""),E=p.computed(()=>i.showLegendValues&&i.legendPosition!==Pe.Hidden),{legendValues:B}=kt.useChartLegendValues(_,i.chartOptions.type,S),P=p.computed(()=>m.value.limit?.toString()||null),L=p.computed(()=>i.chartOptions.hideTruncationWarning?!1:m.value.truncated||!1),I=p.computed(()=>r.t("limitedResultsShown",{maxReturned:P.value})),N=p.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),T=p.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),M=p.computed(()=>i.chartOptions.type==="donut"),O=p.computed(()=>i.chartOptions.type==="scatter"),z=p.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),W=p.computed(()=>{const{metricNames:G,metricUnits:$}=m.value;if(!G||!$)return;const st=G[0],ot=$[st]||"";if(G.length>1){if(st.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})});if(st.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})}if(st)return po(ot)&&r.te(`metricAxisTitles.${st}`)?r.t(`metricAxisTitles.${st}`)||void 0:r.te(`chartLabels.${st}`)?r.t(`chartLabels.${st}`):st}),it=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;const{metricNames:G,metricUnits:$}=m.value;if(!G||!$)return;const st=G[0],ot=$[st]||"";if(G.length>1){if(st.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})});if(st.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})}return r.te(`metricAxisTitles.${st}`)&&(po(ot)||r.te(`chartUnits.${ot}`))?po(ot)?r.t(`metricAxisTitles.${st}`)||void 0:r.t(`metricAxisTitles.${st}`,{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})||void 0:st||void 0}),ut=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,$=T.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if($)return r.te(`chartLabels.${$}`)?r.t(`chartLabels.${$}`):$}),ft=p.computed(()=>O.value?H.value:ia(Number(s.value?.meta?.granularity_ms))),j=p.computed(()=>{if(nx(m.value.datasource))return r.t("timestampAxisTitles.platform");const G=ft.value;if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),tt=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),nt=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),et=p.computed(()=>O.value?!!g.value?.points.length:T.value?SE(_.value):!!(s.value&&s.value.meta&&s.value.data.length)),at=p.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?ia(G.meta.granularity_ms)||"hourly":ia(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),H=p.computed(()=>ia(Math.floor((v.value||0)/xI))||"hourly"),q=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,$)=>G.text===r.t("chartLabels.____OTHER____")?1:$.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt($.text,10))?G.text<$.text?-1:1:G.value&&$.value?$.value.raw-G.value.raw:0),X=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,$)=>G.label===r.t("chartLabels.____OTHER____")?1:$.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt($.label,10))?G.label<$.label?-1:1:G.value&&$.value?$.rawValue-G.rawValue:0),_t=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>e("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 p.provide("showLegendValues",E),p.provide("legendPosition",p.toRef(i,"legendPosition")),(G,$)=>{const st=p.resolveComponent("KTooltip"),ot=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":E.value}])},[et.value&&L.value&&P.value?(p.openBlock(),p.createElementBlock("div",yI,[p.createVNode(st,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",_I,p.toDisplayString(I.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ts.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(hv)})`,size:`var(--kui-icon-size-40, ${p.unref(mv)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),et.value?(p.openBlock(),p.createElementBlock("div",bI,[T.value?(p.openBlock(),p.createBlock(mI,{key:0,brush:x.value,"chart-data":_.value,"chart-legend-sort-fn":q.value,"chart-tooltip-sort-fn":X.value,"dimension-axes-title":j.value,fill:n.chartOptions.stacked,granularity:at.value,"legend-values":p.unref(B),"metric-axes-title":it.value,"metric-unit":S.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:h.value,"time-range-ms":v.value,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":_t.value,onSelectChartRange:$[0]||($[0]=lt=>e("select-chart-range",lt)),onZoomTimeRange:$[1]||($[1]=lt=>e("zoom-time-range",lt))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):N.value?(p.openBlock(),p.createBlock(H2,{key:1,annotations:n.showAnnotations,"chart-data":_.value,"chart-legend-sort-fn":q.value,"chart-tooltip-sort-fn":X.value,"data-testid":"bar-chart-container","dimension-axes-title":ut.value,"legend-values":p.unref(B),"metric-axes-title":it.value,"metric-unit":S.value,orientation:z.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):M.value?(p.openBlock(),p.createBlock(eI,{key:2,"chart-data":_.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(Iu),"legend-position":n.legendPosition,"legend-values":p.unref(B),"metric-name":C.value,"metric-unit":S.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":ut.value,"tooltip-metric-display":W.value,"tooltip-title":n.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"])):O.value?(p.openBlock(),p.createBlock(rI,{key:3,"chart-data":_.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":X.value,"data-testid":"scatter-chart-container","dimension-axes-title":j.value,granularity:H.value,"legend-values":p.unref(B),"metric-axes-title":it.value,"metric-unit":S.value,"shade-outlier-region":n.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":v.value,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","legend-values","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(ot,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(tt.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(nt.value),1)]),_:1}))],2)}}}),vI=an(wI,[["__scopeId","data-v-b0e3abb5"]]),SI={class:"chart-parent","data-testid":"gauge-chart-parent"},TI={class:"chart-totals-flex"},MI={key:1,class:"metric-small","data-testid":"gauge-chart-total"},kI=an(p.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:ai},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(ld()),r=p.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=p.computed(()=>({...t.chartData,datasets:r.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=p.computed(()=>lo(r?.value[0]?.data[t.numerator],{capital:!0})),u=p.computed(()=>lo(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=p.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),h=p.computed(()=>["full","single"].includes(t.metricDisplay)),g=p.computed(()=>t.metricDisplay==="full");return(m,_)=>(p.openBlock(),p.createElementBlock("div",SI,[p.createElementVNode("div",TI,[h.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:p.normalizeStyle(d.value)},p.toDisplayString(l.value),5)):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createElementBlock("div",MI,p.toDisplayString(p.unref(e).t("total"))+": "+p.toDisplayString(u.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",{class:"chart-container",style:p.normalizeStyle({height:n.height,width:n.width})},[p.createVNode(p.unref(k_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),DI={key:1,class:"single-value-wrapper"},CI={class:"single-value-metric"},OI={class:"name-unit-alignment"},AI={class:"single-value","data-testid":"single-value-chart"},EI={key:0,class:"single-value-unit"},RI={class:"single-value-metric-name"},PI={key:0,class:"single-value-trend"},II={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},ud="t1",dd="t2",LI=an(p.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Gm},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(n){const{i18n:t}=kt.useI18n(),{formatBytes:e,formatCost:i}=er({i18n:t}),r=n,s=p.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=p.computed(()=>Qi.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:ud,secondLevelKey:dd})),l=p.computed(()=>a.value?.previous?.[ud]?.[dd]),u=p.computed(()=>a.value?.current?.[ud]?.[dd]),d=p.computed(()=>r.data.data),h=p.computed(()=>r.data.meta?.metric_names?.[0]),g=p.computed(()=>t.te(`chartLabels.${h.value}`)?t.t(`chartLabels.${h.value}`):""),m=p.computed(()=>{const O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const z=`chartUnits.${O}`;return t.te(z)?t.t(z,{plural:""}):""}}),_=p.computed(()=>!!h.value&&(h.value.includes("_per_minute")||h.value.includes("_latency_")||h.value==="error_rate")),x=p.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),v=p.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=p.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=p.computed(()=>{const O=v.value;if(O===null)return"-";const z=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(z==="usd")return i(O);if(z==="bytes")return e(O);if(O>=1e9){const it=(O/1e9).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${it}B`}if(O>=1e7){const it=(O/1e6).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${it}M`}const W=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:Gm;return O.toLocaleString("en-US",{maximumFractionDigits:W})}),E=p.computed(()=>r.showTrend&&r.data?.data?.length<2),B=p.computed(()=>Qi.calculateChange(v.value??0,x.value??0)||0),P=p.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 Qi.changePolarity(B.value,!0,r.increaseIsBad)}),L=p.computed(()=>Qi.defineIcon(P.value,r.increaseIsBad)),I=p.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 Qi.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Qi.metricChange(B.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),N=Qi.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),T=O=>O>0?"positive":O<0?"negative":"neutral",M=O=>O>0?fv:O<0?dv:qh;return p.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,z)=>{const W=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[S.value?(p.openBlock(),p.createBlock(W,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:p.unref(t).t("singleValue.valueError")},null,8,["title"])):(p.openBlock(),p.createElementBlock("div",DI,[p.createElementVNode("div",CI,[p.createElementVNode("div",OI,[p.createElementVNode("span",AI,p.toDisplayString(C.value),1),_.value&&m.value?(p.openBlock(),p.createElementBlock("span",EI,"  "+p.toDisplayString(m.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",RI,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",PI,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",T(P.value)]),"data-testid":"single-value-trend"},[E.value||P.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(L.value),{key:0,color:M(P.value),size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])):(p.openBlock(),p.createBlock(p.unref(Ts.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${p.unref(qh)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])),p.createElementVNode("div",null,p.toDisplayString(I.value),1)],2),p.unref(N)?(p.openBlock(),p.createElementBlock("div",II,p.toDisplayString(p.unref(N)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),NI={class:"simple-chart-shell"},BI={key:1,class:"analytics-chart-parent"},FI=an(p.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.computed(()=>{const d=kt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||ai},p.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=p.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=p.computed(()=>t.chartOptions.type==="gauge"),a=p.computed(()=>t.chartOptions.type==="single_value"),l=p.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=p.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 g=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",NI,[u.value?(p.openBlock(),p.createElementBlock("div",BI,[s.value?(p.openBlock(),p.createBlock(kI,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):p.createCommentVNode("",!0),a.value?(p.openBlock(),p.createBlock(LI,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(g,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),zI={class:"top-n-card-title","data-testid":"top-n-card-title"},UI={class:"top-n-card-description","data-testid":"top-n-card-description"},HI={key:3,class:"top-n-table","data-testid":"top-n-table"},WI={"data-testid":"top-n-table-header"},VI={class:"top-n-table-header-row"},$I={class:"table-header-label"},YI=["data-testid"],qI=["data-testid"],jI=["data-testid"],GI=3,KI=an(p.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{formatUnit:i}=er({i18n:e}),r=p.computed(()=>t.data.data),s=p.computed(()=>!!r.value?.length),a=p.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,GI):[]),l=p.computed(()=>a.value[0]||""),u=p.computed(()=>a.value.length>1),d=p.computed(()=>a.value[a.value.length-1]||""),h=p.computed(()=>l.value?t.data.meta.display[l.value]:{}),g=p.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),m=p.computed(()=>g.value[0]),_=p.computed(()=>m.value?ut(m.value):""),x=p.computed(()=>{const j=a.value.map(tt=>({key:tt,label:u.value?ut(tt):e.t("topNTable.nameLabel"),type:"dimension"}));return m.value&&j.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((tt,nt)=>{nt!==0&&j.push({key:tt,label:ut(tt),type:"metric"})}),j}),v=p.computed(()=>x.value.filter(j=>j.type==="metric")),S=p.computed(()=>x.value.filter(j=>j.type==="dimension").slice(1)),C=j=>j.type==="dimension"&&j.key===d.value,E=j=>u.value&&j.type==="dimension"&&!C(j),B=j=>{const tt=j.event;return String(tt[l.value])},P=(j,tt)=>{const nt=String(j.event[tt]),et=t.data.meta?.display?.[tt]?.[nt];return{dimension:tt,id:nt,name:et?.name||"-",deleted:!!et?.deleted}},L=j=>{const tt=B(j),nt=h.value&&h.value[tt];return nt?nt.name:"-"},I=j=>{const tt=B(j),nt=h.value&&h.value[tt];return nt?!!nt.deleted:!1},N=(j,tt)=>{const nt=j.event[tt];if(nt==null)return"–";const et=typeof nt=="number"?nt:Number(nt);if(Number.isNaN(et))return"–";const at=t.data.meta?.metric_units?.[tt]||"count",H=["count","count/minute","token count"].includes(at);return i(et,at,{approximate:H,isBytes1024:!0,translateUnit:q=>ft(q,et)})},T=j=>m.value?N(j,m.value):"–",M=p.computed(()=>r.value?.length?r.value.map(j=>{const tt=a.value.map(H=>P(j,H)),nt=tt[0],et=nt?.id||B(j),at={id:et,rowKey:tt.map(H=>`${H.dimension}:${H.id}`).join("|")||et,name:nt?.name||L(j),deleted:I(j),dimensions:tt,original:j};return m.value&&(at.value=T(j)),g.value.forEach((H,q)=>{q!==0&&(at[H]=N(j,H))}),at}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(j=>!Object.keys(t.data.meta.display[j]||{}).length))return e.t("topNTable.errors.display");if(!m.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),z=(j,tt)=>{const nt=j[tt];return typeof nt=="string"?nt:nt==null?"–":String(nt)},W=(j,tt)=>j.dimensions.find(nt=>nt.dimension===tt)?.name||"–",it=(j,tt)=>{const nt=j.dimensions.find(et=>et.dimension===tt);return{id:nt?.id||"",name:nt?.name||"–",deleted:nt?.deleted||!1,dimension:tt,dimensions:j.dimensions,isEmpty:nt?.id==="empty"}},ut=j=>e.te(`chartLabels.${j}`)?e.t(`chartLabels.${j}`):j,ft=(j,tt)=>{if(po(j)||j==="count"||j==="requests")return"";const nt=tt===1?"":"s";return e.te(`chartUnits.${j}`)?e.t(`chartUnits.${j}`,{plural:nt}):j};return(j,tt)=>{const nt=p.resolveComponent("KEmptyState"),et=p.resolveComponent("KSkeleton"),at=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(at,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(nt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(et,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",HI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",WI,[p.createElementVNode("tr",VI,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(x.value,H=>(p.openBlock(),p.createElementBlock("th",{key:H.key,class:p.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":H.type==="metric","top-n-table-header-cell-dimension-compact":E(H)}]),"data-testid":"top-n-table-header-column"},[p.createElementVNode("span",$I,p.toDisplayString(H.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(M.value,H=>(p.openBlock(),p.createElementBlock("tr",{key:H.rowKey,class:"top-n-table-row"},[a.value.length?(p.openBlock(),p.createElementBlock("td",{key:0,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[p.createElementVNode("span",{"data-testid":`row-${H.id}`},[p.renderSlot(j.$slots,"name",{record:{id:H.id,name:H.name,deleted:H.deleted,dimension:l.value,dimensions:H.dimensions,isEmpty:H.id==="empty"}},()=>[p.createTextVNode(p.toDisplayString(H.name),1)],!0)],8,YI)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(S.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(q)}])},[p.renderSlot(j.$slots,"name",{record:it(H,q.key)},()=>[p.createTextVNode(p.toDisplayString(W(H,q.key)),1)],!0)],2))),128)),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(v.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:"top-n-table-cell top-n-table-cell-metric"},[q.key==="value"?(p.openBlock(),p.createElementBlock("span",{key:0,"data-testid":`row-${H.id}`},p.toDisplayString(z(H,q.key)),9,qI)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${H.id}-${q.key}`},p.toDisplayString(z(H,q.key)),9,jI))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(nt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",zI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",UI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-0dc897d6"]]),XI={class:"container"},ZI={key:0,class:"no-data","data-testid":"sparkline-empty"},QI=["title"],JI=an(p.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=kt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=kt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),h=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),g=({width:N,height:T})=>{h.width=N,h.height=T},m=p.computed(()=>n.disableTooltip?[]:[new C_({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((N,{data:T,label:M})=>({...N,[M]:T.reduce((O,{y:z})=>O+z,0)}),{})),x=p.computed(()=>d.value.map(({label:N})=>[_.value[N],`${N}: ${_.value[N]}`]).sort(([N],[T])=>T-N).map(([,N])=>N).join(", ")),v=p.computed(()=>Object.keys(_.value).map(N=>_.value[N]).reduce((N,T)=>N+T,0)),S=p.computed(()=>v.value>0),C=p.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),E=p.computed(()=>n.datasets.length>1),B=`SparklineTooltipPosition-${t}`,P=p.computed(()=>{const N=n.type==="sparkline_bar",T=N?r.value-1:r.value,M=N?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:N?0:2,right:N?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:B,external:O=>{Cu(h,O,"minutely",{contextFormatter:z=>{const W=z+i.value;let it="";return i.value>1440*60*1e3?it=da(new Date(W),"MMM dd, yyy hh:mm a"):it=da(new Date(W),"hh:mm a"),`${jw(z)} - ${it}`}})}}},scales:{x:{min:T,max:M,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:E.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:E.value}}}}),L=p.ref("0"),I=p.ref("0");return p.onMounted(()=>{$e.positioners[B]=function(N,T){if(!N.length||h.interactionMode==="interactive"||T.x===null)return!1;const M=10,O=this.chart.canvas.getBoundingClientRect(),z=h.width||this.width,W=h.height||this.height,it=O.top-W>0,ut=it?O.top-W-M:O.top+O.height+M,ft=O.left>z/2-T.x,j=Math.max(M,window.innerWidth-M-z),tt=Math.min(j,ft?Math.floor(O.left-z/2)+T.x:0+M);return L.value=`${ut}px`,I.value=`${tt}px`,{x:tt,y:ut,xAlign:"center",yAlign:it?"top":"bottom"}}}),p.onUnmounted(()=>{$e.positioners[B]&&delete $e.positioners[B]}),(N,T)=>(p.openBlock(),p.createElementBlock("div",XI,[S.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(M_),{key:1,"chart-id":p.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.value,plugins:m.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(p.openBlock(),p.createBlock(p.unref(D_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:m.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",ZI,[p.renderSlot(N.$slots,"empty",{},()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(wo,{key:3,"absolute-left":I.value,"absolute-top":L.value,class:"tooltip","data-testid":"sparkline-tooltip",state:h,"tooltip-title":n.tooltipTitle,onDimensions:g},null,8,["absolute-left","absolute-top","state","tooltip-title"])),S.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:N.$slots.label?"":x.value},[p.renderSlot(N.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,QI)):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vo={exports:{}};var tL=vo.exports,R_;function eL(){return R_||(R_=1,(function(n,t){(function(){var e,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,g="__lodash_placeholder__",m=1,_=2,x=4,v=1,S=2,C=1,E=2,B=4,P=8,L=16,I=32,N=64,T=128,M=256,O=512,z=30,W="...",it=800,ut=16,ft=1,j=2,tt=3,nt=1/0,et=9007199254740991,at=17976931348623157e292,H=NaN,q=4294967295,X=q-1,_t=q>>>1,G=[["ary",T],["bind",C],["bindKey",E],["curry",P],["curryRight",L],["flip",O],["partial",I],["partialRight",N],["rearg",M]],$="[object Arguments]",st="[object Array]",ot="[object AsyncFunction]",lt="[object Boolean]",pt="[object Date]",dt="[object DOMException]",It="[object Error]",zt="[object Function]",vt="[object GeneratorFunction]",Ct="[object Map]",Dt="[object Number]",ve="[object Null]",bt="[object Object]",jt="[object Promise]",Oe="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",ln="[object String]",Vt="[object Symbol]",Le="[object Undefined]",ie="[object WeakMap]",Se="[object WeakSet]",Ee="[object ArrayBuffer]",gn="[object DataView]",zi="[object Float32Array]",Dn="[object Float64Array]",Ye="[object Int8Array]",In="[object Int16Array]",ci="[object Int32Array]",So="[object Uint8Array]",To="[object Uint8ClampedArray]",br="[object Uint16Array]",ui="[object Uint32Array]",Mo=/\b__p \+= '';/g,ko=/\b(__p \+=) '' \+/g,Do=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,pl=/[&<>"']/g,fd=RegExp(Ui.source),hd=RegExp(pl.source),pd=/<%-([\s\S]+?)%>/g,gd=/<%([\s\S]+?)%>/g,Co=/<%=([\s\S]+?)%>/g,gl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,di=/^\w*$/,md=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oo=/[\\^$.*+?()[\]{}|]/g,yd=RegExp(Oo.source),Ao=/^\s+/,_d=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bd=/\{\n\/\* \[wrapped with (.+)\] \*/,xd=/,? & /,wd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ml=/[()=,{}\[\]\/\s]/,vd=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yl=/\w*$/,Sd=/^[-+]0x[0-9a-f]+$/i,Td=/^0b[01]+$/i,Md=/^\[object .+?Constructor\]$/,kd=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,Dd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ns=/($^)/,Cd=/['\n\r\u2028\u2029\\]/g,is="\\ud800-\\udfff",Od="\\u0300-\\u036f",Ad="\\ufe20-\\ufe2f",_l="\\u20d0-\\u20ff",xr=Od+Ad+_l,bl="\\u2700-\\u27bf",rs="a-z\\xdf-\\xf6\\xf8-\\xff",Ed="\\xac\\xb1\\xd7\\xf7",Rd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Pd="\\u2000-\\u206f",Id=" \\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",xl="A-Z\\xc0-\\xd6\\xd8-\\xde",wl="\\ufe0e\\ufe0f",ss=Ed+Rd+Pd+Id,Eo="['’]",Ld="["+is+"]",vl="["+ss+"]",os="["+xr+"]",Sl="\\d+",Nd="["+bl+"]",Tl="["+rs+"]",Ro="[^"+is+ss+Sl+bl+rs+xl+"]",Po="\\ud83c[\\udffb-\\udfff]",Bd="(?:"+os+"|"+Po+")",wr="[^"+is+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",as="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+xl+"]",Ml="\\u200d",kl="(?:"+Tl+"|"+Ro+")",Fd="(?:"+cn+"|"+Ro+")",Dl="(?:"+Eo+"(?:d|ll|m|re|s|t|ve))?",Cl="(?:"+Eo+"(?:D|LL|M|RE|S|T|VE))?",Ol=Bd+"?",Io="["+wl+"]?",fi="(?:"+Ml+"(?:"+[wr,Gn,as].join("|")+")"+Io+Ol+")*",zd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Al="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",El=Io+Ol+fi,Lo="(?:"+[Nd,Gn,as].join("|")+")"+El,Rl="(?:"+[wr+os+"?",os,Gn,as,Ld].join("|")+")",Ud=RegExp(Eo,"g"),Hd=RegExp(os,"g"),ls=RegExp(Po+"(?="+Po+")|"+Rl+El,"g"),Wd=RegExp([cn+"?"+Tl+"+"+Dl+"(?="+[vl,cn,"$"].join("|")+")",Fd+"+"+Cl+"(?="+[vl,cn+kl,"$"].join("|")+")",cn+"?"+kl+"+"+Dl,cn+"+"+Cl,Al,zd,Sl,Lo].join("|"),"g"),cs=RegExp("["+Ml+is+xr+wl+"]"),Vd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,No=["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"],$d=-1,ee={};ee[zi]=ee[Dn]=ee[Ye]=ee[In]=ee[ci]=ee[So]=ee[To]=ee[br]=ee[ui]=!0,ee[$]=ee[st]=ee[Ee]=ee[lt]=ee[gn]=ee[pt]=ee[It]=ee[zt]=ee[Ct]=ee[Dt]=ee[bt]=ee[Ae]=ee[oe]=ee[ln]=ee[ie]=!1;var D={};D[$]=D[st]=D[Ee]=D[gn]=D[lt]=D[pt]=D[zi]=D[Dn]=D[Ye]=D[In]=D[ci]=D[Ct]=D[Dt]=D[bt]=D[Ae]=D[oe]=D[ln]=D[Vt]=D[So]=D[To]=D[br]=D[ui]=!0,D[It]=D[zt]=D[ie]=!1;var V={À:"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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},mt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,Nn=parseInt,Ne=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi,Pl=typeof self=="object"&&self&&self.Object===Object&&self,ce=Ne||Pl||Function("return this")(),us=t&&!t.nodeType&&t,Kn=us&&!0&&n&&!n.nodeType&&n,Bo=Kn&&Kn.exports===us,vr=Bo&&Ne.process,Be=(function(){try{var F=Kn&&Kn.require&&Kn.require("util").types;return F||vr&&vr.binding&&vr.binding("util")}catch{}})(),B_=Be&&Be.isArrayBuffer,F_=Be&&Be.isDate,z_=Be&&Be.isMap,U_=Be&&Be.isRegExp,H_=Be&&Be.isSet,W_=Be&&Be.isTypedArray;function mn(F,K,Y){switch(Y.length){case 0:return F.call(K);case 1:return F.call(K,Y[0]);case 2:return F.call(K,Y[0],Y[1]);case 3:return F.call(K,Y[0],Y[1],Y[2])}return F.apply(K,Y)}function gL(F,K,Y,ht){for(var Ot=-1,$t=F==null?0:F.length;++Ot<$t;){var Me=F[Ot];K(ht,Me,Y(Me),F)}return ht}function yn(F,K){for(var Y=-1,ht=F==null?0:F.length;++Y<ht&&K(F[Y],Y,F)!==!1;);return F}function mL(F,K){for(var Y=F==null?0:F.length;Y--&&K(F[Y],Y,F)!==!1;);return F}function V_(F,K){for(var Y=-1,ht=F==null?0:F.length;++Y<ht;)if(!K(F[Y],Y,F))return!1;return!0}function Vi(F,K){for(var Y=-1,ht=F==null?0:F.length,Ot=0,$t=[];++Y<ht;){var Me=F[Y];K(Me,Y,F)&&($t[Ot++]=Me)}return $t}function Il(F,K){var Y=F==null?0:F.length;return!!Y&&ds(F,K,0)>-1}function Yd(F,K,Y){for(var ht=-1,Ot=F==null?0:F.length;++ht<Ot;)if(Y(K,F[ht]))return!0;return!1}function ue(F,K){for(var Y=-1,ht=F==null?0:F.length,Ot=Array(ht);++Y<ht;)Ot[Y]=K(F[Y],Y,F);return Ot}function $i(F,K){for(var Y=-1,ht=K.length,Ot=F.length;++Y<ht;)F[Ot+Y]=K[Y];return F}function qd(F,K,Y,ht){var Ot=-1,$t=F==null?0:F.length;for(ht&&$t&&(Y=F[++Ot]);++Ot<$t;)Y=K(Y,F[Ot],Ot,F);return Y}function yL(F,K,Y,ht){var Ot=F==null?0:F.length;for(ht&&Ot&&(Y=F[--Ot]);Ot--;)Y=K(Y,F[Ot],Ot,F);return Y}function jd(F,K){for(var Y=-1,ht=F==null?0:F.length;++Y<ht;)if(K(F[Y],Y,F))return!0;return!1}var _L=Gd("length");function bL(F){return F.split("")}function xL(F){return F.match(wd)||[]}function $_(F,K,Y){var ht;return Y(F,function(Ot,$t,Me){if(K(Ot,$t,Me))return ht=$t,!1}),ht}function Ll(F,K,Y,ht){for(var Ot=F.length,$t=Y+(ht?1:-1);ht?$t--:++$t<Ot;)if(K(F[$t],$t,F))return $t;return-1}function ds(F,K,Y){return K===K?RL(F,K,Y):Ll(F,Y_,Y)}function wL(F,K,Y,ht){for(var Ot=Y-1,$t=F.length;++Ot<$t;)if(ht(F[Ot],K))return Ot;return-1}function Y_(F){return F!==F}function q_(F,K){var Y=F==null?0:F.length;return Y?Xd(F,K)/Y:H}function Gd(F){return function(K){return K==null?e:K[F]}}function Kd(F){return function(K){return F==null?e:F[K]}}function j_(F,K,Y,ht,Ot){return Ot(F,function($t,Me,ne){Y=ht?(ht=!1,$t):K(Y,$t,Me,ne)}),Y}function vL(F,K){var Y=F.length;for(F.sort(K);Y--;)F[Y]=F[Y].value;return F}function Xd(F,K){for(var Y,ht=-1,Ot=F.length;++ht<Ot;){var $t=K(F[ht]);$t!==e&&(Y=Y===e?$t:Y+$t)}return Y}function Zd(F,K){for(var Y=-1,ht=Array(F);++Y<F;)ht[Y]=K(Y);return ht}function SL(F,K){return ue(K,function(Y){return[Y,F[Y]]})}function G_(F){return F&&F.slice(0,Q_(F)+1).replace(Ao,"")}function _n(F){return function(K){return F(K)}}function Qd(F,K){return ue(K,function(Y){return F[Y]})}function Fo(F,K){return F.has(K)}function K_(F,K){for(var Y=-1,ht=F.length;++Y<ht&&ds(K,F[Y],0)>-1;);return Y}function X_(F,K){for(var Y=F.length;Y--&&ds(K,F[Y],0)>-1;);return Y}function TL(F,K){for(var Y=F.length,ht=0;Y--;)F[Y]===K&&++ht;return ht}var ML=Kd(V),kL=Kd(J);function DL(F){return"\\"+Te[F]}function CL(F,K){return F==null?e:F[K]}function fs(F){return cs.test(F)}function OL(F){return Vd.test(F)}function AL(F){for(var K,Y=[];!(K=F.next()).done;)Y.push(K.value);return Y}function Jd(F){var K=-1,Y=Array(F.size);return F.forEach(function(ht,Ot){Y[++K]=[Ot,ht]}),Y}function Z_(F,K){return function(Y){return F(K(Y))}}function Yi(F,K){for(var Y=-1,ht=F.length,Ot=0,$t=[];++Y<ht;){var Me=F[Y];(Me===K||Me===g)&&(F[Y]=g,$t[Ot++]=Y)}return $t}function Nl(F){var K=-1,Y=Array(F.size);return F.forEach(function(ht){Y[++K]=ht}),Y}function EL(F){var K=-1,Y=Array(F.size);return F.forEach(function(ht){Y[++K]=[ht,ht]}),Y}function RL(F,K,Y){for(var ht=Y-1,Ot=F.length;++ht<Ot;)if(F[ht]===K)return ht;return-1}function PL(F,K,Y){for(var ht=Y+1;ht--;)if(F[ht]===K)return ht;return ht}function hs(F){return fs(F)?LL(F):_L(F)}function Bn(F){return fs(F)?NL(F):bL(F)}function Q_(F){for(var K=F.length;K--&&_d.test(F.charAt(K)););return K}var IL=Kd(mt);function LL(F){for(var K=ls.lastIndex=0;ls.test(F);)++K;return K}function NL(F){return F.match(ls)||[]}function BL(F){return F.match(Wd)||[]}var FL=(function F(K){K=K==null?ce:ps.defaults(ce.Object(),K,ps.pick(ce,No));var Y=K.Array,ht=K.Date,Ot=K.Error,$t=K.Function,Me=K.Math,ne=K.Object,tf=K.RegExp,zL=K.String,Cn=K.TypeError,Bl=Y.prototype,UL=$t.prototype,gs=ne.prototype,Fl=K["__core-js_shared__"],zl=UL.toString,Gt=gs.hasOwnProperty,HL=0,J_=(function(){var o=/[^.]+$/.exec(Fl&&Fl.keys&&Fl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Ul=gs.toString,WL=zl.call(ne),VL=ce._,$L=tf("^"+zl.call(Gt).replace(Oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hl=Bo?K.Buffer:e,qi=K.Symbol,Wl=K.Uint8Array,t0=Hl?Hl.allocUnsafe:e,Vl=Z_(ne.getPrototypeOf,ne),e0=ne.create,n0=gs.propertyIsEnumerable,$l=Bl.splice,i0=qi?qi.isConcatSpreadable:e,zo=qi?qi.iterator:e,Sr=qi?qi.toStringTag:e,Yl=(function(){try{var o=Cr(ne,"defineProperty");return o({},"",{}),o}catch{}})(),YL=K.clearTimeout!==ce.clearTimeout&&K.clearTimeout,qL=ht&&ht.now!==ce.Date.now&&ht.now,jL=K.setTimeout!==ce.setTimeout&&K.setTimeout,ql=Me.ceil,jl=Me.floor,ef=ne.getOwnPropertySymbols,GL=Hl?Hl.isBuffer:e,r0=K.isFinite,KL=Bl.join,XL=Z_(ne.keys,ne),ke=Me.max,je=Me.min,ZL=ht.now,QL=K.parseInt,s0=Me.random,JL=Bl.reverse,nf=Cr(K,"DataView"),Uo=Cr(K,"Map"),rf=Cr(K,"Promise"),ms=Cr(K,"Set"),Ho=Cr(K,"WeakMap"),Wo=Cr(ne,"create"),Gl=Ho&&new Ho,ys={},tN=Or(nf),eN=Or(Uo),nN=Or(rf),iN=Or(ms),rN=Or(Ho),Kl=qi?qi.prototype:e,Vo=Kl?Kl.valueOf:e,o0=Kl?Kl.toString:e;function w(o){if(ge(o)&&!Rt(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(Gt.call(o,"__wrapped__"))return ab(o)}return new On(o)}var _s=(function(){function o(){}return function(c){if(!fe(c))return{};if(e0)return e0(c);o.prototype=c;var f=new o;return o.prototype=e,f}})();function Xl(){}function On(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}w.templateSettings={escape:pd,evaluate:gd,interpolate:Co,variable:"",imports:{_:w}},w.prototype=Xl.prototype,w.prototype.constructor=w,On.prototype=_s(Xl.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function sN(){var o=new Ut(this.__wrapped__);return o.__actions__=un(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=un(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=un(this.__views__),o}function oN(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function aN(){var o=this.__wrapped__.value(),c=this.__dir__,f=Rt(o),y=c<0,b=f?o.length:0,k=bB(0,b,this.__views__),A=k.start,R=k.end,U=R-A,Z=y?R:A-1,Q=this.__iteratees__,rt=Q.length,ct=0,yt=je(U,this.__takeCount__);if(!f||!y&&b==U&&yt==U)return A0(o,this.__actions__);var Tt=[];t:for(;U--&&ct<yt;){Z+=c;for(var Nt=-1,wt=o[Z];++Nt<rt;){var Ft=Q[Nt],Ht=Ft.iteratee,wn=Ft.type,tn=Ht(wt);if(wn==j)wt=tn;else if(!tn){if(wn==ft)continue t;break t}}Tt[ct++]=wt}return Tt}Ut.prototype=_s(Xl.prototype),Ut.prototype.constructor=Ut;function Tr(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function lN(){this.__data__=Wo?Wo(null):{},this.size=0}function cN(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function uN(o){var c=this.__data__;if(Wo){var f=c[o];return f===d?e:f}return Gt.call(c,o)?c[o]:e}function dN(o){var c=this.__data__;return Wo?c[o]!==e:Gt.call(c,o)}function fN(o,c){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Wo&&c===e?d:c,this}Tr.prototype.clear=lN,Tr.prototype.delete=cN,Tr.prototype.get=uN,Tr.prototype.has=dN,Tr.prototype.set=fN;function hi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function hN(){this.__data__=[],this.size=0}function pN(o){var c=this.__data__,f=Zl(c,o);if(f<0)return!1;var y=c.length-1;return f==y?c.pop():$l.call(c,f,1),--this.size,!0}function gN(o){var c=this.__data__,f=Zl(c,o);return f<0?e:c[f][1]}function mN(o){return Zl(this.__data__,o)>-1}function yN(o,c){var f=this.__data__,y=Zl(f,o);return y<0?(++this.size,f.push([o,c])):f[y][1]=c,this}hi.prototype.clear=hN,hi.prototype.delete=pN,hi.prototype.get=gN,hi.prototype.has=mN,hi.prototype.set=yN;function pi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function _N(){this.size=0,this.__data__={hash:new Tr,map:new(Uo||hi),string:new Tr}}function bN(o){var c=cc(this,o).delete(o);return this.size-=c?1:0,c}function xN(o){return cc(this,o).get(o)}function wN(o){return cc(this,o).has(o)}function vN(o,c){var f=cc(this,o),y=f.size;return f.set(o,c),this.size+=f.size==y?0:1,this}pi.prototype.clear=_N,pi.prototype.delete=bN,pi.prototype.get=xN,pi.prototype.has=wN,pi.prototype.set=vN;function Mr(o){var c=-1,f=o==null?0:o.length;for(this.__data__=new pi;++c<f;)this.add(o[c])}function SN(o){return this.__data__.set(o,d),this}function TN(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=SN,Mr.prototype.has=TN;function Fn(o){var c=this.__data__=new hi(o);this.size=c.size}function MN(){this.__data__=new hi,this.size=0}function kN(o){var c=this.__data__,f=c.delete(o);return this.size=c.size,f}function DN(o){return this.__data__.get(o)}function CN(o){return this.__data__.has(o)}function ON(o,c){var f=this.__data__;if(f instanceof hi){var y=f.__data__;if(!Uo||y.length<r-1)return y.push([o,c]),this.size=++f.size,this;f=this.__data__=new pi(y)}return f.set(o,c),this.size=f.size,this}Fn.prototype.clear=MN,Fn.prototype.delete=kN,Fn.prototype.get=DN,Fn.prototype.has=CN,Fn.prototype.set=ON;function a0(o,c){var f=Rt(o),y=!f&&Ar(o),b=!f&&!y&&Zi(o),k=!f&&!y&&!b&&vs(o),A=f||y||b||k,R=A?Zd(o.length,zL):[],U=R.length;for(var Z in o)(c||Gt.call(o,Z))&&!(A&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||k&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||yi(Z,U)))&&R.push(Z);return R}function l0(o){var c=o.length;return c?o[gf(0,c-1)]:e}function AN(o,c){return uc(un(o),kr(c,0,o.length))}function EN(o){return uc(un(o))}function sf(o,c,f){(f!==e&&!Un(o[c],f)||f===e&&!(c in o))&&Xn(o,c,f)}function $o(o,c,f){var y=o[c];(!(Gt.call(o,c)&&Un(y,f))||f===e&&!(c in o))&&Xn(o,c,f)}function Zl(o,c){for(var f=o.length;f--;)if(Un(o[f][0],c))return f;return-1}function RN(o,c,f,y){return ji(o,function(b,k,A){c(y,b,f(b),A)}),y}function c0(o,c){return o&&Qn(c,Re(c),o)}function PN(o,c){return o&&Qn(c,fn(c),o)}function Xn(o,c,f){c=="__proto__"&&Yl?Yl(o,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[c]=f}function of(o,c){for(var f=-1,y=c.length,b=Y(y),k=o==null;++f<y;)b[f]=k?e:Hf(o,c[f]);return b}function kr(o,c,f){return o===o&&(f!==e&&(o=o<=f?o:f),c!==e&&(o=o>=c?o:c)),o}function An(o,c,f,y,b,k){var A,R=c&m,U=c&_,Z=c&x;if(f&&(A=b?f(o,y,b,k):f(o)),A!==e)return A;if(!fe(o))return o;var Q=Rt(o);if(Q){if(A=wB(o),!R)return un(o,A)}else{var rt=Ge(o),ct=rt==zt||rt==vt;if(Zi(o))return P0(o,R);if(rt==bt||rt==$||ct&&!b){if(A=U||ct?{}:Q0(o),!R)return U?uB(o,PN(A,o)):cB(o,c0(A,o))}else{if(!D[rt])return b?o:{};A=vB(o,rt,R)}}k||(k=new Fn);var yt=k.get(o);if(yt)return yt;k.set(o,A),Db(o)?o.forEach(function(wt){A.add(An(wt,c,f,wt,o,k))}):Mb(o)&&o.forEach(function(wt,Ft){A.set(Ft,An(wt,c,f,Ft,o,k))});var Tt=Z?U?kf:Mf:U?fn:Re,Nt=Q?e:Tt(o);return yn(Nt||o,function(wt,Ft){Nt&&(Ft=wt,wt=o[Ft]),$o(A,Ft,An(wt,c,f,Ft,o,k))}),A}function IN(o){var c=Re(o);return function(f){return u0(f,o,c)}}function u0(o,c,f){var y=f.length;if(o==null)return!y;for(o=ne(o);y--;){var b=f[y],k=c[b],A=o[b];if(A===e&&!(b in o)||!k(A))return!1}return!0}function d0(o,c,f){if(typeof o!="function")throw new Cn(a);return Zo(function(){o.apply(e,f)},c)}function Yo(o,c,f,y){var b=-1,k=Il,A=!0,R=o.length,U=[],Z=c.length;if(!R)return U;f&&(c=ue(c,_n(f))),y?(k=Yd,A=!1):c.length>=r&&(k=Fo,A=!1,c=new Mr(c));t:for(;++b<R;){var Q=o[b],rt=f==null?Q:f(Q);if(Q=y||Q!==0?Q:0,A&&rt===rt){for(var ct=Z;ct--;)if(c[ct]===rt)continue t;U.push(Q)}else k(c,rt,y)||U.push(Q)}return U}var ji=F0(Zn),f0=F0(lf,!0);function LN(o,c){var f=!0;return ji(o,function(y,b,k){return f=!!c(y,b,k),f}),f}function Ql(o,c,f){for(var y=-1,b=o.length;++y<b;){var k=o[y],A=c(k);if(A!=null&&(R===e?A===A&&!xn(A):f(A,R)))var R=A,U=k}return U}function NN(o,c,f,y){var b=o.length;for(f=Lt(f),f<0&&(f=-f>b?0:b+f),y=y===e||y>b?b:Lt(y),y<0&&(y+=b),y=f>y?0:Ob(y);f<y;)o[f++]=c;return o}function h0(o,c){var f=[];return ji(o,function(y,b,k){c(y,b,k)&&f.push(y)}),f}function Fe(o,c,f,y,b){var k=-1,A=o.length;for(f||(f=TB),b||(b=[]);++k<A;){var R=o[k];c>0&&f(R)?c>1?Fe(R,c-1,f,y,b):$i(b,R):y||(b[b.length]=R)}return b}var af=z0(),p0=z0(!0);function Zn(o,c){return o&&af(o,c,Re)}function lf(o,c){return o&&p0(o,c,Re)}function Jl(o,c){return Vi(c,function(f){return _i(o[f])})}function Dr(o,c){c=Ki(c,o);for(var f=0,y=c.length;o!=null&&f<y;)o=o[zn(c[f++])];return f&&f==y?o:e}function g0(o,c,f){var y=c(o);return Rt(o)?y:$i(y,f(o))}function Qe(o){return o==null?o===e?Le:ve:Sr&&Sr in ne(o)?_B(o):EB(o)}function cf(o,c){return o>c}function BN(o,c){return o!=null&&Gt.call(o,c)}function FN(o,c){return o!=null&&c in ne(o)}function zN(o,c,f){return o>=je(c,f)&&o<ke(c,f)}function uf(o,c,f){for(var y=f?Yd:Il,b=o[0].length,k=o.length,A=k,R=Y(k),U=1/0,Z=[];A--;){var Q=o[A];A&&c&&(Q=ue(Q,_n(c))),U=je(Q.length,U),R[A]=!f&&(c||b>=120&&Q.length>=120)?new Mr(A&&Q):e}Q=o[0];var rt=-1,ct=R[0];t:for(;++rt<b&&Z.length<U;){var yt=Q[rt],Tt=c?c(yt):yt;if(yt=f||yt!==0?yt:0,!(ct?Fo(ct,Tt):y(Z,Tt,f))){for(A=k;--A;){var Nt=R[A];if(!(Nt?Fo(Nt,Tt):y(o[A],Tt,f)))continue t}ct&&ct.push(Tt),Z.push(yt)}}return Z}function UN(o,c,f,y){return Zn(o,function(b,k,A){c(y,f(b),k,A)}),y}function qo(o,c,f){c=Ki(c,o),o=nb(o,c);var y=o==null?o:o[zn(Rn(c))];return y==null?e:mn(y,o,f)}function m0(o){return ge(o)&&Qe(o)==$}function HN(o){return ge(o)&&Qe(o)==Ee}function WN(o){return ge(o)&&Qe(o)==pt}function jo(o,c,f,y,b){return o===c?!0:o==null||c==null||!ge(o)&&!ge(c)?o!==o&&c!==c:VN(o,c,f,y,jo,b)}function VN(o,c,f,y,b,k){var A=Rt(o),R=Rt(c),U=A?st:Ge(o),Z=R?st:Ge(c);U=U==$?bt:U,Z=Z==$?bt:Z;var Q=U==bt,rt=Z==bt,ct=U==Z;if(ct&&Zi(o)){if(!Zi(c))return!1;A=!0,Q=!1}if(ct&&!Q)return k||(k=new Fn),A||vs(o)?K0(o,c,f,y,b,k):mB(o,c,U,f,y,b,k);if(!(f&v)){var yt=Q&&Gt.call(o,"__wrapped__"),Tt=rt&&Gt.call(c,"__wrapped__");if(yt||Tt){var Nt=yt?o.value():o,wt=Tt?c.value():c;return k||(k=new Fn),b(Nt,wt,f,y,k)}}return ct?(k||(k=new Fn),yB(o,c,f,y,b,k)):!1}function $N(o){return ge(o)&&Ge(o)==Ct}function df(o,c,f,y){var b=f.length,k=b,A=!y;if(o==null)return!k;for(o=ne(o);b--;){var R=f[b];if(A&&R[2]?R[1]!==o[R[0]]:!(R[0]in o))return!1}for(;++b<k;){R=f[b];var U=R[0],Z=o[U],Q=R[1];if(A&&R[2]){if(Z===e&&!(U in o))return!1}else{var rt=new Fn;if(y)var ct=y(Z,Q,U,o,c,rt);if(!(ct===e?jo(Q,Z,v|S,y,rt):ct))return!1}}return!0}function y0(o){if(!fe(o)||kB(o))return!1;var c=_i(o)?$L:Md;return c.test(Or(o))}function YN(o){return ge(o)&&Qe(o)==Ae}function qN(o){return ge(o)&&Ge(o)==oe}function jN(o){return ge(o)&&mc(o.length)&&!!ee[Qe(o)]}function _0(o){return typeof o=="function"?o:o==null?hn:typeof o=="object"?Rt(o)?w0(o[0],o[1]):x0(o):Hb(o)}function ff(o){if(!Xo(o))return XL(o);var c=[];for(var f in ne(o))Gt.call(o,f)&&f!="constructor"&&c.push(f);return c}function GN(o){if(!fe(o))return AB(o);var c=Xo(o),f=[];for(var y in o)y=="constructor"&&(c||!Gt.call(o,y))||f.push(y);return f}function hf(o,c){return o<c}function b0(o,c){var f=-1,y=dn(o)?Y(o.length):[];return ji(o,function(b,k,A){y[++f]=c(b,k,A)}),y}function x0(o){var c=Cf(o);return c.length==1&&c[0][2]?tb(c[0][0],c[0][1]):function(f){return f===o||df(f,o,c)}}function w0(o,c){return Af(o)&&J0(c)?tb(zn(o),c):function(f){var y=Hf(f,o);return y===e&&y===c?Wf(f,o):jo(c,y,v|S)}}function tc(o,c,f,y,b){o!==c&&af(c,function(k,A){if(b||(b=new Fn),fe(k))KN(o,c,A,f,tc,y,b);else{var R=y?y(Rf(o,A),k,A+"",o,c,b):e;R===e&&(R=k),sf(o,A,R)}},fn)}function KN(o,c,f,y,b,k,A){var R=Rf(o,f),U=Rf(c,f),Z=A.get(U);if(Z){sf(o,f,Z);return}var Q=k?k(R,U,f+"",o,c,A):e,rt=Q===e;if(rt){var ct=Rt(U),yt=!ct&&Zi(U),Tt=!ct&&!yt&&vs(U);Q=U,ct||yt||Tt?Rt(R)?Q=R:_e(R)?Q=un(R):yt?(rt=!1,Q=P0(U,!0)):Tt?(rt=!1,Q=I0(U,!0)):Q=[]:Qo(U)||Ar(U)?(Q=R,Ar(R)?Q=Ab(R):(!fe(R)||_i(R))&&(Q=Q0(U))):rt=!1}rt&&(A.set(U,Q),b(Q,U,y,k,A),A.delete(U)),sf(o,f,Q)}function v0(o,c){var f=o.length;if(f)return c+=c<0?f:0,yi(c,f)?o[c]:e}function S0(o,c,f){c.length?c=ue(c,function(k){return Rt(k)?function(A){return Dr(A,k.length===1?k[0]:k)}:k}):c=[hn];var y=-1;c=ue(c,_n(St()));var b=b0(o,function(k,A,R){var U=ue(c,function(Z){return Z(k)});return{criteria:U,index:++y,value:k}});return vL(b,function(k,A){return lB(k,A,f)})}function XN(o,c){return T0(o,c,function(f,y){return Wf(o,y)})}function T0(o,c,f){for(var y=-1,b=c.length,k={};++y<b;){var A=c[y],R=Dr(o,A);f(R,A)&&Go(k,Ki(A,o),R)}return k}function ZN(o){return function(c){return Dr(c,o)}}function pf(o,c,f,y){var b=y?wL:ds,k=-1,A=c.length,R=o;for(o===c&&(c=un(c)),f&&(R=ue(o,_n(f)));++k<A;)for(var U=0,Z=c[k],Q=f?f(Z):Z;(U=b(R,Q,U,y))>-1;)R!==o&&$l.call(R,U,1),$l.call(o,U,1);return o}function M0(o,c){for(var f=o?c.length:0,y=f-1;f--;){var b=c[f];if(f==y||b!==k){var k=b;yi(b)?$l.call(o,b,1):_f(o,b)}}return o}function gf(o,c){return o+jl(s0()*(c-o+1))}function QN(o,c,f,y){for(var b=-1,k=ke(ql((c-o)/(f||1)),0),A=Y(k);k--;)A[y?k:++b]=o,o+=f;return A}function mf(o,c){var f="";if(!o||c<1||c>et)return f;do c%2&&(f+=o),c=jl(c/2),c&&(o+=o);while(c);return f}function Bt(o,c){return Pf(eb(o,c,hn),o+"")}function JN(o){return l0(Ss(o))}function tB(o,c){var f=Ss(o);return uc(f,kr(c,0,f.length))}function Go(o,c,f,y){if(!fe(o))return o;c=Ki(c,o);for(var b=-1,k=c.length,A=k-1,R=o;R!=null&&++b<k;){var U=zn(c[b]),Z=f;if(U==="__proto__"||U==="constructor"||U==="prototype")return o;if(b!=A){var Q=R[U];Z=y?y(Q,U,R):e,Z===e&&(Z=fe(Q)?Q:yi(c[b+1])?[]:{})}$o(R,U,Z),R=R[U]}return o}var k0=Gl?function(o,c){return Gl.set(o,c),o}:hn,eB=Yl?function(o,c){return Yl(o,"toString",{configurable:!0,enumerable:!1,value:$f(c),writable:!0})}:hn;function nB(o){return uc(Ss(o))}function En(o,c,f){var y=-1,b=o.length;c<0&&(c=-c>b?0:b+c),f=f>b?b:f,f<0&&(f+=b),b=c>f?0:f-c>>>0,c>>>=0;for(var k=Y(b);++y<b;)k[y]=o[y+c];return k}function iB(o,c){var f;return ji(o,function(y,b,k){return f=c(y,b,k),!f}),!!f}function ec(o,c,f){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=_t){for(;y<b;){var k=y+b>>>1,A=o[k];A!==null&&!xn(A)&&(f?A<=c:A<c)?y=k+1:b=k}return b}return yf(o,c,hn,f)}function yf(o,c,f,y){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=f(c);for(var A=c!==c,R=c===null,U=xn(c),Z=c===e;b<k;){var Q=jl((b+k)/2),rt=f(o[Q]),ct=rt!==e,yt=rt===null,Tt=rt===rt,Nt=xn(rt);if(A)var wt=y||Tt;else Z?wt=Tt&&(y||ct):R?wt=Tt&&ct&&(y||!yt):U?wt=Tt&&ct&&!yt&&(y||!Nt):yt||Nt?wt=!1:wt=y?rt<=c:rt<c;wt?b=Q+1:k=Q}return je(k,X)}function D0(o,c){for(var f=-1,y=o.length,b=0,k=[];++f<y;){var A=o[f],R=c?c(A):A;if(!f||!Un(R,U)){var U=R;k[b++]=A===0?0:A}}return k}function C0(o){return typeof o=="number"?o:xn(o)?H:+o}function bn(o){if(typeof o=="string")return o;if(Rt(o))return ue(o,bn)+"";if(xn(o))return o0?o0.call(o):"";var c=o+"";return c=="0"&&1/o==-nt?"-0":c}function Gi(o,c,f){var y=-1,b=Il,k=o.length,A=!0,R=[],U=R;if(f)A=!1,b=Yd;else if(k>=r){var Z=c?null:pB(o);if(Z)return Nl(Z);A=!1,b=Fo,U=new Mr}else U=c?[]:R;t:for(;++y<k;){var Q=o[y],rt=c?c(Q):Q;if(Q=f||Q!==0?Q:0,A&&rt===rt){for(var ct=U.length;ct--;)if(U[ct]===rt)continue t;c&&U.push(rt),R.push(Q)}else b(U,rt,f)||(U!==R&&U.push(rt),R.push(Q))}return R}function _f(o,c){c=Ki(c,o);var f=-1,y=c.length;if(!y)return!0;for(;++f<y;){var b=zn(c[f]);if(b==="__proto__"&&!Gt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&f<y-1)return!1}var k=nb(o,c);return k==null||delete k[zn(Rn(c))]}function O0(o,c,f,y){return Go(o,c,f(Dr(o,c)),y)}function nc(o,c,f,y){for(var b=o.length,k=y?b:-1;(y?k--:++k<b)&&c(o[k],k,o););return f?En(o,y?0:k,y?k+1:b):En(o,y?k+1:0,y?b:k)}function A0(o,c){var f=o;return f instanceof Ut&&(f=f.value()),qd(c,function(y,b){return b.func.apply(b.thisArg,$i([y],b.args))},f)}function bf(o,c,f){var y=o.length;if(y<2)return y?Gi(o[0]):[];for(var b=-1,k=Y(y);++b<y;)for(var A=o[b],R=-1;++R<y;)R!=b&&(k[b]=Yo(k[b]||A,o[R],c,f));return Gi(Fe(k,1),c,f)}function E0(o,c,f){for(var y=-1,b=o.length,k=c.length,A={};++y<b;){var R=y<k?c[y]:e;f(A,o[y],R)}return A}function xf(o){return _e(o)?o:[]}function wf(o){return typeof o=="function"?o:hn}function Ki(o,c){return Rt(o)?o:Af(o,c)?[o]:ob(Kt(o))}var rB=Bt;function Xi(o,c,f){var y=o.length;return f=f===e?y:f,!c&&f>=y?o:En(o,c,f)}var R0=YL||function(o){return ce.clearTimeout(o)};function P0(o,c){if(c)return o.slice();var f=o.length,y=t0?t0(f):new o.constructor(f);return o.copy(y),y}function vf(o){var c=new o.constructor(o.byteLength);return new Wl(c).set(new Wl(o)),c}function sB(o,c){var f=c?vf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function oB(o){var c=new o.constructor(o.source,yl.exec(o));return c.lastIndex=o.lastIndex,c}function aB(o){return Vo?ne(Vo.call(o)):{}}function I0(o,c){var f=c?vf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function L0(o,c){if(o!==c){var f=o!==e,y=o===null,b=o===o,k=xn(o),A=c!==e,R=c===null,U=c===c,Z=xn(c);if(!R&&!Z&&!k&&o>c||k&&A&&U&&!R&&!Z||y&&A&&U||!f&&U||!b)return 1;if(!y&&!k&&!Z&&o<c||Z&&f&&b&&!y&&!k||R&&f&&b||!A&&b||!U)return-1}return 0}function lB(o,c,f){for(var y=-1,b=o.criteria,k=c.criteria,A=b.length,R=f.length;++y<A;){var U=L0(b[y],k[y]);if(U){if(y>=R)return U;var Z=f[y];return U*(Z=="desc"?-1:1)}}return o.index-c.index}function N0(o,c,f,y){for(var b=-1,k=o.length,A=f.length,R=-1,U=c.length,Z=ke(k-A,0),Q=Y(U+Z),rt=!y;++R<U;)Q[R]=c[R];for(;++b<A;)(rt||b<k)&&(Q[f[b]]=o[b]);for(;Z--;)Q[R++]=o[b++];return Q}function B0(o,c,f,y){for(var b=-1,k=o.length,A=-1,R=f.length,U=-1,Z=c.length,Q=ke(k-R,0),rt=Y(Q+Z),ct=!y;++b<Q;)rt[b]=o[b];for(var yt=b;++U<Z;)rt[yt+U]=c[U];for(;++A<R;)(ct||b<k)&&(rt[yt+f[A]]=o[b++]);return rt}function un(o,c){var f=-1,y=o.length;for(c||(c=Y(y));++f<y;)c[f]=o[f];return c}function Qn(o,c,f,y){var b=!f;f||(f={});for(var k=-1,A=c.length;++k<A;){var R=c[k],U=y?y(f[R],o[R],R,f,o):e;U===e&&(U=o[R]),b?Xn(f,R,U):$o(f,R,U)}return f}function cB(o,c){return Qn(o,Of(o),c)}function uB(o,c){return Qn(o,X0(o),c)}function ic(o,c){return function(f,y){var b=Rt(f)?gL:RN,k=c?c():{};return b(f,o,St(y,2),k)}}function bs(o){return Bt(function(c,f){var y=-1,b=f.length,k=b>1?f[b-1]:e,A=b>2?f[2]:e;for(k=o.length>3&&typeof k=="function"?(b--,k):e,A&&Je(f[0],f[1],A)&&(k=b<3?e:k,b=1),c=ne(c);++y<b;){var R=f[y];R&&o(c,R,y,k)}return c})}function F0(o,c){return function(f,y){if(f==null)return f;if(!dn(f))return o(f,y);for(var b=f.length,k=c?b:-1,A=ne(f);(c?k--:++k<b)&&y(A[k],k,A)!==!1;);return f}}function z0(o){return function(c,f,y){for(var b=-1,k=ne(c),A=y(c),R=A.length;R--;){var U=A[o?R:++b];if(f(k[U],U,k)===!1)break}return c}}function dB(o,c,f){var y=c&C,b=Ko(o);function k(){var A=this&&this!==ce&&this instanceof k?b:o;return A.apply(y?f:this,arguments)}return k}function U0(o){return function(c){c=Kt(c);var f=fs(c)?Bn(c):e,y=f?f[0]:c.charAt(0),b=f?Xi(f,1).join(""):c.slice(1);return y[o]()+b}}function xs(o){return function(c){return qd(zb(Fb(c).replace(Ud,"")),o,"")}}function Ko(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 f=_s(o.prototype),y=o.apply(f,c);return fe(y)?y:f}}function fB(o,c,f){var y=Ko(o);function b(){for(var k=arguments.length,A=Y(k),R=k,U=ws(b);R--;)A[R]=arguments[R];var Z=k<3&&A[0]!==U&&A[k-1]!==U?[]:Yi(A,U);if(k-=Z.length,k<f)return Y0(o,c,rc,b.placeholder,e,A,Z,e,e,f-k);var Q=this&&this!==ce&&this instanceof b?y:o;return mn(Q,this,A)}return b}function H0(o){return function(c,f,y){var b=ne(c);if(!dn(c)){var k=St(f,3);c=Re(c),f=function(R){return k(b[R],R,b)}}var A=o(c,f,y);return A>-1?b[k?c[A]:A]:e}}function W0(o){return mi(function(c){var f=c.length,y=f,b=On.prototype.thru;for(o&&c.reverse();y--;){var k=c[y];if(typeof k!="function")throw new Cn(a);if(b&&!A&&lc(k)=="wrapper")var A=new On([],!0)}for(y=A?y:f;++y<f;){k=c[y];var R=lc(k),U=R=="wrapper"?Df(k):e;U&&Ef(U[0])&&U[1]==(T|P|I|M)&&!U[4].length&&U[9]==1?A=A[lc(U[0])].apply(A,U[3]):A=k.length==1&&Ef(k)?A[R]():A.thru(k)}return function(){var Z=arguments,Q=Z[0];if(A&&Z.length==1&&Rt(Q))return A.plant(Q).value();for(var rt=0,ct=f?c[rt].apply(this,Z):Q;++rt<f;)ct=c[rt].call(this,ct);return ct}})}function rc(o,c,f,y,b,k,A,R,U,Z){var Q=c&T,rt=c&C,ct=c&E,yt=c&(P|L),Tt=c&O,Nt=ct?e:Ko(o);function wt(){for(var Ft=arguments.length,Ht=Y(Ft),wn=Ft;wn--;)Ht[wn]=arguments[wn];if(yt)var tn=ws(wt),vn=TL(Ht,tn);if(y&&(Ht=N0(Ht,y,b,yt)),k&&(Ht=B0(Ht,k,A,yt)),Ft-=vn,yt&&Ft<Z){var be=Yi(Ht,tn);return Y0(o,c,rc,wt.placeholder,f,Ht,be,R,U,Z-Ft)}var Hn=rt?f:this,xi=ct?Hn[o]:o;return Ft=Ht.length,R?Ht=RB(Ht,R):Tt&&Ft>1&&Ht.reverse(),Q&&U<Ft&&(Ht.length=U),this&&this!==ce&&this instanceof wt&&(xi=Nt||Ko(xi)),xi.apply(Hn,Ht)}return wt}function V0(o,c){return function(f,y){return UN(f,o,c(y),{})}}function sc(o,c){return function(f,y){var b;if(f===e&&y===e)return c;if(f!==e&&(b=f),y!==e){if(b===e)return y;typeof f=="string"||typeof y=="string"?(f=bn(f),y=bn(y)):(f=C0(f),y=C0(y)),b=o(f,y)}return b}}function Sf(o){return mi(function(c){return c=ue(c,_n(St())),Bt(function(f){var y=this;return o(c,function(b){return mn(b,y,f)})})})}function oc(o,c){c=c===e?" ":bn(c);var f=c.length;if(f<2)return f?mf(c,o):c;var y=mf(c,ql(o/hs(c)));return fs(c)?Xi(Bn(y),0,o).join(""):y.slice(0,o)}function hB(o,c,f,y){var b=c&C,k=Ko(o);function A(){for(var R=-1,U=arguments.length,Z=-1,Q=y.length,rt=Y(Q+U),ct=this&&this!==ce&&this instanceof A?k:o;++Z<Q;)rt[Z]=y[Z];for(;U--;)rt[Z++]=arguments[++R];return mn(ct,b?f:this,rt)}return A}function $0(o){return function(c,f,y){return y&&typeof y!="number"&&Je(c,f,y)&&(f=y=e),c=bi(c),f===e?(f=c,c=0):f=bi(f),y=y===e?c<f?1:-1:bi(y),QN(c,f,y,o)}}function ac(o){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Pn(c),f=Pn(f)),o(c,f)}}function Y0(o,c,f,y,b,k,A,R,U,Z){var Q=c&P,rt=Q?A:e,ct=Q?e:A,yt=Q?k:e,Tt=Q?e:k;c|=Q?I:N,c&=~(Q?N:I),c&B||(c&=-4);var Nt=[o,c,b,yt,rt,Tt,ct,R,U,Z],wt=f.apply(e,Nt);return Ef(o)&&ib(wt,Nt),wt.placeholder=y,rb(wt,o,c)}function Tf(o){var c=Me[o];return function(f,y){if(f=Pn(f),y=y==null?0:je(Lt(y),292),y&&r0(f)){var b=(Kt(f)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+y));return b=(Kt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(f)}}var pB=ms&&1/Nl(new ms([,-0]))[1]==nt?function(o){return new ms(o)}:jf;function q0(o){return function(c){var f=Ge(c);return f==Ct?Jd(c):f==oe?EL(c):SL(c,o(c))}}function gi(o,c,f,y,b,k,A,R){var U=c&E;if(!U&&typeof o!="function")throw new Cn(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=e),A=A===e?A:ke(Lt(A),0),R=R===e?R:Lt(R),Z-=b?b.length:0,c&N){var Q=y,rt=b;y=b=e}var ct=U?e:Df(o),yt=[o,c,f,y,b,Q,rt,k,A,R];if(ct&&OB(yt,ct),o=yt[0],c=yt[1],f=yt[2],y=yt[3],b=yt[4],R=yt[9]=yt[9]===e?U?0:o.length:ke(yt[9]-Z,0),!R&&c&(P|L)&&(c&=-25),!c||c==C)var Tt=dB(o,c,f);else c==P||c==L?Tt=fB(o,c,R):(c==I||c==(C|I))&&!b.length?Tt=hB(o,c,f,y):Tt=rc.apply(e,yt);var Nt=ct?k0:ib;return rb(Nt(Tt,yt),o,c)}function j0(o,c,f,y){return o===e||Un(o,gs[f])&&!Gt.call(y,f)?c:o}function G0(o,c,f,y,b,k){return fe(o)&&fe(c)&&(k.set(c,o),tc(o,c,e,G0,k),k.delete(c)),o}function gB(o){return Qo(o)?e:o}function K0(o,c,f,y,b,k){var A=f&v,R=o.length,U=c.length;if(R!=U&&!(A&&U>R))return!1;var Z=k.get(o),Q=k.get(c);if(Z&&Q)return Z==c&&Q==o;var rt=-1,ct=!0,yt=f&S?new Mr:e;for(k.set(o,c),k.set(c,o);++rt<R;){var Tt=o[rt],Nt=c[rt];if(y)var wt=A?y(Nt,Tt,rt,c,o,k):y(Tt,Nt,rt,o,c,k);if(wt!==e){if(wt)continue;ct=!1;break}if(yt){if(!jd(c,function(Ft,Ht){if(!Fo(yt,Ht)&&(Tt===Ft||b(Tt,Ft,f,y,k)))return yt.push(Ht)})){ct=!1;break}}else if(!(Tt===Nt||b(Tt,Nt,f,y,k))){ct=!1;break}}return k.delete(o),k.delete(c),ct}function mB(o,c,f,y,b,k,A){switch(f){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Ee:return!(o.byteLength!=c.byteLength||!k(new Wl(o),new Wl(c)));case lt:case pt:case Dt:return Un(+o,+c);case It:return o.name==c.name&&o.message==c.message;case Ae:case ln:return o==c+"";case Ct:var R=Jd;case oe:var U=y&v;if(R||(R=Nl),o.size!=c.size&&!U)return!1;var Z=A.get(o);if(Z)return Z==c;y|=S,A.set(o,c);var Q=K0(R(o),R(c),y,b,k,A);return A.delete(o),Q;case Vt:if(Vo)return Vo.call(o)==Vo.call(c)}return!1}function yB(o,c,f,y,b,k){var A=f&v,R=Mf(o),U=R.length,Z=Mf(c),Q=Z.length;if(U!=Q&&!A)return!1;for(var rt=U;rt--;){var ct=R[rt];if(!(A?ct in c:Gt.call(c,ct)))return!1}var yt=k.get(o),Tt=k.get(c);if(yt&&Tt)return yt==c&&Tt==o;var Nt=!0;k.set(o,c),k.set(c,o);for(var wt=A;++rt<U;){ct=R[rt];var Ft=o[ct],Ht=c[ct];if(y)var wn=A?y(Ht,Ft,ct,c,o,k):y(Ft,Ht,ct,o,c,k);if(!(wn===e?Ft===Ht||b(Ft,Ht,f,y,k):wn)){Nt=!1;break}wt||(wt=ct=="constructor")}if(Nt&&!wt){var tn=o.constructor,vn=c.constructor;tn!=vn&&"constructor"in o&&"constructor"in c&&!(typeof tn=="function"&&tn instanceof tn&&typeof vn=="function"&&vn instanceof vn)&&(Nt=!1)}return k.delete(o),k.delete(c),Nt}function mi(o){return Pf(eb(o,e,ub),o+"")}function Mf(o){return g0(o,Re,Of)}function kf(o){return g0(o,fn,X0)}var Df=Gl?function(o){return Gl.get(o)}:jf;function lc(o){for(var c=o.name+"",f=ys[c],y=Gt.call(ys,c)?f.length:0;y--;){var b=f[y],k=b.func;if(k==null||k==o)return b.name}return c}function ws(o){var c=Gt.call(w,"placeholder")?w:o;return c.placeholder}function St(){var o=w.iteratee||Yf;return o=o===Yf?_0:o,arguments.length?o(arguments[0],arguments[1]):o}function cc(o,c){var f=o.__data__;return MB(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Cf(o){for(var c=Re(o),f=c.length;f--;){var y=c[f],b=o[y];c[f]=[y,b,J0(b)]}return c}function Cr(o,c){var f=CL(o,c);return y0(f)?f:e}function _B(o){var c=Gt.call(o,Sr),f=o[Sr];try{o[Sr]=e;var y=!0}catch{}var b=Ul.call(o);return y&&(c?o[Sr]=f:delete o[Sr]),b}var Of=ef?function(o){return o==null?[]:(o=ne(o),Vi(ef(o),function(c){return n0.call(o,c)}))}:Gf,X0=ef?function(o){for(var c=[];o;)$i(c,Of(o)),o=Vl(o);return c}:Gf,Ge=Qe;(nf&&Ge(new nf(new ArrayBuffer(1)))!=gn||Uo&&Ge(new Uo)!=Ct||rf&&Ge(rf.resolve())!=jt||ms&&Ge(new ms)!=oe||Ho&&Ge(new Ho)!=ie)&&(Ge=function(o){var c=Qe(o),f=c==bt?o.constructor:e,y=f?Or(f):"";if(y)switch(y){case tN:return gn;case eN:return Ct;case nN:return jt;case iN:return oe;case rN:return ie}return c});function bB(o,c,f){for(var y=-1,b=f.length;++y<b;){var k=f[y],A=k.size;switch(k.type){case"drop":o+=A;break;case"dropRight":c-=A;break;case"take":c=je(c,o+A);break;case"takeRight":o=ke(o,c-A);break}}return{start:o,end:c}}function xB(o){var c=o.match(bd);return c?c[1].split(xd):[]}function Z0(o,c,f){c=Ki(c,o);for(var y=-1,b=c.length,k=!1;++y<b;){var A=zn(c[y]);if(!(k=o!=null&&f(o,A)))break;o=o[A]}return k||++y!=b?k:(b=o==null?0:o.length,!!b&&mc(b)&&yi(A,b)&&(Rt(o)||Ar(o)))}function wB(o){var c=o.length,f=new o.constructor(c);return c&&typeof o[0]=="string"&&Gt.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function Q0(o){return typeof o.constructor=="function"&&!Xo(o)?_s(Vl(o)):{}}function vB(o,c,f){var y=o.constructor;switch(c){case Ee:return vf(o);case lt:case pt:return new y(+o);case gn:return sB(o,f);case zi:case Dn:case Ye:case In:case ci:case So:case To:case br:case ui:return I0(o,f);case Ct:return new y;case Dt:case ln:return new y(o);case Ae:return oB(o);case oe:return new y;case Vt:return aB(o)}}function SB(o,c){var f=c.length;if(!f)return o;var y=f-1;return c[y]=(f>1?"& ":"")+c[y],c=c.join(f>2?", ":" "),o.replace(Ln,`{
8
8
  /* [wrapped with `+c+`] */
9
- `)}function TB(o){return Et(o)||Ar(o)||!!(i0&&o&&o[i0])}function yi(o,c){var f=typeof o;return c=c??et,!!c&&(f=="number"||f!="symbol"&&Wi.test(o))&&o>-1&&o%1==0&&o<c}function Je(o,c,f){if(!fe(f))return!1;var y=typeof c;return(y=="number"?dn(f)&&yi(c,f.length):y=="string"&&c in f)?Un(f[c],o):!1}function Af(o,c){if(Et(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||xn(o)?!0:di.test(o)||!gl.test(o)||c!=null&&o in ne(c)}function MB(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Rf(o){var c=lc(o),f=w[c];if(typeof f!="function"||!(c in Ut.prototype))return!1;if(o===f)return!0;var y=Df(f);return!!y&&o===y[0]}function kB(o){return!!J_&&J_ in o}var DB=Fl?_i:Kf;function Xo(o){var c=o&&o.constructor,f=typeof c=="function"&&c.prototype||gs;return o===f}function J0(o){return o===o&&!fe(o)}function tb(o,c){return function(f){return f==null?!1:f[o]===c&&(c!==e||o in ne(f))}}function CB(o){var c=pc(o,function(y){return f.size===h&&f.clear(),y}),f=c.cache;return c}function OB(o,c){var f=o[1],y=c[1],b=f|y,k=b<(C|R|T),A=y==T&&f==P||y==T&&f==M&&o[7].length<=c[8]||y==(T|M)&&c[7].length<=c[8]&&f==P;if(!(k||A))return o;y&C&&(o[2]=c[2],b|=f&C?0:B);var E=c[3];if(E){var U=o[3];o[3]=U?N0(U,E,c[4]):E,o[4]=U?Yi(o[3],g):c[4]}return E=c[5],E&&(U=o[5],o[5]=U?B0(U,E,c[6]):E,o[6]=U?Yi(o[5],g):c[6]),E=c[7],E&&(o[7]=E),y&T&&(o[8]=o[8]==null?c[8]:je(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function AB(o){var c=[];if(o!=null)for(var f in ne(o))c.push(f);return c}function RB(o){return Ul.call(o)}function eb(o,c,f){return c=ke(c===e?o.length-1:c,0),function(){for(var y=arguments,b=-1,k=ke(y.length-c,0),A=Y(k);++b<k;)A[b]=y[c+b];b=-1;for(var E=Y(c+1);++b<c;)E[b]=y[b];return E[c]=f(A),mn(o,this,E)}}function nb(o,c){return c.length<2?o:Dr(o,Rn(c,0,-1))}function EB(o,c){for(var f=o.length,y=je(c.length,f),b=un(o);y--;){var k=c[y];o[y]=yi(k,f)?b[k]:e}return o}function Ef(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var ib=sb(k0),Zo=jL||function(o,c){return ce.setTimeout(o,c)},Pf=sb(eB);function rb(o,c,f){var y=c+"";return Pf(o,SB(y,PB(xB(y),f)))}function sb(o){var c=0,f=0;return function(){var y=ZL(),b=ut-(y-f);if(f=y,b>0){if(++c>=it)return arguments[0]}else c=0;return o.apply(e,arguments)}}function uc(o,c){var f=-1,y=o.length,b=y-1;for(c=c===e?y:c;++f<c;){var k=gf(f,b),A=o[k];o[k]=o[f],o[f]=A}return o.length=c,o}var ob=CB(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(md,function(f,y,b,k){c.push(b?k.replace(vd,"$1"):y||f)}),c});function zn(o){if(typeof o=="string"||xn(o))return o;var c=o+"";return c=="0"&&1/o==-nt?"-0":c}function Or(o){if(o!=null){try{return zl.call(o)}catch{}try{return o+""}catch{}}return""}function PB(o,c){return yn(G,function(f){var y="_."+f[0];c&f[1]&&!Il(o,y)&&o.push(y)}),o.sort()}function ab(o){if(o instanceof Ut)return o.clone();var c=new On(o.__wrapped__,o.__chain__);return c.__actions__=un(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function IB(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=ke(Lt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,k=0,A=Y(ql(y/c));b<y;)A[k++]=Rn(o,b,b+=c);return A}function LB(o){for(var c=-1,f=o==null?0:o.length,y=0,b=[];++c<f;){var k=o[c];k&&(b[y++]=k)}return b}function NB(){var o=arguments.length;if(!o)return[];for(var c=Y(o-1),f=arguments[0],y=o;y--;)c[y-1]=arguments[y];return $i(Et(f)?un(f):[f],Fe(c,1))}var BB=Bt(function(o,c){return _e(o)?Yo(o,Fe(c,1,_e,!0)):[]}),FB=Bt(function(o,c){var f=En(c);return _e(f)&&(f=e),_e(o)?Yo(o,Fe(c,1,_e,!0),St(f,2)):[]}),zB=Bt(function(o,c){var f=En(c);return _e(f)&&(f=e),_e(o)?Yo(o,Fe(c,1,_e,!0),e,f):[]});function UB(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Lt(c),Rn(o,c<0?0:c,y)):[]}function HB(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Lt(c),c=y-c,Rn(o,0,c<0?0:c)):[]}function WB(o,c){return o&&o.length?nc(o,St(c,3),!0,!0):[]}function VB(o,c){return o&&o.length?nc(o,St(c,3),!0):[]}function $B(o,c,f,y){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&Je(o,c,f)&&(f=0,y=b),NN(o,c,f,y)):[]}function lb(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=f==null?0:Lt(f);return b<0&&(b=ke(y+b,0)),Ll(o,St(c,3),b)}function cb(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return f!==e&&(b=Lt(f),b=f<0?ke(y+b,0):je(b,y-1)),Ll(o,St(c,3),b,!0)}function ub(o){var c=o==null?0:o.length;return c?Fe(o,1):[]}function YB(o){var c=o==null?0:o.length;return c?Fe(o,nt):[]}function qB(o,c){var f=o==null?0:o.length;return f?(c=c===e?1:Lt(c),Fe(o,c)):[]}function jB(o){for(var c=-1,f=o==null?0:o.length,y={};++c<f;){var b=o[c];Xn(y,b[0],b[1])}return y}function db(o){return o&&o.length?o[0]:e}function GB(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=f==null?0:Lt(f);return b<0&&(b=ke(y+b,0)),ds(o,c,b)}function KB(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var XB=Bt(function(o){var c=ue(o,xf);return c.length&&c[0]===o[0]?uf(c):[]}),ZB=Bt(function(o){var c=En(o),f=ue(o,xf);return c===En(f)?c=e:f.pop(),f.length&&f[0]===o[0]?uf(f,St(c,2)):[]}),QB=Bt(function(o){var c=En(o),f=ue(o,xf);return c=typeof c=="function"?c:e,c&&f.pop(),f.length&&f[0]===o[0]?uf(f,e,c):[]});function JB(o,c){return o==null?"":KL.call(o,c)}function En(o){var c=o==null?0:o.length;return c?o[c-1]:e}function tF(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=y;return f!==e&&(b=Lt(f),b=b<0?ke(y+b,0):je(b,y-1)),c===c?PL(o,c,b):Ll(o,Y_,b,!0)}function eF(o,c){return o&&o.length?v0(o,Lt(c)):e}var nF=Bt(fb);function fb(o,c){return o&&o.length&&c&&c.length?pf(o,c):o}function iF(o,c,f){return o&&o.length&&c&&c.length?pf(o,c,St(f,2)):o}function rF(o,c,f){return o&&o.length&&c&&c.length?pf(o,c,e,f):o}var sF=mi(function(o,c){var f=o==null?0:o.length,y=of(o,c);return M0(o,ue(c,function(b){return yi(b,f)?+b:b}).sort(L0)),y});function oF(o,c){var f=[];if(!(o&&o.length))return f;var y=-1,b=[],k=o.length;for(c=St(c,3);++y<k;){var A=o[y];c(A,y,o)&&(f.push(A),b.push(y))}return M0(o,b),f}function If(o){return o==null?o:JL.call(o)}function aF(o,c,f){var y=o==null?0:o.length;return y?(f&&typeof f!="number"&&Je(o,c,f)?(c=0,f=y):(c=c==null?0:Lt(c),f=f===e?y:Lt(f)),Rn(o,c,f)):[]}function lF(o,c){return ec(o,c)}function cF(o,c,f){return yf(o,c,St(f,2))}function uF(o,c){var f=o==null?0:o.length;if(f){var y=ec(o,c);if(y<f&&Un(o[y],c))return y}return-1}function dF(o,c){return ec(o,c,!0)}function fF(o,c,f){return yf(o,c,St(f,2),!0)}function hF(o,c){var f=o==null?0:o.length;if(f){var y=ec(o,c,!0)-1;if(Un(o[y],c))return y}return-1}function pF(o){return o&&o.length?D0(o):[]}function gF(o,c){return o&&o.length?D0(o,St(c,2)):[]}function mF(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function yF(o,c,f){return o&&o.length?(c=f||c===e?1:Lt(c),Rn(o,0,c<0?0:c)):[]}function _F(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Lt(c),c=y-c,Rn(o,c<0?0:c,y)):[]}function bF(o,c){return o&&o.length?nc(o,St(c,3),!1,!0):[]}function xF(o,c){return o&&o.length?nc(o,St(c,3)):[]}var wF=Bt(function(o){return Gi(Fe(o,1,_e,!0))}),vF=Bt(function(o){var c=En(o);return _e(c)&&(c=e),Gi(Fe(o,1,_e,!0),St(c,2))}),SF=Bt(function(o){var c=En(o);return c=typeof c=="function"?c:e,Gi(Fe(o,1,_e,!0),e,c)});function TF(o){return o&&o.length?Gi(o):[]}function MF(o,c){return o&&o.length?Gi(o,St(c,2)):[]}function kF(o,c){return c=typeof c=="function"?c:e,o&&o.length?Gi(o,e,c):[]}function Lf(o){if(!(o&&o.length))return[];var c=0;return o=Vi(o,function(f){if(_e(f))return c=ke(f.length,c),!0}),Zd(c,function(f){return ue(o,Gd(f))})}function hb(o,c){if(!(o&&o.length))return[];var f=Lf(o);return c==null?f:ue(f,function(y){return mn(c,e,y)})}var DF=Bt(function(o,c){return _e(o)?Yo(o,c):[]}),CF=Bt(function(o){return bf(Vi(o,_e))}),OF=Bt(function(o){var c=En(o);return _e(c)&&(c=e),bf(Vi(o,_e),St(c,2))}),AF=Bt(function(o){var c=En(o);return c=typeof c=="function"?c:e,bf(Vi(o,_e),e,c)}),RF=Bt(Lf);function EF(o,c){return R0(o||[],c||[],$o)}function PF(o,c){return R0(o||[],c||[],Go)}var IF=Bt(function(o){var c=o.length,f=c>1?o[c-1]:e;return f=typeof f=="function"?(o.pop(),f):e,hb(o,f)});function pb(o){var c=w(o);return c.__chain__=!0,c}function LF(o,c){return c(o),o}function dc(o,c){return c(o)}var NF=mi(function(o){var c=o.length,f=c?o[0]:0,y=this.__wrapped__,b=function(k){return of(k,o)};return c>1||this.__actions__.length||!(y instanceof Ut)||!yi(f)?this.thru(b):(y=y.slice(f,+f+(c?1:0)),y.__actions__.push({func:dc,args:[b],thisArg:e}),new On(y,this.__chain__).thru(function(k){return c&&!k.length&&k.push(e),k}))});function BF(){return pb(this)}function FF(){return new On(this.value(),this.__chain__)}function zF(){this.__values__===e&&(this.__values__=Cb(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function UF(){return this}function HF(o){for(var c,f=this;f instanceof Xl;){var y=ab(f);y.__index__=0,y.__values__=e,c?b.__wrapped__=y:c=y;var b=y;f=f.__wrapped__}return b.__wrapped__=o,c}function WF(){var o=this.__wrapped__;if(o instanceof Ut){var c=o;return this.__actions__.length&&(c=new Ut(this)),c=c.reverse(),c.__actions__.push({func:dc,args:[If],thisArg:e}),new On(c,this.__chain__)}return this.thru(If)}function VF(){return A0(this.__wrapped__,this.__actions__)}var $F=ic(function(o,c,f){Gt.call(o,f)?++o[f]:Xn(o,f,1)});function YF(o,c,f){var y=Et(o)?V_:LN;return f&&Je(o,c,f)&&(c=e),y(o,St(c,3))}function qF(o,c){var f=Et(o)?Vi:h0;return f(o,St(c,3))}var jF=H0(lb),GF=H0(cb);function KF(o,c){return Fe(fc(o,c),1)}function XF(o,c){return Fe(fc(o,c),nt)}function ZF(o,c,f){return f=f===e?1:Lt(f),Fe(fc(o,c),f)}function gb(o,c){var f=Et(o)?yn:ji;return f(o,St(c,3))}function mb(o,c){var f=Et(o)?mL:f0;return f(o,St(c,3))}var QF=ic(function(o,c,f){Gt.call(o,f)?o[f].push(c):Xn(o,f,[c])});function JF(o,c,f,y){o=dn(o)?o:Ss(o),f=f&&!y?Lt(f):0;var b=o.length;return f<0&&(f=ke(b+f,0)),yc(o)?f<=b&&o.indexOf(c,f)>-1:!!b&&ds(o,c,f)>-1}var tz=Bt(function(o,c,f){var y=-1,b=typeof c=="function",k=dn(o)?Y(o.length):[];return ji(o,function(A){k[++y]=b?mn(c,A,f):qo(A,c,f)}),k}),ez=ic(function(o,c,f){Xn(o,f,c)});function fc(o,c){var f=Et(o)?ue:b0;return f(o,St(c,3))}function nz(o,c,f,y){return o==null?[]:(Et(c)||(c=c==null?[]:[c]),f=y?e:f,Et(f)||(f=f==null?[]:[f]),S0(o,c,f))}var iz=ic(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function rz(o,c,f){var y=Et(o)?qd:j_,b=arguments.length<3;return y(o,St(c,4),f,b,ji)}function sz(o,c,f){var y=Et(o)?yL:j_,b=arguments.length<3;return y(o,St(c,4),f,b,f0)}function oz(o,c){var f=Et(o)?Vi:h0;return f(o,gc(St(c,3)))}function az(o){var c=Et(o)?l0:JN;return c(o)}function lz(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=Lt(c);var y=Et(o)?AN:tB;return y(o,c)}function cz(o){var c=Et(o)?RN:nB;return c(o)}function uz(o){if(o==null)return 0;if(dn(o))return yc(o)?hs(o):o.length;var c=Ge(o);return c==Ct||c==oe?o.size:ff(o).length}function dz(o,c,f){var y=Et(o)?jd:iB;return f&&Je(o,c,f)&&(c=e),y(o,St(c,3))}var fz=Bt(function(o,c){if(o==null)return[];var f=c.length;return f>1&&Je(o,c[0],c[1])?c=[]:f>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),S0(o,Fe(c,1),[])}),hc=qL||function(){return ce.Date.now()};function hz(o,c){if(typeof c!="function")throw new Cn(a);return o=Lt(o),function(){if(--o<1)return c.apply(this,arguments)}}function yb(o,c,f){return c=f?e:c,c=o&&c==null?o.length:c,gi(o,T,e,e,e,e,c)}function _b(o,c){var f;if(typeof c!="function")throw new Cn(a);return o=Lt(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=e),f}}var Nf=Bt(function(o,c,f){var y=C;if(f.length){var b=Yi(f,ws(Nf));y|=I}return gi(o,y,c,f,b)}),bb=Bt(function(o,c,f){var y=C|R;if(f.length){var b=Yi(f,ws(bb));y|=I}return gi(c,y,o,f,b)});function xb(o,c,f){c=f?e:c;var y=gi(o,P,e,e,e,e,e,c);return y.placeholder=xb.placeholder,y}function wb(o,c,f){c=f?e:c;var y=gi(o,L,e,e,e,e,e,c);return y.placeholder=wb.placeholder,y}function vb(o,c,f){var y,b,k,A,E,U,Z=0,Q=!1,rt=!1,ct=!0;if(typeof o!="function")throw new Cn(a);c=Pn(c)||0,fe(f)&&(Q=!!f.leading,rt="maxWait"in f,k=rt?ke(Pn(f.maxWait)||0,c):k,ct="trailing"in f?!!f.trailing:ct);function yt(be){var Hn=y,xi=b;return y=b=e,Z=be,A=o.apply(xi,Hn),A}function Tt(be){return Z=be,E=Zo(Ft,c),Q?yt(be):A}function Nt(be){var Hn=be-U,xi=be-Z,Wb=c-Hn;return rt?je(Wb,k-xi):Wb}function wt(be){var Hn=be-U,xi=be-Z;return U===e||Hn>=c||Hn<0||rt&&xi>=k}function Ft(){var be=hc();if(wt(be))return Ht(be);E=Zo(Ft,Nt(be))}function Ht(be){return E=e,ct&&y?yt(be):(y=b=e,A)}function wn(){E!==e&&E0(E),Z=0,y=U=b=E=e}function tn(){return E===e?A:Ht(hc())}function vn(){var be=hc(),Hn=wt(be);if(y=arguments,b=this,U=be,Hn){if(E===e)return Tt(U);if(rt)return E0(E),E=Zo(Ft,c),yt(U)}return E===e&&(E=Zo(Ft,c)),A}return vn.cancel=wn,vn.flush=tn,vn}var pz=Bt(function(o,c){return d0(o,1,c)}),gz=Bt(function(o,c,f){return d0(o,Pn(c)||0,f)});function mz(o){return gi(o,O)}function pc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Cn(a);var f=function(){var y=arguments,b=c?c.apply(this,y):y[0],k=f.cache;if(k.has(b))return k.get(b);var A=o.apply(this,y);return f.cache=k.set(b,A)||k,A};return f.cache=new(pc.Cache||pi),f}pc.Cache=pi;function gc(o){if(typeof o!="function")throw new Cn(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 yz(o){return _b(2,o)}var _z=rB(function(o,c){c=c.length==1&&Et(c[0])?ue(c[0],_n(St())):ue(Fe(c,1),_n(St()));var f=c.length;return Bt(function(y){for(var b=-1,k=je(y.length,f);++b<k;)y[b]=c[b].call(this,y[b]);return mn(o,this,y)})}),Bf=Bt(function(o,c){var f=Yi(c,ws(Bf));return gi(o,I,e,c,f)}),Sb=Bt(function(o,c){var f=Yi(c,ws(Sb));return gi(o,N,e,c,f)}),bz=mi(function(o,c){return gi(o,M,e,e,e,c)});function xz(o,c){if(typeof o!="function")throw new Cn(a);return c=c===e?c:Lt(c),Bt(o,c)}function wz(o,c){if(typeof o!="function")throw new Cn(a);return c=c==null?0:ke(Lt(c),0),Bt(function(f){var y=f[c],b=Xi(f,0,c);return y&&$i(b,y),mn(o,this,b)})}function vz(o,c,f){var y=!0,b=!0;if(typeof o!="function")throw new Cn(a);return fe(f)&&(y="leading"in f?!!f.leading:y,b="trailing"in f?!!f.trailing:b),vb(o,c,{leading:y,maxWait:c,trailing:b})}function Sz(o){return yb(o,1)}function Tz(o,c){return Bf(wf(c),o)}function Mz(){if(!arguments.length)return[];var o=arguments[0];return Et(o)?o:[o]}function kz(o){return An(o,x)}function Dz(o,c){return c=typeof c=="function"?c:e,An(o,x,c)}function Cz(o){return An(o,m|x)}function Oz(o,c){return c=typeof c=="function"?c:e,An(o,m|x,c)}function Az(o,c){return c==null||u0(o,c,Ee(c))}function Un(o,c){return o===c||o!==o&&c!==c}var Rz=ac(cf),Ez=ac(function(o,c){return o>=c}),Ar=m0((function(){return arguments})())?m0:function(o){return ge(o)&&Gt.call(o,"callee")&&!n0.call(o,"callee")},Et=Y.isArray,Pz=B_?_n(B_):HN;function dn(o){return o!=null&&mc(o.length)&&!_i(o)}function _e(o){return ge(o)&&dn(o)}function Iz(o){return o===!0||o===!1||ge(o)&&Qe(o)==lt}var Zi=GL||Kf,Lz=F_?_n(F_):WN;function Nz(o){return ge(o)&&o.nodeType===1&&!Qo(o)}function Bz(o){if(o==null)return!0;if(dn(o)&&(Et(o)||typeof o=="string"||typeof o.splice=="function"||Zi(o)||vs(o)||Ar(o)))return!o.length;var c=Ge(o);if(c==Ct||c==oe)return!o.size;if(Xo(o))return!ff(o).length;for(var f in o)if(Gt.call(o,f))return!1;return!0}function Fz(o,c){return jo(o,c)}function zz(o,c,f){f=typeof f=="function"?f:e;var y=f?f(o,c):e;return y===e?jo(o,c,e,f):!!y}function Ff(o){if(!ge(o))return!1;var c=Qe(o);return c==It||c==dt||typeof o.message=="string"&&typeof o.name=="string"&&!Qo(o)}function Uz(o){return typeof o=="number"&&r0(o)}function _i(o){if(!fe(o))return!1;var c=Qe(o);return c==zt||c==vt||c==ot||c==Oe}function Tb(o){return typeof o=="number"&&o==Lt(o)}function mc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=et}function fe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ge(o){return o!=null&&typeof o=="object"}var Mb=z_?_n(z_):$N;function Hz(o,c){return o===c||df(o,c,Cf(c))}function Wz(o,c,f){return f=typeof f=="function"?f:e,df(o,c,Cf(c),f)}function Vz(o){return kb(o)&&o!=+o}function $z(o){if(DB(o))throw new Ot(s);return y0(o)}function Yz(o){return o===null}function qz(o){return o==null}function kb(o){return typeof o=="number"||ge(o)&&Qe(o)==Dt}function Qo(o){if(!ge(o)||Qe(o)!=bt)return!1;var c=Vl(o);if(c===null)return!0;var f=Gt.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&zl.call(f)==WL}var zf=U_?_n(U_):YN;function jz(o){return Tb(o)&&o>=-et&&o<=et}var Db=H_?_n(H_):qN;function yc(o){return typeof o=="string"||!Et(o)&&ge(o)&&Qe(o)==ln}function xn(o){return typeof o=="symbol"||ge(o)&&Qe(o)==Vt}var vs=W_?_n(W_):jN;function Gz(o){return o===e}function Kz(o){return ge(o)&&Ge(o)==ie}function Xz(o){return ge(o)&&Qe(o)==Se}var Zz=ac(hf),Qz=ac(function(o,c){return o<=c});function Cb(o){if(!o)return[];if(dn(o))return yc(o)?Bn(o):un(o);if(zo&&o[zo])return AL(o[zo]());var c=Ge(o),f=c==Ct?Jd:c==oe?Nl:Ss;return f(o)}function bi(o){if(!o)return o===0?o:0;if(o=Pn(o),o===nt||o===-nt){var c=o<0?-1:1;return c*at}return o===o?o:0}function Lt(o){var c=bi(o),f=c%1;return c===c?f?c-f:c:0}function Ob(o){return o?kr(Lt(o),0,q):0}function Pn(o){if(typeof o=="number")return o;if(xn(o))return H;if(fe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=G_(o);var f=Td.test(o);return f||kd.test(o)?Nn(o.slice(2),f?2:8):Sd.test(o)?H:+o}function Ab(o){return Qn(o,fn(o))}function Jz(o){return o?kr(Lt(o),-et,et):o===0?o:0}function Kt(o){return o==null?"":bn(o)}var tU=bs(function(o,c){if(Xo(c)||dn(c)){Qn(c,Ee(c),o);return}for(var f in c)Gt.call(c,f)&&$o(o,f,c[f])}),Rb=bs(function(o,c){Qn(c,fn(c),o)}),Eb=bs(function(o,c,f,y){Qn(c,fn(c),o,y)}),Uf=bs(function(o,c,f,y){Qn(c,Ee(c),o,y)}),eU=mi(of);function nU(o,c){var f=_s(o);return c==null?f:c0(f,c)}var iU=Bt(function(o,c){o=ne(o);var f=-1,y=c.length,b=y>2?c[2]:e;for(b&&Je(c[0],c[1],b)&&(y=1);++f<y;)for(var k=c[f],A=fn(k),E=-1,U=A.length;++E<U;){var Z=A[E],Q=o[Z];(Q===e||Un(Q,gs[Z])&&!Gt.call(o,Z))&&(o[Z]=k[Z])}return o}),rU=Bt(function(o){return o.push(e,G0),mn(Pb,e,o)});function sU(o,c){return $_(o,St(c,3),Zn)}function oU(o,c){return $_(o,St(c,3),lf)}function aU(o,c){return o==null?o:af(o,St(c,3),fn)}function lU(o,c){return o==null?o:p0(o,St(c,3),fn)}function cU(o,c){return o&&Zn(o,St(c,3))}function uU(o,c){return o&&lf(o,St(c,3))}function dU(o){return o==null?[]:Jl(o,Ee(o))}function fU(o){return o==null?[]:Jl(o,fn(o))}function Hf(o,c,f){var y=o==null?e:Dr(o,c);return y===e?f:y}function hU(o,c){return o!=null&&Z0(o,c,BN)}function Wf(o,c){return o!=null&&Z0(o,c,FN)}var pU=V0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Ul.call(c)),o[c]=f},$f(hn)),gU=V0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Ul.call(c)),Gt.call(o,c)?o[c].push(f):o[c]=[f]},St),mU=Bt(qo);function Ee(o){return dn(o)?a0(o):ff(o)}function fn(o){return dn(o)?a0(o,!0):GN(o)}function yU(o,c){var f={};return c=St(c,3),Zn(o,function(y,b,k){Xn(f,c(y,b,k),y)}),f}function _U(o,c){var f={};return c=St(c,3),Zn(o,function(y,b,k){Xn(f,b,c(y,b,k))}),f}var bU=bs(function(o,c,f){tc(o,c,f)}),Pb=bs(function(o,c,f,y){tc(o,c,f,y)}),xU=mi(function(o,c){var f={};if(o==null)return f;var y=!1;c=ue(c,function(k){return k=Ki(k,o),y||(y=k.length>1),k}),Qn(o,kf(o),f),y&&(f=An(f,m|_|x,gB));for(var b=c.length;b--;)_f(f,c[b]);return f});function wU(o,c){return Ib(o,gc(St(c)))}var vU=mi(function(o,c){return o==null?{}:XN(o,c)});function Ib(o,c){if(o==null)return{};var f=ue(kf(o),function(y){return[y]});return c=St(c),T0(o,f,function(y,b){return c(y,b[0])})}function SU(o,c,f){c=Ki(c,o);var y=-1,b=c.length;for(b||(b=1,o=e);++y<b;){var k=o==null?e:o[zn(c[y])];k===e&&(y=b,k=f),o=_i(k)?k.call(o):k}return o}function TU(o,c,f){return o==null?o:Go(o,c,f)}function MU(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:Go(o,c,f,y)}var Lb=q0(Ee),Nb=q0(fn);function kU(o,c,f){var y=Et(o),b=y||Zi(o)||vs(o);if(c=St(c,4),f==null){var k=o&&o.constructor;b?f=y?new k:[]:fe(o)?f=_i(k)?_s(Vl(o)):{}:f={}}return(b?yn:Zn)(o,function(A,E,U){return c(f,A,E,U)}),f}function DU(o,c){return o==null?!0:_f(o,c)}function CU(o,c,f){return o==null?o:O0(o,c,wf(f))}function OU(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:O0(o,c,wf(f),y)}function Ss(o){return o==null?[]:Qd(o,Ee(o))}function AU(o){return o==null?[]:Qd(o,fn(o))}function RU(o,c,f){return f===e&&(f=c,c=e),f!==e&&(f=Pn(f),f=f===f?f:0),c!==e&&(c=Pn(c),c=c===c?c:0),kr(Pn(o),c,f)}function EU(o,c,f){return c=bi(c),f===e?(f=c,c=0):f=bi(f),o=Pn(o),zN(o,c,f)}function PU(o,c,f){if(f&&typeof f!="boolean"&&Je(o,c,f)&&(c=f=e),f===e&&(typeof c=="boolean"?(f=c,c=e):typeof o=="boolean"&&(f=o,o=e)),o===e&&c===e?(o=0,c=1):(o=bi(o),c===e?(c=o,o=0):c=bi(c)),o>c){var y=o;o=c,c=y}if(f||o%1||c%1){var b=s0();return je(o+b*(c-o+qe("1e-"+((b+"").length-1))),c)}return gf(o,c)}var IU=xs(function(o,c,f){return c=c.toLowerCase(),o+(f?Bb(c):c)});function Bb(o){return Vf(Kt(o).toLowerCase())}function Fb(o){return o=Kt(o),o&&o.replace(Dd,ML).replace(Hd,"")}function LU(o,c,f){o=Kt(o),c=bn(c);var y=o.length;f=f===e?y:kr(Lt(f),0,y);var b=f;return f-=c.length,f>=0&&o.slice(f,b)==c}function NU(o){return o=Kt(o),o&&hd.test(o)?o.replace(pl,kL):o}function BU(o){return o=Kt(o),o&&yd.test(o)?o.replace(Oo,"\\$&"):o}var FU=xs(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),zU=xs(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),UU=U0("toLowerCase");function HU(o,c,f){o=Kt(o),c=Lt(c);var y=c?hs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return oc(jl(b),f)+o+oc(ql(b),f)}function WU(o,c,f){o=Kt(o),c=Lt(c);var y=c?hs(o):0;return c&&y<c?o+oc(c-y,f):o}function VU(o,c,f){o=Kt(o),c=Lt(c);var y=c?hs(o):0;return c&&y<c?oc(c-y,f)+o:o}function $U(o,c,f){return f||c==null?c=0:c&&(c=+c),QL(Kt(o).replace(Ao,""),c||0)}function YU(o,c,f){return(f?Je(o,c,f):c===e)?c=1:c=Lt(c),mf(Kt(o),c)}function qU(){var o=arguments,c=Kt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var jU=xs(function(o,c,f){return o+(f?"_":"")+c.toLowerCase()});function GU(o,c,f){return f&&typeof f!="number"&&Je(o,c,f)&&(c=f=e),f=f===e?q:f>>>0,f?(o=Kt(o),o&&(typeof c=="string"||c!=null&&!zf(c))&&(c=bn(c),!c&&fs(o))?Xi(Bn(o),0,f):o.split(c,f)):[]}var KU=xs(function(o,c,f){return o+(f?" ":"")+Vf(c)});function XU(o,c,f){return o=Kt(o),f=f==null?0:kr(Lt(f),0,o.length),c=bn(c),o.slice(f,f+c.length)==c}function ZU(o,c,f){var y=w.templateSettings;f&&Je(o,c,f)&&(c=e),o=Kt(o),c=Uf({},c,y,j0);var b=Uf({},c.imports,y.imports,j0),k=Ee(b),A=Qd(b,k);yn(k,function(wt){if(ml.test(wt))throw new Ot(u)});var E,U,Z=0,Q=c.interpolate||ns,rt="__p += '",ct=tf((c.escape||ns).source+"|"+Q.source+"|"+(Q===Co?Hi:ns).source+"|"+(c.evaluate||ns).source+"|$","g"),yt="//# sourceURL="+(Gt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$d+"]")+`
10
- `;o.replace(ct,function(wt,Ft,Ht,wn,tn,vn){return Ht||(Ht=wn),rt+=o.slice(Z,vn).replace(Cd,DL),Ft&&(E=!0,rt+=`' +
9
+ `)}function TB(o){return Rt(o)||Ar(o)||!!(i0&&o&&o[i0])}function yi(o,c){var f=typeof o;return c=c??et,!!c&&(f=="number"||f!="symbol"&&Wi.test(o))&&o>-1&&o%1==0&&o<c}function Je(o,c,f){if(!fe(f))return!1;var y=typeof c;return(y=="number"?dn(f)&&yi(c,f.length):y=="string"&&c in f)?Un(f[c],o):!1}function Af(o,c){if(Rt(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||xn(o)?!0:di.test(o)||!gl.test(o)||c!=null&&o in ne(c)}function MB(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Ef(o){var c=lc(o),f=w[c];if(typeof f!="function"||!(c in Ut.prototype))return!1;if(o===f)return!0;var y=Df(f);return!!y&&o===y[0]}function kB(o){return!!J_&&J_ in o}var DB=Fl?_i:Kf;function Xo(o){var c=o&&o.constructor,f=typeof c=="function"&&c.prototype||gs;return o===f}function J0(o){return o===o&&!fe(o)}function tb(o,c){return function(f){return f==null?!1:f[o]===c&&(c!==e||o in ne(f))}}function CB(o){var c=pc(o,function(y){return f.size===h&&f.clear(),y}),f=c.cache;return c}function OB(o,c){var f=o[1],y=c[1],b=f|y,k=b<(C|E|T),A=y==T&&f==P||y==T&&f==M&&o[7].length<=c[8]||y==(T|M)&&c[7].length<=c[8]&&f==P;if(!(k||A))return o;y&C&&(o[2]=c[2],b|=f&C?0:B);var R=c[3];if(R){var U=o[3];o[3]=U?N0(U,R,c[4]):R,o[4]=U?Yi(o[3],g):c[4]}return R=c[5],R&&(U=o[5],o[5]=U?B0(U,R,c[6]):R,o[6]=U?Yi(o[5],g):c[6]),R=c[7],R&&(o[7]=R),y&T&&(o[8]=o[8]==null?c[8]:je(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function AB(o){var c=[];if(o!=null)for(var f in ne(o))c.push(f);return c}function EB(o){return Ul.call(o)}function eb(o,c,f){return c=ke(c===e?o.length-1:c,0),function(){for(var y=arguments,b=-1,k=ke(y.length-c,0),A=Y(k);++b<k;)A[b]=y[c+b];b=-1;for(var R=Y(c+1);++b<c;)R[b]=y[b];return R[c]=f(A),mn(o,this,R)}}function nb(o,c){return c.length<2?o:Dr(o,En(c,0,-1))}function RB(o,c){for(var f=o.length,y=je(c.length,f),b=un(o);y--;){var k=c[y];o[y]=yi(k,f)?b[k]:e}return o}function Rf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var ib=sb(k0),Zo=jL||function(o,c){return ce.setTimeout(o,c)},Pf=sb(eB);function rb(o,c,f){var y=c+"";return Pf(o,SB(y,PB(xB(y),f)))}function sb(o){var c=0,f=0;return function(){var y=ZL(),b=ut-(y-f);if(f=y,b>0){if(++c>=it)return arguments[0]}else c=0;return o.apply(e,arguments)}}function uc(o,c){var f=-1,y=o.length,b=y-1;for(c=c===e?y:c;++f<c;){var k=gf(f,b),A=o[k];o[k]=o[f],o[f]=A}return o.length=c,o}var ob=CB(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(md,function(f,y,b,k){c.push(b?k.replace(vd,"$1"):y||f)}),c});function zn(o){if(typeof o=="string"||xn(o))return o;var c=o+"";return c=="0"&&1/o==-nt?"-0":c}function Or(o){if(o!=null){try{return zl.call(o)}catch{}try{return o+""}catch{}}return""}function PB(o,c){return yn(G,function(f){var y="_."+f[0];c&f[1]&&!Il(o,y)&&o.push(y)}),o.sort()}function ab(o){if(o instanceof Ut)return o.clone();var c=new On(o.__wrapped__,o.__chain__);return c.__actions__=un(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function IB(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=ke(Lt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,k=0,A=Y(ql(y/c));b<y;)A[k++]=En(o,b,b+=c);return A}function LB(o){for(var c=-1,f=o==null?0:o.length,y=0,b=[];++c<f;){var k=o[c];k&&(b[y++]=k)}return b}function NB(){var o=arguments.length;if(!o)return[];for(var c=Y(o-1),f=arguments[0],y=o;y--;)c[y-1]=arguments[y];return $i(Rt(f)?un(f):[f],Fe(c,1))}var BB=Bt(function(o,c){return _e(o)?Yo(o,Fe(c,1,_e,!0)):[]}),FB=Bt(function(o,c){var f=Rn(c);return _e(f)&&(f=e),_e(o)?Yo(o,Fe(c,1,_e,!0),St(f,2)):[]}),zB=Bt(function(o,c){var f=Rn(c);return _e(f)&&(f=e),_e(o)?Yo(o,Fe(c,1,_e,!0),e,f):[]});function UB(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Lt(c),En(o,c<0?0:c,y)):[]}function HB(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Lt(c),c=y-c,En(o,0,c<0?0:c)):[]}function WB(o,c){return o&&o.length?nc(o,St(c,3),!0,!0):[]}function VB(o,c){return o&&o.length?nc(o,St(c,3),!0):[]}function $B(o,c,f,y){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&Je(o,c,f)&&(f=0,y=b),NN(o,c,f,y)):[]}function lb(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=f==null?0:Lt(f);return b<0&&(b=ke(y+b,0)),Ll(o,St(c,3),b)}function cb(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return f!==e&&(b=Lt(f),b=f<0?ke(y+b,0):je(b,y-1)),Ll(o,St(c,3),b,!0)}function ub(o){var c=o==null?0:o.length;return c?Fe(o,1):[]}function YB(o){var c=o==null?0:o.length;return c?Fe(o,nt):[]}function qB(o,c){var f=o==null?0:o.length;return f?(c=c===e?1:Lt(c),Fe(o,c)):[]}function jB(o){for(var c=-1,f=o==null?0:o.length,y={};++c<f;){var b=o[c];Xn(y,b[0],b[1])}return y}function db(o){return o&&o.length?o[0]:e}function GB(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=f==null?0:Lt(f);return b<0&&(b=ke(y+b,0)),ds(o,c,b)}function KB(o){var c=o==null?0:o.length;return c?En(o,0,-1):[]}var XB=Bt(function(o){var c=ue(o,xf);return c.length&&c[0]===o[0]?uf(c):[]}),ZB=Bt(function(o){var c=Rn(o),f=ue(o,xf);return c===Rn(f)?c=e:f.pop(),f.length&&f[0]===o[0]?uf(f,St(c,2)):[]}),QB=Bt(function(o){var c=Rn(o),f=ue(o,xf);return c=typeof c=="function"?c:e,c&&f.pop(),f.length&&f[0]===o[0]?uf(f,e,c):[]});function JB(o,c){return o==null?"":KL.call(o,c)}function Rn(o){var c=o==null?0:o.length;return c?o[c-1]:e}function tF(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=y;return f!==e&&(b=Lt(f),b=b<0?ke(y+b,0):je(b,y-1)),c===c?PL(o,c,b):Ll(o,Y_,b,!0)}function eF(o,c){return o&&o.length?v0(o,Lt(c)):e}var nF=Bt(fb);function fb(o,c){return o&&o.length&&c&&c.length?pf(o,c):o}function iF(o,c,f){return o&&o.length&&c&&c.length?pf(o,c,St(f,2)):o}function rF(o,c,f){return o&&o.length&&c&&c.length?pf(o,c,e,f):o}var sF=mi(function(o,c){var f=o==null?0:o.length,y=of(o,c);return M0(o,ue(c,function(b){return yi(b,f)?+b:b}).sort(L0)),y});function oF(o,c){var f=[];if(!(o&&o.length))return f;var y=-1,b=[],k=o.length;for(c=St(c,3);++y<k;){var A=o[y];c(A,y,o)&&(f.push(A),b.push(y))}return M0(o,b),f}function If(o){return o==null?o:JL.call(o)}function aF(o,c,f){var y=o==null?0:o.length;return y?(f&&typeof f!="number"&&Je(o,c,f)?(c=0,f=y):(c=c==null?0:Lt(c),f=f===e?y:Lt(f)),En(o,c,f)):[]}function lF(o,c){return ec(o,c)}function cF(o,c,f){return yf(o,c,St(f,2))}function uF(o,c){var f=o==null?0:o.length;if(f){var y=ec(o,c);if(y<f&&Un(o[y],c))return y}return-1}function dF(o,c){return ec(o,c,!0)}function fF(o,c,f){return yf(o,c,St(f,2),!0)}function hF(o,c){var f=o==null?0:o.length;if(f){var y=ec(o,c,!0)-1;if(Un(o[y],c))return y}return-1}function pF(o){return o&&o.length?D0(o):[]}function gF(o,c){return o&&o.length?D0(o,St(c,2)):[]}function mF(o){var c=o==null?0:o.length;return c?En(o,1,c):[]}function yF(o,c,f){return o&&o.length?(c=f||c===e?1:Lt(c),En(o,0,c<0?0:c)):[]}function _F(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Lt(c),c=y-c,En(o,c<0?0:c,y)):[]}function bF(o,c){return o&&o.length?nc(o,St(c,3),!1,!0):[]}function xF(o,c){return o&&o.length?nc(o,St(c,3)):[]}var wF=Bt(function(o){return Gi(Fe(o,1,_e,!0))}),vF=Bt(function(o){var c=Rn(o);return _e(c)&&(c=e),Gi(Fe(o,1,_e,!0),St(c,2))}),SF=Bt(function(o){var c=Rn(o);return c=typeof c=="function"?c:e,Gi(Fe(o,1,_e,!0),e,c)});function TF(o){return o&&o.length?Gi(o):[]}function MF(o,c){return o&&o.length?Gi(o,St(c,2)):[]}function kF(o,c){return c=typeof c=="function"?c:e,o&&o.length?Gi(o,e,c):[]}function Lf(o){if(!(o&&o.length))return[];var c=0;return o=Vi(o,function(f){if(_e(f))return c=ke(f.length,c),!0}),Zd(c,function(f){return ue(o,Gd(f))})}function hb(o,c){if(!(o&&o.length))return[];var f=Lf(o);return c==null?f:ue(f,function(y){return mn(c,e,y)})}var DF=Bt(function(o,c){return _e(o)?Yo(o,c):[]}),CF=Bt(function(o){return bf(Vi(o,_e))}),OF=Bt(function(o){var c=Rn(o);return _e(c)&&(c=e),bf(Vi(o,_e),St(c,2))}),AF=Bt(function(o){var c=Rn(o);return c=typeof c=="function"?c:e,bf(Vi(o,_e),e,c)}),EF=Bt(Lf);function RF(o,c){return E0(o||[],c||[],$o)}function PF(o,c){return E0(o||[],c||[],Go)}var IF=Bt(function(o){var c=o.length,f=c>1?o[c-1]:e;return f=typeof f=="function"?(o.pop(),f):e,hb(o,f)});function pb(o){var c=w(o);return c.__chain__=!0,c}function LF(o,c){return c(o),o}function dc(o,c){return c(o)}var NF=mi(function(o){var c=o.length,f=c?o[0]:0,y=this.__wrapped__,b=function(k){return of(k,o)};return c>1||this.__actions__.length||!(y instanceof Ut)||!yi(f)?this.thru(b):(y=y.slice(f,+f+(c?1:0)),y.__actions__.push({func:dc,args:[b],thisArg:e}),new On(y,this.__chain__).thru(function(k){return c&&!k.length&&k.push(e),k}))});function BF(){return pb(this)}function FF(){return new On(this.value(),this.__chain__)}function zF(){this.__values__===e&&(this.__values__=Cb(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function UF(){return this}function HF(o){for(var c,f=this;f instanceof Xl;){var y=ab(f);y.__index__=0,y.__values__=e,c?b.__wrapped__=y:c=y;var b=y;f=f.__wrapped__}return b.__wrapped__=o,c}function WF(){var o=this.__wrapped__;if(o instanceof Ut){var c=o;return this.__actions__.length&&(c=new Ut(this)),c=c.reverse(),c.__actions__.push({func:dc,args:[If],thisArg:e}),new On(c,this.__chain__)}return this.thru(If)}function VF(){return A0(this.__wrapped__,this.__actions__)}var $F=ic(function(o,c,f){Gt.call(o,f)?++o[f]:Xn(o,f,1)});function YF(o,c,f){var y=Rt(o)?V_:LN;return f&&Je(o,c,f)&&(c=e),y(o,St(c,3))}function qF(o,c){var f=Rt(o)?Vi:h0;return f(o,St(c,3))}var jF=H0(lb),GF=H0(cb);function KF(o,c){return Fe(fc(o,c),1)}function XF(o,c){return Fe(fc(o,c),nt)}function ZF(o,c,f){return f=f===e?1:Lt(f),Fe(fc(o,c),f)}function gb(o,c){var f=Rt(o)?yn:ji;return f(o,St(c,3))}function mb(o,c){var f=Rt(o)?mL:f0;return f(o,St(c,3))}var QF=ic(function(o,c,f){Gt.call(o,f)?o[f].push(c):Xn(o,f,[c])});function JF(o,c,f,y){o=dn(o)?o:Ss(o),f=f&&!y?Lt(f):0;var b=o.length;return f<0&&(f=ke(b+f,0)),yc(o)?f<=b&&o.indexOf(c,f)>-1:!!b&&ds(o,c,f)>-1}var tz=Bt(function(o,c,f){var y=-1,b=typeof c=="function",k=dn(o)?Y(o.length):[];return ji(o,function(A){k[++y]=b?mn(c,A,f):qo(A,c,f)}),k}),ez=ic(function(o,c,f){Xn(o,f,c)});function fc(o,c){var f=Rt(o)?ue:b0;return f(o,St(c,3))}function nz(o,c,f,y){return o==null?[]:(Rt(c)||(c=c==null?[]:[c]),f=y?e:f,Rt(f)||(f=f==null?[]:[f]),S0(o,c,f))}var iz=ic(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function rz(o,c,f){var y=Rt(o)?qd:j_,b=arguments.length<3;return y(o,St(c,4),f,b,ji)}function sz(o,c,f){var y=Rt(o)?yL:j_,b=arguments.length<3;return y(o,St(c,4),f,b,f0)}function oz(o,c){var f=Rt(o)?Vi:h0;return f(o,gc(St(c,3)))}function az(o){var c=Rt(o)?l0:JN;return c(o)}function lz(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=Lt(c);var y=Rt(o)?AN:tB;return y(o,c)}function cz(o){var c=Rt(o)?EN:nB;return c(o)}function uz(o){if(o==null)return 0;if(dn(o))return yc(o)?hs(o):o.length;var c=Ge(o);return c==Ct||c==oe?o.size:ff(o).length}function dz(o,c,f){var y=Rt(o)?jd:iB;return f&&Je(o,c,f)&&(c=e),y(o,St(c,3))}var fz=Bt(function(o,c){if(o==null)return[];var f=c.length;return f>1&&Je(o,c[0],c[1])?c=[]:f>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),S0(o,Fe(c,1),[])}),hc=qL||function(){return ce.Date.now()};function hz(o,c){if(typeof c!="function")throw new Cn(a);return o=Lt(o),function(){if(--o<1)return c.apply(this,arguments)}}function yb(o,c,f){return c=f?e:c,c=o&&c==null?o.length:c,gi(o,T,e,e,e,e,c)}function _b(o,c){var f;if(typeof c!="function")throw new Cn(a);return o=Lt(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=e),f}}var Nf=Bt(function(o,c,f){var y=C;if(f.length){var b=Yi(f,ws(Nf));y|=I}return gi(o,y,c,f,b)}),bb=Bt(function(o,c,f){var y=C|E;if(f.length){var b=Yi(f,ws(bb));y|=I}return gi(c,y,o,f,b)});function xb(o,c,f){c=f?e:c;var y=gi(o,P,e,e,e,e,e,c);return y.placeholder=xb.placeholder,y}function wb(o,c,f){c=f?e:c;var y=gi(o,L,e,e,e,e,e,c);return y.placeholder=wb.placeholder,y}function vb(o,c,f){var y,b,k,A,R,U,Z=0,Q=!1,rt=!1,ct=!0;if(typeof o!="function")throw new Cn(a);c=Pn(c)||0,fe(f)&&(Q=!!f.leading,rt="maxWait"in f,k=rt?ke(Pn(f.maxWait)||0,c):k,ct="trailing"in f?!!f.trailing:ct);function yt(be){var Hn=y,xi=b;return y=b=e,Z=be,A=o.apply(xi,Hn),A}function Tt(be){return Z=be,R=Zo(Ft,c),Q?yt(be):A}function Nt(be){var Hn=be-U,xi=be-Z,Wb=c-Hn;return rt?je(Wb,k-xi):Wb}function wt(be){var Hn=be-U,xi=be-Z;return U===e||Hn>=c||Hn<0||rt&&xi>=k}function Ft(){var be=hc();if(wt(be))return Ht(be);R=Zo(Ft,Nt(be))}function Ht(be){return R=e,ct&&y?yt(be):(y=b=e,A)}function wn(){R!==e&&R0(R),Z=0,y=U=b=R=e}function tn(){return R===e?A:Ht(hc())}function vn(){var be=hc(),Hn=wt(be);if(y=arguments,b=this,U=be,Hn){if(R===e)return Tt(U);if(rt)return R0(R),R=Zo(Ft,c),yt(U)}return R===e&&(R=Zo(Ft,c)),A}return vn.cancel=wn,vn.flush=tn,vn}var pz=Bt(function(o,c){return d0(o,1,c)}),gz=Bt(function(o,c,f){return d0(o,Pn(c)||0,f)});function mz(o){return gi(o,O)}function pc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Cn(a);var f=function(){var y=arguments,b=c?c.apply(this,y):y[0],k=f.cache;if(k.has(b))return k.get(b);var A=o.apply(this,y);return f.cache=k.set(b,A)||k,A};return f.cache=new(pc.Cache||pi),f}pc.Cache=pi;function gc(o){if(typeof o!="function")throw new Cn(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 yz(o){return _b(2,o)}var _z=rB(function(o,c){c=c.length==1&&Rt(c[0])?ue(c[0],_n(St())):ue(Fe(c,1),_n(St()));var f=c.length;return Bt(function(y){for(var b=-1,k=je(y.length,f);++b<k;)y[b]=c[b].call(this,y[b]);return mn(o,this,y)})}),Bf=Bt(function(o,c){var f=Yi(c,ws(Bf));return gi(o,I,e,c,f)}),Sb=Bt(function(o,c){var f=Yi(c,ws(Sb));return gi(o,N,e,c,f)}),bz=mi(function(o,c){return gi(o,M,e,e,e,c)});function xz(o,c){if(typeof o!="function")throw new Cn(a);return c=c===e?c:Lt(c),Bt(o,c)}function wz(o,c){if(typeof o!="function")throw new Cn(a);return c=c==null?0:ke(Lt(c),0),Bt(function(f){var y=f[c],b=Xi(f,0,c);return y&&$i(b,y),mn(o,this,b)})}function vz(o,c,f){var y=!0,b=!0;if(typeof o!="function")throw new Cn(a);return fe(f)&&(y="leading"in f?!!f.leading:y,b="trailing"in f?!!f.trailing:b),vb(o,c,{leading:y,maxWait:c,trailing:b})}function Sz(o){return yb(o,1)}function Tz(o,c){return Bf(wf(c),o)}function Mz(){if(!arguments.length)return[];var o=arguments[0];return Rt(o)?o:[o]}function kz(o){return An(o,x)}function Dz(o,c){return c=typeof c=="function"?c:e,An(o,x,c)}function Cz(o){return An(o,m|x)}function Oz(o,c){return c=typeof c=="function"?c:e,An(o,m|x,c)}function Az(o,c){return c==null||u0(o,c,Re(c))}function Un(o,c){return o===c||o!==o&&c!==c}var Ez=ac(cf),Rz=ac(function(o,c){return o>=c}),Ar=m0((function(){return arguments})())?m0:function(o){return ge(o)&&Gt.call(o,"callee")&&!n0.call(o,"callee")},Rt=Y.isArray,Pz=B_?_n(B_):HN;function dn(o){return o!=null&&mc(o.length)&&!_i(o)}function _e(o){return ge(o)&&dn(o)}function Iz(o){return o===!0||o===!1||ge(o)&&Qe(o)==lt}var Zi=GL||Kf,Lz=F_?_n(F_):WN;function Nz(o){return ge(o)&&o.nodeType===1&&!Qo(o)}function Bz(o){if(o==null)return!0;if(dn(o)&&(Rt(o)||typeof o=="string"||typeof o.splice=="function"||Zi(o)||vs(o)||Ar(o)))return!o.length;var c=Ge(o);if(c==Ct||c==oe)return!o.size;if(Xo(o))return!ff(o).length;for(var f in o)if(Gt.call(o,f))return!1;return!0}function Fz(o,c){return jo(o,c)}function zz(o,c,f){f=typeof f=="function"?f:e;var y=f?f(o,c):e;return y===e?jo(o,c,e,f):!!y}function Ff(o){if(!ge(o))return!1;var c=Qe(o);return c==It||c==dt||typeof o.message=="string"&&typeof o.name=="string"&&!Qo(o)}function Uz(o){return typeof o=="number"&&r0(o)}function _i(o){if(!fe(o))return!1;var c=Qe(o);return c==zt||c==vt||c==ot||c==Oe}function Tb(o){return typeof o=="number"&&o==Lt(o)}function mc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=et}function fe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ge(o){return o!=null&&typeof o=="object"}var Mb=z_?_n(z_):$N;function Hz(o,c){return o===c||df(o,c,Cf(c))}function Wz(o,c,f){return f=typeof f=="function"?f:e,df(o,c,Cf(c),f)}function Vz(o){return kb(o)&&o!=+o}function $z(o){if(DB(o))throw new Ot(s);return y0(o)}function Yz(o){return o===null}function qz(o){return o==null}function kb(o){return typeof o=="number"||ge(o)&&Qe(o)==Dt}function Qo(o){if(!ge(o)||Qe(o)!=bt)return!1;var c=Vl(o);if(c===null)return!0;var f=Gt.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&zl.call(f)==WL}var zf=U_?_n(U_):YN;function jz(o){return Tb(o)&&o>=-et&&o<=et}var Db=H_?_n(H_):qN;function yc(o){return typeof o=="string"||!Rt(o)&&ge(o)&&Qe(o)==ln}function xn(o){return typeof o=="symbol"||ge(o)&&Qe(o)==Vt}var vs=W_?_n(W_):jN;function Gz(o){return o===e}function Kz(o){return ge(o)&&Ge(o)==ie}function Xz(o){return ge(o)&&Qe(o)==Se}var Zz=ac(hf),Qz=ac(function(o,c){return o<=c});function Cb(o){if(!o)return[];if(dn(o))return yc(o)?Bn(o):un(o);if(zo&&o[zo])return AL(o[zo]());var c=Ge(o),f=c==Ct?Jd:c==oe?Nl:Ss;return f(o)}function bi(o){if(!o)return o===0?o:0;if(o=Pn(o),o===nt||o===-nt){var c=o<0?-1:1;return c*at}return o===o?o:0}function Lt(o){var c=bi(o),f=c%1;return c===c?f?c-f:c:0}function Ob(o){return o?kr(Lt(o),0,q):0}function Pn(o){if(typeof o=="number")return o;if(xn(o))return H;if(fe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=G_(o);var f=Td.test(o);return f||kd.test(o)?Nn(o.slice(2),f?2:8):Sd.test(o)?H:+o}function Ab(o){return Qn(o,fn(o))}function Jz(o){return o?kr(Lt(o),-et,et):o===0?o:0}function Kt(o){return o==null?"":bn(o)}var tU=bs(function(o,c){if(Xo(c)||dn(c)){Qn(c,Re(c),o);return}for(var f in c)Gt.call(c,f)&&$o(o,f,c[f])}),Eb=bs(function(o,c){Qn(c,fn(c),o)}),Rb=bs(function(o,c,f,y){Qn(c,fn(c),o,y)}),Uf=bs(function(o,c,f,y){Qn(c,Re(c),o,y)}),eU=mi(of);function nU(o,c){var f=_s(o);return c==null?f:c0(f,c)}var iU=Bt(function(o,c){o=ne(o);var f=-1,y=c.length,b=y>2?c[2]:e;for(b&&Je(c[0],c[1],b)&&(y=1);++f<y;)for(var k=c[f],A=fn(k),R=-1,U=A.length;++R<U;){var Z=A[R],Q=o[Z];(Q===e||Un(Q,gs[Z])&&!Gt.call(o,Z))&&(o[Z]=k[Z])}return o}),rU=Bt(function(o){return o.push(e,G0),mn(Pb,e,o)});function sU(o,c){return $_(o,St(c,3),Zn)}function oU(o,c){return $_(o,St(c,3),lf)}function aU(o,c){return o==null?o:af(o,St(c,3),fn)}function lU(o,c){return o==null?o:p0(o,St(c,3),fn)}function cU(o,c){return o&&Zn(o,St(c,3))}function uU(o,c){return o&&lf(o,St(c,3))}function dU(o){return o==null?[]:Jl(o,Re(o))}function fU(o){return o==null?[]:Jl(o,fn(o))}function Hf(o,c,f){var y=o==null?e:Dr(o,c);return y===e?f:y}function hU(o,c){return o!=null&&Z0(o,c,BN)}function Wf(o,c){return o!=null&&Z0(o,c,FN)}var pU=V0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Ul.call(c)),o[c]=f},$f(hn)),gU=V0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Ul.call(c)),Gt.call(o,c)?o[c].push(f):o[c]=[f]},St),mU=Bt(qo);function Re(o){return dn(o)?a0(o):ff(o)}function fn(o){return dn(o)?a0(o,!0):GN(o)}function yU(o,c){var f={};return c=St(c,3),Zn(o,function(y,b,k){Xn(f,c(y,b,k),y)}),f}function _U(o,c){var f={};return c=St(c,3),Zn(o,function(y,b,k){Xn(f,b,c(y,b,k))}),f}var bU=bs(function(o,c,f){tc(o,c,f)}),Pb=bs(function(o,c,f,y){tc(o,c,f,y)}),xU=mi(function(o,c){var f={};if(o==null)return f;var y=!1;c=ue(c,function(k){return k=Ki(k,o),y||(y=k.length>1),k}),Qn(o,kf(o),f),y&&(f=An(f,m|_|x,gB));for(var b=c.length;b--;)_f(f,c[b]);return f});function wU(o,c){return Ib(o,gc(St(c)))}var vU=mi(function(o,c){return o==null?{}:XN(o,c)});function Ib(o,c){if(o==null)return{};var f=ue(kf(o),function(y){return[y]});return c=St(c),T0(o,f,function(y,b){return c(y,b[0])})}function SU(o,c,f){c=Ki(c,o);var y=-1,b=c.length;for(b||(b=1,o=e);++y<b;){var k=o==null?e:o[zn(c[y])];k===e&&(y=b,k=f),o=_i(k)?k.call(o):k}return o}function TU(o,c,f){return o==null?o:Go(o,c,f)}function MU(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:Go(o,c,f,y)}var Lb=q0(Re),Nb=q0(fn);function kU(o,c,f){var y=Rt(o),b=y||Zi(o)||vs(o);if(c=St(c,4),f==null){var k=o&&o.constructor;b?f=y?new k:[]:fe(o)?f=_i(k)?_s(Vl(o)):{}:f={}}return(b?yn:Zn)(o,function(A,R,U){return c(f,A,R,U)}),f}function DU(o,c){return o==null?!0:_f(o,c)}function CU(o,c,f){return o==null?o:O0(o,c,wf(f))}function OU(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:O0(o,c,wf(f),y)}function Ss(o){return o==null?[]:Qd(o,Re(o))}function AU(o){return o==null?[]:Qd(o,fn(o))}function EU(o,c,f){return f===e&&(f=c,c=e),f!==e&&(f=Pn(f),f=f===f?f:0),c!==e&&(c=Pn(c),c=c===c?c:0),kr(Pn(o),c,f)}function RU(o,c,f){return c=bi(c),f===e?(f=c,c=0):f=bi(f),o=Pn(o),zN(o,c,f)}function PU(o,c,f){if(f&&typeof f!="boolean"&&Je(o,c,f)&&(c=f=e),f===e&&(typeof c=="boolean"?(f=c,c=e):typeof o=="boolean"&&(f=o,o=e)),o===e&&c===e?(o=0,c=1):(o=bi(o),c===e?(c=o,o=0):c=bi(c)),o>c){var y=o;o=c,c=y}if(f||o%1||c%1){var b=s0();return je(o+b*(c-o+qe("1e-"+((b+"").length-1))),c)}return gf(o,c)}var IU=xs(function(o,c,f){return c=c.toLowerCase(),o+(f?Bb(c):c)});function Bb(o){return Vf(Kt(o).toLowerCase())}function Fb(o){return o=Kt(o),o&&o.replace(Dd,ML).replace(Hd,"")}function LU(o,c,f){o=Kt(o),c=bn(c);var y=o.length;f=f===e?y:kr(Lt(f),0,y);var b=f;return f-=c.length,f>=0&&o.slice(f,b)==c}function NU(o){return o=Kt(o),o&&hd.test(o)?o.replace(pl,kL):o}function BU(o){return o=Kt(o),o&&yd.test(o)?o.replace(Oo,"\\$&"):o}var FU=xs(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),zU=xs(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),UU=U0("toLowerCase");function HU(o,c,f){o=Kt(o),c=Lt(c);var y=c?hs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return oc(jl(b),f)+o+oc(ql(b),f)}function WU(o,c,f){o=Kt(o),c=Lt(c);var y=c?hs(o):0;return c&&y<c?o+oc(c-y,f):o}function VU(o,c,f){o=Kt(o),c=Lt(c);var y=c?hs(o):0;return c&&y<c?oc(c-y,f)+o:o}function $U(o,c,f){return f||c==null?c=0:c&&(c=+c),QL(Kt(o).replace(Ao,""),c||0)}function YU(o,c,f){return(f?Je(o,c,f):c===e)?c=1:c=Lt(c),mf(Kt(o),c)}function qU(){var o=arguments,c=Kt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var jU=xs(function(o,c,f){return o+(f?"_":"")+c.toLowerCase()});function GU(o,c,f){return f&&typeof f!="number"&&Je(o,c,f)&&(c=f=e),f=f===e?q:f>>>0,f?(o=Kt(o),o&&(typeof c=="string"||c!=null&&!zf(c))&&(c=bn(c),!c&&fs(o))?Xi(Bn(o),0,f):o.split(c,f)):[]}var KU=xs(function(o,c,f){return o+(f?" ":"")+Vf(c)});function XU(o,c,f){return o=Kt(o),f=f==null?0:kr(Lt(f),0,o.length),c=bn(c),o.slice(f,f+c.length)==c}function ZU(o,c,f){var y=w.templateSettings;f&&Je(o,c,f)&&(c=e),o=Kt(o),c=Uf({},c,y,j0);var b=Uf({},c.imports,y.imports,j0),k=Re(b),A=Qd(b,k);yn(k,function(wt){if(ml.test(wt))throw new Ot(u)});var R,U,Z=0,Q=c.interpolate||ns,rt="__p += '",ct=tf((c.escape||ns).source+"|"+Q.source+"|"+(Q===Co?Hi:ns).source+"|"+(c.evaluate||ns).source+"|$","g"),yt="//# sourceURL="+(Gt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$d+"]")+`
10
+ `;o.replace(ct,function(wt,Ft,Ht,wn,tn,vn){return Ht||(Ht=wn),rt+=o.slice(Z,vn).replace(Cd,DL),Ft&&(R=!0,rt+=`' +
11
11
  __e(`+Ft+`) +
12
12
  '`),tn&&(U=!0,rt+=`';
13
13
  `+tn+`;
@@ -19,18 +19,18 @@ __p += '`),Ht&&(rt+=`' +
19
19
  }
20
20
  `;else if(ml.test(Tt))throw new Ot(l);rt=(U?rt.replace(Mo,""):rt).replace(ko,"$1").replace(Do,"$1;"),rt="function("+(Tt||"obj")+`) {
21
21
  `+(Tt?"":`obj || (obj = {});
22
- `)+"var __t, __p = ''"+(E?", __e = _.escape":"")+(U?`, __j = Array.prototype.join;
22
+ `)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(U?`, __j = Array.prototype.join;
23
23
  function print() { __p += __j.call(arguments, '') }
24
24
  `:`;
25
25
  `)+rt+`return __p
26
- }`;var Nt=Ub(function(){return $t(k,yt+"return "+rt).apply(e,A)});if(Nt.source=rt,Ff(Nt))throw Nt;return Nt}function QU(o){return Kt(o).toLowerCase()}function JU(o){return Kt(o).toUpperCase()}function tH(o,c,f){if(o=Kt(o),o&&(f||c===e))return G_(o);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=Bn(c),k=K_(y,b),A=X_(y,b)+1;return Xi(y,k,A).join("")}function eH(o,c,f){if(o=Kt(o),o&&(f||c===e))return o.slice(0,Q_(o)+1);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=X_(y,Bn(c))+1;return Xi(y,0,b).join("")}function nH(o,c,f){if(o=Kt(o),o&&(f||c===e))return o.replace(Ao,"");if(!o||!(c=bn(c)))return o;var y=Bn(o),b=K_(y,Bn(c));return Xi(y,b).join("")}function iH(o,c){var f=z,y=W;if(fe(c)){var b="separator"in c?c.separator:b;f="length"in c?Lt(c.length):f,y="omission"in c?bn(c.omission):y}o=Kt(o);var k=o.length;if(fs(o)){var A=Bn(o);k=A.length}if(f>=k)return o;var E=f-hs(y);if(E<1)return y;var U=A?Xi(A,0,E).join(""):o.slice(0,E);if(b===e)return U+y;if(A&&(E+=U.length-E),zf(b)){if(o.slice(E).search(b)){var Z,Q=U;for(b.global||(b=tf(b.source,Kt(yl.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var rt=Z.index;U=U.slice(0,rt===e?E:rt)}}else if(o.indexOf(bn(b),E)!=E){var ct=U.lastIndexOf(b);ct>-1&&(U=U.slice(0,ct))}return U+y}function rH(o){return o=Kt(o),o&&fd.test(o)?o.replace(Ui,IL):o}var sH=xs(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),Vf=U0("toUpperCase");function zb(o,c,f){return o=Kt(o),c=f?e:c,c===e?OL(o)?BL(o):xL(o):o.match(c)||[]}var Ub=Bt(function(o,c){try{return mn(o,e,c)}catch(f){return Ff(f)?f:new Ot(f)}}),oH=mi(function(o,c){return yn(c,function(f){f=zn(f),Xn(o,f,Nf(o[f],o))}),o});function aH(o){var c=o==null?0:o.length,f=St();return o=c?ue(o,function(y){if(typeof y[1]!="function")throw new Cn(a);return[f(y[0]),y[1]]}):[],Bt(function(y){for(var b=-1;++b<c;){var k=o[b];if(mn(k[0],this,y))return mn(k[1],this,y)}})}function lH(o){return IN(An(o,m))}function $f(o){return function(){return o}}function cH(o,c){return o==null||o!==o?c:o}var uH=W0(),dH=W0(!0);function hn(o){return o}function Yf(o){return _0(typeof o=="function"?o:An(o,m))}function fH(o){return x0(An(o,m))}function hH(o,c){return w0(o,An(c,m))}var pH=Bt(function(o,c){return function(f){return qo(f,o,c)}}),gH=Bt(function(o,c){return function(f){return qo(o,f,c)}});function qf(o,c,f){var y=Ee(c),b=Jl(c,y);f==null&&!(fe(c)&&(b.length||!y.length))&&(f=c,c=o,o=this,b=Jl(c,Ee(c)));var k=!(fe(f)&&"chain"in f)||!!f.chain,A=_i(o);return yn(b,function(E){var U=c[E];o[E]=U,A&&(o.prototype[E]=function(){var Z=this.__chain__;if(k||Z){var Q=o(this.__wrapped__),rt=Q.__actions__=un(this.__actions__);return rt.push({func:U,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return U.apply(o,$i([this.value()],arguments))})}),o}function mH(){return ce._===this&&(ce._=VL),this}function jf(){}function yH(o){return o=Lt(o),Bt(function(c){return v0(c,o)})}var _H=Sf(ue),bH=Sf(V_),xH=Sf(jd);function Hb(o){return Af(o)?Gd(zn(o)):ZN(o)}function wH(o){return function(c){return o==null?e:Dr(o,c)}}var vH=$0(),SH=$0(!0);function Gf(){return[]}function Kf(){return!1}function TH(){return{}}function MH(){return""}function kH(){return!0}function DH(o,c){if(o=Lt(o),o<1||o>et)return[];var f=q,y=je(o,q);c=St(c),o-=q;for(var b=Zd(y,c);++f<o;)c(f);return b}function CH(o){return Et(o)?ue(o,zn):xn(o)?[o]:un(ob(Kt(o)))}function OH(o){var c=++HL;return Kt(o)+c}var AH=sc(function(o,c){return o+c},0),RH=Tf("ceil"),EH=sc(function(o,c){return o/c},1),PH=Tf("floor");function IH(o){return o&&o.length?Ql(o,hn,cf):e}function LH(o,c){return o&&o.length?Ql(o,St(c,2),cf):e}function NH(o){return q_(o,hn)}function BH(o,c){return q_(o,St(c,2))}function FH(o){return o&&o.length?Ql(o,hn,hf):e}function zH(o,c){return o&&o.length?Ql(o,St(c,2),hf):e}var UH=sc(function(o,c){return o*c},1),HH=Tf("round"),WH=sc(function(o,c){return o-c},0);function VH(o){return o&&o.length?Xd(o,hn):0}function $H(o,c){return o&&o.length?Xd(o,St(c,2)):0}return w.after=hz,w.ary=yb,w.assign=tU,w.assignIn=Rb,w.assignInWith=Eb,w.assignWith=Uf,w.at=eU,w.before=_b,w.bind=Nf,w.bindAll=oH,w.bindKey=bb,w.castArray=Mz,w.chain=pb,w.chunk=IB,w.compact=LB,w.concat=NB,w.cond=aH,w.conforms=lH,w.constant=$f,w.countBy=$F,w.create=nU,w.curry=xb,w.curryRight=wb,w.debounce=vb,w.defaults=iU,w.defaultsDeep=rU,w.defer=pz,w.delay=gz,w.difference=BB,w.differenceBy=FB,w.differenceWith=zB,w.drop=UB,w.dropRight=HB,w.dropRightWhile=WB,w.dropWhile=VB,w.fill=$B,w.filter=qF,w.flatMap=KF,w.flatMapDeep=XF,w.flatMapDepth=ZF,w.flatten=ub,w.flattenDeep=YB,w.flattenDepth=qB,w.flip=mz,w.flow=uH,w.flowRight=dH,w.fromPairs=jB,w.functions=dU,w.functionsIn=fU,w.groupBy=QF,w.initial=KB,w.intersection=XB,w.intersectionBy=ZB,w.intersectionWith=QB,w.invert=pU,w.invertBy=gU,w.invokeMap=tz,w.iteratee=Yf,w.keyBy=ez,w.keys=Ee,w.keysIn=fn,w.map=fc,w.mapKeys=yU,w.mapValues=_U,w.matches=fH,w.matchesProperty=hH,w.memoize=pc,w.merge=bU,w.mergeWith=Pb,w.method=pH,w.methodOf=gH,w.mixin=qf,w.negate=gc,w.nthArg=yH,w.omit=xU,w.omitBy=wU,w.once=yz,w.orderBy=nz,w.over=_H,w.overArgs=_z,w.overEvery=bH,w.overSome=xH,w.partial=Bf,w.partialRight=Sb,w.partition=iz,w.pick=vU,w.pickBy=Ib,w.property=Hb,w.propertyOf=wH,w.pull=nF,w.pullAll=fb,w.pullAllBy=iF,w.pullAllWith=rF,w.pullAt=sF,w.range=vH,w.rangeRight=SH,w.rearg=bz,w.reject=oz,w.remove=oF,w.rest=xz,w.reverse=If,w.sampleSize=lz,w.set=TU,w.setWith=MU,w.shuffle=cz,w.slice=aF,w.sortBy=fz,w.sortedUniq=pF,w.sortedUniqBy=gF,w.split=GU,w.spread=wz,w.tail=mF,w.take=yF,w.takeRight=_F,w.takeRightWhile=bF,w.takeWhile=xF,w.tap=LF,w.throttle=vz,w.thru=dc,w.toArray=Cb,w.toPairs=Lb,w.toPairsIn=Nb,w.toPath=CH,w.toPlainObject=Ab,w.transform=kU,w.unary=Sz,w.union=wF,w.unionBy=vF,w.unionWith=SF,w.uniq=TF,w.uniqBy=MF,w.uniqWith=kF,w.unset=DU,w.unzip=Lf,w.unzipWith=hb,w.update=CU,w.updateWith=OU,w.values=Ss,w.valuesIn=AU,w.without=DF,w.words=zb,w.wrap=Tz,w.xor=CF,w.xorBy=OF,w.xorWith=AF,w.zip=RF,w.zipObject=EF,w.zipObjectDeep=PF,w.zipWith=IF,w.entries=Lb,w.entriesIn=Nb,w.extend=Rb,w.extendWith=Eb,qf(w,w),w.add=AH,w.attempt=Ub,w.camelCase=IU,w.capitalize=Bb,w.ceil=RH,w.clamp=RU,w.clone=kz,w.cloneDeep=Cz,w.cloneDeepWith=Oz,w.cloneWith=Dz,w.conformsTo=Az,w.deburr=Fb,w.defaultTo=cH,w.divide=EH,w.endsWith=LU,w.eq=Un,w.escape=NU,w.escapeRegExp=BU,w.every=YF,w.find=jF,w.findIndex=lb,w.findKey=sU,w.findLast=GF,w.findLastIndex=cb,w.findLastKey=oU,w.floor=PH,w.forEach=gb,w.forEachRight=mb,w.forIn=aU,w.forInRight=lU,w.forOwn=cU,w.forOwnRight=uU,w.get=Hf,w.gt=Rz,w.gte=Ez,w.has=hU,w.hasIn=Wf,w.head=db,w.identity=hn,w.includes=JF,w.indexOf=GB,w.inRange=EU,w.invoke=mU,w.isArguments=Ar,w.isArray=Et,w.isArrayBuffer=Pz,w.isArrayLike=dn,w.isArrayLikeObject=_e,w.isBoolean=Iz,w.isBuffer=Zi,w.isDate=Lz,w.isElement=Nz,w.isEmpty=Bz,w.isEqual=Fz,w.isEqualWith=zz,w.isError=Ff,w.isFinite=Uz,w.isFunction=_i,w.isInteger=Tb,w.isLength=mc,w.isMap=Mb,w.isMatch=Hz,w.isMatchWith=Wz,w.isNaN=Vz,w.isNative=$z,w.isNil=qz,w.isNull=Yz,w.isNumber=kb,w.isObject=fe,w.isObjectLike=ge,w.isPlainObject=Qo,w.isRegExp=zf,w.isSafeInteger=jz,w.isSet=Db,w.isString=yc,w.isSymbol=xn,w.isTypedArray=vs,w.isUndefined=Gz,w.isWeakMap=Kz,w.isWeakSet=Xz,w.join=JB,w.kebabCase=FU,w.last=En,w.lastIndexOf=tF,w.lowerCase=zU,w.lowerFirst=UU,w.lt=Zz,w.lte=Qz,w.max=IH,w.maxBy=LH,w.mean=NH,w.meanBy=BH,w.min=FH,w.minBy=zH,w.stubArray=Gf,w.stubFalse=Kf,w.stubObject=TH,w.stubString=MH,w.stubTrue=kH,w.multiply=UH,w.nth=eF,w.noConflict=mH,w.noop=jf,w.now=hc,w.pad=HU,w.padEnd=WU,w.padStart=VU,w.parseInt=$U,w.random=PU,w.reduce=rz,w.reduceRight=sz,w.repeat=YU,w.replace=qU,w.result=SU,w.round=HH,w.runInContext=F,w.sample=az,w.size=uz,w.snakeCase=jU,w.some=dz,w.sortedIndex=lF,w.sortedIndexBy=cF,w.sortedIndexOf=uF,w.sortedLastIndex=dF,w.sortedLastIndexBy=fF,w.sortedLastIndexOf=hF,w.startCase=KU,w.startsWith=XU,w.subtract=WH,w.sum=VH,w.sumBy=$H,w.template=ZU,w.times=DH,w.toFinite=bi,w.toInteger=Lt,w.toLength=Ob,w.toLower=QU,w.toNumber=Pn,w.toSafeInteger=Jz,w.toString=Kt,w.toUpper=JU,w.trim=tH,w.trimEnd=eH,w.trimStart=nH,w.truncate=iH,w.unescape=rH,w.uniqueId=OH,w.upperCase=sH,w.upperFirst=Vf,w.each=gb,w.eachRight=mb,w.first=db,qf(w,(function(){var o={};return Zn(w,function(c,f){Gt.call(w.prototype,f)||(o[f]=c)}),o})(),{chain:!1}),w.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),yn(["drop","take"],function(o,c){Ut.prototype[o]=function(f){f=f===e?1:ke(Lt(f),0);var y=this.__filtered__&&!c?new Ut(this):this.clone();return y.__filtered__?y.__takeCount__=je(f,y.__takeCount__):y.__views__.push({size:je(f,q),type:o+(y.__dir__<0?"Right":"")}),y},Ut.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var f=c+1,y=f==ft||f==tt;Ut.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:St(b,3),type:f}),k.__filtered__=k.__filtered__||y,k}}),yn(["head","last"],function(o,c){var f="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[f](1).value()[0]}}),yn(["initial","tail"],function(o,c){var f="drop"+(c?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[f](1)}}),Ut.prototype.compact=function(){return this.filter(hn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Bt(function(o,c){return typeof o=="function"?new Ut(this):this.map(function(f){return qo(f,o,c)})}),Ut.prototype.reject=function(o){return this.filter(gc(St(o)))},Ut.prototype.slice=function(o,c){o=Lt(o);var f=this;return f.__filtered__&&(o>0||c<0)?new Ut(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),c!==e&&(c=Lt(c),f=c<0?f.dropRight(-c):f.take(c-o)),f)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(q)},Zn(Ut.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=w[y?"take"+(c=="last"?"Right":""):c],k=y||/^find/.test(c);b&&(w.prototype[c]=function(){var A=this.__wrapped__,E=y?[1]:arguments,U=A instanceof Ut,Z=E[0],Q=U||Et(A),rt=function(Ft){var Ht=b.apply(w,$i([Ft],E));return y&&ct?Ht[0]:Ht};Q&&f&&typeof Z=="function"&&Z.length!=1&&(U=Q=!1);var ct=this.__chain__,yt=!!this.__actions__.length,Tt=k&&!ct,Nt=U&&!yt;if(!k&&Q){A=Nt?A:new Ut(this);var wt=o.apply(A,E);return wt.__actions__.push({func:dc,args:[rt],thisArg:e}),new On(wt,ct)}return Tt&&Nt?o.apply(this,E):(wt=this.thru(rt),Tt?y?wt.value()[0]:wt.value():wt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=Bl[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var k=this.value();return c.apply(Et(k)?k:[],b)}return this[f](function(A){return c.apply(Et(A)?A:[],b)})}}),Zn(Ut.prototype,function(o,c){var f=w[c];if(f){var y=f.name+"";Gt.call(ys,y)||(ys[y]=[]),ys[y].push({name:c,func:f})}}),ys[rc(e,R).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=sN,Ut.prototype.reverse=oN,Ut.prototype.value=aN,w.prototype.at=NF,w.prototype.chain=BF,w.prototype.commit=FF,w.prototype.next=zF,w.prototype.plant=HF,w.prototype.reverse=WF,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=VF,w.prototype.first=w.prototype.head,zo&&(w.prototype[zo]=UF),w}),ps=FL();Kn?((Kn.exports=ps)._=ps,us._=ps):ce._=ps}).call(tL)})(vo,vo.exports)),vo.exports}var P_=eL(),fl={exports:{}},nL=fl.exports,I_;function iL(){return I_||(I_=1,(function(n,t){(function(e,i){i()})(nL,function(){function e(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,g){var m=new XMLHttpRequest;m.open("GET",d),m.responseType="blob",m.onload=function(){u(m.response,h,g)},m.onerror=function(){console.error("could not download file")},m.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 Fi=="object"&&Fi.global===Fi?Fi: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,g){var m=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,g):s(_,_.target="_blank")):(_.href=m.createObjectURL(d),setTimeout(function(){m.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,h,g){if(h=h||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,g),h);else if(r(d))i(d,h,g);else{var m=document.createElement("a");m.href=d,m.target="_blank",setTimeout(function(){s(m)})}}:function(d,h,g,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof d=="string")return i(d,h,g);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 B=S.result;B=v?B:B.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=B:location=B,m=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,R=C.createObjectURL(d);m?m.location=R:location.href=R,m=null,setTimeout(function(){C.revokeObjectURL(R)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(fl)),fl.exports}var rL=iL(),hl={exports:{}};var sL=hl.exports,L_;function oL(){return L_||(L_=1,(function(n,t){((e,i)=>{n.exports=i()})(sL,function e(){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(T){return T.charCodeAt(0)===65279?T.slice(1):T}function h(T){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(M){var O=L(M);O.chunkSize=parseInt(O.chunkSize),M.step||M.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(M,O){var z=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<z){let it=this._config.newline;it||(W=this._config.quoteChar||'"',it=this._handle.guessLineEndings(M,W)),M=[...M.split(it).slice(z)].join(it)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(W=this._config.beforeFirstChunk(M))!==void 0&&(M=W),this.isFirstChunk=!1,this._halted=!1;var z=this._partialLine+M,W=(this._partialLine="",this._handle.parse(z,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(M=W.meta.cursor,z=(this._finished||(this._partialLine=z.substring(M-this._baseIndex),this._baseIndex=M),W&&W.data&&(this._rowCount+=W.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:W,workerId:u.WORKER_ID,finished:z});else if(N(this._config.chunk)&&!O){if(this._config.chunk(W,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=W=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(W.data),this._completeResults.errors=this._completeResults.errors.concat(W.errors),this._completeResults.meta=W.meta),this._completed||!z||!N(this._config.complete)||W&&W.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),z||W&&W.meta.paused||this._nextChunk(),W}this._halted=!0},this._sendError=function(M){N(this._config.error)?this._config.error(M):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:M,finished:!1})}}function g(T){var M;(T=T||{}).chunkSize||(T.chunkSize=u.RemoteChunkSize),h.call(this,T),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(M=new XMLHttpRequest,this._config.withCredentials&&(M.withCredentials=this._config.withCredentials),r||(M.onload=I(this._chunkLoaded,this),M.onerror=I(this._chunkError,this)),M.ontimeout=I(this._chunkTimeout,this),M.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(M.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,z=this._config.downloadRequestHeaders;for(O in z)M.setRequestHeader(O,z[O])}var W;this._config.chunkSize&&(W=this._start+this._config.chunkSize-1,M.setRequestHeader("Range","bytes="+this._start+"-"+W));try{M.send(this._config.downloadRequestBody)}catch(it){this._chunkError(it.message)}r&&M.status===0&&this._chunkError()}},this._chunkLoaded=function(){M.readyState===4&&(M.status<200||400<=M.status?this._chunkError():(this._start+=this._config.chunkSize||M.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(M),this.parseChunk(M.responseText)))},this._chunkError=function(O){O=M.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function m(T){(T=T||{}).chunkSize||(T.chunkSize=u.LocalChunkSize),h.call(this,T);var M,O,z=typeof FileReader<"u";this.stream=function(W){this._input=W,O=W.slice||W.webkitSlice||W.mozSlice,z?((M=new FileReader).onload=I(this._chunkLoaded,this),M.onerror=I(this._chunkError,this)):M=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var W=this._input,it=(this._config.chunkSize&&(it=Math.min(this._start+this._config.chunkSize,this._input.size),W=O.call(W,this._start,it)),M.readAsText(W,this._config.encoding));z||this._chunkLoaded({target:{result:it}})},this._chunkLoaded=function(W){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(W.target.result)},this._chunkError=function(){this._sendError(M.error)}}function _(T){var M;h.call(this,T=T||{}),this.stream=function(O){return M=O,this._nextChunk()},this._nextChunk=function(){var O,z;if(!this._finished)return O=this._config.chunkSize,M=O?(z=M.substring(0,O),M.substring(O)):(z=M,""),this._finished=!M,this.parseChunk(z)}}function x(T){h.call(this,T=T||{});var M=[],O=!0,z=!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(W){this._input=W,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){z&&M.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),M.length?this.parseChunk(M.shift()):O=!0},this._streamData=I(function(W){try{M.push(typeof W=="string"?W:W.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(M.shift()))}catch(it){this._streamError(it)}},this),this._streamError=I(function(W){this._streamCleanUp(),this._sendError(W)},this),this._streamEnd=I(function(){this._streamCleanUp(),z=!0,this._streamData("")},this),this._streamCleanUp=I(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(T){var M,O,z,W,it=Math.pow(2,53),ut=-it,ft=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,j=/^((\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)))$/,tt=this,nt=0,et=0,at=!1,H=!1,q=[],X={data:[],errors:[],meta:{}};function _t(ot){return T.skipEmptyLines==="greedy"?ot.join("").trim()==="":ot.length===1&&ot[0].length===0}function G(){if(X&&z&&(st("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),z=!1),T.skipEmptyLines&&(X.data=X.data.filter(function(dt){return!_t(dt)})),$()){let dt=function(It){q.push(It)};if(X)if(Array.isArray(X.data[0])){for(var ot=0;$()&&ot<X.data.length;ot++)X.data[ot].forEach(dt);X.data.splice(0,1)}else X.data.forEach(dt)}function lt(dt,It){for(var zt=T.header?{}:[],vt=0;vt<dt.length;vt++){var Ct=vt,Dt=dt[vt],Dt=((ve,bt)=>(jt=>(T.dynamicTypingFunction&&T.dynamicTyping[jt]===void 0&&(T.dynamicTyping[jt]=T.dynamicTypingFunction(jt)),(T.dynamicTyping[jt]||T.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((jt=>{if(ft.test(jt)&&(jt=parseFloat(jt),ut<jt&&jt<it))return 1})(bt)?parseFloat(bt):j.test(bt)?new Date(bt):bt===""?null:bt):bt)(Ct=T.header?vt>=q.length?"__parsed_extra":q[vt]:Ct,Dt=T.transform?T.transform(Dt,Ct):Dt);Ct==="__parsed_extra"?(zt[Ct]=zt[Ct]||[],zt[Ct].push(Dt)):zt[Ct]=Dt}return T.header&&(vt>q.length?st("FieldMismatch","TooManyFields","Too many fields: expected "+q.length+" fields but parsed "+vt,et+It):vt<q.length&&st("FieldMismatch","TooFewFields","Too few fields: expected "+q.length+" fields but parsed "+vt,et+It)),zt}var pt;X&&(T.header||T.dynamicTyping||T.transform)&&(pt=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(lt),pt=X.data.length):X.data=lt(X.data,0),T.header&&X.meta&&(X.meta.fields=q),et+=pt)}function $(){return T.header&&q.length===0}function st(ot,lt,pt,dt){ot={type:ot,code:lt,message:pt},dt!==void 0&&(ot.row=dt),X.errors.push(ot)}N(T.step)&&(W=T.step,T.step=function(ot){X=ot,$()?G():(G(),X.data.length!==0&&(nt+=ot.data.length,T.preview&&nt>T.preview?O.abort():(X.data=X.data[0],W(X,tt))))}),this.parse=function(ot,lt,pt){var dt=T.quoteChar||'"',dt=(T.newline||(T.newline=this.guessLineEndings(ot,dt)),z=!1,T.delimiter?N(T.delimiter)&&(T.delimiter=T.delimiter(ot),X.meta.delimiter=T.delimiter):((dt=((It,zt,vt,Ct,Dt)=>{var ve,bt,jt,Oe;Dt=Dt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ae=0;Ae<Dt.length;Ae++){for(var oe,ln=Dt[Ae],Vt=0,Le=0,ie=0,Se=(jt=void 0,new C({comments:Ct,delimiter:ln,newline:zt,preview:10}).parse(It)),Re=0;Re<Se.data.length;Re++)vt&&_t(Se.data[Re])?ie++:(oe=Se.data[Re].length,Le+=oe,jt===void 0?jt=oe:0<oe&&(Vt+=Math.abs(oe-jt),jt=oe));0<Se.data.length&&(Le/=Se.data.length-ie),1.99<Le&&(bt===void 0||Vt<bt||Vt===bt&&Oe<Le)&&(bt=Vt,ve=ln,Oe=Le)}return{successful:!!(T.delimiter=ve),bestDelimiter:ve}})(ot,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess)).successful?T.delimiter=dt.bestDelimiter:(z=!0,T.delimiter=u.DefaultDelimiter),X.meta.delimiter=T.delimiter),L(T));return dt.header=$(),T.preview&&T.header&&dt.preview++,M=ot,O=new C(dt),X=O.parse(M,lt,pt),G(),at?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return at},this.pause=function(){at=!0,O.abort(),M=N(T.chunk)?"":M.substring(O.getCharIndex())},this.resume=function(){tt.streamer._halted?(at=!1,tt.streamer.parseChunk(M,!0)):setTimeout(tt.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,O.abort(),X.meta.aborted=!0,N(T.complete)&&T.complete(X),M=""},this.guessLineEndings=function(It,dt){It=It.substring(0,1048576);var dt=new RegExp(S(dt)+"([^]*?)"+S(dt),"gm"),pt=(It=It.replace(dt,"")).split("\r"),dt=It.split(`
26
+ }`;var Nt=Ub(function(){return $t(k,yt+"return "+rt).apply(e,A)});if(Nt.source=rt,Ff(Nt))throw Nt;return Nt}function QU(o){return Kt(o).toLowerCase()}function JU(o){return Kt(o).toUpperCase()}function tH(o,c,f){if(o=Kt(o),o&&(f||c===e))return G_(o);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=Bn(c),k=K_(y,b),A=X_(y,b)+1;return Xi(y,k,A).join("")}function eH(o,c,f){if(o=Kt(o),o&&(f||c===e))return o.slice(0,Q_(o)+1);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=X_(y,Bn(c))+1;return Xi(y,0,b).join("")}function nH(o,c,f){if(o=Kt(o),o&&(f||c===e))return o.replace(Ao,"");if(!o||!(c=bn(c)))return o;var y=Bn(o),b=K_(y,Bn(c));return Xi(y,b).join("")}function iH(o,c){var f=z,y=W;if(fe(c)){var b="separator"in c?c.separator:b;f="length"in c?Lt(c.length):f,y="omission"in c?bn(c.omission):y}o=Kt(o);var k=o.length;if(fs(o)){var A=Bn(o);k=A.length}if(f>=k)return o;var R=f-hs(y);if(R<1)return y;var U=A?Xi(A,0,R).join(""):o.slice(0,R);if(b===e)return U+y;if(A&&(R+=U.length-R),zf(b)){if(o.slice(R).search(b)){var Z,Q=U;for(b.global||(b=tf(b.source,Kt(yl.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var rt=Z.index;U=U.slice(0,rt===e?R:rt)}}else if(o.indexOf(bn(b),R)!=R){var ct=U.lastIndexOf(b);ct>-1&&(U=U.slice(0,ct))}return U+y}function rH(o){return o=Kt(o),o&&fd.test(o)?o.replace(Ui,IL):o}var sH=xs(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),Vf=U0("toUpperCase");function zb(o,c,f){return o=Kt(o),c=f?e:c,c===e?OL(o)?BL(o):xL(o):o.match(c)||[]}var Ub=Bt(function(o,c){try{return mn(o,e,c)}catch(f){return Ff(f)?f:new Ot(f)}}),oH=mi(function(o,c){return yn(c,function(f){f=zn(f),Xn(o,f,Nf(o[f],o))}),o});function aH(o){var c=o==null?0:o.length,f=St();return o=c?ue(o,function(y){if(typeof y[1]!="function")throw new Cn(a);return[f(y[0]),y[1]]}):[],Bt(function(y){for(var b=-1;++b<c;){var k=o[b];if(mn(k[0],this,y))return mn(k[1],this,y)}})}function lH(o){return IN(An(o,m))}function $f(o){return function(){return o}}function cH(o,c){return o==null||o!==o?c:o}var uH=W0(),dH=W0(!0);function hn(o){return o}function Yf(o){return _0(typeof o=="function"?o:An(o,m))}function fH(o){return x0(An(o,m))}function hH(o,c){return w0(o,An(c,m))}var pH=Bt(function(o,c){return function(f){return qo(f,o,c)}}),gH=Bt(function(o,c){return function(f){return qo(o,f,c)}});function qf(o,c,f){var y=Re(c),b=Jl(c,y);f==null&&!(fe(c)&&(b.length||!y.length))&&(f=c,c=o,o=this,b=Jl(c,Re(c)));var k=!(fe(f)&&"chain"in f)||!!f.chain,A=_i(o);return yn(b,function(R){var U=c[R];o[R]=U,A&&(o.prototype[R]=function(){var Z=this.__chain__;if(k||Z){var Q=o(this.__wrapped__),rt=Q.__actions__=un(this.__actions__);return rt.push({func:U,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return U.apply(o,$i([this.value()],arguments))})}),o}function mH(){return ce._===this&&(ce._=VL),this}function jf(){}function yH(o){return o=Lt(o),Bt(function(c){return v0(c,o)})}var _H=Sf(ue),bH=Sf(V_),xH=Sf(jd);function Hb(o){return Af(o)?Gd(zn(o)):ZN(o)}function wH(o){return function(c){return o==null?e:Dr(o,c)}}var vH=$0(),SH=$0(!0);function Gf(){return[]}function Kf(){return!1}function TH(){return{}}function MH(){return""}function kH(){return!0}function DH(o,c){if(o=Lt(o),o<1||o>et)return[];var f=q,y=je(o,q);c=St(c),o-=q;for(var b=Zd(y,c);++f<o;)c(f);return b}function CH(o){return Rt(o)?ue(o,zn):xn(o)?[o]:un(ob(Kt(o)))}function OH(o){var c=++HL;return Kt(o)+c}var AH=sc(function(o,c){return o+c},0),EH=Tf("ceil"),RH=sc(function(o,c){return o/c},1),PH=Tf("floor");function IH(o){return o&&o.length?Ql(o,hn,cf):e}function LH(o,c){return o&&o.length?Ql(o,St(c,2),cf):e}function NH(o){return q_(o,hn)}function BH(o,c){return q_(o,St(c,2))}function FH(o){return o&&o.length?Ql(o,hn,hf):e}function zH(o,c){return o&&o.length?Ql(o,St(c,2),hf):e}var UH=sc(function(o,c){return o*c},1),HH=Tf("round"),WH=sc(function(o,c){return o-c},0);function VH(o){return o&&o.length?Xd(o,hn):0}function $H(o,c){return o&&o.length?Xd(o,St(c,2)):0}return w.after=hz,w.ary=yb,w.assign=tU,w.assignIn=Eb,w.assignInWith=Rb,w.assignWith=Uf,w.at=eU,w.before=_b,w.bind=Nf,w.bindAll=oH,w.bindKey=bb,w.castArray=Mz,w.chain=pb,w.chunk=IB,w.compact=LB,w.concat=NB,w.cond=aH,w.conforms=lH,w.constant=$f,w.countBy=$F,w.create=nU,w.curry=xb,w.curryRight=wb,w.debounce=vb,w.defaults=iU,w.defaultsDeep=rU,w.defer=pz,w.delay=gz,w.difference=BB,w.differenceBy=FB,w.differenceWith=zB,w.drop=UB,w.dropRight=HB,w.dropRightWhile=WB,w.dropWhile=VB,w.fill=$B,w.filter=qF,w.flatMap=KF,w.flatMapDeep=XF,w.flatMapDepth=ZF,w.flatten=ub,w.flattenDeep=YB,w.flattenDepth=qB,w.flip=mz,w.flow=uH,w.flowRight=dH,w.fromPairs=jB,w.functions=dU,w.functionsIn=fU,w.groupBy=QF,w.initial=KB,w.intersection=XB,w.intersectionBy=ZB,w.intersectionWith=QB,w.invert=pU,w.invertBy=gU,w.invokeMap=tz,w.iteratee=Yf,w.keyBy=ez,w.keys=Re,w.keysIn=fn,w.map=fc,w.mapKeys=yU,w.mapValues=_U,w.matches=fH,w.matchesProperty=hH,w.memoize=pc,w.merge=bU,w.mergeWith=Pb,w.method=pH,w.methodOf=gH,w.mixin=qf,w.negate=gc,w.nthArg=yH,w.omit=xU,w.omitBy=wU,w.once=yz,w.orderBy=nz,w.over=_H,w.overArgs=_z,w.overEvery=bH,w.overSome=xH,w.partial=Bf,w.partialRight=Sb,w.partition=iz,w.pick=vU,w.pickBy=Ib,w.property=Hb,w.propertyOf=wH,w.pull=nF,w.pullAll=fb,w.pullAllBy=iF,w.pullAllWith=rF,w.pullAt=sF,w.range=vH,w.rangeRight=SH,w.rearg=bz,w.reject=oz,w.remove=oF,w.rest=xz,w.reverse=If,w.sampleSize=lz,w.set=TU,w.setWith=MU,w.shuffle=cz,w.slice=aF,w.sortBy=fz,w.sortedUniq=pF,w.sortedUniqBy=gF,w.split=GU,w.spread=wz,w.tail=mF,w.take=yF,w.takeRight=_F,w.takeRightWhile=bF,w.takeWhile=xF,w.tap=LF,w.throttle=vz,w.thru=dc,w.toArray=Cb,w.toPairs=Lb,w.toPairsIn=Nb,w.toPath=CH,w.toPlainObject=Ab,w.transform=kU,w.unary=Sz,w.union=wF,w.unionBy=vF,w.unionWith=SF,w.uniq=TF,w.uniqBy=MF,w.uniqWith=kF,w.unset=DU,w.unzip=Lf,w.unzipWith=hb,w.update=CU,w.updateWith=OU,w.values=Ss,w.valuesIn=AU,w.without=DF,w.words=zb,w.wrap=Tz,w.xor=CF,w.xorBy=OF,w.xorWith=AF,w.zip=EF,w.zipObject=RF,w.zipObjectDeep=PF,w.zipWith=IF,w.entries=Lb,w.entriesIn=Nb,w.extend=Eb,w.extendWith=Rb,qf(w,w),w.add=AH,w.attempt=Ub,w.camelCase=IU,w.capitalize=Bb,w.ceil=EH,w.clamp=EU,w.clone=kz,w.cloneDeep=Cz,w.cloneDeepWith=Oz,w.cloneWith=Dz,w.conformsTo=Az,w.deburr=Fb,w.defaultTo=cH,w.divide=RH,w.endsWith=LU,w.eq=Un,w.escape=NU,w.escapeRegExp=BU,w.every=YF,w.find=jF,w.findIndex=lb,w.findKey=sU,w.findLast=GF,w.findLastIndex=cb,w.findLastKey=oU,w.floor=PH,w.forEach=gb,w.forEachRight=mb,w.forIn=aU,w.forInRight=lU,w.forOwn=cU,w.forOwnRight=uU,w.get=Hf,w.gt=Ez,w.gte=Rz,w.has=hU,w.hasIn=Wf,w.head=db,w.identity=hn,w.includes=JF,w.indexOf=GB,w.inRange=RU,w.invoke=mU,w.isArguments=Ar,w.isArray=Rt,w.isArrayBuffer=Pz,w.isArrayLike=dn,w.isArrayLikeObject=_e,w.isBoolean=Iz,w.isBuffer=Zi,w.isDate=Lz,w.isElement=Nz,w.isEmpty=Bz,w.isEqual=Fz,w.isEqualWith=zz,w.isError=Ff,w.isFinite=Uz,w.isFunction=_i,w.isInteger=Tb,w.isLength=mc,w.isMap=Mb,w.isMatch=Hz,w.isMatchWith=Wz,w.isNaN=Vz,w.isNative=$z,w.isNil=qz,w.isNull=Yz,w.isNumber=kb,w.isObject=fe,w.isObjectLike=ge,w.isPlainObject=Qo,w.isRegExp=zf,w.isSafeInteger=jz,w.isSet=Db,w.isString=yc,w.isSymbol=xn,w.isTypedArray=vs,w.isUndefined=Gz,w.isWeakMap=Kz,w.isWeakSet=Xz,w.join=JB,w.kebabCase=FU,w.last=Rn,w.lastIndexOf=tF,w.lowerCase=zU,w.lowerFirst=UU,w.lt=Zz,w.lte=Qz,w.max=IH,w.maxBy=LH,w.mean=NH,w.meanBy=BH,w.min=FH,w.minBy=zH,w.stubArray=Gf,w.stubFalse=Kf,w.stubObject=TH,w.stubString=MH,w.stubTrue=kH,w.multiply=UH,w.nth=eF,w.noConflict=mH,w.noop=jf,w.now=hc,w.pad=HU,w.padEnd=WU,w.padStart=VU,w.parseInt=$U,w.random=PU,w.reduce=rz,w.reduceRight=sz,w.repeat=YU,w.replace=qU,w.result=SU,w.round=HH,w.runInContext=F,w.sample=az,w.size=uz,w.snakeCase=jU,w.some=dz,w.sortedIndex=lF,w.sortedIndexBy=cF,w.sortedIndexOf=uF,w.sortedLastIndex=dF,w.sortedLastIndexBy=fF,w.sortedLastIndexOf=hF,w.startCase=KU,w.startsWith=XU,w.subtract=WH,w.sum=VH,w.sumBy=$H,w.template=ZU,w.times=DH,w.toFinite=bi,w.toInteger=Lt,w.toLength=Ob,w.toLower=QU,w.toNumber=Pn,w.toSafeInteger=Jz,w.toString=Kt,w.toUpper=JU,w.trim=tH,w.trimEnd=eH,w.trimStart=nH,w.truncate=iH,w.unescape=rH,w.uniqueId=OH,w.upperCase=sH,w.upperFirst=Vf,w.each=gb,w.eachRight=mb,w.first=db,qf(w,(function(){var o={};return Zn(w,function(c,f){Gt.call(w.prototype,f)||(o[f]=c)}),o})(),{chain:!1}),w.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),yn(["drop","take"],function(o,c){Ut.prototype[o]=function(f){f=f===e?1:ke(Lt(f),0);var y=this.__filtered__&&!c?new Ut(this):this.clone();return y.__filtered__?y.__takeCount__=je(f,y.__takeCount__):y.__views__.push({size:je(f,q),type:o+(y.__dir__<0?"Right":"")}),y},Ut.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var f=c+1,y=f==ft||f==tt;Ut.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:St(b,3),type:f}),k.__filtered__=k.__filtered__||y,k}}),yn(["head","last"],function(o,c){var f="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[f](1).value()[0]}}),yn(["initial","tail"],function(o,c){var f="drop"+(c?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[f](1)}}),Ut.prototype.compact=function(){return this.filter(hn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Bt(function(o,c){return typeof o=="function"?new Ut(this):this.map(function(f){return qo(f,o,c)})}),Ut.prototype.reject=function(o){return this.filter(gc(St(o)))},Ut.prototype.slice=function(o,c){o=Lt(o);var f=this;return f.__filtered__&&(o>0||c<0)?new Ut(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),c!==e&&(c=Lt(c),f=c<0?f.dropRight(-c):f.take(c-o)),f)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(q)},Zn(Ut.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=w[y?"take"+(c=="last"?"Right":""):c],k=y||/^find/.test(c);b&&(w.prototype[c]=function(){var A=this.__wrapped__,R=y?[1]:arguments,U=A instanceof Ut,Z=R[0],Q=U||Rt(A),rt=function(Ft){var Ht=b.apply(w,$i([Ft],R));return y&&ct?Ht[0]:Ht};Q&&f&&typeof Z=="function"&&Z.length!=1&&(U=Q=!1);var ct=this.__chain__,yt=!!this.__actions__.length,Tt=k&&!ct,Nt=U&&!yt;if(!k&&Q){A=Nt?A:new Ut(this);var wt=o.apply(A,R);return wt.__actions__.push({func:dc,args:[rt],thisArg:e}),new On(wt,ct)}return Tt&&Nt?o.apply(this,R):(wt=this.thru(rt),Tt?y?wt.value()[0]:wt.value():wt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=Bl[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var k=this.value();return c.apply(Rt(k)?k:[],b)}return this[f](function(A){return c.apply(Rt(A)?A:[],b)})}}),Zn(Ut.prototype,function(o,c){var f=w[c];if(f){var y=f.name+"";Gt.call(ys,y)||(ys[y]=[]),ys[y].push({name:c,func:f})}}),ys[rc(e,E).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=sN,Ut.prototype.reverse=oN,Ut.prototype.value=aN,w.prototype.at=NF,w.prototype.chain=BF,w.prototype.commit=FF,w.prototype.next=zF,w.prototype.plant=HF,w.prototype.reverse=WF,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=VF,w.prototype.first=w.prototype.head,zo&&(w.prototype[zo]=UF),w}),ps=FL();Kn?((Kn.exports=ps)._=ps,us._=ps):ce._=ps}).call(tL)})(vo,vo.exports)),vo.exports}var P_=eL(),fl={exports:{}},nL=fl.exports,I_;function iL(){return I_||(I_=1,(function(n,t){(function(e,i){i()})(nL,function(){function e(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,g){var m=new XMLHttpRequest;m.open("GET",d),m.responseType="blob",m.onload=function(){u(m.response,h,g)},m.onerror=function(){console.error("could not download file")},m.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 Fi=="object"&&Fi.global===Fi?Fi: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,g){var m=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,g):s(_,_.target="_blank")):(_.href=m.createObjectURL(d),setTimeout(function(){m.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,h,g){if(h=h||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,g),h);else if(r(d))i(d,h,g);else{var m=document.createElement("a");m.href=d,m.target="_blank",setTimeout(function(){s(m)})}}:function(d,h,g,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof d=="string")return i(d,h,g);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 B=S.result;B=v?B:B.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=B:location=B,m=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,E=C.createObjectURL(d);m?m.location=E:location.href=E,m=null,setTimeout(function(){C.revokeObjectURL(E)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(fl)),fl.exports}var rL=iL(),hl={exports:{}};var sL=hl.exports,L_;function oL(){return L_||(L_=1,(function(n,t){((e,i)=>{n.exports=i()})(sL,function e(){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(T){return T.charCodeAt(0)===65279?T.slice(1):T}function h(T){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(M){var O=L(M);O.chunkSize=parseInt(O.chunkSize),M.step||M.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(M,O){var z=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<z){let it=this._config.newline;it||(W=this._config.quoteChar||'"',it=this._handle.guessLineEndings(M,W)),M=[...M.split(it).slice(z)].join(it)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(W=this._config.beforeFirstChunk(M))!==void 0&&(M=W),this.isFirstChunk=!1,this._halted=!1;var z=this._partialLine+M,W=(this._partialLine="",this._handle.parse(z,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(M=W.meta.cursor,z=(this._finished||(this._partialLine=z.substring(M-this._baseIndex),this._baseIndex=M),W&&W.data&&(this._rowCount+=W.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:W,workerId:u.WORKER_ID,finished:z});else if(N(this._config.chunk)&&!O){if(this._config.chunk(W,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=W=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(W.data),this._completeResults.errors=this._completeResults.errors.concat(W.errors),this._completeResults.meta=W.meta),this._completed||!z||!N(this._config.complete)||W&&W.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),z||W&&W.meta.paused||this._nextChunk(),W}this._halted=!0},this._sendError=function(M){N(this._config.error)?this._config.error(M):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:M,finished:!1})}}function g(T){var M;(T=T||{}).chunkSize||(T.chunkSize=u.RemoteChunkSize),h.call(this,T),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(M=new XMLHttpRequest,this._config.withCredentials&&(M.withCredentials=this._config.withCredentials),r||(M.onload=I(this._chunkLoaded,this),M.onerror=I(this._chunkError,this)),M.ontimeout=I(this._chunkTimeout,this),M.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(M.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,z=this._config.downloadRequestHeaders;for(O in z)M.setRequestHeader(O,z[O])}var W;this._config.chunkSize&&(W=this._start+this._config.chunkSize-1,M.setRequestHeader("Range","bytes="+this._start+"-"+W));try{M.send(this._config.downloadRequestBody)}catch(it){this._chunkError(it.message)}r&&M.status===0&&this._chunkError()}},this._chunkLoaded=function(){M.readyState===4&&(M.status<200||400<=M.status?this._chunkError():(this._start+=this._config.chunkSize||M.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(M),this.parseChunk(M.responseText)))},this._chunkError=function(O){O=M.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function m(T){(T=T||{}).chunkSize||(T.chunkSize=u.LocalChunkSize),h.call(this,T);var M,O,z=typeof FileReader<"u";this.stream=function(W){this._input=W,O=W.slice||W.webkitSlice||W.mozSlice,z?((M=new FileReader).onload=I(this._chunkLoaded,this),M.onerror=I(this._chunkError,this)):M=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var W=this._input,it=(this._config.chunkSize&&(it=Math.min(this._start+this._config.chunkSize,this._input.size),W=O.call(W,this._start,it)),M.readAsText(W,this._config.encoding));z||this._chunkLoaded({target:{result:it}})},this._chunkLoaded=function(W){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(W.target.result)},this._chunkError=function(){this._sendError(M.error)}}function _(T){var M;h.call(this,T=T||{}),this.stream=function(O){return M=O,this._nextChunk()},this._nextChunk=function(){var O,z;if(!this._finished)return O=this._config.chunkSize,M=O?(z=M.substring(0,O),M.substring(O)):(z=M,""),this._finished=!M,this.parseChunk(z)}}function x(T){h.call(this,T=T||{});var M=[],O=!0,z=!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(W){this._input=W,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){z&&M.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),M.length?this.parseChunk(M.shift()):O=!0},this._streamData=I(function(W){try{M.push(typeof W=="string"?W:W.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(M.shift()))}catch(it){this._streamError(it)}},this),this._streamError=I(function(W){this._streamCleanUp(),this._sendError(W)},this),this._streamEnd=I(function(){this._streamCleanUp(),z=!0,this._streamData("")},this),this._streamCleanUp=I(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(T){var M,O,z,W,it=Math.pow(2,53),ut=-it,ft=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,j=/^((\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)))$/,tt=this,nt=0,et=0,at=!1,H=!1,q=[],X={data:[],errors:[],meta:{}};function _t(ot){return T.skipEmptyLines==="greedy"?ot.join("").trim()==="":ot.length===1&&ot[0].length===0}function G(){if(X&&z&&(st("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),z=!1),T.skipEmptyLines&&(X.data=X.data.filter(function(dt){return!_t(dt)})),$()){let dt=function(It){q.push(It)};if(X)if(Array.isArray(X.data[0])){for(var ot=0;$()&&ot<X.data.length;ot++)X.data[ot].forEach(dt);X.data.splice(0,1)}else X.data.forEach(dt)}function lt(dt,It){for(var zt=T.header?{}:[],vt=0;vt<dt.length;vt++){var Ct=vt,Dt=dt[vt],Dt=((ve,bt)=>(jt=>(T.dynamicTypingFunction&&T.dynamicTyping[jt]===void 0&&(T.dynamicTyping[jt]=T.dynamicTypingFunction(jt)),(T.dynamicTyping[jt]||T.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((jt=>{if(ft.test(jt)&&(jt=parseFloat(jt),ut<jt&&jt<it))return 1})(bt)?parseFloat(bt):j.test(bt)?new Date(bt):bt===""?null:bt):bt)(Ct=T.header?vt>=q.length?"__parsed_extra":q[vt]:Ct,Dt=T.transform?T.transform(Dt,Ct):Dt);Ct==="__parsed_extra"?(zt[Ct]=zt[Ct]||[],zt[Ct].push(Dt)):zt[Ct]=Dt}return T.header&&(vt>q.length?st("FieldMismatch","TooManyFields","Too many fields: expected "+q.length+" fields but parsed "+vt,et+It):vt<q.length&&st("FieldMismatch","TooFewFields","Too few fields: expected "+q.length+" fields but parsed "+vt,et+It)),zt}var pt;X&&(T.header||T.dynamicTyping||T.transform)&&(pt=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(lt),pt=X.data.length):X.data=lt(X.data,0),T.header&&X.meta&&(X.meta.fields=q),et+=pt)}function $(){return T.header&&q.length===0}function st(ot,lt,pt,dt){ot={type:ot,code:lt,message:pt},dt!==void 0&&(ot.row=dt),X.errors.push(ot)}N(T.step)&&(W=T.step,T.step=function(ot){X=ot,$()?G():(G(),X.data.length!==0&&(nt+=ot.data.length,T.preview&&nt>T.preview?O.abort():(X.data=X.data[0],W(X,tt))))}),this.parse=function(ot,lt,pt){var dt=T.quoteChar||'"',dt=(T.newline||(T.newline=this.guessLineEndings(ot,dt)),z=!1,T.delimiter?N(T.delimiter)&&(T.delimiter=T.delimiter(ot),X.meta.delimiter=T.delimiter):((dt=((It,zt,vt,Ct,Dt)=>{var ve,bt,jt,Oe;Dt=Dt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ae=0;Ae<Dt.length;Ae++){for(var oe,ln=Dt[Ae],Vt=0,Le=0,ie=0,Se=(jt=void 0,new C({comments:Ct,delimiter:ln,newline:zt,preview:10}).parse(It)),Ee=0;Ee<Se.data.length;Ee++)vt&&_t(Se.data[Ee])?ie++:(oe=Se.data[Ee].length,Le+=oe,jt===void 0?jt=oe:0<oe&&(Vt+=Math.abs(oe-jt),jt=oe));0<Se.data.length&&(Le/=Se.data.length-ie),1.99<Le&&(bt===void 0||Vt<bt||Vt===bt&&Oe<Le)&&(bt=Vt,ve=ln,Oe=Le)}return{successful:!!(T.delimiter=ve),bestDelimiter:ve}})(ot,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess)).successful?T.delimiter=dt.bestDelimiter:(z=!0,T.delimiter=u.DefaultDelimiter),X.meta.delimiter=T.delimiter),L(T));return dt.header=$(),T.preview&&T.header&&dt.preview++,M=ot,O=new C(dt),X=O.parse(M,lt,pt),G(),at?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return at},this.pause=function(){at=!0,O.abort(),M=N(T.chunk)?"":M.substring(O.getCharIndex())},this.resume=function(){tt.streamer._halted?(at=!1,tt.streamer.parseChunk(M,!0)):setTimeout(tt.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,O.abort(),X.meta.aborted=!0,N(T.complete)&&T.complete(X),M=""},this.guessLineEndings=function(It,dt){It=It.substring(0,1048576);var dt=new RegExp(S(dt)+"([^]*?)"+S(dt),"gm"),pt=(It=It.replace(dt,"")).split("\r"),dt=It.split(`
27
27
  `),It=1<dt.length&&dt[0].length<pt[0].length;if(pt.length===1||It)return`
28
28
  `;for(var zt=0,vt=0;vt<pt.length;vt++)pt[vt][0]===`
29
29
  `&&zt++;return zt>=pt.length/2?`\r
30
30
  `:"\r"}}function S(T){return T.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(T){var M=(T=T||{}).delimiter,O=T.newline,z=T.comments,W=T.step,it=T.preview,ut=T.fastMode,ft=null,j=!1,tt=T.quoteChar==null?'"':T.quoteChar,nt=tt;if(T.escapeChar!==void 0&&(nt=T.escapeChar),(typeof M!="string"||-1<u.BAD_DELIMITERS.indexOf(M))&&(M=","),z===M)throw new Error("Comment character same as delimiter");z===!0?z="#":(typeof z!="string"||-1<u.BAD_DELIMITERS.indexOf(z))&&(z=!1),O!==`
31
31
  `&&O!=="\r"&&O!==`\r
32
32
  `&&(O=`
33
- `);var et=0,at=!1;this.parse=function(H,q,X){if(typeof H!="string")throw new Error("Input must be a string");var _t=H.length,G=M.length,$=O.length,st=z.length,ot=N(W),lt=[],pt=[],dt=[],It=et=0;if(!H)return Vt();if(ut||ut!==!1&&H.indexOf(tt)===-1){for(var zt=H.split(O),vt=0;vt<zt.length;vt++){if(dt=zt[vt],et+=dt.length,vt!==zt.length-1)et+=O.length;else if(X)return Vt();if(!z||dt.substring(0,st)!==z){if(ot){if(lt=[],Oe(dt.split(M)),Le(),at)return Vt()}else Oe(dt.split(M));if(it&&it<=vt)return lt=lt.slice(0,it),Vt(!0)}}return Vt()}for(var Ct=H.indexOf(M,et),Dt=H.indexOf(O,et),ve=new RegExp(S(nt)+S(tt),"g"),bt=H.indexOf(tt,et);;)if(H[et]===tt)for(bt=et,et++;;){if((bt=H.indexOf(tt,bt+1))===-1)return X||pt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:lt.length,index:et}),oe();if(bt===_t-1)return oe(H.substring(et,bt).replace(ve,tt));if(tt===nt&&H[bt+1]===nt)bt++;else if(tt===nt||bt===0||H[bt-1]!==nt){Ct!==-1&&Ct<bt+1&&(Ct=H.indexOf(M,bt+1));var jt=Ae((Dt=Dt!==-1&&Dt<bt+1?H.indexOf(O,bt+1):Dt)===-1?Ct:Math.min(Ct,Dt));if(H.substr(bt+1+jt,G)===M){dt.push(H.substring(et,bt).replace(ve,tt)),H[et=bt+1+jt+G]!==tt&&(bt=H.indexOf(tt,et)),Ct=H.indexOf(M,et),Dt=H.indexOf(O,et);break}if(jt=Ae(Dt),H.substring(bt+1+jt,bt+1+jt+$)===O){if(dt.push(H.substring(et,bt).replace(ve,tt)),ln(bt+1+jt+$),Ct=H.indexOf(M,et),bt=H.indexOf(tt,et),ot&&(Le(),at))return Vt();if(it&&lt.length>=it)return Vt(!0);break}pt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:lt.length,index:et}),bt++}}else if(z&&dt.length===0&&H.substring(et,et+st)===z){if(Dt===-1)return Vt();et=Dt+$,Dt=H.indexOf(O,et),Ct=H.indexOf(M,et)}else if(Ct!==-1&&(Ct<Dt||Dt===-1))dt.push(H.substring(et,Ct)),et=Ct+G,Ct=H.indexOf(M,et);else{if(Dt===-1)break;if(dt.push(H.substring(et,Dt)),ln(Dt+$),ot&&(Le(),at))return Vt();if(it&&lt.length>=it)return Vt(!0)}return oe();function Oe(ie){lt.push(ie),It=et}function Ae(ie){var Se=0;return Se=ie!==-1&&(ie=H.substring(bt+1,ie))&&ie.trim()===""?ie.length:Se}function oe(ie){return X||(ie===void 0&&(ie=H.substring(et)),dt.push(ie),et=_t,Oe(dt),ot&&Le()),Vt()}function ln(ie){et=ie,Oe(dt),dt=[],Dt=H.indexOf(O,et)}function Vt(ie){if(T.header&&!q&&lt.length&&!j){var Se=lt[0],Re=Object.create(null),gn=new Set(Se);let zi=!1;for(let Dn=0;Dn<Se.length;Dn++){let Ye=d(Se[Dn]);if(Re[Ye=N(T.transformHeader)?T.transformHeader(Ye,Dn):Ye]){let In,ci=Re[Ye];for(;In=Ye+"_"+ci,ci++,gn.has(In););gn.add(In),Se[Dn]=In,Re[Ye]++,zi=!0,(ft=ft===null?{}:ft)[In]=Ye}else Re[Ye]=1,Se[Dn]=Ye;gn.add(Ye)}zi&&console.warn("Duplicate headers found and renamed."),j=!0}return{data:lt,errors:pt,meta:{delimiter:M,linebreak:O,aborted:at,truncated:!!ie,cursor:It+(q||0),renamedHeaders:ft}}}function Le(){W(Vt()),lt=[],pt=[]}},this.abort=function(){at=!0},this.getCharIndex=function(){return et}}function R(T){var M=T.data,O=a[M.workerId],z=!1;if(M.error)O.userError(M.error,M.file);else if(M.results&&M.results.data){var W={abort:function(){z=!0,B(M.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(N(O.userStep)){for(var it=0;it<M.results.data.length&&(O.userStep({data:M.results.data[it],errors:M.results.errors,meta:M.results.meta},W),!z);it++);delete M.results}else N(O.userChunk)&&(O.userChunk(M.results,W,M.file),delete M.results)}M.finished&&!z&&B(M.workerId,M.results)}function B(T,M){var O=a[T];N(O.userComplete)&&O.userComplete(M),O.terminate(),delete a[T]}function P(){throw new Error("Not implemented.")}function L(T){if(typeof T!="object"||T===null)return T;var M,O=Array.isArray(T)?[]:{};for(M in T)O[M]=L(T[M]);return O}function I(T,M){return function(){T.apply(M,arguments)}}function N(T){return typeof T=="function"}return u.parse=function(T,M){var O=(M=M||{}).dynamicTyping||!1;if(N(O)&&(M.dynamicTypingFunction=O,O={}),M.dynamicTyping=O,M.transform=!!N(M.transform)&&M.transform,M.downloadTimeout!==void 0){var O=parseInt(M.downloadTimeout);if(isNaN(O))throw new Error("Config downloadTimeout value ("+M.downloadTimeout+") not parsable by parseInt(val).");M.downloadTimeout=O}if(!M.worker||!u.WORKERS_SUPPORTED)return O=null,u.NODE_STREAM_INPUT,typeof T=="string"?(T=d(T),O=new(M.download?g:_)(M)):T.readable===!0&&N(T.read)&&N(T.on)?O=new x(M):(i.File&&T instanceof File||T instanceof Object)&&(O=new m(M)),O.stream(T);(O=(()=>{var z;return!!u.WORKERS_SUPPORTED&&(z=(()=>{var W=i.URL||i.webkitURL||null,it=e.toString();return u.BLOB_URL||(u.BLOB_URL=W.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; ","(",it,")();"],{type:"text/javascript"})))})(),(z=new i.Worker(z)).onmessage=R,z.id=l++,a[z.id]=z)})()).userStep=M.step,O.userChunk=M.chunk,O.userComplete=M.complete,O.userError=M.error,M.step=N(M.step),M.chunk=N(M.chunk),M.complete=N(M.complete),M.error=N(M.error),delete M.worker,O.postMessage({input:T,config:M,workerId:O.id})},u.unparse=function(T,M){var O=!1,z=!0,W=",",it=`\r
33
+ `);var et=0,at=!1;this.parse=function(H,q,X){if(typeof H!="string")throw new Error("Input must be a string");var _t=H.length,G=M.length,$=O.length,st=z.length,ot=N(W),lt=[],pt=[],dt=[],It=et=0;if(!H)return Vt();if(ut||ut!==!1&&H.indexOf(tt)===-1){for(var zt=H.split(O),vt=0;vt<zt.length;vt++){if(dt=zt[vt],et+=dt.length,vt!==zt.length-1)et+=O.length;else if(X)return Vt();if(!z||dt.substring(0,st)!==z){if(ot){if(lt=[],Oe(dt.split(M)),Le(),at)return Vt()}else Oe(dt.split(M));if(it&&it<=vt)return lt=lt.slice(0,it),Vt(!0)}}return Vt()}for(var Ct=H.indexOf(M,et),Dt=H.indexOf(O,et),ve=new RegExp(S(nt)+S(tt),"g"),bt=H.indexOf(tt,et);;)if(H[et]===tt)for(bt=et,et++;;){if((bt=H.indexOf(tt,bt+1))===-1)return X||pt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:lt.length,index:et}),oe();if(bt===_t-1)return oe(H.substring(et,bt).replace(ve,tt));if(tt===nt&&H[bt+1]===nt)bt++;else if(tt===nt||bt===0||H[bt-1]!==nt){Ct!==-1&&Ct<bt+1&&(Ct=H.indexOf(M,bt+1));var jt=Ae((Dt=Dt!==-1&&Dt<bt+1?H.indexOf(O,bt+1):Dt)===-1?Ct:Math.min(Ct,Dt));if(H.substr(bt+1+jt,G)===M){dt.push(H.substring(et,bt).replace(ve,tt)),H[et=bt+1+jt+G]!==tt&&(bt=H.indexOf(tt,et)),Ct=H.indexOf(M,et),Dt=H.indexOf(O,et);break}if(jt=Ae(Dt),H.substring(bt+1+jt,bt+1+jt+$)===O){if(dt.push(H.substring(et,bt).replace(ve,tt)),ln(bt+1+jt+$),Ct=H.indexOf(M,et),bt=H.indexOf(tt,et),ot&&(Le(),at))return Vt();if(it&&lt.length>=it)return Vt(!0);break}pt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:lt.length,index:et}),bt++}}else if(z&&dt.length===0&&H.substring(et,et+st)===z){if(Dt===-1)return Vt();et=Dt+$,Dt=H.indexOf(O,et),Ct=H.indexOf(M,et)}else if(Ct!==-1&&(Ct<Dt||Dt===-1))dt.push(H.substring(et,Ct)),et=Ct+G,Ct=H.indexOf(M,et);else{if(Dt===-1)break;if(dt.push(H.substring(et,Dt)),ln(Dt+$),ot&&(Le(),at))return Vt();if(it&&lt.length>=it)return Vt(!0)}return oe();function Oe(ie){lt.push(ie),It=et}function Ae(ie){var Se=0;return Se=ie!==-1&&(ie=H.substring(bt+1,ie))&&ie.trim()===""?ie.length:Se}function oe(ie){return X||(ie===void 0&&(ie=H.substring(et)),dt.push(ie),et=_t,Oe(dt),ot&&Le()),Vt()}function ln(ie){et=ie,Oe(dt),dt=[],Dt=H.indexOf(O,et)}function Vt(ie){if(T.header&&!q&&lt.length&&!j){var Se=lt[0],Ee=Object.create(null),gn=new Set(Se);let zi=!1;for(let Dn=0;Dn<Se.length;Dn++){let Ye=d(Se[Dn]);if(Ee[Ye=N(T.transformHeader)?T.transformHeader(Ye,Dn):Ye]){let In,ci=Ee[Ye];for(;In=Ye+"_"+ci,ci++,gn.has(In););gn.add(In),Se[Dn]=In,Ee[Ye]++,zi=!0,(ft=ft===null?{}:ft)[In]=Ye}else Ee[Ye]=1,Se[Dn]=Ye;gn.add(Ye)}zi&&console.warn("Duplicate headers found and renamed."),j=!0}return{data:lt,errors:pt,meta:{delimiter:M,linebreak:O,aborted:at,truncated:!!ie,cursor:It+(q||0),renamedHeaders:ft}}}function Le(){W(Vt()),lt=[],pt=[]}},this.abort=function(){at=!0},this.getCharIndex=function(){return et}}function E(T){var M=T.data,O=a[M.workerId],z=!1;if(M.error)O.userError(M.error,M.file);else if(M.results&&M.results.data){var W={abort:function(){z=!0,B(M.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(N(O.userStep)){for(var it=0;it<M.results.data.length&&(O.userStep({data:M.results.data[it],errors:M.results.errors,meta:M.results.meta},W),!z);it++);delete M.results}else N(O.userChunk)&&(O.userChunk(M.results,W,M.file),delete M.results)}M.finished&&!z&&B(M.workerId,M.results)}function B(T,M){var O=a[T];N(O.userComplete)&&O.userComplete(M),O.terminate(),delete a[T]}function P(){throw new Error("Not implemented.")}function L(T){if(typeof T!="object"||T===null)return T;var M,O=Array.isArray(T)?[]:{};for(M in T)O[M]=L(T[M]);return O}function I(T,M){return function(){T.apply(M,arguments)}}function N(T){return typeof T=="function"}return u.parse=function(T,M){var O=(M=M||{}).dynamicTyping||!1;if(N(O)&&(M.dynamicTypingFunction=O,O={}),M.dynamicTyping=O,M.transform=!!N(M.transform)&&M.transform,M.downloadTimeout!==void 0){var O=parseInt(M.downloadTimeout);if(isNaN(O))throw new Error("Config downloadTimeout value ("+M.downloadTimeout+") not parsable by parseInt(val).");M.downloadTimeout=O}if(!M.worker||!u.WORKERS_SUPPORTED)return O=null,u.NODE_STREAM_INPUT,typeof T=="string"?(T=d(T),O=new(M.download?g:_)(M)):T.readable===!0&&N(T.read)&&N(T.on)?O=new x(M):(i.File&&T instanceof File||T instanceof Object)&&(O=new m(M)),O.stream(T);(O=(()=>{var z;return!!u.WORKERS_SUPPORTED&&(z=(()=>{var W=i.URL||i.webkitURL||null,it=e.toString();return u.BLOB_URL||(u.BLOB_URL=W.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; ","(",it,")();"],{type:"text/javascript"})))})(),(z=new i.Worker(z)).onmessage=E,z.id=l++,a[z.id]=z)})()).userStep=M.step,O.userChunk=M.chunk,O.userComplete=M.complete,O.userError=M.error,M.step=N(M.step),M.chunk=N(M.chunk),M.complete=N(M.complete),M.error=N(M.error),delete M.worker,O.postMessage({input:T,config:M,workerId:O.id})},u.unparse=function(T,M){var O=!1,z=!0,W=",",it=`\r
34
34
  `,ut='"',ft=ut+ut,j=!1,tt=null,nt=!1,et=((()=>{if(typeof M=="object"){if(typeof M.delimiter!="string"||u.BAD_DELIMITERS.filter(function(q){return M.delimiter.indexOf(q)!==-1}).length||(W=M.delimiter),typeof M.quotes!="boolean"&&typeof M.quotes!="function"&&!Array.isArray(M.quotes)||(O=M.quotes),typeof M.skipEmptyLines!="boolean"&&typeof M.skipEmptyLines!="string"||(j=M.skipEmptyLines),typeof M.newline=="string"&&(it=M.newline),typeof M.quoteChar=="string"&&(ut=M.quoteChar,ft=ut+ut),typeof M.header=="boolean"&&(z=M.header),Array.isArray(M.columns)){if(M.columns.length===0)throw new Error("Option columns is empty");tt=M.columns}M.escapeChar!==void 0&&(ft=M.escapeChar+ut),M.escapeFormulae instanceof RegExp?nt=M.escapeFormulae:typeof M.escapeFormulae=="boolean"&&M.escapeFormulae&&(nt=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(ut),"g"));if(typeof T=="string"&&(T=JSON.parse(T)),Array.isArray(T)){if(!T.length||Array.isArray(T[0]))return at(null,T,j);if(typeof T[0]=="object")return at(tt||Object.keys(T[0]),T,j)}else if(typeof T=="object")return typeof T.data=="string"&&(T.data=JSON.parse(T.data)),Array.isArray(T.data)&&(T.fields||(T.fields=T.meta&&T.meta.fields||tt),T.fields||(T.fields=Array.isArray(T.data[0])?T.fields:typeof T.data[0]=="object"?Object.keys(T.data[0]):[]),Array.isArray(T.data[0])||typeof T.data[0]=="object"||(T.data=[T.data])),at(T.fields||[],T.data||[],j);throw new Error("Unable to serialize unrecognized input");function at(q,X,_t){var G="",$=(typeof q=="string"&&(q=JSON.parse(q)),typeof X=="string"&&(X=JSON.parse(X)),Array.isArray(q)&&0<q.length),st=!Array.isArray(X[0]);if($&&z){for(var ot=0;ot<q.length;ot++)0<ot&&(G+=W),G+=H(q[ot],ot);0<X.length&&(G+=it)}for(var lt=0;lt<X.length;lt++){var pt=($?q:X[lt]).length,dt=!1,It=$?Object.keys(X[lt]).length===0:X[lt].length===0;if(_t&&!$&&(dt=_t==="greedy"?X[lt].join("").trim()==="":X[lt].length===1&&X[lt][0].length===0),_t==="greedy"&&$){for(var zt=[],vt=0;vt<pt;vt++){var Ct=st?q[vt]:vt;zt.push(X[lt][Ct])}dt=zt.join("").trim()===""}if(!dt){for(var Dt=0;Dt<pt;Dt++){0<Dt&&!It&&(G+=W);var ve=$&&st?q[Dt]:Dt;G+=H(X[lt][ve],Dt)}lt<X.length-1&&(!_t||0<pt&&!It)&&(G+=it)}}return G}function H(q,X){var _t,G,$;return q==null?"":q.constructor===Date?isNaN(q.getTime())?"":q.toISOString():($=!1,nt&&typeof q=="string"&&nt.test(q)&&(q="'"+q,$=!0),G=(_t=q.toString()).replace(et,ft),($=$||O===!0||typeof O=="function"&&O(q,X)||Array.isArray(O)&&O[X]||((st,ot)=>{for(var lt=0;lt<ot.length;lt++)if(-1<st.indexOf(ot[lt]))return!0;return!1})(G,u.BAD_DELIMITERS)||-1<G.indexOf(W)||-1<_t.indexOf(ut)||G.charAt(0)===" "||G.charAt(G.length-1)===" ")?ut+G+ut:G)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
35
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=g,u.FileStreamer=m,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(T){T=T.data,u.WORKER_ID===void 0&&T&&(u.WORKER_ID=T.workerId),typeof T.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(T.input,T.config),finished:!0}):(i.File&&T.input instanceof File||T.input instanceof Object)&&(T=u.parse(T.input,T.config))&&i.postMessage({workerId:u.WORKER_ID,results:T,finished:!0})}),(g.prototype=Object.create(h.prototype)).constructor=g,(m.prototype=Object.create(h.prototype)).constructor=m,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(hl)),hl.exports}var aL=oL();const lL=["id"],cL=p.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,r=p.computed(()=>`export_${new Date().getTime()}`),s=p.computed(()=>{const h=u();return h.length?h:null}),a=()=>{const h=i.labels;if(typeof i.fields!==pr.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof h===pr.Object?g=>P_.mapKeys(g,(m,_)=>h[_]||_):g=>g},l=()=>{const h=i.fields;if(typeof i.fields!==pr.Object&&!Array.isArray(h))throw new Error("Fields needs to be an array of strings.");return Array.isArray(h)?g=>P_.pick(g,h):g=>g},u=()=>{if(typeof i.fields===pr.Undefined&&typeof i.labels===pr.Undefined)return i.data;const h=a(),g=l();return i.data.map(m=>h(g(m)))},d=()=>{if(!s?.value){console.warn("No data to export");return}e("export-started",s.value);let h=aL.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),e("export-finished",i.filename),!i.testing){const g=new Blob([h],{type:"text/csv;charset="+i.encoding});rL.saveAs(g,i.filename)}};return(h,g)=>(p.openBlock(),p.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[p.renderSlot(h.$slots,"default",{},()=>[p.createTextVNode("Download "+p.toDisplayString(n.filename),1)])],8,lL))}}),uL=p.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=p.computed(()=>Object.keys(t.headers));return(i,r)=>(p.openBlock(),p.createElementBlock("div",null,[p.createVNode(cL,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:p.withCtx(()=>[p.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),dL={class:"kong-ui-public-csv-export-modal"},fL={key:0,class:"selected-range"},hL={key:4,class:"text-muted",tag:"span"},N_=3,pL=p.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=kt.useI18n(),i=n,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=p.ref(1),l=p.computed(()=>m.value.rows.length),u=p.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=p.computed(()=>i.exportState.status!=="success"?"":kt.useChartSelectedRange(p.toRef(i.exportState,"chartData"))),h=p.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(N_,l.value),rowsTotal:l.value,plural:l.value===1?"":"s"})),g=()=>{r("closeModal")},m=p.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(L=>L.timestamp!==x.data[0].timestamp),S=x.data.map(L=>{const I=new Date(L.timestamp);return{...Object.keys(L.event).reduce((T,M)=>{if(M in x.meta.display){const O=L.event[M],z=x.meta.display[M];T[M]=O&&z&&z[O].name||L.event[M]}else T[M]=L.event[M];return T},{}),...v?{timestamp:Wu(I,"yyyy-MM-dd HH:mm:ss"),tzOffset:Wu(I,"XXX")}:{}}});let C=[];v&&(C=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const R="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},B=[...C,...Object.keys(R).map(L=>({label:e.t(`chartLabels.${L}`),key:L})),...i.exportState.chartData.meta.metric_names.map(L=>({label:e.t(`chartLabels.${L}`),key:L}))],P=B.reduce((L,I)=>(L[I.key]=I.label,L),{});return{headers:B,csvHeaders:P,rows:S}}),_=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=m.value;return{total:Number(x.length)||0,data:x.slice(0,N_)}};return p.watch(m,()=>{a.value++}),(x,v)=>{const S=p.resolveComponent("KSkeleton"),C=p.resolveComponent("KEmptyState"),R=p.resolveComponent("KTableData"),B=p.resolveComponent("KTooltip"),P=p.resolveComponent("KButton"),L=p.resolveComponent("KModal");return p.openBlock(),p.createElementBlock("div",dL,[p.createVNode(L,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:p.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:g,onKeyup:p.withKeys(g,["esc"])},{default:p.withCtx(()=>[p.createElementVNode("div",null,[n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",fL,[p.createElementVNode("p",null,p.toDisplayString(n.modalDescription?n.modalDescription:p.unref(e).t("csvExport.exportDescription")),1),p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.exportTimeRange"))+": "+p.toDisplayString(d.value),1)])):p.createCommentVNode("",!0),n.exportState.status==="loading"?(p.openBlock(),p.createBlock(S,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(p.openBlock(),p.createBlock(R,{key:2,class:"vitals-table",fetcher:_,"fetcher-cache-key":String(a.value),headers:m.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":p.withCtx(()=>[p.createVNode(C,{"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRange")),1)]),default:p.withCtx(()=>[p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(p.openBlock(),p.createBlock(C,{key:3,"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.dataError")),1)]),_:1})):p.createCommentVNode("",!0),n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",hL,[p.createTextVNode(p.toDisplayString(h.value)+" ",1),p.createVNode(B,{class:"preview-tooltip",placement:"right",text:p.unref(e).t("csvExport.maximumRecordAmount",{value:p.unref(1e3)})},{default:p.withCtx(()=>[p.createVNode(p.unref(Ts.InfoIcon),{color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])]),_:1},8,["text"])])):p.createCommentVNode("",!0)])]),"footer-actions":p.withCtx(()=>[p.createVNode(P,{appearance:"tertiary",class:"cancel-btn",onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.cancelButton")),1)]),_:1}),p.createVNode(uL,{class:"vitals-report-export-button",filename:s,headers:m.value.csvHeaders,rows:m.value.rows},{default:p.withCtx(()=>[p.createVNode(P,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!u.value},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});Yt.AnalyticsChart=vI,Yt.ChartLegendPosition=Pe,Yt.CsvExportModal=pL,Yt.DECIMAL_DISPLAY=TR,Yt.FONT_SIZE_REGULAR=iy,Yt.FONT_SIZE_SMALL=ny,Yt.MAX_LABEL_LENGTH=Za,Yt.SimpleChart=FI,Yt.SparklineChart=JI,Yt.TopNTable=KI,Yt.ValidType=pr,Yt.chartTypes=ME,Yt.exploreResultToScatterData=Ty,Yt.handleQueryError=yE,Yt.isCancellationError=vy,Yt.isScatterChartData=tl,Yt.lookupStatusCodeColor=sy,Yt.requestsToScatterData=vE,Yt.simpleChartMetricDisplay=TE,Yt.simpleChartTypes=kE,Yt.statusCodeBadgeBackgroundColor=DR,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})}));
36
+ `+h),i.encoding==="utf-8"&&(h="\uFEFF"+h),e("export-finished",i.filename),!i.testing){const g=new Blob([h],{type:"text/csv;charset="+i.encoding});rL.saveAs(g,i.filename)}};return(h,g)=>(p.openBlock(),p.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[p.renderSlot(h.$slots,"default",{},()=>[p.createTextVNode("Download "+p.toDisplayString(n.filename),1)])],8,lL))}}),uL=p.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=p.computed(()=>Object.keys(t.headers));return(i,r)=>(p.openBlock(),p.createElementBlock("div",null,[p.createVNode(cL,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:p.withCtx(()=>[p.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),dL={class:"kong-ui-public-csv-export-modal"},fL={key:0,class:"selected-range"},hL={key:4,class:"text-muted",tag:"span"},N_=3,pL=p.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=kt.useI18n(),i=n,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=p.ref(1),l=p.computed(()=>m.value.rows.length),u=p.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=p.computed(()=>i.exportState.status!=="success"?"":kt.useChartSelectedRange(p.toRef(i.exportState,"chartData"))),h=p.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(N_,l.value),rowsTotal:l.value,plural:l.value===1?"":"s"})),g=()=>{r("closeModal")},m=p.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(L=>L.timestamp!==x.data[0].timestamp),S=x.data.map(L=>{const I=new Date(L.timestamp);return{...Object.keys(L.event).reduce((T,M)=>{if(M in x.meta.display){const O=L.event[M],z=x.meta.display[M];T[M]=O&&z&&z[O].name||L.event[M]}else T[M]=L.event[M];return T},{}),...v?{timestamp:Wu(I,"yyyy-MM-dd HH:mm:ss"),tzOffset:Wu(I,"XXX")}:{}}});let C=[];v&&(C=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const E="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},B=[...C,...Object.keys(E).map(L=>({label:e.t(`chartLabels.${L}`),key:L})),...i.exportState.chartData.meta.metric_names.map(L=>({label:e.t(`chartLabels.${L}`),key:L}))],P=B.reduce((L,I)=>(L[I.key]=I.label,L),{});return{headers:B,csvHeaders:P,rows:S}}),_=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=m.value;return{total:Number(x.length)||0,data:x.slice(0,N_)}};return p.watch(m,()=>{a.value++}),(x,v)=>{const S=p.resolveComponent("KSkeleton"),C=p.resolveComponent("KEmptyState"),E=p.resolveComponent("KTableData"),B=p.resolveComponent("KTooltip"),P=p.resolveComponent("KButton"),L=p.resolveComponent("KModal");return p.openBlock(),p.createElementBlock("div",dL,[p.createVNode(L,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:p.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:g,onKeyup:p.withKeys(g,["esc"])},{default:p.withCtx(()=>[p.createElementVNode("div",null,[n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",fL,[p.createElementVNode("p",null,p.toDisplayString(n.modalDescription?n.modalDescription:p.unref(e).t("csvExport.exportDescription")),1),p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.exportTimeRange"))+": "+p.toDisplayString(d.value),1)])):p.createCommentVNode("",!0),n.exportState.status==="loading"?(p.openBlock(),p.createBlock(S,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(p.openBlock(),p.createBlock(E,{key:2,class:"vitals-table",fetcher:_,"fetcher-cache-key":String(a.value),headers:m.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":p.withCtx(()=>[p.createVNode(C,{"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRange")),1)]),default:p.withCtx(()=>[p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(p.openBlock(),p.createBlock(C,{key:3,"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.dataError")),1)]),_:1})):p.createCommentVNode("",!0),n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",hL,[p.createTextVNode(p.toDisplayString(h.value)+" ",1),p.createVNode(B,{class:"preview-tooltip",placement:"right",text:p.unref(e).t("csvExport.maximumRecordAmount",{value:p.unref(1e3)})},{default:p.withCtx(()=>[p.createVNode(p.unref(Ts.InfoIcon),{color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])]),_:1},8,["text"])])):p.createCommentVNode("",!0)])]),"footer-actions":p.withCtx(()=>[p.createVNode(P,{appearance:"tertiary",class:"cancel-btn",onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.cancelButton")),1)]),_:1}),p.createVNode(uL,{class:"vitals-report-export-button",filename:s,headers:m.value.csvHeaders,rows:m.value.rows},{default:p.withCtx(()=>[p.createVNode(P,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!u.value},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});Yt.AnalyticsChart=vI,Yt.ChartLegendPosition=Pe,Yt.CsvExportModal=pL,Yt.DECIMAL_DISPLAY=TE,Yt.FONT_SIZE_REGULAR=iy,Yt.FONT_SIZE_SMALL=ny,Yt.MAX_LABEL_LENGTH=Za,Yt.SimpleChart=FI,Yt.SparklineChart=JI,Yt.TopNTable=KI,Yt.ValidType=pr,Yt.chartTypes=MR,Yt.exploreResultToScatterData=Ty,Yt.handleQueryError=yR,Yt.isCancellationError=vy,Yt.isScatterChartData=tl,Yt.lookupStatusCodeColor=sy,Yt.requestsToScatterData=vR,Yt.simpleChartMetricDisplay=TR,Yt.simpleChartTypes=kR,Yt.statusCodeBadgeBackgroundColor=DE,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})}));