@templatical/media-library 0.26.3 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,17 @@
1
1
  import { API_ROUTES as e, ApiClient as t, buildUrl as n, createSdkAuthManager as r } from "@templatical/core/cloud";
2
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
- //#region src/api-client.ts
7
- var de = class {
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 ee, Search as J, Star as te, Trash2 as Y, Upload as ne, X as re } from "@lucide/vue";
4
+ import { Cropper as ie } from "vue-advanced-cropper";
5
+ import { onClickOutside as ae, useClipboard as oe, useDebounceFn as se, useDropZone as ce, useEventListener as le, useFileDialog as ue, useIntersectionObserver as de } from "@vueuse/core";
6
+ //#region \0rolldown/runtime.js
7
+ var fe = Object.defineProperty, pe = (e, t) => {
8
+ let n = {};
9
+ for (var r in e) fe(n, r, {
10
+ get: e[r],
11
+ enumerable: !0
12
+ });
13
+ return t || fe(n, Symbol.toStringTag, { value: "Module" }), n;
14
+ }, me = class {
8
15
  authManager;
9
16
  constructor(e) {
10
17
  this.authManager = e;
@@ -161,9 +168,9 @@ var de = class {
161
168
  };
162
169
  //#endregion
163
170
  //#region src/composable.ts
164
- function fe(e) {
171
+ function he(e) {
165
172
  if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
166
- 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;
173
+ let t = new me(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;
167
174
  async function k() {
168
175
  let r = ++O;
169
176
  l.value = !0;
@@ -326,50 +333,50 @@ function fe(e) {
326
333
  function q() {
327
334
  m.value = /* @__PURE__ */ new Set(), h.value = null;
328
335
  }
329
- function J(e) {
336
+ function ee(e) {
330
337
  h.value = e, m.value = /* @__PURE__ */ new Set([e.id]);
331
338
  }
332
- async function Y() {
339
+ async function J() {
333
340
  try {
334
341
  r.value = await t.getMediaFolders();
335
342
  } catch (t) {
336
343
  e.onError?.(t);
337
344
  }
338
345
  }
339
- async function ee(n, r) {
346
+ async function te(n, r) {
340
347
  try {
341
348
  let e = await t.createMediaFolder(n, r);
342
- return await Y(), e;
349
+ return await J(), e;
343
350
  } catch (t) {
344
351
  return e.onError?.(t), null;
345
352
  }
346
353
  }
347
- function X(e, t) {
354
+ function Y(e, t) {
348
355
  for (let n of e) {
349
356
  if (n.id === t) return n;
350
357
  if (n.children) {
351
- let e = X(n.children, t);
358
+ let e = Y(n.children, t);
352
359
  if (e) return e;
353
360
  }
354
361
  }
355
362
  return null;
356
363
  }
357
- async function te(n, r) {
364
+ async function ne(n, r) {
358
365
  try {
359
- await t.renameMediaFolder(n, r), await Y();
366
+ await t.renameMediaFolder(n, r), await J();
360
367
  } catch (t) {
361
368
  e.onError?.(t);
362
369
  }
363
370
  }
364
- async function ne(n) {
371
+ async function re(n) {
365
372
  try {
366
- let e = X(r.value, n)?.parent_id ?? null;
367
- await t.deleteMediaFolder(n), i.value === n && (i.value = e), await Y(), await k();
373
+ let e = Y(r.value, n)?.parent_id ?? null;
374
+ await t.deleteMediaFolder(n), i.value === n && (i.value = e), await J(), await k();
368
375
  } catch (t) {
369
376
  e.onError?.(t);
370
377
  }
371
378
  }
372
- async function re(n) {
379
+ async function ie(n) {
373
380
  E.value = n, C.value = null;
374
381
  try {
375
382
  let e = await t.checkMediaUsage([n.id]);
@@ -378,10 +385,10 @@ function fe(e) {
378
385
  e.onError?.(t);
379
386
  }
380
387
  }
381
- function ie() {
388
+ function ae() {
382
389
  T.value = !1, E.value = null, D.value = null, C.value = null;
383
390
  }
384
- async function ae(r) {
391
+ async function oe(r) {
385
392
  if (!E.value) return null;
386
393
  S.value = !0, C.value = null;
387
394
  try {
@@ -393,7 +400,7 @@ function fe(e) {
393
400
  S.value = !1;
394
401
  }
395
402
  }
396
- async function oe(r, i) {
403
+ async function se(r, i) {
397
404
  try {
398
405
  let e = await t.replaceMedia(r, i);
399
406
  return n.value = n.value.map((t) => t.id === e.id ? e : t), g.value = g.value.map((t) => t.id === e.id ? e : t), h.value?.id === e.id && (h.value = e), e;
@@ -435,12 +442,12 @@ function fe(e) {
435
442
  importFromUrl: G,
436
443
  toggleSelection: K,
437
444
  clearSelection: q,
438
- selectItem: J,
439
- loadFolders: Y,
440
- createFolder: ee,
441
- renameFolder: te,
442
- deleteFolder: ne,
443
- findFolderInTree: X,
445
+ selectItem: ee,
446
+ loadFolders: J,
447
+ createFolder: te,
448
+ renameFolder: ne,
449
+ deleteFolder: re,
450
+ findFolderInTree: Y,
444
451
  loadFrequentlyUsed: V,
445
452
  checkUsageBeforeDelete: H,
446
453
  confirmDelete: U,
@@ -450,16 +457,102 @@ function fe(e) {
450
457
  showReplaceWarning: T,
451
458
  pendingReplaceItem: E,
452
459
  replaceUsageInfo: D,
453
- checkUsageBeforeReplace: re,
454
- cancelReplace: ie,
455
- replaceFile: ae,
456
- replaceMediaDirectly: oe
460
+ checkUsageBeforeReplace: ie,
461
+ cancelReplace: ae,
462
+ replaceFile: oe,
463
+ replaceMediaDirectly: se
457
464
  };
458
465
  }
459
466
  //#endregion
467
+ //#region src/keys.ts
468
+ var ge = Symbol("templaticalMediaPlanConfig"), _e = Symbol("templaticalMediaPopoverTarget"), ve = Symbol("templaticalMediaTranslations"), ye = Symbol("templaticalMediaUiTheme"), be = /* @__PURE__ */ pe({ default: () => xe }), xe = { mediaLibrary: {
469
+ title: "Media Library",
470
+ searchPlaceholder: "Search files...",
471
+ allFiles: "All Files",
472
+ filterAll: "All Types",
473
+ filterImages: "Images",
474
+ filterDocuments: "Documents",
475
+ filterVideos: "Videos",
476
+ filterAudio: "Audio",
477
+ newFolder: "New Folder",
478
+ folderName: "Folder name",
479
+ noFiles: "No files found",
480
+ dropOrClick: "Drop files here or click to upload",
481
+ acceptedFormats: "Images, PDF, Video, Audio, Documents (max 10MB)",
482
+ uploading: "Uploading...",
483
+ uploadingProgress: "Uploading {current} of {total}...",
484
+ selectImage: "Select Image",
485
+ selectFile: "Select File",
486
+ deleteSelected: "Delete",
487
+ copyUrl: "Copy URL",
488
+ copied: "Copied!",
489
+ browseMedia: "Browse Media Library",
490
+ renameFolder: "Rename folder",
491
+ addSubfolder: "Add subfolder",
492
+ subfolderName: "Subfolder name",
493
+ sortNewest: "Newest First",
494
+ sortOldest: "Oldest First",
495
+ sortNameAsc: "Name A-Z",
496
+ sortNameDesc: "Name Z-A",
497
+ sortSizeAsc: "Smallest First",
498
+ sortSizeDesc: "Largest First",
499
+ moveSelected: "Move",
500
+ moveToRoot: "All Files",
501
+ currentFolder: "(current)",
502
+ confirmDelete: "Confirm?",
503
+ renameFile: "Rename",
504
+ editFile: "Edit File",
505
+ fileName: "Filename",
506
+ altText: "Alt Text",
507
+ altTextPlaceholder: "Describe this image for accessibility",
508
+ saveChanges: "Save",
509
+ cancel: "Cancel",
510
+ frequentlyUsed: "Frequently Used",
511
+ deleteWarningTitle: "Delete File",
512
+ deleteWarningMessage: "Are you sure? This action is irreversible.",
513
+ deleteWarningUsageNote: "The following files are used in templates. Deleting them may break those templates.",
514
+ deleteAnyway: "Delete",
515
+ usedInTemplates: "Used in {count} template(s)",
516
+ viewGrid: "Grid view",
517
+ viewList: "List view",
518
+ showFolders: "Show folders",
519
+ hideFolders: "Hide folders",
520
+ importFromUrl: "Import from URL",
521
+ importUrlPlaceholder: "https://example.com/image.jpg",
522
+ import: "Import",
523
+ importing: "Importing...",
524
+ importError: "Failed to import from URL",
525
+ conversionLabel: "Size",
526
+ conversionOriginal: "Original",
527
+ conversionSmall: "Small (150px)",
528
+ conversionMedium: "Medium (600px)",
529
+ conversionLarge: "Large (1200px)",
530
+ replaceFile: "Replace File",
531
+ replaceWarningTitle: "Replace File",
532
+ replaceWarningMessage: "You are about to replace this file. The replacement must have the same file extension ({extension}).",
533
+ replaceWarningUsageNote: "This file is used in {count} template(s). Replacing it will update all references.",
534
+ replaceSelectFile: "Select replacement file",
535
+ replace: "Replace",
536
+ replacing: "Replacing...",
537
+ replaceError: "Failed to replace file",
538
+ saving: "Saving...",
539
+ cropAspectRatio: "Aspect Ratio",
540
+ cropFree: "Free",
541
+ cropSquare: "1:1",
542
+ cropLandscape43: "4:3",
543
+ cropLandscape169: "16:9",
544
+ cropOriginal: "Original",
545
+ cropMaxWidth: "Max Width",
546
+ cropMaxHeight: "Max Height",
547
+ cropOutputSize: "Output Size",
548
+ cropPixels: "px",
549
+ cropOptional: "(optional)",
550
+ storageTooltip: "{used} of {total} used ({remaining} remaining)"
551
+ } };
552
+ //#endregion
460
553
  //#region src/composables/useI18n.ts
461
- function Z(e) {
462
- let t = e ?? _("translations"), n = v(t) ? t.value : t;
554
+ function X(e) {
555
+ let t = e ?? _(ve, null), n = (v(t) ? t.value : t) ?? xe;
463
556
  function r(e, t) {
464
557
  return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
465
558
  }
@@ -470,14 +563,14 @@ function Z(e) {
470
563
  }
471
564
  //#endregion
472
565
  //#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
473
- var pe = {
566
+ var Se = {
474
567
  key: 0,
475
568
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
476
569
  style: { color: "var(--tpl-text-muted)" }
477
- }, me = ["onClick"], he = {
570
+ }, Ce = ["onClick"], we = {
478
571
  key: 1,
479
572
  style: { color: "var(--tpl-text)" }
480
- }, ge = /* @__PURE__ */ h({
573
+ }, Te = /* @__PURE__ */ h({
481
574
  __name: "MediaBreadcrumb",
482
575
  props: {
483
576
  folders: {},
@@ -485,7 +578,7 @@ var pe = {
485
578
  },
486
579
  emits: ["navigate"],
487
580
  setup(e, { emit: t }) {
488
- let n = e, r = t, { t: a } = Z(), o = s(() => {
581
+ let n = e, r = t, { t: a } = X(), o = s(() => {
489
582
  if (!n.currentFolderId) return [];
490
583
  let e = [];
491
584
  return c(n.folders, n.currentFolderId, e), e;
@@ -497,7 +590,7 @@ var pe = {
497
590
  }
498
591
  return !1;
499
592
  }
500
- return (e, t) => o.value.length > 0 ? (S(), d("div", pe, [f("button", {
593
+ return (e, t) => o.value.length > 0 ? (S(), d("div", Se, [f("button", {
501
594
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
502
595
  style: { color: "var(--tpl-primary)" },
503
596
  onClick: t[0] ||= (e) => r("navigate", null)
@@ -509,45 +602,47 @@ var pe = {
509
602
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
510
603
  style: { color: "var(--tpl-primary)" },
511
604
  onClick: (t) => r("navigate", e.id)
512
- }, D(e.name), 9, me)) : (S(), d("span", he, D(e.name), 1))], 64))), 128))])) : u("", !0);
605
+ }, D(e.name), 9, Ce)) : (S(), d("span", we, D(e.name), 1))], 64))), 128))])) : u("", !0);
513
606
  }
514
607
  });
515
608
  //#endregion
516
609
  //#region src/composables/useMediaCategories.ts
517
- function Q() {
518
- let e = _("planConfig"), t = s(() => e.config.value?.media ?? null), n = s(() => t.value?.use_media_library ?? !0), r = s(() => t.value?.categories ?? null), i = s(() => r.value ? Object.values(r.value).flatMap((e) => e.mime_types) : []), a = s(() => i.value.join(",")), o = s(() => t.value?.max_file_size ?? 0);
519
- function c(e, t) {
520
- return r.value ? !t || t.length === 0 ? i.value.includes(e) : t.some((t) => r.value[t]?.mime_types.includes(e)) : !1;
521
- }
522
- function l(e) {
523
- return r.value ? r.value.images?.mime_types.includes(e) ?? !1 : !1;
610
+ function Z(e) {
611
+ let t = e ?? _(ge, null);
612
+ if (!t) throw Error("[Templatical] useMediaCategories() needs a plan config in scope. Render it under <MediaLibraryModal> (pass its `planConfig` prop) or provide PLAN_CONFIG_KEY yourself.");
613
+ let n = s(() => t.config.value?.media ?? null), r = s(() => n.value?.use_media_library ?? !0), i = s(() => n.value?.categories ?? null), a = s(() => i.value ? Object.values(i.value).flatMap((e) => e.mime_types) : []), o = s(() => a.value.join(",")), c = s(() => n.value?.max_file_size ?? 0);
614
+ function l(e, t) {
615
+ return i.value ? !t || t.length === 0 ? a.value.includes(e) : t.some((t) => i.value[t]?.mime_types.includes(e)) : !1;
524
616
  }
525
617
  function u(e) {
526
- if (!r.value) return null;
527
- for (let [t, n] of Object.entries(r.value)) if (n.mime_types.includes(e)) return t;
618
+ return i.value ? i.value.images?.mime_types.includes(e) ?? !1 : !1;
619
+ }
620
+ function d(e) {
621
+ if (!i.value) return null;
622
+ for (let [t, n] of Object.entries(i.value)) if (n.mime_types.includes(e)) return t;
528
623
  return null;
529
624
  }
530
625
  return {
531
- isMediaLibraryEnabled: n,
532
- allAcceptedMimeTypes: i,
533
- allAcceptedInputString: a,
534
- maxFileSize: o,
535
- availableCategories: s(() => r.value ? Object.keys(r.value) : []),
536
- isAcceptedMimeType: c,
537
- isImageMimeType: l,
538
- getCategoryForMimeType: u
626
+ isMediaLibraryEnabled: r,
627
+ allAcceptedMimeTypes: a,
628
+ allAcceptedInputString: o,
629
+ maxFileSize: c,
630
+ availableCategories: s(() => i.value ? Object.keys(i.value) : []),
631
+ isAcceptedMimeType: l,
632
+ isImageMimeType: u,
633
+ getCategoryForMimeType: d
539
634
  };
540
635
  }
541
636
  //#endregion
542
637
  //#region src/composables/useImageCrop.ts
543
- var _e = {
638
+ var Ee = {
544
639
  free: void 0,
545
640
  square: 1,
546
641
  landscape43: 4 / 3,
547
642
  landscape169: 16 / 9,
548
643
  original: void 0
549
644
  };
550
- function ve(e) {
645
+ function De(e) {
551
646
  return e === "image/png" || e === "image/gif" ? {
552
647
  mimeType: "image/png",
553
648
  quality: 1
@@ -559,7 +654,7 @@ function ve(e) {
559
654
  quality: .92
560
655
  };
561
656
  }
562
- function ye(e, t, n) {
657
+ function Oe(e, t, n) {
563
658
  let r = e.width, i = e.height;
564
659
  if (!t && !n) return e;
565
660
  let a = r, o = i;
@@ -573,7 +668,7 @@ function ye(e, t, n) {
573
668
  let c = s.getContext("2d");
574
669
  return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
575
670
  }
576
- function be(e, t, n) {
671
+ function ke(e, t, n) {
577
672
  return new Promise((r, i) => {
578
673
  e.toBlob((e) => {
579
674
  if (!e) {
@@ -585,7 +680,7 @@ function be(e, t, n) {
585
680
  }, n.mimeType, n.quality);
586
681
  });
587
682
  }
588
- function xe(e, t, n, r) {
683
+ function Ae(e, t, n, r) {
589
684
  let i = e, a = t;
590
685
  if (n && i > n) {
591
686
  let e = n / i;
@@ -601,58 +696,58 @@ function xe(e, t, n, r) {
601
696
  };
602
697
  }
603
698
  //#endregion
604
- //#region src/keys.ts
605
- var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Te = {
699
+ //#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
700
+ var je = ["data-tpl-theme"], Me = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ne = {
606
701
  class: "tpl:text-sm tpl:font-semibold",
607
702
  style: { color: "var(--tpl-text)" }
608
- }, Ee = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, De = {
703
+ }, Pe = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Fe = {
609
704
  key: 0,
610
705
  class: "tpl:mb-4"
611
- }, Oe = {
706
+ }, Ie = {
612
707
  class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
613
708
  style: {
614
709
  "border-color": "var(--tpl-border)",
615
710
  height: "300px",
616
711
  "background-color": "var(--tpl-bg)"
617
712
  }
618
- }, ke = { class: "tpl:space-y-3" }, Ae = {
713
+ }, Le = { class: "tpl:space-y-3" }, Re = {
619
714
  class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
620
715
  style: { color: "var(--tpl-text-muted)" }
621
- }, 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 = {
716
+ }, ze = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Be = ["onClick"], Ve = { class: "tpl:flex tpl:gap-3" }, He = { class: "tpl:flex-1" }, Ue = {
622
717
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
623
718
  style: { color: "var(--tpl-text-muted)" }
624
- }, Ie = {
719
+ }, We = {
625
720
  class: "tpl:font-normal",
626
721
  style: { color: "var(--tpl-text-dim)" }
627
- }, Le = { class: "tpl:relative" }, Re = ["value", "placeholder"], ze = {
722
+ }, Ge = { class: "tpl:relative" }, Ke = ["value", "placeholder"], qe = {
628
723
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
629
724
  style: { color: "var(--tpl-text-dim)" }
630
- }, Be = { class: "tpl:flex-1" }, Ve = {
725
+ }, Je = { class: "tpl:flex-1" }, Ye = {
631
726
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
632
727
  style: { color: "var(--tpl-text-muted)" }
633
- }, He = {
728
+ }, Xe = {
634
729
  class: "tpl:font-normal",
635
730
  style: { color: "var(--tpl-text-dim)" }
636
- }, Ue = { class: "tpl:relative" }, We = ["value", "placeholder"], Ge = {
731
+ }, Ze = { class: "tpl:relative" }, Qe = ["value", "placeholder"], $e = {
637
732
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
638
733
  style: { color: "var(--tpl-text-dim)" }
639
- }, Ke = {
734
+ }, et = {
640
735
  key: 0,
641
736
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
642
737
  style: { color: "var(--tpl-text-muted)" }
643
- }, qe = {
738
+ }, tt = {
644
739
  class: "tpl:font-medium",
645
740
  style: { color: "var(--tpl-text)" }
646
- }, Je = { class: "tpl:mb-3" }, Ye = {
741
+ }, nt = { class: "tpl:mb-3" }, rt = {
647
742
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
648
743
  style: { color: "var(--tpl-text-muted)" }
649
- }, Xe = ["autofocus"], Ze = {
744
+ }, it = ["autofocus"], at = {
650
745
  key: 1,
651
746
  class: "tpl:mb-4"
652
- }, Qe = {
747
+ }, ot = {
653
748
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
654
749
  style: { color: "var(--tpl-text-muted)" }
655
- }, $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({
750
+ }, st = ["placeholder"], ct = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, lt = ["disabled"], ut = /*@__PURE__*/ h({
656
751
  __name: "MediaEditModal",
657
752
  props: {
658
753
  visible: { type: Boolean },
@@ -660,33 +755,33 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
660
755
  },
661
756
  emits: ["save", "close"],
662
757
  setup(e, { emit: t }) {
663
- 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 ? [
758
+ let n = e, r = t, { t: c } = X(), h = _(ye, null), g = _(_e, w(null)), v = c.mediaLibrary, { isImageMimeType: x } = Z(), 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 ? [
664
759
  "image/jpeg",
665
760
  "image/png",
666
761
  "image/webp",
667
762
  "image/gif"
668
- ].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);
763
+ ].includes(n.item.mime_type) : !1), K = s(() => P.value === "original" ? B.value : Ee[P.value]), q = s(() => V.value ? Ae(V.value.width, V.value.height, I.value, L.value) : null);
669
764
  j(() => n.visible, (e) => {
670
765
  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));
671
766
  });
672
- function J(e) {
767
+ function ee(e) {
673
768
  e.coordinates && (V.value = {
674
769
  width: Math.round(e.coordinates.width),
675
770
  height: Math.round(e.coordinates.height)
676
771
  }, W.value = !0);
677
772
  }
678
- function Y() {
773
+ function J() {
679
774
  H.value = !0, !B.value && n.item?.width && n.item?.height && (B.value = n.item.width / n.item.height);
680
775
  }
681
- function ee(e) {
776
+ function te(e) {
682
777
  let t = e.target.value;
683
778
  R.value = t, I.value = t && parseInt(t, 10) || void 0;
684
779
  }
685
- function X(e) {
780
+ function Y(e) {
686
781
  let t = e.target.value;
687
782
  z.value = t, L.value = t && parseInt(t, 10) || void 0;
688
783
  }
689
- async function te() {
784
+ async function ne() {
690
785
  let e = C.value.trim();
691
786
  if (!e || !n.item || U.value) return;
692
787
  let t = x(n.item.mime_type), i;
@@ -695,8 +790,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
695
790
  try {
696
791
  let { canvas: e } = O.value.getResult();
697
792
  if (e) {
698
- let t = ye(e, I.value, L.value), r = ve(n.item.mime_type);
699
- i = { file: await be(t, n.item.filename, r) };
793
+ let t = Oe(e, I.value, L.value), r = De(n.item.mime_type);
794
+ i = { file: await ke(t, n.item.filename, r) };
700
795
  }
701
796
  } catch {
702
797
  U.value = !1;
@@ -706,8 +801,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
706
801
  }
707
802
  r("save", n.item.id, e, t ? E.value : void 0, i), r("close");
708
803
  }
709
- function ne(e) {
710
- e.key === "Enter" && !U.value && (e.preventDefault(), te()), e.key === "Escape" && r("close");
804
+ function re(e) {
805
+ e.key === "Enter" && !U.value && (e.preventDefault(), ne()), e.key === "Escape" && r("close");
711
806
  }
712
807
  return (t, n) => (S(), l(a, { to: k(g) || "body" }, [m(o, {
713
808
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
@@ -723,24 +818,24 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
723
818
  class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
724
819
  style: { "background-color": "var(--tpl-overlay)" },
725
820
  onClick: n[3] ||= F((e) => r("close"), ["self"]),
726
- onKeydown: ne
821
+ onKeydown: re
727
822
  }, [f("div", {
728
823
  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"]),
729
824
  style: { "background-color": "var(--tpl-bg-elevated)" }
730
825
  }, [
731
- f("div", we, [f("h3", Te, D(k(c).mediaLibrary.editFile), 1)]),
732
- f("div", Ee, [
733
- G.value ? (S(), d("div", De, [f("div", Oe, [m(k(re), {
826
+ f("div", Me, [f("h3", Ne, D(k(c).mediaLibrary.editFile), 1)]),
827
+ f("div", Pe, [
828
+ G.value ? (S(), d("div", Fe, [f("div", Ie, [m(k(ie), {
734
829
  ref_key: "cropperRef",
735
830
  ref: O,
736
831
  src: e.item.url,
737
832
  "stencil-props": { aspectRatio: K.value },
738
833
  class: "tpl:h-full tpl:w-full",
739
834
  "background-class": "tpl-cropper-background",
740
- onChange: J,
741
- onReady: Y
742
- }, null, 8, ["src", "stencil-props"])]), f("div", ke, [
743
- f("div", null, [f("label", Ae, D(k(c).mediaLibrary.cropAspectRatio), 1), f("div", je, [(S(), d(i, null, T([
835
+ onChange: ee,
836
+ onReady: J
837
+ }, null, 8, ["src", "stencil-props"])]), f("div", Le, [
838
+ f("div", null, [f("label", Re, D(k(c).mediaLibrary.cropAspectRatio), 1), f("div", ze, [(S(), d(i, null, T([
744
839
  "free",
745
840
  "square",
746
841
  "landscape43",
@@ -756,8 +851,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
756
851
  color: P.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
757
852
  }),
758
853
  onClick: (t) => P.value = e
759
- }, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Me)), 64))])]),
760
- 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", {
854
+ }, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Be)), 64))])]),
855
+ f("div", Ve, [f("div", He, [f("label", Ue, [p(D(k(c).mediaLibrary.cropMaxWidth) + " ", 1), f("span", We, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Ge, [f("input", {
761
856
  value: R.value,
762
857
  type: "number",
763
858
  min: "1",
@@ -768,8 +863,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
768
863
  color: "var(--tpl-text)"
769
864
  },
770
865
  placeholder: V.value?.width?.toString() || "",
771
- onInput: ee
772
- }, 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", {
866
+ onInput: te
867
+ }, null, 40, Ke), f("span", qe, D(k(c).mediaLibrary.cropPixels), 1)])]), f("div", Je, [f("label", Ye, [p(D(k(c).mediaLibrary.cropMaxHeight) + " ", 1), f("span", Xe, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Ze, [f("input", {
773
868
  value: z.value,
774
869
  type: "number",
775
870
  min: "1",
@@ -780,11 +875,11 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
780
875
  color: "var(--tpl-text)"
781
876
  },
782
877
  placeholder: V.value?.height?.toString() || "",
783
- onInput: X
784
- }, null, 40, We), f("span", Ge, D(k(c).mediaLibrary.cropPixels), 1)])])]),
785
- 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)
878
+ onInput: Y
879
+ }, null, 40, Qe), f("span", $e, D(k(c).mediaLibrary.cropPixels), 1)])])]),
880
+ q.value ? (S(), d("div", et, [f("span", null, D(k(c).mediaLibrary.cropOutputSize) + ": ", 1), f("span", tt, D(q.value.width) + " x " + D(q.value.height) + " " + D(k(c).mediaLibrary.cropPixels), 1)])) : u("", !0)
786
881
  ])])) : u("", !0),
787
- f("div", Je, [f("label", Ye, D(k(c).mediaLibrary.fileName), 1), N(f("input", {
882
+ f("div", nt, [f("label", rt, D(k(c).mediaLibrary.fileName), 1), N(f("input", {
788
883
  "onUpdate:modelValue": n[0] ||= (e) => C.value = e,
789
884
  type: "text",
790
885
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -794,8 +889,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
794
889
  color: "var(--tpl-text)"
795
890
  },
796
891
  autofocus: !G.value
797
- }, null, 8, Xe), [[A, C.value]])]),
798
- k(x)(e.item.mime_type) ? (S(), d("div", Ze, [f("label", Qe, D(k(c).mediaLibrary.altText), 1), N(f("input", {
892
+ }, null, 8, it), [[A, C.value]])]),
893
+ k(x)(e.item.mime_type) ? (S(), d("div", at, [f("label", ot, D(k(c).mediaLibrary.altText), 1), N(f("input", {
799
894
  "onUpdate:modelValue": n[1] ||= (e) => E.value = e,
800
895
  type: "text",
801
896
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -805,9 +900,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
805
900
  color: "var(--tpl-text)"
806
901
  },
807
902
  placeholder: k(c).mediaLibrary.altTextPlaceholder
808
- }, null, 8, $e), [[A, E.value]])])) : u("", !0)
903
+ }, null, 8, st), [[A, E.value]])])) : u("", !0)
809
904
  ]),
810
- f("div", et, [f("button", {
905
+ f("div", ct, [f("button", {
811
906
  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",
812
907
  style: {
813
908
  "border-color": "var(--tpl-border)",
@@ -819,26 +914,26 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
819
914
  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",
820
915
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
821
916
  disabled: U.value,
822
- onClick: te
823
- }, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9, tt)])
824
- ], 2)], 40, Ce)) : u("", !0)]),
917
+ onClick: ne
918
+ }, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9, lt)])
919
+ ], 2)], 40, je)) : u("", !0)]),
825
920
  _: 1
826
921
  })], 8, ["to"]));
827
922
  }
828
- }), rt = (e, t) => {
923
+ }), dt = (e, t) => {
829
924
  let n = e.__vccOpts || e;
830
925
  for (let [e, r] of t) n[e] = r;
831
926
  return n;
832
- }, it = /*#__PURE__*/ rt(nt, [["__scopeId", "data-v-6b677237"]]), at = {
927
+ }, ft = /*#__PURE__*/ dt(ut, [["__scopeId", "data-v-a5653cc1"]]), pt = {
833
928
  key: 1,
834
929
  class: "tpl:size-4 tpl:shrink-0"
835
- }, ot = {
930
+ }, mt = {
836
931
  key: 0,
837
932
  class: "tpl:truncate"
838
- }, st = {
933
+ }, ht = {
839
934
  key: 3,
840
935
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
841
- }, ct = ["title"], lt = ["title"], ut = { key: 0 }, dt = ["placeholder"], ft = /* @__PURE__ */ h({
936
+ }, gt = ["title"], _t = ["title"], vt = { key: 0 }, yt = ["placeholder"], bt = /* @__PURE__ */ h({
842
937
  __name: "MediaFolderTreeNode",
843
938
  props: {
844
939
  folder: {},
@@ -852,7 +947,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
852
947
  "deleteFolder"
853
948
  ],
854
949
  setup(e, { emit: t }) {
855
- 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 < 4), 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);
950
+ let n = e, r = t, { t: a } = X(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth < 4), 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);
856
951
  function j(e, t) {
857
952
  for (let n of e) if (n.id === t || n.children && j(n.children, t)) return !0;
858
953
  return !1;
@@ -897,7 +992,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
897
992
  class: y(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": O.value }]),
898
993
  size: 10,
899
994
  "stroke-width": 2
900
- }, null, 8, ["class"])])) : (S(), d("span", at)),
995
+ }, null, 8, ["class"])])) : (S(), d("span", pt)),
901
996
  f("button", {
902
997
  class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
903
998
  onClick: n[0] ||= (t) => r("navigate", e.folder.id)
@@ -905,7 +1000,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
905
1000
  class: "tpl:shrink-0",
906
1001
  size: 14,
907
1002
  "stroke-width": 1.5
908
- }), c.value ? u("", !0) : (S(), d("span", ot, D(e.folder.name), 1))]),
1003
+ }), c.value ? u("", !0) : (S(), d("span", mt, D(e.folder.name), 1))]),
909
1004
  c.value ? N((S(), d("input", {
910
1005
  key: 2,
911
1006
  "onUpdate:modelValue": n[1] ||= (e) => p.value = e,
@@ -921,7 +1016,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
921
1016
  onBlur: R,
922
1017
  onClick: n[2] ||= F(() => {}, ["stop"])
923
1018
  }, null, 544)), [[A, p.value]]) : u("", !0),
924
- c.value ? u("", !0) : (S(), d("span", st, [
1019
+ c.value ? u("", !0) : (S(), d("span", ht, [
925
1020
  v.value ? (S(), d("button", {
926
1021
  key: 0,
927
1022
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
@@ -930,7 +1025,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
930
1025
  }, [m(k(q), {
931
1026
  size: 12,
932
1027
  "stroke-width": 2
933
- })], 8, ct)) : u("", !0),
1028
+ })], 8, gt)) : u("", !0),
934
1029
  f("button", {
935
1030
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
936
1031
  title: k(a).mediaLibrary.renameFolder,
@@ -938,17 +1033,17 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
938
1033
  }, [m(k(K), {
939
1034
  size: 12,
940
1035
  "stroke-width": 2
941
- })], 8, lt),
1036
+ })], 8, _t),
942
1037
  f("button", {
943
1038
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
944
1039
  onClick: n[3] ||= F((t) => r("deleteFolder", e.folder.id), ["stop"])
945
- }, [m(k(X), {
1040
+ }, [m(k(Y), {
946
1041
  size: 12,
947
1042
  "stroke-width": 2,
948
1043
  style: { color: "var(--tpl-danger)" }
949
1044
  })])
950
1045
  ]))
951
- ], 4), O.value ? (S(), d("div", ut, [(S(!0), d(i, null, T(e.folder.children, (t) => (S(), l(o, {
1046
+ ], 4), O.value ? (S(), d("div", vt, [(S(!0), d(i, null, T(e.folder.children, (t) => (S(), l(o, {
952
1047
  key: t.id,
953
1048
  folder: t,
954
1049
  "current-folder-id": e.currentFolderId,
@@ -978,13 +1073,13 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
978
1073
  autofocus: "",
979
1074
  onKeydown: [P(H, ["enter"]), P(U, ["escape"])],
980
1075
  onBlur: H
981
- }, null, 40, dt), [[A, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
1076
+ }, null, 40, yt), [[A, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
982
1077
  };
983
1078
  }
984
- }), pt = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, mt = {
1079
+ }), xt = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, St = {
985
1080
  key: 0,
986
1081
  class: "tpl:px-3 tpl:py-2"
987
- }, ht = ["placeholder"], gt = /* @__PURE__ */ h({
1082
+ }, Ct = ["placeholder"], wt = /* @__PURE__ */ h({
988
1083
  __name: "MediaFolderTree",
989
1084
  props: {
990
1085
  folders: {},
@@ -1000,7 +1095,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1000
1095
  "showFrequentlyUsed"
1001
1096
  ],
1002
1097
  setup(e, { emit: t }) {
1003
- let n = t, { t: r } = Z(), a = w(!1), o = w("");
1098
+ let n = t, { t: r } = X(), a = w(!1), o = w("");
1004
1099
  function s() {
1005
1100
  a.value = !0, o.value = "";
1006
1101
  }
@@ -1010,7 +1105,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1010
1105
  function h() {
1011
1106
  a.value = !1, o.value = "";
1012
1107
  }
1013
- return (t, g) => (S(), d("div", pt, [
1108
+ return (t, g) => (S(), d("div", xt, [
1014
1109
  f("button", {
1015
1110
  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",
1016
1111
  style: b({
@@ -1022,7 +1117,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1022
1117
  size: 14,
1023
1118
  "stroke-width": 1.5
1024
1119
  }), p(" " + D(k(r).mediaLibrary.allFiles), 1)], 4),
1025
- (S(!0), d(i, null, T(e.folders, (t) => (S(), l(ft, {
1120
+ (S(!0), d(i, null, T(e.folders, (t) => (S(), l(bt, {
1026
1121
  key: t.id,
1027
1122
  folder: t,
1028
1123
  "current-folder-id": e.currentFolderId,
@@ -1032,7 +1127,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1032
1127
  onRenameFolder: g[3] ||= (e, t) => n("renameFolder", e, t),
1033
1128
  onDeleteFolder: g[4] ||= (e) => n("deleteFolder", e)
1034
1129
  }, null, 8, ["folder", "current-folder-id"]))), 128)),
1035
- a.value ? (S(), d("div", mt, [N(f("input", {
1130
+ a.value ? (S(), d("div", St, [N(f("input", {
1036
1131
  "onUpdate:modelValue": g[5] ||= (e) => o.value = e,
1037
1132
  type: "text",
1038
1133
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -1045,7 +1140,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1045
1140
  autofocus: "",
1046
1141
  onKeydown: [P(c, ["enter"]), P(h, ["escape"])],
1047
1142
  onBlur: c
1048
- }, null, 40, ht), [[A, o.value]])])) : u("", !0),
1143
+ }, null, 40, Ct), [[A, o.value]])])) : u("", !0),
1049
1144
  a.value ? u("", !0) : (S(), d("button", {
1050
1145
  key: 1,
1051
1146
  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",
@@ -1065,13 +1160,13 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1065
1160
  color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
1066
1161
  }),
1067
1162
  onClick: g[6] ||= (e) => n("showFrequentlyUsed")
1068
- }, [m(k(ee), {
1163
+ }, [m(k(te), {
1069
1164
  size: 14,
1070
1165
  "stroke-width": 1.5
1071
1166
  }), p(" " + D(k(r).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
1072
1167
  ]));
1073
1168
  }
1074
- }), _t = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, vt = /* @__PURE__ */ h({
1169
+ }), Tt = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, Et = /* @__PURE__ */ h({
1075
1170
  __name: "MediaFileIcon",
1076
1171
  props: { mimeType: {} },
1077
1172
  setup(e) {
@@ -1172,7 +1267,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1172
1267
  bgColor: "#f9fafb",
1173
1268
  icon: "document"
1174
1269
  }, i = s(() => n[t.mimeType] ?? r);
1175
- return (e, t) => (S(), d("div", _t, [i.value.icon === "document" ? (S(), d("svg", {
1270
+ return (e, t) => (S(), d("div", Tt, [i.value.icon === "document" ? (S(), d("svg", {
1176
1271
  key: 0,
1177
1272
  width: "60",
1178
1273
  height: "60",
@@ -1241,48 +1336,48 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1241
1336
  style: b({ color: i.value.color })
1242
1337
  }, D(i.value.label), 5)]));
1243
1338
  }
1244
- }), yt = { class: "tpl:p-4" }, bt = {
1339
+ }), Dt = { class: "tpl:p-4" }, Ot = {
1245
1340
  key: 1,
1246
1341
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
1247
- }, xt = {
1342
+ }, kt = {
1248
1343
  class: "tpl:text-xs",
1249
1344
  style: { color: "var(--tpl-text-muted)" }
1250
- }, St = {
1345
+ }, At = {
1251
1346
  key: 2,
1252
1347
  class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
1253
- }, Ct = ["onClick"], wt = { class: "tpl:aspect-square" }, Tt = ["src", "alt"], Et = { class: "tpl:px-2 tpl:py-1.5" }, Dt = {
1348
+ }, jt = ["onClick"], Mt = { class: "tpl:aspect-square" }, Nt = ["src", "alt"], Pt = { class: "tpl:px-2 tpl:py-1.5" }, Ft = {
1254
1349
  class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
1255
1350
  style: { color: "var(--tpl-text)" }
1256
- }, Ot = {
1351
+ }, It = {
1257
1352
  class: "tpl:flex tpl:justify-between tpl:text-[9px]",
1258
1353
  style: { color: "var(--tpl-text-muted)" }
1259
- }, kt = { key: 0 }, At = { 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" }, jt = ["title", "onClick"], Mt = ["title", "onClick"], Nt = {
1354
+ }, Lt = { key: 0 }, Rt = { 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" }, zt = ["title", "onClick"], Bt = ["title", "onClick"], Vt = {
1260
1355
  key: 0,
1261
1356
  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",
1262
1357
  style: { "background-color": "var(--tpl-primary)" }
1263
- }, Pt = {
1358
+ }, Ht = {
1264
1359
  key: 3,
1265
1360
  class: "tpl:flex tpl:flex-col tpl:gap-1"
1266
- }, Ft = ["onClick"], It = {
1361
+ }, Ut = ["onClick"], Wt = {
1267
1362
  class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
1268
1363
  style: { "background-color": "var(--tpl-bg-hover)" }
1269
- }, Lt = ["src", "alt"], Rt = {
1364
+ }, Gt = ["src", "alt"], Kt = {
1270
1365
  key: 1,
1271
1366
  class: "tpl-list-icon tpl:size-full"
1272
- }, zt = { class: "tpl:min-w-0 tpl:flex-1" }, Bt = {
1367
+ }, qt = { class: "tpl:min-w-0 tpl:flex-1" }, Jt = {
1273
1368
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1274
1369
  style: { color: "var(--tpl-text)" }
1275
- }, Vt = {
1370
+ }, Yt = {
1276
1371
  class: "tpl:text-[10px]",
1277
1372
  style: { color: "var(--tpl-text-muted)" }
1278
- }, Ht = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Ut = ["title", "onClick"], Wt = ["title", "onClick"], Gt = {
1373
+ }, Xt = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Zt = ["title", "onClick"], Qt = ["title", "onClick"], $t = {
1279
1374
  key: 0,
1280
1375
  class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1281
1376
  style: { "background-color": "var(--tpl-primary)" }
1282
- }, Kt = {
1377
+ }, en = {
1283
1378
  key: 4,
1284
1379
  class: "tpl:flex tpl:justify-center tpl:py-4"
1285
- }, qt = /*#__PURE__*/ rt(/* @__PURE__ */ h({
1380
+ }, tn = /*#__PURE__*/ dt(/* @__PURE__ */ h({
1286
1381
  __name: "MediaGrid",
1287
1382
  props: {
1288
1383
  items: {},
@@ -1300,15 +1395,15 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1300
1395
  "replace"
1301
1396
  ],
1302
1397
  setup(e, { emit: t }) {
1303
- let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: o } = Q();
1398
+ let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: o } = Z();
1304
1399
  function s(e) {
1305
1400
  return !n.accept || n.accept.length === 0 || a(e.mime_type, n.accept);
1306
1401
  }
1307
1402
  function c(e) {
1308
1403
  r("select", e);
1309
1404
  }
1310
- let { t: h } = Z(), g = w(null);
1311
- ue(g, ([{ isIntersecting: e }]) => {
1405
+ let { t: h } = X(), g = w(null);
1406
+ de(g, ([{ isIntersecting: e }]) => {
1312
1407
  e && n.hasMore && !n.isLoading && r("loadMore");
1313
1408
  }, { threshold: .1 });
1314
1409
  function _(e) {
@@ -1321,7 +1416,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1321
1416
  day: "numeric"
1322
1417
  });
1323
1418
  }
1324
- return (t, n) => (S(), d("div", yt, [
1419
+ return (t, n) => (S(), d("div", Dt, [
1325
1420
  e.isLoading && e.items.length === 0 ? (S(), d("div", {
1326
1421
  key: 0,
1327
1422
  class: y(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
@@ -1329,26 +1424,26 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1329
1424
  key: t,
1330
1425
  class: y(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
1331
1426
  style: { "background-color": "var(--tpl-bg-hover)" }
1332
- }, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", bt, [m(k(z), {
1427
+ }, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", Ot, [m(k(z), {
1333
1428
  class: "tpl:mb-3",
1334
1429
  size: 40,
1335
1430
  "stroke-width": 1,
1336
1431
  style: { color: "var(--tpl-text-dim)" }
1337
- }), f("p", xt, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Pt, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1432
+ }), f("p", kt, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Ht, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1338
1433
  key: t.id,
1339
1434
  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" : ""]]),
1340
1435
  style: b({ backgroundColor: e.selectedIds.has(t.id) ? "var(--tpl-bg-hover)" : "transparent" }),
1341
1436
  onClick: (e) => c(t)
1342
1437
  }, [
1343
- f("div", It, [k(o)(t.mime_type) ? (S(), d("img", {
1438
+ f("div", Wt, [k(o)(t.mime_type) ? (S(), d("img", {
1344
1439
  key: 0,
1345
1440
  src: t.small_url || t.url,
1346
1441
  alt: t.filename,
1347
1442
  class: "tpl:size-full tpl:object-cover",
1348
1443
  loading: "lazy"
1349
- }, null, 8, Lt)) : (S(), d("div", Rt, [m(vt, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
1350
- f("div", zt, [f("p", Bt, D(t.filename), 1), f("p", Vt, [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)])]),
1351
- f("div", Ht, [f("button", {
1444
+ }, null, 8, Gt)) : (S(), d("div", Kt, [m(Et, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
1445
+ f("div", qt, [f("p", Jt, D(t.filename), 1), f("p", Yt, [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)])]),
1446
+ f("div", Xt, [f("button", {
1352
1447
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
1353
1448
  style: { color: "var(--tpl-text-muted)" },
1354
1449
  title: k(h).mediaLibrary.editFile,
@@ -1356,20 +1451,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1356
1451
  }, [m(k(K), {
1357
1452
  size: 12,
1358
1453
  "stroke-width": 2
1359
- })], 8, Ut), f("button", {
1454
+ })], 8, Zt), f("button", {
1360
1455
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
1361
1456
  style: { color: "var(--tpl-text-muted)" },
1362
1457
  title: k(h).mediaLibrary.replaceFile,
1363
1458
  onClick: F((e) => r("replace", t), ["stop"])
1364
- }, [m(k(J), {
1459
+ }, [m(k(ee), {
1365
1460
  size: 12,
1366
1461
  "stroke-width": 2
1367
- })], 8, Wt)]),
1368
- e.selectedIds.has(t.id) ? (S(), d("div", Gt, [m(k(I), {
1462
+ })], 8, Qt)]),
1463
+ e.selectedIds.has(t.id) ? (S(), d("div", $t, [m(k(I), {
1369
1464
  size: 12,
1370
1465
  "stroke-width": 3
1371
1466
  })])) : u("", !0)
1372
- ], 14, Ft))), 128))])) : (S(), d("div", St, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1467
+ ], 14, Ut))), 128))])) : (S(), d("div", At, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1373
1468
  key: t.id,
1374
1469
  class: y(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
1375
1470
  "tpl:cursor-pointer",
@@ -1382,18 +1477,18 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1382
1477
  }),
1383
1478
  onClick: (e) => c(t)
1384
1479
  }, [
1385
- f("div", wt, [k(o)(t.mime_type) ? (S(), d("img", {
1480
+ f("div", Mt, [k(o)(t.mime_type) ? (S(), d("img", {
1386
1481
  key: 0,
1387
1482
  src: t.small_url || t.url,
1388
1483
  alt: t.filename,
1389
1484
  class: "tpl:size-full tpl:object-cover",
1390
1485
  loading: "lazy"
1391
- }, null, 8, Tt)) : (S(), l(vt, {
1486
+ }, null, 8, Nt)) : (S(), l(Et, {
1392
1487
  key: 1,
1393
1488
  "mime-type": t.mime_type
1394
1489
  }, null, 8, ["mime-type"]))]),
1395
- f("div", Et, [f("p", Dt, D(t.filename), 1), f("p", Ot, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", kt, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
1396
- f("div", At, [f("button", {
1490
+ f("div", Pt, [f("p", Ft, D(t.filename), 1), f("p", It, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", Lt, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
1491
+ f("div", Rt, [f("button", {
1397
1492
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1398
1493
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
1399
1494
  title: k(h).mediaLibrary.editFile,
@@ -1401,26 +1496,26 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1401
1496
  }, [m(k(K), {
1402
1497
  size: 11,
1403
1498
  "stroke-width": 2
1404
- })], 8, jt), f("button", {
1499
+ })], 8, zt), f("button", {
1405
1500
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1406
1501
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
1407
1502
  title: k(h).mediaLibrary.replaceFile,
1408
1503
  onClick: F((e) => r("replace", t), ["stop"])
1409
- }, [m(k(J), {
1504
+ }, [m(k(ee), {
1410
1505
  size: 11,
1411
1506
  "stroke-width": 2
1412
- })], 8, Mt)]),
1413
- e.selectedIds.has(t.id) ? (S(), d("div", Nt, [m(k(I), {
1507
+ })], 8, Bt)]),
1508
+ e.selectedIds.has(t.id) ? (S(), d("div", Vt, [m(k(I), {
1414
1509
  size: 12,
1415
1510
  "stroke-width": 3
1416
1511
  })])) : u("", !0)
1417
- ], 14, Ct))), 128))])),
1512
+ ], 14, jt))), 128))])),
1418
1513
  f("div", {
1419
1514
  ref_key: "sentinelRef",
1420
1515
  ref: g,
1421
1516
  class: "tpl:h-4"
1422
1517
  }, null, 512),
1423
- e.isLoading && e.items.length > 0 ? (S(), d("div", Kt, [m(k(W), {
1518
+ e.isLoading && e.items.length > 0 ? (S(), d("div", en, [m(k(W), {
1424
1519
  class: "tpl-spinner",
1425
1520
  size: 20,
1426
1521
  "stroke-width": 2,
@@ -1428,20 +1523,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1428
1523
  })])) : u("", !0)
1429
1524
  ]));
1430
1525
  }
1431
- }), [["__scopeId", "data-v-9db961d1"]]), Jt = ["data-tpl-theme"], Yt = {
1526
+ }), [["__scopeId", "data-v-9db961d1"]]), nn = ["data-tpl-theme"], rn = {
1432
1527
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1433
1528
  style: { "background-color": "var(--tpl-bg-elevated)" }
1434
- }, Xt = {
1529
+ }, an = {
1435
1530
  class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
1436
1531
  style: { color: "var(--tpl-text)" }
1437
- }, Zt = { class: "tpl:mb-3" }, Qt = ["placeholder", "disabled"], $t = {
1532
+ }, on = { class: "tpl:mb-3" }, sn = ["placeholder", "disabled"], cn = {
1438
1533
  key: 0,
1439
1534
  class: "tpl:mb-3 tpl:text-xs",
1440
1535
  style: { color: "var(--tpl-danger)" }
1441
- }, en = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, tn = ["disabled"], nn = ["disabled"], rn = {
1536
+ }, ln = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, un = ["disabled"], dn = ["disabled"], fn = {
1442
1537
  key: 0,
1443
1538
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
1444
- }, an = { key: 1 }, on = /* @__PURE__ */ h({
1539
+ }, pn = { key: 1 }, mn = /* @__PURE__ */ h({
1445
1540
  __name: "MediaImportUrlModal",
1446
1541
  props: {
1447
1542
  visible: { type: Boolean },
@@ -1450,7 +1545,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1450
1545
  },
1451
1546
  emits: ["import", "close"],
1452
1547
  setup(e, { emit: t }) {
1453
- let n = e, r = t, { t: i } = Z(), s = _("tplUiTheme"), c = _(Se, w(null)), h = w("");
1548
+ let n = e, r = t, { t: i } = X(), s = _(ye, null), c = _(_e, w(null)), h = w("");
1454
1549
  j(() => n.visible, (e) => {
1455
1550
  e && (h.value = "");
1456
1551
  });
@@ -1479,9 +1574,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1479
1574
  style: { "background-color": "var(--tpl-overlay)" },
1480
1575
  onClick: F(v, ["self"]),
1481
1576
  onKeydown: b
1482
- }, [f("div", Yt, [
1483
- f("h3", Xt, D(k(i).mediaLibrary.importFromUrl), 1),
1484
- f("div", Zt, [N(f("input", {
1577
+ }, [f("div", rn, [
1578
+ f("h3", an, D(k(i).mediaLibrary.importFromUrl), 1),
1579
+ f("div", on, [N(f("input", {
1485
1580
  "onUpdate:modelValue": n[0] ||= (e) => h.value = e,
1486
1581
  type: "url",
1487
1582
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -1493,9 +1588,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1493
1588
  placeholder: k(i).mediaLibrary.importUrlPlaceholder,
1494
1589
  disabled: e.isImporting,
1495
1590
  autofocus: ""
1496
- }, null, 8, Qt), [[A, h.value]])]),
1497
- e.error ? (S(), d("p", $t, D(e.error), 1)) : u("", !0),
1498
- f("div", en, [f("button", {
1591
+ }, null, 8, sn), [[A, h.value]])]),
1592
+ e.error ? (S(), d("p", cn, D(e.error), 1)) : u("", !0),
1593
+ f("div", ln, [f("button", {
1499
1594
  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 }]),
1500
1595
  style: {
1501
1596
  "border-color": "var(--tpl-border)",
@@ -1504,25 +1599,25 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1504
1599
  },
1505
1600
  disabled: e.isImporting,
1506
1601
  onClick: v
1507
- }, D(k(i).mediaLibrary.cancel), 11, tn), f("button", {
1602
+ }, D(k(i).mediaLibrary.cancel), 11, un), f("button", {
1508
1603
  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",
1509
1604
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
1510
1605
  disabled: !h.value.trim() || e.isImporting,
1511
1606
  onClick: g
1512
- }, [e.isImporting ? (S(), d("span", rn, [m(k(W), {
1607
+ }, [e.isImporting ? (S(), d("span", fn, [m(k(W), {
1513
1608
  class: "tpl:animate-spin",
1514
1609
  size: 12,
1515
1610
  "stroke-width": 2
1516
- }), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", an, D(k(i).mediaLibrary.import), 1))], 8, nn)])
1517
- ])], 40, Jt)) : u("", !0)]),
1611
+ }), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", pn, D(k(i).mediaLibrary.import), 1))], 8, dn)])
1612
+ ])], 40, nn)) : u("", !0)]),
1518
1613
  _: 1
1519
1614
  })], 8, ["to"]));
1520
1615
  }
1521
- }), sn = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, cn = ["disabled", "onClick"], ln = { class: "tpl:truncate" }, un = {
1616
+ }), hn = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, gn = ["disabled", "onClick"], _n = { class: "tpl:truncate" }, vn = {
1522
1617
  key: 0,
1523
1618
  class: "tpl:shrink-0",
1524
1619
  style: { color: "var(--tpl-text-dim)" }
1525
- }, dn = /* @__PURE__ */ h({
1620
+ }, yn = /* @__PURE__ */ h({
1526
1621
  __name: "MediaMovePicker",
1527
1622
  props: {
1528
1623
  folders: {},
@@ -1530,7 +1625,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1530
1625
  },
1531
1626
  emits: ["select", "close"],
1532
1627
  setup(e, { emit: t }) {
1533
- let n = t, { t: r } = Z(), a = w(null);
1628
+ let n = t, { t: r } = X(), a = w(null);
1534
1629
  function o(e, t = 0) {
1535
1630
  let n = [];
1536
1631
  for (let r of e) n.push({
@@ -1540,7 +1635,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1540
1635
  }), r.children?.length && n.push(...o(r.children, t + 1));
1541
1636
  return n;
1542
1637
  }
1543
- return ie(a, () => {
1638
+ return ae(a, () => {
1544
1639
  n("close");
1545
1640
  }), (t, s) => (S(), d("div", {
1546
1641
  ref_key: "pickerRef",
@@ -1550,7 +1645,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1550
1645
  "border-color": "var(--tpl-border)",
1551
1646
  "background-color": "var(--tpl-bg-elevated)"
1552
1647
  }
1553
- }, [f("div", sn, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
1648
+ }, [f("div", hn, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
1554
1649
  key: 0,
1555
1650
  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",
1556
1651
  style: { color: "var(--tpl-text)" },
@@ -1575,27 +1670,27 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1575
1670
  size: 14,
1576
1671
  "stroke-width": 1.5
1577
1672
  }),
1578
- f("span", ln, D(t.name), 1),
1579
- t.id === e.currentFolderId ? (S(), d("span", un, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
1580
- ], 12, cn))), 128))])], 512));
1673
+ f("span", _n, D(t.name), 1),
1674
+ t.id === e.currentFolderId ? (S(), d("span", vn, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
1675
+ ], 12, gn))), 128))])], 512));
1581
1676
  }
1582
- }), fn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, pn = ["src", "alt"], mn = {
1677
+ }), bn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, xn = ["src", "alt"], Sn = {
1583
1678
  key: 1,
1584
1679
  class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
1585
1680
  style: { border: "1px solid var(--tpl-border)" }
1586
- }, hn = { class: "tpl:min-w-0 tpl:flex-1" }, gn = {
1681
+ }, Cn = { class: "tpl:min-w-0 tpl:flex-1" }, wn = {
1587
1682
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1588
1683
  style: { color: "var(--tpl-text)" }
1589
- }, _n = {
1684
+ }, Tn = {
1590
1685
  class: "tpl:mt-0.5 tpl:text-[10px]",
1591
1686
  style: { color: "var(--tpl-text-muted)" }
1592
- }, vn = {
1687
+ }, En = {
1593
1688
  key: 2,
1594
1689
  class: "tpl:shrink-0"
1595
- }, yn = {
1690
+ }, Dn = {
1596
1691
  class: "tpl:block tpl:text-[10px]",
1597
1692
  style: { color: "var(--tpl-text-muted)" }
1598
- }, bn = ["value"], xn = ["value"], Sn = /*#__PURE__*/ rt(/* @__PURE__ */ h({
1693
+ }, On = ["value"], kn = ["value"], An = /*#__PURE__*/ dt(/* @__PURE__ */ h({
1599
1694
  __name: "MediaPreviewPanel",
1600
1695
  props: {
1601
1696
  item: {},
@@ -1604,7 +1699,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1604
1699
  },
1605
1700
  emits: ["update:selectedConversion"],
1606
1701
  setup(e, { emit: t }) {
1607
- let n = e, r = t, { t: a } = Z(), { isImageMimeType: o } = Q(), c = s(() => {
1702
+ let n = e, r = t, { t: a } = X(), { isImageMimeType: o } = Z(), c = s(() => {
1608
1703
  if (!b.value || !n.item.conversions_generated) return [];
1609
1704
  let e = [];
1610
1705
  return n.item.small_url && e.push({
@@ -1663,20 +1758,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1663
1758
  day: "numeric"
1664
1759
  });
1665
1760
  }
1666
- return (t, n) => (S(), d("div", fn, [
1761
+ return (t, n) => (S(), d("div", bn, [
1667
1762
  b.value ? (S(), d("img", {
1668
1763
  key: 0,
1669
1764
  src: h.value ?? void 0,
1670
1765
  alt: e.item.alt_text || e.item.filename,
1671
1766
  class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
1672
1767
  style: { border: "1px solid var(--tpl-border)" }
1673
- }, null, 8, pn)) : (S(), d("div", mn, [m(vt, {
1768
+ }, null, 8, xn)) : (S(), d("div", Sn, [m(Et, {
1674
1769
  "mime-type": e.item.mime_type,
1675
1770
  class: "tpl-preview-icon"
1676
1771
  }, null, 8, ["mime-type"])])),
1677
- f("div", hn, [
1678
- f("p", gn, D(e.item.filename), 1),
1679
- f("p", _n, [
1772
+ f("div", Cn, [
1773
+ f("p", wn, D(e.item.filename), 1),
1774
+ f("p", Tn, [
1680
1775
  p(D(x(e.item.size)) + " · " + D(C(e.item.created_at)) + " ", 1),
1681
1776
  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),
1682
1777
  v.value ? (S(), d(i, { key: 1 }, [
@@ -1695,7 +1790,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1695
1790
  style: { color: "var(--tpl-text-dim)" }
1696
1791
  }, D(e.item.alt_text || "\xA0"), 3)) : u("", !0)
1697
1792
  ]),
1698
- l.value ? (S(), d("div", vn, [f("label", yn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
1793
+ l.value ? (S(), d("div", En, [f("label", Dn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
1699
1794
  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",
1700
1795
  style: {
1701
1796
  "border-color": "var(--tpl-border)",
@@ -1707,36 +1802,36 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1707
1802
  }, [(S(!0), d(i, null, T(c.value, (e) => (S(), d("option", {
1708
1803
  key: e.value,
1709
1804
  value: e.value
1710
- }, D(e.label), 9, xn))), 128))], 40, bn)])) : u("", !0)
1805
+ }, D(e.label), 9, kn))), 128))], 40, On)])) : u("", !0)
1711
1806
  ]));
1712
1807
  }
1713
- }), [["__scopeId", "data-v-060e36cd"]]), Cn = ["data-tpl-theme"], wn = {
1808
+ }), [["__scopeId", "data-v-060e36cd"]]), jn = ["data-tpl-theme"], Mn = {
1714
1809
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1715
1810
  style: { "background-color": "var(--tpl-bg-elevated)" }
1716
- }, Tn = {
1811
+ }, Nn = {
1717
1812
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
1718
1813
  style: { color: "var(--tpl-text)" }
1719
- }, En = {
1814
+ }, Pn = {
1720
1815
  class: "tpl:mb-2 tpl:text-xs",
1721
1816
  style: { color: "var(--tpl-text-muted)" }
1722
- }, Dn = {
1817
+ }, Fn = {
1723
1818
  key: 0,
1724
1819
  class: "tpl:mb-3 tpl:text-xs",
1725
1820
  style: { color: "var(--tpl-warning)" }
1726
- }, On = {
1821
+ }, In = {
1727
1822
  class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
1728
1823
  style: { "border-color": "var(--tpl-border)" }
1729
- }, kn = {
1824
+ }, Ln = {
1730
1825
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1731
1826
  style: { color: "var(--tpl-text)" }
1732
- }, An = { class: "tpl:mb-4" }, jn = {
1827
+ }, Rn = { class: "tpl:mb-4" }, zn = {
1733
1828
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
1734
1829
  style: { color: "var(--tpl-text-muted)" }
1735
- }, Mn = ["accept"], Nn = {
1830
+ }, Bn = ["accept"], Vn = {
1736
1831
  key: 1,
1737
1832
  class: "tpl:mb-3 tpl:text-xs",
1738
1833
  style: { color: "var(--tpl-danger)" }
1739
- }, Pn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Fn = ["disabled"], In = ["disabled"], Ln = /* @__PURE__ */ h({
1834
+ }, Hn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Un = ["disabled"], Wn = ["disabled"], Gn = /* @__PURE__ */ h({
1740
1835
  __name: "MediaReplaceModal",
1741
1836
  props: {
1742
1837
  visible: { type: Boolean },
@@ -1747,7 +1842,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1747
1842
  },
1748
1843
  emits: ["replace", "close"],
1749
1844
  setup(e, { emit: t }) {
1750
- let n = e, r = t, { t: i } = Z(), c = _("tplUiTheme"), p = _(Se, w(null)), h = w(null), g = w(null), v = s(() => {
1845
+ let n = e, r = t, { t: i } = X(), c = _(ye, null), p = _(_e, w(null)), h = w(null), g = w(null), v = s(() => {
1751
1846
  if (!n.item) return "";
1752
1847
  let e = n.item.filename.split(".");
1753
1848
  return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
@@ -1780,12 +1875,12 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1780
1875
  style: { "background-color": "var(--tpl-overlay)" },
1781
1876
  onClick: n[1] ||= F((e) => r("close"), ["self"]),
1782
1877
  onKeydown: T
1783
- }, [f("div", wn, [
1784
- f("h3", Tn, D(k(i).mediaLibrary.replaceWarningTitle), 1),
1785
- f("p", En, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
1786
- b.value ? (S(), d("p", Dn, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
1787
- f("div", On, [f("p", kn, D(e.item.filename), 1)]),
1788
- f("div", An, [f("label", jn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
1878
+ }, [f("div", Mn, [
1879
+ f("h3", Nn, D(k(i).mediaLibrary.replaceWarningTitle), 1),
1880
+ f("p", Pn, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
1881
+ b.value ? (S(), d("p", Fn, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
1882
+ f("div", In, [f("p", Ln, D(e.item.filename), 1)]),
1883
+ f("div", Rn, [f("label", zn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
1789
1884
  ref_key: "fileInputRef",
1790
1885
  ref: h,
1791
1886
  type: "file",
@@ -1797,9 +1892,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1797
1892
  color: "var(--tpl-text)"
1798
1893
  },
1799
1894
  onChange: x
1800
- }, null, 40, Mn)]),
1801
- e.error ? (S(), d("p", Nn, D(e.error), 1)) : u("", !0),
1802
- f("div", Pn, [f("button", {
1895
+ }, null, 40, Bn)]),
1896
+ e.error ? (S(), d("p", Vn, D(e.error), 1)) : u("", !0),
1897
+ f("div", Hn, [f("button", {
1803
1898
  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",
1804
1899
  style: {
1805
1900
  "border-color": "var(--tpl-border)",
@@ -1808,29 +1903,29 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1808
1903
  },
1809
1904
  disabled: e.isReplacing,
1810
1905
  onClick: n[0] ||= (e) => r("close")
1811
- }, D(k(i).mediaLibrary.cancel), 9, Fn), f("button", {
1906
+ }, D(k(i).mediaLibrary.cancel), 9, Un), f("button", {
1812
1907
  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",
1813
1908
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
1814
1909
  disabled: !g.value || e.isReplacing,
1815
1910
  onClick: C
1816
- }, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, In)])
1817
- ])], 40, Cn)) : u("", !0)]),
1911
+ }, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, Wn)])
1912
+ ])], 40, jn)) : u("", !0)]),
1818
1913
  _: 1
1819
1914
  })], 8, ["to"]));
1820
1915
  }
1821
- }), Rn = {
1916
+ }), Kn = {
1822
1917
  key: 0,
1823
1918
  class: "tpl:flex tpl:items-center tpl:gap-2"
1824
- }, zn = {
1919
+ }, qn = {
1825
1920
  class: "tpl:text-xs",
1826
1921
  style: { color: "var(--tpl-text-muted)" }
1827
- }, Bn = {
1922
+ }, Jn = {
1828
1923
  class: "tpl:text-xs",
1829
1924
  style: { color: "var(--tpl-text-muted)" }
1830
- }, Vn = {
1925
+ }, Yn = {
1831
1926
  class: "tpl:mt-1 tpl:text-[10px]",
1832
1927
  style: { color: "var(--tpl-text-dim)" }
1833
- }, Hn = /* @__PURE__ */ h({
1928
+ }, Xn = /* @__PURE__ */ h({
1834
1929
  __name: "MediaUploadZone",
1835
1930
  props: {
1836
1931
  isUploading: { type: Boolean },
@@ -1838,7 +1933,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1838
1933
  },
1839
1934
  emits: ["upload"],
1840
1935
  setup(e, { emit: t }) {
1841
- let n = t, { t: r, format: a } = Z(), { allAcceptedMimeTypes: o, allAcceptedInputString: s, maxFileSize: c } = Q(), l = w();
1936
+ let n = t, { t: r, format: a } = X(), { allAcceptedMimeTypes: o, allAcceptedInputString: s, maxFileSize: c } = Z(), l = w();
1842
1937
  function u(e) {
1843
1938
  let t = [];
1844
1939
  for (let n of Array.from(e)) o.value.includes(n.type) && n.size <= c.value && t.push(n);
@@ -1848,9 +1943,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1848
1943
  let t = u(e);
1849
1944
  t.length && n("upload", t);
1850
1945
  }
1851
- let { isOverDropZone: h } = se(l, { onDrop: (e) => {
1946
+ let { isOverDropZone: h } = ce(l, { onDrop: (e) => {
1852
1947
  e?.length && p(e);
1853
- } }), { open: g, onChange: _ } = le({
1948
+ } }), { open: g, onChange: _ } = ue({
1854
1949
  accept: s.value,
1855
1950
  multiple: !0
1856
1951
  });
@@ -1865,35 +1960,35 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1865
1960
  "background-color": "var(--tpl-bg)"
1866
1961
  },
1867
1962
  onClick: n[0] ||= (e) => k(g)()
1868
- }, [e.isUploading ? (S(), d("div", Rn, [m(k(W), {
1963
+ }, [e.isUploading ? (S(), d("div", Kn, [m(k(W), {
1869
1964
  class: "tpl-spinner",
1870
1965
  size: 20,
1871
1966
  "stroke-width": 2,
1872
1967
  style: { color: "var(--tpl-primary)" }
1873
- }), f("span", zn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
1968
+ }), f("span", qn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
1874
1969
  current: e.uploadProgress.current,
1875
1970
  total: e.uploadProgress.total
1876
1971
  }) : k(r).mediaLibrary.uploading), 1)])) : (S(), d(i, { key: 1 }, [
1877
- m(k(te), {
1972
+ m(k(ne), {
1878
1973
  class: "tpl:mb-2",
1879
1974
  size: 24,
1880
1975
  "stroke-width": 1.5,
1881
1976
  style: { color: "var(--tpl-text-dim)" }
1882
1977
  }),
1883
- f("p", Bn, D(k(r).mediaLibrary.dropOrClick), 1),
1884
- f("p", Vn, D(k(r).mediaLibrary.acceptedFormats), 1)
1978
+ f("p", Jn, D(k(r).mediaLibrary.dropOrClick), 1),
1979
+ f("p", Yn, D(k(r).mediaLibrary.acceptedFormats), 1)
1885
1980
  ], 64))], 2));
1886
1981
  }
1887
- }), Un = [
1982
+ }), Zn = [
1888
1983
  "width",
1889
1984
  "height",
1890
1985
  "viewBox"
1891
- ], Wn = [
1986
+ ], Qn = [
1892
1987
  "cx",
1893
1988
  "cy",
1894
1989
  "r",
1895
1990
  "stroke-width"
1896
- ], Gn = [
1991
+ ], $n = [
1897
1992
  "cx",
1898
1993
  "cy",
1899
1994
  "r",
@@ -1901,14 +1996,14 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1901
1996
  "stroke",
1902
1997
  "stroke-dasharray",
1903
1998
  "stroke-dashoffset"
1904
- ], Kn = {
1999
+ ], er = {
1905
2000
  key: 0,
1906
2001
  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",
1907
2002
  style: {
1908
2003
  "background-color": "var(--tpl-text)",
1909
2004
  color: "var(--tpl-bg-elevated)"
1910
2005
  }
1911
- }, qn = /* @__PURE__ */ h({
2006
+ }, tr = /* @__PURE__ */ h({
1912
2007
  __name: "StorageProgressRing",
1913
2008
  props: {
1914
2009
  usedBytes: {},
@@ -1916,7 +2011,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1916
2011
  size: {}
1917
2012
  },
1918
2013
  setup(e) {
1919
- let t = e, { t: n, format: r } = Z(), i = w(!1), a = s(() => t.size ?? 24), c = s(() => Math.max(2, a.value / 8)), l = s(() => (a.value - c.value) / 2), h = s(() => 2 * Math.PI * l.value), g = s(() => t.limitBytes <= 0 ? 0 : Math.min(100, t.usedBytes / t.limitBytes * 100)), _ = s(() => h.value - g.value / 100 * h.value), v = s(() => g.value >= 95 ? "var(--tpl-danger)" : g.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
2014
+ let t = e, { t: n, format: r } = X(), i = w(!1), a = s(() => t.size ?? 24), c = s(() => Math.max(2, a.value / 8)), l = s(() => (a.value - c.value) / 2), h = s(() => 2 * Math.PI * l.value), g = s(() => t.limitBytes <= 0 ? 0 : Math.min(100, t.usedBytes / t.limitBytes * 100)), _ = s(() => h.value - g.value / 100 * h.value), v = s(() => g.value >= 95 ? "var(--tpl-danger)" : g.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
1920
2015
  function y(e) {
1921
2016
  if (e === 0) return "0 B";
1922
2017
  let t = 1024, n = [
@@ -1948,7 +2043,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1948
2043
  fill: "none",
1949
2044
  "stroke-width": c.value,
1950
2045
  style: { stroke: "var(--tpl-border)" }
1951
- }, null, 8, Wn), f("circle", {
2046
+ }, null, 8, Qn), f("circle", {
1952
2047
  cx: a.value / 2,
1953
2048
  cy: a.value / 2,
1954
2049
  r: l.value,
@@ -1959,7 +2054,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1959
2054
  "stroke-dasharray": h.value,
1960
2055
  "stroke-dashoffset": _.value,
1961
2056
  class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
1962
- }, null, 8, Gn)], 8, Un)), m(o, {
2057
+ }, null, 8, $n)], 8, Zn)), m(o, {
1963
2058
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1964
2059
  "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
1965
2060
  "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
@@ -1967,7 +2062,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1967
2062
  "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
1968
2063
  "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
1969
2064
  }, {
1970
- default: M(() => [i.value ? (S(), d("div", Kn, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
2065
+ default: M(() => [i.value ? (S(), d("div", er, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
1971
2066
  class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
1972
2067
  style: { "background-color": "var(--tpl-text)" }
1973
2068
  }, null, -1)])) : u("", !0)]),
@@ -1977,117 +2072,149 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1977
2072
  });
1978
2073
  //#endregion
1979
2074
  //#region src/composables/useMediaLibraryUI.ts
1980
- function Jn(e) {
1981
- let { library: t, canUseMediaFolders: n, translations: r } = e;
1982
- function i() {
1983
- return "value" in r && typeof r.value == "object" ? r.value : r;
2075
+ function nr(e) {
2076
+ let { library: t, translations: n } = e;
2077
+ function r() {
2078
+ return "value" in n && typeof n.value == "object" ? n.value : n;
1984
2079
  }
1985
- let a = w("grid"), o = w(!1), c = w(""), l = w("original"), u = w(null), d = w(!1), f = w(!1), p = s(() => {
2080
+ let i = w("grid"), a = w(!1), o = w(""), c = w("original"), l = w(null), u = w(!1), d = w(!1), f = s(() => {
1986
2081
  let e = t.previewItem.value;
1987
2082
  if (!e) return null;
1988
- switch (l.value) {
2083
+ switch (c.value) {
1989
2084
  case "small": return e.small_url || e.url;
1990
2085
  case "medium": return e.medium_url || e.url;
1991
2086
  case "large": return e.large_url || e.url;
1992
2087
  default: return e.url;
1993
2088
  }
1994
- }), m = s(() => t.frequentlyUsedItems.value.length > 0), h = s(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), g = s(() => Object.values(t.deleteUsageInfo.value).some((e) => e.template_count > 0)), _ = {
1995
- images: () => i().mediaLibrary.filterImages,
1996
- documents: () => i().mediaLibrary.filterDocuments,
1997
- videos: () => i().mediaLibrary.filterVideos,
1998
- audio: () => i().mediaLibrary.filterAudio
2089
+ }), p = s(() => t.frequentlyUsedItems.value.length > 0), m = s(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), h = s(() => Object.values(t.deleteUsageInfo.value).some((e) => e.template_count > 0)), g = {
2090
+ images: () => r().mediaLibrary.filterImages,
2091
+ documents: () => r().mediaLibrary.filterDocuments,
2092
+ videos: () => r().mediaLibrary.filterVideos,
2093
+ audio: () => r().mediaLibrary.filterAudio
1999
2094
  };
2000
- function v(e) {
2001
- return _[e]?.() ?? e;
2095
+ function _(e) {
2096
+ return g[e]?.() ?? e;
2002
2097
  }
2003
- j(o, (e) => {
2004
- e && n.value && t.loadFolders();
2098
+ j(a, (e) => {
2099
+ e && t.loadFolders();
2005
2100
  }), j(() => t.previewItem.value?.id, () => {
2006
- l.value = "original";
2101
+ c.value = "original";
2007
2102
  });
2008
- let y = oe((e) => {
2103
+ let v = se((e) => {
2009
2104
  t.search(e);
2010
2105
  }, 300);
2011
- function b(e) {
2012
- c.value = e, y(e);
2106
+ function y(e) {
2107
+ o.value = e, v(e);
2013
2108
  }
2014
- let { copy: x, copied: S } = ae({
2109
+ let { copy: b, copied: x } = oe({
2015
2110
  copiedDuring: 2e3,
2016
2111
  legacy: !0
2017
2112
  });
2018
- async function C(e) {
2113
+ async function S(e) {
2019
2114
  await t.uploadFiles(e);
2020
2115
  }
2021
- function T(e) {
2116
+ function C(e) {
2022
2117
  t.selectItem(e);
2023
2118
  }
2024
- async function E(e, n) {
2119
+ async function T(e, n) {
2025
2120
  await t.createFolder(e, n);
2026
2121
  }
2027
- async function D(e, n) {
2122
+ async function E(e, n) {
2028
2123
  await t.renameFolder(e, n);
2029
2124
  }
2030
- async function O(e) {
2125
+ async function D(e) {
2031
2126
  await t.deleteFolder(e);
2032
2127
  }
2033
- function k(e) {
2034
- u.value = e;
2128
+ function O(e) {
2129
+ l.value = e;
2035
2130
  }
2036
- async function A(e, n, r, i) {
2037
- i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r), u.value = null;
2131
+ async function k(e, n, r, i) {
2132
+ i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r), l.value = null;
2038
2133
  }
2039
- async function M(e) {
2040
- await t.importFromUrl(e) && (d.value = !1);
2134
+ async function A(e) {
2135
+ await t.importFromUrl(e) && (u.value = !1);
2041
2136
  }
2042
- async function N(e) {
2043
- f.value = !1, await t.moveSelected(e);
2137
+ async function M(e) {
2138
+ d.value = !1, await t.moveSelected(e);
2044
2139
  }
2045
- async function P() {
2140
+ async function N() {
2046
2141
  await t.checkUsageBeforeDelete();
2047
2142
  }
2048
- function F(e) {
2143
+ function P(e) {
2049
2144
  t.checkUsageBeforeReplace(e);
2050
2145
  }
2051
- async function I(e) {
2146
+ async function F(e) {
2052
2147
  await t.replaceFile(e);
2053
2148
  }
2054
- function L() {
2055
- t.clearSelection(), t.cancelDelete(), t.cancelReplace(), c.value = "", t.categoryFilter.value = null, t.sortOption.value = "newest", t.viewMode.value = "files", u.value = null, d.value = !1, l.value = "original";
2149
+ function I() {
2150
+ t.clearSelection(), t.cancelDelete(), t.cancelReplace(), o.value = "", t.categoryFilter.value = null, t.sortOption.value = "newest", t.viewMode.value = "files", l.value = null, u.value = !1, c.value = "original";
2056
2151
  }
2057
2152
  return {
2058
- layoutMode: a,
2059
- showSidebar: o,
2060
- searchInput: c,
2061
- selectedConversion: l,
2062
- editingItem: u,
2063
- showImportUrlModal: d,
2064
- showMovePicker: f,
2065
- selectedUrl: p,
2066
- hasFrequentlyUsed: m,
2067
- displayItems: h,
2068
- hasUsedFiles: g,
2069
- copy: x,
2070
- copied: S,
2071
- getCategoryLabel: v,
2072
- handleSearchInput: b,
2073
- handleUpload: C,
2074
- handleSelect: T,
2075
- handleCreateFolder: E,
2076
- handleRenameFolder: D,
2077
- handleDeleteFolder: O,
2078
- handleEditItem: k,
2079
- handleEditSave: A,
2080
- handleImportFromUrl: M,
2081
- handleMoveToFolder: N,
2082
- handleDeleteClick: P,
2083
- handleReplaceItem: F,
2084
- handleReplaceFile: I,
2085
- resetUI: L
2153
+ layoutMode: i,
2154
+ showSidebar: a,
2155
+ searchInput: o,
2156
+ selectedConversion: c,
2157
+ editingItem: l,
2158
+ showImportUrlModal: u,
2159
+ showMovePicker: d,
2160
+ selectedUrl: f,
2161
+ hasFrequentlyUsed: p,
2162
+ displayItems: m,
2163
+ hasUsedFiles: h,
2164
+ copy: b,
2165
+ copied: x,
2166
+ getCategoryLabel: _,
2167
+ handleSearchInput: y,
2168
+ handleUpload: S,
2169
+ handleSelect: C,
2170
+ handleCreateFolder: T,
2171
+ handleRenameFolder: E,
2172
+ handleDeleteFolder: D,
2173
+ handleEditItem: O,
2174
+ handleEditSave: k,
2175
+ handleImportFromUrl: A,
2176
+ handleMoveToFolder: M,
2177
+ handleDeleteClick: N,
2178
+ handleReplaceItem: P,
2179
+ handleReplaceFile: F,
2180
+ resetUI: I
2086
2181
  };
2087
2182
  }
2088
2183
  //#endregion
2184
+ //#region src/i18n/index.ts
2185
+ var rr = /* #__PURE__ */ Object.assign({
2186
+ "./locales/ca.ts": () => import("./ca-DnghH5Xn.js"),
2187
+ "./locales/de.ts": () => import("./de-ByQyu2jv.js"),
2188
+ "./locales/en.ts": () => Promise.resolve().then(() => be),
2189
+ "./locales/es.ts": () => import("./es-Bcp-DbmC.js"),
2190
+ "./locales/fr.ts": () => import("./fr-DXb0cCZG.js"),
2191
+ "./locales/nl.ts": () => import("./nl-DGT1t3Be.js"),
2192
+ "./locales/pt-BR.ts": () => import("./pt-BR-C0Hzc26R.js")
2193
+ });
2194
+ function ir(e) {
2195
+ return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
2196
+ }
2197
+ var ar = ir(rr);
2198
+ function or(e) {
2199
+ return e.trim().replace(/_/g, "-").toLowerCase();
2200
+ }
2201
+ function sr(e) {
2202
+ let t = or(e);
2203
+ return ar.find((e) => or(e) === t);
2204
+ }
2205
+ function cr(e) {
2206
+ return or(e).split("-")[0];
2207
+ }
2208
+ function lr(e) {
2209
+ return sr(e) ?? sr(cr(e)) ?? "en";
2210
+ }
2211
+ async function ur(e) {
2212
+ let t = rr[`./locales/${lr(e)}.ts`];
2213
+ return (await t()).default;
2214
+ }
2215
+ //#endregion
2089
2216
  //#region src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
2090
- var Yn = ["data-tpl-theme"], Xn = {
2217
+ var dr = ["data-tpl-theme"], fr = {
2091
2218
  class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
2092
2219
  style: {
2093
2220
  width: "900px",
@@ -2098,95 +2225,102 @@ var Yn = ["data-tpl-theme"], Xn = {
2098
2225
  border: "1px solid var(--tpl-border)",
2099
2226
  "box-shadow": "var(--tpl-shadow-xl)"
2100
2227
  }
2101
- }, Zn = {
2228
+ }, pr = {
2102
2229
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
2103
2230
  style: { "border-color": "var(--tpl-border)" }
2104
- }, Qn = {
2231
+ }, mr = {
2105
2232
  class: "tpl:text-sm tpl:font-semibold",
2106
2233
  style: { color: "var(--tpl-text)" }
2107
- }, $n = { class: "tpl:flex tpl:items-center tpl:gap-3" }, er = { class: "tpl:relative" }, tr = ["value", "placeholder"], nr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, rr = {
2234
+ }, hr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, gr = { class: "tpl:relative" }, _r = ["value", "placeholder"], vr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, yr = {
2108
2235
  key: 0,
2109
2236
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
2110
2237
  style: {
2111
2238
  "border-color": "var(--tpl-border)",
2112
2239
  "background-color": "var(--tpl-bg)"
2113
2240
  }
2114
- }, ir = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, ar = {
2241
+ }, br = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, xr = {
2115
2242
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
2116
2243
  style: { "border-color": "var(--tpl-border)" }
2117
- }, or = { class: "tpl:flex tpl:items-center tpl:gap-2" }, sr = ["title"], cr = {
2118
- key: 1,
2244
+ }, Sr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Cr = ["title"], wr = {
2245
+ key: 0,
2119
2246
  class: "tpl:text-xs tpl:font-medium",
2120
2247
  style: { color: "var(--tpl-text)" }
2121
- }, lr = {
2248
+ }, Tr = {
2122
2249
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
2123
2250
  style: {
2124
2251
  border: "1px solid var(--tpl-border)",
2125
2252
  "background-color": "var(--tpl-bg)"
2126
2253
  }
2127
- }, ur = ["title"], dr = ["title"], fr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, pr = ["value"], mr = { value: "" }, hr = ["value"], gr = ["value"], _r = { value: "newest" }, vr = { value: "oldest" }, yr = { value: "name_asc" }, br = { value: "name_desc" }, xr = { value: "size_asc" }, Sr = { value: "size_desc" }, Cr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, wr = {
2254
+ }, Er = ["title"], Dr = ["title"], Or = { class: "tpl:flex tpl:items-center tpl:gap-2" }, kr = ["value"], Ar = { value: "" }, jr = ["value"], Mr = ["value"], Nr = { value: "newest" }, Pr = { value: "oldest" }, Fr = { value: "name_asc" }, Ir = { value: "name_desc" }, Lr = { value: "size_asc" }, Rr = { value: "size_desc" }, zr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Br = {
2128
2255
  key: 0,
2129
2256
  class: "tpl:px-4 tpl:pt-3"
2130
- }, Tr = {
2257
+ }, Vr = {
2131
2258
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
2132
2259
  style: {
2133
2260
  "background-color": "var(--tpl-bg-elevated)",
2134
2261
  "box-shadow": "var(--tpl-shadow-xl)"
2135
2262
  }
2136
- }, Er = {
2263
+ }, Hr = {
2137
2264
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
2138
2265
  style: { color: "var(--tpl-text)" }
2139
- }, Dr = {
2266
+ }, Ur = {
2140
2267
  key: 0,
2141
2268
  class: "tpl:mb-4 tpl:text-xs",
2142
2269
  style: { color: "var(--tpl-text-muted)" }
2143
- }, Or = {
2270
+ }, Wr = {
2144
2271
  key: 1,
2145
2272
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
2146
2273
  style: { "border-color": "var(--tpl-border)" }
2147
- }, kr = { class: "tpl:font-medium" }, Ar = { style: { color: "var(--tpl-text-muted)" } }, jr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Mr = {
2274
+ }, Gr = { class: "tpl:font-medium" }, Kr = { style: { color: "var(--tpl-text-muted)" } }, qr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Jr = {
2148
2275
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
2149
2276
  style: { "border-color": "var(--tpl-border)" }
2150
- }, Nr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Pr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Fr = {
2277
+ }, Yr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Xr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Zr = {
2151
2278
  key: 0,
2152
2279
  class: "tpl:flex tpl:items-center tpl:gap-2"
2153
- }, Ir = {
2154
- key: 1,
2155
- class: "tpl:relative"
2156
- }, Lr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Rr = ["disabled"], zr = /* @__PURE__ */ h({
2280
+ }, Qr = { class: "tpl:relative" }, $r = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ei = ["disabled"], ti = /* @__PURE__ */ h({
2157
2281
  __name: "MediaLibraryModal",
2158
2282
  props: {
2159
2283
  visible: { type: Boolean },
2160
2284
  accept: {},
2161
- popoverTarget: {}
2285
+ authManager: {},
2286
+ projectId: {},
2287
+ planConfig: {},
2288
+ popoverTarget: {},
2289
+ locale: {},
2290
+ uiTheme: {}
2162
2291
  },
2163
2292
  emits: ["close", "select"],
2164
2293
  setup(e, { emit: t }) {
2165
- let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme"), g = O(() => n.popoverTarget ?? null);
2166
- C(Se, g);
2167
- let v = _("authManager"), x = _("projectId"), w = s(() => x.value), E = _("planConfig"), A = s(() => E.hasFeature("media_folders")), N = s(() => E.hasFeature("import_from_url")), P = s(() => E.config.value?.storage.used_bytes ?? 0), L = s(() => E.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: z, availableCategories: B } = Q(), W = fe({
2168
- projectId: w.value,
2169
- authManager: v
2170
- }), K = Jn({
2171
- library: W,
2172
- canUseMediaFolders: A,
2173
- translations: c
2294
+ let n = e, r = t, c = w(null);
2295
+ j(() => n.locale, async (e) => {
2296
+ c.value = await ur(e ?? "en");
2297
+ }, { immediate: !0 }), C(ve, c);
2298
+ let h = s(() => c.value), g = s(() => n.uiTheme);
2299
+ C(ye, g);
2300
+ let _ = O(() => n.popoverTarget ?? null);
2301
+ C(_e, _), C(ge, n.planConfig);
2302
+ let v = s(() => n.planConfig.config.value?.storage.used_bytes ?? 0), x = s(() => n.planConfig.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: E, availableCategories: A } = Z(n.planConfig), N = he({
2303
+ projectId: n.projectId,
2304
+ authManager: n.authManager
2305
+ }), P = nr({
2306
+ library: N,
2307
+ translations: h
2174
2308
  });
2175
2309
  j(() => n.visible, (e) => {
2176
- e ? (W.loadItems(), W.loadFrequentlyUsed()) : K.resetUI();
2310
+ e ? (N.loadItems(), N.loadFrequentlyUsed()) : P.resetUI();
2177
2311
  });
2178
- function q(e) {
2312
+ function L(e) {
2179
2313
  e.key === "Escape" && r("close");
2180
2314
  }
2181
- ce(document, "keydown", q);
2182
- function J() {
2183
- return W.previewItem.value ? !n.accept?.length || z(W.previewItem.value.mime_type, n.accept) : !1;
2315
+ le(document, "keydown", L);
2316
+ function z() {
2317
+ return N.previewItem.value ? !n.accept?.length || E(N.previewItem.value.mime_type, n.accept) : !1;
2184
2318
  }
2185
- function ee() {
2186
- if (J()) {
2187
- let e = W.previewItem.value, t = {
2319
+ function B() {
2320
+ if (z()) {
2321
+ let e = N.previewItem.value, t = {
2188
2322
  ...e,
2189
- url: K.selectedUrl.value || e.url
2323
+ url: P.selectedUrl.value || e.url
2190
2324
  };
2191
2325
  r("select", t), r("close");
2192
2326
  }
@@ -2199,20 +2333,20 @@ var Yn = ["data-tpl-theme"], Xn = {
2199
2333
  "leave-from-class": "tpl:opacity-100",
2200
2334
  "leave-to-class": "tpl:opacity-0"
2201
2335
  }, {
2202
- default: M(() => [e.visible ? (S(), d("div", {
2336
+ default: M(() => [e.visible && c.value ? (S(), d("div", {
2203
2337
  key: 0,
2204
- "data-tpl-theme": k(h),
2338
+ "data-tpl-theme": g.value,
2205
2339
  class: "tpl tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-[9999]",
2206
2340
  onClick: n[18] ||= F((e) => r("close"), ["self"])
2207
- }, [f("div", Xn, [
2208
- f("div", Zn, [f("h2", Qn, D(k(c).mediaLibrary.title), 1), f("div", $n, [
2209
- m(qn, {
2210
- "used-bytes": P.value,
2211
- "limit-bytes": L.value,
2341
+ }, [f("div", fr, [
2342
+ f("div", pr, [f("h2", mr, D(h.value.mediaLibrary.title), 1), f("div", hr, [
2343
+ m(tr, {
2344
+ "used-bytes": v.value,
2345
+ "limit-bytes": x.value,
2212
2346
  size: 22
2213
2347
  }, null, 8, ["used-bytes", "limit-bytes"]),
2214
- f("div", er, [f("input", {
2215
- value: k(K).searchInput.value,
2348
+ f("div", gr, [f("input", {
2349
+ value: k(P).searchInput.value,
2216
2350
  type: "text",
2217
2351
  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)]",
2218
2352
  style: {
@@ -2220,9 +2354,9 @@ var Yn = ["data-tpl-theme"], Xn = {
2220
2354
  "background-color": "var(--tpl-bg)",
2221
2355
  color: "var(--tpl-text)"
2222
2356
  },
2223
- placeholder: k(c).mediaLibrary.searchPlaceholder,
2224
- onInput: n[0] ||= (e) => k(K).handleSearchInput(e.target.value)
2225
- }, null, 40, tr), m(k(Y), {
2357
+ placeholder: h.value.mediaLibrary.searchPlaceholder,
2358
+ onInput: n[0] ||= (e) => k(P).handleSearchInput(e.target.value)
2359
+ }, null, 40, _r), m(k(J), {
2226
2360
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
2227
2361
  size: 13,
2228
2362
  "stroke-width": 2,
@@ -2232,12 +2366,12 @@ var Yn = ["data-tpl-theme"], Xn = {
2232
2366
  class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2233
2367
  style: { color: "var(--tpl-text-muted)" },
2234
2368
  onClick: n[1] ||= (e) => r("close")
2235
- }, [m(k(ne), {
2369
+ }, [m(k(re), {
2236
2370
  size: 18,
2237
2371
  "stroke-width": 2
2238
2372
  })])
2239
2373
  ])]),
2240
- f("div", nr, [m(o, {
2374
+ f("div", vr, [m(o, {
2241
2375
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
2242
2376
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
2243
2377
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -2245,16 +2379,16 @@ var Yn = ["data-tpl-theme"], Xn = {
2245
2379
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
2246
2380
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
2247
2381
  }, {
2248
- default: M(() => [A.value && k(K).showSidebar.value ? (S(), d("div", rr, [m(gt, {
2249
- folders: k(W).folders.value,
2250
- "current-folder-id": k(W).currentFolderId.value,
2251
- "view-mode": k(W).viewMode.value,
2252
- "has-frequently-used": k(K).hasFrequentlyUsed.value,
2253
- onNavigate: k(W).navigateToFolder,
2254
- onCreateFolder: k(K).handleCreateFolder,
2255
- onRenameFolder: k(K).handleRenameFolder,
2256
- onDeleteFolder: k(K).handleDeleteFolder,
2257
- onShowFrequentlyUsed: k(W).showFrequentlyUsed
2382
+ default: M(() => [k(P).showSidebar.value ? (S(), d("div", yr, [m(wt, {
2383
+ folders: k(N).folders.value,
2384
+ "current-folder-id": k(N).currentFolderId.value,
2385
+ "view-mode": k(N).viewMode.value,
2386
+ "has-frequently-used": k(P).hasFrequentlyUsed.value,
2387
+ onNavigate: k(N).navigateToFolder,
2388
+ onCreateFolder: k(P).handleCreateFolder,
2389
+ onRenameFolder: k(P).handleRenameFolder,
2390
+ onDeleteFolder: k(P).handleDeleteFolder,
2391
+ onShowFrequentlyUsed: k(N).showFrequentlyUsed
2258
2392
  }, null, 8, [
2259
2393
  "folders",
2260
2394
  "current-folder-id",
@@ -2267,55 +2401,54 @@ var Yn = ["data-tpl-theme"], Xn = {
2267
2401
  "onShowFrequentlyUsed"
2268
2402
  ])])) : u("", !0)]),
2269
2403
  _: 1
2270
- }), f("div", ir, [f("div", ar, [f("div", or, [
2271
- A.value ? (S(), d("button", {
2272
- key: 0,
2404
+ }), f("div", br, [f("div", xr, [f("div", Sr, [
2405
+ f("button", {
2273
2406
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2274
2407
  style: b({
2275
- color: k(K).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2276
- backgroundColor: k(K).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2277
- border: k(K).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2408
+ color: k(P).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2409
+ backgroundColor: k(P).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2410
+ border: k(P).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2278
2411
  }),
2279
- title: k(K).showSidebar.value ? k(c).mediaLibrary.hideFolders : k(c).mediaLibrary.showFolders,
2280
- onClick: n[2] ||= (e) => k(K).showSidebar.value = !k(K).showSidebar.value
2412
+ title: k(P).showSidebar.value ? h.value.mediaLibrary.hideFolders : h.value.mediaLibrary.showFolders,
2413
+ onClick: n[2] ||= (e) => k(P).showSidebar.value = !k(P).showSidebar.value
2281
2414
  }, [m(k(G), {
2282
2415
  size: 16,
2283
2416
  "stroke-width": 2
2284
- })], 12, sr)) : u("", !0),
2285
- k(W).viewMode.value === "frequently-used" ? (S(), d("span", cr, D(k(c).mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2286
- key: 2,
2287
- folders: k(W).folders.value,
2288
- "current-folder-id": k(W).currentFolderId.value,
2289
- onNavigate: k(W).navigateToFolder
2417
+ })], 12, Cr),
2418
+ k(N).viewMode.value === "frequently-used" ? (S(), d("span", wr, D(h.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(Te, {
2419
+ key: 1,
2420
+ folders: k(N).folders.value,
2421
+ "current-folder-id": k(N).currentFolderId.value,
2422
+ onNavigate: k(N).navigateToFolder
2290
2423
  }, null, 8, [
2291
2424
  "folders",
2292
2425
  "current-folder-id",
2293
2426
  "onNavigate"
2294
2427
  ])),
2295
- f("div", lr, [f("button", {
2428
+ f("div", Tr, [f("button", {
2296
2429
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2297
2430
  style: b({
2298
- color: k(K).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2299
- backgroundColor: k(K).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2431
+ color: k(P).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2432
+ backgroundColor: k(P).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2300
2433
  }),
2301
- title: k(c).mediaLibrary.viewGrid,
2302
- onClick: n[3] ||= (e) => k(K).layoutMode.value = "grid"
2434
+ title: h.value.mediaLibrary.viewGrid,
2435
+ onClick: n[3] ||= (e) => k(P).layoutMode.value = "grid"
2303
2436
  }, [m(k(V), {
2304
2437
  size: 14,
2305
2438
  "stroke-width": 2
2306
- })], 12, ur), f("button", {
2439
+ })], 12, Er), f("button", {
2307
2440
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2308
2441
  style: b({
2309
- color: k(K).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2310
- backgroundColor: k(K).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2442
+ color: k(P).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2443
+ backgroundColor: k(P).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2311
2444
  }),
2312
- title: k(c).mediaLibrary.viewList,
2313
- onClick: n[4] ||= (e) => k(K).layoutMode.value = "list"
2445
+ title: h.value.mediaLibrary.viewList,
2446
+ onClick: n[4] ||= (e) => k(P).layoutMode.value = "list"
2314
2447
  }, [m(k(U), {
2315
2448
  size: 14,
2316
2449
  "stroke-width": 2
2317
- })], 12, dr)])
2318
- ]), f("div", fr, [k(B).length > 1 ? (S(), d("select", {
2450
+ })], 12, Dr)])
2451
+ ]), f("div", Or, [k(A).length > 1 ? (S(), d("select", {
2319
2452
  key: 0,
2320
2453
  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",
2321
2454
  style: {
@@ -2323,59 +2456,58 @@ var Yn = ["data-tpl-theme"], Xn = {
2323
2456
  "background-color": "var(--tpl-bg)",
2324
2457
  color: "var(--tpl-text)"
2325
2458
  },
2326
- value: k(W).categoryFilter.value ?? "",
2327
- onChange: n[5] ||= (e) => k(W).filterByCategory(e.target.value || null)
2328
- }, [f("option", mr, D(k(c).mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(B), (e) => (S(), d("option", {
2459
+ value: k(N).categoryFilter.value ?? "",
2460
+ onChange: n[5] ||= (e) => k(N).filterByCategory(e.target.value || null)
2461
+ }, [f("option", Ar, D(h.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(A), (e) => (S(), d("option", {
2329
2462
  key: e,
2330
2463
  value: e
2331
- }, D(k(K).getCategoryLabel(e)), 9, hr))), 128))], 40, pr)) : u("", !0), f("select", {
2464
+ }, D(k(P).getCategoryLabel(e)), 9, jr))), 128))], 40, kr)) : u("", !0), f("select", {
2332
2465
  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",
2333
2466
  style: {
2334
2467
  "border-color": "var(--tpl-border)",
2335
2468
  "background-color": "var(--tpl-bg)",
2336
2469
  color: "var(--tpl-text)"
2337
2470
  },
2338
- value: k(W).sortOption.value,
2339
- onChange: n[6] ||= (e) => k(W).sortBy(e.target.value)
2471
+ value: k(N).sortOption.value,
2472
+ onChange: n[6] ||= (e) => k(N).sortBy(e.target.value)
2340
2473
  }, [
2341
- f("option", _r, D(k(c).mediaLibrary.sortNewest), 1),
2342
- f("option", vr, D(k(c).mediaLibrary.sortOldest), 1),
2343
- f("option", yr, D(k(c).mediaLibrary.sortNameAsc), 1),
2344
- f("option", br, D(k(c).mediaLibrary.sortNameDesc), 1),
2345
- f("option", xr, D(k(c).mediaLibrary.sortSizeAsc), 1),
2346
- f("option", Sr, D(k(c).mediaLibrary.sortSizeDesc), 1)
2347
- ], 40, gr)])]), f("div", Cr, [k(W).viewMode.value === "files" ? (S(), d("div", wr, [m(Hn, {
2348
- "is-uploading": k(W).isUploading.value,
2349
- "upload-progress": k(W).uploadProgress.value,
2350
- onUpload: k(K).handleUpload
2474
+ f("option", Nr, D(h.value.mediaLibrary.sortNewest), 1),
2475
+ f("option", Pr, D(h.value.mediaLibrary.sortOldest), 1),
2476
+ f("option", Fr, D(h.value.mediaLibrary.sortNameAsc), 1),
2477
+ f("option", Ir, D(h.value.mediaLibrary.sortNameDesc), 1),
2478
+ f("option", Lr, D(h.value.mediaLibrary.sortSizeAsc), 1),
2479
+ f("option", Rr, D(h.value.mediaLibrary.sortSizeDesc), 1)
2480
+ ], 40, Mr)])]), f("div", zr, [k(N).viewMode.value === "files" ? (S(), d("div", Br, [m(Xn, {
2481
+ "is-uploading": k(N).isUploading.value,
2482
+ "upload-progress": k(N).uploadProgress.value,
2483
+ onUpload: k(P).handleUpload
2351
2484
  }, null, 8, [
2352
2485
  "is-uploading",
2353
2486
  "upload-progress",
2354
2487
  "onUpload"
2355
- ]), N.value ? (S(), d("button", {
2356
- key: 0,
2488
+ ]), f("button", {
2357
2489
  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",
2358
2490
  style: {
2359
2491
  "border-color": "var(--tpl-border)",
2360
2492
  color: "var(--tpl-text-muted)",
2361
2493
  "background-color": "var(--tpl-bg)"
2362
2494
  },
2363
- onClick: n[7] ||= (e) => k(K).showImportUrlModal.value = !0
2495
+ onClick: n[7] ||= (e) => k(P).showImportUrlModal.value = !0
2364
2496
  }, [m(k(H), {
2365
2497
  size: 14,
2366
2498
  "stroke-width": 2
2367
- }), p(" " + D(k(c).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(qt, {
2368
- items: k(K).displayItems.value,
2369
- "selected-ids": k(W).selectedItems.value,
2370
- "is-loading": k(W).isLoading.value,
2371
- "has-more": k(W).viewMode.value === "files" && k(W).hasMore.value,
2499
+ }), p(" " + D(h.value.mediaLibrary.importFromUrl), 1)])])) : u("", !0), m(tn, {
2500
+ items: k(P).displayItems.value,
2501
+ "selected-ids": k(N).selectedItems.value,
2502
+ "is-loading": k(N).isLoading.value,
2503
+ "has-more": k(N).viewMode.value === "files" && k(N).hasMore.value,
2372
2504
  accept: e.accept,
2373
- layout: k(K).layoutMode.value,
2374
- onSelect: k(K).handleSelect,
2375
- onToggle: k(W).toggleSelection,
2376
- onLoadMore: k(W).loadMore,
2377
- onEdit: k(K).handleEditItem,
2378
- onReplace: k(K).handleReplaceItem
2505
+ layout: k(P).layoutMode.value,
2506
+ onSelect: k(P).handleSelect,
2507
+ onToggle: k(N).toggleSelection,
2508
+ onLoadMore: k(N).loadMore,
2509
+ onEdit: k(P).handleEditItem,
2510
+ onReplace: k(P).handleReplaceItem
2379
2511
  }, null, 8, [
2380
2512
  "items",
2381
2513
  "selected-ids",
@@ -2389,36 +2521,36 @@ var Yn = ["data-tpl-theme"], Xn = {
2389
2521
  "onEdit",
2390
2522
  "onReplace"
2391
2523
  ])])])]),
2392
- m(on, {
2393
- visible: k(K).showImportUrlModal.value,
2394
- "is-importing": k(W).isImportingFromUrl.value,
2395
- error: k(W).importFromUrlError.value,
2396
- onImport: k(K).handleImportFromUrl,
2397
- onClose: n[8] ||= (e) => k(K).showImportUrlModal.value = !1
2524
+ m(mn, {
2525
+ visible: k(P).showImportUrlModal.value,
2526
+ "is-importing": k(N).isImportingFromUrl.value,
2527
+ error: k(N).importFromUrlError.value,
2528
+ onImport: k(P).handleImportFromUrl,
2529
+ onClose: n[8] ||= (e) => k(P).showImportUrlModal.value = !1
2398
2530
  }, null, 8, [
2399
2531
  "visible",
2400
2532
  "is-importing",
2401
2533
  "error",
2402
2534
  "onImport"
2403
2535
  ]),
2404
- m(it, {
2405
- visible: !!k(K).editingItem.value,
2406
- item: k(K).editingItem.value,
2407
- onSave: k(K).handleEditSave,
2408
- onClose: n[9] ||= (e) => k(K).editingItem.value = null
2536
+ m(ft, {
2537
+ visible: !!k(P).editingItem.value,
2538
+ item: k(P).editingItem.value,
2539
+ onSave: k(P).handleEditSave,
2540
+ onClose: n[9] ||= (e) => k(P).editingItem.value = null
2409
2541
  }, null, 8, [
2410
2542
  "visible",
2411
2543
  "item",
2412
2544
  "onSave"
2413
2545
  ]),
2414
- m(Ln, {
2415
- visible: k(W).showReplaceWarning.value,
2416
- item: k(W).pendingReplaceItem.value,
2417
- "usage-info": k(W).replaceUsageInfo.value,
2418
- "is-replacing": k(W).isReplacing.value,
2419
- error: k(W).replaceError.value,
2420
- onReplace: k(K).handleReplaceFile,
2421
- onClose: k(W).cancelReplace
2546
+ m(Gn, {
2547
+ visible: k(N).showReplaceWarning.value,
2548
+ item: k(N).pendingReplaceItem.value,
2549
+ "usage-info": k(N).replaceUsageInfo.value,
2550
+ "is-replacing": k(N).isReplacing.value,
2551
+ error: k(N).replaceError.value,
2552
+ onReplace: k(P).handleReplaceFile,
2553
+ onClose: k(N).cancelReplace
2422
2554
  }, null, 8, [
2423
2555
  "visible",
2424
2556
  "item",
@@ -2436,7 +2568,7 @@ var Yn = ["data-tpl-theme"], Xn = {
2436
2568
  "leave-from-class": "tpl:opacity-100",
2437
2569
  "leave-to-class": "tpl:opacity-0"
2438
2570
  }, {
2439
- default: M(() => [k(W).showDeleteWarning.value ? (S(), d("div", {
2571
+ default: M(() => [k(N).showDeleteWarning.value ? (S(), d("div", {
2440
2572
  key: 0,
2441
2573
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
2442
2574
  style: {
@@ -2444,59 +2576,59 @@ var Yn = ["data-tpl-theme"], Xn = {
2444
2576
  "backdrop-filter": "blur(8px)",
2445
2577
  "-webkit-backdrop-filter": "blur(8px)"
2446
2578
  },
2447
- onClick: n[12] ||= F((...e) => k(W).cancelDelete && k(W).cancelDelete(...e), ["self"])
2448
- }, [f("div", Tr, [
2449
- f("h3", Er, D(k(c).mediaLibrary.deleteWarningTitle), 1),
2579
+ onClick: n[12] ||= F((...e) => k(N).cancelDelete && k(N).cancelDelete(...e), ["self"])
2580
+ }, [f("div", Vr, [
2581
+ f("h3", Hr, D(h.value.mediaLibrary.deleteWarningTitle), 1),
2450
2582
  f("p", {
2451
- class: y(["tpl:text-xs", k(K).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2583
+ class: y(["tpl:text-xs", k(P).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2452
2584
  style: { color: "var(--tpl-text-muted)" }
2453
- }, D(k(c).mediaLibrary.deleteWarningMessage), 3),
2454
- k(K).hasUsedFiles.value ? (S(), d("p", Dr, D(k(c).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2455
- k(K).hasUsedFiles.value ? (S(), d("div", Or, [(S(!0), d(i, null, T(k(W).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2585
+ }, D(h.value.mediaLibrary.deleteWarningMessage), 3),
2586
+ k(P).hasUsedFiles.value ? (S(), d("p", Ur, D(h.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2587
+ k(P).hasUsedFiles.value ? (S(), d("div", Wr, [(S(!0), d(i, null, T(k(N).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2456
2588
  key: t,
2457
2589
  class: "tpl:text-xs",
2458
2590
  style: { color: "var(--tpl-text)" }
2459
- }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", kr, D(k(K).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Ar, " - " + D(k(c).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2460
- f("div", jr, [f("button", {
2591
+ }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Gr, D(k(P).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Kr, " - " + D(h.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2592
+ f("div", qr, [f("button", {
2461
2593
  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",
2462
2594
  style: {
2463
2595
  "border-color": "var(--tpl-border)",
2464
2596
  color: "var(--tpl-text)",
2465
2597
  "background-color": "var(--tpl-bg)"
2466
2598
  },
2467
- onClick: n[10] ||= (...e) => k(W).cancelDelete && k(W).cancelDelete(...e)
2468
- }, D(k(c).mediaLibrary.cancel), 1), f("button", {
2599
+ onClick: n[10] ||= (...e) => k(N).cancelDelete && k(N).cancelDelete(...e)
2600
+ }, D(h.value.mediaLibrary.cancel), 1), f("button", {
2469
2601
  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",
2470
2602
  style: {
2471
2603
  "border-color": "var(--tpl-danger)",
2472
2604
  color: "var(--tpl-danger)",
2473
2605
  "background-color": "var(--tpl-danger-light)"
2474
2606
  },
2475
- onClick: n[11] ||= (...e) => k(W).confirmDelete && k(W).confirmDelete(...e)
2476
- }, D(k(K).hasUsedFiles.value ? k(c).mediaLibrary.deleteAnyway : k(c).mediaLibrary.confirmDelete), 1)])
2607
+ onClick: n[11] ||= (...e) => k(N).confirmDelete && k(N).confirmDelete(...e)
2608
+ }, D(k(P).hasUsedFiles.value ? h.value.mediaLibrary.deleteAnyway : h.value.mediaLibrary.confirmDelete), 1)])
2477
2609
  ])])) : u("", !0)]),
2478
2610
  _: 1
2479
2611
  }),
2480
- f("div", Mr, [f("div", Nr, [k(W).previewItem.value ? (S(), l(Sn, {
2612
+ f("div", Jr, [f("div", Yr, [k(N).previewItem.value ? (S(), l(An, {
2481
2613
  key: 0,
2482
- "selected-conversion": k(K).selectedConversion.value,
2483
- "onUpdate:selectedConversion": n[13] ||= (e) => k(K).selectedConversion.value = e,
2484
- item: k(W).previewItem.value,
2485
- folders: k(W).folders.value
2614
+ "selected-conversion": k(P).selectedConversion.value,
2615
+ "onUpdate:selectedConversion": n[13] ||= (e) => k(P).selectedConversion.value = e,
2616
+ item: k(N).previewItem.value,
2617
+ folders: k(N).folders.value
2486
2618
  }, null, 8, [
2487
2619
  "selected-conversion",
2488
2620
  "item",
2489
2621
  "folders"
2490
- ])) : u("", !0)]), f("div", Pr, [k(W).selectedItems.value.size > 0 ? (S(), d("div", Fr, [k(W).previewItem.value ? (S(), d("button", {
2622
+ ])) : u("", !0)]), f("div", Xr, [k(N).selectedItems.value.size > 0 ? (S(), d("div", Zr, [k(N).previewItem.value ? (S(), d("button", {
2491
2623
  key: 0,
2492
2624
  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",
2493
2625
  style: b({
2494
- borderColor: k(K).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2495
- color: k(K).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2626
+ borderColor: k(P).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2627
+ color: k(P).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2496
2628
  backgroundColor: "var(--tpl-bg)"
2497
2629
  }),
2498
- onClick: n[14] ||= (e) => k(K).copy(k(K).selectedUrl.value)
2499
- }, [k(K).copied.value ? (S(), l(k(I), {
2630
+ onClick: n[14] ||= (e) => k(P).copy(k(P).selectedUrl.value)
2631
+ }, [k(P).copied.value ? (S(), l(k(I), {
2500
2632
  key: 1,
2501
2633
  size: 12,
2502
2634
  "stroke-width": 2
@@ -2504,25 +2636,25 @@ var Yn = ["data-tpl-theme"], Xn = {
2504
2636
  key: 0,
2505
2637
  size: 12,
2506
2638
  "stroke-width": 2
2507
- })), p(" " + D(k(K).copied.value ? k(c).mediaLibrary.copied : k(c).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), A.value ? (S(), d("div", Ir, [f("button", {
2639
+ })), p(" " + D(k(P).copied.value ? h.value.mediaLibrary.copied : h.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), f("div", Qr, [f("button", {
2508
2640
  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",
2509
2641
  style: {
2510
2642
  "border-color": "var(--tpl-border)",
2511
2643
  color: "var(--tpl-text)",
2512
2644
  "background-color": "var(--tpl-bg)"
2513
2645
  },
2514
- onClick: n[15] ||= (e) => k(K).showMovePicker.value = !k(K).showMovePicker.value
2515
- }, D(k(c).mediaLibrary.moveSelected), 1), k(K).showMovePicker.value ? (S(), l(dn, {
2646
+ onClick: n[15] ||= (e) => k(P).showMovePicker.value = !k(P).showMovePicker.value
2647
+ }, D(h.value.mediaLibrary.moveSelected), 1), k(P).showMovePicker.value ? (S(), l(yn, {
2516
2648
  key: 0,
2517
- folders: k(W).folders.value,
2518
- "current-folder-id": k(W).currentFolderId.value,
2519
- onSelect: k(K).handleMoveToFolder,
2520
- onClose: n[16] ||= (e) => k(K).showMovePicker.value = !1
2649
+ folders: k(N).folders.value,
2650
+ "current-folder-id": k(N).currentFolderId.value,
2651
+ onSelect: k(P).handleMoveToFolder,
2652
+ onClose: n[16] ||= (e) => k(P).showMovePicker.value = !1
2521
2653
  }, null, 8, [
2522
2654
  "folders",
2523
2655
  "current-folder-id",
2524
2656
  "onSelect"
2525
- ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Lr, [k(W).selectedItems.value.size > 0 ? (S(), d("button", {
2657
+ ])) : u("", !0)])])) : u("", !0), f("div", $r, [k(N).selectedItems.value.size > 0 ? (S(), d("button", {
2526
2658
  key: 0,
2527
2659
  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",
2528
2660
  style: {
@@ -2530,43 +2662,43 @@ var Yn = ["data-tpl-theme"], Xn = {
2530
2662
  color: "var(--tpl-danger)",
2531
2663
  "background-color": "var(--tpl-danger-light)"
2532
2664
  },
2533
- onClick: n[17] ||= (...e) => k(K).handleDeleteClick && k(K).handleDeleteClick(...e)
2534
- }, D(k(c).mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
2665
+ onClick: n[17] ||= (...e) => k(P).handleDeleteClick && k(P).handleDeleteClick(...e)
2666
+ }, D(h.value.mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
2535
2667
  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",
2536
2668
  style: {
2537
2669
  "background-color": "var(--tpl-primary)",
2538
2670
  color: "var(--tpl-bg)"
2539
2671
  },
2540
- disabled: !J(),
2541
- onClick: ee
2542
- }, D(e.accept?.length ? k(c).mediaLibrary.selectImage : k(c).mediaLibrary.selectFile), 9, Rr)])])])
2543
- ])], 8, Yn)) : u("", !0)]),
2672
+ disabled: !z(),
2673
+ onClick: B
2674
+ }, D(e.accept?.length ? h.value.mediaLibrary.selectImage : h.value.mediaLibrary.selectFile), 9, ei)])])])
2675
+ ])], 8, dr)) : u("", !0)]),
2544
2676
  _: 1
2545
2677
  })], 8, ["to"]));
2546
2678
  }
2547
2679
  });
2548
2680
  //#endregion
2549
2681
  //#region src/composables/useMediaPicker.ts
2550
- function Br() {
2551
- let e = _("onRequestMedia"), t = _("planConfig"), n = w(!1), r = s(() => !!e && t.hasFeature("pluggable_media"));
2552
- async function i(t) {
2682
+ function ni() {
2683
+ let e = _("onRequestMedia"), t = w(!1), n = s(() => !!e);
2684
+ async function r(n) {
2553
2685
  if (!e) return null;
2554
- n.value = !0;
2686
+ t.value = !0;
2555
2687
  try {
2556
- return await e(t ?? {});
2688
+ return await e(n ?? {});
2557
2689
  } finally {
2558
- n.value = !1;
2690
+ t.value = !1;
2559
2691
  }
2560
2692
  }
2561
2693
  return {
2562
- isPluggableMediaEnabled: r,
2563
- isRequesting: n,
2564
- requestMedia: i
2694
+ isPluggableMediaEnabled: n,
2695
+ isRequesting: t,
2696
+ requestMedia: r
2565
2697
  };
2566
2698
  }
2567
2699
  //#endregion
2568
2700
  //#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
2569
- var Vr = {
2701
+ var ri = {
2570
2702
  class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
2571
2703
  style: {
2572
2704
  width: "100%",
@@ -2574,62 +2706,59 @@ var Vr = {
2574
2706
  "background-color": "var(--tpl-bg-elevated)",
2575
2707
  border: "1px solid var(--tpl-border)"
2576
2708
  }
2577
- }, Hr = {
2709
+ }, ii = {
2578
2710
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
2579
2711
  style: { "border-color": "var(--tpl-border)" }
2580
- }, Ur = {
2712
+ }, ai = {
2581
2713
  class: "tpl:text-sm tpl:font-semibold",
2582
2714
  style: { color: "var(--tpl-text)" }
2583
- }, Wr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Gr = { class: "tpl:relative" }, Kr = ["value", "placeholder"], qr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Jr = {
2715
+ }, oi = { class: "tpl:flex tpl:items-center tpl:gap-3" }, si = { class: "tpl:relative" }, ci = ["value", "placeholder"], li = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ui = {
2584
2716
  key: 0,
2585
2717
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
2586
2718
  style: {
2587
2719
  "border-color": "var(--tpl-border)",
2588
2720
  "background-color": "var(--tpl-bg)"
2589
2721
  }
2590
- }, Yr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Xr = {
2722
+ }, di = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, fi = {
2591
2723
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
2592
2724
  style: { "border-color": "var(--tpl-border)" }
2593
- }, Zr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Qr = ["title"], $r = {
2594
- key: 1,
2725
+ }, pi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, mi = ["title"], hi = {
2726
+ key: 0,
2595
2727
  class: "tpl:text-xs tpl:font-medium",
2596
2728
  style: { color: "var(--tpl-text)" }
2597
- }, ei = {
2729
+ }, gi = {
2598
2730
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
2599
2731
  style: {
2600
2732
  border: "1px solid var(--tpl-border)",
2601
2733
  "background-color": "var(--tpl-bg)"
2602
2734
  }
2603
- }, ti = ["title"], ni = ["title"], ri = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ii = ["value"], ai = { value: "" }, oi = ["value"], si = ["value"], ci = { value: "newest" }, li = { value: "oldest" }, ui = { value: "name_asc" }, di = { value: "name_desc" }, fi = { value: "size_asc" }, pi = { value: "size_desc" }, mi = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, hi = {
2735
+ }, _i = ["title"], vi = ["title"], yi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, bi = ["value"], xi = { value: "" }, Si = ["value"], Ci = ["value"], wi = { value: "newest" }, Ti = { value: "oldest" }, Ei = { value: "name_asc" }, Di = { value: "name_desc" }, Oi = { value: "size_asc" }, ki = { value: "size_desc" }, Ai = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, ji = {
2604
2736
  key: 0,
2605
2737
  class: "tpl:px-4 tpl:pt-3"
2606
- }, gi = {
2738
+ }, Mi = {
2607
2739
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
2608
2740
  style: {
2609
2741
  "background-color": "var(--tpl-bg-elevated)",
2610
2742
  "box-shadow": "var(--tpl-shadow-xl)"
2611
2743
  }
2612
- }, _i = {
2744
+ }, Ni = {
2613
2745
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
2614
2746
  style: { color: "var(--tpl-text)" }
2615
- }, vi = {
2747
+ }, Pi = {
2616
2748
  key: 0,
2617
2749
  class: "tpl:mb-4 tpl:text-xs",
2618
2750
  style: { color: "var(--tpl-text-muted)" }
2619
- }, yi = {
2751
+ }, Fi = {
2620
2752
  key: 1,
2621
2753
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
2622
2754
  style: { "border-color": "var(--tpl-border)" }
2623
- }, bi = { class: "tpl:font-medium" }, xi = { style: { color: "var(--tpl-text-muted)" } }, Si = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ci = {
2755
+ }, Ii = { class: "tpl:font-medium" }, Li = { style: { color: "var(--tpl-text-muted)" } }, Ri = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, zi = {
2624
2756
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
2625
2757
  style: { "border-color": "var(--tpl-border)" }
2626
- }, wi = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Ti = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ei = {
2758
+ }, Bi = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Vi = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Hi = {
2627
2759
  key: 0,
2628
2760
  class: "tpl:flex tpl:items-center tpl:gap-2"
2629
- }, Di = {
2630
- key: 1,
2631
- class: "tpl:relative"
2632
- }, Oi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ki = ["disabled"], Ai = /* @__PURE__ */ h({
2761
+ }, Ui = { class: "tpl:relative" }, Wi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Gi = ["disabled"], Ki = /* @__PURE__ */ h({
2633
2762
  __name: "MediaLibrary",
2634
2763
  props: {
2635
2764
  authManager: {},
@@ -2642,41 +2771,40 @@ var Vr = {
2642
2771
  emits: ["ready"],
2643
2772
  setup(e, { emit: t }) {
2644
2773
  let n = e, r = t, a = s(() => n.translations);
2645
- C("translations", n.translations), C("authManager", n.authManager), C("projectId", s(() => n.projectId));
2646
- let c = w(n.planConfig);
2647
- C("planConfig", {
2648
- config: c,
2774
+ C(ve, w(n.translations));
2775
+ let c = {
2776
+ config: w(n.planConfig),
2649
2777
  isLoading: w(!1),
2650
2778
  hasFeature: (e) => n.planConfig.features[e] ?? !1,
2651
2779
  features: s(() => n.planConfig.features),
2652
2780
  fetchConfig: async () => {}
2653
- });
2654
- let h = s(() => n.planConfig.features.media_folders ?? !1), g = s(() => n.planConfig.features.import_from_url ?? !1), _ = s(() => n.planConfig.storage.used_bytes ?? 0), v = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: E } = Q(), O = fe({
2781
+ };
2782
+ C(ge, c);
2783
+ let h = s(() => n.planConfig.storage.used_bytes ?? 0), g = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: _ } = Z(c), v = he({
2655
2784
  projectId: n.projectId,
2656
2785
  authManager: n.authManager,
2657
2786
  onError: n.onError
2658
- }), A = Jn({
2659
- library: O,
2660
- canUseMediaFolders: h,
2787
+ }), E = nr({
2788
+ library: v,
2661
2789
  translations: a
2662
2790
  });
2663
- function j() {
2664
- if (!O.previewItem.value) return;
2665
- let e = O.previewItem.value, t = {
2791
+ function O() {
2792
+ if (!v.previewItem.value) return;
2793
+ let e = v.previewItem.value, t = {
2666
2794
  ...e,
2667
- url: A.selectedUrl.value || e.url
2795
+ url: E.selectedUrl.value || e.url
2668
2796
  };
2669
2797
  n.onSelect?.(t);
2670
2798
  }
2671
2799
  return x(() => {
2672
- O.loadItems(), O.loadFrequentlyUsed(), r("ready");
2673
- }), (t, n) => (S(), d("div", Vr, [
2674
- f("div", Hr, [f("h2", Ur, D(a.value.mediaLibrary.title), 1), f("div", Wr, [m(qn, {
2675
- "used-bytes": _.value,
2676
- "limit-bytes": v.value,
2800
+ v.loadItems(), v.loadFrequentlyUsed(), r("ready");
2801
+ }), (t, n) => (S(), d("div", ri, [
2802
+ f("div", ii, [f("h2", ai, D(a.value.mediaLibrary.title), 1), f("div", oi, [m(tr, {
2803
+ "used-bytes": h.value,
2804
+ "limit-bytes": g.value,
2677
2805
  size: 22
2678
- }, null, 8, ["used-bytes", "limit-bytes"]), f("div", Gr, [f("input", {
2679
- value: k(A).searchInput.value,
2806
+ }, null, 8, ["used-bytes", "limit-bytes"]), f("div", si, [f("input", {
2807
+ value: k(E).searchInput.value,
2680
2808
  type: "text",
2681
2809
  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)]",
2682
2810
  style: {
@@ -2685,14 +2813,14 @@ var Vr = {
2685
2813
  color: "var(--tpl-text)"
2686
2814
  },
2687
2815
  placeholder: a.value.mediaLibrary.searchPlaceholder,
2688
- onInput: n[0] ||= (e) => k(A).handleSearchInput(e.target.value)
2689
- }, null, 40, Kr), m(k(Y), {
2816
+ onInput: n[0] ||= (e) => k(E).handleSearchInput(e.target.value)
2817
+ }, null, 40, ci), m(k(J), {
2690
2818
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
2691
2819
  size: 13,
2692
2820
  "stroke-width": 2,
2693
2821
  style: { color: "var(--tpl-text-dim)" }
2694
2822
  })])])]),
2695
- f("div", qr, [m(o, {
2823
+ f("div", li, [m(o, {
2696
2824
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
2697
2825
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
2698
2826
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -2700,16 +2828,16 @@ var Vr = {
2700
2828
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
2701
2829
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
2702
2830
  }, {
2703
- default: M(() => [h.value && k(A).showSidebar.value ? (S(), d("div", Jr, [m(gt, {
2704
- folders: k(O).folders.value,
2705
- "current-folder-id": k(O).currentFolderId.value,
2706
- "view-mode": k(O).viewMode.value,
2707
- "has-frequently-used": k(A).hasFrequentlyUsed.value,
2708
- onNavigate: k(O).navigateToFolder,
2709
- onCreateFolder: k(A).handleCreateFolder,
2710
- onRenameFolder: k(A).handleRenameFolder,
2711
- onDeleteFolder: k(A).handleDeleteFolder,
2712
- onShowFrequentlyUsed: k(O).showFrequentlyUsed
2831
+ default: M(() => [k(E).showSidebar.value ? (S(), d("div", ui, [m(wt, {
2832
+ folders: k(v).folders.value,
2833
+ "current-folder-id": k(v).currentFolderId.value,
2834
+ "view-mode": k(v).viewMode.value,
2835
+ "has-frequently-used": k(E).hasFrequentlyUsed.value,
2836
+ onNavigate: k(v).navigateToFolder,
2837
+ onCreateFolder: k(E).handleCreateFolder,
2838
+ onRenameFolder: k(E).handleRenameFolder,
2839
+ onDeleteFolder: k(E).handleDeleteFolder,
2840
+ onShowFrequentlyUsed: k(v).showFrequentlyUsed
2713
2841
  }, null, 8, [
2714
2842
  "folders",
2715
2843
  "current-folder-id",
@@ -2722,55 +2850,54 @@ var Vr = {
2722
2850
  "onShowFrequentlyUsed"
2723
2851
  ])])) : u("", !0)]),
2724
2852
  _: 1
2725
- }), f("div", Yr, [f("div", Xr, [f("div", Zr, [
2726
- h.value ? (S(), d("button", {
2727
- key: 0,
2853
+ }), f("div", di, [f("div", fi, [f("div", pi, [
2854
+ f("button", {
2728
2855
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2729
2856
  style: b({
2730
- color: k(A).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2731
- backgroundColor: k(A).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2732
- border: k(A).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2857
+ color: k(E).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2858
+ backgroundColor: k(E).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2859
+ border: k(E).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2733
2860
  }),
2734
- title: k(A).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
2735
- onClick: n[1] ||= (e) => k(A).showSidebar.value = !k(A).showSidebar.value
2861
+ title: k(E).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
2862
+ onClick: n[1] ||= (e) => k(E).showSidebar.value = !k(E).showSidebar.value
2736
2863
  }, [m(k(G), {
2737
2864
  size: 16,
2738
2865
  "stroke-width": 2
2739
- })], 12, Qr)) : u("", !0),
2740
- k(O).viewMode.value === "frequently-used" ? (S(), d("span", $r, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2741
- key: 2,
2742
- folders: k(O).folders.value,
2743
- "current-folder-id": k(O).currentFolderId.value,
2744
- onNavigate: k(O).navigateToFolder
2866
+ })], 12, mi),
2867
+ k(v).viewMode.value === "frequently-used" ? (S(), d("span", hi, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(Te, {
2868
+ key: 1,
2869
+ folders: k(v).folders.value,
2870
+ "current-folder-id": k(v).currentFolderId.value,
2871
+ onNavigate: k(v).navigateToFolder
2745
2872
  }, null, 8, [
2746
2873
  "folders",
2747
2874
  "current-folder-id",
2748
2875
  "onNavigate"
2749
2876
  ])),
2750
- f("div", ei, [f("button", {
2877
+ f("div", gi, [f("button", {
2751
2878
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2752
2879
  style: b({
2753
- color: k(A).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2754
- backgroundColor: k(A).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2880
+ color: k(E).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2881
+ backgroundColor: k(E).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2755
2882
  }),
2756
2883
  title: a.value.mediaLibrary.viewGrid,
2757
- onClick: n[2] ||= (e) => k(A).layoutMode.value = "grid"
2884
+ onClick: n[2] ||= (e) => k(E).layoutMode.value = "grid"
2758
2885
  }, [m(k(V), {
2759
2886
  size: 14,
2760
2887
  "stroke-width": 2
2761
- })], 12, ti), f("button", {
2888
+ })], 12, _i), f("button", {
2762
2889
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2763
2890
  style: b({
2764
- color: k(A).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2765
- backgroundColor: k(A).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2891
+ color: k(E).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2892
+ backgroundColor: k(E).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2766
2893
  }),
2767
2894
  title: a.value.mediaLibrary.viewList,
2768
- onClick: n[3] ||= (e) => k(A).layoutMode.value = "list"
2895
+ onClick: n[3] ||= (e) => k(E).layoutMode.value = "list"
2769
2896
  }, [m(k(U), {
2770
2897
  size: 14,
2771
2898
  "stroke-width": 2
2772
- })], 12, ni)])
2773
- ]), f("div", ri, [k(E).length > 1 ? (S(), d("select", {
2899
+ })], 12, vi)])
2900
+ ]), f("div", yi, [k(_).length > 1 ? (S(), d("select", {
2774
2901
  key: 0,
2775
2902
  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
2903
  style: {
@@ -2778,58 +2905,57 @@ var Vr = {
2778
2905
  "background-color": "var(--tpl-bg)",
2779
2906
  color: "var(--tpl-text)"
2780
2907
  },
2781
- value: k(O).categoryFilter.value ?? "",
2782
- onChange: n[4] ||= (e) => k(O).filterByCategory(e.target.value || null)
2783
- }, [f("option", ai, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(E), (e) => (S(), d("option", {
2908
+ value: k(v).categoryFilter.value ?? "",
2909
+ onChange: n[4] ||= (e) => k(v).filterByCategory(e.target.value || null)
2910
+ }, [f("option", xi, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(_), (e) => (S(), d("option", {
2784
2911
  key: e,
2785
2912
  value: e
2786
- }, D(k(A).getCategoryLabel(e)), 9, oi))), 128))], 40, ii)) : u("", !0), f("select", {
2913
+ }, D(k(E).getCategoryLabel(e)), 9, Si))), 128))], 40, bi)) : u("", !0), f("select", {
2787
2914
  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",
2788
2915
  style: {
2789
2916
  "border-color": "var(--tpl-border)",
2790
2917
  "background-color": "var(--tpl-bg)",
2791
2918
  color: "var(--tpl-text)"
2792
2919
  },
2793
- value: k(O).sortOption.value,
2794
- onChange: n[5] ||= (e) => k(O).sortBy(e.target.value)
2920
+ value: k(v).sortOption.value,
2921
+ onChange: n[5] ||= (e) => k(v).sortBy(e.target.value)
2795
2922
  }, [
2796
- f("option", ci, D(a.value.mediaLibrary.sortNewest), 1),
2797
- f("option", li, D(a.value.mediaLibrary.sortOldest), 1),
2798
- f("option", ui, D(a.value.mediaLibrary.sortNameAsc), 1),
2799
- f("option", di, D(a.value.mediaLibrary.sortNameDesc), 1),
2800
- f("option", fi, D(a.value.mediaLibrary.sortSizeAsc), 1),
2801
- f("option", pi, D(a.value.mediaLibrary.sortSizeDesc), 1)
2802
- ], 40, si)])]), f("div", mi, [k(O).viewMode.value === "files" ? (S(), d("div", hi, [m(Hn, {
2803
- "is-uploading": k(O).isUploading.value,
2804
- "upload-progress": k(O).uploadProgress.value,
2805
- onUpload: k(A).handleUpload
2923
+ f("option", wi, D(a.value.mediaLibrary.sortNewest), 1),
2924
+ f("option", Ti, D(a.value.mediaLibrary.sortOldest), 1),
2925
+ f("option", Ei, D(a.value.mediaLibrary.sortNameAsc), 1),
2926
+ f("option", Di, D(a.value.mediaLibrary.sortNameDesc), 1),
2927
+ f("option", Oi, D(a.value.mediaLibrary.sortSizeAsc), 1),
2928
+ f("option", ki, D(a.value.mediaLibrary.sortSizeDesc), 1)
2929
+ ], 40, Ci)])]), f("div", Ai, [k(v).viewMode.value === "files" ? (S(), d("div", ji, [m(Xn, {
2930
+ "is-uploading": k(v).isUploading.value,
2931
+ "upload-progress": k(v).uploadProgress.value,
2932
+ onUpload: k(E).handleUpload
2806
2933
  }, null, 8, [
2807
2934
  "is-uploading",
2808
2935
  "upload-progress",
2809
2936
  "onUpload"
2810
- ]), g.value ? (S(), d("button", {
2811
- key: 0,
2937
+ ]), f("button", {
2812
2938
  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",
2813
2939
  style: {
2814
2940
  "border-color": "var(--tpl-border)",
2815
2941
  color: "var(--tpl-text-muted)",
2816
2942
  "background-color": "var(--tpl-bg)"
2817
2943
  },
2818
- onClick: n[6] ||= (e) => k(A).showImportUrlModal.value = !0
2944
+ onClick: n[6] ||= (e) => k(E).showImportUrlModal.value = !0
2819
2945
  }, [m(k(H), {
2820
2946
  size: 14,
2821
2947
  "stroke-width": 2
2822
- }), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(qt, {
2823
- items: k(A).displayItems.value,
2824
- "selected-ids": k(O).selectedItems.value,
2825
- "is-loading": k(O).isLoading.value,
2826
- "has-more": k(O).viewMode.value === "files" && k(O).hasMore.value,
2827
- layout: k(A).layoutMode.value,
2828
- onSelect: k(A).handleSelect,
2829
- onToggle: k(O).toggleSelection,
2830
- onLoadMore: k(O).loadMore,
2831
- onEdit: k(A).handleEditItem,
2832
- onReplace: k(A).handleReplaceItem
2948
+ }), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])])) : u("", !0), m(tn, {
2949
+ items: k(E).displayItems.value,
2950
+ "selected-ids": k(v).selectedItems.value,
2951
+ "is-loading": k(v).isLoading.value,
2952
+ "has-more": k(v).viewMode.value === "files" && k(v).hasMore.value,
2953
+ layout: k(E).layoutMode.value,
2954
+ onSelect: k(E).handleSelect,
2955
+ onToggle: k(v).toggleSelection,
2956
+ onLoadMore: k(v).loadMore,
2957
+ onEdit: k(E).handleEditItem,
2958
+ onReplace: k(E).handleReplaceItem
2833
2959
  }, null, 8, [
2834
2960
  "items",
2835
2961
  "selected-ids",
@@ -2842,36 +2968,36 @@ var Vr = {
2842
2968
  "onEdit",
2843
2969
  "onReplace"
2844
2970
  ])])])]),
2845
- m(on, {
2846
- visible: k(A).showImportUrlModal.value,
2847
- "is-importing": k(O).isImportingFromUrl.value,
2848
- error: k(O).importFromUrlError.value,
2849
- onImport: k(A).handleImportFromUrl,
2850
- onClose: n[7] ||= (e) => k(A).showImportUrlModal.value = !1
2971
+ m(mn, {
2972
+ visible: k(E).showImportUrlModal.value,
2973
+ "is-importing": k(v).isImportingFromUrl.value,
2974
+ error: k(v).importFromUrlError.value,
2975
+ onImport: k(E).handleImportFromUrl,
2976
+ onClose: n[7] ||= (e) => k(E).showImportUrlModal.value = !1
2851
2977
  }, null, 8, [
2852
2978
  "visible",
2853
2979
  "is-importing",
2854
2980
  "error",
2855
2981
  "onImport"
2856
2982
  ]),
2857
- m(it, {
2858
- visible: !!k(A).editingItem.value,
2859
- item: k(A).editingItem.value,
2860
- onSave: k(A).handleEditSave,
2861
- onClose: n[8] ||= (e) => k(A).editingItem.value = null
2983
+ m(ft, {
2984
+ visible: !!k(E).editingItem.value,
2985
+ item: k(E).editingItem.value,
2986
+ onSave: k(E).handleEditSave,
2987
+ onClose: n[8] ||= (e) => k(E).editingItem.value = null
2862
2988
  }, null, 8, [
2863
2989
  "visible",
2864
2990
  "item",
2865
2991
  "onSave"
2866
2992
  ]),
2867
- m(Ln, {
2868
- visible: k(O).showReplaceWarning.value,
2869
- item: k(O).pendingReplaceItem.value,
2870
- "usage-info": k(O).replaceUsageInfo.value,
2871
- "is-replacing": k(O).isReplacing.value,
2872
- error: k(O).replaceError.value,
2873
- onReplace: k(A).handleReplaceFile,
2874
- onClose: k(O).cancelReplace
2993
+ m(Gn, {
2994
+ visible: k(v).showReplaceWarning.value,
2995
+ item: k(v).pendingReplaceItem.value,
2996
+ "usage-info": k(v).replaceUsageInfo.value,
2997
+ "is-replacing": k(v).isReplacing.value,
2998
+ error: k(v).replaceError.value,
2999
+ onReplace: k(E).handleReplaceFile,
3000
+ onClose: k(v).cancelReplace
2875
3001
  }, null, 8, [
2876
3002
  "visible",
2877
3003
  "item",
@@ -2889,7 +3015,7 @@ var Vr = {
2889
3015
  "leave-from-class": "tpl:opacity-100",
2890
3016
  "leave-to-class": "tpl:opacity-0"
2891
3017
  }, {
2892
- default: M(() => [k(O).showDeleteWarning.value ? (S(), d("div", {
3018
+ default: M(() => [k(v).showDeleteWarning.value ? (S(), d("div", {
2893
3019
  key: 0,
2894
3020
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
2895
3021
  style: {
@@ -2897,27 +3023,27 @@ var Vr = {
2897
3023
  "backdrop-filter": "blur(8px)",
2898
3024
  "-webkit-backdrop-filter": "blur(8px)"
2899
3025
  },
2900
- onClick: n[11] ||= F((...e) => k(O).cancelDelete && k(O).cancelDelete(...e), ["self"])
2901
- }, [f("div", gi, [
2902
- f("h3", _i, D(a.value.mediaLibrary.deleteWarningTitle), 1),
3026
+ onClick: n[11] ||= F((...e) => k(v).cancelDelete && k(v).cancelDelete(...e), ["self"])
3027
+ }, [f("div", Mi, [
3028
+ f("h3", Ni, D(a.value.mediaLibrary.deleteWarningTitle), 1),
2903
3029
  f("p", {
2904
- class: y(["tpl:text-xs", k(A).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
3030
+ class: y(["tpl:text-xs", k(E).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2905
3031
  style: { color: "var(--tpl-text-muted)" }
2906
3032
  }, D(a.value.mediaLibrary.deleteWarningMessage), 3),
2907
- k(A).hasUsedFiles.value ? (S(), d("p", vi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2908
- k(A).hasUsedFiles.value ? (S(), d("div", yi, [(S(!0), d(i, null, T(k(O).deleteUsageInfo.value, (e, t) => (S(), d("div", {
3033
+ k(E).hasUsedFiles.value ? (S(), d("p", Pi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
3034
+ k(E).hasUsedFiles.value ? (S(), d("div", Fi, [(S(!0), d(i, null, T(k(v).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2909
3035
  key: t,
2910
3036
  class: "tpl:text-xs",
2911
3037
  style: { color: "var(--tpl-text)" }
2912
- }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", bi, D(k(A).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", xi, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2913
- f("div", Si, [f("button", {
3038
+ }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Ii, D(k(E).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Li, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
3039
+ f("div", Ri, [f("button", {
2914
3040
  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",
2915
3041
  style: {
2916
3042
  "border-color": "var(--tpl-border)",
2917
3043
  color: "var(--tpl-text)",
2918
3044
  "background-color": "var(--tpl-bg)"
2919
3045
  },
2920
- onClick: n[9] ||= (...e) => k(O).cancelDelete && k(O).cancelDelete(...e)
3046
+ onClick: n[9] ||= (...e) => k(v).cancelDelete && k(v).cancelDelete(...e)
2921
3047
  }, D(a.value.mediaLibrary.cancel), 1), f("button", {
2922
3048
  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",
2923
3049
  style: {
@@ -2925,31 +3051,31 @@ var Vr = {
2925
3051
  color: "var(--tpl-danger)",
2926
3052
  "background-color": "var(--tpl-danger-light)"
2927
3053
  },
2928
- onClick: n[10] ||= (...e) => k(O).confirmDelete && k(O).confirmDelete(...e)
2929
- }, D(k(A).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
3054
+ onClick: n[10] ||= (...e) => k(v).confirmDelete && k(v).confirmDelete(...e)
3055
+ }, D(k(E).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
2930
3056
  ])])) : u("", !0)]),
2931
3057
  _: 1
2932
3058
  }),
2933
- f("div", Ci, [f("div", wi, [k(O).previewItem.value ? (S(), l(Sn, {
3059
+ f("div", zi, [f("div", Bi, [k(v).previewItem.value ? (S(), l(An, {
2934
3060
  key: 0,
2935
- "selected-conversion": k(A).selectedConversion.value,
2936
- "onUpdate:selectedConversion": n[12] ||= (e) => k(A).selectedConversion.value = e,
2937
- item: k(O).previewItem.value,
2938
- folders: k(O).folders.value
3061
+ "selected-conversion": k(E).selectedConversion.value,
3062
+ "onUpdate:selectedConversion": n[12] ||= (e) => k(E).selectedConversion.value = e,
3063
+ item: k(v).previewItem.value,
3064
+ folders: k(v).folders.value
2939
3065
  }, null, 8, [
2940
3066
  "selected-conversion",
2941
3067
  "item",
2942
3068
  "folders"
2943
- ])) : u("", !0)]), f("div", Ti, [k(O).selectedItems.value.size > 0 ? (S(), d("div", Ei, [k(O).previewItem.value ? (S(), d("button", {
3069
+ ])) : u("", !0)]), f("div", Vi, [k(v).selectedItems.value.size > 0 ? (S(), d("div", Hi, [k(v).previewItem.value ? (S(), d("button", {
2944
3070
  key: 0,
2945
3071
  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",
2946
3072
  style: b({
2947
- borderColor: k(A).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2948
- color: k(A).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
3073
+ borderColor: k(E).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
3074
+ color: k(E).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2949
3075
  backgroundColor: "var(--tpl-bg)"
2950
3076
  }),
2951
- onClick: n[13] ||= (e) => k(A).copy(k(A).selectedUrl.value)
2952
- }, [k(A).copied.value ? (S(), l(k(I), {
3077
+ onClick: n[13] ||= (e) => k(E).copy(k(E).selectedUrl.value)
3078
+ }, [k(E).copied.value ? (S(), l(k(I), {
2953
3079
  key: 1,
2954
3080
  size: 12,
2955
3081
  "stroke-width": 2
@@ -2957,25 +3083,25 @@ var Vr = {
2957
3083
  key: 0,
2958
3084
  size: 12,
2959
3085
  "stroke-width": 2
2960
- })), p(" " + D(k(A).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), h.value ? (S(), d("div", Di, [f("button", {
3086
+ })), p(" " + D(k(E).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), f("div", Ui, [f("button", {
2961
3087
  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",
2962
3088
  style: {
2963
3089
  "border-color": "var(--tpl-border)",
2964
3090
  color: "var(--tpl-text)",
2965
3091
  "background-color": "var(--tpl-bg)"
2966
3092
  },
2967
- onClick: n[14] ||= (e) => k(A).showMovePicker.value = !k(A).showMovePicker.value
2968
- }, D(a.value.mediaLibrary.moveSelected), 1), k(A).showMovePicker.value ? (S(), l(dn, {
3093
+ onClick: n[14] ||= (e) => k(E).showMovePicker.value = !k(E).showMovePicker.value
3094
+ }, D(a.value.mediaLibrary.moveSelected), 1), k(E).showMovePicker.value ? (S(), l(yn, {
2969
3095
  key: 0,
2970
- folders: k(O).folders.value,
2971
- "current-folder-id": k(O).currentFolderId.value,
2972
- onSelect: k(A).handleMoveToFolder,
2973
- onClose: n[15] ||= (e) => k(A).showMovePicker.value = !1
3096
+ folders: k(v).folders.value,
3097
+ "current-folder-id": k(v).currentFolderId.value,
3098
+ onSelect: k(E).handleMoveToFolder,
3099
+ onClose: n[15] ||= (e) => k(E).showMovePicker.value = !1
2974
3100
  }, null, 8, [
2975
3101
  "folders",
2976
3102
  "current-folder-id",
2977
3103
  "onSelect"
2978
- ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Oi, [k(O).selectedItems.value.size > 0 ? (S(), d("button", {
3104
+ ])) : u("", !0)])])) : u("", !0), f("div", Wi, [k(v).selectedItems.value.size > 0 ? (S(), d("button", {
2979
3105
  key: 0,
2980
3106
  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",
2981
3107
  style: {
@@ -2983,7 +3109,7 @@ var Vr = {
2983
3109
  color: "var(--tpl-danger)",
2984
3110
  "background-color": "var(--tpl-danger-light)"
2985
3111
  },
2986
- onClick: n[16] ||= (...e) => k(A).handleDeleteClick && k(A).handleDeleteClick(...e)
3112
+ onClick: n[16] ||= (...e) => k(E).handleDeleteClick && k(E).handleDeleteClick(...e)
2987
3113
  }, D(a.value.mediaLibrary.deleteSelected), 1)) : u("", !0), e.onSelect ? (S(), d("button", {
2988
3114
  key: 1,
2989
3115
  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",
@@ -2991,84 +3117,52 @@ var Vr = {
2991
3117
  "background-color": "var(--tpl-primary)",
2992
3118
  color: "var(--tpl-bg)"
2993
3119
  },
2994
- disabled: !k(O).previewItem.value,
2995
- onClick: j
2996
- }, D(a.value.mediaLibrary.selectFile), 9, ki)) : u("", !0)])])])
3120
+ disabled: !k(v).previewItem.value,
3121
+ onClick: O
3122
+ }, D(a.value.mediaLibrary.selectFile), 9, Gi)) : u("", !0)])])])
2997
3123
  ]));
2998
3124
  }
2999
- }), ji = /* #__PURE__ */ Object.assign({
3000
- "./locales/ca.ts": () => import("./ca-DnghH5Xn.js"),
3001
- "./locales/de.ts": () => import("./de-ByQyu2jv.js"),
3002
- "./locales/en.ts": () => import("./en-B-xajqfh.js"),
3003
- "./locales/es.ts": () => import("./es-Bcp-DbmC.js"),
3004
- "./locales/fr.ts": () => import("./fr-DXb0cCZG.js"),
3005
- "./locales/nl.ts": () => import("./nl-DGT1t3Be.js"),
3006
- "./locales/pt-BR.ts": () => import("./pt-BR-C0Hzc26R.js")
3007
- });
3008
- function Mi(e) {
3009
- return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
3010
- }
3011
- var Ni = Mi(ji);
3012
- function Pi(e) {
3013
- return e.trim().replace(/_/g, "-").toLowerCase();
3014
- }
3015
- function Fi(e) {
3016
- let t = Pi(e);
3017
- return Ni.find((e) => Pi(e) === t);
3018
- }
3019
- function Ii(e) {
3020
- return Pi(e).split("-")[0];
3021
- }
3022
- function Li(e) {
3023
- return Fi(e) ?? Fi(Ii(e)) ?? "en";
3024
- }
3025
- async function Ri(e) {
3026
- let t = ji[`./locales/${Li(e)}.ts`];
3027
- return (await t()).default;
3028
- }
3029
- //#endregion
3030
- //#region src/standalone/visual.ts
3031
- var $ = null, zi = w(null);
3032
- async function Bi(e) {
3125
+ }), Q = null, qi = w(null);
3126
+ async function Ji(e) {
3033
3127
  let n = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
3034
3128
  if (!n) throw Error(`Container element not found: ${e.container}`);
3035
3129
  let i = r(e.auth, e.onError);
3036
3130
  await i.initialize();
3037
- let a = await new t(i).fetchConfig(), o = await Ri(e.locale ?? "en");
3038
- return Hi(n, e.theme), $ && Vi(), new Promise((t, r) => {
3131
+ let a = await new t(i).fetchConfig(), o = await ur(e.locale ?? "en");
3132
+ return Yi(n, e.theme), Q && $(), new Promise((t, r) => {
3039
3133
  try {
3040
- $ = c({ setup() {
3134
+ Q = c({ setup() {
3041
3135
  let r = () => {
3042
3136
  t({
3043
- setTheme: (e) => Hi(n, e),
3044
- unmount: Vi
3137
+ setTheme: (e) => Yi(n, e),
3138
+ unmount: $
3045
3139
  });
3046
3140
  };
3047
- return () => g(Ai, {
3141
+ return () => g(Ki, {
3048
3142
  authManager: i,
3049
3143
  projectId: i.projectId,
3050
3144
  planConfig: a,
3051
3145
  translations: o,
3052
3146
  onSelect: e.onSelect,
3053
3147
  onError: e.onError,
3054
- ref: zi,
3148
+ ref: qi,
3055
3149
  onReady: r
3056
3150
  });
3057
- } }), $.mount(n);
3151
+ } }), Q.mount(n);
3058
3152
  } catch (e) {
3059
3153
  r(e);
3060
3154
  }
3061
3155
  });
3062
3156
  }
3063
- function Vi() {
3064
- $ && ($.unmount(), $ = null, zi.value = null);
3157
+ function $() {
3158
+ Q && (Q.unmount(), Q = null, qi.value = null);
3065
3159
  }
3066
- function Hi(e, t) {
3160
+ function Yi(e, t) {
3067
3161
  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`)));
3068
3162
  }
3069
3163
  typeof window < "u" && (window.TemplaticalMedia = {
3070
- init: Bi,
3071
- unmount: Vi
3164
+ init: Ji,
3165
+ unmount: $
3072
3166
  });
3073
3167
  //#endregion
3074
- export { de as MediaApiClient, zr as MediaLibraryModal, Bi as init, Vi as unmount, Z as useI18n, Q as useMediaCategories, fe as useMediaLibrary, Br as useMediaPicker };
3168
+ export { me as MediaApiClient, ti as MediaLibraryModal, Ji as init, $ as unmount, X as useI18n, Z as useMediaCategories, he as useMediaLibrary, ni as useMediaPicker };