@llmnative/react 1.6.1 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +617 -593
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/types.d.ts +19 -0
- package/dist/types/src/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8,12 +8,12 @@ import { ArrowDown as E, ArrowUp as D, ArrowUpDown as O, GripVertical as k } fro
|
|
|
8
8
|
import * as A from "@phosphor-icons/react";
|
|
9
9
|
import { createPortal as j, flushSync as M } from "react-dom";
|
|
10
10
|
import { deleteApp as N, getApp as P, getApps as F, initializeApp as I } from "firebase/app";
|
|
11
|
-
import { GoogleAuthProvider as L, OAuthProvider as R, getAdditionalUserInfo as
|
|
11
|
+
import { GoogleAuthProvider as L, OAuthProvider as R, getAdditionalUserInfo as z, getAuth as B, inMemoryPersistence as V, onAuthStateChanged as H, onIdTokenChanged as U, setPersistence as W, signInAnonymously as ee, signInWithCredential as te, signInWithCustomToken as G, signInWithEmailAndPassword as ne, signInWithPopup as re, signOut as K } from "firebase/auth";
|
|
12
12
|
import { addDoc as ie, collection as ae, deleteDoc as oe, doc as se, getCountFromServer as ce, getDoc as le, getDocs as ue, getFirestore as de, onSnapshot as fe, orderBy as q, query as pe, setDoc as me, terminate as he, updateDoc as ge, where as _e, writeBatch as ve } from "firebase/firestore";
|
|
13
13
|
import { createClient as ye } from "@supabase/supabase-js";
|
|
14
|
-
import { deleteObject as be, getDownloadURL as xe, getMetadata as Se, getStorage as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
14
|
+
import { deleteObject as be, getDownloadURL as xe, getMetadata as Se, getStorage as Ce, listAll as we, ref as Te, uploadBytesResumable as Ee, uploadString as De } from "firebase/storage";
|
|
15
|
+
import Oe from "papaparse";
|
|
16
|
+
import J from "react-markdown";
|
|
17
17
|
import ke from "remark-gfm";
|
|
18
18
|
import Ae from "rehype-slug";
|
|
19
19
|
import je from "rehype-autolink-headings";
|
|
@@ -3531,14 +3531,14 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3531
3531
|
xl: "w-[48rem]",
|
|
3532
3532
|
"2xl": "w-[64rem]",
|
|
3533
3533
|
fullscreen: "w-screen"
|
|
3534
|
-
}[F || O.Modal.size || "lg"],
|
|
3534
|
+
}[F || O.Modal.size || "lg"], z = {
|
|
3535
3535
|
sm: "max-h-[30vh]",
|
|
3536
3536
|
md: "max-h-[45vh]",
|
|
3537
3537
|
lg: "max-h-[60vh]",
|
|
3538
3538
|
xl: "max-h-[85vh]",
|
|
3539
3539
|
"2xl": "max-h-[90vh]",
|
|
3540
3540
|
fullscreen: "h-dvh max-h-none"
|
|
3541
|
-
}[F || O.Modal.size || "lg"],
|
|
3541
|
+
}[F || O.Modal.size || "lg"], B = {
|
|
3542
3542
|
center: {
|
|
3543
3543
|
coverClass: "fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",
|
|
3544
3544
|
dialogClass: X("relative z-50 flex w-full flex-col overflow-hidden rounded-lg border border-border/60 bg-card shadow-xl", F !== "fullscreen" && "max-h-[calc(100dvh-2rem)]", L, m || O.Modal.wrapperClassName),
|
|
@@ -3551,7 +3551,7 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3551
3551
|
},
|
|
3552
3552
|
top: {
|
|
3553
3553
|
coverClass: "fixed inset-0 z-50",
|
|
3554
|
-
dialogClass: X("fixed left-0 right-0 top-0 z-50 flex flex-col border-b border-border/60 bg-card shadow-xl",
|
|
3554
|
+
dialogClass: X("fixed left-0 right-0 top-0 z-50 flex flex-col border-b border-border/60 bg-card shadow-xl", z, m || O.Modal.wrapperClassName),
|
|
3555
3555
|
contentClass: X("flex min-h-0 flex-1 flex-col", g || O.Modal.className),
|
|
3556
3556
|
headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", _ || O.Modal.headerClassName),
|
|
3557
3557
|
titleClassName: X("text-lg font-semibold leading-none", v || O.Modal.titleClassName),
|
|
@@ -3581,7 +3581,7 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3581
3581
|
},
|
|
3582
3582
|
bottom: {
|
|
3583
3583
|
coverClass: "fixed inset-0 z-50",
|
|
3584
|
-
dialogClass: X("fixed bottom-0 left-0 right-0 z-50 flex flex-col border-t border-border/60 bg-card shadow-xl",
|
|
3584
|
+
dialogClass: X("fixed bottom-0 left-0 right-0 z-50 flex flex-col border-t border-border/60 bg-card shadow-xl", z, m || O.Modal.wrapperClassName),
|
|
3585
3585
|
contentClass: X("flex min-h-0 flex-1 flex-col", g || O.Modal.className),
|
|
3586
3586
|
headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", _ || O.Modal.headerClassName),
|
|
3587
3587
|
titleClassName: X("text-lg font-semibold leading-none", v || O.Modal.titleClassName),
|
|
@@ -3589,7 +3589,7 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3589
3589
|
bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", b || O.Modal.bodyClassName),
|
|
3590
3590
|
footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", x || O.Modal.footerClassName)
|
|
3591
3591
|
}
|
|
3592
|
-
},
|
|
3592
|
+
}, V = F === "fullscreen" ? "center" : l || O.Modal.position, H = B[V], U = F === "fullscreen" ? X(H.coverClass, "!overflow-hidden !p-0") : H.coverClass;
|
|
3593
3593
|
t.useEffect(() => {
|
|
3594
3594
|
let e = window.document.body.style.overflow;
|
|
3595
3595
|
window.document.body.style.overflow = "hidden";
|
|
@@ -3598,23 +3598,23 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3598
3598
|
window.cancelAnimationFrame(t), P.current !== void 0 && window.clearTimeout(P.current), window.document.body.style.overflow = e || "auto";
|
|
3599
3599
|
};
|
|
3600
3600
|
}, []);
|
|
3601
|
-
let
|
|
3601
|
+
let W = D ?? O.Modal.motion?.[V] ?? "fade", ee = rr(W, W), te = () => {
|
|
3602
3602
|
if (N.current) return;
|
|
3603
3603
|
N.current = !0, M(!1), window.document.body.style.overflow = "auto";
|
|
3604
|
-
let e =
|
|
3604
|
+
let e = ee.transition.duration + ee.transition.delay;
|
|
3605
3605
|
P.current = window.setTimeout(() => {
|
|
3606
3606
|
a?.();
|
|
3607
3607
|
}, e);
|
|
3608
|
-
},
|
|
3608
|
+
}, G = ir(A, W, W), ne = T ? { right: T } : {}, re = {
|
|
3609
3609
|
...ir(A, O.Modal.motion?.backdrop ?? "fade", O.Modal.motion?.backdrop ?? "fade"),
|
|
3610
3610
|
cursor: S && a ? "pointer" : "default",
|
|
3611
3611
|
...C === void 0 ? {} : { zIndex: C - 10 },
|
|
3612
|
-
...
|
|
3612
|
+
...ne
|
|
3613
3613
|
}, K = {
|
|
3614
3614
|
cursor: S && a ? "pointer" : "default",
|
|
3615
3615
|
...C === void 0 ? {} : { zIndex: C },
|
|
3616
3616
|
...w ? { pointerEvents: "none" } : {},
|
|
3617
|
-
...
|
|
3617
|
+
...ne
|
|
3618
3618
|
}, ie = w ? {
|
|
3619
3619
|
transform: l === "left" ? "scale(0.94) translateX(-14px)" : l === "right" ? "scale(0.94) translateX(14px)" : l === "bottom" ? "scale(0.94) translateY(14px)" : l === "top" ? "scale(0.94) translateY(-14px)" : "scale(0.94)",
|
|
3620
3620
|
transformOrigin: l === "left" ? "left center" : l === "right" ? "right center" : l === "bottom" ? "bottom center" : l === "top" ? "top center" : "center",
|
|
@@ -3622,21 +3622,21 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3622
3622
|
filter: "brightness(0.7)"
|
|
3623
3623
|
} : {}, ae = i !== !1 && (i || o || s || d && a), oe = "inline-flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
3624
3624
|
return j(/* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
3625
|
-
className:
|
|
3625
|
+
className: U,
|
|
3626
3626
|
style: K,
|
|
3627
3627
|
onClick: () => {
|
|
3628
|
-
S && a &&
|
|
3628
|
+
S && a && te();
|
|
3629
3629
|
}
|
|
3630
3630
|
}, /* @__PURE__ */ t.createElement("div", {
|
|
3631
|
-
className:
|
|
3631
|
+
className: H.dialogClass,
|
|
3632
3632
|
style: {
|
|
3633
|
-
...
|
|
3633
|
+
...G,
|
|
3634
3634
|
...ie,
|
|
3635
3635
|
...C === void 0 ? {} : { zIndex: C },
|
|
3636
|
-
...
|
|
3636
|
+
...V === "right" ? ne : {}
|
|
3637
3637
|
},
|
|
3638
3638
|
onClick: (e) => e.stopPropagation()
|
|
3639
|
-
}, f, /* @__PURE__ */ t.createElement("div", { className:
|
|
3639
|
+
}, f, /* @__PURE__ */ t.createElement("div", { className: H.contentClass }, (r || n || u || a || E) && /* @__PURE__ */ t.createElement("div", { className: H.headerClassName }, /* @__PURE__ */ t.createElement("div", { className: "min-w-0" }, n && /* @__PURE__ */ t.createElement("h3", { className: H.titleClassName }, n), n && r && /* @__PURE__ */ t.createElement("div", { className: H.subtitleClassName }, r), !n && r && (typeof r == "string" ? /* @__PURE__ */ t.createElement("h3", { className: H.titleClassName }, r) : r)), (u || a || E) && /* @__PURE__ */ t.createElement("div", { className: "ml-auto flex shrink-0 items-center gap-1" }, u && /* @__PURE__ */ t.createElement("button", {
|
|
3640
3640
|
type: "button",
|
|
3641
3641
|
title: F === "fullscreen" ? "Exit fullscreen" : "Enter fullscreen",
|
|
3642
3642
|
"aria-label": F === "fullscreen" ? "Exit fullscreen" : "Enter fullscreen",
|
|
@@ -3653,34 +3653,34 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3653
3653
|
"aria-label": k.close,
|
|
3654
3654
|
className: oe,
|
|
3655
3655
|
onClick: (e) => {
|
|
3656
|
-
e.preventDefault(), e.stopPropagation(),
|
|
3656
|
+
e.preventDefault(), e.stopPropagation(), te();
|
|
3657
3657
|
}
|
|
3658
3658
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
3659
3659
|
name: "x",
|
|
3660
3660
|
size: 20
|
|
3661
|
-
}))))), /* @__PURE__ */ t.createElement("div", { className:
|
|
3661
|
+
}))))), /* @__PURE__ */ t.createElement("div", { className: H.bodyClassName }, e), ae && /* @__PURE__ */ t.createElement("div", { className: H.footerClassName }, i, !i && o && /* @__PURE__ */ t.createElement(zr, {
|
|
3662
3662
|
variant: "primary",
|
|
3663
3663
|
label: k.save,
|
|
3664
3664
|
onClick: async (e) => {
|
|
3665
|
-
e.preventDefault(), await o(e) &&
|
|
3665
|
+
e.preventDefault(), await o(e) && te();
|
|
3666
3666
|
}
|
|
3667
3667
|
}), !i && s && /* @__PURE__ */ t.createElement(zr, {
|
|
3668
3668
|
variant: "danger",
|
|
3669
3669
|
label: k.delete,
|
|
3670
3670
|
onClick: async (e) => {
|
|
3671
|
-
e.preventDefault(), await s(e),
|
|
3671
|
+
e.preventDefault(), await s(e), te();
|
|
3672
3672
|
}
|
|
3673
3673
|
}), !i && d && a && /* @__PURE__ */ t.createElement(Br, {
|
|
3674
3674
|
variant: "link",
|
|
3675
3675
|
label: k.cancel,
|
|
3676
|
-
onClick:
|
|
3676
|
+
onClick: te
|
|
3677
3677
|
}))), p)), !w && /* @__PURE__ */ t.createElement("div", {
|
|
3678
3678
|
"data-rf-modal-backdrop": "",
|
|
3679
3679
|
"aria-hidden": "true",
|
|
3680
3680
|
className: "fixed inset-0 z-40 bg-black/60 backdrop-blur-sm",
|
|
3681
3681
|
style: re,
|
|
3682
3682
|
onClick: () => {
|
|
3683
|
-
S && a &&
|
|
3683
|
+
S && a && te();
|
|
3684
3684
|
}
|
|
3685
3685
|
})), document.body);
|
|
3686
3686
|
}, Mi = ({ children: e, title: n = void 0, onYes: r = void 0, onNo: i = void 0, onClose: a = void 0 }) => {
|
|
@@ -3753,7 +3753,7 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3753
3753
|
index: n
|
|
3754
3754
|
}))), a);
|
|
3755
3755
|
}, Fi = t.createContext(null), Ii = ({ children: e, trigger: n, badge: r = void 0, header: i = void 0, footer: a = void 0, defaultOpen: o = !1, open: s = void 0, onOpenChange: c = void 0, closeOnSelect: l = !0, staticOpen: u = !1, position: d = void 0, placement: f = "bottom", strategy: p = "fixed", wrapperClassName: m = void 0, className: h = void 0, before: g = void 0, after: _ = void 0, triggerClassName: v = void 0, menuClassName: y = void 0, badgeClassName: b = void 0, headerClassName: x = void 0, footerClassName: S = void 0, motion: C = void 0 }) => {
|
|
3756
|
-
let w = Y("dropdown"), [T, E] = t.useState(o), D = t.useRef(null), O = t.useRef(null), k = t.useRef(null), A = t.useId(), M = u ? !0 : s ?? T, [N, P] = t.useState("bottom"), [F, I] = t.useState(void 0), [L, R] = t.useState(null),
|
|
3756
|
+
let w = Y("dropdown"), [T, E] = t.useState(o), D = t.useRef(null), O = t.useRef(null), k = t.useRef(null), A = t.useId(), M = u ? !0 : s ?? T, [N, P] = t.useState("bottom"), [F, I] = t.useState(void 0), [L, R] = t.useState(null), z = !u && n !== void 0, B = ir(M, C ?? w.Dropdown.motion?.open ?? "fadeDown", w.Dropdown.motion?.open ?? "fadeDown"), V = t.useCallback((e) => {
|
|
3757
3757
|
u || (s === void 0 && E(e), c?.(e));
|
|
3758
3758
|
}, [
|
|
3759
3759
|
u,
|
|
@@ -3764,9 +3764,9 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3764
3764
|
if (!M || u) return;
|
|
3765
3765
|
let e = (e) => {
|
|
3766
3766
|
let t = e.target;
|
|
3767
|
-
!D.current?.contains(t) && !k.current?.contains(t) &&
|
|
3767
|
+
!D.current?.contains(t) && !k.current?.contains(t) && V(!1);
|
|
3768
3768
|
}, t = (e) => {
|
|
3769
|
-
e.key === "Escape" &&
|
|
3769
|
+
e.key === "Escape" && V(!1);
|
|
3770
3770
|
};
|
|
3771
3771
|
return window.document.addEventListener("pointerdown", e), window.document.addEventListener("keydown", t), () => {
|
|
3772
3772
|
window.document.removeEventListener("pointerdown", e), window.document.removeEventListener("keydown", t);
|
|
@@ -3774,7 +3774,7 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3774
3774
|
}, [
|
|
3775
3775
|
u,
|
|
3776
3776
|
M,
|
|
3777
|
-
|
|
3777
|
+
V
|
|
3778
3778
|
]), t.useEffect(() => {
|
|
3779
3779
|
if (!M || u || !O.current) return;
|
|
3780
3780
|
let e = O.current.getBoundingClientRect(), t = window.innerHeight - e.bottom - 8, n = e.top - 8, r;
|
|
@@ -3794,33 +3794,33 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3794
3794
|
u,
|
|
3795
3795
|
p
|
|
3796
3796
|
]);
|
|
3797
|
-
function
|
|
3797
|
+
function H(e) {
|
|
3798
3798
|
return typeof e == "object" && !!e && !t.isValidElement(e) && ("icon" in e || "text" in e);
|
|
3799
3799
|
}
|
|
3800
|
-
let
|
|
3800
|
+
let U = z ? /* @__PURE__ */ t.createElement(Ri, {
|
|
3801
3801
|
className: v,
|
|
3802
3802
|
badge: r,
|
|
3803
3803
|
badgeClassName: b,
|
|
3804
3804
|
motion: C,
|
|
3805
|
-
title:
|
|
3806
|
-
onToggle: () =>
|
|
3805
|
+
title: H(n) ? n.title : void 0,
|
|
3806
|
+
onToggle: () => V(!M),
|
|
3807
3807
|
open: M,
|
|
3808
3808
|
menuId: A,
|
|
3809
3809
|
buttonRef: O
|
|
3810
|
-
},
|
|
3810
|
+
}, H(n) ? /* @__PURE__ */ t.createElement(t.Fragment, null, n.icon && /* @__PURE__ */ t.createElement(Q, {
|
|
3811
3811
|
name: n.icon,
|
|
3812
3812
|
className: n.text ? "mr-2" : void 0
|
|
3813
|
-
}), n.text) : n) : null,
|
|
3813
|
+
}), n.text) : n) : null, W = m ?? w.Dropdown.wrapperClassName ?? (g || _ ? "flex items-center gap-2" : void 0), ee = N === "top" ? "bottom-full mb-1" : "top-full mt-1", te = d === "end" ? "right-0" : "left-0", G = /* @__PURE__ */ t.createElement(Fi.Provider, { value: {
|
|
3814
3814
|
closeOnSelect: l,
|
|
3815
|
-
close: () =>
|
|
3815
|
+
close: () => V(!1)
|
|
3816
3816
|
} }, /* @__PURE__ */ t.createElement("div", {
|
|
3817
3817
|
ref: k,
|
|
3818
3818
|
id: A,
|
|
3819
3819
|
role: "menu",
|
|
3820
3820
|
"aria-hidden": !M,
|
|
3821
|
-
className: X("min-w-56 overflow-y-auto rounded-xl border border-border/60 bg-popover/95 p-1 text-popover-foreground shadow-xl shadow-black/5 outline-none backdrop-blur supports-[backdrop-filter]:bg-popover/90 dark:shadow-black/20", u ? "relative" : p === "absolute" ? `absolute z-[200] ${
|
|
3821
|
+
className: X("min-w-56 overflow-y-auto rounded-xl border border-border/60 bg-popover/95 p-1 text-popover-foreground shadow-xl shadow-black/5 outline-none backdrop-blur supports-[backdrop-filter]:bg-popover/90 dark:shadow-black/20", u ? "relative" : p === "absolute" ? `absolute z-[200] ${ee} ${te}` : "fixed z-[200]", y || w.Dropdown.menuClassName),
|
|
3822
3822
|
style: u ? void 0 : {
|
|
3823
|
-
...
|
|
3823
|
+
...B,
|
|
3824
3824
|
opacity: +!!M,
|
|
3825
3825
|
visibility: M ? "visible" : "hidden",
|
|
3826
3826
|
pointerEvents: M ? void 0 : "none",
|
|
@@ -3831,11 +3831,11 @@ var Ti = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3831
3831
|
onClick: (e) => {
|
|
3832
3832
|
e.stopPropagation();
|
|
3833
3833
|
}
|
|
3834
|
-
}, i && /* @__PURE__ */ t.createElement("div", { className: X("px-2 py-1.5 text-sm font-semibold", x || w.Dropdown.headerClassName) }, i, /* @__PURE__ */ t.createElement(Vi, null)), e, a && /* @__PURE__ */ t.createElement("div", { className: S || w.Dropdown.footerClassName }, /* @__PURE__ */ t.createElement(Vi, null), a))),
|
|
3835
|
-
return /* @__PURE__ */ t.createElement(Z, { className:
|
|
3834
|
+
}, i && /* @__PURE__ */ t.createElement("div", { className: X("px-2 py-1.5 text-sm font-semibold", x || w.Dropdown.headerClassName) }, i, /* @__PURE__ */ t.createElement(Vi, null)), e, a && /* @__PURE__ */ t.createElement("div", { className: S || w.Dropdown.footerClassName }, /* @__PURE__ */ t.createElement(Vi, null), a))), ne = !u && p === "fixed" && typeof document < "u";
|
|
3835
|
+
return /* @__PURE__ */ t.createElement(Z, { className: W }, g, /* @__PURE__ */ t.createElement("div", {
|
|
3836
3836
|
ref: D,
|
|
3837
3837
|
className: X(u ? "inline-block text-left" : "relative inline-block text-left", h || w.Dropdown.className)
|
|
3838
|
-
},
|
|
3838
|
+
}, U, ne ? j(G, document.body) : G), _);
|
|
3839
3839
|
};
|
|
3840
3840
|
function Li({ loadItems: e, getItemId: n, renderItem: r, onSelect: i, selectedId: a = void 0, searchPlaceholder: o = void 0, emptyState: s = void 0, loadingState: c = void 0, errorState: l = void 0, debounceMs: u = 200, closeOnSelect: d = !0, inputClassName: f = void 0, selectedClassName: p = void 0, header: m = void 0, open: h = void 0, defaultOpen: g = !1, onOpenChange: _ = void 0, footer: v = void 0, headerClassName: y = void 0, staticOpen: b = !1, ...x }) {
|
|
3841
3841
|
let S = Nn("common"), [C, w] = t.useState(g), [T, E] = t.useState(""), [D, O] = t.useState([]), [k, A] = t.useState(!1), [j, M] = t.useState(null), N = t.useRef(0), P = b || (h ?? C), F = t.useCallback((e) => {
|
|
@@ -4475,7 +4475,7 @@ function fa({ open: e = !0, onClose: n = void 0, surface: r = "flat", showHeader
|
|
|
4475
4475
|
value: e,
|
|
4476
4476
|
label: c?.[e]?.label ?? da(e),
|
|
4477
4477
|
description: c?.[e]?.description ?? "Theme available in the current registry."
|
|
4478
|
-
})), [c, T]), L = i ?? r === "modal", R = /* @__PURE__ */ t.createElement("div", { className: "flex min-w-0 items-center justify-between gap-3" }, /* @__PURE__ */ t.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ t.createElement("h3", { className: "truncate text-lg font-semibold leading-none" }, a), o ? /* @__PURE__ */ t.createElement("div", { className: "mt-1 truncate text-sm text-muted-foreground" }, o) : null), s ? /* @__PURE__ */ t.createElement("div", { className: "flex shrink-0 items-center gap-2" }, s) : null),
|
|
4478
|
+
})), [c, T]), L = i ?? r === "modal", R = /* @__PURE__ */ t.createElement("div", { className: "flex min-w-0 items-center justify-between gap-3" }, /* @__PURE__ */ t.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ t.createElement("h3", { className: "truncate text-lg font-semibold leading-none" }, a), o ? /* @__PURE__ */ t.createElement("div", { className: "mt-1 truncate text-sm text-muted-foreground" }, o) : null), s ? /* @__PURE__ */ t.createElement("div", { className: "flex shrink-0 items-center gap-2" }, s) : null), z = /* @__PURE__ */ t.createElement(t.Fragment, null, l ? /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("label", { className: "mb-3 block text-xs font-semibold uppercase tracking-wider text-muted-foreground" }, "Color mode"), /* @__PURE__ */ t.createElement("div", { className: "flex gap-2" }, ["light", "dark"].map((e) => /* @__PURE__ */ t.createElement("button", {
|
|
4479
4479
|
key: e,
|
|
4480
4480
|
type: "button",
|
|
4481
4481
|
onClick: () => y !== e && E(),
|
|
@@ -4559,7 +4559,7 @@ function fa({ open: e = !0, onClose: n = void 0, surface: r = "flat", showHeader
|
|
|
4559
4559
|
name: e,
|
|
4560
4560
|
size: 16,
|
|
4561
4561
|
className: "text-muted-foreground"
|
|
4562
|
-
})))) : null),
|
|
4562
|
+
})))) : null), B = /* @__PURE__ */ t.createElement("div", { className: X("space-y-6", r === "flat" && "rounded-xl border border-border/60 bg-card p-5", _) }, r === "flat" && L ? /* @__PURE__ */ t.createElement("div", { className: "border-b border-border/60 pb-4" }, R) : null, z);
|
|
4563
4563
|
return r === "modal" ? e ? /* @__PURE__ */ t.createElement(Ai, {
|
|
4564
4564
|
position: "right",
|
|
4565
4565
|
header: L ? R : void 0,
|
|
@@ -4568,7 +4568,7 @@ function fa({ open: e = !0, onClose: n = void 0, surface: r = "flat", showHeader
|
|
|
4568
4568
|
headerClassName: "h-14 !py-0 px-4",
|
|
4569
4569
|
className: _,
|
|
4570
4570
|
wrapperClassName: v
|
|
4571
|
-
}, /* @__PURE__ */ t.createElement("div", { className: "space-y-6" },
|
|
4571
|
+
}, /* @__PURE__ */ t.createElement("div", { className: "space-y-6" }, z)) : null : /* @__PURE__ */ t.createElement("div", { className: v }, B);
|
|
4572
4572
|
}
|
|
4573
4573
|
//#endregion
|
|
4574
4574
|
//#region src/providers/ProviderRegistryContext.tsx
|
|
@@ -4620,7 +4620,7 @@ var Ea = (e) => Ta?.[e], Da = "scrape", Oa = "[DEFAULT]", ka = /* @__PURE__ */ n
|
|
|
4620
4620
|
"appId"
|
|
4621
4621
|
], "firebase.")), Na = (e = Oa) => {
|
|
4622
4622
|
try {
|
|
4623
|
-
return e === Oa ?
|
|
4623
|
+
return e === Oa ? B() : B(P(e));
|
|
4624
4624
|
} catch (e) {
|
|
4625
4625
|
return console.error("FirebaseAuthorization", e instanceof Error ? e.message : "Error: check Configuration"), null;
|
|
4626
4626
|
}
|
|
@@ -4628,7 +4628,7 @@ var Ea = (e) => Ta?.[e], Da = "scrape", Oa = "[DEFAULT]", ka = /* @__PURE__ */ n
|
|
|
4628
4628
|
let t = Na();
|
|
4629
4629
|
if (!t) return !1;
|
|
4630
4630
|
try {
|
|
4631
|
-
return await
|
|
4631
|
+
return await W(t, V), await G(t, e), !0;
|
|
4632
4632
|
} catch (e) {
|
|
4633
4633
|
let n = t.app.options?.apiKey;
|
|
4634
4634
|
return console.error("Firebase custom token sign-in error: ", e, `— app "${t.app.name}" options.apiKey: ${n ? `${n.slice(0, 6)}… (len ${n.length})` : String(n)}`), !1;
|
|
@@ -4803,7 +4803,7 @@ var La = "_key", Ra = (e) => e.replace(/^\/+|\/+$/g, ""), za = (e) => Ra(e).spli
|
|
|
4803
4803
|
})));
|
|
4804
4804
|
} else t(n);
|
|
4805
4805
|
}, (e) => console.error("Firestore onSnapshot error:", e));
|
|
4806
|
-
}, c, l =
|
|
4806
|
+
}, c, l = U(o, (e) => {
|
|
4807
4807
|
c?.(), c = void 0, e ? c = s() : t([]);
|
|
4808
4808
|
});
|
|
4809
4809
|
return () => {
|
|
@@ -5242,7 +5242,7 @@ function go(e, t) {
|
|
|
5242
5242
|
}
|
|
5243
5243
|
//#endregion
|
|
5244
5244
|
//#region src/providers/storage/firebase.ts
|
|
5245
|
-
var _o = (e) => e ?
|
|
5245
|
+
var _o = (e) => e ? Ce(P(), e) : Ce(), vo = (e) => ({
|
|
5246
5246
|
name: e.name,
|
|
5247
5247
|
path: e.fullPath
|
|
5248
5248
|
}), yo = async (e) => {
|
|
@@ -5275,9 +5275,9 @@ var _o = (e) => e ? J(P(), e) : J(), vo = (e) => ({
|
|
|
5275
5275
|
}
|
|
5276
5276
|
upload = async (e, t, n = {}) => {
|
|
5277
5277
|
if (e) try {
|
|
5278
|
-
let r =
|
|
5279
|
-
return typeof e == "string" ? await xe((await
|
|
5280
|
-
let a = n.contentType ? { contentType: n.contentType } : e instanceof File && e.type ? { contentType: e.type } : void 0, o =
|
|
5278
|
+
let r = Te(_o(this.resolveBucket(n.bucket)), t);
|
|
5279
|
+
return typeof e == "string" ? await xe((await De(r, e, "data_url")).ref) : await new Promise((t, i) => {
|
|
5280
|
+
let a = n.contentType ? { contentType: n.contentType } : e instanceof File && e.type ? { contentType: e.type } : void 0, o = Ee(r, e, a);
|
|
5281
5281
|
n.onProgress && o.on("state_changed", (e) => {
|
|
5282
5282
|
let t = e.totalBytes > 0 ? Math.round(e.bytesTransferred / e.totalBytes * 100) : 0;
|
|
5283
5283
|
n.onProgress(t);
|
|
@@ -5288,13 +5288,13 @@ var _o = (e) => e ? J(P(), e) : J(), vo = (e) => ({
|
|
|
5288
5288
|
}
|
|
5289
5289
|
};
|
|
5290
5290
|
createUpload = (e, t, n = {}) => {
|
|
5291
|
-
let r =
|
|
5291
|
+
let r = Te(_o(this.resolveBucket(n.bucket)), t);
|
|
5292
5292
|
if (typeof e == "string") {
|
|
5293
5293
|
let t = !1;
|
|
5294
5294
|
return {
|
|
5295
5295
|
url: (async () => {
|
|
5296
5296
|
if (!t) try {
|
|
5297
|
-
return await xe((await
|
|
5297
|
+
return await xe((await De(r, e, "data_url")).ref);
|
|
5298
5298
|
} catch {
|
|
5299
5299
|
return;
|
|
5300
5300
|
}
|
|
@@ -5306,7 +5306,7 @@ var _o = (e) => e ? J(P(), e) : J(), vo = (e) => ({
|
|
|
5306
5306
|
}
|
|
5307
5307
|
};
|
|
5308
5308
|
}
|
|
5309
|
-
let i =
|
|
5309
|
+
let i = Ee(r, e, n.contentType ? { contentType: n.contentType } : e instanceof File && e.type ? { contentType: e.type } : void 0);
|
|
5310
5310
|
return n.onProgress && i.on("state_changed", (e) => {
|
|
5311
5311
|
let t = e.totalBytes > 0 ? Math.round(e.bytesTransferred / e.totalBytes * 100) : 0;
|
|
5312
5312
|
n.onProgress(t);
|
|
@@ -5358,14 +5358,14 @@ var _o = (e) => e ? J(P(), e) : J(), vo = (e) => ({
|
|
|
5358
5358
|
};
|
|
5359
5359
|
getURL = async (e, t = {}) => {
|
|
5360
5360
|
try {
|
|
5361
|
-
return await xe(
|
|
5361
|
+
return await xe(Te(_o(this.resolveBucket(t.bucket)), e));
|
|
5362
5362
|
} catch (t) {
|
|
5363
5363
|
console.error(`[FirebaseStorage] getURL error for ${e}:`, t);
|
|
5364
5364
|
}
|
|
5365
5365
|
};
|
|
5366
5366
|
getFileInfo = async (e, t = {}) => {
|
|
5367
5367
|
try {
|
|
5368
|
-
let n =
|
|
5368
|
+
let n = Te(_o(this.resolveBucket(t.bucket)), e), r = await Se(n);
|
|
5369
5369
|
return {
|
|
5370
5370
|
name: n.name,
|
|
5371
5371
|
path: n.fullPath,
|
|
@@ -5392,14 +5392,14 @@ var _o = (e) => e ? J(P(), e) : J(), vo = (e) => ({
|
|
|
5392
5392
|
delete = async (e, t = {}) => {
|
|
5393
5393
|
if (t.recursive) return this._deleteFolder(e, t);
|
|
5394
5394
|
try {
|
|
5395
|
-
return await be(
|
|
5395
|
+
return await be(Te(_o(this.resolveBucket(t.bucket)), e)), 1;
|
|
5396
5396
|
} catch (t) {
|
|
5397
5397
|
return t.code === "storage/object-not-found" || console.error(`[FirebaseStorage] delete error for ${e}:`, t), 0;
|
|
5398
5398
|
}
|
|
5399
5399
|
};
|
|
5400
5400
|
_deleteFolder = async (e, t) => {
|
|
5401
5401
|
try {
|
|
5402
|
-
let { items: n, prefixes: r } = await
|
|
5402
|
+
let { items: n, prefixes: r } = await we(Te(_o(this.resolveBucket(t.bucket)), e)), i = 0;
|
|
5403
5403
|
await Promise.all(n.map(async (e) => {
|
|
5404
5404
|
try {
|
|
5405
5405
|
await be(e), i++;
|
|
@@ -5417,7 +5417,7 @@ var _o = (e) => e ? J(P(), e) : J(), vo = (e) => ({
|
|
|
5417
5417
|
_listLevel = async (e, t) => {
|
|
5418
5418
|
let n = t.includeFiles !== !1, r = t.includeFolders === !0;
|
|
5419
5419
|
try {
|
|
5420
|
-
let { items: i, prefixes: a } = await
|
|
5420
|
+
let { items: i, prefixes: a } = await we(Te(_o(this.resolveBucket(t.bucket)), e)), o = n ? t.metadata ? await Promise.all(i.map(yo)) : i.map(vo) : [], s = r ? a.map((e) => ({
|
|
5421
5421
|
name: e.name,
|
|
5422
5422
|
path: e.fullPath,
|
|
5423
5423
|
isFolder: !0
|
|
@@ -5708,8 +5708,8 @@ function Ao(e, n) {
|
|
|
5708
5708
|
}) : e : null;
|
|
5709
5709
|
}
|
|
5710
5710
|
function jo({ items: e, itemsLoading: n = !1, activeId: r = null, onSelect: i = void 0, onError: a = void 0, onResponse: o = void 0, endpoint: s, authorization: c = void 0, requestBody: u = void 0, method: d = "POST", icon: f = "layers", caption: p = void 0, listLabel: g = void 0, placeholder: _ = void 0, disabled: v = !1, open: y = void 0, onOpenChange: b = void 0, footer: x = void 0, before: S = void 0, after: C = void 0, wrapperClassName: w = void 0, className: T = void 0, triggerClassName: E = void 0, listClassName: D = void 0, itemClassName: O = void 0 }) {
|
|
5711
|
-
let k = Y("providerSwitcher"), A = Nn("select"), { switchSession: j } = ko(), M = ei(), [N, P] = h(!1), [F, I] = h(null), L = e.find((e) => e.id === r) ?? null, R = y ?? N,
|
|
5712
|
-
if (
|
|
5711
|
+
let k = Y("providerSwitcher"), A = Nn("select"), { switchSession: j } = ko(), M = ei(), [N, P] = h(!1), [F, I] = h(null), L = e.find((e) => e.id === r) ?? null, R = y ?? N, z = b ?? P, B = F !== null || n, V = m(null), H = async () => c ? typeof c == "function" ? c() : c : M.getAccessToken?.(), U = async (e) => {
|
|
5712
|
+
if (V.current !== e.id) {
|
|
5713
5713
|
I(e.id);
|
|
5714
5714
|
try {
|
|
5715
5715
|
if (typeof s == "function") await j(() => s(e.id), {
|
|
@@ -5717,7 +5717,7 @@ function jo({ items: e, itemsLoading: n = !1, activeId: r = null, onSelect: i =
|
|
|
5717
5717
|
sessionKey: e.id
|
|
5718
5718
|
});
|
|
5719
5719
|
else {
|
|
5720
|
-
let t = await
|
|
5720
|
+
let t = await H();
|
|
5721
5721
|
await j(s, {
|
|
5722
5722
|
onResponse: o,
|
|
5723
5723
|
sessionKey: e.id,
|
|
@@ -5731,36 +5731,36 @@ function jo({ items: e, itemsLoading: n = !1, activeId: r = null, onSelect: i =
|
|
|
5731
5731
|
}
|
|
5732
5732
|
});
|
|
5733
5733
|
}
|
|
5734
|
-
|
|
5734
|
+
V.current = e.id, i?.(e.id);
|
|
5735
5735
|
} catch (t) {
|
|
5736
5736
|
a?.(e.id, t);
|
|
5737
5737
|
} finally {
|
|
5738
5738
|
I(null);
|
|
5739
5739
|
}
|
|
5740
5740
|
}
|
|
5741
|
-
},
|
|
5742
|
-
|
|
5741
|
+
}, W = (e) => {
|
|
5742
|
+
z(!1), U(e);
|
|
5743
5743
|
};
|
|
5744
5744
|
return l(() => {
|
|
5745
|
-
if (!r || r ===
|
|
5745
|
+
if (!r || r === V.current) return;
|
|
5746
5746
|
let t = e.find((e) => e.id === r);
|
|
5747
|
-
t &&
|
|
5747
|
+
t && U(t);
|
|
5748
5748
|
}, [r]), /* @__PURE__ */ t.createElement(t.Fragment, null, S, /* @__PURE__ */ t.createElement(Ii, {
|
|
5749
5749
|
open: R,
|
|
5750
|
-
onOpenChange:
|
|
5750
|
+
onOpenChange: z,
|
|
5751
5751
|
placement: "auto",
|
|
5752
5752
|
wrapperClassName: X(k.ProviderSwitcher.wrapperClassName, w),
|
|
5753
5753
|
className: X(k.ProviderSwitcher.className, T),
|
|
5754
|
-
triggerClassName: X(k.ProviderSwitcher.triggerClassName, (v ||
|
|
5754
|
+
triggerClassName: X(k.ProviderSwitcher.triggerClassName, (v || B) && k.ProviderSwitcher.disabledClassName, E),
|
|
5755
5755
|
footer: x,
|
|
5756
5756
|
trigger: /* @__PURE__ */ t.createElement("span", { className: "flex w-full min-w-0 items-center gap-2.5" }, /* @__PURE__ */ t.createElement("span", { className: X(k.ProviderSwitcher.iconWrapperClassName) }, Ao(L?.icon ?? f)), /* @__PURE__ */ t.createElement("span", { className: "min-w-0 flex-1 pr-2" }, /* @__PURE__ */ t.createElement("span", { className: X(k.ProviderSwitcher.labelClassName) }, L?.label ?? (n ? A.loading : _ ?? A.placeholder)), p ? /* @__PURE__ */ t.createElement("span", { className: X(k.ProviderSwitcher.captionClassName) }, p) : null), /* @__PURE__ */ t.createElement(Q, {
|
|
5757
|
-
name:
|
|
5757
|
+
name: B ? "loader-2" : "chevrons-up-down",
|
|
5758
5758
|
size: 12,
|
|
5759
|
-
className: X(k.ProviderSwitcher.chevronClassName,
|
|
5759
|
+
className: X(k.ProviderSwitcher.chevronClassName, B && "animate-spin")
|
|
5760
5760
|
}))
|
|
5761
5761
|
}, g ?? p ? /* @__PURE__ */ t.createElement(Bi, null, g ?? p) : null, e.map((e) => /* @__PURE__ */ t.createElement(zi, {
|
|
5762
5762
|
key: e.id,
|
|
5763
|
-
onClick: v ||
|
|
5763
|
+
onClick: v || B ? void 0 : () => W(e),
|
|
5764
5764
|
className: X(k.ProviderSwitcher.itemClassName, e.id === r ? k.ProviderSwitcher.itemActiveClassName : k.ProviderSwitcher.itemInactiveClassName, O, D)
|
|
5765
5765
|
}, /* @__PURE__ */ t.createElement("span", { className: "flex w-full min-w-0 items-center gap-2" }, /* @__PURE__ */ t.createElement("span", { className: X("w-3.5 shrink-0", k.ProviderSwitcher.checkClassName) }, e.id === r ? /* @__PURE__ */ t.createElement(Q, {
|
|
5766
5766
|
name: "check",
|
|
@@ -6604,20 +6604,20 @@ var Hs = (e, t, n) => {
|
|
|
6604
6604
|
b?.where,
|
|
6605
6605
|
b?.order,
|
|
6606
6606
|
b?.onLoad
|
|
6607
|
-
]), L = Ci(), [R,
|
|
6608
|
-
l(() => L.subscribe(b?.path, (e) =>
|
|
6607
|
+
]), L = Ci(), [R, z] = h([]);
|
|
6608
|
+
l(() => L.subscribe(b?.path, (e) => z(Bs(e)), I), [
|
|
6609
6609
|
L,
|
|
6610
6610
|
b?.path,
|
|
6611
6611
|
I
|
|
6612
6612
|
]);
|
|
6613
|
-
let [
|
|
6613
|
+
let [B, V] = h([]), H = p(() => xt(Us([...y, ...B], R, x, b?.order, I.fieldMap), "value"), [
|
|
6614
6614
|
y,
|
|
6615
|
-
|
|
6615
|
+
B,
|
|
6616
6616
|
R,
|
|
6617
6617
|
x,
|
|
6618
6618
|
b?.order,
|
|
6619
6619
|
I.fieldMap
|
|
6620
|
-
]),
|
|
6620
|
+
]), U = (t, n) => {
|
|
6621
6621
|
if (t) {
|
|
6622
6622
|
if (P.includes(t) || i && P.length >= i) {
|
|
6623
6623
|
n.value = "";
|
|
@@ -6633,24 +6633,24 @@ var Hs = (e, t, n) => {
|
|
|
6633
6633
|
}, 0), r;
|
|
6634
6634
|
}), n.value = "";
|
|
6635
6635
|
}
|
|
6636
|
-
},
|
|
6636
|
+
}, W = (e) => {
|
|
6637
6637
|
let t = e.target.value;
|
|
6638
|
-
|
|
6639
|
-
},
|
|
6638
|
+
H.some((e) => e.value === t) && U(t, e.target);
|
|
6639
|
+
}, ee = (e) => {
|
|
6640
6640
|
if (e.key !== "Enter") return;
|
|
6641
6641
|
e.preventDefault();
|
|
6642
6642
|
let t = e.target.value.trim();
|
|
6643
6643
|
if (t) {
|
|
6644
|
-
if (!
|
|
6644
|
+
if (!H.some((e) => e.value === t)) {
|
|
6645
6645
|
if (!E) return;
|
|
6646
|
-
|
|
6646
|
+
V((e) => [...e, {
|
|
6647
6647
|
label: t,
|
|
6648
6648
|
value: t
|
|
6649
6649
|
}]), D?.(t);
|
|
6650
6650
|
}
|
|
6651
|
-
|
|
6651
|
+
U(t, e.target);
|
|
6652
6652
|
}
|
|
6653
|
-
},
|
|
6653
|
+
}, te = (t) => {
|
|
6654
6654
|
F((n) => {
|
|
6655
6655
|
let r = n.filter((e) => e !== t);
|
|
6656
6656
|
return setTimeout(() => {
|
|
@@ -6660,32 +6660,32 @@ var Hs = (e, t, n) => {
|
|
|
6660
6660
|
} });
|
|
6661
6661
|
}, 0), r;
|
|
6662
6662
|
});
|
|
6663
|
-
},
|
|
6663
|
+
}, G = u(), ne = `${G}-options`;
|
|
6664
6664
|
return /* @__PURE__ */ t.createElement(Z, { className: A || M.Autocomplete.wrapperClassName }, d && /* @__PURE__ */ t.createElement(js, {
|
|
6665
6665
|
label: d,
|
|
6666
6666
|
required: o,
|
|
6667
|
-
htmlFor:
|
|
6667
|
+
htmlFor: G
|
|
6668
6668
|
}), /* @__PURE__ */ t.createElement(Z, { className: g || _ ? X(is, "flex-nowrap") : "" }, g && /* @__PURE__ */ t.createElement(Ws, { side: "before" }, g), /* @__PURE__ */ t.createElement("div", { className: X(ns, "h-auto min-h-9 flex-wrap items-center gap-1 py-1.5 px-2", g && "rounded-l-none", _ && "rounded-r-none") }, P.map((e) => /* @__PURE__ */ t.createElement("span", {
|
|
6669
6669
|
className: "inline-flex items-center gap-1 rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
6670
6670
|
key: e
|
|
6671
6671
|
}, e, /* @__PURE__ */ t.createElement("button", {
|
|
6672
6672
|
type: "button",
|
|
6673
6673
|
className: "ml-0.5 opacity-60 transition-opacity hover:opacity-100",
|
|
6674
|
-
onClick: () =>
|
|
6674
|
+
onClick: () => te(e)
|
|
6675
6675
|
}, "×"))), (!i || P.length < i) && /* @__PURE__ */ t.createElement("input", {
|
|
6676
|
-
id:
|
|
6676
|
+
id: G,
|
|
6677
6677
|
type: "text",
|
|
6678
6678
|
className: X("min-w-[120px] flex-1 border-none bg-transparent text-sm outline-none placeholder:text-muted-foreground", w || M.Autocomplete.className),
|
|
6679
6679
|
required: o && P.length < (r || 0),
|
|
6680
6680
|
disabled: c || s && !St(O),
|
|
6681
6681
|
placeholder: E ? m ?? "Type or press Enter to create..." : m,
|
|
6682
6682
|
title: f,
|
|
6683
|
-
list:
|
|
6684
|
-
onChange:
|
|
6685
|
-
onKeyDown:
|
|
6686
|
-
})), /* @__PURE__ */ t.createElement("datalist", { id:
|
|
6683
|
+
list: ne,
|
|
6684
|
+
onChange: W,
|
|
6685
|
+
onKeyDown: ee
|
|
6686
|
+
})), /* @__PURE__ */ t.createElement("datalist", { id: ne }, H.map((e, n) => /* @__PURE__ */ t.createElement("option", {
|
|
6687
6687
|
value: e.value,
|
|
6688
|
-
key: `${
|
|
6688
|
+
key: `${G}-${n}`
|
|
6689
6689
|
}, e.label))), _ && /* @__PURE__ */ t.createElement(Ws, { side: "after" }, _)), j ? /* @__PURE__ */ t.createElement(ps, { message: j }) : v && /* @__PURE__ */ t.createElement("div", { className: "mt-1 text-xs text-muted-foreground" }, v));
|
|
6690
6690
|
}, qs = ({ name: e, defaultValue: n = void 0, onChange: r = void 0, required: i = !1, readOnlyAfterSet: a = !1, disabled: o = !1, label: s = void 0, title: c = void 0, before: d = void 0, after: f = void 0, feedback: m = void 0, options: g = [], optionsSource: _ = void 0, order: v = void 0, inheritWrapperClassName: y = !0, wrapperClassName: b = void 0, className: x = void 0, validator: S = void 0, itemClassName: C = void 0 }) => {
|
|
6691
6691
|
let { value: w, handleChange: T, formWrapClass: E } = rd({
|
|
@@ -6744,7 +6744,7 @@ var Hs = (e, t, n) => {
|
|
|
6744
6744
|
} });
|
|
6745
6745
|
}, 0), r;
|
|
6746
6746
|
}));
|
|
6747
|
-
}, R = u(),
|
|
6747
|
+
}, R = u(), z = o || a && k.length > 0, B = /* @__PURE__ */ t.createElement(Z, { className: X(d || f ? X(ns, "h-auto min-h-9 w-full min-w-0 flex-col items-start py-2 px-3") : "", "space-y-1") }, F.map((n) => {
|
|
6748
6748
|
let r = Dt(`cl-${R}-${e}-${n.value}`);
|
|
6749
6749
|
return /* @__PURE__ */ t.createElement("div", {
|
|
6750
6750
|
key: r,
|
|
@@ -6757,7 +6757,7 @@ var Hs = (e, t, n) => {
|
|
|
6757
6757
|
value: n.value,
|
|
6758
6758
|
onChange: L,
|
|
6759
6759
|
checked: k.includes(n.value),
|
|
6760
|
-
disabled:
|
|
6760
|
+
disabled: z,
|
|
6761
6761
|
title: c
|
|
6762
6762
|
}), /* @__PURE__ */ t.createElement("label", {
|
|
6763
6763
|
htmlFor: r,
|
|
@@ -6767,7 +6767,7 @@ var Hs = (e, t, n) => {
|
|
|
6767
6767
|
return /* @__PURE__ */ t.createElement(Z, { className: X(E, x) }, s && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(js, {
|
|
6768
6768
|
label: s,
|
|
6769
6769
|
required: i
|
|
6770
|
-
}), /* @__PURE__ */ t.createElement("hr", { className: "mt-0" })), d || f ? /* @__PURE__ */ t.createElement(Z, { className: X(is, "flex-nowrap items-stretch") }, d && /* @__PURE__ */ t.createElement(Ws, { side: "before" }, d),
|
|
6770
|
+
}), /* @__PURE__ */ t.createElement("hr", { className: "mt-0" })), d || f ? /* @__PURE__ */ t.createElement(Z, { className: X(is, "flex-nowrap items-stretch") }, d && /* @__PURE__ */ t.createElement(Ws, { side: "before" }, d), B, f && /* @__PURE__ */ t.createElement(Ws, { side: "after" }, f)) : B, D ? /* @__PURE__ */ t.createElement(ps, { message: D }) : m && /* @__PURE__ */ t.createElement("div", { className: "mt-1 text-xs text-muted-foreground" }, m));
|
|
6771
6771
|
};
|
|
6772
6772
|
//#endregion
|
|
6773
6773
|
//#region src/libs/imageBuilder.ts
|
|
@@ -7235,13 +7235,13 @@ var ac = a(null), oc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7235
7235
|
srcset: "",
|
|
7236
7236
|
sizes: ""
|
|
7237
7237
|
}), P(!1);
|
|
7238
|
-
},
|
|
7238
|
+
}, z = !!w;
|
|
7239
7239
|
return /* @__PURE__ */ t.createElement(Z, { className: C }, y, i && /* @__PURE__ */ t.createElement(js, {
|
|
7240
7240
|
label: i,
|
|
7241
7241
|
required: a,
|
|
7242
7242
|
htmlFor: f ?? e,
|
|
7243
7243
|
className: p
|
|
7244
|
-
}), /* @__PURE__ */ t.createElement("div", { className: X("rounded-lg border border-input bg-background shadow-sm transition-colors", "focus-within:ring-1 focus-within:ring-ring",
|
|
7244
|
+
}), /* @__PURE__ */ t.createElement("div", { className: X("rounded-lg border border-input bg-background shadow-sm transition-colors", "focus-within:ring-1 focus-within:ring-ring", z && "border-destructive focus-within:ring-destructive/20", o && "cursor-not-allowed opacity-50", v) }, /* @__PURE__ */ t.createElement("div", { className: X("group relative flex min-h-[120px] items-center justify-center overflow-hidden rounded-t-lg transition-colors", "[background-image:repeating-conic-gradient(#e4e4e4_0%_25%,#f5f5f5_0%_50%)]", "dark:[background-image:repeating-conic-gradient(#2a2a2a_0%_25%,#343434_0%_50%)]", "[background-size:16px_16px]") }, E ? /* @__PURE__ */ t.createElement("img", {
|
|
7245
7245
|
src: E,
|
|
7246
7246
|
srcSet: O || void 0,
|
|
7247
7247
|
sizes: k || void 0,
|
|
@@ -7291,7 +7291,7 @@ var ac = a(null), oc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7291
7291
|
disabled: o,
|
|
7292
7292
|
onChange: (e) => I({ alt: e.target.value }),
|
|
7293
7293
|
placeholder: "E.g. Product hero shot",
|
|
7294
|
-
className: X("h-8 rounded-md border border-input bg-background px-2.5 text-sm outline-none focus:ring-1 focus:ring-ring disabled:opacity-50",
|
|
7294
|
+
className: X("h-8 rounded-md border border-input bg-background px-2.5 text-sm outline-none focus:ring-1 focus:ring-ring disabled:opacity-50", z && "border-destructive")
|
|
7295
7295
|
})), O && /* @__PURE__ */ t.createElement(uc, { srcset: O }))), w && /* @__PURE__ */ t.createElement(ps, { message: w }), !w && c && /* @__PURE__ */ t.createElement("p", { className: "mt-1 text-xs text-muted-foreground" }, c), b, N && E && /* @__PURE__ */ t.createElement(lc, {
|
|
7296
7296
|
src: E,
|
|
7297
7297
|
mode: "modal",
|
|
@@ -7457,14 +7457,14 @@ var ac = a(null), oc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7457
7457
|
let t = n.filter((e) => e in a);
|
|
7458
7458
|
y(t[0] ?? Object.keys(a).find((t) => t !== e) ?? Object.keys(a)[0]);
|
|
7459
7459
|
}
|
|
7460
|
-
},
|
|
7460
|
+
}, z = (e) => {
|
|
7461
7461
|
e.preventDefault(), e.stopPropagation();
|
|
7462
7462
|
let t = A.current[v];
|
|
7463
7463
|
t && (F.current = {
|
|
7464
7464
|
offsetX: e.clientX - t.left,
|
|
7465
7465
|
offsetY: e.clientY - t.top
|
|
7466
7466
|
}, k(!0));
|
|
7467
|
-
},
|
|
7467
|
+
}, B = (e, t) => {
|
|
7468
7468
|
e.preventDefault(), e.stopPropagation();
|
|
7469
7469
|
let n = A.current[v];
|
|
7470
7470
|
n && (I.current = {
|
|
@@ -7476,7 +7476,7 @@ var ac = a(null), oc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7476
7476
|
sw: n.width,
|
|
7477
7477
|
sh: n.height
|
|
7478
7478
|
}, k(!0));
|
|
7479
|
-
},
|
|
7479
|
+
}, V = g.includes(v), H = S[v];
|
|
7480
7480
|
return /* @__PURE__ */ t.createElement("div", { className: ["flex gap-4 h-full min-h-0", n ? "flex-col" : ""].join(" ") }, n && /* @__PURE__ */ t.createElement("h3", { className: "text-base font-semibold shrink-0" }, n), /* @__PURE__ */ t.createElement("div", { className: "flex gap-4 flex-1 min-h-0" }, /* @__PURE__ */ t.createElement("div", {
|
|
7481
7481
|
className: "flex-1 min-w-0 min-h-0 flex items-center justify-center rounded-xl overflow-hidden",
|
|
7482
7482
|
style: {
|
|
@@ -7491,7 +7491,7 @@ var ac = a(null), oc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7491
7491
|
backgroundSize: "20px 20px",
|
|
7492
7492
|
backgroundPosition: "0 0,0 10px,10px -10px,-10px 0"
|
|
7493
7493
|
}
|
|
7494
|
-
},
|
|
7494
|
+
}, V ? /* @__PURE__ */ t.createElement("div", {
|
|
7495
7495
|
className: "relative select-none",
|
|
7496
7496
|
style: {
|
|
7497
7497
|
display: "inline-block",
|
|
@@ -7508,10 +7508,10 @@ var ac = a(null), oc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7508
7508
|
},
|
|
7509
7509
|
draggable: !1,
|
|
7510
7510
|
onLoad: () => D(!0)
|
|
7511
|
-
}),
|
|
7512
|
-
crop:
|
|
7513
|
-
onMoveStart:
|
|
7514
|
-
onResizeStart:
|
|
7511
|
+
}), H && w && /* @__PURE__ */ t.createElement(Sc, {
|
|
7512
|
+
crop: H,
|
|
7513
|
+
onMoveStart: z,
|
|
7514
|
+
onResizeStart: B
|
|
7515
7515
|
})) : /* @__PURE__ */ t.createElement("div", { className: "flex flex-col items-center gap-3 text-zinc-500 select-none" }, /* @__PURE__ */ t.createElement("svg", {
|
|
7516
7516
|
className: "w-10 h-10 opacity-30",
|
|
7517
7517
|
fill: "none",
|
|
@@ -7537,10 +7537,10 @@ var ac = a(null), oc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7537
7537
|
active: n === v,
|
|
7538
7538
|
onClick: () => L(n),
|
|
7539
7539
|
onRemove: (e) => R(n, e)
|
|
7540
|
-
}))),
|
|
7540
|
+
}))), V && H && /* @__PURE__ */ t.createElement("div", { className: "shrink-0 pt-3 border-t border-border" }, /* @__PURE__ */ t.createElement("p", { className: "text-xs font-medium text-muted-foreground mb-1" }, o.outputFile), /* @__PURE__ */ t.createElement("p", {
|
|
7541
7541
|
className: "text-xs text-foreground/70 truncate tabular-nums",
|
|
7542
|
-
title:
|
|
7543
|
-
},
|
|
7542
|
+
title: H.fileName
|
|
7543
|
+
}, H.fileName ?? mc(b, v))))), /* @__PURE__ */ t.createElement("canvas", {
|
|
7544
7544
|
ref: s,
|
|
7545
7545
|
className: "hidden"
|
|
7546
7546
|
}));
|
|
@@ -7983,12 +7983,12 @@ var vc = 120, yc = 88, bc = (e) => {
|
|
|
7983
7983
|
let { files: S, setFiles: C, currentFile: w, fileInputRef: T, formWrapClass: E, handleUploadChange: D, handleUpload: O, handleRemove: k, handleSave: A, handleEdit: j, handleClose: M } = Ec(e, n, b, f, p, m, g), N = nd(e, {
|
|
7984
7984
|
required: c,
|
|
7985
7985
|
label: r
|
|
7986
|
-
}), P = Nn("upload"), [F, I] = h(null), [L, R] = h(/* @__PURE__ */ new Set()), [
|
|
7987
|
-
let e =
|
|
7986
|
+
}), P = Nn("upload"), [F, I] = h(null), [L, R] = h(/* @__PURE__ */ new Set()), [z, B] = h(!1), [V, H] = h(""), [U, W] = h(void 0), ee = async () => {
|
|
7987
|
+
let e = V.trim();
|
|
7988
7988
|
try {
|
|
7989
7989
|
new URL(e);
|
|
7990
7990
|
} catch {
|
|
7991
|
-
return
|
|
7991
|
+
return W(P.invalidUrl), !1;
|
|
7992
7992
|
}
|
|
7993
7993
|
let t = {
|
|
7994
7994
|
key: e,
|
|
@@ -8000,16 +8000,16 @@ var vc = 120, yc = 88, bc = (e) => {
|
|
|
8000
8000
|
base64: "",
|
|
8001
8001
|
variants: {}
|
|
8002
8002
|
};
|
|
8003
|
-
return C((e) => o ? [...e, t] : [t]),
|
|
8004
|
-
},
|
|
8005
|
-
|
|
8006
|
-
},
|
|
8003
|
+
return C((e) => o ? [...e, t] : [t]), H(""), W(void 0), B(!1), !0;
|
|
8004
|
+
}, te = () => {
|
|
8005
|
+
B(!1), H(""), W(void 0);
|
|
8006
|
+
}, G = (e, t) => {
|
|
8007
8007
|
let n = e.currentTarget, r = n.naturalWidth > 0 && n.naturalHeight > 0 && (n.naturalWidth < d || n.naturalHeight < u);
|
|
8008
8008
|
R((e) => {
|
|
8009
8009
|
let n = new Set(e);
|
|
8010
8010
|
return r ? n.add(t) : n.delete(t), n;
|
|
8011
8011
|
});
|
|
8012
|
-
},
|
|
8012
|
+
}, ne = ({ scales: e }) => {
|
|
8013
8013
|
if (!e) return;
|
|
8014
8014
|
let n = Object.keys(e);
|
|
8015
8015
|
return n.length === 0 ? null : n.map((n) => /* @__PURE__ */ t.createElement(Xn, { key: n }, /* @__PURE__ */ t.createElement("a", {
|
|
@@ -8051,7 +8051,7 @@ var vc = 120, yc = 88, bc = (e) => {
|
|
|
8051
8051
|
src: jc(e),
|
|
8052
8052
|
alt: `preview-${n}`,
|
|
8053
8053
|
className: `absolute inset-0 w-full h-full ${L.has(e.key) ? "object-contain p-1" : "object-cover"}`,
|
|
8054
|
-
onLoad: (t) =>
|
|
8054
|
+
onLoad: (t) => G(t, e.key)
|
|
8055
8055
|
}), /* @__PURE__ */ t.createElement("div", {
|
|
8056
8056
|
className: "absolute inset-0 bg-black/55 backdrop-blur-[1px] flex flex-col items-center justify-end pb-2 gap-1 transition-opacity",
|
|
8057
8057
|
style: { display: F === n ? "flex" : "none" }
|
|
@@ -8079,7 +8079,7 @@ var vc = 120, yc = 88, bc = (e) => {
|
|
|
8079
8079
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
8080
8080
|
name: "x",
|
|
8081
8081
|
className: "w-4 h-4"
|
|
8082
|
-
}))), a && e.variants && Object.keys(e.variants).length > 0 && /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap gap-1 px-1" }, /* @__PURE__ */ t.createElement(
|
|
8082
|
+
}))), a && e.variants && Object.keys(e.variants).length > 0 && /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap gap-1 px-1" }, /* @__PURE__ */ t.createElement(ne, { scales: e.variants })))) : /* @__PURE__ */ t.createElement(Zo, {
|
|
8083
8083
|
max: 100,
|
|
8084
8084
|
min: 0,
|
|
8085
8085
|
value: e.progress,
|
|
@@ -8103,7 +8103,7 @@ var vc = 120, yc = 88, bc = (e) => {
|
|
|
8103
8103
|
feedback: i
|
|
8104
8104
|
}), _ && /* @__PURE__ */ t.createElement("button", {
|
|
8105
8105
|
type: "button",
|
|
8106
|
-
onClick: () =>
|
|
8106
|
+
onClick: () => B(!0),
|
|
8107
8107
|
title: P.insertFromUrl,
|
|
8108
8108
|
"aria-label": P.insertFromUrl,
|
|
8109
8109
|
className: "absolute -right-2 -top-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full border border-border bg-card text-muted-foreground shadow-sm transition-colors hover:text-primary"
|
|
@@ -8116,21 +8116,21 @@ var vc = 120, yc = 88, bc = (e) => {
|
|
|
8116
8116
|
type: "img",
|
|
8117
8117
|
onSave: A,
|
|
8118
8118
|
onClose: M
|
|
8119
|
-
}), _ &&
|
|
8119
|
+
}), _ && z && /* @__PURE__ */ t.createElement(Ai, {
|
|
8120
8120
|
title: P.insertFromUrl,
|
|
8121
|
-
onSave:
|
|
8122
|
-
onClose:
|
|
8121
|
+
onSave: ee,
|
|
8122
|
+
onClose: te,
|
|
8123
8123
|
size: "sm"
|
|
8124
8124
|
}, /* @__PURE__ */ t.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ t.createElement("input", {
|
|
8125
8125
|
type: "url",
|
|
8126
8126
|
autoFocus: !0,
|
|
8127
|
-
value:
|
|
8127
|
+
value: V,
|
|
8128
8128
|
onChange: (e) => {
|
|
8129
|
-
|
|
8129
|
+
H(e.target.value), W(void 0);
|
|
8130
8130
|
},
|
|
8131
8131
|
placeholder: P.urlPlaceholder,
|
|
8132
8132
|
className: "h-9 w-full rounded-md border border-input bg-background px-2.5 text-sm focus:outline-none focus:ring-1 focus:ring-ring"
|
|
8133
|
-
}),
|
|
8133
|
+
}), U && /* @__PURE__ */ t.createElement(ps, { message: U }))), y);
|
|
8134
8134
|
}, Pc = {
|
|
8135
8135
|
US: "United States",
|
|
8136
8136
|
CN: "中国",
|
|
@@ -8819,9 +8819,9 @@ function Hl(e) {
|
|
|
8819
8819
|
return e ? (e.includes("/") ? e.split("/").pop() : e) || e : null;
|
|
8820
8820
|
}
|
|
8821
8821
|
function Ul({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, onStop: o, disabled: c = !1, onSubmit: d, attachments: f = !1, commands: p, commandsTrigger: g, models: _ = [], selectedModel: v, onModelChange: y, showSettings: b = !1, defaultRole: x = "", defaultVoice: S = "", defaultStyle: C = "", defaultLanguage: w = "", defaultTemperature: T, actions: E, minHeight: D = 96, maxHeight: O = 220, wrapperClassName: k, className: A }) {
|
|
8822
|
-
let j = Y("prompt"), M = Nn("prompt"), N = m(null), P = m(null), F = u(), [I, L] = h([]), [R,
|
|
8822
|
+
let j = Y("prompt"), M = Nn("prompt"), N = m(null), P = m(null), F = u(), [I, L] = h([]), [R, z] = h(!1), B = m(0), [V, H] = h(!1), [U, W] = h(x), [ee, te] = h(S), [G, ne] = h(C), [re, K] = h(w), [ie, ae] = h(T);
|
|
8823
8823
|
l(() => {
|
|
8824
|
-
a ||
|
|
8824
|
+
a || H(!1);
|
|
8825
8825
|
}, [a]), l(() => () => {
|
|
8826
8826
|
I.forEach(({ objectUrl: e }) => URL.revokeObjectURL(e));
|
|
8827
8827
|
}, [I]);
|
|
@@ -8834,13 +8834,13 @@ function Ul({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
8834
8834
|
}));
|
|
8835
8835
|
L((e) => [...e, ...t]);
|
|
8836
8836
|
}, []), ce = s((e) => {
|
|
8837
|
-
!f || !e.dataTransfer.types.includes("Files") || (e.preventDefault(),
|
|
8837
|
+
!f || !e.dataTransfer.types.includes("Files") || (e.preventDefault(), B.current += 1, z(!0));
|
|
8838
8838
|
}, [f]), le = s((e) => {
|
|
8839
8839
|
!f || !e.dataTransfer.types.includes("Files") || e.preventDefault();
|
|
8840
8840
|
}, [f]), ue = s((e) => {
|
|
8841
|
-
f && (e.preventDefault(),
|
|
8841
|
+
f && (e.preventDefault(), B.current = Math.max(0, B.current - 1), B.current === 0 && z(!1));
|
|
8842
8842
|
}, [f]), de = s((e) => {
|
|
8843
|
-
f && (e.preventDefault(),
|
|
8843
|
+
f && (e.preventDefault(), B.current = 0, z(!1), e.dataTransfer.files.length && se(e.dataTransfer.files));
|
|
8844
8844
|
}, [f, se]), fe = $o({
|
|
8845
8845
|
minHeight: D,
|
|
8846
8846
|
maxHeight: O
|
|
@@ -8877,16 +8877,16 @@ function Ul({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
8877
8877
|
files: I.map((e) => e.file),
|
|
8878
8878
|
model: v ?? "",
|
|
8879
8879
|
...b ? {
|
|
8880
|
-
role:
|
|
8881
|
-
voice:
|
|
8882
|
-
style:
|
|
8880
|
+
role: U,
|
|
8881
|
+
voice: ee,
|
|
8882
|
+
style: G,
|
|
8883
8883
|
language: re,
|
|
8884
8884
|
temperature: ie
|
|
8885
8885
|
} : {}
|
|
8886
8886
|
}), I.forEach(({ objectUrl: e }) => URL.revokeObjectURL(e)), L([]));
|
|
8887
8887
|
}, ye = () => {
|
|
8888
8888
|
if (a) {
|
|
8889
|
-
|
|
8889
|
+
H(!0), o?.();
|
|
8890
8890
|
return;
|
|
8891
8891
|
}
|
|
8892
8892
|
ve();
|
|
@@ -8993,9 +8993,9 @@ function Ul({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
8993
8993
|
placement: "top",
|
|
8994
8994
|
position: "start",
|
|
8995
8995
|
triggerClassName: zl
|
|
8996
|
-
}, /* @__PURE__ */ t.createElement(zi, { onClick: () =>
|
|
8996
|
+
}, /* @__PURE__ */ t.createElement(zi, { onClick: () => W("") }, M.defaultOption), Kc.getRoles().map((e) => /* @__PURE__ */ t.createElement(zi, {
|
|
8997
8997
|
key: e,
|
|
8998
|
-
onClick: () =>
|
|
8998
|
+
onClick: () => W(e)
|
|
8999
8999
|
}, e))), /* @__PURE__ */ t.createElement(Ii, {
|
|
9000
9000
|
trigger: {
|
|
9001
9001
|
icon: "globe",
|
|
@@ -9015,9 +9015,9 @@ function Ul({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9015
9015
|
placement: "top",
|
|
9016
9016
|
position: "start",
|
|
9017
9017
|
triggerClassName: zl
|
|
9018
|
-
}, /* @__PURE__ */ t.createElement(zi, { onClick: () =>
|
|
9018
|
+
}, /* @__PURE__ */ t.createElement(zi, { onClick: () => te("") }, M.defaultOption), Kc.getVoices().map((e) => /* @__PURE__ */ t.createElement(zi, {
|
|
9019
9019
|
key: e,
|
|
9020
|
-
onClick: () =>
|
|
9020
|
+
onClick: () => te(e)
|
|
9021
9021
|
}, e))), /* @__PURE__ */ t.createElement(Ii, {
|
|
9022
9022
|
trigger: {
|
|
9023
9023
|
icon: "feather",
|
|
@@ -9026,9 +9026,9 @@ function Ul({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9026
9026
|
placement: "top",
|
|
9027
9027
|
position: "start",
|
|
9028
9028
|
triggerClassName: zl
|
|
9029
|
-
}, /* @__PURE__ */ t.createElement(zi, { onClick: () =>
|
|
9029
|
+
}, /* @__PURE__ */ t.createElement(zi, { onClick: () => ne("") }, M.defaultOption), Kc.getStyles().map((e) => /* @__PURE__ */ t.createElement(zi, {
|
|
9030
9030
|
key: e,
|
|
9031
|
-
onClick: () =>
|
|
9031
|
+
onClick: () => ne(e)
|
|
9032
9032
|
}, e))), /* @__PURE__ */ t.createElement(Ii, {
|
|
9033
9033
|
trigger: {
|
|
9034
9034
|
icon: "thermometer",
|
|
@@ -9050,10 +9050,10 @@ function Ul({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9050
9050
|
type: "button",
|
|
9051
9051
|
onClick: ye,
|
|
9052
9052
|
disabled: a ? !o : c,
|
|
9053
|
-
title:
|
|
9054
|
-
"aria-label":
|
|
9053
|
+
title: V ? "Stopping…" : a ? "Stop" : M.run,
|
|
9054
|
+
"aria-label": V ? "Stopping…" : a ? "Stop" : M.run,
|
|
9055
9055
|
className: `flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${a ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "bg-primary text-primary-foreground hover:bg-primary/90"}`
|
|
9056
|
-
},
|
|
9056
|
+
}, V || a && !o ? /* @__PURE__ */ t.createElement("span", { className: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ t.createElement(Q, {
|
|
9057
9057
|
name: a ? "square" : "send",
|
|
9058
9058
|
size: 14
|
|
9059
9059
|
})))));
|
|
@@ -9195,12 +9195,12 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9195
9195
|
model: String(e?.model ?? t?.model ?? ""),
|
|
9196
9196
|
temperature: typeof e?.temperature == "number" ? e.temperature : t?.temperature
|
|
9197
9197
|
}), cu = ({ name: e, label: n, value: r, required: i, onChange: a, defaultValue: o, minHeight: s = 120, maxHeight: c = 160, before: l, after: d, wrapperClassName: f, className: p, onRunPrompt: m, renderAIUnavailable: g, variables: _, commands: v, commandsTrigger: y, attachments: b, actions: x, statusItems: S }) => {
|
|
9198
|
-
let { handleChange: C, record: w } = rd({ name: e }), T = Y("prompt"), E = Nn("prompt"), D = n || e, [O, k] = h(!1), [A, j] = h(o?.value ?? ""), [M, N] = h(!1), [P, F] = h(null), I = Zc(), L = Qc(), R = typeof localStorage < "u" && localStorage.getItem("prompt.model") || (I ? qc(I.id, I.defaultModel) : ""), { modelOptions:
|
|
9198
|
+
let { handleChange: C, record: w } = rd({ name: e }), T = Y("prompt"), E = Nn("prompt"), D = n || e, [O, k] = h(!1), [A, j] = h(o?.value ?? ""), [M, N] = h(!1), [P, F] = h(null), I = Zc(), L = Qc(), R = typeof localStorage < "u" && localStorage.getItem("prompt.model") || (I ? qc(I.id, I.defaultModel) : ""), { modelOptions: z } = Ql(), B = t.useMemo(() => su(r?.prompt, o), [o, r?.prompt]), V = B.model || R, H = u(), U = $l(V, !!m), W = !U.configured, [ee, te] = h(null), G = !ee && !U.configured ? g?.({
|
|
9199
9199
|
mode: "run",
|
|
9200
|
-
providerId:
|
|
9201
|
-
reason:
|
|
9202
|
-
configured:
|
|
9203
|
-
}) : null,
|
|
9200
|
+
providerId: U.providerId,
|
|
9201
|
+
reason: U.reason,
|
|
9202
|
+
configured: U.configured
|
|
9203
|
+
}) : null, ne = t.useMemo(() => {
|
|
9204
9204
|
if (!A) return "";
|
|
9205
9205
|
let e = {
|
|
9206
9206
|
...w,
|
|
@@ -9211,35 +9211,35 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9211
9211
|
A,
|
|
9212
9212
|
w,
|
|
9213
9213
|
_
|
|
9214
|
-
]), re =
|
|
9214
|
+
]), re = ne !== A, K = (e, t) => C?.({ target: {
|
|
9215
9215
|
name: e,
|
|
9216
9216
|
value: t
|
|
9217
9217
|
} }), ie = x?.map((e) => e.key === "tokenUsage" && !e.content ? {
|
|
9218
9218
|
...e,
|
|
9219
9219
|
content: P ? /* @__PURE__ */ t.createElement("div", { className: "px-3 py-2 text-xs space-y-1" }, /* @__PURE__ */ t.createElement("p", { className: "font-medium text-foreground" }, E.tokenUsage), /* @__PURE__ */ t.createElement("p", { className: "text-muted-foreground" }, Tn(E.tokenInput, { count: String(P.tokensIn) })), /* @__PURE__ */ t.createElement("p", { className: "text-muted-foreground" }, Tn(E.tokenOutput, { count: String(P.tokensOut) })), P.contextPercent !== null && /* @__PURE__ */ t.createElement("p", { className: "text-muted-foreground" }, Tn(E.tokenContext, { percent: P.contextPercent.toFixed(1) })), P.estimatedCost !== null && /* @__PURE__ */ t.createElement("p", { className: "text-muted-foreground" }, Tn(E.tokenCost, { amount: P.estimatedCost.toFixed(5) })), /* @__PURE__ */ t.createElement("p", { className: "text-muted-foreground" }, Tn(E.tokenTime, { seconds: (P.durationMs / 1e3).toFixed(1) }))) : /* @__PURE__ */ t.createElement("p", { className: "px-3 py-2 text-xs text-muted-foreground" }, E.tokenUsageEmpty)
|
|
9220
9220
|
} : e), ae = async (t) => {
|
|
9221
|
-
let n = t.model ||
|
|
9221
|
+
let n = t.model || V || R, r = Jc(n), i = r ? L?.registry[r.provider] ?? I ?? void 0 : I ?? void 0, a = Date.now();
|
|
9222
9222
|
try {
|
|
9223
9223
|
let r = {
|
|
9224
9224
|
...w,
|
|
9225
9225
|
..._
|
|
9226
9226
|
}, o = await Promise.all(t.files.map((e) => xl.fileToAttachment(e))), s = await uu({
|
|
9227
|
-
...
|
|
9227
|
+
...B,
|
|
9228
9228
|
model: n,
|
|
9229
|
-
role: t.role ??
|
|
9230
|
-
voice: t.voice ??
|
|
9231
|
-
style: t.style ??
|
|
9232
|
-
language: t.language ??
|
|
9233
|
-
temperature: t.temperature ??
|
|
9229
|
+
role: t.role ?? B.role,
|
|
9230
|
+
voice: t.voice ?? B.voice,
|
|
9231
|
+
style: t.style ?? B.style,
|
|
9232
|
+
language: t.language ?? B.language,
|
|
9233
|
+
temperature: t.temperature ?? B.temperature
|
|
9234
9234
|
}, r, m, i, o.length > 0 ? o : void 0, {
|
|
9235
9235
|
noProvider: E.noProvider,
|
|
9236
9236
|
noResponse: E.noResponse
|
|
9237
9237
|
}), c = Date.now() - a;
|
|
9238
|
-
if (
|
|
9238
|
+
if (te(null), C?.({ target: {
|
|
9239
9239
|
name: e + ".value",
|
|
9240
9240
|
value: s
|
|
9241
9241
|
} }), t.role !== void 0 && K(e + ".prompt.role", t.role), t.voice !== void 0 && K(e + ".prompt.voice", t.voice), t.style !== void 0 && K(e + ".prompt.style", t.style), t.language !== void 0 && K(e + ".prompt.language", t.language), S && S.length > 0) {
|
|
9242
|
-
let e = Kc.parsePrompt(
|
|
9242
|
+
let e = Kc.parsePrompt(B.value ?? "", r), t = xl.countTokens(e), i = xl.countTokens(s ?? ""), a = xl.contextPercent(t, n), o = xl.estimateCost(t, i, n);
|
|
9243
9243
|
F({
|
|
9244
9244
|
tokensIn: t,
|
|
9245
9245
|
tokensOut: i,
|
|
@@ -9250,11 +9250,11 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9250
9250
|
});
|
|
9251
9251
|
}
|
|
9252
9252
|
} catch (e) {
|
|
9253
|
-
|
|
9253
|
+
te(Xl(e, E.runFailed));
|
|
9254
9254
|
}
|
|
9255
9255
|
};
|
|
9256
9256
|
return /* @__PURE__ */ t.createElement(Z, { className: f || T.Prompt.wrapperClassName }, /* @__PURE__ */ t.createElement("div", { className: "flex items-center gap-2" }, l && /* @__PURE__ */ t.createElement("div", { className: "shrink-0" }, l), /* @__PURE__ */ t.createElement("div", { className: `${Gl} min-w-0 flex-1` }, D && /* @__PURE__ */ t.createElement(Zl, {
|
|
9257
|
-
htmlFor:
|
|
9257
|
+
htmlFor: H,
|
|
9258
9258
|
label: O ? `${E.promptLabel}${D}` : D,
|
|
9259
9259
|
required: i
|
|
9260
9260
|
}), /* @__PURE__ */ t.createElement("div", { className: "group relative" }, /* @__PURE__ */ t.createElement("button", {
|
|
@@ -9266,7 +9266,7 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9266
9266
|
name: O ? "x" : "settings",
|
|
9267
9267
|
size: 13
|
|
9268
9268
|
})), O ? /* @__PURE__ */ t.createElement("div", { className: "overflow-hidden rounded-xl border border-input shadow-sm transition-shadow focus-within:shadow-md focus-within:ring-2 focus-within:ring-warning focus-within:ring-offset-0" }, /* @__PURE__ */ t.createElement(Ms, {
|
|
9269
|
-
id:
|
|
9269
|
+
id: H,
|
|
9270
9270
|
name: e + ".prompt.value",
|
|
9271
9271
|
defaultValue: o?.value,
|
|
9272
9272
|
onChange: (e) => {
|
|
@@ -9278,7 +9278,7 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9278
9278
|
className: `${p || T.Prompt.className} ${au}`,
|
|
9279
9279
|
minHeight: s,
|
|
9280
9280
|
maxHeight: c
|
|
9281
|
-
}), re && M && /* @__PURE__ */ t.createElement("div", { className: "border-t border-input px-4 py-3 bg-muted/20" }, /* @__PURE__ */ t.createElement("p", { className: "whitespace-pre-wrap text-sm text-foreground/70" },
|
|
9281
|
+
}), re && M && /* @__PURE__ */ t.createElement("div", { className: "border-t border-input px-4 py-3 bg-muted/20" }, /* @__PURE__ */ t.createElement("p", { className: "whitespace-pre-wrap text-sm text-foreground/70" }, ne)), re && /* @__PURE__ */ t.createElement("div", { className: "flex items-center justify-end border-t border-input px-2 py-1" }, /* @__PURE__ */ t.createElement("button", {
|
|
9282
9282
|
type: "button",
|
|
9283
9283
|
title: M ? E.hidePreview : E.showPreview,
|
|
9284
9284
|
className: `${ou} flex items-center justify-center ${M ? "bg-muted text-foreground" : ""}`,
|
|
@@ -9304,32 +9304,32 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9304
9304
|
onChange: C ?? (() => {})
|
|
9305
9305
|
});
|
|
9306
9306
|
},
|
|
9307
|
-
disabled:
|
|
9307
|
+
disabled: W,
|
|
9308
9308
|
onSubmit: (e) => {
|
|
9309
9309
|
ae(e);
|
|
9310
9310
|
},
|
|
9311
9311
|
attachments: b,
|
|
9312
9312
|
commands: v,
|
|
9313
9313
|
commandsTrigger: y,
|
|
9314
|
-
models:
|
|
9315
|
-
selectedModel:
|
|
9314
|
+
models: z,
|
|
9315
|
+
selectedModel: V,
|
|
9316
9316
|
onModelChange: (t) => K(e + ".prompt.model", t),
|
|
9317
9317
|
showSettings: !0,
|
|
9318
|
-
defaultRole:
|
|
9319
|
-
defaultVoice:
|
|
9320
|
-
defaultStyle:
|
|
9321
|
-
defaultLanguage:
|
|
9322
|
-
defaultTemperature:
|
|
9318
|
+
defaultRole: B.role,
|
|
9319
|
+
defaultVoice: B.voice,
|
|
9320
|
+
defaultStyle: B.style,
|
|
9321
|
+
defaultLanguage: B.language,
|
|
9322
|
+
defaultTemperature: B.temperature,
|
|
9323
9323
|
actions: ie,
|
|
9324
9324
|
minHeight: s,
|
|
9325
9325
|
maxHeight: c,
|
|
9326
9326
|
className: p || T.Prompt.className,
|
|
9327
9327
|
wrapperClassName: ""
|
|
9328
|
-
}), (
|
|
9328
|
+
}), (ee || !U.configured) && (G ? /* @__PURE__ */ t.createElement("div", { className: "mt-1" }, G) : /* @__PURE__ */ t.createElement("span", { className: "mt-1 flex min-w-0 items-center gap-1 text-xs text-warning" }, /* @__PURE__ */ t.createElement(Q, {
|
|
9329
9329
|
name: "triangle-alert",
|
|
9330
9330
|
size: 13,
|
|
9331
9331
|
className: "shrink-0"
|
|
9332
|
-
}), /* @__PURE__ */ t.createElement("span", { className: "truncate" },
|
|
9332
|
+
}), /* @__PURE__ */ t.createElement("span", { className: "truncate" }, ee ?? (U.reason || E.aiNotConfiguredShort)))), S && S.length > 0 && P && /* @__PURE__ */ t.createElement("div", { className: "mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 rounded-lg border border-input/50 bg-muted/20 px-4 py-1.5 text-[11px] text-muted-foreground" }, S.map((e) => {
|
|
9333
9333
|
if (typeof e == "string") switch (e) {
|
|
9334
9334
|
case "tokensIn": return /* @__PURE__ */ t.createElement("span", { key: "tokensIn" }, Tn(E.tokenInput, { count: P.tokensIn }));
|
|
9335
9335
|
case "tokensOut": return /* @__PURE__ */ t.createElement("span", { key: "tokensOut" }, Tn(E.tokenOutput, { count: P.tokensOut }));
|
|
@@ -9574,23 +9574,23 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9574
9574
|
}
|
|
9575
9575
|
return await b?.(e);
|
|
9576
9576
|
}
|
|
9577
|
-
}), F = m(null), I = m(null), L = m(null), [R,
|
|
9577
|
+
}), F = m(null), I = m(null), L = m(null), [R, z] = h(!0), [B, V] = h({
|
|
9578
9578
|
open: !1,
|
|
9579
9579
|
query: "",
|
|
9580
9580
|
anchorPosition: null,
|
|
9581
9581
|
editorContext: null
|
|
9582
|
-
}),
|
|
9583
|
-
|
|
9584
|
-
let
|
|
9582
|
+
}), H = m(j ?? ""), U = m(B);
|
|
9583
|
+
U.current = B;
|
|
9584
|
+
let W = S?.length ? C ?? "/" : void 0, ee = (S?.length ?? 0) >= 10, te = t.useMemo(() => new Map((S ?? []).map((e) => [e.name, e])), [S]), G = t.useMemo(() => (S ?? []).map((e) => ({
|
|
9585
9585
|
key: e.name,
|
|
9586
|
-
label: `${
|
|
9586
|
+
label: `${W ?? "/"}${e.name}`,
|
|
9587
9587
|
value: e.name,
|
|
9588
9588
|
icon: e.icon,
|
|
9589
9589
|
description: e.description,
|
|
9590
9590
|
group: e.group
|
|
9591
|
-
})), [S,
|
|
9591
|
+
})), [S, W]), ne = t.useMemo(() => {
|
|
9592
9592
|
let e = [], n;
|
|
9593
|
-
return
|
|
9593
|
+
return G.forEach((r) => {
|
|
9594
9594
|
r.group !== n && (n = r.group, r.group && e.push(/* @__PURE__ */ t.createElement(Rl.Heading, { key: `group:${r.group}` }, r.group))), e.push(/* @__PURE__ */ t.createElement(Rl.Item, {
|
|
9595
9595
|
key: r.key,
|
|
9596
9596
|
label: r.label,
|
|
@@ -9599,24 +9599,24 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9599
9599
|
description: r.description
|
|
9600
9600
|
}));
|
|
9601
9601
|
}), e;
|
|
9602
|
-
}, [
|
|
9602
|
+
}, [G]);
|
|
9603
9603
|
l(() => {
|
|
9604
|
-
I.current || (
|
|
9604
|
+
I.current || (H.current = j ?? "");
|
|
9605
9605
|
}, [j]);
|
|
9606
9606
|
let re = s((t) => {
|
|
9607
|
-
|
|
9607
|
+
H.current = t, M({ target: {
|
|
9608
9608
|
name: e,
|
|
9609
9609
|
value: t
|
|
9610
9610
|
} });
|
|
9611
9611
|
}, [M, e]), K = s(() => {
|
|
9612
|
-
|
|
9612
|
+
V({
|
|
9613
9613
|
open: !1,
|
|
9614
9614
|
query: "",
|
|
9615
9615
|
anchorPosition: null,
|
|
9616
9616
|
editorContext: null
|
|
9617
9617
|
});
|
|
9618
9618
|
}, []), ie = s(async (e, t) => {
|
|
9619
|
-
let n =
|
|
9619
|
+
let n = te.get(e.value);
|
|
9620
9620
|
if (n) {
|
|
9621
9621
|
if (n.handler) {
|
|
9622
9622
|
let e = await n.handler(Fl(t)), r = n.consumeSuffix ? Ml(t.textAfterCaret, n.consumeSuffix) : 0;
|
|
@@ -9625,7 +9625,7 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9625
9625
|
}
|
|
9626
9626
|
t.replace(t.triggerRange.start, t.triggerRange.end, `${t.trigger}${n.name} `);
|
|
9627
9627
|
}
|
|
9628
|
-
}, [
|
|
9628
|
+
}, [te]);
|
|
9629
9629
|
l(() => {
|
|
9630
9630
|
let e = !1, t = null;
|
|
9631
9631
|
return Eu(o).then((n) => {
|
|
@@ -9679,19 +9679,19 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9679
9679
|
}),
|
|
9680
9680
|
...x ?? []
|
|
9681
9681
|
];
|
|
9682
|
-
|
|
9682
|
+
W && i.push(n.EditorView.updateListener.of((e) => {
|
|
9683
9683
|
let t = e.state.selection.main;
|
|
9684
9684
|
if (t.from !== t.to) {
|
|
9685
|
-
|
|
9685
|
+
U.current.open && K();
|
|
9686
9686
|
return;
|
|
9687
9687
|
}
|
|
9688
|
-
let n = Ou(e.state.doc.toString(), t.from,
|
|
9688
|
+
let n = Ou(e.state.doc.toString(), t.from, W);
|
|
9689
9689
|
if (!n) {
|
|
9690
|
-
|
|
9690
|
+
U.current.open && K();
|
|
9691
9691
|
return;
|
|
9692
9692
|
}
|
|
9693
|
-
let r = e.view.coordsAtPos(t.from), i = ku(e.view,
|
|
9694
|
-
!r || !i ||
|
|
9693
|
+
let r = e.view.coordsAtPos(t.from), i = ku(e.view, W);
|
|
9694
|
+
!r || !i || V({
|
|
9695
9695
|
open: !0,
|
|
9696
9696
|
query: n.query,
|
|
9697
9697
|
anchorPosition: {
|
|
@@ -9703,26 +9703,26 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9703
9703
|
}), n.Prec.highest(n.keymap.of([
|
|
9704
9704
|
{
|
|
9705
9705
|
key: "ArrowDown",
|
|
9706
|
-
run: () =>
|
|
9706
|
+
run: () => U.current.open ? (L.current?.moveNext(), !0) : !1
|
|
9707
9707
|
},
|
|
9708
9708
|
{
|
|
9709
9709
|
key: "ArrowUp",
|
|
9710
|
-
run: () =>
|
|
9710
|
+
run: () => U.current.open ? (L.current?.movePrev(), !0) : !1
|
|
9711
9711
|
},
|
|
9712
9712
|
{
|
|
9713
9713
|
key: "Enter",
|
|
9714
|
-
run: () =>
|
|
9714
|
+
run: () => U.current.open ? (L.current?.selectActive(), !0) : !1
|
|
9715
9715
|
},
|
|
9716
9716
|
{
|
|
9717
9717
|
key: "Tab",
|
|
9718
|
-
run: () =>
|
|
9718
|
+
run: () => U.current.open ? (L.current?.selectActive(), !0) : !1
|
|
9719
9719
|
},
|
|
9720
9720
|
{
|
|
9721
9721
|
key: "Escape",
|
|
9722
|
-
run: () =>
|
|
9722
|
+
run: () => U.current.open ? (L.current?.close(), !0) : !1
|
|
9723
9723
|
}
|
|
9724
9724
|
])), n.EditorView.domEventHandlers({ keydown: (e) => {
|
|
9725
|
-
if (!
|
|
9725
|
+
if (!U.current.open) return !1;
|
|
9726
9726
|
switch (e.key) {
|
|
9727
9727
|
case "ArrowDown": return e.preventDefault(), L.current?.moveNext(), !0;
|
|
9728
9728
|
case "ArrowUp": return e.preventDefault(), L.current?.movePrev(), !0;
|
|
@@ -9733,15 +9733,15 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9733
9733
|
}
|
|
9734
9734
|
} })), g && i.push(n.EditorView.editable.of(!1));
|
|
9735
9735
|
let a = n.EditorState.create({
|
|
9736
|
-
doc:
|
|
9736
|
+
doc: H.current,
|
|
9737
9737
|
extensions: i
|
|
9738
9738
|
});
|
|
9739
9739
|
t = new n.EditorView({
|
|
9740
9740
|
state: a,
|
|
9741
9741
|
parent: F.current
|
|
9742
|
-
}), Du(t.scrollDOM, A), I.current = t,
|
|
9742
|
+
}), Du(t.scrollDOM, A), I.current = t, z(!1);
|
|
9743
9743
|
}).catch((t) => {
|
|
9744
|
-
e || (console.error("[CodeEditor] Failed to load CodeMirror:", t),
|
|
9744
|
+
e || (console.error("[CodeEditor] Failed to load CodeMirror:", t), z(!1));
|
|
9745
9745
|
}), () => {
|
|
9746
9746
|
e = !0, t && (t.destroy(), I.current = null);
|
|
9747
9747
|
};
|
|
@@ -9752,10 +9752,10 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9752
9752
|
o,
|
|
9753
9753
|
re,
|
|
9754
9754
|
c,
|
|
9755
|
-
|
|
9755
|
+
W
|
|
9756
9756
|
]), l(() => {
|
|
9757
9757
|
let e = j ?? "", t = I.current;
|
|
9758
|
-
t && e !==
|
|
9758
|
+
t && e !== H.current && (H.current = e, t.dispatch({ changes: {
|
|
9759
9759
|
from: 0,
|
|
9760
9760
|
to: t.state.doc.length,
|
|
9761
9761
|
insert: e
|
|
@@ -9784,22 +9784,22 @@ var eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9784
9784
|
required: p,
|
|
9785
9785
|
htmlFor: O,
|
|
9786
9786
|
className: v
|
|
9787
|
-
}), /* @__PURE__ */ t.createElement("div", { className: X(E || D ? is : "", A.fill && "flex-1 min-h-0 flex flex-col") }, E && /* @__PURE__ */ t.createElement("span", { className: X("inline-flex shrink-0 items-center border border-input bg-muted px-3 py-1 text-sm text-muted-foreground", "rounded-l-md rounded-r-none border-r-0") }, E),
|
|
9787
|
+
}), /* @__PURE__ */ t.createElement("div", { className: X(E || D ? is : "", A.fill && "flex-1 min-h-0 flex flex-col") }, E && /* @__PURE__ */ t.createElement("span", { className: X("inline-flex shrink-0 items-center border border-input bg-muted px-3 py-1 text-sm text-muted-foreground", "rounded-l-md rounded-r-none border-r-0") }, E), W && G.length > 0 ? /* @__PURE__ */ t.createElement(Rl, {
|
|
9788
9788
|
ref: L,
|
|
9789
9789
|
className: X(A.fill && "flex-1 min-h-0 flex flex-col"),
|
|
9790
|
-
trigger:
|
|
9791
|
-
searchable:
|
|
9792
|
-
controlled:
|
|
9793
|
-
open:
|
|
9794
|
-
anchorPosition:
|
|
9795
|
-
query:
|
|
9796
|
-
editorContext:
|
|
9790
|
+
trigger: W,
|
|
9791
|
+
searchable: ee,
|
|
9792
|
+
controlled: B.editorContext ? {
|
|
9793
|
+
open: B.open,
|
|
9794
|
+
anchorPosition: B.anchorPosition,
|
|
9795
|
+
query: B.query,
|
|
9796
|
+
editorContext: B.editorContext,
|
|
9797
9797
|
onClose: K
|
|
9798
9798
|
} : void 0,
|
|
9799
9799
|
onSelect: (e, t) => {
|
|
9800
9800
|
ie(e, t);
|
|
9801
9801
|
}
|
|
9802
|
-
},
|
|
9802
|
+
}, ne, oe) : oe, D && /* @__PURE__ */ t.createElement("span", { className: X("inline-flex shrink-0 items-center border border-input bg-muted px-3 py-1 text-sm text-muted-foreground", "rounded-l-none rounded-r-md border-l-0") }, D)), P && /* @__PURE__ */ t.createElement(ps, { message: P }), _ && /* @__PURE__ */ t.createElement("p", { className: "mt-1 text-xs text-muted-foreground" }, _));
|
|
9803
9803
|
}, ju = {
|
|
9804
9804
|
string: (e = {}) => ({
|
|
9805
9805
|
__props: e,
|
|
@@ -10852,7 +10852,7 @@ var cd = (e) => {
|
|
|
10852
10852
|
return;
|
|
10853
10853
|
}
|
|
10854
10854
|
}, dd = ({ children: e, appearance: n = void 0, controller: r = void 0, header: i = void 0, footer: a = void 0, path: o = void 0, defaultValues: c = void 0, keyGenerator: u = void 0, onLoad: d = void 0, onRecordChange: f = void 0, onSave: g = void 0, onDelete: _ = void 0, onComplete: v = void 0, log: y = !1, showNotice: b = !0, draftBucket: S = void 0, noticeAnchorRef: C = void 0, showBack: w = !1, wrapperClassName: T = void 0, headerClassName: E = void 0, className: D = void 0, footerClassName: O = void 0, formClassName: k = void 0 }) => {
|
|
10855
|
-
let A = x(), j = Y("form"), N = Nn("form"), P = Ci(), F = qu(r), I = Wu(F), [L, R] = h(c), [
|
|
10855
|
+
let A = x(), j = Y("form"), N = Nn("form"), P = Ci(), F = qu(r), I = Wu(F), [L, R] = h(c), [z, B] = h(!1), [V, H] = h(!1), U = !c?.[La], W = m(wt(c ?? {})), [ee, te] = h(() => ld(c)), [G, ne] = h(null), re = m({ isDirty: !1 }), K = p(() => {
|
|
10856
10856
|
if (!S) return;
|
|
10857
10857
|
let e = ct(S), t = ct(o || `${A.pathname}${A.hash || ""}`);
|
|
10858
10858
|
return e && t ? `llmnative.form-draft.${e}.${t}` : void 0;
|
|
@@ -10861,28 +10861,28 @@ var cd = (e) => {
|
|
|
10861
10861
|
A.pathname,
|
|
10862
10862
|
A.hash,
|
|
10863
10863
|
o
|
|
10864
|
-
]), ie = !!(g || o || !
|
|
10864
|
+
]), ie = !!(g || o || !U), ae = !!(_ || !U), oe = p(() => ld(L) !== ee, [L, ee]), se = N.noChangesToSave ?? "No changes to save", ce = N.draftRestoreTitle ?? "Unsaved changes found", le = N.draftRestoreMessage ?? "A local draft is available for this form. Restore it or discard it.", ue = N.draftRestoreAction ?? "Restore", de = N.draftDiscardAction ?? "Discard", fe = N.draftRestoredTitle ?? "Draft restored", q = N.draftRestoredMessage ?? "The local draft has been restored. You can still discard it for a few seconds.", pe = s(() => {
|
|
10865
10865
|
!K || typeof localStorage > "u" || localStorage.removeItem(K);
|
|
10866
10866
|
}, [K]), me = s(() => {
|
|
10867
10867
|
if (!(!K || typeof localStorage > "u")) return ud(localStorage.getItem(K));
|
|
10868
10868
|
}, [K]), he = s(() => {
|
|
10869
|
-
R(wt(
|
|
10869
|
+
R(wt(W.current));
|
|
10870
10870
|
}, []), [ge, _e] = h(void 0), ve = s(({ message: e, type: t = "danger" }) => {
|
|
10871
10871
|
b && _e({
|
|
10872
10872
|
type: t,
|
|
10873
10873
|
message: e
|
|
10874
10874
|
});
|
|
10875
|
-
}, [b]), [ye, be] = h({}), xe = m({}), Se = m(null),
|
|
10876
|
-
pe(), he(),
|
|
10875
|
+
}, [b]), [ye, be] = h({}), xe = m({}), Se = m(null), Ce = m(L), we = m(c), Te = m(g), Ee = m(_), De = m(v), Oe = m(o), J = m(y), ke = s(() => {
|
|
10876
|
+
pe(), he(), ne(null);
|
|
10877
10877
|
}, [pe, he]), Ae = s(() => {
|
|
10878
10878
|
let e = me();
|
|
10879
10879
|
if (!e) {
|
|
10880
|
-
|
|
10880
|
+
ne(null);
|
|
10881
10881
|
return;
|
|
10882
10882
|
}
|
|
10883
|
-
R(wt(e)),
|
|
10883
|
+
R(wt(e)), ne("restored");
|
|
10884
10884
|
}, [me]), je = s(() => {
|
|
10885
|
-
be({}), _e(void 0),
|
|
10885
|
+
be({}), _e(void 0), ne(null), he();
|
|
10886
10886
|
}, [he]), Me = s((e, t) => {
|
|
10887
10887
|
xe.current[e] = t;
|
|
10888
10888
|
}, []), Ne = s((e) => {
|
|
@@ -10901,7 +10901,7 @@ var cd = (e) => {
|
|
|
10901
10901
|
if (Array.isArray(e)) return e[Number(t)];
|
|
10902
10902
|
if (typeof e == "object") return e[t];
|
|
10903
10903
|
}
|
|
10904
|
-
},
|
|
10904
|
+
}, Ce.current);
|
|
10905
10905
|
if (r && (o == null || typeof o == "string" && o.trim() === "" || Array.isArray(o) && o.length === 0)) {
|
|
10906
10906
|
e[t] = i ? Tn(N.requiredField, { field: i }) : N.requiredFieldGeneric;
|
|
10907
10907
|
continue;
|
|
@@ -10921,7 +10921,7 @@ var cd = (e) => {
|
|
|
10921
10921
|
}, [N]), Ie = s((e) => {
|
|
10922
10922
|
if (!o) return;
|
|
10923
10923
|
let t = st(o);
|
|
10924
|
-
if (
|
|
10924
|
+
if (U) return t.split("/").filter(Boolean).length % 2 == 0 && !u ? `/${t}` : `/${t}/${u?.(e) ?? Date.now().toString()}`;
|
|
10925
10925
|
let n = e[La];
|
|
10926
10926
|
if (!n) return o;
|
|
10927
10927
|
let r = t.split("/").filter(Boolean);
|
|
@@ -10929,22 +10929,22 @@ var cd = (e) => {
|
|
|
10929
10929
|
}, [
|
|
10930
10930
|
o,
|
|
10931
10931
|
u,
|
|
10932
|
-
|
|
10932
|
+
U
|
|
10933
10933
|
]), Le = s(async (e) => {
|
|
10934
|
-
if (
|
|
10934
|
+
if (J.current && Oe.current && P) {
|
|
10935
10935
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = Yr("user");
|
|
10936
|
-
P.set(`/log/${
|
|
10936
|
+
P.set(`/log/${Oe.current}/${ct(t)}`, {
|
|
10937
10937
|
user: n?.email ?? "unknown",
|
|
10938
10938
|
when: t,
|
|
10939
10939
|
action: e,
|
|
10940
|
-
record:
|
|
10940
|
+
record: Ce.current
|
|
10941
10941
|
});
|
|
10942
10942
|
}
|
|
10943
10943
|
return ve({
|
|
10944
10944
|
message: e === "delete" ? N.deleteSuccess : N.saveSuccess,
|
|
10945
10945
|
type: "success"
|
|
10946
|
-
}), await
|
|
10947
|
-
record:
|
|
10946
|
+
}), await De.current?.({
|
|
10947
|
+
record: Ce.current,
|
|
10948
10948
|
action: e
|
|
10949
10949
|
}) ?? !0;
|
|
10950
10950
|
}, [
|
|
@@ -10962,18 +10962,18 @@ var cd = (e) => {
|
|
|
10962
10962
|
message: N.noticeRequiredFields,
|
|
10963
10963
|
type: "warning"
|
|
10964
10964
|
}), !1;
|
|
10965
|
-
let t =
|
|
10966
|
-
|
|
10965
|
+
let t = U ? "create" : "update";
|
|
10966
|
+
B(!0);
|
|
10967
10967
|
try {
|
|
10968
|
-
let e = (
|
|
10969
|
-
record:
|
|
10970
|
-
prevRecord:
|
|
10968
|
+
let e = (Te.current && await Te.current({
|
|
10969
|
+
record: Ce.current,
|
|
10970
|
+
prevRecord: we.current,
|
|
10971
10971
|
action: t,
|
|
10972
|
-
storagePath:
|
|
10973
|
-
})) ?? Ie(
|
|
10974
|
-
return e && await P.set(e, Nt(
|
|
10972
|
+
storagePath: Oe.current
|
|
10973
|
+
})) ?? Ie(Ce.current ?? {});
|
|
10974
|
+
return e && await P.set(e, Nt(Ce.current)), W.current = wt(Ce.current ?? {}), te(ld(Ce.current)), pe(), ne(null), await Le(t);
|
|
10975
10975
|
} finally {
|
|
10976
|
-
|
|
10976
|
+
B(!1);
|
|
10977
10977
|
}
|
|
10978
10978
|
}, [
|
|
10979
10979
|
pe,
|
|
@@ -10982,17 +10982,17 @@ var cd = (e) => {
|
|
|
10982
10982
|
N.noticeRequiredFields,
|
|
10983
10983
|
Le,
|
|
10984
10984
|
oe,
|
|
10985
|
-
|
|
10985
|
+
U,
|
|
10986
10986
|
se,
|
|
10987
10987
|
b,
|
|
10988
10988
|
Fe
|
|
10989
10989
|
]), ze = s(async (e) => {
|
|
10990
|
-
e?.preventDefault?.(), b && _e(void 0),
|
|
10990
|
+
e?.preventDefault?.(), b && _e(void 0), H(!0);
|
|
10991
10991
|
try {
|
|
10992
|
-
let e = (
|
|
10993
|
-
return e && await P.remove(e), pe(),
|
|
10992
|
+
let e = (Ee.current && await Ee.current({ record: Ce.current })) ?? Ie(Ce.current ?? {});
|
|
10993
|
+
return e && await P.remove(e), pe(), ne(null), await Le("delete");
|
|
10994
10994
|
} finally {
|
|
10995
|
-
|
|
10995
|
+
H(!1);
|
|
10996
10996
|
}
|
|
10997
10997
|
}, [
|
|
10998
10998
|
pe,
|
|
@@ -11003,25 +11003,25 @@ var cd = (e) => {
|
|
|
11003
11003
|
]);
|
|
11004
11004
|
l(() => {
|
|
11005
11005
|
let e = wt(c ?? {});
|
|
11006
|
-
if (c && (R(e), d?.(wt(e))),
|
|
11007
|
-
|
|
11006
|
+
if (c && (R(e), d?.(wt(e))), W.current = e, te(ld(e)), !S) {
|
|
11007
|
+
ne(null);
|
|
11008
11008
|
return;
|
|
11009
11009
|
}
|
|
11010
11010
|
let t = me();
|
|
11011
11011
|
if (t && ld(t) !== ld(e)) {
|
|
11012
|
-
|
|
11012
|
+
ne("restore");
|
|
11013
11013
|
return;
|
|
11014
11014
|
}
|
|
11015
|
-
|
|
11015
|
+
ne(null);
|
|
11016
11016
|
}, [
|
|
11017
11017
|
JSON.stringify(c),
|
|
11018
11018
|
S,
|
|
11019
11019
|
d,
|
|
11020
11020
|
me
|
|
11021
11021
|
]), l(() => {
|
|
11022
|
-
|
|
11022
|
+
Ce.current = L, L !== void 0 && f?.(L);
|
|
11023
11023
|
}, [L, f]), l(() => {
|
|
11024
|
-
|
|
11024
|
+
we.current = c, Te.current = g, Ee.current = _, De.current = v, Oe.current = o, J.current = y;
|
|
11025
11025
|
}, [
|
|
11026
11026
|
c,
|
|
11027
11027
|
y,
|
|
@@ -11033,7 +11033,7 @@ var cd = (e) => {
|
|
|
11033
11033
|
if (!K || typeof localStorage > "u" || L === void 0) return;
|
|
11034
11034
|
if (!oe) {
|
|
11035
11035
|
let e = me();
|
|
11036
|
-
if (e && ld(e) !==
|
|
11036
|
+
if (e && ld(e) !== ee) return;
|
|
11037
11037
|
localStorage.removeItem(K);
|
|
11038
11038
|
return;
|
|
11039
11039
|
}
|
|
@@ -11042,7 +11042,7 @@ var cd = (e) => {
|
|
|
11042
11042
|
}, 150);
|
|
11043
11043
|
return () => window.clearTimeout(e);
|
|
11044
11044
|
}, [
|
|
11045
|
-
|
|
11045
|
+
ee,
|
|
11046
11046
|
K,
|
|
11047
11047
|
oe,
|
|
11048
11048
|
me,
|
|
@@ -11077,17 +11077,17 @@ var cd = (e) => {
|
|
|
11077
11077
|
Ae
|
|
11078
11078
|
]), l(() => {
|
|
11079
11079
|
I.setState({
|
|
11080
|
-
record:
|
|
11081
|
-
isNewRecord:
|
|
11080
|
+
record: Ce.current,
|
|
11081
|
+
isNewRecord: U,
|
|
11082
11082
|
isDirty: oe,
|
|
11083
11083
|
canSave: ie,
|
|
11084
11084
|
canDelete: ae,
|
|
11085
|
-
isSaving:
|
|
11086
|
-
isDeleting:
|
|
11087
|
-
saveDisabled: !ie || !oe ||
|
|
11088
|
-
deleteDisabled: !ae ||
|
|
11089
|
-
hasDraft:
|
|
11090
|
-
draftStatus:
|
|
11085
|
+
isSaving: z,
|
|
11086
|
+
isDeleting: V,
|
|
11087
|
+
saveDisabled: !ie || !oe || z,
|
|
11088
|
+
deleteDisabled: !ae || V,
|
|
11089
|
+
hasDraft: G !== null,
|
|
11090
|
+
draftStatus: G,
|
|
11091
11091
|
errors: ye,
|
|
11092
11092
|
hasErrors: Object.keys(ye).length > 0
|
|
11093
11093
|
});
|
|
@@ -11095,12 +11095,12 @@ var cd = (e) => {
|
|
|
11095
11095
|
ae,
|
|
11096
11096
|
ie,
|
|
11097
11097
|
I,
|
|
11098
|
-
|
|
11098
|
+
G,
|
|
11099
11099
|
ye,
|
|
11100
|
-
|
|
11100
|
+
V,
|
|
11101
11101
|
oe,
|
|
11102
|
-
|
|
11103
|
-
|
|
11102
|
+
U,
|
|
11103
|
+
z,
|
|
11104
11104
|
L
|
|
11105
11105
|
]), l(() => () => Gu(F), [I]);
|
|
11106
11106
|
let Be = s((e) => {
|
|
@@ -11133,13 +11133,13 @@ var cd = (e) => {
|
|
|
11133
11133
|
timeout: ge.type === "success" ? 3e3 : void 0,
|
|
11134
11134
|
onClose: ge.type === "success" ? () => _e(void 0) : void 0
|
|
11135
11135
|
}, ge.message) : null, [ge, C]), Ge = p(() => {
|
|
11136
|
-
if (!
|
|
11137
|
-
let e =
|
|
11136
|
+
if (!G) return null;
|
|
11137
|
+
let e = G === "restore" ? ce : fe, n = G === "restore" ? le : q;
|
|
11138
11138
|
return /* @__PURE__ */ t.createElement(Po, {
|
|
11139
|
-
variant:
|
|
11140
|
-
timeout:
|
|
11141
|
-
onClose:
|
|
11142
|
-
}, /* @__PURE__ */ t.createElement("div", { className: "flex items-start justify-between gap-3" }, /* @__PURE__ */ t.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ t.createElement("div", { className: "font-medium" }, e), /* @__PURE__ */ t.createElement("div", { className: "text-sm opacity-90" }, n)), /* @__PURE__ */ t.createElement("div", { className: "flex shrink-0 items-center gap-2" },
|
|
11139
|
+
variant: G === "restore" ? "warning" : "info",
|
|
11140
|
+
timeout: G === "restored" ? 6e3 : void 0,
|
|
11141
|
+
onClose: G === "restored" ? () => ne(null) : void 0
|
|
11142
|
+
}, /* @__PURE__ */ t.createElement("div", { className: "flex items-start justify-between gap-3" }, /* @__PURE__ */ t.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ t.createElement("div", { className: "font-medium" }, e), /* @__PURE__ */ t.createElement("div", { className: "text-sm opacity-90" }, n)), /* @__PURE__ */ t.createElement("div", { className: "flex shrink-0 items-center gap-2" }, G === "restore" ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(Br, {
|
|
11143
11143
|
label: ue,
|
|
11144
11144
|
variant: "warning",
|
|
11145
11145
|
onClick: () => Ae()
|
|
@@ -11155,7 +11155,7 @@ var cd = (e) => {
|
|
|
11155
11155
|
}, [
|
|
11156
11156
|
ke,
|
|
11157
11157
|
de,
|
|
11158
|
-
|
|
11158
|
+
G,
|
|
11159
11159
|
ue,
|
|
11160
11160
|
le,
|
|
11161
11161
|
ce,
|
|
@@ -11167,17 +11167,17 @@ var cd = (e) => {
|
|
|
11167
11167
|
case "empty": return /* @__PURE__ */ t.createElement(t.Fragment, null, Ge, Ue, We);
|
|
11168
11168
|
default: return /* @__PURE__ */ t.createElement(ki, {
|
|
11169
11169
|
header: i || /* @__PURE__ */ t.createElement(Qi, {
|
|
11170
|
-
rootItem:
|
|
11170
|
+
rootItem: U ? N.headerAdd : N.headerEdit,
|
|
11171
11171
|
trail: o || void 0
|
|
11172
11172
|
}),
|
|
11173
|
-
footer: (a || !
|
|
11173
|
+
footer: (a || !U || g || _ || w || !!o) && /* @__PURE__ */ t.createElement(t.Fragment, null, a, We, (g || !!o || !U) && /* @__PURE__ */ t.createElement(zr, {
|
|
11174
11174
|
className: X(j.Form.buttonSaveClass, F.saveDisabled && "cursor-not-allowed opacity-50"),
|
|
11175
11175
|
label: N.buttonSave,
|
|
11176
11176
|
title: F.saveDisabled && !oe ? se : void 0,
|
|
11177
11177
|
disabled: F.saveDisabled,
|
|
11178
11178
|
loading: F.isSaving,
|
|
11179
11179
|
onClick: (e) => F.save(e)
|
|
11180
|
-
}), (_ || !
|
|
11180
|
+
}), (_ || !U) && /* @__PURE__ */ t.createElement(zr, {
|
|
11181
11181
|
className: j.Form.buttonDeleteClass,
|
|
11182
11182
|
label: N.buttonDelete,
|
|
11183
11183
|
disabled: F.deleteDisabled,
|
|
@@ -11208,7 +11208,7 @@ var cd = (e) => {
|
|
|
11208
11208
|
i,
|
|
11209
11209
|
E,
|
|
11210
11210
|
oe,
|
|
11211
|
-
|
|
11211
|
+
U,
|
|
11212
11212
|
se,
|
|
11213
11213
|
We,
|
|
11214
11214
|
_,
|
|
@@ -11479,15 +11479,15 @@ function Dd(e, t) {
|
|
|
11479
11479
|
//#endregion
|
|
11480
11480
|
//#region src/components/ui/Table.tsx
|
|
11481
11481
|
function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRowClick: i = void 0, onReorder: a = void 0, onSelectionChange: o = void 0, selection: c = "multiple", sortable: d = !1, pagination: f = void 0, activeKey: g = void 0, selectedKeys: _ = void 0, groupBy: v = void 0, recordId: y = void 0, before: b = void 0, after: x = void 0, wrapperClassName: S = void 0, className: C = void 0, headerClassName: w = void 0, bodyClassName: T = void 0, footerClassName: A = void 0, heightClassName: j = void 0, scrollClassName: M = void 0, selectedClassName: N = void 0, renderCell: P = void 0 }) {
|
|
11482
|
-
let F = Y("table"), I = Nn("table"), L = N || F.Table.selectedClassName, [R,
|
|
11482
|
+
let F = Y("table"), I = Nn("table"), L = N || F.Table.selectedClassName, [R, z] = h(n || []), B = p(() => {
|
|
11483
11483
|
if (!(!d || typeof d == "boolean")) return d;
|
|
11484
|
-
}, [typeof d == "object" ? d?.dir : void 0, typeof d == "object" ? d?.field : void 0]),
|
|
11485
|
-
e &&
|
|
11486
|
-
}, []), le = u(), ue = !!a, de =
|
|
11484
|
+
}, [typeof d == "object" ? d?.dir : void 0, typeof d == "object" ? d?.field : void 0]), V = d !== !1, [H, U] = h(B), [W, ee] = h(null), [te, G] = h(null), [ne, re] = h(null), [K, ie] = h(null), [ae, oe] = h(null), se = m(!1), ce = s((e) => {
|
|
11485
|
+
e && ee(e);
|
|
11486
|
+
}, []), le = u(), ue = !!a, de = V || !!Ls.normalize(B), fe = ue && de, q = !fe && V, pe = fe ? void 0 : B;
|
|
11487
11487
|
l(() => {
|
|
11488
|
-
|
|
11488
|
+
z(n || []);
|
|
11489
11489
|
}, [n]), l(() => {
|
|
11490
|
-
|
|
11490
|
+
U(pe);
|
|
11491
11491
|
}, [pe?.field, pe?.dir]), l(() => {
|
|
11492
11492
|
!fe || se.current || (console.warn("Table: `onReorder` cannot be combined with sortable sorting on the same view. Manual reorder takes precedence and sorting is ignored."), se.current = !0);
|
|
11493
11493
|
}, [fe]);
|
|
@@ -11504,19 +11504,19 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11504
11504
|
he,
|
|
11505
11505
|
R
|
|
11506
11506
|
]), l(() => {
|
|
11507
|
-
if (
|
|
11507
|
+
if (H || !e?.length || ue) return;
|
|
11508
11508
|
let t = e.find((e) => q && e.sort !== !1);
|
|
11509
|
-
t &&
|
|
11509
|
+
t && U({
|
|
11510
11510
|
field: t.key,
|
|
11511
11511
|
dir: "asc"
|
|
11512
11512
|
});
|
|
11513
11513
|
}, [
|
|
11514
|
-
|
|
11514
|
+
H,
|
|
11515
11515
|
q,
|
|
11516
11516
|
e,
|
|
11517
11517
|
ue
|
|
11518
11518
|
]);
|
|
11519
|
-
let be = p(() => Ls.records(R,
|
|
11519
|
+
let be = p(() => Ls.records(R, H) || [], [R, H]), xe = (e, t, n) => {
|
|
11520
11520
|
let r = e.target;
|
|
11521
11521
|
for (; r && r.tagName !== "TR";) {
|
|
11522
11522
|
if ([
|
|
@@ -11533,53 +11533,53 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11533
11533
|
if (P) return P(e, n, r);
|
|
11534
11534
|
let i = e[n], a = typeof i == "object" && i && !Array.isArray(i) ? i : null, o = a?.prompt && a?.value || i;
|
|
11535
11535
|
return t.isValidElement(o) || typeof o != "object" || !o ? o : Array.isArray(o) && !o.some((e) => typeof e == "object" && e) ? o.join(", ") : "";
|
|
11536
|
-
},
|
|
11536
|
+
}, Ce = s((e, t) => {
|
|
11537
11537
|
let n = he(e, t), r = ge.includes(n) ? ge.filter((e) => e !== n) : [...ge, n];
|
|
11538
11538
|
ye(r);
|
|
11539
11539
|
}, [
|
|
11540
11540
|
ge,
|
|
11541
11541
|
he,
|
|
11542
11542
|
ye
|
|
11543
|
-
]),
|
|
11543
|
+
]), we = s((e, t) => {
|
|
11544
11544
|
let n = he(e, t);
|
|
11545
11545
|
ye(ge.includes(n) ? [] : [n]);
|
|
11546
11546
|
}, [
|
|
11547
11547
|
ge,
|
|
11548
11548
|
he,
|
|
11549
11549
|
ye
|
|
11550
|
-
]),
|
|
11551
|
-
if (!
|
|
11552
|
-
let n = be.findIndex((e, t) => he(e, t) ===
|
|
11553
|
-
re(null),
|
|
11550
|
+
]), Te = s((e, t) => {
|
|
11551
|
+
if (!te) return;
|
|
11552
|
+
let n = be.findIndex((e, t) => he(e, t) === te), r = be.findIndex((n, r) => he(n, r) === he(e, t));
|
|
11553
|
+
re(null), G(null);
|
|
11554
11554
|
let i = K?.position || "after";
|
|
11555
11555
|
if (ie(null), n < 0 || r < 0 || n === r) return;
|
|
11556
11556
|
let o = [...be], [s] = o.splice(n, 1), c = n < r ? r + (i === "after" ? 0 : -1) : r + +(i === "after");
|
|
11557
|
-
o.splice(c, 0, s),
|
|
11557
|
+
o.splice(c, 0, s), U(void 0), z(o), a?.(o, {
|
|
11558
11558
|
fromIndex: n,
|
|
11559
11559
|
toIndex: c,
|
|
11560
11560
|
record: s
|
|
11561
11561
|
});
|
|
11562
11562
|
}, [
|
|
11563
|
-
|
|
11563
|
+
te,
|
|
11564
11564
|
K?.position,
|
|
11565
11565
|
he,
|
|
11566
11566
|
a,
|
|
11567
11567
|
be
|
|
11568
11568
|
]);
|
|
11569
11569
|
if (be.length === 0) return /* @__PURE__ */ t.createElement("p", { className: "p-4" }, I.noDataFound);
|
|
11570
|
-
let
|
|
11570
|
+
let Ee = e || Object.keys(be[0]).map((e) => ({
|
|
11571
11571
|
key: e,
|
|
11572
11572
|
label: e,
|
|
11573
|
-
sort:
|
|
11574
|
-
})),
|
|
11573
|
+
sort: V
|
|
11574
|
+
})), De = [
|
|
11575
11575
|
"w-full",
|
|
11576
11576
|
F.Table.scrollClassName,
|
|
11577
11577
|
j ? `${j} overflow-auto` : "",
|
|
11578
11578
|
M || ""
|
|
11579
|
-
].filter(Boolean).join(" "),
|
|
11579
|
+
].filter(Boolean).join(" "), Oe = !!j, J = Ee.length + +!!ve + +!!ue, ke = Oe ? "sticky top-0 z-10 bg-card" : "", Ae = (e, n, r, i) => !K || K.key !== e || K.position !== n ? null : /* @__PURE__ */ t.createElement("tr", {
|
|
11580
11580
|
"aria-hidden": "true",
|
|
11581
11581
|
onDragOver: (t) => {
|
|
11582
|
-
ue && (t.preventDefault(),
|
|
11582
|
+
ue && (t.preventDefault(), ne !== e && re(e), ie({
|
|
11583
11583
|
key: e,
|
|
11584
11584
|
position: n
|
|
11585
11585
|
}));
|
|
@@ -11588,10 +11588,10 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11588
11588
|
ue && (t.preventDefault(), ie({
|
|
11589
11589
|
key: e,
|
|
11590
11590
|
position: n
|
|
11591
|
-
}),
|
|
11591
|
+
}), Te(r, i));
|
|
11592
11592
|
}
|
|
11593
11593
|
}, /* @__PURE__ */ t.createElement("td", {
|
|
11594
|
-
colSpan:
|
|
11594
|
+
colSpan: J,
|
|
11595
11595
|
className: "border-0 p-0"
|
|
11596
11596
|
}, /* @__PURE__ */ t.createElement("div", { className: "relative h-5 cursor-grab" }, /* @__PURE__ */ t.createElement("div", { className: "absolute inset-x-2 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ t.createElement("div", { className: "h-0 rounded-full border-t-2 border-primary/80" }), /* @__PURE__ */ t.createElement("div", { className: "absolute left-0 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full bg-primary shadow-sm" }))))), je = /* @__PURE__ */ t.createElement("tr", null, ve && /* @__PURE__ */ t.createElement("th", {
|
|
11597
11597
|
className: ["px-3 py-2 font-semibold text-muted-foreground", ke].filter(Boolean).join(" "),
|
|
@@ -11613,8 +11613,8 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11613
11613
|
width: "1%",
|
|
11614
11614
|
whiteSpace: "nowrap"
|
|
11615
11615
|
}
|
|
11616
|
-
}, /* @__PURE__ */ t.createElement("div", { className: "th-inner py-1" })),
|
|
11617
|
-
let n = q && e.sort !== !1, r = n &&
|
|
11616
|
+
}, /* @__PURE__ */ t.createElement("div", { className: "th-inner py-1" })), Ee.map((e) => e.label ? (() => {
|
|
11617
|
+
let n = q && e.sort !== !1, r = n && H?.field === e.key, i = r ? H?.dir === "desc" ? "descending" : "ascending" : "none";
|
|
11618
11618
|
return /* @__PURE__ */ t.createElement("th", {
|
|
11619
11619
|
key: e.key,
|
|
11620
11620
|
className: [
|
|
@@ -11626,16 +11626,16 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11626
11626
|
}, n ? /* @__PURE__ */ t.createElement("button", {
|
|
11627
11627
|
type: "button",
|
|
11628
11628
|
className: "th-inner group inline-flex w-full cursor-pointer items-center gap-2 rounded-sm border-0 bg-transparent px-0 py-1 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 " + (r ? "font-semibold text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
11629
|
-
onClick: () =>
|
|
11629
|
+
onClick: () => U((t) => Ls.toggle(t, e.key)),
|
|
11630
11630
|
"aria-label": r ? Tn(I.sortByCurrent, {
|
|
11631
11631
|
label: e.label,
|
|
11632
|
-
direction:
|
|
11632
|
+
direction: H?.dir === "desc" ? "descending" : "ascending"
|
|
11633
11633
|
}) : Tn(I.sortBy, { label: e.label }),
|
|
11634
|
-
title: r ? `${e.label}: ${
|
|
11634
|
+
title: r ? `${e.label}: ${H?.dir === "desc" ? "descending" : "ascending"}` : Tn(I.sortBy, { label: e.label })
|
|
11635
11635
|
}, /* @__PURE__ */ t.createElement("span", {
|
|
11636
11636
|
className: "inline-flex h-4 w-4 flex-none items-center justify-center transition-colors " + (r ? "text-primary" : "text-muted-foreground/70 group-hover:text-foreground/80"),
|
|
11637
11637
|
"aria-hidden": "true"
|
|
11638
|
-
}, r ?
|
|
11638
|
+
}, r ? H?.dir === "desc" ? /* @__PURE__ */ t.createElement(E, { size: 14 }) : /* @__PURE__ */ t.createElement(D, { size: 14 }) : /* @__PURE__ */ t.createElement(O, { size: 14 })), /* @__PURE__ */ t.createElement("span", null, e.label)) : /* @__PURE__ */ t.createElement("div", { className: "th-inner py-1" }, e.label));
|
|
11639
11639
|
})() : /* @__PURE__ */ t.createElement("th", {
|
|
11640
11640
|
key: e.key,
|
|
11641
11641
|
className: ["px-3 py-2 font-semibold text-muted-foreground", ke].filter(Boolean).join(" "),
|
|
@@ -11645,7 +11645,7 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11645
11645
|
}
|
|
11646
11646
|
}))), Me = /* @__PURE__ */ t.createElement(Hp, {
|
|
11647
11647
|
records: be,
|
|
11648
|
-
appendTo:
|
|
11648
|
+
appendTo: W,
|
|
11649
11649
|
wrapperClassName: "px-3 pt-4 pb-2",
|
|
11650
11650
|
...f || {}
|
|
11651
11651
|
}, (e, n) => {
|
|
@@ -11653,9 +11653,9 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11653
11653
|
return e.map((e, o) => {
|
|
11654
11654
|
let s = n + o, l = he(e, s), u = r ? r.map((t) => String(e[t] ?? "")).join(" · ") : void 0, d = u !== void 0 && u !== a;
|
|
11655
11655
|
a = u;
|
|
11656
|
-
let f = ge.includes(l), p =
|
|
11656
|
+
let f = ge.includes(l), p = ne === l, m = te === l, h = L && (g === void 0 ? ae : g) === l;
|
|
11657
11657
|
return /* @__PURE__ */ t.createElement(t.Fragment, { key: l }, d && /* @__PURE__ */ t.createElement("tr", { "aria-hidden": "true" }, /* @__PURE__ */ t.createElement("td", {
|
|
11658
|
-
colSpan:
|
|
11658
|
+
colSpan: J,
|
|
11659
11659
|
className: "bg-muted/40 px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground"
|
|
11660
11660
|
}, u)), Ae(l, "before", e, s), /* @__PURE__ */ t.createElement("tr", {
|
|
11661
11661
|
draggable: ue,
|
|
@@ -11672,25 +11672,25 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11672
11672
|
i && xe(t, e, s);
|
|
11673
11673
|
},
|
|
11674
11674
|
onDragStart: () => {
|
|
11675
|
-
|
|
11675
|
+
G(l);
|
|
11676
11676
|
},
|
|
11677
11677
|
onDragOver: (e) => {
|
|
11678
11678
|
if (!ue) return;
|
|
11679
11679
|
e.preventDefault();
|
|
11680
11680
|
let t = e.currentTarget.getBoundingClientRect(), n = e.clientY < t.top + t.height / 2 ? "before" : "after";
|
|
11681
|
-
|
|
11681
|
+
ne !== l && re(l), te !== l && ie((e) => e?.key === l && e.position === n ? e : {
|
|
11682
11682
|
key: l,
|
|
11683
11683
|
position: n
|
|
11684
11684
|
});
|
|
11685
11685
|
},
|
|
11686
11686
|
onDragLeave: () => {
|
|
11687
|
-
|
|
11687
|
+
ne === l && re(null);
|
|
11688
11688
|
},
|
|
11689
11689
|
onDragEnd: () => {
|
|
11690
|
-
|
|
11690
|
+
G(null), re(null), ie(null);
|
|
11691
11691
|
},
|
|
11692
11692
|
onDrop: (t) => {
|
|
11693
|
-
ue && (t.preventDefault(),
|
|
11693
|
+
ue && (t.preventDefault(), Te(e, s));
|
|
11694
11694
|
}
|
|
11695
11695
|
}, ve && /* @__PURE__ */ t.createElement("td", {
|
|
11696
11696
|
className: "px-3 py-2 border-b border-border/50",
|
|
@@ -11705,13 +11705,13 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11705
11705
|
checked: f,
|
|
11706
11706
|
onChange: () => {
|
|
11707
11707
|
if (c === "single") {
|
|
11708
|
-
|
|
11708
|
+
we(e, s);
|
|
11709
11709
|
return;
|
|
11710
11710
|
}
|
|
11711
|
-
|
|
11711
|
+
Ce(e, s);
|
|
11712
11712
|
},
|
|
11713
11713
|
onClick: (t) => {
|
|
11714
|
-
t.stopPropagation(), c === "single" && (t.preventDefault(),
|
|
11714
|
+
t.stopPropagation(), c === "single" && (t.preventDefault(), we(e, s));
|
|
11715
11715
|
}
|
|
11716
11716
|
})), ue && /* @__PURE__ */ t.createElement("td", {
|
|
11717
11717
|
className: "px-3 py-2 border-b border-border/50",
|
|
@@ -11726,12 +11726,12 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11726
11726
|
"aria-label": Tn(I.reorderRow, { key: l }),
|
|
11727
11727
|
onClick: (e) => e.preventDefault(),
|
|
11728
11728
|
onDragStart: (e) => {
|
|
11729
|
-
e.stopPropagation(),
|
|
11729
|
+
e.stopPropagation(), G(l);
|
|
11730
11730
|
},
|
|
11731
11731
|
onDragEnd: (e) => {
|
|
11732
|
-
e.stopPropagation(),
|
|
11732
|
+
e.stopPropagation(), G(null), re(null), ie(null);
|
|
11733
11733
|
}
|
|
11734
|
-
}, /* @__PURE__ */ t.createElement(k, { size: 14 }))),
|
|
11734
|
+
}, /* @__PURE__ */ t.createElement(k, { size: 14 }))), Ee.map((n) => /* @__PURE__ */ t.createElement("td", {
|
|
11735
11735
|
key: n.key,
|
|
11736
11736
|
className: "px-3 py-2 border-b border-border/50"
|
|
11737
11737
|
}, Se(e, n.key, s)))), Ae(l, "after", e, s));
|
|
@@ -11740,7 +11740,7 @@ function Od({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
11740
11740
|
return /* @__PURE__ */ t.createElement("div", { className: "flex items-stretch gap-3" }, b && /* @__PURE__ */ t.createElement("div", { className: "table-before flex shrink-0 items-center self-stretch" }, b), /* @__PURE__ */ t.createElement("div", {
|
|
11741
11741
|
ref: ce,
|
|
11742
11742
|
className: "min-w-0 flex-1 overflow-x-auto " + (S || F.Table.wrapperClassName)
|
|
11743
|
-
}, /* @__PURE__ */ t.createElement("div", { className:
|
|
11743
|
+
}, /* @__PURE__ */ t.createElement("div", { className: De }, /* @__PURE__ */ t.createElement("table", { className: "w-full text-left text-sm border-collapse " + (C || F.Table.className) }, /* @__PURE__ */ t.createElement("thead", { className: "border-b " + (w || F.Table.headerClassName) }, je), /* @__PURE__ */ t.createElement("tbody", { className: T || F.Table.bodyClassName }, Me), r && /* @__PURE__ */ t.createElement("tfoot", { className: A || F.Table.footerClassName }, r)))), x && /* @__PURE__ */ t.createElement("div", { className: "table-after flex shrink-0 items-center self-stretch" }, x));
|
|
11744
11744
|
}
|
|
11745
11745
|
//#endregion
|
|
11746
11746
|
//#region src/components/ui/LayoutBuilder.tsx
|
|
@@ -12082,13 +12082,13 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12082
12082
|
name: k.formatted,
|
|
12083
12083
|
wrapperClassName: x,
|
|
12084
12084
|
inheritWrapperClassName: b
|
|
12085
|
-
}), j = rd({ name: k.street }), M = rd({ name: k.city }), N = rd({ name: k.state }), P = rd({ name: k.zip }), F = rd({ name: k.country }), I = rd({ name: k.countryCode }), L = rd({ name: k.lat }), R = rd({ name: k.lng }),
|
|
12085
|
+
}), j = rd({ name: k.street }), M = rd({ name: k.city }), N = rd({ name: k.state }), P = rd({ name: k.zip }), F = rd({ name: k.country }), I = rd({ name: k.countryCode }), L = rd({ name: k.lat }), R = rd({ name: k.lng }), z = rd({ name: k.zoom }), B = nd(e, {
|
|
12086
12086
|
required: r,
|
|
12087
12087
|
label: n,
|
|
12088
12088
|
validator: f
|
|
12089
|
-
}),
|
|
12089
|
+
}), V = u(), H = v ?? V, U = typeof _ == "object" ? _ : {}, W = !!_, ee = U.position ?? "below", te = U.defaultZoom ?? 15, G = U.height ?? 240, [ne, re] = h(typeof A.value == "string" ? A.value : ""), [K, ie] = h([]), [ae, oe] = h(!1), [se, ce] = h(!1), [le, ue] = h(null), de = m(void 0), fe = m(0), q = m(null), pe = m(null), me = m(void 0), he = m(void 0), ge = m(void 0), _e = m(void 0), ve = m(!1);
|
|
12090
12090
|
l(() => {
|
|
12091
|
-
typeof A.value == "string" && A.value !==
|
|
12091
|
+
typeof A.value == "string" && A.value !== ne && re(A.value);
|
|
12092
12092
|
}, [A.value]), l(() => {
|
|
12093
12093
|
if (!ae) return;
|
|
12094
12094
|
let e = (e) => {
|
|
@@ -12097,7 +12097,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12097
12097
|
return window.document.addEventListener("pointerdown", e), () => window.document.removeEventListener("pointerdown", e);
|
|
12098
12098
|
}, [ae]), l(() => {
|
|
12099
12099
|
if (!O) return;
|
|
12100
|
-
let e = ++fe.current, t =
|
|
12100
|
+
let e = ++fe.current, t = ne.trim();
|
|
12101
12101
|
if (t.length < 3) {
|
|
12102
12102
|
ie([]), ce(!1);
|
|
12103
12103
|
return;
|
|
@@ -12135,10 +12135,10 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12135
12135
|
})();
|
|
12136
12136
|
}, 250);
|
|
12137
12137
|
return () => window.clearTimeout(n);
|
|
12138
|
-
}, [
|
|
12138
|
+
}, [ne, O]);
|
|
12139
12139
|
let ye = (e, t) => {
|
|
12140
12140
|
ve.current = !0;
|
|
12141
|
-
let n = e.formatted ??
|
|
12141
|
+
let n = e.formatted ?? ne;
|
|
12142
12142
|
re(n), A.handleChange({ target: {
|
|
12143
12143
|
name: k.formatted,
|
|
12144
12144
|
value: n
|
|
@@ -12166,7 +12166,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12166
12166
|
} }), e.lng !== void 0 && R.handleChange({ target: {
|
|
12167
12167
|
name: k.lng,
|
|
12168
12168
|
value: e.lng
|
|
12169
|
-
} }), t !== void 0 &&
|
|
12169
|
+
} }), t !== void 0 && z.handleChange({ target: {
|
|
12170
12170
|
name: k.zoom,
|
|
12171
12171
|
value: t
|
|
12172
12172
|
} }), p?.(e);
|
|
@@ -12248,7 +12248,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12248
12248
|
F.value,
|
|
12249
12249
|
O
|
|
12250
12250
|
]), l(() => {
|
|
12251
|
-
if (!
|
|
12251
|
+
if (!W || !O || !pe.current || he.current) return;
|
|
12252
12252
|
let e = !1;
|
|
12253
12253
|
return Gd({
|
|
12254
12254
|
apiKey: O.apiKey,
|
|
@@ -12260,7 +12260,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12260
12260
|
let n = typeof L.value == "number" && typeof R.value == "number", r = n ? {
|
|
12261
12261
|
lat: L.value,
|
|
12262
12262
|
lng: R.value
|
|
12263
|
-
} : Kd, i = typeof
|
|
12263
|
+
} : Kd, i = typeof z.value == "number" ? z.value : n ? te : qd, a = new t.maps.Map(pe.current, {
|
|
12264
12264
|
center: r,
|
|
12265
12265
|
zoom: i,
|
|
12266
12266
|
streetViewControl: !1,
|
|
@@ -12275,7 +12275,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12275
12275
|
e.latLng && (xe(t, e.latLng), Se(e.latLng));
|
|
12276
12276
|
}), a.addListener("zoom_changed", () => {
|
|
12277
12277
|
let e = a.getZoom();
|
|
12278
|
-
typeof e == "number" &&
|
|
12278
|
+
typeof e == "number" && z.handleChange({ target: {
|
|
12279
12279
|
name: k.zoom,
|
|
12280
12280
|
value: e
|
|
12281
12281
|
} });
|
|
@@ -12285,8 +12285,8 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12285
12285
|
}), () => {
|
|
12286
12286
|
e = !0;
|
|
12287
12287
|
};
|
|
12288
|
-
}, [
|
|
12289
|
-
let
|
|
12288
|
+
}, [W, O]);
|
|
12289
|
+
let Ce = async (e) => {
|
|
12290
12290
|
oe(!1);
|
|
12291
12291
|
try {
|
|
12292
12292
|
let t = e.prediction.toPlace();
|
|
@@ -12296,11 +12296,11 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12296
12296
|
"formattedAddress"
|
|
12297
12297
|
] });
|
|
12298
12298
|
let n = Qd(t);
|
|
12299
|
-
ye(n,
|
|
12299
|
+
ye(n, W ? te : void 0);
|
|
12300
12300
|
let r = me.current;
|
|
12301
|
-
if (
|
|
12301
|
+
if (W && r && he.current && n.lat !== void 0 && n.lng !== void 0) {
|
|
12302
12302
|
let e = new r.maps.LatLng(n.lat, n.lng);
|
|
12303
|
-
he.current.setCenter(e), he.current.setZoom(
|
|
12303
|
+
he.current.setCenter(e), he.current.setZoom(te), xe(r, e);
|
|
12304
12304
|
}
|
|
12305
12305
|
de.current = void 0, ue(null);
|
|
12306
12306
|
} catch (e) {
|
|
@@ -12310,40 +12310,40 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12310
12310
|
if (!O) return /* @__PURE__ */ t.createElement(Z, { className: A.formWrapClass }, n && /* @__PURE__ */ t.createElement(js, {
|
|
12311
12311
|
label: n,
|
|
12312
12312
|
required: r,
|
|
12313
|
-
htmlFor:
|
|
12313
|
+
htmlFor: H,
|
|
12314
12314
|
className: y
|
|
12315
12315
|
}), /* @__PURE__ */ t.createElement("input", {
|
|
12316
|
-
id:
|
|
12316
|
+
id: H,
|
|
12317
12317
|
disabled: !0,
|
|
12318
12318
|
className: X(ns, S || D.AddressAutocomplete.className),
|
|
12319
12319
|
placeholder: E.notConfigured,
|
|
12320
12320
|
title: E.notConfigured
|
|
12321
12321
|
}), /* @__PURE__ */ t.createElement("div", { className: ts }, E.notConfigured));
|
|
12322
|
-
let
|
|
12322
|
+
let we = W ? /* @__PURE__ */ t.createElement("div", {
|
|
12323
12323
|
ref: pe,
|
|
12324
12324
|
className: X("mt-2 w-full overflow-hidden rounded-md border", T),
|
|
12325
|
-
style: { height:
|
|
12325
|
+
style: { height: G }
|
|
12326
12326
|
}) : null;
|
|
12327
12327
|
return /* @__PURE__ */ t.createElement(Z, { className: A.formWrapClass || D.AddressAutocomplete.wrapperClassName }, n && /* @__PURE__ */ t.createElement(js, {
|
|
12328
12328
|
label: n,
|
|
12329
12329
|
required: r,
|
|
12330
|
-
htmlFor:
|
|
12330
|
+
htmlFor: H,
|
|
12331
12331
|
className: y
|
|
12332
|
-
}),
|
|
12332
|
+
}), ee === "above" && we, /* @__PURE__ */ t.createElement("div", {
|
|
12333
12333
|
ref: q,
|
|
12334
12334
|
className: "relative"
|
|
12335
12335
|
}, /* @__PURE__ */ t.createElement("input", {
|
|
12336
|
-
id:
|
|
12336
|
+
id: H,
|
|
12337
12337
|
type: "text",
|
|
12338
12338
|
role: "combobox",
|
|
12339
12339
|
"aria-expanded": ae,
|
|
12340
12340
|
"aria-autocomplete": "list",
|
|
12341
12341
|
autoComplete: "off",
|
|
12342
|
-
className: X(ns, "pr-8",
|
|
12342
|
+
className: X(ns, "pr-8", B && "border-destructive focus-visible:ring-destructive/20", S || D.AddressAutocomplete.className),
|
|
12343
12343
|
placeholder: i ?? E.placeholder,
|
|
12344
12344
|
required: r,
|
|
12345
12345
|
disabled: a,
|
|
12346
|
-
value:
|
|
12346
|
+
value: ne,
|
|
12347
12347
|
onChange: (e) => {
|
|
12348
12348
|
re(e.target.value), oe(!0);
|
|
12349
12349
|
},
|
|
@@ -12352,18 +12352,18 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12352
12352
|
name: se ? "loader-circle" : "map-pin",
|
|
12353
12353
|
size: 15,
|
|
12354
12354
|
className: se ? "animate-spin" : void 0
|
|
12355
|
-
})), ae &&
|
|
12355
|
+
})), ae && ne.trim().length >= 3 && /* @__PURE__ */ t.createElement("div", { className: X("absolute z-50 mt-1 max-h-64 w-full overflow-y-auto rounded-md border p-1 text-sm shadow-lg", C || D.AddressAutocomplete.menuClassName) }, le ? /* @__PURE__ */ t.createElement("div", { className: "px-2 py-3 text-center text-destructive" }, le) : se && K.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-2 py-3 text-center text-muted-foreground" }, E.searching) : K.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-2 py-3 text-center text-muted-foreground" }, E.noResults) : K.map((e) => /* @__PURE__ */ t.createElement("button", {
|
|
12356
12356
|
key: e.id,
|
|
12357
12357
|
type: "button",
|
|
12358
12358
|
className: X("flex w-full items-start gap-2 rounded-sm px-2 py-1.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground", w || D.AddressAutocomplete.itemClassName),
|
|
12359
12359
|
onClick: () => {
|
|
12360
|
-
|
|
12360
|
+
Ce(e);
|
|
12361
12361
|
}
|
|
12362
12362
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
12363
12363
|
name: "map-pin",
|
|
12364
12364
|
size: 14,
|
|
12365
12365
|
className: "mt-0.5 shrink-0 text-muted-foreground"
|
|
12366
|
-
}), /* @__PURE__ */ t.createElement("span", { className: "min-w-0 truncate" }, e.text))))),
|
|
12366
|
+
}), /* @__PURE__ */ t.createElement("span", { className: "min-w-0 truncate" }, e.text))))), ee === "below" && we, B ? /* @__PURE__ */ t.createElement(ps, { message: B }) : o && /* @__PURE__ */ t.createElement("div", { className: "mt-1 text-xs text-muted-foreground" }, o));
|
|
12367
12367
|
}, tf = ({ name: e, onDataLoaded: n, onClear: r = void 0, onParseField: i = void 0, label: a = void 0, icon: o = "upload", delimiter: s = void 0, normalizeKeys: c = !1, removeEmptyFields: l = !1, required: u = !1, before: d = void 0, after: f = void 0, wrapperClassName: p = void 0, className: g = void 0 }) => {
|
|
12368
12368
|
let _ = Nn("upload"), [v, y] = h(null), [b, x] = h(!1), [S, C] = h(null), w = m(null), T = ([e, t]) => {
|
|
12369
12369
|
if (![
|
|
@@ -12372,7 +12372,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
12372
12372
|
void 0
|
|
12373
12373
|
].includes(e) && t !== void 0 && !(l && ["", null].includes(t))) return c && (e = ct(e)), i ? i([e, t]) : [e.trim(), Pt(t)];
|
|
12374
12374
|
}, E = (e) => {
|
|
12375
|
-
e &&
|
|
12375
|
+
e && Oe.parse(e, {
|
|
12376
12376
|
header: !0,
|
|
12377
12377
|
skipEmptyLines: !0,
|
|
12378
12378
|
delimiter: s,
|
|
@@ -13072,13 +13072,13 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13072
13072
|
a
|
|
13073
13073
|
] : a;
|
|
13074
13074
|
}
|
|
13075
|
-
}), { Table: A, TableRow: j, TableHeader: M, TableCell: N } = e[6], P = e[7].default, F = e[8].default, [I, L] = h(!1), [R,
|
|
13075
|
+
}), { Table: A, TableRow: j, TableHeader: M, TableCell: N } = e[6], P = e[7].default, F = e[8].default, [I, L] = h(!1), [R, z] = h(""), [B, V] = h([]), [H, U] = h(null), [, W] = t.useReducer((e) => e + 1, 0), ee = m(null), te = m(null), [G, ne] = h({
|
|
13076
13076
|
open: !1,
|
|
13077
13077
|
query: "",
|
|
13078
13078
|
anchorPosition: null,
|
|
13079
13079
|
editorContext: null
|
|
13080
|
-
}), re = m(
|
|
13081
|
-
re.current =
|
|
13080
|
+
}), re = m(G);
|
|
13081
|
+
re.current = G;
|
|
13082
13082
|
let K = x?.length ? S ?? "/" : void 0, ie = (x?.length ?? 0) >= 10, ae = t.useMemo(() => new Map((x ?? []).map((e) => [e.name, e])), [x]), oe = t.useMemo(() => (x ?? []).map((e) => ({
|
|
13083
13083
|
key: e.name,
|
|
13084
13084
|
label: `${K ?? "/"}${e.name}`,
|
|
@@ -13089,7 +13089,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13089
13089
|
srcsetWidths: se,
|
|
13090
13090
|
onFileReady: (e) => {
|
|
13091
13091
|
let t = e.fileName.replace(/\.[^/.]+$/, "").replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim().replace(/^(.)/, (e) => e.toUpperCase()), n = e.url || (e.base64 ? `data:${e.type};base64,${e.base64}` : "");
|
|
13092
|
-
|
|
13092
|
+
V((r) => [...r, {
|
|
13093
13093
|
fileProps: e,
|
|
13094
13094
|
preview: n,
|
|
13095
13095
|
defaultAlt: t
|
|
@@ -13100,7 +13100,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13100
13100
|
maxHeight: p,
|
|
13101
13101
|
paddingOffset: 16
|
|
13102
13102
|
}), de = s(() => {
|
|
13103
|
-
|
|
13103
|
+
ne({
|
|
13104
13104
|
open: !1,
|
|
13105
13105
|
query: "",
|
|
13106
13106
|
anchorPosition: null,
|
|
@@ -13170,7 +13170,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13170
13170
|
let t = n.marks?.find((e) => e.type.name === "link");
|
|
13171
13171
|
t && (t.attrs.href && (e.href = t.attrs.href), t.attrs.target && (e.target = t.attrs.target));
|
|
13172
13172
|
}
|
|
13173
|
-
return
|
|
13173
|
+
return U({
|
|
13174
13174
|
pos: t,
|
|
13175
13175
|
attrs: e
|
|
13176
13176
|
}), !0;
|
|
@@ -13181,11 +13181,11 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13181
13181
|
handleKeyDown(e, t) {
|
|
13182
13182
|
if (!re.current.open) return !1;
|
|
13183
13183
|
switch (t.key) {
|
|
13184
|
-
case "ArrowDown": return t.preventDefault(),
|
|
13185
|
-
case "ArrowUp": return t.preventDefault(),
|
|
13184
|
+
case "ArrowDown": return t.preventDefault(), te.current?.moveNext(), !0;
|
|
13185
|
+
case "ArrowUp": return t.preventDefault(), te.current?.movePrev(), !0;
|
|
13186
13186
|
case "Enter":
|
|
13187
|
-
case "Tab": return t.preventDefault(),
|
|
13188
|
-
case "Escape": return t.preventDefault(),
|
|
13187
|
+
case "Tab": return t.preventDefault(), te.current?.selectActive(), !0;
|
|
13188
|
+
case "Escape": return t.preventDefault(), te.current?.close(), !0;
|
|
13189
13189
|
default: return !1;
|
|
13190
13190
|
}
|
|
13191
13191
|
}
|
|
@@ -13201,8 +13201,8 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13201
13201
|
q,
|
|
13202
13202
|
i
|
|
13203
13203
|
]), l(() => {
|
|
13204
|
-
if (q) return q.view.dom.style.minHeight = `${ue.adjustedMinHeight}px`, q.on("selectionUpdate",
|
|
13205
|
-
q.off("selectionUpdate",
|
|
13204
|
+
if (q) return q.view.dom.style.minHeight = `${ue.adjustedMinHeight}px`, q.on("selectionUpdate", W), () => {
|
|
13205
|
+
q.off("selectionUpdate", W);
|
|
13206
13206
|
};
|
|
13207
13207
|
}, [q, ue.adjustedMinHeight]), l(() => {
|
|
13208
13208
|
if (!q || !K || I) {
|
|
@@ -13230,7 +13230,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13230
13230
|
return;
|
|
13231
13231
|
}
|
|
13232
13232
|
let o = q.view.coordsAtPos(e.from), s = fe(q, K);
|
|
13233
|
-
!o || !s ||
|
|
13233
|
+
!o || !s || ne({
|
|
13234
13234
|
open: !0,
|
|
13235
13235
|
query: a.query,
|
|
13236
13236
|
anchorPosition: {
|
|
@@ -13261,7 +13261,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13261
13261
|
t.replace(t.triggerRange.start, t.triggerRange.end, `${t.trigger}${n.name} `);
|
|
13262
13262
|
}
|
|
13263
13263
|
}, [ae]), he = () => {
|
|
13264
|
-
q && (I ? q.commands.setContent(R) :
|
|
13264
|
+
q && (I ? q.commands.setContent(R) : z(q.getHTML()), L((e) => !e));
|
|
13265
13265
|
}, ge = (e) => new Promise((t) => {
|
|
13266
13266
|
let n = new FileReader();
|
|
13267
13267
|
n.onload = (e) => t(e.target?.result), n.readAsDataURL(e);
|
|
@@ -13302,7 +13302,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13302
13302
|
let t = [];
|
|
13303
13303
|
e.forEach(({ alt: e, href: n, target: r, enabled: i }, a) => {
|
|
13304
13304
|
if (!i) return;
|
|
13305
|
-
let o =
|
|
13305
|
+
let o = B[a];
|
|
13306
13306
|
if (!o) return;
|
|
13307
13307
|
le.handleRemove(o.fileProps.key);
|
|
13308
13308
|
let s = o.fileProps.url || o.preview, c = {
|
|
@@ -13324,10 +13324,10 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13324
13324
|
type: "image",
|
|
13325
13325
|
attrs: l
|
|
13326
13326
|
});
|
|
13327
|
-
}), t.length && q.chain().focus().insertContent(t).run(),
|
|
13327
|
+
}), t.length && q.chain().focus().insertContent(t).run(), V([]);
|
|
13328
13328
|
}, ye = s(async (e, t) => {
|
|
13329
13329
|
let n = "image.jpg";
|
|
13330
|
-
if (
|
|
13330
|
+
if (V((r) => (n = r[e]?.fileProps.fileName ?? "image.jpg", r.map((n, r) => r === e ? {
|
|
13331
13331
|
...n,
|
|
13332
13332
|
preview: t,
|
|
13333
13333
|
fileProps: {
|
|
@@ -13344,7 +13344,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13344
13344
|
url: s,
|
|
13345
13345
|
width: i
|
|
13346
13346
|
}]);
|
|
13347
|
-
|
|
13347
|
+
V((t) => t.map((t, n) => n === e ? {
|
|
13348
13348
|
...t,
|
|
13349
13349
|
fileProps: {
|
|
13350
13350
|
...t.fileProps,
|
|
@@ -13358,8 +13358,8 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13358
13358
|
ce,
|
|
13359
13359
|
g?.path
|
|
13360
13360
|
]), be = ({ src: e, alt: t, href: n, target: r }) => {
|
|
13361
|
-
if (!q || !
|
|
13362
|
-
let { pos: i, attrs: a } =
|
|
13361
|
+
if (!q || !H) return;
|
|
13362
|
+
let { pos: i, attrs: a } = H, o = q.state.doc.nodeAt(i);
|
|
13363
13363
|
if (o?.type.name === "image") {
|
|
13364
13364
|
let { tr: s, schema: c } = q.state, l = e !== void 0 && e !== a.src, u = {
|
|
13365
13365
|
...a,
|
|
@@ -13377,32 +13377,32 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13377
13377
|
target: r || "_blank"
|
|
13378
13378
|
})]) : p = d.filter((e) => e.type.name !== "link"), s.setNodeMarkup(i, null, u, p), q.view.dispatch(s);
|
|
13379
13379
|
}
|
|
13380
|
-
|
|
13380
|
+
U(null);
|
|
13381
13381
|
}, xe = u.filter((e) => e !== "imageUpload" && e !== "documentUpload" && e !== "sourceCode");
|
|
13382
|
-
return /* @__PURE__ */ t.createElement(t.Fragment, null,
|
|
13383
|
-
items:
|
|
13382
|
+
return /* @__PURE__ */ t.createElement(t.Fragment, null, B.length > 0 && /* @__PURE__ */ t.createElement(bf, {
|
|
13383
|
+
items: B,
|
|
13384
13384
|
onInsertAll: ve,
|
|
13385
13385
|
onCropSave: ye,
|
|
13386
13386
|
onCancel: () => {
|
|
13387
|
-
|
|
13387
|
+
B.forEach((e) => le.handleRemove(e.fileProps.key)), V([]);
|
|
13388
13388
|
}
|
|
13389
|
-
}),
|
|
13390
|
-
state:
|
|
13389
|
+
}), H && /* @__PURE__ */ t.createElement(xf, {
|
|
13390
|
+
state: H,
|
|
13391
13391
|
onConfirm: be,
|
|
13392
|
-
onCancel: () =>
|
|
13392
|
+
onCancel: () => U(null)
|
|
13393
13393
|
}), /* @__PURE__ */ t.createElement("div", { className: X("rounded-md border border-input bg-background shadow-sm transition-colors", "focus-within:ring-1 focus-within:ring-ring", v && "border-destructive focus-within:ring-destructive/20", o && "cursor-not-allowed opacity-50", y) }, c === "fixed" && q && /* @__PURE__ */ t.createElement(gf, {
|
|
13394
13394
|
editor: q,
|
|
13395
13395
|
commands: u,
|
|
13396
13396
|
sourceMode: I,
|
|
13397
13397
|
onImageUpload: le.handleUpload,
|
|
13398
|
-
onDocumentUpload: () =>
|
|
13398
|
+
onDocumentUpload: () => ee.current?.click(),
|
|
13399
13399
|
onSourceToggle: he
|
|
13400
13400
|
}), c === "floating" && q && /* @__PURE__ */ t.createElement(T, { editor: q }, /* @__PURE__ */ t.createElement("div", { className: "flex items-center gap-0.5 rounded-md border border-border bg-background px-1 py-0.5 shadow-lg" }, /* @__PURE__ */ t.createElement(gf, {
|
|
13401
13401
|
editor: q,
|
|
13402
13402
|
commands: xe,
|
|
13403
13403
|
sourceMode: I,
|
|
13404
13404
|
onImageUpload: le.handleUpload,
|
|
13405
|
-
onDocumentUpload: () =>
|
|
13405
|
+
onDocumentUpload: () => ee.current?.click(),
|
|
13406
13406
|
onSourceToggle: he,
|
|
13407
13407
|
compact: !0
|
|
13408
13408
|
}))), q && !I && /* @__PURE__ */ t.createElement(T, {
|
|
@@ -13462,21 +13462,21 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13462
13462
|
overflowY: "auto"
|
|
13463
13463
|
},
|
|
13464
13464
|
value: R,
|
|
13465
|
-
onChange: (e) =>
|
|
13465
|
+
onChange: (e) => z(e.target.value)
|
|
13466
13466
|
}) : (() => {
|
|
13467
13467
|
let e = /* @__PURE__ */ t.createElement("div", {
|
|
13468
13468
|
style: ue.wrapperStyle,
|
|
13469
13469
|
className: X("w-full px-3 py-2 text-sm", "[&_.ProseMirror]:outline-none", "[&_.ProseMirror_p]:my-1", "[&_.ProseMirror_h1]:my-2 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold", "[&_.ProseMirror_h2]:my-2 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold", "[&_.ProseMirror_h3]:my-1 [&_.ProseMirror_h3]:text-lg [&_.ProseMirror_h3]:font-semibold", "[&_.ProseMirror_ul]:list-disc [&_.ProseMirror_ul]:pl-6", "[&_.ProseMirror_ol]:list-decimal [&_.ProseMirror_ol]:pl-6", "[&_.ProseMirror_blockquote]:my-2 [&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:text-muted-foreground", "[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-xs", "[&_.ProseMirror_pre]:my-2 [&_.ProseMirror_pre]:overflow-x-auto [&_.ProseMirror_pre]:rounded [&_.ProseMirror_pre]:bg-muted [&_.ProseMirror_pre]:p-3", "[&_.ProseMirror_table]:w-full [&_.ProseMirror_table]:border-collapse", "[&_.ProseMirror_td]:border [&_.ProseMirror_td]:border-border [&_.ProseMirror_td]:px-2 [&_.ProseMirror_td]:py-1", "[&_.ProseMirror_th]:border [&_.ProseMirror_th]:border-border [&_.ProseMirror_th]:bg-muted [&_.ProseMirror_th]:px-2 [&_.ProseMirror_th]:py-1 [&_.ProseMirror_th]:font-semibold", "[&_.ProseMirror_a]:text-primary [&_.ProseMirror_a]:underline [&_.ProseMirror_a]:pointer-events-none", "[&_.ProseMirror_a_img]:pointer-events-auto", "[&_.ProseMirror_.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror_.is-editor-empty:first-child::before]:float-left [&_.ProseMirror_.is-editor-empty:first-child::before]:h-0 [&_.ProseMirror_.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror_.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]")
|
|
13470
13470
|
}, /* @__PURE__ */ t.createElement(w, { editor: q }));
|
|
13471
13471
|
return K && oe.length > 0 ? /* @__PURE__ */ t.createElement(Rl, {
|
|
13472
|
-
ref:
|
|
13472
|
+
ref: te,
|
|
13473
13473
|
trigger: K,
|
|
13474
13474
|
searchable: ie,
|
|
13475
|
-
controlled:
|
|
13476
|
-
open:
|
|
13477
|
-
anchorPosition:
|
|
13478
|
-
query:
|
|
13479
|
-
editorContext:
|
|
13475
|
+
controlled: G.editorContext ? {
|
|
13476
|
+
open: G.open,
|
|
13477
|
+
anchorPosition: G.anchorPosition,
|
|
13478
|
+
query: G.query,
|
|
13479
|
+
editorContext: G.editorContext,
|
|
13480
13480
|
onClose: de
|
|
13481
13481
|
} : void 0,
|
|
13482
13482
|
onSelect: (e, t) => {
|
|
@@ -13506,7 +13506,7 @@ var ef = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13506
13506
|
le.handleUploadChange(e);
|
|
13507
13507
|
}
|
|
13508
13508
|
}), /* @__PURE__ */ t.createElement("input", {
|
|
13509
|
-
ref:
|
|
13509
|
+
ref: ee,
|
|
13510
13510
|
type: "file",
|
|
13511
13511
|
multiple: !0,
|
|
13512
13512
|
accept: _?.accept ?? ".pdf,.doc,.docx,.txt,.csv",
|
|
@@ -13577,39 +13577,39 @@ function Tf(e) {
|
|
|
13577
13577
|
}) : e : null;
|
|
13578
13578
|
}
|
|
13579
13579
|
function Ef({ title: e = void 0, description: n = void 0, meta: r = void 0, badge: i = void 0, icon: a = void 0, trailing: o = void 0, footer: s = void 0, children: c = void 0, href: l = void 0, external: u = !1, active: d = !1, disabled: f = !1, dashed: p = !1, compact: m = !1, align: h = "start", onClick: g = void 0, before: _ = void 0, after: y = void 0, wrapperClassName: b = void 0, className: x = void 0, titleClassName: S = void 0, descriptionClassName: C = void 0, metaClassName: w = void 0, badgeClassName: T = void 0, leadingClassName: E = void 0, bodyClassName: D = void 0, headerClassName: O = void 0, trailingClassName: k = void 0, footerClassName: A = void 0, style: j = void 0, motion: M = void 0 }) {
|
|
13580
|
-
let N = Y("listCard"), P = !!l || !!g, F = ar(f || !P, j, M ?? N.ListCard.motion?.press ?? "press"), I = Tf(a), L = s ?? c, R = X("flex w-full gap-3 rounded-xl border border-border/60 bg-background p-4 text-left transition-[background-color,border-color,box-shadow,color] duration-150", h === "center" ? "items-center" : "items-start", P && !f && "cursor-pointer", N.ListCard.className, d ? N.ListCard.activeClassName : N.ListCard.inactiveClassName, f && N.ListCard.disabledClassName, p && N.ListCard.dashedClassName, m && N.ListCard.compactClassName, x),
|
|
13580
|
+
let N = Y("listCard"), P = !!l || !!g, F = ar(f || !P, j, M ?? N.ListCard.motion?.press ?? "press"), I = Tf(a), L = s ?? c, R = X("flex w-full gap-3 rounded-xl border border-border/60 bg-background p-4 text-left transition-[background-color,border-color,box-shadow,color] duration-150", h === "center" ? "items-center" : "items-start", P && !f && "cursor-pointer", N.ListCard.className, d ? N.ListCard.activeClassName : N.ListCard.inactiveClassName, f && N.ListCard.disabledClassName, p && N.ListCard.dashedClassName, m && N.ListCard.compactClassName, x), z = /* @__PURE__ */ t.createElement(t.Fragment, null, I ? /* @__PURE__ */ t.createElement("div", { className: X("mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", h === "center" && "mt-0", N.ListCard.leadingClassName, E) }, I) : null, /* @__PURE__ */ t.createElement("div", { className: X("min-w-0 flex-1", N.ListCard.bodyClassName, D) }, e || i ? /* @__PURE__ */ t.createElement("div", { className: X("flex items-center gap-2", N.ListCard.headerClassName, O) }, e ? /* @__PURE__ */ t.createElement("div", { className: X("min-w-0 flex-1 truncate text-sm font-semibold text-foreground", N.ListCard.titleClassName, S) }, e) : /* @__PURE__ */ t.createElement("div", { className: "flex-1" }), i ? /* @__PURE__ */ t.createElement("div", { className: X("shrink-0", N.ListCard.badgeClassName, T) }, i) : null) : null, n ? /* @__PURE__ */ t.createElement("div", { className: X("mt-1 text-sm text-muted-foreground", N.ListCard.descriptionClassName, C) }, n) : null, r ? /* @__PURE__ */ t.createElement("div", { className: X("mt-1 text-xs text-muted-foreground", N.ListCard.metaClassName, w) }, r) : null, L ? /* @__PURE__ */ t.createElement("div", { className: X("mt-3", N.ListCard.footerClassName, A) }, L) : null), o ? /* @__PURE__ */ t.createElement("div", { className: X("shrink-0 self-center", N.ListCard.trailingClassName, k) }, o) : null), B = (e) => {
|
|
13581
13581
|
if (f) {
|
|
13582
13582
|
e.preventDefault(), e.stopPropagation();
|
|
13583
13583
|
return;
|
|
13584
13584
|
}
|
|
13585
13585
|
g?.(e);
|
|
13586
|
-
},
|
|
13587
|
-
return
|
|
13586
|
+
}, V;
|
|
13587
|
+
return V = l && !f ? u ? /* @__PURE__ */ t.createElement("a", {
|
|
13588
13588
|
href: l,
|
|
13589
13589
|
target: "_blank",
|
|
13590
13590
|
rel: "noreferrer noopener",
|
|
13591
13591
|
className: R,
|
|
13592
13592
|
style: F.style,
|
|
13593
13593
|
...F.pressHandlers,
|
|
13594
|
-
onClick:
|
|
13595
|
-
},
|
|
13594
|
+
onClick: B
|
|
13595
|
+
}, z) : /* @__PURE__ */ t.createElement(v, {
|
|
13596
13596
|
to: l,
|
|
13597
13597
|
className: R,
|
|
13598
13598
|
style: F.style,
|
|
13599
13599
|
...F.pressHandlers,
|
|
13600
|
-
onClick:
|
|
13601
|
-
},
|
|
13600
|
+
onClick: B
|
|
13601
|
+
}, z) : P ? /* @__PURE__ */ t.createElement("button", {
|
|
13602
13602
|
type: "button",
|
|
13603
13603
|
className: R,
|
|
13604
13604
|
style: F.style,
|
|
13605
13605
|
disabled: f,
|
|
13606
13606
|
...F.pressHandlers,
|
|
13607
|
-
onClick:
|
|
13608
|
-
},
|
|
13607
|
+
onClick: B
|
|
13608
|
+
}, z) : /* @__PURE__ */ t.createElement("div", {
|
|
13609
13609
|
className: R,
|
|
13610
13610
|
style: j,
|
|
13611
13611
|
"aria-disabled": f || void 0
|
|
13612
|
-
},
|
|
13612
|
+
}, z), /* @__PURE__ */ t.createElement(Z, { className: X(N.ListCard.wrapperClassName, b) }, _, V, y);
|
|
13613
13613
|
}
|
|
13614
13614
|
//#endregion
|
|
13615
13615
|
//#region src/components/blocks/SideNav.tsx
|
|
@@ -14204,16 +14204,16 @@ function bp({ appName: e = tp, children: n }) {
|
|
|
14204
14204
|
}]);
|
|
14205
14205
|
}, []), M = s((e) => {
|
|
14206
14206
|
d((t) => t.filter((t) => t.id !== e));
|
|
14207
|
-
}, []), N = s(() => m({}), []), P = s(() => _({}), []), F = s(() => y({}), []), I = s(() => x(rp), []), L = s(() => C(np), []), R = s(() => T({}), []),
|
|
14207
|
+
}, []), N = s(() => m({}), []), P = s(() => _({}), []), F = s(() => y({}), []), I = s(() => x(rp), []), L = s(() => C(np), []), R = s(() => T({}), []), z = s(() => D({}), []), B = s(() => k({}), []);
|
|
14208
14208
|
l(() => {
|
|
14209
14209
|
globalThis.document !== void 0 && (globalThis.document.documentElement.lang = b.lang ?? i.current, globalThis.document.documentElement.dir = b.dir ?? a.current);
|
|
14210
14210
|
}, [b.lang, b.dir]);
|
|
14211
|
-
let
|
|
14211
|
+
let V = u.length > 0 ? u[u.length - 1].metadata : o;
|
|
14212
14212
|
l(() => {
|
|
14213
|
-
globalThis.document !== void 0 && (globalThis.document.title =
|
|
14214
|
-
}, [
|
|
14215
|
-
let
|
|
14216
|
-
metadata:
|
|
14213
|
+
globalThis.document !== void 0 && (globalThis.document.title = V.title ?? r);
|
|
14214
|
+
}, [V.title, r]);
|
|
14215
|
+
let H = p(() => ({
|
|
14216
|
+
metadata: V,
|
|
14217
14217
|
social: f,
|
|
14218
14218
|
links: g,
|
|
14219
14219
|
pagination: v,
|
|
@@ -14239,11 +14239,11 @@ function bp({ appName: e = tp, children: n }) {
|
|
|
14239
14239
|
setAssetsHead: T,
|
|
14240
14240
|
clearAssetsHead: R,
|
|
14241
14241
|
setPwaHead: D,
|
|
14242
|
-
clearPwaHead:
|
|
14242
|
+
clearPwaHead: z,
|
|
14243
14243
|
setSchemaOrg: k,
|
|
14244
|
-
clearSchemaOrg:
|
|
14244
|
+
clearSchemaOrg: B
|
|
14245
14245
|
}), [
|
|
14246
|
-
|
|
14246
|
+
V,
|
|
14247
14247
|
f,
|
|
14248
14248
|
g,
|
|
14249
14249
|
v,
|
|
@@ -14261,12 +14261,12 @@ function bp({ appName: e = tp, children: n }) {
|
|
|
14261
14261
|
I,
|
|
14262
14262
|
L,
|
|
14263
14263
|
R,
|
|
14264
|
-
|
|
14265
|
-
|
|
14264
|
+
z,
|
|
14265
|
+
B
|
|
14266
14266
|
]);
|
|
14267
|
-
return /* @__PURE__ */ t.createElement($f.Provider, { value:
|
|
14267
|
+
return /* @__PURE__ */ t.createElement($f.Provider, { value: H }, n, /* @__PURE__ */ t.createElement(yp, {
|
|
14268
14268
|
appName: r,
|
|
14269
|
-
metadata:
|
|
14269
|
+
metadata: V,
|
|
14270
14270
|
social: f,
|
|
14271
14271
|
links: g,
|
|
14272
14272
|
pagination: v,
|
|
@@ -14469,7 +14469,7 @@ function Bp({ content: e, components: n, className: r, wrapperClassName: i, meta
|
|
|
14469
14469
|
title: a?.title ?? s
|
|
14470
14470
|
} : void 0);
|
|
14471
14471
|
let c = t.useMemo(() => zp(o), [o]);
|
|
14472
|
-
return /* @__PURE__ */ t.createElement("div", { className: X("rf-markdown-reader max-w-none text-sm text-foreground", i, r) }, /* @__PURE__ */ t.createElement(
|
|
14472
|
+
return /* @__PURE__ */ t.createElement("div", { className: X("rf-markdown-reader max-w-none text-sm text-foreground", i, r) }, /* @__PURE__ */ t.createElement(J, {
|
|
14473
14473
|
remarkPlugins: [ke],
|
|
14474
14474
|
rehypePlugins: [
|
|
14475
14475
|
Ae,
|
|
@@ -14615,7 +14615,7 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14615
14615
|
3: "1rem",
|
|
14616
14616
|
4: "1.5rem",
|
|
14617
14617
|
5: "3rem"
|
|
14618
|
-
}, L = I[P] ?? I[2], R = "0.75rem",
|
|
14618
|
+
}, L = I[P] ?? I[2], R = "0.75rem", z = "calc(50% - 1rem)", B = P === 0 ? `${(100 / F).toFixed(4)}%` : `calc((100% - (${L} * ${F - 1})) / ${F})`, V = e || [], H = p(() => {
|
|
14619
14619
|
if (!c) return;
|
|
14620
14620
|
if (typeof c == "object") return c;
|
|
14621
14621
|
let t = e?.[0];
|
|
@@ -14630,16 +14630,16 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14630
14630
|
typeof c == "object" ? c?.dir : void 0,
|
|
14631
14631
|
typeof c == "object" ? c?.field : void 0,
|
|
14632
14632
|
c
|
|
14633
|
-
]),
|
|
14634
|
-
records:
|
|
14633
|
+
]), U = Dd("item"), W = s((e, t) => U(e, t), [U]), { activeSelectedKeys: ee, showSelection: te, updateSelection: G } = Ed({
|
|
14634
|
+
records: V,
|
|
14635
14635
|
selectedKeys: _,
|
|
14636
14636
|
onSelectionChange: o,
|
|
14637
|
-
getRecordKey:
|
|
14638
|
-
}),
|
|
14637
|
+
getRecordKey: W
|
|
14638
|
+
}), ne = m(/* @__PURE__ */ new Map());
|
|
14639
14639
|
l(() => {
|
|
14640
|
-
let e = new Set(
|
|
14641
|
-
for (let t of
|
|
14642
|
-
}, [
|
|
14640
|
+
let e = new Set(V.map((e, t) => W(e, t)));
|
|
14641
|
+
for (let t of ne.current.keys()) e.has(t) || ne.current.delete(t);
|
|
14642
|
+
}, [V, W]);
|
|
14643
14643
|
let re = (e, t) => {
|
|
14644
14644
|
if (A) {
|
|
14645
14645
|
let t = A.split(/\s+/).filter(Boolean), n = e.target;
|
|
@@ -14658,12 +14658,12 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14658
14658
|
}
|
|
14659
14659
|
a?.(t);
|
|
14660
14660
|
}, K = s((e, t) => {
|
|
14661
|
-
let n =
|
|
14662
|
-
|
|
14661
|
+
let n = W(e, t), r = ee.includes(n) ? ee.filter((e) => e !== n) : [...ee, n];
|
|
14662
|
+
G(r);
|
|
14663
14663
|
}, [
|
|
14664
|
-
|
|
14665
|
-
|
|
14666
|
-
|
|
14664
|
+
ee,
|
|
14665
|
+
W,
|
|
14666
|
+
G
|
|
14667
14667
|
]), ie = (e, n) => {
|
|
14668
14668
|
let r = e.img;
|
|
14669
14669
|
return r && t.isValidElement(r) ? t.cloneElement(r, {
|
|
@@ -14694,8 +14694,8 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14694
14694
|
})), oe = (e, n, r = "left", i) => /* @__PURE__ */ t.createElement("div", {
|
|
14695
14695
|
className: X("absolute z-10 overflow-hidden text-ellipsis whitespace-nowrap leading-none", r === "right" ? "text-right" : "text-left", i),
|
|
14696
14696
|
style: {
|
|
14697
|
-
width:
|
|
14698
|
-
maxWidth:
|
|
14697
|
+
width: z,
|
|
14698
|
+
maxWidth: z,
|
|
14699
14699
|
pointerEvents: "none",
|
|
14700
14700
|
...n
|
|
14701
14701
|
}
|
|
@@ -14745,7 +14745,7 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14745
14745
|
...r.style
|
|
14746
14746
|
}, o.align, r.className)) : null;
|
|
14747
14747
|
}) : null, de = s((e, t) => {
|
|
14748
|
-
let n =
|
|
14748
|
+
let n = W(e, t), r = ne.current.get(n);
|
|
14749
14749
|
if (r && r.recordRef === e && r.overlaysRef === i && r.onClickRef === a && r.rowIndex === t) return {
|
|
14750
14750
|
image: r.image,
|
|
14751
14751
|
overlays: r.overlays
|
|
@@ -14754,7 +14754,7 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14754
14754
|
image: ie(e, t),
|
|
14755
14755
|
overlays: ue(e, t)
|
|
14756
14756
|
};
|
|
14757
|
-
return
|
|
14757
|
+
return ne.current.set(n, {
|
|
14758
14758
|
recordRef: e,
|
|
14759
14759
|
overlaysRef: i,
|
|
14760
14760
|
onClickRef: a,
|
|
@@ -14763,19 +14763,19 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14763
14763
|
overlays: o.overlays
|
|
14764
14764
|
}), o;
|
|
14765
14765
|
}, [
|
|
14766
|
-
|
|
14766
|
+
W,
|
|
14767
14767
|
a,
|
|
14768
14768
|
i
|
|
14769
14769
|
]), fe = (e, n) => {
|
|
14770
|
-
let r =
|
|
14770
|
+
let r = W(n, e), i = ee.includes(r), a = A?.split(/\s+/).filter(Boolean) || [], o = de(n, e);
|
|
14771
14771
|
return /* @__PURE__ */ t.createElement("div", {
|
|
14772
14772
|
key: r,
|
|
14773
14773
|
className: X("item min-w-0", i && a),
|
|
14774
14774
|
style: {
|
|
14775
|
-
flex: `0 0 ${
|
|
14776
|
-
maxWidth:
|
|
14775
|
+
flex: `0 0 ${B}`,
|
|
14776
|
+
maxWidth: B
|
|
14777
14777
|
}
|
|
14778
|
-
}, /* @__PURE__ */ t.createElement("div", { className: "relative overflow-hidden rounded-lg" },
|
|
14778
|
+
}, /* @__PURE__ */ t.createElement("div", { className: "relative overflow-hidden rounded-lg" }, te && /* @__PURE__ */ t.createElement("label", { className: "absolute left-3 top-3 z-20 inline-flex items-center rounded bg-background/90 px-2 py-1 shadow-sm" }, /* @__PURE__ */ t.createElement("input", {
|
|
14779
14779
|
type: "checkbox",
|
|
14780
14780
|
"aria-label": Tn(O.selectItem, { key: r }),
|
|
14781
14781
|
checked: i,
|
|
@@ -14797,7 +14797,7 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14797
14797
|
}));
|
|
14798
14798
|
}, pe = p(() => {
|
|
14799
14799
|
if (!Array.isArray(e)) return;
|
|
14800
|
-
let t = Ls.records(e,
|
|
14800
|
+
let t = Ls.records(e, H) || [];
|
|
14801
14801
|
return g ? q(t, g) : t.map((e, t) => ({
|
|
14802
14802
|
kind: "item",
|
|
14803
14803
|
item: e,
|
|
@@ -14806,7 +14806,7 @@ var Vp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14806
14806
|
}, [
|
|
14807
14807
|
e,
|
|
14808
14808
|
g,
|
|
14809
|
-
|
|
14809
|
+
H
|
|
14810
14810
|
]);
|
|
14811
14811
|
return pe === void 0 ? /* @__PURE__ */ t.createElement("p", { className: "p-4" }, /* @__PURE__ */ t.createElement("span", { className: "mr-2 inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }), k.loading) : pe.length === 0 ? /* @__PURE__ */ t.createElement("p", { className: "p-4" }, k.noDataFound) : /* @__PURE__ */ t.createElement("div", { className: X("flex items-stretch gap-3", b || D.Gallery.wrapperClassName) }, v && /* @__PURE__ */ t.createElement("div", { className: "gallery-before flex shrink-0 items-center self-stretch" }, v), /* @__PURE__ */ t.createElement(Z, { className: X("min-w-0 flex-1 flex flex-col", x || D.Gallery.className) }, n && /* @__PURE__ */ t.createElement("div", { className: S || D.Gallery.headerClassName }, n), /* @__PURE__ */ t.createElement(Z, { className: X("min-w-0 flex-1", C || D.Gallery.scrollClassName) }, /* @__PURE__ */ t.createElement(Hp, {
|
|
14812
14812
|
records: pe,
|
|
@@ -15129,50 +15129,73 @@ function Jp({ selection: e }) {
|
|
|
15129
15129
|
//#endregion
|
|
15130
15130
|
//#region src/components/widgets/grid-core/GridCore.tsx
|
|
15131
15131
|
var Yp = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function" ? t.title(n) : t.title || r : t?.kind === "modal" ? typeof t.title == "function" ? t.title(n) : t.title || Xf(e, t, i) : Xf(e, t, i);
|
|
15132
|
-
function Xp({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, form: o, editDeepLink: c, header: u, footer: d, view: f = "table", views: m, sticky: g, wrapperClassName: _, cardClassName: v, bodyClassName: y, loading: b = !1, title: x, before: S, after: C, sortable: w = !0, pagination: T, selection: E, onRowClick: D, reorderable: O = !1, onReorder: k, groupBy: A, searchable: j,
|
|
15133
|
-
let
|
|
15132
|
+
function Xp({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, form: o, editDeepLink: c, header: u, footer: d, view: f = "table", views: m, sticky: g, wrapperClassName: _, cardClassName: v, bodyClassName: y, loading: b = !1, title: x, before: S, after: C, sortable: w = !0, pagination: T, selection: E, onRowClick: D, reorderable: O = !1, onReorder: k, groupBy: A, searchable: j, filters: M, onSave: N, onDelete: P, onComplete: F, audit: I = !1, onLoad: L }) {
|
|
15133
|
+
let R = Y("grid"), z = Nn("grid"), B = Nn("common"), V = p(() => ({ add: z.buttonAdd }), [z.buttonAdd]), H = Ci(), { preparedRecords: U, loading: W } = qp({
|
|
15134
15134
|
records: e,
|
|
15135
|
-
onLoad:
|
|
15136
|
-
}),
|
|
15135
|
+
onLoad: L
|
|
15136
|
+
}), ee = Kp({
|
|
15137
15137
|
columns: i,
|
|
15138
|
-
records:
|
|
15138
|
+
records: U,
|
|
15139
15139
|
form: o
|
|
15140
|
-
}), te =
|
|
15141
|
-
|
|
15142
|
-
|
|
15143
|
-
|
|
15140
|
+
}), [te, G] = h(() => Object.fromEntries((M ?? []).map((e) => [e.key, e.defaultValue ?? !1]))), ne = s((e) => {
|
|
15141
|
+
G((t) => ({
|
|
15142
|
+
...t,
|
|
15143
|
+
[e]: !t[e]
|
|
15144
|
+
}));
|
|
15145
|
+
}, []), re = p(() => !M || M.length === 0 ? U : U.filter((e) => M.every((t) => t.predicate(e, te[t.key] ?? t.defaultValue ?? !1))), [
|
|
15146
|
+
U,
|
|
15147
|
+
M,
|
|
15148
|
+
te
|
|
15149
|
+
]), K = M && M.length > 0 ? /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap items-center gap-3" }, M.map((e) => {
|
|
15150
|
+
let n = te[e.key] ?? e.defaultValue ?? !1;
|
|
15151
|
+
return /* @__PURE__ */ t.createElement("label", {
|
|
15152
|
+
key: e.key,
|
|
15153
|
+
className: "inline-flex shrink-0 cursor-pointer items-center gap-1.5 select-none"
|
|
15154
|
+
}, /* @__PURE__ */ t.createElement("span", { className: "relative inline-flex h-5 w-9 shrink-0 items-center" }, /* @__PURE__ */ t.createElement("input", {
|
|
15155
|
+
type: "checkbox",
|
|
15156
|
+
checked: n,
|
|
15157
|
+
onChange: () => ne(e.key),
|
|
15158
|
+
className: "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0"
|
|
15159
|
+
}), /* @__PURE__ */ t.createElement("span", {
|
|
15160
|
+
"aria-hidden": "true",
|
|
15161
|
+
className: X("pointer-events-none absolute inset-0 rounded-full transition-colors duration-200 ease-out peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2", n ? "bg-primary" : "bg-muted-foreground/35")
|
|
15162
|
+
}, /* @__PURE__ */ t.createElement("span", { className: X("pointer-events-none absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-background shadow-sm transition-transform duration-200 ease-out", n && "translate-x-4") }))), /* @__PURE__ */ t.createElement("span", { className: "text-sm text-muted-foreground" }, e.label));
|
|
15163
|
+
})) : null, ie = j === !0 ? {} : j || void 0, [ae, oe] = h(""), se = p(() => {
|
|
15164
|
+
if (!ie || !ae.trim()) return re;
|
|
15165
|
+
let e = ae.trim().toLowerCase(), t = ie.fields?.map(String);
|
|
15166
|
+
return re.filter((n) => (t ?? Object.keys(n)).some((t) => {
|
|
15144
15167
|
let r = Mt(n, t);
|
|
15145
15168
|
return typeof r == "string" && r.toLowerCase().includes(e);
|
|
15146
15169
|
}));
|
|
15147
15170
|
}, [
|
|
15148
|
-
|
|
15149
|
-
|
|
15150
|
-
|
|
15151
|
-
]),
|
|
15171
|
+
re,
|
|
15172
|
+
ie,
|
|
15173
|
+
ae
|
|
15174
|
+
]), ce = ie ? /* @__PURE__ */ t.createElement("div", { className: "flex min-w-0 items-center gap-2" }, /* @__PURE__ */ t.createElement("input", {
|
|
15152
15175
|
type: "search",
|
|
15153
|
-
value:
|
|
15154
|
-
onChange: (e) =>
|
|
15155
|
-
placeholder:
|
|
15176
|
+
value: ae,
|
|
15177
|
+
onChange: (e) => oe(e.target.value),
|
|
15178
|
+
placeholder: ie.placeholder ?? B.search,
|
|
15156
15179
|
className: "w-full max-w-xs rounded-md border border-input bg-background px-2 py-1 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
15157
|
-
}), /* @__PURE__ */ t.createElement("span", { className: "shrink-0 text-xs text-muted-foreground" },
|
|
15180
|
+
}), /* @__PURE__ */ t.createElement("span", { className: "shrink-0 text-xs text-muted-foreground" }, se.length, " / ", re.length)) : null, le = m ?? {}, ue = le.table ?? {}, de = le.gallery ?? {}, [fe, q] = h(f);
|
|
15158
15181
|
l(() => {
|
|
15159
|
-
|
|
15182
|
+
q(f);
|
|
15160
15183
|
}, [f]);
|
|
15161
|
-
let [
|
|
15162
|
-
|
|
15184
|
+
let [pe, me] = h(() => new Set(ee.filter((e) => e.defaultVisible === !1).map((e) => String(e.key)))), he = s((e) => {
|
|
15185
|
+
me((t) => {
|
|
15163
15186
|
let n = new Set(t);
|
|
15164
15187
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
15165
15188
|
});
|
|
15166
|
-
}, []),
|
|
15167
|
-
|
|
15189
|
+
}, []), ge = p(() => ee.filter((e) => !pe.has(String(e.key))), [ee, pe]), _e = de.fields ?? [], [ve, ye] = h(() => new Set(_e.filter((e) => e.defaultVisible === !1).map((e) => String(e.key)))), be = s((e) => {
|
|
15190
|
+
ye((t) => {
|
|
15168
15191
|
let n = new Set(t);
|
|
15169
15192
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
15170
15193
|
});
|
|
15171
|
-
}, []),
|
|
15194
|
+
}, []), xe = p(() => _e.filter((e) => !ve.has(String(e.key))), [_e, ve]), Se = p(() => {
|
|
15172
15195
|
let e = [];
|
|
15173
|
-
if (
|
|
15196
|
+
if (xe.length) {
|
|
15174
15197
|
let n = /* @__PURE__ */ new Map();
|
|
15175
|
-
|
|
15198
|
+
xe.forEach((e) => {
|
|
15176
15199
|
let t = e.position ?? "bottomLeft";
|
|
15177
15200
|
n.has(t) || n.set(t, []), n.get(t).push(e);
|
|
15178
15201
|
}), e.push(...Array.from(n.entries()).map(([e, n]) => ({
|
|
@@ -15186,217 +15209,218 @@ function Xp({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, fo
|
|
|
15186
15209
|
}))
|
|
15187
15210
|
})));
|
|
15188
15211
|
}
|
|
15189
|
-
let n = [...
|
|
15212
|
+
let n = [...de.overlays ?? [], ...e];
|
|
15190
15213
|
return n.length ? n : void 0;
|
|
15191
|
-
}, [
|
|
15214
|
+
}, [de.overlays, xe]), { mode: Ce, activeSelectionKeys: we, selectionState: Te, handleSelectionChange: Ee } = Jp({ selection: E }), { normalizedActions: De, activeAction: Oe, activeActionConfig: J, activeActionBody: ke, activeKey: Ae, runAction: je, close: Me, getActionContext: Ne, getModalActionContext: Pe, getRecordKey: Fe, formController: Ie } = Gp({
|
|
15192
15215
|
actions: a,
|
|
15193
15216
|
form: o,
|
|
15194
15217
|
editDeepLink: c,
|
|
15195
|
-
preparedRecords:
|
|
15218
|
+
preparedRecords: U,
|
|
15196
15219
|
recordId: n,
|
|
15197
15220
|
sourcePath: r,
|
|
15198
|
-
db:
|
|
15199
|
-
onSave:
|
|
15200
|
-
onDelete:
|
|
15201
|
-
onComplete:
|
|
15202
|
-
audit:
|
|
15203
|
-
}),
|
|
15204
|
-
if (D?.(e), !
|
|
15205
|
-
let t =
|
|
15206
|
-
if (
|
|
15207
|
-
|
|
15221
|
+
db: H,
|
|
15222
|
+
onSave: N,
|
|
15223
|
+
onDelete: P,
|
|
15224
|
+
onComplete: F,
|
|
15225
|
+
audit: I
|
|
15226
|
+
}), Le = De.edit, Re = !!Le && (Le.kind !== "modal" || !!o), ze = s((e) => {
|
|
15227
|
+
if (D?.(e), !Re) return;
|
|
15228
|
+
let t = Fe(e);
|
|
15229
|
+
if (Oe?.actionKey === "edit" && Oe.record && Fe(Oe.record) === t) {
|
|
15230
|
+
Me();
|
|
15208
15231
|
return;
|
|
15209
15232
|
}
|
|
15210
|
-
|
|
15233
|
+
je("edit", e);
|
|
15211
15234
|
}, [
|
|
15212
|
-
|
|
15213
|
-
|
|
15235
|
+
Oe?.actionKey,
|
|
15236
|
+
Oe?.record,
|
|
15237
|
+
Re,
|
|
15214
15238
|
Me,
|
|
15215
|
-
|
|
15216
|
-
ke,
|
|
15239
|
+
Fe,
|
|
15217
15240
|
D,
|
|
15218
|
-
|
|
15219
|
-
]),
|
|
15220
|
-
let i =
|
|
15241
|
+
je
|
|
15242
|
+
]), Be = D || Re ? ze : void 0, Ve = s((e, n, r) => {
|
|
15243
|
+
let i = De[e];
|
|
15221
15244
|
return !i || !Jf(i, n) ? null : /* @__PURE__ */ t.createElement(Br, {
|
|
15222
15245
|
className: r || (e === "add" ? "btn-primary" : void 0),
|
|
15223
15246
|
icon: i.icon,
|
|
15224
|
-
label: Xf(e, i,
|
|
15247
|
+
label: Xf(e, i, V),
|
|
15225
15248
|
disabled: Yf(i, n),
|
|
15226
|
-
onClick: () =>
|
|
15249
|
+
onClick: () => je(e, n)
|
|
15227
15250
|
});
|
|
15228
15251
|
}, [
|
|
15229
|
-
|
|
15230
|
-
|
|
15231
|
-
|
|
15232
|
-
]),
|
|
15252
|
+
De,
|
|
15253
|
+
je,
|
|
15254
|
+
V
|
|
15255
|
+
]), He = p(() => Object.entries(De).filter(([e, t]) => e !== "edit" && e !== "delete" && Jf(t, void 0)).map(([e]) => e), [De]), Ue = p(() => ({
|
|
15233
15256
|
title: x,
|
|
15234
|
-
records:
|
|
15235
|
-
selection:
|
|
15236
|
-
runAction:
|
|
15257
|
+
records: U,
|
|
15258
|
+
selection: Te,
|
|
15259
|
+
runAction: je
|
|
15237
15260
|
}), [
|
|
15238
|
-
|
|
15261
|
+
U,
|
|
15262
|
+
je,
|
|
15239
15263
|
Te,
|
|
15240
|
-
ye,
|
|
15241
15264
|
x
|
|
15242
|
-
]),
|
|
15243
|
-
records:
|
|
15244
|
-
selection:
|
|
15245
|
-
runAction:
|
|
15265
|
+
]), We = p(() => ({
|
|
15266
|
+
records: U,
|
|
15267
|
+
selection: Te,
|
|
15268
|
+
runAction: je
|
|
15246
15269
|
}), [
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
]),
|
|
15270
|
+
U,
|
|
15271
|
+
je,
|
|
15272
|
+
Te
|
|
15273
|
+
]), Ge = le.toggle ? /* @__PURE__ */ t.createElement("span", { className: "inline-flex rounded-md border border-border overflow-hidden" }, /* @__PURE__ */ t.createElement(Br, {
|
|
15251
15274
|
icon: "list",
|
|
15252
15275
|
ariaLabel: "Table view",
|
|
15253
15276
|
title: "Table view",
|
|
15254
|
-
className: "rounded-none border-0 " + (
|
|
15255
|
-
onClick: () =>
|
|
15277
|
+
className: "rounded-none border-0 " + (fe === "table" ? "bg-card text-foreground shadow-sm" : "bg-transparent text-muted-foreground"),
|
|
15278
|
+
onClick: () => q("table")
|
|
15256
15279
|
}), /* @__PURE__ */ t.createElement(Br, {
|
|
15257
15280
|
icon: "layout-grid",
|
|
15258
15281
|
ariaLabel: "Gallery view",
|
|
15259
15282
|
title: "Gallery view",
|
|
15260
|
-
className: "rounded-none border-0 border-l border-border " + (
|
|
15261
|
-
onClick: () =>
|
|
15262
|
-
})) : null,
|
|
15283
|
+
className: "rounded-none border-0 border-l border-border " + (fe === "gallery" ? "bg-card text-foreground shadow-sm" : "bg-transparent text-muted-foreground"),
|
|
15284
|
+
onClick: () => q("gallery")
|
|
15285
|
+
})) : null, Ke = ue.columnPicker && fe === "table" ? /* @__PURE__ */ t.createElement(Ii, {
|
|
15263
15286
|
trigger: {
|
|
15264
15287
|
icon: "columns",
|
|
15265
15288
|
title: "Columns"
|
|
15266
15289
|
},
|
|
15267
15290
|
triggerClassName: "btn btn-outline-secondary",
|
|
15268
15291
|
position: "end"
|
|
15269
|
-
},
|
|
15292
|
+
}, ee.map((e) => {
|
|
15270
15293
|
let n = String(e.key);
|
|
15271
15294
|
return /* @__PURE__ */ t.createElement("label", {
|
|
15272
15295
|
key: n,
|
|
15273
15296
|
className: "flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm hover:bg-accent"
|
|
15274
15297
|
}, /* @__PURE__ */ t.createElement("input", {
|
|
15275
15298
|
type: "checkbox",
|
|
15276
|
-
checked: !
|
|
15277
|
-
onChange: () =>
|
|
15299
|
+
checked: !pe.has(n),
|
|
15300
|
+
onChange: () => he(n)
|
|
15278
15301
|
}), e.label);
|
|
15279
|
-
})) : null,
|
|
15302
|
+
})) : null, qe = de.fieldPicker && fe === "gallery" && _e.length ? /* @__PURE__ */ t.createElement(Ii, {
|
|
15280
15303
|
trigger: {
|
|
15281
15304
|
icon: "sliders-horizontal",
|
|
15282
15305
|
title: "Fields"
|
|
15283
15306
|
},
|
|
15284
15307
|
triggerClassName: "btn btn-outline-secondary",
|
|
15285
15308
|
position: "end"
|
|
15286
|
-
},
|
|
15309
|
+
}, _e.map((e) => {
|
|
15287
15310
|
let n = String(e.key);
|
|
15288
15311
|
return /* @__PURE__ */ t.createElement("label", {
|
|
15289
15312
|
key: n,
|
|
15290
15313
|
className: "flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm hover:bg-accent"
|
|
15291
15314
|
}, /* @__PURE__ */ t.createElement("input", {
|
|
15292
15315
|
type: "checkbox",
|
|
15293
|
-
checked: !
|
|
15294
|
-
onChange: () =>
|
|
15316
|
+
checked: !ve.has(n),
|
|
15317
|
+
onChange: () => be(n)
|
|
15295
15318
|
}), e.label);
|
|
15296
|
-
})) : null,
|
|
15297
|
-
if (u !== void 0) return typeof u == "function" ? u(
|
|
15298
|
-
if (!(!x && !
|
|
15319
|
+
})) : null, Je = p(() => {
|
|
15320
|
+
if (u !== void 0) return typeof u == "function" ? u(Ue) : u;
|
|
15321
|
+
if (!(!x && !ce && !K && !He.length && !Ge && !Ke && !qe)) return /* @__PURE__ */ t.createElement(t.Fragment, null, ce || K ? /* @__PURE__ */ t.createElement("span", { className: "flex min-w-0 flex-1 items-center gap-3" }, x, ce, K) : x || /* @__PURE__ */ t.createElement("span", null), He.length || Ge || Ke || qe ? /* @__PURE__ */ t.createElement("span", { className: "flex flex-wrap items-center gap-2" }, Ke, qe, Ge, He.map((e) => /* @__PURE__ */ t.createElement(t.Fragment, { key: e }, Ve(e)))) : null);
|
|
15299
15322
|
}, [
|
|
15300
|
-
|
|
15323
|
+
Ve,
|
|
15301
15324
|
u,
|
|
15302
|
-
|
|
15303
|
-
|
|
15325
|
+
He,
|
|
15326
|
+
Ue,
|
|
15304
15327
|
x,
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
|
|
15328
|
+
Ge,
|
|
15329
|
+
Ke,
|
|
15330
|
+
qe,
|
|
15331
|
+
ce,
|
|
15332
|
+
K
|
|
15333
|
+
]), Ye = p(() => {
|
|
15334
|
+
if (d !== void 0) return typeof d == "function" ? d(We) : d;
|
|
15335
|
+
}, [d, We]), Xe = p(() => {
|
|
15336
|
+
if (!(!Oe || !J || J.kind !== "modal" && J.kind !== "delete")) return Pe(Oe.actionKey, Oe.record);
|
|
15313
15337
|
}, [
|
|
15314
|
-
|
|
15338
|
+
Oe,
|
|
15315
15339
|
J,
|
|
15316
|
-
|
|
15317
|
-
]),
|
|
15318
|
-
if (!(!J || J.kind !== "modal" && J.kind !== "delete" || J.header === void 0 || !
|
|
15319
|
-
}, [J,
|
|
15340
|
+
Pe
|
|
15341
|
+
]), Ze = p(() => {
|
|
15342
|
+
if (!(!J || J.kind !== "modal" && J.kind !== "delete" || J.header === void 0 || !Xe)) return typeof J.header == "function" ? J.header(Xe) : J.header;
|
|
15343
|
+
}, [J, Xe]), Qe = p(() => {
|
|
15320
15344
|
if (!(!J || J.kind !== "modal" && J.kind !== "delete")) {
|
|
15321
15345
|
if (J.footer === !1) return !1;
|
|
15322
|
-
if (!(J.footer === void 0 || !
|
|
15346
|
+
if (!(J.footer === void 0 || !Xe)) return typeof J.footer == "function" ? J.footer(Xe) : J.footer;
|
|
15323
15347
|
}
|
|
15324
|
-
}, [J,
|
|
15348
|
+
}, [J, Xe]), $e = Zf(w);
|
|
15325
15349
|
return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(ki, {
|
|
15326
15350
|
wrapperClassName: _,
|
|
15327
|
-
header:
|
|
15328
|
-
footer:
|
|
15329
|
-
className: X(
|
|
15330
|
-
headerClassName:
|
|
15331
|
-
bodyClassName: X(
|
|
15332
|
-
footerClassName:
|
|
15333
|
-
loading: b ||
|
|
15334
|
-
},
|
|
15335
|
-
records:
|
|
15351
|
+
header: Je,
|
|
15352
|
+
footer: Ye,
|
|
15353
|
+
className: X(R.Grid.Card.className, g ? `sticky-${g}` : "", v),
|
|
15354
|
+
headerClassName: R.Grid.Card.headerClassName,
|
|
15355
|
+
bodyClassName: X(R.Grid.Card.bodyClassName, y),
|
|
15356
|
+
footerClassName: R.Grid.Card.footerClassName,
|
|
15357
|
+
loading: b || W
|
|
15358
|
+
}, fe === "gallery" ? /* @__PURE__ */ t.createElement(Wp, {
|
|
15359
|
+
records: se,
|
|
15336
15360
|
recordId: n,
|
|
15337
|
-
sortable:
|
|
15361
|
+
sortable: $e || w,
|
|
15338
15362
|
pagination: T,
|
|
15339
|
-
selection:
|
|
15340
|
-
selectedKeys:
|
|
15341
|
-
onSelectionChange:
|
|
15342
|
-
onRowClick:
|
|
15363
|
+
selection: Ce,
|
|
15364
|
+
selectedKeys: we,
|
|
15365
|
+
onSelectionChange: Ce ? Ee : void 0,
|
|
15366
|
+
onRowClick: Be,
|
|
15343
15367
|
groupBy: A,
|
|
15344
|
-
wrapperClassName:
|
|
15368
|
+
wrapperClassName: R.Grid.Gallery.wrapperClassName,
|
|
15345
15369
|
before: S,
|
|
15346
15370
|
after: C,
|
|
15347
|
-
columns:
|
|
15348
|
-
overlays:
|
|
15371
|
+
columns: de.columns,
|
|
15372
|
+
overlays: Se
|
|
15349
15373
|
}) : /* @__PURE__ */ t.createElement(Qf, {
|
|
15350
|
-
records:
|
|
15374
|
+
records: se,
|
|
15351
15375
|
recordId: n,
|
|
15352
|
-
columns:
|
|
15353
|
-
runAction:
|
|
15354
|
-
sortable:
|
|
15376
|
+
columns: ge,
|
|
15377
|
+
runAction: je,
|
|
15378
|
+
sortable: $e || w,
|
|
15355
15379
|
pagination: T,
|
|
15356
|
-
selection:
|
|
15357
|
-
selectedKeys:
|
|
15358
|
-
onSelectionChange:
|
|
15359
|
-
onRowClick:
|
|
15380
|
+
selection: Ce,
|
|
15381
|
+
selectedKeys: we,
|
|
15382
|
+
onSelectionChange: Ce ? Ee : void 0,
|
|
15383
|
+
onRowClick: Be,
|
|
15360
15384
|
reorderable: O,
|
|
15361
15385
|
onReorder: k,
|
|
15362
|
-
activeKey:
|
|
15386
|
+
activeKey: Ae,
|
|
15363
15387
|
groupBy: A,
|
|
15364
|
-
wrapperClassName:
|
|
15365
|
-
className:
|
|
15366
|
-
heightClassName:
|
|
15367
|
-
scrollClassName:
|
|
15368
|
-
headerClassName:
|
|
15388
|
+
wrapperClassName: R.Grid.Table.wrapperClassName,
|
|
15389
|
+
className: ue.className,
|
|
15390
|
+
heightClassName: ue.heightClassName,
|
|
15391
|
+
scrollClassName: ue.scrollClassName,
|
|
15392
|
+
headerClassName: ue.headerClassName,
|
|
15369
15393
|
before: S,
|
|
15370
15394
|
after: C
|
|
15371
|
-
})),
|
|
15372
|
-
size: (J.kind === "modal" || J.kind === "delete") && J.size ||
|
|
15373
|
-
position: (J.kind === "modal" || J.kind === "delete") && J.position ||
|
|
15374
|
-
header:
|
|
15375
|
-
title: Yp(
|
|
15376
|
-
onClose:
|
|
15377
|
-
onSave: J.kind === "modal" && J.footer === void 0 && (
|
|
15395
|
+
})), Oe && J && (J.kind === "modal" || J.kind === "delete") && /* @__PURE__ */ t.createElement(Ai, {
|
|
15396
|
+
size: (J.kind === "modal" || J.kind === "delete") && J.size || R.Grid.Modal.size,
|
|
15397
|
+
position: (J.kind === "modal" || J.kind === "delete") && J.position || R.Grid.Modal.position,
|
|
15398
|
+
header: Ze,
|
|
15399
|
+
title: Yp(Oe.actionKey, J, J.kind === "modal" || J.kind === "delete" ? Pe(Oe.actionKey, Oe.record) : Ne(Oe.actionKey, Oe.record), z.deleteConfirm, V),
|
|
15400
|
+
onClose: Me,
|
|
15401
|
+
onSave: J.kind === "modal" && J.footer === void 0 && (Oe.actionKey === "add" || Oe.actionKey === "edit") ? (e) => Ie.save(e) : void 0,
|
|
15378
15402
|
onDelete: J.kind === "delete" ? async () => {
|
|
15379
|
-
let e =
|
|
15403
|
+
let e = Oe.record;
|
|
15380
15404
|
if (!e) return !1;
|
|
15381
|
-
let t =
|
|
15382
|
-
if (!t && !
|
|
15383
|
-
t && await
|
|
15384
|
-
let n = await
|
|
15405
|
+
let t = P ? await P({ record: e }) : r ? `${r}/${Fe(e)}` : void 0;
|
|
15406
|
+
if (!t && !P) return !1;
|
|
15407
|
+
t && await H.remove(t);
|
|
15408
|
+
let n = await F?.({
|
|
15385
15409
|
record: e,
|
|
15386
15410
|
action: "delete"
|
|
15387
15411
|
}) ?? !0;
|
|
15388
|
-
return n &&
|
|
15389
|
-
} : J.kind === "modal" && J.footer === void 0 &&
|
|
15390
|
-
footer:
|
|
15412
|
+
return n && Me(), n;
|
|
15413
|
+
} : J.kind === "modal" && J.footer === void 0 && Oe.actionKey === "edit" && Oe.record && De.delete ? async () => (await Pe(Oe.actionKey, Oe.record).runAction("remove"), !1) : void 0,
|
|
15414
|
+
footer: Qe,
|
|
15391
15415
|
showCancel: J.kind === "modal" || J.kind === "delete" ? J.footer === void 0 : !0,
|
|
15392
15416
|
allowFullscreen: J.kind === "modal" || J.kind === "delete" ? J.allowFullscreen : !0,
|
|
15393
|
-
wrapperClassName:
|
|
15394
|
-
className:
|
|
15395
|
-
headerClassName:
|
|
15396
|
-
titleClassName:
|
|
15397
|
-
bodyClassName:
|
|
15398
|
-
footerClassName:
|
|
15399
|
-
},
|
|
15417
|
+
wrapperClassName: R.Grid.Modal.wrapperClassName,
|
|
15418
|
+
className: R.Grid.Modal.className,
|
|
15419
|
+
headerClassName: R.Grid.Modal.headerClassName,
|
|
15420
|
+
titleClassName: R.Grid.Modal.titleClassName,
|
|
15421
|
+
bodyClassName: R.Grid.Modal.bodyClassName,
|
|
15422
|
+
footerClassName: R.Grid.Modal.footerClassName
|
|
15423
|
+
}, ke));
|
|
15400
15424
|
}
|
|
15401
15425
|
//#endregion
|
|
15402
15426
|
//#region src/components/widgets/grid-core/GridArray.tsx
|
|
@@ -15645,7 +15669,7 @@ var em = () => {
|
|
|
15645
15669
|
r(/* @__PURE__ */ Error("GoogleAuthProvider: Firebase auth is not initialized."));
|
|
15646
15670
|
return;
|
|
15647
15671
|
}
|
|
15648
|
-
let o = await
|
|
15672
|
+
let o = await te(a, L.credential(t)), s = z(o);
|
|
15649
15673
|
Xr({
|
|
15650
15674
|
...o.user,
|
|
15651
15675
|
profile: s?.profile ?? i
|
|
@@ -15669,7 +15693,7 @@ var em = () => {
|
|
|
15669
15693
|
}
|
|
15670
15694
|
onAuthChange(e) {
|
|
15671
15695
|
let t = Na();
|
|
15672
|
-
return t ?
|
|
15696
|
+
return t ? H(t, (t) => {
|
|
15673
15697
|
let n = this.getUser();
|
|
15674
15698
|
if (!t) {
|
|
15675
15699
|
e(n);
|
|
@@ -15989,7 +16013,7 @@ var em = () => {
|
|
|
15989
16013
|
};
|
|
15990
16014
|
}));
|
|
15991
16015
|
});
|
|
15992
|
-
}, c, l =
|
|
16016
|
+
}, c, l = H(o, (e) => {
|
|
15993
16017
|
c?.(), c = void 0, e ? c = s() : t([]);
|
|
15994
16018
|
});
|
|
15995
16019
|
return () => {
|
|
@@ -16045,7 +16069,7 @@ var Nm = class {
|
|
|
16045
16069
|
if (!t) throw Error("FirebaseAuthProvider: Firebase auth is not initialized");
|
|
16046
16070
|
let n = e.method ?? "password";
|
|
16047
16071
|
if (n === "anonymous") {
|
|
16048
|
-
let { user: e } = await
|
|
16072
|
+
let { user: e } = await ee(t);
|
|
16049
16073
|
return Mm(e);
|
|
16050
16074
|
}
|
|
16051
16075
|
if (n === "oauth") {
|
|
@@ -16056,7 +16080,7 @@ var Nm = class {
|
|
|
16056
16080
|
}
|
|
16057
16081
|
let { email: r, password: i } = e;
|
|
16058
16082
|
if (!r || !i) throw Error("FirebaseAuthProvider.signIn: email and password are required");
|
|
16059
|
-
let { user: a } = await
|
|
16083
|
+
let { user: a } = await ne(t, r, i);
|
|
16060
16084
|
return Mm(a);
|
|
16061
16085
|
}
|
|
16062
16086
|
async signOut() {
|
|
@@ -16068,7 +16092,7 @@ var Nm = class {
|
|
|
16068
16092
|
onAuthChange(e) {
|
|
16069
16093
|
if (!this.options.config) {
|
|
16070
16094
|
let t = Na(this.appName);
|
|
16071
|
-
return t ?
|
|
16095
|
+
return t ? H(t, (t) => e(Mm(t))) : (e(null), () => {});
|
|
16072
16096
|
}
|
|
16073
16097
|
let t = () => {}, n = !1;
|
|
16074
16098
|
return this.initPromise.then(() => {
|
|
@@ -16078,7 +16102,7 @@ var Nm = class {
|
|
|
16078
16102
|
e(null);
|
|
16079
16103
|
return;
|
|
16080
16104
|
}
|
|
16081
|
-
t =
|
|
16105
|
+
t = H(r, (t) => e(Mm(t)));
|
|
16082
16106
|
}), () => {
|
|
16083
16107
|
n = !0, t();
|
|
16084
16108
|
};
|
|
@@ -19029,7 +19053,7 @@ var t_ = class {
|
|
|
19029
19053
|
//#endregion
|
|
19030
19054
|
//#region src/libs/csv.ts
|
|
19031
19055
|
function n_(e, t) {
|
|
19032
|
-
let n =
|
|
19056
|
+
let n = Oe.parse(e, {
|
|
19033
19057
|
header: !0,
|
|
19034
19058
|
skipEmptyLines: !0,
|
|
19035
19059
|
delimiter: t?.delimiter,
|