@nivaro/react 0.1.191 → 0.1.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +147 -147
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import { createPortal as _r } from "react-dom";
12
12
  import { Slot as Mk } from "@radix-ui/react-slot";
13
13
  import { cva as bm } from "class-variance-authority";
14
14
  import { Command as Fs } from "cmdk";
15
- import * as ka from "@radix-ui/react-dialog";
15
+ import * as wa from "@radix-ui/react-dialog";
16
16
  import * as bc from "@radix-ui/react-popover";
17
17
  import * as x0 from "@radix-ui/react-switch";
18
18
  import { toast as Le } from "sonner";
@@ -52,12 +52,12 @@ function Ae() {
52
52
  if (!t) throw new Error("useNivaroClient must be used within <NivaroProvider>");
53
53
  return t.client;
54
54
  }
55
- function Na() {
55
+ function _a() {
56
56
  const t = Wr(rh);
57
57
  return (t == null ? void 0 : t.client) ?? null;
58
58
  }
59
59
  function ci() {
60
- const t = Na(), n = t == null ? void 0 : t.getToken();
60
+ const t = _a(), n = t == null ? void 0 : t.getToken();
61
61
  return {
62
62
  apiBase: t ? `${t.url}/api` : "/api",
63
63
  authHeaders: n ? { Authorization: `Bearer ${n}` } : {},
@@ -143,7 +143,7 @@ function Rn(t) {
143
143
  return { _method: "DELETE", _path: t };
144
144
  }
145
145
  function mF() {
146
- const t = Na(), n = Tt(), { data: a = [] } = ie({
146
+ const t = _a(), n = Tt(), { data: a = [] } = ie({
147
147
  queryKey: ["announcements-active"],
148
148
  queryFn: () => t.request(
149
149
  te("/announcements/active")
@@ -255,7 +255,7 @@ function pF({
255
255
  appName: t = "The API",
256
256
  fetchVersion: n
257
257
  }) {
258
- const a = Na(), s = lN(), [l, i] = S(!1);
258
+ const a = _a(), s = lN(), [l, i] = S(!1);
259
259
  if (Oe(() => {
260
260
  const o = (m) => (m == null ? void 0 : m.data) ?? m ?? null;
261
261
  sN(n ?? (a ? () => a.request(te("/version")).then((m) => o(m)).catch(() => null) : () => fetch("/api/version", { cache: "no-store" }).then((m) => m.ok ? m.json() : null).then(o).catch(() => null)));
@@ -651,7 +651,7 @@ function vc({
651
651
  );
652
652
  }
653
653
  const Wc = "__empty__";
654
- function va({
654
+ function Na({
655
655
  value: t,
656
656
  onChange: n,
657
657
  options: a,
@@ -673,7 +673,7 @@ function va({
673
673
  }
674
674
  function ds(t) {
675
675
  return /* @__PURE__ */ e(
676
- va,
676
+ Na,
677
677
  {
678
678
  ...t,
679
679
  className: V(
@@ -769,7 +769,7 @@ function gl({
769
769
  className: s
770
770
  }) {
771
771
  return /* @__PURE__ */ e(
772
- va,
772
+ Na,
773
773
  {
774
774
  value: t,
775
775
  onChange: n,
@@ -2606,7 +2606,7 @@ function xF({
2606
2606
  )
2607
2607
  ] });
2608
2608
  }
2609
- const ya = 256, CN = (t, n, a) => `https://tile.openstreetmap.org/${t}/${n}/${a}.png`;
2609
+ const ka = 256, CN = (t, n, a) => `https://tile.openstreetmap.org/${t}/${n}/${a}.png`;
2610
2610
  function Mo(t, n) {
2611
2611
  return (t + 180) / 360 * 2 ** n;
2612
2612
  }
@@ -2645,7 +2645,7 @@ function Lg({
2645
2645
  const q = T.map((R) => R.lat), j = T.map((R) => R.lng), M = Math.min(...q), O = Math.max(...q), F = Math.min(...j), P = Math.max(...j), K = { lat: (M + O) / 2, lng: (F + P) / 2 };
2646
2646
  let D = 15;
2647
2647
  for (; D > 3; ) {
2648
- const R = Math.abs(Mo(P, D) - Mo(F, D)) * ya, E = Math.abs(Eo(M, D) - Eo(O, D)) * ya;
2648
+ const R = Math.abs(Mo(P, D) - Mo(F, D)) * ka, E = Math.abs(Eo(M, D) - Eo(O, D)) * ka;
2649
2649
  if (R < u.w * 0.85 && E < u.h * 0.85) break;
2650
2650
  D--;
2651
2651
  }
@@ -2653,7 +2653,7 @@ function Lg({
2653
2653
  }, [t, n, u]), Oe(() => {
2654
2654
  d && p({ lat: d.lat, lng: d.lng, zoom: d.zoom ?? 8 });
2655
2655
  }, [d == null ? void 0 : d.nonce]);
2656
- const g = m ?? { lat: 39.5, lng: -98.35, zoom: 4 }, v = Mo(g.lng, g.zoom), y = Eo(g.lat, g.zoom), b = [], x = 2 ** g.zoom, $ = Math.floor(v - u.w / 2 / ya), C = Math.ceil(v + u.w / 2 / ya), A = Math.max(0, Math.floor(y - u.h / 2 / ya)), N = Math.min(x - 1, Math.ceil(y + u.h / 2 / ya));
2656
+ const g = m ?? { lat: 39.5, lng: -98.35, zoom: 4 }, v = Mo(g.lng, g.zoom), y = Eo(g.lat, g.zoom), b = [], x = 2 ** g.zoom, $ = Math.floor(v - u.w / 2 / ka), C = Math.ceil(v + u.w / 2 / ka), A = Math.max(0, Math.floor(y - u.h / 2 / ka)), N = Math.min(x - 1, Math.ceil(y + u.h / 2 / ka));
2657
2657
  for (let T = $; T <= C; T++)
2658
2658
  for (let q = A; q <= N; q++) {
2659
2659
  const j = (T % x + x) % x;
@@ -2661,13 +2661,13 @@ function Lg({
2661
2661
  z: g.zoom,
2662
2662
  x: j,
2663
2663
  y: q,
2664
- left: u.w / 2 + (T - v) * ya,
2665
- top: u.h / 2 + (q - y) * ya
2664
+ left: u.w / 2 + (T - v) * ka,
2665
+ top: u.h / 2 + (q - y) * ka
2666
2666
  });
2667
2667
  }
2668
2668
  const w = (T, q) => ({
2669
- x: u.w / 2 + (Mo(q, g.zoom) - v) * ya,
2670
- y: u.h / 2 + (Eo(T, g.zoom) - y) * ya
2669
+ x: u.w / 2 + (Mo(q, g.zoom) - v) * ka,
2670
+ y: u.h / 2 + (Eo(T, g.zoom) - y) * ka
2671
2671
  }), _ = ve(() => {
2672
2672
  const q = /* @__PURE__ */ new Map();
2673
2673
  for (const j of t) {
@@ -2686,10 +2686,10 @@ function Lg({
2686
2686
  const M = j ?? g, O = Math.max(2, Math.min(18, M.zoom + T));
2687
2687
  if (O === M.zoom) return M;
2688
2688
  if (q) {
2689
- const F = Mo(M.lng, M.zoom) + (q.x - u.w / 2) / ya, P = Eo(M.lat, M.zoom) + (q.y - u.h / 2) / ya, K = 2 ** (O - M.zoom);
2689
+ const F = Mo(M.lng, M.zoom) + (q.x - u.w / 2) / ka, P = Eo(M.lat, M.zoom) + (q.y - u.h / 2) / ka, K = 2 ** (O - M.zoom);
2690
2690
  return {
2691
- lng: ip(F * K - (q.x - u.w / 2) / ya, O),
2692
- lat: op(P * K - (q.y - u.h / 2) / ya, O),
2691
+ lng: ip(F * K - (q.x - u.w / 2) / ka, O),
2692
+ lat: op(P * K - (q.y - u.h / 2) / ka, O),
2693
2693
  zoom: O
2694
2694
  };
2695
2695
  }
@@ -2709,7 +2709,7 @@ function Lg({
2709
2709
  onPointerMove: (T) => {
2710
2710
  const q = h.current;
2711
2711
  if (!q) return;
2712
- const j = (T.clientX - q.x) / ya, M = (T.clientY - q.y) / ya;
2712
+ const j = (T.clientX - q.x) / ka, M = (T.clientY - q.y) / ka;
2713
2713
  p({
2714
2714
  zoom: g.zoom,
2715
2715
  lng: ip(Mo(q.lng, g.zoom) - j, g.zoom),
@@ -2733,7 +2733,7 @@ function Lg({
2733
2733
  alt: "",
2734
2734
  draggable: !1,
2735
2735
  className: "pointer-events-none absolute select-none",
2736
- style: { left: T.left, top: T.top, width: ya, height: ya }
2736
+ style: { left: T.left, top: T.top, width: ka, height: ka }
2737
2737
  },
2738
2738
  `${T.z}/${T.x}/${T.y}`
2739
2739
  )),
@@ -2826,8 +2826,8 @@ function Lg({
2826
2826
  type: "button",
2827
2827
  onClick: (q) => {
2828
2828
  q.stopPropagation(), p({
2829
- lat: op(y + (T.y - u.h / 2) / ya, g.zoom),
2830
- lng: ip(v + (T.x - u.w / 2) / ya, g.zoom),
2829
+ lat: op(y + (T.y - u.h / 2) / ka, g.zoom),
2830
+ lng: ip(v + (T.x - u.w / 2) / ka, g.zoom),
2831
2831
  zoom: Math.min(18, g.zoom + 2)
2832
2832
  });
2833
2833
  },
@@ -2898,13 +2898,13 @@ const $N = bm(
2898
2898
  ({ className: t, variant: n, size: a, asChild: s = !1, ...l }, i) => /* @__PURE__ */ e(s ? Mk : "button", { className: V($N({ variant: n, size: a, className: t })), ref: i, ...l })
2899
2899
  );
2900
2900
  Be.displayName = "Button";
2901
- const kl = ka.Root, qN = ka.Trigger, FN = ka.Portal;
2901
+ const kl = wa.Root, qN = wa.Trigger, FN = wa.Portal;
2902
2902
  function TN({
2903
2903
  className: t,
2904
2904
  ...n
2905
2905
  }) {
2906
2906
  return /* @__PURE__ */ e(
2907
- ka.Overlay,
2907
+ wa.Overlay,
2908
2908
  {
2909
2909
  className: V(
2910
2910
  "fixed inset-0 z-[110] bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
@@ -2922,7 +2922,7 @@ function Nl({
2922
2922
  return /* @__PURE__ */ r(FN, { children: [
2923
2923
  /* @__PURE__ */ e(TN, {}),
2924
2924
  /* @__PURE__ */ r(
2925
- ka.Content,
2925
+ wa.Content,
2926
2926
  {
2927
2927
  className: V(
2928
2928
  "fixed left-[50%] top-[50%] z-[110] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] rounded-2xl bg-white shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
@@ -2931,7 +2931,7 @@ function Nl({
2931
2931
  ...a,
2932
2932
  children: [
2933
2933
  n,
2934
- /* @__PURE__ */ e(ka.Close, { className: "absolute right-4 top-2 rounded-lg p-1 text-slate-400 hover:text-slate-600 focus:outline-none focus:ring-2 focus:ring-nvr-cyan", children: /* @__PURE__ */ e(tn, { className: "h-4 w-4" }) })
2934
+ /* @__PURE__ */ e(wa.Close, { className: "absolute right-4 top-2 rounded-lg p-1 text-slate-400 hover:text-slate-600 focus:outline-none focus:ring-2 focus:ring-nvr-cyan", children: /* @__PURE__ */ e(tn, { className: "h-4 w-4" }) })
2935
2935
  ]
2936
2936
  }
2937
2937
  )
@@ -2957,7 +2957,7 @@ function _l({
2957
2957
  ...n
2958
2958
  }) {
2959
2959
  return /* @__PURE__ */ e(
2960
- ka.Title,
2960
+ wa.Title,
2961
2961
  {
2962
2962
  className: V("text-lg font-semibold text-slate-900", t),
2963
2963
  ...n
@@ -2969,7 +2969,7 @@ function Og({
2969
2969
  ...n
2970
2970
  }) {
2971
2971
  return /* @__PURE__ */ e(
2972
- ka.Description,
2972
+ wa.Description,
2973
2973
  {
2974
2974
  className: V("text-sm text-slate-500 mt-1", t),
2975
2975
  ...n
@@ -3396,7 +3396,7 @@ function ON({
3396
3396
  }
3397
3397
  ) }),
3398
3398
  /* @__PURE__ */ e("td", { className: "px-2 py-1", children: C.lookupOn ? /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Lookup ↓" }) : /* @__PURE__ */ e(
3399
- va,
3399
+ Na,
3400
3400
  {
3401
3401
  value: C.type,
3402
3402
  onChange: (_) => N({ type: _ }),
@@ -3455,7 +3455,7 @@ function ON({
3455
3455
  /* @__PURE__ */ e("span", { children: "equals the file value, and store its id." }),
3456
3456
  /* @__PURE__ */ e("span", { className: "ml-1", children: "If no match:" }),
3457
3457
  /* @__PURE__ */ e(
3458
- va,
3458
+ Na,
3459
3459
  {
3460
3460
  value: C.lookupOnMissing,
3461
3461
  onChange: (_) => N({ lookupOnMissing: _ }),
@@ -8492,8 +8492,8 @@ function Nc({
8492
8492
  )
8493
8493
  ] });
8494
8494
  }
8495
- const Wl = ka.Root, __ = ka.Trigger, S_ = ka.Portal, my = nr.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
8496
- ka.Overlay,
8495
+ const Wl = wa.Root, __ = wa.Trigger, S_ = wa.Portal, my = nr.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
8496
+ wa.Overlay,
8497
8497
  {
8498
8498
  className: V(
8499
8499
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
@@ -8503,7 +8503,7 @@ const Wl = ka.Root, __ = ka.Trigger, S_ = ka.Portal, my = nr.forwardRef(({ class
8503
8503
  ref: a
8504
8504
  }
8505
8505
  ));
8506
- my.displayName = ka.Overlay.displayName;
8506
+ my.displayName = wa.Overlay.displayName;
8507
8507
  const C_ = bm(
8508
8508
  "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 z-[100]",
8509
8509
  {
@@ -8521,35 +8521,35 @@ const C_ = bm(
8521
8521
  }
8522
8522
  ), Sl = nr.forwardRef(({ side: t = "right", className: n, children: a, ...s }, l) => /* @__PURE__ */ r(S_, { children: [
8523
8523
  /* @__PURE__ */ e(my, {}),
8524
- /* @__PURE__ */ r(ka.Content, { ref: l, className: V(C_({ side: t }), n), ...s, children: [
8524
+ /* @__PURE__ */ r(wa.Content, { ref: l, className: V(C_({ side: t }), n), ...s, children: [
8525
8525
  a,
8526
- /* @__PURE__ */ r(ka.Close, { className: "absolute right-4 top-2 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
8526
+ /* @__PURE__ */ r(wa.Close, { className: "absolute right-4 top-2 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
8527
8527
  /* @__PURE__ */ e(tn, { className: "h-4 w-4" }),
8528
8528
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
8529
8529
  ] })
8530
8530
  ] })
8531
8531
  ] }));
8532
- Sl.displayName = ka.Content.displayName;
8532
+ Sl.displayName = wa.Content.displayName;
8533
8533
  const li = ({ className: t, ...n }) => /* @__PURE__ */ e("div", { className: V("flex flex-col space-y-2 text-center sm:text-left", t), ...n });
8534
8534
  li.displayName = "SheetHeader";
8535
8535
  const ii = nr.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
8536
- ka.Title,
8536
+ wa.Title,
8537
8537
  {
8538
8538
  ref: a,
8539
8539
  className: V("text-lg font-semibold text-foreground", t),
8540
8540
  ...n
8541
8541
  }
8542
8542
  ));
8543
- ii.displayName = ka.Title.displayName;
8543
+ ii.displayName = wa.Title.displayName;
8544
8544
  const $_ = nr.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
8545
- ka.Description,
8545
+ wa.Description,
8546
8546
  {
8547
8547
  ref: a,
8548
8548
  className: V("text-sm text-muted-foreground", t),
8549
8549
  ...n
8550
8550
  }
8551
8551
  ));
8552
- $_.displayName = ka.Description.displayName;
8552
+ $_.displayName = wa.Description.displayName;
8553
8553
  const q_ = /* @__PURE__ */ new Set([
8554
8554
  "alias",
8555
8555
  "o2m",
@@ -10759,16 +10759,16 @@ function U_({
10759
10759
  if (Ut === "original") return Ts;
10760
10760
  const Q = H.find((oe) => oe.addendumId === Ut);
10761
10761
  return Q ? Q.rows.map((oe) => Cr({ ...oe })) : Ts;
10762
- }, [Ut, H, Ts]), wa = Ot.length >= kp, Rr = ne == null ? void 0 : ne.report;
10762
+ }, [Ut, H, Ts]), Sa = Ot.length >= kp, Rr = ne == null ? void 0 : ne.report;
10763
10763
  Oe(() => {
10764
10764
  if (Rr) {
10765
- if (wa || Ue) {
10765
+ if (Sa || Ue) {
10766
10766
  Rr(t, n, null);
10767
10767
  return;
10768
10768
  }
10769
10769
  Rr(t, n, ca);
10770
10770
  }
10771
- }, [Rr, t, n, ca, wa, Ue]);
10771
+ }, [Rr, t, n, ca, Sa, Ue]);
10772
10772
  const Is = ze(() => {
10773
10773
  });
10774
10774
  Is.current = () => Rr == null ? void 0 : Rr(t, n, null), Oe(() => () => Is.current(), []);
@@ -11354,7 +11354,7 @@ function U_({
11354
11354
  const be = (Ge) => Ge == null || Ge === "", ye = $r.filter(
11355
11355
  (Ge) => {
11356
11356
  var rt;
11357
- return Ge.required && !Sa(Ge) && !((rt = je.locks) != null && rt.includes(Ge.field)) && be(je.draft[Ge.field]);
11357
+ return Ge.required && !ya(Ge) && !((rt = je.locks) != null && rt.includes(Ge.field)) && be(je.draft[Ge.field]);
11358
11358
  }
11359
11359
  );
11360
11360
  if (ye.length > 0) {
@@ -11460,7 +11460,7 @@ function U_({
11460
11460
  wt(!1);
11461
11461
  }
11462
11462
  }
11463
- const [Ql, pi] = S(/* @__PURE__ */ new Set()), [ra, Tl] = S(null), [rr, rs] = S(null), [as, Aa] = S(!1), [vr, B] = S(1), [Fe, mt] = S(!1), [Mt, hn] = S(!1), [dn, Yn] = S({}), [mr, pa] = S(!1), [Hr, _a] = S({}), [ga, ss] = S(!1);
11463
+ const [Ql, pi] = S(/* @__PURE__ */ new Set()), [ra, Tl] = S(null), [rr, rs] = S(null), [as, Aa] = S(!1), [vr, B] = S(1), [Fe, mt] = S(!1), [Mt, hn] = S(!1), [dn, Yn] = S({}), [mr, pa] = S(!1), [Hr, Ca] = S({}), [ga, ss] = S(!1);
11464
11464
  function $o(Q, oe) {
11465
11465
  Yn((be) => ({ ...be, [Q]: oe }));
11466
11466
  }
@@ -11478,7 +11478,7 @@ function U_({
11478
11478
  )
11479
11479
  ), R.invalidateQueries({ queryKey: ["o2m-rows", t, n, a] }))), _n.length && E && _n.forEach(
11480
11480
  (oe, be) => E.updateRow(t, n, be, { ...oe, ...Hr })
11481
- ), pa(!1), _a({});
11481
+ ), pa(!1), Ca({});
11482
11482
  } catch {
11483
11483
  } finally {
11484
11484
  ss(!1);
@@ -11827,7 +11827,7 @@ function U_({
11827
11827
  },
11828
11828
  ye
11829
11829
  );
11830
- }) }), Sa = (Q) => Q.computed_type === "write" && !!Q.computed_formula || Q.interface === "formula-column" || Q.interface === "match-agg-column" || Q.interface === "relation-path" || !!Q.readonly || ta(Q), Ca = (Q) => (
11830
+ }) }), ya = (Q) => Q.computed_type === "write" && !!Q.computed_formula || Q.interface === "formula-column" || Q.interface === "match-agg-column" || Q.interface === "relation-path" || !!Q.readonly || ta(Q), va = (Q) => (
11831
11831
  // Spans EVERY column — the leading grip/number/status cells are hidden
11832
11832
  // while the panel renders (the panel header already says "Line N · …"),
11833
11833
  // so nothing pushes the form to the right.
@@ -11872,7 +11872,7 @@ function U_({
11872
11872
  ] }),
11873
11873
  (() => {
11874
11874
  const oe = [
11875
- ...$r.filter(Sa),
11875
+ ...$r.filter(ya),
11876
11876
  ...ur.filter((be) => ta(be))
11877
11877
  ];
11878
11878
  return oe.length > 0 && (() => {
@@ -11906,7 +11906,7 @@ function U_({
11906
11906
  {
11907
11907
  className: "grid items-start gap-x-4 gap-y-3",
11908
11908
  style: { gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))" },
11909
- children: ur.filter((oe) => !Sa(oe)).map((oe) => {
11909
+ children: ur.filter((oe) => !ya(oe)).map((oe) => {
11910
11910
  var rt, tt, at;
11911
11911
  const be = oe.computed_type === "write" && !!oe.computed_formula, ye = oe.label || Qt(oe.field), Je = oe.interface === "formula-column" || oe.interface === "match-agg-column" || oe.interface === "relation-path";
11912
11912
  if (ta(oe))
@@ -12209,7 +12209,7 @@ function U_({
12209
12209
  {
12210
12210
  field: Q,
12211
12211
  value: Hr[Q.field] ?? null,
12212
- onChange: (oe) => _a((be) => ({ ...be, [Q.field]: oe })),
12212
+ onChange: (oe) => Ca((be) => ({ ...be, [Q.field]: oe })),
12213
12213
  relations: Ce,
12214
12214
  collection: t,
12215
12215
  itemId: "new"
@@ -12358,7 +12358,7 @@ function U_({
12358
12358
  c && /* @__PURE__ */ e("td", { className: "w-8 px-2 align-middle text-slate-400 text-[11px] select-none", children: oe + 1 }),
12359
12359
  Vt && /* @__PURE__ */ e("td", { className: "px-3 py-1 align-middle w-20", children: qt ? /* @__PURE__ */ e("span", { className: "inline-flex text-[10px] font-medium text-red-600 bg-red-50 border border-red-200 rounded px-1.5 py-0.5 dark:border-red-900/40 dark:bg-red-950/30 dark:text-red-300", children: "Delete" }) : ot ? /* @__PURE__ */ e("span", { className: "nvr-pop inline-flex text-[10px] font-medium text-amber-600 bg-amber-50 border border-amber-200 dark:text-amber-400 dark:bg-amber-500/10 dark:border-amber-500/40 rounded px-1.5 py-0.5", children: "Edited" }) : null })
12360
12360
  ] }),
12361
- tt && !qt && ls === "panel" ? Ca({
12361
+ tt && !qt && ls === "panel" ? va({
12362
12362
  identity: `${c ? `Line ${oe + 1} · ` : ""}${Ui(sn)}`,
12363
12363
  draft: (je == null ? void 0 : je.draft) ?? sn,
12364
12364
  rowId: be,
@@ -12556,7 +12556,7 @@ function U_({
12556
12556
  c && /* @__PURE__ */ e("td", { className: "w-8 px-2 align-middle text-slate-400 text-[11px] select-none", children: Bt.length + _n.length + 1 }),
12557
12557
  (W || Vt) && /* @__PURE__ */ e("td", { className: "px-3 py-1.5" })
12558
12558
  ] }),
12559
- ls === "panel" ? Ca({
12559
+ ls === "panel" ? va({
12560
12560
  identity: `${c ? `Line ${Bt.length + _n.length + 1} · ` : ""}New line`,
12561
12561
  draft: je.draft,
12562
12562
  rowId: void 0,
@@ -12732,7 +12732,7 @@ function U_({
12732
12732
  !ye && rt && Q.id != null && Ql.has(Q.id) && /* @__PURE__ */ e("span", { className: "inline-flex text-[10px] font-medium text-blue-600 bg-blue-50 border border-blue-200 rounded px-1.5 py-0.5", children: "Edited" })
12733
12733
  ] })
12734
12734
  ] }),
12735
- ye && ls === "panel" ? Ca({
12735
+ ye && ls === "panel" ? va({
12736
12736
  identity: `${c ? `Line ${Bt.length + oe + 1} · ` : ""}${Ui(ye ? je.draft : Q)}`,
12737
12737
  draft: (je == null ? void 0 : je.draft) ?? Q,
12738
12738
  rowId: be,
@@ -15636,7 +15636,7 @@ function m5({ value: t }) {
15636
15636
  ] });
15637
15637
  }
15638
15638
  function fy(t) {
15639
- const n = Na(), a = [...new Set(t.filter((l) => !!l))].sort(), { data: s } = ie({
15639
+ const n = _a(), a = [...new Set(t.filter((l) => !!l))].sort(), { data: s } = ie({
15640
15640
  queryKey: ["file-health", a.join(",")],
15641
15641
  queryFn: () => n.request(
15642
15642
  We("/files/verify", { ids: a.slice(0, 100) })
@@ -17939,7 +17939,7 @@ function C5({
17939
17939
  return /* @__PURE__ */ r("div", { className: "space-y-1.5 border-b border-slate-200 bg-slate-50 px-2 py-1.5", children: [
17940
17940
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
17941
17941
  /* @__PURE__ */ e(
17942
- va,
17942
+ Na,
17943
17943
  {
17944
17944
  value: i,
17945
17945
  onChange: d,
@@ -18611,7 +18611,7 @@ function xl({
18611
18611
  })();
18612
18612
  if (R.length > 0)
18613
18613
  return /* @__PURE__ */ e(
18614
- va,
18614
+ Na,
18615
18615
  {
18616
18616
  value: A,
18617
18617
  onChange: (E) => a(E || null),
@@ -19418,7 +19418,7 @@ function wu({
19418
19418
  entries: a,
19419
19419
  separator: s
19420
19420
  }) {
19421
- const l = Na(), i = String(n), o = a.some((p) => p.field.includes(".")) ? ["id", ...a.map((p) => p.field)].join(",") : null, { data: u } = ie({
19421
+ const l = _a(), i = String(n), o = a.some((p) => p.field.includes(".")) ? ["id", ...a.map((p) => p.field)].join(",") : null, { data: u } = ie({
19422
19422
  queryKey: ["inline-display", t, i, o],
19423
19423
  queryFn: () => l.request(
19424
19424
  te(`/items/${t}/${i}`, o ? { fields: o } : void 0)
@@ -19621,7 +19621,7 @@ function Ci(t, n) {
19621
19621
  return !l.includes(" ") && !l.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(l) && !/^\d+$/.test(l) && (l.includes("_") || l.includes("-") || /^[a-z]/.test(l)) ? Qt(l) : l;
19622
19622
  }
19623
19623
  function ob({ userId: t }) {
19624
- const n = Na(), { navigate: a, userUrl: s } = Ps(), l = s ? s(t) : `/users/${t}`, { data: i } = ie({
19624
+ const n = _a(), { navigate: a, userUrl: s } = Ps(), l = s ? s(t) : `/users/${t}`, { data: i } = ie({
19625
19625
  queryKey: ["user-chip", t],
19626
19626
  queryFn: () => n.request(
19627
19627
  te(`/users/${t}`)
@@ -19774,7 +19774,7 @@ function wy({
19774
19774
  collection: t,
19775
19775
  itemId: n
19776
19776
  }) {
19777
- const a = Na(), { data: s = [], isLoading: l } = ie({
19777
+ const a = _a(), { data: s = [], isLoading: l } = ie({
19778
19778
  queryKey: ["pipeline-owners-resolved", t, n],
19779
19779
  queryFn: () => a.request(
19780
19780
  We(`/pipelines/instance/${t}/owners/batch`, { ids: [n] })
@@ -19792,7 +19792,7 @@ function F0({
19792
19792
  itemId: n,
19793
19793
  label: a
19794
19794
  }) {
19795
- const s = Na(), { data: l = [] } = ie({
19795
+ const s = _a(), { data: l = [] } = ie({
19796
19796
  queryKey: ["pipeline-instance-owners", t, n],
19797
19797
  queryFn: () => s.request(te(`/pipelines/instance/${t}/${n}/owners`)).then((o) => o.data ?? []),
19798
19798
  enabled: !!s && !!t && !!n && n !== "new",
@@ -19980,7 +19980,7 @@ function Co({
19980
19980
  userId: t,
19981
19981
  size: n = "default"
19982
19982
  }) {
19983
- const a = Na(), { navigate: s, userUrl: l } = Ps(), i = l ? l(t) : `/users/${t}`, [d, o] = S(!1), { data: u, isLoading: c } = ie({
19983
+ const a = _a(), { navigate: s, userUrl: l } = Ps(), i = l ? l(t) : `/users/${t}`, [d, o] = S(!1), { data: u, isLoading: c } = ie({
19984
19984
  queryKey: ["user-card", t],
19985
19985
  queryFn: () => a.request(te(`/users/${t}/card`)).then((g) => g.data ?? null),
19986
19986
  enabled: !!a && !!t,
@@ -20041,7 +20041,7 @@ function B5({
20041
20041
  filenameTemplate: l,
20042
20042
  label: i
20043
20043
  }) {
20044
- const d = Na(), o = Tt(), [u, c] = S(!1), m = async () => {
20044
+ const d = _a(), o = Tt(), [u, c] = S(!1), m = async () => {
20045
20045
  if (!(!d || u || !s)) {
20046
20046
  c(!0);
20047
20047
  try {
@@ -20095,7 +20095,7 @@ function _c({
20095
20095
  id: n,
20096
20096
  className: a
20097
20097
  }) {
20098
- const s = Na(), l = n != null && n !== "" ? String(n) : null, { data: i } = ie({
20098
+ const s = _a(), l = n != null && n !== "" ? String(n) : null, { data: i } = ie({
20099
20099
  queryKey: ["col-meta-dt", t],
20100
20100
  queryFn: () => s.request(
20101
20101
  te(`/collections/${t}`)
@@ -27208,7 +27208,7 @@ function Fp({
27208
27208
  )) }),
27209
27209
  c ? /* @__PURE__ */ r("div", { className: "mt-2 space-y-1.5 rounded-md border border-slate-200 p-2 dark:border-border", children: [
27210
27210
  /* @__PURE__ */ e(
27211
- va,
27211
+ Na,
27212
27212
  {
27213
27213
  value: b,
27214
27214
  onChange: x,
@@ -27530,7 +27530,7 @@ function tu({
27530
27530
  /* @__PURE__ */ r("div", { children: [
27531
27531
  /* @__PURE__ */ e(Nn, { className: "mb-1 block text-[11px]", children: "Priority" }),
27532
27532
  /* @__PURE__ */ e(
27533
- va,
27533
+ Na,
27534
27534
  {
27535
27535
  value: A,
27536
27536
  onChange: (R) => N(R),
@@ -27694,7 +27694,7 @@ function tu({
27694
27694
  /* @__PURE__ */ r("div", { children: [
27695
27695
  /* @__PURE__ */ e(Nn, { className: "mb-1 block text-[11px]", children: "Priority" }),
27696
27696
  /* @__PURE__ */ e(
27697
- va,
27697
+ Na,
27698
27698
  {
27699
27699
  value: A,
27700
27700
  onChange: (R) => N(R),
@@ -28771,7 +28771,7 @@ function R3({
28771
28771
  )
28772
28772
  ] }),
28773
28773
  /* @__PURE__ */ e(
28774
- va,
28774
+ Na,
28775
28775
  {
28776
28776
  value: i,
28777
28777
  onChange: d,
@@ -30812,7 +30812,7 @@ function yS({
30812
30812
  })
30813
30813
  }),
30814
30814
  [Zn, xn, Sr]
30815
- ), [Or, Nr] = S([]), ja = ze(!1), Ts = ze(!1), [ca, wa] = S(/* @__PURE__ */ new Map()), [Rr, Is] = S(/* @__PURE__ */ new Map()), $r = ze(
30815
+ ), [Or, Nr] = S([]), ja = ze(!1), Ts = ze(!1), [ca, Sa] = S(/* @__PURE__ */ new Map()), [Rr, Is] = S(/* @__PURE__ */ new Map()), $r = ze(
30816
30816
  null
30817
30817
  ), dr = ze(/* @__PURE__ */ new Map()), Ya = ze(0), Xa = ze(/* @__PURE__ */ new Map()), fr = ze(/* @__PURE__ */ new Map()), er = ve(
30818
30818
  () => ({
@@ -30821,7 +30821,7 @@ function yS({
30821
30821
  getDerivedOrigin: (L) => fr.current.get(L) ?? null,
30822
30822
  stageLink: (L, U) => {
30823
30823
  var J, se;
30824
- if (wa((me) => {
30824
+ if (Sa((me) => {
30825
30825
  const $e = me.get(L) ?? [], Re = hS($e, U);
30826
30826
  if (Re === $e) return me;
30827
30827
  const Ee = new Map(me);
@@ -30835,7 +30835,7 @@ function yS({
30835
30835
  const se = new Map(J), me = new Set(se.get(L));
30836
30836
  return me.add(U), se.set(L, me), se;
30837
30837
  }),
30838
- unstageLink: (L, U) => wa((J) => {
30838
+ unstageLink: (L, U) => Sa((J) => {
30839
30839
  const se = new Map(J);
30840
30840
  return se.set(
30841
30841
  L,
@@ -31206,7 +31206,7 @@ function yS({
31206
31206
  [t, ce, Dr, er, K, z, ee]
31207
31207
  ), hs = ze(!1);
31208
31208
  Oe(() => {
31209
- !H || !O && !F && !P || hs.current || (hs.current = !0, O && (Ct((L) => ({ ...O, ...L })), Jt.current = { ...O, ...Jt.current }), F && wa((L) => {
31209
+ !H || !O && !F && !P || hs.current || (hs.current = !0, O && (Ct((L) => ({ ...O, ...L })), Jt.current = { ...O, ...Jt.current }), F && Sa((L) => {
31210
31210
  const U = new Map(L);
31211
31211
  for (const [J, se] of Object.entries(F))
31212
31212
  !U.has(J) && se.length && U.set(J, [...se]);
@@ -31879,11 +31879,11 @@ function yS({
31879
31879
  return L;
31880
31880
  }, [ee]), Hr = ze(pa);
31881
31881
  Hr.current = pa;
31882
- const _a = ze(/* @__PURE__ */ new Map()), ga = kn((L, U, J) => {
31882
+ const Ca = ze(/* @__PURE__ */ new Map()), ga = kn((L, U, J) => {
31883
31883
  const se = `${L}.${U}`;
31884
31884
  if (J === null) {
31885
- if (!_a.current.has(se)) return;
31886
- _a.current.delete(se), mr((Re) => {
31885
+ if (!Ca.current.has(se)) return;
31886
+ Ca.current.delete(se), mr((Re) => {
31887
31887
  if (!Re.has(se)) return Re;
31888
31888
  const Ee = new Map(Re);
31889
31889
  return Ee.delete(se), Ee;
@@ -31893,7 +31893,7 @@ function yS({
31893
31893
  const me = Hr.current.get(se);
31894
31894
  if (!me) return;
31895
31895
  const $e = J.map((Re) => me.map((Ee) => String(Re[Ee] ?? "")).join("")).join("");
31896
- _a.current.get(se) !== $e && (_a.current.set(se, $e), mr((Re) => new Map(Re).set(se, J)));
31896
+ Ca.current.get(se) !== $e && (Ca.current.set(se, $e), mr((Re) => new Map(Re).set(se, J)));
31897
31897
  }, []), ss = ve(
31898
31898
  () => ({ rows: Yn, report: ga }),
31899
31899
  [Yn, ga]
@@ -32002,7 +32002,7 @@ function yS({
32002
32002
  }, [ee, Yn, Gr, Ls, je]), vs = ve(
32003
32003
  () => dn ? { ...je, ...dn } : je,
32004
32004
  [je, dn]
32005
- ), Ir = De !== "original", Sa = Ir ? "nivaro_addendums" : t, Ca = Ir ? De : z, il = ve(() => {
32005
+ ), Ir = De !== "original", ya = Ir ? "nivaro_addendums" : t, va = Ir ? De : z, il = ve(() => {
32006
32006
  const L = {};
32007
32007
  for (const U of Fe)
32008
32008
  if (!["approved", "rejected"].includes(U.status))
@@ -32640,8 +32640,8 @@ ${se.join(`
32640
32640
  }, jo = (Fa == null ? void 0 : Fa.group_key) ?? null, yd = !!(jo && Tr.some((L) => L.key === jo)), Uv = () => /* @__PURE__ */ e(
32641
32641
  c2,
32642
32642
  {
32643
- collection: Sa,
32644
- item: Ca,
32643
+ collection: ya,
32644
+ item: va,
32645
32645
  title: (Fa == null ? void 0 : Fa.label_override) ?? void 0,
32646
32646
  defaultExpanded: (Fa == null ? void 0 : Fa.default_expanded) ?? !1
32647
32647
  }
@@ -33375,7 +33375,7 @@ ${se.join(`
33375
33375
  }
33376
33376
  } catch {
33377
33377
  }
33378
- Yt.current = null, vn.current = null, ne.invalidateQueries({ queryKey: ["collision-base", t] }), ln(!1), wa(/* @__PURE__ */ new Map()), Is(/* @__PURE__ */ new Map()), On([]), Bt([]);
33378
+ Yt.current = null, vn.current = null, ne.invalidateQueries({ queryKey: ["collision-base", t] }), ln(!1), Sa(/* @__PURE__ */ new Map()), Is(/* @__PURE__ */ new Map()), On([]), Bt([]);
33379
33379
  const U = /* @__PURE__ */ new Set([
33380
33380
  ...Zn.keys(),
33381
33381
  ...xn.keys(),
@@ -33424,8 +33424,8 @@ ${se.join(`
33424
33424
  return /* @__PURE__ */ e(
33425
33425
  Zc,
33426
33426
  {
33427
- collection: Sa,
33428
- item: Ca,
33427
+ collection: ya,
33428
+ item: va,
33429
33429
  title: (Er == null ? void 0 : Er.label_override) ?? void 0,
33430
33430
  defaultExpanded: (Er == null ? void 0 : Er.default_expanded) ?? !1,
33431
33431
  showApprovalChain: !!(Er != null && Er.show_approval_chain),
@@ -33933,8 +33933,8 @@ ${se.join(`
33933
33933
  group: U,
33934
33934
  fields: Re,
33935
33935
  ownersAssignment: Ee ? Fa : void 0,
33936
- ownersCollection: Sa,
33937
- ownersItemId: Ca,
33936
+ ownersCollection: ya,
33937
+ ownersItemId: va,
33938
33938
  pdfAssignment: He ? Xr : void 0,
33939
33939
  pdfAttachField: He ? Al : void 0,
33940
33940
  pdfFilenameTemplate: He ? Jh : void 0,
@@ -33986,8 +33986,8 @@ ${se.join(`
33986
33986
  !Er && x && /* @__PURE__ */ e(
33987
33987
  Zc,
33988
33988
  {
33989
- collection: Sa,
33990
- item: Ca,
33989
+ collection: ya,
33990
+ item: va,
33991
33991
  onBeforeTransition: Wi,
33992
33992
  addendumPending: !Ir && ue > 0 && !!(Z != null && Z.addendums_enabled),
33993
33993
  addendumView: Ir
@@ -34204,8 +34204,8 @@ ${se.join(`
34204
34204
  !Er && x && /* @__PURE__ */ e(
34205
34205
  Zc,
34206
34206
  {
34207
- collection: Sa,
34208
- item: Ca,
34207
+ collection: ya,
34208
+ item: va,
34209
34209
  onBeforeTransition: Wi,
34210
34210
  addendumPending: !Ir && ue > 0 && !!(Z != null && Z.addendums_enabled),
34211
34211
  addendumView: Ir
@@ -34306,8 +34306,8 @@ ${se.join(`
34306
34306
  Sb,
34307
34307
  {
34308
34308
  wrap: !1,
34309
- collection: Sa,
34310
- item: Ca,
34309
+ collection: ya,
34310
+ item: va,
34311
34311
  onBeforeTransition: async () => {
34312
34312
  if (!Wi()) return !1;
34313
34313
  if (!Lt) return !0;
@@ -34318,7 +34318,7 @@ ${se.join(`
34318
34318
  }
34319
34319
  }
34320
34320
  },
34321
- `${Sa}:${Ca}`
34321
+ `${ya}:${va}`
34322
34322
  )
34323
34323
  ] })
34324
34324
  ] }) }), me = sn.length > 0 ? Math.min(...sn.map((He) => He.sort)) : 1 / 0, $e = zc.filter((He) => typeof He != "string" ? He.sort < me : He === "__pipeline__" ? !!(Er && Er.sort < me) : He === "__comments__" ? !!($a && $a.sort < me) : He === "__tasks__" ? !!(qa && qa.sort < me) : He === "__addendums__" ? !!(Os && Os.sort < me) : !1), Re = zc.filter((He) => He === "__ungrouped__" ? !1 : typeof He != "string" ? He.sort >= me : He === "__pipeline__" ? !(Er && Er.sort < me) : He === "__comments__" ? !($a && $a.sort < me) : He === "__tasks__" ? !(qa && qa.sort < me) : He === "__addendums__" ? !(Os && Os.sort < me) : !1);
@@ -34348,8 +34348,8 @@ ${se.join(`
34348
34348
  !Er && x && /* @__PURE__ */ e(
34349
34349
  Zc,
34350
34350
  {
34351
- collection: Sa,
34352
- item: Ca,
34351
+ collection: ya,
34352
+ item: va,
34353
34353
  defaultExpanded: !1,
34354
34354
  onBeforeTransition: Wi,
34355
34355
  addendumPending: !Ir && ue > 0 && !!(Z != null && Z.addendums_enabled),
@@ -35309,8 +35309,8 @@ ${se.join(`
35309
35309
  Sb,
35310
35310
  {
35311
35311
  wrap: !1,
35312
- collection: Sa,
35313
- item: Ca,
35312
+ collection: ya,
35313
+ item: va,
35314
35314
  onBeforeTransition: async () => {
35315
35315
  if (!Wi()) return !1;
35316
35316
  if (!Lt) return !0;
@@ -35321,7 +35321,7 @@ ${se.join(`
35321
35321
  }
35322
35322
  }
35323
35323
  },
35324
- `${Sa}:${Ca}`
35324
+ `${ya}:${va}`
35325
35325
  )
35326
35326
  ] })
35327
35327
  ]
@@ -35417,8 +35417,8 @@ ${se.join(`
35417
35417
  /* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(
35418
35418
  wy,
35419
35419
  {
35420
- collection: Sa,
35421
- itemId: Ca
35420
+ collection: ya,
35421
+ itemId: va
35422
35422
  }
35423
35423
  ) }),
35424
35424
  yt === "__owners__" ? /* @__PURE__ */ e($n, { className: "absolute top-2 right-2 h-3 w-3 text-green-500" }) : /* @__PURE__ */ e(
@@ -35591,8 +35591,8 @@ ${se.join(`
35591
35591
  !H && z && !((vf = W == null ? void 0 : W.layout) != null && vf.hide_sla_banner) && /* @__PURE__ */ e("div", { className: "nvr-expand-in", children: /* @__PURE__ */ e(
35592
35592
  z3,
35593
35593
  {
35594
- collection: t,
35595
- itemId: String(z)
35594
+ collection: ya,
35595
+ itemId: String(va)
35596
35596
  }
35597
35597
  ) }),
35598
35598
  Or.length > 0 && /* @__PURE__ */ e(
@@ -38499,7 +38499,7 @@ function zS({
38499
38499
  },
38500
38500
  children: [
38501
38501
  /* @__PURE__ */ e(
38502
- va,
38502
+ Na,
38503
38503
  {
38504
38504
  value: k,
38505
38505
  onChange: T,
@@ -38760,7 +38760,7 @@ function TF({
38760
38760
  staleTime: 10 * 6e4,
38761
38761
  retry: !1
38762
38762
  }))
38763
- }), wa = ve(() => {
38763
+ }), Sa = ve(() => {
38764
38764
  const I = /* @__PURE__ */ new Map();
38765
38765
  return Ts.forEach((xe, Pe) => {
38766
38766
  var _e;
@@ -38770,14 +38770,14 @@ function TF({
38770
38770
  () => [
38771
38771
  ...new Set(
38772
38772
  ja.filter((I) => I.info.kind === "m2m").map((I) => {
38773
- const xe = I.info.relation.many_collection ?? "", Pe = wa.get(xe), _e = Pe == null ? void 0 : Pe.relations.find(
38773
+ const xe = I.info.relation.many_collection ?? "", Pe = Sa.get(xe), _e = Pe == null ? void 0 : Pe.relations.find(
38774
38774
  (Xe) => Xe.many_collection === xe && Xe.many_field === I.info.relation.junction_field
38775
38775
  );
38776
38776
  return (_e == null ? void 0 : _e.one_collection) ?? "";
38777
38777
  }).filter(Boolean)
38778
38778
  )
38779
38779
  ],
38780
- [ja, wa]
38780
+ [ja, Sa]
38781
38781
  ), Is = yr({
38782
38782
  queries: Rr.map((I) => ({
38783
38783
  queryKey: ["cbv-collection-meta", I],
@@ -38796,28 +38796,28 @@ function TF({
38796
38796
  for (const xe of ja) {
38797
38797
  const Pe = xe.info.relation.many_collection ?? "";
38798
38798
  if (xe.info.kind === "o2m")
38799
- I[xe.field] = `${xe.field}.${Yu(wa.get(Pe))}`;
38799
+ I[xe.field] = `${xe.field}.${Yu(Sa.get(Pe))}`;
38800
38800
  else {
38801
- const _e = wa.get(Pe), Xe = _e == null ? void 0 : _e.relations.find(
38801
+ const _e = Sa.get(Pe), Xe = _e == null ? void 0 : _e.relations.find(
38802
38802
  (Wt) => Wt.many_collection === Pe && Wt.many_field === xe.info.relation.junction_field
38803
38803
  ), bt = (Xe == null ? void 0 : Xe.one_collection) ?? "";
38804
38804
  I[xe.field] = `${xe.field}.${Yu(bt ? $r.get(bt) : void 0)}`;
38805
38805
  }
38806
38806
  }
38807
38807
  return I;
38808
- }, [ja, wa, $r]), Ya = ve(() => {
38808
+ }, [ja, Sa, $r]), Ya = ve(() => {
38809
38809
  const I = {};
38810
38810
  for (const xe of ja)
38811
38811
  if (xe.info.kind === "o2m")
38812
38812
  I[xe.field] = { kind: "o2m" };
38813
38813
  else {
38814
- const Pe = xe.info.relation.many_collection ?? "", _e = wa.get(Pe), Xe = _e == null ? void 0 : _e.relations.find(
38814
+ const Pe = xe.info.relation.many_collection ?? "", _e = Sa.get(Pe), Xe = _e == null ? void 0 : _e.relations.find(
38815
38815
  (bt) => bt.many_collection === Pe && bt.many_field === xe.info.relation.junction_field
38816
38816
  );
38817
38817
  Xe != null && Xe.one_collection && (I[xe.field] = { kind: "m2m", target: Xe.one_collection });
38818
38818
  }
38819
38819
  return I;
38820
- }, [ja, wa]), Xa = So(fe, 350), fr = ve(() => {
38820
+ }, [ja, Sa]), Xa = So(fe, 350), fr = ve(() => {
38821
38821
  var xe, Pe;
38822
38822
  const I = [];
38823
38823
  for (const _e of C) {
@@ -39283,7 +39283,7 @@ function TF({
39283
39283
  }), Hr = Ve({
39284
39284
  mutationFn: (I) => p.request(Rn(`/items/${t}/${I}`)),
39285
39285
  onSuccess: () => void h.invalidateQueries({ queryKey: ["cbv-items", t] })
39286
- }), _a = Ve({
39286
+ }), Ca = Ve({
39287
39287
  mutationFn: (I) => p.request(Rn(`/saved-views/${I}`)),
39288
39288
  onSuccess: (I, xe) => {
39289
39289
  Lt === xe && Aa(), rs();
@@ -39407,7 +39407,7 @@ function TF({
39407
39407
  } finally {
39408
39408
  ll(!1);
39409
39409
  }
39410
- }, Ui = Zr === 0 ? 0 : (v - 1) * Wn + 1, vs = Math.min(v * Wn, Zr), Ir = !!(qr != null && qr.instances), Sa = (It ? 1 : 0) + (Ir ? 2 : 0) + (rn ? 1 : 0), Ca = [
39410
+ }, Ui = Zr === 0 ? 0 : (v - 1) * Wn + 1, vs = Math.min(v * Wn, Zr), Ir = !!(qr != null && qr.instances), ya = (It ? 1 : 0) + (Ir ? 2 : 0) + (rn ? 1 : 0), va = [
39411
39411
  ...xn.map((I) => ({ key: I, kind: "data" })),
39412
39412
  ...Ir ? [
39413
39413
  { key: "__state__", kind: "state" },
@@ -39415,9 +39415,9 @@ function TF({
39415
39415
  ] : [],
39416
39416
  ...rn ? [{ key: "__actions__", kind: "actions" }] : []
39417
39417
  ], il = [
39418
- ...Ca.filter((I) => Dr(I.key) === "left"),
39419
- ...Ca.filter((I) => !Dr(I.key)),
39420
- ...Ca.filter((I) => Dr(I.key) === "right")
39418
+ ...va.filter((I) => Dr(I.key) === "left"),
39419
+ ...va.filter((I) => !Dr(I.key)),
39420
+ ...va.filter((I) => Dr(I.key) === "right")
39421
39421
  ], fi = [
39422
39422
  ...Ir ? [{ key: "__state__", label: "State" }] : [],
39423
39423
  ...xn.filter((I) => Vr(I) || !ws(xr, t, I)).map((I) => ({ key: I, label: Nr(I) }))
@@ -40492,7 +40492,7 @@ ${Pe}`).then(() => {
40492
40492
  children: "★"
40493
40493
  }
40494
40494
  ),
40495
- /* @__PURE__ */ e("button", { type: "button", onClick: () => _a.mutate(I.id), title: "Delete view", "aria-label": `Delete ${I.name}`, className: "hover:text-red-500", children: "✕" })
40495
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => Ca.mutate(I.id), title: "Delete view", "aria-label": `Delete ${I.name}`, className: "hover:text-red-500", children: "✕" })
40496
40496
  ] })
40497
40497
  ]
40498
40498
  },
@@ -40674,13 +40674,13 @@ ${Pe}`).then(() => {
40674
40674
  })
40675
40675
  ] })
40676
40676
  ] }),
40677
- /* @__PURE__ */ e("tbody", { className: "text-[12px] tabular-nums", children: hs ? Array.from({ length: 12 }, (I, xe) => /* @__PURE__ */ e("tr", { className: "border-b border-slate-100 dark:border-slate-800", children: /* @__PURE__ */ e("td", { className: "px-3 py-2", colSpan: xn.length + Sa, children: /* @__PURE__ */ e(
40677
+ /* @__PURE__ */ e("tbody", { className: "text-[12px] tabular-nums", children: hs ? Array.from({ length: 12 }, (I, xe) => /* @__PURE__ */ e("tr", { className: "border-b border-slate-100 dark:border-slate-800", children: /* @__PURE__ */ e("td", { className: "px-3 py-2", colSpan: xn.length + ya, children: /* @__PURE__ */ e(
40678
40678
  "span",
40679
40679
  {
40680
40680
  className: "cbv-shimmer block h-3.5 rounded",
40681
40681
  style: { width: `${55 + xe * 17 % 40}%` }
40682
40682
  }
40683
- ) }) }, xe)) : Pr.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: xn.length + Sa, className: "nvr-fade-in py-16", children: (() => {
40683
+ ) }) }, xe)) : Pr.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: xn.length + ya, className: "nvr-fade-in py-16", children: (() => {
40684
40684
  const I = C.length === 0 && Object.keys(fe).length === 0 && !Object.values(ce).some((Pe) => Pe.length > 0) && !$, xe = de == null ? void 0 : de.empty_state;
40685
40685
  if (I && xe && (xe.title || xe.message)) {
40686
40686
  const Pe = xe.cta_url ?? "", _e = Pe.startsWith("/"), Xe = /^https?:\/\//.test(Pe);
@@ -40728,7 +40728,7 @@ ${Pe}`).then(() => {
40728
40728
  }),
40729
40729
  style: Pe,
40730
40730
  className: "nvr-row-enter cursor-pointer border-b border-slate-200 bg-slate-50/80 transition-colors hover:bg-slate-100/80 dark:border-slate-700 dark:bg-muted/40",
40731
- children: /* @__PURE__ */ e("td", { className: "px-3 py-1.5", colSpan: xn.length + Sa, children: /* @__PURE__ */ r("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-200", children: [
40731
+ children: /* @__PURE__ */ e("td", { className: "px-3 py-1.5", colSpan: xn.length + ya, children: /* @__PURE__ */ r("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-200", children: [
40732
40732
  /* @__PURE__ */ e(
40733
40733
  qn,
40734
40734
  {
@@ -46177,7 +46177,7 @@ val1,val2,val3`,
46177
46177
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
46178
46178
  /* @__PURE__ */ e(Nn, { className: "text-[11.5px]", children: "When a record already exists" }),
46179
46179
  /* @__PURE__ */ e(
46180
- va,
46180
+ Na,
46181
46181
  {
46182
46182
  value: C,
46183
46183
  onChange: A,
@@ -46745,7 +46745,7 @@ function T4({
46745
46745
  }
46746
46746
  ) }),
46747
46747
  /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
46748
- va,
46748
+ Na,
46749
46749
  {
46750
46750
  value: m.type,
46751
46751
  onChange: (f) => h({ type: f }),
@@ -47242,7 +47242,7 @@ function M4({
47242
47242
  String(m.id)
47243
47243
  )),
47244
47244
  /* @__PURE__ */ e(
47245
- va,
47245
+ Na,
47246
47246
  {
47247
47247
  value: "",
47248
47248
  onChange: (m) => {
@@ -47471,7 +47471,7 @@ function E4({
47471
47471
  label: "Loader",
47472
47472
  hint: "Bulk pushes a file to the share and BULK INSERTs it; insert batches rows directly. Ignored in service mode.",
47473
47473
  children: /* @__PURE__ */ e(
47474
- va,
47474
+ Na,
47475
47475
  {
47476
47476
  value: c.loader,
47477
47477
  onChange: (_) => m((k) => ({ ...k, loader: _ })),
@@ -47491,7 +47491,7 @@ function E4({
47491
47491
  label: "Processor",
47492
47492
  hint: "Stored procedure MERGEs staging rows (no revisions). Items service diffs and writes only real changes — revisions, activity, rules and computed fields apply.",
47493
47493
  children: /* @__PURE__ */ e(
47494
- va,
47494
+ Na,
47495
47495
  {
47496
47496
  value: c.processor,
47497
47497
  onChange: (_) => m((k) => ({ ...k, processor: _ })),
@@ -63618,8 +63618,8 @@ function QF({ queueId: t, realtime: n, renderError: a }) {
63618
63618
  if (pa.length === 0) continue;
63619
63619
  const Hr = x[Yn];
63620
63620
  if (Hr && (Array.isArray(Hr) ? Hr.length > 0 : Hr !== "")) continue;
63621
- const _a = pa.length ? await Mt(hn, pa) : [];
63622
- _a.length > 0 && (Fe[Yn] = _a);
63621
+ const Ca = pa.length ? await Mt(hn, pa) : [];
63622
+ Ca.length > 0 && (Fe[Yn] = Ca);
63623
63623
  } catch {
63624
63624
  }
63625
63625
  }
@@ -64009,7 +64009,7 @@ function QF({ queueId: t, realtime: n, renderError: a }) {
64009
64009
  queryKey: ["queue-views", t],
64010
64010
  queryFn: () => l.request(te(`/queues/${t}/views`)),
64011
64011
  enabled: !!t
64012
- }), [Nr, ja] = S(null), [Ts, ca] = S(!1), [wa, Rr] = S(""), [Is, $r] = S(!1), [dr, Ya] = S(!1);
64012
+ }), [Nr, ja] = S(null), [Ts, ca] = S(!1), [Sa, Rr] = S(""), [Is, $r] = S(!1), [dr, Ya] = S(!1);
64013
64013
  function Xa(B) {
64014
64014
  const Fe = B.state ?? {};
64015
64015
  c(Fe.scope ?? "all"), $({ ...W.current, ...Fe.filters ?? {} }), b(Fe.sort ?? ""), A(Fe.group_by ?? null), St(Fe.columns ?? null), q(Fe.pins ?? null), Fe.view && v(Me.includes(Fe.view) ? Fe.view : Me[0]), p(1), ja(B.id);
@@ -64037,7 +64037,7 @@ function QF({ queueId: t, realtime: n, renderError: a }) {
64037
64037
  }), js = Ve({
64038
64038
  mutationFn: () => l.request(
64039
64039
  We(`/queues/${t}/views`, {
64040
- name: wa.trim(),
64040
+ name: Sa.trim(),
64041
64041
  is_shared: Is || dr,
64042
64042
  is_default: dr,
64043
64043
  state: {
@@ -64281,8 +64281,8 @@ function QF({ queueId: t, realtime: n, renderError: a }) {
64281
64281
  header: we(`extra.${B}`, Qd(B)),
64282
64282
  sortable: !0,
64283
64283
  render: (Fe) => {
64284
- var _a, ga;
64285
- const mt = (_a = Fe.extra) == null ? void 0 : _a[B];
64284
+ var Ca, ga;
64285
+ const mt = (Ca = Fe.extra) == null ? void 0 : Ca[B];
64286
64286
  if (mt == null || mt === "") return /* @__PURE__ */ e("span", { className: "text-slate-300", children: "—" });
64287
64287
  const Mt = Hn(B), hn = Mt ? io(String(mt), Mt) : String(mt), { text: dn, title: Yn } = ur(hn), mr = ((F == null ? void 0 : F.extra_field_meta) ?? []).find((ss) => ss.path === B), pa = ((ga = Fe.extra_ids) == null ? void 0 : ga[B]) ?? [], Hr = ta(B);
64288
64288
  return (mr == null ? void 0 : mr.kind) === "relation" && mr.target_collection && pa.length > 0 && Hr.enabled && !mr.aggregate ? /* @__PURE__ */ e(
@@ -64410,9 +64410,9 @@ function QF({ queueId: t, realtime: n, renderError: a }) {
64410
64410
  te(`/items/${B.target_collection}`, mt)
64411
64411
  )).data ?? [], dn = Hn(B.path), Yn = z[B.path] ? new Set(z[B.path]) : null, mr = /* @__PURE__ */ new Set(), pa = [];
64412
64412
  for (const Hr of hn) {
64413
- const _a = Hr[B.display_field];
64414
- if (_a == null || _a === "") continue;
64415
- const ga = String(_a);
64413
+ const Ca = Hr[B.display_field];
64414
+ if (Ca == null || Ca === "") continue;
64415
+ const ga = String(Ca);
64416
64416
  mr.has(ga) || Yn && !Yn.has(ga) || (mr.add(ga), pa.push({ label: dn ? io(ga, dn) : ga, value: ga }));
64417
64417
  }
64418
64418
  return pa;
@@ -64950,7 +64950,7 @@ function QF({ queueId: t, realtime: n, renderError: a }) {
64950
64950
  /* @__PURE__ */ e(
64951
64951
  "input",
64952
64952
  {
64953
- value: wa,
64953
+ value: Sa,
64954
64954
  onChange: (B) => Rr(B.target.value),
64955
64955
  placeholder: "View name",
64956
64956
  className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
@@ -64981,7 +64981,7 @@ function QF({ queueId: t, realtime: n, renderError: a }) {
64981
64981
  "button",
64982
64982
  {
64983
64983
  type: "button",
64984
- disabled: !wa.trim() || js.isPending,
64984
+ disabled: !Sa.trim() || js.isPending,
64985
64985
  onClick: () => js.mutate(),
64986
64986
  className: "w-full rounded-md bg-nvr-cyan px-2 py-1.5 text-[12px] font-semibold text-white hover:bg-nvr-cyan/90 disabled:opacity-50",
64987
64987
  children: "Save current view"
@@ -67227,7 +67227,7 @@ function Vq({
67227
67227
  const M = b.find((O) => O.value === q.field);
67228
67228
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
67229
67229
  /* @__PURE__ */ e(
67230
- va,
67230
+ Na,
67231
67231
  {
67232
67232
  value: q.field,
67233
67233
  onChange: (O) => m((F) => F.map((P, K) => K === j ? { ...P, field: O } : P)),
@@ -67237,7 +67237,7 @@ function Vq({
67237
67237
  }
67238
67238
  ),
67239
67239
  (M == null ? void 0 : M.aggregatable) && /* @__PURE__ */ e(
67240
- va,
67240
+ Na,
67241
67241
  {
67242
67242
  value: q.agg,
67243
67243
  onChange: (O) => m(
@@ -67249,7 +67249,7 @@ function Vq({
67249
67249
  }
67250
67250
  ),
67251
67251
  /* @__PURE__ */ e(
67252
- va,
67252
+ Na,
67253
67253
  {
67254
67254
  value: q.op,
67255
67255
  onChange: (O) => m(
@@ -68788,7 +68788,7 @@ function VF({
68788
68788
  ] })
68789
68789
  ] }),
68790
68790
  /* @__PURE__ */ e(
68791
- va,
68791
+ Na,
68792
68792
  {
68793
68793
  value: (vn == null ? void 0 : vn.preset) ?? "",
68794
68794
  onChange: (Ue) => x(Ue ? { preset: Ue } : null),
@@ -70264,7 +70264,7 @@ function JF() {
70264
70264
  ] });
70265
70265
  }
70266
70266
  function n6() {
70267
- const t = Na(), { data: n, isFetched: a } = ie({
70267
+ const t = _a(), { data: n, isFetched: a } = ie({
70268
70268
  queryKey: ["feature-flags-mine"],
70269
70269
  enabled: !!t,
70270
70270
  staleTime: 6e4,
@@ -70492,7 +70492,7 @@ function o6({
70492
70492
  inputId: d,
70493
70493
  errorId: o
70494
70494
  }) {
70495
- const u = Na(), [c, m] = S(!1), [p, h] = S(null), [f, g] = S(0), v = d ?? t.field, y = n != null && typeof n == "object" ? String(n.id ?? "") : n == null ? "" : String(n);
70495
+ const u = _a(), [c, m] = S(!1), [p, h] = S(null), [f, g] = S(0), v = d ?? t.field, y = n != null && typeof n == "object" ? String(n.id ?? "") : n == null ? "" : String(n);
70496
70496
  return /* @__PURE__ */ r("div", { children: [
70497
70497
  /* @__PURE__ */ e(
70498
70498
  "input",
@@ -70641,7 +70641,7 @@ function s0({
70641
70641
  errorId: o
70642
70642
  }) {
70643
70643
  var $, C, A;
70644
- const u = Na(), [c, m] = S(""), p = (($ = t.relation) == null ? void 0 : $.relatedCollection) ?? "", {
70644
+ const u = _a(), [c, m] = S(""), p = (($ = t.relation) == null ? void 0 : $.relatedCollection) ?? "", {
70645
70645
  options: h,
70646
70646
  loading: f,
70647
70647
  error: g
@@ -70899,7 +70899,7 @@ function p6({
70899
70899
  field: t,
70900
70900
  itemId: n
70901
70901
  }) {
70902
- const a = Na(), s = nh(), l = t.relation, i = (l == null ? void 0 : l.relatedCollection) ?? "", d = (l == null ? void 0 : l.manyField) ?? "", [o, u] = S([]), [c, m] = S([]), [p, h] = S(/* @__PURE__ */ new Map()), [f, g] = S([]), [v, y] = S(/* @__PURE__ */ new Set()), b = ze(!0);
70902
+ const a = _a(), s = nh(), l = t.relation, i = (l == null ? void 0 : l.relatedCollection) ?? "", d = (l == null ? void 0 : l.manyField) ?? "", [o, u] = S([]), [c, m] = S([]), [p, h] = S(/* @__PURE__ */ new Map()), [f, g] = S([]), [v, y] = S(/* @__PURE__ */ new Set()), b = ze(!0);
70903
70903
  Oe(() => (b.current = !0, () => {
70904
70904
  b.current = !1;
70905
70905
  }), []);
@@ -71180,7 +71180,7 @@ function g6({
71180
71180
  labelOverride: a,
71181
71181
  defaultExpanded: s
71182
71182
  }) {
71183
- const l = Na(), [i, d] = S(!1), [o, u] = S([]), [c, m] = S(!1), [p, h] = S(""), [f, g] = S(!1), [v, y] = S(null), [b, x] = S(""), $ = ze(!0), C = ze(!1);
71183
+ const l = _a(), [i, d] = S(!1), [o, u] = S([]), [c, m] = S(!1), [p, h] = S(""), [f, g] = S(!1), [v, y] = S(null), [b, x] = S(""), $ = ze(!0), C = ze(!1);
71184
71184
  Oe(() => ($.current = !0, () => {
71185
71185
  $.current = !1;
71186
71186
  }), []), Oe(() => {
@@ -71981,7 +71981,7 @@ function N6({
71981
71981
  labelOverride: a,
71982
71982
  defaultExpanded: s
71983
71983
  }) {
71984
- const l = Na(), [i, d] = S(!1), [o, u] = S(null), [c, m] = S(""), [p, h] = S(null), [f, g] = S(!1), [v, y] = S(!1), b = ze(!0), x = ze(!1);
71984
+ const l = _a(), [i, d] = S(!1), [o, u] = S(null), [c, m] = S(""), [p, h] = S(null), [f, g] = S(!1), [v, y] = S(!1), b = ze(!0), x = ze(!1);
71985
71985
  Oe(() => (b.current = !0, () => {
71986
71986
  b.current = !1;
71987
71987
  }), []), Oe(() => {
@@ -72329,7 +72329,7 @@ function S6({
72329
72329
  labelOverride: a,
72330
72330
  defaultExpanded: s
72331
72331
  }) {
72332
- const l = Na(), [i, d] = S(!1), [o, u] = S([]), [c, m] = S([]), [p, h] = S(!1), [f, g] = S(!1), [v, y] = S(""), [b, x] = S(""), [$, C] = S(""), [A, N] = S(!1), w = ze(!0), _ = ze(!1);
72332
+ const l = _a(), [i, d] = S(!1), [o, u] = S([]), [c, m] = S([]), [p, h] = S(!1), [f, g] = S(!1), [v, y] = S(""), [b, x] = S(""), [$, C] = S(""), [A, N] = S(!1), w = ze(!0), _ = ze(!1);
72333
72333
  Oe(() => (w.current = !0, () => {
72334
72334
  w.current = !1;
72335
72335
  }), []), Oe(() => {
@@ -73401,7 +73401,7 @@ function D6(t, n) {
73401
73401
  return !0;
73402
73402
  }
73403
73403
  function cT(t, n, a) {
73404
- const s = Na(), l = a ?? s;
73404
+ const s = _a(), l = a ?? s;
73405
73405
  if (!l)
73406
73406
  throw new Error(
73407
73407
  "useNivaroForm requires a NivaroClient — pass one as the third argument or wrap the tree in <NivaroProvider>."
@@ -73694,7 +73694,7 @@ function zx(t) {
73694
73694
  };
73695
73695
  }
73696
73696
  function mT(t = {}) {
73697
- const n = Na(), a = t.client ?? n, s = t.app, l = t.disabled ?? !1, i = ze({
73697
+ const n = _a(), a = t.client ?? n, s = t.app, l = t.disabled ?? !1, i = ze({
73698
73698
  recordingId: null,
73699
73699
  buffer: [],
73700
73700
  seq: 0,
@@ -74039,7 +74039,7 @@ export {
74039
74039
  Ae as useNivaroClient,
74040
74040
  cT as useNivaroForm,
74041
74041
  gh as useOnlineUsers,
74042
- Na as useOptionalNivaroClient,
74042
+ _a as useOptionalNivaroClient,
74043
74043
  Cm as useOptionalRealtime,
74044
74044
  iT as useOrderedLayout,
74045
74045
  km as useOverlayState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.1.191",
3
+ "version": "0.1.192",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",