@kong-ui-public/analytics-utilities 12.1.4 → 12.1.5-pr.2672.d176b7586.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/package.json +1 -1
  2. package/dist/types/constants.d.ts +0 -4
  3. package/dist/types/constants.d.ts.map +0 -1
  4. package/dist/types/dashboardSchema.v2.d.ts +0 -3243
  5. package/dist/types/dashboardSchema.v2.d.ts.map +0 -1
  6. package/dist/types/filters.d.ts +0 -3
  7. package/dist/types/filters.d.ts.map +0 -1
  8. package/dist/types/format.d.ts +0 -34
  9. package/dist/types/format.d.ts.map +0 -1
  10. package/dist/types/granularity.d.ts +0 -27
  11. package/dist/types/granularity.d.ts.map +0 -1
  12. package/dist/types/index.d.ts +0 -10
  13. package/dist/types/index.d.ts.map +0 -1
  14. package/dist/types/queryTime.d.ts +0 -36
  15. package/dist/types/queryTime.d.ts.map +0 -1
  16. package/dist/types/specUtils.d.ts +0 -3
  17. package/dist/types/specUtils.d.ts.map +0 -1
  18. package/dist/types/timeframes.d.ts +0 -33
  19. package/dist/types/timeframes.d.ts.map +0 -1
  20. package/dist/types/types/analytics-config.d.ts +0 -23
  21. package/dist/types/types/analytics-config.d.ts.map +0 -1
  22. package/dist/types/types/chart-types.d.ts +0 -3
  23. package/dist/types/types/chart-types.d.ts.map +0 -1
  24. package/dist/types/types/country-codes.d.ts +0 -745
  25. package/dist/types/types/country-codes.d.ts.map +0 -1
  26. package/dist/types/types/datepicker-selection.d.ts +0 -6
  27. package/dist/types/types/datepicker-selection.d.ts.map +0 -1
  28. package/dist/types/types/druid-granularity.d.ts +0 -6
  29. package/dist/types/types/druid-granularity.d.ts.map +0 -1
  30. package/dist/types/types/explore/advanced.d.ts +0 -20
  31. package/dist/types/types/explore/advanced.d.ts.map +0 -1
  32. package/dist/types/types/explore/ai.d.ts +0 -20
  33. package/dist/types/types/explore/ai.d.ts.map +0 -1
  34. package/dist/types/types/explore/all.d.ts +0 -18
  35. package/dist/types/types/explore/all.d.ts.map +0 -1
  36. package/dist/types/types/explore/basic.d.ts +0 -31
  37. package/dist/types/types/explore/basic.d.ts.map +0 -1
  38. package/dist/types/types/explore/common.d.ts +0 -34
  39. package/dist/types/types/explore/common.d.ts.map +0 -1
  40. package/dist/types/types/explore/index.d.ts +0 -8
  41. package/dist/types/types/explore/index.d.ts.map +0 -1
  42. package/dist/types/types/explore/requests.d.ts +0 -57
  43. package/dist/types/types/explore/requests.d.ts.map +0 -1
  44. package/dist/types/types/explore/result.d.ts +0 -48
  45. package/dist/types/types/explore/result.d.ts.map +0 -1
  46. package/dist/types/types/explore/util.d.ts +0 -8
  47. package/dist/types/types/explore/util.d.ts.map +0 -1
  48. package/dist/types/types/index.d.ts +0 -14
  49. package/dist/types/types/index.d.ts.map +0 -1
  50. package/dist/types/types/query-bridge.d.ts +0 -29
  51. package/dist/types/types/query-bridge.d.ts.map +0 -1
  52. package/dist/types/types/query-time.d.ts +0 -13
  53. package/dist/types/types/query-time.d.ts.map +0 -1
  54. package/dist/types/types/request-export.d.ts +0 -11
  55. package/dist/types/types/request-export.d.ts.map +0 -1
  56. package/dist/types/types/time-period.d.ts +0 -9
  57. package/dist/types/types/time-period.d.ts.map +0 -1
  58. package/dist/types/types/timeframe-keys.d.ts +0 -21
  59. package/dist/types/types/timeframe-keys.d.ts.map +0 -1
  60. package/dist/types/types/timeframe-options.d.ts +0 -18
  61. package/dist/types/types/timeframe-options.d.ts.map +0 -1
  62. package/dist/types/types/timeframe.d.ts +0 -17
  63. package/dist/types/types/timeframe.d.ts.map +0 -1
  64. package/dist/types/utils/GeoLookup.d.ts +0 -4
  65. package/dist/types/utils/GeoLookup.d.ts.map +0 -1
  66. package/dist/types/utils/SeedRandom.d.ts +0 -6
  67. package/dist/types/utils/SeedRandom.d.ts.map +0 -1
  68. package/dist/types/utils/chartDataGenerator.d.ts +0 -9
  69. package/dist/types/utils/chartDataGenerator.d.ts.map +0 -1
  70. package/dist/types/utils/formatUnit.d.ts +0 -21
  71. package/dist/types/utils/formatUnit.d.ts.map +0 -1
  72. package/dist/types/utils/helpers.d.ts +0 -2
  73. package/dist/types/utils/helpers.d.ts.map +0 -1
  74. package/dist/types/utils/index.d.ts +0 -6
  75. package/dist/types/utils/index.d.ts.map +0 -1
  76. package/dist/vitals-utilities.cjs +0 -2
  77. package/dist/vitals-utilities.cjs.map +0 -1
  78. package/dist/vitals-utilities.es.js +0 -4039
  79. package/dist/vitals-utilities.es.js.map +0 -1
  80. package/dist/vitals-utilities.umd.js +0 -2
  81. package/dist/vitals-utilities.umd.js.map +0 -1
@@ -1,4039 +0,0 @@
1
- var Jr = Object.defineProperty;
2
- var ea = (e, t, n) => t in e ? Jr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var T = (e, t, n) => ea(e, typeof t != "symbol" ? t + "" : t, n);
4
- const Ro = 3e4, Co = 1e3, Yo = "analytics-query-provider";
5
- var p = /* @__PURE__ */ ((e) => (e.FIFTEEN_MIN = "15m", e.ONE_HOUR = "1h", e.SIX_HOUR = "6h", e.TWELVE_HOUR = "12h", e.ONE_DAY = "24h", e.SEVEN_DAY = "7d", e.THIRTY_DAY = "30d", e.NINETY_DAY = "90d", e.ONE_HUNDRED_EIGHTY_DAY = "180d", e.ONE_YEAR = "365d", e.CURRENT_WEEK = "current_week", e.CURRENT_MONTH = "current_month", e.CURRENT_QUARTER = "current_quarter", e.CURRENT_YEAR = "current_year", e.PREVIOUS_WEEK = "previous_week", e.PREVIOUS_MONTH = "previous_month", e.PREVIOUS_QUARTER = "previous_quarter", e.PREVIOUS_YEAR = "previous_year", e))(p || {});
6
- const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
7
- "horizontal_bar",
8
- "vertical_bar",
9
- "timeseries_line",
10
- "choropleth_map",
11
- "timeseries_bar",
12
- "donut",
13
- "single_value"
14
- ], ta = ["in", "not_in", "selector"], Ao = ["=", "!="], Fo = ["=", "!=", "<", ">", "<=", ">="], na = ["empty", "not_empty"], Ho = ["starts_with", "ends_with"], Lo = ["absolute", "relative"], on = [
15
- "15m",
16
- "1h",
17
- "6h",
18
- "12h",
19
- "24h",
20
- "7d",
21
- "current_week",
22
- "previous_week",
23
- "30d",
24
- "current_month",
25
- "previous_month"
26
- ], sn = [
27
- "secondly",
28
- "tenSecondly",
29
- "thirtySecondly",
30
- "minutely",
31
- "fiveMinutely",
32
- "tenMinutely",
33
- "thirtyMinutely",
34
- "hourly",
35
- "twoHourly",
36
- "twelveHourly",
37
- "daily",
38
- "weekly",
39
- "trend"
40
- ], oe = (e) => e.filter((t) => t !== "time"), Ze = [
41
- "api",
42
- "api_product",
43
- "api_product_version",
44
- "control_plane",
45
- "control_plane_group",
46
- "data_plane_node",
47
- "gateway_service",
48
- "portal",
49
- "route",
50
- "status_code",
51
- "status_code_grouped",
52
- "time"
53
- ], Me = oe(Ze), un = [
54
- "active_services",
55
- "request_count",
56
- "request_per_minute",
57
- "response_latency_average"
58
- ], cn = [
59
- ...Ze,
60
- "application",
61
- "consumer",
62
- "country_code",
63
- "upstream_status_code",
64
- "upstream_status_code_grouped",
65
- "response_source",
66
- "data_plane_node_version",
67
- "realm"
68
- ], Se = oe(cn), ra = [
69
- ...un,
70
- "response_latency_p99",
71
- "response_latency_p95",
72
- "response_latency_p50",
73
- "upstream_latency_p99",
74
- "upstream_latency_p95",
75
- "upstream_latency_p50",
76
- "upstream_latency_average",
77
- "kong_latency_p99",
78
- "kong_latency_p95",
79
- "kong_latency_p50",
80
- "kong_latency_average",
81
- "response_size_p99",
82
- "response_size_p95",
83
- "response_size_p50",
84
- "response_size_average",
85
- "response_size_sum",
86
- "request_size_p99",
87
- "request_size_p95",
88
- "request_size_p50",
89
- "request_size_average",
90
- "request_size_sum"
91
- ], ln = [
92
- "control_plane",
93
- "control_plane_group",
94
- "gateway_service",
95
- "consumer",
96
- "application",
97
- "route",
98
- "ai_provider",
99
- "ai_response_model",
100
- "ai_request_model",
101
- "llm_cache_status",
102
- "llm_embeddings_provider",
103
- "llm_embeddings_model",
104
- "time",
105
- "realm",
106
- "status_code",
107
- "status_code_grouped",
108
- "ai_plugin"
109
- ], Oe = oe(ln), aa = [
110
- "total_tokens",
111
- "prompt_tokens",
112
- "completion_tokens",
113
- "ai_request_count",
114
- "cost",
115
- "llm_cache_embeddings_latency_average",
116
- "llm_cache_fetch_latency_average",
117
- "llm_latency_average",
118
- "llm_embeddings_tokens",
119
- "llm_embeddings_cost"
120
- ], ia = [
121
- "api",
122
- "api_product",
123
- "api_product_version",
124
- "application",
125
- "auth_type",
126
- "client_ip",
127
- "consumer",
128
- "consumer_group",
129
- "control_plane",
130
- "control_plane_group",
131
- "country_code",
132
- "data_plane_node",
133
- "data_plane_node_version",
134
- "gateway_service",
135
- "header_host",
136
- "header_user_agent",
137
- "http_method",
138
- "portal",
139
- "realm",
140
- "request_id",
141
- "request_uri",
142
- "response_header_content_type",
143
- "response_source",
144
- "route",
145
- "service_port",
146
- "service_protocol",
147
- "sse",
148
- "status_code_grouped",
149
- "time",
150
- "trace_id",
151
- "upstream_uri",
152
- "upstream_status_code_grouped",
153
- "websocket"
154
- ], oa = oe(ia), sa = [
155
- "auth_type",
156
- "client_ip",
157
- "data_plane_node_version",
158
- "header_host",
159
- "header_user_agent",
160
- "http_method",
161
- "request_id",
162
- "request_uri",
163
- "response_header_content_type",
164
- "response_source",
165
- "service_port",
166
- "service_protocol",
167
- "trace_id",
168
- "upstream_uri"
169
- ], Uo = sa, ua = [
170
- "ai_count",
171
- "latencies_response_ms",
172
- "latencies_upstream_ms",
173
- "latencies_kong_gateway_ms",
174
- "request_body_size",
175
- "response_body_size",
176
- "response_header_content_length",
177
- "status_code",
178
- "upstream_status_code"
179
- ], ca = oe(ua), Wo = [
180
- "15M",
181
- "1H",
182
- "6H",
183
- "12H",
184
- "24H",
185
- "7D"
186
- ], qo = ["basic", "api_usage", "llm_usage"], la = {
187
- basic: new Set(Me),
188
- api_usage: new Set(Se),
189
- llm_usage: new Set(Oe)
190
- }, jo = (e, t) => t.filter((n) => la[e].has(n.field)), dn = [
191
- { code: "AF", name: "Afghanistan" },
192
- { code: "AX", name: "Aland Islands" },
193
- { code: "AL", name: "Albania" },
194
- { code: "DZ", name: "Algeria" },
195
- { code: "AS", name: "American Samoa" },
196
- { code: "AD", name: "Andorra" },
197
- { code: "AO", name: "Angola" },
198
- { code: "AI", name: "Anguilla" },
199
- { code: "AQ", name: "Antarctica" },
200
- { code: "AG", name: "Antigua and Barbuda" },
201
- { code: "AR", name: "Argentina" },
202
- { code: "AM", name: "Armenia" },
203
- { code: "AW", name: "Aruba" },
204
- { code: "AU", name: "Australia" },
205
- { code: "AT", name: "Austria" },
206
- { code: "AZ", name: "Azerbaijan" },
207
- { code: "BS", name: "Bahamas" },
208
- { code: "BH", name: "Bahrain" },
209
- { code: "BD", name: "Bangladesh" },
210
- { code: "BB", name: "Barbados" },
211
- { code: "BY", name: "Belarus" },
212
- { code: "BE", name: "Belgium" },
213
- { code: "BZ", name: "Belize" },
214
- { code: "BJ", name: "Benin" },
215
- { code: "BM", name: "Bermuda" },
216
- { code: "BT", name: "Bhutan" },
217
- { code: "BO", name: "Bolivia" },
218
- { code: "BA", name: "Bosnia and Herzegovina" },
219
- { code: "BW", name: "Botswana" },
220
- { code: "BV", name: "Bouvet Island" },
221
- { code: "BR", name: "Brazil" },
222
- { code: "IO", name: "British Indian Ocean Territory" },
223
- { code: "BN", name: "Brunei Darussalam" },
224
- { code: "BG", name: "Bulgaria" },
225
- { code: "BF", name: "Burkina Faso" },
226
- { code: "BI", name: "Burundi" },
227
- { code: "KH", name: "Cambodia" },
228
- { code: "CM", name: "Cameroon" },
229
- { code: "CA", name: "Canada" },
230
- { code: "CV", name: "Cape Verde" },
231
- { code: "KY", name: "Cayman Islands" },
232
- { code: "CF", name: "Central African Republic" },
233
- { code: "TD", name: "Chad" },
234
- { code: "CL", name: "Chile" },
235
- { code: "CN", name: "China" },
236
- { code: "CX", name: "Christmas Island" },
237
- { code: "CC", name: "Cocos (Keeling) Islands" },
238
- { code: "CO", name: "Colombia" },
239
- { code: "KM", name: "Comoros" },
240
- { code: "CG", name: "Congo" },
241
- { code: "CD", name: "Democratic Republic of the Congo" },
242
- { code: "CK", name: "Cook Islands" },
243
- { code: "CR", name: "Costa Rica" },
244
- { code: "CI", name: "Cote d'Ivoire" },
245
- { code: "HR", name: "Croatia" },
246
- { code: "CU", name: "Cuba" },
247
- { code: "CY", name: "Cyprus" },
248
- { code: "CZ", name: "Czech Republic" },
249
- { code: "DK", name: "Denmark" },
250
- { code: "DJ", name: "Djibouti" },
251
- { code: "DM", name: "Dominica" },
252
- { code: "DO", name: "Dominican Republic" },
253
- { code: "EC", name: "Ecuador" },
254
- { code: "EG", name: "Egypt" },
255
- { code: "SV", name: "El Salvador" },
256
- { code: "GQ", name: "Equatorial Guinea" },
257
- { code: "ER", name: "Eritrea" },
258
- { code: "EE", name: "Estonia" },
259
- { code: "ET", name: "Ethiopia" },
260
- { code: "FK", name: "Falkland Islands (Malvinas)" },
261
- { code: "FO", name: "Faroe Islands" },
262
- { code: "FJ", name: "Fiji" },
263
- { code: "FI", name: "Finland" },
264
- { code: "FR", name: "France" },
265
- { code: "GF", name: "French Guiana" },
266
- { code: "PF", name: "French Polynesia" },
267
- { code: "TF", name: "French Southern Territories" },
268
- { code: "GA", name: "Gabon" },
269
- { code: "GM", name: "Gambia" },
270
- { code: "GE", name: "Georgia" },
271
- { code: "DE", name: "Germany" },
272
- { code: "GH", name: "Ghana" },
273
- { code: "GI", name: "Gibraltar" },
274
- { code: "GR", name: "Greece" },
275
- { code: "GL", name: "Greenland" },
276
- { code: "GD", name: "Grenada" },
277
- { code: "GP", name: "Guadeloupe" },
278
- { code: "GU", name: "Guam" },
279
- { code: "GT", name: "Guatemala" },
280
- { code: "GG", name: "Guernsey" },
281
- { code: "GN", name: "Guinea" },
282
- { code: "GW", name: "Guinea-Bissau" },
283
- { code: "GY", name: "Guyana" },
284
- { code: "HT", name: "Haiti" },
285
- { code: "HM", name: "Heard Island and McDonald Islands" },
286
- { code: "VA", name: "The Vatican" },
287
- { code: "HN", name: "Honduras" },
288
- { code: "HK", name: "Hong Kong" },
289
- { code: "HU", name: "Hungary" },
290
- { code: "IS", name: "Iceland" },
291
- { code: "IN", name: "India" },
292
- { code: "ID", name: "Indonesia" },
293
- { code: "IR", name: "Iran" },
294
- { code: "IQ", name: "Iraq" },
295
- { code: "IE", name: "Ireland" },
296
- { code: "IM", name: "Isle of Man" },
297
- { code: "IL", name: "Israel" },
298
- { code: "IT", name: "Italy" },
299
- { code: "JM", name: "Jamaica" },
300
- { code: "JP", name: "Japan" },
301
- { code: "JE", name: "Jersey" },
302
- { code: "JO", name: "Jordan" },
303
- { code: "KZ", name: "Kazakhstan" },
304
- { code: "KE", name: "Kenya" },
305
- { code: "KI", name: "Kiribati" },
306
- { code: "KP", name: "North Korea" },
307
- { code: "KR", name: "South Korea" },
308
- { code: "KW", name: "Kuwait" },
309
- { code: "KG", name: "Kyrgyzstan" },
310
- { code: "LA", name: "Laos" },
311
- { code: "LV", name: "Latvia" },
312
- { code: "LB", name: "Lebanon" },
313
- { code: "LS", name: "Lesotho" },
314
- { code: "LR", name: "Liberia" },
315
- { code: "LY", name: "Libya" },
316
- { code: "LI", name: "Liechtenstein" },
317
- { code: "LT", name: "Lithuania" },
318
- { code: "LU", name: "Luxembourg" },
319
- { code: "MO", name: "Macao" },
320
- { code: "MK", name: "Macedonia" },
321
- { code: "MG", name: "Madagascar" },
322
- { code: "MW", name: "Malawi" },
323
- { code: "MY", name: "Malaysia" },
324
- { code: "MV", name: "Maldives" },
325
- { code: "ML", name: "Mali" },
326
- { code: "MT", name: "Malta" },
327
- { code: "MH", name: "Marshall Islands" },
328
- { code: "MQ", name: "Martinique" },
329
- { code: "MR", name: "Mauritania" },
330
- { code: "MU", name: "Mauritius" },
331
- { code: "YT", name: "Mayotte" },
332
- { code: "MX", name: "Mexico" },
333
- { code: "FM", name: "Micronesia, " },
334
- { code: "MD", name: "Moldova," },
335
- { code: "MC", name: "Monaco" },
336
- { code: "MN", name: "Mongolia" },
337
- { code: "ME", name: "Montenegro" },
338
- { code: "MS", name: "Montserrat" },
339
- { code: "MA", name: "Morocco" },
340
- { code: "MZ", name: "Mozambique" },
341
- { code: "MM", name: "Myanmar" },
342
- { code: "NA", name: "Namibia" },
343
- { code: "NR", name: "Nauru" },
344
- { code: "NP", name: "Nepal" },
345
- { code: "NL", name: "Netherlands" },
346
- { code: "NC", name: "New Caledonia" },
347
- { code: "NZ", name: "New Zealand" },
348
- { code: "NI", name: "Nicaragua" },
349
- { code: "NE", name: "Niger" },
350
- { code: "NG", name: "Nigeria" },
351
- { code: "NU", name: "Niue" },
352
- { code: "NF", name: "Norfolk Island" },
353
- { code: "MP", name: "Northern Mariana Islands" },
354
- { code: "NO", name: "Norway" },
355
- { code: "OM", name: "Oman" },
356
- { code: "PK", name: "Pakistan" },
357
- { code: "PW", name: "Palau" },
358
- { code: "PA", name: "Panama" },
359
- { code: "PG", name: "Papua New Guinea" },
360
- { code: "PY", name: "Paraguay" },
361
- { code: "PE", name: "Peru" },
362
- { code: "PH", name: "Philippines" },
363
- { code: "PN", name: "Pitcairn" },
364
- { code: "PL", name: "Poland" },
365
- { code: "PT", name: "Portugal" },
366
- { code: "PR", name: "Puerto Rico" },
367
- { code: "QA", name: "Qatar" },
368
- { code: "RE", name: "Reunion" },
369
- { code: "RO", name: "Romania" },
370
- { code: "RU", name: "Russia" },
371
- { code: "RW", name: "Rwanda" },
372
- { code: "BL", name: "Saint Barthelemy" },
373
- { code: "SH", name: "Saint Helena" },
374
- { code: "KN", name: "Saint Kitts and Nevis" },
375
- { code: "LC", name: "Saint Lucia" },
376
- { code: "MF", name: "Saint Martin" },
377
- { code: "PM", name: "Saint Pierre and Miquelon" },
378
- { code: "VC", name: "Saint Vincent and the Grenadines" },
379
- { code: "WS", name: "Samoa" },
380
- { code: "SM", name: "San Marino" },
381
- { code: "ST", name: "Sao Tome and Principe" },
382
- { code: "SA", name: "Saudi Arabia" },
383
- { code: "SN", name: "Senegal" },
384
- { code: "RS", name: "Serbia" },
385
- { code: "SC", name: "Seychelles" },
386
- { code: "SL", name: "Sierra Leone" },
387
- { code: "SG", name: "Singapore" },
388
- { code: "SX", name: "Sint Maarten" },
389
- { code: "SK", name: "Slovakia" },
390
- { code: "SI", name: "Slovenia" },
391
- { code: "SB", name: "Solomon Islands" },
392
- { code: "SO", name: "Somalia" },
393
- { code: "ZA", name: "South Africa" },
394
- { code: "GS", name: "South Georgia and the South Sandwich Islands" },
395
- { code: "SS", name: "South Sudan" },
396
- { code: "ES", name: "Spain" },
397
- { code: "LK", name: "Sri Lanka" },
398
- { code: "SD", name: "Sudan" },
399
- { code: "SR", name: "Suriname" },
400
- { code: "SJ", name: "Svalbard and Jan Mayen" },
401
- { code: "SZ", name: "Swaziland" },
402
- { code: "SE", name: "Sweden" },
403
- { code: "CH", name: "Switzerland" },
404
- { code: "SY", name: "Syria" },
405
- { code: "TW", name: "Taiwan" },
406
- { code: "TJ", name: "Tajikistan" },
407
- { code: "TZ", name: "Tanzania" },
408
- { code: "TH", name: "Thailand" },
409
- { code: "TL", name: "Timor-Leste" },
410
- { code: "TG", name: "Togo" },
411
- { code: "TK", name: "Tokelau" },
412
- { code: "TO", name: "Tonga" },
413
- { code: "TT", name: "Trinidad and Tobago" },
414
- { code: "TN", name: "Tunisia" },
415
- { code: "TR", name: "Turkey" },
416
- { code: "TM", name: "Turkmenistan" },
417
- { code: "TC", name: "Turks and Caicos Islands" },
418
- { code: "TV", name: "Tuvalu" },
419
- { code: "UG", name: "Uganda" },
420
- { code: "UA", name: "Ukraine" },
421
- { code: "AE", name: "United Arab Emirates" },
422
- { code: "GB", name: "United Kingdom" },
423
- { code: "US", name: "United States" },
424
- { code: "UM", name: "United States Minor Outlying Islands" },
425
- { code: "UY", name: "Uruguay" },
426
- { code: "UZ", name: "Uzbekistan" },
427
- { code: "VU", name: "Vanuatu" },
428
- { code: "VE", name: "Venezuela" },
429
- { code: "VN", name: "Vietnam" },
430
- { code: "VG", name: "British Virgin Islands" },
431
- { code: "VI", name: "U.S. Virgin Islands" },
432
- { code: "WF", name: "Wallis and Futuna" },
433
- { code: "EH", name: "Western Sahara" },
434
- { code: "YE", name: "Yemen" },
435
- { code: "ZM", name: "Zambia" },
436
- { code: "ZW", name: "Zimbabwe" }
437
- ], zo = [
438
- "horizontal_bar",
439
- "vertical_bar",
440
- "gauge",
441
- "donut",
442
- "timeseries_line",
443
- "timeseries_bar",
444
- "golden_signals",
445
- "top_n",
446
- "slottable",
447
- "single_value",
448
- "choropleth_map"
449
- ], se = {
450
- type: "string"
451
- }, U = {
452
- type: "string"
453
- }, mn = {
454
- type: "boolean"
455
- }, fn = {
456
- type: ["object", "array"],
457
- items: {
458
- type: "string"
459
- },
460
- additionalProperties: {
461
- type: "string"
462
- }
463
- }, da = {
464
- type: "object",
465
- properties: {
466
- type: {
467
- type: "string",
468
- enum: ["slottable"]
469
- },
470
- id: {
471
- type: "string"
472
- }
473
- },
474
- required: ["type", "id"],
475
- additionalProperties: !1
476
- }, ma = {
477
- type: "object",
478
- properties: {
479
- type: {
480
- type: "string",
481
- enum: ["horizontal_bar", "vertical_bar"]
482
- },
483
- stacked: {
484
- type: "boolean"
485
- },
486
- chart_dataset_colors: fn,
487
- synthetics_data_key: se,
488
- chart_title: U,
489
- allow_csv_export: mn
490
- },
491
- required: ["type"],
492
- additionalProperties: !1
493
- }, fa = {
494
- type: "object",
495
- properties: {
496
- type: {
497
- type: "string",
498
- enum: ["warning", "error", "neutral"]
499
- },
500
- value: {
501
- type: "number"
502
- },
503
- label: {
504
- type: "string"
505
- },
506
- highlightIntersections: {
507
- type: "boolean",
508
- default: !1
509
- }
510
- },
511
- required: ["type", "value"],
512
- additionalProperties: !1
513
- }, ha = {
514
- type: "object",
515
- properties: {
516
- type: {
517
- type: "string",
518
- enum: ["timeseries_line", "timeseries_bar"]
519
- },
520
- stacked: {
521
- type: "boolean"
522
- },
523
- threshold: {
524
- type: "object",
525
- additionalProperties: {
526
- type: "array",
527
- items: fa
528
- }
529
- },
530
- chart_dataset_colors: fn,
531
- synthetics_data_key: se,
532
- chart_title: U,
533
- allow_csv_export: mn
534
- },
535
- required: ["type"],
536
- additionalProperties: !1
537
- }, ya = {
538
- type: "object",
539
- properties: {
540
- type: {
541
- type: "string",
542
- enum: ["gauge"]
543
- },
544
- metric_display: {
545
- type: "string",
546
- enum: ["hidden", "single", "full"]
547
- // This matches the SimpleChartMetricDisplay type.
548
- },
549
- reverse_dataset: {
550
- type: "boolean"
551
- },
552
- numerator: {
553
- type: "number"
554
- },
555
- synthetics_data_key: se,
556
- chart_title: U
557
- },
558
- required: ["type"],
559
- additionalProperties: !1
560
- }, ga = {
561
- type: "object",
562
- properties: {
563
- type: {
564
- type: "string",
565
- enum: ["donut"]
566
- },
567
- synthetics_data_key: se,
568
- chart_title: U
569
- },
570
- required: ["type"],
571
- additionalProperties: !1
572
- }, pa = {
573
- type: "object",
574
- properties: {
575
- chart_title: U,
576
- synthetics_data_key: se,
577
- type: {
578
- type: "string",
579
- enum: ["top_n"]
580
- },
581
- description: {
582
- type: "string"
583
- },
584
- entity_link: {
585
- type: "string"
586
- }
587
- },
588
- required: ["type"],
589
- additionalProperties: !1
590
- }, _a = {
591
- type: "object",
592
- properties: {
593
- chart_title: U,
594
- type: {
595
- type: "string",
596
- enum: ["golden_signals"]
597
- },
598
- long_card_titles: {
599
- type: "boolean"
600
- },
601
- description: {
602
- type: "string"
603
- },
604
- percentile_latency: {
605
- type: "boolean"
606
- }
607
- },
608
- required: ["type"],
609
- additionalProperties: !1
610
- }, wa = {
611
- type: "object",
612
- properties: {
613
- type: {
614
- type: "string",
615
- enum: ["single_value"]
616
- },
617
- decimal_points: {
618
- type: "number"
619
- },
620
- chart_title: U
621
- },
622
- required: ["type"],
623
- additionalProperties: !1
624
- }, ba = {
625
- type: "object",
626
- properties: {
627
- type: {
628
- type: "string",
629
- enum: ["choropleth_map"]
630
- },
631
- chart_title: U,
632
- fit_to_country: {
633
- type: "string",
634
- enum: dn.map((e) => e.code)
635
- },
636
- legend: {
637
- type: "boolean",
638
- default: !1
639
- },
640
- bounds: {
641
- type: "array",
642
- minItems: 2,
643
- maxItems: 2,
644
- items: {
645
- type: "array",
646
- minItems: 2,
647
- maxItems: 2,
648
- items: [
649
- { type: "number", minimum: -180, maximum: 180 },
650
- { type: "number", minimum: -90, maximum: 90 }
651
- ]
652
- }
653
- }
654
- },
655
- required: ["type"],
656
- additionalProperties: !1
657
- }, Ta = {
658
- type: "object",
659
- properties: {
660
- tz: {
661
- type: "string",
662
- default: "Etc/UTC"
663
- },
664
- type: {
665
- type: "string",
666
- enum: [
667
- "relative"
668
- ]
669
- },
670
- time_range: {
671
- type: "string",
672
- enum: on,
673
- default: "1h"
674
- }
675
- },
676
- required: [
677
- "type",
678
- "time_range"
679
- ],
680
- additionalProperties: !1
681
- }, Da = {
682
- type: "object",
683
- description: "A duration representing an exact start and end time.",
684
- properties: {
685
- tz: {
686
- type: "string"
687
- },
688
- type: {
689
- type: "string",
690
- enum: [
691
- "absolute"
692
- ]
693
- },
694
- start: {
695
- type: "string"
696
- },
697
- end: {
698
- type: "string"
699
- }
700
- },
701
- required: [
702
- "type",
703
- "start",
704
- "end"
705
- ],
706
- additionalProperties: !1
707
- }, Xe = {
708
- granularity: {
709
- type: "string",
710
- description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
711
- enum: sn
712
- },
713
- time_range: {
714
- type: "object",
715
- description: "The time range to query.",
716
- anyOf: [
717
- Ta,
718
- Da
719
- ],
720
- default: {
721
- type: "relative",
722
- time_range: "1h"
723
- }
724
- },
725
- limit: {
726
- type: "number"
727
- },
728
- meta: {
729
- type: "object"
730
- }
731
- }, Qe = (e) => ({
732
- type: "array",
733
- description: "List of aggregated metrics to collect across the requested time span.",
734
- items: {
735
- type: "string",
736
- enum: e
737
- }
738
- }), Ke = (e) => ({
739
- type: "array",
740
- description: "List of attributes or entity types to group by.",
741
- minItems: 0,
742
- maxItems: 2,
743
- items: {
744
- type: "string",
745
- enum: e
746
- }
747
- }), Ee = (e) => ({
748
- type: "array",
749
- description: "A list of filters to apply to the query",
750
- items: {
751
- oneOf: [
752
- {
753
- type: "object",
754
- description: "In filter",
755
- properties: {
756
- field: {
757
- type: "string",
758
- enum: e
759
- },
760
- operator: {
761
- type: "string",
762
- enum: ta
763
- },
764
- value: {
765
- type: "array",
766
- items: {
767
- type: ["string", "number", "null"]
768
- }
769
- }
770
- },
771
- required: [
772
- "field",
773
- "operator",
774
- "value"
775
- ],
776
- additionalProperties: !1
777
- },
778
- {
779
- type: "object",
780
- description: "Empty filter",
781
- properties: {
782
- field: {
783
- type: "string",
784
- enum: e
785
- },
786
- operator: {
787
- type: "string",
788
- enum: na
789
- }
790
- },
791
- required: [
792
- "field",
793
- "operator"
794
- ],
795
- additionalProperties: !1
796
- }
797
- ]
798
- }
799
- }), Ma = {
800
- type: "object",
801
- description: "A query to launch at the advanced explore API",
802
- properties: {
803
- datasource: {
804
- type: "string",
805
- enum: [
806
- "api_usage"
807
- ]
808
- },
809
- metrics: Qe(ra),
810
- dimensions: Ke(cn),
811
- filters: Ee(Se),
812
- ...Xe
813
- },
814
- required: ["datasource"],
815
- additionalProperties: !1
816
- }, Sa = {
817
- type: "object",
818
- description: "A query to launch at the basic explore API",
819
- properties: {
820
- datasource: {
821
- type: "string",
822
- enum: [
823
- "basic"
824
- ]
825
- },
826
- metrics: Qe(un),
827
- dimensions: Ke(Ze),
828
- filters: Ee(Me),
829
- ...Xe
830
- },
831
- required: ["datasource"],
832
- additionalProperties: !1
833
- }, Oa = {
834
- type: "object",
835
- description: "A query to launch at the AI explore API",
836
- properties: {
837
- datasource: {
838
- type: "string",
839
- enum: [
840
- "llm_usage"
841
- ]
842
- },
843
- metrics: Qe(aa),
844
- dimensions: Ke(ln),
845
- filters: Ee(Oe),
846
- ...Xe
847
- },
848
- required: ["datasource"],
849
- additionalProperties: !1
850
- }, Ea = {
851
- anyOf: [Ma, Sa, Oa]
852
- }, va = {
853
- type: "object",
854
- properties: {
855
- query: Ea,
856
- chart: {
857
- anyOf: [
858
- ma,
859
- ya,
860
- ga,
861
- ha,
862
- _a,
863
- pa,
864
- da,
865
- wa,
866
- ba
867
- ]
868
- }
869
- },
870
- required: ["query", "chart"],
871
- additionalProperties: !1
872
- }, Na = {
873
- type: "object",
874
- properties: {
875
- position: {
876
- type: "object",
877
- properties: {
878
- col: {
879
- type: "number"
880
- },
881
- row: {
882
- type: "number"
883
- }
884
- },
885
- description: "Position of the tile in the grid.",
886
- required: ["col", "row"],
887
- additionalProperties: !1
888
- },
889
- size: {
890
- type: "object",
891
- properties: {
892
- cols: {
893
- type: "number"
894
- },
895
- rows: {
896
- type: "number"
897
- },
898
- fit_to_content: {
899
- type: "boolean"
900
- }
901
- },
902
- description: "Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",
903
- required: ["cols", "rows"],
904
- additionalProperties: !1
905
- }
906
- },
907
- required: ["position", "size"],
908
- additionalProperties: !1
909
- }, Ia = {
910
- type: "object",
911
- properties: {
912
- type: {
913
- type: "string",
914
- enum: ["chart"]
915
- },
916
- definition: va,
917
- layout: Na,
918
- id: {
919
- type: "string",
920
- description: "Unique identifier for the tile. If not provided, one will be generated."
921
- }
922
- },
923
- required: ["type", "definition", "layout"],
924
- additionalProperties: !1
925
- }, Vo = {
926
- type: "object",
927
- properties: {
928
- tiles: {
929
- type: "array",
930
- items: Ia
931
- },
932
- tile_height: {
933
- type: "number",
934
- description: "Height of each tile in pixels."
935
- },
936
- preset_filters: Ee([.../* @__PURE__ */ new Set([...Se, ...Me, ...Oe])]),
937
- template_id: {
938
- type: ["string", "null"],
939
- description: "Template id which was used to instantiate this dashboard."
940
- }
941
- },
942
- required: ["tiles"],
943
- additionalProperties: !1
944
- }, $o = (e) => {
945
- const t = [];
946
- return Me.includes(e) && t.push("basic"), Se.includes(e) && t.push("api_usage"), Oe.includes(e) && t.push("llm_usage"), (oa.includes(e) || ca.includes(e)) && t.push("requests"), t;
947
- }, xa = {
948
- lessThanXSeconds: {
949
- one: "less than a second",
950
- other: "less than {{count}} seconds"
951
- },
952
- xSeconds: {
953
- one: "1 second",
954
- other: "{{count}} seconds"
955
- },
956
- halfAMinute: "half a minute",
957
- lessThanXMinutes: {
958
- one: "less than a minute",
959
- other: "less than {{count}} minutes"
960
- },
961
- xMinutes: {
962
- one: "1 minute",
963
- other: "{{count}} minutes"
964
- },
965
- aboutXHours: {
966
- one: "about 1 hour",
967
- other: "about {{count}} hours"
968
- },
969
- xHours: {
970
- one: "1 hour",
971
- other: "{{count}} hours"
972
- },
973
- xDays: {
974
- one: "1 day",
975
- other: "{{count}} days"
976
- },
977
- aboutXWeeks: {
978
- one: "about 1 week",
979
- other: "about {{count}} weeks"
980
- },
981
- xWeeks: {
982
- one: "1 week",
983
- other: "{{count}} weeks"
984
- },
985
- aboutXMonths: {
986
- one: "about 1 month",
987
- other: "about {{count}} months"
988
- },
989
- xMonths: {
990
- one: "1 month",
991
- other: "{{count}} months"
992
- },
993
- aboutXYears: {
994
- one: "about 1 year",
995
- other: "about {{count}} years"
996
- },
997
- xYears: {
998
- one: "1 year",
999
- other: "{{count}} years"
1000
- },
1001
- overXYears: {
1002
- one: "over 1 year",
1003
- other: "over {{count}} years"
1004
- },
1005
- almostXYears: {
1006
- one: "almost 1 year",
1007
- other: "almost {{count}} years"
1008
- }
1009
- }, Pa = (e, t, n) => {
1010
- let r;
1011
- const i = xa[e];
1012
- return typeof i == "string" ? r = i : t === 1 ? r = i.one : r = i.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
1013
- };
1014
- function He(e) {
1015
- return (t = {}) => {
1016
- const n = t.width ? String(t.width) : e.defaultWidth;
1017
- return e.formats[n] || e.formats[e.defaultWidth];
1018
- };
1019
- }
1020
- const Ra = {
1021
- full: "EEEE, MMMM do, y",
1022
- long: "MMMM do, y",
1023
- medium: "MMM d, y",
1024
- short: "MM/dd/yyyy"
1025
- }, Ca = {
1026
- full: "h:mm:ss a zzzz",
1027
- long: "h:mm:ss a z",
1028
- medium: "h:mm:ss a",
1029
- short: "h:mm a"
1030
- }, Ya = {
1031
- full: "{{date}} 'at' {{time}}",
1032
- long: "{{date}} 'at' {{time}}",
1033
- medium: "{{date}}, {{time}}",
1034
- short: "{{date}}, {{time}}"
1035
- }, Ga = {
1036
- date: He({
1037
- formats: Ra,
1038
- defaultWidth: "full"
1039
- }),
1040
- time: He({
1041
- formats: Ca,
1042
- defaultWidth: "full"
1043
- }),
1044
- dateTime: He({
1045
- formats: Ya,
1046
- defaultWidth: "full"
1047
- })
1048
- }, ka = {
1049
- lastWeek: "'last' eeee 'at' p",
1050
- yesterday: "'yesterday at' p",
1051
- today: "'today at' p",
1052
- tomorrow: "'tomorrow at' p",
1053
- nextWeek: "eeee 'at' p",
1054
- other: "P"
1055
- }, Aa = (e, t, n, r) => ka[e];
1056
- function re(e) {
1057
- return (t, n) => {
1058
- const r = n != null && n.context ? String(n.context) : "standalone";
1059
- let i;
1060
- if (r === "formatting" && e.formattingValues) {
1061
- const c = e.defaultFormattingWidth || e.defaultWidth, m = n != null && n.width ? String(n.width) : c;
1062
- i = e.formattingValues[m] || e.formattingValues[c];
1063
- } else {
1064
- const c = e.defaultWidth, m = n != null && n.width ? String(n.width) : e.defaultWidth;
1065
- i = e.values[m] || e.values[c];
1066
- }
1067
- const o = e.argumentCallback ? e.argumentCallback(t) : t;
1068
- return i[o];
1069
- };
1070
- }
1071
- const Fa = {
1072
- narrow: ["B", "A"],
1073
- abbreviated: ["BC", "AD"],
1074
- wide: ["Before Christ", "Anno Domini"]
1075
- }, Ha = {
1076
- narrow: ["1", "2", "3", "4"],
1077
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1078
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1079
- }, La = {
1080
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1081
- abbreviated: [
1082
- "Jan",
1083
- "Feb",
1084
- "Mar",
1085
- "Apr",
1086
- "May",
1087
- "Jun",
1088
- "Jul",
1089
- "Aug",
1090
- "Sep",
1091
- "Oct",
1092
- "Nov",
1093
- "Dec"
1094
- ],
1095
- wide: [
1096
- "January",
1097
- "February",
1098
- "March",
1099
- "April",
1100
- "May",
1101
- "June",
1102
- "July",
1103
- "August",
1104
- "September",
1105
- "October",
1106
- "November",
1107
- "December"
1108
- ]
1109
- }, Ua = {
1110
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
1111
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1112
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1113
- wide: [
1114
- "Sunday",
1115
- "Monday",
1116
- "Tuesday",
1117
- "Wednesday",
1118
- "Thursday",
1119
- "Friday",
1120
- "Saturday"
1121
- ]
1122
- }, Wa = {
1123
- narrow: {
1124
- am: "a",
1125
- pm: "p",
1126
- midnight: "mi",
1127
- noon: "n",
1128
- morning: "morning",
1129
- afternoon: "afternoon",
1130
- evening: "evening",
1131
- night: "night"
1132
- },
1133
- abbreviated: {
1134
- am: "AM",
1135
- pm: "PM",
1136
- midnight: "midnight",
1137
- noon: "noon",
1138
- morning: "morning",
1139
- afternoon: "afternoon",
1140
- evening: "evening",
1141
- night: "night"
1142
- },
1143
- wide: {
1144
- am: "a.m.",
1145
- pm: "p.m.",
1146
- midnight: "midnight",
1147
- noon: "noon",
1148
- morning: "morning",
1149
- afternoon: "afternoon",
1150
- evening: "evening",
1151
- night: "night"
1152
- }
1153
- }, qa = {
1154
- narrow: {
1155
- am: "a",
1156
- pm: "p",
1157
- midnight: "mi",
1158
- noon: "n",
1159
- morning: "in the morning",
1160
- afternoon: "in the afternoon",
1161
- evening: "in the evening",
1162
- night: "at night"
1163
- },
1164
- abbreviated: {
1165
- am: "AM",
1166
- pm: "PM",
1167
- midnight: "midnight",
1168
- noon: "noon",
1169
- morning: "in the morning",
1170
- afternoon: "in the afternoon",
1171
- evening: "in the evening",
1172
- night: "at night"
1173
- },
1174
- wide: {
1175
- am: "a.m.",
1176
- pm: "p.m.",
1177
- midnight: "midnight",
1178
- noon: "noon",
1179
- morning: "in the morning",
1180
- afternoon: "in the afternoon",
1181
- evening: "in the evening",
1182
- night: "at night"
1183
- }
1184
- }, ja = (e, t) => {
1185
- const n = Number(e), r = n % 100;
1186
- if (r > 20 || r < 10)
1187
- switch (r % 10) {
1188
- case 1:
1189
- return n + "st";
1190
- case 2:
1191
- return n + "nd";
1192
- case 3:
1193
- return n + "rd";
1194
- }
1195
- return n + "th";
1196
- }, za = {
1197
- ordinalNumber: ja,
1198
- era: re({
1199
- values: Fa,
1200
- defaultWidth: "wide"
1201
- }),
1202
- quarter: re({
1203
- values: Ha,
1204
- defaultWidth: "wide",
1205
- argumentCallback: (e) => e - 1
1206
- }),
1207
- month: re({
1208
- values: La,
1209
- defaultWidth: "wide"
1210
- }),
1211
- day: re({
1212
- values: Ua,
1213
- defaultWidth: "wide"
1214
- }),
1215
- dayPeriod: re({
1216
- values: Wa,
1217
- defaultWidth: "wide",
1218
- formattingValues: qa,
1219
- defaultFormattingWidth: "wide"
1220
- })
1221
- };
1222
- function ae(e) {
1223
- return (t, n = {}) => {
1224
- const r = n.width, i = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], o = t.match(i);
1225
- if (!o)
1226
- return null;
1227
- const c = o[0], m = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], g = Array.isArray(m) ? $a(m, (d) => d.test(c)) : (
1228
- // [TODO] -- I challenge you to fix the type
1229
- Va(m, (d) => d.test(c))
1230
- );
1231
- let l;
1232
- l = e.valueCallback ? e.valueCallback(g) : g, l = n.valueCallback ? (
1233
- // [TODO] -- I challenge you to fix the type
1234
- n.valueCallback(l)
1235
- ) : l;
1236
- const f = t.slice(c.length);
1237
- return { value: l, rest: f };
1238
- };
1239
- }
1240
- function Va(e, t) {
1241
- for (const n in e)
1242
- if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
1243
- return n;
1244
- }
1245
- function $a(e, t) {
1246
- for (let n = 0; n < e.length; n++)
1247
- if (t(e[n]))
1248
- return n;
1249
- }
1250
- function Ba(e) {
1251
- return (t, n = {}) => {
1252
- const r = t.match(e.matchPattern);
1253
- if (!r) return null;
1254
- const i = r[0], o = t.match(e.parsePattern);
1255
- if (!o) return null;
1256
- let c = e.valueCallback ? e.valueCallback(o[0]) : o[0];
1257
- c = n.valueCallback ? n.valueCallback(c) : c;
1258
- const m = t.slice(i.length);
1259
- return { value: c, rest: m };
1260
- };
1261
- }
1262
- const Za = /^(\d+)(th|st|nd|rd)?/i, Xa = /\d+/i, Qa = {
1263
- narrow: /^(b|a)/i,
1264
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1265
- wide: /^(before christ|before common era|anno domini|common era)/i
1266
- }, Ka = {
1267
- any: [/^b/i, /^(a|c)/i]
1268
- }, Ja = {
1269
- narrow: /^[1234]/i,
1270
- abbreviated: /^q[1234]/i,
1271
- wide: /^[1234](th|st|nd|rd)? quarter/i
1272
- }, ei = {
1273
- any: [/1/i, /2/i, /3/i, /4/i]
1274
- }, ti = {
1275
- narrow: /^[jfmasond]/i,
1276
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1277
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1278
- }, ni = {
1279
- narrow: [
1280
- /^j/i,
1281
- /^f/i,
1282
- /^m/i,
1283
- /^a/i,
1284
- /^m/i,
1285
- /^j/i,
1286
- /^j/i,
1287
- /^a/i,
1288
- /^s/i,
1289
- /^o/i,
1290
- /^n/i,
1291
- /^d/i
1292
- ],
1293
- any: [
1294
- /^ja/i,
1295
- /^f/i,
1296
- /^mar/i,
1297
- /^ap/i,
1298
- /^may/i,
1299
- /^jun/i,
1300
- /^jul/i,
1301
- /^au/i,
1302
- /^s/i,
1303
- /^o/i,
1304
- /^n/i,
1305
- /^d/i
1306
- ]
1307
- }, ri = {
1308
- narrow: /^[smtwf]/i,
1309
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1310
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1311
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1312
- }, ai = {
1313
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1314
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1315
- }, ii = {
1316
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1317
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1318
- }, oi = {
1319
- any: {
1320
- am: /^a/i,
1321
- pm: /^p/i,
1322
- midnight: /^mi/i,
1323
- noon: /^no/i,
1324
- morning: /morning/i,
1325
- afternoon: /afternoon/i,
1326
- evening: /evening/i,
1327
- night: /night/i
1328
- }
1329
- }, si = {
1330
- ordinalNumber: Ba({
1331
- matchPattern: Za,
1332
- parsePattern: Xa,
1333
- valueCallback: (e) => parseInt(e, 10)
1334
- }),
1335
- era: ae({
1336
- matchPatterns: Qa,
1337
- defaultMatchWidth: "wide",
1338
- parsePatterns: Ka,
1339
- defaultParseWidth: "any"
1340
- }),
1341
- quarter: ae({
1342
- matchPatterns: Ja,
1343
- defaultMatchWidth: "wide",
1344
- parsePatterns: ei,
1345
- defaultParseWidth: "any",
1346
- valueCallback: (e) => e + 1
1347
- }),
1348
- month: ae({
1349
- matchPatterns: ti,
1350
- defaultMatchWidth: "wide",
1351
- parsePatterns: ni,
1352
- defaultParseWidth: "any"
1353
- }),
1354
- day: ae({
1355
- matchPatterns: ri,
1356
- defaultMatchWidth: "wide",
1357
- parsePatterns: ai,
1358
- defaultParseWidth: "any"
1359
- }),
1360
- dayPeriod: ae({
1361
- matchPatterns: ii,
1362
- defaultMatchWidth: "any",
1363
- parsePatterns: oi,
1364
- defaultParseWidth: "any"
1365
- })
1366
- }, ui = {
1367
- code: "en-US",
1368
- formatDistance: Pa,
1369
- formatLong: Ga,
1370
- formatRelative: Aa,
1371
- localize: za,
1372
- match: si,
1373
- options: {
1374
- weekStartsOn: 0,
1375
- firstWeekContainsDate: 1
1376
- }
1377
- };
1378
- let ci = {};
1379
- function ue() {
1380
- return ci;
1381
- }
1382
- const hn = 6048e5, li = 864e5, di = 60, mi = 3600, kt = Symbol.for("constructDateFrom");
1383
- function R(e, t) {
1384
- return typeof e == "function" ? e(t) : e && typeof e == "object" && kt in e ? e[kt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
1385
- }
1386
- function O(e, t) {
1387
- return R(t || e, e);
1388
- }
1389
- function At(e) {
1390
- const t = O(e), n = new Date(
1391
- Date.UTC(
1392
- t.getFullYear(),
1393
- t.getMonth(),
1394
- t.getDate(),
1395
- t.getHours(),
1396
- t.getMinutes(),
1397
- t.getSeconds(),
1398
- t.getMilliseconds()
1399
- )
1400
- );
1401
- return n.setUTCFullYear(t.getFullYear()), +e - +n;
1402
- }
1403
- function fi(e, ...t) {
1404
- const n = R.bind(
1405
- null,
1406
- t.find((r) => typeof r == "object")
1407
- );
1408
- return t.map(n);
1409
- }
1410
- function ie(e, t) {
1411
- const n = O(e, t == null ? void 0 : t.in);
1412
- return n.setHours(0, 0, 0, 0), n;
1413
- }
1414
- function hi(e, t, n) {
1415
- const [r, i] = fi(
1416
- n == null ? void 0 : n.in,
1417
- e,
1418
- t
1419
- ), o = ie(r), c = ie(i), m = +o - At(o), g = +c - At(c);
1420
- return Math.round((m - g) / li);
1421
- }
1422
- function yi(e, t) {
1423
- const n = O(e, t == null ? void 0 : t.in);
1424
- return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
1425
- }
1426
- function gi(e, t) {
1427
- const n = O(e, t == null ? void 0 : t.in);
1428
- return hi(n, yi(n)) + 1;
1429
- }
1430
- function A(e, t) {
1431
- var m, g, l, f;
1432
- const n = ue(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((g = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : g.weekStartsOn) ?? n.weekStartsOn ?? ((f = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : f.weekStartsOn) ?? 0, i = O(e, t == null ? void 0 : t.in), o = i.getDay(), c = (o < r ? 7 : 0) + o - r;
1433
- return i.setDate(i.getDate() - c), i.setHours(0, 0, 0, 0), i;
1434
- }
1435
- function _e(e, t) {
1436
- return A(e, { ...t, weekStartsOn: 1 });
1437
- }
1438
- function yn(e, t) {
1439
- const n = O(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = R(n, 0);
1440
- i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
1441
- const o = _e(i), c = R(n, 0);
1442
- c.setFullYear(r, 0, 4), c.setHours(0, 0, 0, 0);
1443
- const m = _e(c);
1444
- return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= m.getTime() ? r : r - 1;
1445
- }
1446
- function pi(e, t) {
1447
- const n = yn(e, t), r = R(e, 0);
1448
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), _e(r);
1449
- }
1450
- function _i(e, t) {
1451
- const n = O(e, t == null ? void 0 : t.in), r = +_e(n) - +pi(n);
1452
- return Math.round(r / hn) + 1;
1453
- }
1454
- function gn(e, t) {
1455
- var f, d, h, b;
1456
- const n = O(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = ue(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((b = (h = i.locale) == null ? void 0 : h.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, c = R((t == null ? void 0 : t.in) || e, 0);
1457
- c.setFullYear(r + 1, 0, o), c.setHours(0, 0, 0, 0);
1458
- const m = A(c, t), g = R((t == null ? void 0 : t.in) || e, 0);
1459
- g.setFullYear(r, 0, o), g.setHours(0, 0, 0, 0);
1460
- const l = A(g, t);
1461
- return +n >= +m ? r + 1 : +n >= +l ? r : r - 1;
1462
- }
1463
- function wi(e, t) {
1464
- var m, g, l, f;
1465
- const n = ue(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((g = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : g.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((f = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = gn(e, t), o = R((t == null ? void 0 : t.in) || e, 0);
1466
- return o.setFullYear(i, 0, r), o.setHours(0, 0, 0, 0), A(o, t);
1467
- }
1468
- function bi(e, t) {
1469
- const n = O(e, t == null ? void 0 : t.in), r = +A(n, t) - +wi(n, t);
1470
- return Math.round(r / hn) + 1;
1471
- }
1472
- function _(e, t) {
1473
- const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
1474
- return n + r;
1475
- }
1476
- const L = {
1477
- // Year
1478
- y(e, t) {
1479
- const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
1480
- return _(t === "yy" ? r % 100 : r, t.length);
1481
- },
1482
- // Month
1483
- M(e, t) {
1484
- const n = e.getMonth();
1485
- return t === "M" ? String(n + 1) : _(n + 1, 2);
1486
- },
1487
- // Day of the month
1488
- d(e, t) {
1489
- return _(e.getDate(), t.length);
1490
- },
1491
- // AM or PM
1492
- a(e, t) {
1493
- const n = e.getHours() / 12 >= 1 ? "pm" : "am";
1494
- switch (t) {
1495
- case "a":
1496
- case "aa":
1497
- return n.toUpperCase();
1498
- case "aaa":
1499
- return n;
1500
- case "aaaaa":
1501
- return n[0];
1502
- case "aaaa":
1503
- default:
1504
- return n === "am" ? "a.m." : "p.m.";
1505
- }
1506
- },
1507
- // Hour [1-12]
1508
- h(e, t) {
1509
- return _(e.getHours() % 12 || 12, t.length);
1510
- },
1511
- // Hour [0-23]
1512
- H(e, t) {
1513
- return _(e.getHours(), t.length);
1514
- },
1515
- // Minute
1516
- m(e, t) {
1517
- return _(e.getMinutes(), t.length);
1518
- },
1519
- // Second
1520
- s(e, t) {
1521
- return _(e.getSeconds(), t.length);
1522
- },
1523
- // Fraction of second
1524
- S(e, t) {
1525
- const n = t.length, r = e.getMilliseconds(), i = Math.trunc(
1526
- r * Math.pow(10, n - 3)
1527
- );
1528
- return _(i, t.length);
1529
- }
1530
- }, K = {
1531
- midnight: "midnight",
1532
- noon: "noon",
1533
- morning: "morning",
1534
- afternoon: "afternoon",
1535
- evening: "evening",
1536
- night: "night"
1537
- }, Ft = {
1538
- // Era
1539
- G: function(e, t, n) {
1540
- const r = e.getFullYear() > 0 ? 1 : 0;
1541
- switch (t) {
1542
- case "G":
1543
- case "GG":
1544
- case "GGG":
1545
- return n.era(r, { width: "abbreviated" });
1546
- case "GGGGG":
1547
- return n.era(r, { width: "narrow" });
1548
- case "GGGG":
1549
- default:
1550
- return n.era(r, { width: "wide" });
1551
- }
1552
- },
1553
- // Year
1554
- y: function(e, t, n) {
1555
- if (t === "yo") {
1556
- const r = e.getFullYear(), i = r > 0 ? r : 1 - r;
1557
- return n.ordinalNumber(i, { unit: "year" });
1558
- }
1559
- return L.y(e, t);
1560
- },
1561
- // Local week-numbering year
1562
- Y: function(e, t, n, r) {
1563
- const i = gn(e, r), o = i > 0 ? i : 1 - i;
1564
- if (t === "YY") {
1565
- const c = o % 100;
1566
- return _(c, 2);
1567
- }
1568
- return t === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : _(o, t.length);
1569
- },
1570
- // ISO week-numbering year
1571
- R: function(e, t) {
1572
- const n = yn(e);
1573
- return _(n, t.length);
1574
- },
1575
- // Extended year. This is a single number designating the year of this calendar system.
1576
- // The main difference between `y` and `u` localizers are B.C. years:
1577
- // | Year | `y` | `u` |
1578
- // |------|-----|-----|
1579
- // | AC 1 | 1 | 1 |
1580
- // | BC 1 | 1 | 0 |
1581
- // | BC 2 | 2 | -1 |
1582
- // Also `yy` always returns the last two digits of a year,
1583
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1584
- u: function(e, t) {
1585
- const n = e.getFullYear();
1586
- return _(n, t.length);
1587
- },
1588
- // Quarter
1589
- Q: function(e, t, n) {
1590
- const r = Math.ceil((e.getMonth() + 1) / 3);
1591
- switch (t) {
1592
- case "Q":
1593
- return String(r);
1594
- case "QQ":
1595
- return _(r, 2);
1596
- case "Qo":
1597
- return n.ordinalNumber(r, { unit: "quarter" });
1598
- case "QQQ":
1599
- return n.quarter(r, {
1600
- width: "abbreviated",
1601
- context: "formatting"
1602
- });
1603
- case "QQQQQ":
1604
- return n.quarter(r, {
1605
- width: "narrow",
1606
- context: "formatting"
1607
- });
1608
- case "QQQQ":
1609
- default:
1610
- return n.quarter(r, {
1611
- width: "wide",
1612
- context: "formatting"
1613
- });
1614
- }
1615
- },
1616
- // Stand-alone quarter
1617
- q: function(e, t, n) {
1618
- const r = Math.ceil((e.getMonth() + 1) / 3);
1619
- switch (t) {
1620
- case "q":
1621
- return String(r);
1622
- case "qq":
1623
- return _(r, 2);
1624
- case "qo":
1625
- return n.ordinalNumber(r, { unit: "quarter" });
1626
- case "qqq":
1627
- return n.quarter(r, {
1628
- width: "abbreviated",
1629
- context: "standalone"
1630
- });
1631
- case "qqqqq":
1632
- return n.quarter(r, {
1633
- width: "narrow",
1634
- context: "standalone"
1635
- });
1636
- case "qqqq":
1637
- default:
1638
- return n.quarter(r, {
1639
- width: "wide",
1640
- context: "standalone"
1641
- });
1642
- }
1643
- },
1644
- // Month
1645
- M: function(e, t, n) {
1646
- const r = e.getMonth();
1647
- switch (t) {
1648
- case "M":
1649
- case "MM":
1650
- return L.M(e, t);
1651
- case "Mo":
1652
- return n.ordinalNumber(r + 1, { unit: "month" });
1653
- case "MMM":
1654
- return n.month(r, {
1655
- width: "abbreviated",
1656
- context: "formatting"
1657
- });
1658
- case "MMMMM":
1659
- return n.month(r, {
1660
- width: "narrow",
1661
- context: "formatting"
1662
- });
1663
- case "MMMM":
1664
- default:
1665
- return n.month(r, { width: "wide", context: "formatting" });
1666
- }
1667
- },
1668
- // Stand-alone month
1669
- L: function(e, t, n) {
1670
- const r = e.getMonth();
1671
- switch (t) {
1672
- case "L":
1673
- return String(r + 1);
1674
- case "LL":
1675
- return _(r + 1, 2);
1676
- case "Lo":
1677
- return n.ordinalNumber(r + 1, { unit: "month" });
1678
- case "LLL":
1679
- return n.month(r, {
1680
- width: "abbreviated",
1681
- context: "standalone"
1682
- });
1683
- case "LLLLL":
1684
- return n.month(r, {
1685
- width: "narrow",
1686
- context: "standalone"
1687
- });
1688
- case "LLLL":
1689
- default:
1690
- return n.month(r, { width: "wide", context: "standalone" });
1691
- }
1692
- },
1693
- // Local week of year
1694
- w: function(e, t, n, r) {
1695
- const i = bi(e, r);
1696
- return t === "wo" ? n.ordinalNumber(i, { unit: "week" }) : _(i, t.length);
1697
- },
1698
- // ISO week of year
1699
- I: function(e, t, n) {
1700
- const r = _i(e);
1701
- return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : _(r, t.length);
1702
- },
1703
- // Day of the month
1704
- d: function(e, t, n) {
1705
- return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : L.d(e, t);
1706
- },
1707
- // Day of year
1708
- D: function(e, t, n) {
1709
- const r = gi(e);
1710
- return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : _(r, t.length);
1711
- },
1712
- // Day of week
1713
- E: function(e, t, n) {
1714
- const r = e.getDay();
1715
- switch (t) {
1716
- case "E":
1717
- case "EE":
1718
- case "EEE":
1719
- return n.day(r, {
1720
- width: "abbreviated",
1721
- context: "formatting"
1722
- });
1723
- case "EEEEE":
1724
- return n.day(r, {
1725
- width: "narrow",
1726
- context: "formatting"
1727
- });
1728
- case "EEEEEE":
1729
- return n.day(r, {
1730
- width: "short",
1731
- context: "formatting"
1732
- });
1733
- case "EEEE":
1734
- default:
1735
- return n.day(r, {
1736
- width: "wide",
1737
- context: "formatting"
1738
- });
1739
- }
1740
- },
1741
- // Local day of week
1742
- e: function(e, t, n, r) {
1743
- const i = e.getDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
1744
- switch (t) {
1745
- case "e":
1746
- return String(o);
1747
- case "ee":
1748
- return _(o, 2);
1749
- case "eo":
1750
- return n.ordinalNumber(o, { unit: "day" });
1751
- case "eee":
1752
- return n.day(i, {
1753
- width: "abbreviated",
1754
- context: "formatting"
1755
- });
1756
- case "eeeee":
1757
- return n.day(i, {
1758
- width: "narrow",
1759
- context: "formatting"
1760
- });
1761
- case "eeeeee":
1762
- return n.day(i, {
1763
- width: "short",
1764
- context: "formatting"
1765
- });
1766
- case "eeee":
1767
- default:
1768
- return n.day(i, {
1769
- width: "wide",
1770
- context: "formatting"
1771
- });
1772
- }
1773
- },
1774
- // Stand-alone local day of week
1775
- c: function(e, t, n, r) {
1776
- const i = e.getDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
1777
- switch (t) {
1778
- case "c":
1779
- return String(o);
1780
- case "cc":
1781
- return _(o, t.length);
1782
- case "co":
1783
- return n.ordinalNumber(o, { unit: "day" });
1784
- case "ccc":
1785
- return n.day(i, {
1786
- width: "abbreviated",
1787
- context: "standalone"
1788
- });
1789
- case "ccccc":
1790
- return n.day(i, {
1791
- width: "narrow",
1792
- context: "standalone"
1793
- });
1794
- case "cccccc":
1795
- return n.day(i, {
1796
- width: "short",
1797
- context: "standalone"
1798
- });
1799
- case "cccc":
1800
- default:
1801
- return n.day(i, {
1802
- width: "wide",
1803
- context: "standalone"
1804
- });
1805
- }
1806
- },
1807
- // ISO day of week
1808
- i: function(e, t, n) {
1809
- const r = e.getDay(), i = r === 0 ? 7 : r;
1810
- switch (t) {
1811
- case "i":
1812
- return String(i);
1813
- case "ii":
1814
- return _(i, t.length);
1815
- case "io":
1816
- return n.ordinalNumber(i, { unit: "day" });
1817
- case "iii":
1818
- return n.day(r, {
1819
- width: "abbreviated",
1820
- context: "formatting"
1821
- });
1822
- case "iiiii":
1823
- return n.day(r, {
1824
- width: "narrow",
1825
- context: "formatting"
1826
- });
1827
- case "iiiiii":
1828
- return n.day(r, {
1829
- width: "short",
1830
- context: "formatting"
1831
- });
1832
- case "iiii":
1833
- default:
1834
- return n.day(r, {
1835
- width: "wide",
1836
- context: "formatting"
1837
- });
1838
- }
1839
- },
1840
- // AM or PM
1841
- a: function(e, t, n) {
1842
- const i = e.getHours() / 12 >= 1 ? "pm" : "am";
1843
- switch (t) {
1844
- case "a":
1845
- case "aa":
1846
- return n.dayPeriod(i, {
1847
- width: "abbreviated",
1848
- context: "formatting"
1849
- });
1850
- case "aaa":
1851
- return n.dayPeriod(i, {
1852
- width: "abbreviated",
1853
- context: "formatting"
1854
- }).toLowerCase();
1855
- case "aaaaa":
1856
- return n.dayPeriod(i, {
1857
- width: "narrow",
1858
- context: "formatting"
1859
- });
1860
- case "aaaa":
1861
- default:
1862
- return n.dayPeriod(i, {
1863
- width: "wide",
1864
- context: "formatting"
1865
- });
1866
- }
1867
- },
1868
- // AM, PM, midnight, noon
1869
- b: function(e, t, n) {
1870
- const r = e.getHours();
1871
- let i;
1872
- switch (r === 12 ? i = K.noon : r === 0 ? i = K.midnight : i = r / 12 >= 1 ? "pm" : "am", t) {
1873
- case "b":
1874
- case "bb":
1875
- return n.dayPeriod(i, {
1876
- width: "abbreviated",
1877
- context: "formatting"
1878
- });
1879
- case "bbb":
1880
- return n.dayPeriod(i, {
1881
- width: "abbreviated",
1882
- context: "formatting"
1883
- }).toLowerCase();
1884
- case "bbbbb":
1885
- return n.dayPeriod(i, {
1886
- width: "narrow",
1887
- context: "formatting"
1888
- });
1889
- case "bbbb":
1890
- default:
1891
- return n.dayPeriod(i, {
1892
- width: "wide",
1893
- context: "formatting"
1894
- });
1895
- }
1896
- },
1897
- // in the morning, in the afternoon, in the evening, at night
1898
- B: function(e, t, n) {
1899
- const r = e.getHours();
1900
- let i;
1901
- switch (r >= 17 ? i = K.evening : r >= 12 ? i = K.afternoon : r >= 4 ? i = K.morning : i = K.night, t) {
1902
- case "B":
1903
- case "BB":
1904
- case "BBB":
1905
- return n.dayPeriod(i, {
1906
- width: "abbreviated",
1907
- context: "formatting"
1908
- });
1909
- case "BBBBB":
1910
- return n.dayPeriod(i, {
1911
- width: "narrow",
1912
- context: "formatting"
1913
- });
1914
- case "BBBB":
1915
- default:
1916
- return n.dayPeriod(i, {
1917
- width: "wide",
1918
- context: "formatting"
1919
- });
1920
- }
1921
- },
1922
- // Hour [1-12]
1923
- h: function(e, t, n) {
1924
- if (t === "ho") {
1925
- let r = e.getHours() % 12;
1926
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1927
- }
1928
- return L.h(e, t);
1929
- },
1930
- // Hour [0-23]
1931
- H: function(e, t, n) {
1932
- return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : L.H(e, t);
1933
- },
1934
- // Hour [0-11]
1935
- K: function(e, t, n) {
1936
- const r = e.getHours() % 12;
1937
- return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : _(r, t.length);
1938
- },
1939
- // Hour [1-24]
1940
- k: function(e, t, n) {
1941
- let r = e.getHours();
1942
- return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : _(r, t.length);
1943
- },
1944
- // Minute
1945
- m: function(e, t, n) {
1946
- return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : L.m(e, t);
1947
- },
1948
- // Second
1949
- s: function(e, t, n) {
1950
- return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : L.s(e, t);
1951
- },
1952
- // Fraction of second
1953
- S: function(e, t) {
1954
- return L.S(e, t);
1955
- },
1956
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1957
- X: function(e, t, n) {
1958
- const r = e.getTimezoneOffset();
1959
- if (r === 0)
1960
- return "Z";
1961
- switch (t) {
1962
- case "X":
1963
- return Lt(r);
1964
- case "XXXX":
1965
- case "XX":
1966
- return $(r);
1967
- case "XXXXX":
1968
- case "XXX":
1969
- default:
1970
- return $(r, ":");
1971
- }
1972
- },
1973
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1974
- x: function(e, t, n) {
1975
- const r = e.getTimezoneOffset();
1976
- switch (t) {
1977
- case "x":
1978
- return Lt(r);
1979
- case "xxxx":
1980
- case "xx":
1981
- return $(r);
1982
- case "xxxxx":
1983
- case "xxx":
1984
- default:
1985
- return $(r, ":");
1986
- }
1987
- },
1988
- // Timezone (GMT)
1989
- O: function(e, t, n) {
1990
- const r = e.getTimezoneOffset();
1991
- switch (t) {
1992
- case "O":
1993
- case "OO":
1994
- case "OOO":
1995
- return "GMT" + Ht(r, ":");
1996
- case "OOOO":
1997
- default:
1998
- return "GMT" + $(r, ":");
1999
- }
2000
- },
2001
- // Timezone (specific non-location)
2002
- z: function(e, t, n) {
2003
- const r = e.getTimezoneOffset();
2004
- switch (t) {
2005
- case "z":
2006
- case "zz":
2007
- case "zzz":
2008
- return "GMT" + Ht(r, ":");
2009
- case "zzzz":
2010
- default:
2011
- return "GMT" + $(r, ":");
2012
- }
2013
- },
2014
- // Seconds timestamp
2015
- t: function(e, t, n) {
2016
- const r = Math.trunc(+e / 1e3);
2017
- return _(r, t.length);
2018
- },
2019
- // Milliseconds timestamp
2020
- T: function(e, t, n) {
2021
- return _(+e, t.length);
2022
- }
2023
- };
2024
- function Ht(e, t = "") {
2025
- const n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.trunc(r / 60), o = r % 60;
2026
- return o === 0 ? n + String(i) : n + String(i) + t + _(o, 2);
2027
- }
2028
- function Lt(e, t) {
2029
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + _(Math.abs(e) / 60, 2) : $(e, t);
2030
- }
2031
- function $(e, t = "") {
2032
- const n = e > 0 ? "-" : "+", r = Math.abs(e), i = _(Math.trunc(r / 60), 2), o = _(r % 60, 2);
2033
- return n + i + t + o;
2034
- }
2035
- const Ut = (e, t) => {
2036
- switch (e) {
2037
- case "P":
2038
- return t.date({ width: "short" });
2039
- case "PP":
2040
- return t.date({ width: "medium" });
2041
- case "PPP":
2042
- return t.date({ width: "long" });
2043
- case "PPPP":
2044
- default:
2045
- return t.date({ width: "full" });
2046
- }
2047
- }, pn = (e, t) => {
2048
- switch (e) {
2049
- case "p":
2050
- return t.time({ width: "short" });
2051
- case "pp":
2052
- return t.time({ width: "medium" });
2053
- case "ppp":
2054
- return t.time({ width: "long" });
2055
- case "pppp":
2056
- default:
2057
- return t.time({ width: "full" });
2058
- }
2059
- }, Ti = (e, t) => {
2060
- const n = e.match(/(P+)(p+)?/) || [], r = n[1], i = n[2];
2061
- if (!i)
2062
- return Ut(e, t);
2063
- let o;
2064
- switch (r) {
2065
- case "P":
2066
- o = t.dateTime({ width: "short" });
2067
- break;
2068
- case "PP":
2069
- o = t.dateTime({ width: "medium" });
2070
- break;
2071
- case "PPP":
2072
- o = t.dateTime({ width: "long" });
2073
- break;
2074
- case "PPPP":
2075
- default:
2076
- o = t.dateTime({ width: "full" });
2077
- break;
2078
- }
2079
- return o.replace("{{date}}", Ut(r, t)).replace("{{time}}", pn(i, t));
2080
- }, Di = {
2081
- p: pn,
2082
- P: Ti
2083
- }, Mi = /^D+$/, Si = /^Y+$/, Oi = ["D", "DD", "YY", "YYYY"];
2084
- function Ei(e) {
2085
- return Mi.test(e);
2086
- }
2087
- function vi(e) {
2088
- return Si.test(e);
2089
- }
2090
- function Ni(e, t, n) {
2091
- const r = Ii(e, t, n);
2092
- if (console.warn(r), Oi.includes(e)) throw new RangeError(r);
2093
- }
2094
- function Ii(e, t, n) {
2095
- const r = e[0] === "Y" ? "years" : "days of the month";
2096
- return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
2097
- }
2098
- function xi(e) {
2099
- return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
2100
- }
2101
- function Pi(e) {
2102
- return !(!xi(e) && typeof e != "number" || isNaN(+O(e)));
2103
- }
2104
- const Ri = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ci = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Yi = /^'([^]*?)'?$/, Gi = /''/g, ki = /[a-zA-Z]/;
2105
- function Ai(e, t, n) {
2106
- var f, d, h, b, E, N, C, W;
2107
- const r = ue(), i = (n == null ? void 0 : n.locale) ?? r.locale ?? ui, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (f = n == null ? void 0 : n.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((b = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, c = (n == null ? void 0 : n.weekStartsOn) ?? ((N = (E = n == null ? void 0 : n.locale) == null ? void 0 : E.options) == null ? void 0 : N.weekStartsOn) ?? r.weekStartsOn ?? ((W = (C = r.locale) == null ? void 0 : C.options) == null ? void 0 : W.weekStartsOn) ?? 0, m = O(e, n == null ? void 0 : n.in);
2108
- if (!Pi(m))
2109
- throw new RangeError("Invalid time value");
2110
- let g = t.match(Ci).map((v) => {
2111
- const D = v[0];
2112
- if (D === "p" || D === "P") {
2113
- const q = Di[D];
2114
- return q(v, i.formatLong);
2115
- }
2116
- return v;
2117
- }).join("").match(Ri).map((v) => {
2118
- if (v === "''")
2119
- return { isToken: !1, value: "'" };
2120
- const D = v[0];
2121
- if (D === "'")
2122
- return { isToken: !1, value: Fi(v) };
2123
- if (Ft[D])
2124
- return { isToken: !0, value: v };
2125
- if (D.match(ki))
2126
- throw new RangeError(
2127
- "Format string contains an unescaped latin alphabet character `" + D + "`"
2128
- );
2129
- return { isToken: !1, value: v };
2130
- });
2131
- i.localize.preprocessor && (g = i.localize.preprocessor(m, g));
2132
- const l = {
2133
- firstWeekContainsDate: o,
2134
- weekStartsOn: c,
2135
- locale: i
2136
- };
2137
- return g.map((v) => {
2138
- if (!v.isToken) return v.value;
2139
- const D = v.value;
2140
- (!(n != null && n.useAdditionalWeekYearTokens) && vi(D) || !(n != null && n.useAdditionalDayOfYearTokens) && Ei(D)) && Ni(D, t, String(e));
2141
- const q = Ft[D[0]];
2142
- return q(m, D, i.localize, l);
2143
- }).join("");
2144
- }
2145
- function Fi(e) {
2146
- const t = e.match(Yi);
2147
- return t ? t[1].replace(Gi, "'") : e;
2148
- }
2149
- function Le(e, t, n) {
2150
- const r = O(e, n == null ? void 0 : n.in);
2151
- return isNaN(t) ? R(e, NaN) : (r.setDate(r.getDate() + t), r);
2152
- }
2153
- function Hi(e, t, n) {
2154
- const r = O(e, n == null ? void 0 : n.in);
2155
- if (isNaN(t)) return R(e, NaN);
2156
- const i = r.getDate(), o = R(e, r.getTime());
2157
- o.setMonth(r.getMonth() + t + 1, 0);
2158
- const c = o.getDate();
2159
- return i >= c ? o : (r.setFullYear(
2160
- o.getFullYear(),
2161
- o.getMonth(),
2162
- i
2163
- ), r);
2164
- }
2165
- function ee(e, t) {
2166
- const n = O(e, t == null ? void 0 : t.in);
2167
- return n.setDate(1), n.setHours(0, 0, 0, 0), n;
2168
- }
2169
- function Li(e, t) {
2170
- const n = O(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = n.getMonth(), o = R(n, 0);
2171
- return o.setFullYear(r, i + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
2172
- }
2173
- function Ui() {
2174
- return Object.assign({}, ue());
2175
- }
2176
- function Wt(e) {
2177
- return +O(e);
2178
- }
2179
- function qt(e) {
2180
- return Math.trunc(+O(e) / 1e3);
2181
- }
2182
- function jt(e) {
2183
- return Math.trunc(e * mi);
2184
- }
2185
- function Wi(e) {
2186
- const t = e / di;
2187
- return Math.trunc(t);
2188
- }
2189
- function _n(e, t, n) {
2190
- return Hi(e, -1, n);
2191
- }
2192
- function zt(e, t, n) {
2193
- const r = Ui(), i = zi(e, n.timeZone, n.locale ?? r.locale);
2194
- return "formatToParts" in i ? qi(i, t) : ji(i, t);
2195
- }
2196
- function qi(e, t) {
2197
- const n = e.formatToParts(t);
2198
- for (let r = n.length - 1; r >= 0; --r)
2199
- if (n[r].type === "timeZoneName")
2200
- return n[r].value;
2201
- }
2202
- function ji(e, t) {
2203
- const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
2204
- return r ? r[0].substr(1) : "";
2205
- }
2206
- function zi(e, t, n) {
2207
- return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
2208
- timeZone: t,
2209
- timeZoneName: e
2210
- });
2211
- }
2212
- function Vi(e, t) {
2213
- const n = Qi(t);
2214
- return "formatToParts" in n ? Bi(n, e) : Zi(n, e);
2215
- }
2216
- const $i = {
2217
- year: 0,
2218
- month: 1,
2219
- day: 2,
2220
- hour: 3,
2221
- minute: 4,
2222
- second: 5
2223
- };
2224
- function Bi(e, t) {
2225
- try {
2226
- const n = e.formatToParts(t), r = [];
2227
- for (let i = 0; i < n.length; i++) {
2228
- const o = $i[n[i].type];
2229
- o !== void 0 && (r[o] = parseInt(n[i].value, 10));
2230
- }
2231
- return r;
2232
- } catch (n) {
2233
- if (n instanceof RangeError)
2234
- return [NaN];
2235
- throw n;
2236
- }
2237
- }
2238
- function Zi(e, t) {
2239
- const n = e.format(t), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
2240
- return [
2241
- parseInt(r[3], 10),
2242
- parseInt(r[1], 10),
2243
- parseInt(r[2], 10),
2244
- parseInt(r[4], 10),
2245
- parseInt(r[5], 10),
2246
- parseInt(r[6], 10)
2247
- ];
2248
- }
2249
- const Ue = {}, Vt = new Intl.DateTimeFormat("en-US", {
2250
- hourCycle: "h23",
2251
- timeZone: "America/New_York",
2252
- year: "numeric",
2253
- month: "2-digit",
2254
- day: "2-digit",
2255
- hour: "2-digit",
2256
- minute: "2-digit",
2257
- second: "2-digit"
2258
- }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), Xi = Vt === "06/25/2014, 00:00:00" || Vt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
2259
- function Qi(e) {
2260
- return Ue[e] || (Ue[e] = Xi ? new Intl.DateTimeFormat("en-US", {
2261
- hourCycle: "h23",
2262
- timeZone: e,
2263
- year: "numeric",
2264
- month: "numeric",
2265
- day: "2-digit",
2266
- hour: "2-digit",
2267
- minute: "2-digit",
2268
- second: "2-digit"
2269
- }) : new Intl.DateTimeFormat("en-US", {
2270
- hour12: !1,
2271
- timeZone: e,
2272
- year: "numeric",
2273
- month: "numeric",
2274
- day: "2-digit",
2275
- hour: "2-digit",
2276
- minute: "2-digit",
2277
- second: "2-digit"
2278
- })), Ue[e];
2279
- }
2280
- function Je(e, t, n, r, i, o, c) {
2281
- const m = /* @__PURE__ */ new Date(0);
2282
- return m.setUTCFullYear(e, t, n), m.setUTCHours(r, i, o, c), m;
2283
- }
2284
- const $t = 36e5, Ki = 6e4, We = {
2285
- timezoneZ: /^(Z)$/,
2286
- timezoneHH: /^([+-]\d{2})$/,
2287
- timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
2288
- };
2289
- function ce(e, t, n) {
2290
- if (!e)
2291
- return 0;
2292
- let r = We.timezoneZ.exec(e);
2293
- if (r)
2294
- return 0;
2295
- let i, o;
2296
- if (r = We.timezoneHH.exec(e), r)
2297
- return i = parseInt(r[1], 10), Bt(i) ? -(i * $t) : NaN;
2298
- if (r = We.timezoneHHMM.exec(e), r) {
2299
- i = parseInt(r[2], 10);
2300
- const c = parseInt(r[3], 10);
2301
- return Bt(i, c) ? (o = Math.abs(i) * $t + c * Ki, r[1] === "+" ? -o : o) : NaN;
2302
- }
2303
- if (to(e)) {
2304
- t = new Date(t || Date.now());
2305
- const c = n ? t : Ji(t), m = Be(c, e);
2306
- return -(n ? m : eo(t, m, e));
2307
- }
2308
- return NaN;
2309
- }
2310
- function Ji(e) {
2311
- return Je(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
2312
- }
2313
- function Be(e, t) {
2314
- const n = Vi(e, t), r = Je(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
2315
- let i = e.getTime();
2316
- const o = i % 1e3;
2317
- return i -= o >= 0 ? o : 1e3 + o, r - i;
2318
- }
2319
- function eo(e, t, n) {
2320
- let i = e.getTime() - t;
2321
- const o = Be(new Date(i), n);
2322
- if (t === o)
2323
- return t;
2324
- i -= o - t;
2325
- const c = Be(new Date(i), n);
2326
- return o === c ? o : Math.max(o, c);
2327
- }
2328
- function Bt(e, t) {
2329
- return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
2330
- }
2331
- const Zt = {};
2332
- function to(e) {
2333
- if (Zt[e])
2334
- return !0;
2335
- try {
2336
- return new Intl.DateTimeFormat(void 0, { timeZone: e }), Zt[e] = !0, !0;
2337
- } catch {
2338
- return !1;
2339
- }
2340
- }
2341
- const no = 60 * 1e3, ro = {
2342
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2343
- X: function(e, t, n) {
2344
- const r = qe(n.timeZone, e);
2345
- if (r === 0)
2346
- return "Z";
2347
- switch (t) {
2348
- case "X":
2349
- return Xt(r);
2350
- case "XXXX":
2351
- case "XX":
2352
- return J(r);
2353
- case "XXXXX":
2354
- case "XXX":
2355
- default:
2356
- return J(r, ":");
2357
- }
2358
- },
2359
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2360
- x: function(e, t, n) {
2361
- const r = qe(n.timeZone, e);
2362
- switch (t) {
2363
- case "x":
2364
- return Xt(r);
2365
- case "xxxx":
2366
- case "xx":
2367
- return J(r);
2368
- case "xxxxx":
2369
- case "xxx":
2370
- default:
2371
- return J(r, ":");
2372
- }
2373
- },
2374
- // Timezone (GMT)
2375
- O: function(e, t, n) {
2376
- const r = qe(n.timeZone, e);
2377
- switch (t) {
2378
- case "O":
2379
- case "OO":
2380
- case "OOO":
2381
- return "GMT" + ao(r, ":");
2382
- case "OOOO":
2383
- default:
2384
- return "GMT" + J(r, ":");
2385
- }
2386
- },
2387
- // Timezone (specific non-location)
2388
- z: function(e, t, n) {
2389
- switch (t) {
2390
- case "z":
2391
- case "zz":
2392
- case "zzz":
2393
- return zt("short", e, n);
2394
- case "zzzz":
2395
- default:
2396
- return zt("long", e, n);
2397
- }
2398
- }
2399
- };
2400
- function qe(e, t) {
2401
- const n = e ? ce(e, t, !0) / no : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
2402
- if (Number.isNaN(n))
2403
- throw new RangeError("Invalid time zone specified: " + e);
2404
- return n;
2405
- }
2406
- function we(e, t) {
2407
- const n = e < 0 ? "-" : "";
2408
- let r = Math.abs(e).toString();
2409
- for (; r.length < t; )
2410
- r = "0" + r;
2411
- return n + r;
2412
- }
2413
- function J(e, t = "") {
2414
- const n = e > 0 ? "-" : "+", r = Math.abs(e), i = we(Math.floor(r / 60), 2), o = we(Math.floor(r % 60), 2);
2415
- return n + i + t + o;
2416
- }
2417
- function Xt(e, t) {
2418
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + we(Math.abs(e) / 60, 2) : J(e, t);
2419
- }
2420
- function ao(e, t = "") {
2421
- const n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.floor(r / 60), o = r % 60;
2422
- return o === 0 ? n + String(i) : n + String(i) + t + we(o, 2);
2423
- }
2424
- function Qt(e) {
2425
- const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
2426
- return t.setUTCFullYear(e.getFullYear()), +e - +t;
2427
- }
2428
- const wn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, je = 36e5, Kt = 6e4, io = 2, I = {
2429
- dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
2430
- datePattern: /^([0-9W+-]+)(.*)/,
2431
- // year tokens
2432
- YY: /^(\d{2})$/,
2433
- YYY: [
2434
- /^([+-]\d{2})$/,
2435
- // 0 additional digits
2436
- /^([+-]\d{3})$/,
2437
- // 1 additional digit
2438
- /^([+-]\d{4})$/
2439
- // 2 additional digits
2440
- ],
2441
- YYYY: /^(\d{4})/,
2442
- YYYYY: [
2443
- /^([+-]\d{4})/,
2444
- // 0 additional digits
2445
- /^([+-]\d{5})/,
2446
- // 1 additional digit
2447
- /^([+-]\d{6})/
2448
- // 2 additional digits
2449
- ],
2450
- // date tokens
2451
- MM: /^-(\d{2})$/,
2452
- DDD: /^-?(\d{3})$/,
2453
- MMDD: /^-?(\d{2})-?(\d{2})$/,
2454
- Www: /^-?W(\d{2})$/,
2455
- WwwD: /^-?W(\d{2})-?(\d{1})$/,
2456
- HH: /^(\d{2}([.,]\d*)?)$/,
2457
- HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
2458
- HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
2459
- // time zone tokens (to identify the presence of a tz)
2460
- timeZone: wn
2461
- };
2462
- function be(e, t = {}) {
2463
- if (arguments.length < 1)
2464
- throw new TypeError("1 argument required, but only " + arguments.length + " present");
2465
- if (e === null)
2466
- return /* @__PURE__ */ new Date(NaN);
2467
- const n = t.additionalDigits == null ? io : Number(t.additionalDigits);
2468
- if (n !== 2 && n !== 1 && n !== 0)
2469
- throw new RangeError("additionalDigits must be 0, 1 or 2");
2470
- if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
2471
- return new Date(e.getTime());
2472
- if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
2473
- return new Date(e);
2474
- if (Object.prototype.toString.call(e) !== "[object String]")
2475
- return /* @__PURE__ */ new Date(NaN);
2476
- const r = oo(e), { year: i, restDateString: o } = so(r.date, n), c = uo(o, i);
2477
- if (c === null || isNaN(c.getTime()))
2478
- return /* @__PURE__ */ new Date(NaN);
2479
- if (c) {
2480
- const m = c.getTime();
2481
- let g = 0, l;
2482
- if (r.time && (g = co(r.time), g === null || isNaN(g)))
2483
- return /* @__PURE__ */ new Date(NaN);
2484
- if (r.timeZone || t.timeZone) {
2485
- if (l = ce(r.timeZone || t.timeZone, new Date(m + g)), isNaN(l))
2486
- return /* @__PURE__ */ new Date(NaN);
2487
- } else
2488
- l = Qt(new Date(m + g)), l = Qt(new Date(m + g + l));
2489
- return new Date(m + g + l);
2490
- } else
2491
- return /* @__PURE__ */ new Date(NaN);
2492
- }
2493
- function oo(e) {
2494
- const t = {};
2495
- let n = I.dateTimePattern.exec(e), r;
2496
- if (n ? (t.date = n[1], r = n[3]) : (n = I.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
2497
- const i = I.timeZone.exec(r);
2498
- i ? (t.time = r.replace(i[1], ""), t.timeZone = i[1].trim()) : t.time = r;
2499
- }
2500
- return t;
2501
- }
2502
- function so(e, t) {
2503
- if (e) {
2504
- const n = I.YYY[t], r = I.YYYYY[t];
2505
- let i = I.YYYY.exec(e) || r.exec(e);
2506
- if (i) {
2507
- const o = i[1];
2508
- return {
2509
- year: parseInt(o, 10),
2510
- restDateString: e.slice(o.length)
2511
- };
2512
- }
2513
- if (i = I.YY.exec(e) || n.exec(e), i) {
2514
- const o = i[1];
2515
- return {
2516
- year: parseInt(o, 10) * 100,
2517
- restDateString: e.slice(o.length)
2518
- };
2519
- }
2520
- }
2521
- return {
2522
- year: null
2523
- };
2524
- }
2525
- function uo(e, t) {
2526
- if (t === null)
2527
- return null;
2528
- let n, r, i;
2529
- if (!e || !e.length)
2530
- return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
2531
- let o = I.MM.exec(e);
2532
- if (o)
2533
- return n = /* @__PURE__ */ new Date(0), r = parseInt(o[1], 10) - 1, en(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
2534
- if (o = I.DDD.exec(e), o) {
2535
- n = /* @__PURE__ */ new Date(0);
2536
- const c = parseInt(o[1], 10);
2537
- return fo(t, c) ? (n.setUTCFullYear(t, 0, c), n) : /* @__PURE__ */ new Date(NaN);
2538
- }
2539
- if (o = I.MMDD.exec(e), o) {
2540
- n = /* @__PURE__ */ new Date(0), r = parseInt(o[1], 10) - 1;
2541
- const c = parseInt(o[2], 10);
2542
- return en(t, r, c) ? (n.setUTCFullYear(t, r, c), n) : /* @__PURE__ */ new Date(NaN);
2543
- }
2544
- if (o = I.Www.exec(e), o)
2545
- return i = parseInt(o[1], 10) - 1, tn(i) ? Jt(t, i) : /* @__PURE__ */ new Date(NaN);
2546
- if (o = I.WwwD.exec(e), o) {
2547
- i = parseInt(o[1], 10) - 1;
2548
- const c = parseInt(o[2], 10) - 1;
2549
- return tn(i, c) ? Jt(t, i, c) : /* @__PURE__ */ new Date(NaN);
2550
- }
2551
- return null;
2552
- }
2553
- function co(e) {
2554
- let t, n, r = I.HH.exec(e);
2555
- if (r)
2556
- return t = parseFloat(r[1].replace(",", ".")), ze(t) ? t % 24 * je : NaN;
2557
- if (r = I.HHMM.exec(e), r)
2558
- return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), ze(t, n) ? t % 24 * je + n * Kt : NaN;
2559
- if (r = I.HHMMSS.exec(e), r) {
2560
- t = parseInt(r[1], 10), n = parseInt(r[2], 10);
2561
- const i = parseFloat(r[3].replace(",", "."));
2562
- return ze(t, n, i) ? t % 24 * je + n * Kt + i * 1e3 : NaN;
2563
- }
2564
- return null;
2565
- }
2566
- function Jt(e, t, n) {
2567
- t = t || 0, n = n || 0;
2568
- const r = /* @__PURE__ */ new Date(0);
2569
- r.setUTCFullYear(e, 0, 4);
2570
- const i = r.getUTCDay() || 7, o = t * 7 + n + 1 - i;
2571
- return r.setUTCDate(r.getUTCDate() + o), r;
2572
- }
2573
- const lo = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], mo = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2574
- function bn(e) {
2575
- return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
2576
- }
2577
- function en(e, t, n) {
2578
- if (t < 0 || t > 11)
2579
- return !1;
2580
- if (n != null) {
2581
- if (n < 1)
2582
- return !1;
2583
- const r = bn(e);
2584
- if (r && n > mo[t] || !r && n > lo[t])
2585
- return !1;
2586
- }
2587
- return !0;
2588
- }
2589
- function fo(e, t) {
2590
- if (t < 1)
2591
- return !1;
2592
- const n = bn(e);
2593
- return !(n && t > 366 || !n && t > 365);
2594
- }
2595
- function tn(e, t) {
2596
- return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
2597
- }
2598
- function ze(e, t, n) {
2599
- return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
2600
- }
2601
- const ho = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
2602
- function yo(e, t, n = {}) {
2603
- t = String(t);
2604
- const r = t.match(ho);
2605
- if (r) {
2606
- const i = be(n.originalDate || e, n);
2607
- t = r.reduce(function(o, c) {
2608
- if (c[0] === "'")
2609
- return o;
2610
- const m = o.indexOf(c), g = o[m - 1] === "'", l = o.replace(c, "'" + ro[c[0]](i, c, n) + "'");
2611
- return g ? l.substring(0, m - 1) + l.substring(m + 1) : l;
2612
- }, t);
2613
- }
2614
- return Ai(e, t, n);
2615
- }
2616
- function Tn(e, t, n) {
2617
- e = be(e, n);
2618
- const r = ce(t, e, !0), i = new Date(e.getTime() - r), o = /* @__PURE__ */ new Date(0);
2619
- return o.setFullYear(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate()), o.setHours(i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds()), o;
2620
- }
2621
- function Dn(e, t, n, r) {
2622
- return r = {
2623
- ...r,
2624
- timeZone: t,
2625
- originalDate: e
2626
- }, yo(Tn(e, t, { timeZone: r.timeZone }), n, r);
2627
- }
2628
- function go(e, t, n) {
2629
- if (typeof e == "string" && !e.match(wn))
2630
- return be(e, { ...n, timeZone: t });
2631
- e = be(e, n);
2632
- const r = Je(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), i = ce(t, new Date(r));
2633
- return new Date(r + i);
2634
- }
2635
- function Mn(e, t) {
2636
- return -ce(e, t);
2637
- }
2638
- function Bo(e, t = {}) {
2639
- const n = (t == null ? void 0 : t.tz) || Intl.DateTimeFormat().resolvedOptions().timeZone;
2640
- let r = "MMM dd, yyy hh:mm a";
2641
- switch (t.format) {
2642
- case "short":
2643
- r = "MMM dd, yyyy";
2644
- break;
2645
- case "default":
2646
- r = "MMM dd, yyyy hh:mm a";
2647
- break;
2648
- case "full":
2649
- r = "MMM dd, yyyy hh:mm:ss.SSS a";
2650
- break;
2651
- }
2652
- return t.includeTZ && (r += " (z)"), Dn(e, n, r);
2653
- }
2654
- function nn(e, t = {}) {
2655
- if (!e)
2656
- return e;
2657
- const n = t.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
2658
- try {
2659
- let r = "MMM dd, yyy hh:mm a";
2660
- t.short && (r = "MMM dd, yyy"), t.includeTZ && (r += " (z)");
2661
- const i = new Date(e);
2662
- return Dn(i, n, r);
2663
- } catch {
2664
- return console.error("Invalid value passed to formatTime", e), "(invalid date)";
2665
- }
2666
- }
2667
- function Zo(e, t) {
2668
- return `${nn(e.getTime())} - ${nn(t.getTime(), { includeTZ: !0 })}`;
2669
- }
2670
- const Te = {
2671
- secondly: 1e3,
2672
- tenSecondly: 10 * 1e3,
2673
- thirtySecondly: 30 * 1e3,
2674
- minutely: 60 * 1e3,
2675
- fiveMinutely: 5 * 60 * 1e3,
2676
- tenMinutely: 10 * 60 * 1e3,
2677
- thirtyMinutely: 30 * 60 * 1e3,
2678
- hourly: 60 * 60 * 1e3,
2679
- twoHourly: 2 * 60 * 60 * 1e3,
2680
- twelveHourly: 12 * 60 * 60 * 1e3,
2681
- daily: 60 * 60 * 24 * 1e3,
2682
- weekly: 60 * 60 * 24 * 7 * 1e3,
2683
- trend: 0
2684
- };
2685
- function Xo(e, t) {
2686
- return e.map((n) => ({
2687
- value: n,
2688
- label: t.t(`configuration.vitals.reports.granularity.${n}`)
2689
- }));
2690
- }
2691
- function po(e, t) {
2692
- return {
2693
- duration: e,
2694
- type: "duration",
2695
- origin: t
2696
- };
2697
- }
2698
- function Qo(e) {
2699
- return e && sn.find((n) => e <= Te[n]) || null;
2700
- }
2701
- function Sn(e, t, n, r) {
2702
- const i = Te[n];
2703
- let o = 0;
2704
- return i >= Te.daily && (r ? o = -Mn(r, t) : o = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - o) / i) * i + o);
2705
- }
2706
- function _o(e, t, n) {
2707
- return Sn(Math.floor, e, t, n);
2708
- }
2709
- function On(e, t, n) {
2710
- return Sn(Math.ceil, e, t, n);
2711
- }
2712
- class ve {
2713
- constructor(t, n, r) {
2714
- T(this, "timeframe");
2715
- T(this, "tz");
2716
- T(this, "dataGranularity");
2717
- if (this.constructor === ve)
2718
- throw new Error("BaseQueryTime is not meant to be used directly.");
2719
- this.timeframe = t, this.tz = n, this.dataGranularity = r ?? t.dataGranularity;
2720
- }
2721
- calculateStartDate(t, n, r = 1) {
2722
- if (t)
2723
- return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * r);
2724
- {
2725
- const i = this.endDate(), o = this.timeframe.rawStart(this.tz), c = _o(o, n, this.tz), g = (i.getTime() - c.getTime()) * (r - 1);
2726
- return new Date(c.getTime() - g);
2727
- }
2728
- }
2729
- granularitySeconds() {
2730
- return Math.floor(this.granularityMs() / 1e3);
2731
- }
2732
- granularityDruid() {
2733
- return po(this.granularityMs(), this.startDate().toISOString());
2734
- }
2735
- // Return a UNIX timestamp suitable for use in the `start` query param.
2736
- startSeconds() {
2737
- return qt(this.startDate());
2738
- }
2739
- // Return a UNIX timestamp suitable for use in the `end` query param.
2740
- endSeconds() {
2741
- return qt(this.endDate());
2742
- }
2743
- // Return epoch time in milliseconds, suitable for use in the `startMs` query param.
2744
- startMs() {
2745
- return Wt(this.startDate());
2746
- }
2747
- // Return epoch time in milliseconds, suitable for use in the `endMs` query param.
2748
- endMs() {
2749
- return Wt(this.endDate());
2750
- }
2751
- }
2752
- class Ko extends ve {
2753
- constructor(n, r, i, o, c) {
2754
- super(n, i, o);
2755
- T(this, "granularity");
2756
- r && n.allowedGranularities(c).has(r) ? this.granularity = r : c ? this.granularity = n.fineGrainedDefaultGranularity ?? n.defaultResponseGranularity : this.granularity = n.defaultResponseGranularity;
2757
- }
2758
- startDate() {
2759
- return this.calculateStartDate(this.timeframe.isRelative, this.granularity);
2760
- }
2761
- endDate() {
2762
- return On(this.timeframe.rawEnd(), this.granularity, this.tz);
2763
- }
2764
- granularityMs() {
2765
- return Te[this.granularity];
2766
- }
2767
- }
2768
- class wo extends ve {
2769
- startDate() {
2770
- return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity);
2771
- }
2772
- endDate() {
2773
- return On(this.timeframe.rawEnd(this.tz), this.dataGranularity, this.tz);
2774
- }
2775
- granularityMs() {
2776
- return this.endDate().getTime() - this.startDate().getTime();
2777
- }
2778
- }
2779
- class Jo extends wo {
2780
- startDate() {
2781
- return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
2782
- }
2783
- granularityMs() {
2784
- return this.endDate().getTime() - super.startDate().getTime();
2785
- }
2786
- }
2787
- var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2788
- function En(e) {
2789
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2790
- }
2791
- var De = { exports: {} };
2792
- De.exports;
2793
- (function(e, t) {
2794
- var n = 200, r = "__lodash_hash_undefined__", i = 9007199254740991, o = "[object Arguments]", c = "[object Array]", m = "[object Boolean]", g = "[object Date]", l = "[object Error]", f = "[object Function]", d = "[object GeneratorFunction]", h = "[object Map]", b = "[object Number]", E = "[object Object]", N = "[object Promise]", C = "[object RegExp]", W = "[object Set]", v = "[object String]", D = "[object Symbol]", q = "[object WeakMap]", tt = "[object ArrayBuffer]", le = "[object DataView]", nt = "[object Float32Array]", rt = "[object Float64Array]", at = "[object Int8Array]", it = "[object Int16Array]", ot = "[object Int32Array]", st = "[object Uint8Array]", ut = "[object Uint8ClampedArray]", ct = "[object Uint16Array]", lt = "[object Uint32Array]", In = /[\\^$.*+?()[\]{}|]/g, xn = /\w*$/, Pn = /^\[object .+?Constructor\]$/, Rn = /^(?:0|[1-9]\d*)$/, w = {};
2795
- w[o] = w[c] = w[tt] = w[le] = w[m] = w[g] = w[nt] = w[rt] = w[at] = w[it] = w[ot] = w[h] = w[b] = w[E] = w[C] = w[W] = w[v] = w[D] = w[st] = w[ut] = w[ct] = w[lt] = !0, w[l] = w[f] = w[q] = !1;
2796
- var Cn = typeof pe == "object" && pe && pe.Object === Object && pe, Yn = typeof self == "object" && self && self.Object === Object && self, Y = Cn || Yn || Function("return this")(), dt = t && !t.nodeType && t, mt = dt && !0 && e && !e.nodeType && e, Gn = mt && mt.exports === dt;
2797
- function kn(a, s) {
2798
- return a.set(s[0], s[1]), a;
2799
- }
2800
- function An(a, s) {
2801
- return a.add(s), a;
2802
- }
2803
- function Fn(a, s) {
2804
- for (var u = -1, y = a ? a.length : 0; ++u < y && s(a[u], u, a) !== !1; )
2805
- ;
2806
- return a;
2807
- }
2808
- function Hn(a, s) {
2809
- for (var u = -1, y = s.length, M = a.length; ++u < y; )
2810
- a[M + u] = s[u];
2811
- return a;
2812
- }
2813
- function ft(a, s, u, y) {
2814
- for (var M = -1, x = a ? a.length : 0; ++M < x; )
2815
- u = s(u, a[M], M, a);
2816
- return u;
2817
- }
2818
- function Ln(a, s) {
2819
- for (var u = -1, y = Array(a); ++u < a; )
2820
- y[u] = s(u);
2821
- return y;
2822
- }
2823
- function Un(a, s) {
2824
- return a == null ? void 0 : a[s];
2825
- }
2826
- function ht(a) {
2827
- var s = !1;
2828
- if (a != null && typeof a.toString != "function")
2829
- try {
2830
- s = !!(a + "");
2831
- } catch {
2832
- }
2833
- return s;
2834
- }
2835
- function yt(a) {
2836
- var s = -1, u = Array(a.size);
2837
- return a.forEach(function(y, M) {
2838
- u[++s] = [M, y];
2839
- }), u;
2840
- }
2841
- function Ne(a, s) {
2842
- return function(u) {
2843
- return a(s(u));
2844
- };
2845
- }
2846
- function gt(a) {
2847
- var s = -1, u = Array(a.size);
2848
- return a.forEach(function(y) {
2849
- u[++s] = y;
2850
- }), u;
2851
- }
2852
- var Wn = Array.prototype, qn = Function.prototype, de = Object.prototype, Ie = Y["__core-js_shared__"], pt = function() {
2853
- var a = /[^.]+$/.exec(Ie && Ie.keys && Ie.keys.IE_PROTO || "");
2854
- return a ? "Symbol(src)_1." + a : "";
2855
- }(), _t = qn.toString, H = de.hasOwnProperty, me = de.toString, jn = RegExp(
2856
- "^" + _t.call(H).replace(In, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2857
- ), wt = Gn ? Y.Buffer : void 0, bt = Y.Symbol, Tt = Y.Uint8Array, zn = Ne(Object.getPrototypeOf, Object), Vn = Object.create, $n = de.propertyIsEnumerable, Bn = Wn.splice, Dt = Object.getOwnPropertySymbols, Zn = wt ? wt.isBuffer : void 0, Xn = Ne(Object.keys, Object), xe = X(Y, "DataView"), te = X(Y, "Map"), Pe = X(Y, "Promise"), Re = X(Y, "Set"), Ce = X(Y, "WeakMap"), ne = X(Object, "create"), Qn = V(xe), Kn = V(te), Jn = V(Pe), er = V(Re), tr = V(Ce), Mt = bt ? bt.prototype : void 0, St = Mt ? Mt.valueOf : void 0;
2858
- function j(a) {
2859
- var s = -1, u = a ? a.length : 0;
2860
- for (this.clear(); ++s < u; ) {
2861
- var y = a[s];
2862
- this.set(y[0], y[1]);
2863
- }
2864
- }
2865
- function nr() {
2866
- this.__data__ = ne ? ne(null) : {};
2867
- }
2868
- function rr(a) {
2869
- return this.has(a) && delete this.__data__[a];
2870
- }
2871
- function ar(a) {
2872
- var s = this.__data__;
2873
- if (ne) {
2874
- var u = s[a];
2875
- return u === r ? void 0 : u;
2876
- }
2877
- return H.call(s, a) ? s[a] : void 0;
2878
- }
2879
- function ir(a) {
2880
- var s = this.__data__;
2881
- return ne ? s[a] !== void 0 : H.call(s, a);
2882
- }
2883
- function or(a, s) {
2884
- var u = this.__data__;
2885
- return u[a] = ne && s === void 0 ? r : s, this;
2886
- }
2887
- j.prototype.clear = nr, j.prototype.delete = rr, j.prototype.get = ar, j.prototype.has = ir, j.prototype.set = or;
2888
- function G(a) {
2889
- var s = -1, u = a ? a.length : 0;
2890
- for (this.clear(); ++s < u; ) {
2891
- var y = a[s];
2892
- this.set(y[0], y[1]);
2893
- }
2894
- }
2895
- function sr() {
2896
- this.__data__ = [];
2897
- }
2898
- function ur(a) {
2899
- var s = this.__data__, u = fe(s, a);
2900
- if (u < 0)
2901
- return !1;
2902
- var y = s.length - 1;
2903
- return u == y ? s.pop() : Bn.call(s, u, 1), !0;
2904
- }
2905
- function cr(a) {
2906
- var s = this.__data__, u = fe(s, a);
2907
- return u < 0 ? void 0 : s[u][1];
2908
- }
2909
- function lr(a) {
2910
- return fe(this.__data__, a) > -1;
2911
- }
2912
- function dr(a, s) {
2913
- var u = this.__data__, y = fe(u, a);
2914
- return y < 0 ? u.push([a, s]) : u[y][1] = s, this;
2915
- }
2916
- G.prototype.clear = sr, G.prototype.delete = ur, G.prototype.get = cr, G.prototype.has = lr, G.prototype.set = dr;
2917
- function B(a) {
2918
- var s = -1, u = a ? a.length : 0;
2919
- for (this.clear(); ++s < u; ) {
2920
- var y = a[s];
2921
- this.set(y[0], y[1]);
2922
- }
2923
- }
2924
- function mr() {
2925
- this.__data__ = {
2926
- hash: new j(),
2927
- map: new (te || G)(),
2928
- string: new j()
2929
- };
2930
- }
2931
- function fr(a) {
2932
- return he(this, a).delete(a);
2933
- }
2934
- function hr(a) {
2935
- return he(this, a).get(a);
2936
- }
2937
- function yr(a) {
2938
- return he(this, a).has(a);
2939
- }
2940
- function gr(a, s) {
2941
- return he(this, a).set(a, s), this;
2942
- }
2943
- B.prototype.clear = mr, B.prototype.delete = fr, B.prototype.get = hr, B.prototype.has = yr, B.prototype.set = gr;
2944
- function Z(a) {
2945
- this.__data__ = new G(a);
2946
- }
2947
- function pr() {
2948
- this.__data__ = new G();
2949
- }
2950
- function _r(a) {
2951
- return this.__data__.delete(a);
2952
- }
2953
- function wr(a) {
2954
- return this.__data__.get(a);
2955
- }
2956
- function br(a) {
2957
- return this.__data__.has(a);
2958
- }
2959
- function Tr(a, s) {
2960
- var u = this.__data__;
2961
- if (u instanceof G) {
2962
- var y = u.__data__;
2963
- if (!te || y.length < n - 1)
2964
- return y.push([a, s]), this;
2965
- u = this.__data__ = new B(y);
2966
- }
2967
- return u.set(a, s), this;
2968
- }
2969
- Z.prototype.clear = pr, Z.prototype.delete = _r, Z.prototype.get = wr, Z.prototype.has = br, Z.prototype.set = Tr;
2970
- function Dr(a, s) {
2971
- var u = ke(a) || Vr(a) ? Ln(a.length, String) : [], y = u.length, M = !!y;
2972
- for (var x in a)
2973
- H.call(a, x) && !(M && (x == "length" || Wr(x, y))) && u.push(x);
2974
- return u;
2975
- }
2976
- function Ot(a, s, u) {
2977
- var y = a[s];
2978
- (!(H.call(a, s) && It(y, u)) || u === void 0 && !(s in a)) && (a[s] = u);
2979
- }
2980
- function fe(a, s) {
2981
- for (var u = a.length; u--; )
2982
- if (It(a[u][0], s))
2983
- return u;
2984
- return -1;
2985
- }
2986
- function Mr(a, s) {
2987
- return a && Et(s, Ae(s), a);
2988
- }
2989
- function Ye(a, s, u, y, M, x, k) {
2990
- var P;
2991
- if (y && (P = x ? y(a, M, x, k) : y(a)), P !== void 0)
2992
- return P;
2993
- if (!ye(a))
2994
- return a;
2995
- var Rt = ke(a);
2996
- if (Rt) {
2997
- if (P = Hr(a), !s)
2998
- return kr(a, P);
2999
- } else {
3000
- var Q = z(a), Ct = Q == f || Q == d;
3001
- if (Br(a))
3002
- return Ir(a, s);
3003
- if (Q == E || Q == o || Ct && !x) {
3004
- if (ht(a))
3005
- return x ? a : {};
3006
- if (P = Lr(Ct ? {} : a), !s)
3007
- return Ar(a, Mr(P, a));
3008
- } else {
3009
- if (!w[Q])
3010
- return x ? a : {};
3011
- P = Ur(a, Q, Ye, s);
3012
- }
3013
- }
3014
- k || (k = new Z());
3015
- var Yt = k.get(a);
3016
- if (Yt)
3017
- return Yt;
3018
- if (k.set(a, P), !Rt)
3019
- var Gt = u ? Fr(a) : Ae(a);
3020
- return Fn(Gt || a, function(Fe, ge) {
3021
- Gt && (ge = Fe, Fe = a[ge]), Ot(P, ge, Ye(Fe, s, u, y, ge, a, k));
3022
- }), P;
3023
- }
3024
- function Sr(a) {
3025
- return ye(a) ? Vn(a) : {};
3026
- }
3027
- function Or(a, s, u) {
3028
- var y = s(a);
3029
- return ke(a) ? y : Hn(y, u(a));
3030
- }
3031
- function Er(a) {
3032
- return me.call(a);
3033
- }
3034
- function vr(a) {
3035
- if (!ye(a) || jr(a))
3036
- return !1;
3037
- var s = Pt(a) || ht(a) ? jn : Pn;
3038
- return s.test(V(a));
3039
- }
3040
- function Nr(a) {
3041
- if (!Nt(a))
3042
- return Xn(a);
3043
- var s = [];
3044
- for (var u in Object(a))
3045
- H.call(a, u) && u != "constructor" && s.push(u);
3046
- return s;
3047
- }
3048
- function Ir(a, s) {
3049
- if (s)
3050
- return a.slice();
3051
- var u = new a.constructor(a.length);
3052
- return a.copy(u), u;
3053
- }
3054
- function Ge(a) {
3055
- var s = new a.constructor(a.byteLength);
3056
- return new Tt(s).set(new Tt(a)), s;
3057
- }
3058
- function xr(a, s) {
3059
- var u = s ? Ge(a.buffer) : a.buffer;
3060
- return new a.constructor(u, a.byteOffset, a.byteLength);
3061
- }
3062
- function Pr(a, s, u) {
3063
- var y = s ? u(yt(a), !0) : yt(a);
3064
- return ft(y, kn, new a.constructor());
3065
- }
3066
- function Rr(a) {
3067
- var s = new a.constructor(a.source, xn.exec(a));
3068
- return s.lastIndex = a.lastIndex, s;
3069
- }
3070
- function Cr(a, s, u) {
3071
- var y = s ? u(gt(a), !0) : gt(a);
3072
- return ft(y, An, new a.constructor());
3073
- }
3074
- function Yr(a) {
3075
- return St ? Object(St.call(a)) : {};
3076
- }
3077
- function Gr(a, s) {
3078
- var u = s ? Ge(a.buffer) : a.buffer;
3079
- return new a.constructor(u, a.byteOffset, a.length);
3080
- }
3081
- function kr(a, s) {
3082
- var u = -1, y = a.length;
3083
- for (s || (s = Array(y)); ++u < y; )
3084
- s[u] = a[u];
3085
- return s;
3086
- }
3087
- function Et(a, s, u, y) {
3088
- u || (u = {});
3089
- for (var M = -1, x = s.length; ++M < x; ) {
3090
- var k = s[M], P = void 0;
3091
- Ot(u, k, P === void 0 ? a[k] : P);
3092
- }
3093
- return u;
3094
- }
3095
- function Ar(a, s) {
3096
- return Et(a, vt(a), s);
3097
- }
3098
- function Fr(a) {
3099
- return Or(a, Ae, vt);
3100
- }
3101
- function he(a, s) {
3102
- var u = a.__data__;
3103
- return qr(s) ? u[typeof s == "string" ? "string" : "hash"] : u.map;
3104
- }
3105
- function X(a, s) {
3106
- var u = Un(a, s);
3107
- return vr(u) ? u : void 0;
3108
- }
3109
- var vt = Dt ? Ne(Dt, Object) : Qr, z = Er;
3110
- (xe && z(new xe(new ArrayBuffer(1))) != le || te && z(new te()) != h || Pe && z(Pe.resolve()) != N || Re && z(new Re()) != W || Ce && z(new Ce()) != q) && (z = function(a) {
3111
- var s = me.call(a), u = s == E ? a.constructor : void 0, y = u ? V(u) : void 0;
3112
- if (y)
3113
- switch (y) {
3114
- case Qn:
3115
- return le;
3116
- case Kn:
3117
- return h;
3118
- case Jn:
3119
- return N;
3120
- case er:
3121
- return W;
3122
- case tr:
3123
- return q;
3124
- }
3125
- return s;
3126
- });
3127
- function Hr(a) {
3128
- var s = a.length, u = a.constructor(s);
3129
- return s && typeof a[0] == "string" && H.call(a, "index") && (u.index = a.index, u.input = a.input), u;
3130
- }
3131
- function Lr(a) {
3132
- return typeof a.constructor == "function" && !Nt(a) ? Sr(zn(a)) : {};
3133
- }
3134
- function Ur(a, s, u, y) {
3135
- var M = a.constructor;
3136
- switch (s) {
3137
- case tt:
3138
- return Ge(a);
3139
- case m:
3140
- case g:
3141
- return new M(+a);
3142
- case le:
3143
- return xr(a, y);
3144
- case nt:
3145
- case rt:
3146
- case at:
3147
- case it:
3148
- case ot:
3149
- case st:
3150
- case ut:
3151
- case ct:
3152
- case lt:
3153
- return Gr(a, y);
3154
- case h:
3155
- return Pr(a, y, u);
3156
- case b:
3157
- case v:
3158
- return new M(a);
3159
- case C:
3160
- return Rr(a);
3161
- case W:
3162
- return Cr(a, y, u);
3163
- case D:
3164
- return Yr(a);
3165
- }
3166
- }
3167
- function Wr(a, s) {
3168
- return s = s ?? i, !!s && (typeof a == "number" || Rn.test(a)) && a > -1 && a % 1 == 0 && a < s;
3169
- }
3170
- function qr(a) {
3171
- var s = typeof a;
3172
- return s == "string" || s == "number" || s == "symbol" || s == "boolean" ? a !== "__proto__" : a === null;
3173
- }
3174
- function jr(a) {
3175
- return !!pt && pt in a;
3176
- }
3177
- function Nt(a) {
3178
- var s = a && a.constructor, u = typeof s == "function" && s.prototype || de;
3179
- return a === u;
3180
- }
3181
- function V(a) {
3182
- if (a != null) {
3183
- try {
3184
- return _t.call(a);
3185
- } catch {
3186
- }
3187
- try {
3188
- return a + "";
3189
- } catch {
3190
- }
3191
- }
3192
- return "";
3193
- }
3194
- function zr(a) {
3195
- return Ye(a, !0, !0);
3196
- }
3197
- function It(a, s) {
3198
- return a === s || a !== a && s !== s;
3199
- }
3200
- function Vr(a) {
3201
- return $r(a) && H.call(a, "callee") && (!$n.call(a, "callee") || me.call(a) == o);
3202
- }
3203
- var ke = Array.isArray;
3204
- function xt(a) {
3205
- return a != null && Zr(a.length) && !Pt(a);
3206
- }
3207
- function $r(a) {
3208
- return Xr(a) && xt(a);
3209
- }
3210
- var Br = Zn || Kr;
3211
- function Pt(a) {
3212
- var s = ye(a) ? me.call(a) : "";
3213
- return s == f || s == d;
3214
- }
3215
- function Zr(a) {
3216
- return typeof a == "number" && a > -1 && a % 1 == 0 && a <= i;
3217
- }
3218
- function ye(a) {
3219
- var s = typeof a;
3220
- return !!a && (s == "object" || s == "function");
3221
- }
3222
- function Xr(a) {
3223
- return !!a && typeof a == "object";
3224
- }
3225
- function Ae(a) {
3226
- return xt(a) ? Dr(a) : Nr(a);
3227
- }
3228
- function Qr() {
3229
- return [];
3230
- }
3231
- function Kr() {
3232
- return !1;
3233
- }
3234
- e.exports = zr;
3235
- })(De, De.exports);
3236
- var bo = De.exports;
3237
- const To = /* @__PURE__ */ En(bo), F = (e, t) => new Date(e.getTime() - Mn(t, e));
3238
- class S {
3239
- constructor(t) {
3240
- T(this, "timeframeText");
3241
- T(this, "key");
3242
- T(this, "display");
3243
- T(this, "timeframeLength");
3244
- T(this, "allowedTiers");
3245
- // defaultResponseGranularity tracks which of the allowed granularities is picked for a given
3246
- // timeframe if the user does not or cannot specify a granularity.
3247
- T(this, "defaultResponseGranularity");
3248
- // dataGranularity tracks the granularity of the available data on the server for a specific timeframe.
3249
- // As of writing, it's always the same as the default response granularity, but it may not always be.
3250
- // It controls how timeframes are rounded to ensure complete time buckets from the server.
3251
- T(this, "dataGranularity");
3252
- // isRelative impacts whether we take the `floor` or the `ceil` of the start time.
3253
- // If the time range is relative, we want the ceil -- because we take the ceil of the
3254
- // end time to make sure we're showing all the data we can for the last time bucket.
3255
- // If the time range is absolute, we want the floor -- because otherwise we wouldn't be including
3256
- // the first time bucket.
3257
- T(this, "isRelative");
3258
- T(this, "fineGrainedDefaultGranularity");
3259
- T(this, "_startCustom");
3260
- T(this, "_endCustom");
3261
- T(this, "_allowedGranularitiesOverride");
3262
- 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;
3263
- }
3264
- // rawEnd does not consider granularity and should not be used directly in queries.
3265
- // Use `new QueryTime(timeframe, granularity?).queryEndSeconds()` instead.
3266
- // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
3267
- rawEnd(t) {
3268
- return this._endCustom || /* @__PURE__ */ new Date();
3269
- }
3270
- // rawStart does not consider granularity and should not be used directly in queries.
3271
- // Use `new QueryTime(timeframe, granularity?).queryStartSeconds()` instead.
3272
- // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
3273
- rawStart(t) {
3274
- return this._startCustom || new Date(this.rawEnd().getTime() - this.timeframeLengthMs());
3275
- }
3276
- timeframeLengthMs() {
3277
- return this.timeframeLength() * 1e3;
3278
- }
3279
- maximumTimeframeLength() {
3280
- return this.timeframeLength();
3281
- }
3282
- allowedGranularities(t) {
3283
- if (this._allowedGranularitiesOverride && t)
3284
- return new Set(this._allowedGranularitiesOverride);
3285
- const n = /* @__PURE__ */ new Set(), r = this.maximumTimeframeLength() / 3600;
3286
- return r <= 6 && n.add("minutely"), r >= 2 && r <= 7 * 24 && n.add("hourly"), r >= 2 * 24 && n.add("daily"), r >= 2 * 24 * 14 && n.add("weekly"), n;
3287
- }
3288
- cacheKey() {
3289
- return this.key !== "custom" ? this.key : `${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`;
3290
- }
3291
- v4Query(t) {
3292
- if (this.key === "custom")
3293
- return {
3294
- type: "absolute",
3295
- start: this.rawStart(),
3296
- end: this.rawEnd(),
3297
- tz: t
3298
- };
3299
- if (on.includes(this.key))
3300
- return {
3301
- type: "relative",
3302
- // Safe assertion; we just checked that key is a member of the union.
3303
- time_range: this.key,
3304
- tz: t
3305
- };
3306
- throw new Error("Unsupported relative time value for Explore");
3307
- }
3308
- tzAdjustedDate(t) {
3309
- if (!t)
3310
- return /* @__PURE__ */ new Date();
3311
- const n = go(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
3312
- return Tn(n, t);
3313
- }
3314
- }
3315
- class Do extends S {
3316
- rawStart(t) {
3317
- let n = A(this.tzAdjustedDate(t), { weekStartsOn: 1 });
3318
- return t && (n = F(n, t)), n;
3319
- }
3320
- maximumTimeframeLength() {
3321
- return 60 * 60 * 24 * 7;
3322
- }
3323
- }
3324
- class Mo extends S {
3325
- rawStart(t) {
3326
- let n = ee(this.tzAdjustedDate(t));
3327
- return t && (n = F(n, t)), n;
3328
- }
3329
- maximumTimeframeLength() {
3330
- return 60 * 60 * 24 * 31;
3331
- }
3332
- }
3333
- class So extends S {
3334
- rawStart(t) {
3335
- let n = new Date(this.tzAdjustedDate(t).getFullYear(), 0, 1);
3336
- return t && (n = F(n, t)), n;
3337
- }
3338
- maximumTimeframeLength() {
3339
- return 60 * 60 * 24 * 366;
3340
- }
3341
- }
3342
- class Oo extends S {
3343
- rawEnd(t) {
3344
- let n = A(this.tzAdjustedDate(t), { weekStartsOn: 1 });
3345
- return t && (n = F(n, t)), n;
3346
- }
3347
- rawStart(t) {
3348
- const n = this.tzAdjustedDate(t);
3349
- let r = A(n.setDate(n.getDate() - 7), {
3350
- weekStartsOn: 1
3351
- });
3352
- return t && (r = F(r, t)), r;
3353
- }
3354
- }
3355
- class Eo extends S {
3356
- rawEnd(t) {
3357
- let n = ee(this.tzAdjustedDate(t));
3358
- return t && (n = F(n, t)), n;
3359
- }
3360
- rawStart(t) {
3361
- let n = ee(_n(this.tzAdjustedDate(t)));
3362
- return t && (n = F(n, t)), n;
3363
- }
3364
- }
3365
- class vo extends S {
3366
- rawEnd(t) {
3367
- let n = new Date(this.tzAdjustedDate(t).getFullYear(), 0, 1);
3368
- return t && (n = F(n, t)), n;
3369
- }
3370
- rawStart(t) {
3371
- let n = new Date(this.tzAdjustedDate(t).getFullYear() - 1, 0, 1);
3372
- return t && (n = F(n, t)), n;
3373
- }
3374
- }
3375
- const No = /* @__PURE__ */ new Map([
3376
- [
3377
- p.FIFTEEN_MIN,
3378
- new S({
3379
- key: p.FIFTEEN_MIN,
3380
- display: "Last 15 minutes",
3381
- timeframeText: "15 minutes",
3382
- timeframeLength: () => 60 * 15,
3383
- defaultResponseGranularity: "minutely",
3384
- dataGranularity: "minutely",
3385
- isRelative: !0,
3386
- fineGrainedDefaultGranularity: "thirtySecondly",
3387
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3388
- allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely"]
3389
- })
3390
- ],
3391
- [
3392
- p.ONE_HOUR,
3393
- new S({
3394
- key: p.ONE_HOUR,
3395
- display: "Last hour",
3396
- timeframeText: "One hour",
3397
- timeframeLength: () => 60 * 60 * 1,
3398
- defaultResponseGranularity: "minutely",
3399
- dataGranularity: "minutely",
3400
- isRelative: !0,
3401
- fineGrainedDefaultGranularity: "minutely",
3402
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3403
- allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely", "fiveMinutely", "tenMinutely"]
3404
- })
3405
- ],
3406
- [
3407
- p.SIX_HOUR,
3408
- new S({
3409
- key: p.SIX_HOUR,
3410
- display: "Last 6 hours",
3411
- timeframeText: "6 hours",
3412
- timeframeLength: () => 60 * 60 * 6,
3413
- defaultResponseGranularity: "hourly",
3414
- dataGranularity: "hourly",
3415
- isRelative: !0,
3416
- fineGrainedDefaultGranularity: "fiveMinutely",
3417
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3418
- allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3419
- })
3420
- ],
3421
- [
3422
- p.TWELVE_HOUR,
3423
- new S({
3424
- key: p.TWELVE_HOUR,
3425
- display: "Last 12 hours",
3426
- timeframeText: "12 hours",
3427
- timeframeLength: () => 60 * 60 * 12,
3428
- defaultResponseGranularity: "hourly",
3429
- dataGranularity: "hourly",
3430
- isRelative: !0,
3431
- fineGrainedDefaultGranularity: "tenMinutely",
3432
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3433
- allowedGranularitiesOverride: ["minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3434
- })
3435
- ],
3436
- [
3437
- p.ONE_DAY,
3438
- new S({
3439
- key: p.ONE_DAY,
3440
- display: "Last 24 hours",
3441
- timeframeText: "24 hours",
3442
- timeframeLength: () => 60 * 60 * 24,
3443
- defaultResponseGranularity: "hourly",
3444
- dataGranularity: "hourly",
3445
- isRelative: !0,
3446
- fineGrainedDefaultGranularity: "thirtyMinutely",
3447
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3448
- allowedGranularitiesOverride: ["fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3449
- })
3450
- ],
3451
- [
3452
- p.SEVEN_DAY,
3453
- new S({
3454
- key: p.SEVEN_DAY,
3455
- display: "Last 7 days",
3456
- timeframeText: "7 days",
3457
- timeframeLength: () => 60 * 60 * 24 * 7,
3458
- defaultResponseGranularity: "daily",
3459
- dataGranularity: "daily",
3460
- isRelative: !0,
3461
- fineGrainedDefaultGranularity: "twoHourly",
3462
- allowedTiers: ["trial", "plus", "enterprise"],
3463
- allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3464
- })
3465
- ],
3466
- [
3467
- p.THIRTY_DAY,
3468
- new S({
3469
- key: p.THIRTY_DAY,
3470
- display: "Last 30 days",
3471
- timeframeText: "30 days",
3472
- timeframeLength: () => 60 * 60 * 24 * 30,
3473
- defaultResponseGranularity: "daily",
3474
- dataGranularity: "daily",
3475
- isRelative: !0,
3476
- fineGrainedDefaultGranularity: "twelveHourly",
3477
- allowedTiers: ["trial", "plus", "enterprise"],
3478
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3479
- })
3480
- ],
3481
- [
3482
- p.NINETY_DAY,
3483
- new S({
3484
- key: p.NINETY_DAY,
3485
- display: "Last 90 days",
3486
- timeframeText: "90 days",
3487
- timeframeLength: () => 60 * 60 * 24 * 90,
3488
- defaultResponseGranularity: "daily",
3489
- dataGranularity: "daily",
3490
- isRelative: !0,
3491
- fineGrainedDefaultGranularity: "daily",
3492
- allowedTiers: ["trial", "plus", "enterprise"],
3493
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3494
- })
3495
- ],
3496
- [
3497
- p.ONE_HUNDRED_EIGHTY_DAY,
3498
- new S({
3499
- key: p.ONE_HUNDRED_EIGHTY_DAY,
3500
- display: "Last 180 days",
3501
- timeframeText: "180 days",
3502
- timeframeLength: () => 60 * 60 * 24 * 180,
3503
- defaultResponseGranularity: "daily",
3504
- dataGranularity: "daily",
3505
- isRelative: !0,
3506
- fineGrainedDefaultGranularity: "daily",
3507
- allowedTiers: ["trial", "plus", "enterprise"],
3508
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3509
- })
3510
- ],
3511
- [
3512
- p.ONE_YEAR,
3513
- new S({
3514
- key: p.ONE_YEAR,
3515
- display: "Last 365 days",
3516
- timeframeText: "365 days",
3517
- timeframeLength: () => 60 * 60 * 24 * 365,
3518
- defaultResponseGranularity: "daily",
3519
- dataGranularity: "daily",
3520
- isRelative: !0,
3521
- fineGrainedDefaultGranularity: "daily",
3522
- allowedTiers: ["trial", "plus", "enterprise"],
3523
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3524
- })
3525
- ],
3526
- [
3527
- p.CURRENT_WEEK,
3528
- new Do({
3529
- key: p.CURRENT_WEEK,
3530
- display: "This week",
3531
- timeframeText: "Week",
3532
- timeframeLength: () => {
3533
- const e = A(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
3534
- return (ie(Le(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3535
- },
3536
- defaultResponseGranularity: "daily",
3537
- dataGranularity: "daily",
3538
- isRelative: !1,
3539
- fineGrainedDefaultGranularity: "twoHourly",
3540
- allowedTiers: ["plus", "enterprise"],
3541
- allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3542
- })
3543
- ],
3544
- [
3545
- p.CURRENT_MONTH,
3546
- new Mo({
3547
- key: p.CURRENT_MONTH,
3548
- display: "This month",
3549
- timeframeText: "Month",
3550
- timeframeLength: () => {
3551
- const e = ee(/* @__PURE__ */ new Date());
3552
- return (ie(Le(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3553
- },
3554
- defaultResponseGranularity: "daily",
3555
- dataGranularity: "daily",
3556
- isRelative: !1,
3557
- allowedTiers: ["plus", "enterprise"]
3558
- })
3559
- ],
3560
- [
3561
- p.CURRENT_YEAR,
3562
- new So({
3563
- key: p.CURRENT_YEAR,
3564
- display: "This year",
3565
- timeframeText: "Year",
3566
- timeframeLength: () => {
3567
- const e = new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1);
3568
- return (ie(Le(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3569
- },
3570
- defaultResponseGranularity: "daily",
3571
- dataGranularity: "daily",
3572
- isRelative: !1,
3573
- allowedTiers: ["plus", "enterprise"]
3574
- })
3575
- ],
3576
- [
3577
- p.PREVIOUS_WEEK,
3578
- new Oo({
3579
- key: p.PREVIOUS_WEEK,
3580
- display: "Previous week",
3581
- timeframeText: "Week",
3582
- timeframeLength: () => 60 * 60 * 24 * 7,
3583
- defaultResponseGranularity: "daily",
3584
- dataGranularity: "daily",
3585
- isRelative: !1,
3586
- fineGrainedDefaultGranularity: "twoHourly",
3587
- allowedTiers: ["plus", "enterprise"],
3588
- allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3589
- })
3590
- ],
3591
- [
3592
- p.PREVIOUS_MONTH,
3593
- new Eo({
3594
- key: p.PREVIOUS_MONTH,
3595
- display: "Previous month",
3596
- timeframeText: "Month",
3597
- timeframeLength: () => {
3598
- let e = 0;
3599
- const t = ee(/* @__PURE__ */ new Date()), n = ee(_n(/* @__PURE__ */ new Date()));
3600
- return t.getTimezoneOffset() !== n.getTimezoneOffset() && (e = rn(t, n)), 60 * 60 * 24 * Li((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + jt(e);
3601
- },
3602
- defaultResponseGranularity: "daily",
3603
- dataGranularity: "daily",
3604
- isRelative: !1,
3605
- allowedTiers: ["plus", "enterprise"]
3606
- })
3607
- ],
3608
- [
3609
- p.PREVIOUS_YEAR,
3610
- new vo({
3611
- key: p.PREVIOUS_YEAR,
3612
- display: "Previous year",
3613
- timeframeText: "Year",
3614
- timeframeLength: () => {
3615
- const e = new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1), t = new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1);
3616
- let n = 0;
3617
- return e.getTimezoneOffset() !== t.getTimezoneOffset() && (n = rn(e, t)), 60 * 60 * 24 * (365 + (t.getFullYear() % 4 === 0 ? 1 : 0)) + jt(n);
3618
- },
3619
- defaultResponseGranularity: "daily",
3620
- dataGranularity: "daily",
3621
- isRelative: !1,
3622
- allowedTiers: ["plus", "enterprise"]
3623
- })
3624
- ]
3625
- ]);
3626
- function es(e) {
3627
- const t = new Date(e.start), n = new Date(e.end), r = (n.getTime() - t.getTime()) / 1e3;
3628
- return e.timePeriodsKey && To(No.get(e.timePeriodsKey)) || new S({
3629
- key: "custom",
3630
- timeframeText: "custom",
3631
- display: "custom",
3632
- startCustom: t,
3633
- endCustom: n,
3634
- timeframeLength: () => r,
3635
- defaultResponseGranularity: "daily",
3636
- dataGranularity: "daily",
3637
- isRelative: !1,
3638
- allowedTiers: ["free", "plus", "enterprise"]
3639
- });
3640
- }
3641
- function ts(e) {
3642
- return {
3643
- ...e.key !== "custom" && { timePeriodsKey: e.key },
3644
- start: e.rawStart(),
3645
- end: e.rawEnd()
3646
- };
3647
- }
3648
- function ns(e) {
3649
- return {
3650
- key: e.key,
3651
- display: e.display,
3652
- timeframeText: e.timeframeText,
3653
- timeframeLength: () => e.key,
3654
- // Used to generate test IDs for the Kongponent.
3655
- start: () => e.rawStart(),
3656
- end: () => e.rawEnd()
3657
- };
3658
- }
3659
- function rn(e, t) {
3660
- return Wi(e.getTimezoneOffset() - t.getTimezoneOffset());
3661
- }
3662
- const rs = {
3663
- "15M": p.FIFTEEN_MIN,
3664
- "1H": p.ONE_HOUR,
3665
- "6H": p.SIX_HOUR,
3666
- "12H": p.TWELVE_HOUR,
3667
- "24H": p.ONE_DAY,
3668
- "7D": p.SEVEN_DAY,
3669
- "15m": p.FIFTEEN_MIN,
3670
- "1h": p.ONE_HOUR,
3671
- "6h": p.SIX_HOUR,
3672
- "12h": p.TWELVE_HOUR,
3673
- "24h": p.ONE_DAY,
3674
- "7d": p.SEVEN_DAY,
3675
- "30d": p.THIRTY_DAY,
3676
- "90d": p.NINETY_DAY,
3677
- "180d": p.ONE_HUNDRED_EIGHTY_DAY,
3678
- "365d": p.ONE_YEAR,
3679
- current_week: p.CURRENT_WEEK,
3680
- current_month: p.CURRENT_MONTH,
3681
- current_year: p.CURRENT_YEAR,
3682
- previous_week: p.PREVIOUS_WEEK,
3683
- previous_month: p.PREVIOUS_MONTH,
3684
- previous_year: p.PREVIOUS_YEAR
3685
- };
3686
- class et {
3687
- constructor(t) {
3688
- T(this, "_seed");
3689
- this._seed = t;
3690
- }
3691
- next(t, n) {
3692
- const r = Math.sin(this._seed++) * 1e4, i = r - Math.floor(r);
3693
- return Math.floor(i * (n - t + 1)) + t;
3694
- }
3695
- }
3696
- const as = (e, t, n) => {
3697
- const r = vn(10, 1e4), i = new et(r), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), m = [];
3698
- let g = 0;
3699
- for (let d = o; d <= c; d += 60 * 60 * 1e3)
3700
- if (t)
3701
- for (const h in t)
3702
- t[h].forEach((b) => {
3703
- g += i.next(50, 500);
3704
- const E = {
3705
- [h]: b,
3706
- [e.name]: g
3707
- }, N = {
3708
- version: "1.0",
3709
- timestamp: new Date(d).toISOString(),
3710
- event: E
3711
- };
3712
- m.push(N);
3713
- });
3714
- else {
3715
- g += i.next(50, 500);
3716
- const h = {
3717
- version: "1.0",
3718
- timestamp: new Date(d).toISOString(),
3719
- event: {
3720
- [e.name]: g
3721
- }
3722
- };
3723
- m.push(h);
3724
- }
3725
- const l = {};
3726
- if (t)
3727
- for (const d in t)
3728
- l[d] = {}, t[d].forEach((h) => {
3729
- l[d][h] = {
3730
- name: h,
3731
- deleted: !1
3732
- };
3733
- });
3734
- const f = {
3735
- start_ms: o,
3736
- end_ms: c,
3737
- start: new Date(o).toISOString(),
3738
- end: new Date(c).toISOString(),
3739
- query_id: "12345",
3740
- metric_names: [e.name],
3741
- metric_units: {
3742
- [e.name]: e.unit
3743
- },
3744
- granularity_ms: 60 * 60 * 1e3,
3745
- // 1 hour in ms
3746
- display: l,
3747
- ...n ?? {}
3748
- };
3749
- return {
3750
- data: m,
3751
- meta: f
3752
- };
3753
- }, is = (e, t) => {
3754
- const n = vn(10, 1e4), r = new et(n), i = Date.now() - 6 * 60 * 60 * 1e3, o = Date.now(), c = [], m = {};
3755
- e.forEach((l) => {
3756
- m[l.name] = 0;
3757
- });
3758
- for (let l = i; l <= o; l += 60 * 60 * 1e3) {
3759
- const f = {};
3760
- e.forEach((h) => {
3761
- m[h.name] += r.next(50, 500), f[h.name] = m[h.name];
3762
- });
3763
- const d = {
3764
- version: "1.0",
3765
- timestamp: new Date(l).toISOString(),
3766
- event: f
3767
- };
3768
- c.push(d);
3769
- }
3770
- const g = {
3771
- start_ms: i,
3772
- end_ms: o,
3773
- start: new Date(i).toISOString(),
3774
- end: new Date(o).toISOString(),
3775
- query_id: "12345",
3776
- metric_names: e.map((l) => l.name),
3777
- metric_units: e.reduce((l, f) => (l[f.name] = f.unit, l), {}),
3778
- granularity_ms: 60 * 60 * 1e3,
3779
- // 1 hour in ms
3780
- display: {},
3781
- ...t ?? {}
3782
- };
3783
- return {
3784
- data: c,
3785
- meta: g
3786
- };
3787
- }, os = (e, t, n) => {
3788
- const r = Math.floor(Math.random() * 9991) + 10, i = new et(r), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), m = new Date((o + c) / 2).toISOString(), g = [];
3789
- if (t) {
3790
- const d = Object.keys(t), h = Object.values(t), b = (E, N) => {
3791
- if (N === d.length) {
3792
- e.forEach((C) => {
3793
- E[C.name] = i.next(1e3, 5e7);
3794
- }), g.push({
3795
- version: "1.0",
3796
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3797
- event: { ...E }
3798
- });
3799
- return;
3800
- }
3801
- h[N].forEach((C) => {
3802
- b({ ...E, [d[N]]: C }, N + 1);
3803
- });
3804
- };
3805
- b({}, 0);
3806
- } else {
3807
- const d = {};
3808
- e.forEach((h) => {
3809
- d[h.name] = i.next(50, 500);
3810
- }), g.push({
3811
- version: "1.0",
3812
- timestamp: m,
3813
- event: d
3814
- });
3815
- }
3816
- const l = {};
3817
- if (t)
3818
- for (const d in t)
3819
- l[d] = {}, t[d].forEach((h) => {
3820
- l[d][h] = {
3821
- name: h,
3822
- deleted: !1
3823
- };
3824
- });
3825
- const f = {
3826
- start_ms: o,
3827
- end_ms: c,
3828
- start: new Date(o).toISOString(),
3829
- end: new Date(c).toISOString(),
3830
- query_id: "12345",
3831
- metric_names: e.map((d) => d.name),
3832
- metric_units: e.reduce((d, h) => (d[h.name] = h.unit, d), {}),
3833
- truncated: !1,
3834
- limit: 50,
3835
- display: l,
3836
- granularity_ms: c - o,
3837
- ...n ?? {}
3838
- };
3839
- return {
3840
- data: g,
3841
- meta: f
3842
- };
3843
- };
3844
- function vn(e, t) {
3845
- return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
3846
- }
3847
- const Io = new Map(dn.map((e) => [e.code, { code: e.code, name: e.name }])), ss = (e) => {
3848
- var t;
3849
- return ((t = Io.get(e)) == null ? void 0 : t.name) || e;
3850
- };
3851
- var Nn = { exports: {} };
3852
- (function(e) {
3853
- (function() {
3854
- function t(l, f) {
3855
- if (f.separator === !1 || l < 1e3)
3856
- return l.toString();
3857
- var d = typeof f.separator == "string" ? f.separator : ",", h = [], b = Math.round(l).toString().split("");
3858
- return b.reverse().forEach(function(E, N) {
3859
- N && N % 3 === 0 && h.push(d), h.push(E);
3860
- }), h.reverse().join("");
3861
- }
3862
- function n(l, f, d) {
3863
- var h = l / f, b = d.round ? "round" : "floor";
3864
- return d.decimal === !1 ? (l = Math[b](h), l.toString()) : (d.precision ? l = h : l = h < 10 ? Math[b](h * 10) / 10 : Math[b](h), l = l.toString(), typeof d.decimal == "string" && (l = l.replace(".", d.decimal)), l);
3865
- }
3866
- var r = 1e3, i = 1e4, o = 1e6, c = 1e9, m = 1e12;
3867
- function g(l, f) {
3868
- var d;
3869
- f = f || {};
3870
- var h = l < 0;
3871
- h && (l = Math.abs(l)), f.precision && (l = parseFloat(l.toPrecision(f.precision)));
3872
- var b = f.min10k ? i : r;
3873
- return l < b || f.precision && f.precision > Math.log10(l) ? d = t(n(l, 1, f), f) : l < o ? d = n(l, r, f) + "k" : l < c ? d = n(l, o, f) + "m" : l < m ? d = t(n(l, c, f), f) + "b" : d = t(n(l, m, f), f) + "t", h && (d = "-" + d), f.capital && (d = d.toUpperCase()), f.prefix && (d = f.prefix + d), f.suffix && (d = d + f.suffix), d;
3874
- }
3875
- g.addCommas = t, e.exports = g;
3876
- })();
3877
- })(Nn);
3878
- var xo = Nn.exports;
3879
- const Ve = /* @__PURE__ */ En(xo);
3880
- var an;
3881
- const $e = new Intl.NumberFormat(((an = document == null ? void 0 : document.documentElement) == null ? void 0 : an.lang) || "en-US");
3882
- function us({
3883
- i18n: e
3884
- }) {
3885
- const t = (o, c) => {
3886
- if (isNaN(o))
3887
- return "0 B";
3888
- const m = c ? Math.pow(2, 50) : 1e15, g = c ? Math.pow(2, 40) : 1e12, l = c ? Math.pow(2, 30) : 1e9, f = c ? Math.pow(2, 20) : 1e6, d = c ? Math.pow(2, 10) : 1e3;
3889
- let h;
3890
- return o >= m ? h = e.formatNumber(
3891
- Number.parseFloat((o / m).toPrecision(3)),
3892
- { style: "unit", unit: "petabyte", unitDisplay: "narrow" }
3893
- ) : o >= g ? h = e.formatNumber(
3894
- Number.parseFloat((o / g).toPrecision(3)),
3895
- { style: "unit", unit: "terabyte", unitDisplay: "narrow" }
3896
- ) : o >= l ? h = e.formatNumber(
3897
- Number.parseFloat((o / l).toPrecision(3)),
3898
- { style: "unit", unit: "gigabyte", unitDisplay: "narrow" }
3899
- ) : o >= f ? h = e.formatNumber(
3900
- Number.parseFloat((o / f).toPrecision(3)),
3901
- { style: "unit", unit: "megabyte", unitDisplay: "narrow" }
3902
- ) : o >= d ? h = e.formatNumber(
3903
- Number.parseFloat((o / d).toPrecision(3)),
3904
- { style: "unit", unit: "kilobyte", unitDisplay: "narrow" }
3905
- ) : h = e.formatNumber(
3906
- Number.parseFloat(o.toPrecision(3)),
3907
- { style: "unit", unit: "byte", unitDisplay: "narrow" }
3908
- ), h.replace(/([a-zA-Z]*)$/, " $1");
3909
- }, n = (o, c = "USD") => isNaN(o) ? c === "USD" ? "$0.00" : `${o}` : o >= 0.01 || c !== "USD" ? e.formatNumber(o, { style: "currency", currency: c }) : o < 1e-4 ? "< $0.0001" : `$${Number.parseFloat(o.toPrecision(4))}`;
3910
- return { formatUnit: (o, c, {
3911
- isBytes1024: m = !1,
3912
- currency: g = "USD",
3913
- approximate: l = !1,
3914
- translateUnit: f = (d) => d
3915
- } = {}) => {
3916
- const d = f(c, o);
3917
- switch (c) {
3918
- case "bytes":
3919
- return t(o, m);
3920
- case "usd":
3921
- return n(o, g);
3922
- case "ms":
3923
- case "count/minute":
3924
- case "token count":
3925
- case "count":
3926
- default:
3927
- return isNaN(o) ? `${o}` : l ? `${Ve(o, { capital: !0 })} ${d}` : o >= 0.01 ? `${$e.format(Number.parseFloat(o.toFixed(2)))} ${d}` : `${Number.parseFloat(o.toPrecision(4))} ${d}`;
3928
- }
3929
- }, formatBytes: t, formatCost: n, formatRange: (o, c, m, {
3930
- isBytes1024: g = !1,
3931
- currency: l = "USD",
3932
- approximate: f = !1,
3933
- translateUnit: d = (h) => h
3934
- } = {}) => {
3935
- const h = d(m, c);
3936
- switch (m) {
3937
- case "bytes":
3938
- return `${t(o, g)} - ${t(c, g)}`;
3939
- case "usd":
3940
- return `${n(o, l)} - ${n(c, l)}`;
3941
- case "ms":
3942
- case "count/minute":
3943
- case "token count":
3944
- case "count":
3945
- default:
3946
- if (isNaN(o) || isNaN(c))
3947
- return `${o} - ${c}`;
3948
- if (f)
3949
- return `${Ve(o, { capital: !0 })} - ${Ve(c, { capital: !0 })} ${h}`;
3950
- }
3951
- const b = o >= 0.01 ? `${$e.format(Number.parseFloat(o.toFixed(2)))}` : `${Number.parseFloat(o.toPrecision(4))}`, E = c >= 0.01 ? `${$e.format(Number.parseFloat(c.toFixed(2)))}` : `${Number.parseFloat(c.toPrecision(4))}`;
3952
- return `${b} - ${E} ${h}`;
3953
- } };
3954
- }
3955
- export {
3956
- dn as COUNTRIES,
3957
- Jo as DeltaQueryTime,
3958
- Co as EXPORT_RECORD_LIMIT,
3959
- Te as Granularities,
3960
- Yo as INJECT_QUERY_PROVIDER,
3961
- Ro as REFRESH_INTERVAL_MS,
3962
- et as SeededRandom,
3963
- rs as TIMEFRAME_LOOKUP,
3964
- No as TimePeriods,
3965
- S as Timeframe,
3966
- p as TimeframeKeys,
3967
- Ko as TimeseriesQueryTime,
3968
- wo as UnaryQueryTime,
3969
- aa as aiExploreAggregations,
3970
- Ma as apiUsageQuerySchema,
3971
- ma as barChartSchema,
3972
- un as basicExploreAggregations,
3973
- Sa as basicQuerySchema,
3974
- On as ceilToNearestTimeGrain,
3975
- ba as choroplethMapSchema,
3976
- Io as countries,
3977
- Vo as dashboardConfigSchema,
3978
- zo as dashboardTileTypes,
3979
- la as datasourceToFilterableDimensions,
3980
- es as datePickerSelectionToTimeframe,
3981
- ga as donutChartSchema,
3982
- rn as dstOffsetHours,
3983
- ra as exploreAggregations,
3984
- ta as exploreFilterTypesV2,
3985
- Go as extendedRelativeTimeRangeValues,
3986
- Oe as filterableAiExploreDimensions,
3987
- Me as filterableBasicExploreDimensions,
3988
- Se as filterableExploreDimensions,
3989
- oa as filterableRequestDimensions,
3990
- ca as filterableRequestMetrics,
3991
- Uo as filterableRequestWildcardDimensions,
3992
- _o as floorToNearestTimeGrain,
3993
- nn as formatTime,
3994
- Zo as formatTimeRange,
3995
- Bo as formatTimestamp,
3996
- ya as gaugeChartSchema,
3997
- os as generateCrossSectionalData,
3998
- is as generateMultipleMetricTimeSeriesData,
3999
- as as generateSingleMetricTimeSeriesData,
4000
- ss as getCountryName,
4001
- $o as getFieldDataSources,
4002
- Xo as granularitiesToOptions,
4003
- po as granularityMsToQuery,
4004
- sn as granularityValues,
4005
- Oa as llmUsageSchema,
4006
- _a as metricCardSchema,
4007
- Qo as msToGranularity,
4008
- $e as numberFormatter,
4009
- qo as queryDatasources,
4010
- ln as queryableAiExploreDimensions,
4011
- Ze as queryableBasicExploreDimensions,
4012
- cn as queryableExploreDimensions,
4013
- ia as queryableRequestDimensions,
4014
- ua as queryableRequestMetrics,
4015
- sa as queryableRequestWildcardDimensions,
4016
- vn as rand,
4017
- Wo as relativeTimeRangeValuesRequestV2,
4018
- on as relativeTimeRangeValuesV4,
4019
- ko as reportChartTypes,
4020
- na as requestFilterTypeEmptyV2,
4021
- Ao as requestFilterTypeEqualsV2,
4022
- Fo as requestFilterTypeMetricV2,
4023
- Ho as requestFilterTypeWildcardV2,
4024
- wa as singleValueSchema,
4025
- da as slottableSchema,
4026
- jo as stripUnknownFilters,
4027
- fa as thresholdSchema,
4028
- Ia as tileConfigSchema,
4029
- va as tileDefinitionSchema,
4030
- Na as tileLayoutSchema,
4031
- Lo as timeRangeTypeV2,
4032
- ts as timeframeToDatepickerSelection,
4033
- ns as timeframeToDatepickerTimeperiod,
4034
- ha as timeseriesChartSchema,
4035
- pa as topNTableSchema,
4036
- us as unitFormatter,
4037
- Ea as validDashboardQuery
4038
- };
4039
- //# sourceMappingURL=vitals-utilities.es.js.map