@chaibuilder/pages 0.2.0 → 0.2.1

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.
@@ -3,18 +3,18 @@ var qn = (e) => {
3
3
  };
4
4
  var Kn = (e, t, n) => t.has(e) || qn("Cannot " + n);
5
5
  var T = (e, t, n) => (Kn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), F = (e, t, n) => t.has(e) ? qn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), M = (e, t, n, r) => (Kn(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
6
- import { jsx as u, jsxs as m, Fragment as ar } from "react/jsx-runtime";
6
+ import { jsx as u, jsxs as g, Fragment as ar } from "react/jsx-runtime";
7
7
  import { PERMISSIONS as ps, usePermissions as ir, useLanguages as Ot, getBlocksFromHTML as vs, useTheme as Ss, useTranslation as As, registerChaiSidebarPanel as Vn, ChaiBuilderEditor as ws } from "@chaibuilder/sdk";
8
8
  import { loadWebBlocks as bs } from "@chaibuilder/sdk/web-blocks";
9
9
  import { useQueryClient as Ae, onlineManager as or, useMutation as xe, useQuery as Pe, QueryClient as Ts, QueryClientProvider as _s } from "@tanstack/react-query";
10
10
  import * as Z from "react";
11
- import { useState as ge, useEffect as Ut, useMemo as me, useCallback as Ue, useRef as $t } from "react";
11
+ import { useState as me, useEffect as Ut, useMemo as ge, useCallback as Ue, useRef as $t } from "react";
12
12
  import { get as ae, isEmpty as Ie, find as Se, reverse as Ps, sortBy as Ns, startsWith as yt, isEqual as Ln, filter as xn, map as lr, toLower as Cs, trim as Is, each as Ls, includes as xs, has as tn, pick as cr, keys as Gs, pickBy as ks, endsWith as Ds, isArray as Os, startCase as Us, cloneDeep as Rs, isString as Wn } from "lodash-es";
13
13
  import { AlertCircle as Ms, StarIcon as Bs, MoreHorizontal as Fs, PencilIcon as js, Power as Hs, TrashIcon as qs, LockIcon as ur, UserIcon as Ks, AlertTriangleIcon as Vs, LanguagesIcon as Ws, DatabaseIcon as zs, ChevronLeft as $s, ChevronRight as Qs, Loader2 as Ys } from "lucide-react";
14
14
  import { atom as Gn, useAtom as kn } from "jotai";
15
15
  import { toast as Ee } from "sonner";
16
16
  import { useRegisteredChaiBlocks as Xs, getDefaultBlockProps as Zs } from "@chaibuilder/runtime";
17
- import { Dialog as nn, DialogContent as rn, DialogHeader as sn, DialogTitle as an, DialogDescription as on, Alert as dr, Label as ue, Input as Te, DialogFooter as ln, Button as re, DropdownMenu as Js, DropdownMenuTrigger as ea, DropdownMenuContent as ta, DropdownMenuItem as gn, Card as fr, CardHeader as hr, CardTitle as gr, CardContent as mr, CardFooter as yr, AlertDialog as na, AlertDialogTrigger as ra, AlertDialogContent as sa, AlertDialogHeader as aa, AlertDialogTitle as ia, AlertDialogDescription as oa, AlertDialogFooter as la, AlertDialogCancel as ca, AlertDialogAction as ua, Popover as da, Tooltip as fa, TooltipTrigger as ha, PopoverTrigger as ga, TooltipContent as ma, PopoverContent as ya, Command as Ea, CommandInput as pa, CommandList as va, CommandEmpty as Sa, CommandGroup as Aa, CommandItem as zn, AlertDescription as wa, Accordion as ba, AccordionItem as Mt, AccordionTrigger as Bt, AccordionContent as Ft, Textarea as jt } from "@chaibuilder/sdk/ui";
17
+ import { Dialog as nn, DialogContent as rn, DialogHeader as sn, DialogTitle as an, DialogDescription as on, Alert as dr, Label as ue, Input as Te, DialogFooter as ln, Button as re, DropdownMenu as Js, DropdownMenuTrigger as ea, DropdownMenuContent as ta, DropdownMenuItem as mn, Card as fr, CardHeader as hr, CardTitle as mr, CardContent as gr, CardFooter as yr, AlertDialog as na, AlertDialogTrigger as ra, AlertDialogContent as sa, AlertDialogHeader as aa, AlertDialogTitle as ia, AlertDialogDescription as oa, AlertDialogFooter as la, AlertDialogCancel as ca, AlertDialogAction as ua, Popover as da, Tooltip as fa, TooltipTrigger as ha, PopoverTrigger as ma, TooltipContent as ga, PopoverContent as ya, Command as Ea, CommandInput as pa, CommandList as va, CommandEmpty as Sa, CommandGroup as Aa, CommandItem as zn, AlertDescription as wa, Accordion as ba, AccordionItem as Mt, AccordionTrigger as Bt, AccordionContent as Ft, Textarea as jt } from "@chaibuilder/sdk/ui";
18
18
  var _ = {
19
19
  context: void 0,
20
20
  registry: void 0,
@@ -31,7 +31,7 @@ function $n(e) {
31
31
  const t = String(e), n = t.length - 1;
32
32
  return _.context.id + (n ? String.fromCharCode(96 + n) : "") + t;
33
33
  }
34
- function mt(e) {
34
+ function gt(e) {
35
35
  _.context = e;
36
36
  }
37
37
  var Ta = (e, t) => e === t, Qt = Symbol("solid-proxy"), Er = typeof Proxy == "function", pr = Symbol("solid-track"), Yt = {
@@ -41,7 +41,7 @@ var Ta = (e, t) => e === t, Qt = Symbol("solid-proxy"), Er = typeof Proxy == "fu
41
41
  cleanups: null,
42
42
  context: null,
43
43
  owner: null
44
- }, mn = {}, R = null, yn = null, _a = null, j = null, ce = null, Le = null, cn = 0;
44
+ }, gn = {}, R = null, yn = null, _a = null, j = null, ce = null, Le = null, cn = 0;
45
45
  function je(e, t) {
46
46
  const n = j, r = R, s = e.length === 0, a = t === void 0 ? r : t, i = s ? Sr : {
47
47
  owned: null,
@@ -90,7 +90,7 @@ function Na(e) {
90
90
  function Ca(e, t, n) {
91
91
  let r, s, a;
92
92
  arguments.length === 1 ? (r = !0, s = e, a = {}) : (r = e, s = t, a = {});
93
- let i = null, o = mn, l = null, d = !1, h = "initialValue" in a, g = typeof r == "function" && fe(r);
93
+ let i = null, o = gn, l = null, d = !1, h = "initialValue" in a, m = typeof r == "function" && fe(r);
94
94
  const v = /* @__PURE__ */ new Set(), [A, E] = (a.storage || J)(a.initialValue), [N, y] = J(void 0), [Q, p] = J(void 0, {
95
95
  equals: !1
96
96
  }), [C, O] = J(h ? "ready" : "unresolved");
@@ -100,7 +100,7 @@ function Ca(e, t, n) {
100
100
  () => a.onHydrated(ne, {
101
101
  value: U
102
102
  })
103
- ), o = mn, ie(U, K)), U;
103
+ ), o = gn, ie(U, K)), U;
104
104
  }
105
105
  function ie(B, U) {
106
106
  _e(() => {
@@ -120,12 +120,12 @@ function Ca(e, t, n) {
120
120
  if (B !== !1 && d)
121
121
  return;
122
122
  d = !1;
123
- const U = g ? g() : r;
123
+ const U = m ? m() : r;
124
124
  if (U == null || U === !1) {
125
125
  q(i, le(A));
126
126
  return;
127
127
  }
128
- const K = o !== mn ? o : le(
128
+ const K = o !== gn ? o : le(
129
129
  () => s(U, {
130
130
  value: A(),
131
131
  refetching: B
@@ -161,7 +161,7 @@ function Ca(e, t, n) {
161
161
  return A();
162
162
  }
163
163
  }
164
- }), g ? Pa(() => k(!1)) : k(!1), [
164
+ }), m ? Pa(() => k(!1)) : k(!1), [
165
165
  se,
166
166
  {
167
167
  refetch: k,
@@ -368,7 +368,7 @@ function Ua(e) {
368
368
  _.effects || (_.effects = []), _.effects.push(...e.slice(0, n));
369
369
  return;
370
370
  }
371
- mt();
371
+ gt();
372
372
  }
373
373
  for (_.effects && (_.done || !_.count) && (e = [..._.effects, ...e], n += _.effects.length, delete _.effects), t = 0; t < n; t++)
374
374
  Zt(e[t]);
@@ -457,36 +457,36 @@ function en(e) {
457
457
  function Ma(e, t, n = {}) {
458
458
  let r = [], s = [], a = [], i = 0, o = t.length > 1 ? [] : null;
459
459
  return vt(() => en(a)), () => {
460
- let l = e() || [], d = l.length, h, g;
460
+ let l = e() || [], d = l.length, h, m;
461
461
  return l[pr], le(() => {
462
462
  let A, E, N, y, Q, p, C, O, q;
463
463
  if (d === 0)
464
464
  i !== 0 && (en(a), a = [], r = [], s = [], i = 0, o && (o = [])), n.fallback && (r = [An], s[0] = je((ie) => (a[0] = ie, n.fallback())), i = 1);
465
465
  else if (i === 0) {
466
- for (s = new Array(d), g = 0; g < d; g++)
467
- r[g] = l[g], s[g] = je(v);
466
+ for (s = new Array(d), m = 0; m < d; m++)
467
+ r[m] = l[m], s[m] = je(v);
468
468
  i = d;
469
469
  } else {
470
470
  for (N = new Array(d), y = new Array(d), o && (Q = new Array(d)), p = 0, C = Math.min(i, d); p < C && r[p] === l[p]; p++)
471
471
  ;
472
472
  for (C = i - 1, O = d - 1; C >= p && O >= p && r[C] === l[O]; C--, O--)
473
473
  N[O] = s[C], y[O] = a[C], o && (Q[O] = o[C]);
474
- for (A = /* @__PURE__ */ new Map(), E = new Array(O + 1), g = O; g >= p; g--)
475
- q = l[g], h = A.get(q), E[g] = h === void 0 ? -1 : h, A.set(q, g);
474
+ for (A = /* @__PURE__ */ new Map(), E = new Array(O + 1), m = O; m >= p; m--)
475
+ q = l[m], h = A.get(q), E[m] = h === void 0 ? -1 : h, A.set(q, m);
476
476
  for (h = p; h <= C; h++)
477
- q = r[h], g = A.get(q), g !== void 0 && g !== -1 ? (N[g] = s[h], y[g] = a[h], o && (Q[g] = o[h]), g = E[g], A.set(q, g)) : a[h]();
478
- for (g = p; g < d; g++)
479
- g in N ? (s[g] = N[g], a[g] = y[g], o && (o[g] = Q[g], o[g](g))) : s[g] = je(v);
477
+ q = r[h], m = A.get(q), m !== void 0 && m !== -1 ? (N[m] = s[h], y[m] = a[h], o && (Q[m] = o[h]), m = E[m], A.set(q, m)) : a[h]();
478
+ for (m = p; m < d; m++)
479
+ m in N ? (s[m] = N[m], a[m] = y[m], o && (o[m] = Q[m], o[m](m))) : s[m] = je(v);
480
480
  s = s.slice(0, i = d), r = l.slice(0);
481
481
  }
482
482
  return s;
483
483
  });
484
484
  function v(A) {
485
- if (a[g] = A, o) {
486
- const [E, N] = J(g);
487
- return o[g] = N, t(l[g], E);
485
+ if (a[m] = A, o) {
486
+ const [E, N] = J(m);
487
+ return o[m] = N, t(l[m], E);
488
488
  }
489
- return t(l[g]);
489
+ return t(l[m]);
490
490
  }
491
491
  };
492
492
  }
@@ -498,12 +498,12 @@ function Ba(e, t, n = {}) {
498
498
  if (h === 0)
499
499
  return o !== 0 && (en(a), a = [], r = [], s = [], o = 0, i = []), n.fallback && (r = [An], s[0] = je((v) => (a[0] = v, n.fallback())), o = 1), s;
500
500
  for (r[0] === An && (a[0](), a = [], r = [], s = [], o = 0), l = 0; l < h; l++)
501
- l < r.length && r[l] !== d[l] ? i[l](() => d[l]) : l >= r.length && (s[l] = je(g));
501
+ l < r.length && r[l] !== d[l] ? i[l](() => d[l]) : l >= r.length && (s[l] = je(m));
502
502
  for (; l < r.length; l++)
503
503
  a[l]();
504
504
  return o = i.length = a.length = h, r = d.slice(0), s = s.slice(0, o);
505
505
  });
506
- function g(v) {
506
+ function m(v) {
507
507
  a[l] = v;
508
508
  const [A, E] = J(d[l]);
509
509
  return i[l] = E, t(A, l);
@@ -591,16 +591,16 @@ function Cr(...e) {
591
591
  const h = l[d];
592
592
  if (h === "__proto__" || h === "constructor")
593
593
  continue;
594
- const g = Object.getOwnPropertyDescriptor(o, h);
594
+ const m = Object.getOwnPropertyDescriptor(o, h);
595
595
  if (!r[h])
596
- r[h] = g.get ? {
596
+ r[h] = m.get ? {
597
597
  enumerable: !0,
598
598
  configurable: !0,
599
- get: Fa.bind(n[h] = [g.get.bind(o)])
600
- } : g.value !== void 0 ? g : void 0;
599
+ get: Fa.bind(n[h] = [m.get.bind(o)])
600
+ } : m.value !== void 0 ? m : void 0;
601
601
  else {
602
602
  const v = n[h];
603
- v && (g.get ? v.push(g.get.bind(o)) : g.value !== void 0 && v.push(() => g.value));
603
+ v && (m.get ? v.push(m.get.bind(o)) : m.value !== void 0 && v.push(() => m.value));
604
604
  }
605
605
  }
606
606
  }
@@ -661,7 +661,7 @@ function Ir(e) {
661
661
  if (a) {
662
662
  const [o, l] = J();
663
663
  _.count || (_.count = 0), _.count++, (n || (n = e())).then((d) => {
664
- !_.done && mt(a), _.count--, l(() => d.default), mt();
664
+ !_.done && gt(a), _.count--, l(() => d.default), gt();
665
665
  }), t = o;
666
666
  } else if (!t) {
667
667
  const [o] = Ca(() => (n || (n = e())).then((l) => l.default));
@@ -673,9 +673,9 @@ function Ir(e) {
673
673
  if (!a || _.done)
674
674
  return i(s);
675
675
  const o = _.context;
676
- mt(a);
676
+ gt(a);
677
677
  const l = i(s);
678
- return mt(o), l;
678
+ return gt(o), l;
679
679
  }) : ""
680
680
  );
681
681
  };
@@ -963,15 +963,15 @@ function Za(e, t, n) {
963
963
  } else {
964
964
  if (!d) {
965
965
  d = /* @__PURE__ */ new Map();
966
- let g = o;
967
- for (; g < a; )
968
- d.set(n[g], g++);
966
+ let m = o;
967
+ for (; m < a; )
968
+ d.set(n[m], m++);
969
969
  }
970
970
  const h = d.get(t[i]);
971
971
  if (h != null)
972
972
  if (o < h && h < a) {
973
- let g = i, v = 1, A;
974
- for (; ++g < s && g < a && !((A = d.get(t[g])) == null || A !== h + v); )
973
+ let m = i, v = 1, A;
974
+ for (; ++m < s && m < a && !((A = d.get(t[m])) == null || A !== h + v); )
975
975
  v++;
976
976
  if (v > h - o) {
977
977
  const E = t[i];
@@ -1110,7 +1110,7 @@ function Yn(e, t, n) {
1110
1110
  e.classList.toggle(r[s], n);
1111
1111
  }
1112
1112
  function Xn(e, t, n, r, s, a, i) {
1113
- let o, l, d, h, g;
1113
+ let o, l, d, h, m;
1114
1114
  if (t === "style")
1115
1115
  return ai(e, n, r);
1116
1116
  if (t === "classList")
@@ -1136,8 +1136,8 @@ function Xn(e, t, n, r, s, a, i) {
1136
1136
  bn(e, t.slice(5), n);
1137
1137
  else if (t.slice(0, 5) === "bool:")
1138
1138
  ti(e, t.slice(5), n);
1139
- else if ((g = t.slice(0, 5) === "prop:") || (d = Va.has(t)) || !s && ((h = $a(t, e.tagName)) || (l = Ka.has(t))) || (o = e.nodeName.includes("-") || "is" in i)) {
1140
- if (g)
1139
+ else if ((m = t.slice(0, 5) === "prop:") || (d = Va.has(t)) || !s && ((h = $a(t, e.tagName)) || (l = Ka.has(t))) || (o = e.nodeName.includes("-") || "is" in i)) {
1140
+ if (m)
1141
1141
  t = t.slice(5), l = !0;
1142
1142
  else if (Ve(e))
1143
1143
  return n;
@@ -1235,10 +1235,10 @@ function At(e, t, n, r, s) {
1235
1235
  let h = l[0];
1236
1236
  if (h.parentNode !== e)
1237
1237
  return n;
1238
- const g = [h];
1238
+ const m = [h];
1239
1239
  for (; (h = h.nextSibling) !== r; )
1240
- g.push(h);
1241
- return n = g;
1240
+ m.push(h);
1241
+ return n = m;
1242
1242
  }
1243
1243
  if (l.length === 0) {
1244
1244
  if (n = ze(e, n, r), o)
@@ -1323,7 +1323,7 @@ function hl(e) {
1323
1323
  const o = r();
1324
1324
  if (o instanceof HTMLHeadElement) {
1325
1325
  const [l, d] = J(!1), h = () => d(!0);
1326
- je((g) => Tn(o, () => l() ? g() : a(), null)), vt(h);
1326
+ je((m) => Tn(o, () => l() ? m() : a(), null)), vt(h);
1327
1327
  } else {
1328
1328
  const l = kr(e.isSVG ? "g" : "div", e.isSVG), d = t && l.attachShadow ? l.attachShadow({
1329
1329
  mode: "open"
@@ -1342,7 +1342,7 @@ function hl(e) {
1342
1342
  }
1343
1343
  ), n;
1344
1344
  }
1345
- function gl(e) {
1345
+ function ml(e) {
1346
1346
  const [t, n] = ja(e, ["component"]), r = fe(() => t.component);
1347
1347
  return fe(() => {
1348
1348
  const s = r();
@@ -1387,7 +1387,7 @@ var hi = class {
1387
1387
  getValue(e) {
1388
1388
  return this.kv.getByKey(e);
1389
1389
  }
1390
- }, gi = class extends Dr {
1390
+ }, mi = class extends Dr {
1391
1391
  constructor() {
1392
1392
  super((e) => e.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
1393
1393
  }
@@ -1398,7 +1398,7 @@ var hi = class {
1398
1398
  return this.classToAllowedProps.get(e);
1399
1399
  }
1400
1400
  };
1401
- function mi(e) {
1401
+ function gi(e) {
1402
1402
  if ("values" in Object)
1403
1403
  return Object.values(e);
1404
1404
  const t = [];
@@ -1407,7 +1407,7 @@ function mi(e) {
1407
1407
  return t;
1408
1408
  }
1409
1409
  function yi(e, t) {
1410
- const n = mi(e);
1410
+ const n = gi(e);
1411
1411
  if ("find" in n)
1412
1412
  return n.find(t);
1413
1413
  const r = n;
@@ -1747,21 +1747,21 @@ var Wr = (e, t, n, r, s = [], a = [], i = /* @__PURE__ */ new Map()) => {
1747
1747
  return {
1748
1748
  transformedValue: null
1749
1749
  };
1750
- const l = tr(e, n), d = (l == null ? void 0 : l.value) ?? e, h = Re(d) ? [] : {}, g = {};
1750
+ const l = tr(e, n), d = (l == null ? void 0 : l.value) ?? e, h = Re(d) ? [] : {}, m = {};
1751
1751
  ut(d, (A, E) => {
1752
1752
  if (E === "__proto__" || E === "constructor" || E === "prototype")
1753
1753
  throw new Error(`Detected property ${E}. This is a prototype pollution risk, please remove it from your object.`);
1754
1754
  const N = Wr(A, t, n, r, [...s, E], [...a, e], i);
1755
- h[E] = N.transformedValue, Re(N.annotations) ? g[E] = N.annotations : wt(N.annotations) && ut(N.annotations, (y, Q) => {
1756
- g[Rr(E) + "." + Q] = y;
1755
+ h[E] = N.transformedValue, Re(N.annotations) ? m[E] = N.annotations : wt(N.annotations) && ut(N.annotations, (y, Q) => {
1756
+ m[Rr(E) + "." + Q] = y;
1757
1757
  });
1758
1758
  });
1759
- const v = Pn(g) ? {
1759
+ const v = Pn(m) ? {
1760
1760
  transformedValue: h,
1761
1761
  annotations: l ? [l.type] : void 0
1762
1762
  } : {
1763
1763
  transformedValue: h,
1764
- annotations: l ? [l.type, g] : g
1764
+ annotations: l ? [l.type, m] : m
1765
1765
  };
1766
1766
  return o || i.set(e, v), v;
1767
1767
  };
@@ -1804,7 +1804,7 @@ var H = class {
1804
1804
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
1805
1805
  */
1806
1806
  constructor({ dedupe: e = !1 } = {}) {
1807
- this.classRegistry = new gi(), this.symbolRegistry = new Dr((t) => t.description ?? ""), this.customTransformerRegistry = new Ei(), this.allowedErrorProps = [], this.dedupe = e;
1807
+ this.classRegistry = new mi(), this.symbolRegistry = new Dr((t) => t.description ?? ""), this.customTransformerRegistry = new Ei(), this.allowedErrorProps = [], this.dedupe = e;
1808
1808
  }
1809
1809
  serialize(e) {
1810
1810
  const t = /* @__PURE__ */ new Map(), n = Wr(e, t, this, this.dedupe), r = {
@@ -1856,7 +1856,7 @@ H.registerClass = H.defaultInstance.registerClass.bind(H.defaultInstance);
1856
1856
  H.registerSymbol = H.defaultInstance.registerSymbol.bind(H.defaultInstance);
1857
1857
  H.registerCustom = H.defaultInstance.registerCustom.bind(H.defaultInstance);
1858
1858
  H.allowErrorProps = H.defaultInstance.allowErrorProps.bind(H.defaultInstance);
1859
- var Hi = H.serialize, ml = H.stringify;
1859
+ var Hi = H.serialize, gl = H.stringify;
1860
1860
  function yl(e) {
1861
1861
  return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
1862
1862
  }
@@ -2016,7 +2016,7 @@ var Al = (e, t = !1) => {
2016
2016
  const t = xr(() => {
2017
2017
  const n = this, [r] = T(this, Xe), [s] = T(this, Ze), [a] = T(this, Je), [i] = T(this, et), [o] = T(this, Qe);
2018
2018
  let l;
2019
- return T(this, tt) ? l = T(this, tt) : (l = Ir(() => import("./HO4MOOFI-Cb3CTzDI.js")), M(this, tt, l)), Yr(T(this, Ct), T(this, Ye)), Nr(l, Cr({
2019
+ return T(this, tt) ? l = T(this, tt) : (l = Ir(() => import("./HO4MOOFI-BgIIimxb.js")), M(this, tt, l)), Yr(T(this, Ct), T(this, Ye)), Nr(l, Cr({
2020
2020
  get queryFlavor() {
2021
2021
  return T(n, Pt);
2022
2022
  },
@@ -2082,9 +2082,9 @@ var Al = (e, t = !1) => {
2082
2082
  errorTypes: l,
2083
2083
  styleNonce: d,
2084
2084
  shadowDOMTarget: h,
2085
- onClose: g
2085
+ onClose: m
2086
2086
  } = e;
2087
- M(this, nt, J(t)), M(this, xt, n), M(this, Gt, r), M(this, Lt, s), M(this, kt, d), M(this, rt, h), M(this, st, J(a)), M(this, at, J(i)), M(this, it, J(o)), M(this, ot, J(l)), M(this, lt, J(g));
2087
+ M(this, nt, J(t)), M(this, xt, n), M(this, Gt, r), M(this, Lt, s), M(this, kt, d), M(this, rt, h), M(this, st, J(a)), M(this, at, J(i)), M(this, it, J(o)), M(this, ot, J(l)), M(this, lt, J(m));
2088
2088
  }
2089
2089
  setButtonPosition(e) {
2090
2090
  T(this, st)[1](e);
@@ -2110,7 +2110,7 @@ var Al = (e, t = !1) => {
2110
2110
  const t = xr(() => {
2111
2111
  const n = this, [r] = T(this, st), [s] = T(this, at), [a] = T(this, it), [i] = T(this, ot), [o] = T(this, nt), [l] = T(this, lt);
2112
2112
  let d;
2113
- return T(this, ct) ? d = T(this, ct) : (d = Ir(() => import("./HUY7CZI3-w0XnbOPP.js")), M(this, ct, d)), Yr(T(this, kt), T(this, rt)), Nr(d, Cr({
2113
+ return T(this, ct) ? d = T(this, ct) : (d = Ir(() => import("./HUY7CZI3-DvCh8ZKP.js")), M(this, ct, d)), Yr(T(this, kt), T(this, rt)), Nr(d, Cr({
2114
2114
  get queryFlavor() {
2115
2115
  return T(n, xt);
2116
2116
  },
@@ -2417,7 +2417,7 @@ const qe = {
2417
2417
  zu: "Zulu"
2418
2418
  };
2419
2419
  function ke() {
2420
- const [e, t] = ge(
2420
+ const [e, t] = me(
2421
2421
  new URLSearchParams(window.location.search)
2422
2422
  );
2423
2423
  return Ut(() => {
@@ -2485,7 +2485,7 @@ if (import.meta.vitest) {
2485
2485
  });
2486
2486
  }
2487
2487
  const Pl = () => {
2488
- const e = Ke("user"), t = Ke("onSessionExpired"), n = me(() => e == null ? void 0 : e.authToken, [e == null ? void 0 : e.authToken]);
2488
+ const e = Ke("user"), t = Ke("onSessionExpired"), n = ge(() => e == null ? void 0 : e.authToken, [e == null ? void 0 : e.authToken]);
2489
2489
  return Ue(
2490
2490
  async (r, s, a = {}) => {
2491
2491
  if (n)
@@ -2511,7 +2511,7 @@ const Pl = () => {
2511
2511
  [n, t]
2512
2512
  );
2513
2513
  }, ee = () => {
2514
- const e = Ke("user"), t = Ke("onSessionExpired"), n = me(() => e == null ? void 0 : e.authToken, [e == null ? void 0 : e.authToken]);
2514
+ const e = Ke("user"), t = Ke("onSessionExpired"), n = ge(() => e == null ? void 0 : e.authToken, [e == null ? void 0 : e.authToken]);
2515
2515
  return Ue(
2516
2516
  async (r, s, a = {}) => {
2517
2517
  if (n)
@@ -2581,7 +2581,7 @@ const Pl = () => {
2581
2581
  });
2582
2582
  }, Ji = Gn({ lastSaved: void 0 }), ns = () => kn(Ji), ft = () => {
2583
2583
  const [e] = ke(), t = e.get("page"), { data: n, isFetching: r } = ts();
2584
- return { data: me(
2584
+ return { data: ge(
2585
2585
  () => Se(n, { id: t }) || {},
2586
2586
  [n, t]
2587
2587
  ), isFetching: r };
@@ -2708,7 +2708,7 @@ const Pl = () => {
2708
2708
  });
2709
2709
  }, to = (e) => {
2710
2710
  const { data: t } = De();
2711
- return me(
2711
+ return ge(
2712
2712
  () => t == null ? void 0 : t.find((n) => n.key === e),
2713
2713
  [t, e]
2714
2714
  );
@@ -2870,7 +2870,7 @@ const Pl = () => {
2870
2870
  page: e,
2871
2871
  onClose: t
2872
2872
  }) => {
2873
- const [n, r] = ge(e.slug || ""), { mutate: s, isPending: a } = oo(), { data: i } = De(), o = Se(i, { key: e == null ? void 0 : e.pageType }), l = (h) => {
2873
+ const [n, r] = me(e.slug || ""), { mutate: s, isPending: a } = oo(), { data: i } = De(), o = Se(i, { key: e == null ? void 0 : e.pageType }), l = (h) => {
2874
2874
  if (h.preventDefault(), !(e != null && e.primaryPage) && Object.keys(qe).some((A) => n === `/${A}` || yt(n, `/${A}/`))) {
2875
2875
  Ee.error("Error", {
2876
2876
  description: "Slugs cannot start with a language code for primary page"
@@ -2879,37 +2879,37 @@ const Pl = () => {
2879
2879
  }
2880
2880
  s({ ...e, slug: n }, { onSuccess: t });
2881
2881
  }, d = (e == null ? void 0 : e.lang) || "";
2882
- return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ m(rn, { children: [
2883
- /* @__PURE__ */ m(sn, { children: [
2882
+ return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ g(rn, { children: [
2883
+ /* @__PURE__ */ g(sn, { children: [
2884
2884
  /* @__PURE__ */ u(an, { children: "Change Slug" }),
2885
- /* @__PURE__ */ u(on, { className: "text-xs", children: /* @__PURE__ */ m(dr, { variant: "destructive", className: "mt-2", children: [
2885
+ /* @__PURE__ */ u(on, { className: "text-xs", children: /* @__PURE__ */ g(dr, { variant: "destructive", className: "mt-2", children: [
2886
2886
  /* @__PURE__ */ u(Ms, { className: "h-4 w-4" }),
2887
2887
  "Changing the slug may have impact on your SEO. Please proceed with caution."
2888
2888
  ] }) })
2889
2889
  ] }),
2890
- /* @__PURE__ */ m("form", { onSubmit: l, children: [
2891
- /* @__PURE__ */ m("div", { className: "space-y-4 py-4 text-sm ", children: [
2892
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
2893
- /* @__PURE__ */ m("div", { children: [
2890
+ /* @__PURE__ */ g("form", { onSubmit: l, children: [
2891
+ /* @__PURE__ */ g("div", { className: "space-y-4 py-4 text-sm ", children: [
2892
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
2893
+ /* @__PURE__ */ g("div", { children: [
2894
2894
  /* @__PURE__ */ u("span", { children: "Type:" }),
2895
- /* @__PURE__ */ m("span", { className: "font-medium text-gray-600", children: [
2895
+ /* @__PURE__ */ g("span", { className: "font-medium text-gray-600", children: [
2896
2896
  " ",
2897
2897
  (o == null ? void 0 : o.name) || (e == null ? void 0 : e.pageType)
2898
2898
  ] })
2899
2899
  ] }),
2900
- /* @__PURE__ */ m("div", { children: [
2900
+ /* @__PURE__ */ g("div", { children: [
2901
2901
  /* @__PURE__ */ u("span", { children: "Name:" }),
2902
- /* @__PURE__ */ m("span", { className: "font-medium text-gray-600", children: [
2902
+ /* @__PURE__ */ g("span", { className: "font-medium text-gray-600", children: [
2903
2903
  " ",
2904
2904
  e.name
2905
2905
  ] })
2906
2906
  ] })
2907
2907
  ] }),
2908
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
2909
- /* @__PURE__ */ m(ue, { htmlFor: "slug", className: "text-right", children: [
2908
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
2909
+ /* @__PURE__ */ g(ue, { htmlFor: "slug", className: "text-right", children: [
2910
2910
  "Slug",
2911
2911
  " ",
2912
- /* @__PURE__ */ m("small", { className: "font-light text-gray-500", children: [
2912
+ /* @__PURE__ */ g("small", { className: "font-light text-gray-500", children: [
2913
2913
  "Slug should start with /",
2914
2914
  d
2915
2915
  ] })
@@ -2920,8 +2920,8 @@ const Pl = () => {
2920
2920
  id: "slug",
2921
2921
  value: n,
2922
2922
  onChange: (h) => {
2923
- const g = h.target.value;
2924
- yt(g, `/${d}`) && r(g);
2923
+ const m = h.target.value;
2924
+ yt(m, `/${d}`) && r(m);
2925
2925
  },
2926
2926
  className: "col-span-3",
2927
2927
  required: !0,
@@ -2956,24 +2956,24 @@ function co({
2956
2956
  }, o = a == null ? void 0 : a.find(
2957
2957
  (l) => l.key === (e == null ? void 0 : e.pageType)
2958
2958
  );
2959
- return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ m(rn, { children: [
2960
- /* @__PURE__ */ m(sn, { children: [
2959
+ return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ g(rn, { children: [
2960
+ /* @__PURE__ */ g(sn, { children: [
2961
2961
  /* @__PURE__ */ u(an, { children: "Confirm Deletion" }),
2962
- /* @__PURE__ */ m(on, { className: "py-4 text-slate-500", children: [
2963
- /* @__PURE__ */ m("div", { children: [
2962
+ /* @__PURE__ */ g(on, { className: "py-4 text-slate-500", children: [
2963
+ /* @__PURE__ */ g("div", { children: [
2964
2964
  "Are you sure you want to remove ",
2965
2965
  /* @__PURE__ */ u("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
2966
2966
  " ",
2967
2967
  o != null && o.hasSlug ? (o == null ? void 0 : o.name) + "?" : `page? ${e != null && e.primaryPage ? "" : "This will also delete all associated language pages."}`
2968
2968
  ] }),
2969
- e.lang && /* @__PURE__ */ m("div", { className: "py-2 text-sm", children: [
2969
+ e.lang && /* @__PURE__ */ g("div", { className: "py-2 text-sm", children: [
2970
2970
  "Language:",
2971
2971
  " ",
2972
2972
  /* @__PURE__ */ u("span", { className: "font-medium text-gray-500", children: ae(qe, e.lang, e.lang) })
2973
2973
  ] })
2974
2974
  ] })
2975
2975
  ] }),
2976
- /* @__PURE__ */ m(ln, { children: [
2976
+ /* @__PURE__ */ g(ln, { children: [
2977
2977
  /* @__PURE__ */ u(re, { variant: "outline", onClick: t, children: "Cancel" }),
2978
2978
  /* @__PURE__ */ u(
2979
2979
  re,
@@ -2987,7 +2987,7 @@ function co({
2987
2987
  ] })
2988
2988
  ] }) });
2989
2989
  }
2990
- const gt = ({
2990
+ const mt = ({
2991
2991
  permission: e,
2992
2992
  permissions: t,
2993
2993
  children: n,
@@ -3002,17 +3002,17 @@ const gt = ({
3002
3002
  const { mutate: n, isPending: r } = ao(), s = async () => {
3003
3003
  n(e, { onSuccess: t });
3004
3004
  };
3005
- return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ m(rn, { children: [
3006
- /* @__PURE__ */ m(sn, { children: [
3005
+ return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ g(rn, { children: [
3006
+ /* @__PURE__ */ g(sn, { children: [
3007
3007
  /* @__PURE__ */ u(an, { children: "Confirm action" }),
3008
- /* @__PURE__ */ m(on, { children: [
3008
+ /* @__PURE__ */ g(on, { children: [
3009
3009
  z.UNPUBLISH_MSG,
3010
3010
  " ",
3011
3011
  /* @__PURE__ */ u("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
3012
3012
  "?"
3013
3013
  ] })
3014
3014
  ] }),
3015
- /* @__PURE__ */ m(ln, { children: [
3015
+ /* @__PURE__ */ g(ln, { children: [
3016
3016
  /* @__PURE__ */ u(re, { variant: "outline", onClick: t, children: "Cancel" }),
3017
3017
  /* @__PURE__ */ u(
3018
3018
  re,
@@ -3030,7 +3030,7 @@ const gt = ({
3030
3030
  onClose: t,
3031
3031
  languages: n
3032
3032
  }) => {
3033
- const { data: r } = ft(), { data: s } = De(), [a, i] = ge(e.name || ""), [o, l] = ge(e.edit ? e.lang : ""), [d, h] = ge(e.edit ? e.slug : ""), { mutate: g, isPending: v } = ro(), { mutate: A, isPending: E } = rs(), N = me(
3033
+ const { data: r } = ft(), { data: s } = De(), [a, i] = me(e.name || ""), [o, l] = me(e.edit ? e.lang : ""), [d, h] = me(e.edit ? e.slug : ""), { mutate: m, isPending: v } = ro(), { mutate: A, isPending: E } = rs(), N = ge(
3034
3034
  () => s == null ? void 0 : s.find(
3035
3035
  (C) => C.key === e.pageType
3036
3036
  ),
@@ -3044,18 +3044,18 @@ const gt = ({
3044
3044
  slug: d,
3045
3045
  pageType: r == null ? void 0 : r.pageType
3046
3046
  };
3047
- O.pageType = e.pageType, e.edit && (O.id = e == null ? void 0 : e.id), e.edit ? A(O, { onSuccess: t }) : g(O, { onSuccess: t });
3047
+ O.pageType = e.pageType, e.edit && (O.id = e == null ? void 0 : e.id), e.edit ? A(O, { onSuccess: t }) : m(O, { onSuccess: t });
3048
3048
  };
3049
- return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ m(rn, { className: "sm:max-w-[425px] text-slate-600", children: [
3050
- /* @__PURE__ */ m(sn, { children: [
3049
+ return /* @__PURE__ */ u(nn, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ g(rn, { className: "sm:max-w-[425px] text-slate-600", children: [
3050
+ /* @__PURE__ */ g(sn, { children: [
3051
3051
  /* @__PURE__ */ u(an, { children: e.edit ? z.EDIT_LANGUAGE : z.ADD_NEW_LANGUAGE }),
3052
3052
  /* @__PURE__ */ u(on, { className: "font-light", children: z.ENTER_LANGUAGE_DETAILS })
3053
3053
  ] }),
3054
- /* @__PURE__ */ m("form", { onSubmit: p, children: [
3055
- /* @__PURE__ */ m("div", { className: "grid gap-4 py-4", children: [
3056
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
3054
+ /* @__PURE__ */ g("form", { onSubmit: p, children: [
3055
+ /* @__PURE__ */ g("div", { className: "grid gap-4 py-4", children: [
3056
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
3057
3057
  /* @__PURE__ */ u(ue, { htmlFor: "lang", className: "text-right", children: z.LANGUAGE }),
3058
- /* @__PURE__ */ m(
3058
+ /* @__PURE__ */ g(
3059
3059
  "select",
3060
3060
  {
3061
3061
  value: o,
@@ -3072,7 +3072,7 @@ const gt = ({
3072
3072
  }
3073
3073
  )
3074
3074
  ] }),
3075
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
3075
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
3076
3076
  /* @__PURE__ */ u(ue, { htmlFor: "slug", className: "text-right", children: z.PAGE_NAME }),
3077
3077
  /* @__PURE__ */ u(
3078
3078
  Te,
@@ -3086,8 +3086,8 @@ const gt = ({
3086
3086
  }
3087
3087
  )
3088
3088
  ] }),
3089
- !y && /* @__PURE__ */ m("div", { className: "space-y-1", children: [
3090
- /* @__PURE__ */ m(ue, { htmlFor: "slug", className: "text-right", children: [
3089
+ !y && /* @__PURE__ */ g("div", { className: "space-y-1", children: [
3090
+ /* @__PURE__ */ g(ue, { htmlFor: "slug", className: "text-right", children: [
3091
3091
  z.SLUG,
3092
3092
  " ",
3093
3093
  /* @__PURE__ */ u("small", { className: "font-light", children: z.SLUG_SHOULD_START_WITH })
@@ -3122,26 +3122,26 @@ const gt = ({
3122
3122
  ] })
3123
3123
  ] }) });
3124
3124
  }, ho = () => {
3125
- const [e, t] = ge(null), { selectedLang: n, fallbackLang: r, setSelectedLang: s } = Ot(), { data: a, isFetching: i } = On(), { data: o } = ft(), [l, d] = ge(null), [h, g] = ge(null), [v, A] = ge(null), { data: E } = fn(), N = xn(
3125
+ const [e, t] = me(null), { selectedLang: n, fallbackLang: r, setSelectedLang: s } = Ot(), { data: a, isFetching: i } = On(), { data: o } = ft(), [l, d] = me(null), [h, m] = me(null), [v, A] = me(null), { data: E } = fn(), N = xn(
3126
3126
  ae(E, "languages") || ["en"],
3127
3127
  (y) => !Se(a, { lang: y }) && y !== ae(E, "fallbackLang")
3128
3128
  );
3129
- return /* @__PURE__ */ m("div", { className: "space-y-4 pt-2", children: [
3130
- /* @__PURE__ */ u("ul", { className: "space-y-2 mt-4", children: i ? /* @__PURE__ */ m("div", { className: "w-full space-y-3 py-4", children: [
3129
+ return /* @__PURE__ */ g("div", { className: "space-y-4 pt-2", children: [
3130
+ /* @__PURE__ */ u("ul", { className: "space-y-2 mt-4", children: i ? /* @__PURE__ */ g("div", { className: "w-full space-y-3 py-4", children: [
3131
3131
  /* @__PURE__ */ u("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
3132
3132
  /* @__PURE__ */ u("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
3133
3133
  /* @__PURE__ */ u("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
3134
3134
  ] }) : lr(a, (y) => {
3135
3135
  const Q = y.lang, p = y.slug, C = !y.primaryPage;
3136
- return /* @__PURE__ */ m(ar, { children: [
3137
- /* @__PURE__ */ m(
3136
+ return /* @__PURE__ */ g(ar, { children: [
3137
+ /* @__PURE__ */ g(
3138
3138
  "li",
3139
3139
  {
3140
3140
  className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${Q === n ? "bg-gray-200" : "hover:bg-gray-100"}`,
3141
3141
  onClick: () => s(Q),
3142
3142
  children: [
3143
- /* @__PURE__ */ m("div", { className: " flex-1 gap-x-3", children: [
3144
- /* @__PURE__ */ m(
3143
+ /* @__PURE__ */ g("div", { className: " flex-1 gap-x-3", children: [
3144
+ /* @__PURE__ */ g(
3145
3145
  "div",
3146
3146
  {
3147
3147
  className: "text-[13px] text-slate-800 flex items-center gap-x-2",
@@ -3156,14 +3156,14 @@ const gt = ({
3156
3156
  ]
3157
3157
  }
3158
3158
  ),
3159
- /* @__PURE__ */ m("div", { children: [
3160
- p && /* @__PURE__ */ m("div", { className: "text-[11px] text-slate-600 font-light", children: [
3159
+ /* @__PURE__ */ g("div", { children: [
3160
+ p && /* @__PURE__ */ g("div", { className: "text-[11px] text-slate-600 font-light", children: [
3161
3161
  "Slug: ",
3162
3162
  /* @__PURE__ */ u("b", { className: "font-medium", children: p })
3163
3163
  ] }),
3164
- /* @__PURE__ */ m("div", { className: "text-[11px] text-slate-600 font-light", children: [
3164
+ /* @__PURE__ */ g("div", { className: "text-[11px] text-slate-600 font-light", children: [
3165
3165
  "Name:",
3166
- /* @__PURE__ */ m("b", { className: "font-medium", children: [
3166
+ /* @__PURE__ */ g("b", { className: "font-medium", children: [
3167
3167
  " ",
3168
3168
  y.name,
3169
3169
  " "
@@ -3171,18 +3171,18 @@ const gt = ({
3171
3171
  ] })
3172
3172
  ] })
3173
3173
  ] }),
3174
- C ? /* @__PURE__ */ m("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
3174
+ C ? /* @__PURE__ */ g("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
3175
3175
  /* @__PURE__ */ u(Bs, { fill: "orange", className: "w-3 h-3" }),
3176
3176
  /* @__PURE__ */ u("b", { children: " Primary" })
3177
3177
  ] }) : /* @__PURE__ */ u("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ u(
3178
- gt,
3178
+ mt,
3179
3179
  {
3180
3180
  permissions: [
3181
3181
  Oe.EDIT_PAGE,
3182
3182
  Oe.DELETE_PAGE,
3183
3183
  Oe.UNPUBLISH_PAGE
3184
3184
  ],
3185
- children: /* @__PURE__ */ m(Js, { children: [
3185
+ children: /* @__PURE__ */ g(Js, { children: [
3186
3186
  /* @__PURE__ */ u(
3187
3187
  ea,
3188
3188
  {
@@ -3199,13 +3199,13 @@ const gt = ({
3199
3199
  )
3200
3200
  }
3201
3201
  ),
3202
- /* @__PURE__ */ m(ta, { align: "end", className: "text-sm", children: [
3202
+ /* @__PURE__ */ g(ta, { align: "end", className: "text-sm", children: [
3203
3203
  /* @__PURE__ */ u(
3204
- gt,
3204
+ mt,
3205
3205
  {
3206
3206
  permissions: [Oe.EDIT_PAGE],
3207
- children: /* @__PURE__ */ m(
3208
- gn,
3207
+ children: /* @__PURE__ */ g(
3208
+ mn,
3209
3209
  {
3210
3210
  className: "flex items-center gap-2 cursor-pointer",
3211
3211
  onClick: (q) => {
@@ -3220,15 +3220,15 @@ const gt = ({
3220
3220
  }
3221
3221
  ),
3222
3222
  /* @__PURE__ */ u(
3223
- gt,
3223
+ mt,
3224
3224
  {
3225
3225
  permissions: [Oe.UNPUBLISH_PAGE],
3226
- children: (y == null ? void 0 : y.online) && /* @__PURE__ */ m(
3227
- gn,
3226
+ children: (y == null ? void 0 : y.online) && /* @__PURE__ */ g(
3227
+ mn,
3228
3228
  {
3229
3229
  className: "flex items-center gap-2 cursor-pointer",
3230
3230
  onClick: (q) => {
3231
- q.stopPropagation(), g(y);
3231
+ q.stopPropagation(), m(y);
3232
3232
  },
3233
3233
  children: [
3234
3234
  /* @__PURE__ */ u(Hs, { className: "size-3" }),
@@ -3239,11 +3239,11 @@ const gt = ({
3239
3239
  }
3240
3240
  ),
3241
3241
  /* @__PURE__ */ u(
3242
- gt,
3242
+ mt,
3243
3243
  {
3244
3244
  permissions: [Oe.DELETE_PAGE],
3245
- children: /* @__PURE__ */ m(
3246
- gn,
3245
+ children: /* @__PURE__ */ g(
3246
+ mn,
3247
3247
  {
3248
3248
  className: "flex items-center gap-2 cursor-pointer",
3249
3249
  onClick: (q) => {
@@ -3268,7 +3268,7 @@ const gt = ({
3268
3268
  /* @__PURE__ */ u("div", { className: "h-1 w-full border-b" })
3269
3269
  ] });
3270
3270
  }) }),
3271
- /* @__PURE__ */ u(gt, { permissions: [Oe.ADD_PAGE], children: /* @__PURE__ */ u("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ u(
3271
+ /* @__PURE__ */ u(mt, { permissions: [Oe.ADD_PAGE], children: /* @__PURE__ */ u("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ u(
3272
3272
  re,
3273
3273
  {
3274
3274
  variant: "default",
@@ -3299,7 +3299,7 @@ const gt = ({
3299
3299
  uo,
3300
3300
  {
3301
3301
  page: h,
3302
- onClose: () => g(null)
3302
+ onClose: () => m(null)
3303
3303
  }
3304
3304
  ),
3305
3305
  v && /* @__PURE__ */ u(
@@ -3310,8 +3310,8 @@ const gt = ({
3310
3310
  }
3311
3311
  )
3312
3312
  ] });
3313
- }, go = (e) => {
3314
- const { fallbackLang: t } = Ot(), { data: n } = fn(), { data: r, isFetching: s } = On(), a = me(() => {
3313
+ }, mo = (e) => {
3314
+ const { fallbackLang: t } = Ot(), { data: n } = fn(), { data: r, isFetching: s } = On(), a = ge(() => {
3315
3315
  const i = { [t]: !0 };
3316
3316
  return Ls(ae(n, "languages"), (o) => {
3317
3317
  const l = Se(r, { lang: o });
@@ -3319,7 +3319,7 @@ const gt = ({
3319
3319
  }), i;
3320
3320
  }, [t, r, n]);
3321
3321
  return s || Ie(e) || e && a[e];
3322
- }, mo = (e) => {
3322
+ }, go = (e) => {
3323
3323
  const t = te(), n = ee();
3324
3324
  return Pe({
3325
3325
  queryKey: ["chaiUserInfo", e],
@@ -3331,7 +3331,7 @@ const gt = ({
3331
3331
  });
3332
3332
  }, yo = Gn(void 0), Un = () => {
3333
3333
  const [e] = ke(), t = e.get("page"), n = Ke("user"), [r, s] = kn(yo);
3334
- return me(() => ({
3334
+ return ge(() => ({
3335
3335
  isLocked: t && (n == null ? void 0 : n.id) !== r,
3336
3336
  currentEditor: r,
3337
3337
  setCurrentEditor: (a) => s(a)
@@ -3372,7 +3372,7 @@ var Rn = {};
3372
3372
  c.clear();
3373
3373
  }
3374
3374
  };
3375
- }(o, /* @__PURE__ */ new Map()), g = function() {
3375
+ }(o, /* @__PURE__ */ new Map()), m = function() {
3376
3376
  var f = Math.floor(16.666666666666668), c, S, b = {}, I = 0;
3377
3377
  return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (c = function(L) {
3378
3378
  var x = Math.random();
@@ -3597,9 +3597,9 @@ var Rn = {};
3597
3597
  function X() {
3598
3598
  r && !(b.width === s.width && b.height === s.height) && (b.width = f.width = s.width, b.height = f.height = s.height), !b.width && !b.height && (S(f), b.width = f.width, b.height = f.height), x.clearRect(0, 0, b.width, b.height), L = L.filter(function(oe) {
3599
3599
  return ne(x, oe);
3600
- }), L.length ? w = g.frame(X) : $();
3600
+ }), L.length ? w = m.frame(X) : $();
3601
3601
  }
3602
- w = g.frame(X), G = $;
3602
+ w = m.frame(X), G = $;
3603
3603
  });
3604
3604
  return {
3605
3605
  addFettis: function(Y) {
@@ -3608,14 +3608,14 @@ var Rn = {};
3608
3608
  canvas: f,
3609
3609
  promise: W,
3610
3610
  reset: function() {
3611
- w && g.cancel(w), G && G();
3611
+ w && m.cancel(w), G && G();
3612
3612
  }
3613
3613
  };
3614
3614
  }
3615
3615
  function ye(f, c) {
3616
3616
  var S = !f, b = !!y(c || {}, "resize"), I = !1, L = y(c, "disableForReducedMotion", Boolean), x = a && !!y(c || {}, "useWorker"), w = x ? v() : null, G = S ? se : k, W = f && w ? !!f.__confetti_initialized : !1, Y = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, $;
3617
3617
  function X(D, de, pe) {
3618
- for (var ve = y(D, "particleCount", Q), Ne = y(D, "angle", Number), Me = y(D, "spread", Number), we = y(D, "startVelocity", Number), us = y(D, "decay", Number), ds = y(D, "gravity", Number), fs = y(D, "drift", Number), Bn = y(D, "colors", O), hs = y(D, "ticks", Number), Fn = y(D, "shapes"), gs = y(D, "scalar"), ms = !!y(D, "flat"), jn = ie(D), Hn = ve, hn = [], ys = f.width * jn.x, Es = f.height * jn.y; Hn--; )
3618
+ for (var ve = y(D, "particleCount", Q), Ne = y(D, "angle", Number), Me = y(D, "spread", Number), we = y(D, "startVelocity", Number), us = y(D, "decay", Number), ds = y(D, "gravity", Number), fs = y(D, "drift", Number), Bn = y(D, "colors", O), hs = y(D, "ticks", Number), Fn = y(D, "shapes"), ms = y(D, "scalar"), gs = !!y(D, "flat"), jn = ie(D), Hn = ve, hn = [], ys = f.width * jn.x, Es = f.height * jn.y; Hn--; )
3619
3619
  hn.push(
3620
3620
  K({
3621
3621
  x: ys,
@@ -3629,8 +3629,8 @@ var Rn = {};
3629
3629
  decay: us,
3630
3630
  gravity: ds,
3631
3631
  drift: fs,
3632
- scalar: gs,
3633
- flat: ms
3632
+ scalar: ms,
3633
+ flat: gs
3634
3634
  })
3635
3635
  );
3636
3636
  return $ ? $.addFettis(hn) : ($ = Rt(f, hn, G, de, pe), $.promise);
@@ -3800,7 +3800,7 @@ const po = {
3800
3800
  return n;
3801
3801
  }), bo = (e) => {
3802
3802
  const t = Xs();
3803
- return me(() => {
3803
+ return ge(() => {
3804
3804
  if (!e || Ie(e)) return { blocks: [] };
3805
3805
  const n = xn(
3806
3806
  e,
@@ -3855,8 +3855,8 @@ const po = {
3855
3855
  const d = await t(e, {
3856
3856
  action: "GET_LIBRARY_ITEM",
3857
3857
  data: { id: l.id }
3858
- }), h = ae(d, "html", ""), g = ae(d, "blocks", []);
3859
- return Os(g) ? g : vs(h);
3858
+ }), h = ae(d, "html", ""), m = ae(d, "blocks", []);
3859
+ return Os(m) ? m : vs(h);
3860
3860
  }, getUILibraryBlocks: async (o) => {
3861
3861
  try {
3862
3862
  return (await t(e, {
@@ -3920,16 +3920,14 @@ function No({
3920
3920
  onTakeOver: r,
3921
3921
  currentEditor: s
3922
3922
  }) {
3923
- const [a, i] = ge(!1), o = () => {
3924
- i(!1), r();
3925
- };
3926
- return console.log("currentEditor", s), /* @__PURE__ */ u("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ m(fr, { className: "w-full max-w-md mx-auto", children: [
3927
- /* @__PURE__ */ u(hr, { className: "space-y-1", children: /* @__PURE__ */ m(gr, { className: "flex items-center gap-2 text-2xl", children: [
3923
+ const [a, i] = me(!1);
3924
+ return /* @__PURE__ */ u("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ g(fr, { className: "w-full max-w-md mx-auto", children: [
3925
+ /* @__PURE__ */ u(hr, { className: "space-y-1", children: /* @__PURE__ */ g(mr, { className: "flex items-center gap-2 text-2xl", children: [
3928
3926
  /* @__PURE__ */ u(ur, { className: "w-6 h-6 text-yellow-500" }),
3929
3927
  s === "EXPIRED" ? "Editing access timed out" : "Page locked for editing"
3930
3928
  ] }) }),
3931
- /* @__PURE__ */ u(mr, { className: "grid gap-4", children: s === "EXPIRED" ? /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u("p", { children: "Your editing access has been paused due to inactivity. Please refresh the page to continue" }) }) : /* @__PURE__ */ m("div", { children: [
3932
- /* @__PURE__ */ m("div", { className: "flex items-center space-x-4", children: [
3929
+ /* @__PURE__ */ u(gr, { className: "grid gap-4", children: s === "EXPIRED" ? /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u("p", { children: "Your editing access has been paused due to inactivity. Please refresh the page to continue" }) }) : /* @__PURE__ */ g("div", { children: [
3930
+ /* @__PURE__ */ g("div", { className: "flex items-center space-x-4", children: [
3933
3931
  e ? /* @__PURE__ */ u(
3934
3932
  "img",
3935
3933
  {
@@ -3938,7 +3936,7 @@ function No({
3938
3936
  className: "w-12 h-12 border border-gray-300 rounded-full"
3939
3937
  }
3940
3938
  ) : /* @__PURE__ */ u(Ks, { className: "w-12 h-12 p-2 border border-gray-300 rounded-full" }),
3941
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
3939
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
3942
3940
  /* @__PURE__ */ u("h3", { className: "font-semibold", children: t }),
3943
3941
  n && /* @__PURE__ */ u("p", { className: "text-sm text-muted-foreground", children: n })
3944
3942
  ] })
@@ -3953,40 +3951,42 @@ function No({
3953
3951
  variant: "destructive",
3954
3952
  children: "Refresh"
3955
3953
  }
3956
- ) }) : /* @__PURE__ */ m(na, { open: a, onOpenChange: i, children: [
3957
- /* @__PURE__ */ u(ra, { asChild: !0, children: /* @__PURE__ */ m("span", { className: "flex flex-col items-center", children: [
3954
+ ) }) : /* @__PURE__ */ g(na, { open: a, onOpenChange: i, children: [
3955
+ /* @__PURE__ */ u(ra, { asChild: !0, children: /* @__PURE__ */ g("span", { className: "flex flex-col items-center", children: [
3958
3956
  /* @__PURE__ */ u(re, { className: "w-full", variant: "destructive", children: "Take Over" }),
3959
3957
  /* @__PURE__ */ u("p", { className: "mt-2 text-xs text-muted-foreground", children: "If you need to edit, you can take over the lock, but be aware that the other user might lose unsaved changes." })
3960
3958
  ] }) }),
3961
- /* @__PURE__ */ m(sa, { className: "z-[99]", children: [
3962
- /* @__PURE__ */ m(aa, { children: [
3959
+ /* @__PURE__ */ g(sa, { className: "z-[99]", children: [
3960
+ /* @__PURE__ */ g(aa, { children: [
3963
3961
  /* @__PURE__ */ u(ia, { children: "Are you sure you want to take over?" }),
3964
- /* @__PURE__ */ m(oa, { children: [
3965
- /* @__PURE__ */ m("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
3962
+ /* @__PURE__ */ g(oa, { children: [
3963
+ /* @__PURE__ */ g("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
3966
3964
  /* @__PURE__ */ u(Vs, { className: "w-5 h-5" }),
3967
3965
  /* @__PURE__ */ u("span", { children: "This action might cause the other user to lose unsaved changes." })
3968
3966
  ] }),
3969
3967
  /* @__PURE__ */ u("br", {}),
3970
- /* @__PURE__ */ m("span", { className: "mt-2", children: [
3968
+ /* @__PURE__ */ g("span", { className: "mt-2", children: [
3971
3969
  "By taking over, you will become the active editor of this page, and ",
3972
3970
  t,
3973
3971
  " will lose their editing access."
3974
3972
  ] })
3975
3973
  ] })
3976
3974
  ] }),
3977
- /* @__PURE__ */ m(la, { children: [
3975
+ /* @__PURE__ */ g(la, { children: [
3978
3976
  /* @__PURE__ */ u(ca, { children: "Cancel" }),
3979
- /* @__PURE__ */ u(ua, { onClick: o, children: "Yes, Take Over" })
3977
+ /* @__PURE__ */ u(ua, { onClick: () => {
3978
+ i(!1), r();
3979
+ }, children: "Yes, Take Over" })
3980
3980
  ] })
3981
3981
  ] })
3982
3982
  ] }) })
3983
3983
  ] }) });
3984
3984
  }
3985
3985
  const Co = () => {
3986
- const { isLocked: e, currentEditor: t } = Un(), { data: n } = mo(t), [r] = ke(), s = r.get("page"), { mutate: a } = Zr(), { isFetching: i } = ss(), o = Ue(() => {
3986
+ const { isLocked: e, currentEditor: t } = Un(), { data: n } = go(t), [r] = ke(), s = r.get("page"), { mutate: a } = Zr(), { isFetching: i } = ss(), o = Ue(() => {
3987
3987
  a({ id: s });
3988
3988
  }, [s, a]);
3989
- return console.log("---- is locked-------", n, e, t), !e || i ? /* @__PURE__ */ u("div", { className: "" }) : /* @__PURE__ */ u(
3989
+ return !e || i ? /* @__PURE__ */ u("div", { className: "" }) : /* @__PURE__ */ u(
3990
3990
  No,
3991
3991
  {
3992
3992
  ...n,
@@ -3997,7 +3997,7 @@ const Co = () => {
3997
3997
  }
3998
3998
  );
3999
3999
  }, Io = () => {
4000
- const [e, t] = ke(), n = e.get("lang"), r = go(n), { setSelectedLang: s } = Ot(), a = () => {
4000
+ const [e, t] = ke(), n = e.get("lang"), r = mo(n), { setSelectedLang: s } = Ot(), a = () => {
4001
4001
  const o = new URLSearchParams(window.location.search);
4002
4002
  o.delete("lang");
4003
4003
  const l = o.toString(), d = `${window.location.pathname}${l ? `?${l}` : ""}`;
@@ -4005,14 +4005,14 @@ const Co = () => {
4005
4005
  };
4006
4006
  if (r) return null;
4007
4007
  const i = ae(qe, n);
4008
- return /* @__PURE__ */ u("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ m(fr, { className: "w-full max-w-md mx-auto", children: [
4009
- /* @__PURE__ */ u(hr, { className: "space-y-1", children: /* @__PURE__ */ m(gr, { className: "flex items-center gap-2 text-2xl", children: [
4008
+ return /* @__PURE__ */ u("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ g(fr, { className: "w-full max-w-md mx-auto", children: [
4009
+ /* @__PURE__ */ u(hr, { className: "space-y-1", children: /* @__PURE__ */ g(mr, { className: "flex items-center gap-2 text-2xl", children: [
4010
4010
  /* @__PURE__ */ u(ur, { className: "w-6 h-6 text-yellow-500" }),
4011
4011
  'Page missing for "',
4012
4012
  i,
4013
4013
  '" language.'
4014
4014
  ] }) }),
4015
- /* @__PURE__ */ u(mr, { className: "grid gap-4", children: /* @__PURE__ */ m("div", { children: [
4015
+ /* @__PURE__ */ u(gr, { className: "grid gap-4", children: /* @__PURE__ */ g("div", { children: [
4016
4016
  'Page is not available in the "',
4017
4017
  i,
4018
4018
  '" language. Either create the page in the "',
@@ -4031,7 +4031,7 @@ const Co = () => {
4031
4031
  ] }) });
4032
4032
  }, Lo = () => {
4033
4033
  const [e] = Ss(), { mutate: t, isPending: n } = io(), { mutateAsync: r, isPending: s } = Jr();
4034
- return /* @__PURE__ */ m("div", { className: "bg-white py-3 flex items-center justify-center gap-x-3 border-t", children: [
4034
+ return /* @__PURE__ */ g("div", { className: "bg-white py-3 flex items-center justify-center gap-x-3 border-t", children: [
4035
4035
  /* @__PURE__ */ u(
4036
4036
  re,
4037
4037
  {
@@ -4087,7 +4087,7 @@ const Co = () => {
4087
4087
  button: Go
4088
4088
  }, Do = () => {
4089
4089
  const { selectedLang: e } = Ot(), { data: t, isFetching: n } = On();
4090
- return { data: me(() => Se(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
4090
+ return { data: ge(() => Se(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
4091
4091
  };
4092
4092
  function Ce({
4093
4093
  data: e,
@@ -4099,7 +4099,7 @@ function Ce({
4099
4099
  Z.useEffect(() => {
4100
4100
  s || o([]), d(e);
4101
4101
  }, [e, s]);
4102
- const h = (E) => Array.isArray(E) ? "array" : typeof E == "object" && E !== null ? "object" : "value", g = Z.useCallback(
4102
+ const h = (E) => Array.isArray(E) ? "array" : typeof E == "object" && E !== null ? "object" : "value", m = Z.useCallback(
4103
4103
  (E) => {
4104
4104
  const N = (y) => n === "value" ? y === "value" || y === "object" : n === "array" ? y === "array" : y === n;
4105
4105
  E.type === "object" ? (o((y) => [...y, E.key]), d(E.value)) : N(E.type) && (t([...i, E.key].join(".")), a(!1));
@@ -4115,9 +4115,9 @@ function Ce({
4115
4115
  value: N,
4116
4116
  type: h(N)
4117
4117
  })).filter((E) => n === "value" ? E.type === "value" || E.type === "object" : n === "array" ? E.type === "array" || E.type === "object" : n === "object" ? E.type === "object" : !0), [l, n]);
4118
- return /* @__PURE__ */ m(da, { open: s, onOpenChange: a, children: [
4119
- /* @__PURE__ */ m(fa, { children: [
4120
- /* @__PURE__ */ u(ha, { asChild: !0, children: /* @__PURE__ */ u(ga, { asChild: !0, children: /* @__PURE__ */ u(
4118
+ return /* @__PURE__ */ g(da, { open: s, onOpenChange: a, children: [
4119
+ /* @__PURE__ */ g(fa, { children: [
4120
+ /* @__PURE__ */ u(ha, { asChild: !0, children: /* @__PURE__ */ u(ma, { asChild: !0, children: /* @__PURE__ */ u(
4121
4121
  re,
4122
4122
  {
4123
4123
  size: "sm",
@@ -4129,14 +4129,14 @@ function Ce({
4129
4129
  children: /* @__PURE__ */ u(zs, { className: "h-3 w-3" })
4130
4130
  }
4131
4131
  ) }) }),
4132
- /* @__PURE__ */ u(ma, { children: "Add field" })
4132
+ /* @__PURE__ */ u(ga, { children: "Add field" })
4133
4133
  ] }),
4134
- /* @__PURE__ */ u(ya, { className: "w-[200px] p-0", children: /* @__PURE__ */ m(Ea, { children: [
4134
+ /* @__PURE__ */ u(ya, { className: "w-[200px] p-0", children: /* @__PURE__ */ g(Ea, { children: [
4135
4135
  /* @__PURE__ */ u(pa, { className: "border-none", placeholder: "Search..." }),
4136
- /* @__PURE__ */ m(va, { children: [
4136
+ /* @__PURE__ */ g(va, { children: [
4137
4137
  /* @__PURE__ */ u(Sa, { children: "No option found." }),
4138
- /* @__PURE__ */ m(Aa, { children: [
4139
- i.length > 0 && /* @__PURE__ */ m(
4138
+ /* @__PURE__ */ g(Aa, { children: [
4139
+ i.length > 0 && /* @__PURE__ */ g(
4140
4140
  zn,
4141
4141
  {
4142
4142
  onSelect: v,
@@ -4147,14 +4147,14 @@ function Ce({
4147
4147
  ]
4148
4148
  }
4149
4149
  ),
4150
- A.map((E) => /* @__PURE__ */ m(
4150
+ A.map((E) => /* @__PURE__ */ g(
4151
4151
  zn,
4152
4152
  {
4153
- onSelect: () => g(E),
4153
+ onSelect: () => m(E),
4154
4154
  className: "flex items-center justify-between",
4155
4155
  children: [
4156
4156
  /* @__PURE__ */ u("span", { children: E.key }),
4157
- /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
4157
+ /* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
4158
4158
  n === "object" && E.type === "object" && /* @__PURE__ */ u(
4159
4159
  re,
4160
4160
  {
@@ -4190,8 +4190,8 @@ const Oo = (e, t) => {
4190
4190
  const E = i.charAt(0);
4191
4191
  l = !/[\s.,!?;:()[\]{}]/.test(E) && E !== "";
4192
4192
  }
4193
- const d = o ? " " : "", h = l ? " " : "", g = `{{${t}}}`, v = a + (o ? d : "") + g + (l ? h : "") + i, A = n + (o ? 1 : 0) + // Account for space before if added
4194
- g.length;
4193
+ const d = o ? " " : "", h = l ? " " : "", m = `{{${t}}}`, v = a + (o ? d : "") + m + (l ? h : "") + i, A = n + (o ? 1 : 0) + // Account for space before if added
4194
+ m.length;
4195
4195
  return {
4196
4196
  value: v,
4197
4197
  newCursorPos: A
@@ -4202,7 +4202,7 @@ const Oo = (e, t) => {
4202
4202
  pageType: s == null ? void 0 : s.pageType
4203
4203
  }), { data: i, isFetching: o } = Do(), l = i == null ? void 0 : i.seo, d = $t(
4204
4204
  null
4205
- ), [h, g] = ge({
4205
+ ), [h, m] = me({
4206
4206
  title: "",
4207
4207
  description: "",
4208
4208
  cononicalUrl: "",
@@ -4217,7 +4217,7 @@ const Oo = (e, t) => {
4217
4217
  ...l
4218
4218
  }), v = $t({ initial: h, updated: h }), A = t.length ? t : n, { mutate: E, isPending: N } = rs(), y = N, { hasPermission: Q } = ir(), p = Q(Oe.EDIT_SEO);
4219
4219
  Ut(() => {
4220
- !o && l && g({
4220
+ !o && l && m({
4221
4221
  title: "",
4222
4222
  description: "",
4223
4223
  cononicalUrl: "",
@@ -4235,13 +4235,13 @@ const Oo = (e, t) => {
4235
4235
  const C = async () => {
4236
4236
  E({ id: i == null ? void 0 : i.id, seo: h }), v.current.initial = h, v.current.updated = h;
4237
4237
  }, O = () => {
4238
- g({
4238
+ m({
4239
4239
  ...h,
4240
4240
  ogTitle: h.title,
4241
4241
  ogDescription: h.description
4242
4242
  });
4243
4243
  }, q = () => {
4244
- g({
4244
+ m({
4245
4245
  ...h,
4246
4246
  searchTitle: h.ogTitle,
4247
4247
  searchDescription: h.ogDescription
@@ -4256,7 +4256,7 @@ const Oo = (e, t) => {
4256
4256
  d.current = {
4257
4257
  id: B,
4258
4258
  position: ne
4259
- }, U.tagName.toLowerCase() === "input" ? (U.value = K, g((V) => ({
4259
+ }, U.tagName.toLowerCase() === "input" ? (U.value = K, m((V) => ({
4260
4260
  ...V,
4261
4261
  [U.name]: K
4262
4262
  })), U.focus(), U.setSelectionRange(ne, ne), [0, 10, 50, 100, 200].forEach((V) => {
@@ -4264,7 +4264,7 @@ const Oo = (e, t) => {
4264
4264
  const he = document.getElementById(B);
4265
4265
  he && (he.focus(), he.setSelectionRange(ne, ne));
4266
4266
  }, V);
4267
- })) : (g((ye) => ({
4267
+ })) : (m((ye) => ({
4268
4268
  ...ye,
4269
4269
  [U.name]: K
4270
4270
  })), requestAnimationFrame(() => {
@@ -4284,29 +4284,29 @@ const Oo = (e, t) => {
4284
4284
  ...h,
4285
4285
  [k.target.name]: k.target.name === "noIndex" || k.target.name === "noFollow" ? k.target.checked : k.target.value
4286
4286
  };
4287
- g(B), v.current.updated = B;
4287
+ m(B), v.current.updated = B;
4288
4288
  };
4289
- return /* @__PURE__ */ m("div", { className: "relative pb-40", children: [
4289
+ return /* @__PURE__ */ g("div", { className: "relative pb-40", children: [
4290
4290
  !p && /* @__PURE__ */ u("div", { className: "absolute inset-0 z-10 backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ u(dr, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ u(wa, { children: e(
4291
4291
  "You don't have permission to edit SEO settings. Contact your administrator for access."
4292
4292
  ) }) }) }),
4293
- /* @__PURE__ */ m("div", { className: "p-2 text-xs text-left bg-gray-100 rounded-md", children: [
4293
+ /* @__PURE__ */ g("div", { className: "p-2 text-xs text-left bg-gray-100 rounded-md", children: [
4294
4294
  e("Slug"),
4295
4295
  ": ",
4296
4296
  i == null ? void 0 : i.slug,
4297
4297
  "  ",
4298
- r.length > 0 && /* @__PURE__ */ m("span", { className: "font-semibold text-blue-500", children: [
4298
+ r.length > 0 && /* @__PURE__ */ g("span", { className: "font-semibold text-blue-500", children: [
4299
4299
  "(",
4300
4300
  ae(qe, A, A),
4301
4301
  ")"
4302
4302
  ] })
4303
4303
  ] }),
4304
- /* @__PURE__ */ u("form", { className: "space-y-8", children: /* @__PURE__ */ m(ba, { type: "multiple", defaultValue: ["page"], children: [
4305
- /* @__PURE__ */ m(Mt, { value: "page", children: [
4304
+ /* @__PURE__ */ u("form", { className: "space-y-8", children: /* @__PURE__ */ g(ba, { type: "multiple", defaultValue: ["page"], children: [
4305
+ /* @__PURE__ */ g(Mt, { value: "page", children: [
4306
4306
  /* @__PURE__ */ u(Bt, { className: "font-semibold text-slate-700", children: e("SEO") }),
4307
- /* @__PURE__ */ u(Ft, { className: "pt-2", children: /* @__PURE__ */ m("div", { className: "space-y-4", children: [
4308
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4309
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4307
+ /* @__PURE__ */ u(Ft, { className: "pt-2", children: /* @__PURE__ */ g("div", { className: "space-y-4", children: [
4308
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4309
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4310
4310
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "title", children: e("SEO Title") }),
4311
4311
  p && /* @__PURE__ */ u(
4312
4312
  Ce,
@@ -4331,8 +4331,8 @@ const Oo = (e, t) => {
4331
4331
  }
4332
4332
  )
4333
4333
  ] }),
4334
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4335
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4334
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4335
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4336
4336
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "description", children: e("SEO Description") }),
4337
4337
  p && /* @__PURE__ */ u(
4338
4338
  Ce,
@@ -4356,8 +4356,8 @@ const Oo = (e, t) => {
4356
4356
  }
4357
4357
  )
4358
4358
  ] }),
4359
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4360
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4359
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4360
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4361
4361
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "title", children: e("Canonical URL") }),
4362
4362
  p && /* @__PURE__ */ u(
4363
4363
  Ce,
@@ -4382,8 +4382,8 @@ const Oo = (e, t) => {
4382
4382
  }
4383
4383
  )
4384
4384
  ] }),
4385
- /* @__PURE__ */ m("div", { className: "", children: [
4386
- /* @__PURE__ */ m("div", { className: "flex items-center gap-x-2", children: [
4385
+ /* @__PURE__ */ g("div", { className: "", children: [
4386
+ /* @__PURE__ */ g("div", { className: "flex items-center gap-x-2", children: [
4387
4387
  /* @__PURE__ */ u(
4388
4388
  Te,
4389
4389
  {
@@ -4402,8 +4402,8 @@ const Oo = (e, t) => {
4402
4402
  "Check this if you don't want search engines to index this page."
4403
4403
  ) })
4404
4404
  ] }),
4405
- /* @__PURE__ */ m("div", { className: "", children: [
4406
- /* @__PURE__ */ m("div", { className: "flex items-center gap-x-2", children: [
4405
+ /* @__PURE__ */ g("div", { className: "", children: [
4406
+ /* @__PURE__ */ g("div", { className: "flex items-center gap-x-2", children: [
4407
4407
  /* @__PURE__ */ u(
4408
4408
  Te,
4409
4409
  {
@@ -4424,9 +4424,9 @@ const Oo = (e, t) => {
4424
4424
  ] })
4425
4425
  ] }) })
4426
4426
  ] }),
4427
- /* @__PURE__ */ m(Mt, { value: "og", children: [
4427
+ /* @__PURE__ */ g(Mt, { value: "og", children: [
4428
4428
  /* @__PURE__ */ u(Bt, { className: "font-bold text-slate-700", children: e("Open Graph") }),
4429
- /* @__PURE__ */ u(Ft, { children: /* @__PURE__ */ m("div", { className: "space-y-4", children: [
4429
+ /* @__PURE__ */ u(Ft, { children: /* @__PURE__ */ g("div", { className: "space-y-4", children: [
4430
4430
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ u(
4431
4431
  re,
4432
4432
  {
@@ -4438,8 +4438,8 @@ const Oo = (e, t) => {
4438
4438
  children: e("Copy from SEO Settings")
4439
4439
  }
4440
4440
  ) }),
4441
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4442
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4441
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4442
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4443
4443
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "ogTitle", children: e("OG Title") }),
4444
4444
  p && /* @__PURE__ */ u(
4445
4445
  Ce,
@@ -4464,8 +4464,8 @@ const Oo = (e, t) => {
4464
4464
  }
4465
4465
  )
4466
4466
  ] }),
4467
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4468
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4467
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4468
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4469
4469
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "ogDescription", children: e("OG Description") }),
4470
4470
  p && /* @__PURE__ */ u(
4471
4471
  Ce,
@@ -4490,8 +4490,8 @@ const Oo = (e, t) => {
4490
4490
  }
4491
4491
  )
4492
4492
  ] }),
4493
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4494
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4493
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4494
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4495
4495
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "ogImage", children: e("OG Image URL") }),
4496
4496
  p && /* @__PURE__ */ u(
4497
4497
  Ce,
@@ -4518,9 +4518,9 @@ const Oo = (e, t) => {
4518
4518
  ] })
4519
4519
  ] }) })
4520
4520
  ] }),
4521
- /* @__PURE__ */ m(Mt, { value: "search", children: [
4521
+ /* @__PURE__ */ g(Mt, { value: "search", children: [
4522
4522
  /* @__PURE__ */ u(Bt, { className: "font-bold text-slate-700", children: e("Search") }),
4523
- /* @__PURE__ */ u(Ft, { children: /* @__PURE__ */ m("div", { className: "space-y-4", children: [
4523
+ /* @__PURE__ */ u(Ft, { children: /* @__PURE__ */ g("div", { className: "space-y-4", children: [
4524
4524
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ u(
4525
4525
  re,
4526
4526
  {
@@ -4532,8 +4532,8 @@ const Oo = (e, t) => {
4532
4532
  children: e("Copy from OG Settings")
4533
4533
  }
4534
4534
  ) }),
4535
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4536
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4535
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4536
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4537
4537
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "searchTitle", children: e("Search Title") }),
4538
4538
  p && /* @__PURE__ */ u(
4539
4539
  Ce,
@@ -4558,8 +4558,8 @@ const Oo = (e, t) => {
4558
4558
  }
4559
4559
  )
4560
4560
  ] }),
4561
- /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4562
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4561
+ /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4562
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4563
4563
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "searchDescription", children: e("Search Description") }),
4564
4564
  p && /* @__PURE__ */ u(
4565
4565
  Ce,
@@ -4586,10 +4586,10 @@ const Oo = (e, t) => {
4586
4586
  ] })
4587
4587
  ] }) })
4588
4588
  ] }),
4589
- /* @__PURE__ */ m(Mt, { value: "jsonLD", children: [
4589
+ /* @__PURE__ */ g(Mt, { value: "jsonLD", children: [
4590
4590
  /* @__PURE__ */ u(Bt, { className: "font-bold text-slate-700", children: e("JSON-LD") }),
4591
- /* @__PURE__ */ u(Ft, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: /* @__PURE__ */ m("div", { className: "space-y-1", children: [
4592
- /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
4591
+ /* @__PURE__ */ u(Ft, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: /* @__PURE__ */ g("div", { className: "space-y-1", children: [
4592
+ /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
4593
4593
  /* @__PURE__ */ u(ue, { className: "text-xs", htmlFor: "jsonLD", children: e("JSON-LD") }),
4594
4594
  p && /* @__PURE__ */ u(
4595
4595
  Ce,
@@ -4641,7 +4641,7 @@ const ls = "seo", Uo = ({
4641
4641
  className: "my-1",
4642
4642
  onClick: t,
4643
4643
  variant: e ? "default" : "ghost",
4644
- children: /* @__PURE__ */ m(
4644
+ children: /* @__PURE__ */ g(
4645
4645
  "svg",
4646
4646
  {
4647
4647
  className: "w-4 h-4",
@@ -4673,9 +4673,9 @@ const Bo = (e) => {
4673
4673
  role: "",
4674
4674
  permissions: null
4675
4675
  }
4676
- } = xo(), { data: o } = To(), { data: l, isFetching: d } = ss(), { blocks: h } = bo(l), { data: g } = fn(), { data: v } = De(), { mutateAsync: A } = Jr(), E = Ao(), { getUILibraryBlock: N, getUILibraryBlocks: y, onSave: Q } = _o(), { getPartialBlocks: p, getPartialBlockBlocks: C } = Po(), { aiContext: O, setAiContext: q } = Mn(), { mutateAsync: ie } = no(), [se, k] = ge(!1), B = me(
4677
- () => (g == null ? void 0 : g.fallbackLang) || "en",
4678
- [g]
4676
+ } = xo(), { data: o } = To(), { data: l, isFetching: d } = ss(), { blocks: h } = bo(l), { data: m } = fn(), { data: v } = De(), { mutateAsync: A } = Jr(), E = Ao(), { getUILibraryBlock: N, getUILibraryBlocks: y, onSave: Q } = _o(), { getPartialBlocks: p, getPartialBlockBlocks: C } = Po(), { aiContext: O, setAiContext: q } = Mn(), { mutateAsync: ie } = no(), [se, k] = me(!1), B = ge(
4677
+ () => (m == null ? void 0 : m.fallbackLang) || "en",
4678
+ [m]
4679
4679
  ), { data: U } = as({
4680
4680
  pageType: a == null ? void 0 : a.pageType,
4681
4681
  lang: s || B
@@ -4686,17 +4686,17 @@ const Bo = (e) => {
4686
4686
  };
4687
4687
  return window.addEventListener("visibilitychange", V), () => window.removeEventListener("visibilitychange", V);
4688
4688
  }, []), t.current = h;
4689
- const K = me(() => {
4689
+ const K = ge(() => {
4690
4690
  const V = {};
4691
4691
  return i && (V.permissions = ae(i, "permissions", null), V.role = ae(i, "role", "user")), V;
4692
- }, [i]), ne = me(() => o, [o]), Rt = Ue(
4692
+ }, [i]), ne = ge(() => o, [o]), Rt = Ue(
4693
4693
  async (V, he) => await ie({ pageType: V, query: he }),
4694
4694
  [ie]
4695
- ), ye = me(
4696
- () => ae(g, "theme", {}) || {},
4697
- [g]
4695
+ ), ye = ge(
4696
+ () => ae(m, "theme", {}) || {},
4697
+ [m]
4698
4698
  );
4699
- return /* @__PURE__ */ m(ar, { children: [
4699
+ return /* @__PURE__ */ g(ar, { children: [
4700
4700
  d && /* @__PURE__ */ u("div", { className: "absolute inset-0 z-50 flex items-center justify-center w-screen h-screen bg-white/30", children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center bg-white rounded-full size-10", children: /* @__PURE__ */ u(Ys, { className: "size-5 animate-spin" }) }) }),
4701
4701
  /* @__PURE__ */ u(
4702
4702
  ws,
@@ -4706,8 +4706,8 @@ const Bo = (e) => {
4706
4706
  pageId: a == null ? void 0 : a.id,
4707
4707
  loading: d,
4708
4708
  fallbackLang: B,
4709
- languages: (g == null ? void 0 : g.languages) || [],
4710
- brandingOptions: (g == null ? void 0 : g.theme) || {},
4709
+ languages: (m == null ? void 0 : m.languages) || [],
4710
+ brandingOptions: (m == null ? void 0 : m.theme) || {},
4711
4711
  translations: e.translations || {},
4712
4712
  locale: e.locale || "en",
4713
4713
  htmlDir: e.htmlDir || "ltr",
@@ -4746,7 +4746,7 @@ const Bo = (e) => {
4746
4746
  ...K
4747
4747
  }
4748
4748
  ),
4749
- /* @__PURE__ */ m("div", { children: [
4749
+ /* @__PURE__ */ g("div", { children: [
4750
4750
  /* @__PURE__ */ u(Co, {}),
4751
4751
  /* @__PURE__ */ u(Io, {})
4752
4752
  ] })
@@ -4759,7 +4759,7 @@ const Bo = (e) => {
4759
4759
  }
4760
4760
  }
4761
4761
  }), Nl = (e) => {
4762
- const [, t] = es(), [n, r] = ge(!1);
4762
+ const [, t] = es(), [n, r] = me(!1);
4763
4763
  return Ut(() => (t(
4764
4764
  cr(e, [
4765
4765
  "apiUrl",
@@ -4774,7 +4774,7 @@ const Bo = (e) => {
4774
4774
  r(!0);
4775
4775
  }, 200), () => {
4776
4776
  r(!1), t({});
4777
- }), [e, t]), n ? /* @__PURE__ */ m(_s, { client: Fo, children: [
4777
+ }), [e, t]), n ? /* @__PURE__ */ g(_s, { client: Fo, children: [
4778
4778
  /* @__PURE__ */ u(Bo, { ...e }),
4779
4779
  /* @__PURE__ */ u(Yi, {})
4780
4780
  ] }) : /* @__PURE__ */ u("div", {});
@@ -4786,7 +4786,7 @@ export {
4786
4786
  Al as A,
4787
4787
  Jo as B,
4788
4788
  fl as C,
4789
- gl as D,
4789
+ ml as D,
4790
4790
  le as E,
4791
4791
  il as F,
4792
4792
  Pa as G,
@@ -4799,14 +4799,14 @@ export {
4799
4799
  je as N,
4800
4800
  ri as O,
4801
4801
  hl as P,
4802
- ml as Q,
4802
+ gl as Q,
4803
4803
  ul as R,
4804
4804
  ll as S,
4805
4805
  cl as T,
4806
4806
  Wt as U,
4807
4807
  nl as V,
4808
4808
  Nl as W,
4809
- gt as X,
4809
+ mt as X,
4810
4810
  ft as Y,
4811
4811
  On as Z,
4812
4812
  ts as _,
@@ -4815,7 +4815,7 @@ export {
4815
4815
  xo as a1,
4816
4816
  ee as a2,
4817
4817
  Pl as a3,
4818
- mo as a4,
4818
+ go as a4,
4819
4819
  J as b,
4820
4820
  fe as c,
4821
4821
  Ja as d,