react-semaphor 0.1.466 → 0.1.468

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +152 -282
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.js +4 -4
  6. package/dist/chunks/{analyze-result-contract-CMZDRRwo.js → analyze-result-contract-kaCNxjA7.js} +1 -1
  7. package/dist/chunks/{common-types-Co766x6t.js → common-types-BgI-ymBp.js} +30 -23
  8. package/dist/chunks/common-types-tRK8fhXV.cjs +1 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DbLc4VV9.cjs → dashboard-briefing-launcher-Bo4GmnB7.cjs} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-C_Iy9yvg.js → dashboard-briefing-launcher-DjBmkS6v.js} +9 -9
  11. package/dist/chunks/{dashboard-controls-Rotbld-z.cjs → dashboard-controls-CstKugeB.cjs} +1 -1
  12. package/dist/chunks/{dashboard-controls-C25Pk_CY.js → dashboard-controls-CvrCyVPZ.js} +9 -9
  13. package/dist/chunks/{dashboard-filter-value-compatibility-B8ynE_O1.js → dashboard-filter-value-compatibility-o-kufPZB.js} +7 -7
  14. package/dist/chunks/{dashboard-input-contract-Px64VWBL.js → dashboard-input-contract-Ciboc347.js} +6 -6
  15. package/dist/chunks/{dashboard-json-DjMbADzW.js → dashboard-json-D9r_xere.js} +7 -7
  16. package/dist/chunks/{dashboard-json-LeJ0JD4L.cjs → dashboard-json-ZGqzmExU.cjs} +1 -1
  17. package/dist/chunks/{edit-dashboard-visual-ryv-jOUA.cjs → edit-dashboard-visual-BzVDWVyZ.cjs} +11 -11
  18. package/dist/chunks/{edit-dashboard-visual-BDNcPoBS.js → edit-dashboard-visual-D64tmqA4.js} +1720 -1720
  19. package/dist/chunks/{editor-action-buttons-lBwd5Stw.cjs → editor-action-buttons-BXJlZl7z.cjs} +1 -1
  20. package/dist/chunks/{editor-action-buttons-CFDC0po3.js → editor-action-buttons-C2msc_en.js} +6 -6
  21. package/dist/chunks/{index-Bs9OvwM2.js → index-B6cfDHwn.js} +28534 -28321
  22. package/dist/chunks/{index-BlCnNcaB.js → index-DO4BESNy.js} +9 -9
  23. package/dist/chunks/{index-UKhl24L_.cjs → index-DZdmd5AL.cjs} +223 -223
  24. package/dist/chunks/matrix-result-contract-C3cGHj_y.js +598 -0
  25. package/dist/chunks/matrix-result-contract-CkRVx693.cjs +1 -0
  26. package/dist/chunks/{pivot-header-presentation-CSf6CyOt.js → pivot-header-presentation-OpY8xzdT.js} +2 -2
  27. package/dist/chunks/{pivot-result-identity-BvT51Nog.js → pivot-result-identity-CCMpd8ZA.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle--NNNPUtG.js → pivot-result-lifecycle-B38AZx4a.js} +19 -19
  29. package/dist/chunks/{raw-temporal-contract-BqVMduCs.js → raw-temporal-contract-r_EMdR85.js} +1 -1
  30. package/dist/chunks/{report-preferences-dialog-DzUi-b9O.cjs → report-preferences-dialog-B89ypIJ-.cjs} +1 -1
  31. package/dist/chunks/{report-preferences-dialog-JCUuGAtd.js → report-preferences-dialog-Dvy818KV.js} +6 -6
  32. package/dist/chunks/{report-runtime-context-CrTzKt0C.js → report-runtime-context-CcXUjpb-.js} +7 -7
  33. package/dist/chunks/{saved-temporal-bucket-format-DfqnCGCz.js → saved-temporal-bucket-format-hylaofsQ.js} +29 -29
  34. package/dist/chunks/{switch-B6rFVSdw.js → switch-8PklEEN1.js} +9 -9
  35. package/dist/chunks/{switch-BghC7eOM.cjs → switch-DykyqM66.cjs} +1 -1
  36. package/dist/chunks/{temporal-bucket-DFYIkexB.js → temporal-bucket-Cc9fmx8s.js} +12 -12
  37. package/dist/chunks/{temporal-bucket-authoring-ZxFzhTmL.js → temporal-bucket-authoring-DjPFtRSF.js} +3 -3
  38. package/dist/chunks/{temporal-bucket-contract-COPPwwbi.js → temporal-bucket-contract-DT4kU0VY.js} +1 -1
  39. package/dist/chunks/{token-types-p1M3SA2G.js → token-types-Z889rD6g.js} +1 -1
  40. package/dist/chunks/{update-policy-BKOA5S76.js → update-policy-Bu5Tw43R.js} +1 -1
  41. package/dist/chunks/{validators-CCpBY1e0.js → validators-DhTaCK1O.js} +50 -50
  42. package/dist/dashboard/index.cjs +1 -1
  43. package/dist/dashboard/index.js +2 -2
  44. package/dist/dashboard-authoring/index.js +4 -4
  45. package/dist/data-app-builder/index.cjs +1 -1
  46. package/dist/data-app-builder/index.js +2 -2
  47. package/dist/data-app-codegen/index.js +2 -2
  48. package/dist/data-app-codegen-node/index.js +3 -3
  49. package/dist/data-app-sdk/index.js +3 -3
  50. package/dist/data-app-sdk-adapters/index.js +2 -2
  51. package/dist/data-app-sdk-validation/index.js +9 -9
  52. package/dist/format-utils/index.js +10 -10
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.js +117 -115
  55. package/dist/report-runtime-context/index.js +2 -2
  56. package/dist/surfboard/index.cjs +1 -1
  57. package/dist/surfboard/index.js +3 -3
  58. package/dist/types/analytics-protocol.d.ts +18 -0
  59. package/dist/types/index.cjs +1 -1
  60. package/dist/types/index.js +18 -16
  61. package/dist/types/main.d.ts +9 -0
  62. package/dist/types/types.d.ts +9 -0
  63. package/package.json +1 -1
  64. package/dist/chunks/common-types-o3LJcrpg.cjs +0 -1
  65. package/dist/chunks/matrix-result-contract-DQ9_UadF.js +0 -421
  66. package/dist/chunks/matrix-result-contract-DiHDIyQk.cjs +0 -1
@@ -1,15 +1,15 @@
1
1
  var ee = Object.defineProperty;
2
2
  var te = (e, t, r) => t in e ? ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var g = (e, t, r) => te(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { b as k, an as G, r as re } from "./validators-CCpBY1e0.js";
5
- import { p as ae } from "./raw-temporal-contract-BqVMduCs.js";
4
+ import { b as k, an as G, q as re } from "./validators-DhTaCK1O.js";
5
+ import { p as ae } from "./raw-temporal-contract-r_EMdR85.js";
6
6
  import { canonicalizeSupportedLocale as E, canonicalizeSupportedCurrencyCode as $ } from "../value-format-preferences/index.js";
7
- import { l as h, j as ne, a as ie } from "./temporal-bucket-DFYIkexB.js";
7
+ import { l as h, j as ne, a as ie } from "./temporal-bucket-Cc9fmx8s.js";
8
8
  import { f as oe } from "./index-CACdoqu3.js";
9
- import { b as se } from "./report-runtime-context-CrTzKt0C.js";
10
- import "./analyze-result-contract-CMZDRRwo.js";
11
- import { a as ce } from "./temporal-bucket-contract-COPPwwbi.js";
12
- import { d as me, P as le } from "./pivot-result-identity-BvT51Nog.js";
9
+ import { b as se } from "./report-runtime-context-CcXUjpb-.js";
10
+ import "./analyze-result-contract-kaCNxjA7.js";
11
+ import { a as ce } from "./temporal-bucket-contract-DT4kU0VY.js";
12
+ import { d as me, P as le } from "./pivot-result-identity-CCMpd8ZA.js";
13
13
  function N(e) {
14
14
  if (!e) return !1;
15
15
  const t = e.toLowerCase().replace("_", "-");
@@ -1094,7 +1094,7 @@ function K(e, t) {
1094
1094
  const r = I(e), a = I(t);
1095
1095
  return r.length === a.length && r.every((n, i) => n === a[i]);
1096
1096
  }
1097
- function Le(e) {
1097
+ function qe(e) {
1098
1098
  if (!Array.isArray(e))
1099
1099
  throw new Error("resolvedFormats must be an array");
1100
1100
  const t = /* @__PURE__ */ new Set();
@@ -1159,7 +1159,7 @@ function Le(e) {
1159
1159
  return t.add(s), o;
1160
1160
  });
1161
1161
  }
1162
- function qe(e) {
1162
+ function Le(e) {
1163
1163
  try {
1164
1164
  if (!h(e))
1165
1165
  throw new Error("presentation execution snapshot must be an object");
@@ -1179,7 +1179,7 @@ function qe(e) {
1179
1179
  return {
1180
1180
  version: 1,
1181
1181
  reportContext: t.value,
1182
- resolvedFormats: Le(e.resolvedFormats)
1182
+ resolvedFormats: qe(e.resolvedFormats)
1183
1183
  };
1184
1184
  } catch (t) {
1185
1185
  throw t instanceof j ? t : new j(
@@ -1188,7 +1188,7 @@ function qe(e) {
1188
1188
  }
1189
1189
  }
1190
1190
  function vt(e) {
1191
- return qe({
1191
+ return Le({
1192
1192
  version: 1,
1193
1193
  reportContext: e.reportContext,
1194
1194
  resolvedFormats: [...e.resolvedFormats]
@@ -1364,7 +1364,7 @@ function Be(e) {
1364
1364
  }
1365
1365
  return e;
1366
1366
  }
1367
- function L(e, t) {
1367
+ function q(e, t) {
1368
1368
  if (!Array.isArray(e) || e.some((r) => typeof r != "string" || !r) || new Set(e).size !== e.length)
1369
1369
  throw new u(
1370
1370
  `Canonical pivot contract ${t} must be an array of unique field identities.`
@@ -1389,12 +1389,12 @@ function Ue(e, t) {
1389
1389
  "detail"
1390
1390
  ].map((f) => [
1391
1391
  f,
1392
- L(
1392
+ q(
1393
1393
  a[f],
1394
1394
  `expectedRoleFieldIds.${f}`
1395
1395
  )
1396
1396
  ])
1397
- ), o = L(
1397
+ ), o = q(
1398
1398
  r.expectedMetricAliases,
1399
1399
  "expectedMetricAliases"
1400
1400
  ), s = r.columnKinds;
@@ -1432,7 +1432,7 @@ function Ue(e, t) {
1432
1432
  columnClassifications: y
1433
1433
  };
1434
1434
  }
1435
- function q(e, t) {
1435
+ function L(e, t) {
1436
1436
  const r = [
1437
1437
  "groupby",
1438
1438
  "metric",
@@ -1516,7 +1516,7 @@ function Xe(e) {
1516
1516
  );
1517
1517
  V(a, r);
1518
1518
  const s = O(e.columnKeyMap);
1519
- return q(s, a), {
1519
+ return L(s, a), {
1520
1520
  pivotResultState: "loaded_empty",
1521
1521
  records: [],
1522
1522
  columns: r,
@@ -1533,7 +1533,7 @@ function Xe(e) {
1533
1533
  "A loaded_valid pivot result must carry at least one record."
1534
1534
  );
1535
1535
  const i = O(e.columnKeyMap);
1536
- q(i, a), Ye(i, r, a), V(a, r);
1536
+ L(i, a), Ye(i, r, a), V(a, r);
1537
1537
  const o = r.filter(
1538
1538
  (s) => a.columnKinds[s.key] === "pivot_metric"
1539
1539
  );
@@ -1625,8 +1625,8 @@ export {
1625
1625
  he as i,
1626
1626
  lt as j,
1627
1627
  Ne as k,
1628
- Le as l,
1629
- qe as m,
1628
+ qe as l,
1629
+ Le as m,
1630
1630
  vt as n,
1631
1631
  pt as o,
1632
1632
  ye as p,
@@ -1,7 +1,7 @@
1
1
  var d = Object.defineProperty;
2
2
  var i = (a, e, t) => e in a ? d(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var n = (a, e, t) => i(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { R as l } from "./validators-CCpBY1e0.js";
4
+ import { R as l } from "./validators-DhTaCK1O.js";
5
5
  class r extends Error {
6
6
  constructor(t) {
7
7
  super(t);
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),o=require("react"),l=require("./index-UKhl24L_.cjs"),u=require("./switch-BghC7eOM.cjs"),V=require("./report-runtime-context-CLtzrZdC.cjs");require("./x-B6ghREd2.cjs");require("./saved-temporal-bucket-format-Ca4hUfTo.cjs");require("./validators-DO-YuzgO.cjs");require("./analyze-result-contract-CMwVg9w2.cjs");const L=require("../value-format-preferences/index.cjs");function G(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(p=>p.actions.applyResolvedCalendarPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,[g,S]=o.useState(!1),[b,C]=o.useState(!1),[f,j]=o.useState(!1),[T,x]=o.useState(null),[w,P]=o.useState(null),v=o.useRef(i);v.current=i,o.useEffect(()=>{P(null),x(null),S(!1),C(!1),j(!1)},[i]);const N=o.useCallback(async p=>{const r=V.parseCalendarPreferencesResponse(await p.json());if(!r.ok)throw new Error("Calendar preferences response is invalid");return r.value},[]),k=o.useCallback(async()=>{if(!s||!i||!h)return;const p=i;S(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to fetch preferences")}const n=await N(r);v.current===p&&P(n)}catch(r){v.current===p&&x(r instanceof Error?r.message:"Unknown error")}finally{v.current===p&&S(!1)}},[i,h,s,N]);o.useEffect(()=>{s&&k()},[s,k]);const E=o.useCallback(async p=>{if(!i||!h)return x("Not authenticated"),!1;const r=i;C(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(p)});if(!n.ok){const D=await n.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}const y=await N(n);return v.current!==r?!1:(P(y),m(y.resolved,y.sources),!0)}catch(n){return v.current===r&&x(n instanceof Error?n.message:"Unknown error"),!1}finally{v.current===r&&C(!1)}},[i,h,m,N]),A=o.useCallback(async()=>{if(!i||!h)return x("Not authenticated"),!1;const p=i;j(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to clear preferences")}const n=await N(r);return v.current!==p?!1:(P(n),m(n.resolved,n.sources),!0)}catch(r){return v.current===p&&x(r instanceof Error?r.message:"Unknown error"),!1}finally{v.current===p&&j(!1)}},[i,h,m,N]);return{preferences:w,isLoading:g,isSaving:b,isClearing:f,error:T,updatePreferences:E,clearPreferences:A,refetch:k}}const F=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],B=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],R="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const a=Intl;if(a.supportedValuesOf)return a.supportedValuesOf("timeZone")}catch{}return F.map(a=>a.value)}function H(a){if(!a)return"default";if(a.tz!==a.weekStart)return"inherited";switch(a.tz){case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"system_default":return"system";case"session_initial":return"embedded";default:return"default"}}function U(a){const c=F.find(t=>t.value===a);return c?c.label:a}function K(a){const c=B.find(t=>t.value===a);return c?c.label:String(a)}function J({active:a,onClose:c}){const{preferences:t,isLoading:m,isSaving:s,isClearing:i,updatePreferences:h,clearPreferences:g}=G({enabled:a}),S=l.useCalendarContext(),b=(t==null?void 0:t.resolved.tz)||(S==null?void 0:S.tz)||"UTC",C=(t==null?void 0:t.resolved.weekStart)??(S==null?void 0:S.weekStart)??1,[f,j]=o.useState((t==null?void 0:t.stored)===null),[T,x]=o.useState(!1),[w,P]=o.useState(b),[v,N]=o.useState(C),[k,E]=o.useState(!1),A=o.useMemo(()=>W(),[]),p=o.useMemo(()=>A.filter(d=>!F.some(M=>M.value===d)),[A]),r=o.useMemo(()=>U(w),[w]),n=t!=null&&t.inherited?U(t.inherited.tz):"UTC",y=t!=null&&t.inherited?K(t.inherited.weekStart):"Monday",D=H(t==null?void 0:t.inheritedSources);o.useEffect(()=>{if(!a){x(!1);return}T||(t&&j(t.stored===null),P(b),N(C))},[a,T,t,b,C]);const O=async()=>{if(m){l.ue.error("Preferences are still loading. Please try again.");return}f?await g()?(l.ue.success("Now using default settings."),c()):l.ue.error("Failed to save preferences. Please try again."):await h({tz:w,weekStart:v})?(l.ue.success("Preferences saved."),c()):l.ue.error("Failed to save preferences. Please try again.")},_=()=>{c()},z=s||i,$=z||m;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(l.RadioGroup,{value:f?"defaults":"custom",onValueChange:d=>{x(!0),j(d==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",f&&"bg-muted/50"),onClick:()=>{x(!0),j(!0)},children:[e.jsx(l.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",D," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[n,", week starts ",y]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!f&&"bg-muted/50"),onClick:()=>{x(!0),j(!1)},children:[e.jsx(l.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:u.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",f&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Timezone"}),e.jsxs(u.Popover,{open:k,onOpenChange:E,modal:!0,children:[e.jsx(u.PopoverTrigger,{asChild:!0,children:e.jsxs(u.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":k,className:"w-full justify-between text-[12px] font-normal",disabled:f,children:[e.jsx("span",{className:"truncate",children:r}),e.jsx(l.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(u.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(l.Command,{className:"overflow-visible",children:[e.jsx(l.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(l.CommandList,{children:[e.jsx(l.CommandEmpty,{children:"No timezone found."}),e.jsx(l.CommandGroup,{heading:"Common",children:F.map(d=>e.jsxs(l.CommandItem,{value:`${d.value} ${d.label}`,onSelect:()=>{x(!0),P(d.value),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:d.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:d.value})]},d.value))}),e.jsx(l.CommandSeparator,{}),e.jsx(l.CommandGroup,{heading:"All timezones",children:p.map(d=>e.jsxs(l.CommandItem,{value:d,onSelect:()=>{x(!0),P(d),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d?"opacity-100":"opacity-0")}),d]},d))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Week starts on"}),e.jsx(l.RadioGroup,{value:String(v),onValueChange:d=>{x(!0),N(Number(d))},className:"flex gap-4",disabled:f,children:B.map(d=>e.jsxs("label",{htmlFor:`week-start-${d.value}`,className:u.cn("flex cursor-pointer items-center gap-2 text-[13px]",f&&"cursor-not-allowed"),children:[e.jsx(l.RadioGroupItem,{value:String(d.value),id:`week-start-${d.value}`,disabled:f}),d.label]},d.value))})]})]})]}),e.jsxs(l.DialogFooter,{children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:_,disabled:z,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:O,disabled:$,children:z?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})}function Y(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(r=>r.actions.applyResolvedValueFormatPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,g=o.useRef(i);g.current=i;const[S,b]=o.useState(null),[C,f]=o.useState(!1),[j,T]=o.useState(!1),[x,w]=o.useState(!1),[P,v]=o.useState(null);o.useEffect(()=>{b(null),v(null),f(!1),T(!1),w(!1)},[i]);const N=o.useCallback(async r=>{const n=L.parseValueFormatPreferencesResponse(await r.json());if(!n.ok)throw new Error("Value format preferences response is invalid");return n.value},[]),k=o.useCallback(async(r,n)=>{if(!i||!h)throw new Error("Not authenticated");const y=await fetch(`${h}/v1/user-preferences/value-format`,{method:r,headers:{Authorization:`Bearer ${i}`,...n?{"Content-Type":"application/json"}:{}},body:n?JSON.stringify(n):void 0});if(!y.ok){const D=await y.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}return N(y)},[i,h,N]),E=o.useCallback(async()=>{if(!s||!i||!h)return;const r=i;f(!0),v(null);try{const n=await k("GET");g.current===r&&b(n)}catch(n){g.current===r&&v(n instanceof Error?n.message:"Unknown error")}finally{g.current===r&&f(!1)}},[i,h,s,k]);o.useEffect(()=>{s&&E()},[s,E]);const A=o.useCallback(async r=>{const n=i;T(!0),v(null);try{const y=await k("PATCH",r);return g.current!==n?!1:(b(y),m(y.resolved,y.sources),!0)}catch(y){return g.current===n&&v(y instanceof Error?y.message:"Unknown error"),!1}finally{g.current===n&&T(!1)}},[i,m,k]),p=o.useCallback(async()=>{const r=i;w(!0),v(null);try{const n=await k("DELETE");return g.current!==r?!1:(b(n),m(n.resolved,n.sources),!0)}catch(n){return g.current===r&&v(n instanceof Error?n.message:"Unknown error"),!1}finally{g.current===r&&w(!1)}},[i,m,k]);return{preferences:S,isLoading:C,isSaving:j,isClearing:x,error:P,updatePreferences:A,clearPreferences:p,refetch:E}}const I=["locale","dateStyle","dateTime.dateStyle","dateTime.timeStyle","defaultCurrency"];function q(a,c){var t,m;switch(c){case"locale":return a==null?void 0:a.locale;case"dateStyle":return a==null?void 0:a.dateStyle;case"dateTime.dateStyle":return(t=a==null?void 0:a.dateTime)==null?void 0:t.dateStyle;case"dateTime.timeStyle":return(m=a==null?void 0:a.dateTime)==null?void 0:m.timeStyle;case"defaultCurrency":return a==null?void 0:a.defaultCurrency}}function Z(a){var m,s;const c=(m=a==null?void 0:a.dateTime)==null?void 0:m.dateStyle,t=(s=a==null?void 0:a.dateTime)==null?void 0:s.timeStyle;return{locale:a==null?void 0:a.locale,dateStyle:a==null?void 0:a.dateStyle,dateTime:c===void 0&&t===void 0?void 0:{dateStyle:c,timeStyle:t},defaultCurrency:a==null?void 0:a.defaultCurrency}}function Q({active:a,onClose:c}){var g,S,b,C,f,j,T;const{preferences:t,isLoading:m,isSaving:s,updatePreferences:i}=Y({enabled:a});if(!a)return null;if(!t)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx("div",{className:"flex min-h-36 items-center justify-center text-[12px] text-muted-foreground",children:m?"Loading preferences…":"Preferences unavailable."})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",disabled:!0,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",disabled:!0,children:"Save"})]})]})]});const h=[((g=t.stored)==null?void 0:g.locale)??"",((S=t.stored)==null?void 0:S.dateStyle)??"",((C=(b=t.stored)==null?void 0:b.dateTime)==null?void 0:C.dateStyle)??"",((j=(f=t.stored)==null?void 0:f.dateTime)==null?void 0:j.timeStyle)??"",((T=t.stored)==null?void 0:T.defaultCurrency)??""].join(":");return e.jsx(X,{preferences:t,isSaving:s,updatePreferences:i,onClose:c},h)}function X({preferences:a,isSaving:c,updatePreferences:t,onClose:m}){var b,C;const[s,i]=o.useState(()=>Z(a.stored)),h=(s.locale===void 0||L.canonicalizeSupportedLocale(s.locale)!==void 0)&&(s.defaultCurrency===void 0||L.canonicalizeSupportedCurrencyCode(s.defaultCurrency)!==void 0)&&(s.dateStyle===void 0||["short","medium","long"].includes(s.dateStyle))&&(((b=s.dateTime)==null?void 0:b.dateStyle)===void 0||["short","medium","long"].includes(s.dateTime.dateStyle))&&(((C=s.dateTime)==null?void 0:C.timeStyle)===void 0||["short","medium","long"].includes(s.dateTime.timeStyle)),g=async()=>{const f={...s.locale!==void 0?{locale:s.locale}:{},...s.dateStyle!==void 0?{dateStyle:s.dateStyle}:{},...s.dateTime?{dateTime:{...s.dateTime}}:{},...s.defaultCurrency!==void 0?{defaultCurrency:s.defaultCurrency}:{}},j=I.filter(w=>q(s,w)===void 0&&q(a.stored,w)!==void 0),T={...Object.keys(f).length>0?{set:f}:{},...j.length>0?{clear:j}:{}};(Object.keys(T).length===0?!0:await t(T))?(l.ue.success("Display format preferences saved."),m()):l.ue.error("Failed to save preferences. Please try again.")},S=async()=>{await t({clear:[...I]})?(l.ue.success("Display format preferences reset."),m()):l.ue.error("Failed to reset display format preferences. Please try again.")};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx(l.DisplayFormatPreferencesFields,{value:s,inherited:a.inherited,inheritedSources:a.inheritedSources,onChange:i,disabled:c})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",onClick:S,disabled:c||a.stored===null,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:m,disabled:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:g,disabled:c||!h,children:c?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})]})}function ee({open:a,onOpenChange:c}){const[t,m]=o.useState("display"),s=()=>c(!1);return e.jsx(l.Dialog,{open:a,onOpenChange:c,children:e.jsxs(l.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(l.DialogHeader,{children:[e.jsx(l.DialogTitle,{className:"text-[15px]",children:"Report preferences"}),e.jsx(l.DialogDescription,{className:"text-[13px] leading-5",children:"Set how values and Calendar periods appear for you."})]}),e.jsxs(u.Tabs,{value:t,onValueChange:m,children:[e.jsxs(u.TabsList,{variant:"underline",className:"w-full justify-start",children:[e.jsx(u.TabsTrigger,{value:"display",children:"Display formats"}),e.jsx(u.TabsTrigger,{value:"calendar",children:"Calendar"})]}),e.jsx(u.TabsContent,{value:"display",children:e.jsx(Q,{active:a&&t==="display",onClose:s})}),e.jsx(u.TabsContent,{value:"calendar",children:e.jsx(J,{active:a&&t==="calendar",onClose:s})})]})]})})}exports.ReportPreferencesDialog=ee;
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("react"),l=require("./index-DZdmd5AL.cjs"),u=require("./switch-DykyqM66.cjs"),V=require("./report-runtime-context-CLtzrZdC.cjs");require("./x-B6ghREd2.cjs");require("./saved-temporal-bucket-format-Ca4hUfTo.cjs");require("./validators-DO-YuzgO.cjs");require("./analyze-result-contract-CMwVg9w2.cjs");const L=require("../value-format-preferences/index.cjs");function G(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(p=>p.actions.applyResolvedCalendarPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,[g,S]=o.useState(!1),[b,C]=o.useState(!1),[f,j]=o.useState(!1),[T,x]=o.useState(null),[w,P]=o.useState(null),v=o.useRef(i);v.current=i,o.useEffect(()=>{P(null),x(null),S(!1),C(!1),j(!1)},[i]);const N=o.useCallback(async p=>{const r=V.parseCalendarPreferencesResponse(await p.json());if(!r.ok)throw new Error("Calendar preferences response is invalid");return r.value},[]),k=o.useCallback(async()=>{if(!s||!i||!h)return;const p=i;S(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to fetch preferences")}const n=await N(r);v.current===p&&P(n)}catch(r){v.current===p&&x(r instanceof Error?r.message:"Unknown error")}finally{v.current===p&&S(!1)}},[i,h,s,N]);o.useEffect(()=>{s&&k()},[s,k]);const E=o.useCallback(async p=>{if(!i||!h)return x("Not authenticated"),!1;const r=i;C(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(p)});if(!n.ok){const D=await n.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}const y=await N(n);return v.current!==r?!1:(P(y),m(y.resolved,y.sources),!0)}catch(n){return v.current===r&&x(n instanceof Error?n.message:"Unknown error"),!1}finally{v.current===r&&C(!1)}},[i,h,m,N]),A=o.useCallback(async()=>{if(!i||!h)return x("Not authenticated"),!1;const p=i;j(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to clear preferences")}const n=await N(r);return v.current!==p?!1:(P(n),m(n.resolved,n.sources),!0)}catch(r){return v.current===p&&x(r instanceof Error?r.message:"Unknown error"),!1}finally{v.current===p&&j(!1)}},[i,h,m,N]);return{preferences:w,isLoading:g,isSaving:b,isClearing:f,error:T,updatePreferences:E,clearPreferences:A,refetch:k}}const F=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],B=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],R="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const a=Intl;if(a.supportedValuesOf)return a.supportedValuesOf("timeZone")}catch{}return F.map(a=>a.value)}function H(a){if(!a)return"default";if(a.tz!==a.weekStart)return"inherited";switch(a.tz){case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"system_default":return"system";case"session_initial":return"embedded";default:return"default"}}function U(a){const c=F.find(t=>t.value===a);return c?c.label:a}function K(a){const c=B.find(t=>t.value===a);return c?c.label:String(a)}function J({active:a,onClose:c}){const{preferences:t,isLoading:m,isSaving:s,isClearing:i,updatePreferences:h,clearPreferences:g}=G({enabled:a}),S=l.useCalendarContext(),b=(t==null?void 0:t.resolved.tz)||(S==null?void 0:S.tz)||"UTC",C=(t==null?void 0:t.resolved.weekStart)??(S==null?void 0:S.weekStart)??1,[f,j]=o.useState((t==null?void 0:t.stored)===null),[T,x]=o.useState(!1),[w,P]=o.useState(b),[v,N]=o.useState(C),[k,E]=o.useState(!1),A=o.useMemo(()=>W(),[]),p=o.useMemo(()=>A.filter(d=>!F.some(M=>M.value===d)),[A]),r=o.useMemo(()=>U(w),[w]),n=t!=null&&t.inherited?U(t.inherited.tz):"UTC",y=t!=null&&t.inherited?K(t.inherited.weekStart):"Monday",D=H(t==null?void 0:t.inheritedSources);o.useEffect(()=>{if(!a){x(!1);return}T||(t&&j(t.stored===null),P(b),N(C))},[a,T,t,b,C]);const O=async()=>{if(m){l.ue.error("Preferences are still loading. Please try again.");return}f?await g()?(l.ue.success("Now using default settings."),c()):l.ue.error("Failed to save preferences. Please try again."):await h({tz:w,weekStart:v})?(l.ue.success("Preferences saved."),c()):l.ue.error("Failed to save preferences. Please try again.")},_=()=>{c()},z=s||i,$=z||m;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(l.RadioGroup,{value:f?"defaults":"custom",onValueChange:d=>{x(!0),j(d==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",f&&"bg-muted/50"),onClick:()=>{x(!0),j(!0)},children:[e.jsx(l.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",D," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[n,", week starts ",y]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!f&&"bg-muted/50"),onClick:()=>{x(!0),j(!1)},children:[e.jsx(l.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:u.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",f&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Timezone"}),e.jsxs(u.Popover,{open:k,onOpenChange:E,modal:!0,children:[e.jsx(u.PopoverTrigger,{asChild:!0,children:e.jsxs(u.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":k,className:"w-full justify-between text-[12px] font-normal",disabled:f,children:[e.jsx("span",{className:"truncate",children:r}),e.jsx(l.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(u.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(l.Command,{className:"overflow-visible",children:[e.jsx(l.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(l.CommandList,{children:[e.jsx(l.CommandEmpty,{children:"No timezone found."}),e.jsx(l.CommandGroup,{heading:"Common",children:F.map(d=>e.jsxs(l.CommandItem,{value:`${d.value} ${d.label}`,onSelect:()=>{x(!0),P(d.value),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:d.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:d.value})]},d.value))}),e.jsx(l.CommandSeparator,{}),e.jsx(l.CommandGroup,{heading:"All timezones",children:p.map(d=>e.jsxs(l.CommandItem,{value:d,onSelect:()=>{x(!0),P(d),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d?"opacity-100":"opacity-0")}),d]},d))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Week starts on"}),e.jsx(l.RadioGroup,{value:String(v),onValueChange:d=>{x(!0),N(Number(d))},className:"flex gap-4",disabled:f,children:B.map(d=>e.jsxs("label",{htmlFor:`week-start-${d.value}`,className:u.cn("flex cursor-pointer items-center gap-2 text-[13px]",f&&"cursor-not-allowed"),children:[e.jsx(l.RadioGroupItem,{value:String(d.value),id:`week-start-${d.value}`,disabled:f}),d.label]},d.value))})]})]})]}),e.jsxs(l.DialogFooter,{children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:_,disabled:z,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:O,disabled:$,children:z?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})}function Y(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(r=>r.actions.applyResolvedValueFormatPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,g=o.useRef(i);g.current=i;const[S,b]=o.useState(null),[C,f]=o.useState(!1),[j,T]=o.useState(!1),[x,w]=o.useState(!1),[P,v]=o.useState(null);o.useEffect(()=>{b(null),v(null),f(!1),T(!1),w(!1)},[i]);const N=o.useCallback(async r=>{const n=L.parseValueFormatPreferencesResponse(await r.json());if(!n.ok)throw new Error("Value format preferences response is invalid");return n.value},[]),k=o.useCallback(async(r,n)=>{if(!i||!h)throw new Error("Not authenticated");const y=await fetch(`${h}/v1/user-preferences/value-format`,{method:r,headers:{Authorization:`Bearer ${i}`,...n?{"Content-Type":"application/json"}:{}},body:n?JSON.stringify(n):void 0});if(!y.ok){const D=await y.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}return N(y)},[i,h,N]),E=o.useCallback(async()=>{if(!s||!i||!h)return;const r=i;f(!0),v(null);try{const n=await k("GET");g.current===r&&b(n)}catch(n){g.current===r&&v(n instanceof Error?n.message:"Unknown error")}finally{g.current===r&&f(!1)}},[i,h,s,k]);o.useEffect(()=>{s&&E()},[s,E]);const A=o.useCallback(async r=>{const n=i;T(!0),v(null);try{const y=await k("PATCH",r);return g.current!==n?!1:(b(y),m(y.resolved,y.sources),!0)}catch(y){return g.current===n&&v(y instanceof Error?y.message:"Unknown error"),!1}finally{g.current===n&&T(!1)}},[i,m,k]),p=o.useCallback(async()=>{const r=i;w(!0),v(null);try{const n=await k("DELETE");return g.current!==r?!1:(b(n),m(n.resolved,n.sources),!0)}catch(n){return g.current===r&&v(n instanceof Error?n.message:"Unknown error"),!1}finally{g.current===r&&w(!1)}},[i,m,k]);return{preferences:S,isLoading:C,isSaving:j,isClearing:x,error:P,updatePreferences:A,clearPreferences:p,refetch:E}}const I=["locale","dateStyle","dateTime.dateStyle","dateTime.timeStyle","defaultCurrency"];function q(a,c){var t,m;switch(c){case"locale":return a==null?void 0:a.locale;case"dateStyle":return a==null?void 0:a.dateStyle;case"dateTime.dateStyle":return(t=a==null?void 0:a.dateTime)==null?void 0:t.dateStyle;case"dateTime.timeStyle":return(m=a==null?void 0:a.dateTime)==null?void 0:m.timeStyle;case"defaultCurrency":return a==null?void 0:a.defaultCurrency}}function Z(a){var m,s;const c=(m=a==null?void 0:a.dateTime)==null?void 0:m.dateStyle,t=(s=a==null?void 0:a.dateTime)==null?void 0:s.timeStyle;return{locale:a==null?void 0:a.locale,dateStyle:a==null?void 0:a.dateStyle,dateTime:c===void 0&&t===void 0?void 0:{dateStyle:c,timeStyle:t},defaultCurrency:a==null?void 0:a.defaultCurrency}}function Q({active:a,onClose:c}){var g,S,b,C,f,j,T;const{preferences:t,isLoading:m,isSaving:s,updatePreferences:i}=Y({enabled:a});if(!a)return null;if(!t)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx("div",{className:"flex min-h-36 items-center justify-center text-[12px] text-muted-foreground",children:m?"Loading preferences…":"Preferences unavailable."})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",disabled:!0,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",disabled:!0,children:"Save"})]})]})]});const h=[((g=t.stored)==null?void 0:g.locale)??"",((S=t.stored)==null?void 0:S.dateStyle)??"",((C=(b=t.stored)==null?void 0:b.dateTime)==null?void 0:C.dateStyle)??"",((j=(f=t.stored)==null?void 0:f.dateTime)==null?void 0:j.timeStyle)??"",((T=t.stored)==null?void 0:T.defaultCurrency)??""].join(":");return e.jsx(X,{preferences:t,isSaving:s,updatePreferences:i,onClose:c},h)}function X({preferences:a,isSaving:c,updatePreferences:t,onClose:m}){var b,C;const[s,i]=o.useState(()=>Z(a.stored)),h=(s.locale===void 0||L.canonicalizeSupportedLocale(s.locale)!==void 0)&&(s.defaultCurrency===void 0||L.canonicalizeSupportedCurrencyCode(s.defaultCurrency)!==void 0)&&(s.dateStyle===void 0||["short","medium","long"].includes(s.dateStyle))&&(((b=s.dateTime)==null?void 0:b.dateStyle)===void 0||["short","medium","long"].includes(s.dateTime.dateStyle))&&(((C=s.dateTime)==null?void 0:C.timeStyle)===void 0||["short","medium","long"].includes(s.dateTime.timeStyle)),g=async()=>{const f={...s.locale!==void 0?{locale:s.locale}:{},...s.dateStyle!==void 0?{dateStyle:s.dateStyle}:{},...s.dateTime?{dateTime:{...s.dateTime}}:{},...s.defaultCurrency!==void 0?{defaultCurrency:s.defaultCurrency}:{}},j=I.filter(w=>q(s,w)===void 0&&q(a.stored,w)!==void 0),T={...Object.keys(f).length>0?{set:f}:{},...j.length>0?{clear:j}:{}};(Object.keys(T).length===0?!0:await t(T))?(l.ue.success("Display format preferences saved."),m()):l.ue.error("Failed to save preferences. Please try again.")},S=async()=>{await t({clear:[...I]})?(l.ue.success("Display format preferences reset."),m()):l.ue.error("Failed to reset display format preferences. Please try again.")};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx(l.DisplayFormatPreferencesFields,{value:s,inherited:a.inherited,inheritedSources:a.inheritedSources,onChange:i,disabled:c})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",onClick:S,disabled:c||a.stored===null,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:m,disabled:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:g,disabled:c||!h,children:c?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})]})}function ee({open:a,onOpenChange:c}){const[t,m]=o.useState("display"),s=()=>c(!1);return e.jsx(l.Dialog,{open:a,onOpenChange:c,children:e.jsxs(l.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(l.DialogHeader,{children:[e.jsx(l.DialogTitle,{className:"text-[15px]",children:"Report preferences"}),e.jsx(l.DialogDescription,{className:"text-[13px] leading-5",children:"Set how values and Calendar periods appear for you."})]}),e.jsxs(u.Tabs,{value:t,onValueChange:m,children:[e.jsxs(u.TabsList,{variant:"underline",className:"w-full justify-start",children:[e.jsx(u.TabsTrigger,{value:"display",children:"Display formats"}),e.jsx(u.TabsTrigger,{value:"calendar",children:"Calendar"})]}),e.jsx(u.TabsContent,{value:"display",children:e.jsx(Q,{active:a&&t==="display",onClose:s})}),e.jsx(u.TabsContent,{value:"calendar",children:e.jsx(J,{active:a&&t==="calendar",onClose:s})})]})]})})}exports.ReportPreferencesDialog=ee;
@@ -1,12 +1,12 @@
1
1
  import { jsxs as o, Fragment as j, jsx as t } from "react/jsx-runtime";
2
2
  import oe, { useState as S, useRef as X, useEffect as U, useCallback as E, useMemo as _ } from "react";
3
- import { az as ee, aA as ce, aB as B, aC as $, aD as de, h as ue, i as me, j as fe, k as he, l as M, m as H, aE as ve, aF as V, aG as z, b as ye, aH as pe, aI as ge, aJ as Se, aK as be, aL as Te } from "./index-Bs9OvwM2.js";
4
- import { u as ae, c as F, O as W, P as we, a as Ce, B as L, b as ke, d as q, L as te, T as xe, F as Ne, G, I as K } from "./switch-B6rFVSdw.js";
5
- import { a as Pe } from "./report-runtime-context-CrTzKt0C.js";
3
+ import { az as ee, aA as ce, aB as B, aC as $, aD as de, h as ue, i as me, j as fe, k as he, l as M, m as H, aE as ve, aF as V, aG as z, b as ye, aH as pe, aI as ge, aJ as Se, aK as be, aL as Te } from "./index-B6cfDHwn.js";
4
+ import { u as ae, c as F, O as W, P as we, a as Ce, B as L, b as ke, d as q, L as te, T as xe, F as Ne, G, I as K } from "./switch-8PklEEN1.js";
5
+ import { a as Pe } from "./report-runtime-context-CcXUjpb-.js";
6
6
  import "./x-CXDkqdur.js";
7
- import "./saved-temporal-bucket-format-DfqnCGCz.js";
8
- import "./validators-CCpBY1e0.js";
9
- import "./analyze-result-contract-CMZDRRwo.js";
7
+ import "./saved-temporal-bucket-format-hylaofsQ.js";
8
+ import "./validators-DhTaCK1O.js";
9
+ import "./analyze-result-contract-kaCNxjA7.js";
10
10
  import { parseValueFormatPreferencesResponse as Ae, canonicalizeSupportedLocale as Ee, canonicalizeSupportedCurrencyCode as ze } from "../value-format-preferences/index.js";
11
11
  function Le(e = {}) {
12
12
  const { authToken: i, tokenProps: a } = ee(), d = ae(
@@ -1,5 +1,5 @@
1
1
  import { parseValueFormatPreferences as _, isReportPreferenceSource as C } from "../value-format-preferences/index.js";
2
- import { b as k, h as g } from "./validators-CCpBY1e0.js";
2
+ import { b as k, g } from "./validators-DhTaCK1O.js";
3
3
  const M = {
4
4
  tz: "UTC",
5
5
  weekStart: 1,
@@ -170,7 +170,7 @@ function l(e, a, r) {
170
170
  }
171
171
  return e;
172
172
  }
173
- function v(e, a) {
173
+ function h(e, a) {
174
174
  if (!o(e))
175
175
  return {
176
176
  ok: !1,
@@ -205,10 +205,10 @@ function D(e) {
205
205
  e.inherited,
206
206
  "inherited",
207
207
  !1
208
- ), s = v(
208
+ ), s = h(
209
209
  e.inheritedSources,
210
210
  "inheritedSources"
211
- ), c = d(e.resolved, "resolved", !1), i = v(e.sources, "sources");
211
+ ), c = d(e.resolved, "resolved", !1), i = h(e.sources, "sources");
212
212
  for (const u of [r, t, s, c, i])
213
213
  u.ok || a.push(...u.issues);
214
214
  return a.length || !r.ok || !t.ok || !s.ok || !c.ok || !i.ok ? { ok: !1, issues: a } : {
@@ -293,12 +293,12 @@ function j(e) {
293
293
  s.timeStyle,
294
294
  "preferenceSources.valueFormat.dateTime.timeStyle",
295
295
  a
296
- ) : void 0, h = l(
296
+ ) : void 0, v = l(
297
297
  t.defaultCurrency,
298
298
  "preferenceSources.valueFormat.defaultCurrency",
299
299
  a
300
300
  );
301
- return a.length || !c || !i || !u || !f || !m || !S || !h ? { ok: !1, issues: a } : {
301
+ return a.length || !c || !i || !u || !f || !m || !S || !v ? { ok: !1, issues: a } : {
302
302
  ok: !0,
303
303
  value: {
304
304
  calendar: {
@@ -312,7 +312,7 @@ function j(e) {
312
312
  dateStyle: m,
313
313
  timeStyle: S
314
314
  },
315
- defaultCurrency: h
315
+ defaultCurrency: v
316
316
  }
317
317
  }
318
318
  };
@@ -1,8 +1,8 @@
1
1
  import { S as P, a as k } from "./color-CJvdlFM_.js";
2
- import { O as R, al as v, m as O, F as D } from "./validators-CCpBY1e0.js";
3
- import "./analyze-result-contract-CMZDRRwo.js";
2
+ import { N as R, al as v, l as O, E as D } from "./validators-DhTaCK1O.js";
3
+ import "./analyze-result-contract-kaCNxjA7.js";
4
4
  import "../value-format-preferences/index.js";
5
- import { A as g } from "./temporal-bucket-authoring-ZxFzhTmL.js";
5
+ import { A as g } from "./temporal-bucket-authoring-DjPFtRSF.js";
6
6
  var te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
7
7
  function U(e) {
8
8
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -33,11 +33,11 @@ function G() {
33
33
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
34
34
  return y(I);
35
35
  }
36
- const l = [];
36
+ const s = [];
37
37
  for (let e = 0; e < 256; ++e)
38
- l.push((e + 256).toString(16).slice(1));
38
+ s.push((e + 256).toString(16).slice(1));
39
39
  function L(e, r = 0) {
40
- return l[e[r + 0]] + l[e[r + 1]] + l[e[r + 2]] + l[e[r + 3]] + "-" + l[e[r + 4]] + l[e[r + 5]] + "-" + l[e[r + 6]] + l[e[r + 7]] + "-" + l[e[r + 8]] + l[e[r + 9]] + "-" + l[e[r + 10]] + l[e[r + 11]] + l[e[r + 12]] + l[e[r + 13]] + l[e[r + 14]] + l[e[r + 15]];
40
+ return s[e[r + 0]] + s[e[r + 1]] + s[e[r + 2]] + s[e[r + 3]] + "-" + s[e[r + 4]] + s[e[r + 5]] + "-" + s[e[r + 6]] + s[e[r + 7]] + "-" + s[e[r + 8]] + s[e[r + 9]] + "-" + s[e[r + 10]] + s[e[r + 11]] + s[e[r + 12]] + s[e[r + 13]] + s[e[r + 14]] + s[e[r + 15]];
41
41
  }
42
42
  const W = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), E = {
43
43
  randomUUID: W
@@ -54,7 +54,7 @@ var T = {}, B = {}, A = { exports: {} }, o = String, S = function() {
54
54
  };
55
55
  A.exports = S();
56
56
  A.exports.createColors = S;
57
- var j = A.exports;
57
+ var N = A.exports;
58
58
  (function(e) {
59
59
  Object.defineProperty(e, "__esModule", {
60
60
  value: !0
@@ -67,13 +67,13 @@ var j = A.exports;
67
67
  }
68
68
  r(e, {
69
69
  dim: function() {
70
- return s;
70
+ return l;
71
71
  },
72
72
  default: function() {
73
73
  return c;
74
74
  }
75
75
  });
76
- const a = /* @__PURE__ */ t(j);
76
+ const a = /* @__PURE__ */ t(N);
77
77
  function t(f) {
78
78
  return f && f.__esModule ? f : {
79
79
  default: f
@@ -83,7 +83,7 @@ var j = A.exports;
83
83
  function n(f, u, p) {
84
84
  typeof process < "u" && process.env.JEST_WORKER_ID || p && d.has(p) || (p && d.add(p), console.warn(""), u.forEach((b) => console.warn(f, "-", b)));
85
85
  }
86
- function s(f) {
86
+ function l(f) {
87
87
  return a.default.dim(f);
88
88
  }
89
89
  const c = {
@@ -128,9 +128,9 @@ var j = A.exports;
128
128
  default: n
129
129
  };
130
130
  }
131
- function t({ version: n, from: s, to: c }) {
132
- r.default.warn(`${s}-color-renamed`, [
133
- `As of Tailwind CSS ${n}, \`${s}\` has been renamed to \`${c}\`.`,
131
+ function t({ version: n, from: l, to: c }) {
132
+ r.default.warn(`${l}-color-renamed`, [
133
+ `As of Tailwind CSS ${n}, \`${l}\` has been renamed to \`${c}\`.`,
134
134
  "Update your configuration file to silence this warning."
135
135
  ]);
136
136
  }
@@ -464,10 +464,10 @@ var j = A.exports;
464
464
  };
465
465
  })(T);
466
466
  let _ = T;
467
- var q = (_.__esModule ? _ : { default: _ }).default;
468
- const i = /* @__PURE__ */ U(q), N = ".semaphor-scope";
467
+ var j = (_.__esModule ? _ : { default: _ }).default;
468
+ const i = /* @__PURE__ */ U(j), q = ".semaphor-scope";
469
469
  function V(e) {
470
- return e ? e.closest(N) : null;
470
+ return e ? e.closest(q) : null;
471
471
  }
472
472
  function Q(e) {
473
473
  if (!e) return "light";
@@ -478,7 +478,7 @@ const fe = !1, de = [
478
478
  "table",
479
479
  "view",
480
480
  "materialized view"
481
- ], ie = ["_forecast"], se = "dm", le = "semaphor_calculated_fields", ce = "calculated_fields", ue = ["lg", "md", "sm", "xs", "xxs"], pe = {
481
+ ], ie = ["_forecast"], le = "dm", se = "semaphor_calculated_fields", ce = "calculated_fields", ue = ["lg", "md", "sm", "xs", "xxs"], pe = {
482
482
  // dashboardHeader: ' font-mono border-b-2 border-red-700',
483
483
  default: {
484
484
  dashboardPanel: "",
@@ -714,8 +714,8 @@ const fe = !1, de = [
714
714
  }
715
715
  };
716
716
  function F(e) {
717
- var t, d, n, s, c, f, u, p, b;
718
- const r = (c = (s = (n = (d = (t = e == null ? void 0 : e.chart) == null ? void 0 : t.config) == null ? void 0 : d._config) == null ? void 0 : n.options) == null ? void 0 : s.plugins) == null ? void 0 : c.datalabels;
717
+ var t, d, n, l, c, f, u, p, b;
718
+ const r = (c = (l = (n = (d = (t = e == null ? void 0 : e.chart) == null ? void 0 : t.config) == null ? void 0 : d._config) == null ? void 0 : n.options) == null ? void 0 : l.plugins) == null ? void 0 : c.datalabels;
719
719
  let a = (f = e == null ? void 0 : e.dataset) == null ? void 0 : f.backgroundColor;
720
720
  return (r == null ? void 0 : r.align) === "end" && (r == null ? void 0 : r.anchor) === "end" && (a = C((u = e == null ? void 0 : e.chart) == null ? void 0 : u.canvas)), (r == null ? void 0 : r.align) === "start" && (r == null ? void 0 : r.anchor) === "start" && (a = C((p = e == null ? void 0 : e.chart) == null ? void 0 : p.canvas)), $(a, {
721
721
  baseColor: C((b = e == null ? void 0 : e.chart) == null ? void 0 : b.canvas)
@@ -738,11 +738,11 @@ function C(e) {
738
738
  }
739
739
  function $(e, r = {}) {
740
740
  let a = 0, t = 0, d = 0, n = 0;
741
- const s = r.baseColor ? k(r.baseColor) : null, c = (m) => {
741
+ const l = r.baseColor ? k(r.baseColor) : null, c = (m) => {
742
742
  if (!m) return i.gray[500];
743
743
  const w = k(m);
744
744
  if (!w) return i.gray[500];
745
- const h = M(w, s);
745
+ const h = M(w, l);
746
746
  a += h.r, t += h.g, d += h.b, n++;
747
747
  };
748
748
  if (Array.isArray(e) ? e.forEach((m) => {
@@ -772,10 +772,10 @@ function K(e) {
772
772
  return !!(r || a || t || d);
773
773
  }
774
774
  function ge(e, r) {
775
- var n, s, c;
775
+ var n, l, c;
776
776
  if (r != null && r.skipSetupCheck || e.type === "text" || (n = e.customCardPreferences) != null && n.url)
777
777
  return !1;
778
- const a = !!(e.connectionId || (s = e.dataSource) != null && s.connectionId), t = !!((c = e.sql) != null && c.trim()), d = K(e.config);
778
+ const a = !!(e.connectionId || (l = e.dataSource) != null && l.connectionId), t = !!((c = e.sql) != null && c.trim()), d = K(e.config);
779
779
  return !a || !d && !t;
780
780
  }
781
781
  function be(e) {
@@ -869,15 +869,15 @@ function me(e) {
869
869
  };
870
870
  let a, t, d;
871
871
  if (e.format !== void 0 && e.format !== null) {
872
- const s = R.safeParse(e.format);
873
- if (!s.success)
872
+ const l = R.safeParse(e.format);
873
+ if (!l.success)
874
874
  a = g, t = "unsupported_pattern";
875
875
  else {
876
876
  const c = v(
877
- s.data,
877
+ l.data,
878
878
  r.granularity
879
879
  );
880
- a = c.ok ? s.data : g, c.ok || (t = c.code === "invalid_temporal_bucket_pattern" ? "unsupported_pattern" : "grain_incompatible_pattern", d = s.data.presentation.mode === "pattern" ? s.data.presentation.pattern : s.data.presentation.mode === "preset" ? s.data.presentation.preset : void 0);
880
+ a = c.ok ? l.data : g, c.ok || (t = c.code === "invalid_temporal_bucket_pattern" ? "unsupported_pattern" : "grain_incompatible_pattern", d = l.data.presentation.mode === "pattern" ? l.data.presentation.pattern : l.data.presentation.mode === "preset" ? l.data.presentation.preset : void 0);
881
881
  }
882
882
  } else
883
883
  ({ format: a, repairCode: t, ignoredPattern: d } = J(
@@ -901,7 +901,7 @@ function me(e) {
901
901
  export {
902
902
  ue as B,
903
903
  ce as C,
904
- se as D,
904
+ le as D,
905
905
  ie as M,
906
906
  be as a,
907
907
  fe as b,
@@ -916,7 +916,7 @@ export {
916
916
  te as k,
917
917
  oe as l,
918
918
  F as m,
919
- le as n,
919
+ se as n,
920
920
  me as r,
921
921
  ne as v
922
922
  };
@@ -2,23 +2,23 @@ import { j as mp, c as je, C as Rl } from "./x-CXDkqdur.js";
2
2
  import { jsx as w, jsxs as be, Fragment as Yn } from "react/jsx-runtime";
3
3
  import * as p from "react";
4
4
  import Ce, { useLayoutEffect as gp, useState as yp, forwardRef as bp, useRef as qa, useMemo as vp, useId as Cp, useImperativeHandle as Sp } from "react";
5
- import { e as _l, v as st, D as _r, B as Wi, f as Ip, h as Pl, r as wp, j as Ha, k as De } from "./saved-temporal-bucket-format-DfqnCGCz.js";
6
- import { F as Ke, O as Ol, m as xp, ap as Ep, j as Pr, ah as Vn, C as Wa } from "./validators-CCpBY1e0.js";
7
- import "./analyze-result-contract-CMZDRRwo.js";
5
+ import { e as _l, v as st, D as _r, B as Wi, f as Ip, h as Pl, r as wp, j as Ha, k as De } from "./saved-temporal-bucket-format-hylaofsQ.js";
6
+ import { E as Ke, N as Ol, l as xp, ap as Ep, h as Pr, ah as Vn, B as Wa } from "./validators-DhTaCK1O.js";
7
+ import "./analyze-result-contract-kaCNxjA7.js";
8
8
  import "../value-format-preferences/index.js";
9
9
  import * as Xr from "react-dom";
10
10
  import Tp from "react-dom";
11
11
  import { u as Fp } from "./appearance-context-DVXt8qjW.js";
12
12
  import "react-dom/client";
13
- import { D as Dp } from "./temporal-bucket-DFYIkexB.js";
14
- import { b as Ap } from "./report-runtime-context-CrTzKt0C.js";
13
+ import { D as Dp } from "./temporal-bucket-Cc9fmx8s.js";
14
+ import { b as Ap } from "./report-runtime-context-CcXUjpb-.js";
15
15
  import { createFrameLayouts as Rp } from "../layouts/index.js";
16
16
  import { t as Gi, c as Or, h as _p, j as Pp, f as Qr, k as Op, i as Zr } from "./format-types-CFHQoIuk.js";
17
17
  import { f as Dt } from "./index-CACdoqu3.js";
18
- import { a as Mp } from "./temporal-bucket-authoring-ZxFzhTmL.js";
19
- import { o as Ml, l as kl, n as Nl, b as Jr, e as Vl, d as Yi, h as kp, r as Ga, g as Np, j as Vp } from "./dashboard-filter-value-compatibility-B8ynE_O1.js";
20
- import { a as Ya, C as Ll } from "./common-types-Co766x6t.js";
21
- import { s as Lp, e as Bp, i as $p, a as Up, q as Ki, r as ci, f as Bl, g as Kn } from "./dashboard-input-contract-Px64VWBL.js";
18
+ import { a as Mp } from "./temporal-bucket-authoring-DjPFtRSF.js";
19
+ import { o as Ml, l as kl, n as Nl, b as Jr, e as Vl, d as Yi, h as kp, r as Ga, g as Np, j as Vp } from "./dashboard-filter-value-compatibility-o-kufPZB.js";
20
+ import { a as Ya, C as Ll } from "./common-types-BgI-ymBp.js";
21
+ import { s as Lp, e as Bp, i as $p, a as Up, q as Ki, r as ci, f as Bl, g as Kn } from "./dashboard-input-contract-Ciboc347.js";
22
22
  const Ka = (e) => {
23
23
  let n;
24
24
  const t = /* @__PURE__ */ new Set(), r = (c, d) => {
@@ -1,4 +1,4 @@
1
- "use strict";const Re=require("./x-B6ghREd2.cjs"),I=require("react/jsx-runtime"),ae=require("react"),Y=require("./saved-temporal-bucket-format-Ca4hUfTo.cjs"),oe=require("./validators-DO-YuzgO.cjs");require("./analyze-result-contract-CMwVg9w2.cjs");require("../value-format-preferences/index.cjs");const Zl=require("react-dom"),Fm=require("./appearance-context-DhyjbQk1.cjs");require("react-dom/client");const Dm=require("./temporal-bucket-BDRcWdVv.cjs"),Am=require("./report-runtime-context-CLtzrZdC.cjs"),Rm=require("../layouts/index.cjs"),fe=require("./format-types-PSZZ7hG8.cjs"),Mt=require("./index-F25jnH0p.cjs"),_m=require("./temporal-bucket-authoring-C6sZAVqS.cjs"),ce=require("./dashboard-filter-value-compatibility-Bnl2lsng.cjs"),qr=require("./common-types-o3LJcrpg.cjs"),ge=require("./dashboard-input-contract-12mPNhCF.cjs");function Jl(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const p=Jl(ae),lo=Jl(Zl),Cs=e=>{let n;const t=new Set,r=(c,d)=>{const u=typeof c=="function"?c(n):c;if(!Object.is(u,n)){const f=n;n=d??(typeof u!="object"||u===null)?u:Object.assign({},n,u),t.forEach(h=>h(n,f))}},o=()=>n,s={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=n=e(r,o,s);return s},Pm=e=>e?Cs(e):Cs,Om=e=>e;function Mm(e,n=Om){const t=ae.useSyncExternalStore(e.subscribe,ae.useCallback(()=>n(e.getState()),[e,n]),ae.useCallback(()=>n(e.getInitialState()),[e,n]));return ae.useDebugValue(t),t}const Ss=e=>{const n=Pm(e),t=r=>Mm(n,r);return Object.assign(t,n),t},zt=e=>e?Ss(e):Ss;var ec=Symbol.for("immer-nothing"),Is=Symbol.for("immer-draftable"),Z=Symbol.for("immer-state"),km=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Ie(e,...n){if(process.env.NODE_ENV!=="production"){const t=km[e],r=typeof t=="function"?t.apply(null,n):t;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zn=Object.getPrototypeOf;function hn(e){return!!e&&!!e[Z]}function nt(e){var n;return e?tc(e)||Array.isArray(e)||!!e[Is]||!!((n=e.constructor)!=null&&n[Is])||nr(e)||uo(e):!1}var Nm=Object.prototype.constructor.toString(),xs=new WeakMap;function tc(e){if(!e||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);if(n===null||n===Object.prototype)return!0;const t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;if(t===Object)return!0;if(typeof t!="function")return!1;let r=xs.get(t);return r===void 0&&(r=Function.toString.call(t),xs.set(t,r)),r===Nm}function qn(e,n,t=!0){co(e)===0?(t?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{n(o,e[o],e)}):e.forEach((r,o)=>n(o,r,e))}function co(e){const n=e[Z];return n?n.type_:Array.isArray(e)?1:nr(e)?2:uo(e)?3:0}function Si(e,n){return co(e)===2?e.has(n):Object.prototype.hasOwnProperty.call(e,n)}function nc(e,n,t){const r=co(e);r===2?e.set(n,t):r===3?e.add(t):e[n]=t}function Vm(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}function nr(e){return e instanceof Map}function uo(e){return e instanceof Set}function ue(e){return e.copy_||e.base_}function Ii(e,n){if(nr(e))return new Map(e);if(uo(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const t=tc(e);if(n===!0||n==="class_only"&&!t){const r=Object.getOwnPropertyDescriptors(e);delete r[Z];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const a=o[i],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(zn(e),r)}else{const r=zn(e);if(r!==null&&t)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function na(e,n=!1){return fo(e)||hn(e)||!nt(e)||(co(e)>1&&Object.defineProperties(e,{set:Sr,add:Sr,clear:Sr,delete:Sr}),Object.freeze(e),n&&Object.values(e).forEach(t=>na(t,!0))),e}function Lm(){Ie(2)}var Sr={value:Lm};function fo(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var xi={};function kt(e){const n=xi[e];return n||Ie(0,e),n}function Bm(e,n){xi[e]||(xi[e]=n)}var Hn;function Hr(){return Hn}function $m(e,n){return{drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ws(e,n){n&&(kt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function wi(e){Ti(e),e.drafts_.forEach(jm),e.drafts_=null}function Ti(e){e===Hn&&(Hn=e.parent_)}function Ts(e){return Hn=$m(Hn,e)}function jm(e){const n=e[Z];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function Es(e,n){n.unfinalizedDrafts_=n.drafts_.length;const t=n.drafts_[0];return e!==void 0&&e!==t?(t[Z].modified_&&(wi(n),Ie(4)),nt(e)&&(e=Gr(n,e),n.parent_||Wr(n,e)),n.patches_&&kt("Patches").generateReplacementPatches_(t[Z].base_,e,n.patches_,n.inversePatches_)):e=Gr(n,t,[]),wi(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==ec?e:void 0}function Gr(e,n,t){if(fo(n))return n;const r=e.immer_.shouldUseStrictIteration(),o=n[Z];if(!o)return qn(n,(i,a)=>Fs(e,o,n,i,a,t),r),n;if(o.scope_!==e)return n;if(!o.modified_)return Wr(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const i=o.copy_;let a=i,s=!1;o.type_===3&&(a=new Set(i),i.clear(),s=!0),qn(a,(l,c)=>Fs(e,o,i,l,c,t,s),r),Wr(e,i,!1),t&&e.patches_&&kt("Patches").generatePatches_(o,t,e.patches_,e.inversePatches_)}return o.copy_}function Fs(e,n,t,r,o,i,a){if(o==null||typeof o!="object"&&!a)return;const s=fo(o);if(!(s&&!a)){if(process.env.NODE_ENV!=="production"&&o===t&&Ie(5),hn(o)){const l=i&&n&&n.type_!==3&&!Si(n.assigned_,r)?i.concat(r):void 0,c=Gr(e,o,l);if(nc(t,r,c),hn(c))e.canAutoFreeze_=!1;else return}else a&&t.add(o);if(nt(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||n&&n.base_&&n.base_[r]===o&&s)return;Gr(e,o),(!n||!n.scope_.parent_)&&typeof r!="symbol"&&(nr(t)?t.has(r):Object.prototype.propertyIsEnumerable.call(t,r))&&Wr(e,o)}}}function Wr(e,n,t=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&na(n,t)}function Um(e,n){const t=Array.isArray(e),r={type_:t?1:0,scope_:n?n.scope_:Hr(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ra;t&&(o=[r],i=Gn);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}var ra={get(e,n){if(n===Z)return e;const t=ue(e);if(!Si(t,n))return zm(e,t,n);const r=t[n];return e.finalized_||!nt(r)?r:r===Wo(e.base_,n)?(Yo(e),e.copy_[n]=Wn(r,e)):r},has(e,n){return n in ue(e)},ownKeys(e){return Reflect.ownKeys(ue(e))},set(e,n,t){const r=rc(ue(e),n);if(r!=null&&r.set)return r.set.call(e.draft_,t),!0;if(!e.modified_){const o=Wo(ue(e),n),i=o==null?void 0:o[Z];if(i&&i.base_===t)return e.copy_[n]=t,e.assigned_[n]=!1,!0;if(Vm(t,o)&&(t!==void 0||Si(e.base_,n)))return!0;Yo(e),et(e)}return e.copy_[n]===t&&(t!==void 0||n in e.copy_)||Number.isNaN(t)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=t,e.assigned_[n]=!0),!0},deleteProperty(e,n){return Wo(e.base_,n)!==void 0||n in e.base_?(e.assigned_[n]=!1,Yo(e),et(e)):delete e.assigned_[n],e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const t=ue(e),r=Reflect.getOwnPropertyDescriptor(t,n);return r&&{writable:!0,configurable:e.type_!==1||n!=="length",enumerable:r.enumerable,value:t[n]}},defineProperty(){Ie(11)},getPrototypeOf(e){return zn(e.base_)},setPrototypeOf(){Ie(12)}},Gn={};qn(ra,(e,n)=>{Gn[e]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}});Gn.deleteProperty=function(e,n){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(n))&&Ie(13),Gn.set.call(this,e,n,void 0)};Gn.set=function(e,n,t){return process.env.NODE_ENV!=="production"&&n!=="length"&&isNaN(parseInt(n))&&Ie(14),ra.set.call(this,e[0],n,t,e[0])};function Wo(e,n){const t=e[Z];return(t?ue(t):e)[n]}function zm(e,n,t){var o;const r=rc(n,t);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function rc(e,n){if(!(n in e))return;let t=zn(e);for(;t;){const r=Object.getOwnPropertyDescriptor(t,n);if(r)return r;t=zn(t)}}function et(e){e.modified_||(e.modified_=!0,e.parent_&&et(e.parent_))}function Yo(e){e.copy_||(e.copy_=Ii(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var qm=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(n,t,r)=>{if(typeof n=="function"&&typeof t!="function"){const i=t;t=n;const a=this;return function(l=i,...c){return a.produce(l,d=>t.call(this,d,...c))}}typeof t!="function"&&Ie(6),r!==void 0&&typeof r!="function"&&Ie(7);let o;if(nt(n)){const i=Ts(this),a=Wn(n,void 0);let s=!0;try{o=t(a),s=!1}finally{s?wi(i):Ti(i)}return ws(i,r),Es(o,i)}else if(!n||typeof n!="object"){if(o=t(n),o===void 0&&(o=n),o===ec&&(o=void 0),this.autoFreeze_&&na(o,!0),r){const i=[],a=[];kt("Patches").generateReplacementPatches_(n,o,i,a),r(i,a)}return o}else Ie(1,n)},this.produceWithPatches=(n,t)=>{if(typeof n=="function")return(a,...s)=>this.produceWithPatches(a,l=>n(l,...s));let r,o;return[this.produce(n,t,(a,s)=>{r=a,o=s}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){nt(e)||Ie(8),hn(e)&&(e=Hm(e));const n=Ts(this),t=Wn(e,void 0);return t[Z].isManual_=!0,Ti(n),t}finishDraft(e,n){const t=e&&e[Z];(!t||!t.isManual_)&&Ie(9);const{scope_:r}=t;return ws(r,n),Es(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,n){let t;for(t=n.length-1;t>=0;t--){const o=n[t];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}t>-1&&(n=n.slice(t+1));const r=kt("Patches").applyPatches_;return hn(e)?r(e,n):this.produce(e,o=>r(o,n))}};function Wn(e,n){const t=nr(e)?kt("MapSet").proxyMap_(e,n):uo(e)?kt("MapSet").proxySet_(e,n):Um(e,n);return(n?n.scope_:Hr()).drafts_.push(t),t}function Hm(e){return hn(e)||Ie(10,e),oc(e)}function oc(e){if(!nt(e)||fo(e))return e;const n=e[Z];let t,r=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,t=Ii(e,n.scope_.immer_.useStrictShallowCopy_),r=n.scope_.immer_.shouldUseStrictIteration()}else t=Ii(e,!0);return qn(t,(o,i)=>{nc(t,o,oc(i))},r),n&&(n.finalized_=!1),t}function Gm(){class e extends Map{constructor(l,c){super(),this[Z]={type_:2,parent_:c,scope_:c?c.scope_:Hr(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:l,draft_:this,isManual_:!1,revoked_:!1}}get size(){return ue(this[Z]).size}has(l){return ue(this[Z]).has(l)}set(l,c){const d=this[Z];return a(d),(!ue(d).has(l)||ue(d).get(l)!==c)&&(t(d),et(d),d.assigned_.set(l,!0),d.copy_.set(l,c),d.assigned_.set(l,!0)),this}delete(l){if(!this.has(l))return!1;const c=this[Z];return a(c),t(c),et(c),c.base_.has(l)?c.assigned_.set(l,!1):c.assigned_.delete(l),c.copy_.delete(l),!0}clear(){const l=this[Z];a(l),ue(l).size&&(t(l),et(l),l.assigned_=new Map,qn(l.base_,c=>{l.assigned_.set(c,!1)}),l.copy_.clear())}forEach(l,c){const d=this[Z];ue(d).forEach((u,f,h)=>{l.call(c,this.get(f),f,this)})}get(l){const c=this[Z];a(c);const d=ue(c).get(l);if(c.finalized_||!nt(d)||d!==c.base_.get(l))return d;const u=Wn(d,c);return t(c),c.copy_.set(l,u),u}keys(){return ue(this[Z]).keys()}values(){const l=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const c=l.next();return c.done?c:{done:!1,value:this.get(c.value)}}}}entries(){const l=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const c=l.next();if(c.done)return c;const d=this.get(c.value);return{done:!1,value:[c.value,d]}}}}[Symbol.iterator](){return this.entries()}}function n(s,l){return new e(s,l)}function t(s){s.copy_||(s.assigned_=new Map,s.copy_=new Map(s.base_))}class r extends Set{constructor(l,c){super(),this[Z]={type_:3,parent_:c,scope_:c?c.scope_:Hr(),modified_:!1,finalized_:!1,copy_:void 0,base_:l,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return ue(this[Z]).size}has(l){const c=this[Z];return a(c),c.copy_?!!(c.copy_.has(l)||c.drafts_.has(l)&&c.copy_.has(c.drafts_.get(l))):c.base_.has(l)}add(l){const c=this[Z];return a(c),this.has(l)||(i(c),et(c),c.copy_.add(l)),this}delete(l){if(!this.has(l))return!1;const c=this[Z];return a(c),i(c),et(c),c.copy_.delete(l)||(c.drafts_.has(l)?c.copy_.delete(c.drafts_.get(l)):!1)}clear(){const l=this[Z];a(l),ue(l).size&&(i(l),et(l),l.copy_.clear())}values(){const l=this[Z];return a(l),i(l),l.copy_.values()}entries(){const l=this[Z];return a(l),i(l),l.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(l,c){const d=this.values();let u=d.next();for(;!u.done;)l.call(c,u.value,u.value,this),u=d.next()}}function o(s,l){return new r(s,l)}function i(s){s.copy_||(s.copy_=new Set,s.base_.forEach(l=>{if(nt(l)){const c=Wn(l,s);s.drafts_.set(l,c),s.copy_.add(c)}else s.copy_.add(l)}))}function a(s){s.revoked_&&Ie(3,JSON.stringify(ue(s)))}Bm("MapSet",{proxyMap_:n,proxySet_:o})}var Wm=new qm,Ym=Wm.produce;const Km=e=>(n,t,r)=>(r.setState=(o,i,...a)=>{const s=typeof o=="function"?Ym(o):o;return n(s,i,...a)},e(r.setState,t,r)),po=Km;var Qm=function e(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var r,o,i;if(Array.isArray(n)){if(r=n.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!e(n[o],t[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){var a=i[o];if(!(a==="_owner"&&n.$$typeof)&&!e(n[a],t[a]))return!1}return!0}return n!==n&&t!==t};const Ei=Y.getDefaultExportFromCjs(Qm),At=new Map;function Xm(e,n){return At.has(e)||At.set(e,new Set),At.get(e).add(n),()=>{var t;(t=At.get(e))==null||t.delete(n)}}function oa(e){const n=At.get(e);n&&n.forEach(t=>{try{t()}catch(r){console.error(`Error in store event callback for '${e}':`,r)}})}function Zm(e){e?At.delete(e):At.clear()}const it={subscribe:Xm,emit:oa,clear:Zm},Jm=()=>oa("dashboard:load"),eh=()=>oa("dashboard:unload"),Ds={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Yn=new Map,Ir=e=>{const n=Yn.get(e);return n?Object.fromEntries(Object.entries(n.stores).map(([t,r])=>[t,r.getState()])):{}},th=(e,n,t)=>{if(e===void 0)return{type:"untracked",connection:n.connect(t)};const r=Yn.get(t.name);if(r)return{type:"tracked",store:e,...r};const o={connection:n.connect(t),stores:{}};return Yn.set(t.name,o),{type:"tracked",store:e,...o}},nh=(e,n)=>{if(n===void 0)return;const t=Yn.get(e);t&&(delete t.stores[n],Object.keys(t.stores).length===0&&Yn.delete(e))},rh=e=>{var n,t;if(!e)return;const r=e.split(`
1
+ "use strict";const Re=require("./x-B6ghREd2.cjs"),I=require("react/jsx-runtime"),ae=require("react"),Y=require("./saved-temporal-bucket-format-Ca4hUfTo.cjs"),oe=require("./validators-DO-YuzgO.cjs");require("./analyze-result-contract-CMwVg9w2.cjs");require("../value-format-preferences/index.cjs");const Zl=require("react-dom"),Fm=require("./appearance-context-DhyjbQk1.cjs");require("react-dom/client");const Dm=require("./temporal-bucket-BDRcWdVv.cjs"),Am=require("./report-runtime-context-CLtzrZdC.cjs"),Rm=require("../layouts/index.cjs"),fe=require("./format-types-PSZZ7hG8.cjs"),Mt=require("./index-F25jnH0p.cjs"),_m=require("./temporal-bucket-authoring-C6sZAVqS.cjs"),ce=require("./dashboard-filter-value-compatibility-Bnl2lsng.cjs"),qr=require("./common-types-tRK8fhXV.cjs"),ge=require("./dashboard-input-contract-12mPNhCF.cjs");function Jl(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const p=Jl(ae),lo=Jl(Zl),Cs=e=>{let n;const t=new Set,r=(c,d)=>{const u=typeof c=="function"?c(n):c;if(!Object.is(u,n)){const f=n;n=d??(typeof u!="object"||u===null)?u:Object.assign({},n,u),t.forEach(h=>h(n,f))}},o=()=>n,s={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=n=e(r,o,s);return s},Pm=e=>e?Cs(e):Cs,Om=e=>e;function Mm(e,n=Om){const t=ae.useSyncExternalStore(e.subscribe,ae.useCallback(()=>n(e.getState()),[e,n]),ae.useCallback(()=>n(e.getInitialState()),[e,n]));return ae.useDebugValue(t),t}const Ss=e=>{const n=Pm(e),t=r=>Mm(n,r);return Object.assign(t,n),t},zt=e=>e?Ss(e):Ss;var ec=Symbol.for("immer-nothing"),Is=Symbol.for("immer-draftable"),Z=Symbol.for("immer-state"),km=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Ie(e,...n){if(process.env.NODE_ENV!=="production"){const t=km[e],r=typeof t=="function"?t.apply(null,n):t;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zn=Object.getPrototypeOf;function hn(e){return!!e&&!!e[Z]}function nt(e){var n;return e?tc(e)||Array.isArray(e)||!!e[Is]||!!((n=e.constructor)!=null&&n[Is])||nr(e)||uo(e):!1}var Nm=Object.prototype.constructor.toString(),xs=new WeakMap;function tc(e){if(!e||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);if(n===null||n===Object.prototype)return!0;const t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;if(t===Object)return!0;if(typeof t!="function")return!1;let r=xs.get(t);return r===void 0&&(r=Function.toString.call(t),xs.set(t,r)),r===Nm}function qn(e,n,t=!0){co(e)===0?(t?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{n(o,e[o],e)}):e.forEach((r,o)=>n(o,r,e))}function co(e){const n=e[Z];return n?n.type_:Array.isArray(e)?1:nr(e)?2:uo(e)?3:0}function Si(e,n){return co(e)===2?e.has(n):Object.prototype.hasOwnProperty.call(e,n)}function nc(e,n,t){const r=co(e);r===2?e.set(n,t):r===3?e.add(t):e[n]=t}function Vm(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}function nr(e){return e instanceof Map}function uo(e){return e instanceof Set}function ue(e){return e.copy_||e.base_}function Ii(e,n){if(nr(e))return new Map(e);if(uo(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const t=tc(e);if(n===!0||n==="class_only"&&!t){const r=Object.getOwnPropertyDescriptors(e);delete r[Z];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const a=o[i],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(zn(e),r)}else{const r=zn(e);if(r!==null&&t)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function na(e,n=!1){return fo(e)||hn(e)||!nt(e)||(co(e)>1&&Object.defineProperties(e,{set:Sr,add:Sr,clear:Sr,delete:Sr}),Object.freeze(e),n&&Object.values(e).forEach(t=>na(t,!0))),e}function Lm(){Ie(2)}var Sr={value:Lm};function fo(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var xi={};function kt(e){const n=xi[e];return n||Ie(0,e),n}function Bm(e,n){xi[e]||(xi[e]=n)}var Hn;function Hr(){return Hn}function $m(e,n){return{drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ws(e,n){n&&(kt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function wi(e){Ti(e),e.drafts_.forEach(jm),e.drafts_=null}function Ti(e){e===Hn&&(Hn=e.parent_)}function Ts(e){return Hn=$m(Hn,e)}function jm(e){const n=e[Z];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function Es(e,n){n.unfinalizedDrafts_=n.drafts_.length;const t=n.drafts_[0];return e!==void 0&&e!==t?(t[Z].modified_&&(wi(n),Ie(4)),nt(e)&&(e=Gr(n,e),n.parent_||Wr(n,e)),n.patches_&&kt("Patches").generateReplacementPatches_(t[Z].base_,e,n.patches_,n.inversePatches_)):e=Gr(n,t,[]),wi(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==ec?e:void 0}function Gr(e,n,t){if(fo(n))return n;const r=e.immer_.shouldUseStrictIteration(),o=n[Z];if(!o)return qn(n,(i,a)=>Fs(e,o,n,i,a,t),r),n;if(o.scope_!==e)return n;if(!o.modified_)return Wr(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const i=o.copy_;let a=i,s=!1;o.type_===3&&(a=new Set(i),i.clear(),s=!0),qn(a,(l,c)=>Fs(e,o,i,l,c,t,s),r),Wr(e,i,!1),t&&e.patches_&&kt("Patches").generatePatches_(o,t,e.patches_,e.inversePatches_)}return o.copy_}function Fs(e,n,t,r,o,i,a){if(o==null||typeof o!="object"&&!a)return;const s=fo(o);if(!(s&&!a)){if(process.env.NODE_ENV!=="production"&&o===t&&Ie(5),hn(o)){const l=i&&n&&n.type_!==3&&!Si(n.assigned_,r)?i.concat(r):void 0,c=Gr(e,o,l);if(nc(t,r,c),hn(c))e.canAutoFreeze_=!1;else return}else a&&t.add(o);if(nt(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||n&&n.base_&&n.base_[r]===o&&s)return;Gr(e,o),(!n||!n.scope_.parent_)&&typeof r!="symbol"&&(nr(t)?t.has(r):Object.prototype.propertyIsEnumerable.call(t,r))&&Wr(e,o)}}}function Wr(e,n,t=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&na(n,t)}function Um(e,n){const t=Array.isArray(e),r={type_:t?1:0,scope_:n?n.scope_:Hr(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ra;t&&(o=[r],i=Gn);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}var ra={get(e,n){if(n===Z)return e;const t=ue(e);if(!Si(t,n))return zm(e,t,n);const r=t[n];return e.finalized_||!nt(r)?r:r===Wo(e.base_,n)?(Yo(e),e.copy_[n]=Wn(r,e)):r},has(e,n){return n in ue(e)},ownKeys(e){return Reflect.ownKeys(ue(e))},set(e,n,t){const r=rc(ue(e),n);if(r!=null&&r.set)return r.set.call(e.draft_,t),!0;if(!e.modified_){const o=Wo(ue(e),n),i=o==null?void 0:o[Z];if(i&&i.base_===t)return e.copy_[n]=t,e.assigned_[n]=!1,!0;if(Vm(t,o)&&(t!==void 0||Si(e.base_,n)))return!0;Yo(e),et(e)}return e.copy_[n]===t&&(t!==void 0||n in e.copy_)||Number.isNaN(t)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=t,e.assigned_[n]=!0),!0},deleteProperty(e,n){return Wo(e.base_,n)!==void 0||n in e.base_?(e.assigned_[n]=!1,Yo(e),et(e)):delete e.assigned_[n],e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const t=ue(e),r=Reflect.getOwnPropertyDescriptor(t,n);return r&&{writable:!0,configurable:e.type_!==1||n!=="length",enumerable:r.enumerable,value:t[n]}},defineProperty(){Ie(11)},getPrototypeOf(e){return zn(e.base_)},setPrototypeOf(){Ie(12)}},Gn={};qn(ra,(e,n)=>{Gn[e]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}});Gn.deleteProperty=function(e,n){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(n))&&Ie(13),Gn.set.call(this,e,n,void 0)};Gn.set=function(e,n,t){return process.env.NODE_ENV!=="production"&&n!=="length"&&isNaN(parseInt(n))&&Ie(14),ra.set.call(this,e[0],n,t,e[0])};function Wo(e,n){const t=e[Z];return(t?ue(t):e)[n]}function zm(e,n,t){var o;const r=rc(n,t);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function rc(e,n){if(!(n in e))return;let t=zn(e);for(;t;){const r=Object.getOwnPropertyDescriptor(t,n);if(r)return r;t=zn(t)}}function et(e){e.modified_||(e.modified_=!0,e.parent_&&et(e.parent_))}function Yo(e){e.copy_||(e.copy_=Ii(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var qm=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(n,t,r)=>{if(typeof n=="function"&&typeof t!="function"){const i=t;t=n;const a=this;return function(l=i,...c){return a.produce(l,d=>t.call(this,d,...c))}}typeof t!="function"&&Ie(6),r!==void 0&&typeof r!="function"&&Ie(7);let o;if(nt(n)){const i=Ts(this),a=Wn(n,void 0);let s=!0;try{o=t(a),s=!1}finally{s?wi(i):Ti(i)}return ws(i,r),Es(o,i)}else if(!n||typeof n!="object"){if(o=t(n),o===void 0&&(o=n),o===ec&&(o=void 0),this.autoFreeze_&&na(o,!0),r){const i=[],a=[];kt("Patches").generateReplacementPatches_(n,o,i,a),r(i,a)}return o}else Ie(1,n)},this.produceWithPatches=(n,t)=>{if(typeof n=="function")return(a,...s)=>this.produceWithPatches(a,l=>n(l,...s));let r,o;return[this.produce(n,t,(a,s)=>{r=a,o=s}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){nt(e)||Ie(8),hn(e)&&(e=Hm(e));const n=Ts(this),t=Wn(e,void 0);return t[Z].isManual_=!0,Ti(n),t}finishDraft(e,n){const t=e&&e[Z];(!t||!t.isManual_)&&Ie(9);const{scope_:r}=t;return ws(r,n),Es(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,n){let t;for(t=n.length-1;t>=0;t--){const o=n[t];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}t>-1&&(n=n.slice(t+1));const r=kt("Patches").applyPatches_;return hn(e)?r(e,n):this.produce(e,o=>r(o,n))}};function Wn(e,n){const t=nr(e)?kt("MapSet").proxyMap_(e,n):uo(e)?kt("MapSet").proxySet_(e,n):Um(e,n);return(n?n.scope_:Hr()).drafts_.push(t),t}function Hm(e){return hn(e)||Ie(10,e),oc(e)}function oc(e){if(!nt(e)||fo(e))return e;const n=e[Z];let t,r=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,t=Ii(e,n.scope_.immer_.useStrictShallowCopy_),r=n.scope_.immer_.shouldUseStrictIteration()}else t=Ii(e,!0);return qn(t,(o,i)=>{nc(t,o,oc(i))},r),n&&(n.finalized_=!1),t}function Gm(){class e extends Map{constructor(l,c){super(),this[Z]={type_:2,parent_:c,scope_:c?c.scope_:Hr(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:l,draft_:this,isManual_:!1,revoked_:!1}}get size(){return ue(this[Z]).size}has(l){return ue(this[Z]).has(l)}set(l,c){const d=this[Z];return a(d),(!ue(d).has(l)||ue(d).get(l)!==c)&&(t(d),et(d),d.assigned_.set(l,!0),d.copy_.set(l,c),d.assigned_.set(l,!0)),this}delete(l){if(!this.has(l))return!1;const c=this[Z];return a(c),t(c),et(c),c.base_.has(l)?c.assigned_.set(l,!1):c.assigned_.delete(l),c.copy_.delete(l),!0}clear(){const l=this[Z];a(l),ue(l).size&&(t(l),et(l),l.assigned_=new Map,qn(l.base_,c=>{l.assigned_.set(c,!1)}),l.copy_.clear())}forEach(l,c){const d=this[Z];ue(d).forEach((u,f,h)=>{l.call(c,this.get(f),f,this)})}get(l){const c=this[Z];a(c);const d=ue(c).get(l);if(c.finalized_||!nt(d)||d!==c.base_.get(l))return d;const u=Wn(d,c);return t(c),c.copy_.set(l,u),u}keys(){return ue(this[Z]).keys()}values(){const l=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const c=l.next();return c.done?c:{done:!1,value:this.get(c.value)}}}}entries(){const l=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const c=l.next();if(c.done)return c;const d=this.get(c.value);return{done:!1,value:[c.value,d]}}}}[Symbol.iterator](){return this.entries()}}function n(s,l){return new e(s,l)}function t(s){s.copy_||(s.assigned_=new Map,s.copy_=new Map(s.base_))}class r extends Set{constructor(l,c){super(),this[Z]={type_:3,parent_:c,scope_:c?c.scope_:Hr(),modified_:!1,finalized_:!1,copy_:void 0,base_:l,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return ue(this[Z]).size}has(l){const c=this[Z];return a(c),c.copy_?!!(c.copy_.has(l)||c.drafts_.has(l)&&c.copy_.has(c.drafts_.get(l))):c.base_.has(l)}add(l){const c=this[Z];return a(c),this.has(l)||(i(c),et(c),c.copy_.add(l)),this}delete(l){if(!this.has(l))return!1;const c=this[Z];return a(c),i(c),et(c),c.copy_.delete(l)||(c.drafts_.has(l)?c.copy_.delete(c.drafts_.get(l)):!1)}clear(){const l=this[Z];a(l),ue(l).size&&(i(l),et(l),l.copy_.clear())}values(){const l=this[Z];return a(l),i(l),l.copy_.values()}entries(){const l=this[Z];return a(l),i(l),l.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(l,c){const d=this.values();let u=d.next();for(;!u.done;)l.call(c,u.value,u.value,this),u=d.next()}}function o(s,l){return new r(s,l)}function i(s){s.copy_||(s.copy_=new Set,s.base_.forEach(l=>{if(nt(l)){const c=Wn(l,s);s.drafts_.set(l,c),s.copy_.add(c)}else s.copy_.add(l)}))}function a(s){s.revoked_&&Ie(3,JSON.stringify(ue(s)))}Bm("MapSet",{proxyMap_:n,proxySet_:o})}var Wm=new qm,Ym=Wm.produce;const Km=e=>(n,t,r)=>(r.setState=(o,i,...a)=>{const s=typeof o=="function"?Ym(o):o;return n(s,i,...a)},e(r.setState,t,r)),po=Km;var Qm=function e(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var r,o,i;if(Array.isArray(n)){if(r=n.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!e(n[o],t[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){var a=i[o];if(!(a==="_owner"&&n.$$typeof)&&!e(n[a],t[a]))return!1}return!0}return n!==n&&t!==t};const Ei=Y.getDefaultExportFromCjs(Qm),At=new Map;function Xm(e,n){return At.has(e)||At.set(e,new Set),At.get(e).add(n),()=>{var t;(t=At.get(e))==null||t.delete(n)}}function oa(e){const n=At.get(e);n&&n.forEach(t=>{try{t()}catch(r){console.error(`Error in store event callback for '${e}':`,r)}})}function Zm(e){e?At.delete(e):At.clear()}const it={subscribe:Xm,emit:oa,clear:Zm},Jm=()=>oa("dashboard:load"),eh=()=>oa("dashboard:unload"),Ds={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Yn=new Map,Ir=e=>{const n=Yn.get(e);return n?Object.fromEntries(Object.entries(n.stores).map(([t,r])=>[t,r.getState()])):{}},th=(e,n,t)=>{if(e===void 0)return{type:"untracked",connection:n.connect(t)};const r=Yn.get(t.name);if(r)return{type:"tracked",store:e,...r};const o={connection:n.connect(t),stores:{}};return Yn.set(t.name,o),{type:"tracked",store:e,...o}},nh=(e,n)=>{if(n===void 0)return;const t=Yn.get(e);t&&(delete t.stores[n],Object.keys(t.stores).length===0&&Yn.delete(e))},rh=e=>{var n,t;if(!e)return;const r=e.split(`
2
2
  `),o=r.findIndex(a=>a.includes("api.setState"));if(o<0)return;const i=((n=r[o+1])==null?void 0:n.trim())||"";return(t=/.+ (.+) .+/.exec(i))==null?void 0:t[1]},oh=(e,n={})=>(t,r,o)=>{const{enabled:i,anonymousActionType:a,store:s,...l}=n;let c;try{c=(i??(Ds?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return e(t,r,o);const{connection:d,...u}=th(s,c,l);let f=!0;o.setState=(m,y,C)=>{const g=t(m,y);if(!f)return g;const v=C===void 0?{type:a||rh(new Error().stack)||"anonymous"}:typeof C=="string"?{type:C}:C;return s===void 0?(d==null||d.send(v,r()),g):(d==null||d.send({...v,type:`${s}/${v.type}`},{...Ir(l.name),[s]:o.getState()}),g)},o.devtools={cleanup:()=>{d&&typeof d.unsubscribe=="function"&&d.unsubscribe(),nh(l.name,s)}};const h=(...m)=>{const y=f;f=!1,t(...m),f=y},b=e(o.setState,r,o);if(u.type==="untracked"?d==null||d.init(b):(u.stores[u.store]=o,d==null||d.init(Object.fromEntries(Object.entries(u.stores).map(([m,y])=>[m,m===u.store?b:y.getState()])))),o.dispatchFromDevtools&&typeof o.dispatch=="function"){let m=!1;const y=o.dispatch;o.dispatch=(...C)=>{(Ds?"production":void 0)!=="production"&&C[0].type==="__setState"&&!m&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),m=!0),y(...C)}}return d.subscribe(m=>{var y;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ko(m.payload,C=>{if(C.type==="__setState"){if(s===void 0){h(C.state);return}Object.keys(C.state).length!==1&&console.error(`
3
3
  [zustand devtools middleware] Unsupported __setState action format.
4
4
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),