@llmnative/react 1.10.2 → 1.11.0
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.mjs
CHANGED
|
@@ -8,7 +8,7 @@ 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 z, getAuth as B, inMemoryPersistence as V, onAuthStateChanged as H, onIdTokenChanged as U, setPersistence as W, signInAnonymously as ee, signInWithCredential as G, signInWithCustomToken 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 G, signInWithCustomToken as K, signInWithEmailAndPassword as te, signInWithPopup as ne, signOut as re } 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
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";
|
|
@@ -3636,16 +3636,16 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3636
3636
|
P.current = window.setTimeout(() => {
|
|
3637
3637
|
a?.();
|
|
3638
3638
|
}, e);
|
|
3639
|
-
},
|
|
3639
|
+
}, K = or(A, W, W), te = T ? { right: T } : {}, ne = {
|
|
3640
3640
|
...or(A, O.Modal.motion?.backdrop ?? "fade", O.Modal.motion?.backdrop ?? "fade"),
|
|
3641
3641
|
cursor: S && a ? "pointer" : "default",
|
|
3642
3642
|
...C === void 0 ? {} : { zIndex: C - 10 },
|
|
3643
|
-
...
|
|
3644
|
-
},
|
|
3643
|
+
...te
|
|
3644
|
+
}, re = {
|
|
3645
3645
|
cursor: S && a ? "pointer" : "default",
|
|
3646
3646
|
...C === void 0 ? {} : { zIndex: C },
|
|
3647
3647
|
...w ? { pointerEvents: "none" } : {},
|
|
3648
|
-
...
|
|
3648
|
+
...te
|
|
3649
3649
|
}, ie = w ? {
|
|
3650
3650
|
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)",
|
|
3651
3651
|
transformOrigin: l === "left" ? "left center" : l === "right" ? "right center" : l === "bottom" ? "bottom center" : l === "top" ? "top center" : "center",
|
|
@@ -3654,17 +3654,17 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3654
3654
|
} : {}, 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";
|
|
3655
3655
|
return j(/* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
3656
3656
|
className: U,
|
|
3657
|
-
style:
|
|
3657
|
+
style: re,
|
|
3658
3658
|
onClick: () => {
|
|
3659
3659
|
S && a && G();
|
|
3660
3660
|
}
|
|
3661
3661
|
}, /* @__PURE__ */ t.createElement("div", {
|
|
3662
3662
|
className: H.dialogClass,
|
|
3663
3663
|
style: {
|
|
3664
|
-
...
|
|
3664
|
+
...K,
|
|
3665
3665
|
...ie,
|
|
3666
3666
|
...C === void 0 ? {} : { zIndex: C },
|
|
3667
|
-
...V === "right" ?
|
|
3667
|
+
...V === "right" ? te : {}
|
|
3668
3668
|
},
|
|
3669
3669
|
onClick: (e) => e.stopPropagation()
|
|
3670
3670
|
}, 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", {
|
|
@@ -3709,7 +3709,7 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3709
3709
|
"data-rf-modal-backdrop": "",
|
|
3710
3710
|
"aria-hidden": "true",
|
|
3711
3711
|
className: "fixed inset-0 z-40 bg-black/60 backdrop-blur-sm",
|
|
3712
|
-
style:
|
|
3712
|
+
style: ne,
|
|
3713
3713
|
onClick: () => {
|
|
3714
3714
|
S && a && G();
|
|
3715
3715
|
}
|
|
@@ -3841,7 +3841,7 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3841
3841
|
}, H(n) ? /* @__PURE__ */ t.createElement(t.Fragment, null, n.icon && /* @__PURE__ */ t.createElement(Q, {
|
|
3842
3842
|
name: n.icon,
|
|
3843
3843
|
className: n.text ? "mr-2" : void 0
|
|
3844
|
-
}), 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", G = d === "end" ? "right-0" : "left-0",
|
|
3844
|
+
}), 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", G = d === "end" ? "right-0" : "left-0", K = /* @__PURE__ */ t.createElement(Li.Provider, { value: {
|
|
3845
3845
|
closeOnSelect: l,
|
|
3846
3846
|
close: () => V(!1)
|
|
3847
3847
|
} }, /* @__PURE__ */ t.createElement("div", {
|
|
@@ -3862,11 +3862,11 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
3862
3862
|
onClick: (e) => {
|
|
3863
3863
|
e.stopPropagation();
|
|
3864
3864
|
}
|
|
3865
|
-
}, i && /* @__PURE__ */ t.createElement("div", { className: X("px-2 py-1.5 text-sm font-semibold", x || w.Dropdown.headerClassName) }, i, /* @__PURE__ */ t.createElement(Ui, null)), e, a && /* @__PURE__ */ t.createElement("div", { className: S || w.Dropdown.footerClassName }, /* @__PURE__ */ t.createElement(Ui, null), a))),
|
|
3865
|
+
}, i && /* @__PURE__ */ t.createElement("div", { className: X("px-2 py-1.5 text-sm font-semibold", x || w.Dropdown.headerClassName) }, i, /* @__PURE__ */ t.createElement(Ui, null)), e, a && /* @__PURE__ */ t.createElement("div", { className: S || w.Dropdown.footerClassName }, /* @__PURE__ */ t.createElement(Ui, null), a))), te = !u && p === "fixed" && typeof document < "u";
|
|
3866
3866
|
return /* @__PURE__ */ t.createElement(Z, { className: W }, g, /* @__PURE__ */ t.createElement("div", {
|
|
3867
3867
|
ref: D,
|
|
3868
3868
|
className: X(u ? "inline-block text-left" : "relative inline-block text-left", h || w.Dropdown.className)
|
|
3869
|
-
}, U,
|
|
3869
|
+
}, U, te ? j(K, document.body) : K), _);
|
|
3870
3870
|
};
|
|
3871
3871
|
function zi({ 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 }) {
|
|
3872
3872
|
let S = Fn("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) => {
|
|
@@ -4659,7 +4659,7 @@ var Oa = (e) => Da?.[e], ka = "scrape", Aa = "[DEFAULT]", ja = /* @__PURE__ */ n
|
|
|
4659
4659
|
let t = Fa();
|
|
4660
4660
|
if (!t) return !1;
|
|
4661
4661
|
try {
|
|
4662
|
-
return await W(t, V), await
|
|
4662
|
+
return await W(t, V), await K(t, e), !0;
|
|
4663
4663
|
} catch (e) {
|
|
4664
4664
|
let n = t.app.options?.apiKey;
|
|
4665
4665
|
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;
|
|
@@ -6691,11 +6691,11 @@ var Ws = (e, t, n) => {
|
|
|
6691
6691
|
} });
|
|
6692
6692
|
}, 0), r;
|
|
6693
6693
|
});
|
|
6694
|
-
},
|
|
6694
|
+
}, K = u(), te = `${K}-options`;
|
|
6695
6695
|
return /* @__PURE__ */ t.createElement(Z, { className: A || M.Autocomplete.wrapperClassName }, d && /* @__PURE__ */ t.createElement(Ns, {
|
|
6696
6696
|
label: d,
|
|
6697
6697
|
required: o,
|
|
6698
|
-
htmlFor:
|
|
6698
|
+
htmlFor: K
|
|
6699
6699
|
}), /* @__PURE__ */ t.createElement(Z, { className: g || _ ? X(os, "flex-nowrap") : "" }, g && /* @__PURE__ */ t.createElement(Ks, { side: "before" }, g), /* @__PURE__ */ t.createElement("div", { className: X(is, "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", {
|
|
6700
6700
|
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",
|
|
6701
6701
|
key: e
|
|
@@ -6704,19 +6704,19 @@ var Ws = (e, t, n) => {
|
|
|
6704
6704
|
className: "ml-0.5 opacity-60 transition-opacity hover:opacity-100",
|
|
6705
6705
|
onClick: () => G(e)
|
|
6706
6706
|
}, "×"))), (!i || P.length < i) && /* @__PURE__ */ t.createElement("input", {
|
|
6707
|
-
id:
|
|
6707
|
+
id: K,
|
|
6708
6708
|
type: "text",
|
|
6709
6709
|
className: X("min-w-[120px] flex-1 border-none bg-transparent text-sm outline-none placeholder:text-muted-foreground", w || M.Autocomplete.className),
|
|
6710
6710
|
required: o && P.length < (r || 0),
|
|
6711
6711
|
disabled: c || s && !St(O),
|
|
6712
6712
|
placeholder: E ? m ?? "Type or press Enter to create..." : m,
|
|
6713
6713
|
title: f,
|
|
6714
|
-
list:
|
|
6714
|
+
list: te,
|
|
6715
6715
|
onChange: W,
|
|
6716
6716
|
onKeyDown: ee
|
|
6717
|
-
})), /* @__PURE__ */ t.createElement("datalist", { id:
|
|
6717
|
+
})), /* @__PURE__ */ t.createElement("datalist", { id: te }, H.map((e, n) => /* @__PURE__ */ t.createElement("option", {
|
|
6718
6718
|
value: e.value,
|
|
6719
|
-
key: `${
|
|
6719
|
+
key: `${K}-${n}`
|
|
6720
6720
|
}, e.label))), _ && /* @__PURE__ */ t.createElement(Ks, { side: "after" }, _)), j ? /* @__PURE__ */ t.createElement(hs, { message: j }) : v && /* @__PURE__ */ t.createElement("div", { className: "mt-1 text-xs text-muted-foreground" }, v));
|
|
6721
6721
|
}, Ys = ({ 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 }) => {
|
|
6722
6722
|
let { value: w, handleChange: T, formWrapClass: E } = Dd({
|
|
@@ -8034,13 +8034,13 @@ var bc = 120, xc = 88, Sc = (e) => {
|
|
|
8034
8034
|
return C((e) => o ? [...e, t] : [t]), H(""), W(void 0), B(!1), !0;
|
|
8035
8035
|
}, G = () => {
|
|
8036
8036
|
B(!1), H(""), W(void 0);
|
|
8037
|
-
},
|
|
8037
|
+
}, K = (e, t) => {
|
|
8038
8038
|
let n = e.currentTarget, r = n.naturalWidth > 0 && n.naturalHeight > 0 && (n.naturalWidth < d || n.naturalHeight < u);
|
|
8039
8039
|
R((e) => {
|
|
8040
8040
|
let n = new Set(e);
|
|
8041
8041
|
return r ? n.add(t) : n.delete(t), n;
|
|
8042
8042
|
});
|
|
8043
|
-
},
|
|
8043
|
+
}, te = ({ scales: e }) => {
|
|
8044
8044
|
if (!e) return;
|
|
8045
8045
|
let n = Object.keys(e);
|
|
8046
8046
|
return n.length === 0 ? null : n.map((n) => /* @__PURE__ */ t.createElement(Qn, { key: n }, /* @__PURE__ */ t.createElement("a", {
|
|
@@ -8082,7 +8082,7 @@ var bc = 120, xc = 88, Sc = (e) => {
|
|
|
8082
8082
|
src: Nc(e),
|
|
8083
8083
|
alt: `preview-${n}`,
|
|
8084
8084
|
className: `absolute inset-0 w-full h-full ${L.has(e.key) ? "object-contain p-1" : "object-cover"}`,
|
|
8085
|
-
onLoad: (t) =>
|
|
8085
|
+
onLoad: (t) => K(t, e.key)
|
|
8086
8086
|
}), /* @__PURE__ */ t.createElement("div", {
|
|
8087
8087
|
className: "absolute inset-0 bg-black/55 backdrop-blur-[1px] flex flex-col items-center justify-end pb-2 gap-1 transition-opacity",
|
|
8088
8088
|
style: { display: F === n ? "flex" : "none" }
|
|
@@ -8110,7 +8110,7 @@ var bc = 120, xc = 88, Sc = (e) => {
|
|
|
8110
8110
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
8111
8111
|
name: "x",
|
|
8112
8112
|
className: "w-4 h-4"
|
|
8113
|
-
}))), a && e.variants && Object.keys(e.variants).length > 0 && /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap gap-1 px-1" }, /* @__PURE__ */ t.createElement(
|
|
8113
|
+
}))), a && e.variants && Object.keys(e.variants).length > 0 && /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap gap-1 px-1" }, /* @__PURE__ */ t.createElement(te, { scales: e.variants })))) : /* @__PURE__ */ t.createElement($o, {
|
|
8114
8114
|
max: 100,
|
|
8115
8115
|
min: 0,
|
|
8116
8116
|
value: e.progress,
|
|
@@ -8855,51 +8855,51 @@ var Vl = "h-7 w-7 cursor-pointer rounded-md text-muted-foreground transition-col
|
|
|
8855
8855
|
function Wl(e) {
|
|
8856
8856
|
return e ? (e.includes("/") ? e.split("/").pop() : e) || e : null;
|
|
8857
8857
|
}
|
|
8858
|
-
function Gl({ 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,
|
|
8859
|
-
let
|
|
8858
|
+
function Gl({ 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, modelPlaceholder: b, showSettings: x = !1, defaultRole: S = "", defaultVoice: C = "", defaultStyle: w = "", defaultLanguage: T = "", defaultTemperature: E, actions: D, minHeight: O = 96, maxHeight: k = 220, wrapperClassName: A, className: j }) {
|
|
8859
|
+
let M = Y("prompt"), N = Fn("prompt"), P = m(null), F = m(null), I = u(), [L, R] = h([]), [z, B] = h(!1), V = m(0), [H, U] = h(!1), [W, ee] = h(S), [G, K] = h(C), [te, ne] = h(w), [re, ie] = h(T), [ae, oe] = h(E);
|
|
8860
8860
|
l(() => {
|
|
8861
|
-
a ||
|
|
8861
|
+
a || U(!1);
|
|
8862
8862
|
}, [a]), l(() => () => {
|
|
8863
|
-
|
|
8864
|
-
}, [
|
|
8865
|
-
let
|
|
8866
|
-
|
|
8867
|
-
}, []),
|
|
8863
|
+
L.forEach(({ objectUrl: e }) => URL.revokeObjectURL(e));
|
|
8864
|
+
}, [L]);
|
|
8865
|
+
let se = s((e) => {
|
|
8866
|
+
R((t) => (URL.revokeObjectURL(t[e].objectUrl), t.filter((t, n) => n !== e)));
|
|
8867
|
+
}, []), ce = s((e) => {
|
|
8868
8868
|
let t = Array.from(e).map((e) => ({
|
|
8869
8869
|
file: e,
|
|
8870
8870
|
objectUrl: URL.createObjectURL(e)
|
|
8871
8871
|
}));
|
|
8872
|
-
|
|
8873
|
-
}, []),
|
|
8874
|
-
!f || !e.dataTransfer.types.includes("Files") || (e.preventDefault(),
|
|
8875
|
-
}, [f]), le = s((e) => {
|
|
8876
|
-
!f || !e.dataTransfer.types.includes("Files") || e.preventDefault();
|
|
8872
|
+
R((e) => [...e, ...t]);
|
|
8873
|
+
}, []), le = s((e) => {
|
|
8874
|
+
!f || !e.dataTransfer.types.includes("Files") || (e.preventDefault(), V.current += 1, B(!0));
|
|
8877
8875
|
}, [f]), ue = s((e) => {
|
|
8878
|
-
f
|
|
8876
|
+
!f || !e.dataTransfer.types.includes("Files") || e.preventDefault();
|
|
8879
8877
|
}, [f]), de = s((e) => {
|
|
8880
|
-
f && (e.preventDefault(),
|
|
8881
|
-
}, [f
|
|
8882
|
-
|
|
8883
|
-
|
|
8878
|
+
f && (e.preventDefault(), V.current = Math.max(0, V.current - 1), V.current === 0 && B(!1));
|
|
8879
|
+
}, [f]), fe = s((e) => {
|
|
8880
|
+
f && (e.preventDefault(), V.current = 0, B(!1), e.dataTransfer.files.length && ce(e.dataTransfer.files));
|
|
8881
|
+
}, [f, ce]), q = ts({
|
|
8882
|
+
minHeight: O,
|
|
8883
|
+
maxHeight: k
|
|
8884
8884
|
});
|
|
8885
8885
|
l(() => {
|
|
8886
|
-
let e =
|
|
8886
|
+
let e = P.current;
|
|
8887
8887
|
if (!e) return;
|
|
8888
8888
|
e.style.height = "auto";
|
|
8889
|
-
let t = Math.max(e.scrollHeight,
|
|
8890
|
-
e.style.height = `${n}px`, e.style.overflowY =
|
|
8889
|
+
let t = Math.max(e.scrollHeight, q.resolvedMinHeight), n = q.resolvedMaxHeight ? Math.min(t, q.resolvedMaxHeight) : t;
|
|
8890
|
+
e.style.height = `${n}px`, e.style.overflowY = q.resolvedMaxHeight && t > q.resolvedMaxHeight ? "auto" : "hidden";
|
|
8891
8891
|
}, [
|
|
8892
8892
|
n,
|
|
8893
|
-
|
|
8894
|
-
|
|
8893
|
+
q.resolvedMinHeight,
|
|
8894
|
+
q.resolvedMaxHeight
|
|
8895
8895
|
]);
|
|
8896
|
-
let
|
|
8896
|
+
let pe = p?.length ? g ?? "/" : void 0, me = (p?.length ?? 0) >= 10, he = t.useMemo(() => new Map((p ?? []).map((e) => [e.name, e])), [p]), ge = t.useMemo(() => (p ?? []).map((e) => ({
|
|
8897
8897
|
key: e.name,
|
|
8898
|
-
label: `${
|
|
8898
|
+
label: `${pe ?? "/"}${e.name}`,
|
|
8899
8899
|
value: e.name,
|
|
8900
8900
|
icon: e.icon
|
|
8901
|
-
})), [p,
|
|
8902
|
-
let n =
|
|
8901
|
+
})), [p, pe]), _e = s(async (e, t) => {
|
|
8902
|
+
let n = he.get(e.value);
|
|
8903
8903
|
if (n) {
|
|
8904
8904
|
if (n.handler) {
|
|
8905
8905
|
let e = await n.handler(Ll(t)), r = n.consumeSuffix ? Pl(t.textAfterCaret, n.consumeSuffix) : 0;
|
|
@@ -8908,48 +8908,48 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
8908
8908
|
}
|
|
8909
8909
|
t.replace(t.triggerRange.start, t.triggerRange.end, `${t.trigger}${n.name} `);
|
|
8910
8910
|
}
|
|
8911
|
-
}, [
|
|
8911
|
+
}, [he]), ve = Wl(v), ye = () => {
|
|
8912
8912
|
c || a || (d({
|
|
8913
8913
|
text: n,
|
|
8914
|
-
files:
|
|
8914
|
+
files: L.map((e) => e.file),
|
|
8915
8915
|
model: v ?? "",
|
|
8916
|
-
...
|
|
8917
|
-
role:
|
|
8918
|
-
voice:
|
|
8916
|
+
...x ? {
|
|
8917
|
+
role: W,
|
|
8918
|
+
voice: G,
|
|
8919
8919
|
style: te,
|
|
8920
8920
|
language: re,
|
|
8921
|
-
temperature:
|
|
8921
|
+
temperature: ae
|
|
8922
8922
|
} : {}
|
|
8923
|
-
}),
|
|
8924
|
-
},
|
|
8923
|
+
}), L.forEach(({ objectUrl: e }) => URL.revokeObjectURL(e)), R([]));
|
|
8924
|
+
}, be = () => {
|
|
8925
8925
|
if (a) {
|
|
8926
|
-
|
|
8926
|
+
U(!0), o?.();
|
|
8927
8927
|
return;
|
|
8928
8928
|
}
|
|
8929
|
-
|
|
8930
|
-
},
|
|
8931
|
-
id:
|
|
8929
|
+
ye();
|
|
8930
|
+
}, xe = /* @__PURE__ */ t.createElement("textarea", {
|
|
8931
|
+
id: I,
|
|
8932
8932
|
name: e,
|
|
8933
|
-
ref:
|
|
8933
|
+
ref: P,
|
|
8934
8934
|
value: n,
|
|
8935
8935
|
onChange: (e) => r(e.target.value),
|
|
8936
8936
|
placeholder: i,
|
|
8937
|
-
className:
|
|
8938
|
-
style: { maxHeight:
|
|
8937
|
+
className: j || Ul,
|
|
8938
|
+
style: { maxHeight: k },
|
|
8939
8939
|
onKeyDown: (e) => {
|
|
8940
|
-
e.key === "Enter" && !e.shiftKey && !
|
|
8940
|
+
e.key === "Enter" && !e.shiftKey && !pe && (e.preventDefault(), be());
|
|
8941
8941
|
}
|
|
8942
8942
|
});
|
|
8943
|
-
return /* @__PURE__ */ t.createElement(Z, { className:
|
|
8944
|
-
className: `group relative rounded-xl border shadow-sm transition-shadow focus-within:shadow-md focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0 ${
|
|
8945
|
-
onDragEnter:
|
|
8946
|
-
onDragOver:
|
|
8947
|
-
onDragLeave:
|
|
8948
|
-
onDrop:
|
|
8949
|
-
}, f &&
|
|
8943
|
+
return /* @__PURE__ */ t.createElement(Z, { className: A || M.Prompt.wrapperClassName }, /* @__PURE__ */ t.createElement("div", {
|
|
8944
|
+
className: `group relative rounded-xl border shadow-sm transition-shadow focus-within:shadow-md focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0 ${z ? "border-primary ring-2 ring-primary" : "border-input"}`,
|
|
8945
|
+
onDragEnter: le,
|
|
8946
|
+
onDragOver: ue,
|
|
8947
|
+
onDragLeave: de,
|
|
8948
|
+
onDrop: fe
|
|
8949
|
+
}, f && z && /* @__PURE__ */ t.createElement("div", { className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-xl bg-primary/5" }, /* @__PURE__ */ t.createElement("div", { className: "flex items-center gap-2 rounded-lg bg-background px-3 py-1.5 text-xs font-medium text-primary shadow" }, /* @__PURE__ */ t.createElement(Q, {
|
|
8950
8950
|
name: "paperclip",
|
|
8951
8951
|
size: 13
|
|
8952
|
-
}),
|
|
8952
|
+
}), N.dropFilesHere)), /* @__PURE__ */ t.createElement("div", { className: "overflow-hidden rounded-t-xl" }, L.length > 0 && /* @__PURE__ */ t.createElement("div", { className: "flex gap-2 overflow-x-auto border-b border-input px-3 py-2.5" }, L.map(({ file: e, objectUrl: n }, r) => /* @__PURE__ */ t.createElement("div", {
|
|
8953
8953
|
key: n,
|
|
8954
8954
|
className: "relative shrink-0"
|
|
8955
8955
|
}, e.type.startsWith("image/") ? /* @__PURE__ */ t.createElement("div", { className: "h-16 w-16 overflow-hidden rounded-lg border border-input bg-muted/30" }, /* @__PURE__ */ t.createElement("img", {
|
|
@@ -8963,38 +8963,38 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
8963
8963
|
}), /* @__PURE__ */ t.createElement("div", { className: "max-w-[100px]" }, /* @__PURE__ */ t.createElement("p", { className: "truncate font-medium text-foreground" }, e.name), /* @__PURE__ */ t.createElement("p", { className: "text-muted-foreground" }, (e.size / 1024).toFixed(0), " KB"))), /* @__PURE__ */ t.createElement("button", {
|
|
8964
8964
|
type: "button",
|
|
8965
8965
|
className: "absolute -right-1.5 -top-1.5 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-foreground text-background shadow",
|
|
8966
|
-
onClick: () =>
|
|
8966
|
+
onClick: () => se(r)
|
|
8967
8967
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
8968
8968
|
name: "x",
|
|
8969
8969
|
size: 9
|
|
8970
|
-
}))))),
|
|
8971
|
-
trigger:
|
|
8972
|
-
searchable:
|
|
8970
|
+
}))))), pe && ge.length > 0 ? /* @__PURE__ */ t.createElement(Bl, {
|
|
8971
|
+
trigger: pe,
|
|
8972
|
+
searchable: me,
|
|
8973
8973
|
onSelect: (e, t) => {
|
|
8974
|
-
|
|
8974
|
+
_e(e, t);
|
|
8975
8975
|
}
|
|
8976
|
-
},
|
|
8976
|
+
}, ge.map((e) => /* @__PURE__ */ t.createElement(Bl.Item, {
|
|
8977
8977
|
key: e.key,
|
|
8978
8978
|
label: e.label,
|
|
8979
8979
|
value: e.value,
|
|
8980
8980
|
icon: e.icon
|
|
8981
|
-
})),
|
|
8982
|
-
ref:
|
|
8981
|
+
})), xe) : xe), f && /* @__PURE__ */ t.createElement("input", {
|
|
8982
|
+
ref: F,
|
|
8983
8983
|
type: "file",
|
|
8984
8984
|
multiple: !0,
|
|
8985
8985
|
className: "hidden",
|
|
8986
8986
|
onChange: (e) => {
|
|
8987
|
-
e.target.files && (
|
|
8987
|
+
e.target.files && (ce(e.target.files), e.target.value = "");
|
|
8988
8988
|
}
|
|
8989
|
-
}), /* @__PURE__ */ t.createElement("div", { className: "relative flex items-center gap-1 rounded-b-xl border-t border-input px-2 py-1" }, (f || (
|
|
8989
|
+
}), /* @__PURE__ */ t.createElement("div", { className: "relative flex items-center gap-1 rounded-b-xl border-t border-input px-2 py-1" }, (f || (D?.length ?? 0) > 0) && /* @__PURE__ */ t.createElement(t.Fragment, null, f && /* @__PURE__ */ t.createElement("button", {
|
|
8990
8990
|
type: "button",
|
|
8991
|
-
title:
|
|
8991
|
+
title: N.attachFiles,
|
|
8992
8992
|
className: `${Vl} flex items-center justify-center`,
|
|
8993
|
-
onClick: () =>
|
|
8993
|
+
onClick: () => F.current?.click()
|
|
8994
8994
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
8995
8995
|
name: "paperclip",
|
|
8996
8996
|
size: 13
|
|
8997
|
-
})),
|
|
8997
|
+
})), D?.map((e) => e.content ? /* @__PURE__ */ t.createElement(Ri, {
|
|
8998
8998
|
key: e.key,
|
|
8999
8999
|
trigger: {
|
|
9000
9000
|
icon: e.icon,
|
|
@@ -9014,7 +9014,7 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9014
9014
|
}))), /* @__PURE__ */ t.createElement("div", { className: "mx-1 h-4 w-px shrink-0 bg-border" })), _.length > 0 && /* @__PURE__ */ t.createElement(Ri, {
|
|
9015
9015
|
trigger: {
|
|
9016
9016
|
icon: "cpu",
|
|
9017
|
-
text:
|
|
9017
|
+
text: ve ?? b ?? N.defaultOption
|
|
9018
9018
|
},
|
|
9019
9019
|
placement: "top",
|
|
9020
9020
|
position: "start",
|
|
@@ -9022,7 +9022,7 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9022
9022
|
}, _.map((e) => /* @__PURE__ */ t.createElement(Vi, {
|
|
9023
9023
|
key: e.value,
|
|
9024
9024
|
onClick: () => y?.(e.value)
|
|
9025
|
-
}, e.label))),
|
|
9025
|
+
}, e.label))), x && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(Ri, {
|
|
9026
9026
|
trigger: {
|
|
9027
9027
|
icon: "user",
|
|
9028
9028
|
title: "Role"
|
|
@@ -9030,9 +9030,9 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9030
9030
|
placement: "top",
|
|
9031
9031
|
position: "start",
|
|
9032
9032
|
triggerClassName: Vl
|
|
9033
|
-
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () =>
|
|
9033
|
+
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () => ee("") }, N.defaultOption), Jc.getRoles().map((e) => /* @__PURE__ */ t.createElement(Vi, {
|
|
9034
9034
|
key: e,
|
|
9035
|
-
onClick: () =>
|
|
9035
|
+
onClick: () => ee(e)
|
|
9036
9036
|
}, e))), /* @__PURE__ */ t.createElement(Ri, {
|
|
9037
9037
|
trigger: {
|
|
9038
9038
|
icon: "globe",
|
|
@@ -9041,9 +9041,9 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9041
9041
|
placement: "top",
|
|
9042
9042
|
position: "start",
|
|
9043
9043
|
triggerClassName: Vl
|
|
9044
|
-
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () =>
|
|
9044
|
+
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () => ie("") }, N.defaultOption), Jc.getLangs().map((e) => /* @__PURE__ */ t.createElement(Vi, {
|
|
9045
9045
|
key: e,
|
|
9046
|
-
onClick: () =>
|
|
9046
|
+
onClick: () => ie(e)
|
|
9047
9047
|
}, e))), /* @__PURE__ */ t.createElement(Ri, {
|
|
9048
9048
|
trigger: {
|
|
9049
9049
|
icon: "mic",
|
|
@@ -9052,9 +9052,9 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9052
9052
|
placement: "top",
|
|
9053
9053
|
position: "start",
|
|
9054
9054
|
triggerClassName: Vl
|
|
9055
|
-
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () =>
|
|
9055
|
+
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () => K("") }, N.defaultOption), Jc.getVoices().map((e) => /* @__PURE__ */ t.createElement(Vi, {
|
|
9056
9056
|
key: e,
|
|
9057
|
-
onClick: () =>
|
|
9057
|
+
onClick: () => K(e)
|
|
9058
9058
|
}, e))), /* @__PURE__ */ t.createElement(Ri, {
|
|
9059
9059
|
trigger: {
|
|
9060
9060
|
icon: "feather",
|
|
@@ -9063,7 +9063,7 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9063
9063
|
placement: "top",
|
|
9064
9064
|
position: "start",
|
|
9065
9065
|
triggerClassName: Vl
|
|
9066
|
-
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () => ne("") },
|
|
9066
|
+
}, /* @__PURE__ */ t.createElement(Vi, { onClick: () => ne("") }, N.defaultOption), Jc.getStyles().map((e) => /* @__PURE__ */ t.createElement(Vi, {
|
|
9067
9067
|
key: e,
|
|
9068
9068
|
onClick: () => ne(e)
|
|
9069
9069
|
}, e))), /* @__PURE__ */ t.createElement(Ri, {
|
|
@@ -9080,17 +9080,17 @@ function Gl({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
|
|
|
9080
9080
|
min: 0,
|
|
9081
9081
|
max: 1,
|
|
9082
9082
|
step: .1,
|
|
9083
|
-
value:
|
|
9084
|
-
onChange: (e) =>
|
|
9083
|
+
value: ae ?? 0,
|
|
9084
|
+
onChange: (e) => oe(Number(e.target.value)),
|
|
9085
9085
|
className: "w-full cursor-pointer accent-primary"
|
|
9086
9086
|
})))), /* @__PURE__ */ t.createElement("div", { className: "flex-1" }), /* @__PURE__ */ t.createElement("button", {
|
|
9087
9087
|
type: "button",
|
|
9088
|
-
onClick:
|
|
9088
|
+
onClick: be,
|
|
9089
9089
|
disabled: a ? !o : c,
|
|
9090
|
-
title:
|
|
9091
|
-
"aria-label":
|
|
9090
|
+
title: H ? "Stopping…" : a ? "Stop" : N.run,
|
|
9091
|
+
"aria-label": H ? "Stopping…" : a ? "Stop" : N.run,
|
|
9092
9092
|
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"}`
|
|
9093
|
-
},
|
|
9093
|
+
}, H || 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, {
|
|
9094
9094
|
name: a ? "square" : "send",
|
|
9095
9095
|
size: 14
|
|
9096
9096
|
})))));
|
|
@@ -9235,12 +9235,12 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9235
9235
|
let { handleChange: C, record: w } = Dd({
|
|
9236
9236
|
name: e,
|
|
9237
9237
|
subscribeToFullRecord: !0
|
|
9238
|
-
}), T = Y("prompt"), E = Fn("prompt"), D = n || e, [O, k] = h(!1), [A, j] = h(o?.value ?? ""), [M, N] = h(!1), [P, F] = h(null), I = $c(), L = el(), { modelOptions: R } = eu(), z = typeof localStorage < "u" ? localStorage.getItem("prompt.model") : null, B = z && R.some((e) => e.value === z) ? z : "", V = t.useMemo(() => lu(r?.prompt, o), [o, r?.prompt]), H = V.model || B, U = u(), W = tu(H, !!m), ee = !W.configured || !m && !H, [G,
|
|
9238
|
+
}), T = Y("prompt"), E = Fn("prompt"), D = n || e, [O, k] = h(!1), [A, j] = h(o?.value ?? ""), [M, N] = h(!1), [P, F] = h(null), I = $c(), L = el(), { modelOptions: R } = eu(), z = typeof localStorage < "u" ? localStorage.getItem("prompt.model") : null, B = z && R.some((e) => e.value === z) ? z : "", V = t.useMemo(() => lu(r?.prompt, o), [o, r?.prompt]), H = V.model || B, U = u(), W = tu(H, !!m), ee = !W.configured || !m && !H, [G, K] = h(null), te = !G && !W.configured ? g?.({
|
|
9239
9239
|
mode: "run",
|
|
9240
9240
|
providerId: W.providerId,
|
|
9241
9241
|
reason: W.reason,
|
|
9242
9242
|
configured: W.configured
|
|
9243
|
-
}) : null,
|
|
9243
|
+
}) : null, ne = t.useMemo(() => {
|
|
9244
9244
|
if (!A) return "";
|
|
9245
9245
|
let e = {
|
|
9246
9246
|
...w,
|
|
@@ -9251,7 +9251,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9251
9251
|
A,
|
|
9252
9252
|
w,
|
|
9253
9253
|
_
|
|
9254
|
-
]),
|
|
9254
|
+
]), re = ne !== A, ie = (e, t) => C?.({ target: {
|
|
9255
9255
|
name: e,
|
|
9256
9256
|
value: t
|
|
9257
9257
|
} }), ae = x?.map((e) => e.key === "tokenUsage" && !e.content ? {
|
|
@@ -9275,7 +9275,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9275
9275
|
noProvider: E.noProvider,
|
|
9276
9276
|
noResponse: E.noResponse
|
|
9277
9277
|
}), c = Date.now() - a;
|
|
9278
|
-
if (
|
|
9278
|
+
if (K(null), C?.({ target: {
|
|
9279
9279
|
name: e + ".value",
|
|
9280
9280
|
value: s
|
|
9281
9281
|
} }), t.role !== void 0 && ie(e + ".prompt.role", t.role), t.voice !== void 0 && ie(e + ".prompt.voice", t.voice), t.style !== void 0 && ie(e + ".prompt.style", t.style), t.language !== void 0 && ie(e + ".prompt.language", t.language), S && S.length > 0) {
|
|
@@ -9290,7 +9290,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9290
9290
|
});
|
|
9291
9291
|
}
|
|
9292
9292
|
} catch (e) {
|
|
9293
|
-
|
|
9293
|
+
K(Ql(e, E.runFailed));
|
|
9294
9294
|
}
|
|
9295
9295
|
};
|
|
9296
9296
|
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: `${ql} min-w-0 flex-1` }, D && /* @__PURE__ */ t.createElement($l, {
|
|
@@ -9318,7 +9318,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9318
9318
|
className: `${p || T.Prompt.className} ${su}`,
|
|
9319
9319
|
minHeight: s,
|
|
9320
9320
|
maxHeight: c
|
|
9321
|
-
}),
|
|
9321
|
+
}), 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", {
|
|
9322
9322
|
type: "button",
|
|
9323
9323
|
title: M ? E.hidePreview : E.showPreview,
|
|
9324
9324
|
className: `${cu} flex items-center justify-center ${M ? "bg-muted text-foreground" : ""}`,
|
|
@@ -9365,7 +9365,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9365
9365
|
maxHeight: c,
|
|
9366
9366
|
className: p || T.Prompt.className,
|
|
9367
9367
|
wrapperClassName: ""
|
|
9368
|
-
}), (G || !W.configured) && (
|
|
9368
|
+
}), (G || !W.configured) && (te ? /* @__PURE__ */ t.createElement("div", { className: "mt-1" }, te) : /* @__PURE__ */ t.createElement("span", { className: "mt-1 flex min-w-0 items-center gap-1 text-xs text-warning" }, /* @__PURE__ */ t.createElement(Q, {
|
|
9369
9369
|
name: "triangle-alert",
|
|
9370
9370
|
size: 13,
|
|
9371
9371
|
className: "shrink-0"
|
|
@@ -9621,16 +9621,16 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9621
9621
|
editorContext: null
|
|
9622
9622
|
}), H = m(j ?? ""), U = m(B);
|
|
9623
9623
|
U.current = B;
|
|
9624
|
-
let W = S?.length ? C ?? "/" : void 0, ee = (S?.length ?? 0) >= 10, G = t.useMemo(() => new Map((S ?? []).map((e) => [e.name, e])), [S]),
|
|
9624
|
+
let W = S?.length ? C ?? "/" : void 0, ee = (S?.length ?? 0) >= 10, G = t.useMemo(() => new Map((S ?? []).map((e) => [e.name, e])), [S]), K = t.useMemo(() => (S ?? []).map((e) => ({
|
|
9625
9625
|
key: e.name,
|
|
9626
9626
|
label: `${W ?? "/"}${e.name}`,
|
|
9627
9627
|
value: e.name,
|
|
9628
9628
|
icon: e.icon,
|
|
9629
9629
|
description: e.description,
|
|
9630
9630
|
group: e.group
|
|
9631
|
-
})), [S, W]),
|
|
9631
|
+
})), [S, W]), te = t.useMemo(() => {
|
|
9632
9632
|
let e = [], n;
|
|
9633
|
-
return
|
|
9633
|
+
return K.forEach((r) => {
|
|
9634
9634
|
r.group !== n && (n = r.group, r.group && e.push(/* @__PURE__ */ t.createElement(Bl.Heading, { key: `group:${r.group}` }, r.group))), e.push(/* @__PURE__ */ t.createElement(Bl.Item, {
|
|
9635
9635
|
key: r.key,
|
|
9636
9636
|
label: r.label,
|
|
@@ -9639,17 +9639,17 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9639
9639
|
description: r.description
|
|
9640
9640
|
}));
|
|
9641
9641
|
}), e;
|
|
9642
|
-
}, [
|
|
9642
|
+
}, [K]);
|
|
9643
9643
|
l(() => {
|
|
9644
9644
|
I.current || (H.current = j ?? "");
|
|
9645
9645
|
}, [j]);
|
|
9646
|
-
let
|
|
9646
|
+
let ne = s((t) => {
|
|
9647
9647
|
H.current = t, M({ target: {
|
|
9648
9648
|
name: e,
|
|
9649
9649
|
value: t
|
|
9650
9650
|
} });
|
|
9651
|
-
}, [M, e]),
|
|
9652
|
-
|
|
9651
|
+
}, [M, e]), re = m(ne);
|
|
9652
|
+
re.current = ne;
|
|
9653
9653
|
let ie = s(() => {
|
|
9654
9654
|
V({
|
|
9655
9655
|
open: !1,
|
|
@@ -9717,7 +9717,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9717
9717
|
n.language,
|
|
9718
9718
|
r,
|
|
9719
9719
|
n.EditorView.updateListener.of((e) => {
|
|
9720
|
-
e.docChanged &&
|
|
9720
|
+
e.docChanged && re.current(e.state.doc.toString());
|
|
9721
9721
|
}),
|
|
9722
9722
|
...x ?? []
|
|
9723
9723
|
];
|
|
@@ -9825,7 +9825,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9825
9825
|
required: p,
|
|
9826
9826
|
htmlFor: O,
|
|
9827
9827
|
className: v
|
|
9828
|
-
}), /* @__PURE__ */ t.createElement("div", { className: X(E || D ? os : "", 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 &&
|
|
9828
|
+
}), /* @__PURE__ */ t.createElement("div", { className: X(E || D ? os : "", 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 && K.length > 0 ? /* @__PURE__ */ t.createElement(Bl, {
|
|
9829
9829
|
ref: L,
|
|
9830
9830
|
className: X(A.fill && "flex-1 min-h-0 flex flex-col"),
|
|
9831
9831
|
trigger: W,
|
|
@@ -9840,7 +9840,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9840
9840
|
onSelect: (e, t) => {
|
|
9841
9841
|
ae(e, t);
|
|
9842
9842
|
}
|
|
9843
|
-
},
|
|
9843
|
+
}, te, se) : se, 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(hs, { message: P }), _ && /* @__PURE__ */ t.createElement("p", { className: "mt-1 text-xs text-muted-foreground" }, _));
|
|
9844
9844
|
}, Nu = () => Promise.all([
|
|
9845
9845
|
import("@tiptap/react"),
|
|
9846
9846
|
import("@tiptap/react/menus"),
|
|
@@ -10467,19 +10467,19 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
10467
10467
|
a
|
|
10468
10468
|
] : a;
|
|
10469
10469
|
}
|
|
10470
|
-
}), { 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), G = m(null), [
|
|
10470
|
+
}), { 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), G = m(null), [K, te] = h({
|
|
10471
10471
|
open: !1,
|
|
10472
10472
|
query: "",
|
|
10473
10473
|
anchorPosition: null,
|
|
10474
10474
|
editorContext: null
|
|
10475
|
-
}),
|
|
10476
|
-
|
|
10477
|
-
let
|
|
10475
|
+
}), ne = m(K);
|
|
10476
|
+
ne.current = K;
|
|
10477
|
+
let re = 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) => ({
|
|
10478
10478
|
key: e.name,
|
|
10479
|
-
label: `${
|
|
10479
|
+
label: `${re ?? "/"}${e.name}`,
|
|
10480
10480
|
value: e.name,
|
|
10481
10481
|
icon: e.icon
|
|
10482
|
-
})), [x,
|
|
10482
|
+
})), [x, re]), se = g?.srcsetWidths === void 0 ? [400, 800] : g.srcsetWidths, ce = lc(), le = Dc({
|
|
10483
10483
|
uploadPath: g?.path,
|
|
10484
10484
|
srcsetWidths: se,
|
|
10485
10485
|
onFileReady: (e) => {
|
|
@@ -10495,7 +10495,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
10495
10495
|
maxHeight: p,
|
|
10496
10496
|
paddingOffset: 16
|
|
10497
10497
|
}), de = s(() => {
|
|
10498
|
-
|
|
10498
|
+
te({
|
|
10499
10499
|
open: !1,
|
|
10500
10500
|
query: "",
|
|
10501
10501
|
anchorPosition: null,
|
|
@@ -10574,7 +10574,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
10574
10574
|
return !1;
|
|
10575
10575
|
},
|
|
10576
10576
|
handleKeyDown(e, t) {
|
|
10577
|
-
if (!
|
|
10577
|
+
if (!ne.current.open) return !1;
|
|
10578
10578
|
switch (t.key) {
|
|
10579
10579
|
case "ArrowDown": return t.preventDefault(), G.current?.moveNext(), !0;
|
|
10580
10580
|
case "ArrowUp": return t.preventDefault(), G.current?.movePrev(), !0;
|
|
@@ -10600,32 +10600,32 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
10600
10600
|
q.off("selectionUpdate", W);
|
|
10601
10601
|
};
|
|
10602
10602
|
}, [q, ue.adjustedMinHeight]), l(() => {
|
|
10603
|
-
if (!q || !
|
|
10604
|
-
|
|
10603
|
+
if (!q || !re || I) {
|
|
10604
|
+
ne.current.open && de();
|
|
10605
10605
|
return;
|
|
10606
10606
|
}
|
|
10607
10607
|
let e = () => {
|
|
10608
10608
|
if (!q.isFocused) {
|
|
10609
|
-
|
|
10609
|
+
ne.current.open && de();
|
|
10610
10610
|
return;
|
|
10611
10611
|
}
|
|
10612
10612
|
let e = q.state.selection;
|
|
10613
10613
|
if (!e.empty) {
|
|
10614
|
-
|
|
10614
|
+
ne.current.open && de();
|
|
10615
10615
|
return;
|
|
10616
10616
|
}
|
|
10617
10617
|
let { $from: t } = e, n = t.parent;
|
|
10618
10618
|
if (!n.isTextblock) {
|
|
10619
|
-
|
|
10619
|
+
ne.current.open && de();
|
|
10620
10620
|
return;
|
|
10621
10621
|
}
|
|
10622
|
-
let r = n.textContent ?? "", i = t.parentOffset, a = Qu(r, i,
|
|
10622
|
+
let r = n.textContent ?? "", i = t.parentOffset, a = Qu(r, i, re);
|
|
10623
10623
|
if (!a) {
|
|
10624
|
-
|
|
10624
|
+
ne.current.open && de();
|
|
10625
10625
|
return;
|
|
10626
10626
|
}
|
|
10627
|
-
let o = q.view.coordsAtPos(e.from), s = fe(q,
|
|
10628
|
-
!o || !s ||
|
|
10627
|
+
let o = q.view.coordsAtPos(e.from), s = fe(q, re);
|
|
10628
|
+
!o || !s || te({
|
|
10629
10629
|
open: !0,
|
|
10630
10630
|
query: a.query,
|
|
10631
10631
|
anchorPosition: {
|
|
@@ -10642,7 +10642,7 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
10642
10642
|
de,
|
|
10643
10643
|
q,
|
|
10644
10644
|
fe,
|
|
10645
|
-
|
|
10645
|
+
re,
|
|
10646
10646
|
I
|
|
10647
10647
|
]);
|
|
10648
10648
|
let me = s(async (e, t) => {
|
|
@@ -10863,15 +10863,15 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
10863
10863
|
style: ue.wrapperStyle,
|
|
10864
10864
|
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)]")
|
|
10865
10865
|
}, /* @__PURE__ */ t.createElement(w, { editor: q }));
|
|
10866
|
-
return
|
|
10866
|
+
return re && oe.length > 0 ? /* @__PURE__ */ t.createElement(Bl, {
|
|
10867
10867
|
ref: G,
|
|
10868
|
-
trigger:
|
|
10868
|
+
trigger: re,
|
|
10869
10869
|
searchable: ie,
|
|
10870
|
-
controlled:
|
|
10871
|
-
open:
|
|
10872
|
-
anchorPosition:
|
|
10873
|
-
query:
|
|
10874
|
-
editorContext:
|
|
10870
|
+
controlled: K.editorContext ? {
|
|
10871
|
+
open: K.open,
|
|
10872
|
+
anchorPosition: K.anchorPosition,
|
|
10873
|
+
query: K.query,
|
|
10874
|
+
editorContext: K.editorContext,
|
|
10875
10875
|
onClose: de
|
|
10876
10876
|
} : void 0,
|
|
10877
10877
|
onSelect: (e, t) => {
|
|
@@ -12060,7 +12060,7 @@ function Fd(e) {
|
|
|
12060
12060
|
var Id = {}, Ld = ({ 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: _ = void 0, onDelete: v = void 0, onComplete: y = void 0, log: b = !1, showNotice: S = !0, draftBucket: C = void 0, noticeAnchorRef: w = void 0, showBack: T = !1, wrapperClassName: E = void 0, headerClassName: D = void 0, className: O = void 0, footerClassName: k = void 0, formClassName: A = void 0 }) => {
|
|
12061
12061
|
let j = x(), N = Y("form"), P = Fn("form"), F = Ti(), I = _d(r), L = md(I), R = m(void 0);
|
|
12062
12062
|
R.current ||= Fd(c);
|
|
12063
|
-
let z = R.current, B = g(z.subscribe, z.getRecord), V = z.setRecord, [H, U] = h(!1), [W, ee] = h(!1), G = !c?.[za],
|
|
12063
|
+
let z = R.current, B = g(z.subscribe, z.getRecord), V = z.setRecord, [H, U] = h(!1), [W, ee] = h(!1), G = !c?.[za], K = m(wt(c ?? {})), [te, ne] = h(() => Nd(c)), [re, ie] = h(null), ae = m({ isDirty: !1 }), oe = p(() => {
|
|
12064
12064
|
if (!C) return;
|
|
12065
12065
|
let e = ct(C), t = ct(o || `${j.pathname}${j.hash || ""}`);
|
|
12066
12066
|
return e && t ? `llmnative.form-draft.${e}.${t}` : void 0;
|
|
@@ -12069,12 +12069,12 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12069
12069
|
j.pathname,
|
|
12070
12070
|
j.hash,
|
|
12071
12071
|
o
|
|
12072
|
-
]), se = !!(_ || o || !G), ce = !!(v || !G), le = p(() => !Ft(B,
|
|
12072
|
+
]), se = !!(_ || o || !G), ce = !!(v || !G), le = p(() => !Ft(B, K.current), [B, K.current]), ue = P.noChangesToSave ?? "No changes to save", de = P.draftRestoreTitle ?? "Unsaved changes found", fe = P.draftRestoreMessage ?? "A local draft is available for this form. Restore it or discard it.", q = P.draftRestoreAction ?? "Restore", pe = P.draftDiscardAction ?? "Discard", me = P.draftRestoredTitle ?? "Draft restored", he = P.draftRestoredMessage ?? "The local draft has been restored. You can still discard it for a few seconds.", ge = s(() => {
|
|
12073
12073
|
!oe || typeof localStorage > "u" || localStorage.removeItem(oe);
|
|
12074
12074
|
}, [oe]), _e = s(() => {
|
|
12075
12075
|
if (!(!oe || typeof localStorage > "u")) return Pd(localStorage.getItem(oe));
|
|
12076
12076
|
}, [oe]), ve = s(() => {
|
|
12077
|
-
V(wt(
|
|
12077
|
+
V(wt(K.current));
|
|
12078
12078
|
}, []), [ye, be] = h(void 0), xe = s(({ message: e, type: t = "danger" }) => {
|
|
12079
12079
|
S && be({
|
|
12080
12080
|
type: t,
|
|
@@ -12179,7 +12179,7 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12179
12179
|
action: t,
|
|
12180
12180
|
storagePath: je.current
|
|
12181
12181
|
})) ?? ze(Ee.current ?? {});
|
|
12182
|
-
return e && await F.set(e, Nt(Ee.current)),
|
|
12182
|
+
return e && await F.set(e, Nt(Ee.current)), K.current = wt(Ee.current ?? {}), ne(Nd(Ee.current)), ge(), ie(null), await Be(t);
|
|
12183
12183
|
} finally {
|
|
12184
12184
|
U(!1);
|
|
12185
12185
|
}
|
|
@@ -12211,7 +12211,7 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12211
12211
|
]);
|
|
12212
12212
|
l(() => {
|
|
12213
12213
|
let e = wt(c ?? {});
|
|
12214
|
-
if (c && (V(e), d?.(wt(e))),
|
|
12214
|
+
if (c && (V(e), d?.(wt(e))), K.current = e, ne(Nd(e)), !C) {
|
|
12215
12215
|
ie(null);
|
|
12216
12216
|
return;
|
|
12217
12217
|
}
|
|
@@ -12241,7 +12241,7 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12241
12241
|
if (!oe || typeof localStorage > "u" || B === void 0) return;
|
|
12242
12242
|
if (!le) {
|
|
12243
12243
|
let e = _e();
|
|
12244
|
-
if (e && Nd(e) !==
|
|
12244
|
+
if (e && Nd(e) !== te) return;
|
|
12245
12245
|
localStorage.removeItem(oe);
|
|
12246
12246
|
return;
|
|
12247
12247
|
}
|
|
@@ -12250,7 +12250,7 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12250
12250
|
}, 150);
|
|
12251
12251
|
return () => window.clearTimeout(e);
|
|
12252
12252
|
}, [
|
|
12253
|
-
|
|
12253
|
+
te,
|
|
12254
12254
|
oe,
|
|
12255
12255
|
le,
|
|
12256
12256
|
_e,
|
|
@@ -12294,8 +12294,8 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12294
12294
|
isDeleting: W,
|
|
12295
12295
|
saveDisabled: !se || !le || H,
|
|
12296
12296
|
deleteDisabled: !ce || W,
|
|
12297
|
-
hasDraft:
|
|
12298
|
-
draftStatus:
|
|
12297
|
+
hasDraft: re !== null,
|
|
12298
|
+
draftStatus: re,
|
|
12299
12299
|
errors: Se,
|
|
12300
12300
|
hasErrors: Object.keys(Se).length > 0
|
|
12301
12301
|
});
|
|
@@ -12303,7 +12303,7 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12303
12303
|
ce,
|
|
12304
12304
|
se,
|
|
12305
12305
|
L,
|
|
12306
|
-
|
|
12306
|
+
re,
|
|
12307
12307
|
Se,
|
|
12308
12308
|
W,
|
|
12309
12309
|
le,
|
|
@@ -12340,13 +12340,13 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12340
12340
|
timeout: ye.type === "success" ? 3e3 : void 0,
|
|
12341
12341
|
onClose: ye.type === "success" ? () => be(void 0) : void 0
|
|
12342
12342
|
}, ye.message) : null, [ye, w]), Je = p(() => {
|
|
12343
|
-
if (!
|
|
12344
|
-
let e =
|
|
12343
|
+
if (!re) return null;
|
|
12344
|
+
let e = re === "restore" ? de : me, n = re === "restore" ? fe : he;
|
|
12345
12345
|
return /* @__PURE__ */ t.createElement(Io, {
|
|
12346
|
-
variant:
|
|
12347
|
-
timeout:
|
|
12348
|
-
onClose:
|
|
12349
|
-
}, /* @__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" },
|
|
12346
|
+
variant: re === "restore" ? "warning" : "info",
|
|
12347
|
+
timeout: re === "restored" ? 6e3 : void 0,
|
|
12348
|
+
onClose: re === "restored" ? () => ie(null) : void 0
|
|
12349
|
+
}, /* @__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" }, re === "restore" ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(Hr, {
|
|
12350
12350
|
label: q,
|
|
12351
12351
|
variant: "warning",
|
|
12352
12352
|
onClick: () => Pe()
|
|
@@ -12362,7 +12362,7 @@ var Id = {}, Ld = ({ children: e, appearance: n = void 0, controller: r = void 0
|
|
|
12362
12362
|
}, [
|
|
12363
12363
|
Ne,
|
|
12364
12364
|
pe,
|
|
12365
|
-
|
|
12365
|
+
re,
|
|
12366
12366
|
q,
|
|
12367
12367
|
fe,
|
|
12368
12368
|
de,
|
|
@@ -12688,7 +12688,7 @@ function $d(e, t) {
|
|
|
12688
12688
|
function ef({ 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 }) {
|
|
12689
12689
|
let F = Y("table"), I = Fn("table"), L = N || F.Table.selectedClassName, [R, z] = h(n || []), B = p(() => {
|
|
12690
12690
|
if (!(!d || typeof d == "boolean")) return d;
|
|
12691
|
-
}, [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), [G,
|
|
12691
|
+
}, [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), [G, K] = h(null), [te, ne] = h(null), [re, ie] = h(null), [ae, oe] = h(null), se = m(!1), ce = s((e) => {
|
|
12692
12692
|
e && ee(e);
|
|
12693
12693
|
}, []), le = u(), ue = !!a, de = V || !!zs.normalize(B), fe = ue && de, q = !fe && V, pe = fe ? void 0 : B;
|
|
12694
12694
|
l(() => {
|
|
@@ -12757,8 +12757,8 @@ function ef({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
12757
12757
|
]), Te = s((e, t) => {
|
|
12758
12758
|
if (!G) return;
|
|
12759
12759
|
let n = be.findIndex((e, t) => he(e, t) === G), r = be.findIndex((n, r) => he(n, r) === he(e, t));
|
|
12760
|
-
|
|
12761
|
-
let i =
|
|
12760
|
+
ne(null), K(null);
|
|
12761
|
+
let i = re?.position || "after";
|
|
12762
12762
|
if (ie(null), n < 0 || r < 0 || n === r) return;
|
|
12763
12763
|
let o = [...be], [s] = o.splice(n, 1), c = n < r ? r + (i === "after" ? 0 : -1) : r + +(i === "after");
|
|
12764
12764
|
o.splice(c, 0, s), U(void 0), z(o), a?.(o, {
|
|
@@ -12768,7 +12768,7 @@ function ef({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
12768
12768
|
});
|
|
12769
12769
|
}, [
|
|
12770
12770
|
G,
|
|
12771
|
-
|
|
12771
|
+
re?.position,
|
|
12772
12772
|
he,
|
|
12773
12773
|
a,
|
|
12774
12774
|
be
|
|
@@ -12783,10 +12783,10 @@ function ef({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
12783
12783
|
F.Table.scrollClassName,
|
|
12784
12784
|
j ? `${j} overflow-auto` : "",
|
|
12785
12785
|
M || ""
|
|
12786
|
-
].filter(Boolean).join(" "), Oe = !!j, ke = Ee.length + +!!ve + +!!ue, Ae = Oe ? "sticky top-0 z-10 bg-card" : "", je = (e, n, r, i) => !
|
|
12786
|
+
].filter(Boolean).join(" "), Oe = !!j, ke = Ee.length + +!!ve + +!!ue, Ae = Oe ? "sticky top-0 z-10 bg-card" : "", je = (e, n, r, i) => !re || re.key !== e || re.position !== n ? null : /* @__PURE__ */ t.createElement("tr", {
|
|
12787
12787
|
"aria-hidden": "true",
|
|
12788
12788
|
onDragOver: (t) => {
|
|
12789
|
-
ue && (t.preventDefault(),
|
|
12789
|
+
ue && (t.preventDefault(), te !== e && ne(e), ie({
|
|
12790
12790
|
key: e,
|
|
12791
12791
|
position: n
|
|
12792
12792
|
}));
|
|
@@ -12860,7 +12860,7 @@ function ef({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
12860
12860
|
return e.map((e, o) => {
|
|
12861
12861
|
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;
|
|
12862
12862
|
a = u;
|
|
12863
|
-
let f = ge.includes(l), p =
|
|
12863
|
+
let f = ge.includes(l), p = te === l, m = G === l, h = L && (g === void 0 ? ae : g) === l;
|
|
12864
12864
|
return /* @__PURE__ */ t.createElement(t.Fragment, { key: l }, d && /* @__PURE__ */ t.createElement("tr", { "aria-hidden": "true" }, /* @__PURE__ */ t.createElement("td", {
|
|
12865
12865
|
colSpan: ke,
|
|
12866
12866
|
className: "bg-muted/40 px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground"
|
|
@@ -12879,22 +12879,22 @@ function ef({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
12879
12879
|
i && xe(t, e, s);
|
|
12880
12880
|
},
|
|
12881
12881
|
onDragStart: () => {
|
|
12882
|
-
|
|
12882
|
+
K(l);
|
|
12883
12883
|
},
|
|
12884
12884
|
onDragOver: (e) => {
|
|
12885
12885
|
if (!ue) return;
|
|
12886
12886
|
e.preventDefault();
|
|
12887
12887
|
let t = e.currentTarget.getBoundingClientRect(), n = e.clientY < t.top + t.height / 2 ? "before" : "after";
|
|
12888
|
-
|
|
12888
|
+
te !== l && ne(l), G !== l && ie((e) => e?.key === l && e.position === n ? e : {
|
|
12889
12889
|
key: l,
|
|
12890
12890
|
position: n
|
|
12891
12891
|
});
|
|
12892
12892
|
},
|
|
12893
12893
|
onDragLeave: () => {
|
|
12894
|
-
|
|
12894
|
+
te === l && ne(null);
|
|
12895
12895
|
},
|
|
12896
12896
|
onDragEnd: () => {
|
|
12897
|
-
|
|
12897
|
+
K(null), ne(null), ie(null);
|
|
12898
12898
|
},
|
|
12899
12899
|
onDrop: (t) => {
|
|
12900
12900
|
ue && (t.preventDefault(), Te(e, s));
|
|
@@ -12933,10 +12933,10 @@ function ef({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
|
|
|
12933
12933
|
"aria-label": Dn(I.reorderRow, { key: l }),
|
|
12934
12934
|
onClick: (e) => e.preventDefault(),
|
|
12935
12935
|
onDragStart: (e) => {
|
|
12936
|
-
e.stopPropagation(),
|
|
12936
|
+
e.stopPropagation(), K(l);
|
|
12937
12937
|
},
|
|
12938
12938
|
onDragEnd: (e) => {
|
|
12939
|
-
e.stopPropagation(),
|
|
12939
|
+
e.stopPropagation(), K(null), ne(null), ie(null);
|
|
12940
12940
|
}
|
|
12941
12941
|
}, /* @__PURE__ */ t.createElement(k, { size: 14 }))), Ee.map((n) => /* @__PURE__ */ t.createElement("td", {
|
|
12942
12942
|
key: n.key,
|
|
@@ -13293,9 +13293,9 @@ var Df = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13293
13293
|
required: r,
|
|
13294
13294
|
label: n,
|
|
13295
13295
|
validator: f
|
|
13296
|
-
}), V = u(), H = v ?? V, U = typeof _ == "object" ? _ : {}, W = !!_, ee = U.position ?? "below", G = U.defaultZoom ?? 15,
|
|
13296
|
+
}), V = u(), H = v ?? V, U = typeof _ == "object" ? _ : {}, W = !!_, ee = U.position ?? "below", G = U.defaultZoom ?? 15, K = U.height ?? 240, [te, ne] = h(typeof A.value == "string" ? A.value : ""), [re, 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);
|
|
13297
13297
|
l(() => {
|
|
13298
|
-
typeof A.value == "string" && A.value !==
|
|
13298
|
+
typeof A.value == "string" && A.value !== te && ne(A.value);
|
|
13299
13299
|
}, [A.value]), l(() => {
|
|
13300
13300
|
if (!ae) return;
|
|
13301
13301
|
let e = (e) => {
|
|
@@ -13304,7 +13304,7 @@ var Df = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13304
13304
|
return window.document.addEventListener("pointerdown", e), () => window.document.removeEventListener("pointerdown", e);
|
|
13305
13305
|
}, [ae]), l(() => {
|
|
13306
13306
|
if (!O) return;
|
|
13307
|
-
let e = ++fe.current, t =
|
|
13307
|
+
let e = ++fe.current, t = te.trim();
|
|
13308
13308
|
if (t.length < 3) {
|
|
13309
13309
|
ie([]), ce(!1);
|
|
13310
13310
|
return;
|
|
@@ -13342,11 +13342,11 @@ var Df = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13342
13342
|
})();
|
|
13343
13343
|
}, 250);
|
|
13344
13344
|
return () => window.clearTimeout(n);
|
|
13345
|
-
}, [
|
|
13345
|
+
}, [te, O]);
|
|
13346
13346
|
let ye = (e, t) => {
|
|
13347
13347
|
ve.current = !0;
|
|
13348
|
-
let n = e.formatted ??
|
|
13349
|
-
|
|
13348
|
+
let n = e.formatted ?? te;
|
|
13349
|
+
ne(n), A.handleChange({ target: {
|
|
13350
13350
|
name: k.formatted,
|
|
13351
13351
|
value: n
|
|
13352
13352
|
} }), e.street !== void 0 && j.handleChange({ target: {
|
|
@@ -13427,7 +13427,7 @@ var Df = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13427
13427
|
})).results[0];
|
|
13428
13428
|
if (!n) return;
|
|
13429
13429
|
let r = Ef(n), i = r.formatted ?? t;
|
|
13430
|
-
if (
|
|
13430
|
+
if (ne(i), A.handleChange({ target: {
|
|
13431
13431
|
name: k.formatted,
|
|
13432
13432
|
value: i
|
|
13433
13433
|
} }), r.lat !== void 0 && L.handleChange({ target: {
|
|
@@ -13529,7 +13529,7 @@ var Df = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13529
13529
|
let we = W ? /* @__PURE__ */ t.createElement("div", {
|
|
13530
13530
|
ref: pe,
|
|
13531
13531
|
className: X("mt-2 w-full overflow-hidden rounded-md border", T),
|
|
13532
|
-
style: { height:
|
|
13532
|
+
style: { height: K }
|
|
13533
13533
|
}) : null;
|
|
13534
13534
|
return /* @__PURE__ */ t.createElement(Z, { className: A.formWrapClass || D.AddressAutocomplete.wrapperClassName }, n && /* @__PURE__ */ t.createElement(Ns, {
|
|
13535
13535
|
label: n,
|
|
@@ -13550,16 +13550,16 @@ var Df = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
|
|
|
13550
13550
|
placeholder: i ?? E.placeholder,
|
|
13551
13551
|
required: r,
|
|
13552
13552
|
disabled: a,
|
|
13553
|
-
value:
|
|
13553
|
+
value: te,
|
|
13554
13554
|
onChange: (e) => {
|
|
13555
|
-
|
|
13555
|
+
ne(e.target.value), oe(!0);
|
|
13556
13556
|
},
|
|
13557
13557
|
onFocus: () => oe(!0)
|
|
13558
13558
|
}), /* @__PURE__ */ t.createElement("span", { className: "pointer-events-none absolute inset-y-0 right-2 flex items-center text-muted-foreground" }, /* @__PURE__ */ t.createElement(Q, {
|
|
13559
13559
|
name: se ? "loader-circle" : "map-pin",
|
|
13560
13560
|
size: 15,
|
|
13561
13561
|
className: se ? "animate-spin" : void 0
|
|
13562
|
-
})), ae &&
|
|
13562
|
+
})), ae && te.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 && re.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-2 py-3 text-center text-muted-foreground" }, E.searching) : re.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-2 py-3 text-center text-muted-foreground" }, E.noResults) : re.map((e) => /* @__PURE__ */ t.createElement("button", {
|
|
13563
13563
|
key: e.id,
|
|
13564
13564
|
type: "button",
|
|
13565
13565
|
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),
|
|
@@ -13798,39 +13798,46 @@ function zf({ group: e, expanded: n, openItems: r, showIcons: i, onToggle: a })
|
|
|
13798
13798
|
onToggle: a
|
|
13799
13799
|
}))));
|
|
13800
13800
|
}
|
|
13801
|
-
function Bf({ menuKey: e, items: n, defaultCollapsed: r = !1,
|
|
13802
|
-
let { pathname:
|
|
13801
|
+
function Bf({ menuKey: e, items: n, defaultCollapsed: r = !1, collapsed: i, onCollapsedChange: a, showIcons: o = !0, showCollapseButton: c = !0, footer: u, header: d, embedded: f = !1 }) {
|
|
13802
|
+
let { pathname: p } = x(), g = Y("sideNav"), _ = Uh(e ?? ""), v = n ?? (e ? Nf(_) : []), y = i !== void 0, [b, S] = h(r), C = i === void 0 ? b : i, w = s((e) => {
|
|
13803
|
+
let t = typeof e == "function" ? e(C) : e;
|
|
13804
|
+
y ? a?.(t) : S(t);
|
|
13805
|
+
}, [
|
|
13806
|
+
y,
|
|
13807
|
+
C,
|
|
13808
|
+
a
|
|
13809
|
+
]), [T, E] = h(!1), [D, O] = h(/* @__PURE__ */ new Set()), k = m(null), A = !C || T;
|
|
13803
13810
|
l(() => {
|
|
13804
|
-
|
|
13811
|
+
O((e) => {
|
|
13805
13812
|
let t = new Set(e);
|
|
13806
|
-
return
|
|
13807
|
-
e.children?.some((e) => Pf(
|
|
13813
|
+
return v.forEach((e) => {
|
|
13814
|
+
e.children?.some((e) => Pf(p, e.path, e.end)) && t.add(e.path);
|
|
13808
13815
|
}), t;
|
|
13809
13816
|
});
|
|
13810
|
-
}, [
|
|
13811
|
-
let
|
|
13812
|
-
|
|
13817
|
+
}, [p]);
|
|
13818
|
+
let j = s((e) => {
|
|
13819
|
+
O((t) => {
|
|
13813
13820
|
let n = new Set(t);
|
|
13814
13821
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
13815
13822
|
});
|
|
13816
|
-
}, []),
|
|
13817
|
-
|
|
13818
|
-
},
|
|
13819
|
-
|
|
13823
|
+
}, []), M = () => {
|
|
13824
|
+
C && (k.current && clearTimeout(k.current), E(!0));
|
|
13825
|
+
}, N = () => {
|
|
13826
|
+
C && (k.current = setTimeout(() => E(!1), 80));
|
|
13820
13827
|
};
|
|
13821
|
-
if (
|
|
13822
|
-
let
|
|
13823
|
-
return
|
|
13828
|
+
if (v.length === 0) return null;
|
|
13829
|
+
let P = Ff(v);
|
|
13830
|
+
return f ? /* @__PURE__ */ t.createElement("nav", { className: X("px-1.5 py-2", g.SideNav.navClassName) }, P.map((e) => /* @__PURE__ */ t.createElement(zf, {
|
|
13824
13831
|
key: e.key,
|
|
13825
13832
|
group: e,
|
|
13826
13833
|
expanded: !0,
|
|
13827
|
-
openItems:
|
|
13828
|
-
showIcons:
|
|
13829
|
-
onToggle:
|
|
13834
|
+
openItems: D,
|
|
13835
|
+
showIcons: o,
|
|
13836
|
+
onToggle: j
|
|
13830
13837
|
}))) : /* @__PURE__ */ t.createElement("div", {
|
|
13831
|
-
className: X("min-h-0",
|
|
13838
|
+
className: X("min-h-0", g.SideNav.wrapperClassName),
|
|
13832
13839
|
style: {
|
|
13833
|
-
width:
|
|
13840
|
+
width: C ? Mf : jf,
|
|
13834
13841
|
height: "100%",
|
|
13835
13842
|
transition: "width 220ms cubic-bezier(0.4,0,0.2,1)",
|
|
13836
13843
|
flexShrink: 0,
|
|
@@ -13838,51 +13845,51 @@ function Bf({ menuKey: e, items: n, defaultCollapsed: r = !1, showIcons: i = !0,
|
|
|
13838
13845
|
}
|
|
13839
13846
|
}, /* @__PURE__ */ t.createElement("aside", {
|
|
13840
13847
|
style: {
|
|
13841
|
-
width:
|
|
13848
|
+
width: A ? jf : Mf,
|
|
13842
13849
|
transition: "width 220ms cubic-bezier(0.4,0,0.2,1)",
|
|
13843
|
-
position:
|
|
13850
|
+
position: C ? "absolute" : "sticky",
|
|
13844
13851
|
top: 0,
|
|
13845
|
-
zIndex:
|
|
13846
|
-
boxShadow:
|
|
13852
|
+
zIndex: C && T ? 50 : 10,
|
|
13853
|
+
boxShadow: C && T ? "4px 0 24px rgba(0,0,0,0.10)" : "none",
|
|
13847
13854
|
height: "100%",
|
|
13848
13855
|
overflowX: "hidden",
|
|
13849
13856
|
overflowY: "hidden"
|
|
13850
13857
|
},
|
|
13851
|
-
className: X("flex min-h-0 flex-col border-r bg-background",
|
|
13852
|
-
onMouseEnter:
|
|
13853
|
-
onMouseLeave:
|
|
13854
|
-
},
|
|
13855
|
-
className: X("flex h-14 shrink-0 items-center border-b px-1.5",
|
|
13858
|
+
className: X("flex min-h-0 flex-col border-r bg-background", g.SideNav.shellClassName, C && T && g.SideNav.overlayClassName),
|
|
13859
|
+
onMouseEnter: M,
|
|
13860
|
+
onMouseLeave: N
|
|
13861
|
+
}, d && /* @__PURE__ */ t.createElement("div", {
|
|
13862
|
+
className: X("flex h-14 shrink-0 items-center border-b px-1.5", g.SideNav.headerClassName),
|
|
13856
13863
|
style: {
|
|
13857
|
-
opacity: +!!
|
|
13858
|
-
maxWidth:
|
|
13864
|
+
opacity: +!!A,
|
|
13865
|
+
maxWidth: A ? "100%" : "0px",
|
|
13859
13866
|
overflow: "hidden",
|
|
13860
13867
|
transition: "opacity 150ms ease, max-width 200ms ease"
|
|
13861
13868
|
}
|
|
13862
|
-
}, /* @__PURE__ */ t.createElement("div", { className: "min-w-0 flex-1" },
|
|
13869
|
+
}, /* @__PURE__ */ t.createElement("div", { className: "min-w-0 flex-1" }, d)), /* @__PURE__ */ t.createElement("nav", { className: X("min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-1.5 py-2", g.SideNav.navClassName) }, P.map((e) => /* @__PURE__ */ t.createElement(zf, {
|
|
13863
13870
|
key: e.key,
|
|
13864
13871
|
group: e,
|
|
13865
|
-
expanded:
|
|
13866
|
-
openItems:
|
|
13867
|
-
showIcons:
|
|
13868
|
-
onToggle:
|
|
13869
|
-
}))), (
|
|
13872
|
+
expanded: A,
|
|
13873
|
+
openItems: D,
|
|
13874
|
+
showIcons: o,
|
|
13875
|
+
onToggle: j
|
|
13876
|
+
}))), (c || u) && /* @__PURE__ */ t.createElement("div", { className: X("shrink-0 border-t px-1.5 py-2 flex items-center gap-1", g.SideNav.footerClassName) }, c && /* @__PURE__ */ t.createElement("button", {
|
|
13870
13877
|
onClick: () => {
|
|
13871
|
-
|
|
13878
|
+
w((e) => !e), E(!1);
|
|
13872
13879
|
},
|
|
13873
|
-
title:
|
|
13874
|
-
className: X("shrink-0 flex items-center justify-center rounded-md w-8 h-8 transition-colors text-muted-foreground hover:text-foreground hover:bg-accent",
|
|
13880
|
+
title: C ? "Expand sidebar" : "Collapse sidebar",
|
|
13881
|
+
className: X("shrink-0 flex items-center justify-center rounded-md w-8 h-8 transition-colors text-muted-foreground hover:text-foreground hover:bg-accent", g.SideNav.collapseButtonClassName)
|
|
13875
13882
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
13876
|
-
name:
|
|
13883
|
+
name: C ? "chevrons-right" : "chevrons-left",
|
|
13877
13884
|
size: 16
|
|
13878
|
-
})),
|
|
13885
|
+
})), u && /* @__PURE__ */ t.createElement("div", { style: {
|
|
13879
13886
|
flex: 1,
|
|
13880
13887
|
minWidth: 0,
|
|
13881
|
-
opacity: +!!
|
|
13882
|
-
maxWidth:
|
|
13888
|
+
opacity: +!!A,
|
|
13889
|
+
maxWidth: A ? "100%" : "0px",
|
|
13883
13890
|
overflow: "hidden",
|
|
13884
13891
|
transition: "opacity 150ms ease, max-width 200ms ease"
|
|
13885
|
-
} },
|
|
13892
|
+
} }, u))));
|
|
13886
13893
|
}
|
|
13887
13894
|
//#endregion
|
|
13888
13895
|
//#region src/components/widgets/grid-core/useGridDBRecords.ts
|
|
@@ -14716,17 +14723,17 @@ var Gp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14716
14723
|
typeof c == "object" ? c?.dir : void 0,
|
|
14717
14724
|
typeof c == "object" ? c?.field : void 0,
|
|
14718
14725
|
c
|
|
14719
|
-
]), U = $d("item"), W = s((e, t) => U(e, t), [U]), { activeSelectedKeys: ee, showSelection: G, updateSelection:
|
|
14726
|
+
]), U = $d("item"), W = s((e, t) => U(e, t), [U]), { activeSelectedKeys: ee, showSelection: G, updateSelection: K } = Qd({
|
|
14720
14727
|
records: V,
|
|
14721
14728
|
selectedKeys: _,
|
|
14722
14729
|
onSelectionChange: o,
|
|
14723
14730
|
getRecordKey: W
|
|
14724
|
-
}),
|
|
14731
|
+
}), te = m(/* @__PURE__ */ new Map());
|
|
14725
14732
|
l(() => {
|
|
14726
14733
|
let e = new Set(V.map((e, t) => W(e, t)));
|
|
14727
|
-
for (let t of
|
|
14734
|
+
for (let t of te.current.keys()) e.has(t) || te.current.delete(t);
|
|
14728
14735
|
}, [V, W]);
|
|
14729
|
-
let
|
|
14736
|
+
let ne = (e, t) => {
|
|
14730
14737
|
if (A) {
|
|
14731
14738
|
let t = A.split(/\s+/).filter(Boolean), n = e.target;
|
|
14732
14739
|
for (; n && !n.classList.contains("item");) {
|
|
@@ -14743,13 +14750,13 @@ var Gp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14743
14750
|
}), n.classList.add(...t));
|
|
14744
14751
|
}
|
|
14745
14752
|
a?.(t);
|
|
14746
|
-
},
|
|
14753
|
+
}, re = s((e, t) => {
|
|
14747
14754
|
let n = W(e, t), r = ee.includes(n) ? ee.filter((e) => e !== n) : [...ee, n];
|
|
14748
|
-
|
|
14755
|
+
K(r);
|
|
14749
14756
|
}, [
|
|
14750
14757
|
ee,
|
|
14751
14758
|
W,
|
|
14752
|
-
|
|
14759
|
+
K
|
|
14753
14760
|
]), ie = (e, n) => {
|
|
14754
14761
|
let r = e.img;
|
|
14755
14762
|
return r && t.isValidElement(r) ? t.cloneElement(r, {
|
|
@@ -14760,7 +14767,7 @@ var Gp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14760
14767
|
cursor: a ? "pointer" : "default"
|
|
14761
14768
|
},
|
|
14762
14769
|
onClick: a ? ((t) => {
|
|
14763
|
-
|
|
14770
|
+
ne(t, e), r.props.onClick?.(t);
|
|
14764
14771
|
}) : r.props.onClick
|
|
14765
14772
|
}) : /* @__PURE__ */ t.createElement("img", {
|
|
14766
14773
|
className: "block h-auto w-full max-w-full rounded-lg object-cover",
|
|
@@ -14772,7 +14779,7 @@ var Gp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14772
14779
|
aspectRatio: "16 / 11",
|
|
14773
14780
|
cursor: a ? "pointer" : "default"
|
|
14774
14781
|
},
|
|
14775
|
-
onClick: a ? ((t) =>
|
|
14782
|
+
onClick: a ? ((t) => ne(t, e)) : void 0
|
|
14776
14783
|
});
|
|
14777
14784
|
}, ae = (e) => t.isValidElement(e) ? e : /* @__PURE__ */ t.createElement("span", { className: "inline-block max-w-full overflow-hidden text-ellipsis align-top" }, /* @__PURE__ */ t.createElement(Zn, {
|
|
14778
14785
|
badge: e,
|
|
@@ -14831,7 +14838,7 @@ var Gp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14831
14838
|
...r.style
|
|
14832
14839
|
}, o.align, r.className)) : null;
|
|
14833
14840
|
}) : null, de = s((e, t) => {
|
|
14834
|
-
let n = W(e, t), r =
|
|
14841
|
+
let n = W(e, t), r = te.current.get(n);
|
|
14835
14842
|
if (r && r.recordRef === e && r.overlaysRef === i && r.onClickRef === a && r.rowIndex === t) return {
|
|
14836
14843
|
image: r.image,
|
|
14837
14844
|
overlays: r.overlays
|
|
@@ -14840,7 +14847,7 @@ var Gp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14840
14847
|
image: ie(e, t),
|
|
14841
14848
|
overlays: ue(e, t)
|
|
14842
14849
|
};
|
|
14843
|
-
return
|
|
14850
|
+
return te.current.set(n, {
|
|
14844
14851
|
recordRef: e,
|
|
14845
14852
|
overlaysRef: i,
|
|
14846
14853
|
onClickRef: a,
|
|
@@ -14865,7 +14872,7 @@ var Gp = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
|
|
|
14865
14872
|
type: "checkbox",
|
|
14866
14873
|
"aria-label": Dn(O.selectItem, { key: r }),
|
|
14867
14874
|
checked: i,
|
|
14868
|
-
onChange: () =>
|
|
14875
|
+
onChange: () => re(n, e),
|
|
14869
14876
|
onClick: (e) => e.stopPropagation()
|
|
14870
14877
|
})), o.image, o.overlays));
|
|
14871
14878
|
}, q = (e, t) => {
|
|
@@ -15354,13 +15361,13 @@ function om({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, fo
|
|
|
15354
15361
|
columns: i,
|
|
15355
15362
|
records: U,
|
|
15356
15363
|
form: o
|
|
15357
|
-
}), [G,
|
|
15358
|
-
|
|
15364
|
+
}), [G, K] = h(() => Object.fromEntries((M ?? []).map((e) => [e.key, em(e)]))), [te, ne] = h(!1), re = s((e, t) => {
|
|
15365
|
+
K((n) => ({
|
|
15359
15366
|
...n,
|
|
15360
15367
|
[e]: t
|
|
15361
15368
|
}));
|
|
15362
15369
|
}, []), ie = s((e) => {
|
|
15363
|
-
|
|
15370
|
+
K((t) => ({
|
|
15364
15371
|
...t,
|
|
15365
15372
|
[e.key]: em(e)
|
|
15366
15373
|
}));
|
|
@@ -15374,7 +15381,7 @@ function om({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, fo
|
|
|
15374
15381
|
title: z.filtersButton,
|
|
15375
15382
|
variant: "link",
|
|
15376
15383
|
badge: ae.length > 0 ? ae.length : void 0,
|
|
15377
|
-
onClick: () =>
|
|
15384
|
+
onClick: () => ne(!0)
|
|
15378
15385
|
}) : null, ce = (M ?? []).length > 0 && ae.length > 0 ? /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap items-center gap-1.5" }, ae.map((e) => /* @__PURE__ */ t.createElement(Qn, {
|
|
15379
15386
|
key: e.key,
|
|
15380
15387
|
variant: "info",
|
|
@@ -15385,22 +15392,22 @@ function om({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, fo
|
|
|
15385
15392
|
ariaLabel: `${z.filtersClearAll} ${e.label}`,
|
|
15386
15393
|
title: `${z.filtersClearAll} ${e.label}`,
|
|
15387
15394
|
onClick: () => ie(e)
|
|
15388
|
-
})))) : null, le = !j && se ? /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap items-center gap-2" }, se, ce) : null, ue =
|
|
15395
|
+
})))) : null, le = !j && se ? /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap items-center gap-2" }, se, ce) : null, ue = te && M && M.length > 0 ? /* @__PURE__ */ t.createElement(Mi, {
|
|
15389
15396
|
title: z.filtersPanelTitle,
|
|
15390
15397
|
size: "md",
|
|
15391
15398
|
position: "right",
|
|
15392
|
-
onClose: () =>
|
|
15399
|
+
onClose: () => ne(!1),
|
|
15393
15400
|
footer: /* @__PURE__ */ t.createElement(Hr, {
|
|
15394
15401
|
label: z.filtersClearAll,
|
|
15395
15402
|
variant: "link",
|
|
15396
15403
|
disabled: ae.length === 0,
|
|
15397
|
-
onClick: () =>
|
|
15404
|
+
onClick: () => K(Object.fromEntries(M.map((e) => [e.key, em(e)])))
|
|
15398
15405
|
})
|
|
15399
15406
|
}, /* @__PURE__ */ t.createElement("div", { className: "flex flex-col gap-5" }, M.map((e) => /* @__PURE__ */ t.createElement(am, {
|
|
15400
15407
|
key: e.key,
|
|
15401
15408
|
filter: e,
|
|
15402
15409
|
value: G[e.key] ?? em(e),
|
|
15403
|
-
onChange: (t) =>
|
|
15410
|
+
onChange: (t) => re(e.key, t),
|
|
15404
15411
|
dict: z
|
|
15405
15412
|
})))) : null, de = j === !0 ? {} : j || void 0, [fe, q] = h(""), pe = p(() => {
|
|
15406
15413
|
if (!de || !fe.trim()) return oe;
|
|
@@ -15931,7 +15938,7 @@ var um = () => {
|
|
|
15931
15938
|
let e = Zr("user");
|
|
15932
15939
|
e?.profile?.sub && window.google?.accounts?.id?.revoke(e.profile.sub), localStorage.removeItem("googleCredentialToken"), $r("user");
|
|
15933
15940
|
let t = Fa();
|
|
15934
|
-
t && await
|
|
15941
|
+
t && await re(t);
|
|
15935
15942
|
}
|
|
15936
15943
|
onAuthChange(e) {
|
|
15937
15944
|
let t = Fa();
|
|
@@ -16317,19 +16324,19 @@ var Um = class {
|
|
|
16317
16324
|
if (n === "oauth") {
|
|
16318
16325
|
let { provider: n } = e;
|
|
16319
16326
|
if (!n) throw Error("FirebaseAuthProvider.signIn: provider is required for oauth");
|
|
16320
|
-
let { user: r } = await
|
|
16327
|
+
let { user: r } = await ne(t, Vm(n));
|
|
16321
16328
|
return Hm(r);
|
|
16322
16329
|
}
|
|
16323
16330
|
let { email: r, password: i } = e;
|
|
16324
16331
|
if (!r || !i) throw Error("FirebaseAuthProvider.signIn: email and password are required");
|
|
16325
|
-
let { user: a } = await
|
|
16332
|
+
let { user: a } = await te(t, r, i);
|
|
16326
16333
|
return Hm(a);
|
|
16327
16334
|
}
|
|
16328
16335
|
async signOut() {
|
|
16329
16336
|
await this.initPromise;
|
|
16330
16337
|
let e = Fa(this.appName);
|
|
16331
16338
|
if (!e) throw Error("FirebaseAuthProvider: Firebase auth is not initialized");
|
|
16332
|
-
await
|
|
16339
|
+
await re(e);
|
|
16333
16340
|
}
|
|
16334
16341
|
onAuthChange(e) {
|
|
16335
16342
|
if (!this.options.config) {
|