@kong-ui-public/analytics-chart 10.34.3-pr.3869.e876c8c8a.0 → 10.34.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/style.css +1 -0
  2. package/dist/types/components/AnalyticsChart.vue.d.ts +41 -0
  3. package/dist/types/components/AnalyticsChart.vue.d.ts.map +1 -0
  4. package/dist/types/components/CsvExportModal.vue.d.ts +16 -0
  5. package/dist/types/components/CsvExportModal.vue.d.ts.map +1 -0
  6. package/dist/types/components/DownloadCsv.vue.d.ts +20 -0
  7. package/dist/types/components/DownloadCsv.vue.d.ts.map +1 -0
  8. package/dist/types/components/SimpleChart.vue.d.ts +74 -0
  9. package/dist/types/components/SimpleChart.vue.d.ts.map +1 -0
  10. package/dist/types/components/SparklineChart.vue.d.ts +95 -0
  11. package/dist/types/components/SparklineChart.vue.d.ts.map +1 -0
  12. package/dist/types/components/TopNTable.vue.d.ts +59 -0
  13. package/dist/types/components/TopNTable.vue.d.ts.map +1 -0
  14. package/dist/types/components/ZoomActions.vue.d.ts +15 -0
  15. package/dist/types/components/ZoomActions.vue.d.ts.map +1 -0
  16. package/dist/types/components/ZoomTimerange.vue.d.ts +10 -0
  17. package/dist/types/components/ZoomTimerange.vue.d.ts.map +1 -0
  18. package/dist/types/components/chart-plugins/ChartLegend.vue.d.ts +36 -0
  19. package/dist/types/components/chart-plugins/ChartLegend.vue.d.ts.map +1 -0
  20. package/dist/types/components/chart-plugins/ChartTooltip.vue.d.ts +34 -0
  21. package/dist/types/components/chart-plugins/ChartTooltip.vue.d.ts.map +1 -0
  22. package/dist/types/components/chart-plugins/DragSelectPlugin.d.ts +22 -0
  23. package/dist/types/components/chart-plugins/DragSelectPlugin.d.ts.map +1 -0
  24. package/dist/types/components/chart-plugins/HighlightPlugin.d.ts +18 -0
  25. package/dist/types/components/chart-plugins/HighlightPlugin.d.ts.map +1 -0
  26. package/dist/types/components/chart-plugins/OutlierBandPlugin.d.ts +14 -0
  27. package/dist/types/components/chart-plugins/OutlierBandPlugin.d.ts.map +1 -0
  28. package/dist/types/components/chart-plugins/ReferenceLinePlugin.d.ts +12 -0
  29. package/dist/types/components/chart-plugins/ReferenceLinePlugin.d.ts.map +1 -0
  30. package/dist/types/components/chart-plugins/ThresholdPlugin.d.ts +33 -0
  31. package/dist/types/components/chart-plugins/ThresholdPlugin.d.ts.map +1 -0
  32. package/dist/types/components/chart-plugins/VerticalLinePlugin.d.ts +29 -0
  33. package/dist/types/components/chart-plugins/VerticalLinePlugin.d.ts.map +1 -0
  34. package/dist/types/components/chart-types/DonutChart.vue.d.ts +30 -0
  35. package/dist/types/components/chart-types/DonutChart.vue.d.ts.map +1 -0
  36. package/dist/types/components/chart-types/GaugeChart.vue.d.ts +92 -0
  37. package/dist/types/components/chart-types/GaugeChart.vue.d.ts.map +1 -0
  38. package/dist/types/components/chart-types/ScatterChart.vue.d.ts +40 -0
  39. package/dist/types/components/chart-types/ScatterChart.vue.d.ts.map +1 -0
  40. package/dist/types/components/chart-types/SingleValue.vue.d.ts +69 -0
  41. package/dist/types/components/chart-types/SingleValue.vue.d.ts.map +1 -0
  42. package/dist/types/components/chart-types/StackedBarChart.vue.d.ts +33 -0
  43. package/dist/types/components/chart-types/StackedBarChart.vue.d.ts.map +1 -0
  44. package/dist/types/components/chart-types/TimeSeriesChart.vue.d.ts +52 -0
  45. package/dist/types/components/chart-types/TimeSeriesChart.vue.d.ts.map +1 -0
  46. package/dist/types/components/top-n/TopNMetricBar.vue.d.ts +9 -0
  47. package/dist/types/components/top-n/TopNMetricBar.vue.d.ts.map +1 -0
  48. package/dist/types/components/top-n/TopNMetricCell.vue.d.ts +11 -0
  49. package/dist/types/components/top-n/TopNMetricCell.vue.d.ts.map +1 -0
  50. package/dist/types/components/vue-json-csv/VueJsonCsv.vue.d.ts +166 -0
  51. package/dist/types/components/vue-json-csv/VueJsonCsv.vue.d.ts.map +1 -0
  52. package/dist/types/composables/index.d.ts +35 -0
  53. package/dist/types/composables/index.d.ts.map +1 -0
  54. package/dist/types/composables/useBarChartOptions.d.ts +118 -0
  55. package/dist/types/composables/useBarChartOptions.d.ts.map +1 -0
  56. package/dist/types/composables/useChartJSCommon.d.ts +5 -0
  57. package/dist/types/composables/useChartJSCommon.d.ts.map +1 -0
  58. package/dist/types/composables/useChartLegendValues.d.ts +6 -0
  59. package/dist/types/composables/useChartLegendValues.d.ts.map +1 -0
  60. package/dist/types/composables/useChartSelectedRange.d.ts +4 -0
  61. package/dist/types/composables/useChartSelectedRange.d.ts.map +1 -0
  62. package/dist/types/composables/useDonutChartOptions.d.ts +42 -0
  63. package/dist/types/composables/useDonutChartOptions.d.ts.map +1 -0
  64. package/dist/types/composables/useEvaluateFeatureFlag.d.ts +4 -0
  65. package/dist/types/composables/useEvaluateFeatureFlag.d.ts.map +1 -0
  66. package/dist/types/composables/useExploreResultToDatasets.d.ts +5 -0
  67. package/dist/types/composables/useExploreResultToDatasets.d.ts.map +1 -0
  68. package/dist/types/composables/useExploreResultToTimeDatasets.d.ts +6 -0
  69. package/dist/types/composables/useExploreResultToTimeDatasets.d.ts.map +1 -0
  70. package/dist/types/composables/useI18n.d.ts +9 -0
  71. package/dist/types/composables/useI18n.d.ts.map +1 -0
  72. package/dist/types/composables/useLineChartOptions.d.ts +115 -0
  73. package/dist/types/composables/useLineChartOptions.d.ts.map +1 -0
  74. package/dist/types/composables/useReportChartDataForSynthetics.d.ts +9 -0
  75. package/dist/types/composables/useReportChartDataForSynthetics.d.ts.map +1 -0
  76. package/dist/types/composables/useScatterChartOptions.d.ts +139 -0
  77. package/dist/types/composables/useScatterChartOptions.d.ts.map +1 -0
  78. package/dist/types/composables/useScatterDatasets.d.ts +18 -0
  79. package/dist/types/composables/useScatterDatasets.d.ts.map +1 -0
  80. package/dist/types/composables/useSparklineSync.d.ts +30 -0
  81. package/dist/types/composables/useSparklineSync.d.ts.map +1 -0
  82. package/dist/types/composables/useTooltipAbsolutePosition.d.ts +9 -0
  83. package/dist/types/composables/useTooltipAbsolutePosition.d.ts.map +1 -0
  84. package/dist/types/composables/useTranslatedUnits.d.ts +4 -0
  85. package/dist/types/composables/useTranslatedUnits.d.ts.map +1 -0
  86. package/dist/types/constants/index.d.ts +4 -0
  87. package/dist/types/constants/index.d.ts.map +1 -0
  88. package/dist/types/enums/chart-legend-position.enum.d.ts +5 -0
  89. package/dist/types/enums/chart-legend-position.enum.d.ts.map +1 -0
  90. package/dist/types/enums/index.d.ts +2 -0
  91. package/dist/types/enums/index.d.ts.map +1 -0
  92. package/dist/types/index.d.ts +19 -0
  93. package/dist/types/index.d.ts.map +1 -0
  94. package/dist/types/types/chart-data.d.ts +279 -0
  95. package/dist/types/types/chart-data.d.ts.map +1 -0
  96. package/dist/types/types/chart-export.d.ts +20 -0
  97. package/dist/types/types/chart-export.d.ts.map +1 -0
  98. package/dist/types/types/chart-meta.d.ts +6 -0
  99. package/dist/types/types/chart-meta.d.ts.map +1 -0
  100. package/dist/types/types/chart-types.d.ts +6 -0
  101. package/dist/types/types/chart-types.d.ts.map +1 -0
  102. package/dist/types/types/chartjs-options.d.ts +84 -0
  103. package/dist/types/types/chartjs-options.d.ts.map +1 -0
  104. package/dist/types/types/dataset-generation-types.d.ts +15 -0
  105. package/dist/types/types/dataset-generation-types.d.ts.map +1 -0
  106. package/dist/types/types/explore-to-dataset-deps.d.ts +18 -0
  107. package/dist/types/types/explore-to-dataset-deps.d.ts.map +1 -0
  108. package/dist/types/types/external-link.d.ts +4 -0
  109. package/dist/types/types/external-link.d.ts.map +1 -0
  110. package/dist/types/types/index.d.ts +12 -0
  111. package/dist/types/types/index.d.ts.map +1 -0
  112. package/dist/types/types/query-error.d.ts +7 -0
  113. package/dist/types/types/query-error.d.ts.map +1 -0
  114. package/dist/types/types/scatter-data.d.ts +38 -0
  115. package/dist/types/types/scatter-data.d.ts.map +1 -0
  116. package/dist/types/types/zoom-action-item.d.ts +9 -0
  117. package/dist/types/types/zoom-action-item.d.ts.map +1 -0
  118. package/dist/types/utils/bucketTimestamps.d.ts +8 -0
  119. package/dist/types/utils/bucketTimestamps.d.ts.map +1 -0
  120. package/dist/types/utils/colors.d.ts +8 -0
  121. package/dist/types/utils/colors.d.ts.map +1 -0
  122. package/dist/types/utils/commonOptions.d.ts +22 -0
  123. package/dist/types/utils/commonOptions.d.ts.map +1 -0
  124. package/dist/types/utils/constants.d.ts +5 -0
  125. package/dist/types/utils/constants.d.ts.map +1 -0
  126. package/dist/types/utils/customColors.d.ts +8 -0
  127. package/dist/types/utils/customColors.d.ts.map +1 -0
  128. package/dist/types/utils/defaultLineOptions.d.ts +9 -0
  129. package/dist/types/utils/defaultLineOptions.d.ts.map +1 -0
  130. package/dist/types/utils/dimension-icons.d.ts +5 -0
  131. package/dist/types/utils/dimension-icons.d.ts.map +1 -0
  132. package/dist/types/utils/format-timestamps.d.ts +13 -0
  133. package/dist/types/utils/format-timestamps.d.ts.map +1 -0
  134. package/dist/types/utils/i18n.d.ts +3 -0
  135. package/dist/types/utils/i18n.d.ts.map +1 -0
  136. package/dist/types/utils/index.d.ts +14 -0
  137. package/dist/types/utils/index.d.ts.map +1 -0
  138. package/dist/types/utils/metric-units.d.ts +3 -0
  139. package/dist/types/utils/metric-units.d.ts.map +1 -0
  140. package/dist/types/utils/percentiles.d.ts +3 -0
  141. package/dist/types/utils/percentiles.d.ts.map +1 -0
  142. package/dist/types/utils/queryError.d.ts +4 -0
  143. package/dist/types/utils/queryError.d.ts.map +1 -0
  144. package/dist/types/utils/scatter-adapters.d.ts +25 -0
  145. package/dist/types/utils/scatter-adapters.d.ts.map +1 -0
  146. package/dist/types/utils/stackedBarUtil.d.ts +9 -0
  147. package/dist/types/utils/stackedBarUtil.d.ts.map +1 -0
  148. package/dist/types/utils/theme-colors.d.ts +8 -0
  149. package/dist/types/utils/theme-colors.d.ts.map +1 -0
  150. package/dist/types/utils/topn-columns.d.ts +16 -0
  151. package/dist/types/utils/topn-columns.d.ts.map +1 -0
  152. package/dist/vitals-chart.es.js +26658 -0
  153. package/dist/vitals-chart.umd.js +36 -0
  154. package/package.json +2 -2
@@ -0,0 +1,36 @@
1
+ (function(Yt,h){typeof exports=="object"&&typeof module<"u"?h(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"],h):(Yt=typeof globalThis<"u"?globalThis:Yt||self,h(Yt["kong-ui-publicvitals-chart"]={},Yt.Vue,Yt.KongIcons,Yt["kong-ui-public-i18n"],Yt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Yt,h,de,Jf,tr){"use strict";var mt=(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))(mt||{});const tx=["in","not_in","selector"],ex=["empty","not_empty"],nx=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],er=n=>n.filter(t=>t!=="time"),th=["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"],eh=er(th),ix=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],nh=[...th,"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"],ih=er(nh),rx=[...ix,"share_of_requests","cache_hit_rate","response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],sx=["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"],rh=er(sx),ox=["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"],ax=er(ox),lx=["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"],cx=lx,ux=["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"],dx=er(ux),fx=["platform","platform_usage"],hx=n=>fx.includes(n),px=[...nh.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"],sh=er(px);[...rx];const mx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],oh=er(mx);new Set(eh),new Set(ih),new Set(rh),new Set(sh),new Set(oh);const ah=[{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"}];ah.map(n=>n.code);const lh=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:tx},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:ex}},required:["field","operator"],additionalProperties:!1}]}}),gx=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];lh(Array.from(new Set([...ax,...cx,...dx]))),lh([...new Set([...ih,...eh,...rh,...sh,...gx,...oh])]);const yx={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"}},_x=(n,t,e)=>{let i;const r=yx[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 bc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const bx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vx={date:bc({formats:bx,defaultWidth:"full"}),time:bc({formats:xx,defaultWidth:"full"}),dateTime:bc({formats:wx,defaultWidth:"full"})},Sx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tx=(n,t,e,i)=>Sx[n];function Ds(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 Mx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Dx={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"]},Cx={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"]},Ox={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"}},Ax={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"}},Ex=(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"},Rx={ordinalNumber:Ex,era:Ds({values:Mx,defaultWidth:"wide"}),quarter:Ds({values:kx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ds({values:Dx,defaultWidth:"wide"}),day:Ds({values:Cx,defaultWidth:"wide"}),dayPeriod:Ds({values:Ox,defaultWidth:"wide",formattingValues:Ax,defaultFormattingWidth:"wide"})};function Cs(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)?Ix(l,m=>m.test(a)):Px(l,m=>m.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const p=t.slice(a.length);return{value:d,rest:p}}}function Px(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ix(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Lx(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 Nx=/^(\d+)(th|st|nd|rd)?/i,Bx=/\d+/i,Fx={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},zx={any:[/^b/i,/^(a|c)/i]},Ux={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Hx={any:[/1/i,/2/i,/3/i,/4/i]},Wx={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},$x={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]},Vx={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},Yx={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]},qx={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},jx={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}},Gx={ordinalNumber:Lx({matchPattern:Nx,parsePattern:Bx,valueCallback:n=>parseInt(n,10)}),era:Cs({matchPatterns:Fx,defaultMatchWidth:"wide",parsePatterns:zx,defaultParseWidth:"any"}),quarter:Cs({matchPatterns:Ux,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Cs({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any"}),day:Cs({matchPatterns:Vx,defaultMatchWidth:"wide",parsePatterns:Yx,defaultParseWidth:"any"}),dayPeriod:Cs({matchPatterns:qx,defaultMatchWidth:"any",parsePatterns:jx,defaultParseWidth:"any"})},Kx={code:"en-US",formatDistance:_x,formatLong:vx,formatRelative:Tx,localize:Rx,match:Gx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Xx={};function Os(){return Xx}const ch=6048e5,Zx=864e5,Qx=60,Jx=3600,uh=Symbol.for("constructDateFrom");function Tn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&uh in n?n[uh](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ue(n,t){return Tn(t||n,n)}function dh(n){const t=Ue(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 tw(n,...t){const e=Tn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ir(n,t){const e=Ue(n,t?.in);return e.setHours(0,0,0,0),e}function ew(n,t,e){const[i,r]=tw(e?.in,n,t),s=Ir(i),a=Ir(r),l=+s-dh(s),u=+a-dh(a);return Math.round((l-u)/Zx)}function nw(n,t){const e=Ue(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function iw(n,t){const e=Ue(n,t?.in);return ew(e,nw(e))+1}function ei(n,t){const e=Os(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ue(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 ta(n,t){return ei(n,{...t,weekStartsOn:1})}function fh(n,t){const e=Ue(n,t?.in),i=e.getFullYear(),r=Tn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=ta(r),a=Tn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=ta(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function rw(n,t){const e=fh(n,t),i=Tn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ta(i)}function sw(n,t){const e=Ue(n,t?.in),i=+ta(e)-+rw(e);return Math.round(i/ch)+1}function hh(n,t){const e=Ue(n,t?.in),i=e.getFullYear(),r=Os(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Tn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=ei(a,t),u=Tn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=ei(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function ow(n,t){const e=Os(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=hh(n,t),s=Tn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ei(s,t)}function aw(n,t){const e=Ue(n,t?.in),i=+ei(e,t)-+ow(e,t);return Math.round(i/ch)+1}function Xt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Si={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)}},Lr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ph={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 Si.y(n,t)},Y:function(n,t,e,i){const r=hh(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=fh(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 Si.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=aw(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=sw(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"}):Si.d(n,t)},D:function(n,t,e){const i=iw(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=Lr.noon:i===0?r=Lr.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=Lr.evening:i>=12?r=Lr.afternoon:i>=4?r=Lr.morning:r=Lr.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 Si.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Si.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"}):Si.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Si.s(n,t)},S:function(n,t){return Si.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return gh(i);case"XXXX":case"XX":return nr(i);default:return nr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return gh(i);case"xxxx":case"xx":return nr(i);default:return nr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mh(i,":");default:return"GMT"+nr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mh(i,":");default:return"GMT"+nr(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 mh(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 gh(n,t){return n%60===0?(n>0?"-":"+")+Xt(Math.abs(n)/60,2):nr(n,t)}function nr(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 yh=(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"})}},_h=(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"})}},lw=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return yh(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}}",yh(i,t)).replace("{{time}}",_h(r,t))},cw={p:_h,P:lw},uw=/^D+$/,dw=/^Y+$/,fw=["D","DD","YY","YYYY"];function hw(n){return uw.test(n)}function pw(n){return dw.test(n)}function mw(n,t,e){const i=gw(n,t,e);if(console.warn(i),fw.includes(n))throw new RangeError(i)}function gw(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 yw(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function _w(n){return!(!yw(n)&&typeof n!="number"||isNaN(+Ue(n)))}const bw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ww=/^'([^]*?)'?$/,vw=/''/g,Sw=/[a-zA-Z]/;function Tw(n,t,e){const i=Os(),r=e?.locale??i.locale??Kx,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=Ue(n,e?.in);if(!_w(l))throw new RangeError("Invalid time value");let u=t.match(xw).map(p=>{const m=p[0];if(m==="p"||m==="P"){const g=cw[m];return g(p,r.formatLong)}return p}).join("").match(bw).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:Mw(p)};if(ph[m])return{isToken:!0,value:p};if(m.match(Sw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(p=>{if(!p.isToken)return p.value;const m=p.value;(!e?.useAdditionalWeekYearTokens&&pw(m)||!e?.useAdditionalDayOfYearTokens&&hw(m))&&mw(m,t,String(n));const g=ph[m[0]];return g(l,m,r.localize,d)}).join("")}function Mw(n){const t=n.match(ww);return t?t[1].replace(vw,"'"):n}function ea(n,t,e){const i=Ue(n,e?.in);return isNaN(t)?Tn(n,NaN):(i.setDate(i.getDate()+t),i)}function bh(n,t,e){const i=Ue(n,e?.in);if(isNaN(t))return Tn(n,NaN);if(!t)return i;const r=i.getDate(),s=Tn(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 kw(n,t,e){return bh(n,t*3,e)}function Nr(n,t){const e=Ue(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Br(n,t){const e=Ue(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Dw(n,t){const e=Ue(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Tn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Cw(){return Object.assign({},Os())}function xh(n){return Math.trunc(n*Jx)}function Ow(n){const t=n/Qx;return Math.trunc(t)}function wh(n,t,e){return bh(n,-1,e)}function vh(n,t,e){return kw(n,-1,e)}function Sh(n,t,e){const i=Cw(),r=Rw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?Aw(r,t):Ew(r,t)}function Aw(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 Ew(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Rw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Pw(n,t){const e=Fw(t);return"formatToParts"in e?Lw(e,n):Nw(e,n)}const Iw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Lw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Iw[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 Nw(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 xc={},Th=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")),Bw=Th==="06/25/2014, 00:00:00"||Th==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Fw(n){return xc[n]||(xc[n]=Bw?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"})),xc[n]}function wc(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 Mh=36e5,zw=6e4,vc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function As(n,t,e){if(!n)return 0;let i=vc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=vc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),kh(r)?-(r*Mh):NaN;if(i=vc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return kh(r,a)?(s=Math.abs(r)*Mh+a*zw,i[1]==="+"?-s:s):NaN}if(Ww(n)){t=new Date(t||Date.now());const a=e?t:Uw(t),l=Sc(a,n);return-(e?l:Hw(t,l,n))}return NaN}function Uw(n){return wc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Sc(n,t){const e=Pw(n,t),i=wc(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 Hw(n,t,e){let i=n.getTime()-t;const r=Sc(new Date(i),e);if(t===r)return t;i-=r-t;const s=Sc(new Date(i),e);return r===s?r:Math.max(r,s)}function kh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Dh={};function Ww(n){if(Dh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Dh[n]=!0,!0}catch{return!1}}const $w=60*1e3,Vw={X:function(n,t,e){const i=Tc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return Fr(i);default:return Fr(i,":")}},x:function(n,t,e){const i=Tc(e.timeZone,n);switch(t){case"x":return Ch(i);case"xxxx":case"xx":return Fr(i);default:return Fr(i,":")}},O:function(n,t,e){const i=Tc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Yw(i,":");default:return"GMT"+Fr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Sh("short",n,e);default:return Sh("long",n,e)}}};function Tc(n,t){const e=n?As(n,t,!0)/$w:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function na(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Fr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=na(Math.floor(i/60),2),s=na(Math.floor(i%60),2);return e+r+t+s}function Ch(n,t){return n%60===0?(n>0?"-":"+")+na(Math.abs(n)/60,2):Fr(n,t)}function Yw(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+na(s,2)}function Oh(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 Ah=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Mc=36e5,Eh=6e4,qw=2,Ze={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Ah};function ia(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?qw: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=jw(n),{year:r,restDateString:s}=Gw(i.date,e),a=Kw(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=Xw(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=As(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=Oh(new Date(l+u)),d=Oh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function jw(n){const t={};let e=Ze.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ze.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ze.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Gw(n,t){if(n){const e=Ze.YYY[t],i=Ze.YYYYY[t];let r=Ze.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ze.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 Kw(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=Ze.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Ih(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ze.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return Jw(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ze.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Ih(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ze.Www.exec(n),s)return r=parseInt(s[1],10)-1,Lh(r)?Rh(t,r):new Date(NaN);if(s=Ze.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Lh(r,a)?Rh(t,r,a):new Date(NaN)}return null}function Xw(n){let t,e,i=Ze.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),kc(t)?t%24*Mc:NaN;if(i=Ze.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),kc(t,e)?t%24*Mc+e*Eh:NaN;if(i=Ze.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return kc(t,e,r)?t%24*Mc+e*Eh+r*1e3:NaN}return null}function Rh(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 Zw=[31,28,31,30,31,30,31,31,30,31,30,31],Qw=[31,29,31,30,31,30,31,31,30,31,30,31];function Ph(n){return n%400===0||n%4===0&&n%100!==0}function Ih(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ph(n);if(i&&e>Qw[t]||!i&&e>Zw[t])return!1}return!0}function Jw(n,t){if(t<1)return!1;const e=Ph(n);return!(e&&t>366||!e&&t>365)}function Lh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function kc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const tv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ev(n,t,e={}){t=String(t);const i=t.match(tv);if(i){const r=ia(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,"'"+Vw[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return Tw(n,t,e)}function Nh(n,t,e){n=ia(n,e);const i=As(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 Bh(n,t,e,i){return i={...i,timeZone:t,originalDate:n},ev(Nh(n,t,{timeZone:i.timeZone}),e,i)}function nv(n,t,e){if(typeof n=="string"&&!n.match(Ah))return ia(n,{...e,timeZone:t});n=ia(n,e);const i=wc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=As(t,new Date(i));return new Date(i+r)}function iv(n,t){return-As(n,t)}function Fh(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)"),Bh(n,e,i)}function rv(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 Bh(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const sv={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 ra(n){return n&&nx.find(t=>n<=sv[t])||null}var sa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},oa={exports:{}};oa.exports;var zh;function ov(){return zh||(zh=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]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",_="[object Number]",x="[object Object]",w="[object Promise]",S="[object RegExp]",C="[object Set]",A="[object String]",B="[object Symbol]",P="[object WeakMap]",I="[object ArrayBuffer]",$="[object DataView]",z="[object Float32Array]",v="[object Float64Array]",M="[object Int8Array]",O="[object Int16Array]",N="[object Int32Array]",W="[object Uint8Array]",G="[object Uint8ClampedArray]",lt="[object Uint16Array]",ut="[object Uint32Array]",ht=/[\\^$.*+?()[\]{}|]/g,dt=/\w*$/,bt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,ct={};ct[s]=ct[a]=ct[I]=ct[$]=ct[l]=ct[u]=ct[z]=ct[v]=ct[M]=ct[O]=ct[N]=ct[g]=ct[_]=ct[x]=ct[S]=ct[C]=ct[A]=ct[B]=ct[W]=ct[G]=ct[lt]=ct[ut]=!0,ct[d]=ct[p]=ct[P]=!1;var V=typeof sa=="object"&&sa&&sa.Object===Object&&sa,L=typeof self=="object"&&self&&self.Object===Object&&self,H=V||L||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&!0&&n&&!n.nodeType&&n,X=st&&st.exports===it;function tt(D,Y){return D.set(Y[0],Y[1]),D}function rt(D,Y){return D.add(Y),D}function j(D,Y){for(var J=-1,gt=D?D.length:0;++J<gt&&Y(D[J],J,D)!==!1;);return D}function et(D,Y){for(var J=-1,gt=Y.length,Me=D.length;++J<gt;)D[Me+J]=Y[J];return D}function ot(D,Y,J,gt){for(var Me=-1,Ge=D?D.length:0;++Me<Ge;)J=Y(J,D[Me],Me,D);return J}function wt(D,Y){for(var J=-1,gt=Array(D);++J<D;)gt[J]=Y(J);return gt}function Lt(D,Y){return D?.[Y]}function vt(D){var Y=!1;if(D!=null&&typeof D.toString!="function")try{Y=!!(D+"")}catch{}return Y}function Ot(D){var Y=-1,J=Array(D.size);return D.forEach(function(gt,Me){J[++Y]=[Me,gt]}),J}function kt(D,Y){return function(J){return D(Y(J))}}function Se(D){var Y=-1,J=Array(D.size);return D.forEach(function(gt){J[++Y]=gt}),J}var _t=Array.prototype,jt=Function.prototype,Ae=Object.prototype,Ee=H["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),cn=jt.toString,$t=Ae.hasOwnProperty,Ne=Ae.toString,ie=RegExp("^"+cn.call($t).replace(ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=X?H.Buffer:void 0,Re=H.Symbol,gn=H.Uint8Array,Hi=kt(Object.getPrototypeOf,Object),Cn=Object.create,je=Ae.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,To=Te?Te.isBuffer:void 0,Mo=kt(Object.keys,Object),vr=Xn(H,"DataView"),fi=Xn(H,"Map"),ko=Xn(H,"Promise"),Do=Xn(H,"Set"),Co=Xn(H,"WeakMap"),Wi=Xn(Object,"create"),ml=pi(vr),md=pi(fi),gd=pi(ko),yd=pi(Do),_d=pi(Co),Oo=Re?Re.prototype:void 0,gl=Oo?Oo.valueOf:void 0;function hi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var gt=D[Y];this.set(gt[0],gt[1])}}function bd(){this.__data__=Wi?Wi(null):{}}function Ao(D){return this.has(D)&&delete this.__data__[D]}function xd(D){var Y=this.__data__;if(Wi){var J=Y[D];return J===i?void 0:J}return $t.call(Y,D)?Y[D]:void 0}function Eo(D){var Y=this.__data__;return Wi?Y[D]!==void 0:$t.call(Y,D)}function wd(D,Y){var J=this.__data__;return J[D]=Wi&&Y===void 0?i:Y,this}hi.prototype.clear=bd,hi.prototype.delete=Ao,hi.prototype.get=xd,hi.prototype.has=Eo,hi.prototype.set=wd;function Nn(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var gt=D[Y];this.set(gt[0],gt[1])}}function vd(){this.__data__=[]}function Sd(D){var Y=this.__data__,J=Sr(Y,D);if(J<0)return!1;var gt=Y.length-1;return J==gt?Y.pop():Ln.call(Y,J,1),!0}function Td(D){var Y=this.__data__,J=Sr(Y,D);return J<0?void 0:Y[J][1]}function yl(D){return Sr(this.__data__,D)>-1}function Md(D,Y){var J=this.__data__,gt=Sr(J,D);return gt<0?J.push([D,Y]):J[gt][1]=Y,this}Nn.prototype.clear=vd,Nn.prototype.delete=Sd,Nn.prototype.get=Td,Nn.prototype.has=yl,Nn.prototype.set=Md;function $i(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var gt=D[Y];this.set(gt[0],gt[1])}}function _l(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function kd(D){return Tr(this,D).delete(D)}function Dd(D){return Tr(this,D).get(D)}function Cd(D){return Tr(this,D).has(D)}function Od(D,Y){return Tr(this,D).set(D,Y),this}$i.prototype.clear=_l,$i.prototype.delete=kd,$i.prototype.get=Dd,$i.prototype.has=Cd,$i.prototype.set=Od;function Vi(D){this.__data__=new Nn(D)}function Ad(){this.__data__=new Nn}function ss(D){return this.__data__.delete(D)}function Ed(D){return this.__data__.get(D)}function os(D){return this.__data__.has(D)}function Rd(D,Y){var J=this.__data__;if(J instanceof Nn){var gt=J.__data__;if(!fi||gt.length<e-1)return gt.push([D,Y]),this;J=this.__data__=new $i(gt)}return J.set(D,Y),this}Vi.prototype.clear=Ad,Vi.prototype.delete=ss,Vi.prototype.get=Ed,Vi.prototype.has=os,Vi.prototype.set=Rd;function Pd(D,Y){var J=No(D)||Rl(D)?wt(D.length,String):[],gt=J.length,Me=!!gt;for(var Ge in D)$t.call(D,Ge)&&!(Me&&(Ge=="length"||Cl(Ge,gt)))&&J.push(Ge);return J}function bl(D,Y,J){var gt=D[Y];(!($t.call(D,Y)&&El(gt,J))||J===void 0&&!(Y in D))&&(D[Y]=J)}function Sr(D,Y){for(var J=D.length;J--;)if(El(D[J][0],Y))return J;return-1}function xl(D,Y){return D&&Po(Y,Bo(Y),D)}function as(D,Y,J,gt,Me,Ge,Bn){var Be;if(gt&&(Be=Ge?gt(D,Me,Ge,Bn):gt(D)),Be!==void 0)return Be;if(!fs(D))return D;var Il=No(D);if(Il){if(Be=kl(D),!Y)return Ml(D,Be)}else{var ce=un(D),hs=ce==p||ce==m;if(Vd(D))return vl(D,Y);if(ce==x||ce==s||hs&&!Ge){if(vt(D))return Ge?D:{};if(Be=Dl(hs?{}:D),!Y)return Io(D,xl(Be,D))}else{if(!ct[ce])return Ge?D:{};Be=Hd(D,ce,as,Y)}}Bn||(Bn=new Vi);var Zn=Bn.get(D);if(Zn)return Zn;if(Bn.set(D,Be),!Il)var Fo=J?Ud(D):Bo(D);return j(Fo||D,function(Mr,Fe){Fo&&(Fe=Mr,Mr=D[Fe]),bl(Be,Fe,as(Mr,Y,J,gt,Fe,D,Bn))}),Be}function Id(D){return fs(D)?Cn(D):{}}function Ld(D,Y,J){var gt=Y(D);return No(D)?gt:et(gt,J(D))}function Nd(D){return Ne.call(D)}function Bd(D){if(!fs(D)||Al(D))return!1;var Y=ds(D)||vt(D)?ie:bt;return Y.test(pi(D))}function wl(D){if(!Lo(D))return Mo(D);var Y=[];for(var J in Object(D))$t.call(D,J)&&J!="constructor"&&Y.push(J);return Y}function vl(D,Y){if(Y)return D.slice();var J=new D.constructor(D.length);return D.copy(J),J}function ls(D){var Y=new D.constructor(D.byteLength);return new gn(Y).set(new gn(D)),Y}function Ro(D,Y){var J=Y?ls(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.byteLength)}function Fd(D,Y,J){var gt=Y?J(Ot(D),!0):Ot(D);return ot(gt,tt,new D.constructor)}function Sl(D){var Y=new D.constructor(D.source,dt.exec(D));return Y.lastIndex=D.lastIndex,Y}function cs(D,Y,J){var gt=Y?J(Se(D),!0):Se(D);return ot(gt,rt,new D.constructor)}function Tl(D){return gl?Object(gl.call(D)):{}}function zd(D,Y){var J=Y?ls(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.length)}function Ml(D,Y){var J=-1,gt=D.length;for(Y||(Y=Array(gt));++J<gt;)Y[J]=D[J];return Y}function Po(D,Y,J,gt){J||(J={});for(var Me=-1,Ge=Y.length;++Me<Ge;){var Bn=Y[Me],Be=void 0;bl(J,Bn,Be===void 0?D[Bn]:Be)}return J}function Io(D,Y){return Po(D,us(D),Y)}function Ud(D){return Ld(D,Bo,us)}function Tr(D,Y){var J=D.__data__;return Ol(Y)?J[typeof Y=="string"?"string":"hash"]:J.map}function Xn(D,Y){var J=Lt(D,Y);return Bd(J)?J:void 0}var us=di?kt(di,Object):jd,un=Nd;(vr&&un(new vr(new ArrayBuffer(1)))!=$||fi&&un(new fi)!=g||ko&&un(ko.resolve())!=w||Do&&un(new Do)!=C||Co&&un(new Co)!=P)&&(un=function(D){var Y=Ne.call(D),J=Y==x?D.constructor:void 0,gt=J?pi(J):void 0;if(gt)switch(gt){case ml:return $;case md:return g;case gd:return w;case yd:return C;case _d:return P}return Y});function kl(D){var Y=D.length,J=D.constructor(Y);return Y&&typeof D[0]=="string"&&$t.call(D,"index")&&(J.index=D.index,J.input=D.input),J}function Dl(D){return typeof D.constructor=="function"&&!Lo(D)?Id(Hi(D)):{}}function Hd(D,Y,J,gt){var Me=D.constructor;switch(Y){case I:return ls(D);case l:case u:return new Me(+D);case $:return Ro(D,gt);case z:case v:case M:case O:case N:case W:case G:case lt:case ut:return zd(D,gt);case g:return Fd(D,gt,J);case _:case A:return new Me(D);case S:return Sl(D);case C:return cs(D,gt,J);case B:return Tl(D)}}function Cl(D,Y){return Y=Y??r,!!Y&&(typeof D=="number"||at.test(D))&&D>-1&&D%1==0&&D<Y}function Ol(D){var Y=typeof D;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?D!=="__proto__":D===null}function Al(D){return!!oe&&oe in D}function Lo(D){var Y=D&&D.constructor,J=typeof Y=="function"&&Y.prototype||Ae;return D===J}function pi(D){if(D!=null){try{return cn.call(D)}catch{}try{return D+""}catch{}}return""}function Wd(D){return as(D,!0,!0)}function El(D,Y){return D===Y||D!==D&&Y!==Y}function Rl(D){return $d(D)&&$t.call(D,"callee")&&(!je.call(D,"callee")||Ne.call(D)==s)}var No=Array.isArray;function Pl(D){return D!=null&&Yd(D.length)&&!ds(D)}function $d(D){return qd(D)&&Pl(D)}var Vd=To||ee;function ds(D){var Y=fs(D)?Ne.call(D):"";return Y==p||Y==m}function Yd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function fs(D){var Y=typeof D;return!!D&&(Y=="object"||Y=="function")}function qd(D){return!!D&&typeof D=="object"}function Bo(D){return Pl(D)?Pd(D):wl(D)}function jd(){return[]}function ee(){return!1}n.exports=Wd})(oa,oa.exports)),oa.exports}ov();const Mn=(n,t)=>new Date(n.getTime()-iv(t,n));class Ce{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=nv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Nh(e,t)}}class av extends Ce{rawStart(t){let e=ei(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class lv extends Ce{rawStart(t){let e=Br(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class cv extends Ce{rawStart(t){let e=Nr(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class uv extends Ce{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class dv extends Ce{rawEnd(t){let e=ei(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Mn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=ei(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Mn(i,t)),i}}class fv extends Ce{rawEnd(t){let e=Nr(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}rawStart(t){let e=Nr(vh(this.tzAdjustedDate(t)));return t&&(e=Mn(e,t)),e}}class hv extends Ce{rawEnd(t){let e=Br(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}rawStart(t){let e=Br(wh(this.tzAdjustedDate(t)));return t&&(e=Mn(e,t)),e}}class pv extends Ce{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Mn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Mn(e,t)),e}}mt.FIFTEEN_MIN,new Ce({key:mt.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"]}),mt.ONE_HOUR,new Ce({key:mt.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"]}),mt.SIX_HOUR,new Ce({key:mt.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"]}),mt.TWELVE_HOUR,new Ce({key:mt.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"]}),mt.ONE_DAY,new Ce({key:mt.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"]}),mt.SEVEN_DAY,new Ce({key:mt.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"]}),mt.THIRTY_DAY,new Ce({key:mt.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"]}),mt.NINETY_DAY,new Ce({key:mt.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"]}),mt.ONE_HUNDRED_EIGHTY_DAY,new Ce({key:mt.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"]}),mt.ONE_YEAR,new Ce({key:mt.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"]}),mt.CURRENT_WEEK,new av({key:mt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ei(new Date,{weekStartsOn:1});return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.CURRENT_MONTH,new lv({key:mt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Br(new Date);return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.CURRENT_QUARTER,new cv({key:mt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Nr(new Date);return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.CURRENT_YEAR,new uv({key:mt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_WEEK,new dv({key:mt.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"]}),mt.PREVIOUS_MONTH,new hv({key:mt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Br(new Date),e=Br(wh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Uh(t,e)),3600*24*Dw(new Date().setMonth(new Date().getMonth()-1))+xh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_QUARTER,new fv({key:mt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Nr(new Date),t=Nr(vh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_YEAR,new pv({key:mt.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=Uh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+xh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Uh(n,t){return Ow(n.getTimezoneOffset()-t.getTimezoneOffset())}mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.THIRTY_DAY,mt.NINETY_DAY,mt.ONE_HUNDRED_EIGHTY_DAY,mt.ONE_YEAR,mt.CURRENT_WEEK,mt.CURRENT_MONTH,mt.CURRENT_QUARTER,mt.CURRENT_YEAR,mt.PREVIOUS_WEEK,mt.PREVIOUS_MONTH,mt.PREVIOUS_QUARTER,mt.PREVIOUS_YEAR;const mv=new Map(ah.map(n=>[n.code,{code:n.code,name:n.name}])),Dc=n=>mv.get(n)?.name||n,Hh=1e3,gv=1e4,Wh=1e6,$h=1e9,Vh=1e12,aa=(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("")},Es=(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 la(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?gv:Hh;return n<r||t.precision&&t.precision>Math.log10(n)?e=aa(Es(n,1,t),t):n<Wh?e=`${Es(n,Hh,t)}k`:n<$h?e=`${Es(n,Wh,t)}m`:n<Vh?e=`${aa(Es(n,$h,t),t)}b`:e=`${aa(Es(n,Vh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}la.addCommas=aa;const yv=typeof document<"u"&&document.documentElement?.lang||"en-US",ca=new Intl.NumberFormat(yv);function ni({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 p;return i>=s?p=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?p=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?p=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?p=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?p=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):p=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),p.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?`${la(i,{capital:!0})} ${d}`:i>=.01?`${ca.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=p=>p}={})=>{const p=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`${la(i,{capital:!0})} - ${la(r,{capital:!0})} ${p}`}const m=i>=.01?`${ca.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,g=r>=.01?`${ca.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${m} - ${g} ${p}`}}}const _v=n=>{const t=n.length;let e=5381;for(let i=0;i<t;i++)e=e*33^n.charCodeAt(i);return e>>>0},bv="#0044f4",Yh="#6c7489",xv="#afb7c5",wv="#d60027",vv="#ffc400",Sv="#bee2ff",Tv="#8fc1ff",Mv="#5f9aff",kv="#306fff",Dv="#b5ffee",Cv="#00fabe",Ov="#00d6a4",Av="#00a17b",Ev="#007d60",Rv="#005944",Pv="#b5ffee",Iv="#00fabe",Lv="#b5ffee",Nv="#00a17b",Bv="#fff296",Fv="#ffe04b",zv="#ffc400",Uv="#b37600",Hv="#995c00",Wv="#804400",$v="#fff296",Vv="#ffe04b",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="#a31f00",m1="#ffc2b3",g1="#ff9877",y1="#ff723c",_1="#f75008",b1="#d13500",x1="#ffabab",w1="#ff7272",v1="#ff3954",S1="#f50045",T1="#d60027",M1="#ad000e",k1="#ffabab",D1="#ff7272",C1="#ff3954",O1="#f50045",A1="#d60027",E1="#eefaff",R1="#ecfffb",P1="#fffce0",I1="#fff1ef",L1="#ffe5e5",N1="#5f9aff",B1="#00d6a4",F1="#ffc400",z1="#ff723c",U1="#ff3954",H1={100:Sv,101:Tv,102:Mv,103:kv,200:Dv,201:Cv,202:Ov,203:Av,204:Ev,205:Rv,206:Pv,207:Iv,208:Lv,226:Nv,300:Bv,301:Fv,302:zv,303:Uv,304:Hv,305:Wv,307:$v,308:Vv,400:Yv,401:qv,402:jv,403:Gv,404:Kv,405:Xv,406:Zv,407:Qv,408:Jv,409:t1,410:e1,411:n1,412:i1,413:r1,414:s1,415:o1,416:a1,417:l1,418:c1,421:u1,422:d1,423:f1,424:h1,425:p1,426:m1,428:g1,429:y1,431:_1,451:b1,500:x1,501:w1,502:v1,503:S1,504:T1,505:M1,506:k1,507:D1,508:C1,510:O1,511:A1},W1={100:E1,200:R1,300:P1,400:I1,500:L1},qh={"1XX":N1,"2XX":B1,"3XX":F1,"4XX":z1,"5XX":U1},$1={error:wv,warning:vv,empty:xv,neutral:Yh,____OTHER____:bv},jh=["#1693AE","#2EA697","#5CB56C","#AD47F1","#7287F1","#4DA8DF","#DA5024","#EC4D87","#D771D5","#6C931E","#AC8E26","#DB8743"],Gh=["#006B74","#187C62","#538732","#7201DE","#1E63D3","#1E83A3","#B2001F","#BA107B","#A739D0","#5E6400","#8B620C","#BB5420"],V1=n=>_v(n),Kh=({discriminator:n,theme:t="light",customPalette:e=void 0})=>{const i=Math.abs(Math.floor(n));return e?e[i%e.length]:t==="dark"?Gh[i%Gh.length]:jh[i%jh.length]},Rs=({state:n})=>$1[n]??Yh,Y1=({statusCode:n})=>{const t=typeof n=="number"?n:Number.parseInt(n,10),e=`${t}`,i=`${Math.floor(t/100)*100}`;return H1[e]??W1[i]??Rs({state:"neutral"})},q1=({group:n})=>qh[n]?qh[n]:Rs({state:"neutral"}),ua=({discriminator:n=void 0,state:t=void 0,dimension:e=void 0,dimensionValue:i=void 0,metric:r=void 0,theme:s="light",customPalette:a=void 0})=>{if(n!==void 0)return Kh({discriminator:n,theme:s,customPalette:a});if(t!==void 0)return Rs({state:t});if(i&&["empty","____OTHER____"].includes(i))return Rs({state:i});if(e!==void 0&&i!==void 0){if(e==="status_code")return Y1({statusCode:i});if(e==="status_code_grouped")return q1({group:i})}return e||i||r?Kh({discriminator:V1(`${e??""}${i??""}${r??""}`),theme:s,customPalette:a}):Rs({state:"neutral"})},Xh="#d60027",Zh="#ffe5e5",j1="#f1f0ff",G1="#e0e4ea",Qh="#6c7489",K1="#afb7c5",Jh="#0d0e14",X1="#d60027",Z1="#ad000e",Cc="#6c7489",tp="#52596e",Q1="#007d60",J1="#995c00",tS="#ffc400",eS="'Inter', Roboto, Helvetica, sans-serif",ir="16px",nS="20px",iS="#bee2ff",rS="#8fc1ff",sS="#5f9aff",oS="#306fff",aS="#b5ffee",lS="#00fabe",cS="#00d6a4",uS="#00a17b",dS="#007d60",fS="#005944",hS="#b5ffee",pS="#00fabe",mS="#b5ffee",gS="#00a17b",yS="#fff296",_S="#ffe04b",bS="#ffc400",xS="#b37600",wS="#995c00",vS="#804400",SS="#fff296",TS="#ffe04b",MS="#ffc2b3",kS="#ff9877",DS="#ff723c",CS="#f75008",OS="#d13500",AS="#a31f00",ES="#ffc2b3",RS="#ff9877",PS="#ff723c",IS="#f75008",LS="#d13500",NS="#a31f00",BS="#ffc2b3",FS="#ff9877",zS="#ff723c",US="#f75008",HS="#d13500",WS="#a31f00",$S="#ffc2b3",VS="#ff9877",YS="#ff723c",qS="#f75008",jS="#d13500",GS="#a31f00",KS="#ffc2b3",XS="#ff9877",ZS="#ff723c",QS="#f75008",JS="#d13500",tT="#ffabab",eT="#ff7272",nT="#ff3954",iT="#f50045",rT="#d60027",sT="#ad000e",oT="#ffabab",aT="#ff7272",lT="#ff3954",cT="#f50045",uT="#d60027",dT="#eefaff",fT="#ecfffb",hT="#fffce0",pT="#fff1ef",mT="#ffe5e5",gT="#5f9aff",yT="#00d6a4",_T="#ffc400",bT="#ff723c",xT="#ff3954",ep=6048e5,wT=864e5,Ps=6e4,zr=36e5,vT=1e3,np=Symbol.for("constructDateFrom");function pe(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&np in n?n[np](t):n instanceof Date?new n.constructor(t):new Date(t)}function Et(n,t){return pe(t||n,n)}function da(n,t,e){const i=Et(n,e?.in);return isNaN(t)?pe(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Oc(n,t,e){const i=Et(n,e?.in);if(isNaN(t))return pe(n,NaN);if(!t)return i;const r=i.getDate(),s=pe(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 Ac(n,t,e){return pe(n,+Et(n)+t)}function ST(n,t,e){return Ac(n,t*zr)}let TT={};function rr(){return TT}function $n(n,t){const e=rr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Et(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 Ur(n,t){return $n(n,{...t,weekStartsOn:1})}function ip(n,t){const e=Et(n,t?.in),i=e.getFullYear(),r=pe(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Ur(r),a=pe(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Ur(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function fa(n){const t=Et(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 sr(n,...t){const e=pe.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ec(n,t){const e=Et(n,t?.in);return e.setHours(0,0,0,0),e}function rp(n,t,e){const[i,r]=sr(e?.in,n,t),s=Ec(i),a=Ec(r),l=+s-fa(s),u=+a-fa(a);return Math.round((l-u)/wT)}function MT(n,t){const e=ip(n,t),i=pe(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ur(i)}function kT(n,t,e){const i=Et(n,e?.in);return i.setTime(i.getTime()+t*Ps),i}function DT(n,t,e){return Oc(n,t*3,e)}function CT(n,t,e){return Ac(n,t*1e3)}function OT(n,t,e){return da(n,t*7,e)}function AT(n,t,e){return Oc(n,t*12,e)}function Is(n,t){const e=+Et(n)-+Et(t);return e<0?-1:e>0?1:e}function ET(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Rc(n){return!(!ET(n)&&typeof n!="number"||isNaN(+Et(n)))}function RT(n,t,e){const[i,r]=sr(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function PT(n,t,e){const[i,r]=sr(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function sp(n,t,e){const[i,r]=sr(e?.in,n,t),s=op(i,r),a=Math.abs(rp(i,r));i.setDate(i.getDate()-s*a);const l=+(op(i,r)===-s),u=s*(a-l);return u===0?0:u}function op(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 Ls(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function IT(n,t,e){const[i,r]=sr(e?.in,n,t),s=(+i-+r)/zr;return Ls(e?.roundingMethod)(s)}function Pc(n,t){return+Et(n)-+Et(t)}function LT(n,t,e){const i=Pc(n,t)/Ps;return Ls(e?.roundingMethod)(i)}function ap(n,t){const e=Et(n,t?.in);return e.setHours(23,59,59,999),e}function lp(n,t){const e=Et(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function NT(n,t){const e=Et(n,t?.in);return+ap(e,t)==+lp(e,t)}function cp(n,t,e){const[i,r,s]=sr(e?.in,n,n,t),a=Is(r,s),l=Math.abs(RT(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Is(r,s)===-a;NT(i)&&l===1&&Is(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function BT(n,t,e){const i=cp(n,t,e)/3;return Ls(e?.roundingMethod)(i)}function FT(n,t,e){const i=Pc(n,t)/1e3;return Ls(e?.roundingMethod)(i)}function zT(n,t,e){const i=sp(n,t,e)/7;return Ls(e?.roundingMethod)(i)}function UT(n,t,e){const[i,r]=sr(e?.in,n,t),s=Is(i,r),a=Math.abs(PT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Is(i,r)===-s,u=s*(a-+l);return u===0?0:u}function HT(n,t){const e=Et(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function WT(n,t){const e=Et(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function $T(n,t){const e=Et(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function up(n,t){const e=Et(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function VT(n,t){const e=Et(n,t?.in);return e.setMinutes(59,59,999),e}function YT(n,t){const e=rr(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Et(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 qT(n,t){const e=Et(n,t?.in);return e.setSeconds(59,999),e}function jT(n,t){const e=Et(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function GT(n,t){const e=Et(n,t?.in);return e.setMilliseconds(999),e}const KT={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"}},XT=(n,t,e)=>{let i;const r=KT[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 Ic(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ZT={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tM={date:Ic({formats:ZT,defaultWidth:"full"}),time:Ic({formats:QT,defaultWidth:"full"}),dateTime:Ic({formats:JT,defaultWidth:"full"})},eM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nM=(n,t,e,i)=>eM[n];function Ns(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 iM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sM={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"]},oM={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"]},aM={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"}},lM={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"}},cM={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:Ns({values:iM,defaultWidth:"wide"}),quarter:Ns({values:rM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ns({values:sM,defaultWidth:"wide"}),day:Ns({values:oM,defaultWidth:"wide"}),dayPeriod:Ns({values:aM,defaultWidth:"wide",formattingValues:lM,defaultFormattingWidth:"wide"})};function Bs(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)?dM(l,m=>m.test(a)):uM(l,m=>m.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const p=t.slice(a.length);return{value:d,rest:p}}}function uM(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function dM(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function fM(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 hM=/^(\d+)(th|st|nd|rd)?/i,pM=/\d+/i,mM={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},gM={any:[/^b/i,/^(a|c)/i]},yM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_M={any:[/1/i,/2/i,/3/i,/4/i]},bM={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},xM={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]},wM={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},vM={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]},SM={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},TM={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}},MM={ordinalNumber:fM({matchPattern:hM,parsePattern:pM,valueCallback:n=>parseInt(n,10)}),era:Bs({matchPatterns:mM,defaultMatchWidth:"wide",parsePatterns:gM,defaultParseWidth:"any"}),quarter:Bs({matchPatterns:yM,defaultMatchWidth:"wide",parsePatterns:_M,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Bs({matchPatterns:bM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any"}),day:Bs({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:vM,defaultParseWidth:"any"}),dayPeriod:Bs({matchPatterns:SM,defaultMatchWidth:"any",parsePatterns:TM,defaultParseWidth:"any"})},dp={code:"en-US",formatDistance:XT,formatLong:tM,formatRelative:nM,localize:cM,match:MM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kM(n,t){const e=Et(n,t?.in);return rp(e,up(e))+1}function fp(n,t){const e=Et(n,t?.in),i=+Ur(e)-+MT(e);return Math.round(i/ep)+1}function Lc(n,t){const e=Et(n,t?.in),i=e.getFullYear(),r=rr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=pe(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=$n(a,t),u=pe(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=$n(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function DM(n,t){const e=rr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Lc(n,t),s=pe(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),$n(s,t)}function hp(n,t){const e=Et(n,t?.in),i=+$n(e,t)-+DM(e,t);return Math.round(i/ep)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ti={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)}},Hr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},pp={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 Ti.y(n,t)},Y:function(n,t,e,i){const r=Lc(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=ip(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 Ti.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=hp(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=fp(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"}):Ti.d(n,t)},D:function(n,t,e){const i=kM(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=Hr.noon:i===0?r=Hr.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=Hr.evening:i>=12?r=Hr.afternoon:i>=4?r=Hr.morning:r=Hr.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 Ti.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ti.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"}):Ti.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ti.s(n,t)},S:function(n,t){return Ti.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return gp(i);case"XXXX":case"XX":return or(i);default:return or(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return gp(i);case"xxxx":case"xx":return or(i);default:return or(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mp(i,":");default:return"GMT"+or(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mp(i,":");default:return"GMT"+or(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 mp(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 gp(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):or(n,t)}function or(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 yp=(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"})}},_p=(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"})}},Nc={p:_p,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return yp(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}}",yp(i,t)).replace("{{time}}",_p(r,t))}},CM=/^D+$/,OM=/^Y+$/,AM=["D","DD","YY","YYYY"];function bp(n){return CM.test(n)}function xp(n){return OM.test(n)}function Bc(n,t,e){const i=EM(n,t,e);if(console.warn(i),AM.includes(n))throw new RangeError(i)}function EM(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 RM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,PM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IM=/^'([^]*?)'?$/,LM=/''/g,NM=/[a-zA-Z]/;function ha(n,t,e){const i=rr(),r=e?.locale??i.locale??dp,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=Et(n,e?.in);if(!Rc(l))throw new RangeError("Invalid time value");let u=t.match(PM).map(p=>{const m=p[0];if(m==="p"||m==="P"){const g=Nc[m];return g(p,r.formatLong)}return p}).join("").match(RM).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:BM(p)};if(pp[m])return{isToken:!0,value:p};if(m.match(NM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(p=>{if(!p.isToken)return p.value;const m=p.value;(!e?.useAdditionalWeekYearTokens&&xp(m)||!e?.useAdditionalDayOfYearTokens&&bp(m))&&Bc(m,t,String(n));const g=pp[m[0]];return g(l,m,r.localize,d)}).join("")}function BM(n){const t=n.match(IM);return t?t[1].replace(LM,"'"):n}function wp(){return Object.assign({},rr())}function FM(n,t){const e=Et(n,t?.in).getDay();return e===0?7:e}function zM(n,t){const e=UM(t)?new t(0):pe(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function UM(n){return typeof n=="function"&&n.prototype?.constructor===n}const HM=10;class vp{subPriority=0;validate(t,e){return!0}}class WM extends vp{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 $M extends vp{priority=HM;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>pe(e,i))}set(t,e){return e.timestampIsSet?t:pe(t,zM(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new WM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class VM 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 ye={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},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 _e(n,t){return n&&{value:t(n.value),rest:n.rest}}function fe(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Yn(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*zr+s*Ps+a*vT),rest:t.slice(e[0].length)}}function Sp(n){return fe(ye.anyDigitsSigned,n)}function me(n,t){switch(n){case 1:return fe(ye.singleDigit,t);case 2:return fe(ye.twoDigits,t);case 3:return fe(ye.threeDigits,t);case 4:return fe(ye.fourDigits,t);default:return fe(new RegExp("^\\d{1,"+n+"}"),t)}}function pa(n,t){switch(n){case 1:return fe(ye.singleDigitSigned,t);case 2:return fe(ye.twoDigitsSigned,t);case 3:return fe(ye.threeDigitsSigned,t);case 4:return fe(ye.fourDigitsSigned,t);default:return fe(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Fc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Tp(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 Mp(n){return n%400===0||n%4===0&&n%100!==0}class YM 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 _e(me(4,t),r);case"yo":return _e(i.ordinalNumber(t,{unit:"year"}),r);default:return _e(me(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=Tp(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 qM extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return _e(me(4,t),r);case"Yo":return _e(i.ordinalNumber(t,{unit:"year"}),r);default:return _e(me(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Lc(t,r);if(i.isTwoDigitYear){const l=Tp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),$n(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),$n(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class jM extends Wt{priority=130;parse(t,e){return pa(e==="R"?4:e.length,t)}set(t,e,i){const r=pe(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Ur(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class GM extends Wt{priority=130;parse(t,e){return pa(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 KM extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return me(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 XM extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return me(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 ZM 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 _e(fe(ye.month,t),r);case"MM":return _e(me(2,t),r);case"Mo":return _e(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 QM extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return _e(fe(ye.month,t),r);case"LL":return _e(me(2,t),r);case"Lo":return _e(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 JM(n,t,e){const i=Et(n,e?.in),r=hp(i,e)-t;return i.setDate(i.getDate()-r*7),Et(i,e?.in)}class tk extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return fe(ye.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return $n(JM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function ek(n,t,e){const i=Et(n,e?.in),r=fp(i,e)-t;return i.setDate(i.getDate()-r*7),i}class nk extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return fe(ye.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Ur(ek(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const ik=[31,28,31,30,31,30,31,31,30,31,30,31],rk=[31,29,31,30,31,30,31,31,30,31,30,31];class sk extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return fe(ye.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return me(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=Mp(i),s=t.getMonth();return r?e>=1&&e<=rk[s]:e>=1&&e<=ik[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 ok extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return fe(ye.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return me(e.length,t)}}validate(t,e){const i=t.getFullYear();return Mp(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 zc(n,t,e){const i=rr(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Et(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,p=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return da(s,p,e)}class ak 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=zc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class lk 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 _e(me(e.length,t),s);case"eo":return _e(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=zc(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 ck 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 _e(me(e.length,t),s);case"co":return _e(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=zc(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 uk(n,t,e){const i=Et(n,e?.in),r=FM(i,e),s=t-r;return da(i,s,e)}class dk extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return me(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return _e(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 _e(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return _e(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return _e(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=uk(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 fk 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(Fc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class hk 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(Fc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class pk 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(Fc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class mk extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return fe(ye.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 gk extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return fe(ye.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 yk extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return fe(ye.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 _k extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return fe(ye.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 bk extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return fe(ye.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return me(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 xk extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return fe(ye.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return me(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 wk extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return _e(me(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class vk extends Wt{priority=10;parse(t,e){switch(e){case"X":return Yn(Vn.basicOptionalMinutes,t);case"XX":return Yn(Vn.basic,t);case"XXXX":return Yn(Vn.basicOptionalSeconds,t);case"XXXXX":return Yn(Vn.extendedOptionalSeconds,t);default:return Yn(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:pe(t,t.getTime()-fa(t)-i)}incompatibleTokens=["t","T","x"]}class Sk extends Wt{priority=10;parse(t,e){switch(e){case"x":return Yn(Vn.basicOptionalMinutes,t);case"xx":return Yn(Vn.basic,t);case"xxxx":return Yn(Vn.basicOptionalSeconds,t);case"xxxxx":return Yn(Vn.extendedOptionalSeconds,t);default:return Yn(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:pe(t,t.getTime()-fa(t)-i)}incompatibleTokens=["t","T","X"]}class Tk extends Wt{priority=40;parse(t){return Sp(t)}set(t,e,i){return[pe(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Mk extends Wt{priority=20;parse(t){return Sp(t)}set(t,e,i){return[pe(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const kk={G:new VM,y:new YM,Y:new qM,R:new jM,u:new GM,Q:new KM,q:new XM,M:new ZM,L:new QM,w:new tk,I:new nk,d:new sk,D:new ok,E:new ak,e:new lk,c:new ck,i:new dk,a:new fk,b:new hk,B:new pk,h:new mk,H:new gk,K:new yk,k:new _k,m:new bk,s:new xk,S:new wk,X:new vk,x:new Sk,t:new Tk,T:new Mk},Dk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ck=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ok=/^'([^]*?)'?$/,Ak=/''/g,Ek=/\S/,Rk=/[a-zA-Z]/;function Pk(n,t,e,i){const r=()=>pe(i?.in||e,NaN),s=wp(),a=i?.locale??s.locale??dp,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():Et(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},p=[new $M(i?.in,e)],m=t.match(Ck).map(S=>{const C=S[0];if(C in Nc){const A=Nc[C];return A(S,a.formatLong)}return S}).join("").match(Dk),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&xp(S)&&Bc(S,t,n),!i?.useAdditionalDayOfYearTokens&&bp(S)&&Bc(S,t,n);const C=S[0],A=kk[C];if(A){const{incompatibleTokens:B}=A;if(Array.isArray(B)){const I=g.find($=>B.includes($.token)||$.token===C);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${S}\` at the same time`)}else if(A.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);g.push({token:C,fullToken:S});const P=A.run(n,S,a.match,d);if(!P)return r();p.push(P.setter),n=P.rest}else{if(C.match(Rk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=Ik(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&Ek.test(n))return r();const _=p.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,A)=>A.indexOf(S)===C).map(S=>p.filter(C=>C.priority===S).sort((C,A)=>A.subPriority-C.subPriority)).map(S=>S[0]);let x=Et(e,i?.in);if(isNaN(+x))return r();const w={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,w,d);Array.isArray(C)?(x=C[0],Object.assign(w,C[1])):x=C}return x}function Ik(n){return n.match(Ok)[1].replace(Ak,"'")}function Lk(n,t){const e=Et(n,t?.in);return e.setMinutes(0,0,0),e}function Nk(n,t){const e=Et(n,t?.in);return e.setSeconds(0,0),e}function Bk(n,t){const e=Et(n,t?.in);return e.setMilliseconds(0),e}function kp(n){const t=n/zr;return Math.trunc(t)}function Dp(n,t){const e=()=>pe(t?.in,NaN),i=t?.additionalDigits??2,r=Hk(n);let s;if(r.date){const d=Wk(r.date,i);s=$k(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=Vk(r.time),isNaN(l)))return e();if(r.timezone){if(u=Yk(r.timezone),isNaN(u))return e()}else{const d=new Date(a+l),p=Et(0,t?.in);return p.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),p.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),p}return Et(a+l+u,t?.in)}const ma={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fk=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,zk=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Uk=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Hk(n){const t={},e=n.split(ma.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],ma.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ma.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=ma.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function Wk(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 $k(n,t){if(t===null)return new Date(NaN);const e=n.match(Fk);if(!e)return new Date(NaN);const i=!!e[4],r=Fs(e[1]),s=Fs(e[2])-1,a=Fs(e[3]),l=Fs(e[4]),u=Fs(e[5])-1;if(i)return Xk(t,l,u)?qk(t,l,u):new Date(NaN);{const d=new Date(0);return!Gk(t,s,a)||!Kk(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Fs(n){return n?parseInt(n):1}function Vk(n){const t=n.match(zk);if(!t)return NaN;const e=Uc(t[1]),i=Uc(t[2]),r=Uc(t[3]);return Zk(e,i,r)?e*zr+i*Ps+r*1e3:NaN}function Uc(n){return n&&parseFloat(n.replace(",","."))||0}function Yk(n){if(n==="Z")return 0;const t=n.match(Uk);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Qk(i,r)?e*(i*zr+r*Ps):NaN}function qk(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 jk=[31,null,31,30,31,30,31,31,30,31,30,31];function Cp(n){return n%400===0||n%4===0&&n%100!==0}function Gk(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(jk[t]||(Cp(n)?29:28))}function Kk(n,t){return t>=1&&t<=(Cp(n)?366:365)}function Xk(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Zk(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Qk(n,t){return t>=0&&t<=59}const Op={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",scatter:{median:"Median",percentile:"p{value}",outlier:"Outlier (> {label})"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},canceled:{message:"Request canceled"},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",share_of_requests:"Share of requests",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",consumer_group:"Consumer group",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",total_tokens_per_minute:"Total tokens per minute",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",share_of_requests:"Share of requests",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal latency (p50) in {unit}",response_size_p99:"Response size (p99) in {unit}",response_size_p95:"Response size (p95) in {unit}",response_size_p50:"Response size (p50) in {unit}",request_size_p99:"Request size (p99) in {unit}",request_size_p95:"Request size (p95) in {unit}",request_size_p50:"Request size (p50) in {unit}",request_size_sum:"Request size (sum) in {unit}",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response size (p99) in {unit}",RESPONSE_SIZE_P95:"Response size (p95) in {unit}",RESPONSE_SIZE_P50:"Response size (p50) in {unit}",REQUEST_SIZE_P99:"Request size (p99) in {unit}",REQUEST_SIZE_P95:"Request size (p95) in {unit}",REQUEST_SIZE_P50:"Request size (p50) in {unit}",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99) in {unit}",LatencyP95:"Response latency (p95) in {unit}",LatencyP50:"Response latency (p50) in {unit}",LatencyAverage:"Response latency (avg) in {unit}",UpstreamLatencyP99:"Upstream latency (p99) in {unit}",UpstreamLatencyP95:"Upstream latency (p95) in {unit}",UpstreamLatencyP50:"Upstream latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream latency (avg) in {unit}",KongLatencyP99:"Kong latency (p99) in {unit}",KongLatencyP95:"Kong latency (p95) in {unit}",KongLatencyP50:"Kong latency (p50) in {unit}",KongLatencyAverage:"Kong latency (avg) in {unit}",ResponseSizeP99:"Response size (p99) in {unit}",ResponseSizeP95:"Response size (p95) in {unit}",ResponseSizeP50:"Response size (p50) in {unit}",RequestSizeP99:"Request size (p99) in {unit}",RequestSizeP95:"Request size (p95) in {unit}",RequestSizeP50:"Request size (p50) in {unit}",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)",total_tokens_per_minute:"Total tokens per minute"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",daily:"@timestamp per day",weekly:"@timestamp per week"},timestampAxisTitles:{platform:"@timestamp created at"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},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 Jk(){const n=Jf.createI18n("en-us",Op);return{i18n:n,i18nT:Jf.i18nTComponent(n)}}function zs(n){return n+.5|0}const Mi=(n,t,e)=>Math.max(Math.min(n,e),t);function Us(n){return Mi(zs(n*2.55),0,255)}function ki(n){return Mi(zs(n*255),0,255)}function ii(n){return Mi(zs(n/2.55)/100,0,1)}function Ap(n){return Mi(zs(n*100),0,100)}const kn={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},Hc=[..."0123456789ABCDEF"],tD=n=>Hc[n&15],eD=n=>Hc[(n&240)>>4]+Hc[n&15],ga=n=>(n&240)>>4===(n&15),nD=n=>ga(n.r)&&ga(n.g)&&ga(n.b)&&ga(n.a);function iD(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&kn[n[1]]*17,g:255&kn[n[2]]*17,b:255&kn[n[3]]*17,a:t===5?kn[n[4]]*17:255}:(t===7||t===9)&&(e={r:kn[n[1]]<<4|kn[n[2]],g:kn[n[3]]<<4|kn[n[4]],b:kn[n[5]]<<4|kn[n[6]],a:t===9?kn[n[7]]<<4|kn[n[8]]:255})),e}const rD=(n,t)=>n<255?t(n):"";function sD(n){var t=nD(n)?tD:eD;return n?"#"+t(n.r)+t(n.g)+t(n.b)+rD(n.a,t):void 0}const oD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ep(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 aD(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 lD(n,t,e){const i=Ep(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 cD(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 Wc(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,p;return s!==a&&(p=s-a,d=l>.5?p/(2-s-a):p/(s+a),u=cD(e,i,r,p,s),u=u*60+.5),[u|0,d||0,l]}function $c(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(ki)}function Vc(n,t,e){return $c(Ep,n,t,e)}function uD(n,t,e){return $c(lD,n,t,e)}function dD(n,t,e){return $c(aD,n,t,e)}function Rp(n){return(n%360+360)%360}function fD(n){const t=oD.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Us(+t[5]):ki(+t[5]));const r=Rp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=uD(r,s,a):t[1]==="hsv"?i=dD(r,s,a):i=Vc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function hD(n,t){var e=Wc(n);e[0]=Rp(e[0]+t),e=Vc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function pD(n){if(!n)return;const t=Wc(n),e=t[0],i=Ap(t[1]),r=Ap(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ii(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Pp={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"},Ip={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function mD(){const n={},t=Object.keys(Ip),e=Object.keys(Pp);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,Pp[s]);s=parseInt(Ip[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let ya;function gD(n){ya||(ya=mD(),ya.transparent=[0,0,0,0]);const t=ya[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const yD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _D(n){const t=yD.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Us(a):Mi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Us(i):Mi(i,0,255)),r=255&(t[4]?Us(r):Mi(r,0,255)),s=255&(t[6]?Us(s):Mi(s,0,255)),{r:i,g:r,b:s,a:e}}}function bD(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ii(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Yc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wr=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function xD(n,t,e){const i=Wr(ii(n.r)),r=Wr(ii(n.g)),s=Wr(ii(n.b));return{r:ki(Yc(i+e*(Wr(ii(t.r))-i))),g:ki(Yc(r+e*(Wr(ii(t.g))-r))),b:ki(Yc(s+e*(Wr(ii(t.b))-s))),a:n.a+e*(t.a-n.a)}}function _a(n,t,e){if(n){let i=Wc(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 Lp(n,t){return n&&Object.assign(t||{},n)}function Np(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=ki(n[3]))):(t=Lp(n,{r:0,g:0,b:0,a:1}),t.a=ki(t.a)),t}function wD(n){return n.charAt(0)==="r"?_D(n):fD(n)}class Hs{constructor(t){if(t instanceof Hs)return t;const e=typeof t;let i;e==="object"?i=Np(t):e==="string"&&(i=iD(t)||gD(t)||wD(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Lp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=Np(t)}rgbString(){return this._valid?bD(this._rgb):void 0}hexString(){return this._valid?sD(this._rgb):void 0}hslString(){return this._valid?pD(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=xD(this._rgb,t._rgb,e)),this}clone(){return new Hs(this.rgb)}alpha(t){return this._rgb.a=ki(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=zs(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 _a(this._rgb,2,t),this}darken(t){return _a(this._rgb,2,-t),this}saturate(t){return _a(this._rgb,1,t),this}desaturate(t){return _a(this._rgb,1,-t),this}rotate(t){return hD(this._rgb,t),this}}function ri(){}const vD=(()=>{let n=0;return()=>n++})();function St(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 It(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function mn(n,t){return ae(n)?n:t}function Ct(n,t){return typeof n>"u"?t:n}const SD=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Bp=(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(It(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ba(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 xa(n){if(qt(n))return n.map(xa);if(It(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=xa(n[e[r]]);return t}return n}function Fp(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function TD(n,t,e,i){if(!Fp(n))return;const r=t[n],s=e[n];It(r)&&It(s)?Ws(r,s,i):t[n]=xa(s)}function Ws(n,t,e){const i=qt(t)?t:[t],r=i.length;if(!It(n))return n;e=e||{};const s=e.merger||TD;let a;for(let l=0;l<r;++l){if(a=i[l],!It(a))continue;const u=Object.keys(a);for(let d=0,p=u.length;d<p;++d)s(u[d],n,a,e)}return n}function $s(n,t){return Ws(n,t,{merger:MD})}function MD(n,t,e){if(!Fp(n))return;const i=t[n],r=e[n];It(i)&&It(r)?$s(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=xa(r))}const zp={"":n=>n,x:n=>n.x,y:n=>n.y};function kD(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 DD(n){const t=kD(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Di(n,t){return(zp[t]||(zp[t]=DD(t)))(n)}function qc(n){return n.charAt(0).toUpperCase()+n.slice(1)}const rn=n=>typeof n<"u",sn=n=>typeof n=="function",Up=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function CD(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Rt=Math.PI,te=2*Rt,OD=te+Rt,wa=Number.POSITIVE_INFINITY,jc=Rt/180,re=Rt/2,Dn=Rt/4,va=Rt*2/3,Ci=Math.log10,qn=Math.sign;function Vs(n,t,e){return Math.abs(n-t)<e}function Hp(n){const t=Math.round(n);n=Vs(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Ci(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function AD(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 ED(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Oi(n){return!ED(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function RD(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Wp(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 we(n){return n*(Rt/180)}function Sa(n){return n*(180/Rt)}function $p(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Ta(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 $r(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function PD(n,t){return(n-t+OD)%te-Rt}function He(n){return(n%te+te)%te}function Ys(n,t,e,i){const r=He(n),s=He(t),a=He(e),l=He(s-r),u=He(a-r),d=He(r-s),p=He(r-a);return r===s||r===a||i&&s===a||l>u&&d<p}function Oe(n,t,e){return Math.max(t,Math.min(e,n))}function ID(n){return Oe(n,-32768,32767)}function si(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Gc(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 oi=(n,t,e,i)=>Gc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),LD=(n,t,e)=>Gc(n,e,i=>n[i][t]>=e);function ND(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 Vp=["push","pop","shift","splice","unshift"];function BD(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Vp.forEach(e=>{const i="_onData"+qc(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 Yp(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)&&(Vp.forEach(s=>{delete n[s]}),delete n._chartjs)}function qp(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const jp=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Gp(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,jp.call(window,()=>{i=!1,n.apply(t,e)}))}}function FD(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Kc=n=>n==="start"?"left":n==="end"?"right":"center",We=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,zD=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Kp(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,p=a.axis,{min:m,max:g,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(oi(u,p,m).lo,e?i:oi(t,p,a.getPixelForValue(m)).lo),d){const w=u.slice(0,r+1).reverse().findIndex(S=>!St(S[l.axis]));r-=Math.max(0,w)}r=Oe(r,0,i-1)}if(x){let w=Math.max(oi(u,a.axis,g,!0).hi+1,e?0:oi(t,p,a.getPixelForValue(g),!0).hi+1);if(d){const S=u.slice(w-1).findIndex(C=>!St(C[l.axis]));w+=Math.max(0,S)}s=Oe(w,r,i)-r}else s=i-r}return{start:r,count:s}}function Xp(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 Ma=n=>n===0||n===1,Zp=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),Qp=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,qs={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=>Ma(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=>Ma(n)?n:Zp(n,.075,.3),easeOutElastic:n=>Ma(n)?n:Qp(n,.075,.3),easeInOutElastic(n){return Ma(n)?n:n<.5?.5*Zp(n*2,.1125,.45):.5+.5*Qp(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-qs.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?qs.easeInBounce(n*2)*.5:qs.easeOutBounce(n*2-1)*.5+.5};function Xc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ka(n){return Xc(n)?n:new Hs(n)}function Zc(n){return Xc(n)?n:new Hs(n).saturate(.5).darken(.1).hexString()}const UD=["x","y","borderWidth","radius","tension"],HD=["color","borderColor","backgroundColor"];function WD(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:HD},numbers:{type:"number",properties:UD}}),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 $D(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Jp=new Map;function VD(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Jp.get(e);return i||(i=new Intl.NumberFormat(n,t),Jp.set(e,i)),i}function js(n,t,e){return VD(t,e).format(n)}const tm={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=YD(n,e)}const a=Ci(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),js(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Ci(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?tm.numeric.call(this,n,t,e):""}};function YD(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 Da={formatters:tm};function qD(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:Da.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 ar=Object.create(null),Qc=Object.create(null);function Gs(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 Jc(n,t,e){return typeof t=="string"?Ws(Gs(n,t),e):Ws(Gs(n,""),t)}class jD{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)=>Zc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Zc(r.borderColor),this.hoverColor=(i,r)=>Zc(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 Jc(this,t,e)}get(t){return Gs(this,t)}describe(t,e){return Jc(Qc,t,e)}override(t,e){return Jc(ar,t,e)}route(t,e,i,r){const s=Gs(this,t),a=Gs(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 It(u)?Object.assign({},d,u):Ct(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new jD({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[WD,$D,qD]);function GD(n){return!n||St(n.size)||St(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ca(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 KD(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,p,m,g;for(u=0;u<l;u++)if(m=e[u],m!=null&&!qt(m))a=Ca(n,r,s,a,m);else if(qt(m))for(d=0,p=m.length;d<p;d++)g=m[d],g!=null&&!qt(g)&&(a=Ca(n,r,s,a,g));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function lr(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 em(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function tu(n,t,e,i){nm(n,t,e,i,null)}function nm(n,t,e,i,r){let s,a,l,u,d,p,m,g;const _=t.pointStyle,x=t.rotation,w=t.radius;let S=(x||0)*jc;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(w)||w<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,w,0,0,te):n.arc(e,i,w,0,te),n.closePath();break;case"triangle":p=r?r/2:w,n.moveTo(e+Math.sin(S)*p,i-Math.cos(S)*w),S+=va,n.lineTo(e+Math.sin(S)*p,i-Math.cos(S)*w),S+=va,n.lineTo(e+Math.sin(S)*p,i-Math.cos(S)*w),n.closePath();break;case"rectRounded":d=w*.516,u=w-d,a=Math.cos(S+Dn)*u,m=Math.cos(S+Dn)*(r?r/2-d:u),l=Math.sin(S+Dn)*u,g=Math.sin(S+Dn)*(r?r/2-d:u),n.arc(e-m,i-l,d,S-Rt,S-re),n.arc(e+g,i-a,d,S-re,S),n.arc(e+m,i+l,d,S,S+re),n.arc(e-g,i+a,d,S+re,S+Rt),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*w,p=r?r/2:u,n.rect(e-p,i-u,2*p,2*u);break}S+=Dn;case"rectRot":m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+g,i-a),n.lineTo(e+m,i+l),n.lineTo(e-g,i+a),n.closePath();break;case"crossRot":S+=Dn;case"cross":m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+m,i+l),n.moveTo(e+g,i-a),n.lineTo(e-g,i+a);break;case"star":m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+m,i+l),n.moveTo(e+g,i-a),n.lineTo(e-g,i+a),S+=Dn,m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+m,i+l),n.moveTo(e+g,i-a),n.lineTo(e-g,i+a);break;case"line":a=r?r/2:Math.cos(S)*w,l=Math.sin(S)*w,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:w),i+Math.sin(S)*w);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ai(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 Ks(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Xs(n){n.restore()}function XD(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 ZD(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 QD(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),St(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function JD(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,p=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,p),n.lineTo(l,p),n.stroke()}}function tC(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function cr(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,QD(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&tC(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),St(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),JD(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Vr(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 eC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,nC=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function iC(n,t){const e=(""+n).match(eC);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 rC=n=>+n||0;function eu(n,t){const e={},i=It(t),r=i?Object.keys(t):t,s=It(n)?i?a=>Ct(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=rC(s(a));return e}function im(n){return eu(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ai(n){return eu(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ve(n){const t=im(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=Ct(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Ct(n.style,t.style);i&&!(""+i).match(nC)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ct(n.family,t.family),lineHeight:iC(Ct(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Ct(n.weight,t.weight),string:""};return r.string=GD(r),r}function Zs(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 sC(n,t,e){const{min:i,max:r}=n,s=Bp(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 Ei(n,t){return Object.assign(Object.create(n),t)}function nu(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=lm("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>nu([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 sm(l,u,()=>hC(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return cm(l).includes(u)},ownKeys(l){return cm(l)},set(l,u,d){const p=l._storage||(l._storage=r());return l[u]=p[u]=d,delete l._keys,!0}})}function Yr(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:rm(n,i),setContext:s=>Yr(n,s,e,i),override:s=>Yr(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 sm(s,a,()=>aC(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 rm(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:sn(e)?e:()=>e,isIndexable:sn(i)?i:()=>i}}const oC=(n,t)=>n?n+qc(t):t,iu=(n,t)=>It(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function sm(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function aC(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return sn(l)&&a.isScriptable(t)&&(l=lC(t,l,n,e)),qt(l)&&l.length&&(l=cC(t,l,n,a.isIndexable)),iu(t,l)&&(l=Yr(l,r,s&&s[t],a)),l}function lC(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),iu(n,u)&&(u=ru(r._scopes,r,n,u)),u}function cC(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(It(t[0])){const u=t,d=r._scopes.filter(p=>p!==u);t=[];for(const p of u){const m=ru(d,r,n,p);t.push(Yr(m,s,a&&a[n],l))}}return t}function om(n,t,e){return sn(n)?n(t,e):n}const uC=(n,t)=>n===!0?t:typeof n=="string"?Di(t,n):void 0;function dC(n,t,e,i,r){for(const s of t){const a=uC(e,s);if(a){n.add(a);const l=om(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 ru(n,t,e,i){const r=t._rootScopes,s=om(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=am(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=am(l,a,s,u,i),u===null)?!1:nu(Array.from(l),[""],r,s,()=>fC(t,e,i))}function am(n,t,e,i,r){for(;e;)e=dC(n,t,e,i,r);return e}function fC(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return qt(r)&&It(e)?e:r||{}}function hC(n,t,e,i){let r;for(const s of t)if(r=lm(oC(s,n),e),typeof r<"u")return iu(n,r)?ru(e,i,n,r):r}function lm(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function cm(n){let t=n._keys;return t||(t=n._keys=pC(n._scopes)),t}function pC(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 um(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,p;for(l=0,u=i;l<u;++l)d=l+e,p=t[d],a[l]={r:r.parse(Di(p,s),d)};return a}const mC=Number.EPSILON||1e-14,qr=(n,t)=>t<n.length&&!n[t].skip&&n[t],dm=n=>n==="x"?"y":"x";function gC(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=$r(s,r),u=$r(a,s);let d=l/(l+u),p=u/(l+u);d=isNaN(d)?0:d,p=isNaN(p)?0:p;const m=i*d,g=i*p;return{previous:{x:s.x-m*(a.x-r.x),y:s.y-m*(a.y-r.y)},next:{x:s.x+g*(a.x-r.x),y:s.y+g*(a.y-r.y)}}}function yC(n,t,e){const i=n.length;let r,s,a,l,u,d=qr(n,0);for(let p=0;p<i-1;++p)if(u=d,d=qr(n,p+1),!(!u||!d)){if(Vs(t[p],0,mC)){e[p]=e[p+1]=0;continue}r=e[p]/t[p],s=e[p+1]/t[p],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[p]=r*a*t[p],e[p+1]=s*a*t[p])}}function _C(n,t,e="x"){const i=dm(e),r=n.length;let s,a,l,u=qr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=qr(n,d+1),!l)continue;const p=l[e],m=l[i];a&&(s=(p-a[e])/3,l[`cp1${e}`]=p-s,l[`cp1${i}`]=m-s*t[d]),u&&(s=(u[e]-p)/3,l[`cp2${e}`]=p+s,l[`cp2${i}`]=m+s*t[d])}}function bC(n,t="x"){const e=dm(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=qr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=qr(n,a+1),!!u){if(d){const p=d[t]-u[t];r[a]=p!==0?(d[e]-u[e])/p:0}s[a]=l?d?qn(r[a-1])!==qn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}yC(n,r,s),_C(n,s,t)}function Oa(n,t,e){return Math.max(Math.min(n,e),t)}function xC(n,t){let e,i,r,s,a,l=ai(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&ai(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=Oa(r.cp1x,t.left,t.right),r.cp1y=Oa(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Oa(r.cp2x,t.left,t.right),r.cp2y=Oa(r.cp2y,t.top,t.bottom)))}function wC(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")bC(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=gC(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&&xC(n,e)}function su(){return typeof window<"u"&&typeof document<"u"}function ou(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Aa(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 Ea=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function vC(n,t){return Ea(n).getPropertyValue(t)}const SC=["top","right","bottom","left"];function ur(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=SC[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const TC=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function MC(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(TC(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 Ri(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Ea(e),s=r.boxSizing==="border-box",a=ur(r,"padding"),l=ur(r,"border","width"),{x:u,y:d,box:p}=MC(n,e),m=a.left+(p&&l.left),g=a.top+(p&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-m)/_*e.width/i),y:Math.round((d-g)/x*e.height/i)}}function kC(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&ou(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Ea(s),u=ur(l,"border","width"),d=ur(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Aa(l.maxWidth,s,"clientWidth"),r=Aa(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||wa,maxHeight:r||wa}}const Pi=n=>Math.round(n*10)/10;function DC(n,t,e,i){const r=Ea(n),s=ur(r,"margin"),a=Aa(r.maxWidth,n,"clientWidth")||wa,l=Aa(r.maxHeight,n,"clientHeight")||wa,u=kC(n,t,e);let{width:d,height:p}=u;if(r.boxSizing==="content-box"){const g=ur(r,"border","width"),_=ur(r,"padding");d-=_.width+g.width,p-=_.height+g.height}return d=Math.max(0,d-s.width),p=Math.max(0,i?d/i:p-s.height),d=Pi(Math.min(d,a,u.maxWidth)),p=Pi(Math.min(p,l,u.maxHeight)),d&&!p&&(p=Pi(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&p>u.height&&(p=u.height,d=Pi(Math.floor(p*i))),{width:d,height:p}}function fm(n,t,e){const i=t||1,r=Pi(n.height*i),s=Pi(n.width*i);n.height=Pi(n.height),n.width=Pi(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 CC=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};su()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function hm(n,t){const e=vC(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function dr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function OC(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 AC(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=dr(n,r,e),l=dr(r,s,e),u=dr(s,t,e),d=dr(a,l,e),p=dr(l,u,e);return dr(d,p,e)}const EC=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}}},RC=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function jr(n,t,e){return n?EC(t,e):RC()}function pm(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 mm(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function gm(n){return n==="angle"?{between:Ys,compare:PD,normalize:He}:{between:si,compare:(t,e)=>t-e,normalize:t=>t}}function ym({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 PC(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=gm(i),u=t.length;let{start:d,end:p,loop:m}=n,g,_;if(m){for(d+=u,p+=u,g=0,_=u;g<_&&a(l(t[d%u][i]),r,s);++g)d--,p--;d%=u,p%=u}return p<d&&(p+=u),{start:d,end:p,loop:m,style:n.style}}function _m(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=gm(i),{start:p,end:m,loop:g,style:_}=PC(n,t,e),x=[];let w=!1,S=null,C,A,B;const P=()=>u(r,B,C)&&l(r,B)!==0,I=()=>l(s,C)===0||u(s,B,C),$=()=>w||P(),z=()=>!w||I();for(let v=p,M=p;v<=m;++v)A=t[v%a],!A.skip&&(C=d(A[i]),C!==B&&(w=u(C,r,s),S===null&&$()&&(S=l(C,r)===0?v:M),S!==null&&z()&&(x.push(ym({start:S,end:v,loop:g,count:a,style:_})),S=null),M=v,B=C));return S!==null&&x.push(ym({start:S,end:m,loop:g,count:a,style:_})),x}function bm(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=_m(i[r],n.points,t);s.length&&e.push(...s)}return e}function IC(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 LC(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 NC(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=IC(e,r,s,i);if(i===!0)return xm(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 xm(n,LC(e,a,u,d),e,t)}function xm(n,t,e,i){return!i||!i.setContext||!e?t:BC(n,t,e,i)}function BC(n,t,e,i){const r=n._chart.getContext(),s=wm(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let p=s,m=t[0].start,g=m;function _(x,w,S,C){const A=l?-1:1;if(x!==w){for(x+=u;e[x%u].skip;)x-=A;for(;e[w%u].skip;)w+=A;x%u!==w%u&&(d.push({start:x%u,end:w%u,loop:S,style:C}),p=C,m=w%u)}}for(const x of t){m=l?m:x.start;let w=e[m%u],S;for(g=m+1;g<=x.end;g++){const C=e[g%u];S=wm(i.setContext(Ei(r,{type:"segment",p0:w,p1:C,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),FC(S,p)&&_(m,g-1,x.loop,p),w=C,p=S}m<g-1&&_(m,g-1,x.loop,p)}return d}function wm(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function FC(n,t){if(!t)return!1;const e=[],i=function(r,s){return Xc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Ra(n,t,e){return n.options.clip?n[e]:t[e]}function zC(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ra(e,t,"left"),right:Ra(e,t,"right"),top:Ra(i,t,"top"),bottom:Ra(i,t,"bottom")}:t}function vm(n,t){const e=t._clip;if(e.disabled)return!1;const i=zC(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 UC{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=jp.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 li=new UC;const Sm="transparent",HC={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=ka(n||Sm),r=i.valid&&ka(t||Sm);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class WC{constructor(t,e,i,r){const s=e[i];r=Zs([t.to,r,s,t.from]);const a=Zs([t.from,s,r]);this._active=!0,this._fn=t.fn||HC[t.type||typeof a],this._easing=qs[t.easing]||qs.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=Zs([t.to,e,r,t.from]),this._from=Zs([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 au{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!It(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!It(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=VC(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&$C(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 p=e[d];let m=s[d];const g=i.get(d);if(m)if(g&&m.active()){m.update(g,p,l);continue}else m.cancel();if(!g||!g.duration){t[d]=p;continue}s[d]=m=new WC(g,t,d,p),r.push(m)}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 li.add(this._chart,i),!0}}function $C(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 VC(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 Tm(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 YC(n,t,e){if(e===!1)return!1;const i=Tm(n,e),r=Tm(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function qC(n){let t,e,i,r;return It(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 Mm(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 km(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let p=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===e){if(p=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||qn(t)===qn(d))&&(t+=d)}return!p&&!i.all?0:t}function jC(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,p;for(u=0,d=a.length;u<d;++u)p=a[u],l[u]={[r]:p,[s]:n[p]};return l}function lu(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function GC(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function KC(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 XC(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Dm(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 Cm(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,p=GC(s,a,i),m=t.length;let g;for(let _=0;_<m;++_){const x=t[_],{[u]:w,[d]:S}=x,C=x._stacks||(x._stacks={});g=C[d]=XC(r,p,w),g[l]=S,g._top=Dm(g,a,!0,i.type),g._bottom=Dm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function cu(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function ZC(n,t){return Ei(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function QC(n,t,e){return Ei(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Qs(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 uu=n=>n==="reset"||n==="none",Om=(n,t)=>t?n:Object.assign({},n),JC=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Mm(e,!0),values:null};class Ii{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=lu(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&&Qs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(m,g,_,x)=>m==="x"?g:m==="r"?x:_,s=e.xAxisID=Ct(i.xAxisID,cu(t,"x")),a=e.yAxisID=Ct(i.yAxisID,cu(t,"y")),l=e.rAxisID=Ct(i.rAxisID,cu(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),p=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(p)}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&&Yp(this._data,this),t._stacked&&Qs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(It(e)){const r=this._cachedMeta;this._data=jC(e,r)}else if(i!==e){if(i){Yp(i,this);const r=this._cachedMeta;Qs(r),r._parsed=[]}e&&Object.isExtensible(e)&&BD(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=lu(e.vScale,e),e.stack!==i.stack&&(r=!0,Qs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(Cm(this,e._parsed),e._stacked=lu(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],p,m,g;if(this._parsing===!1)i._parsed=r,i._sorted=!0,g=r;else{qt(r[t])?g=this.parseArrayData(i,r,t,e):It(r[t])?g=this.parseObjectData(i,r,t,e):g=this.parsePrimitiveData(i,r,t,e);const _=()=>m[l]===null||d&&m[l]<d[l];for(p=0;p<e;++p)i._parsed[p+t]=m=g[p],u&&(_()&&(u=!1),d=m);i._sorted=u}a&&Cm(this,g)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),p=s===a,m=new Array(r);let g,_,x;for(g=0,_=r;g<_;++g)x=g+i,m[g]={[l]:p||s.parse(d[x],x),[u]:a.parse(e[x],x)};return m}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,p,m;for(u=0,d=r;u<d;++u)p=u+i,m=e[p],l[u]={x:s.parse(m[0],p),y:a.parse(m[1],p)};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 p,m,g,_;for(p=0,m=r;p<m;++p)g=p+i,_=e[g],d[p]={x:s.parse(Di(_,l),g),y:a.parse(Di(_,u),g)};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:Mm(r,!0),values:e._stacks[t.axis]._visualValues};return km(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=km(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=JC(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:p,max:m}=KC(l);let g,_;function x(){_=r[g];const w=_[l.axis];return!ae(_[t.axis])||p>w||m<w}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++g);if(s){for(g=a-1;g>=0;--g)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const 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=qC(Ct(this.options.clip,YC(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 p;for(i.dataset&&i.dataset.draw(t,s,l,u),p=l;p<l+u;++p){const m=r[p];m.hidden||(m.active&&d?a.push(m):m.draw(t,s))}for(p=0;p<a.length;++p)a[p].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=QC(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=ZC(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&&rn(i);if(l)return Om(l,u);const d=this.chart.config,p=d.datasetElementScopeKeys(this._type,t),m=r?[`${t}Hover`,"hover",t,""]:[t,""],g=d.getOptionScopes(this.getDataset(),p),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),w=d.resolveNamedOptions(g,_,x,m);return w.$shared&&(w.$shared=u,s[a]=Object.freeze(Om(w,u))),w}_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 p=this.chart.config,m=p.datasetAnimationScopeKeys(this._type,e),g=p.getOptionScopes(this.getDataset(),m);u=p.createResolver(g,this.getContext(t,i,e))}const d=new au(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||uu(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){uu(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!uu(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&&Qs(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 tO(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=qp(i.sort((r,s)=>r-s))}return n._cache.$bar}function eO(n){const t=n.iScale,e=tO(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(rn(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=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 nO(n,t,e,i){const r=e.barThickness;let s,a;return St(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 iO(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 rO(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 Am(n,t,e,i){return qt(n)?rO(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Em(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,p,m,g;for(d=e,p=e+i;d<p;++d)g=t[d],m={},m[r.axis]=l||r.parse(a[d],d),u.push(Am(g,m,s,d));return u}function du(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function sO(n,t,e){return n!==0?qn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function oO(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 aO(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:p}=oO(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=p:(s[Rm(p,a,l,u)]=!0,r=d)),s[Rm(r,a,l,u)]=!0,n.borderSkipped=s}function Rm(n,t,e,i){return i?(n=lO(n,t,e),n=Pm(n,e,t)):n=Pm(n,t,e),n}function lO(n,t,e){return n===t?e:n===e?t:n}function Pm(n,t,e){return n==="start"?t:n==="end"?e:n}function cO(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Im extends Ii{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 Em(t,e,i,r)}parseArrayData(t,e,i,r){return Em(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,p=a.axis==="x"?l:u,m=[];let g,_,x,w;for(g=i,_=i+r;g<_;++g)w=e[g],x={},x[s.axis]=s.parse(Di(w,d),g),m.push(Am(Di(w,p),x,a,g));return m}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=du(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(),p=this._getRuler(),{sharedOptions:m,includeOptions:g}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),w=s||St(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,p),C=(x._stacks||{})[l.axis],A={horizontal:d,base:w.base,enableBorderRadius:!C||du(x._custom)||a===C._top||a===C._bottom,x:d?w.head:S.center,y:d?S.center:w.head,height:d?S.size:Math.abs(w.size),width:d?Math.abs(w.size):S.size};g&&(A.options=m||this.resolveDataElementOptions(_,t[_].active?"active":r));const B=A.options||t[_].options;aO(A,B,C,a),cO(A,B,p.ratio),this.updateElement(t[_],_,A,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(p=>p.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),u=l&&l[i.axis],d=p=>{const m=p._parsed.find(_=>_[i.axis]===u),g=m&&m[p.vScale.axis];if(St(g)||isNaN(g))return!0};for(const p of r)if(!(e!==void 0&&d(p))&&((s===!1||a.indexOf(p.stack)===-1||s===void 0&&p.stack===void 0)&&a.push(p.stack),p.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[Ct(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||eO(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,p=du(d);let m=u[e.axis],g=0,_=i?this.applyStack(e,u,i):m,x,w;_!==m&&(g=_-m,_=m),p&&(m=d.barStart,_=d.barEnd-d.barStart,m!==0&&qn(m)!==qn(d.barEnd)&&(g=0),g+=m);const S=!St(s)&&!p?s:g;let C=e.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(g+_):x=C,w=x-C,Math.abs(w)<a){w=sO(w,e,l)*a,m===l&&(C-=w/2);const A=e.getPixelForDecimal(0),B=e.getPixelForDecimal(1),P=Math.min(A,B),I=Math.max(A,B);C=Math.max(Math.min(C,I),P),x=C+w,i&&!p&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const A=qn(w)*e.getLineWidthForValue(l)/2;C+=A,w-=A}return{size:w,base:C,head:x,center:x+w/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Ct(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(e.grouped){const p=s?this._getStackCount(t):e.stackCount,m=r.barThickness==="flex"?iO(t,e,r,p*d):nO(t,e,r,p*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ct(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=m.start+m.chunk*x+m.chunk/2,u=Math.min(a,m.chunk*m.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,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 uO extends Ii{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=Ct(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=Ct(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),p=a.axis,m=l.axis;for(let g=e;g<e+i;g++){const _=t[g],x=!s&&this.getParsed(g),w={},S=w[p]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[p]),C=w[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);w.skip=isNaN(S)||isNaN(C),d&&(w.options=u||this.resolveDataElementOptions(g,_.active?"active":r),s&&(w.options.radius=0)),this.updateElement(_,g,w,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+=Ct(i&&i._custom,s),r}}function dO(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),p=Math.sin(l),m=Math.cos(u),g=Math.sin(u),_=(B,P,I)=>Ys(B,l,u,!0)?1:Math.max(P,P*e,I,I*e),x=(B,P,I)=>Ys(B,l,u,!0)?-1:Math.min(P,P*e,I,I*e),w=_(0,d,m),S=_(re,p,g),C=x(Rt,d,m),A=x(Rt+re,p,g);i=(w-C)/2,r=(S-A)/2,s=-(w+C)/2,a=-(S+A)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Js extends Ii{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 m=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:m.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:m.borderDash,lineDashOffset:m.borderDashOffset,lineJoin:m.borderJoinStyle,lineWidth:m.borderWidth,strokeStyle:m.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||m.borderRadius),index:d}}):[]}},onClick(t,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(It(i[t])){const{key:u="value"}=this._parsing;s=d=>+Di(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return we(this.options.rotation-90)}_getCircumference(){return we(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(SD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:p,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:_,offsetX:x,offsetY:w}=dO(m,p,u),S=(i.width-a)/g,C=(i.height-a)/_,A=Math.max(Math.min(S,C)/2,0),B=Bp(this.options.radius,A),P=Math.max(B*u,0),I=(B-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*B,this.offsetY=w*B,r.total=this.calculateTotal(),this.outerRadius=B-I*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-I*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,p=(l.left+l.right)/2,m=(l.top+l.bottom)/2,g=s&&d.animateScale,_=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:w,includeOptions:S}=this._getSharedOptions(e,r);let C=this._getRotation(),A;for(A=0;A<e;++A)C+=this._circumference(A,s);for(A=e;A<e+i;++A){const B=this._circumference(A,s),P=t[A],I={x:p+this.offsetX,y:m+this.offsetY,startAngle:C,endAngle:C+B,circumference:B,outerRadius:x,innerRadius:_};S&&(I.options=w||this.resolveDataElementOptions(A,P.active?"active":r)),C+=B,this.updateElement(P,A,I,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=js(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(Ct(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Lm extends Ii{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}=Kp(e,r,a);this._drawStart=l,this._drawCount=u,Xp(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:p,includeOptions:m}=this._getSharedOptions(e,r),g=a.axis,_=l.axis,{spanGaps:x,segment:w}=this.options,S=Oi(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",A=e+i,B=t.length;let P=e>0&&this.getParsed(e-1);for(let I=0;I<B;++I){const $=t[I],z=C?$:{};if(I<e||I>=A){z.skip=!0;continue}const v=this.getParsed(I),M=St(v[_]),O=z[g]=a.getPixelForValue(v[g],I),N=z[_]=s||M?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,v,u):v[_],I);z.skip=isNaN(O)||isNaN(N)||M,z.stop=I>0&&Math.abs(v[g]-P[g])>S,w&&(z.parsed=v,z.raw=d.data[I]),m&&(z.options=p||this.resolveDataElementOptions(I,$.active?"active":r)),C||this.updateElement($,I,z,r),P=v}}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 Nm extends Ii{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=js(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return um.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,p=d.xCenter,m=d.yCenter,g=d.getIndexAngle(0)-.5*Rt;let _=g,x;const w=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,w);for(x=e;x<e+i;x++){const S=t[x];let C=_,A=_+this._computeAngle(x,r,w),B=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(B=0),u.animateRotate&&(C=A=g));const P={x:p,y:m,innerRadius:0,outerRadius:B,startAngle:C,endAngle:A,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)?we(this.resolveDataElementOptions(t,e).angle||i):0}}class fO extends Js{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class hO extends Ii{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 um.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),p=s.getPointPositionForValue(l,this.getParsed(l).r),m=a?s.xCenter:p.x,g=a?s.yCenter:p.y,_={x:m,y:g,angle:p.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,_,r)}}}class Bm extends Ii{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}=Kp(e,i,r);if(this._drawStart=s,this._drawCount=a,Xp(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,p=this.resolveDataElementOptions(e,r),m=this.getSharedOptions(p),g=this.includeOptions(r,m),_=a.axis,x=l.axis,{spanGaps:w,segment:S}=this.options,C=Oi(w)?w:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let B=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const I=t[P],$=this.getParsed(P),z=A?I:{},v=St($[x]),M=z[_]=a.getPixelForValue($[_],P),O=z[x]=s||v?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,$,u):$[x],P);z.skip=isNaN(M)||isNaN(O)||v,z.stop=P>0&&Math.abs($[_]-B[_])>C,S&&(z.parsed=$,z.raw=d.data[P]),g&&(z.options=m||this.resolveDataElementOptions(P,I.active?"active":r)),A||this.updateElement(I,P,z,r),B=$}this.updateSharedOptions(m,r,p)}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 pO=Object.freeze({__proto__:null,BarController:Im,BubbleController:uO,DoughnutController:Js,LineController:Lm,PieController:fO,PolarAreaController:Nm,RadarController:hO,ScatterController:Bm});function fr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class fu{static override(t){Object.assign(fu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return fr()}parse(){return fr()}format(){return fr()}add(){return fr()}diff(){return fr()}startOf(){return fr()}endOf(){return fr()}}var Fm={_date:fu};function mO(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?LD:oi;if(i){if(r._sharedOptions){const p=s[0],m=typeof p.getRange=="function"&&p.getRange(t);if(m){const g=d(s,t,e-m),_=d(s,t,e+m);return{lo:g.lo,hi:_.hi}}}}else{const p=d(s,t,e);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=n,_=g.slice(0,p.lo+1).reverse().findIndex(w=>!St(w[m.axis]));p.lo-=Math.max(0,_);const x=g.slice(p.hi).findIndex(w=>!St(w[m.axis]));p.hi+=Math.max(0,x)}return p}}return{lo:0,hi:s.length-1}}function to(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:p}=s[l],{lo:m,hi:g}=mO(s[l],t,a,r);for(let _=m;_<=g;++_){const x=p[_];x.skip||i(x,d,_)}}}function gO(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 hu(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||to(n,e,t,function(l,u,d){!r&&!ai(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function yO(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:p}=a.getProps(["startAngle","endAngle"],i),{angle:m}=Ta(a,{x:t.x,y:t.y});Ys(m,d,p)&&r.push({element:a,datasetIndex:l,index:u})}return to(n,e,t,s),r}function _O(n,t,e,i,r,s){let a=[];const l=gO(e);let u=Number.POSITIVE_INFINITY;function d(p,m,g){const _=p.inRange(t.x,t.y,r);if(i&&!_)return;const x=p.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const S=l(t,x);S<u?(a=[{element:p,datasetIndex:m,index:g}],u=S):S===u&&a.push({element:p,datasetIndex:m,index:g})}return to(n,e,t,d),a}function pu(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?yO(n,t,e,r):_O(n,t,e,i,r,s)}function zm(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return to(n,e,t,(u,d,p)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:p}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var mu={evaluateInteractionItems:to,modes:{index(n,t,e,i){const r=Ri(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?hu(n,r,s,i,a):pu(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const p=l[0].index,m=d.data[p];m&&!m.skip&&u.push({element:m,datasetIndex:d.index,index:p})}),u):[]},dataset(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?hu(n,r,s,i,a):pu(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let p=0;p<d.length;++p)l.push({element:d[p],datasetIndex:u,index:p})}return l},point(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return hu(n,r,s,i,a)},nearest(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return pu(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ri(t,n);return zm(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ri(t,n);return zm(n,r,"y",e.intersect,i)}}};const Um=["left","top","right","bottom"];function eo(n,t){return n.filter(e=>e.pos===t)}function Hm(n,t){return n.filter(e=>Um.indexOf(e.pos)===-1&&e.box.axis===t)}function no(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 bO(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 xO(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Um.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 wO(n,t){const e=xO(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],p=d&&l.stackWeight/d.weight;l.horizontal?(l.width=p?p*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=p?p*r:u&&t.availableHeight)}return e}function vO(n){const t=bO(n),e=no(t.filter(d=>d.box.fullSize),!0),i=no(eo(t,"left"),!0),r=no(eo(t,"right")),s=no(eo(t,"top"),!0),a=no(eo(t,"bottom")),l=Hm(t,"x"),u=Hm(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:eo(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Wm(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function $m(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 SO(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!It(r)){e.size&&(n[r]-=e.size);const m=i[e.stack]||{size:0,count:1};m.size=Math.max(m.size,e.horizontal?s.height:s.width),e.size=m.size/m.count,n[r]+=e.size}s.getPadding&&$m(a,s.getPadding());const l=Math.max(0,t.outerWidth-Wm(a,n,"left","right")),u=Math.max(0,t.outerHeight-Wm(a,n,"top","bottom")),d=l!==n.w,p=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:p}:{same:p,other:d}}function TO(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 MO(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 io(n,t,e,i){const r=[];let s,a,l,u,d,p;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,MO(l.horizontal,t));const{same:m,other:g}=SO(t,e,l,i);d|=m&&r.length,p=p||g,u.fullSize||r.push(l)}return d&&io(r,t,e,i)||p}function Pa(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 Vm(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},p=l.stackWeight/d.weight||1;if(l.horizontal){const m=t.w*p,g=d.size||u.height;rn(d.start)&&(a=d.start),u.fullSize?Pa(u,r.left,a,e.outerWidth-r.right-r.left,g):Pa(u,t.left+d.placed,a,m,g),d.start=a,d.placed+=m,a=u.bottom}else{const m=t.h*p,g=d.size||u.width;rn(d.start)&&(s=d.start),u.fullSize?Pa(u,s,r.top,g,e.outerHeight-r.bottom-r.top):Pa(u,s,t.top+d.placed,g,m),d.start=s,d.placed+=m,s=u.right}}t.x=s,t.y=a}var $e={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=ve(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=vO(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.boxes,w=>{typeof w.beforeLayout=="function"&&w.beforeLayout()});const p=u.reduce((w,S)=>S.box.options&&S.box.options.display===!1?w:w+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/p,hBoxMaxHeight:a/2}),g=Object.assign({},r);$m(g,ve(i));const _=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=wO(u.concat(d),m);io(l.fullSize,_,m,x),io(u,_,m,x),io(d,_,m,x)&&io(u,_,m,x),TO(_),Vm(l.leftAndTop,_,m,x),_.x+=_.w,_.y+=_.h,Vm(l.rightAndBottom,_,m,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,w=>{const S=w.box;Object.assign(S,n.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Ym{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 kO extends Ym{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ia="$chartjs",DO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},qm=n=>n===null||n==="";function CO(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ia]={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",qm(r)){const s=hm(n,"width");s!==void 0&&(n.width=s)}if(qm(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=hm(n,"height");s!==void 0&&(n.height=s)}return n}const jm=CC?{passive:!0}:!1;function OO(n,t,e){n&&n.addEventListener(t,e,jm)}function AO(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,jm)}function EO(n,t){const e=DO[n.type]||n.type,{x:i,y:r}=Ri(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function La(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function RO(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||La(l.addedNodes,i),a=a&&!La(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function PO(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||La(l.removedNodes,i),a=a&&!La(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const ro=new Map;let Gm=0;function Km(){const n=window.devicePixelRatio;n!==Gm&&(Gm=n,ro.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function IO(n,t){ro.size||window.addEventListener("resize",Km),ro.set(n,t)}function LO(n){ro.delete(n),ro.size||window.removeEventListener("resize",Km)}function NO(n,t,e){const i=n.canvas,r=i&&ou(i);if(!r)return;const s=Gp((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,p=u.contentRect.height;d===0&&p===0||s(d,p)});return a.observe(r),IO(n,s),a}function gu(n,t,e){e&&e.disconnect(),t==="resize"&&LO(n)}function BO(n,t,e){const i=n.canvas,r=Gp(s=>{n.ctx!==null&&e(EO(s,n))},n);return OO(i,t,r),r}class FO extends Ym{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(CO(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ia])return!1;const i=e[Ia].initial;["height","width"].forEach(s=>{const a=i[s];St(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[Ia],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:RO,detach:PO,resize:NO}[e]||BO;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]||AO)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return DC(t,e,i,r)}isAttached(t){const e=t&&ou(t);return!!(e&&e.isConnected)}}function zO(n){return!su()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?kO:FO}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 Oi(this.x)&&Oi(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 UO(n,t){const e=n.options.ticks,i=HO(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?$O(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return VO(t,d,s,a/r),d;const p=WO(s,t,r);if(a>0){let m,g;const _=a>1?Math.round((u-l)/(a-1)):null;for(Na(t,d,p,St(_)?0:l-_,l),m=0,g=a-1;m<g;m++)Na(t,d,p,s[m],s[m+1]);return Na(t,d,p,u,St(_)?t.length:u+_),d}return Na(t,d,p),d}function HO(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 WO(n,t,e){const i=YO(n),r=t.length/e;if(!i)return Math.max(r,1);const s=AD(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 $O(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function VO(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 Na(n,t,e,i,r){const s=Ct(i,0),a=Math.min(Ct(r,n.length),n.length);let l=0,u,d,p;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),p=s;p<0;)l++,p=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===p&&(t.push(n[d]),l++,p=Math.round(s+l*e))}function YO(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 qO=n=>n==="left"?"right":n==="right"?"left":n,Xm=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Zm=(n,t)=>Math.min(t||n,n);function Qm(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 jO(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 GO(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 so(n){return n.drawTicks?n.tickLength:0}function Jm(n,t){if(!n.display)return 0;const e=le(n.font,t),i=ve(n.padding);return(qt(n.text)?n.text.length:1)*e.lineHeight+i.height}function KO(n,t){return Ei(n,{scale:t,type:"scale"})}function XO(n,t,e){return Ei(n,{tick:e,index:t,type:"tick"})}function ZO(n,t,e){let i=Kc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=qO(i)),i}function QO(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:p}=u;let m=0,g,_,x;const w=a-r,S=l-s;if(n.isHorizontal()){if(_=We(i,s,l),It(e)){const C=Object.keys(e)[0],A=e[C];x=p[C].getPixelForValue(A)+w-t}else e==="center"?x=(d.bottom+d.top)/2+w-t:x=Xm(n,e,t);g=l-s}else{if(It(e)){const C=Object.keys(e)[0],A=e[C];_=p[C].getPixelForValue(A)-S+t}else e==="center"?_=(d.left+d.right)/2-S+t:_=Xm(n,e,t);x=We(i,a,r),m=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:g,rotation:m}}class hr 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=mn(t,Number.POSITIVE_INFINITY),e=mn(e,Number.NEGATIVE_INFINITY),i=mn(i,Number.POSITIVE_INFINITY),r=mn(r,Number.NEGATIVE_INFINITY),{min:mn(t,i),max:mn(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:mn(e,mn(i,e)),max:mn(i,mn(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=sC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?Qm(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=UO(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=Zm(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 p=this._getLabelSizes(),m=p.widest.width,g=p.highest.height,_=Oe(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),m+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-so(t.grid)-e.padding-Jm(t.title,this.chart.options.font),d=Math.sqrt(m*m+g*g),a=Sa(Math.min(Math.asin(Oe((p.highest.height+6)/l,-1,1)),Math.asin(Oe(u/d,-1,1))-Math.asin(Oe(g/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=Jm(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=so(s)+u):(t.height=this.maxHeight,t.width=so(s)+u),i.display&&this.ticks.length){const{first:d,last:p,widest:m,highest:g}=this._getLabelSizes(),_=i.padding*2,x=we(this.labelRotation),w=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*m.width+w*g.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:w*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,p,S,w)}}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 p=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,_=0;u?d?(g=r*t.width,_=i*e.height):(g=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,_=e.width/2),this.paddingLeft=Math.max((g-p+a)*this.width/(this.width-p),0),this.paddingRight=Math.max((_-m+a)*this.width/(this.width-m),0)}else{let p=e.height/2,m=t.height/2;s==="start"?(p=0,m=t.height):s==="end"&&(p=e.height,m=0),this.paddingTop=p+a,this.paddingBottom=m+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){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++)St(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Qm(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/Zm(e,i));let d=0,p=0,m,g,_,x,w,S,C,A,B,P,I;for(m=0;m<e;m+=u){if(x=t[m].label,w=this._resolveTickFontOptions(m),r.font=S=w.string,C=s[S]=s[S]||{data:{},gc:[]},A=w.lineHeight,B=P=0,!St(x)&&!qt(x))B=Ca(r,C.data,C.gc,B,x),P=A;else if(qt(x))for(g=0,_=x.length;g<_;++g)I=x[g],!St(I)&&!qt(I)&&(B=Ca(r,C.data,C.gc,B,I),P+=A);a.push(B),l.push(P),d=Math.max(B,d),p=Math.max(P,p)}GO(s,e);const $=a.indexOf(d),z=l.indexOf(p),v=M=>({width:a[M]||0,height:l[M]||0});return{first:v(0),last:v(e-1),widest:v($),highest:v(z),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 ID(this._alignToPixels?lr(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=XO(this.getContext(),t,i))}return this.$context||(this.$context=KO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=we(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(),m=this.ticks.length+(u?1:0),g=so(s),_=[],x=l.setContext(this.getContext()),w=x.display?x.width:0,S=w/2,C=function(ht){return lr(i,ht,w)};let A,B,P,I,$,z,v,M,O,N,W,G;if(a==="top")A=C(this.bottom),z=this.bottom-g,M=A-S,N=C(t.top)+S,G=t.bottom;else if(a==="bottom")A=C(this.top),N=t.top,G=C(t.bottom)-S,z=A+S,M=this.top+g;else if(a==="left")A=C(this.right),$=this.right-g,v=A-S,O=C(t.left)+S,W=t.right;else if(a==="right")A=C(this.left),O=t.left,W=C(t.right)-S,$=A+S,v=this.left+g;else if(e==="x"){if(a==="center")A=C((t.top+t.bottom)/2+.5);else if(It(a)){const ht=Object.keys(a)[0],dt=a[ht];A=C(this.chart.scales[ht].getPixelForValue(dt))}N=t.top,G=t.bottom,z=A+S,M=z+g}else if(e==="y"){if(a==="center")A=C((t.left+t.right)/2);else if(It(a)){const ht=Object.keys(a)[0],dt=a[ht];A=C(this.chart.scales[ht].getPixelForValue(dt))}$=A-S,v=$-g,O=t.left,W=t.right}const lt=Ct(r.ticks.maxTicksLimit,m),ut=Math.max(1,Math.ceil(m/lt));for(B=0;B<m;B+=ut){const ht=this.getContext(B),dt=s.setContext(ht),bt=l.setContext(ht),at=dt.lineWidth,ct=dt.color,V=bt.dash||[],L=bt.dashOffset,H=dt.tickWidth,it=dt.tickColor,st=dt.tickBorderDash||[],X=dt.tickBorderDashOffset;P=jO(this,B,u),P!==void 0&&(I=lr(i,P,at),d?$=v=O=W=I:z=M=N=G=I,_.push({tx1:$,ty1:z,tx2:v,ty2:M,x1:O,y1:N,x2:W,y2:G,width:at,color:ct,borderDash:V,borderDashOffset:L,tickWidth:H,tickColor:it,tickBorderDash:st,tickBorderDashOffset:X}))}return this._ticksLength=m,this._borderValue=A,_}_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:p,mirror:m}=s,g=so(i.grid),_=g+p,x=m?-p:_,w=-we(this.labelRotation),S=[];let C,A,B,P,I,$,z,v,M,O,N,W,G="middle";if(r==="top")$=this.bottom-x,z=this._getXAxisLabelAlignment();else if(r==="bottom")$=this.top+x,z=this._getXAxisLabelAlignment();else if(r==="left"){const ut=this._getYAxisLabelAlignment(g);z=ut.textAlign,I=ut.x}else if(r==="right"){const ut=this._getYAxisLabelAlignment(g);z=ut.textAlign,I=ut.x}else if(e==="x"){if(r==="center")$=(t.top+t.bottom)/2+_;else if(It(r)){const ut=Object.keys(r)[0],ht=r[ut];$=this.chart.scales[ut].getPixelForValue(ht)+_}z=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")I=(t.left+t.right)/2-_;else if(It(r)){const ut=Object.keys(r)[0],ht=r[ut];I=this.chart.scales[ut].getPixelForValue(ht)}z=this._getYAxisLabelAlignment(g).textAlign}e==="y"&&(u==="start"?G="top":u==="end"&&(G="bottom"));const lt=this._getLabelSizes();for(C=0,A=l.length;C<A;++C){B=l[C],P=B.label;const ut=s.setContext(this.getContext(C));v=this.getPixelForTick(C)+s.labelOffset,M=this._resolveTickFontOptions(C),O=M.lineHeight,N=qt(P)?P.length:1;const ht=N/2,dt=ut.color,bt=ut.textStrokeColor,at=ut.textStrokeWidth;let ct=z;a?(I=v,z==="inner"&&(C===A-1?ct=this.options.reverse?"left":"right":C===0?ct=this.options.reverse?"right":"left":ct="center"),r==="top"?d==="near"||w!==0?W=-N*O+O/2:d==="center"?W=-lt.highest.height/2-ht*O+O:W=-lt.highest.height+O/2:d==="near"||w!==0?W=O/2:d==="center"?W=lt.highest.height/2-ht*O:W=lt.highest.height-N*O,m&&(W*=-1),w!==0&&!ut.showLabelBackdrop&&(I+=O/2*Math.sin(w))):($=v,W=(1-N)*O/2);let V;if(ut.showLabelBackdrop){const L=ve(ut.backdropPadding),H=lt.heights[C],it=lt.widths[C];let st=W-L.top,X=0-L.left;switch(G){case"middle":st-=H/2;break;case"bottom":st-=H;break}switch(z){case"center":X-=it/2;break;case"right":X-=it;break;case"inner":C===A-1?X-=it:C>0&&(X-=it/2);break}V={left:X,top:st,width:it+L.width,height:H+L.height,color:ut.backdropColor}}S.push({label:P,font:M,textOffset:W,options:{rotation:w,color:dt,strokeColor:bt,strokeWidth:at,textAlign:ct,textBaseline:G,translation:[I,$],backdrop:V}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-we(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,p;return e==="left"?r?(p=this.right+s,i==="near"?d="left":i==="center"?(d="center",p+=u/2):(d="right",p+=u)):(p=this.right-l,i==="near"?d="right":i==="center"?(d="center",p-=u/2):(d="left",p=this.left)):e==="right"?r?(p=this.left+s,i==="near"?d="right":i==="center"?(d="center",p-=u/2):(d="left",p-=u)):(p=this.left+l,i==="near"?d="left":i==="center"?(d="center",p+=u/2):(d="right",p=this.right)):d="right",{textAlign:d,x:p}}_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,p)=>{!p.width||!p.color||(i.save(),i.lineWidth=p.width,i.strokeStyle=p.color,i.setLineDash(p.borderDash||[]),i.lineDashOffset=p.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,p,m,g;this.isHorizontal()?(d=lr(t,this.left,a)-a/2,p=lr(t,this.right,l)+l/2,m=g=u):(m=lr(t,this.top,a)-a/2,g=lr(t,this.bottom,l)+l/2,d=p=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,m),e.lineTo(p,g),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Ks(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,p=a.textOffset;cr(i,d,0,p,u,l)}r&&Xs(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=ve(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||It(e)?(u+=a.bottom,qt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:p,maxWidth:m,rotation:g}=QO(this,u,e,l);cr(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:ZO(l,e,r),textBaseline:"middle",translation:[d,p]})}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=Ct(t.grid&&t.grid.z,-1),r=Ct(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==hr.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 Ba{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;eA(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,JO(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 ar[i])}}function JO(n,t,e){const i=Ws(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&tA(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function tA(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 eA(n){return"id"in n&&"defaults"in n}class nA{constructor(){this.controllers=new Ba(Ii,"datasets",!0),this.elements=new Ba(Ve,"elements"),this.plugins=new Ba(Object,"plugins"),this.scales=new Ba(hr,"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=qc(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 jn=new nA;class iA{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(){St(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Ct(i.options&&i.options.plugins,{}),s=rA(i);return r===!1&&!e?[]:oA(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 rA(n){const t={},e=[],i=Object.keys(jn.plugins.items);for(let s=0;s<i.length;s++)e.push(jn.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 sA(n,t){return!t&&n===!1?null:n===!0?{}:n}function oA(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=sA(i[u],r);d!==null&&s.push({plugin:l,options:aA(n.config,{plugin:l,local:e[u]},d,a)})}return s}function aA(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 yu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function lA(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function cA(n,t){return n===t?"_index_":"_value_"}function tg(n){if(n==="x"||n==="y"||n==="r")return n}function uA(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function _u(n,...t){if(tg(n))return n;for(const e of t){const i=e.axis||uA(e.position)||n.length>1&&tg(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function eg(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function dA(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 eg(n,"x",e[0])||eg(n,"y",e[0])}return{}}function fA(n,t){const e=ar[n.type]||{scales:{}},i=t.scales||{},r=yu(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!It(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=_u(a,l,dA(a,n),se.scales[l.type]),d=cA(u,r),p=e.scales||{};s[a]=$s(Object.create(null),[{axis:u},l,p[u],p[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||yu(l,t),p=(ar[l]||{}).scales||{};Object.keys(p).forEach(m=>{const g=lA(m,u),_=a[g+"AxisID"]||g;s[_]=s[_]||Object.create(null),$s(s[_],[{axis:g},i[_],p[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];$s(l,[se.scales[l.type],se.scale])}),s}function ng(n){const t=n.options||(n.options={});t.plugins=Ct(t.plugins,{}),t.scales=fA(n,t)}function ig(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function hA(n){return n=n||{},n.data=ig(n.data),ng(n),n}const rg=new Map,sg=new Set;function Fa(n,t){let e=rg.get(n);return e||(e=t(),rg.set(n,e),sg.add(e)),e}const oo=(n,t,e)=>{const i=Di(t,e);i!==void 0&&n.add(i)};class pA{constructor(t){this._config=hA(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=ig(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(),ng(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fa(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Fa(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Fa(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Fa(`${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(p=>{t&&(u.add(t),p.forEach(m=>oo(u,t,m))),p.forEach(m=>oo(u,r,m)),p.forEach(m=>oo(u,ar[s]||{},m)),p.forEach(m=>oo(u,se,m)),p.forEach(m=>oo(u,Qc,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),sg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,ar[e]||{},se.datasets[e]||{},{type:e},se,Qc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=og(this._resolverCache,t,r);let u=a;if(gA(a,e)){s.$shared=!1,i=sn(i)?i():i;const d=this.createResolver(t,i,l);u=Yr(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=og(this._resolverCache,t,i);return It(e)?Yr(s,e,void 0,r):s}}function og(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:nu(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const mA=n=>It(n)&&Object.getOwnPropertyNames(n).some(t=>sn(n[t]));function gA(n,t){const{isScriptable:e,isIndexable:i}=rm(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(sn(l)||mA(l))||a&&qt(l))return!0}return!1}var yA="4.5.1";const _A=["top","bottom","left","right","chartArea"];function ag(n,t){return n==="top"||n==="bottom"||_A.indexOf(n)===-1&&t==="x"}function lg(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function cg(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function bA(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function ug(n){return su()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const za={},dg=n=>{const t=ug(n);return Object.values(za).filter(e=>e.canvas===t).pop()};function xA(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 wA(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let on=class{static defaults=se;static instances=za;static overrides=ar;static registry=jn;static version=yA;static getChart=dg;static register(...t){jn.add(...t),fg()}static unregister(...t){jn.remove(...t),fg()}constructor(t,e){const i=this.config=new pA(e),r=ug(t),s=dg(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||zO(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,p=u&&u.width;if(this.id=vD(),this.ctx=l,this.canvas=u,this.width=p,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 iA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=FD(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],za[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",cg),li.listen(this,"progress",bA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return St(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 jn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():fm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return em(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(t,e){li.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,fm(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=_u(a,l),d=u==="r",p=u==="x";return{options:l,dposition:d?"chartArea":p?"bottom":"left",dtype:d?"radialLinear":p?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=_u(u,l),p=Ct(l.type,a.dtype);(l.position===void 0||ag(l.position,d)!==ag(a.dposition))&&(l.position=a.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===p)m=i[u];else{const g=jn.getScale(p);m=new g({id:u,type:p,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{$e.configure(this,a,a.options),$e.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(lg("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||yu(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=jn.getController(l),{datasetElementType:d,dataElementType:p}=se.datasets[l];Object.assign(u,{dataElementType:jn.getElement(p),datasetElementType:d&&jn.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,p=this.data.datasets.length;d<p;d++){const{controller:m}=this.getDatasetMeta(d),g=!r&&s.indexOf(m)===-1;m.buildOrUpdateElements(g),a=Math.max(+m.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Jt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(lg("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=>{$e.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Up(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;xA(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(!Up(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;$e.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,sn(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&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),cg({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=vm(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Ks(e,r),t.controller.draw(),r&&Xs(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ai(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=mu.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=Ei(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);rn(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(),li.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(),em(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete za[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}});!ba(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(p=>!d.some(m=>p.datasetIndex===m.datasetIndex&&p.index===m.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=CD(t),d=wA(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 p=!ba(l,r);return(p||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,p}_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 fg(){return Jt(on.instances,n=>n._plugins.invalidate())}function vA(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:p}=u,m=Math.min(d/a,He(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+m/2,e-m/2),l>0){const g=Math.min(d/l,He(i-e));n.arc(r,s,l+d/2,e-g/2,i+g/2,!0)}else{const g=Math.min(d/2,a*He(i-e));if(p==="round")n.arc(r,s,g,e-Rt/2,i+Rt/2,!0);else if(p==="bevel"){const _=2*g*g,x=-_*Math.cos(e+Rt/2)+r,w=-_*Math.sin(e+Rt/2)+s,S=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;n.lineTo(x,w),n.lineTo(S,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function SA(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 TA(n){return eu(n,["outerStart","outerEnd","innerStart","innerEnd"])}function MA(n,t,e,i){const r=TA(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 Oe(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Oe(r.innerStart,0,a),innerEnd:Oe(r.innerEnd,0,a)}}function Gr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Ua(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:p}=t,m=Math.max(t.outerRadius+i+e-d,0),g=p>0?p+i+e+d:0;let _=0;const x=r-u;if(i){const ut=p>0?p-i:0,ht=m>0?m-i:0,dt=(ut+ht)/2,bt=dt!==0?x*dt/(dt+i):x;_=(x-bt)/2}const w=Math.max(.001,x*m-e/Rt)/m,S=(x-w)/2,C=u+S+_,A=r-S-_,{outerStart:B,outerEnd:P,innerStart:I,innerEnd:$}=MA(t,g,m,A-C),z=m-B,v=m-P,M=C+B/z,O=A-P/v,N=g+I,W=g+$,G=C+I/N,lt=A-$/W;if(n.beginPath(),s){const ut=(M+O)/2;if(n.arc(a,l,m,M,ut),n.arc(a,l,m,ut,O),P>0){const at=Gr(v,O,a,l);n.arc(at.x,at.y,P,O,A+re)}const ht=Gr(W,A,a,l);if(n.lineTo(ht.x,ht.y),$>0){const at=Gr(W,lt,a,l);n.arc(at.x,at.y,$,A+re,lt+Math.PI)}const dt=(A-$/g+(C+I/g))/2;if(n.arc(a,l,g,A-$/g,dt,!0),n.arc(a,l,g,dt,C+I/g,!0),I>0){const at=Gr(N,G,a,l);n.arc(at.x,at.y,I,G+Math.PI,C-re)}const bt=Gr(z,C,a,l);if(n.lineTo(bt.x,bt.y),B>0){const at=Gr(z,M,a,l);n.arc(at.x,at.y,B,C-re,M)}}else{n.moveTo(a,l);const ut=Math.cos(M)*m+a,ht=Math.sin(M)*m+l;n.lineTo(ut,ht);const dt=Math.cos(O)*m+a,bt=Math.sin(O)*m+l;n.lineTo(dt,bt)}n.closePath()}function kA(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Ua(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Ua(n,t,e,i,u,r),n.fill(),u}function DA(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:p,borderDash:m,borderDashOffset:g,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(m||[]),n.lineDashOffset=g,x?(n.lineWidth=d*2,n.lineJoin=p||"round"):(n.lineWidth=d,n.lineJoin=p||"bevel");let w=t.endAngle;if(s){Ua(n,t,e,i,w,r);for(let S=0;S<s;++S)n.stroke();isNaN(l)||(w=a+(l%te||te))}x&&SA(n,t,w),u.selfJoin&&w-a>=Rt&&_===0&&p!=="miter"&&vA(n,t,w),s||(Ua(n,t,e,i,w,r),n.stroke())}class CA 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}=Ta(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:p,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),g=(this.options.spacing+this.options.borderWidth)/2,_=Ct(m,u-l),x=Ys(s,l,u)&&l!==u,w=_>=te||x,S=si(a,d+g,p+g);return w&&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,p=(r+s)/2,m=(a+l+d+u)/2;return{x:e+Math.cos(p)*m,y:i+Math.sin(p)*m}}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,kA(t,this,d,s,a),DA(t,this,d,s,a),t.restore()}}function hg(n,t,e=t){n.lineCap=Ct(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Ct(e.borderDash,t.borderDash)),n.lineDashOffset=Ct(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Ct(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Ct(e.borderWidth,t.borderWidth),n.strokeStyle=Ct(e.borderColor,t.borderColor)}function OA(n,t,e){n.lineTo(e.x,e.y)}function AA(n){return n.stepped?XD:n.tension||n.cubicInterpolationMode==="monotone"?ZD:OA}function pg(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),p=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!p?i+d-u:d-u}}function EA(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=pg(r,e,i),p=AA(s);let{move:m=!0,reverse:g}=i||{},_,x,w;for(_=0;_<=d;++_)x=r[(l+(g?d-_:_))%a],!x.skip&&(m?(n.moveTo(x.x,x.y),m=!1):p(n,w,x,g,s.stepped),w=x);return u&&(x=r[(l+(g?d:0))%a],p(n,w,x,g,s.stepped)),!!u}function RA(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=pg(r,e,i),{move:u=!0,reverse:d}=i||{};let p=0,m=0,g,_,x,w,S,C;const A=P=>(a+(d?l-P:P))%s,B=()=>{w!==S&&(n.lineTo(p,S),n.lineTo(p,w),n.lineTo(p,C))};for(u&&(_=r[A(0)],n.moveTo(_.x,_.y)),g=0;g<=l;++g){if(_=r[A(g)],_.skip)continue;const P=_.x,I=_.y,$=P|0;$===x?(I<w?w=I:I>S&&(S=I),p=(m*p+P)/++m):(B(),n.lineTo(P,I),x=$,m=0,w=S=I),C=I}B()}function bu(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?RA:EA}function PA(n){return n.stepped?OC:n.tension||n.cubicInterpolationMode==="monotone"?AC:dr}function IA(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),hg(n,t.options),n.stroke(r)}function LA(n,t,e,i){const{segments:r,options:s}=t,a=bu(t);for(const l of r)hg(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const NA=typeof Path2D=="function";function BA(n,t,e,i){NA&&!t.options.segment?IA(n,t,e,i):LA(n,t,e,i)}class Ha 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;wC(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=NC(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=bm(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=PA(i);let d,p;for(d=0,p=a.length;d<p;++d){const{start:m,end:g}=a[d],_=s[m],x=s[g];if(_===x){l.push(_);continue}const w=Math.abs((r-_[e])/(x[e]-_[e])),S=u(_,x,w,i.stepped);S[e]=t[e],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,e,i){return bu(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=bu(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(),BA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function mg(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class FA 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 mg(this,t,"x",e)}inYRange(t,e){return mg(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||!ai(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,tu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function gg(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,p,m;return n.horizontal?(m=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-m,p=i+m):(m=s/2,l=e-m,u=e+m,d=Math.min(i,r),p=Math.max(i,r)),{left:l,top:d,right:u,bottom:p}}function Li(n,t,e,i){return n?0:Oe(t,e,i)}function zA(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=im(i);return{t:Li(r.top,s.top,0,e),r:Li(r.right,s.right,0,t),b:Li(r.bottom,s.bottom,0,e),l:Li(r.left,s.left,0,t)}}function UA(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Ai(r),a=Math.min(t,e),l=n.borderSkipped,u=i||It(r);return{topLeft:Li(!u||l.top||l.left,s.topLeft,0,a),topRight:Li(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Li(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Li(!u||l.bottom||l.right,s.bottomRight,0,a)}}function HA(n){const t=gg(n),e=t.right-t.left,i=t.bottom-t.top,r=zA(n,e/2,i/2),s=UA(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 xu(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&gg(n,i);return l&&(r||si(t,l.left,l.right))&&(s||si(e,l.top,l.bottom))}function WA(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function $A(n,t){n.rect(t.x,t.y,t.w,t.h)}function wu(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 VA 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}=HA(this),l=WA(a.radius)?Vr:$A;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,wu(a,e,s)),t.clip(),l(t,wu(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,wu(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return xu(this,t,e,i)}inXRange(t,e){return xu(this,t,null,e)}inYRange(t,e){return xu(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 YA=Object.freeze({__proto__:null,ArcElement:CA,BarElement:VA,LineElement:Ha,PointElement:FA});const vu=["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)"],yg=vu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function _g(n){return vu[n%vu.length]}function bg(n){return yg[n%yg.length]}function qA(n,t){return n.borderColor=_g(t),n.backgroundColor=bg(t),++t}function jA(n,t){return n.backgroundColor=n.data.map(()=>_g(t++)),t}function GA(n,t){return n.backgroundColor=n.data.map(()=>bg(t++)),t}function KA(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Js?t=jA(e,t):r instanceof Nm?t=GA(e,t):r&&(t=qA(e,t))}}function xg(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function XA(n){return n&&(n.borderColor||n.backgroundColor)}function ZA(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var QA={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=xg(i)||XA(r)||s&&xg(s)||ZA();if(!e.forceOverride&&a)return;const l=KA(n);i.forEach(l)}};function JA(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 p=t,m,g,_,x,w;for(a[u++]=n[p],m=0;m<s-2;m++){let S=0,C=0,A;const B=Math.floor((m+1)*l)+1+t,P=Math.min(Math.floor((m+2)*l)+1,e)+t,I=P-B;for(A=B;A<P;A++)S+=n[A].x,C+=n[A].y;S/=I,C/=I;const $=Math.floor(m*l)+1+t,z=Math.min(Math.floor((m+1)*l)+1,e)+t,{x:v,y:M}=n[p];for(_=x=-1,A=$;A<z;A++)x=.5*Math.abs((v-S)*(n[A].y-M)-(v-n[A].x)*(C-M)),x>_&&(_=x,g=n[A],w=A);a[u++]=g,p=w}return a[u++]=n[d],a}function tE(n,t,e,i){let r=0,s=0,a,l,u,d,p,m,g,_,x,w;const S=[],C=t+e-1,A=n[t].x,P=n[C].x-A;for(a=t;a<t+e;++a){l=n[a],u=(l.x-A)/P*i,d=l.y;const I=u|0;if(I===p)d<x?(x=d,m=a):d>w&&(w=d,g=a),r=(s*r+l.x)/++s;else{const $=a-1;if(!St(m)&&!St(g)){const z=Math.min(m,g),v=Math.max(m,g);z!==_&&z!==$&&S.push({...n[z],x:r}),v!==_&&v!==$&&S.push({...n[v],x:r})}a>0&&$!==_&&S.push(n[$]),S.push(l),p=I,s=0,x=w=d,m=g=_=a}}return S}function wg(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 vg(n){n.data.datasets.forEach(t=>{wg(t)})}function eE(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=Oe(oi(t,s.axis,a).lo,0,e-1)),d?r=Oe(oi(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var nE={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){vg(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(Zs([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const p=n.scales[u.xAxisID];if(p.type!=="linear"&&p.type!=="time"||n.options.parsing)return;let{start:m,count:g}=eE(u,d);const _=e.threshold||4*i;if(g<=_){wg(r);return}St(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(w){this._data=w}}));let x;switch(e.algorithm){case"lttb":x=JA(d,m,g,i,e);break;case"min-max":x=tE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){vg(n)}};function iE(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=Wa(u,d,r);const p=Su(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:p,start:r[u],end:r[d]});continue}const m=bm(t,p);for(const g of m){const _=Su(e,s[g.start],s[g.end],g.loop),x=_m(l,r,_);for(const w of x)a.push({source:w,target:g,start:{[e]:Sg(p,_,"start",Math.max)},end:{[e]:Sg(p,_,"end",Math.min)}})}}return a}function Su(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=He(r),s=He(s)),{property:n,start:r,end:s}}function rE(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Wa(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 Wa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Sg(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Tg(n,t){let e=[],i=!1;return qt(n)?(i=!0,e=n):e=rE(n,t),e.length?new Ha({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Mg(n){return n&&n.fill!==!1}function sE(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 oE(n,t,e){const i=uE(n);if(It(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?aE(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function aE(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function lE(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:It(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function cE(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:It(n)?i=n.value:i=t.getBaseValue(),i}function uE(n){const t=n.options,e=t.fill;let i=Ct(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function dE(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=fE(t,e);l.push(Tg({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let p=d.start;p<=d.end;p++)hE(r,a[p],l)}return new Ha({points:r,options:{}})}function fE(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 hE(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=pE(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function pE(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 p=s[d],m=a[p.start][e],g=a[p.end][e];if(si(r,m,g)){l=r===m,u=r===g;break}}return{first:l,last:u,point:i}}class kg{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 mE(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return gE(t,e);if(e==="stack")return dE(n);if(e==="shape")return!0;const r=yE(n);return r instanceof kg?r:Tg(r,i)}function gE(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function yE(n){return(n.scale||{}).getPointPositionForValue?bE(n):_E(n)}function _E(n){const{scale:t={},fill:e}=n,i=lE(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function bE(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=cE(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new kg({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 Tu(n,t,e){const i=mE(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,p=d.fill,m=d.backgroundColor,{above:g=m,below:_=m}=p||{},x=r.getDatasetMeta(s),w=vm(r,x);i&&a.points.length&&(Ks(n,e),xE(n,{line:a,target:i,above:g,below:_,area:e,scale:l,axis:u,clip:w}),Xs(n))}function xE(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 p=s;s!==r&&(d==="x"?(Dg(n,i,a.top),Mu(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),Dg(n,i,a.bottom)):d==="y"&&(Cg(n,i,a.left),Mu(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),Cg(n,i,a.right),p=r)),Mu(n,{line:e,target:i,color:p,scale:l,property:d,clip:u}),n.restore()}function Dg(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,p=r[u],m=r[Wa(u,d,r)];s?(n.moveTo(p.x,p.y),s=!1):(n.lineTo(p.x,e),n.lineTo(p.x,p.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(m.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Cg(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,p=r[u],m=r[Wa(u,d,r)];s?(n.moveTo(p.x,p.y),s=!1):(n.lineTo(e,p.y),n.lineTo(p.x,p.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,m.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Mu(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=iE(e,i,r);for(const{source:d,target:p,start:m,end:g}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,wE(n,a,l,x&&Su(r,m,g)),n.beginPath();const w=!!e.pathSegment(n,d);let S;if(x){w?n.closePath():Og(n,i,g,r);const C=!!i.pathSegment(n,p,{move:w,reverse:!0});S=w&&C,S||Og(n,i,m,r)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function wE(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,p,m;s==="x"?(u=a,d=r.top,p=l,m=r.bottom):(u=r.left,d=a,p=r.right,m=l),n.beginPath(),e&&(u=Math.max(u,e.left),p=Math.min(p,e.right),d=Math.max(d,e.top),m=Math.min(m,e.bottom)),n.rect(u,d,p-u,m-d),n.clip()}}function Og(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var vE={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 Ha&&(u={visible:n.isDatasetVisible(a),index:a,fill:oE(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=sE(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&&Tu(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;Mg(s)&&Tu(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Mg(i)||e.drawTime!=="beforeDatasetDraw"||Tu(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ag=(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)}},SE=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Eg 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}=Ag(i,s);let d,p;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,p=this._fitRows(a,s,l,u)+10):(p=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(p,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],p=r+l;let m=t;s.textAlign="left",s.textBaseline="middle";let g=-1,_=-p;return this.legendItems.forEach((x,w)=>{const S=i+e/2+s.measureText(x.text).width;(w===0||d[d.length-1]+S+2*l>a)&&(m+=p,d[d.length-(w>0?0:1)]=0,_+=p,g++),u[w]={left:0,top:_,row:g,width:S,height:r},d[d.length-1]+=S+l}),m}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],p=a-t;let m=l,g=0,_=0,x=0,w=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:A,itemHeight:B}=TE(i,e,s,S,r);C>0&&_+B+2*l>p&&(m+=g+l,d.push({width:g,height:_}),x+=g+l,w++,g=_=0),u[C]={left:x,top:_,col:w,width:A,height:B},g=Math.max(g,A),_+=B+l}),m+=g,d.push({width:g,height:_}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=jr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=We(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=We(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=We(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=We(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;Ks(t,this),this._draw(),Xs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=jr(t.rtl,this.left,this.width),d=le(a.font),{padding:p}=a,m=d.size,g=m/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:w,itemHeight:S}=Ag(a,m),C=function($,z,v){if(isNaN(x)||x<=0||isNaN(w)||w<0)return;r.save();const M=Ct(v.lineWidth,1);if(r.fillStyle=Ct(v.fillStyle,l),r.lineCap=Ct(v.lineCap,"butt"),r.lineDashOffset=Ct(v.lineDashOffset,0),r.lineJoin=Ct(v.lineJoin,"miter"),r.lineWidth=M,r.strokeStyle=Ct(v.strokeStyle,l),r.setLineDash(Ct(v.lineDash,[])),a.usePointStyle){const O={radius:w*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:M},N=u.xPlus($,x/2),W=z+g;nm(r,O,N,W,a.pointStyleWidth&&x)}else{const O=z+Math.max((m-w)/2,0),N=u.leftForLtr($,x),W=Ai(v.borderRadius);r.beginPath(),Object.values(W).some(G=>G!==0)?Vr(r,{x:N,y:O,w:x,h:w,radius:W}):r.rect(N,O,x,w),r.fill(),M!==0&&r.stroke()}r.restore()},A=function($,z,v){cr(r,v.text,$,z+S/2,d,{strikethrough:v.hidden,textAlign:u.textAlign(v.textAlign)})},B=this.isHorizontal(),P=this._computeTitleHeight();B?_={x:We(s,this.left+p,this.right-i[0]),y:this.top+p+P,line:0}:_={x:this.left+p,y:We(s,this.top+P+p,this.bottom-e[0].height),line:0},pm(this.ctx,t.textDirection);const I=S+p;this.legendItems.forEach(($,z)=>{r.strokeStyle=$.fontColor,r.fillStyle=$.fontColor;const v=r.measureText($.text).width,M=u.textAlign($.textAlign||($.textAlign=a.textAlign)),O=x+g+v;let N=_.x,W=_.y;u.setWidth(this.width),B?z>0&&N+O+p>this.right&&(W=_.y+=I,_.line++,N=_.x=We(s,this.left+p,this.right-i[_.line])):z>0&&W+I>this.bottom&&(N=_.x=N+e[_.line].width+p,_.line++,W=_.y=We(s,this.top+P+p,this.bottom-e[_.line].height));const G=u.x(N);if(C(G,W,$),N=zD(M,N+x+g,B?N+O:this.right,t.rtl),A(u.x(N),W,$),B)_.x+=O+p;else if(typeof $.text!="string"){const lt=d.lineHeight;_.y+=Rg($,lt)+p}else _.y+=I}),mm(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=ve(e.padding);if(!e.display)return;const s=jr(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let p,m=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),p=this.top+d,m=We(t.align,m,this.right-g);else{const x=this.columnSizes.reduce((w,S)=>Math.max(w,S.height),0);p=d+We(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=We(l,m,m+g);a.textAlign=s.textAlign(Kc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,cr(a,e.text,_,p,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=ve(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(si(t,this.left,this.right)&&si(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],si(t,r.left,r.left+r.width)&&si(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!DE(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=SE(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 TE(n,t,e,i,r){const s=ME(i,n,t,e),a=kE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function ME(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 kE(n,t,e){let i=n;return typeof t.text!="string"&&(i=Rg(t,e)),i}function Rg(n,t){const e=n.text?n.text.length:0;return t*e}function DE(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var CE={id:"legend",_element:Eg,start(n,t,e){const i=n.legend=new Eg({ctx:n.ctx,options:e,chart:n});$e.configure(n,i,e),$e.addBox(n,i)},stop(n){$e.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;$e.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),p=ve(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:(p.width+p.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 ku 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=ve(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,p,m;return this.isHorizontal()?(p=We(l,i,s),m=e+t,d=s-i):(a.position==="left"?(p=i+t,m=We(l,r,e),u=Rt*-.5):(p=s-t,m=We(l,e,r),u=Rt*.5),d=r-e),{titleX:p,titleY:m,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);cr(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:Kc(e.align),textBaseline:"middle",translation:[a,l]})}}function OE(n,t){const e=new ku({ctx:n.ctx,options:t,chart:n});$e.configure(n,e,t),$e.addBox(n,e),n.titleBlock=e}var AE={id:"title",_element:ku,start(n,t,e){OE(n,e)},stop(n){const t=n.titleBlock;$e.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;$e.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 $a=new WeakMap;var EE={id:"subtitle",start(n,t,e){const i=new ku({ctx:n.ctx,options:e,chart:n});$e.configure(n,i,e),$e.addBox(n,i),$a.set(n,i)},stop(n){$e.removeBox(n,$a.get(n)),$a.delete(n)},beforeUpdate(n,t,e){const i=$a.get(n);$e.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 ao={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(),p=$r(t,d);p<r&&(r=p,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function Gn(n,t){return t&&(qt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ci(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
2
+ `)>-1?n.split(`
3
+ `):n}function RE(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 Pg(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),p=le(t.footerFont),m=s.length,g=r.length,_=i.length,x=ve(t.padding);let w=x.height,S=0,C=i.reduce((P,I)=>P+I.before.length+I.lines.length+I.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,m&&(w+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;w+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}g&&(w+=t.footerMarginTop+g*p.lineHeight+(g-1)*t.footerSpacing);let A=0;const B=function(P){S=Math.max(S,e.measureText(P).width+A)};return e.save(),e.font=d.string,Jt(n.title,B),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),B),A=t.displayColors?a+2+t.boxPadding:0,Jt(i,P=>{Jt(P.before,B),Jt(P.lines,B),Jt(P.after,B)}),A=0,e.font=p.string,Jt(n.footer,B),e.restore(),S+=x.width,{width:S,height:w}}function PE(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function IE(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 LE(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"),IE(d,n,t,e)&&(d="center"),d}function Ig(n,t,e){const i=e.yAlign||t.yAlign||PE(n,e);return{xAlign:e.xAlign||t.xAlign||LE(n,t,e,i),yAlign:i}}function NE(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function BE(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Lg(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:p,topRight:m,bottomLeft:g,bottomRight:_}=Ai(a);let x=NE(t,l);const w=BE(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(p,g)+r:l==="right"&&(x+=Math.max(m,_)+r),{x:Oe(x,0,i.width-t.width),y:Oe(w,0,i.height-t.height)}}function Va(n,t,e){const i=ve(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ng(n){return Gn([],ci(n))}function FE(n,t,e){return Ei(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Bg(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Fg={beforeTitle:ri,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:ri,beforeBody:ri,beforeLabel:ri,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return St(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri};function an(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Fg[t].call(e,i):r}class zg extends Ve{static positioners=ao;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 au(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=FE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=an(i,"beforeTitle",this,t),s=an(i,"title",this,t),a=an(i,"afterTitle",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(a)),l}getBeforeBody(t,e){return Ng(an(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Bg(i,s);Gn(a.before,ci(an(l,"beforeLabel",this,s))),Gn(a.lines,an(l,"label",this,s)),Gn(a.after,ci(an(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Ng(an(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=an(i,"beforeFooter",this,t),s=an(i,"footer",this,t),a=an(i,"afterFooter",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(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(RE(this.chart,e[u]));return t.filter&&(l=l.filter((p,m,g)=>t.filter(p,m,g,i))),t.itemSort&&(l=l.sort((p,m)=>t.itemSort(p,m,i))),Jt(l,p=>{const m=Bg(t.callbacks,p);r.push(an(m,"labelColor",this,p)),s.push(an(m,"labelPointStyle",this,p)),a.push(an(m,"labelTextColor",this,p))}),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=ao[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=Pg(this,i),d=Object.assign({},l,u),p=Ig(this.chart,i,d),m=Lg(i,d,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,s={opacity:1,x:m.x,y:m.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay: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:p,bottomRight:m}=Ai(l),{x:g,y:_}=t,{width:x,height:w}=e;let S,C,A,B,P,I;return s==="center"?(P=_+w/2,r==="left"?(S=g,C=S-a,B=P+a,I=P-a):(S=g+x,C=S+a,B=P-a,I=P+a),A=S):(r==="left"?C=g+Math.max(u,p)+a:r==="right"?C=g+x-Math.max(d,m)-a:C=this.caretX,s==="top"?(B=_,P=B-a,S=C-a,A=C+a):(B=_+w,P=B+a,S=C+a,A=C-a),I=B),{x1:S,x2:C,x3:A,y1:B,y2:P,y3:I}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=jr(i.rtl,this.x,this.width);for(t.x=Va(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,p=le(s.bodyFont),m=Va(this,"left",s),g=r.x(m),_=u<p.lineHeight?(p.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const w={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},S=r.leftForLtr(g,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,tu(t,w,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,tu(t,w,S,C)}else{t.lineWidth=It(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 w=r.leftForLtr(g,d),S=r.leftForLtr(r.xPlus(g,1),d-2),C=Ai(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Vr(t,{x:w,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Vr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(w,x,d,u),t.strokeRect(w,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:p}=i,m=le(i.bodyFont);let g=m.lineHeight,_=0;const x=jr(i.rtl,this.x,this.width),w=function(v){e.fillText(v,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let C,A,B,P,I,$,z;for(e.textAlign=a,e.textBaseline="middle",e.font=m.string,t.x=Va(this,S,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,w),_=l&&S!=="right"?a==="center"?d/2+p:d+2+p:0,P=0,$=r.length;P<$;++P){for(C=r[P],A=this.labelTextColors[P],e.fillStyle=A,Jt(C.before,w),B=C.lines,l&&B.length&&(this._drawColorBox(e,t,P,x,i),g=Math.max(m.lineHeight,u)),I=0,z=B.length;I<z;++I)w(B[I]),g=m.lineHeight;Jt(C.after,w)}_=0,g=m.lineHeight,Jt(this.afterBody,w),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=jr(i.rtl,this.x,this.width);for(t.x=Va(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:p}=i,{topLeft:m,topRight:g,bottomLeft:_,bottomRight:x}=Ai(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+m,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-g,u),e.quadraticCurveTo(l+d,u,l+d,u+g),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+p-x),e.quadraticCurveTo(l+d,u+p,l+d-x,u+p),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+p),e.quadraticCurveTo(l,u+p,l,u+p-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+m),e.quadraticCurveTo(l,u,l+m,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=ao[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Pg(this,t),u=Object.assign({},a,this._size),d=Ig(e,t,u),p=Lg(t,u,d,e);(r._to!==p.x||s._to!==p.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,p))}}_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=ve(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),pm(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),mm(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=!ba(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||!ba(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=ao[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var Ye={id:"tooltip",_element:zg,positioners:ao,afterInit(n,t,e){e&&(n.tooltip=new zg({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:Fg},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"]},zE=Object.freeze({__proto__:null,Colors:QA,Decimation:nE,Filler:vE,Legend:CE,SubTitle:EE,Title:AE,Tooltip:Ye});const UE=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function HE(n,t,e,i){const r=n.indexOf(t);if(r===-1)return UE(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const WE=(n,t)=>n===null?null:Oe(Math.round(n),0,t);function Ug(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class $E extends hr{static id="category";static defaults={ticks:{callback:Ug}};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(St(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:HE(i,t,Ct(e,t),this._addedLabels),WE(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 Ug.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 VE(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:p,maxDigits:m,includeBounds:g}=n,_=s||1,x=p-1,{min:w,max:S}=t,C=!St(a),A=!St(l),B=!St(d),P=(S-w)/(m+1);let I=Hp((S-w)/x/_)*_,$,z,v,M;if(I<1e-14&&!C&&!A)return[{value:w},{value:S}];M=Math.ceil(S/I)-Math.floor(w/I),M>x&&(I=Hp(M*I/x/_)*_),St(u)||($=Math.pow(10,u),I=Math.ceil(I*$)/$),r==="ticks"?(z=Math.floor(w/I)*I,v=Math.ceil(S/I)*I):(z=w,v=S),C&&A&&s&&RD((l-a)/s,I/1e3)?(M=Math.round(Math.min((l-a)/I,p)),I=(l-a)/M,z=a,v=l):B?(z=C?a:z,v=A?l:v,M=d-1,I=(v-z)/M):(M=(v-z)/I,Vs(M,Math.round(M),I/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max($p(I),$p(z));$=Math.pow(10,St(u)?O:u),z=Math.round(z*$)/$,v=Math.round(v*$)/$;let N=0;for(C&&(g&&z!==a?(e.push({value:a}),z<a&&N++,Vs(Math.round((z+N*I)*$)/$,a,Hg(a,P,n))&&N++):z<a&&N++);N<M;++N){const W=Math.round((z+N*I)*$)/$;if(A&&W>l)break;e.push({value:W})}return A&&g&&v!==l?e.length&&Vs(e[e.length-1].value,l,Hg(l,P,n))?e[e.length-1].value=l:e.push({value:l}):(!A||v===l)&&e.push({value:v}),e}function Hg(n,t,{horizontal:e,minRotation:i}){const r=we(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Ya extends hr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return St(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=qn(r),d=qn(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=VE(r,s);return t.bounds==="ticks"&&Wp(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 js(t,this.chart.options.locale,this.options.ticks.format)}}class YE extends Ya{static id="linear";static defaults={ticks:{callback:Da.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=we(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 lo=n=>Math.floor(Ci(n)),pr=(n,t)=>Math.pow(10,lo(n)+t);function Wg(n){return n/Math.pow(10,lo(n))===1}function $g(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function qE(n,t){const e=t-n;let i=lo(e);for(;$g(n,t,i)>10;)i++;for(;$g(n,t,i)<10;)i--;return Math.min(i,lo(n))}function jE(n,{min:t,max:e}){t=mn(n.min,t);const i=[],r=lo(t);let s=qE(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,p=Math.floor((t-u)/l/10)*l*10;let m=Math.floor((d-p)/Math.pow(10,s)),g=mn(n.min,Math.round((u+p+m*Math.pow(10,s))*a)/a);for(;g<e;)i.push({value:g,major:Wg(g),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),g=Math.round((u+p+m*Math.pow(10,s))*a)/a;const _=mn(n.max,g);return i.push({value:_,major:Wg(_),significand:m}),i}class GE extends hr{static id="logarithmic";static defaults={ticks:{callback:Da.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=Ya.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===pr(this.min,0)?pr(this.min,-1):pr(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(pr(i,-1)),a(pr(r,1)))),i<=0&&s(pr(r,-1)),r<=0&&a(pr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=jE(e,this);return t.bounds==="ticks"&&Wp(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":js(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ci(t),this._valueRange=Ci(this.max)-Ci(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ci(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Du(n){const t=n.ticks;if(t.display&&n.display){const e=ve(t.backdropPadding);return Ct(t.font&&t.font.size,se.font.size)+e.height}return 0}function KE(n,t,e){return e=qt(e)?e:[e],{w:KD(n,t.string,e),h:e.length*t.lineHeight}}function Vg(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 XE(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 p=n.getPointPosition(u,n.drawingArea+r[u],l),m=le(d.font),g=KE(n.ctx,m,n._pointLabels[u]);i[u]=g;const _=He(n.getIndexAngle(u)+l),x=Math.round(Sa(_)),w=Vg(x,p.x,g.w,0,180),S=Vg(x,p.y,g.h,90,270);ZE(e,t,_,w,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=tR(n,i,r)}function ZE(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 QE(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(Sa(He(u.angle+re))),p=iR(u.y,l.h,d),m=eR(d),g=nR(u.x,l.w,m);return{visible:!0,x:u.x,y:p,textAlign:m,left:g,top:p,right:g+l.w,bottom:p+l.h}}function JE(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ai({x:e,y:i},t)||ai({x:e,y:s},t)||ai({x:r,y:i},t)||ai({x:r,y:s},t))}function tR(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Du(s)/2,additionalAngle:a?Rt/r:0};let d;for(let p=0;p<r;p++){u.padding=e[p],u.size=t[p];const m=QE(n,p,u);i.push(m),l==="auto"&&(m.visible=JE(m,d),m.visible&&(d=m))}return i}function eR(n){return n===0||n===180?"center":n<180?"left":"right"}function nR(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function iR(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function rR(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!St(l)){const u=Ai(t.borderRadius),d=ve(t.backdropPadding);n.fillStyle=l;const p=i-d.left,m=r-d.top,g=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Vr(n,{x:p,y:m,w:g,h:_,radius:u}),n.fill()):n.fillRect(p,m,g,_)}}function sR(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));rR(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:p}=s;cr(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:p,textBaseline:"middle"})}}function Yg(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 oR(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(),Yg(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function aR(n,t,e){return Ei(n,{label:e,index:t,type:"pointLabel"})}class lR extends Ya{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:Da.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=ve(Du(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/Du(this.options))}generateTickLabels(t){Ya.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?XE(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 He(t*e+we(i))}getDistanceFromCenterForValue(t){if(St(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(St(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return aR(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(),Yg(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&&sR(this,a),r.display&&this.ticks.forEach((p,m)=>{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(p.value);const g=this.getContext(m),_=r.setContext(g),x=s.setContext(g);oR(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const p=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:g}=p;!g||!m||(t.lineWidth=g,t.strokeStyle=m,t.setLineDash(p.borderDash),t.lineDashOffset=p.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)),p=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=p.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const m=ve(d.backdropPadding);t.fillRect(-a/2-m.left,-s-p.size/2-m.top,a+m.width,p.size+m.height)}cr(t,l.label,0,-s,p,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const qa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ln=Object.keys(qa);function qg(n,t){return n-t}function jg(n,t){if(St(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"&&(Oi(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Gg(n,t,e,i){const r=ln.length;for(let s=ln.indexOf(n);s<r-1;++s){const a=qa[ln[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return ln[s]}return ln[r-1]}function cR(n,t,e,i,r){for(let s=ln.length-1;s>=ln.indexOf(e);s--){const a=ln[s];if(qa[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return ln[e?ln.indexOf(e):0]}function uR(n){for(let t=ln.indexOf(n)+1,e=ln.length;t<e;++t)if(qa[ln[t]].common)return ln[t]}function Kg(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Gc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function dR(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 Xg(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:dR(n,i,r,e)}class Cu extends hr{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 Fm._date(t.adapters.date);r.init(e),$s(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:jg(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=ND(r,s,a);return this._unit=e.unit||(i.autoSkip?Gg(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):cR(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:uR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Xg(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=Oe(e,0,a),i=Oe(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||Gg(s.minUnit,e,i,this._getLabelCapacity(e)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Oi(u)||u===!0,p={};let m=e,g,_;if(d&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,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(g=m,_=0;g<i;g=+t.add(g,l,a),_++)Kg(p,g,x);return(g===i||r.bounds==="ticks"||_===1)&&Kg(p,g,x),Object.keys(p).sort(qg).map(w=>+w)}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,p=u&&l[u],m=d&&l[d],g=i[e],_=d&&m&&g&&g.major;return this._adapter.format(t,r||(_?m:p))}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=we(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,Xg(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(jg(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qp(t.sort(qg))}}function ja(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}=oi(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}=oi(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 fR extends Cu{static id="timeseries";static defaults=Cu.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=ja(e,this.min),this._tableRange=ja(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,p;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)p=r[a+1],u=r[a-1],d=r[a],Math.round((p+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(ja(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ja(this._table,i*this._tableRange+this._minPos,!0)}}var hR=Object.freeze({__proto__:null,CategoryScale:$E,LinearScale:YE,LogarithmicScale:GE,RadialLinearScale:lR,TimeScale:Cu,TimeSeriesScale:fR});const pR=[pO,YA,zE,hR];function mR(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};Ye.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const p=this.chart.canvas.getBoundingClientRect(),m=n.tooltipState.width||this.width,g=p.width/2,_=Qa(d,m,g),x=d.y,w=d.x<g?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:w}},mu.modes.customInteractionMode=function(u,d){const p=Ri(d,u),m=[];return mu.evaluateInteractionItems(u,u.options.indexAxis||"x",p,(g,_,x)=>{u.options.indexAxis==="y"&&g.inYRange(p.y,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&p.x!==null&&g.inXRange(p.x,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x})}),m};const r=n.numLabels.value>25?d0:f0,s=({chart:u,index:d})=>{const p=u.data;return{size:r,style:p?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,p)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(p),d&&d.length>Ja?d.slice(0,Ja)+"...":d):u.getLabelForValue(Number(d)),l=h.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"?!St(n.metricAxesTitle?.value):!St(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"?!St(n.metricAxesTitle?.value):!St(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=>{l0(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return h.getCurrentInstance()&&h.onUnmounted(()=>{Ye.positioners[e]&&delete Ye.positioners[e]}),l}on.register(...pR);const gR=(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 yR(n,t,e,i,r){const s=h.shallowRef(null),a=(l,u)=>{if(t.value)return new on(t.value,{type:n,data:l,plugins:i,options:u})};return h.onMounted(()=>{s.value=a(e.value,r.value)}),h.onBeforeUnmount(()=>{St(s.value)||s.value.destroy()}),h.watch(e,(l,u)=>{if(gR(u,l)&&!St(s.value)){for(const[d,p]of l.datasets.entries())Object.assign(s.value.data.datasets[d],p);s.value.data.labels=l.labels,s.value.update()}else St(s.value)||s.value.destroy(),s.value=a(l,r.value)}),h.watch(t,()=>{St(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),h.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))&&(St(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const Zg=1e3,_R=1e4,Qg=1e6,Jg=1e9,t0=1e12,co=(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("")},Kr=(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 uo(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?_R:Zg;return n<r||t.precision&&t.precision>Math.log10(n)?e=co(Kr(n,1,t),t):n<Qg?e=`${Kr(n,Zg,t)}k`:n<Jg?e=`${Kr(n,Qg,t)}m`:n<t0?e=`${co(Kr(n,Jg,t),t)}b`:e=`${co(Kr(n,t0,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}uo.addCommas=co;function bR(n,t,e){const{i18n:i}=xt.useI18n(),{formatBytes:r}=ni({i18n:i}),{translateUnit:s}=xt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((m,g)=>m+(typeof g=="number"?Number(g)||0:Number(g&&g.y)||0),0);let p;if(e.value==="bytes")p=r(d);else{const m=s(e.value,d);p=i&&i.t("legend.datapointValueDisplay",{value:uo(d,{capital:!0}),unit:m})||`${uo(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:p,isThreshold:u.isThreshold}}},{}))}}function xR(n){return h.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Fh(new Date(e))} - ${Fh(new Date(i),{includeTZ:!0})}`:""})}function wR(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ye.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,p=Qa(a,u,d),m=a.y,g=a.x<d?"left":"center";return{x:p-n.tooltipState.offsetX,y:m,xAlign:g}};const r=h.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{l0(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return h.onUnmounted(()=>{Ye.positioners[e]&&delete Ye.positioners[e]}),{options:r}}function vR(n){const t=h.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 A0({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!St(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=h.computed(()=>({title:{display:!St(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};Ye.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const p=this.chart.canvas.getBoundingClientRect(),m=n.tooltipState.width||this.width,g=n.tooltipState.height||this.height,_=p.width/2,x=p.height/2,w=Qa(d,m,_);let S=c0(d,g,x);const C=d.y<x?"top":"bottom",A=d.x<_?"left":"center";return g>p.height&&(S=0),{x:w,y:S,xAlign:A,yAlign:C}};const a=h.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,p=new Date(d.getTime()-u);return kp(u)>24||p.getDate()!==d.getDate()}),l=h.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=>{Ou(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 h.onUnmounted(()=>{Ye.positioners[r]&&delete Ye.positioners[r]}),{options:l}}const SR=["usd","bytes"],TR="usd";function MR(n){const{i18n:t}=xt.useI18n(),{formatUnit:e}=ni({i18n:t}),i=(_,x)=>!x||!SR.includes(x)?_:_===0&&x===TR?t.formatNumber(0,{style:"currency",currency:"USD"}):e(_,x),r=h.computed(()=>{const _=Number(n.timeRangeMs.value),x=new Date,w=new Date(x.getTime()-_);return kp(_)>24||w.getDate()!==x.getDate()}),s=h.computed(()=>({display:!St(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=h.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:_=>i(_,n.xMetricUnit?.value)},title:s.value,border:{display:!1}})),l=h.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:_=>A0({tickValue:new Date(_),granularity:n.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=h.computed(()=>({title:{display:!St(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:_=>i(_,n.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(_,x,w)=>{const S=w?.timestamp;return S===void 0?"":Jr({tickValue:new Date(S),granularity:x})},m=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;Ye.positioners[m]=function(_,x){if(!_.length||n.tooltipState.interactionMode==="interactive"||x.x===null||x.y===null)return!1;const w=this.chart.canvas.getBoundingClientRect(),S=n.tooltipState.width||this.width,C=n.tooltipState.height||this.height,A=w.width/2,B=w.height/2,P=Qa(x,S,A);let I=c0(x,C,B);const $=x.y<B?"top":"bottom",z=x.x<A?"left":"center";return C>w.height&&(I=0),{x:P,y:I,xAlign:z,yAlign:$}};const g=h.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:n.xMetric?.value?a.value:l.value,y:u.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:m,external:_=>{Ou(n.tooltipState,_,n.granularity.value,{...n.xMetric?.value?{contextFormatter:d}:{}})}},outlierBandPlugin:{value:n.outlierValue?.value,color:n.themeColors.value.outlierBand},referenceLinePlugin:{lines:n.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return h.onUnmounted(()=>{Ye.positioners[m]&&delete Ye.positioners[m]}),{options:g}}function kR(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l,seriesDimension:u}=n,{i18n:d}=xt.useI18n(),{evaluateFeatureFlag:p}=xt.useEvaluateFeatureFlag(),m=p("analytics-color-updates",!1);return t?i.map(g=>({label:d&&d.te(`chartLabels.${g}`)&&d.t(`chartLabels.${g}`)||g,backgroundColor:m?ua({metric:g}):Eu(i.indexOf(g),Kn),data:a.map((_,x)=>e?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?ua({dimension:u,dimensionValue:g.id}):Ru(_,g.name,g.id==="empty",l??Kn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function DR(n,t){const{i18n:e}=xt.useI18n();return h.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,p=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const m=d&&l||a,g=m[0],_=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(M=>a.map((O,N)=>{const W=M.event[g],G=d?`${W},${O}`:`${N},${O}`,lt=M.event[O];return[G,lt]})):r.map(M=>{const O=d?`${M.event[g]},${M.event[_]}`:`${g},${_}`,N=M.event[a[0]];return[O,N]})),w=Object.keys(x).reduce((M,O)=>{const[N]=O.split(","),W=x[O];return M[N]?M[N]+=W:M[N]=W,M},{}),S=Object.entries(w).sort(([,M],[,O])=>Number(O)-Number(M)).map(([M])=>M),C=s[g],A=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&&A&&Object.entries(A).map(([M,O])=>({id:M,name:O.name}))||a.map(M=>({id:M,name:M}));if(d&&g==="country_code"&&(B=B.map(M=>({...M,name:Dc(M.id)||M.name}))),d&&_==="country_code"&&(P=P.map(M=>({...M,name:Dc(M.id)||M.name}))),g!=="status_code"&&g!=="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 I=kR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:P,pivotRecords:x,rowLabels:B,seriesDimension:_,colorPalette:n.colorPalette||Kn}),$=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),z=B.map(M=>M.id==="empty");return{labels:$,datasets:I,isLabelEmpty:z,isMultiDimension:p}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const CR=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),OR=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Dp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},AR=(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 CR(l,u,e)};function ER(n,t){const{i18n:e}=xt.useI18n(),{evaluateFeatureFlag:i}=xt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1);return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:l,metric_names:u,start:d,end:p}=t.value.meta,m=new Date(d).getTime(),g=new Date(p).getTime();if(!u)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const _=l&&Object.keys(l)||u,x=_&&_[0],w=l?.[x],S=!!w&&u.length>1;let C=l&&w&&Object.keys(w).map(v=>({id:v,name:w[v].name}))||u.map(v=>({id:v,name:v}));x==="country_code"&&(C=C.map(v=>({...v,name:Dc(v.id)||v.name})));const A=t.value.meta.granularity_ms;if(typeof A!="number"||isNaN(A)||!isFinite(A)||A===0)return console.error("Invalid step value:",A),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const B=OR(m),P=AR(m,g,A,B,a),I=a?.length?a.reduce((v,M)=>{const O=new Date(M.timestamp).valueOf(),N=M.event;for(const W of u)O in v||(v[O]={}),W in v[O]||(v[O][W]={});for(const W of u)C.forEach(G=>{(w?N[x]===G.id:W===G.id)?(v[O][W]||(v[O][W]={}),v[O][W][G.id]=Math.round(Number(N[W])*1e3)/1e3):_.length||(v[O][W]||(v[O][W]={}),v[O][W][G.id]=Math.round(Number(N[G.id])*1e3)/1e3)});return v},{}):{},z=[...w||u.length===1?u.flatMap(v=>C.map(M=>[v,M.id,M.name,M.id==="empty"])):C.map(v=>[v.name,v.id,v.name,v.id==="empty"])].map(([v,M,O,N],W)=>{const G=P.map(ct=>ct in I&&v in I[ct]?{x:ct,y:I[ct][v][M]||0}:{x:ct,y:0});let{colorPalette:lt,fill:ut}=n;St(lt)&&(lt=Kn);const ht=r?ua({dimension:x,dimensionValue:M}):Ru(W,O,N,lt),dt=N0(O)?e.t(`chartLabels.${O}`):O,bt=N0(v)?e.t(`chartLabels.${v}`):v,at=u.findIndex(ct=>ct===v);return{rawDimension:O,rawMetric:v,label:S?`${dt} — ${bt}`:dt,borderColor:ht,backgroundColor:ht,data:G,total:G.reduce((ct,{y:V})=>ct+Number(V),0),...yP,...S?{borderDash:at===0?[]:[at*4,2]}:{},fill:ut,borderWidth:ut?bP:_P,isSegmentEmpty:N}});return x==="status_code"||x==="status_code_grouped"?z.sort((v,M)=>(v.label??"")<(M.label??"")?-1:1):z.sort((v,M)=>Number(v.total)<Number(M.total)?-1:1),{datasets:z}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const RR=2,PR=.6,e0=1,IR=2,n0=50,LR=[6,4],NR=[2,3],BR=(n,t)=>{const e=Math.sin(t)*1e4;return(e-Math.floor(e))*n};function FR(n,t){const{i18n:e}=xt.useI18n(),{evaluateFeatureFlag:i}=xt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===n0?e.t("scatter.median"):e.t("scatter.percentile",{value:a}));return h.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:l,dimension:u,display:d,xMetric:p,xMetricUnit:m}=a,g=p?e.te(`chartLabels.${p}`)&&e.t(`chartLabels.${p}`)||p:"",_=n.scatter||{},x=_.jitterMs??0,w=_.pointRadius??RR,S=_.pointOpacity??PR,C=new Map,A=[];a.points.forEach(G=>{const lt=G.group??l,ut=C.get(lt)||[];let ht,dt;G.x!==void 0?(ht={x:G.x,timestamp:G.timestamp},dt=[{label:g,value:G.x,...m?{unit:m}:{}},...G.extras??[]]):(ht={x:G.timestamp+BR(x,G.timestamp+G.value)},dt=G.extras??[]),ut.push({...ht,y:G.value,...dt.length?{extras:dt}:{}}),C.set(lt,ut),A.push(G.value)});const B=_.percentileLines||[],P=[...B.map(G=>G.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],I=P.length?l2(A,P):new Map,$=_.outlierPercentile!==void 0?I.get(_.outlierPercentile):void 0,z=$!==void 0&&Number.isFinite($),v=St(n.colorPalette)?Kn:n.colorPalette,M=n.themeColors?.value??Gu(),O=[],N=G=>{const lt=G?.y;return z&&Number.isFinite(lt)&&lt>$};Array.from(C.entries()).forEach(([G,lt],ut)=>{const ht=u&&d?.[G]?.name||G,dt=G==="empty",bt=r?ua({dimension:u,dimensionValue:G}):Ru(ut,ht,dt,v),at=ju(bt,S),ct=e.te(`chartLabels.${ht}`)&&e.t(`chartLabels.${ht}`)||ht;O.push({type:"scatter",rawDimension:ht,rawMetric:l,label:ct,borderColor:V=>N(V.raw)?M.outlier:bt,backgroundColor:V=>N(V.raw)?M.outlier:at,pointRadius:V=>N(V.raw)?w+e0:w,pointHoverRadius:V=>(N(V.raw)?w+e0:w)+IR,data:lt,pointBorderWidth:0,showLine:!1,isSegmentEmpty:dt})});const W=[];return B.forEach(G=>{const lt=I.get(G.percentile);if(lt===void 0||!Number.isFinite(lt))return;const ut=G.percentile===n0;W.push({percentile:G.percentile,label:s(G.percentile,G.label),value:lt,color:G.color||(ut?M.medianLine:M.outlier),borderDash:G.borderDash||(ut?LR:NR)})}),{datasets:O,...z?{outlier:{value:$,label:e.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:M.outlier}}:{},...W.length?{referenceLines:W}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const zR=(n,t)=>{h.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 UR(){const{i18n:n}=xt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return mo(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const HR="analytics-query-provider",i0=2;function WR(){const n=h.inject(HR);return{evaluateFeatureFlag:(e,i)=>typeof n?.evaluateFeatureFlagFn!="function"?i:n.evaluateFeatureFlagFn(e,i)}}function r0(n,t){return h.getCurrentScope()?(h.onScopeDispose(n,t),!0):!1}const s0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $R=n=>n!=null,VR=Object.prototype.toString,YR=n=>VR.call(n)==="[object Object]";function Ga(n){return Array.isArray(n)?n:[n]}function qR(n){return h.getCurrentInstance()}function jR(n,t={}){if(!h.isRef(n))return h.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=h.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=h.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 GR(n,t=!0,e){qR()?h.onMounted(n,e):t?n():h.nextTick(n)}function KR(n,t,e){return h.watch(n,t,{...e,immediate:!0})}const Ka=s0?window:void 0;function Xr(n){var t;const e=h.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function fo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=h.computed(()=>{const i=Ga(h.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return KR(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Xr(s)))!==null&&i!==void 0?i:[Ka].filter(s=>s!=null),Ga(h.toValue(e.value?n[1]:n[0])),Ga(h.unref(e.value?n[2]:n[1])),h.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=YR(a)?{...a}:a,p=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{p.forEach(m=>m())})},{flush:"post"})}function XR(){const n=h.shallowRef(!1),t=h.getCurrentInstance();return t&&h.onMounted(()=>{n.value=!0},t),n}function o0(n){const t=XR();return h.computed(()=>(t.value,!!n()))}function ZR(n,t,e={}){const{window:i=Ka,...r}=e;let s;const a=o0(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=h.watch(h.computed(()=>{const m=Ga(h.toValue(n)).map(Xr).filter($R);return new Set(m)}),m=>{l(),a.value&&m.size&&(s=new MutationObserver(t),m.forEach(g=>s.observe(g,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),p=()=>{u(),l()};return r0(p),{isSupported:a,stop:p,takeRecords:d}}const Xa={speed:2,margin:30,direction:"both"};function QR(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 JR(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:p,onEnd:m,onStart:g,initialValue:_,axis:x="both",draggingElement:w=Ka,containerElement:S,handle:C=n,buttons:A=[0],restrictInView:B,autoScroll:P=!1}=t,I=h.ref((e=h.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),$=h.ref(),z=V=>a?a.includes(V.pointerType):!0,v=V=>{h.toValue(l)&&V.preventDefault(),h.toValue(u)&&V.stopPropagation()},M=h.toValue(P),O=typeof M=="object"?{speed:(i=h.toValue(M.speed))!==null&&i!==void 0?i:Xa.speed,margin:(r=h.toValue(M.margin))!==null&&r!==void 0?r:Xa.margin,direction:(s=M.direction)!==null&&s!==void 0?s:Xa.direction}:Xa,N=V=>typeof V=="number"?[V,V]:[V.x,V.y],W=(V,L,H)=>{const{clientWidth:it,clientHeight:st,scrollLeft:X,scrollTop:tt,scrollWidth:rt,scrollHeight:j}=V,[et,ot]=N(O.margin),[wt,Lt]=N(O.speed);let vt=0,Ot=0;(O.direction==="x"||O.direction==="both")&&(H.x<et&&X>0?vt=-wt:H.x+L.width>it-et&&X<rt-it&&(vt=wt)),(O.direction==="y"||O.direction==="both")&&(H.y<ot&&tt>0?Ot=-Lt:H.y+L.height>st-ot&&tt<j-st&&(Ot=Lt)),(vt||Ot)&&V.scrollBy({left:vt,top:Ot,behavior:"auto"})};let G=null;const lt=()=>{const V=h.toValue(S);V&&!G&&(G=setInterval(()=>{const L=h.toValue(n).getBoundingClientRect(),{x:H,y:it}=I.value,st={x:H-V.scrollLeft,y:it-V.scrollTop};st.x>=0&&st.y>=0&&(W(V,L,st),st.x+=V.scrollLeft,st.y+=V.scrollTop,I.value=st)},1e3/60))},ut=()=>{G&&(clearInterval(G),G=null)},ht=(V,L,H,it)=>{const[st,X]=typeof H=="number"?[H,H]:[H.x,H.y],{clientWidth:tt,clientHeight:rt}=L;return V.x<st||V.x+it.width>tt-st||V.y<X||V.y+it.height>rt-X},dt=()=>{if(h.toValue(t.disabled)||!$.value)return;const V=h.toValue(S);if(!V)return;const L=h.toValue(n).getBoundingClientRect(),{x:H,y:it}=I.value,st={x:H-V.scrollLeft,y:it-V.scrollTop};ht(st,V,O.margin,L)?lt():ut()};h.toValue(P)&&h.watch(I,dt);const bt=V=>{var L;if(!h.toValue(A).includes(V.button)||h.toValue(t.disabled)||!z(V)||h.toValue(d)&&V.target!==h.toValue(n))return;const H=h.toValue(S),it=H==null||(L=H.getBoundingClientRect)===null||L===void 0?void 0:L.call(H),st=h.toValue(n).getBoundingClientRect(),X={x:V.clientX-(H?st.left-it.left+(P?0:H.scrollLeft):st.left),y:V.clientY-(H?st.top-it.top+(P?0:H.scrollTop):st.top)};g?.(X,V)!==!1&&($.value=X,v(V))},at=V=>{if(h.toValue(t.disabled)||!z(V)||!$.value)return;const L=h.toValue(S);L instanceof HTMLElement&&QR(L);const H=h.toValue(n).getBoundingClientRect();let{x:it,y:st}=I.value;if((x==="x"||x==="both")&&(it=V.clientX-$.value.x,L&&(it=Math.min(Math.max(0,it),L.scrollWidth-H.width))),(x==="y"||x==="both")&&(st=V.clientY-$.value.y,L&&(st=Math.min(Math.max(0,st),L.scrollHeight-H.height))),h.toValue(P)&&L&&(G===null&&W(L,H,{x:it,y:st}),it+=L.scrollLeft,st+=L.scrollTop),L&&(B||P)){if(x!=="y"){const X=it-L.scrollLeft;X<0?it=L.scrollLeft:X>L.clientWidth-H.width&&(it=L.clientWidth-H.width+L.scrollLeft)}if(x!=="x"){const X=st-L.scrollTop;X<0?st=L.scrollTop:X>L.clientHeight-H.height&&(st=L.clientHeight-H.height+L.scrollTop)}}I.value={x:it,y:st},p?.(I.value,V),v(V)},ct=V=>{h.toValue(t.disabled)||!z(V)||$.value&&($.value=void 0,P&&ut(),m?.(I.value,V),v(V))};if(s0){const V=()=>{var L;return{capture:(L=t.capture)!==null&&L!==void 0?L:!0,passive:!h.toValue(l)}};fo(C,"pointerdown",bt,V),fo(w,"pointermove",at,V),fo(w,["pointerup","pointercancel"],ct,V)}return{...jR(I),position:I,isDragging:h.computed(()=>!!$.value),style:h.computed(()=>`
4
+ left: ${I.value.x}px;
5
+ top: ${I.value.y}px;
6
+ ${P?"text-wrap: nowrap;":""}
7
+ `)}}function tP(n,t,e={}){const{window:i=Ka,...r}=e;let s;const a=o0(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=h.watch(h.computed(()=>{const p=h.toValue(n);return Array.isArray(p)?p.map(m=>Xr(m)):[Xr(p)]}),p=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const m of p)m&&s.observe(m,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return r0(d),{isSupported:a,stop:d}}function eP(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=h.shallowRef(0),u=h.shallowRef(0),d=h.shallowRef(0),p=h.shallowRef(0),m=h.shallowRef(0),g=h.shallowRef(0),_=h.shallowRef(0),x=h.shallowRef(0);function w(){const C=Xr(n);if(!C){e&&(l.value=0,u.value=0,d.value=0,p.value=0,m.value=0,g.value=0,_.value=0,x.value=0);return}const A=C.getBoundingClientRect();l.value=A.height,u.value=A.bottom,d.value=A.left,p.value=A.right,m.value=A.top,g.value=A.width,_.value=A.x,x.value=A.y}function S(){a==="sync"?w():a==="next-frame"&&requestAnimationFrame(()=>w())}return tP(n,S),h.watch(()=>Xr(n),C=>!C&&S()),ZR(n,S,{attributeFilter:["style","class"]}),r&&fo("scroll",S,{capture:!0,passive:!0}),i&&fo("resize",S,{passive:!0}),GR(()=>{s&&S()}),{height:l,bottom:u,left:d,right:p,top:m,width:g,x:_,y:x,update:S}}function nP(n,t){const{top:e,left:i}=eP(n),r=h.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=h.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const iP=({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,p=t+(u+1)*a;let m=0;for(;l<r.length&&r[l]>=d&&r[l]<=p;)m++,l++;s.push([Math.ceil(d),m])}return s},a0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),ho=h.ref({}),rP=n=>(ho.value[n]||(ho.value[n]=a0()),ho.value[n]),sP=(n,t)=>{const e=ho.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 ho.value[t])};function oP({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 p=e!==void 0&&n!==void 0?rP(e):a0(),m=n!==void 0?n:"static-chart-key",g=h.computed(()=>t.reduce((O,{timestamps:N})=>[...O,...N],[])),_=h.computed(()=>i||g.value.reduce((O,N)=>O===0?N:Math.min(O,N),0)),x=h.computed(()=>r||g.value.reduce((O,N)=>Math.max(O,N),0));h.watchEffect(()=>{p.minStamps[m]=_.value,p.maxStamps[m]=x.value,l!==void 0&&(p.renderPoints[m]=l)});const w=h.computed(()=>Object.values(p.minStamps).reduce((O,N)=>O===0?N:Math.min(O,N),0)),S=h.computed(()=>Object.values(p.maxStamps).reduce((O,N)=>Math.max(O,N),0)),C=h.computed(()=>{const O=Object.values(p.renderPoints);return O.length===0?24:O.reduce((N,W)=>Math.max(N,W),2)}),A=h.computed(()=>{const O=S.value-w.value;return Math.ceil(O/C.value)}),B=h.computed(()=>t.length>1),P=h.computed(()=>t.map(({timestamps:O,color:N,label:W})=>({data:iP({bucketCount:C.value,minStamp:w.value,maxStamp:S.value,timestamps:O}).map(([ut,ht])=>({x:ut,y:ht})),label:W,...(u==="sparkline_bar"||B.value)&&N&&{backgroundColor:N},...u!=="sparkline_bar"&&N&&{borderColor:N},...B.value&&u!=="sparkline_bar"&&{fill:!0}}))),I=h.computed(()=>{const O=P.value[0]?.data?.length??0,N=[];for(let W=0;W<O;W++){let G=0;for(let lt=0;lt<P.value.length;lt++)G+=P.value[lt].data[W].y;N.push(G)}return N}),$=h.computed(()=>{const O=I.value.reduce((N,W)=>Math.max(N,W),0);return Math.max(O,a??0)}),z=h.computed(()=>{const O=P.value.reduce((G,{data:lt})=>[...G,...lt.map(({y:ut})=>ut)],[]),N=O.length?O[0]:0,W=O.reduce((G,lt)=>Math.min(G,lt),N);return s===void 0?W:Math.min(W,s)});h.watchEffect(()=>{p.maxCounts[m]=$.value,p.minCounts[m]=z.value});const v=h.computed(()=>{const O=Object.values(p.minCounts),N=O.length?O[0]:0;return O.reduce((W,G)=>Math.min(W,G),N)}),M=h.computed(()=>Object.values(p.maxCounts).reduce((O,N)=>Math.max(O,N),0));return h.onUnmounted(()=>{n!==void 0&&e!==void 0&&sP(n,e)}),{syncedMinStamp:w,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:A,syncedMinCount:v,syncedMaxCount:M}}const xt={useBarChartOptions:mR,useChartJSCommon:yR,useChartLegendValues:bR,useChartSelectedRange:xR,useExploreResultToDatasets:DR,useExploreResultToTimeDataset:ER,useScatterDatasets:FR,useDonutChartOptions:wR,useLineChartOptions:vR,useScatterChartOptions:MR,useI18n:Jk,useReportChartDataForSynthetics:zR,useTranslatedUnits:UR,useEvaluateFeatureFlag:WR,useTooltipAbsolutePosition:nP,useSparklineSync:oP},Za=n=>["interactive","zoom-interactive"].includes(n),Ou=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Za(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=xt.useI18n(),{formatUnit:a}=ni({i18n:s}),l=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Za(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",p=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(p,e,r.dataPoints[0].raw):Jr({tickValue:new Date(p),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,_)=>{const x=g.parsed[d],w=a(x??0,n.units,{translateUnit:n.translateUnit}),S=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:S,value:w,rawValue:x,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l);const m=r.dataPoints[0]?.raw?.extras??[];for(const g of m)n.tooltipSeries.push({label:g.label,value:g.unit?a(Number(g.value)||0,g.unit,{translateUnit:n.translateUnit}):String(g.value),rawValue:Number(g.value)||0,isExtra:!0});n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},l0=(n,t)=>{const{tooltip:e}=t,{i18n:i}=xt.useI18n(),{formatUnit:r}=ni({i18n:i});if(e.opacity===0&&!Za(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(e.body&&!Za(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,p)=>{const m=u?d.parsed:d.parsed[l],g=r(m??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[p].backgroundColor,borderColor:a[p].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},aP=n=>n&&n.datasets&&n.datasets.length,lP=n=>aP(n)&&n.datasets.some(t=>t.data.length),cP=n=>n.datasets.some(t=>t.data[0]&&Rc(t.data[0].x)),uP=n=>!!lP(n)&&n.datasets.some(t=>t.data.length==1),dP=n=>cP(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Qa=(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)},c0=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function u0(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Au=(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)},fP=2,d0=10,f0=12,Ja=10,Kn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Eu=(n,t)=>(t||Kn)[n%Kn.length],hP="#6f7787",pP={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"}},mP=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return pP[t]?.background||"#fafafa"},gP=K1,Ru=(n,t,e,i)=>{let r;return e?r=gP:Array.isArray(i)?r=Eu(n,i):r=i[t],r||Eu(n)},Pu=n=>{switch(n){case"error":return X1;case"warning":return tS;case"neutral":return Qh;default:return Qh}},yP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},_P=2,bP=0,Iu=new Map,h0=(n,t)=>{const{i18n:e}=xt.useI18n(),{formatBytes:i}=ni({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):ca.format(n)},xP=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},wP=()=>{const n="label_height";if(!Iu.has(n)){const t=le({});Iu.set(n,t.lineHeight)}return Iu.get(n)},vP=(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),SP=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,TP=G1,MP={100:iS,101:rS,102:sS,103:oS,200:aS,201:lS,202:cS,203:uS,204:dS,205:fS,206:hS,207:pS,208:mS,226:gS,300:yS,301:_S,302:bS,303:xS,304:wS,305:vS,307:SS,308:TS,400:MS,401:kS,402:DS,403:CS,404:OS,405:AS,406:ES,407:RS,408:PS,409:IS,410:LS,411:NS,412:BS,413:FS,414:zS,415:US,416:HS,417:WS,418:$S,421:VS,422:YS,423:qS,424:jS,425:GS,426:KS,428:XS,429:ZS,431:QS,451:JS,500:tT,501:eT,502:nT,503:iT,504:rT,505:sT,506:oT,507:aT,508:lT,510:cT,511:uT},kP={100:dT,200:fT,300:hT,400:pT,500:mT},DP={"1XX":gT,"2XX":yT,"3XX":_T,"4XX":bT,"5XX":xT},p0=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return MP[t]??kP[e]??TP},Lu={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=p0(`${t}`),n),{}),____OTHER____:j1,...DP};function m0(n,t,e){const i=wp(),r=AP(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?CP(r,t):OP(r,t)}function CP(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 OP(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function AP(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function EP(n,t){const e=NP(t);return"formatToParts"in e?PP(e,n):IP(e,n)}const RP={year:0,month:1,day:2,hour:3,minute:4,second:5};function PP(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=RP[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 IP(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 Nu={},g0=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")),LP=g0==="06/25/2014, 00:00:00"||g0==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function NP(n){return Nu[n]||(Nu[n]=LP?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"})),Nu[n]}function y0(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 _0=36e5,BP=6e4,Bu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Fu(n,t,e){if(!n)return 0;let i=Bu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Bu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),b0(r)?-(r*_0):NaN;if(i=Bu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return b0(r,a)?(s=Math.abs(r)*_0+a*BP,i[1]==="+"?-s:s):NaN}if(UP(n)){t=new Date(t||Date.now());const a=e?t:FP(t),l=zu(a,n);return-(e?l:zP(t,l,n))}return NaN}function FP(n){return y0(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function zu(n,t){const e=EP(n,t),i=y0(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 zP(n,t,e){let r=n.getTime()-t;const s=zu(new Date(r),e);if(t===s)return t;r-=s-t;const a=zu(new Date(r),e);return s===a?s:Math.max(s,a)}function b0(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const x0={};function UP(n){if(x0[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),x0[n]=!0,!0}catch{return!1}}const HP=60*1e3,WP={X:function(n,t,e){const i=Uu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return w0(i);case"XXXX":case"XX":return Zr(i);default:return Zr(i,":")}},x:function(n,t,e){const i=Uu(e.timeZone,n);switch(t){case"x":return w0(i);case"xxxx":case"xx":return Zr(i);default:return Zr(i,":")}},O:function(n,t,e){const i=Uu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+$P(i,":");default:return"GMT"+Zr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return m0("short",n,e);default:return m0("long",n,e)}}};function Uu(n,t){const e=n?Fu(n,t,!0)/HP:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function tl(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Zr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=tl(Math.floor(i/60),2),s=tl(Math.floor(i%60),2);return e+r+t+s}function w0(n,t){return n%60===0?(n>0?"-":"+")+tl(Math.abs(n)/60,2):Zr(n,t)}function $P(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+tl(s,2)}function v0(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 VP=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Hu=36e5,S0=6e4,YP=2,Qe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:VP};function T0(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?YP: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=qP(n),{year:r,restDateString:s}=jP(i.date,e),a=GP(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=KP(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Fu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=v0(new Date(l+u)),d=v0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function qP(n){const t={};let e=Qe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Qe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Qe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function jP(n,t){if(n){const e=Qe.YYY[t],i=Qe.YYYYY[t];let r=Qe.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Qe.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 GP(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=Qe.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,D0(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Qe.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return QP(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Qe.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return D0(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Qe.Www.exec(n),s)return r=parseInt(s[1],10)-1,C0(r)?M0(t,r):new Date(NaN);if(s=Qe.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return C0(r,a)?M0(t,r,a):new Date(NaN)}return null}function KP(n){let t,e,i=Qe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Wu(t)?t%24*Hu:NaN;if(i=Qe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Wu(t,e)?t%24*Hu+e*S0:NaN;if(i=Qe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Wu(t,e,r)?t%24*Hu+e*S0+r*1e3:NaN}return null}function M0(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 XP=[31,28,31,30,31,30,31,31,30,31,30,31],ZP=[31,29,31,30,31,30,31,31,30,31,30,31];function k0(n){return n%400===0||n%4===0&&n%100!==0}function D0(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=k0(n);if(i&&e>ZP[t]||!i&&e>XP[t])return!1}return!0}function QP(n,t){if(t<1)return!1;const e=k0(n);return!(e&&t>366||!e&&t>365)}function C0(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Wu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const JP=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function $u(n,t,e={}){t=String(t);const i=t.match(JP);if(i){const r=T0(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,"'"+WP[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return ha(n,t,e)}function t2(n,t,e){n=T0(n,e);const i=Fu(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 po(n,t,e,i){return i={...i,timeZone:t,originalDate:n},$u(t2(n,t,{timeZone:i.timeZone}),e,i)}const e2=(n,t)=>`${po(n,t,"yyyy")} W${po(n,t,"II")}`,Vu="yyyy-MM-dd h:mm:ss a",Yu="h:mm:ss a",mr="yyyy-MM-dd h:mm a",Qr="h:mm a",n2="yyyy-MM-dd",qu="MMM dd, yyyy h:mm:ss a",Ni="MMM dd, yyyy h:mm a",i2={secondly:n=>n?Vu:Yu,tenSecondly:n=>n?Vu:Yu,thirtySecondly:n=>n?Vu:Yu,minutely:n=>n?mr:Qr,fiveMinutely:n=>n?mr:Qr,tenMinutely:n=>n?mr:Qr,thirtyMinutely:n=>n?mr:Qr,hourly:n=>n?mr:Qr,twoHourly:n=>n?mr:Qr,twelveHourly:()=>mr,daily:()=>n2},r2={secondly:()=>qu,tenSecondly:()=>qu,thirtySecondly:()=>qu,minutely:()=>Ni,fiveMinutely:()=>Ni,tenMinutely:()=>Ni,thirtyMinutely:()=>Ni,hourly:()=>Ni,twoHourly:()=>Ni,twelveHourly:()=>Ni,daily:()=>Ni};function O0({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 e2(n,l);if(r&&r[t]){const u=r[t](i);return po(n,l,u)}if(s&&s[t]){const u=s[t]();return po(n,l,u)}return po(n,l,a)}const A0=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>O0({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:i2,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Jr=({tickValue:n,granularity:t,timezone:e})=>O0({tickValue:n,granularity:t,timezone:e,tooltipMap:r2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),E0=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",s2=n=>{const{i18n:t}=xt.useI18n();return E0(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}},mo=n=>n.toLocaleLowerCase().endsWith("count"),o2=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))},a2=(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)},l2=(n,t)=>{const e=n.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,a2(e,i)]))},R0=.7,ju=(n,t)=>{const e=ka(n.trim());return e.valid?e.alpha(t).rgbString():n},Gu=n=>{const t=n??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:Jh,outlier:Xh,outlierBand:ju(Zh,R0)};const e=window.getComputedStyle(t),i=(r,s)=>e.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",Jh),outlier:i("--kui-color-background-danger",Xh),outlierBand:ju(i("--kui-color-background-danger-weakest",Zh),R0)}},c2="empty",P0=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.length>1?e[0]:void 0,p=d?e[1]:e[0],m=t&&Object.keys(t)[0]||void 0,g=n.data??[],_=[];for(const x of g){const w=L0(x.timestamp,x.event[p],m?x.event[m]:void 0);if(w){if(d){const S=I0(x.event[d]);if(S===void 0)continue;w.x=S}_.push(w)}}return{points:_,metric:p,metricUnit:i?.[p],...d?{xMetric:d,xMetricUnit:i?.[d]}:{},dimension:m,display:m?t?.[m]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},I0=n=>{if(n==null||n==="")return;const t=Number(n);return Number.isFinite(t)?t:void 0},L0=(n,t,e,i)=>{const r=new Date(n).valueOf(),s=I0(t);if(!Number.isFinite(r)||s===void 0)return;const a=i?.length?{extras:i}:{};return e===void 0?{timestamp:r,value:s,...a}:{timestamp:r,value:s,group:e!==null&&e!==""?String(e):c2,...a}},u2=(n,t,e)=>{if(!e?.length)return;const i=[];for(const{field:r,label:s,unit:a}of e){const l=gr(n,r)??gr(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},d2=(n,t)=>{if(!n||!("meta"in n))return;const{metric:e,dimension:i,unroll:r,display:s,extraFields:a,metricUnit:l}=t,u=t.timestamp??"request_start";if(!e){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const d=[];for(const p of n.results??[]){const m=gr(p,u);for(const g of f2(p,r)){const _=gr(g,e),x=i?gr(g,i)??gr(p,i):void 0,w=L0(m,_,i?x??null:void 0,u2(g,p,a));w&&d.push(w)}}return{points:d,metric:e,metricUnit:l,dimension:i,display:s,start:n.meta?.time_range?.start,end:n.meta?.time_range?.end,truncated:n.truncated,limit:n.limit,datasource:"requests"}},f2=(n,t)=>{if(!t)return[n];const e=gr(n,t);return Array.isArray(e)?e:[]},gr=(n,t)=>{let e=n;for(const i of t.split(".")){if(e===null||typeof e!="object")return;e=e[i]}return e},N0=n=>Object.hasOwn(Op.chartLabels,n),h2=["hidden","single","full"];var yr=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(yr||{});const p2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],m2=["gauge","top_n","single_value"],Ku=n=>n===null||typeof n!="object"||!("points"in n)?!1:Array.isArray(n.points);var Ie=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(Ie||{});const B0={modes:{point(n,t){return el(n,t,{intersect:!0})},nearest(n,t,e){return _2(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 Xu(n,t,e){return(B0.modes[e.mode]||B0.modes.nearest)(n,t,e)}function g2(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 y2(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):g2(i,t,e.axis))}function _2(n,t,e){let i=Number.POSITIVE_INFINITY;return el(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),l=y2(t,a,e.axis),u=$r(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 _r(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 b2=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,br=.001,nl=(n,t,e)=>Math.min(e,Math.max(t,n)),F0=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function x2(n,t,e){for(const i of Object.keys(n))n[i]=nl(n[i],t,e);return n}function w2(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 z0(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=n.x>=t-u-br&&n.x<=i+u+br,p=n.y>=e-u-br&&n.y<=r+u+br;return s==="x"?d:(s==="y"||d)&&p}function U0(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=_r(n,e,we(-r));return z0(l,t,i,{borderWidth:s,hitTolerance:a})}function xr(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function v2(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(b2(l,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const H0=n=>typeof n=="string"&&n.endsWith("%"),W0=n=>parseFloat(n)/100,$0=n=>nl(W0(n),0,1),go=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),S2={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 Zu(n,t){return t==="start"?0:t==="end"?n:H0(t)?$0(t)*n:n/2}function Bi(n,t,e=!0){return typeof t=="number"?t:H0(t)?(e?$0(t):W0(t))*n:n}function T2(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 V0(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const l=It(a),u=t.width+(l?a.width:0)+e,d=t.height+(l?a.height:0)+e,p=Qu(i),m=G0(n.x,u,r,p.x),g=G0(n.y,d,s,p.y);return{x:m,y:g,x2:m+u,y2:g+d,width:u,height:d,centerX:m+u/2,centerY:g+d/2}}function Qu(n,t="center"){return It(n)?{x:Ct(n.x,t),y:Ct(n.y,t)}:(n=Ct(n,t),{x:n,y:n})}const Y0=(n,t)=>n&&n.autoFit&&t<1;function q0(n,t){const e=n.font,i=qt(e)?e:[e];return Y0(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 j0(n){return n&&(rn(n.xValue)||rn(n.yValue))}function G0(n,t,e=0,i){return n-Zu(t,i)+e}function ts(n,t,e){const i=e.init;if(i){if(i===!0)return X0(t,e)}else return;return M2(n,t,e)}function K0(n,t,e){let i=!1;return t.forEach(r=>{sn(n[r])?(i=!0,e[r]=n[r]):rn(e[r])&&delete e[r]}),i}function X0(n,t){const e=t.type||"line";return S2[e](n)}function M2(n,t,e){const i=Qt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return X0(t,e);if(It(i))return i}const Ju=new Map,k2=n=>isNaN(n)||n<=0,D2=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(we(i)),n.translate(-t,-e))}function ui(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 es(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:Bi(e.width,t.width),height:Bi(e.height,t.height)};const i=q0(t),r=t.textStrokeWidth,s=qt(e)?e:[e],a=s.join()+D2(i)+r+(n._measureText?"-spriting":"");return Ju.has(a)||Ju.set(a,E2(n,s,i,r)),Ju.get(a)}function Z0(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),es(n,e);const l=ui(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Vr(n,{x:i,y:r,w:s,h:a,radius:x2(Ai(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),l&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Q0(n,t,e,i){const r=e.content;if(il(r)){n.save(),n.globalAlpha=I2(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=q0(e,i),l=e.color,u=qt(l)?l:[l],d=T2(t,e),p=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,C2(n,e)&&R2(n,{x:d,y:p},s,a),P2(n,{x:d,y:p},s,{fonts:a,colors:u}),n.restore()}function C2(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function O2(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*jc;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}k2(r)||A2(n,{x:e,y:i,radius:r,rotation:l,style:a,rad:u})}function A2(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let l,u,d,p;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+=va,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=va,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":p=i*.516,d=i-p,l=Math.cos(a+Dn)*d,u=Math.sin(a+Dn)*d,n.arc(t-l,e-u,p,a-Rt,a-re),n.arc(t+u,e-l,p,a-re,a),n.arc(t+l,e+u,p,a,a+re),n.arc(t-u,e+l,p,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+=Dn;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+=Dn;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+=Dn,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 E2(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 R2(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 P2(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)],p=r[Math.min(u,r.length-1)],m=p.lineHeight;n.beginPath(),n.font=p.string,n.fillStyle=d,n.fillText(l,t,e+m/2+a),a+=m,n.fill()})}function I2(n,t){const e=Oi(n)?n:t;return Oi(e)?nl(e,0,1):1}const J0=["left","bottom","top","right"];function L2(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&U2(t,s);if(!a||W2(t,s,a))return;if(n.save(),n.beginPath(),!ui(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=N2(t,a),{sideStart:p,sideEnd:m}=F2(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(p.x,p.y),n.lineTo(m.x,m.y);const g=_r({x:e,y:i},t.getCenterPoint(),we(-t.rotation));n.lineTo(g.x,g.y),n.stroke(),n.restore()}function N2(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=B2(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 B2(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 F2(n,t,e){const{y:i,width:r,height:s,options:a}=n,l=a.callout.start,u=z2(t,a.callout);let d,p;return t==="left"||t==="right"?(d={x:e.x,y:i+Bi(s,l)},p={x:d.x+u,y:d.y}):(d={x:e.x+Bi(r,l),y:e.y},p={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:p}}function z2(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function U2(n,t){const e=t.position;return J0.includes(e)?e:H2(n,t)}function H2(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:p,centerY:m,rotation:g}=n,_={x:p,y:m},x=t.start,w=Bi(a,x),S=Bi(l,x),C=[e,e+w,e+w,r],A=[i+S,s,i,s],B=[];for(let P=0;P<4;P++){const I=_r({x:C[P],y:A[P]},_,we(g));B.push({position:J0[P],distance:$r(I,{x:u,y:d})})}return B.sort((P,I)=>P.distance-I.distance)[0].position}function W2(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 ty={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 ns(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function wr(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 ey(n,t){if(n){const e=n.options.reverse,i=ns(n,t.min,e?t.end:t.start),r=ns(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function ny(n,t){const{chartArea:e,scales:i}=n,r=i[wr(i,t,"xScaleID")],s=i[wr(i,t,"yScaleID")];let a=e.width/2,l=e.height/2;return r&&(a=ns(r,t.xValue,r.left+r.width/2)),s&&(l=ns(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function td(n,t){const e=n.scales,i=e[wr(e,t,"xScaleID")],r=e[wr(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:l,bottom:u}=r||n.chartArea;const d=sy(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const p=sy(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=p.start,u=p.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 iy(n,t){if(!j0(t)){const e=td(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 V2(n,t)}function $2(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?Y2(r,s,t):q2(e,s,t),s}function ry(n,t){const e=td(n,t);return e.initProperties=ts(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:K2(n,e,t),initProperties:e.initProperties}],e}function V2(n,t){const e=ny(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 sy(n,t){const e=ey(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function Y2(n,t,e){const i=ns(n,e.value,NaN),r=ns(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function q2(n,t,e){for(const i of Object.keys(ty)){const r=n[wr(n,e,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:p}=ty[i],m=ey(r,{min:e[s],max:e[a],start:r[l],end:r[u]});t[d]=m.start,t[p]=m.end}}}function j2({properties:n,options:t},e,i,r){const{x:s,x2:a,width:l}=n;return oy({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 G2({properties:n,options:t},e,i,r){const{y:s,y2:a,height:l}=n;return oy({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 oy(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+Zu(d,s)}function K2(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Qu(i.position),s=ve(i.padding),a=sl(n.ctx,i),l=j2({properties:t,options:e},a,r,s),u=G2({properties:t,options:e},a,r,s),d=a.width+s.width,p=a.height+s.height;return{x:l,y:u,x2:l+d,y2:u+p,width:d,height:p,centerX:l+d/2,centerY:u+p/2,rotation:i.rotation}}const ed=["enter","leave"],nd=ed.concat("click");function X2(n,t,e){t.listened=K0(e,nd,t.listeners),t.moveListened=!1,ed.forEach(i=>{sn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&sn(i.click)&&(t.listened=!0),t.moveListened||ed.forEach(r=>{sn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function Z2(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return Q2(n,t,e);case"click":return J2(n,t,e)}}function Q2(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Xu(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=ay(s,"leave",r,i);return ay(s,"enter",i,r)||a}function ay({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=ly(a.options[e]||n.listeners[e],a,t)||s);return s}function J2(n,t,e){const i=n.listeners,r=Xu(n.visibleElements,t,e.interaction);let s;for(const a of r)s=ly(a.options.click||i.click,a,t)||s;return s}function ly(n,t,e){return Qt(n,[t.$context,e])===!0}const ol=["afterDraw","beforeDraw"];function tI(n,t,e){const i=t.visibleElements;t.hooked=K0(e,ol,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ol.forEach(s=>{sn(r.options[s])&&(t.hooked=!0)})})}function cy(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Qt(i,[t.$context])}}function eI(n,t,e){const i=oI(n.scales,t,e);let r=uy(t,i,"min","suggestedMin");r=uy(t,i,"max","suggestedMax")||r,r&&sn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function nI(n,t){for(const e of n)rI(e,t)}function uy(n,t,e,i){if(ae(t[e])&&!iI(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function iI(n,t,e){return rn(n[t])||rn(n[e])}function rI(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=wr(t,n,e);i&&!t[i]&&sI(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function sI(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(rn(n[e+i]))return!0;return!1}function oI(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ct(t.min,Number.NEGATIVE_INFINITY),max:Ct(t.max,Number.POSITIVE_INFINITY)};for(const l of e)l.scaleID===r?dy(l,t,["value","endValue"],a):wr(n,l,s)===r&&dy(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function dy(n,t,e,i){for(const r of e){const s=n[r];if(rn(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class is extends Ve{inRange(t,e,i,r){const{x:s,y:a}=_r({x:t,y:e},this.getCenterPoint(r),we(-this.options.rotation));return z0({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return xr(this,t)}draw(t){t.save(),rl(t,this.getCenterPoint(),this.options.rotation),Z0(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return ry(t,e)}}is.id="boxAnnotation",is.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},is.defaultRoutes={borderColor:"color",backgroundColor:"color"},is.descriptors={label:{_fallback:!0}};class al extends Ve{inRange(t,e,i,r){return U0({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 xr(this,t)}draw(t){const e=this.options;!e.display||!e.content||(fI(t,this),t.save(),rl(t,this.getCenterPoint(),this.rotation),Q0(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=aI(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=cI(t,e,i);let l=sl(t.ctx,e);const u=uI(l,a);Y0(e,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:p,yAdjust:m}=e,g=V0(s,l,{borderWidth:0,position:d,xAdjust:p,yAdjust:m});return{initProperties:ts(t,g,e),...g,...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 aI(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Js&&lI(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function lI(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 cI({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:l,offsetX:u,offsetY:d}=e.controller,p=(i+s)/2+u,m=(r+a)/2+d,g={left:Math.max(p-l,i),right:Math.min(p+l,s),top:Math.max(m-l,r),bottom:Math.min(m+l,a)},_={x:(g.left+g.right)/2,y:(g.top+g.bottom)/2},x=t.spacing+t.borderWidth/2,w=l-x,S=_.y>m,C=S?r+x:a-x,A=dI(C,p,m,w);return{controllerMeta:{_centerX:p,_centerY:m,_radius:w,_counterclockwise:S,...A},point:_,radius:Math.min(l,Math.min(g.right-g.left,g.bottom-g.top)/2)}}function uI({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function dI(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,p=(-a+Math.sqrt(u))/2;return{_startAngle:Ta({x:t,y:e},{x:d,y:n}).angle,_endAngle:Ta({x:t,y:e},{x:p,y:n}).angle}}function fI(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;n.save();const d=ui(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 yo extends Ve{inRange(t,e,i,r){return U0({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 xr(this,t)}draw(t){const e=this.options,i=!rn(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),rl(t,this.getCenterPoint(),this.rotation),L2(t,this),Z0(t,this,e),Q0(t,hI(this),e),t.restore())}resolveElementProperties(t,e){let i;if(j0(e))i=ny(t,e);else{const{centerX:l,centerY:u}=td(t,e);i={x:l,y:u}}const r=ve(e.padding),s=sl(t.ctx,e),a=V0(i,s,e,r);return{initProperties:ts(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}yo.id="labelAnnotation",yo.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},yo.defaultRoutes={borderColor:"color"};function hI({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=ve(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 id=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),rd=(n,t,e)=>id(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,fy=(n,t,e)=>id(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,_o=n=>n*n,pI=(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},hy=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,sd=(n,t,e,i)=>({x:hy(n.x,t.x,e.x,i),y:hy(n.y,t.y,e.y,i)}),py=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),my=(n,t,e,i)=>-Math.atan2(py(n.x,t.x,e.x,i),py(n.y,t.y,e.y,i))+.5*Rt;class bo 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){ui(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:p}=this.$context,m=t*p.currentDevicePixelRatio,g=e*p.currentDevicePixelRatio,_=u.isPointInStroke(l,m,g)||od(this,a,r);return u.restore(),_}const d=_o(s);return _I(this,a,d,r)||od(this,a,r)}return mI(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return xr(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!ui(t,l))return t.restore();es(t,l);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(l.curve&&a)return kI(t,this,a,u),t.restore();const{startOpts:d,endOpts:p,startAdjust:m,endAdjust:g}=xy(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+m,0),t.lineTo(u-g,0),t.shadowColor=l.borderShadowColor,t.stroke(),ad(t,0,m,d),ad(t,u,-g,p),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=$2(t,e),{x:r,y:s,x2:a,y2:l}=i,u=gI(i,t.chartArea),d=u?yI({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=ts(t,d,e),e.curve){const m={x:d.x,y:d.y},g={x:d.x2,y:d.y2};d.cp=MI(d,e,$r(m,g))}const p=bI(t,d,e.label);return p._visible=u,d.elements=[{type:"label",optionScope:"label",properties:p,initProperties:d.initProperties}],d}}bo.id="lineAnnotation";const gy={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};bo.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},gy),fill:!1,length:12,start:Object.assign({},gy),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({},yo.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},bo.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},bo.defaultRoutes={borderColor:"color"};function mI(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=pI(t,e,n.getProps(["x","y","x2","y2"],s),i);return F0(a,r)||od(n,{mouseX:t,mouseY:e},s,i)}function gI({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 yy({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=fy(a,{x:n,y:t},e),n=a),n>r&&(t=fy(r,{x:n,y:t},e),n=r),t<i&&(n=rd(i,{x:n,y:t},e),t=i),t>s&&(n=rd(s,{x:n,y:t},e),t=s),{x:n,y:t}}function yI(n,t,e){const{x:i,y:r}=yy(n,t,e),{x:s,y:a}=yy(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function _I(n,{mouseX:t,mouseY:e},i=br,r){const{x:s,y:a,x2:l,y2:u}=n.getProps(["x","y","x2","y2"],r),d=l-s,p=u-a,m=_o(d)+_o(p),g=m===0?-1:((t-s)*d+(e-a)*p)/m;let _,x;return g<0?(_=s,x=a):g>1?(_=l,x=u):(_=s+g*d,x=a+g*p),_o(t-_)+_o(e-x)<=i}function od(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function bI(n,t,e){const i=e.borderWidth,r=ve(e.padding),s=sl(n.ctx,e),a=s.width+r.width+i,l=s.height+r.height+i;return wI(t,e,{width:a,height:l,padding:r},n.chartArea)}function xI(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 wI(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:l,yAdjust:u}=t,d={x:n.x,y:n.y},p={x:n.x2,y:n.y2},m=t.rotation==="auto"?xI(n):we(t.rotation),g=vI(r,s,m),_=SI(n,t,{labelSize:g,padding:a},i),x=n.cp?sd(d,n.cp,p,_):id(d,p,_),w={size:g.w,min:i.left,max:i.right,padding:a.left},S={size:g.h,min:i.top,max:i.bottom,padding:a.top},C=by(x.x,w)+l,A=by(x.y,S)+u;return{x:C-r/2,y:A-s/2,x2:C+r/2,y2:A+s/2,centerX:C,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:Sa(m)}}function vI(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 SI(n,t,e,i){let r;const s=TI(n,i);return t.position==="start"?r=_y({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-_y({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=Zu(1,t.position),r}function _y(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 TI(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 by(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 xy(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:wy(n,e),endAdjust:wy(n,i)}}function wy(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(rd(0,s,{x:0,y:r}))}function ad(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(),es(n,i),ui(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 MI(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=n,d=Math.atan2(a-r,s-i),p=Qu(t.controlPoint,0),m={x:l+Bi(e,p.x,!1),y:u+Bi(e,p.y,!1)};return _r(m,{x:l,y:u},d)}function vy(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),ad(n,0,-r,s),n.restore())}function kI(n,t,e,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:p,startAdjust:m,endAdjust:g}=xy(t),_={x:r,y:s},x={x:a,y:l},w=my(_,e,x,0),S=my(_,e,x,1)-Rt,C=sd(_,e,x,m/i),A=sd(_,e,x,1-g/i),B=new Path2D;n.beginPath(),B.moveTo(C.x,C.y),B.quadraticCurveTo(e.x,e.y,A.x,A.y),n.shadowColor=u.borderShadowColor,n.stroke(B),t.path=B,t.ctx=n,vy(n,C,{angle:w,adjust:m},d),vy(n,A,{angle:S,adjust:g},p)}class xo 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 DI({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:l,y:u,x2:d,y2:p}=this.getProps(["x","y","x2","y2"],r),m=i==="y"?{start:u,end:p}:{start:l,end:d},g=_r({x:t,y:e},this.getCenterPoint(r),we(-s));return g[i]>=m.start-a-br&&g[i]<=m.end+a+br}getCenterPoint(t){return xr(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),rl(t,this.getCenterPoint(),a.rotation),es(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=ui(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 ry(t,e)}}xo.id="ellipseAnnotation",xo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},is.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},xo.defaultRoutes={borderColor:"color",backgroundColor:"color"},xo.descriptors={label:{_fallback:!0}};function DI(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 p=we(e||0),m=Math.cos(p),g=Math.sin(p),_=Math.pow(m*(n.x-a)+g*(n.y-l),2),x=Math.pow(g*(n.x-a)-m*(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),p=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?w2({x:t,y:e},this.getCenterPoint(r),d/2,p):F0(i==="y"?{start:a,end:u,value:e}:{start:s,end:l,value:t},p)}getCenterPoint(t){return xr(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,es(t,e);const r=ui(t,e);O2(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=iy(t,e);return i.initProperties=ts(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&&OI(this.elements,t,e,r);const s=_r({x:t,y:e},this.getCenterPoint(r),we(-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 xr(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,es(t,i);const r=ui(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=iy(t,e),{sides:r,rotation:s}=e,a=[],l=2*Rt/r;let u=s*jc;for(let d=0;d<r;d++,u+=l){const p=CI(i,e,u);p.initProperties=ts(t,i,e),a.push(p)}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 CI({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 OI(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 Fi={box:is,doughnutLabel:al,ellipse:xo,label:yo,line:bo,point:ll,polygon:cl};Object.keys(Fi).forEach(n=>{se.describe(`elements.${Fi[n].id}`,{_fallback:"plugins.annotation.common"})});const AI={update:Object.assign},EI=nd.concat(ol),Sy=(n,t)=>It(t)?ud(n,t):n,ld=n=>n==="color"||n==="font";function cd(n="line"){return Fi[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function RI(n,t,e,i){const r=II(n,e.animations,i),s=t.annotations,a=BI(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=Ty(a,l,u.type),p=u.setContext(NI(n,d,a,u)),m=d.resolveElementProperties(n,p);m.skip=PI(m),"elements"in m&&(LI(d,m.elements,p,r),delete m.elements),rn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=My(p),r.update(d,m)}}function PI(n){return isNaN(n.x)||isNaN(n.y)}function II(n,t,e){return e==="reset"||e==="none"||e==="resize"?AI:new au(n,t)}function LI(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=Ty(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);l.options=My(d),i.update(u,l)}}function Ty(n,t,e,i){const r=Fi[cd(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function My(n){const t=Fi[cd(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,ud(n,t.defaults),ud(n,t.defaultRoutes));for(const i of EI)e[i]=n[i];return e}function ud(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];ld(i)&&qt(s)?e[i]=s.map(a=>Sy(a,r)):e[i]=Sy(s,r)}return e}function NI(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 BI(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 FI="3.1.0";const zi=new Map,ky=n=>n.type!=="doughnutLabel",zI=nd.concat(ol);var Dy={id:"annotation",version:FI,beforeRegister(){v2("chart.js","4.0",on.version)},afterRegister(){on.register(Fi)},afterUnregister(){on.unregister(Fi)},beforeInit(n){zi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=zi.get(n),r=i.annotations=[];let s=e.annotations;It(s)?Object.keys(s).forEach(a=>{const l=s[a];It(l)&&(l.id=a,r.push(l))}):qt(s)&&r.push(...s),nI(r.filter(ky),n.scales)},afterDataLimits(n,t){const e=zi.get(n);eI(n,t.scale,e.annotations.filter(ky).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=zi.get(n);X2(n,i,e),RI(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),tI(n,i,e)},beforeDatasetsDraw(n,t,e){wo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){wo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){wo(n,t.index,e.clip)},beforeDraw(n,t,e){wo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){wo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=zi.get(n);Z2(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){zi.delete(n)},getAnnotations(n){const t=zi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Xu(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=>!zI.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Fi[cd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ld,_fallback:!0},_indexable:ld}},additionalOptionScopes:[""]};function wo(n,t,e){const{ctx:i,chartArea:r}=n,s=zi.get(n);e&&Ks(i,r);const a=UI(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)HI(i,r,s,l);e&&Xs(i)}function UI(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 HI(n,t,e,i){const r=i.element;i.main?(cy(e,r,"beforeDraw"),r.draw(n,t),cy(e,r,"afterDraw")):r.draw(n,t)}const WI={class:"zoom-timerange-container"},$I={class:"zoom-timerange-details"},VI={class:"label","data-testid":"zoom-timerange-from"},YI={class:"label","data-testid":"zoom-timerange-to"},qI=h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=xt.useI18n(),i=h.ref(Jr({tickValue:t.start,granularity:t.granularity})),r=h.ref(Jr({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{u0(()=>{i.value=Jr({tickValue:a,granularity:t.granularity}),r.value=Jr({tickValue:l,granularity:t.granularity})},100)()};return h.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(h.openBlock(),h.createElementBlock("div",WI,[h.createElementVNode("div",$I,[h.createElementVNode("div",VI,h.toDisplayString(h.unref(e).t("zoom_time_range.from")),1),h.createElementVNode("div",null,h.toDisplayString(i.value),1),h.createElementVNode("div",YI,h.toDisplayString(h.unref(e).t("zoom_time_range.to")),1),h.createElementVNode("div",null,h.toDisplayString(r.value),1)])]))}}),qe=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},Cy=qe(qI,[["__scopeId","data-v-4fa681cf"]]),jI={class:"zoom-actions-container"},GI={class:"zoom-actions-heading"},KI={class:"zoom-action-select"},XI=["data-testid"],ZI=["aria-disabled","href"],QI=["onClick"],JI=qe(h.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)=>(h.openBlock(),h.createElementBlock("div",jI,[h.createElementVNode("div",GI,[h.createVNode(Cy,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),h.createVNode(h.unref(de.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${h.unref(Cc)})`,size:`var(--kui-icon-size-30, ${h.unref(ir)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=h.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),h.createElementVNode("div",KI,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.zoomActionItems,l=>(h.openBlock(),h.createElementBlock("div",{key:l.key,class:h.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(h.openBlock(),h.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},h.toDisplayString(l.label),9,ZI)):(h.openBlock(),h.createElementBlock("div",{key:1,onClick:u=>r(l)},h.toDisplayString(l.label),9,QI))],10,XI))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),tL={key:2},eL={class:"tooltip-title"},nL={class:"title"},iL={key:0,class:"subtitle"},rL={class:"context"},sL={class:"metric"},oL={class:"tooltip"},aL={key:0,class:"square-marker marker-placeholder"},lL={class:"display-value"},vo=qe(h.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=h.ref(null),{x:s,y:a,isDragging:l}=JR(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=h.computed(()=>`${a.value}px`),d=h.computed(()=>`${s.value}px`),p=h.computed(()=>i.state.tooltipContext),m=h.computed(()=>i.state.metricDisplay),g=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return h.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),h.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),h.watch(r,_=>{if(_){const{width:x,height:w}=_.getBoundingClientRect();e("dimensions",{width:x,height:w})}}),(_,x)=>n.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:h.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:g.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:g.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(h.openBlock(),h.createBlock(Cy,{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?(h.openBlock(),h.createBlock(JI,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=w=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",tL,[h.createElementVNode("div",eL,[h.createElementVNode("div",nL,[h.createElementVNode("div",null,h.toDisplayString(n.tooltipTitle),1),g.value?(h.openBlock(),h.createBlock(h.unref(de.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${h.unref(Cc)})`,size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["color","size"])):h.createCommentVNode("",!0)]),p.value||m.value?(h.openBlock(),h.createElementBlock("div",iL,[h.createElementVNode("div",rL,h.toDisplayString(p.value),1),h.createElementVNode("div",sL,h.toDisplayString(m.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",oL,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.state.tooltipSeries,({backgroundColor:w,borderColor:S,label:C,value:A,isSegmentEmpty:B,isExtra:P},I)=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:C+I},[n.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",{key:0,class:h.normalizeClass({"extra-row":P})},[P?(h.openBlock(),h.createElementBlock("div",aL)):(h.openBlock(),h.createElementBlock("div",{key:1,class:"square-marker",style:h.normalizeStyle({background:String(w),borderColor:String(S)})},null,4)),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:B}])},h.toDisplayString(C),3),h.createElementVNode("span",lL,h.toDisplayString(A),1)],2)):h.createCommentVNode("",!0)],64))),128))])]))],6)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),cL={key:0,class:"legend-container","data-testid":"legend"},uL=["onClick"],dL={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},fL=["stroke","stroke-dasharray"],hL=["title"],pL={class:"label truncate-label"},mL={key:0,class:"sub-label"},gL={key:0},yL={class:"tooltip-content"},ul=qe(h.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}=xt.useI18n(),i=h.inject("showLegendValues",!1),r=h.inject("legendPosition",h.ref(Ie.Bottom)),s=({datasetIndex:u,index:d,isKey:p},m)=>p?`key-${m}`:`dataset-${u??0}-${d??0}`,a=(u=0,d)=>{if(t.chartInstance===null)return;const p=t.chartInstance instanceof on?t.chartInstance:t.chartInstance.chart,m=l(u,d);!p.getDatasetMeta(u).dataset&&d!==void 0?p.toggleDataVisibility(d):m?p.hide(u,d):p.show(u,d),p.update()},l=(u=0,d)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const p=t.chartInstance instanceof on?t.chartInstance:t.chartInstance.chart;return p.getDatasetMeta(u).dataset||d===void 0?p.isDatasetVisible(u):p.getDataVisibility(d)};return(u,d)=>{const p=h.resolveComponent("KTooltip");return h.unref(r)!==h.unref(Ie).Hidden?(h.openBlock(),h.createElementBlock("ul",cL,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:m,strokeStyle:g,text:_,datasetIndex:x,index:w,value:S,isSegmentEmpty:C,isKey:A,lineDash:B},P)=>(h.openBlock(),h.createElementBlock("li",{key:s({datasetIndex:x,index:w,isKey:A},P),class:h.normalizeClass({"legend-key":A}),onClick:I=>A?void 0:a(x,w)},[B?.length?(h.openBlock(),h.createElementBlock("svg",dL,[h.createElementVNode("line",{stroke:g,"stroke-dasharray":B.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,fL)])):(h.openBlock(),h.createElementBlock("div",{key:1,class:"square-marker",style:h.normalizeStyle({background:m,"border-color":g})},null,4)),h.createVNode(p,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!A&&!l(x,w),"inline-value":A}]),title:S&&(h.unref(i)||A)?`${_}: ${S.formatted}`:_},[h.createElementVNode("div",pL,h.toDisplayString(_),1),S&&(h.unref(i)||A)?(h.openBlock(),h.createElementBlock("div",mL,[A?(h.openBlock(),h.createElementBlock("span",gL,"-")):h.createCommentVNode("",!0),h.createTextVNode(" "+h.toDisplayString(S.formatted),1)])):h.createCommentVNode("",!0)],10,hL)]),_:2},[C?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",yL,h.toDisplayString(h.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,uL))),128))])):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Le=[];for(let n=0;n<256;++n)Le.push((n+256).toString(16).slice(1));function _L(n,t=0){return(Le[n[t+0]]+Le[n[t+1]]+Le[n[t+2]]+Le[n[t+3]]+"-"+Le[n[t+4]]+Le[n[t+5]]+"-"+Le[n[t+6]]+Le[n[t+7]]+"-"+Le[n[t+8]]+Le[n[t+9]]+"-"+Le[n[t+10]]+Le[n[t+11]]+Le[n[t+12]]+Le[n[t+13]]+Le[n[t+14]]+Le[n[t+15]]).toLowerCase()}const bL=new Uint8Array(16);function xL(){return crypto.getRandomValues(bL)}function dd(n,t,e){return crypto.randomUUID?crypto.randomUUID():wL(n)}function wL(n,t,e){n=n||{};const i=n.random??n.rng?.()??xL();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,_L(i)}const Oy=(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 Ay{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Oy(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,Oy(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 vL=["id"],SL=["id"],TL={class:"axis-tooltip-content"},ML="100%",kL="100%",DL=20,CL=20,Ey=6,OL=0,AL=10,EL=10,RL=1,PL=qe(h.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=xt.useI18n(),{translateUnit:i}=xt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new Ay,l=h.useTemplateRef("chartContainer"),u=h.useTemplateRef("chartParent"),d=({chart:X},tt)=>{const rt=X.data,j=rt.labels?.indexOf(tt);return rt.datasets.reduce((et,ot,wt)=>{if(X.isDatasetVisible(wt)){const Lt=ot.data[j];return isNaN(Lt)?et:et+Lt}else return et},0)},p=(X,tt,rt,j)=>{const et=j==="horizontal";tt===null&&(tt=e.t("entityNoName"));const ot={type:"label",yValue:vt=>et?tt:d(vt,tt),xValue:vt=>et?d(vt,tt):tt},wt={...ot,position:et?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>et?0:-Math.abs(wP()),content:vt=>h0(d(vt,tt),rt)},Lt={...ot,content:vt=>SP(d(vt,tt),vP(vt.chart,X)),position:et?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:vt=>et?xP(h0(d(vt,tt),rt)):0,color:hP};return{[`${tt}-value`]:wt,[`${tt}-percent`]:Lt}},m=h.useTemplateRef("canvas"),g=h.useTemplateRef("axis"),_=dd(),x=dd(),w=h.ref([]),S=h.inject("legendPosition",Ie.Bottom),C=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),A=h.toRef(t,"metricUnit"),B=h.computed(()=>t.orientation==="horizontal"),P=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:h.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:h.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:h.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:I,tooltipAbsoluteTop:$}=xt.useTooltipAbsolutePosition(u,P),z=h.ref(0),v=()=>t.annotations&&t.chartData.labels?.reduce((X,tt)=>Object.assign(X,p(t.chartData,tt,A.value,t.orientation)),{}),M={id:_,afterUpdate(X){z.value+=1,w.value=Au(X,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?v():{}}},W=[M,{id:"axisHover",afterEvent(X,tt){if(C.show=!1,tt.event.type==="mousemove"){const rt=tt.event,j=X.options.indexAxis,et=X.scales,ot=X.scales[j].getLabelForValue(Number(X.scales[j].getValueForPixel(rt[j]))),Lt=X.scales[j].getLabels().indexOf(ot),vt=t.chartData.isLabelEmpty?.[Lt];if((kt=>kt==="x"?rt.y>et.x.top:rt.x<et.y.right)(j)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const Se=X.canvas.getContext("2d").measureText(ot).width,_t=Math.abs(Math.round(rt.x-Se*.5)),jt=Math.round(rt.x+Se*.5),Ae=X.canvas.getBoundingClientRect(),Ee=40;C.left=j==="x"?`${(_t>0?_t:jt)-C.offset+Ae.left}px`:`${rt.x-Se*.5-C.offset+Ae.left}px`,C.top=`${rt.y-Ee+Ae.top}px`,ot.length>Ja?(C.show=!0,C.text=ot):vt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],G=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),lt=h.ref(0),ut=h.ref(0),ht=new ResizeObserver(u0(X=>{lt.value=X[0].contentRect.width,ut.value=X[0].contentRect.height},100)),dt=h.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&!B.value?`${Math.max(X*(DL+Ey),lt.value)}px`:ML}),bt=h.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&B.value?`${Math.max(X*(CL+Ey),ut.value)}px`:kL});xt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&on.register(Dy),l.value&&(lt.value=l.value.offsetWidth,ut.value=l.value.offsetHeight,ht.observe(l.value))}),h.onUnmounted(()=>{l.value&&ht.unobserve(l.value)});const at=h.computed(()=>{const X=xt.useBarChartOptions({tooltipState:P,legendID:_,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:B.value?"y":"x",numLabels:G});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:v(),clip:!1}}}}),ct=xt.useChartJSCommon("bar",m,h.toRef(t,"chartData"),W,at);h.onBeforeUnmount(()=>{on.unregister(Dy)});const V={[Ie.Bottom]:"column"},L=h.computed(()=>{if(g.value&&ct.value){const X=window.devicePixelRatio,tt=ct.value,rt=tt.scales.y.width*X+RL,j=(tt.scales.y.height+tt.scales.y.top+tt.scales.x.height)*X,et=g.value.getContext("2d");return et.scale(X,X),et.canvas.width=rt,et.canvas.height=j,et.canvas.style.width=`${rt/X}px`,et.canvas.style.height=`${j/X}px`,{scale:X,width:rt*X,height:j*X,targetCtx:et}}return null}),H=X=>{const tt=X.target;if(L.value&&ct.value&&!B.value){const rt=L.value.scale,j=L.value.targetCtx,et=L.value.width,ot=L.value.height,wt=ct.value,Lt=wt.canvas;j.fillStyle="white",tt.scrollLeft>=OL&&tt.scrollLeft<=AL?(j.globalCompositeOperation="source-over",j.clearRect(0,0,et,ot),j.drawImage(Lt,0,0,et,ot,0,0,et,ot),j.globalCompositeOperation="destination-over",j.fillRect(0,0,et,ot)):(j.globalCompositeOperation="source-over",j.fillRect(0,(wt.scales.y.height+wt.scales.y.top+EL)*rt,et,wt.scales.x.height*rt))}P.offsetY=tt.scrollTop,P.offsetX=tt.scrollLeft,C.offset=tt.scrollLeft},it=({width:X,height:tt})=>{P.width=X,P.height=tt};h.watch(()=>t.orientation,()=>{if(g.value&&L.value){const X=L.value.width,tt=L.value.height;(g.value?.getContext("2d")).clearRect(0,0,X,tt)}P.showTooltip=!1,P.interactionMode="idle"}),h.watch(()=>t.annotations,X=>{ct.value&&(X?ct.value.options.plugins.annotation.annotations=v(t.chartData):delete ct.value.options.plugins.annotation.annotations)});const st=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(X,tt)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",V[h.unref(S)]])},[h.createElementVNode("canvas",{id:h.unref(r),ref:"axis",class:"axis"},null,8,vL),h.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:tt[0]||(tt[0]=rt=>st()),onScroll:H},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:dt.value,height:bt.value})},[h.createElementVNode("canvas",{id:h.unref(s),ref:"canvas",class:"chart-canvas"},null,8,SL)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[C.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[h.createElementVNode("div",TL,h.toDisplayString(C.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(vo,{"absolute-left":h.unref(I),"absolute-top":h.unref($),"chart-parent-ref":u.value,state:P,"tooltip-title":n.tooltipTitle,onDimensions:it},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),h.createVNode(ul,{id:h.unref(_),"chart-instance":h.unref(ct),items:w.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const IL={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"};Fm._date.override({_id:"date-fns",formats:function(){return IL},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=Et(n):e==="string"&&(typeof t=="string"?n=Pk(n,t,new Date,this.options):n=Dp(n,this.options)),Rc(n)?n.getTime():null},format:function(n,t){return ha(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Ac(n,t);case"second":return CT(n,t);case"minute":return kT(n,t);case"hour":return ST(n,t);case"day":return da(n,t);case"week":return OT(n,t);case"month":return Oc(n,t);case"quarter":return DT(n,t);case"year":return AT(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Pc(n,t);case"second":return FT(n,t);case"minute":return LT(n,t);case"hour":return IT(n,t);case"day":return sp(n,t);case"week":return zT(n,t);case"month":return cp(n,t);case"quarter":return BT(n,t);case"year":return UT(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Bk(n);case"minute":return Nk(n);case"hour":return Lk(n);case"day":return Ec(n);case"week":return $n(n);case"isoWeek":return $n(n,{weekStartsOn:+e});case"month":return WT(n);case"quarter":return HT(n);case"year":return up(n);default:return n}},endOf:function(n,t){switch(t){case"second":return GT(n);case"minute":return qT(n);case"hour":return VT(n);case"day":return ap(n);case"week":return YT(n);case"month":return lp(n);case"quarter":return jT(n);case"year":return $T(n);default:return n}}});const Ry={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},LL={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Ry,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},NL=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function rs(n){return h.isProxy(n)?h.toRaw(n):n}function BL(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function FL(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Py(n,t){n.labels=t}function Iy(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 zL(n,t){const e={labels:[],datasets:[]};return Py(e,n.labels),Iy(e,n.datasets,t),e}const UL=h.defineComponent({props:LL,setup(n,t){let{expose:e,slots:i}=t;const r=h.ref(null),s=h.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:p,options:m,plugins:g,datasetIdKey:_}=n,x=zL(p,_),w=BL(x,p);s.value=new on(r.value,{type:d,data:w,options:{...m},plugins:g})},l=()=>{const d=h.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 h.onMounted(a),h.onUnmounted(l),h.watch([()=>n.options,()=>n.data],(d,p)=>{let[m,g]=d,[_,x]=p;const w=h.toRaw(s.value);if(!w)return;let S=!1;if(m){const C=rs(m),A=rs(_);C&&C!==A&&(FL(w,C),S=!0)}if(g){const C=rs(g.labels),A=rs(x.labels),B=rs(g.datasets),P=rs(x.datasets);C!==A&&(Py(w.config.data,C),S=!0),B&&B!==P&&(Iy(w.config.data,B,n.datasetIdKey),S=!0)}S&&h.nextTick(()=>{u(w)})},{deep:!0}),()=>h.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[h.h("p",{},[i.default?i.default():""])])}});function dl(n,t){return on.register(t),h.defineComponent({props:Ry,setup(e,i){let{expose:r}=i;const s=h.shallowRef(null),a=h.shallowRef(null);h.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>h.h(UL,NL({ref:l},{type:n,...e}))}})}const Ly=dl("bar",Im),Ny=dl("doughnut",Js),By=dl("line",Lm),HL=dl("scatter",Bm),WL={class:"chart-container"},$L={key:0,class:"chart-center-metric"},VL={class:"chart-center-total"},YL={key:0,class:"chart-center-unit"},qL=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Ie.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=xt.useTranslatedUnits(),{i18n:i}=xt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=h.ref([]),l=h.useTemplateRef("chartParent"),u=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:h.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:h.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:p}=xt.useTooltipAbsolutePosition(l,u),m={id:r,afterUpdate(z){a.value=z.options.plugins.legend.labels.generateLabels(z).map(v=>({...v,value:t.legendValues&&t.legendValues[v.text],hidden:!1}))}},g=h.computed(()=>[m]),_=h.computed(()=>[t.chartData.datasets.reduce((v,M)=>(v.labels.push(M.label),v.backgroundColor.push(M.backgroundColor),v.hoverBorderColor.push(ka(M.backgroundColor).saturate(.5).darken(.15).hexString()),v.data.push(M.data.reduce((O,N)=>O+N,0)),v),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=ni({i18n:i}),w=h.computed(()=>o2(t.metricName??"")),S=h.computed(()=>{const z=_.value[0]?.data.reduce((v,M)=>v+M,0)??0;return x(z,t.metricUnit,{approximate:!0,translateUnit:(v,M)=>e(v,M)}).trim()}),C=h.computed(()=>t.tooltipMetricDisplay||""),A=h.computed(()=>({...t.chartData,datasets:_.value}));xt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:B}=xt.useDonutChartOptions({tooltipState:u,legendID:r}),P=h.ref(),I=z=>({[Ie.Bottom]:"column",[Ie.Hidden]:"hidden"})[z],$=({width:z,height:v})=>{u.width=z,u.height=v};return(z,v)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",I(n.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",WL,[h.createVNode(h.unref(Ny),{ref_key:"chartInstance",ref:P,"chart-id":h.unref(s),data:A.value,options:h.unref(B),plugins:g.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&w.value?(h.openBlock(),h.createElementBlock("div",$L,[h.createElementVNode("span",VL,h.toDisplayString(S.value),1),C.value?(h.openBlock(),h.createElementBlock("span",YL,h.toDisplayString(C.value),1)):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(vo,{"absolute-left":h.unref(d),"absolute-top":h.unref(p),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:$},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(ul,{id:h.unref(r),"chart-instance":P.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),jL=qe(qL,[["__scopeId","data-v-ecbae072"]]);class GL{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,p=Math.min(Math.max(s.getPixelForValue(r),a),l);if(p<=a)return;const m=t.ctx;m.save(),m.fillStyle=i.color,m.fillRect(u,a,d-u,p-a),m.restore()}}const KL=1.5;class XL{id="referenceLinePlugin";afterDatasetsDraw(t,e,i){const r=i?.lines;if(!r?.length)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,p=t.ctx;p.save(),p.lineWidth=KL;for(const{value:m,color:g,borderDash:_}of r){if(!Number.isFinite(m))continue;const x=s.getPixelForValue(m);x<a||x>l||(p.beginPath(),p.setLineDash(_),p.strokeStyle=g,p.moveTo(u,x),p.lineTo(d,x),p.stroke())}p.restore()}}const ZL={class:"chart-container"},QL=qe(h.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},xMetric:{default:void 0},xMetricUnit:{default:void 0},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>Gu()}},setup(n){const t=n,e=h.inject("legendPosition",Ie.Bottom),{i18n:i}=xt.useI18n(),{formatUnit:r}=ni({i18n:i}),{translateUnit:s}=xt.useTranslatedUnits(),a=h.useTemplateRef("chartParent"),l=new GL,u=new XL,d=crypto.randomUUID(),p=crypto.randomUUID(),m=h.ref(),g=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:h.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:p,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=xt.useTooltipAbsolutePosition(a,g);xt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const w=h.computed(()=>t.chartData?.outlier),S=h.computed(()=>t.chartData?.referenceLines??[]),C=h.ref([]),A={id:d,afterUpdate(O){C.value=Au(O,void 0,t.chartLegendSortFn)}},B=h.computed(()=>{const O=[];w.value&&O.push({text:w.value.label,fillStyle:w.value.color,strokeStyle:w.value.color,isKey:!0});for(const N of S.value)O.push({text:N.label,fillStyle:N.color,strokeStyle:N.color,lineDash:N.borderDash,isKey:!0,value:{raw:N.value,formatted:r(N.value,t.metricUnit,{translateUnit:s})}});return O}),P=h.computed(()=>[...C.value,...B.value]),I=h.computed(()=>t.shadeOutlierRegion?w.value?.value:void 0),$=h.computed(()=>[A,...I.value!==void 0?[l]:[],...S.value.length?[u]:[]]),z=h.computed(()=>`scatter-${$.value.map(O=>O.id).join("-")}`),{options:v}=xt.useScatterChartOptions({tooltipState:g,legendID:d,granularity:h.toRef(t,"granularity"),timeRangeMs:h.toRef(t,"timeRangeMs"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),metricUnit:h.toRef(t,"metricUnit"),xMetric:h.toRef(t,"xMetric"),xMetricUnit:h.toRef(t,"xMetricUnit"),outlierValue:I,referenceLines:S,themeColors:h.toRef(t,"themeColors")}),M=O=>({[Ie.Bottom]:"column",[Ie.Hidden]:"hidden"})[O];return(O,N)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",M(h.unref(e))]),"data-testid":"scatter-chart-parent"},[h.createElementVNode("div",ZL,[(h.openBlock(),h.createBlock(h.unref(HL),{key:z.value,ref_key:"chartInstance",ref:m,"chart-id":h.unref(p),class:"chart-canvas",data:n.chartData,"data-testid":"scatter-chart",options:h.unref(v),plugins:$.value},null,8,["chart-id","data","options","plugins"]))]),h.createVNode(vo,{"absolute-left":h.unref(_),"absolute-top":h.unref(x),"data-testid":"tooltip",granularity:n.granularity,state:g,"tooltip-title":n.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),h.createVNode(ul,{id:h.unref(d),"chart-instance":m.value,"data-testid":"legend",items:P.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3bb682a5"]]),fd=(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()},Je={},JL=()=>{Je.x=void 0,Je.chart=void 0,Je.strategy=void 0,Je.group=void 0},tN=10;class Fy{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<tN)return;const r=()=>{Je.chart=e,Je.strategy=this._brushStrategy,Je.group=this._brushGroup;for(const s of Object.values(on.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Je.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Je.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;fd(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;fd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Je.x===void 0)return;const e=Je.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Je.group===this._brushGroup&&fd(t.ctx,Je.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&&Je.chart===t){const e=Je.x!==void 0;if(JL(),e)for(const i of Object.values(on.instances))i!==t&&i.update("none")}}}const eN=(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()},nN=(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()},zy=(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)}},Uy=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class iN{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=zy(t,this);d&&Uy("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=zy(t,this);d?Uy("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)&&(nN(t,this._startX,this._endX),eN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const rN=20,sN="rgba(255, 171, 171, 0.4)",oN="rgba(255, 196, 0, 0.2)",Hy=(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)},aN=(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=Hy(s[d-1],s[d],a.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:Hy(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},lN=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 cN{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(),p=u.getValueForPixel(l-d.top);if(p)for(const m of Object.keys(this._thresholds||{})){const g=this._thresholds?.[m];g&&g.forEach(_=>{_.hovered=Math.abs(_.value-p)<rN})}}};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 p=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,p),i.lineTo(t.chartArea.right,p),i.lineWidth=1,i.strokeStyle=Pu(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let m="";u.label?m=`${u.label}: ${u.value}`:u.type==="warning"?m=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?m=this.i18n.t("chartLabels.threshold-error",{value:u.value}):m=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Pu(u.type),i.font=eS,i.fillText(m,t.chartArea.left,p-4),i.restore())});const a=aN(t,s);lN(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),p=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?sN:oN,i.fillRect(d,t.chartArea.top,p-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(p,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Pu(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const uN=qe(h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},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}=xt.useI18n(),s=new Fy,a=new Ay,l=new iN,u=new cN(r),{translateUnit:d}=xt.useTranslatedUnits(),p=h.ref(),m=crypto.randomUUID(),g=crypto.randomUUID(),_=h.ref([]),x=h.inject("legendPosition",Ie.Bottom),w=h.useTemplateRef("chartParent"),S=h.ref(void 0),C=h.ref(!1),A=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:h.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:h.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:g,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:B,tooltipAbsoluteTop:P}=xt.useTooltipAbsolutePosition(w,A),I={id:m,afterUpdate(V){_.value=Au(V,e.legendValues,e.chartLegendSortFn)}},$=h.computed(()=>[I,a,...e.brush?[l]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),z=h.computed(()=>`line-${$.value.map(V=>V.id).join("-")}`),v=h.computed(()=>`bar-${$.value.map(V=>V.id).join("-")}`),M=h.computed(()=>e.chartData&&uP(e.chartData)),{options:O}=xt.useLineChartOptions({tooltipState:A,timeRangeMs:h.toRef(e,"timeRangeMs"),granularity:h.toRef(e,"granularity"),legendID:m,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:M,threshold:h.toRef(e,"threshold")});xt.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey"));const N=V=>V?V.end.getTime()>V.start.getTime():!1,W=V=>({[Ie.Bottom]:"column",[Ie.Hidden]:"hidden"})[V],G=({width:V,height:L})=>{A.width=V,A.height=L},lt=(V=!0)=>{A.interactionMode="idle",A.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(V),s.isPaused&&s.resume()},ut=()=>{A.interactionMode="interactive"},ht=()=>{!p.value||!p.value.chart.tooltip?.dataPoints?.length||(A.interactionMode==="interactive"?s.clickedSegment=p.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},dt=()=>{if(C.value){C.value=!1;return}A.interactionMode!=="idle"?lt():ut(),ht()};h.watch(()=>e.type,()=>{A.interactionMode="idle",A.showTooltip=!1,s.destroyClickedSegment()});const bt=V=>{V.preventDefault(),V.stopPropagation();const{xStart:L,xEnd:H}=V.detail,it={start:new Date(L),end:new Date(H),type:"absolute"};if(!N(it)){S.value=void 0,lt(!1);return}S.value=it,A.interactionMode="zoom-interactive",it&&i("select-chart-range",it)},at=V=>{A.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:L,xEnd:H}=V.detail;S.value={start:new Date(L),end:new Date(H),type:"absolute"}},ct=V=>{if(!w.value||A.interactionMode==="idle")return;const L=V.target;L&&w.value.contains(L)||C.value||lt(!1)};return h.watch(()=>p.value?.chart,()=>{p.value?.chart&&(p.value.chart.canvas.removeEventListener("dragSelect",bt),p.value.chart.canvas.removeEventListener("dragSelectMove",at),p.value.chart.canvas.addEventListener("dragSelect",bt),p.value.chart.canvas.addEventListener("dragSelectMove",at))}),h.onMounted(()=>{document.addEventListener("click",ct,!0)}),h.onUnmounted(()=>{p.value?.chart&&(p.value.chart.canvas.removeEventListener("dragSelect",bt),p.value.chart.canvas.removeEventListener("dragSelectMove",at)),document.removeEventListener("click",ct,!0)}),(V,L)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",W(h.unref(x))]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:L[0]||(L[0]=H=>dt())},[n.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(By),{key:z.value,ref_key:"chartInstance",ref:p,"chart-id":h.unref(g),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:h.unref(O),plugins:$.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(Ly),{key:v.value,ref_key:"chartInstance",ref:p,"chart-id":h.unref(g),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:h.unref(O),plugins:$.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(vo,{"absolute-left":h.unref(B),"absolute-top":h.unref(P),"data-testid":"tooltip",granularity:n.granularity,state:A,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":S.value,onDimensions:G,onOnAction:L[1]||(L[1]=()=>lt(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),h.createVNode(ul,{id:h.unref(m),"chart-instance":p.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-399f4923"]]),dN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},fN={class:"tooltip-content"},hN={key:2,class:"analytics-chart-parent"},pN=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Ie.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}=xt.useI18n(),s=h.computed(()=>Ku(i.chartData)?void 0:i.chartData),a=h.computed(()=>{const j=s.value?.meta,et=j?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&et.length>1&&Object.keys(j?.display??{}).length>0?et:[]}),l=h.computed(()=>a.value.length>1),u=h.computed(()=>i.activeMetric&&a.value.includes(i.activeMetric)?i.activeMetric:a.value[0]),d=h.computed(()=>{const j=s.value;return!j||!l.value||!u.value?j:{...j,meta:{...j.meta,metric_names:[u.value]}}}),p=h.computed(()=>{const j=i.chartOptions.threshold;return!l.value||!j?j:{...j,...Object.fromEntries(Object.keys(j).filter(et=>et!==u.value).map(et=>[et,[]]))}}),m=h.computed(()=>{if(G.value)return Ku(i.chartData)?i.chartData:P0(i.chartData)}),g=h.inject("app:konnectColorMode",h.computed(()=>"light")),_=h.useTemplateRef("chartShell"),x=h.computed(()=>(g.value,Gu(_.value))),w=h.computed(()=>{if(m.value){const{start:et,end:ot,metric:wt,metricUnit:Lt,truncated:vt,limit:Ot,datasource:kt}=m.value;return{start:et,end:ot,metricNames:[wt],metricUnits:{[wt]:Lt??""},truncated:vt,limit:Ot,datasource:kt}}const j=d.value?.meta;return{start:j?.start,end:j?.end,metricNames:j?.metric_names,metricUnits:j?.metric_units,truncated:j?.truncated,limit:j?.limit,datasource:j?.datasource}}),S=h.computed(()=>G.value?xt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:x},m).value:s.value?N.value?xt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Lu},d).value:xt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Lu},s).value:{datasets:[]}),C=h.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),A=h.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:j,end:et}=w.value;if(j&&et)return new Date(et).getTime()-new Date(j).getTime()}),B=h.computed(()=>w.value.metricUnits?l.value&&u.value?w.value.metricUnits[u.value]??"":Object.values(w.value.metricUnits)[0]??"":""),P=h.computed(()=>w.value.metricUnits?l.value&&u.value?u.value:Object.keys(w.value.metricUnits)[0]??"":""),I=h.computed(()=>i.showLegendValues&&i.legendPosition!==Ie.Hidden),{legendValues:$}=xt.useChartLegendValues(S,i.chartOptions.type,B),z=h.computed(()=>w.value.limit?.toString()||null),v=h.computed(()=>i.chartOptions.hideTruncationWarning?!1:w.value.truncated||!1),M=h.computed(()=>r.t("limitedResultsShown",{maxReturned:z.value})),O=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),N=h.computed(()=>["timeseries_bar","timeseries_line"].some(j=>j===i.chartOptions.type)),W=h.computed(()=>i.chartOptions.type==="donut"),G=h.computed(()=>i.chartOptions.type==="scatter"),lt=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),ut=h.computed(()=>{const{metricNames:j,metricUnits:et}=w.value;if(!j||!et)return;const ot=j[0],wt=et[ot]||"";if(j.length>1){if(ot.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${wt}`,{plural:"s"})});if(ot.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${wt}`,{plural:"s"})})}if(ot)return mo(wt)&&r.te(`metricAxisTitles.${ot}`)?r.t(`metricAxisTitles.${ot}`)||void 0:r.te(`chartLabels.${ot}`)?r.t(`chartLabels.${ot}`):ot}),ht=h.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;const{metricNames:j,metricUnits:et}=w.value;if(!j||!et)return;const ot=j[0],wt=et[ot]||"";if(j.length>1){if(ot.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${wt}`,{plural:"s"})});if(ot.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${wt}`,{plural:"s"})})}return dt(ot,wt)}),dt=(j,et)=>r.te(`metricAxisTitles.${j}`)&&(mo(et)||r.te(`chartUnits.${et}`))?mo(et)?r.t(`metricAxisTitles.${j}`)||void 0:r.t(`metricAxisTitles.${j}`,{unit:r.t(`chartUnits.${et}`,{plural:"s"})})||void 0:j||void 0,bt=h.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const j=s.value?.meta,et=N.value?"Time":Object.keys(j?.display||j?.metric_names||{})[0];if(et)return r.te(`chartLabels.${et}`)?r.t(`chartLabels.${et}`):et}),at=h.computed(()=>{if(hx(w.value.datasource))return r.t("timestampAxisTitles.platform");const j=ra(s.value?.meta?.granularity_ms);if(j)return r.te(`granularityAxisTitles.${j}`)?r.t(`granularityAxisTitles.${j}`):j}),ct=h.computed(()=>{const j=m.value?.xMetric;return j?dt(j,m.value?.xMetricUnit??""):at.value}),V=h.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),L=h.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),H=h.computed(()=>G.value?!!m.value?.points.length:N.value?dP(S.value):!!(s.value&&s.value.meta&&s.value.data.length)),it=h.computed(()=>{const j=s.value;return j?j.meta.granularity_ms?ra(j.meta.granularity_ms)||"hourly":ra(new Date(j.data[1].timestamp).getTime()-new Date(j.data[0].timestamp).getTime())||"hourly":"hourly"}),st=h.computed(()=>ra(s.value?.meta?.granularity_ms)||"secondly"),X=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(j,et)=>j.text===r.t("chartLabels.____OTHER____")?1:et.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.text,10))&&!isNaN(parseInt(et.text,10))?j.text<et.text?-1:1:j.value&&et.value?et.value.raw-j.value.raw:0),tt=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(j,et)=>j.label===r.t("chartLabels.____OTHER____")?1:et.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.label,10))&&!isNaN(parseInt(et.label,10))?j.label<et.label?-1:1:j.value&&et.value?et.rawValue-j.rawValue:0),rt=h.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:j=>e("zoom-time-range",j)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return h.provide("showLegendValues",I),h.provide("legendPosition",h.toRef(i,"legendPosition")),(j,et)=>{const ot=h.resolveComponent("KTooltip"),wt=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",{ref:"chartShell",class:h.normalizeClass(["analytics-chart-shell",{"show-values":I.value}])},[H.value&&v.value&&z.value?(h.openBlock(),h.createElementBlock("div",dN,[h.createVNode(ot,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",fN,h.toDisplayString(M.value),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(de.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(J1)})`,size:`var(--kui-icon-size-40, ${h.unref(nS)})`},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),H.value?(h.openBlock(),h.createElementBlock("div",hN,[N.value?(h.openBlock(),h.createBlock(uN,{key:0,brush:C.value,"chart-data":S.value,"chart-legend-sort-fn":X.value,"chart-tooltip-sort-fn":tt.value,"dimension-axes-title":at.value,fill:n.chartOptions.stacked,granularity:it.value,"legend-values":h.unref($),"metric-axes-title":ht.value,"metric-unit":B.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:p.value,"time-range-ms":A.value,"tooltip-metric-display":ut.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":rt.value,onSelectChartRange:et[0]||(et[0]=Lt=>e("select-chart-range",Lt)),onZoomTimeRange:et[1]||(et[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"])):O.value?(h.openBlock(),h.createBlock(PL,{key:1,annotations:n.showAnnotations,"chart-data":S.value,"chart-legend-sort-fn":X.value,"chart-tooltip-sort-fn":tt.value,"data-testid":"bar-chart-container","dimension-axes-title":bt.value,"legend-values":h.unref($),"metric-axes-title":ht.value,"metric-unit":B.value,orientation:lt.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":ut.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"])):W.value?(h.openBlock(),h.createBlock(jL,{key:2,"chart-data":S.value,"dataset-colors":n.chartOptions.chartDatasetColors||h.unref(Lu),"legend-position":n.legendPosition,"legend-values":h.unref($),"metric-name":P.value,"metric-unit":B.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":bt.value,"tooltip-metric-display":ut.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"])):G.value?(h.openBlock(),h.createBlock(QL,{key:3,"chart-data":S.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":tt.value,"data-testid":"scatter-chart-container","dimension-axes-title":ct.value,granularity:st.value,"metric-axes-title":ht.value,"metric-unit":B.value,"shade-outlier-region":n.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":n.syntheticsDataKey,"theme-colors":x.value,"time-range-ms":A.value,"tooltip-metric-display":ut.value,"tooltip-title":n.tooltipTitle,"x-metric":m.value?.xMetric,"x-metric-unit":m.value?.xMetricUnit},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","theme-colors","time-range-ms","tooltip-metric-display","tooltip-title","x-metric","x-metric-unit"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(wt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(V.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(L.value),1)]),_:1}))],2)}}}),mN=qe(pN,[["__scopeId","data-v-bbdf6b28"]]),gN={class:"chart-parent","data-testid":"gauge-chart-parent"},yN={class:"chart-totals-flex"},_N={key:1,class:"metric-small","data-testid":"gauge-chart-total"},bN=qe(h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Kn},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}=xt.useI18n(),i=h.ref(dd()),r=h.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((w,S)=>w+S,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=h.computed(()=>({...t.chartData,datasets:r.value}));xt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=h.computed(()=>uo(r?.value[0]?.data[t.numerator],{capital:!0})),u=h.computed(()=>uo(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=h.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),p=h.computed(()=>["full","single"].includes(t.metricDisplay)),m=h.computed(()=>t.metricDisplay==="full");return(g,_)=>(h.openBlock(),h.createElementBlock("div",gN,[h.createElementVNode("div",yN,[p.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(d.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),m.value?(h.openBlock(),h.createElementBlock("div",_N,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(u.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Ny),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),xN={key:1,class:"single-value-wrapper"},wN={class:"single-value-metric"},vN={class:"name-unit-alignment"},SN={class:"single-value","data-testid":"single-value-chart"},TN={key:0,class:"single-value-unit"},MN={class:"single-value-metric-name"},kN={key:0,class:"single-value-trend"},DN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},hd="t1",pd="t2",CN=qe(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:i0},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}=xt.useI18n(),{formatBytes:e,formatCost:i}=ni({i18n:t}),r=n,s=h.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=h.computed(()=>tr.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:hd,secondLevelKey:pd})),l=h.computed(()=>a.value?.previous?.[hd]?.[pd]),u=h.computed(()=>a.value?.current?.[hd]?.[pd]),d=h.computed(()=>r.data.data),p=h.computed(()=>r.data.meta?.metric_names?.[0]),m=h.computed(()=>t.te(`chartLabels.${p.value}`)?t.t(`chartLabels.${p.value}`):""),g=h.computed(()=>{const O=p.value?r.data.meta?.metric_units?.[p.value]:void 0;if(O){const N=`chartUnits.${O}`;return t.te(N)?t.t(N,{plural:""}):""}}),_=h.computed(()=>!!p.value&&(p.value.includes("_per_minute")||p.value.includes("_latency_")||p.value==="error_rate")),x=h.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),w=h.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!p.value)return null;const O=d.value[0].event[p.value];return typeof O!="number"||isNaN(O)?null:O}),S=h.computed(()=>r.data?.data?.length===void 0||r.data?.data?.length===0||!r.showTrend&&w.value===null||r.showTrend&&x.value===null&&w.value===null),C=h.computed(()=>{const O=w.value;if(O===null)return"-";const N=p.value?r.data.meta?.metric_units?.[p.value]:void 0;if(N==="usd")return i(O);if(N==="bytes")return e(O);if(O>=1e9){const G=(O/1e9).toFixed(1);return G.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${G}B`}if(O>=1e7){const G=(O/1e6).toFixed(1);return G.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${G}M`}const W=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:i0;return O.toLocaleString("en-US",{maximumFractionDigits:W})}),A=h.computed(()=>r.showTrend&&r.data?.data?.length<2),B=h.computed(()=>tr.calculateChange(w.value??0,x.value??0)||0),P=h.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 tr.changePolarity(B.value,!0,r.increaseIsBad)}),I=h.computed(()=>tr.defineIcon(P.value,r.increaseIsBad)),$=h.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 tr.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return tr.metricChange(B.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),z=tr.useTrendRange(h.computed(()=>r.showTrend),void 0,h.computed(()=>r.data.meta)),v=O=>O>0?"positive":O<0?"negative":"neutral",M=O=>O>0?Q1:O<0?Z1:tp;return h.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,N)=>{const W=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[S.value?(h.openBlock(),h.createBlock(W,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t).t("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",xN,[h.createElementVNode("div",wN,[h.createElementVNode("div",vN,[h.createElementVNode("span",SN,h.toDisplayString(C.value),1),_.value&&g.value?(h.openBlock(),h.createElementBlock("span",TN,"  "+h.toDisplayString(g.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",MN,h.toDisplayString(m.value),1)]),n.showTrend?(h.openBlock(),h.createElementBlock("div",kN,[h.createElementVNode("div",{class:h.normalizeClass(["trend-change",v(P.value)]),"data-testid":"single-value-trend"},[A.value||P.value!==0?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(I.value),{key:0,color:M(P.value),size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["color","size"])):(h.openBlock(),h.createBlock(h.unref(de.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${h.unref(tp)})`,size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["color","size"])),h.createElementVNode("div",null,h.toDisplayString($.value),1)],2),h.unref(z)?(h.openBlock(),h.createElementBlock("div",DN,h.toDisplayString(h.unref(z)),1)):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),ON={class:"simple-chart-shell"},AN={key:1,class:"analytics-chart-parent"},EN=qe(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=xt.useI18n(),i=h.computed(()=>{const d=xt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Kn},h.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=h.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=h.computed(()=>t.chartOptions.type==="gauge"),a=h.computed(()=>t.chartOptions.type==="single_value"),l=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=h.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const p=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[p]!==null}return d});return(d,p)=>{const m=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",ON,[u.value?(h.openBlock(),h.createElementBlock("div",AN,[s.value?(h.openBlock(),h.createBlock(bN,{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"])):h.createCommentVNode("",!0),a.value?(h.openBlock(),h.createBlock(CN,{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"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(m,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),fl=(n,t)=>{if(!n||!t)return;const e=t.toLowerCase();return n[t]??Object.entries(n).find(([i])=>i.toLowerCase()===e)?.[1]},Wy=n=>{if(n==null||n==="")return null;const t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:null},RN=n=>n.reduce((t,e)=>e===null?t:{sum:t.sum+e,max:Math.max(t.max,e)},{sum:0,max:0}),PN=(n,t)=>t.sum>0?n/t.sum:null,IN=(n,t,e)=>{const i=e==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(n/i,0),1)},LN=(n,t)=>{const e=(t??[]).filter(s=>n>=s.value);if(!e.length)return;const i=Math.max(...e.map(s=>s.value));return e.filter(s=>s.value===i).some(s=>s.type==="error")?"error":"warning"},NN={ai_provider:{anthropic:de.AnthropicIcon,azure:de.AzureIcon,bedrock:de.AmazonBedrockIcon,cerebras:de.CerebrasIcon,cohere:de.CohereIcon,databricks:de.DatabricksIcon,deepseek:de.DeepseekIcon,gemini:de.GeminiIcon,huggingface:de.HuggingFaceIcon,llama2:de.MetaLlamaIcon,mistral:de.MistralIcon,moonshot:de.KimiIcon,nvidia:de.NvidiaIcon,ollama:de.OllamaIcon,openai:de.OpenAiIcon,vertex:de.GoogleVertexIcon,vllm:de.VllmIcon,xai:de.GrokIcon}},BN=(n,t)=>{if(!(!n||!t))return NN[n]?.[t.toLowerCase()]},FN=["data-threshold"],zN=qe(h.defineComponent({__name:"TopNMetricBar",props:{ratio:{},threshold:{}},setup(n){h.useCssVars(e=>({v0394367e:h.unref(t)}));const t=Kn[1];return(e,i)=>(h.openBlock(),h.createElementBlock("span",{class:h.normalizeClass(["top-n-metric-cell-bar",{[`top-n-metric-cell--bar-${n.threshold}`]:!!n.threshold}]),"data-testid":"top-n-metric-cell-bar","data-threshold":n.threshold},[h.createElementVNode("span",{class:"top-n-metric-cell-bar-fill",style:h.normalizeStyle({width:`${n.ratio*100}%`})},null,4)],10,FN))}}),[["__scopeId","data-v-24eb60ef"]]),UN=["data-threshold"],HN={class:"top-n-metric-cell-value"},WN={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},$N=qe(h.defineComponent({__name:"TopNMetricCell",props:{display:{},relative:{},threshold:{},hasBar:{type:Boolean}},setup(n){return(t,e)=>(h.openBlock(),h.createElementBlock("span",{class:h.normalizeClass(["top-n-metric-cell",{"top-n-metric-cell--bar":n.hasBar,[`top-n-metric-cell--text-${n.threshold}`]:!n.hasBar&&!!n.threshold}]),"data-threshold":n.threshold},[h.createElementVNode("span",HN,h.toDisplayString(n.display),1),n.relative?(h.openBlock(),h.createElementBlock("span",WN,"("+h.toDisplayString(n.relative)+")",1)):h.createCommentVNode("",!0)],10,UN))}}),[["__scopeId","data-v-17e7f860"]]),VN={class:"top-n-card-title","data-testid":"top-n-card-title"},YN={class:"top-n-card-description","data-testid":"top-n-card-description"},qN={key:3,class:"top-n-table","data-testid":"top-n-table"},jN={"data-testid":"top-n-table-header"},GN={class:"top-n-table-header-row"},KN=["colspan"],XN={class:"table-header-label"},ZN=["data-testid"],QN={class:"top-n-table-cell-label"},JN={key:0,class:"top-n-table-cell top-n-table-cell-bar"},tB=3,eB=qe(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"},columnOptions:{default:void 0}},setup(n){const t=n,{i18n:e}=xt.useI18n(),{formatUnit:i}=ni({i18n:e}),r=h.computed(()=>t.data.data),s=h.computed(()=>!!r.value?.length),a=h.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,tB):[]),l=h.computed(()=>a.value[0]||""),u=h.computed(()=>a.value.length>1),d=h.computed(()=>a.value[a.value.length-1]||""),p=h.computed(()=>l.value?t.data.meta.display[l.value]:{}),m=h.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),g=h.computed(()=>m.value[0]),_=h.computed(()=>g.value?ct(g.value):""),x=h.computed(()=>{const L=a.value.map(H=>({key:H,columnKey:H,label:dt(H,u.value?ct(H):e.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&L.push({key:"value",columnKey:g.value,label:dt(g.value,_.value),type:"metric"}),m.value.forEach((H,it)=>{it!==0&&L.push({key:H,columnKey:H,label:dt(H,ct(H)),type:"metric"})}),L}),w=h.computed(()=>x.value.filter(L=>L.type==="metric")),S=h.computed(()=>x.value.filter(L=>L.type==="dimension").slice(1)),C=L=>L.type==="dimension"&&L.key===d.value,A=L=>L.type==="metric"&&!!fl(t.columnOptions,L.columnKey)?.bar,B=L=>u.value&&L.type==="dimension"&&!C(L),P=L=>{const H=L.event;return String(H[l.value])},I=(L,H)=>{const it=String(L.event[H]),st=t.data.meta?.display?.[H]?.[it];return{dimension:H,id:it,name:st?.name||"-",deleted:!!st?.deleted}},$=L=>{const H=P(L),it=p.value&&p.value[H];return it?it.name:"-"},z=L=>{const H=P(L),it=p.value&&p.value[H];return it?!!it.deleted:!1},v=L=>{const H=it=>i(it,"%",{translateUnit:st=>V(st,it)});return L>0&&L<.01?`< ${H(.01)}`:H(L)},M=(L,H)=>{const it=L.event[H];if(it==null)return"–";const st=typeof it=="number"?it:Number(it);if(Number.isNaN(st))return"–";const X=t.data.meta?.metric_units?.[H]||"count";if(X==="%")return v(st);const tt=["count","count/minute","token count"].includes(X);return i(st,X,{approximate:tt,isBytes1024:!0,translateUnit:rt=>V(rt,st)})},O=h.computed(()=>Object.fromEntries(m.value.map(L=>[L,RN(r.value.map(H=>Wy(H.event[L])))]))),N=(L,H)=>{const it=fl(t.columnOptions,H),st=Wy(L.event[H]);if(!it||st===null)return{display:M(L,H)};const X=O.value[H],tt=it.value==="relative"?PN(st,X):null;return{display:M(L,H),relative:tt===null?void 0:v(tt*100),barRatio:it.bar?IN(st,X,it.bar):void 0,threshold:LN(st,it.thresholds)}},W=h.computed(()=>r.value?.length?r.value.map(L=>{const H=a.value.map(tt=>I(L,tt)),it=H[0],st=it?.id||P(L),X={id:st,rowKey:H.map(tt=>`${tt.dimension}:${tt.id}`).join("|")||st,name:it?.name||$(L),deleted:z(L),dimensions:H,metrics:{},original:L};return m.value.forEach((tt,rt)=>{X.metrics[rt===0?"value":tt]=N(L,tt)}),X}):[]),G=h.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(L=>!Object.keys(t.data.meta.display[L]||{}).length))return e.t("topNTable.errors.display");if(!g.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),lt=(L,H)=>L.metrics[H]??{display:"–"},ut=(L,H)=>L.dimensions.find(it=>it.dimension===H)?.id||"",ht=(L,H)=>BN(fl(t.columnOptions,L)?.icon_set,H),dt=(L,H)=>L&&fl(t.columnOptions,L)?.label||H,bt=(L,H)=>L.dimensions.find(it=>it.dimension===H)?.name||"–",at=(L,H)=>{const it=L.dimensions.find(st=>st.dimension===H);return{id:it?.id||"",name:it?.name||"–",deleted:it?.deleted||!1,dimension:H,dimensions:L.dimensions,isEmpty:it?.id==="empty"}},ct=L=>e.te(`chartLabels.${L}`)?e.t(`chartLabels.${L}`):L,V=(L,H)=>{if(mo(L)||L==="count"||L==="requests")return"";const it=H===1?"":"s";return e.te(`chartUnits.${L}`)?e.t(`chartUnits.${L}`,{plural:it}):L};return(L,H)=>{const it=h.resolveComponent("KEmptyState"),st=h.resolveComponent("KSkeleton"),X=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(X,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},h.createSlots({default:h.withCtx(()=>[G.value?(h.openBlock(),h.createBlock(it,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(G.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(st,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",qN,[h.createElementVNode("table",{class:h.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[h.createElementVNode("thead",jN,[h.createElementVNode("tr",GN,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(x.value,tt=>(h.openBlock(),h.createElementBlock("th",{key:tt.key,class:h.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":tt.type==="metric","top-n-table-header-cell-dimension-compact":B(tt)}]),colspan:A(tt)?2:void 0,"data-testid":"top-n-table-header-column"},[h.createElementVNode("span",XN,h.toDisplayString(tt.label),1),H[0]||(H[0]=h.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,KN))),128))])]),h.createElementVNode("tbody",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(W.value,tt=>(h.openBlock(),h.createElementBlock("tr",{key:tt.rowKey,class:"top-n-table-row"},[a.value.length?(h.openBlock(),h.createElementBlock("td",{key:0,class:h.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[h.createElementVNode("span",{class:"top-n-table-cell-label","data-testid":`row-${tt.id}`},[ht(l.value,tt.id)?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(ht(l.value,tt.id)),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["size"])):h.createCommentVNode("",!0),h.renderSlot(L.$slots,"name",{record:{id:tt.id,name:tt.name,deleted:tt.deleted,dimension:l.value,dimensions:tt.dimensions,isEmpty:tt.id==="empty"}},()=>[h.createTextVNode(h.toDisplayString(tt.name),1)],!0)],8,ZN)],2)):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(S.value,rt=>(h.openBlock(),h.createElementBlock("td",{key:rt.key,class:h.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(rt)}])},[h.createElementVNode("span",QN,[ht(rt.key,ut(tt,rt.key))?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(ht(rt.key,ut(tt,rt.key))),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["size"])):h.createCommentVNode("",!0),h.renderSlot(L.$slots,"name",{record:at(tt,rt.key)},()=>[h.createTextVNode(h.toDisplayString(bt(tt,rt.key)),1)],!0)])],2))),128)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(w.value,rt=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:rt.key},[h.createElementVNode("td",{class:h.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":A(rt)}])},[h.createVNode($N,{"data-testid":rt.key==="value"?`row-${tt.id}`:`row-${tt.id}-${rt.key}`,display:lt(tt,rt.key).display,"has-bar":A(rt),relative:lt(tt,rt.key).relative,threshold:lt(tt,rt.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),A(rt)?(h.openBlock(),h.createElementBlock("td",JN,[h.createVNode(zN,{ratio:lt(tt,rt.key).barRatio??0,threshold:lt(tt,rt.key).threshold},null,8,["ratio","threshold"])])):h.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(h.openBlock(),h.createBlock(it,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",VN,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",YN,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]),nB={class:"container"},iB={key:0,class:"no-data","data-testid":"sparkline-empty"},rB=["title"],sB=qe(h.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}=xt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=xt.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}),p=h.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"}),m=({width:z,height:v})=>{p.width=z,p.height=v},g=h.computed(()=>n.disableTooltip?[]:[new Fy({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=h.computed(()=>d.value.reduce((z,{data:v,label:M})=>({...z,[M]:v.reduce((O,{y:N})=>O+N,0)}),{})),x=h.computed(()=>d.value.map(({label:z})=>[_.value[z],`${z}: ${_.value[z]}`]).sort(([z],[v])=>v-z).map(([,z])=>z).join(", ")),w=h.computed(()=>Object.keys(_.value).map(z=>_.value[z]).reduce((z,v)=>z+v,0)),S=h.computed(()=>w.value>0),C=h.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=h.computed(()=>n.datasets.length>1),B=`SparklineTooltipPosition-${t}`,P=h.computed(()=>{const z=n.type==="sparkline_bar",v=z?r.value-1:r.value,M=z?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:z?0:2,right:z?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:B,external:O=>{Ou(p,O,"minutely",{contextFormatter:N=>{const W=N+i.value;let G="";return i.value>1440*60*1e3?G=ha(new Date(W),"MMM dd, yyy hh:mm a"):G=ha(new Date(W),"hh:mm a"),`${rv(N)} - ${G}`}})}}},scales:{x:{min:v,max:M,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:A.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:A.value}}}}),I=h.ref("0"),$=h.ref("0");return h.onMounted(()=>{Ye.positioners[B]=function(z,v){if(!z.length||p.interactionMode==="interactive"||v.x===null)return!1;const M=10,O=this.chart.canvas.getBoundingClientRect(),N=p.width||this.width,W=p.height||this.height,G=O.top-W>0,lt=G?O.top-W-M:O.top+O.height+M,ut=O.left>N/2-v.x,ht=Math.max(M,window.innerWidth-M-N),dt=Math.min(ht,ut?Math.floor(O.left-N/2)+v.x:0+M);return I.value=`${lt}px`,$.value=`${dt}px`,{x:dt,y:lt,xAlign:"center",yAlign:G?"top":"bottom"}}}),h.onUnmounted(()=>{Ye.positioners[B]&&delete Ye.positioners[B]}),(z,v)=>(h.openBlock(),h.createElementBlock("div",nB,[S.value?n.type==="sparkline_bar"?(h.openBlock(),h.createBlock(h.unref(Ly),{key:1,"chart-id":h.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.value,plugins:g.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(h.openBlock(),h.createBlock(h.unref(By),{key:2,"chart-id":h.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",iB,[h.renderSlot(z.$slots,"empty",{},()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(vo,{key:3,"absolute-left":$.value,"absolute-top":I.value,class:"tooltip","data-testid":"sparkline-tooltip",state:p,"tooltip-title":n.tooltipTitle,onDimensions:m},null,8,["absolute-left","absolute-top","state","tooltip-title"])),S.value&&n.showLabel?(h.openBlock(),h.createElementBlock("div",{key:4,class:"label",title:z.$slots.label?"":x.value},[h.renderSlot(z.$slots,"label",{total:w.value,totalByDataset:_.value},()=>[h.createTextVNode(h.toDisplayString(x.value),1)],!0)],8,rB)):h.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},So={exports:{}};var oB=So.exports,$y;function aB(){return $y||($y=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__",p=500,m="__lodash_placeholder__",g=1,_=2,x=4,w=1,S=2,C=1,A=2,B=4,P=8,I=16,$=32,z=64,v=128,M=256,O=512,N=30,W="...",G=800,lt=16,ut=1,ht=2,dt=3,bt=1/0,at=9007199254740991,ct=17976931348623157e292,V=NaN,L=4294967295,H=L-1,it=L>>>1,st=[["ary",v],["bind",C],["bindKey",A],["curry",P],["curryRight",I],["flip",O],["partial",$],["partialRight",z],["rearg",M]],X="[object Arguments]",tt="[object Array]",rt="[object AsyncFunction]",j="[object Boolean]",et="[object Date]",ot="[object DOMException]",wt="[object Error]",Lt="[object Function]",vt="[object GeneratorFunction]",Ot="[object Map]",kt="[object Number]",Se="[object Null]",_t="[object Object]",jt="[object Promise]",Ae="[object Proxy]",Ee="[object RegExp]",oe="[object Set]",cn="[object String]",$t="[object Symbol]",Ne="[object Undefined]",ie="[object WeakMap]",Te="[object WeakSet]",Re="[object ArrayBuffer]",gn="[object DataView]",Hi="[object Float32Array]",Cn="[object Float64Array]",je="[object Int8Array]",Ln="[object Int16Array]",di="[object Int32Array]",To="[object Uint8Array]",Mo="[object Uint8ClampedArray]",vr="[object Uint16Array]",fi="[object Uint32Array]",ko=/\b__p \+= '';/g,Do=/\b(__p \+=) '' \+/g,Co=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wi=/&(?:amp|lt|gt|quot|#39);/g,ml=/[&<>"']/g,md=RegExp(Wi.source),gd=RegExp(ml.source),yd=/<%-([\s\S]+?)%>/g,_d=/<%([\s\S]+?)%>/g,Oo=/<%=([\s\S]+?)%>/g,gl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,bd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ao=/[\\^$.*+?()[\]{}|]/g,xd=RegExp(Ao.source),Eo=/^\s+/,wd=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vd=/\{\n\/\* \[wrapped with (.+)\] \*/,Sd=/,? & /,Td=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yl=/[()=,{}\[\]\/\s]/,Md=/\\(\\)?/g,$i=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_l=/\w*$/,kd=/^[-+]0x[0-9a-f]+$/i,Dd=/^0b[01]+$/i,Cd=/^\[object .+?Constructor\]$/,Od=/^0o[0-7]+$/i,Vi=/^(?:0|[1-9]\d*)$/,Ad=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ss=/($^)/,Ed=/['\n\r\u2028\u2029\\]/g,os="\\ud800-\\udfff",Rd="\\u0300-\\u036f",Pd="\\ufe20-\\ufe2f",bl="\\u20d0-\\u20ff",Sr=Rd+Pd+bl,xl="\\u2700-\\u27bf",as="a-z\\xdf-\\xf6\\xf8-\\xff",Id="\\xac\\xb1\\xd7\\xf7",Ld="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Nd="\\u2000-\\u206f",Bd=" \\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",wl="A-Z\\xc0-\\xd6\\xd8-\\xde",vl="\\ufe0e\\ufe0f",ls=Id+Ld+Nd+Bd,Ro="['’]",Fd="["+os+"]",Sl="["+ls+"]",cs="["+Sr+"]",Tl="\\d+",zd="["+xl+"]",Ml="["+as+"]",Po="[^"+os+ls+Tl+xl+as+wl+"]",Io="\\ud83c[\\udffb-\\udfff]",Ud="(?:"+cs+"|"+Io+")",Tr="[^"+os+"]",Xn="(?:\\ud83c[\\udde6-\\uddff]){2}",us="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+wl+"]",kl="\\u200d",Dl="(?:"+Ml+"|"+Po+")",Hd="(?:"+un+"|"+Po+")",Cl="(?:"+Ro+"(?:d|ll|m|re|s|t|ve))?",Ol="(?:"+Ro+"(?:D|LL|M|RE|S|T|VE))?",Al=Ud+"?",Lo="["+vl+"]?",pi="(?:"+kl+"(?:"+[Tr,Xn,us].join("|")+")"+Lo+Al+")*",Wd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",El="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rl=Lo+Al+pi,No="(?:"+[zd,Xn,us].join("|")+")"+Rl,Pl="(?:"+[Tr+cs+"?",cs,Xn,us,Fd].join("|")+")",$d=RegExp(Ro,"g"),Vd=RegExp(cs,"g"),ds=RegExp(Io+"(?="+Io+")|"+Pl+Rl,"g"),Yd=RegExp([un+"?"+Ml+"+"+Cl+"(?="+[Sl,un,"$"].join("|")+")",Hd+"+"+Ol+"(?="+[Sl,un+Dl,"$"].join("|")+")",un+"?"+Dl+"+"+Cl,un+"+"+Ol,El,Wd,Tl,No].join("|"),"g"),fs=RegExp("["+kl+os+Sr+vl+"]"),qd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Bo=["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"],jd=-1,ee={};ee[Hi]=ee[Cn]=ee[je]=ee[Ln]=ee[di]=ee[To]=ee[Mo]=ee[vr]=ee[fi]=!0,ee[X]=ee[tt]=ee[Re]=ee[j]=ee[gn]=ee[et]=ee[wt]=ee[Lt]=ee[Ot]=ee[kt]=ee[_t]=ee[Ee]=ee[oe]=ee[cn]=ee[ie]=!1;var D={};D[X]=D[tt]=D[Re]=D[gn]=D[j]=D[et]=D[Hi]=D[Cn]=D[je]=D[Ln]=D[di]=D[Ot]=D[kt]=D[_t]=D[Ee]=D[oe]=D[cn]=D[$t]=D[To]=D[Mo]=D[vr]=D[fi]=!0,D[wt]=D[Lt]=D[ie]=!1;var Y={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},J={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},gt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Me={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,Bn=parseInt,Be=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,Il=typeof self=="object"&&self&&self.Object===Object&&self,ce=Be||Il||Function("return this")(),hs=t&&!t.nodeType&&t,Zn=hs&&!0&&n&&!n.nodeType&&n,Fo=Zn&&Zn.exports===hs,Mr=Fo&&Be.process,Fe=(function(){try{var F=Zn&&Zn.require&&Zn.require("util").types;return F||Mr&&Mr.binding&&Mr.binding("util")}catch{}})(),Gy=Fe&&Fe.isArrayBuffer,Ky=Fe&&Fe.isDate,Xy=Fe&&Fe.isMap,Zy=Fe&&Fe.isRegExp,Qy=Fe&&Fe.isSet,Jy=Fe&&Fe.isTypedArray;function yn(F,K,q){switch(q.length){case 0:return F.call(K);case 1:return F.call(K,q[0]);case 2:return F.call(K,q[0],q[1]);case 3:return F.call(K,q[0],q[1],q[2])}return F.apply(K,q)}function wB(F,K,q,pt){for(var At=-1,Vt=F==null?0:F.length;++At<Vt;){var ke=F[At];K(pt,ke,q(ke),F)}return pt}function _n(F,K){for(var q=-1,pt=F==null?0:F.length;++q<pt&&K(F[q],q,F)!==!1;);return F}function vB(F,K){for(var q=F==null?0:F.length;q--&&K(F[q],q,F)!==!1;);return F}function t_(F,K){for(var q=-1,pt=F==null?0:F.length;++q<pt;)if(!K(F[q],q,F))return!1;return!0}function Yi(F,K){for(var q=-1,pt=F==null?0:F.length,At=0,Vt=[];++q<pt;){var ke=F[q];K(ke,q,F)&&(Vt[At++]=ke)}return Vt}function Ll(F,K){var q=F==null?0:F.length;return!!q&&ps(F,K,0)>-1}function Gd(F,K,q){for(var pt=-1,At=F==null?0:F.length;++pt<At;)if(q(K,F[pt]))return!0;return!1}function ue(F,K){for(var q=-1,pt=F==null?0:F.length,At=Array(pt);++q<pt;)At[q]=K(F[q],q,F);return At}function qi(F,K){for(var q=-1,pt=K.length,At=F.length;++q<pt;)F[At+q]=K[q];return F}function Kd(F,K,q,pt){var At=-1,Vt=F==null?0:F.length;for(pt&&Vt&&(q=F[++At]);++At<Vt;)q=K(q,F[At],At,F);return q}function SB(F,K,q,pt){var At=F==null?0:F.length;for(pt&&At&&(q=F[--At]);At--;)q=K(q,F[At],At,F);return q}function Xd(F,K){for(var q=-1,pt=F==null?0:F.length;++q<pt;)if(K(F[q],q,F))return!0;return!1}var TB=Zd("length");function MB(F){return F.split("")}function kB(F){return F.match(Td)||[]}function e_(F,K,q){var pt;return q(F,function(At,Vt,ke){if(K(At,Vt,ke))return pt=Vt,!1}),pt}function Nl(F,K,q,pt){for(var At=F.length,Vt=q+(pt?1:-1);pt?Vt--:++Vt<At;)if(K(F[Vt],Vt,F))return Vt;return-1}function ps(F,K,q){return K===K?FB(F,K,q):Nl(F,n_,q)}function DB(F,K,q,pt){for(var At=q-1,Vt=F.length;++At<Vt;)if(pt(F[At],K))return At;return-1}function n_(F){return F!==F}function i_(F,K){var q=F==null?0:F.length;return q?Jd(F,K)/q:V}function Zd(F){return function(K){return K==null?e:K[F]}}function Qd(F){return function(K){return F==null?e:F[K]}}function r_(F,K,q,pt,At){return At(F,function(Vt,ke,ne){q=pt?(pt=!1,Vt):K(q,Vt,ke,ne)}),q}function CB(F,K){var q=F.length;for(F.sort(K);q--;)F[q]=F[q].value;return F}function Jd(F,K){for(var q,pt=-1,At=F.length;++pt<At;){var Vt=K(F[pt]);Vt!==e&&(q=q===e?Vt:q+Vt)}return q}function tf(F,K){for(var q=-1,pt=Array(F);++q<F;)pt[q]=K(q);return pt}function OB(F,K){return ue(K,function(q){return[q,F[q]]})}function s_(F){return F&&F.slice(0,c_(F)+1).replace(Eo,"")}function bn(F){return function(K){return F(K)}}function ef(F,K){return ue(K,function(q){return F[q]})}function zo(F,K){return F.has(K)}function o_(F,K){for(var q=-1,pt=F.length;++q<pt&&ps(K,F[q],0)>-1;);return q}function a_(F,K){for(var q=F.length;q--&&ps(K,F[q],0)>-1;);return q}function AB(F,K){for(var q=F.length,pt=0;q--;)F[q]===K&&++pt;return pt}var EB=Qd(Y),RB=Qd(J);function PB(F){return"\\"+Me[F]}function IB(F,K){return F==null?e:F[K]}function ms(F){return fs.test(F)}function LB(F){return qd.test(F)}function NB(F){for(var K,q=[];!(K=F.next()).done;)q.push(K.value);return q}function nf(F){var K=-1,q=Array(F.size);return F.forEach(function(pt,At){q[++K]=[At,pt]}),q}function l_(F,K){return function(q){return F(K(q))}}function ji(F,K){for(var q=-1,pt=F.length,At=0,Vt=[];++q<pt;){var ke=F[q];(ke===K||ke===m)&&(F[q]=m,Vt[At++]=q)}return Vt}function Bl(F){var K=-1,q=Array(F.size);return F.forEach(function(pt){q[++K]=pt}),q}function BB(F){var K=-1,q=Array(F.size);return F.forEach(function(pt){q[++K]=[pt,pt]}),q}function FB(F,K,q){for(var pt=q-1,At=F.length;++pt<At;)if(F[pt]===K)return pt;return-1}function zB(F,K,q){for(var pt=q+1;pt--;)if(F[pt]===K)return pt;return pt}function gs(F){return ms(F)?HB(F):TB(F)}function Fn(F){return ms(F)?WB(F):MB(F)}function c_(F){for(var K=F.length;K--&&wd.test(F.charAt(K)););return K}var UB=Qd(gt);function HB(F){for(var K=ds.lastIndex=0;ds.test(F);)++K;return K}function WB(F){return F.match(ds)||[]}function $B(F){return F.match(Yd)||[]}var VB=(function F(K){K=K==null?ce:ys.defaults(ce.Object(),K,ys.pick(ce,Bo));var q=K.Array,pt=K.Date,At=K.Error,Vt=K.Function,ke=K.Math,ne=K.Object,rf=K.RegExp,YB=K.String,On=K.TypeError,Fl=q.prototype,qB=Vt.prototype,_s=ne.prototype,zl=K["__core-js_shared__"],Ul=qB.toString,Gt=_s.hasOwnProperty,jB=0,u_=(function(){var o=/[^.]+$/.exec(zl&&zl.keys&&zl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Hl=_s.toString,GB=Ul.call(ne),KB=ce._,XB=rf("^"+Ul.call(Gt).replace(Ao,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wl=Fo?K.Buffer:e,Gi=K.Symbol,$l=K.Uint8Array,d_=Wl?Wl.allocUnsafe:e,Vl=l_(ne.getPrototypeOf,ne),f_=ne.create,h_=_s.propertyIsEnumerable,Yl=Fl.splice,p_=Gi?Gi.isConcatSpreadable:e,Uo=Gi?Gi.iterator:e,kr=Gi?Gi.toStringTag:e,ql=(function(){try{var o=Er(ne,"defineProperty");return o({},"",{}),o}catch{}})(),ZB=K.clearTimeout!==ce.clearTimeout&&K.clearTimeout,QB=pt&&pt.now!==ce.Date.now&&pt.now,JB=K.setTimeout!==ce.setTimeout&&K.setTimeout,jl=ke.ceil,Gl=ke.floor,sf=ne.getOwnPropertySymbols,tF=Wl?Wl.isBuffer:e,m_=K.isFinite,eF=Fl.join,nF=l_(ne.keys,ne),De=ke.max,Ke=ke.min,iF=pt.now,rF=K.parseInt,g_=ke.random,sF=Fl.reverse,of=Er(K,"DataView"),Ho=Er(K,"Map"),af=Er(K,"Promise"),bs=Er(K,"Set"),Wo=Er(K,"WeakMap"),$o=Er(ne,"create"),Kl=Wo&&new Wo,xs={},oF=Rr(of),aF=Rr(Ho),lF=Rr(af),cF=Rr(bs),uF=Rr(Wo),Xl=Gi?Gi.prototype:e,Vo=Xl?Xl.valueOf:e,y_=Xl?Xl.toString:e;function T(o){if(ge(o)&&!Pt(o)&&!(o instanceof Ut)){if(o instanceof An)return o;if(Gt.call(o,"__wrapped__"))return _b(o)}return new An(o)}var ws=(function(){function o(){}return function(c){if(!he(c))return{};if(f_)return f_(c);o.prototype=c;var f=new o;return o.prototype=e,f}})();function Zl(){}function An(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}T.templateSettings={escape:yd,evaluate:_d,interpolate:Oo,variable:"",imports:{_:T}},T.prototype=Zl.prototype,T.prototype.constructor=T,An.prototype=ws(Zl.prototype),An.prototype.constructor=An;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=L,this.__views__=[]}function dF(){var o=new Ut(this.__wrapped__);return o.__actions__=dn(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=dn(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=dn(this.__views__),o}function fF(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function hF(){var o=this.__wrapped__.value(),c=this.__dir__,f=Pt(o),y=c<0,b=f?o.length:0,k=Mz(0,b,this.__views__),E=k.start,R=k.end,U=R-E,Z=y?R:E-1,Q=this.__iteratees__,nt=Q.length,ft=0,yt=Ke(U,this.__takeCount__);if(!f||!y&&b==U&&yt==U)return H_(o,this.__actions__);var Dt=[];t:for(;U--&&ft<yt;){Z+=c;for(var Bt=-1,Tt=o[Z];++Bt<nt;){var zt=Q[Bt],Ht=zt.iteratee,vn=zt.type,nn=Ht(Tt);if(vn==ht)Tt=nn;else if(!nn){if(vn==ut)continue t;break t}}Dt[ft++]=Tt}return Dt}Ut.prototype=ws(Zl.prototype),Ut.prototype.constructor=Ut;function Dr(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 pF(){this.__data__=$o?$o(null):{},this.size=0}function mF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function gF(o){var c=this.__data__;if($o){var f=c[o];return f===d?e:f}return Gt.call(c,o)?c[o]:e}function yF(o){var c=this.__data__;return $o?c[o]!==e:Gt.call(c,o)}function _F(o,c){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=$o&&c===e?d:c,this}Dr.prototype.clear=pF,Dr.prototype.delete=mF,Dr.prototype.get=gF,Dr.prototype.has=yF,Dr.prototype.set=_F;function mi(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 bF(){this.__data__=[],this.size=0}function xF(o){var c=this.__data__,f=Ql(c,o);if(f<0)return!1;var y=c.length-1;return f==y?c.pop():Yl.call(c,f,1),--this.size,!0}function wF(o){var c=this.__data__,f=Ql(c,o);return f<0?e:c[f][1]}function vF(o){return Ql(this.__data__,o)>-1}function SF(o,c){var f=this.__data__,y=Ql(f,o);return y<0?(++this.size,f.push([o,c])):f[y][1]=c,this}mi.prototype.clear=bF,mi.prototype.delete=xF,mi.prototype.get=wF,mi.prototype.has=vF,mi.prototype.set=SF;function gi(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 TF(){this.size=0,this.__data__={hash:new Dr,map:new(Ho||mi),string:new Dr}}function MF(o){var c=uc(this,o).delete(o);return this.size-=c?1:0,c}function kF(o){return uc(this,o).get(o)}function DF(o){return uc(this,o).has(o)}function CF(o,c){var f=uc(this,o),y=f.size;return f.set(o,c),this.size+=f.size==y?0:1,this}gi.prototype.clear=TF,gi.prototype.delete=MF,gi.prototype.get=kF,gi.prototype.has=DF,gi.prototype.set=CF;function Cr(o){var c=-1,f=o==null?0:o.length;for(this.__data__=new gi;++c<f;)this.add(o[c])}function OF(o){return this.__data__.set(o,d),this}function AF(o){return this.__data__.has(o)}Cr.prototype.add=Cr.prototype.push=OF,Cr.prototype.has=AF;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function EF(){this.__data__=new mi,this.size=0}function RF(o){var c=this.__data__,f=c.delete(o);return this.size=c.size,f}function PF(o){return this.__data__.get(o)}function IF(o){return this.__data__.has(o)}function LF(o,c){var f=this.__data__;if(f instanceof mi){var y=f.__data__;if(!Ho||y.length<r-1)return y.push([o,c]),this.size=++f.size,this;f=this.__data__=new gi(y)}return f.set(o,c),this.size=f.size,this}zn.prototype.clear=EF,zn.prototype.delete=RF,zn.prototype.get=PF,zn.prototype.has=IF,zn.prototype.set=LF;function __(o,c){var f=Pt(o),y=!f&&Pr(o),b=!f&&!y&&Ji(o),k=!f&&!y&&!b&&Ms(o),E=f||y||b||k,R=E?tf(o.length,YB):[],U=R.length;for(var Z in o)(c||Gt.call(o,Z))&&!(E&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||k&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||bi(Z,U)))&&R.push(Z);return R}function b_(o){var c=o.length;return c?o[_f(0,c-1)]:e}function NF(o,c){return dc(dn(o),Or(c,0,o.length))}function BF(o){return dc(dn(o))}function lf(o,c,f){(f!==e&&!Hn(o[c],f)||f===e&&!(c in o))&&Qn(o,c,f)}function Yo(o,c,f){var y=o[c];(!(Gt.call(o,c)&&Hn(y,f))||f===e&&!(c in o))&&Qn(o,c,f)}function Ql(o,c){for(var f=o.length;f--;)if(Hn(o[f][0],c))return f;return-1}function FF(o,c,f,y){return Ki(o,function(b,k,E){c(y,b,f(b),E)}),y}function x_(o,c){return o&&ti(c,Pe(c),o)}function zF(o,c){return o&&ti(c,hn(c),o)}function Qn(o,c,f){c=="__proto__"&&ql?ql(o,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[c]=f}function cf(o,c){for(var f=-1,y=c.length,b=q(y),k=o==null;++f<y;)b[f]=k?e:Vf(o,c[f]);return b}function Or(o,c,f){return o===o&&(f!==e&&(o=o<=f?o:f),c!==e&&(o=o>=c?o:c)),o}function En(o,c,f,y,b,k){var E,R=c&g,U=c&_,Z=c&x;if(f&&(E=b?f(o,y,b,k):f(o)),E!==e)return E;if(!he(o))return o;var Q=Pt(o);if(Q){if(E=Dz(o),!R)return dn(o,E)}else{var nt=Xe(o),ft=nt==Lt||nt==vt;if(Ji(o))return V_(o,R);if(nt==_t||nt==X||ft&&!b){if(E=U||ft?{}:cb(o),!R)return U?gz(o,zF(E,o)):mz(o,x_(E,o))}else{if(!D[nt])return b?o:{};E=Cz(o,nt,R)}}k||(k=new zn);var yt=k.get(o);if(yt)return yt;k.set(o,E),Fb(o)?o.forEach(function(Tt){E.add(En(Tt,c,f,Tt,o,k))}):Nb(o)&&o.forEach(function(Tt,zt){E.set(zt,En(Tt,c,f,zt,o,k))});var Dt=Z?U?Of:Cf:U?hn:Pe,Bt=Q?e:Dt(o);return _n(Bt||o,function(Tt,zt){Bt&&(zt=Tt,Tt=o[zt]),Yo(E,zt,En(Tt,c,f,zt,o,k))}),E}function UF(o){var c=Pe(o);return function(f){return w_(f,o,c)}}function w_(o,c,f){var y=f.length;if(o==null)return!y;for(o=ne(o);y--;){var b=f[y],k=c[b],E=o[b];if(E===e&&!(b in o)||!k(E))return!1}return!0}function v_(o,c,f){if(typeof o!="function")throw new On(a);return Qo(function(){o.apply(e,f)},c)}function qo(o,c,f,y){var b=-1,k=Ll,E=!0,R=o.length,U=[],Z=c.length;if(!R)return U;f&&(c=ue(c,bn(f))),y?(k=Gd,E=!1):c.length>=r&&(k=zo,E=!1,c=new Cr(c));t:for(;++b<R;){var Q=o[b],nt=f==null?Q:f(Q);if(Q=y||Q!==0?Q:0,E&&nt===nt){for(var ft=Z;ft--;)if(c[ft]===nt)continue t;U.push(Q)}else k(c,nt,y)||U.push(Q)}return U}var Ki=K_(Jn),S_=K_(df,!0);function HF(o,c){var f=!0;return Ki(o,function(y,b,k){return f=!!c(y,b,k),f}),f}function Jl(o,c,f){for(var y=-1,b=o.length;++y<b;){var k=o[y],E=c(k);if(E!=null&&(R===e?E===E&&!wn(E):f(E,R)))var R=E,U=k}return U}function WF(o,c,f,y){var b=o.length;for(f=Nt(f),f<0&&(f=-f>b?0:b+f),y=y===e||y>b?b:Nt(y),y<0&&(y+=b),y=f>y?0:Ub(y);f<y;)o[f++]=c;return o}function T_(o,c){var f=[];return Ki(o,function(y,b,k){c(y,b,k)&&f.push(y)}),f}function ze(o,c,f,y,b){var k=-1,E=o.length;for(f||(f=Az),b||(b=[]);++k<E;){var R=o[k];c>0&&f(R)?c>1?ze(R,c-1,f,y,b):qi(b,R):y||(b[b.length]=R)}return b}var uf=X_(),M_=X_(!0);function Jn(o,c){return o&&uf(o,c,Pe)}function df(o,c){return o&&M_(o,c,Pe)}function tc(o,c){return Yi(c,function(f){return xi(o[f])})}function Ar(o,c){c=Zi(c,o);for(var f=0,y=c.length;o!=null&&f<y;)o=o[Un(c[f++])];return f&&f==y?o:e}function k_(o,c,f){var y=c(o);return Pt(o)?y:qi(y,f(o))}function tn(o){return o==null?o===e?Ne:Se:kr&&kr in ne(o)?Tz(o):Bz(o)}function ff(o,c){return o>c}function $F(o,c){return o!=null&&Gt.call(o,c)}function VF(o,c){return o!=null&&c in ne(o)}function YF(o,c,f){return o>=Ke(c,f)&&o<De(c,f)}function hf(o,c,f){for(var y=f?Gd:Ll,b=o[0].length,k=o.length,E=k,R=q(k),U=1/0,Z=[];E--;){var Q=o[E];E&&c&&(Q=ue(Q,bn(c))),U=Ke(Q.length,U),R[E]=!f&&(c||b>=120&&Q.length>=120)?new Cr(E&&Q):e}Q=o[0];var nt=-1,ft=R[0];t:for(;++nt<b&&Z.length<U;){var yt=Q[nt],Dt=c?c(yt):yt;if(yt=f||yt!==0?yt:0,!(ft?zo(ft,Dt):y(Z,Dt,f))){for(E=k;--E;){var Bt=R[E];if(!(Bt?zo(Bt,Dt):y(o[E],Dt,f)))continue t}ft&&ft.push(Dt),Z.push(yt)}}return Z}function qF(o,c,f,y){return Jn(o,function(b,k,E){c(y,f(b),k,E)}),y}function jo(o,c,f){c=Zi(c,o),o=hb(o,c);var y=o==null?o:o[Un(Pn(c))];return y==null?e:yn(y,o,f)}function D_(o){return ge(o)&&tn(o)==X}function jF(o){return ge(o)&&tn(o)==Re}function GF(o){return ge(o)&&tn(o)==et}function Go(o,c,f,y,b){return o===c?!0:o==null||c==null||!ge(o)&&!ge(c)?o!==o&&c!==c:KF(o,c,f,y,Go,b)}function KF(o,c,f,y,b,k){var E=Pt(o),R=Pt(c),U=E?tt:Xe(o),Z=R?tt:Xe(c);U=U==X?_t:U,Z=Z==X?_t:Z;var Q=U==_t,nt=Z==_t,ft=U==Z;if(ft&&Ji(o)){if(!Ji(c))return!1;E=!0,Q=!1}if(ft&&!Q)return k||(k=new zn),E||Ms(o)?ob(o,c,f,y,b,k):vz(o,c,U,f,y,b,k);if(!(f&w)){var yt=Q&&Gt.call(o,"__wrapped__"),Dt=nt&&Gt.call(c,"__wrapped__");if(yt||Dt){var Bt=yt?o.value():o,Tt=Dt?c.value():c;return k||(k=new zn),b(Bt,Tt,f,y,k)}}return ft?(k||(k=new zn),Sz(o,c,f,y,b,k)):!1}function XF(o){return ge(o)&&Xe(o)==Ot}function pf(o,c,f,y){var b=f.length,k=b,E=!y;if(o==null)return!k;for(o=ne(o);b--;){var R=f[b];if(E&&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(E&&R[2]){if(Z===e&&!(U in o))return!1}else{var nt=new zn;if(y)var ft=y(Z,Q,U,o,c,nt);if(!(ft===e?Go(Q,Z,w|S,y,nt):ft))return!1}}return!0}function C_(o){if(!he(o)||Rz(o))return!1;var c=xi(o)?XB:Cd;return c.test(Rr(o))}function ZF(o){return ge(o)&&tn(o)==Ee}function QF(o){return ge(o)&&Xe(o)==oe}function JF(o){return ge(o)&&yc(o.length)&&!!ee[tn(o)]}function O_(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?Pt(o)?R_(o[0],o[1]):E_(o):Qb(o)}function mf(o){if(!Zo(o))return nF(o);var c=[];for(var f in ne(o))Gt.call(o,f)&&f!="constructor"&&c.push(f);return c}function tz(o){if(!he(o))return Nz(o);var c=Zo(o),f=[];for(var y in o)y=="constructor"&&(c||!Gt.call(o,y))||f.push(y);return f}function gf(o,c){return o<c}function A_(o,c){var f=-1,y=fn(o)?q(o.length):[];return Ki(o,function(b,k,E){y[++f]=c(b,k,E)}),y}function E_(o){var c=Ef(o);return c.length==1&&c[0][2]?db(c[0][0],c[0][1]):function(f){return f===o||pf(f,o,c)}}function R_(o,c){return Pf(o)&&ub(c)?db(Un(o),c):function(f){var y=Vf(f,o);return y===e&&y===c?Yf(f,o):Go(c,y,w|S)}}function ec(o,c,f,y,b){o!==c&&uf(c,function(k,E){if(b||(b=new zn),he(k))ez(o,c,E,f,ec,y,b);else{var R=y?y(Lf(o,E),k,E+"",o,c,b):e;R===e&&(R=k),lf(o,E,R)}},hn)}function ez(o,c,f,y,b,k,E){var R=Lf(o,f),U=Lf(c,f),Z=E.get(U);if(Z){lf(o,f,Z);return}var Q=k?k(R,U,f+"",o,c,E):e,nt=Q===e;if(nt){var ft=Pt(U),yt=!ft&&Ji(U),Dt=!ft&&!yt&&Ms(U);Q=U,ft||yt||Dt?Pt(R)?Q=R:be(R)?Q=dn(R):yt?(nt=!1,Q=V_(U,!0)):Dt?(nt=!1,Q=Y_(U,!0)):Q=[]:Jo(U)||Pr(U)?(Q=R,Pr(R)?Q=Hb(R):(!he(R)||xi(R))&&(Q=cb(U))):nt=!1}nt&&(E.set(U,Q),b(Q,U,y,k,E),E.delete(U)),lf(o,f,Q)}function P_(o,c){var f=o.length;if(f)return c+=c<0?f:0,bi(c,f)?o[c]:e}function I_(o,c,f){c.length?c=ue(c,function(k){return Pt(k)?function(E){return Ar(E,k.length===1?k[0]:k)}:k}):c=[pn];var y=-1;c=ue(c,bn(Mt()));var b=A_(o,function(k,E,R){var U=ue(c,function(Z){return Z(k)});return{criteria:U,index:++y,value:k}});return CB(b,function(k,E){return pz(k,E,f)})}function nz(o,c){return L_(o,c,function(f,y){return Yf(o,y)})}function L_(o,c,f){for(var y=-1,b=c.length,k={};++y<b;){var E=c[y],R=Ar(o,E);f(R,E)&&Ko(k,Zi(E,o),R)}return k}function iz(o){return function(c){return Ar(c,o)}}function yf(o,c,f,y){var b=y?DB:ps,k=-1,E=c.length,R=o;for(o===c&&(c=dn(c)),f&&(R=ue(o,bn(f)));++k<E;)for(var U=0,Z=c[k],Q=f?f(Z):Z;(U=b(R,Q,U,y))>-1;)R!==o&&Yl.call(R,U,1),Yl.call(o,U,1);return o}function N_(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;bi(b)?Yl.call(o,b,1):wf(o,b)}}return o}function _f(o,c){return o+Gl(g_()*(c-o+1))}function rz(o,c,f,y){for(var b=-1,k=De(jl((c-o)/(f||1)),0),E=q(k);k--;)E[y?k:++b]=o,o+=f;return E}function bf(o,c){var f="";if(!o||c<1||c>at)return f;do c%2&&(f+=o),c=Gl(c/2),c&&(o+=o);while(c);return f}function Ft(o,c){return Nf(fb(o,c,pn),o+"")}function sz(o){return b_(ks(o))}function oz(o,c){var f=ks(o);return dc(f,Or(c,0,f.length))}function Ko(o,c,f,y){if(!he(o))return o;c=Zi(c,o);for(var b=-1,k=c.length,E=k-1,R=o;R!=null&&++b<k;){var U=Un(c[b]),Z=f;if(U==="__proto__"||U==="constructor"||U==="prototype")return o;if(b!=E){var Q=R[U];Z=y?y(Q,U,R):e,Z===e&&(Z=he(Q)?Q:bi(c[b+1])?[]:{})}Yo(R,U,Z),R=R[U]}return o}var B_=Kl?function(o,c){return Kl.set(o,c),o}:pn,az=ql?function(o,c){return ql(o,"toString",{configurable:!0,enumerable:!1,value:jf(c),writable:!0})}:pn;function lz(o){return dc(ks(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=q(b);++y<b;)k[y]=o[y+c];return k}function cz(o,c){var f;return Ki(o,function(y,b,k){return f=c(y,b,k),!f}),!!f}function nc(o,c,f){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=it){for(;y<b;){var k=y+b>>>1,E=o[k];E!==null&&!wn(E)&&(f?E<=c:E<c)?y=k+1:b=k}return b}return xf(o,c,pn,f)}function xf(o,c,f,y){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=f(c);for(var E=c!==c,R=c===null,U=wn(c),Z=c===e;b<k;){var Q=Gl((b+k)/2),nt=f(o[Q]),ft=nt!==e,yt=nt===null,Dt=nt===nt,Bt=wn(nt);if(E)var Tt=y||Dt;else Z?Tt=Dt&&(y||ft):R?Tt=Dt&&ft&&(y||!yt):U?Tt=Dt&&ft&&!yt&&(y||!Bt):yt||Bt?Tt=!1:Tt=y?nt<=c:nt<c;Tt?b=Q+1:k=Q}return Ke(k,H)}function F_(o,c){for(var f=-1,y=o.length,b=0,k=[];++f<y;){var E=o[f],R=c?c(E):E;if(!f||!Hn(R,U)){var U=R;k[b++]=E===0?0:E}}return k}function z_(o){return typeof o=="number"?o:wn(o)?V:+o}function xn(o){if(typeof o=="string")return o;if(Pt(o))return ue(o,xn)+"";if(wn(o))return y_?y_.call(o):"";var c=o+"";return c=="0"&&1/o==-bt?"-0":c}function Xi(o,c,f){var y=-1,b=Ll,k=o.length,E=!0,R=[],U=R;if(f)E=!1,b=Gd;else if(k>=r){var Z=c?null:xz(o);if(Z)return Bl(Z);E=!1,b=zo,U=new Cr}else U=c?[]:R;t:for(;++y<k;){var Q=o[y],nt=c?c(Q):Q;if(Q=f||Q!==0?Q:0,E&&nt===nt){for(var ft=U.length;ft--;)if(U[ft]===nt)continue t;c&&U.push(nt),R.push(Q)}else b(U,nt,f)||(U!==R&&U.push(nt),R.push(Q))}return R}function wf(o,c){c=Zi(c,o);var f=-1,y=c.length;if(!y)return!0;for(;++f<y;){var b=Un(c[f]);if(b==="__proto__"&&!Gt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&f<y-1)return!1}var k=hb(o,c);return k==null||delete k[Un(Pn(c))]}function U_(o,c,f,y){return Ko(o,c,f(Ar(o,c)),y)}function ic(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 H_(o,c){var f=o;return f instanceof Ut&&(f=f.value()),Kd(c,function(y,b){return b.func.apply(b.thisArg,qi([y],b.args))},f)}function vf(o,c,f){var y=o.length;if(y<2)return y?Xi(o[0]):[];for(var b=-1,k=q(y);++b<y;)for(var E=o[b],R=-1;++R<y;)R!=b&&(k[b]=qo(k[b]||E,o[R],c,f));return Xi(ze(k,1),c,f)}function W_(o,c,f){for(var y=-1,b=o.length,k=c.length,E={};++y<b;){var R=y<k?c[y]:e;f(E,o[y],R)}return E}function Sf(o){return be(o)?o:[]}function Tf(o){return typeof o=="function"?o:pn}function Zi(o,c){return Pt(o)?o:Pf(o,c)?[o]:yb(Kt(o))}var uz=Ft;function Qi(o,c,f){var y=o.length;return f=f===e?y:f,!c&&f>=y?o:Rn(o,c,f)}var $_=ZB||function(o){return ce.clearTimeout(o)};function V_(o,c){if(c)return o.slice();var f=o.length,y=d_?d_(f):new o.constructor(f);return o.copy(y),y}function Mf(o){var c=new o.constructor(o.byteLength);return new $l(c).set(new $l(o)),c}function dz(o,c){var f=c?Mf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function fz(o){var c=new o.constructor(o.source,_l.exec(o));return c.lastIndex=o.lastIndex,c}function hz(o){return Vo?ne(Vo.call(o)):{}}function Y_(o,c){var f=c?Mf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function q_(o,c){if(o!==c){var f=o!==e,y=o===null,b=o===o,k=wn(o),E=c!==e,R=c===null,U=c===c,Z=wn(c);if(!R&&!Z&&!k&&o>c||k&&E&&U&&!R&&!Z||y&&E&&U||!f&&U||!b)return 1;if(!y&&!k&&!Z&&o<c||Z&&f&&b&&!y&&!k||R&&f&&b||!E&&b||!U)return-1}return 0}function pz(o,c,f){for(var y=-1,b=o.criteria,k=c.criteria,E=b.length,R=f.length;++y<E;){var U=q_(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 j_(o,c,f,y){for(var b=-1,k=o.length,E=f.length,R=-1,U=c.length,Z=De(k-E,0),Q=q(U+Z),nt=!y;++R<U;)Q[R]=c[R];for(;++b<E;)(nt||b<k)&&(Q[f[b]]=o[b]);for(;Z--;)Q[R++]=o[b++];return Q}function G_(o,c,f,y){for(var b=-1,k=o.length,E=-1,R=f.length,U=-1,Z=c.length,Q=De(k-R,0),nt=q(Q+Z),ft=!y;++b<Q;)nt[b]=o[b];for(var yt=b;++U<Z;)nt[yt+U]=c[U];for(;++E<R;)(ft||b<k)&&(nt[yt+f[E]]=o[b++]);return nt}function dn(o,c){var f=-1,y=o.length;for(c||(c=q(y));++f<y;)c[f]=o[f];return c}function ti(o,c,f,y){var b=!f;f||(f={});for(var k=-1,E=c.length;++k<E;){var R=c[k],U=y?y(f[R],o[R],R,f,o):e;U===e&&(U=o[R]),b?Qn(f,R,U):Yo(f,R,U)}return f}function mz(o,c){return ti(o,Rf(o),c)}function gz(o,c){return ti(o,ab(o),c)}function rc(o,c){return function(f,y){var b=Pt(f)?wB:FF,k=c?c():{};return b(f,o,Mt(y,2),k)}}function vs(o){return Ft(function(c,f){var y=-1,b=f.length,k=b>1?f[b-1]:e,E=b>2?f[2]:e;for(k=o.length>3&&typeof k=="function"?(b--,k):e,E&&en(f[0],f[1],E)&&(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 K_(o,c){return function(f,y){if(f==null)return f;if(!fn(f))return o(f,y);for(var b=f.length,k=c?b:-1,E=ne(f);(c?k--:++k<b)&&y(E[k],k,E)!==!1;);return f}}function X_(o){return function(c,f,y){for(var b=-1,k=ne(c),E=y(c),R=E.length;R--;){var U=E[o?R:++b];if(f(k[U],U,k)===!1)break}return c}}function yz(o,c,f){var y=c&C,b=Xo(o);function k(){var E=this&&this!==ce&&this instanceof k?b:o;return E.apply(y?f:this,arguments)}return k}function Z_(o){return function(c){c=Kt(c);var f=ms(c)?Fn(c):e,y=f?f[0]:c.charAt(0),b=f?Qi(f,1).join(""):c.slice(1);return y[o]()+b}}function Ss(o){return function(c){return Kd(Xb(Kb(c).replace($d,"")),o,"")}}function Xo(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=ws(o.prototype),y=o.apply(f,c);return he(y)?y:f}}function _z(o,c,f){var y=Xo(o);function b(){for(var k=arguments.length,E=q(k),R=k,U=Ts(b);R--;)E[R]=arguments[R];var Z=k<3&&E[0]!==U&&E[k-1]!==U?[]:ji(E,U);if(k-=Z.length,k<f)return nb(o,c,sc,b.placeholder,e,E,Z,e,e,f-k);var Q=this&&this!==ce&&this instanceof b?y:o;return yn(Q,this,E)}return b}function Q_(o){return function(c,f,y){var b=ne(c);if(!fn(c)){var k=Mt(f,3);c=Pe(c),f=function(R){return k(b[R],R,b)}}var E=o(c,f,y);return E>-1?b[k?c[E]:E]:e}}function J_(o){return _i(function(c){var f=c.length,y=f,b=An.prototype.thru;for(o&&c.reverse();y--;){var k=c[y];if(typeof k!="function")throw new On(a);if(b&&!E&&cc(k)=="wrapper")var E=new An([],!0)}for(y=E?y:f;++y<f;){k=c[y];var R=cc(k),U=R=="wrapper"?Af(k):e;U&&If(U[0])&&U[1]==(v|P|$|M)&&!U[4].length&&U[9]==1?E=E[cc(U[0])].apply(E,U[3]):E=k.length==1&&If(k)?E[R]():E.thru(k)}return function(){var Z=arguments,Q=Z[0];if(E&&Z.length==1&&Pt(Q))return E.plant(Q).value();for(var nt=0,ft=f?c[nt].apply(this,Z):Q;++nt<f;)ft=c[nt].call(this,ft);return ft}})}function sc(o,c,f,y,b,k,E,R,U,Z){var Q=c&v,nt=c&C,ft=c&A,yt=c&(P|I),Dt=c&O,Bt=ft?e:Xo(o);function Tt(){for(var zt=arguments.length,Ht=q(zt),vn=zt;vn--;)Ht[vn]=arguments[vn];if(yt)var nn=Ts(Tt),Sn=AB(Ht,nn);if(y&&(Ht=j_(Ht,y,b,yt)),k&&(Ht=G_(Ht,k,E,yt)),zt-=Sn,yt&&zt<Z){var xe=ji(Ht,nn);return nb(o,c,sc,Tt.placeholder,f,Ht,xe,R,U,Z-zt)}var Wn=nt?f:this,vi=ft?Wn[o]:o;return zt=Ht.length,R?Ht=Fz(Ht,R):Dt&&zt>1&&Ht.reverse(),Q&&U<zt&&(Ht.length=U),this&&this!==ce&&this instanceof Tt&&(vi=Bt||Xo(vi)),vi.apply(Wn,Ht)}return Tt}function tb(o,c){return function(f,y){return qF(f,o,c(y),{})}}function oc(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=xn(f),y=xn(y)):(f=z_(f),y=z_(y)),b=o(f,y)}return b}}function kf(o){return _i(function(c){return c=ue(c,bn(Mt())),Ft(function(f){var y=this;return o(c,function(b){return yn(b,y,f)})})})}function ac(o,c){c=c===e?" ":xn(c);var f=c.length;if(f<2)return f?bf(c,o):c;var y=bf(c,jl(o/gs(c)));return ms(c)?Qi(Fn(y),0,o).join(""):y.slice(0,o)}function bz(o,c,f,y){var b=c&C,k=Xo(o);function E(){for(var R=-1,U=arguments.length,Z=-1,Q=y.length,nt=q(Q+U),ft=this&&this!==ce&&this instanceof E?k:o;++Z<Q;)nt[Z]=y[Z];for(;U--;)nt[Z++]=arguments[++R];return yn(ft,b?f:this,nt)}return E}function eb(o){return function(c,f,y){return y&&typeof y!="number"&&en(c,f,y)&&(f=y=e),c=wi(c),f===e?(f=c,c=0):f=wi(f),y=y===e?c<f?1:-1:wi(y),rz(c,f,y,o)}}function lc(o){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=In(c),f=In(f)),o(c,f)}}function nb(o,c,f,y,b,k,E,R,U,Z){var Q=c&P,nt=Q?E:e,ft=Q?e:E,yt=Q?k:e,Dt=Q?e:k;c|=Q?$:z,c&=~(Q?z:$),c&B||(c&=-4);var Bt=[o,c,b,yt,nt,Dt,ft,R,U,Z],Tt=f.apply(e,Bt);return If(o)&&pb(Tt,Bt),Tt.placeholder=y,mb(Tt,o,c)}function Df(o){var c=ke[o];return function(f,y){if(f=In(f),y=y==null?0:Ke(Nt(y),292),y&&m_(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 xz=bs&&1/Bl(new bs([,-0]))[1]==bt?function(o){return new bs(o)}:Xf;function ib(o){return function(c){var f=Xe(c);return f==Ot?nf(c):f==oe?BB(c):OB(c,o(c))}}function yi(o,c,f,y,b,k,E,R){var U=c&A;if(!U&&typeof o!="function")throw new On(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=e),E=E===e?E:De(Nt(E),0),R=R===e?R:Nt(R),Z-=b?b.length:0,c&z){var Q=y,nt=b;y=b=e}var ft=U?e:Af(o),yt=[o,c,f,y,b,Q,nt,k,E,R];if(ft&&Lz(yt,ft),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:De(yt[9]-Z,0),!R&&c&(P|I)&&(c&=-25),!c||c==C)var Dt=yz(o,c,f);else c==P||c==I?Dt=_z(o,c,R):(c==$||c==(C|$))&&!b.length?Dt=bz(o,c,f,y):Dt=sc.apply(e,yt);var Bt=ft?B_:pb;return mb(Bt(Dt,yt),o,c)}function rb(o,c,f,y){return o===e||Hn(o,_s[f])&&!Gt.call(y,f)?c:o}function sb(o,c,f,y,b,k){return he(o)&&he(c)&&(k.set(c,o),ec(o,c,e,sb,k),k.delete(c)),o}function wz(o){return Jo(o)?e:o}function ob(o,c,f,y,b,k){var E=f&w,R=o.length,U=c.length;if(R!=U&&!(E&&U>R))return!1;var Z=k.get(o),Q=k.get(c);if(Z&&Q)return Z==c&&Q==o;var nt=-1,ft=!0,yt=f&S?new Cr:e;for(k.set(o,c),k.set(c,o);++nt<R;){var Dt=o[nt],Bt=c[nt];if(y)var Tt=E?y(Bt,Dt,nt,c,o,k):y(Dt,Bt,nt,o,c,k);if(Tt!==e){if(Tt)continue;ft=!1;break}if(yt){if(!Xd(c,function(zt,Ht){if(!zo(yt,Ht)&&(Dt===zt||b(Dt,zt,f,y,k)))return yt.push(Ht)})){ft=!1;break}}else if(!(Dt===Bt||b(Dt,Bt,f,y,k))){ft=!1;break}}return k.delete(o),k.delete(c),ft}function vz(o,c,f,y,b,k,E){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 $l(o),new $l(c)));case j:case et:case kt:return Hn(+o,+c);case wt:return o.name==c.name&&o.message==c.message;case Ee:case cn:return o==c+"";case Ot:var R=nf;case oe:var U=y&w;if(R||(R=Bl),o.size!=c.size&&!U)return!1;var Z=E.get(o);if(Z)return Z==c;y|=S,E.set(o,c);var Q=ob(R(o),R(c),y,b,k,E);return E.delete(o),Q;case $t:if(Vo)return Vo.call(o)==Vo.call(c)}return!1}function Sz(o,c,f,y,b,k){var E=f&w,R=Cf(o),U=R.length,Z=Cf(c),Q=Z.length;if(U!=Q&&!E)return!1;for(var nt=U;nt--;){var ft=R[nt];if(!(E?ft in c:Gt.call(c,ft)))return!1}var yt=k.get(o),Dt=k.get(c);if(yt&&Dt)return yt==c&&Dt==o;var Bt=!0;k.set(o,c),k.set(c,o);for(var Tt=E;++nt<U;){ft=R[nt];var zt=o[ft],Ht=c[ft];if(y)var vn=E?y(Ht,zt,ft,c,o,k):y(zt,Ht,ft,o,c,k);if(!(vn===e?zt===Ht||b(zt,Ht,f,y,k):vn)){Bt=!1;break}Tt||(Tt=ft=="constructor")}if(Bt&&!Tt){var nn=o.constructor,Sn=c.constructor;nn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof nn=="function"&&nn instanceof nn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Bt=!1)}return k.delete(o),k.delete(c),Bt}function _i(o){return Nf(fb(o,e,wb),o+"")}function Cf(o){return k_(o,Pe,Rf)}function Of(o){return k_(o,hn,ab)}var Af=Kl?function(o){return Kl.get(o)}:Xf;function cc(o){for(var c=o.name+"",f=xs[c],y=Gt.call(xs,c)?f.length:0;y--;){var b=f[y],k=b.func;if(k==null||k==o)return b.name}return c}function Ts(o){var c=Gt.call(T,"placeholder")?T:o;return c.placeholder}function Mt(){var o=T.iteratee||Gf;return o=o===Gf?O_:o,arguments.length?o(arguments[0],arguments[1]):o}function uc(o,c){var f=o.__data__;return Ez(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Ef(o){for(var c=Pe(o),f=c.length;f--;){var y=c[f],b=o[y];c[f]=[y,b,ub(b)]}return c}function Er(o,c){var f=IB(o,c);return C_(f)?f:e}function Tz(o){var c=Gt.call(o,kr),f=o[kr];try{o[kr]=e;var y=!0}catch{}var b=Hl.call(o);return y&&(c?o[kr]=f:delete o[kr]),b}var Rf=sf?function(o){return o==null?[]:(o=ne(o),Yi(sf(o),function(c){return h_.call(o,c)}))}:Zf,ab=sf?function(o){for(var c=[];o;)qi(c,Rf(o)),o=Vl(o);return c}:Zf,Xe=tn;(of&&Xe(new of(new ArrayBuffer(1)))!=gn||Ho&&Xe(new Ho)!=Ot||af&&Xe(af.resolve())!=jt||bs&&Xe(new bs)!=oe||Wo&&Xe(new Wo)!=ie)&&(Xe=function(o){var c=tn(o),f=c==_t?o.constructor:e,y=f?Rr(f):"";if(y)switch(y){case oF:return gn;case aF:return Ot;case lF:return jt;case cF:return oe;case uF:return ie}return c});function Mz(o,c,f){for(var y=-1,b=f.length;++y<b;){var k=f[y],E=k.size;switch(k.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=Ke(c,o+E);break;case"takeRight":o=De(o,c-E);break}}return{start:o,end:c}}function kz(o){var c=o.match(vd);return c?c[1].split(Sd):[]}function lb(o,c,f){c=Zi(c,o);for(var y=-1,b=c.length,k=!1;++y<b;){var E=Un(c[y]);if(!(k=o!=null&&f(o,E)))break;o=o[E]}return k||++y!=b?k:(b=o==null?0:o.length,!!b&&yc(b)&&bi(E,b)&&(Pt(o)||Pr(o)))}function Dz(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 cb(o){return typeof o.constructor=="function"&&!Zo(o)?ws(Vl(o)):{}}function Cz(o,c,f){var y=o.constructor;switch(c){case Re:return Mf(o);case j:case et:return new y(+o);case gn:return dz(o,f);case Hi:case Cn:case je:case Ln:case di:case To:case Mo:case vr:case fi:return Y_(o,f);case Ot:return new y;case kt:case cn:return new y(o);case Ee:return fz(o);case oe:return new y;case $t:return hz(o)}}function Oz(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(Nn,`{
8
+ /* [wrapped with `+c+`] */
9
+ `)}function Az(o){return Pt(o)||Pr(o)||!!(p_&&o&&o[p_])}function bi(o,c){var f=typeof o;return c=c??at,!!c&&(f=="number"||f!="symbol"&&Vi.test(o))&&o>-1&&o%1==0&&o<c}function en(o,c,f){if(!he(f))return!1;var y=typeof c;return(y=="number"?fn(f)&&bi(c,f.length):y=="string"&&c in f)?Hn(f[c],o):!1}function Pf(o,c){if(Pt(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||wn(o)?!0:hi.test(o)||!gl.test(o)||c!=null&&o in ne(c)}function Ez(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function If(o){var c=cc(o),f=T[c];if(typeof f!="function"||!(c in Ut.prototype))return!1;if(o===f)return!0;var y=Af(f);return!!y&&o===y[0]}function Rz(o){return!!u_&&u_ in o}var Pz=zl?xi:Qf;function Zo(o){var c=o&&o.constructor,f=typeof c=="function"&&c.prototype||_s;return o===f}function ub(o){return o===o&&!he(o)}function db(o,c){return function(f){return f==null?!1:f[o]===c&&(c!==e||o in ne(f))}}function Iz(o){var c=mc(o,function(y){return f.size===p&&f.clear(),y}),f=c.cache;return c}function Lz(o,c){var f=o[1],y=c[1],b=f|y,k=b<(C|A|v),E=y==v&&f==P||y==v&&f==M&&o[7].length<=c[8]||y==(v|M)&&c[7].length<=c[8]&&f==P;if(!(k||E))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?j_(U,R,c[4]):R,o[4]=U?ji(o[3],m):c[4]}return R=c[5],R&&(U=o[5],o[5]=U?G_(U,R,c[6]):R,o[6]=U?ji(o[5],m):c[6]),R=c[7],R&&(o[7]=R),y&v&&(o[8]=o[8]==null?c[8]:Ke(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function Nz(o){var c=[];if(o!=null)for(var f in ne(o))c.push(f);return c}function Bz(o){return Hl.call(o)}function fb(o,c,f){return c=De(c===e?o.length-1:c,0),function(){for(var y=arguments,b=-1,k=De(y.length-c,0),E=q(k);++b<k;)E[b]=y[c+b];b=-1;for(var R=q(c+1);++b<c;)R[b]=y[b];return R[c]=f(E),yn(o,this,R)}}function hb(o,c){return c.length<2?o:Ar(o,Rn(c,0,-1))}function Fz(o,c){for(var f=o.length,y=Ke(c.length,f),b=dn(o);y--;){var k=c[y];o[y]=bi(k,f)?b[k]:e}return o}function Lf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var pb=gb(B_),Qo=JB||function(o,c){return ce.setTimeout(o,c)},Nf=gb(az);function mb(o,c,f){var y=c+"";return Nf(o,Oz(y,zz(kz(y),f)))}function gb(o){var c=0,f=0;return function(){var y=iF(),b=lt-(y-f);if(f=y,b>0){if(++c>=G)return arguments[0]}else c=0;return o.apply(e,arguments)}}function dc(o,c){var f=-1,y=o.length,b=y-1;for(c=c===e?y:c;++f<c;){var k=_f(f,b),E=o[k];o[k]=o[f],o[f]=E}return o.length=c,o}var yb=Iz(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(bd,function(f,y,b,k){c.push(b?k.replace(Md,"$1"):y||f)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-bt?"-0":c}function Rr(o){if(o!=null){try{return Ul.call(o)}catch{}try{return o+""}catch{}}return""}function zz(o,c){return _n(st,function(f){var y="_."+f[0];c&f[1]&&!Ll(o,y)&&o.push(y)}),o.sort()}function _b(o){if(o instanceof Ut)return o.clone();var c=new An(o.__wrapped__,o.__chain__);return c.__actions__=dn(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function Uz(o,c,f){(f?en(o,c,f):c===e)?c=1:c=De(Nt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,k=0,E=q(jl(y/c));b<y;)E[k++]=Rn(o,b,b+=c);return E}function Hz(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 Wz(){var o=arguments.length;if(!o)return[];for(var c=q(o-1),f=arguments[0],y=o;y--;)c[y-1]=arguments[y];return qi(Pt(f)?dn(f):[f],ze(c,1))}var $z=Ft(function(o,c){return be(o)?qo(o,ze(c,1,be,!0)):[]}),Vz=Ft(function(o,c){var f=Pn(c);return be(f)&&(f=e),be(o)?qo(o,ze(c,1,be,!0),Mt(f,2)):[]}),Yz=Ft(function(o,c){var f=Pn(c);return be(f)&&(f=e),be(o)?qo(o,ze(c,1,be,!0),e,f):[]});function qz(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Nt(c),Rn(o,c<0?0:c,y)):[]}function jz(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Nt(c),c=y-c,Rn(o,0,c<0?0:c)):[]}function Gz(o,c){return o&&o.length?ic(o,Mt(c,3),!0,!0):[]}function Kz(o,c){return o&&o.length?ic(o,Mt(c,3),!0):[]}function Xz(o,c,f,y){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&en(o,c,f)&&(f=0,y=b),WF(o,c,f,y)):[]}function bb(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=f==null?0:Nt(f);return b<0&&(b=De(y+b,0)),Nl(o,Mt(c,3),b)}function xb(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return f!==e&&(b=Nt(f),b=f<0?De(y+b,0):Ke(b,y-1)),Nl(o,Mt(c,3),b,!0)}function wb(o){var c=o==null?0:o.length;return c?ze(o,1):[]}function Zz(o){var c=o==null?0:o.length;return c?ze(o,bt):[]}function Qz(o,c){var f=o==null?0:o.length;return f?(c=c===e?1:Nt(c),ze(o,c)):[]}function Jz(o){for(var c=-1,f=o==null?0:o.length,y={};++c<f;){var b=o[c];Qn(y,b[0],b[1])}return y}function vb(o){return o&&o.length?o[0]:e}function tU(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=f==null?0:Nt(f);return b<0&&(b=De(y+b,0)),ps(o,c,b)}function eU(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var nU=Ft(function(o){var c=ue(o,Sf);return c.length&&c[0]===o[0]?hf(c):[]}),iU=Ft(function(o){var c=Pn(o),f=ue(o,Sf);return c===Pn(f)?c=e:f.pop(),f.length&&f[0]===o[0]?hf(f,Mt(c,2)):[]}),rU=Ft(function(o){var c=Pn(o),f=ue(o,Sf);return c=typeof c=="function"?c:e,c&&f.pop(),f.length&&f[0]===o[0]?hf(f,e,c):[]});function sU(o,c){return o==null?"":eF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:e}function oU(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var b=y;return f!==e&&(b=Nt(f),b=b<0?De(y+b,0):Ke(b,y-1)),c===c?zB(o,c,b):Nl(o,n_,b,!0)}function aU(o,c){return o&&o.length?P_(o,Nt(c)):e}var lU=Ft(Sb);function Sb(o,c){return o&&o.length&&c&&c.length?yf(o,c):o}function cU(o,c,f){return o&&o.length&&c&&c.length?yf(o,c,Mt(f,2)):o}function uU(o,c,f){return o&&o.length&&c&&c.length?yf(o,c,e,f):o}var dU=_i(function(o,c){var f=o==null?0:o.length,y=cf(o,c);return N_(o,ue(c,function(b){return bi(b,f)?+b:b}).sort(q_)),y});function fU(o,c){var f=[];if(!(o&&o.length))return f;var y=-1,b=[],k=o.length;for(c=Mt(c,3);++y<k;){var E=o[y];c(E,y,o)&&(f.push(E),b.push(y))}return N_(o,b),f}function Bf(o){return o==null?o:sF.call(o)}function hU(o,c,f){var y=o==null?0:o.length;return y?(f&&typeof f!="number"&&en(o,c,f)?(c=0,f=y):(c=c==null?0:Nt(c),f=f===e?y:Nt(f)),Rn(o,c,f)):[]}function pU(o,c){return nc(o,c)}function mU(o,c,f){return xf(o,c,Mt(f,2))}function gU(o,c){var f=o==null?0:o.length;if(f){var y=nc(o,c);if(y<f&&Hn(o[y],c))return y}return-1}function yU(o,c){return nc(o,c,!0)}function _U(o,c,f){return xf(o,c,Mt(f,2),!0)}function bU(o,c){var f=o==null?0:o.length;if(f){var y=nc(o,c,!0)-1;if(Hn(o[y],c))return y}return-1}function xU(o){return o&&o.length?F_(o):[]}function wU(o,c){return o&&o.length?F_(o,Mt(c,2)):[]}function vU(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function SU(o,c,f){return o&&o.length?(c=f||c===e?1:Nt(c),Rn(o,0,c<0?0:c)):[]}function TU(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:Nt(c),c=y-c,Rn(o,c<0?0:c,y)):[]}function MU(o,c){return o&&o.length?ic(o,Mt(c,3),!1,!0):[]}function kU(o,c){return o&&o.length?ic(o,Mt(c,3)):[]}var DU=Ft(function(o){return Xi(ze(o,1,be,!0))}),CU=Ft(function(o){var c=Pn(o);return be(c)&&(c=e),Xi(ze(o,1,be,!0),Mt(c,2))}),OU=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:e,Xi(ze(o,1,be,!0),e,c)});function AU(o){return o&&o.length?Xi(o):[]}function EU(o,c){return o&&o.length?Xi(o,Mt(c,2)):[]}function RU(o,c){return c=typeof c=="function"?c:e,o&&o.length?Xi(o,e,c):[]}function Ff(o){if(!(o&&o.length))return[];var c=0;return o=Yi(o,function(f){if(be(f))return c=De(f.length,c),!0}),tf(c,function(f){return ue(o,Zd(f))})}function Tb(o,c){if(!(o&&o.length))return[];var f=Ff(o);return c==null?f:ue(f,function(y){return yn(c,e,y)})}var PU=Ft(function(o,c){return be(o)?qo(o,c):[]}),IU=Ft(function(o){return vf(Yi(o,be))}),LU=Ft(function(o){var c=Pn(o);return be(c)&&(c=e),vf(Yi(o,be),Mt(c,2))}),NU=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:e,vf(Yi(o,be),e,c)}),BU=Ft(Ff);function FU(o,c){return W_(o||[],c||[],Yo)}function zU(o,c){return W_(o||[],c||[],Ko)}var UU=Ft(function(o){var c=o.length,f=c>1?o[c-1]:e;return f=typeof f=="function"?(o.pop(),f):e,Tb(o,f)});function Mb(o){var c=T(o);return c.__chain__=!0,c}function HU(o,c){return c(o),o}function fc(o,c){return c(o)}var WU=_i(function(o){var c=o.length,f=c?o[0]:0,y=this.__wrapped__,b=function(k){return cf(k,o)};return c>1||this.__actions__.length||!(y instanceof Ut)||!bi(f)?this.thru(b):(y=y.slice(f,+f+(c?1:0)),y.__actions__.push({func:fc,args:[b],thisArg:e}),new An(y,this.__chain__).thru(function(k){return c&&!k.length&&k.push(e),k}))});function $U(){return Mb(this)}function VU(){return new An(this.value(),this.__chain__)}function YU(){this.__values__===e&&(this.__values__=zb(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function qU(){return this}function jU(o){for(var c,f=this;f instanceof Zl;){var y=_b(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 GU(){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:fc,args:[Bf],thisArg:e}),new An(c,this.__chain__)}return this.thru(Bf)}function KU(){return H_(this.__wrapped__,this.__actions__)}var XU=rc(function(o,c,f){Gt.call(o,f)?++o[f]:Qn(o,f,1)});function ZU(o,c,f){var y=Pt(o)?t_:HF;return f&&en(o,c,f)&&(c=e),y(o,Mt(c,3))}function QU(o,c){var f=Pt(o)?Yi:T_;return f(o,Mt(c,3))}var JU=Q_(bb),t5=Q_(xb);function e5(o,c){return ze(hc(o,c),1)}function n5(o,c){return ze(hc(o,c),bt)}function i5(o,c,f){return f=f===e?1:Nt(f),ze(hc(o,c),f)}function kb(o,c){var f=Pt(o)?_n:Ki;return f(o,Mt(c,3))}function Db(o,c){var f=Pt(o)?vB:S_;return f(o,Mt(c,3))}var r5=rc(function(o,c,f){Gt.call(o,f)?o[f].push(c):Qn(o,f,[c])});function s5(o,c,f,y){o=fn(o)?o:ks(o),f=f&&!y?Nt(f):0;var b=o.length;return f<0&&(f=De(b+f,0)),_c(o)?f<=b&&o.indexOf(c,f)>-1:!!b&&ps(o,c,f)>-1}var o5=Ft(function(o,c,f){var y=-1,b=typeof c=="function",k=fn(o)?q(o.length):[];return Ki(o,function(E){k[++y]=b?yn(c,E,f):jo(E,c,f)}),k}),a5=rc(function(o,c,f){Qn(o,f,c)});function hc(o,c){var f=Pt(o)?ue:A_;return f(o,Mt(c,3))}function l5(o,c,f,y){return o==null?[]:(Pt(c)||(c=c==null?[]:[c]),f=y?e:f,Pt(f)||(f=f==null?[]:[f]),I_(o,c,f))}var c5=rc(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function u5(o,c,f){var y=Pt(o)?Kd:r_,b=arguments.length<3;return y(o,Mt(c,4),f,b,Ki)}function d5(o,c,f){var y=Pt(o)?SB:r_,b=arguments.length<3;return y(o,Mt(c,4),f,b,S_)}function f5(o,c){var f=Pt(o)?Yi:T_;return f(o,gc(Mt(c,3)))}function h5(o){var c=Pt(o)?b_:sz;return c(o)}function p5(o,c,f){(f?en(o,c,f):c===e)?c=1:c=Nt(c);var y=Pt(o)?NF:oz;return y(o,c)}function m5(o){var c=Pt(o)?BF:lz;return c(o)}function g5(o){if(o==null)return 0;if(fn(o))return _c(o)?gs(o):o.length;var c=Xe(o);return c==Ot||c==oe?o.size:mf(o).length}function y5(o,c,f){var y=Pt(o)?Xd:cz;return f&&en(o,c,f)&&(c=e),y(o,Mt(c,3))}var _5=Ft(function(o,c){if(o==null)return[];var f=c.length;return f>1&&en(o,c[0],c[1])?c=[]:f>2&&en(c[0],c[1],c[2])&&(c=[c[0]]),I_(o,ze(c,1),[])}),pc=QB||function(){return ce.Date.now()};function b5(o,c){if(typeof c!="function")throw new On(a);return o=Nt(o),function(){if(--o<1)return c.apply(this,arguments)}}function Cb(o,c,f){return c=f?e:c,c=o&&c==null?o.length:c,yi(o,v,e,e,e,e,c)}function Ob(o,c){var f;if(typeof c!="function")throw new On(a);return o=Nt(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=e),f}}var zf=Ft(function(o,c,f){var y=C;if(f.length){var b=ji(f,Ts(zf));y|=$}return yi(o,y,c,f,b)}),Ab=Ft(function(o,c,f){var y=C|A;if(f.length){var b=ji(f,Ts(Ab));y|=$}return yi(c,y,o,f,b)});function Eb(o,c,f){c=f?e:c;var y=yi(o,P,e,e,e,e,e,c);return y.placeholder=Eb.placeholder,y}function Rb(o,c,f){c=f?e:c;var y=yi(o,I,e,e,e,e,e,c);return y.placeholder=Rb.placeholder,y}function Pb(o,c,f){var y,b,k,E,R,U,Z=0,Q=!1,nt=!1,ft=!0;if(typeof o!="function")throw new On(a);c=In(c)||0,he(f)&&(Q=!!f.leading,nt="maxWait"in f,k=nt?De(In(f.maxWait)||0,c):k,ft="trailing"in f?!!f.trailing:ft);function yt(xe){var Wn=y,vi=b;return y=b=e,Z=xe,E=o.apply(vi,Wn),E}function Dt(xe){return Z=xe,R=Qo(zt,c),Q?yt(xe):E}function Bt(xe){var Wn=xe-U,vi=xe-Z,Jb=c-Wn;return nt?Ke(Jb,k-vi):Jb}function Tt(xe){var Wn=xe-U,vi=xe-Z;return U===e||Wn>=c||Wn<0||nt&&vi>=k}function zt(){var xe=pc();if(Tt(xe))return Ht(xe);R=Qo(zt,Bt(xe))}function Ht(xe){return R=e,ft&&y?yt(xe):(y=b=e,E)}function vn(){R!==e&&$_(R),Z=0,y=U=b=R=e}function nn(){return R===e?E:Ht(pc())}function Sn(){var xe=pc(),Wn=Tt(xe);if(y=arguments,b=this,U=xe,Wn){if(R===e)return Dt(U);if(nt)return $_(R),R=Qo(zt,c),yt(U)}return R===e&&(R=Qo(zt,c)),E}return Sn.cancel=vn,Sn.flush=nn,Sn}var x5=Ft(function(o,c){return v_(o,1,c)}),w5=Ft(function(o,c,f){return v_(o,In(c)||0,f)});function v5(o){return yi(o,O)}function mc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new On(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 E=o.apply(this,y);return f.cache=k.set(b,E)||k,E};return f.cache=new(mc.Cache||gi),f}mc.Cache=gi;function gc(o){if(typeof o!="function")throw new On(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function S5(o){return Ob(2,o)}var T5=uz(function(o,c){c=c.length==1&&Pt(c[0])?ue(c[0],bn(Mt())):ue(ze(c,1),bn(Mt()));var f=c.length;return Ft(function(y){for(var b=-1,k=Ke(y.length,f);++b<k;)y[b]=c[b].call(this,y[b]);return yn(o,this,y)})}),Uf=Ft(function(o,c){var f=ji(c,Ts(Uf));return yi(o,$,e,c,f)}),Ib=Ft(function(o,c){var f=ji(c,Ts(Ib));return yi(o,z,e,c,f)}),M5=_i(function(o,c){return yi(o,M,e,e,e,c)});function k5(o,c){if(typeof o!="function")throw new On(a);return c=c===e?c:Nt(c),Ft(o,c)}function D5(o,c){if(typeof o!="function")throw new On(a);return c=c==null?0:De(Nt(c),0),Ft(function(f){var y=f[c],b=Qi(f,0,c);return y&&qi(b,y),yn(o,this,b)})}function C5(o,c,f){var y=!0,b=!0;if(typeof o!="function")throw new On(a);return he(f)&&(y="leading"in f?!!f.leading:y,b="trailing"in f?!!f.trailing:b),Pb(o,c,{leading:y,maxWait:c,trailing:b})}function O5(o){return Cb(o,1)}function A5(o,c){return Uf(Tf(c),o)}function E5(){if(!arguments.length)return[];var o=arguments[0];return Pt(o)?o:[o]}function R5(o){return En(o,x)}function P5(o,c){return c=typeof c=="function"?c:e,En(o,x,c)}function I5(o){return En(o,g|x)}function L5(o,c){return c=typeof c=="function"?c:e,En(o,g|x,c)}function N5(o,c){return c==null||w_(o,c,Pe(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var B5=lc(ff),F5=lc(function(o,c){return o>=c}),Pr=D_((function(){return arguments})())?D_:function(o){return ge(o)&&Gt.call(o,"callee")&&!h_.call(o,"callee")},Pt=q.isArray,z5=Gy?bn(Gy):jF;function fn(o){return o!=null&&yc(o.length)&&!xi(o)}function be(o){return ge(o)&&fn(o)}function U5(o){return o===!0||o===!1||ge(o)&&tn(o)==j}var Ji=tF||Qf,H5=Ky?bn(Ky):GF;function W5(o){return ge(o)&&o.nodeType===1&&!Jo(o)}function $5(o){if(o==null)return!0;if(fn(o)&&(Pt(o)||typeof o=="string"||typeof o.splice=="function"||Ji(o)||Ms(o)||Pr(o)))return!o.length;var c=Xe(o);if(c==Ot||c==oe)return!o.size;if(Zo(o))return!mf(o).length;for(var f in o)if(Gt.call(o,f))return!1;return!0}function V5(o,c){return Go(o,c)}function Y5(o,c,f){f=typeof f=="function"?f:e;var y=f?f(o,c):e;return y===e?Go(o,c,e,f):!!y}function Hf(o){if(!ge(o))return!1;var c=tn(o);return c==wt||c==ot||typeof o.message=="string"&&typeof o.name=="string"&&!Jo(o)}function q5(o){return typeof o=="number"&&m_(o)}function xi(o){if(!he(o))return!1;var c=tn(o);return c==Lt||c==vt||c==rt||c==Ae}function Lb(o){return typeof o=="number"&&o==Nt(o)}function yc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=at}function he(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ge(o){return o!=null&&typeof o=="object"}var Nb=Xy?bn(Xy):XF;function j5(o,c){return o===c||pf(o,c,Ef(c))}function G5(o,c,f){return f=typeof f=="function"?f:e,pf(o,c,Ef(c),f)}function K5(o){return Bb(o)&&o!=+o}function X5(o){if(Pz(o))throw new At(s);return C_(o)}function Z5(o){return o===null}function Q5(o){return o==null}function Bb(o){return typeof o=="number"||ge(o)&&tn(o)==kt}function Jo(o){if(!ge(o)||tn(o)!=_t)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&&Ul.call(f)==GB}var Wf=Zy?bn(Zy):ZF;function J5(o){return Lb(o)&&o>=-at&&o<=at}var Fb=Qy?bn(Qy):QF;function _c(o){return typeof o=="string"||!Pt(o)&&ge(o)&&tn(o)==cn}function wn(o){return typeof o=="symbol"||ge(o)&&tn(o)==$t}var Ms=Jy?bn(Jy):JF;function tH(o){return o===e}function eH(o){return ge(o)&&Xe(o)==ie}function nH(o){return ge(o)&&tn(o)==Te}var iH=lc(gf),rH=lc(function(o,c){return o<=c});function zb(o){if(!o)return[];if(fn(o))return _c(o)?Fn(o):dn(o);if(Uo&&o[Uo])return NB(o[Uo]());var c=Xe(o),f=c==Ot?nf:c==oe?Bl:ks;return f(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===bt||o===-bt){var c=o<0?-1:1;return c*ct}return o===o?o:0}function Nt(o){var c=wi(o),f=c%1;return c===c?f?c-f:c:0}function Ub(o){return o?Or(Nt(o),0,L):0}function In(o){if(typeof o=="number")return o;if(wn(o))return V;if(he(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=he(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=s_(o);var f=Dd.test(o);return f||Od.test(o)?Bn(o.slice(2),f?2:8):kd.test(o)?V:+o}function Hb(o){return ti(o,hn(o))}function sH(o){return o?Or(Nt(o),-at,at):o===0?o:0}function Kt(o){return o==null?"":xn(o)}var oH=vs(function(o,c){if(Zo(c)||fn(c)){ti(c,Pe(c),o);return}for(var f in c)Gt.call(c,f)&&Yo(o,f,c[f])}),Wb=vs(function(o,c){ti(c,hn(c),o)}),$b=vs(function(o,c,f,y){ti(c,hn(c),o,y)}),$f=vs(function(o,c,f,y){ti(c,Pe(c),o,y)}),aH=_i(cf);function lH(o,c){var f=ws(o);return c==null?f:x_(f,c)}var cH=Ft(function(o,c){o=ne(o);var f=-1,y=c.length,b=y>2?c[2]:e;for(b&&en(c[0],c[1],b)&&(y=1);++f<y;)for(var k=c[f],E=hn(k),R=-1,U=E.length;++R<U;){var Z=E[R],Q=o[Z];(Q===e||Hn(Q,_s[Z])&&!Gt.call(o,Z))&&(o[Z]=k[Z])}return o}),uH=Ft(function(o){return o.push(e,sb),yn(Vb,e,o)});function dH(o,c){return e_(o,Mt(c,3),Jn)}function fH(o,c){return e_(o,Mt(c,3),df)}function hH(o,c){return o==null?o:uf(o,Mt(c,3),hn)}function pH(o,c){return o==null?o:M_(o,Mt(c,3),hn)}function mH(o,c){return o&&Jn(o,Mt(c,3))}function gH(o,c){return o&&df(o,Mt(c,3))}function yH(o){return o==null?[]:tc(o,Pe(o))}function _H(o){return o==null?[]:tc(o,hn(o))}function Vf(o,c,f){var y=o==null?e:Ar(o,c);return y===e?f:y}function bH(o,c){return o!=null&&lb(o,c,$F)}function Yf(o,c){return o!=null&&lb(o,c,VF)}var xH=tb(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Hl.call(c)),o[c]=f},jf(pn)),wH=tb(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Hl.call(c)),Gt.call(o,c)?o[c].push(f):o[c]=[f]},Mt),vH=Ft(jo);function Pe(o){return fn(o)?__(o):mf(o)}function hn(o){return fn(o)?__(o,!0):tz(o)}function SH(o,c){var f={};return c=Mt(c,3),Jn(o,function(y,b,k){Qn(f,c(y,b,k),y)}),f}function TH(o,c){var f={};return c=Mt(c,3),Jn(o,function(y,b,k){Qn(f,b,c(y,b,k))}),f}var MH=vs(function(o,c,f){ec(o,c,f)}),Vb=vs(function(o,c,f,y){ec(o,c,f,y)}),kH=_i(function(o,c){var f={};if(o==null)return f;var y=!1;c=ue(c,function(k){return k=Zi(k,o),y||(y=k.length>1),k}),ti(o,Of(o),f),y&&(f=En(f,g|_|x,wz));for(var b=c.length;b--;)wf(f,c[b]);return f});function DH(o,c){return Yb(o,gc(Mt(c)))}var CH=_i(function(o,c){return o==null?{}:nz(o,c)});function Yb(o,c){if(o==null)return{};var f=ue(Of(o),function(y){return[y]});return c=Mt(c),L_(o,f,function(y,b){return c(y,b[0])})}function OH(o,c,f){c=Zi(c,o);var y=-1,b=c.length;for(b||(b=1,o=e);++y<b;){var k=o==null?e:o[Un(c[y])];k===e&&(y=b,k=f),o=xi(k)?k.call(o):k}return o}function AH(o,c,f){return o==null?o:Ko(o,c,f)}function EH(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:Ko(o,c,f,y)}var qb=ib(Pe),jb=ib(hn);function RH(o,c,f){var y=Pt(o),b=y||Ji(o)||Ms(o);if(c=Mt(c,4),f==null){var k=o&&o.constructor;b?f=y?new k:[]:he(o)?f=xi(k)?ws(Vl(o)):{}:f={}}return(b?_n:Jn)(o,function(E,R,U){return c(f,E,R,U)}),f}function PH(o,c){return o==null?!0:wf(o,c)}function IH(o,c,f){return o==null?o:U_(o,c,Tf(f))}function LH(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:U_(o,c,Tf(f),y)}function ks(o){return o==null?[]:ef(o,Pe(o))}function NH(o){return o==null?[]:ef(o,hn(o))}function BH(o,c,f){return f===e&&(f=c,c=e),f!==e&&(f=In(f),f=f===f?f:0),c!==e&&(c=In(c),c=c===c?c:0),Or(In(o),c,f)}function FH(o,c,f){return c=wi(c),f===e?(f=c,c=0):f=wi(f),o=In(o),YF(o,c,f)}function zH(o,c,f){if(f&&typeof f!="boolean"&&en(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=wi(o),c===e?(c=o,o=0):c=wi(c)),o>c){var y=o;o=c,c=y}if(f||o%1||c%1){var b=g_();return Ke(o+b*(c-o+Ge("1e-"+((b+"").length-1))),c)}return _f(o,c)}var UH=Ss(function(o,c,f){return c=c.toLowerCase(),o+(f?Gb(c):c)});function Gb(o){return qf(Kt(o).toLowerCase())}function Kb(o){return o=Kt(o),o&&o.replace(Ad,EB).replace(Vd,"")}function HH(o,c,f){o=Kt(o),c=xn(c);var y=o.length;f=f===e?y:Or(Nt(f),0,y);var b=f;return f-=c.length,f>=0&&o.slice(f,b)==c}function WH(o){return o=Kt(o),o&&gd.test(o)?o.replace(ml,RB):o}function $H(o){return o=Kt(o),o&&xd.test(o)?o.replace(Ao,"\\$&"):o}var VH=Ss(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),YH=Ss(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),qH=Z_("toLowerCase");function jH(o,c,f){o=Kt(o),c=Nt(c);var y=c?gs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return ac(Gl(b),f)+o+ac(jl(b),f)}function GH(o,c,f){o=Kt(o),c=Nt(c);var y=c?gs(o):0;return c&&y<c?o+ac(c-y,f):o}function KH(o,c,f){o=Kt(o),c=Nt(c);var y=c?gs(o):0;return c&&y<c?ac(c-y,f)+o:o}function XH(o,c,f){return f||c==null?c=0:c&&(c=+c),rF(Kt(o).replace(Eo,""),c||0)}function ZH(o,c,f){return(f?en(o,c,f):c===e)?c=1:c=Nt(c),bf(Kt(o),c)}function QH(){var o=arguments,c=Kt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var JH=Ss(function(o,c,f){return o+(f?"_":"")+c.toLowerCase()});function tW(o,c,f){return f&&typeof f!="number"&&en(o,c,f)&&(c=f=e),f=f===e?L:f>>>0,f?(o=Kt(o),o&&(typeof c=="string"||c!=null&&!Wf(c))&&(c=xn(c),!c&&ms(o))?Qi(Fn(o),0,f):o.split(c,f)):[]}var eW=Ss(function(o,c,f){return o+(f?" ":"")+qf(c)});function nW(o,c,f){return o=Kt(o),f=f==null?0:Or(Nt(f),0,o.length),c=xn(c),o.slice(f,f+c.length)==c}function iW(o,c,f){var y=T.templateSettings;f&&en(o,c,f)&&(c=e),o=Kt(o),c=$f({},c,y,rb);var b=$f({},c.imports,y.imports,rb),k=Pe(b),E=ef(b,k);_n(k,function(Tt){if(yl.test(Tt))throw new At(u)});var R,U,Z=0,Q=c.interpolate||ss,nt="__p += '",ft=rf((c.escape||ss).source+"|"+Q.source+"|"+(Q===Oo?$i:ss).source+"|"+(c.evaluate||ss).source+"|$","g"),yt="//# sourceURL="+(Gt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jd+"]")+`
10
+ `;o.replace(ft,function(Tt,zt,Ht,vn,nn,Sn){return Ht||(Ht=vn),nt+=o.slice(Z,Sn).replace(Ed,PB),zt&&(R=!0,nt+=`' +
11
+ __e(`+zt+`) +
12
+ '`),nn&&(U=!0,nt+=`';
13
+ `+nn+`;
14
+ __p += '`),Ht&&(nt+=`' +
15
+ ((__t = (`+Ht+`)) == null ? '' : __t) +
16
+ '`),Z=Sn+Tt.length,Tt}),nt+=`';
17
+ `;var Dt=Gt.call(c,"variable")&&c.variable;if(!Dt)nt=`with (obj) {
18
+ `+nt+`
19
+ }
20
+ `;else if(yl.test(Dt))throw new At(l);nt=(U?nt.replace(ko,""):nt).replace(Do,"$1").replace(Co,"$1;"),nt="function("+(Dt||"obj")+`) {
21
+ `+(Dt?"":`obj || (obj = {});
22
+ `)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(U?`, __j = Array.prototype.join;
23
+ function print() { __p += __j.call(arguments, '') }
24
+ `:`;
25
+ `)+nt+`return __p
26
+ }`;var Bt=Zb(function(){return Vt(k,yt+"return "+nt).apply(e,E)});if(Bt.source=nt,Hf(Bt))throw Bt;return Bt}function rW(o){return Kt(o).toLowerCase()}function sW(o){return Kt(o).toUpperCase()}function oW(o,c,f){if(o=Kt(o),o&&(f||c===e))return s_(o);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=Fn(c),k=o_(y,b),E=a_(y,b)+1;return Qi(y,k,E).join("")}function aW(o,c,f){if(o=Kt(o),o&&(f||c===e))return o.slice(0,c_(o)+1);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=a_(y,Fn(c))+1;return Qi(y,0,b).join("")}function lW(o,c,f){if(o=Kt(o),o&&(f||c===e))return o.replace(Eo,"");if(!o||!(c=xn(c)))return o;var y=Fn(o),b=o_(y,Fn(c));return Qi(y,b).join("")}function cW(o,c){var f=N,y=W;if(he(c)){var b="separator"in c?c.separator:b;f="length"in c?Nt(c.length):f,y="omission"in c?xn(c.omission):y}o=Kt(o);var k=o.length;if(ms(o)){var E=Fn(o);k=E.length}if(f>=k)return o;var R=f-gs(y);if(R<1)return y;var U=E?Qi(E,0,R).join(""):o.slice(0,R);if(b===e)return U+y;if(E&&(R+=U.length-R),Wf(b)){if(o.slice(R).search(b)){var Z,Q=U;for(b.global||(b=rf(b.source,Kt(_l.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var nt=Z.index;U=U.slice(0,nt===e?R:nt)}}else if(o.indexOf(xn(b),R)!=R){var ft=U.lastIndexOf(b);ft>-1&&(U=U.slice(0,ft))}return U+y}function uW(o){return o=Kt(o),o&&md.test(o)?o.replace(Wi,UB):o}var dW=Ss(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),qf=Z_("toUpperCase");function Xb(o,c,f){return o=Kt(o),c=f?e:c,c===e?LB(o)?$B(o):kB(o):o.match(c)||[]}var Zb=Ft(function(o,c){try{return yn(o,e,c)}catch(f){return Hf(f)?f:new At(f)}}),fW=_i(function(o,c){return _n(c,function(f){f=Un(f),Qn(o,f,zf(o[f],o))}),o});function hW(o){var c=o==null?0:o.length,f=Mt();return o=c?ue(o,function(y){if(typeof y[1]!="function")throw new On(a);return[f(y[0]),y[1]]}):[],Ft(function(y){for(var b=-1;++b<c;){var k=o[b];if(yn(k[0],this,y))return yn(k[1],this,y)}})}function pW(o){return UF(En(o,g))}function jf(o){return function(){return o}}function mW(o,c){return o==null||o!==o?c:o}var gW=J_(),yW=J_(!0);function pn(o){return o}function Gf(o){return O_(typeof o=="function"?o:En(o,g))}function _W(o){return E_(En(o,g))}function bW(o,c){return R_(o,En(c,g))}var xW=Ft(function(o,c){return function(f){return jo(f,o,c)}}),wW=Ft(function(o,c){return function(f){return jo(o,f,c)}});function Kf(o,c,f){var y=Pe(c),b=tc(c,y);f==null&&!(he(c)&&(b.length||!y.length))&&(f=c,c=o,o=this,b=tc(c,Pe(c)));var k=!(he(f)&&"chain"in f)||!!f.chain,E=xi(o);return _n(b,function(R){var U=c[R];o[R]=U,E&&(o.prototype[R]=function(){var Z=this.__chain__;if(k||Z){var Q=o(this.__wrapped__),nt=Q.__actions__=dn(this.__actions__);return nt.push({func:U,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return U.apply(o,qi([this.value()],arguments))})}),o}function vW(){return ce._===this&&(ce._=KB),this}function Xf(){}function SW(o){return o=Nt(o),Ft(function(c){return P_(c,o)})}var TW=kf(ue),MW=kf(t_),kW=kf(Xd);function Qb(o){return Pf(o)?Zd(Un(o)):iz(o)}function DW(o){return function(c){return o==null?e:Ar(o,c)}}var CW=eb(),OW=eb(!0);function Zf(){return[]}function Qf(){return!1}function AW(){return{}}function EW(){return""}function RW(){return!0}function PW(o,c){if(o=Nt(o),o<1||o>at)return[];var f=L,y=Ke(o,L);c=Mt(c),o-=L;for(var b=tf(y,c);++f<o;)c(f);return b}function IW(o){return Pt(o)?ue(o,Un):wn(o)?[o]:dn(yb(Kt(o)))}function LW(o){var c=++jB;return Kt(o)+c}var NW=oc(function(o,c){return o+c},0),BW=Df("ceil"),FW=oc(function(o,c){return o/c},1),zW=Df("floor");function UW(o){return o&&o.length?Jl(o,pn,ff):e}function HW(o,c){return o&&o.length?Jl(o,Mt(c,2),ff):e}function WW(o){return i_(o,pn)}function $W(o,c){return i_(o,Mt(c,2))}function VW(o){return o&&o.length?Jl(o,pn,gf):e}function YW(o,c){return o&&o.length?Jl(o,Mt(c,2),gf):e}var qW=oc(function(o,c){return o*c},1),jW=Df("round"),GW=oc(function(o,c){return o-c},0);function KW(o){return o&&o.length?Jd(o,pn):0}function XW(o,c){return o&&o.length?Jd(o,Mt(c,2)):0}return T.after=b5,T.ary=Cb,T.assign=oH,T.assignIn=Wb,T.assignInWith=$b,T.assignWith=$f,T.at=aH,T.before=Ob,T.bind=zf,T.bindAll=fW,T.bindKey=Ab,T.castArray=E5,T.chain=Mb,T.chunk=Uz,T.compact=Hz,T.concat=Wz,T.cond=hW,T.conforms=pW,T.constant=jf,T.countBy=XU,T.create=lH,T.curry=Eb,T.curryRight=Rb,T.debounce=Pb,T.defaults=cH,T.defaultsDeep=uH,T.defer=x5,T.delay=w5,T.difference=$z,T.differenceBy=Vz,T.differenceWith=Yz,T.drop=qz,T.dropRight=jz,T.dropRightWhile=Gz,T.dropWhile=Kz,T.fill=Xz,T.filter=QU,T.flatMap=e5,T.flatMapDeep=n5,T.flatMapDepth=i5,T.flatten=wb,T.flattenDeep=Zz,T.flattenDepth=Qz,T.flip=v5,T.flow=gW,T.flowRight=yW,T.fromPairs=Jz,T.functions=yH,T.functionsIn=_H,T.groupBy=r5,T.initial=eU,T.intersection=nU,T.intersectionBy=iU,T.intersectionWith=rU,T.invert=xH,T.invertBy=wH,T.invokeMap=o5,T.iteratee=Gf,T.keyBy=a5,T.keys=Pe,T.keysIn=hn,T.map=hc,T.mapKeys=SH,T.mapValues=TH,T.matches=_W,T.matchesProperty=bW,T.memoize=mc,T.merge=MH,T.mergeWith=Vb,T.method=xW,T.methodOf=wW,T.mixin=Kf,T.negate=gc,T.nthArg=SW,T.omit=kH,T.omitBy=DH,T.once=S5,T.orderBy=l5,T.over=TW,T.overArgs=T5,T.overEvery=MW,T.overSome=kW,T.partial=Uf,T.partialRight=Ib,T.partition=c5,T.pick=CH,T.pickBy=Yb,T.property=Qb,T.propertyOf=DW,T.pull=lU,T.pullAll=Sb,T.pullAllBy=cU,T.pullAllWith=uU,T.pullAt=dU,T.range=CW,T.rangeRight=OW,T.rearg=M5,T.reject=f5,T.remove=fU,T.rest=k5,T.reverse=Bf,T.sampleSize=p5,T.set=AH,T.setWith=EH,T.shuffle=m5,T.slice=hU,T.sortBy=_5,T.sortedUniq=xU,T.sortedUniqBy=wU,T.split=tW,T.spread=D5,T.tail=vU,T.take=SU,T.takeRight=TU,T.takeRightWhile=MU,T.takeWhile=kU,T.tap=HU,T.throttle=C5,T.thru=fc,T.toArray=zb,T.toPairs=qb,T.toPairsIn=jb,T.toPath=IW,T.toPlainObject=Hb,T.transform=RH,T.unary=O5,T.union=DU,T.unionBy=CU,T.unionWith=OU,T.uniq=AU,T.uniqBy=EU,T.uniqWith=RU,T.unset=PH,T.unzip=Ff,T.unzipWith=Tb,T.update=IH,T.updateWith=LH,T.values=ks,T.valuesIn=NH,T.without=PU,T.words=Xb,T.wrap=A5,T.xor=IU,T.xorBy=LU,T.xorWith=NU,T.zip=BU,T.zipObject=FU,T.zipObjectDeep=zU,T.zipWith=UU,T.entries=qb,T.entriesIn=jb,T.extend=Wb,T.extendWith=$b,Kf(T,T),T.add=NW,T.attempt=Zb,T.camelCase=UH,T.capitalize=Gb,T.ceil=BW,T.clamp=BH,T.clone=R5,T.cloneDeep=I5,T.cloneDeepWith=L5,T.cloneWith=P5,T.conformsTo=N5,T.deburr=Kb,T.defaultTo=mW,T.divide=FW,T.endsWith=HH,T.eq=Hn,T.escape=WH,T.escapeRegExp=$H,T.every=ZU,T.find=JU,T.findIndex=bb,T.findKey=dH,T.findLast=t5,T.findLastIndex=xb,T.findLastKey=fH,T.floor=zW,T.forEach=kb,T.forEachRight=Db,T.forIn=hH,T.forInRight=pH,T.forOwn=mH,T.forOwnRight=gH,T.get=Vf,T.gt=B5,T.gte=F5,T.has=bH,T.hasIn=Yf,T.head=vb,T.identity=pn,T.includes=s5,T.indexOf=tU,T.inRange=FH,T.invoke=vH,T.isArguments=Pr,T.isArray=Pt,T.isArrayBuffer=z5,T.isArrayLike=fn,T.isArrayLikeObject=be,T.isBoolean=U5,T.isBuffer=Ji,T.isDate=H5,T.isElement=W5,T.isEmpty=$5,T.isEqual=V5,T.isEqualWith=Y5,T.isError=Hf,T.isFinite=q5,T.isFunction=xi,T.isInteger=Lb,T.isLength=yc,T.isMap=Nb,T.isMatch=j5,T.isMatchWith=G5,T.isNaN=K5,T.isNative=X5,T.isNil=Q5,T.isNull=Z5,T.isNumber=Bb,T.isObject=he,T.isObjectLike=ge,T.isPlainObject=Jo,T.isRegExp=Wf,T.isSafeInteger=J5,T.isSet=Fb,T.isString=_c,T.isSymbol=wn,T.isTypedArray=Ms,T.isUndefined=tH,T.isWeakMap=eH,T.isWeakSet=nH,T.join=sU,T.kebabCase=VH,T.last=Pn,T.lastIndexOf=oU,T.lowerCase=YH,T.lowerFirst=qH,T.lt=iH,T.lte=rH,T.max=UW,T.maxBy=HW,T.mean=WW,T.meanBy=$W,T.min=VW,T.minBy=YW,T.stubArray=Zf,T.stubFalse=Qf,T.stubObject=AW,T.stubString=EW,T.stubTrue=RW,T.multiply=qW,T.nth=aU,T.noConflict=vW,T.noop=Xf,T.now=pc,T.pad=jH,T.padEnd=GH,T.padStart=KH,T.parseInt=XH,T.random=zH,T.reduce=u5,T.reduceRight=d5,T.repeat=ZH,T.replace=QH,T.result=OH,T.round=jW,T.runInContext=F,T.sample=h5,T.size=g5,T.snakeCase=JH,T.some=y5,T.sortedIndex=pU,T.sortedIndexBy=mU,T.sortedIndexOf=gU,T.sortedLastIndex=yU,T.sortedLastIndexBy=_U,T.sortedLastIndexOf=bU,T.startCase=eW,T.startsWith=nW,T.subtract=GW,T.sum=KW,T.sumBy=XW,T.template=iW,T.times=PW,T.toFinite=wi,T.toInteger=Nt,T.toLength=Ub,T.toLower=rW,T.toNumber=In,T.toSafeInteger=sH,T.toString=Kt,T.toUpper=sW,T.trim=oW,T.trimEnd=aW,T.trimStart=lW,T.truncate=cW,T.unescape=uW,T.uniqueId=LW,T.upperCase=dW,T.upperFirst=qf,T.each=kb,T.eachRight=Db,T.first=vb,Kf(T,(function(){var o={};return Jn(T,function(c,f){Gt.call(T.prototype,f)||(o[f]=c)}),o})(),{chain:!1}),T.VERSION=i,_n(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),_n(["drop","take"],function(o,c){Ut.prototype[o]=function(f){f=f===e?1:De(Nt(f),0);var y=this.__filtered__&&!c?new Ut(this):this.clone();return y.__filtered__?y.__takeCount__=Ke(f,y.__takeCount__):y.__views__.push({size:Ke(f,L),type:o+(y.__dir__<0?"Right":"")}),y},Ut.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),_n(["filter","map","takeWhile"],function(o,c){var f=c+1,y=f==ut||f==dt;Ut.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:Mt(b,3),type:f}),k.__filtered__=k.__filtered__||y,k}}),_n(["head","last"],function(o,c){var f="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[f](1).value()[0]}}),_n(["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(pn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Ft(function(o,c){return typeof o=="function"?new Ut(this):this.map(function(f){return jo(f,o,c)})}),Ut.prototype.reject=function(o){return this.filter(gc(Mt(o)))},Ut.prototype.slice=function(o,c){o=Nt(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=Nt(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(L)},Jn(Ut.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=T[y?"take"+(c=="last"?"Right":""):c],k=y||/^find/.test(c);b&&(T.prototype[c]=function(){var E=this.__wrapped__,R=y?[1]:arguments,U=E instanceof Ut,Z=R[0],Q=U||Pt(E),nt=function(zt){var Ht=b.apply(T,qi([zt],R));return y&&ft?Ht[0]:Ht};Q&&f&&typeof Z=="function"&&Z.length!=1&&(U=Q=!1);var ft=this.__chain__,yt=!!this.__actions__.length,Dt=k&&!ft,Bt=U&&!yt;if(!k&&Q){E=Bt?E:new Ut(this);var Tt=o.apply(E,R);return Tt.__actions__.push({func:fc,args:[nt],thisArg:e}),new An(Tt,ft)}return Dt&&Bt?o.apply(this,R):(Tt=this.thru(nt),Dt?y?Tt.value()[0]:Tt.value():Tt)})}),_n(["pop","push","shift","sort","splice","unshift"],function(o){var c=Fl[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var k=this.value();return c.apply(Pt(k)?k:[],b)}return this[f](function(E){return c.apply(Pt(E)?E:[],b)})}}),Jn(Ut.prototype,function(o,c){var f=T[c];if(f){var y=f.name+"";Gt.call(xs,y)||(xs[y]=[]),xs[y].push({name:c,func:f})}}),xs[sc(e,A).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=dF,Ut.prototype.reverse=fF,Ut.prototype.value=hF,T.prototype.at=WU,T.prototype.chain=$U,T.prototype.commit=VU,T.prototype.next=YU,T.prototype.plant=jU,T.prototype.reverse=GU,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=KU,T.prototype.first=T.prototype.head,Uo&&(T.prototype[Uo]=qU),T}),ys=VB();Zn?((Zn.exports=ys)._=ys,hs._=ys):ce._=ys}).call(oB)})(So,So.exports)),So.exports}var Vy=aB(),hl={exports:{}},lB=hl.exports,Yy;function cB(){return Yy||(Yy=1,(function(n,t){(function(e,i){i()})(lB,function(){function e(d,p){return typeof p>"u"?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.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,p,m){var g=new XMLHttpRequest;g.open("GET",d),g.responseType="blob",g.onload=function(){u(g.response,p,m)},g.onerror=function(){console.error("could not download file")},g.send()}function r(d){var p=new XMLHttpRequest;p.open("HEAD",d,!1);try{p.send()}catch{}return 200<=p.status&&299>=p.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(p)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ui=="object"&&Ui.global===Ui?Ui: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,p,m){var g=a.URL||a.webkitURL,_=document.createElement("a");p=p||d.name||"download",_.download=p,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,p,m):s(_,_.target="_blank")):(_.href=g.createObjectURL(d),setTimeout(function(){g.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,p,m){if(p=p||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,m),p);else if(r(d))i(d,p,m);else{var g=document.createElement("a");g.href=d,g.target="_blank",setTimeout(function(){s(g)})}}:function(d,p,m,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),typeof d=="string")return i(d,p,m);var _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||_&&x||l)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var B=S.result;B=w?B:B.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=B:location=B,g=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,A=C.createObjectURL(d);g?g.location=A:location.href=A,g=null,setTimeout(function(){C.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(hl)),hl.exports}var uB=cB(),pl={exports:{}};var dB=pl.exports,qy;function fB(){return qy||(qy=1,(function(n,t){((e,i)=>{n.exports=i()})(dB,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(v){return v.charCodeAt(0)===65279?v.slice(1):v}function p(v){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=I(M);O.chunkSize=parseInt(O.chunkSize),M.step||M.chunk||(O.chunkSize=null),this._handle=new w(O),(this._handle.streamer=this)._config=O}).call(this,v),this.parseChunk=function(M,O){var N=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<N){let G=this._config.newline;G||(W=this._config.quoteChar||'"',G=this._handle.guessLineEndings(M,W)),M=[...M.split(G).slice(N)].join(G)}this.isFirstChunk&&z(this._config.beforeFirstChunk)&&(W=this._config.beforeFirstChunk(M))!==void 0&&(M=W),this.isFirstChunk=!1,this._halted=!1;var N=this._partialLine+M,W=(this._partialLine="",this._handle.parse(N,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(M=W.meta.cursor,N=(this._finished||(this._partialLine=N.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:N});else if(z(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||!N||!z(this._config.complete)||W&&W.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),N||W&&W.meta.paused||this._nextChunk(),W}this._halted=!0},this._sendError=function(M){z(this._config.error)?this._config.error(M):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:M,finished:!1})}}function m(v){var M;(v=v||{}).chunkSize||(v.chunkSize=u.RemoteChunkSize),p.call(this,v),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=$(this._chunkLoaded,this),M.onerror=$(this._chunkError,this)),M.ontimeout=$(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,N=this._config.downloadRequestHeaders;for(O in N)M.setRequestHeader(O,N[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(G){this._chunkError(G.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 g(v){(v=v||{}).chunkSize||(v.chunkSize=u.LocalChunkSize),p.call(this,v);var M,O,N=typeof FileReader<"u";this.stream=function(W){this._input=W,O=W.slice||W.webkitSlice||W.mozSlice,N?((M=new FileReader).onload=$(this._chunkLoaded,this),M.onerror=$(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,G=(this._config.chunkSize&&(G=Math.min(this._start+this._config.chunkSize,this._input.size),W=O.call(W,this._start,G)),M.readAsText(W,this._config.encoding));N||this._chunkLoaded({target:{result:G}})},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 _(v){var M;p.call(this,v=v||{}),this.stream=function(O){return M=O,this._nextChunk()},this._nextChunk=function(){var O,N;if(!this._finished)return O=this._config.chunkSize,M=O?(N=M.substring(0,O),M.substring(O)):(N=M,""),this._finished=!M,this.parseChunk(N)}}function x(v){p.call(this,v=v||{});var M=[],O=!0,N=!1;this.pause=function(){p.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){p.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(){N&&M.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),M.length?this.parseChunk(M.shift()):O=!0},this._streamData=$(function(W){try{M.push(typeof W=="string"?W:W.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(M.shift()))}catch(G){this._streamError(G)}},this),this._streamError=$(function(W){this._streamCleanUp(),this._sendError(W)},this),this._streamEnd=$(function(){this._streamCleanUp(),N=!0,this._streamData("")},this),this._streamCleanUp=$(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function w(v){var M,O,N,W,G=Math.pow(2,53),lt=-G,ut=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ht=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,dt=this,bt=0,at=0,ct=!1,V=!1,L=[],H={data:[],errors:[],meta:{}};function it(rt){return v.skipEmptyLines==="greedy"?rt.join("").trim()==="":rt.length===1&&rt[0].length===0}function st(){if(H&&N&&(tt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),N=!1),v.skipEmptyLines&&(H.data=H.data.filter(function(ot){return!it(ot)})),X()){let ot=function(wt){L.push(wt)};if(H)if(Array.isArray(H.data[0])){for(var rt=0;X()&&rt<H.data.length;rt++)H.data[rt].forEach(ot);H.data.splice(0,1)}else H.data.forEach(ot)}function j(ot,wt){for(var Lt=v.header?{}:[],vt=0;vt<ot.length;vt++){var Ot=vt,kt=ot[vt],kt=((Se,_t)=>(jt=>(v.dynamicTypingFunction&&v.dynamicTyping[jt]===void 0&&(v.dynamicTyping[jt]=v.dynamicTypingFunction(jt)),(v.dynamicTyping[jt]||v.dynamicTyping)===!0))(Se)?_t==="true"||_t==="TRUE"||_t!=="false"&&_t!=="FALSE"&&((jt=>{if(ut.test(jt)&&(jt=parseFloat(jt),lt<jt&&jt<G))return 1})(_t)?parseFloat(_t):ht.test(_t)?new Date(_t):_t===""?null:_t):_t)(Ot=v.header?vt>=L.length?"__parsed_extra":L[vt]:Ot,kt=v.transform?v.transform(kt,Ot):kt);Ot==="__parsed_extra"?(Lt[Ot]=Lt[Ot]||[],Lt[Ot].push(kt)):Lt[Ot]=kt}return v.header&&(vt>L.length?tt("FieldMismatch","TooManyFields","Too many fields: expected "+L.length+" fields but parsed "+vt,at+wt):vt<L.length&&tt("FieldMismatch","TooFewFields","Too few fields: expected "+L.length+" fields but parsed "+vt,at+wt)),Lt}var et;H&&(v.header||v.dynamicTyping||v.transform)&&(et=1,!H.data.length||Array.isArray(H.data[0])?(H.data=H.data.map(j),et=H.data.length):H.data=j(H.data,0),v.header&&H.meta&&(H.meta.fields=L),at+=et)}function X(){return v.header&&L.length===0}function tt(rt,j,et,ot){rt={type:rt,code:j,message:et},ot!==void 0&&(rt.row=ot),H.errors.push(rt)}z(v.step)&&(W=v.step,v.step=function(rt){H=rt,X()?st():(st(),H.data.length!==0&&(bt+=rt.data.length,v.preview&&bt>v.preview?O.abort():(H.data=H.data[0],W(H,dt))))}),this.parse=function(rt,j,et){var ot=v.quoteChar||'"',ot=(v.newline||(v.newline=this.guessLineEndings(rt,ot)),N=!1,v.delimiter?z(v.delimiter)&&(v.delimiter=v.delimiter(rt),H.meta.delimiter=v.delimiter):((ot=((wt,Lt,vt,Ot,kt)=>{var Se,_t,jt,Ae;kt=kt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ee=0;Ee<kt.length;Ee++){for(var oe,cn=kt[Ee],$t=0,Ne=0,ie=0,Te=(jt=void 0,new C({comments:Ot,delimiter:cn,newline:Lt,preview:10}).parse(wt)),Re=0;Re<Te.data.length;Re++)vt&&it(Te.data[Re])?ie++:(oe=Te.data[Re].length,Ne+=oe,jt===void 0?jt=oe:0<oe&&($t+=Math.abs(oe-jt),jt=oe));0<Te.data.length&&(Ne/=Te.data.length-ie),1.99<Ne&&(_t===void 0||$t<_t||$t===_t&&Ae<Ne)&&(_t=$t,Se=cn,Ae=Ne)}return{successful:!!(v.delimiter=Se),bestDelimiter:Se}})(rt,v.newline,v.skipEmptyLines,v.comments,v.delimitersToGuess)).successful?v.delimiter=ot.bestDelimiter:(N=!0,v.delimiter=u.DefaultDelimiter),H.meta.delimiter=v.delimiter),I(v));return ot.header=X(),v.preview&&v.header&&ot.preview++,M=rt,O=new C(ot),H=O.parse(M,j,et),st(),ct?{meta:{paused:!0}}:H||{meta:{paused:!1}}},this.paused=function(){return ct},this.pause=function(){ct=!0,O.abort(),M=z(v.chunk)?"":M.substring(O.getCharIndex())},this.resume=function(){dt.streamer._halted?(ct=!1,dt.streamer.parseChunk(M,!0)):setTimeout(dt.resume,3)},this.aborted=function(){return V},this.abort=function(){V=!0,O.abort(),H.meta.aborted=!0,z(v.complete)&&v.complete(H),M=""},this.guessLineEndings=function(wt,ot){wt=wt.substring(0,1048576);var ot=new RegExp(S(ot)+"([^]*?)"+S(ot),"gm"),et=(wt=wt.replace(ot,"")).split("\r"),ot=wt.split(`
27
+ `),wt=1<ot.length&&ot[0].length<et[0].length;if(et.length===1||wt)return`
28
+ `;for(var Lt=0,vt=0;vt<et.length;vt++)et[vt][0]===`
29
+ `&&Lt++;return Lt>=et.length/2?`\r
30
+ `:"\r"}}function S(v){return v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(v){var M=(v=v||{}).delimiter,O=v.newline,N=v.comments,W=v.step,G=v.preview,lt=v.fastMode,ut=null,ht=!1,dt=v.quoteChar==null?'"':v.quoteChar,bt=dt;if(v.escapeChar!==void 0&&(bt=v.escapeChar),(typeof M!="string"||-1<u.BAD_DELIMITERS.indexOf(M))&&(M=","),N===M)throw new Error("Comment character same as delimiter");N===!0?N="#":(typeof N!="string"||-1<u.BAD_DELIMITERS.indexOf(N))&&(N=!1),O!==`
31
+ `&&O!=="\r"&&O!==`\r
32
+ `&&(O=`
33
+ `);var at=0,ct=!1;this.parse=function(V,L,H){if(typeof V!="string")throw new Error("Input must be a string");var it=V.length,st=M.length,X=O.length,tt=N.length,rt=z(W),j=[],et=[],ot=[],wt=at=0;if(!V)return $t();if(lt||lt!==!1&&V.indexOf(dt)===-1){for(var Lt=V.split(O),vt=0;vt<Lt.length;vt++){if(ot=Lt[vt],at+=ot.length,vt!==Lt.length-1)at+=O.length;else if(H)return $t();if(!N||ot.substring(0,tt)!==N){if(rt){if(j=[],Ae(ot.split(M)),Ne(),ct)return $t()}else Ae(ot.split(M));if(G&&G<=vt)return j=j.slice(0,G),$t(!0)}}return $t()}for(var Ot=V.indexOf(M,at),kt=V.indexOf(O,at),Se=new RegExp(S(bt)+S(dt),"g"),_t=V.indexOf(dt,at);;)if(V[at]===dt)for(_t=at,at++;;){if((_t=V.indexOf(dt,_t+1))===-1)return H||et.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:j.length,index:at}),oe();if(_t===it-1)return oe(V.substring(at,_t).replace(Se,dt));if(dt===bt&&V[_t+1]===bt)_t++;else if(dt===bt||_t===0||V[_t-1]!==bt){Ot!==-1&&Ot<_t+1&&(Ot=V.indexOf(M,_t+1));var jt=Ee((kt=kt!==-1&&kt<_t+1?V.indexOf(O,_t+1):kt)===-1?Ot:Math.min(Ot,kt));if(V.substr(_t+1+jt,st)===M){ot.push(V.substring(at,_t).replace(Se,dt)),V[at=_t+1+jt+st]!==dt&&(_t=V.indexOf(dt,at)),Ot=V.indexOf(M,at),kt=V.indexOf(O,at);break}if(jt=Ee(kt),V.substring(_t+1+jt,_t+1+jt+X)===O){if(ot.push(V.substring(at,_t).replace(Se,dt)),cn(_t+1+jt+X),Ot=V.indexOf(M,at),_t=V.indexOf(dt,at),rt&&(Ne(),ct))return $t();if(G&&j.length>=G)return $t(!0);break}et.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:j.length,index:at}),_t++}}else if(N&&ot.length===0&&V.substring(at,at+tt)===N){if(kt===-1)return $t();at=kt+X,kt=V.indexOf(O,at),Ot=V.indexOf(M,at)}else if(Ot!==-1&&(Ot<kt||kt===-1))ot.push(V.substring(at,Ot)),at=Ot+st,Ot=V.indexOf(M,at);else{if(kt===-1)break;if(ot.push(V.substring(at,kt)),cn(kt+X),rt&&(Ne(),ct))return $t();if(G&&j.length>=G)return $t(!0)}return oe();function Ae(ie){j.push(ie),wt=at}function Ee(ie){var Te=0;return Te=ie!==-1&&(ie=V.substring(_t+1,ie))&&ie.trim()===""?ie.length:Te}function oe(ie){return H||(ie===void 0&&(ie=V.substring(at)),ot.push(ie),at=it,Ae(ot),rt&&Ne()),$t()}function cn(ie){at=ie,Ae(ot),ot=[],kt=V.indexOf(O,at)}function $t(ie){if(v.header&&!L&&j.length&&!ht){var Te=j[0],Re=Object.create(null),gn=new Set(Te);let Hi=!1;for(let Cn=0;Cn<Te.length;Cn++){let je=d(Te[Cn]);if(Re[je=z(v.transformHeader)?v.transformHeader(je,Cn):je]){let Ln,di=Re[je];for(;Ln=je+"_"+di,di++,gn.has(Ln););gn.add(Ln),Te[Cn]=Ln,Re[je]++,Hi=!0,(ut=ut===null?{}:ut)[Ln]=je}else Re[je]=1,Te[Cn]=je;gn.add(je)}Hi&&console.warn("Duplicate headers found and renamed."),ht=!0}return{data:j,errors:et,meta:{delimiter:M,linebreak:O,aborted:ct,truncated:!!ie,cursor:wt+(L||0),renamedHeaders:ut}}}function Ne(){W($t()),j=[],et=[]}},this.abort=function(){ct=!0},this.getCharIndex=function(){return at}}function A(v){var M=v.data,O=a[M.workerId],N=!1;if(M.error)O.userError(M.error,M.file);else if(M.results&&M.results.data){var W={abort:function(){N=!0,B(M.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(z(O.userStep)){for(var G=0;G<M.results.data.length&&(O.userStep({data:M.results.data[G],errors:M.results.errors,meta:M.results.meta},W),!N);G++);delete M.results}else z(O.userChunk)&&(O.userChunk(M.results,W,M.file),delete M.results)}M.finished&&!N&&B(M.workerId,M.results)}function B(v,M){var O=a[v];z(O.userComplete)&&O.userComplete(M),O.terminate(),delete a[v]}function P(){throw new Error("Not implemented.")}function I(v){if(typeof v!="object"||v===null)return v;var M,O=Array.isArray(v)?[]:{};for(M in v)O[M]=I(v[M]);return O}function $(v,M){return function(){v.apply(M,arguments)}}function z(v){return typeof v=="function"}return u.parse=function(v,M){var O=(M=M||{}).dynamicTyping||!1;if(z(O)&&(M.dynamicTypingFunction=O,O={}),M.dynamicTyping=O,M.transform=!!z(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 v=="string"?(v=d(v),O=new(M.download?m:_)(M)):v.readable===!0&&z(v.read)&&z(v.on)?O=new x(M):(i.File&&v instanceof File||v instanceof Object)&&(O=new g(M)),O.stream(v);(O=(()=>{var N;return!!u.WORKERS_SUPPORTED&&(N=(()=>{var W=i.URL||i.webkitURL||null,G=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; ","(",G,")();"],{type:"text/javascript"})))})(),(N=new i.Worker(N)).onmessage=A,N.id=l++,a[N.id]=N)})()).userStep=M.step,O.userChunk=M.chunk,O.userComplete=M.complete,O.userError=M.error,M.step=z(M.step),M.chunk=z(M.chunk),M.complete=z(M.complete),M.error=z(M.error),delete M.worker,O.postMessage({input:v,config:M,workerId:O.id})},u.unparse=function(v,M){var O=!1,N=!0,W=",",G=`\r
34
+ `,lt='"',ut=lt+lt,ht=!1,dt=null,bt=!1,at=((()=>{if(typeof M=="object"){if(typeof M.delimiter!="string"||u.BAD_DELIMITERS.filter(function(L){return M.delimiter.indexOf(L)!==-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"||(ht=M.skipEmptyLines),typeof M.newline=="string"&&(G=M.newline),typeof M.quoteChar=="string"&&(lt=M.quoteChar,ut=lt+lt),typeof M.header=="boolean"&&(N=M.header),Array.isArray(M.columns)){if(M.columns.length===0)throw new Error("Option columns is empty");dt=M.columns}M.escapeChar!==void 0&&(ut=M.escapeChar+lt),M.escapeFormulae instanceof RegExp?bt=M.escapeFormulae:typeof M.escapeFormulae=="boolean"&&M.escapeFormulae&&(bt=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(lt),"g"));if(typeof v=="string"&&(v=JSON.parse(v)),Array.isArray(v)){if(!v.length||Array.isArray(v[0]))return ct(null,v,ht);if(typeof v[0]=="object")return ct(dt||Object.keys(v[0]),v,ht)}else if(typeof v=="object")return typeof v.data=="string"&&(v.data=JSON.parse(v.data)),Array.isArray(v.data)&&(v.fields||(v.fields=v.meta&&v.meta.fields||dt),v.fields||(v.fields=Array.isArray(v.data[0])?v.fields:typeof v.data[0]=="object"?Object.keys(v.data[0]):[]),Array.isArray(v.data[0])||typeof v.data[0]=="object"||(v.data=[v.data])),ct(v.fields||[],v.data||[],ht);throw new Error("Unable to serialize unrecognized input");function ct(L,H,it){var st="",X=(typeof L=="string"&&(L=JSON.parse(L)),typeof H=="string"&&(H=JSON.parse(H)),Array.isArray(L)&&0<L.length),tt=!Array.isArray(H[0]);if(X&&N){for(var rt=0;rt<L.length;rt++)0<rt&&(st+=W),st+=V(L[rt],rt);0<H.length&&(st+=G)}for(var j=0;j<H.length;j++){var et=(X?L:H[j]).length,ot=!1,wt=X?Object.keys(H[j]).length===0:H[j].length===0;if(it&&!X&&(ot=it==="greedy"?H[j].join("").trim()==="":H[j].length===1&&H[j][0].length===0),it==="greedy"&&X){for(var Lt=[],vt=0;vt<et;vt++){var Ot=tt?L[vt]:vt;Lt.push(H[j][Ot])}ot=Lt.join("").trim()===""}if(!ot){for(var kt=0;kt<et;kt++){0<kt&&!wt&&(st+=W);var Se=X&&tt?L[kt]:kt;st+=V(H[j][Se],kt)}j<H.length-1&&(!it||0<et&&!wt)&&(st+=G)}}return st}function V(L,H){var it,st,X;return L==null?"":L.constructor===Date?isNaN(L.getTime())?"":L.toISOString():(X=!1,bt&&typeof L=="string"&&bt.test(L)&&(L="'"+L,X=!0),st=(it=L.toString()).replace(at,ut),(X=X||O===!0||typeof O=="function"&&O(L,H)||Array.isArray(O)&&O[H]||((tt,rt)=>{for(var j=0;j<rt.length;j++)if(-1<tt.indexOf(rt[j]))return!0;return!1})(st,u.BAD_DELIMITERS)||-1<st.indexOf(W)||-1<it.indexOf(lt)||st.charAt(0)===" "||st.charAt(st.length-1)===" ")?lt+st+lt:st)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
35
+ `,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=C,u.ParserHandle=w,u.NetworkStreamer=m,u.FileStreamer=g,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(v){v=v.data,u.WORKER_ID===void 0&&v&&(u.WORKER_ID=v.workerId),typeof v.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(v.input,v.config),finished:!0}):(i.File&&v.input instanceof File||v.input instanceof Object)&&(v=u.parse(v.input,v.config))&&i.postMessage({workerId:u.WORKER_ID,results:v,finished:!0})}),(m.prototype=Object.create(p.prototype)).constructor=m,(g.prototype=Object.create(p.prototype)).constructor=g,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(p.prototype)).constructor=x,u})})(pl)),pl.exports}var hB=fB();const pB=["id"],mB=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,r=h.computed(()=>`export_${new Date().getTime()}`),s=h.computed(()=>{const p=u();return p.length?p:null}),a=()=>{const p=i.labels;if(typeof i.fields!==yr.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof p===yr.Object?m=>Vy.mapKeys(m,(g,_)=>p[_]||_):m=>m},l=()=>{const p=i.fields;if(typeof i.fields!==yr.Object&&!Array.isArray(p))throw new Error("Fields needs to be an array of strings.");return Array.isArray(p)?m=>Vy.pick(m,p):m=>m},u=()=>{if(typeof i.fields===yr.Undefined&&typeof i.labels===yr.Undefined)return i.data;const p=a(),m=l();return i.data.map(g=>p(m(g)))},d=()=>{if(!s?.value){console.warn("No data to export");return}e("export-started",s.value);let p=hB.unparse(s.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(p="SEP="+i.delimiter+`\r
36
+ `+p),i.encoding==="utf-8"&&(p="\uFEFF"+p),e("export-finished",i.filename),!i.testing){const m=new Blob([p],{type:"text/csv;charset="+i.encoding});uB.saveAs(m,i.filename)}};return(p,m)=>(h.openBlock(),h.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[h.renderSlot(p.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,pB))}}),gB=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,r)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(mB,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),yB={class:"kong-ui-public-csv-export-modal"},_B={key:0,class:"selected-range"},bB={key:4,class:"text-muted",tag:"span"},jy=3,xB=h.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=xt.useI18n(),i=n,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=h.ref(1),l=h.computed(()=>g.value.rows.length),u=h.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=h.computed(()=>i.exportState.status!=="success"?"":xt.useChartSelectedRange(h.toRef(i.exportState,"chartData"))),p=h.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(jy,l.value),rowsTotal:l.value,plural:l.value===1?"":"s"})),m=()=>{r("closeModal")},g=h.computed(()=>{if(i.exportState.status!=="success"||!u.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const x=i.exportState.chartData,w=x.data.some(I=>I.timestamp!==x.data[0].timestamp),S=x.data.map(I=>{const $=new Date(I.timestamp);return{...Object.keys(I.event).reduce((v,M)=>{if(M in x.meta.display){const O=I.event[M],N=x.meta.display[M];v[M]=O&&N&&N[O].name||I.event[M]}else v[M]=I.event[M];return v},{}),...w?{timestamp:$u($,"yyyy-MM-dd HH:mm:ss"),tzOffset:$u($,"XXX")}:{}}});let C=[];w&&(C=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const A="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},B=[...C,...Object.keys(A).map(I=>({label:e.t(`chartLabels.${I}`),key:I})),...i.exportState.chartData.meta.metric_names.map(I=>({label:e.t(`chartLabels.${I}`),key:I}))],P=B.reduce((I,$)=>(I[$.key]=$.label,I),{});return{headers:B,csvHeaders:P,rows:S}}),_=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=g.value;return{total:Number(x.length)||0,data:x.slice(0,jy)}};return h.watch(g,()=>{a.value++}),(x,w)=>{const S=h.resolveComponent("KSkeleton"),C=h.resolveComponent("KEmptyState"),A=h.resolveComponent("KTableData"),B=h.resolveComponent("KTooltip"),P=h.resolveComponent("KButton"),I=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",yB,[h.createVNode(I,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:m,onKeyup:h.withKeys(m,["esc"])},{default:h.withCtx(()=>[h.createElementVNode("div",null,[n.exportState.status==="success"&&u.value?(h.openBlock(),h.createElementBlock("div",_B,[h.createElementVNode("p",null,h.toDisplayString(n.modalDescription?n.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(d.value),1)])):h.createCommentVNode("",!0),n.exportState.status==="loading"?(h.openBlock(),h.createBlock(S,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(h.openBlock(),h.createBlock(A,{key:2,class:"vitals-table",fetcher:_,"fetcher-cache-key":String(a.value),headers:g.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":h.withCtx(()=>[h.createVNode(C,{"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),default:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(h.openBlock(),h.createBlock(C,{key:3,"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.dataError")),1)]),_:1})):h.createCommentVNode("",!0),n.exportState.status==="success"&&u.value?(h.openBlock(),h.createElementBlock("div",bB,[h.createTextVNode(h.toDisplayString(p.value)+" ",1),h.createVNode(B,{class:"preview-tooltip",placement:"right",text:h.unref(e).t("csvExport.maximumRecordAmount",{value:h.unref(1e3)})},{default:h.withCtx(()=>[h.createVNode(h.unref(de.InfoIcon),{color:`var(--kui-color-text-neutral, ${h.unref(Cc)})`,size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["color","size"])]),_:1},8,["text"])])):h.createCommentVNode("",!0)])]),"footer-actions":h.withCtx(()=>[h.createVNode(P,{appearance:"tertiary",class:"cancel-btn",onClick:m},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(gB,{class:"vitals-report-export-button",filename:s,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(P,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!u.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});Yt.AnalyticsChart=mN,Yt.ChartLegendPosition=Ie,Yt.CsvExportModal=xB,Yt.DECIMAL_DISPLAY=fP,Yt.FONT_SIZE_REGULAR=f0,Yt.FONT_SIZE_SMALL=d0,Yt.MAX_LABEL_LENGTH=Ja,Yt.SimpleChart=EN,Yt.SparklineChart=sB,Yt.TopNTable=eB,Yt.ValidType=yr,Yt.chartTypes=p2,Yt.exploreResultToScatterData=P0,Yt.handleQueryError=s2,Yt.isCancellationError=E0,Yt.isScatterChartData=Ku,Yt.lookupStatusCodeColor=p0,Yt.requestsToScatterData=d2,Yt.simpleChartMetricDisplay=h2,Yt.simpleChartTypes=m2,Yt.statusCodeBadgeBackgroundColor=mP,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})}));