react-semaphor 0.1.301 → 0.1.303

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 (66) hide show
  1. package/dist/appearance/index.cjs +1 -0
  2. package/dist/appearance/index.js +9 -0
  3. package/dist/brand-studio/index.cjs +21 -0
  4. package/dist/brand-studio/index.js +1461 -0
  5. package/dist/chunks/dashboard-controls-BCJZOzrL.js +2226 -0
  6. package/dist/chunks/dashboard-controls-CVFoOPti.js +47 -0
  7. package/dist/chunks/dashboard-filter-controls-button-C-e7230k.js +11 -0
  8. package/dist/chunks/{dashboard-filter-controls-button-DjALRkvg.js → dashboard-filter-controls-button-Cfbac4Jw.js} +205 -216
  9. package/dist/chunks/dashboard-json-BM5ywMgp.js +1 -0
  10. package/dist/chunks/{dashboard-json-D-zIG46N.js → dashboard-json-BzvLPhGM.js} +14 -12
  11. package/dist/chunks/dashboard-summary-settings-dialog-BdxKl1UF.js +1 -0
  12. package/dist/chunks/{dashboard-summary-settings-dialog-D-F1eEJI.js → dashboard-summary-settings-dialog-ChK3344r.js} +64 -63
  13. package/dist/chunks/date-formatter-D9Bvw5Qk.js +1 -0
  14. package/dist/chunks/date-formatter-DyIOb6uC.js +333 -0
  15. package/dist/chunks/{edit-dashboard-visual-BjflrL8w.js → edit-dashboard-visual-D725CWD5.js} +6690 -6679
  16. package/dist/chunks/edit-dashboard-visual-nNaZ2IK1.js +183 -0
  17. package/dist/chunks/index-BWjB_9uz.js +1356 -0
  18. package/dist/chunks/index-CJdxSyQq.js +2578 -0
  19. package/dist/chunks/{index-DDA12yqV.js → index-CYWgnME0.js} +48994 -66425
  20. package/dist/chunks/index-D7KJindZ.js +1 -0
  21. package/dist/chunks/index-DFOb_6HB.js +1657 -0
  22. package/dist/chunks/index-DRlMUglg.js +4 -0
  23. package/dist/chunks/palette-B9DJXMGo.js +11 -0
  24. package/dist/chunks/palette-DGOzbtsn.js +43 -0
  25. package/dist/chunks/{resource-management-panel-B2558XA1.js → resource-management-panel-CE0-NcLL.js} +116 -115
  26. package/dist/chunks/resource-management-panel-mJmc5dMT.js +6 -0
  27. package/dist/chunks/rotate-ccw-Bs7YJn10.js +6 -0
  28. package/dist/chunks/rotate-ccw-YsjQwpKm.js +14 -0
  29. package/dist/chunks/save-Bj1y1rug.js +6 -0
  30. package/dist/chunks/save-CUrexoNl.js +21 -0
  31. package/dist/chunks/switch-CiEX68py.js +163 -0
  32. package/dist/chunks/switch-oojO-gal.js +19730 -0
  33. package/dist/chunks/{use-create-flow-overlay-state-BUw_JtLs.js → use-create-flow-overlay-state-BHDKxe7I.js} +396 -412
  34. package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +16 -0
  35. package/dist/chunks/{use-visual-utils-C45OxsOf.js → use-visual-utils-CjFzlR0P.js} +54 -53
  36. package/dist/chunks/use-visual-utils-DYDXMl5v.js +1 -0
  37. package/dist/dashboard/index.cjs +1 -1
  38. package/dist/dashboard/index.js +1 -1
  39. package/dist/format-utils/index.cjs +1 -1
  40. package/dist/format-utils/index.js +2 -2
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.js +210 -207
  43. package/dist/style.css +1 -1
  44. package/dist/surfboard/index.cjs +1 -1
  45. package/dist/surfboard/index.js +2 -2
  46. package/dist/types/appearance.d.ts +176 -0
  47. package/dist/types/brand-studio.d.ts +245 -0
  48. package/dist/types/dashboard.d.ts +134 -0
  49. package/dist/types/main.d.ts +142 -1
  50. package/dist/types/surfboard.d.ts +134 -0
  51. package/dist/types/types.d.ts +139 -0
  52. package/package.json +13 -1
  53. package/dist/chunks/braces-Bhqo4iW1.js +0 -23
  54. package/dist/chunks/braces-BwK7fWd_.js +0 -6
  55. package/dist/chunks/dashboard-controls-BIRiWCUK.js +0 -47
  56. package/dist/chunks/dashboard-controls-DIlnYo96.js +0 -2219
  57. package/dist/chunks/dashboard-filter-controls-button-CK1-mKQh.js +0 -11
  58. package/dist/chunks/dashboard-json-DK4mQ1gS.js +0 -1
  59. package/dist/chunks/dashboard-summary-settings-dialog-DSxNqxFI.js +0 -1
  60. package/dist/chunks/date-formatter-CqXdM6JO.js +0 -1
  61. package/dist/chunks/date-formatter-vkCj9Ct-.js +0 -1982
  62. package/dist/chunks/edit-dashboard-visual-DCsrtJr_.js +0 -193
  63. package/dist/chunks/index-8GnvL1_L.js +0 -1523
  64. package/dist/chunks/resource-management-panel-CKp4_aem.js +0 -6
  65. package/dist/chunks/use-create-flow-overlay-state-CWcCdPbC.js +0 -21
  66. package/dist/chunks/use-visual-utils-DyaThRzf.js +0 -1
@@ -0,0 +1,333 @@
1
+ import { t as l, c as O, g as S, e as _, a as I, m as $, b as x, f as X, d as U, h as R } from "./index-DFOb_6HB.js";
2
+ function M(r, e) {
3
+ const c = l(r), a = l(e), t = c.getTime() - a.getTime();
4
+ return t < 0 ? -1 : t > 0 ? 1 : t;
5
+ }
6
+ function v(r) {
7
+ return O(r, Date.now());
8
+ }
9
+ function A(r, e) {
10
+ const c = l(r), a = l(e), t = c.getFullYear() - a.getFullYear(), f = c.getMonth() - a.getMonth();
11
+ return t * 12 + f;
12
+ }
13
+ function C(r) {
14
+ return (e) => {
15
+ const a = (r ? Math[r] : Math.trunc)(e);
16
+ return a === 0 ? 0 : a;
17
+ };
18
+ }
19
+ function V(r, e) {
20
+ return +l(r) - +l(e);
21
+ }
22
+ function Y(r) {
23
+ const e = l(r);
24
+ return e.setHours(23, 59, 59, 999), e;
25
+ }
26
+ function B(r) {
27
+ const e = l(r), c = e.getMonth();
28
+ return e.setFullYear(e.getFullYear(), c + 1, 0), e.setHours(23, 59, 59, 999), e;
29
+ }
30
+ function W(r) {
31
+ const e = l(r);
32
+ return +Y(e) == +B(e);
33
+ }
34
+ function k(r, e) {
35
+ const c = l(r), a = l(e), t = M(c, a), f = Math.abs(
36
+ A(c, a)
37
+ );
38
+ let i;
39
+ if (f < 1)
40
+ i = 0;
41
+ else {
42
+ c.getMonth() === 1 && c.getDate() > 27 && c.setDate(30), c.setMonth(c.getMonth() - t * f);
43
+ let u = M(c, a) === -t;
44
+ W(l(r)) && f === 1 && M(r, a) === 1 && (u = !1), i = t * (f - Number(u));
45
+ }
46
+ return i === 0 ? 0 : i;
47
+ }
48
+ function H(r, e, c) {
49
+ const a = V(r, e) / 1e3;
50
+ return C(c == null ? void 0 : c.roundingMethod)(a);
51
+ }
52
+ function E(r, e, c) {
53
+ const a = S(), t = (c == null ? void 0 : c.locale) ?? a.locale ?? _, f = 2520, i = M(r, e);
54
+ if (isNaN(i))
55
+ throw new RangeError("Invalid time value");
56
+ const u = Object.assign({}, c, {
57
+ addSuffix: c == null ? void 0 : c.addSuffix,
58
+ comparison: i
59
+ });
60
+ let m, D;
61
+ i > 0 ? (m = l(e), D = l(r)) : (m = l(r), D = l(e));
62
+ const s = H(D, m), w = (I(D) - I(m)) / 1e3, n = Math.round((s - w) / 60);
63
+ let d;
64
+ if (n < 2)
65
+ return c != null && c.includeSeconds ? s < 5 ? t.formatDistance("lessThanXSeconds", 5, u) : s < 10 ? t.formatDistance("lessThanXSeconds", 10, u) : s < 20 ? t.formatDistance("lessThanXSeconds", 20, u) : s < 40 ? t.formatDistance("halfAMinute", 0, u) : s < 60 ? t.formatDistance("lessThanXMinutes", 1, u) : t.formatDistance("xMinutes", 1, u) : n === 0 ? t.formatDistance("lessThanXMinutes", 1, u) : t.formatDistance("xMinutes", n, u);
66
+ if (n < 45)
67
+ return t.formatDistance("xMinutes", n, u);
68
+ if (n < 90)
69
+ return t.formatDistance("aboutXHours", 1, u);
70
+ if (n < $) {
71
+ const g = Math.round(n / 60);
72
+ return t.formatDistance("aboutXHours", g, u);
73
+ } else {
74
+ if (n < f)
75
+ return t.formatDistance("xDays", 1, u);
76
+ if (n < x) {
77
+ const g = Math.round(n / $);
78
+ return t.formatDistance("xDays", g, u);
79
+ } else if (n < x * 2)
80
+ return d = Math.round(n / x), t.formatDistance("aboutXMonths", d, u);
81
+ }
82
+ if (d = k(D, m), d < 12) {
83
+ const g = Math.round(n / x);
84
+ return t.formatDistance("xMonths", g, u);
85
+ } else {
86
+ const g = d % 12, y = Math.trunc(d / 12);
87
+ return g < 3 ? t.formatDistance("aboutXYears", y, u) : g < 9 ? t.formatDistance("overXYears", y, u) : t.formatDistance("almostXYears", y + 1, u);
88
+ }
89
+ }
90
+ function j(r, e) {
91
+ return E(r, v(r), e);
92
+ }
93
+ function T(r) {
94
+ if (!r) return !1;
95
+ const e = r.toLowerCase().replace("_", "-");
96
+ return e === "en-in" || e.startsWith("en-in-");
97
+ }
98
+ function G(r, e) {
99
+ const c = Math.abs(r);
100
+ return c >= 1e12 ? { divisor: 1e12, suffix: "T" } : c >= 1e9 ? { divisor: 1e9, suffix: "B" } : T(e) && c >= 1e7 ? { divisor: 1e7, suffix: "Cr" } : c >= 1e6 ? { divisor: 1e6, suffix: "M" } : T(e) && c >= 1e5 ? { divisor: 1e5, suffix: "L" } : c >= 1e3 ? { divisor: 1e3, suffix: "K" } : { divisor: 1, suffix: "" };
101
+ }
102
+ function N(r, e) {
103
+ try {
104
+ const c = h(e);
105
+ return G(r, c);
106
+ } catch {
107
+ return G(r, "en-US");
108
+ }
109
+ }
110
+ function K(r) {
111
+ try {
112
+ return new Intl.NumberFormat(r), !0;
113
+ } catch {
114
+ return !1;
115
+ }
116
+ }
117
+ function h(r) {
118
+ return r && K(r) ? r : "en-US";
119
+ }
120
+ function L(r, e) {
121
+ if (r == null || isNaN(r))
122
+ return "";
123
+ const c = h(e == null ? void 0 : e.locale);
124
+ let a = r;
125
+ if (e != null && e.multiplyBy && (a *= e.multiplyBy), e != null && e.useSuffix) {
126
+ const { divisor: f, suffix: i } = N(a, c);
127
+ a = a / f;
128
+ const u = new Intl.NumberFormat(c, {
129
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
130
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
131
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
132
+ }).format(a);
133
+ return `${(e == null ? void 0 : e.prefix) ?? ""}${u}${i}${(e == null ? void 0 : e.suffix) ?? ""}`;
134
+ }
135
+ const t = new Intl.NumberFormat(c, {
136
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
137
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
138
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
139
+ }).format(a);
140
+ if (e != null && e.negativeInParentheses && a < 0) {
141
+ const f = t.replace("-", "");
142
+ return `(${(e == null ? void 0 : e.prefix) ?? ""}${f}${(e == null ? void 0 : e.suffix) ?? ""})`;
143
+ }
144
+ return `${(e == null ? void 0 : e.prefix) ?? ""}${t}${(e == null ? void 0 : e.suffix) ?? ""}`;
145
+ }
146
+ function q(r, e) {
147
+ if (r == null || isNaN(r))
148
+ return "";
149
+ const c = h(e == null ? void 0 : e.locale), a = (e == null ? void 0 : e.currency) || "USD", t = r < 0, f = !!(e != null && e.negativeInParentheses && t), i = f ? Math.abs(r) : r;
150
+ try {
151
+ if (e != null && e.useSuffix) {
152
+ const { divisor: m, suffix: D } = N(i, c), s = i / m, n = `${new Intl.NumberFormat(c, {
153
+ style: "currency",
154
+ currency: a,
155
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
156
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
157
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
158
+ }).format(s)}${D}`;
159
+ return f ? `(${n})` : n;
160
+ }
161
+ const u = new Intl.NumberFormat(c, {
162
+ style: "currency",
163
+ currency: a,
164
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
165
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
166
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
167
+ }).format(i);
168
+ return f ? `(${u})` : u;
169
+ } catch {
170
+ const u = Math.abs(r), m = e != null && e.useSuffix ? N(u, c) : { divisor: 1, suffix: "" }, D = L(
171
+ u / m.divisor,
172
+ {
173
+ locale: c,
174
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
175
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
176
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
177
+ }
178
+ ), s = `${a} ${D}${m.suffix}`;
179
+ return t ? e != null && e.negativeInParentheses ? `(${s})` : `-${s}` : s;
180
+ }
181
+ }
182
+ function J(r, e) {
183
+ if (r == null || isNaN(r))
184
+ return "";
185
+ const c = h(e == null ? void 0 : e.locale), t = (e == null ? void 0 : e.alreadyPercent) ?? (e == null ? void 0 : e.percentValueMode) === "whole" ? r / 100 : r;
186
+ return new Intl.NumberFormat(c, {
187
+ style: "percent",
188
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
189
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
190
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
191
+ }).format(t);
192
+ }
193
+ function P(r, e) {
194
+ if (r == null || isNaN(r))
195
+ return "";
196
+ const c = h(e == null ? void 0 : e.locale);
197
+ return new Intl.NumberFormat(c, {
198
+ notation: "scientific",
199
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
200
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
201
+ }).format(r);
202
+ }
203
+ function F(r, e, c = "en-US") {
204
+ if (r == null || isNaN(r))
205
+ return "";
206
+ const a = h((e == null ? void 0 : e.locale) || c), t = (e == null ? void 0 : e.style) || "decimal";
207
+ if (t === "percent") {
208
+ const i = ((e == null ? void 0 : e.percentValueMode) ?? "whole") === "whole" ? r / 100 : r;
209
+ return new Intl.NumberFormat(a, {
210
+ style: "percent",
211
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
212
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
213
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
214
+ }).format(i);
215
+ }
216
+ return t === "currency" ? new Intl.NumberFormat(a, {
217
+ style: "currency",
218
+ currency: (e == null ? void 0 : e.currency) || "USD",
219
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
220
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
221
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
222
+ }).format(r) : t === "scientific" ? P(r, {
223
+ locale: a,
224
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
225
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
226
+ }) : new Intl.NumberFormat(a, {
227
+ minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
228
+ maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
229
+ useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
230
+ }).format(r);
231
+ }
232
+ function b(r, e, c) {
233
+ const a = {
234
+ style: e === "currency" ? "currency" : e === "percent" ? "percent" : "decimal",
235
+ locale: c == null ? void 0 : c.locale,
236
+ currency: c == null ? void 0 : c.currency,
237
+ minimumFractionDigits: c == null ? void 0 : c.decimalPlaces,
238
+ maximumFractionDigits: c == null ? void 0 : c.decimalPlaces,
239
+ useSuffix: c == null ? void 0 : c.useSuffix,
240
+ prefix: c == null ? void 0 : c.prefix,
241
+ suffix: c == null ? void 0 : c.suffix,
242
+ negativeInParentheses: c == null ? void 0 : c.negativeInParentheses,
243
+ multiplyBy: c == null ? void 0 : c.multiplyBy
244
+ };
245
+ switch (e) {
246
+ case "currency":
247
+ return q(r, a);
248
+ case "percent":
249
+ return J(r, a);
250
+ case "scientific":
251
+ return P(r, a);
252
+ default:
253
+ return L(r, a);
254
+ }
255
+ }
256
+ function p(r, e) {
257
+ return r && r !== "auto" ? r : e;
258
+ }
259
+ function o(r, e = /* @__PURE__ */ new Date()) {
260
+ try {
261
+ const c = {
262
+ timeZone: r,
263
+ timeZoneName: "short"
264
+ }, t = new Intl.DateTimeFormat("en-US", c).formatToParts(e).find((f) => f.type === "timeZoneName");
265
+ return (t == null ? void 0 : t.value) || r;
266
+ } catch {
267
+ return r;
268
+ }
269
+ }
270
+ function ee(r) {
271
+ try {
272
+ const e = {
273
+ timeZone: r,
274
+ timeZoneName: "long"
275
+ }, a = new Intl.DateTimeFormat("en-US", e).formatToParts(
276
+ /* @__PURE__ */ new Date()
277
+ ).find((t) => t.type === "timeZoneName");
278
+ return (a == null ? void 0 : a.value) || r;
279
+ } catch {
280
+ return r;
281
+ }
282
+ }
283
+ function Z(r, e = "auto") {
284
+ if (!r)
285
+ return /* @__PURE__ */ new Date(NaN);
286
+ const c = r.endsWith("Z"), a = /[+-]\d{2}:?\d{2}$/.test(r), t = /\([A-Z]{3,4}\)$/.test(r);
287
+ if (e === "auto")
288
+ return c || a || t ? new Date(r) : /* @__PURE__ */ new Date(r + "Z");
289
+ if (e === "local") {
290
+ if (c || a) {
291
+ const f = r.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
292
+ return new Date(f);
293
+ }
294
+ return new Date(r);
295
+ } else return e === "UTC" ? c ? new Date(r) : a ? new Date(r) : /* @__PURE__ */ new Date(r + "Z") : c || a || t ? new Date(r) : R(r, e);
296
+ }
297
+ const Q = "MM/dd/yyyy", re = (r, e, c, a = "auto") => {
298
+ if (!r)
299
+ return "";
300
+ try {
301
+ const t = Z(r, a);
302
+ if (isNaN(t.getTime()))
303
+ return r;
304
+ const i = (e && e.trim() ? e : Q).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
305
+ return c && c !== "auto" ? X(t, c, i) : U(t, i);
306
+ } catch (t) {
307
+ return console.error("Date formatting error:", t), r;
308
+ }
309
+ }, ce = (r, e = "auto") => {
310
+ if (!r)
311
+ return "";
312
+ try {
313
+ const c = Z(r, e);
314
+ return isNaN(c.getTime()) ? r : j(c, { addSuffix: !0 });
315
+ } catch (c) {
316
+ return console.error("Relative time formatting error:", c), r;
317
+ }
318
+ };
319
+ export {
320
+ ce as a,
321
+ re as b,
322
+ L as c,
323
+ q as d,
324
+ J as e,
325
+ F as f,
326
+ P as g,
327
+ b as h,
328
+ o as i,
329
+ ee as j,
330
+ j as k,
331
+ Z as p,
332
+ p as r
333
+ };