react-semaphor 0.1.183 → 0.1.184

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/chunks/calendar-preferences-dialog-D9oF_URo.js +1 -0
  2. package/dist/chunks/calendar-preferences-dialog-DeXKY9JD.js +457 -0
  3. package/dist/chunks/common-types-CfJLrTJd.js +1 -0
  4. package/dist/chunks/common-types-DhqlRVrq.js +8 -0
  5. package/dist/chunks/{dashboard-controls-BqMZqU3v.js → dashboard-controls-CB8282ob.js} +8 -8
  6. package/dist/chunks/{dashboard-controls-F8wbPI8x.js → dashboard-controls-lRs5t5cg.js} +499 -484
  7. package/dist/chunks/{dashboard-json-DUNbo5Io.js → dashboard-json-BmzqRV5Q.js} +1 -1
  8. package/dist/chunks/{dashboard-json-BFRJvB_f.js → dashboard-json-Brn4hMd-.js} +1 -1
  9. package/dist/chunks/date-formatter-Sz6QDaM8.js +1 -0
  10. package/dist/chunks/{index-B4EhQdS9.js → date-formatter-Y8Za1ib3.js} +500 -544
  11. package/dist/chunks/{edit-dashboard-visual-CPwMz-Gl.js → edit-dashboard-visual--FJBg3i3.js} +713 -713
  12. package/dist/chunks/{edit-dashboard-visual-C-2xW9ZO.js → edit-dashboard-visual-DNq8ni5W.js} +8 -8
  13. package/dist/chunks/{editor-action-buttons-DEi2BM_u.js → editor-action-buttons-COCkxvCM.js} +27 -27
  14. package/dist/chunks/{editor-action-buttons-C5pFQC5d.js → editor-action-buttons-RPpMm3Zr.js} +1 -1
  15. package/dist/chunks/{index-LgltNjBB.js → index-CyYJ0bVW.js} +21147 -20949
  16. package/dist/chunks/{index-CcVMCdNu.js → index-Dz2kwOQh.js} +229 -229
  17. package/dist/chunks/{notification-bell-BCdcnJx6.js → notification-bell-B86bWytX.js} +109 -109
  18. package/dist/chunks/{notification-bell-C0rpelXK.js → notification-bell-Bdk-qQIx.js} +2 -2
  19. package/dist/chunks/{resource-management-panel-D6ZT7DsU.js → resource-management-panel-BZKSwkRq.js} +160 -160
  20. package/dist/chunks/{resource-management-panel-CaKtrD1Q.js → resource-management-panel-CvKBoIFQ.js} +1 -1
  21. package/dist/chunks/{use-role-aware-display-preferences-B3xYm_4b.js → use-role-aware-display-preferences-D-jgaajh.js} +1 -1
  22. package/dist/chunks/{use-role-aware-display-preferences-F6Zc7Evm.js → use-role-aware-display-preferences-Kxc427Zx.js} +1 -1
  23. package/dist/chunks/{use-visual-utils-B1yUV6dt.js → use-visual-utils-Du4NIgMk.js} +1 -1
  24. package/dist/chunks/{use-visual-utils-D48U4CBx.js → use-visual-utils-DwQQN6wI.js} +33 -33
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +3 -3
  27. package/dist/format-utils/index.cjs +5 -5
  28. package/dist/format-utils/index.js +200 -250
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +75 -71
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.cjs +1 -1
  33. package/dist/surfboard/index.js +6 -4
  34. package/dist/types/format-utils.d.ts +43 -20
  35. package/dist/types/index.cjs +1 -1
  36. package/dist/types/index.js +8 -5
  37. package/dist/types/main.d.ts +87 -2
  38. package/dist/types/surfboard.d.ts +7 -0
  39. package/dist/types/types.d.ts +313 -0
  40. package/package.json +1 -1
  41. package/dist/chunks/index-8Crk3ROJ.js +0 -1
@@ -1,5 +1,6 @@
1
- import { f as F, p as g, a as I } from "../chunks/index-B4EhQdS9.js";
2
- const $ = [
1
+ import { f as N, a as I } from "../chunks/date-formatter-Y8Za1ib3.js";
2
+ import { g as Y, b as Z, p as F, r as p } from "../chunks/date-formatter-Y8Za1ib3.js";
3
+ const b = [
3
4
  { value: 1e12, suffix: "T" },
4
5
  { value: 1e9, suffix: "B" },
5
6
  { value: 1e7, suffix: "Cr" },
@@ -9,11 +10,11 @@ const $ = [
9
10
  // Lakh (Indian)
10
11
  { value: 1e3, suffix: "K" }
11
12
  ];
12
- function S(r) {
13
+ function D(r) {
13
14
  const e = Math.abs(r);
14
- for (const { value: u, suffix: t } of $)
15
+ for (const { value: u, suffix: c } of b)
15
16
  if (e >= u)
16
- return { divisor: u, suffix: t };
17
+ return { divisor: u, suffix: c };
17
18
  return { divisor: 1, suffix: "" };
18
19
  }
19
20
  function L(r) {
@@ -23,95 +24,95 @@ function L(r) {
23
24
  return !1;
24
25
  }
25
26
  }
26
- function f(r) {
27
+ function t(r) {
27
28
  return r && L(r) ? r : "en-US";
28
29
  }
29
- function B(r, e) {
30
+ function $(r, e) {
30
31
  if (r == null || isNaN(r))
31
32
  return "";
32
- const u = f(e == null ? void 0 : e.locale);
33
- let t = r;
34
- if (e != null && e.multiplyBy && (t *= e.multiplyBy), e != null && e.useSuffix) {
35
- const { divisor: a, suffix: l } = S(t);
36
- t = t / a;
37
- const i = new Intl.NumberFormat(u, {
33
+ const u = t(e == null ? void 0 : e.locale);
34
+ let c = r;
35
+ if (e != null && e.multiplyBy && (c *= e.multiplyBy), e != null && e.useSuffix) {
36
+ const { divisor: f, suffix: i } = D(c);
37
+ c = c / f;
38
+ const m = new Intl.NumberFormat(u, {
38
39
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
39
40
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
40
41
  useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
41
- }).format(t);
42
- return `${(e == null ? void 0 : e.prefix) ?? ""}${i}${l}${(e == null ? void 0 : e.suffix) ?? ""}`;
42
+ }).format(c);
43
+ return `${(e == null ? void 0 : e.prefix) ?? ""}${m}${i}${(e == null ? void 0 : e.suffix) ?? ""}`;
43
44
  }
44
- const c = new Intl.NumberFormat(u, {
45
+ const l = new Intl.NumberFormat(u, {
45
46
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
46
47
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
47
48
  useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
48
- }).format(t);
49
- if (e != null && e.negativeInParentheses && t < 0) {
50
- const a = c.replace("-", "");
51
- return `${(e == null ? void 0 : e.prefix) ?? ""}(${a})${(e == null ? void 0 : e.suffix) ?? ""}`;
49
+ }).format(c);
50
+ if (e != null && e.negativeInParentheses && c < 0) {
51
+ const f = l.replace("-", "");
52
+ return `${(e == null ? void 0 : e.prefix) ?? ""}(${f})${(e == null ? void 0 : e.suffix) ?? ""}`;
52
53
  }
53
- return `${(e == null ? void 0 : e.prefix) ?? ""}${c}${(e == null ? void 0 : e.suffix) ?? ""}`;
54
+ return `${(e == null ? void 0 : e.prefix) ?? ""}${l}${(e == null ? void 0 : e.suffix) ?? ""}`;
54
55
  }
55
- function Z(r, e) {
56
+ function z(r, e) {
56
57
  if (r == null || isNaN(r))
57
58
  return "";
58
- const u = f(e == null ? void 0 : e.locale), t = (e == null ? void 0 : e.currency) || "USD";
59
+ const u = t(e == null ? void 0 : e.locale), c = (e == null ? void 0 : e.currency) || "USD";
59
60
  if (e != null && e.useSuffix) {
60
- const { divisor: c, suffix: a } = S(r), l = r / c;
61
+ const { divisor: l, suffix: f } = D(r), i = r / l;
61
62
  return `${new Intl.NumberFormat(u, {
62
63
  style: "currency",
63
- currency: t,
64
+ currency: c,
64
65
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
65
66
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
66
- }).format(l)}${a}`;
67
+ }).format(i)}${f}`;
67
68
  }
68
69
  return new Intl.NumberFormat(u, {
69
70
  style: "currency",
70
- currency: t,
71
+ currency: c,
71
72
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
72
73
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
73
74
  }).format(r);
74
75
  }
75
- function E(r, e) {
76
+ function B(r, e) {
76
77
  if (r == null || isNaN(r))
77
78
  return "";
78
- const u = f(e == null ? void 0 : e.locale), t = e != null && e.alreadyPercent ? r / 100 : r;
79
+ const u = t(e == null ? void 0 : e.locale), c = e != null && e.alreadyPercent ? r / 100 : r;
79
80
  return new Intl.NumberFormat(u, {
80
81
  style: "percent",
81
82
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
82
83
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
83
- }).format(t);
84
+ }).format(c);
84
85
  }
85
- function R(r, e) {
86
+ function E(r, e) {
86
87
  if (r == null || isNaN(r))
87
88
  return "";
88
- const u = f(e == null ? void 0 : e.locale);
89
+ const u = t(e == null ? void 0 : e.locale);
89
90
  return new Intl.NumberFormat(u, {
90
91
  notation: "scientific",
91
92
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
92
93
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
93
94
  }).format(r);
94
95
  }
95
- function D(r, e, u = "en-US") {
96
+ function d(r, e, u = "en-US") {
96
97
  if (r == null || isNaN(r))
97
98
  return "";
98
- const t = f((e == null ? void 0 : e.locale) || u), c = (e == null ? void 0 : e.style) || "decimal";
99
- return c === "percent" ? new Intl.NumberFormat(t, {
99
+ const c = t((e == null ? void 0 : e.locale) || u), l = (e == null ? void 0 : e.style) || "decimal";
100
+ return l === "percent" ? new Intl.NumberFormat(c, {
100
101
  style: "percent",
101
102
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
102
103
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
103
- }).format(r / 100) : c === "currency" ? new Intl.NumberFormat(t, {
104
+ }).format(r / 100) : l === "currency" ? new Intl.NumberFormat(c, {
104
105
  style: "currency",
105
106
  currency: (e == null ? void 0 : e.currency) || "USD",
106
107
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
107
108
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
108
- }).format(r) : new Intl.NumberFormat(t, {
109
+ }).format(r) : new Intl.NumberFormat(c, {
109
110
  minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
110
111
  maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
111
112
  }).format(r);
112
113
  }
113
- function q(r, e, u) {
114
- const t = {
114
+ function k(r, e, u) {
115
+ const c = {
115
116
  locale: u == null ? void 0 : u.locale,
116
117
  currency: u == null ? void 0 : u.currency,
117
118
  minimumFractionDigits: u == null ? void 0 : u.decimalPlaces,
@@ -124,101 +125,51 @@ function q(r, e, u) {
124
125
  };
125
126
  switch (e) {
126
127
  case "currency":
127
- return Z(r, t);
128
+ return z(r, c);
128
129
  case "percent":
129
- return E(r, t);
130
+ return B(r, c);
130
131
  case "scientific":
131
- return R(r, t);
132
+ return E(r, c);
132
133
  default:
133
- return B(r, t);
134
- }
135
- }
136
- function b(r, e) {
137
- return r && r !== "auto" ? r : e;
138
- }
139
- function J(r, e = /* @__PURE__ */ new Date()) {
140
- try {
141
- const u = {
142
- timeZone: r,
143
- timeZoneName: "short"
144
- }, c = new Intl.DateTimeFormat("en-US", u).formatToParts(e).find((a) => a.type === "timeZoneName");
145
- return (c == null ? void 0 : c.value) || r;
146
- } catch {
147
- return r;
134
+ return $(r, c);
148
135
  }
149
136
  }
150
- function Q(r) {
151
- try {
152
- const e = {
153
- timeZone: r,
154
- timeZoneName: "long"
155
- }, t = new Intl.DateTimeFormat("en-US", e).formatToParts(
156
- /* @__PURE__ */ new Date()
157
- ).find((c) => c.type === "timeZoneName");
158
- return (t == null ? void 0 : t.value) || r;
159
- } catch {
160
- return r;
161
- }
162
- }
163
- function A(r, e = "auto") {
164
- if (!r)
165
- return /* @__PURE__ */ new Date(NaN);
166
- const u = r.endsWith("Z"), t = /[+-]\d{2}:?\d{2}$/.test(r), c = /\([A-Z]{3,4}\)$/.test(r);
167
- if (e === "auto")
168
- return u || t || c ? new Date(r) : /* @__PURE__ */ new Date(r + "Z");
169
- if (e === "local") {
170
- if (u || t) {
171
- const a = r.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
172
- return new Date(a);
173
- }
174
- return new Date(r);
175
- } else return e === "UTC" ? u ? new Date(r) : t ? new Date(r) : /* @__PURE__ */ new Date(r + "Z") : u || t || c ? new Date(r) : /* @__PURE__ */ new Date(r + "Z");
137
+ function R(r, e, u, c) {
138
+ const l = r instanceof Date ? r.toISOString() : String(r), f = (c == null ? void 0 : c.browserTimezone) || u, i = (c == null ? void 0 : c.isSqlCard) ?? !1;
139
+ if (e != null && e.useRelativeTime)
140
+ return N(
141
+ l,
142
+ (e == null ? void 0 : e.sourceTimezone) || "auto"
143
+ );
144
+ const m = e != null && e.useCustomFormat && (e != null && e.customFormat) ? e.customFormat : (e == null ? void 0 : e.format) || "MM/dd/yyyy";
145
+ return I(
146
+ l,
147
+ m,
148
+ e != null && e.timezone && (e == null ? void 0 : e.timezone) !== "auto" ? e.timezone : i ? f : u,
149
+ (e == null ? void 0 : e.sourceTimezone) || "auto"
150
+ );
176
151
  }
177
152
  function P(r, e, u) {
178
- if (r == null)
179
- return "";
180
- try {
181
- const t = typeof r == "string" ? A(r, e == null ? void 0 : e.sourceTimezone) : r;
182
- if (isNaN(t.getTime()))
183
- return String(r);
184
- if (e != null && e.useRelativeTime)
185
- return H(t);
186
- const c = e != null && e.useCustomFormat && (e != null && e.customFormat) ? e.customFormat : (e == null ? void 0 : e.format) || "MM/dd/yyyy", a = b(e == null ? void 0 : e.timezone, u || "UTC");
187
- return F(t, a, c);
188
- } catch {
189
- return String(r);
190
- }
191
- }
192
- function H(r) {
193
- if (r == null)
194
- return "";
195
- try {
196
- const e = typeof r == "string" ? g(r) : r;
197
- return isNaN(e.getTime()) ? String(r) : I(e, { addSuffix: !0 });
198
- } catch {
199
- return String(r);
200
- }
201
- }
202
- function U(r, e, u) {
203
- return P(r, e, u);
204
- }
205
- function M(r, e, u) {
206
153
  if (r == null)
207
154
  return "";
208
155
  if (!u.useFormattedValues || !e)
209
156
  return String(r);
210
157
  switch (e.type) {
211
158
  case "number":
212
- return typeof r == "number" ? D(
159
+ return typeof r == "number" ? d(
213
160
  r,
214
161
  e.numberFormat,
215
162
  u.locale
216
163
  ) : String(r);
217
164
  case "date":
218
- return U(
165
+ return R(
219
166
  r,
220
167
  e.dateFormat,
221
- u.timezone
168
+ u.timezone,
169
+ {
170
+ browserTimezone: u.browserTimezone,
171
+ isSqlCard: u.isSqlCard
172
+ }
222
173
  );
223
174
  case "progress":
224
175
  return typeof r == "number" ? `${r}%` : String(r);
@@ -230,222 +181,221 @@ function M(r, e, u) {
230
181
  return String(r);
231
182
  }
232
183
  }
233
- function j(r, e) {
184
+ function A(r, e) {
234
185
  return e.visibleColumns.map((u) => {
235
- const t = r[u], c = e.columnSettings[u];
236
- return M(t, c, {
186
+ const c = r[u], l = e.columnSettings[u];
187
+ return P(c, l, {
237
188
  useFormattedValues: e.useFormattedValues,
238
189
  timezone: e.timezone,
239
190
  locale: e.locale
240
191
  });
241
192
  });
242
193
  }
243
- function y(r, e = ",") {
194
+ function h(r, e = ",") {
244
195
  if (r == null)
245
196
  return "";
246
197
  const u = String(r);
247
198
  return u.includes(e) || u.includes('"') || u.includes(`
248
199
  `) || u.includes("\r") ? `"${u.replace(/"/g, '""')}"` : u;
249
200
  }
250
- function h(r, e = ",") {
251
- return r.map((u) => y(u, e)).join(e);
201
+ function S(r, e = ",") {
202
+ return r.map((u) => h(u, e)).join(e);
252
203
  }
253
- function C(r, e = {}) {
254
- const { delimiter: u = ",", lineEnding: t = `
204
+ function H(r, e = {}) {
205
+ const { delimiter: u = ",", lineEnding: c = `
255
206
  ` } = e;
256
- return r.map((c) => h(c, u)).join(t);
207
+ return r.map((l) => S(l, u)).join(c);
257
208
  }
258
- function Y(r, e = {}) {
209
+ function K(r, e = {}) {
259
210
  if (r.length === 0)
260
211
  return "";
261
212
  const {
262
213
  delimiter: u = ",",
263
- lineEnding: t = `
214
+ lineEnding: c = `
264
215
  `,
265
- includeHeaders: c = !0,
266
- columns: a
267
- } = e, l = a || Object.keys(r[0]), i = [];
268
- c && i.push(l);
269
- for (const m of r) {
270
- const s = l.map((d) => {
271
- const n = m[d];
272
- return n == null ? "" : String(n);
216
+ includeHeaders: l = !0,
217
+ columns: f
218
+ } = e, i = f || Object.keys(r[0]), m = [];
219
+ l && m.push(i);
220
+ for (const n of r) {
221
+ const s = i.map((y) => {
222
+ const a = n[y];
223
+ return a == null ? "" : String(a);
273
224
  });
274
- i.push(s);
225
+ m.push(s);
275
226
  }
276
- return C(i, { delimiter: u, lineEnding: t });
227
+ return H(m, { delimiter: u, lineEnding: c });
277
228
  }
278
- function G(r, e) {
229
+ function C(r, e) {
279
230
  const u = [];
280
- e.includeHeaders && u.push(h(e.visibleColumns, e.delimiter));
281
- for (const t of r) {
282
- const c = j(t, e);
231
+ e.includeHeaders && u.push(S(e.visibleColumns, e.delimiter));
232
+ for (const c of r) {
233
+ const l = A(c, e);
283
234
  u.push(
284
- c.map((a) => y(a, e.delimiter)).join(e.delimiter)
235
+ l.map((f) => h(f, e.delimiter)).join(e.delimiter)
285
236
  );
286
237
  }
287
238
  return u;
288
239
  }
289
- function v(r, e, u = `
240
+ function X(r, e, u = `
290
241
  `) {
291
- return G(r, e).join(u);
242
+ return C(r, e).join(u);
292
243
  }
293
- function O(r, e, u) {
294
- return r == null ? "" : u.useFormattedValues ? typeof r == "number" && (e == null ? void 0 : e.type) === "number" ? D(
244
+ function M(r, e, u) {
245
+ return r == null ? "" : u.useFormattedValues ? typeof r == "number" && (e == null ? void 0 : e.type) === "number" ? d(
295
246
  r,
296
247
  e.numberFormat,
297
248
  u.locale
298
249
  ) : typeof r == "number" ? r.toLocaleString(u.locale) : String(r) : String(r);
299
250
  }
300
- function W(r, e, u) {
301
- var c, a;
302
- const t = [];
251
+ function j(r, e, u) {
252
+ var l, f;
253
+ const c = [];
303
254
  if (r.isSubtotal && !r.isGrandTotal) {
304
- const l = e.groupByColumns.findIndex(
305
- (i) => i.alias === r.subtotalLevel
255
+ const i = e.groupByColumns.findIndex(
256
+ (m) => m.alias === r.subtotalLevel
306
257
  );
307
- e.groupByColumns.forEach((i, m) => {
308
- var s, d, n, x;
309
- if (m === l) {
310
- const N = (d = (s = e.rowAggregates) == null ? void 0 : s.find(
258
+ e.groupByColumns.forEach((m, n) => {
259
+ var s, y, a, x;
260
+ if (n === i) {
261
+ const w = (y = (s = e.rowAggregates) == null ? void 0 : s.find(
311
262
  (V) => V.groupLevel === r.subtotalLevel
312
- )) == null ? void 0 : d.label, T = (x = (n = r.subtotalContext) == null ? void 0 : n.groupByValues) == null ? void 0 : x[i.alias];
313
- t.push(N ?? `Subtotal (${T ?? "Total"})`);
314
- } else m < l ? t.push(String(r[i.alias] ?? "")) : t.push("");
263
+ )) == null ? void 0 : y.label, g = (x = (a = r.subtotalContext) == null ? void 0 : a.groupByValues) == null ? void 0 : x[m.alias];
264
+ c.push(w ?? `Subtotal (${g ?? "Total"})`);
265
+ } else n < i ? c.push(String(r[m.alias] ?? "")) : c.push("");
315
266
  });
316
267
  } else if (r.isGrandTotal) {
317
- const l = (a = (c = e.rowAggregates) == null ? void 0 : c.find(
318
- (i) => i.groupLevel === "ALL"
319
- )) == null ? void 0 : a.label;
320
- t.push(l || "Grand Total"), e.groupByColumns.slice(1).forEach(() => t.push(""));
268
+ const i = (f = (l = e.rowAggregates) == null ? void 0 : l.find(
269
+ (m) => m.groupLevel === "ALL"
270
+ )) == null ? void 0 : f.label;
271
+ c.push(i || "Grand Total"), e.groupByColumns.slice(1).forEach(() => c.push(""));
321
272
  } else
322
- e.groupByColumns.forEach((l) => {
323
- t.push(String(r[l.alias] ?? ""));
273
+ e.groupByColumns.forEach((i) => {
274
+ c.push(String(r[i.alias] ?? ""));
324
275
  });
325
- return e.pivotSchema.filter((l) => l.isMetricColumn).forEach((l) => {
326
- const i = r[l.alias], m = u.columnSettings[l.alias];
327
- t.push(O(i, m, u));
328
- }), t;
276
+ return e.pivotSchema.filter((i) => i.isMetricColumn).forEach((i) => {
277
+ const m = r[i.alias], n = u.columnSettings[i.alias];
278
+ c.push(M(m, n, u));
279
+ }), c;
329
280
  }
330
- function k(r) {
281
+ function G(r) {
331
282
  const e = r.groupByColumns.map(
332
- (t) => t.label || t.name
333
- ), u = r.pivotSchema.filter((t) => t.isMetricColumn).map((t) => t.displayLabel || t.metricLabel || t.metricName || t.alias);
283
+ (c) => c.label || c.name
284
+ ), u = r.pivotSchema.filter((c) => c.isMetricColumn).map((c) => c.displayLabel || c.metricLabel || c.metricName || c.alias);
334
285
  return [...e, ...u];
335
286
  }
336
- function p(r, e, u) {
337
- const t = [];
287
+ function _(r, e, u) {
288
+ const c = [];
338
289
  if (u.includeHeaders) {
339
- const c = k(e);
340
- t.push(h(c, u.delimiter));
290
+ const l = G(e);
291
+ c.push(S(l, u.delimiter));
341
292
  }
342
- for (const c of r) {
343
- const a = W(
344
- c,
293
+ for (const l of r) {
294
+ const f = j(
295
+ l,
345
296
  e,
346
297
  u
347
298
  );
348
- t.push(
349
- a.map((l) => y(l, u.delimiter)).join(u.delimiter)
299
+ c.push(
300
+ f.map((i) => h(i, u.delimiter)).join(u.delimiter)
350
301
  );
351
302
  }
352
- return t;
303
+ return c;
353
304
  }
354
- function w(r, e, u) {
355
- for (const t of r) {
356
- if (t.level < u) {
357
- e[t.level].push(t.name);
358
- for (let c = 1; c < t.colspan; c++)
359
- e[t.level].push("");
305
+ function T(r, e, u) {
306
+ for (const c of r) {
307
+ if (c.level < u) {
308
+ e[c.level].push(c.name);
309
+ for (let l = 1; l < c.colspan; l++)
310
+ e[c.level].push("");
360
311
  }
361
- t.children ? w(t.children, e, u) : t.columnKey && e[u].push(t.name);
312
+ c.children ? T(c.children, e, u) : c.columnKey && e[u].push(c.name);
362
313
  }
363
314
  }
364
- function z(r) {
365
- const e = r.pivotByColumns.length, u = r.groupByColumns.length, t = Array.from(
315
+ function U(r) {
316
+ const e = r.pivotByColumns.length, u = r.groupByColumns.length, c = Array.from(
366
317
  { length: e + 1 },
367
318
  () => []
368
319
  );
369
- for (let c = 0; c < e; c++)
370
- t[c].push(...Array(u).fill(""));
371
- if (t[e].push(
372
- ...r.groupByColumns.map((c) => c.label || c.name)
373
- ), w(r.columnHeadersTree, t, e), r.showRowTotals) {
374
- for (let c = 0; c < e; c++)
375
- t[c].push("");
376
- t[e].push("Total");
320
+ for (let l = 0; l < e; l++)
321
+ c[l].push(...Array(u).fill(""));
322
+ if (c[e].push(
323
+ ...r.groupByColumns.map((l) => l.label || l.name)
324
+ ), T(r.columnHeadersTree, c, e), r.showRowTotals) {
325
+ for (let l = 0; l < e; l++)
326
+ c[l].push("");
327
+ c[e].push("Total");
377
328
  }
378
- return t;
329
+ return c;
379
330
  }
380
- function K(r, e, u) {
331
+ function q(r, e, u) {
381
332
  if (r == null)
382
333
  return "";
383
334
  if (!u.useFormattedValues)
384
335
  return String(r);
385
- const t = u.columnSettings[e];
386
- return typeof r == "number" && (t == null ? void 0 : t.type) === "number" ? D(
336
+ const c = u.columnSettings[e];
337
+ return typeof r == "number" && (c == null ? void 0 : c.type) === "number" ? d(
387
338
  r,
388
- t.numberFormat,
339
+ c.numberFormat,
389
340
  u.locale
390
341
  ) : typeof r == "number" ? r.toLocaleString(u.locale) : String(r);
391
342
  }
392
- function X(r, e, u) {
393
- const t = [];
394
- r.fieldValues.forEach((a, l) => {
395
- r.isSubtotal && l === 0 ? t.push(`${a} Total`) : r.isSubtotal ? t.push("") : t.push(String(a ?? ""));
343
+ function O(r, e, u) {
344
+ const c = [];
345
+ r.fieldValues.forEach((f, i) => {
346
+ r.isSubtotal && i === 0 ? c.push(`${f} Total`) : r.isSubtotal ? c.push("") : c.push(String(f ?? ""));
396
347
  });
397
- let c = 0;
398
- return e.columnHeaders.forEach((a) => {
399
- var m;
400
- const l = (m = r.cells[a]) == null ? void 0 : m.value, i = K(l, a, u);
401
- t.push(i), e.showRowTotals && typeof l == "number" && (c += l);
402
- }), e.showRowTotals && t.push(c.toLocaleString(u.locale)), t;
403
- }
404
- function o(r, e, u) {
405
- const t = [];
348
+ let l = 0;
349
+ return e.columnHeaders.forEach((f) => {
350
+ var n;
351
+ const i = (n = r.cells[f]) == null ? void 0 : n.value, m = q(i, f, u);
352
+ c.push(m), e.showRowTotals && typeof i == "number" && (l += i);
353
+ }), e.showRowTotals && c.push(l.toLocaleString(u.locale)), c;
354
+ }
355
+ function v(r, e, u) {
356
+ const c = [];
406
357
  if (u.includeHeaders) {
407
- const c = z(e);
408
- for (const a of c)
409
- t.push(h(a, u.delimiter));
358
+ const l = U(e);
359
+ for (const f of l)
360
+ c.push(S(f, u.delimiter));
410
361
  }
411
- for (const c of r) {
412
- const a = X(
413
- c,
362
+ for (const l of r) {
363
+ const f = O(
364
+ l,
414
365
  e,
415
366
  u
416
367
  );
417
- t.push(
418
- a.map((l) => y(l, u.delimiter)).join(u.delimiter)
368
+ c.push(
369
+ f.map((i) => h(i, u.delimiter)).join(u.delimiter)
419
370
  );
420
371
  }
421
- return t;
372
+ return c;
422
373
  }
423
374
  export {
424
- C as arrayToCSV,
425
- h as arrayToCSVRow,
426
- y as escapeCSVValue,
427
- W as formatAggregateRow,
428
- p as formatAggregateTableForCSV,
429
- M as formatCellValue,
430
- Z as formatCurrency,
431
- P as formatDate,
432
- U as formatDateWithColumnSettings,
433
- B as formatNumber,
434
- q as formatNumberCustom,
435
- D as formatNumberWithColumnSettings,
436
- E as formatPercent,
437
- X as formatPivotDataRow,
438
- o as formatPivotTableForCSV,
439
- H as formatRelativeTime,
440
- j as formatRowForExport,
441
- R as formatScientific,
442
- G as formatTableForCSV,
443
- k as generateAggregateHeaders,
444
- z as generatePivotHeaders,
445
- v as generateTableCSV,
446
- J as getTimezoneAbbreviation,
447
- Q as getTimezoneName,
448
- Y as objectsToCSV,
449
- A as parseWithSourceTimezone,
450
- b as resolveTimezone
375
+ H as arrayToCSV,
376
+ S as arrayToCSVRow,
377
+ h as escapeCSVValue,
378
+ j as formatAggregateRow,
379
+ _ as formatAggregateTableForCSV,
380
+ P as formatCellValue,
381
+ z as formatCurrency,
382
+ I as formatDate,
383
+ $ as formatNumber,
384
+ k as formatNumberCustom,
385
+ d as formatNumberWithColumnSettings,
386
+ B as formatPercent,
387
+ O as formatPivotDataRow,
388
+ v as formatPivotTableForCSV,
389
+ N as formatRelativeTime,
390
+ A as formatRowForExport,
391
+ E as formatScientific,
392
+ C as formatTableForCSV,
393
+ G as generateAggregateHeaders,
394
+ U as generatePivotHeaders,
395
+ X as generateTableCSV,
396
+ Y as getTimezoneAbbreviation,
397
+ Z as getTimezoneName,
398
+ K as objectsToCSV,
399
+ F as parseWithSourceTimezone,
400
+ p as resolveTimezone
451
401
  };