react-semaphor 0.1.526 → 0.1.528

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 (180) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1190 -296
  3. package/dist/brand-studio/index.js +15 -15
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DUu-tCQw.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-BkskKMck.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-CbjuruKe.js → index-CTYnXU85.js} +781 -780
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DhykwdZs.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.js} +11 -11
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-1Mm8x8w7.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-Dp7kFpVk.js +1383 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-CZa3556D.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-Bqdtknud.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-VV0-Ro6F.js} +131 -132
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-IZjBSU6Z.js} +47 -26
  35. package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-C4YH-W1X.js +24003 -0
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +12 -12
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +165 -168
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +1 -1
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  58. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  59. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  60. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  61. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  62. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  63. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  64. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  66. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  67. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  68. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  69. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  70. package/dist/types/index.js +5 -5
  71. package/dist/types/lib/api/exports-api.d.ts +3 -0
  72. package/dist/types/lib/csv-download.d.ts +9 -0
  73. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  75. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  76. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  77. package/dist/types/lib/export-utils.d.ts +17 -15
  78. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  79. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  80. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  81. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  83. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  84. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  85. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  86. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  87. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  88. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  89. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  90. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  91. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  92. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  93. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  94. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  95. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  96. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  97. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  98. package/dist/types/lib/types/common-types.d.ts +5 -0
  99. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  100. package/dist/types/lib/types/semantic-types.d.ts +4 -2
  101. package/dist/types/lib/types/token-types.d.ts +0 -1
  102. package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
  103. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  104. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  105. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  106. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  107. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  108. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
  109. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
  110. package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
  111. package/dist/types/shared/analytics-protocol/index.d.ts +15 -1
  112. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  113. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  114. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  115. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +61 -6
  116. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
  117. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  118. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  119. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  120. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  121. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  124. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  125. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  126. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  127. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  128. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  129. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  130. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  131. package/dist/types/shared/temporal/index.d.ts +5 -0
  132. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  133. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  134. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  135. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  136. package/package.json +1 -17
  137. package/src/data-app-sdk/README.md +6 -3
  138. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  139. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  140. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  141. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  142. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  143. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  144. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  145. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  146. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  147. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  148. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  149. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  150. package/dist/data-app-builder/index.js +0 -3666
  151. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  152. package/dist/data-app-codegen/index.js +0 -22
  153. package/dist/data-app-codegen-node/index.js +0 -1807
  154. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  155. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  156. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  157. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  158. package/dist/types/data-app-builder/constants.d.ts +0 -14
  159. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  160. package/dist/types/data-app-builder/index.d.ts +0 -1
  161. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  162. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  163. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  164. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  165. package/dist/types/data-app-builder/types.d.ts +0 -558
  166. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  167. package/dist/types/data-app-builder.d.ts +0 -2
  168. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  169. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  170. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  171. package/dist/types/data-app-codegen/index.d.ts +0 -6
  172. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  173. package/dist/types/data-app-codegen/node.d.ts +0 -2
  174. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  175. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  176. package/dist/types/data-app-codegen-node.d.ts +0 -2
  177. package/dist/types/data-app-codegen.d.ts +0 -2
  178. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  179. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  180. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -1,33 +1,33 @@
1
1
  import { jsx as e, jsxs as s, Fragment as F } from "react/jsx-runtime";
2
- import { u as C, B as V, at as Tr, au as Fr, av as Xe, c as xe, _ as D, aw as ve, ax as tt, ay as jt, L as Re, az as qt, Z as $r, G as Ct, j as Gr, aA as Br } from "./code-highlight-994tgM9v.js";
3
- import { bl as Hr, bm as Vr, bn as rt, bo as jr, bp as qr, bq as zr, br as Kr, bs as Qr, bt as Wr, ax as W, bu as ye, bv as Jr, aU as Yr, aV as Xr, aX as kt, aY as Et, bw as zt, b9 as at, bx as Zr, by as ea, bz as Kt, bA as ta, bB as Qt, bC as U, bD as ra, ak as aa, aJ as na, bE as oa, bF as sa, bG as ia, k as da, u as Pe, o as ca, R as Qe, bH as la, bI as ua, bJ as ma, bK as ha, G as pa, bL as fa, bM as ba, I as At, bN as ga, aL as xa, bO as va, bP as ya, bQ as wa, bR as It, bS as Mt, bT as Lt, bU as Na, bV as Sa, bW as Da, bX as Ca, bY as _e, bZ as ka, b_ as We, n as Ea, b$ as Aa } from "./semaphor-ready-indicator-BLRDuLr4.js";
4
- import { c as ne, X as Wt, C as Ia } from "./x-CXDkqdur.js";
5
- import * as k from "react";
6
- import Jt, { useMemo as Q, useState as N, useEffect as Ue, useRef as Pt, useLayoutEffect as Ma } from "react";
7
- import { d as La, c as Pa, u as _a, A as Oa, a as Ra, g as Ua, V as Ta, N as Fa, h as $a, U as Ga } from "./dashboard-briefing-launcher-DXz1GhFZ.js";
8
- import "./card-config-utils-9sv4e-Vb.js";
9
- import { createPortal as Ba } from "react-dom";
10
- import "./validators-CsdOtZI6.js";
11
- import "./matrix-operation-contract-D32U2CSw.js";
2
+ import { u as C, B as H, aO as Gr, aP as Vr, aQ as Ze, c as be, aj as D, aR as xe, aS as nt, aT as zt, L as Re, m as Hr, s as qr, t as jr, v as zr, w as Kr, x as Qr, aU as Kt, ah as Wr, a2 as At, n as Mt, o as Lt, p as Pt, q as Ot, I as Jr, D as Yr, aV as Xr } from "./switch-C4YH-W1X.js";
3
+ import { bq as Zr, br as ea, bs as ot, bt as ta, bu as ra, bv as aa, bw as na, bx as oa, by as sa, aB as J, az as ve, bz as ye, bA as ia, aY as Qt, aZ as Wt, a$ as et, b0 as tt, bB as Jt, bd as st, bm as re, bC as da, bD as ca, bE as Yt, bF as la, bG as Xt, a_ as ua, bH as ma, bI as U, bJ as ha, an as pa, aN as fa, bK as ga, bL as ba, bM as xa, l as va, u as Pe, r as ya, m as We, bN as wa, bO as Na, bP as Sa, bQ as Da, K as Ca, bR as ka, bS as Ea, I as _t, bT as Ia, aP as Aa, bU as Ma, bV as La, bW as Pa, bX as Rt, bY as Ut, bZ as Tt, b_ as Oa, b$ as _a, c0 as Ra, c1 as Ua, c2 as Oe, c3 as Ta, c4 as Fa, c5 as Je, c6 as Ft, q as $a, c7 as Ba, c8 as Ga, c9 as Va, ca as Ha, cb as qa, cc as ja, cd as za, ce as Ka, cf as $t } from "./semaphor-ready-indicator-DbA4mVQL.js";
4
+ import { c as ae, X as Zt, C as Qa } from "./x-CXDkqdur.js";
5
+ import * as E from "react";
6
+ import er, { useMemo as W, useState as N, useEffect as Ue, useRef as Bt, useLayoutEffect as Wa } from "react";
7
+ import { d as Ja, c as Ya, u as Xa, A as Za, a as en, g as tn, V as rn, N as an, h as nn, U as on } from "./dashboard-briefing-launcher-Bb0RhGRC.js";
8
+ import "./card-config-utils-BdPceiw8.js";
9
+ import { createPortal as sn } from "react-dom";
10
+ import "./validators-CQcG0EPN.js";
11
+ import "./matrix-operation-contract-Dp7kFpVk.js";
12
+ import "zod";
12
13
  import "../value-format-preferences/index.js";
13
- import { u as we, P as ae, C as _t, A as Ha, g as Va, h as ja, i as qa, j as za, k as Ka, l as Qa, m as Ot } from "./pre-block-Cq1RqhZX.js";
14
- import { S as Wa, C as Ja } from "./search-CJz-QQ0Q.js";
15
- import { d as Yt } from "./semantic-format-Baqp8kD_.js";
16
- import { K as Ze } from "./calculated-field-identity-D1ofR4KJ.js";
17
- import { R as Ya } from "./report-preferences-dialog-BcH-0lR-.js";
18
- import { i as Rt, j as Ut, k as Tt, l as Ft, I as Xa } from "./switch-XaAACBrJ.js";
19
- import { u as Za } from "./use-debounced-dirty-check-BwAbnX_5.js";
20
- import { s as en } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
21
- import { S as tn } from "./save-DgMfP0j8.js";
22
- import { P as rn } from "./palette-Cp1hqZtm.js";
23
- import { B as an } from "./braces-8TRlDwDw.js";
14
+ import { S as dn, C as cn } from "./selection-reducer-IZjBSU6Z.js";
15
+ import { k as tr } from "./matrix-formatter-1Mm8x8w7.js";
16
+ import { K as rt } from "./calculated-field-identity-DUu-tCQw.js";
17
+ import { R as ln } from "./report-preferences-dialog-VV0-Ro6F.js";
18
+ import { r as un } from "./pivot-result-lifecycle-Bqdtknud.js";
19
+ import { u as mn } from "./use-debounced-dirty-check-BwAbnX_5.js";
20
+ import { s as hn } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
21
+ import { S as pn } from "./save-DgMfP0j8.js";
22
+ import { P as fn } from "./palette-Cp1hqZtm.js";
23
+ import { B as gn } from "./braces-8TRlDwDw.js";
24
24
  /**
25
25
  * @license lucide-react v0.453.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
29
  */
30
- const nn = ne("Monitor", [
30
+ const bn = ae("Monitor", [
31
31
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
32
32
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
33
33
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
@@ -38,7 +38,7 @@ const nn = ne("Monitor", [
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
40
  */
41
- const on = ne("Moon", [
41
+ const xn = ae("Moon", [
42
42
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
43
43
  ]);
44
44
  /**
@@ -47,7 +47,7 @@ const on = ne("Moon", [
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
49
  */
50
- const sn = ne("ShieldX", [
50
+ const vn = ae("ShieldX", [
51
51
  [
52
52
  "path",
53
53
  {
@@ -64,7 +64,7 @@ const sn = ne("ShieldX", [
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
66
  */
67
- const dn = ne("Sun", [
67
+ const yn = ae("Sun", [
68
68
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
69
69
  ["path", { d: "M12 2v2", key: "tus03m" }],
70
70
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -81,7 +81,7 @@ const dn = ne("Sun", [
81
81
  * This source code is licensed under the ISC license.
82
82
  * See the LICENSE file in the root directory of this source tree.
83
83
  */
84
- const cn = ne("UserPlus", [
84
+ const wn = ae("UserPlus", [
85
85
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
86
86
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
87
87
  ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
@@ -93,11 +93,11 @@ const cn = ne("UserPlus", [
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
95
  */
96
- const Xt = ne("UserRound", [
96
+ const rr = ae("UserRound", [
97
97
  ["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
98
98
  ["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
99
99
  ]);
100
- var et = { exports: {} }, Je = {};
100
+ var at = { exports: {} }, Ye = {};
101
101
  /**
102
102
  * @license React
103
103
  * use-sync-external-store-shim.production.js
@@ -107,32 +107,32 @@ var et = { exports: {} }, Je = {};
107
107
  * This source code is licensed under the MIT license found in the
108
108
  * LICENSE file in the root directory of this source tree.
109
109
  */
110
- var $t;
111
- function ln() {
112
- if ($t) return Je;
113
- $t = 1;
114
- var t = Jt;
110
+ var Gt;
111
+ function Nn() {
112
+ if (Gt) return Ye;
113
+ Gt = 1;
114
+ var t = er;
115
115
  function n(c, h) {
116
116
  return c === h && (c !== 0 || 1 / c === 1 / h) || c !== c && h !== h;
117
117
  }
118
- var a = typeof Object.is == "function" ? Object.is : n, r = t.useState, o = t.useEffect, l = t.useLayoutEffect, m = t.useDebugValue;
119
- function u(c, h) {
120
- var i = h(), x = r({ inst: { value: i, getSnapshot: h } }), v = x[0].inst, w = x[1];
118
+ var a = typeof Object.is == "function" ? Object.is : n, r = t.useState, o = t.useEffect, l = t.useLayoutEffect, u = t.useDebugValue;
119
+ function m(c, h) {
120
+ var i = h(), x = r({ inst: { value: i, getSnapshot: h } }), y = x[0].inst, w = x[1];
121
121
  return l(
122
122
  function() {
123
- v.value = i, v.getSnapshot = h, g(v) && w({ inst: v });
123
+ y.value = i, y.getSnapshot = h, b(y) && w({ inst: y });
124
124
  },
125
125
  [c, i, h]
126
126
  ), o(
127
127
  function() {
128
- return g(v) && w({ inst: v }), c(function() {
129
- g(v) && w({ inst: v });
128
+ return b(y) && w({ inst: y }), c(function() {
129
+ b(y) && w({ inst: y });
130
130
  });
131
131
  },
132
132
  [c]
133
- ), m(i), i;
133
+ ), u(i), i;
134
134
  }
135
- function g(c) {
135
+ function b(c) {
136
136
  var h = c.getSnapshot;
137
137
  c = c.value;
138
138
  try {
@@ -145,10 +145,10 @@ function ln() {
145
145
  function f(c, h) {
146
146
  return h();
147
147
  }
148
- var b = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : u;
149
- return Je.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : b, Je;
148
+ var g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : m;
149
+ return Ye.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : g, Ye;
150
150
  }
151
- var Ye = {};
151
+ var Xe = {};
152
152
  /**
153
153
  * @license React
154
154
  * use-sync-external-store-shim.development.js
@@ -158,47 +158,47 @@ var Ye = {};
158
158
  * This source code is licensed under the MIT license found in the
159
159
  * LICENSE file in the root directory of this source tree.
160
160
  */
161
- var Gt;
162
- function un() {
163
- return Gt || (Gt = 1, process.env.NODE_ENV !== "production" && function() {
161
+ var Vt;
162
+ function Sn() {
163
+ return Vt || (Vt = 1, process.env.NODE_ENV !== "production" && function() {
164
164
  function t(i, x) {
165
165
  return i === x && (i !== 0 || 1 / i === 1 / x) || i !== i && x !== x;
166
166
  }
167
167
  function n(i, x) {
168
- b || o.startTransition === void 0 || (b = !0, console.error(
168
+ g || o.startTransition === void 0 || (g = !0, console.error(
169
169
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
170
170
  ));
171
- var v = x();
171
+ var y = x();
172
172
  if (!c) {
173
173
  var w = x();
174
- l(v, w) || (console.error(
174
+ l(y, w) || (console.error(
175
175
  "The result of getSnapshot should be cached to avoid an infinite loop"
176
176
  ), c = !0);
177
177
  }
178
- w = m({
179
- inst: { value: v, getSnapshot: x }
178
+ w = u({
179
+ inst: { value: y, getSnapshot: x }
180
180
  });
181
181
  var S = w[0].inst, p = w[1];
182
- return g(
182
+ return b(
183
183
  function() {
184
- S.value = v, S.getSnapshot = x, a(S) && p({ inst: S });
184
+ S.value = y, S.getSnapshot = x, a(S) && p({ inst: S });
185
185
  },
186
- [i, v, x]
187
- ), u(
186
+ [i, y, x]
187
+ ), m(
188
188
  function() {
189
189
  return a(S) && p({ inst: S }), i(function() {
190
190
  a(S) && p({ inst: S });
191
191
  });
192
192
  },
193
193
  [i]
194
- ), f(v), v;
194
+ ), f(y), y;
195
195
  }
196
196
  function a(i) {
197
197
  var x = i.getSnapshot;
198
198
  i = i.value;
199
199
  try {
200
- var v = x();
201
- return !l(i, v);
200
+ var y = x();
201
+ return !l(i, y);
202
202
  } catch {
203
203
  return !0;
204
204
  }
@@ -207,24 +207,24 @@ function un() {
207
207
  return x();
208
208
  }
209
209
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
210
- var o = Jt, l = typeof Object.is == "function" ? Object.is : t, m = o.useState, u = o.useEffect, g = o.useLayoutEffect, f = o.useDebugValue, b = !1, c = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
211
- Ye.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
212
- }()), Ye;
210
+ var o = er, l = typeof Object.is == "function" ? Object.is : t, u = o.useState, m = o.useEffect, b = o.useLayoutEffect, f = o.useDebugValue, g = !1, c = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
211
+ Xe.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
212
+ }()), Xe;
213
213
  }
214
- process.env.NODE_ENV === "production" ? et.exports = ln() : et.exports = un();
215
- var mn = et.exports;
216
- const Oe = ["light", "dark", "system"];
217
- function hn() {
218
- const { theme: t, setTheme: n } = Hr(), a = C(
219
- (m) => m.actions.setDashboardTheme
214
+ process.env.NODE_ENV === "production" ? at.exports = Nn() : at.exports = Sn();
215
+ var Dn = at.exports;
216
+ const _e = ["light", "dark", "system"];
217
+ function Cn() {
218
+ const { theme: t, setTheme: n } = Zr(), a = C(
219
+ (u) => u.actions.setDashboardTheme
220
220
  );
221
221
  function r() {
222
- const m = Oe.includes(t) ? t : "system", u = Oe[(Oe.indexOf(m) + 1) % Oe.length];
223
- n(u), a(u);
222
+ const u = _e.includes(t) ? t : "system", m = _e[(_e.indexOf(u) + 1) % _e.length];
223
+ n(m), a(m);
224
224
  }
225
- const o = t === "light" ? dn : t === "dark" ? on : nn, l = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
225
+ const o = t === "light" ? yn : t === "dark" ? xn : bn, l = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
226
226
  return /* @__PURE__ */ e(
227
- V,
227
+ H,
228
228
  {
229
229
  type: "button",
230
230
  variant: "ghost",
@@ -237,19 +237,19 @@ function hn() {
237
237
  }
238
238
  );
239
239
  }
240
- function pn() {
241
- const { displayPreferences: t, shouldShowElement: n } = Vr(), { currentUser: a, userContext: r } = rt(), o = Q(
242
- () => jr(a),
240
+ function kn() {
241
+ const { displayPreferences: t, shouldShowElement: n } = ea(), { currentUser: a, userContext: r } = ot(), o = W(
242
+ () => ta(a),
243
243
  [a]
244
- ), l = Q(() => (u) => o && o[u] !== void 0 && o[u] === !1 ? !1 : n(u), [o, n, t]), m = Q(
244
+ ), l = W(() => (m) => o && o[m] !== void 0 && o[m] === !1 ? !1 : n(m), [o, n, t]), u = W(
245
245
  () => {
246
- var u, g, f, b, c;
246
+ var m, b, f, g, c;
247
247
  return {
248
- canEdit: ((u = r == null ? void 0 : r.permissions) == null ? void 0 : u.canEdit) ?? Wr(a),
249
- canUseFilters: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canEdit) ?? Qr(a),
250
- canManageDashboards: ((f = r == null ? void 0 : r.permissions) == null ? void 0 : f.canCreateDashboard) ?? Kr(a),
251
- canCreateDashboards: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canCreateDashboard) ?? zr(a),
252
- canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? qr(a)
248
+ canEdit: ((m = r == null ? void 0 : r.permissions) == null ? void 0 : m.canEdit) ?? sa(a),
249
+ canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? oa(a),
250
+ canManageDashboards: ((f = r == null ? void 0 : r.permissions) == null ? void 0 : f.canCreateDashboard) ?? na(a),
251
+ canCreateDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ?? aa(a),
252
+ canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? ra(a)
253
253
  };
254
254
  },
255
255
  [a, r]
@@ -257,45 +257,45 @@ function pn() {
257
257
  return {
258
258
  displayPreferences: t,
259
259
  shouldShowElement: l,
260
- permissions: m,
260
+ permissions: u,
261
261
  currentUser: a
262
262
  };
263
263
  }
264
- function fn(t, n = []) {
264
+ function En(t, n = []) {
265
265
  let a = [];
266
- function r(l, m) {
267
- const u = k.createContext(m);
268
- u.displayName = l + "Context";
269
- const g = a.length;
270
- a = [...a, m];
266
+ function r(l, u) {
267
+ const m = E.createContext(u);
268
+ m.displayName = l + "Context";
269
+ const b = a.length;
270
+ a = [...a, u];
271
271
  const f = (c) => {
272
272
  var S;
273
- const { scope: h, children: i, ...x } = c, v = ((S = h == null ? void 0 : h[t]) == null ? void 0 : S[g]) || u, w = k.useMemo(() => x, Object.values(x));
274
- return /* @__PURE__ */ e(v.Provider, { value: w, children: i });
273
+ const { scope: h, children: i, ...x } = c, y = ((S = h == null ? void 0 : h[t]) == null ? void 0 : S[b]) || m, w = E.useMemo(() => x, Object.values(x));
274
+ return /* @__PURE__ */ e(y.Provider, { value: w, children: i });
275
275
  };
276
276
  f.displayName = l + "Provider";
277
- function b(c, h) {
278
- var v;
279
- const i = ((v = h == null ? void 0 : h[t]) == null ? void 0 : v[g]) || u, x = k.useContext(i);
277
+ function g(c, h) {
278
+ var y;
279
+ const i = ((y = h == null ? void 0 : h[t]) == null ? void 0 : y[b]) || m, x = E.useContext(i);
280
280
  if (x) return x;
281
- if (m !== void 0) return m;
281
+ if (u !== void 0) return u;
282
282
  throw new Error(`\`${c}\` must be used within \`${l}\``);
283
283
  }
284
- return [f, b];
284
+ return [f, g];
285
285
  }
286
286
  const o = () => {
287
- const l = a.map((m) => k.createContext(m));
288
- return function(u) {
289
- const g = (u == null ? void 0 : u[t]) || l;
290
- return k.useMemo(
291
- () => ({ [`__scope${t}`]: { ...u, [t]: g } }),
292
- [u, g]
287
+ const l = a.map((u) => E.createContext(u));
288
+ return function(m) {
289
+ const b = (m == null ? void 0 : m[t]) || l;
290
+ return E.useMemo(
291
+ () => ({ [`__scope${t}`]: { ...m, [t]: b } }),
292
+ [m, b]
293
293
  );
294
294
  };
295
295
  };
296
- return o.scopeName = t, [r, bn(o, ...n)];
296
+ return o.scopeName = t, [r, In(o, ...n)];
297
297
  }
298
- function bn(...t) {
298
+ function In(...t) {
299
299
  const n = t[0];
300
300
  if (t.length === 1) return n;
301
301
  const a = () => {
@@ -304,16 +304,16 @@ function bn(...t) {
304
304
  scopeName: o.scopeName
305
305
  }));
306
306
  return function(l) {
307
- const m = r.reduce((u, { useScope: g, scopeName: f }) => {
308
- const c = g(l)[`__scope${f}`];
309
- return { ...u, ...c };
307
+ const u = r.reduce((m, { useScope: b, scopeName: f }) => {
308
+ const c = b(l)[`__scope${f}`];
309
+ return { ...m, ...c };
310
310
  }, {});
311
- return k.useMemo(() => ({ [`__scope${n.scopeName}`]: m }), [m]);
311
+ return E.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
312
312
  };
313
313
  };
314
314
  return a.scopeName = n.scopeName, a;
315
315
  }
316
- var gn = [
316
+ var An = [
317
317
  "a",
318
318
  "button",
319
319
  "div",
@@ -331,185 +331,185 @@ var gn = [
331
331
  "span",
332
332
  "svg",
333
333
  "ul"
334
- ], nt = gn.reduce((t, n) => {
335
- const a = Tr(`Primitive.${n}`), r = k.forwardRef((o, l) => {
336
- const { asChild: m, ...u } = o, g = m ? a : n;
337
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...u, ref: l });
334
+ ], it = An.reduce((t, n) => {
335
+ const a = Gr(`Primitive.${n}`), r = E.forwardRef((o, l) => {
336
+ const { asChild: u, ...m } = o, b = u ? a : n;
337
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(b, { ...m, ref: l });
338
338
  });
339
339
  return r.displayName = `Primitive.${n}`, { ...t, [n]: r };
340
340
  }, {});
341
- function xn() {
342
- return mn.useSyncExternalStore(
343
- vn,
341
+ function Mn() {
342
+ return Dn.useSyncExternalStore(
343
+ Ln,
344
344
  () => !0,
345
345
  () => !1
346
346
  );
347
347
  }
348
- function vn() {
348
+ function Ln() {
349
349
  return () => {
350
350
  };
351
351
  }
352
- var ot = "Avatar", [yn] = fn(ot), [wn, Zt] = yn(ot), er = k.forwardRef(
352
+ var dt = "Avatar", [Pn] = En(dt), [On, ar] = Pn(dt), nr = E.forwardRef(
353
353
  (t, n) => {
354
- const { __scopeAvatar: a, ...r } = t, [o, l] = k.useState("idle");
354
+ const { __scopeAvatar: a, ...r } = t, [o, l] = E.useState("idle");
355
355
  return /* @__PURE__ */ e(
356
- wn,
356
+ On,
357
357
  {
358
358
  scope: a,
359
359
  imageLoadingStatus: o,
360
360
  onImageLoadingStatusChange: l,
361
- children: /* @__PURE__ */ e(nt.span, { ...r, ref: n })
361
+ children: /* @__PURE__ */ e(it.span, { ...r, ref: n })
362
362
  }
363
363
  );
364
364
  }
365
365
  );
366
- er.displayName = ot;
367
- var tr = "AvatarImage", rr = k.forwardRef(
366
+ nr.displayName = dt;
367
+ var or = "AvatarImage", sr = E.forwardRef(
368
368
  (t, n) => {
369
369
  const { __scopeAvatar: a, src: r, onLoadingStatusChange: o = () => {
370
- }, ...l } = t, m = Zt(tr, a), u = Nn(r, l), g = Fr((f) => {
371
- o(f), m.onImageLoadingStatusChange(f);
370
+ }, ...l } = t, u = ar(or, a), m = _n(r, l), b = Vr((f) => {
371
+ o(f), u.onImageLoadingStatusChange(f);
372
372
  });
373
- return Xe(() => {
374
- u !== "idle" && g(u);
375
- }, [u, g]), u === "loaded" ? /* @__PURE__ */ e(nt.img, { ...l, ref: n, src: r }) : null;
373
+ return Ze(() => {
374
+ m !== "idle" && b(m);
375
+ }, [m, b]), m === "loaded" ? /* @__PURE__ */ e(it.img, { ...l, ref: n, src: r }) : null;
376
376
  }
377
377
  );
378
- rr.displayName = tr;
379
- var ar = "AvatarFallback", nr = k.forwardRef(
378
+ sr.displayName = or;
379
+ var ir = "AvatarFallback", dr = E.forwardRef(
380
380
  (t, n) => {
381
- const { __scopeAvatar: a, delayMs: r, ...o } = t, l = Zt(ar, a), [m, u] = k.useState(r === void 0);
382
- return k.useEffect(() => {
381
+ const { __scopeAvatar: a, delayMs: r, ...o } = t, l = ar(ir, a), [u, m] = E.useState(r === void 0);
382
+ return E.useEffect(() => {
383
383
  if (r !== void 0) {
384
- const g = window.setTimeout(() => u(!0), r);
385
- return () => window.clearTimeout(g);
384
+ const b = window.setTimeout(() => m(!0), r);
385
+ return () => window.clearTimeout(b);
386
386
  }
387
- }, [r]), m && l.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(nt.span, { ...o, ref: n }) : null;
387
+ }, [r]), u && l.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(it.span, { ...o, ref: n }) : null;
388
388
  }
389
389
  );
390
- nr.displayName = ar;
391
- function Bt(t, n) {
390
+ dr.displayName = ir;
391
+ function Ht(t, n) {
392
392
  return t ? n ? (t.src !== n && (t.src = n), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
393
393
  }
394
- function Nn(t, { referrerPolicy: n, crossOrigin: a }) {
395
- const r = xn(), o = k.useRef(null), l = r ? (o.current || (o.current = new window.Image()), o.current) : null, [m, u] = k.useState(
396
- () => Bt(l, t)
394
+ function _n(t, { referrerPolicy: n, crossOrigin: a }) {
395
+ const r = Mn(), o = E.useRef(null), l = r ? (o.current || (o.current = new window.Image()), o.current) : null, [u, m] = E.useState(
396
+ () => Ht(l, t)
397
397
  );
398
- return Xe(() => {
399
- u(Bt(l, t));
400
- }, [l, t]), Xe(() => {
401
- const g = (c) => () => {
402
- u(c);
398
+ return Ze(() => {
399
+ m(Ht(l, t));
400
+ }, [l, t]), Ze(() => {
401
+ const b = (c) => () => {
402
+ m(c);
403
403
  };
404
404
  if (!l) return;
405
- const f = g("loaded"), b = g("error");
406
- return l.addEventListener("load", f), l.addEventListener("error", b), n && (l.referrerPolicy = n), typeof a == "string" && (l.crossOrigin = a), () => {
407
- l.removeEventListener("load", f), l.removeEventListener("error", b);
405
+ const f = b("loaded"), g = b("error");
406
+ return l.addEventListener("load", f), l.addEventListener("error", g), n && (l.referrerPolicy = n), typeof a == "string" && (l.crossOrigin = a), () => {
407
+ l.removeEventListener("load", f), l.removeEventListener("error", g);
408
408
  };
409
- }, [l, a, n]), m;
409
+ }, [l, a, n]), u;
410
410
  }
411
- var or = er, sr = rr, ir = nr;
412
- const dr = k.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
413
- or,
411
+ var cr = nr, lr = sr, ur = dr;
412
+ const mr = E.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
413
+ cr,
414
414
  {
415
415
  ref: a,
416
- className: xe(
416
+ className: be(
417
417
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
418
418
  t
419
419
  ),
420
420
  ...n
421
421
  }
422
422
  ));
423
- dr.displayName = or.displayName;
424
- const Sn = k.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
425
- sr,
423
+ mr.displayName = cr.displayName;
424
+ const Rn = E.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
425
+ lr,
426
426
  {
427
427
  ref: a,
428
- className: xe("aspect-square h-full w-full", t),
428
+ className: be("aspect-square h-full w-full", t),
429
429
  ...n
430
430
  }
431
431
  ));
432
- Sn.displayName = sr.displayName;
433
- const cr = k.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
434
- ir,
432
+ Rn.displayName = lr.displayName;
433
+ const hr = E.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
434
+ ur,
435
435
  {
436
436
  ref: a,
437
- className: xe(
437
+ className: be(
438
438
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
439
439
  t
440
440
  ),
441
441
  ...n
442
442
  }
443
443
  ));
444
- cr.displayName = ir.displayName;
445
- const Dn = async (t, n, a) => {
444
+ hr.displayName = ur.displayName;
445
+ const Un = async (t, n, a) => {
446
446
  const r = `${t}/management/v1/groups`;
447
- return await jt(r, n, a);
448
- }, Cn = async (t, n, a, r) => {
447
+ return await zt(r, n, a);
448
+ }, Tn = async (t, n, a, r) => {
449
449
  const o = `${t}/management/v1/groups/${a}`;
450
- return tt(o, n, "PATCH", r);
451
- }, kn = async (t, n, a) => {
450
+ return nt(o, n, "PATCH", r);
451
+ }, Fn = async (t, n, a) => {
452
452
  const r = `${t}/management/v1/groups/${a}`;
453
- await tt(r, n, "DELETE");
454
- }, En = async (t, n, a, r) => {
453
+ await nt(r, n, "DELETE");
454
+ }, $n = async (t, n, a, r) => {
455
455
  const o = `${t}/management/v1/groups/${a}/members`;
456
- return await jt(o, n, r);
457
- }, An = async (t, n, a, r) => {
456
+ return await zt(o, n, r);
457
+ }, Bn = async (t, n, a, r) => {
458
458
  const o = `${t}/management/v1/groups/${a}/members`;
459
- await tt(o, n, "DELETE", r);
459
+ await nt(o, n, "DELETE", r);
460
460
  };
461
- function In() {
462
- const { authToken: t, tokenProps: n } = W(), a = we();
461
+ function Gn() {
462
+ const { authToken: t, tokenProps: n } = J(), a = ve();
463
463
  return ye({
464
- mutationFn: (r) => Dn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
464
+ mutationFn: (r) => Un(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
465
465
  onSuccess: () => {
466
466
  a.invalidateQueries({ queryKey: ["groups"] }), D.success("Group created successfully");
467
467
  },
468
468
  onError: (r) => {
469
469
  console.error("Failed to create group:", r), D.error("Failed to create group", {
470
- description: ve(r, "Failed to create group")
470
+ description: xe(r, "Failed to create group")
471
471
  });
472
472
  }
473
473
  });
474
474
  }
475
- function Mn() {
476
- const { authToken: t, tokenProps: n } = W(), a = we();
475
+ function Vn() {
476
+ const { authToken: t, tokenProps: n } = J(), a = ve();
477
477
  return ye({
478
478
  mutationFn: ({
479
479
  groupId: r,
480
480
  data: o
481
- }) => Cn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
481
+ }) => Tn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
482
482
  onSuccess: (r, o) => {
483
483
  a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({ queryKey: ["groups"] }), D.success("Group updated successfully");
484
484
  },
485
485
  onError: (r) => {
486
486
  console.error("Failed to update group:", r), D.error("Failed to update group", {
487
- description: ve(r, "Failed to update group")
487
+ description: xe(r, "Failed to update group")
488
488
  });
489
489
  }
490
490
  });
491
491
  }
492
- function Ln() {
493
- const { authToken: t, tokenProps: n } = W(), a = we();
492
+ function Hn() {
493
+ const { authToken: t, tokenProps: n } = J(), a = ve();
494
494
  return ye({
495
- mutationFn: (r) => kn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
495
+ mutationFn: (r) => Fn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
496
496
  onSuccess: (r, o) => {
497
497
  a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", o] }), D.success("Group deleted successfully");
498
498
  },
499
499
  onError: (r) => {
500
500
  console.error("Failed to delete group:", r), D.error("Failed to delete group", {
501
- description: ve(r, "Failed to delete group")
501
+ description: xe(r, "Failed to delete group")
502
502
  });
503
503
  }
504
504
  });
505
505
  }
506
- function Pn() {
507
- const { authToken: t, tokenProps: n } = W(), a = we();
506
+ function qn() {
507
+ const { authToken: t, tokenProps: n } = J(), a = ve();
508
508
  return ye({
509
509
  mutationFn: ({
510
510
  groupId: r,
511
511
  data: o
512
- }) => En(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
512
+ }) => $n(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
513
513
  onSuccess: (r, o) => {
514
514
  a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
515
515
  queryKey: ["group-members", o.groupId]
@@ -517,18 +517,18 @@ function Pn() {
517
517
  },
518
518
  onError: (r) => {
519
519
  console.error("Failed to add group members:", r), D.error("Failed to add members", {
520
- description: ve(r, "Failed to add members")
520
+ description: xe(r, "Failed to add members")
521
521
  });
522
522
  }
523
523
  });
524
524
  }
525
- function _n() {
526
- const { authToken: t, tokenProps: n } = W(), a = we();
525
+ function jn() {
526
+ const { authToken: t, tokenProps: n } = J(), a = ve();
527
527
  return ye({
528
528
  mutationFn: ({
529
529
  groupId: r,
530
530
  data: o
531
- }) => An(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
531
+ }) => Bn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
532
532
  onSuccess: (r, o) => {
533
533
  a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
534
534
  queryKey: ["group-members", o.groupId]
@@ -536,41 +536,41 @@ function _n() {
536
536
  },
537
537
  onError: (r) => {
538
538
  console.error("Failed to remove group members:", r), D.error("Failed to remove members", {
539
- description: ve(r, "Failed to remove members")
539
+ description: xe(r, "Failed to remove members")
540
540
  });
541
541
  }
542
542
  });
543
543
  }
544
- const On = [];
545
- function Rn({
544
+ const zn = [];
545
+ function Kn({
546
546
  open: t,
547
547
  onOpenChange: n
548
548
  }) {
549
549
  var p, $, T;
550
- const { tokenProps: a } = W(), { currentUser: r } = rt(), o = (r == null ? void 0 : r.type) === "tenant", l = a == null ? void 0 : a.tenantId, {
551
- groups: m,
552
- isLoading: u,
553
- error: g,
550
+ const { tokenProps: a } = J(), { currentUser: r } = ot(), o = (r == null ? void 0 : r.type) === "tenant", l = a == null ? void 0 : a.tenantId, {
551
+ groups: u,
552
+ isLoading: m,
553
+ error: b,
554
554
  refetch: f
555
- } = Jr({
555
+ } = ia({
556
556
  type: o ? "TENANT_GROUP" : "all",
557
557
  tenantId: o ? l : void 0,
558
558
  includeMembers: !1
559
- }), b = g ? lr(g, "Unable to load groups.") : null, [c, h] = N({ kind: "list" }), [i, x] = N(null), v = Ln();
559
+ }), g = b ? pr(b, "Unable to load groups.") : null, [c, h] = N({ kind: "list" }), [i, x] = N(null), y = Hn();
560
560
  Ue(() => {
561
561
  t || (h({ kind: "list" }), x(null));
562
562
  }, [t]);
563
- const w = c.kind === "members" && m.find((M) => M.id === c.groupId) || null, S = async () => {
563
+ const w = c.kind === "members" && u.find((A) => A.id === c.groupId) || null, S = async () => {
564
564
  if (i)
565
565
  try {
566
- await v.mutateAsync(i.id), x(null), h({ kind: "list" }), f();
566
+ await y.mutateAsync(i.id), x(null), h({ kind: "list" }), f();
567
567
  } catch {
568
568
  }
569
569
  };
570
- return /* @__PURE__ */ e(Yr, { open: t, onOpenChange: n, children: /* @__PURE__ */ s(Xr, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
570
+ return /* @__PURE__ */ e(Qt, { open: t, onOpenChange: n, children: /* @__PURE__ */ s(Wt, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
571
571
  c.kind === "list" ? /* @__PURE__ */ s("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
572
- /* @__PURE__ */ e(kt, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
573
- /* @__PURE__ */ e(Et, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
572
+ /* @__PURE__ */ e(et, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
573
+ /* @__PURE__ */ e(tt, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
574
574
  ] }) : c.kind === "create" ? /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
575
575
  /* @__PURE__ */ e(
576
576
  "button",
@@ -579,27 +579,27 @@ function Rn({
579
579
  onClick: () => h({ kind: "list" }),
580
580
  "aria-label": "Back",
581
581
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
582
- children: /* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" })
582
+ children: /* @__PURE__ */ e(Jt, { className: "h-3.5 w-3.5" })
583
583
  }
584
584
  ),
585
- /* @__PURE__ */ e(kt, { className: "truncate text-[13px] font-medium", children: "New group" }),
586
- /* @__PURE__ */ e(Et, { className: "sr-only", children: "Create a new group to organize members." })
585
+ /* @__PURE__ */ e(et, { className: "truncate text-[13px] font-medium", children: "New group" }),
586
+ /* @__PURE__ */ e(tt, { className: "sr-only", children: "Create a new group to organize members." })
587
587
  ] }) : null,
588
588
  c.kind === "list" && /* @__PURE__ */ e(
589
- Un,
589
+ Qn,
590
590
  {
591
- groups: m,
592
- isLoading: u,
593
- errorMessage: b,
591
+ groups: u,
592
+ isLoading: m,
593
+ errorMessage: g,
594
594
  onRetry: () => f(),
595
595
  currentUserId: r == null ? void 0 : r.id,
596
- onOpenGroup: (M) => h({ kind: "members", groupId: M }),
596
+ onOpenGroup: (A) => h({ kind: "members", groupId: A }),
597
597
  onCreate: () => h({ kind: "create" }),
598
- onDeleteRequest: (M) => x(M)
598
+ onDeleteRequest: (A) => x(A)
599
599
  }
600
600
  ),
601
601
  c.kind === "members" && w && /* @__PURE__ */ e(
602
- $n,
602
+ Yn,
603
603
  {
604
604
  group: w,
605
605
  isTenantViewer: o,
@@ -614,13 +614,13 @@ function Rn({
614
614
  w.id
615
615
  ),
616
616
  c.kind === "create" && /* @__PURE__ */ e(
617
- Gn,
617
+ Xn,
618
618
  {
619
619
  isTenantUser: o,
620
620
  tenantId: l,
621
621
  onCancel: () => h({ kind: "list" }),
622
- onCreated: (M) => {
623
- f(), h({ kind: "members", groupId: M });
622
+ onCreated: (A) => {
623
+ f(), h({ kind: "members", groupId: A });
624
624
  }
625
625
  }
626
626
  ),
@@ -637,7 +637,7 @@ function Rn({
637
637
  {
638
638
  type: "button",
639
639
  onClick: () => x(null),
640
- disabled: v.isPending,
640
+ disabled: y.isPending,
641
641
  className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-background",
642
642
  children: "Cancel"
643
643
  }
@@ -647,10 +647,10 @@ function Rn({
647
647
  {
648
648
  type: "button",
649
649
  onClick: S,
650
- disabled: v.isPending,
650
+ disabled: y.isPending,
651
651
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
652
652
  children: [
653
- v.isPending ? /* @__PURE__ */ e(Re, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(at, { className: "h-3 w-3" }),
653
+ y.isPending ? /* @__PURE__ */ e(Re, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(st, { className: "h-3 w-3" }),
654
654
  "Delete group"
655
655
  ]
656
656
  }
@@ -659,42 +659,42 @@ function Rn({
659
659
  ] })
660
660
  ] }) });
661
661
  }
662
- function Un({
662
+ function Qn({
663
663
  groups: t,
664
664
  isLoading: n,
665
665
  errorMessage: a,
666
666
  onRetry: r,
667
667
  currentUserId: o,
668
668
  onOpenGroup: l,
669
- onCreate: m,
670
- onDeleteRequest: u
669
+ onCreate: u,
670
+ onDeleteRequest: m
671
671
  }) {
672
- const [g, f] = N(""), b = Q(
672
+ const [b, f] = N(""), g = W(
673
673
  () => t.filter(
674
- (c) => !g.trim() || c.name.toLowerCase().includes(g.toLowerCase()) || (c.description || "").toLowerCase().includes(g.toLowerCase())
674
+ (c) => !b.trim() || c.name.toLowerCase().includes(b.toLowerCase()) || (c.description || "").toLowerCase().includes(b.toLowerCase())
675
675
  ),
676
- [t, g]
676
+ [t, b]
677
677
  );
678
678
  return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
679
679
  /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
680
680
  /* @__PURE__ */ s("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
681
- /* @__PURE__ */ e(Wa, { className: "h-3 w-3 text-muted-foreground" }),
681
+ /* @__PURE__ */ e(dn, { className: "h-3 w-3 text-muted-foreground" }),
682
682
  /* @__PURE__ */ e(
683
683
  "input",
684
684
  {
685
- value: g,
685
+ value: b,
686
686
  onChange: (c) => f(c.target.value),
687
687
  placeholder: "Search groups…",
688
688
  className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
689
689
  }
690
690
  ),
691
- g && /* @__PURE__ */ e(
691
+ b && /* @__PURE__ */ e(
692
692
  "button",
693
693
  {
694
694
  type: "button",
695
695
  onClick: () => f(""),
696
696
  className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
697
- children: /* @__PURE__ */ e(Wt, { className: "h-2.5 w-2.5" })
697
+ children: /* @__PURE__ */ e(Zt, { className: "h-2.5 w-2.5" })
698
698
  }
699
699
  )
700
700
  ] }),
@@ -702,10 +702,10 @@ function Un({
702
702
  "button",
703
703
  {
704
704
  type: "button",
705
- onClick: m,
705
+ onClick: u,
706
706
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
707
707
  children: [
708
- /* @__PURE__ */ e(ae, { className: "h-3 w-3" }),
708
+ /* @__PURE__ */ e(re, { className: "h-3 w-3" }),
709
709
  "New group"
710
710
  ]
711
711
  }
@@ -718,35 +718,35 @@ function Un({
718
718
  },
719
719
  c
720
720
  )) }) : a ? /* @__PURE__ */ e(
721
- ur,
721
+ fr,
722
722
  {
723
723
  title: "Can't load groups",
724
724
  message: a,
725
725
  onRetry: r
726
726
  }
727
- ) : b.length === 0 && t.length === 0 ? /* @__PURE__ */ e(Fn, { onCreate: m }) : b.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
727
+ ) : g.length === 0 && t.length === 0 ? /* @__PURE__ */ e(Jn, { onCreate: u }) : g.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
728
728
  /* @__PURE__ */ s("div", { className: "text-[12px] text-foreground", children: [
729
729
  'No groups match "',
730
- g,
730
+ b,
731
731
  '"'
732
732
  ] }),
733
733
  /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
734
- ] }) : b.map((c) => {
734
+ ] }) : g.map((c) => {
735
735
  var h;
736
736
  return /* @__PURE__ */ e(
737
- Tn,
737
+ Wn,
738
738
  {
739
739
  group: c,
740
740
  canDelete: ((h = c.permissions) == null ? void 0 : h.canDelete) ?? c.createdBy === o,
741
741
  onClick: () => l(c.id),
742
- onDelete: () => u(c)
742
+ onDelete: () => m(c)
743
743
  },
744
744
  c.id
745
745
  );
746
746
  }) })
747
747
  ] });
748
748
  }
749
- function Tn({
749
+ function Wn({
750
750
  group: t,
751
751
  canDelete: n,
752
752
  onClick: a,
@@ -754,7 +754,7 @@ function Tn({
754
754
  }) {
755
755
  let o = "";
756
756
  try {
757
- o = Yt(new Date(t.createdAt), "MMM d, yyyy");
757
+ o = tr(new Date(t.createdAt), "MMM d, yyyy");
758
758
  } catch {
759
759
  o = "";
760
760
  }
@@ -765,12 +765,12 @@ function Tn({
765
765
  onClick: a,
766
766
  className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
767
767
  children: [
768
- /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(ta, { className: "h-3.5 w-3.5" }) }),
768
+ /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" }) }),
769
769
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
770
770
  /* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
771
771
  /* @__PURE__ */ s("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
772
772
  /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
773
- /* @__PURE__ */ e(Xt, { className: "h-2.5 w-2.5" }),
773
+ /* @__PURE__ */ e(rr, { className: "h-2.5 w-2.5" }),
774
774
  t.memberCount,
775
775
  " member",
776
776
  t.memberCount === 1 ? "" : "s"
@@ -778,7 +778,7 @@ function Tn({
778
778
  o && /* @__PURE__ */ s(F, { children: [
779
779
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
780
780
  /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
781
- /* @__PURE__ */ e(Qt, { className: "h-2.5 w-2.5" }),
781
+ /* @__PURE__ */ e(Xt, { className: "h-2.5 w-2.5" }),
782
782
  o
783
783
  ] })
784
784
  ] }),
@@ -802,18 +802,18 @@ function Tn({
802
802
  },
803
803
  "aria-label": `Delete ${t.name}`,
804
804
  className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
805
- children: /* @__PURE__ */ e(at, { className: "h-3 w-3" })
805
+ children: /* @__PURE__ */ e(st, { className: "h-3 w-3" })
806
806
  }
807
807
  ),
808
- /* @__PURE__ */ e(Ja, { className: "h-3.5 w-3.5 text-muted-foreground" })
808
+ /* @__PURE__ */ e(cn, { className: "h-3.5 w-3.5 text-muted-foreground" })
809
809
  ] })
810
810
  ]
811
811
  }
812
812
  );
813
813
  }
814
- function Fn({ onCreate: t }) {
814
+ function Jn({ onCreate: t }) {
815
815
  return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
816
- /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(Kt, { className: "h-4 w-4" }) }),
816
+ /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(Yt, { className: "h-4 w-4" }) }),
817
817
  /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
818
818
  /* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
819
819
  /* @__PURE__ */ s(
@@ -823,91 +823,91 @@ function Fn({ onCreate: t }) {
823
823
  onClick: t,
824
824
  className: "mt-1 inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
825
825
  children: [
826
- /* @__PURE__ */ e(ae, { className: "h-3 w-3" }),
826
+ /* @__PURE__ */ e(re, { className: "h-3 w-3" }),
827
827
  "New group"
828
828
  ]
829
829
  }
830
830
  )
831
831
  ] });
832
832
  }
833
- function $n({
833
+ function Yn({
834
834
  group: t,
835
835
  isTenantViewer: n,
836
836
  canEdit: a,
837
837
  canDelete: r,
838
838
  canManageMembers: o,
839
839
  onBack: l,
840
- onMembersChanged: m,
841
- onUpdated: u,
842
- onRequestDelete: g
840
+ onMembersChanged: u,
841
+ onUpdated: m,
842
+ onRequestDelete: b
843
843
  }) {
844
844
  const {
845
845
  data: f,
846
- isLoading: b,
846
+ isLoading: g,
847
847
  error: c,
848
848
  refetch: h
849
- } = Zr(t.id), i = (f == null ? void 0 : f.members) ?? On, x = c ? lr(c, "Unable to load members for this group.") : null, v = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = ea({
850
- type: v,
849
+ } = da(t.id), i = (f == null ? void 0 : f.members) ?? zn, x = c ? pr(c, "Unable to load members for this group.") : null, y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = ca({
850
+ type: y,
851
851
  tenantId: t.tenantId || void 0,
852
852
  active: !0,
853
853
  limit: 200
854
- }), S = Q(
855
- () => new Set(i.map((y) => y.userId)),
854
+ }), S = W(
855
+ () => new Set(i.map((v) => v.userId)),
856
856
  [i]
857
- ), p = Pn(), $ = _n(), T = Mn(), [M, A] = N(!1), [E, J] = N(t.name), [Te, j] = N(!1), [oe, q] = N(t.description || ""), [se, ie] = N(""), [Ne, Y] = N(!1), Fe = Q(() => {
858
- const y = se.trim().toLowerCase();
857
+ ), p = qn(), $ = jn(), T = Vn(), [A, I] = N(!1), [k, Y] = N(t.name), [Te, q] = N(!1), [ne, j] = N(t.description || ""), [oe, se] = N(""), [Fe, ie] = N(!1), we = W(() => {
858
+ const v = oe.trim().toLowerCase();
859
859
  return w.filter((R) => !S.has(R.id)).filter(
860
- (R) => !y || (R.name || "").toLowerCase().includes(y) || (R.email || "").toLowerCase().includes(y)
860
+ (R) => !v || (R.name || "").toLowerCase().includes(v) || (R.email || "").toLowerCase().includes(v)
861
861
  ).slice(0, 50);
862
- }, [w, S, se]), de = async () => {
863
- const y = E.trim();
864
- if (A(!1), y.length >= 3 && y !== t.name)
862
+ }, [w, S, oe]), X = async () => {
863
+ const v = k.trim();
864
+ if (I(!1), v.length >= 3 && v !== t.name)
865
865
  try {
866
866
  await T.mutateAsync({
867
867
  groupId: t.id,
868
- data: { name: y }
869
- }), u();
868
+ data: { name: v }
869
+ }), m();
870
870
  } catch {
871
871
  }
872
- }, Se = async () => {
873
- const y = oe.trim();
874
- if (j(!1), y !== (t.description || ""))
872
+ }, Ne = async () => {
873
+ const v = ne.trim();
874
+ if (q(!1), v !== (t.description || ""))
875
875
  try {
876
876
  await T.mutateAsync({
877
877
  groupId: t.id,
878
- data: { description: y }
879
- }), u();
878
+ data: { description: v }
879
+ }), m();
880
880
  } catch {
881
881
  }
882
- }, X = async (y) => {
882
+ }, Se = async (v) => {
883
883
  if (o) {
884
- ie(""), Y(!1);
884
+ se(""), ie(!1);
885
885
  try {
886
886
  await p.mutateAsync({
887
887
  groupId: t.id,
888
888
  data: {
889
- userIds: [y.id],
890
- userType: v === "tenant" ? "tenant" : "org"
889
+ userIds: [v.id],
890
+ userType: y === "tenant" ? "tenant" : "org"
891
891
  }
892
- }), h(), m();
892
+ }), h(), u();
893
893
  } catch {
894
894
  }
895
895
  }
896
- }, Z = async (y) => {
896
+ }, $e = async (v) => {
897
897
  if (o)
898
898
  try {
899
899
  await $.mutateAsync({
900
900
  groupId: t.id,
901
- data: { userIds: [y] }
902
- }), h(), m();
901
+ data: { userIds: [v] }
902
+ }), h(), u();
903
903
  } catch {
904
904
  }
905
905
  };
906
- let G = "";
906
+ let B = "";
907
907
  try {
908
- G = Yt(new Date(t.createdAt), "MMM d, yyyy");
908
+ B = tr(new Date(t.createdAt), "MMM d, yyyy");
909
909
  } catch {
910
- G = "";
910
+ B = "";
911
911
  }
912
912
  return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
913
913
  /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
@@ -918,18 +918,18 @@ function $n({
918
918
  onClick: l,
919
919
  "aria-label": "Back",
920
920
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
921
- children: /* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" })
921
+ children: /* @__PURE__ */ e(Jt, { className: "h-3.5 w-3.5" })
922
922
  }
923
923
  ),
924
- M ? /* @__PURE__ */ e(
924
+ A ? /* @__PURE__ */ e(
925
925
  "input",
926
926
  {
927
927
  autoFocus: !0,
928
- value: E,
929
- onChange: (y) => J(y.target.value),
930
- onBlur: de,
931
- onKeyDown: (y) => {
932
- y.key === "Enter" && de(), y.key === "Escape" && (J(t.name), A(!1));
928
+ value: k,
929
+ onChange: (v) => Y(v.target.value),
930
+ onBlur: X,
931
+ onKeyDown: (v) => {
932
+ v.key === "Enter" && X(), v.key === "Escape" && (Y(t.name), I(!1));
933
933
  },
934
934
  className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
935
935
  }
@@ -938,7 +938,7 @@ function $n({
938
938
  {
939
939
  type: "button",
940
940
  onClick: () => {
941
- a && (J(t.name), A(!0));
941
+ a && (Y(t.name), I(!0));
942
942
  },
943
943
  title: a ? "Click to rename" : t.name,
944
944
  disabled: !a,
@@ -947,7 +947,7 @@ function $n({
947
947
  }
948
948
  ),
949
949
  /* @__PURE__ */ s("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
950
- /* @__PURE__ */ e(Xt, { className: "h-2.5 w-2.5" }),
950
+ /* @__PURE__ */ e(rr, { className: "h-2.5 w-2.5" }),
951
951
  i.length,
952
952
  " member",
953
953
  i.length === 1 ? "" : "s"
@@ -959,11 +959,11 @@ function $n({
959
959
  {
960
960
  autoFocus: !0,
961
961
  rows: 2,
962
- value: oe,
963
- onChange: (y) => q(y.target.value),
962
+ value: ne,
963
+ onChange: (v) => j(v.target.value),
964
964
  maxLength: 200,
965
- onKeyDown: (y) => {
966
- y.key === "Escape" && (q(t.description || ""), j(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && Se();
965
+ onKeyDown: (v) => {
966
+ v.key === "Escape" && (j(t.description || ""), q(!1)), v.key === "Enter" && (v.metaKey || v.ctrlKey) && Ne();
967
967
  },
968
968
  placeholder: "What is this group for?",
969
969
  className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
@@ -971,7 +971,7 @@ function $n({
971
971
  ),
972
972
  /* @__PURE__ */ s("div", { className: "mt-1.5 flex items-center justify-between", children: [
973
973
  /* @__PURE__ */ s("span", { className: "text-[10.5px] text-muted-foreground", children: [
974
- oe.length,
974
+ ne.length,
975
975
  "/200 · Esc to cancel · ⌘↩ to save"
976
976
  ] }),
977
977
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
@@ -980,7 +980,7 @@ function $n({
980
980
  {
981
981
  type: "button",
982
982
  onClick: () => {
983
- q(t.description || ""), j(!1);
983
+ j(t.description || ""), q(!1);
984
984
  },
985
985
  className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
986
986
  children: "Cancel"
@@ -990,7 +990,7 @@ function $n({
990
990
  "button",
991
991
  {
992
992
  type: "button",
993
- onClick: Se,
993
+ onClick: Ne,
994
994
  className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
995
995
  children: "Save"
996
996
  }
@@ -1002,7 +1002,7 @@ function $n({
1002
1002
  {
1003
1003
  type: "button",
1004
1004
  onClick: () => {
1005
- a && (q(t.description || ""), j(!0));
1005
+ a && (j(t.description || ""), q(!0));
1006
1006
  },
1007
1007
  disabled: !a,
1008
1008
  title: a ? "Click to edit description" : void 0,
@@ -1010,33 +1010,33 @@ function $n({
1010
1010
  children: [
1011
1011
  t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
1012
1012
  /* @__PURE__ */ s("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
1013
- G ? `Created ${G}` : "Recently created",
1013
+ B ? `Created ${B}` : "Recently created",
1014
1014
  a ? " · You can edit this group" : ""
1015
1015
  ] })
1016
1016
  ]
1017
1017
  }
1018
1018
  ) }),
1019
1019
  o && /* @__PURE__ */ e(
1020
- Bn,
1020
+ Zn,
1021
1021
  {
1022
- query: se,
1023
- setQuery: ie,
1024
- open: Ne,
1025
- setOpen: Y,
1026
- candidates: Fe,
1022
+ query: oe,
1023
+ setQuery: se,
1024
+ open: Fe,
1025
+ setOpen: ie,
1026
+ candidates: we,
1027
1027
  showKindChip: !n,
1028
- onAdd: X,
1028
+ onAdd: Se,
1029
1029
  busy: p.isPending
1030
1030
  }
1031
1031
  ),
1032
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: b ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(
1032
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: g ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((v) => /* @__PURE__ */ e(
1033
1033
  "div",
1034
1034
  {
1035
1035
  className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
1036
1036
  },
1037
- y
1037
+ v
1038
1038
  )) }) : x ? /* @__PURE__ */ e(
1039
- ur,
1039
+ fr,
1040
1040
  {
1041
1041
  title: "Can't load members",
1042
1042
  message: x,
@@ -1045,74 +1045,74 @@ function $n({
1045
1045
  ) : i.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
1046
1046
  /* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
1047
1047
  /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: o ? "Search above to add people to this group." : "This group does not have any members." })
1048
- ] }) : i.map((y) => {
1049
- var R, ce, z, De, le, I;
1048
+ ] }) : i.map((v) => {
1049
+ var R, de, z, ce, K, De;
1050
1050
  return /* @__PURE__ */ s(
1051
1051
  "div",
1052
1052
  {
1053
1053
  className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
1054
1054
  children: [
1055
- /* @__PURE__ */ e(mr, { name: ((R = y.user) == null ? void 0 : R.name) || ((ce = y.user) == null ? void 0 : ce.email) || "?" }),
1055
+ /* @__PURE__ */ e(gr, { name: ((R = v.user) == null ? void 0 : R.name) || ((de = v.user) == null ? void 0 : de.email) || "?" }),
1056
1056
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1057
- /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((z = y.user) == null ? void 0 : z.name) || ((De = y.user) == null ? void 0 : De.email) || "Unknown" }),
1058
- ((le = y.user) == null ? void 0 : le.email) && y.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
1057
+ /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((z = v.user) == null ? void 0 : z.name) || ((ce = v.user) == null ? void 0 : ce.email) || "Unknown" }),
1058
+ ((K = v.user) == null ? void 0 : K.email) && v.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: v.user.email })
1059
1059
  ] }),
1060
- !n && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
1060
+ !n && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: v.userType }),
1061
1061
  /* @__PURE__ */ e(
1062
1062
  "button",
1063
1063
  {
1064
1064
  type: "button",
1065
- onClick: () => Z(y.userId),
1065
+ onClick: () => $e(v.userId),
1066
1066
  disabled: !o || $.isPending,
1067
- "aria-label": `Remove ${((I = y.user) == null ? void 0 : I.name) || "member"}`,
1067
+ "aria-label": `Remove ${((De = v.user) == null ? void 0 : De.name) || "member"}`,
1068
1068
  className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
1069
- children: /* @__PURE__ */ e(Wt, { className: "h-3 w-3" })
1069
+ children: /* @__PURE__ */ e(Zt, { className: "h-3 w-3" })
1070
1070
  }
1071
1071
  )
1072
1072
  ]
1073
1073
  },
1074
- y.id
1074
+ v.id
1075
1075
  );
1076
1076
  }) }),
1077
1077
  r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */ s(
1078
1078
  "button",
1079
1079
  {
1080
1080
  type: "button",
1081
- onClick: g,
1081
+ onClick: b,
1082
1082
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
1083
1083
  children: [
1084
- /* @__PURE__ */ e(at, { className: "h-3 w-3" }),
1084
+ /* @__PURE__ */ e(st, { className: "h-3 w-3" }),
1085
1085
  "Delete group"
1086
1086
  ]
1087
1087
  }
1088
1088
  ) })
1089
1089
  ] });
1090
1090
  }
1091
- function Gn({
1091
+ function Xn({
1092
1092
  isTenantUser: t,
1093
1093
  tenantId: n,
1094
1094
  onCancel: a,
1095
1095
  onCreated: r
1096
1096
  }) {
1097
- const [o, l] = N(""), [m, u] = N(""), [g, f] = N(null), b = In(), c = o.trim().length >= 3 && o.trim().length <= 50, h = async () => {
1097
+ const [o, l] = N(""), [u, m] = N(""), [b, f] = N(null), g = Gn(), c = o.trim().length >= 3 && o.trim().length <= 50, h = async () => {
1098
1098
  if (!c) return;
1099
1099
  f(null);
1100
1100
  const i = {
1101
1101
  name: o.trim(),
1102
- description: m.trim() || void 0,
1102
+ description: u.trim() || void 0,
1103
1103
  type: t ? "TENANT_GROUP" : "ORG_GROUP",
1104
1104
  ...t && n ? { tenantId: n } : {}
1105
1105
  };
1106
1106
  try {
1107
- const x = await b.mutateAsync(i), v = x == null ? void 0 : x.id;
1108
- v ? r(v) : a();
1107
+ const x = await g.mutateAsync(i), y = x == null ? void 0 : x.id;
1108
+ y ? r(y) : a();
1109
1109
  } catch (x) {
1110
1110
  f(x instanceof Error ? x.message : "Failed to create group");
1111
1111
  }
1112
1112
  };
1113
1113
  return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1114
1114
  /* @__PURE__ */ s("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
1115
- /* @__PURE__ */ e(Ht, { children: "Name" }),
1115
+ /* @__PURE__ */ e(qt, { children: "Name" }),
1116
1116
  /* @__PURE__ */ e(
1117
1117
  "input",
1118
1118
  {
@@ -1126,24 +1126,24 @@ function Gn({
1126
1126
  ),
1127
1127
  /* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
1128
1128
  /* @__PURE__ */ s("div", { className: "mt-4", children: [
1129
- /* @__PURE__ */ e(Ht, { children: "Description (optional)" }),
1129
+ /* @__PURE__ */ e(qt, { children: "Description (optional)" }),
1130
1130
  /* @__PURE__ */ e(
1131
1131
  "textarea",
1132
1132
  {
1133
1133
  rows: 2,
1134
- value: m,
1135
- onChange: (i) => u(i.target.value),
1134
+ value: u,
1135
+ onChange: (i) => m(i.target.value),
1136
1136
  maxLength: 200,
1137
1137
  placeholder: "What is this group for?",
1138
1138
  className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
1139
1139
  }
1140
1140
  ),
1141
1141
  /* @__PURE__ */ s("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
1142
- m.length,
1142
+ u.length,
1143
1143
  "/200"
1144
1144
  ] })
1145
1145
  ] }),
1146
- g && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: g })
1146
+ b && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: b })
1147
1147
  ] }),
1148
1148
  /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
1149
1149
  /* @__PURE__ */ e(
@@ -1151,7 +1151,7 @@ function Gn({
1151
1151
  {
1152
1152
  type: "button",
1153
1153
  onClick: a,
1154
- disabled: b.isPending,
1154
+ disabled: g.isPending,
1155
1155
  className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-accent",
1156
1156
  children: "Cancel"
1157
1157
  }
@@ -1161,13 +1161,13 @@ function Gn({
1161
1161
  {
1162
1162
  type: "button",
1163
1163
  onClick: h,
1164
- disabled: !c || b.isPending,
1164
+ disabled: !c || g.isPending,
1165
1165
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
1166
- children: b.isPending ? /* @__PURE__ */ s(F, { children: [
1166
+ children: g.isPending ? /* @__PURE__ */ s(F, { children: [
1167
1167
  /* @__PURE__ */ e(Re, { className: "h-3 w-3 animate-spin" }),
1168
1168
  "Creating…"
1169
1169
  ] }) : /* @__PURE__ */ s(F, { children: [
1170
- /* @__PURE__ */ e(ae, { className: "h-3 w-3" }),
1170
+ /* @__PURE__ */ e(re, { className: "h-3 w-3" }),
1171
1171
  "Create group"
1172
1172
  ] })
1173
1173
  }
@@ -1175,30 +1175,30 @@ function Gn({
1175
1175
  ] })
1176
1176
  ] });
1177
1177
  }
1178
- function Bn({
1178
+ function Zn({
1179
1179
  query: t,
1180
1180
  setQuery: n,
1181
1181
  open: a,
1182
1182
  setOpen: r,
1183
1183
  candidates: o,
1184
1184
  showKindChip: l,
1185
- onAdd: m,
1186
- busy: u
1185
+ onAdd: u,
1186
+ busy: m
1187
1187
  }) {
1188
- const g = Pt(null), f = Pt(null), [b, c] = N(null);
1189
- Ma(() => {
1188
+ const b = Bt(null), f = Bt(null), [g, c] = N(null);
1189
+ Wa(() => {
1190
1190
  if (!a) {
1191
1191
  c(null);
1192
1192
  return;
1193
1193
  }
1194
1194
  const i = () => {
1195
- const x = g.current;
1195
+ const x = b.current;
1196
1196
  if (!x) return;
1197
- const v = x.getBoundingClientRect(), w = 240, p = window.innerHeight - v.bottom < w + 16 && v.top > w;
1197
+ const y = x.getBoundingClientRect(), w = 240, p = window.innerHeight - y.bottom < w + 16 && y.top > w;
1198
1198
  c({
1199
- left: v.left,
1200
- top: p ? v.top - 6 : v.bottom + 6,
1201
- width: v.width,
1199
+ left: y.left,
1200
+ top: p ? y.top - 6 : y.bottom + 6,
1201
+ width: y.width,
1202
1202
  above: p
1203
1203
  });
1204
1204
  };
@@ -1209,20 +1209,20 @@ function Bn({
1209
1209
  if (!a) return;
1210
1210
  const i = (x) => {
1211
1211
  var w, S;
1212
- const v = x.target;
1213
- (w = g.current) != null && w.contains(v) || (S = f.current) != null && S.contains(v) || r(!1);
1212
+ const y = x.target;
1213
+ (w = b.current) != null && w.contains(y) || (S = f.current) != null && S.contains(y) || r(!1);
1214
1214
  };
1215
1215
  return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
1216
1216
  }, [a, r]);
1217
- const h = a && o.length > 0 && b;
1217
+ const h = a && o.length > 0 && g;
1218
1218
  return /* @__PURE__ */ s("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
1219
1219
  /* @__PURE__ */ s(
1220
1220
  "div",
1221
1221
  {
1222
- ref: g,
1222
+ ref: b,
1223
1223
  className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
1224
1224
  children: [
1225
- /* @__PURE__ */ e(cn, { className: "h-3 w-3 text-muted-foreground" }),
1225
+ /* @__PURE__ */ e(wn, { className: "h-3 w-3 text-muted-foreground" }),
1226
1226
  /* @__PURE__ */ e(
1227
1227
  "input",
1228
1228
  {
@@ -1232,34 +1232,34 @@ function Bn({
1232
1232
  },
1233
1233
  onFocus: () => r(!0),
1234
1234
  placeholder: "Add a member by name or email…",
1235
- disabled: u,
1235
+ disabled: m,
1236
1236
  className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
1237
1237
  }
1238
1238
  )
1239
1239
  ]
1240
1240
  }
1241
1241
  ),
1242
- h && typeof document < "u" && Ba(
1242
+ h && typeof document < "u" && sn(
1243
1243
  /* @__PURE__ */ e(
1244
1244
  "div",
1245
1245
  {
1246
1246
  ref: f,
1247
1247
  style: {
1248
1248
  position: "fixed",
1249
- left: b.left,
1250
- top: b.top,
1251
- width: b.width,
1252
- transform: b.above ? "translateY(-100%)" : void 0
1249
+ left: g.left,
1250
+ top: g.top,
1251
+ width: g.width,
1252
+ transform: g.above ? "translateY(-100%)" : void 0
1253
1253
  },
1254
1254
  className: "z-[60] max-h-[240px] overflow-y-auto rounded-[5px] border border-border bg-background shadow-[0_8px_24px_-12px_rgba(0,0,0,0.18)]",
1255
1255
  children: o.map((i) => /* @__PURE__ */ s(
1256
1256
  "button",
1257
1257
  {
1258
1258
  type: "button",
1259
- onClick: () => m(i),
1259
+ onClick: () => u(i),
1260
1260
  className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
1261
1261
  children: [
1262
- /* @__PURE__ */ e(mr, { name: i.name || i.email || "?" }),
1262
+ /* @__PURE__ */ e(gr, { name: i.name || i.email || "?" }),
1263
1263
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1264
1264
  /* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: i.name || i.email || "Unknown" }),
1265
1265
  i.email && i.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: i.email })
@@ -1275,7 +1275,7 @@ function Bn({
1275
1275
  )
1276
1276
  ] });
1277
1277
  }
1278
- function lr(t, n) {
1278
+ function pr(t, n) {
1279
1279
  if (!t) return n;
1280
1280
  if (t instanceof Error) {
1281
1281
  const a = t.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
@@ -1283,7 +1283,7 @@ function lr(t, n) {
1283
1283
  }
1284
1284
  return typeof t == "string" ? t : n;
1285
1285
  }
1286
- function ur({
1286
+ function fr({
1287
1287
  title: t,
1288
1288
  message: n,
1289
1289
  onRetry: a
@@ -1302,30 +1302,66 @@ function ur({
1302
1302
  )
1303
1303
  ] });
1304
1304
  }
1305
- function Ht({ children: t }) {
1305
+ function qt({ children: t }) {
1306
1306
  return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
1307
1307
  }
1308
- function mr({ name: t }) {
1308
+ function gr({ name: t }) {
1309
1309
  const n = t.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1310
- return /* @__PURE__ */ e(dr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(cr, { className: "text-[9px] font-semibold", children: n || "?" }) });
1310
+ return /* @__PURE__ */ e(mr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(hr, { className: "text-[9px] font-semibold", children: n || "?" }) });
1311
1311
  }
1312
- function be(t, n, a) {
1313
- var l, m;
1312
+ const eo = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
1313
+ function to({
1314
+ open: t,
1315
+ onOpenChange: n
1316
+ }) {
1317
+ const a = C(
1318
+ (o) => {
1319
+ var l, u;
1320
+ return un({
1321
+ dashboardDefault: (u = (l = o.dashboard) == null ? void 0 : l.exportDefaults) == null ? void 0 : u.csvEncoding
1322
+ });
1323
+ }
1324
+ ), { setDashboardExportDefaults: r } = C(
1325
+ (o) => o.actions
1326
+ );
1327
+ return /* @__PURE__ */ e(Qt, { open: t, onOpenChange: n, children: /* @__PURE__ */ s(Wt, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
1328
+ /* @__PURE__ */ s(ua, { children: [
1329
+ /* @__PURE__ */ e(et, { className: "text-[15px]", children: "Download settings" }),
1330
+ /* @__PURE__ */ e(tt, { className: "text-[13px] leading-5", children: "Applies to every CSV downloaded or delivered from this dashboard. People can still change it for a single download." })
1331
+ ] }),
1332
+ /* @__PURE__ */ s("div", { className: "space-y-2", children: [
1333
+ /* @__PURE__ */ e(Hr, { htmlFor: "dashboard-csv-encoding", className: eo, children: "CSV encoding" }),
1334
+ /* @__PURE__ */ s(
1335
+ qr,
1336
+ {
1337
+ value: a,
1338
+ onValueChange: (o) => r({ csvEncoding: o }),
1339
+ children: [
1340
+ /* @__PURE__ */ e(jr, { id: "dashboard-csv-encoding", size: "sm", children: /* @__PURE__ */ e(zr, {}) }),
1341
+ /* @__PURE__ */ e(Kr, { children: ma.map((o) => /* @__PURE__ */ e(Qr, { value: o.value, children: o.label }, o.value)) })
1342
+ ]
1343
+ }
1344
+ )
1345
+ ] })
1346
+ ] }) });
1347
+ }
1348
+ function fe(t, n, a) {
1349
+ var l, u;
1314
1350
  const r = (t.controls || []).find(
1315
- (u) => u.id === a
1351
+ (m) => m.id === a
1316
1352
  );
1317
1353
  if (r)
1318
1354
  return r.label;
1319
- const o = (m = (l = qt(t, n)) == null ? void 0 : l.controls) == null ? void 0 : m.find(
1320
- (u) => u.id === a
1355
+ const o = (u = (l = Kt(t, n)) == null ? void 0 : l.controls) == null ? void 0 : u.find(
1356
+ (m) => m.id === a
1321
1357
  );
1322
1358
  return (o == null ? void 0 : o.label) || a;
1323
1359
  }
1324
1360
  function ge(t, n) {
1325
1361
  var a;
1326
- return ((a = qt(t, n)) == null ? void 0 : a.title) || n;
1362
+ return ((a = Kt(t, n)) == null ? void 0 : a.title) || n;
1327
1363
  }
1328
- function Hn(t) {
1364
+ function ro(t) {
1329
1365
  const { errors: n, dashboard: a } = t;
1330
1366
  if (!a)
1331
1367
  return n;
@@ -1335,57 +1371,57 @@ function Hn(t) {
1335
1371
  /^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
1336
1372
  );
1337
1373
  if (l) {
1338
- const [, b, c] = l, h = `${b}:${c}:missing-metric`;
1374
+ const [, g, c] = l, h = `${g}:${c}:missing-metric`;
1339
1375
  r.has(h) || r.set(
1340
1376
  h,
1341
- `"${ge(a, b)}" has an outdated "${be(
1377
+ `"${ge(a, g)}" has an outdated "${fe(
1342
1378
  a,
1343
- b,
1379
+ g,
1344
1380
  c
1345
1381
  )}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
1346
1382
  );
1347
1383
  continue;
1348
1384
  }
1349
- const m = o.match(
1385
+ const u = o.match(
1350
1386
  /^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
1351
1387
  );
1352
- if (m) {
1353
- const [, b, c] = m, h = `${b}:${c}:missing-group-by`;
1388
+ if (u) {
1389
+ const [, g, c] = u, h = `${g}:${c}:missing-group-by`;
1354
1390
  r.has(h) || r.set(
1355
1391
  h,
1356
- `"${ge(a, b)}" has an outdated "${be(
1392
+ `"${ge(a, g)}" has an outdated "${fe(
1357
1393
  a,
1358
- b,
1394
+ g,
1359
1395
  c
1360
1396
  )}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
1361
1397
  );
1362
1398
  continue;
1363
1399
  }
1364
- const u = o.match(
1400
+ const m = o.match(
1365
1401
  /^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
1366
1402
  );
1367
- if (u) {
1368
- const [, b, c] = u, h = `${b}:${c}:invalid-metric`;
1403
+ if (m) {
1404
+ const [, g, c] = m, h = `${g}:${c}:invalid-metric`;
1369
1405
  r.has(h) || r.set(
1370
1406
  h,
1371
- `"${ge(a, b)}" has an invalid "${be(
1407
+ `"${ge(a, g)}" has an invalid "${fe(
1372
1408
  a,
1373
- b,
1409
+ g,
1374
1410
  c
1375
1411
  )}" metric mapping. Open the card controls and choose a valid metric for each option.`
1376
1412
  );
1377
1413
  continue;
1378
1414
  }
1379
- const g = o.match(
1415
+ const b = o.match(
1380
1416
  /^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
1381
1417
  );
1382
- if (g) {
1383
- const [, b, c] = g, h = `${b}:${c}:invalid-group-by`;
1418
+ if (b) {
1419
+ const [, g, c] = b, h = `${g}:${c}:invalid-group-by`;
1384
1420
  r.has(h) || r.set(
1385
1421
  h,
1386
- `"${ge(a, b)}" has an invalid "${be(
1422
+ `"${ge(a, g)}" has an invalid "${fe(
1387
1423
  a,
1388
- b,
1424
+ g,
1389
1425
  c
1390
1426
  )}" field mapping. Open the card controls and choose a valid field for each option.`
1391
1427
  );
@@ -1395,12 +1431,12 @@ function Hn(t) {
1395
1431
  /^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
1396
1432
  );
1397
1433
  if (f) {
1398
- const [, b, c] = f, h = `${b}:${c}:missing-temporal-group-by`;
1434
+ const [, g, c] = f, h = `${g}:${c}:missing-temporal-group-by`;
1399
1435
  r.has(h) || r.set(
1400
1436
  h,
1401
- `"${ge(a, b)}" can no longer use "${be(
1437
+ `"${ge(a, g)}" can no longer use "${fe(
1402
1438
  a,
1403
- b,
1439
+ g,
1404
1440
  c
1405
1441
  )}" for time grain because the card does not currently group by a date field.`
1406
1442
  );
@@ -1410,16 +1446,16 @@ function Hn(t) {
1410
1446
  }
1411
1447
  return Array.from(r.values());
1412
1448
  }
1413
- function Vn({
1449
+ function ao({
1414
1450
  visible: t,
1415
1451
  onSelect: n
1416
1452
  }) {
1417
1453
  return t ? /* @__PURE__ */ s(U, { onSelect: n, children: [
1418
- /* @__PURE__ */ e(ra, { className: "h-3.5 w-3.5" }),
1454
+ /* @__PURE__ */ e(ha, { className: "h-3.5 w-3.5" }),
1419
1455
  "Schedule email report"
1420
1456
  ] }) : null;
1421
1457
  }
1422
- function jn({
1458
+ function no({
1423
1459
  scheduleReportVisible: t,
1424
1460
  analyticalBriefingVisible: n,
1425
1461
  onScheduleReport: a,
@@ -1427,69 +1463,69 @@ function jn({
1427
1463
  }) {
1428
1464
  return /* @__PURE__ */ s(F, { children: [
1429
1465
  /* @__PURE__ */ e(
1430
- Vn,
1466
+ ao,
1431
1467
  {
1432
1468
  visible: t,
1433
1469
  onSelect: a
1434
1470
  }
1435
1471
  ),
1436
1472
  n ? /* @__PURE__ */ s(U, { onSelect: r, children: [
1437
- /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5" }),
1473
+ /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1438
1474
  "Create analytical briefing"
1439
1475
  ] }) : null
1440
1476
  ] });
1441
1477
  }
1442
- function Vt(t, n) {
1478
+ function jt(t, n) {
1443
1479
  return {
1444
- dashboard: Ze(t),
1445
- semanticExecutionPayload: Ze(n)
1480
+ dashboard: rt(t),
1481
+ semanticExecutionPayload: rt(n)
1446
1482
  };
1447
1483
  }
1448
- function fo() {
1449
- var vt, yt, wt, Nt, St;
1450
- La(), Pa();
1484
+ function Ao() {
1485
+ var St, Dt, Ct, kt, Et;
1486
+ Ja(), Ya();
1451
1487
  const {
1452
1488
  authToken: t,
1453
1489
  tokenProps: n,
1454
1490
  id: a,
1455
1491
  showBriefings: r
1456
- } = W(), o = aa(), { isLocalDev: l } = na(), {
1457
- canEditDashboard: m,
1458
- hasInspectionUser: u,
1459
- inspectionMessage: g,
1492
+ } = J(), o = pa(), { isLocalDev: l } = fa(), {
1493
+ canEditDashboard: u,
1494
+ hasInspectionUser: m,
1495
+ inspectionMessage: b,
1460
1496
  isInspectionMode: f,
1461
- isInspectionSurface: b
1462
- } = oa(), { openBrandStudioPreview: c } = sa(), { permissions: h } = pn(), i = ia(), { isLoading: x } = da(), v = C((d) => d.theme), w = C((d) => d.isDownloadingPdf), S = C(
1497
+ isInspectionSurface: g
1498
+ } = ga(), { openBrandStudioPreview: c } = ba(), { permissions: h } = kn(), i = xa(), { isLoading: x } = va(), y = C((d) => d.theme), w = C((d) => d.isDownloadingPdf), S = C(
1463
1499
  (d) => d.dashboardAssistantDraftScopeKey
1464
- ), p = C((d) => d.dashboard), $ = C((d) => d.selectedSheetId), T = (vt = p == null ? void 0 : p.sheets) == null ? void 0 : vt.find(
1500
+ ), p = C((d) => d.dashboard), $ = C((d) => d.selectedSheetId), T = (St = p == null ? void 0 : p.sheets) == null ? void 0 : St.find(
1465
1501
  (d) => d.id === $
1466
- ), M = $r(T), A = M ? (yt = T == null ? void 0 : T.document) == null ? void 0 : yt.page : void 0, E = C(
1502
+ ), A = Wr(T), I = A ? (Dt = T == null ? void 0 : T.document) == null ? void 0 : Dt.page : void 0, k = C(
1467
1503
  (d) => d.isDashboardEditing
1468
- ), { setDashboardTitle: J } = C((d) => d.actions), [Te, j] = N(!1), [oe, q] = N(!1), [se, ie] = N(!1), [Ne, Y] = N(null), [Fe, de] = N(!1), [Se, X] = N(!1), [Z, G] = N(null), [y, R] = N([]), [ce, z] = N(!1), [De, le] = N(!1), I = C((d) => d.isVisualEditing);
1469
- Ct((d) => d.card);
1470
- const hr = Pe(
1504
+ ), { setDashboardTitle: Y } = C((d) => d.actions), [Te, q] = N(!1), [ne, j] = N(!1), [oe, se] = N(!1), [Fe, ie] = N(!1), [we, X] = N(null), [Ne, Se] = N(!1), [$e, B] = N(!1), [v, R] = N(null), [de, z] = N([]), [ce, K] = N(!1), [De, ct] = N(!1), _ = C((d) => d.isVisualEditing);
1505
+ At((d) => d.card);
1506
+ const br = Pe(
1471
1507
  (d) => d.selectedDashboard
1472
- ), pr = Pe(
1508
+ ), xr = Pe(
1473
1509
  (d) => d.initialDashboard
1474
1510
  );
1475
- Pe((d) => d.selectedVisual), C((d) => d.selectedFrameId), Ct((d) => d.frame);
1476
- const st = C(
1511
+ Pe((d) => d.selectedVisual), C((d) => d.selectedFrameId), At((d) => d.frame);
1512
+ const lt = C(
1477
1513
  (d) => d.showDashboardJSON
1478
1514
  );
1479
1515
  C((d) => d.onSaveFunction);
1480
- const { setIsDashboardEditing: it, setShowDashboardJSON: dt } = C(
1516
+ const { setIsDashboardEditing: ut, setShowDashboardJSON: mt } = C(
1481
1517
  (d) => d.actions
1482
- ), { setInitialDashboard: ct, clearSelectedDashboard: $e } = Pe(
1518
+ ), { setInitialDashboard: ht, clearSelectedDashboard: Be } = Pe(
1483
1519
  (d) => d.actions
1484
- ), ue = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Ce } = ca(Qe.DASHBOARD), { data: Ge } = la(), fr = ((wt = Ge == null ? void 0 : Ge.preference) == null ? void 0 : wt.defaultDashboardId) || null, { mutate: br, isPending: gr } = ua(), { currentUser: xr } = rt(), vr = ma(xr), B = hr || pr, ee = ha({
1520
+ ), le = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Ce } = ya(We.DASHBOARD), { data: Ge } = wa(), vr = ((Ct = Ge == null ? void 0 : Ge.preference) == null ? void 0 : Ct.defaultDashboardId) || null, { mutate: yr, isPending: wr } = Na(), { currentUser: Nr } = ot(), Sr = Sa(Nr), G = br || xr, Z = Da({
1485
1521
  config: n.config,
1486
- canNavigateDashboardHub: ue,
1487
- canShareDashboard: ((Nt = B == null ? void 0 : B.permissions) == null ? void 0 : Nt.canShare) === !0,
1488
- canManageGroups: vr
1489
- }), lt = B ? {
1490
- id: B.id,
1491
- title: (p == null ? void 0 : p.title) || B.title || "Dashboard"
1492
- } : null, { handleAddNewFrame: yr } = pa(), [Be, He] = N(!1), [wr, me] = N(!1), [Ve, ke] = N("close"), he = fa(Qe.DASHBOARD), [L, pe] = N(null), Nr = async (d, P) => {
1522
+ canNavigateDashboardHub: le,
1523
+ canShareDashboard: ((kt = G == null ? void 0 : G.permissions) == null ? void 0 : kt.canShare) === !0,
1524
+ canManageGroups: Sr
1525
+ }), pt = G ? {
1526
+ id: G.id,
1527
+ title: (p == null ? void 0 : p.title) || G.title || "Dashboard"
1528
+ } : null, { handleAddNewFrame: Dr } = Ca(), [Ve, He] = N(!1), [Cr, ue] = N(!1), [qe, ke] = N("close"), me = ka(We.DASHBOARD), [M, he] = N(null), kr = async (d, L) => {
1493
1529
  if (!f) {
1494
1530
  if (!(p != null && p.id)) {
1495
1531
  console.log("No dashboard ID found");
@@ -1498,25 +1534,25 @@ function fo() {
1498
1534
  console.log("Updating dashboard title:", {
1499
1535
  dashboardId: p.id,
1500
1536
  newTitle: d,
1501
- previousTitle: P
1502
- }), he.mutate(
1537
+ previousTitle: L
1538
+ }), me.mutate(
1503
1539
  {
1504
1540
  resourceId: p.id,
1505
1541
  data: { title: d }
1506
1542
  },
1507
1543
  {
1508
1544
  onSuccess: () => {
1509
- pe(
1510
- (_) => (_ == null ? void 0 : _.dashboard.id) === p.id ? {
1511
- ..._,
1512
- dashboard: { ..._.dashboard, title: d }
1513
- } : _
1545
+ he(
1546
+ (P) => (P == null ? void 0 : P.dashboard.id) === p.id ? {
1547
+ ...P,
1548
+ dashboard: { ...P.dashboard, title: d }
1549
+ } : P
1514
1550
  ), D.success("Dashboard title updated");
1515
1551
  },
1516
- onError: (_) => {
1517
- console.error("Failed to update dashboard title:", _), D.error("Failed to update dashboard title");
1518
- const re = C.getState().dashboard;
1519
- (re == null ? void 0 : re.id) === p.id && re.title === d && J(P);
1552
+ onError: (P) => {
1553
+ console.error("Failed to update dashboard title:", P), D.error("Failed to update dashboard title");
1554
+ const te = C.getState().dashboard;
1555
+ (te == null ? void 0 : te.id) === p.id && te.title === d && Y(L);
1520
1556
  }
1521
1557
  }
1522
1558
  );
@@ -1526,184 +1562,184 @@ function fo() {
1526
1562
  if (Ce && Ce.length > 0) {
1527
1563
  const d = p == null ? void 0 : p.id;
1528
1564
  if (d) {
1529
- const P = Ce.find(
1530
- (_) => _.id === d
1565
+ const L = Ce.find(
1566
+ (P) => P.id === d
1531
1567
  );
1532
- P && ct(P);
1568
+ L && ht(L);
1533
1569
  }
1534
1570
  }
1535
- }, [Ce, p == null ? void 0 : p.id, ct]);
1536
- const Sr = n.orgUserId || n.tenantId, je = Q(
1537
- () => qn({
1571
+ }, [Ce, p == null ? void 0 : p.id, ht]);
1572
+ const Er = n.orgUserId || n.tenantId, je = W(
1573
+ () => oo({
1538
1574
  accessToken: t == null ? void 0 : t.accessToken,
1539
1575
  dashboardId: (p == null ? void 0 : p.id) || a || n.dashboard_id,
1540
- selectedSheetId: M ? $ : void 0,
1541
- pageSize: A == null ? void 0 : A.size,
1542
- orientation: A == null ? void 0 : A.orientation,
1543
- theme: v
1576
+ selectedSheetId: A ? $ : void 0,
1577
+ pageSize: I == null ? void 0 : I.size,
1578
+ orientation: I == null ? void 0 : I.orientation,
1579
+ theme: y
1544
1580
  }),
1545
1581
  [
1546
1582
  t == null ? void 0 : t.accessToken,
1547
1583
  a,
1548
1584
  p == null ? void 0 : p.id,
1549
- M,
1550
- A == null ? void 0 : A.orientation,
1551
- A == null ? void 0 : A.size,
1585
+ A,
1586
+ I == null ? void 0 : I.orientation,
1587
+ I == null ? void 0 : I.size,
1552
1588
  $,
1553
- v,
1589
+ y,
1554
1590
  n.dashboard_id
1555
1591
  ]
1556
- ), ut = E && !I && !f && Sr && m, { setDashboard: qe } = C((d) => d.actions), mt = C(
1592
+ ), ft = k && !_ && !f && Er && u, { setDashboard: ze } = C((d) => d.actions), gt = C(
1557
1593
  (d) => d.semanticExecutionPayload
1558
- ), Dr = () => {
1559
- it(!0);
1594
+ ), Ir = () => {
1595
+ ut(!0);
1560
1596
  }, Ee = () => {
1561
- it(!1), dt(!1), pe(null);
1597
+ ut(!1), mt(!1), he(null);
1562
1598
  };
1563
1599
  Ue(() => {
1564
- if (!E) {
1565
- L && pe(null);
1600
+ if (!k) {
1601
+ M && he(null);
1566
1602
  return;
1567
1603
  }
1568
- L || !p || x || pe(
1569
- Vt(
1604
+ M || !p || x || he(
1605
+ jt(
1570
1606
  p,
1571
- mt
1607
+ gt
1572
1608
  )
1573
1609
  );
1574
1610
  }, [
1575
1611
  p,
1576
- L,
1577
- E,
1612
+ M,
1613
+ k,
1578
1614
  x,
1579
- mt
1615
+ gt
1580
1616
  ]);
1581
- const ht = (L == null ? void 0 : L.dashboard) ?? null, { isDirty: pt, isDirtyPending: Cr, resetDirty: fe } = Za(
1617
+ const bt = (M == null ? void 0 : M.dashboard) ?? null, { isDirty: xt, isDirtyPending: Ar, resetDirty: pe } = mn(
1582
1618
  p,
1583
- ht,
1619
+ bt,
1584
1620
  300,
1585
1621
  1e3,
1586
- en
1587
- ), ft = _a(
1588
- ht,
1622
+ hn
1623
+ ), vt = Xa(
1624
+ bt,
1589
1625
  f,
1590
- m
1591
- ), bt = pt || Cr, Ae = Be || he.isPending, kr = () => {
1626
+ u
1627
+ ), yt = xt || Ar, Ie = Ve || me.isPending, Mr = () => {
1592
1628
  if (f) {
1593
- L && qe(L.dashboard, {
1594
- semanticExecutionPayload: L.semanticExecutionPayload
1595
- }), Ee(), fe();
1629
+ M && ze(M.dashboard, {
1630
+ semanticExecutionPayload: M.semanticExecutionPayload
1631
+ }), Ee(), pe();
1596
1632
  return;
1597
1633
  }
1598
- ft() ? (ke("close"), me(!0)) : (Ee(), fe());
1599
- }, Er = async () => {
1600
- await ze({
1634
+ vt() ? (ke("close"), ue(!0)) : (Ee(), pe());
1635
+ }, Lr = async () => {
1636
+ await Ke({
1601
1637
  closeAfterSave: !0,
1602
- navigateHomeAfterSave: Ve === "home"
1638
+ navigateHomeAfterSave: qe === "home"
1603
1639
  });
1604
- }, Ar = () => {
1605
- const d = Ve === "home" && !!ue;
1606
- L && qe(L.dashboard, {
1607
- semanticExecutionPayload: L.semanticExecutionPayload
1608
- }), Ee(), d && $e(), ke("close"), me(!1), fe();
1609
- }, Ir = () => {
1610
- L && (qe(L.dashboard, {
1611
- semanticExecutionPayload: L.semanticExecutionPayload
1612
- }), fe());
1613
- }, Mr = () => {
1614
- if (ue) {
1615
- if (E && ft()) {
1616
- ke("home"), me(!0);
1640
+ }, Pr = () => {
1641
+ const d = qe === "home" && !!le;
1642
+ M && ze(M.dashboard, {
1643
+ semanticExecutionPayload: M.semanticExecutionPayload
1644
+ }), Ee(), d && Be(), ke("close"), ue(!1), pe();
1645
+ }, Or = () => {
1646
+ M && (ze(M.dashboard, {
1647
+ semanticExecutionPayload: M.semanticExecutionPayload
1648
+ }), pe());
1649
+ }, _r = () => {
1650
+ if (le) {
1651
+ if (k && vt()) {
1652
+ ke("home"), ue(!0);
1617
1653
  return;
1618
1654
  }
1619
- $e();
1655
+ Be();
1620
1656
  }
1621
1657
  };
1622
- async function ze(d) {
1658
+ async function Ke(d) {
1623
1659
  if (f)
1624
1660
  return;
1625
- const P = C.getState().dashboard;
1626
- if (!P)
1661
+ const L = C.getState().dashboard;
1662
+ if (!L)
1627
1663
  return;
1628
- const _ = (d == null ? void 0 : d.closeAfterSave) ?? ce, re = (d == null ? void 0 : d.navigateHomeAfterSave) ?? !1;
1629
- z(_), _ && me(!1);
1630
- const Rr = Ze(P);
1631
- X(!0), G(null), R([]), He(!0);
1632
- const Ur = {
1633
- template: P
1664
+ const P = (d == null ? void 0 : d.closeAfterSave) ?? ce, te = (d == null ? void 0 : d.navigateHomeAfterSave) ?? !1;
1665
+ K(P), P && ue(!1);
1666
+ const $r = rt(L);
1667
+ B(!0), R(null), z([]), He(!0);
1668
+ const Br = {
1669
+ template: L
1634
1670
  };
1635
- he.mutate(
1671
+ me.mutate(
1636
1672
  {
1637
- resourceId: P.id,
1638
- data: Ur
1673
+ resourceId: L.id,
1674
+ data: Br
1639
1675
  },
1640
1676
  {
1641
1677
  onSuccess: (O) => {
1642
- var Ie, Me, Dt;
1643
- const K = (O == null ? void 0 : O.id) || ((Ie = O == null ? void 0 : O.dashboard) == null ? void 0 : Ie.id) || ((Me = O == null ? void 0 : O.resource) == null ? void 0 : Me.id) || ((Dt = O == null ? void 0 : O.template) == null ? void 0 : Dt.id) || null;
1644
- if (!P.id && K) {
1645
- const Ke = Br.getState(), Le = Ke.pendingDashboardDraftMigration;
1646
- (Le == null ? void 0 : Le.scopeKey) === S ? Ke.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1647
- K
1648
- ) : Le && Ke.actions.clearPendingDashboardDraftMigration();
1678
+ var Ae, Me, It;
1679
+ const Q = (O == null ? void 0 : O.id) || ((Ae = O == null ? void 0 : O.dashboard) == null ? void 0 : Ae.id) || ((Me = O == null ? void 0 : O.resource) == null ? void 0 : Me.id) || ((It = O == null ? void 0 : O.template) == null ? void 0 : It.id) || null;
1680
+ if (!L.id && Q) {
1681
+ const Qe = Xr.getState(), Le = Qe.pendingDashboardDraftMigration;
1682
+ (Le == null ? void 0 : Le.scopeKey) === S ? Qe.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1683
+ Q
1684
+ ) : Le && Qe.actions.clearPendingDashboardDraftMigration();
1649
1685
  }
1650
- He(!1), D.success("Dashboard saved!"), pe(
1651
- Vt(
1652
- Rr,
1686
+ He(!1), D.success("Dashboard saved!"), he(
1687
+ jt(
1688
+ $r,
1653
1689
  C.getState().semanticExecutionPayload
1654
1690
  )
1655
- ), X(!1), z(!1), _ && (Ee(), fe(), re && ue && $e()), ke("close");
1691
+ ), B(!1), K(!1), P && (Ee(), pe(), te && le && Be()), ke("close");
1656
1692
  },
1657
1693
  onError: (O) => {
1658
- He(!1), G("Failed to save dashboard. Please try again.");
1659
- const K = O.details, Ie = Array.isArray(
1660
- K == null ? void 0 : K.errors
1661
- ) ? (K.errors || []).filter(
1694
+ He(!1), R("Failed to save dashboard. Please try again.");
1695
+ const Q = O.details, Ae = Array.isArray(
1696
+ Q == null ? void 0 : Q.errors
1697
+ ) ? (Q.errors || []).filter(
1662
1698
  (Me) => typeof Me == "string"
1663
1699
  ) : [];
1664
- R(
1665
- Hn({
1666
- errors: Ie,
1667
- dashboard: P || void 0
1700
+ z(
1701
+ ro({
1702
+ errors: Ae,
1703
+ dashboard: L || void 0
1668
1704
  })
1669
1705
  ), D.error("Failed to save dashboard");
1670
1706
  }
1671
1707
  }
1672
1708
  );
1673
1709
  }
1674
- const gt = p.title;
1675
- he.isPending && console.log("Title during update:", {
1676
- title: gt,
1710
+ const wt = p.title;
1711
+ me.isPending && console.log("Title during update:", {
1712
+ title: wt,
1677
1713
  dashboardStateTitle: p.title,
1678
1714
  dashboardId: p == null ? void 0 : p.id
1679
1715
  });
1680
- const Lr = ue && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), Pr = !f && ee.showDashboardHub && Lr, _r = !f && i && ee.showDashboardHub, H = (p == null ? void 0 : p.id) || null, xt = ba(
1681
- (St = n.config) == null ? void 0 : St.showBriefings,
1716
+ const Rr = le && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), Ur = !f && Z.showDashboardHub && Rr, Tr = !f && i && Z.showDashboardHub, V = (p == null ? void 0 : p.id) || null, Nt = Ea(
1717
+ (Et = n.config) == null ? void 0 : Et.showBriefings,
1682
1718
  r
1683
- ), te = !!H && fr === H, Or = () => {
1684
- !H || f || br({
1685
- dashboardId: te ? null : H
1719
+ ), ee = !!V && vr === V, Fr = () => {
1720
+ !V || f || yr({
1721
+ dashboardId: ee ? null : V
1686
1722
  });
1687
1723
  };
1688
- return !i && !I ? null : /* @__PURE__ */ s(
1724
+ return !i && !_ ? null : /* @__PURE__ */ s(
1689
1725
  "div",
1690
1726
  {
1691
1727
  className: "flex min-h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-1.5",
1692
1728
  role: "dashboard-controls",
1693
1729
  children: [
1694
1730
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
1695
- _r && !I && /* @__PURE__ */ e(
1696
- At,
1731
+ Tr && !_ && /* @__PURE__ */ e(
1732
+ _t,
1697
1733
  {
1698
1734
  "aria-label": "Dashboard Hub",
1699
1735
  tooltip: "Dashboard Hub",
1700
- onClick: Mr,
1736
+ onClick: _r,
1701
1737
  className: "h-7 w-7 px-0",
1702
1738
  buttonProps: { size: "xs" },
1703
- children: /* @__PURE__ */ e(ga, { className: "h-3.5 w-3.5" })
1739
+ children: /* @__PURE__ */ e(Ia, { className: "h-3.5 w-3.5" })
1704
1740
  }
1705
1741
  ),
1706
- !I && i && (x ? /* @__PURE__ */ e(
1742
+ !_ && i && (x ? /* @__PURE__ */ e(
1707
1743
  "div",
1708
1744
  {
1709
1745
  className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
@@ -1713,29 +1749,29 @@ function fo() {
1713
1749
  }
1714
1750
  ) : /* @__PURE__ */ s(F, { children: [
1715
1751
  /* @__PURE__ */ e(
1716
- xa,
1752
+ Aa,
1717
1753
  {
1718
- value: gt || "Untitled Dashboard",
1754
+ value: wt || "Untitled Dashboard",
1719
1755
  onSave: (d) => {
1720
1756
  console.log("EditableText onSave called:", {
1721
1757
  newTitle: d,
1722
- canEditDashboard: m,
1758
+ canEditDashboard: u,
1723
1759
  dashboardId: p == null ? void 0 : p.id
1724
1760
  });
1725
- const P = (p == null ? void 0 : p.title) || "";
1726
- J(d), Nr(d, P);
1761
+ const L = (p == null ? void 0 : p.title) || "";
1762
+ Y(d), kr(d, L);
1727
1763
  },
1728
- isEditable: va({
1729
- isDashboardEditing: E,
1730
- canEditDashboard: m === !0 && !f
1764
+ isEditable: Ma({
1765
+ isDashboardEditing: k,
1766
+ canEditDashboard: u === !0 && !f
1731
1767
  }),
1732
1768
  displayClassName: "text-[13px] font-medium",
1733
1769
  inputClassName: "text-[13px] font-medium",
1734
1770
  placeholder: "Dashboard Title",
1735
- isPending: he.isPending
1771
+ isPending: me.isPending
1736
1772
  }
1737
1773
  ),
1738
- ee.showDashboardHub && te && /* @__PURE__ */ e(
1774
+ Z.showDashboardHub && ee && /* @__PURE__ */ e(
1739
1775
  "span",
1740
1776
  {
1741
1777
  className: "shrink-0 rounded-[4px] border border-border/60 px-1.5 py-px text-[10px] font-medium uppercase tracking-[0.06em] text-muted-foreground",
@@ -1743,145 +1779,145 @@ function fo() {
1743
1779
  children: "Default"
1744
1780
  }
1745
1781
  ),
1746
- Pr && H && /* @__PURE__ */ e(Rt, { children: /* @__PURE__ */ s(Ut, { children: [
1747
- /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ e(
1748
- V,
1782
+ Ur && V && /* @__PURE__ */ e(Mt, { children: /* @__PURE__ */ s(Lt, { children: [
1783
+ /* @__PURE__ */ e(Pt, { asChild: !0, children: /* @__PURE__ */ e(
1784
+ H,
1749
1785
  {
1750
1786
  variant: "ghost",
1751
1787
  size: "xs",
1752
- onClick: Or,
1753
- disabled: gr || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
1754
- className: xe(
1788
+ onClick: Fr,
1789
+ disabled: wr || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
1790
+ className: be(
1755
1791
  "w-7 px-0",
1756
- te ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
1792
+ ee ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
1757
1793
  ),
1758
- "aria-pressed": te,
1759
- "aria-label": te ? "Remove as default dashboard" : "Set as default dashboard",
1760
- children: /* @__PURE__ */ e(ya, { className: "h-3.5 w-3.5" })
1794
+ "aria-pressed": ee,
1795
+ "aria-label": ee ? "Remove as default dashboard" : "Set as default dashboard",
1796
+ children: /* @__PURE__ */ e(La, { className: "h-3.5 w-3.5" })
1761
1797
  }
1762
1798
  ) }),
1763
- /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ e("p", { children: te ? "Remove as default dashboard" : "Set as default dashboard" }) })
1799
+ /* @__PURE__ */ e(Ot, { children: /* @__PURE__ */ e("p", { children: ee ? "Remove as default dashboard" : "Set as default dashboard" }) })
1764
1800
  ] }) })
1765
1801
  ] }))
1766
1802
  ] }),
1767
1803
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
1768
- I && /* @__PURE__ */ s(F, { children: [
1769
- /* @__PURE__ */ e(Oa, {}),
1770
- /* @__PURE__ */ e(Ra, {})
1804
+ _ && /* @__PURE__ */ s(F, { children: [
1805
+ /* @__PURE__ */ e(Za, {}),
1806
+ /* @__PURE__ */ e(en, {})
1771
1807
  ] }),
1772
- !I && i && !f && ee.showDashboardSharing && /* @__PURE__ */ s(
1773
- V,
1808
+ !_ && i && !f && Z.showDashboardSharing && /* @__PURE__ */ s(
1809
+ H,
1774
1810
  {
1775
1811
  variant: "outline",
1776
1812
  size: "xs",
1777
- onClick: () => j(!0),
1813
+ onClick: () => q(!0),
1778
1814
  children: [
1779
- /* @__PURE__ */ e(wa, { className: "h-3.5 w-3.5" }),
1815
+ /* @__PURE__ */ e(Pa, { className: "h-3.5 w-3.5" }),
1780
1816
  "Share"
1781
1817
  ]
1782
1818
  }
1783
1819
  ),
1784
- !I && E && !f && h.canUseFilters && i && /* @__PURE__ */ e(Ua, {}),
1785
- E && !I && !f && i && !M && /* @__PURE__ */ s("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1820
+ !_ && k && !f && h.canUseFilters && i && /* @__PURE__ */ e(tn, {}),
1821
+ k && !_ && !f && i && !A && /* @__PURE__ */ s("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1786
1822
  /* @__PURE__ */ s(
1787
- V,
1823
+ H,
1788
1824
  {
1789
1825
  variant: "ghost",
1790
1826
  size: "xs",
1791
- disabled: !E,
1792
- onClick: () => void yr(),
1827
+ disabled: !k,
1828
+ onClick: () => void Dr(),
1793
1829
  className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
1794
1830
  children: [
1795
- /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5" }),
1831
+ /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1796
1832
  "Visual"
1797
1833
  ]
1798
1834
  }
1799
1835
  ),
1800
- /* @__PURE__ */ s(It, { modal: !1, children: [
1801
- /* @__PURE__ */ e(Mt, { asChild: !0, children: /* @__PURE__ */ e(
1802
- V,
1836
+ /* @__PURE__ */ s(Rt, { modal: !1, children: [
1837
+ /* @__PURE__ */ e(Ut, { asChild: !0, children: /* @__PURE__ */ e(
1838
+ H,
1803
1839
  {
1804
1840
  variant: "ghost",
1805
1841
  size: "xs",
1806
1842
  className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
1807
1843
  "aria-label": "Open visual options",
1808
- disabled: !E,
1809
- children: /* @__PURE__ */ e(Ia, { className: "h-3.5 w-3.5" })
1844
+ disabled: !k,
1845
+ children: /* @__PURE__ */ e(Qa, { className: "h-3.5 w-3.5" })
1810
1846
  }
1811
1847
  ) }),
1812
1848
  /* @__PURE__ */ e(
1813
- Lt,
1849
+ Tt,
1814
1850
  {
1815
1851
  align: "end",
1816
1852
  className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
1817
- children: /* @__PURE__ */ s(U, { onClick: () => le(!0), children: [
1818
- /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5" }),
1853
+ children: /* @__PURE__ */ s(U, { onClick: () => ct(!0), children: [
1854
+ /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1819
1855
  "From library..."
1820
1856
  ] })
1821
1857
  }
1822
1858
  )
1823
1859
  ] }),
1824
1860
  /* @__PURE__ */ e(
1825
- Ta,
1861
+ rn,
1826
1862
  {
1827
1863
  open: De,
1828
- onOpenChange: le
1864
+ onOpenChange: ct
1829
1865
  }
1830
1866
  )
1831
1867
  ] }),
1832
- !I && !E && (m || f) && (!b || !u || m !== void 0) && i && /* @__PURE__ */ s("div", { className: "inline-flex items-center gap-1", children: [
1833
- /* @__PURE__ */ s(V, { size: "xs", onClick: Dr, children: [
1834
- /* @__PURE__ */ e(Na, { className: "h-3.5 w-3.5" }),
1868
+ !_ && !k && (u || f) && (!g || !m || u !== void 0) && i && /* @__PURE__ */ s("div", { className: "inline-flex items-center gap-1", children: [
1869
+ /* @__PURE__ */ s(H, { size: "xs", onClick: Ir, children: [
1870
+ /* @__PURE__ */ e(Oa, { className: "h-3.5 w-3.5" }),
1835
1871
  f ? "Inspect" : "Edit"
1836
1872
  ] }),
1837
- g ? /* @__PURE__ */ e(Rt, { children: /* @__PURE__ */ s(Ut, { children: [
1838
- /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ e(
1873
+ b ? /* @__PURE__ */ e(Mt, { children: /* @__PURE__ */ s(Lt, { children: [
1874
+ /* @__PURE__ */ e(Pt, { asChild: !0, children: /* @__PURE__ */ e(
1839
1875
  "button",
1840
1876
  {
1841
1877
  type: "button",
1842
- "aria-label": g,
1878
+ "aria-label": b,
1843
1879
  className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1844
- children: /* @__PURE__ */ e(Xa, { "aria-hidden": "true", className: "size-3.5" })
1880
+ children: /* @__PURE__ */ e(Jr, { "aria-hidden": "true", className: "size-3.5" })
1845
1881
  }
1846
1882
  ) }),
1847
- /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ e("p", { children: g }) })
1883
+ /* @__PURE__ */ e(Ot, { children: /* @__PURE__ */ e("p", { children: b }) })
1848
1884
  ] }) }) : null
1849
1885
  ] }),
1850
- ut && i && pt && /* @__PURE__ */ s(
1851
- V,
1886
+ ft && i && xt && /* @__PURE__ */ s(
1887
+ H,
1852
1888
  {
1853
1889
  variant: "outline",
1854
1890
  size: "xs",
1855
- onClick: Ir,
1856
- disabled: Ae,
1891
+ onClick: Or,
1892
+ disabled: Ie,
1857
1893
  children: [
1858
- /* @__PURE__ */ e(Sa, { className: "h-3.5 w-3.5" }),
1894
+ /* @__PURE__ */ e(_a, { className: "h-3.5 w-3.5" }),
1859
1895
  "Undo"
1860
1896
  ]
1861
1897
  }
1862
1898
  ),
1863
- ut && i && /* @__PURE__ */ s(
1864
- V,
1899
+ ft && i && /* @__PURE__ */ s(
1900
+ H,
1865
1901
  {
1866
1902
  size: "xs",
1867
- className: xe(!bt && "opacity-60"),
1868
- disabled: Ae || !bt,
1869
- onClick: () => ze(),
1903
+ className: be(!yt && "opacity-60"),
1904
+ disabled: Ie || !yt,
1905
+ onClick: () => Ke(),
1870
1906
  children: [
1871
- Ae ? /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(tn, { className: "h-3.5 w-3.5" }),
1872
- Ae ? "Saving..." : "Save"
1907
+ Ie ? /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pn, { className: "h-3.5 w-3.5" }),
1908
+ Ie ? "Saving..." : "Save"
1873
1909
  ]
1874
1910
  }
1875
1911
  ),
1876
- E && !I && i && /* @__PURE__ */ s(V, { variant: "outline", size: "xs", onClick: kr, children: [
1877
- /* @__PURE__ */ e(Da, { className: "h-3.5 w-3.5" }),
1912
+ k && !_ && i && /* @__PURE__ */ s(H, { variant: "outline", size: "xs", onClick: Mr, children: [
1913
+ /* @__PURE__ */ e(Ra, { className: "h-3.5 w-3.5" }),
1878
1914
  "Close"
1879
1915
  ] }),
1880
- !I && i && /* @__PURE__ */ e("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ e(Fa, {}) }),
1881
- !I && l && /* @__PURE__ */ e(hn, {}),
1882
- !I && i && !f && /* @__PURE__ */ s(It, { children: [
1883
- /* @__PURE__ */ e(Mt, { asChild: !0, children: /* @__PURE__ */ e(
1884
- At,
1916
+ !_ && i && /* @__PURE__ */ e("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ e(an, {}) }),
1917
+ !_ && l && /* @__PURE__ */ e(Cn, {}),
1918
+ !_ && i && !f && /* @__PURE__ */ s(Rt, { children: [
1919
+ /* @__PURE__ */ e(Ut, { asChild: !0, children: /* @__PURE__ */ e(
1920
+ _t,
1885
1921
  {
1886
1922
  tooltip: "More Options",
1887
1923
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
@@ -1890,59 +1926,69 @@ function fo() {
1890
1926
  variant: "ghost",
1891
1927
  "aria-label": "More dashboard options"
1892
1928
  },
1893
- children: /* @__PURE__ */ e(Ca, { className: "h-3.5 w-3.5" })
1929
+ children: /* @__PURE__ */ e(Ua, { className: "h-3.5 w-3.5" })
1894
1930
  }
1895
1931
  ) }),
1896
1932
  /* @__PURE__ */ s(
1897
- Lt,
1933
+ Tt,
1898
1934
  {
1899
1935
  align: "end",
1900
1936
  className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
1901
1937
  children: [
1902
- /* @__PURE__ */ e(_e, { children: "Reports & briefings" }),
1938
+ /* @__PURE__ */ e(Oe, { children: "Reports & briefings" }),
1903
1939
  /* @__PURE__ */ s(
1904
1940
  U,
1905
1941
  {
1906
1942
  disabled: w,
1907
- onSelect: () => de(!0),
1943
+ onSelect: () => Se(!0),
1908
1944
  children: [
1909
- /* @__PURE__ */ e(ka, { className: "h-3.5 w-3.5" }),
1945
+ /* @__PURE__ */ e(Ta, { className: "h-3.5 w-3.5" }),
1910
1946
  "Export"
1911
1947
  ]
1912
1948
  }
1913
1949
  ),
1914
1950
  /* @__PURE__ */ e(
1915
- jn,
1951
+ no,
1916
1952
  {
1917
- scheduleReportVisible: !!(xt && o.surfaceVisible && H && !E),
1918
- analyticalBriefingVisible: !!(xt && o.surfaceVisible && H && !E),
1919
- onScheduleReport: () => Y("scheduled_report"),
1920
- onCreateAnalyticalBriefing: () => Y("analytical_briefing")
1953
+ scheduleReportVisible: !!(Nt && o.surfaceVisible && V && !k),
1954
+ analyticalBriefingVisible: !!(Nt && o.surfaceVisible && V && !k),
1955
+ onScheduleReport: () => X("scheduled_report"),
1956
+ onCreateAnalyticalBriefing: () => X("analytical_briefing")
1921
1957
  }
1922
1958
  ),
1923
- /* @__PURE__ */ e(We, {}),
1924
- ee.showGroupManagement && /* @__PURE__ */ s(F, { children: [
1925
- /* @__PURE__ */ e(_e, { children: "Access" }),
1959
+ k && /* @__PURE__ */ s(
1960
+ U,
1961
+ {
1962
+ onSelect: () => ie(!0),
1963
+ children: [
1964
+ /* @__PURE__ */ e(Fa, { className: "h-3.5 w-3.5" }),
1965
+ "Download settings"
1966
+ ]
1967
+ }
1968
+ ),
1969
+ /* @__PURE__ */ e(Je, {}),
1970
+ Z.showGroupManagement && /* @__PURE__ */ s(F, { children: [
1971
+ /* @__PURE__ */ e(Oe, { children: "Access" }),
1926
1972
  /* @__PURE__ */ s(
1927
1973
  U,
1928
1974
  {
1929
- onClick: () => q(!0),
1975
+ onClick: () => j(!0),
1930
1976
  children: [
1931
- /* @__PURE__ */ e(Kt, { className: "h-3.5 w-3.5" }),
1977
+ /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
1932
1978
  "Manage Groups"
1933
1979
  ]
1934
1980
  }
1935
1981
  ),
1936
- /* @__PURE__ */ e(We, {})
1982
+ /* @__PURE__ */ e(Je, {})
1937
1983
  ] }),
1938
- /* @__PURE__ */ e(_e, { children: "Preferences" }),
1939
- /* @__PURE__ */ s(U, { onClick: () => ie(!0), children: [
1940
- /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
1984
+ /* @__PURE__ */ e(Oe, { children: "Preferences" }),
1985
+ /* @__PURE__ */ s(U, { onClick: () => se(!0), children: [
1986
+ /* @__PURE__ */ e(Xt, { className: "h-3.5 w-3.5" }),
1941
1987
  "Report preferences"
1942
1988
  ] }),
1943
1989
  l && i && /* @__PURE__ */ s(F, { children: [
1944
- /* @__PURE__ */ e(We, {}),
1945
- /* @__PURE__ */ e(_e, { children: "Developer" }),
1990
+ /* @__PURE__ */ e(Je, {}),
1991
+ /* @__PURE__ */ e(Oe, { children: "Developer" }),
1946
1992
  /* @__PURE__ */ s(
1947
1993
  U,
1948
1994
  {
@@ -1953,12 +1999,12 @@ function fo() {
1953
1999
  ).catch(() => D.error("Unable to copy token")) : D.error("Clipboard not available"));
1954
2000
  },
1955
2001
  children: [
1956
- /* @__PURE__ */ e(_t, { className: "h-3.5 w-3.5" }),
2002
+ /* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
1957
2003
  "Copy token"
1958
2004
  ]
1959
2005
  }
1960
2006
  ),
1961
- M && /* @__PURE__ */ s(
2007
+ A && /* @__PURE__ */ s(
1962
2008
  U,
1963
2009
  {
1964
2010
  disabled: !je,
@@ -1981,7 +2027,7 @@ function fo() {
1981
2027
  ) : D.error("Clipboard not available");
1982
2028
  },
1983
2029
  children: [
1984
- /* @__PURE__ */ e(_t, { className: "h-3.5 w-3.5" }),
2030
+ /* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
1985
2031
  "Copy local document PDF URL"
1986
2032
  ]
1987
2033
  }
@@ -1989,24 +2035,24 @@ function fo() {
1989
2035
  /* @__PURE__ */ s(
1990
2036
  U,
1991
2037
  {
1992
- onSelect: () => Gr(n.apiServiceUrl),
2038
+ onSelect: () => Yr(n.apiServiceUrl),
1993
2039
  children: [
1994
- /* @__PURE__ */ e(sn, { className: "h-3.5 w-3.5" }),
2040
+ /* @__PURE__ */ e(vn, { className: "h-3.5 w-3.5" }),
1995
2041
  "Invalidate token"
1996
2042
  ]
1997
2043
  }
1998
2044
  ),
1999
2045
  /* @__PURE__ */ s(U, { onSelect: c, children: [
2000
- /* @__PURE__ */ e(rn, { className: "h-3.5 w-3.5" }),
2046
+ /* @__PURE__ */ e(fn, { className: "h-3.5 w-3.5" }),
2001
2047
  "Brand Studio"
2002
2048
  ] }),
2003
- E && /* @__PURE__ */ s(
2049
+ k && /* @__PURE__ */ s(
2004
2050
  U,
2005
2051
  {
2006
- onSelect: () => dt(!st),
2052
+ onSelect: () => mt(!lt),
2007
2053
  children: [
2008
- /* @__PURE__ */ e(an, { className: "h-3.5 w-3.5" }),
2009
- st ? "Hide dashboard JSON" : "Show dashboard JSON"
2054
+ /* @__PURE__ */ e(gn, { className: "h-3.5 w-3.5" }),
2055
+ lt ? "Hide dashboard JSON" : "Show dashboard JSON"
2010
2056
  ]
2011
2057
  }
2012
2058
  )
@@ -2015,87 +2061,94 @@ function fo() {
2015
2061
  }
2016
2062
  )
2017
2063
  ] }),
2018
- Te && lt && /* @__PURE__ */ e(
2019
- Ea,
2064
+ Te && pt && /* @__PURE__ */ e(
2065
+ $a,
2066
+ {
2067
+ resource: pt,
2068
+ resourceType: We.DASHBOARD,
2069
+ onClose: () => q(!1)
2070
+ }
2071
+ ),
2072
+ Z.showGroupManagement && /* @__PURE__ */ e(
2073
+ Kn,
2020
2074
  {
2021
- resource: lt,
2022
- resourceType: Qe.DASHBOARD,
2023
- onClose: () => j(!1)
2075
+ open: ne,
2076
+ onOpenChange: j
2024
2077
  }
2025
2078
  ),
2026
- ee.showGroupManagement && /* @__PURE__ */ e(
2027
- Rn,
2079
+ /* @__PURE__ */ e(
2080
+ ln,
2028
2081
  {
2029
2082
  open: oe,
2030
- onOpenChange: q
2083
+ onOpenChange: se
2031
2084
  }
2032
2085
  ),
2033
2086
  /* @__PURE__ */ e(
2034
- Ya,
2087
+ to,
2035
2088
  {
2036
- open: se,
2089
+ open: Fe,
2037
2090
  onOpenChange: ie
2038
2091
  }
2039
2092
  ),
2040
- H && Ne ? /* @__PURE__ */ e(
2041
- $a,
2093
+ V && we ? /* @__PURE__ */ e(
2094
+ nn,
2042
2095
  {
2043
- dashboardId: H,
2044
- dashboardTitle: (p == null ? void 0 : p.title) || (B == null ? void 0 : B.title),
2096
+ dashboardId: V,
2097
+ dashboardTitle: (p == null ? void 0 : p.title) || (G == null ? void 0 : G.title),
2045
2098
  open: !0,
2046
2099
  onOpenChange: (d) => {
2047
- d || Y(null);
2100
+ d || X(null);
2048
2101
  },
2049
2102
  hideTrigger: !0,
2050
- workflowIntent: Ne
2103
+ workflowIntent: we
2051
2104
  }
2052
2105
  ) : null,
2053
2106
  i && /* @__PURE__ */ e(
2054
- Aa,
2107
+ Ba,
2055
2108
  {
2056
- open: Fe,
2057
- onOpenChange: de
2109
+ open: Ne,
2110
+ onOpenChange: Se
2058
2111
  }
2059
2112
  ),
2060
2113
  /* @__PURE__ */ e(
2061
- Ha,
2114
+ Ga,
2062
2115
  {
2063
- open: Se,
2116
+ open: $e,
2064
2117
  onOpenChange: (d) => {
2065
- !d && Be && !Z || (X(d), d || (G(null), R([]), z(!1)));
2118
+ !d && Ve && !v || (B(d), d || (R(null), z([]), K(!1)));
2066
2119
  },
2067
2120
  children: /* @__PURE__ */ s(Va, { className: "max-w-sm", children: [
2068
- /* @__PURE__ */ s(ja, { children: [
2069
- /* @__PURE__ */ e(qa, { children: Z ? "Save failed" : "Saving dashboard" }),
2070
- /* @__PURE__ */ e(za, { className: "pt-2", children: Z ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2071
- y.length > 0 && /* @__PURE__ */ s("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2121
+ /* @__PURE__ */ s(Ha, { children: [
2122
+ /* @__PURE__ */ e(qa, { children: v ? "Save failed" : "Saving dashboard" }),
2123
+ /* @__PURE__ */ e(ja, { className: "pt-2", children: v ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2124
+ de.length > 0 && /* @__PURE__ */ s("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2072
2125
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
2073
- /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: y.slice(0, 5).map((d) => /* @__PURE__ */ e("li", { children: d }, d)) })
2126
+ /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: de.slice(0, 5).map((d) => /* @__PURE__ */ e("li", { children: d }, d)) })
2074
2127
  ] })
2075
2128
  ] }),
2076
- /* @__PURE__ */ e(Ka, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: Z ? /* @__PURE__ */ s(F, { children: [
2129
+ /* @__PURE__ */ e(za, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: v ? /* @__PURE__ */ s(F, { children: [
2077
2130
  /* @__PURE__ */ e(
2078
- Qa,
2131
+ Ka,
2079
2132
  {
2080
2133
  onClick: () => {
2081
- X(!1), G(null), R([]), z(!1);
2134
+ B(!1), R(null), z([]), K(!1);
2082
2135
  },
2083
2136
  className: "m-0",
2084
2137
  children: "Close"
2085
2138
  }
2086
2139
  ),
2087
2140
  /* @__PURE__ */ e(
2088
- Ot,
2141
+ $t,
2089
2142
  {
2090
- onClick: () => ze({
2143
+ onClick: () => Ke({
2091
2144
  closeAfterSave: ce,
2092
- navigateHomeAfterSave: Ve === "home"
2145
+ navigateHomeAfterSave: qe === "home"
2093
2146
  }),
2094
2147
  className: "m-0",
2095
2148
  children: "Retry"
2096
2149
  }
2097
2150
  )
2098
- ] }) : /* @__PURE__ */ s(Ot, { disabled: !0, className: "m-0 cursor-default", children: [
2151
+ ] }) : /* @__PURE__ */ s($t, { disabled: !0, className: "m-0 cursor-default", children: [
2099
2152
  /* @__PURE__ */ e(Re, { className: "mr-2 h-4 w-4 animate-spin" }),
2100
2153
  "Saving..."
2101
2154
  ] }) })
@@ -2103,15 +2156,15 @@ function fo() {
2103
2156
  }
2104
2157
  ),
2105
2158
  /* @__PURE__ */ e(
2106
- Ga,
2159
+ on,
2107
2160
  {
2108
- open: wr,
2161
+ open: Cr,
2109
2162
  onOpenChange: (d) => {
2110
- me(d);
2163
+ ue(d);
2111
2164
  },
2112
- onSave: Er,
2113
- onDiscard: Ar,
2114
- isSaving: Be,
2165
+ onSave: Lr,
2166
+ onDiscard: Pr,
2167
+ isSaving: Ve,
2115
2168
  saveLabel: "Save",
2116
2169
  discardLabel: "Discard changes"
2117
2170
  }
@@ -2121,7 +2174,7 @@ function fo() {
2121
2174
  }
2122
2175
  );
2123
2176
  }
2124
- function qn({
2177
+ function oo({
2125
2178
  accessToken: t,
2126
2179
  dashboardId: n,
2127
2180
  selectedSheetId: a,
@@ -2131,11 +2184,11 @@ function qn({
2131
2184
  }) {
2132
2185
  if (!t || !a)
2133
2186
  return null;
2134
- const m = new URL("http://localhost:5173/print-document");
2135
- m.searchParams.set("token", t), n && m.searchParams.set("dashboardId", n), m.searchParams.set("selectedSheetId", a), l && m.searchParams.set("theme", l);
2136
- const u = new URL("http://127.0.0.1:3002/");
2137
- return u.searchParams.set("pdfMode", "document"), u.searchParams.set("pageSize", r || "letter"), u.searchParams.set("orientation", o || "portrait"), u.searchParams.set("url", m.toString()), u.toString();
2187
+ const u = new URL("http://localhost:5173/print-document");
2188
+ u.searchParams.set("token", t), n && u.searchParams.set("dashboardId", n), u.searchParams.set("selectedSheetId", a), l && u.searchParams.set("theme", l);
2189
+ const m = new URL("http://127.0.0.1:3002/");
2190
+ return m.searchParams.set("pdfMode", "document"), m.searchParams.set("pageSize", r || "letter"), m.searchParams.set("orientation", o || "portrait"), m.searchParams.set("url", u.toString()), m.toString();
2138
2191
  }
2139
2192
  export {
2140
- fo as default
2193
+ Ao as default
2141
2194
  };