@templatical/media-library 0.6.6 → 0.7.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.
@@ -1,10 +1,10 @@
1
1
  import { API_ROUTES as e, ApiClient as t, buildUrl as n, createSdkAuthManager as r } from "@templatical/core/cloud";
2
- import { Fragment as i, Teleport as a, Transition as o, computed as s, createApp as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, h as g, inject as _, isRef as v, normalizeClass as y, normalizeStyle as b, onMounted as x, openBlock as S, provide as C, ref as w, renderList as T, resolveComponent as E, toDisplayString as D, unref as O, vModelText as k, watch as A, withCtx as j, withDirectives as M, withKeys as N, withModifiers as P } from "vue";
3
- import { Check as F, ChevronRight as I, Copy as L, File as R, Folder as z, Grid2x2 as B, Link as V, List as H, LoaderCircle as U, PanelLeft as W, Pencil as G, Plus as K, RefreshCw as q, Search as J, Star as Y, Trash2 as ee, Upload as X, X as te } from "@lucide/vue";
4
- import { Cropper as ne } from "vue-advanced-cropper";
5
- import { onClickOutside as re, useClipboard as ie, useDebounceFn as ae, useDropZone as oe, useEventListener as se, useFileDialog as ce, useIntersectionObserver as le } from "@vueuse/core";
2
+ import { Fragment as i, Teleport as a, Transition as o, computed as s, createApp as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, h as g, inject as _, isRef as v, normalizeClass as y, normalizeStyle as b, onMounted as x, openBlock as S, provide as C, ref as w, renderList as T, resolveComponent as E, toDisplayString as D, toRef as O, unref as k, vModelText as A, watch as j, withCtx as M, withDirectives as N, withKeys as P, withModifiers as F } from "vue";
3
+ import { Check as I, ChevronRight as L, Copy as R, File as z, Folder as B, Grid2x2 as V, Link as H, List as U, LoaderCircle as W, PanelLeft as G, Pencil as K, Plus as q, RefreshCw as J, Search as Y, Star as ee, Trash2 as X, Upload as te, X as ne } from "@lucide/vue";
4
+ import { Cropper as re } from "vue-advanced-cropper";
5
+ import { onClickOutside as ie, useClipboard as ae, useDebounceFn as oe, useDropZone as se, useEventListener as ce, useFileDialog as le, useIntersectionObserver as ue } from "@vueuse/core";
6
6
  //#region src/api-client.ts
7
- var ue = class {
7
+ var de = class {
8
8
  constructor(e) {
9
9
  this.authManager = e;
10
10
  }
@@ -160,9 +160,9 @@ var ue = class {
160
160
  };
161
161
  //#endregion
162
162
  //#region src/composable.ts
163
- function de(e) {
163
+ function fe(e) {
164
164
  if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
165
- let t = new ue(e.authManager), n = w([]), r = w([]), i = w(null), a = w("files"), o = w(""), s = w(null), c = w("newest"), l = w(!1), u = w(!1), d = w(!1), f = w(null), p = w(null), m = w(/* @__PURE__ */ new Set()), h = w(null), g = w([]), _ = w({}), v = w(!1), y = w([]), b = w(!1), x = w(null), S = w(!1), C = w(null), T = w(!1), E = w(null), D = w(null), O = 0;
165
+ let t = new de(e.authManager), n = w([]), r = w([]), i = w(null), a = w("files"), o = w(""), s = w(null), c = w("newest"), l = w(!1), u = w(!1), d = w(!1), f = w(null), p = w(null), m = w(/* @__PURE__ */ new Set()), h = w(null), g = w([]), _ = w({}), v = w(!1), y = w([]), b = w(!1), x = w(null), S = w(!1), C = w(null), T = w(!1), E = w(null), D = w(null), O = 0;
166
166
  async function k() {
167
167
  let r = ++O;
168
168
  l.value = !0;
@@ -467,14 +467,14 @@ function Z(e) {
467
467
  }
468
468
  //#endregion
469
469
  //#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
470
- var fe = {
470
+ var pe = {
471
471
  key: 0,
472
472
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
473
473
  style: { color: "var(--tpl-text-muted)" }
474
- }, pe = ["onClick"], me = {
474
+ }, me = ["onClick"], he = {
475
475
  key: 1,
476
476
  style: { color: "var(--tpl-text)" }
477
- }, he = /* @__PURE__ */ h({
477
+ }, ge = /* @__PURE__ */ h({
478
478
  __name: "MediaBreadcrumb",
479
479
  props: {
480
480
  folders: {},
@@ -494,11 +494,11 @@ var fe = {
494
494
  }
495
495
  return !1;
496
496
  }
497
- return (e, t) => o.value.length > 0 ? (S(), d("div", fe, [f("button", {
497
+ return (e, t) => o.value.length > 0 ? (S(), d("div", pe, [f("button", {
498
498
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
499
499
  style: { color: "var(--tpl-primary)" },
500
500
  onClick: t[0] ||= (e) => r("navigate", null)
501
- }, D(O(a).mediaLibrary.allFiles), 1), (S(!0), d(i, null, T(o.value, (e, t) => (S(), d(i, { key: e.id }, [m(O(I), {
501
+ }, D(k(a).mediaLibrary.allFiles), 1), (S(!0), d(i, null, T(o.value, (e, t) => (S(), d(i, { key: e.id }, [m(k(L), {
502
502
  size: 12,
503
503
  "stroke-width": 2
504
504
  }), t < o.value.length - 1 ? (S(), d("button", {
@@ -506,7 +506,7 @@ var fe = {
506
506
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
507
507
  style: { color: "var(--tpl-primary)" },
508
508
  onClick: (t) => r("navigate", e.id)
509
- }, D(e.name), 9, pe)) : (S(), d("span", me, D(e.name), 1))], 64))), 128))])) : u("", !0);
509
+ }, D(e.name), 9, me)) : (S(), d("span", he, D(e.name), 1))], 64))), 128))])) : u("", !0);
510
510
  }
511
511
  });
512
512
  //#endregion
@@ -537,14 +537,14 @@ function Q() {
537
537
  }
538
538
  //#endregion
539
539
  //#region src/composables/useImageCrop.ts
540
- var ge = {
540
+ var _e = {
541
541
  free: void 0,
542
542
  square: 1,
543
543
  landscape43: 4 / 3,
544
544
  landscape169: 16 / 9,
545
545
  original: void 0
546
546
  };
547
- function _e(e) {
547
+ function ve(e) {
548
548
  return e === "image/png" || e === "image/gif" ? {
549
549
  mimeType: "image/png",
550
550
  quality: 1
@@ -556,7 +556,7 @@ function _e(e) {
556
556
  quality: .92
557
557
  };
558
558
  }
559
- function ve(e, t, n) {
559
+ function ye(e, t, n) {
560
560
  let r = e.width, i = e.height;
561
561
  if (!t && !n) return e;
562
562
  let a = r, o = i;
@@ -566,7 +566,7 @@ function ve(e, t, n) {
566
566
  let c = s.getContext("2d");
567
567
  return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
568
568
  }
569
- function ye(e, t, n) {
569
+ function be(e, t, n) {
570
570
  return new Promise((r, i) => {
571
571
  e.toBlob((e) => {
572
572
  if (!e) {
@@ -578,7 +578,7 @@ function ye(e, t, n) {
578
578
  }, n.mimeType, n.quality);
579
579
  });
580
580
  }
581
- function be(e, t, n, r) {
581
+ function xe(e, t, n, r) {
582
582
  let i = e, a = t;
583
583
  if (n && i > n) {
584
584
  let e = n / i;
@@ -594,58 +594,58 @@ function be(e, t, n, r) {
594
594
  };
595
595
  }
596
596
  //#endregion
597
- //#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
598
- var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce = {
597
+ //#region src/keys.ts
598
+ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Te = {
599
599
  class: "tpl:text-sm tpl:font-semibold",
600
600
  style: { color: "var(--tpl-text)" }
601
- }, we = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Te = {
601
+ }, Ee = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, De = {
602
602
  key: 0,
603
603
  class: "tpl:mb-4"
604
- }, Ee = {
604
+ }, Oe = {
605
605
  class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
606
606
  style: {
607
607
  "border-color": "var(--tpl-border)",
608
608
  height: "300px",
609
609
  "background-color": "var(--tpl-bg)"
610
610
  }
611
- }, De = { class: "tpl:space-y-3" }, Oe = {
611
+ }, ke = { class: "tpl:space-y-3" }, Ae = {
612
612
  class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
613
613
  style: { color: "var(--tpl-text-muted)" }
614
- }, ke = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Ae = ["onClick"], je = { class: "tpl:flex tpl:gap-3" }, Me = { class: "tpl:flex-1" }, Ne = {
614
+ }, je = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Me = ["onClick"], Ne = { class: "tpl:flex tpl:gap-3" }, Pe = { class: "tpl:flex-1" }, Fe = {
615
615
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
616
616
  style: { color: "var(--tpl-text-muted)" }
617
- }, Pe = {
617
+ }, Ie = {
618
618
  class: "tpl:font-normal",
619
619
  style: { color: "var(--tpl-text-dim)" }
620
- }, Fe = { class: "tpl:relative" }, Ie = ["value", "placeholder"], Le = {
620
+ }, Le = { class: "tpl:relative" }, Re = ["value", "placeholder"], ze = {
621
621
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
622
622
  style: { color: "var(--tpl-text-dim)" }
623
- }, Re = { class: "tpl:flex-1" }, ze = {
623
+ }, Be = { class: "tpl:flex-1" }, Ve = {
624
624
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
625
625
  style: { color: "var(--tpl-text-muted)" }
626
- }, Be = {
626
+ }, He = {
627
627
  class: "tpl:font-normal",
628
628
  style: { color: "var(--tpl-text-dim)" }
629
- }, Ve = { class: "tpl:relative" }, He = ["value", "placeholder"], Ue = {
629
+ }, Ue = { class: "tpl:relative" }, We = ["value", "placeholder"], Ge = {
630
630
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
631
631
  style: { color: "var(--tpl-text-dim)" }
632
- }, We = {
632
+ }, Ke = {
633
633
  key: 0,
634
634
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
635
635
  style: { color: "var(--tpl-text-muted)" }
636
- }, Ge = {
636
+ }, qe = {
637
637
  class: "tpl:font-medium",
638
638
  style: { color: "var(--tpl-text)" }
639
- }, Ke = { class: "tpl:mb-3" }, qe = {
639
+ }, Je = { class: "tpl:mb-3" }, Ye = {
640
640
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
641
641
  style: { color: "var(--tpl-text-muted)" }
642
- }, Je = ["autofocus"], Ye = {
642
+ }, Xe = ["autofocus"], Ze = {
643
643
  key: 1,
644
644
  class: "tpl:mb-4"
645
- }, Xe = {
645
+ }, Qe = {
646
646
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
647
647
  style: { color: "var(--tpl-text-muted)" }
648
- }, Ze = ["placeholder"], Qe = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, $e = ["disabled"], et = /* @__PURE__ */ h({
648
+ }, $e = ["placeholder"], et = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, tt = ["disabled"], nt = /* @__PURE__ */ h({
649
649
  __name: "MediaEditModal",
650
650
  props: {
651
651
  visible: { type: Boolean },
@@ -653,56 +653,56 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
653
653
  },
654
654
  emits: ["save", "close"],
655
655
  setup(e, { emit: t }) {
656
- let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme"), g = c.mediaLibrary, { isImageMimeType: v } = Q(), x = w(""), C = w(""), E = w(null), N = w("free"), F = w(void 0), I = w(void 0), L = w(""), R = w(""), z = w(void 0), B = w(null), V = w(!1), H = w(!1), U = w(!1), W = s(() => n.item ? [
656
+ let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme"), g = _(Se, w(null)), v = c.mediaLibrary, { isImageMimeType: x } = Q(), C = w(""), E = w(""), O = w(null), P = w("free"), I = w(void 0), L = w(void 0), R = w(""), z = w(""), B = w(void 0), V = w(null), H = w(!1), U = w(!1), W = w(!1), G = s(() => n.item ? [
657
657
  "image/jpeg",
658
658
  "image/png",
659
659
  "image/webp",
660
660
  "image/gif"
661
- ].includes(n.item.mime_type) : !1), G = s(() => N.value === "original" ? z.value : ge[N.value]), K = s(() => B.value ? be(B.value.width, B.value.height, F.value, I.value) : null);
662
- A(() => n.visible, (e) => {
663
- e && n.item && (x.value = n.item.filename, C.value = n.item.alt_text || "", N.value = "free", F.value = void 0, I.value = void 0, L.value = "", R.value = "", z.value = void 0, B.value = null, V.value = !1, U.value = !1, n.item.width && n.item.height && (z.value = n.item.width / n.item.height));
661
+ ].includes(n.item.mime_type) : !1), K = s(() => P.value === "original" ? B.value : _e[P.value]), q = s(() => V.value ? xe(V.value.width, V.value.height, I.value, L.value) : null);
662
+ j(() => n.visible, (e) => {
663
+ e && n.item && (C.value = n.item.filename, E.value = n.item.alt_text || "", P.value = "free", I.value = void 0, L.value = void 0, R.value = "", z.value = "", B.value = void 0, V.value = null, H.value = !1, W.value = !1, n.item.width && n.item.height && (B.value = n.item.width / n.item.height));
664
664
  });
665
- function q(e) {
666
- e.coordinates && (B.value = {
665
+ function J(e) {
666
+ e.coordinates && (V.value = {
667
667
  width: Math.round(e.coordinates.width),
668
668
  height: Math.round(e.coordinates.height)
669
- }, U.value = !0);
670
- }
671
- function J() {
672
- V.value = !0, !z.value && n.item?.width && n.item?.height && (z.value = n.item.width / n.item.height);
669
+ }, W.value = !0);
673
670
  }
674
- function Y(e) {
675
- let t = e.target.value;
676
- L.value = t, F.value = t && parseInt(t, 10) || void 0;
671
+ function Y() {
672
+ H.value = !0, !B.value && n.item?.width && n.item?.height && (B.value = n.item.width / n.item.height);
677
673
  }
678
674
  function ee(e) {
679
675
  let t = e.target.value;
680
676
  R.value = t, I.value = t && parseInt(t, 10) || void 0;
681
677
  }
682
- async function X() {
683
- let e = x.value.trim();
684
- if (!e || !n.item || H.value) return;
685
- let t = v(n.item.mime_type), i;
686
- if (W.value && E.value && U.value) {
687
- H.value = !0;
678
+ function X(e) {
679
+ let t = e.target.value;
680
+ z.value = t, L.value = t && parseInt(t, 10) || void 0;
681
+ }
682
+ async function te() {
683
+ let e = C.value.trim();
684
+ if (!e || !n.item || U.value) return;
685
+ let t = x(n.item.mime_type), i;
686
+ if (G.value && O.value && W.value) {
687
+ U.value = !0;
688
688
  try {
689
- let { canvas: e } = E.value.getResult();
689
+ let { canvas: e } = O.value.getResult();
690
690
  if (e) {
691
- let t = ve(e, F.value, I.value), r = _e(n.item.mime_type);
692
- i = { file: await ye(t, n.item.filename, r) };
691
+ let t = ye(e, I.value, L.value), r = ve(n.item.mime_type);
692
+ i = { file: await be(t, n.item.filename, r) };
693
693
  }
694
694
  } catch {
695
- H.value = !1;
695
+ U.value = !1;
696
696
  return;
697
697
  }
698
- H.value = !1;
698
+ U.value = !1;
699
699
  }
700
- r("save", n.item.id, e, t ? C.value : void 0, i), r("close");
700
+ r("save", n.item.id, e, t ? E.value : void 0, i), r("close");
701
701
  }
702
- function te(e) {
703
- e.key === "Enter" && !H.value && (e.preventDefault(), X()), e.key === "Escape" && r("close");
702
+ function ne(e) {
703
+ e.key === "Enter" && !U.value && (e.preventDefault(), te()), e.key === "Escape" && r("close");
704
704
  }
705
- return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
705
+ return (t, n) => (S(), l(a, { to: k(g) || "body" }, [m(o, {
706
706
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
707
707
  "enter-from-class": "tpl:opacity-0",
708
708
  "enter-to-class": "tpl:opacity-100",
@@ -710,30 +710,30 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
710
710
  "leave-from-class": "tpl:opacity-100",
711
711
  "leave-to-class": "tpl:opacity-0"
712
712
  }, {
713
- default: j(() => [e.visible && e.item ? (S(), d("div", {
713
+ default: M(() => [e.visible && e.item ? (S(), d("div", {
714
714
  key: 0,
715
- "data-tpl-theme": O(h),
715
+ "data-tpl-theme": k(h),
716
716
  class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
717
717
  style: { "background-color": "var(--tpl-overlay)" },
718
- onClick: n[3] ||= P((e) => r("close"), ["self"]),
719
- onKeydown: te
718
+ onClick: n[3] ||= F((e) => r("close"), ["self"]),
719
+ onKeydown: ne
720
720
  }, [f("div", {
721
- class: y(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", W.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
721
+ class: y(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", G.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
722
722
  style: { "background-color": "var(--tpl-bg-elevated)" }
723
723
  }, [
724
- f("div", Se, [f("h3", Ce, D(O(c).mediaLibrary.editFile), 1)]),
725
- f("div", we, [
726
- W.value ? (S(), d("div", Te, [f("div", Ee, [m(O(ne), {
724
+ f("div", we, [f("h3", Te, D(k(c).mediaLibrary.editFile), 1)]),
725
+ f("div", Ee, [
726
+ G.value ? (S(), d("div", De, [f("div", Oe, [m(k(re), {
727
727
  ref_key: "cropperRef",
728
- ref: E,
728
+ ref: O,
729
729
  src: e.item.url,
730
- "stencil-props": { aspectRatio: G.value },
730
+ "stencil-props": { aspectRatio: K.value },
731
731
  class: "tpl:h-full tpl:w-full",
732
732
  "background-class": "tpl-cropper-background",
733
- onChange: q,
734
- onReady: J
735
- }, null, 8, ["src", "stencil-props"])]), f("div", De, [
736
- f("div", null, [f("label", Oe, D(O(c).mediaLibrary.cropAspectRatio), 1), f("div", ke, [(S(), d(i, null, T([
733
+ onChange: J,
734
+ onReady: Y
735
+ }, null, 8, ["src", "stencil-props"])]), f("div", ke, [
736
+ f("div", null, [f("label", Ae, D(k(c).mediaLibrary.cropAspectRatio), 1), f("div", je, [(S(), d(i, null, T([
737
737
  "free",
738
738
  "square",
739
739
  "landscape43",
@@ -744,14 +744,14 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
744
744
  type: "button",
745
745
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
746
746
  style: b({
747
- borderColor: N.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
748
- backgroundColor: N.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
749
- color: N.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
747
+ borderColor: P.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
748
+ backgroundColor: P.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
749
+ color: P.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
750
750
  }),
751
- onClick: (t) => N.value = e
752
- }, D(O(g)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Ae)), 64))])]),
753
- f("div", je, [f("div", Me, [f("label", Ne, [p(D(O(c).mediaLibrary.cropMaxWidth) + " ", 1), f("span", Pe, D(O(c).mediaLibrary.cropOptional), 1)]), f("div", Fe, [f("input", {
754
- value: L.value,
751
+ onClick: (t) => P.value = e
752
+ }, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Me)), 64))])]),
753
+ f("div", Ne, [f("div", Pe, [f("label", Fe, [p(D(k(c).mediaLibrary.cropMaxWidth) + " ", 1), f("span", Ie, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Le, [f("input", {
754
+ value: R.value,
755
755
  type: "number",
756
756
  min: "1",
757
757
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -760,10 +760,10 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
760
760
  "background-color": "var(--tpl-bg)",
761
761
  color: "var(--tpl-text)"
762
762
  },
763
- placeholder: B.value?.width?.toString() || "",
764
- onInput: Y
765
- }, null, 40, Ie), f("span", Le, D(O(c).mediaLibrary.cropPixels), 1)])]), f("div", Re, [f("label", ze, [p(D(O(c).mediaLibrary.cropMaxHeight) + " ", 1), f("span", Be, D(O(c).mediaLibrary.cropOptional), 1)]), f("div", Ve, [f("input", {
766
- value: R.value,
763
+ placeholder: V.value?.width?.toString() || "",
764
+ onInput: ee
765
+ }, null, 40, Re), f("span", ze, D(k(c).mediaLibrary.cropPixels), 1)])]), f("div", Be, [f("label", Ve, [p(D(k(c).mediaLibrary.cropMaxHeight) + " ", 1), f("span", He, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Ue, [f("input", {
766
+ value: z.value,
767
767
  type: "number",
768
768
  min: "1",
769
769
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -772,13 +772,13 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
772
772
  "background-color": "var(--tpl-bg)",
773
773
  color: "var(--tpl-text)"
774
774
  },
775
- placeholder: B.value?.height?.toString() || "",
776
- onInput: ee
777
- }, null, 40, He), f("span", Ue, D(O(c).mediaLibrary.cropPixels), 1)])])]),
778
- K.value ? (S(), d("div", We, [f("span", null, D(O(c).mediaLibrary.cropOutputSize) + ": ", 1), f("span", Ge, D(K.value.width) + " x " + D(K.value.height) + " " + D(O(c).mediaLibrary.cropPixels), 1)])) : u("", !0)
775
+ placeholder: V.value?.height?.toString() || "",
776
+ onInput: X
777
+ }, null, 40, We), f("span", Ge, D(k(c).mediaLibrary.cropPixels), 1)])])]),
778
+ q.value ? (S(), d("div", Ke, [f("span", null, D(k(c).mediaLibrary.cropOutputSize) + ": ", 1), f("span", qe, D(q.value.width) + " x " + D(q.value.height) + " " + D(k(c).mediaLibrary.cropPixels), 1)])) : u("", !0)
779
779
  ])])) : u("", !0),
780
- f("div", Ke, [f("label", qe, D(O(c).mediaLibrary.fileName), 1), M(f("input", {
781
- "onUpdate:modelValue": n[0] ||= (e) => x.value = e,
780
+ f("div", Je, [f("label", Ye, D(k(c).mediaLibrary.fileName), 1), N(f("input", {
781
+ "onUpdate:modelValue": n[0] ||= (e) => C.value = e,
782
782
  type: "text",
783
783
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
784
784
  style: {
@@ -786,10 +786,10 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
786
786
  "background-color": "var(--tpl-bg)",
787
787
  color: "var(--tpl-text)"
788
788
  },
789
- autofocus: !W.value
790
- }, null, 8, Je), [[k, x.value]])]),
791
- O(v)(e.item.mime_type) ? (S(), d("div", Ye, [f("label", Xe, D(O(c).mediaLibrary.altText), 1), M(f("input", {
792
- "onUpdate:modelValue": n[1] ||= (e) => C.value = e,
789
+ autofocus: !G.value
790
+ }, null, 8, Xe), [[A, C.value]])]),
791
+ k(x)(e.item.mime_type) ? (S(), d("div", Ze, [f("label", Qe, D(k(c).mediaLibrary.altText), 1), N(f("input", {
792
+ "onUpdate:modelValue": n[1] ||= (e) => E.value = e,
793
793
  type: "text",
794
794
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
795
795
  style: {
@@ -797,10 +797,10 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
797
797
  "background-color": "var(--tpl-bg)",
798
798
  color: "var(--tpl-text)"
799
799
  },
800
- placeholder: O(c).mediaLibrary.altTextPlaceholder
801
- }, null, 8, Ze), [[k, C.value]])])) : u("", !0)
800
+ placeholder: k(c).mediaLibrary.altTextPlaceholder
801
+ }, null, 8, $e), [[A, E.value]])])) : u("", !0)
802
802
  ]),
803
- f("div", Qe, [f("button", {
803
+ f("div", et, [f("button", {
804
804
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
805
805
  style: {
806
806
  "border-color": "var(--tpl-border)",
@@ -808,30 +808,30 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
808
808
  "background-color": "var(--tpl-bg)"
809
809
  },
810
810
  onClick: n[2] ||= (e) => r("close")
811
- }, D(O(c).mediaLibrary.cancel), 1), f("button", {
811
+ }, D(k(c).mediaLibrary.cancel), 1), f("button", {
812
812
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
813
813
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
814
- disabled: H.value,
815
- onClick: X
816
- }, D(H.value ? O(c).mediaLibrary.saving : O(c).mediaLibrary.saveChanges), 9, $e)])
817
- ], 2)], 40, xe)) : u("", !0)]),
814
+ disabled: U.value,
815
+ onClick: te
816
+ }, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9, tt)])
817
+ ], 2)], 40, Ce)) : u("", !0)]),
818
818
  _: 1
819
- })]));
819
+ })], 8, ["to"]));
820
820
  }
821
- }), tt = (e, t) => {
821
+ }), rt = (e, t) => {
822
822
  let n = e.__vccOpts || e;
823
823
  for (let [e, r] of t) n[e] = r;
824
824
  return n;
825
- }, nt = /* @__PURE__ */ tt(et, [["__scopeId", "data-v-bd5f2e31"]]), rt = {
825
+ }, it = /* @__PURE__ */ rt(nt, [["__scopeId", "data-v-6b677237"]]), at = {
826
826
  key: 1,
827
827
  class: "tpl:size-4 tpl:shrink-0"
828
- }, it = {
828
+ }, ot = {
829
829
  key: 0,
830
830
  class: "tpl:truncate"
831
- }, at = {
831
+ }, st = {
832
832
  key: 3,
833
833
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
834
- }, ot = ["title"], st = ["title"], ct = { key: 0 }, lt = ["placeholder"], ut = 5, dt = /* @__PURE__ */ h({
834
+ }, ct = ["title"], lt = ["title"], ut = { key: 0 }, dt = ["placeholder"], ft = 5, pt = /* @__PURE__ */ h({
835
835
  __name: "MediaFolderTreeNode",
836
836
  props: {
837
837
  folder: {},
@@ -845,22 +845,22 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
845
845
  "deleteFolder"
846
846
  ],
847
847
  setup(e, { emit: t }) {
848
- let n = e, r = t, { t: a } = Z(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth < ut - 1), x = s(() => n.currentFolderId === n.folder.id), C = s(() => !n.currentFolderId || !n.folder.children ? !1 : j(n.folder.children, n.currentFolderId)), A = s(() => o.value || C.value);
848
+ let n = e, r = t, { t: a } = Z(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth < ft - 1), x = s(() => n.currentFolderId === n.folder.id), C = s(() => !n.currentFolderId || !n.folder.children ? !1 : j(n.folder.children, n.currentFolderId)), O = s(() => o.value || C.value);
849
849
  function j(e, t) {
850
850
  for (let n of e) if (n.id === t || n.children && j(n.children, t)) return !0;
851
851
  return !1;
852
852
  }
853
- function F() {
853
+ function M() {
854
854
  o.value = !o.value;
855
855
  }
856
- function L() {
856
+ function I() {
857
857
  c.value = !0, p.value = n.folder.name;
858
858
  }
859
859
  function R() {
860
860
  let e = p.value.trim();
861
861
  e && e !== n.folder.name && r("renameFolder", n.folder.id, e), c.value = !1, p.value = "";
862
862
  }
863
- function B() {
863
+ function z() {
864
864
  c.value = !1, p.value = "";
865
865
  }
866
866
  function V() {
@@ -885,21 +885,21 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
885
885
  _.value || h.value ? (S(), d("button", {
886
886
  key: 0,
887
887
  class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
888
- onClick: P(F, ["stop"])
889
- }, [m(O(I), {
890
- class: y(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": A.value }]),
888
+ onClick: F(M, ["stop"])
889
+ }, [m(k(L), {
890
+ class: y(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": O.value }]),
891
891
  size: 10,
892
892
  "stroke-width": 2
893
- }, null, 8, ["class"])])) : (S(), d("span", rt)),
893
+ }, null, 8, ["class"])])) : (S(), d("span", at)),
894
894
  f("button", {
895
895
  class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
896
896
  onClick: n[0] ||= (t) => r("navigate", e.folder.id)
897
- }, [m(O(z), {
897
+ }, [m(k(B), {
898
898
  class: "tpl:shrink-0",
899
899
  size: 14,
900
900
  "stroke-width": 1.5
901
- }), c.value ? u("", !0) : (S(), d("span", it, D(e.folder.name), 1))]),
902
- c.value ? M((S(), d("input", {
901
+ }), c.value ? u("", !0) : (S(), d("span", ot, D(e.folder.name), 1))]),
902
+ c.value ? N((S(), d("input", {
903
903
  key: 2,
904
904
  "onUpdate:modelValue": n[1] ||= (e) => p.value = e,
905
905
  type: "text",
@@ -910,38 +910,38 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
910
910
  color: "var(--tpl-text)"
911
911
  },
912
912
  autofocus: "",
913
- onKeydown: [N(R, ["enter"]), N(B, ["escape"])],
913
+ onKeydown: [P(R, ["enter"]), P(z, ["escape"])],
914
914
  onBlur: R,
915
- onClick: n[2] ||= P(() => {}, ["stop"])
916
- }, null, 544)), [[k, p.value]]) : u("", !0),
917
- c.value ? u("", !0) : (S(), d("span", at, [
915
+ onClick: n[2] ||= F(() => {}, ["stop"])
916
+ }, null, 544)), [[A, p.value]]) : u("", !0),
917
+ c.value ? u("", !0) : (S(), d("span", st, [
918
918
  v.value ? (S(), d("button", {
919
919
  key: 0,
920
920
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
921
- title: O(a).mediaLibrary.addSubfolder,
922
- onClick: P(V, ["stop"])
923
- }, [m(O(K), {
921
+ title: k(a).mediaLibrary.addSubfolder,
922
+ onClick: F(V, ["stop"])
923
+ }, [m(k(q), {
924
924
  size: 12,
925
925
  "stroke-width": 2
926
- })], 8, ot)) : u("", !0),
926
+ })], 8, ct)) : u("", !0),
927
927
  f("button", {
928
928
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
929
- title: O(a).mediaLibrary.renameFolder,
930
- onClick: P(L, ["stop"])
931
- }, [m(O(G), {
929
+ title: k(a).mediaLibrary.renameFolder,
930
+ onClick: F(I, ["stop"])
931
+ }, [m(k(K), {
932
932
  size: 12,
933
933
  "stroke-width": 2
934
- })], 8, st),
934
+ })], 8, lt),
935
935
  f("button", {
936
936
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
937
- onClick: n[3] ||= P((t) => r("deleteFolder", e.folder.id), ["stop"])
938
- }, [m(O(ee), {
937
+ onClick: n[3] ||= F((t) => r("deleteFolder", e.folder.id), ["stop"])
938
+ }, [m(k(X), {
939
939
  size: 12,
940
940
  "stroke-width": 2,
941
941
  style: { color: "var(--tpl-danger)" }
942
942
  })])
943
943
  ]))
944
- ], 4), A.value ? (S(), d("div", ct, [(S(!0), d(i, null, T(e.folder.children, (t) => (S(), l(o, {
944
+ ], 4), O.value ? (S(), d("div", ut, [(S(!0), d(i, null, T(e.folder.children, (t) => (S(), l(o, {
945
945
  key: t.id,
946
946
  folder: t,
947
947
  "current-folder-id": e.currentFolderId,
@@ -958,7 +958,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
958
958
  key: 0,
959
959
  style: b({ paddingLeft: `${(e.depth + 1) * 16 + 8}px` }),
960
960
  class: "tpl:py-1.5 tpl:pr-2"
961
- }, [M(f("input", {
961
+ }, [N(f("input", {
962
962
  "onUpdate:modelValue": n[8] ||= (e) => g.value = e,
963
963
  type: "text",
964
964
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -967,17 +967,17 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
967
967
  "background-color": "var(--tpl-bg)",
968
968
  color: "var(--tpl-text)"
969
969
  },
970
- placeholder: O(a).mediaLibrary.subfolderName,
970
+ placeholder: k(a).mediaLibrary.subfolderName,
971
971
  autofocus: "",
972
- onKeydown: [N(H, ["enter"]), N(U, ["escape"])],
972
+ onKeydown: [P(H, ["enter"]), P(U, ["escape"])],
973
973
  onBlur: H
974
- }, null, 40, lt), [[k, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
974
+ }, null, 40, dt), [[A, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
975
975
  };
976
976
  }
977
- }), ft = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, pt = {
977
+ }), mt = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, ht = {
978
978
  key: 0,
979
979
  class: "tpl:px-3 tpl:py-2"
980
- }, mt = ["placeholder"], ht = /* @__PURE__ */ h({
980
+ }, gt = ["placeholder"], _t = /* @__PURE__ */ h({
981
981
  __name: "MediaFolderTree",
982
982
  props: {
983
983
  folders: {},
@@ -1003,7 +1003,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1003
1003
  function h() {
1004
1004
  a.value = !1, o.value = "";
1005
1005
  }
1006
- return (t, g) => (S(), d("div", ft, [
1006
+ return (t, g) => (S(), d("div", mt, [
1007
1007
  f("button", {
1008
1008
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
1009
1009
  style: b({
@@ -1011,11 +1011,11 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1011
1011
  color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
1012
1012
  }),
1013
1013
  onClick: g[0] ||= (e) => n("navigate", null)
1014
- }, [m(O(R), {
1014
+ }, [m(k(z), {
1015
1015
  size: 14,
1016
1016
  "stroke-width": 1.5
1017
- }), p(" " + D(O(r).mediaLibrary.allFiles), 1)], 4),
1018
- (S(!0), d(i, null, T(e.folders, (t) => (S(), l(dt, {
1017
+ }), p(" " + D(k(r).mediaLibrary.allFiles), 1)], 4),
1018
+ (S(!0), d(i, null, T(e.folders, (t) => (S(), l(pt, {
1019
1019
  key: t.id,
1020
1020
  folder: t,
1021
1021
  "current-folder-id": e.currentFolderId,
@@ -1025,7 +1025,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1025
1025
  onRenameFolder: g[3] ||= (e, t) => n("renameFolder", e, t),
1026
1026
  onDeleteFolder: g[4] ||= (e) => n("deleteFolder", e)
1027
1027
  }, null, 8, ["folder", "current-folder-id"]))), 128)),
1028
- a.value ? (S(), d("div", pt, [M(f("input", {
1028
+ a.value ? (S(), d("div", ht, [N(f("input", {
1029
1029
  "onUpdate:modelValue": g[5] ||= (e) => o.value = e,
1030
1030
  type: "text",
1031
1031
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -1034,20 +1034,20 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1034
1034
  "background-color": "var(--tpl-bg)",
1035
1035
  color: "var(--tpl-text)"
1036
1036
  },
1037
- placeholder: O(r).mediaLibrary.folderName,
1037
+ placeholder: k(r).mediaLibrary.folderName,
1038
1038
  autofocus: "",
1039
- onKeydown: [N(c, ["enter"]), N(h, ["escape"])],
1039
+ onKeydown: [P(c, ["enter"]), P(h, ["escape"])],
1040
1040
  onBlur: c
1041
- }, null, 40, mt), [[k, o.value]])])) : u("", !0),
1041
+ }, null, 40, gt), [[A, o.value]])])) : u("", !0),
1042
1042
  a.value ? u("", !0) : (S(), d("button", {
1043
1043
  key: 1,
1044
1044
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
1045
1045
  style: { color: "var(--tpl-text-muted)" },
1046
1046
  onClick: s
1047
- }, [m(O(K), {
1047
+ }, [m(k(q), {
1048
1048
  size: 14,
1049
1049
  "stroke-width": 1.5
1050
- }), p(" " + D(O(r).mediaLibrary.newFolder), 1)])),
1050
+ }), p(" " + D(k(r).mediaLibrary.newFolder), 1)])),
1051
1051
  g[7] ||= f("div", { class: "tpl:flex-1" }, null, -1),
1052
1052
  e.hasFrequentlyUsed ? (S(), d("button", {
1053
1053
  key: 2,
@@ -1058,13 +1058,13 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1058
1058
  color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
1059
1059
  }),
1060
1060
  onClick: g[6] ||= (e) => n("showFrequentlyUsed")
1061
- }, [m(O(Y), {
1061
+ }, [m(k(ee), {
1062
1062
  size: 14,
1063
1063
  "stroke-width": 1.5
1064
- }), p(" " + D(O(r).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
1064
+ }), p(" " + D(k(r).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
1065
1065
  ]));
1066
1066
  }
1067
- }), gt = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, _t = /* @__PURE__ */ h({
1067
+ }), vt = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, yt = /* @__PURE__ */ h({
1068
1068
  __name: "MediaFileIcon",
1069
1069
  props: { mimeType: {} },
1070
1070
  setup(e) {
@@ -1165,7 +1165,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1165
1165
  bgColor: "#f9fafb",
1166
1166
  icon: "document"
1167
1167
  }, i = s(() => n[t.mimeType] ?? r);
1168
- return (e, t) => (S(), d("div", gt, [i.value.icon === "document" ? (S(), d("svg", {
1168
+ return (e, t) => (S(), d("div", vt, [i.value.icon === "document" ? (S(), d("svg", {
1169
1169
  key: 0,
1170
1170
  width: "60",
1171
1171
  height: "60",
@@ -1234,48 +1234,48 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1234
1234
  style: b({ color: i.value.color })
1235
1235
  }, D(i.value.label), 5)]));
1236
1236
  }
1237
- }), vt = { class: "tpl:p-4" }, yt = {
1237
+ }), bt = { class: "tpl:p-4" }, xt = {
1238
1238
  key: 1,
1239
1239
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
1240
- }, bt = {
1240
+ }, St = {
1241
1241
  class: "tpl:text-xs",
1242
1242
  style: { color: "var(--tpl-text-muted)" }
1243
- }, xt = {
1243
+ }, Ct = {
1244
1244
  key: 2,
1245
1245
  class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
1246
- }, St = ["onClick"], Ct = { class: "tpl:aspect-square" }, wt = ["src", "alt"], Tt = { class: "tpl:px-2 tpl:py-1.5" }, Et = {
1246
+ }, wt = ["onClick"], Tt = { class: "tpl:aspect-square" }, Et = ["src", "alt"], Dt = { class: "tpl:px-2 tpl:py-1.5" }, Ot = {
1247
1247
  class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
1248
1248
  style: { color: "var(--tpl-text)" }
1249
- }, Dt = {
1249
+ }, kt = {
1250
1250
  class: "tpl:flex tpl:justify-between tpl:text-[9px]",
1251
1251
  style: { color: "var(--tpl-text-muted)" }
1252
- }, Ot = { key: 0 }, kt = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, At = ["title", "onClick"], jt = ["title", "onClick"], Mt = {
1252
+ }, At = { key: 0 }, jt = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Mt = ["title", "onClick"], Nt = ["title", "onClick"], Pt = {
1253
1253
  key: 0,
1254
1254
  class: "tpl:absolute tpl:top-1.5 tpl:right-1.5 tpl:flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1255
1255
  style: { "background-color": "var(--tpl-primary)" }
1256
- }, Nt = {
1256
+ }, Ft = {
1257
1257
  key: 3,
1258
1258
  class: "tpl:flex tpl:flex-col tpl:gap-1"
1259
- }, Pt = ["onClick"], Ft = {
1259
+ }, It = ["onClick"], Lt = {
1260
1260
  class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
1261
1261
  style: { "background-color": "var(--tpl-bg-hover)" }
1262
- }, It = ["src", "alt"], Lt = {
1262
+ }, Rt = ["src", "alt"], zt = {
1263
1263
  key: 1,
1264
1264
  class: "tpl-list-icon tpl:size-full"
1265
- }, Rt = { class: "tpl:min-w-0 tpl:flex-1" }, zt = {
1265
+ }, Bt = { class: "tpl:min-w-0 tpl:flex-1" }, Vt = {
1266
1266
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1267
1267
  style: { color: "var(--tpl-text)" }
1268
- }, Bt = {
1268
+ }, Ht = {
1269
1269
  class: "tpl:text-[10px]",
1270
1270
  style: { color: "var(--tpl-text-muted)" }
1271
- }, Vt = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Ht = ["title", "onClick"], Ut = ["title", "onClick"], Wt = {
1271
+ }, Ut = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Wt = ["title", "onClick"], Gt = ["title", "onClick"], Kt = {
1272
1272
  key: 0,
1273
1273
  class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1274
1274
  style: { "background-color": "var(--tpl-primary)" }
1275
- }, Gt = {
1275
+ }, qt = {
1276
1276
  key: 4,
1277
1277
  class: "tpl:flex tpl:justify-center tpl:py-4"
1278
- }, Kt = /* @__PURE__ */ tt(/* @__PURE__ */ h({
1278
+ }, Jt = /* @__PURE__ */ rt(/* @__PURE__ */ h({
1279
1279
  __name: "MediaGrid",
1280
1280
  props: {
1281
1281
  items: {},
@@ -1301,7 +1301,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1301
1301
  r("select", e);
1302
1302
  }
1303
1303
  let { t: h } = Z(), g = w(null);
1304
- le(g, ([{ isIntersecting: e }]) => {
1304
+ ue(g, ([{ isIntersecting: e }]) => {
1305
1305
  e && n.hasMore && !n.isLoading && r("loadMore");
1306
1306
  }, { threshold: .1 });
1307
1307
  function _(e) {
@@ -1314,7 +1314,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1314
1314
  day: "numeric"
1315
1315
  });
1316
1316
  }
1317
- return (t, n) => (S(), d("div", vt, [
1317
+ return (t, n) => (S(), d("div", bt, [
1318
1318
  e.isLoading && e.items.length === 0 ? (S(), d("div", {
1319
1319
  key: 0,
1320
1320
  class: y(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
@@ -1322,47 +1322,47 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1322
1322
  key: t,
1323
1323
  class: y(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
1324
1324
  style: { "background-color": "var(--tpl-bg-hover)" }
1325
- }, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", yt, [m(O(R), {
1325
+ }, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", xt, [m(k(z), {
1326
1326
  class: "tpl:mb-3",
1327
1327
  size: 40,
1328
1328
  "stroke-width": 1,
1329
1329
  style: { color: "var(--tpl-text-dim)" }
1330
- }), f("p", bt, D(O(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Nt, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1330
+ }), f("p", St, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Ft, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1331
1331
  key: t.id,
1332
1332
  class: y(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!s(t) && !e.selectedIds.has(t.id) ? "tpl:opacity-60" : ""]]),
1333
1333
  style: b({ backgroundColor: e.selectedIds.has(t.id) ? "var(--tpl-bg-hover)" : "transparent" }),
1334
1334
  onClick: (e) => c(t)
1335
1335
  }, [
1336
- f("div", Ft, [O(o)(t.mime_type) ? (S(), d("img", {
1336
+ f("div", Lt, [k(o)(t.mime_type) ? (S(), d("img", {
1337
1337
  key: 0,
1338
1338
  src: t.small_url || t.url,
1339
1339
  alt: t.filename,
1340
1340
  class: "tpl:size-full tpl:object-cover",
1341
1341
  loading: "lazy"
1342
- }, null, 8, It)) : (S(), d("div", Lt, [m(_t, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
1343
- f("div", Rt, [f("p", zt, D(t.filename), 1), f("p", Bt, [p(D(_(t.size)) + " · " + D(v(t.created_at)) + " ", 1), O(o)(t.mime_type) && t.width && t.height ? (S(), d(i, { key: 0 }, [p(" · " + D(t.width) + "×" + D(t.height), 1)], 64)) : u("", !0)])]),
1344
- f("div", Vt, [f("button", {
1342
+ }, null, 8, Rt)) : (S(), d("div", zt, [m(yt, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
1343
+ f("div", Bt, [f("p", Vt, D(t.filename), 1), f("p", Ht, [p(D(_(t.size)) + " · " + D(v(t.created_at)) + " ", 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d(i, { key: 0 }, [p(" · " + D(t.width) + "×" + D(t.height), 1)], 64)) : u("", !0)])]),
1344
+ f("div", Ut, [f("button", {
1345
1345
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
1346
1346
  style: { color: "var(--tpl-text-muted)" },
1347
- title: O(h).mediaLibrary.editFile,
1348
- onClick: P((e) => r("edit", t), ["stop"])
1349
- }, [m(O(G), {
1347
+ title: k(h).mediaLibrary.editFile,
1348
+ onClick: F((e) => r("edit", t), ["stop"])
1349
+ }, [m(k(K), {
1350
1350
  size: 12,
1351
1351
  "stroke-width": 2
1352
- })], 8, Ht), f("button", {
1352
+ })], 8, Wt), f("button", {
1353
1353
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
1354
1354
  style: { color: "var(--tpl-text-muted)" },
1355
- title: O(h).mediaLibrary.replaceFile,
1356
- onClick: P((e) => r("replace", t), ["stop"])
1357
- }, [m(O(q), {
1355
+ title: k(h).mediaLibrary.replaceFile,
1356
+ onClick: F((e) => r("replace", t), ["stop"])
1357
+ }, [m(k(J), {
1358
1358
  size: 12,
1359
1359
  "stroke-width": 2
1360
- })], 8, Ut)]),
1361
- e.selectedIds.has(t.id) ? (S(), d("div", Wt, [m(O(F), {
1360
+ })], 8, Gt)]),
1361
+ e.selectedIds.has(t.id) ? (S(), d("div", Kt, [m(k(I), {
1362
1362
  size: 12,
1363
1363
  "stroke-width": 3
1364
1364
  })])) : u("", !0)
1365
- ], 14, Pt))), 128))])) : (S(), d("div", xt, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1365
+ ], 14, It))), 128))])) : (S(), d("div", Ct, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1366
1366
  key: t.id,
1367
1367
  class: y(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
1368
1368
  "tpl:cursor-pointer",
@@ -1375,45 +1375,45 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1375
1375
  }),
1376
1376
  onClick: (e) => c(t)
1377
1377
  }, [
1378
- f("div", Ct, [O(o)(t.mime_type) ? (S(), d("img", {
1378
+ f("div", Tt, [k(o)(t.mime_type) ? (S(), d("img", {
1379
1379
  key: 0,
1380
1380
  src: t.small_url || t.url,
1381
1381
  alt: t.filename,
1382
1382
  class: "tpl:size-full tpl:object-cover",
1383
1383
  loading: "lazy"
1384
- }, null, 8, wt)) : (S(), l(_t, {
1384
+ }, null, 8, Et)) : (S(), l(yt, {
1385
1385
  key: 1,
1386
1386
  "mime-type": t.mime_type
1387
1387
  }, null, 8, ["mime-type"]))]),
1388
- f("div", Tt, [f("p", Et, D(t.filename), 1), f("p", Dt, [f("span", null, D(_(t.size)), 1), O(o)(t.mime_type) && t.width && t.height ? (S(), d("span", Ot, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
1389
- f("div", kt, [f("button", {
1388
+ f("div", Dt, [f("p", Ot, D(t.filename), 1), f("p", kt, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", At, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
1389
+ f("div", jt, [f("button", {
1390
1390
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1391
1391
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
1392
- title: O(h).mediaLibrary.editFile,
1393
- onClick: P((e) => r("edit", t), ["stop"])
1394
- }, [m(O(G), {
1392
+ title: k(h).mediaLibrary.editFile,
1393
+ onClick: F((e) => r("edit", t), ["stop"])
1394
+ }, [m(k(K), {
1395
1395
  size: 11,
1396
1396
  "stroke-width": 2
1397
- })], 8, At), f("button", {
1397
+ })], 8, Mt), f("button", {
1398
1398
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1399
1399
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
1400
- title: O(h).mediaLibrary.replaceFile,
1401
- onClick: P((e) => r("replace", t), ["stop"])
1402
- }, [m(O(q), {
1400
+ title: k(h).mediaLibrary.replaceFile,
1401
+ onClick: F((e) => r("replace", t), ["stop"])
1402
+ }, [m(k(J), {
1403
1403
  size: 11,
1404
1404
  "stroke-width": 2
1405
- })], 8, jt)]),
1406
- e.selectedIds.has(t.id) ? (S(), d("div", Mt, [m(O(F), {
1405
+ })], 8, Nt)]),
1406
+ e.selectedIds.has(t.id) ? (S(), d("div", Pt, [m(k(I), {
1407
1407
  size: 12,
1408
1408
  "stroke-width": 3
1409
1409
  })])) : u("", !0)
1410
- ], 14, St))), 128))])),
1410
+ ], 14, wt))), 128))])),
1411
1411
  f("div", {
1412
1412
  ref_key: "sentinelRef",
1413
1413
  ref: g,
1414
1414
  class: "tpl:h-4"
1415
1415
  }, null, 512),
1416
- e.isLoading && e.items.length > 0 ? (S(), d("div", Gt, [m(O(U), {
1416
+ e.isLoading && e.items.length > 0 ? (S(), d("div", qt, [m(k(W), {
1417
1417
  class: "tpl-spinner",
1418
1418
  size: 20,
1419
1419
  "stroke-width": 2,
@@ -1421,20 +1421,20 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1421
1421
  })])) : u("", !0)
1422
1422
  ]));
1423
1423
  }
1424
- }), [["__scopeId", "data-v-9db961d1"]]), qt = ["data-tpl-theme"], Jt = {
1424
+ }), [["__scopeId", "data-v-9db961d1"]]), Yt = ["data-tpl-theme"], Xt = {
1425
1425
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1426
1426
  style: { "background-color": "var(--tpl-bg-elevated)" }
1427
- }, Yt = {
1427
+ }, Zt = {
1428
1428
  class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
1429
1429
  style: { color: "var(--tpl-text)" }
1430
- }, Xt = { class: "tpl:mb-3" }, Zt = ["placeholder", "disabled"], Qt = {
1430
+ }, Qt = { class: "tpl:mb-3" }, $t = ["placeholder", "disabled"], en = {
1431
1431
  key: 0,
1432
1432
  class: "tpl:mb-3 tpl:text-xs",
1433
1433
  style: { color: "var(--tpl-danger)" }
1434
- }, $t = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, en = ["disabled"], tn = ["disabled"], nn = {
1434
+ }, tn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, nn = ["disabled"], rn = ["disabled"], an = {
1435
1435
  key: 0,
1436
1436
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
1437
- }, rn = { key: 1 }, an = /* @__PURE__ */ h({
1437
+ }, on = { key: 1 }, sn = /* @__PURE__ */ h({
1438
1438
  __name: "MediaImportUrlModal",
1439
1439
  props: {
1440
1440
  visible: { type: Boolean },
@@ -1443,21 +1443,21 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1443
1443
  },
1444
1444
  emits: ["import", "close"],
1445
1445
  setup(e, { emit: t }) {
1446
- let n = e, r = t, { t: i } = Z(), s = _("tplUiTheme"), c = w("");
1447
- A(() => n.visible, (e) => {
1448
- e && (c.value = "");
1446
+ let n = e, r = t, { t: i } = Z(), s = _("tplUiTheme"), c = _(Se, w(null)), h = w("");
1447
+ j(() => n.visible, (e) => {
1448
+ e && (h.value = "");
1449
1449
  });
1450
- function h() {
1451
- let e = c.value.trim();
1450
+ function g() {
1451
+ let e = h.value.trim();
1452
1452
  !e || n.isImporting || r("import", e);
1453
1453
  }
1454
- function g() {
1454
+ function v() {
1455
1455
  n.isImporting || r("close");
1456
1456
  }
1457
- function v(e) {
1458
- e.key === "Enter" && (e.preventDefault(), h()), e.key === "Escape" && g();
1457
+ function b(e) {
1458
+ e.key === "Enter" && (e.preventDefault(), g()), e.key === "Escape" && v();
1459
1459
  }
1460
- return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
1460
+ return (t, n) => (S(), l(a, { to: k(c) || "body" }, [m(o, {
1461
1461
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1462
1462
  "enter-from-class": "tpl:opacity-0",
1463
1463
  "enter-to-class": "tpl:opacity-100",
@@ -1465,17 +1465,17 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1465
1465
  "leave-from-class": "tpl:opacity-100",
1466
1466
  "leave-to-class": "tpl:opacity-0"
1467
1467
  }, {
1468
- default: j(() => [e.visible ? (S(), d("div", {
1468
+ default: M(() => [e.visible ? (S(), d("div", {
1469
1469
  key: 0,
1470
- "data-tpl-theme": O(s),
1470
+ "data-tpl-theme": k(s),
1471
1471
  class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
1472
1472
  style: { "background-color": "var(--tpl-overlay)" },
1473
- onClick: P(g, ["self"]),
1474
- onKeydown: v
1475
- }, [f("div", Jt, [
1476
- f("h3", Yt, D(O(i).mediaLibrary.importFromUrl), 1),
1477
- f("div", Xt, [M(f("input", {
1478
- "onUpdate:modelValue": n[0] ||= (e) => c.value = e,
1473
+ onClick: F(v, ["self"]),
1474
+ onKeydown: b
1475
+ }, [f("div", Xt, [
1476
+ f("h3", Zt, D(k(i).mediaLibrary.importFromUrl), 1),
1477
+ f("div", Qt, [N(f("input", {
1478
+ "onUpdate:modelValue": n[0] ||= (e) => h.value = e,
1479
1479
  type: "url",
1480
1480
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
1481
1481
  style: {
@@ -1483,12 +1483,12 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1483
1483
  "background-color": "var(--tpl-bg)",
1484
1484
  color: "var(--tpl-text)"
1485
1485
  },
1486
- placeholder: O(i).mediaLibrary.importUrlPlaceholder,
1486
+ placeholder: k(i).mediaLibrary.importUrlPlaceholder,
1487
1487
  disabled: e.isImporting,
1488
1488
  autofocus: ""
1489
- }, null, 8, Zt), [[k, c.value]])]),
1490
- e.error ? (S(), d("p", Qt, D(e.error), 1)) : u("", !0),
1491
- f("div", $t, [f("button", {
1489
+ }, null, 8, $t), [[A, h.value]])]),
1490
+ e.error ? (S(), d("p", en, D(e.error), 1)) : u("", !0),
1491
+ f("div", tn, [f("button", {
1492
1492
  class: y(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150", { "tpl:cursor-not-allowed tpl:opacity-50": e.isImporting }]),
1493
1493
  style: {
1494
1494
  "border-color": "var(--tpl-border)",
@@ -1496,26 +1496,26 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1496
1496
  "background-color": "var(--tpl-bg)"
1497
1497
  },
1498
1498
  disabled: e.isImporting,
1499
- onClick: g
1500
- }, D(O(i).mediaLibrary.cancel), 11, en), f("button", {
1499
+ onClick: v
1500
+ }, D(k(i).mediaLibrary.cancel), 11, nn), f("button", {
1501
1501
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
1502
1502
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
1503
- disabled: !c.value.trim() || e.isImporting,
1504
- onClick: h
1505
- }, [e.isImporting ? (S(), d("span", nn, [m(O(U), {
1503
+ disabled: !h.value.trim() || e.isImporting,
1504
+ onClick: g
1505
+ }, [e.isImporting ? (S(), d("span", an, [m(k(W), {
1506
1506
  class: "tpl:animate-spin",
1507
1507
  size: 12,
1508
1508
  "stroke-width": 2
1509
- }), p(" " + D(O(i).mediaLibrary.importing), 1)])) : (S(), d("span", rn, D(O(i).mediaLibrary.import), 1))], 8, tn)])
1510
- ])], 40, qt)) : u("", !0)]),
1509
+ }), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", on, D(k(i).mediaLibrary.import), 1))], 8, rn)])
1510
+ ])], 40, Yt)) : u("", !0)]),
1511
1511
  _: 1
1512
- })]));
1512
+ })], 8, ["to"]));
1513
1513
  }
1514
- }), on = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, sn = ["disabled", "onClick"], cn = { class: "tpl:truncate" }, ln = {
1514
+ }), cn = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, ln = ["disabled", "onClick"], un = { class: "tpl:truncate" }, dn = {
1515
1515
  key: 0,
1516
1516
  class: "tpl:shrink-0",
1517
1517
  style: { color: "var(--tpl-text-dim)" }
1518
- }, un = /* @__PURE__ */ h({
1518
+ }, fn = /* @__PURE__ */ h({
1519
1519
  __name: "MediaMovePicker",
1520
1520
  props: {
1521
1521
  folders: {},
@@ -1533,7 +1533,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1533
1533
  }), r.children?.length && n.push(...o(r.children, t + 1));
1534
1534
  return n;
1535
1535
  }
1536
- return re(a, () => {
1536
+ return ie(a, () => {
1537
1537
  n("close");
1538
1538
  }), (t, s) => (S(), d("div", {
1539
1539
  ref_key: "pickerRef",
@@ -1543,16 +1543,16 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1543
1543
  "border-color": "var(--tpl-border)",
1544
1544
  "background-color": "var(--tpl-bg-elevated)"
1545
1545
  }
1546
- }, [f("div", on, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
1546
+ }, [f("div", cn, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
1547
1547
  key: 0,
1548
1548
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
1549
1549
  style: { color: "var(--tpl-text)" },
1550
1550
  onClick: s[0] ||= (e) => n("select", null)
1551
- }, [m(O(R), {
1551
+ }, [m(k(z), {
1552
1552
  class: "tpl:shrink-0",
1553
1553
  size: 14,
1554
1554
  "stroke-width": 1.5
1555
- }), p(" " + D(O(r).mediaLibrary.moveToRoot), 1)])), (S(!0), d(i, null, T(o(e.folders), (t) => (S(), d("button", {
1555
+ }), p(" " + D(k(r).mediaLibrary.moveToRoot), 1)])), (S(!0), d(i, null, T(o(e.folders), (t) => (S(), d("button", {
1556
1556
  key: t.id,
1557
1557
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:py-1.5 tpl:pr-3 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
1558
1558
  style: b({
@@ -1563,32 +1563,32 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1563
1563
  disabled: t.id === e.currentFolderId,
1564
1564
  onClick: (e) => n("select", t.id)
1565
1565
  }, [
1566
- m(O(z), {
1566
+ m(k(B), {
1567
1567
  class: "tpl:shrink-0",
1568
1568
  size: 14,
1569
1569
  "stroke-width": 1.5
1570
1570
  }),
1571
- f("span", cn, D(t.name), 1),
1572
- t.id === e.currentFolderId ? (S(), d("span", ln, D(O(r).mediaLibrary.currentFolder), 1)) : u("", !0)
1573
- ], 12, sn))), 128))])], 512));
1571
+ f("span", un, D(t.name), 1),
1572
+ t.id === e.currentFolderId ? (S(), d("span", dn, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
1573
+ ], 12, ln))), 128))])], 512));
1574
1574
  }
1575
- }), dn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, fn = ["src", "alt"], pn = {
1575
+ }), pn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, mn = ["src", "alt"], hn = {
1576
1576
  key: 1,
1577
1577
  class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
1578
1578
  style: { border: "1px solid var(--tpl-border)" }
1579
- }, mn = { class: "tpl:min-w-0 tpl:flex-1" }, hn = {
1579
+ }, gn = { class: "tpl:min-w-0 tpl:flex-1" }, _n = {
1580
1580
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1581
1581
  style: { color: "var(--tpl-text)" }
1582
- }, gn = {
1582
+ }, vn = {
1583
1583
  class: "tpl:mt-0.5 tpl:text-[10px]",
1584
1584
  style: { color: "var(--tpl-text-muted)" }
1585
- }, _n = {
1585
+ }, yn = {
1586
1586
  key: 2,
1587
1587
  class: "tpl:shrink-0"
1588
- }, vn = {
1588
+ }, bn = {
1589
1589
  class: "tpl:block tpl:text-[10px]",
1590
1590
  style: { color: "var(--tpl-text-muted)" }
1591
- }, yn = ["value"], bn = ["value"], xn = /* @__PURE__ */ tt(/* @__PURE__ */ h({
1591
+ }, xn = ["value"], Sn = ["value"], Cn = /* @__PURE__ */ rt(/* @__PURE__ */ h({
1592
1592
  __name: "MediaPreviewPanel",
1593
1593
  props: {
1594
1594
  item: {},
@@ -1656,25 +1656,25 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1656
1656
  day: "numeric"
1657
1657
  });
1658
1658
  }
1659
- return (t, n) => (S(), d("div", dn, [
1659
+ return (t, n) => (S(), d("div", pn, [
1660
1660
  b.value ? (S(), d("img", {
1661
1661
  key: 0,
1662
1662
  src: h.value ?? void 0,
1663
1663
  alt: e.item.alt_text || e.item.filename,
1664
1664
  class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
1665
1665
  style: { border: "1px solid var(--tpl-border)" }
1666
- }, null, 8, fn)) : (S(), d("div", pn, [m(_t, {
1666
+ }, null, 8, mn)) : (S(), d("div", hn, [m(yt, {
1667
1667
  "mime-type": e.item.mime_type,
1668
1668
  class: "tpl-preview-icon"
1669
1669
  }, null, 8, ["mime-type"])])),
1670
- f("div", mn, [
1671
- f("p", hn, D(e.item.filename), 1),
1672
- f("p", gn, [
1670
+ f("div", gn, [
1671
+ f("p", _n, D(e.item.filename), 1),
1672
+ f("p", vn, [
1673
1673
  p(D(x(e.item.size)) + " · " + D(C(e.item.created_at)) + " ", 1),
1674
1674
  b.value && e.item.width && e.item.height ? (S(), d(i, { key: 0 }, [p(" · " + D(e.item.width) + "×" + D(e.item.height) + "px ", 1)], 64)) : u("", !0),
1675
1675
  v.value ? (S(), d(i, { key: 1 }, [
1676
1676
  n[0] ||= p(" · ", -1),
1677
- m(O(z), {
1677
+ m(k(B), {
1678
1678
  class: "tpl:mb-px tpl:inline",
1679
1679
  size: 9,
1680
1680
  "stroke-width": 2
@@ -1688,7 +1688,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1688
1688
  style: { color: "var(--tpl-text-dim)" }
1689
1689
  }, D(e.item.alt_text || "\xA0"), 3)) : u("", !0)
1690
1690
  ]),
1691
- l.value ? (S(), d("div", _n, [f("label", vn, D(O(a).mediaLibrary.conversionLabel), 1), f("select", {
1691
+ l.value ? (S(), d("div", yn, [f("label", bn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
1692
1692
  class: "tpl:mt-0.5 tpl:rounded-md tpl:border tpl:py-1 tpl:pr-6 tpl:pl-2 tpl:text-xs tpl:outline-none",
1693
1693
  style: {
1694
1694
  "border-color": "var(--tpl-border)",
@@ -1700,36 +1700,36 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1700
1700
  }, [(S(!0), d(i, null, T(c.value, (e) => (S(), d("option", {
1701
1701
  key: e.value,
1702
1702
  value: e.value
1703
- }, D(e.label), 9, bn))), 128))], 40, yn)])) : u("", !0)
1703
+ }, D(e.label), 9, Sn))), 128))], 40, xn)])) : u("", !0)
1704
1704
  ]));
1705
1705
  }
1706
- }), [["__scopeId", "data-v-060e36cd"]]), Sn = ["data-tpl-theme"], Cn = {
1706
+ }), [["__scopeId", "data-v-060e36cd"]]), wn = ["data-tpl-theme"], Tn = {
1707
1707
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1708
1708
  style: { "background-color": "var(--tpl-bg-elevated)" }
1709
- }, wn = {
1709
+ }, En = {
1710
1710
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
1711
1711
  style: { color: "var(--tpl-text)" }
1712
- }, Tn = {
1712
+ }, Dn = {
1713
1713
  class: "tpl:mb-2 tpl:text-xs",
1714
1714
  style: { color: "var(--tpl-text-muted)" }
1715
- }, En = {
1715
+ }, On = {
1716
1716
  key: 0,
1717
1717
  class: "tpl:mb-3 tpl:text-xs",
1718
1718
  style: { color: "var(--tpl-warning)" }
1719
- }, Dn = {
1719
+ }, kn = {
1720
1720
  class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
1721
1721
  style: { "border-color": "var(--tpl-border)" }
1722
- }, On = {
1722
+ }, An = {
1723
1723
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1724
1724
  style: { color: "var(--tpl-text)" }
1725
- }, kn = { class: "tpl:mb-4" }, An = {
1725
+ }, jn = { class: "tpl:mb-4" }, Mn = {
1726
1726
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
1727
1727
  style: { color: "var(--tpl-text-muted)" }
1728
- }, jn = ["accept"], Mn = {
1728
+ }, Nn = ["accept"], Pn = {
1729
1729
  key: 1,
1730
1730
  class: "tpl:mb-3 tpl:text-xs",
1731
1731
  style: { color: "var(--tpl-danger)" }
1732
- }, Nn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Pn = ["disabled"], Fn = ["disabled"], In = /* @__PURE__ */ h({
1732
+ }, Fn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, In = ["disabled"], Ln = ["disabled"], Rn = /* @__PURE__ */ h({
1733
1733
  __name: "MediaReplaceModal",
1734
1734
  props: {
1735
1735
  visible: { type: Boolean },
@@ -1740,25 +1740,25 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1740
1740
  },
1741
1741
  emits: ["replace", "close"],
1742
1742
  setup(e, { emit: t }) {
1743
- let n = e, r = t, { t: i } = Z(), c = _("tplUiTheme"), p = w(null), h = w(null), g = s(() => {
1743
+ let n = e, r = t, { t: i } = Z(), c = _("tplUiTheme"), p = _(Se, w(null)), h = w(null), g = w(null), v = s(() => {
1744
1744
  if (!n.item) return "";
1745
1745
  let e = n.item.filename.split(".");
1746
1746
  return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
1747
- }), v = s(() => g.value ? `.${g.value}` : "*"), y = s(() => (n.usageInfo?.template_count ?? 0) > 0);
1748
- A(() => n.visible, (e) => {
1749
- e || (h.value = null, p.value && (p.value.value = ""));
1747
+ }), y = s(() => v.value ? `.${v.value}` : "*"), b = s(() => (n.usageInfo?.template_count ?? 0) > 0);
1748
+ j(() => n.visible, (e) => {
1749
+ e || (g.value = null, h.value && (h.value.value = ""));
1750
1750
  });
1751
- function b(e) {
1751
+ function x(e) {
1752
1752
  let t = e.target;
1753
- t.files && t.files.length > 0 && (h.value = t.files[0]);
1753
+ t.files && t.files.length > 0 && (g.value = t.files[0]);
1754
1754
  }
1755
- function x() {
1756
- h.value && r("replace", h.value);
1755
+ function C() {
1756
+ g.value && r("replace", g.value);
1757
1757
  }
1758
- function C(e) {
1758
+ function T(e) {
1759
1759
  e.key === "Escape" && r("close");
1760
1760
  }
1761
- return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
1761
+ return (t, n) => (S(), l(a, { to: k(p) || "body" }, [m(o, {
1762
1762
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1763
1763
  "enter-from-class": "tpl:opacity-0",
1764
1764
  "enter-to-class": "tpl:opacity-100",
@@ -1766,33 +1766,33 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1766
1766
  "leave-from-class": "tpl:opacity-100",
1767
1767
  "leave-to-class": "tpl:opacity-0"
1768
1768
  }, {
1769
- default: j(() => [e.visible && e.item ? (S(), d("div", {
1769
+ default: M(() => [e.visible && e.item ? (S(), d("div", {
1770
1770
  key: 0,
1771
- "data-tpl-theme": O(c),
1771
+ "data-tpl-theme": k(c),
1772
1772
  class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
1773
1773
  style: { "background-color": "var(--tpl-overlay)" },
1774
- onClick: n[1] ||= P((e) => r("close"), ["self"]),
1775
- onKeydown: C
1776
- }, [f("div", Cn, [
1777
- f("h3", wn, D(O(i).mediaLibrary.replaceWarningTitle), 1),
1778
- f("p", Tn, D(O(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${g.value}`)), 1),
1779
- y.value ? (S(), d("p", En, D(O(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
1780
- f("div", Dn, [f("p", On, D(e.item.filename), 1)]),
1781
- f("div", kn, [f("label", An, D(O(i).mediaLibrary.replaceSelectFile), 1), f("input", {
1774
+ onClick: n[1] ||= F((e) => r("close"), ["self"]),
1775
+ onKeydown: T
1776
+ }, [f("div", Tn, [
1777
+ f("h3", En, D(k(i).mediaLibrary.replaceWarningTitle), 1),
1778
+ f("p", Dn, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
1779
+ b.value ? (S(), d("p", On, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
1780
+ f("div", kn, [f("p", An, D(e.item.filename), 1)]),
1781
+ f("div", jn, [f("label", Mn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
1782
1782
  ref_key: "fileInputRef",
1783
- ref: p,
1783
+ ref: h,
1784
1784
  type: "file",
1785
- accept: v.value,
1785
+ accept: y.value,
1786
1786
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs",
1787
1787
  style: {
1788
1788
  "border-color": "var(--tpl-border)",
1789
1789
  "background-color": "var(--tpl-bg)",
1790
1790
  color: "var(--tpl-text)"
1791
1791
  },
1792
- onChange: b
1793
- }, null, 40, jn)]),
1794
- e.error ? (S(), d("p", Mn, D(e.error), 1)) : u("", !0),
1795
- f("div", Nn, [f("button", {
1792
+ onChange: x
1793
+ }, null, 40, Nn)]),
1794
+ e.error ? (S(), d("p", Pn, D(e.error), 1)) : u("", !0),
1795
+ f("div", Fn, [f("button", {
1796
1796
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
1797
1797
  style: {
1798
1798
  "border-color": "var(--tpl-border)",
@@ -1801,29 +1801,29 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1801
1801
  },
1802
1802
  disabled: e.isReplacing,
1803
1803
  onClick: n[0] ||= (e) => r("close")
1804
- }, D(O(i).mediaLibrary.cancel), 9, Pn), f("button", {
1804
+ }, D(k(i).mediaLibrary.cancel), 9, In), f("button", {
1805
1805
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
1806
1806
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
1807
- disabled: !h.value || e.isReplacing,
1808
- onClick: x
1809
- }, D(e.isReplacing ? O(i).mediaLibrary.replacing : O(i).mediaLibrary.replace), 9, Fn)])
1810
- ])], 40, Sn)) : u("", !0)]),
1807
+ disabled: !g.value || e.isReplacing,
1808
+ onClick: C
1809
+ }, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, Ln)])
1810
+ ])], 40, wn)) : u("", !0)]),
1811
1811
  _: 1
1812
- })]));
1812
+ })], 8, ["to"]));
1813
1813
  }
1814
- }), Ln = {
1814
+ }), zn = {
1815
1815
  key: 0,
1816
1816
  class: "tpl:flex tpl:items-center tpl:gap-2"
1817
- }, Rn = {
1817
+ }, Bn = {
1818
1818
  class: "tpl:text-xs",
1819
1819
  style: { color: "var(--tpl-text-muted)" }
1820
- }, zn = {
1820
+ }, Vn = {
1821
1821
  class: "tpl:text-xs",
1822
1822
  style: { color: "var(--tpl-text-muted)" }
1823
- }, Bn = {
1823
+ }, Hn = {
1824
1824
  class: "tpl:mt-1 tpl:text-[10px]",
1825
1825
  style: { color: "var(--tpl-text-dim)" }
1826
- }, Vn = /* @__PURE__ */ h({
1826
+ }, Un = /* @__PURE__ */ h({
1827
1827
  __name: "MediaUploadZone",
1828
1828
  props: {
1829
1829
  isUploading: { type: Boolean },
@@ -1841,9 +1841,9 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1841
1841
  let t = u(e);
1842
1842
  t.length && n("upload", t);
1843
1843
  }
1844
- let { isOverDropZone: h } = oe(l, { onDrop: (e) => {
1844
+ let { isOverDropZone: h } = se(l, { onDrop: (e) => {
1845
1845
  e?.length && p(e);
1846
- } }), { open: g, onChange: _ } = ce({
1846
+ } }), { open: g, onChange: _ } = le({
1847
1847
  accept: s.value,
1848
1848
  multiple: !0
1849
1849
  });
@@ -1852,41 +1852,41 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1852
1852
  }), (t, n) => (S(), d("div", {
1853
1853
  ref_key: "dropZoneRef",
1854
1854
  ref: l,
1855
- class: y(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", O(h) ? "tpl-upload-zone-active" : ""]),
1855
+ class: y(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", k(h) ? "tpl-upload-zone-active" : ""]),
1856
1856
  style: {
1857
1857
  "border-color": "var(--tpl-border-light)",
1858
1858
  "background-color": "var(--tpl-bg)"
1859
1859
  },
1860
- onClick: n[0] ||= (e) => O(g)()
1861
- }, [e.isUploading ? (S(), d("div", Ln, [m(O(U), {
1860
+ onClick: n[0] ||= (e) => k(g)()
1861
+ }, [e.isUploading ? (S(), d("div", zn, [m(k(W), {
1862
1862
  class: "tpl-spinner",
1863
1863
  size: 20,
1864
1864
  "stroke-width": 2,
1865
1865
  style: { color: "var(--tpl-primary)" }
1866
- }), f("span", Rn, D(e.uploadProgress && e.uploadProgress.total > 1 ? O(a)(O(r).mediaLibrary.uploadingProgress, {
1866
+ }), f("span", Bn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
1867
1867
  current: e.uploadProgress.current,
1868
1868
  total: e.uploadProgress.total
1869
- }) : O(r).mediaLibrary.uploading), 1)])) : (S(), d(i, { key: 1 }, [
1870
- m(O(X), {
1869
+ }) : k(r).mediaLibrary.uploading), 1)])) : (S(), d(i, { key: 1 }, [
1870
+ m(k(te), {
1871
1871
  class: "tpl:mb-2",
1872
1872
  size: 24,
1873
1873
  "stroke-width": 1.5,
1874
1874
  style: { color: "var(--tpl-text-dim)" }
1875
1875
  }),
1876
- f("p", zn, D(O(r).mediaLibrary.dropOrClick), 1),
1877
- f("p", Bn, D(O(r).mediaLibrary.acceptedFormats), 1)
1876
+ f("p", Vn, D(k(r).mediaLibrary.dropOrClick), 1),
1877
+ f("p", Hn, D(k(r).mediaLibrary.acceptedFormats), 1)
1878
1878
  ], 64))], 2));
1879
1879
  }
1880
- }), Hn = [
1880
+ }), Wn = [
1881
1881
  "width",
1882
1882
  "height",
1883
1883
  "viewBox"
1884
- ], Un = [
1884
+ ], Gn = [
1885
1885
  "cx",
1886
1886
  "cy",
1887
1887
  "r",
1888
1888
  "stroke-width"
1889
- ], Wn = [
1889
+ ], Kn = [
1890
1890
  "cx",
1891
1891
  "cy",
1892
1892
  "r",
@@ -1894,14 +1894,14 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1894
1894
  "stroke",
1895
1895
  "stroke-dasharray",
1896
1896
  "stroke-dashoffset"
1897
- ], Gn = {
1897
+ ], qn = {
1898
1898
  key: 0,
1899
1899
  class: "tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:-translate-x-1/2 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:whitespace-nowrap tpl:shadow-lg",
1900
1900
  style: {
1901
1901
  "background-color": "var(--tpl-text)",
1902
1902
  color: "var(--tpl-bg-elevated)"
1903
1903
  }
1904
- }, Kn = /* @__PURE__ */ h({
1904
+ }, Jn = /* @__PURE__ */ h({
1905
1905
  __name: "StorageProgressRing",
1906
1906
  props: {
1907
1907
  usedBytes: {},
@@ -1941,7 +1941,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1941
1941
  fill: "none",
1942
1942
  "stroke-width": c.value,
1943
1943
  style: { stroke: "var(--tpl-border)" }
1944
- }, null, 8, Un), f("circle", {
1944
+ }, null, 8, Gn), f("circle", {
1945
1945
  cx: a.value / 2,
1946
1946
  cy: a.value / 2,
1947
1947
  r: l.value,
@@ -1952,7 +1952,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1952
1952
  "stroke-dasharray": h.value,
1953
1953
  "stroke-dashoffset": _.value,
1954
1954
  class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
1955
- }, null, 8, Wn)], 8, Hn)), m(o, {
1955
+ }, null, 8, Kn)], 8, Wn)), m(o, {
1956
1956
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1957
1957
  "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
1958
1958
  "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
@@ -1960,7 +1960,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1960
1960
  "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
1961
1961
  "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
1962
1962
  }, {
1963
- default: j(() => [i.value ? (S(), d("div", Gn, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
1963
+ default: M(() => [i.value ? (S(), d("div", qn, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
1964
1964
  class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
1965
1965
  style: { "background-color": "var(--tpl-text)" }
1966
1966
  }, null, -1)])) : u("", !0)]),
@@ -1970,7 +1970,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
1970
1970
  });
1971
1971
  //#endregion
1972
1972
  //#region src/composables/useMediaLibraryUI.ts
1973
- function qn(e) {
1973
+ function Yn(e) {
1974
1974
  let { library: t, canUseMediaFolders: n, translations: r } = e;
1975
1975
  function i() {
1976
1976
  return "value" in r && typeof r.value == "object" ? r.value : r;
@@ -1993,18 +1993,18 @@ function qn(e) {
1993
1993
  function v(e) {
1994
1994
  return _[e]?.() ?? e;
1995
1995
  }
1996
- A(o, (e) => {
1996
+ j(o, (e) => {
1997
1997
  e && n.value && t.loadFolders();
1998
- }), A(() => t.previewItem.value?.id, () => {
1998
+ }), j(() => t.previewItem.value?.id, () => {
1999
1999
  l.value = "original";
2000
2000
  });
2001
- let y = ae((e) => {
2001
+ let y = oe((e) => {
2002
2002
  t.search(e);
2003
2003
  }, 300);
2004
2004
  function b(e) {
2005
2005
  c.value = e, y(e);
2006
2006
  }
2007
- let { copy: x, copied: S } = ie({
2007
+ let { copy: x, copied: S } = ae({
2008
2008
  copiedDuring: 2e3,
2009
2009
  legacy: !0
2010
2010
  });
@@ -2026,7 +2026,7 @@ function qn(e) {
2026
2026
  function k(e) {
2027
2027
  u.value = e;
2028
2028
  }
2029
- async function j(e, n, r, i) {
2029
+ async function A(e, n, r, i) {
2030
2030
  i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r), u.value = null;
2031
2031
  }
2032
2032
  async function M(e) {
@@ -2069,7 +2069,7 @@ function qn(e) {
2069
2069
  handleRenameFolder: D,
2070
2070
  handleDeleteFolder: O,
2071
2071
  handleEditItem: k,
2072
- handleEditSave: j,
2072
+ handleEditSave: A,
2073
2073
  handleImportFromUrl: M,
2074
2074
  handleMoveToFolder: N,
2075
2075
  handleDeleteClick: P,
@@ -2080,7 +2080,7 @@ function qn(e) {
2080
2080
  }
2081
2081
  //#endregion
2082
2082
  //#region src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
2083
- var Jn = ["data-tpl-theme"], Yn = {
2083
+ var Xn = ["data-tpl-theme"], Zn = {
2084
2084
  class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
2085
2085
  style: {
2086
2086
  width: "900px",
@@ -2091,97 +2091,100 @@ var Jn = ["data-tpl-theme"], Yn = {
2091
2091
  border: "1px solid var(--tpl-border)",
2092
2092
  "box-shadow": "var(--tpl-shadow-xl)"
2093
2093
  }
2094
- }, Xn = {
2094
+ }, Qn = {
2095
2095
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
2096
2096
  style: { "border-color": "var(--tpl-border)" }
2097
- }, Zn = {
2097
+ }, $n = {
2098
2098
  class: "tpl:text-sm tpl:font-semibold",
2099
2099
  style: { color: "var(--tpl-text)" }
2100
- }, Qn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, $n = { class: "tpl:relative" }, er = ["value", "placeholder"], tr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, nr = {
2100
+ }, er = { class: "tpl:flex tpl:items-center tpl:gap-3" }, tr = { class: "tpl:relative" }, nr = ["value", "placeholder"], rr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ir = {
2101
2101
  key: 0,
2102
2102
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
2103
2103
  style: {
2104
2104
  "border-color": "var(--tpl-border)",
2105
2105
  "background-color": "var(--tpl-bg)"
2106
2106
  }
2107
- }, rr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, ir = {
2107
+ }, ar = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, or = {
2108
2108
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
2109
2109
  style: { "border-color": "var(--tpl-border)" }
2110
- }, ar = { class: "tpl:flex tpl:items-center tpl:gap-2" }, or = ["title"], sr = {
2110
+ }, sr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, cr = ["title"], lr = {
2111
2111
  key: 1,
2112
2112
  class: "tpl:text-xs tpl:font-medium",
2113
2113
  style: { color: "var(--tpl-text)" }
2114
- }, cr = {
2114
+ }, ur = {
2115
2115
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
2116
2116
  style: {
2117
2117
  border: "1px solid var(--tpl-border)",
2118
2118
  "background-color": "var(--tpl-bg)"
2119
2119
  }
2120
- }, lr = ["title"], ur = ["title"], dr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, fr = ["value"], pr = { value: "" }, mr = ["value"], hr = ["value"], gr = { value: "newest" }, _r = { value: "oldest" }, vr = { value: "name_asc" }, yr = { value: "name_desc" }, br = { value: "size_asc" }, xr = { value: "size_desc" }, Sr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Cr = {
2120
+ }, dr = ["title"], fr = ["title"], pr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, mr = ["value"], hr = { value: "" }, gr = ["value"], _r = ["value"], vr = { value: "newest" }, yr = { value: "oldest" }, br = { value: "name_asc" }, xr = { value: "name_desc" }, Sr = { value: "size_asc" }, Cr = { value: "size_desc" }, wr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Tr = {
2121
2121
  key: 0,
2122
2122
  class: "tpl:px-4 tpl:pt-3"
2123
- }, wr = {
2123
+ }, Er = {
2124
2124
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
2125
2125
  style: {
2126
2126
  "background-color": "var(--tpl-bg-elevated)",
2127
2127
  "box-shadow": "var(--tpl-shadow-xl)"
2128
2128
  }
2129
- }, Tr = {
2129
+ }, Dr = {
2130
2130
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
2131
2131
  style: { color: "var(--tpl-text)" }
2132
- }, Er = {
2132
+ }, Or = {
2133
2133
  key: 0,
2134
2134
  class: "tpl:mb-4 tpl:text-xs",
2135
2135
  style: { color: "var(--tpl-text-muted)" }
2136
- }, Dr = {
2136
+ }, kr = {
2137
2137
  key: 1,
2138
2138
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
2139
2139
  style: { "border-color": "var(--tpl-border)" }
2140
- }, Or = { class: "tpl:font-medium" }, kr = { style: { color: "var(--tpl-text-muted)" } }, Ar = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, jr = {
2140
+ }, Ar = { class: "tpl:font-medium" }, jr = { style: { color: "var(--tpl-text-muted)" } }, Mr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Nr = {
2141
2141
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
2142
2142
  style: { "border-color": "var(--tpl-border)" }
2143
- }, Mr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Nr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Pr = {
2143
+ }, Pr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Fr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ir = {
2144
2144
  key: 0,
2145
2145
  class: "tpl:flex tpl:items-center tpl:gap-2"
2146
- }, Fr = {
2146
+ }, Lr = {
2147
2147
  key: 1,
2148
2148
  class: "tpl:relative"
2149
- }, Ir = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Lr = ["disabled"], Rr = /* @__PURE__ */ h({
2149
+ }, Rr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, zr = ["disabled"], Br = /* @__PURE__ */ h({
2150
2150
  __name: "MediaLibraryModal",
2151
2151
  props: {
2152
2152
  visible: { type: Boolean },
2153
- accept: {}
2153
+ accept: {},
2154
+ popoverTarget: {}
2154
2155
  },
2155
2156
  emits: ["close", "select"],
2156
2157
  setup(e, { emit: t }) {
2157
- let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme"), g = _("authManager"), v = _("projectId"), x = s(() => v.value), C = _("planConfig"), w = s(() => C.hasFeature("media_folders")), E = s(() => C.hasFeature("import_from_url")), k = s(() => C.config.value?.storage.used_bytes ?? 0), M = s(() => C.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: N, availableCategories: I } = Q(), R = de({
2158
+ let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme");
2159
+ C(Se, O(() => n.popoverTarget ?? null));
2160
+ let g = _("authManager"), v = _("projectId"), x = s(() => v.value), w = _("planConfig"), E = s(() => w.hasFeature("media_folders")), A = s(() => w.hasFeature("import_from_url")), N = s(() => w.config.value?.storage.used_bytes ?? 0), P = s(() => w.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: L, availableCategories: z } = Q(), B = fe({
2158
2161
  projectId: x.value,
2159
2162
  authManager: g
2160
- }), z = qn({
2161
- library: R,
2162
- canUseMediaFolders: w,
2163
+ }), W = Yn({
2164
+ library: B,
2165
+ canUseMediaFolders: E,
2163
2166
  translations: c
2164
2167
  });
2165
- A(() => n.visible, (e) => {
2166
- e ? (R.loadItems(), R.loadFrequentlyUsed()) : z.resetUI();
2168
+ j(() => n.visible, (e) => {
2169
+ e ? (B.loadItems(), B.loadFrequentlyUsed()) : W.resetUI();
2167
2170
  });
2168
- function U(e) {
2171
+ function K(e) {
2169
2172
  e.key === "Escape" && r("close");
2170
2173
  }
2171
- se(document, "keydown", U);
2172
- function G() {
2173
- return R.previewItem.value ? n.accept?.length ? N(R.previewItem.value.mime_type, n.accept) : !0 : !1;
2174
+ ce(document, "keydown", K);
2175
+ function q() {
2176
+ return B.previewItem.value ? n.accept?.length ? L(B.previewItem.value.mime_type, n.accept) : !0 : !1;
2174
2177
  }
2175
- function K() {
2176
- if (G()) {
2177
- let e = R.previewItem.value;
2178
+ function J() {
2179
+ if (q()) {
2180
+ let e = B.previewItem.value;
2178
2181
  r("select", {
2179
2182
  ...e,
2180
- url: z.selectedUrl.value || e.url
2183
+ url: W.selectedUrl.value || e.url
2181
2184
  }), r("close");
2182
2185
  }
2183
2186
  }
2184
- return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
2187
+ return (t, n) => (S(), l(a, { to: e.popoverTarget || "body" }, [m(o, {
2185
2188
  "enter-active-class": "tpl:transition tpl:duration-200",
2186
2189
  "enter-from-class": "tpl:opacity-0",
2187
2190
  "enter-to-class": "tpl:opacity-100",
@@ -2189,20 +2192,20 @@ var Jn = ["data-tpl-theme"], Yn = {
2189
2192
  "leave-from-class": "tpl:opacity-100",
2190
2193
  "leave-to-class": "tpl:opacity-0"
2191
2194
  }, {
2192
- default: j(() => [e.visible ? (S(), d("div", {
2195
+ default: M(() => [e.visible ? (S(), d("div", {
2193
2196
  key: 0,
2194
- "data-tpl-theme": O(h),
2197
+ "data-tpl-theme": k(h),
2195
2198
  class: "tpl tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-[9999]",
2196
- onClick: n[18] ||= P((e) => r("close"), ["self"])
2197
- }, [f("div", Yn, [
2198
- f("div", Xn, [f("h2", Zn, D(O(c).mediaLibrary.title), 1), f("div", Qn, [
2199
- m(Kn, {
2200
- "used-bytes": k.value,
2201
- "limit-bytes": M.value,
2199
+ onClick: n[18] ||= F((e) => r("close"), ["self"])
2200
+ }, [f("div", Zn, [
2201
+ f("div", Qn, [f("h2", $n, D(k(c).mediaLibrary.title), 1), f("div", er, [
2202
+ m(Jn, {
2203
+ "used-bytes": N.value,
2204
+ "limit-bytes": P.value,
2202
2205
  size: 22
2203
2206
  }, null, 8, ["used-bytes", "limit-bytes"]),
2204
- f("div", $n, [f("input", {
2205
- value: O(z).searchInput.value,
2207
+ f("div", tr, [f("input", {
2208
+ value: k(W).searchInput.value,
2206
2209
  type: "text",
2207
2210
  class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)]",
2208
2211
  style: {
@@ -2210,9 +2213,9 @@ var Jn = ["data-tpl-theme"], Yn = {
2210
2213
  "background-color": "var(--tpl-bg)",
2211
2214
  color: "var(--tpl-text)"
2212
2215
  },
2213
- placeholder: O(c).mediaLibrary.searchPlaceholder,
2214
- onInput: n[0] ||= (e) => O(z).handleSearchInput(e.target.value)
2215
- }, null, 40, er), m(O(J), {
2216
+ placeholder: k(c).mediaLibrary.searchPlaceholder,
2217
+ onInput: n[0] ||= (e) => k(W).handleSearchInput(e.target.value)
2218
+ }, null, 40, nr), m(k(Y), {
2216
2219
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
2217
2220
  size: 13,
2218
2221
  "stroke-width": 2,
@@ -2222,12 +2225,12 @@ var Jn = ["data-tpl-theme"], Yn = {
2222
2225
  class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2223
2226
  style: { color: "var(--tpl-text-muted)" },
2224
2227
  onClick: n[1] ||= (e) => r("close")
2225
- }, [m(O(te), {
2228
+ }, [m(k(ne), {
2226
2229
  size: 18,
2227
2230
  "stroke-width": 2
2228
2231
  })])
2229
2232
  ])]),
2230
- f("div", tr, [m(o, {
2233
+ f("div", rr, [m(o, {
2231
2234
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
2232
2235
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
2233
2236
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -2235,16 +2238,16 @@ var Jn = ["data-tpl-theme"], Yn = {
2235
2238
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
2236
2239
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
2237
2240
  }, {
2238
- default: j(() => [w.value && O(z).showSidebar.value ? (S(), d("div", nr, [m(ht, {
2239
- folders: O(R).folders.value,
2240
- "current-folder-id": O(R).currentFolderId.value,
2241
- "view-mode": O(R).viewMode.value,
2242
- "has-frequently-used": O(z).hasFrequentlyUsed.value,
2243
- onNavigate: O(R).navigateToFolder,
2244
- onCreateFolder: O(z).handleCreateFolder,
2245
- onRenameFolder: O(z).handleRenameFolder,
2246
- onDeleteFolder: O(z).handleDeleteFolder,
2247
- onShowFrequentlyUsed: O(R).showFrequentlyUsed
2241
+ default: M(() => [E.value && k(W).showSidebar.value ? (S(), d("div", ir, [m(_t, {
2242
+ folders: k(B).folders.value,
2243
+ "current-folder-id": k(B).currentFolderId.value,
2244
+ "view-mode": k(B).viewMode.value,
2245
+ "has-frequently-used": k(W).hasFrequentlyUsed.value,
2246
+ onNavigate: k(B).navigateToFolder,
2247
+ onCreateFolder: k(W).handleCreateFolder,
2248
+ onRenameFolder: k(W).handleRenameFolder,
2249
+ onDeleteFolder: k(W).handleDeleteFolder,
2250
+ onShowFrequentlyUsed: k(B).showFrequentlyUsed
2248
2251
  }, null, 8, [
2249
2252
  "folders",
2250
2253
  "current-folder-id",
@@ -2257,55 +2260,55 @@ var Jn = ["data-tpl-theme"], Yn = {
2257
2260
  "onShowFrequentlyUsed"
2258
2261
  ])])) : u("", !0)]),
2259
2262
  _: 1
2260
- }), f("div", rr, [f("div", ir, [f("div", ar, [
2261
- w.value ? (S(), d("button", {
2263
+ }), f("div", ar, [f("div", or, [f("div", sr, [
2264
+ E.value ? (S(), d("button", {
2262
2265
  key: 0,
2263
2266
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2264
2267
  style: b({
2265
- color: O(z).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2266
- backgroundColor: O(z).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2267
- border: O(z).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2268
+ color: k(W).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2269
+ backgroundColor: k(W).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2270
+ border: k(W).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2268
2271
  }),
2269
- title: O(z).showSidebar.value ? O(c).mediaLibrary.hideFolders : O(c).mediaLibrary.showFolders,
2270
- onClick: n[2] ||= (e) => O(z).showSidebar.value = !O(z).showSidebar.value
2271
- }, [m(O(W), {
2272
+ title: k(W).showSidebar.value ? k(c).mediaLibrary.hideFolders : k(c).mediaLibrary.showFolders,
2273
+ onClick: n[2] ||= (e) => k(W).showSidebar.value = !k(W).showSidebar.value
2274
+ }, [m(k(G), {
2272
2275
  size: 16,
2273
2276
  "stroke-width": 2
2274
- })], 12, or)) : u("", !0),
2275
- O(R).viewMode.value === "frequently-used" ? (S(), d("span", sr, D(O(c).mediaLibrary.frequentlyUsed), 1)) : (S(), l(he, {
2277
+ })], 12, cr)) : u("", !0),
2278
+ k(B).viewMode.value === "frequently-used" ? (S(), d("span", lr, D(k(c).mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2276
2279
  key: 2,
2277
- folders: O(R).folders.value,
2278
- "current-folder-id": O(R).currentFolderId.value,
2279
- onNavigate: O(R).navigateToFolder
2280
+ folders: k(B).folders.value,
2281
+ "current-folder-id": k(B).currentFolderId.value,
2282
+ onNavigate: k(B).navigateToFolder
2280
2283
  }, null, 8, [
2281
2284
  "folders",
2282
2285
  "current-folder-id",
2283
2286
  "onNavigate"
2284
2287
  ])),
2285
- f("div", cr, [f("button", {
2288
+ f("div", ur, [f("button", {
2286
2289
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2287
2290
  style: b({
2288
- color: O(z).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2289
- backgroundColor: O(z).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2291
+ color: k(W).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2292
+ backgroundColor: k(W).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2290
2293
  }),
2291
- title: O(c).mediaLibrary.viewGrid,
2292
- onClick: n[3] ||= (e) => O(z).layoutMode.value = "grid"
2293
- }, [m(O(B), {
2294
+ title: k(c).mediaLibrary.viewGrid,
2295
+ onClick: n[3] ||= (e) => k(W).layoutMode.value = "grid"
2296
+ }, [m(k(V), {
2294
2297
  size: 14,
2295
2298
  "stroke-width": 2
2296
- })], 12, lr), f("button", {
2299
+ })], 12, dr), f("button", {
2297
2300
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2298
2301
  style: b({
2299
- color: O(z).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2300
- backgroundColor: O(z).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2302
+ color: k(W).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2303
+ backgroundColor: k(W).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2301
2304
  }),
2302
- title: O(c).mediaLibrary.viewList,
2303
- onClick: n[4] ||= (e) => O(z).layoutMode.value = "list"
2304
- }, [m(O(H), {
2305
+ title: k(c).mediaLibrary.viewList,
2306
+ onClick: n[4] ||= (e) => k(W).layoutMode.value = "list"
2307
+ }, [m(k(U), {
2305
2308
  size: 14,
2306
2309
  "stroke-width": 2
2307
- })], 12, ur)])
2308
- ]), f("div", dr, [O(I).length > 1 ? (S(), d("select", {
2310
+ })], 12, fr)])
2311
+ ]), f("div", pr, [k(z).length > 1 ? (S(), d("select", {
2309
2312
  key: 0,
2310
2313
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
2311
2314
  style: {
@@ -2313,36 +2316,36 @@ var Jn = ["data-tpl-theme"], Yn = {
2313
2316
  "background-color": "var(--tpl-bg)",
2314
2317
  color: "var(--tpl-text)"
2315
2318
  },
2316
- value: O(R).categoryFilter.value ?? "",
2317
- onChange: n[5] ||= (e) => O(R).filterByCategory(e.target.value || null)
2318
- }, [f("option", pr, D(O(c).mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(O(I), (e) => (S(), d("option", {
2319
+ value: k(B).categoryFilter.value ?? "",
2320
+ onChange: n[5] ||= (e) => k(B).filterByCategory(e.target.value || null)
2321
+ }, [f("option", hr, D(k(c).mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(z), (e) => (S(), d("option", {
2319
2322
  key: e,
2320
2323
  value: e
2321
- }, D(O(z).getCategoryLabel(e)), 9, mr))), 128))], 40, fr)) : u("", !0), f("select", {
2324
+ }, D(k(W).getCategoryLabel(e)), 9, gr))), 128))], 40, mr)) : u("", !0), f("select", {
2322
2325
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
2323
2326
  style: {
2324
2327
  "border-color": "var(--tpl-border)",
2325
2328
  "background-color": "var(--tpl-bg)",
2326
2329
  color: "var(--tpl-text)"
2327
2330
  },
2328
- value: O(R).sortOption.value,
2329
- onChange: n[6] ||= (e) => O(R).sortBy(e.target.value)
2331
+ value: k(B).sortOption.value,
2332
+ onChange: n[6] ||= (e) => k(B).sortBy(e.target.value)
2330
2333
  }, [
2331
- f("option", gr, D(O(c).mediaLibrary.sortNewest), 1),
2332
- f("option", _r, D(O(c).mediaLibrary.sortOldest), 1),
2333
- f("option", vr, D(O(c).mediaLibrary.sortNameAsc), 1),
2334
- f("option", yr, D(O(c).mediaLibrary.sortNameDesc), 1),
2335
- f("option", br, D(O(c).mediaLibrary.sortSizeAsc), 1),
2336
- f("option", xr, D(O(c).mediaLibrary.sortSizeDesc), 1)
2337
- ], 40, hr)])]), f("div", Sr, [O(R).viewMode.value === "files" ? (S(), d("div", Cr, [m(Vn, {
2338
- "is-uploading": O(R).isUploading.value,
2339
- "upload-progress": O(R).uploadProgress.value,
2340
- onUpload: O(z).handleUpload
2334
+ f("option", vr, D(k(c).mediaLibrary.sortNewest), 1),
2335
+ f("option", yr, D(k(c).mediaLibrary.sortOldest), 1),
2336
+ f("option", br, D(k(c).mediaLibrary.sortNameAsc), 1),
2337
+ f("option", xr, D(k(c).mediaLibrary.sortNameDesc), 1),
2338
+ f("option", Sr, D(k(c).mediaLibrary.sortSizeAsc), 1),
2339
+ f("option", Cr, D(k(c).mediaLibrary.sortSizeDesc), 1)
2340
+ ], 40, _r)])]), f("div", wr, [k(B).viewMode.value === "files" ? (S(), d("div", Tr, [m(Un, {
2341
+ "is-uploading": k(B).isUploading.value,
2342
+ "upload-progress": k(B).uploadProgress.value,
2343
+ onUpload: k(W).handleUpload
2341
2344
  }, null, 8, [
2342
2345
  "is-uploading",
2343
2346
  "upload-progress",
2344
2347
  "onUpload"
2345
- ]), E.value ? (S(), d("button", {
2348
+ ]), A.value ? (S(), d("button", {
2346
2349
  key: 0,
2347
2350
  class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2348
2351
  style: {
@@ -2350,22 +2353,22 @@ var Jn = ["data-tpl-theme"], Yn = {
2350
2353
  color: "var(--tpl-text-muted)",
2351
2354
  "background-color": "var(--tpl-bg)"
2352
2355
  },
2353
- onClick: n[7] ||= (e) => O(z).showImportUrlModal.value = !0
2354
- }, [m(O(V), {
2356
+ onClick: n[7] ||= (e) => k(W).showImportUrlModal.value = !0
2357
+ }, [m(k(H), {
2355
2358
  size: 14,
2356
2359
  "stroke-width": 2
2357
- }), p(" " + D(O(c).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Kt, {
2358
- items: O(z).displayItems.value,
2359
- "selected-ids": O(R).selectedItems.value,
2360
- "is-loading": O(R).isLoading.value,
2361
- "has-more": O(R).viewMode.value === "files" && O(R).hasMore.value,
2360
+ }), p(" " + D(k(c).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Jt, {
2361
+ items: k(W).displayItems.value,
2362
+ "selected-ids": k(B).selectedItems.value,
2363
+ "is-loading": k(B).isLoading.value,
2364
+ "has-more": k(B).viewMode.value === "files" && k(B).hasMore.value,
2362
2365
  accept: e.accept,
2363
- layout: O(z).layoutMode.value,
2364
- onSelect: O(z).handleSelect,
2365
- onToggle: O(R).toggleSelection,
2366
- onLoadMore: O(R).loadMore,
2367
- onEdit: O(z).handleEditItem,
2368
- onReplace: O(z).handleReplaceItem
2366
+ layout: k(W).layoutMode.value,
2367
+ onSelect: k(W).handleSelect,
2368
+ onToggle: k(B).toggleSelection,
2369
+ onLoadMore: k(B).loadMore,
2370
+ onEdit: k(W).handleEditItem,
2371
+ onReplace: k(W).handleReplaceItem
2369
2372
  }, null, 8, [
2370
2373
  "items",
2371
2374
  "selected-ids",
@@ -2379,36 +2382,36 @@ var Jn = ["data-tpl-theme"], Yn = {
2379
2382
  "onEdit",
2380
2383
  "onReplace"
2381
2384
  ])])])]),
2382
- m(an, {
2383
- visible: O(z).showImportUrlModal.value,
2384
- "is-importing": O(R).isImportingFromUrl.value,
2385
- error: O(R).importFromUrlError.value,
2386
- onImport: O(z).handleImportFromUrl,
2387
- onClose: n[8] ||= (e) => O(z).showImportUrlModal.value = !1
2385
+ m(sn, {
2386
+ visible: k(W).showImportUrlModal.value,
2387
+ "is-importing": k(B).isImportingFromUrl.value,
2388
+ error: k(B).importFromUrlError.value,
2389
+ onImport: k(W).handleImportFromUrl,
2390
+ onClose: n[8] ||= (e) => k(W).showImportUrlModal.value = !1
2388
2391
  }, null, 8, [
2389
2392
  "visible",
2390
2393
  "is-importing",
2391
2394
  "error",
2392
2395
  "onImport"
2393
2396
  ]),
2394
- m(nt, {
2395
- visible: !!O(z).editingItem.value,
2396
- item: O(z).editingItem.value,
2397
- onSave: O(z).handleEditSave,
2398
- onClose: n[9] ||= (e) => O(z).editingItem.value = null
2397
+ m(it, {
2398
+ visible: !!k(W).editingItem.value,
2399
+ item: k(W).editingItem.value,
2400
+ onSave: k(W).handleEditSave,
2401
+ onClose: n[9] ||= (e) => k(W).editingItem.value = null
2399
2402
  }, null, 8, [
2400
2403
  "visible",
2401
2404
  "item",
2402
2405
  "onSave"
2403
2406
  ]),
2404
- m(In, {
2405
- visible: O(R).showReplaceWarning.value,
2406
- item: O(R).pendingReplaceItem.value,
2407
- "usage-info": O(R).replaceUsageInfo.value,
2408
- "is-replacing": O(R).isReplacing.value,
2409
- error: O(R).replaceError.value,
2410
- onReplace: O(z).handleReplaceFile,
2411
- onClose: O(R).cancelReplace
2407
+ m(Rn, {
2408
+ visible: k(B).showReplaceWarning.value,
2409
+ item: k(B).pendingReplaceItem.value,
2410
+ "usage-info": k(B).replaceUsageInfo.value,
2411
+ "is-replacing": k(B).isReplacing.value,
2412
+ error: k(B).replaceError.value,
2413
+ onReplace: k(W).handleReplaceFile,
2414
+ onClose: k(B).cancelReplace
2412
2415
  }, null, 8, [
2413
2416
  "visible",
2414
2417
  "item",
@@ -2426,7 +2429,7 @@ var Jn = ["data-tpl-theme"], Yn = {
2426
2429
  "leave-from-class": "tpl:opacity-100",
2427
2430
  "leave-to-class": "tpl:opacity-0"
2428
2431
  }, {
2429
- default: j(() => [O(R).showDeleteWarning.value ? (S(), d("div", {
2432
+ default: M(() => [k(B).showDeleteWarning.value ? (S(), d("div", {
2430
2433
  key: 0,
2431
2434
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
2432
2435
  style: {
@@ -2434,85 +2437,85 @@ var Jn = ["data-tpl-theme"], Yn = {
2434
2437
  "backdrop-filter": "blur(8px)",
2435
2438
  "-webkit-backdrop-filter": "blur(8px)"
2436
2439
  },
2437
- onClick: n[12] ||= P((...e) => O(R).cancelDelete && O(R).cancelDelete(...e), ["self"])
2438
- }, [f("div", wr, [
2439
- f("h3", Tr, D(O(c).mediaLibrary.deleteWarningTitle), 1),
2440
+ onClick: n[12] ||= F((...e) => k(B).cancelDelete && k(B).cancelDelete(...e), ["self"])
2441
+ }, [f("div", Er, [
2442
+ f("h3", Dr, D(k(c).mediaLibrary.deleteWarningTitle), 1),
2440
2443
  f("p", {
2441
- class: y(["tpl:text-xs", O(z).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2444
+ class: y(["tpl:text-xs", k(W).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2442
2445
  style: { color: "var(--tpl-text-muted)" }
2443
- }, D(O(c).mediaLibrary.deleteWarningMessage), 3),
2444
- O(z).hasUsedFiles.value ? (S(), d("p", Er, D(O(c).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2445
- O(z).hasUsedFiles.value ? (S(), d("div", Dr, [(S(!0), d(i, null, T(O(R).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2446
+ }, D(k(c).mediaLibrary.deleteWarningMessage), 3),
2447
+ k(W).hasUsedFiles.value ? (S(), d("p", Or, D(k(c).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2448
+ k(W).hasUsedFiles.value ? (S(), d("div", kr, [(S(!0), d(i, null, T(k(B).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2446
2449
  key: t,
2447
2450
  class: "tpl:text-xs",
2448
2451
  style: { color: "var(--tpl-text)" }
2449
- }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Or, D(O(z).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", kr, " - " + D(O(c).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2450
- f("div", Ar, [f("button", {
2452
+ }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Ar, D(k(W).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", jr, " - " + D(k(c).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2453
+ f("div", Mr, [f("button", {
2451
2454
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2452
2455
  style: {
2453
2456
  "border-color": "var(--tpl-border)",
2454
2457
  color: "var(--tpl-text)",
2455
2458
  "background-color": "var(--tpl-bg)"
2456
2459
  },
2457
- onClick: n[10] ||= (...e) => O(R).cancelDelete && O(R).cancelDelete(...e)
2458
- }, D(O(c).mediaLibrary.cancel), 1), f("button", {
2460
+ onClick: n[10] ||= (...e) => k(B).cancelDelete && k(B).cancelDelete(...e)
2461
+ }, D(k(c).mediaLibrary.cancel), 1), f("button", {
2459
2462
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2460
2463
  style: {
2461
2464
  "border-color": "var(--tpl-danger)",
2462
2465
  color: "var(--tpl-danger)",
2463
2466
  "background-color": "var(--tpl-danger-light)"
2464
2467
  },
2465
- onClick: n[11] ||= (...e) => O(R).confirmDelete && O(R).confirmDelete(...e)
2466
- }, D(O(z).hasUsedFiles.value ? O(c).mediaLibrary.deleteAnyway : O(c).mediaLibrary.confirmDelete), 1)])
2468
+ onClick: n[11] ||= (...e) => k(B).confirmDelete && k(B).confirmDelete(...e)
2469
+ }, D(k(W).hasUsedFiles.value ? k(c).mediaLibrary.deleteAnyway : k(c).mediaLibrary.confirmDelete), 1)])
2467
2470
  ])])) : u("", !0)]),
2468
2471
  _: 1
2469
2472
  }),
2470
- f("div", jr, [f("div", Mr, [O(R).previewItem.value ? (S(), l(xn, {
2473
+ f("div", Nr, [f("div", Pr, [k(B).previewItem.value ? (S(), l(Cn, {
2471
2474
  key: 0,
2472
- "selected-conversion": O(z).selectedConversion.value,
2473
- "onUpdate:selectedConversion": n[13] ||= (e) => O(z).selectedConversion.value = e,
2474
- item: O(R).previewItem.value,
2475
- folders: O(R).folders.value
2475
+ "selected-conversion": k(W).selectedConversion.value,
2476
+ "onUpdate:selectedConversion": n[13] ||= (e) => k(W).selectedConversion.value = e,
2477
+ item: k(B).previewItem.value,
2478
+ folders: k(B).folders.value
2476
2479
  }, null, 8, [
2477
2480
  "selected-conversion",
2478
2481
  "item",
2479
2482
  "folders"
2480
- ])) : u("", !0)]), f("div", Nr, [O(R).selectedItems.value.size > 0 ? (S(), d("div", Pr, [O(R).previewItem.value ? (S(), d("button", {
2483
+ ])) : u("", !0)]), f("div", Fr, [k(B).selectedItems.value.size > 0 ? (S(), d("div", Ir, [k(B).previewItem.value ? (S(), d("button", {
2481
2484
  key: 0,
2482
2485
  class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2483
2486
  style: b({
2484
- borderColor: O(z).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2485
- color: O(z).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2487
+ borderColor: k(W).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2488
+ color: k(W).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2486
2489
  backgroundColor: "var(--tpl-bg)"
2487
2490
  }),
2488
- onClick: n[14] ||= (e) => O(z).copy(O(z).selectedUrl.value)
2489
- }, [O(z).copied.value ? (S(), l(O(F), {
2491
+ onClick: n[14] ||= (e) => k(W).copy(k(W).selectedUrl.value)
2492
+ }, [k(W).copied.value ? (S(), l(k(I), {
2490
2493
  key: 1,
2491
2494
  size: 12,
2492
2495
  "stroke-width": 2
2493
- })) : (S(), l(O(L), {
2496
+ })) : (S(), l(k(R), {
2494
2497
  key: 0,
2495
2498
  size: 12,
2496
2499
  "stroke-width": 2
2497
- })), p(" " + D(O(z).copied.value ? O(c).mediaLibrary.copied : O(c).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), w.value ? (S(), d("div", Fr, [f("button", {
2500
+ })), p(" " + D(k(W).copied.value ? k(c).mediaLibrary.copied : k(c).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), E.value ? (S(), d("div", Lr, [f("button", {
2498
2501
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2499
2502
  style: {
2500
2503
  "border-color": "var(--tpl-border)",
2501
2504
  color: "var(--tpl-text)",
2502
2505
  "background-color": "var(--tpl-bg)"
2503
2506
  },
2504
- onClick: n[15] ||= (e) => O(z).showMovePicker.value = !O(z).showMovePicker.value
2505
- }, D(O(c).mediaLibrary.moveSelected), 1), O(z).showMovePicker.value ? (S(), l(un, {
2507
+ onClick: n[15] ||= (e) => k(W).showMovePicker.value = !k(W).showMovePicker.value
2508
+ }, D(k(c).mediaLibrary.moveSelected), 1), k(W).showMovePicker.value ? (S(), l(fn, {
2506
2509
  key: 0,
2507
- folders: O(R).folders.value,
2508
- "current-folder-id": O(R).currentFolderId.value,
2509
- onSelect: O(z).handleMoveToFolder,
2510
- onClose: n[16] ||= (e) => O(z).showMovePicker.value = !1
2510
+ folders: k(B).folders.value,
2511
+ "current-folder-id": k(B).currentFolderId.value,
2512
+ onSelect: k(W).handleMoveToFolder,
2513
+ onClose: n[16] ||= (e) => k(W).showMovePicker.value = !1
2511
2514
  }, null, 8, [
2512
2515
  "folders",
2513
2516
  "current-folder-id",
2514
2517
  "onSelect"
2515
- ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Ir, [O(R).selectedItems.value.size > 0 ? (S(), d("button", {
2518
+ ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Rr, [k(B).selectedItems.value.size > 0 ? (S(), d("button", {
2516
2519
  key: 0,
2517
2520
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2518
2521
  style: {
@@ -2520,24 +2523,24 @@ var Jn = ["data-tpl-theme"], Yn = {
2520
2523
  color: "var(--tpl-danger)",
2521
2524
  "background-color": "var(--tpl-danger-light)"
2522
2525
  },
2523
- onClick: n[17] ||= (...e) => O(z).handleDeleteClick && O(z).handleDeleteClick(...e)
2524
- }, D(O(c).mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
2526
+ onClick: n[17] ||= (...e) => k(W).handleDeleteClick && k(W).handleDeleteClick(...e)
2527
+ }, D(k(c).mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
2525
2528
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
2526
2529
  style: {
2527
2530
  "background-color": "var(--tpl-primary)",
2528
2531
  color: "var(--tpl-bg)"
2529
2532
  },
2530
- disabled: !G(),
2531
- onClick: K
2532
- }, D(e.accept?.length ? O(c).mediaLibrary.selectImage : O(c).mediaLibrary.selectFile), 9, Lr)])])])
2533
- ])], 8, Jn)) : u("", !0)]),
2533
+ disabled: !q(),
2534
+ onClick: J
2535
+ }, D(e.accept?.length ? k(c).mediaLibrary.selectImage : k(c).mediaLibrary.selectFile), 9, zr)])])])
2536
+ ])], 8, Xn)) : u("", !0)]),
2534
2537
  _: 1
2535
- })]));
2538
+ })], 8, ["to"]));
2536
2539
  }
2537
2540
  });
2538
2541
  //#endregion
2539
2542
  //#region src/composables/useMediaPicker.ts
2540
- function zr() {
2543
+ function Vr() {
2541
2544
  let e = _("onRequestMedia"), t = _("planConfig"), n = w(!1), r = s(() => !!e && t.hasFeature("pluggable_media"));
2542
2545
  async function i(t) {
2543
2546
  if (!e) return null;
@@ -2556,7 +2559,7 @@ function zr() {
2556
2559
  }
2557
2560
  //#endregion
2558
2561
  //#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
2559
- var Br = {
2562
+ var Hr = {
2560
2563
  class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
2561
2564
  style: {
2562
2565
  width: "100%",
@@ -2564,62 +2567,62 @@ var Br = {
2564
2567
  "background-color": "var(--tpl-bg-elevated)",
2565
2568
  border: "1px solid var(--tpl-border)"
2566
2569
  }
2567
- }, Vr = {
2570
+ }, Ur = {
2568
2571
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
2569
2572
  style: { "border-color": "var(--tpl-border)" }
2570
- }, Hr = {
2573
+ }, Wr = {
2571
2574
  class: "tpl:text-sm tpl:font-semibold",
2572
2575
  style: { color: "var(--tpl-text)" }
2573
- }, Ur = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Wr = { class: "tpl:relative" }, Gr = ["value", "placeholder"], Kr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, qr = {
2576
+ }, Gr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Kr = { class: "tpl:relative" }, qr = ["value", "placeholder"], Jr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Yr = {
2574
2577
  key: 0,
2575
2578
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
2576
2579
  style: {
2577
2580
  "border-color": "var(--tpl-border)",
2578
2581
  "background-color": "var(--tpl-bg)"
2579
2582
  }
2580
- }, Jr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Yr = {
2583
+ }, Xr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Zr = {
2581
2584
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
2582
2585
  style: { "border-color": "var(--tpl-border)" }
2583
- }, Xr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Zr = ["title"], Qr = {
2586
+ }, Qr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, $r = ["title"], ei = {
2584
2587
  key: 1,
2585
2588
  class: "tpl:text-xs tpl:font-medium",
2586
2589
  style: { color: "var(--tpl-text)" }
2587
- }, $r = {
2590
+ }, ti = {
2588
2591
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
2589
2592
  style: {
2590
2593
  border: "1px solid var(--tpl-border)",
2591
2594
  "background-color": "var(--tpl-bg)"
2592
2595
  }
2593
- }, ei = ["title"], ti = ["title"], ni = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ri = ["value"], ii = { value: "" }, ai = ["value"], oi = ["value"], si = { value: "newest" }, ci = { value: "oldest" }, li = { value: "name_asc" }, ui = { value: "name_desc" }, di = { value: "size_asc" }, fi = { value: "size_desc" }, pi = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, mi = {
2596
+ }, ni = ["title"], ri = ["title"], ii = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ai = ["value"], oi = { value: "" }, si = ["value"], ci = ["value"], li = { value: "newest" }, ui = { value: "oldest" }, di = { value: "name_asc" }, fi = { value: "name_desc" }, pi = { value: "size_asc" }, mi = { value: "size_desc" }, hi = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, gi = {
2594
2597
  key: 0,
2595
2598
  class: "tpl:px-4 tpl:pt-3"
2596
- }, hi = {
2599
+ }, _i = {
2597
2600
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
2598
2601
  style: {
2599
2602
  "background-color": "var(--tpl-bg-elevated)",
2600
2603
  "box-shadow": "var(--tpl-shadow-xl)"
2601
2604
  }
2602
- }, gi = {
2605
+ }, vi = {
2603
2606
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
2604
2607
  style: { color: "var(--tpl-text)" }
2605
- }, _i = {
2608
+ }, yi = {
2606
2609
  key: 0,
2607
2610
  class: "tpl:mb-4 tpl:text-xs",
2608
2611
  style: { color: "var(--tpl-text-muted)" }
2609
- }, vi = {
2612
+ }, bi = {
2610
2613
  key: 1,
2611
2614
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
2612
2615
  style: { "border-color": "var(--tpl-border)" }
2613
- }, yi = { class: "tpl:font-medium" }, bi = { style: { color: "var(--tpl-text-muted)" } }, xi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Si = {
2616
+ }, xi = { class: "tpl:font-medium" }, Si = { style: { color: "var(--tpl-text-muted)" } }, Ci = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, wi = {
2614
2617
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
2615
2618
  style: { "border-color": "var(--tpl-border)" }
2616
- }, Ci = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, wi = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ti = {
2619
+ }, Ti = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Ei = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Di = {
2617
2620
  key: 0,
2618
2621
  class: "tpl:flex tpl:items-center tpl:gap-2"
2619
- }, Ei = {
2622
+ }, Oi = {
2620
2623
  key: 1,
2621
2624
  class: "tpl:relative"
2622
- }, Di = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Oi = ["disabled"], ki = /* @__PURE__ */ h({
2625
+ }, ki = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ai = ["disabled"], ji = /* @__PURE__ */ h({
2623
2626
  __name: "MediaLibrary",
2624
2627
  props: {
2625
2628
  authManager: {},
@@ -2639,11 +2642,11 @@ var Br = {
2639
2642
  features: s(() => n.planConfig.features),
2640
2643
  fetchConfig: async () => {}
2641
2644
  });
2642
- let c = s(() => n.planConfig.features.media_folders ?? !1), h = s(() => n.planConfig.features.import_from_url ?? !1), g = s(() => n.planConfig.storage.used_bytes ?? 0), _ = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: v } = Q(), E = de({
2645
+ let c = s(() => n.planConfig.features.media_folders ?? !1), h = s(() => n.planConfig.features.import_from_url ?? !1), g = s(() => n.planConfig.storage.used_bytes ?? 0), _ = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: v } = Q(), E = fe({
2643
2646
  projectId: n.projectId,
2644
2647
  authManager: n.authManager,
2645
2648
  onError: n.onError
2646
- }), k = qn({
2649
+ }), O = Yn({
2647
2650
  library: E,
2648
2651
  canUseMediaFolders: c,
2649
2652
  translations: a
@@ -2652,19 +2655,19 @@ var Br = {
2652
2655
  if (!E.previewItem.value) return;
2653
2656
  let e = E.previewItem.value, t = {
2654
2657
  ...e,
2655
- url: k.selectedUrl.value || e.url
2658
+ url: O.selectedUrl.value || e.url
2656
2659
  };
2657
2660
  n.onSelect?.(t);
2658
2661
  }
2659
2662
  return x(() => {
2660
2663
  E.loadItems(), E.loadFrequentlyUsed(), r("ready");
2661
- }), (t, n) => (S(), d("div", Br, [
2662
- f("div", Vr, [f("h2", Hr, D(a.value.mediaLibrary.title), 1), f("div", Ur, [m(Kn, {
2664
+ }), (t, n) => (S(), d("div", Hr, [
2665
+ f("div", Ur, [f("h2", Wr, D(a.value.mediaLibrary.title), 1), f("div", Gr, [m(Jn, {
2663
2666
  "used-bytes": g.value,
2664
2667
  "limit-bytes": _.value,
2665
2668
  size: 22
2666
- }, null, 8, ["used-bytes", "limit-bytes"]), f("div", Wr, [f("input", {
2667
- value: O(k).searchInput.value,
2669
+ }, null, 8, ["used-bytes", "limit-bytes"]), f("div", Kr, [f("input", {
2670
+ value: k(O).searchInput.value,
2668
2671
  type: "text",
2669
2672
  class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)]",
2670
2673
  style: {
@@ -2673,14 +2676,14 @@ var Br = {
2673
2676
  color: "var(--tpl-text)"
2674
2677
  },
2675
2678
  placeholder: a.value.mediaLibrary.searchPlaceholder,
2676
- onInput: n[0] ||= (e) => O(k).handleSearchInput(e.target.value)
2677
- }, null, 40, Gr), m(O(J), {
2679
+ onInput: n[0] ||= (e) => k(O).handleSearchInput(e.target.value)
2680
+ }, null, 40, qr), m(k(Y), {
2678
2681
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
2679
2682
  size: 13,
2680
2683
  "stroke-width": 2,
2681
2684
  style: { color: "var(--tpl-text-dim)" }
2682
2685
  })])])]),
2683
- f("div", Kr, [m(o, {
2686
+ f("div", Jr, [m(o, {
2684
2687
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
2685
2688
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
2686
2689
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -2688,16 +2691,16 @@ var Br = {
2688
2691
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
2689
2692
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
2690
2693
  }, {
2691
- default: j(() => [c.value && O(k).showSidebar.value ? (S(), d("div", qr, [m(ht, {
2692
- folders: O(E).folders.value,
2693
- "current-folder-id": O(E).currentFolderId.value,
2694
- "view-mode": O(E).viewMode.value,
2695
- "has-frequently-used": O(k).hasFrequentlyUsed.value,
2696
- onNavigate: O(E).navigateToFolder,
2697
- onCreateFolder: O(k).handleCreateFolder,
2698
- onRenameFolder: O(k).handleRenameFolder,
2699
- onDeleteFolder: O(k).handleDeleteFolder,
2700
- onShowFrequentlyUsed: O(E).showFrequentlyUsed
2694
+ default: M(() => [c.value && k(O).showSidebar.value ? (S(), d("div", Yr, [m(_t, {
2695
+ folders: k(E).folders.value,
2696
+ "current-folder-id": k(E).currentFolderId.value,
2697
+ "view-mode": k(E).viewMode.value,
2698
+ "has-frequently-used": k(O).hasFrequentlyUsed.value,
2699
+ onNavigate: k(E).navigateToFolder,
2700
+ onCreateFolder: k(O).handleCreateFolder,
2701
+ onRenameFolder: k(O).handleRenameFolder,
2702
+ onDeleteFolder: k(O).handleDeleteFolder,
2703
+ onShowFrequentlyUsed: k(E).showFrequentlyUsed
2701
2704
  }, null, 8, [
2702
2705
  "folders",
2703
2706
  "current-folder-id",
@@ -2710,55 +2713,55 @@ var Br = {
2710
2713
  "onShowFrequentlyUsed"
2711
2714
  ])])) : u("", !0)]),
2712
2715
  _: 1
2713
- }), f("div", Jr, [f("div", Yr, [f("div", Xr, [
2716
+ }), f("div", Xr, [f("div", Zr, [f("div", Qr, [
2714
2717
  c.value ? (S(), d("button", {
2715
2718
  key: 0,
2716
2719
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2717
2720
  style: b({
2718
- color: O(k).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2719
- backgroundColor: O(k).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2720
- border: O(k).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2721
+ color: k(O).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2722
+ backgroundColor: k(O).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2723
+ border: k(O).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2721
2724
  }),
2722
- title: O(k).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
2723
- onClick: n[1] ||= (e) => O(k).showSidebar.value = !O(k).showSidebar.value
2724
- }, [m(O(W), {
2725
+ title: k(O).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
2726
+ onClick: n[1] ||= (e) => k(O).showSidebar.value = !k(O).showSidebar.value
2727
+ }, [m(k(G), {
2725
2728
  size: 16,
2726
2729
  "stroke-width": 2
2727
- })], 12, Zr)) : u("", !0),
2728
- O(E).viewMode.value === "frequently-used" ? (S(), d("span", Qr, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(he, {
2730
+ })], 12, $r)) : u("", !0),
2731
+ k(E).viewMode.value === "frequently-used" ? (S(), d("span", ei, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2729
2732
  key: 2,
2730
- folders: O(E).folders.value,
2731
- "current-folder-id": O(E).currentFolderId.value,
2732
- onNavigate: O(E).navigateToFolder
2733
+ folders: k(E).folders.value,
2734
+ "current-folder-id": k(E).currentFolderId.value,
2735
+ onNavigate: k(E).navigateToFolder
2733
2736
  }, null, 8, [
2734
2737
  "folders",
2735
2738
  "current-folder-id",
2736
2739
  "onNavigate"
2737
2740
  ])),
2738
- f("div", $r, [f("button", {
2741
+ f("div", ti, [f("button", {
2739
2742
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2740
2743
  style: b({
2741
- color: O(k).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2742
- backgroundColor: O(k).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2744
+ color: k(O).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2745
+ backgroundColor: k(O).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2743
2746
  }),
2744
2747
  title: a.value.mediaLibrary.viewGrid,
2745
- onClick: n[2] ||= (e) => O(k).layoutMode.value = "grid"
2746
- }, [m(O(B), {
2748
+ onClick: n[2] ||= (e) => k(O).layoutMode.value = "grid"
2749
+ }, [m(k(V), {
2747
2750
  size: 14,
2748
2751
  "stroke-width": 2
2749
- })], 12, ei), f("button", {
2752
+ })], 12, ni), f("button", {
2750
2753
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2751
2754
  style: b({
2752
- color: O(k).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2753
- backgroundColor: O(k).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2755
+ color: k(O).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2756
+ backgroundColor: k(O).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2754
2757
  }),
2755
2758
  title: a.value.mediaLibrary.viewList,
2756
- onClick: n[3] ||= (e) => O(k).layoutMode.value = "list"
2757
- }, [m(O(H), {
2759
+ onClick: n[3] ||= (e) => k(O).layoutMode.value = "list"
2760
+ }, [m(k(U), {
2758
2761
  size: 14,
2759
2762
  "stroke-width": 2
2760
- })], 12, ti)])
2761
- ]), f("div", ni, [O(v).length > 1 ? (S(), d("select", {
2763
+ })], 12, ri)])
2764
+ ]), f("div", ii, [k(v).length > 1 ? (S(), d("select", {
2762
2765
  key: 0,
2763
2766
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
2764
2767
  style: {
@@ -2766,31 +2769,31 @@ var Br = {
2766
2769
  "background-color": "var(--tpl-bg)",
2767
2770
  color: "var(--tpl-text)"
2768
2771
  },
2769
- value: O(E).categoryFilter.value ?? "",
2770
- onChange: n[4] ||= (e) => O(E).filterByCategory(e.target.value || null)
2771
- }, [f("option", ii, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(O(v), (e) => (S(), d("option", {
2772
+ value: k(E).categoryFilter.value ?? "",
2773
+ onChange: n[4] ||= (e) => k(E).filterByCategory(e.target.value || null)
2774
+ }, [f("option", oi, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(v), (e) => (S(), d("option", {
2772
2775
  key: e,
2773
2776
  value: e
2774
- }, D(O(k).getCategoryLabel(e)), 9, ai))), 128))], 40, ri)) : u("", !0), f("select", {
2777
+ }, D(k(O).getCategoryLabel(e)), 9, si))), 128))], 40, ai)) : u("", !0), f("select", {
2775
2778
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
2776
2779
  style: {
2777
2780
  "border-color": "var(--tpl-border)",
2778
2781
  "background-color": "var(--tpl-bg)",
2779
2782
  color: "var(--tpl-text)"
2780
2783
  },
2781
- value: O(E).sortOption.value,
2782
- onChange: n[5] ||= (e) => O(E).sortBy(e.target.value)
2784
+ value: k(E).sortOption.value,
2785
+ onChange: n[5] ||= (e) => k(E).sortBy(e.target.value)
2783
2786
  }, [
2784
- f("option", si, D(a.value.mediaLibrary.sortNewest), 1),
2785
- f("option", ci, D(a.value.mediaLibrary.sortOldest), 1),
2786
- f("option", li, D(a.value.mediaLibrary.sortNameAsc), 1),
2787
- f("option", ui, D(a.value.mediaLibrary.sortNameDesc), 1),
2788
- f("option", di, D(a.value.mediaLibrary.sortSizeAsc), 1),
2789
- f("option", fi, D(a.value.mediaLibrary.sortSizeDesc), 1)
2790
- ], 40, oi)])]), f("div", pi, [O(E).viewMode.value === "files" ? (S(), d("div", mi, [m(Vn, {
2791
- "is-uploading": O(E).isUploading.value,
2792
- "upload-progress": O(E).uploadProgress.value,
2793
- onUpload: O(k).handleUpload
2787
+ f("option", li, D(a.value.mediaLibrary.sortNewest), 1),
2788
+ f("option", ui, D(a.value.mediaLibrary.sortOldest), 1),
2789
+ f("option", di, D(a.value.mediaLibrary.sortNameAsc), 1),
2790
+ f("option", fi, D(a.value.mediaLibrary.sortNameDesc), 1),
2791
+ f("option", pi, D(a.value.mediaLibrary.sortSizeAsc), 1),
2792
+ f("option", mi, D(a.value.mediaLibrary.sortSizeDesc), 1)
2793
+ ], 40, ci)])]), f("div", hi, [k(E).viewMode.value === "files" ? (S(), d("div", gi, [m(Un, {
2794
+ "is-uploading": k(E).isUploading.value,
2795
+ "upload-progress": k(E).uploadProgress.value,
2796
+ onUpload: k(O).handleUpload
2794
2797
  }, null, 8, [
2795
2798
  "is-uploading",
2796
2799
  "upload-progress",
@@ -2803,21 +2806,21 @@ var Br = {
2803
2806
  color: "var(--tpl-text-muted)",
2804
2807
  "background-color": "var(--tpl-bg)"
2805
2808
  },
2806
- onClick: n[6] ||= (e) => O(k).showImportUrlModal.value = !0
2807
- }, [m(O(V), {
2809
+ onClick: n[6] ||= (e) => k(O).showImportUrlModal.value = !0
2810
+ }, [m(k(H), {
2808
2811
  size: 14,
2809
2812
  "stroke-width": 2
2810
- }), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Kt, {
2811
- items: O(k).displayItems.value,
2812
- "selected-ids": O(E).selectedItems.value,
2813
- "is-loading": O(E).isLoading.value,
2814
- "has-more": O(E).viewMode.value === "files" && O(E).hasMore.value,
2815
- layout: O(k).layoutMode.value,
2816
- onSelect: O(k).handleSelect,
2817
- onToggle: O(E).toggleSelection,
2818
- onLoadMore: O(E).loadMore,
2819
- onEdit: O(k).handleEditItem,
2820
- onReplace: O(k).handleReplaceItem
2813
+ }), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Jt, {
2814
+ items: k(O).displayItems.value,
2815
+ "selected-ids": k(E).selectedItems.value,
2816
+ "is-loading": k(E).isLoading.value,
2817
+ "has-more": k(E).viewMode.value === "files" && k(E).hasMore.value,
2818
+ layout: k(O).layoutMode.value,
2819
+ onSelect: k(O).handleSelect,
2820
+ onToggle: k(E).toggleSelection,
2821
+ onLoadMore: k(E).loadMore,
2822
+ onEdit: k(O).handleEditItem,
2823
+ onReplace: k(O).handleReplaceItem
2821
2824
  }, null, 8, [
2822
2825
  "items",
2823
2826
  "selected-ids",
@@ -2830,36 +2833,36 @@ var Br = {
2830
2833
  "onEdit",
2831
2834
  "onReplace"
2832
2835
  ])])])]),
2833
- m(an, {
2834
- visible: O(k).showImportUrlModal.value,
2835
- "is-importing": O(E).isImportingFromUrl.value,
2836
- error: O(E).importFromUrlError.value,
2837
- onImport: O(k).handleImportFromUrl,
2838
- onClose: n[7] ||= (e) => O(k).showImportUrlModal.value = !1
2836
+ m(sn, {
2837
+ visible: k(O).showImportUrlModal.value,
2838
+ "is-importing": k(E).isImportingFromUrl.value,
2839
+ error: k(E).importFromUrlError.value,
2840
+ onImport: k(O).handleImportFromUrl,
2841
+ onClose: n[7] ||= (e) => k(O).showImportUrlModal.value = !1
2839
2842
  }, null, 8, [
2840
2843
  "visible",
2841
2844
  "is-importing",
2842
2845
  "error",
2843
2846
  "onImport"
2844
2847
  ]),
2845
- m(nt, {
2846
- visible: !!O(k).editingItem.value,
2847
- item: O(k).editingItem.value,
2848
- onSave: O(k).handleEditSave,
2849
- onClose: n[8] ||= (e) => O(k).editingItem.value = null
2848
+ m(it, {
2849
+ visible: !!k(O).editingItem.value,
2850
+ item: k(O).editingItem.value,
2851
+ onSave: k(O).handleEditSave,
2852
+ onClose: n[8] ||= (e) => k(O).editingItem.value = null
2850
2853
  }, null, 8, [
2851
2854
  "visible",
2852
2855
  "item",
2853
2856
  "onSave"
2854
2857
  ]),
2855
- m(In, {
2856
- visible: O(E).showReplaceWarning.value,
2857
- item: O(E).pendingReplaceItem.value,
2858
- "usage-info": O(E).replaceUsageInfo.value,
2859
- "is-replacing": O(E).isReplacing.value,
2860
- error: O(E).replaceError.value,
2861
- onReplace: O(k).handleReplaceFile,
2862
- onClose: O(E).cancelReplace
2858
+ m(Rn, {
2859
+ visible: k(E).showReplaceWarning.value,
2860
+ item: k(E).pendingReplaceItem.value,
2861
+ "usage-info": k(E).replaceUsageInfo.value,
2862
+ "is-replacing": k(E).isReplacing.value,
2863
+ error: k(E).replaceError.value,
2864
+ onReplace: k(O).handleReplaceFile,
2865
+ onClose: k(E).cancelReplace
2863
2866
  }, null, 8, [
2864
2867
  "visible",
2865
2868
  "item",
@@ -2877,7 +2880,7 @@ var Br = {
2877
2880
  "leave-from-class": "tpl:opacity-100",
2878
2881
  "leave-to-class": "tpl:opacity-0"
2879
2882
  }, {
2880
- default: j(() => [O(E).showDeleteWarning.value ? (S(), d("div", {
2883
+ default: M(() => [k(E).showDeleteWarning.value ? (S(), d("div", {
2881
2884
  key: 0,
2882
2885
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
2883
2886
  style: {
@@ -2885,27 +2888,27 @@ var Br = {
2885
2888
  "backdrop-filter": "blur(8px)",
2886
2889
  "-webkit-backdrop-filter": "blur(8px)"
2887
2890
  },
2888
- onClick: n[11] ||= P((...e) => O(E).cancelDelete && O(E).cancelDelete(...e), ["self"])
2889
- }, [f("div", hi, [
2890
- f("h3", gi, D(a.value.mediaLibrary.deleteWarningTitle), 1),
2891
+ onClick: n[11] ||= F((...e) => k(E).cancelDelete && k(E).cancelDelete(...e), ["self"])
2892
+ }, [f("div", _i, [
2893
+ f("h3", vi, D(a.value.mediaLibrary.deleteWarningTitle), 1),
2891
2894
  f("p", {
2892
- class: y(["tpl:text-xs", O(k).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2895
+ class: y(["tpl:text-xs", k(O).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2893
2896
  style: { color: "var(--tpl-text-muted)" }
2894
2897
  }, D(a.value.mediaLibrary.deleteWarningMessage), 3),
2895
- O(k).hasUsedFiles.value ? (S(), d("p", _i, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2896
- O(k).hasUsedFiles.value ? (S(), d("div", vi, [(S(!0), d(i, null, T(O(E).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2898
+ k(O).hasUsedFiles.value ? (S(), d("p", yi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2899
+ k(O).hasUsedFiles.value ? (S(), d("div", bi, [(S(!0), d(i, null, T(k(E).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2897
2900
  key: t,
2898
2901
  class: "tpl:text-xs",
2899
2902
  style: { color: "var(--tpl-text)" }
2900
- }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", yi, D(O(k).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", bi, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2901
- f("div", xi, [f("button", {
2903
+ }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", xi, D(k(O).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Si, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2904
+ f("div", Ci, [f("button", {
2902
2905
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2903
2906
  style: {
2904
2907
  "border-color": "var(--tpl-border)",
2905
2908
  color: "var(--tpl-text)",
2906
2909
  "background-color": "var(--tpl-bg)"
2907
2910
  },
2908
- onClick: n[9] ||= (...e) => O(E).cancelDelete && O(E).cancelDelete(...e)
2911
+ onClick: n[9] ||= (...e) => k(E).cancelDelete && k(E).cancelDelete(...e)
2909
2912
  }, D(a.value.mediaLibrary.cancel), 1), f("button", {
2910
2913
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2911
2914
  style: {
@@ -2913,57 +2916,57 @@ var Br = {
2913
2916
  color: "var(--tpl-danger)",
2914
2917
  "background-color": "var(--tpl-danger-light)"
2915
2918
  },
2916
- onClick: n[10] ||= (...e) => O(E).confirmDelete && O(E).confirmDelete(...e)
2917
- }, D(O(k).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
2919
+ onClick: n[10] ||= (...e) => k(E).confirmDelete && k(E).confirmDelete(...e)
2920
+ }, D(k(O).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
2918
2921
  ])])) : u("", !0)]),
2919
2922
  _: 1
2920
2923
  }),
2921
- f("div", Si, [f("div", Ci, [O(E).previewItem.value ? (S(), l(xn, {
2924
+ f("div", wi, [f("div", Ti, [k(E).previewItem.value ? (S(), l(Cn, {
2922
2925
  key: 0,
2923
- "selected-conversion": O(k).selectedConversion.value,
2924
- "onUpdate:selectedConversion": n[12] ||= (e) => O(k).selectedConversion.value = e,
2925
- item: O(E).previewItem.value,
2926
- folders: O(E).folders.value
2926
+ "selected-conversion": k(O).selectedConversion.value,
2927
+ "onUpdate:selectedConversion": n[12] ||= (e) => k(O).selectedConversion.value = e,
2928
+ item: k(E).previewItem.value,
2929
+ folders: k(E).folders.value
2927
2930
  }, null, 8, [
2928
2931
  "selected-conversion",
2929
2932
  "item",
2930
2933
  "folders"
2931
- ])) : u("", !0)]), f("div", wi, [O(E).selectedItems.value.size > 0 ? (S(), d("div", Ti, [O(E).previewItem.value ? (S(), d("button", {
2934
+ ])) : u("", !0)]), f("div", Ei, [k(E).selectedItems.value.size > 0 ? (S(), d("div", Di, [k(E).previewItem.value ? (S(), d("button", {
2932
2935
  key: 0,
2933
2936
  class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2934
2937
  style: b({
2935
- borderColor: O(k).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2936
- color: O(k).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2938
+ borderColor: k(O).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2939
+ color: k(O).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2937
2940
  backgroundColor: "var(--tpl-bg)"
2938
2941
  }),
2939
- onClick: n[13] ||= (e) => O(k).copy(O(k).selectedUrl.value)
2940
- }, [O(k).copied.value ? (S(), l(O(F), {
2942
+ onClick: n[13] ||= (e) => k(O).copy(k(O).selectedUrl.value)
2943
+ }, [k(O).copied.value ? (S(), l(k(I), {
2941
2944
  key: 1,
2942
2945
  size: 12,
2943
2946
  "stroke-width": 2
2944
- })) : (S(), l(O(L), {
2947
+ })) : (S(), l(k(R), {
2945
2948
  key: 0,
2946
2949
  size: 12,
2947
2950
  "stroke-width": 2
2948
- })), p(" " + D(O(k).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), c.value ? (S(), d("div", Ei, [f("button", {
2951
+ })), p(" " + D(k(O).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), c.value ? (S(), d("div", Oi, [f("button", {
2949
2952
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2950
2953
  style: {
2951
2954
  "border-color": "var(--tpl-border)",
2952
2955
  color: "var(--tpl-text)",
2953
2956
  "background-color": "var(--tpl-bg)"
2954
2957
  },
2955
- onClick: n[14] ||= (e) => O(k).showMovePicker.value = !O(k).showMovePicker.value
2956
- }, D(a.value.mediaLibrary.moveSelected), 1), O(k).showMovePicker.value ? (S(), l(un, {
2958
+ onClick: n[14] ||= (e) => k(O).showMovePicker.value = !k(O).showMovePicker.value
2959
+ }, D(a.value.mediaLibrary.moveSelected), 1), k(O).showMovePicker.value ? (S(), l(fn, {
2957
2960
  key: 0,
2958
- folders: O(E).folders.value,
2959
- "current-folder-id": O(E).currentFolderId.value,
2960
- onSelect: O(k).handleMoveToFolder,
2961
- onClose: n[15] ||= (e) => O(k).showMovePicker.value = !1
2961
+ folders: k(E).folders.value,
2962
+ "current-folder-id": k(E).currentFolderId.value,
2963
+ onSelect: k(O).handleMoveToFolder,
2964
+ onClose: n[15] ||= (e) => k(O).showMovePicker.value = !1
2962
2965
  }, null, 8, [
2963
2966
  "folders",
2964
2967
  "current-folder-id",
2965
2968
  "onSelect"
2966
- ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Di, [O(E).selectedItems.value.size > 0 ? (S(), d("button", {
2969
+ ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", ki, [k(E).selectedItems.value.size > 0 ? (S(), d("button", {
2967
2970
  key: 0,
2968
2971
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2969
2972
  style: {
@@ -2971,7 +2974,7 @@ var Br = {
2971
2974
  color: "var(--tpl-danger)",
2972
2975
  "background-color": "var(--tpl-danger-light)"
2973
2976
  },
2974
- onClick: n[16] ||= (...e) => O(k).handleDeleteClick && O(k).handleDeleteClick(...e)
2977
+ onClick: n[16] ||= (...e) => k(O).handleDeleteClick && k(O).handleDeleteClick(...e)
2975
2978
  }, D(a.value.mediaLibrary.deleteSelected), 1)) : u("", !0), e.onSelect ? (S(), d("button", {
2976
2979
  key: 1,
2977
2980
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
@@ -2979,53 +2982,68 @@ var Br = {
2979
2982
  "background-color": "var(--tpl-primary)",
2980
2983
  color: "var(--tpl-bg)"
2981
2984
  },
2982
- disabled: !O(E).previewItem.value,
2985
+ disabled: !k(E).previewItem.value,
2983
2986
  onClick: A
2984
- }, D(a.value.mediaLibrary.selectFile), 9, Oi)) : u("", !0)])])])
2987
+ }, D(a.value.mediaLibrary.selectFile), 9, Ai)) : u("", !0)])])])
2985
2988
  ]));
2986
2989
  }
2987
- }), Ai = (e, t, n) => {
2990
+ }), Mi = (e, t, n) => {
2988
2991
  let r = t.lastIndexOf("?"), i = e[r === -1 || r < t.lastIndexOf("/") ? t : t.slice(0, r)];
2989
2992
  return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((e, r) => {
2990
2993
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ Error("Unknown variable dynamic import: " + t + (t.split("/").length === n ? "" : ". Note that variables only represent file names one level deep."))));
2991
2994
  });
2992
- }, ji = ["en", "de"];
2993
- function Mi(e) {
2994
- return e.split("-")[0].toLowerCase();
2995
+ }, Ni = [
2996
+ "en",
2997
+ "de",
2998
+ "pt-BR"
2999
+ ];
3000
+ function Pi(e) {
3001
+ return e.trim().replace(/_/g, "-").toLowerCase();
3002
+ }
3003
+ function Fi(e) {
3004
+ let t = Pi(e);
3005
+ return Ni.find((e) => Pi(e) === t);
3006
+ }
3007
+ function Ii(e) {
3008
+ return Pi(e).split("-")[0];
3009
+ }
3010
+ function Li(e) {
3011
+ return Fi(e) ?? Fi(Ii(e)) ?? "en";
2995
3012
  }
2996
- async function Ni(e) {
2997
- let t = Mi(e), n = ji.includes(t) ? t : "en";
2998
- return (await Ai(/* @__PURE__ */ Object.assign({
3013
+ async function Ri(e) {
3014
+ let t = Li(e);
3015
+ return (await Mi(/* @__PURE__ */ Object.assign({
2999
3016
  "./locales/de.ts": () => import("./de-BULkjF_s.js"),
3000
- "./locales/en.ts": () => import("./en-ivlOqPuR.js")
3001
- }), `./locales/${n}.ts`, 3)).default;
3017
+ "./locales/en.ts": () => import("./en-ivlOqPuR.js"),
3018
+ "./locales/pt-BR.ts": () => import("./pt-BR-T5mPyHbx.js")
3019
+ }), `./locales/${t}.ts`, 3)).default;
3002
3020
  }
3003
3021
  //#endregion
3004
3022
  //#region src/standalone/visual.ts
3005
- var $ = null, Pi = w(null);
3006
- async function Fi(e) {
3023
+ var $ = null, zi = w(null);
3024
+ async function Bi(e) {
3007
3025
  let n = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
3008
3026
  if (!n) throw Error(`Container element not found: ${e.container}`);
3009
3027
  let i = r(e.auth, e.onError);
3010
3028
  await i.initialize();
3011
- let a = await new t(i).fetchConfig(), o = await Ni(e.locale ?? "en");
3012
- return Li(n, e.theme), $ && Ii(), new Promise((t, r) => {
3029
+ let a = await new t(i).fetchConfig(), o = await Ri(e.locale ?? "en");
3030
+ return Hi(n, e.theme), $ && Vi(), new Promise((t, r) => {
3013
3031
  try {
3014
3032
  $ = c({ setup() {
3015
3033
  let r = () => {
3016
3034
  t({
3017
- setTheme: (e) => Li(n, e),
3018
- unmount: Ii
3035
+ setTheme: (e) => Hi(n, e),
3036
+ unmount: Vi
3019
3037
  });
3020
3038
  };
3021
- return () => g(ki, {
3039
+ return () => g(ji, {
3022
3040
  authManager: i,
3023
3041
  projectId: i.projectId,
3024
3042
  planConfig: a,
3025
3043
  translations: o,
3026
3044
  onSelect: e.onSelect,
3027
3045
  onError: e.onError,
3028
- ref: Pi,
3046
+ ref: zi,
3029
3047
  onReady: r
3030
3048
  });
3031
3049
  } }), $.mount(n);
@@ -3034,15 +3052,15 @@ async function Fi(e) {
3034
3052
  }
3035
3053
  });
3036
3054
  }
3037
- function Ii() {
3038
- $ && ($.unmount(), $ = null, Pi.value = null);
3055
+ function Vi() {
3056
+ $ && ($.unmount(), $ = null, zi.value = null);
3039
3057
  }
3040
- function Li(e, t) {
3058
+ function Hi(e, t) {
3041
3059
  t && (t.primaryColor && e.style.setProperty("--tpl-primary", t.primaryColor), t.borderRadius !== void 0 && (e.style.setProperty("--tpl-radius", `${t.borderRadius}px`), e.style.setProperty("--tpl-radius-sm", `${Math.max(0, t.borderRadius - 3)}px`), e.style.setProperty("--tpl-radius-lg", `${t.borderRadius + 4}px`)));
3042
3060
  }
3043
3061
  typeof window < "u" && (window.TemplaticalMedia = {
3044
- init: Fi,
3045
- unmount: Ii
3062
+ init: Bi,
3063
+ unmount: Vi
3046
3064
  });
3047
3065
  //#endregion
3048
- export { ue as MediaApiClient, Rr as MediaLibraryModal, Fi as init, Ii as unmount, Z as useI18n, Q as useMediaCategories, de as useMediaLibrary, zr as useMediaPicker };
3066
+ export { de as MediaApiClient, Br as MediaLibraryModal, Bi as init, Vi as unmount, Z as useI18n, Q as useMediaCategories, fe as useMediaLibrary, Vr as useMediaPicker };