@llmnative/react 1.19.2 → 1.19.3

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 te, signInWithEmailAndPassword as ne, signInWithPopup as re, signOut as K } from "firebase/auth";
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";
@@ -3590,171 +3590,180 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
3590
3590
  show: a ?? m.Card.loading,
3591
3591
  ...o === void 0 ? {} : { minHeight: o }
3592
3592
  }, e)), i ? /* @__PURE__ */ t.createElement("div", { className: X(Ai, m.Card.footerClassName, d) }, i) : null), p);
3593
- }, Mi = (e) => /* @__PURE__ */ t.createElement(Ni, e), Ni = ({ children: e, title: n = void 0, header: r = void 0, footer: i = void 0, onClose: a = void 0, onSave: o = void 0, onDelete: s = void 0, size: c = void 0, position: l = void 0, allowFullscreen: u = !1, showCancel: d = !0, before: f = void 0, after: p = void 0, wrapperClassName: m = void 0, className: g = void 0, headerClassName: _ = void 0, titleClassName: v = void 0, subtitleClassName: y = void 0, bodyClassName: b = void 0, footerClassName: x = void 0, closeOnBackdrop: S = !0, zIndex: C = void 0, stackedBehind: w = !1, rightInset: T = void 0, closeSlot: E = void 0, motion: D = void 0 }) => {
3594
- let O = Y("modal"), k = Fn("modal"), [A, M] = t.useState(!1), N = t.useRef(!1), P = t.useRef(void 0), [F, I] = h(c), L = {
3593
+ }, Mi = (e) => /* @__PURE__ */ t.createElement(Ni, e), Ni = ({ children: e, title: n = void 0, header: r = void 0, footer: i = void 0, onClose: a = void 0, onSave: o = void 0, onDelete: s = void 0, size: c = void 0, position: l = void 0, allowFullscreen: d = !1, showCancel: f = !0, before: p = void 0, after: m = void 0, wrapperClassName: g = void 0, className: _ = void 0, headerClassName: v = void 0, titleClassName: y = void 0, subtitleClassName: b = void 0, bodyClassName: x = void 0, footerClassName: S = void 0, closeOnBackdrop: C = !0, zIndex: w = void 0, stackedBehind: T = !1, rightInset: E = void 0, closeSlot: D = void 0, motion: O = void 0 }) => {
3594
+ let k = Y("modal"), A = Fn("modal"), [M, N] = t.useState(!1), P = t.useRef(!1), F = t.useRef(void 0), [I, L] = h(c), R = {
3595
3595
  sm: "max-w-sm",
3596
3596
  md: "max-w-md",
3597
3597
  lg: "max-w-2xl",
3598
3598
  xl: "max-w-4xl",
3599
3599
  "2xl": "max-w-6xl",
3600
3600
  fullscreen: "max-w-none w-screen h-dvh rounded-none"
3601
- }[F || O.Modal.size || "lg"], R = {
3601
+ }[I || k.Modal.size || "lg"], z = {
3602
3602
  sm: "w-72",
3603
3603
  md: "w-96",
3604
3604
  lg: "w-[36rem]",
3605
3605
  xl: "w-[48rem]",
3606
3606
  "2xl": "w-[64rem]",
3607
3607
  fullscreen: "w-screen"
3608
- }[F || O.Modal.size || "lg"], z = {
3608
+ }[I || k.Modal.size || "lg"], B = {
3609
3609
  sm: "max-h-[30vh]",
3610
3610
  md: "max-h-[45vh]",
3611
3611
  lg: "max-h-[60vh]",
3612
3612
  xl: "max-h-[85vh]",
3613
3613
  "2xl": "max-h-[90vh]",
3614
3614
  fullscreen: "h-dvh max-h-none"
3615
- }[F || O.Modal.size || "lg"], B = {
3615
+ }[I || k.Modal.size || "lg"], V = {
3616
3616
  center: {
3617
3617
  coverClass: "fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",
3618
- 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),
3619
- contentClass: X("flex min-h-0 flex-1 flex-col", g || O.Modal.className),
3620
- headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", _ || O.Modal.headerClassName),
3621
- titleClassName: X("text-lg font-semibold leading-none", v || O.Modal.titleClassName),
3622
- subtitleClassName: X("mt-1 text-sm text-muted-foreground", y || O.Modal.subtitleClassName),
3623
- bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", b || O.Modal.bodyClassName),
3624
- footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", x || O.Modal.footerClassName)
3618
+ dialogClass: X("relative z-50 flex w-full flex-col overflow-hidden rounded-lg border border-border/60 bg-card shadow-xl", I !== "fullscreen" && "max-h-[calc(100dvh-2rem)]", R, g || k.Modal.wrapperClassName),
3619
+ contentClass: X("flex min-h-0 flex-1 flex-col", _ || k.Modal.className),
3620
+ headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", v || k.Modal.headerClassName),
3621
+ titleClassName: X("text-lg font-semibold leading-none", y || k.Modal.titleClassName),
3622
+ subtitleClassName: X("mt-1 text-sm text-muted-foreground", b || k.Modal.subtitleClassName),
3623
+ bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", x || k.Modal.bodyClassName),
3624
+ footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", S || k.Modal.footerClassName)
3625
3625
  },
3626
3626
  top: {
3627
3627
  coverClass: "fixed inset-0 z-50",
3628
- 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),
3629
- contentClass: X("flex min-h-0 flex-1 flex-col", g || O.Modal.className),
3630
- headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", _ || O.Modal.headerClassName),
3631
- titleClassName: X("text-lg font-semibold leading-none", v || O.Modal.titleClassName),
3632
- subtitleClassName: X("mt-1 text-sm text-muted-foreground", y || O.Modal.subtitleClassName),
3633
- bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", b || O.Modal.bodyClassName),
3634
- footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", x || O.Modal.footerClassName)
3628
+ dialogClass: X("fixed left-0 right-0 top-0 z-50 flex flex-col border-b border-border/60 bg-card shadow-xl", B, g || k.Modal.wrapperClassName),
3629
+ contentClass: X("flex min-h-0 flex-1 flex-col", _ || k.Modal.className),
3630
+ headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", v || k.Modal.headerClassName),
3631
+ titleClassName: X("text-lg font-semibold leading-none", y || k.Modal.titleClassName),
3632
+ subtitleClassName: X("mt-1 text-sm text-muted-foreground", b || k.Modal.subtitleClassName),
3633
+ bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", x || k.Modal.bodyClassName),
3634
+ footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", S || k.Modal.footerClassName)
3635
3635
  },
3636
3636
  left: {
3637
3637
  coverClass: "fixed inset-0 z-50",
3638
- dialogClass: X("fixed bottom-0 left-0 top-0 z-50 flex max-w-full flex-col border-r border-border/60 bg-card shadow-xl", R, m || O.Modal.wrapperClassName),
3639
- contentClass: X("flex min-h-0 flex-1 flex-col", g || O.Modal.className),
3640
- headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", _ || O.Modal.headerClassName),
3641
- titleClassName: X("text-lg font-semibold leading-none", v || O.Modal.titleClassName),
3642
- subtitleClassName: X("mt-1 text-sm text-muted-foreground", y || O.Modal.subtitleClassName),
3643
- bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", b || O.Modal.bodyClassName),
3644
- footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", x || O.Modal.footerClassName)
3638
+ dialogClass: X("fixed bottom-0 left-0 top-0 z-50 flex max-w-full flex-col border-r border-border/60 bg-card shadow-xl", z, g || k.Modal.wrapperClassName),
3639
+ contentClass: X("flex min-h-0 flex-1 flex-col", _ || k.Modal.className),
3640
+ headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", v || k.Modal.headerClassName),
3641
+ titleClassName: X("text-lg font-semibold leading-none", y || k.Modal.titleClassName),
3642
+ subtitleClassName: X("mt-1 text-sm text-muted-foreground", b || k.Modal.subtitleClassName),
3643
+ bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", x || k.Modal.bodyClassName),
3644
+ footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", S || k.Modal.footerClassName)
3645
3645
  },
3646
3646
  right: {
3647
3647
  coverClass: "fixed inset-0 z-50",
3648
- dialogClass: X("fixed bottom-0 right-0 top-0 z-50 flex max-w-full flex-col border-l border-border/60 bg-card shadow-xl", R, m || O.Modal.wrapperClassName),
3649
- contentClass: X("flex min-h-0 flex-1 flex-col", g || O.Modal.className),
3650
- headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", _ || O.Modal.headerClassName),
3651
- titleClassName: X("text-lg font-semibold leading-none", v || O.Modal.titleClassName),
3652
- subtitleClassName: X("mt-1 text-sm text-muted-foreground", y || O.Modal.subtitleClassName),
3653
- bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", b || O.Modal.bodyClassName),
3654
- footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", x || O.Modal.footerClassName)
3648
+ dialogClass: X("fixed bottom-0 right-0 top-0 z-50 flex max-w-full flex-col border-l border-border/60 bg-card shadow-xl", z, g || k.Modal.wrapperClassName),
3649
+ contentClass: X("flex min-h-0 flex-1 flex-col", _ || k.Modal.className),
3650
+ headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", v || k.Modal.headerClassName),
3651
+ titleClassName: X("text-lg font-semibold leading-none", y || k.Modal.titleClassName),
3652
+ subtitleClassName: X("mt-1 text-sm text-muted-foreground", b || k.Modal.subtitleClassName),
3653
+ bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", x || k.Modal.bodyClassName),
3654
+ footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", S || k.Modal.footerClassName)
3655
3655
  },
3656
3656
  bottom: {
3657
3657
  coverClass: "fixed inset-0 z-50",
3658
- 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),
3659
- contentClass: X("flex min-h-0 flex-1 flex-col", g || O.Modal.className),
3660
- headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", _ || O.Modal.headerClassName),
3661
- titleClassName: X("text-lg font-semibold leading-none", v || O.Modal.titleClassName),
3662
- subtitleClassName: X("mt-1 text-sm text-muted-foreground", y || O.Modal.subtitleClassName),
3663
- bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", b || O.Modal.bodyClassName),
3664
- footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", x || O.Modal.footerClassName)
3658
+ dialogClass: X("fixed bottom-0 left-0 right-0 z-50 flex flex-col border-t border-border/60 bg-card shadow-xl", B, g || k.Modal.wrapperClassName),
3659
+ contentClass: X("flex min-h-0 flex-1 flex-col", _ || k.Modal.className),
3660
+ headerClassName: X("flex items-center justify-between gap-3 border-b border-border/60 px-4 py-3", v || k.Modal.headerClassName),
3661
+ titleClassName: X("text-lg font-semibold leading-none", y || k.Modal.titleClassName),
3662
+ subtitleClassName: X("mt-1 text-sm text-muted-foreground", b || k.Modal.subtitleClassName),
3663
+ bodyClassName: X("min-h-0 flex-1 overflow-auto p-4", x || k.Modal.bodyClassName),
3664
+ footerClassName: X("flex items-center justify-end gap-3 border-t border-border/60 px-4 py-3", S || k.Modal.footerClassName)
3665
3665
  }
3666
- }, V = F === "fullscreen" ? "center" : l || O.Modal.position, H = B[V], U = F === "fullscreen" ? X(H.coverClass, "!overflow-hidden !p-0") : H.coverClass;
3666
+ }, H = I === "fullscreen" ? "center" : l || k.Modal.position, U = V[H], W = I === "fullscreen" ? X(U.coverClass, "!overflow-hidden !p-0") : U.coverClass;
3667
3667
  t.useEffect(() => {
3668
3668
  let e = window.document.body.style.overflow;
3669
3669
  window.document.body.style.overflow = "hidden";
3670
- let t = window.requestAnimationFrame(() => M(!0));
3670
+ let t = window.requestAnimationFrame(() => N(!0));
3671
3671
  return () => {
3672
- window.cancelAnimationFrame(t), P.current !== void 0 && window.clearTimeout(P.current), window.document.body.style.overflow = e || "auto";
3672
+ window.cancelAnimationFrame(t), F.current !== void 0 && window.clearTimeout(F.current), window.document.body.style.overflow = e || "auto";
3673
3673
  };
3674
3674
  }, []);
3675
- let W = D ?? O.Modal.motion?.[V] ?? "fade", ee = ar(W, W), G = () => {
3676
- if (N.current) return;
3677
- N.current = !0, M(!1), window.document.body.style.overflow = "auto";
3678
- let e = ee.transition.duration + ee.transition.delay;
3679
- P.current = window.setTimeout(() => {
3675
+ let ee = O ?? k.Modal.motion?.[H] ?? "fade", G = ar(ee, ee), K = () => {
3676
+ if (P.current) return;
3677
+ P.current = !0, N(!1), window.document.body.style.overflow = "auto";
3678
+ let e = G.transition.duration + G.transition.delay;
3679
+ F.current = window.setTimeout(() => {
3680
3680
  a?.();
3681
3681
  }, e);
3682
- }, te = or(A, W, W), ne = T ? { right: T } : {}, re = {
3683
- ...or(A, O.Modal.motion?.backdrop ?? "fade", O.Modal.motion?.backdrop ?? "fade"),
3684
- cursor: S && a ? "pointer" : "default",
3685
- ...C === void 0 ? {} : { zIndex: C - 10 },
3682
+ }, te = or(M, ee, ee), ne = E ? { right: E } : {}, re = {
3683
+ ...or(M, k.Modal.motion?.backdrop ?? "fade", k.Modal.motion?.backdrop ?? "fade"),
3684
+ cursor: C && a ? "pointer" : "default",
3685
+ ...w === void 0 ? {} : { zIndex: w - 10 },
3686
3686
  ...ne
3687
- }, K = {
3688
- cursor: S && a ? "pointer" : "default",
3689
- ...C === void 0 ? {} : { zIndex: C },
3690
- ...w ? { pointerEvents: "none" } : {},
3687
+ }, ie = {
3688
+ cursor: C && a ? "pointer" : "default",
3689
+ ...w === void 0 ? {} : { zIndex: w },
3690
+ ...T ? { pointerEvents: "none" } : {},
3691
3691
  ...ne
3692
- }, ie = w ? {
3692
+ }, ae = T ? {
3693
3693
  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)",
3694
3694
  transformOrigin: l === "left" ? "left center" : l === "right" ? "right center" : l === "bottom" ? "bottom center" : l === "top" ? "top center" : "center",
3695
3695
  transition: "transform 200ms ease, filter 200ms ease",
3696
3696
  filter: "brightness(0.7)"
3697
- } : {}, 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";
3697
+ } : {}, oe = i !== !1 && (i || o || s || f && a), se = u(), ce = n || typeof r == "string" && r ? se : void 0, le = "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";
3698
3698
  return j(/* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
3699
- className: U,
3700
- style: K,
3699
+ className: W,
3700
+ style: ie,
3701
3701
  onClick: () => {
3702
- S && a && G();
3702
+ C && a && K();
3703
3703
  }
3704
3704
  }, /* @__PURE__ */ t.createElement("div", {
3705
- className: H.dialogClass,
3705
+ role: "dialog",
3706
+ "aria-modal": !T || void 0,
3707
+ "aria-labelledby": ce,
3708
+ className: U.dialogClass,
3706
3709
  style: {
3707
3710
  ...te,
3708
- ...ie,
3709
- ...C === void 0 ? {} : { zIndex: C },
3710
- ...V === "right" ? ne : {}
3711
+ ...ae,
3712
+ ...w === void 0 ? {} : { zIndex: w },
3713
+ ...H === "right" ? ne : {}
3711
3714
  },
3712
3715
  onClick: (e) => e.stopPropagation()
3713
- }, 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", {
3716
+ }, p, /* @__PURE__ */ t.createElement("div", { className: U.contentClass }, (r || n || d || a || D) && /* @__PURE__ */ t.createElement("div", { className: U.headerClassName }, /* @__PURE__ */ t.createElement("div", { className: "min-w-0" }, n && /* @__PURE__ */ t.createElement("h3", {
3717
+ id: se,
3718
+ className: U.titleClassName
3719
+ }, n), n && r && /* @__PURE__ */ t.createElement("div", { className: U.subtitleClassName }, r), !n && r && (typeof r == "string" ? /* @__PURE__ */ t.createElement("h3", {
3720
+ id: se,
3721
+ className: U.titleClassName
3722
+ }, r) : r)), (d || a || D) && /* @__PURE__ */ t.createElement("div", { className: "ml-auto flex shrink-0 items-center gap-1" }, d && /* @__PURE__ */ t.createElement("button", {
3714
3723
  type: "button",
3715
- title: F === "fullscreen" ? "Exit fullscreen" : "Enter fullscreen",
3716
- "aria-label": F === "fullscreen" ? "Exit fullscreen" : "Enter fullscreen",
3717
- className: oe,
3724
+ title: I === "fullscreen" ? "Exit fullscreen" : "Enter fullscreen",
3725
+ "aria-label": I === "fullscreen" ? "Exit fullscreen" : "Enter fullscreen",
3726
+ className: le,
3718
3727
  onClick: (e) => {
3719
- e.preventDefault(), e.stopPropagation(), I((e) => e === "fullscreen" ? c === "fullscreen" ? "lg" : c : "fullscreen");
3728
+ e.preventDefault(), e.stopPropagation(), L((e) => e === "fullscreen" ? c === "fullscreen" ? "lg" : c : "fullscreen");
3720
3729
  }
3721
3730
  }, /* @__PURE__ */ t.createElement(Q, {
3722
- name: F === "fullscreen" ? O.Modal.iconCollapse : O.Modal.iconExpand,
3731
+ name: I === "fullscreen" ? k.Modal.iconCollapse : k.Modal.iconExpand,
3723
3732
  size: 18
3724
- })), E ?? (a && /* @__PURE__ */ t.createElement("button", {
3733
+ })), D ?? (a && /* @__PURE__ */ t.createElement("button", {
3725
3734
  type: "button",
3726
- title: k.close,
3727
- "aria-label": k.close,
3728
- className: oe,
3735
+ title: A.close,
3736
+ "aria-label": A.close,
3737
+ className: le,
3729
3738
  onClick: (e) => {
3730
- e.preventDefault(), e.stopPropagation(), G();
3739
+ e.preventDefault(), e.stopPropagation(), K();
3731
3740
  }
3732
3741
  }, /* @__PURE__ */ t.createElement(Q, {
3733
3742
  name: "x",
3734
3743
  size: 20
3735
- }))))), /* @__PURE__ */ t.createElement("div", { className: H.bodyClassName }, e), ae && /* @__PURE__ */ t.createElement("div", { className: H.footerClassName }, i, !i && o && /* @__PURE__ */ t.createElement(Vr, {
3744
+ }))))), /* @__PURE__ */ t.createElement("div", { className: U.bodyClassName }, e), oe && /* @__PURE__ */ t.createElement("div", { className: U.footerClassName }, i, !i && o && /* @__PURE__ */ t.createElement(Vr, {
3736
3745
  variant: "primary",
3737
- label: k.save,
3746
+ label: A.save,
3738
3747
  onClick: async (e) => {
3739
- e.preventDefault(), await o(e) && G();
3748
+ e.preventDefault(), await o(e) && K();
3740
3749
  }
3741
3750
  }), !i && s && /* @__PURE__ */ t.createElement(Vr, {
3742
3751
  variant: "danger",
3743
- label: k.delete,
3752
+ label: A.delete,
3744
3753
  onClick: async (e) => {
3745
- e.preventDefault(), await s(e), G();
3754
+ e.preventDefault(), await s(e), K();
3746
3755
  }
3747
- }), !i && d && a && /* @__PURE__ */ t.createElement(Hr, {
3756
+ }), !i && f && a && /* @__PURE__ */ t.createElement(Hr, {
3748
3757
  variant: "link",
3749
- label: k.cancel,
3750
- onClick: G
3751
- }))), p)), !w && /* @__PURE__ */ t.createElement("div", {
3758
+ label: A.cancel,
3759
+ onClick: K
3760
+ }))), m)), !T && /* @__PURE__ */ t.createElement("div", {
3752
3761
  "data-rf-modal-backdrop": "",
3753
3762
  "aria-hidden": "true",
3754
3763
  className: "fixed inset-0 z-40 bg-black/60 backdrop-blur-sm",
3755
3764
  style: re,
3756
3765
  onClick: () => {
3757
- S && a && G();
3766
+ C && a && K();
3758
3767
  }
3759
3768
  })), document.body);
3760
3769
  }, Pi = ({ children: e, title: n = void 0, onYes: r = void 0, onNo: i = void 0, onClose: a = void 0 }) => {
@@ -3884,7 +3893,7 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
3884
3893
  }, H(n) ? /* @__PURE__ */ t.createElement(t.Fragment, null, n.icon && /* @__PURE__ */ t.createElement(Q, {
3885
3894
  name: n.icon,
3886
3895
  className: n.text ? "mr-2" : void 0
3887
- }), 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", te = /* @__PURE__ */ t.createElement(Li.Provider, { value: {
3896
+ }), 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: {
3888
3897
  closeOnSelect: l,
3889
3898
  close: () => V(!1)
3890
3899
  } }, /* @__PURE__ */ t.createElement("div", {
@@ -3905,11 +3914,11 @@ var Di = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
3905
3914
  onClick: (e) => {
3906
3915
  e.stopPropagation();
3907
3916
  }
3908
- }, 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))), ne = !u && p === "fixed" && typeof document < "u";
3917
+ }, 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";
3909
3918
  return /* @__PURE__ */ t.createElement(Z, { className: W }, g, /* @__PURE__ */ t.createElement("div", {
3910
3919
  ref: D,
3911
3920
  className: X(u ? "inline-block text-left" : "relative inline-block text-left", h || w.Dropdown.className)
3912
- }, U, ne ? j(te, document.body) : te), _);
3921
+ }, U, te ? j(K, document.body) : K), _);
3913
3922
  };
3914
3923
  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 }) {
3915
3924
  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) => {
@@ -4702,7 +4711,7 @@ var Oa = (e) => Da?.[e], ka = "scrape", Aa = "[DEFAULT]", ja = /* @__PURE__ */ n
4702
4711
  let t = Fa();
4703
4712
  if (!t) return !1;
4704
4713
  try {
4705
- return await W(t, V), await te(t, e), !0;
4714
+ return await W(t, V), await K(t, e), !0;
4706
4715
  } catch (e) {
4707
4716
  let n = t.app.options?.apiKey;
4708
4717
  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;
@@ -6769,11 +6778,11 @@ var qs = (e, t, n) => {
6769
6778
  } });
6770
6779
  }, 0), r;
6771
6780
  });
6772
- }, te = u(), ne = `${te}-options`;
6781
+ }, K = u(), te = `${K}-options`;
6773
6782
  return /* @__PURE__ */ t.createElement(Z, { className: A || M.Autocomplete.wrapperClassName }, d && /* @__PURE__ */ t.createElement(Is, {
6774
6783
  label: d,
6775
6784
  required: o,
6776
- htmlFor: te
6785
+ htmlFor: K
6777
6786
  }), /* @__PURE__ */ t.createElement(Z, { className: g || _ ? X(ls, "flex-nowrap") : "" }, g && /* @__PURE__ */ t.createElement(Ys, { side: "before" }, g), /* @__PURE__ */ t.createElement("div", { className: X(ss, "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", {
6778
6787
  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",
6779
6788
  key: e
@@ -6782,19 +6791,19 @@ var qs = (e, t, n) => {
6782
6791
  className: "ml-0.5 opacity-60 transition-opacity hover:opacity-100",
6783
6792
  onClick: () => G(e)
6784
6793
  }, "×"))), (!i || P.length < i) && /* @__PURE__ */ t.createElement("input", {
6785
- id: te,
6794
+ id: K,
6786
6795
  type: "text",
6787
6796
  className: X("min-w-[120px] flex-1 border-none bg-transparent text-sm outline-none placeholder:text-muted-foreground", w || M.Autocomplete.className),
6788
6797
  required: o && P.length < (r || 0),
6789
6798
  disabled: c || s && !St(O),
6790
6799
  placeholder: E ? m ?? "Type or press Enter to create..." : m,
6791
6800
  title: f,
6792
- list: ne,
6801
+ list: te,
6793
6802
  onChange: W,
6794
6803
  onKeyDown: ee
6795
- })), /* @__PURE__ */ t.createElement("datalist", { id: ne }, H.map((e, n) => /* @__PURE__ */ t.createElement("option", {
6804
+ })), /* @__PURE__ */ t.createElement("datalist", { id: te }, H.map((e, n) => /* @__PURE__ */ t.createElement("option", {
6796
6805
  value: e.value,
6797
- key: `${te}-${n}`
6806
+ key: `${K}-${n}`
6798
6807
  }, e.label))), _ && /* @__PURE__ */ t.createElement(Ys, { side: "after" }, _)), j ? /* @__PURE__ */ t.createElement(vs, { message: j }) : v && /* @__PURE__ */ t.createElement("div", { className: "mt-1 text-xs text-muted-foreground" }, v));
6799
6808
  }, 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 }) => {
6800
6809
  let { value: w, handleChange: T, formWrapClass: E } = Zd({
@@ -8125,13 +8134,13 @@ var Cc = 120, wc = 88, Tc = (e) => {
8125
8134
  return C((e) => o ? [...e, t] : [t]), H(""), W(void 0), B(!1), !0;
8126
8135
  }, G = () => {
8127
8136
  B(!1), H(""), W(void 0);
8128
- }, te = (e, t) => {
8137
+ }, K = (e, t) => {
8129
8138
  let n = e.currentTarget, r = n.naturalWidth > 0 && n.naturalHeight > 0 && (n.naturalWidth < d || n.naturalHeight < u);
8130
8139
  R((e) => {
8131
8140
  let n = new Set(e);
8132
8141
  return r ? n.add(t) : n.delete(t), n;
8133
8142
  });
8134
- }, ne = ({ scales: e }) => {
8143
+ }, te = ({ scales: e }) => {
8135
8144
  if (!e) return;
8136
8145
  let n = Object.keys(e);
8137
8146
  return n.length === 0 ? null : n.map((n) => /* @__PURE__ */ t.createElement(Qn, { key: n }, /* @__PURE__ */ t.createElement("a", {
@@ -8173,7 +8182,7 @@ var Cc = 120, wc = 88, Tc = (e) => {
8173
8182
  src: Ic(e),
8174
8183
  alt: `preview-${n}`,
8175
8184
  className: `absolute inset-0 w-full h-full ${L.has(e.key) ? "object-contain p-1" : "object-cover"}`,
8176
- onLoad: (t) => te(t, e.key)
8185
+ onLoad: (t) => K(t, e.key)
8177
8186
  }), /* @__PURE__ */ t.createElement("div", {
8178
8187
  className: "absolute inset-0 bg-black/55 backdrop-blur-[1px] flex flex-col items-center justify-end pb-2 gap-1 transition-opacity",
8179
8188
  style: { display: F === n ? "flex" : "none" }
@@ -8201,7 +8210,7 @@ var Cc = 120, wc = 88, Tc = (e) => {
8201
8210
  }, /* @__PURE__ */ t.createElement(Q, {
8202
8211
  name: "x",
8203
8212
  className: "w-4 h-4"
8204
- }))), 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(ns, {
8213
+ }))), 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(ns, {
8205
8214
  max: 100,
8206
8215
  min: 0,
8207
8216
  value: e.progress,
@@ -9050,7 +9059,7 @@ function mu(e) {
9050
9059
  return e ? (e.includes("/") ? e.split("/").pop() : e) || e : null;
9051
9060
  }
9052
9061
  function hu({ 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 }) {
9053
- 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, te] = h(C), [ne, re] = h(w), [K, ie] = h(T), [ae, oe] = h(E);
9062
+ 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);
9054
9063
  l(() => {
9055
9064
  a || U(!1);
9056
9065
  }, [a]), l(() => () => {
@@ -9110,8 +9119,8 @@ function hu({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
9110
9119
  ...x ? {
9111
9120
  role: W,
9112
9121
  voice: G,
9113
- style: ne,
9114
- language: K,
9122
+ style: te,
9123
+ language: re,
9115
9124
  temperature: ae
9116
9125
  } : {}
9117
9126
  }), L.forEach(({ objectUrl: e }) => URL.revokeObjectURL(e)), R([]));
@@ -9250,9 +9259,9 @@ function hu({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
9250
9259
  placement: "top",
9251
9260
  position: "start",
9252
9261
  triggerClassName: ou
9253
- }, /* @__PURE__ */ t.createElement(Vi, { onClick: () => te("") }, N.defaultOption), Zc.getVoices().map((e) => /* @__PURE__ */ t.createElement(Vi, {
9262
+ }, /* @__PURE__ */ t.createElement(Vi, { onClick: () => K("") }, N.defaultOption), Zc.getVoices().map((e) => /* @__PURE__ */ t.createElement(Vi, {
9254
9263
  key: e,
9255
- onClick: () => te(e)
9264
+ onClick: () => K(e)
9256
9265
  }, e))), /* @__PURE__ */ t.createElement(Ri, {
9257
9266
  trigger: {
9258
9267
  icon: "feather",
@@ -9261,9 +9270,9 @@ function hu({ name: e, value: n, onChange: r, placeholder: i, running: a = !1, o
9261
9270
  placement: "top",
9262
9271
  position: "start",
9263
9272
  triggerClassName: ou
9264
- }, /* @__PURE__ */ t.createElement(Vi, { onClick: () => re("") }, N.defaultOption), Zc.getStyles().map((e) => /* @__PURE__ */ t.createElement(Vi, {
9273
+ }, /* @__PURE__ */ t.createElement(Vi, { onClick: () => ne("") }, N.defaultOption), Zc.getStyles().map((e) => /* @__PURE__ */ t.createElement(Vi, {
9265
9274
  key: e,
9266
- onClick: () => re(e)
9275
+ onClick: () => ne(e)
9267
9276
  }, e))), /* @__PURE__ */ t.createElement(Ri, {
9268
9277
  trigger: {
9269
9278
  icon: "thermometer",
@@ -9435,12 +9444,12 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9435
9444
  let { handleChange: C, record: w } = Zd({
9436
9445
  name: e,
9437
9446
  subscribeToFullRecord: !0
9438
- }), 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 = rl(), L = il(), { modelOptions: R } = wu(), z = typeof localStorage < "u" ? localStorage.getItem("prompt.model") : null, B = z && R.some((e) => e.value === z) ? z : "", V = t.useMemo(() => Nu(r?.prompt, o), [o, r?.prompt]), H = V.model || B, U = u(), W = Tu(H, !!m), ee = !W.configured || !m && !H, [G, te] = h(null), ne = !G && !W.configured ? g?.({
9447
+ }), 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 = rl(), L = il(), { modelOptions: R } = wu(), z = typeof localStorage < "u" ? localStorage.getItem("prompt.model") : null, B = z && R.some((e) => e.value === z) ? z : "", V = t.useMemo(() => Nu(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?.({
9439
9448
  mode: "run",
9440
9449
  providerId: W.providerId,
9441
9450
  reason: W.reason,
9442
9451
  configured: W.configured
9443
- }) : null, re = t.useMemo(() => {
9452
+ }) : null, ne = t.useMemo(() => {
9444
9453
  if (!A) return "";
9445
9454
  let e = {
9446
9455
  ...w,
@@ -9451,7 +9460,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9451
9460
  A,
9452
9461
  w,
9453
9462
  _
9454
- ]), K = re !== A, ie = (e, t) => C?.({ target: {
9463
+ ]), re = ne !== A, ie = (e, t) => C?.({ target: {
9455
9464
  name: e,
9456
9465
  value: t
9457
9466
  } }), ae = x?.map((e) => e.key === "tokenUsage" && !e.content ? {
@@ -9475,7 +9484,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9475
9484
  noProvider: E.noProvider,
9476
9485
  noResponse: E.noResponse
9477
9486
  }), c = Date.now() - a;
9478
- if (te(null), C?.({ target: {
9487
+ if (K(null), C?.({ target: {
9479
9488
  name: e + ".value",
9480
9489
  value: s
9481
9490
  } }), 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) {
@@ -9490,7 +9499,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9490
9499
  });
9491
9500
  }
9492
9501
  } catch (e) {
9493
- te(Su(e, E.runFailed));
9502
+ K(Su(e, E.runFailed));
9494
9503
  }
9495
9504
  };
9496
9505
  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: `${_u} min-w-0 flex-1` }, D && /* @__PURE__ */ t.createElement(Cu, {
@@ -9518,7 +9527,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9518
9527
  className: `${p || T.Prompt.className} ${ju}`,
9519
9528
  minHeight: s,
9520
9529
  maxHeight: c
9521
- }), K && 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" }, re)), K && /* @__PURE__ */ t.createElement("div", { className: "flex items-center justify-end border-t border-input px-2 py-1" }, /* @__PURE__ */ t.createElement("button", {
9530
+ }), 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", {
9522
9531
  type: "button",
9523
9532
  title: M ? E.hidePreview : E.showPreview,
9524
9533
  className: `${Mu} flex items-center justify-center ${M ? "bg-muted text-foreground" : ""}`,
@@ -9565,7 +9574,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9565
9574
  maxHeight: c,
9566
9575
  className: p || T.Prompt.className,
9567
9576
  wrapperClassName: ""
9568
- }), (G || !W.configured) && (ne ? /* @__PURE__ */ t.createElement("div", { className: "mt-1" }, ne) : /* @__PURE__ */ t.createElement("span", { className: "mt-1 flex min-w-0 items-center gap-1 text-xs text-warning" }, /* @__PURE__ */ t.createElement(Q, {
9577
+ }), (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, {
9569
9578
  name: "triangle-alert",
9570
9579
  size: 13,
9571
9580
  className: "shrink-0"
@@ -9819,16 +9828,16 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9819
9828
  editorContext: null
9820
9829
  }), U = m(M ?? ""), W = m(V);
9821
9830
  W.current = V;
9822
- let ee = C?.length ? w ?? "/" : void 0, G = (C?.length ?? 0) >= 10, te = t.useMemo(() => new Map((C ?? []).map((e) => [e.name, e])), [C]), ne = t.useMemo(() => (C ?? []).map((e) => ({
9831
+ let ee = C?.length ? w ?? "/" : void 0, G = (C?.length ?? 0) >= 10, K = t.useMemo(() => new Map((C ?? []).map((e) => [e.name, e])), [C]), te = t.useMemo(() => (C ?? []).map((e) => ({
9823
9832
  key: e.name,
9824
9833
  label: `${ee ?? "/"}${e.name}`,
9825
9834
  value: e.name,
9826
9835
  icon: e.icon,
9827
9836
  description: e.description,
9828
9837
  group: e.group
9829
- })), [C, ee]), re = t.useMemo(() => {
9838
+ })), [C, ee]), ne = t.useMemo(() => {
9830
9839
  let e = [], n;
9831
- return ne.forEach((r) => {
9840
+ return te.forEach((r) => {
9832
9841
  r.group !== n && (n = r.group, r.group && e.push(/* @__PURE__ */ t.createElement(nu.Heading, { key: `group:${r.group}` }, r.group))), e.push(/* @__PURE__ */ t.createElement(nu.Item, {
9833
9842
  key: r.key,
9834
9843
  label: r.label,
@@ -9837,17 +9846,17 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9837
9846
  description: r.description
9838
9847
  }));
9839
9848
  }), e;
9840
- }, [ne]);
9849
+ }, [te]);
9841
9850
  l(() => {
9842
9851
  L.current || (U.current = M ?? "");
9843
9852
  }, [M]);
9844
- let K = s((t) => {
9853
+ let re = s((t) => {
9845
9854
  U.current = t, N({ target: {
9846
9855
  name: e,
9847
9856
  value: t
9848
9857
  } });
9849
- }, [N, e]), ie = m(K);
9850
- ie.current = K;
9858
+ }, [N, e]), ie = m(re);
9859
+ ie.current = re;
9851
9860
  let ae = s(() => {
9852
9861
  H({
9853
9862
  open: !1,
@@ -9856,7 +9865,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9856
9865
  editorContext: null
9857
9866
  });
9858
9867
  }, []), oe = s(async (e, t) => {
9859
- let n = te.get(e.value);
9868
+ let n = K.get(e.value);
9860
9869
  if (n) {
9861
9870
  if (n.handler) {
9862
9871
  let e = await n.handler($l(t)), r = n.consumeSuffix ? Xl(t.textAfterCaret, n.consumeSuffix) : 0;
@@ -9865,7 +9874,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
9865
9874
  }
9866
9875
  t.replace(t.triggerRange.start, t.triggerRange.end, `${t.trigger}${n.name} `);
9867
9876
  }
9868
- }, [te]);
9877
+ }, [K]);
9869
9878
  l(() => {
9870
9879
  let e = !1, t = null;
9871
9880
  return Qu(o).then((n) => {
@@ -10023,7 +10032,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
10023
10032
  required: p,
10024
10033
  htmlFor: k,
10025
10034
  className: v
10026
- }), /* @__PURE__ */ t.createElement("div", { className: X(D || O ? ls : "", j.fill && "flex-1 min-h-0 flex flex-col") }, 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-md rounded-r-none border-r-0") }, D), ee && ne.length > 0 ? /* @__PURE__ */ t.createElement(nu, {
10035
+ }), /* @__PURE__ */ t.createElement("div", { className: X(D || O ? ls : "", j.fill && "flex-1 min-h-0 flex flex-col") }, 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-md rounded-r-none border-r-0") }, D), ee && te.length > 0 ? /* @__PURE__ */ t.createElement(nu, {
10027
10036
  ref: R,
10028
10037
  className: X(j.fill && "flex-1 min-h-0 flex flex-col"),
10029
10038
  trigger: ee,
@@ -10038,7 +10047,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
10038
10047
  onSelect: (e, t) => {
10039
10048
  oe(e, t);
10040
10049
  }
10041
- }, re, ce) : ce, O && /* @__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") }, O)), F && /* @__PURE__ */ t.createElement(vs, { message: F }), _ && /* @__PURE__ */ t.createElement("p", { className: "mt-1 text-xs text-muted-foreground" }, _));
10050
+ }, ne, ce) : ce, O && /* @__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") }, O)), F && /* @__PURE__ */ t.createElement(vs, { message: F }), _ && /* @__PURE__ */ t.createElement("p", { className: "mt-1 text-xs text-muted-foreground" }, _));
10042
10051
  }, rd = () => Promise.all([
10043
10052
  import("@tiptap/react"),
10044
10053
  import("@tiptap/react/menus"),
@@ -10665,19 +10674,19 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
10665
10674
  a
10666
10675
  ] : a;
10667
10676
  }
10668
- }), { 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), [te, ne] = h({
10677
+ }), { 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({
10669
10678
  open: !1,
10670
10679
  query: "",
10671
10680
  anchorPosition: null,
10672
10681
  editorContext: null
10673
- }), re = m(te);
10674
- re.current = te;
10675
- 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) => ({
10682
+ }), ne = m(K);
10683
+ ne.current = K;
10684
+ 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) => ({
10676
10685
  key: e.name,
10677
- label: `${K ?? "/"}${e.name}`,
10686
+ label: `${re ?? "/"}${e.name}`,
10678
10687
  value: e.name,
10679
10688
  icon: e.icon
10680
- })), [x, K]), se = g?.srcsetWidths === void 0 ? [400, 800] : g.srcsetWidths, ce = fc(), le = Ac({
10689
+ })), [x, re]), se = g?.srcsetWidths === void 0 ? [400, 800] : g.srcsetWidths, ce = fc(), le = Ac({
10681
10690
  uploadPath: g?.path,
10682
10691
  srcsetWidths: se,
10683
10692
  onFileReady: (e) => {
@@ -10693,7 +10702,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
10693
10702
  maxHeight: p,
10694
10703
  paddingOffset: 16
10695
10704
  }), de = s(() => {
10696
- ne({
10705
+ te({
10697
10706
  open: !1,
10698
10707
  query: "",
10699
10708
  anchorPosition: null,
@@ -10772,7 +10781,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
10772
10781
  return !1;
10773
10782
  },
10774
10783
  handleKeyDown(e, t) {
10775
- if (!re.current.open) return !1;
10784
+ if (!ne.current.open) return !1;
10776
10785
  switch (t.key) {
10777
10786
  case "ArrowDown": return t.preventDefault(), G.current?.moveNext(), !0;
10778
10787
  case "ArrowUp": return t.preventDefault(), G.current?.movePrev(), !0;
@@ -10798,32 +10807,32 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
10798
10807
  q.off("selectionUpdate", W);
10799
10808
  };
10800
10809
  }, [q, ue.adjustedMinHeight]), l(() => {
10801
- if (!q || !K || I) {
10802
- re.current.open && de();
10810
+ if (!q || !re || I) {
10811
+ ne.current.open && de();
10803
10812
  return;
10804
10813
  }
10805
10814
  let e = () => {
10806
10815
  if (!q.isFocused) {
10807
- re.current.open && de();
10816
+ ne.current.open && de();
10808
10817
  return;
10809
10818
  }
10810
10819
  let e = q.state.selection;
10811
10820
  if (!e.empty) {
10812
- re.current.open && de();
10821
+ ne.current.open && de();
10813
10822
  return;
10814
10823
  }
10815
10824
  let { $from: t } = e, n = t.parent;
10816
10825
  if (!n.isTextblock) {
10817
- re.current.open && de();
10826
+ ne.current.open && de();
10818
10827
  return;
10819
10828
  }
10820
- let r = n.textContent ?? "", i = t.parentOffset, a = Sd(r, i, K);
10829
+ let r = n.textContent ?? "", i = t.parentOffset, a = Sd(r, i, re);
10821
10830
  if (!a) {
10822
- re.current.open && de();
10831
+ ne.current.open && de();
10823
10832
  return;
10824
10833
  }
10825
- let o = q.view.coordsAtPos(e.from), s = fe(q, K);
10826
- o && s && ne({
10834
+ let o = q.view.coordsAtPos(e.from), s = fe(q, re);
10835
+ o && s && te({
10827
10836
  open: !0,
10828
10837
  query: a.query,
10829
10838
  anchorPosition: {
@@ -10840,7 +10849,7 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
10840
10849
  de,
10841
10850
  q,
10842
10851
  fe,
10843
- K,
10852
+ re,
10844
10853
  I
10845
10854
  ]);
10846
10855
  let me = s(async (e, t) => {
@@ -11061,15 +11070,15 @@ var Eu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
11061
11070
  style: ue.wrapperStyle,
11062
11071
  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)]")
11063
11072
  }, /* @__PURE__ */ t.createElement(w, { editor: q }));
11064
- return K && oe.length > 0 ? /* @__PURE__ */ t.createElement(nu, {
11073
+ return re && oe.length > 0 ? /* @__PURE__ */ t.createElement(nu, {
11065
11074
  ref: G,
11066
- trigger: K,
11075
+ trigger: re,
11067
11076
  searchable: ie,
11068
- controlled: te.editorContext ? {
11069
- open: te.open,
11070
- anchorPosition: te.anchorPosition,
11071
- query: te.query,
11072
- editorContext: te.editorContext,
11077
+ controlled: K.editorContext ? {
11078
+ open: K.open,
11079
+ anchorPosition: K.anchorPosition,
11080
+ query: K.query,
11081
+ editorContext: K.editorContext,
11073
11082
  onClose: de
11074
11083
  } : void 0,
11075
11084
  onSelect: (e, t) => {
@@ -12258,7 +12267,7 @@ function of(e) {
12258
12267
  var sf = {}, cf = ({ 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 }) => {
12259
12268
  let j = x(), N = Y("form"), P = Fn("form"), F = Ti(), I = Vd(r), L = Rd(I), R = m(void 0);
12260
12269
  R.current ||= of(c);
12261
- let z = R.current, B = g(z.subscribe, z.getRecord), V = z.setRecord, [H, U] = h(!1), [W, ee] = h(!1), G = !c?.[za], te = m(wt(c ?? {})), [ne, re] = h(() => rf(c)), [K, ie] = h(null), ae = m({ isDirty: !1 }), oe = p(() => {
12270
+ 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(() => rf(c)), [re, ie] = h(null), ae = m({ isDirty: !1 }), oe = p(() => {
12262
12271
  if (!C) return;
12263
12272
  let e = ct(C), t = ct(o || `${j.pathname}${j.hash || ""}`);
12264
12273
  return e && t ? `llmnative.form-draft.${e}.${t}` : void 0;
@@ -12267,12 +12276,12 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12267
12276
  j.pathname,
12268
12277
  j.hash,
12269
12278
  o
12270
- ]), se = !!(_ || o || !G), ce = !(!v && G), le = p(() => !Ft(B, te.current), [B, te.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(() => {
12279
+ ]), 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(() => {
12271
12280
  oe && typeof localStorage < "u" && localStorage.removeItem(oe);
12272
12281
  }, [oe]), _e = s(() => {
12273
12282
  if (oe && typeof localStorage < "u") return af(localStorage.getItem(oe));
12274
12283
  }, [oe]), ve = s(() => {
12275
- V(wt(te.current));
12284
+ V(wt(K.current));
12276
12285
  }, []), [ye, be] = h(void 0), xe = s(({ message: e, type: t = "danger" }) => {
12277
12286
  S && be({
12278
12287
  type: t,
@@ -12377,7 +12386,7 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12377
12386
  action: t,
12378
12387
  storagePath: je.current
12379
12388
  })) ?? ze(Ee.current ?? {});
12380
- return e && await F.set(e, Nt(Ee.current)), te.current = wt(Ee.current ?? {}), re(rf(Ee.current)), ge(), ie(null), await Be(t);
12389
+ return e && await F.set(e, Nt(Ee.current)), K.current = wt(Ee.current ?? {}), ne(rf(Ee.current)), ge(), ie(null), await Be(t);
12381
12390
  } finally {
12382
12391
  U(!1);
12383
12392
  }
@@ -12409,7 +12418,7 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12409
12418
  ]);
12410
12419
  l(() => {
12411
12420
  let e = wt(c ?? {});
12412
- if (c && (V(e), d?.(wt(e))), te.current = e, re(rf(e)), !C) {
12421
+ if (c && (V(e), d?.(wt(e))), K.current = e, ne(rf(e)), !C) {
12413
12422
  ie(null);
12414
12423
  return;
12415
12424
  }
@@ -12439,7 +12448,7 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12439
12448
  if (!oe || typeof localStorage > "u" || B === void 0) return;
12440
12449
  if (!le) {
12441
12450
  let e = _e();
12442
- if (e && rf(e) !== ne) return;
12451
+ if (e && rf(e) !== te) return;
12443
12452
  localStorage.removeItem(oe);
12444
12453
  return;
12445
12454
  }
@@ -12455,7 +12464,7 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12455
12464
  }, 150);
12456
12465
  return () => window.clearTimeout(e);
12457
12466
  }, [
12458
- ne,
12467
+ te,
12459
12468
  oe,
12460
12469
  le,
12461
12470
  xe,
@@ -12502,8 +12511,8 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12502
12511
  isDeleting: W,
12503
12512
  saveDisabled: !se || !le || H,
12504
12513
  deleteDisabled: !ce || W,
12505
- hasDraft: K !== null,
12506
- draftStatus: K,
12514
+ hasDraft: re !== null,
12515
+ draftStatus: re,
12507
12516
  errors: Se,
12508
12517
  hasErrors: Object.keys(Se).length > 0
12509
12518
  });
@@ -12511,7 +12520,7 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12511
12520
  ce,
12512
12521
  se,
12513
12522
  L,
12514
- K,
12523
+ re,
12515
12524
  Se,
12516
12525
  W,
12517
12526
  le,
@@ -12548,13 +12557,13 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12548
12557
  timeout: ye.type === "success" ? 3e3 : void 0,
12549
12558
  onClose: ye.type === "success" ? () => be(void 0) : void 0
12550
12559
  }, ye.message) : null, [ye, w]), Je = p(() => {
12551
- if (!K) return null;
12552
- let e = K === "restore" ? de : me, n = K === "restore" ? fe : he;
12560
+ if (!re) return null;
12561
+ let e = re === "restore" ? de : me, n = re === "restore" ? fe : he;
12553
12562
  return /* @__PURE__ */ t.createElement(Io, {
12554
- variant: K === "restore" ? "warning" : "info",
12555
- timeout: K === "restored" ? 6e3 : void 0,
12556
- onClose: K === "restored" ? () => ie(null) : void 0
12557
- }, /* @__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" }, K === "restore" ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(Hr, {
12563
+ variant: re === "restore" ? "warning" : "info",
12564
+ timeout: re === "restored" ? 6e3 : void 0,
12565
+ onClose: re === "restored" ? () => ie(null) : void 0
12566
+ }, /* @__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, {
12558
12567
  label: q,
12559
12568
  variant: "warning",
12560
12569
  onClick: () => Pe()
@@ -12570,7 +12579,7 @@ var sf = {}, cf = ({ children: e, appearance: n = void 0, controller: r = void 0
12570
12579
  }, [
12571
12580
  Ne,
12572
12581
  pe,
12573
- K,
12582
+ re,
12574
12583
  q,
12575
12584
  fe,
12576
12585
  de,
@@ -12897,7 +12906,7 @@ function Cf(e, t) {
12897
12906
  function wf({ 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 }) {
12898
12907
  let F = Y("table"), I = Fn("table"), L = N || F.Table.selectedClassName, [R, z] = h(n || []), B = p(() => {
12899
12908
  if (d && typeof d != "boolean") return d;
12900
- }, [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, te] = h(null), [ne, re] = h(null), [K, ie] = h(null), [ae, oe] = h(null), se = m(!1), ce = s((e) => {
12909
+ }, [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) => {
12901
12910
  e && ee(e);
12902
12911
  }, []), le = u(), ue = !!a, de = V || !!Hs.normalize(B), fe = ue && de, q = !fe && V, pe = fe ? void 0 : B;
12903
12912
  l(() => {
@@ -12966,8 +12975,8 @@ function wf({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
12966
12975
  ]), Te = s((e, t) => {
12967
12976
  if (!G) return;
12968
12977
  let n = be.findIndex((e, t) => he(e, t) === G), r = be.findIndex((n, r) => he(n, r) === he(e, t));
12969
- re(null), te(null);
12970
- let i = K?.position || "after";
12978
+ ne(null), K(null);
12979
+ let i = re?.position || "after";
12971
12980
  if (ie(null), n < 0 || r < 0 || n === r) return;
12972
12981
  let o = [...be], [s] = o.splice(n, 1), c = n < r ? r + (i === "after" ? 0 : -1) : r + +(i === "after");
12973
12982
  o.splice(c, 0, s), U(void 0), z(o), a?.(o, {
@@ -12977,7 +12986,7 @@ function wf({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
12977
12986
  });
12978
12987
  }, [
12979
12988
  G,
12980
- K?.position,
12989
+ re?.position,
12981
12990
  he,
12982
12991
  a,
12983
12992
  be
@@ -12992,10 +13001,10 @@ function wf({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
12992
13001
  F.Table.scrollClassName,
12993
13002
  j ? `${j} overflow-auto` : "",
12994
13003
  M || ""
12995
- ].filter(Boolean).join(" "), Oe = !!j, ke = Ee.length + +!!ve + +!!ue, Ae = Oe ? "sticky top-0 z-10 bg-card" : "", je = (e, n, r, i) => !K || K.key !== e || K.position !== n ? null : /* @__PURE__ */ t.createElement("tr", {
13004
+ ].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", {
12996
13005
  "aria-hidden": "true",
12997
13006
  onDragOver: (t) => {
12998
- ue && (t.preventDefault(), ne !== e && re(e), ie({
13007
+ ue && (t.preventDefault(), te !== e && ne(e), ie({
12999
13008
  key: e,
13000
13009
  position: n
13001
13010
  }));
@@ -13069,7 +13078,7 @@ function wf({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
13069
13078
  return e.map((e, o) => {
13070
13079
  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;
13071
13080
  a = u;
13072
- let f = ge.includes(l), p = ne === l, m = G === l, h = L && (g === void 0 ? ae : g) === l;
13081
+ let f = ge.includes(l), p = te === l, m = G === l, h = L && (g === void 0 ? ae : g) === l;
13073
13082
  return /* @__PURE__ */ t.createElement(t.Fragment, { key: l }, d && /* @__PURE__ */ t.createElement("tr", { "aria-hidden": "true" }, /* @__PURE__ */ t.createElement("td", {
13074
13083
  colSpan: ke,
13075
13084
  className: "bg-muted/40 px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground"
@@ -13088,22 +13097,22 @@ function wf({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
13088
13097
  i && xe(t, e, s);
13089
13098
  },
13090
13099
  onDragStart: () => {
13091
- te(l);
13100
+ K(l);
13092
13101
  },
13093
13102
  onDragOver: (e) => {
13094
13103
  if (!ue) return;
13095
13104
  e.preventDefault();
13096
13105
  let t = e.currentTarget.getBoundingClientRect(), n = e.clientY < t.top + t.height / 2 ? "before" : "after";
13097
- ne !== l && re(l), G !== l && ie((e) => e?.key === l && e.position === n ? e : {
13106
+ te !== l && ne(l), G !== l && ie((e) => e?.key === l && e.position === n ? e : {
13098
13107
  key: l,
13099
13108
  position: n
13100
13109
  });
13101
13110
  },
13102
13111
  onDragLeave: () => {
13103
- ne === l && re(null);
13112
+ te === l && ne(null);
13104
13113
  },
13105
13114
  onDragEnd: () => {
13106
- te(null), re(null), ie(null);
13115
+ K(null), ne(null), ie(null);
13107
13116
  },
13108
13117
  onDrop: (t) => {
13109
13118
  ue && (t.preventDefault(), Te(e, s));
@@ -13142,10 +13151,10 @@ function wf({ columns: e = void 0, records: n = void 0, footer: r = void 0, onRo
13142
13151
  "aria-label": Dn(I.reorderRow, { key: l }),
13143
13152
  onClick: (e) => e.preventDefault(),
13144
13153
  onDragStart: (e) => {
13145
- e.stopPropagation(), te(l);
13154
+ e.stopPropagation(), K(l);
13146
13155
  },
13147
13156
  onDragEnd: (e) => {
13148
- e.stopPropagation(), te(null), re(null), ie(null);
13157
+ e.stopPropagation(), K(null), ne(null), ie(null);
13149
13158
  }
13150
13159
  }, /* @__PURE__ */ t.createElement(k, { size: 14 }))), Ee.map((n) => /* @__PURE__ */ t.createElement("td", {
13151
13160
  key: n.key,
@@ -13502,9 +13511,9 @@ var Xf = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
13502
13511
  required: r,
13503
13512
  label: n,
13504
13513
  validator: f
13505
- }), V = u(), H = v ?? V, U = typeof _ == "object" ? _ : {}, W = !!_, ee = U.position ?? "below", G = U.defaultZoom ?? 15, te = 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);
13514
+ }), 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);
13506
13515
  l(() => {
13507
- typeof A.value == "string" && A.value !== ne && re(A.value);
13516
+ typeof A.value == "string" && A.value !== te && ne(A.value);
13508
13517
  }, [A.value]), l(() => {
13509
13518
  if (!ae) return;
13510
13519
  let e = (e) => {
@@ -13513,7 +13522,7 @@ var Xf = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
13513
13522
  return window.document.addEventListener("pointerdown", e), () => window.document.removeEventListener("pointerdown", e);
13514
13523
  }, [ae]), l(() => {
13515
13524
  if (!O) return;
13516
- let e = ++fe.current, t = ne.trim();
13525
+ let e = ++fe.current, t = te.trim();
13517
13526
  if (t.length < 3) {
13518
13527
  ie([]), ce(!1);
13519
13528
  return;
@@ -13551,11 +13560,11 @@ var Xf = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
13551
13560
  })();
13552
13561
  }, 250);
13553
13562
  return () => window.clearTimeout(n);
13554
- }, [ne, O]);
13563
+ }, [te, O]);
13555
13564
  let ye = (e, t) => {
13556
13565
  ve.current = !0;
13557
- let n = e.formatted ?? ne;
13558
- re(n), A.handleChange({ target: {
13566
+ let n = e.formatted ?? te;
13567
+ ne(n), A.handleChange({ target: {
13559
13568
  name: k.formatted,
13560
13569
  value: n
13561
13570
  } }), e.street !== void 0 && j.handleChange({ target: {
@@ -13636,7 +13645,7 @@ var Xf = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
13636
13645
  })).results[0];
13637
13646
  if (!n) return;
13638
13647
  let r = Yf(n), i = r.formatted ?? t;
13639
- if (re(i), A.handleChange({ target: {
13648
+ if (ne(i), A.handleChange({ target: {
13640
13649
  name: k.formatted,
13641
13650
  value: i
13642
13651
  } }), r.lat !== void 0 && L.handleChange({ target: {
@@ -13738,7 +13747,7 @@ var Xf = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
13738
13747
  let we = W ? /* @__PURE__ */ t.createElement("div", {
13739
13748
  ref: pe,
13740
13749
  className: X("mt-2 w-full overflow-hidden rounded-md border", T),
13741
- style: { height: te }
13750
+ style: { height: K }
13742
13751
  }) : null;
13743
13752
  return /* @__PURE__ */ t.createElement(Z, { className: A.formWrapClass || D.AddressAutocomplete.wrapperClassName }, n && /* @__PURE__ */ t.createElement(Is, {
13744
13753
  label: n,
@@ -13759,16 +13768,16 @@ var Xf = ({ name: e, label: n = void 0, required: r = !1, placeholder: i = void
13759
13768
  placeholder: i ?? E.placeholder,
13760
13769
  required: r,
13761
13770
  disabled: a,
13762
- value: ne,
13771
+ value: te,
13763
13772
  onChange: (e) => {
13764
- re(e.target.value), oe(!0);
13773
+ ne(e.target.value), oe(!0);
13765
13774
  },
13766
13775
  onFocus: () => oe(!0)
13767
13776
  }), /* @__PURE__ */ t.createElement("span", { className: "pointer-events-none absolute inset-y-0 right-2 flex items-center text-muted-foreground" }, /* @__PURE__ */ t.createElement(Q, {
13768
13777
  name: se ? "loader-circle" : "map-pin",
13769
13778
  size: 15,
13770
13779
  className: se ? "animate-spin" : void 0
13771
- })), 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", {
13780
+ })), 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", {
13772
13781
  key: e.id,
13773
13782
  type: "button",
13774
13783
  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),
@@ -14934,17 +14943,17 @@ var mm = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
14934
14943
  typeof u == "object" ? u?.dir : void 0,
14935
14944
  typeof u == "object" ? u?.field : void 0,
14936
14945
  u
14937
- ]), W = Cf("item"), ee = s((e, t) => W(e, t), [W]), { activeSelectedKeys: G, showSelection: te, updateSelection: ne } = Sf({
14946
+ ]), W = Cf("item"), ee = s((e, t) => W(e, t), [W]), { activeSelectedKeys: G, showSelection: K, updateSelection: te } = Sf({
14938
14947
  records: H,
14939
14948
  selectedKeys: v,
14940
14949
  onSelectionChange: c,
14941
14950
  getRecordKey: ee
14942
- }), re = m(/* @__PURE__ */ new Map());
14951
+ }), ne = m(/* @__PURE__ */ new Map());
14943
14952
  l(() => {
14944
14953
  let e = new Set(H.map((e, t) => ee(e, t)));
14945
- for (let t of re.current.keys()) e.has(t) || re.current.delete(t);
14954
+ for (let t of ne.current.keys()) e.has(t) || ne.current.delete(t);
14946
14955
  }, [H, ee]);
14947
- let K = (e, t) => {
14956
+ let re = (e, t) => {
14948
14957
  if (j) {
14949
14958
  let t = j.split(/\s+/).filter(Boolean), n = e.target;
14950
14959
  for (; n && !n.classList.contains("item");) {
@@ -14963,11 +14972,11 @@ var mm = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
14963
14972
  o?.(t);
14964
14973
  }, ie = s((e, t) => {
14965
14974
  let n = ee(e, t), r = G.includes(n) ? G.filter((e) => e !== n) : [...G, n];
14966
- ne(r);
14975
+ te(r);
14967
14976
  }, [
14968
14977
  G,
14969
14978
  ee,
14970
- ne
14979
+ te
14971
14980
  ]), ae = (e, n) => {
14972
14981
  let r = e.img;
14973
14982
  return r && t.isValidElement(r) ? t.cloneElement(r, {
@@ -14978,7 +14987,7 @@ var mm = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
14978
14987
  cursor: o ? "pointer" : "default"
14979
14988
  },
14980
14989
  onClick: o ? ((t) => {
14981
- K(t, e), r.props.onClick?.(t);
14990
+ re(t, e), r.props.onClick?.(t);
14982
14991
  }) : r.props.onClick
14983
14992
  }) : /* @__PURE__ */ t.createElement("img", {
14984
14993
  className: "block h-auto w-full max-w-full rounded-lg object-cover",
@@ -14990,7 +14999,7 @@ var mm = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
14990
14999
  aspectRatio: "16 / 11",
14991
15000
  cursor: o ? "pointer" : "default"
14992
15001
  },
14993
- onClick: o ? ((t) => K(t, e)) : void 0
15002
+ onClick: o ? ((t) => re(t, e)) : void 0
14994
15003
  });
14995
15004
  }, oe = (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, {
14996
15005
  badge: e,
@@ -15049,7 +15058,7 @@ var mm = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
15049
15058
  ...r.style
15050
15059
  }, o.align, r.className)) : null;
15051
15060
  }) : null, fe = s((e, t) => {
15052
- let n = ee(e, t), r = re.current.get(n);
15061
+ let n = ee(e, t), r = ne.current.get(n);
15053
15062
  if (r && r.recordRef === e && r.overlaysRef === i && r.onClickRef === o && r.rowIndex === t) return {
15054
15063
  image: r.image,
15055
15064
  overlays: r.overlays
@@ -15058,7 +15067,7 @@ var mm = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
15058
15067
  image: ae(e, t),
15059
15068
  overlays: de(e, t)
15060
15069
  };
15061
- return re.current.set(n, {
15070
+ return ne.current.set(n, {
15062
15071
  recordRef: e,
15063
15072
  overlaysRef: i,
15064
15073
  onClickRef: o,
@@ -15084,8 +15093,8 @@ var mm = ({ children: e, name: n, onChange: r = void 0, onAdd: i = void 0, onRem
15084
15093
  }
15085
15094
  }, /* @__PURE__ */ t.createElement("div", {
15086
15095
  className: X("relative", !a && "overflow-hidden rounded-lg", a && o && "cursor-pointer"),
15087
- onClick: a && o ? (e) => K(e, n) : void 0
15088
- }, 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", {
15096
+ onClick: a && o ? (e) => re(e, n) : void 0
15097
+ }, K && /* @__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", {
15089
15098
  type: "checkbox",
15090
15099
  "aria-label": Dn(k.selectItem, { key: r }),
15091
15100
  checked: i,
@@ -15579,13 +15588,13 @@ function km({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, fo
15579
15588
  columns: i,
15580
15589
  records: U,
15581
15590
  form: o
15582
- }), [G, te] = h(() => Object.fromEntries((M ?? []).map((e) => [e.key, Cm(e)]))), [ne, re] = h(!1), K = s((e, t) => {
15583
- te((n) => ({
15591
+ }), [G, K] = h(() => Object.fromEntries((M ?? []).map((e) => [e.key, Cm(e)]))), [te, ne] = h(!1), re = s((e, t) => {
15592
+ K((n) => ({
15584
15593
  ...n,
15585
15594
  [e]: t
15586
15595
  }));
15587
15596
  }, []), ie = s((e) => {
15588
- te((t) => ({
15597
+ K((t) => ({
15589
15598
  ...t,
15590
15599
  [e.key]: Cm(e)
15591
15600
  }));
@@ -15599,7 +15608,7 @@ function km({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, fo
15599
15608
  title: z.filtersButton,
15600
15609
  variant: "link",
15601
15610
  badge: ae.length > 0 ? ae.length : void 0,
15602
- onClick: () => re(!0)
15611
+ onClick: () => ne(!0)
15603
15612
  }) : 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, {
15604
15613
  key: e.key,
15605
15614
  variant: "info",
@@ -15610,22 +15619,22 @@ function km({ records: e, recordId: n, sourcePath: r, columns: i, actions: a, fo
15610
15619
  ariaLabel: `${z.filtersClearAll} ${e.label}`,
15611
15620
  title: `${z.filtersClearAll} ${e.label}`,
15612
15621
  onClick: () => ie(e)
15613
- })))) : null, le = !j && se ? /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap items-center gap-2" }, se, ce) : null, ue = ne && M && M.length > 0 ? /* @__PURE__ */ t.createElement(Mi, {
15622
+ })))) : 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, {
15614
15623
  title: z.filtersPanelTitle,
15615
15624
  size: "md",
15616
15625
  position: "right",
15617
- onClose: () => re(!1),
15626
+ onClose: () => ne(!1),
15618
15627
  footer: /* @__PURE__ */ t.createElement(Hr, {
15619
15628
  label: z.filtersClearAll,
15620
15629
  variant: "link",
15621
15630
  disabled: ae.length === 0,
15622
- onClick: () => te(Object.fromEntries(M.map((e) => [e.key, Cm(e)])))
15631
+ onClick: () => K(Object.fromEntries(M.map((e) => [e.key, Cm(e)])))
15623
15632
  })
15624
15633
  }, /* @__PURE__ */ t.createElement("div", { className: "flex flex-col gap-5" }, M.map((e) => /* @__PURE__ */ t.createElement(Om, {
15625
15634
  key: e.key,
15626
15635
  filter: e,
15627
15636
  value: G[e.key] ?? Cm(e),
15628
- onChange: (t) => K(e.key, t),
15637
+ onChange: (t) => re(e.key, t),
15629
15638
  dict: z
15630
15639
  })))) : null, de = j === !0 ? {} : j || void 0, [fe, q] = h(""), pe = p(() => {
15631
15640
  if (!de || !fe.trim()) return oe;
@@ -16162,7 +16171,7 @@ var Nm = () => {
16162
16171
  let e = Zr("user");
16163
16172
  e?.profile?.sub && window.google?.accounts?.id?.revoke(e.profile.sub), localStorage.removeItem("googleCredentialToken"), $r("user");
16164
16173
  let t = Fa();
16165
- t && await K(t);
16174
+ t && await re(t);
16166
16175
  }
16167
16176
  onAuthChange(e) {
16168
16177
  let t = Fa();
@@ -16549,19 +16558,19 @@ var fh = class {
16549
16558
  if (n === "oauth") {
16550
16559
  let { provider: n } = e;
16551
16560
  if (!n) throw Error("FirebaseAuthProvider.signIn: provider is required for oauth");
16552
- let { user: r } = await re(t, uh(n));
16561
+ let { user: r } = await ne(t, uh(n));
16553
16562
  return dh(r);
16554
16563
  }
16555
16564
  let { email: r, password: i } = e;
16556
16565
  if (!r || !i) throw Error("FirebaseAuthProvider.signIn: email and password are required");
16557
- let { user: a } = await ne(t, r, i);
16566
+ let { user: a } = await te(t, r, i);
16558
16567
  return dh(a);
16559
16568
  }
16560
16569
  async signOut() {
16561
16570
  await this.initPromise;
16562
16571
  let e = Fa(this.appName);
16563
16572
  if (!e) throw Error("FirebaseAuthProvider: Firebase auth is not initialized");
16564
- await K(e);
16573
+ await re(e);
16565
16574
  }
16566
16575
  onAuthChange(e) {
16567
16576
  if (!this.options.config) {