react-semaphor 0.0.688 → 0.0.689

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.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as a, jsx as e, Fragment as J } from "react/jsx-runtime";
2
- import { L as le, M as wn, u as X, N as At, O as Et, P as _, Q as Ot, T as Je, V as Sn, I as pt, W as Xe, X as rt, Y as rl, Z as Ye, _ as lt, $ as it, a0 as ot, a1 as gt, a2 as U, a3 as Oe, a4 as Rt, a5 as ye, a6 as kn, a7 as xa, a8 as $i, a9 as Ar, aa as Dn, ab as G, ac as Tn, ad as Yi, ae as ll, af as qi, ag as Ki, ah as Ma, ai as he, j as Er, aj as Wi, ak as Ji, al as Wt, am as _e, an as ue, ao as De, ap as ft, aq as je, ar as _a, as as Na, at as Va, au as Hi, av as ba, aw as xt, ax as Qe, ay as Ze, az as is, aA as tt, aB as Ee, aC as et, aD as Mn, aE as Is, aF as Ia, aG as la, aH as Ca, aI as In, aJ as An, aK as Qi, aL as os, aM as En, aN as On, aO as Rn, aP as Fn, R as Kt, aQ as il, aR as Zi, aS as Pn, aT as cs, aU as Ln, aV as zn, aW as ja, aX as Ba, aY as Ua, aZ as _n, a_ as _s, a$ as Vn, b0 as ol, b1 as cl, b2 as jn, b3 as fe, b4 as ge, b5 as xe, b6 as ve, b7 as ae, b8 as dl, b9 as ul, ba as Xi, bb as eo, bc as ia, bd as to, be as ao, bf as Ct, bg as wt, bh as Re, bi as ut, bj as Dt, J as O, bk as Lt, bl as Vs, bm as js, bn as Bn, bo as so, bp as st, bq as Aa, br as oa, bs as As, bt as ml, bu as hl, bv as no, bw as Un, bx as Gn, by as $n, bz as Yn, bA as qn, bB as Kn, bC as Wn, bD as Jn, bE as Ss, bF as Bs, bG as ds, K as ie, bH as ro, bI as It, bJ as lo, bK as ca, bL as pl, bM as qe, bN as Hn, bO as io, bP as Qn, bQ as Es, bR as Zn, bS as ks, bT as Ga, bU as Xn, bV as oo, bW as co, bX as uo, bY as mo, bZ as ho, i as po, b_ as Os, b$ as fl, c0 as zt, c1 as _t, c2 as Vt, c3 as Ht, c4 as us, c5 as ms, c6 as hs, c7 as ps, c8 as ha, c9 as $a, ca as Ea, cb as Oa, cc as Ft, cd as fs, A as jt, r as gl, q as xl, l as Tt, ce as Pt, cf as Ge, cg as fo, ch as sa, ci as ta, cj as vl, ck as go, k as yl, cl as Xa, cm as Xt, cn as xo, n as aa, m as Ut, o as Gt, co as un, cp as Us, cq as Gs, cr as Ya, cs as $s, ct as na, x as Or, cu as qa, cv as es, cw as Rr, cx as vo, cy as yo, cz as No, cA as Nl, cB as bo, cC as Co, cD as bl, cE as wo, cF as Ys, cG as So, cH as ko, cI as mn, cJ as $t, cK as We, cL as Yt, cM as Do, cN as To, cO as Mo, cP as er, cQ as Io, cR as Cl, cS as tr, cT as Ao, cU as wl, cV as Ds, cW as Sl, cX as Eo, cY as Oo, cZ as ts, c_ as Ro, c$ as ar, d0 as Fo, d1 as Po, d2 as Fr, d3 as Lo, E as gs, b as sr, d4 as zo, d5 as _o, d6 as Vo, d7 as nr, d8 as jo, d9 as Bo, da as Uo, db as kl, dc as rr, dd as Dl, de as Tl, df as Ml, dg as Il, dh as Al, di as lr, dj as ir, dk as El, dl as Ol, dm as Rl, dn as or, dp as qs, dq as Ks, dr as Go, ds as $o, dt as ua, du as Yo, dv as qo, dw as Ko, dx as Wo, dy as Jo, dz as Ho, dA as Fl, dB as mt, dC as ht, dD as Te, dE as Me, dF as Ie, dG as ea, dH as Qo, dI as Zo, dJ as Xo, dK as ec, dL as tc, y as ac, dM as Pr, dN as Pl, dO as sc, dP as nc, dQ as dt, dR as ys, dS as Lr, dT as rc, dU as zr, dV as lc, dW as ic, dX as oc, dY as cc, dZ as cr, d_ as dr, d$ as ur, e0 as Ka, e1 as mr, e2 as ra, e3 as dc, e4 as Ws, e5 as Ll, e6 as uc, e7 as mc, e8 as _r, e9 as hc, ea as pc, eb as fc, ec as gc, ed as xc, w as Vr, ee as jr, ef as vc, eg as yc, eh as zl, ei as Nc, ej as _l, ek as bc, el as Cc, em as wc, en as Sc, eo as kc, ep as Dc, eq as Tc, er as Mc, es as Ic, et as Ac, eu as Ec, ev as Oc, ew as Rc, ex as Fc, ey as Pc, ez as Lc, eA as Vl, eB as zc, eC as _c, eD as hn, eE as Vc, eF as Ts, eG as Ms, eH as Wa, eI as jc, eJ as Br, eK as Bc, eL as pn, eM as jl, eN as hr, eO as Xs, eP as pr, eQ as Uc, eR as Gc, eS as $c, eT as as, eU as Yc, eV as Bl, eW as fn, eX as qc, eY as Kc, eZ as Wc, e_ as gn, e$ as xn, f0 as Rs, f1 as Ul, f2 as Ra, f3 as ss, f4 as Jc, f5 as Hc, f6 as Qc, f7 as Zc, f8 as Xc, f9 as ed, fa as td, fb as ad, fc as en, fd as sd, fe as nd, ff as rd, F as Gl, fg as ld, p as id, fh as od, B as cd, fi as dd, fj as ud, fk as md, fl as $l, fm as Yl, fn as hd, fo as ql, fp as pd, fq as fd, fr as gd, fs as xd, ft as vd, S as yd, fu as Nd, U as bd, fv as Cd, C as wd } from "./index-BRk9PMc7.js";
2
+ import { L as le, M as wn, u as X, N as At, O as Et, P as _, Q as Ot, T as Je, V as Sn, I as pt, W as Xe, X as rt, Y as rl, Z as Ye, _ as lt, $ as it, a0 as ot, a1 as gt, a2 as U, a3 as Oe, a4 as Rt, a5 as ye, a6 as kn, a7 as xa, a8 as $i, a9 as Ar, aa as Dn, ab as G, ac as Tn, ad as Yi, ae as ll, af as qi, ag as Ki, ah as Ma, ai as he, j as Er, aj as Wi, ak as Ji, al as Wt, am as _e, an as ue, ao as De, ap as ft, aq as je, ar as _a, as as Na, at as Va, au as Hi, av as ba, aw as xt, ax as Qe, ay as Ze, az as is, aA as tt, aB as Ee, aC as et, aD as Mn, aE as Is, aF as Ia, aG as ia, aH as Ca, aI as In, aJ as An, aK as Qi, aL as os, aM as En, aN as On, aO as Rn, aP as Fn, R as Kt, aQ as il, aR as Zi, aS as Pn, aT as cs, aU as Ln, aV as zn, aW as ja, aX as Ba, aY as Ua, aZ as _n, a_ as _s, a$ as Vn, b0 as ol, b1 as cl, b2 as jn, b3 as fe, b4 as ge, b5 as xe, b6 as ve, b7 as ae, b8 as dl, b9 as ul, ba as Xi, bb as eo, bc as Ht, bd as to, be as ao, bf as Ct, bg as wt, bh as Re, bi as ut, bj as Dt, J as O, bk as Lt, bl as Vs, bm as js, bn as Bn, bo as so, bp as st, bq as Aa, br as oa, bs as As, bt as ml, bu as hl, bv as no, bw as Un, bx as Gn, by as $n, bz as Yn, bA as qn, bB as Kn, bC as Wn, bD as Jn, bE as Ss, bF as Bs, bG as ds, K as ie, bH as ro, bI as It, bJ as lo, bK as ca, bL as pl, bM as qe, bN as Hn, bO as io, bP as Qn, bQ as Es, bR as Zn, bS as ks, bT as Ga, bU as Xn, bV as oo, bW as co, bX as uo, bY as mo, bZ as ho, i as po, b_ as Os, b$ as fl, c0 as zt, c1 as _t, c2 as Vt, c3 as Qt, c4 as us, c5 as ms, c6 as hs, c7 as ps, c8 as ha, c9 as $a, ca as Ea, cb as Oa, cc as Ft, cd as fs, A as jt, r as gl, q as xl, l as Tt, ce as Pt, cf as Ge, cg as fo, ch as na, ci as aa, cj as vl, ck as go, k as yl, cl as Xa, cm as ea, cn as xo, n as sa, m as Ut, o as Gt, co as un, cp as Us, cq as Gs, cr as Ya, cs as $s, ct as ra, x as Or, cu as qa, cv as es, cw as Rr, cx as vo, cy as yo, cz as No, cA as Nl, cB as bo, cC as Co, cD as bl, cE as wo, cF as Ys, cG as So, cH as ko, cI as mn, cJ as $t, cK as We, cL as Yt, cM as Do, cN as To, cO as Mo, cP as er, cQ as Io, cR as Cl, cS as tr, cT as Ao, cU as wl, cV as Ds, cW as Sl, cX as Eo, cY as Oo, cZ as ts, c_ as Ro, c$ as ar, d0 as Fo, d1 as Po, d2 as Fr, d3 as Lo, E as gs, b as sr, d4 as zo, d5 as _o, d6 as Vo, d7 as nr, d8 as jo, d9 as Bo, da as Uo, db as kl, dc as rr, dd as Dl, de as Tl, df as Ml, dg as Il, dh as Al, di as lr, dj as ir, dk as El, dl as Ol, dm as Rl, dn as or, dp as qs, dq as Ks, dr as Go, ds as $o, dt as ua, du as Yo, dv as qo, dw as Ko, dx as Wo, dy as Jo, dz as Ho, dA as Fl, dB as mt, dC as ht, dD as Te, dE as Me, dF as Ie, dG as ta, dH as Qo, dI as Zo, dJ as Xo, dK as ec, dL as tc, y as ac, dM as Pr, dN as Pl, dO as sc, dP as nc, dQ as dt, dR as ys, dS as Lr, dT as rc, dU as zr, dV as lc, dW as ic, dX as oc, dY as cc, dZ as cr, d_ as dr, d$ as ur, e0 as Ka, e1 as mr, e2 as la, e3 as dc, e4 as Ws, e5 as Ll, e6 as uc, e7 as mc, e8 as _r, e9 as hc, ea as pc, eb as fc, ec as gc, ed as xc, w as Vr, ee as jr, ef as vc, eg as yc, eh as zl, ei as Nc, ej as _l, ek as bc, el as Cc, em as wc, en as Sc, eo as kc, ep as Dc, eq as Tc, er as Mc, es as Ic, et as Ac, eu as Ec, ev as Oc, ew as Rc, ex as Fc, ey as Pc, ez as Lc, eA as Vl, eB as zc, eC as _c, eD as hn, eE as Vc, eF as Ts, eG as Ms, eH as Wa, eI as jc, eJ as Br, eK as Bc, eL as pn, eM as jl, eN as hr, eO as Xs, eP as pr, eQ as Uc, eR as Gc, eS as $c, eT as as, eU as Yc, eV as Bl, eW as fn, eX as qc, eY as Kc, eZ as Wc, e_ as gn, e$ as xn, f0 as Rs, f1 as Ul, f2 as Ra, f3 as ss, f4 as Jc, f5 as Hc, f6 as Qc, f7 as Zc, f8 as Xc, f9 as ed, fa as td, fb as ad, fc as en, fd as sd, fe as nd, ff as rd, F as Gl, fg as ld, p as id, fh as od, B as cd, fi as dd, fj as ud, fk as md, fl as $l, fm as Yl, fn as hd, fo as ql, fp as pd, fq as fd, fr as gd, fs as xd, ft as vd, S as yd, fu as Nd, U as bd, fv as Cd, C as wd } from "./index-BATJPB8E.js";
3
3
  import * as ma from "react";
4
4
  import $e, { useState as V, useRef as Nt, useEffect as ke, useMemo as Ve, useCallback as Se, useContext as fr, Suspense as Kl } from "react";
5
5
  import { createPortal as Sd } from "react-dom";
@@ -2111,7 +2111,7 @@ function ni({
2111
2111
  A ? y.removeSelectedUser(C) : N ? y.removeUserFromRemove(C) : y.addSelectedUser({ id: C, role: "VIEWER" });
2112
2112
  }), v = c || y.updateSelectedUserRole, g = u || y.addUserToRemove, b = d || ((C, A, N) => {
2113
2113
  y.addUserToUpdate({ id: C, currentRole: A, newRole: N });
2114
- }), I = l.filter((C) => C.id !== (i == null ? void 0 : i.id)), T = h;
2114
+ }), I = l.filter((C) => C.id !== (i == null ? void 0 : i.id)), M = h;
2115
2115
  return /* @__PURE__ */ a("div", { className: "space-y-2", children: [
2116
2116
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
2117
2117
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
@@ -2159,10 +2159,10 @@ function ni({
2159
2159
  }
2160
2160
  ),
2161
2161
  !n && !s && (I == null ? void 0 : I.length) > 0 && I.map((C) => {
2162
- const A = t ? Su(C, t, i) : void 0, N = T.includes(C.id), S = !!A, w = S && !N, L = m.some(
2163
- (M) => M.id === C.id
2162
+ const A = t ? Su(C, t, i) : void 0, N = M.includes(C.id), S = !!A, w = S && !N, L = m.some(
2163
+ (D) => D.id === C.id
2164
2164
  ), k = m.find(
2165
- (M) => M.id === C.id
2165
+ (D) => D.id === C.id
2166
2166
  ), z = r(C.type);
2167
2167
  return /* @__PURE__ */ e(
2168
2168
  Eu,
@@ -2260,7 +2260,7 @@ function Ou({
2260
2260
  isUpdating: o = !1,
2261
2261
  isRemoving: c = !1
2262
2262
  }) {
2263
- const u = la(), d = yt().filter(
2263
+ const u = ia(), d = yt().filter(
2264
2264
  (b) => b.value === "VIEWER" || b.value === "EDITOR" || b.value === "CONTRIBUTOR"
2265
2265
  ), m = n.role !== "NONE" ? n.role : "NONE", h = l ? l.newRole : m, p = n.role !== "NONE" && !i && (!l || l.newRole === m), x = l !== null && l.newRole !== m, y = i, f = m === "NONE" || !m, v = (b) => {
2266
2266
  switch (b) {
@@ -2450,7 +2450,7 @@ function Ru({
2450
2450
  isRemoving: o = !1
2451
2451
  }) {
2452
2452
  var $, ne;
2453
- const c = Pn(), u = cs(), { searchQuery: d, setSearchQuery: m, debouncedSearchQuery: h } = Ln(), p = _a(), x = Na(), y = Va(), f = la(), v = zn(), g = ba(), [b, I] = $e.useState("specific_users"), T = () => {
2453
+ const c = Pn(), u = cs(), { searchQuery: d, setSearchQuery: m, debouncedSearchQuery: h } = Ln(), p = _a(), x = Na(), y = Va(), f = ia(), v = zn(), g = ba(), [b, I] = $e.useState("specific_users"), M = () => {
2454
2454
  if (c === "org") return "organization";
2455
2455
  if (c === "tenant") return "tenant";
2456
2456
  }, C = () => {
@@ -2460,7 +2460,7 @@ function Ru({
2460
2460
  debouncedSearchQuery: h,
2461
2461
  resourceId: (t == null ? void 0 : t.id) || "",
2462
2462
  resourceType: n,
2463
- userType: T(),
2463
+ userType: M(),
2464
2464
  tenantId: C()
2465
2465
  });
2466
2466
  $e.useEffect(() => {
@@ -2488,9 +2488,9 @@ function Ru({
2488
2488
  (Ne) => Ne.orgUserId === ee
2489
2489
  );
2490
2490
  de ? g.removeSelectedUser(ee) : H ? g.removeUserFromRemove(ee) : me || g.addSelectedUser({ id: ee, role: "VIEWER" });
2491
- }, M = (ee, de) => {
2491
+ }, D = (ee, de) => {
2492
2492
  g.updateSelectedUserRole(ee, de);
2493
- }, D = (ee) => {
2493
+ }, T = (ee) => {
2494
2494
  g.addUserToRemove(ee), g.removeSelectedUser(ee);
2495
2495
  }, E = (ee) => {
2496
2496
  g.removeUserFromRemove(ee);
@@ -2542,7 +2542,7 @@ function Ru({
2542
2542
  selectedUsers: p,
2543
2543
  selectedUserObjects: k,
2544
2544
  onRemove: z,
2545
- onRoleChange: M,
2545
+ onRoleChange: D,
2546
2546
  getRoleOptions: yt
2547
2547
  }
2548
2548
  ),
@@ -2576,8 +2576,8 @@ function Ru({
2576
2576
  allUsers: L,
2577
2577
  currentUser: s,
2578
2578
  handleUserToggle: z,
2579
- handleUserRoleChange: M,
2580
- handleRemoveAccess: D,
2579
+ handleUserRoleChange: D,
2580
+ handleRemoveAccess: T,
2581
2581
  handleUpdateAccess: (ee, de, H) => {
2582
2582
  g.addUserToUpdate({ id: ee, currentRole: de, newRole: H });
2583
2583
  }
@@ -2641,7 +2641,7 @@ function li({
2641
2641
  /* @__PURE__ */ e("div", { className: "max-h-[300px] space-y-2 overflow-y-auto rounded-md border p-3", children: t.map((f) => {
2642
2642
  const v = n == null ? void 0 : n.find(
2643
2643
  (N) => N.groupId === f.id
2644
- ), g = m.some((N) => N.id === f.id), b = h.includes(f.id), I = p.find((N) => N.id === f.id), T = !!v && !b;
2644
+ ), g = m.some((N) => N.id === f.id), b = h.includes(f.id), I = p.find((N) => N.id === f.id), M = !!v && !b;
2645
2645
  let A = (v == null ? void 0 : v.role) || "VIEWER";
2646
2646
  if (g) {
2647
2647
  const N = m.find((S) => S.id === f.id);
@@ -2652,7 +2652,7 @@ function li({
2652
2652
  {
2653
2653
  className: G(
2654
2654
  "flex items-center justify-between rounded-lg p-2 transition-colors",
2655
- T && !b ? "border border-green-200 bg-green-50" : b ? "border border-red-200 bg-red-50" : g ? "border border-blue-200 bg-blue-50" : "hover:bg-muted/50"
2655
+ M && !b ? "border border-green-200 bg-green-50" : b ? "border border-red-200 bg-red-50" : g ? "border border-blue-200 bg-blue-50" : "hover:bg-muted/50"
2656
2656
  ),
2657
2657
  children: [
2658
2658
  /* @__PURE__ */ a("div", { className: "flex items-center space-x-3", children: [
@@ -2660,10 +2660,10 @@ function li({
2660
2660
  et,
2661
2661
  {
2662
2662
  id: `group-${f.id}`,
2663
- checked: T ? !b : g,
2663
+ checked: M ? !b : g,
2664
2664
  disabled: !1,
2665
2665
  onCheckedChange: () => {
2666
- T ? b ? x.removeGroupFromRemove(f.id) : u == null || u(f.id) : o == null || o(f.id);
2666
+ M ? b ? x.removeGroupFromRemove(f.id) : u == null || u(f.id) : o == null || o(f.id);
2667
2667
  }
2668
2668
  }
2669
2669
  ),
@@ -2700,7 +2700,7 @@ function li({
2700
2700
  )
2701
2701
  ] }),
2702
2702
  /* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
2703
- T && !b ? /* @__PURE__ */ e(
2703
+ M && !b ? /* @__PURE__ */ e(
2704
2704
  ya,
2705
2705
  {
2706
2706
  currentRole: A,
@@ -2714,7 +2714,7 @@ function li({
2714
2714
  }
2715
2715
  ) : (
2716
2716
  /* Show role selector for newly selected groups */
2717
- g && !T && /* @__PURE__ */ e(
2717
+ g && !M && /* @__PURE__ */ e(
2718
2718
  ya,
2719
2719
  {
2720
2720
  currentRole: A,
@@ -2724,7 +2724,7 @@ function li({
2724
2724
  }
2725
2725
  )
2726
2726
  ),
2727
- T && !b && !I && /* @__PURE__ */ e(
2727
+ M && !b && !I && /* @__PURE__ */ e(
2728
2728
  _,
2729
2729
  {
2730
2730
  variant: "ghost",
@@ -2831,7 +2831,7 @@ function qr({
2831
2831
  isRemoving: o = !1
2832
2832
  }) {
2833
2833
  var Z;
2834
- const { searchQuery: c, debouncedSearchQuery: u, setSearchQuery: d } = Ln(), m = _a(), h = Na(), p = Va(), x = ja(), y = Ba(), f = Ua(), v = la(), g = _s(), b = Vn(), I = cs(), T = ba(), { data: C, isLoading: A } = ol({
2834
+ const { searchQuery: c, debouncedSearchQuery: u, setSearchQuery: d } = Ln(), m = _a(), h = Na(), p = Va(), x = ja(), y = Ba(), f = Ua(), v = ia(), g = _s(), b = Vn(), I = cs(), M = ba(), { data: C, isLoading: A } = ol({
2835
2835
  enabled: (s == null ? void 0 : s.type) === "organization"
2836
2836
  }), { groups: N, isLoading: S } = cl(
2837
2837
  "tenant",
@@ -2840,26 +2840,26 @@ function qr({
2840
2840
  (s == null ? void 0 : s.type) === "organization" ? "all_tenants" : "specific_tenant_users"
2841
2841
  );
2842
2842
  $e.useEffect(() => {
2843
- (s == null ? void 0 : s.type) === "tenant" ? (T.setCurrentContext("tenant-dialog"), T.setCurrentMode("specificTenantUsers")) : (T.setCurrentContext("tenant-tab"), T.setCurrentMode("allTenants"));
2844
- }, [T, s == null ? void 0 : s.type]);
2843
+ (s == null ? void 0 : s.type) === "tenant" ? (M.setCurrentContext("tenant-dialog"), M.setCurrentMode("specificTenantUsers")) : (M.setCurrentContext("tenant-tab"), M.setCurrentMode("allTenants"));
2844
+ }, [M, s == null ? void 0 : s.type]);
2845
2845
  const k = (B) => {
2846
2846
  var Ae, Le, we, ze;
2847
2847
  L(
2848
2848
  B
2849
2849
  );
2850
2850
  let ce;
2851
- if (B === "specific_tenant_users" ? ce = "specific_users" : B === "all_tenant_users" || B === "all_tenants" ? ce = "all_users" : B === "groups" ? ce = "groups" : ce = "specific_users", r == null || r(ce), B === "groups" ? (T.setCurrentContext("group-share"), T.setCurrentMode("specificGroups")) : (s == null ? void 0 : s.type) === "tenant" ? (T.setCurrentContext("tenant-dialog"), B === "specific_tenant_users" ? T.setCurrentMode("specificTenantUsers") : B === "all_tenant_users" && (T.setCurrentMode("allTenantUsers"), s != null && s.tenantId && T.setSelectedTenant(s.tenantId))) : (T.setCurrentContext("tenant-tab"), B === "specific_tenant_users" ? T.setCurrentMode("specificTenantUsers") : B === "all_tenant_users" ? T.setCurrentMode("allTenantUsers") : B === "all_tenants" && T.setCurrentMode("allTenants")), B === "all_tenant_users") {
2852
- const Ke = (Le = (Ae = D == null ? void 0 : D.shares) == null ? void 0 : Ae.tenantWide) == null ? void 0 : Le[0];
2853
- Ke && Ke.role !== void 0 && T.setTenantWideRole(Ke.role);
2851
+ if (B === "specific_tenant_users" ? ce = "specific_users" : B === "all_tenant_users" || B === "all_tenants" ? ce = "all_users" : B === "groups" ? ce = "groups" : ce = "specific_users", r == null || r(ce), B === "groups" ? (M.setCurrentContext("group-share"), M.setCurrentMode("specificGroups")) : (s == null ? void 0 : s.type) === "tenant" ? (M.setCurrentContext("tenant-dialog"), B === "specific_tenant_users" ? M.setCurrentMode("specificTenantUsers") : B === "all_tenant_users" && (M.setCurrentMode("allTenantUsers"), s != null && s.tenantId && M.setSelectedTenant(s.tenantId))) : (M.setCurrentContext("tenant-tab"), B === "specific_tenant_users" ? M.setCurrentMode("specificTenantUsers") : B === "all_tenant_users" ? M.setCurrentMode("allTenantUsers") : B === "all_tenants" && M.setCurrentMode("allTenants")), B === "all_tenant_users") {
2852
+ const Ke = (Le = (Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.tenantWide) == null ? void 0 : Le[0];
2853
+ Ke && Ke.role !== void 0 && M.setTenantWideRole(Ke.role);
2854
2854
  } else if (B === "all_tenants") {
2855
- const Ke = (ze = (we = D == null ? void 0 : D.shares) == null ? void 0 : we.allTenantsOnly) == null ? void 0 : ze[0];
2856
- Ke && Ke.role !== void 0 && T.setAllTenantsRole(Ke.role);
2855
+ const Ke = (ze = (we = T == null ? void 0 : T.shares) == null ? void 0 : we.allTenantsOnly) == null ? void 0 : ze[0];
2856
+ Ke && Ke.role !== void 0 && M.setAllTenantsRole(Ke.role);
2857
2857
  }
2858
2858
  }, z = (B) => {
2859
- T.setSelectedTenant(B);
2859
+ M.setSelectedTenant(B);
2860
2860
  }, {
2861
- allUsers: M,
2862
- existingShares: D,
2861
+ allUsers: D,
2862
+ existingShares: T,
2863
2863
  isLoadingUsers: E,
2864
2864
  isErrorLoadingUsers: P,
2865
2865
  isLoadingShares: F,
@@ -2873,63 +2873,63 @@ function qr({
2873
2873
  tenantId: (s == null ? void 0 : s.type) === "tenant" ? s.tenantId : I
2874
2874
  }), j = (B) => {
2875
2875
  var we, ze;
2876
- const ce = m.some((Ke) => Ke.id === B), Ae = h.includes(B), Le = (ze = (we = D == null ? void 0 : D.shares) == null ? void 0 : we.specificTenantUsers) == null ? void 0 : ze.some(
2876
+ const ce = m.some((Ke) => Ke.id === B), Ae = h.includes(B), Le = (ze = (we = T == null ? void 0 : T.shares) == null ? void 0 : we.specificTenantUsers) == null ? void 0 : ze.some(
2877
2877
  (Ke) => Ke.tenantUserId === B
2878
2878
  );
2879
- ce ? T.removeSelectedUser(B) : Ae ? T.removeUserFromRemove(B) : Le || T.addSelectedUser({ id: B, role: "VIEWER" });
2879
+ ce ? M.removeSelectedUser(B) : Ae ? M.removeUserFromRemove(B) : Le || M.addSelectedUser({ id: B, role: "VIEWER" });
2880
2880
  }, K = (B, ce) => {
2881
- T.updateSelectedUserRole(B, ce);
2881
+ M.updateSelectedUserRole(B, ce);
2882
2882
  }, Q = (B) => {
2883
- T.addUserToRemove(B), T.removeSelectedUser(B);
2883
+ M.addUserToRemove(B), M.removeSelectedUser(B);
2884
2884
  }, $ = (B) => {
2885
- T.removeUserFromRemove(B);
2885
+ M.removeUserFromRemove(B);
2886
2886
  }, ne = (B) => {
2887
- T.removeUserFromUpdate(B);
2887
+ M.removeUserFromUpdate(B);
2888
2888
  }, ee = (B, ce, Ae) => {
2889
- T.addUserToUpdate({ id: B, currentRole: ce, newRole: Ae });
2889
+ M.addUserToUpdate({ id: B, currentRole: ce, newRole: Ae });
2890
2890
  }, de = (B, ce) => {
2891
- w === "all_tenant_users" ? T.setTenantWideRole(ce) : w === "all_tenants" && T.setAllTenantsRole(ce);
2891
+ w === "all_tenant_users" ? M.setTenantWideRole(ce) : w === "all_tenants" && M.setAllTenantsRole(ce);
2892
2892
  }, H = () => {
2893
- w === "all_tenant_users" ? T.setTenantWideRole("VIEWER") : w === "all_tenants" && T.setAllTenantsRole("VIEWER");
2893
+ w === "all_tenant_users" ? M.setTenantWideRole("VIEWER") : w === "all_tenants" && M.setAllTenantsRole("VIEWER");
2894
2894
  }, Y = (() => {
2895
2895
  var B, ce, Ae, Le;
2896
- return v === "allTenants" ? (ce = (B = D == null ? void 0 : D.shares) == null ? void 0 : B.allTenantsOnly) == null ? void 0 : ce[0] : v === "allTenantUsers" ? (Le = (Ae = D == null ? void 0 : D.shares) == null ? void 0 : Ae.tenantWide) == null ? void 0 : Le[0] : null;
2896
+ return v === "allTenants" ? (ce = (B = T == null ? void 0 : T.shares) == null ? void 0 : B.allTenantsOnly) == null ? void 0 : ce[0] : v === "allTenantUsers" ? (Le = (Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.tenantWide) == null ? void 0 : Le[0] : null;
2897
2897
  })();
2898
2898
  $e.useEffect(() => {
2899
2899
  var B, ce, Ae, Le;
2900
2900
  if (w === "all_tenant_users") {
2901
- const we = (ce = (B = D == null ? void 0 : D.shares) == null ? void 0 : B.tenantWide) == null ? void 0 : ce[0];
2902
- we && we.role !== void 0 && T.setTenantWideRole(we.role);
2901
+ const we = (ce = (B = T == null ? void 0 : T.shares) == null ? void 0 : B.tenantWide) == null ? void 0 : ce[0];
2902
+ we && we.role !== void 0 && M.setTenantWideRole(we.role);
2903
2903
  } else if (w === "all_tenants") {
2904
- const we = (Le = (Ae = D == null ? void 0 : D.shares) == null ? void 0 : Ae.allTenantsOnly) == null ? void 0 : Le[0];
2905
- we && we.role !== void 0 && T.setAllTenantsRole(we.role);
2904
+ const we = (Le = (Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.allTenantsOnly) == null ? void 0 : Le[0];
2905
+ we && we.role !== void 0 && M.setAllTenantsRole(we.role);
2906
2906
  }
2907
- }, [w, D, T]);
2908
- const W = M.filter(
2907
+ }, [w, T, M]);
2908
+ const W = D.filter(
2909
2909
  (B) => m.some((ce) => ce.id === B.id)
2910
2910
  ), Ne = (B) => {
2911
2911
  const ce = x.some((we) => we.id === B), Ae = y.includes(B), Le = be == null ? void 0 : be.some(
2912
2912
  (we) => we.groupId === B
2913
2913
  );
2914
- ce ? T.removeSelectedGroup(B) : Ae ? T.removeGroupFromRemove(B) : Le || T.addSelectedGroup({ id: B, role: "VIEWER" });
2914
+ ce ? M.removeSelectedGroup(B) : Ae ? M.removeGroupFromRemove(B) : Le || M.addSelectedGroup({ id: B, role: "VIEWER" });
2915
2915
  }, re = (B, ce) => {
2916
- T.updateSelectedGroupRole(B, ce);
2916
+ M.updateSelectedGroupRole(B, ce);
2917
2917
  }, Ce = (B) => {
2918
- T.addGroupToRemove(B), T.removeSelectedGroup(B);
2918
+ M.addGroupToRemove(B), M.removeSelectedGroup(B);
2919
2919
  }, q = (B, ce, Ae) => {
2920
- T.addGroupToUpdate({ id: B, currentRole: ce, newRole: Ae });
2920
+ M.addGroupToUpdate({ id: B, currentRole: ce, newRole: Ae });
2921
2921
  }, pe = N.filter(
2922
2922
  (B) => x.some((ce) => ce.id === B.id)
2923
2923
  ), Fe = $e.useMemo(() => w !== "groups" ? [] : N.filter((B) => B.type !== "TENANT_GROUP" ? !1 : B.name.toLowerCase().includes(c.toLowerCase()) || B.description && B.description.toLowerCase().includes(c.toLowerCase())), [N, w, c]), be = $e.useMemo(() => {
2924
2924
  var ce, Ae;
2925
- const B = ((ce = D == null ? void 0 : D.shares) == null ? void 0 : ce.specificGroups) || ((Ae = D == null ? void 0 : D.shares) == null ? void 0 : Ae.groups) || [];
2925
+ const B = ((ce = T == null ? void 0 : T.shares) == null ? void 0 : ce.specificGroups) || ((Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.groups) || [];
2926
2926
  return !B || B.length === 0 ? [] : B.filter(
2927
2927
  (Le) => {
2928
2928
  const we = N.find((ze) => ze.id === Le.groupId);
2929
2929
  return (we == null ? void 0 : we.type) === "TENANT_GROUP";
2930
2930
  }
2931
2931
  );
2932
- }, [D, N]), He = E || F || w === "groups" && S, Pe = P || R, se = () => (s == null ? void 0 : s.type) === "tenant" || w === "all_tenants" || w === "groups" ? !0 : I && (w === "specific_tenant_users" || w === "all_tenant_users");
2932
+ }, [T, N]), He = E || F || w === "groups" && S, Pe = P || R, se = () => (s == null ? void 0 : s.type) === "tenant" || w === "all_tenants" || w === "groups" ? !0 : I && (w === "specific_tenant_users" || w === "all_tenant_users");
2933
2933
  return /* @__PURE__ */ a(J, { children: [
2934
2934
  Pe && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
2935
2935
  /* @__PURE__ */ e(jn, { className: "mx-auto mb-2 h-8 w-8 text-destructive" }),
@@ -3034,7 +3034,7 @@ function qr({
3034
3034
  ei,
3035
3035
  {
3036
3036
  usersToRemove: h,
3037
- allUsers: M,
3037
+ allUsers: D,
3038
3038
  onRemove: $
3039
3039
  }
3040
3040
  ),
@@ -3042,7 +3042,7 @@ function qr({
3042
3042
  ti,
3043
3043
  {
3044
3044
  usersToUpdate: p,
3045
- allUsers: M,
3045
+ allUsers: D,
3046
3046
  onRemove: ne,
3047
3047
  getRoleOptions: yt
3048
3048
  }
@@ -3050,14 +3050,14 @@ function qr({
3050
3050
  /* @__PURE__ */ e(
3051
3051
  ni,
3052
3052
  {
3053
- existingShares: D,
3053
+ existingShares: T,
3054
3054
  isInitialLoading: !!He,
3055
3055
  isSearching: !1,
3056
3056
  resource: t,
3057
3057
  onShare: () => {
3058
3058
  },
3059
3059
  getRoleOptions: yt,
3060
- allUsers: M,
3060
+ allUsers: D,
3061
3061
  currentUser: s,
3062
3062
  handleUserToggle: j,
3063
3063
  handleUserRoleChange: K,
@@ -3153,11 +3153,11 @@ function Lu({
3153
3153
  var P, F;
3154
3154
  const { searchQuery: c, setSearchQuery: u } = Ln(), d = ja(), m = Ba(), h = Ua(), p = ba(), [x, y] = $e.useState("org_groups"), [f, v] = $e.useState(""), { data: g, isLoading: b } = ol({
3155
3155
  enabled: (s == null ? void 0 : s.type) === "organization" && x === "tenant_groups"
3156
- }), I = Array.isArray(g) ? g : (g == null ? void 0 : g.tenants) || [], T = () => {
3156
+ }), I = Array.isArray(g) ? g : (g == null ? void 0 : g.tenants) || [], M = () => {
3157
3157
  if ((s == null ? void 0 : s.type) === "organization") return "organization";
3158
3158
  if ((s == null ? void 0 : s.type) === "tenant") return "tenant";
3159
3159
  }, { groups: C, isLoading: A } = cl(
3160
- T(),
3160
+ M(),
3161
3161
  x === "tenant_groups" && (s == null ? void 0 : s.type) === "organization" ? f : s == null ? void 0 : s.tenantId
3162
3162
  ), { existingShares: N } = La({
3163
3163
  debouncedSearchQuery: "",
@@ -3179,9 +3179,9 @@ function Lu({
3179
3179
  ($) => $.groupId === R
3180
3180
  );
3181
3181
  j ? p.removeSelectedGroup(R) : K ? p.removeGroupFromRemove(R) : Q || p.addSelectedGroup({ id: R, role: "VIEWER" });
3182
- }, M = (R, j) => {
3182
+ }, D = (R, j) => {
3183
3183
  p.updateSelectedGroupRole(R, j);
3184
- }, D = (R) => {
3184
+ }, T = (R) => {
3185
3185
  p.addGroupToRemove(R), p.removeSelectedGroup(R);
3186
3186
  }, E = (R, j, K) => {
3187
3187
  p.addGroupToUpdate({ id: R, currentRole: j, newRole: K });
@@ -3252,7 +3252,7 @@ function Lu({
3252
3252
  selectedGroups: d,
3253
3253
  groupObjects: k,
3254
3254
  onRemove: z,
3255
- onRoleChange: M,
3255
+ onRoleChange: D,
3256
3256
  getRoleOptions: yt
3257
3257
  }
3258
3258
  ),
@@ -3282,8 +3282,8 @@ function Lu({
3282
3282
  getRoleOptions: yt,
3283
3283
  currentUser: s,
3284
3284
  handleGroupToggle: z,
3285
- handleGroupRoleChange: M,
3286
- handleRemoveAccess: D,
3285
+ handleGroupRoleChange: D,
3286
+ handleRemoveAccess: T,
3287
3287
  handleUpdateAccess: E
3288
3288
  }
3289
3289
  )
@@ -3291,7 +3291,7 @@ function Lu({
3291
3291
  ] }) : null;
3292
3292
  }
3293
3293
  const oi = () => {
3294
- const t = dl(), n = la(), s = _a(), r = Na(), l = Va(), i = ja(), o = Ba(), c = Ua(), u = cs(), d = zn(), m = Vn(), h = _s(), p = ul(), x = Ve(() => () => Xi({
3294
+ const t = dl(), n = ia(), s = _a(), r = Na(), l = Va(), i = ja(), o = Ba(), c = Ua(), u = cs(), d = zn(), m = Vn(), h = _s(), p = ul(), x = Ve(() => () => Xi({
3295
3295
  currentContext: t,
3296
3296
  currentMode: n,
3297
3297
  selectedUsers: s,
@@ -3374,50 +3374,50 @@ function Kr({
3374
3374
  currentAllUsersShare: u,
3375
3375
  onRemoveAccess: d
3376
3376
  }) {
3377
- const m = _a(), h = Na(), p = Va(), x = cs(), y = zn(), f = Vn(), v = _s(), { buildShareData: g, validateShareData: b, isCurrentStateValid: I } = oi(), T = s || r || l, C = () => {
3378
- var L, k, z, M;
3379
- if (T) return "Updating...";
3377
+ const m = _a(), h = Na(), p = Va(), x = cs(), y = zn(), f = Vn(), v = _s(), { buildShareData: g, validateShareData: b, isCurrentStateValid: I } = oi(), M = s || r || l, C = () => {
3378
+ var L, k, z, D;
3379
+ if (M) return "Updating...";
3380
3380
  if (c === "specific_users") {
3381
3381
  if (m.length === 0 && h.length === 0 && p.length === 0)
3382
3382
  return "Select users to share with";
3383
- const D = m.length + h.length + p.length;
3384
- return D === 0 ? "Select users to share with" : m.length > 0 && h.length > 0 ? `Update access for ${D} user${D !== 1 ? "s" : ""}` : h.length > 0 && m.length === 0 && p.length === 0 ? `Remove access for ${h.length} user${h.length !== 1 ? "s" : ""}` : m.length > 0 && h.length === 0 && p.length === 0 ? `Share with ${m.length} user${m.length !== 1 ? "s" : ""}` : p.length > 0 && m.length === 0 && h.length === 0 ? `Update access for ${p.length} user${p.length !== 1 ? "s" : ""}` : `Update access for ${D} user${D !== 1 ? "s" : ""}`;
3383
+ const T = m.length + h.length + p.length;
3384
+ return T === 0 ? "Select users to share with" : m.length > 0 && h.length > 0 ? `Update access for ${T} user${T !== 1 ? "s" : ""}` : h.length > 0 && m.length === 0 && p.length === 0 ? `Remove access for ${h.length} user${h.length !== 1 ? "s" : ""}` : m.length > 0 && h.length === 0 && p.length === 0 ? `Share with ${m.length} user${m.length !== 1 ? "s" : ""}` : p.length > 0 && m.length === 0 && h.length === 0 ? `Update access for ${p.length} user${p.length !== 1 ? "s" : ""}` : `Update access for ${T} user${T !== 1 ? "s" : ""}`;
3385
3385
  } else if (c === "all_users") {
3386
3386
  if (!u || u.role === void 0)
3387
3387
  return "Share with All Users";
3388
- const D = u.role;
3389
- return y === D ? "Remove Access" : "Update Access";
3388
+ const T = u.role;
3389
+ return y === T ? "Remove Access" : "Update Access";
3390
3390
  } else if (c === "all_tenants") {
3391
- const D = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
3392
- if (!D || D.role === void 0)
3391
+ const T = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
3392
+ if (!T || T.role === void 0)
3393
3393
  return "Share with All Tenants";
3394
- const E = D.role;
3394
+ const E = T.role;
3395
3395
  return f === E ? "Remove Access" : "Update Access";
3396
3396
  } else if (c === "all_tenant_users") {
3397
- const D = (M = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : M[0];
3398
- if (!D || D.role === void 0)
3397
+ const T = (D = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : D[0];
3398
+ if (!T || T.role === void 0)
3399
3399
  return "Share with All Tenant Users";
3400
- const E = D.role;
3400
+ const E = T.role;
3401
3401
  return v === E ? "Remove Access" : "Update Access";
3402
3402
  } else if (c === "specific_tenant_users") {
3403
3403
  if (m.length === 0 && h.length === 0 && p.length === 0)
3404
3404
  return "Select users to share with";
3405
- const D = m.length + h.length + p.length;
3406
- return D === 0 ? "Select users to share with" : m.length > 0 && h.length > 0 ? `Update access for ${D} user${D !== 1 ? "s" : ""}` : h.length > 0 && m.length === 0 && p.length === 0 ? `Remove access for ${h.length} user${h.length !== 1 ? "s" : ""}` : m.length > 0 && h.length === 0 && p.length === 0 ? `Share with ${m.length} user${m.length !== 1 ? "s" : ""}` : p.length > 0 && m.length === 0 && h.length === 0 ? `Update access for ${p.length} user${p.length !== 1 ? "s" : ""}` : `Update access for ${D} user${D !== 1 ? "s" : ""}`;
3405
+ const T = m.length + h.length + p.length;
3406
+ return T === 0 ? "Select users to share with" : m.length > 0 && h.length > 0 ? `Update access for ${T} user${T !== 1 ? "s" : ""}` : h.length > 0 && m.length === 0 && p.length === 0 ? `Remove access for ${h.length} user${h.length !== 1 ? "s" : ""}` : m.length > 0 && h.length === 0 && p.length === 0 ? `Share with ${m.length} user${m.length !== 1 ? "s" : ""}` : p.length > 0 && m.length === 0 && h.length === 0 ? `Update access for ${p.length} user${p.length !== 1 ? "s" : ""}` : `Update access for ${T} user${T !== 1 ? "s" : ""}`;
3407
3407
  }
3408
3408
  return "Share";
3409
- }, A = () => T || !t || c === "all_tenant_users" && !x || c === "specific_tenant_users" && !x ? !0 : !I, N = () => {
3409
+ }, A = () => M || !t || c === "all_tenant_users" && !x || c === "specific_tenant_users" && !x ? !0 : !I, N = () => {
3410
3410
  const L = g();
3411
3411
  L && b(L) && i(L);
3412
3412
  }, S = () => {
3413
- var L, k, z, M;
3413
+ var L, k, z, D;
3414
3414
  if (c === "all_users")
3415
3415
  if (!u || u.role === void 0) {
3416
- const D = g();
3417
- D && b(D) && i(D);
3416
+ const T = g();
3417
+ T && b(T) && i(T);
3418
3418
  } else {
3419
- const D = u.role;
3420
- if (y === D)
3419
+ const T = u.role;
3420
+ if (y === T)
3421
3421
  d == null || d();
3422
3422
  else {
3423
3423
  const P = g();
@@ -3431,12 +3431,12 @@ function Kr({
3431
3431
  }
3432
3432
  }
3433
3433
  else if (c === "all_tenants") {
3434
- const D = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
3435
- if (!D || D.role === void 0) {
3434
+ const T = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
3435
+ if (!T || T.role === void 0) {
3436
3436
  const E = g();
3437
3437
  E && b(E) && i(E);
3438
3438
  } else {
3439
- const E = D.role;
3439
+ const E = T.role;
3440
3440
  if (f === E)
3441
3441
  d == null || d();
3442
3442
  else {
@@ -3451,12 +3451,12 @@ function Kr({
3451
3451
  }
3452
3452
  }
3453
3453
  } else if (c === "all_tenant_users") {
3454
- const D = (M = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : M[0];
3455
- if (!D || D.role === void 0) {
3454
+ const T = (D = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : D[0];
3455
+ if (!T || T.role === void 0) {
3456
3456
  const E = g();
3457
3457
  E && b(E) && i(E);
3458
3458
  } else {
3459
- const E = D.role;
3459
+ const E = T.role;
3460
3460
  if (v === E)
3461
3461
  d == null || d();
3462
3462
  else {
@@ -3472,29 +3472,29 @@ function Kr({
3472
3472
  }
3473
3473
  }
3474
3474
  }, w = () => {
3475
- var L, k, z, M;
3475
+ var L, k, z, D;
3476
3476
  if (c === "all_users") {
3477
3477
  if (!u || u.role === void 0)
3478
3478
  return "default";
3479
- const D = u.role;
3480
- return y === D ? "destructive" : "default";
3479
+ const T = u.role;
3480
+ return y === T ? "destructive" : "default";
3481
3481
  } else if (c === "all_tenants") {
3482
- const D = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
3483
- if (!D || D.role === void 0)
3482
+ const T = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
3483
+ if (!T || T.role === void 0)
3484
3484
  return "default";
3485
- const E = D.role;
3485
+ const E = T.role;
3486
3486
  return f === E ? "destructive" : "default";
3487
3487
  } else if (c === "all_tenant_users") {
3488
- const D = (M = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : M[0];
3489
- if (!D || D.role === void 0)
3488
+ const T = (D = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : D[0];
3489
+ if (!T || T.role === void 0)
3490
3490
  return "default";
3491
- const E = D.role;
3491
+ const E = T.role;
3492
3492
  return v === E ? "destructive" : "default";
3493
3493
  }
3494
3494
  return "default";
3495
3495
  };
3496
3496
  return /* @__PURE__ */ a(Rt, { children: [
3497
- /* @__PURE__ */ a(_, { variant: "outline", onClick: o, disabled: T, children: [
3497
+ /* @__PURE__ */ a(_, { variant: "outline", onClick: o, disabled: M, children: [
3498
3498
  /* @__PURE__ */ e(De, { className: "mr-2 h-4 w-4" }),
3499
3499
  "Close"
3500
3500
  ] }),
@@ -3502,14 +3502,14 @@ function Kr({
3502
3502
  _,
3503
3503
  {
3504
3504
  onClick: N,
3505
- disabled: !t || T,
3505
+ disabled: !t || M,
3506
3506
  variant: "default",
3507
3507
  children: [
3508
- T ? /* @__PURE__ */ a(J, { children: [
3508
+ M ? /* @__PURE__ */ a(J, { children: [
3509
3509
  /* @__PURE__ */ e(Ee, { className: "mr-2 h-4 w-4 animate-spin" }),
3510
3510
  "Updating..."
3511
3511
  ] }) : /* @__PURE__ */ e(Ta, { className: "mr-2 h-4 w-4" }),
3512
- !T && C()
3512
+ !M && C()
3513
3513
  ]
3514
3514
  }
3515
3515
  ) }),
@@ -3520,11 +3520,11 @@ function Kr({
3520
3520
  disabled: A(),
3521
3521
  variant: w(),
3522
3522
  children: [
3523
- T ? /* @__PURE__ */ a(J, { children: [
3523
+ M ? /* @__PURE__ */ a(J, { children: [
3524
3524
  /* @__PURE__ */ e(Ee, { className: "mr-2 h-4 w-4 animate-spin" }),
3525
3525
  "Updating..."
3526
3526
  ] }) : /* @__PURE__ */ e(je, { className: "mr-2 h-4 w-4" }),
3527
- !T && C()
3527
+ !M && C()
3528
3528
  ]
3529
3529
  }
3530
3530
  )
@@ -3541,7 +3541,7 @@ function zu({
3541
3541
  currentAllUsersShare: c
3542
3542
  }) {
3543
3543
  const u = _a(), d = Na(), m = Va(), h = ja(), p = Ba(), x = Ua();
3544
- la(), dl();
3544
+ ia(), dl();
3545
3545
  const y = _s();
3546
3546
  cs();
3547
3547
  const { buildShareData: f, validateShareData: v, isCurrentStateValid: g } = oi(), b = n || s || r, I = () => {
@@ -3563,7 +3563,7 @@ function zu({
3563
3563
  return y === w ? "Remove Access" : "Update Access";
3564
3564
  }
3565
3565
  return "Share";
3566
- }, T = () => b || !t ? !0 : !g, C = () => {
3566
+ }, M = () => b || !t ? !0 : !g, C = () => {
3567
3567
  const w = f();
3568
3568
  w && v(w) && l(w);
3569
3569
  }, A = () => {
@@ -3635,7 +3635,7 @@ function zu({
3635
3635
  _,
3636
3636
  {
3637
3637
  onClick: N,
3638
- disabled: T(),
3638
+ disabled: M(),
3639
3639
  variant: S(),
3640
3640
  children: [
3641
3641
  b ? /* @__PURE__ */ a(J, { children: [
@@ -3663,7 +3663,7 @@ function _u({
3663
3663
  onRemoveAccess: d
3664
3664
  }) {
3665
3665
  const m = ja(), h = Ba(), p = Ua();
3666
- ul(), la();
3666
+ ul(), ia();
3667
3667
  const x = () => {
3668
3668
  i({
3669
3669
  context: "group-share",
@@ -4061,7 +4061,7 @@ function ju(t, n, s, r) {
4061
4061
  t.map((v) => {
4062
4062
  var b, I;
4063
4063
  const g = (I = (b = c == null ? void 0 : c.shares) == null ? void 0 : b.specificTenantUsers) == null ? void 0 : I.find(
4064
- (T) => T.tenantUserId === v
4064
+ (M) => M.tenantUserId === v
4065
4065
  );
4066
4066
  return {
4067
4067
  scope: "specific_tenant_user",
@@ -4138,7 +4138,7 @@ function ju(t, n, s, r) {
4138
4138
  }
4139
4139
  }
4140
4140
  function Bu(t, n, s) {
4141
- const r = ba(), l = Na(), i = Pn(), o = la(), { currentUser: c } = ia(), { existingShares: u } = La({
4141
+ const r = ba(), l = Na(), i = Pn(), o = ia(), { currentUser: c } = Ht(), { existingShares: u } = La({
4142
4142
  debouncedSearchQuery: "",
4143
4143
  resourceId: t || "",
4144
4144
  resourceType: Kt.DASHBOARD,
@@ -4208,8 +4208,8 @@ function xr({
4208
4208
  onShareSuccess: r,
4209
4209
  onRemoveSuccess: l
4210
4210
  }) {
4211
- var M, D, E, P, F, R, j, K;
4212
- const { currentUser: i } = ia(), [o, c] = $e.useState("specific_users"), [u, d] = $e.useState("specific_users"), [m, h] = $e.useState("specific_groups"), p = ba(), x = Pn(), y = la(), f = to(), v = ao(), { handleShareSubmit: g, handleRemoveAccess: b } = Bu(
4211
+ var D, T, E, P, F, R, j, K;
4212
+ const { currentUser: i } = Ht(), [o, c] = $e.useState("specific_users"), [u, d] = $e.useState("specific_users"), [m, h] = $e.useState("specific_groups"), p = ba(), x = Pn(), y = ia(), f = to(), v = ao(), { handleShareSubmit: g, handleRemoveAccess: b } = Bu(
4213
4213
  t.id,
4214
4214
  (Q, $) => {
4215
4215
  f.mutate(Q, {
@@ -4229,7 +4229,7 @@ function xr({
4229
4229
  }
4230
4230
  });
4231
4231
  }
4232
- ), I = f.isPending, T = v.isPending, C = f.isPending, { existingShares: A } = La({
4232
+ ), I = f.isPending, M = v.isPending, C = f.isPending, { existingShares: A } = La({
4233
4233
  debouncedSearchQuery: "",
4234
4234
  resourceId: (t == null ? void 0 : t.id) || "",
4235
4235
  resourceType: n,
@@ -4239,7 +4239,7 @@ function xr({
4239
4239
  resourceId: (t == null ? void 0 : t.id) || "",
4240
4240
  resourceType: n,
4241
4241
  userType: "organization"
4242
- }), S = (D = (M = A == null ? void 0 : A.shares) == null ? void 0 : M.tenantWide) == null ? void 0 : D[0], w = (P = (E = N == null ? void 0 : N.shares) == null ? void 0 : E.orgUsersOnly) == null ? void 0 : P[0], L = () => {
4242
+ }), S = (T = (D = A == null ? void 0 : A.shares) == null ? void 0 : D.tenantWide) == null ? void 0 : T[0], w = (P = (E = N == null ? void 0 : N.shares) == null ? void 0 : E.orgUsersOnly) == null ? void 0 : P[0], L = () => {
4243
4243
  if (x === "org")
4244
4244
  return u;
4245
4245
  switch (y) {
@@ -4291,7 +4291,7 @@ function xr({
4291
4291
  onShareTabTypeChange: d,
4292
4292
  isSharing: I,
4293
4293
  isUpdating: C,
4294
- isRemoving: T
4294
+ isRemoving: M
4295
4295
  }
4296
4296
  ) }) }),
4297
4297
  /* @__PURE__ */ e(
@@ -4310,7 +4310,7 @@ function xr({
4310
4310
  ),
4311
4311
  isSharing: I,
4312
4312
  isUpdating: C,
4313
- isRemoving: T
4313
+ isRemoving: M
4314
4314
  }
4315
4315
  ) })
4316
4316
  }
@@ -4329,7 +4329,7 @@ function xr({
4329
4329
  onShareTabTypeChange: h,
4330
4330
  isSharing: I,
4331
4331
  isUpdating: C,
4332
- isRemoving: T
4332
+ isRemoving: M
4333
4333
  }
4334
4334
  ) })
4335
4335
  }
@@ -4348,7 +4348,7 @@ function xr({
4348
4348
  onShareTabTypeChange: (Q) => c(Q),
4349
4349
  isSharing: I,
4350
4350
  isUpdating: C,
4351
- isRemoving: T
4351
+ isRemoving: M
4352
4352
  }
4353
4353
  ) }) })
4354
4354
  ),
@@ -4360,7 +4360,7 @@ function xr({
4360
4360
  resource: t,
4361
4361
  existingShares: N,
4362
4362
  isSharing: I,
4363
- isRemoving: T,
4363
+ isRemoving: M,
4364
4364
  isUpdating: C,
4365
4365
  onShare: g,
4366
4366
  onClose: s,
@@ -4376,7 +4376,7 @@ function xr({
4376
4376
  resource: t,
4377
4377
  existingShares: A,
4378
4378
  isSharing: I,
4379
- isRemoving: T,
4379
+ isRemoving: M,
4380
4380
  isUpdating: C,
4381
4381
  onShare: g,
4382
4382
  onClose: s,
@@ -4393,7 +4393,7 @@ function xr({
4393
4393
  resource: t,
4394
4394
  existingShares: N,
4395
4395
  isSharing: I,
4396
- isRemoving: T,
4396
+ isRemoving: M,
4397
4397
  isUpdating: C,
4398
4398
  onShare: g,
4399
4399
  onClose: s,
@@ -4410,7 +4410,7 @@ function xr({
4410
4410
  {
4411
4411
  resource: t,
4412
4412
  isSharing: I,
4413
- isRemoving: T,
4413
+ isRemoving: M,
4414
4414
  isUpdating: C,
4415
4415
  onShare: g,
4416
4416
  onClose: s,
@@ -4676,25 +4676,25 @@ function Zu({
4676
4676
  tenantId: s.tenantId || void 0,
4677
4677
  active: !0,
4678
4678
  limit: 100
4679
- }), b = Ju(), I = Hu(), T = (p == null ? void 0 : p.members) || [], C = Ve(() => new Set(T.map((M) => M.userId)), [T]), A = Ve(() => v.filter((M) => !C.has(M.id)), [v, C]), N = Ve(() => {
4679
+ }), b = Ju(), I = Hu(), M = (p == null ? void 0 : p.members) || [], C = Ve(() => new Set(M.map((D) => D.userId)), [M]), A = Ve(() => v.filter((D) => !C.has(D.id)), [v, C]), N = Ve(() => {
4680
4680
  if (!o) return A;
4681
- const M = o.toLowerCase();
4681
+ const D = o.toLowerCase();
4682
4682
  return A.filter(
4683
- (D) => {
4683
+ (T) => {
4684
4684
  var E, P;
4685
- return ((E = D.name) == null ? void 0 : E.toLowerCase().includes(M)) || ((P = D.email) == null ? void 0 : P.toLowerCase().includes(M));
4685
+ return ((E = T.name) == null ? void 0 : E.toLowerCase().includes(D)) || ((P = T.email) == null ? void 0 : P.toLowerCase().includes(D));
4686
4686
  }
4687
4687
  );
4688
4688
  }, [A, o]), S = Ve(() => {
4689
- if (!o) return T;
4690
- const M = o.toLowerCase();
4691
- return T.filter(
4692
- (D) => {
4689
+ if (!o) return M;
4690
+ const D = o.toLowerCase();
4691
+ return M.filter(
4692
+ (T) => {
4693
4693
  var E, P, F, R;
4694
- return ((P = (E = D.user) == null ? void 0 : E.name) == null ? void 0 : P.toLowerCase().includes(M)) || ((R = (F = D.user) == null ? void 0 : F.email) == null ? void 0 : R.toLowerCase().includes(M));
4694
+ return ((P = (E = T.user) == null ? void 0 : E.name) == null ? void 0 : P.toLowerCase().includes(D)) || ((R = (F = T.user) == null ? void 0 : F.email) == null ? void 0 : R.toLowerCase().includes(D));
4695
4695
  }
4696
4696
  );
4697
- }, [T, o]), w = async () => {
4697
+ }, [M, o]), w = async () => {
4698
4698
  if (u.length !== 0)
4699
4699
  try {
4700
4700
  await b.mutateAsync({
@@ -4704,8 +4704,8 @@ function Zu({
4704
4704
  userType: f === "tenant" ? "tenant" : "org"
4705
4705
  }
4706
4706
  }), d([]), i("members"), y(), r == null || r();
4707
- } catch (M) {
4708
- console.error("Failed to add members:", M);
4707
+ } catch (D) {
4708
+ console.error("Failed to add members:", D);
4709
4709
  }
4710
4710
  }, L = async () => {
4711
4711
  if (m.length !== 0)
@@ -4716,25 +4716,25 @@ function Zu({
4716
4716
  userIds: m
4717
4717
  }
4718
4718
  }), h([]), y(), r == null || r();
4719
- } catch (M) {
4720
- console.error("Failed to remove members:", M);
4719
+ } catch (D) {
4720
+ console.error("Failed to remove members:", D);
4721
4721
  }
4722
- }, k = (M) => {
4722
+ }, k = (D) => {
4723
4723
  d(
4724
- (D) => D.includes(M) ? D.filter((E) => E !== M) : [...D, M]
4724
+ (T) => T.includes(D) ? T.filter((E) => E !== D) : [...T, D]
4725
4725
  );
4726
- }, z = (M) => {
4726
+ }, z = (D) => {
4727
4727
  h(
4728
- (D) => D.includes(M) ? D.filter((E) => E !== M) : [...D, M]
4728
+ (T) => T.includes(D) ? T.filter((E) => E !== D) : [...T, D]
4729
4729
  );
4730
4730
  };
4731
4731
  return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(rt, { open: t, onOpenChange: n, children: /* @__PURE__ */ a(lt, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
4732
4732
  /* @__PURE__ */ a(it, { children: [
4733
4733
  /* @__PURE__ */ e(ot, { children: s.name }),
4734
4734
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
4735
- T.length,
4735
+ M.length,
4736
4736
  " ",
4737
- T.length === 1 ? "member" : "members"
4737
+ M.length === 1 ? "member" : "members"
4738
4738
  ] }) }),
4739
4739
  /* @__PURE__ */ a("p", { id: "group-members-description", className: "sr-only", children: [
4740
4740
  "Add or remove members from the ",
@@ -4742,8 +4742,8 @@ function Zu({
4742
4742
  " group"
4743
4743
  ] })
4744
4744
  ] }),
4745
- /* @__PURE__ */ a(Ct, { value: l, onValueChange: (M) => {
4746
- i(M), c(""), h([]);
4745
+ /* @__PURE__ */ a(Ct, { value: l, onValueChange: (D) => {
4746
+ i(D), c(""), h([]);
4747
4747
  }, className: "mt-4", children: [
4748
4748
  /* @__PURE__ */ a(wt, { className: "grid w-full grid-cols-2", children: [
4749
4749
  /* @__PURE__ */ e(Re, { value: "members", children: "Current Members" }),
@@ -4757,23 +4757,23 @@ function Zu({
4757
4757
  {
4758
4758
  placeholder: "Search members...",
4759
4759
  value: o,
4760
- onChange: (M) => c(M.target.value),
4760
+ onChange: (D) => c(D.target.value),
4761
4761
  className: "pl-10"
4762
4762
  }
4763
4763
  )
4764
4764
  ] }),
4765
- /* @__PURE__ */ e(st, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: x ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((M) => /* @__PURE__ */ e(Aa, { className: "h-16 w-full" }, M)) }) : S.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
4765
+ /* @__PURE__ */ e(st, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: x ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Aa, { className: "h-16 w-full" }, D)) }) : S.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
4766
4766
  /* @__PURE__ */ e(je, { className: "h-12 w-12 mb-3 opacity-50" }),
4767
4767
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: o ? "No members found" : "No members yet" }),
4768
4768
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: o ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
4769
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: S.map((M) => /* @__PURE__ */ e(
4769
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: S.map((D) => /* @__PURE__ */ e(
4770
4770
  Xu,
4771
4771
  {
4772
- member: M,
4773
- selected: m.includes(M.userId),
4774
- onToggle: () => z(M.userId)
4772
+ member: D,
4773
+ selected: m.includes(D.userId),
4774
+ onToggle: () => z(D.userId)
4775
4775
  },
4776
- M.id
4776
+ D.id
4777
4777
  )) }) }),
4778
4778
  m.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
4779
4779
  /* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
@@ -4808,23 +4808,23 @@ function Zu({
4808
4808
  {
4809
4809
  placeholder: "Search users to add...",
4810
4810
  value: o,
4811
- onChange: (M) => c(M.target.value),
4811
+ onChange: (D) => c(D.target.value),
4812
4812
  className: "pl-10"
4813
4813
  }
4814
4814
  )
4815
4815
  ] }),
4816
- /* @__PURE__ */ e(st, { className: "h-[300px]", children: g ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((M) => /* @__PURE__ */ e(Aa, { className: "h-16 w-full" }, M)) }) : N.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
4816
+ /* @__PURE__ */ e(st, { className: "h-[300px]", children: g ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Aa, { className: "h-16 w-full" }, D)) }) : N.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
4817
4817
  /* @__PURE__ */ e(As, { className: "h-12 w-12 mb-3 opacity-50" }),
4818
4818
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
4819
4819
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: o ? "Try a different search" : "All eligible users are already members" })
4820
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: N.map((M) => /* @__PURE__ */ e(
4820
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: N.map((D) => /* @__PURE__ */ e(
4821
4821
  em,
4822
4822
  {
4823
- user: M,
4824
- selected: u.includes(M.id),
4825
- onToggle: () => k(M.id)
4823
+ user: D,
4824
+ selected: u.includes(D.id),
4825
+ onToggle: () => k(D.id)
4826
4826
  },
4827
- M.id
4827
+ D.id
4828
4828
  )) }) }),
4829
4829
  u.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
4830
4830
  /* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
@@ -4902,11 +4902,11 @@ function tm({
4902
4902
  open: t,
4903
4903
  onOpenChange: n
4904
4904
  }) {
4905
- const [s, r] = V("groups"), [l, i] = V(""), [o, c] = V(null), [u, d] = V(!1), [m, h] = V(null), { tokenProps: p } = Xe(), { currentUser: x } = ia(), y = Wu(), f = (x == null ? void 0 : x.type) === "tenant", v = p == null ? void 0 : p.tenantId, { groups: g, isLoading: b, refetch: I } = no({
4905
+ const [s, r] = V("groups"), [l, i] = V(""), [o, c] = V(null), [u, d] = V(!1), [m, h] = V(null), { tokenProps: p } = Xe(), { currentUser: x } = Ht(), y = Wu(), f = (x == null ? void 0 : x.type) === "tenant", v = p == null ? void 0 : p.tenantId, { groups: g, isLoading: b, refetch: I } = no({
4906
4906
  type: f ? "TENANT_GROUP" : "all",
4907
4907
  tenantId: f ? v : void 0,
4908
4908
  includeMembers: !1
4909
- }), T = g.filter(
4909
+ }), M = g.filter(
4910
4910
  (S) => {
4911
4911
  var w;
4912
4912
  return S.name.toLowerCase().includes(l.toLowerCase()) || ((w = S.description) == null ? void 0 : w.toLowerCase().includes(l.toLowerCase()));
@@ -4956,11 +4956,11 @@ function tm({
4956
4956
  }
4957
4957
  )
4958
4958
  ] }),
4959
- /* @__PURE__ */ e(st, { className: "h-[400px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((S) => /* @__PURE__ */ e(Aa, { className: "h-24 w-full" }, S)) }) : T.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
4959
+ /* @__PURE__ */ e(st, { className: "h-[400px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((S) => /* @__PURE__ */ e(Aa, { className: "h-24 w-full" }, S)) }) : M.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
4960
4960
  /* @__PURE__ */ e(je, { className: "h-12 w-12 mb-3 opacity-50" }),
4961
4961
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
4962
4962
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
4963
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: T.map((S) => /* @__PURE__ */ e(
4963
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((S) => /* @__PURE__ */ e(
4964
4964
  am,
4965
4965
  {
4966
4966
  group: S,
@@ -5276,13 +5276,13 @@ function wa() {
5276
5276
  } = ie(), {
5277
5277
  setIsDashboardEditing: b,
5278
5278
  setIsVisualEditing: I,
5279
- setSelectedFrameId: T,
5279
+ setSelectedFrameId: M,
5280
5280
  clearSelectedFrameId: C,
5281
5281
  addFrame: A,
5282
5282
  setIsDashboardPanelOpen: N
5283
5283
  } = pt(), S = X((E) => E.selectedSheetId), w = X((E) => E.selectedFrameId), L = X((E) => E.dashboard), k = X((E) => E.filterValues), z = ro((r == null ? void 0 : r.id) || "", {
5284
5284
  enabled: !!(r != null && r.id) && !!(t != null && t.accessToken)
5285
- }), M = Se(
5285
+ }), D = Se(
5286
5286
  async (E) => {
5287
5287
  try {
5288
5288
  l(E), C();
@@ -5345,7 +5345,7 @@ function wa() {
5345
5345
  w,
5346
5346
  k
5347
5347
  ]
5348
- ), D = Se(
5348
+ ), T = Se(
5349
5349
  async (E) => {
5350
5350
  var P;
5351
5351
  try {
@@ -5371,7 +5371,7 @@ function wa() {
5371
5371
  visualId: E.id
5372
5372
  // Link this frame to the library visual
5373
5373
  };
5374
- return A(S, Q, "end"), b(!0), T(Q.id), N(!1), { success: !0, fromCache: R };
5374
+ return A(S, Q, "end"), b(!0), M(Q.id), N(!1), { success: !0, fromCache: R };
5375
5375
  } catch (F) {
5376
5376
  return console.error("Error adding visual:", F), { success: !1, error: "Failed to add visual to dashboard" };
5377
5377
  }
@@ -5384,7 +5384,7 @@ function wa() {
5384
5384
  S,
5385
5385
  A,
5386
5386
  b,
5387
- T,
5387
+ M,
5388
5388
  N
5389
5389
  ]
5390
5390
  );
@@ -5393,8 +5393,8 @@ function wa() {
5393
5393
  isLoading: z.isLoading,
5394
5394
  isError: z.isError,
5395
5395
  error: z.error,
5396
- handleEditLibraryVisual: M,
5397
- handleAddLibraryVisual: D,
5396
+ handleEditLibraryVisual: D,
5397
+ handleAddLibraryVisual: T,
5398
5398
  getUpdatedFrame: lm().getUpdatedFrame,
5399
5399
  refetch: z.refetch
5400
5400
  };
@@ -5749,15 +5749,15 @@ function Hs() {
5749
5749
  );
5750
5750
  }
5751
5751
  function um() {
5752
- const [t, n] = V(!1), [s, r] = V(!1), [l, i] = V(null), o = O((T) => T.frame), c = O((T) => T.card), u = Bs(), d = X((T) => T.selectedSheetId), m = X(
5753
- (T) => T.actions.setIsDashboardPanelOpen
5754
- ), { getUpdatedFrame: h } = wa(), { selectVisual: p } = ds(), { addFrame: x, setSelectedFrameId: y, setIsVisualEditing: f } = pt(), v = !!(o != null && o.visualId), g = (u == null ? void 0 : u.title) || (c == null ? void 0 : c.title) || "Untitled Visual", b = io((T) => {
5755
- if (T != null && T.id) {
5756
- if (p(T), s && l && d) {
5752
+ const [t, n] = V(!1), [s, r] = V(!1), [l, i] = V(null), o = O((M) => M.frame), c = O((M) => M.card), u = Bs(), d = X((M) => M.selectedSheetId), m = X(
5753
+ (M) => M.actions.setIsDashboardPanelOpen
5754
+ ), { getUpdatedFrame: h } = wa(), { selectVisual: p } = ds(), { addFrame: x, setSelectedFrameId: y, setIsVisualEditing: f } = pt(), v = !!(o != null && o.visualId), g = (u == null ? void 0 : u.title) || (c == null ? void 0 : c.title) || "Untitled Visual", b = io((M) => {
5755
+ if (M != null && M.id) {
5756
+ if (p(M), s && l && d) {
5757
5757
  const C = {
5758
5758
  ...l,
5759
5759
  id: It(),
5760
- visualId: T.id
5760
+ visualId: M.id
5761
5761
  // Link to the newly created library visual
5762
5762
  };
5763
5763
  x(d, C, "end"), y(C.id), r(!1), i(null), f(!1);
@@ -5768,22 +5768,22 @@ function um() {
5768
5768
  return {
5769
5769
  saveAsDialogOpen: t,
5770
5770
  setSaveAsDialogOpen: n,
5771
- handleSaveAs: async (T) => {
5771
+ handleSaveAs: async (M) => {
5772
5772
  if (!d) {
5773
5773
  he.error("No sheet selected");
5774
5774
  return;
5775
5775
  }
5776
5776
  const C = h();
5777
- if (T.saveToLibrary) {
5778
- r(T.saveToCurrentDashboard), i(C);
5777
+ if (M.saveToLibrary) {
5778
+ r(M.saveToCurrentDashboard), i(C);
5779
5779
  const A = {
5780
- title: T.name,
5781
- description: T.description,
5780
+ title: M.name,
5781
+ description: M.description,
5782
5782
  frameObject: C,
5783
5783
  isPrivate: !1
5784
5784
  };
5785
5785
  b.mutate(A);
5786
- } else if (T.saveToCurrentDashboard) {
5786
+ } else if (M.saveToCurrentDashboard) {
5787
5787
  const A = {
5788
5788
  ...C,
5789
5789
  id: It(),
@@ -5791,7 +5791,7 @@ function um() {
5791
5791
  // Explicitly no visualId for local visuals
5792
5792
  cards: C.cards.map((N) => ({
5793
5793
  ...N,
5794
- title: N.id === c.id ? T.name : N.title
5794
+ title: N.id === c.id ? M.name : N.title
5795
5795
  }))
5796
5796
  };
5797
5797
  x(d, A, "end"), y(A.id), he.success("Visual saved to dashboard"), n(!1), f(!1);
@@ -5938,7 +5938,7 @@ function pm() {
5938
5938
  (Z) => Z.isDashboardEditing
5939
5939
  ), [p, x] = V(!1), [y, f] = V(!1), [v, g] = V(!1), b = X((Z) => Z.isDashboardPanelOpen), I = X(
5940
5940
  (Z) => Z.actions.setIsDashboardPanelOpen
5941
- ), T = X((Z) => Z.filterValues), C = X((Z) => Z.isVisualEditing), A = O((Z) => Z.card), N = Dt(
5941
+ ), M = X((Z) => Z.filterValues), C = X((Z) => Z.isVisualEditing), A = O((Z) => Z.card), N = Dt(
5942
5942
  (Z) => Z.selectedDashboard
5943
5943
  ), S = Dt(
5944
5944
  (Z) => Z.initialDashboard
@@ -5946,13 +5946,13 @@ function pm() {
5946
5946
  X((Z) => Z.selectedFrameId), O((Z) => Z.frame);
5947
5947
  const L = N ? (Pe = N == null ? void 0 : N.permissions) == null ? void 0 : Pe.canEdit : (He = S == null ? void 0 : S.permissions) == null ? void 0 : He.canEdit, k = X((Z) => Z.showFilters), z = X(
5948
5948
  (Z) => Z.showDashboardJSON
5949
- ), M = X((Z) => Z.onSaveFunction), D = X(
5949
+ ), D = X((Z) => Z.onSaveFunction), T = X(
5950
5950
  (Z) => Z.actions.setShowFilters
5951
5951
  ), { setIsDashboardEditing: E, setShowDashboardJSON: P } = X(
5952
5952
  (Z) => Z.actions
5953
5953
  ), { setInitialDashboard: F, clearSelectedDashboard: R } = Dt(
5954
5954
  (Z) => Z.actions
5955
- ), { resources: j } = co(Kt.DASHBOARD), { currentUser: K } = ia(), Q = uo(K), $ = N || S, ne = $ ? {
5955
+ ), { resources: j } = co(Kt.DASHBOARD), { currentUser: K } = Ht(), Q = uo(K), $ = N || S, ne = $ ? {
5956
5956
  id: $.id,
5957
5957
  title: (m == null ? void 0 : m.title) || $.title || "Dashboard"
5958
5958
  } : null, { handleAddNewFrame: ee } = mo(), [de, H] = V(!1), me = ho(Kt.DASHBOARD);
@@ -6000,13 +6000,13 @@ function pm() {
6000
6000
  ), B = JSON.stringify(Z), ce = {
6001
6001
  ...d,
6002
6002
  template: B,
6003
- filterValues: T
6003
+ filterValues: M
6004
6004
  };
6005
6005
  await yn(
6006
6006
  n.apiServiceUrl,
6007
6007
  ce,
6008
6008
  t == null ? void 0 : t.accessToken
6009
- ), he.success("Lens saved"), M == null || M(Z), x(!1);
6009
+ ), he.success("Lens saved"), D == null || D(Z), x(!1);
6010
6010
  }
6011
6011
  const q = (d == null ? void 0 : d.name) || m.title, Fe = j && j.length > 0 && (n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail), be = N && !(n != null && n.dashboard_id) && !s;
6012
6012
  return /* @__PURE__ */ a(
@@ -6085,7 +6085,7 @@ function pm() {
6085
6085
  {
6086
6086
  className: "h-7 p-2",
6087
6087
  variant: "outline",
6088
- onClick: () => D(!0),
6088
+ onClick: () => T(!0),
6089
6089
  size: "sm",
6090
6090
  children: /* @__PURE__ */ e(Os, { className: "h-4 w-4" })
6091
6091
  }
@@ -6233,7 +6233,7 @@ function fm({
6233
6233
  }
6234
6234
  ) }),
6235
6235
  /* @__PURE__ */ e(
6236
- Ht,
6236
+ Qt,
6237
6237
  {
6238
6238
  className: "w-full p-0",
6239
6239
  style: { minWidth: x },
@@ -6377,10 +6377,10 @@ function gm({ column: t }) {
6377
6377
  (f) => f.selectedDatamodelId
6378
6378
  ), c = O((f) => f.sqlGen), { modelItems: u, connectionType: d } = jt(), m = O((f) => f.actions.setSqlGen), h = O((f) => f.actions.setCardSql), p = O((f) => f.actions.setRunSql);
6379
6379
  function x(f, v) {
6380
- var T;
6381
- const g = gl(f, c, v), b = (T = u == null ? void 0 : u.find(
6380
+ var M;
6381
+ const g = gl(f, c, v), b = (M = u == null ? void 0 : u.find(
6382
6382
  (C) => C.id === o
6383
- )) == null ? void 0 : T.name;
6383
+ )) == null ? void 0 : M.name;
6384
6384
  m(g);
6385
6385
  const I = xl(
6386
6386
  g,
@@ -6476,8 +6476,8 @@ function vm({ id: t, children: n, type: s = "column" }) {
6476
6476
  data: { type: s }
6477
6477
  // Tag as a column from the left-hand side
6478
6478
  }), c = o ? {
6479
- translate: sa.Translate.toString(o),
6480
- transform: sa.Transform.toString(o)
6479
+ translate: na.Translate.toString(o),
6480
+ transform: na.Transform.toString(o)
6481
6481
  } : void 0;
6482
6482
  return /* @__PURE__ */ e(
6483
6483
  "div",
@@ -6494,7 +6494,7 @@ function ym({
6494
6494
  onClick: t,
6495
6495
  column: n
6496
6496
  }) {
6497
- const s = ta((m) => m.activeId), r = O(
6497
+ const s = aa((m) => m.activeId), r = O(
6498
6498
  (m) => {
6499
6499
  var h;
6500
6500
  return (h = m.card.queryConfig) == null ? void 0 : h.groupByColumns;
@@ -6570,30 +6570,30 @@ const an = {
6570
6570
  id: "__placeholder__"
6571
6571
  }, pa = "droppable-group-by", fa = "droppable-metrics", ga = "droppable-pivot-by", Ls = "sortable-group-by", Nn = "sortable-metrics", zs = "sortable-pivot-by", bn = "droppable-filters", Cn = "sortable-filters", yr = "sortable-order-by";
6572
6572
  function Nm() {
6573
- const t = ta((D) => D.insertIndex), n = O(
6574
- (D) => {
6573
+ const t = aa((T) => T.insertIndex), n = O(
6574
+ (T) => {
6575
6575
  var E;
6576
- return ((E = D.card.queryConfig) == null ? void 0 : E.groupByColumns) || [];
6576
+ return ((E = T.card.queryConfig) == null ? void 0 : E.groupByColumns) || [];
6577
6577
  }
6578
6578
  ), s = O(
6579
- (D) => {
6579
+ (T) => {
6580
6580
  var E;
6581
- return ((E = D.card.queryConfig) == null ? void 0 : E.metricColumns) || [];
6581
+ return ((E = T.card.queryConfig) == null ? void 0 : E.metricColumns) || [];
6582
6582
  }
6583
6583
  ), r = O(
6584
- (D) => {
6584
+ (T) => {
6585
6585
  var E;
6586
- return ((E = D.card.queryConfig) == null ? void 0 : E.filterColumns) || [];
6586
+ return ((E = T.card.queryConfig) == null ? void 0 : E.filterColumns) || [];
6587
6587
  }
6588
6588
  ), l = O(
6589
- (D) => {
6589
+ (T) => {
6590
6590
  var E;
6591
- return ((E = D.card.queryConfig) == null ? void 0 : E.orderBy) || [];
6591
+ return ((E = T.card.queryConfig) == null ? void 0 : E.orderBy) || [];
6592
6592
  }
6593
6593
  ), i = O(
6594
- (D) => {
6594
+ (T) => {
6595
6595
  var E;
6596
- return ((E = D.card.queryConfig) == null ? void 0 : E.pivotColumns) || [];
6596
+ return ((E = T.card.queryConfig) == null ? void 0 : E.pivotColumns) || [];
6597
6597
  }
6598
6598
  ), {
6599
6599
  setInsertIndex: o,
@@ -6609,21 +6609,21 @@ function Nm() {
6609
6609
  setOrderByColumns: f,
6610
6610
  setPivotByColumns: v
6611
6611
  } = ie(), { columns: g } = yl(), { formattedTableName: b } = jt(), I = Xa(
6612
- Xt(xo, {
6612
+ ea(xo, {
6613
6613
  activationConstraint: {
6614
6614
  distance: 1
6615
6615
  }
6616
6616
  })
6617
6617
  // Add other sensors if needed
6618
- ), T = (D) => {
6618
+ ), M = (T) => {
6619
6619
  var F;
6620
- const { active: E, over: P } = D;
6620
+ const { active: E, over: P } = T;
6621
6621
  if (((F = E.data.current) == null ? void 0 : F.type) === "column" && P) {
6622
6622
  const R = P.id, j = g.find(
6623
6623
  (ne) => ne.column_name === E.id
6624
6624
  );
6625
6625
  if (!j) return;
6626
- const K = aa(j.data_type), Q = Ut(j.data_type), $ = Gt(j.data_type);
6626
+ const K = sa(j.data_type), Q = Ut(j.data_type), $ = Gt(j.data_type);
6627
6627
  if (Q || $) {
6628
6628
  if (n.some(
6629
6629
  (ee) => ee.id === R
@@ -6696,15 +6696,15 @@ function Nm() {
6696
6696
  } else
6697
6697
  u(n), d(s), m(r), h(i);
6698
6698
  };
6699
- function C(D) {
6700
- c(D.active.id), o(null), u(n), d(s), m(r), h(i);
6699
+ function C(T) {
6700
+ c(T.active.id), o(null), u(n), d(s), m(r), h(i);
6701
6701
  }
6702
- function A(D) {
6703
- return !r.some((E) => E.name === D.column_name);
6702
+ function A(T) {
6703
+ return !r.some((E) => E.name === T.column_name);
6704
6704
  }
6705
- function N(D, E = "SUM") {
6706
- const { column_name: P, data_type: F } = D, R = [...s], j = t !== null ? t : s.length, K = {
6707
- ...D,
6705
+ function N(T, E = "SUM") {
6706
+ const { column_name: P, data_type: F } = T, R = [...s], j = t !== null ? t : s.length, K = {
6707
+ ...T,
6708
6708
  id: kt(P),
6709
6709
  // Unique ID
6710
6710
  name: P,
@@ -6715,77 +6715,77 @@ function Nm() {
6715
6715
  };
6716
6716
  R.splice(j, 0, K), x(R);
6717
6717
  }
6718
- function S(D) {
6719
- const E = Ut(D.data_type);
6720
- Gt(D.data_type);
6718
+ function S(T) {
6719
+ const E = Ut(T.data_type);
6720
+ Gt(T.data_type);
6721
6721
  const P = [...i], F = t !== null ? t : i.length;
6722
6722
  let R;
6723
6723
  E ? R = {
6724
- ...D,
6725
- id: kt(D.column_name),
6724
+ ...T,
6725
+ id: kt(T.column_name),
6726
6726
  // Unique ID
6727
- name: D.column_name,
6728
- type: D.data_type,
6727
+ name: T.column_name,
6728
+ type: T.data_type,
6729
6729
  role: "groupby"
6730
6730
  } : R = {
6731
- ...D,
6732
- id: kt(D.column_name),
6731
+ ...T,
6732
+ id: kt(T.column_name),
6733
6733
  // Unique ID
6734
- name: D.column_name,
6735
- type: D.data_type,
6734
+ name: T.column_name,
6735
+ type: T.data_type,
6736
6736
  role: "groupby",
6737
- label: za(D.column_name, "month"),
6737
+ label: za(T.column_name, "month"),
6738
6738
  granularity: "month"
6739
6739
  }, P.splice(F, 0, R), v(P);
6740
6740
  }
6741
- function w(D) {
6742
- const E = Ut(D.data_type);
6743
- Gt(D.data_type);
6741
+ function w(T) {
6742
+ const E = Ut(T.data_type);
6743
+ Gt(T.data_type);
6744
6744
  const P = [...n], F = t !== null ? t : n.length;
6745
6745
  let R;
6746
6746
  E ? R = {
6747
- ...D,
6748
- id: kt(D.column_name),
6747
+ ...T,
6748
+ id: kt(T.column_name),
6749
6749
  // Unique ID
6750
- name: D.column_name,
6751
- type: D.data_type,
6750
+ name: T.column_name,
6751
+ type: T.data_type,
6752
6752
  role: "groupby"
6753
6753
  } : R = {
6754
- ...D,
6755
- id: kt(D.column_name),
6754
+ ...T,
6755
+ id: kt(T.column_name),
6756
6756
  // Unique ID
6757
- name: D.column_name,
6758
- type: D.data_type,
6757
+ name: T.column_name,
6758
+ type: T.data_type,
6759
6759
  role: "groupby",
6760
- label: za(D.column_name, "month"),
6760
+ label: za(T.column_name, "month"),
6761
6761
  granularity: "month"
6762
6762
  }, P.splice(F, 0, R), p(P);
6763
6763
  }
6764
- function L(D) {
6764
+ function L(T) {
6765
6765
  const E = [...r], P = t !== null ? t : r.length, F = {
6766
- ...D,
6767
- id: kt(D.column_name),
6766
+ ...T,
6767
+ id: kt(T.column_name),
6768
6768
  // Unique ID
6769
- name: D.column_name,
6770
- type: D.data_type,
6769
+ name: T.column_name,
6770
+ type: T.data_type,
6771
6771
  sql: un(
6772
- D.data_type,
6772
+ T.data_type,
6773
6773
  b,
6774
- Tt(D.column_name)
6774
+ Tt(T.column_name)
6775
6775
  ),
6776
6776
  role: "filter"
6777
6777
  };
6778
6778
  E.splice(P, 0, F), y(E);
6779
6779
  }
6780
- function k(D) {
6780
+ function k(T) {
6781
6781
  var R, j, K, Q, $, ne, ee, de;
6782
- const { active: E, over: P } = D, F = E.data.current;
6782
+ const { active: E, over: P } = T, F = E.data.current;
6783
6783
  if ((F == null ? void 0 : F.type) === "column" && P) {
6784
6784
  const H = g.find(
6785
6785
  (Ne) => Ne.column_name === E.id
6786
6786
  );
6787
6787
  if (!H) return;
6788
- const me = aa(H.data_type), Y = Ut(H.data_type), W = Gt(H.data_type);
6788
+ const me = sa(H.data_type), Y = Ut(H.data_type), W = Gt(H.data_type);
6789
6789
  (Y || W) && (P.id === pa || ((R = P.data.current) == null ? void 0 : R.type) === Ls) && w(H), (Y || W) && (P.id === ga || ((j = P.data.current) == null ? void 0 : j.type) === zs) ? S(H) : (me || Y) && (P.id === fa || ((K = P.data.current) == null ? void 0 : K.type) === Nn) ? (me && N(H), Y && N(H, "COUNT")) : A(H) && (P.id === bn || ((Q = P.data.current) == null ? void 0 : Q.type) === Cn) && L(H);
6790
6790
  }
6791
6791
  if (P && (($ = P.data.current) == null ? void 0 : $.type) === Ls && n.some((H) => H.id === E.id)) {
@@ -6818,10 +6818,10 @@ function Nm() {
6818
6818
  Y.splice(me, 0, W), y(Y);
6819
6819
  }
6820
6820
  }
6821
- z(D), c(null), o(null), u(n), d(s), m(r), h(i);
6821
+ z(T), c(null), o(null), u(n), d(s), m(r), h(i);
6822
6822
  }
6823
- function z(D) {
6824
- const { active: E, over: P } = D, F = E.data.current;
6823
+ function z(T) {
6824
+ const { active: E, over: P } = T, F = E.data.current;
6825
6825
  if ((F == null ? void 0 : F.type) === yr && P) {
6826
6826
  const R = l.findIndex(
6827
6827
  (K) => Za(K.columnId) === E.id
@@ -6834,14 +6834,14 @@ function Nm() {
6834
6834
  }
6835
6835
  }
6836
6836
  }
6837
- function M() {
6837
+ function D() {
6838
6838
  c(null), o(null), u(n), d(s), m(r);
6839
6839
  }
6840
6840
  return {
6841
- handleDragOver: T,
6841
+ handleDragOver: M,
6842
6842
  handleDragEnd: k,
6843
6843
  handleDragStart: C,
6844
- handleDragCancel: M,
6844
+ handleDragCancel: D,
6845
6845
  sensors: I
6846
6846
  };
6847
6847
  }
@@ -6929,7 +6929,7 @@ function Cm({
6929
6929
  setCardSql: g,
6930
6930
  setRunSql: b,
6931
6931
  setSqlGen: I,
6932
- setIsShowingVisual: T
6932
+ setIsShowingVisual: M
6933
6933
  } = ie(), { connectionType: C, modelItems: A, selectedDatamodelName: N } = jt();
6934
6934
  function S(R) {
6935
6935
  var j;
@@ -6983,7 +6983,7 @@ function Cm({
6983
6983
  };
6984
6984
  v(K);
6985
6985
  }
6986
- if (aa(R.data_type)) {
6986
+ if (sa(R.data_type)) {
6987
6987
  const K = {
6988
6988
  ...R,
6989
6989
  role: "metric",
@@ -7005,7 +7005,7 @@ function Cm({
7005
7005
  connectionType: C,
7006
7006
  databaseName: h || ""
7007
7007
  });
7008
- T(!1);
7008
+ M(!1);
7009
7009
  const j = C === "MSSQL" ? `SELECT top 10 * FROM ${R}` : `SELECT * FROM ${R} LIMIT 10`;
7010
7010
  g(j), b(!0);
7011
7011
  }
@@ -7021,9 +7021,9 @@ function Cm({
7021
7021
  }
7022
7022
  const k = (s == null ? void 0 : s.filter(
7023
7023
  (R) => R.column_name.toLowerCase().includes(l.toLowerCase())
7024
- )) || [], z = (R) => aa(R.data_type) ? "number" : "text", M = o === "all" ? k : k.filter(
7024
+ )) || [], z = (R) => sa(R.data_type) ? "number" : "text", D = o === "all" ? k : k.filter(
7025
7025
  (R) => z(R) === o
7026
- ), D = k.filter(
7026
+ ), T = k.filter(
7027
7027
  (R) => z(R) === "text"
7028
7028
  ).length, E = k.filter(
7029
7029
  (R) => z(R) === "number"
@@ -7044,7 +7044,7 @@ function Cm({
7044
7044
  {
7045
7045
  onClick: (j) => j.stopPropagation(),
7046
7046
  className: "flex items-center justify-end",
7047
- children: aa(R.data_type) && /* @__PURE__ */ e(gm, { column: R })
7047
+ children: sa(R.data_type) && /* @__PURE__ */ e(gm, { column: R })
7048
7048
  }
7049
7049
  )
7050
7050
  ]
@@ -7117,7 +7117,7 @@ function Cm({
7117
7117
  ] }),
7118
7118
  /* @__PURE__ */ a(Re, { value: "text", className: "text-xs", children: [
7119
7119
  /* @__PURE__ */ e(Gs, { className: "size-4 shrink-0" }),
7120
- /* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: D })
7120
+ /* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: T })
7121
7121
  ] }),
7122
7122
  /* @__PURE__ */ a(Re, { value: "number", className: "text-xs", children: [
7123
7123
  /* @__PURE__ */ e(Ya, { className: "size-4 shrink-0" }),
@@ -7132,19 +7132,19 @@ function Cm({
7132
7132
  {
7133
7133
  className: "flex-1 basis-0 overflow-y-auto px-4 pt-3",
7134
7134
  children: [
7135
- M.length === 0 && l && /* @__PURE__ */ a("div", { className: "py-4 text-center text-sm text-gray-500", children: [
7135
+ D.length === 0 && l && /* @__PURE__ */ a("div", { className: "py-4 text-center text-sm text-gray-500", children: [
7136
7136
  'No fields found matching "',
7137
7137
  l,
7138
7138
  '"'
7139
7139
  ] }),
7140
- M.length === 0 && !l && o !== "all" && /* @__PURE__ */ a("div", { className: "py-4 text-center text-sm text-gray-500", children: [
7140
+ D.length === 0 && !l && o !== "all" && /* @__PURE__ */ a("div", { className: "py-4 text-center text-sm text-gray-500", children: [
7141
7141
  "No ",
7142
7142
  o,
7143
7143
  " fields found"
7144
7144
  ] }),
7145
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: M == null ? void 0 : M.map((R) => /* @__PURE__ */ e("div", { children: P(R) }, R.column_name)) }),
7146
- /* @__PURE__ */ e(na, { orientation: "vertical" }),
7147
- /* @__PURE__ */ e(na, { orientation: "horizontal" })
7145
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: D == null ? void 0 : D.map((R) => /* @__PURE__ */ e("div", { children: P(R) }, R.column_name)) }),
7146
+ /* @__PURE__ */ e(ra, { orientation: "vertical" }),
7147
+ /* @__PURE__ */ e(ra, { orientation: "horizontal" })
7148
7148
  ]
7149
7149
  }
7150
7150
  )
@@ -7171,7 +7171,7 @@ function hi({
7171
7171
  schemaItems: g,
7172
7172
  databaseItems: b,
7173
7173
  tableItems: I,
7174
- columns: T,
7174
+ columns: M,
7175
7175
  isConnectionsLoading: C,
7176
7176
  isModelsLoading: A,
7177
7177
  isConnectionsError: N,
@@ -7180,8 +7180,8 @@ function hi({
7180
7180
  isDatabaseError: L,
7181
7181
  isSchemaLoadingOrFetching: k,
7182
7182
  isSchemaError: z,
7183
- isColumnsError: M,
7184
- isColumnsLoadingOrFetching: D,
7183
+ isColumnsError: D,
7184
+ isColumnsLoadingOrFetching: T,
7185
7185
  isTableLoadingOrFetching: E,
7186
7186
  isTableError: P,
7187
7187
  connectionType: F,
@@ -7201,13 +7201,13 @@ function hi({
7201
7201
  schemaName: re
7202
7202
  } = jt(), { data: Ce, refetch: q } = qe(i);
7203
7203
  function pe() {
7204
- return t ? t(re, Ne, T) : /* @__PURE__ */ e(
7204
+ return t ? t(re, Ne, M) : /* @__PURE__ */ e(
7205
7205
  Cm,
7206
7206
  {
7207
7207
  schemaName: re,
7208
7208
  tableName: Ne,
7209
- columns: T,
7210
- status: D ? "Loading..." : M ? "Error" : "Success"
7209
+ columns: M,
7210
+ status: T ? "Loading..." : D ? "Error" : "Success"
7211
7211
  }
7212
7212
  );
7213
7213
  }
@@ -7676,7 +7676,7 @@ function Tm() {
7676
7676
  setCardType: g,
7677
7677
  setCardPython: b,
7678
7678
  runAssistant: I,
7679
- setShowAIDialog: T
7679
+ setShowAIDialog: M
7680
7680
  } = ie();
7681
7681
  O(($) => $.onSave), O(($) => $.onClose), O(($) => $.actions.setSqlGen);
7682
7682
  const C = O(($) => $.runSql), A = O(($) => $.actions.setRunSql), N = O(
@@ -7687,8 +7687,8 @@ function Tm() {
7687
7687
  isFetching: L,
7688
7688
  isSuccess: k,
7689
7689
  isError: z,
7690
- error: M,
7691
- errorSql: D,
7690
+ error: D,
7691
+ errorSql: T,
7692
7692
  queryKey: E,
7693
7693
  refetch: P,
7694
7694
  errorMessage: F
@@ -7713,7 +7713,7 @@ function Tm() {
7713
7713
  N,
7714
7714
  p,
7715
7715
  // setQueryError,
7716
- M
7716
+ D
7717
7717
  ]), ke(() => {
7718
7718
  C && (t.getQueryData(E) || P(), A(!1));
7719
7719
  }, [C, P, A, E, t]);
@@ -7726,7 +7726,7 @@ function Tm() {
7726
7726
 
7727
7727
  Error SQL:
7728
7728
 
7729
- ${D}
7729
+ ${T}
7730
7730
 
7731
7731
  Query:
7732
7732
 
@@ -7844,7 +7844,7 @@ ${d}` : ""}
7844
7844
  /* @__PURE__ */ e(
7845
7845
  gi,
7846
7846
  {
7847
- errorSql: D,
7847
+ errorSql: T,
7848
7848
  sql: S == null ? void 0 : S.sql,
7849
7849
  error: F,
7850
7850
  onDebugWithAssistant: R
@@ -7867,7 +7867,7 @@ ${d}` : ""}
7867
7867
  {
7868
7868
  disabled: c,
7869
7869
  onClick: () => {
7870
- T(!0);
7870
+ M(!0);
7871
7871
  },
7872
7872
  className: "h-9 w-full cursor-text px-3 text-left text-sm text-muted-foreground",
7873
7873
  children: c ? "" : "Type your question..."
@@ -7962,18 +7962,18 @@ function Im({ className: t }) {
7962
7962
  ) });
7963
7963
  }
7964
7964
  function Am({ card: t }) {
7965
- var I, T, C, A, N, S, w, L, k, z, M;
7965
+ var I, M, C, A, N, S, w, L, k, z, D;
7966
7966
  const [n, s] = V(!1), [r, l] = V(
7967
7967
  []
7968
- ), { authToken: i } = Xe(), { theme: o } = wn(), c = Mo(i == null ? void 0 : i.accessToken), u = X((D) => D.themeStyle), d = {
7968
+ ), { authToken: i } = Xe(), { theme: o } = wn(), c = Mo(i == null ? void 0 : i.accessToken), u = X((T) => T.themeStyle), d = {
7969
7969
  mode: o || "system",
7970
- colors: ((T = (I = u == null ? void 0 : u.chart) == null ? void 0 : I.dataset) == null ? void 0 : T.backgroundColor) || []
7970
+ colors: ((M = (I = u == null ? void 0 : u.chart) == null ? void 0 : I.dataset) == null ? void 0 : M.backgroundColor) || []
7971
7971
  };
7972
7972
  (C = t.customCardPreferences) != null && C.inputData;
7973
- const { getCard: m } = er(((A = t.customCardPreferences) == null ? void 0 : A.url) || ""), h = ((N = t.customCardPreferences) == null ? void 0 : N.visualType) || "single", p = O((D) => D.frame), { setCustomCardPreferences: x } = ie(), { data: y } = qe(t), f = Se((D, E) => {
7973
+ const { getCard: m } = er(((A = t.customCardPreferences) == null ? void 0 : A.url) || ""), h = ((N = t.customCardPreferences) == null ? void 0 : N.visualType) || "single", p = O((T) => T.frame), { setCustomCardPreferences: x } = ie(), { data: y } = qe(t), f = Se((T, E) => {
7974
7974
  l((P) => ({
7975
7975
  ...P,
7976
- [D]: E
7976
+ [T]: E
7977
7977
  }));
7978
7978
  }, []);
7979
7979
  if (!((S = t.customCardPreferences) != null && S.componentName))
@@ -7981,14 +7981,14 @@ function Am({ card: t }) {
7981
7981
  const v = m(
7982
7982
  (w = t.customCardPreferences) == null ? void 0 : w.componentName
7983
7983
  );
7984
- function g(D) {
7985
- s(D);
7984
+ function g(T) {
7985
+ s(T);
7986
7986
  }
7987
7987
  const b = Object.keys(
7988
7988
  ((L = t.customCardPreferences) == null ? void 0 : L.dataInputCardIds) || {}
7989
- ).map((D) => {
7989
+ ).map((T) => {
7990
7990
  var F, R, j;
7991
- const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[D].cardId, P = (j = p == null ? void 0 : p.cards) == null ? void 0 : j.find((K) => K.id === E);
7991
+ const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[T].cardId, P = (j = p == null ? void 0 : p.cards) == null ? void 0 : j.find((K) => K.id === E);
7992
7992
  return P || null;
7993
7993
  });
7994
7994
  return /* @__PURE__ */ e("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ a(
@@ -8010,9 +8010,9 @@ function Am({ card: t }) {
8010
8010
  v && h === "multiple" && /* @__PURE__ */ a(J, { children: [
8011
8011
  Object.keys(
8012
8012
  ((z = t.customCardPreferences) == null ? void 0 : z.dataInputCardIds) || {}
8013
- ).map((D) => {
8013
+ ).map((T) => {
8014
8014
  var F, R, j;
8015
- const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[D].cardId, P = (j = p == null ? void 0 : p.cards) == null ? void 0 : j.find(
8015
+ const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[T].cardId, P = (j = p == null ? void 0 : p.cards) == null ? void 0 : j.find(
8016
8016
  (K) => K.id === E
8017
8017
  );
8018
8018
  if (P)
@@ -8021,10 +8021,10 @@ function Am({ card: t }) {
8021
8021
  {
8022
8022
  onLoadingStatus: g,
8023
8023
  onDataChange: f,
8024
- dataInputIndex: D,
8024
+ dataInputIndex: T,
8025
8025
  card: P
8026
8026
  },
8027
- P.id + D
8027
+ P.id + T
8028
8028
  );
8029
8029
  }),
8030
8030
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e(
@@ -8033,18 +8033,18 @@ function Am({ card: t }) {
8033
8033
  theme: d,
8034
8034
  onDataChange: f,
8035
8035
  settings: b.map(
8036
- (D) => {
8036
+ (T) => {
8037
8037
  var E;
8038
- return (E = D == null ? void 0 : D.customCardPreferences) == null ? void 0 : E.settings;
8038
+ return (E = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : E.settings;
8039
8039
  }
8040
8040
  ),
8041
- data: b.map((D) => D != null && D.id ? r == null ? void 0 : r[D.id] : [])
8041
+ data: b.map((T) => T != null && T.id ? r == null ? void 0 : r[T.id] : [])
8042
8042
  }
8043
8043
  ) })
8044
8044
  ] })
8045
8045
  ]
8046
8046
  },
8047
- (M = t.customCardPreferences) == null ? void 0 : M.componentName
8047
+ (D = t.customCardPreferences) == null ? void 0 : D.componentName
8048
8048
  ) });
8049
8049
  }
8050
8050
  function vi({
@@ -8070,8 +8070,8 @@ function vi({
8070
8070
  m == null ? void 0 : m.subtotalColumns,
8071
8071
  m == null ? void 0 : m.pivotSchema,
8072
8072
  m == null ? void 0 : m.groupByColumns
8073
- ]), I = Ao(s, b), T = (w, L) => {
8074
- var z, M;
8073
+ ]), I = Ao(s, b), M = (w, L) => {
8074
+ var z, D;
8075
8075
  const k = {
8076
8076
  ...s,
8077
8077
  paginationConfig: {
@@ -8080,7 +8080,7 @@ function vi({
8080
8080
  pageSize: L
8081
8081
  }
8082
8082
  };
8083
- f(k), v(k), s.sql && ((M = (z = s.preferences) == null ? void 0 : z.tablePrefs) != null && M.enableDevModePagination) && c(!0);
8083
+ f(k), v(k), s.sql && ((D = (z = s.preferences) == null ? void 0 : z.tablePrefs) != null && D.enableDevModePagination) && c(!0);
8084
8084
  }, C = Ve(() => !s.id || !(m != null && m.records) ? null : wl({
8085
8085
  card: s,
8086
8086
  data: m == null ? void 0 : m.records,
@@ -8132,7 +8132,7 @@ function vi({
8132
8132
  card: s,
8133
8133
  data: (m == null ? void 0 : m.records) || [],
8134
8134
  paginationMetadata: y,
8135
- onPaginationChange: T,
8135
+ onPaginationChange: M,
8136
8136
  isLoading: h || p
8137
8137
  }
8138
8138
  ) });
@@ -8168,7 +8168,7 @@ function vi({
8168
8168
  groupByColumns: m == null ? void 0 : m.groupByColumns,
8169
8169
  pivotSchema: m == null ? void 0 : m.pivotSchema,
8170
8170
  paginationMetadata: y,
8171
- onPaginationChange: T,
8171
+ onPaginationChange: M,
8172
8172
  onAggregationChange: (w) => {
8173
8173
  const L = Fr(
8174
8174
  w,
@@ -8395,14 +8395,14 @@ function Fm() {
8395
8395
  } catch {
8396
8396
  d("Invalid JSON configuration");
8397
8397
  }
8398
- }, T = Object.keys(h || {}).length === 0;
8398
+ }, M = Object.keys(h || {}).length === 0;
8399
8399
  return /* @__PURE__ */ a(rt, { open: t, onOpenChange: n, children: [
8400
8400
  /* @__PURE__ */ e(rl, { asChild: !0, children: /* @__PURE__ */ e(
8401
8401
  ye,
8402
8402
  {
8403
8403
  tooltip: "Customize Visual",
8404
8404
  onClick: b,
8405
- className: T ? "" : "text-green-600 hover:text-green-700",
8405
+ className: M ? "" : "text-green-600 hover:text-green-700",
8406
8406
  children: /* @__PURE__ */ e(zo, { className: "h-4 w-4" })
8407
8407
  }
8408
8408
  ) }),
@@ -8921,13 +8921,13 @@ function jm({
8921
8921
  className: t
8922
8922
  }) {
8923
8923
  var p, x, y, f, v, g, b, I;
8924
- const n = O((T) => T.card), { setCardPreferences: s, updateCardInFrame: r, setCard: l } = ie(), [i, o] = V(!1), c = ((x = (p = n.preferences) == null ? void 0 : p.displayOptions) == null ? void 0 : x.showFilterInfo) ?? !0, u = ((f = (y = n.preferences) == null ? void 0 : y.displayOptions) == null ? void 0 : f.showCardToolbar) ?? !0, d = ((g = (v = n.preferences) == null ? void 0 : v.displayOptions) == null ? void 0 : g.showChrome) ?? !0, m = ((I = (b = n.preferences) == null ? void 0 : b.displayOptions) == null ? void 0 : I.allowScroll) ?? !0, h = (T, C) => {
8924
+ const n = O((M) => M.card), { setCardPreferences: s, updateCardInFrame: r, setCard: l } = ie(), [i, o] = V(!1), c = ((x = (p = n.preferences) == null ? void 0 : p.displayOptions) == null ? void 0 : x.showFilterInfo) ?? !0, u = ((f = (y = n.preferences) == null ? void 0 : y.displayOptions) == null ? void 0 : f.showCardToolbar) ?? !0, d = ((g = (v = n.preferences) == null ? void 0 : v.displayOptions) == null ? void 0 : g.showChrome) ?? !0, m = ((I = (b = n.preferences) == null ? void 0 : b.displayOptions) == null ? void 0 : I.allowScroll) ?? !0, h = (M, C) => {
8925
8925
  var S;
8926
8926
  const A = {
8927
8927
  ...n.preferences,
8928
8928
  displayOptions: {
8929
8929
  ...(S = n.preferences) == null ? void 0 : S.displayOptions,
8930
- [T]: C
8930
+ [M]: C
8931
8931
  }
8932
8932
  };
8933
8933
  s(A);
@@ -8951,10 +8951,10 @@ function jm({
8951
8951
  ua,
8952
8952
  {
8953
8953
  checked: c,
8954
- onCheckedChange: (T) => {
8955
- h("showFilterInfo", T);
8954
+ onCheckedChange: (M) => {
8955
+ h("showFilterInfo", M);
8956
8956
  },
8957
- onSelect: (T) => T.preventDefault(),
8957
+ onSelect: (M) => M.preventDefault(),
8958
8958
  className: "pr-2",
8959
8959
  children: [
8960
8960
  /* @__PURE__ */ e("span", { className: "flex-1", children: "Filter Info" }),
@@ -8966,10 +8966,10 @@ function jm({
8966
8966
  ua,
8967
8967
  {
8968
8968
  checked: u,
8969
- onCheckedChange: (T) => {
8970
- h("showCardToolbar", T);
8969
+ onCheckedChange: (M) => {
8970
+ h("showCardToolbar", M);
8971
8971
  },
8972
- onSelect: (T) => T.preventDefault(),
8972
+ onSelect: (M) => M.preventDefault(),
8973
8973
  className: "pr-2",
8974
8974
  children: [
8975
8975
  /* @__PURE__ */ e("span", { className: "flex-1", children: "Card Toolbar" }),
@@ -8981,10 +8981,10 @@ function jm({
8981
8981
  ua,
8982
8982
  {
8983
8983
  checked: d,
8984
- onCheckedChange: (T) => {
8985
- h("showChrome", T);
8984
+ onCheckedChange: (M) => {
8985
+ h("showChrome", M);
8986
8986
  },
8987
- onSelect: (T) => T.preventDefault(),
8987
+ onSelect: (M) => M.preventDefault(),
8988
8988
  className: "pr-2",
8989
8989
  children: [
8990
8990
  /* @__PURE__ */ e("span", { className: "flex-1", children: "Card Chrome" }),
@@ -8996,10 +8996,10 @@ function jm({
8996
8996
  ua,
8997
8997
  {
8998
8998
  checked: m,
8999
- onCheckedChange: (T) => {
9000
- h("allowScroll", T);
8999
+ onCheckedChange: (M) => {
9000
+ h("allowScroll", M);
9001
9001
  },
9002
- onSelect: (T) => T.preventDefault(),
9002
+ onSelect: (M) => M.preventDefault(),
9003
9003
  className: "pr-2",
9004
9004
  children: [
9005
9005
  /* @__PURE__ */ e("span", { className: "flex-1", children: "Allow Scroll" }),
@@ -9263,12 +9263,12 @@ function Ns({
9263
9263
  const S = JSON.stringify(p == null ? void 0 : p.records, null, 2), w = new Blob([S], { type: "application/json" }), L = URL.createObjectURL(w), k = document.createElement("a");
9264
9264
  k.href = L, k.download = `${n.title}.json`, k.click();
9265
9265
  }
9266
- function T() {
9266
+ function M() {
9267
9267
  const w = [
9268
9268
  Object.keys(
9269
- p == null ? void 0 : p.records.reduce((M, D) => ({ ...M, ...D }), {})
9269
+ p == null ? void 0 : p.records.reduce((D, T) => ({ ...D, ...T }), {})
9270
9270
  ).join(","),
9271
- ...((p == null ? void 0 : p.records) || []).map((M) => Object.values(M).join(","))
9271
+ ...((p == null ? void 0 : p.records) || []).map((D) => Object.values(D).join(","))
9272
9272
  ].join(`
9273
9273
  `), L = new Blob([w], { type: "text/csv" }), k = URL.createObjectURL(L), z = document.createElement("a");
9274
9274
  z.href = k, z.download = `${n.title}.csv`, z.click();
@@ -9299,7 +9299,7 @@ function Ns({
9299
9299
  className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
9300
9300
  variant: "ghost",
9301
9301
  size: "icon",
9302
- onClick: T,
9302
+ onClick: M,
9303
9303
  children: /* @__PURE__ */ e(Ho, { className: "size-4" })
9304
9304
  }
9305
9305
  ),
@@ -9421,7 +9421,7 @@ function Um() {
9421
9421
  /* @__PURE__ */ e("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
9422
9422
  /* @__PURE__ */ a(st, { className: "overflow-y-auto pt-1 font-mono text-xs text-foreground/90", children: [
9423
9423
  /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: n } }),
9424
- /* @__PURE__ */ e(na, { orientation: "horizontal" })
9424
+ /* @__PURE__ */ e(ra, { orientation: "horizontal" })
9425
9425
  ] })
9426
9426
  ] });
9427
9427
  }
@@ -9488,7 +9488,7 @@ function $m() {
9488
9488
  );
9489
9489
  function m(g, b) {
9490
9490
  if (!t) return;
9491
- const T = {
9491
+ const M = {
9492
9492
  ...(t == null ? void 0 : t.dataInputCardIds) || {},
9493
9493
  [g]: {
9494
9494
  cardId: b,
@@ -9497,11 +9497,11 @@ function $m() {
9497
9497
  };
9498
9498
  o({
9499
9499
  ...t,
9500
- dataInputCardIds: T
9500
+ dataInputCardIds: M
9501
9501
  });
9502
9502
  }
9503
9503
  function h(g) {
9504
- var I, T;
9504
+ var I, M;
9505
9505
  const b = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((C) => {
9506
9506
  var A;
9507
9507
  return ((A = C == null ? void 0 : C.customCardPreferences) == null ? void 0 : A.visualType) !== "multiple";
@@ -9509,7 +9509,7 @@ function $m() {
9509
9509
  value: C.id,
9510
9510
  label: C.tabTitle || C.title
9511
9511
  }));
9512
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: (T = g == null ? void 0 : g.dataInputs) == null ? void 0 : T.map((C, A) => {
9512
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: (M = g == null ? void 0 : g.dataInputs) == null ? void 0 : M.map((C, A) => {
9513
9513
  var N, S;
9514
9514
  return /* @__PURE__ */ a(
9515
9515
  "div",
@@ -9533,13 +9533,13 @@ function $m() {
9533
9533
  );
9534
9534
  }) });
9535
9535
  }
9536
- function p(g, b, I = [], T = "") {
9536
+ function p(g, b, I = [], M = "") {
9537
9537
  var C, A;
9538
9538
  return t ? g === "input" ? /* @__PURE__ */ e(
9539
9539
  Oe,
9540
9540
  {
9541
- className: `h-8 w-full ${ea}`,
9542
- value: ((C = t == null ? void 0 : t.settings) == null ? void 0 : C[b]) || T,
9541
+ className: `h-8 w-full ${ta}`,
9542
+ value: ((C = t == null ? void 0 : t.settings) == null ? void 0 : C[b]) || M,
9543
9543
  onChange: (N) => {
9544
9544
  o({
9545
9545
  ...t,
@@ -9557,7 +9557,7 @@ function $m() {
9557
9557
  className: "h-8 w-full",
9558
9558
  label: "",
9559
9559
  options: I,
9560
- value: ((A = t == null ? void 0 : t.settings) == null ? void 0 : A[b]) || T,
9560
+ value: ((A = t == null ? void 0 : t.settings) == null ? void 0 : A[b]) || M,
9561
9561
  onValueChange: (N) => {
9562
9562
  o({
9563
9563
  ...t,
@@ -9569,13 +9569,13 @@ function $m() {
9569
9569
  }
9570
9570
  function x(g) {
9571
9571
  const b = Object.entries((g == null ? void 0 : g.settings) || {});
9572
- return /* @__PURE__ */ e("div", { className: "space-y-3", children: b.map(([I, T]) => /* @__PURE__ */ a("div", { className: "space-y-1", children: [
9573
- /* @__PURE__ */ e(U, { children: T.title }),
9572
+ return /* @__PURE__ */ e("div", { className: "space-y-3", children: b.map(([I, M]) => /* @__PURE__ */ a("div", { className: "space-y-1", children: [
9573
+ /* @__PURE__ */ e(U, { children: M.title }),
9574
9574
  p(
9575
- T.ui,
9575
+ M.ui,
9576
9576
  I,
9577
- T.options,
9578
- T.defaultValue
9577
+ M.options,
9578
+ M.defaultValue
9579
9579
  )
9580
9580
  ] }, I)) });
9581
9581
  }
@@ -9821,7 +9821,7 @@ function Ym({ idx: t }) {
9821
9821
  }
9822
9822
  return /* @__PURE__ */ a(zt, { children: [
9823
9823
  /* @__PURE__ */ e(_t, { children: /* @__PURE__ */ e(Zl, { className: "size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground" }) }),
9824
- /* @__PURE__ */ e(Ht, { className: "w-fit px-2 py-1", children: /* @__PURE__ */ a("div", { className: "flex gap-1", children: [
9824
+ /* @__PURE__ */ e(Qt, { className: "w-fit px-2 py-1", children: /* @__PURE__ */ a("div", { className: "flex gap-1", children: [
9825
9825
  /* @__PURE__ */ e(
9826
9826
  "button",
9827
9827
  {
@@ -10046,16 +10046,16 @@ function Nr() {
10046
10046
  function p(x, y = "dashboard", f) {
10047
10047
  var S;
10048
10048
  const v = Tt(x.column_name), g = Tt(s || ""), b = Tt(r || ""), I = Tt(m);
10049
- let T = ac({
10049
+ let M = ac({
10050
10050
  schemaName: b,
10051
10051
  tableName: I,
10052
10052
  connectionType: h,
10053
10053
  databaseName: g
10054
- }), C = `${T}.${v}`;
10054
+ }), C = `${M}.${v}`;
10055
10055
  const A = (S = d == null ? void 0 : d.find(
10056
10056
  (w) => w.id === n
10057
10057
  )) == null ? void 0 : S.name;
10058
- n && n !== "none" && (C = `${Pr}.${A}.${v}`, T = `${Pr}.${A}`), f != null && f.qualifiedFieldName && (C = f.qualifiedFieldName), f != null && f.entityName && (T = f.entityName);
10058
+ n && n !== "none" && (C = `${Pr}.${A}.${v}`, M = `${Pr}.${A}`), f != null && f.qualifiedFieldName && (C = f.qualifiedFieldName), f != null && f.entityName && (M = f.entityName);
10059
10059
  const N = i == null ? void 0 : i.find(
10060
10060
  (w) => w.column === C && w.table === I && (w.database === g || w.database === s)
10061
10061
  );
@@ -10077,7 +10077,7 @@ function Nr() {
10077
10077
  operation: "in",
10078
10078
  sql: un(
10079
10079
  x.data_type,
10080
- T,
10080
+ M,
10081
10081
  v
10082
10082
  )
10083
10083
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
@@ -10095,7 +10095,7 @@ function Nr() {
10095
10095
  operation: "in",
10096
10096
  sql: un(
10097
10097
  x.data_type,
10098
- T,
10098
+ M,
10099
10099
  v
10100
10100
  )
10101
10101
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
@@ -10140,7 +10140,7 @@ function Km({
10140
10140
  ]
10141
10141
  }
10142
10142
  ) }),
10143
- /* @__PURE__ */ e(Ht, { className: "w-[200px] p-0", children: /* @__PURE__ */ a(us, { children: [
10143
+ /* @__PURE__ */ e(Qt, { className: "w-[200px] p-0", children: /* @__PURE__ */ a(us, { children: [
10144
10144
  /* @__PURE__ */ e(ms, { placeholder: "Search column", className: "h-9" }),
10145
10145
  /* @__PURE__ */ a(hs, { children: [
10146
10146
  /* @__PURE__ */ e(ps, { children: "No framework found." }),
@@ -10506,7 +10506,7 @@ function eh({
10506
10506
  {
10507
10507
  onChange: (u) => r(c, "start", u.target.value),
10508
10508
  value: o.start,
10509
- className: G(`h-7 ${ea}`)
10509
+ className: G(`h-7 ${ta}`)
10510
10510
  }
10511
10511
  ),
10512
10512
  /* @__PURE__ */ e("span", { children: "-" }),
@@ -10515,7 +10515,7 @@ function eh({
10515
10515
  {
10516
10516
  value: o.end,
10517
10517
  onChange: (u) => r(c, "end", u.target.value),
10518
- className: G(`h-7 ${ea}`)
10518
+ className: G(`h-7 ${ta}`)
10519
10519
  }
10520
10520
  ),
10521
10521
  /* @__PURE__ */ e(
@@ -10523,7 +10523,7 @@ function eh({
10523
10523
  {
10524
10524
  onChange: (u) => r(c, "color", u.target.value),
10525
10525
  value: o.color,
10526
- className: G(`h-7 min-w-14 p-0 ${ea}`),
10526
+ className: G(`h-7 min-w-14 p-0 ${ta}`),
10527
10527
  type: "color",
10528
10528
  list: "presetColors"
10529
10529
  }
@@ -10865,7 +10865,7 @@ const sh = [
10865
10865
  value: t
10866
10866
  }));
10867
10867
  function lh() {
10868
- var u, d, m, h, p, x, y, f, v, g, b, I, T, C, A, N, S, w;
10868
+ var u, d, m, h, p, x, y, f, v, g, b, I, M, C, A, N, S, w;
10869
10869
  const t = O((L) => L.card), n = (d = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : d.topoJsonUrl, [s, r] = V(
10870
10870
  ((h = (m = t == null ? void 0 : t.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : h.customTopoJsonUrl) || ""
10871
10871
  ), { setCardPreferences: l } = ie(), { data: i } = tr(t), o = Object.keys((i == null ? void 0 : i.objects) || {}).map((L) => ({
@@ -10924,7 +10924,7 @@ function lh() {
10924
10924
  });
10925
10925
  },
10926
10926
  value: s,
10927
- className: `h-9 w-full ${ea}`,
10927
+ className: `h-9 w-full ${ta}`,
10928
10928
  placeholder: "Custom URL"
10929
10929
  }
10930
10930
  ),
@@ -11002,7 +11002,7 @@ function lh() {
11002
11002
  /* @__PURE__ */ e(
11003
11003
  Oe,
11004
11004
  {
11005
- className: `h-9 w-full ${ea}`,
11005
+ className: `h-9 w-full ${ta}`,
11006
11006
  type: "number",
11007
11007
  step: 0.1,
11008
11008
  value: ((I = (b = t.preferences) == null ? void 0 : b.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
@@ -11022,19 +11022,19 @@ function lh() {
11022
11022
  /* @__PURE__ */ e(
11023
11023
  Oe,
11024
11024
  {
11025
- className: `h-9 w-full ${ea}`,
11025
+ className: `h-9 w-full ${ta}`,
11026
11026
  type: "number",
11027
11027
  step: 10,
11028
- value: ((A = (C = (T = t.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : C.projectionOffset) == null ? void 0 : A[0]) || 0,
11028
+ value: ((A = (C = (M = t.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : C.projectionOffset) == null ? void 0 : A[0]) || 0,
11029
11029
  onChange: (L) => {
11030
- var k, z, M, D;
11030
+ var k, z, D, T;
11031
11031
  l({
11032
11032
  ...t.preferences,
11033
11033
  mapVisualOptions: {
11034
11034
  ...(k = t.preferences) == null ? void 0 : k.mapVisualOptions,
11035
11035
  projectionOffset: [
11036
11036
  Number(L.target.value),
11037
- ((D = (M = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : M.projectionOffset) == null ? void 0 : D[1]) || 0
11037
+ ((T = (D = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : D.projectionOffset) == null ? void 0 : T[1]) || 0
11038
11038
  ]
11039
11039
  }
11040
11040
  });
@@ -11045,18 +11045,18 @@ function lh() {
11045
11045
  /* @__PURE__ */ e(
11046
11046
  Oe,
11047
11047
  {
11048
- className: `h-9 w-full ${ea}`,
11048
+ className: `h-9 w-full ${ta}`,
11049
11049
  type: "number",
11050
11050
  step: 10,
11051
11051
  value: ((w = (S = (N = t.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : S.projectionOffset) == null ? void 0 : w[1]) || 0,
11052
11052
  onChange: (L) => {
11053
- var k, z, M, D;
11053
+ var k, z, D, T;
11054
11054
  l({
11055
11055
  ...t.preferences,
11056
11056
  mapVisualOptions: {
11057
11057
  ...(k = t.preferences) == null ? void 0 : k.mapVisualOptions,
11058
11058
  projectionOffset: [
11059
- ((D = (M = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : M.projectionOffset) == null ? void 0 : D[0]) || 0,
11059
+ ((T = (D = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : D.projectionOffset) == null ? void 0 : T[0]) || 0,
11060
11060
  Number(L.target.value)
11061
11061
  ]
11062
11062
  }
@@ -11272,11 +11272,11 @@ function Ii({ color: t, onColorChange: n, onClose: s }) {
11272
11272
  const h = (v) => {
11273
11273
  l(v), x(v, i, c);
11274
11274
  }, p = (v) => {
11275
- const g = v.currentTarget.getBoundingClientRect(), b = Math.max(0, Math.min(1, (v.clientX - g.left) / g.width)), I = Math.max(0, Math.min(1, (v.clientY - g.top) / g.height)), T = b * 100, C = (1 - I) * 100;
11276
- o(T), u(C), x(r, T, C);
11275
+ const g = v.currentTarget.getBoundingClientRect(), b = Math.max(0, Math.min(1, (v.clientX - g.left) / g.width)), I = Math.max(0, Math.min(1, (v.clientY - g.top) / g.height)), M = b * 100, C = (1 - I) * 100;
11276
+ o(M), u(C), x(r, M, C);
11277
11277
  }, x = (v, g, b) => {
11278
- const I = uh(v, g, b), T = dh(I.r, I.g, I.b);
11279
- m(T);
11278
+ const I = uh(v, g, b), M = dh(I.r, I.g, I.b);
11279
+ m(M);
11280
11280
  }, y = (v) => {
11281
11281
  if (m(v), /^#[0-9A-Fa-f]{6}$/.test(v)) {
11282
11282
  const g = Jr(v);
@@ -11471,17 +11471,17 @@ const mh = [
11471
11471
  // yellow-400
11472
11472
  ];
11473
11473
  function Ai() {
11474
- var I, T, C, A, N, S, w, L, k, z;
11475
- const t = O((M) => M.card), n = O((M) => {
11476
- var D;
11477
- return (D = M.card) == null ? void 0 : D.preferences;
11474
+ var I, M, C, A, N, S, w, L, k, z;
11475
+ const t = O((D) => D.card), n = O((D) => {
11476
+ var T;
11477
+ return (T = D.card) == null ? void 0 : T.preferences;
11478
11478
  }), { setCardPreferences: s, updateCardInFrame: r } = ie(), { data: l } = qe(t), [i, o] = V({}), [c, u] = V(
11479
11479
  null
11480
11480
  ), [d, m] = V(null), h = Ve(() => {
11481
11481
  var P, F, R, j, K, Q, $;
11482
11482
  if (!(l != null && l.records) || l.records.length === 0) return [];
11483
- const M = (t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine", D = (t == null ? void 0 : t.type) === "bar" || (t == null ? void 0 : t.type) === "line", E = ((P = t == null ? void 0 : t.config) == null ? void 0 : P.pivotByColumns) && t.config.pivotByColumns.length > 0;
11484
- if ((M || D) && E) {
11483
+ const D = (t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine", T = (t == null ? void 0 : t.type) === "bar" || (t == null ? void 0 : t.type) === "line", E = ((P = t == null ? void 0 : t.config) == null ? void 0 : P.pivotByColumns) && t.config.pivotByColumns.length > 0;
11484
+ if ((D || T) && E) {
11485
11485
  if (l.pivotSchema && Array.isArray(l.pivotSchema)) {
11486
11486
  const ne = /* @__PURE__ */ new Set();
11487
11487
  return l.pivotSchema.forEach((ee) => {
@@ -11504,7 +11504,7 @@ function Ai() {
11504
11504
  );
11505
11505
  }
11506
11506
  }
11507
- if ((D || M) && !E && ((K = (j = t == null ? void 0 : t.config) == null ? void 0 : j.metricColumns) != null && K.length))
11507
+ if ((T || D) && !E && ((K = (j = t == null ? void 0 : t.config) == null ? void 0 : j.metricColumns) != null && K.length))
11508
11508
  return t.config.metricColumns.map(
11509
11509
  (ne) => ne.alias || ne.label || ne.name
11510
11510
  );
@@ -11519,24 +11519,24 @@ function Ai() {
11519
11519
  }, [
11520
11520
  l,
11521
11521
  (I = t == null ? void 0 : t.config) == null ? void 0 : I.groupByColumns,
11522
- (T = t == null ? void 0 : t.config) == null ? void 0 : T.pivotByColumns,
11522
+ (M = t == null ? void 0 : t.config) == null ? void 0 : M.pivotByColumns,
11523
11523
  (C = t == null ? void 0 : t.config) == null ? void 0 : C.metricColumns,
11524
11524
  t == null ? void 0 : t.type
11525
11525
  ]), p = Ve(() => rc(), []);
11526
11526
  ke(() => {
11527
- const M = {};
11528
- h.forEach((D, E) => {
11529
- M[D] = zr(
11530
- D,
11527
+ const D = {};
11528
+ h.forEach((T, E) => {
11529
+ D[T] = zr(
11530
+ T,
11531
11531
  E,
11532
11532
  n == null ? void 0 : n.colorConfig
11533
11533
  );
11534
- }), o(M);
11534
+ }), o(D);
11535
11535
  }, [h, n == null ? void 0 : n.colorConfig, p]);
11536
- const x = (M, D) => {
11536
+ const x = (D, T) => {
11537
11537
  const E = {
11538
11538
  ...i,
11539
- [M]: D
11539
+ [D]: T
11540
11540
  };
11541
11541
  o(E);
11542
11542
  const P = {
@@ -11551,9 +11551,9 @@ function Ai() {
11551
11551
  preferences: P
11552
11552
  };
11553
11553
  r(F);
11554
- }, y = (M, D) => {
11554
+ }, y = (D, T) => {
11555
11555
  var K;
11556
- const E = p[D % p.length], { [M]: P, ...F } = ((K = n == null ? void 0 : n.colorConfig) == null ? void 0 : K.segments) || {}, R = {
11556
+ const E = p[T % p.length], { [D]: P, ...F } = ((K = n == null ? void 0 : n.colorConfig) == null ? void 0 : K.segments) || {}, R = {
11557
11557
  ...n || {},
11558
11558
  colorConfig: {
11559
11559
  segments: F
@@ -11566,24 +11566,24 @@ function Ai() {
11566
11566
  };
11567
11567
  r(j), o((Q) => ({
11568
11568
  ...Q,
11569
- [M]: E
11569
+ [D]: E
11570
11570
  }));
11571
11571
  };
11572
11572
  if (!h.length || !((t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine" ? ((N = (A = t == null ? void 0 : t.config) == null ? void 0 : A.groupByColumns) == null ? void 0 : N.length) || ((w = (S = t == null ? void 0 : t.config) == null ? void 0 : S.pivotByColumns) == null ? void 0 : w.length) : (k = (L = t == null ? void 0 : t.config) == null ? void 0 : L.groupByColumns) == null ? void 0 : k.length) || ["table", "kpi", "text", "custom"].includes(t.type))
11573
11573
  return null;
11574
11574
  const g = () => {
11575
- const M = {
11575
+ const D = {
11576
11576
  ...n || {},
11577
11577
  colorConfig: {
11578
11578
  segments: {}
11579
11579
  }
11580
11580
  };
11581
- s(M);
11582
- const D = {
11581
+ s(D);
11582
+ const T = {
11583
11583
  ...t,
11584
- preferences: M
11584
+ preferences: D
11585
11585
  };
11586
- r(D);
11586
+ r(T);
11587
11587
  const E = {};
11588
11588
  h.forEach((P, F) => {
11589
11589
  E[P] = zr(P, F, void 0);
@@ -11606,23 +11606,23 @@ function Ai() {
11606
11606
  ]
11607
11607
  }
11608
11608
  ) }) }),
11609
- /* @__PURE__ */ e("div", { className: "max-h-[200px] space-y-2 overflow-y-auto pr-1", children: h.map((M, D) => {
11610
- const E = lc(i[M], D), P = !E;
11609
+ /* @__PURE__ */ e("div", { className: "max-h-[200px] space-y-2 overflow-y-auto pr-1", children: h.map((D, T) => {
11610
+ const E = lc(i[D], T), P = !E;
11611
11611
  return /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
11612
11612
  /* @__PURE__ */ a(
11613
11613
  zt,
11614
11614
  {
11615
- open: c === M,
11616
- onOpenChange: (F) => u(F ? M : null),
11615
+ open: c === D,
11616
+ onOpenChange: (F) => u(F ? D : null),
11617
11617
  children: [
11618
11618
  /* @__PURE__ */ e(_t, { asChild: !0, children: /* @__PURE__ */ e(
11619
11619
  "button",
11620
11620
  {
11621
11621
  className: "h-5 w-5 shrink-0 rounded border border-input shadow-sm transition-colors hover:border-gray-400 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
11622
- style: { backgroundColor: i[M] }
11622
+ style: { backgroundColor: i[D] }
11623
11623
  }
11624
11624
  ) }),
11625
- /* @__PURE__ */ e(Ht, { align: "start", className: "w-auto p-3", children: /* @__PURE__ */ a("div", { className: "space-y-2.5", children: [
11625
+ /* @__PURE__ */ e(Qt, { align: "start", className: "w-auto p-3", children: /* @__PURE__ */ a("div", { className: "space-y-2.5", children: [
11626
11626
  /* @__PURE__ */ a("div", { className: "space-y-1", children: [
11627
11627
  /* @__PURE__ */ e("p", { className: "text-xs font-medium text-muted-foreground", children: "Theme Colors" }),
11628
11628
  /* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-1.5", children: p.slice(0, 10).map((F, R) => /* @__PURE__ */ a(
@@ -11630,14 +11630,14 @@ function Ai() {
11630
11630
  {
11631
11631
  className: G(
11632
11632
  "relative h-5 w-5 rounded border-2 transition-all hover:scale-110",
11633
- i[M] === F ? "border-gray-900" : "border-transparent"
11633
+ i[D] === F ? "border-gray-900" : "border-transparent"
11634
11634
  ),
11635
11635
  style: { backgroundColor: F },
11636
11636
  onClick: () => {
11637
- x(M, F), u(null);
11637
+ x(D, F), u(null);
11638
11638
  },
11639
11639
  children: [
11640
- R === D % p.length && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "rounded-full bg-white/90 px-0.5 text-[8px] font-bold text-gray-900 shadow-sm", children: "D" }) }),
11640
+ R === T % p.length && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "rounded-full bg-white/90 px-0.5 text-[8px] font-bold text-gray-900 shadow-sm", children: "D" }) }),
11641
11641
  /* @__PURE__ */ e("span", { className: "sr-only", children: F })
11642
11642
  ]
11643
11643
  },
@@ -11651,11 +11651,11 @@ function Ai() {
11651
11651
  {
11652
11652
  className: G(
11653
11653
  "h-5 w-5 rounded border transition-all hover:scale-110",
11654
- i[M] === F ? "border-2 border-gray-900" : F === "#ffffff" ? "border border-gray-300" : "border border-transparent"
11654
+ i[D] === F ? "border-2 border-gray-900" : F === "#ffffff" ? "border border-gray-300" : "border border-transparent"
11655
11655
  ),
11656
11656
  style: { backgroundColor: F },
11657
11657
  onClick: () => {
11658
- x(M, F), u(null);
11658
+ x(D, F), u(null);
11659
11659
  },
11660
11660
  children: /* @__PURE__ */ e("span", { className: "sr-only", children: F })
11661
11661
  },
@@ -11669,8 +11669,8 @@ function Ai() {
11669
11669
  className: "text-sm font-medium text-blue-600 hover:text-blue-700",
11670
11670
  onClick: () => {
11671
11671
  m({
11672
- value: M,
11673
- color: i[M]
11672
+ value: D,
11673
+ color: i[D]
11674
11674
  }), u(null);
11675
11675
  },
11676
11676
  children: "Custom color"
@@ -11681,7 +11681,7 @@ function Ai() {
11681
11681
  {
11682
11682
  className: "flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",
11683
11683
  onClick: () => {
11684
- y(M, D), u(null);
11684
+ y(D, T), u(null);
11685
11685
  },
11686
11686
  children: [
11687
11687
  /* @__PURE__ */ e(Yr, { className: "h-3 w-3" }),
@@ -11694,9 +11694,9 @@ function Ai() {
11694
11694
  ]
11695
11695
  }
11696
11696
  ),
11697
- /* @__PURE__ */ e("span", { className: "flex-1 truncate text-sm", children: M }),
11697
+ /* @__PURE__ */ e("span", { className: "flex-1 truncate text-sm", children: D }),
11698
11698
  P && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "(custom)" })
11699
- ] }, M);
11699
+ ] }, D);
11700
11700
  }) }),
11701
11701
  d && /* @__PURE__ */ a("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
11702
11702
  /* @__PURE__ */ e(
@@ -11710,8 +11710,8 @@ function Ai() {
11710
11710
  Ii,
11711
11711
  {
11712
11712
  color: d.color,
11713
- onColorChange: (M) => {
11714
- x(d.value, M), m(null);
11713
+ onColorChange: (D) => {
11714
+ x(d.value, D), m(null);
11715
11715
  },
11716
11716
  onClose: () => m(null)
11717
11717
  }
@@ -12027,7 +12027,7 @@ function br({
12027
12027
  ] });
12028
12028
  }
12029
12029
  function Qr({ axis: t, label: n, type: s, config: r, onChange: l }) {
12030
- var h, p, x, y, f, v, g, b, I, T, C, A;
12030
+ var h, p, x, y, f, v, g, b, I, M, C, A;
12031
12031
  const i = (N, S) => {
12032
12032
  l({
12033
12033
  ...r,
@@ -12172,7 +12172,7 @@ function Qr({ axis: t, label: n, type: s, config: r, onChange: l }) {
12172
12172
  {
12173
12173
  type: "number",
12174
12174
  placeholder: "auto",
12175
- value: ((I = r == null ? void 0 : r.scale) == null ? void 0 : I.max) === "auto" || ((T = r == null ? void 0 : r.scale) == null ? void 0 : T.max) === void 0 ? "" : String(r.scale.max),
12175
+ value: ((I = r == null ? void 0 : r.scale) == null ? void 0 : I.max) === "auto" || ((M = r == null ? void 0 : r.scale) == null ? void 0 : M.max) === void 0 ? "" : String(r.scale.max),
12176
12176
  onSave: (N) => u("max", N),
12177
12177
  className: ""
12178
12178
  }
@@ -12313,7 +12313,7 @@ function Oi() {
12313
12313
  ] });
12314
12314
  }
12315
12315
  function Ri() {
12316
- var S, w, L, k, z, M, D, E, P;
12316
+ var S, w, L, k, z, D, T, E, P;
12317
12317
  const t = O((F) => F.card), n = O(
12318
12318
  (F) => {
12319
12319
  var R, j;
@@ -12383,7 +12383,7 @@ function Ri() {
12383
12383
  ...(i ? ["center", "left", "right"] : ["center", "top", "bottom"]).filter((R) => R !== v),
12384
12384
  "custom"
12385
12385
  ];
12386
- const b = () => dt(v), I = ["center", "start", "end"], T = ["center", "start", "end", "top", "bottom"], C = u ? ["auto", "number", "currency", "percent", "none"] : ["number", "currency", "percent", "none"], A = [
12386
+ const b = () => dt(v), I = ["center", "start", "end"], M = ["center", "start", "end", "top", "bottom"], C = u ? ["auto", "number", "currency", "percent", "none"] : ["number", "currency", "percent", "none"], A = [
12387
12387
  { value: "USD", label: "USD - US Dollar" },
12388
12388
  { value: "EUR", label: "EUR - Euro" },
12389
12389
  { value: "GBP", label: "GBP - British Pound" },
@@ -12467,7 +12467,7 @@ function Ri() {
12467
12467
  onValueChange: (F) => p("align", F),
12468
12468
  children: [
12469
12469
  /* @__PURE__ */ e(ge, { className: "h-8 text-xs flex-1", children: /* @__PURE__ */ e(xe, {}) }),
12470
- /* @__PURE__ */ e(ve, { children: T.map((F) => /* @__PURE__ */ e(ae, { value: F, className: "text-xs", children: dt(F) }, F)) })
12470
+ /* @__PURE__ */ e(ve, { children: M.map((F) => /* @__PURE__ */ e(ae, { value: F, className: "text-xs", children: dt(F) }, F)) })
12471
12471
  ]
12472
12472
  }
12473
12473
  )
@@ -12520,7 +12520,7 @@ function Ri() {
12520
12520
  /* @__PURE__ */ e(
12521
12521
  mt,
12522
12522
  {
12523
- checked: ((M = n == null ? void 0 : n.formatOptions) == null ? void 0 : M.useSuffix) ?? !1,
12523
+ checked: ((D = n == null ? void 0 : n.formatOptions) == null ? void 0 : D.useSuffix) ?? !1,
12524
12524
  onCheckedChange: (F) => y("useSuffix", F)
12525
12525
  }
12526
12526
  )
@@ -12530,7 +12530,7 @@ function Ri() {
12530
12530
  /* @__PURE__ */ a(
12531
12531
  fe,
12532
12532
  {
12533
- value: ((D = n == null ? void 0 : n.formatOptions) == null ? void 0 : D.locale) || "en-US",
12533
+ value: ((T = n == null ? void 0 : n.formatOptions) == null ? void 0 : T.locale) || "en-US",
12534
12534
  onValueChange: (F) => y("locale", F),
12535
12535
  children: [
12536
12536
  /* @__PURE__ */ e(ge, { className: "h-8 text-xs flex-1", children: /* @__PURE__ */ e(xe, {}) }),
@@ -12739,7 +12739,7 @@ function bh() {
12739
12739
  }
12740
12740
  return /* @__PURE__ */ a(st, { className: "h-full w-full text-sm", children: [
12741
12741
  n(t),
12742
- /* @__PURE__ */ e(na, { orientation: "horizontal" })
12742
+ /* @__PURE__ */ e(ra, { orientation: "horizontal" })
12743
12743
  ] });
12744
12744
  }
12745
12745
  function Fi({
@@ -12807,7 +12807,7 @@ function wh({ column: t }) {
12807
12807
  let s = Ch;
12808
12808
  Ut(t.type) && (s = s.filter(
12809
12809
  (l) => ["COUNT", "DISTINCT"].includes(l.value)
12810
- )), aa(t.type) && (s = s.filter(
12810
+ )), sa(t.type) && (s = s.filter(
12811
12811
  (l) => !["DISTINCT"].includes(l.value)
12812
12812
  ));
12813
12813
  function r(l) {
@@ -12959,11 +12959,11 @@ function Th({
12959
12959
  isDragging: y
12960
12960
  } = Ka({ id: t.id, data: { type: n } }), f = p ? {
12961
12961
  opacity: y ? 0.5 : void 0,
12962
- transform: sa.Translate.toString(p),
12962
+ transform: na.Translate.toString(p),
12963
12963
  transition: x
12964
12964
  } : void 0, v = Ut(t.type);
12965
12965
  function g(A) {
12966
- const N = aa(A.data_type), S = Ut(A.data_type), w = Gt(A.data_type), L = N ? "number" : S ? "string" : w ? "date" : "string";
12966
+ const N = sa(A.data_type), S = Ut(A.data_type), w = Gt(A.data_type), L = N ? "number" : S ? "string" : w ? "date" : "string";
12967
12967
  if (r === pa) {
12968
12968
  if (S) {
12969
12969
  const k = {
@@ -13043,7 +13043,7 @@ function Th({
13043
13043
  if ((r === pa || r === ga) && A)
13044
13044
  return /* @__PURE__ */ e(kh, { column: t });
13045
13045
  }
13046
- function T() {
13046
+ function M() {
13047
13047
  return /* @__PURE__ */ e(
13048
13048
  "div",
13049
13049
  {
@@ -13090,7 +13090,7 @@ function Th({
13090
13090
  /* @__PURE__ */ a("div", { className: "flex h-8 grow items-center justify-between rounded-md bg-muted", children: [
13091
13091
  C(),
13092
13092
  I(),
13093
- T()
13093
+ M()
13094
13094
  ] }),
13095
13095
  l && b()
13096
13096
  ] }),
@@ -13119,7 +13119,7 @@ function cn({
13119
13119
  var f, v;
13120
13120
  const { setNodeRef: o, isOver: c, over: u } = mr({
13121
13121
  id: t
13122
- }), d = ta((g) => g.activeId), m = O((g) => {
13122
+ }), d = aa((g) => g.activeId), m = O((g) => {
13123
13123
  var b;
13124
13124
  return (b = g.card) == null ? void 0 : b.type;
13125
13125
  }), h = c || ((v = (f = u == null ? void 0 : u.data) == null ? void 0 : f.current) == null ? void 0 : v.type) === l, p = d ? r : s, x = l === Ls ? "Rows" : l === zs ? "Pivot Columns" : "Columns";
@@ -13127,7 +13127,7 @@ function cn({
13127
13127
  if (!p || p.length === 0)
13128
13128
  return /* @__PURE__ */ e("div", { className: "mr-5 flex h-8 grow items-center space-x-2 rounded-md border border-dashed border-muted-foreground/80 bg-background px-2 py-1 text-sm text-muted-foreground", children: /* @__PURE__ */ e("span", { className: "invisible text-muted-foreground/70 group-hover:visible", children: "Drag here" }) });
13129
13129
  }
13130
- return /* @__PURE__ */ e(ra, { items: s == null ? void 0 : s.map((g) => g.id), children: /* @__PURE__ */ a(
13130
+ return /* @__PURE__ */ e(la, { items: s == null ? void 0 : s.map((g) => g.id), children: /* @__PURE__ */ a(
13131
13131
  "div",
13132
13132
  {
13133
13133
  className: G(
@@ -13171,7 +13171,7 @@ function Li({ children: t, id: n, type: s }) {
13171
13171
  isDragging: u
13172
13172
  } = Ka({ id: n, data: { type: s } }), d = o ? {
13173
13173
  opacity: u ? 0.5 : void 0,
13174
- transform: sa.Translate.toString(o),
13174
+ transform: na.Translate.toString(o),
13175
13175
  transition: c
13176
13176
  } : void 0;
13177
13177
  return /* @__PURE__ */ e("div", { ...l, ...r, ref: i, style: d, children: t });
@@ -13225,7 +13225,7 @@ function Ih() {
13225
13225
  b && l(b);
13226
13226
  }
13227
13227
  return /* @__PURE__ */ e(
13228
- ra,
13228
+ la,
13229
13229
  {
13230
13230
  items: t.map((g) => Za(g.columnId)),
13231
13231
  children: /* @__PURE__ */ a("div", { className: "space-y-2 rounded-md p-4 text-sm", children: [
@@ -13296,21 +13296,21 @@ function Ah() {
13296
13296
  var g;
13297
13297
  return ((g = v.card.queryConfig) == null ? void 0 : g.groupByColumns) || [];
13298
13298
  }
13299
- ), n = O((v) => v.card.type), s = ta(
13299
+ ), n = O((v) => v.card.type), s = aa(
13300
13300
  (v) => v.previewGroupByColumns
13301
13301
  ), r = O(
13302
13302
  (v) => {
13303
13303
  var g;
13304
13304
  return ((g = v.card.queryConfig) == null ? void 0 : g.metricColumns) || [];
13305
13305
  }
13306
- ), l = ta(
13306
+ ), l = aa(
13307
13307
  (v) => v.previewMetricColumns
13308
13308
  ), i = O(
13309
13309
  (v) => {
13310
13310
  var g;
13311
13311
  return ((g = v.card.queryConfig) == null ? void 0 : g.pivotColumns) || [];
13312
13312
  }
13313
- ), o = ta(
13313
+ ), o = aa(
13314
13314
  (v) => v.previewPivotColumns
13315
13315
  ), {
13316
13316
  // setSelectedConnectionId,
@@ -13367,7 +13367,7 @@ function Ah() {
13367
13367
  ),
13368
13368
  /* @__PURE__ */ e(Ih, {})
13369
13369
  ] }),
13370
- /* @__PURE__ */ e(na, { orientation: "horizontal" })
13370
+ /* @__PURE__ */ e(ra, { orientation: "horizontal" })
13371
13371
  ] })
13372
13372
  ] });
13373
13373
  }
@@ -13446,20 +13446,20 @@ function Eh({
13446
13446
  }) {
13447
13447
  const s = X((I) => I.themeStyle), r = O(
13448
13448
  (I) => {
13449
- var T, C;
13450
- return (C = (T = I.card) == null ? void 0 : T.queryConfig) == null ? void 0 : C.filters;
13449
+ var M, C;
13450
+ return (C = (M = I.card) == null ? void 0 : M.queryConfig) == null ? void 0 : C.filters;
13451
13451
  }
13452
13452
  ), l = O(
13453
13453
  (I) => {
13454
- var T, C;
13455
- return (C = (T = I.card.queryConfig) == null ? void 0 : T.filterColumns) == null ? void 0 : C.find(
13454
+ var M, C;
13455
+ return (C = (M = I.card.queryConfig) == null ? void 0 : M.filterColumns) == null ? void 0 : C.find(
13456
13456
  (A) => A.name === t.name
13457
13457
  );
13458
13458
  }
13459
13459
  ), { selectedConnectionId: i, selectedDatabaseName: o, selectedTableName: c } = jt(), u = Ve(() => {
13460
13460
  var I;
13461
13461
  return (I = r == null ? void 0 : r.find(
13462
- (T) => T.filterColumnName === t.name
13462
+ (M) => M.filterColumnName === t.name
13463
13463
  )) == null ? void 0 : I.filterValue;
13464
13464
  }, [r, t.name]), d = Ve(() => Array.isArray(u) ? u.map(
13465
13465
  (I) => ({
@@ -13476,8 +13476,8 @@ function Eh({
13476
13476
  // not needed
13477
13477
  dataType: t.type
13478
13478
  }, { data: p, isLoading: x, isFetching: y, isError: f } = Ll(h), v = Ve(() => {
13479
- var T;
13480
- return h.column ? (T = p == null ? void 0 : p.records) == null ? void 0 : T.map((C) => {
13479
+ var M;
13480
+ return h.column ? (M = p == null ? void 0 : p.records) == null ? void 0 : M.map((C) => {
13481
13481
  let A = h.column.split(".").slice(-1)[0].replace(/"/g, "");
13482
13482
  return C[A] === void 0 && (A = A.toLowerCase()), {
13483
13483
  id: C[A],
@@ -13488,8 +13488,8 @@ function Eh({
13488
13488
  }) : [];
13489
13489
  }, [p, h.column]);
13490
13490
  function g(I) {
13491
- const T = I.map((C) => C.id);
13492
- m(t.name, T);
13491
+ const M = I.map((C) => C.id);
13492
+ m(t.name, M);
13493
13493
  }
13494
13494
  function b() {
13495
13495
  return x || y ? /* @__PURE__ */ e(
@@ -13597,7 +13597,7 @@ function Rh({
13597
13597
  }
13598
13598
  ),
13599
13599
  /* @__PURE__ */ a(
13600
- Ht,
13600
+ Qt,
13601
13601
  {
13602
13602
  style: {
13603
13603
  // borderRadius: currentStyle?.chart?.options?.borderRadius,
@@ -13668,11 +13668,11 @@ function Fh({
13668
13668
  // not needed
13669
13669
  dataType: t.type
13670
13670
  }, { isLoading: u, isFetching: d, isError: m, data: h } = Ll(c), p = h == null ? void 0 : h.records, { dateRange: x, setDateRange: y, initialDateRange: f } = mc(p), { updateEditorFilterValue: v } = ie();
13671
- function g(T) {
13671
+ function g(M) {
13672
13672
  var A, N;
13673
13673
  const C = {
13674
- gte: (A = T == null ? void 0 : T.from) == null ? void 0 : A.toISOString(),
13675
- lte: (N = T == null ? void 0 : T.to) == null ? void 0 : N.toISOString()
13674
+ gte: (A = M == null ? void 0 : M.from) == null ? void 0 : A.toISOString(),
13675
+ lte: (N = M == null ? void 0 : M.to) == null ? void 0 : N.toISOString()
13676
13676
  };
13677
13677
  v(t.name, C);
13678
13678
  }
@@ -13715,7 +13715,7 @@ function Ph({
13715
13715
  var y, f;
13716
13716
  const { setNodeRef: i, isOver: o, over: c } = mr({
13717
13717
  id: t
13718
- }), u = ta((v) => v.activeId), d = {
13718
+ }), u = aa((v) => v.activeId), d = {
13719
13719
  // borderColor: isOver ? 'green' : undefined,
13720
13720
  }, m = o || ((f = (y = c == null ? void 0 : c.data) == null ? void 0 : y.current) == null ? void 0 : f.type) === l;
13721
13721
  function h() {
@@ -13752,7 +13752,7 @@ function Ph({
13752
13752
  );
13753
13753
  }
13754
13754
  const x = u ? r : s;
13755
- return /* @__PURE__ */ e(ra, { items: s == null ? void 0 : s.map((v) => v.id), children: /* @__PURE__ */ a(
13755
+ return /* @__PURE__ */ e(la, { items: s == null ? void 0 : s.map((v) => v.id), children: /* @__PURE__ */ a(
13756
13756
  "div",
13757
13757
  {
13758
13758
  className: G(
@@ -13778,7 +13778,7 @@ function zh() {
13778
13778
  var i;
13779
13779
  return ((i = l.card.queryConfig) == null ? void 0 : i.filterColumns) || [];
13780
13780
  }
13781
- ), n = ta(
13781
+ ), n = aa(
13782
13782
  (l) => l.previewFilterColumns
13783
13783
  ), { removeColumnFromFilterColumns: s } = ie();
13784
13784
  function r(l) {
@@ -13937,7 +13937,7 @@ function jh(t) {
13937
13937
  setQueryConfig: y
13938
13938
  } = ie(), f = O((q) => q.currentAssitantScope) || [], v = O((q) => q.userInputForAI), g = O((q) => q.triggerAIRun), b = O((q) => q.card), I = O(
13939
13939
  (q) => q.selectedDatabaseName
13940
- ), T = O((q) => q.selectedTableName), C = O(
13940
+ ), M = O((q) => q.selectedTableName), C = O(
13941
13941
  (q) => q.selectedConnectionId
13942
13942
  ), A = O(
13943
13943
  (q) => q.selectedSchemaName
@@ -13947,7 +13947,7 @@ function jh(t) {
13947
13947
  errorMessage: S,
13948
13948
  refetch: w,
13949
13949
  data: L
13950
- } = qe(b), { setTriggerAIRun: k, setCurrentAssitantScope: z, setCardConfig: M } = ie(), { selectedDatamodelName: D, connectionType: E, selectedDatamodelId: P } = jt(), {
13950
+ } = qe(b), { setTriggerAIRun: k, setCurrentAssitantScope: z, setCardConfig: D } = ie(), { selectedDatamodelName: T, connectionType: E, selectedDatamodelId: P } = jt(), {
13951
13951
  messages: F,
13952
13952
  setMessages: R,
13953
13953
  regenerate: j,
@@ -14006,8 +14006,8 @@ function jh(t) {
14006
14006
  async function H({ toolCall: q }) {
14007
14007
  var pe, Fe, be, He, Pe, se, Z, B, ce, Ae, Le, we, ze, Ke, ka, Da;
14008
14008
  if (["createChartFromSql", "createForecast"].includes(q.toolName)) {
14009
- const Qt = ((pe = q.input) == null ? void 0 : pe.sql) ?? ((Fe = q.args) == null ? void 0 : Fe.sql), vt = ((be = q.input) == null ? void 0 : be.python) ?? ((He = q.args) == null ? void 0 : He.python), oe = ((Pe = q.input) == null ? void 0 : Pe.chartType) ?? ((se = q.args) == null ? void 0 : se.chartType);
14010
- x(oe), h(Qt), m(vt), p(!0), ne({
14009
+ const Zt = ((pe = q.input) == null ? void 0 : pe.sql) ?? ((Fe = q.args) == null ? void 0 : Fe.sql), vt = ((be = q.input) == null ? void 0 : be.python) ?? ((He = q.args) == null ? void 0 : He.python), oe = ((Pe = q.input) == null ? void 0 : Pe.chartType) ?? ((se = q.args) == null ? void 0 : se.chartType);
14010
+ x(oe), h(Zt), m(vt), p(!0), ne({
14011
14011
  tool: q.toolName,
14012
14012
  toolCallId: q.toolCallId,
14013
14013
  output: {
@@ -14038,8 +14038,8 @@ function jh(t) {
14038
14038
  });
14039
14039
  } else if (q.toolName === "generateQueryConfig") {
14040
14040
  s("Generating query config...");
14041
- const Qt = ((Z = q.input) == null ? void 0 : Z.chartType) ?? ((B = q.args) == null ? void 0 : B.chartType), vt = ((ce = q.input) == null ? void 0 : ce.queryConfig) ?? ((Ae = q.args) == null ? void 0 : Ae.queryConfig);
14042
- ((Le = q.input) == null ? void 0 : Le.cardConfig) ?? ((we = q.args) == null || we.cardConfig), x(Qt), M(vt), h(void 0), m(void 0);
14041
+ const Zt = ((Z = q.input) == null ? void 0 : Z.chartType) ?? ((B = q.args) == null ? void 0 : B.chartType), vt = ((ce = q.input) == null ? void 0 : ce.queryConfig) ?? ((Ae = q.args) == null ? void 0 : Ae.queryConfig);
14042
+ ((Le = q.input) == null ? void 0 : Le.cardConfig) ?? ((we = q.args) == null || we.cardConfig), x(Zt), D(vt), h(void 0), m(void 0);
14043
14043
  const oe = await w();
14044
14044
  if ((ze = oe == null ? void 0 : oe.data) != null && ze.error) {
14045
14045
  ne({
@@ -14104,9 +14104,9 @@ function jh(t) {
14104
14104
  const q = {
14105
14105
  databaseName: I || "",
14106
14106
  schemaName: A || "",
14107
- tableName: T || "",
14107
+ tableName: M || "",
14108
14108
  datamodelId: P || "",
14109
- datamodelName: Vr(D),
14109
+ datamodelName: Vr(T),
14110
14110
  connectionId: C || "",
14111
14111
  connectionType: E || ""
14112
14112
  }, pe = jr([...f, q]);
@@ -14116,8 +14116,8 @@ function jh(t) {
14116
14116
  const q = {
14117
14117
  databaseName: I || "",
14118
14118
  schemaName: A || "",
14119
- tableName: T || "",
14120
- datamodelName: Vr(D),
14119
+ tableName: M || "",
14120
+ datamodelName: Vr(T),
14121
14121
  connectionId: C || "",
14122
14122
  connectionType: E || "",
14123
14123
  datamodelId: P || ""
@@ -14172,10 +14172,10 @@ function Zr({
14172
14172
  onFullscreenChange: n,
14173
14173
  fullscreenContainer: s
14174
14174
  }) {
14175
- const r = Nt(null), [l, i] = V(!1), [o, c] = V(zl), [u, d] = V(!1), [m, h] = V(!1), [p, x] = V(!1), y = t ?? p, f = Nc(), { setCurrentAIContext: v } = _l(), { clearQueue: g } = bc(), { clearFileAttachments: b } = Cc(), I = wc("editor"), T = X((oe) => oe.dashboard.aiContext), C = O((oe) => oe.card.dataSource), A = O((oe) => oe.actions.setCardSql), N = O((oe) => oe.actions.setRunSql), S = O((oe) => oe.showAIDialog), w = X(
14175
+ const r = Nt(null), [l, i] = V(!1), [o, c] = V(zl), [u, d] = V(!1), [m, h] = V(!1), [p, x] = V(!1), y = t ?? p, f = Nc(), { setCurrentAIContext: v } = _l(), { clearQueue: g } = bc(), { clearFileAttachments: b } = Cc(), I = wc("editor"), M = X((oe) => oe.dashboard.aiContext), C = O((oe) => oe.card.dataSource), A = O((oe) => oe.actions.setCardSql), N = O((oe) => oe.actions.setRunSql), S = O((oe) => oe.showAIDialog), w = X(
14176
14176
  (oe) => oe.handleOpenAssistantProfile
14177
- ), { setShowAIDialog: L, setCardPython: k } = ie(), { setDataSource: z } = ie(), { assistantProfile: M } = Sc(), {
14178
- messages: D,
14177
+ ), { setShowAIDialog: L, setCardPython: k } = ie(), { setDataSource: z } = ie(), { assistantProfile: D } = Sc(), {
14178
+ messages: T,
14179
14179
  setMessages: E,
14180
14180
  sendMessage: P,
14181
14181
  isLoading: F,
@@ -14206,7 +14206,7 @@ function Zr({
14206
14206
  totalMessageCount: W,
14207
14207
  loadMoreMessages: Ne,
14208
14208
  resetMessageWindow: re
14209
- } = kc(D, {
14209
+ } = kc(T, {
14210
14210
  maxVisibleMessages: 15,
14211
14211
  // Reduced from 50 to 15 for better performance
14212
14212
  initialLoadCount: 10,
@@ -14225,7 +14225,7 @@ function Zr({
14225
14225
  threshold: 50,
14226
14226
  delay: 0,
14227
14227
  // No delay for real-time scrolling
14228
- dependencies: [j, D.length]
14228
+ dependencies: [j, T.length]
14229
14229
  // Also trigger on status changes and total message count
14230
14230
  });
14231
14231
  ke(() => {
@@ -14239,7 +14239,7 @@ function Zr({
14239
14239
  isLoading: F,
14240
14240
  sendMessage: P
14241
14241
  });
14242
- const { hasActiveTools: se } = Mc(D), Z = Se(
14242
+ const { hasActiveTools: se } = Mc(T), Z = Se(
14243
14243
  (oe) => {
14244
14244
  n == null || n(oe), t === void 0 && x(oe);
14245
14245
  },
@@ -14263,7 +14263,7 @@ function Zr({
14263
14263
  },
14264
14264
  [P, be]
14265
14265
  ), ce = Se(async () => {
14266
- const oe = JSON.stringify(D ?? [], null, 2);
14266
+ const oe = JSON.stringify(T ?? [], null, 2);
14267
14267
  try {
14268
14268
  if (typeof navigator > "u" || !navigator.clipboard)
14269
14269
  throw new Error("Clipboard API unavailable");
@@ -14271,7 +14271,7 @@ function Zr({
14271
14271
  } catch (at) {
14272
14272
  console.error("Failed to copy conversation", at), he.error("Unable to copy conversation");
14273
14273
  }
14274
- }, [D]), Ae = Se(() => {
14274
+ }, [T]), Ae = Se(() => {
14275
14275
  Z(!y);
14276
14276
  }, [y, Z]);
14277
14277
  function Le(oe, at) {
@@ -14279,7 +14279,7 @@ function Zr({
14279
14279
  }
14280
14280
  function we() {
14281
14281
  f.selectedEntities.length === 0 && v({
14282
- selectedEntities: (T == null ? void 0 : T.selectedEntities) || []
14282
+ selectedEntities: (M == null ? void 0 : M.selectedEntities) || []
14283
14283
  });
14284
14284
  }
14285
14285
  function ze(oe) {
@@ -14342,7 +14342,7 @@ function Zr({
14342
14342
  function Da() {
14343
14343
  return /* @__PURE__ */ e("div", { "data-role": "header", children: /* @__PURE__ */ e("div", { className: "text-lg font-semibold", children: "Assistant" }) });
14344
14344
  }
14345
- const Qt = (ne == null ? void 0 : ne.length) === 0 && (D == null ? void 0 : D.filter((oe) => oe.role === "user").length) === 0, vt = /* @__PURE__ */ a(
14345
+ const Zt = (ne == null ? void 0 : ne.length) === 0 && (T == null ? void 0 : T.filter((oe) => oe.role === "user").length) === 0, vt = /* @__PURE__ */ a(
14346
14346
  "div",
14347
14347
  {
14348
14348
  "data-role": "editor-assistant",
@@ -14365,7 +14365,7 @@ function Zr({
14365
14365
  size: "sm",
14366
14366
  className: "h-7 p-2",
14367
14367
  onClick: w,
14368
- children: (M == null ? void 0 : M.name) || "Default Profile"
14368
+ children: (D == null ? void 0 : D.name) || "Default Profile"
14369
14369
  }
14370
14370
  ),
14371
14371
  /* @__PURE__ */ a("div", { "data-role": "header-actions", className: "flex items-center", children: [
@@ -14474,17 +14474,17 @@ function Zr({
14474
14474
  ) }),
14475
14475
  /* @__PURE__ */ a("div", { className: "space-y-3", children: [
14476
14476
  /* @__PURE__ */ a("div", { children: [
14477
- Qt && !M && /* @__PURE__ */ e(
14477
+ Zt && !D && /* @__PURE__ */ e(
14478
14478
  Rc,
14479
14479
  {
14480
14480
  onClick: ze,
14481
14481
  placeholders: Bh
14482
14482
  }
14483
14483
  ),
14484
- /* @__PURE__ */ e("div", { children: Qt && M && /* @__PURE__ */ e(
14484
+ /* @__PURE__ */ e("div", { children: Zt && D && /* @__PURE__ */ e(
14485
14485
  Fc,
14486
14486
  {
14487
- seedQuestions: M.seedQuestions || [],
14487
+ seedQuestions: D.seedQuestions || [],
14488
14488
  handleSeedQuestionClick: Ke
14489
14489
  }
14490
14490
  ) })
@@ -14555,47 +14555,47 @@ const wr = (t) => {
14555
14555
  switch (z) {
14556
14556
  case "groupBy":
14557
14557
  return (t.config.groupByColumns || []).map(
14558
- (M) => ({
14559
- id: M.id,
14560
- name: M.name,
14561
- dataType: M.dataType,
14562
- label: M.label !== void 0 ? M.label : M.name,
14563
- qualifiedEntityName: M.qualifiedEntityName,
14564
- entityId: M.entityId,
14565
- entityName: M.entityName,
14566
- entityType: M.entityType,
14567
- dateFormat: M.dateFormat,
14568
- customFormat: M.customFormat,
14569
- granularity: M.granularity
14558
+ (D) => ({
14559
+ id: D.id,
14560
+ name: D.name,
14561
+ dataType: D.dataType,
14562
+ label: D.label !== void 0 ? D.label : D.name,
14563
+ qualifiedEntityName: D.qualifiedEntityName,
14564
+ entityId: D.entityId,
14565
+ entityName: D.entityName,
14566
+ entityType: D.entityType,
14567
+ dateFormat: D.dateFormat,
14568
+ customFormat: D.customFormat,
14569
+ granularity: D.granularity
14570
14570
  })
14571
14571
  );
14572
14572
  case "metrics":
14573
14573
  return t.config.metricColumns || [];
14574
14574
  case "pivotBy":
14575
14575
  return (t.config.pivotByColumns || []).map(
14576
- (M) => ({
14577
- id: M.id,
14578
- name: M.name,
14579
- dataType: M.dataType,
14580
- label: M.label !== void 0 ? M.label : M.name,
14581
- qualifiedEntityName: M.qualifiedEntityName,
14582
- entityId: M.entityId,
14583
- entityName: M.entityName,
14584
- entityType: M.entityType
14576
+ (D) => ({
14577
+ id: D.id,
14578
+ name: D.name,
14579
+ dataType: D.dataType,
14580
+ label: D.label !== void 0 ? D.label : D.name,
14581
+ qualifiedEntityName: D.qualifiedEntityName,
14582
+ entityId: D.entityId,
14583
+ entityName: D.entityName,
14584
+ entityType: D.entityType
14585
14585
  })
14586
14586
  );
14587
14587
  case "sortBy":
14588
14588
  return (t.config.sortByColumns || []).map(
14589
- (M) => ({
14590
- id: M.id,
14591
- name: M.name,
14592
- dataType: M.dataType,
14593
- label: M.label !== void 0 ? M.label : M.name,
14594
- qualifiedEntityName: M.qualifiedEntityName,
14595
- entityId: M.entityId,
14596
- entityName: M.entityName,
14597
- entityType: M.entityType,
14598
- direction: M.direction
14589
+ (D) => ({
14590
+ id: D.id,
14591
+ name: D.name,
14592
+ dataType: D.dataType,
14593
+ label: D.label !== void 0 ? D.label : D.name,
14594
+ qualifiedEntityName: D.qualifiedEntityName,
14595
+ entityId: D.entityId,
14596
+ entityName: D.entityName,
14597
+ entityType: D.entityType,
14598
+ direction: D.direction
14599
14599
  })
14600
14600
  );
14601
14601
  case "source":
@@ -14606,30 +14606,30 @@ const wr = (t) => {
14606
14606
  },
14607
14607
  [t]
14608
14608
  ), x = Se(
14609
- (z, M) => {
14609
+ (z, D) => {
14610
14610
  if (h)
14611
14611
  switch (z) {
14612
14612
  case "groupBy": {
14613
14613
  n(h, {
14614
- groupByColumns: M
14614
+ groupByColumns: D
14615
14615
  });
14616
14616
  break;
14617
14617
  }
14618
14618
  case "metrics": {
14619
14619
  n(h, {
14620
- metricColumns: M
14620
+ metricColumns: D
14621
14621
  });
14622
14622
  break;
14623
14623
  }
14624
14624
  case "pivotBy": {
14625
14625
  n(h, {
14626
- pivotByColumns: M
14626
+ pivotByColumns: D
14627
14627
  });
14628
14628
  break;
14629
14629
  }
14630
14630
  case "sortBy": {
14631
14631
  n(h, {
14632
- sortByColumns: M
14632
+ sortByColumns: D
14633
14633
  });
14634
14634
  break;
14635
14635
  }
@@ -14643,22 +14643,22 @@ const wr = (t) => {
14643
14643
  // createSortByColumn,
14644
14644
  ]
14645
14645
  ), y = Se(
14646
- (z, M, D) => {
14646
+ (z, D, T) => {
14647
14647
  if (!h) return;
14648
- const P = p(z)[M];
14648
+ const P = p(z)[D];
14649
14649
  if (P)
14650
14650
  switch (z) {
14651
14651
  case "groupBy":
14652
- s(h, P.id, { label: D });
14652
+ s(h, P.id, { label: T });
14653
14653
  break;
14654
14654
  case "metrics":
14655
- r(h, P.id, { label: D });
14655
+ r(h, P.id, { label: T });
14656
14656
  break;
14657
14657
  case "pivotBy":
14658
- l(h, P.id, { label: D });
14658
+ l(h, P.id, { label: T });
14659
14659
  break;
14660
14660
  case "sortBy":
14661
- i(h, P.id, { label: D });
14661
+ i(h, P.id, { label: T });
14662
14662
  break;
14663
14663
  }
14664
14664
  },
@@ -14671,58 +14671,58 @@ const wr = (t) => {
14671
14671
  i
14672
14672
  ]
14673
14673
  ), f = Se(
14674
- (z, M) => {
14674
+ (z, D) => {
14675
14675
  if (!h) return;
14676
14676
  const E = p("metrics")[z];
14677
14677
  E && r(h, E.id, {
14678
- aggregate: M,
14678
+ aggregate: D,
14679
14679
  label: zc(
14680
14680
  E.name,
14681
- M
14681
+ D
14682
14682
  )
14683
14683
  });
14684
14684
  },
14685
14685
  [h, p, r]
14686
14686
  ), v = Se(
14687
- (z, M, D) => {
14687
+ (z, D, T) => {
14688
14688
  if (!h) return;
14689
14689
  const P = p("groupBy")[z];
14690
14690
  if (!P) return;
14691
14691
  const F = {
14692
- dateFormat: M
14692
+ dateFormat: D
14693
14693
  };
14694
- M === "custom" && D ? F.customFormat = D : F.customFormat = void 0, s(h, P.id, F);
14694
+ D === "custom" && T ? F.customFormat = T : F.customFormat = void 0, s(h, P.id, F);
14695
14695
  },
14696
14696
  [h, p, s]
14697
14697
  ), g = Se(
14698
- (z, M) => {
14698
+ (z, D) => {
14699
14699
  if (!h) return;
14700
14700
  const E = p("groupBy")[z];
14701
14701
  E && s(h, E.id, {
14702
- granularity: M
14702
+ granularity: D
14703
14703
  });
14704
14704
  },
14705
14705
  [h, p, s]
14706
14706
  ), b = Se(
14707
- (z, M) => {
14707
+ (z, D) => {
14708
14708
  if (!h) return;
14709
14709
  const E = p("metrics")[z];
14710
14710
  E && r(h, E.id, {
14711
- aliasTemplate: M
14711
+ aliasTemplate: D
14712
14712
  });
14713
14713
  },
14714
14714
  [h, p, r]
14715
14715
  ), I = Se(
14716
- (z, M) => {
14717
- if (console.log("handleValueAliasesChange", z, M), !h) return;
14718
- console.log("handleValueAliasesChange", z, M);
14716
+ (z, D) => {
14717
+ if (console.log("handleValueAliasesChange", z, D), !h) return;
14718
+ console.log("handleValueAliasesChange", z, D);
14719
14719
  const E = p("metrics")[z];
14720
- E && (console.log("handleValueAliasesChange", M), r(h, E.id, {
14721
- valueAliases: M
14720
+ E && (console.log("handleValueAliasesChange", D), r(h, E.id, {
14721
+ valueAliases: D
14722
14722
  }));
14723
14723
  },
14724
14724
  [h, p, r]
14725
- ), T = Se(
14725
+ ), M = Se(
14726
14726
  (z) => {
14727
14727
  h && n(h, { comparisonType: z });
14728
14728
  },
@@ -14751,15 +14751,15 @@ const wr = (t) => {
14751
14751
  (z) => {
14752
14752
  var j;
14753
14753
  if (!h) return;
14754
- const M = [
14754
+ const D = [
14755
14755
  ...p("groupBy"),
14756
14756
  ...p("pivotBy"),
14757
14757
  ...p("metrics"),
14758
14758
  ...p("sortBy")
14759
- ], D = (j = t == null ? void 0 : t.config) == null ? void 0 : j.joinPlan, E = _c(
14759
+ ], T = (j = t == null ? void 0 : t.config) == null ? void 0 : j.joinPlan, E = _c(
14760
14760
  z,
14761
- M,
14762
- D
14761
+ D,
14762
+ T
14763
14763
  );
14764
14764
  if (!E.isValid) {
14765
14765
  E.showError && hn();
@@ -14767,7 +14767,7 @@ const wr = (t) => {
14767
14767
  }
14768
14768
  const P = Vc(
14769
14769
  z,
14770
- M
14770
+ D
14771
14771
  ), F = p(P);
14772
14772
  if (Ts(z, F)) return;
14773
14773
  const R = Ms(z, P, F);
@@ -14780,9 +14780,9 @@ const wr = (t) => {
14780
14780
  x
14781
14781
  ]
14782
14782
  ), L = Se(
14783
- (z, M) => {
14783
+ (z, D) => {
14784
14784
  if (!h) return;
14785
- const E = p(z)[M];
14785
+ const E = p(z)[D];
14786
14786
  if (E) {
14787
14787
  if (z !== "sortBy") {
14788
14788
  const P = p("sortBy"), F = P.filter(
@@ -14830,7 +14830,7 @@ const wr = (t) => {
14830
14830
  removeField: L,
14831
14831
  handleFieldClick: w,
14832
14832
  // KPI-specific handlers
14833
- handleKpiComparisonTypeChange: T,
14833
+ handleKpiComparisonTypeChange: M,
14834
14834
  handleKpiShowTrendlineChange: C,
14835
14835
  handleKpiTrendlineWindowChange: A,
14836
14836
  handleKpiTrendlineGranularityChange: N,
@@ -14858,7 +14858,7 @@ function Gh({ field: t }) {
14858
14858
  transition: i,
14859
14859
  isDragging: o
14860
14860
  } = Ka({ id: t.id }), [c, u] = V(!1), d = O((y) => y.card), { handleFieldClick: m } = wr(d), h = {
14861
- transform: sa.Transform.toString(l),
14861
+ transform: na.Transform.toString(l),
14862
14862
  transition: i
14863
14863
  };
14864
14864
  Ge(t.dataType);
@@ -14965,16 +14965,16 @@ function $h() {
14965
14965
  ), m = (I) => {
14966
14966
  if (I.dataType === "number" || I.dataType === "integer" || I.dataType === "float" || I.dataType === "decimal" || I.dataType === "currency")
14967
14967
  return "metrics";
14968
- const T = Ge(I.dataType);
14969
- return ["date", "string", "boolean"].includes(T) ? "dimensions" : T === "number" ? "metrics" : "dimensions";
14968
+ const M = Ge(I.dataType);
14969
+ return ["date", "string", "boolean"].includes(M) ? "dimensions" : M === "number" ? "metrics" : "dimensions";
14970
14970
  }, p = (s === "all" ? d : d.filter(
14971
14971
  (I) => m(I) === s
14972
- )).reduce((I, T) => {
14973
- const C = T.qualifiedEntityName || "Other Fields";
14972
+ )).reduce((I, M) => {
14973
+ const C = M.qualifiedEntityName || "Other Fields";
14974
14974
  return I[C] || (I[C] = {
14975
- label: jc(T.entityName),
14975
+ label: jc(M.entityName),
14976
14976
  fields: []
14977
- }), I[C].fields.push(T), I;
14977
+ }), I[C].fields.push(M), I;
14978
14978
  }, {}), y = Object.keys(p), f = d.filter(
14979
14979
  (I) => m(I) === "dimensions"
14980
14980
  ).length, v = d.filter(
@@ -15049,10 +15049,10 @@ function $h() {
15049
15049
  type: "multiple",
15050
15050
  defaultValue: y,
15051
15051
  className: "space-y-2",
15052
- children: Object.entries(p).map(([I, T]) => {
15052
+ children: Object.entries(p).map(([I, M]) => {
15053
15053
  const C = o.find((A) => A.entityName === I) || {
15054
15054
  entityName: I,
15055
- label: T.label
15055
+ label: M.label
15056
15056
  };
15057
15057
  return /* @__PURE__ */ a(
15058
15058
  Te,
@@ -15072,13 +15072,13 @@ function $h() {
15072
15072
  {
15073
15073
  variant: "secondary",
15074
15074
  className: "rounded-full text-xs text-muted-foreground group-hover:bg-background",
15075
- children: T.fields.length
15075
+ children: M.fields.length
15076
15076
  }
15077
15077
  )
15078
15078
  ]
15079
15079
  }
15080
15080
  ) }),
15081
- /* @__PURE__ */ e(Ie, { className: "pb-2", children: /* @__PURE__ */ e("div", { className: "space-y-1", children: T.fields.map((A) => /* @__PURE__ */ e(Gh, { field: A }, A.id)) }) })
15081
+ /* @__PURE__ */ e(Ie, { className: "pb-2", children: /* @__PURE__ */ e("div", { className: "space-y-1", children: M.fields.map((A) => /* @__PURE__ */ e(Gh, { field: A }, A.id)) }) })
15082
15082
  ]
15083
15083
  },
15084
15084
  I
@@ -15091,8 +15091,8 @@ function $h() {
15091
15091
  /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-400", children: "Try selecting different data sources" })
15092
15092
  ] }),
15093
15093
  Object.keys(p).length === 0 && i.length > 0 && /* @__PURE__ */ e("div", { className: "py-4 text-center text-sm text-gray-500", children: "No fields found for this category" }),
15094
- /* @__PURE__ */ e(na, { orientation: "horizontal" }),
15095
- /* @__PURE__ */ e(na, { orientation: "vertical" })
15094
+ /* @__PURE__ */ e(ra, { orientation: "horizontal" }),
15095
+ /* @__PURE__ */ e(ra, { orientation: "vertical" })
15096
15096
  ] })
15097
15097
  ] });
15098
15098
  }
@@ -15143,18 +15143,18 @@ function qh({
15143
15143
  }), i(new Set([...l].filter((N) => N !== A)));
15144
15144
  }, u = (A, N) => {
15145
15145
  var k, z;
15146
- const S = s.joins.find((M) => M.id === A);
15146
+ const S = s.joins.find((D) => D.id === A);
15147
15147
  if (!S) return;
15148
15148
  const w = { ...S, ...N }, L = s.joins.map(
15149
- (M) => M.id === A ? w : M
15149
+ (D) => D.id === A ? w : D
15150
15150
  );
15151
15151
  if ((k = w.source) != null && k.name && ((z = w.target) != null && z.name) && w.joinKeyGroups[0].keys.length === 0) {
15152
- const M = n.find(
15152
+ const D = n.find(
15153
15153
  (F) => {
15154
15154
  var R;
15155
15155
  return F.name === ((R = w.source) == null ? void 0 : R.name);
15156
15156
  }
15157
- ), D = n.find(
15157
+ ), T = n.find(
15158
15158
  (F) => {
15159
15159
  var R;
15160
15160
  return F.name === ((R = w.target) == null ? void 0 : R.name);
@@ -15167,9 +15167,9 @@ function qh({
15167
15167
  dataType: "",
15168
15168
  label: "",
15169
15169
  qualifiedFieldName: "",
15170
- entityId: (M == null ? void 0 : M.name) || "",
15171
- entityName: (M == null ? void 0 : M.name) || "",
15172
- entityType: (M == null ? void 0 : M.type) || "table"
15170
+ entityId: (D == null ? void 0 : D.name) || "",
15171
+ entityName: (D == null ? void 0 : D.name) || "",
15172
+ entityType: (D == null ? void 0 : D.type) || "table"
15173
15173
  },
15174
15174
  target: {
15175
15175
  id: `target-${Date.now()}`,
@@ -15177,9 +15177,9 @@ function qh({
15177
15177
  dataType: "",
15178
15178
  label: "",
15179
15179
  qualifiedFieldName: "",
15180
- entityId: (D == null ? void 0 : D.name) || "",
15181
- entityName: (D == null ? void 0 : D.name) || "",
15182
- entityType: (D == null ? void 0 : D.type) || "table"
15180
+ entityId: (T == null ? void 0 : T.name) || "",
15181
+ entityName: (T == null ? void 0 : T.name) || "",
15182
+ entityType: (T == null ? void 0 : T.type) || "table"
15183
15183
  },
15184
15184
  operator: "="
15185
15185
  }, P = [...w.joinKeyGroups];
@@ -15204,8 +15204,8 @@ function qh({
15204
15204
  const N = s.joins.findIndex((S) => S.id === A);
15205
15205
  if (N > 0) {
15206
15206
  const S = [...s.joins], w = { ...S[N] }, L = { ...S[N - 1] };
15207
- S[N] = L, S[N - 1] = w, S.forEach((z, M) => {
15208
- z.sequence = M + 1;
15207
+ S[N] = L, S[N - 1] = w, S.forEach((z, D) => {
15208
+ z.sequence = D + 1;
15209
15209
  });
15210
15210
  const k = {
15211
15211
  ...s,
@@ -15218,8 +15218,8 @@ function qh({
15218
15218
  const N = s.joins.findIndex((S) => S.id === A);
15219
15219
  if (N < s.joins.length - 1) {
15220
15220
  const S = [...s.joins], w = { ...S[N] }, L = { ...S[N + 1] };
15221
- S[N] = L, S[N + 1] = w, S.forEach((z, M) => {
15222
- z.sequence = M + 1;
15221
+ S[N] = L, S[N + 1] = w, S.forEach((z, D) => {
15222
+ z.sequence = D + 1;
15223
15223
  });
15224
15224
  const k = {
15225
15225
  ...s,
@@ -15270,12 +15270,12 @@ function qh({
15270
15270
  w.splice(N, 1), u(A, { joinKeyGroups: w });
15271
15271
  },
15272
15272
  addJoinKey: (A, N) => {
15273
- const S = s.joins.find((M) => M.id === A);
15273
+ const S = s.joins.find((D) => D.id === A);
15274
15274
  if (!S) return;
15275
15275
  const w = n.find(
15276
- (M) => M.name === S.source.name
15276
+ (D) => D.name === S.source.name
15277
15277
  ), L = n.find(
15278
- (M) => M.name === S.target.name
15278
+ (D) => D.name === S.target.name
15279
15279
  ), k = [...S.joinKeyGroups], z = {
15280
15280
  id: `key-${Date.now()}`,
15281
15281
  source: {
@@ -15310,25 +15310,25 @@ function qh({
15310
15310
  if (!k) return;
15311
15311
  const z = n.find(
15312
15312
  (P) => P.name === k.source.name
15313
- ), M = n.find(
15313
+ ), D = n.find(
15314
15314
  (P) => P.name === k.target.name
15315
- ), D = [...k.joinKeyGroups], E = D[N].keys[S];
15316
- w === "sourceColumnName" && z ? D[N].keys[S] = {
15315
+ ), T = [...k.joinKeyGroups], E = T[N].keys[S];
15316
+ w === "sourceColumnName" && z ? T[N].keys[S] = {
15317
15317
  ...E,
15318
15318
  source: {
15319
15319
  ...E.source,
15320
15320
  name: L
15321
15321
  }
15322
- } : w === "targetColumnName" && M ? D[N].keys[S] = {
15322
+ } : w === "targetColumnName" && D ? T[N].keys[S] = {
15323
15323
  ...E,
15324
15324
  target: {
15325
15325
  ...E.target,
15326
15326
  name: L
15327
15327
  }
15328
- } : w === "operator" && (D[N].keys[S] = {
15328
+ } : w === "operator" && (T[N].keys[S] = {
15329
15329
  ...E,
15330
15330
  operator: L
15331
- }), u(A, { joinKeyGroups: D });
15331
+ }), u(A, { joinKeyGroups: T });
15332
15332
  },
15333
15333
  removeJoinKey: (A, N, S) => {
15334
15334
  const w = s.joins.find((k) => k.id === A);
@@ -15346,11 +15346,11 @@ function qh({
15346
15346
  FROM ${N.name}`;
15347
15347
  return A.forEach((w) => {
15348
15348
  const L = n.find(
15349
- (M) => M.name === w.target.name
15349
+ (D) => D.name === w.target.name
15350
15350
  );
15351
15351
  if (!L) return;
15352
- const k = w.joinKeyGroups.filter((M) => M.keys && M.keys.length > 0).map((M) => {
15353
- const D = M.keys.filter(
15352
+ const k = w.joinKeyGroups.filter((D) => D.keys && D.keys.length > 0).map((D) => {
15353
+ const T = D.keys.filter(
15354
15354
  (E) => {
15355
15355
  var P, F, R, j;
15356
15356
  return ((P = E.source) == null ? void 0 : P.name) && ((F = E.target) == null ? void 0 : F.name) && ((R = E.source) == null ? void 0 : R.entityName) && ((j = E.target) == null ? void 0 : j.entityName);
@@ -15358,7 +15358,7 @@ FROM ${N.name}`;
15358
15358
  ).map(
15359
15359
  (E) => `${E.source.entityName}.${E.source.name} ${E.operator} ${E.target.entityName}.${E.target.name}`
15360
15360
  );
15361
- return D.length > 1 ? `(${D.join(` ${M.operator} `)})` : D[0];
15361
+ return T.length > 1 ? `(${T.join(` ${D.operator} `)})` : T[0];
15362
15362
  }).filter(Boolean), z = k.length > 1 ? k.join(" OR ") : k[0] || "condition_here";
15363
15363
  S += `
15364
15364
  ${w.joinType} JOIN ${L.name}
@@ -15401,7 +15401,7 @@ function Kh({
15401
15401
  getAvailableTargetEntities: g,
15402
15402
  addJoinKeyGroup: b,
15403
15403
  updateGroupOperator: I,
15404
- removeJoinKeyGroup: T,
15404
+ removeJoinKeyGroup: M,
15405
15405
  addJoinKey: C,
15406
15406
  updateJoinKey: A,
15407
15407
  removeJoinKey: N,
@@ -15411,7 +15411,7 @@ function Kh({
15411
15411
  initialJoinPlan: t,
15412
15412
  availableDataSources: n
15413
15413
  }), L = (k) => {
15414
- const z = o.find((M) => M.entityName === k);
15414
+ const z = o.find((D) => D.entityName === k);
15415
15415
  return (z == null ? void 0 : z.columns) || [];
15416
15416
  };
15417
15417
  return /* @__PURE__ */ a("div", { className: "space-y-6", children: [
@@ -15423,7 +15423,7 @@ function Kh({
15423
15423
  value: c.baseEntity.name,
15424
15424
  onValueChange: (k) => {
15425
15425
  const z = n.find(
15426
- (M) => M.name === k
15426
+ (D) => D.name === k
15427
15427
  );
15428
15428
  d({
15429
15429
  ...c,
@@ -15476,9 +15476,9 @@ function Kh({
15476
15476
  c.joins.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-dashed py-8 text-center text-muted-foreground", children: /* @__PURE__ */ e("p", { children: "No joins configured. Add a join to connect multiple data sources." }) }) : /* @__PURE__ */ e("div", { className: "max-h-[300px] space-y-4 overflow-y-auto", children: c.joins.map((k) => {
15477
15477
  const z = n.find(
15478
15478
  (E) => E.name === k.source.name
15479
- ), M = n.find(
15479
+ ), D = n.find(
15480
15480
  (E) => E.name === k.target.name
15481
- ), D = u.has(k.id);
15481
+ ), T = u.has(k.id);
15482
15482
  return /* @__PURE__ */ a(Ca, { className: "border", children: [
15483
15483
  /* @__PURE__ */ e(In, { className: "pb-3", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
15484
15484
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
@@ -15486,11 +15486,11 @@ function Kh({
15486
15486
  /* @__PURE__ */ a(An, { className: "text-sm", children: [
15487
15487
  "Join ",
15488
15488
  k.sequence,
15489
- z && M && /* @__PURE__ */ a("span", { className: "ml-2 font-normal text-gray-600", children: [
15489
+ z && D && /* @__PURE__ */ a("span", { className: "ml-2 font-normal text-gray-600", children: [
15490
15490
  "(",
15491
15491
  z.name,
15492
15492
  " → ",
15493
- M.name,
15493
+ D.name,
15494
15494
  ")"
15495
15495
  ] })
15496
15496
  ] })
@@ -15522,7 +15522,7 @@ function Kh({
15522
15522
  variant: "ghost",
15523
15523
  size: "sm",
15524
15524
  onClick: () => f(k.id),
15525
- children: D ? /* @__PURE__ */ e(qa, { className: "h-4 w-4" }) : /* @__PURE__ */ e(Vt, { className: "h-4 w-4" })
15525
+ children: T ? /* @__PURE__ */ e(qa, { className: "h-4 w-4" }) : /* @__PURE__ */ e(Vt, { className: "h-4 w-4" })
15526
15526
  }
15527
15527
  ),
15528
15528
  /* @__PURE__ */ e(
@@ -15536,7 +15536,7 @@ function Kh({
15536
15536
  )
15537
15537
  ] })
15538
15538
  ] }) }),
15539
- D && /* @__PURE__ */ a(os, { className: "space-y-4 pb-6", children: [
15539
+ T && /* @__PURE__ */ a(os, { className: "space-y-4 pb-6", children: [
15540
15540
  /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: [
15541
15541
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
15542
15542
  /* @__PURE__ */ e(U, { children: "Source" }),
@@ -15693,7 +15693,7 @@ function Kh({
15693
15693
  )
15694
15694
  ] })
15695
15695
  ] }),
15696
- k.source.name && k.target.name && z && M && /* @__PURE__ */ a("div", { className: "space-y-4", children: [
15696
+ k.source.name && k.target.name && z && D && /* @__PURE__ */ a("div", { className: "space-y-4", children: [
15697
15697
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
15698
15698
  /* @__PURE__ */ e(U, { children: "Join Conditions" }),
15699
15699
  /* @__PURE__ */ a(
@@ -15758,7 +15758,7 @@ function Kh({
15758
15758
  type: "button",
15759
15759
  variant: "ghost",
15760
15760
  size: "sm",
15761
- onClick: () => T(
15761
+ onClick: () => M(
15762
15762
  k.id,
15763
15763
  P
15764
15764
  ),
@@ -16130,7 +16130,7 @@ FROM ${x.name}`;
16130
16130
  );
16131
16131
  if (!v) return;
16132
16132
  const g = f.joinKeyGroups.filter((I) => I.keys && I.keys.length > 0).map((I) => {
16133
- const T = I.keys.filter(
16133
+ const M = I.keys.filter(
16134
16134
  (C) => {
16135
16135
  var A, N, S, w;
16136
16136
  return ((A = C.source) == null ? void 0 : A.name) && ((N = C.target) == null ? void 0 : N.name) && ((S = C.source) == null ? void 0 : S.entityName) && ((w = C.target) == null ? void 0 : w.entityName);
@@ -16138,7 +16138,7 @@ FROM ${x.name}`;
16138
16138
  ).map(
16139
16139
  (C) => `${C.source.entityName}.${C.source.name} ${C.operator} ${C.target.entityName}.${C.target.name}`
16140
16140
  );
16141
- return T.length > 1 ? `(${T.join(` ${I.operator} `)})` : T[0];
16141
+ return M.length > 1 ? `(${M.join(` ${I.operator} `)})` : M[0];
16142
16142
  }).filter(Boolean), b = g.length > 1 ? g.join(" OR ") : g[0] || "condition_here";
16143
16143
  y += `
16144
16144
  ${f.joinType} JOIN ${v.name}
@@ -16442,7 +16442,7 @@ function Xh({
16442
16442
  // onToggleVisibility,
16443
16443
  }) {
16444
16444
  const [n, s] = V(!1), [r, l] = V(!1), [i, o] = V(!0), c = O((h) => h.card.dataSource);
16445
- ia();
16445
+ Ht();
16446
16446
  const { updateDataSource: u } = ie(), d = {
16447
16447
  connectionId: "",
16448
16448
  connectionType: "",
@@ -16631,10 +16631,10 @@ function ap({
16631
16631
  selectedChart: t,
16632
16632
  onChartChange: n
16633
16633
  }) {
16634
- var T;
16634
+ var M;
16635
16635
  const [s, r] = V(!1), { data: l } = Ni();
16636
16636
  tp();
16637
- const o = ((T = O((C) => C.card).customCardPreferences) == null ? void 0 : T.url) || "";
16637
+ const o = ((M = O((C) => C.card).customCardPreferences) == null ? void 0 : M.url) || "";
16638
16638
  vr(o);
16639
16639
  const { setCardType: c, setCardPreferences: u, setIsDevMode: d } = O(
16640
16640
  (C) => C.actions
@@ -16700,7 +16700,7 @@ function ap({
16700
16700
  ]
16701
16701
  }
16702
16702
  ) }),
16703
- /* @__PURE__ */ e(Ht, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
16703
+ /* @__PURE__ */ e(Qt, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
16704
16704
  /* @__PURE__ */ e(ms, { placeholder: "Search chart types..." }),
16705
16705
  /* @__PURE__ */ a(hs, { className: "mb-2 max-h-[300px]", children: [
16706
16706
  /* @__PURE__ */ e(ps, { children: "No chart type found." }),
@@ -17160,7 +17160,7 @@ function cp({
17160
17160
  editingCondition: l,
17161
17161
  onSave: i
17162
17162
  }) {
17163
- var I, T;
17163
+ var I, M;
17164
17164
  const o = !!l, [c, u] = V(o ? "values" : "fields"), [d, m] = V(""), [h, p] = V({
17165
17165
  id: (l == null ? void 0 : l.id) || It(),
17166
17166
  field: (l == null ? void 0 : l.field) || null,
@@ -17237,7 +17237,7 @@ function cp({
17237
17237
  return ke(() => {
17238
17238
  t && b();
17239
17239
  }, [t, o, l]), /* @__PURE__ */ e(rt, { open: t, onOpenChange: n, children: /* @__PURE__ */ a(lt, { className: "max-w-2xl", children: [
17240
- /* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(ot, { children: o ? `Edit Filter: ${(I = h.field) == null ? void 0 : I.label}` : c === "fields" ? "Select Field to Filter" : `Select Values for ${(T = h.field) == null ? void 0 : T.label}` }) }),
17240
+ /* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(ot, { children: o ? `Edit Filter: ${(I = h.field) == null ? void 0 : I.label}` : c === "fields" ? "Select Field to Filter" : `Select Values for ${(M = h.field) == null ? void 0 : M.label}` }) }),
17241
17241
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
17242
17242
  !o && (r == null ? void 0 : r.conditions) && r.conditions.length > 0 && c === "fields" && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
17243
17243
  /* @__PURE__ */ e(U, { className: "text-xs font-medium text-muted-foreground", children: "Current Filters:" }),
@@ -17423,13 +17423,13 @@ function up({
17423
17423
  handleGranularityChange: g,
17424
17424
  handleAliasTemplateChange: b,
17425
17425
  handleValueAliasesChange: I,
17426
- removeField: T,
17426
+ removeField: M,
17427
17427
  handleKpiComparisonTypeChange: C,
17428
17428
  handleKpiShowTrendlineChange: A,
17429
17429
  handleKpiTrendlineWindowChange: N,
17430
17430
  handleKpiTrendlineGranularityChange: S,
17431
17431
  handleKpiTargetValueChange: w
17432
- } = wr(x), [L, k] = V(!1), [z, M] = V(!1), [D, E] = V(null), [P, F] = V(
17432
+ } = wr(x), [L, k] = V(!1), [z, D] = V(!1), [T, E] = V(null), [P, F] = V(
17433
17433
  t.dateFormat || "YYYY-MM-DD"
17434
17434
  ), [R, j] = V(t.customFormat || ""), [K, Q] = V(!!t.customFormat), [$, ne] = V(
17435
17435
  t.granularity || "day"
@@ -17466,11 +17466,11 @@ function up({
17466
17466
  metricColumns: nt
17467
17467
  });
17468
17468
  }
17469
- M(!1);
17469
+ D(!1);
17470
17470
  }, He = () => {
17471
- T(n, s);
17471
+ M(n, s);
17472
17472
  }, Pe = {
17473
- transform: sa.Transform.toString(m),
17473
+ transform: na.Transform.toString(m),
17474
17474
  transition: h
17475
17475
  }, se = Ge(t.dataType), Z = se === "date", B = o === "kpi", ce = (te) => {
17476
17476
  switch (te) {
@@ -17532,7 +17532,7 @@ function up({
17532
17532
  { value: "custom", label: "Custom Format..." }
17533
17533
  ];
17534
17534
  }
17535
- }, Ae = ce($), Le = n !== "pivotBy", we = Z && n === "groupBy", ze = !B && Z && n === "groupBy", Ke = B && Z && n === "groupBy", ka = B && n === "metrics" && ((Mr = x.config) == null ? void 0 : Mr.comparisonType) === "target", Da = n === "metrics", Qt = () => /* @__PURE__ */ e(
17535
+ }, Ae = ce($), Le = n !== "pivotBy", we = Z && n === "groupBy", ze = !B && Z && n === "groupBy", Ke = B && Z && n === "groupBy", ka = B && n === "metrics" && ((Mr = x.config) == null ? void 0 : Mr.comparisonType) === "target", Da = n === "metrics", Zt = () => /* @__PURE__ */ e(
17536
17536
  "div",
17537
17537
  {
17538
17538
  title: `${t.entityName}.${t.name}`,
@@ -17606,7 +17606,7 @@ function up({
17606
17606
  ] })
17607
17607
  ] })
17608
17608
  ] }) : null, Ha = () => {
17609
- var te, Be, Ue, nt, Zt;
17609
+ var te, Be, Ue, nt, Xt;
17610
17610
  return Ke ? /* @__PURE__ */ a(J, { children: [
17611
17611
  /* @__PURE__ */ a("div", { className: "space-y-1", children: [
17612
17612
  /* @__PURE__ */ e(U, { className: "text-xs font-medium text-muted-foreground", children: "Comparison Type" }),
@@ -17661,7 +17661,7 @@ function up({
17661
17661
  /* @__PURE__ */ a(
17662
17662
  fe,
17663
17663
  {
17664
- value: ((Zt = x.config) == null ? void 0 : Zt.trendlineGranularity) || "day",
17664
+ value: ((Xt = x.config) == null ? void 0 : Xt.trendlineGranularity) || "day",
17665
17665
  onValueChange: S,
17666
17666
  children: [
17667
17667
  /* @__PURE__ */ e(ge, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(xe, { placeholder: "Select granularity..." }) }),
@@ -17726,7 +17726,7 @@ function up({
17726
17726
  {
17727
17727
  className: "flex cursor-pointer items-center gap-2 rounded bg-muted/50 p-2 text-xs transition-colors hover:bg-muted/70",
17728
17728
  onClick: () => {
17729
- E(te), M(!0);
17729
+ E(te), D(!0);
17730
17730
  },
17731
17731
  children: [
17732
17732
  /* @__PURE__ */ a("span", { className: "font-medium", children: [
@@ -17761,16 +17761,16 @@ function up({
17761
17761
  var nt;
17762
17762
  Be.stopPropagation();
17763
17763
  const Ue = Y.conditions.filter(
17764
- (Zt) => Zt.id !== te.id
17764
+ (Xt) => Xt.id !== te.id
17765
17765
  );
17766
17766
  if (Ue.length > 0) {
17767
- const Zt = {
17767
+ const Xt = {
17768
17768
  ...Y,
17769
17769
  conditions: Ue
17770
17770
  };
17771
- be(Zt);
17771
+ be(Xt);
17772
17772
  } else if (W(void 0), n === "metrics") {
17773
- const Zt = {
17773
+ const Xt = {
17774
17774
  ...t,
17775
17775
  parameters: {
17776
17776
  ...t.parameters,
@@ -17779,7 +17779,7 @@ function up({
17779
17779
  }, vs = [
17780
17780
  ...((nt = x.config) == null ? void 0 : nt.metricColumns) || []
17781
17781
  ];
17782
- vs[s] = Zt, O.getState().actions.updateCardConfig(x.id, {
17782
+ vs[s] = Xt, O.getState().actions.updateCardConfig(x.id, {
17783
17783
  metricColumns: vs
17784
17784
  });
17785
17785
  }
@@ -17798,7 +17798,7 @@ function up({
17798
17798
  size: "sm",
17799
17799
  className: "h-8 w-full justify-start text-xs",
17800
17800
  onClick: () => {
17801
- E(null), M(!0);
17801
+ E(null), D(!0);
17802
17802
  },
17803
17803
  children: [
17804
17804
  /* @__PURE__ */ e(Os, { className: "mr-2 h-3 w-3" }),
@@ -17910,7 +17910,7 @@ function up({
17910
17910
  )
17911
17911
  ] }),
17912
17912
  L && /* @__PURE__ */ a("div", { className: "space-y-3", children: [
17913
- Qt(),
17913
+ Zt(),
17914
17914
  vt(),
17915
17915
  o === "kpi" && oe(),
17916
17916
  at(),
@@ -17926,11 +17926,11 @@ function up({
17926
17926
  {
17927
17927
  open: z,
17928
17928
  onOpenChange: (te) => {
17929
- M(te), te || E(null);
17929
+ D(te), te || E(null);
17930
17930
  },
17931
17931
  availableFields: Bi,
17932
17932
  existingFilters: Y,
17933
- editingCondition: D,
17933
+ editingCondition: T,
17934
17934
  onSave: (te) => {
17935
17935
  var Be;
17936
17936
  if (te)
@@ -18081,7 +18081,7 @@ function Cs({
18081
18081
  ref: c,
18082
18082
  className: `rounded-lg border-2 border-dashed p-1 transition-all ${o ? "border-blue-500 bg-blue-50 dark:bg-blue-950" : h ? "border-blue-200 bg-blue-50/30 dark:border-blue-800 dark:bg-blue-950/30" : "min-h-[60px] border-muted-foreground/20 bg-background"}`,
18083
18083
  children: n.length === 0 ? /* @__PURE__ */ e("div", { className: "flex min-h-[40px] items-center justify-center text-sm text-gray-400", children: r }) : /* @__PURE__ */ e(
18084
- ra,
18084
+ la,
18085
18085
  {
18086
18086
  items: n.map((y) => y.id),
18087
18087
  strategy: as,
@@ -18157,7 +18157,7 @@ function dn({
18157
18157
  "aria-label": `Change color for ${s}`
18158
18158
  }
18159
18159
  ) }),
18160
- /* @__PURE__ */ e(Ht, { align: "start", className: "w-auto p-2", children: /* @__PURE__ */ a("div", { className: "space-y-2", children: [
18160
+ /* @__PURE__ */ e(Qt, { align: "start", className: "w-auto p-2", children: /* @__PURE__ */ a("div", { className: "space-y-2", children: [
18161
18161
  /* @__PURE__ */ e("div", { className: "grid grid-cols-3 items-center justify-items-center gap-1", children: hp.map((u) => /* @__PURE__ */ e(
18162
18162
  "button",
18163
18163
  {
@@ -18299,7 +18299,7 @@ function pp() {
18299
18299
  }
18300
18300
  ),
18301
18301
  (() => {
18302
- var b, I, T;
18302
+ var b, I, M;
18303
18303
  const g = i.calculationType || "difference";
18304
18304
  return /* @__PURE__ */ a("div", { className: "space-y-2 rounded-md bg-muted/50 p-2 text-xs", children: [
18305
18305
  /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: (b = ws[g]) == null ? void 0 : b.description }),
@@ -18311,7 +18311,7 @@ function pp() {
18311
18311
  /* @__PURE__ */ a("div", { className: "border-t pt-1 italic text-muted-foreground", children: [
18312
18312
  /* @__PURE__ */ e("span", { className: "font-medium", children: "Example:" }),
18313
18313
  " ",
18314
- (T = ws[g]) == null ? void 0 : T.example
18314
+ (M = ws[g]) == null ? void 0 : M.example
18315
18315
  ] })
18316
18316
  ] });
18317
18317
  })()
@@ -18813,7 +18813,7 @@ function xp({
18813
18813
  sortByFields: i
18814
18814
  }
18815
18815
  ),
18816
- /* @__PURE__ */ e(na, { orientation: "horizontal" })
18816
+ /* @__PURE__ */ e(ra, { orientation: "horizontal" })
18817
18817
  ] })
18818
18818
  ]
18819
18819
  }
@@ -18987,19 +18987,19 @@ function vp({
18987
18987
  typeof k == "string" ? k = `'${k}'` : Array.isArray(k) && (k = `'${k.join(", ")}'`);
18988
18988
  else if (S.field.dataType === "date" || S.field.dataType === "datetime" || S.field.dataType === "timestamp")
18989
18989
  if (S.operator === "between" && Array.isArray(k) && k.length === 2) {
18990
- const z = k[0] ? `'${k[0]}'` : "NULL", M = k[1] ? `'${k[1]}'` : "NULL";
18991
- return `${w} BETWEEN ${z} AND ${M}`;
18990
+ const z = k[0] ? `'${k[0]}'` : "NULL", D = k[1] ? `'${k[1]}'` : "NULL";
18991
+ return `${w} BETWEEN ${z} AND ${D}`;
18992
18992
  } else if ((S.operator === "in" || S.operator === "not in") && Array.isArray(k)) {
18993
- const z = k.map((M) => M ? `'${M}'` : "NULL").join(", ");
18993
+ const z = k.map((D) => D ? `'${D}'` : "NULL").join(", ");
18994
18994
  return `${w} ${L} (${z})`;
18995
18995
  } else typeof k == "string" || k instanceof Date ? k = `'${k}'` : Array.isArray(k) && k.length > 0 && (k = `'${k[0]}'`);
18996
18996
  else if (["in", "not in"].includes(S.operator)) {
18997
18997
  let z = [];
18998
18998
  Array.isArray(k) ? z = k.map(
18999
- (M) => typeof M == "string" ? `'${M}'` : String(M)
19000
- ) : typeof k == "string" ? z = k.split(",").map((M) => {
19001
- const D = M.trim();
19002
- return S.field.dataType === "string" ? `'${D}'` : D;
18999
+ (D) => typeof D == "string" ? `'${D}'` : String(D)
19000
+ ) : typeof k == "string" ? z = k.split(",").map((D) => {
19001
+ const T = D.trim();
19002
+ return S.field.dataType === "string" ? `'${T}'` : T;
19003
19003
  }) : typeof k == "number" && (z = [String(k)]), k = `(${z.join(", ")})`;
19004
19004
  }
19005
19005
  switch (L) {
@@ -19018,14 +19018,14 @@ function vp({
19018
19018
  }
19019
19019
  }, N = (S) => {
19020
19020
  const w = S.conditions.map(A), L = S.groups.map(
19021
- (D) => N(D)
19021
+ (T) => N(T)
19022
19022
  ), k = [...w, ...L].filter(Boolean);
19023
19023
  if (k.length === 0) return "";
19024
- const z = k.join(` ${S.logicalOperator} `), M = k.length > 1 ? `(${z})` : z;
19025
- return S.negate ? `NOT ${M}` : M;
19024
+ const z = k.join(` ${S.logicalOperator} `), D = k.length > 1 ? `(${z})` : z;
19025
+ return S.negate ? `NOT ${D}` : D;
19026
19026
  };
19027
19027
  return N(C);
19028
- }, T = s.conditions.length > 0 || s.groups.length > 0;
19028
+ }, M = s.conditions.length > 0 || s.groups.length > 0;
19029
19029
  return {
19030
19030
  currentFilters: s,
19031
19031
  setCurrentFilters: r,
@@ -19042,7 +19042,7 @@ function vp({
19042
19042
  reorderConditions: g,
19043
19043
  reorderGroups: b,
19044
19044
  generateSQLPreview: I,
19045
- hasAnyFilters: T
19045
+ hasAnyFilters: M
19046
19046
  };
19047
19047
  }
19048
19048
  function yp({
@@ -19120,7 +19120,7 @@ function Cp({
19120
19120
  ]
19121
19121
  }
19122
19122
  ) }),
19123
- /* @__PURE__ */ e(Ht, { className: "z-50 w-80 p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
19123
+ /* @__PURE__ */ e(Qt, { className: "z-50 w-80 p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
19124
19124
  /* @__PURE__ */ e(ms, { placeholder: "Search fields...", className: "h-9" }),
19125
19125
  /* @__PURE__ */ e(ps, { children: "No fields found." }),
19126
19126
  /* @__PURE__ */ e(hs, { className: "max-h-80", children: Object.entries(c).map(([u, d]) => /* @__PURE__ */ e(
@@ -19274,7 +19274,7 @@ function wp({
19274
19274
  ]
19275
19275
  }
19276
19276
  ) }),
19277
- /* @__PURE__ */ e(Ht, { className: "z-50 w-fit overflow-auto p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
19277
+ /* @__PURE__ */ e(Qt, { className: "z-50 w-fit overflow-auto p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
19278
19278
  /* @__PURE__ */ e(ms, { placeholder: "Search..." }),
19279
19279
  /* @__PURE__ */ a(hs, { children: [
19280
19280
  /* @__PURE__ */ e(ps, { children: "No results found." }),
@@ -19488,7 +19488,7 @@ function zi({
19488
19488
  } = Ka({ id: t.id }), { isPending: f, error: v } = Dr(
19489
19489
  t.field
19490
19490
  ), g = {
19491
- transform: sa.Transform.toString(p),
19491
+ transform: na.Transform.toString(p),
19492
19492
  transition: x
19493
19493
  };
19494
19494
  return /* @__PURE__ */ a(
@@ -19527,12 +19527,12 @@ function zi({
19527
19527
  {
19528
19528
  value: t.field,
19529
19529
  onValueChange: (b) => {
19530
- const I = b, T = Ge(I.dataType) === "date";
19530
+ const I = b, M = Ge(I.dataType) === "date";
19531
19531
  u(s, t.id, {
19532
19532
  field: I,
19533
19533
  value: "",
19534
19534
  // For date fields, default to 'between' operator
19535
- operator: T ? "between" : "="
19535
+ operator: M ? "between" : "="
19536
19536
  });
19537
19537
  },
19538
19538
  availableFields: c,
@@ -19674,26 +19674,26 @@ function Rp({
19674
19674
  listeners: g,
19675
19675
  setNodeRef: b,
19676
19676
  transform: I,
19677
- transition: T,
19677
+ transition: M,
19678
19678
  isDragging: C
19679
19679
  } = Ka({ id: t.id }), A = {
19680
- transform: sa.Transform.toString(I),
19681
- transition: T
19680
+ transform: na.Transform.toString(I),
19681
+ transition: M
19682
19682
  }, N = (w) => {
19683
19683
  const { active: L, over: k } = w;
19684
19684
  if (k && L.id !== k.id) {
19685
19685
  const z = t.conditions.findIndex(
19686
- (D) => D.id === L.id
19687
- ), M = t.conditions.findIndex(
19688
- (D) => D.id === k.id
19686
+ (T) => T.id === L.id
19687
+ ), D = t.conditions.findIndex(
19688
+ (T) => T.id === k.id
19689
19689
  );
19690
- z !== -1 && M !== -1 && d(t.id, z, M);
19690
+ z !== -1 && D !== -1 && d(t.id, z, D);
19691
19691
  }
19692
19692
  }, S = (w) => {
19693
19693
  const { active: L, over: k } = w;
19694
19694
  if (k && L.id !== k.id && s) {
19695
- const z = t.groups.findIndex((D) => D.id === L.id), M = t.groups.findIndex((D) => D.id === k.id);
19696
- z !== -1 && M !== -1 && m(s, z, M);
19695
+ const z = t.groups.findIndex((T) => T.id === L.id), D = t.groups.findIndex((T) => T.id === k.id);
19696
+ z !== -1 && D !== -1 && m(s, z, D);
19697
19697
  }
19698
19698
  };
19699
19699
  return /* @__PURE__ */ a(
@@ -19756,15 +19756,15 @@ function Rp({
19756
19756
  Ra,
19757
19757
  {
19758
19758
  sensors: Xa(
19759
- Xt(Rs),
19760
- Xt(xn, {
19759
+ ea(Rs),
19760
+ ea(xn, {
19761
19761
  coordinateGetter: gn
19762
19762
  })
19763
19763
  ),
19764
19764
  collisionDetection: ss,
19765
19765
  onDragEnd: N,
19766
19766
  children: /* @__PURE__ */ e(
19767
- ra,
19767
+ la,
19768
19768
  {
19769
19769
  items: t.conditions.map((w) => w.id),
19770
19770
  strategy: as,
@@ -19792,15 +19792,15 @@ function Rp({
19792
19792
  Ra,
19793
19793
  {
19794
19794
  sensors: Xa(
19795
- Xt(Rs),
19796
- Xt(xn, {
19795
+ ea(Rs),
19796
+ ea(xn, {
19797
19797
  coordinateGetter: gn
19798
19798
  })
19799
19799
  ),
19800
19800
  collisionDetection: ss,
19801
19801
  onDragEnd: S,
19802
19802
  children: /* @__PURE__ */ e(
19803
- ra,
19803
+ la,
19804
19804
  {
19805
19805
  items: t.groups.map((w) => w.id),
19806
19806
  strategy: as,
@@ -19867,36 +19867,36 @@ function Fp({
19867
19867
  reorderGroups: g,
19868
19868
  generateSQLPreview: b,
19869
19869
  hasAnyFilters: I,
19870
- setCurrentFilters: T
19870
+ setCurrentFilters: M
19871
19871
  } = vp({
19872
19872
  initialFilters: t,
19873
19873
  availableFields: n
19874
19874
  }), C = Xa(
19875
- Xt(Rs),
19876
- Xt(xn, {
19875
+ ea(Rs),
19876
+ ea(xn, {
19877
19877
  coordinateGetter: gn
19878
19878
  })
19879
- ), [A, N] = V(!1), S = (k, z, M) => {
19880
- const D = (E) => E.id === k ? {
19879
+ ), [A, N] = V(!1), S = (k, z, D) => {
19880
+ const T = (E) => E.id === k ? {
19881
19881
  ...E,
19882
19882
  conditions: E.conditions.map((P) => P.id === z ? {
19883
19883
  ...P,
19884
- field: M,
19885
- dataType: M.dataType
19884
+ field: D,
19885
+ dataType: D.dataType
19886
19886
  } : P)
19887
19887
  } : {
19888
19888
  ...E,
19889
- groups: E.groups.map(D)
19889
+ groups: E.groups.map(T)
19890
19890
  };
19891
- T(D(i));
19892
- }, w = (k, z = 0, M) => z === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ a("div", { className: "p-3 px-0", children: [
19891
+ M(T(i));
19892
+ }, w = (k, z = 0, D) => z === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ a("div", { className: "p-3 px-0", children: [
19893
19893
  /* @__PURE__ */ e(
19894
19894
  Ra,
19895
19895
  {
19896
19896
  sensors: C,
19897
19897
  collisionDetection: ss,
19898
- onDragEnd: (D) => {
19899
- const { active: E, over: P } = D;
19898
+ onDragEnd: (T) => {
19899
+ const { active: E, over: P } = T;
19900
19900
  if (P && E.id !== P.id) {
19901
19901
  const F = k.conditions.findIndex(
19902
19902
  (j) => j.id === E.id
@@ -19907,14 +19907,14 @@ function Fp({
19907
19907
  }
19908
19908
  },
19909
19909
  children: /* @__PURE__ */ e(
19910
- ra,
19910
+ la,
19911
19911
  {
19912
- items: k.conditions.map((D) => D.id),
19912
+ items: k.conditions.map((T) => T.id),
19913
19913
  strategy: as,
19914
- children: k.conditions.map((D, E) => /* @__PURE__ */ e(
19914
+ children: k.conditions.map((T, E) => /* @__PURE__ */ e(
19915
19915
  zi,
19916
19916
  {
19917
- condition: D,
19917
+ condition: T,
19918
19918
  index: E,
19919
19919
  groupId: k.id,
19920
19920
  groupLogicalOperator: k.logicalOperator,
@@ -19925,7 +19925,7 @@ function Fp({
19925
19925
  availableFields: o,
19926
19926
  updateConditionFields: x
19927
19927
  },
19928
- D.id
19928
+ T.id
19929
19929
  ))
19930
19930
  }
19931
19931
  )
@@ -19936,8 +19936,8 @@ function Fp({
19936
19936
  {
19937
19937
  sensors: C,
19938
19938
  collisionDetection: ss,
19939
- onDragEnd: (D) => {
19940
- const { active: E, over: P } = D;
19939
+ onDragEnd: (T) => {
19940
+ const { active: E, over: P } = T;
19941
19941
  if (P && E.id !== P.id) {
19942
19942
  const F = k.groups.findIndex(
19943
19943
  (j) => j.id === E.id
@@ -19948,12 +19948,12 @@ function Fp({
19948
19948
  }
19949
19949
  },
19950
19950
  children: /* @__PURE__ */ e(
19951
- ra,
19951
+ la,
19952
19952
  {
19953
- items: k.groups.map((D) => D.id),
19953
+ items: k.groups.map((T) => T.id),
19954
19954
  strategy: as,
19955
19955
  children: k.groups.map(
19956
- (D) => w(D, z + 1, k.id)
19956
+ (T) => w(T, z + 1, k.id)
19957
19957
  )
19958
19958
  }
19959
19959
  )
@@ -19992,7 +19992,7 @@ function Fp({
19992
19992
  {
19993
19993
  group: k,
19994
19994
  depth: z,
19995
- parentGroupId: M,
19995
+ parentGroupId: D,
19996
19996
  onUpdateGroupOperator: y,
19997
19997
  onUpdateGroupNegate: f,
19998
19998
  onRemoveGroup: h,
@@ -20119,8 +20119,8 @@ function Lp({
20119
20119
  i(null);
20120
20120
  return;
20121
20121
  }
20122
- const g = f.id, b = v.id, I = d(g), T = d(b) || b;
20123
- if (T === "sortBy") {
20122
+ const g = f.id, b = v.id, I = d(g), M = d(b) || b;
20123
+ if (M === "sortBy") {
20124
20124
  if (I === "source") {
20125
20125
  const C = n.find((N) => N.id === g);
20126
20126
  if (!C) {
@@ -20143,7 +20143,7 @@ function Lp({
20143
20143
  return;
20144
20144
  }
20145
20145
  }
20146
- if (I === "source" && T === "sortBy") {
20146
+ if (I === "source" && M === "sortBy") {
20147
20147
  const C = [...n].find((S) => S.id === g);
20148
20148
  if (!C) {
20149
20149
  i(null);
@@ -20162,7 +20162,7 @@ function Lp({
20162
20162
  i(null), r("sortBy", [...A, N]);
20163
20163
  return;
20164
20164
  }
20165
- if (I === "source" && T !== "source" && T !== "sortBy") {
20165
+ if (I === "source" && M !== "source" && M !== "sortBy") {
20166
20166
  const C = [...n].find((w) => w.id === g);
20167
20167
  if (!C) {
20168
20168
  i(null);
@@ -20195,41 +20195,41 @@ function Lp({
20195
20195
  return;
20196
20196
  }
20197
20197
  }
20198
- const N = s(T);
20198
+ const N = s(M);
20199
20199
  if (Ts(C, N)) {
20200
20200
  i(null);
20201
20201
  return;
20202
20202
  }
20203
20203
  const S = Ms(
20204
20204
  C,
20205
- T,
20205
+ M,
20206
20206
  N
20207
20207
  );
20208
- i(null), r(T, [...N, S]);
20208
+ i(null), r(M, [...N, S]);
20209
20209
  return;
20210
20210
  }
20211
- if (I && T && I !== "source" && T !== "source" && I !== T) {
20212
- const C = s(I), A = s(T), N = C.find((L) => L.id === g);
20211
+ if (I && M && I !== "source" && M !== "source" && I !== M) {
20212
+ const C = s(I), A = s(M), N = C.find((L) => L.id === g);
20213
20213
  if (!N) {
20214
20214
  i(null);
20215
20215
  return;
20216
20216
  }
20217
20217
  const S = Ms(
20218
20218
  N,
20219
- T,
20219
+ M,
20220
20220
  A
20221
20221
  );
20222
- if (i(null), T === "sortBy") {
20223
- Ts(N, A) || r(T, [...A, S]);
20222
+ if (i(null), M === "sortBy") {
20223
+ Ts(N, A) || r(M, [...A, S]);
20224
20224
  return;
20225
20225
  }
20226
20226
  const w = C.filter(
20227
20227
  (L) => L.id !== g
20228
20228
  );
20229
- r(I, w), r(T, [...A, S]);
20229
+ r(I, w), r(M, [...A, S]);
20230
20230
  return;
20231
20231
  }
20232
- if (I && T && I === T && I !== "source") {
20232
+ if (I && M && I === M && I !== "source") {
20233
20233
  const C = s(I), A = C.findIndex((S) => S.id === g), N = C.findIndex((S) => S.id === b);
20234
20234
  if (A !== N) {
20235
20235
  const S = fn(C, A, N);
@@ -20422,9 +20422,9 @@ function Bp({
20422
20422
  updateCardInFrame: x,
20423
20423
  setCardId: y,
20424
20424
  setShowAIDialog: f
20425
- } = ie(), { updateCardId: v } = pt(), [g, b] = V(null), I = O((re) => re.showAIDialog), T = X((re) => re.isVisualEditing), [C, A] = V(!1), [N, S] = V(!1), [w, L] = V(
20425
+ } = ie(), { updateCardId: v } = pt(), [g, b] = V(null), I = O((re) => re.showAIDialog), M = X((re) => re.isVisualEditing), [C, A] = V(!1), [N, S] = V(!1), [w, L] = V(
20426
20426
  null
20427
- ), { isConsoleMode: k } = Ga(), { config: z } = fr(Zn).tokenProps, M = (z == null ? void 0 : z.showInfoTab) !== !1, D = O(
20427
+ ), { isConsoleMode: k } = Ga(), { config: z } = fr(Zn).tokenProps, D = (z == null ? void 0 : z.showInfoTab) !== !1, T = O(
20428
20428
  (re) => {
20429
20429
  var Ce;
20430
20430
  return ((Ce = re.card.customCardPreferences) == null ? void 0 : Ce.url) && re.card.type === "custom";
@@ -20531,7 +20531,7 @@ function Bp({
20531
20531
  "div",
20532
20532
  {
20533
20533
  className: G("relative flex w-0 grow flex-col", {
20534
- "border-l": I && T
20534
+ "border-l": I && M
20535
20535
  }),
20536
20536
  children: [
20537
20537
  s && de(),
@@ -20585,7 +20585,7 @@ function Bp({
20585
20585
  r && zl
20586
20586
  ] })
20587
20587
  ] }),
20588
- !C && D && /* @__PURE__ */ e(
20588
+ !C && T && /* @__PURE__ */ e(
20589
20589
  ye,
20590
20590
  {
20591
20591
  "aria-label": "Open Chart Settings",
@@ -20609,7 +20609,7 @@ function Bp({
20609
20609
  sortState: me
20610
20610
  }
20611
20611
  ) }),
20612
- t === "info" && M && /* @__PURE__ */ e("div", { className: "px-6", children: /* @__PURE__ */ a("div", { className: "rounded-md bg-background", children: [
20612
+ t === "info" && D && /* @__PURE__ */ e("div", { className: "px-6", children: /* @__PURE__ */ a("div", { className: "rounded-md bg-background", children: [
20613
20613
  /* @__PURE__ */ a("div", { className: "mb-2", children: [
20614
20614
  k && /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
20615
20615
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Card ID:" }),
@@ -20757,11 +20757,11 @@ function $p() {
20757
20757
  (Q) => Q.actions.getAvailableFields
20758
20758
  );
20759
20759
  const { addCard: f, removeCard: v, updateCard: g, setActiveCard: b, updateFilters: I } = ie(), {
20760
- columns: T = [],
20760
+ columns: M = [],
20761
20761
  isLoading: C,
20762
20762
  error: A
20763
20763
  } = Wa(), N = Xa(
20764
- Xt(Rs, {
20764
+ ea(Rs, {
20765
20765
  activationConstraint: {
20766
20766
  distance: 8
20767
20767
  }
@@ -20769,12 +20769,12 @@ function $p() {
20769
20769
  ), S = y, {
20770
20770
  getFieldsForContainer: w,
20771
20771
  setFieldsForContainer: L
20772
- } = wr(S), { activeField: k, handleDragStart: z, handleDragEnd: M } = Lp({
20772
+ } = wr(S), { activeField: k, handleDragStart: z, handleDragEnd: D } = Lp({
20773
20773
  activeCardId: x.activeCardId,
20774
- sourceFields: T,
20774
+ sourceFields: M,
20775
20775
  getFieldsForContainer: w,
20776
20776
  setFieldsForContainer: L
20777
- }), D = (Q, $) => {
20777
+ }), T = (Q, $) => {
20778
20778
  $ && I(Q, $);
20779
20779
  }, E = (Q) => {
20780
20780
  var $;
@@ -20784,7 +20784,7 @@ function $p() {
20784
20784
  filters: void 0
20785
20785
  }
20786
20786
  });
20787
- }, P = T, F = (Q) => {
20787
+ }, P = M, F = (Q) => {
20788
20788
  if (!Q) return 0;
20789
20789
  let $ = Q.conditions.length;
20790
20790
  return Q.groups.forEach((ne) => {
@@ -20797,7 +20797,7 @@ function $p() {
20797
20797
  sensors: N,
20798
20798
  collisionDetection: ss,
20799
20799
  onDragStart: z,
20800
- onDragEnd: M,
20800
+ onDragEnd: D,
20801
20801
  children: [
20802
20802
  /* @__PURE__ */ a("div", { className: "flex h-full grow", children: [
20803
20803
  /* @__PURE__ */ e(
@@ -20831,7 +20831,7 @@ function $p() {
20831
20831
  filterCount: R,
20832
20832
  activeCard: S,
20833
20833
  dataSourceState: y.dataSource || Hn,
20834
- columns: T,
20834
+ columns: M,
20835
20835
  columnsLoading: C,
20836
20836
  columnsError: A,
20837
20837
  getFieldsForContainer: w,
@@ -20859,7 +20859,7 @@ function $p() {
20859
20859
  {
20860
20860
  cardId: S.id,
20861
20861
  filters: ((K = S.config) == null ? void 0 : K.filters) || null,
20862
- onFiltersChange: D,
20862
+ onFiltersChange: T,
20863
20863
  onClearFilters: E,
20864
20864
  availableFields: P,
20865
20865
  isOpen: l,
@@ -20879,7 +20879,7 @@ function Yp({ authToken: t, onSave: n, onClose: s }) {
20879
20879
  [u]
20880
20880
  ), { setAuthToken: y } = pt(), { setShowAIDialog: f, setOnSave: v, setOnClose: g } = ie(), { setActiveAssistantType: b } = _l(), {
20881
20881
  handleDragOver: I,
20882
- handleDragEnd: T,
20882
+ handleDragEnd: M,
20883
20883
  handleDragStart: C,
20884
20884
  handleDragCancel: A,
20885
20885
  sensors: N
@@ -21003,7 +21003,7 @@ function Yp({ authToken: t, onSave: n, onClose: s }) {
21003
21003
  {
21004
21004
  sensors: N,
21005
21005
  onDragStart: C,
21006
- onDragEnd: T,
21006
+ onDragEnd: M,
21007
21007
  onDragOver: I,
21008
21008
  onDragCancel: A,
21009
21009
  children: /* @__PURE__ */ e(
@@ -21039,7 +21039,7 @@ function qp() {
21039
21039
  }
21040
21040
  function Kp({ column: t }) {
21041
21041
  return /* @__PURE__ */ e(xt, { children: /* @__PURE__ */ a(Qe, { children: [
21042
- /* @__PURE__ */ e(Ze, { className: "shrink-0", asChild: !0, children: Ut(t.data_type) ? /* @__PURE__ */ e(ld, { className: "size-3 text-muted-foreground" }) : aa(t.data_type) ? /* @__PURE__ */ e(Jt, { className: "size-3 text-muted-foreground" }) : Gt(t.data_type) ? /* @__PURE__ */ e(Pt, { className: "size-3 text-muted-foreground" }) : id(t.data_type) ? /* @__PURE__ */ e(va, { className: "size-3 text-muted-foreground" }) : t.data_type.startsWith("json") ? /* @__PURE__ */ e(Rd, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ e(od, { className: "size-3 text-muted-foreground" }) }),
21042
+ /* @__PURE__ */ e(Ze, { className: "shrink-0", asChild: !0, children: Ut(t.data_type) ? /* @__PURE__ */ e(ld, { className: "size-3 text-muted-foreground" }) : sa(t.data_type) ? /* @__PURE__ */ e(Jt, { className: "size-3 text-muted-foreground" }) : Gt(t.data_type) ? /* @__PURE__ */ e(Pt, { className: "size-3 text-muted-foreground" }) : id(t.data_type) ? /* @__PURE__ */ e(va, { className: "size-3 text-muted-foreground" }) : t.data_type.startsWith("json") ? /* @__PURE__ */ e(Rd, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ e(od, { className: "size-3 text-muted-foreground" }) }),
21043
21043
  /* @__PURE__ */ e(tt, { children: /* @__PURE__ */ e("p", { className: "text-xs", children: t.data_type }) })
21044
21044
  ] }) });
21045
21045
  }
@@ -21169,8 +21169,8 @@ function Hp() {
21169
21169
  p.map((g) => {
21170
21170
  const b = l == null ? void 0 : l.some(
21171
21171
  (I) => {
21172
- var T;
21173
- return I.title === g.name || ((T = I.column) == null ? void 0 : T.includes(g.name));
21172
+ var M;
21173
+ return I.title === g.name || ((M = I.column) == null ? void 0 : M.includes(g.name));
21174
21174
  }
21175
21175
  );
21176
21176
  return /* @__PURE__ */ e(
@@ -21379,7 +21379,7 @@ function af({
21379
21379
  block: "center"
21380
21380
  });
21381
21381
  }, [p]);
21382
- const I = () => /* @__PURE__ */ e(Js, { className: "h-4 w-4" }), T = () => {
21382
+ const I = () => /* @__PURE__ */ e(Js, { className: "h-4 w-4" }), M = () => {
21383
21383
  m(t), l == null || l(t);
21384
21384
  };
21385
21385
  return /* @__PURE__ */ e(
@@ -21390,7 +21390,7 @@ function af({
21390
21390
  "group cursor-pointer border border-border/50 p-3 transition-colors hover:bg-accent/50",
21391
21391
  p ? "border-purple-500" : h && "border-primary"
21392
21392
  ),
21393
- onClick: T,
21393
+ onClick: M,
21394
21394
  children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
21395
21395
  /* @__PURE__ */ e("div", { className: "mt-0.5 rounded bg-muted p-1.5", children: I() }),
21396
21396
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
@@ -21716,7 +21716,7 @@ function nf() {
21716
21716
  null
21717
21717
  ), { selectVisual: v } = ds(), { handleEditLibraryVisual: g, handleAddLibraryVisual: b } = wa(), {
21718
21718
  resources: I,
21719
- isLoading: T,
21719
+ isLoading: M,
21720
21720
  isError: C,
21721
21721
  createResource: A,
21722
21722
  updateResource: N,
@@ -21732,17 +21732,17 @@ function nf() {
21732
21732
  r(!1), W && (v(W), g(W));
21733
21733
  }
21734
21734
  );
21735
- ia();
21735
+ Ht();
21736
21736
  const z = I.filter(
21737
21737
  (W) => {
21738
21738
  var Ne, re;
21739
21739
  return ((Ne = W == null ? void 0 : W.title) == null ? void 0 : Ne.toLowerCase().includes(t.toLowerCase())) || ((re = W == null ? void 0 : W.description) == null ? void 0 : re.toLowerCase().includes(t.toLowerCase()));
21740
21740
  }
21741
- ), M = (W) => new Date(W).toLocaleDateString("en-US", {
21741
+ ), D = (W) => new Date(W).toLocaleDateString("en-US", {
21742
21742
  month: "short",
21743
21743
  day: "numeric",
21744
21744
  year: "numeric"
21745
- }), D = (W) => {
21745
+ }), T = (W) => {
21746
21746
  A({
21747
21747
  title: W.title,
21748
21748
  description: W.description,
@@ -21817,7 +21817,7 @@ function nf() {
21817
21817
  }
21818
21818
  });
21819
21819
  };
21820
- return T ? /* @__PURE__ */ e(_i, {}) : C ? /* @__PURE__ */ e(st, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
21820
+ return M ? /* @__PURE__ */ e(_i, {}) : C ? /* @__PURE__ */ e(st, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
21821
21821
  /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
21822
21822
  /* @__PURE__ */ e(
21823
21823
  _,
@@ -21869,7 +21869,7 @@ function nf() {
21869
21869
  onShareVisual: de,
21870
21870
  isDeleting: k,
21871
21871
  isDuplicating: p === W.id,
21872
- formatDate: M
21872
+ formatDate: D
21873
21873
  },
21874
21874
  W.id
21875
21875
  )) }) }),
@@ -21936,7 +21936,7 @@ function nf() {
21936
21936
  {
21937
21937
  open: s,
21938
21938
  onOpenChange: r,
21939
- onSubmit: D,
21939
+ onSubmit: T,
21940
21940
  isCreating: L
21941
21941
  }
21942
21942
  ),
@@ -21964,12 +21964,12 @@ function rf({
21964
21964
  formatDate: u,
21965
21965
  onDashboardItemClick: d
21966
21966
  }) {
21967
- var I, T, C, A;
21968
- const { selectDashboard: m } = ds(), h = pd(t.id), { isConsoleMode: p } = Ga(), [x, y] = V(!1), [f, v] = V(!1);
21967
+ var S, w, L, k, z;
21968
+ const { selectDashboard: m } = ds(), h = pd(t.id), { isConsoleMode: p } = Ga(), { currentUser: x, isLoading: y, isError: f } = Ht(), v = !f && (x == null ? void 0 : x.type) === "tenant" && ((S = x == null ? void 0 : x.role) == null ? void 0 : S.toUpperCase()) === "VIEWER", g = y || v, [b, I] = V(!1), [M, C] = V(!1);
21969
21969
  ke(() => {
21970
- s ? (y(!0), v(!0)) : f && (y(!1), v(!1));
21971
- }, [s, f]);
21972
- const g = () => /* @__PURE__ */ e(Ya, { className: "h-4 w-4" }), b = () => {
21970
+ s ? (I(!0), C(!0)) : M && (I(!1), C(!1));
21971
+ }, [s, M]);
21972
+ const A = () => /* @__PURE__ */ e(Ya, { className: "h-4 w-4" }), N = () => {
21973
21973
  m(t), r(t.id), d == null || d(t.id);
21974
21974
  };
21975
21975
  return /* @__PURE__ */ e(
@@ -21979,9 +21979,9 @@ function rf({
21979
21979
  "group cursor-pointer border border-border/50 p-3 transition-colors hover:bg-accent/50",
21980
21980
  h && "border-primary"
21981
21981
  ),
21982
- onClick: b,
21982
+ onClick: N,
21983
21983
  children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
21984
- /* @__PURE__ */ e("div", { className: "mt-0.5 rounded bg-muted p-1.5", children: g() }),
21984
+ /* @__PURE__ */ e("div", { className: "mt-0.5 rounded bg-muted p-1.5", children: A() }),
21985
21985
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
21986
21986
  /* @__PURE__ */ a("div", { className: "mb-1 flex items-center gap-2", children: [
21987
21987
  /* @__PURE__ */ e(
@@ -22002,7 +22002,7 @@ function rf({
22002
22002
  {
22003
22003
  className: "text-xs text-muted-foreground line-clamp-2",
22004
22004
  title: t.description || "No description",
22005
- children: (I = t.description) != null && I.trim() ? t.description : "No description"
22005
+ children: (w = t.description) != null && w.trim() ? t.description : "No description"
22006
22006
  }
22007
22007
  )
22008
22008
  ] }),
@@ -22010,35 +22010,35 @@ function rf({
22010
22010
  "div",
22011
22011
  {
22012
22012
  className: "invisible ml-2 flex flex-shrink-0 items-center gap-1 transition-opacity duration-150 group-hover:visible",
22013
- onClick: (N) => N.stopPropagation(),
22013
+ onClick: (D) => D.stopPropagation(),
22014
22014
  children: [
22015
- t.permissions.canEdit && /* @__PURE__ */ e(
22015
+ t.permissions.canEdit && !g && /* @__PURE__ */ e(
22016
22016
  _,
22017
22017
  {
22018
22018
  size: "sm",
22019
22019
  variant: "ghost",
22020
22020
  className: "h-6 w-6 p-0",
22021
- onClick: (N) => {
22022
- N.stopPropagation(), l == null || l(t);
22021
+ onClick: (D) => {
22022
+ D.stopPropagation(), l == null || l(t);
22023
22023
  },
22024
22024
  title: "Edit details",
22025
22025
  children: /* @__PURE__ */ e(Fs, { className: "h-3 w-3" })
22026
22026
  }
22027
22027
  ),
22028
- /* @__PURE__ */ a(
22028
+ !g && /* @__PURE__ */ a(
22029
22029
  At,
22030
22030
  {
22031
22031
  modal: !1,
22032
- open: x,
22033
- onOpenChange: y,
22032
+ open: b,
22033
+ onOpenChange: I,
22034
22034
  children: [
22035
22035
  /* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(_, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e($l, { className: "h-3 w-3" }) }) }),
22036
22036
  /* @__PURE__ */ a(Ot, { align: "end", className: "z-[51] w-40", children: [
22037
22037
  /* @__PURE__ */ a(
22038
22038
  Je,
22039
22039
  {
22040
- onClick: (N) => {
22041
- N.preventDefault(), N.stopPropagation(), o(t.id);
22040
+ onClick: (D) => {
22041
+ D.preventDefault(), D.stopPropagation(), o(t.id);
22042
22042
  },
22043
22043
  disabled: s,
22044
22044
  children: [
@@ -22050,8 +22050,8 @@ function rf({
22050
22050
  t.permissions.canEdit && /* @__PURE__ */ a(
22051
22051
  Je,
22052
22052
  {
22053
- onClick: (N) => {
22054
- N.stopPropagation(), l == null || l(t);
22053
+ onClick: (D) => {
22054
+ D.stopPropagation(), l == null || l(t);
22055
22055
  },
22056
22056
  children: [
22057
22057
  /* @__PURE__ */ e(Fs, { className: "mr-2 h-3 w-3" }),
@@ -22062,8 +22062,8 @@ function rf({
22062
22062
  t.permissions.canEdit && /* @__PURE__ */ e(J, { children: /* @__PURE__ */ a(
22063
22063
  Je,
22064
22064
  {
22065
- onClick: (N) => {
22066
- N.stopPropagation(), c(t);
22065
+ onClick: (D) => {
22066
+ D.stopPropagation(), c(t);
22067
22067
  },
22068
22068
  children: [
22069
22069
  /* @__PURE__ */ e(je, { className: "mr-2 h-3 w-3" }),
@@ -22076,8 +22076,8 @@ function rf({
22076
22076
  /* @__PURE__ */ a(
22077
22077
  Je,
22078
22078
  {
22079
- onClick: (N) => {
22080
- N.stopPropagation(), i(t);
22079
+ onClick: (D) => {
22080
+ D.stopPropagation(), i(t);
22081
22081
  },
22082
22082
  className: "text-destructive",
22083
22083
  disabled: n,
@@ -22090,9 +22090,9 @@ function rf({
22090
22090
  ] }),
22091
22091
  /* @__PURE__ */ e(xa, {}),
22092
22092
  /* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
22093
- (((T = t.ownership.createdBy) == null ? void 0 : T.type) === "tenant" || ((C = t.ownership.createdBy) == null ? void 0 : C.type) === "organization" && p) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
22093
+ (((L = t.ownership.createdBy) == null ? void 0 : L.type) === "tenant" || ((k = t.ownership.createdBy) == null ? void 0 : k.type) === "organization" && p) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
22094
22094
  /* @__PURE__ */ e(Ia, { className: "h-3 w-3" }),
22095
- /* @__PURE__ */ e("span", { children: ((A = t.ownership.createdBy) == null ? void 0 : A.name) || "Unknown" })
22095
+ /* @__PURE__ */ e("span", { children: ((z = t.ownership.createdBy) == null ? void 0 : z.name) || "Unknown" })
22096
22096
  ] }),
22097
22097
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
22098
22098
  /* @__PURE__ */ e(Pt, { className: "h-3 w-3" }),
@@ -22120,7 +22120,7 @@ function lf({ onRetry: t }) {
22120
22120
  function of(t) {
22121
22121
  const { onLoadDashboard: n, onEditDashboard: s, onDashboardItemClick: r } = t, [l, i] = V(""), [o, c] = V(!1), [u, d] = V(!1), [m, h] = V(
22122
22122
  null
22123
- ), [p, x] = V(!1), [y, f] = V(null), [v, g] = V(null), [b, I] = V(null), T = Dt(
22123
+ ), [p, x] = V(!1), [y, f] = V(null), [v, g] = V(null), [b, I] = V(null), M = Dt(
22124
22124
  (se) => se.lastSelectedDashboard
22125
22125
  ), C = Dt(
22126
22126
  (se) => se.selectedDashboard
@@ -22132,8 +22132,8 @@ function of(t) {
22132
22132
  onDashboardSelect: r
22133
22133
  }), {
22134
22134
  resources: z,
22135
- isLoading: M,
22136
- isError: D,
22135
+ isLoading: D,
22136
+ isError: T,
22137
22137
  createResource: E,
22138
22138
  updateResource: P,
22139
22139
  deleteResource: F,
@@ -22145,12 +22145,12 @@ function of(t) {
22145
22145
  () => {
22146
22146
  x(!1);
22147
22147
  const se = y == null ? void 0 : y.id;
22148
- f(null), (C == null ? void 0 : C.id) === se && (!(S != null && S.dashboard_id) && !w ? N() : T && T.id !== se && A(T));
22148
+ f(null), (C == null ? void 0 : C.id) === se && (!(S != null && S.dashboard_id) && !w ? N() : M && M.id !== se && A(M));
22149
22149
  },
22150
22150
  (se) => {
22151
22151
  c(!1), k(se, Q);
22152
22152
  }
22153
- ), { currentUser: $ } = ia(), ne = z.filter(
22153
+ ), { currentUser: $ } = Ht(), ne = z.filter(
22154
22154
  (se) => {
22155
22155
  var Z, B;
22156
22156
  return ((Z = se == null ? void 0 : se.title) == null ? void 0 : Z.toLowerCase().includes(l.toLowerCase())) || ((B = se == null ? void 0 : se.description) == null ? void 0 : B.toLowerCase().includes(l.toLowerCase()));
@@ -22234,7 +22234,7 @@ function of(t) {
22234
22234
  }
22235
22235
  });
22236
22236
  };
22237
- return M ? /* @__PURE__ */ e(_i, {}) : D ? /* @__PURE__ */ e(lf, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "relative flex h-full flex-1 flex-col gap-4", children: [
22237
+ return D ? /* @__PURE__ */ e(_i, {}) : T ? /* @__PURE__ */ e(lf, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "relative flex h-full flex-1 flex-col gap-4", children: [
22238
22238
  z && z.length > 5 && /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(
22239
22239
  _e,
22240
22240
  {
@@ -22369,7 +22369,7 @@ function cf({
22369
22369
  (C) => C.actions
22370
22370
  ), {
22371
22371
  currentUser: c
22372
- } = ia(), u = c, { permissions: d } = Xn(), h = vd() && d.canAccessVisuals, p = "dashboards", [x, y] = Sr(
22372
+ } = Ht(), u = c, { permissions: d } = Xn(), h = vd() && d.canAccessVisuals, p = "dashboards", [x, y] = Sr(
22373
22373
  "resource-management-active-tab",
22374
22374
  p
22375
22375
  ), f = h ? x : "dashboards", v = l === "overlay", g = ai(n, {
@@ -22382,7 +22382,7 @@ function cf({
22382
22382
  ) : "w-full max-w-[28rem] min-w-[18rem] overflow-hidden shadow-sm",
22383
22383
  s
22384
22384
  ), I = (C) => {
22385
- }, T = (C) => {
22385
+ }, M = (C) => {
22386
22386
  console.log("Editing dashboard:", C);
22387
22387
  };
22388
22388
  return /* @__PURE__ */ e(xt, { children: (!v || t) && /* @__PURE__ */ a("div", { ref: g, className: b, children: [
@@ -22433,7 +22433,7 @@ function cf({
22433
22433
  of,
22434
22434
  {
22435
22435
  onLoadDashboard: I,
22436
- onEditDashboard: T,
22436
+ onEditDashboard: M,
22437
22437
  onDashboardItemClick: r
22438
22438
  }
22439
22439
  ) }),