react-semaphor 0.1.601 → 0.1.603
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.
- package/dist/analytics-protocol/index.js +415 -375
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
- package/dist/chunks/{assistant-chat-BE0XXzZP.js → assistant-chat-B6hNQI1t.js} +146 -146
- package/dist/chunks/{bookmark-impact-DXDAN5AY.js → bookmark-impact-Ba2PLcGp.js} +3 -3
- package/dist/chunks/{bookmark-state-BMyB3Tb6.js → bookmark-state-n7AaNzR_.js} +517 -516
- package/dist/chunks/{card-filter-builder-CE0-YVN5.js → card-filter-builder-Y22HizVx.js} +474 -474
- package/dist/chunks/{comparison-window-caption-Dxj2CHOa.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
- package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
- package/dist/chunks/{dashboard-mJKPFRbb.js → dashboard-BghI99oY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CntwKyiZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +725 -716
- package/dist/chunks/{dashboard-controls-XO089DMg.js → dashboard-controls-CtFXlyjV.js} +53 -53
- package/dist/chunks/{dashboard-json-CQRiydUv.js → dashboard-json-DfGBUtCd.js} +5 -5
- package/dist/chunks/dates-BnrXF4bb.js +185 -0
- package/dist/chunks/{edit-dashboard-visual-f-Dm-BLR.js → edit-dashboard-visual-oxt3x1wb.js} +8081 -8268
- package/dist/chunks/{filter-line-CKNMyNTQ.js → filter-line-Cy5YYqRL.js} +27 -27
- package/dist/chunks/{filter-reach-copy-B8GGyVuR.js → filter-reach-copy-CE_ZX147.js} +1786 -2214
- package/dist/chunks/{filter-value-text-CRtKecI5.js → filter-value-text-fWvSDwkl.js} +11 -11
- package/dist/chunks/{index-DoPApnxg.js → index-D5rxbtS4.js} +24 -24
- package/dist/chunks/{layout-grid-CiSCZdIr.js → layout-grid-9LndRoLa.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-myf3D3Qx.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
- package/dist/chunks/{matrix-operation-contract-C1SuOHLZ.js → matrix-operation-contract-DPBj69D8.js} +518 -514
- package/dist/chunks/{metric-comparison-Cm0G893W.js → metric-comparison-B0FR-Q8I.js} +184 -125
- package/dist/chunks/{paintbrush-DQIwqlck.js → paintbrush-58FQYY-y.js} +1 -1
- package/dist/chunks/{palette-Cun747Rg.js → palette-Be62Tkoa.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-C1Dyx8du.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
- package/dist/chunks/{pivot-result-identity-CBS-ssEp.js → pivot-result-identity-CAP4--iq.js} +1 -1
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
- package/dist/chunks/{report-preferences-dialog-SDZEcG2x.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
- package/dist/chunks/{report-runtime-context-BbedQdtc.js → report-runtime-context-c77_KF9v.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-DRBS0eRa.js → resolve-dashboard-input-context-Rtl1ffmE.js} +8808 -7291
- package/dist/chunks/{save-Dj5bjm7P.js → save-C5A0JnEV.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DWVlJcsa.js → saved-dashboard-context-tcyTU8jm.js} +199 -213
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
- package/dist/chunks/{semaphor-ready-indicator-OFOoAY-A.js → semaphor-ready-indicator-FBvunj6S.js} +37894 -35726
- package/dist/chunks/{shelf-drop-preview-context-2swWypXu.js → shelf-drop-preview-context-QKStrcK9.js} +54 -54
- package/dist/chunks/{stored-dashboard-NtOuEX6a.js → stored-dashboard-CHozcAY9.js} +770 -743
- package/dist/chunks/{style-sheet-parts-Qv4UcLAo.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
- package/dist/chunks/{table-export-sheet-Do7ZB0_F.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
- package/dist/chunks/{token-types-Dy_aXO-U.js → token-types-XbM6QByy.js} +1 -1
- package/dist/chunks/{upload-Bq-puSVy.js → upload-H15d7uHK.js} +1 -1
- package/dist/chunks/{validators-C7DFk3QK.js → validators-Baf3VIf5.js} +5 -5
- package/dist/chunks/{variable-draft-Cy03qnEi.js → variable-draft-C2y8Jp6Z.js} +27 -28
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +3392 -2761
- package/dist/format-utils/index.js +205 -204
- package/dist/index.js +73 -75
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/dashboard-web-component.d.ts +7 -0
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +1 -1
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/query-context/assemble-card-query.d.ts +6 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +30 -1
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +15 -0
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +129 -0
- package/dist/types/shared/dashboard-authoring/calculations/resolve-dashboard-field-copies.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/calculations/tokens.d.ts +36 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/calculation-change.d.ts +399 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +165 -360
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +23 -2
- package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +143 -266
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +158 -0
- package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +71 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +17 -6
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/types/shared/usage-events/details.d.ts +2 -2
- package/dist/types/shared/usage-events/envelope.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/dates-B-Urp5OD.js +0 -164
- package/dist/chunks/matrix-member-presentation-g0c_NpDW.js +0 -258
- package/dist/chunks/raw-temporal-value-DN_l-Tss.js +0 -454
- package/dist/chunks/selection-filter-compiler-DmAr7yqC.js +0 -131
package/dist/chunks/{report-preferences-dialog-SDZEcG2x.js → report-preferences-dialog-uJp9GBTM.js}
RENAMED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as r, Fragment as M, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import He, { useMemo as
|
|
3
|
-
import { b as
|
|
2
|
+
import He, { useMemo as B, useState as I, useEffect as j, lazy as ae, Suspense as Q, useRef as L, useLayoutEffect as ee, useCallback as P, useId as $ } from "react";
|
|
3
|
+
import { b as Ke, b8 as be, bk as qe, bl as Ge, u as D, bm as ze, Y as Je, W as Xe, bn as Ze, bo as Ye, bp as Qe, bq as et, br as J, bs as Le, bt as ge, bu as tt, ad as X, ac as at, bv as rt, bw as nt, ae as ve, af as st, bx as lt, E as it, F as ot, S as dt, B as ct, a as ut, U as mt, by as ht, D as ft, A as bt, C as pt, bz as gt, bA as vt, bB as ye, bC as ne, bD as yt, i as St, j as wt, k as xt, l as Ct, m as Se, n as we, bE as Tt, bF as pe, bG as F, bH as Nt, bI as Et, bJ as It, bK as At, bL as Dt } from "./semaphor-ready-indicator-FBvunj6S.js";
|
|
4
4
|
import { j as kt, c as U } from "./pickers-DkqmtnTL.js";
|
|
5
|
-
import {
|
|
5
|
+
import { L as _t } from "./bookmark-state-n7AaNzR_.js";
|
|
6
6
|
import { r as Pt, a as Re } from "./availability-Bp5Gfu1I.js";
|
|
7
|
-
import { s as zt } from "./resolve-dashboard-input-context-
|
|
8
|
-
import { B as z, Z as Lt, _ as Rt, $ as Ut, a0 as Ft, a1 as Ot, a2 as Bt, s as G, e as jt, f as Mt, h as Vt, j as xe, L as Ue, y as de, z as ce, A as ue, D as me, E as O, T as Wt, k as $t, l as
|
|
9
|
-
import "./validators-
|
|
10
|
-
import "./matrix-operation-contract-
|
|
11
|
-
import "./analytics-base-schemas-
|
|
7
|
+
import { s as zt } from "./resolve-dashboard-input-context-Rtl1ffmE.js";
|
|
8
|
+
import { B as z, Z as Lt, _ as Rt, $ as Ut, a0 as Ft, a1 as Ot, a2 as Bt, s as G, e as jt, f as Mt, h as Vt, j as xe, L as Ue, y as de, z as ce, A as ue, D as me, E as O, T as Wt, k as $t, l as Ce, n as Te } from "./style-sheet-parts-CDCG-8Ej.js";
|
|
9
|
+
import "./validators-Baf3VIf5.js";
|
|
10
|
+
import "./matrix-operation-contract-DPBj69D8.js";
|
|
11
|
+
import "./analytics-base-schemas-DsUh5Q3C.js";
|
|
12
12
|
import { parseValueFormatPreferencesResponse as Ht, canonicalizeSupportedLocale as Fe, getSupportedCurrencyCodes as Kt, canonicalizeSupportedCurrencyCode as qt } from "../value-format-preferences/index.js";
|
|
13
|
-
import {
|
|
14
|
-
import { a as Jt } from "./report-runtime-context-
|
|
15
|
-
import {
|
|
13
|
+
import { a as Gt } from "./filter-reach-copy-CE_ZX147.js";
|
|
14
|
+
import { a as Jt } from "./report-runtime-context-c77_KF9v.js";
|
|
15
|
+
import { at as Z, aA as H } from "./pivot-result-contract-expectations-BYqAmG9n.js";
|
|
16
16
|
function Xt() {
|
|
17
17
|
return /* @__PURE__ */ r(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
20
|
role: "dashboard-plus-main",
|
|
21
21
|
className: "flex min-h-0 grow basis-0 overflow-hidden",
|
|
22
|
-
children: /* @__PURE__ */ r("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: /* @__PURE__ */ r(
|
|
22
|
+
children: /* @__PURE__ */ r("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: /* @__PURE__ */ r(Ke, {}) })
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
}
|
|
@@ -49,22 +49,22 @@ let Ne = 0;
|
|
|
49
49
|
function Ee(e, a) {
|
|
50
50
|
Ne += 1;
|
|
51
51
|
const { name: t, layout: n } = Re(a == null ? void 0 : a.config);
|
|
52
|
-
return { ...
|
|
52
|
+
return { ...Ge(n), id: Ne, callerKey: e, assistantName: t };
|
|
53
53
|
}
|
|
54
54
|
function ea({
|
|
55
55
|
children: e,
|
|
56
56
|
authToken: a
|
|
57
57
|
}) {
|
|
58
|
-
const t = be(), n =
|
|
58
|
+
const t = be(), n = B(
|
|
59
59
|
() => a === void 0 ? t.tokenProps : aa(a),
|
|
60
60
|
[a, t.tokenProps]
|
|
61
|
-
), s =
|
|
61
|
+
), s = B(() => Yt(n), [n]), i = B(
|
|
62
62
|
() => Qt(n).available,
|
|
63
63
|
[n]
|
|
64
64
|
), [l, o] = I(() => Ee(s, n));
|
|
65
65
|
l.callerKey !== s && o(Ee(s, n)), ra(l);
|
|
66
|
-
const h =
|
|
67
|
-
return /* @__PURE__ */ r(
|
|
66
|
+
const h = B(() => ({ instance: l, available: i }), [l, i]);
|
|
67
|
+
return /* @__PURE__ */ r(qe.Provider, { value: h, children: e });
|
|
68
68
|
}
|
|
69
69
|
function ta({ children: e }) {
|
|
70
70
|
return ze() ? /* @__PURE__ */ r(M, { children: e }) : /* @__PURE__ */ r(ea, { children: e });
|
|
@@ -78,7 +78,7 @@ function aa(e) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
function ra(e) {
|
|
81
|
-
|
|
81
|
+
j(() => {
|
|
82
82
|
const a = (n, s) => {
|
|
83
83
|
const i = e.store.getState().focus;
|
|
84
84
|
i && !na(i, n, s) && e.clearFocus();
|
|
@@ -93,9 +93,9 @@ function na(e, a, t) {
|
|
|
93
93
|
const n = t ? _t(t, e.cardId) : void 0;
|
|
94
94
|
return !!n && n.sheet.id === e.sheetId;
|
|
95
95
|
}
|
|
96
|
-
const sa = ae(() => import("./assistant-chat-
|
|
97
|
-
function
|
|
98
|
-
const e =
|
|
96
|
+
const sa = ae(() => import("./assistant-chat-B6hNQI1t.js"));
|
|
97
|
+
function Qa() {
|
|
98
|
+
const e = Je(), a = Xe();
|
|
99
99
|
if (!e.available) return null;
|
|
100
100
|
const t = a !== "lg";
|
|
101
101
|
return /* @__PURE__ */ d(
|
|
@@ -109,7 +109,7 @@ function Ya() {
|
|
|
109
109
|
onClick: e.toggle,
|
|
110
110
|
className: t ? "w-7 px-0" : void 0,
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */ r(
|
|
112
|
+
/* @__PURE__ */ r(Ze, { className: "h-3.5 w-3.5" }),
|
|
113
113
|
!t && e.assistantName
|
|
114
114
|
]
|
|
115
115
|
}
|
|
@@ -123,10 +123,10 @@ const la = {
|
|
|
123
123
|
"full-page": "absolute inset-0 z-30"
|
|
124
124
|
}, ia = "absolute left-0 top-0 z-30 max-h-[var(--assistant-beside-max-h)] max-w-[var(--assistant-beside-max-w)] rounded-card border border-border shadow-lg", oa = 640, q = 8;
|
|
125
125
|
function da({ surface: e = "dashboard" } = {}) {
|
|
126
|
-
const a = ze(), { isOpen: t, mounted: n, storedLayout: s, width: i, beside: l, besideSize: o, focusCardId: h, askCount: w } =
|
|
127
|
-
(a == null ? void 0 : a.instance.store) ??
|
|
128
|
-
|
|
129
|
-
var
|
|
126
|
+
const a = ze(), { isOpen: t, mounted: n, storedLayout: s, width: i, beside: l, besideSize: o, focusCardId: h, askCount: w } = Ye(
|
|
127
|
+
(a == null ? void 0 : a.instance.store) ?? et,
|
|
128
|
+
Qe((f) => {
|
|
129
|
+
var v;
|
|
130
130
|
return {
|
|
131
131
|
isOpen: f.isOpen,
|
|
132
132
|
mounted: f.mounted,
|
|
@@ -134,7 +134,7 @@ function da({ surface: e = "dashboard" } = {}) {
|
|
|
134
134
|
width: f.width,
|
|
135
135
|
beside: f.beside,
|
|
136
136
|
besideSize: f.besideSize,
|
|
137
|
-
focusCardId: (
|
|
137
|
+
focusCardId: (v = f.focus) == null ? void 0 : v.cardId,
|
|
138
138
|
askCount: f.askCount
|
|
139
139
|
};
|
|
140
140
|
})
|
|
@@ -165,13 +165,13 @@ function da({ surface: e = "dashboard" } = {}) {
|
|
|
165
165
|
onKeyDown: c === "beside-card" ? (f) => {
|
|
166
166
|
if (f.key !== "Escape" || f.defaultPrevented || !(f.target instanceof Node) || !f.currentTarget.contains(f.target)) return;
|
|
167
167
|
f.preventDefault();
|
|
168
|
-
const
|
|
169
|
-
a.instance.close(),
|
|
168
|
+
const v = b.cardActions();
|
|
169
|
+
a.instance.close(), v == null || v.focus();
|
|
170
170
|
} : void 0,
|
|
171
171
|
children: [
|
|
172
172
|
m ? /* @__PURE__ */ r(fa, { instance: a.instance, side: c === "docked-left" ? "right" : "left", width: i }) : null,
|
|
173
173
|
c === "beside-card" ? /* @__PURE__ */ r(ha, { instance: a.instance, size: o, side: b.handleSide }) : null,
|
|
174
|
-
/* @__PURE__ */ r(
|
|
174
|
+
/* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(sa, { instance: a.instance, surface: e, placement: c }, a.instance.id) })
|
|
175
175
|
]
|
|
176
176
|
}
|
|
177
177
|
);
|
|
@@ -198,15 +198,15 @@ function ua(e, a) {
|
|
|
198
198
|
Ut({ padding: q }),
|
|
199
199
|
Ft({
|
|
200
200
|
padding: q,
|
|
201
|
-
apply: ({ availableWidth: m, availableHeight: f, elements:
|
|
202
|
-
|
|
201
|
+
apply: ({ availableWidth: m, availableHeight: f, elements: v }) => {
|
|
202
|
+
v.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, m)}px`), v.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, f)}px`);
|
|
203
203
|
}
|
|
204
204
|
}),
|
|
205
205
|
Ot()
|
|
206
206
|
],
|
|
207
|
-
whileElementsMounted: (m, f,
|
|
207
|
+
whileElementsMounted: (m, f, v) => Bt(m, f, () => {
|
|
208
208
|
const E = ma(m, f);
|
|
209
|
-
n(E), E === null && i(l.current),
|
|
209
|
+
n(E), E === null && i(l.current), v();
|
|
210
210
|
})
|
|
211
211
|
}), c = w.floating;
|
|
212
212
|
return ee(() => {
|
|
@@ -342,7 +342,7 @@ function fa({ instance: e, side: a, width: t }) {
|
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
344
|
function ba(e) {
|
|
345
|
-
const a =
|
|
345
|
+
const a = tt();
|
|
346
346
|
return P(
|
|
347
347
|
async (t, n) => {
|
|
348
348
|
const s = D.getState();
|
|
@@ -358,7 +358,7 @@ function ba(e) {
|
|
|
358
358
|
const h = await a(o, { reuseLoaded: !0 }).catch((w) => {
|
|
359
359
|
console.warn("Applying the change without refreshed semantic metadata:", w);
|
|
360
360
|
});
|
|
361
|
-
|
|
361
|
+
at(l, h);
|
|
362
362
|
}
|
|
363
363
|
return n != null && n.stillWanted && !n.stillWanted() ? { ok: !1, reason: "dropped" } : e() ? D.getState().actions.applyProposal({ ...t, semanticExecutionPayload: l }) : { ok: !1, reason: "not_editable", message: X.no_save };
|
|
364
364
|
},
|
|
@@ -366,12 +366,12 @@ function ba(e) {
|
|
|
366
366
|
);
|
|
367
367
|
}
|
|
368
368
|
function pa(e) {
|
|
369
|
-
const { canEditDashboard: a, isInspectionMode: t } =
|
|
369
|
+
const { canEditDashboard: a, isInspectionMode: t } = rt(), n = nt(), s = D(ve), i = e && n && a === !0 && !t, l = L(i);
|
|
370
370
|
ee(() => {
|
|
371
371
|
l.current = i;
|
|
372
372
|
});
|
|
373
373
|
const o = P(
|
|
374
|
-
() => l.current &&
|
|
374
|
+
() => l.current && ve(D.getState()),
|
|
375
375
|
[]
|
|
376
376
|
);
|
|
377
377
|
return { canChange: i && s, canChangeNow: o };
|
|
@@ -397,9 +397,9 @@ function ga({
|
|
|
397
397
|
}), i = ba(n), [l, o] = I(null), h = L(/* @__PURE__ */ new Map()), w = L(/* @__PURE__ */ new Map()), x = L(Promise.resolve()), u = L({ apply: i, onLifecycleEvent: a });
|
|
398
398
|
ee(() => {
|
|
399
399
|
u.current = { apply: i, onLifecycleEvent: a };
|
|
400
|
-
}),
|
|
400
|
+
}), j(() => {
|
|
401
401
|
e.setScreenState({ eligible: t, ...s ? { dashboardId: s } : {} });
|
|
402
|
-
}, [e, t, s]),
|
|
402
|
+
}, [e, t, s]), j(
|
|
403
403
|
() => D.subscribe((c, S) => {
|
|
404
404
|
if (c.editSessionEpoch !== S.editSessionEpoch) {
|
|
405
405
|
h.current.clear(), o(null);
|
|
@@ -410,29 +410,29 @@ function ga({
|
|
|
410
410
|
f !== c.dashboard && h.current.delete(m);
|
|
411
411
|
}),
|
|
412
412
|
[]
|
|
413
|
-
),
|
|
413
|
+
), j(() => {
|
|
414
414
|
const c = (m) => {
|
|
415
415
|
const f = D.getState().dashboard;
|
|
416
416
|
if (!f || f.id !== m.dashboardId) return;
|
|
417
|
-
const
|
|
418
|
-
h.current.set(
|
|
417
|
+
const v = Sa();
|
|
418
|
+
h.current.set(v, f), e.answerCopyRequest({
|
|
419
419
|
kind: "uploaded",
|
|
420
420
|
screenId: e.screenId,
|
|
421
421
|
requestId: m.requestId,
|
|
422
|
-
revisionId:
|
|
422
|
+
revisionId: v,
|
|
423
423
|
dashboard: f
|
|
424
424
|
});
|
|
425
425
|
}, S = async (m, f) => {
|
|
426
|
-
var p,
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
e.reportOutcome({ screenId: e.screenId, deliveryId: m.deliveryId, outcome:
|
|
426
|
+
var p, y, T;
|
|
427
|
+
const v = w.current.get(m.deliveryId);
|
|
428
|
+
if (v) {
|
|
429
|
+
e.reportOutcome({ screenId: e.screenId, deliveryId: m.deliveryId, outcome: v });
|
|
430
430
|
return;
|
|
431
431
|
}
|
|
432
432
|
const E = h.current.get(m.revisionId), A = () => !E || h.current.get(m.revisionId) !== E ? "dashboard_changed" : performance.now() < f + m.applyWithinMs ? null : "expired", _ = A();
|
|
433
433
|
let k;
|
|
434
434
|
if (_ || !E)
|
|
435
|
-
k =
|
|
435
|
+
k = Y(_ ?? "dashboard_changed");
|
|
436
436
|
else {
|
|
437
437
|
let g = "expired";
|
|
438
438
|
const V = await u.current.apply(
|
|
@@ -444,11 +444,11 @@ function ga({
|
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
);
|
|
447
|
-
k =
|
|
447
|
+
k = ya(V, g);
|
|
448
448
|
}
|
|
449
449
|
if (w.current.set(m.deliveryId, k), e.reportOutcome({ screenId: e.screenId, deliveryId: m.deliveryId, outcome: k }), k.status !== "applied") return;
|
|
450
450
|
const N = ((p = D.getState().dashboard) == null ? void 0 : p.id) ?? "";
|
|
451
|
-
o({ deliveryId: m.deliveryId, proposalId: m.proposalId, summary: m.summary, dashboardId: N, words: null }), (
|
|
451
|
+
o({ deliveryId: m.deliveryId, proposalId: m.proposalId, summary: m.summary, dashboardId: N, words: null }), (T = (y = u.current).onLifecycleEvent) == null || T.call(y, {
|
|
452
452
|
type: "dashboard:change-applied",
|
|
453
453
|
dashboardId: N,
|
|
454
454
|
payload: { deliveryId: m.deliveryId, summary: m.summary }
|
|
@@ -461,7 +461,7 @@ function ga({
|
|
|
461
461
|
}
|
|
462
462
|
const f = performance.now();
|
|
463
463
|
x.current = x.current.then(
|
|
464
|
-
() => S(m, f).catch((
|
|
464
|
+
() => S(m, f).catch((v) => console.error("[live-screen] a delivery failed", v))
|
|
465
465
|
);
|
|
466
466
|
});
|
|
467
467
|
}, [e]);
|
|
@@ -475,10 +475,10 @@ function ga({
|
|
|
475
475
|
payload: { deliveryId: l.deliveryId, summary: l.summary }
|
|
476
476
|
}), o(null)) : c.reason === "changed_since" ? o({ ...l, words: "changed_since" }) : c.reason === "not_editable" ? o({ ...l, words: "not_editable" }) : o(null);
|
|
477
477
|
}, [l]);
|
|
478
|
-
return l ? /* @__PURE__ */ r(
|
|
478
|
+
return l ? /* @__PURE__ */ r(va, { note: l, onUndo: b }) : null;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
const t = D((l) =>
|
|
480
|
+
function va({ note: e, onUndo: a }) {
|
|
481
|
+
const t = D((l) => st(l, e.proposalId)), n = D((l) => l.isVisualEditing);
|
|
482
482
|
if (t === "none" && e.words === null) return null;
|
|
483
483
|
const s = e.words === "changed_since" || t === "changed_since", i = s ? "changed_since" : e.words === "not_editable" ? "not_editable" : t;
|
|
484
484
|
return /* @__PURE__ */ d(
|
|
@@ -505,7 +505,7 @@ function ya({ note: e, onUndo: a }) {
|
|
|
505
505
|
title: n ? K.closeEditorToUndo : void 0,
|
|
506
506
|
onClick: a,
|
|
507
507
|
children: [
|
|
508
|
-
/* @__PURE__ */ r(
|
|
508
|
+
/* @__PURE__ */ r(lt, { className: "h-3 w-3" }),
|
|
509
509
|
K.undo
|
|
510
510
|
]
|
|
511
511
|
}
|
|
@@ -515,43 +515,43 @@ function ya({ note: e, onUndo: a }) {
|
|
|
515
515
|
}
|
|
516
516
|
);
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function ya(e, a) {
|
|
519
519
|
if (e.ok) return { status: "applied" };
|
|
520
520
|
switch (e.reason) {
|
|
521
521
|
case "dashboard_changed":
|
|
522
522
|
case "not_editable":
|
|
523
|
-
return
|
|
523
|
+
return Y(e.reason);
|
|
524
524
|
case "refused":
|
|
525
525
|
return { status: "not_applied", reason: "refused", message: (e.message || Be.refused).slice(0, 500) };
|
|
526
526
|
case "dropped":
|
|
527
|
-
return
|
|
527
|
+
return Y(a);
|
|
528
528
|
case "previous_not_applied":
|
|
529
|
-
return
|
|
529
|
+
return Y("refused");
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Y(e) {
|
|
533
533
|
return { status: "not_applied", reason: e, message: Be[e] };
|
|
534
534
|
}
|
|
535
535
|
function Sa() {
|
|
536
536
|
return globalThis.crypto.randomUUID();
|
|
537
537
|
}
|
|
538
|
-
const wa = ae(() => import("./dashboard-controls-
|
|
539
|
-
() => import("./edit-dashboard-visual-
|
|
540
|
-
),
|
|
541
|
-
function
|
|
538
|
+
const wa = ae(() => import("./dashboard-controls-CtFXlyjV.js")), xa = ae(
|
|
539
|
+
() => import("./edit-dashboard-visual-oxt3x1wb.js")
|
|
540
|
+
), Ca = ae(() => import("./dashboard-json-DfGBUtCd.js"));
|
|
541
|
+
function er({
|
|
542
542
|
showControls: e = !1,
|
|
543
543
|
showFooter: a = !0,
|
|
544
544
|
liveScreen: t,
|
|
545
545
|
...n
|
|
546
546
|
}) {
|
|
547
|
-
const s = D(
|
|
548
|
-
(
|
|
549
|
-
), { appearance:
|
|
550
|
-
return /* @__PURE__ */ r(
|
|
551
|
-
/* @__PURE__ */ r(
|
|
552
|
-
/* @__PURE__ */ d(
|
|
547
|
+
const s = D(
|
|
548
|
+
(o) => o.showDashboardJSON
|
|
549
|
+
), { appearance: i, preferences: l } = n;
|
|
550
|
+
return /* @__PURE__ */ r(it, { FallbackComponent: ot, children: /* @__PURE__ */ r(dt, { dashboardProps: n, children: /* @__PURE__ */ d(ct, { children: [
|
|
551
|
+
/* @__PURE__ */ r(ut, { componentType: "surfboard", componentId: n.id }),
|
|
552
|
+
/* @__PURE__ */ d(mt, { appearance: i, children: [
|
|
553
553
|
/* @__PURE__ */ r(
|
|
554
|
-
|
|
554
|
+
ht,
|
|
555
555
|
{
|
|
556
556
|
toastOptions: {
|
|
557
557
|
classNames: {
|
|
@@ -565,16 +565,13 @@ function Qa({
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
|
-
/* @__PURE__ */ d(
|
|
569
|
-
|
|
570
|
-
/* @__PURE__ */ r(
|
|
571
|
-
e && /* @__PURE__ */ r(
|
|
568
|
+
/* @__PURE__ */ d(ft, { preferences: l, children: [
|
|
569
|
+
s && /* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(Ca, {}) }),
|
|
570
|
+
/* @__PURE__ */ r(bt, { children: /* @__PURE__ */ r(ta, { children: /* @__PURE__ */ d("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
|
|
571
|
+
e && /* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(wa, {}) }),
|
|
572
572
|
t && /* @__PURE__ */ r(ga, { port: t, onLifecycleEvent: n.onDashboardLifecycleEvent }),
|
|
573
573
|
/* @__PURE__ */ d("div", { className: "relative flex grow overflow-hidden", children: [
|
|
574
|
-
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */
|
|
575
|
-
s && /* @__PURE__ */ r(Y, { fallback: null, children: /* @__PURE__ */ r(xa, {}) }),
|
|
576
|
-
/* @__PURE__ */ r(Ke, { mode: s ? "hidden" : "visible", children: /* @__PURE__ */ r(Xt, {}) })
|
|
577
|
-
] }) }),
|
|
574
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ r(pt, { ...n, type: "dashboard", children: /* @__PURE__ */ r(Ta, {}) }) }),
|
|
578
575
|
/* @__PURE__ */ r(da, {})
|
|
579
576
|
] })
|
|
580
577
|
] }) }) })
|
|
@@ -582,11 +579,28 @@ function Qa({
|
|
|
582
579
|
] })
|
|
583
580
|
] }) }) });
|
|
584
581
|
}
|
|
585
|
-
function
|
|
582
|
+
function Ta() {
|
|
583
|
+
const e = D((t) => t.isVisualEditing), a = B(() => /* @__PURE__ */ r(gt.Provider, { value: !0, children: /* @__PURE__ */ r(Xt, {}) }), []);
|
|
584
|
+
return /* @__PURE__ */ d("div", { className: "relative flex min-h-0 min-w-0 grow basis-0 flex-col", children: [
|
|
585
|
+
/* @__PURE__ */ r(
|
|
586
|
+
"div",
|
|
587
|
+
{
|
|
588
|
+
className: "flex min-h-0 grow basis-0 flex-col",
|
|
589
|
+
style: e ? { visibility: "hidden" } : void 0,
|
|
590
|
+
inert: e || void 0,
|
|
591
|
+
"aria-hidden": e || void 0,
|
|
592
|
+
"data-dashboard-hidden": e || void 0,
|
|
593
|
+
children: a
|
|
594
|
+
}
|
|
595
|
+
),
|
|
596
|
+
e && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-10 flex flex-col", children: /* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(xa, {}) }) })
|
|
597
|
+
] });
|
|
598
|
+
}
|
|
599
|
+
function Na(e = {}) {
|
|
586
600
|
const { authToken: a, tokenProps: t } = be(), n = D(
|
|
587
601
|
(N) => N.actions.applyResolvedCalendarPreferences
|
|
588
|
-
), s = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, l = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, h] = I(!1), [w, x] = I(!1), [u, b] = I(!1), [c, S] = I(null), [m, f] = I(null),
|
|
589
|
-
|
|
602
|
+
), s = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, l = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, h] = I(!1), [w, x] = I(!1), [u, b] = I(!1), [c, S] = I(null), [m, f] = I(null), v = L(i);
|
|
603
|
+
v.current = i, j(() => {
|
|
590
604
|
f(null), S(null), h(!1), x(!1), b(!1);
|
|
591
605
|
}, [i]);
|
|
592
606
|
const E = P(async (N) => {
|
|
@@ -607,18 +621,18 @@ function Ca(e = {}) {
|
|
|
607
621
|
}
|
|
608
622
|
);
|
|
609
623
|
if (!p.ok) {
|
|
610
|
-
const
|
|
611
|
-
throw new Error(
|
|
624
|
+
const T = await p.json().catch(() => ({}));
|
|
625
|
+
throw new Error(T.error || "Failed to fetch preferences");
|
|
612
626
|
}
|
|
613
|
-
const
|
|
614
|
-
|
|
627
|
+
const y = await E(p);
|
|
628
|
+
v.current === N && f(y);
|
|
615
629
|
} catch (p) {
|
|
616
|
-
|
|
630
|
+
v.current === N && S(p instanceof Error ? p.message : "Unknown error");
|
|
617
631
|
} finally {
|
|
618
|
-
|
|
632
|
+
v.current === N && h(!1);
|
|
619
633
|
}
|
|
620
634
|
}, [i, l, s, E]);
|
|
621
|
-
|
|
635
|
+
j(() => {
|
|
622
636
|
s && A();
|
|
623
637
|
}, [s, A]);
|
|
624
638
|
const _ = P(
|
|
@@ -628,7 +642,7 @@ function Ca(e = {}) {
|
|
|
628
642
|
const p = i;
|
|
629
643
|
x(!0), S(null);
|
|
630
644
|
try {
|
|
631
|
-
const
|
|
645
|
+
const y = await fetch(
|
|
632
646
|
`${l}/v1/user-preferences/calendar`,
|
|
633
647
|
{
|
|
634
648
|
method: "PATCH",
|
|
@@ -639,16 +653,16 @@ function Ca(e = {}) {
|
|
|
639
653
|
body: JSON.stringify(N)
|
|
640
654
|
}
|
|
641
655
|
);
|
|
642
|
-
if (!
|
|
643
|
-
const g = await
|
|
656
|
+
if (!y.ok) {
|
|
657
|
+
const g = await y.json().catch(() => ({}));
|
|
644
658
|
throw new Error(g.error || "Failed to update preferences");
|
|
645
659
|
}
|
|
646
|
-
const
|
|
647
|
-
return
|
|
648
|
-
} catch (
|
|
649
|
-
return
|
|
660
|
+
const T = await E(y);
|
|
661
|
+
return v.current !== p ? !1 : (f(T), n(T.resolved, T.sources), !0);
|
|
662
|
+
} catch (y) {
|
|
663
|
+
return v.current === p && S(y instanceof Error ? y.message : "Unknown error"), !1;
|
|
650
664
|
} finally {
|
|
651
|
-
|
|
665
|
+
v.current === p && x(!1);
|
|
652
666
|
}
|
|
653
667
|
},
|
|
654
668
|
[
|
|
@@ -671,15 +685,15 @@ function Ca(e = {}) {
|
|
|
671
685
|
}
|
|
672
686
|
);
|
|
673
687
|
if (!p.ok) {
|
|
674
|
-
const
|
|
675
|
-
throw new Error(
|
|
688
|
+
const T = await p.json().catch(() => ({}));
|
|
689
|
+
throw new Error(T.error || "Failed to clear preferences");
|
|
676
690
|
}
|
|
677
|
-
const
|
|
678
|
-
return
|
|
691
|
+
const y = await E(p);
|
|
692
|
+
return v.current !== N ? !1 : (f(y), n(y.resolved, y.sources), !0);
|
|
679
693
|
} catch (p) {
|
|
680
|
-
return
|
|
694
|
+
return v.current === N && S(p instanceof Error ? p.message : "Unknown error"), !1;
|
|
681
695
|
} finally {
|
|
682
|
-
|
|
696
|
+
v.current === N && b(!1);
|
|
683
697
|
}
|
|
684
698
|
}, [
|
|
685
699
|
i,
|
|
@@ -718,7 +732,7 @@ const te = [
|
|
|
718
732
|
{ value: 1, label: "Monday" },
|
|
719
733
|
{ value: 6, label: "Saturday" }
|
|
720
734
|
], Ae = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
721
|
-
function
|
|
735
|
+
function Ea() {
|
|
722
736
|
try {
|
|
723
737
|
const e = Intl;
|
|
724
738
|
if (e.supportedValuesOf)
|
|
@@ -727,7 +741,7 @@ function Na() {
|
|
|
727
741
|
}
|
|
728
742
|
return te.map((e) => e.value);
|
|
729
743
|
}
|
|
730
|
-
function
|
|
744
|
+
function Ia(e) {
|
|
731
745
|
if (!e) return "default";
|
|
732
746
|
if (e.tz !== e.weekStart) return "inherited";
|
|
733
747
|
switch (e.tz) {
|
|
@@ -747,11 +761,11 @@ function De(e) {
|
|
|
747
761
|
const a = te.find((t) => t.value === e);
|
|
748
762
|
return a ? a.label : e;
|
|
749
763
|
}
|
|
750
|
-
function
|
|
764
|
+
function Aa(e) {
|
|
751
765
|
const a = je.find((t) => t.value === e);
|
|
752
766
|
return a ? a.label : String(e);
|
|
753
767
|
}
|
|
754
|
-
function
|
|
768
|
+
function Da({
|
|
755
769
|
active: e,
|
|
756
770
|
onClose: a
|
|
757
771
|
}) {
|
|
@@ -762,16 +776,16 @@ function Aa({
|
|
|
762
776
|
isClearing: i,
|
|
763
777
|
updatePreferences: l,
|
|
764
778
|
clearPreferences: o
|
|
765
|
-
} =
|
|
779
|
+
} = Na({ enabled: e }), h = vt(), w = (t == null ? void 0 : t.resolved.tz) || (h == null ? void 0 : h.tz) || "UTC", x = (t == null ? void 0 : t.resolved.weekStart) ?? (h == null ? void 0 : h.weekStart) ?? 1, [u, b] = I((t == null ? void 0 : t.stored) === null), [c, S] = I(!1), [m, f] = I(
|
|
766
780
|
w
|
|
767
|
-
), [
|
|
781
|
+
), [v, E] = I(
|
|
768
782
|
x
|
|
769
|
-
), [A, _] = I(!1), k =
|
|
783
|
+
), [A, _] = I(!1), k = B(() => Ea(), []), N = B(
|
|
770
784
|
() => k.filter(
|
|
771
|
-
(
|
|
785
|
+
(C) => !te.some(($e) => $e.value === C)
|
|
772
786
|
),
|
|
773
787
|
[k]
|
|
774
|
-
), p =
|
|
788
|
+
), p = B(() => De(m), [m]), y = t != null && t.inherited ? De(t.inherited.tz) : "UTC", T = t != null && t.inherited ? Aa(t.inherited.weekStart) : "Monday", g = Ia(
|
|
775
789
|
t == null ? void 0 : t.inheritedSources
|
|
776
790
|
);
|
|
777
791
|
He.useEffect(() => {
|
|
@@ -794,7 +808,7 @@ function Aa({
|
|
|
794
808
|
}
|
|
795
809
|
u ? await o() ? (F.success("Now using default settings."), a()) : F.error("Failed to save preferences. Please try again.") : await l({
|
|
796
810
|
tz: m,
|
|
797
|
-
weekStart:
|
|
811
|
+
weekStart: v
|
|
798
812
|
}) ? (F.success("Preferences saved."), a()) : F.error("Failed to save preferences. Please try again.");
|
|
799
813
|
}, R = () => {
|
|
800
814
|
a();
|
|
@@ -802,11 +816,11 @@ function Aa({
|
|
|
802
816
|
return /* @__PURE__ */ d(M, { children: [
|
|
803
817
|
/* @__PURE__ */ d("div", { className: "space-y-4 py-1", children: [
|
|
804
818
|
/* @__PURE__ */ d(
|
|
805
|
-
|
|
819
|
+
ye,
|
|
806
820
|
{
|
|
807
821
|
value: u ? "defaults" : "custom",
|
|
808
|
-
onValueChange: (
|
|
809
|
-
S(!0), b(
|
|
822
|
+
onValueChange: (C) => {
|
|
823
|
+
S(!0), b(C === "defaults");
|
|
810
824
|
},
|
|
811
825
|
className: "space-y-0.5",
|
|
812
826
|
children: [
|
|
@@ -837,9 +851,9 @@ function Aa({
|
|
|
837
851
|
" defaults"
|
|
838
852
|
] }),
|
|
839
853
|
/* @__PURE__ */ d("p", { className: "text-[12px] text-muted-foreground", children: [
|
|
840
|
-
|
|
854
|
+
y,
|
|
841
855
|
", week starts ",
|
|
842
|
-
|
|
856
|
+
T
|
|
843
857
|
] })
|
|
844
858
|
] })
|
|
845
859
|
]
|
|
@@ -900,7 +914,7 @@ function Aa({
|
|
|
900
914
|
disabled: u,
|
|
901
915
|
children: [
|
|
902
916
|
/* @__PURE__ */ r("span", { className: "truncate", children: p }),
|
|
903
|
-
/* @__PURE__ */ r(
|
|
917
|
+
/* @__PURE__ */ r(yt, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
|
|
904
918
|
]
|
|
905
919
|
}
|
|
906
920
|
) }),
|
|
@@ -912,13 +926,13 @@ function Aa({
|
|
|
912
926
|
children: /* @__PURE__ */ d(St, { className: "overflow-visible", children: [
|
|
913
927
|
/* @__PURE__ */ r(wt, { placeholder: "Search timezones…" }),
|
|
914
928
|
/* @__PURE__ */ d(xt, { children: [
|
|
915
|
-
/* @__PURE__ */ r(
|
|
916
|
-
/* @__PURE__ */ r(Se, { heading: "Common", children: te.map((
|
|
929
|
+
/* @__PURE__ */ r(Ct, { children: "No timezone found." }),
|
|
930
|
+
/* @__PURE__ */ r(Se, { heading: "Common", children: te.map((C) => /* @__PURE__ */ d(
|
|
917
931
|
we,
|
|
918
932
|
{
|
|
919
|
-
value: `${
|
|
933
|
+
value: `${C.value} ${C.label}`,
|
|
920
934
|
onSelect: () => {
|
|
921
|
-
S(!0), f(
|
|
935
|
+
S(!0), f(C.value), _(!1);
|
|
922
936
|
},
|
|
923
937
|
children: [
|
|
924
938
|
/* @__PURE__ */ r(
|
|
@@ -926,23 +940,23 @@ function Aa({
|
|
|
926
940
|
{
|
|
927
941
|
className: U(
|
|
928
942
|
"h-3.5 w-3.5",
|
|
929
|
-
m ===
|
|
943
|
+
m === C.value ? "opacity-100" : "opacity-0"
|
|
930
944
|
)
|
|
931
945
|
}
|
|
932
946
|
),
|
|
933
|
-
/* @__PURE__ */ r("span", { className: "flex-1", children:
|
|
934
|
-
/* @__PURE__ */ r("span", { className: "text-[11px] text-muted-foreground", children:
|
|
947
|
+
/* @__PURE__ */ r("span", { className: "flex-1", children: C.label }),
|
|
948
|
+
/* @__PURE__ */ r("span", { className: "text-[11px] text-muted-foreground", children: C.value })
|
|
935
949
|
]
|
|
936
950
|
},
|
|
937
|
-
|
|
951
|
+
C.value
|
|
938
952
|
)) }),
|
|
939
|
-
/* @__PURE__ */ r(
|
|
940
|
-
/* @__PURE__ */ r(Se, { heading: "All timezones", children: N.map((
|
|
953
|
+
/* @__PURE__ */ r(Tt, {}),
|
|
954
|
+
/* @__PURE__ */ r(Se, { heading: "All timezones", children: N.map((C) => /* @__PURE__ */ d(
|
|
941
955
|
we,
|
|
942
956
|
{
|
|
943
|
-
value:
|
|
957
|
+
value: C,
|
|
944
958
|
onSelect: () => {
|
|
945
|
-
S(!0), f(
|
|
959
|
+
S(!0), f(C), _(!1);
|
|
946
960
|
},
|
|
947
961
|
children: [
|
|
948
962
|
/* @__PURE__ */ r(
|
|
@@ -950,14 +964,14 @@ function Aa({
|
|
|
950
964
|
{
|
|
951
965
|
className: U(
|
|
952
966
|
"h-3.5 w-3.5",
|
|
953
|
-
m ===
|
|
967
|
+
m === C ? "opacity-100" : "opacity-0"
|
|
954
968
|
)
|
|
955
969
|
}
|
|
956
970
|
),
|
|
957
|
-
|
|
971
|
+
C
|
|
958
972
|
]
|
|
959
973
|
},
|
|
960
|
-
|
|
974
|
+
C
|
|
961
975
|
)) })
|
|
962
976
|
] })
|
|
963
977
|
] })
|
|
@@ -970,18 +984,18 @@ function Aa({
|
|
|
970
984
|
/* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
971
985
|
/* @__PURE__ */ r(G, { className: Ae, children: "Week starts on" }),
|
|
972
986
|
/* @__PURE__ */ r(
|
|
973
|
-
|
|
987
|
+
ye,
|
|
974
988
|
{
|
|
975
|
-
value: String(
|
|
976
|
-
onValueChange: (
|
|
977
|
-
S(!0), E(Number(
|
|
989
|
+
value: String(v),
|
|
990
|
+
onValueChange: (C) => {
|
|
991
|
+
S(!0), E(Number(C));
|
|
978
992
|
},
|
|
979
993
|
className: "flex gap-4",
|
|
980
994
|
disabled: u,
|
|
981
|
-
children: je.map((
|
|
995
|
+
children: je.map((C) => /* @__PURE__ */ d(
|
|
982
996
|
"label",
|
|
983
997
|
{
|
|
984
|
-
htmlFor: `week-start-${
|
|
998
|
+
htmlFor: `week-start-${C.value}`,
|
|
985
999
|
className: U(
|
|
986
1000
|
"flex cursor-pointer items-center gap-2 text-[13px]",
|
|
987
1001
|
u && "cursor-not-allowed"
|
|
@@ -990,15 +1004,15 @@ function Aa({
|
|
|
990
1004
|
/* @__PURE__ */ r(
|
|
991
1005
|
ne,
|
|
992
1006
|
{
|
|
993
|
-
value: String(
|
|
994
|
-
id: `week-start-${
|
|
1007
|
+
value: String(C.value),
|
|
1008
|
+
id: `week-start-${C.value}`,
|
|
995
1009
|
disabled: u
|
|
996
1010
|
}
|
|
997
1011
|
),
|
|
998
|
-
|
|
1012
|
+
C.label
|
|
999
1013
|
]
|
|
1000
1014
|
},
|
|
1001
|
-
|
|
1015
|
+
C.value
|
|
1002
1016
|
))
|
|
1003
1017
|
}
|
|
1004
1018
|
)
|
|
@@ -1025,80 +1039,80 @@ function Aa({
|
|
|
1025
1039
|
] })
|
|
1026
1040
|
] });
|
|
1027
1041
|
}
|
|
1028
|
-
function
|
|
1042
|
+
function ka(e = {}) {
|
|
1029
1043
|
const { authToken: a, tokenProps: t } = be(), n = D(
|
|
1030
1044
|
(p) => p.actions.applyResolvedValueFormatPreferences
|
|
1031
1045
|
), s = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, l = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = L(i);
|
|
1032
1046
|
o.current = i;
|
|
1033
|
-
const [h, w] = I(null), [x, u] = I(!1), [b, c] = I(!1), [S, m] = I(!1), [f,
|
|
1034
|
-
|
|
1035
|
-
w(null),
|
|
1047
|
+
const [h, w] = I(null), [x, u] = I(!1), [b, c] = I(!1), [S, m] = I(!1), [f, v] = I(null);
|
|
1048
|
+
j(() => {
|
|
1049
|
+
w(null), v(null), u(!1), c(!1), m(!1);
|
|
1036
1050
|
}, [i]);
|
|
1037
1051
|
const E = P(async (p) => {
|
|
1038
|
-
const
|
|
1039
|
-
if (!
|
|
1052
|
+
const y = Ht(await p.json());
|
|
1053
|
+
if (!y.ok)
|
|
1040
1054
|
throw new Error("Value format preferences response is invalid");
|
|
1041
|
-
return
|
|
1055
|
+
return y.value;
|
|
1042
1056
|
}, []), A = P(
|
|
1043
|
-
async (p,
|
|
1057
|
+
async (p, y) => {
|
|
1044
1058
|
if (!i || !l)
|
|
1045
1059
|
throw new Error("Not authenticated");
|
|
1046
|
-
const
|
|
1060
|
+
const T = await fetch(
|
|
1047
1061
|
`${l}/v1/user-preferences/value-format`,
|
|
1048
1062
|
{
|
|
1049
1063
|
method: p,
|
|
1050
1064
|
headers: {
|
|
1051
1065
|
Authorization: `Bearer ${i}`,
|
|
1052
|
-
...
|
|
1066
|
+
...y ? { "Content-Type": "application/json" } : {}
|
|
1053
1067
|
},
|
|
1054
|
-
body:
|
|
1068
|
+
body: y ? JSON.stringify(y) : void 0
|
|
1055
1069
|
}
|
|
1056
1070
|
);
|
|
1057
|
-
if (!
|
|
1058
|
-
const g = await
|
|
1071
|
+
if (!T.ok) {
|
|
1072
|
+
const g = await T.json().catch(() => ({}));
|
|
1059
1073
|
throw new Error(g.error || "Failed to update preferences");
|
|
1060
1074
|
}
|
|
1061
|
-
return E(
|
|
1075
|
+
return E(T);
|
|
1062
1076
|
},
|
|
1063
1077
|
[i, l, E]
|
|
1064
1078
|
), _ = P(async () => {
|
|
1065
1079
|
if (!s || !i || !l) return;
|
|
1066
1080
|
const p = i;
|
|
1067
|
-
u(!0),
|
|
1081
|
+
u(!0), v(null);
|
|
1068
1082
|
try {
|
|
1069
|
-
const
|
|
1070
|
-
o.current === p && w(
|
|
1071
|
-
} catch (
|
|
1072
|
-
o.current === p && y
|
|
1083
|
+
const y = await A("GET");
|
|
1084
|
+
o.current === p && w(y);
|
|
1085
|
+
} catch (y) {
|
|
1086
|
+
o.current === p && v(y instanceof Error ? y.message : "Unknown error");
|
|
1073
1087
|
} finally {
|
|
1074
1088
|
o.current === p && u(!1);
|
|
1075
1089
|
}
|
|
1076
1090
|
}, [i, l, s, A]);
|
|
1077
|
-
|
|
1091
|
+
j(() => {
|
|
1078
1092
|
s && _();
|
|
1079
1093
|
}, [s, _]);
|
|
1080
1094
|
const k = P(
|
|
1081
1095
|
async (p) => {
|
|
1082
|
-
const
|
|
1083
|
-
c(!0),
|
|
1096
|
+
const y = i;
|
|
1097
|
+
c(!0), v(null);
|
|
1084
1098
|
try {
|
|
1085
|
-
const
|
|
1086
|
-
return o.current !==
|
|
1087
|
-
} catch (
|
|
1088
|
-
return o.current ===
|
|
1099
|
+
const T = await A("PATCH", p);
|
|
1100
|
+
return o.current !== y ? !1 : (w(T), n(T.resolved, T.sources), !0);
|
|
1101
|
+
} catch (T) {
|
|
1102
|
+
return o.current === y && v(T instanceof Error ? T.message : "Unknown error"), !1;
|
|
1089
1103
|
} finally {
|
|
1090
|
-
o.current ===
|
|
1104
|
+
o.current === y && c(!1);
|
|
1091
1105
|
}
|
|
1092
1106
|
},
|
|
1093
1107
|
[i, n, A]
|
|
1094
1108
|
), N = P(async () => {
|
|
1095
1109
|
const p = i;
|
|
1096
|
-
m(!0),
|
|
1110
|
+
m(!0), v(null);
|
|
1097
1111
|
try {
|
|
1098
|
-
const
|
|
1099
|
-
return o.current !== p ? !1 : (w(
|
|
1100
|
-
} catch (
|
|
1101
|
-
return o.current === p && y
|
|
1112
|
+
const y = await A("DELETE");
|
|
1113
|
+
return o.current !== p ? !1 : (w(y), n(y.resolved, y.sources), !0);
|
|
1114
|
+
} catch (y) {
|
|
1115
|
+
return o.current === p && v(y instanceof Error ? y.message : "Unknown error"), !1;
|
|
1102
1116
|
} finally {
|
|
1103
1117
|
o.current === p && m(!1);
|
|
1104
1118
|
}
|
|
@@ -1139,7 +1153,7 @@ const he = [
|
|
|
1139
1153
|
"INR",
|
|
1140
1154
|
"BRL",
|
|
1141
1155
|
"KWD"
|
|
1142
|
-
]),
|
|
1156
|
+
]), _a = Kt(), Pa = _a.filter(
|
|
1143
1157
|
(e) => !Me.has(e)
|
|
1144
1158
|
), Ve = [
|
|
1145
1159
|
{ value: "short", label: "Short" },
|
|
@@ -1168,7 +1182,7 @@ function le(e) {
|
|
|
1168
1182
|
var a;
|
|
1169
1183
|
return ((a = Ve.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
|
|
1170
1184
|
}
|
|
1171
|
-
function
|
|
1185
|
+
function za(e) {
|
|
1172
1186
|
const a = he.find((t) => t.value === e);
|
|
1173
1187
|
return a ? `${a.label} — ${a.value}` : e;
|
|
1174
1188
|
}
|
|
@@ -1229,14 +1243,14 @@ function oe({
|
|
|
1229
1243
|
)
|
|
1230
1244
|
] });
|
|
1231
1245
|
}
|
|
1232
|
-
function
|
|
1246
|
+
function La({
|
|
1233
1247
|
value: e,
|
|
1234
1248
|
inherited: a,
|
|
1235
1249
|
inheritedSources: t,
|
|
1236
1250
|
onChange: n,
|
|
1237
1251
|
disabled: s
|
|
1238
1252
|
}) {
|
|
1239
|
-
var N, p,
|
|
1253
|
+
var N, p, y, T;
|
|
1240
1254
|
const i = $(), l = $(), o = $(), h = $(), w = $(), u = (e.locale === void 0 ? void 0 : Fe(e.locale)) ?? a.locale, b = e.defaultCurrency ?? a.defaultCurrency, c = {
|
|
1241
1255
|
locale: u,
|
|
1242
1256
|
dateStyle: e.dateStyle ?? a.dateStyle,
|
|
@@ -1255,7 +1269,7 @@ function za({
|
|
|
1255
1269
|
value: ke,
|
|
1256
1270
|
metadata: { kind: "raw_temporal", valueKind: "date" },
|
|
1257
1271
|
format: m
|
|
1258
|
-
}).text,
|
|
1272
|
+
}).text, v = H({
|
|
1259
1273
|
value: se,
|
|
1260
1274
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1261
1275
|
format: m
|
|
@@ -1322,7 +1336,7 @@ function za({
|
|
|
1322
1336
|
locale: g === "inherit" ? void 0 : g
|
|
1323
1337
|
}),
|
|
1324
1338
|
children: [
|
|
1325
|
-
/* @__PURE__ */ r(ce, { id: i, size: "xs", children: /* @__PURE__ */ r(ue, { children: e.locale === void 0 ? `Inherited · ${a.locale}` :
|
|
1339
|
+
/* @__PURE__ */ r(ce, { id: i, size: "xs", children: /* @__PURE__ */ r(ue, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : za(e.locale) }) }),
|
|
1326
1340
|
/* @__PURE__ */ d(me, { children: [
|
|
1327
1341
|
/* @__PURE__ */ d(O, { value: "inherit", children: [
|
|
1328
1342
|
"Inherited from ",
|
|
@@ -1370,7 +1384,7 @@ function za({
|
|
|
1370
1384
|
{
|
|
1371
1385
|
id: h,
|
|
1372
1386
|
label: "Date",
|
|
1373
|
-
value: (
|
|
1387
|
+
value: (y = e.dateTime) == null ? void 0 : y.dateStyle,
|
|
1374
1388
|
inherited: a.dateTime.dateStyle,
|
|
1375
1389
|
inheritedSource: t.dateTime.dateStyle,
|
|
1376
1390
|
examples: A,
|
|
@@ -1383,7 +1397,7 @@ function za({
|
|
|
1383
1397
|
{
|
|
1384
1398
|
id: w,
|
|
1385
1399
|
label: "Time",
|
|
1386
|
-
value: (
|
|
1400
|
+
value: (T = e.dateTime) == null ? void 0 : T.timeStyle,
|
|
1387
1401
|
inherited: a.dateTime.timeStyle,
|
|
1388
1402
|
inheritedSource: t.dateTime.timeStyle,
|
|
1389
1403
|
examples: _,
|
|
@@ -1421,7 +1435,7 @@ function za({
|
|
|
1421
1435
|
a.defaultCurrency
|
|
1422
1436
|
] }),
|
|
1423
1437
|
[...Me].map((g) => /* @__PURE__ */ r(O, { value: g, children: g }, g)),
|
|
1424
|
-
|
|
1438
|
+
Pa.map((g) => /* @__PURE__ */ r(O, { value: g, children: g }, g))
|
|
1425
1439
|
] })
|
|
1426
1440
|
]
|
|
1427
1441
|
}
|
|
@@ -1436,7 +1450,7 @@ function za({
|
|
|
1436
1450
|
] }),
|
|
1437
1451
|
/* @__PURE__ */ d("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
1438
1452
|
/* @__PURE__ */ r("dt", { className: "text-muted-foreground", children: "Date & time" }),
|
|
1439
|
-
/* @__PURE__ */ r("dd", { className: "text-right font-medium text-foreground", children:
|
|
1453
|
+
/* @__PURE__ */ r("dd", { className: "text-right font-medium text-foreground", children: v })
|
|
1440
1454
|
] }),
|
|
1441
1455
|
/* @__PURE__ */ d("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
1442
1456
|
/* @__PURE__ */ r("dt", { className: "text-muted-foreground", children: "Currency" }),
|
|
@@ -1469,7 +1483,7 @@ function Pe(e, a) {
|
|
|
1469
1483
|
return e == null ? void 0 : e.defaultCurrency;
|
|
1470
1484
|
}
|
|
1471
1485
|
}
|
|
1472
|
-
function
|
|
1486
|
+
function Ra(e) {
|
|
1473
1487
|
var n, s;
|
|
1474
1488
|
const a = (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.dateStyle, t = (s = e == null ? void 0 : e.dateTime) == null ? void 0 : s.timeStyle;
|
|
1475
1489
|
return {
|
|
@@ -1479,12 +1493,12 @@ function La(e) {
|
|
|
1479
1493
|
defaultCurrency: e == null ? void 0 : e.defaultCurrency
|
|
1480
1494
|
};
|
|
1481
1495
|
}
|
|
1482
|
-
function
|
|
1496
|
+
function Ua({
|
|
1483
1497
|
active: e,
|
|
1484
1498
|
onClose: a
|
|
1485
1499
|
}) {
|
|
1486
1500
|
var o, h, w, x, u, b, c;
|
|
1487
|
-
const { preferences: t, isLoading: n, isSaving: s, updatePreferences: i } =
|
|
1501
|
+
const { preferences: t, isLoading: n, isSaving: s, updatePreferences: i } = ka({ enabled: e });
|
|
1488
1502
|
if (!e) return null;
|
|
1489
1503
|
if (!t)
|
|
1490
1504
|
return /* @__PURE__ */ d(M, { children: [
|
|
@@ -1505,7 +1519,7 @@ function Ra({
|
|
|
1505
1519
|
((c = t.stored) == null ? void 0 : c.defaultCurrency) ?? ""
|
|
1506
1520
|
].join(":");
|
|
1507
1521
|
return /* @__PURE__ */ r(
|
|
1508
|
-
|
|
1522
|
+
Fa,
|
|
1509
1523
|
{
|
|
1510
1524
|
preferences: t,
|
|
1511
1525
|
isSaving: s,
|
|
@@ -1515,7 +1529,7 @@ function Ra({
|
|
|
1515
1529
|
l
|
|
1516
1530
|
);
|
|
1517
1531
|
}
|
|
1518
|
-
function
|
|
1532
|
+
function Fa({
|
|
1519
1533
|
preferences: e,
|
|
1520
1534
|
isSaving: a,
|
|
1521
1535
|
updatePreferences: t,
|
|
@@ -1523,7 +1537,7 @@ function Ua({
|
|
|
1523
1537
|
}) {
|
|
1524
1538
|
var w, x;
|
|
1525
1539
|
const [s, i] = I(
|
|
1526
|
-
() =>
|
|
1540
|
+
() => Ra(e.stored)
|
|
1527
1541
|
), l = (s.locale === void 0 || Fe(s.locale) !== void 0) && (s.defaultCurrency === void 0 || qt(s.defaultCurrency) !== void 0) && (s.dateStyle === void 0 || ["short", "medium", "long"].includes(s.dateStyle)) && (((w = s.dateTime) == null ? void 0 : w.dateStyle) === void 0 || ["short", "medium", "long"].includes(s.dateTime.dateStyle)) && (((x = s.dateTime) == null ? void 0 : x.timeStyle) === void 0 || ["short", "medium", "long"].includes(s.dateTime.timeStyle)), o = async () => {
|
|
1528
1542
|
const u = {
|
|
1529
1543
|
...s.locale !== void 0 ? { locale: s.locale } : {},
|
|
@@ -1546,7 +1560,7 @@ function Ua({
|
|
|
1546
1560
|
};
|
|
1547
1561
|
return /* @__PURE__ */ d(M, { children: [
|
|
1548
1562
|
/* @__PURE__ */ r("div", { className: "py-2", children: /* @__PURE__ */ r(
|
|
1549
|
-
|
|
1563
|
+
La,
|
|
1550
1564
|
{
|
|
1551
1565
|
value: s,
|
|
1552
1566
|
inherited: e.inherited,
|
|
@@ -1593,7 +1607,7 @@ function Ua({
|
|
|
1593
1607
|
] })
|
|
1594
1608
|
] });
|
|
1595
1609
|
}
|
|
1596
|
-
function
|
|
1610
|
+
function tr({
|
|
1597
1611
|
open: e,
|
|
1598
1612
|
onOpenChange: a
|
|
1599
1613
|
}) {
|
|
@@ -1605,18 +1619,18 @@ function er({
|
|
|
1605
1619
|
] }),
|
|
1606
1620
|
/* @__PURE__ */ d(Wt, { value: t, onValueChange: n, children: [
|
|
1607
1621
|
/* @__PURE__ */ d($t, { variant: "underline", className: "w-full justify-start", children: [
|
|
1608
|
-
/* @__PURE__ */ r(
|
|
1609
|
-
/* @__PURE__ */ r(
|
|
1622
|
+
/* @__PURE__ */ r(Ce, { value: "display", children: "Display formats" }),
|
|
1623
|
+
/* @__PURE__ */ r(Ce, { value: "calendar", children: "Calendar" })
|
|
1610
1624
|
] }),
|
|
1611
|
-
/* @__PURE__ */ r(
|
|
1612
|
-
|
|
1625
|
+
/* @__PURE__ */ r(Te, { value: "display", children: /* @__PURE__ */ r(
|
|
1626
|
+
Ua,
|
|
1613
1627
|
{
|
|
1614
1628
|
active: e && t === "display",
|
|
1615
1629
|
onClose: s
|
|
1616
1630
|
}
|
|
1617
1631
|
) }),
|
|
1618
|
-
/* @__PURE__ */ r(
|
|
1619
|
-
|
|
1632
|
+
/* @__PURE__ */ r(Te, { value: "calendar", children: /* @__PURE__ */ r(
|
|
1633
|
+
Da,
|
|
1620
1634
|
{
|
|
1621
1635
|
active: e && t === "calendar",
|
|
1622
1636
|
onClose: s
|
|
@@ -1627,11 +1641,11 @@ function er({
|
|
|
1627
1641
|
}
|
|
1628
1642
|
export {
|
|
1629
1643
|
ea as A,
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1644
|
+
er as D,
|
|
1645
|
+
tr as R,
|
|
1646
|
+
La as a,
|
|
1633
1647
|
da as b,
|
|
1634
|
-
|
|
1648
|
+
Qa as c,
|
|
1635
1649
|
ba as d,
|
|
1636
1650
|
pa as u
|
|
1637
1651
|
};
|