react-semaphor 0.1.432 → 0.1.433

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 (24) hide show
  1. package/dist/chunks/{dashboard-BNNLoBLt.js → dashboard-CCRvBqUy.js} +203 -199
  2. package/dist/chunks/{dashboard-DxwOPUB6.js → dashboard-DxynqfO7.js} +23 -23
  3. package/dist/chunks/{dashboard-briefing-launcher-B2jFSq0-.js → dashboard-briefing-launcher-B5y65OKI.js} +2 -2
  4. package/dist/chunks/{dashboard-briefing-launcher-Hvo4V3np.js → dashboard-briefing-launcher-h9DIL6l1.js} +1 -1
  5. package/dist/chunks/{dashboard-controls-CB2dDJP4.js → dashboard-controls-BN09XPen.js} +342 -342
  6. package/dist/chunks/dashboard-controls-Cp_Q8acT.js +36 -0
  7. package/dist/chunks/{dashboard-json-n4hMQPtc.js → dashboard-json-BNxt7dUo.js} +1 -1
  8. package/dist/chunks/{dashboard-json-cSLaRjlU.js → dashboard-json-Bf3-8gq8.js} +1 -1
  9. package/dist/chunks/{edit-dashboard-visual-BwXL-sin.js → edit-dashboard-visual-B8Mofk1U.js} +1 -1
  10. package/dist/chunks/{edit-dashboard-visual-C5eejq9I.js → edit-dashboard-visual-DX76RXmE.js} +2 -2
  11. package/dist/chunks/{report-preferences-dialog-D8Qe2GGf.js → report-preferences-dialog-DMQjY7oS.js} +1 -1
  12. package/dist/chunks/{report-preferences-dialog-CDYDm7dt.js → report-preferences-dialog-DxK9_fbn.js} +1 -1
  13. package/dist/chunks/{use-create-flow-overlay-state-Dv5iYPzX.js → use-create-flow-overlay-state-BX3dLUMB.js} +1 -1
  14. package/dist/chunks/{use-create-flow-overlay-state-9-aceNp5.js → use-create-flow-overlay-state-C6savp4F.js} +1 -1
  15. package/dist/dashboard/index.cjs +1 -1
  16. package/dist/dashboard/index.js +1 -1
  17. package/dist/data-app-builder/index.cjs +1 -1
  18. package/dist/data-app-builder/index.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +4 -4
  21. package/dist/surfboard/index.cjs +1 -1
  22. package/dist/surfboard/index.js +2 -2
  23. package/package.json +1 -1
  24. package/dist/chunks/dashboard-controls-DwW7cOds.js +0 -36
@@ -2006,7 +2006,7 @@ i_.exports;
2006
2006
  function Ee(we) {
2007
2007
  return qd(we) && Ie(we) == s;
2008
2008
  }
2009
- function tt(we) {
2009
+ function et(we) {
2010
2010
  if (!mc(we) || Ct(we))
2011
2011
  return !1;
2012
2012
  var Fe = Fh(we) ? ee : U;
@@ -2109,7 +2109,7 @@ i_.exports;
2109
2109
  }
2110
2110
  function Pi(we, Fe) {
2111
2111
  var Ke = de(we, Fe);
2112
- return tt(Ke) ? Ke : void 0;
2112
+ return et(Ke) ? Ke : void 0;
2113
2113
  }
2114
2114
  function Zs(we) {
2115
2115
  var Fe = pe.call(we, st), Ke = we[st];
@@ -45960,6 +45960,7 @@ function qBe({
45960
45960
  id: ye,
45961
45961
  accessorFn: (ee) => ee[ye],
45962
45962
  meta: {
45963
+ isNumeric: j === "table" && (pe == null ? void 0 : pe.type) === "number",
45963
45964
  getConditionalFormatting: (ee, se) => D9({
45964
45965
  formatting: L.conditionalFormatting,
45965
45966
  row: ee,
@@ -48804,9 +48805,9 @@ function VVe(e) {
48804
48805
  "data-column-id": ze.id,
48805
48806
  draggable: hn,
48806
48807
  onMouseDownCapture: (Ie) => {
48807
- var tt, ut;
48808
+ var et, ut;
48808
48809
  const Ee = Ie.target;
48809
- l.current = !!((tt = Ee.closest) != null && tt.call(
48810
+ l.current = !!((et = Ee.closest) != null && et.call(
48810
48811
  Ee,
48811
48812
  "[data-resize-handle]"
48812
48813
  )), c.current = !!((ut = Ee.closest) != null && ut.call(Ee, "[data-grip-handle]"));
@@ -48827,9 +48828,9 @@ function VVe(e) {
48827
48828
  if (!y || !Qe || Qe === ze.column.id || ze.column.id === "select")
48828
48829
  return;
48829
48830
  Ie.preventDefault();
48830
- const Ee = Ie.currentTarget.getBoundingClientRect(), tt = Ee.left + Ee.width / 2, ut = {
48831
+ const Ee = Ie.currentTarget.getBoundingClientRect(), et = Ee.left + Ee.width / 2, ut = {
48831
48832
  colId: ze.column.id,
48832
- side: Ie.clientX < tt ? "before" : "after"
48833
+ side: Ie.clientX < et ? "before" : "after"
48833
48834
  };
48834
48835
  at((Yt) => (Yt == null ? void 0 : Yt.colId) === ut.colId && Yt.side === ut.side ? Yt : ut);
48835
48836
  },
@@ -48946,8 +48947,8 @@ function VVe(e) {
48946
48947
  "px-4 text-foreground/90",
48947
48948
  v && "border-gray-300 print:border-gray-400"
48948
48949
  )
48949
- }), tt = on.column.columnDef.meta, ut = (rr = tt == null ? void 0 : tt.getConditionalFormatting) == null ? void 0 : rr.call(
48950
- tt,
48950
+ }), et = on.column.columnDef.meta, ut = (rr = et == null ? void 0 : et.getConditionalFormatting) == null ? void 0 : rr.call(
48951
+ et,
48951
48952
  Pt.original,
48952
48953
  Pt.index
48953
48954
  ), Yt = ((He = ut == null ? void 0 : ut.overlay) == null ? void 0 : He.kind) === "dataBar" ? ut.overlay : void 0, sn = Yt ? Math.max(0, Math.min(1, Yt.ratio)) : 0, Qn = ((pt = ut == null ? void 0 : ut.cellStyle) == null ? void 0 : pt.color) ?? ((It = ut == null ? void 0 : ut.rowStyle) == null ? void 0 : It.color);
@@ -48970,7 +48971,10 @@ function VVe(e) {
48970
48971
  textAlign: "left"
48971
48972
  } : null
48972
48973
  },
48973
- className: Ee.className,
48974
+ className: K(
48975
+ Ee.className,
48976
+ (et == null ? void 0 : et.isNumeric) && "numeric"
48977
+ ),
48974
48978
  children: [
48975
48979
  Yt ? /* @__PURE__ */ d(
48976
48980
  "div",
@@ -49061,12 +49065,12 @@ function VVe(e) {
49061
49065
  },
49062
49066
  children: Ge.map((gt, ze, _t) => {
49063
49067
  const Pt = U == null ? void 0 : U[gt.id], hn = Ze[gt.id], on = gt.id === Oe, gn = typeof hn == "number" || (Pt == null ? void 0 : Pt.type) === "number" ? G1(hn) : null, _r = (Pt == null ? void 0 : Pt.type) === "number" || gn !== null, Ie = (Pt == null ? void 0 : Pt.textAlign) ?? (_r ? "right" : "left"), Ee = ze === _t.length - 1;
49064
- let tt = "";
49065
- hn != null ? gn !== null ? tt = Je(
49068
+ let et = "";
49069
+ hn != null ? gn !== null ? et = Je(
49066
49070
  gt.id,
49067
49071
  gn,
49068
49072
  Pt
49069
- ) : tt = String(hn) : on && (tt = "Total");
49073
+ ) : et = String(hn) : on && (et = "Total");
49070
49074
  const ut = id({
49071
49075
  tableAppearance: C,
49072
49076
  style: {
@@ -49090,7 +49094,7 @@ function VVe(e) {
49090
49094
  _r && "numeric tabular-nums",
49091
49095
  v && "border-gray-300 print:border-gray-400"
49092
49096
  )
49093
- }), Yt = !v && typeof hn == "string" && tt.trim().length > 0;
49097
+ }), Yt = !v && typeof hn == "string" && et.trim().length > 0;
49094
49098
  return /* @__PURE__ */ d(
49095
49099
  "td",
49096
49100
  {
@@ -49098,7 +49102,7 @@ function VVe(e) {
49098
49102
  style: ut.style,
49099
49103
  className: ut.className,
49100
49104
  children: Yt ? /* @__PURE__ */ w("span", { className: "inline-flex items-center gap-1.5", children: [
49101
- /* @__PURE__ */ d("span", { children: tt }),
49105
+ /* @__PURE__ */ d("span", { children: et }),
49102
49106
  /* @__PURE__ */ w(zr, { children: [
49103
49107
  /* @__PURE__ */ d(Br, { asChild: !0, children: /* @__PURE__ */ d(
49104
49108
  "span",
@@ -49117,7 +49121,7 @@ function VVe(e) {
49117
49121
  }
49118
49122
  )
49119
49123
  ] })
49120
- ] }) : tt
49124
+ ] }) : et
49121
49125
  },
49122
49126
  gt.id
49123
49127
  );
@@ -60960,7 +60964,7 @@ function Ace() {
60960
60964
  throw qh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
60961
60965
  }
60962
60966
  }, _r = function(be) {
60963
- tt(be);
60967
+ et(be);
60964
60968
  const Be = b(be);
60965
60969
  if (Be) {
60966
60970
  const Te = [];
@@ -61017,7 +61021,7 @@ function Ace() {
61017
61021
  } catch {
61018
61022
  }
61019
61023
  }
61020
- }, tt = function(be) {
61024
+ }, et = function(be) {
61021
61025
  const Be = [be];
61022
61026
  for (; Be.length > 0; ) {
61023
61027
  const dt = Be.pop();
@@ -61368,12 +61372,12 @@ function Ace() {
61368
61372
  Ri(Te, jt), ms(Te), pt(Te.content) && ni(Te.content);
61369
61373
  } catch (xn) {
61370
61374
  throw Mt && (_r(Ct), Lg(t.removed, (Gn) => {
61371
- Gn.element && tt(Gn.element);
61375
+ Gn.element && et(Gn.element);
61372
61376
  })), xn;
61373
61377
  }
61374
61378
  if (Mt)
61375
61379
  return Lg(t.removed, (xn) => {
61376
- xn.element && tt(xn.element);
61380
+ xn.element && et(xn.element);
61377
61381
  }), pe && rr(Ct), Ct;
61378
61382
  if (ge) {
61379
61383
  if (pe && rr(Be), Pe)
@@ -101902,20 +101906,20 @@ function dft({
101902
101906
  currentUser: I,
101903
101907
  isLoading: T,
101904
101908
  isError: E
101905
- } = ds(), D = !T && !E && !!I, M = !n && r === "scheduled_report", A = re((et) => et.dashboard), P = re((et) => et.theme), O = re((et) => et.selectedSheetId), $ = re((et) => et.filterValues), z = re((et) => et.controlValues), H = re(
101906
- (et) => et.semanticExecutionPayload
101909
+ } = ds(), D = !T && !E && !!I, M = !n && r === "scheduled_report", A = re((tt) => tt.dashboard), P = re((tt) => tt.theme), O = re((tt) => tt.selectedSheetId), $ = re((tt) => tt.filterValues), z = re((tt) => tt.controlValues), H = re(
101910
+ (tt) => tt.semanticExecutionPayload
101907
101911
  ), R = re(
101908
- (et) => et.cardControlValuesMap
101912
+ (tt) => tt.cardControlValuesMap
101909
101913
  ), U = re(
101910
- (et) => et.inlineFilterValuesMap
101914
+ (tt) => tt.inlineFilterValuesMap
101911
101915
  ), q = re(
101912
- (et) => et.dashboardInputValues
101916
+ (tt) => tt.dashboardInputValues
101913
101917
  ), F = re(
101914
- (et) => {
101918
+ (tt) => {
101915
101919
  var Nt;
101916
- return (Nt = et.reportContext) == null ? void 0 : Nt.calendar.tz;
101920
+ return (Nt = tt.reportContext) == null ? void 0 : Nt.calendar.tz;
101917
101921
  }
101918
- ), Z = sr((et) => et.interactionStates), G = e ?? (N == null ? void 0 : N.apiServiceUrl), Y = t ?? (S == null ? void 0 : S.accessToken), Q = X(() => ({ ...oft, ...m }), [m]), V = X(
101922
+ ), Z = sr((tt) => tt.interactionStates), G = e ?? (N == null ? void 0 : N.apiServiceUrl), Y = t ?? (S == null ? void 0 : S.accessToken), Q = X(() => ({ ...oft, ...m }), [m]), V = X(
101919
101923
  () => khe({ briefing: n, sourceContext: c }),
101920
101924
  [n, c]
101921
101925
  ), B = X(
@@ -101941,8 +101945,8 @@ function dft({
101941
101945
  ), [Ve, ct] = te([]), [wt, Bt] = te(!1), [Dt, Ft] = te(null), [Vt, Rt] = te(0), [zt, Re] = te(null), [Le, Ue] = te(!1), [qe, nt] = te(!1), [Xt, $t] = te(null), [Qt, nn] = te(null);
101942
101946
  Ne(() => {
101943
101947
  if (!Qt) return;
101944
- const et = window.setTimeout(() => nn(null), 12e3);
101945
- return () => window.clearTimeout(et);
101948
+ const tt = window.setTimeout(() => nn(null), 12e3);
101949
+ return () => window.clearTimeout(tt);
101946
101950
  }, [Qt]);
101947
101951
  const rn = Me(void 0), {
101948
101952
  activeRunId: kr,
@@ -101954,24 +101958,24 @@ function dft({
101954
101958
  token: Y,
101955
101959
  intervalMs: HK,
101956
101960
  timeoutMs: aft,
101957
- fetchRun: ({ apiServiceUrl: et, token: Nt, runId: bn }) => {
101961
+ fetchRun: ({ apiServiceUrl: tt, token: Nt, runId: bn }) => {
101958
101962
  if (!(L != null && L.id))
101959
101963
  throw new Error("Missing saved item id for run polling.");
101960
101964
  return Q.getBriefingRun(
101961
- et,
101965
+ tt,
101962
101966
  Nt,
101963
101967
  L.id,
101964
101968
  bn
101965
101969
  );
101966
101970
  },
101967
- onRun: (et) => {
101968
- xe(et);
101971
+ onRun: (tt) => {
101972
+ xe(tt);
101969
101973
  },
101970
- onTerminalRun: (et) => {
101974
+ onTerminalRun: (tt) => {
101971
101975
  De("result"), me(null);
101972
101976
  },
101973
- onError: (et) => {
101974
- me(`Unable to refresh run status: ${Js(et)}`);
101977
+ onError: (tt) => {
101978
+ me(`Unable to refresh run status: ${Js(tt)}`);
101975
101979
  },
101976
101980
  onTimeout: () => {
101977
101981
  me(
@@ -101987,23 +101991,23 @@ function dft({
101987
101991
  token: Y,
101988
101992
  intervalMs: HK,
101989
101993
  timeoutMs: ift,
101990
- fetchRun: ({ apiServiceUrl: et, token: Nt, runId: bn }) => Q.getBriefingPreviewRun(
101991
- et,
101994
+ fetchRun: ({ apiServiceUrl: tt, token: Nt, runId: bn }) => Q.getBriefingPreviewRun(
101995
+ tt,
101992
101996
  Nt,
101993
101997
  bn
101994
101998
  ),
101995
- onRun: (et) => {
101996
- ae(et), et.status === "SUCCESS" && ge((Nt) => Nt ?? ee);
101999
+ onRun: (tt) => {
102000
+ ae(tt), tt.status === "SUCCESS" && ge((Nt) => Nt ?? ee);
101997
102001
  },
101998
- onTerminalRun: (et) => {
101999
- et.status === "FAILED" ? me(et.error || "Briefing preview failed.") : (me(null), De("result"));
102002
+ onTerminalRun: (tt) => {
102003
+ tt.status === "FAILED" ? me(tt.error || "Briefing preview failed.") : (me(null), De("result"));
102000
102004
  },
102001
- onError: (et) => {
102002
- me(`Unable to refresh briefing preview status: ${Js(et)}`);
102005
+ onError: (tt) => {
102006
+ me(`Unable to refresh briefing preview status: ${Js(tt)}`);
102003
102007
  },
102004
- onTimeout: (et) => {
102008
+ onTimeout: (tt) => {
102005
102009
  ae(
102006
- (Nt) => (Nt == null ? void 0 : Nt.id) === et ? {
102010
+ (Nt) => (Nt == null ? void 0 : Nt.id) === tt ? {
102007
102011
  ...Nt,
102008
102012
  status: "FAILED",
102009
102013
  completedAt: Nt.completedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
@@ -102011,11 +102015,11 @@ function dft({
102011
102015
  } : Nt
102012
102016
  ), me("Briefing preview status refresh timed out.");
102013
102017
  }
102014
- }), gn = !!(L != null && L.id), _r = (L == null ? void 0 : L.status) === "PAUSED" || J.schedule.status === "PAUSED", Ie = gn && !!(L != null && L.scheduleExpr || J.schedule.enabled), Ee = ye ?? (L == null ? void 0 : L.latestRun) ?? null, tt = Ee && Tm(Ee.status) && kr === Ee.id ? Ee : null, ut = Ee && N3(Ee.status) ? Ee : null, Yt = he && N3(he.status) ? he : null, sn = Qe === "result" && (Yt || ut) ? "result" : Qe === "plan" && pe ? "plan" : "edit", Qn = V.detail ?? (J.source.type === "dashboard" ? (
102018
+ }), gn = !!(L != null && L.id), _r = (L == null ? void 0 : L.status) === "PAUSED" || J.schedule.status === "PAUSED", Ie = gn && !!(L != null && L.scheduleExpr || J.schedule.enabled), Ee = ye ?? (L == null ? void 0 : L.latestRun) ?? null, et = Ee && Tm(Ee.status) && kr === Ee.id ? Ee : null, ut = Ee && N3(Ee.status) ? Ee : null, Yt = he && N3(he.status) ? he : null, sn = Qe === "result" && (Yt || ut) ? "result" : Qe === "plan" && pe ? "plan" : "edit", Qn = V.detail ?? (J.source.type === "dashboard" ? (
102015
102019
  // Prefer the dashboard's actual title from the store; never expose
102016
102020
  // the raw ID to end users.
102017
102021
  (A == null ? void 0 : A.title) ?? null
102018
- ) : "All project data available to this token"), rr = (L == null ? void 0 : L.status) ?? J.schedule.status, He = he !== null && Tm(he.status) && Pt === he.id, It = He || tt !== null, At = ne !== null || It, Sn = sn === "edit" && ut !== null && !It, ro = (he == null ? void 0 : he.status) === "SUCCESS" && he.result ? he : null, Ri = ro !== null && ie !== null && ie !== ee, _a = mt === "preview" ? he : null, Co = mt === "saved" ? ut : null, Pi = Co ? Fme(Co) : null, Zs = ((o8 = _a == null ? void 0 : _a.result) == null ? void 0 : o8.title) ?? (Pi == null ? void 0 : Pi.subject) ?? (Ko(Co == null ? void 0 : Co.result) && typeof Co.result.title == "string" ? Co.result.title : null) ?? (L == null ? void 0 : L.name) ?? "Briefing preview", hc = X(
102022
+ ) : "All project data available to this token"), rr = (L == null ? void 0 : L.status) ?? J.schedule.status, He = he !== null && Tm(he.status) && Pt === he.id, It = He || et !== null, At = ne !== null || It, Sn = sn === "edit" && ut !== null && !It, ro = (he == null ? void 0 : he.status) === "SUCCESS" && he.result ? he : null, Ri = ro !== null && ie !== null && ie !== ee, _a = mt === "preview" ? he : null, Co = mt === "saved" ? ut : null, Pi = Co ? Fme(Co) : null, Zs = ((o8 = _a == null ? void 0 : _a.result) == null ? void 0 : o8.title) ?? (Pi == null ? void 0 : Pi.subject) ?? (Ko(Co == null ? void 0 : Co.result) && typeof Co.result.title == "string" ? Co.result.title : null) ?? (L == null ? void 0 : L.name) ?? "Briefing preview", hc = X(
102019
102023
  () => ({
102020
102024
  dashboard: A,
102021
102025
  theme: P || "light",
@@ -102045,10 +102049,10 @@ function dft({
102045
102049
  ]
102046
102050
  );
102047
102051
  Ne(() => {
102048
- const et = (n == null ? void 0 : n.id) ?? null;
102049
- if (rn.current === et)
102052
+ const tt = (n == null ? void 0 : n.id) ?? null;
102053
+ if (rn.current === tt)
102050
102054
  return;
102051
- rn.current = et, gt(), _t(), on(), W(n ?? null);
102055
+ rn.current = tt, gt(), _t(), on(), W(n ?? null);
102052
102056
  let Nt = BG({
102053
102057
  briefing: n,
102054
102058
  sourceContext: V,
@@ -102096,14 +102100,14 @@ function dft({
102096
102100
  intent: r,
102097
102101
  draft: ni
102098
102102
  }), Ct = Z2(ri), be = ms.slackAllowed, Be = ms.emailEnabled, dt = ms.slackEnabled, Te = Be && dt, ot = (a8 = (i8 = J.delivery.channelConfigs) == null ? void 0 : i8.SLACK) == null ? void 0 : a8.slackConfig, Mt = ((s8 = ot == null ? void 0 : ot.destination) == null ? void 0 : s8.type) === "channel" ? ot.destination.channelId ?? "" : "", jt = Ve.find(
102099
- (et) => et.id === Mt
102103
+ (tt) => tt.id === Mt
102100
102104
  ), en = (ot == null ? void 0 : ot.threadMentions) ?? [], Mn = en.length > 0, xn = JSON.stringify({
102101
102105
  recipients: en
102102
102106
  }), Gn = dt && !Be ? "SLACK" : Be && !dt ? "EMAIL" : xt, Nn = Gn === "EMAIL" ? "SLACK" : "EMAIL";
102103
102107
  Ne(() => {
102104
102108
  if (!G || !Y || !dt)
102105
102109
  return;
102106
- let et = !1;
102110
+ let tt = !1;
102107
102111
  return Bt(!0), Ft(null), Promise.all([
102108
102112
  rP(
102109
102113
  G,
@@ -102120,13 +102124,13 @@ function dft({
102120
102124
  throw Nt;
102121
102125
  })
102122
102126
  ]).then(([Nt, bn]) => {
102123
- et || (Je(Nt), ct(bn.channels));
102127
+ tt || (Je(Nt), ct(bn.channels));
102124
102128
  }).catch((Nt) => {
102125
- et || (Ft(Js(Nt)), ct([]));
102129
+ tt || (Ft(Js(Nt)), ct([]));
102126
102130
  }).finally(() => {
102127
- et || Bt(!1);
102131
+ tt || Bt(!1);
102128
102132
  }), () => {
102129
- et = !0;
102133
+ tt = !0;
102130
102134
  };
102131
102135
  }, [
102132
102136
  dt,
@@ -102142,7 +102146,7 @@ function dft({
102142
102146
  Re(null);
102143
102147
  return;
102144
102148
  }
102145
- let et = !1;
102149
+ let tt = !1;
102146
102150
  return rP(
102147
102151
  G,
102148
102152
  Y,
@@ -102153,11 +102157,11 @@ function dft({
102153
102157
  body: xn
102154
102158
  }
102155
102159
  ).then((Nt) => {
102156
- et || Re(Nt);
102160
+ tt || Re(Nt);
102157
102161
  }).catch(() => {
102158
- et || Re(null);
102162
+ tt || Re(null);
102159
102163
  }), () => {
102160
- et = !0;
102164
+ tt = !0;
102161
102165
  };
102162
102166
  }, [
102163
102167
  dt,
@@ -102167,9 +102171,9 @@ function dft({
102167
102171
  Xe == null ? void 0 : Xe.installed,
102168
102172
  xn
102169
102173
  ]);
102170
- const vr = (et) => {
102171
- le((Nt) => LI(Nt, et)), ce([]), me(null), L != null && L.id || (ke(null), se((Nt) => Nt + 1), De("edit"));
102172
- }, pi = () => !G || !Y ? (me("Missing Semaphor API credentials."), null) : { apiServiceUrl: G, token: Y }, Fh = async (et) => {
102174
+ const vr = (tt) => {
102175
+ le((Nt) => LI(Nt, tt)), ce([]), me(null), L != null && L.id || (ke(null), se((Nt) => Nt + 1), De("edit"));
102176
+ }, pi = () => !G || !Y ? (me("Missing Semaphor API credentials."), null) : { apiServiceUrl: G, token: Y }, Fh = async (tt) => {
102173
102177
  const Nt = AG(ni);
102174
102178
  if (M && ni.attachments.length === 0 && (Nt.issues.push({
102175
102179
  field: "attachments",
@@ -102179,7 +102183,7 @@ function dft({
102179
102183
  const bn = pi();
102180
102184
  if (!bn)
102181
102185
  return null;
102182
- et != null && et.pendingAction && de(et.pendingAction);
102186
+ tt != null && tt.pendingAction && de(tt.pendingAction);
102183
102187
  try {
102184
102188
  const So = L != null && L.id ? await Q.updateBriefing(
102185
102189
  bn.apiServiceUrl,
@@ -102196,12 +102200,12 @@ function dft({
102196
102200
  const l8 = lft(So);
102197
102201
  return l8.length > 0 ? (ce(l8), me(null)) : me(Js(So)), null;
102198
102202
  } finally {
102199
- et != null && et.pendingAction && de(null);
102203
+ tt != null && tt.pendingAction && de(null);
102200
102204
  }
102201
102205
  }, Oh = async () => Fh({ pendingAction: "save" }), mc = () => {
102202
- const et = AG(ni);
102203
- return ce(et.issues), me(null), et.valid ? MG(ni) : null;
102204
- }, qd = async (et) => {
102206
+ const tt = AG(ni);
102207
+ return ce(tt.issues), me(null), tt.valid ? MG(ni) : null;
102208
+ }, qd = async (tt) => {
102205
102209
  const Nt = pi();
102206
102210
  if (!Nt)
102207
102211
  return null;
@@ -102215,15 +102219,15 @@ function dft({
102215
102219
  Nt.token,
102216
102220
  bn
102217
102221
  );
102218
- return ke(So.plan), et != null && et.silent || De("plan"), So.plan;
102222
+ return ke(So.plan), tt != null && tt.silent || De("plan"), So.plan;
102219
102223
  } catch (So) {
102220
102224
  return me(Js(So)), null;
102221
102225
  } finally {
102222
102226
  de(null);
102223
102227
  }
102224
102228
  }, jD = async () => {
102225
- const et = pi();
102226
- if (!et)
102229
+ const tt = pi();
102230
+ if (!tt)
102227
102231
  return;
102228
102232
  const Nt = mc();
102229
102233
  if (Nt)
@@ -102233,8 +102237,8 @@ function dft({
102233
102237
  return;
102234
102238
  de("preview");
102235
102239
  const So = await Q.runBriefingPreview(
102236
- et.apiServiceUrl,
102237
- et.token,
102240
+ tt.apiServiceUrl,
102241
+ tt.token,
102238
102242
  {
102239
102243
  draft: Nt,
102240
102244
  planId: bn.id,
@@ -102248,8 +102252,8 @@ function dft({
102248
102252
  de(null);
102249
102253
  }
102250
102254
  }, vg = async () => {
102251
- const et = pi();
102252
- if (et) {
102255
+ const tt = pi();
102256
+ if (tt) {
102253
102257
  if (!(L != null && L.id)) {
102254
102258
  await jD();
102255
102259
  return;
@@ -102261,8 +102265,8 @@ function dft({
102261
102265
  de("run"), me(null), ae(null);
102262
102266
  try {
102263
102267
  const Nt = await Q.runBriefingNow(
102264
- et.apiServiceUrl,
102265
- et.token,
102268
+ tt.apiServiceUrl,
102269
+ tt.token,
102266
102270
  L.id,
102267
102271
  { requestId: p() }
102268
102272
  );
@@ -102276,27 +102280,27 @@ function dft({
102276
102280
  }, QC = async () => {
102277
102281
  if (!(L != null && L.id))
102278
102282
  return null;
102279
- const et = pi();
102280
- if (!et)
102283
+ const tt = pi();
102284
+ if (!tt)
102281
102285
  return null;
102282
102286
  const Nt = await Q.getBriefing(
102283
- et.apiServiceUrl,
102284
- et.token,
102287
+ tt.apiServiceUrl,
102288
+ tt.token,
102285
102289
  L.id
102286
102290
  );
102287
102291
  return W(Nt.briefing), le(Jx(Nt.briefing)), g == null || g(Nt.briefing), Nt.briefing;
102288
102292
  }, JC = async () => {
102289
- if (!(L != null && L.id) || !(tt != null && tt.id))
102293
+ if (!(L != null && L.id) || !(et != null && et.id))
102290
102294
  return;
102291
- const et = pi();
102292
- if (et) {
102295
+ const tt = pi();
102296
+ if (tt) {
102293
102297
  de("cancelRun"), me(null);
102294
102298
  try {
102295
102299
  const Nt = await Q.cancelBriefingRun(
102296
- et.apiServiceUrl,
102297
- et.token,
102300
+ tt.apiServiceUrl,
102301
+ tt.token,
102298
102302
  L.id,
102299
- tt.id
102303
+ et.id
102300
102304
  );
102301
102305
  _t(), xe(Nt.run), De("result"), await QC().catch(() => null);
102302
102306
  } catch (Nt) {
@@ -102308,13 +102312,13 @@ function dft({
102308
102312
  }, HD = async () => {
102309
102313
  if (!He || !(he != null && he.id))
102310
102314
  return;
102311
- const et = pi();
102312
- if (et) {
102315
+ const tt = pi();
102316
+ if (tt) {
102313
102317
  de("cancelRun"), me(null);
102314
102318
  try {
102315
102319
  const Nt = await Q.cancelBriefingPreviewRun(
102316
- et.apiServiceUrl,
102317
- et.token,
102320
+ tt.apiServiceUrl,
102321
+ tt.token,
102318
102322
  he.id
102319
102323
  );
102320
102324
  on(), ae(Nt.previewRun), De("result");
@@ -102325,9 +102329,9 @@ function dft({
102325
102329
  }
102326
102330
  }
102327
102331
  }, UD = () => {
102328
- !L || !tt || C == null || C({
102329
- briefing: { ...L, latestRun: tt },
102330
- run: tt
102332
+ !L || !et || C == null || C({
102333
+ briefing: { ...L, latestRun: et },
102334
+ run: et
102331
102335
  });
102332
102336
  }, eS = async () => {
102333
102337
  if (!J.instruction.trim())
@@ -102350,7 +102354,7 @@ function dft({
102350
102354
  }
102351
102355
  }, qD = () => {
102352
102356
  Qt && (vr({ instruction: Qt.previousText }), nn(null));
102353
- }, we = async (et) => {
102357
+ }, we = async (tt) => {
102354
102358
  if (!(L != null && L.id))
102355
102359
  return;
102356
102360
  const Nt = pi();
@@ -102361,7 +102365,7 @@ function dft({
102361
102365
  Nt.apiServiceUrl,
102362
102366
  Nt.token,
102363
102367
  L.id,
102364
- et
102368
+ tt
102365
102369
  );
102366
102370
  const bn = await QC().catch(() => null), So = (bn == null ? void 0 : bn.latestRun) ?? null;
102367
102371
  xe(So), So || De("edit");
@@ -102371,14 +102375,14 @@ function dft({
102371
102375
  de(null);
102372
102376
  }
102373
102377
  }
102374
- }, Fe = async (et) => {
102378
+ }, Fe = async (tt) => {
102375
102379
  if (!(L != null && L.id))
102376
102380
  return;
102377
102381
  const Nt = pi();
102378
102382
  if (Nt) {
102379
- de(et === "PAUSED" ? "pause" : "resume"), me(null);
102383
+ de(tt === "PAUSED" ? "pause" : "resume"), me(null);
102380
102384
  try {
102381
- const bn = et === "PAUSED" ? await Q.pauseBriefing(
102385
+ const bn = tt === "PAUSED" ? await Q.pauseBriefing(
102382
102386
  Nt.apiServiceUrl,
102383
102387
  Nt.token,
102384
102388
  L.id
@@ -102395,12 +102399,12 @@ function dft({
102395
102399
  }
102396
102400
  }
102397
102401
  }, Ke = J.instruction.split(`
102398
- `).map((et) => et.trim()).find((et) => et.length > 0), tn = X(
102402
+ `).map((tt) => tt.trim()).find((tt) => tt.length > 0), tn = X(
102399
102403
  () => L ? Jx(L) : null,
102400
102404
  [L]
102401
- ), On = !!tn && JSON.stringify(ni) !== JSON.stringify(tn), mr = J.body.type === "custom_message", Kr = gn && !k && J.body.type === "generated_analysis", pr = J.source.type === "dashboard" || !!(l != null && l.length), jr = mr ? ri ? "Message (optional)" : "Email body" : "What should this briefing investigate?", ps = mr ? "Write the email body that recipients will see." : "Describe the outcome in business terms. Mention what to watch, when to bother the team, and what to include in the briefing.", Ia = mr ? "Sent as-is in the email body. No analysis is generated." : "Tell the analyst what to watch, when to escalate, and what to include.", Wd = (et) => {
102405
+ ), On = !!tn && JSON.stringify(ni) !== JSON.stringify(tn), mr = J.body.type === "custom_message", Kr = gn && !k && J.body.type === "generated_analysis", pr = J.source.type === "dashboard" || !!(l != null && l.length), jr = mr ? ri ? "Message (optional)" : "Email body" : "What should this briefing investigate?", ps = mr ? "Write the email body that recipients will see." : "Describe the outcome in business terms. Mention what to watch, when to bother the team, and what to include in the briefing.", Ia = mr ? "Sent as-is in the email body. No analysis is generated." : "Tell the analyst what to watch, when to escalate, and what to include.", Wd = (tt) => {
102402
102406
  var Nt, bn;
102403
- if (Ze(et), et === "EMAIL") {
102407
+ if (Ze(tt), tt === "EMAIL") {
102404
102408
  vr({
102405
102409
  delivery: {
102406
102410
  channels: MN(J.delivery.channels, "EMAIL")
@@ -102440,9 +102444,9 @@ function dft({
102440
102444
  return;
102441
102445
  }
102442
102446
  Wd(Nn);
102443
- }, $0 = (et) => {
102447
+ }, $0 = (tt) => {
102444
102448
  var bn;
102445
- const Nt = Ve.find((So) => So.id === et);
102449
+ const Nt = Ve.find((So) => So.id === tt);
102446
102450
  Ze("SLACK"), vr({
102447
102451
  delivery: {
102448
102452
  channels: MN(J.delivery.channels, "SLACK"),
@@ -102455,7 +102459,7 @@ function dft({
102455
102459
  ...ot ?? {},
102456
102460
  destination: {
102457
102461
  type: "channel",
102458
- channelId: et,
102462
+ channelId: tt,
102459
102463
  ...Nt ? { channelName: Nt.name } : {},
102460
102464
  ...Nt ? { isPrivate: Nt.isPrivate } : {}
102461
102465
  },
@@ -102467,7 +102471,7 @@ function dft({
102467
102471
  }
102468
102472
  }
102469
102473
  });
102470
- }, tS = (et) => {
102474
+ }, tS = (tt) => {
102471
102475
  var Nt, bn;
102472
102476
  Ze("SLACK"), vr({
102473
102477
  delivery: {
@@ -102480,7 +102484,7 @@ function dft({
102480
102484
  slackConfig: {
102481
102485
  ...ot ?? {},
102482
102486
  destination: ((bn = ot == null ? void 0 : ot.destination) == null ? void 0 : bn.type) === "channel" ? ot.destination : { type: "channel", channelId: "" },
102483
- threadMentions: et,
102487
+ threadMentions: tt,
102484
102488
  postThreadDetail: (ot == null ? void 0 : ot.postThreadDetail) ?? !0,
102485
102489
  includeDashboardLink: !0,
102486
102490
  includeBriefingLink: !0
@@ -102490,11 +102494,11 @@ function dft({
102490
102494
  }
102491
102495
  });
102492
102496
  }, Gxe = X(() => {
102493
- const et = J.schedule.enabled ? eJ(
102497
+ const tt = J.schedule.enabled ? eJ(
102494
102498
  J.schedule.scheduleExpr,
102495
102499
  J.schedule.timezone
102496
102500
  ) ?? "Invalid schedule" : "On demand", Nt = J.delivery.recipients.length, bn = Nt === 0 ? "No email recipients" : `${Nt} email recipient${Nt === 1 ? "" : "s"}`, So = jt ? `#${jt.name}` : "Slack channel";
102497
- return Te ? `${et} · ${bn} · ${So}` : dt ? `${et} · ${jt ? `#${jt.name}` : "Slack channel"}` : `${et} · ${bn}`;
102501
+ return Te ? `${tt} · ${bn} · ${So}` : dt ? `${tt} · ${jt ? `#${jt.name}` : "Slack channel"}` : `${tt} · ${bn}`;
102498
102502
  }, [
102499
102503
  J.delivery.recipients.length,
102500
102504
  J.schedule.enabled,
@@ -102571,21 +102575,21 @@ function dft({
102571
102575
  ]
102572
102576
  }
102573
102577
  ) : null,
102574
- tt ? /* @__PURE__ */ d(Udt, {}) : null,
102578
+ et ? /* @__PURE__ */ d(Udt, {}) : null,
102575
102579
  /* @__PURE__ */ d(
102576
102580
  Wdt,
102577
102581
  {
102578
102582
  pendingAction: ne,
102579
102583
  previewRun: he,
102580
- savedActiveRun: tt,
102584
+ savedActiveRun: et,
102581
102585
  detailsVisible: st,
102582
- onShowDetails: () => at((et) => !et),
102586
+ onShowDetails: () => at((tt) => !tt),
102583
102587
  onCancelPreviewRun: He ? HD : void 0,
102584
- onCancelSavedRun: tt ? JC : void 0,
102585
- onMinimizeRun: tt && C ? UD : void 0
102588
+ onCancelSavedRun: et ? JC : void 0,
102589
+ onMinimizeRun: et && C ? UD : void 0
102586
102590
  }
102587
102591
  ),
102588
- st && he && Tm(he.status) ? /* @__PURE__ */ d(BK, { run: he }) : st && tt ? /* @__PURE__ */ d(BK, { run: tt }) : null,
102592
+ st && he && Tm(he.status) ? /* @__PURE__ */ d(BK, { run: he }) : st && et ? /* @__PURE__ */ d(BK, { run: et }) : null,
102589
102593
  /* @__PURE__ */ d("div", { className: "flex-1 space-y-5 overflow-y-auto px-4 py-4", children: sn === "edit" ? /* @__PURE__ */ w($e, { children: [
102590
102594
  Kr ? /* @__PURE__ */ w("div", { className: "rounded-card border border-amber-200 bg-amber-50 px-3 py-2.5 text-[12px] leading-[1.5] text-amber-900 dark:border-amber-900/70 dark:bg-amber-950/30 dark:text-amber-200", children: [
102591
102595
  /* @__PURE__ */ d("div", { className: "font-medium", children: "Analytical briefings are disabled for this project." }),
@@ -102654,8 +102658,8 @@ function dft({
102654
102658
  autoFocus: !0,
102655
102659
  className: "min-h-0 flex-1 resize-none bg-transparent text-[14px] leading-[1.6] text-card-foreground/90 outline-none placeholder:text-muted-foreground",
102656
102660
  value: J.instruction,
102657
- onChange: (et) => {
102658
- vr({ instruction: et.target.value });
102661
+ onChange: (tt) => {
102662
+ vr({ instruction: tt.target.value });
102659
102663
  },
102660
102664
  placeholder: ps,
102661
102665
  "aria-label": jr
@@ -102746,7 +102750,7 @@ function dft({
102746
102750
  onSecondaryDeliveryChange: L0,
102747
102751
  onSlackChannelChange: $0,
102748
102752
  onSlackMentionsChange: tS,
102749
- onSlackRefresh: () => Rt((et) => et + 1)
102753
+ onSlackRefresh: () => Rt((tt) => tt + 1)
102750
102754
  }
102751
102755
  ),
102752
102756
  mr ? null : /* @__PURE__ */ w("div", { children: [
@@ -102757,7 +102761,7 @@ function dft({
102757
102761
  source: J.source,
102758
102762
  resolvedSourceContext: V,
102759
102763
  sourceDetail: Qn,
102760
- onChange: (et) => vr({ source: et })
102764
+ onChange: (tt) => vr({ source: tt })
102761
102765
  }
102762
102766
  )
102763
102767
  ] })
@@ -102805,13 +102809,13 @@ function dft({
102805
102809
  /* @__PURE__ */ d(Sr, { className: "h-3 w-3" }),
102806
102810
  "Fix these before saving:"
102807
102811
  ] }),
102808
- /* @__PURE__ */ d("ul", { className: "space-y-0.5 pl-4", children: ue.map((et) => /* @__PURE__ */ d(
102812
+ /* @__PURE__ */ d("ul", { className: "space-y-0.5 pl-4", children: ue.map((tt) => /* @__PURE__ */ d(
102809
102813
  "li",
102810
102814
  {
102811
102815
  className: "list-disc marker:text-destructive/60",
102812
- children: et.message
102816
+ children: tt.message
102813
102817
  },
102814
- `${et.field}:${et.message}`
102818
+ `${tt.field}:${tt.message}`
102815
102819
  )) })
102816
102820
  ]
102817
102821
  }
@@ -102864,8 +102868,8 @@ function dft({
102864
102868
  Gi,
102865
102869
  {
102866
102870
  open: vt,
102867
- onOpenChange: (et) => {
102868
- Oe(et), et || We(null);
102871
+ onOpenChange: (tt) => {
102872
+ Oe(tt), tt || We(null);
102869
102873
  },
102870
102874
  children: /* @__PURE__ */ w(Ei, { className: "flex max-h-[90vh] w-[min(960px,calc(100vw-32px))] max-w-none flex-col gap-0 overflow-hidden p-0", children: [
102871
102875
  /* @__PURE__ */ w(ls, { className: "border-b border-border px-6 py-3 text-left", children: [
@@ -104033,7 +104037,7 @@ function qK({
104033
104037
  ] });
104034
104038
  }
104035
104039
  if (!e.id) return null;
104036
- const _r = ((hc = (Zs = E.preferences) == null ? void 0 : Zs.displayOptions) == null ? void 0 : hc.showChrome) ?? !0, Ie = ((ni = (ms = E.preferences) == null ? void 0 : ms.displayOptions) == null ? void 0 : ni.allowScroll) ?? !0, Ee = ((Ct = (ri = E.preferences) == null ? void 0 : ri.displayOptions) == null ? void 0 : Ct.showInlineFilterBar) ?? !0, tt = Xnt(E), ut = Rfe(E), Yt = _r ? "px-5 pb-3" : "px-3 pb-3", sn = E.type === "table" || E.type === "pivotTable" || E.type === "aggregateTable" || E.type === "matrixTable" || E.type === "detailTable", Qn = !hh(s.mode), rr = hn(), He = _r ? /* @__PURE__ */ w($e, { children: [
104040
+ const _r = ((hc = (Zs = E.preferences) == null ? void 0 : Zs.displayOptions) == null ? void 0 : hc.showChrome) ?? !0, Ie = ((ni = (ms = E.preferences) == null ? void 0 : ms.displayOptions) == null ? void 0 : ni.allowScroll) ?? !0, Ee = ((Ct = (ri = E.preferences) == null ? void 0 : ri.displayOptions) == null ? void 0 : Ct.showInlineFilterBar) ?? !0, et = Xnt(E), ut = Rfe(E), Yt = _r ? "px-5 pb-3" : "px-3 pb-3", sn = E.type === "table" || E.type === "pivotTable" || E.type === "aggregateTable" || E.type === "matrixTable" || E.type === "detailTable", Qn = !hh(s.mode), rr = hn(), He = _r ? /* @__PURE__ */ w($e, { children: [
104037
104041
  pe ? /* @__PURE__ */ d(
104038
104042
  Fee,
104039
104043
  {
@@ -104093,7 +104097,7 @@ function qK({
104093
104097
  ] })
104094
104098
  }
104095
104099
  ) : /* @__PURE__ */ d("div", { className: "h-8" }),
104096
- (tt || Ee && E.inlineFilters && E.inlineFilters.length > 0) && /* @__PURE__ */ d(
104100
+ (et || Ee && E.inlineFilters && E.inlineFilters.length > 0) && /* @__PURE__ */ d(
104097
104101
  "div",
104098
104102
  {
104099
104103
  className: K(
@@ -104113,7 +104117,7 @@ function qK({
104113
104117
  sheetId: h || ""
104114
104118
  }
104115
104119
  ),
104116
- tt && /* @__PURE__ */ d(nrt, { card: E })
104120
+ et && /* @__PURE__ */ d(nrt, { card: E })
104117
104121
  ] })
104118
104122
  }
104119
104123
  ),
@@ -116239,14 +116243,14 @@ function Kbt({
116239
116243
  }) {
116240
116244
  var gn, _r, Ie;
116241
116245
  const { tokenProps: f } = Ut(), h = ((_r = (gn = f.config) == null ? void 0 : gn.projectFeatures) == null ? void 0 : _r.features.aiWritingHelpers) !== !1, { selectedConnection: m } = Wte(), p = ht((Ee) => {
116242
- var tt;
116243
- return (tt = Ee.card) == null ? void 0 : tt.config;
116246
+ var et;
116247
+ return (et = Ee.card) == null ? void 0 : et.config;
116244
116248
  }), g = ht((Ee) => {
116245
- var tt;
116246
- return (tt = Ee.card) == null ? void 0 : tt.dataSource;
116249
+ var et;
116250
+ return (et = Ee.card) == null ? void 0 : et.dataSource;
116247
116251
  }), b = ht((Ee) => {
116248
- var tt;
116249
- return (tt = Ee.card) == null ? void 0 : tt.type;
116252
+ var et;
116253
+ return (et = Ee.card) == null ? void 0 : et.type;
116250
116254
  }), x = ht((Ee) => Ee.filterValues) ?? Hbt, [v, C] = te(c), [S, N] = te(""), [_, k] = te(""), [I, T] = te(null), [E, D] = te("card"), [M, A] = te({}), [P, O] = te(""), [$, z] = te(!1), [H, R] = te(""), [U, q] = te(""), [F, Z] = te(
116251
116255
  void 0
116252
116256
  ), [G, Y] = te(null), [Q, V] = te(!1), [B, j] = te(!1), [L, W] = te(null), J = Ha(), le = Me(!1), ne = Me(null), { userContext: de } = ds(), ue = X(
@@ -116329,7 +116333,7 @@ function Kbt({
116329
116333
  Ge
116330
116334
  );
116331
116335
  return Ee.filter(
116332
- (tt) => !!tt
116336
+ (et) => !!et
116333
116337
  );
116334
116338
  }, [Ge, _]), Vt = X(
116335
116339
  () => lV(Ft),
@@ -116358,18 +116362,18 @@ function Kbt({
116358
116362
  }, Le = ve(() => {
116359
116363
  N(""), k(""), T(null), D("card"), A({}), O(""), z(!1), R(""), q(""), Z(void 0), W(null), Y(null), V(!1), We(), at(), t(!1);
116360
116364
  }, [t, We, at]), Ue = ve(
116361
- (Ee, tt) => Ee.replace(/\{field_(\d+)\}/g, (ut, Yt) => {
116365
+ (Ee, et) => Ee.replace(/\{field_(\d+)\}/g, (ut, Yt) => {
116362
116366
  var rr;
116363
- const sn = tt[Number(Yt)];
116367
+ const sn = et[Number(Yt)];
116364
116368
  return sn ? `{${((rr = Ge.find((He) => He.id === sn.id)) == null ? void 0 : rr.tokenLabel) || sn.label || sn.name}}` : ut;
116365
116369
  }),
116366
116370
  [Ge]
116367
116371
  ), qe = ve(
116368
116372
  (Ee) => {
116369
116373
  var Yt;
116370
- const tt = ((Yt = Ee.calculatedFormula) == null ? void 0 : Yt.inputFields) || [], ut = Ee.role === "metric" ? obt(Ee) : Ee.expression || "";
116374
+ const et = ((Yt = Ee.calculatedFormula) == null ? void 0 : Yt.inputFields) || [], ut = Ee.role === "metric" ? obt(Ee) : Ee.expression || "";
116371
116375
  k(
116372
- Ue(ut, tt)
116376
+ Ue(ut, et)
116373
116377
  );
116374
116378
  },
116375
116379
  [Ue]
@@ -116397,8 +116401,8 @@ function Kbt({
116397
116401
  T(Yt);
116398
116402
  return;
116399
116403
  }
116400
- const tt = u && u.length > 0 ? u.includes(c) ? c : u[0] : c;
116401
- C(tt), N(""), k(""), T(null), W(null), D("card");
116404
+ const et = u && u.length > 0 ? u.includes(c) ? c : u[0] : c;
116405
+ C(et), N(""), k(""), T(null), W(null), D("card");
116402
116406
  }, [
116403
116407
  e,
116404
116408
  r,
@@ -116410,35 +116414,35 @@ function Kbt({
116410
116414
  ]);
116411
116415
  const nt = ve(
116412
116416
  (Ee) => {
116413
- const tt = typeof document < "u" ? document.getElementById(J) : null;
116414
- if (!tt) {
116417
+ const et = typeof document < "u" ? document.getElementById(J) : null;
116418
+ if (!et) {
116415
116419
  k((sn) => sn + Ee);
116416
116420
  return;
116417
116421
  }
116418
- const ut = tt.selectionStart || 0, Yt = tt.selectionEnd || 0;
116422
+ const ut = et.selectionStart || 0, Yt = et.selectionEnd || 0;
116419
116423
  k(
116420
116424
  (sn) => `${sn.slice(0, ut)}${Ee}${sn.slice(Yt)}`
116421
116425
  ), requestAnimationFrame(() => {
116422
- tt.focus();
116426
+ et.focus();
116423
116427
  const sn = ut + Ee.length;
116424
- tt.setSelectionRange(sn, sn);
116428
+ et.setSelectionRange(sn, sn);
116425
116429
  });
116426
116430
  },
116427
116431
  [J]
116428
116432
  ), Xt = (Ee) => {
116429
116433
  if (pe) return;
116430
- const tt = Ee.tokenLabel || Ee.label || Ee.name;
116431
- nt(`{${tt}}`);
116434
+ const et = Ee.tokenLabel || Ee.label || Ee.name;
116435
+ nt(`{${et}}`);
116432
116436
  }, $t = (Ee) => {
116433
116437
  pe || nt(Ee);
116434
116438
  }, Qt = async () => {
116435
116439
  const Ee = {};
116436
116440
  return S.trim() || (Ee.name = "Name is required"), _.trim() || (Ee.expression = "Expression is required"), Ee.expression || (await vt()).isValid || (Ee.expression = "Fix validation errors before saving"), A(Ee), Object.keys(Ee).length === 0;
116437
116441
  }, nn = () => {
116438
- const { orderedTokens: Ee, orderedFields: tt } = zk(
116442
+ const { orderedTokens: Ee, orderedFields: et } = zk(
116439
116443
  _,
116440
116444
  Ge
116441
- ), ut = tt.filter(
116445
+ ), ut = et.filter(
116442
116446
  (Qn) => !!Qn
116443
116447
  ), Yt = A3(
116444
116448
  _,
@@ -116456,10 +116460,10 @@ function Kbt({
116456
116460
  ...sn
116457
116461
  } : sn;
116458
116462
  }, rn = () => {
116459
- const { orderedTokens: Ee, orderedFields: tt } = zk(
116463
+ const { orderedTokens: Ee, orderedFields: et } = zk(
116460
116464
  _,
116461
116465
  Ge
116462
- ), ut = tt.filter(
116466
+ ), ut = et.filter(
116463
116467
  (rr) => !!rr
116464
116468
  ), Yt = dbt(
116465
116469
  ut,
@@ -116488,7 +116492,7 @@ function Kbt({
116488
116492
  }));
116489
116493
  return;
116490
116494
  }
116491
- const tt = v === "dimension" ? nn() : rn();
116495
+ const et = v === "dimension" ? nn() : rn();
116492
116496
  if (Ee === "sheet") {
116493
116497
  if (!a) {
116494
116498
  A((ut) => ({
@@ -116497,7 +116501,7 @@ function Kbt({
116497
116501
  }));
116498
116502
  return;
116499
116503
  }
116500
- await a(tt), Le();
116504
+ await a(et), Le();
116501
116505
  return;
116502
116506
  }
116503
116507
  if (Ee === "dashboard") {
@@ -116508,10 +116512,10 @@ function Kbt({
116508
116512
  }));
116509
116513
  return;
116510
116514
  }
116511
- await s(tt), Le();
116515
+ await s(et), Le();
116512
116516
  return;
116513
116517
  }
116514
- await i(tt), Le();
116518
+ await i(et), Le();
116515
116519
  }, gt = async () => {
116516
116520
  if (pe || (A({}), !await Qt())) return;
116517
116521
  const Ee = ke || he ? E : o || "card";
@@ -117141,8 +117145,8 @@ const Uge = Ce.memo(function({
117141
117145
  inlineFilters: r
117142
117146
  } = {}) {
117143
117147
  var hn, on, gn, _r;
117144
- const [o, i] = te(""), [a, s] = te("all"), l = Me(null), [c, u] = te(null), [f, h] = te(!1), m = 280, p = (Ie, Ee) => (tt, ut) => {
117145
- if (!tt) {
117148
+ const [o, i] = te(""), [a, s] = te("all"), l = Me(null), [c, u] = te(null), [f, h] = te(!1), m = 280, p = (Ie, Ee) => (et, ut) => {
117149
+ if (!et) {
117146
117150
  u(
117147
117151
  (rr) => rr && rr.field.id === Ie.id ? null : rr
117148
117152
  );
@@ -117225,7 +117229,7 @@ const Uge = Ce.memo(function({
117225
117229
  }, at = (Ie) => {
117226
117230
  const Ee = Ie.filter(ge);
117227
117231
  return a === "all" ? Ee : Ee.filter(
117228
- (tt) => st(tt) === a
117232
+ (et) => st(et) === a
117229
117233
  );
117230
117234
  }, xt = a === "all" ? Qe : Qe.filter(
117231
117235
  (Ie) => st(Ie) === a
@@ -117235,17 +117239,17 @@ const Uge = Ce.memo(function({
117235
117239
  ), Oe = pe.filter(
117236
117240
  (Ie) => !vt(Ie)
117237
117241
  ), We = at(Oe).sort(Ge).reduce((Ie, Ee) => {
117238
- const tt = Ee.qualifiedEntityName || "Other Fields";
117239
- return Ie[tt] || (Ie[tt] = {
117242
+ const et = Ee.qualifiedEntityName || "Other Fields";
117243
+ return Ie[et] || (Ie[et] = {
117240
117244
  label: sp(Ee.entityName),
117241
117245
  fields: []
117242
- }), Ie[tt].fields.push(Ee), Ie;
117246
+ }), Ie[et].fields.push(Ee), Ie;
117243
117247
  }, {}), Xe = Ce.useMemo(
117244
117248
  () => Object.entries(We).map(([Ie, Ee]) => {
117245
- const tt = ke.find((Yt) => Yt.entityName === Ie) || {
117249
+ const et = ke.find((Yt) => Yt.entityName === Ie) || {
117246
117250
  entityName: Ie,
117247
117251
  label: Ee.label
117248
- }, ut = Ie === As ? "Domain Calculated Fields" : tt.label || tt.entityName;
117252
+ }, ut = Ie === As ? "Domain Calculated Fields" : et.label || et.entityName;
117249
117253
  return {
117250
117254
  groupName: Ie,
117251
117255
  groupLabel: ut,
@@ -117260,10 +117264,10 @@ const Uge = Ce.memo(function({
117260
117264
  [We, ke, Ge]
117261
117265
  ), Je = (Ie) => Ie.id || `${Ie.entityName}-${Ie.qualifiedEntityName}-${Ie.name}-${Ie.role || "field"}`, Ve = Ce.useMemo(() => {
117262
117266
  const Ie = /* @__PURE__ */ new Map();
117263
- return pe.forEach((tt) => {
117267
+ return pe.forEach((et) => {
117264
117268
  Ie.set(
117265
- Je(tt),
117266
- uie(tt, {
117269
+ Je(et),
117270
+ uie(et, {
117267
117271
  joinabilityMap: (ue == null ? void 0 : ue.joinabilityMap) || null,
117268
117272
  selectedFields: ce,
117269
117273
  cardConfig: D,
@@ -117361,7 +117365,7 @@ const Uge = Ce.memo(function({
117361
117365
  }, $t = (Ie) => {
117362
117366
  var Ee;
117363
117367
  return (Ee = A == null ? void 0 : A.calculatedFields) == null ? void 0 : Ee.find(
117364
- (tt) => Rf(tt, Ie)
117368
+ (et) => Rf(et, Ie)
117365
117369
  );
117366
117370
  }, Qt = (Ie) => F.find(
117367
117371
  (Ee) => Rf(Ee, Ie, {
@@ -117421,8 +117425,8 @@ const Uge = Ce.memo(function({
117421
117425
  ), b(!0);
117422
117426
  return;
117423
117427
  }
117424
- const tt = qe(Ie);
117425
- tt && (x(tt), C("card"), N(tt.role === "metric" ? "metric" : "dimension"), b(!0));
117428
+ const et = qe(Ie);
117429
+ et && (x(et), C("card"), N(et.role === "metric" ? "metric" : "dimension"), b(!0));
117426
117430
  }, ze = async (Ie) => {
117427
117431
  if (!xe)
117428
117432
  return;
@@ -117430,18 +117434,18 @@ const Uge = Ce.memo(function({
117430
117434
  yt.error("Domain calculated fields are read-only in this explorer.");
117431
117435
  return;
117432
117436
  }
117433
- const Ee = nt(Ie), tt = {
117437
+ const Ee = nt(Ie), et = {
117434
117438
  allowComparableFallback: Ee.scope !== "card"
117435
117439
  };
117436
117440
  if (Ee.scope === "sheet") {
117437
- kr(Ee.matchedField || Ie), nn(Ie, tt);
117441
+ kr(Ee.matchedField || Ie), nn(Ie, et);
117438
117442
  return;
117439
117443
  }
117440
117444
  if (Ee.scope === "dashboard") {
117441
- rn(Ee.matchedField || Ie), nn(Ie, tt);
117445
+ rn(Ee.matchedField || Ie), nn(Ie, et);
117442
117446
  return;
117443
117447
  }
117444
- nn(Ie, tt), Xt(Ie, tt);
117448
+ nn(Ie, et), Xt(Ie, et);
117445
117449
  }, _t = async () => {
117446
117450
  if (_) {
117447
117451
  T(!0);
@@ -117617,7 +117621,7 @@ const Uge = Ce.memo(function({
117617
117621
  /* @__PURE__ */ d(iT, { className: "pb-1", children: /* @__PURE__ */ w("div", { children: [
117618
117622
  Ie.fields.length === 0 && ct && /* @__PURE__ */ d("p", { className: "px-4 py-2 text-[11px] text-muted-foreground", children: "No calculated fields yet — click + to add." }),
117619
117623
  Ie.fields.map((Ee) => {
117620
- const tt = Ve.get(
117624
+ const et = Ve.get(
117621
117625
  Je(Ee)
117622
117626
  ), ut = t === "editor" && xe && eu(Ee);
117623
117627
  return /* @__PURE__ */ d(
@@ -117625,11 +117629,11 @@ const Uge = Ce.memo(function({
117625
117629
  {
117626
117630
  field: Ee,
117627
117631
  context: t,
117628
- fieldState: tt,
117632
+ fieldState: et,
117629
117633
  onFieldSelect: n,
117630
117634
  inlineFilters: t === "inline-filter" || t === "document-filter" ? r : void 0,
117631
117635
  actions: ut ? Pt(Ee) : void 0,
117632
- onHover: p(Ee, tt)
117636
+ onHover: p(Ee, et)
117633
117637
  },
117634
117638
  Ee.id
117635
117639
  );
@@ -117639,7 +117643,7 @@ const Uge = Ce.memo(function({
117639
117643
  },
117640
117644
  Ie.key
117641
117645
  )),
117642
- Xe.map(({ groupName: Ie, groupLabel: Ee, fields: tt }) => /* @__PURE__ */ w(
117646
+ Xe.map(({ groupName: Ie, groupLabel: Ee, fields: et }) => /* @__PURE__ */ w(
117643
117647
  rT,
117644
117648
  {
117645
117649
  value: Ie,
@@ -117652,11 +117656,11 @@ const Uge = Ce.memo(function({
117652
117656
  className: "flex min-w-0 flex-1 items-center gap-1.5",
117653
117657
  children: [
117654
117658
  /* @__PURE__ */ d("span", { className: "max-w-[180px] truncate text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: Ee }),
117655
- /* @__PURE__ */ d("span", { className: "font-mono text-[10px] tabular-nums text-muted-foreground/70", children: tt.length })
117659
+ /* @__PURE__ */ d("span", { className: "font-mono text-[10px] tabular-nums text-muted-foreground/70", children: et.length })
117656
117660
  ]
117657
117661
  }
117658
117662
  ) }),
117659
- /* @__PURE__ */ d(iT, { className: "pb-2", children: /* @__PURE__ */ d("div", { className: "space-y-1", children: tt.map((ut) => {
117663
+ /* @__PURE__ */ d(iT, { className: "pb-2", children: /* @__PURE__ */ d("div", { className: "space-y-1", children: et.map((ut) => {
117660
117664
  const Yt = Ve.get(
117661
117665
  Je(ut)
117662
117666
  ), sn = t === "editor" && xe && eu(ut);
@@ -117756,7 +117760,7 @@ const Uge = Ce.memo(function({
117756
117760
  existingFieldScope: v,
117757
117761
  initialFieldType: S,
117758
117762
  onSave: (Ie) => {
117759
- const Ee = y, tt = v === "dashboard" ? F : (A == null ? void 0 : A.calculatedFields) || [];
117763
+ const Ee = y, et = v === "dashboard" ? F : (A == null ? void 0 : A.calculatedFields) || [];
117760
117764
  if (Ie.role === "metric") {
117761
117765
  const {
117762
117766
  nextActiveFields: rr,
@@ -117767,7 +117771,7 @@ const Uge = Ce.memo(function({
117767
117771
  activeFields: ae,
117768
117772
  sortByFields: se,
117769
117773
  storedFields: ie,
117770
- sharedFields: tt,
117774
+ sharedFields: et,
117771
117775
  updatedField: Ie,
117772
117776
  editingField: Ee,
117773
117777
  previousScope: v
@@ -117777,9 +117781,9 @@ const Uge = Ce.memo(function({
117777
117781
  ...He ? { sortByColumns: He } : {}
117778
117782
  }), O(M.id, {
117779
117783
  calculatedFields: pt
117780
- }), v === "dashboard" && It !== tt ? U(It) : A && It !== tt && Ug({
117784
+ }), v === "dashboard" && It !== et ? U(It) : A && It !== et && Ug({
117781
117785
  nextSharedFields: It,
117782
- currentSharedFields: tt,
117786
+ currentSharedFields: et,
117783
117787
  isVisualEditing: z,
117784
117788
  selectedSheetId: H,
117785
117789
  updateFrame: $,
@@ -117796,7 +117800,7 @@ const Uge = Ce.memo(function({
117796
117800
  activeFields: ee,
117797
117801
  sortByFields: se,
117798
117802
  storedFields: ie,
117799
- sharedFields: tt,
117803
+ sharedFields: et,
117800
117804
  updatedField: Ie,
117801
117805
  editingField: Ee,
117802
117806
  previousScope: v
@@ -117806,9 +117810,9 @@ const Uge = Ce.memo(function({
117806
117810
  ...Yt ? { sortByColumns: Yt } : {}
117807
117811
  }), O(M.id, {
117808
117812
  calculatedFields: sn
117809
- }), v === "dashboard" && Qn !== tt ? U(Qn) : A && Qn !== tt && Ug({
117813
+ }), v === "dashboard" && Qn !== et ? U(Qn) : A && Qn !== et && Ug({
117810
117814
  nextSharedFields: Qn,
117811
- currentSharedFields: tt,
117815
+ currentSharedFields: et,
117812
117816
  isVisualEditing: z,
117813
117817
  selectedSheetId: H,
117814
117818
  updateFrame: $,
@@ -117816,7 +117820,7 @@ const Uge = Ce.memo(function({
117816
117820
  });
117817
117821
  },
117818
117822
  onSaveToSheet: (Ie) => {
117819
- const Ee = y, tt = (A == null ? void 0 : A.calculatedFields) || [];
117823
+ const Ee = y, et = (A == null ? void 0 : A.calculatedFields) || [];
117820
117824
  if (Ie.role === "metric") {
117821
117825
  const {
117822
117826
  nextActiveFields: He,
@@ -117828,7 +117832,7 @@ const Uge = Ce.memo(function({
117828
117832
  activeFields: ae,
117829
117833
  sortByFields: se,
117830
117834
  storedFields: ie,
117831
- sheetFields: tt,
117835
+ sheetFields: et,
117832
117836
  dashboardFields: F,
117833
117837
  updatedField: Ie,
117834
117838
  editingField: Ee,
@@ -117836,7 +117840,7 @@ const Uge = Ce.memo(function({
117836
117840
  });
117837
117841
  A && Ug({
117838
117842
  nextSharedFields: At,
117839
- currentSharedFields: tt,
117843
+ currentSharedFields: et,
117840
117844
  isVisualEditing: z,
117841
117845
  selectedSheetId: H,
117842
117846
  updateFrame: $,
@@ -117859,7 +117863,7 @@ const Uge = Ce.memo(function({
117859
117863
  activeFields: ee,
117860
117864
  sortByFields: se,
117861
117865
  storedFields: ie,
117862
- sheetFields: tt,
117866
+ sheetFields: et,
117863
117867
  dashboardFields: F,
117864
117868
  updatedField: Ie,
117865
117869
  editingField: Ee,
@@ -117867,7 +117871,7 @@ const Uge = Ce.memo(function({
117867
117871
  });
117868
117872
  A && Ug({
117869
117873
  nextSharedFields: Qn,
117870
- currentSharedFields: tt,
117874
+ currentSharedFields: et,
117871
117875
  isVisualEditing: z,
117872
117876
  selectedSheetId: H,
117873
117877
  updateFrame: $,
@@ -117880,14 +117884,14 @@ const Uge = Ce.memo(function({
117880
117884
  });
117881
117885
  },
117882
117886
  onSaveToDashboard: (Ie) => {
117883
- const Ee = y, tt = Ie.role === "metric" ? ae : ee, ut = (A == null ? void 0 : A.calculatedFields) || [], {
117887
+ const Ee = y, et = Ie.role === "metric" ? ae : ee, ut = (A == null ? void 0 : A.calculatedFields) || [], {
117884
117888
  nextActiveFields: Yt,
117885
117889
  nextSortByFields: sn,
117886
117890
  nextStoredFields: Qn,
117887
117891
  nextSharedFields: rr,
117888
117892
  nextSheetFields: He
117889
117893
  } = Qbt({
117890
- activeFields: tt,
117894
+ activeFields: et,
117891
117895
  sortByFields: se,
117892
117896
  storedFields: ie,
117893
117897
  sharedFields: F,
@@ -128466,7 +128470,7 @@ function vwt({ sheet: e }) {
128466
128470
  "Export"
128467
128471
  ]
128468
128472
  }
128469
- ), Ee = j === "preview", tt = /* @__PURE__ */ d(
128473
+ ), Ee = j === "preview", et = /* @__PURE__ */ d(
128470
128474
  "button",
128471
128475
  {
128472
128476
  type: "button",
@@ -128635,7 +128639,7 @@ function vwt({ sheet: e }) {
128635
128639
  /* @__PURE__ */ d(EP, {}),
128636
128640
  /* @__PURE__ */ d(Uwt, { zoom: fe, onZoomChange: me }),
128637
128641
  /* @__PURE__ */ d(EP, {}),
128638
- tt
128642
+ et
128639
128643
  ] }),
128640
128644
  isEditing: !0
128641
128645
  }
@@ -149419,9 +149423,9 @@ function dxe({
149419
149423
  }
149420
149424
  );
149421
149425
  }
149422
- const wDt = BT(() => import("./dashboard-controls-CB2dDJP4.js")), CDt = BT(
149423
- () => import("./edit-dashboard-visual-C5eejq9I.js")
149424
- ), SDt = BT(() => import("./dashboard-json-cSLaRjlU.js"));
149426
+ const wDt = BT(() => import("./dashboard-controls-BN09XPen.js")), CDt = BT(
149427
+ () => import("./edit-dashboard-visual-DX76RXmE.js")
149428
+ ), SDt = BT(() => import("./dashboard-json-Bf3-8gq8.js"));
149425
149429
  function KPt({
149426
149430
  showControls: e = !1,
149427
149431
  showFooter: t = !0,