autoql-fe-utils 1.0.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.
@@ -0,0 +1,3039 @@
1
+ (() => {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined")
12
+ return require.apply(this, arguments);
13
+ throw new Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __commonJS = (cb, mod) => function __require2() {
16
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
+ mod
33
+ ));
34
+
35
+ // node_modules/dayjs/dayjs.min.js
36
+ var require_dayjs_min = __commonJS({
37
+ "node_modules/dayjs/dayjs.min.js"(exports, module) {
38
+ !function(t, e) {
39
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
40
+ }(exports, function() {
41
+ "use strict";
42
+ var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
43
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
44
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
45
+ } }, m = function(t2, e2, n2) {
46
+ var r2 = String(t2);
47
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
48
+ }, v = { s: m, z: function(t2) {
49
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
50
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
51
+ }, m: function t2(e2, n2) {
52
+ if (e2.date() < n2.date())
53
+ return -t2(n2, e2);
54
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f);
55
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
56
+ }, a: function(t2) {
57
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
58
+ }, p: function(t2) {
59
+ return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
60
+ }, u: function(t2) {
61
+ return void 0 === t2;
62
+ } }, g = "en", D = {};
63
+ D[g] = M;
64
+ var p = function(t2) {
65
+ return t2 instanceof _;
66
+ }, S = function t2(e2, n2, r2) {
67
+ var i2;
68
+ if (!e2)
69
+ return g;
70
+ if ("string" == typeof e2) {
71
+ var s2 = e2.toLowerCase();
72
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
73
+ var u2 = e2.split("-");
74
+ if (!i2 && u2.length > 1)
75
+ return t2(u2[0]);
76
+ } else {
77
+ var a2 = e2.name;
78
+ D[a2] = e2, i2 = a2;
79
+ }
80
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
81
+ }, w = function(t2, e2) {
82
+ if (p(t2))
83
+ return t2.clone();
84
+ var n2 = "object" == typeof e2 ? e2 : {};
85
+ return n2.date = t2, n2.args = arguments, new _(n2);
86
+ }, O = v;
87
+ O.l = S, O.i = p, O.w = function(t2, e2) {
88
+ return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
89
+ };
90
+ var _ = function() {
91
+ function M2(t2) {
92
+ this.$L = S(t2.locale, null, true), this.parse(t2);
93
+ }
94
+ var m2 = M2.prototype;
95
+ return m2.parse = function(t2) {
96
+ this.$d = function(t3) {
97
+ var e2 = t3.date, n2 = t3.utc;
98
+ if (null === e2)
99
+ return /* @__PURE__ */ new Date(NaN);
100
+ if (O.u(e2))
101
+ return /* @__PURE__ */ new Date();
102
+ if (e2 instanceof Date)
103
+ return new Date(e2);
104
+ if ("string" == typeof e2 && !/Z$/i.test(e2)) {
105
+ var r2 = e2.match($);
106
+ if (r2) {
107
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
108
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
109
+ }
110
+ }
111
+ return new Date(e2);
112
+ }(t2), this.$x = t2.x || {}, this.init();
113
+ }, m2.init = function() {
114
+ var t2 = this.$d;
115
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
116
+ }, m2.$utils = function() {
117
+ return O;
118
+ }, m2.isValid = function() {
119
+ return !(this.$d.toString() === l);
120
+ }, m2.isSame = function(t2, e2) {
121
+ var n2 = w(t2);
122
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
123
+ }, m2.isAfter = function(t2, e2) {
124
+ return w(t2) < this.startOf(e2);
125
+ }, m2.isBefore = function(t2, e2) {
126
+ return this.endOf(e2) < w(t2);
127
+ }, m2.$g = function(t2, e2, n2) {
128
+ return O.u(t2) ? this[e2] : this.set(n2, t2);
129
+ }, m2.unix = function() {
130
+ return Math.floor(this.valueOf() / 1e3);
131
+ }, m2.valueOf = function() {
132
+ return this.$d.getTime();
133
+ }, m2.startOf = function(t2, e2) {
134
+ var n2 = this, r2 = !!O.u(e2) || e2, h2 = O.p(t2), l2 = function(t3, e3) {
135
+ var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
136
+ return r2 ? i2 : i2.endOf(a);
137
+ }, $2 = function(t3, e3) {
138
+ return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
139
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
140
+ switch (h2) {
141
+ case c:
142
+ return r2 ? l2(1, 0) : l2(31, 11);
143
+ case f:
144
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
145
+ case o:
146
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
147
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
148
+ case a:
149
+ case d:
150
+ return $2(v2 + "Hours", 0);
151
+ case u:
152
+ return $2(v2 + "Minutes", 1);
153
+ case s:
154
+ return $2(v2 + "Seconds", 2);
155
+ case i:
156
+ return $2(v2 + "Milliseconds", 3);
157
+ default:
158
+ return this.clone();
159
+ }
160
+ }, m2.endOf = function(t2) {
161
+ return this.startOf(t2, false);
162
+ }, m2.$set = function(t2, e2) {
163
+ var n2, o2 = O.p(t2), h2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = h2 + "Date", n2[d] = h2 + "Date", n2[f] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s] = h2 + "Minutes", n2[i] = h2 + "Seconds", n2[r] = h2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
164
+ if (o2 === f || o2 === c) {
165
+ var y2 = this.clone().set(d, 1);
166
+ y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
167
+ } else
168
+ l2 && this.$d[l2]($2);
169
+ return this.init(), this;
170
+ }, m2.set = function(t2, e2) {
171
+ return this.clone().$set(t2, e2);
172
+ }, m2.get = function(t2) {
173
+ return this[O.p(t2)]();
174
+ }, m2.add = function(r2, h2) {
175
+ var d2, l2 = this;
176
+ r2 = Number(r2);
177
+ var $2 = O.p(h2), y2 = function(t2) {
178
+ var e2 = w(l2);
179
+ return O.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
180
+ };
181
+ if ($2 === f)
182
+ return this.set(f, this.$M + r2);
183
+ if ($2 === c)
184
+ return this.set(c, this.$y + r2);
185
+ if ($2 === a)
186
+ return y2(1);
187
+ if ($2 === o)
188
+ return y2(7);
189
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
190
+ return O.w(m3, this);
191
+ }, m2.subtract = function(t2, e2) {
192
+ return this.add(-1 * t2, e2);
193
+ }, m2.format = function(t2) {
194
+ var e2 = this, n2 = this.$locale();
195
+ if (!this.isValid())
196
+ return n2.invalidDate || l;
197
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h2 = function(t3, n3, i3, s3) {
198
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
199
+ }, c2 = function(t3) {
200
+ return O.s(s2 % 12 || 12, t3, "0");
201
+ }, d2 = n2.meridiem || function(t3, e3, n3) {
202
+ var r3 = t3 < 12 ? "AM" : "PM";
203
+ return n3 ? r3.toLowerCase() : r3;
204
+ }, $2 = { YY: String(this.$y).slice(-2), YYYY: O.s(this.$y, 4, "0"), M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f2, 3), MMMM: h2(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o2, 2), ddd: h2(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 };
205
+ return r2.replace(y, function(t3, e3) {
206
+ return e3 || $2[t3] || i2.replace(":", "");
207
+ });
208
+ }, m2.utcOffset = function() {
209
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
210
+ }, m2.diff = function(r2, d2, l2) {
211
+ var $2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, v2 = this - M3, g2 = O.m(this, M3);
212
+ return g2 = ($2 = {}, $2[c] = g2 / 12, $2[f] = g2, $2[h] = g2 / 3, $2[o] = (v2 - m3) / 6048e5, $2[a] = (v2 - m3) / 864e5, $2[u] = v2 / n, $2[s] = v2 / e, $2[i] = v2 / t, $2)[y2] || v2, l2 ? g2 : O.a(g2);
213
+ }, m2.daysInMonth = function() {
214
+ return this.endOf(f).$D;
215
+ }, m2.$locale = function() {
216
+ return D[this.$L];
217
+ }, m2.locale = function(t2, e2) {
218
+ if (!t2)
219
+ return this.$L;
220
+ var n2 = this.clone(), r2 = S(t2, e2, true);
221
+ return r2 && (n2.$L = r2), n2;
222
+ }, m2.clone = function() {
223
+ return O.w(this.$d, this);
224
+ }, m2.toDate = function() {
225
+ return new Date(this.valueOf());
226
+ }, m2.toJSON = function() {
227
+ return this.isValid() ? this.toISOString() : null;
228
+ }, m2.toISOString = function() {
229
+ return this.$d.toISOString();
230
+ }, m2.toString = function() {
231
+ return this.$d.toUTCString();
232
+ }, M2;
233
+ }(), T = _.prototype;
234
+ return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) {
235
+ T[t2[1]] = function(e2) {
236
+ return this.$g(e2, t2[0], t2[1]);
237
+ };
238
+ }), w.extend = function(t2, e2) {
239
+ return t2.$i || (t2(e2, _, w), t2.$i = true), w;
240
+ }, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
241
+ return w(1e3 * t2);
242
+ }, w.en = D[g], w.Ls = D, w.p = {}, w;
243
+ });
244
+ }
245
+ });
246
+
247
+ // node_modules/dayjs/plugin/advancedFormat.js
248
+ var require_advancedFormat = __commonJS({
249
+ "node_modules/dayjs/plugin/advancedFormat.js"(exports, module) {
250
+ !function(e, t) {
251
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_advancedFormat = t();
252
+ }(exports, function() {
253
+ "use strict";
254
+ return function(e, t) {
255
+ var r = t.prototype, n = r.format;
256
+ r.format = function(e2) {
257
+ var t2 = this, r2 = this.$locale();
258
+ if (!this.isValid())
259
+ return n.bind(this)(e2);
260
+ var s = this.$utils(), a = (e2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(e3) {
261
+ switch (e3) {
262
+ case "Q":
263
+ return Math.ceil((t2.$M + 1) / 3);
264
+ case "Do":
265
+ return r2.ordinal(t2.$D);
266
+ case "gggg":
267
+ return t2.weekYear();
268
+ case "GGGG":
269
+ return t2.isoWeekYear();
270
+ case "wo":
271
+ return r2.ordinal(t2.week(), "W");
272
+ case "w":
273
+ case "ww":
274
+ return s.s(t2.week(), "w" === e3 ? 1 : 2, "0");
275
+ case "W":
276
+ case "WW":
277
+ return s.s(t2.isoWeek(), "W" === e3 ? 1 : 2, "0");
278
+ case "k":
279
+ case "kk":
280
+ return s.s(String(0 === t2.$H ? 24 : t2.$H), "k" === e3 ? 1 : 2, "0");
281
+ case "X":
282
+ return Math.floor(t2.$d.getTime() / 1e3);
283
+ case "x":
284
+ return t2.$d.getTime();
285
+ case "z":
286
+ return "[" + t2.offsetName() + "]";
287
+ case "zzz":
288
+ return "[" + t2.offsetName("long") + "]";
289
+ default:
290
+ return e3;
291
+ }
292
+ });
293
+ return n.bind(this)(a);
294
+ };
295
+ };
296
+ });
297
+ }
298
+ });
299
+
300
+ // node_modules/dayjs/plugin/localizedFormat.js
301
+ var require_localizedFormat = __commonJS({
302
+ "node_modules/dayjs/plugin/localizedFormat.js"(exports, module) {
303
+ !function(e, t) {
304
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_localizedFormat = t();
305
+ }(exports, function() {
306
+ "use strict";
307
+ var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
308
+ return function(t, o, n) {
309
+ var r = o.prototype, i = r.format;
310
+ n.en.formats = e, r.format = function(t2) {
311
+ void 0 === t2 && (t2 = "YYYY-MM-DDTHH:mm:ssZ");
312
+ var o2 = this.$locale().formats, n2 = function(t3, o3) {
313
+ return t3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t4, n3, r2) {
314
+ var i2 = r2 && r2.toUpperCase();
315
+ return n3 || o3[r2] || e[r2] || o3[i2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e2, t5, o4) {
316
+ return t5 || o4.slice(1);
317
+ });
318
+ });
319
+ }(t2, void 0 === o2 ? {} : o2);
320
+ return i.call(this, n2);
321
+ };
322
+ };
323
+ });
324
+ }
325
+ });
326
+
327
+ // node_modules/dayjs/plugin/utc.js
328
+ var require_utc = __commonJS({
329
+ "node_modules/dayjs/plugin/utc.js"(exports, module) {
330
+ !function(t, i) {
331
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_utc = i();
332
+ }(exports, function() {
333
+ "use strict";
334
+ var t = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
335
+ return function(s, f, n) {
336
+ var u = f.prototype;
337
+ n.utc = function(t2) {
338
+ var i2 = { date: t2, utc: true, args: arguments };
339
+ return new f(i2);
340
+ }, u.utc = function(i2) {
341
+ var e2 = n(this.toDate(), { locale: this.$L, utc: true });
342
+ return i2 ? e2.add(this.utcOffset(), t) : e2;
343
+ }, u.local = function() {
344
+ return n(this.toDate(), { locale: this.$L, utc: false });
345
+ };
346
+ var o = u.parse;
347
+ u.parse = function(t2) {
348
+ t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), o.call(this, t2);
349
+ };
350
+ var r = u.init;
351
+ u.init = function() {
352
+ if (this.$u) {
353
+ var t2 = this.$d;
354
+ this.$y = t2.getUTCFullYear(), this.$M = t2.getUTCMonth(), this.$D = t2.getUTCDate(), this.$W = t2.getUTCDay(), this.$H = t2.getUTCHours(), this.$m = t2.getUTCMinutes(), this.$s = t2.getUTCSeconds(), this.$ms = t2.getUTCMilliseconds();
355
+ } else
356
+ r.call(this);
357
+ };
358
+ var a = u.utcOffset;
359
+ u.utcOffset = function(s2, f2) {
360
+ var n2 = this.$utils().u;
361
+ if (n2(s2))
362
+ return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
363
+ if ("string" == typeof s2 && (s2 = function(t2) {
364
+ void 0 === t2 && (t2 = "");
365
+ var s3 = t2.match(i);
366
+ if (!s3)
367
+ return null;
368
+ var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
369
+ return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
370
+ }(s2), null === s2))
371
+ return this;
372
+ var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2, o2 = this;
373
+ if (f2)
374
+ return o2.$offset = u2, o2.$u = 0 === s2, o2;
375
+ if (0 !== s2) {
376
+ var r2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
377
+ (o2 = this.local().add(u2 + r2, t)).$offset = u2, o2.$x.$localOffset = r2;
378
+ } else
379
+ o2 = this.utc();
380
+ return o2;
381
+ };
382
+ var h = u.format;
383
+ u.format = function(t2) {
384
+ var i2 = t2 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
385
+ return h.call(this, i2);
386
+ }, u.valueOf = function() {
387
+ var t2 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
388
+ return this.$d.valueOf() - 6e4 * t2;
389
+ }, u.isUTC = function() {
390
+ return !!this.$u;
391
+ }, u.toISOString = function() {
392
+ return this.toDate().toISOString();
393
+ }, u.toString = function() {
394
+ return this.toDate().toUTCString();
395
+ };
396
+ var l = u.toDate;
397
+ u.toDate = function(t2) {
398
+ return "s" === t2 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
399
+ };
400
+ var c = u.diff;
401
+ u.diff = function(t2, i2, e2) {
402
+ if (t2 && this.$u === t2.$u)
403
+ return c.call(this, t2, i2, e2);
404
+ var s2 = this.local(), f2 = n(t2).local();
405
+ return c.call(s2, f2, i2, e2);
406
+ };
407
+ };
408
+ });
409
+ }
410
+ });
411
+
412
+ // node_modules/dayjs/plugin/timezone.js
413
+ var require_timezone = __commonJS({
414
+ "node_modules/dayjs/plugin/timezone.js"(exports, module) {
415
+ !function(t, e) {
416
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_timezone = e();
417
+ }(exports, function() {
418
+ "use strict";
419
+ var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
420
+ return function(n, i, o) {
421
+ var r, a = function(t2, n2, i2) {
422
+ void 0 === i2 && (i2 = {});
423
+ var o2 = new Date(t2), r2 = function(t3, n3) {
424
+ void 0 === n3 && (n3 = {});
425
+ var i3 = n3.timeZoneName || "short", o3 = t3 + "|" + i3, r3 = e[o3];
426
+ return r3 || (r3 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t3, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o3] = r3), r3;
427
+ }(n2, i2);
428
+ return r2.formatToParts(o2);
429
+ }, u = function(e2, n2) {
430
+ for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
431
+ var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t[s2];
432
+ c >= 0 && (r2[c] = parseInt(m, 10));
433
+ }
434
+ var d = r2[3], l = 24 === d ? 0 : d, v = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", h = +e2;
435
+ return (o.utc(v).valueOf() - (h -= h % 1e3)) / 6e4;
436
+ }, f = i.prototype;
437
+ f.tz = function(t2, e2) {
438
+ void 0 === t2 && (t2 = r);
439
+ var n2 = this.utcOffset(), i2 = this.toDate(), a2 = i2.toLocaleString("en-US", { timeZone: t2 }), u2 = Math.round((i2 - new Date(a2)) / 1e3 / 60), f2 = o(a2).$set("millisecond", this.$ms).utcOffset(15 * -Math.round(i2.getTimezoneOffset() / 15) - u2, true);
440
+ if (e2) {
441
+ var s2 = f2.utcOffset();
442
+ f2 = f2.add(n2 - s2, "minute");
443
+ }
444
+ return f2.$x.$timezone = t2, f2;
445
+ }, f.offsetName = function(t2) {
446
+ var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t2 }).find(function(t3) {
447
+ return "timezonename" === t3.type.toLowerCase();
448
+ });
449
+ return n2 && n2.value;
450
+ };
451
+ var s = f.startOf;
452
+ f.startOf = function(t2, e2) {
453
+ if (!this.$x || !this.$x.$timezone)
454
+ return s.call(this, t2, e2);
455
+ var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"));
456
+ return s.call(n2, t2, e2).tz(this.$x.$timezone, true);
457
+ }, o.tz = function(t2, e2, n2) {
458
+ var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
459
+ if ("string" != typeof t2)
460
+ return o(t2).tz(a2);
461
+ var s2 = function(t3, e3, n3) {
462
+ var i3 = t3 - 60 * e3 * 1e3, o2 = u(i3, n3);
463
+ if (e3 === o2)
464
+ return [i3, e3];
465
+ var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
466
+ return o2 === r2 ? [i3, o2] : [t3 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
467
+ }(o.utc(t2, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
468
+ return d.$x.$timezone = a2, d;
469
+ }, o.tz.guess = function() {
470
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
471
+ }, o.tz.setDefault = function(t2) {
472
+ r = t2;
473
+ };
474
+ };
475
+ });
476
+ }
477
+ });
478
+
479
+ // node_modules/dayjs/plugin/isBetween.js
480
+ var require_isBetween = __commonJS({
481
+ "node_modules/dayjs/plugin/isBetween.js"(exports, module) {
482
+ !function(e, i) {
483
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isBetween = i();
484
+ }(exports, function() {
485
+ "use strict";
486
+ return function(e, i, t) {
487
+ i.prototype.isBetween = function(e2, i2, s, f) {
488
+ var n = t(e2), o = t(i2), r = "(" === (f = f || "()")[0], u = ")" === f[1];
489
+ return (r ? this.isAfter(n, s) : !this.isBefore(n, s)) && (u ? this.isBefore(o, s) : !this.isAfter(o, s)) || (r ? this.isBefore(n, s) : !this.isAfter(n, s)) && (u ? this.isAfter(o, s) : !this.isBefore(o, s));
490
+ };
491
+ };
492
+ });
493
+ }
494
+ });
495
+
496
+ // node_modules/dayjs/plugin/weekOfYear.js
497
+ var require_weekOfYear = __commonJS({
498
+ "node_modules/dayjs/plugin/weekOfYear.js"(exports, module) {
499
+ !function(e, t) {
500
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekOfYear = t();
501
+ }(exports, function() {
502
+ "use strict";
503
+ var e = "week", t = "year";
504
+ return function(i, n, r) {
505
+ var f = n.prototype;
506
+ f.week = function(i2) {
507
+ if (void 0 === i2 && (i2 = null), null !== i2)
508
+ return this.add(7 * (i2 - this.week()), "day");
509
+ var n2 = this.$locale().yearStart || 1;
510
+ if (11 === this.month() && this.date() > 25) {
511
+ var f2 = r(this).startOf(t).add(1, t).date(n2), s = r(this).endOf(e);
512
+ if (f2.isBefore(s))
513
+ return 1;
514
+ }
515
+ var a = r(this).startOf(t).date(n2).startOf(e).subtract(1, "millisecond"), o = this.diff(a, e, true);
516
+ return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
517
+ }, f.weeks = function(e2) {
518
+ return void 0 === e2 && (e2 = null), this.week(e2);
519
+ };
520
+ };
521
+ });
522
+ }
523
+ });
524
+
525
+ // node_modules/dayjs/plugin/quarterOfYear.js
526
+ var require_quarterOfYear = __commonJS({
527
+ "node_modules/dayjs/plugin/quarterOfYear.js"(exports, module) {
528
+ !function(t, n) {
529
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_quarterOfYear = n();
530
+ }(exports, function() {
531
+ "use strict";
532
+ var t = "month", n = "quarter";
533
+ return function(e, i) {
534
+ var r = i.prototype;
535
+ r.quarter = function(t2) {
536
+ return this.$utils().u(t2) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (t2 - 1));
537
+ };
538
+ var s = r.add;
539
+ r.add = function(e2, i2) {
540
+ return e2 = Number(e2), this.$utils().p(i2) === n ? this.add(3 * e2, t) : s.bind(this)(e2, i2);
541
+ };
542
+ var u = r.startOf;
543
+ r.startOf = function(e2, i2) {
544
+ var r2 = this.$utils(), s2 = !!r2.u(i2) || i2;
545
+ if (r2.p(e2) === n) {
546
+ var o = this.quarter() - 1;
547
+ return s2 ? this.month(3 * o).startOf(t).startOf("day") : this.month(3 * o + 2).endOf(t).endOf("day");
548
+ }
549
+ return u.bind(this)(e2, i2);
550
+ };
551
+ };
552
+ });
553
+ }
554
+ });
555
+
556
+ // node_modules/dayjs/plugin/customParseFormat.js
557
+ var require_customParseFormat = __commonJS({
558
+ "node_modules/dayjs/plugin/customParseFormat.js"(exports, module) {
559
+ !function(e, t) {
560
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
561
+ }(exports, function() {
562
+ "use strict";
563
+ var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d\d/, r = /\d\d?/, i = /\d*[^-_:/,()\s\d]+/, o = {}, s = function(e2) {
564
+ return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
565
+ };
566
+ var a = function(e2) {
567
+ return function(t2) {
568
+ this[e2] = +t2;
569
+ };
570
+ }, f = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
571
+ (this.zone || (this.zone = {})).offset = function(e3) {
572
+ if (!e3)
573
+ return 0;
574
+ if ("Z" === e3)
575
+ return 0;
576
+ var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
577
+ return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
578
+ }(e2);
579
+ }], h = function(e2) {
580
+ var t2 = o[e2];
581
+ return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
582
+ }, u = function(e2, t2) {
583
+ var n2, r2 = o.meridiem;
584
+ if (r2) {
585
+ for (var i2 = 1; i2 <= 24; i2 += 1)
586
+ if (e2.indexOf(r2(i2, 0, t2)) > -1) {
587
+ n2 = i2 > 12;
588
+ break;
589
+ }
590
+ } else
591
+ n2 = e2 === (t2 ? "pm" : "PM");
592
+ return n2;
593
+ }, d = { A: [i, function(e2) {
594
+ this.afternoon = u(e2, false);
595
+ }], a: [i, function(e2) {
596
+ this.afternoon = u(e2, true);
597
+ }], S: [/\d/, function(e2) {
598
+ this.milliseconds = 100 * +e2;
599
+ }], SS: [n, function(e2) {
600
+ this.milliseconds = 10 * +e2;
601
+ }], SSS: [/\d{3}/, function(e2) {
602
+ this.milliseconds = +e2;
603
+ }], s: [r, a("seconds")], ss: [r, a("seconds")], m: [r, a("minutes")], mm: [r, a("minutes")], H: [r, a("hours")], h: [r, a("hours")], HH: [r, a("hours")], hh: [r, a("hours")], D: [r, a("day")], DD: [n, a("day")], Do: [i, function(e2) {
604
+ var t2 = o.ordinal, n2 = e2.match(/\d+/);
605
+ if (this.day = n2[0], t2)
606
+ for (var r2 = 1; r2 <= 31; r2 += 1)
607
+ t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
608
+ }], M: [r, a("month")], MM: [n, a("month")], MMM: [i, function(e2) {
609
+ var t2 = h("months"), n2 = (h("monthsShort") || t2.map(function(e3) {
610
+ return e3.slice(0, 3);
611
+ })).indexOf(e2) + 1;
612
+ if (n2 < 1)
613
+ throw new Error();
614
+ this.month = n2 % 12 || n2;
615
+ }], MMMM: [i, function(e2) {
616
+ var t2 = h("months").indexOf(e2) + 1;
617
+ if (t2 < 1)
618
+ throw new Error();
619
+ this.month = t2 % 12 || t2;
620
+ }], Y: [/[+-]?\d+/, a("year")], YY: [n, function(e2) {
621
+ this.year = s(e2);
622
+ }], YYYY: [/\d{4}/, a("year")], Z: f, ZZ: f };
623
+ function c(n2) {
624
+ var r2, i2;
625
+ r2 = n2, i2 = o && o.formats;
626
+ for (var s2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t2, n3, r3) {
627
+ var o2 = r3 && r3.toUpperCase();
628
+ return n3 || i2[r3] || e[r3] || i2[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e2, t3, n4) {
629
+ return t3 || n4.slice(1);
630
+ });
631
+ })).match(t), a2 = s2.length, f2 = 0; f2 < a2; f2 += 1) {
632
+ var h2 = s2[f2], u2 = d[h2], c2 = u2 && u2[0], l = u2 && u2[1];
633
+ s2[f2] = l ? { regex: c2, parser: l } : h2.replace(/^\[|\]$/g, "");
634
+ }
635
+ return function(e2) {
636
+ for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
637
+ var i3 = s2[n3];
638
+ if ("string" == typeof i3)
639
+ r3 += i3.length;
640
+ else {
641
+ var o2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = o2.exec(h3)[0];
642
+ f3.call(t2, u3), e2 = e2.replace(u3, "");
643
+ }
644
+ }
645
+ return function(e3) {
646
+ var t3 = e3.afternoon;
647
+ if (void 0 !== t3) {
648
+ var n4 = e3.hours;
649
+ t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
650
+ }
651
+ }(t2), t2;
652
+ };
653
+ }
654
+ return function(e2, t2, n2) {
655
+ n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (s = e2.parseTwoDigitYear);
656
+ var r2 = t2.prototype, i2 = r2.parse;
657
+ r2.parse = function(e3) {
658
+ var t3 = e3.date, r3 = e3.utc, s2 = e3.args;
659
+ this.$u = r3;
660
+ var a2 = s2[1];
661
+ if ("string" == typeof a2) {
662
+ var f2 = true === s2[2], h2 = true === s2[3], u2 = f2 || h2, d2 = s2[2];
663
+ h2 && (d2 = s2[2]), o = this.$locale(), !f2 && d2 && (o = n2.Ls[d2]), this.$d = function(e4, t4, n3) {
664
+ try {
665
+ if (["x", "X"].indexOf(t4) > -1)
666
+ return new Date(("X" === t4 ? 1e3 : 1) * e4);
667
+ var r4 = c(t4)(e4), i3 = r4.year, o2 = r4.month, s3 = r4.day, a3 = r4.hours, f3 = r4.minutes, h3 = r4.seconds, u3 = r4.milliseconds, d3 = r4.zone, l2 = /* @__PURE__ */ new Date(), m2 = s3 || (i3 || o2 ? 1 : l2.getDate()), M2 = i3 || l2.getFullYear(), Y = 0;
668
+ i3 && !o2 || (Y = o2 > 0 ? o2 - 1 : l2.getMonth());
669
+ var p = a3 || 0, v = f3 || 0, D = h3 || 0, g = u3 || 0;
670
+ return d3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g + 60 * d3.offset * 1e3)) : n3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g)) : new Date(M2, Y, m2, p, v, D, g);
671
+ } catch (e5) {
672
+ return /* @__PURE__ */ new Date("");
673
+ }
674
+ }(t3, a2, r3), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), o = {};
675
+ } else if (a2 instanceof Array)
676
+ for (var l = a2.length, m = 1; m <= l; m += 1) {
677
+ s2[1] = a2[m - 1];
678
+ var M = n2.apply(this, s2);
679
+ if (M.isValid()) {
680
+ this.$d = M.$d, this.$L = M.$L, this.init();
681
+ break;
682
+ }
683
+ m === l && (this.$d = /* @__PURE__ */ new Date(""));
684
+ }
685
+ else
686
+ i2.call(this, e3);
687
+ };
688
+ };
689
+ });
690
+ }
691
+ });
692
+
693
+ // node_modules/dayjs/plugin/isSameOrBefore.js
694
+ var require_isSameOrBefore = __commonJS({
695
+ "node_modules/dayjs/plugin/isSameOrBefore.js"(exports, module) {
696
+ !function(e, i) {
697
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isSameOrBefore = i();
698
+ }(exports, function() {
699
+ "use strict";
700
+ return function(e, i) {
701
+ i.prototype.isSameOrBefore = function(e2, i2) {
702
+ return this.isSame(e2, i2) || this.isBefore(e2, i2);
703
+ };
704
+ };
705
+ });
706
+ }
707
+ });
708
+
709
+ // node_modules/dayjs/plugin/isToday.js
710
+ var require_isToday = __commonJS({
711
+ "node_modules/dayjs/plugin/isToday.js"(exports, module) {
712
+ !function(e, o) {
713
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = o() : "function" == typeof define && define.amd ? define(o) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isToday = o();
714
+ }(exports, function() {
715
+ "use strict";
716
+ return function(e, o, t) {
717
+ o.prototype.isToday = function() {
718
+ var e2 = "YYYY-MM-DD", o2 = t();
719
+ return this.format(e2) === o2.format(e2);
720
+ };
721
+ };
722
+ });
723
+ }
724
+ });
725
+
726
+ // node_modules/lodash.isequal/index.js
727
+ var require_lodash = __commonJS({
728
+ "node_modules/lodash.isequal/index.js"(exports, module) {
729
+ var LARGE_ARRAY_SIZE = 200;
730
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
731
+ var COMPARE_PARTIAL_FLAG = 1;
732
+ var COMPARE_UNORDERED_FLAG = 2;
733
+ var MAX_SAFE_INTEGER = 9007199254740991;
734
+ var argsTag = "[object Arguments]";
735
+ var arrayTag = "[object Array]";
736
+ var asyncTag = "[object AsyncFunction]";
737
+ var boolTag = "[object Boolean]";
738
+ var dateTag = "[object Date]";
739
+ var errorTag = "[object Error]";
740
+ var funcTag = "[object Function]";
741
+ var genTag = "[object GeneratorFunction]";
742
+ var mapTag = "[object Map]";
743
+ var numberTag = "[object Number]";
744
+ var nullTag = "[object Null]";
745
+ var objectTag = "[object Object]";
746
+ var promiseTag = "[object Promise]";
747
+ var proxyTag = "[object Proxy]";
748
+ var regexpTag = "[object RegExp]";
749
+ var setTag = "[object Set]";
750
+ var stringTag = "[object String]";
751
+ var symbolTag = "[object Symbol]";
752
+ var undefinedTag = "[object Undefined]";
753
+ var weakMapTag = "[object WeakMap]";
754
+ var arrayBufferTag = "[object ArrayBuffer]";
755
+ var dataViewTag = "[object DataView]";
756
+ var float32Tag = "[object Float32Array]";
757
+ var float64Tag = "[object Float64Array]";
758
+ var int8Tag = "[object Int8Array]";
759
+ var int16Tag = "[object Int16Array]";
760
+ var int32Tag = "[object Int32Array]";
761
+ var uint8Tag = "[object Uint8Array]";
762
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
763
+ var uint16Tag = "[object Uint16Array]";
764
+ var uint32Tag = "[object Uint32Array]";
765
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
766
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
767
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
768
+ var typedArrayTags = {};
769
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
770
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
771
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
772
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
773
+ var root = freeGlobal || freeSelf || Function("return this")();
774
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
775
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
776
+ var moduleExports = freeModule && freeModule.exports === freeExports;
777
+ var freeProcess = moduleExports && freeGlobal.process;
778
+ var nodeUtil = function() {
779
+ try {
780
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
781
+ } catch (e) {
782
+ }
783
+ }();
784
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
785
+ function arrayFilter(array, predicate) {
786
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
787
+ while (++index < length) {
788
+ var value = array[index];
789
+ if (predicate(value, index, array)) {
790
+ result[resIndex++] = value;
791
+ }
792
+ }
793
+ return result;
794
+ }
795
+ function arrayPush(array, values) {
796
+ var index = -1, length = values.length, offset = array.length;
797
+ while (++index < length) {
798
+ array[offset + index] = values[index];
799
+ }
800
+ return array;
801
+ }
802
+ function arraySome(array, predicate) {
803
+ var index = -1, length = array == null ? 0 : array.length;
804
+ while (++index < length) {
805
+ if (predicate(array[index], index, array)) {
806
+ return true;
807
+ }
808
+ }
809
+ return false;
810
+ }
811
+ function baseTimes(n, iteratee) {
812
+ var index = -1, result = Array(n);
813
+ while (++index < n) {
814
+ result[index] = iteratee(index);
815
+ }
816
+ return result;
817
+ }
818
+ function baseUnary(func) {
819
+ return function(value) {
820
+ return func(value);
821
+ };
822
+ }
823
+ function cacheHas(cache, key) {
824
+ return cache.has(key);
825
+ }
826
+ function getValue(object, key) {
827
+ return object == null ? void 0 : object[key];
828
+ }
829
+ function mapToArray(map) {
830
+ var index = -1, result = Array(map.size);
831
+ map.forEach(function(value, key) {
832
+ result[++index] = [key, value];
833
+ });
834
+ return result;
835
+ }
836
+ function overArg(func, transform) {
837
+ return function(arg) {
838
+ return func(transform(arg));
839
+ };
840
+ }
841
+ function setToArray(set) {
842
+ var index = -1, result = Array(set.size);
843
+ set.forEach(function(value) {
844
+ result[++index] = value;
845
+ });
846
+ return result;
847
+ }
848
+ var arrayProto = Array.prototype;
849
+ var funcProto = Function.prototype;
850
+ var objectProto = Object.prototype;
851
+ var coreJsData = root["__core-js_shared__"];
852
+ var funcToString = funcProto.toString;
853
+ var hasOwnProperty = objectProto.hasOwnProperty;
854
+ var maskSrcKey = function() {
855
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
856
+ return uid ? "Symbol(src)_1." + uid : "";
857
+ }();
858
+ var nativeObjectToString = objectProto.toString;
859
+ var reIsNative = RegExp(
860
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
861
+ );
862
+ var Buffer2 = moduleExports ? root.Buffer : void 0;
863
+ var Symbol2 = root.Symbol;
864
+ var Uint8Array2 = root.Uint8Array;
865
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
866
+ var splice = arrayProto.splice;
867
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
868
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
869
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
870
+ var nativeKeys = overArg(Object.keys, Object);
871
+ var DataView = getNative(root, "DataView");
872
+ var Map = getNative(root, "Map");
873
+ var Promise2 = getNative(root, "Promise");
874
+ var Set = getNative(root, "Set");
875
+ var WeakMap = getNative(root, "WeakMap");
876
+ var nativeCreate = getNative(Object, "create");
877
+ var dataViewCtorString = toSource(DataView);
878
+ var mapCtorString = toSource(Map);
879
+ var promiseCtorString = toSource(Promise2);
880
+ var setCtorString = toSource(Set);
881
+ var weakMapCtorString = toSource(WeakMap);
882
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
883
+ var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
884
+ function Hash(entries) {
885
+ var index = -1, length = entries == null ? 0 : entries.length;
886
+ this.clear();
887
+ while (++index < length) {
888
+ var entry = entries[index];
889
+ this.set(entry[0], entry[1]);
890
+ }
891
+ }
892
+ function hashClear() {
893
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
894
+ this.size = 0;
895
+ }
896
+ function hashDelete(key) {
897
+ var result = this.has(key) && delete this.__data__[key];
898
+ this.size -= result ? 1 : 0;
899
+ return result;
900
+ }
901
+ function hashGet(key) {
902
+ var data = this.__data__;
903
+ if (nativeCreate) {
904
+ var result = data[key];
905
+ return result === HASH_UNDEFINED ? void 0 : result;
906
+ }
907
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
908
+ }
909
+ function hashHas(key) {
910
+ var data = this.__data__;
911
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
912
+ }
913
+ function hashSet(key, value) {
914
+ var data = this.__data__;
915
+ this.size += this.has(key) ? 0 : 1;
916
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
917
+ return this;
918
+ }
919
+ Hash.prototype.clear = hashClear;
920
+ Hash.prototype["delete"] = hashDelete;
921
+ Hash.prototype.get = hashGet;
922
+ Hash.prototype.has = hashHas;
923
+ Hash.prototype.set = hashSet;
924
+ function ListCache(entries) {
925
+ var index = -1, length = entries == null ? 0 : entries.length;
926
+ this.clear();
927
+ while (++index < length) {
928
+ var entry = entries[index];
929
+ this.set(entry[0], entry[1]);
930
+ }
931
+ }
932
+ function listCacheClear() {
933
+ this.__data__ = [];
934
+ this.size = 0;
935
+ }
936
+ function listCacheDelete(key) {
937
+ var data = this.__data__, index = assocIndexOf(data, key);
938
+ if (index < 0) {
939
+ return false;
940
+ }
941
+ var lastIndex = data.length - 1;
942
+ if (index == lastIndex) {
943
+ data.pop();
944
+ } else {
945
+ splice.call(data, index, 1);
946
+ }
947
+ --this.size;
948
+ return true;
949
+ }
950
+ function listCacheGet(key) {
951
+ var data = this.__data__, index = assocIndexOf(data, key);
952
+ return index < 0 ? void 0 : data[index][1];
953
+ }
954
+ function listCacheHas(key) {
955
+ return assocIndexOf(this.__data__, key) > -1;
956
+ }
957
+ function listCacheSet(key, value) {
958
+ var data = this.__data__, index = assocIndexOf(data, key);
959
+ if (index < 0) {
960
+ ++this.size;
961
+ data.push([key, value]);
962
+ } else {
963
+ data[index][1] = value;
964
+ }
965
+ return this;
966
+ }
967
+ ListCache.prototype.clear = listCacheClear;
968
+ ListCache.prototype["delete"] = listCacheDelete;
969
+ ListCache.prototype.get = listCacheGet;
970
+ ListCache.prototype.has = listCacheHas;
971
+ ListCache.prototype.set = listCacheSet;
972
+ function MapCache(entries) {
973
+ var index = -1, length = entries == null ? 0 : entries.length;
974
+ this.clear();
975
+ while (++index < length) {
976
+ var entry = entries[index];
977
+ this.set(entry[0], entry[1]);
978
+ }
979
+ }
980
+ function mapCacheClear() {
981
+ this.size = 0;
982
+ this.__data__ = {
983
+ "hash": new Hash(),
984
+ "map": new (Map || ListCache)(),
985
+ "string": new Hash()
986
+ };
987
+ }
988
+ function mapCacheDelete(key) {
989
+ var result = getMapData(this, key)["delete"](key);
990
+ this.size -= result ? 1 : 0;
991
+ return result;
992
+ }
993
+ function mapCacheGet(key) {
994
+ return getMapData(this, key).get(key);
995
+ }
996
+ function mapCacheHas(key) {
997
+ return getMapData(this, key).has(key);
998
+ }
999
+ function mapCacheSet(key, value) {
1000
+ var data = getMapData(this, key), size = data.size;
1001
+ data.set(key, value);
1002
+ this.size += data.size == size ? 0 : 1;
1003
+ return this;
1004
+ }
1005
+ MapCache.prototype.clear = mapCacheClear;
1006
+ MapCache.prototype["delete"] = mapCacheDelete;
1007
+ MapCache.prototype.get = mapCacheGet;
1008
+ MapCache.prototype.has = mapCacheHas;
1009
+ MapCache.prototype.set = mapCacheSet;
1010
+ function SetCache(values) {
1011
+ var index = -1, length = values == null ? 0 : values.length;
1012
+ this.__data__ = new MapCache();
1013
+ while (++index < length) {
1014
+ this.add(values[index]);
1015
+ }
1016
+ }
1017
+ function setCacheAdd(value) {
1018
+ this.__data__.set(value, HASH_UNDEFINED);
1019
+ return this;
1020
+ }
1021
+ function setCacheHas(value) {
1022
+ return this.__data__.has(value);
1023
+ }
1024
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
1025
+ SetCache.prototype.has = setCacheHas;
1026
+ function Stack(entries) {
1027
+ var data = this.__data__ = new ListCache(entries);
1028
+ this.size = data.size;
1029
+ }
1030
+ function stackClear() {
1031
+ this.__data__ = new ListCache();
1032
+ this.size = 0;
1033
+ }
1034
+ function stackDelete(key) {
1035
+ var data = this.__data__, result = data["delete"](key);
1036
+ this.size = data.size;
1037
+ return result;
1038
+ }
1039
+ function stackGet(key) {
1040
+ return this.__data__.get(key);
1041
+ }
1042
+ function stackHas(key) {
1043
+ return this.__data__.has(key);
1044
+ }
1045
+ function stackSet(key, value) {
1046
+ var data = this.__data__;
1047
+ if (data instanceof ListCache) {
1048
+ var pairs = data.__data__;
1049
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
1050
+ pairs.push([key, value]);
1051
+ this.size = ++data.size;
1052
+ return this;
1053
+ }
1054
+ data = this.__data__ = new MapCache(pairs);
1055
+ }
1056
+ data.set(key, value);
1057
+ this.size = data.size;
1058
+ return this;
1059
+ }
1060
+ Stack.prototype.clear = stackClear;
1061
+ Stack.prototype["delete"] = stackDelete;
1062
+ Stack.prototype.get = stackGet;
1063
+ Stack.prototype.has = stackHas;
1064
+ Stack.prototype.set = stackSet;
1065
+ function arrayLikeKeys(value, inherited) {
1066
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
1067
+ for (var key in value) {
1068
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
1069
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1070
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1071
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
1072
+ isIndex(key, length)))) {
1073
+ result.push(key);
1074
+ }
1075
+ }
1076
+ return result;
1077
+ }
1078
+ function assocIndexOf(array, key) {
1079
+ var length = array.length;
1080
+ while (length--) {
1081
+ if (eq(array[length][0], key)) {
1082
+ return length;
1083
+ }
1084
+ }
1085
+ return -1;
1086
+ }
1087
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1088
+ var result = keysFunc(object);
1089
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1090
+ }
1091
+ function baseGetTag(value) {
1092
+ if (value == null) {
1093
+ return value === void 0 ? undefinedTag : nullTag;
1094
+ }
1095
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
1096
+ }
1097
+ function baseIsArguments(value) {
1098
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1099
+ }
1100
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
1101
+ if (value === other) {
1102
+ return true;
1103
+ }
1104
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
1105
+ return value !== value && other !== other;
1106
+ }
1107
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1108
+ }
1109
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1110
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
1111
+ objTag = objTag == argsTag ? objectTag : objTag;
1112
+ othTag = othTag == argsTag ? objectTag : othTag;
1113
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
1114
+ if (isSameTag && isBuffer(object)) {
1115
+ if (!isBuffer(other)) {
1116
+ return false;
1117
+ }
1118
+ objIsArr = true;
1119
+ objIsObj = false;
1120
+ }
1121
+ if (isSameTag && !objIsObj) {
1122
+ stack || (stack = new Stack());
1123
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1124
+ }
1125
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1126
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
1127
+ if (objIsWrapped || othIsWrapped) {
1128
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
1129
+ stack || (stack = new Stack());
1130
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1131
+ }
1132
+ }
1133
+ if (!isSameTag) {
1134
+ return false;
1135
+ }
1136
+ stack || (stack = new Stack());
1137
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1138
+ }
1139
+ function baseIsNative(value) {
1140
+ if (!isObject2(value) || isMasked(value)) {
1141
+ return false;
1142
+ }
1143
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1144
+ return pattern.test(toSource(value));
1145
+ }
1146
+ function baseIsTypedArray(value) {
1147
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1148
+ }
1149
+ function baseKeys(object) {
1150
+ if (!isPrototype(object)) {
1151
+ return nativeKeys(object);
1152
+ }
1153
+ var result = [];
1154
+ for (var key in Object(object)) {
1155
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
1156
+ result.push(key);
1157
+ }
1158
+ }
1159
+ return result;
1160
+ }
1161
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1162
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
1163
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1164
+ return false;
1165
+ }
1166
+ var stacked = stack.get(array);
1167
+ if (stacked && stack.get(other)) {
1168
+ return stacked == other;
1169
+ }
1170
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
1171
+ stack.set(array, other);
1172
+ stack.set(other, array);
1173
+ while (++index < arrLength) {
1174
+ var arrValue = array[index], othValue = other[index];
1175
+ if (customizer) {
1176
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
1177
+ }
1178
+ if (compared !== void 0) {
1179
+ if (compared) {
1180
+ continue;
1181
+ }
1182
+ result = false;
1183
+ break;
1184
+ }
1185
+ if (seen) {
1186
+ if (!arraySome(other, function(othValue2, othIndex) {
1187
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
1188
+ return seen.push(othIndex);
1189
+ }
1190
+ })) {
1191
+ result = false;
1192
+ break;
1193
+ }
1194
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1195
+ result = false;
1196
+ break;
1197
+ }
1198
+ }
1199
+ stack["delete"](array);
1200
+ stack["delete"](other);
1201
+ return result;
1202
+ }
1203
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1204
+ switch (tag) {
1205
+ case dataViewTag:
1206
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
1207
+ return false;
1208
+ }
1209
+ object = object.buffer;
1210
+ other = other.buffer;
1211
+ case arrayBufferTag:
1212
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
1213
+ return false;
1214
+ }
1215
+ return true;
1216
+ case boolTag:
1217
+ case dateTag:
1218
+ case numberTag:
1219
+ return eq(+object, +other);
1220
+ case errorTag:
1221
+ return object.name == other.name && object.message == other.message;
1222
+ case regexpTag:
1223
+ case stringTag:
1224
+ return object == other + "";
1225
+ case mapTag:
1226
+ var convert = mapToArray;
1227
+ case setTag:
1228
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
1229
+ convert || (convert = setToArray);
1230
+ if (object.size != other.size && !isPartial) {
1231
+ return false;
1232
+ }
1233
+ var stacked = stack.get(object);
1234
+ if (stacked) {
1235
+ return stacked == other;
1236
+ }
1237
+ bitmask |= COMPARE_UNORDERED_FLAG;
1238
+ stack.set(object, other);
1239
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1240
+ stack["delete"](object);
1241
+ return result;
1242
+ case symbolTag:
1243
+ if (symbolValueOf) {
1244
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1245
+ }
1246
+ }
1247
+ return false;
1248
+ }
1249
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1250
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
1251
+ if (objLength != othLength && !isPartial) {
1252
+ return false;
1253
+ }
1254
+ var index = objLength;
1255
+ while (index--) {
1256
+ var key = objProps[index];
1257
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
1258
+ return false;
1259
+ }
1260
+ }
1261
+ var stacked = stack.get(object);
1262
+ if (stacked && stack.get(other)) {
1263
+ return stacked == other;
1264
+ }
1265
+ var result = true;
1266
+ stack.set(object, other);
1267
+ stack.set(other, object);
1268
+ var skipCtor = isPartial;
1269
+ while (++index < objLength) {
1270
+ key = objProps[index];
1271
+ var objValue = object[key], othValue = other[key];
1272
+ if (customizer) {
1273
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
1274
+ }
1275
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
1276
+ result = false;
1277
+ break;
1278
+ }
1279
+ skipCtor || (skipCtor = key == "constructor");
1280
+ }
1281
+ if (result && !skipCtor) {
1282
+ var objCtor = object.constructor, othCtor = other.constructor;
1283
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
1284
+ result = false;
1285
+ }
1286
+ }
1287
+ stack["delete"](object);
1288
+ stack["delete"](other);
1289
+ return result;
1290
+ }
1291
+ function getAllKeys(object) {
1292
+ return baseGetAllKeys(object, keys, getSymbols);
1293
+ }
1294
+ function getMapData(map, key) {
1295
+ var data = map.__data__;
1296
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1297
+ }
1298
+ function getNative(object, key) {
1299
+ var value = getValue(object, key);
1300
+ return baseIsNative(value) ? value : void 0;
1301
+ }
1302
+ function getRawTag(value) {
1303
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
1304
+ try {
1305
+ value[symToStringTag] = void 0;
1306
+ var unmasked = true;
1307
+ } catch (e) {
1308
+ }
1309
+ var result = nativeObjectToString.call(value);
1310
+ if (unmasked) {
1311
+ if (isOwn) {
1312
+ value[symToStringTag] = tag;
1313
+ } else {
1314
+ delete value[symToStringTag];
1315
+ }
1316
+ }
1317
+ return result;
1318
+ }
1319
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1320
+ if (object == null) {
1321
+ return [];
1322
+ }
1323
+ object = Object(object);
1324
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1325
+ return propertyIsEnumerable.call(object, symbol);
1326
+ });
1327
+ };
1328
+ var getTag = baseGetTag;
1329
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
1330
+ getTag = function(value) {
1331
+ var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
1332
+ if (ctorString) {
1333
+ switch (ctorString) {
1334
+ case dataViewCtorString:
1335
+ return dataViewTag;
1336
+ case mapCtorString:
1337
+ return mapTag;
1338
+ case promiseCtorString:
1339
+ return promiseTag;
1340
+ case setCtorString:
1341
+ return setTag;
1342
+ case weakMapCtorString:
1343
+ return weakMapTag;
1344
+ }
1345
+ }
1346
+ return result;
1347
+ };
1348
+ }
1349
+ function isIndex(value, length) {
1350
+ length = length == null ? MAX_SAFE_INTEGER : length;
1351
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
1352
+ }
1353
+ function isKeyable(value) {
1354
+ var type = typeof value;
1355
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1356
+ }
1357
+ function isMasked(func) {
1358
+ return !!maskSrcKey && maskSrcKey in func;
1359
+ }
1360
+ function isPrototype(value) {
1361
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
1362
+ return value === proto;
1363
+ }
1364
+ function objectToString(value) {
1365
+ return nativeObjectToString.call(value);
1366
+ }
1367
+ function toSource(func) {
1368
+ if (func != null) {
1369
+ try {
1370
+ return funcToString.call(func);
1371
+ } catch (e) {
1372
+ }
1373
+ try {
1374
+ return func + "";
1375
+ } catch (e) {
1376
+ }
1377
+ }
1378
+ return "";
1379
+ }
1380
+ function eq(value, other) {
1381
+ return value === other || value !== value && other !== other;
1382
+ }
1383
+ var isArguments = baseIsArguments(function() {
1384
+ return arguments;
1385
+ }()) ? baseIsArguments : function(value) {
1386
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1387
+ };
1388
+ var isArray = Array.isArray;
1389
+ function isArrayLike(value) {
1390
+ return value != null && isLength(value.length) && !isFunction(value);
1391
+ }
1392
+ var isBuffer = nativeIsBuffer || stubFalse;
1393
+ function isEqual2(value, other) {
1394
+ return baseIsEqual(value, other);
1395
+ }
1396
+ function isFunction(value) {
1397
+ if (!isObject2(value)) {
1398
+ return false;
1399
+ }
1400
+ var tag = baseGetTag(value);
1401
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1402
+ }
1403
+ function isLength(value) {
1404
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1405
+ }
1406
+ function isObject2(value) {
1407
+ var type = typeof value;
1408
+ return value != null && (type == "object" || type == "function");
1409
+ }
1410
+ function isObjectLike(value) {
1411
+ return value != null && typeof value == "object";
1412
+ }
1413
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1414
+ function keys(object) {
1415
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1416
+ }
1417
+ function stubArray() {
1418
+ return [];
1419
+ }
1420
+ function stubFalse() {
1421
+ return false;
1422
+ }
1423
+ module.exports = isEqual2;
1424
+ }
1425
+ });
1426
+
1427
+ // src/HelperFns/objectHelpers.ts
1428
+ var nameValueObject = (name, value) => {
1429
+ return {
1430
+ name,
1431
+ value
1432
+ };
1433
+ };
1434
+ var getKeyByValue = (object, value) => {
1435
+ return Object.keys(object).find((key) => object[key] === value);
1436
+ };
1437
+
1438
+ // src/HelperFns/columnHelpers.ts
1439
+ var isColumnNumberType = (col) => {
1440
+ const type = col == null ? void 0 : col.type;
1441
+ return type === "DOLLAR_AMT" || type === "QUANTITY" || type === "PERCENT" || type === "RATIO";
1442
+ };
1443
+ var isColumnStringType = (col) => {
1444
+ const type = col == null ? void 0 : col.type;
1445
+ return type === "STRING" || type === "DATE_STRING" || type === "DATE" || type === "UNKNOWN";
1446
+ };
1447
+ var isColumnDateType = (col) => {
1448
+ try {
1449
+ const isDateType = col.type === "DATE" || col.type === "DATE_STRING";
1450
+ return isDateType;
1451
+ } catch (error) {
1452
+ return false;
1453
+ }
1454
+ };
1455
+ var hasNumberColumn = (columns) => {
1456
+ var _a;
1457
+ const hasNumberColumn2 = !!((_a = columns.filter((col) => isColumnNumberType(col))) == null ? void 0 : _a.length);
1458
+ return hasNumberColumn2;
1459
+ };
1460
+ var hasStringColumn = (columns) => {
1461
+ var _a;
1462
+ const hasStringColumn2 = !!((_a = columns.filter((col) => isColumnStringType(col))) == null ? void 0 : _a.length);
1463
+ return hasStringColumn2;
1464
+ };
1465
+ var hasDateColumn = (columns) => {
1466
+ var _a;
1467
+ const hasDateColumn2 = !!((_a = columns.filter((col) => isColumnDateType(col))) == null ? void 0 : _a.length);
1468
+ return hasDateColumn2;
1469
+ };
1470
+ var getVisibleColumns = (columns) => {
1471
+ return columns == null ? void 0 : columns.filter((col) => col == null ? void 0 : col.is_visible);
1472
+ };
1473
+ var getGroupableColumns = (columns) => {
1474
+ const groupableColumns = [];
1475
+ if (columns) {
1476
+ columns.forEach((col, index) => {
1477
+ if (col.groupable) {
1478
+ groupableColumns.push(index);
1479
+ }
1480
+ });
1481
+ }
1482
+ return groupableColumns;
1483
+ };
1484
+ var getGroupBys = (row, columns) => {
1485
+ if (!(columns == null ? void 0 : columns.length)) {
1486
+ return void 0;
1487
+ }
1488
+ const groupableColumns = getGroupableColumns(columns);
1489
+ const numGroupables = groupableColumns.length;
1490
+ if (!numGroupables) {
1491
+ return { groupBys: void 0, supportedByAPI: false };
1492
+ }
1493
+ const groupBys = [];
1494
+ groupableColumns.forEach((colIndex) => {
1495
+ const groupByName = columns[colIndex].name;
1496
+ const groupByValue = `${row[colIndex]}`;
1497
+ groupBys.push(nameValueObject(groupByName, groupByValue));
1498
+ });
1499
+ return { groupBys, supportedByAPI: true };
1500
+ };
1501
+ var getGroupBysFromTable = (cell, tableColumns) => {
1502
+ if (!cell || !tableColumns) {
1503
+ return void 0;
1504
+ }
1505
+ const groupableColumns = getGroupableColumns(tableColumns);
1506
+ const numGroupables = groupableColumns.length;
1507
+ if (!numGroupables) {
1508
+ return void 0;
1509
+ }
1510
+ const rowData = cell.getData();
1511
+ const groupByArray = [];
1512
+ groupableColumns.forEach((colIndex) => {
1513
+ const groupByName = tableColumns[colIndex].name;
1514
+ const groupByValue = `${rowData[colIndex]}`;
1515
+ groupByArray.push(nameValueObject(groupByName, groupByValue));
1516
+ });
1517
+ return groupByArray;
1518
+ };
1519
+ var getGroupBysFromPivotTable = ({
1520
+ cell,
1521
+ rowHeaders,
1522
+ columnHeaders,
1523
+ rowHeaderDefinition,
1524
+ columnHeaderDefinition
1525
+ }) => {
1526
+ var _a;
1527
+ try {
1528
+ const columnName = columnHeaderDefinition.name;
1529
+ const columnField = Number(cell.getField()) - 1;
1530
+ const columnValue = getKeyByValue(columnHeaders, columnField);
1531
+ const rowName = rowHeaderDefinition.name;
1532
+ const rowIndex = ((_a = cell == null ? void 0 : cell.getRow()) == null ? void 0 : _a.getPosition()) - 1;
1533
+ const rowValue = getKeyByValue(rowHeaders, rowIndex);
1534
+ if (columnName && rowName && columnValue !== void 0 && rowValue !== void 0) {
1535
+ return [
1536
+ {
1537
+ name: columnName,
1538
+ value: `${columnValue}`
1539
+ },
1540
+ {
1541
+ name: rowName,
1542
+ value: `${rowValue}`
1543
+ }
1544
+ ];
1545
+ }
1546
+ } catch (error) {
1547
+ console.error(error);
1548
+ }
1549
+ return void 0;
1550
+ };
1551
+ var isAggregation = (columns) => {
1552
+ try {
1553
+ let isAgg = false;
1554
+ if (columns) {
1555
+ isAgg = !!columns.find((col) => col.groupable);
1556
+ }
1557
+ return isAgg;
1558
+ } catch (error) {
1559
+ console.error(error);
1560
+ return false;
1561
+ }
1562
+ };
1563
+ var getColumnTypeAmounts = (columns) => {
1564
+ let amountOfStringColumns = 0;
1565
+ let amountOfNumberColumns = 0;
1566
+ columns.forEach((col) => {
1567
+ if (isColumnNumberType(col) && col.is_visible) {
1568
+ amountOfNumberColumns += 1;
1569
+ } else if (isColumnStringType(col) && col.is_visible) {
1570
+ amountOfStringColumns += 1;
1571
+ }
1572
+ });
1573
+ return { amountOfNumberColumns, amountOfStringColumns };
1574
+ };
1575
+ var getDateColumnIndex = (columns) => {
1576
+ return columns.findIndex((col) => col.is_visible && (col.type === "DATE" || col.type === "DATE_STRING"));
1577
+ };
1578
+ var getNumberOfGroupables = (columns) => {
1579
+ let numberOfGroupables = 0;
1580
+ if (columns) {
1581
+ columns.forEach((col) => {
1582
+ if (col.groupable) {
1583
+ numberOfGroupables += 1;
1584
+ }
1585
+ });
1586
+ }
1587
+ return numberOfGroupables;
1588
+ };
1589
+ var isListQuery = (columns) => {
1590
+ return getNumberOfGroupables(columns) === 0;
1591
+ };
1592
+
1593
+ // src/dayjsWithPlugins.ts
1594
+ var import_dayjs = __toESM(require_dayjs_min());
1595
+ var import_advancedFormat = __toESM(require_advancedFormat());
1596
+ var import_localizedFormat = __toESM(require_localizedFormat());
1597
+ var import_utc = __toESM(require_utc());
1598
+ var import_timezone = __toESM(require_timezone());
1599
+ var import_isBetween = __toESM(require_isBetween());
1600
+ var import_weekOfYear = __toESM(require_weekOfYear());
1601
+ var import_quarterOfYear = __toESM(require_quarterOfYear());
1602
+ var import_customParseFormat = __toESM(require_customParseFormat());
1603
+ var import_isSameOrBefore = __toESM(require_isSameOrBefore());
1604
+ var import_isToday = __toESM(require_isToday());
1605
+ import_dayjs.default.extend(import_utc.default);
1606
+ import_dayjs.default.extend(import_isToday.default);
1607
+ import_dayjs.default.extend(import_timezone.default);
1608
+ import_dayjs.default.extend(import_isBetween.default);
1609
+ import_dayjs.default.extend(import_weekOfYear.default);
1610
+ import_dayjs.default.extend(import_quarterOfYear.default);
1611
+ import_dayjs.default.extend(import_advancedFormat.default);
1612
+ import_dayjs.default.extend(import_isSameOrBefore.default);
1613
+ import_dayjs.default.extend(import_localizedFormat.default);
1614
+ import_dayjs.default.extend(import_customParseFormat.default);
1615
+ (function applyLocale() {
1616
+ const specificLanguageCode = window.navigator.language || "en";
1617
+ const genericLanguageCode = specificLanguageCode.split("-")[0];
1618
+ try {
1619
+ __require(`dayjs/locale/${specificLanguageCode}.js`);
1620
+ import_dayjs.default.locale(specificLanguageCode);
1621
+ } catch (error) {
1622
+ try {
1623
+ __require(`dayjs/locale/${genericLanguageCode}.js`);
1624
+ import_dayjs.default.locale(genericLanguageCode);
1625
+ } catch (error2) {
1626
+ }
1627
+ }
1628
+ })();
1629
+ var dayjsWithPlugins_default = import_dayjs.default;
1630
+
1631
+ // src/HelperFns/stringHelpers.ts
1632
+ var capitalizeFirstChar = (string) => {
1633
+ let capitalized = string;
1634
+ try {
1635
+ capitalized = string.charAt(0).toUpperCase() + string.slice(1);
1636
+ } catch (error) {
1637
+ console.error(error);
1638
+ }
1639
+ return capitalized;
1640
+ };
1641
+ var isNumber = (str) => {
1642
+ return /^\d+$/.test(str);
1643
+ };
1644
+
1645
+ // src/Constants/constants.ts
1646
+ var TABLE_TYPES = [
1647
+ "pivot_table",
1648
+ "pivot_column",
1649
+ "date_pivot",
1650
+ "table",
1651
+ "compare_table",
1652
+ "compare_table_budget"
1653
+ ];
1654
+ var CHART_TYPES = [
1655
+ "bar",
1656
+ "bubble",
1657
+ "chart",
1658
+ "column",
1659
+ "heatmap",
1660
+ "line",
1661
+ "pie",
1662
+ "stacked_bar",
1663
+ "stacked_column",
1664
+ "stacked_line",
1665
+ "column_line",
1666
+ "histogram",
1667
+ "scatterplot"
1668
+ ];
1669
+ var DATE_ONLY_CHART_TYPES = ["line", "stacked_line"];
1670
+ var DOUBLE_AXIS_CHART_TYPES = ["column_line"];
1671
+ var MONTH_NAMES = [
1672
+ "January",
1673
+ "February",
1674
+ "March",
1675
+ "April",
1676
+ "May",
1677
+ "June",
1678
+ "July",
1679
+ "August",
1680
+ "September",
1681
+ "October",
1682
+ "November",
1683
+ "December"
1684
+ ];
1685
+ var DEFAULT_DATA_PAGE_SIZE = 500;
1686
+ var MAX_DATA_PAGE_SIZE = 5e3;
1687
+ var WEEKDAY_NAMES_MON = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
1688
+ var WEEKDAY_NAMES_SUN = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
1689
+ var DOW_STYLES = ["NUM_1_MON", "NUM_1_SUN", "NUM_0_MON", "NUM_0_SUN", "ALPHA_MON", "ALPHA_SUN"];
1690
+ var SEASON_NAMES = ["SP", "SU", "FA", "HO"];
1691
+ var DAYJS_PRECISION_FORMATS = {
1692
+ DAY: "ll",
1693
+ MONTH: "MMMM YYYY",
1694
+ YEAR: "YYYY",
1695
+ DATE_HOUR: "ll h:00A",
1696
+ DATE_MINUTE: "ll h:mmA"
1697
+ };
1698
+ var DEFAULT_AGG_TYPE = "sum";
1699
+ var AGG_TYPES = [
1700
+ {
1701
+ displayName: "Sum",
1702
+ value: "sum",
1703
+ unit: "inherit",
1704
+ tooltip: "<strong>Sum:</strong> Values that have the same chart axis label will be added up."
1705
+ },
1706
+ {
1707
+ displayName: "Avg",
1708
+ value: "avg",
1709
+ unit: "inherit",
1710
+ tooltip: "<strong>Average:</strong> Values that have the same chart axis label will be averaged."
1711
+ },
1712
+ // {
1713
+ // displayName: 'Median',
1714
+ // value: 'median',
1715
+ // unit: 'inherit',
1716
+ // tooltip: 'The median (middle) value will be shown for all data points with same label.',
1717
+ // },
1718
+ // {
1719
+ // displayName: 'Minimum',
1720
+ // value: 'min',
1721
+ // unit: 'inherit',
1722
+ // tooltip: 'The smallest value will be shown for all data points with same label.',
1723
+ // },
1724
+ // {
1725
+ // displayName: 'Maximum',
1726
+ // value: 'max',
1727
+ // unit: 'inherit',
1728
+ // tooltip: 'The largest value will be shown for all data points with same label.',
1729
+ // },
1730
+ // {
1731
+ // displayName: 'Standard deviation',
1732
+ // value: 'deviation',
1733
+ // unit: 'none',
1734
+ // tooltip: 'The standard deviation will be shown for all data points with the same label.',
1735
+ // },
1736
+ // {
1737
+ // displayName: 'Variance',
1738
+ // value: 'variance',
1739
+ // unit: 'none',
1740
+ // tooltip: 'The variance will be shown for all data points with the same label.',
1741
+ // },
1742
+ {
1743
+ displayName: "Count",
1744
+ value: "count",
1745
+ unit: "none",
1746
+ tooltip: "<strong>Count:</strong> The total number of non-blank values will be shown for all data points with the same label."
1747
+ }
1748
+ // {
1749
+ // displayName: 'Distinct Count',
1750
+ // value: 'count-distinct',
1751
+ // unit: 'none',
1752
+ // },
1753
+ ];
1754
+ var MAX_LEGEND_LABELS = 22;
1755
+ var MIN_HISTOGRAM_SAMPLE = 20;
1756
+
1757
+ // src/Constants/enums.ts
1758
+ var TimestampFormats = /* @__PURE__ */ ((TimestampFormats2) => {
1759
+ TimestampFormats2["epoch"] = "EPOCH";
1760
+ TimestampFormats2["iso8601"] = "ISO8601";
1761
+ return TimestampFormats2;
1762
+ })(TimestampFormats || {});
1763
+ var PrecisionTypes = /* @__PURE__ */ ((PrecisionTypes2) => {
1764
+ PrecisionTypes2["DAY"] = "DAY";
1765
+ PrecisionTypes2["MONTH"] = "MONTH";
1766
+ PrecisionTypes2["YEAR"] = "YEAR";
1767
+ PrecisionTypes2["WEEK"] = "WEEK";
1768
+ PrecisionTypes2["QUARTER"] = "QUARTER";
1769
+ PrecisionTypes2["DATE_HOUR"] = "DATE_HOUR";
1770
+ PrecisionTypes2["DATE_MINUTE"] = "DATE_MINUTE";
1771
+ PrecisionTypes2["HOUR"] = "HOUR";
1772
+ PrecisionTypes2["MINUTE"] = "MINUTE";
1773
+ return PrecisionTypes2;
1774
+ })(PrecisionTypes || {});
1775
+ var NumberColumnTypes = /* @__PURE__ */ ((NumberColumnTypes2) => {
1776
+ NumberColumnTypes2["CURRENCY"] = "DOLLAR_AMT";
1777
+ NumberColumnTypes2["QUANTITY"] = "QUANTITY";
1778
+ NumberColumnTypes2["RATIO"] = "RATIO";
1779
+ NumberColumnTypes2["PERCENT"] = "PERCENT";
1780
+ return NumberColumnTypes2;
1781
+ })(NumberColumnTypes || {});
1782
+ var NumberColumnTypeDisplayNames = /* @__PURE__ */ ((NumberColumnTypeDisplayNames2) => {
1783
+ NumberColumnTypeDisplayNames2["DOLLAR_AMT"] = "Currency";
1784
+ NumberColumnTypeDisplayNames2["QUANTITY"] = "Quantity";
1785
+ NumberColumnTypeDisplayNames2["RATIO"] = "Ratio";
1786
+ NumberColumnTypeDisplayNames2["PERCENT"] = "Percent";
1787
+ return NumberColumnTypeDisplayNames2;
1788
+ })(NumberColumnTypeDisplayNames || {});
1789
+
1790
+ // src/Constants/defaults.ts
1791
+ var authenticationDefault = {
1792
+ token: void 0,
1793
+ apiKey: void 0,
1794
+ domain: void 0,
1795
+ dprKey: void 0,
1796
+ dprDomain: void 0
1797
+ };
1798
+ var dataFormattingDefault = {
1799
+ timestampFormat: "ISO8601" /* iso8601 */,
1800
+ currencyCode: "USD",
1801
+ languageCode: "en-US",
1802
+ currencyDecimals: 2,
1803
+ quantityDecimals: 2,
1804
+ ratioDecimals: 4,
1805
+ comparisonDisplay: "PERCENT",
1806
+ monthYearFormat: "MMMM YYYY",
1807
+ dayMonthYearFormat: "ll"
1808
+ };
1809
+ var autoQLConfigDefault = {
1810
+ debug: false,
1811
+ test: false,
1812
+ enableAutocomplete: true,
1813
+ enableQueryInterpretation: true,
1814
+ enableQueryValidation: true,
1815
+ enableQuerySuggestions: true,
1816
+ enableColumnVisibilityManager: true,
1817
+ enableDrilldowns: true,
1818
+ enableNotifications: false,
1819
+ enableCSVDownload: true,
1820
+ enableReportProblem: true
1821
+ };
1822
+ var dataConfigDefault = {
1823
+ stringColumnIndices: [],
1824
+ numberColumnIndices: [],
1825
+ stringColumnIndex: 0,
1826
+ legendColumnIndex: void 0,
1827
+ numberColumnIndex: 1
1828
+ };
1829
+ var getAuthentication = (prop = {}) => {
1830
+ return {
1831
+ ...authenticationDefault,
1832
+ ...prop
1833
+ };
1834
+ };
1835
+ var getDataFormatting = (prop = {}) => {
1836
+ return {
1837
+ ...dataFormattingDefault,
1838
+ ...prop
1839
+ };
1840
+ };
1841
+ var getAutoQLConfig = (prop = {}) => {
1842
+ return {
1843
+ ...autoQLConfigDefault,
1844
+ ...prop
1845
+ };
1846
+ };
1847
+ var getDataConfig = (prop = {}) => {
1848
+ return {
1849
+ ...dataConfigDefault,
1850
+ ...prop
1851
+ };
1852
+ };
1853
+
1854
+ // src/HelperFns/dataFormattingHelpers.ts
1855
+ var formatStringDateWithPrecision = (value, col) => {
1856
+ if (!value) {
1857
+ return void 0;
1858
+ }
1859
+ let formattedValue = value;
1860
+ try {
1861
+ switch (col.precision) {
1862
+ case "DOW": {
1863
+ formattedValue = formatDOW(value, col);
1864
+ break;
1865
+ }
1866
+ case "HOUR": {
1867
+ const dayjsTime = dayjsWithPlugins_default.utc(value, "THH:mm:ss.SSSZ").utc();
1868
+ if (dayjsTime.isValid()) {
1869
+ formattedValue = dayjsTime.format("h:00A");
1870
+ }
1871
+ break;
1872
+ }
1873
+ case "MINUTE": {
1874
+ const dayjsTime = dayjsWithPlugins_default.utc(value, "THH:mm:ss.SSSZ").utc();
1875
+ if (dayjsTime.isValid()) {
1876
+ formattedValue = dayjsTime.format("h:mmA");
1877
+ }
1878
+ break;
1879
+ }
1880
+ case "MONTH": {
1881
+ formattedValue = value;
1882
+ break;
1883
+ }
1884
+ default: {
1885
+ formattedValue = value;
1886
+ break;
1887
+ }
1888
+ }
1889
+ return formattedValue;
1890
+ } catch (error) {
1891
+ console.error(error);
1892
+ return value;
1893
+ }
1894
+ };
1895
+ var formatStringDate = (value, config = dataFormattingDefault) => {
1896
+ var _a;
1897
+ if (!value) {
1898
+ return void 0;
1899
+ }
1900
+ if (value && typeof value === "string") {
1901
+ const dateArray = value.split("-");
1902
+ const year = dateArray == null ? void 0 : dateArray[0];
1903
+ const day = dateArray == null ? void 0 : dateArray[2];
1904
+ let month;
1905
+ let week;
1906
+ if ((_a = dateArray == null ? void 0 : dateArray[1]) == null ? void 0 : _a.includes("W")) {
1907
+ week = dateArray == null ? void 0 : dateArray[1];
1908
+ } else {
1909
+ month = dateArray == null ? void 0 : dateArray[1];
1910
+ }
1911
+ const { monthYearFormat, dayMonthYearFormat } = getDataFormatting(config);
1912
+ const dayJSObj = dayjsWithPlugins_default.utc(value).utc();
1913
+ if (!dayJSObj.isValid()) {
1914
+ return value;
1915
+ }
1916
+ let date = value;
1917
+ if (day) {
1918
+ date = dayJSObj.format(dayMonthYearFormat);
1919
+ } else if (month) {
1920
+ date = dayJSObj.format(monthYearFormat);
1921
+ } else if (week) {
1922
+ } else if (year) {
1923
+ date = year;
1924
+ }
1925
+ return date;
1926
+ }
1927
+ return value;
1928
+ };
1929
+ var formatDateType = (element, column, config = dataFormattingDefault) => {
1930
+ if (isNumber(element)) {
1931
+ return formatEpochDate(element, column, config);
1932
+ }
1933
+ return formatISODateWithPrecision(element, column, config);
1934
+ };
1935
+ var formatDateStringType = (element, column, config = dataFormattingDefault) => {
1936
+ if (!column) {
1937
+ return element;
1938
+ }
1939
+ if (column.precision) {
1940
+ return formatStringDateWithPrecision(element, column);
1941
+ }
1942
+ return formatStringDate(element, config);
1943
+ };
1944
+ var formatISODateWithPrecision = (value, col, config = dataFormattingDefault) => {
1945
+ if (!value) {
1946
+ return void 0;
1947
+ }
1948
+ if (!col) {
1949
+ return value;
1950
+ }
1951
+ const precision = col.precision;
1952
+ const { dayMonthYearFormat, monthYearFormat } = getDataFormatting(config);
1953
+ const dateDayJS = dayjsWithPlugins_default.utc(value).utc();
1954
+ if (!dateDayJS.isValid()) {
1955
+ return value;
1956
+ }
1957
+ let date = dateDayJS.format(dayMonthYearFormat);
1958
+ try {
1959
+ switch (precision) {
1960
+ case "DAY" /* DAY */: {
1961
+ break;
1962
+ }
1963
+ case "WEEK" /* WEEK */: {
1964
+ const dateJSStart = dateDayJS.startOf("week").format("MMM D");
1965
+ const dateJSEnd = dateDayJS.endOf("week").format("MMM D");
1966
+ const week = dateDayJS.week();
1967
+ const year = dateDayJS.format("YYYY");
1968
+ date = `${dateJSStart} - ${dateJSEnd}, ${year} (Week ${week})`;
1969
+ break;
1970
+ }
1971
+ case "MONTH" /* MONTH */: {
1972
+ date = dateDayJS.format(monthYearFormat);
1973
+ break;
1974
+ }
1975
+ case "QUARTER" /* QUARTER */: {
1976
+ const quarter = dateDayJS.quarter();
1977
+ const year = dateDayJS.format("YYYY");
1978
+ date = `${year}-Q${quarter}`;
1979
+ break;
1980
+ }
1981
+ case "YEAR" /* YEAR */: {
1982
+ date = dateDayJS.format("YYYY");
1983
+ break;
1984
+ }
1985
+ case "DATE_HOUR" /* DATE_HOUR */: {
1986
+ date = dateDayJS.format(`${dayMonthYearFormat} h:00A`);
1987
+ break;
1988
+ }
1989
+ case "DATE_MINUTE" /* DATE_MINUTE */: {
1990
+ date = dateDayJS.format(`${dayMonthYearFormat} h:mmA`);
1991
+ break;
1992
+ }
1993
+ default: {
1994
+ break;
1995
+ }
1996
+ }
1997
+ return date;
1998
+ } catch (error) {
1999
+ console.error(error);
2000
+ }
2001
+ };
2002
+ var formatEpochDate = (value, col, config = dataFormattingDefault) => {
2003
+ if (!value) {
2004
+ return void 0;
2005
+ }
2006
+ if (!col) {
2007
+ return value;
2008
+ }
2009
+ try {
2010
+ const { monthYearFormat, dayMonthYearFormat } = getDataFormatting(config);
2011
+ const year = "YYYY";
2012
+ const monthYear = monthYearFormat;
2013
+ const dayMonthYear = dayMonthYearFormat;
2014
+ const title = col.title;
2015
+ let dayJSObj;
2016
+ if (isNaN(parseFloat(value))) {
2017
+ dayJSObj = dayjsWithPlugins_default.utc(value).utc();
2018
+ } else {
2019
+ dayJSObj = dayjsWithPlugins_default.unix(value).utc();
2020
+ }
2021
+ if (!dayJSObj.isValid()) {
2022
+ return value;
2023
+ }
2024
+ let date = dayJSObj.format(dayMonthYear);
2025
+ if (isNaN(parseFloat(value))) {
2026
+ if (title && title.toLowerCase().includes("year")) {
2027
+ date = dayJSObj.format(year);
2028
+ } else if (title && title.toLowerCase().includes("month")) {
2029
+ date = dayJSObj.format(monthYear);
2030
+ }
2031
+ date = dayJSObj.format(dayMonthYear);
2032
+ } else if (title && title.toLowerCase().includes("year")) {
2033
+ date = dayJSObj.format(year);
2034
+ } else if (title && title.toLowerCase().includes("month")) {
2035
+ date = dayJSObj.format(monthYear);
2036
+ }
2037
+ return date;
2038
+ } catch (error) {
2039
+ console.error(error);
2040
+ return value;
2041
+ }
2042
+ };
2043
+ var formatDOW = (value, col) => {
2044
+ let dowStyle = col.dow_style;
2045
+ if (!dowStyle) {
2046
+ dowStyle = "NUM_1_MON";
2047
+ }
2048
+ let formattedValue = value;
2049
+ let weekdayNumber = Number(value);
2050
+ switch (dowStyle) {
2051
+ case "NUM_1_MON": {
2052
+ const weekdays = WEEKDAY_NAMES_MON;
2053
+ const index = weekdayNumber - 1;
2054
+ if (index >= 0) {
2055
+ formattedValue = weekdays[index];
2056
+ } else {
2057
+ console.warn(`dow style is NUM_1_MON but the value could not be converted to a number: ${value}`);
2058
+ }
2059
+ break;
2060
+ }
2061
+ case "NUM_1_SUN": {
2062
+ const weekdays = WEEKDAY_NAMES_SUN;
2063
+ const index = weekdayNumber - 1;
2064
+ if (index >= 0) {
2065
+ formattedValue = weekdays[index];
2066
+ } else {
2067
+ console.warn(`dow style is NUM_1_SUN but the value could not be converted to a number: ${value}`);
2068
+ }
2069
+ break;
2070
+ }
2071
+ case "NUM_0_MON": {
2072
+ const weekdays = WEEKDAY_NAMES_MON;
2073
+ if (weekdayNumber >= 0) {
2074
+ formattedValue = weekdays[weekdayNumber];
2075
+ } else {
2076
+ console.warn(`dow style is NUM_0_MON but the value could not be converted to a number: ${value}`);
2077
+ }
2078
+ break;
2079
+ }
2080
+ case "NUM_0_SUN": {
2081
+ const weekdays = WEEKDAY_NAMES_SUN;
2082
+ if (weekdayNumber >= 0) {
2083
+ formattedValue = weekdays[weekdayNumber];
2084
+ } else {
2085
+ console.warn(`dow style is NUM_0_SUN but the value could not be converted to a number: ${value}`);
2086
+ }
2087
+ break;
2088
+ }
2089
+ case "ALPHA_MON":
2090
+ case "ALPHA_SUN": {
2091
+ const weekday = WEEKDAY_NAMES_MON.find((weekday2) => weekday2.toLowerCase().includes(value.trim().toLowerCase()));
2092
+ if (weekday) {
2093
+ formattedValue = weekday;
2094
+ } else {
2095
+ console.warn(`dow style is ALPHA but the value could not be matched to a weekday name: ${value}`);
2096
+ }
2097
+ break;
2098
+ }
2099
+ default: {
2100
+ console.warn(`could not format dow value. dow_style was not recognized: ${col.dow_style}`);
2101
+ break;
2102
+ }
2103
+ }
2104
+ return formattedValue;
2105
+ };
2106
+ var dateStringSortFnWithoutPrecision = (a, b) => {
2107
+ if (a.includes("-W")) {
2108
+ const aDateYear = a.substring(0, 4);
2109
+ const bDateYear = b.substring(0, 4);
2110
+ if (aDateYear !== bDateYear) {
2111
+ return aDateYear - bDateYear;
2112
+ } else {
2113
+ const aDateWeek = a.substring(6, 8);
2114
+ const bDateWeek = b.substring(6, 8);
2115
+ return aDateWeek - bDateWeek;
2116
+ }
2117
+ } else if (WEEKDAY_NAMES_MON.includes(a.trim())) {
2118
+ const aDayIndex = WEEKDAY_NAMES_MON.findIndex((d) => d.toLowerCase().includes(a.trim().toLowerCase()));
2119
+ const bDayIndex = WEEKDAY_NAMES_MON.findIndex((d) => d.toLowerCase().includes(b.trim().toLowerCase()));
2120
+ let sortValue = a - b;
2121
+ if (aDayIndex >= 0 && bDayIndex >= 0) {
2122
+ sortValue = aDayIndex - bDayIndex;
2123
+ }
2124
+ return sortValue;
2125
+ } else if (MONTH_NAMES.includes(a.trim())) {
2126
+ const aMonthIndex = MONTH_NAMES.findIndex((m) => m === a.trim());
2127
+ const bMonthIndex = MONTH_NAMES.findIndex((m) => m === b.trim());
2128
+ if (aMonthIndex >= 0 && bMonthIndex >= 0) {
2129
+ return bMonthIndex - aMonthIndex;
2130
+ }
2131
+ return a - b;
2132
+ } else if (SEASON_NAMES.includes(a.substr(0, 2))) {
2133
+ const aSeasonIndex = SEASON_NAMES.findIndex((s) => s === a.substr(0, 2));
2134
+ const bSeasonIndex = SEASON_NAMES.findIndex((s) => s === b.substr(0, 2));
2135
+ const aYear = Number(a.substr(2));
2136
+ const bYear = Number(b.substr(2));
2137
+ if (aYear === bYear) {
2138
+ return aSeasonIndex - bSeasonIndex;
2139
+ }
2140
+ return aYear - bYear;
2141
+ }
2142
+ return a - b;
2143
+ };
2144
+ var dateStringSortFn = (a, b, col) => {
2145
+ if (typeof a !== "string" || typeof b !== "string" || !col) {
2146
+ return a - b;
2147
+ }
2148
+ const aTrimmed = a.trim();
2149
+ const bTrimmed = b.trim();
2150
+ switch (col.precision) {
2151
+ case "DOW": {
2152
+ const dowStyle = col.dow_style ?? "ALPHA_MON";
2153
+ let aIndex = WEEKDAY_NAMES_MON.findIndex((dow) => dow.toLowerCase().includes(aTrimmed.toLowerCase()));
2154
+ let bIndex = WEEKDAY_NAMES_MON.findIndex((dow) => dow.toLowerCase().includes(bTrimmed.toLowerCase()));
2155
+ if (dowStyle === "ALPHA_SUN") {
2156
+ aIndex = WEEKDAY_NAMES_SUN.findIndex((dow) => dow.toLowerCase().includes(aTrimmed.toLowerCase()));
2157
+ bIndex = WEEKDAY_NAMES_SUN.findIndex((dow) => dow.toLowerCase().includes(bTrimmed.toLowerCase()));
2158
+ }
2159
+ return aIndex - bIndex;
2160
+ }
2161
+ case "HOUR":
2162
+ case "MINUTE": {
2163
+ const aDayjsTime = dayjsWithPlugins_default.utc(aTrimmed, "THH:mm:ss.SSSZ").utc();
2164
+ const bDayjsTime = dayjsWithPlugins_default.utc(bTrimmed, "THH:mm:ss.SSSZ").utc();
2165
+ return aDayjsTime.unix() - bDayjsTime.unix();
2166
+ }
2167
+ case "MONTH": {
2168
+ MONTH_NAMES;
2169
+ const aMonthIndex = MONTH_NAMES.findIndex((m) => m.toLowerCase() === aTrimmed.toLowerCase());
2170
+ const bMonthIndex = MONTH_NAMES.findIndex((m) => m.toLowerCase() === bTrimmed.toLowerCase());
2171
+ return aMonthIndex - bMonthIndex;
2172
+ }
2173
+ default: {
2174
+ return dateStringSortFnWithoutPrecision(aTrimmed, bTrimmed);
2175
+ }
2176
+ }
2177
+ };
2178
+ var dateSortFn = (a, b, col, isTable) => {
2179
+ try {
2180
+ if (!a && !b) {
2181
+ return 0;
2182
+ } else if (!a && b) {
2183
+ return 1;
2184
+ } else if (a && !b || !col) {
2185
+ return -1;
2186
+ }
2187
+ let aDate = Number(a);
2188
+ let bDate = Number(b);
2189
+ let sortValue = aDate - bDate;
2190
+ if (isNaN(aDate) || isNaN(bDate)) {
2191
+ if (col.type === "DATE_STRING") {
2192
+ sortValue = dateStringSortFn(a, b, col);
2193
+ } else {
2194
+ sortValue = dayjsWithPlugins_default.utc(a).unix() - dayjsWithPlugins_default.utc(b).unix();
2195
+ }
2196
+ }
2197
+ if (isTable && col.precision === "DOW") {
2198
+ sortValue = -1 * sortValue;
2199
+ }
2200
+ return sortValue;
2201
+ } catch (error) {
2202
+ console.error(error);
2203
+ return -1;
2204
+ }
2205
+ };
2206
+ var sortDataByDate = (data, tableColumns, sortDirection = "desc", isTable) => {
2207
+ try {
2208
+ if (!data || typeof data !== "object") {
2209
+ throw new Error("Could not sort data by date - no data supplied");
2210
+ }
2211
+ const dateColumnIndex = getDateColumnIndex(tableColumns);
2212
+ const dateColumn = tableColumns[dateColumnIndex];
2213
+ if (dateColumnIndex >= 0) {
2214
+ let multiplier = sortDirection === "desc" ? -1 : 1;
2215
+ const sortedData = [...data].sort(
2216
+ (a, b) => multiplier * dateSortFn(a[dateColumnIndex], b[dateColumnIndex], dateColumn, isTable)
2217
+ );
2218
+ return sortedData;
2219
+ }
2220
+ } catch (error) {
2221
+ console.error(error);
2222
+ }
2223
+ return data;
2224
+ };
2225
+ var formatElement = ({
2226
+ element,
2227
+ column,
2228
+ config = dataFormattingDefault,
2229
+ htmlElement,
2230
+ isChart = false
2231
+ }) => {
2232
+ try {
2233
+ let formattedElement = element;
2234
+ const { currencyCode, languageCode, currencyDecimals, quantityDecimals, ratioDecimals } = getDataFormatting(config);
2235
+ let type = column == null ? void 0 : column.type;
2236
+ if (isChart && ["count", "deviation", "variance"].includes(column == null ? void 0 : column.aggType)) {
2237
+ type = "QUANTITY";
2238
+ }
2239
+ if (column) {
2240
+ switch (type) {
2241
+ case "STRING": {
2242
+ break;
2243
+ }
2244
+ case "DOLLAR_AMT": {
2245
+ const elementNumber = parseFloat(`${element}`);
2246
+ if (!isNaN(elementNumber)) {
2247
+ const currency = currencyCode || "USD";
2248
+ const validatedCurrencyDecimals = currencyDecimals || currencyDecimals === 0 ? currencyDecimals : void 0;
2249
+ try {
2250
+ formattedElement = new Intl.NumberFormat(languageCode, {
2251
+ style: "currency",
2252
+ currency: `${currency}`,
2253
+ minimumFractionDigits: validatedCurrencyDecimals,
2254
+ maximumFractionDigits: validatedCurrencyDecimals
2255
+ }).format(elementNumber);
2256
+ } catch (error) {
2257
+ console.error(error);
2258
+ formattedElement = new Intl.NumberFormat(languageCode, {
2259
+ style: "currency",
2260
+ currency: "USD",
2261
+ minimumFractionDigits: validatedCurrencyDecimals,
2262
+ maximumFractionDigits: validatedCurrencyDecimals
2263
+ }).format(elementNumber);
2264
+ }
2265
+ }
2266
+ break;
2267
+ }
2268
+ case "QUANTITY": {
2269
+ const validatedQuantityDecimals = !isNaN(quantityDecimals) ? quantityDecimals : 2;
2270
+ const elementNumber = parseFloat(`${element}`);
2271
+ if (!isNaN(elementNumber)) {
2272
+ const numDecimals = elementNumber % 1 !== 0 ? validatedQuantityDecimals : 0;
2273
+ formattedElement = new Intl.NumberFormat(languageCode, {
2274
+ minimumFractionDigits: numDecimals,
2275
+ maximumFractionDigits: numDecimals
2276
+ }).format(elementNumber);
2277
+ }
2278
+ break;
2279
+ }
2280
+ case "DATE": {
2281
+ formattedElement = formatDateType(element, column, config);
2282
+ break;
2283
+ }
2284
+ case "DATE_STRING": {
2285
+ formattedElement = formatDateStringType(element, column, config);
2286
+ break;
2287
+ }
2288
+ case "RATIO": {
2289
+ const numDecimals = !isNaN(ratioDecimals) ? ratioDecimals : 4;
2290
+ const elementNumber = parseFloat(`${element}`);
2291
+ if (!isNaN(elementNumber)) {
2292
+ formattedElement = new Intl.NumberFormat(languageCode, {
2293
+ minimumFractionDigits: numDecimals,
2294
+ maximumFractionDigits: numDecimals
2295
+ }).format(elementNumber);
2296
+ }
2297
+ break;
2298
+ }
2299
+ case "PERCENT": {
2300
+ const elementNumber = parseFloat(`${element}`);
2301
+ if (!isNaN(elementNumber)) {
2302
+ const p = elementNumber / 100;
2303
+ formattedElement = new Intl.NumberFormat(languageCode, {
2304
+ style: "percent",
2305
+ minimumFractionDigits: 2,
2306
+ maximumFractionDigits: 2
2307
+ }).format(p);
2308
+ if (htmlElement) {
2309
+ if (elementNumber < 0) {
2310
+ htmlElement.classList.add("comparison-value-negative");
2311
+ } else if (elementNumber > 0) {
2312
+ htmlElement.classList.add("comparison-value-positive");
2313
+ }
2314
+ }
2315
+ }
2316
+ break;
2317
+ }
2318
+ default: {
2319
+ break;
2320
+ }
2321
+ }
2322
+ }
2323
+ return formattedElement;
2324
+ } catch (error) {
2325
+ console.error(error);
2326
+ return element;
2327
+ }
2328
+ };
2329
+ var getNumberFormatConfig = (d, scale) => {
2330
+ var _a, _b;
2331
+ let minimumFractionDigits = 0;
2332
+ let maximumFractionDigits = 0;
2333
+ let notation;
2334
+ const domainRange = ((_a = scale == null ? void 0 : scale.domain()) == null ? void 0 : _a[1]) - ((_b = scale == null ? void 0 : scale.domain()) == null ? void 0 : _b[0]);
2335
+ const smallDomain = domainRange && domainRange < 10;
2336
+ const absValue = Math.abs(d);
2337
+ if (smallDomain) {
2338
+ minimumFractionDigits = 2;
2339
+ maximumFractionDigits = 2;
2340
+ } else if (absValue >= 1e3) {
2341
+ notation = "compact";
2342
+ if (absValue > 1e9) {
2343
+ maximumFractionDigits = 3;
2344
+ } else if (absValue > 1e6) {
2345
+ maximumFractionDigits = 2;
2346
+ } else if (absValue > 1e3) {
2347
+ maximumFractionDigits = 1;
2348
+ }
2349
+ }
2350
+ return { minimumFractionDigits, maximumFractionDigits, notation };
2351
+ };
2352
+ var formatChartLabel = ({ d, scale, column, dataFormatting, maxLabelWidth }) => {
2353
+ if (d === null) {
2354
+ return {
2355
+ fullWidthLabel: "Untitled Category",
2356
+ formattedLabel: "Untitled Category"
2357
+ };
2358
+ }
2359
+ const col = column ?? (scale == null ? void 0 : scale.column);
2360
+ if (!col || !col.type) {
2361
+ return {
2362
+ fullWidthLabel: d,
2363
+ formattedLabel: d
2364
+ };
2365
+ }
2366
+ const config = (scale == null ? void 0 : scale.dataFormatting) ?? dataFormatting;
2367
+ const { currencyCode, languageCode } = config;
2368
+ let type = col.type;
2369
+ if ((scale == null ? void 0 : scale.units) === "none") {
2370
+ type = "QUANTITY";
2371
+ }
2372
+ const { minimumFractionDigits, maximumFractionDigits, notation } = getNumberFormatConfig(d, scale);
2373
+ let formattedLabel = d;
2374
+ if (scale == null ? void 0 : scale.showLabelDecimals) {
2375
+ formattedLabel = formatElement({
2376
+ element: d,
2377
+ column: column ?? (scale == null ? void 0 : scale.column),
2378
+ config: dataFormatting,
2379
+ isChart: true
2380
+ });
2381
+ } else {
2382
+ switch (type) {
2383
+ case "STRING": {
2384
+ break;
2385
+ }
2386
+ case "DOLLAR_AMT": {
2387
+ if (Number(d) || Number(d) === 0) {
2388
+ const style = "currency";
2389
+ const currency = currencyCode || "USD";
2390
+ const currencyConfig = {
2391
+ style,
2392
+ minimumFractionDigits,
2393
+ maximumFractionDigits,
2394
+ notation
2395
+ };
2396
+ try {
2397
+ formattedLabel = new Intl.NumberFormat(languageCode, {
2398
+ ...currencyConfig,
2399
+ currency
2400
+ }).format(d);
2401
+ } catch (error) {
2402
+ console.error(error);
2403
+ formattedLabel = new Intl.NumberFormat(languageCode, {
2404
+ ...currencyConfig,
2405
+ currency: "USD"
2406
+ }).format(d);
2407
+ }
2408
+ }
2409
+ break;
2410
+ }
2411
+ case "QUANTITY": {
2412
+ if (!isNaN(parseFloat(d))) {
2413
+ formattedLabel = new Intl.NumberFormat(languageCode, {
2414
+ minimumFractionDigits,
2415
+ maximumFractionDigits,
2416
+ notation
2417
+ }).format(d);
2418
+ }
2419
+ break;
2420
+ }
2421
+ case "DATE": {
2422
+ formattedLabel = formatDateType(d, col, config);
2423
+ break;
2424
+ }
2425
+ case "DATE_STRING": {
2426
+ formattedLabel = formatDateStringType(d, col, config);
2427
+ break;
2428
+ }
2429
+ case "PERCENT": {
2430
+ if (Number(d) || Number(d) === 0) {
2431
+ const p = Number(d) / 100;
2432
+ formattedLabel = new Intl.NumberFormat(languageCode, {
2433
+ style: "percent",
2434
+ minimumFractionDigits: 1,
2435
+ maximumFractionDigits: 1
2436
+ }).format(p);
2437
+ }
2438
+ break;
2439
+ }
2440
+ default: {
2441
+ break;
2442
+ }
2443
+ }
2444
+ }
2445
+ const fullWidthLabel = formattedLabel;
2446
+ if (typeof formattedLabel === "string" && maxLabelWidth && formattedLabel.length > maxLabelWidth) {
2447
+ formattedLabel = `${formattedLabel.substring(0, maxLabelWidth)}...`;
2448
+ }
2449
+ return { fullWidthLabel, formattedLabel };
2450
+ };
2451
+ var getCurrencySymbol = (dataFormatting = dataFormattingDefault) => {
2452
+ var _a;
2453
+ try {
2454
+ const { currencyCode, languageCode } = getDataFormatting(dataFormatting);
2455
+ const formattedParts = new Intl.NumberFormat(languageCode, {
2456
+ style: "currency",
2457
+ currency: currencyCode
2458
+ }).formatToParts(0);
2459
+ const symbol = (_a = formattedParts.find((part) => (part == null ? void 0 : part.type) === "currency")) == null ? void 0 : _a.value;
2460
+ return symbol;
2461
+ } catch (error) {
2462
+ console.error(error);
2463
+ return;
2464
+ }
2465
+ };
2466
+ var getDayjsObjForStringType = (value, col) => {
2467
+ if (!value) {
2468
+ return void 0;
2469
+ }
2470
+ try {
2471
+ switch (col.precision) {
2472
+ case "DOW": {
2473
+ return void 0;
2474
+ }
2475
+ case "HOUR":
2476
+ case "MINUTE": {
2477
+ return dayjsWithPlugins_default.utc(value, "THH:mm:ss.SSSZ").utc();
2478
+ }
2479
+ case "MONTH": {
2480
+ return void 0;
2481
+ }
2482
+ default: {
2483
+ return void 0;
2484
+ }
2485
+ }
2486
+ } catch (error) {
2487
+ console.error(error);
2488
+ return void 0;
2489
+ }
2490
+ };
2491
+ var getDayJSObj = ({ value, column }) => {
2492
+ if (column.type === "DATE_STRING") {
2493
+ return getDayjsObjForStringType(value, column);
2494
+ }
2495
+ if (isNumber(value)) {
2496
+ return dayjsWithPlugins_default.unix(value).utc();
2497
+ }
2498
+ return dayjsWithPlugins_default.utc(value).utc();
2499
+ };
2500
+ var getEpochFromDate = (date, precision, precisionFrame) => {
2501
+ if (date == null ? void 0 : date.getTime) {
2502
+ if (precision && precisionFrame === "start") {
2503
+ return dayjsWithPlugins_default(date).utc().startOf(precision).valueOf();
2504
+ } else if (precision && precisionFrame === "end") {
2505
+ return dayjsWithPlugins_default(date).utc().endOf(precision).valueOf();
2506
+ }
2507
+ return date.getTime();
2508
+ }
2509
+ return;
2510
+ };
2511
+
2512
+ // src/HelperFns/arrayHelpers.ts
2513
+ var import_lodash = __toESM(require_lodash());
2514
+ var invertArray = (array) => {
2515
+ const numRows = array.length;
2516
+ const numColumns = array[0].length;
2517
+ const invertedArray = [];
2518
+ for (let i = 0; i < numColumns; i++) {
2519
+ invertedArray[i] = [];
2520
+ for (let j = 0; j < numRows; j++) {
2521
+ if (array[j][i])
2522
+ invertedArray[i][j] = array[j][i];
2523
+ }
2524
+ }
2525
+ return invertedArray;
2526
+ };
2527
+ var functionsEqual = (a, b) => {
2528
+ return (a == null ? void 0 : a.toString()) == (b == null ? void 0 : b.toString());
2529
+ };
2530
+ var isObject = (obj) => {
2531
+ return typeof obj === "object" && !Array.isArray(obj) && obj !== null && obj !== void 0;
2532
+ };
2533
+ var deepEqual = (objA, objB) => {
2534
+ const lodashIsEqual = (0, import_lodash.default)(objA, objB);
2535
+ if (lodashIsEqual) {
2536
+ return true;
2537
+ }
2538
+ const objAIsObject = isObject(objA);
2539
+ const objBIsObject = isObject(objB);
2540
+ if (!objAIsObject || !objBIsObject) {
2541
+ return lodashIsEqual;
2542
+ }
2543
+ const keysA = Object.keys(objA);
2544
+ const keysB = Object.keys(objB);
2545
+ if (keysA.length !== keysB.length) {
2546
+ return false;
2547
+ }
2548
+ for (let i = 0; i < keysA.length; i++) {
2549
+ if (typeof objA[keysA[i]] === "function" && typeof objB[keysA[i]] === "function") {
2550
+ if (!functionsEqual(objA[keysA[i]], objB[keysA[i]])) {
2551
+ return false;
2552
+ }
2553
+ } else if (!Object.hasOwnProperty.call(objB, keysA[i]) || !(0, import_lodash.default)(objA[keysA[i]], objB[keysA[i]])) {
2554
+ return false;
2555
+ }
2556
+ }
2557
+ return true;
2558
+ };
2559
+ var difference = (objA, objB) => {
2560
+ const diff = [];
2561
+ Object.keys(Object.assign({}, objA, objB)).forEach((key) => {
2562
+ if (typeof objA[key] === "function" && typeof objB[key] === "function") {
2563
+ if (!functionsEqual(objA[key], objB[key])) {
2564
+ diff.push({
2565
+ key,
2566
+ objA: objA[key],
2567
+ objB: objB[key]
2568
+ });
2569
+ }
2570
+ } else if (!Object.is(objA[key], objB[key])) {
2571
+ diff.push({
2572
+ key,
2573
+ objA: objA[key],
2574
+ objB: objB[key]
2575
+ });
2576
+ }
2577
+ });
2578
+ return diff;
2579
+ };
2580
+ var rotateArray = (array, n) => {
2581
+ const rotated = [...array];
2582
+ n = n % array.length;
2583
+ if (n < 0)
2584
+ n = array.length + n;
2585
+ for (let i = 0; i < n; i++) {
2586
+ rotated.unshift(rotated.pop());
2587
+ }
2588
+ return rotated;
2589
+ };
2590
+ var onlyUnique = (value, index, self2) => {
2591
+ return self2.indexOf(value) === index;
2592
+ };
2593
+ var makeEmptyArray = (w, h, value = "") => {
2594
+ var arr = [];
2595
+ for (let i = 0; i < h; i++) {
2596
+ arr[i] = [];
2597
+ for (let j = 0; j < w; j++) {
2598
+ arr[i][j] = value;
2599
+ }
2600
+ }
2601
+ return arr;
2602
+ };
2603
+
2604
+ // src/HelperFns/displayTypeHelpers.ts
2605
+ var isChartType = (type) => CHART_TYPES.includes(type);
2606
+ var isTableType = (type) => TABLE_TYPES.includes(type);
2607
+ var isDisplayTypeValid = (response, displayType, dataLength, pivotDataLength, columns, isDataLimited) => {
2608
+ var _a, _b;
2609
+ const supportedDisplayTypes = getSupportedDisplayTypes({
2610
+ response,
2611
+ columns: columns ?? ((_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.columns),
2612
+ dataLength,
2613
+ pivotDataLength,
2614
+ isDataLimited
2615
+ });
2616
+ const isValid = displayType && supportedDisplayTypes.includes(displayType);
2617
+ return isValid;
2618
+ };
2619
+ var shouldPlotMultiSeries = (columns) => {
2620
+ if (isAggregation(columns)) {
2621
+ return false;
2622
+ }
2623
+ const multiSeriesIndex = columns.findIndex((col) => col.multi_series === true);
2624
+ return multiSeriesIndex >= 0;
2625
+ };
2626
+ var supportsPieChart = (columns, chartData) => {
2627
+ if (shouldPlotMultiSeries(columns)) {
2628
+ return false;
2629
+ }
2630
+ if (chartData) {
2631
+ return chartData.length < 7;
2632
+ }
2633
+ return true;
2634
+ };
2635
+ var supports2DCharts = (columns, dataLength) => {
2636
+ if (dataLength <= 1) {
2637
+ return false;
2638
+ }
2639
+ const { amountOfNumberColumns, amountOfStringColumns } = getColumnTypeAmounts(columns);
2640
+ return amountOfNumberColumns > 0 && amountOfStringColumns > 0;
2641
+ };
2642
+ var supportsRegularPivotTable = (columns, dataLength, data) => {
2643
+ var _a, _b;
2644
+ if (dataLength <= 1) {
2645
+ return false;
2646
+ }
2647
+ const groupbyColumns = getGroupableColumns(columns);
2648
+ const hasTwoGroupables = (groupbyColumns == null ? void 0 : groupbyColumns.length) === 2;
2649
+ if (!hasTwoGroupables) {
2650
+ return false;
2651
+ }
2652
+ const visibleColumns = getVisibleColumns(columns);
2653
+ const groupbyColumn1 = columns[groupbyColumns[0]];
2654
+ const groupbyColumn2 = columns[groupbyColumns[1]];
2655
+ if (!groupbyColumn1.is_visible || !groupbyColumn2.is_visible || !((visibleColumns == null ? void 0 : visibleColumns.length) >= 3)) {
2656
+ return false;
2657
+ }
2658
+ const column1Data = (data == null ? void 0 : data.map((row) => {
2659
+ return row[groupbyColumns[0]];
2660
+ })) ?? [];
2661
+ const column2Data = (data == null ? void 0 : data.map((row) => {
2662
+ return row[groupbyColumns[1]];
2663
+ })) ?? [];
2664
+ const uniqueData1Length = ((_a = column1Data == null ? void 0 : column1Data.filter(onlyUnique)) == null ? void 0 : _a.length) ?? 0;
2665
+ const uniqueData2Length = ((_b = column2Data == null ? void 0 : column2Data.filter(onlyUnique)) == null ? void 0 : _b.length) ?? 0;
2666
+ if (uniqueData1Length > MAX_LEGEND_LABELS && uniqueData2Length > MAX_LEGEND_LABELS) {
2667
+ console.debug(
2668
+ `Info: Pivot table will not be supported since there are too many unique fields. The calculated dimensions would be: ${uniqueData1Length} x ${uniqueData2Length}`
2669
+ );
2670
+ return false;
2671
+ }
2672
+ return true;
2673
+ };
2674
+ var supportsDatePivotTable = (columns) => {
2675
+ var _a;
2676
+ const dateColumnIndex = columns.findIndex((col) => col.type === "DATE" || col.type === "DATE_STRING");
2677
+ const dateColumn = columns[dateColumnIndex];
2678
+ return dateColumn && ((_a = dateColumn == null ? void 0 : dateColumn.display_name) == null ? void 0 : _a.toLowerCase().includes("month")) && (columns == null ? void 0 : columns.length) === 2;
2679
+ };
2680
+ var isSingleValueResponse = (response) => {
2681
+ var _a, _b, _c, _d, _e, _f;
2682
+ if (!response) {
2683
+ return false;
2684
+ }
2685
+ const rows = (_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.rows;
2686
+ const columns = (_d = (_c = response == null ? void 0 : response.data) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2687
+ const referenceID = (_e = response == null ? void 0 : response.data) == null ? void 0 : _e.reference_id;
2688
+ const hasNoData = rows && !(rows == null ? void 0 : rows.length);
2689
+ const hasOneColumn = (columns == null ? void 0 : columns.length) === 1;
2690
+ if (hasNoData && hasOneColumn && referenceID === "1.1.211") {
2691
+ return true;
2692
+ }
2693
+ const oneRowAndColumn = (rows == null ? void 0 : rows.length) === 1 && ((_f = rows[0]) == null ? void 0 : _f.length) === 1;
2694
+ if (oneRowAndColumn) {
2695
+ return true;
2696
+ }
2697
+ return false;
2698
+ };
2699
+ var getSupportedDisplayTypes = ({
2700
+ response,
2701
+ columns,
2702
+ dataLength,
2703
+ pivotDataLength,
2704
+ isDataLimited
2705
+ } = {}) => {
2706
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2707
+ try {
2708
+ if (!((_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.display_type)) {
2709
+ return [];
2710
+ }
2711
+ const displayType = response.data.data.display_type;
2712
+ if (displayType === "suggestion" || displayType === "help" || displayType === "html") {
2713
+ return [displayType];
2714
+ }
2715
+ const rows = ((_d = (_c = response == null ? void 0 : response.data) == null ? void 0 : _c.data) == null ? void 0 : _d.rows) ?? [];
2716
+ const allColumns = columns || ((_f = (_e = response == null ? void 0 : response.data) == null ? void 0 : _e.data) == null ? void 0 : _f.columns);
2717
+ const visibleColumns = getVisibleColumns(allColumns);
2718
+ if (!(visibleColumns == null ? void 0 : visibleColumns.length)) {
2719
+ return ["text"];
2720
+ }
2721
+ if (isSingleValueResponse(response)) {
2722
+ return ["single-value"];
2723
+ }
2724
+ if (!(rows == null ? void 0 : rows.length)) {
2725
+ return ["table"];
2726
+ }
2727
+ const maxRowsForPieChart = 10;
2728
+ const numRows = dataLength ?? rows.length;
2729
+ let pivotDataHasLength = true;
2730
+ const pivotDataLengthProvided = pivotDataLength !== void 0 && pivotDataLength !== null;
2731
+ if (pivotDataLengthProvided) {
2732
+ pivotDataHasLength = !!pivotDataLength;
2733
+ }
2734
+ if (supportsRegularPivotTable(visibleColumns, numRows, (_h = (_g = response == null ? void 0 : response.data) == null ? void 0 : _g.data) == null ? void 0 : _h.rows)) {
2735
+ const supportedDisplayTypes = ["table"];
2736
+ if (!isDataLimited) {
2737
+ supportedDisplayTypes.push("pivot_table");
2738
+ }
2739
+ if (
2740
+ // Comment out for now so chart row count doesnt change display type
2741
+ // numRows <= maxRowsForPivot &&
2742
+ pivotDataHasLength
2743
+ ) {
2744
+ supportedDisplayTypes.push("stacked_column", "stacked_bar", "column", "bar", "bubble", "heatmap");
2745
+ if (hasDateColumn(visibleColumns)) {
2746
+ supportedDisplayTypes.push("stacked_line", "line");
2747
+ }
2748
+ }
2749
+ return supportedDisplayTypes;
2750
+ } else if (supports2DCharts(visibleColumns, numRows)) {
2751
+ const supportedDisplayTypes = ["table", "column", "bar"];
2752
+ if (numRows > MIN_HISTOGRAM_SAMPLE) {
2753
+ supportedDisplayTypes.push("histogram");
2754
+ }
2755
+ if (hasDateColumn(visibleColumns)) {
2756
+ supportedDisplayTypes.push("line");
2757
+ }
2758
+ if (numRows > 1 && numRows <= maxRowsForPieChart) {
2759
+ supportedDisplayTypes.push("pie");
2760
+ }
2761
+ const { amountOfNumberColumns } = getColumnTypeAmounts(visibleColumns);
2762
+ if (amountOfNumberColumns > 1) {
2763
+ supportedDisplayTypes.push("column_line");
2764
+ supportedDisplayTypes.push("scatterplot");
2765
+ }
2766
+ if (!isDataLimited && supportsDatePivotTable(visibleColumns)) {
2767
+ const dateColumnIndex = visibleColumns.findIndex((col) => col.type === "DATE" || col.type === "DATE_STRING");
2768
+ const dateColumn = visibleColumns[dateColumnIndex];
2769
+ const data = (_j = (_i = response == null ? void 0 : response.data) == null ? void 0 : _i.data) == null ? void 0 : _j.rows;
2770
+ const uniqueYears = [];
2771
+ data.forEach((row) => {
2772
+ const year = formatElement({
2773
+ element: row[dateColumnIndex],
2774
+ column: dateColumn,
2775
+ config: getDataFormatting({ monthYearFormat: "YYYY", dayMonthYearFormat: "YYYY" })
2776
+ });
2777
+ if (!uniqueYears.includes(year)) {
2778
+ uniqueYears.push(year);
2779
+ }
2780
+ });
2781
+ if (uniqueYears.length > 1) {
2782
+ supportedDisplayTypes.push("pivot_table");
2783
+ }
2784
+ }
2785
+ return supportedDisplayTypes;
2786
+ }
2787
+ return ["table"];
2788
+ } catch (error) {
2789
+ console.error(error);
2790
+ return ["table"];
2791
+ }
2792
+ };
2793
+ var getFirstChartDisplayType = (supportedDisplayTypes, fallback) => {
2794
+ const chartType = supportedDisplayTypes.find((displayType) => isChartType(displayType));
2795
+ if (chartType) {
2796
+ return chartType;
2797
+ }
2798
+ return fallback;
2799
+ };
2800
+ var getDefaultDisplayType = (response, defaultToChart, columns, dataLength, pivotDataLength, preferredDisplayType, isDataLimited = false) => {
2801
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2802
+ const supportedDisplayTypes = getSupportedDisplayTypes({
2803
+ response,
2804
+ columns: columns ?? ((_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.columns),
2805
+ dataLength,
2806
+ pivotDataLength,
2807
+ isDataLimited
2808
+ });
2809
+ if (preferredDisplayType && supportedDisplayTypes.includes(preferredDisplayType)) {
2810
+ return preferredDisplayType;
2811
+ }
2812
+ const responseDisplayType = (_d = (_c = response == null ? void 0 : response.data) == null ? void 0 : _c.data) == null ? void 0 : _d.display_type;
2813
+ if (supportedDisplayTypes.includes(preferredDisplayType)) {
2814
+ return preferredDisplayType;
2815
+ }
2816
+ if (responseDisplayType === "suggestion" || responseDisplayType === "help" || responseDisplayType === "html") {
2817
+ return responseDisplayType;
2818
+ }
2819
+ if (supportedDisplayTypes.length === 1) {
2820
+ return supportedDisplayTypes[0];
2821
+ }
2822
+ if (supportedDisplayTypes.includes("pivot_table")) {
2823
+ let displayType = "pivot_table";
2824
+ if (defaultToChart) {
2825
+ displayType = isAggregation((_f = (_e = response == null ? void 0 : response.data) == null ? void 0 : _e.data) == null ? void 0 : _f.columns) ? getFirstChartDisplayType(supportedDisplayTypes, "pivot_table") : "pivot_table";
2826
+ }
2827
+ return displayType;
2828
+ }
2829
+ if (!responseDisplayType && hasData(response) || responseDisplayType === "data") {
2830
+ let displayType = "table";
2831
+ if (defaultToChart) {
2832
+ displayType = isAggregation((_h = (_g = response == null ? void 0 : response.data) == null ? void 0 : _g.data) == null ? void 0 : _h.columns) ? getFirstChartDisplayType(supportedDisplayTypes, "table") : "table";
2833
+ }
2834
+ return displayType;
2835
+ }
2836
+ return "text";
2837
+ };
2838
+ var hasData = (response) => {
2839
+ var _a, _b, _c;
2840
+ if (!response) {
2841
+ return false;
2842
+ }
2843
+ return (_c = (_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.rows) == null ? void 0 : _c.length;
2844
+ };
2845
+
2846
+ // src/HelperFns/domHelpers.ts
2847
+ var currentEventLoopEnd = () => {
2848
+ return new Promise((resolve) => {
2849
+ setTimeout(resolve, 0);
2850
+ });
2851
+ };
2852
+ var animateInputText = ({ text = "", inputRef, callback = () => {
2853
+ }, totalAnimationTime = 1e3 }) => {
2854
+ if (!text.length || !inputRef || typeof text !== "string") {
2855
+ return Promise.resolve();
2856
+ }
2857
+ return new Promise((resolve) => {
2858
+ const timePerChar = Math.round(totalAnimationTime / text.length);
2859
+ for (let i = 1; i <= text.length; i++) {
2860
+ setTimeout(() => {
2861
+ inputRef.value = text.slice(0, i);
2862
+ if (i === text.length) {
2863
+ setTimeout(() => {
2864
+ callback();
2865
+ resolve();
2866
+ }, 300);
2867
+ }
2868
+ }, i * timePerChar);
2869
+ }
2870
+ });
2871
+ };
2872
+ var handleTooltipBoundaryCollision = (e, self2) => {
2873
+ var _a;
2874
+ const tooltipRef = (_a = self2 == null ? void 0 : self2.reactTooltipRef) == null ? void 0 : _a.tooltipRef;
2875
+ if (!tooltipRef) {
2876
+ return;
2877
+ }
2878
+ const rect = tooltipRef.getBoundingClientRect();
2879
+ const overflownLeft = rect.left < 0;
2880
+ const overflownRight = rect.right > window.innerWidth;
2881
+ if (overflownLeft) {
2882
+ tooltipRef.style.setProperty("left", "10px");
2883
+ tooltipRef.style.setProperty("right", "auto");
2884
+ } else if (overflownRight) {
2885
+ tooltipRef.style.setProperty("left", "auto");
2886
+ tooltipRef.style.setProperty("right", "10px");
2887
+ }
2888
+ };
2889
+ var removeFromDOM = (elem) => {
2890
+ if (!elem) {
2891
+ return;
2892
+ }
2893
+ try {
2894
+ if (typeof elem.forEach === "function" && (elem == null ? void 0 : elem.length)) {
2895
+ elem.forEach((el) => {
2896
+ if (el && typeof el.remove === "function") {
2897
+ el.remove();
2898
+ }
2899
+ });
2900
+ } else if (typeof elem.remove === "function") {
2901
+ elem.remove();
2902
+ }
2903
+ } catch (error) {
2904
+ console.error(error);
2905
+ }
2906
+ };
2907
+ var setCaretPosition = (elem, caretPos) => {
2908
+ if (elem !== null) {
2909
+ if (elem.createTextRange) {
2910
+ const range = elem.createTextRange();
2911
+ range.move("character", caretPos);
2912
+ range.select();
2913
+ } else {
2914
+ if (elem.selectionStart) {
2915
+ elem.focus();
2916
+ elem.setSelectionRange(caretPos, caretPos);
2917
+ } else {
2918
+ elem.focus();
2919
+ }
2920
+ }
2921
+ }
2922
+ };
2923
+ var getPadding = (element) => {
2924
+ const padding = { left: 0, right: 0, top: 0, bottom: 0 };
2925
+ try {
2926
+ const left = parseInt(window.getComputedStyle(element)["padding-left"], 10);
2927
+ const right = parseInt(window.getComputedStyle(element)["padding-right"], 10);
2928
+ const top = parseInt(window.getComputedStyle(element)["padding-top"], 10);
2929
+ const bottom = parseInt(window.getComputedStyle(element)["padding-bottom"], 10);
2930
+ padding.left = left;
2931
+ padding.right = right;
2932
+ padding.top = top;
2933
+ padding.bottom = bottom;
2934
+ } catch (error) {
2935
+ return padding;
2936
+ }
2937
+ return padding;
2938
+ };
2939
+ var getQueryParams = (url) => {
2940
+ try {
2941
+ const queryParams = {};
2942
+ const anchor = document.createElement("a");
2943
+ anchor.href = url;
2944
+ const queryStrings = anchor.search.substring(1);
2945
+ const params = queryStrings.split("&");
2946
+ for (var i = 0; i < params.length; i++) {
2947
+ var pair = params[i].split("=");
2948
+ queryParams[pair[0]] = decodeURIComponent(pair[1]);
2949
+ }
2950
+ return queryParams;
2951
+ } catch (error) {
2952
+ return void 0;
2953
+ }
2954
+ };
2955
+ var svgToPng = (svgElement, scale = 3) => {
2956
+ return new Promise(function(resolve, reject) {
2957
+ try {
2958
+ const bbox = svgElement.getBoundingClientRect();
2959
+ const originalWidth = bbox.width;
2960
+ const originalHeight = bbox.height;
2961
+ const scaledWidth = originalWidth * scale;
2962
+ const scaledHeight = originalHeight * scale;
2963
+ const clonedSvg = svgElement.cloneNode(true);
2964
+ clonedSvg.setAttribute("transform-origin", "top left");
2965
+ clonedSvg.setAttribute("transform", `scale(${scale})`);
2966
+ const image64 = getSVGBase64(clonedSvg);
2967
+ const canvas = document.createElement("canvas");
2968
+ canvas.style.width = originalWidth + "px";
2969
+ canvas.style.height = originalHeight + "px";
2970
+ canvas.width = scaledWidth;
2971
+ canvas.height = scaledHeight;
2972
+ const ctx = canvas.getContext("2d");
2973
+ const img = new Image();
2974
+ img.onload = function() {
2975
+ ctx.drawImage(this, 0, 0, scaledWidth, scaledHeight);
2976
+ resolve(canvas.toDataURL("image/png", 1));
2977
+ };
2978
+ img.onerror = function() {
2979
+ reject("failed to load image");
2980
+ };
2981
+ img.src = image64;
2982
+ } catch (error) {
2983
+ console.error(error);
2984
+ reject("failed to convert svg to png " + error);
2985
+ }
2986
+ });
2987
+ };
2988
+ var getBBoxFromRef = (ref) => {
2989
+ if (!ref || !ref.getBBox) {
2990
+ return;
2991
+ }
2992
+ return ref.getBBox();
2993
+ };
2994
+ var getSVGBase64 = (svgElement) => {
2995
+ try {
2996
+ const domUrl = window.URL || window.webkitURL || window;
2997
+ if (!domUrl) {
2998
+ throw new Error("(browser doesnt support this)");
2999
+ } else if (!svgElement) {
3000
+ throw new Error("(svg element does not exist)");
3001
+ }
3002
+ var xml = new XMLSerializer().serializeToString(svgElement);
3003
+ var svg64 = btoa(unescape(encodeURIComponent(xml)));
3004
+ const imgSrc = `data:image/svg+xml;base64,${svg64}`;
3005
+ return imgSrc;
3006
+ } catch (error) {
3007
+ return void 0;
3008
+ }
3009
+ };
3010
+
3011
+ // src/HelperFns/propsHelpers.ts
3012
+ var getStringFromSource = (source) => {
3013
+ if (typeof source === "string" || typeof source === "number") {
3014
+ return `${source}`;
3015
+ }
3016
+ if (Array.isArray(source) && !!source.length) {
3017
+ return source.join(".");
3018
+ }
3019
+ return null;
3020
+ };
3021
+ var mergeSources = (source, newSource) => {
3022
+ let finalSource = null;
3023
+ try {
3024
+ const sourceString = getStringFromSource(source);
3025
+ const newSourceString = getStringFromSource(newSource);
3026
+ if (sourceString && newSourceString) {
3027
+ finalSource = [sourceString, newSourceString].join(".");
3028
+ } else if (sourceString) {
3029
+ finalSource = sourceString;
3030
+ } else if (newSourceString) {
3031
+ finalSource = newSourceString;
3032
+ }
3033
+ } catch (error) {
3034
+ console.error(error);
3035
+ }
3036
+ return finalSource;
3037
+ };
3038
+ })();
3039
+ //# sourceMappingURL=index.global.js.map