@chaibuilder/pages 0.11.1 → 0.11.2
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.
- package/dist/{LNWAZHJI-D882C_7p.cjs → LNWAZHJI-DHuHLUIS.cjs} +1 -1
- package/dist/{LNWAZHJI-BbaRO6rJ.js → LNWAZHJI-ikdFXaCe.js} +2 -2
- package/dist/{MWZ6AO7Z-BENCFzVR.cjs → MWZ6AO7Z-CdFGNmYl.cjs} +1 -1
- package/dist/{MWZ6AO7Z-C1GCbInS.js → MWZ6AO7Z-uvdDTCnz.js} +2 -2
- package/dist/{YPM2AS64-DBOZcP39.js → YPM2AS64-BEgz97Tq.js} +1 -1
- package/dist/{YPM2AS64-NG88fHO6.cjs → YPM2AS64-BcDjyDAA.cjs} +1 -1
- package/dist/{index-B9RbhM1X.cjs → index-COE73rUN.cjs} +4 -4
- package/dist/{index-0rUFe1LG.js → index-rrgQUAfs.js} +493 -493
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Zl = Object.defineProperty;
|
|
2
2
|
var fr = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var Pt = (e, t, s) =>
|
|
5
|
+
var eo = (e, t, s) => t in e ? Zl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
6
|
+
var Pt = (e, t, s) => eo(e, typeof t != "symbol" ? t + "" : t, s), gr = (e, t, s) => t.has(e) || fr("Cannot " + s);
|
|
7
7
|
var te = (e, t, s) => (gr(e, t, "read from private field"), s ? s.call(e) : t.get(e)), we = (e, t, s) => t.has(e) ? fr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), pe = (e, t, s, a) => (gr(e, t, "write to private field"), a ? a.call(e, s) : t.set(e, s), s);
|
|
8
8
|
import { jsx as n, jsxs as c, Fragment as de } from "react/jsx-runtime";
|
|
9
|
-
import { has as Ie, get as $, isEmpty as Y, reverse as
|
|
9
|
+
import { has as Ie, get as $, isEmpty as Y, reverse as to, sortBy as no, each as so, find as ve, keyBy as Qa, map as Be, noop as Kr, groupBy as Hr, minBy as ao, set as gt, filter as ye, startsWith as sn, startCase as zt, isObject as ba, pick as fs, initial as ro, includes as xt, uniq as ka, union as io, flatMap as Pa, compact as Ks, uniqBy as lo, mapValues as Wr, toLower as Bt, endsWith as Qr, replace as oo, isString as Ia, trim as co, isArray as Jr, isPlainObject as uo, orderBy as As, first as Yr, concat as ho, debounce as mo, upperCase as pr, keys as fo, pickBy as go, isEqual as Us, values as po, isFunction as yo, merge as vo, cloneDeep as bo } from "lodash-es";
|
|
10
10
|
import * as Ce from "react";
|
|
11
|
-
import
|
|
11
|
+
import Hs, { useCallback as ae, useState as S, useEffect as le, useRef as tt, useMemo as W, Suspense as Ja, createContext as xo, Component as wo, createElement as yr, lazy as No } from "react";
|
|
12
12
|
import { useAtom as Ue, atom as vt } from "jotai";
|
|
13
|
-
import { useMutation as ke, useQueryClient as Pe, useQuery as De, onlineManager as
|
|
14
|
-
import { toast as
|
|
15
|
-
import { useLanguages as Fe, useSavePage as
|
|
16
|
-
import { Tooltip as Xe, TooltipTrigger as Ze, TooltipContent as et, Card as Qs, CardHeader as Js, CardTitle as Ys, CardContent as Xs, CardFooter as Zs, Button as T, Skeleton as Mt, AlertDialog as
|
|
17
|
-
import { formatDistanceToNow as
|
|
18
|
-
import { LockIcon as
|
|
13
|
+
import { useMutation as ke, useQueryClient as Pe, useQuery as De, onlineManager as Xr, QueryClient as Eo, QueryClientProvider as So } from "@tanstack/react-query";
|
|
14
|
+
import { toast as H } from "sonner";
|
|
15
|
+
import { useLanguages as Fe, useSavePage as Wt, useIsPageLoaded as Ao, useUpdateBlocksPropsRealtime as Zr, PERMISSIONS as To, usePartailBlocksStore as Co, usePermissions as Pn, useLibraryBlocks as ko, useTheme as Po, useSidebarActivePanel as Ws, useChaiFeatureFlag as Et, mergeClasses as Vn, useRightPanel as Io, registerChaiLibrary as _o, getBlocksFromHTML as Lo, useBuilderProp as Do, useTranslation as Oo, registerChaiSidebarPanel as Ts, registerChaiFeatureFlag as Xt, registerChaiTopBar as Ro, registerChaiMediaManager as Go, registerChaiSaveToLibrary as Uo, ChaiBuilderEditor as Bo } from "@chaibuilder/sdk";
|
|
16
|
+
import { Tooltip as Xe, TooltipTrigger as Ze, TooltipContent as et, Card as Qs, CardHeader as Js, CardTitle as Ys, CardContent as Xs, CardFooter as Zs, Button as T, Skeleton as Mt, AlertDialog as ei, AlertDialogTrigger as ti, AlertDialogContent as ni, AlertDialogHeader as si, AlertDialogTitle as ai, AlertDialogDescription as ri, AlertDialogFooter as ii, AlertDialogCancel as li, AlertDialogAction as oi, Popover as Nn, PopoverTrigger as En, PopoverContent as Sn, Input as xe, Label as he, Dialog as je, DialogContent as ze, DialogHeader as Ve, DialogTitle as Ke, DialogDescription as nt, Alert as In, DialogFooter as ht, CommandList as ci, Command as Kn, CommandEmpty as Hn, CommandGroup as _t, CommandItem as ft, Textarea as An, DropdownMenu as _n, DropdownMenuTrigger as Ln, DropdownMenuContent as Dn, DropdownMenuItem as $e, Select as di, SelectTrigger as ui, SelectValue as Mo, SelectContent as hi, SelectItem as an, Badge as xa, TooltipProvider as Ft, Separator as Fo, Sheet as mi, SheetContent as fi, SheetHeader as gi, SheetTitle as pi, SheetDescription as $o, Switch as _a, ScrollArea as Ds, SheetTrigger as qo, DropdownMenuSeparator as jo, CardDescription as zo, CommandInput as Vo, Tabs as yi, TabsList as vi, TabsTrigger as Mn, TabsContent as Fn, AlertDescription as bi, HoverCard as Ko, HoverCardTrigger as Ho, HoverCardContent as Wo } from "@chaibuilder/sdk/ui";
|
|
17
|
+
import { formatDistanceToNow as xi, formatDate as Qo, format as ea } from "date-fns";
|
|
18
|
+
import { LockIcon as wi, LockKeyhole as Jo, UserIcon as Yo, Info as Xo, KeyIcon as Zo, AlertTriangleIcon as ec, Loader as wt, TableIcon as tc, CheckCircle as Ni, Target as nc, Edit as Wn, Check as it, X as Tn, Trash2 as ta, Plus as gs, ImageIcon as Qn, AlertCircle as na, ChevronDown as Lt, Search as Nt, Tag as sc, File as Qt, CopyPlusIcon as ac, Pencil as Ei, Power as Si, Trash as Ya, SquareLibrary as vr, ChevronsUpDown as Ai, ChevronsDownUp as Ti, ChevronRight as sa, StarsIcon as Ci, Globe as Xa, MoreHorizontal as Cn, Star as ki, FilterXIcon as rc, Filter as ic, ListFilter as lc, RefreshCw as oc, NotepadText as cc, Lock as Pi, Languages as br, LogsIcon as dc, Folder as uc, FileJson as La, Copy as Bs, History as hc, Eye as aa, Undo2 as Ii, CloudOff as mc, Rocket as Da, Save as _i, GlobeIcon as fc, Palette as gc, Send as xr, Settings as Li, ExternalLink as pc, EyeOff as yc, Loader2 as Di, StarIcon as vc, PencilIcon as bc, TrashIcon as xc, LanguagesIcon as wc, DatabaseIcon as Nc, ChevronLeft as Za, Sparkle as Ec, Code as Sc, AlertTriangle as Oi, User as Ac, Link as Tc, Archive as Cc, Film as kc, Upload as Pc } from "lucide-react";
|
|
19
19
|
import Ic from "compressorjs";
|
|
20
20
|
import { parseDiff as _c, Diff as Lc, Hunk as Dc } from "react-diff-view";
|
|
21
21
|
import { useRegisteredChaiBlocks as Oc, getDefaultBlockProps as Rc } from "@chaibuilder/runtime";
|
|
@@ -351,7 +351,7 @@ function jc(e = () => {
|
|
|
351
351
|
}), o && (i.subscribe = l(o)), i;
|
|
352
352
|
}
|
|
353
353
|
const zc = jc();
|
|
354
|
-
function
|
|
354
|
+
function Ri(e, t, s = zc, a) {
|
|
355
355
|
const r = wr(
|
|
356
356
|
t
|
|
357
357
|
);
|
|
@@ -369,9 +369,9 @@ function Oi(e, t, s = zc, a) {
|
|
|
369
369
|
}
|
|
370
370
|
localStorage.removeItem("_chai_user");
|
|
371
371
|
localStorage.removeItem("__chai__user");
|
|
372
|
-
const
|
|
372
|
+
const Gi = "__logged_in_user", Vc = Ri(Gi, null), ot = () => {
|
|
373
373
|
const [e, t] = Ue(Vc), s = ae(() => {
|
|
374
|
-
t(null), localStorage.removeItem(
|
|
374
|
+
t(null), localStorage.removeItem(Gi);
|
|
375
375
|
}, [t]);
|
|
376
376
|
return {
|
|
377
377
|
isLoggedIn: !!e,
|
|
@@ -398,7 +398,7 @@ if (import.meta.vitest) {
|
|
|
398
398
|
}
|
|
399
399
|
let tn = null;
|
|
400
400
|
function Kc() {
|
|
401
|
-
const { user: e, setUser: t, logout: s } = ot(), a = ia(), r =
|
|
401
|
+
const { user: e, setUser: t, logout: s } = ot(), a = ia(), r = ct("getAccessToken", !1), i = async () => {
|
|
402
402
|
if (r === !1 && e && !(!Ie(e, "expiresAt") || !Ie(e, "accessToken") || !Ie(e, "refreshToken")))
|
|
403
403
|
try {
|
|
404
404
|
const l = await ra(a, {
|
|
@@ -435,19 +435,19 @@ function Kc() {
|
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function Hc() {
|
|
439
439
|
return tn;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
441
|
+
const Ui = () => {
|
|
442
442
|
const { user: e, setUser: t } = ot(), { mutateAsync: s } = Kc(), a = 60, r = ae(() => {
|
|
443
443
|
if (!(e != null && e.expiresAt)) return !1;
|
|
444
444
|
if (!e || !(e != null && e.refreshToken)) return !0;
|
|
445
445
|
const o = Math.floor(Date.now() / 1e3);
|
|
446
446
|
return e.expiresAt - o <= a;
|
|
447
|
-
}, [e]), l =
|
|
447
|
+
}, [e]), l = ct("getAccessToken", async () => {
|
|
448
448
|
if (!(!Ie(e, "expiresAt") || !Ie(e, "accessToken") || !Ie(e, "refreshToken"))) {
|
|
449
449
|
if (r()) {
|
|
450
|
-
const o =
|
|
450
|
+
const o = Hc();
|
|
451
451
|
if (o) {
|
|
452
452
|
const h = await o;
|
|
453
453
|
return h && t(h), (h == null ? void 0 : h.accessToken) || "";
|
|
@@ -468,7 +468,7 @@ const Gi = () => {
|
|
|
468
468
|
}, [l])
|
|
469
469
|
};
|
|
470
470
|
}, Z = () => {
|
|
471
|
-
const { logout: e } = ot(), { getAccessToken: t } =
|
|
471
|
+
const { logout: e } = ot(), { getAccessToken: t } = Ui();
|
|
472
472
|
return ae(
|
|
473
473
|
async (s, a, r = {}) => {
|
|
474
474
|
const i = await t();
|
|
@@ -497,7 +497,7 @@ const Gi = () => {
|
|
|
497
497
|
},
|
|
498
498
|
[e, t]
|
|
499
499
|
);
|
|
500
|
-
},
|
|
500
|
+
}, Bi = () => {
|
|
501
501
|
const e = ue(), t = Pe(), s = Z();
|
|
502
502
|
return ke({
|
|
503
503
|
mutationFn: async (a) => s(e, { action: G.RELEASE_LOCK, data: a }),
|
|
@@ -507,7 +507,7 @@ const Gi = () => {
|
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
509
|
});
|
|
510
|
-
},
|
|
510
|
+
}, Mi = () => {
|
|
511
511
|
const e = ue(), t = Pe(), s = Z();
|
|
512
512
|
return ke({
|
|
513
513
|
mutationFn: async (a) => s(e, {
|
|
@@ -518,31 +518,31 @@ const Gi = () => {
|
|
|
518
518
|
var i;
|
|
519
519
|
t.invalidateQueries({
|
|
520
520
|
queryKey: [G.GET_WEBSITE_DRAFT_SETTINGS]
|
|
521
|
-
}), (i = r == null ? void 0 : r.settings) != null && i.theme ||
|
|
521
|
+
}), (i = r == null ? void 0 : r.settings) != null && i.theme || H.success("Website settings updated successfully.");
|
|
522
522
|
},
|
|
523
523
|
onError: (a) => {
|
|
524
|
-
|
|
524
|
+
H.error("Failed to update website settings", {
|
|
525
525
|
description: a.message
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
});
|
|
529
|
-
},
|
|
529
|
+
}, Wc = () => {
|
|
530
530
|
const e = ue(), t = Pe(), s = Z();
|
|
531
531
|
return ke({
|
|
532
532
|
mutationFn: async (a) => s(e, { action: G.UPDATE_WEBSITE_DATA, data: a }),
|
|
533
533
|
onSuccess: () => {
|
|
534
534
|
t.invalidateQueries({
|
|
535
535
|
queryKey: [G.GET_WEBSITE_DATA]
|
|
536
|
-
}),
|
|
536
|
+
}), H.success("Website data updated successfully.");
|
|
537
537
|
},
|
|
538
538
|
onError: (a) => {
|
|
539
|
-
|
|
539
|
+
H.error("Failed to update website data", {
|
|
540
540
|
description: a.message
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
});
|
|
544
544
|
};
|
|
545
|
-
function
|
|
545
|
+
function He() {
|
|
546
546
|
const [e, t] = S(
|
|
547
547
|
new URLSearchParams(window.location.search)
|
|
548
548
|
);
|
|
@@ -555,16 +555,16 @@ function We() {
|
|
|
555
555
|
};
|
|
556
556
|
}, []), [e, t];
|
|
557
557
|
}
|
|
558
|
-
const Qc = vt({}),
|
|
559
|
-
const [e] =
|
|
558
|
+
const Qc = vt({}), Fi = () => Ue(Qc), Jc = () => {
|
|
559
|
+
const [e] = He(), t = e.get("page"), s = tt(""), { mutate: a } = Bi();
|
|
560
560
|
le(() => {
|
|
561
561
|
!Y(s.current) && t !== s.current && a({ id: s.current }), s.current = t;
|
|
562
562
|
}, [t, a, s]);
|
|
563
|
-
},
|
|
564
|
-
const [s] =
|
|
565
|
-
return
|
|
566
|
-
}, ue = () =>
|
|
567
|
-
const t = ue(), [s] =
|
|
563
|
+
}, ct = (e, t) => {
|
|
564
|
+
const [s] = Fi();
|
|
565
|
+
return W(() => $(s, e, t), [s, e, t]);
|
|
566
|
+
}, ue = () => ct("apiUrl", "/chai/api"), ia = () => ct("usersApiUrl", "/chai/users"), ps = () => ct("assetsApiUrl", "/chai/assets"), Yc = () => ct("supabaseInstance", null), pt = (e) => {
|
|
567
|
+
const t = ue(), [s] = He(), a = e ?? s.get("page"), r = Z();
|
|
568
568
|
return De({
|
|
569
569
|
queryKey: [G.GET_LANGUAGE_PAGES, a],
|
|
570
570
|
initialData: [],
|
|
@@ -574,7 +574,7 @@ const Qc = vt({}), Mi = () => Ue(Qc), Jc = () => {
|
|
|
574
574
|
action: G.GET_LANGUAGE_PAGES,
|
|
575
575
|
data: { id: a }
|
|
576
576
|
});
|
|
577
|
-
return
|
|
577
|
+
return to(no(i, "primaryPage"));
|
|
578
578
|
},
|
|
579
579
|
enabled: !!a
|
|
580
580
|
});
|
|
@@ -592,10 +592,10 @@ const Qc = vt({}), Mi = () => Ue(Qc), Jc = () => {
|
|
|
592
592
|
data: { draft: !0 }
|
|
593
593
|
})
|
|
594
594
|
});
|
|
595
|
-
},
|
|
596
|
-
const { fallbackLang: t } = Fe(), { data: s } = St(), { data: a, isFetching: r } = pt(), i =
|
|
595
|
+
}, $i = (e) => {
|
|
596
|
+
const { fallbackLang: t } = Fe(), { data: s } = St(), { data: a, isFetching: r } = pt(), i = W(() => {
|
|
597
597
|
const l = { [t]: !0 };
|
|
598
|
-
return
|
|
598
|
+
return so($(s, "languages"), (o) => {
|
|
599
599
|
const d = ve(a, { lang: o });
|
|
600
600
|
l[o] = !!d;
|
|
601
601
|
}), l;
|
|
@@ -616,8 +616,8 @@ const Qc = vt({}), Mi = () => Ue(Qc), Jc = () => {
|
|
|
616
616
|
), aiContext: t };
|
|
617
617
|
}, Xc = vt(
|
|
618
618
|
null
|
|
619
|
-
),
|
|
620
|
-
const [e] =
|
|
619
|
+
), qi = () => Ue(Xc), tr = () => {
|
|
620
|
+
const [e] = qi();
|
|
621
621
|
return (e == null ? void 0 : e.slug) || "";
|
|
622
622
|
};
|
|
623
623
|
function Zc(e, t) {
|
|
@@ -628,7 +628,7 @@ function Zc(e, t) {
|
|
|
628
628
|
}, [e, t]), s;
|
|
629
629
|
}
|
|
630
630
|
const ed = ({ query: e, uuid: t }) => {
|
|
631
|
-
const { selectedLang: s, fallbackLang: a } = Fe(), { data: r } =
|
|
631
|
+
const { selectedLang: s, fallbackLang: a } = Fe(), { data: r } = We(), i = r == null ? void 0 : r.pageType, l = ue(), o = Z(), { data: d, isFetching: h } = De({
|
|
632
632
|
queryKey: [G.GET_DYNAMIC_PAGES, e, i, t],
|
|
633
633
|
initialData: [],
|
|
634
634
|
queryFn: async () => await o(l, {
|
|
@@ -636,10 +636,10 @@ const ed = ({ query: e, uuid: t }) => {
|
|
|
636
636
|
data: { query: e, pageType: i, uuid: t }
|
|
637
637
|
}) || [],
|
|
638
638
|
enabled: !!i
|
|
639
|
-
}), u =
|
|
639
|
+
}), u = W(() => s === "" ? d.filter((m) => m.lang === "" || m.lang === a) : d.filter((m) => m.lang === s), [s, a, d]);
|
|
640
640
|
return { allLangPages: d, data: u, isFetching: h };
|
|
641
|
-
},
|
|
642
|
-
const { selectedLang: e, fallbackLang: t } = Fe(), [s, a] =
|
|
641
|
+
}, ji = () => {
|
|
642
|
+
const { selectedLang: e, fallbackLang: t } = Fe(), [s, a] = qi(), [r, i] = S(""), l = Zc(r, 500), { allLangPages: o, data: d, isFetching: h } = ed({ query: l }), u = ae((g) => a(g), [a]), m = ae((g) => i(g), [i]), y = ae(() => {
|
|
643
643
|
if (!s) return;
|
|
644
644
|
const g = !(s != null && s.primaryPage), p = e.length === 0, f = g ? s == null ? void 0 : s.id : s == null ? void 0 : s.primaryPage, x = o.filter(
|
|
645
645
|
(N) => (N == null ? void 0 : N.primaryPage) === f || N.id === f
|
|
@@ -659,7 +659,7 @@ const ed = ({ query: e, uuid: t }) => {
|
|
|
659
659
|
};
|
|
660
660
|
}, Rt = () => {
|
|
661
661
|
const { data: e } = St();
|
|
662
|
-
return
|
|
662
|
+
return W(
|
|
663
663
|
() => (e == null ? void 0 : e.fallbackLang) || "en",
|
|
664
664
|
[e]
|
|
665
665
|
);
|
|
@@ -687,15 +687,15 @@ const ed = ({ query: e, uuid: t }) => {
|
|
|
687
687
|
},
|
|
688
688
|
placeholderData: (r) => r || {}
|
|
689
689
|
});
|
|
690
|
-
}, nd = vt({ lastSaved: void 0 }), la = () => Ue(nd),
|
|
691
|
-
const [e] =
|
|
692
|
-
return { data:
|
|
690
|
+
}, nd = vt({ lastSaved: void 0 }), la = () => Ue(nd), We = () => {
|
|
691
|
+
const [e] = He(), t = e.get("page"), [s] = zi(), { data: a, isFetching: r } = On();
|
|
692
|
+
return { data: W(() => ({ ...ve(a, { id: t }) || {}, metadata: s }), [a, t, s]), isFetching: r };
|
|
693
693
|
}, Gt = () => {
|
|
694
|
-
const [e] =
|
|
695
|
-
return { data:
|
|
696
|
-
}, sd = vt({}),
|
|
697
|
-
const { data: e } = Gt(), t = tr(), s = e == null ? void 0 : e.slug,
|
|
698
|
-
return t ?
|
|
694
|
+
const [e] = He(), t = e.get("lang") ?? "", { data: s, isFetching: a } = pt();
|
|
695
|
+
return { data: W(() => ve(s, { lang: t }) || {}, [s, t]), isFetching: a };
|
|
696
|
+
}, sd = vt({}), zi = () => Ue(sd), Vi = () => {
|
|
697
|
+
const { data: e } = Gt(), t = tr(), s = ct("getLiveUrl", Kr), a = e == null ? void 0 : e.slug, r = s(a || "/");
|
|
698
|
+
return t ? r + t : r;
|
|
699
699
|
};
|
|
700
700
|
class ad {
|
|
701
701
|
constructor(t, s, a, r) {
|
|
@@ -741,10 +741,10 @@ class ad {
|
|
|
741
741
|
return t.length > 0 ? t[0] : null;
|
|
742
742
|
}
|
|
743
743
|
getPageUserMapping() {
|
|
744
|
-
const t = this.getOnlineUsers({}), s =
|
|
744
|
+
const t = this.getOnlineUsers({}), s = Hr(t, "pageId"), a = {};
|
|
745
745
|
return Object.keys(s).forEach((r) => {
|
|
746
746
|
var l;
|
|
747
|
-
const i = (l =
|
|
747
|
+
const i = (l = ao(s[r], "onlineAt")) == null ? void 0 : l.userId;
|
|
748
748
|
i !== this.userId && (a[r] = i);
|
|
749
749
|
}), a;
|
|
750
750
|
}
|
|
@@ -823,9 +823,9 @@ const At = (e) => {
|
|
|
823
823
|
isTakeOverRequested: !1,
|
|
824
824
|
requestingClientId: "",
|
|
825
825
|
isActiveInOtherTab: !1
|
|
826
|
-
}), ld = vt(""), od = vt(null), nr = vt({}),
|
|
827
|
-
const [e] =
|
|
828
|
-
return
|
|
826
|
+
}), ld = vt(""), od = vt(null), nr = vt({}), Ki = () => Ue(nr), Tt = () => {
|
|
827
|
+
const [e] = He(), t = e.get("page"), { user: s } = ot(), [a, r] = Ue(rd), [i, l] = Ue(id), [o, d] = Ue(od), [h, u] = Ue(ld), [m] = Ue(nr);
|
|
828
|
+
return W(() => ({
|
|
829
829
|
pageLock: i,
|
|
830
830
|
pageToUser: m,
|
|
831
831
|
lockingStatus: h,
|
|
@@ -851,7 +851,7 @@ const At = (e) => {
|
|
|
851
851
|
m
|
|
852
852
|
]);
|
|
853
853
|
}, cd = () => {
|
|
854
|
-
const e = Yc(), { data: t } =
|
|
854
|
+
const e = Yc(), { data: t } = We(), { user: s } = ot(), a = t == null ? void 0 : t.id, { data: r } = St(), { pageLock: i, setPageLock: l, setLockingStatus: o, realtimeInstance: d, setRealtimeInstance: h } = Tt(), [, u] = Ue(nr), m = tt(!1), y = tt(i), g = tt(!1);
|
|
855
855
|
return le(() => {
|
|
856
856
|
if (s != null && s.id && e && !d && (r != null && r.appKey) && !g.current) {
|
|
857
857
|
g.current = !0;
|
|
@@ -915,7 +915,7 @@ const At = (e) => {
|
|
|
915
915
|
* - update state for editing page
|
|
916
916
|
*/
|
|
917
917
|
case "TAKE_OVER_REQUEST_ACCEPTED":
|
|
918
|
-
x != null && x.isTakingOverFromAnotherTab || (o("take_over_request_accepted"),
|
|
918
|
+
x != null && x.isTakingOverFromAnotherTab || (o("take_over_request_accepted"), H.success("Your Page Take Over Request Accepted", { position: "top-center" })), l({
|
|
919
919
|
...y == null ? void 0 : y.current,
|
|
920
920
|
status: "checking",
|
|
921
921
|
requestedBy: "",
|
|
@@ -957,8 +957,8 @@ const At = (e) => {
|
|
|
957
957
|
}, o(""), l(y.current), d == null || d.leavePage());
|
|
958
958
|
};
|
|
959
959
|
}, [a, d]), i == null ? void 0 : i.status;
|
|
960
|
-
},
|
|
961
|
-
const { data: e } =
|
|
960
|
+
}, Hi = () => {
|
|
961
|
+
const { data: e } = We(), { user: t } = ot(), s = e == null ? void 0 : e.id, { pageLock: a, setPageLock: r, realtimeInstance: i } = Tt(), { savePageAsync: l } = Wt(), o = ae(() => {
|
|
962
962
|
!i || !s || !(t != null && t.id) || (r({ ...a, isTakeOverRequested: !0 }), i == null || i.sendEvent("TAKE_OVER_REQUESTED"));
|
|
963
963
|
}, [i, s, t == null ? void 0 : t.id, r, a]), d = ae(async () => {
|
|
964
964
|
!i || !s || !(t != null && t.id) || (await l(), i == null || i.sendEvent("TAKE_OVER_REQUEST_ACCEPTED", {
|
|
@@ -989,7 +989,7 @@ const At = (e) => {
|
|
|
989
989
|
requestTakeOver: o
|
|
990
990
|
};
|
|
991
991
|
}, Wi = () => {
|
|
992
|
-
const [e] =
|
|
992
|
+
const [e] = He(), t = e.get("page"), s = ue(), { setAiContext: a } = er(), { setCurrentEditor: r } = Tt(), [, i] = la(), [, l] = zi(), [, o] = Ao(), d = Z();
|
|
993
993
|
return De({
|
|
994
994
|
queryKey: [G.GET_DRAFT_PAGE, t],
|
|
995
995
|
staleTime: 1 / 0,
|
|
@@ -1006,8 +1006,8 @@ const At = (e) => {
|
|
|
1006
1006
|
},
|
|
1007
1007
|
enabled: !!t
|
|
1008
1008
|
});
|
|
1009
|
-
},
|
|
1010
|
-
const { data: e } =
|
|
1009
|
+
}, Qi = () => {
|
|
1010
|
+
const { data: e } = We(), { data: t } = Gt(), s = ue(), a = Z(), r = Rt(), i = tr();
|
|
1011
1011
|
return De({
|
|
1012
1012
|
queryKey: [G.GET_BUILDER_PAGE_DATA, t == null ? void 0 : t.id, i],
|
|
1013
1013
|
initialData: {},
|
|
@@ -1034,7 +1034,7 @@ const At = (e) => {
|
|
|
1034
1034
|
}),
|
|
1035
1035
|
enabled: !!(t != null && t.pageType)
|
|
1036
1036
|
});
|
|
1037
|
-
}, ys = ({ children: e }) => /* @__PURE__ */ n("div", { className: "fixed bottom-0 left-0 right-0 top-[50px] z-[20] flex w-screen flex-col items-center justify-center bg-black/20", children: e }),
|
|
1037
|
+
}, ys = ({ children: e }) => /* @__PURE__ */ n("div", { className: "fixed bottom-0 left-0 right-0 top-[50px] z-[20] flex w-screen flex-col items-center justify-center bg-black/20", children: e }), Ji = ({ fullScreen: e = !0 }) => {
|
|
1038
1038
|
const t = /* @__PURE__ */ c("div", { className: "flex flex-row gap-2", children: [
|
|
1039
1039
|
/* @__PURE__ */ n("div", { className: "h-4 w-4 animate-bounce rounded-full bg-purple-500" }),
|
|
1040
1040
|
/* @__PURE__ */ n("div", { className: "h-4 w-4 animate-bounce rounded-full bg-cyan-500 [animation-delay:-.3s]" }),
|
|
@@ -1044,7 +1044,7 @@ const At = (e) => {
|
|
|
1044
1044
|
}, dd = ({ currentEditor: e }) => {
|
|
1045
1045
|
const { user: t } = ot(), { data: s } = At(e);
|
|
1046
1046
|
return !s || !e || e === (t == null ? void 0 : t.id) ? null : /* @__PURE__ */ n("span", { className: "ml-2 flex items-center gap-1 text-xs font-light text-gray-500", children: /* @__PURE__ */ c(Xe, { children: [
|
|
1047
|
-
/* @__PURE__ */ n(Ze, { children: /* @__PURE__ */ n(
|
|
1047
|
+
/* @__PURE__ */ n(Ze, { children: /* @__PURE__ */ n(wi, { className: "h-3 w-3" }) }),
|
|
1048
1048
|
/* @__PURE__ */ n(et, { children: /* @__PURE__ */ c("p", { children: [
|
|
1049
1049
|
s.name,
|
|
1050
1050
|
" is editing"
|
|
@@ -1084,7 +1084,7 @@ function hd({
|
|
|
1084
1084
|
a && !o ? /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: [
|
|
1085
1085
|
"Last saved:",
|
|
1086
1086
|
" ",
|
|
1087
|
-
|
|
1087
|
+
xi(new Date(a), {
|
|
1088
1088
|
addSuffix: !0
|
|
1089
1089
|
})
|
|
1090
1090
|
] }) : /* @__PURE__ */ n(Mt, { className: "h-4 w-40 rounded" })
|
|
@@ -1112,15 +1112,15 @@ function hd({
|
|
|
1112
1112
|
/* @__PURE__ */ n(Zs, { children: i ? /* @__PURE__ */ c(T, { disabled: d, onClick: y, className: "w-full", variant: "destructive", children: [
|
|
1113
1113
|
/* @__PURE__ */ n(Zo, { className: "h-5 w-5" }),
|
|
1114
1114
|
d ? "Page take is requested." : l ? "Request take over again" : "Request take over"
|
|
1115
|
-
] }) : /* @__PURE__ */ c(
|
|
1116
|
-
/* @__PURE__ */ n(
|
|
1115
|
+
] }) : /* @__PURE__ */ c(ei, { open: u, onOpenChange: m, children: [
|
|
1116
|
+
/* @__PURE__ */ n(ti, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "flex flex-col items-center", children: [
|
|
1117
1117
|
/* @__PURE__ */ n(T, { className: "w-full", variant: "destructive", children: "Take over" }),
|
|
1118
1118
|
/* @__PURE__ */ n("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." })
|
|
1119
1119
|
] }) }),
|
|
1120
|
-
/* @__PURE__ */ c(
|
|
1121
|
-
/* @__PURE__ */ c(
|
|
1122
|
-
/* @__PURE__ */ n(
|
|
1123
|
-
/* @__PURE__ */ c(
|
|
1120
|
+
/* @__PURE__ */ c(ni, { className: "z-[99]", children: [
|
|
1121
|
+
/* @__PURE__ */ c(si, { children: [
|
|
1122
|
+
/* @__PURE__ */ n(ai, { children: "Are you sure you want to take over?" }),
|
|
1123
|
+
/* @__PURE__ */ c(ri, { children: [
|
|
1124
1124
|
/* @__PURE__ */ c("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
|
|
1125
1125
|
/* @__PURE__ */ n(ec, { className: "h-5 w-5" }),
|
|
1126
1126
|
/* @__PURE__ */ n("span", { children: "This action might cause the other user to lose unsaved changes." })
|
|
@@ -1133,9 +1133,9 @@ function hd({
|
|
|
1133
1133
|
] })
|
|
1134
1134
|
] })
|
|
1135
1135
|
] }),
|
|
1136
|
-
/* @__PURE__ */ c(
|
|
1137
|
-
/* @__PURE__ */ n(
|
|
1138
|
-
/* @__PURE__ */ n(
|
|
1136
|
+
/* @__PURE__ */ c(ii, { children: [
|
|
1137
|
+
/* @__PURE__ */ n(li, { children: "Cancel" }),
|
|
1138
|
+
/* @__PURE__ */ n(oi, { onClick: y, children: "Yes, Take Over" })
|
|
1139
1139
|
] })
|
|
1140
1140
|
] })
|
|
1141
1141
|
] }) })
|
|
@@ -1146,16 +1146,16 @@ const Cs = ({
|
|
|
1146
1146
|
lockingStatus: t,
|
|
1147
1147
|
onContinue: s
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const [a, r] = S(!1), i = t === "page_is_active_in_other_tab", l = (t == null ? void 0 : t.length) > 0, { pageLock: o, acceptTakeOver: d, rejectTakeOver: h } =
|
|
1149
|
+
const [a, r] = S(!1), i = t === "page_is_active_in_other_tab", l = (t == null ? void 0 : t.length) > 0, { pageLock: o, acceptTakeOver: d, rejectTakeOver: h } = Hi(), u = () => {
|
|
1150
1150
|
r(!0), l || i ? s() : d(), setTimeout(() => {
|
|
1151
1151
|
r(!1);
|
|
1152
1152
|
}, 3e3);
|
|
1153
1153
|
};
|
|
1154
1154
|
return le(() => {
|
|
1155
1155
|
(o == null ? void 0 : o.requestedBy) === "ANOTHER_TAB" && d();
|
|
1156
|
-
}, [o, d]), (o == null ? void 0 : o.requestedBy) === "ANOTHER_TAB" ? null : e ? /* @__PURE__ */ n(
|
|
1156
|
+
}, [o, d]), (o == null ? void 0 : o.requestedBy) === "ANOTHER_TAB" ? null : e ? /* @__PURE__ */ n(Ji, {}) : /* @__PURE__ */ n(ys, { children: /* @__PURE__ */ c(Qs, { className: "mx-auto w-full max-w-md", children: [
|
|
1157
1157
|
/* @__PURE__ */ n(Js, { className: "space-y-1", children: /* @__PURE__ */ c(Ys, { className: "flex items-center gap-2 text-xl font-medium", children: [
|
|
1158
|
-
a ? /* @__PURE__ */ n(wt, { className: "h-6 w-6 animate-spin text-gray-500" }) : i ? /* @__PURE__ */ n(tc, { className: "h-6 w-6 text-green-500" }) : l ? /* @__PURE__ */ n(
|
|
1158
|
+
a ? /* @__PURE__ */ n(wt, { className: "h-6 w-6 animate-spin text-gray-500" }) : i ? /* @__PURE__ */ n(tc, { className: "h-6 w-6 text-green-500" }) : l ? /* @__PURE__ */ n(Ni, { className: "h-6 w-6 text-green-500" }) : /* @__PURE__ */ n(nc, { className: "h-6 w-6 text-green-500" }),
|
|
1159
1159
|
i ? "Page is active in other tab" : l ? "You can edit the page now." : "Page take over request"
|
|
1160
1160
|
] }) }),
|
|
1161
1161
|
/* @__PURE__ */ n(Xs, { className: "grid gap-4", children: /* @__PURE__ */ n("div", { children: i ? /* @__PURE__ */ n("p", { children: 'You are already editing this page in another tab. To continue editing here, click on "Continue editing here".' }) : l ? /* @__PURE__ */ n("p", { children: "This page is released by other user you can continue editing now." }) : /* @__PURE__ */ c("p", { children: [
|
|
@@ -1176,10 +1176,10 @@ const Cs = ({
|
|
|
1176
1176
|
onClick: u,
|
|
1177
1177
|
className: l ? "" : "bg-green-500 hover:bg-green-600",
|
|
1178
1178
|
children: i ? /* @__PURE__ */ c(de, { children: [
|
|
1179
|
-
/* @__PURE__ */ n(
|
|
1179
|
+
/* @__PURE__ */ n(Wn, { className: "h-5 w-5" }),
|
|
1180
1180
|
" Continue editing here"
|
|
1181
1181
|
] }) : l ? /* @__PURE__ */ c(de, { children: [
|
|
1182
|
-
/* @__PURE__ */ n(
|
|
1182
|
+
/* @__PURE__ */ n(Wn, { className: "h-5 w-5" }),
|
|
1183
1183
|
" Continue to edit"
|
|
1184
1184
|
] }) : /* @__PURE__ */ c(de, { children: [
|
|
1185
1185
|
/* @__PURE__ */ n(it, { className: "h-5 w-5" }),
|
|
@@ -1194,7 +1194,7 @@ const Cs = ({
|
|
|
1194
1194
|
] })
|
|
1195
1195
|
] }) });
|
|
1196
1196
|
}, md = () => {
|
|
1197
|
-
const { pageLock: e, requestTakeOver: t } =
|
|
1197
|
+
const { pageLock: e, requestTakeOver: t } = Hi(), { isLocked: s, currentEditor: a, lockingStatus: r, setLockingStatus: i, realtimePageLockEnabled: l } = Tt(), { data: o, isFetching: d } = At(a), [h] = He(), u = h.get("page"), { mutate: m } = Bi(), { isFetching: y } = Wi(), [g] = la(), p = Pe(), f = ae(() => {
|
|
1198
1198
|
l ? t() : m({ id: u });
|
|
1199
1199
|
}, [u, m, t, l]);
|
|
1200
1200
|
return u ? l && (e == null ? void 0 : e.status) === "checking" ? /* @__PURE__ */ n(Cs, { isChecking: !0, lockingStatus: "", onContinue: () => {
|
|
@@ -1223,7 +1223,7 @@ const Cs = ({
|
|
|
1223
1223
|
}
|
|
1224
1224
|
) : null;
|
|
1225
1225
|
}, fd = () => {
|
|
1226
|
-
const [e, t] =
|
|
1226
|
+
const [e, t] = He(), s = e.get("lang"), a = $i(s), { setSelectedLang: r } = Fe(), i = () => {
|
|
1227
1227
|
const o = new URLSearchParams(window.location.search);
|
|
1228
1228
|
o.delete("lang");
|
|
1229
1229
|
const d = o.toString(), h = `${window.location.pathname}${d ? `?${d}` : ""}`;
|
|
@@ -1233,7 +1233,7 @@ const Cs = ({
|
|
|
1233
1233
|
const l = $(Le, s);
|
|
1234
1234
|
return /* @__PURE__ */ n(ys, { children: /* @__PURE__ */ c(Qs, { className: "mx-auto w-full max-w-md", children: [
|
|
1235
1235
|
/* @__PURE__ */ n(Js, { className: "space-y-1", children: /* @__PURE__ */ c(Ys, { className: "flex items-center gap-2 text-2xl", children: [
|
|
1236
|
-
/* @__PURE__ */ n(
|
|
1236
|
+
/* @__PURE__ */ n(wi, { className: "h-6 w-6 text-yellow-500" }),
|
|
1237
1237
|
'Page missing for "',
|
|
1238
1238
|
l,
|
|
1239
1239
|
'" language.'
|
|
@@ -1258,7 +1258,7 @@ const Cs = ({
|
|
|
1258
1258
|
e(a);
|
|
1259
1259
|
},
|
|
1260
1260
|
onError: (a) => {
|
|
1261
|
-
console.error("Error saving block:", a),
|
|
1261
|
+
console.error("Error saving block:", a), H.error("Failed to save block", {
|
|
1262
1262
|
description: a instanceof Error ? a.message : "Unknown error"
|
|
1263
1263
|
});
|
|
1264
1264
|
}
|
|
@@ -1293,7 +1293,7 @@ const Cs = ({
|
|
|
1293
1293
|
e();
|
|
1294
1294
|
},
|
|
1295
1295
|
onError: (a) => {
|
|
1296
|
-
console.error("Error deleting block:", a),
|
|
1296
|
+
console.error("Error deleting block:", a), H.error("Failed to delete block", {
|
|
1297
1297
|
description: a instanceof Error ? a.message : "Unknown error"
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
@@ -1306,8 +1306,8 @@ const Cs = ({
|
|
|
1306
1306
|
blockName: r,
|
|
1307
1307
|
trigger: i
|
|
1308
1308
|
}) => {
|
|
1309
|
-
const [l, o] = S(!1), d =
|
|
1310
|
-
d([e], { _libBlockId: void 0 }),
|
|
1309
|
+
const [l, o] = S(!1), d = Zr(), h = yd(() => {
|
|
1310
|
+
d([e], { _libBlockId: void 0 }), H.success("Block deleted successfully"), o(!1), a();
|
|
1311
1311
|
});
|
|
1312
1312
|
return /* @__PURE__ */ c(Nn, { open: s, onOpenChange: (y) => !y && a(), children: [
|
|
1313
1313
|
/* @__PURE__ */ n(En, { asChild: !0, children: i || /* @__PURE__ */ c(
|
|
@@ -1436,10 +1436,10 @@ const Cs = ({
|
|
|
1436
1436
|
onSuccess: () => {
|
|
1437
1437
|
s.invalidateQueries({
|
|
1438
1438
|
queryKey: ["library-groups"]
|
|
1439
|
-
}),
|
|
1439
|
+
}), H.success("Group created successfully");
|
|
1440
1440
|
},
|
|
1441
1441
|
onError: (d) => {
|
|
1442
|
-
console.error("Error creating group:", d),
|
|
1442
|
+
console.error("Error creating group:", d), H.error("Failed to create group", {
|
|
1443
1443
|
description: d instanceof Error ? d.message : "Unknown error"
|
|
1444
1444
|
});
|
|
1445
1445
|
}
|
|
@@ -1480,7 +1480,7 @@ const Cs = ({
|
|
|
1480
1480
|
{ id: "stats", name: "Stats" },
|
|
1481
1481
|
{ id: "team", name: "Team" },
|
|
1482
1482
|
{ id: "timeline", name: "Timeline" }
|
|
1483
|
-
]), u =
|
|
1483
|
+
]), u = W(
|
|
1484
1484
|
() => [
|
|
1485
1485
|
...o,
|
|
1486
1486
|
...d.filter(
|
|
@@ -1559,7 +1559,7 @@ function Oa(e) {
|
|
|
1559
1559
|
const t = isNaN(e) ? 0 : typeof e == "number" ? e : parseInt(e);
|
|
1560
1560
|
return t ? t < 1024 ? `${t.toFixed(2)} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(2)} KB` : `${(t / (1024 * 1024)).toFixed(2)} MB` : "0 B";
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function Yi(e) {
|
|
1563
1563
|
return new Promise((t, s) => {
|
|
1564
1564
|
if (e.size <= Nr) {
|
|
1565
1565
|
t(e);
|
|
@@ -1578,7 +1578,7 @@ function Ji(e) {
|
|
|
1578
1578
|
t(a);
|
|
1579
1579
|
},
|
|
1580
1580
|
error(a) {
|
|
1581
|
-
|
|
1581
|
+
H.error(
|
|
1582
1582
|
`Failed to compress image. Image size is ${Oa(e.size)}, which exceeds the maximum allowed size of ${Oa(Nd)}.`
|
|
1583
1583
|
), s(a);
|
|
1584
1584
|
}
|
|
@@ -1594,13 +1594,13 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1594
1594
|
try {
|
|
1595
1595
|
a(!0);
|
|
1596
1596
|
let m = h;
|
|
1597
|
-
h.type.startsWith("image/") && (m = await
|
|
1597
|
+
h.type.startsWith("image/") && (m = await Yi(h));
|
|
1598
1598
|
const y = new FileReader();
|
|
1599
1599
|
y.onloadend = () => {
|
|
1600
1600
|
t(y.result), a(!1);
|
|
1601
1601
|
}, y.readAsDataURL(m);
|
|
1602
1602
|
} catch (m) {
|
|
1603
|
-
console.error("Error reading file:", m), a(!1),
|
|
1603
|
+
console.error("Error reading file:", m), a(!1), H.error("Failed to process image", {
|
|
1604
1604
|
description: m instanceof Error ? m.message : "Unknown error"
|
|
1605
1605
|
});
|
|
1606
1606
|
}
|
|
@@ -1664,9 +1664,9 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1664
1664
|
EDIT_MEDIA: "edit_media",
|
|
1665
1665
|
DELETE_MEDIA: "delete_media"
|
|
1666
1666
|
}, Sd = (e) => {
|
|
1667
|
-
const { blocks: t, close: s, blockId: a } = e, { getPartailBlocks: r } = Co(), i = t.find((E) => E._id === a), l = i == null ? void 0 : i._libBlockId, o = !!l, d =
|
|
1667
|
+
const { blocks: t, close: s, blockId: a } = e, { getPartailBlocks: r } = Co(), i = t.find((E) => E._id === a), l = i == null ? void 0 : i._libBlockId, o = !!l, d = W(() => t.some(
|
|
1668
1668
|
(E) => E._type === "PartialBlock" || E._type === "GlobalBlock"
|
|
1669
|
-
), [t]), h =
|
|
1669
|
+
), [t]), h = W(() => {
|
|
1670
1670
|
let E = [];
|
|
1671
1671
|
for (const R of t)
|
|
1672
1672
|
if (R._type === "PartialBlock" || R._type === "GlobalBlock") {
|
|
@@ -1675,8 +1675,8 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1675
1675
|
} else
|
|
1676
1676
|
E.push(R);
|
|
1677
1677
|
return E;
|
|
1678
|
-
}, [t, r]), [u, m] = S(""), [y, g] = S(""), [p, f] = S(""), [v, x] = S(""), [N, I] = S({}), [L, C] = S(!1), [P, U] = S(o), [J, ee] = S(!1), { hasPermission: D } = Pn(), F = D(Te.DELETE_LIBRARY_BLOCK), M =
|
|
1679
|
-
M([a], { _libBlockId: void 0 }),
|
|
1678
|
+
}, [t, r]), [u, m] = S(""), [y, g] = S(""), [p, f] = S(""), [v, x] = S(""), [N, I] = S({}), [L, C] = S(!1), [P, U] = S(o), [J, ee] = S(!1), { hasPermission: D } = Pn(), F = D(Te.DELETE_LIBRARY_BLOCK), M = Zr(), q = () => {
|
|
1679
|
+
M([a], { _libBlockId: void 0 }), H.success("Block delinked from library"), s();
|
|
1680
1680
|
}, {
|
|
1681
1681
|
data: B,
|
|
1682
1682
|
isLoading: K,
|
|
@@ -1695,7 +1695,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1695
1695
|
return u.trim() ? u.length < 2 && (E.name = "Name must be at least 2 characters") : E.name = "Name is required", y || (E.group = "Group is required"), I(E), Object.keys(E).length === 0;
|
|
1696
1696
|
}, { resetLibrary: Oe } = ko({ id: "" }), me = gd(
|
|
1697
1697
|
(E) => {
|
|
1698
|
-
o || M([a], { _libBlockId: E.id }),
|
|
1698
|
+
o || M([a], { _libBlockId: E.id }), H.success(`Block ${o ? "updated" : "saved"} successfully`), Oe(E.library), s();
|
|
1699
1699
|
}
|
|
1700
1700
|
), w = async (E) => {
|
|
1701
1701
|
if (E.preventDefault(), !Ae()) return;
|
|
@@ -1860,9 +1860,9 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1860
1860
|
initialData: [],
|
|
1861
1861
|
queryFn: async () => t(e, { action: G.GET_PAGE_TYPES })
|
|
1862
1862
|
});
|
|
1863
|
-
},
|
|
1863
|
+
}, Xi = (e) => {
|
|
1864
1864
|
const { data: t } = Ge();
|
|
1865
|
-
return
|
|
1865
|
+
return W(() => t == null ? void 0 : t.find((s) => s.key === e), [t, e]);
|
|
1866
1866
|
}, Td = () => {
|
|
1867
1867
|
const e = ue(), t = Z();
|
|
1868
1868
|
return ke({
|
|
@@ -1880,7 +1880,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
1882
|
});
|
|
1883
|
-
},
|
|
1883
|
+
}, Zi = () => {
|
|
1884
1884
|
const e = ue(), t = Pe(), s = Z(), { data: a } = Ge();
|
|
1885
1885
|
return ke({
|
|
1886
1886
|
mutationFn: async (r) => await s(e, {
|
|
@@ -1897,11 +1897,11 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1897
1897
|
queryKey: [G.GET_WEBSITE_PAGES]
|
|
1898
1898
|
});
|
|
1899
1899
|
const l = i.template ? `Page created from "${i.template.name}" template` : i.hasSlug === !1 ? "New " + ((o = ve(a, { key: i.pageType })) == null ? void 0 : o.name) + " added successfully" : "New page added successfully";
|
|
1900
|
-
|
|
1900
|
+
H.success(l);
|
|
1901
1901
|
},
|
|
1902
1902
|
onError: (r, i) => {
|
|
1903
1903
|
const l = ve(a, { key: i.pageType });
|
|
1904
|
-
|
|
1904
|
+
H.error(`Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`, {
|
|
1905
1905
|
description: $(Ad, r.message, r.message)
|
|
1906
1906
|
});
|
|
1907
1907
|
}
|
|
@@ -1926,7 +1926,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1926
1926
|
},
|
|
1927
1927
|
onError: (i, l) => {
|
|
1928
1928
|
const o = ve(r, { key: l.pageType });
|
|
1929
|
-
|
|
1929
|
+
H.error(`Failed to update ${o != null && o.hasSlug ? "page" : o.name}.`, {
|
|
1930
1930
|
description: i.message
|
|
1931
1931
|
});
|
|
1932
1932
|
}
|
|
@@ -1940,7 +1940,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1940
1940
|
}),
|
|
1941
1941
|
onSuccess: (r, i) => {
|
|
1942
1942
|
if (r.code === "PAGE_LOCKED") {
|
|
1943
|
-
|
|
1943
|
+
H.error("Delete not allowed", {
|
|
1944
1944
|
description: "Page is currently being edited by another user."
|
|
1945
1945
|
});
|
|
1946
1946
|
return;
|
|
@@ -1955,7 +1955,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1955
1955
|
},
|
|
1956
1956
|
onError: (r, i) => {
|
|
1957
1957
|
const l = ve(a, { key: i.pageType });
|
|
1958
|
-
|
|
1958
|
+
H.error(`Failed to delete ${l != null && l.hasSlug ? "page" : l.name}.`, {
|
|
1959
1959
|
description: r.message
|
|
1960
1960
|
});
|
|
1961
1961
|
}
|
|
@@ -1974,19 +1974,19 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1974
1974
|
queryKey: [G.GET_WEBSITE_PAGES]
|
|
1975
1975
|
});
|
|
1976
1976
|
const l = ve(a, { key: i.pageType });
|
|
1977
|
-
|
|
1977
|
+
H.success(
|
|
1978
1978
|
l != null && l.hasSlug ? ce.PAGE_UNPUBLISH_SUCCESS : "New " + l.name + " added successfully."
|
|
1979
1979
|
);
|
|
1980
1980
|
},
|
|
1981
1981
|
onError: (r, i) => {
|
|
1982
1982
|
const l = ve(a, { key: i.pageType });
|
|
1983
|
-
|
|
1983
|
+
H.error(`Failed to take offline ${l != null && l.hasSlug ? "page" : l.name}.`, {
|
|
1984
1984
|
description: r.message
|
|
1985
1985
|
});
|
|
1986
1986
|
}
|
|
1987
1987
|
});
|
|
1988
1988
|
}, ar = () => {
|
|
1989
|
-
const e = ue(), t = Z(), s = Pe(), { data: a } =
|
|
1989
|
+
const e = ue(), t = Z(), s = Pe(), { data: a } = We(), { savePageAsync: r } = Wt();
|
|
1990
1990
|
return ke({
|
|
1991
1991
|
mutationFn: async ({ ids: i }) => (await r(), t(e, {
|
|
1992
1992
|
action: G.PUBLISH_CHANGES,
|
|
@@ -2002,7 +2002,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
2002
2002
|
});
|
|
2003
2003
|
},
|
|
2004
2004
|
onError: (i) => {
|
|
2005
|
-
console.log("##", i),
|
|
2005
|
+
console.log("##", i), H.error("Failed to publish pages.");
|
|
2006
2006
|
}
|
|
2007
2007
|
});
|
|
2008
2008
|
}, Pd = () => {
|
|
@@ -2024,10 +2024,10 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
2024
2024
|
onSuccess: () => {
|
|
2025
2025
|
s.invalidateQueries({
|
|
2026
2026
|
queryKey: [G.GET_WEBSITE_PAGES]
|
|
2027
|
-
}),
|
|
2027
|
+
}), H.success("Page marked as template successfully.");
|
|
2028
2028
|
},
|
|
2029
2029
|
onError: () => {
|
|
2030
|
-
|
|
2030
|
+
H.error("Failed to mark page as template.");
|
|
2031
2031
|
}
|
|
2032
2032
|
});
|
|
2033
2033
|
}, Id = () => {
|
|
@@ -2040,10 +2040,10 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
2040
2040
|
onSuccess: () => {
|
|
2041
2041
|
s.invalidateQueries({
|
|
2042
2042
|
queryKey: [G.GET_WEBSITE_PAGES]
|
|
2043
|
-
}),
|
|
2043
|
+
}), H.success("Page unmarked as template successfully.");
|
|
2044
2044
|
},
|
|
2045
2045
|
onError: () => {
|
|
2046
|
-
|
|
2046
|
+
H.error("Failed to unmark page as template.");
|
|
2047
2047
|
}
|
|
2048
2048
|
});
|
|
2049
2049
|
}, _d = () => {
|
|
@@ -2054,14 +2054,14 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
2054
2054
|
data: { id: a, slug: r }
|
|
2055
2055
|
}),
|
|
2056
2056
|
onSuccess: (a, { primaryPage: r }) => {
|
|
2057
|
-
|
|
2057
|
+
H.success(ce.SLUG_CHANGE_SUCCESS), r ? s.invalidateQueries({
|
|
2058
2058
|
queryKey: [G.GET_LANGUAGE_PAGES, r]
|
|
2059
2059
|
}) : s.invalidateQueries({
|
|
2060
2060
|
queryKey: [G.GET_WEBSITE_PAGES]
|
|
2061
2061
|
});
|
|
2062
2062
|
},
|
|
2063
2063
|
onError: () => {
|
|
2064
|
-
|
|
2064
|
+
H.error("Failed to change slug");
|
|
2065
2065
|
}
|
|
2066
2066
|
});
|
|
2067
2067
|
};
|
|
@@ -2491,7 +2491,7 @@ const Dd = {
|
|
|
2491
2491
|
const s = { ...Dd, ...t };
|
|
2492
2492
|
Ld(s);
|
|
2493
2493
|
}, Rd = () => {
|
|
2494
|
-
const [e] = Po(), { mutate: t, isPending: s } = ar(), { mutateAsync: a, isPending: r } =
|
|
2494
|
+
const [e] = Po(), { mutate: t, isPending: s } = ar(), { mutateAsync: a, isPending: r } = Mi();
|
|
2495
2495
|
return /* @__PURE__ */ c("div", { className: "flex items-center justify-center gap-x-3 border-t bg-white py-3", children: [
|
|
2496
2496
|
/* @__PURE__ */ n(T, { size: "sm", variant: "outline", disabled: s || r, onClick: () => {
|
|
2497
2497
|
a({ settings: { theme: e } });
|
|
@@ -2584,7 +2584,7 @@ function ir({
|
|
|
2584
2584
|
] }) })
|
|
2585
2585
|
] });
|
|
2586
2586
|
}
|
|
2587
|
-
const
|
|
2587
|
+
const el = ({
|
|
2588
2588
|
edit: e,
|
|
2589
2589
|
lang: t,
|
|
2590
2590
|
languages: s,
|
|
@@ -2610,7 +2610,7 @@ const Zi = ({
|
|
|
2610
2610
|
]
|
|
2611
2611
|
}
|
|
2612
2612
|
)
|
|
2613
|
-
] }),
|
|
2613
|
+
] }), tl = ({ lang: e, name: t, setName: s, parentHasSelectedLanguagePage: a }) => /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
2614
2614
|
/* @__PURE__ */ n(he, { htmlFor: "name", children: ce.PAGE_NAME }),
|
|
2615
2615
|
/* @__PURE__ */ n(
|
|
2616
2616
|
xe,
|
|
@@ -2671,7 +2671,7 @@ const Zi = ({
|
|
|
2671
2671
|
fullSlug: y()
|
|
2672
2672
|
}
|
|
2673
2673
|
)
|
|
2674
|
-
] }),
|
|
2674
|
+
] }), nl = ({
|
|
2675
2675
|
parentHasSelectedLanguagePage: e,
|
|
2676
2676
|
name: t,
|
|
2677
2677
|
lang: s,
|
|
@@ -2687,7 +2687,7 @@ const Zi = ({
|
|
|
2687
2687
|
isPending: y
|
|
2688
2688
|
}) => {
|
|
2689
2689
|
const g = y || !t || !s || o.some((p) => (r ? p.id !== i : !0) && p.parent === (l == null ? void 0 : l.id) && p.lang === s) || !d && !(h && u) && (!m || !a);
|
|
2690
|
-
return /* @__PURE__ */ n(
|
|
2690
|
+
return /* @__PURE__ */ n(ht, { children: e ? /* @__PURE__ */ c(de, { children: [
|
|
2691
2691
|
/* @__PURE__ */ n(T, { type: "submit", disabled: g && !l.dynamic, children: y ? /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2692
2692
|
/* @__PURE__ */ n("span", { className: "loader mr-2" }),
|
|
2693
2693
|
r ? ce.UPDATING : ce.ADDING
|
|
@@ -2721,7 +2721,7 @@ const Zi = ({
|
|
|
2721
2721
|
}) => /* @__PURE__ */ c("form", { onSubmit: e, children: [
|
|
2722
2722
|
/* @__PURE__ */ c("div", { className: "grid gap-4 py-4", children: [
|
|
2723
2723
|
/* @__PURE__ */ n(
|
|
2724
|
-
|
|
2724
|
+
el,
|
|
2725
2725
|
{
|
|
2726
2726
|
edit: t,
|
|
2727
2727
|
lang: s,
|
|
@@ -2733,7 +2733,7 @@ const Zi = ({
|
|
|
2733
2733
|
}
|
|
2734
2734
|
),
|
|
2735
2735
|
/* @__PURE__ */ n(
|
|
2736
|
-
|
|
2736
|
+
tl,
|
|
2737
2737
|
{
|
|
2738
2738
|
lang: s,
|
|
2739
2739
|
name: r,
|
|
@@ -2743,7 +2743,7 @@ const Zi = ({
|
|
|
2743
2743
|
)
|
|
2744
2744
|
] }),
|
|
2745
2745
|
/* @__PURE__ */ n(
|
|
2746
|
-
|
|
2746
|
+
nl,
|
|
2747
2747
|
{
|
|
2748
2748
|
parentHasSelectedLanguagePage: d,
|
|
2749
2749
|
name: r,
|
|
@@ -2809,7 +2809,7 @@ const Zi = ({
|
|
|
2809
2809
|
) : /* @__PURE__ */ c("form", { onSubmit: t, children: [
|
|
2810
2810
|
/* @__PURE__ */ c("div", { className: "grid gap-4 py-4", children: [
|
|
2811
2811
|
/* @__PURE__ */ n(
|
|
2812
|
-
|
|
2812
|
+
el,
|
|
2813
2813
|
{
|
|
2814
2814
|
edit: s,
|
|
2815
2815
|
lang: a,
|
|
@@ -2821,7 +2821,7 @@ const Zi = ({
|
|
|
2821
2821
|
}
|
|
2822
2822
|
),
|
|
2823
2823
|
/* @__PURE__ */ n(
|
|
2824
|
-
|
|
2824
|
+
tl,
|
|
2825
2825
|
{
|
|
2826
2826
|
lang: a,
|
|
2827
2827
|
name: i,
|
|
@@ -2850,7 +2850,7 @@ const Zi = ({
|
|
|
2850
2850
|
)
|
|
2851
2851
|
] }),
|
|
2852
2852
|
/* @__PURE__ */ n(
|
|
2853
|
-
|
|
2853
|
+
nl,
|
|
2854
2854
|
{
|
|
2855
2855
|
parentHasSelectedLanguagePage: h,
|
|
2856
2856
|
name: i,
|
|
@@ -2875,9 +2875,9 @@ const Zi = ({
|
|
|
2875
2875
|
edit: r = !1,
|
|
2876
2876
|
preselectedLang: i
|
|
2877
2877
|
}) => {
|
|
2878
|
-
const { data: l = [] } = On(), o =
|
|
2878
|
+
const { data: l = [] } = On(), o = W(() => l.find((z) => z.id === a), [l, a]), [d, h] = S(""), [u, m] = S(""), [y, g] = S(""), [p, f] = S(!0), [v, x] = S(!0), { mutate: N, isPending: I } = Zi(), { mutate: L, isPending: C } = sr(), P = I || C, { data: U, isFetching: J } = St(), ee = Rt(), { data: D, isFetching: F } = pt(a), { data: M = [], isFetching: q } = pt(
|
|
2879
2879
|
o == null ? void 0 : o.parent
|
|
2880
|
-
), { data: B = [], isFetching: K } = Ge(), { setSelectedLang: re } = Fe(), [, Ae] =
|
|
2880
|
+
), { data: B = [], isFetching: K } = Ge(), { setSelectedLang: re } = Fe(), [, Ae] = He(), [, Oe] = Ws(), me = J || F || q || K, w = W(() => ye(U == null ? void 0 : U.languages, (z) => !ve(D, { lang: z })), [U, D]), b = W(
|
|
2881
2881
|
() => B.find((z) => z.key === (o == null ? void 0 : o.pageType)),
|
|
2882
2882
|
[B, o == null ? void 0 : o.pageType]
|
|
2883
2883
|
), E = !(b != null && b.hasSlug), R = (o == null ? void 0 : o.slug) === "/";
|
|
@@ -2897,7 +2897,7 @@ const Zi = ({
|
|
|
2897
2897
|
m(z), (!d || d === (o == null ? void 0 : o.name)) && h(`${o == null ? void 0 : o.name} - ${Le[z]}`);
|
|
2898
2898
|
}
|
|
2899
2899
|
}, [i, w, r, d, o]);
|
|
2900
|
-
const { parentSlug: A, isRootPage: O } =
|
|
2900
|
+
const { parentSlug: A, isRootPage: O } = W(() => {
|
|
2901
2901
|
if (R || !u)
|
|
2902
2902
|
return { parentSlug: void 0, isRootPage: !(o != null && o.parent) };
|
|
2903
2903
|
if (!(o != null && o.parent))
|
|
@@ -2907,7 +2907,7 @@ const Zi = ({
|
|
|
2907
2907
|
};
|
|
2908
2908
|
const z = M == null ? void 0 : M.find((oe) => oe.lang === u);
|
|
2909
2909
|
return { parentSlug: z == null ? void 0 : z.slug, isRootPage: !1 };
|
|
2910
|
-
}, [o == null ? void 0 : o.parent, M, v, u, R]), V =
|
|
2910
|
+
}, [o == null ? void 0 : o.parent, M, v, u, R]), V = W(() => O ? !0 : !!(M != null && M.some((z) => (z == null ? void 0 : z.lang) === u)), [u, M, O]), j = () => {
|
|
2911
2911
|
let z = "";
|
|
2912
2912
|
return O ? z = `/${v ? [u, y].filter(Boolean).join("/") : y}` : z = `${Dt(A)}/${y}`, z.replace(/\/{2,}/g, "/").replace(/\/$/, "");
|
|
2913
2913
|
}, Q = (z) => {
|
|
@@ -3020,7 +3020,7 @@ function jd({
|
|
|
3020
3020
|
i && /* @__PURE__ */ n("div", { className: "text-red-500 text-xs mt-1", children: i })
|
|
3021
3021
|
] }) });
|
|
3022
3022
|
}
|
|
3023
|
-
const Ms = ({ children: e, onWheel: t, ...s }) => /* @__PURE__ */ n(
|
|
3023
|
+
const Ms = ({ children: e, onWheel: t, ...s }) => /* @__PURE__ */ n(ci, { ...s, onWheel: (r) => {
|
|
3024
3024
|
try {
|
|
3025
3025
|
r.preventDefault();
|
|
3026
3026
|
const i = r.currentTarget;
|
|
@@ -3040,7 +3040,7 @@ function zd({
|
|
|
3040
3040
|
}) {
|
|
3041
3041
|
const [l, o] = S(!1), [d, h] = S(""), u = Et("enable-add-page-dropdown");
|
|
3042
3042
|
u || (a = "w-full rounded-md border border-gray-300 px-3 py-2");
|
|
3043
|
-
const m =
|
|
3043
|
+
const m = W(() => !e || e.length === 0 ? [] : e.filter((N) => !Y(N.slug)).filter((N) => N.slug !== "/").sort((N, I) => N.slug.localeCompare(I.slug)), [e]), y = W(() => {
|
|
3044
3044
|
if (!d.trim()) return m;
|
|
3045
3045
|
const x = d.toLowerCase();
|
|
3046
3046
|
return m.filter(
|
|
@@ -3090,7 +3090,7 @@ function zd({
|
|
|
3090
3090
|
)
|
|
3091
3091
|
] }) }) }),
|
|
3092
3092
|
/* @__PURE__ */ c(Ms, { className: "max-h-[300px] overflow-y-auto", children: [
|
|
3093
|
-
/* @__PURE__ */ n(
|
|
3093
|
+
/* @__PURE__ */ n(Hn, { children: "No pages found." }),
|
|
3094
3094
|
/* @__PURE__ */ c(_t, { children: [
|
|
3095
3095
|
/* @__PURE__ */ c(
|
|
3096
3096
|
ft,
|
|
@@ -3219,7 +3219,7 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3219
3219
|
)
|
|
3220
3220
|
] }) }),
|
|
3221
3221
|
/* @__PURE__ */ c(Ms, { className: "max-h-[300px] overflow-y-auto", children: [
|
|
3222
|
-
/* @__PURE__ */ n(
|
|
3222
|
+
/* @__PURE__ */ n(Hn, { children: "No templates found." }),
|
|
3223
3223
|
Object.entries(y).map(([f, v]) => /* @__PURE__ */ n(_t, { heading: f, children: v.map((x) => /* @__PURE__ */ c(
|
|
3224
3224
|
ft,
|
|
3225
3225
|
{
|
|
@@ -3262,13 +3262,13 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3262
3262
|
/* @__PURE__ */ n("div", { className: "border-t bg-gray-50 p-2 text-xs text-gray-500", children: "Template preview" })
|
|
3263
3263
|
] })
|
|
3264
3264
|
] });
|
|
3265
|
-
},
|
|
3265
|
+
}, Hd = () => {
|
|
3266
3266
|
const e = ue(), t = Z();
|
|
3267
3267
|
return De({
|
|
3268
3268
|
queryKey: [G.GET_LIBRARIES],
|
|
3269
3269
|
queryFn: async () => await t(e, { action: G.GET_LIBRARIES }) || []
|
|
3270
3270
|
});
|
|
3271
|
-
},
|
|
3271
|
+
}, Wd = (e) => {
|
|
3272
3272
|
const t = ue(), s = Z();
|
|
3273
3273
|
return De({
|
|
3274
3274
|
queryKey: [G.GET_TEMPLATES_BY_TYPE, e],
|
|
@@ -3282,21 +3282,21 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3282
3282
|
}
|
|
3283
3283
|
});
|
|
3284
3284
|
}, Qd = (e) => {
|
|
3285
|
-
const { data: t = [], isLoading: s } =
|
|
3285
|
+
const { data: t = [], isLoading: s } = Wd(e), { data: a = [], isLoading: r } = Hd(), i = W(() => s || r ? [] : t.map((o) => {
|
|
3286
3286
|
const d = ve(a, { id: o.library });
|
|
3287
3287
|
return {
|
|
3288
3288
|
...o,
|
|
3289
3289
|
libraryName: (d == null ? void 0 : d.type) !== "shared" ? "Site Library" : (d == null ? void 0 : d.name) + " Library",
|
|
3290
3290
|
libraryType: d == null ? void 0 : d.type
|
|
3291
3291
|
};
|
|
3292
|
-
}), [t, a, s, r]), l =
|
|
3292
|
+
}), [t, a, s, r]), l = W(() => Hr(i, "libraryName"), [i]);
|
|
3293
3293
|
return {
|
|
3294
3294
|
data: i,
|
|
3295
3295
|
groupedData: l,
|
|
3296
3296
|
isLoading: s || r
|
|
3297
3297
|
};
|
|
3298
3298
|
}, oa = () => {
|
|
3299
|
-
const [, e] =
|
|
3299
|
+
const [, e] = He();
|
|
3300
3300
|
return ae(
|
|
3301
3301
|
(t, s) => {
|
|
3302
3302
|
const r = new URLSearchParams(window.location.search).get("lang"), i = new URLSearchParams({ page: t });
|
|
@@ -3368,10 +3368,10 @@ if (import.meta.vitest) {
|
|
|
3368
3368
|
const Ut = (...e) => e.filter(Boolean).join(" ");
|
|
3369
3369
|
function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel: a }) {
|
|
3370
3370
|
var Ns, Es;
|
|
3371
|
-
const r = oa(), i = !!(e != null && e.id), { data: l } = On(), { mutate: o, isPending: d } =
|
|
3371
|
+
const r = oa(), i = !!(e != null && e.id), { data: l } = On(), { mutate: o, isPending: d } = Zi(), { mutate: h, isPending: u } = sr(), [m, y] = S(null), [g, p] = S(!0), [f, v] = S((e == null ? void 0 : e.pageType) ?? "page"), { hasPermission: x } = Pn(), N = x(Te.CHANGE_PAGE_TYPE), [I, L] = S(!1), [C, P] = S(""), { selectedLang: U, fallbackLang: J } = Fe(), ee = U || J, [D, F] = S(""), [M, q] = S(!1), B = W(() => {
|
|
3372
3372
|
const k = t.find((fe) => fe.key === f);
|
|
3373
3373
|
return (k == null ? void 0 : k.hasSlug) === !1;
|
|
3374
|
-
}, [f, t]), [K, re] = S((e == null ? void 0 : e.parent) ?? ""), [Ae, Oe] = S((e == null ? void 0 : e.name) ?? ""), [me, w] = S((e == null ? void 0 : e.dynamic) ?? !1), [b, E] = S(me ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""), [R, A] = S((e == null ? void 0 : e.dynamicSlugCustom) ?? ""), [O, V] = S(!0), [j, Q] = S(!1), [ie, z] = S(""), { data: oe, isLoading: be } = Qd(f), Ne = d || u, _ = Et("enable-add-page-dropdown"), ne =
|
|
3374
|
+
}, [f, t]), [K, re] = S((e == null ? void 0 : e.parent) ?? ""), [Ae, Oe] = S((e == null ? void 0 : e.name) ?? ""), [me, w] = S((e == null ? void 0 : e.dynamic) ?? !1), [b, E] = S(me ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""), [R, A] = S((e == null ? void 0 : e.dynamicSlugCustom) ?? ""), [O, V] = S(!0), [j, Q] = S(!1), [ie, z] = S(""), { data: oe, isLoading: be } = Qd(f), Ne = d || u, _ = Et("enable-add-page-dropdown"), ne = W(() => !i || !(e != null && e.id) || !l ? null : l.find((k) => k.id === e.id), [i, e == null ? void 0 : e.id, l]), Re = (ne == null ? void 0 : ne.online) || !1, st = W(() => !i || !(e != null && e.id) || !l ? !1 : l.some((k) => k.parent === e.id), [i, e == null ? void 0 : e.id, l]), X = t.find((k) => k.key === f), Je = (k) => {
|
|
3375
3375
|
if (i && f !== k) {
|
|
3376
3376
|
P(k), L(!0), F(""), q(!1);
|
|
3377
3377
|
return;
|
|
@@ -3383,9 +3383,9 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3383
3383
|
w(k), k ? E("") : A("");
|
|
3384
3384
|
}, fa = (k) => {
|
|
3385
3385
|
if (re(k), k && k !== "none") {
|
|
3386
|
-
const fe = l == null ? void 0 : l.find((Ye) => Ye.id === k),
|
|
3387
|
-
if (b.startsWith(
|
|
3388
|
-
const Ye = b.slice(
|
|
3386
|
+
const fe = l == null ? void 0 : l.find((Ye) => Ye.id === k), dt = (fe == null ? void 0 : fe.slug) || "";
|
|
3387
|
+
if (b.startsWith(dt)) {
|
|
3388
|
+
const Ye = b.slice(dt.length).replace(/^\/+/, "");
|
|
3389
3389
|
E(Ye);
|
|
3390
3390
|
} else
|
|
3391
3391
|
E(b.replace(/^\/+/, ""));
|
|
@@ -3393,7 +3393,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3393
3393
|
E(b ? `${b}` : "");
|
|
3394
3394
|
}, ga = (k) => {
|
|
3395
3395
|
z(k);
|
|
3396
|
-
}, xs = () => Ae.trim() ? me && !Y(b) ? (y("Slug must be empty when using dynamic slug"), !1) : me && !O ? (y("Dynamic slug is invalid"), !1) : !0 : (
|
|
3396
|
+
}, xs = () => Ae.trim() ? me && !Y(b) ? (y("Slug must be empty when using dynamic slug"), !1) : me && !O ? (y("Dynamic slug is invalid"), !1) : !0 : (H.error("Name is required"), !1), pa = () => {
|
|
3397
3397
|
const k = {
|
|
3398
3398
|
pageType: X == null ? void 0 : X.key,
|
|
3399
3399
|
name: Ae,
|
|
@@ -3404,7 +3404,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3404
3404
|
{ id: e == null ? void 0 : e.id, name: Ae },
|
|
3405
3405
|
{
|
|
3406
3406
|
onSuccess: () => {
|
|
3407
|
-
|
|
3407
|
+
H.success((X == null ? void 0 : X.name) + " updated successfully"), s();
|
|
3408
3408
|
}
|
|
3409
3409
|
}
|
|
3410
3410
|
) : o(k, {
|
|
@@ -3415,10 +3415,10 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3415
3415
|
}, ws = (k, fe) => {
|
|
3416
3416
|
if (!k.trim() && !me)
|
|
3417
3417
|
return y("Child page slug is required"), !1;
|
|
3418
|
-
const
|
|
3418
|
+
const dt = Dt(fe), Ye = Er(dt, k);
|
|
3419
3419
|
return Object.keys(Le).some((Ss) => Ye === `/${Ss}` || (Ye == null ? void 0 : Ye.startsWith(`/${Ss}/`))) ? (y("Slugs cannot start with a language code for primary page"), !1) : !0;
|
|
3420
3420
|
}, ya = (k, fe) => {
|
|
3421
|
-
const
|
|
3421
|
+
const dt = Dt(fe), Ye = Er(dt, k), rt = {
|
|
3422
3422
|
pageType: f,
|
|
3423
3423
|
name: Ae,
|
|
3424
3424
|
slug: Ye.replace(/\/$/, ""),
|
|
@@ -3432,22 +3432,22 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3432
3432
|
jsonLD: {}
|
|
3433
3433
|
};
|
|
3434
3434
|
if (me && (rt.dynamicSlugCustom = R), i) {
|
|
3435
|
-
const
|
|
3435
|
+
const ut = fs(rt, ["pageType", "parent", "name", "slug", "dynamic", "dynamicSlugCustom"]);
|
|
3436
3436
|
h(
|
|
3437
|
-
{ id: e == null ? void 0 : e.id, ...
|
|
3437
|
+
{ id: e == null ? void 0 : e.id, ...ut },
|
|
3438
3438
|
{
|
|
3439
3439
|
onSuccess: () => {
|
|
3440
|
-
|
|
3440
|
+
H.success("Page updated successfully"), s();
|
|
3441
3441
|
}
|
|
3442
3442
|
}
|
|
3443
3443
|
);
|
|
3444
3444
|
} else {
|
|
3445
|
-
const
|
|
3446
|
-
|
|
3447
|
-
const { seo: Ss, jsonLD:
|
|
3448
|
-
gt(rt, "seo", Ss), gt(rt, "jsonLD",
|
|
3449
|
-
onSuccess: (
|
|
3450
|
-
s(), r(
|
|
3445
|
+
const ut = ve(t, { key: f });
|
|
3446
|
+
ut != null && ut.trackingDefault && (rt.tracking = ut.trackingDefault);
|
|
3447
|
+
const { seo: Ss, jsonLD: Yl } = rn(ut, ee);
|
|
3448
|
+
gt(rt, "seo", Ss), gt(rt, "jsonLD", Yl), o(rt, {
|
|
3449
|
+
onSuccess: (Xl) => {
|
|
3450
|
+
s(), r(Xl.page.id, a);
|
|
3451
3451
|
}
|
|
3452
3452
|
});
|
|
3453
3453
|
}
|
|
@@ -3465,18 +3465,18 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3465
3465
|
{ id: e == null ? void 0 : e.id, ...k },
|
|
3466
3466
|
{
|
|
3467
3467
|
onSuccess: () => {
|
|
3468
|
-
|
|
3468
|
+
H.success("Page updated successfully"), s();
|
|
3469
3469
|
}
|
|
3470
3470
|
}
|
|
3471
3471
|
);
|
|
3472
3472
|
else {
|
|
3473
3473
|
const fe = ve(t, { key: f });
|
|
3474
3474
|
fe != null && fe.trackingDefault && (k.tracking = fe.trackingDefault);
|
|
3475
|
-
const { seo:
|
|
3476
|
-
gt(k, "seo",
|
|
3475
|
+
const { seo: dt, jsonLD: Ye } = rn(fe, ee);
|
|
3476
|
+
gt(k, "seo", dt), gt(k, "jsonLD", Ye), o(k, {
|
|
3477
3477
|
onSuccess: (rt) => {
|
|
3478
|
-
var
|
|
3479
|
-
(
|
|
3478
|
+
var ut;
|
|
3479
|
+
(ut = rt == null ? void 0 : rt.page) != null && ut.id && r(rt.page.id, a), s();
|
|
3480
3480
|
}
|
|
3481
3481
|
});
|
|
3482
3482
|
}
|
|
@@ -3487,14 +3487,14 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3487
3487
|
return;
|
|
3488
3488
|
}
|
|
3489
3489
|
if (K && K !== "none") {
|
|
3490
|
-
const fe = l == null ? void 0 : l.find((Ye) => Ye.id === K),
|
|
3491
|
-
if (!ws(b,
|
|
3490
|
+
const fe = l == null ? void 0 : l.find((Ye) => Ye.id === K), dt = (fe == null ? void 0 : fe.slug) || "";
|
|
3491
|
+
if (!ws(b, dt))
|
|
3492
3492
|
return;
|
|
3493
|
-
ya(b,
|
|
3493
|
+
ya(b, dt);
|
|
3494
3494
|
} else
|
|
3495
3495
|
va();
|
|
3496
3496
|
}
|
|
3497
|
-
}, { pagesType: Yt, partialsType: kt } =
|
|
3497
|
+
}, { pagesType: Yt, partialsType: kt } = W(() => {
|
|
3498
3498
|
const k = (fe) => D ? fe.name.toLowerCase().includes(D.toLowerCase()) || fe.key.toLowerCase().includes(D.toLowerCase()) : !0;
|
|
3499
3499
|
return {
|
|
3500
3500
|
pagesType: t.filter((fe) => fe.hasSlug !== !1 && k(fe)),
|
|
@@ -3535,7 +3535,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3535
3535
|
)
|
|
3536
3536
|
] }) }),
|
|
3537
3537
|
/* @__PURE__ */ c(Ms, { className: "overflow-y-auto", children: [
|
|
3538
|
-
/* @__PURE__ */ n(
|
|
3538
|
+
/* @__PURE__ */ n(Hn, { children: "No page type found." }),
|
|
3539
3539
|
i ? B ? /* @__PURE__ */ n(_t, { heading: "Partials", children: kt.map((k) => /* @__PURE__ */ c(
|
|
3540
3540
|
ft,
|
|
3541
3541
|
{
|
|
@@ -3768,7 +3768,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3768
3768
|
)
|
|
3769
3769
|
] }) }),
|
|
3770
3770
|
/* @__PURE__ */ c(Ms, { className: "max-h-[200px] overflow-y-auto", children: [
|
|
3771
|
-
/* @__PURE__ */ n(
|
|
3771
|
+
/* @__PURE__ */ n(Hn, { children: "No page type found." }),
|
|
3772
3772
|
/* @__PURE__ */ n(_t, { heading: "Partials", children: kt.map((k) => /* @__PURE__ */ c(
|
|
3773
3773
|
ft,
|
|
3774
3774
|
{
|
|
@@ -3842,7 +3842,7 @@ function ca({
|
|
|
3842
3842
|
page: e,
|
|
3843
3843
|
onClose: t
|
|
3844
3844
|
}) {
|
|
3845
|
-
const [, s] =
|
|
3845
|
+
const [, s] = He(), { mutate: a, isPending: r } = Cd(), { data: i } = Ge(), { setSelectedLang: l, fallbackLang: o } = Fe(), [, d] = Ws(), h = () => {
|
|
3846
3846
|
r || a(e, {
|
|
3847
3847
|
onSuccess: () => {
|
|
3848
3848
|
e != null && e.primaryPage ? (window.history.replaceState({}, "", `/?page=${e.primaryPage}`), s(new URLSearchParams({ page: e.primaryPage }))) : (window.history.replaceState({}, "", "/"), s(new URLSearchParams())), window.dispatchEvent(new PopStateEvent("popstate")), l(o), d("outline"), t();
|
|
@@ -3868,7 +3868,7 @@ function ca({
|
|
|
3868
3868
|
] })
|
|
3869
3869
|
] })
|
|
3870
3870
|
] }),
|
|
3871
|
-
/* @__PURE__ */ c(
|
|
3871
|
+
/* @__PURE__ */ c(ht, { children: [
|
|
3872
3872
|
/* @__PURE__ */ n(T, { variant: "outline", onClick: t, children: "Cancel" }),
|
|
3873
3873
|
/* @__PURE__ */ n(
|
|
3874
3874
|
T,
|
|
@@ -3898,10 +3898,10 @@ const Yd = () => {
|
|
|
3898
3898
|
onSuccess: () => {
|
|
3899
3899
|
t.invalidateQueries({
|
|
3900
3900
|
queryKey: [G.GET_WEBSITE_PAGES]
|
|
3901
|
-
}),
|
|
3901
|
+
}), H.success("Page duplicated successfully");
|
|
3902
3902
|
},
|
|
3903
3903
|
onError: (a) => {
|
|
3904
|
-
|
|
3904
|
+
H.error("Failed to duplicate page", {
|
|
3905
3905
|
description: a.message || "An error occurred while duplicating the page"
|
|
3906
3906
|
});
|
|
3907
3907
|
}
|
|
@@ -3914,7 +3914,7 @@ const Yd = () => {
|
|
|
3914
3914
|
}) => {
|
|
3915
3915
|
const { mutate: a, isPending: r } = Yd(), [i, l] = S(null), [o, d] = S(`${e.name} (Copy)`), h = oa(), u = Y(e.slug), [m, y] = S(
|
|
3916
3916
|
u ? "" : `${e.slug.split("/").pop()}-copy`
|
|
3917
|
-
), g = u ? "" :
|
|
3917
|
+
), g = u ? "" : ro(e.slug.split("/")).join("/"), [p, f] = S(!1), v = (x) => {
|
|
3918
3918
|
if (x.preventDefault(), !o.trim()) {
|
|
3919
3919
|
l("Name is required");
|
|
3920
3920
|
return;
|
|
@@ -4036,7 +4036,7 @@ const Yd = () => {
|
|
|
4036
4036
|
const L = (C = I.target.files) == null ? void 0 : C[0];
|
|
4037
4037
|
if (L) {
|
|
4038
4038
|
if (L.size > Xd) {
|
|
4039
|
-
|
|
4039
|
+
H.error("File too large", {
|
|
4040
4040
|
description: `Maximum file size is 1MB. Selected file is ${(L.size / 1024).toFixed(2)}KB.`
|
|
4041
4041
|
}), u.current && (u.current.value = "");
|
|
4042
4042
|
return;
|
|
@@ -4048,7 +4048,7 @@ const Yd = () => {
|
|
|
4048
4048
|
o(P.result), h(!1);
|
|
4049
4049
|
}, P.readAsDataURL(L);
|
|
4050
4050
|
} catch (P) {
|
|
4051
|
-
console.error("Error reading file:", P), h(!1),
|
|
4051
|
+
console.error("Error reading file:", P), h(!1), H.error("Failed to process image", {
|
|
4052
4052
|
description: P instanceof Error ? P.message : "Unknown error"
|
|
4053
4053
|
});
|
|
4054
4054
|
}
|
|
@@ -4170,7 +4170,7 @@ const Yd = () => {
|
|
|
4170
4170
|
] })
|
|
4171
4171
|
] }),
|
|
4172
4172
|
/* @__PURE__ */ c(
|
|
4173
|
-
|
|
4173
|
+
ht,
|
|
4174
4174
|
{
|
|
4175
4175
|
className: s ? "opacity-75 pointer-events-none" : "",
|
|
4176
4176
|
children: [
|
|
@@ -4200,7 +4200,7 @@ const Yd = () => {
|
|
|
4200
4200
|
children: o,
|
|
4201
4201
|
isLanguagePage: d
|
|
4202
4202
|
}) => {
|
|
4203
|
-
const { hasPermission: h } = Pn(), { data: u } = Ge(), m =
|
|
4203
|
+
const { hasPermission: h } = Pn(), { data: u } = Ge(), m = W(() => ve(u, { key: e.pageType }), [u, e.pageType]), y = W(() => !!e.isTemplate, [e.isTemplate]), g = W(() => !!(m != null && m.hasSlug), [m == null ? void 0 : m.hasSlug]);
|
|
4204
4204
|
return !h(Te.EDIT_PAGE) && !h(Te.DELETE_PAGE) && !h(Te.UNPUBLISH_PAGE) || !e ? null : /* @__PURE__ */ c(_n, { children: [
|
|
4205
4205
|
/* @__PURE__ */ n(Ln, { asChild: !0, onClick: (f) => f.stopPropagation(), children: o }),
|
|
4206
4206
|
/* @__PURE__ */ c(Dn, { align: "center", className: "text-sm", children: [
|
|
@@ -4228,7 +4228,7 @@ const Yd = () => {
|
|
|
4228
4228
|
});
|
|
4229
4229
|
},
|
|
4230
4230
|
children: [
|
|
4231
|
-
/* @__PURE__ */ n(
|
|
4231
|
+
/* @__PURE__ */ n(Ei, { className: "size-3" }),
|
|
4232
4232
|
"Edit"
|
|
4233
4233
|
]
|
|
4234
4234
|
}
|
|
@@ -4241,7 +4241,7 @@ const Yd = () => {
|
|
|
4241
4241
|
f.stopPropagation(), a(e);
|
|
4242
4242
|
},
|
|
4243
4243
|
children: [
|
|
4244
|
-
/* @__PURE__ */ n(
|
|
4244
|
+
/* @__PURE__ */ n(Si, { className: "size-3" }),
|
|
4245
4245
|
ce.UNPUBLISH
|
|
4246
4246
|
]
|
|
4247
4247
|
}
|
|
@@ -4297,7 +4297,7 @@ const Yd = () => {
|
|
|
4297
4297
|
/* @__PURE__ */ n(nt, { className: "py-4 text-slate-500 space-y-1 text-xs", children: "Are you sure you want to unmark this page as a template?" })
|
|
4298
4298
|
] }),
|
|
4299
4299
|
/* @__PURE__ */ c(
|
|
4300
|
-
|
|
4300
|
+
ht,
|
|
4301
4301
|
{
|
|
4302
4302
|
className: s ? "opacity-75 pointer-events-none" : "",
|
|
4303
4303
|
children: [
|
|
@@ -4342,7 +4342,7 @@ const Yd = () => {
|
|
|
4342
4342
|
"?"
|
|
4343
4343
|
] })
|
|
4344
4344
|
] }),
|
|
4345
|
-
/* @__PURE__ */ c(
|
|
4345
|
+
/* @__PURE__ */ c(ht, { children: [
|
|
4346
4346
|
/* @__PURE__ */ n(T, { variant: "outline", onClick: t, children: "Cancel" }),
|
|
4347
4347
|
/* @__PURE__ */ n(
|
|
4348
4348
|
T,
|
|
@@ -4355,7 +4355,7 @@ const Yd = () => {
|
|
|
4355
4355
|
)
|
|
4356
4356
|
] })
|
|
4357
4357
|
] }) });
|
|
4358
|
-
}, Zd =
|
|
4358
|
+
}, Zd = Ri("expandedPagesState", []), hr = (e) => Pa(e, (t) => [
|
|
4359
4359
|
t,
|
|
4360
4360
|
...t.children ? hr(t.children) : []
|
|
4361
4361
|
]), eu = (e, t) => {
|
|
@@ -4372,12 +4372,12 @@ const Yd = () => {
|
|
|
4372
4372
|
return null;
|
|
4373
4373
|
};
|
|
4374
4374
|
return s(e) || [];
|
|
4375
|
-
},
|
|
4375
|
+
}, sl = (e, t) => {
|
|
4376
4376
|
if (!t) return [];
|
|
4377
4377
|
const s = hr(e), a = ve(s, (r) => r.id === t);
|
|
4378
4378
|
if (a) {
|
|
4379
4379
|
if (a.parent)
|
|
4380
|
-
return [...
|
|
4380
|
+
return [...sl(e, a.parent), t];
|
|
4381
4381
|
const r = eu(e, t);
|
|
4382
4382
|
if (!Y(r))
|
|
4383
4383
|
return r;
|
|
@@ -4399,7 +4399,7 @@ const Yd = () => {
|
|
|
4399
4399
|
}, [s, a, e]), i = ae(
|
|
4400
4400
|
(h, u) => {
|
|
4401
4401
|
if (!u || Y(h)) return;
|
|
4402
|
-
const m = hr(h), y =
|
|
4402
|
+
const m = hr(h), y = sl(m, u);
|
|
4403
4403
|
if (!Array.isArray(y) || Y(y)) return;
|
|
4404
4404
|
const g = y.slice(0, -1);
|
|
4405
4405
|
Y(g) || s((p) => ka([...p, ...g]));
|
|
@@ -4409,7 +4409,7 @@ const Yd = () => {
|
|
|
4409
4409
|
(h) => {
|
|
4410
4410
|
if (Y(h)) return;
|
|
4411
4411
|
const u = tu(h);
|
|
4412
|
-
Y(u) || s((m) =>
|
|
4412
|
+
Y(u) || s((m) => io(m, u));
|
|
4413
4413
|
},
|
|
4414
4414
|
[s]
|
|
4415
4415
|
), o = ae((h) => {
|
|
@@ -4469,21 +4469,21 @@ const Yd = () => {
|
|
|
4469
4469
|
return Object.values(t).forEach((a) => {
|
|
4470
4470
|
a.parent && t[a.parent] ? t[a.parent].children.push(a) : s.push(a);
|
|
4471
4471
|
}), s;
|
|
4472
|
-
},
|
|
4472
|
+
}, al = (e) => !e || !e.length ? [] : [...e].sort(
|
|
4473
4473
|
(s, a) => (s.name || "").localeCompare(a.name || "")
|
|
4474
4474
|
).map((s) => ({
|
|
4475
4475
|
...s,
|
|
4476
|
-
children: s.children ?
|
|
4477
|
-
})),
|
|
4476
|
+
children: s.children ? al(s.children) : []
|
|
4477
|
+
})), rl = (e, t, s, a) => {
|
|
4478
4478
|
if (!e || !e.length) return [];
|
|
4479
4479
|
let r = e;
|
|
4480
4480
|
if (s !== "all" && (r = Ks(ye(e, { pageType: s }))), Y(t))
|
|
4481
4481
|
r = Sr(r, t);
|
|
4482
4482
|
else {
|
|
4483
4483
|
const u = Sr(r, t), m = nu(e, u);
|
|
4484
|
-
r =
|
|
4484
|
+
r = lo([...u, ...m], "id");
|
|
4485
4485
|
}
|
|
4486
|
-
const i =
|
|
4486
|
+
const i = al(su(r)), l = Ra(i, t, a), o = ye(l, (u) => a(u.pageType)).sort((u, m) => (u.name || "").localeCompare(m.name || "")), d = ye(l, (u) => !a(u.pageType));
|
|
4487
4487
|
let h = [];
|
|
4488
4488
|
if (s === "all") {
|
|
4489
4489
|
const u = Qa(d, "pageType");
|
|
@@ -4514,10 +4514,10 @@ const Yd = () => {
|
|
|
4514
4514
|
isExpanded: m,
|
|
4515
4515
|
onToggleExpand: y
|
|
4516
4516
|
}) => {
|
|
4517
|
-
const g = oa(), { data: p } = Ge(), [, f] =
|
|
4517
|
+
const g = oa(), { data: p } = Ge(), [, f] = Ws(), v = W(() => ve(p, { key: t.pageType }), [p, t.pageType]), x = W(() => {
|
|
4518
4518
|
const C = $(t, "slug", ""), P = e ? Dt(e) : "", U = P ? C.replace(P, "") : C;
|
|
4519
4519
|
return U || "/";
|
|
4520
|
-
}, [t, e]), N =
|
|
4520
|
+
}, [t, e]), N = W(() => !!t.isTemplate, [t.isTemplate]), I = ae(() => {
|
|
4521
4521
|
f("outline"), g($(t, "id"), a);
|
|
4522
4522
|
}, [g, a, t, f]), L = ae(
|
|
4523
4523
|
(C) => {
|
|
@@ -4547,7 +4547,7 @@ const Yd = () => {
|
|
|
4547
4547
|
)
|
|
4548
4548
|
}
|
|
4549
4549
|
),
|
|
4550
|
-
t.dynamic ? /* @__PURE__ */ n("div", { className: "h-4 w-4 stroke-[1] text-slate-500", children: /* @__PURE__ */ n(
|
|
4550
|
+
t.dynamic ? /* @__PURE__ */ n("div", { className: "h-4 w-4 stroke-[1] text-slate-500", children: /* @__PURE__ */ n(Ci, { className: "h-4 w-4 text-yellow-400" }) }) : v != null && v.icon ? /* @__PURE__ */ n("div", { className: "h-4 w-4 stroke-[1] text-slate-500", dangerouslySetInnerHTML: { __html: v.icon } }) : v != null && v.hasSlug ? /* @__PURE__ */ n(Qt, { className: "h-4 w-4 stroke-[1] text-slate-500" }) : /* @__PURE__ */ n(Xa, { className: "h-4 w-4 stroke-[1] text-slate-500" }),
|
|
4551
4551
|
!t.isPartialGroup && /* @__PURE__ */ n("div", { className: `h-2.5 w-2.5 rounded-full ${t.online ? "bg-green-300" : "bg-gray-300"}` }),
|
|
4552
4552
|
/* @__PURE__ */ n("span", { className: "truncate font-light leading-none text-slate-800", children: t.name }),
|
|
4553
4553
|
v != null && v.hasSlug ? /* @__PURE__ */ c(
|
|
@@ -4558,7 +4558,7 @@ const Yd = () => {
|
|
|
4558
4558
|
children: [
|
|
4559
4559
|
x,
|
|
4560
4560
|
t.dynamic && /* @__PURE__ */ c("span", { className: "text-xs font-light leading-none text-slate-500", children: [
|
|
4561
|
-
|
|
4561
|
+
Qr(x, "/") ? `${v == null ? void 0 : v.dynamicSlug}` : `/${v == null ? void 0 : v.dynamicSlug}`,
|
|
4562
4562
|
t.dynamicSlugCustom
|
|
4563
4563
|
] })
|
|
4564
4564
|
]
|
|
@@ -4600,7 +4600,7 @@ const Yd = () => {
|
|
|
4600
4600
|
}
|
|
4601
4601
|
);
|
|
4602
4602
|
}, ru = ({ close: e }) => {
|
|
4603
|
-
const [, t] = S([]), [s, a] = S(null), [r, i] = S(""), [l, o] = S(""), [d, h] = S(null), u = (A) => l ? String($(A, "name", "")).toLowerCase().includes(l.toLowerCase()) || String($(A, "key", "")).toLowerCase().includes(l.toLowerCase()) : !0, [m, y] = S(null), [g, p] = S(null), [f, v] = S(null), [x, N] = S(null), { data: I, isFetching: L } = On(), [C, P] = S(""), { hasPermission: U } = Pn(), { updateForSelectedPage: J, expandPagesOnSearch: ee, expandAll: D, collapseAll: F } = Rn(null), [M, q] =
|
|
4603
|
+
const [, t] = S([]), [s, a] = S(null), [r, i] = S(""), [l, o] = S(""), [d, h] = S(null), u = (A) => l ? String($(A, "name", "")).toLowerCase().includes(l.toLowerCase()) || String($(A, "key", "")).toLowerCase().includes(l.toLowerCase()) : !0, [m, y] = S(null), [g, p] = S(null), [f, v] = S(null), [x, N] = S(null), { data: I, isFetching: L } = On(), [C, P] = S(""), { hasPermission: U } = Pn(), { updateForSelectedPage: J, expandPagesOnSearch: ee, expandAll: D, collapseAll: F } = Rn(null), [M, q] = He(), B = M.get("page"), K = tt(null), { data: re } = Ge(), Ae = Et("enable-add-page-dropdown"), Oe = ae((A) => {
|
|
4604
4604
|
var O;
|
|
4605
4605
|
return (O = ve(re, { key: A })) == null ? void 0 : O.hasSlug;
|
|
4606
4606
|
}, [re]);
|
|
@@ -4624,7 +4624,7 @@ const Yd = () => {
|
|
|
4624
4624
|
A && (A != null && A.pageType) ? t((O) => [...O, A == null ? void 0 : A.pageType]) : (window.history.replaceState(null, "", "/"), q(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
4625
4625
|
}
|
|
4626
4626
|
}, [I, B, L, q]);
|
|
4627
|
-
const b =
|
|
4627
|
+
const b = W(() => I ? rl(I, r, C, Oe) : [], [I, r, C, Oe]);
|
|
4628
4628
|
le(() => {
|
|
4629
4629
|
B && !L && !Y(b) && (J(b, B), K.current && K.current.scrollIntoView({
|
|
4630
4630
|
behavior: "smooth",
|
|
@@ -4652,15 +4652,15 @@ const Yd = () => {
|
|
|
4652
4652
|
onChange: (A) => i(A.target.value)
|
|
4653
4653
|
}
|
|
4654
4654
|
),
|
|
4655
|
-
!Y(C) && /* @__PURE__ */ c(
|
|
4655
|
+
!Y(C) && /* @__PURE__ */ c(di, { value: C, onValueChange: me, children: [
|
|
4656
4656
|
/* @__PURE__ */ n(
|
|
4657
|
-
|
|
4657
|
+
ui,
|
|
4658
4658
|
{
|
|
4659
4659
|
className: `${C === "all" ? "bg-gray-50 hover:bg-gray-100" : "bg-gray-100 hover:bg-gray-50"} absolute right-1.5 top-1.5 -mt-px h-max w-max min-w-[120px] whitespace-nowrap p-0 py-1 pl-2 pr-1 text-xs text-gray-600 shadow-none ring-0 focus:ring-0`,
|
|
4660
4660
|
children: /* @__PURE__ */ n(Mo, { placeholder: "Select page type" })
|
|
4661
4661
|
}
|
|
4662
4662
|
),
|
|
4663
|
-
/* @__PURE__ */ c(
|
|
4663
|
+
/* @__PURE__ */ c(hi, { align: "end", children: [
|
|
4664
4664
|
Ae && /* @__PURE__ */ n("div", { className: "sticky top-0 z-10 bg-white px-3 py-2", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
4665
4665
|
/* @__PURE__ */ n(Nt, { strokeWidth: 2, className: "absolute left-2 top-2 h-4 w-4 text-gray-400" }),
|
|
4666
4666
|
/* @__PURE__ */ n(
|
|
@@ -4698,8 +4698,8 @@ const Yd = () => {
|
|
|
4698
4698
|
] })
|
|
4699
4699
|
] }),
|
|
4700
4700
|
/* @__PURE__ */ c("div", { className: "flex gap-1", children: [
|
|
4701
|
-
/* @__PURE__ */ n(T, { variant: "outline", size: "icon", onClick: E, className: "p-1 text-gray-500", children: /* @__PURE__ */ n(
|
|
4702
|
-
/* @__PURE__ */ n(T, { variant: "outline", size: "icon", onClick: R, className: "p-1 text-gray-500", children: /* @__PURE__ */ n(
|
|
4701
|
+
/* @__PURE__ */ n(T, { variant: "outline", size: "icon", onClick: E, className: "p-1 text-gray-500", children: /* @__PURE__ */ n(Ai, {}) }),
|
|
4702
|
+
/* @__PURE__ */ n(T, { variant: "outline", size: "icon", onClick: R, className: "p-1 text-gray-500", children: /* @__PURE__ */ n(Ti, {}) })
|
|
4703
4703
|
] })
|
|
4704
4704
|
] }),
|
|
4705
4705
|
L ? /* @__PURE__ */ n("div", { className: "space-y-2", children: Be([...Array(5).keys()], (A) => /* @__PURE__ */ n("div", { className: "h-9 w-full animate-pulse rounded bg-gray-200" }, A)) }) : Y(b) ? /* @__PURE__ */ c("div", { className: "flex h-[70vh] flex-col items-center justify-center gap-y-1 text-sm font-medium text-slate-500", children: [
|
|
@@ -4709,7 +4709,7 @@ const Yd = () => {
|
|
|
4709
4709
|
] }) : /* @__PURE__ */ n("div", { className: "h-[70vh] space-y-2 overflow-y-auto text-sm text-slate-700", children: Be(b, (A) => {
|
|
4710
4710
|
const O = A.id === B;
|
|
4711
4711
|
return /* @__PURE__ */ n("div", { ref: O ? K : null, children: /* @__PURE__ */ n(
|
|
4712
|
-
|
|
4712
|
+
il,
|
|
4713
4713
|
{
|
|
4714
4714
|
item: A,
|
|
4715
4715
|
currentPage: B,
|
|
@@ -4757,7 +4757,7 @@ const Yd = () => {
|
|
|
4757
4757
|
x && /* @__PURE__ */ n(ur, { page: x, onClose: () => N(null) }),
|
|
4758
4758
|
s && /* @__PURE__ */ n(or, { page: s, onClose: () => a(null), closePanel: e })
|
|
4759
4759
|
] });
|
|
4760
|
-
},
|
|
4760
|
+
}, il = ({
|
|
4761
4761
|
item: e,
|
|
4762
4762
|
currentPage: t,
|
|
4763
4763
|
close: s,
|
|
@@ -4791,7 +4791,7 @@ const Yd = () => {
|
|
|
4791
4791
|
}
|
|
4792
4792
|
),
|
|
4793
4793
|
m && y && /* @__PURE__ */ n("div", { className: "bg-white pl-6 pt-2", children: Be($(e, "children", []), (p) => /* @__PURE__ */ n(
|
|
4794
|
-
|
|
4794
|
+
il,
|
|
4795
4795
|
{
|
|
4796
4796
|
item: p,
|
|
4797
4797
|
currentPage: t,
|
|
@@ -4814,9 +4814,9 @@ const Yd = () => {
|
|
|
4814
4814
|
const d = s.toLowerCase(), h = (u) => String($(o, u, "")).toLowerCase().includes(d);
|
|
4815
4815
|
return h("name") || h("key");
|
|
4816
4816
|
}, l = r.find((o) => o.key === e);
|
|
4817
|
-
return /* @__PURE__ */ c(
|
|
4817
|
+
return /* @__PURE__ */ c(di, { onValueChange: t, value: e, children: [
|
|
4818
4818
|
/* @__PURE__ */ n(
|
|
4819
|
-
|
|
4819
|
+
ui,
|
|
4820
4820
|
{
|
|
4821
4821
|
className: `${e === "all" ? "bg-gray-100/30 hover:bg-gray-100" : "gap-x-1 border bg-gray-100/30 hover:bg-gray-100"} h-9 w-max min-w-[150px] overflow-hidden whitespace-nowrap rounded p-0 px-2 py-1 text-xs text-gray-600 shadow-none ring-0 focus:ring-0 [&>svg]:hidden`,
|
|
4822
4822
|
children: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-between gap-x-1.5", children: [
|
|
@@ -4830,7 +4830,7 @@ const Yd = () => {
|
|
|
4830
4830
|
] })
|
|
4831
4831
|
}
|
|
4832
4832
|
),
|
|
4833
|
-
/* @__PURE__ */ c(
|
|
4833
|
+
/* @__PURE__ */ c(hi, { children: [
|
|
4834
4834
|
/* @__PURE__ */ n("div", { className: "sticky top-0 z-10 bg-white pb-2", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
4835
4835
|
/* @__PURE__ */ n(Nt, { strokeWidth: 2, className: "absolute left-2 top-2.5 h-3.5 w-3.5 text-gray-400" }),
|
|
4836
4836
|
/* @__PURE__ */ n(
|
|
@@ -4890,7 +4890,7 @@ const Yd = () => {
|
|
|
4890
4890
|
const { expandAll: t, collapseAll: s, expandedPages: a } = Rn(null);
|
|
4891
4891
|
return /* @__PURE__ */ c("div", { className: "flex gap-1", children: [
|
|
4892
4892
|
/* @__PURE__ */ c(Xe, { children: [
|
|
4893
|
-
/* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ n(T, { variant: "outline", size: "icon", onClick: () => t(e), className: "rounded p-1 text-gray-500", children: /* @__PURE__ */ n(
|
|
4893
|
+
/* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ n(T, { variant: "outline", size: "icon", onClick: () => t(e), className: "rounded p-1 text-gray-500", children: /* @__PURE__ */ n(Ai, {}) }) }),
|
|
4894
4894
|
/* @__PURE__ */ n(et, { children: "Expand All" })
|
|
4895
4895
|
] }),
|
|
4896
4896
|
/* @__PURE__ */ c(Xe, { children: [
|
|
@@ -4902,13 +4902,13 @@ const Yd = () => {
|
|
|
4902
4902
|
size: "icon",
|
|
4903
4903
|
onClick: () => s(),
|
|
4904
4904
|
className: "rounded p-1 text-gray-500",
|
|
4905
|
-
children: /* @__PURE__ */ n(
|
|
4905
|
+
children: /* @__PURE__ */ n(Ti, {})
|
|
4906
4906
|
}
|
|
4907
4907
|
) }),
|
|
4908
4908
|
/* @__PURE__ */ n(et, { children: "Collapse All" })
|
|
4909
4909
|
] })
|
|
4910
4910
|
] });
|
|
4911
|
-
},
|
|
4911
|
+
}, ll = ({ languages: e, selectedLanguage: t, setSelectedLanguage: s }) => {
|
|
4912
4912
|
const a = Rt();
|
|
4913
4913
|
return /* @__PURE__ */ n("div", { className: "scrollbar-hide flex gap-1 overflow-x-auto pb-1", children: e.map((r) => /* @__PURE__ */ c(
|
|
4914
4914
|
T,
|
|
@@ -4918,7 +4918,7 @@ const Yd = () => {
|
|
|
4918
4918
|
className: `h-6 flex-shrink-0 whitespace-nowrap rounded px-3 text-xs font-normal ${t === r ? "bg-black text-white hover:bg-black" : "text-gray-500"}`,
|
|
4919
4919
|
onClick: () => s(r.toLowerCase()),
|
|
4920
4920
|
children: [
|
|
4921
|
-
r === a && /* @__PURE__ */ n(
|
|
4921
|
+
r === a && /* @__PURE__ */ n(ki, { size: 4, className: `p-0.5 ${t === a ? "fill-white" : "fill-black"}` }),
|
|
4922
4922
|
Le[r] || ""
|
|
4923
4923
|
]
|
|
4924
4924
|
},
|
|
@@ -4966,7 +4966,7 @@ const Yd = () => {
|
|
|
4966
4966
|
] }),
|
|
4967
4967
|
m ? /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4968
4968
|
/* @__PURE__ */ n(
|
|
4969
|
-
|
|
4969
|
+
ll,
|
|
4970
4970
|
{
|
|
4971
4971
|
languages: a,
|
|
4972
4972
|
selectedLanguage: i,
|
|
@@ -5025,7 +5025,7 @@ const du = ({ page: e }) => {
|
|
|
5025
5025
|
)
|
|
5026
5026
|
}
|
|
5027
5027
|
);
|
|
5028
|
-
}, uu = ({ page: e, pageType: t }) => /* @__PURE__ */ n("div", { className: "flex h-full items-center justify-center gap-x-1", children: e.dynamic ? /* @__PURE__ */ n(
|
|
5028
|
+
}, uu = ({ page: e, pageType: t }) => /* @__PURE__ */ n("div", { className: "flex h-full items-center justify-center gap-x-1", children: e.dynamic ? /* @__PURE__ */ n(Ci, { size: 12, className: "text-yellow-400" }) : t != null && t.icon ? /* @__PURE__ */ n(
|
|
5029
5029
|
"div",
|
|
5030
5030
|
{
|
|
5031
5031
|
className: "flex h-4 max-h-4 w-4 max-w-4 items-center justify-center stroke-[1] text-slate-500",
|
|
@@ -5040,7 +5040,7 @@ const du = ({ page: e }) => {
|
|
|
5040
5040
|
selectedLanguage: i,
|
|
5041
5041
|
showUntranslatedPages: l
|
|
5042
5042
|
}) => {
|
|
5043
|
-
const [o] =
|
|
5043
|
+
const [o] = Ki(), d = Rt(), h = s === e.id, u = !!e.isTemplate, m = W(() => ve(t, { key: e.pageType }), [t, e.pageType]), y = o == null ? void 0 : o[e.id], { data: g } = At(y), p = g ? g == null ? void 0 : g.name : null;
|
|
5044
5044
|
let f = $(r, e == null ? void 0 : e.id);
|
|
5045
5045
|
f = $(f, "lang") === i ? f : null;
|
|
5046
5046
|
const v = i === d || !!f, x = (f == null ? void 0 : f.name) || (e == null ? void 0 : e.name) || "No name";
|
|
@@ -5050,7 +5050,7 @@ const du = ({ page: e }) => {
|
|
|
5050
5050
|
const C = N.split("/").pop();
|
|
5051
5051
|
N = N.endsWith(C) && e.dynamic ? "" : `/${C}`;
|
|
5052
5052
|
}
|
|
5053
|
-
const L =
|
|
5053
|
+
const L = W(() => {
|
|
5054
5054
|
const C = "flex h-7 min-w-0 flex-1 cursor-pointer select-none items-center gap-x-1.5 rounded px-px text-xs duration-300 border-[1px]", P = `${h ? "border-primary/30 bg-primary/5" : "border-transparent hover:border-gray-200 hover:bg-gray-100"}`;
|
|
5055
5055
|
return v ? `${C} ${P} ${p ? "opacity-60" : ""}` : `${C} bg-gray-100 opacity-50 group-hover:border-gray-200 border-transparent group-hover:bg-blue-100`;
|
|
5056
5056
|
}, [v, h, p]);
|
|
@@ -5087,12 +5087,12 @@ const du = ({ page: e }) => {
|
|
|
5087
5087
|
setUnmarkAsTemplate: (C) => a("unmarkAsTemplate", C),
|
|
5088
5088
|
children: /* @__PURE__ */ n("div", { className: "m-0 cursor-pointer rounded border border-transparent p-0.5 duration-100 hover:border-gray-400 hover:bg-white", children: /* @__PURE__ */ n(Cn, { className: "h-4 w-4", onClick: (C) => C.stopPropagation() }) })
|
|
5089
5089
|
}
|
|
5090
|
-
) }) : p ? /* @__PURE__ */ n("span", { className: "duration absolute right-1.5 top-1/2 -translate-y-1/2 text-xs text-gray-500", children: /* @__PURE__ */ n(
|
|
5090
|
+
) }) : p ? /* @__PURE__ */ n("span", { className: "duration absolute right-1.5 top-1/2 -translate-y-1/2 text-xs text-gray-500", children: /* @__PURE__ */ n(Pi, { className: "h-3.5 w-3.5 fill-red-200 text-red-500" }) }) : null
|
|
5091
5091
|
]
|
|
5092
5092
|
}
|
|
5093
5093
|
),
|
|
5094
5094
|
/* @__PURE__ */ n(de, { children: p && /* @__PURE__ */ c("button", { className: "absolute right-0 top-0 flex h-full items-center gap-x-1 rounded bg-red-50 px-2 py-0.5 text-xs font-light text-red-500 opacity-0 group-hover:opacity-100", children: [
|
|
5095
|
-
/* @__PURE__ */ n(
|
|
5095
|
+
/* @__PURE__ */ n(Wn, { size: 12, className: "stroke-[3]" }),
|
|
5096
5096
|
" ",
|
|
5097
5097
|
/* @__PURE__ */ n("span", { className: "font-medium", children: p }),
|
|
5098
5098
|
" is editing this page"
|
|
@@ -5116,7 +5116,7 @@ const du = ({ page: e }) => {
|
|
|
5116
5116
|
}
|
|
5117
5117
|
) })
|
|
5118
5118
|
] });
|
|
5119
|
-
},
|
|
5119
|
+
}, ol = ({
|
|
5120
5120
|
pages: e,
|
|
5121
5121
|
tier: t,
|
|
5122
5122
|
pageTypes: s,
|
|
@@ -5141,7 +5141,7 @@ const du = ({ page: e }) => {
|
|
|
5141
5141
|
}
|
|
5142
5142
|
),
|
|
5143
5143
|
h.children && h.children.length > 0 && (d == null ? void 0 : d.includes(h.id)) && /* @__PURE__ */ n(
|
|
5144
|
-
|
|
5144
|
+
ol,
|
|
5145
5145
|
{
|
|
5146
5146
|
pages: h.children,
|
|
5147
5147
|
tier: t + 1,
|
|
@@ -5155,13 +5155,13 @@ const du = ({ page: e }) => {
|
|
|
5155
5155
|
)
|
|
5156
5156
|
] }, h.id)) });
|
|
5157
5157
|
}, fu = ({ close: e }) => {
|
|
5158
|
-
const { languages: t, setSelectedLang: s } = Fe(), { data: a } = Ge(), { data: r, isFetching: i } = On(), [l, o] =
|
|
5158
|
+
const { languages: t, setSelectedLang: s } = Fe(), { data: a } = Ge(), { data: r, isFetching: i } = On(), [l, o] = He(), { updateForSelectedPage: d, expandPagesOnSearch: h } = Rn(null), u = Rt(), m = l.get("page"), [y, g] = S(""), [p, f] = S(null), [v, x] = S(null), [N, I] = S(null), [L, C] = S(null), [P, U] = S(""), [J, ee] = S(null), [D, F] = S(null), [M, q] = S(u), [B, K] = S(!1), [, re] = Ue(vs), Ae = B && M !== u, { data: Oe, isFetching: me } = td(M), w = ae(
|
|
5159
5159
|
(A) => {
|
|
5160
5160
|
var O;
|
|
5161
5161
|
return (O = ve(a, { key: A })) == null ? void 0 : O.hasSlug;
|
|
5162
5162
|
},
|
|
5163
5163
|
[a]
|
|
5164
|
-
), b =
|
|
5164
|
+
), b = W(() => r ? Ae ? ye(r, (A) => !(Oe != null && Oe[A.id])) : rl(r, y, P, w) : [], [r, w, y, P, Oe, Ae]);
|
|
5165
5165
|
le(() => {
|
|
5166
5166
|
if (!Y(P)) return;
|
|
5167
5167
|
const A = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
@@ -5243,7 +5243,7 @@ const du = ({ page: e }) => {
|
|
|
5243
5243
|
"Empty List!",
|
|
5244
5244
|
/* @__PURE__ */ n("span", { className: "font-light", children: "Add new page to start" })
|
|
5245
5245
|
] }) : /* @__PURE__ */ n(
|
|
5246
|
-
|
|
5246
|
+
ol,
|
|
5247
5247
|
{
|
|
5248
5248
|
tier: 0,
|
|
5249
5249
|
pages: b,
|
|
@@ -5272,10 +5272,10 @@ const du = ({ page: e }) => {
|
|
|
5272
5272
|
J && /* @__PURE__ */ n(or, { page: J, onClose: () => ee(null), closePanel: e })
|
|
5273
5273
|
] });
|
|
5274
5274
|
}, gu = () => {
|
|
5275
|
-
const e =
|
|
5276
|
-
return e ? /* @__PURE__ */ n("div", { className: "max-h-9 w-full overflow-hidden pr-2", children:
|
|
5275
|
+
const e = ct("logo", null);
|
|
5276
|
+
return e ? /* @__PURE__ */ n("div", { className: "max-h-9 w-full overflow-hidden pr-2", children: Hs.createElement(e, {}) }) : null;
|
|
5277
5277
|
}, pu = () => {
|
|
5278
|
-
const [e] =
|
|
5278
|
+
const [e] = He(), t = e.get("page"), { data: s, isFetching: a } = We(), [r, i] = S(!1), { savePage: l } = Wt(), o = !!t && !Y(s), d = !t || !a && Y(s) || r, h = Et("enable-old-page-manager");
|
|
5279
5279
|
return /* @__PURE__ */ c(de, { children: [
|
|
5280
5280
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ c(Xe, { children: [
|
|
5281
5281
|
/* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ n(
|
|
@@ -5292,15 +5292,15 @@ const du = ({ page: e }) => {
|
|
|
5292
5292
|
) }),
|
|
5293
5293
|
/* @__PURE__ */ n(et, { side: "right", children: /* @__PURE__ */ n("p", { children: "Open pages manager" }) })
|
|
5294
5294
|
] }) }) }),
|
|
5295
|
-
/* @__PURE__ */ n(
|
|
5296
|
-
|
|
5295
|
+
/* @__PURE__ */ n(mi, { open: d, onOpenChange: (u) => !u && o && i(!1), children: /* @__PURE__ */ c(
|
|
5296
|
+
fi,
|
|
5297
5297
|
{
|
|
5298
5298
|
side: "left",
|
|
5299
5299
|
"aria-describedby": "pages-manager-description",
|
|
5300
5300
|
className: `${h ? "w-full !max-w-screen-md" : "!min-w-[50vh] !max-w-[800px] p-0"} z-50 border-border ${o ? "" : "sheet-hide-close-btn"}`,
|
|
5301
5301
|
children: [
|
|
5302
|
-
/* @__PURE__ */ c(
|
|
5303
|
-
/* @__PURE__ */ c(
|
|
5302
|
+
/* @__PURE__ */ c(gi, { className: `mb-3 ${h ? "" : "px-4 pt-4"}`, children: [
|
|
5303
|
+
/* @__PURE__ */ c(pi, { className: "flex items-center gap-2 text-sm font-semibold", children: [
|
|
5304
5304
|
/* @__PURE__ */ n("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary text-primary-foreground", children: /* @__PURE__ */ n(uc, { className: "h-4 w-4" }) }),
|
|
5305
5305
|
/* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
5306
5306
|
/* @__PURE__ */ n("span", { className: "text-sm font-semibold", children: "Pages" }),
|
|
@@ -5320,16 +5320,16 @@ const du = ({ page: e }) => {
|
|
|
5320
5320
|
}
|
|
5321
5321
|
) })
|
|
5322
5322
|
] });
|
|
5323
|
-
},
|
|
5323
|
+
}, cl = ({
|
|
5324
5324
|
showAdd: e = !0,
|
|
5325
5325
|
variant: t = "ghost"
|
|
5326
5326
|
}) => {
|
|
5327
|
-
const { fallbackLang: s, languages: a, selectedLang: r, setSelectedLang: i } = Fe(), l = Y(r) ? s : r, [, o] =
|
|
5327
|
+
const { fallbackLang: s, languages: a, selectedLang: r, setSelectedLang: i } = Fe(), l = Y(r) ? s : r, [, o] = He(), { isLocked: d } = Tt();
|
|
5328
5328
|
le(() => {
|
|
5329
5329
|
const v = new URLSearchParams(window.location.search), x = v.get("lang");
|
|
5330
5330
|
x && (a.includes(x) ? i(x) : (v.delete("lang"), o(v), i("")));
|
|
5331
5331
|
}, [a, o, i]);
|
|
5332
|
-
const [, h] = Ue(vs), { data: u } =
|
|
5332
|
+
const [, h] = Ue(vs), { data: u } = We(), { data: m } = St(), { data: y } = pt(), g = W(() => {
|
|
5333
5333
|
const v = Ks(
|
|
5334
5334
|
Be($(m, "languages"), (x) => {
|
|
5335
5335
|
const N = ve(y, { lang: x });
|
|
@@ -5401,7 +5401,7 @@ const du = ({ page: e }) => {
|
|
|
5401
5401
|
children: [
|
|
5402
5402
|
/* @__PURE__ */ n("div", { className: "text-slate-600", children: v.value }),
|
|
5403
5403
|
v.key === s && /* @__PURE__ */ c("small", { className: "flex items-center gap-x-1 text-[9px] leading-none text-orange-500", children: [
|
|
5404
|
-
/* @__PURE__ */ n(
|
|
5404
|
+
/* @__PURE__ */ n(ki, { fill: "orange", className: "h-2 w-2" }),
|
|
5405
5405
|
"Primary"
|
|
5406
5406
|
] })
|
|
5407
5407
|
]
|
|
@@ -5458,7 +5458,7 @@ function vu(e, t) {
|
|
|
5458
5458
|
queryFn: async () => {
|
|
5459
5459
|
if (!e.uid || !t.uid)
|
|
5460
5460
|
throw new Error("Both revision IDs are required for comparison");
|
|
5461
|
-
const r = (o) => o === "draft" || o === "live" ? o : "revision", i = (o) =>
|
|
5461
|
+
const r = (o) => o === "draft" || o === "live" ? o : "revision", i = (o) => oo(o.uid, `${o.label}:`, "");
|
|
5462
5462
|
return await a(s, {
|
|
5463
5463
|
action: G.GET_COMPARE_DATA,
|
|
5464
5464
|
data: {
|
|
@@ -5545,7 +5545,7 @@ function xu(e, t, s = "data.json") {
|
|
|
5545
5545
|
}
|
|
5546
5546
|
function qn(e, t = !0, s = !1) {
|
|
5547
5547
|
if (Ia(e)) {
|
|
5548
|
-
const a =
|
|
5548
|
+
const a = co(e);
|
|
5549
5549
|
if (sn(a, "{") || sn(a, "[") || t && (a === "true" || a === "false" || a === "null" || /^-?\d+(\.\d+)?([eE][+-]?\d+)?$/.test(a)))
|
|
5550
5550
|
try {
|
|
5551
5551
|
const i = JSON.parse(a);
|
|
@@ -5557,7 +5557,7 @@ function qn(e, t = !0, s = !1) {
|
|
|
5557
5557
|
}
|
|
5558
5558
|
return e;
|
|
5559
5559
|
}
|
|
5560
|
-
return
|
|
5560
|
+
return Jr(e) ? Be(e, (a) => qn(a, t, s)) : uo(e) ? Wr(e, (a) => qn(a, t, s)) : e;
|
|
5561
5561
|
}
|
|
5562
5562
|
const wu = (e) => {
|
|
5563
5563
|
switch (e) {
|
|
@@ -5576,11 +5576,11 @@ const wu = (e) => {
|
|
|
5576
5576
|
return s.filter((l) => a.includes(l)).map((l) => ({ key: l, label: wu(l) })).filter((l) => l.key.length > 0);
|
|
5577
5577
|
};
|
|
5578
5578
|
function Eu({ open: e, compare: t, onOpenChange: s }) {
|
|
5579
|
-
const a = t[0], r = t[1], [i, l] = S(null), [o, d] = S("split"), [h, u] = S(!1), [m, y] = S("blocks"), { data: g, isLoading: p } = vu(a, r), { leftData: f, rightData: v, options: x } =
|
|
5579
|
+
const a = t[0], r = t[1], [i, l] = S(null), [o, d] = S("split"), [h, u] = S(!1), [m, y] = S("blocks"), { data: g, isLoading: p } = vu(a, r), { leftData: f, rightData: v, options: x } = W(() => {
|
|
5580
5580
|
var F, M;
|
|
5581
5581
|
const P = (F = g == null ? void 0 : g.version1) == null ? void 0 : F[m], U = (M = g == null ? void 0 : g.version2) == null ? void 0 : M[m], J = qn(P), ee = qn(U), D = Nu(g == null ? void 0 : g.version1, g == null ? void 0 : g.version2);
|
|
5582
5582
|
return { leftData: J, rightData: ee, options: D };
|
|
5583
|
-
}, [g, m]), N =
|
|
5583
|
+
}, [g, m]), N = W(() => !f || !v ? "" : xu(f, v), [f, v]), I = W(() => {
|
|
5584
5584
|
if (!N) return [];
|
|
5585
5585
|
try {
|
|
5586
5586
|
return _c(N);
|
|
@@ -5628,7 +5628,7 @@ function Eu({ open: e, compare: t, onOpenChange: s }) {
|
|
|
5628
5628
|
] })
|
|
5629
5629
|
] }) })
|
|
5630
5630
|
] }) }),
|
|
5631
|
-
p ? /* @__PURE__ */ n(
|
|
5631
|
+
p ? /* @__PURE__ */ n(Ji, { fullScreen: !1 }) : /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ c("div", { className: "relative min-h-0 flex-1", children: [
|
|
5632
5632
|
/* @__PURE__ */ c("div", { className: "absolute -top-5 z-50 mt-0.5 flex w-full items-center justify-between gap-2", children: [
|
|
5633
5633
|
/* @__PURE__ */ n("div", { className: "flex w-1/2 items-center justify-center gap-2", children: /* @__PURE__ */ n(Tr, { version: a }) }),
|
|
5634
5634
|
/* @__PURE__ */ n("div", { className: "flex w-1/2 items-center justify-center gap-2", children: /* @__PURE__ */ n(Tr, { version: r }) })
|
|
@@ -5728,11 +5728,11 @@ const Au = () => {
|
|
|
5728
5728
|
/* @__PURE__ */ n(Da, { className: "h-3 w-3" }),
|
|
5729
5729
|
/* @__PURE__ */ n("span", { className: "text-[11px] leading-tight", children: "Published" })
|
|
5730
5730
|
] }) : e === "unsaved" ? /* @__PURE__ */ c("div", { className: "flex items-center gap-1 rounded-full bg-red-500/10 px-1.5 py-0.5 text-xs text-red-600", children: [
|
|
5731
|
-
/* @__PURE__ */ n(
|
|
5731
|
+
/* @__PURE__ */ n(_i, { className: "h-3 w-3" }),
|
|
5732
5732
|
/* @__PURE__ */ n("span", { className: "text-[11px] leading-tight", children: "Unsaved changes" })
|
|
5733
5733
|
] }) : /* @__PURE__ */ n("span", { className: "rounded bg-purple-500/10 px-1.5 py-0.5 font-mono text-xs font-bold text-purple-600", children: e });
|
|
5734
5734
|
function Cu({ compare: e, setCompare: t, isComparisonEnabled: s }) {
|
|
5735
|
-
const { data: a } =
|
|
5735
|
+
const { data: a } = We(), { saveState: r } = Wt(), [i] = la();
|
|
5736
5736
|
if (!a) return null;
|
|
5737
5737
|
const l = !!e.find((h) => {
|
|
5738
5738
|
var u;
|
|
@@ -5747,14 +5747,14 @@ function Cu({ compare: e, setCompare: t, isComparisonEnabled: s }) {
|
|
|
5747
5747
|
/* @__PURE__ */ n("div", { className: "flex items-center pl-2 text-[11px] text-muted-foreground", children: !Y(i.lastSaved) && /* @__PURE__ */ c("span", { children: [
|
|
5748
5748
|
"Last updated",
|
|
5749
5749
|
" ",
|
|
5750
|
-
|
|
5750
|
+
xi(new Date(i.lastSaved), {
|
|
5751
5751
|
addSuffix: !0
|
|
5752
5752
|
})
|
|
5753
5753
|
] }) }),
|
|
5754
5754
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 pt-0.5", children: d ? /* @__PURE__ */ n($t, { tag: "unsaved" }) : null })
|
|
5755
5755
|
] }),
|
|
5756
5756
|
s && /* @__PURE__ */ n(
|
|
5757
|
-
|
|
5757
|
+
dl,
|
|
5758
5758
|
{
|
|
5759
5759
|
checked: l,
|
|
5760
5760
|
disabled: o,
|
|
@@ -5770,7 +5770,7 @@ function Cu({ compare: e, setCompare: t, isComparisonEnabled: s }) {
|
|
|
5770
5770
|
}
|
|
5771
5771
|
function ku() {
|
|
5772
5772
|
var q, B;
|
|
5773
|
-
const [e, t] = Ce.useState([]), [s, a] = Ce.useState(!1), [r, i] = Ce.useState(null), [l, o] = Ce.useState(!1), [d, h] = Ce.useState(!1), { data: u } =
|
|
5773
|
+
const [e, t] = Ce.useState([]), [s, a] = Ce.useState(!1), [r, i] = Ce.useState(null), [l, o] = Ce.useState(!1), [d, h] = Ce.useState(!1), { data: u } = We(), { data: m, isFetching: y, error: g, refetch: p } = Su(u == null ? void 0 : u.id), { mutate: f, isPending: v } = Au(), { mutate: x, isPending: N } = Tu(), I = Pe(), L = Vi(), C = Et("enable-page-revisions-compare"), { selectedLang: P, fallbackLang: U } = Fe(), J = P || U;
|
|
5774
5774
|
le(() => t([]), [u == null ? void 0 : u.id]);
|
|
5775
5775
|
const ee = (K) => {
|
|
5776
5776
|
r && x(
|
|
@@ -5802,7 +5802,7 @@ function ku() {
|
|
|
5802
5802
|
s && p();
|
|
5803
5803
|
}, [s, p]), /* @__PURE__ */ c(de, { children: [
|
|
5804
5804
|
/* @__PURE__ */ n(Ft, { children: /* @__PURE__ */ c(Xe, { children: [
|
|
5805
|
-
/* @__PURE__ */ c(
|
|
5805
|
+
/* @__PURE__ */ c(mi, { open: s, onOpenChange: a, children: [
|
|
5806
5806
|
/* @__PURE__ */ n(qo, { asChild: !0, children: /* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
5807
5807
|
/* @__PURE__ */ c(T, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
|
|
5808
5808
|
/* @__PURE__ */ n(hc, { className: "h-4 w-4" }),
|
|
@@ -5810,9 +5810,9 @@ function ku() {
|
|
|
5810
5810
|
] }),
|
|
5811
5811
|
/* @__PURE__ */ n("div", { className: "h-4 w-px bg-gray-200 dark:bg-gray-700" })
|
|
5812
5812
|
] }) }) }),
|
|
5813
|
-
/* @__PURE__ */ c(
|
|
5814
|
-
/* @__PURE__ */ c(
|
|
5815
|
-
/* @__PURE__ */ n(
|
|
5813
|
+
/* @__PURE__ */ c(fi, { className: "flex h-[100vh] flex-col", children: [
|
|
5814
|
+
/* @__PURE__ */ c(gi, { children: [
|
|
5815
|
+
/* @__PURE__ */ n(pi, { children: "Revision History" }),
|
|
5816
5816
|
(u == null ? void 0 : u.createdAt) && /* @__PURE__ */ c("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
5817
5817
|
"Page created on ",
|
|
5818
5818
|
ea(new Date(u.createdAt), "MMM d, yyyy 'at' h:mm a")
|
|
@@ -5945,7 +5945,7 @@ function Cr({
|
|
|
5945
5945
|
/* @__PURE__ */ n(lt, { permissions: [Te.RESTORE_REVISION, Te.DELETE_REVISION], children: /* @__PURE__ */ n(_u, { revision: e, onRestore: s, onDelete: a }) })
|
|
5946
5946
|
] }),
|
|
5947
5947
|
h && /* @__PURE__ */ n(
|
|
5948
|
-
|
|
5948
|
+
dl,
|
|
5949
5949
|
{
|
|
5950
5950
|
checked: g,
|
|
5951
5951
|
disabled: p,
|
|
@@ -6017,7 +6017,7 @@ function Iu({ compare: e, setCompare: t, pageId: s }) {
|
|
|
6017
6017
|
a && (e == null ? void 0 : e.length) > 1 && s && /* @__PURE__ */ n(Eu, { open: a, onOpenChange: r, compare: e })
|
|
6018
6018
|
] });
|
|
6019
6019
|
}
|
|
6020
|
-
function
|
|
6020
|
+
function dl({ checked: e, disabled: t, onChange: s, label: a = "Compare" }) {
|
|
6021
6021
|
return /* @__PURE__ */ n("div", { className: "absolute bottom-2 right-2", children: /* @__PURE__ */ c("label", { className: `flex cursor-pointer items-center gap-x-1 text-[11px] ${t ? "opacity-50" : ""}`, children: [
|
|
6022
6022
|
/* @__PURE__ */ n(
|
|
6023
6023
|
"input",
|
|
@@ -6040,7 +6040,7 @@ function _u({ revision: e, onRestore: t, onDelete: s }) {
|
|
|
6040
6040
|
] }) }),
|
|
6041
6041
|
/* @__PURE__ */ c(Dn, { align: "end", className: "text-xs", children: [
|
|
6042
6042
|
/* @__PURE__ */ n(lt, { permission: Te.RESTORE_REVISION, children: /* @__PURE__ */ c($e, { onClick: t, className: "cursor-pointer text-sm", children: [
|
|
6043
|
-
/* @__PURE__ */ n(
|
|
6043
|
+
/* @__PURE__ */ n(Ii, { className: "mr-2 h-4 w-4" }),
|
|
6044
6044
|
/* @__PURE__ */ n("span", { children: "Restore this version" })
|
|
6045
6045
|
] }) }),
|
|
6046
6046
|
/* @__PURE__ */ n(lt, { permission: Te.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ c(de, { children: [
|
|
@@ -6082,7 +6082,7 @@ function Lu({
|
|
|
6082
6082
|
] })
|
|
6083
6083
|
] }),
|
|
6084
6084
|
/* @__PURE__ */ n("div", { className: "py-2", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: "How would you like to handle your current edits?" }) }),
|
|
6085
|
-
/* @__PURE__ */ c(
|
|
6085
|
+
/* @__PURE__ */ c(ht, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
6086
6086
|
/* @__PURE__ */ n(T, { variant: "outline", className: "sm:flex-1", onClick: () => a(!1), disabled: r, children: r ? /* @__PURE__ */ c(de, { children: [
|
|
6087
6087
|
/* @__PURE__ */ n("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
6088
6088
|
"Saving as draft..."
|
|
@@ -6094,7 +6094,7 @@ function Lu({
|
|
|
6094
6094
|
/* @__PURE__ */ n("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
6095
6095
|
"Discarding current..."
|
|
6096
6096
|
] }) : /* @__PURE__ */ c(de, { children: [
|
|
6097
|
-
/* @__PURE__ */ n(
|
|
6097
|
+
/* @__PURE__ */ n(Ii, { className: "mr-2 h-4 w-4" }),
|
|
6098
6098
|
"Discard current"
|
|
6099
6099
|
] }) })
|
|
6100
6100
|
] })
|
|
@@ -6131,7 +6131,7 @@ function Du({
|
|
|
6131
6131
|
] })
|
|
6132
6132
|
] }),
|
|
6133
6133
|
/* @__PURE__ */ n("div", { className: "py-2", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: "This action cannot be undone. Are you sure you want to proceed?" }) }),
|
|
6134
|
-
/* @__PURE__ */ c(
|
|
6134
|
+
/* @__PURE__ */ c(ht, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
6135
6135
|
/* @__PURE__ */ n(T, { variant: "outline", className: "sm:flex-1", onClick: () => t(!1), disabled: r, children: "Cancel" }),
|
|
6136
6136
|
/* @__PURE__ */ n(T, { variant: "destructive", className: "sm:flex-1", onClick: a, disabled: r, children: r ? /* @__PURE__ */ c(de, { children: [
|
|
6137
6137
|
/* @__PURE__ */ n("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
@@ -6160,7 +6160,7 @@ const Ou = () => {
|
|
|
6160
6160
|
scope: "row",
|
|
6161
6161
|
className: `flex items-center gap-x-1 whitespace-nowrap px-6 py-2 text-gray-900 dark:text-white ${o ? "opacity-50" : ""}`,
|
|
6162
6162
|
children: [
|
|
6163
|
-
o ? /* @__PURE__ */ n(
|
|
6163
|
+
o ? /* @__PURE__ */ n(Pi, { className: "h-4 w-4 fill-red-200 text-red-500" }) : /* @__PURE__ */ n(
|
|
6164
6164
|
"input",
|
|
6165
6165
|
{
|
|
6166
6166
|
checked: xt(t, e == null ? void 0 : e.id),
|
|
@@ -6179,9 +6179,9 @@ const Ou = () => {
|
|
|
6179
6179
|
}
|
|
6180
6180
|
),
|
|
6181
6181
|
/* @__PURE__ */ n("td", { className: "px-2", children: a(e == null ? void 0 : e.pageType) }),
|
|
6182
|
-
/* @__PURE__ */ n("td", { className: "px-4 text-right", children:
|
|
6182
|
+
/* @__PURE__ */ n("td", { className: "px-4 text-right", children: Yr(e.changes) || "" }),
|
|
6183
6183
|
/* @__PURE__ */ n(de, { children: o && /* @__PURE__ */ c("button", { className: "absolute right-0 top-0 flex h-full items-center gap-x-1 rounded bg-red-50 px-2 py-0.5 text-xs font-light text-red-500 opacity-0 group-hover:opacity-100", children: [
|
|
6184
|
-
/* @__PURE__ */ n(
|
|
6184
|
+
/* @__PURE__ */ n(Wn, { size: 12, className: "stroke-[3]" }),
|
|
6185
6185
|
" ",
|
|
6186
6186
|
/* @__PURE__ */ n("span", { className: "font-medium", children: o }),
|
|
6187
6187
|
" is editing this page"
|
|
@@ -6192,19 +6192,19 @@ function Gu({
|
|
|
6192
6192
|
showModal: e = !1,
|
|
6193
6193
|
onClose: t = () => console.log("Cancelled")
|
|
6194
6194
|
}) {
|
|
6195
|
-
const [s] =
|
|
6195
|
+
const [s] = Ki(), [a, r] = S([]), i = Rt(), [l, o] = S(i), { data: d, isFetching: h } = Ou(), { data: u } = Ge(), m = ae((D) => {
|
|
6196
6196
|
var F;
|
|
6197
6197
|
return (F = ve(u, { key: D })) == null ? void 0 : F.hasSlug;
|
|
6198
|
-
}, [u]), y =
|
|
6198
|
+
}, [u]), y = W(
|
|
6199
6199
|
() => ye(u, (D) => !m(D.key)).map((D) => D.key),
|
|
6200
6200
|
[m, u]
|
|
6201
|
-
), p = ka(Be(d, "lang")).filter(Boolean), f =
|
|
6201
|
+
), p = ka(Be(d, "lang")).filter(Boolean), f = W(
|
|
6202
6202
|
() => ye(d, (D) => D.pageType === "theme" ? !1 : l === i ? D.lang === l || D.lang === "" : D.lang === l),
|
|
6203
6203
|
[d, l, i]
|
|
6204
|
-
), v =
|
|
6204
|
+
), v = W(
|
|
6205
6205
|
() => ye(f, (D) => !y.includes(D.pageType)),
|
|
6206
6206
|
[f, y]
|
|
6207
|
-
), x =
|
|
6207
|
+
), x = W(
|
|
6208
6208
|
() => ye(f, (D) => y.includes(D.pageType)),
|
|
6209
6209
|
[f, y]
|
|
6210
6210
|
), { mutate: N, isPending: I } = ar();
|
|
@@ -6216,7 +6216,7 @@ function Gu({
|
|
|
6216
6216
|
r((F) => ye(F, (M) => !xt(D, M)));
|
|
6217
6217
|
}, [s]);
|
|
6218
6218
|
const L = a.length === (f == null ? void 0 : f.length), C = (D) => {
|
|
6219
|
-
r((F) => xt(F, D) ? ye(F, (M) => M !== D) :
|
|
6219
|
+
r((F) => xt(F, D) ? ye(F, (M) => M !== D) : ho(F, D));
|
|
6220
6220
|
}, P = () => {
|
|
6221
6221
|
r(L ? [] : Be(f, "id"));
|
|
6222
6222
|
}, U = () => {
|
|
@@ -6232,7 +6232,7 @@ function Gu({
|
|
|
6232
6232
|
if (D === "theme") return "Theme";
|
|
6233
6233
|
const F = ve(u, { key: D });
|
|
6234
6234
|
return F ? F == null ? void 0 : F.name : D;
|
|
6235
|
-
}, ee =
|
|
6235
|
+
}, ee = W(() => {
|
|
6236
6236
|
const D = [
|
|
6237
6237
|
{ label: "Updated", top: "pt-2" },
|
|
6238
6238
|
...As(ye(v, { online: !0 }), "pageType"),
|
|
@@ -6251,7 +6251,7 @@ function Gu({
|
|
|
6251
6251
|
/* @__PURE__ */ n(nt, { className: "text-xs", children: "Select the pages you want to publish. Click publish when you're done." })
|
|
6252
6252
|
] }),
|
|
6253
6253
|
p.length > 0 && /* @__PURE__ */ n("div", { className: "my-[2px] mt-0", children: /* @__PURE__ */ n(
|
|
6254
|
-
|
|
6254
|
+
ll,
|
|
6255
6255
|
{
|
|
6256
6256
|
languages: [i, ...p],
|
|
6257
6257
|
selectedLanguage: l,
|
|
@@ -6300,7 +6300,7 @@ function Gu({
|
|
|
6300
6300
|
)
|
|
6301
6301
|
) })
|
|
6302
6302
|
] }) }),
|
|
6303
|
-
/* @__PURE__ */ c(
|
|
6303
|
+
/* @__PURE__ */ c(ht, { className: "mt-10 flex items-center justify-center", children: [
|
|
6304
6304
|
a.length > 0 && /* @__PURE__ */ c("span", { className: "text-center text-sm text-muted-foreground", children: [
|
|
6305
6305
|
a.length,
|
|
6306
6306
|
" Page",
|
|
@@ -6324,7 +6324,7 @@ const Uu = ({
|
|
|
6324
6324
|
/* @__PURE__ */ n(Ke, { children: r }),
|
|
6325
6325
|
/* @__PURE__ */ n(nt, { children: i })
|
|
6326
6326
|
] }),
|
|
6327
|
-
/* @__PURE__ */ c(
|
|
6327
|
+
/* @__PURE__ */ c(ht, { className: "flex gap-2", children: [
|
|
6328
6328
|
/* @__PURE__ */ n(
|
|
6329
6329
|
T,
|
|
6330
6330
|
{
|
|
@@ -6359,7 +6359,7 @@ const Uu = ({
|
|
|
6359
6359
|
});
|
|
6360
6360
|
};
|
|
6361
6361
|
function Mu({ onClose: e }) {
|
|
6362
|
-
const { data: t, isFetching: s } = Bu(), { mutateAsync: a, isPending: r } =
|
|
6362
|
+
const { data: t, isFetching: s } = Bu(), { mutateAsync: a, isPending: r } = Wc(), i = ct("settingComponent", null), l = mo(async (o) => (await a({ data: o }), !0), 300);
|
|
6363
6363
|
return i ? /* @__PURE__ */ n(je, { open: !0, onOpenChange: e, children: /* @__PURE__ */ c(ze, { className: "w-full", children: [
|
|
6364
6364
|
/* @__PURE__ */ n(Ve, { children: /* @__PURE__ */ n(Ke, { children: "Website Settings" }) }),
|
|
6365
6365
|
s ? /* @__PURE__ */ c("div", { className: "w-full space-y-3 py-4", children: [
|
|
@@ -6369,7 +6369,7 @@ function Mu({ onClose: e }) {
|
|
|
6369
6369
|
/* @__PURE__ */ n("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
6370
6370
|
/* @__PURE__ */ n("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
6371
6371
|
/* @__PURE__ */ n("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
6372
|
-
] }) : /* @__PURE__ */ n("div", { children:
|
|
6372
|
+
] }) : /* @__PURE__ */ n("div", { children: Hs.createElement(i, {
|
|
6373
6373
|
data: t || {},
|
|
6374
6374
|
onSave: r ? () => {
|
|
6375
6375
|
} : l,
|
|
@@ -6379,7 +6379,7 @@ function Mu({ onClose: e }) {
|
|
|
6379
6379
|
] }) }) : null;
|
|
6380
6380
|
}
|
|
6381
6381
|
const Fu = () => {
|
|
6382
|
-
const { selectedLang: e, fallbackLang: t } = Fe(), s =
|
|
6382
|
+
const { selectedLang: e, fallbackLang: t } = Fe(), s = ct("getPreviewUrl", async (m) => m), [a, r] = S(""), { data: i } = We(), { data: l } = pt(), { data: o } = Ge(), d = W(
|
|
6383
6383
|
() => {
|
|
6384
6384
|
var m;
|
|
6385
6385
|
return (m = l == null ? void 0 : l.find((y) => (y == null ? void 0 : y.lang) === e)) == null ? void 0 : m.slug;
|
|
@@ -6420,7 +6420,7 @@ const Fu = () => {
|
|
|
6420
6420
|
/* @__PURE__ */ n("div", { className: "h-4 w-px bg-gray-200 dark:bg-gray-700" })
|
|
6421
6421
|
] });
|
|
6422
6422
|
}, qu = () => {
|
|
6423
|
-
const [e, t] = S(!1), { isLocked: s } = Tt(), { savePageAsync: a, saveState: r } =
|
|
6423
|
+
const [e, t] = S(!1), { isLocked: s } = Tt(), { savePageAsync: a, saveState: r } = Wt();
|
|
6424
6424
|
le(() => {
|
|
6425
6425
|
const h = (u) => {
|
|
6426
6426
|
r === "UNSAVED" && (u.preventDefault(), u.returnValue = !1);
|
|
@@ -6431,12 +6431,12 @@ const Fu = () => {
|
|
|
6431
6431
|
}, [r]);
|
|
6432
6432
|
const i = ae(async () => {
|
|
6433
6433
|
e || (t(!0), await a(), t(!1));
|
|
6434
|
-
}, [a, e]), { buttonIcon: l, buttonClass: o, tooltipContent: d } =
|
|
6434
|
+
}, [a, e]), { buttonIcon: l, buttonClass: o, tooltipContent: d } = W(() => {
|
|
6435
6435
|
switch (r) {
|
|
6436
6436
|
case "UNSAVED":
|
|
6437
6437
|
return {
|
|
6438
6438
|
tooltipContent: ce.SAVEDRAFT,
|
|
6439
|
-
buttonIcon: /* @__PURE__ */ n(
|
|
6439
|
+
buttonIcon: /* @__PURE__ */ n(_i, { className: "h-4 w-4" }),
|
|
6440
6440
|
buttonClass: "gap-x-1"
|
|
6441
6441
|
};
|
|
6442
6442
|
case "SAVING":
|
|
@@ -6448,7 +6448,7 @@ const Fu = () => {
|
|
|
6448
6448
|
case "SAVED":
|
|
6449
6449
|
return {
|
|
6450
6450
|
tooltipContent: ce.SAVED,
|
|
6451
|
-
buttonIcon: /* @__PURE__ */ n(
|
|
6451
|
+
buttonIcon: /* @__PURE__ */ n(Ni, { className: "h-4 w-4" }),
|
|
6452
6452
|
buttonClass: "text-green-500 gap-x-1"
|
|
6453
6453
|
};
|
|
6454
6454
|
}
|
|
@@ -6459,7 +6459,7 @@ const Fu = () => {
|
|
|
6459
6459
|
d
|
|
6460
6460
|
] });
|
|
6461
6461
|
}, ju = () => {
|
|
6462
|
-
const { selectedLang: e } = Fe(), { data: t } = Gt(), { data: s } = pt(), [a, r] = S(!1), [i, l] = S(!1), [o, d] = S(null), { savePageAsync: h } =
|
|
6462
|
+
const { selectedLang: e } = Fe(), { data: t } = Gt(), { data: s } = pt(), [a, r] = S(!1), [i, l] = S(!1), [o, d] = S(null), { savePageAsync: h } = Wt(), [u, m] = S(!1), { data: y } = We(), { mutate: g, isPending: p } = ar(), { needTranslations: f } = Wt(), v = f(), { buttonText: x, buttonClassName: N, isPublished: I } = W(() => {
|
|
6463
6463
|
const ee = y && (y == null ? void 0 : y.online);
|
|
6464
6464
|
return {
|
|
6465
6465
|
buttonClassName: ee ? "hover:bg-green-600 bg-green-500" : "",
|
|
@@ -6479,7 +6479,7 @@ const Fu = () => {
|
|
|
6479
6479
|
m(!1), C();
|
|
6480
6480
|
}, U = async () => {
|
|
6481
6481
|
m(!1), await h();
|
|
6482
|
-
}, J =
|
|
6482
|
+
}, J = W(() => Be(s ?? [], "id"), [s]);
|
|
6483
6483
|
return /* @__PURE__ */ c(de, { children: [
|
|
6484
6484
|
/* @__PURE__ */ c("div", { className: "flex", children: [
|
|
6485
6485
|
/* @__PURE__ */ c(
|
|
@@ -6571,15 +6571,15 @@ const Fu = () => {
|
|
|
6571
6571
|
)
|
|
6572
6572
|
] });
|
|
6573
6573
|
}, zu = () => {
|
|
6574
|
-
const e =
|
|
6574
|
+
const e = ct("settingComponent", null), [t, s] = S(!1);
|
|
6575
6575
|
return e ? /* @__PURE__ */ c(de, { children: [
|
|
6576
|
-
/* @__PURE__ */ n(Vt, { content: ce.WEBSITEDATA, children: /* @__PURE__ */ n(T, { variant: "ghost", size: "icon", className: "gap-2", onClick: () => s(!0), children: /* @__PURE__ */ n(
|
|
6576
|
+
/* @__PURE__ */ n(Vt, { content: ce.WEBSITEDATA, children: /* @__PURE__ */ n(T, { variant: "ghost", size: "icon", className: "gap-2", onClick: () => s(!0), children: /* @__PURE__ */ n(Li, { className: "h-4 w-4" }) }) }),
|
|
6577
6577
|
t && /* @__PURE__ */ n(Mu, { onClose: () => s(!1) }),
|
|
6578
6578
|
/* @__PURE__ */ n("div", { className: "h-4 w-px bg-gray-200 dark:bg-gray-700" })
|
|
6579
6579
|
] }) : null;
|
|
6580
6580
|
};
|
|
6581
6581
|
function Vu() {
|
|
6582
|
-
const { isLocked: e } = Tt(), [t] =
|
|
6582
|
+
const { isLocked: e } = Tt(), [t] = He(), s = t.get("lang"), a = $i(s);
|
|
6583
6583
|
return e || !a ? /* @__PURE__ */ n("div", {}) : /* @__PURE__ */ c("div", { className: "flex items-center justify-end gap-1", children: [
|
|
6584
6584
|
/* @__PURE__ */ n(ku, {}),
|
|
6585
6585
|
/* @__PURE__ */ n(lt, { permission: Te.EDIT_THEME, children: /* @__PURE__ */ n($u, {}) }),
|
|
@@ -6604,7 +6604,7 @@ const Ku = ({
|
|
|
6604
6604
|
disabled: !e,
|
|
6605
6605
|
onKeyDown: (a) => a.stopPropagation()
|
|
6606
6606
|
}
|
|
6607
|
-
),
|
|
6607
|
+
), Hu = ({
|
|
6608
6608
|
dynamicPage: e,
|
|
6609
6609
|
setDynamicPage: t,
|
|
6610
6610
|
searchQuery: s,
|
|
@@ -6641,7 +6641,7 @@ const Ku = ({
|
|
|
6641
6641
|
))
|
|
6642
6642
|
] })
|
|
6643
6643
|
] });
|
|
6644
|
-
},
|
|
6644
|
+
}, Wu = () => {
|
|
6645
6645
|
const {
|
|
6646
6646
|
dynamicPage: e,
|
|
6647
6647
|
dynamicPages: t,
|
|
@@ -6651,11 +6651,11 @@ const Ku = ({
|
|
|
6651
6651
|
updateDynamicPage: i,
|
|
6652
6652
|
updateSearchQuery: l,
|
|
6653
6653
|
onChangeLanguage: o
|
|
6654
|
-
} =
|
|
6654
|
+
} = ji(), d = tt(void 0);
|
|
6655
6655
|
return le(() => {
|
|
6656
6656
|
d.current !== a && e && (o(), d.current = a);
|
|
6657
6657
|
}, [a, t]), /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
6658
|
-
|
|
6658
|
+
Hu,
|
|
6659
6659
|
{
|
|
6660
6660
|
dynamicPage: e,
|
|
6661
6661
|
setDynamicPage: i,
|
|
@@ -6723,7 +6723,7 @@ const Ku = ({
|
|
|
6723
6723
|
/* @__PURE__ */ n("h1", { className: "text-lg font-medium", children: e ? "Select a page" : "No pages found" }),
|
|
6724
6724
|
/* @__PURE__ */ n("p", { className: "pt-2 text-center text-sm font-light text-gray-600", children: e ? "Please select a page from the list in the top header. This will enable you to edit the page." : "Please add a new page" })
|
|
6725
6725
|
] }) }), Yu = () => {
|
|
6726
|
-
const { data: e } = Gt(), t = tr(), { data: s, isFetching: a } =
|
|
6726
|
+
const { data: e } = Gt(), t = tr(), { data: s, isFetching: a } = We(), r = $(s, "dynamic", !1), i = Et("dynamic-page-selector"), { dynamicPage: l, allLangPages: o } = ji(), d = o.length > 0, h = e == null ? void 0 : e.slug, u = !h, m = Vi(), g = (u ? `Partial: ${e == null ? void 0 : e.name} ` : `${h}${t}`).replace(window.location.host, "");
|
|
6727
6727
|
return /* @__PURE__ */ c("div", { className: "relative z-10 flex items-center gap-x-1", children: [
|
|
6728
6728
|
/* @__PURE__ */ n(
|
|
6729
6729
|
"div",
|
|
@@ -6743,7 +6743,7 @@ const Ku = ({
|
|
|
6743
6743
|
a && "pointer-events-none cursor-not-allowed opacity-50"
|
|
6744
6744
|
),
|
|
6745
6745
|
children: [
|
|
6746
|
-
/* @__PURE__ */ n(
|
|
6746
|
+
/* @__PURE__ */ n(cl, {}),
|
|
6747
6747
|
/* @__PURE__ */ c("div", { className: "flex w-full items-center overflow-hidden", children: [
|
|
6748
6748
|
/* @__PURE__ */ n(
|
|
6749
6749
|
"div",
|
|
@@ -6762,7 +6762,7 @@ const Ku = ({
|
|
|
6762
6762
|
),
|
|
6763
6763
|
r && !a && i && /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
6764
6764
|
!l && /* @__PURE__ */ n(Ju, { hasDynamicPage: d }),
|
|
6765
|
-
/* @__PURE__ */ n(
|
|
6765
|
+
/* @__PURE__ */ n(Wu, {})
|
|
6766
6766
|
] })
|
|
6767
6767
|
] });
|
|
6768
6768
|
}, Xu = () => /* @__PURE__ */ c("div", { className: "flex h-full w-full items-center justify-between px-2", children: [
|
|
@@ -6784,21 +6784,21 @@ const Ku = ({
|
|
|
6784
6784
|
return {
|
|
6785
6785
|
...a,
|
|
6786
6786
|
...fs(s, [
|
|
6787
|
-
...
|
|
6787
|
+
...fo(a),
|
|
6788
6788
|
"_type",
|
|
6789
6789
|
"_id",
|
|
6790
6790
|
"_name",
|
|
6791
6791
|
"_parent",
|
|
6792
6792
|
"_bindings"
|
|
6793
6793
|
]),
|
|
6794
|
-
...
|
|
6794
|
+
...go(s, (r, i) => Qr(i, "_attrs")),
|
|
6795
6795
|
...s
|
|
6796
6796
|
};
|
|
6797
6797
|
}
|
|
6798
6798
|
return s;
|
|
6799
6799
|
}), th = (e) => {
|
|
6800
6800
|
const t = Oc();
|
|
6801
|
-
return
|
|
6801
|
+
return W(() => {
|
|
6802
6802
|
if (!e || Y(e)) return { blocks: [] };
|
|
6803
6803
|
const s = ye(
|
|
6804
6804
|
e,
|
|
@@ -6812,7 +6812,7 @@ const Ku = ({
|
|
|
6812
6812
|
action: "GET_LIBRARY_ITEM",
|
|
6813
6813
|
data: { id: e.id }
|
|
6814
6814
|
}), r = $(a, "html", ""), i = $(a, "blocks", []);
|
|
6815
|
-
return
|
|
6815
|
+
return Jr(i) ? i : Lo(r);
|
|
6816
6816
|
},
|
|
6817
6817
|
async getUILibraryBlocks(e, t, s) {
|
|
6818
6818
|
try {
|
|
@@ -7000,7 +7000,7 @@ const Ku = ({
|
|
|
7000
7000
|
] }),
|
|
7001
7001
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n("p", { className: "text-sm text-destructive", children: m }) }),
|
|
7002
7002
|
/* @__PURE__ */ n(T, { type: "submit", className: "w-full", disabled: !f || g.isPending, children: g.isPending ? /* @__PURE__ */ c(de, { children: [
|
|
7003
|
-
/* @__PURE__ */ n(
|
|
7003
|
+
/* @__PURE__ */ n(Di, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
7004
7004
|
"Logging in..."
|
|
7005
7005
|
] }) : "Login" })
|
|
7006
7006
|
] }) }),
|
|
@@ -7039,7 +7039,7 @@ const Ku = ({
|
|
|
7039
7039
|
] }) });
|
|
7040
7040
|
};
|
|
7041
7041
|
let Ga = ih;
|
|
7042
|
-
const lh = () =>
|
|
7042
|
+
const lh = () => W(() => Ga, [Ga]), Yf = (e) => {
|
|
7043
7043
|
Ga = e;
|
|
7044
7044
|
}, oh = () => {
|
|
7045
7045
|
const e = lh();
|
|
@@ -7050,7 +7050,7 @@ const lh = () => H(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7050
7050
|
}) => {
|
|
7051
7051
|
const [s, a] = S(e.slug || ""), { mutate: r, isPending: i } = _d(), { data: l } = Ge(), o = ve(l, { key: e == null ? void 0 : e.pageType }), d = (u) => {
|
|
7052
7052
|
if (u.preventDefault(), !(e != null && e.primaryPage) && Object.keys(Le).some((g) => s === `/${g}` || sn(s, `/${g}/`))) {
|
|
7053
|
-
|
|
7053
|
+
H.error("Error", {
|
|
7054
7054
|
description: "Slugs cannot start with a language code for primary page"
|
|
7055
7055
|
});
|
|
7056
7056
|
return;
|
|
@@ -7110,7 +7110,7 @@ const lh = () => H(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7110
7110
|
)
|
|
7111
7111
|
] })
|
|
7112
7112
|
] }),
|
|
7113
|
-
/* @__PURE__ */ n(
|
|
7113
|
+
/* @__PURE__ */ n(ht, { children: /* @__PURE__ */ n(
|
|
7114
7114
|
T,
|
|
7115
7115
|
{
|
|
7116
7116
|
type: "submit",
|
|
@@ -7121,7 +7121,7 @@ const lh = () => H(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7121
7121
|
] })
|
|
7122
7122
|
] }) });
|
|
7123
7123
|
}, dh = () => {
|
|
7124
|
-
const [, e] = Ue(vs), { selectedLang: t, fallbackLang: s, setSelectedLang: a } = Fe(), { data: r, isFetching: i } = pt(), { data: l } =
|
|
7124
|
+
const [, e] = Ue(vs), { selectedLang: t, fallbackLang: s, setSelectedLang: a } = Fe(), { data: r, isFetching: i } = pt(), { data: l } = We(), { data: o } = Ge(), d = W(() => {
|
|
7125
7125
|
const x = o == null ? void 0 : o.find((N) => N.key === (l == null ? void 0 : l.pageType));
|
|
7126
7126
|
return l != null && l.dynamic ? x == null ? void 0 : x.dynamicSlug : "";
|
|
7127
7127
|
}, [o, l == null ? void 0 : l.pageType, l == null ? void 0 : l.dynamic]), [h, u] = S(null), [m, y] = S(null), [g, p] = S(null), { data: f } = St(), v = ye(
|
|
@@ -7201,7 +7201,7 @@ const lh = () => H(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7201
7201
|
P.stopPropagation(), y(x);
|
|
7202
7202
|
},
|
|
7203
7203
|
children: [
|
|
7204
|
-
/* @__PURE__ */ n(
|
|
7204
|
+
/* @__PURE__ */ n(Si, { className: "size-3" }),
|
|
7205
7205
|
ce.UNPUBLISH
|
|
7206
7206
|
]
|
|
7207
7207
|
}
|
|
@@ -7255,8 +7255,8 @@ const lh = () => H(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7255
7255
|
}) => {
|
|
7256
7256
|
const { data: s } = St();
|
|
7257
7257
|
return !Ie(s, "languages") || !$(s, "languages", []).length ? null : /* @__PURE__ */ n(T, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ n(wc, { className: "w-4 h-4" }) });
|
|
7258
|
-
},
|
|
7259
|
-
id:
|
|
7258
|
+
}, ul = "lang", hh = {
|
|
7259
|
+
id: ul,
|
|
7260
7260
|
label: "Languages",
|
|
7261
7261
|
position: "top",
|
|
7262
7262
|
panel: dh,
|
|
@@ -7309,7 +7309,7 @@ function It({
|
|
|
7309
7309
|
/* @__PURE__ */ n(Sn, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ c(Kn, { children: [
|
|
7310
7310
|
/* @__PURE__ */ n(Vo, { className: "border-none", placeholder: "Search..." }),
|
|
7311
7311
|
/* @__PURE__ */ c(
|
|
7312
|
-
|
|
7312
|
+
ci,
|
|
7313
7313
|
{
|
|
7314
7314
|
onWheel: (p) => {
|
|
7315
7315
|
try {
|
|
@@ -7321,7 +7321,7 @@ function It({
|
|
|
7321
7321
|
}
|
|
7322
7322
|
},
|
|
7323
7323
|
children: [
|
|
7324
|
-
/* @__PURE__ */ n(
|
|
7324
|
+
/* @__PURE__ */ n(Hn, { children: "No option found." }),
|
|
7325
7325
|
/* @__PURE__ */ c(_t, { children: [
|
|
7326
7326
|
l.length > 0 && /* @__PURE__ */ c(
|
|
7327
7327
|
ft,
|
|
@@ -7369,7 +7369,7 @@ function It({
|
|
|
7369
7369
|
}
|
|
7370
7370
|
const mh = () => {
|
|
7371
7371
|
const { selectedLang: e } = Fe(), { data: t, isFetching: s } = pt();
|
|
7372
|
-
return { data:
|
|
7372
|
+
return { data: W(() => ve(t, { lang: e || "" }) || {}, [t, e]), isFetching: s };
|
|
7373
7373
|
}, fh = () => {
|
|
7374
7374
|
var l;
|
|
7375
7375
|
const t = (l = document.getElementById("canvas-iframe").contentDocument) == null ? void 0 : l.body.innerHTML;
|
|
@@ -7425,7 +7425,7 @@ const mh = () => {
|
|
|
7425
7425
|
variant: "ghost",
|
|
7426
7426
|
size: "sm",
|
|
7427
7427
|
onClick: () => d(),
|
|
7428
|
-
children: h ? /* @__PURE__ */ n(
|
|
7428
|
+
children: h ? /* @__PURE__ */ n(Di, { className: "h-3 w-3 animate-spin text-yellow-500" }) : /* @__PURE__ */ n(Ec, { className: "text-yellow-500" })
|
|
7429
7429
|
}
|
|
7430
7430
|
);
|
|
7431
7431
|
}, gh = ({
|
|
@@ -7568,9 +7568,9 @@ const mh = () => {
|
|
|
7568
7568
|
}, I = () => {
|
|
7569
7569
|
m != null && m.position && f.current && (f.current.focus(), f.current.setSelectionRange(m.position, m.position + 1));
|
|
7570
7570
|
};
|
|
7571
|
-
return /* @__PURE__ */ n("div", { className: "space-y-2", children: /* @__PURE__ */ c(
|
|
7571
|
+
return /* @__PURE__ */ n("div", { className: "space-y-2", children: /* @__PURE__ */ c(yi, { value: h, onValueChange: u, className: "w-full", children: [
|
|
7572
7572
|
/* @__PURE__ */ c("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
7573
|
-
/* @__PURE__ */ c(
|
|
7573
|
+
/* @__PURE__ */ c(vi, { className: "grid w-[200px] grid-cols-2", children: [
|
|
7574
7574
|
/* @__PURE__ */ c(Mn, { value: "edit", className: "flex items-center gap-1", children: [
|
|
7575
7575
|
/* @__PURE__ */ n(Sc, { className: "h-4 w-4" }),
|
|
7576
7576
|
/* @__PURE__ */ n("span", { children: "Edit" })
|
|
@@ -7628,8 +7628,8 @@ const mh = () => {
|
|
|
7628
7628
|
}
|
|
7629
7629
|
),
|
|
7630
7630
|
m && /* @__PURE__ */ c(In, { variant: "destructive", className: "mt-2", children: [
|
|
7631
|
-
/* @__PURE__ */ n(
|
|
7632
|
-
/* @__PURE__ */ c(
|
|
7631
|
+
/* @__PURE__ */ n(Oi, { className: "h-4 w-4" }),
|
|
7632
|
+
/* @__PURE__ */ c(bi, { className: "flex flex-col", children: [
|
|
7633
7633
|
/* @__PURE__ */ n("span", { className: "font-medium", children: "Invalid JSON" }),
|
|
7634
7634
|
/* @__PURE__ */ n("span", { className: "text-sm", children: m.message }),
|
|
7635
7635
|
m.line && m.column && /* @__PURE__ */ c("span", { className: "text-sm", children: [
|
|
@@ -7671,8 +7671,8 @@ const mh = () => {
|
|
|
7671
7671
|
value: d,
|
|
7672
7672
|
newCursorPos: h
|
|
7673
7673
|
};
|
|
7674
|
-
},
|
|
7675
|
-
const { t: e } = Oo(), [, t] =
|
|
7674
|
+
}, hl = () => {
|
|
7675
|
+
const { t: e } = Oo(), [, t] = Ws(), { data: s } = We(), { data: a } = Qi(), { data: r, isFetching: i } = mh(), l = r == null ? void 0 : r.seo, o = tt(null), d = s == null ? void 0 : s.id, h = s == null ? void 0 : s.pageType, u = Xi(h), { selectedLang: m, fallbackLang: y } = Fe(), g = m || y, p = Et("enable-seo-meta-tab"), [f, v] = S(!1), [x, N] = S(!1), [I, L] = S(!1), [C, P] = S(null), [U, J] = S({
|
|
7676
7676
|
keyword: "",
|
|
7677
7677
|
title: "",
|
|
7678
7678
|
description: "",
|
|
@@ -7735,9 +7735,9 @@ const mh = () => {
|
|
|
7735
7735
|
ogDescription: $(E, "seo.ogDescription", "")
|
|
7736
7736
|
// Keep jsonLD as is
|
|
7737
7737
|
};
|
|
7738
|
-
J(R),
|
|
7738
|
+
J(R), H.success(e("SEO fields reset to defaults"));
|
|
7739
7739
|
} catch (E) {
|
|
7740
|
-
|
|
7740
|
+
H.error(e("Failed to reset SEO fields")), console.error("Reset SEO error:", E);
|
|
7741
7741
|
} finally {
|
|
7742
7742
|
v(!1);
|
|
7743
7743
|
}
|
|
@@ -7749,9 +7749,9 @@ const mh = () => {
|
|
|
7749
7749
|
...U,
|
|
7750
7750
|
jsonLD: $(E, "seo.jsonLD", "")
|
|
7751
7751
|
};
|
|
7752
|
-
J(R),
|
|
7752
|
+
J(R), H.success(e("JSON-LD reset to default"));
|
|
7753
7753
|
} catch (E) {
|
|
7754
|
-
|
|
7754
|
+
H.error(e("Failed to reset JSON-LD")), console.error("Reset JSON-LD error:", E);
|
|
7755
7755
|
} finally {
|
|
7756
7756
|
N(!1);
|
|
7757
7757
|
}
|
|
@@ -7767,9 +7767,9 @@ const mh = () => {
|
|
|
7767
7767
|
ogImageId: $(E, "seo.ogImageId", ""),
|
|
7768
7768
|
metaOther: $(E, "seo.metaOther", "{}")
|
|
7769
7769
|
};
|
|
7770
|
-
J(R),
|
|
7770
|
+
J(R), H.success(e("Meta Tag fields reset to defaults"));
|
|
7771
7771
|
} catch (E) {
|
|
7772
|
-
|
|
7772
|
+
H.error(e("Failed to reset Meta Tag fields")), console.error("Reset Meta Tag error:", E);
|
|
7773
7773
|
} finally {
|
|
7774
7774
|
v(!1);
|
|
7775
7775
|
}
|
|
@@ -7778,7 +7778,7 @@ const mh = () => {
|
|
|
7778
7778
|
{ id: r == null ? void 0 : r.id, seo: U, primaryPage: d },
|
|
7779
7779
|
{
|
|
7780
7780
|
onSuccess: () => {
|
|
7781
|
-
console.log("SEO & JSON-LD updated successfully", U), ee.current[g] = U,
|
|
7781
|
+
console.log("SEO & JSON-LD updated successfully", U), ee.current[g] = U, H.success("SEO & JSON-LD updated successfully");
|
|
7782
7782
|
}
|
|
7783
7783
|
}
|
|
7784
7784
|
);
|
|
@@ -7820,7 +7820,7 @@ const mh = () => {
|
|
|
7820
7820
|
name: E,
|
|
7821
7821
|
value: typeof R.fieldValue == "string" ? R.fieldValue.replace(/^"(.*)"$/, "$1") : R.fieldValue
|
|
7822
7822
|
}
|
|
7823
|
-
}), R.error &&
|
|
7823
|
+
}), R.error && H.error(
|
|
7824
7824
|
/* @__PURE__ */ c("div", { children: [
|
|
7825
7825
|
/* @__PURE__ */ n("h2", { children: "Failed to generate:" }),
|
|
7826
7826
|
/* @__PURE__ */ n("p", { children: R.error })
|
|
@@ -7828,17 +7828,17 @@ const mh = () => {
|
|
|
7828
7828
|
);
|
|
7829
7829
|
};
|
|
7830
7830
|
return /* @__PURE__ */ c("div", { className: "relative flex h-full flex-col", "data-panel-id": "seo", children: [
|
|
7831
|
-
!B && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center backdrop-blur-sm", children: /* @__PURE__ */ n(In, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ n(
|
|
7831
|
+
!B && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center backdrop-blur-sm", children: /* @__PURE__ */ n(In, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ n(bi, { children: e("You don't have permission to edit SEO settings. Contact your administrator for access.") }) }) }),
|
|
7832
7832
|
/* @__PURE__ */ c("div", { className: "no-scrollbar flex-grow overflow-y-auto px-2 pb-20", children: [
|
|
7833
7833
|
/* @__PURE__ */ c("div", { className: "mb-4 flex w-full items-center justify-between rounded-md bg-gray-100 px-2 py-1 text-left text-sm", children: [
|
|
7834
7834
|
/* @__PURE__ */ c("span", { children: [
|
|
7835
7835
|
/* @__PURE__ */ n("div", { className: "font-medium", children: r == null ? void 0 : r.name }),
|
|
7836
7836
|
/* @__PURE__ */ n("span", { className: "font-mono text-xs leading-tight text-gray-500", children: r == null ? void 0 : r.slug })
|
|
7837
7837
|
] }),
|
|
7838
|
-
/* @__PURE__ */ n(
|
|
7838
|
+
/* @__PURE__ */ n(cl, { variant: "outline", showAdd: !1 })
|
|
7839
7839
|
] }),
|
|
7840
|
-
/* @__PURE__ */ n("form", { className: "space-y-8", children: /* @__PURE__ */ c(
|
|
7841
|
-
/* @__PURE__ */ c(
|
|
7840
|
+
/* @__PURE__ */ n("form", { className: "space-y-8", children: /* @__PURE__ */ c(yi, { defaultValue: "seo", className: "w-full", children: [
|
|
7841
|
+
/* @__PURE__ */ c(vi, { className: `mb-4 grid w-full ${p ? "grid-cols-3" : "grid-cols-2"}`, children: [
|
|
7842
7842
|
/* @__PURE__ */ n(Mn, { value: "seo", children: e("SEO Fields") }),
|
|
7843
7843
|
p && /* @__PURE__ */ n(Mn, { value: "opengraph", children: e("Meta Tags") }),
|
|
7844
7844
|
/* @__PURE__ */ n(Mn, { value: "jsonld", children: e("JSON-LD") })
|
|
@@ -8114,7 +8114,7 @@ const mh = () => {
|
|
|
8114
8114
|
)
|
|
8115
8115
|
] }),
|
|
8116
8116
|
/* @__PURE__ */ n(
|
|
8117
|
-
|
|
8117
|
+
Wa,
|
|
8118
8118
|
{
|
|
8119
8119
|
assetId: U.ogImageId,
|
|
8120
8120
|
assetUrl: U.ogImage,
|
|
@@ -8248,24 +8248,24 @@ const mh = () => {
|
|
|
8248
8248
|
)
|
|
8249
8249
|
] });
|
|
8250
8250
|
};
|
|
8251
|
-
|
|
8252
|
-
const
|
|
8253
|
-
const { data: s } =
|
|
8251
|
+
hl.displayName = "SeoPanel";
|
|
8252
|
+
const ml = "seo", xh = ({ isActive: e, show: t }) => {
|
|
8253
|
+
const { data: s } = We(), a = Xi(s == null ? void 0 : s.pageType);
|
|
8254
8254
|
return !Ie(a, "hasSlug") || !a.hasSlug ? null : /* @__PURE__ */ n(T, { size: "sm", className: "my-1", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ c("svg", { className: "h-4 w-4", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 21 21", fill: "currentColor", children: [
|
|
8255
8255
|
/* @__PURE__ */ n("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
|
|
8256
8256
|
/* @__PURE__ */ n("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
|
|
8257
8257
|
] }) });
|
|
8258
8258
|
}, wh = {
|
|
8259
|
-
id:
|
|
8259
|
+
id: ml,
|
|
8260
8260
|
label: "SEO",
|
|
8261
|
-
panel:
|
|
8261
|
+
panel: hl,
|
|
8262
8262
|
button: xh,
|
|
8263
8263
|
position: "top",
|
|
8264
8264
|
width: 600,
|
|
8265
8265
|
view: "modal"
|
|
8266
8266
|
}, Ua = {}, Na = (e, t) => {
|
|
8267
8267
|
Ie(Ua, e) && console.warn(`Site setting ${e} already registered. Overriding...`), gt(Ua, e, { id: e, ...t });
|
|
8268
|
-
}, Nh = () =>
|
|
8268
|
+
}, Nh = () => po(Ua), Eh = () => {
|
|
8269
8269
|
var i;
|
|
8270
8270
|
const e = Nh(), [t, s] = S(((i = e[0]) == null ? void 0 : i.id) || ""), a = e.find((l) => l.id === t), r = a == null ? void 0 : a.panel;
|
|
8271
8271
|
return /* @__PURE__ */ c("div", { className: "flex h-full gap-4", children: [
|
|
@@ -8281,7 +8281,7 @@ const hl = "seo", xh = ({ isActive: e, show: t }) => {
|
|
|
8281
8281
|
}) }) }),
|
|
8282
8282
|
/* @__PURE__ */ n("div", { className: "no-scrollbar flex-1 overflow-y-auto", children: /* @__PURE__ */ n(Ja, { fallback: /* @__PURE__ */ n("div", { className: "flex items-center justify-center h-full", children: "Loading..." }), children: r ? /* @__PURE__ */ n(r, {}) : /* @__PURE__ */ n("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: /* @__PURE__ */ n("p", { children: "Select a setting from the sidebar or register settings using registerChaiSiteSetting" }) }) }) })
|
|
8283
8283
|
] });
|
|
8284
|
-
}, Sh = "site-settings", Ah = ({ isActive: e, show: t }) => Et("enable-site-settings") ? /* @__PURE__ */ n(T, { size: "sm", className: "my-1", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ n(
|
|
8284
|
+
}, Sh = "site-settings", Ah = ({ isActive: e, show: t }) => Et("enable-site-settings") ? /* @__PURE__ */ n(T, { size: "sm", className: "my-1", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ n(Li, { className: "h-4 w-4" }) }) : null, Th = {
|
|
8285
8285
|
id: Sh,
|
|
8286
8286
|
label: "Site Settings",
|
|
8287
8287
|
panel: Eh,
|
|
@@ -8290,23 +8290,23 @@ const hl = "seo", xh = ({ isActive: e, show: t }) => {
|
|
|
8290
8290
|
width: 800,
|
|
8291
8291
|
view: "modal"
|
|
8292
8292
|
}, Ch = "user-info", kh = () => {
|
|
8293
|
-
const { user: e, logout: t } = ot(), s =
|
|
8293
|
+
const { user: e, logout: t } = ot(), s = ct("onLogout", Kr);
|
|
8294
8294
|
return e ? /* @__PURE__ */ c(Ko, { children: [
|
|
8295
|
-
/* @__PURE__ */ n(
|
|
8296
|
-
/* @__PURE__ */ c(
|
|
8295
|
+
/* @__PURE__ */ n(Ho, { asChild: !0, children: /* @__PURE__ */ n(T, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ n(Ac, { className: "h-4 w-4" }) }) }),
|
|
8296
|
+
/* @__PURE__ */ c(Wo, { className: "w-auto space-y-2 p-4", children: [
|
|
8297
8297
|
/* @__PURE__ */ n("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
|
|
8298
8298
|
/* @__PURE__ */ n("div", { className: "text-xs text-muted-foreground", children: e.email }),
|
|
8299
|
-
/* @__PURE__ */ c(
|
|
8300
|
-
/* @__PURE__ */ n(
|
|
8301
|
-
/* @__PURE__ */ c(
|
|
8302
|
-
/* @__PURE__ */ c(
|
|
8303
|
-
/* @__PURE__ */ n(
|
|
8304
|
-
/* @__PURE__ */ n(
|
|
8299
|
+
/* @__PURE__ */ c(ei, { children: [
|
|
8300
|
+
/* @__PURE__ */ n(ti, { asChild: !0, children: /* @__PURE__ */ n(T, { variant: "outline", size: "sm", className: "w-full", children: "Logout" }) }),
|
|
8301
|
+
/* @__PURE__ */ c(ni, { children: [
|
|
8302
|
+
/* @__PURE__ */ c(si, { children: [
|
|
8303
|
+
/* @__PURE__ */ n(ai, { children: "Are you sure you want to logout?" }),
|
|
8304
|
+
/* @__PURE__ */ n(ri, { children: "You will be redirected to the login page." })
|
|
8305
8305
|
] }),
|
|
8306
|
-
/* @__PURE__ */ c(
|
|
8307
|
-
/* @__PURE__ */ n(
|
|
8306
|
+
/* @__PURE__ */ c(ii, { children: [
|
|
8307
|
+
/* @__PURE__ */ n(li, { children: "Cancel" }),
|
|
8308
8308
|
/* @__PURE__ */ n(
|
|
8309
|
-
|
|
8309
|
+
oi,
|
|
8310
8310
|
{
|
|
8311
8311
|
onClick: () => {
|
|
8312
8312
|
t(), yo(s) && s();
|
|
@@ -8325,7 +8325,7 @@ const hl = "seo", xh = ({ isActive: e, show: t }) => {
|
|
|
8325
8325
|
button: kh,
|
|
8326
8326
|
position: "bottom"
|
|
8327
8327
|
}, Ih = () => {
|
|
8328
|
-
Ts(
|
|
8328
|
+
Ts(ml, wh), Ts(ul, hh), Ts("site-settings", Th), Ts("user-info", Ph);
|
|
8329
8329
|
};
|
|
8330
8330
|
var se = {
|
|
8331
8331
|
context: void 0,
|
|
@@ -8346,16 +8346,16 @@ function Dr(e) {
|
|
|
8346
8346
|
function Bn(e) {
|
|
8347
8347
|
se.context = e;
|
|
8348
8348
|
}
|
|
8349
|
-
var
|
|
8349
|
+
var fl = !1, _h = (e, t) => e === t, Fs = Symbol("solid-proxy"), gl = typeof Proxy == "function", pl = Symbol("solid-track"), $s = {
|
|
8350
8350
|
equals: _h
|
|
8351
|
-
},
|
|
8351
|
+
}, yl = Sl, Ct = 1, qs = 2, vl = {
|
|
8352
8352
|
owned: null,
|
|
8353
8353
|
cleanups: null,
|
|
8354
8354
|
context: null,
|
|
8355
8355
|
owner: null
|
|
8356
8356
|
}, Ea = {}, ge = null, Sa = null, Lh = null, Ee = null, Qe = null, bt = null, da = 0;
|
|
8357
8357
|
function Kt(e, t) {
|
|
8358
|
-
const s = Ee, a = ge, r = e.length === 0, i = t === void 0 ? a : t, l = r ?
|
|
8358
|
+
const s = Ee, a = ge, r = e.length === 0, i = t === void 0 ? a : t, l = r ? vl : {
|
|
8359
8359
|
owned: null,
|
|
8360
8360
|
cleanups: null,
|
|
8361
8361
|
context: i ? i.context : null,
|
|
@@ -8375,26 +8375,26 @@ function _e(e, t) {
|
|
|
8375
8375
|
observers: null,
|
|
8376
8376
|
observerSlots: null,
|
|
8377
8377
|
comparator: t.equals || void 0
|
|
8378
|
-
}, a = (r) => (typeof r == "function" && (r = r(s.value)),
|
|
8379
|
-
return [
|
|
8378
|
+
}, a = (r) => (typeof r == "function" && (r = r(s.value)), El(s, r));
|
|
8379
|
+
return [Nl.bind(s), a];
|
|
8380
8380
|
}
|
|
8381
8381
|
function Dh(e, t, s) {
|
|
8382
8382
|
const a = ua(e, t, !0, Ct);
|
|
8383
8383
|
Gn(a);
|
|
8384
8384
|
}
|
|
8385
|
-
function
|
|
8385
|
+
function Ht(e, t, s) {
|
|
8386
8386
|
const a = ua(e, t, !1, Ct);
|
|
8387
8387
|
Gn(a);
|
|
8388
8388
|
}
|
|
8389
|
-
function
|
|
8390
|
-
|
|
8389
|
+
function bl(e, t, s) {
|
|
8390
|
+
yl = qh;
|
|
8391
8391
|
const a = ua(e, t, !1, Ct);
|
|
8392
8392
|
(!s || !s.render) && (a.user = !0), bt ? bt.push(a) : Gn(a);
|
|
8393
8393
|
}
|
|
8394
8394
|
function Me(e, t, s) {
|
|
8395
8395
|
s = s ? Object.assign({}, $s, s) : $s;
|
|
8396
8396
|
const a = ua(e, t, !0, 0);
|
|
8397
|
-
return a.observers = null, a.observerSlots = null, a.comparator = s.equals || void 0, Gn(a),
|
|
8397
|
+
return a.observers = null, a.observerSlots = null, a.comparator = s.equals || void 0, Gn(a), Nl.bind(a);
|
|
8398
8398
|
}
|
|
8399
8399
|
function Oh(e) {
|
|
8400
8400
|
return e && typeof e == "object" && "then" in e;
|
|
@@ -8476,7 +8476,7 @@ function Rh(e, t, s) {
|
|
|
8476
8476
|
});
|
|
8477
8477
|
let ee = ge;
|
|
8478
8478
|
return m ? Dh(() => (ee = ge, J(!1))) : J(!1), [U, {
|
|
8479
|
-
refetch: (D) =>
|
|
8479
|
+
refetch: (D) => xl(ee, () => J(D)),
|
|
8480
8480
|
mutate: p
|
|
8481
8481
|
}];
|
|
8482
8482
|
}
|
|
@@ -8509,7 +8509,7 @@ function Zf(e, t, s) {
|
|
|
8509
8509
|
};
|
|
8510
8510
|
}
|
|
8511
8511
|
function Gh(e) {
|
|
8512
|
-
|
|
8512
|
+
bl(() => qe(e));
|
|
8513
8513
|
}
|
|
8514
8514
|
function Jn(e) {
|
|
8515
8515
|
return ge === null || (ge.cleanups === null ? ge.cleanups = [e] : ge.cleanups.push(e)), e;
|
|
@@ -8517,7 +8517,7 @@ function Jn(e) {
|
|
|
8517
8517
|
function Or() {
|
|
8518
8518
|
return ge;
|
|
8519
8519
|
}
|
|
8520
|
-
function
|
|
8520
|
+
function xl(e, t) {
|
|
8521
8521
|
const s = ge, a = Ee;
|
|
8522
8522
|
ge = e, Ee = null;
|
|
8523
8523
|
try {
|
|
@@ -8552,7 +8552,7 @@ function sg(e) {
|
|
|
8552
8552
|
let t;
|
|
8553
8553
|
return ge && ge.context && (t = ge.context[e.id]) !== void 0 ? t : e.defaultValue;
|
|
8554
8554
|
}
|
|
8555
|
-
function
|
|
8555
|
+
function wl(e) {
|
|
8556
8556
|
const t = Me(e), s = Me(() => Ba(t()));
|
|
8557
8557
|
return s.toArray = () => {
|
|
8558
8558
|
const a = s();
|
|
@@ -8560,7 +8560,7 @@ function xl(e) {
|
|
|
8560
8560
|
}, s;
|
|
8561
8561
|
}
|
|
8562
8562
|
var Mh;
|
|
8563
|
-
function
|
|
8563
|
+
function Nl() {
|
|
8564
8564
|
if (this.sources && this.state)
|
|
8565
8565
|
if (this.state === Ct) Gn(this);
|
|
8566
8566
|
else {
|
|
@@ -8573,12 +8573,12 @@ function wl() {
|
|
|
8573
8573
|
}
|
|
8574
8574
|
return this.value;
|
|
8575
8575
|
}
|
|
8576
|
-
function
|
|
8576
|
+
function El(e, t, s) {
|
|
8577
8577
|
let a = e.value;
|
|
8578
8578
|
return (!e.comparator || !e.comparator(a, t)) && (e.value = t, e.observers && e.observers.length && yt(() => {
|
|
8579
8579
|
for (let r = 0; r < e.observers.length; r += 1) {
|
|
8580
8580
|
const i = e.observers[r], l = Sa && Sa.running;
|
|
8581
|
-
l && Sa.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Qe.push(i) : bt.push(i), i.observers &&
|
|
8581
|
+
l && Sa.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Qe.push(i) : bt.push(i), i.observers && Al(i)), l || (i.state = Ct);
|
|
8582
8582
|
}
|
|
8583
8583
|
if (Qe.length > 1e6)
|
|
8584
8584
|
throw Qe = [], new Error();
|
|
@@ -8601,7 +8601,7 @@ function Fh(e, t, s) {
|
|
|
8601
8601
|
} finally {
|
|
8602
8602
|
Ee = i, ge = r;
|
|
8603
8603
|
}
|
|
8604
|
-
(!e.updatedAt || e.updatedAt <= s) && (e.updatedAt != null && "observers" in e ?
|
|
8604
|
+
(!e.updatedAt || e.updatedAt <= s) && (e.updatedAt != null && "observers" in e ? El(e, a) : e.value = a, e.updatedAt = s);
|
|
8605
8605
|
}
|
|
8606
8606
|
function ua(e, t, s, a = Ct, r) {
|
|
8607
8607
|
const i = {
|
|
@@ -8617,7 +8617,7 @@ function ua(e, t, s, a = Ct, r) {
|
|
|
8617
8617
|
context: ge ? ge.context : null,
|
|
8618
8618
|
pure: s
|
|
8619
8619
|
};
|
|
8620
|
-
return ge === null || ge !==
|
|
8620
|
+
return ge === null || ge !== vl && (ge.owned ? ge.owned.push(i) : ge.owned = [i]), i;
|
|
8621
8621
|
}
|
|
8622
8622
|
function js(e) {
|
|
8623
8623
|
if (e.state === 0) return;
|
|
@@ -8646,11 +8646,11 @@ function yt(e, t) {
|
|
|
8646
8646
|
}
|
|
8647
8647
|
}
|
|
8648
8648
|
function $h(e) {
|
|
8649
|
-
if (Qe && (
|
|
8649
|
+
if (Qe && (Sl(Qe), Qe = null), e) return;
|
|
8650
8650
|
const t = bt;
|
|
8651
|
-
bt = null, t.length && yt(() =>
|
|
8651
|
+
bt = null, t.length && yt(() => yl(t), !1);
|
|
8652
8652
|
}
|
|
8653
|
-
function
|
|
8653
|
+
function Sl(e) {
|
|
8654
8654
|
for (let t = 0; t < e.length; t++) js(e[t]);
|
|
8655
8655
|
}
|
|
8656
8656
|
function qh(e) {
|
|
@@ -8678,10 +8678,10 @@ function zs(e, t) {
|
|
|
8678
8678
|
}
|
|
8679
8679
|
}
|
|
8680
8680
|
}
|
|
8681
|
-
function
|
|
8681
|
+
function Al(e) {
|
|
8682
8682
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
8683
8683
|
const s = e.observers[t];
|
|
8684
|
-
s.state || (s.state = qs, s.pure ? Qe.push(s) : bt.push(s), s.observers &&
|
|
8684
|
+
s.state || (s.state = qs, s.pure ? Qe.push(s) : bt.push(s), s.observers && Al(s));
|
|
8685
8685
|
}
|
|
8686
8686
|
}
|
|
8687
8687
|
function Yn(e) {
|
|
@@ -8731,10 +8731,10 @@ function Ba(e) {
|
|
|
8731
8731
|
function jh(e, t) {
|
|
8732
8732
|
return function(a) {
|
|
8733
8733
|
let r;
|
|
8734
|
-
return
|
|
8734
|
+
return Ht(() => r = qe(() => (ge.context = {
|
|
8735
8735
|
...ge.context,
|
|
8736
8736
|
[e]: a.value
|
|
8737
|
-
},
|
|
8737
|
+
}, wl(() => a.children))), void 0), r;
|
|
8738
8738
|
};
|
|
8739
8739
|
}
|
|
8740
8740
|
var Ma = Symbol("fallback");
|
|
@@ -8745,7 +8745,7 @@ function zh(e, t, s = {}) {
|
|
|
8745
8745
|
let a = [], r = [], i = [], l = 0, o = t.length > 1 ? [] : null;
|
|
8746
8746
|
return Jn(() => Vs(i)), () => {
|
|
8747
8747
|
let d = e() || [], h = d.length, u, m;
|
|
8748
|
-
return d[
|
|
8748
|
+
return d[pl], qe(() => {
|
|
8749
8749
|
let g, p, f, v, x, N, I, L, C;
|
|
8750
8750
|
if (h === 0)
|
|
8751
8751
|
l !== 0 && (Vs(i), i = [], a = [], r = [], l = 0, o && (o = [])), s.fallback && (a = [Ma], r[0] = Kt((P) => (i[0] = P, s.fallback())), l = 1);
|
|
@@ -8780,7 +8780,7 @@ function Vh(e, t, s = {}) {
|
|
|
8780
8780
|
let a = [], r = [], i = [], l = [], o = 0, d;
|
|
8781
8781
|
return Jn(() => Vs(i)), () => {
|
|
8782
8782
|
const h = e() || [], u = h.length;
|
|
8783
|
-
return h[
|
|
8783
|
+
return h[pl], qe(() => {
|
|
8784
8784
|
if (u === 0)
|
|
8785
8785
|
return o !== 0 && (Vs(i), i = [], a = [], r = [], o = 0, l = []), s.fallback && (a = [Ma], r[0] = Kt((y) => (i[0] = y, s.fallback())), o = 1), r;
|
|
8786
8786
|
for (a[0] === Ma && (i[0](), i = [], a = [], r = [], o = 0), d = 0; d < u; d++)
|
|
@@ -8796,7 +8796,7 @@ function Vh(e, t, s = {}) {
|
|
|
8796
8796
|
}
|
|
8797
8797
|
};
|
|
8798
8798
|
}
|
|
8799
|
-
function
|
|
8799
|
+
function Tl(e, t) {
|
|
8800
8800
|
return qe(() => e(t || {}));
|
|
8801
8801
|
}
|
|
8802
8802
|
function ks() {
|
|
@@ -8835,13 +8835,13 @@ function Kh() {
|
|
|
8835
8835
|
if (s !== void 0) return s;
|
|
8836
8836
|
}
|
|
8837
8837
|
}
|
|
8838
|
-
function
|
|
8838
|
+
function Cl(...e) {
|
|
8839
8839
|
let t = !1;
|
|
8840
8840
|
for (let l = 0; l < e.length; l++) {
|
|
8841
8841
|
const o = e[l];
|
|
8842
8842
|
t = t || !!o && Fs in o, e[l] = typeof o == "function" ? (t = !0, Me(o)) : o;
|
|
8843
8843
|
}
|
|
8844
|
-
if (
|
|
8844
|
+
if (gl && t)
|
|
8845
8845
|
return new Proxy({
|
|
8846
8846
|
get(l) {
|
|
8847
8847
|
for (let o = e.length - 1; o >= 0; o--) {
|
|
@@ -8888,8 +8888,8 @@ function Tl(...e) {
|
|
|
8888
8888
|
}
|
|
8889
8889
|
return r;
|
|
8890
8890
|
}
|
|
8891
|
-
function
|
|
8892
|
-
if (
|
|
8891
|
+
function Hh(e, ...t) {
|
|
8892
|
+
if (gl && Fs in e) {
|
|
8893
8893
|
const r = new Set(t.length > 1 ? t.flat() : t[0]), i = t.map((l) => new Proxy({
|
|
8894
8894
|
get(o) {
|
|
8895
8895
|
return l.includes(o) ? e[o] : void 0;
|
|
@@ -8923,7 +8923,7 @@ function Wh(e, ...t) {
|
|
|
8923
8923
|
}
|
|
8924
8924
|
return [...a, s];
|
|
8925
8925
|
}
|
|
8926
|
-
function
|
|
8926
|
+
function kl(e) {
|
|
8927
8927
|
let t, s;
|
|
8928
8928
|
const a = (r) => {
|
|
8929
8929
|
const i = se.context;
|
|
@@ -8947,11 +8947,11 @@ function Cl(e) {
|
|
|
8947
8947
|
};
|
|
8948
8948
|
return a.preload = () => s || ((s = e()).then((r) => t = () => r.default), s), a;
|
|
8949
8949
|
}
|
|
8950
|
-
var
|
|
8950
|
+
var Wh = 0;
|
|
8951
8951
|
function ag() {
|
|
8952
|
-
return se.context ? se.getNextContextId() : `cl-${
|
|
8952
|
+
return se.context ? se.getNextContextId() : `cl-${Wh++}`;
|
|
8953
8953
|
}
|
|
8954
|
-
var
|
|
8954
|
+
var Pl = (e) => `Stale read from <${e}>.`;
|
|
8955
8955
|
function rg(e) {
|
|
8956
8956
|
const t = "fallback" in e && {
|
|
8957
8957
|
fallback: () => e.fallback
|
|
@@ -8973,7 +8973,7 @@ function lg(e) {
|
|
|
8973
8973
|
if (r) {
|
|
8974
8974
|
const i = e.children;
|
|
8975
8975
|
return typeof i == "function" && i.length > 0 ? qe(() => i(t ? r : () => {
|
|
8976
|
-
if (!qe(a)) throw
|
|
8976
|
+
if (!qe(a)) throw Pl("Show");
|
|
8977
8977
|
return s();
|
|
8978
8978
|
})) : i;
|
|
8979
8979
|
}
|
|
@@ -8981,7 +8981,7 @@ function lg(e) {
|
|
|
8981
8981
|
}, void 0, void 0);
|
|
8982
8982
|
}
|
|
8983
8983
|
function og(e) {
|
|
8984
|
-
const t =
|
|
8984
|
+
const t = wl(() => e.children), s = Me(() => {
|
|
8985
8985
|
const a = t(), r = Array.isArray(a) ? a : [a];
|
|
8986
8986
|
let i = () => {
|
|
8987
8987
|
};
|
|
@@ -8999,7 +8999,7 @@ function og(e) {
|
|
|
8999
8999
|
const [r, i, l] = a, o = l.children;
|
|
9000
9000
|
return typeof o == "function" && o.length > 0 ? qe(() => o(l.keyed ? i() : () => {
|
|
9001
9001
|
var h;
|
|
9002
|
-
if (((h = qe(s)()) == null ? void 0 : h[0]) !== r) throw
|
|
9002
|
+
if (((h = qe(s)()) == null ? void 0 : h[0]) !== r) throw Pl("Match");
|
|
9003
9003
|
return i();
|
|
9004
9004
|
})) : o;
|
|
9005
9005
|
}, void 0, void 0);
|
|
@@ -9165,7 +9165,7 @@ function am(e, t, s) {
|
|
|
9165
9165
|
}
|
|
9166
9166
|
}
|
|
9167
9167
|
var jn = "_$DX_DELEGATE";
|
|
9168
|
-
function
|
|
9168
|
+
function Il(e, t, s, a = {}) {
|
|
9169
9169
|
let r;
|
|
9170
9170
|
return Kt((i) => {
|
|
9171
9171
|
r = i, t === document ? e() : qa(t, e(), t.firstChild ? null : void 0, s);
|
|
@@ -9185,12 +9185,12 @@ function rm(e, t = window.document) {
|
|
|
9185
9185
|
const s = t[jn] || (t[jn] = /* @__PURE__ */ new Set());
|
|
9186
9186
|
for (let a = 0, r = e.length; a < r; a++) {
|
|
9187
9187
|
const i = e[a];
|
|
9188
|
-
s.has(i) || (s.add(i), t.addEventListener(i,
|
|
9188
|
+
s.has(i) || (s.add(i), t.addEventListener(i, _l));
|
|
9189
9189
|
}
|
|
9190
9190
|
}
|
|
9191
9191
|
function hg(e = window.document) {
|
|
9192
9192
|
if (e[jn]) {
|
|
9193
|
-
for (let t of e[jn].keys()) e.removeEventListener(t,
|
|
9193
|
+
for (let t of e[jn].keys()) e.removeEventListener(t, _l);
|
|
9194
9194
|
delete e[jn];
|
|
9195
9195
|
}
|
|
9196
9196
|
}
|
|
@@ -9241,14 +9241,14 @@ function um(e, t, s) {
|
|
|
9241
9241
|
}
|
|
9242
9242
|
function hm(e, t = {}, s, a) {
|
|
9243
9243
|
const r = {};
|
|
9244
|
-
return a ||
|
|
9244
|
+
return a || Ht(() => r.children = Xn(e, t.children, r.children)), Ht(() => typeof t.ref == "function" && mm(t.ref, e)), Ht(() => fm(e, t, s, !0, r, !0)), r;
|
|
9245
9245
|
}
|
|
9246
9246
|
function mm(e, t, s) {
|
|
9247
9247
|
return qe(() => e(t, s));
|
|
9248
9248
|
}
|
|
9249
9249
|
function qa(e, t, s, a) {
|
|
9250
9250
|
if (s !== void 0 && !a && (a = []), typeof t != "function") return Xn(e, t, a, s);
|
|
9251
|
-
|
|
9251
|
+
Ht((r) => Xn(e, t(), r, s), a);
|
|
9252
9252
|
}
|
|
9253
9253
|
function fm(e, t, s, a, r = {}, i = !1) {
|
|
9254
9254
|
t || (t = {});
|
|
@@ -9313,7 +9313,7 @@ function Gr(e, t, s, a, r, i, l) {
|
|
|
9313
9313
|
}
|
|
9314
9314
|
return s;
|
|
9315
9315
|
}
|
|
9316
|
-
function
|
|
9316
|
+
function _l(e) {
|
|
9317
9317
|
if (se.registry && se.events && se.events.find(([d, h]) => h === e))
|
|
9318
9318
|
return;
|
|
9319
9319
|
let t = e.target;
|
|
@@ -9376,7 +9376,7 @@ function Xn(e, t, s, a, r) {
|
|
|
9376
9376
|
s = en(e, s, a);
|
|
9377
9377
|
} else {
|
|
9378
9378
|
if (l === "function")
|
|
9379
|
-
return
|
|
9379
|
+
return Ht(() => {
|
|
9380
9380
|
let d = t();
|
|
9381
9381
|
for (; typeof d == "function"; ) d = d();
|
|
9382
9382
|
s = Xn(e, d, s, a);
|
|
@@ -9384,7 +9384,7 @@ function Xn(e, t, s, a, r) {
|
|
|
9384
9384
|
if (Array.isArray(t)) {
|
|
9385
9385
|
const d = [], h = s && Array.isArray(s);
|
|
9386
9386
|
if (ja(d, t, s, r))
|
|
9387
|
-
return
|
|
9387
|
+
return Ht(() => s = Xn(e, d, s, a, !0)), () => s;
|
|
9388
9388
|
if (i) {
|
|
9389
9389
|
if (!d.length) return s;
|
|
9390
9390
|
if (a === void 0) return s = [...e.childNodes];
|
|
@@ -9452,7 +9452,7 @@ function ym() {
|
|
|
9452
9452
|
return se.getNextContextId();
|
|
9453
9453
|
}
|
|
9454
9454
|
var vm = "http://www.w3.org/2000/svg";
|
|
9455
|
-
function
|
|
9455
|
+
function Ll(e, t = !1) {
|
|
9456
9456
|
return t ? document.createElementNS(vm, e) : document.createElement(e);
|
|
9457
9457
|
}
|
|
9458
9458
|
function mg(e) {
|
|
@@ -9460,14 +9460,14 @@ function mg(e) {
|
|
|
9460
9460
|
useShadow: t
|
|
9461
9461
|
} = e, s = document.createTextNode(""), a = () => e.mount || document.body, r = Or();
|
|
9462
9462
|
let i, l = !!se.context;
|
|
9463
|
-
return
|
|
9464
|
-
l && (Or().user = l = !1), i || (i =
|
|
9463
|
+
return bl(() => {
|
|
9464
|
+
l && (Or().user = l = !1), i || (i = xl(r, () => Me(() => e.children)));
|
|
9465
9465
|
const o = a();
|
|
9466
9466
|
if (o instanceof HTMLHeadElement) {
|
|
9467
9467
|
const [d, h] = _e(!1), u = () => h(!0);
|
|
9468
9468
|
Kt((m) => qa(o, () => d() ? m() : i(), null)), Jn(u);
|
|
9469
9469
|
} else {
|
|
9470
|
-
const d =
|
|
9470
|
+
const d = Ll(e.isSVG ? "g" : "div", e.isSVG), h = t && d.attachShadow ? d.attachShadow({
|
|
9471
9471
|
mode: "open"
|
|
9472
9472
|
}) : d;
|
|
9473
9473
|
Object.defineProperty(d, "_$host", {
|
|
@@ -9489,13 +9489,13 @@ function bm(e, t) {
|
|
|
9489
9489
|
case "function":
|
|
9490
9490
|
return qe(() => a(t));
|
|
9491
9491
|
case "string":
|
|
9492
|
-
const r = nm.has(a), i = se.context ? gm() :
|
|
9492
|
+
const r = nm.has(a), i = se.context ? gm() : Ll(a, r);
|
|
9493
9493
|
return hm(i, t, r), i;
|
|
9494
9494
|
}
|
|
9495
9495
|
});
|
|
9496
9496
|
}
|
|
9497
9497
|
function fg(e) {
|
|
9498
|
-
const [, t] =
|
|
9498
|
+
const [, t] = Hh(e, ["component"]);
|
|
9499
9499
|
return bm(() => e.component, t);
|
|
9500
9500
|
}
|
|
9501
9501
|
var xm = class {
|
|
@@ -9514,7 +9514,7 @@ var xm = class {
|
|
|
9514
9514
|
clear() {
|
|
9515
9515
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
9516
9516
|
}
|
|
9517
|
-
},
|
|
9517
|
+
}, Dl = class {
|
|
9518
9518
|
constructor(e) {
|
|
9519
9519
|
this.generateIdentifier = e, this.kv = new xm();
|
|
9520
9520
|
}
|
|
@@ -9530,7 +9530,7 @@ var xm = class {
|
|
|
9530
9530
|
getValue(e) {
|
|
9531
9531
|
return this.kv.getByKey(e);
|
|
9532
9532
|
}
|
|
9533
|
-
}, wm = class extends
|
|
9533
|
+
}, wm = class extends Dl {
|
|
9534
9534
|
constructor() {
|
|
9535
9535
|
super((e) => e.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
9536
9536
|
}
|
|
@@ -9586,7 +9586,7 @@ var Sm = class {
|
|
|
9586
9586
|
findByName(e) {
|
|
9587
9587
|
return this.transfomers[e];
|
|
9588
9588
|
}
|
|
9589
|
-
}, Am = (e) => Object.prototype.toString.call(e).slice(8, -1),
|
|
9589
|
+
}, Am = (e) => Object.prototype.toString.call(e).slice(8, -1), Ol = (e) => typeof e > "u", Tm = (e) => e === null, Zn = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, za = (e) => Zn(e) && Object.keys(e).length === 0, Ot = (e) => Array.isArray(e), Cm = (e) => typeof e == "string", km = (e) => typeof e == "number" && !isNaN(e), Pm = (e) => typeof e == "boolean", Im = (e) => e instanceof RegExp, es = (e) => e instanceof Map, ts = (e) => e instanceof Set, Rl = (e) => Am(e) === "Symbol", _m = (e) => e instanceof Date && !isNaN(e.valueOf()), Lm = (e) => e instanceof Error, Mr = (e) => typeof e == "number" && isNaN(e), Dm = (e) => Pm(e) || Tm(e) || Ol(e) || km(e) || Cm(e) || Rl(e), Om = (e) => typeof e == "bigint", Rm = (e) => e === 1 / 0 || e === -1 / 0, Gm = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Um = (e) => e instanceof URL, Gl = (e) => e.replace(/\./g, "\\."), Ta = (e) => e.map(String).map(Gl).join("."), zn = (e) => {
|
|
9590
9590
|
const t = [];
|
|
9591
9591
|
let s = "";
|
|
9592
9592
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -9612,8 +9612,8 @@ function mt(e, t, s, a) {
|
|
|
9612
9612
|
untransform: a
|
|
9613
9613
|
};
|
|
9614
9614
|
}
|
|
9615
|
-
var
|
|
9616
|
-
mt(
|
|
9615
|
+
var Ul = [
|
|
9616
|
+
mt(Ol, "undefined", () => null, () => {
|
|
9617
9617
|
}),
|
|
9618
9618
|
mt(Om, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : e),
|
|
9619
9619
|
mt(_m, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
@@ -9656,7 +9656,7 @@ function ha(e, t, s, a) {
|
|
|
9656
9656
|
untransform: a
|
|
9657
9657
|
};
|
|
9658
9658
|
}
|
|
9659
|
-
var
|
|
9659
|
+
var Bl = ha((e, t) => Rl(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, s) => {
|
|
9660
9660
|
const a = s.symbolRegistry.getValue(t[1]);
|
|
9661
9661
|
if (!a)
|
|
9662
9662
|
throw new Error("Trying to deserialize unknown symbol");
|
|
@@ -9671,16 +9671,16 @@ var Ul = ha((e, t) => Ol(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) =
|
|
|
9671
9671
|
Float32Array,
|
|
9672
9672
|
Float64Array,
|
|
9673
9673
|
Uint8ClampedArray
|
|
9674
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
9674
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), Ml = ha(Gm, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
9675
9675
|
const s = Bm[t[1]];
|
|
9676
9676
|
if (!s)
|
|
9677
9677
|
throw new Error("Trying to deserialize unknown typed array");
|
|
9678
9678
|
return new s(e);
|
|
9679
9679
|
});
|
|
9680
|
-
function
|
|
9680
|
+
function Fl(e, t) {
|
|
9681
9681
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
9682
9682
|
}
|
|
9683
|
-
var
|
|
9683
|
+
var $l = ha(Fl, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
9684
9684
|
const s = t.classRegistry.getAllowedProps(e.constructor);
|
|
9685
9685
|
if (!s)
|
|
9686
9686
|
return { ...e };
|
|
@@ -9693,44 +9693,44 @@ var Fl = ha(Ml, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)
|
|
|
9693
9693
|
if (!a)
|
|
9694
9694
|
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
9695
9695
|
return Object.assign(Object.create(a.prototype), e);
|
|
9696
|
-
}),
|
|
9696
|
+
}), ql = ha((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, s) => {
|
|
9697
9697
|
const a = s.customTransformerRegistry.findByName(t[1]);
|
|
9698
9698
|
if (!a)
|
|
9699
9699
|
throw new Error("Trying to deserialize unknown custom value");
|
|
9700
9700
|
return a.deserialize(e);
|
|
9701
|
-
}), Mm = [
|
|
9701
|
+
}), Mm = [$l, Bl, ql, Ml], Fr = (e, t) => {
|
|
9702
9702
|
const s = Br(Mm, (r) => r.isApplicable(e, t));
|
|
9703
9703
|
if (s)
|
|
9704
9704
|
return {
|
|
9705
9705
|
value: s.transform(e, t),
|
|
9706
9706
|
type: s.annotation(e, t)
|
|
9707
9707
|
};
|
|
9708
|
-
const a = Br(
|
|
9708
|
+
const a = Br(Ul, (r) => r.isApplicable(e, t));
|
|
9709
9709
|
if (a)
|
|
9710
9710
|
return {
|
|
9711
9711
|
value: a.transform(e, t),
|
|
9712
9712
|
type: a.annotation
|
|
9713
9713
|
};
|
|
9714
|
-
},
|
|
9715
|
-
|
|
9716
|
-
|
|
9714
|
+
}, jl = {};
|
|
9715
|
+
Ul.forEach((e) => {
|
|
9716
|
+
jl[e.annotation] = e;
|
|
9717
9717
|
});
|
|
9718
9718
|
var Fm = (e, t, s) => {
|
|
9719
9719
|
if (Ot(t))
|
|
9720
9720
|
switch (t[0]) {
|
|
9721
9721
|
case "symbol":
|
|
9722
|
-
return
|
|
9722
|
+
return Bl.untransform(e, t, s);
|
|
9723
9723
|
case "class":
|
|
9724
|
-
return Fl.untransform(e, t, s);
|
|
9725
|
-
case "custom":
|
|
9726
9724
|
return $l.untransform(e, t, s);
|
|
9725
|
+
case "custom":
|
|
9726
|
+
return ql.untransform(e, t, s);
|
|
9727
9727
|
case "typed-array":
|
|
9728
|
-
return
|
|
9728
|
+
return Ml.untransform(e, t, s);
|
|
9729
9729
|
default:
|
|
9730
9730
|
throw new Error("Unknown transformation: " + t);
|
|
9731
9731
|
}
|
|
9732
9732
|
else {
|
|
9733
|
-
const a =
|
|
9733
|
+
const a = jl[t];
|
|
9734
9734
|
if (!a)
|
|
9735
9735
|
throw new Error("Unknown transformation: " + t);
|
|
9736
9736
|
return a.untransform(e, s);
|
|
@@ -9743,7 +9743,7 @@ var Fm = (e, t, s) => {
|
|
|
9743
9743
|
s.next(), t--;
|
|
9744
9744
|
return s.next().value;
|
|
9745
9745
|
};
|
|
9746
|
-
function
|
|
9746
|
+
function zl(e) {
|
|
9747
9747
|
if (Gs(e, "__proto__"))
|
|
9748
9748
|
throw new Error("__proto__ is not allowed as a property");
|
|
9749
9749
|
if (Gs(e, "prototype"))
|
|
@@ -9752,7 +9752,7 @@ function jl(e) {
|
|
|
9752
9752
|
throw new Error("constructor is not allowed as a property");
|
|
9753
9753
|
}
|
|
9754
9754
|
var $m = (e, t) => {
|
|
9755
|
-
|
|
9755
|
+
zl(t);
|
|
9756
9756
|
for (let s = 0; s < t.length; s++) {
|
|
9757
9757
|
const a = t[s];
|
|
9758
9758
|
if (ts(e))
|
|
@@ -9772,7 +9772,7 @@ var $m = (e, t) => {
|
|
|
9772
9772
|
}
|
|
9773
9773
|
return e;
|
|
9774
9774
|
}, Va = (e, t, s) => {
|
|
9775
|
-
if (
|
|
9775
|
+
if (zl(t), t.length === 0)
|
|
9776
9776
|
return s(e);
|
|
9777
9777
|
let a = e;
|
|
9778
9778
|
for (let i = 0; i < t.length - 1; i++) {
|
|
@@ -9853,7 +9853,7 @@ function jm(e, t) {
|
|
|
9853
9853
|
kn(t, s);
|
|
9854
9854
|
return e;
|
|
9855
9855
|
}
|
|
9856
|
-
var zm = (e, t) => Zn(e) || Ot(e) || es(e) || ts(e) ||
|
|
9856
|
+
var zm = (e, t) => Zn(e) || Ot(e) || es(e) || ts(e) || Fl(e, t);
|
|
9857
9857
|
function Vm(e, t, s) {
|
|
9858
9858
|
const a = s.get(e);
|
|
9859
9859
|
a ? a.push(t) : s.set(e, [t]);
|
|
@@ -9869,7 +9869,7 @@ function Km(e, t) {
|
|
|
9869
9869
|
i.length === 0 ? a = l.map(Ta) : s[Ta(i)] = l.map(Ta);
|
|
9870
9870
|
}), a ? za(s) ? [a] : [a, s] : za(s) ? void 0 : s;
|
|
9871
9871
|
}
|
|
9872
|
-
var
|
|
9872
|
+
var Vl = (e, t, s, a, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
9873
9873
|
const o = Dm(e);
|
|
9874
9874
|
if (!o) {
|
|
9875
9875
|
Vm(e, r, t);
|
|
@@ -9896,9 +9896,9 @@ var zl = (e, t, s, a, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
9896
9896
|
kn(h, (g, p) => {
|
|
9897
9897
|
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
9898
9898
|
throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
|
|
9899
|
-
const f =
|
|
9899
|
+
const f = Vl(g, t, s, a, [...r, p], [...i, e], l);
|
|
9900
9900
|
u[p] = f.transformedValue, Ot(f.annotations) ? m[p] = f.annotations : Zn(f.annotations) && kn(f.annotations, (v, x) => {
|
|
9901
|
-
m[
|
|
9901
|
+
m[Gl(p) + "." + x] = v;
|
|
9902
9902
|
});
|
|
9903
9903
|
});
|
|
9904
9904
|
const y = za(m) ? {
|
|
@@ -9910,19 +9910,19 @@ var zl = (e, t, s, a, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
9910
9910
|
};
|
|
9911
9911
|
return o || l.set(e, y), y;
|
|
9912
9912
|
};
|
|
9913
|
-
function
|
|
9913
|
+
function Kl(e) {
|
|
9914
9914
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
9915
9915
|
}
|
|
9916
9916
|
function $r(e) {
|
|
9917
|
-
return
|
|
9917
|
+
return Kl(e) === "Array";
|
|
9918
9918
|
}
|
|
9919
|
-
function
|
|
9920
|
-
if (
|
|
9919
|
+
function Hm(e) {
|
|
9920
|
+
if (Kl(e) !== "Object")
|
|
9921
9921
|
return !1;
|
|
9922
9922
|
const t = Object.getPrototypeOf(e);
|
|
9923
9923
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
9924
9924
|
}
|
|
9925
|
-
function
|
|
9925
|
+
function Wm(e, t, s, a, r) {
|
|
9926
9926
|
const i = {}.propertyIsEnumerable.call(a, t) ? "enumerable" : "nonenumerable";
|
|
9927
9927
|
i === "enumerable" && (e[t] = s), r && i === "nonenumerable" && Object.defineProperty(e, t, {
|
|
9928
9928
|
value: s,
|
|
@@ -9931,17 +9931,17 @@ function Hm(e, t, s, a, r) {
|
|
|
9931
9931
|
configurable: !0
|
|
9932
9932
|
});
|
|
9933
9933
|
}
|
|
9934
|
-
function
|
|
9934
|
+
function Ha(e, t = {}) {
|
|
9935
9935
|
if ($r(e))
|
|
9936
|
-
return e.map((r) =>
|
|
9937
|
-
if (!
|
|
9936
|
+
return e.map((r) => Ha(r, t));
|
|
9937
|
+
if (!Hm(e))
|
|
9938
9938
|
return e;
|
|
9939
9939
|
const s = Object.getOwnPropertyNames(e), a = Object.getOwnPropertySymbols(e);
|
|
9940
9940
|
return [...s, ...a].reduce((r, i) => {
|
|
9941
9941
|
if ($r(t.props) && !t.props.includes(i))
|
|
9942
9942
|
return r;
|
|
9943
|
-
const l = e[i], o =
|
|
9944
|
-
return
|
|
9943
|
+
const l = e[i], o = Ha(l, t);
|
|
9944
|
+
return Wm(r, i, o, e, t.nonenumerable), r;
|
|
9945
9945
|
}, {});
|
|
9946
9946
|
}
|
|
9947
9947
|
var Se = class {
|
|
@@ -9949,10 +9949,10 @@ var Se = class {
|
|
|
9949
9949
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
9950
9950
|
*/
|
|
9951
9951
|
constructor({ dedupe: e = !1 } = {}) {
|
|
9952
|
-
this.classRegistry = new wm(), this.symbolRegistry = new
|
|
9952
|
+
this.classRegistry = new wm(), this.symbolRegistry = new Dl((t) => t.description ?? ""), this.customTransformerRegistry = new Sm(), this.allowedErrorProps = [], this.dedupe = e;
|
|
9953
9953
|
}
|
|
9954
9954
|
serialize(e) {
|
|
9955
|
-
const t = /* @__PURE__ */ new Map(), s =
|
|
9955
|
+
const t = /* @__PURE__ */ new Map(), s = Vl(e, t, this, this.dedupe), a = {
|
|
9956
9956
|
json: s.transformedValue
|
|
9957
9957
|
};
|
|
9958
9958
|
s.annotations && (a.meta = {
|
|
@@ -9967,7 +9967,7 @@ var Se = class {
|
|
|
9967
9967
|
}
|
|
9968
9968
|
deserialize(e) {
|
|
9969
9969
|
const { json: t, meta: s } = e;
|
|
9970
|
-
let a =
|
|
9970
|
+
let a = Ha(t);
|
|
9971
9971
|
return s != null && s.values && (a = qm(a, s.values, this)), s != null && s.referentialEqualities && (a = jm(a, s.referentialEqualities)), a;
|
|
9972
9972
|
}
|
|
9973
9973
|
stringify(e) {
|
|
@@ -10029,10 +10029,10 @@ var wg = (e, t = !1) => {
|
|
|
10029
10029
|
json: s
|
|
10030
10030
|
} = Qm(e);
|
|
10031
10031
|
return JSON.stringify(s, null, t ? 2 : void 0);
|
|
10032
|
-
}, Ps = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Jm = (e, t) => e.queryHash.localeCompare(t.queryHash),
|
|
10032
|
+
}, Ps = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Jm = (e, t) => e.queryHash.localeCompare(t.queryHash), Hl = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Ym = (e, t) => Ps(e) === Ps(t) ? Hl(e, t) : Ps(e) > Ps(t) ? 1 : -1, Ng = {
|
|
10033
10033
|
status: Ym,
|
|
10034
10034
|
"query hash": Jm,
|
|
10035
|
-
"last updated":
|
|
10035
|
+
"last updated": Hl
|
|
10036
10036
|
}, Is = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, Wl = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Xm = (e, t) => Is(e) === Is(t) ? Wl(e, t) : Is(e) > Is(t) ? 1 : -1, Eg = {
|
|
10037
10037
|
status: Xm,
|
|
10038
10038
|
"last updated": Wl
|
|
@@ -10106,7 +10106,7 @@ var wg = (e, t = !1) => {
|
|
|
10106
10106
|
return s[a] = Ls(s[a], r), s;
|
|
10107
10107
|
}
|
|
10108
10108
|
return e;
|
|
10109
|
-
},
|
|
10109
|
+
}, Ql = (e, t) => {
|
|
10110
10110
|
if (!e || document.querySelector("#_goober") || (t == null ? void 0 : t.querySelector("#_goober"))) return;
|
|
10111
10111
|
const a = document.createElement("style"), r = document.createTextNode("");
|
|
10112
10112
|
a.appendChild(r), a.id = "_goober", a.setAttribute("nonce", e), t ? t.appendChild(a) : document.head.appendChild(a);
|
|
@@ -10159,10 +10159,10 @@ var wg = (e, t = !1) => {
|
|
|
10159
10159
|
mount(e) {
|
|
10160
10160
|
if (te(this, qt))
|
|
10161
10161
|
throw new Error("Devtools is already mounted");
|
|
10162
|
-
const t =
|
|
10162
|
+
const t = Il(() => {
|
|
10163
10163
|
const s = this, [a] = te(this, cn), [r] = te(this, dn), [i] = te(this, un), [l] = te(this, hn), [o] = te(this, is), [d] = te(this, ln);
|
|
10164
10164
|
let h;
|
|
10165
|
-
return te(this, mn) ? h = te(this, mn) : (h =
|
|
10165
|
+
return te(this, mn) ? h = te(this, mn) : (h = kl(() => import("./LNWAZHJI-ikdFXaCe.js")), pe(this, mn, h)), Ql(te(this, rs), te(this, on)), Tl(h, Cl({
|
|
10166
10166
|
get queryFlavor() {
|
|
10167
10167
|
return te(s, ss);
|
|
10168
10168
|
},
|
|
@@ -10258,10 +10258,10 @@ var wg = (e, t = !1) => {
|
|
|
10258
10258
|
mount(e) {
|
|
10259
10259
|
if (te(this, jt))
|
|
10260
10260
|
throw new Error("Devtools is already mounted");
|
|
10261
|
-
const t =
|
|
10261
|
+
const t = Il(() => {
|
|
10262
10262
|
const s = this, [a] = te(this, pn), [r] = te(this, yn), [i] = te(this, vn), [l] = te(this, bn), [o] = te(this, hs), [d] = te(this, fn), [h] = te(this, xn);
|
|
10263
10263
|
let u;
|
|
10264
|
-
return te(this, wn) ? u = te(this, wn) : (u =
|
|
10264
|
+
return te(this, wn) ? u = te(this, wn) : (u = kl(() => import("./MWZ6AO7Z-uvdDTCnz.js")), pe(this, wn, u)), Ql(te(this, us), te(this, gn)), Tl(u, Cl({
|
|
10265
10265
|
get queryFlavor() {
|
|
10266
10266
|
return te(s, cs);
|
|
10267
10267
|
},
|
|
@@ -10321,7 +10321,7 @@ function tf(e) {
|
|
|
10321
10321
|
client: t,
|
|
10322
10322
|
queryFlavor: "React Query",
|
|
10323
10323
|
version: "5",
|
|
10324
|
-
onlineManager:
|
|
10324
|
+
onlineManager: Xr,
|
|
10325
10325
|
buttonPosition: a,
|
|
10326
10326
|
position: r,
|
|
10327
10327
|
initialIsOpen: i,
|
|
@@ -10351,7 +10351,7 @@ function nf(e) {
|
|
|
10351
10351
|
client: t,
|
|
10352
10352
|
queryFlavor: "React Query",
|
|
10353
10353
|
version: "5",
|
|
10354
|
-
onlineManager:
|
|
10354
|
+
onlineManager: Xr,
|
|
10355
10355
|
buttonPosition: "bottom-left",
|
|
10356
10356
|
position: "bottom",
|
|
10357
10357
|
initialIsOpen: !0,
|
|
@@ -10406,7 +10406,7 @@ const af = () => {
|
|
|
10406
10406
|
queryFn: async () => t(e, { action: G.GET_COLLECTIONS })
|
|
10407
10407
|
});
|
|
10408
10408
|
}, lf = () => {
|
|
10409
|
-
const { data: e } =
|
|
10409
|
+
const { data: e } = We(), { data: t } = Gt(), { data: s } = St(), a = ue(), r = Z(), i = W(() => (s == null ? void 0 : s.fallbackLang) || "en", [s == null ? void 0 : s.fallbackLang]);
|
|
10410
10410
|
return ke({
|
|
10411
10411
|
mutationFn: async ({ block: l }) => r(a, {
|
|
10412
10412
|
action: G.GET_BLOCK_ASYNC_PROPS,
|
|
@@ -10540,11 +10540,11 @@ const hf = () => {
|
|
|
10540
10540
|
queryKey: [G.GET_ASSETS]
|
|
10541
10541
|
});
|
|
10542
10542
|
const i = a == null ? void 0 : a.length;
|
|
10543
|
-
|
|
10543
|
+
H.success(`${i === 1 ? "Asset" : i + " Assets"} uploaded successfully`);
|
|
10544
10544
|
}
|
|
10545
10545
|
},
|
|
10546
10546
|
onError: () => {
|
|
10547
|
-
|
|
10547
|
+
H.error("Failed to upload asset");
|
|
10548
10548
|
}
|
|
10549
10549
|
});
|
|
10550
10550
|
}, mf = () => {
|
|
@@ -10559,10 +10559,10 @@ const hf = () => {
|
|
|
10559
10559
|
throw new Error(a == null ? void 0 : a.error);
|
|
10560
10560
|
t.invalidateQueries({
|
|
10561
10561
|
queryKey: [G.GET_ASSETS]
|
|
10562
|
-
}),
|
|
10562
|
+
}), H.success("Asset deleted successfully");
|
|
10563
10563
|
},
|
|
10564
10564
|
onError: () => {
|
|
10565
|
-
|
|
10565
|
+
H.error("Failed to delete asset");
|
|
10566
10566
|
}
|
|
10567
10567
|
});
|
|
10568
10568
|
}, ff = () => {
|
|
@@ -10577,10 +10577,10 @@ const hf = () => {
|
|
|
10577
10577
|
throw new Error(a == null ? void 0 : a.error);
|
|
10578
10578
|
t.invalidateQueries({
|
|
10579
10579
|
queryKey: [G.GET_ASSETS]
|
|
10580
|
-
}),
|
|
10580
|
+
}), H.success("Asset updated successfully");
|
|
10581
10581
|
},
|
|
10582
10582
|
onError: () => {
|
|
10583
|
-
|
|
10583
|
+
H.error("Failed to update asset");
|
|
10584
10584
|
}
|
|
10585
10585
|
});
|
|
10586
10586
|
};
|
|
@@ -10592,7 +10592,7 @@ function gf({
|
|
|
10592
10592
|
showPageInput: r = !0,
|
|
10593
10593
|
className: i = ""
|
|
10594
10594
|
}) {
|
|
10595
|
-
const [l, o] = S(String(e)), d =
|
|
10595
|
+
const [l, o] = S(String(e)), d = W(() => {
|
|
10596
10596
|
const p = Math.floor(a / 2);
|
|
10597
10597
|
let f = Math.max(1, e - p), v = Math.min(t, e + p);
|
|
10598
10598
|
v - f + 1 < a && (f === 1 ? v = Math.min(t, f + a - 1) : v === t && (f = Math.max(1, v - a + 1)));
|
|
@@ -10749,14 +10749,14 @@ const bf = ({
|
|
|
10749
10749
|
var m, y, g;
|
|
10750
10750
|
const { data: i, isLoading: l, isError: o } = yf(e || ""), [d, h] = S(""), u = async (p, f) => {
|
|
10751
10751
|
try {
|
|
10752
|
-
await navigator.clipboard.writeText(p),
|
|
10752
|
+
await navigator.clipboard.writeText(p), H.success(`${f} copied to clipboard`);
|
|
10753
10753
|
} catch (v) {
|
|
10754
|
-
|
|
10754
|
+
H.error(`Failed to copy ${f}`, {
|
|
10755
10755
|
description: v == null ? void 0 : v.message
|
|
10756
10756
|
});
|
|
10757
10757
|
}
|
|
10758
10758
|
};
|
|
10759
|
-
return
|
|
10759
|
+
return Hs.useEffect(() => {
|
|
10760
10760
|
i != null && i.description && h(i.description);
|
|
10761
10761
|
}, [i]), l ? /* @__PURE__ */ n("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ n(wt, { className: "h-8 w-8 animate-spin" }) }) : o || !(i != null && i.id) ? /* @__PURE__ */ n("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ c("div", { className: "text-center max-w-md mx-auto p-6", children: [
|
|
10762
10762
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ n(na, { className: "h-12 w-12 text-gray-400" }) }),
|
|
@@ -10809,7 +10809,7 @@ const bf = ({
|
|
|
10809
10809
|
onClick: () => s(i),
|
|
10810
10810
|
disabled: r,
|
|
10811
10811
|
children: [
|
|
10812
|
-
/* @__PURE__ */ n(
|
|
10812
|
+
/* @__PURE__ */ n(Ei, { className: "h-4 w-4" }),
|
|
10813
10813
|
"Edit Image"
|
|
10814
10814
|
]
|
|
10815
10815
|
}
|
|
@@ -10925,7 +10925,7 @@ const bf = ({
|
|
|
10925
10925
|
] })
|
|
10926
10926
|
] })
|
|
10927
10927
|
] });
|
|
10928
|
-
}, xf =
|
|
10928
|
+
}, xf = Hs.lazy(() => import("./image-editor-CzFST20j.js")), wf = 25 * 1024 * 1024, Nf = ({ isUpdatingAsset: e, allowedTypes: t, uploadAssets: s, isUploadingAsset: a, onUploaded: r }) => {
|
|
10929
10929
|
const [i, l] = S(() => {
|
|
10930
10930
|
const g = localStorage.getItem("chai_optimize_images");
|
|
10931
10931
|
return g !== null ? g === "true" : !0;
|
|
@@ -10938,10 +10938,10 @@ const bf = ({
|
|
|
10938
10938
|
try {
|
|
10939
10939
|
const p = g;
|
|
10940
10940
|
if (!p.every((N) => N.type.startsWith("image/")))
|
|
10941
|
-
return
|
|
10941
|
+
return H.error("Invalid file type. Please upload a valid file."), Promise.reject(new Error("Invalid file type"));
|
|
10942
10942
|
const f = p.map(async (N) => {
|
|
10943
10943
|
let I = N;
|
|
10944
|
-
return N.type.startsWith("image/") && (I = await
|
|
10944
|
+
return N.type.startsWith("image/") && (I = await Yi(N)), new Promise((L, C) => {
|
|
10945
10945
|
const P = new FileReader();
|
|
10946
10946
|
P.readAsDataURL(I), P.onload = async () => {
|
|
10947
10947
|
L({
|
|
@@ -10964,7 +10964,7 @@ const bf = ({
|
|
|
10964
10964
|
let f = 0;
|
|
10965
10965
|
return g.forEach((v) => {
|
|
10966
10966
|
v.size > wf ? f++ : p.push(v);
|
|
10967
|
-
}), f > 0 &&
|
|
10967
|
+
}), f > 0 && H.error(
|
|
10968
10968
|
`${f === 1 && g.length === 1 ? "File" : f + (f === 1 ? " file" : " files")} exceed the maximum size limit of 10MB.`
|
|
10969
10969
|
), Y(p) ? [] : d(p);
|
|
10970
10970
|
}, { getRootProps: u, getInputProps: m, isDragActive: y } = Gc({
|
|
@@ -11047,7 +11047,7 @@ const bf = ({
|
|
|
11047
11047
|
"span",
|
|
11048
11048
|
{
|
|
11049
11049
|
className: `flex cursor-help items-center text-amber-500 ${i ? "invisible" : ""}`,
|
|
11050
|
-
children: /* @__PURE__ */ n(
|
|
11050
|
+
children: /* @__PURE__ */ n(Oi, { className: "mr-1 h-4 w-4" })
|
|
11051
11051
|
}
|
|
11052
11052
|
) }),
|
|
11053
11053
|
/* @__PURE__ */ n(et, { side: "top", children: /* @__PURE__ */ c("p", { className: "text-xs text-white", children: [
|
|
@@ -11064,8 +11064,8 @@ const bf = ({
|
|
|
11064
11064
|
}
|
|
11065
11065
|
);
|
|
11066
11066
|
};
|
|
11067
|
-
function
|
|
11068
|
-
const l =
|
|
11067
|
+
function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
11068
|
+
const l = W(() => [s], [s]), [o, d] = S(null), [h, u] = S(null), [m, y] = S(null), [g, p] = S({ show: !1, file: "" }), [f, v] = S(!1), [x, N] = S(a ? "details" : "grid"), [I, L] = S(""), [C, P] = S(""), [U, J] = S(1), [ee] = S(30), [D, F] = S([]);
|
|
11069
11069
|
le(() => {
|
|
11070
11070
|
a && (d(a), N("details"));
|
|
11071
11071
|
}, [a]), le(() => {
|
|
@@ -11098,7 +11098,7 @@ function Ql({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11098
11098
|
), V = ae(() => {
|
|
11099
11099
|
F([]);
|
|
11100
11100
|
}, []), j = (_) => {
|
|
11101
|
-
(_ == null ? void 0 : _.length) !== 0 && (t(fs(
|
|
11101
|
+
(_ == null ? void 0 : _.length) !== 0 && (t(fs(Yr(_ || D), ["id", "url", "width", "height", "description"])), e());
|
|
11102
11102
|
}, Q = async (_) => {
|
|
11103
11103
|
u(_);
|
|
11104
11104
|
}, ie = async () => {
|
|
@@ -11271,7 +11271,7 @@ function Ql({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11271
11271
|
size: "icon",
|
|
11272
11272
|
className: "h-8 w-8 rounded-full",
|
|
11273
11273
|
onClick: (ne) => {
|
|
11274
|
-
ne.stopPropagation(), navigator.clipboard.writeText(_.url),
|
|
11274
|
+
ne.stopPropagation(), navigator.clipboard.writeText(_.url), H.success("Asset URL copied to clipboard");
|
|
11275
11275
|
},
|
|
11276
11276
|
children: /* @__PURE__ */ n(Bs, { className: "h-4 w-4" })
|
|
11277
11277
|
}
|
|
@@ -11293,7 +11293,7 @@ function Ql({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11293
11293
|
name: _.name
|
|
11294
11294
|
});
|
|
11295
11295
|
},
|
|
11296
|
-
children: /* @__PURE__ */ n(
|
|
11296
|
+
children: /* @__PURE__ */ n(Wn, { className: "h-4 w-4" })
|
|
11297
11297
|
}
|
|
11298
11298
|
) }),
|
|
11299
11299
|
/* @__PURE__ */ n(et, { children: /* @__PURE__ */ n("p", { children: "Edit Image" }) })
|
|
@@ -11385,7 +11385,7 @@ function Ql({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11385
11385
|
'"? This action cannot be undone.'
|
|
11386
11386
|
] })
|
|
11387
11387
|
] }),
|
|
11388
|
-
/* @__PURE__ */ c(
|
|
11388
|
+
/* @__PURE__ */ c(ht, { className: "gap-2 sm:gap-0", children: [
|
|
11389
11389
|
/* @__PURE__ */ n(T, { variant: "outline", onClick: () => u(null), children: "Cancel" }),
|
|
11390
11390
|
/* @__PURE__ */ n(T, { variant: "destructive", onClick: ie, children: "Delete" })
|
|
11391
11391
|
] })
|
|
@@ -11394,8 +11394,8 @@ function Ql({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11394
11394
|
}
|
|
11395
11395
|
const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11396
11396
|
__proto__: null,
|
|
11397
|
-
default:
|
|
11398
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
11397
|
+
default: Jl
|
|
11398
|
+
}, Symbol.toStringTag, { value: "Module" })), Wa = ({
|
|
11399
11399
|
assetId: e,
|
|
11400
11400
|
assetUrl: t,
|
|
11401
11401
|
onChange: s,
|
|
@@ -11477,7 +11477,7 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11477
11477
|
)
|
|
11478
11478
|
] }),
|
|
11479
11479
|
/* @__PURE__ */ n("div", { className: "h-full flex-1 p-4", children: /* @__PURE__ */ n(
|
|
11480
|
-
|
|
11480
|
+
Jl,
|
|
11481
11481
|
{
|
|
11482
11482
|
close: h,
|
|
11483
11483
|
onSelect: u,
|
|
@@ -11512,7 +11512,7 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11512
11512
|
/* @__PURE__ */ c("div", { children: [
|
|
11513
11513
|
/* @__PURE__ */ n("label", { className: "text-sm font-medium block mb-1", children: "Logo" }),
|
|
11514
11514
|
/* @__PURE__ */ n(
|
|
11515
|
-
|
|
11515
|
+
Wa,
|
|
11516
11516
|
{
|
|
11517
11517
|
assetId: e.logoId,
|
|
11518
11518
|
assetUrl: e.logoUrl,
|
|
@@ -11532,7 +11532,7 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11532
11532
|
/* @__PURE__ */ c("div", { children: [
|
|
11533
11533
|
/* @__PURE__ */ n("label", { className: "text-sm font-medium block mb-1", children: "Favicon" }),
|
|
11534
11534
|
/* @__PURE__ */ n(
|
|
11535
|
-
|
|
11535
|
+
Wa,
|
|
11536
11536
|
{
|
|
11537
11537
|
assetId: e.faviconId,
|
|
11538
11538
|
assetUrl: e.faviconUrl,
|
|
@@ -11861,27 +11861,27 @@ If();
|
|
|
11861
11861
|
Go(_f);
|
|
11862
11862
|
Uo(Sd);
|
|
11863
11863
|
const Lf = (e) => {
|
|
11864
|
-
const t = tt([]), [s] =
|
|
11864
|
+
const t = tt([]), [s] = He(), a = s.get("page"), { data: r } = We(), {
|
|
11865
11865
|
data: i = {
|
|
11866
11866
|
role: "",
|
|
11867
11867
|
permissions: null
|
|
11868
11868
|
}
|
|
11869
11869
|
} = sh();
|
|
11870
11870
|
nh(), cd();
|
|
11871
|
-
const { data: l, isFetching: o } = Wi(), { blocks: d } = th(l), { data: h } = Ge(), { mutateAsync: u } =
|
|
11871
|
+
const { data: l, isFetching: o } = Wi(), { blocks: d } = th(l), { data: h } = Ge(), { mutateAsync: u } = Mi(), m = Zu(), { onSave: y } = ah(), { getPartialBlocks: g, getPartialBlockBlocks: p } = rh(), { aiContext: f, setAiContext: v } = er(), { mutateAsync: x } = Td(), [N, I] = S(!1), { data: L } = St(), C = Rt(), { data: P } = Qi(), { data: U } = rf(), { mutateAsync: J } = lf(), ee = of();
|
|
11872
11872
|
Jc(), le(() => {
|
|
11873
11873
|
const q = () => {
|
|
11874
11874
|
document.hidden ? I(!0) : I(!1);
|
|
11875
11875
|
};
|
|
11876
11876
|
return window.addEventListener("visibilitychange", q), () => window.removeEventListener("visibilitychange", q);
|
|
11877
11877
|
}, []), t.current = d;
|
|
11878
|
-
const D =
|
|
11878
|
+
const D = W(() => {
|
|
11879
11879
|
const q = {};
|
|
11880
11880
|
return i && (q.permissions = $(i, "permissions", null), q.role = $(i, "role", "user")), q;
|
|
11881
11881
|
}, [i]), F = ae(
|
|
11882
11882
|
async (q, B) => await x({ pageType: q, query: B }),
|
|
11883
11883
|
[x]
|
|
11884
|
-
), M =
|
|
11884
|
+
), M = W(() => $(L, "theme", {}) || {}, [L]);
|
|
11885
11885
|
return /* @__PURE__ */ c(de, { children: [
|
|
11886
11886
|
/* @__PURE__ */ n(
|
|
11887
11887
|
Bo,
|
|
@@ -11944,7 +11944,7 @@ const Lf = (e) => {
|
|
|
11944
11944
|
}
|
|
11945
11945
|
}
|
|
11946
11946
|
}), Tg = (e) => {
|
|
11947
|
-
const { isLoggedIn: t } = ot(), [, s] =
|
|
11947
|
+
const { isLoggedIn: t } = ot(), [, s] = Fi(), [a, r] = S(!1);
|
|
11948
11948
|
return le(() => (s(
|
|
11949
11949
|
fs(e, [
|
|
11950
11950
|
"apiUrl",
|
|
@@ -11991,7 +11991,7 @@ const Lf = (e) => {
|
|
|
11991
11991
|
}
|
|
11992
11992
|
});
|
|
11993
11993
|
}, kg = () => {
|
|
11994
|
-
const { logout: e } = ot(), { getAccessToken: t } =
|
|
11994
|
+
const { logout: e } = ot(), { getAccessToken: t } = Ui();
|
|
11995
11995
|
return ae(
|
|
11996
11996
|
async ({
|
|
11997
11997
|
url: s,
|
|
@@ -12029,7 +12029,7 @@ const Lf = (e) => {
|
|
|
12029
12029
|
if (typeof window > "u")
|
|
12030
12030
|
throw new Error("@chaibuilder/pages is not available on the server");
|
|
12031
12031
|
export {
|
|
12032
|
-
|
|
12032
|
+
pl as $,
|
|
12033
12033
|
xg as A,
|
|
12034
12034
|
wg as B,
|
|
12035
12035
|
Xf as C,
|
|
@@ -12056,19 +12056,19 @@ export {
|
|
|
12056
12056
|
Tg as X,
|
|
12057
12057
|
It as Y,
|
|
12058
12058
|
Gt as Z,
|
|
12059
|
-
|
|
12060
|
-
|
|
12059
|
+
Qi as _,
|
|
12060
|
+
Tl as a,
|
|
12061
12061
|
Rt as a0,
|
|
12062
12062
|
of as a1,
|
|
12063
12063
|
Ge as a2,
|
|
12064
12064
|
Cg as a3,
|
|
12065
12065
|
lt as a4,
|
|
12066
|
-
|
|
12067
|
-
|
|
12066
|
+
cl as a5,
|
|
12067
|
+
Wa as a6,
|
|
12068
12068
|
_r as a7,
|
|
12069
12069
|
Yf as a8,
|
|
12070
12070
|
Na as a9,
|
|
12071
|
-
|
|
12071
|
+
We as aa,
|
|
12072
12072
|
pt as ab,
|
|
12073
12073
|
On as ac,
|
|
12074
12074
|
St as ad,
|
|
@@ -12081,12 +12081,12 @@ export {
|
|
|
12081
12081
|
_e as b,
|
|
12082
12082
|
Me as c,
|
|
12083
12083
|
rm as d,
|
|
12084
|
-
|
|
12085
|
-
|
|
12084
|
+
bl as e,
|
|
12085
|
+
Cl as f,
|
|
12086
12086
|
Ag as g,
|
|
12087
|
-
|
|
12087
|
+
Hh as h,
|
|
12088
12088
|
ng as i,
|
|
12089
|
-
|
|
12089
|
+
Ht as j,
|
|
12090
12090
|
$a as k,
|
|
12091
12091
|
ag as l,
|
|
12092
12092
|
Eg as m,
|