@kong-ui-public/analytics-utilities 12.1.0 → 12.1.1-pr.2582.06c0bb66d.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 (83) 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 -15
  9. package/dist/types/format.d.ts.map +0 -1
  10. package/dist/types/format.spec.tz.d.ts +0 -2
  11. package/dist/types/format.spec.tz.d.ts.map +0 -1
  12. package/dist/types/granularity.d.ts +0 -27
  13. package/dist/types/granularity.d.ts.map +0 -1
  14. package/dist/types/index.d.ts +0 -10
  15. package/dist/types/index.d.ts.map +0 -1
  16. package/dist/types/queryTime.d.ts +0 -36
  17. package/dist/types/queryTime.d.ts.map +0 -1
  18. package/dist/types/queryTime.spec.tz.d.ts +0 -2
  19. package/dist/types/queryTime.spec.tz.d.ts.map +0 -1
  20. package/dist/types/specUtils.d.ts +0 -3
  21. package/dist/types/specUtils.d.ts.map +0 -1
  22. package/dist/types/timeframes.d.ts +0 -33
  23. package/dist/types/timeframes.d.ts.map +0 -1
  24. package/dist/types/types/analytics-config.d.ts +0 -23
  25. package/dist/types/types/analytics-config.d.ts.map +0 -1
  26. package/dist/types/types/chart-types.d.ts +0 -3
  27. package/dist/types/types/chart-types.d.ts.map +0 -1
  28. package/dist/types/types/country-codes.d.ts +0 -745
  29. package/dist/types/types/country-codes.d.ts.map +0 -1
  30. package/dist/types/types/datepicker-selection.d.ts +0 -6
  31. package/dist/types/types/datepicker-selection.d.ts.map +0 -1
  32. package/dist/types/types/druid-granularity.d.ts +0 -6
  33. package/dist/types/types/druid-granularity.d.ts.map +0 -1
  34. package/dist/types/types/explore/advanced.d.ts +0 -20
  35. package/dist/types/types/explore/advanced.d.ts.map +0 -1
  36. package/dist/types/types/explore/ai.d.ts +0 -20
  37. package/dist/types/types/explore/ai.d.ts.map +0 -1
  38. package/dist/types/types/explore/all.d.ts +0 -18
  39. package/dist/types/types/explore/all.d.ts.map +0 -1
  40. package/dist/types/types/explore/basic.d.ts +0 -31
  41. package/dist/types/types/explore/basic.d.ts.map +0 -1
  42. package/dist/types/types/explore/common.d.ts +0 -34
  43. package/dist/types/types/explore/common.d.ts.map +0 -1
  44. package/dist/types/types/explore/index.d.ts +0 -8
  45. package/dist/types/types/explore/index.d.ts.map +0 -1
  46. package/dist/types/types/explore/requests.d.ts +0 -57
  47. package/dist/types/types/explore/requests.d.ts.map +0 -1
  48. package/dist/types/types/explore/result.d.ts +0 -48
  49. package/dist/types/types/explore/result.d.ts.map +0 -1
  50. package/dist/types/types/explore/util.d.ts +0 -8
  51. package/dist/types/types/explore/util.d.ts.map +0 -1
  52. package/dist/types/types/index.d.ts +0 -14
  53. package/dist/types/types/index.d.ts.map +0 -1
  54. package/dist/types/types/query-bridge.d.ts +0 -29
  55. package/dist/types/types/query-bridge.d.ts.map +0 -1
  56. package/dist/types/types/query-time.d.ts +0 -13
  57. package/dist/types/types/query-time.d.ts.map +0 -1
  58. package/dist/types/types/request-export.d.ts +0 -11
  59. package/dist/types/types/request-export.d.ts.map +0 -1
  60. package/dist/types/types/time-period.d.ts +0 -9
  61. package/dist/types/types/time-period.d.ts.map +0 -1
  62. package/dist/types/types/timeframe-keys.d.ts +0 -21
  63. package/dist/types/types/timeframe-keys.d.ts.map +0 -1
  64. package/dist/types/types/timeframe-options.d.ts +0 -18
  65. package/dist/types/types/timeframe-options.d.ts.map +0 -1
  66. package/dist/types/types/timeframe.d.ts +0 -17
  67. package/dist/types/types/timeframe.d.ts.map +0 -1
  68. package/dist/types/utils/GeoLookup.d.ts +0 -4
  69. package/dist/types/utils/GeoLookup.d.ts.map +0 -1
  70. package/dist/types/utils/SeedRandom.d.ts +0 -6
  71. package/dist/types/utils/SeedRandom.d.ts.map +0 -1
  72. package/dist/types/utils/chartDataGenerator.d.ts +0 -9
  73. package/dist/types/utils/chartDataGenerator.d.ts.map +0 -1
  74. package/dist/types/utils/helpers.d.ts +0 -2
  75. package/dist/types/utils/helpers.d.ts.map +0 -1
  76. package/dist/types/utils/index.d.ts +0 -5
  77. package/dist/types/utils/index.d.ts.map +0 -1
  78. package/dist/vitals-utilities.cjs +0 -2
  79. package/dist/vitals-utilities.cjs.map +0 -1
  80. package/dist/vitals-utilities.es.js +0 -3921
  81. package/dist/vitals-utilities.es.js.map +0 -1
  82. package/dist/vitals-utilities.umd.js +0 -2
  83. package/dist/vitals-utilities.umd.js.map +0 -1
@@ -1,3921 +0,0 @@
1
- var Zr = Object.defineProperty;
2
- var $r = (e, t, n) => t in e ? Zr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var T = (e, t, n) => $r(e, typeof t != "symbol" ? t + "" : t, n);
4
- const Eo = 3e4, No = 1e3, Io = "analytics-query-provider";
5
- var m = /* @__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))(m || {});
6
- const xo = ["90d", "180d", "365d", "current_year", "previous_year"], Ro = [
7
- "horizontal_bar",
8
- "vertical_bar",
9
- "timeseries_line",
10
- "choropleth_map",
11
- "timeseries_bar",
12
- "donut",
13
- "single_value"
14
- ], Xr = ["in", "not_in", "selector"], Po = ["=", "!="], Co = ["=", "!=", "<", ">", "<=", ">="], Qr = ["empty", "not_empty"], Yo = ["starts_with", "ends_with"], Go = ["absolute", "relative"], nn = [
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
- ], rn = [
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"), Ve = [
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(Ve), an = [
54
- "active_services",
55
- "request_count",
56
- "request_per_minute",
57
- "response_latency_average"
58
- ], on = [
59
- ...Ve,
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(on), Kr = [
69
- ...an,
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
- ], sn = [
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(sn), Jr = [
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
- ], ea = [
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
- ], ta = oe(ea), na = [
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
- ], Ao = na, ra = [
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
- ], aa = oe(ra), ko = [
180
- "15M",
181
- "1H",
182
- "6H",
183
- "12H",
184
- "24H",
185
- "7D"
186
- ], Ho = ["basic", "api_usage", "llm_usage"], ia = {
187
- basic: new Set(Me),
188
- api_usage: new Set(Se),
189
- llm_usage: new Set(Oe)
190
- }, Fo = (e, t) => t.filter((n) => ia[e].has(n.field)), un = [
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
- ], Lo = [
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
- }, cn = {
454
- type: "boolean"
455
- }, ln = {
456
- type: ["object", "array"],
457
- items: {
458
- type: "string"
459
- },
460
- additionalProperties: {
461
- type: "string"
462
- }
463
- }, oa = {
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
- }, sa = {
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: ln,
487
- synthetics_data_key: se,
488
- chart_title: U,
489
- allow_csv_export: cn
490
- },
491
- required: ["type"],
492
- additionalProperties: !1
493
- }, ua = {
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
- }, ca = {
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: ua
528
- }
529
- },
530
- chart_dataset_colors: ln,
531
- synthetics_data_key: se,
532
- chart_title: U,
533
- allow_csv_export: cn
534
- },
535
- required: ["type"],
536
- additionalProperties: !1
537
- }, la = {
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
- }, da = {
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
- }, ma = {
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
- }, fa = {
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
- }, ha = {
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
- }, ya = {
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: un.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
- }, ga = {
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: nn,
673
- default: "1h"
674
- }
675
- },
676
- required: [
677
- "type",
678
- "time_range"
679
- ],
680
- additionalProperties: !1
681
- }, pa = {
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
- }, Ze = {
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: rn
712
- },
713
- time_range: {
714
- type: "object",
715
- description: "The time range to query.",
716
- anyOf: [
717
- ga,
718
- pa
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
- }, $e = (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
- }), Xe = (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
- }), ve = (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: Xr
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: Qr
789
- }
790
- },
791
- required: [
792
- "field",
793
- "operator"
794
- ],
795
- additionalProperties: !1
796
- }
797
- ]
798
- }
799
- }), _a = {
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: $e(Kr),
810
- dimensions: Xe(on),
811
- filters: ve(Se),
812
- ...Ze
813
- },
814
- required: ["datasource"],
815
- additionalProperties: !1
816
- }, wa = {
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: $e(an),
827
- dimensions: Xe(Ve),
828
- filters: ve(Me),
829
- ...Ze
830
- },
831
- required: ["datasource"],
832
- additionalProperties: !1
833
- }, Ta = {
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: $e(Jr),
844
- dimensions: Xe(sn),
845
- filters: ve(Oe),
846
- ...Ze
847
- },
848
- required: ["datasource"],
849
- additionalProperties: !1
850
- }, ba = {
851
- anyOf: [_a, wa, Ta]
852
- }, Da = {
853
- type: "object",
854
- properties: {
855
- query: ba,
856
- chart: {
857
- anyOf: [
858
- sa,
859
- la,
860
- da,
861
- ca,
862
- fa,
863
- ma,
864
- oa,
865
- ha,
866
- ya
867
- ]
868
- }
869
- },
870
- required: ["query", "chart"],
871
- additionalProperties: !1
872
- }, Ma = {
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
- }, Sa = {
910
- type: "object",
911
- properties: {
912
- type: {
913
- type: "string",
914
- enum: ["chart"]
915
- },
916
- definition: Da,
917
- layout: Ma,
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
- }, Uo = {
926
- type: "object",
927
- properties: {
928
- tiles: {
929
- type: "array",
930
- items: Sa
931
- },
932
- tile_height: {
933
- type: "number",
934
- description: "Height of each tile in pixels."
935
- },
936
- preset_filters: ve([.../* @__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
- }, Wo = (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"), (ta.includes(e) || aa.includes(e)) && t.push("requests"), t;
947
- }, Oa = {
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
- }, va = (e, t, n) => {
1010
- let r;
1011
- const i = Oa[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 Fe(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 Ea = {
1021
- full: "EEEE, MMMM do, y",
1022
- long: "MMMM do, y",
1023
- medium: "MMM d, y",
1024
- short: "MM/dd/yyyy"
1025
- }, Na = {
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
- }, Ia = {
1031
- full: "{{date}} 'at' {{time}}",
1032
- long: "{{date}} 'at' {{time}}",
1033
- medium: "{{date}}, {{time}}",
1034
- short: "{{date}}, {{time}}"
1035
- }, xa = {
1036
- date: Fe({
1037
- formats: Ea,
1038
- defaultWidth: "full"
1039
- }),
1040
- time: Fe({
1041
- formats: Na,
1042
- defaultWidth: "full"
1043
- }),
1044
- dateTime: Fe({
1045
- formats: Ia,
1046
- defaultWidth: "full"
1047
- })
1048
- }, Ra = {
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
- }, Pa = (e, t, n, r) => Ra[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, d = n != null && n.width ? String(n.width) : c;
1062
- i = e.formattingValues[d] || e.formattingValues[c];
1063
- } else {
1064
- const c = e.defaultWidth, d = n != null && n.width ? String(n.width) : e.defaultWidth;
1065
- i = e.values[d] || e.values[c];
1066
- }
1067
- const s = e.argumentCallback ? e.argumentCallback(t) : t;
1068
- return i[s];
1069
- };
1070
- }
1071
- const Ca = {
1072
- narrow: ["B", "A"],
1073
- abbreviated: ["BC", "AD"],
1074
- wide: ["Before Christ", "Anno Domini"]
1075
- }, Ya = {
1076
- narrow: ["1", "2", "3", "4"],
1077
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1078
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1079
- }, Ga = {
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
- }, Aa = {
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
- }, ka = {
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
- }, Ha = {
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
- }, Fa = (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
- }, La = {
1197
- ordinalNumber: Fa,
1198
- era: re({
1199
- values: Ca,
1200
- defaultWidth: "wide"
1201
- }),
1202
- quarter: re({
1203
- values: Ya,
1204
- defaultWidth: "wide",
1205
- argumentCallback: (e) => e - 1
1206
- }),
1207
- month: re({
1208
- values: Ga,
1209
- defaultWidth: "wide"
1210
- }),
1211
- day: re({
1212
- values: Aa,
1213
- defaultWidth: "wide"
1214
- }),
1215
- dayPeriod: re({
1216
- values: ka,
1217
- defaultWidth: "wide",
1218
- formattingValues: Ha,
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], s = t.match(i);
1225
- if (!s)
1226
- return null;
1227
- const c = s[0], d = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], h = Array.isArray(d) ? Wa(d, (y) => y.test(c)) : (
1228
- // [TODO] -- I challenge you to fix the type
1229
- Ua(d, (y) => y.test(c))
1230
- );
1231
- let f;
1232
- f = e.valueCallback ? e.valueCallback(h) : h, f = n.valueCallback ? (
1233
- // [TODO] -- I challenge you to fix the type
1234
- n.valueCallback(f)
1235
- ) : f;
1236
- const _ = t.slice(c.length);
1237
- return { value: f, rest: _ };
1238
- };
1239
- }
1240
- function Ua(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 Wa(e, t) {
1246
- for (let n = 0; n < e.length; n++)
1247
- if (t(e[n]))
1248
- return n;
1249
- }
1250
- function qa(e) {
1251
- return (t, n = {}) => {
1252
- const r = t.match(e.matchPattern);
1253
- if (!r) return null;
1254
- const i = r[0], s = t.match(e.parsePattern);
1255
- if (!s) return null;
1256
- let c = e.valueCallback ? e.valueCallback(s[0]) : s[0];
1257
- c = n.valueCallback ? n.valueCallback(c) : c;
1258
- const d = t.slice(i.length);
1259
- return { value: c, rest: d };
1260
- };
1261
- }
1262
- const ja = /^(\d+)(th|st|nd|rd)?/i, za = /\d+/i, Ba = {
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
- }, Va = {
1267
- any: [/^b/i, /^(a|c)/i]
1268
- }, Za = {
1269
- narrow: /^[1234]/i,
1270
- abbreviated: /^q[1234]/i,
1271
- wide: /^[1234](th|st|nd|rd)? quarter/i
1272
- }, $a = {
1273
- any: [/1/i, /2/i, /3/i, /4/i]
1274
- }, Xa = {
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
- }, Qa = {
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
- }, Ka = {
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
- }, Ja = {
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
- }, ei = {
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
- }, ti = {
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
- }, ni = {
1330
- ordinalNumber: qa({
1331
- matchPattern: ja,
1332
- parsePattern: za,
1333
- valueCallback: (e) => parseInt(e, 10)
1334
- }),
1335
- era: ae({
1336
- matchPatterns: Ba,
1337
- defaultMatchWidth: "wide",
1338
- parsePatterns: Va,
1339
- defaultParseWidth: "any"
1340
- }),
1341
- quarter: ae({
1342
- matchPatterns: Za,
1343
- defaultMatchWidth: "wide",
1344
- parsePatterns: $a,
1345
- defaultParseWidth: "any",
1346
- valueCallback: (e) => e + 1
1347
- }),
1348
- month: ae({
1349
- matchPatterns: Xa,
1350
- defaultMatchWidth: "wide",
1351
- parsePatterns: Qa,
1352
- defaultParseWidth: "any"
1353
- }),
1354
- day: ae({
1355
- matchPatterns: Ka,
1356
- defaultMatchWidth: "wide",
1357
- parsePatterns: Ja,
1358
- defaultParseWidth: "any"
1359
- }),
1360
- dayPeriod: ae({
1361
- matchPatterns: ei,
1362
- defaultMatchWidth: "any",
1363
- parsePatterns: ti,
1364
- defaultParseWidth: "any"
1365
- })
1366
- }, ri = {
1367
- code: "en-US",
1368
- formatDistance: va,
1369
- formatLong: xa,
1370
- formatRelative: Pa,
1371
- localize: La,
1372
- match: ni,
1373
- options: {
1374
- weekStartsOn: 0,
1375
- firstWeekContainsDate: 1
1376
- }
1377
- };
1378
- let ai = {};
1379
- function ue() {
1380
- return ai;
1381
- }
1382
- const dn = 6048e5, ii = 864e5, oi = 60, si = 3600, Yt = Symbol.for("constructDateFrom");
1383
- function P(e, t) {
1384
- return typeof e == "function" ? e(t) : e && typeof e == "object" && Yt in e ? e[Yt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
1385
- }
1386
- function S(e, t) {
1387
- return P(t || e, e);
1388
- }
1389
- function Gt(e) {
1390
- const t = S(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 ui(e, ...t) {
1404
- const n = P.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 = S(e, t == null ? void 0 : t.in);
1412
- return n.setHours(0, 0, 0, 0), n;
1413
- }
1414
- function ci(e, t, n) {
1415
- const [r, i] = ui(
1416
- n == null ? void 0 : n.in,
1417
- e,
1418
- t
1419
- ), s = ie(r), c = ie(i), d = +s - Gt(s), h = +c - Gt(c);
1420
- return Math.round((d - h) / ii);
1421
- }
1422
- function li(e, t) {
1423
- const n = S(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 di(e, t) {
1427
- const n = S(e, t == null ? void 0 : t.in);
1428
- return ci(n, li(n)) + 1;
1429
- }
1430
- function k(e, t) {
1431
- var d, h, f, _;
1432
- const n = ue(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? n.weekStartsOn ?? ((_ = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : _.weekStartsOn) ?? 0, i = S(e, t == null ? void 0 : t.in), s = i.getDay(), c = (s < r ? 7 : 0) + s - r;
1433
- return i.setDate(i.getDate() - c), i.setHours(0, 0, 0, 0), i;
1434
- }
1435
- function _e(e, t) {
1436
- return k(e, { ...t, weekStartsOn: 1 });
1437
- }
1438
- function mn(e, t) {
1439
- const n = S(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = P(n, 0);
1440
- i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
1441
- const s = _e(i), c = P(n, 0);
1442
- c.setFullYear(r, 0, 4), c.setHours(0, 0, 0, 0);
1443
- const d = _e(c);
1444
- return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1;
1445
- }
1446
- function mi(e, t) {
1447
- const n = mn(e, t), r = P(e, 0);
1448
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), _e(r);
1449
- }
1450
- function fi(e, t) {
1451
- const n = S(e, t == null ? void 0 : t.in), r = +_e(n) - +mi(n);
1452
- return Math.round(r / dn) + 1;
1453
- }
1454
- function fn(e, t) {
1455
- var _, y, g, I;
1456
- const n = S(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = ue(), s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((y = (_ = t == null ? void 0 : t.locale) == null ? void 0 : _.options) == null ? void 0 : y.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((I = (g = i.locale) == null ? void 0 : g.options) == null ? void 0 : I.firstWeekContainsDate) ?? 1, c = P((t == null ? void 0 : t.in) || e, 0);
1457
- c.setFullYear(r + 1, 0, s), c.setHours(0, 0, 0, 0);
1458
- const d = k(c, t), h = P((t == null ? void 0 : t.in) || e, 0);
1459
- h.setFullYear(r, 0, s), h.setHours(0, 0, 0, 0);
1460
- const f = k(h, t);
1461
- return +n >= +d ? r + 1 : +n >= +f ? r : r - 1;
1462
- }
1463
- function hi(e, t) {
1464
- var d, h, f, _;
1465
- const n = ue(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((_ = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : _.firstWeekContainsDate) ?? 1, i = fn(e, t), s = P((t == null ? void 0 : t.in) || e, 0);
1466
- return s.setFullYear(i, 0, r), s.setHours(0, 0, 0, 0), k(s, t);
1467
- }
1468
- function yi(e, t) {
1469
- const n = S(e, t == null ? void 0 : t.in), r = +k(n, t) - +hi(n, t);
1470
- return Math.round(r / dn) + 1;
1471
- }
1472
- function p(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 p(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) : p(n + 1, 2);
1486
- },
1487
- // Day of the month
1488
- d(e, t) {
1489
- return p(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 p(e.getHours() % 12 || 12, t.length);
1510
- },
1511
- // Hour [0-23]
1512
- H(e, t) {
1513
- return p(e.getHours(), t.length);
1514
- },
1515
- // Minute
1516
- m(e, t) {
1517
- return p(e.getMinutes(), t.length);
1518
- },
1519
- // Second
1520
- s(e, t) {
1521
- return p(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 p(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
- }, At = {
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 = fn(e, r), s = i > 0 ? i : 1 - i;
1564
- if (t === "YY") {
1565
- const c = s % 100;
1566
- return p(c, 2);
1567
- }
1568
- return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : p(s, t.length);
1569
- },
1570
- // ISO week-numbering year
1571
- R: function(e, t) {
1572
- const n = mn(e);
1573
- return p(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 p(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 p(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 p(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 p(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 = yi(e, r);
1696
- return t === "wo" ? n.ordinalNumber(i, { unit: "week" }) : p(i, t.length);
1697
- },
1698
- // ISO week of year
1699
- I: function(e, t, n) {
1700
- const r = fi(e);
1701
- return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : p(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 = di(e);
1710
- return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : p(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(), s = (i - r.weekStartsOn + 8) % 7 || 7;
1744
- switch (t) {
1745
- case "e":
1746
- return String(s);
1747
- case "ee":
1748
- return p(s, 2);
1749
- case "eo":
1750
- return n.ordinalNumber(s, { 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(), s = (i - r.weekStartsOn + 8) % 7 || 7;
1777
- switch (t) {
1778
- case "c":
1779
- return String(s);
1780
- case "cc":
1781
- return p(s, t.length);
1782
- case "co":
1783
- return n.ordinalNumber(s, { 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 p(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" }) : p(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" }) : p(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 Ht(r);
1964
- case "XXXX":
1965
- case "XX":
1966
- return V(r);
1967
- case "XXXXX":
1968
- case "XXX":
1969
- default:
1970
- return V(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 Ht(r);
1979
- case "xxxx":
1980
- case "xx":
1981
- return V(r);
1982
- case "xxxxx":
1983
- case "xxx":
1984
- default:
1985
- return V(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" + kt(r, ":");
1996
- case "OOOO":
1997
- default:
1998
- return "GMT" + V(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" + kt(r, ":");
2009
- case "zzzz":
2010
- default:
2011
- return "GMT" + V(r, ":");
2012
- }
2013
- },
2014
- // Seconds timestamp
2015
- t: function(e, t, n) {
2016
- const r = Math.trunc(+e / 1e3);
2017
- return p(r, t.length);
2018
- },
2019
- // Milliseconds timestamp
2020
- T: function(e, t, n) {
2021
- return p(+e, t.length);
2022
- }
2023
- };
2024
- function kt(e, t = "") {
2025
- const n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.trunc(r / 60), s = r % 60;
2026
- return s === 0 ? n + String(i) : n + String(i) + t + p(s, 2);
2027
- }
2028
- function Ht(e, t) {
2029
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + p(Math.abs(e) / 60, 2) : V(e, t);
2030
- }
2031
- function V(e, t = "") {
2032
- const n = e > 0 ? "-" : "+", r = Math.abs(e), i = p(Math.trunc(r / 60), 2), s = p(r % 60, 2);
2033
- return n + i + t + s;
2034
- }
2035
- const Ft = (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
- }, hn = (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
- }, gi = (e, t) => {
2060
- const n = e.match(/(P+)(p+)?/) || [], r = n[1], i = n[2];
2061
- if (!i)
2062
- return Ft(e, t);
2063
- let s;
2064
- switch (r) {
2065
- case "P":
2066
- s = t.dateTime({ width: "short" });
2067
- break;
2068
- case "PP":
2069
- s = t.dateTime({ width: "medium" });
2070
- break;
2071
- case "PPP":
2072
- s = t.dateTime({ width: "long" });
2073
- break;
2074
- case "PPPP":
2075
- default:
2076
- s = t.dateTime({ width: "full" });
2077
- break;
2078
- }
2079
- return s.replace("{{date}}", Ft(r, t)).replace("{{time}}", hn(i, t));
2080
- }, pi = {
2081
- p: hn,
2082
- P: gi
2083
- }, _i = /^D+$/, wi = /^Y+$/, Ti = ["D", "DD", "YY", "YYYY"];
2084
- function bi(e) {
2085
- return _i.test(e);
2086
- }
2087
- function Di(e) {
2088
- return wi.test(e);
2089
- }
2090
- function Mi(e, t, n) {
2091
- const r = Si(e, t, n);
2092
- if (console.warn(r), Ti.includes(e)) throw new RangeError(r);
2093
- }
2094
- function Si(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 Oi(e) {
2099
- return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
2100
- }
2101
- function vi(e) {
2102
- return !(!Oi(e) && typeof e != "number" || isNaN(+S(e)));
2103
- }
2104
- const Ei = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ni = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ii = /^'([^]*?)'?$/, xi = /''/g, Ri = /[a-zA-Z]/;
2105
- function Pi(e, t, n) {
2106
- var _, y, g, I, x, R, C, W;
2107
- const r = ue(), i = (n == null ? void 0 : n.locale) ?? r.locale ?? ri, s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((y = (_ = n == null ? void 0 : n.locale) == null ? void 0 : _.options) == null ? void 0 : y.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((I = (g = r.locale) == null ? void 0 : g.options) == null ? void 0 : I.firstWeekContainsDate) ?? 1, c = (n == null ? void 0 : n.weekStartsOn) ?? ((R = (x = n == null ? void 0 : n.locale) == null ? void 0 : x.options) == null ? void 0 : R.weekStartsOn) ?? r.weekStartsOn ?? ((W = (C = r.locale) == null ? void 0 : C.options) == null ? void 0 : W.weekStartsOn) ?? 0, d = S(e, n == null ? void 0 : n.in);
2108
- if (!vi(d))
2109
- throw new RangeError("Invalid time value");
2110
- let h = t.match(Ni).map((O) => {
2111
- const b = O[0];
2112
- if (b === "p" || b === "P") {
2113
- const q = pi[b];
2114
- return q(O, i.formatLong);
2115
- }
2116
- return O;
2117
- }).join("").match(Ei).map((O) => {
2118
- if (O === "''")
2119
- return { isToken: !1, value: "'" };
2120
- const b = O[0];
2121
- if (b === "'")
2122
- return { isToken: !1, value: Ci(O) };
2123
- if (At[b])
2124
- return { isToken: !0, value: O };
2125
- if (b.match(Ri))
2126
- throw new RangeError(
2127
- "Format string contains an unescaped latin alphabet character `" + b + "`"
2128
- );
2129
- return { isToken: !1, value: O };
2130
- });
2131
- i.localize.preprocessor && (h = i.localize.preprocessor(d, h));
2132
- const f = {
2133
- firstWeekContainsDate: s,
2134
- weekStartsOn: c,
2135
- locale: i
2136
- };
2137
- return h.map((O) => {
2138
- if (!O.isToken) return O.value;
2139
- const b = O.value;
2140
- (!(n != null && n.useAdditionalWeekYearTokens) && Di(b) || !(n != null && n.useAdditionalDayOfYearTokens) && bi(b)) && Mi(b, t, String(e));
2141
- const q = At[b[0]];
2142
- return q(d, b, i.localize, f);
2143
- }).join("");
2144
- }
2145
- function Ci(e) {
2146
- const t = e.match(Ii);
2147
- return t ? t[1].replace(xi, "'") : e;
2148
- }
2149
- function Le(e, t, n) {
2150
- const r = S(e, n == null ? void 0 : n.in);
2151
- return isNaN(t) ? P(e, NaN) : (r.setDate(r.getDate() + t), r);
2152
- }
2153
- function Yi(e, t, n) {
2154
- const r = S(e, n == null ? void 0 : n.in);
2155
- if (isNaN(t)) return P(e, NaN);
2156
- const i = r.getDate(), s = P(e, r.getTime());
2157
- s.setMonth(r.getMonth() + t + 1, 0);
2158
- const c = s.getDate();
2159
- return i >= c ? s : (r.setFullYear(
2160
- s.getFullYear(),
2161
- s.getMonth(),
2162
- i
2163
- ), r);
2164
- }
2165
- function ee(e, t) {
2166
- const n = S(e, t == null ? void 0 : t.in);
2167
- return n.setDate(1), n.setHours(0, 0, 0, 0), n;
2168
- }
2169
- function Gi(e, t) {
2170
- const n = S(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = n.getMonth(), s = P(n, 0);
2171
- return s.setFullYear(r, i + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
2172
- }
2173
- function Ai() {
2174
- return Object.assign({}, ue());
2175
- }
2176
- function Lt(e) {
2177
- return +S(e);
2178
- }
2179
- function Ut(e) {
2180
- return Math.trunc(+S(e) / 1e3);
2181
- }
2182
- function Wt(e) {
2183
- return Math.trunc(e * si);
2184
- }
2185
- function ki(e) {
2186
- const t = e / oi;
2187
- return Math.trunc(t);
2188
- }
2189
- function yn(e, t, n) {
2190
- return Yi(e, -1, n);
2191
- }
2192
- function qt(e, t, n) {
2193
- const r = Ai(), i = Li(e, n.timeZone, n.locale ?? r.locale);
2194
- return "formatToParts" in i ? Hi(i, t) : Fi(i, t);
2195
- }
2196
- function Hi(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 Fi(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 Li(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 Ui(e, t) {
2213
- const n = Bi(t);
2214
- return "formatToParts" in n ? qi(n, e) : ji(n, e);
2215
- }
2216
- const Wi = {
2217
- year: 0,
2218
- month: 1,
2219
- day: 2,
2220
- hour: 3,
2221
- minute: 4,
2222
- second: 5
2223
- };
2224
- function qi(e, t) {
2225
- try {
2226
- const n = e.formatToParts(t), r = [];
2227
- for (let i = 0; i < n.length; i++) {
2228
- const s = Wi[n[i].type];
2229
- s !== void 0 && (r[s] = 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 ji(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 = {}, jt = 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")), zi = jt === "06/25/2014, 00:00:00" || jt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
2259
- function Bi(e) {
2260
- return Ue[e] || (Ue[e] = zi ? 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 Qe(e, t, n, r, i, s, c) {
2281
- const d = /* @__PURE__ */ new Date(0);
2282
- return d.setUTCFullYear(e, t, n), d.setUTCHours(r, i, s, c), d;
2283
- }
2284
- const zt = 36e5, Vi = 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, s;
2296
- if (r = We.timezoneHH.exec(e), r)
2297
- return i = parseInt(r[1], 10), Bt(i) ? -(i * zt) : 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) ? (s = Math.abs(i) * zt + c * Vi, r[1] === "+" ? -s : s) : NaN;
2302
- }
2303
- if (Xi(e)) {
2304
- t = new Date(t || Date.now());
2305
- const c = n ? t : Zi(t), d = Be(c, e);
2306
- return -(n ? d : $i(t, d, e));
2307
- }
2308
- return NaN;
2309
- }
2310
- function Zi(e) {
2311
- return Qe(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
2312
- }
2313
- function Be(e, t) {
2314
- const n = Ui(e, t), r = Qe(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
2315
- let i = e.getTime();
2316
- const s = i % 1e3;
2317
- return i -= s >= 0 ? s : 1e3 + s, r - i;
2318
- }
2319
- function $i(e, t, n) {
2320
- let i = e.getTime() - t;
2321
- const s = Be(new Date(i), n);
2322
- if (t === s)
2323
- return t;
2324
- i -= s - t;
2325
- const c = Be(new Date(i), n);
2326
- return s === c ? s : Math.max(s, c);
2327
- }
2328
- function Bt(e, t) {
2329
- return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
2330
- }
2331
- const Vt = {};
2332
- function Xi(e) {
2333
- if (Vt[e])
2334
- return !0;
2335
- try {
2336
- return new Intl.DateTimeFormat(void 0, { timeZone: e }), Vt[e] = !0, !0;
2337
- } catch {
2338
- return !1;
2339
- }
2340
- }
2341
- const Qi = 60 * 1e3, Ki = {
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 Zt(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 Zt(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" + Ji(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 qt("short", e, n);
2394
- case "zzzz":
2395
- default:
2396
- return qt("long", e, n);
2397
- }
2398
- }
2399
- };
2400
- function qe(e, t) {
2401
- const n = e ? ce(e, t, !0) / Qi : (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), s = we(Math.floor(r % 60), 2);
2415
- return n + i + t + s;
2416
- }
2417
- function Zt(e, t) {
2418
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + we(Math.abs(e) / 60, 2) : J(e, t);
2419
- }
2420
- function Ji(e, t = "") {
2421
- const n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.floor(r / 60), s = r % 60;
2422
- return s === 0 ? n + String(i) : n + String(i) + t + we(s, 2);
2423
- }
2424
- function $t(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 gn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, je = 36e5, Xt = 6e4, eo = 2, v = {
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: gn
2461
- };
2462
- function Te(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 ? eo : 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 = to(e), { year: i, restDateString: s } = no(r.date, n), c = ro(s, i);
2477
- if (c === null || isNaN(c.getTime()))
2478
- return /* @__PURE__ */ new Date(NaN);
2479
- if (c) {
2480
- const d = c.getTime();
2481
- let h = 0, f;
2482
- if (r.time && (h = ao(r.time), h === null || isNaN(h)))
2483
- return /* @__PURE__ */ new Date(NaN);
2484
- if (r.timeZone || t.timeZone) {
2485
- if (f = ce(r.timeZone || t.timeZone, new Date(d + h)), isNaN(f))
2486
- return /* @__PURE__ */ new Date(NaN);
2487
- } else
2488
- f = $t(new Date(d + h)), f = $t(new Date(d + h + f));
2489
- return new Date(d + h + f);
2490
- } else
2491
- return /* @__PURE__ */ new Date(NaN);
2492
- }
2493
- function to(e) {
2494
- const t = {};
2495
- let n = v.dateTimePattern.exec(e), r;
2496
- if (n ? (t.date = n[1], r = n[3]) : (n = v.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
2497
- const i = v.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 no(e, t) {
2503
- if (e) {
2504
- const n = v.YYY[t], r = v.YYYYY[t];
2505
- let i = v.YYYY.exec(e) || r.exec(e);
2506
- if (i) {
2507
- const s = i[1];
2508
- return {
2509
- year: parseInt(s, 10),
2510
- restDateString: e.slice(s.length)
2511
- };
2512
- }
2513
- if (i = v.YY.exec(e) || n.exec(e), i) {
2514
- const s = i[1];
2515
- return {
2516
- year: parseInt(s, 10) * 100,
2517
- restDateString: e.slice(s.length)
2518
- };
2519
- }
2520
- }
2521
- return {
2522
- year: null
2523
- };
2524
- }
2525
- function ro(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 s = v.MM.exec(e);
2532
- if (s)
2533
- return n = /* @__PURE__ */ new Date(0), r = parseInt(s[1], 10) - 1, Kt(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
2534
- if (s = v.DDD.exec(e), s) {
2535
- n = /* @__PURE__ */ new Date(0);
2536
- const c = parseInt(s[1], 10);
2537
- return so(t, c) ? (n.setUTCFullYear(t, 0, c), n) : /* @__PURE__ */ new Date(NaN);
2538
- }
2539
- if (s = v.MMDD.exec(e), s) {
2540
- n = /* @__PURE__ */ new Date(0), r = parseInt(s[1], 10) - 1;
2541
- const c = parseInt(s[2], 10);
2542
- return Kt(t, r, c) ? (n.setUTCFullYear(t, r, c), n) : /* @__PURE__ */ new Date(NaN);
2543
- }
2544
- if (s = v.Www.exec(e), s)
2545
- return i = parseInt(s[1], 10) - 1, Jt(i) ? Qt(t, i) : /* @__PURE__ */ new Date(NaN);
2546
- if (s = v.WwwD.exec(e), s) {
2547
- i = parseInt(s[1], 10) - 1;
2548
- const c = parseInt(s[2], 10) - 1;
2549
- return Jt(i, c) ? Qt(t, i, c) : /* @__PURE__ */ new Date(NaN);
2550
- }
2551
- return null;
2552
- }
2553
- function ao(e) {
2554
- let t, n, r = v.HH.exec(e);
2555
- if (r)
2556
- return t = parseFloat(r[1].replace(",", ".")), ze(t) ? t % 24 * je : NaN;
2557
- if (r = v.HHMM.exec(e), r)
2558
- return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), ze(t, n) ? t % 24 * je + n * Xt : NaN;
2559
- if (r = v.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 * Xt + i * 1e3 : NaN;
2563
- }
2564
- return null;
2565
- }
2566
- function Qt(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, s = t * 7 + n + 1 - i;
2571
- return r.setUTCDate(r.getUTCDate() + s), r;
2572
- }
2573
- const io = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], oo = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2574
- function pn(e) {
2575
- return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
2576
- }
2577
- function Kt(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 = pn(e);
2584
- if (r && n > oo[t] || !r && n > io[t])
2585
- return !1;
2586
- }
2587
- return !0;
2588
- }
2589
- function so(e, t) {
2590
- if (t < 1)
2591
- return !1;
2592
- const n = pn(e);
2593
- return !(n && t > 366 || !n && t > 365);
2594
- }
2595
- function Jt(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 uo = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
2602
- function co(e, t, n = {}) {
2603
- t = String(t);
2604
- const r = t.match(uo);
2605
- if (r) {
2606
- const i = Te(n.originalDate || e, n);
2607
- t = r.reduce(function(s, c) {
2608
- if (c[0] === "'")
2609
- return s;
2610
- const d = s.indexOf(c), h = s[d - 1] === "'", f = s.replace(c, "'" + Ki[c[0]](i, c, n) + "'");
2611
- return h ? f.substring(0, d - 1) + f.substring(d + 1) : f;
2612
- }, t);
2613
- }
2614
- return Pi(e, t, n);
2615
- }
2616
- function _n(e, t, n) {
2617
- e = Te(e, n);
2618
- const r = ce(t, e, !0), i = new Date(e.getTime() - r), s = /* @__PURE__ */ new Date(0);
2619
- return s.setFullYear(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate()), s.setHours(i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds()), s;
2620
- }
2621
- function wn(e, t, n, r) {
2622
- return r = {
2623
- ...r,
2624
- timeZone: t,
2625
- originalDate: e
2626
- }, co(_n(e, t, { timeZone: r.timeZone }), n, r);
2627
- }
2628
- function lo(e, t, n) {
2629
- if (typeof e == "string" && !e.match(gn))
2630
- return Te(e, { ...n, timeZone: t });
2631
- e = Te(e, n);
2632
- const r = Qe(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 Tn(e, t) {
2636
- return -ce(e, t);
2637
- }
2638
- function qo(e, t = {}) {
2639
- const n = (t == null ? void 0 : t.tz) || Intl.DateTimeFormat().resolvedOptions().timeZone, r = t != null && t.includeTZ ? "yyyy-MM-dd HH:mm:ss.SSS (z)" : "yyyy-MM-dd HH:mm:ss.SSS";
2640
- return wn(e, n, r);
2641
- }
2642
- function en(e, t = {}) {
2643
- if (!e)
2644
- return e;
2645
- const n = t.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
2646
- try {
2647
- let r = "MMM dd, yyy hh:mm a";
2648
- t.short && (r = "MMM dd, yyy"), t.includeTZ && (r += " (z)");
2649
- const i = new Date(e);
2650
- return wn(i, n, r);
2651
- } catch {
2652
- return console.error("Invalid value passed to formatTime", e), "(invalid date)";
2653
- }
2654
- }
2655
- function jo(e, t) {
2656
- return `${en(e.getTime())} - ${en(t.getTime(), { includeTZ: !0 })}`;
2657
- }
2658
- const be = {
2659
- secondly: 1e3,
2660
- tenSecondly: 10 * 1e3,
2661
- thirtySecondly: 30 * 1e3,
2662
- minutely: 60 * 1e3,
2663
- fiveMinutely: 5 * 60 * 1e3,
2664
- tenMinutely: 10 * 60 * 1e3,
2665
- thirtyMinutely: 30 * 60 * 1e3,
2666
- hourly: 60 * 60 * 1e3,
2667
- twoHourly: 2 * 60 * 60 * 1e3,
2668
- twelveHourly: 12 * 60 * 60 * 1e3,
2669
- daily: 60 * 60 * 24 * 1e3,
2670
- weekly: 60 * 60 * 24 * 7 * 1e3,
2671
- trend: 0
2672
- };
2673
- function zo(e, t) {
2674
- return e.map((n) => ({
2675
- value: n,
2676
- label: t.t(`configuration.vitals.reports.granularity.${n}`)
2677
- }));
2678
- }
2679
- function mo(e, t) {
2680
- return {
2681
- duration: e,
2682
- type: "duration",
2683
- origin: t
2684
- };
2685
- }
2686
- function Bo(e) {
2687
- return e && rn.find((n) => e <= be[n]) || null;
2688
- }
2689
- function bn(e, t, n, r) {
2690
- const i = be[n];
2691
- let s = 0;
2692
- return i >= be.daily && (r ? s = -Tn(r, t) : s = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - s) / i) * i + s);
2693
- }
2694
- function fo(e, t, n) {
2695
- return bn(Math.floor, e, t, n);
2696
- }
2697
- function Dn(e, t, n) {
2698
- return bn(Math.ceil, e, t, n);
2699
- }
2700
- class Ee {
2701
- constructor(t, n, r) {
2702
- T(this, "timeframe");
2703
- T(this, "tz");
2704
- T(this, "dataGranularity");
2705
- if (this.constructor === Ee)
2706
- throw new Error("BaseQueryTime is not meant to be used directly.");
2707
- this.timeframe = t, this.tz = n, this.dataGranularity = r ?? t.dataGranularity;
2708
- }
2709
- calculateStartDate(t, n, r = 1) {
2710
- if (t)
2711
- return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * r);
2712
- {
2713
- const i = this.endDate(), s = this.timeframe.rawStart(this.tz), c = fo(s, n, this.tz), h = (i.getTime() - c.getTime()) * (r - 1);
2714
- return new Date(c.getTime() - h);
2715
- }
2716
- }
2717
- granularitySeconds() {
2718
- return Math.floor(this.granularityMs() / 1e3);
2719
- }
2720
- granularityDruid() {
2721
- return mo(this.granularityMs(), this.startDate().toISOString());
2722
- }
2723
- // Return a UNIX timestamp suitable for use in the `start` query param.
2724
- startSeconds() {
2725
- return Ut(this.startDate());
2726
- }
2727
- // Return a UNIX timestamp suitable for use in the `end` query param.
2728
- endSeconds() {
2729
- return Ut(this.endDate());
2730
- }
2731
- // Return epoch time in milliseconds, suitable for use in the `startMs` query param.
2732
- startMs() {
2733
- return Lt(this.startDate());
2734
- }
2735
- // Return epoch time in milliseconds, suitable for use in the `endMs` query param.
2736
- endMs() {
2737
- return Lt(this.endDate());
2738
- }
2739
- }
2740
- class Vo extends Ee {
2741
- constructor(n, r, i, s, c) {
2742
- super(n, i, s);
2743
- T(this, "granularity");
2744
- r && n.allowedGranularities(c).has(r) ? this.granularity = r : c ? this.granularity = n.fineGrainedDefaultGranularity ?? n.defaultResponseGranularity : this.granularity = n.defaultResponseGranularity;
2745
- }
2746
- startDate() {
2747
- return this.calculateStartDate(this.timeframe.isRelative, this.granularity);
2748
- }
2749
- endDate() {
2750
- return Dn(this.timeframe.rawEnd(), this.granularity, this.tz);
2751
- }
2752
- granularityMs() {
2753
- return be[this.granularity];
2754
- }
2755
- }
2756
- class ho extends Ee {
2757
- startDate() {
2758
- return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity);
2759
- }
2760
- endDate() {
2761
- return Dn(this.timeframe.rawEnd(this.tz), this.dataGranularity, this.tz);
2762
- }
2763
- granularityMs() {
2764
- return this.endDate().getTime() - this.startDate().getTime();
2765
- }
2766
- }
2767
- class Zo extends ho {
2768
- startDate() {
2769
- return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
2770
- }
2771
- granularityMs() {
2772
- return this.endDate().getTime() - super.startDate().getTime();
2773
- }
2774
- }
2775
- var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2776
- function yo(e) {
2777
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2778
- }
2779
- var De = { exports: {} };
2780
- De.exports;
2781
- (function(e, t) {
2782
- var n = 200, r = "__lodash_hash_undefined__", i = 9007199254740991, s = "[object Arguments]", c = "[object Array]", d = "[object Boolean]", h = "[object Date]", f = "[object Error]", _ = "[object Function]", y = "[object GeneratorFunction]", g = "[object Map]", I = "[object Number]", x = "[object Object]", R = "[object Promise]", C = "[object RegExp]", W = "[object Set]", O = "[object String]", b = "[object Symbol]", q = "[object WeakMap]", Je = "[object ArrayBuffer]", le = "[object DataView]", et = "[object Float32Array]", tt = "[object Float64Array]", nt = "[object Int8Array]", rt = "[object Int16Array]", at = "[object Int32Array]", it = "[object Uint8Array]", ot = "[object Uint8ClampedArray]", st = "[object Uint16Array]", ut = "[object Uint32Array]", Sn = /[\\^$.*+?()[\]{}|]/g, On = /\w*$/, vn = /^\[object .+?Constructor\]$/, En = /^(?:0|[1-9]\d*)$/, w = {};
2783
- w[s] = w[c] = w[Je] = w[le] = w[d] = w[h] = w[et] = w[tt] = w[nt] = w[rt] = w[at] = w[g] = w[I] = w[x] = w[C] = w[W] = w[O] = w[b] = w[it] = w[ot] = w[st] = w[ut] = !0, w[f] = w[_] = w[q] = !1;
2784
- var Nn = typeof pe == "object" && pe && pe.Object === Object && pe, In = typeof self == "object" && self && self.Object === Object && self, Y = Nn || In || Function("return this")(), ct = t && !t.nodeType && t, lt = ct && !0 && e && !e.nodeType && e, xn = lt && lt.exports === ct;
2785
- function Rn(a, o) {
2786
- return a.set(o[0], o[1]), a;
2787
- }
2788
- function Pn(a, o) {
2789
- return a.add(o), a;
2790
- }
2791
- function Cn(a, o) {
2792
- for (var u = -1, l = a ? a.length : 0; ++u < l && o(a[u], u, a) !== !1; )
2793
- ;
2794
- return a;
2795
- }
2796
- function Yn(a, o) {
2797
- for (var u = -1, l = o.length, D = a.length; ++u < l; )
2798
- a[D + u] = o[u];
2799
- return a;
2800
- }
2801
- function dt(a, o, u, l) {
2802
- for (var D = -1, E = a ? a.length : 0; ++D < E; )
2803
- u = o(u, a[D], D, a);
2804
- return u;
2805
- }
2806
- function Gn(a, o) {
2807
- for (var u = -1, l = Array(a); ++u < a; )
2808
- l[u] = o(u);
2809
- return l;
2810
- }
2811
- function An(a, o) {
2812
- return a == null ? void 0 : a[o];
2813
- }
2814
- function mt(a) {
2815
- var o = !1;
2816
- if (a != null && typeof a.toString != "function")
2817
- try {
2818
- o = !!(a + "");
2819
- } catch {
2820
- }
2821
- return o;
2822
- }
2823
- function ft(a) {
2824
- var o = -1, u = Array(a.size);
2825
- return a.forEach(function(l, D) {
2826
- u[++o] = [D, l];
2827
- }), u;
2828
- }
2829
- function Ne(a, o) {
2830
- return function(u) {
2831
- return a(o(u));
2832
- };
2833
- }
2834
- function ht(a) {
2835
- var o = -1, u = Array(a.size);
2836
- return a.forEach(function(l) {
2837
- u[++o] = l;
2838
- }), u;
2839
- }
2840
- var kn = Array.prototype, Hn = Function.prototype, de = Object.prototype, Ie = Y["__core-js_shared__"], yt = function() {
2841
- var a = /[^.]+$/.exec(Ie && Ie.keys && Ie.keys.IE_PROTO || "");
2842
- return a ? "Symbol(src)_1." + a : "";
2843
- }(), gt = Hn.toString, F = de.hasOwnProperty, me = de.toString, Fn = RegExp(
2844
- "^" + gt.call(F).replace(Sn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2845
- ), pt = xn ? Y.Buffer : void 0, _t = Y.Symbol, wt = Y.Uint8Array, Ln = Ne(Object.getPrototypeOf, Object), Un = Object.create, Wn = de.propertyIsEnumerable, qn = kn.splice, Tt = Object.getOwnPropertySymbols, jn = pt ? pt.isBuffer : void 0, zn = Ne(Object.keys, Object), xe = X(Y, "DataView"), te = X(Y, "Map"), Re = X(Y, "Promise"), Pe = X(Y, "Set"), Ce = X(Y, "WeakMap"), ne = X(Object, "create"), Bn = B(xe), Vn = B(te), Zn = B(Re), $n = B(Pe), Xn = B(Ce), bt = _t ? _t.prototype : void 0, Dt = bt ? bt.valueOf : void 0;
2846
- function j(a) {
2847
- var o = -1, u = a ? a.length : 0;
2848
- for (this.clear(); ++o < u; ) {
2849
- var l = a[o];
2850
- this.set(l[0], l[1]);
2851
- }
2852
- }
2853
- function Qn() {
2854
- this.__data__ = ne ? ne(null) : {};
2855
- }
2856
- function Kn(a) {
2857
- return this.has(a) && delete this.__data__[a];
2858
- }
2859
- function Jn(a) {
2860
- var o = this.__data__;
2861
- if (ne) {
2862
- var u = o[a];
2863
- return u === r ? void 0 : u;
2864
- }
2865
- return F.call(o, a) ? o[a] : void 0;
2866
- }
2867
- function er(a) {
2868
- var o = this.__data__;
2869
- return ne ? o[a] !== void 0 : F.call(o, a);
2870
- }
2871
- function tr(a, o) {
2872
- var u = this.__data__;
2873
- return u[a] = ne && o === void 0 ? r : o, this;
2874
- }
2875
- j.prototype.clear = Qn, j.prototype.delete = Kn, j.prototype.get = Jn, j.prototype.has = er, j.prototype.set = tr;
2876
- function G(a) {
2877
- var o = -1, u = a ? a.length : 0;
2878
- for (this.clear(); ++o < u; ) {
2879
- var l = a[o];
2880
- this.set(l[0], l[1]);
2881
- }
2882
- }
2883
- function nr() {
2884
- this.__data__ = [];
2885
- }
2886
- function rr(a) {
2887
- var o = this.__data__, u = fe(o, a);
2888
- if (u < 0)
2889
- return !1;
2890
- var l = o.length - 1;
2891
- return u == l ? o.pop() : qn.call(o, u, 1), !0;
2892
- }
2893
- function ar(a) {
2894
- var o = this.__data__, u = fe(o, a);
2895
- return u < 0 ? void 0 : o[u][1];
2896
- }
2897
- function ir(a) {
2898
- return fe(this.__data__, a) > -1;
2899
- }
2900
- function or(a, o) {
2901
- var u = this.__data__, l = fe(u, a);
2902
- return l < 0 ? u.push([a, o]) : u[l][1] = o, this;
2903
- }
2904
- G.prototype.clear = nr, G.prototype.delete = rr, G.prototype.get = ar, G.prototype.has = ir, G.prototype.set = or;
2905
- function Z(a) {
2906
- var o = -1, u = a ? a.length : 0;
2907
- for (this.clear(); ++o < u; ) {
2908
- var l = a[o];
2909
- this.set(l[0], l[1]);
2910
- }
2911
- }
2912
- function sr() {
2913
- this.__data__ = {
2914
- hash: new j(),
2915
- map: new (te || G)(),
2916
- string: new j()
2917
- };
2918
- }
2919
- function ur(a) {
2920
- return he(this, a).delete(a);
2921
- }
2922
- function cr(a) {
2923
- return he(this, a).get(a);
2924
- }
2925
- function lr(a) {
2926
- return he(this, a).has(a);
2927
- }
2928
- function dr(a, o) {
2929
- return he(this, a).set(a, o), this;
2930
- }
2931
- Z.prototype.clear = sr, Z.prototype.delete = ur, Z.prototype.get = cr, Z.prototype.has = lr, Z.prototype.set = dr;
2932
- function $(a) {
2933
- this.__data__ = new G(a);
2934
- }
2935
- function mr() {
2936
- this.__data__ = new G();
2937
- }
2938
- function fr(a) {
2939
- return this.__data__.delete(a);
2940
- }
2941
- function hr(a) {
2942
- return this.__data__.get(a);
2943
- }
2944
- function yr(a) {
2945
- return this.__data__.has(a);
2946
- }
2947
- function gr(a, o) {
2948
- var u = this.__data__;
2949
- if (u instanceof G) {
2950
- var l = u.__data__;
2951
- if (!te || l.length < n - 1)
2952
- return l.push([a, o]), this;
2953
- u = this.__data__ = new Z(l);
2954
- }
2955
- return u.set(a, o), this;
2956
- }
2957
- $.prototype.clear = mr, $.prototype.delete = fr, $.prototype.get = hr, $.prototype.has = yr, $.prototype.set = gr;
2958
- function pr(a, o) {
2959
- var u = Ae(a) || Ur(a) ? Gn(a.length, String) : [], l = u.length, D = !!l;
2960
- for (var E in a)
2961
- F.call(a, E) && !(D && (E == "length" || kr(E, l))) && u.push(E);
2962
- return u;
2963
- }
2964
- function Mt(a, o, u) {
2965
- var l = a[o];
2966
- (!(F.call(a, o) && Et(l, u)) || u === void 0 && !(o in a)) && (a[o] = u);
2967
- }
2968
- function fe(a, o) {
2969
- for (var u = a.length; u--; )
2970
- if (Et(a[u][0], o))
2971
- return u;
2972
- return -1;
2973
- }
2974
- function _r(a, o) {
2975
- return a && St(o, ke(o), a);
2976
- }
2977
- function Ye(a, o, u, l, D, E, A) {
2978
- var N;
2979
- if (l && (N = E ? l(a, D, E, A) : l(a)), N !== void 0)
2980
- return N;
2981
- if (!ye(a))
2982
- return a;
2983
- var xt = Ae(a);
2984
- if (xt) {
2985
- if (N = Yr(a), !o)
2986
- return Rr(a, N);
2987
- } else {
2988
- var Q = z(a), Rt = Q == _ || Q == y;
2989
- if (qr(a))
2990
- return Sr(a, o);
2991
- if (Q == x || Q == s || Rt && !E) {
2992
- if (mt(a))
2993
- return E ? a : {};
2994
- if (N = Gr(Rt ? {} : a), !o)
2995
- return Pr(a, _r(N, a));
2996
- } else {
2997
- if (!w[Q])
2998
- return E ? a : {};
2999
- N = Ar(a, Q, Ye, o);
3000
- }
3001
- }
3002
- A || (A = new $());
3003
- var Pt = A.get(a);
3004
- if (Pt)
3005
- return Pt;
3006
- if (A.set(a, N), !xt)
3007
- var Ct = u ? Cr(a) : ke(a);
3008
- return Cn(Ct || a, function(He, ge) {
3009
- Ct && (ge = He, He = a[ge]), Mt(N, ge, Ye(He, o, u, l, ge, a, A));
3010
- }), N;
3011
- }
3012
- function wr(a) {
3013
- return ye(a) ? Un(a) : {};
3014
- }
3015
- function Tr(a, o, u) {
3016
- var l = o(a);
3017
- return Ae(a) ? l : Yn(l, u(a));
3018
- }
3019
- function br(a) {
3020
- return me.call(a);
3021
- }
3022
- function Dr(a) {
3023
- if (!ye(a) || Fr(a))
3024
- return !1;
3025
- var o = It(a) || mt(a) ? Fn : vn;
3026
- return o.test(B(a));
3027
- }
3028
- function Mr(a) {
3029
- if (!vt(a))
3030
- return zn(a);
3031
- var o = [];
3032
- for (var u in Object(a))
3033
- F.call(a, u) && u != "constructor" && o.push(u);
3034
- return o;
3035
- }
3036
- function Sr(a, o) {
3037
- if (o)
3038
- return a.slice();
3039
- var u = new a.constructor(a.length);
3040
- return a.copy(u), u;
3041
- }
3042
- function Ge(a) {
3043
- var o = new a.constructor(a.byteLength);
3044
- return new wt(o).set(new wt(a)), o;
3045
- }
3046
- function Or(a, o) {
3047
- var u = o ? Ge(a.buffer) : a.buffer;
3048
- return new a.constructor(u, a.byteOffset, a.byteLength);
3049
- }
3050
- function vr(a, o, u) {
3051
- var l = o ? u(ft(a), !0) : ft(a);
3052
- return dt(l, Rn, new a.constructor());
3053
- }
3054
- function Er(a) {
3055
- var o = new a.constructor(a.source, On.exec(a));
3056
- return o.lastIndex = a.lastIndex, o;
3057
- }
3058
- function Nr(a, o, u) {
3059
- var l = o ? u(ht(a), !0) : ht(a);
3060
- return dt(l, Pn, new a.constructor());
3061
- }
3062
- function Ir(a) {
3063
- return Dt ? Object(Dt.call(a)) : {};
3064
- }
3065
- function xr(a, o) {
3066
- var u = o ? Ge(a.buffer) : a.buffer;
3067
- return new a.constructor(u, a.byteOffset, a.length);
3068
- }
3069
- function Rr(a, o) {
3070
- var u = -1, l = a.length;
3071
- for (o || (o = Array(l)); ++u < l; )
3072
- o[u] = a[u];
3073
- return o;
3074
- }
3075
- function St(a, o, u, l) {
3076
- u || (u = {});
3077
- for (var D = -1, E = o.length; ++D < E; ) {
3078
- var A = o[D], N = void 0;
3079
- Mt(u, A, N === void 0 ? a[A] : N);
3080
- }
3081
- return u;
3082
- }
3083
- function Pr(a, o) {
3084
- return St(a, Ot(a), o);
3085
- }
3086
- function Cr(a) {
3087
- return Tr(a, ke, Ot);
3088
- }
3089
- function he(a, o) {
3090
- var u = a.__data__;
3091
- return Hr(o) ? u[typeof o == "string" ? "string" : "hash"] : u.map;
3092
- }
3093
- function X(a, o) {
3094
- var u = An(a, o);
3095
- return Dr(u) ? u : void 0;
3096
- }
3097
- var Ot = Tt ? Ne(Tt, Object) : Br, z = br;
3098
- (xe && z(new xe(new ArrayBuffer(1))) != le || te && z(new te()) != g || Re && z(Re.resolve()) != R || Pe && z(new Pe()) != W || Ce && z(new Ce()) != q) && (z = function(a) {
3099
- var o = me.call(a), u = o == x ? a.constructor : void 0, l = u ? B(u) : void 0;
3100
- if (l)
3101
- switch (l) {
3102
- case Bn:
3103
- return le;
3104
- case Vn:
3105
- return g;
3106
- case Zn:
3107
- return R;
3108
- case $n:
3109
- return W;
3110
- case Xn:
3111
- return q;
3112
- }
3113
- return o;
3114
- });
3115
- function Yr(a) {
3116
- var o = a.length, u = a.constructor(o);
3117
- return o && typeof a[0] == "string" && F.call(a, "index") && (u.index = a.index, u.input = a.input), u;
3118
- }
3119
- function Gr(a) {
3120
- return typeof a.constructor == "function" && !vt(a) ? wr(Ln(a)) : {};
3121
- }
3122
- function Ar(a, o, u, l) {
3123
- var D = a.constructor;
3124
- switch (o) {
3125
- case Je:
3126
- return Ge(a);
3127
- case d:
3128
- case h:
3129
- return new D(+a);
3130
- case le:
3131
- return Or(a, l);
3132
- case et:
3133
- case tt:
3134
- case nt:
3135
- case rt:
3136
- case at:
3137
- case it:
3138
- case ot:
3139
- case st:
3140
- case ut:
3141
- return xr(a, l);
3142
- case g:
3143
- return vr(a, l, u);
3144
- case I:
3145
- case O:
3146
- return new D(a);
3147
- case C:
3148
- return Er(a);
3149
- case W:
3150
- return Nr(a, l, u);
3151
- case b:
3152
- return Ir(a);
3153
- }
3154
- }
3155
- function kr(a, o) {
3156
- return o = o ?? i, !!o && (typeof a == "number" || En.test(a)) && a > -1 && a % 1 == 0 && a < o;
3157
- }
3158
- function Hr(a) {
3159
- var o = typeof a;
3160
- return o == "string" || o == "number" || o == "symbol" || o == "boolean" ? a !== "__proto__" : a === null;
3161
- }
3162
- function Fr(a) {
3163
- return !!yt && yt in a;
3164
- }
3165
- function vt(a) {
3166
- var o = a && a.constructor, u = typeof o == "function" && o.prototype || de;
3167
- return a === u;
3168
- }
3169
- function B(a) {
3170
- if (a != null) {
3171
- try {
3172
- return gt.call(a);
3173
- } catch {
3174
- }
3175
- try {
3176
- return a + "";
3177
- } catch {
3178
- }
3179
- }
3180
- return "";
3181
- }
3182
- function Lr(a) {
3183
- return Ye(a, !0, !0);
3184
- }
3185
- function Et(a, o) {
3186
- return a === o || a !== a && o !== o;
3187
- }
3188
- function Ur(a) {
3189
- return Wr(a) && F.call(a, "callee") && (!Wn.call(a, "callee") || me.call(a) == s);
3190
- }
3191
- var Ae = Array.isArray;
3192
- function Nt(a) {
3193
- return a != null && jr(a.length) && !It(a);
3194
- }
3195
- function Wr(a) {
3196
- return zr(a) && Nt(a);
3197
- }
3198
- var qr = jn || Vr;
3199
- function It(a) {
3200
- var o = ye(a) ? me.call(a) : "";
3201
- return o == _ || o == y;
3202
- }
3203
- function jr(a) {
3204
- return typeof a == "number" && a > -1 && a % 1 == 0 && a <= i;
3205
- }
3206
- function ye(a) {
3207
- var o = typeof a;
3208
- return !!a && (o == "object" || o == "function");
3209
- }
3210
- function zr(a) {
3211
- return !!a && typeof a == "object";
3212
- }
3213
- function ke(a) {
3214
- return Nt(a) ? pr(a) : Mr(a);
3215
- }
3216
- function Br() {
3217
- return [];
3218
- }
3219
- function Vr() {
3220
- return !1;
3221
- }
3222
- e.exports = Lr;
3223
- })(De, De.exports);
3224
- var go = De.exports;
3225
- const po = /* @__PURE__ */ yo(go), H = (e, t) => new Date(e.getTime() - Tn(t, e));
3226
- class M {
3227
- constructor(t) {
3228
- T(this, "timeframeText");
3229
- T(this, "key");
3230
- T(this, "display");
3231
- T(this, "timeframeLength");
3232
- T(this, "allowedTiers");
3233
- // defaultResponseGranularity tracks which of the allowed granularities is picked for a given
3234
- // timeframe if the user does not or cannot specify a granularity.
3235
- T(this, "defaultResponseGranularity");
3236
- // dataGranularity tracks the granularity of the available data on the server for a specific timeframe.
3237
- // As of writing, it's always the same as the default response granularity, but it may not always be.
3238
- // It controls how timeframes are rounded to ensure complete time buckets from the server.
3239
- T(this, "dataGranularity");
3240
- // isRelative impacts whether we take the `floor` or the `ceil` of the start time.
3241
- // If the time range is relative, we want the ceil -- because we take the ceil of the
3242
- // end time to make sure we're showing all the data we can for the last time bucket.
3243
- // If the time range is absolute, we want the floor -- because otherwise we wouldn't be including
3244
- // the first time bucket.
3245
- T(this, "isRelative");
3246
- T(this, "fineGrainedDefaultGranularity");
3247
- T(this, "_startCustom");
3248
- T(this, "_endCustom");
3249
- T(this, "_allowedGranularitiesOverride");
3250
- 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;
3251
- }
3252
- // rawEnd does not consider granularity and should not be used directly in queries.
3253
- // Use `new QueryTime(timeframe, granularity?).queryEndSeconds()` instead.
3254
- // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
3255
- rawEnd(t) {
3256
- return this._endCustom || /* @__PURE__ */ new Date();
3257
- }
3258
- // rawStart does not consider granularity and should not be used directly in queries.
3259
- // Use `new QueryTime(timeframe, granularity?).queryStartSeconds()` instead.
3260
- // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
3261
- rawStart(t) {
3262
- return this._startCustom || new Date(this.rawEnd().getTime() - this.timeframeLengthMs());
3263
- }
3264
- timeframeLengthMs() {
3265
- return this.timeframeLength() * 1e3;
3266
- }
3267
- maximumTimeframeLength() {
3268
- return this.timeframeLength();
3269
- }
3270
- allowedGranularities(t) {
3271
- if (this._allowedGranularitiesOverride && t)
3272
- return new Set(this._allowedGranularitiesOverride);
3273
- const n = /* @__PURE__ */ new Set(), r = this.maximumTimeframeLength() / 3600;
3274
- 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;
3275
- }
3276
- cacheKey() {
3277
- return this.key !== "custom" ? this.key : `${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`;
3278
- }
3279
- v4Query(t) {
3280
- if (this.key === "custom")
3281
- return {
3282
- type: "absolute",
3283
- start: this.rawStart(),
3284
- end: this.rawEnd(),
3285
- tz: t
3286
- };
3287
- if (nn.includes(this.key))
3288
- return {
3289
- type: "relative",
3290
- // Safe assertion; we just checked that key is a member of the union.
3291
- time_range: this.key,
3292
- tz: t
3293
- };
3294
- throw new Error("Unsupported relative time value for Explore");
3295
- }
3296
- tzAdjustedDate(t) {
3297
- if (!t)
3298
- return /* @__PURE__ */ new Date();
3299
- const n = lo(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
3300
- return _n(n, t);
3301
- }
3302
- }
3303
- class _o extends M {
3304
- rawStart(t) {
3305
- let n = k(this.tzAdjustedDate(t), { weekStartsOn: 1 });
3306
- return t && (n = H(n, t)), n;
3307
- }
3308
- maximumTimeframeLength() {
3309
- return 60 * 60 * 24 * 7;
3310
- }
3311
- }
3312
- class wo extends M {
3313
- rawStart(t) {
3314
- let n = ee(this.tzAdjustedDate(t));
3315
- return t && (n = H(n, t)), n;
3316
- }
3317
- maximumTimeframeLength() {
3318
- return 60 * 60 * 24 * 31;
3319
- }
3320
- }
3321
- class To extends M {
3322
- rawStart(t) {
3323
- let n = new Date(this.tzAdjustedDate(t).getFullYear(), 0, 1);
3324
- return t && (n = H(n, t)), n;
3325
- }
3326
- maximumTimeframeLength() {
3327
- return 60 * 60 * 24 * 366;
3328
- }
3329
- }
3330
- class bo extends M {
3331
- rawEnd(t) {
3332
- let n = k(this.tzAdjustedDate(t), { weekStartsOn: 1 });
3333
- return t && (n = H(n, t)), n;
3334
- }
3335
- rawStart(t) {
3336
- const n = this.tzAdjustedDate(t);
3337
- let r = k(n.setDate(n.getDate() - 7), {
3338
- weekStartsOn: 1
3339
- });
3340
- return t && (r = H(r, t)), r;
3341
- }
3342
- }
3343
- class Do extends M {
3344
- rawEnd(t) {
3345
- let n = ee(this.tzAdjustedDate(t));
3346
- return t && (n = H(n, t)), n;
3347
- }
3348
- rawStart(t) {
3349
- let n = ee(yn(this.tzAdjustedDate(t)));
3350
- return t && (n = H(n, t)), n;
3351
- }
3352
- }
3353
- class Mo extends M {
3354
- rawEnd(t) {
3355
- let n = new Date(this.tzAdjustedDate(t).getFullYear(), 0, 1);
3356
- return t && (n = H(n, t)), n;
3357
- }
3358
- rawStart(t) {
3359
- let n = new Date(this.tzAdjustedDate(t).getFullYear() - 1, 0, 1);
3360
- return t && (n = H(n, t)), n;
3361
- }
3362
- }
3363
- const So = /* @__PURE__ */ new Map([
3364
- [
3365
- m.FIFTEEN_MIN,
3366
- new M({
3367
- key: m.FIFTEEN_MIN,
3368
- display: "Last 15 minutes",
3369
- timeframeText: "15 minutes",
3370
- timeframeLength: () => 60 * 15,
3371
- defaultResponseGranularity: "minutely",
3372
- dataGranularity: "minutely",
3373
- isRelative: !0,
3374
- fineGrainedDefaultGranularity: "thirtySecondly",
3375
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3376
- allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely"]
3377
- })
3378
- ],
3379
- [
3380
- m.ONE_HOUR,
3381
- new M({
3382
- key: m.ONE_HOUR,
3383
- display: "Last hour",
3384
- timeframeText: "One hour",
3385
- timeframeLength: () => 60 * 60 * 1,
3386
- defaultResponseGranularity: "minutely",
3387
- dataGranularity: "minutely",
3388
- isRelative: !0,
3389
- fineGrainedDefaultGranularity: "minutely",
3390
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3391
- allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely", "fiveMinutely", "tenMinutely"]
3392
- })
3393
- ],
3394
- [
3395
- m.SIX_HOUR,
3396
- new M({
3397
- key: m.SIX_HOUR,
3398
- display: "Last 6 hours",
3399
- timeframeText: "6 hours",
3400
- timeframeLength: () => 60 * 60 * 6,
3401
- defaultResponseGranularity: "hourly",
3402
- dataGranularity: "hourly",
3403
- isRelative: !0,
3404
- fineGrainedDefaultGranularity: "fiveMinutely",
3405
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3406
- allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3407
- })
3408
- ],
3409
- [
3410
- m.TWELVE_HOUR,
3411
- new M({
3412
- key: m.TWELVE_HOUR,
3413
- display: "Last 12 hours",
3414
- timeframeText: "12 hours",
3415
- timeframeLength: () => 60 * 60 * 12,
3416
- defaultResponseGranularity: "hourly",
3417
- dataGranularity: "hourly",
3418
- isRelative: !0,
3419
- fineGrainedDefaultGranularity: "tenMinutely",
3420
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3421
- allowedGranularitiesOverride: ["minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3422
- })
3423
- ],
3424
- [
3425
- m.ONE_DAY,
3426
- new M({
3427
- key: m.ONE_DAY,
3428
- display: "Last 24 hours",
3429
- timeframeText: "24 hours",
3430
- timeframeLength: () => 60 * 60 * 24,
3431
- defaultResponseGranularity: "hourly",
3432
- dataGranularity: "hourly",
3433
- isRelative: !0,
3434
- fineGrainedDefaultGranularity: "thirtyMinutely",
3435
- allowedTiers: ["free", "trial", "plus", "enterprise"],
3436
- allowedGranularitiesOverride: ["fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3437
- })
3438
- ],
3439
- [
3440
- m.SEVEN_DAY,
3441
- new M({
3442
- key: m.SEVEN_DAY,
3443
- display: "Last 7 days",
3444
- timeframeText: "7 days",
3445
- timeframeLength: () => 60 * 60 * 24 * 7,
3446
- defaultResponseGranularity: "daily",
3447
- dataGranularity: "daily",
3448
- isRelative: !0,
3449
- fineGrainedDefaultGranularity: "twoHourly",
3450
- allowedTiers: ["trial", "plus", "enterprise"],
3451
- allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3452
- })
3453
- ],
3454
- [
3455
- m.THIRTY_DAY,
3456
- new M({
3457
- key: m.THIRTY_DAY,
3458
- display: "Last 30 days",
3459
- timeframeText: "30 days",
3460
- timeframeLength: () => 60 * 60 * 24 * 30,
3461
- defaultResponseGranularity: "daily",
3462
- dataGranularity: "daily",
3463
- isRelative: !0,
3464
- fineGrainedDefaultGranularity: "twelveHourly",
3465
- allowedTiers: ["trial", "plus", "enterprise"],
3466
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3467
- })
3468
- ],
3469
- [
3470
- m.NINETY_DAY,
3471
- new M({
3472
- key: m.NINETY_DAY,
3473
- display: "Last 90 days",
3474
- timeframeText: "90 days",
3475
- timeframeLength: () => 60 * 60 * 24 * 90,
3476
- defaultResponseGranularity: "daily",
3477
- dataGranularity: "daily",
3478
- isRelative: !0,
3479
- fineGrainedDefaultGranularity: "daily",
3480
- allowedTiers: ["trial", "plus", "enterprise"],
3481
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3482
- })
3483
- ],
3484
- [
3485
- m.ONE_HUNDRED_EIGHTY_DAY,
3486
- new M({
3487
- key: m.ONE_HUNDRED_EIGHTY_DAY,
3488
- display: "Last 180 days",
3489
- timeframeText: "180 days",
3490
- timeframeLength: () => 60 * 60 * 24 * 180,
3491
- defaultResponseGranularity: "daily",
3492
- dataGranularity: "daily",
3493
- isRelative: !0,
3494
- fineGrainedDefaultGranularity: "daily",
3495
- allowedTiers: ["trial", "plus", "enterprise"],
3496
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3497
- })
3498
- ],
3499
- [
3500
- m.ONE_YEAR,
3501
- new M({
3502
- key: m.ONE_YEAR,
3503
- display: "Last 365 days",
3504
- timeframeText: "365 days",
3505
- timeframeLength: () => 60 * 60 * 24 * 365,
3506
- defaultResponseGranularity: "daily",
3507
- dataGranularity: "daily",
3508
- isRelative: !0,
3509
- fineGrainedDefaultGranularity: "daily",
3510
- allowedTiers: ["trial", "plus", "enterprise"],
3511
- allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3512
- })
3513
- ],
3514
- [
3515
- m.CURRENT_WEEK,
3516
- new _o({
3517
- key: m.CURRENT_WEEK,
3518
- display: "This week",
3519
- timeframeText: "Week",
3520
- timeframeLength: () => {
3521
- const e = k(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
3522
- return (ie(Le(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3523
- },
3524
- defaultResponseGranularity: "daily",
3525
- dataGranularity: "daily",
3526
- isRelative: !1,
3527
- fineGrainedDefaultGranularity: "twoHourly",
3528
- allowedTiers: ["plus", "enterprise"],
3529
- allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3530
- })
3531
- ],
3532
- [
3533
- m.CURRENT_MONTH,
3534
- new wo({
3535
- key: m.CURRENT_MONTH,
3536
- display: "This month",
3537
- timeframeText: "Month",
3538
- timeframeLength: () => {
3539
- const e = ee(/* @__PURE__ */ new Date());
3540
- return (ie(Le(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3541
- },
3542
- defaultResponseGranularity: "daily",
3543
- dataGranularity: "daily",
3544
- isRelative: !1,
3545
- allowedTiers: ["plus", "enterprise"]
3546
- })
3547
- ],
3548
- [
3549
- m.CURRENT_YEAR,
3550
- new To({
3551
- key: m.CURRENT_YEAR,
3552
- display: "This year",
3553
- timeframeText: "Year",
3554
- timeframeLength: () => {
3555
- const e = new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1);
3556
- return (ie(Le(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3557
- },
3558
- defaultResponseGranularity: "daily",
3559
- dataGranularity: "daily",
3560
- isRelative: !1,
3561
- allowedTiers: ["plus", "enterprise"]
3562
- })
3563
- ],
3564
- [
3565
- m.PREVIOUS_WEEK,
3566
- new bo({
3567
- key: m.PREVIOUS_WEEK,
3568
- display: "Previous week",
3569
- timeframeText: "Week",
3570
- timeframeLength: () => 60 * 60 * 24 * 7,
3571
- defaultResponseGranularity: "daily",
3572
- dataGranularity: "daily",
3573
- isRelative: !1,
3574
- fineGrainedDefaultGranularity: "twoHourly",
3575
- allowedTiers: ["plus", "enterprise"],
3576
- allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3577
- })
3578
- ],
3579
- [
3580
- m.PREVIOUS_MONTH,
3581
- new Do({
3582
- key: m.PREVIOUS_MONTH,
3583
- display: "Previous month",
3584
- timeframeText: "Month",
3585
- timeframeLength: () => {
3586
- let e = 0;
3587
- const t = ee(/* @__PURE__ */ new Date()), n = ee(yn(/* @__PURE__ */ new Date()));
3588
- return t.getTimezoneOffset() !== n.getTimezoneOffset() && (e = tn(t, n)), 60 * 60 * 24 * Gi((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + Wt(e);
3589
- },
3590
- defaultResponseGranularity: "daily",
3591
- dataGranularity: "daily",
3592
- isRelative: !1,
3593
- allowedTiers: ["plus", "enterprise"]
3594
- })
3595
- ],
3596
- [
3597
- m.PREVIOUS_YEAR,
3598
- new Mo({
3599
- key: m.PREVIOUS_YEAR,
3600
- display: "Previous year",
3601
- timeframeText: "Year",
3602
- timeframeLength: () => {
3603
- const e = new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1), t = new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1);
3604
- let n = 0;
3605
- return e.getTimezoneOffset() !== t.getTimezoneOffset() && (n = tn(e, t)), 60 * 60 * 24 * (365 + (t.getFullYear() % 4 === 0 ? 1 : 0)) + Wt(n);
3606
- },
3607
- defaultResponseGranularity: "daily",
3608
- dataGranularity: "daily",
3609
- isRelative: !1,
3610
- allowedTiers: ["plus", "enterprise"]
3611
- })
3612
- ]
3613
- ]);
3614
- function $o(e) {
3615
- const t = new Date(e.start), n = new Date(e.end), r = (n.getTime() - t.getTime()) / 1e3;
3616
- return e.timePeriodsKey && po(So.get(e.timePeriodsKey)) || new M({
3617
- key: "custom",
3618
- timeframeText: "custom",
3619
- display: "custom",
3620
- startCustom: t,
3621
- endCustom: n,
3622
- timeframeLength: () => r,
3623
- defaultResponseGranularity: "daily",
3624
- dataGranularity: "daily",
3625
- isRelative: !1,
3626
- allowedTiers: ["free", "plus", "enterprise"]
3627
- });
3628
- }
3629
- function Xo(e) {
3630
- return {
3631
- ...e.key !== "custom" && { timePeriodsKey: e.key },
3632
- start: e.rawStart(),
3633
- end: e.rawEnd()
3634
- };
3635
- }
3636
- function Qo(e) {
3637
- return {
3638
- key: e.key,
3639
- display: e.display,
3640
- timeframeText: e.timeframeText,
3641
- timeframeLength: () => e.key,
3642
- // Used to generate test IDs for the Kongponent.
3643
- start: () => e.rawStart(),
3644
- end: () => e.rawEnd()
3645
- };
3646
- }
3647
- function tn(e, t) {
3648
- return ki(e.getTimezoneOffset() - t.getTimezoneOffset());
3649
- }
3650
- const Ko = {
3651
- "15M": m.FIFTEEN_MIN,
3652
- "1H": m.ONE_HOUR,
3653
- "6H": m.SIX_HOUR,
3654
- "12H": m.TWELVE_HOUR,
3655
- "24H": m.ONE_DAY,
3656
- "7D": m.SEVEN_DAY,
3657
- "15m": m.FIFTEEN_MIN,
3658
- "1h": m.ONE_HOUR,
3659
- "6h": m.SIX_HOUR,
3660
- "12h": m.TWELVE_HOUR,
3661
- "24h": m.ONE_DAY,
3662
- "7d": m.SEVEN_DAY,
3663
- "30d": m.THIRTY_DAY,
3664
- "90d": m.NINETY_DAY,
3665
- "180d": m.ONE_HUNDRED_EIGHTY_DAY,
3666
- "365d": m.ONE_YEAR,
3667
- current_week: m.CURRENT_WEEK,
3668
- current_month: m.CURRENT_MONTH,
3669
- current_year: m.CURRENT_YEAR,
3670
- previous_week: m.PREVIOUS_WEEK,
3671
- previous_month: m.PREVIOUS_MONTH,
3672
- previous_year: m.PREVIOUS_YEAR
3673
- };
3674
- class Ke {
3675
- constructor(t) {
3676
- T(this, "_seed");
3677
- this._seed = t;
3678
- }
3679
- next(t, n) {
3680
- const r = Math.sin(this._seed++) * 1e4, i = r - Math.floor(r);
3681
- return Math.floor(i * (n - t + 1)) + t;
3682
- }
3683
- }
3684
- const Jo = (e, t, n) => {
3685
- const r = Mn(10, 1e4), i = new Ke(r), s = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = [];
3686
- let h = 0;
3687
- for (let y = s; y <= c; y += 60 * 60 * 1e3)
3688
- if (t)
3689
- for (const g in t)
3690
- t[g].forEach((I) => {
3691
- h += i.next(50, 500);
3692
- const x = {
3693
- [g]: I,
3694
- [e.name]: h
3695
- }, R = {
3696
- version: "1.0",
3697
- timestamp: new Date(y).toISOString(),
3698
- event: x
3699
- };
3700
- d.push(R);
3701
- });
3702
- else {
3703
- h += i.next(50, 500);
3704
- const g = {
3705
- version: "1.0",
3706
- timestamp: new Date(y).toISOString(),
3707
- event: {
3708
- [e.name]: h
3709
- }
3710
- };
3711
- d.push(g);
3712
- }
3713
- const f = {};
3714
- if (t)
3715
- for (const y in t)
3716
- f[y] = {}, t[y].forEach((g) => {
3717
- f[y][g] = {
3718
- name: g,
3719
- deleted: !1
3720
- };
3721
- });
3722
- const _ = {
3723
- start_ms: s,
3724
- end_ms: c,
3725
- start: new Date(s).toISOString(),
3726
- end: new Date(c).toISOString(),
3727
- query_id: "12345",
3728
- metric_names: [e.name],
3729
- metric_units: {
3730
- [e.name]: e.unit
3731
- },
3732
- granularity_ms: 60 * 60 * 1e3,
3733
- // 1 hour in ms
3734
- display: f,
3735
- ...n ?? {}
3736
- };
3737
- return {
3738
- data: d,
3739
- meta: _
3740
- };
3741
- }, es = (e, t) => {
3742
- const n = Mn(10, 1e4), r = new Ke(n), i = Date.now() - 6 * 60 * 60 * 1e3, s = Date.now(), c = [], d = {};
3743
- e.forEach((f) => {
3744
- d[f.name] = 0;
3745
- });
3746
- for (let f = i; f <= s; f += 60 * 60 * 1e3) {
3747
- const _ = {};
3748
- e.forEach((g) => {
3749
- d[g.name] += r.next(50, 500), _[g.name] = d[g.name];
3750
- });
3751
- const y = {
3752
- version: "1.0",
3753
- timestamp: new Date(f).toISOString(),
3754
- event: _
3755
- };
3756
- c.push(y);
3757
- }
3758
- const h = {
3759
- start_ms: i,
3760
- end_ms: s,
3761
- start: new Date(i).toISOString(),
3762
- end: new Date(s).toISOString(),
3763
- query_id: "12345",
3764
- metric_names: e.map((f) => f.name),
3765
- metric_units: e.reduce((f, _) => (f[_.name] = _.unit, f), {}),
3766
- granularity_ms: 60 * 60 * 1e3,
3767
- // 1 hour in ms
3768
- display: {},
3769
- ...t ?? {}
3770
- };
3771
- return {
3772
- data: c,
3773
- meta: h
3774
- };
3775
- }, ts = (e, t, n) => {
3776
- const r = Math.floor(Math.random() * 9991) + 10, i = new Ke(r), s = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = new Date((s + c) / 2).toISOString(), h = [];
3777
- if (t) {
3778
- const y = Object.keys(t), g = Object.values(t), I = (x, R) => {
3779
- if (R === y.length) {
3780
- e.forEach((C) => {
3781
- x[C.name] = i.next(1e3, 5e7);
3782
- }), h.push({
3783
- version: "1.0",
3784
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3785
- event: { ...x }
3786
- });
3787
- return;
3788
- }
3789
- g[R].forEach((C) => {
3790
- I({ ...x, [y[R]]: C }, R + 1);
3791
- });
3792
- };
3793
- I({}, 0);
3794
- } else {
3795
- const y = {};
3796
- e.forEach((g) => {
3797
- y[g.name] = i.next(50, 500);
3798
- }), h.push({
3799
- version: "1.0",
3800
- timestamp: d,
3801
- event: y
3802
- });
3803
- }
3804
- const f = {};
3805
- if (t)
3806
- for (const y in t)
3807
- f[y] = {}, t[y].forEach((g) => {
3808
- f[y][g] = {
3809
- name: g,
3810
- deleted: !1
3811
- };
3812
- });
3813
- const _ = {
3814
- start_ms: s,
3815
- end_ms: c,
3816
- start: new Date(s).toISOString(),
3817
- end: new Date(c).toISOString(),
3818
- query_id: "12345",
3819
- metric_names: e.map((y) => y.name),
3820
- metric_units: e.reduce((y, g) => (y[g.name] = g.unit, y), {}),
3821
- truncated: !1,
3822
- limit: 50,
3823
- display: f,
3824
- granularity_ms: c - s,
3825
- ...n ?? {}
3826
- };
3827
- return {
3828
- data: h,
3829
- meta: _
3830
- };
3831
- };
3832
- function Mn(e, t) {
3833
- return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
3834
- }
3835
- const Oo = new Map(un.map((e) => [e.code, { code: e.code, name: e.name }])), ns = (e) => {
3836
- var t;
3837
- return ((t = Oo.get(e)) == null ? void 0 : t.name) || e;
3838
- };
3839
- export {
3840
- un as COUNTRIES,
3841
- Zo as DeltaQueryTime,
3842
- No as EXPORT_RECORD_LIMIT,
3843
- be as Granularities,
3844
- Io as INJECT_QUERY_PROVIDER,
3845
- Eo as REFRESH_INTERVAL_MS,
3846
- Ke as SeededRandom,
3847
- Ko as TIMEFRAME_LOOKUP,
3848
- So as TimePeriods,
3849
- M as Timeframe,
3850
- m as TimeframeKeys,
3851
- Vo as TimeseriesQueryTime,
3852
- ho as UnaryQueryTime,
3853
- Jr as aiExploreAggregations,
3854
- _a as apiUsageQuerySchema,
3855
- sa as barChartSchema,
3856
- an as basicExploreAggregations,
3857
- wa as basicQuerySchema,
3858
- Dn as ceilToNearestTimeGrain,
3859
- ya as choroplethMapSchema,
3860
- Oo as countries,
3861
- Uo as dashboardConfigSchema,
3862
- Lo as dashboardTileTypes,
3863
- ia as datasourceToFilterableDimensions,
3864
- $o as datePickerSelectionToTimeframe,
3865
- da as donutChartSchema,
3866
- tn as dstOffsetHours,
3867
- Kr as exploreAggregations,
3868
- Xr as exploreFilterTypesV2,
3869
- xo as extendedRelativeTimeRangeValues,
3870
- Oe as filterableAiExploreDimensions,
3871
- Me as filterableBasicExploreDimensions,
3872
- Se as filterableExploreDimensions,
3873
- ta as filterableRequestDimensions,
3874
- aa as filterableRequestMetrics,
3875
- Ao as filterableRequestWildcardDimensions,
3876
- fo as floorToNearestTimeGrain,
3877
- qo as formatLogTimestamp,
3878
- en as formatTime,
3879
- jo as formatTimeRange,
3880
- la as gaugeChartSchema,
3881
- ts as generateCrossSectionalData,
3882
- es as generateMultipleMetricTimeSeriesData,
3883
- Jo as generateSingleMetricTimeSeriesData,
3884
- ns as getCountryName,
3885
- Wo as getFieldDataSources,
3886
- zo as granularitiesToOptions,
3887
- mo as granularityMsToQuery,
3888
- rn as granularityValues,
3889
- Ta as llmUsageSchema,
3890
- fa as metricCardSchema,
3891
- Bo as msToGranularity,
3892
- Ho as queryDatasources,
3893
- sn as queryableAiExploreDimensions,
3894
- Ve as queryableBasicExploreDimensions,
3895
- on as queryableExploreDimensions,
3896
- ea as queryableRequestDimensions,
3897
- ra as queryableRequestMetrics,
3898
- na as queryableRequestWildcardDimensions,
3899
- Mn as rand,
3900
- ko as relativeTimeRangeValuesRequestV2,
3901
- nn as relativeTimeRangeValuesV4,
3902
- Ro as reportChartTypes,
3903
- Qr as requestFilterTypeEmptyV2,
3904
- Po as requestFilterTypeEqualsV2,
3905
- Co as requestFilterTypeMetricV2,
3906
- Yo as requestFilterTypeWildcardV2,
3907
- ha as singleValueSchema,
3908
- oa as slottableSchema,
3909
- Fo as stripUnknownFilters,
3910
- ua as thresholdSchema,
3911
- Sa as tileConfigSchema,
3912
- Da as tileDefinitionSchema,
3913
- Ma as tileLayoutSchema,
3914
- Go as timeRangeTypeV2,
3915
- Xo as timeframeToDatepickerSelection,
3916
- Qo as timeframeToDatepickerTimeperiod,
3917
- ca as timeseriesChartSchema,
3918
- ma as topNTableSchema,
3919
- ba as validDashboardQuery
3920
- };
3921
- //# sourceMappingURL=vitals-utilities.es.js.map