@templatical/media-library 0.27.0 → 0.27.2

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,6 +1,13 @@
1
1
  import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as ee, Z as T, _ as E, a as D, at as O, b as te, c as ne, d as re, et as ie, f as k, g as ae, h as oe, i as se, it as A, j, k as M, l as ce, m as le, n as ue, nt as de, o as fe, ot as N, p as pe, q as P, r as me, rt as F, s as he, st as I, t as ge, tt as L, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-BrkXiZSA.js";
2
- //#region ../types/src/config.ts
3
- var xe = class extends Error {
2
+ //#region \0rolldown/runtime.js
3
+ var xe = Object.defineProperty, Se = (e, t) => {
4
+ let n = {};
5
+ for (var r in e) xe(n, r, {
6
+ get: e[r],
7
+ enumerable: !0
8
+ });
9
+ return t || xe(n, Symbol.toStringTag, { value: "Module" }), n;
10
+ }, Ce = class extends Error {
4
11
  statusCode;
5
12
  constructor(e, t) {
6
13
  super(e), this.statusCode = t, this.name = "SdkError";
@@ -14,7 +21,7 @@ var xe = class extends Error {
14
21
  get isServerError() {
15
22
  return this.statusCode !== void 0 && this.statusCode >= 500;
16
23
  }
17
- }, Se = class e {
24
+ }, we = class e {
18
25
  static DEFAULT_BASE_URL = "https://templatical.com";
19
26
  accessToken = null;
20
27
  expiresAt = null;
@@ -88,7 +95,7 @@ var xe = class extends Error {
88
95
  };
89
96
  e === "POST" && this.requestOptions.body && (t["Content-Type"] = "application/json", n.body = JSON.stringify(this.requestOptions.body));
90
97
  let r = await fetch(this.url, n);
91
- if (!r.ok) throw new xe(`Token refresh failed: ${r.status}`, r.status);
98
+ if (!r.ok) throw new Ce(`Token refresh failed: ${r.status}`, r.status);
92
99
  let i = await r.json();
93
100
  if (!i.token || !i.expires_at || !i.project_id || !i.tenant) throw Error("Invalid token response: missing token, expires_at, project_id, or tenant");
94
101
  return this.accessToken = i.token, this.expiresAt = /* @__PURE__ */ new Date(i.expires_at * 1e3), this._projectId = i.project_id, this._tenantSlug = i.tenant, this._testEmailConfig = i.test_email?.allowed_emails && i.test_email?.signature ? {
@@ -115,8 +122,8 @@ var xe = class extends Error {
115
122
  return a.status === 401 && (a = await i(await this.refreshToken())), a;
116
123
  }
117
124
  };
118
- function Ce(e, t) {
119
- return e.mode === "direct" ? new Se({
125
+ function Te(e, t) {
126
+ return e.mode === "direct" ? new we({
120
127
  url: `${(e.baseUrl ?? "https://templatical.com").replace(/\/$/, "")}/api/v1/auth/token`,
121
128
  baseUrl: e.baseUrl,
122
129
  requestOptions: {
@@ -130,7 +137,7 @@ function Ce(e, t) {
130
137
  }
131
138
  },
132
139
  onError: t
133
- }) : new Se({
140
+ }) : new we({
134
141
  url: e.url,
135
142
  baseUrl: e.baseUrl,
136
143
  requestOptions: e.requestOptions,
@@ -142,16 +149,16 @@ function Ce(e, t) {
142
149
  function B(e, t) {
143
150
  return e.replace(/\{(\w+)\}/g, (e, n) => encodeURIComponent(t[n] ?? ""));
144
151
  }
145
- var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{template}`, Te = `${V}/ai`, Ee = `${we}/media`, De = `${Ee}/folders`, Oe = `${we}/saved-modules`, H = {
152
+ var Ee = "/api/v1/projects/{project}/tenants/{tenant}", V = `${Ee}/templates/{template}`, De = `${V}/ai`, Oe = `${Ee}/media`, ke = `${Oe}/folders`, Ae = `${Ee}/saved-modules`, H = {
146
153
  health: "/api/v1/health",
147
- "projects.config": `${we}/config`,
148
- "broadcasting.auth": `${we}/broadcasting/auth`,
149
- "templates.store": `${we}/templates`,
154
+ "projects.config": `${Ee}/config`,
155
+ "broadcasting.auth": `${Ee}/broadcasting/auth`,
156
+ "templates.store": `${Ee}/templates`,
150
157
  "templates.show": `${V}`,
151
158
  "templates.update": `${V}`,
152
159
  "templates.destroy": `${V}`,
153
160
  "templates.export": `${V}/export`,
154
- "templates.importFromBeefree": `${we}/templates/import/from-beefree`,
161
+ "templates.importFromBeefree": `${Ee}/templates/import/from-beefree`,
155
162
  "templates.sendTestEmail": `${V}/send-test-email`,
156
163
  "versions.index": `${V}/versions`,
157
164
  "versions.store": `${V}/versions`,
@@ -162,31 +169,31 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
162
169
  "comments.update": `${V}/comments/{comment}`,
163
170
  "comments.destroy": `${V}/comments/{comment}`,
164
171
  "comments.resolve": `${V}/comments/{comment}/resolve`,
165
- "ai.generate": `${Te}/generate`,
166
- "ai.conversationMessages": `${Te}/conversation-messages`,
167
- "ai.suggestions": `${Te}/suggestions`,
168
- "ai.rewriteText": `${Te}/rewrite-text`,
169
- "ai.score": `${Te}/score`,
170
- "ai.fixFinding": `${Te}/fix-finding`,
171
- "ai.generateFromDesign": `${Te}/generate-from-design`,
172
- "media.upload": `${Ee}/upload`,
173
- "media.browse": `${Ee}/browse`,
174
- "media.delete": `${Ee}/delete`,
175
- "media.move": `${Ee}/move`,
176
- "media.update": `${Ee}/{media}`,
177
- "media.replace": `${Ee}/{media}/replace`,
178
- "media.checkUsage": `${Ee}/check-usage`,
179
- "media.frequentlyUsed": `${Ee}/frequently-used`,
180
- "media.importFromUrl": `${Ee}/import-from-url`,
181
- "folders.index": `${De}`,
182
- "folders.store": `${De}`,
183
- "folders.update": `${De}/{mediaFolder}`,
184
- "folders.destroy": `${De}/{mediaFolder}`,
185
- "savedModules.index": `${Oe}`,
186
- "savedModules.store": `${Oe}`,
187
- "savedModules.update": `${Oe}/{savedModule}`,
188
- "savedModules.destroy": `${Oe}/{savedModule}`
189
- }, ke = class {
172
+ "ai.generate": `${De}/generate`,
173
+ "ai.conversationMessages": `${De}/conversation-messages`,
174
+ "ai.suggestions": `${De}/suggestions`,
175
+ "ai.rewriteText": `${De}/rewrite-text`,
176
+ "ai.score": `${De}/score`,
177
+ "ai.fixFinding": `${De}/fix-finding`,
178
+ "ai.generateFromDesign": `${De}/generate-from-design`,
179
+ "media.upload": `${Oe}/upload`,
180
+ "media.browse": `${Oe}/browse`,
181
+ "media.delete": `${Oe}/delete`,
182
+ "media.move": `${Oe}/move`,
183
+ "media.update": `${Oe}/{media}`,
184
+ "media.replace": `${Oe}/{media}/replace`,
185
+ "media.checkUsage": `${Oe}/check-usage`,
186
+ "media.frequentlyUsed": `${Oe}/frequently-used`,
187
+ "media.importFromUrl": `${Oe}/import-from-url`,
188
+ "folders.index": `${ke}`,
189
+ "folders.store": `${ke}`,
190
+ "folders.update": `${ke}/{mediaFolder}`,
191
+ "folders.destroy": `${ke}/{mediaFolder}`,
192
+ "savedModules.index": `${Ae}`,
193
+ "savedModules.store": `${Ae}`,
194
+ "savedModules.update": `${Ae}/{savedModule}`,
195
+ "savedModules.destroy": `${Ae}/{savedModule}`
196
+ }, je = class {
190
197
  authManager;
191
198
  constructor(e) {
192
199
  this.authManager = e;
@@ -214,7 +221,7 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
214
221
  });
215
222
  if (!n.ok) {
216
223
  let e = await n.json().catch(() => ({ message: `HTTP error ${n.status}` }));
217
- throw new xe(this.extractFirstValidationError(e), n.status);
224
+ throw new Ce(this.extractFirstValidationError(e), n.status);
218
225
  }
219
226
  if (n.status !== 204) return (await n.json()).data;
220
227
  }
@@ -384,11 +391,94 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
384
391
  savedModule: e
385
392
  }), { method: "DELETE" });
386
393
  }
387
- };
394
+ }, Me = Symbol("templaticalMediaPlanConfig"), Ne = Symbol("templaticalMediaPopoverTarget"), Pe = Symbol("templaticalMediaTranslations"), Fe = Symbol("templaticalMediaUiTheme"), Ie = /* @__PURE__ */ Se({ default: () => Le }), Le = { mediaLibrary: {
395
+ title: "Media Library",
396
+ searchPlaceholder: "Search files...",
397
+ allFiles: "All Files",
398
+ filterAll: "All Types",
399
+ filterImages: "Images",
400
+ filterDocuments: "Documents",
401
+ filterVideos: "Videos",
402
+ filterAudio: "Audio",
403
+ newFolder: "New Folder",
404
+ folderName: "Folder name",
405
+ noFiles: "No files found",
406
+ dropOrClick: "Drop files here or click to upload",
407
+ acceptedFormats: "Images, PDF, Video, Audio, Documents (max 10MB)",
408
+ uploading: "Uploading...",
409
+ uploadingProgress: "Uploading {current} of {total}...",
410
+ selectImage: "Select Image",
411
+ selectFile: "Select File",
412
+ deleteSelected: "Delete",
413
+ copyUrl: "Copy URL",
414
+ copied: "Copied!",
415
+ browseMedia: "Browse Media Library",
416
+ renameFolder: "Rename folder",
417
+ addSubfolder: "Add subfolder",
418
+ subfolderName: "Subfolder name",
419
+ sortNewest: "Newest First",
420
+ sortOldest: "Oldest First",
421
+ sortNameAsc: "Name A-Z",
422
+ sortNameDesc: "Name Z-A",
423
+ sortSizeAsc: "Smallest First",
424
+ sortSizeDesc: "Largest First",
425
+ moveSelected: "Move",
426
+ moveToRoot: "All Files",
427
+ currentFolder: "(current)",
428
+ confirmDelete: "Confirm?",
429
+ renameFile: "Rename",
430
+ editFile: "Edit File",
431
+ fileName: "Filename",
432
+ altText: "Alt Text",
433
+ altTextPlaceholder: "Describe this image for accessibility",
434
+ saveChanges: "Save",
435
+ cancel: "Cancel",
436
+ frequentlyUsed: "Frequently Used",
437
+ deleteWarningTitle: "Delete File",
438
+ deleteWarningMessage: "Are you sure? This action is irreversible.",
439
+ deleteWarningUsageNote: "The following files are used in templates. Deleting them may break those templates.",
440
+ deleteAnyway: "Delete",
441
+ usedInTemplates: "Used in {count} template(s)",
442
+ viewGrid: "Grid view",
443
+ viewList: "List view",
444
+ showFolders: "Show folders",
445
+ hideFolders: "Hide folders",
446
+ importFromUrl: "Import from URL",
447
+ importUrlPlaceholder: "https://example.com/image.jpg",
448
+ import: "Import",
449
+ importing: "Importing...",
450
+ importError: "Failed to import from URL",
451
+ conversionLabel: "Size",
452
+ conversionOriginal: "Original",
453
+ conversionSmall: "Small (150px)",
454
+ conversionMedium: "Medium (600px)",
455
+ conversionLarge: "Large (1200px)",
456
+ replaceFile: "Replace File",
457
+ replaceWarningTitle: "Replace File",
458
+ replaceWarningMessage: "You are about to replace this file. The replacement must have the same file extension ({extension}).",
459
+ replaceWarningUsageNote: "This file is used in {count} template(s). Replacing it will update all references.",
460
+ replaceSelectFile: "Select replacement file",
461
+ replace: "Replace",
462
+ replacing: "Replacing...",
463
+ replaceError: "Failed to replace file",
464
+ saving: "Saving...",
465
+ cropAspectRatio: "Aspect Ratio",
466
+ cropFree: "Free",
467
+ cropSquare: "1:1",
468
+ cropLandscape43: "4:3",
469
+ cropLandscape169: "16:9",
470
+ cropOriginal: "Original",
471
+ cropMaxWidth: "Max Width",
472
+ cropMaxHeight: "Max Height",
473
+ cropOutputSize: "Output Size",
474
+ cropPixels: "px",
475
+ cropOptional: "(optional)",
476
+ storageTooltip: "{used} of {total} used ({remaining} remaining)"
477
+ } };
388
478
  //#endregion
389
479
  //#region src/composables/useI18n.ts
390
- function Ae(e) {
391
- let t = e ?? l("translations"), n = w(t) ? t.value : t;
480
+ function Re(e) {
481
+ let t = e ?? l(Pe, null), n = (w(t) ? t.value : t) ?? Le;
392
482
  function r(e, t) {
393
483
  return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
394
484
  }
@@ -399,14 +489,14 @@ function Ae(e) {
399
489
  }
400
490
  //#endregion
401
491
  //#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
402
- var je = {
492
+ var ze = {
403
493
  key: 0,
404
494
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
405
495
  style: { color: "var(--tpl-text-muted)" }
406
- }, Me = ["onClick"], Ne = {
496
+ }, Be = ["onClick"], Ve = {
407
497
  key: 1,
408
498
  style: { color: "var(--tpl-text)" }
409
- }, Pe = /* @__PURE__ */ m({
499
+ }, He = /* @__PURE__ */ m({
410
500
  __name: "MediaBreadcrumb",
411
501
  props: {
412
502
  folders: {},
@@ -414,7 +504,7 @@ var je = {
414
504
  },
415
505
  emits: ["navigate"],
416
506
  setup(e, { emit: n }) {
417
- let r = e, o = n, { t: s } = Ae(), c = a(() => {
507
+ let r = e, o = n, { t: s } = Re(), c = a(() => {
418
508
  if (!r.currentFolderId) return [];
419
509
  let e = [];
420
510
  return l(r.folders, r.currentFolderId, e), e;
@@ -426,7 +516,7 @@ var je = {
426
516
  }
427
517
  return !1;
428
518
  }
429
- return (e, n) => c.value.length > 0 ? (z(), t("div", je, [i("button", {
519
+ return (e, n) => c.value.length > 0 ? (z(), t("div", ze, [i("button", {
430
520
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
431
521
  style: { color: "var(--tpl-primary)" },
432
522
  onClick: n[0] ||= (e) => o("navigate", null)
@@ -438,47 +528,47 @@ var je = {
438
528
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
439
529
  style: { color: "var(--tpl-primary)" },
440
530
  onClick: (t) => o("navigate", e.id)
441
- }, I(e.name), 9, Me)) : (z(), t("span", Ne, I(e.name), 1))], 64))), 128))])) : M("", !0);
531
+ }, I(e.name), 9, Be)) : (z(), t("span", Ve, I(e.name), 1))], 64))), 128))])) : M("", !0);
442
532
  }
443
- }), Fe = Symbol("templaticalMediaPlanConfig"), Ie = Symbol("templaticalMediaPopoverTarget");
533
+ });
444
534
  //#endregion
445
535
  //#region src/composables/useMediaCategories.ts
446
- function Le() {
447
- let e = l(Fe, null);
448
- if (!e) throw Error("[Templatical] useMediaCategories() needs a plan config in scope. Render it under <MediaLibraryModal> (pass its `planConfig` prop) or provide PLAN_CONFIG_KEY yourself.");
449
- let t = a(() => e.config.value?.media ?? null), n = a(() => t.value?.use_media_library ?? !0), r = a(() => t.value?.categories ?? null), i = a(() => r.value ? Object.values(r.value).flatMap((e) => e.mime_types) : []), o = a(() => i.value.join(",")), s = a(() => t.value?.max_file_size ?? 0);
450
- function c(e, t) {
451
- return r.value ? !t || t.length === 0 ? i.value.includes(e) : t.some((t) => r.value[t]?.mime_types.includes(e)) : !1;
452
- }
453
- function u(e) {
454
- return r.value ? r.value.images?.mime_types.includes(e) ?? !1 : !1;
536
+ function Ue(e) {
537
+ let t = e ?? l(Me, null);
538
+ 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.");
539
+ let n = a(() => t.config.value?.media ?? null), r = a(() => n.value?.use_media_library ?? !0), i = a(() => n.value?.categories ?? null), o = a(() => i.value ? Object.values(i.value).flatMap((e) => e.mime_types) : []), s = a(() => o.value.join(",")), c = a(() => n.value?.max_file_size ?? 0);
540
+ function u(e, t) {
541
+ return i.value ? !t || t.length === 0 ? o.value.includes(e) : t.some((t) => i.value[t]?.mime_types.includes(e)) : !1;
455
542
  }
456
543
  function d(e) {
457
- if (!r.value) return null;
458
- for (let [t, n] of Object.entries(r.value)) if (n.mime_types.includes(e)) return t;
544
+ return i.value ? i.value.images?.mime_types.includes(e) ?? !1 : !1;
545
+ }
546
+ function f(e) {
547
+ if (!i.value) return null;
548
+ for (let [t, n] of Object.entries(i.value)) if (n.mime_types.includes(e)) return t;
459
549
  return null;
460
550
  }
461
551
  return {
462
- isMediaLibraryEnabled: n,
463
- allAcceptedMimeTypes: i,
464
- allAcceptedInputString: o,
465
- maxFileSize: s,
466
- availableCategories: a(() => r.value ? Object.keys(r.value) : []),
467
- isAcceptedMimeType: c,
468
- isImageMimeType: u,
469
- getCategoryForMimeType: d
552
+ isMediaLibraryEnabled: r,
553
+ allAcceptedMimeTypes: o,
554
+ allAcceptedInputString: s,
555
+ maxFileSize: c,
556
+ availableCategories: a(() => i.value ? Object.keys(i.value) : []),
557
+ isAcceptedMimeType: u,
558
+ isImageMimeType: d,
559
+ getCategoryForMimeType: f
470
560
  };
471
561
  }
472
562
  //#endregion
473
563
  //#region src/composables/useImageCrop.ts
474
- var Re = {
564
+ var We = {
475
565
  free: void 0,
476
566
  square: 1,
477
567
  landscape43: 4 / 3,
478
568
  landscape169: 16 / 9,
479
569
  original: void 0
480
570
  };
481
- function ze(e) {
571
+ function Ge(e) {
482
572
  return e === "image/png" || e === "image/gif" ? {
483
573
  mimeType: "image/png",
484
574
  quality: 1
@@ -490,7 +580,7 @@ function ze(e) {
490
580
  quality: .92
491
581
  };
492
582
  }
493
- function Be(e, t, n) {
583
+ function Ke(e, t, n) {
494
584
  let r = e.width, i = e.height;
495
585
  if (!t && !n) return e;
496
586
  let a = r, o = i;
@@ -504,7 +594,7 @@ function Be(e, t, n) {
504
594
  let c = s.getContext("2d");
505
595
  return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
506
596
  }
507
- function Ve(e, t, n) {
597
+ function qe(e, t, n) {
508
598
  return new Promise((r, i) => {
509
599
  e.toBlob((e) => {
510
600
  if (!e) {
@@ -516,7 +606,7 @@ function Ve(e, t, n) {
516
606
  }, n.mimeType, n.quality);
517
607
  });
518
608
  }
519
- function He(e, t, n, r) {
609
+ function Je(e, t, n, r) {
520
610
  let i = e, a = t;
521
611
  if (n && i > n) {
522
612
  let e = n / i;
@@ -533,7 +623,7 @@ function He(e, t, n, r) {
533
623
  }
534
624
  //#endregion
535
625
  //#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.41_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
536
- function Ue(e, t) {
626
+ function Ye(e, t) {
537
627
  var n = Object.keys(e);
538
628
  if (Object.getOwnPropertySymbols) {
539
629
  var r = Object.getOwnPropertySymbols(e);
@@ -546,9 +636,9 @@ function Ue(e, t) {
546
636
  function U(e) {
547
637
  for (var t = 1; t < arguments.length; t++) {
548
638
  var n = arguments[t] == null ? {} : arguments[t];
549
- t % 2 ? Ue(Object(n), !0).forEach((function(t) {
639
+ t % 2 ? Ye(Object(n), !0).forEach((function(t) {
550
640
  W(e, t, n[t]);
551
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ue(Object(n)).forEach((function(t) {
641
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ye(Object(n)).forEach((function(t) {
552
642
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
553
643
  }));
554
644
  }
@@ -562,7 +652,7 @@ function W(e, t, n) {
562
652
  writable: !0
563
653
  }) : e[t] = n, e;
564
654
  }
565
- function We(e, t) {
655
+ function Xe(e, t) {
566
656
  if (e == null) return {};
567
657
  var n, r, i = function(e, t) {
568
658
  if (e == null) return {};
@@ -576,28 +666,28 @@ function We(e, t) {
576
666
  }
577
667
  return i;
578
668
  }
579
- function Ge(e) {
669
+ function Ze(e) {
580
670
  return function(e) {
581
- if (Array.isArray(e)) return Ke(e);
671
+ if (Array.isArray(e)) return Qe(e);
582
672
  }(e) || function(e) {
583
673
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
584
674
  }(e) || function(e, t) {
585
675
  if (e) {
586
- if (typeof e == "string") return Ke(e, t);
676
+ if (typeof e == "string") return Qe(e, t);
587
677
  var n = Object.prototype.toString.call(e).slice(8, -1);
588
678
  if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
589
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ke(e, t);
679
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Qe(e, t);
590
680
  }
591
681
  }(e) || function() {
592
682
  throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
593
683
  }();
594
684
  }
595
- function Ke(e, t) {
685
+ function Qe(e, t) {
596
686
  (t == null || t > e.length) && (t = e.length);
597
687
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
598
688
  return r;
599
689
  }
600
- var qe, Je, Ye, G = (qe = function(e) {
690
+ var $e, et, tt, G = ($e = function(e) {
601
691
  (function() {
602
692
  var t = {}.hasOwnProperty;
603
693
  function n() {
@@ -621,15 +711,15 @@ var qe, Je, Ye, G = (qe = function(e) {
621
711
  }
622
712
  e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
623
713
  })();
624
- }, qe(Ye = {
625
- path: Je,
714
+ }, $e(tt = {
715
+ path: et,
626
716
  exports: {},
627
717
  require: function(e, t) {
628
718
  return function() {
629
719
  throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
630
- }(t == null && Ye.path);
720
+ }(t == null && tt.path);
631
721
  }
632
- }, Ye.exports), Ye.exports), Xe = function(e) {
722
+ }, tt.exports), tt.exports), nt = function(e) {
633
723
  return function(t, n) {
634
724
  if (!t) return e;
635
725
  var r;
@@ -641,7 +731,7 @@ var qe, Je, Ye, G = (qe = function(e) {
641
731
  }), "") : "");
642
732
  };
643
733
  };
644
- function Ze(e, t, n) {
734
+ function rt(e, t, n) {
645
735
  var r, i, a, o, s;
646
736
  function c() {
647
737
  var l = Date.now() - o;
@@ -659,65 +749,65 @@ function Ze(e, t, n) {
659
749
  r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
660
750
  }, l;
661
751
  }
662
- Ze.debounce = Ze;
663
- var Qe = Ze, K = function() {
752
+ rt.debounce = rt;
753
+ var it = rt, K = function() {
664
754
  return K = Object.assign || function(e) {
665
755
  for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
666
756
  return e;
667
757
  }, K.apply(this, arguments);
668
758
  };
669
- function $e(e, t) {
759
+ function at(e, t) {
670
760
  var n, r;
671
761
  return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
672
762
  name: n,
673
763
  classname: r
674
764
  };
675
765
  }
676
- function et(e) {
766
+ function ot(e) {
677
767
  return /^blob:/.test(e);
678
768
  }
679
- function tt(e) {
680
- return et(e) || function(e) {
769
+ function st(e) {
770
+ return ot(e) || function(e) {
681
771
  return /^data:/.test(e);
682
772
  }(e);
683
773
  }
684
- function nt(e) {
774
+ function ct(e) {
685
775
  return !!(e && e.constructor && e.call && e.apply);
686
776
  }
687
777
  function q(e) {
688
778
  return e === void 0;
689
779
  }
690
- function rt(e) {
780
+ function lt(e) {
691
781
  return typeof e == "object" && !!e;
692
782
  }
693
- function it(e, t, n) {
783
+ function ut(e, t, n) {
694
784
  var r = {};
695
- return rt(e) ? (Object.keys(t).forEach((function(i) {
696
- r[i] = q(e[i]) ? t[i] : rt(t[i]) ? rt(e[i]) ? it(e[i], t[i], n[i]) : e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? !!e[i] : e[i];
785
+ return lt(e) ? (Object.keys(t).forEach((function(i) {
786
+ r[i] = q(e[i]) ? t[i] : lt(t[i]) ? lt(e[i]) ? ut(e[i], t[i], n[i]) : e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? !!e[i] : e[i];
697
787
  })), r) : e ? t : n;
698
788
  }
699
- function at(e) {
789
+ function dt(e) {
700
790
  var t = Number(e);
701
791
  return Number.isNaN(t) ? e : t;
702
792
  }
703
- function ot(e) {
793
+ function ft(e) {
704
794
  return typeof (e == "number" || function(e) {
705
795
  return typeof e == "object" && !!e;
706
- }(e) && toString.call(e) == "[object Number]") && !st(e);
796
+ }(e) && toString.call(e) == "[object Number]") && !pt(e);
707
797
  }
708
- function st(e) {
798
+ function pt(e) {
709
799
  return e != e;
710
800
  }
711
- function ct(e, t) {
801
+ function mt(e, t) {
712
802
  return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
713
803
  }
714
- var lt = function(e, t) {
804
+ var ht = function(e, t) {
715
805
  e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
716
- }, ut = function(e, t) {
806
+ }, gt = function(e, t) {
717
807
  t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
718
- }, dt = function(e) {
808
+ }, _t = function(e) {
719
809
  this.type = "move", this.directions = e;
720
- }, ft = function() {
810
+ }, vt = function() {
721
811
  function e(e, t, n, r, i) {
722
812
  this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
723
813
  }
@@ -735,7 +825,7 @@ var lt = function(e, t) {
735
825
  top: 0
736
826
  };
737
827
  }, e;
738
- }(), pt = {
828
+ }(), yt = {
739
829
  name: "DraggableElement",
740
830
  props: { classname: { type: String } },
741
831
  beforeMount: function() {
@@ -756,7 +846,7 @@ var lt = function(e, t) {
756
846
  this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
757
847
  },
758
848
  onTouchStart: function(e) {
759
- e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Ge(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
849
+ e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Ze(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
760
850
  return {
761
851
  clientX: t.clientX + n.clientX / e.touches.length,
762
852
  clientY: t.clientY + n.clientY / e.touches.length
@@ -802,11 +892,11 @@ var lt = function(e, t) {
802
892
  };
803
893
  },
804
894
  processMove: function(e, t) {
805
- var n = Ge(t);
895
+ var n = Ze(t);
806
896
  if (this.touches.length) {
807
897
  if (this.touches.length === 1 && n.length === 1) {
808
898
  var r = this.$refs.draggable;
809
- this.$emit("drag", new ft(e, r, {
899
+ this.$emit("drag", new vt(e, r, {
810
900
  left: n[0].clientX,
811
901
  top: n[0].clientY
812
902
  }, {
@@ -828,7 +918,7 @@ var lt = function(e, t) {
828
918
  "enter"
829
919
  ]
830
920
  };
831
- pt.render = function(e, t, n, r, i, a) {
921
+ yt.render = function(e, t, n, r, i, a) {
832
922
  return z(), h("div", {
833
923
  ref: "draggable",
834
924
  class: n.classname,
@@ -846,9 +936,9 @@ pt.render = function(e, t, n, r, i, a) {
846
936
  }
847
937
  }, [c(e.$slots, "default")], 34);
848
938
  };
849
- var mt = Xe("vue-handler-wrapper"), ht = {
939
+ var bt = nt("vue-handler-wrapper"), xt = {
850
940
  name: "HandlerWrapper",
851
- components: { DraggableElement: pt },
941
+ components: { DraggableElement: yt },
852
942
  props: {
853
943
  horizontalPosition: { type: String },
854
944
  verticalPosition: { type: String },
@@ -860,12 +950,12 @@ var mt = Xe("vue-handler-wrapper"), ht = {
860
950
  computed: { classes: function() {
861
951
  var e;
862
952
  if (this.horizontalPosition || this.verticalPosition) {
863
- var t, n = $e(this.horizontalPosition, this.verticalPosition);
864
- e = mt((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
865
- } else e = mt({ disabled: this.disabled });
953
+ var t, n = at(this.horizontalPosition, this.verticalPosition);
954
+ e = bt((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
955
+ } else e = bt({ disabled: this.disabled });
866
956
  return {
867
957
  root: e,
868
- draggable: mt("draggable")
958
+ draggable: bt("draggable")
869
959
  };
870
960
  } },
871
961
  emits: [
@@ -875,7 +965,7 @@ var mt = Xe("vue-handler-wrapper"), ht = {
875
965
  "drag-end"
876
966
  ]
877
967
  };
878
- ht.render = function(e, t, n, r, i, a) {
968
+ xt.render = function(e, t, n, r, i, a) {
879
969
  var o = x("DraggableElement");
880
970
  return z(), h("div", { class: a.classes.root }, [p(o, {
881
971
  class: a.classes.draggable,
@@ -898,9 +988,9 @@ ht.render = function(e, t, n, r, i, a) {
898
988
  _: 3
899
989
  }, 8, ["class"])], 2);
900
990
  };
901
- var gt = Xe("vue-line-wrapper"), _t = {
991
+ var St = nt("vue-line-wrapper"), Ct = {
902
992
  name: "LineWrapper",
903
- components: { DraggableElement: pt },
993
+ components: { DraggableElement: yt },
904
994
  props: {
905
995
  position: {
906
996
  type: String,
@@ -913,7 +1003,7 @@ var gt = Xe("vue-line-wrapper"), _t = {
913
1003
  },
914
1004
  computed: { classname: function() {
915
1005
  var e;
916
- return gt((W(e = {}, this.position, !0), W(e, "disabled", this.disabled), e));
1006
+ return St((W(e = {}, this.position, !0), W(e, "disabled", this.disabled), e));
917
1007
  } },
918
1008
  emits: [
919
1009
  "leave",
@@ -922,7 +1012,7 @@ var gt = Xe("vue-line-wrapper"), _t = {
922
1012
  "drag-end"
923
1013
  ]
924
1014
  };
925
- _t.render = function(e, t, n, r, i, a) {
1015
+ Ct.render = function(e, t, n, r, i, a) {
926
1016
  var o = x("DraggableElement");
927
1017
  return z(), h(o, {
928
1018
  class: a.classname,
@@ -945,23 +1035,23 @@ _t.render = function(e, t, n, r, i, a) {
945
1035
  _: 3
946
1036
  }, 8, ["class"]);
947
1037
  };
948
- var vt = [
1038
+ var wt = [
949
1039
  "left",
950
1040
  "right",
951
1041
  "top",
952
1042
  "bottom"
953
- ], yt = ["left", "right"], bt = ["top", "bottom"], xt = ["left", "top"], St = [
1043
+ ], Tt = ["left", "right"], Et = ["top", "bottom"], Dt = ["left", "top"], Ot = [
954
1044
  "fill-area",
955
1045
  "fit-area",
956
1046
  "stencil",
957
1047
  "none"
958
- ], Ct = {
1048
+ ], kt = {
959
1049
  left: 0,
960
1050
  top: 0,
961
1051
  width: 0,
962
1052
  height: 0
963
1053
  };
964
- function wt(e, t, n) {
1054
+ function At(e, t, n) {
965
1055
  return !(n ||= [
966
1056
  "width",
967
1057
  "height",
@@ -971,7 +1061,7 @@ function wt(e, t, n) {
971
1061
  return e[n] !== t[n];
972
1062
  }));
973
1063
  }
974
- function Tt(e) {
1064
+ function jt(e) {
975
1065
  return {
976
1066
  left: e.left,
977
1067
  top: e.top,
@@ -979,7 +1069,7 @@ function Tt(e) {
979
1069
  bottom: e.top + e.height
980
1070
  };
981
1071
  }
982
- function Et(e, t) {
1072
+ function Mt(e, t) {
983
1073
  return {
984
1074
  left: e.left - t.left,
985
1075
  top: e.top - t.top
@@ -991,19 +1081,19 @@ function J(e) {
991
1081
  top: e.top + e.height / 2
992
1082
  };
993
1083
  }
994
- function Dt(e, t) {
1084
+ function Nt(e, t) {
995
1085
  var n = {
996
1086
  left: 0,
997
1087
  top: 0,
998
1088
  right: 0,
999
1089
  bottom: 0
1000
1090
  };
1001
- return vt.forEach((function(r) {
1002
- var i = t[r], a = Tt(e)[r];
1091
+ return wt.forEach((function(r) {
1092
+ var i = t[r], a = jt(e)[r];
1003
1093
  n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
1004
1094
  })), n;
1005
1095
  }
1006
- function Ot(e, t) {
1096
+ function Pt(e, t) {
1007
1097
  return {
1008
1098
  left: e.left - t.left,
1009
1099
  top: e.top - t.top,
@@ -1011,7 +1101,7 @@ function Ot(e, t) {
1011
1101
  height: e.height + t.top + t.bottom
1012
1102
  };
1013
1103
  }
1014
- function kt(e) {
1104
+ function Ft(e) {
1015
1105
  return {
1016
1106
  left: -e.left,
1017
1107
  top: -e.top
@@ -1046,21 +1136,21 @@ function X(e, t, n, r) {
1046
1136
  function Z(e) {
1047
1137
  return e.width / e.height;
1048
1138
  }
1049
- function At(e, t) {
1139
+ function It(e, t) {
1050
1140
  return Math.min(t.right !== void 0 && t.left !== void 0 ? (t.right - t.left) / e.width : 1 / 0, t.bottom !== void 0 && t.top !== void 0 ? (t.bottom - t.top) / e.height : 1 / 0);
1051
1141
  }
1052
- function jt(e, t) {
1142
+ function Lt(e, t) {
1053
1143
  var n = {
1054
1144
  left: 0,
1055
1145
  top: 0
1056
- }, r = Dt(e, t);
1146
+ }, r = Nt(e, t);
1057
1147
  return r.left && r.left > 0 ? n.left = r.left : r.right && r.right > 0 && (n.left = -r.right), r.top && r.top > 0 ? n.top = r.top : r.bottom && r.bottom > 0 && (n.top = -r.bottom), n;
1058
1148
  }
1059
- function Mt(e, t) {
1149
+ function Rt(e, t) {
1060
1150
  var n;
1061
1151
  return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
1062
1152
  }
1063
- function Nt(e, t) {
1153
+ function zt(e, t) {
1064
1154
  var n = Z(e), r = Z(t);
1065
1155
  return t.width < 1 / 0 && t.height < 1 / 0 ? n > r ? {
1066
1156
  width: t.width,
@@ -1076,36 +1166,36 @@ function Nt(e, t) {
1076
1166
  height: t.height
1077
1167
  } : e;
1078
1168
  }
1079
- function Pt(e, t) {
1169
+ function Bt(e, t) {
1080
1170
  var n = t * Math.PI / 180;
1081
1171
  return {
1082
1172
  width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
1083
1173
  height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
1084
1174
  };
1085
1175
  }
1086
- function Ft(e, t) {
1176
+ function Vt(e, t) {
1087
1177
  var n = t * Math.PI / 180;
1088
1178
  return {
1089
1179
  left: e.left * Math.cos(n) - e.top * Math.sin(n),
1090
1180
  top: e.left * Math.sin(n) + e.top * Math.cos(n)
1091
1181
  };
1092
1182
  }
1093
- function It(e, t) {
1094
- var n = Dt(Q(e, t), t);
1095
- return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, At(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, At(e, t)) : 1;
1183
+ function Ht(e, t) {
1184
+ var n = Nt(Q(e, t), t);
1185
+ return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, It(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, It(e, t)) : 1;
1096
1186
  }
1097
1187
  function Q(e, t, n) {
1098
1188
  n === void 0 && (n = !1);
1099
- var r = jt(e, t);
1100
- return Y(e, n ? kt(r) : r);
1189
+ var r = Lt(e, t);
1190
+ return Y(e, n ? Ft(r) : r);
1101
1191
  }
1102
- function Lt(e) {
1192
+ function Ut(e) {
1103
1193
  return {
1104
1194
  width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0,
1105
1195
  height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0
1106
1196
  };
1107
1197
  }
1108
- function Rt(e, t) {
1198
+ function Wt(e, t) {
1109
1199
  return K(K({}, e), {
1110
1200
  minWidth: Math.min(t.width, e.minWidth),
1111
1201
  minHeight: Math.min(t.height, e.minHeight),
@@ -1113,25 +1203,25 @@ function Rt(e, t) {
1113
1203
  maxHeight: Math.min(t.height, e.maxHeight)
1114
1204
  });
1115
1205
  }
1116
- function zt(e, t, n) {
1206
+ function Gt(e, t, n) {
1117
1207
  n === void 0 && (n = !0);
1118
1208
  var r = {};
1119
- return vt.forEach((function(i) {
1209
+ return wt.forEach((function(i) {
1120
1210
  var a = e[i], o = t[i];
1121
1211
  a !== void 0 && o !== void 0 ? r[i] = i === "left" || i === "top" ? n ? Math.max(a, o) : Math.min(a, o) : n ? Math.min(a, o) : Math.max(a, o) : o === void 0 ? a !== void 0 && (r[i] = a) : r[i] = o;
1122
1212
  })), r;
1123
1213
  }
1124
- function Bt(e, t) {
1125
- return zt(e, t, !0);
1214
+ function Kt(e, t) {
1215
+ return Gt(e, t, !0);
1126
1216
  }
1127
- function Vt(e) {
1217
+ function qt(e) {
1128
1218
  var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
1129
1219
  return !!((t.correctRatio || Z(t) >= n.minimum && Z(t) <= n.maximum) && t.height <= i.maxHeight && t.width <= i.maxWidth && t.width && t.height && (r || t.height >= i.minHeight && t.width >= i.minWidth));
1130
1220
  }
1131
- function Ht(e, t) {
1221
+ function Jt(e, t) {
1132
1222
  return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
1133
1223
  }
1134
- function Ut(e) {
1224
+ function Yt(e) {
1135
1225
  var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
1136
1226
  minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
1137
1227
  maximum: e.aspectRatio && e.aspectRatio.maximum || 1 / 0
@@ -1141,15 +1231,15 @@ function Ut(e) {
1141
1231
  };
1142
1232
  function o(e, a) {
1143
1233
  return a === void 0 && (a = !1), e.reduce((function(e, o) {
1144
- return Vt({
1234
+ return qt({
1145
1235
  size: o,
1146
1236
  aspectRatio: i,
1147
1237
  sizeRestrictions: r,
1148
1238
  ignoreMinimum: a
1149
- }) && (!e || Ht(o, {
1239
+ }) && (!e || Jt(o, {
1150
1240
  width: t,
1151
1241
  height: n
1152
- }) < Ht(e, {
1242
+ }) < Jt(e, {
1153
1243
  width: t,
1154
1244
  height: n
1155
1245
  })) ? o : e;
@@ -1166,7 +1256,7 @@ function Ut(e) {
1166
1256
  height: a.height,
1167
1257
  correctRatio: !0
1168
1258
  });
1169
- })), Vt({
1259
+ })), qt({
1170
1260
  size: a,
1171
1261
  aspectRatio: i,
1172
1262
  sizeRestrictions: r
@@ -1177,16 +1267,16 @@ function Ut(e) {
1177
1267
  height: c.height
1178
1268
  };
1179
1269
  }
1180
- function Wt(e) {
1270
+ function Xt(e) {
1181
1271
  var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = Y(n, t.directions);
1182
- return Y(a, jt(a, i));
1272
+ return Y(a, Lt(a, i));
1183
1273
  }
1184
- function Gt(e) {
1274
+ function Zt(e) {
1185
1275
  var t = e.coordinates, n = e.transform, r = e.imageSize, i = e.sizeRestrictions, a = e.positionRestrictions, o = e.aspectRatio, s = e.visibleArea, c = function(e, t) {
1186
- return Wt({
1276
+ return Xt({
1187
1277
  coordinates: e,
1188
1278
  positionRestrictions: a,
1189
- event: new dt({
1279
+ event: new _t({
1190
1280
  left: t.left - e.left,
1191
1281
  top: t.top - e.top
1192
1282
  })
@@ -1199,7 +1289,7 @@ function Gt(e) {
1199
1289
  imageSize: r,
1200
1290
  visibleArea: s
1201
1291
  }) : e).width) && q(t.height) || (l = function(e, t) {
1202
- return c(K(K(K({}, e), Ut({
1292
+ return c(K(K(K({}, e), Yt({
1203
1293
  width: t.width,
1204
1294
  height: t.height,
1205
1295
  sizeRestrictions: i,
@@ -1214,9 +1304,9 @@ function Gt(e) {
1214
1304
  }(l, K(K({}, l), t))), q(t.left) && q(t.top) || (l = c(l, K(K({}, l), t)));
1215
1305
  })), l;
1216
1306
  }
1217
- function Kt(e) {
1307
+ function Qt(e) {
1218
1308
  var t = e.getAreaRestrictions, n = e.boundaries, r = e.coordinates, i = e.visibleArea, a = e.stencilSize, o = e.sizeRestrictions, s = e.positionRestrictions, c, l, u, d = K({}, r), f = K({}, i), p = K({}, a);
1219
- c = Z(p), l = Z(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = K(K({}, d), Ut({
1309
+ c = Z(p), l = Z(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = K(K({}, d), Yt({
1220
1310
  sizeRestrictions: o,
1221
1311
  width: d.width,
1222
1312
  height: d.height,
@@ -1225,19 +1315,19 @@ function Kt(e) {
1225
1315
  maximum: Z(p)
1226
1316
  }
1227
1317
  })));
1228
- var m = It(f = X(f, d.width * n.width / (f.width * p.width)), t({
1318
+ var m = Ht(f = X(f, d.width * n.width / (f.width * p.width)), t({
1229
1319
  visibleArea: f,
1230
1320
  type: "resize"
1231
1321
  }));
1232
- return m !== 1 && (f = X(f, m), d = X(d, m)), f = Q(f = Y(f, Et(J(d), J(f))), t({
1322
+ return m !== 1 && (f = X(f, m), d = X(d, m)), f = Q(f = Y(f, Mt(J(d), J(f))), t({
1233
1323
  visibleArea: f,
1234
1324
  type: "move"
1235
1325
  })), {
1236
- coordinates: d = Q(d, Bt(Tt(f), s)),
1326
+ coordinates: d = Q(d, Kt(jt(f), s)),
1237
1327
  visibleArea: f
1238
1328
  };
1239
1329
  }
1240
- function qt(e) {
1330
+ function $t(e) {
1241
1331
  var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s = K({}, i), c = K({}, a);
1242
1332
  if (i && a && t.type !== "manipulateImage") {
1243
1333
  var l = {
@@ -1245,31 +1335,31 @@ function qt(e) {
1245
1335
  height: 0
1246
1336
  };
1247
1337
  Z(r) > Z(s) ? (l.height = .8 * r.height, l.width = l.height * Z(s)) : (l.width = .8 * r.width, l.height = l.width * Z(s));
1248
- var u = It(c = X(c, s.width * r.width / (c.width * l.width)), n({
1338
+ var u = Ht(c = X(c, s.width * r.width / (c.width * l.width)), n({
1249
1339
  visibleArea: c,
1250
1340
  type: "resize"
1251
1341
  }));
1252
- c = X(c, u), u !== 1 && (l.height /= u, l.width /= u), c = Q(c = Y(c, Et(J(s), J(c))), n({
1342
+ c = X(c, u), u !== 1 && (l.height /= u, l.width /= u), c = Q(c = Y(c, Mt(J(s), J(c))), n({
1253
1343
  visibleArea: c,
1254
1344
  type: "move"
1255
- })), s = Q(s, Bt(Tt(c), o));
1345
+ })), s = Q(s, Kt(jt(c), o));
1256
1346
  }
1257
1347
  return {
1258
1348
  coordinates: s,
1259
1349
  visibleArea: c
1260
1350
  };
1261
1351
  }
1262
- function Jt(e) {
1352
+ function en(e) {
1263
1353
  var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = K({}, r), o = K({}, n);
1264
1354
  if (t.type === "setCoordinates") {
1265
1355
  var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
1266
- s > c ? a = X(a, Math.min(o.width / a.width, At(a, i({
1356
+ s > c ? a = X(a, Math.min(o.width / a.width, It(a, i({
1267
1357
  visibleArea: a,
1268
1358
  type: "resize"
1269
- })))) : c > s && (a = X(a, Math.min(o.height / a.height, At(a, i({
1359
+ })))) : c > s && (a = X(a, Math.min(o.height / a.height, It(a, i({
1270
1360
  visibleArea: a,
1271
1361
  type: "resize"
1272
- }))))), a = Q(a = Y(a, kt(jt(o, Tt(a)))), i({
1362
+ }))))), a = Q(a = Y(a, Ft(Lt(o, jt(a)))), i({
1273
1363
  visibleArea: a,
1274
1364
  type: "move"
1275
1365
  }));
@@ -1279,14 +1369,14 @@ function Jt(e) {
1279
1369
  coordinates: o
1280
1370
  };
1281
1371
  }
1282
- function Yt(e) {
1372
+ function tn(e) {
1283
1373
  var t = e.imageSize, n = e.visibleArea, r = e.coordinates, i = n || t;
1284
1374
  return {
1285
1375
  left: (n ? n.left : 0) + i.width / 2 - r.width / 2,
1286
1376
  top: (n ? n.top : 0) + i.height / 2 - r.height / 2
1287
1377
  };
1288
1378
  }
1289
- function Xt(e) {
1379
+ function nn(e) {
1290
1380
  var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || 1 / 0, Math.max(r.minimum || 0, Z(a))), s = a.width < a.height ? {
1291
1381
  width: .8 * a.width,
1292
1382
  height: .8 * a.width / o
@@ -1294,35 +1384,35 @@ function Xt(e) {
1294
1384
  height: .8 * a.height,
1295
1385
  width: .8 * a.height * o
1296
1386
  };
1297
- return Ut(K(K({}, s), {
1387
+ return Yt(K(K({}, s), {
1298
1388
  aspectRatio: r,
1299
1389
  sizeRestrictions: i
1300
1390
  }));
1301
1391
  }
1302
- function Zt(e) {
1392
+ function rn(e) {
1303
1393
  var t, n, r = e.imageSize, i = e.visibleArea, a = e.boundaries, o = e.aspectRatio, s = e.sizeRestrictions, c = e.stencilSize, l = i || r;
1304
- return Z(l) > Z(a) ? n = (t = c.height * l.height / a.height) * Z(c) : t = (n = c.width * l.width / a.width) / Z(c), Ut({
1394
+ return Z(l) > Z(a) ? n = (t = c.height * l.height / a.height) * Z(c) : t = (n = c.width * l.width / a.width) / Z(c), Yt({
1305
1395
  width: n,
1306
1396
  height: t,
1307
1397
  aspectRatio: o,
1308
1398
  sizeRestrictions: s
1309
1399
  });
1310
1400
  }
1311
- function Qt(e) {
1401
+ function an(e) {
1312
1402
  var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = Z(e.boundaries);
1313
1403
  if (n) {
1314
1404
  var a = {
1315
1405
  height: Math.max(n.height, r.height),
1316
1406
  width: Math.max(n.width, r.width)
1317
- }, o = Nt({
1407
+ }, o = zt({
1318
1408
  width: Z(a) > i ? a.width : a.height * i,
1319
1409
  height: Z(a) > i ? a.width / i : a.height
1320
- }, Lt(t())), s = {
1410
+ }, Ut(t())), s = {
1321
1411
  left: n.left + n.width / 2 - o.width / 2,
1322
1412
  top: n.top + n.height / 2 - o.height / 2,
1323
1413
  width: o.width,
1324
1414
  height: o.height
1325
- }, c = Dt(n, Tt(K({
1415
+ }, c = Nt(n, jt(K({
1326
1416
  left: 0,
1327
1417
  top: 0
1328
1418
  }, r))), l = {};
@@ -1339,10 +1429,10 @@ function Qt(e) {
1339
1429
  height: o.height
1340
1430
  };
1341
1431
  }
1342
- function $t(e, t) {
1343
- return zt(e, Tt(t));
1432
+ function on(e, t) {
1433
+ return Gt(e, jt(t));
1344
1434
  }
1345
- function en(e) {
1435
+ function sn(e) {
1346
1436
  var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.sizeRestrictions, a = e.getAreaRestrictions, o = e.positionRestrictions, s = e.adjustStencil, c = t.scale, l = t.move, u = K({}, r), d = K({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
1347
1437
  u = Y(u, {
1348
1438
  left: l.left || 0,
@@ -1351,16 +1441,16 @@ function en(e) {
1351
1441
  var h = {
1352
1442
  stencil: {
1353
1443
  minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
1354
- maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0, At(d, o))
1444
+ maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0, It(d, o))
1355
1445
  },
1356
- area: { maximum: At(u, a({
1446
+ area: { maximum: It(u, a({
1357
1447
  visibleArea: u,
1358
1448
  type: "resize"
1359
1449
  })) }
1360
1450
  };
1361
1451
  c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u = X(u, p, c.center));
1362
1452
  var g = n.left - r.left, _ = r.width + r.left - (n.width + n.left), v = n.top - r.top, y = r.height + r.top - (n.height + n.top);
1363
- return u = Q(u = Y(u, jt(u, {
1453
+ return u = Q(u = Y(u, Lt(u, {
1364
1454
  left: o.left === void 0 ? void 0 : o.left - g * p,
1365
1455
  top: o.top === void 0 ? void 0 : o.top - v * p,
1366
1456
  bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
@@ -1368,46 +1458,46 @@ function en(e) {
1368
1458
  })), a({
1369
1459
  visibleArea: u,
1370
1460
  type: "move"
1371
- })), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Q(d, Bt(Tt(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = Y(u = Q(u = X(u, f, c.factor > 1 ? c.center : J(d)), a({
1461
+ })), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Q(d, Kt(jt(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = Y(u = Q(u = X(u, f, c.factor > 1 ? c.center : J(d)), a({
1372
1462
  visibleArea: u,
1373
1463
  type: "move"
1374
- })), kt(jt(d, Tt(u)))))), {
1464
+ })), Ft(Lt(d, jt(u)))))), {
1375
1465
  coordinates: d,
1376
1466
  visibleArea: u
1377
1467
  };
1378
1468
  }
1379
- function tn(e) {
1380
- var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = K({}, r), d = K({}, i), f = Ft(J(K({
1469
+ function cn(e) {
1470
+ var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = K({}, r), d = K({}, i), f = Vt(J(K({
1381
1471
  left: 0,
1382
1472
  top: 0
1383
1473
  }, c)), l);
1384
- return (u = K(K({}, Ut({
1474
+ return (u = K(K({}, Yt({
1385
1475
  sizeRestrictions: a,
1386
1476
  aspectRatio: t,
1387
1477
  width: u.width,
1388
1478
  height: u.height
1389
- })), Ft(J(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = X(d, It(d, n({
1479
+ })), Vt(J(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = X(d, Ht(d, n({
1390
1480
  visibleArea: d,
1391
1481
  type: "resize"
1392
1482
  }))), {
1393
1483
  coordinates: u = Q(u, o),
1394
- visibleArea: d = Q(d = Y(d, Et(J(u), J(r))), n({
1484
+ visibleArea: d = Q(d = Y(d, Mt(J(u), J(r))), n({
1395
1485
  visibleArea: d,
1396
1486
  type: "move"
1397
1487
  }))
1398
1488
  };
1399
1489
  }
1400
- function nn(e) {
1490
+ function ln(e) {
1401
1491
  var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = K({}, a), l = K({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
1402
1492
  if (u || d) {
1403
- var f = Ft({
1493
+ var f = Vt({
1404
1494
  left: s.width / 2,
1405
1495
  top: s.height / 2
1406
- }, -r), p = Ft(J(c), -r), m = Ft({
1496
+ }, -r), p = Vt(J(c), -r), m = Vt({
1407
1497
  left: u ? f.left - (p.left - f.left) : p.left,
1408
1498
  top: d ? f.top - (p.top - f.top) : p.top
1409
1499
  }, r);
1410
- c = Y(c, Et(m, J(c))), p = Ft(J(l), -r), l = Q(l = Y(l, Et(m = Ft({
1500
+ c = Y(c, Mt(m, J(c))), p = Vt(J(l), -r), l = Q(l = Y(l, Mt(m = Vt({
1411
1501
  left: u ? f.left - (p.left - f.left) : p.left,
1412
1502
  top: d ? f.top - (p.top - f.top) : p.top
1413
1503
  }, r), J(l))), i({
@@ -1420,11 +1510,11 @@ function nn(e) {
1420
1510
  visibleArea: l
1421
1511
  };
1422
1512
  }
1423
- function rn(e) {
1424
- var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = K({}, t), l = Ot(n, c).width, u = Ot(n, c).height;
1513
+ function un(e) {
1514
+ var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = K({}, t), l = Pt(n, c).width, u = Pt(n, c).height;
1425
1515
  l < 0 && (c.left < 0 && c.right < 0 ? (c.left = -(n.width - a.minWidth) / (c.left / c.right), c.right = -(n.width - a.minWidth) / (c.right / c.left)) : c.left < 0 ? c.left = -(n.width - a.minWidth) : c.right < 0 && (c.right = -(n.width - a.minWidth))), u < 0 && (c.top < 0 && c.bottom < 0 ? (c.top = -(n.height - a.minHeight) / (c.top / c.bottom), c.bottom = -(n.height - a.minHeight) / (c.bottom / c.top)) : c.top < 0 ? c.top = -(n.height - a.minHeight) : c.bottom < 0 && (c.bottom = -(n.height - a.minHeight)));
1426
- var d = Dt(Ot(n, c), i);
1427
- s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = Dt(Ot(n, c), i));
1516
+ var d = Nt(Pt(n, c), i);
1517
+ s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = Nt(Pt(n, c), i));
1428
1518
  var f = {
1429
1519
  width: 1 / 0,
1430
1520
  height: 1 / 0,
@@ -1433,37 +1523,37 @@ function rn(e) {
1433
1523
  top: 1 / 0,
1434
1524
  bottom: 1 / 0
1435
1525
  };
1436
- if (vt.forEach((function(e) {
1526
+ if (wt.forEach((function(e) {
1437
1527
  var t = d[e];
1438
1528
  t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
1439
1529
  })), o) {
1440
- var p = Math.min.apply(null, vt.map((function(e) {
1530
+ var p = Math.min.apply(null, wt.map((function(e) {
1441
1531
  return f[e];
1442
1532
  })));
1443
- p !== 1 / 0 && vt.forEach((function(e) {
1533
+ p !== 1 / 0 && wt.forEach((function(e) {
1444
1534
  c[e] *= p;
1445
1535
  }));
1446
- } else vt.forEach((function(e) {
1536
+ } else wt.forEach((function(e) {
1447
1537
  f[e] !== 1 / 0 && (c[e] *= f[e]);
1448
1538
  }));
1449
- if (l = Ot(n, c).width, u = Ot(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
1539
+ if (l = Pt(n, c).width, u = Pt(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
1450
1540
  var m = Math.min(f.width, f.height);
1451
- m !== 1 / 0 && vt.forEach((function(e) {
1541
+ m !== 1 / 0 && wt.forEach((function(e) {
1452
1542
  c[e] *= m;
1453
1543
  }));
1454
- } else f.width !== 1 / 0 && yt.forEach((function(e) {
1544
+ } else f.width !== 1 / 0 && Tt.forEach((function(e) {
1455
1545
  c[e] *= f.width;
1456
- })), f.height !== 1 / 0 && bt.forEach((function(e) {
1546
+ })), f.height !== 1 / 0 && Et.forEach((function(e) {
1457
1547
  c[e] *= f.height;
1458
1548
  }));
1459
1549
  return c;
1460
1550
  }
1461
- function an(e, t, n) {
1551
+ function dn(e, t, n) {
1462
1552
  return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
1463
1553
  }
1464
- var on = Xe("vue-simple-handler"), sn = Xe("vue-simple-handler-wrapper"), cn = {
1554
+ var fn = nt("vue-simple-handler"), pn = nt("vue-simple-handler-wrapper"), mn = {
1465
1555
  name: "SimpleHandler",
1466
- components: { HandlerWrapper: ht },
1556
+ components: { HandlerWrapper: xt },
1467
1557
  props: {
1468
1558
  defaultClass: { type: String },
1469
1559
  hoverClass: { type: String },
@@ -1481,8 +1571,8 @@ var on = Xe("vue-simple-handler"), sn = Xe("vue-simple-handler-wrapper"), cn = {
1481
1571
  computed: { classes: function() {
1482
1572
  var e, t = (W(e = {}, this.horizontalPosition, !!this.horizontalPosition), W(e, this.verticalPosition, !!this.verticalPosition), W(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), W(e, "hover", this.hover), e);
1483
1573
  return {
1484
- default: G(on(t), this.defaultClass, this.hover && this.hoverClass),
1485
- wrapper: G(sn(t), this.wrapperClass)
1574
+ default: G(fn(t), this.defaultClass, this.hover && this.hoverClass),
1575
+ wrapper: G(pn(t), this.wrapperClass)
1486
1576
  };
1487
1577
  } },
1488
1578
  methods: {
@@ -1501,7 +1591,7 @@ var on = Xe("vue-simple-handler"), sn = Xe("vue-simple-handler-wrapper"), cn = {
1501
1591
  },
1502
1592
  emits: ["drag", "drag-end"]
1503
1593
  };
1504
- cn.render = function(e, t, n, r, i, a) {
1594
+ mn.render = function(e, t, n, r, i, a) {
1505
1595
  var o = x("HandlerWrapper");
1506
1596
  return z(), h(o, {
1507
1597
  class: a.classes.wrapper,
@@ -1528,9 +1618,9 @@ cn.render = function(e, t, n, r, i, a) {
1528
1618
  "onLeave"
1529
1619
  ]);
1530
1620
  };
1531
- var ln = Xe("vue-simple-line"), un = Xe("vue-simple-line-wrapper"), dn = {
1621
+ var hn = nt("vue-simple-line"), gn = nt("vue-simple-line-wrapper"), _n = {
1532
1622
  name: "SimpleLine",
1533
- components: { LineWrapper: _t },
1623
+ components: { LineWrapper: Ct },
1534
1624
  props: {
1535
1625
  defaultClass: { type: String },
1536
1626
  hoverClass: { type: String },
@@ -1546,8 +1636,8 @@ var ln = Xe("vue-simple-line"), un = Xe("vue-simple-line-wrapper"), dn = {
1546
1636
  },
1547
1637
  computed: { classes: function() {
1548
1638
  return {
1549
- root: G(ln(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
1550
- wrapper: G(un(W({}, this.position, !0)), this.wrapperClass)
1639
+ root: G(hn(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
1640
+ wrapper: G(gn(W({}, this.position, !0)), this.wrapperClass)
1551
1641
  };
1552
1642
  } },
1553
1643
  methods: {
@@ -1566,7 +1656,7 @@ var ln = Xe("vue-simple-line"), un = Xe("vue-simple-line-wrapper"), dn = {
1566
1656
  },
1567
1657
  emits: ["drag", "drag-end"]
1568
1658
  };
1569
- dn.render = function(e, t, n, r, i, a) {
1659
+ _n.render = function(e, t, n, r, i, a) {
1570
1660
  var o = x("LineWrapper");
1571
1661
  return z(), h(o, {
1572
1662
  class: a.classes.wrapper,
@@ -1591,15 +1681,15 @@ dn.render = function(e, t, n, r, i, a) {
1591
1681
  "onLeave"
1592
1682
  ]);
1593
1683
  };
1594
- var fn = Xe("vue-bounding-box"), pn = [
1684
+ var vn = nt("vue-bounding-box"), yn = [
1595
1685
  "east",
1596
1686
  "west",
1597
1687
  null
1598
- ], mn = [
1688
+ ], bn = [
1599
1689
  "south",
1600
1690
  "north",
1601
1691
  null
1602
- ], hn = {
1692
+ ], xn = {
1603
1693
  name: "BoundingBox",
1604
1694
  props: {
1605
1695
  width: { type: Number },
@@ -1623,7 +1713,7 @@ var fn = Xe("vue-bounding-box"), pn = [
1623
1713
  handlersComponent: {
1624
1714
  type: [Object, String],
1625
1715
  default: function() {
1626
- return cn;
1716
+ return mn;
1627
1717
  }
1628
1718
  },
1629
1719
  handlersClasses: {
@@ -1652,7 +1742,7 @@ var fn = Xe("vue-bounding-box"), pn = [
1652
1742
  linesComponent: {
1653
1743
  type: [Object, String],
1654
1744
  default: function() {
1655
- return dn;
1745
+ return _n;
1656
1746
  }
1657
1747
  },
1658
1748
  linesClasses: {
@@ -1674,10 +1764,10 @@ var fn = Xe("vue-bounding-box"), pn = [
1674
1764
  },
1675
1765
  data: function() {
1676
1766
  var e = [];
1677
- return pn.forEach((function(t) {
1678
- mn.forEach((function(n) {
1767
+ return yn.forEach((function(t) {
1768
+ bn.forEach((function(n) {
1679
1769
  if (t !== n) {
1680
- var r = $e(t, n);
1770
+ var r = at(t, n);
1681
1771
  e.push({
1682
1772
  name: r.name,
1683
1773
  classname: r.classname,
@@ -1696,7 +1786,7 @@ var fn = Xe("vue-bounding-box"), pn = [
1696
1786
  classes: function() {
1697
1787
  var e = this.handlersClasses, t = this.handlersWrappersClasses, n = this.linesClasses, r = this.linesWrappersClasses;
1698
1788
  return {
1699
- root: fn(),
1789
+ root: vn(),
1700
1790
  handlers: e,
1701
1791
  handlersWrappers: t,
1702
1792
  lines: n,
@@ -1734,8 +1824,8 @@ var fn = Xe("vue-bounding-box"), pn = [
1734
1824
  };
1735
1825
  if (n && r) {
1736
1826
  var o = i.horizontalDirection, s = i.verticalDirection, c = o === "east" ? n : o === "west" ? 0 : n / 2, l = s === "south" ? r : s === "north" ? 0 : r / 2;
1737
- a.wrapperClass = fn("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
1738
- } else a.wrapperClass = fn("handler", W({}, i.classname, !0));
1827
+ a.wrapperClass = vn("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
1828
+ } else a.wrapperClass = vn("handler", W({}, i.classname, !0));
1739
1829
  t.push(a);
1740
1830
  }
1741
1831
  })), t;
@@ -1761,7 +1851,7 @@ var fn = Xe("vue-bounding-box"), pn = [
1761
1851
  top: 0,
1762
1852
  bottom: 0
1763
1853
  };
1764
- t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new ut(s, {
1854
+ t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new gt(s, {
1765
1855
  allowedDirections: {
1766
1856
  left: t === "west" || !t,
1767
1857
  right: t === "east" || !t,
@@ -1775,7 +1865,7 @@ var fn = Xe("vue-bounding-box"), pn = [
1775
1865
  },
1776
1866
  emits: ["resize", "resize-end"]
1777
1867
  };
1778
- hn.render = function(e, t, n, r, i, a) {
1868
+ xn.render = function(e, t, n, r, i, a) {
1779
1869
  return z(), h("div", {
1780
1870
  ref: "box",
1781
1871
  class: a.classes.root,
@@ -1835,7 +1925,7 @@ hn.render = function(e, t, n, r, i, a) {
1835
1925
  })), 128))
1836
1926
  ], 6);
1837
1927
  };
1838
- var gn = Xe("vue-draggable-area"), _n = {
1928
+ var Sn = nt("vue-draggable-area"), Cn = {
1839
1929
  name: "DraggableArea",
1840
1930
  props: {
1841
1931
  movable: {
@@ -1848,7 +1938,7 @@ var gn = Xe("vue-draggable-area"), _n = {
1848
1938
  }
1849
1939
  },
1850
1940
  computed: { classnames: function() {
1851
- return { default: gn() };
1941
+ return { default: Sn() };
1852
1942
  } },
1853
1943
  beforeMount: function() {
1854
1944
  window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
@@ -1863,14 +1953,14 @@ var gn = Xe("vue-draggable-area"), _n = {
1863
1953
  onTouchStart: function(e) {
1864
1954
  if (e.cancelable) {
1865
1955
  var t = this.movable && e.touches.length === 1;
1866
- t && (this.touches = Ge(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1956
+ t && (this.touches = Ze(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1867
1957
  }
1868
1958
  },
1869
1959
  onTouchEnd: function() {
1870
1960
  this.touchStarted = !1, this.processEnd();
1871
1961
  },
1872
1962
  onTouchMove: function(e) {
1873
- this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : ct({
1963
+ this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : mt({
1874
1964
  x: this.touches[0].clientX,
1875
1965
  y: this.touches[0].clientY
1876
1966
  }, {
@@ -1909,10 +1999,10 @@ var gn = Xe("vue-draggable-area"), _n = {
1909
1999
  };
1910
2000
  },
1911
2001
  processMove: function(e, t) {
1912
- var n = Ge(t);
2002
+ var n = Ze(t);
1913
2003
  if (this.touches.length) {
1914
2004
  var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
1915
- this.touches.length === 1 && n.length === 1 && this.$emit("move", new dt({
2005
+ this.touches.length === 1 && n.length === 1 && this.$emit("move", new _t({
1916
2006
  left: n[0].clientX - (i + this.anchor.x),
1917
2007
  top: n[0].clientY - (a + this.anchor.y)
1918
2008
  }));
@@ -1924,7 +2014,7 @@ var gn = Xe("vue-draggable-area"), _n = {
1924
2014
  },
1925
2015
  emits: ["move", "move-end"]
1926
2016
  };
1927
- _n.render = function(e, t, n, r, i, a) {
2017
+ Cn.render = function(e, t, n, r, i, a) {
1928
2018
  return z(), h("div", {
1929
2019
  ref: "container",
1930
2020
  onTouchstart: t[1] ||= function() {
@@ -1935,7 +2025,7 @@ _n.render = function(e, t, n, r, i, a) {
1935
2025
  }
1936
2026
  }, [c(e.$slots, "default")], 544);
1937
2027
  };
1938
- function vn(e) {
2028
+ function wn(e) {
1939
2029
  return {
1940
2030
  rotate: e.rotate || 0,
1941
2031
  flip: {
@@ -1944,7 +2034,7 @@ function vn(e) {
1944
2034
  }
1945
2035
  };
1946
2036
  }
1947
- function yn(e) {
2037
+ function Tn(e) {
1948
2038
  return new Promise((function(t, n) {
1949
2039
  try {
1950
2040
  if (e) {
@@ -1977,11 +2067,11 @@ function yn(e) {
1977
2067
  var a, o, s;
1978
2068
  }));
1979
2069
  }
1980
- function bn(e) {
2070
+ function En(e) {
1981
2071
  var t = e.rotate, n = e.flip, r = e.scaleX, i = e.scaleY, a = "";
1982
2072
  return a += " rotate(" + t + "deg) ", a += " scaleX(" + r * (n.horizontal ? -1 : 1) + ") ", a += " scaleY(" + i * (n.vertical ? -1 : 1) + ") ";
1983
2073
  }
1984
- function xn(e) {
2074
+ function Dn(e) {
1985
2075
  try {
1986
2076
  var t, n = new DataView(e), r = void 0, i = void 0, a = void 0, o = void 0;
1987
2077
  if (n.getUint8(0) === 255 && n.getUint8(1) === 216) for (var s = n.byteLength, c = 2; c + 1 < s;) {
@@ -2013,7 +2103,7 @@ function xn(e) {
2013
2103
  return null;
2014
2104
  }
2015
2105
  }
2016
- function Sn(e, t) {
2106
+ function On(e, t) {
2017
2107
  var n = t.getBoundingClientRect(), r = n.left, i = n.top, a = {
2018
2108
  left: 0,
2019
2109
  top: 0
@@ -2021,7 +2111,7 @@ function Sn(e, t) {
2021
2111
  return e.forEach((function(t) {
2022
2112
  a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
2023
2113
  })), e.forEach((function(e) {
2024
- o += ct({
2114
+ o += mt({
2025
2115
  x: a.left,
2026
2116
  y: a.top
2027
2117
  }, {
@@ -2034,7 +2124,7 @@ function Sn(e, t) {
2034
2124
  count: e.length
2035
2125
  };
2036
2126
  }
2037
- var Cn = {
2127
+ var kn = {
2038
2128
  props: {
2039
2129
  touchMove: {
2040
2130
  type: Boolean,
@@ -2064,18 +2154,18 @@ var Cn = {
2064
2154
  window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
2065
2155
  },
2066
2156
  created: function() {
2067
- this.transforming = !1, this.debouncedProcessEnd = Qe(this.processEnd), this.touches = [];
2157
+ this.transforming = !1, this.debouncedProcessEnd = it(this.processEnd), this.touches = [];
2068
2158
  },
2069
2159
  methods: {
2070
2160
  processMove: function(e, t) {
2071
2161
  if (this.touches.length) {
2072
- if (this.touches.length === 1 && t.length === 1) this.$emit("move", new lt({
2162
+ if (this.touches.length === 1 && t.length === 1) this.$emit("move", new ht({
2073
2163
  left: this.touches[0].clientX - t[0].clientX,
2074
2164
  top: this.touches[0].clientY - t[0].clientY
2075
2165
  }));
2076
2166
  else if (this.touches.length > 1 && this.touchResize) {
2077
- var n = Sn(t, this.$refs.container), r = this.oldGeometricProperties;
2078
- r.count === n.count && r.count > 1 && this.$emit("resize", new lt({
2167
+ var n = On(t, this.$refs.container), r = this.oldGeometricProperties;
2168
+ r.count === n.count && r.count > 1 && this.$emit("resize", new ht({
2079
2169
  left: r.centerMass.left - n.centerMass.left,
2080
2170
  top: r.centerMass.top - n.centerMass.top
2081
2171
  }, {
@@ -2098,9 +2188,9 @@ var Cn = {
2098
2188
  onTouchStart: function(e) {
2099
2189
  if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
2100
2190
  var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
2101
- this.touches = Ge(e.touches).filter((function(e) {
2191
+ this.touches = Ze(e.touches).filter((function(e) {
2102
2192
  return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
2103
- })), this.oldGeometricProperties = Sn(this.touches, t);
2193
+ })), this.oldGeometricProperties = On(this.touches, t);
2104
2194
  }
2105
2195
  },
2106
2196
  onTouchEnd: function(e) {
@@ -2109,7 +2199,7 @@ var Cn = {
2109
2199
  onTouchMove: function(e) {
2110
2200
  var t = this;
2111
2201
  if (this.touches.length) {
2112
- var n = Ge(e.touches).filter((function(e) {
2202
+ var n = Ze(e.touches).filter((function(e) {
2113
2203
  return !e.identifier || t.touches.find((function(t) {
2114
2204
  return t.identifier === e.identifier;
2115
2205
  }));
@@ -2138,11 +2228,11 @@ var Cn = {
2138
2228
  },
2139
2229
  onWheel: function(e) {
2140
2230
  if (this.wheelResize && this.processEvent(e)) {
2141
- var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || st(s) ? s : s > 0 ? 1 : -1), a = {
2231
+ var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || pt(s) ? s : s > 0 ? 1 : -1), a = {
2142
2232
  left: e.clientX - n,
2143
2233
  top: e.clientY - r
2144
2234
  };
2145
- this.$emit("resize", new lt({}, {
2235
+ this.$emit("resize", new ht({}, {
2146
2236
  factor: i,
2147
2237
  center: a
2148
2238
  })), this.touches.length || this.debouncedProcessEnd();
@@ -2156,7 +2246,7 @@ var Cn = {
2156
2246
  "transform-end"
2157
2247
  ]
2158
2248
  };
2159
- Cn.render = function(e, t, n, r, i, a) {
2249
+ kn.render = function(e, t, n, r, i, a) {
2160
2250
  return z(), h("div", {
2161
2251
  ref: "container",
2162
2252
  onTouchstart: t[1] ||= function() {
@@ -2170,8 +2260,8 @@ Cn.render = function(e, t, n, r, i, a) {
2170
2260
  }
2171
2261
  }, [c(e.$slots, "default")], 544);
2172
2262
  };
2173
- var wn = {
2174
- components: { TransformableImage: Cn },
2263
+ var An = {
2264
+ components: { TransformableImage: kn },
2175
2265
  props: {
2176
2266
  touchMove: {
2177
2267
  type: Boolean,
@@ -2192,7 +2282,7 @@ var wn = {
2192
2282
  },
2193
2283
  emits: ["resize", "move"]
2194
2284
  };
2195
- wn.render = function(e, t, n, r, i, a) {
2285
+ An.render = function(e, t, n, r, i, a) {
2196
2286
  var o = x("transformable-image");
2197
2287
  return z(), h(o, {
2198
2288
  "touch-move": n.touchMove,
@@ -2217,7 +2307,7 @@ wn.render = function(e, t, n, r, i, a) {
2217
2307
  "wheel-resize"
2218
2308
  ]);
2219
2309
  };
2220
- var Tn = Xe("vue-preview"), En = {
2310
+ var jn = nt("vue-preview"), Mn = {
2221
2311
  props: {
2222
2312
  coordinates: { type: Object },
2223
2313
  transitions: { type: Object },
@@ -2247,10 +2337,10 @@ var Tn = Xe("vue-preview"), En = {
2247
2337
  computed: {
2248
2338
  classes: function() {
2249
2339
  return {
2250
- root: Tn({ fill: this.fill }),
2251
- wrapper: Tn("wrapper"),
2252
- imageWrapper: Tn("image-wrapper"),
2253
- image: G(Tn("image"), this.imageClass)
2340
+ root: jn({ fill: this.fill }),
2341
+ wrapper: jn("wrapper"),
2342
+ imageWrapper: jn("image-wrapper"),
2343
+ image: G(jn("image"), this.imageClass)
2254
2344
  };
2255
2345
  },
2256
2346
  style: function() {
@@ -2278,7 +2368,7 @@ var Tn = Xe("vue-preview"), En = {
2278
2368
  }, this.image.transforms), {}, {
2279
2369
  scaleX: 1 / e,
2280
2370
  scaleY: 1 / e
2281
- }), n = this.imageSize.width, r = this.imageSize.height, i = Pt({
2371
+ }), n = this.imageSize.width, r = this.imageSize.height, i = Bt({
2282
2372
  width: n,
2283
2373
  height: r
2284
2374
  }, t.rotate), a = {
@@ -2297,7 +2387,7 @@ var Tn = Xe("vue-preview"), En = {
2297
2387
  }
2298
2388
  };
2299
2389
  return a.transform = `translate(
2300
- ${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + bn(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
2390
+ ${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + En(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
2301
2391
  }
2302
2392
  return {};
2303
2393
  },
@@ -2341,7 +2431,7 @@ var Tn = Xe("vue-preview"), En = {
2341
2431
  }
2342
2432
  }
2343
2433
  };
2344
- En.render = function(e, t, n, r, i, a) {
2434
+ Mn.render = function(e, t, n, r, i, a) {
2345
2435
  return z(), h("div", {
2346
2436
  ref: "root",
2347
2437
  class: a.classes.root,
@@ -2357,20 +2447,20 @@ En.render = function(e, t, n, r, i, a) {
2357
2447
  style: a.imageStyle
2358
2448
  }, null, 14, ["src"]), [[ye, n.image && n.image.src]])], 6)], 6);
2359
2449
  };
2360
- var Dn = {
2361
- components: { Preview: En },
2450
+ var Nn = {
2451
+ components: { Preview: Mn },
2362
2452
  inheritAttrs: !1
2363
2453
  };
2364
- Dn.render = function(e, t, n, r, i, a) {
2454
+ Nn.render = function(e, t, n, r, i, a) {
2365
2455
  var o = x("preview");
2366
2456
  return z(), h(o, f(e.$attrs, { fill: !0 }), null, 16);
2367
2457
  };
2368
- var On = Xe("vue-rectangle-stencil"), kn = {
2458
+ var Pn = nt("vue-rectangle-stencil"), Fn = {
2369
2459
  name: "RectangleStencil",
2370
2460
  components: {
2371
- StencilPreview: Dn,
2372
- BoundingBox: hn,
2373
- DraggableArea: _n
2461
+ StencilPreview: Nn,
2462
+ BoundingBox: xn,
2463
+ DraggableArea: Cn
2374
2464
  },
2375
2465
  props: {
2376
2466
  image: { type: Object },
@@ -2380,14 +2470,14 @@ var On = Xe("vue-rectangle-stencil"), kn = {
2380
2470
  handlersComponent: {
2381
2471
  type: [Object, String],
2382
2472
  default: function() {
2383
- return cn;
2473
+ return mn;
2384
2474
  }
2385
2475
  },
2386
2476
  lines: { type: Object },
2387
2477
  linesComponent: {
2388
2478
  type: [Object, String],
2389
2479
  default: function() {
2390
- return dn;
2480
+ return _n;
2391
2481
  }
2392
2482
  },
2393
2483
  aspectRatio: { type: [Number, String] },
@@ -2440,13 +2530,13 @@ var On = Xe("vue-rectangle-stencil"), kn = {
2440
2530
  computed: {
2441
2531
  classes: function() {
2442
2532
  return {
2443
- stencil: G(On({
2533
+ stencil: G(Pn({
2444
2534
  movable: this.movable,
2445
2535
  moving: this.moving,
2446
2536
  resizing: this.resizing
2447
2537
  }), this.moving && this.movingClass, this.resizing && this.resizingClass),
2448
- preview: G(On("preview"), this.previewClass),
2449
- boundingBox: G(On("bounding-box"), this.boundingBoxClass)
2538
+ preview: G(Pn("preview"), this.previewClass),
2539
+ boundingBox: G(Pn("bounding-box"), this.boundingBoxClass)
2450
2540
  };
2451
2541
  },
2452
2542
  style: function() {
@@ -2485,7 +2575,7 @@ var On = Xe("vue-rectangle-stencil"), kn = {
2485
2575
  "move-end"
2486
2576
  ]
2487
2577
  };
2488
- kn.render = function(e, t, n, r, i, a) {
2578
+ Fn.render = function(e, t, n, r, i, a) {
2489
2579
  var o = x("stencil-preview"), s = x("draggable-area"), c = x("bounding-box");
2490
2580
  return z(), h("div", {
2491
2581
  class: a.classes.stencil,
@@ -2556,9 +2646,9 @@ kn.render = function(e, t, n, r, i, a) {
2556
2646
  "onResizeEnd"
2557
2647
  ])], 6);
2558
2648
  };
2559
- var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2649
+ var In = ["transitions"], Ln = nt("vue-advanced-cropper"), Rn = {
2560
2650
  name: "Cropper",
2561
- components: { BackgroundWrapper: wn },
2651
+ components: { BackgroundWrapper: An },
2562
2652
  props: {
2563
2653
  src: {
2564
2654
  type: String,
@@ -2567,13 +2657,13 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2567
2657
  stencilComponent: {
2568
2658
  type: [Object, String],
2569
2659
  default: function() {
2570
- return kn;
2660
+ return Fn;
2571
2661
  }
2572
2662
  },
2573
2663
  backgroundWrapperComponent: {
2574
2664
  type: [Object, String],
2575
2665
  default: function() {
2576
- return wn;
2666
+ return An;
2577
2667
  }
2578
2668
  },
2579
2669
  stencilProps: {
@@ -2622,7 +2712,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2622
2712
  type: String,
2623
2713
  default: "fit-area",
2624
2714
  validator: function(e) {
2625
- return St.indexOf(e) !== -1;
2715
+ return Ot.indexOf(e) !== -1;
2626
2716
  }
2627
2717
  },
2628
2718
  roundResult: {
@@ -2665,31 +2755,31 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2665
2755
  bottom: !0,
2666
2756
  top: !0
2667
2757
  };
2668
- a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), vt.forEach((function(e) {
2758
+ a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), wt.forEach((function(e) {
2669
2759
  l[e] || (c[e] = 0);
2670
2760
  }));
2671
- var u = Ot(o, c = rn({
2761
+ var u = Pt(o, c = un({
2672
2762
  coordinates: o,
2673
2763
  directions: c,
2674
2764
  sizeRestrictions: a,
2675
2765
  positionRestrictions: i
2676
- })).width, d = Ot(o, c).height, f = s.preserveRatio ? Z(o) : Mt(u / d, r);
2766
+ })).width, d = Pt(o, c).height, f = s.preserveRatio ? Z(o) : Rt(u / d, r);
2677
2767
  if (f) {
2678
2768
  var p = s.respectDirection;
2679
2769
  if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
2680
2770
  var m = u / f - o.height;
2681
2771
  if (l.top && l.bottom) {
2682
2772
  var h = c.top, g = c.bottom;
2683
- c.bottom = an(m, g, h), c.top = an(m, h, g);
2773
+ c.bottom = dn(m, g, h), c.top = dn(m, h, g);
2684
2774
  } else l.bottom ? c.bottom = m : l.top ? c.top = m : l.right ? c.right = 0 : l.left && (c.left = 0);
2685
2775
  } else if (p === "height") {
2686
2776
  var _ = o.width - d * f;
2687
2777
  if (l.left && l.right) {
2688
2778
  var v = c.left, y = c.right;
2689
- c.left = -an(_, v, y), c.right = -an(_, y, v);
2779
+ c.left = -dn(_, v, y), c.right = -dn(_, y, v);
2690
2780
  } else l.left ? c.left = -_ : l.right ? c.right = -_ : l.top ? c.top = 0 : l.bottom && (c.bottom = 0);
2691
2781
  }
2692
- c = rn({
2782
+ c = un({
2693
2783
  directions: c,
2694
2784
  coordinates: o,
2695
2785
  sizeRestrictions: a,
@@ -2698,10 +2788,10 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2698
2788
  compensate: s.compensate
2699
2789
  });
2700
2790
  }
2701
- return u = Ot(o, c).width, d = Ot(o, c).height, (f = s.preserveRatio ? Z(o) : Mt(u / d, r)) && Math.abs(f - u / d) > .001 && vt.forEach((function(e) {
2791
+ return u = Pt(o, c).width, d = Pt(o, c).height, (f = s.preserveRatio ? Z(o) : Rt(u / d, r)) && Math.abs(f - u / d) > .001 && wt.forEach((function(e) {
2702
2792
  l[e] || (c[e] = 0);
2703
- })), Wt({
2704
- event: new dt({
2793
+ })), Xt({
2794
+ event: new _t({
2705
2795
  left: -c.left,
2706
2796
  top: -c.top
2707
2797
  }),
@@ -2717,7 +2807,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2717
2807
  },
2718
2808
  moveAlgorithm: {
2719
2809
  type: Function,
2720
- default: Wt
2810
+ default: Xt
2721
2811
  },
2722
2812
  initStretcher: {
2723
2813
  type: Function,
@@ -2729,7 +2819,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2729
2819
  fitCoordinates: {
2730
2820
  type: Function,
2731
2821
  default: function(e) {
2732
- var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), Ut({
2822
+ var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), Yt({
2733
2823
  width: n.width,
2734
2824
  height: n.height,
2735
2825
  aspectRatio: r,
@@ -2740,7 +2830,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2740
2830
  minWidth: Math.min(t.width, i.minWidth)
2741
2831
  }
2742
2832
  }));
2743
- return o = Q(o = Y(o, Et(J(n), J(o))), Bt(Tt(t), a));
2833
+ return o = Q(o = Y(o, Mt(J(n), J(o))), Kt(jt(t), a));
2744
2834
  }
2745
2835
  },
2746
2836
  fitVisibleArea: {
@@ -2748,7 +2838,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2748
2838
  default: function(e) {
2749
2839
  var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = K({}, t);
2750
2840
  a.height = a.width / Z(n), a.top += (t.height - a.height) / 2, (i.height - a.height > 0 || i.width - a.width > 0) && (a = X(a, Math.max(i.height / a.height, i.width / a.width)));
2751
- var o = kt(jt(i, Tt(a = X(a, It(a, r({
2841
+ var o = Ft(Lt(i, jt(a = X(a, Ht(a, r({
2752
2842
  visibleArea: a,
2753
2843
  type: "resize"
2754
2844
  }))))));
@@ -2829,7 +2919,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2829
2919
  height: 0
2830
2920
  },
2831
2921
  visibleArea: null,
2832
- coordinates: U({}, Ct)
2922
+ coordinates: U({}, kt)
2833
2923
  };
2834
2924
  },
2835
2925
  computed: {
@@ -2867,7 +2957,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2867
2957
  return !!(this.visibleArea && this.imageLoaded);
2868
2958
  },
2869
2959
  settings: function() {
2870
- var e = it(this.resizeImage, {
2960
+ var e = ut(this.resizeImage, {
2871
2961
  touch: !0,
2872
2962
  wheel: { ratio: .1 },
2873
2963
  adjustStencil: !0
@@ -2877,7 +2967,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2877
2967
  adjustStencil: !1
2878
2968
  });
2879
2969
  return {
2880
- moveImage: it(this.moveImage, {
2970
+ moveImage: ut(this.moveImage, {
2881
2971
  touch: !0,
2882
2972
  mouse: !0
2883
2973
  }, {
@@ -2908,10 +2998,10 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2908
2998
  if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
2909
2999
  var e = this.sizeRestrictionsAlgorithm({
2910
3000
  imageSize: this.imageSize,
2911
- minWidth: q(this.minWidth) ? 0 : at(this.minWidth),
2912
- minHeight: q(this.minHeight) ? 0 : at(this.minHeight),
2913
- maxWidth: q(this.maxWidth) ? 1 / 0 : at(this.maxWidth),
2914
- maxHeight: q(this.maxHeight) ? 1 / 0 : at(this.maxHeight)
3001
+ minWidth: q(this.minWidth) ? 0 : dt(this.minWidth),
3002
+ minHeight: q(this.minHeight) ? 0 : dt(this.minHeight),
3003
+ maxWidth: q(this.maxWidth) ? 1 / 0 : dt(this.maxWidth),
3004
+ maxHeight: q(this.maxHeight) ? 1 / 0 : dt(this.maxHeight)
2915
3005
  });
2916
3006
  if (e = function(e) {
2917
3007
  var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = K(K({}, n), {
@@ -2921,7 +3011,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2921
3011
  maxHeight: n.maxHeight === void 0 ? 1 / 0 : n.maxHeight
2922
3012
  });
2923
3013
  i.left !== void 0 && i.right !== void 0 && (a.maxWidth = Math.min(a.maxWidth, i.right - i.left)), i.bottom !== void 0 && i.top !== void 0 && (a.maxHeight = Math.min(a.maxHeight, i.bottom - i.top));
2924
- var o = Lt(t), s = Nt(r, o);
3014
+ var o = Ut(t), s = zt(r, o);
2925
3015
  return o.width < 1 / 0 && (!a.maxWidth || a.maxWidth > s.width) && (a.maxWidth = Math.min(a.maxWidth, s.width)), o.height < 1 / 0 && (!a.maxHeight || a.maxHeight > s.height) && (a.maxHeight = Math.min(a.maxHeight, s.height)), a.minWidth > a.maxWidth && (a.minWidth = a.maxWidth, a.widthFrozen = !0), a.minHeight > a.maxHeight && (a.minHeight = a.maxHeight, a.heightFrozen = !0), a;
2926
3016
  }({
2927
3017
  sizeRestrictions: e,
@@ -2936,7 +3026,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2936
3026
  visibleArea: this.visibleArea,
2937
3027
  stencilSize: this.getStencilSize()
2938
3028
  }), this.visibleArea && this.stencilSize) {
2939
- var t = this.getStencilSize(), n = Lt(this.getAreaRestrictions({
3029
+ var t = this.getStencilSize(), n = Ut(this.getAreaRestrictions({
2940
3030
  visibleArea: this.visibleArea,
2941
3031
  type: "resize"
2942
3032
  }));
@@ -2959,15 +3049,15 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2959
3049
  },
2960
3050
  classes: function() {
2961
3051
  return {
2962
- cropper: jn(),
2963
- image: G(jn("image"), this.imageClass),
2964
- stencil: jn("stencil"),
2965
- boundaries: G(jn("boundaries"), this.boundariesClass),
2966
- stretcher: G(jn("stretcher")),
2967
- background: G(jn("background"), this.backgroundClass),
2968
- foreground: G(jn("foreground"), this.foregroundClass),
2969
- imageWrapper: G(jn("image-wrapper")),
2970
- cropperWrapper: G(jn("cropper-wrapper"))
3052
+ cropper: Ln(),
3053
+ image: G(Ln("image"), this.imageClass),
3054
+ stencil: Ln("stencil"),
3055
+ boundaries: G(Ln("boundaries"), this.boundariesClass),
3056
+ stretcher: G(Ln("stretcher")),
3057
+ background: G(Ln("background"), this.backgroundClass),
3058
+ foreground: G(Ln("foreground"), this.foregroundClass),
3059
+ imageWrapper: G(Ln("image-wrapper")),
3060
+ cropperWrapper: G(Ln("cropper-wrapper"))
2971
3061
  };
2972
3062
  },
2973
3063
  stencilCoordinates: function() {
@@ -3012,7 +3102,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3012
3102
  height: `${e.height}px`,
3013
3103
  left: "0px",
3014
3104
  top: "0px",
3015
- transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + bn(r)
3105
+ transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + En(r)
3016
3106
  };
3017
3107
  return this.transitionsOptions.enabled && (i.transition = `${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`), i;
3018
3108
  }
@@ -3053,7 +3143,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3053
3143
  }
3054
3144
  },
3055
3145
  created: function() {
3056
- this.debouncedUpdate = Qe(this.update, this.debounce), this.debouncedDisableTransitions = Qe(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
3146
+ this.debouncedUpdate = it(this.update, this.debounce), this.debouncedDisableTransitions = it(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
3057
3147
  },
3058
3148
  mounted: function() {
3059
3149
  this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
@@ -3089,7 +3179,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3089
3179
  },
3090
3180
  zoom: function(e, t) {
3091
3181
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3092
- this.onManipulateImage(new lt({}, {
3182
+ this.onManipulateImage(new ht({}, {
3093
3183
  factor: 1 / e,
3094
3184
  center: t
3095
3185
  }), {
@@ -3099,7 +3189,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3099
3189
  },
3100
3190
  move: function(e, t) {
3101
3191
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3102
- this.onManipulateImage(new lt({
3192
+ this.onManipulateImage(new ht({
3103
3193
  left: e || 0,
3104
3194
  top: t || 0
3105
3195
  }), {
@@ -3143,13 +3233,13 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3143
3233
  };
3144
3234
  return i.width > n.maxWidth ? i.width = Math.floor(t.width) : i.width < n.minWidth && (i.width = Math.ceil(t.width)), i.height > n.maxHeight ? i.height = Math.floor(t.height) : i.height < n.minHeight && (i.height = Math.ceil(t.height)), Q(i, r);
3145
3235
  }(U(U({}, this.getPublicProperties()), {}, {
3146
- positionRestrictions: $t(this.positionRestrictions, this.visibleArea),
3236
+ positionRestrictions: on(this.positionRestrictions, this.visibleArea),
3147
3237
  coordinates: e
3148
3238
  })) : e;
3149
3239
  },
3150
3240
  processAutoZoom: function(e, t, n, r) {
3151
3241
  var i = this.autoZoomAlgorithm;
3152
- i ||= this.stencilSize ? Kt : this.autoZoom ? qt : Jt;
3242
+ i ||= this.stencilSize ? Qt : this.autoZoom ? $t : en;
3153
3243
  var a = i({
3154
3244
  event: {
3155
3245
  type: e,
@@ -3164,10 +3254,10 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3164
3254
  sizeRestrictions: this.sizeRestrictions,
3165
3255
  stencilSize: this.getStencilSize()
3166
3256
  });
3167
- return U(U({}, a), {}, { changed: !wt(a.visibleArea, t) || !wt(a.coordinates, n) });
3257
+ return U(U({}, a), {}, { changed: !At(a.visibleArea, t) || !At(a.coordinates, n) });
3168
3258
  },
3169
3259
  runAutoZoom: function(e) {
3170
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = We(t, An), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
3260
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Xe(t, In), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
3171
3261
  r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
3172
3262
  },
3173
3263
  normalizeEvent: function(e) {
@@ -3188,13 +3278,13 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3188
3278
  });
3189
3279
  if (t.type === "resize") {
3190
3280
  var i = K(K({}, t), { directions: K({}, t.directions) });
3191
- return vt.forEach((function(e) {
3281
+ return wt.forEach((function(e) {
3192
3282
  i.directions[e] *= r;
3193
3283
  })), i;
3194
3284
  }
3195
3285
  if (t.type === "move") {
3196
3286
  var a = K(K({}, t), { directions: K({}, t.directions) });
3197
- return xt.forEach((function(e) {
3287
+ return Dt.forEach((function(e) {
3198
3288
  a.directions[e] *= r;
3199
3289
  })), a;
3200
3290
  }
@@ -3207,9 +3297,9 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3207
3297
  var r = n.rotate, i = n.flip, a = {
3208
3298
  width: t.naturalWidth,
3209
3299
  height: t.naturalHeight
3210
- }, o = Pt(a, r), s = e.getContext("2d");
3300
+ }, o = Bt(a, r), s = e.getContext("2d");
3211
3301
  e.height = o.height, e.width = o.width, s.save();
3212
- var c = Ft(J(K({
3302
+ var c = Vt(J(K({
3213
3303
  left: 0,
3214
3304
  top: 0
3215
3305
  }, a)), r);
@@ -3228,7 +3318,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3228
3318
  return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
3229
3319
  var t;
3230
3320
  }));
3231
- }, a = Ut({
3321
+ }, a = Yt({
3232
3322
  sizeRestrictions: {
3233
3323
  minWidth: i([r.width, r.minWidth]) || 0,
3234
3324
  minHeight: i([r.height, r.minHeight]) || 0,
@@ -3262,8 +3352,8 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3262
3352
  this.$emit("change", this.getResult());
3263
3353
  },
3264
3354
  applyTransform: function(e) {
3265
- var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Rt(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? $t(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
3266
- return Gt({
3355
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Wt(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? on(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
3356
+ return Zt({
3267
3357
  transform: e,
3268
3358
  coordinates: this.coordinates,
3269
3359
  imageSize: this.imageSize,
@@ -3278,23 +3368,23 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3278
3368
  if (this.$refs.image) {
3279
3369
  this.$refs.cropper, this.$refs.image;
3280
3370
  var t = this.defaultSize;
3281
- t ||= this.stencilSize ? Zt : Xt, this.sizeRestrictions;
3282
- var n = nt(t) ? t({
3371
+ t ||= this.stencilSize ? rn : nn, this.sizeRestrictions;
3372
+ var n = ct(t) ? t({
3283
3373
  boundaries: this.boundaries,
3284
3374
  imageSize: this.imageSize,
3285
3375
  aspectRatio: this.getAspectRatio(),
3286
3376
  sizeRestrictions: this.sizeRestrictions,
3287
3377
  stencilSize: this.getStencilSize(),
3288
3378
  visibleArea: this.visibleArea
3289
- }) : t, r = this.defaultPosition || Yt, i = [n, function(t) {
3379
+ }) : t, r = this.defaultPosition || tn, i = [n, function(t) {
3290
3380
  var n = t.coordinates;
3291
- return U({}, nt(r) ? r({
3381
+ return U({}, ct(r) ? r({
3292
3382
  coordinates: n,
3293
3383
  imageSize: e.imageSize,
3294
3384
  visibleArea: e.visibleArea
3295
3385
  }) : e.defaultPosition);
3296
3386
  }];
3297
- this.delayedTransforms && i.push.apply(i, Ge(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
3387
+ this.delayedTransforms && i.push.apply(i, Ze(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
3298
3388
  }
3299
3389
  },
3300
3390
  clearImage: function() {
@@ -3324,7 +3414,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3324
3414
  cropper: n,
3325
3415
  imageSize: e.imageSize
3326
3416
  };
3327
- if (e.boundaries = nt(e.defaultBoundaries) ? e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? function(e) {
3417
+ if (e.boundaries = ct(e.defaultBoundaries) ? e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? function(e) {
3328
3418
  var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
3329
3419
  return o > i && (o = i, a = n.height * i / n.width), {
3330
3420
  width: o,
@@ -3343,8 +3433,8 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3343
3433
  var e = this;
3344
3434
  return this.appliedImageTransforms = U(U({}, this.defaultImageTransforms), {}, { flip: U({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
3345
3435
  e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
3346
- var t, n, r, i, a, o, s = e.defaultVisibleArea || Qt;
3347
- e.visibleArea = nt(s) ? s({
3436
+ var t, n, r, i, a, o, s = e.defaultVisibleArea || an;
3437
+ e.visibleArea = ct(s) ? s({
3348
3438
  imageSize: e.imageSize,
3349
3439
  boundaries: e.boundaries,
3350
3440
  coordinates: e.priority === "visible-area" ? null : e.coordinates,
@@ -3395,7 +3485,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3395
3485
  var e, t = this;
3396
3486
  if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
3397
3487
  if (function(e) {
3398
- if (tt(e)) return !1;
3488
+ if (st(e)) return !1;
3399
3489
  var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
3400
3490
  protocol: n[1] || "",
3401
3491
  host: n[2] || "",
@@ -3410,8 +3500,8 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3410
3500
  }
3411
3501
  if (this.checkOrientation) {
3412
3502
  var r = (e = this.src, new Promise((function(t) {
3413
- yn(e).then((function(n) {
3414
- var r = xn(n);
3503
+ Tn(e).then((function(n) {
3504
+ var r = Dn(n);
3415
3505
  t(n ? {
3416
3506
  source: e,
3417
3507
  arrayBuffer: n,
@@ -3448,14 +3538,14 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3448
3538
  },
3449
3539
  onParseImage: function(e) {
3450
3540
  var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
3451
- this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? et(n) || !tt(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
3541
+ this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? ot(n) || !st(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
3452
3542
  for (var t = [], n = new Uint8Array(e); n.length > 0;) {
3453
3543
  var r = n.subarray(0, 8192);
3454
3544
  t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
3455
3545
  }
3456
3546
  return "data:image/jpeg;base64," + btoa(t.join(""));
3457
- }(r) : this.imageAttributes.src = n, this.appliedImageTransforms = nt(this.defaultTransforms) ? vn(this.defaultTransforms()) : rt(this.defaultTransforms) ? vn(this.defaultTransforms) : function(e) {
3458
- var t = vn({});
3547
+ }(r) : this.imageAttributes.src = n, this.appliedImageTransforms = ct(this.defaultTransforms) ? wn(this.defaultTransforms()) : lt(this.defaultTransforms) ? wn(this.defaultTransforms) : function(e) {
3548
+ var t = wn({});
3459
3549
  if (e) switch (e) {
3460
3550
  case 2:
3461
3551
  t.flip.horizontal = !0;
@@ -3495,7 +3585,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3495
3585
  var t = this;
3496
3586
  this.transitionsOptions.enabled || this.awaitRender((function() {
3497
3587
  t.coordinates = t.moveAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3498
- positionRestrictions: $t(t.positionRestrictions, t.visibleArea),
3588
+ positionRestrictions: on(t.positionRestrictions, t.visibleArea),
3499
3589
  coordinates: t.coordinates,
3500
3590
  event: t.normalizeEvent(e)
3501
3591
  })), t.onChange();
@@ -3506,7 +3596,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3506
3596
  this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
3507
3597
  var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
3508
3598
  t.coordinates = t.resizeAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3509
- positionRestrictions: $t(t.positionRestrictions, t.visibleArea),
3599
+ positionRestrictions: on(t.positionRestrictions, t.visibleArea),
3510
3600
  sizeRestrictions: {
3511
3601
  maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
3512
3602
  maxHeight: Math.min(n.maxHeight, t.visibleArea.height),
@@ -3522,7 +3612,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3522
3612
  if (!this.transitionsOptions.enabled) {
3523
3613
  var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
3524
3614
  r && this.enableTransitions();
3525
- var o = en(U(U({}, this.getPublicProperties()), {}, {
3615
+ var o = sn(U(U({}, this.getPublicProperties()), {}, {
3526
3616
  event: a ? this.normalizeEvent(e) : e,
3527
3617
  getAreaRestrictions: this.getAreaRestrictions,
3528
3618
  imageRestriction: this.imageRestriction,
@@ -3552,7 +3642,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3552
3642
  }
3553
3643
  if (q(t) && (t = q(i) ? a : i), q(n) && (n = q(i) ? o : i), !e && (q(t) || q(n))) {
3554
3644
  var c = this.getStencilSize(), l = c ? Z(c) : null;
3555
- q(t) && (t = ot(l) ? l : void 0), q(n) && (n = ot(l) ? l : void 0);
3645
+ q(t) && (t = ft(l) ? l : void 0), q(n) && (n = ft(l) ? l : void 0);
3556
3646
  }
3557
3647
  return {
3558
3648
  minimum: t,
@@ -3570,10 +3660,10 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3570
3660
  coefficient: this.coefficient,
3571
3661
  coordinates: this.coordinates,
3572
3662
  aspectRatio: this.getAspectRatio(!0)
3573
- }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, Mt(Z(i = nt(n) ? n({
3663
+ }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, Rt(Z(i = ct(n) ? n({
3574
3664
  boundaries: t,
3575
3665
  aspectRatio: r
3576
- }) : n), r) && (i = Ut({
3666
+ }) : n), r) && (i = Yt({
3577
3667
  sizeRestrictions: {
3578
3668
  maxWidth: t.width,
3579
3669
  maxHeight: t.height,
@@ -3586,7 +3676,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3586
3676
  minimum: r.minimum,
3587
3677
  maximum: r.maximum
3588
3678
  }
3589
- })), (i.width > t.width || i.height > t.height) && (i = Ut({
3679
+ })), (i.width > t.width || i.height > t.height) && (i = Yt({
3590
3680
  sizeRestrictions: {
3591
3681
  maxWidth: t.width,
3592
3682
  maxHeight: t.height,
@@ -3615,13 +3705,13 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3615
3705
  };
3616
3706
  },
3617
3707
  defaultCoordinates: function() {
3618
- return U({}, Ct);
3708
+ return U({}, kt);
3619
3709
  },
3620
3710
  flip: function(e, t) {
3621
3711
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3622
3712
  if (!this.transitionsActive) {
3623
3713
  r && this.enableTransitions();
3624
- var i = U({}, this.imageTransforms.flip), a = nn({
3714
+ var i = U({}, this.imageTransforms.flip), a = ln({
3625
3715
  flip: {
3626
3716
  horizontal: e ? !i.horizontal : i.horizontal,
3627
3717
  vertical: t ? !i.vertical : i.vertical
@@ -3645,7 +3735,7 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3645
3735
  n && this.enableTransitions();
3646
3736
  var r = U({}, this.imageSize);
3647
3737
  this.appliedImageTransforms.rotate += e;
3648
- var i = tn({
3738
+ var i = cn({
3649
3739
  visibleArea: this.visibleArea,
3650
3740
  coordinates: this.coordinates,
3651
3741
  previousImageSize: r,
@@ -3665,16 +3755,16 @@ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
3665
3755
  "error",
3666
3756
  "ready"
3667
3757
  ]
3668
- }, Nn = {
3758
+ }, zn = {
3669
3759
  key: 0,
3670
3760
  ref: "canvas",
3671
3761
  style: { display: "none" }
3672
- }, Pn = {
3762
+ }, Bn = {
3673
3763
  key: 1,
3674
3764
  ref: "sourceCanvas",
3675
3765
  style: { display: "none" }
3676
3766
  };
3677
- Mn.render = function(e, t, n, i, a, o) {
3767
+ Rn.render = function(e, t, n, i, a, o) {
3678
3768
  return z(), h("div", {
3679
3769
  ref: "cropper",
3680
3770
  class: o.classes.cropper
@@ -3732,8 +3822,8 @@ Mn.render = function(e, t, n, i, a, o) {
3732
3822
  "onMove",
3733
3823
  "onMoveEnd"
3734
3824
  ])), [[ye, a.imageLoaded]]),
3735
- n.canvas ? (z(), h("canvas", Nn, null, 512)) : M("", !0),
3736
- n.canvas ? (z(), h("canvas", Pn, null, 512)) : M("", !0)
3825
+ n.canvas ? (z(), h("canvas", zn, null, 512)) : M("", !0),
3826
+ n.canvas ? (z(), h("canvas", Bn, null, 512)) : M("", !0)
3737
3827
  ];
3738
3828
  })),
3739
3829
  _: 1
@@ -3749,57 +3839,57 @@ Mn.render = function(e, t, n, i, a, o) {
3749
3839
  };
3750
3840
  //#endregion
3751
3841
  //#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
3752
- var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln = {
3842
+ var Vn = ["data-tpl-theme"], Hn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Un = {
3753
3843
  class: "tpl:text-sm tpl:font-semibold",
3754
3844
  style: { color: "var(--tpl-text)" }
3755
- }, Rn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, zn = {
3845
+ }, Wn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Gn = {
3756
3846
  key: 0,
3757
3847
  class: "tpl:mb-4"
3758
- }, Bn = {
3848
+ }, Kn = {
3759
3849
  class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
3760
3850
  style: {
3761
3851
  "border-color": "var(--tpl-border)",
3762
3852
  height: "300px",
3763
3853
  "background-color": "var(--tpl-bg)"
3764
3854
  }
3765
- }, Vn = { class: "tpl:space-y-3" }, Hn = {
3855
+ }, qn = { class: "tpl:space-y-3" }, Jn = {
3766
3856
  class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
3767
3857
  style: { color: "var(--tpl-text-muted)" }
3768
- }, Un = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Wn = ["onClick"], Gn = { class: "tpl:flex tpl:gap-3" }, Kn = { class: "tpl:flex-1" }, qn = {
3858
+ }, Yn = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Xn = ["onClick"], Zn = { class: "tpl:flex tpl:gap-3" }, Qn = { class: "tpl:flex-1" }, $n = {
3769
3859
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3770
3860
  style: { color: "var(--tpl-text-muted)" }
3771
- }, Jn = {
3861
+ }, er = {
3772
3862
  class: "tpl:font-normal",
3773
3863
  style: { color: "var(--tpl-text-dim)" }
3774
- }, Yn = { class: "tpl:relative" }, Xn = ["value", "placeholder"], Zn = {
3864
+ }, tr = { class: "tpl:relative" }, nr = ["value", "placeholder"], rr = {
3775
3865
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
3776
3866
  style: { color: "var(--tpl-text-dim)" }
3777
- }, Qn = { class: "tpl:flex-1" }, $n = {
3867
+ }, ir = { class: "tpl:flex-1" }, ar = {
3778
3868
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3779
3869
  style: { color: "var(--tpl-text-muted)" }
3780
- }, er = {
3870
+ }, or = {
3781
3871
  class: "tpl:font-normal",
3782
3872
  style: { color: "var(--tpl-text-dim)" }
3783
- }, tr = { class: "tpl:relative" }, nr = ["value", "placeholder"], rr = {
3873
+ }, sr = { class: "tpl:relative" }, cr = ["value", "placeholder"], lr = {
3784
3874
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
3785
3875
  style: { color: "var(--tpl-text-dim)" }
3786
- }, ir = {
3876
+ }, ur = {
3787
3877
  key: 0,
3788
3878
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
3789
3879
  style: { color: "var(--tpl-text-muted)" }
3790
- }, ar = {
3880
+ }, dr = {
3791
3881
  class: "tpl:font-medium",
3792
3882
  style: { color: "var(--tpl-text)" }
3793
- }, or = { class: "tpl:mb-3" }, sr = {
3883
+ }, fr = { class: "tpl:mb-3" }, pr = {
3794
3884
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3795
3885
  style: { color: "var(--tpl-text-muted)" }
3796
- }, cr = ["autofocus"], lr = {
3886
+ }, mr = ["autofocus"], hr = {
3797
3887
  key: 1,
3798
3888
  class: "tpl:mb-4"
3799
- }, ur = {
3889
+ }, gr = {
3800
3890
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3801
3891
  style: { color: "var(--tpl-text-muted)" }
3802
- }, dr = ["placeholder"], fr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, pr = ["disabled"], mr = /*@__PURE__*/ m({
3892
+ }, _r = ["placeholder"], vr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, yr = ["disabled"], br = /*@__PURE__*/ m({
3803
3893
  __name: "MediaEditModal",
3804
3894
  props: {
3805
3895
  visible: { type: Boolean },
@@ -3807,12 +3897,12 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3807
3897
  },
3808
3898
  emits: ["save", "close"],
3809
3899
  setup(n, { emit: o }) {
3810
- let c = n, d = o, { t: f } = Ae(), m = l("tplUiTheme"), g = l(Ie, e(null)), _ = f.mediaLibrary, { isImageMimeType: v } = Le(), y = e(""), x = e(""), C = e(null), w = e("free"), ee = e(void 0), T = e(void 0), E = e(""), D = e(""), ne = e(void 0), re = e(null), ie = e(!1), k = e(!1), ae = e(!1), oe = a(() => c.item ? [
3900
+ let c = n, d = o, { t: f } = Re(), m = l(Fe, null), g = l(Ne, e(null)), _ = f.mediaLibrary, { isImageMimeType: v } = Ue(), y = e(""), x = e(""), C = e(null), w = e("free"), ee = e(void 0), T = e(void 0), E = e(""), D = e(""), ne = e(void 0), re = e(null), ie = e(!1), k = e(!1), ae = e(!1), oe = a(() => c.item ? [
3811
3901
  "image/jpeg",
3812
3902
  "image/png",
3813
3903
  "image/webp",
3814
3904
  "image/gif"
3815
- ].includes(c.item.mime_type) : !1), se = a(() => w.value === "original" ? ne.value : Re[w.value]), ce = a(() => re.value ? He(re.value.width, re.value.height, ee.value, T.value) : null);
3905
+ ].includes(c.item.mime_type) : !1), se = a(() => w.value === "original" ? ne.value : We[w.value]), ce = a(() => re.value ? Je(re.value.width, re.value.height, ee.value, T.value) : null);
3816
3906
  s(() => c.visible, (e) => {
3817
3907
  e && c.item && (y.value = c.item.filename, x.value = c.item.alt_text || "", w.value = "free", ee.value = void 0, T.value = void 0, E.value = "", D.value = "", ne.value = void 0, re.value = null, ie.value = !1, ae.value = !1, c.item.width && c.item.height && (ne.value = c.item.width / c.item.height));
3818
3908
  });
@@ -3842,8 +3932,8 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3842
3932
  try {
3843
3933
  let { canvas: e } = C.value.getResult();
3844
3934
  if (e) {
3845
- let t = Be(e, ee.value, T.value), r = ze(c.item.mime_type);
3846
- n = { file: await Ve(t, c.item.filename, r) };
3935
+ let t = Ke(e, ee.value, T.value), r = Ge(c.item.mime_type);
3936
+ n = { file: await qe(t, c.item.filename, r) };
3847
3937
  }
3848
3938
  } catch {
3849
3939
  k.value = !1;
@@ -3875,9 +3965,9 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3875
3965
  class: O(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", oe.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
3876
3966
  style: { "background-color": "var(--tpl-bg-elevated)" }
3877
3967
  }, [
3878
- i("div", In, [i("h3", Ln, I(A(f).mediaLibrary.editFile), 1)]),
3879
- i("div", Rn, [
3880
- oe.value ? (z(), t("div", zn, [i("div", Bn, [p(A(Mn), {
3968
+ i("div", Hn, [i("h3", Un, I(A(f).mediaLibrary.editFile), 1)]),
3969
+ i("div", Wn, [
3970
+ oe.value ? (z(), t("div", Gn, [i("div", Kn, [p(A(Rn), {
3881
3971
  ref_key: "cropperRef",
3882
3972
  ref: C,
3883
3973
  src: n.item.url,
@@ -3886,8 +3976,8 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3886
3976
  "background-class": "tpl-cropper-background",
3887
3977
  onChange: le,
3888
3978
  onReady: ue
3889
- }, null, 8, ["src", "stencil-props"])]), i("div", Vn, [
3890
- i("div", null, [i("label", Hn, I(A(f).mediaLibrary.cropAspectRatio), 1), i("div", Un, [(z(), t(R, null, S([
3979
+ }, null, 8, ["src", "stencil-props"])]), i("div", qn, [
3980
+ i("div", null, [i("label", Jn, I(A(f).mediaLibrary.cropAspectRatio), 1), i("div", Yn, [(z(), t(R, null, S([
3891
3981
  "free",
3892
3982
  "square",
3893
3983
  "landscape43",
@@ -3903,8 +3993,8 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3903
3993
  color: w.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
3904
3994
  }),
3905
3995
  onClick: (t) => w.value = e
3906
- }, I(A(_)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Wn)), 64))])]),
3907
- i("div", Gn, [i("div", Kn, [i("label", qn, [j(I(A(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", Jn, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", Yn, [i("input", {
3996
+ }, I(A(_)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Xn)), 64))])]),
3997
+ i("div", Zn, [i("div", Qn, [i("label", $n, [j(I(A(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", er, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", tr, [i("input", {
3908
3998
  value: E.value,
3909
3999
  type: "number",
3910
4000
  min: "1",
@@ -3916,7 +4006,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3916
4006
  },
3917
4007
  placeholder: re.value?.width?.toString() || "",
3918
4008
  onInput: de
3919
- }, null, 40, Xn), i("span", Zn, I(A(f).mediaLibrary.cropPixels), 1)])]), i("div", Qn, [i("label", $n, [j(I(A(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", er, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", tr, [i("input", {
4009
+ }, null, 40, nr), i("span", rr, I(A(f).mediaLibrary.cropPixels), 1)])]), i("div", ir, [i("label", ar, [j(I(A(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", or, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", sr, [i("input", {
3920
4010
  value: D.value,
3921
4011
  type: "number",
3922
4012
  min: "1",
@@ -3928,10 +4018,10 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3928
4018
  },
3929
4019
  placeholder: re.value?.height?.toString() || "",
3930
4020
  onInput: fe
3931
- }, null, 40, nr), i("span", rr, I(A(f).mediaLibrary.cropPixels), 1)])])]),
3932
- ce.value ? (z(), t("div", ir, [i("span", null, I(A(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", ar, I(ce.value.width) + " x " + I(ce.value.height) + " " + I(A(f).mediaLibrary.cropPixels), 1)])) : M("", !0)
4021
+ }, null, 40, cr), i("span", lr, I(A(f).mediaLibrary.cropPixels), 1)])])]),
4022
+ ce.value ? (z(), t("div", ur, [i("span", null, I(A(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", dr, I(ce.value.width) + " x " + I(ce.value.height) + " " + I(A(f).mediaLibrary.cropPixels), 1)])) : M("", !0)
3933
4023
  ])])) : M("", !0),
3934
- i("div", or, [i("label", sr, I(A(f).mediaLibrary.fileName), 1), u(i("input", {
4024
+ i("div", fr, [i("label", pr, I(A(f).mediaLibrary.fileName), 1), u(i("input", {
3935
4025
  "onUpdate:modelValue": a[0] ||= (e) => y.value = e,
3936
4026
  type: "text",
3937
4027
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -3941,8 +4031,8 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3941
4031
  color: "var(--tpl-text)"
3942
4032
  },
3943
4033
  autofocus: !oe.value
3944
- }, null, 8, cr), [[te, y.value]])]),
3945
- A(v)(n.item.mime_type) ? (z(), t("div", lr, [i("label", ur, I(A(f).mediaLibrary.altText), 1), u(i("input", {
4034
+ }, null, 8, mr), [[te, y.value]])]),
4035
+ A(v)(n.item.mime_type) ? (z(), t("div", hr, [i("label", gr, I(A(f).mediaLibrary.altText), 1), u(i("input", {
3946
4036
  "onUpdate:modelValue": a[1] ||= (e) => x.value = e,
3947
4037
  type: "text",
3948
4038
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -3952,9 +4042,9 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3952
4042
  color: "var(--tpl-text)"
3953
4043
  },
3954
4044
  placeholder: A(f).mediaLibrary.altTextPlaceholder
3955
- }, null, 8, dr), [[te, x.value]])])) : M("", !0)
4045
+ }, null, 8, _r), [[te, x.value]])])) : M("", !0)
3956
4046
  ]),
3957
- i("div", fr, [i("button", {
4047
+ i("div", vr, [i("button", {
3958
4048
  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",
3959
4049
  style: {
3960
4050
  "border-color": "var(--tpl-border)",
@@ -3967,25 +4057,25 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3967
4057
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
3968
4058
  disabled: k.value,
3969
4059
  onClick: pe
3970
- }, I(k.value ? A(f).mediaLibrary.saving : A(f).mediaLibrary.saveChanges), 9, pr)])
3971
- ], 2)], 40, Fn)) : M("", !0)]),
4060
+ }, I(k.value ? A(f).mediaLibrary.saving : A(f).mediaLibrary.saveChanges), 9, yr)])
4061
+ ], 2)], 40, Vn)) : M("", !0)]),
3972
4062
  _: 1
3973
4063
  })], 8, ["to"]));
3974
4064
  }
3975
- }), hr = (e, t) => {
4065
+ }), xr = (e, t) => {
3976
4066
  let n = e.__vccOpts || e;
3977
4067
  for (let [e, r] of t) n[e] = r;
3978
4068
  return n;
3979
- }, gr = /*#__PURE__*/ hr(mr, [["__scopeId", "data-v-6b677237"]]), _r = {
4069
+ }, Sr = /*#__PURE__*/ xr(br, [["__scopeId", "data-v-a5653cc1"]]), Cr = {
3980
4070
  key: 1,
3981
4071
  class: "tpl:size-4 tpl:shrink-0"
3982
- }, vr = {
4072
+ }, wr = {
3983
4073
  key: 0,
3984
4074
  class: "tpl:truncate"
3985
- }, yr = {
4075
+ }, Tr = {
3986
4076
  key: 3,
3987
4077
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
3988
- }, br = ["title"], xr = ["title"], Sr = { key: 0 }, Cr = ["placeholder"], wr = /* @__PURE__ */ m({
4078
+ }, Er = ["title"], Dr = ["title"], Or = { key: 0 }, kr = ["placeholder"], Ar = /* @__PURE__ */ m({
3989
4079
  __name: "MediaFolderTreeNode",
3990
4080
  props: {
3991
4081
  folder: {},
@@ -3999,7 +4089,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
3999
4089
  "deleteFolder"
4000
4090
  ],
4001
4091
  setup(n, { emit: o }) {
4002
- let s = n, c = o, { t: l } = Ae(), d = e(!1), f = e(!1), m = e(""), g = e(!1), _ = e(""), v = a(() => (s.folder.children?.length ?? 0) > 0), b = a(() => s.depth < 4), C = a(() => s.currentFolderId === s.folder.id), w = a(() => !s.currentFolderId || !s.folder.children ? !1 : T(s.folder.children, s.currentFolderId)), ee = a(() => d.value || w.value);
4092
+ let s = n, c = o, { t: l } = Re(), d = e(!1), f = e(!1), m = e(""), g = e(!1), _ = e(""), v = a(() => (s.folder.children?.length ?? 0) > 0), b = a(() => s.depth < 4), C = a(() => s.currentFolderId === s.folder.id), w = a(() => !s.currentFolderId || !s.folder.children ? !1 : T(s.folder.children, s.currentFolderId)), ee = a(() => d.value || w.value);
4003
4093
  function T(e, t) {
4004
4094
  for (let n of e) if (n.id === t || n.children && T(n.children, t)) return !0;
4005
4095
  return !1;
@@ -4044,7 +4134,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4044
4134
  class: O(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": ee.value }]),
4045
4135
  size: 10,
4046
4136
  "stroke-width": 2
4047
- }, null, 8, ["class"])])) : (z(), t("span", _r)),
4137
+ }, null, 8, ["class"])])) : (z(), t("span", Cr)),
4048
4138
  i("button", {
4049
4139
  class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
4050
4140
  onClick: a[0] ||= (e) => c("navigate", n.folder.id)
@@ -4052,7 +4142,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4052
4142
  class: "tpl:shrink-0",
4053
4143
  size: 14,
4054
4144
  "stroke-width": 1.5
4055
- }), f.value ? M("", !0) : (z(), t("span", vr, I(n.folder.name), 1))]),
4145
+ }), f.value ? M("", !0) : (z(), t("span", wr, I(n.folder.name), 1))]),
4056
4146
  f.value ? u((z(), t("input", {
4057
4147
  key: 2,
4058
4148
  "onUpdate:modelValue": a[1] ||= (e) => m.value = e,
@@ -4068,7 +4158,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4068
4158
  onBlur: ne,
4069
4159
  onClick: a[2] ||= r(() => {}, ["stop"])
4070
4160
  }, null, 544)), [[te, m.value]]) : M("", !0),
4071
- f.value ? M("", !0) : (z(), t("span", yr, [
4161
+ f.value ? M("", !0) : (z(), t("span", Tr, [
4072
4162
  b.value ? (z(), t("button", {
4073
4163
  key: 0,
4074
4164
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
@@ -4077,7 +4167,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4077
4167
  }, [p(A(fe), {
4078
4168
  size: 12,
4079
4169
  "stroke-width": 2
4080
- })], 8, br)) : M("", !0),
4170
+ })], 8, Er)) : M("", !0),
4081
4171
  i("button", {
4082
4172
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4083
4173
  title: A(l).mediaLibrary.renameFolder,
@@ -4085,7 +4175,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4085
4175
  }, [p(A(he), {
4086
4176
  size: 12,
4087
4177
  "stroke-width": 2
4088
- })], 8, xr),
4178
+ })], 8, Dr),
4089
4179
  i("button", {
4090
4180
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4091
4181
  onClick: a[3] ||= r((e) => c("deleteFolder", n.folder.id), ["stop"])
@@ -4095,7 +4185,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4095
4185
  style: { color: "var(--tpl-danger)" }
4096
4186
  })])
4097
4187
  ]))
4098
- ], 4), ee.value ? (z(), t("div", Sr, [(z(!0), t(R, null, S(n.folder.children, (e) => (z(), h(o, {
4188
+ ], 4), ee.value ? (z(), t("div", Or, [(z(!0), t(R, null, S(n.folder.children, (e) => (z(), h(o, {
4099
4189
  key: e.id,
4100
4190
  folder: e,
4101
4191
  "current-folder-id": n.currentFolderId,
@@ -4125,13 +4215,13 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4125
4215
  autofocus: "",
4126
4216
  onKeydown: [y(k, ["enter"]), y(oe, ["escape"])],
4127
4217
  onBlur: k
4128
- }, null, 40, Cr), [[te, _.value]])], 4)) : M("", !0)])) : M("", !0)]);
4218
+ }, null, 40, kr), [[te, _.value]])], 4)) : M("", !0)])) : M("", !0)]);
4129
4219
  };
4130
4220
  }
4131
- }), Tr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Er = {
4221
+ }), jr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Mr = {
4132
4222
  key: 0,
4133
4223
  class: "tpl:px-3 tpl:py-2"
4134
- }, Dr = ["placeholder"], Or = /* @__PURE__ */ m({
4224
+ }, Nr = ["placeholder"], Pr = /* @__PURE__ */ m({
4135
4225
  __name: "MediaFolderTree",
4136
4226
  props: {
4137
4227
  folders: {},
@@ -4147,7 +4237,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4147
4237
  "showFrequentlyUsed"
4148
4238
  ],
4149
4239
  setup(n, { emit: r }) {
4150
- let a = r, { t: o } = Ae(), s = e(!1), c = e("");
4240
+ let a = r, { t: o } = Re(), s = e(!1), c = e("");
4151
4241
  function l() {
4152
4242
  s.value = !0, c.value = "";
4153
4243
  }
@@ -4157,7 +4247,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4157
4247
  function f() {
4158
4248
  s.value = !1, c.value = "";
4159
4249
  }
4160
- return (e, r) => (z(), t("div", Tr, [
4250
+ return (e, r) => (z(), t("div", jr, [
4161
4251
  i("button", {
4162
4252
  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",
4163
4253
  style: N({
@@ -4169,7 +4259,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4169
4259
  size: 14,
4170
4260
  "stroke-width": 1.5
4171
4261
  }), j(" " + I(A(o).mediaLibrary.allFiles), 1)], 4),
4172
- (z(!0), t(R, null, S(n.folders, (e) => (z(), h(wr, {
4262
+ (z(!0), t(R, null, S(n.folders, (e) => (z(), h(Ar, {
4173
4263
  key: e.id,
4174
4264
  folder: e,
4175
4265
  "current-folder-id": n.currentFolderId,
@@ -4179,7 +4269,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4179
4269
  onRenameFolder: r[3] ||= (e, t) => a("renameFolder", e, t),
4180
4270
  onDeleteFolder: r[4] ||= (e) => a("deleteFolder", e)
4181
4271
  }, null, 8, ["folder", "current-folder-id"]))), 128)),
4182
- s.value ? (z(), t("div", Er, [u(i("input", {
4272
+ s.value ? (z(), t("div", Mr, [u(i("input", {
4183
4273
  "onUpdate:modelValue": r[5] ||= (e) => c.value = e,
4184
4274
  type: "text",
4185
4275
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -4192,7 +4282,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4192
4282
  autofocus: "",
4193
4283
  onKeydown: [y(d, ["enter"]), y(f, ["escape"])],
4194
4284
  onBlur: d
4195
- }, null, 40, Dr), [[te, c.value]])])) : M("", !0),
4285
+ }, null, 40, Nr), [[te, c.value]])])) : M("", !0),
4196
4286
  s.value ? M("", !0) : (z(), t("button", {
4197
4287
  key: 1,
4198
4288
  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",
@@ -4218,7 +4308,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4218
4308
  }), j(" " + I(A(o).mediaLibrary.frequentlyUsed), 1)], 4)) : M("", !0)
4219
4309
  ]));
4220
4310
  }
4221
- }), kr = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, Ar = /* @__PURE__ */ m({
4311
+ }), Fr = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, Ir = /* @__PURE__ */ m({
4222
4312
  __name: "MediaFileIcon",
4223
4313
  props: { mimeType: {} },
4224
4314
  setup(e) {
@@ -4319,7 +4409,7 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4319
4409
  bgColor: "#f9fafb",
4320
4410
  icon: "document"
4321
4411
  }, s = a(() => r[n.mimeType] ?? o);
4322
- return (e, n) => (z(), t("div", kr, [s.value.icon === "document" ? (z(), t("svg", {
4412
+ return (e, n) => (z(), t("div", Fr, [s.value.icon === "document" ? (z(), t("svg", {
4323
4413
  key: 0,
4324
4414
  width: "60",
4325
4415
  height: "60",
@@ -4391,10 +4481,10 @@ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln
4391
4481
  });
4392
4482
  //#endregion
4393
4483
  //#region ../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
4394
- function jr(e, t) {
4484
+ function Lr(e, t) {
4395
4485
  return ee() ? (T(e, t), !0) : !1;
4396
4486
  }
4397
- function Mr() {
4487
+ function Rr() {
4398
4488
  let e = /* @__PURE__ */ new Set(), t = (t) => {
4399
4489
  e.delete(t);
4400
4490
  };
@@ -4402,7 +4492,7 @@ function Mr() {
4402
4492
  on: (n) => {
4403
4493
  e.add(n);
4404
4494
  let r = () => t(n);
4405
- return jr(r), { off: r };
4495
+ return Lr(r), { off: r };
4406
4496
  },
4407
4497
  off: t,
4408
4498
  trigger: (...t) => Promise.all(Array.from(e).map((e) => e(...t))),
@@ -4411,14 +4501,14 @@ function Mr() {
4411
4501
  }
4412
4502
  };
4413
4503
  }
4414
- var Nr = typeof window < "u" && typeof document < "u";
4504
+ var zr = typeof window < "u" && typeof document < "u";
4415
4505
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4416
- var Pr = (e) => e != null, Fr = Object.prototype.toString, Ir = (e) => Fr.call(e) === "[object Object]", $ = () => {}, Lr = (e, t) => Object.hasOwn(e, t), Rr = /* #__PURE__ */ zr();
4417
- function zr() {
4506
+ var Br = (e) => e != null, Vr = Object.prototype.toString, Hr = (e) => Vr.call(e) === "[object Object]", $ = () => {}, Ur = (e, t) => Object.hasOwn(e, t), Wr = /* #__PURE__ */ Gr();
4507
+ function Gr() {
4418
4508
  var e, t;
4419
- return Nr && !!((e = window) != null && (e = e.navigator) != null && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
4509
+ return zr && !!((e = window) != null && (e = e.navigator) != null && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
4420
4510
  }
4421
- function Br(e, t) {
4511
+ function Kr(e, t) {
4422
4512
  function n(...n) {
4423
4513
  return new Promise((r, i) => {
4424
4514
  Promise.resolve(e(() => t.apply(this, n), {
@@ -4434,7 +4524,7 @@ function Br(e, t) {
4434
4524
  isPending: e.isPending
4435
4525
  }), n;
4436
4526
  }
4437
- function Vr(e, t = {}) {
4527
+ function qr(e, t = {}) {
4438
4528
  let n, r, i = $, a = $, o = L(!1), s = (e) => {
4439
4529
  clearTimeout(e), i(), i = $;
4440
4530
  }, c;
@@ -4461,7 +4551,7 @@ function Vr(e, t = {}) {
4461
4551
  isPending: ie(o)
4462
4552
  });
4463
4553
  }
4464
- function Hr(e) {
4554
+ function Jr(e) {
4465
4555
  let t;
4466
4556
  function n() {
4467
4557
  return t ||= e(), t;
@@ -4471,13 +4561,13 @@ function Hr(e) {
4471
4561
  t = void 0, e && await e;
4472
4562
  }, n;
4473
4563
  }
4474
- function Ur(e) {
4564
+ function Yr(e) {
4475
4565
  return Array.isArray(e) ? e : [e];
4476
4566
  }
4477
- function Wr(e, t = 200, n = {}) {
4478
- return Br(Vr(t, n), e);
4567
+ function Xr(e, t = 200, n = {}) {
4568
+ return Kr(qr(t, n), e);
4479
4569
  }
4480
- function Gr(e, t, n = {}) {
4570
+ function Zr(e, t, n = {}) {
4481
4571
  let { immediate: r = !0, immediateCallback: i = !1 } = n, a = L(!1), o;
4482
4572
  function s() {
4483
4573
  o &&= (clearTimeout(o), void 0);
@@ -4490,13 +4580,13 @@ function Gr(e, t, n = {}) {
4490
4580
  a.value = !1, o = void 0, e(...n);
4491
4581
  }, F(t));
4492
4582
  }
4493
- return r && (a.value = !0, Nr && l()), jr(c), {
4583
+ return r && (a.value = !0, zr && l()), Lr(c), {
4494
4584
  isPending: ie(a),
4495
4585
  start: l,
4496
4586
  stop: c
4497
4587
  };
4498
4588
  }
4499
- function Kr(e, t, n) {
4589
+ function Qr(e, t, n) {
4500
4590
  return s(e, t, {
4501
4591
  ...n,
4502
4592
  immediate: !0
@@ -4504,46 +4594,46 @@ function Kr(e, t, n) {
4504
4594
  }
4505
4595
  //#endregion
4506
4596
  //#region ../../node_modules/.pnpm/@vueuse+core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
4507
- var qr = Nr ? window : void 0, Jr = Nr ? window.document : void 0, Yr = Nr ? window.navigator : void 0;
4508
- function Xr(e) {
4597
+ var $r = zr ? window : void 0, ei = zr ? window.document : void 0, ti = zr ? window.navigator : void 0;
4598
+ function ni(e) {
4509
4599
  let t = F(e);
4510
4600
  return t?.$el ?? t;
4511
4601
  }
4512
- function Zr(...e) {
4602
+ function ri(...e) {
4513
4603
  let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = a(() => {
4514
- let t = Ur(F(e[0])).filter((e) => e != null);
4604
+ let t = Yr(F(e[0])).filter((e) => e != null);
4515
4605
  return t.every((e) => typeof e != "string") ? t : void 0;
4516
4606
  });
4517
- return Kr(() => [
4518
- n.value?.map((e) => Xr(e)) ?? [qr].filter((e) => e != null),
4519
- Ur(F(n.value ? e[1] : e[0])),
4520
- Ur(A(n.value ? e[2] : e[1])),
4607
+ return Qr(() => [
4608
+ n.value?.map((e) => ni(e)) ?? [$r].filter((e) => e != null),
4609
+ Yr(F(n.value ? e[1] : e[0])),
4610
+ Yr(A(n.value ? e[2] : e[1])),
4521
4611
  F(n.value ? e[3] : e[2])
4522
4612
  ], ([e, n, r, i], a, o) => {
4523
4613
  if (!e?.length || !n?.length || !r?.length) return;
4524
- let s = Ir(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
4614
+ let s = Hr(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
4525
4615
  o(() => {
4526
4616
  c.forEach((e) => e());
4527
4617
  });
4528
4618
  }, { flush: "post" });
4529
4619
  }
4530
- var Qr = !1;
4531
- function $r(e, t, n = {}) {
4532
- let { window: r = qr, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
4620
+ var ii = !1;
4621
+ function ai(e, t, n = {}) {
4622
+ let { window: r = $r, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
4533
4623
  if (!r) return s ? {
4534
4624
  stop: $,
4535
4625
  cancel: $,
4536
4626
  trigger: $
4537
4627
  } : $;
4538
- if (Rr && !Qr) {
4539
- Qr = !0;
4628
+ if (Wr && !ii) {
4629
+ ii = !0;
4540
4630
  let e = { passive: !0 };
4541
4631
  Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", $, e)), r.document.documentElement.addEventListener("click", $, e);
4542
4632
  }
4543
4633
  let c = !0, l = (e) => F(i).some((t) => {
4544
4634
  if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
4545
4635
  {
4546
- let n = Xr(t);
4636
+ let n = ni(t);
4547
4637
  return n && (e.target === n || e.composedPath().includes(n));
4548
4638
  }
4549
4639
  });
@@ -4556,7 +4646,7 @@ function $r(e, t, n = {}) {
4556
4646
  return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
4557
4647
  }
4558
4648
  let f = (n) => {
4559
- let r = Xr(e);
4649
+ let r = ni(e);
4560
4650
  if (n.target != null && !(!(r instanceof Element) && u(e) && d(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
4561
4651
  if ("detail" in n && n.detail === 0 && (c = !l(n)), !c) {
4562
4652
  c = !0;
@@ -4565,7 +4655,7 @@ function $r(e, t, n = {}) {
4565
4655
  t(n);
4566
4656
  }
4567
4657
  }, p = !1, m = [
4568
- Zr(r, "click", (e) => {
4658
+ ri(r, "click", (e) => {
4569
4659
  p || (p = !0, setTimeout(() => {
4570
4660
  p = !1;
4571
4661
  }, 0), f(e));
@@ -4573,13 +4663,13 @@ function $r(e, t, n = {}) {
4573
4663
  passive: !0,
4574
4664
  capture: a
4575
4665
  }),
4576
- Zr(r, "pointerdown", (t) => {
4577
- let n = Xr(e);
4666
+ ri(r, "pointerdown", (t) => {
4667
+ let n = ni(e);
4578
4668
  c = !l(t) && !!(n && !t.composedPath().includes(n));
4579
4669
  }, { passive: !0 }),
4580
- o && Zr(r, "blur", (n) => {
4670
+ o && ri(r, "blur", (n) => {
4581
4671
  setTimeout(() => {
4582
- let i = Xr(e), a = r.document.activeElement;
4672
+ let i = ni(e), a = r.document.activeElement;
4583
4673
  for (; a?.shadowRoot;) a = a.shadowRoot.activeElement;
4584
4674
  a?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
4585
4675
  }, 0);
@@ -4595,22 +4685,22 @@ function $r(e, t, n = {}) {
4595
4685
  }
4596
4686
  } : h;
4597
4687
  }
4598
- function ei() {
4688
+ function oi() {
4599
4689
  let e = L(!1), t = g();
4600
4690
  return t && v(() => {
4601
4691
  e.value = !0;
4602
4692
  }, t), e;
4603
4693
  }
4604
4694
  /* @__NO_SIDE_EFFECTS__ */
4605
- function ti(e) {
4606
- return ei(), a(() => !!e());
4695
+ function si(e) {
4696
+ return oi(), a(() => !!e());
4607
4697
  }
4608
- function ni(e, t = {}) {
4609
- let { controls: n = !1, navigator: r = Yr } = t, i = /* @__PURE__ */ ti(() => r && "permissions" in r), a = L(), o = typeof e == "string" ? { name: e } : e, s = L(), c = () => {
4698
+ function ci(e, t = {}) {
4699
+ let { controls: n = !1, navigator: r = ti } = t, i = /* @__PURE__ */ si(() => r && "permissions" in r), a = L(), o = typeof e == "string" ? { name: e } : e, s = L(), c = () => {
4610
4700
  s.value = a.value?.state ?? "prompt";
4611
4701
  };
4612
- Zr(a, "change", c, { passive: !0 });
4613
- let l = Hr(async () => {
4702
+ ri(a, "change", c, { passive: !0 });
4703
+ let l = Jr(async () => {
4614
4704
  if (i.value) {
4615
4705
  if (!a.value) try {
4616
4706
  a.value = await r.permissions.query(o);
@@ -4628,8 +4718,8 @@ function ni(e, t = {}) {
4628
4718
  query: l
4629
4719
  } : s;
4630
4720
  }
4631
- function ri(e = {}) {
4632
- let { navigator: t = Yr, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ ti(() => t && "clipboard" in t), c = ni("clipboard-read"), l = ni("clipboard-write"), u = a(() => s.value || o), d = L(""), f = L(!1), p = L(!1), m = Gr(() => f.value = !1, i, { immediate: !1 }), h = 0;
4721
+ function li(e = {}) {
4722
+ let { navigator: t = ti, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ si(() => t && "clipboard" in t), c = ci("clipboard-read"), l = ci("clipboard-write"), u = a(() => s.value || o), d = L(""), f = L(!1), p = L(!1), m = Zr(() => f.value = !1, i, { immediate: !1 }), h = 0;
4633
4723
  async function g() {
4634
4724
  let e = !(s.value && x(c.value));
4635
4725
  if (!e) try {
@@ -4639,7 +4729,7 @@ function ri(e = {}) {
4639
4729
  }
4640
4730
  e && (d.value = b());
4641
4731
  }
4642
- u.value && n && Zr(["copy", "cut"], g, { passive: !0 });
4732
+ u.value && n && ri(["copy", "cut"], g, { passive: !0 });
4643
4733
  async function _(e) {
4644
4734
  let n = e ?? F(r);
4645
4735
  if (u.value && n != null) {
@@ -4683,9 +4773,9 @@ function ri(e = {}) {
4683
4773
  copy: _
4684
4774
  };
4685
4775
  }
4686
- function ii(e, t = {}) {
4776
+ function ui(e, t = {}) {
4687
4777
  let n = L(!1), r = L(null), i = 0, a = !0;
4688
- if (Nr) {
4778
+ if (zr) {
4689
4779
  let o = typeof t == "function" ? { onDrop: t } : t, s = o.multiple ?? !0, c = o.preventDefaultForUnhandled ?? !1, l = (e) => {
4690
4780
  let t = Array.from(e.dataTransfer?.files ?? []);
4691
4781
  return t.length === 0 ? null : s ? t : [t[0]];
@@ -4723,23 +4813,23 @@ function ii(e, t = {}) {
4723
4813
  }
4724
4814
  }
4725
4815
  };
4726
- Zr(e, "dragenter", (e) => p(e, "enter")), Zr(e, "dragover", (e) => p(e, "over")), Zr(e, "dragleave", (e) => p(e, "leave")), Zr(e, "drop", (e) => p(e, "drop"));
4816
+ ri(e, "dragenter", (e) => p(e, "enter")), ri(e, "dragover", (e) => p(e, "over")), ri(e, "dragleave", (e) => p(e, "leave")), ri(e, "drop", (e) => p(e, "drop"));
4727
4817
  }
4728
4818
  return {
4729
4819
  files: r,
4730
4820
  isOverDropZone: n
4731
4821
  };
4732
4822
  }
4733
- function ai(e, t, n = {}) {
4734
- let { root: r, rootMargin: i, threshold: o = 0, window: c = qr, immediate: l = !0 } = n, u = /* @__PURE__ */ ti(() => c && "IntersectionObserver" in c), d = a(() => Ur(F(e)).map(Xr).filter(Pr)), f = $, p = L(l), m = u.value ? s(() => [
4823
+ function di(e, t, n = {}) {
4824
+ let { root: r, rootMargin: i, threshold: o = 0, window: c = $r, immediate: l = !0 } = n, u = /* @__PURE__ */ si(() => c && "IntersectionObserver" in c), d = a(() => Yr(F(e)).map(ni).filter(Br)), f = $, p = L(l), m = u.value ? s(() => [
4735
4825
  d.value,
4736
- Xr(r),
4826
+ ni(r),
4737
4827
  F(i),
4738
4828
  p.value
4739
4829
  ], ([e, n, r]) => {
4740
4830
  if (f(), !p.value || !e.length) return;
4741
4831
  let i = new IntersectionObserver(t, {
4742
- root: Xr(n),
4832
+ root: ni(n),
4743
4833
  rootMargin: r,
4744
4834
  threshold: o
4745
4835
  });
@@ -4752,7 +4842,7 @@ function ai(e, t, n = {}) {
4752
4842
  }) : $, h = () => {
4753
4843
  f(), m(), p.value = !1;
4754
4844
  };
4755
- return jr(h), {
4845
+ return Lr(h), {
4756
4846
  isSupported: u,
4757
4847
  isActive: p,
4758
4848
  pause() {
@@ -4764,22 +4854,22 @@ function ai(e, t, n = {}) {
4764
4854
  stop: h
4765
4855
  };
4766
4856
  }
4767
- var oi = {
4857
+ var fi = {
4768
4858
  multiple: !0,
4769
4859
  accept: "*",
4770
4860
  reset: !1,
4771
4861
  directory: !1
4772
4862
  };
4773
- function si(e) {
4863
+ function pi(e) {
4774
4864
  if (!e) return null;
4775
4865
  if (e instanceof FileList) return e;
4776
4866
  let t = new DataTransfer();
4777
4867
  for (let n of e) t.items.add(n);
4778
4868
  return t.files;
4779
4869
  }
4780
- function ci(t = {}) {
4781
- let { document: n = Jr } = t, r = e(si(t.initialFiles)), { on: i, trigger: o } = Mr(), { on: s, trigger: c } = Mr(), l = a(() => {
4782
- let e = Xr(t.input) ?? (n ? n.createElement("input") : void 0);
4870
+ function mi(t = {}) {
4871
+ let { document: n = ei } = t, r = e(pi(t.initialFiles)), { on: i, trigger: o } = Rr(), { on: s, trigger: c } = Rr(), l = a(() => {
4872
+ let e = ni(t.input) ?? (n ? n.createElement("input") : void 0);
4783
4873
  return e && (e.type = "file", e.onchange = (e) => {
4784
4874
  r.value = e.target.files, o(r.value);
4785
4875
  }, e.oncancel = () => {
@@ -4789,7 +4879,7 @@ function ci(t = {}) {
4789
4879
  r.value = null, l.value && l.value.value && (l.value.value = "", o(null));
4790
4880
  }, f = (e) => {
4791
4881
  let t = l.value;
4792
- t && (t.multiple = F(e.multiple), t.accept = F(e.accept), t.webkitdirectory = F(e.directory), Lr(e, "capture") && (t.capture = F(e.capture)));
4882
+ t && (t.multiple = F(e.multiple), t.accept = F(e.accept), t.webkitdirectory = F(e.directory), Ur(e, "capture") && (t.capture = F(e.capture)));
4793
4883
  };
4794
4884
  return d(() => {
4795
4885
  f(t);
@@ -4799,7 +4889,7 @@ function ci(t = {}) {
4799
4889
  let n = l.value;
4800
4890
  if (!n) return;
4801
4891
  let r = {
4802
- ...oi,
4892
+ ...fi,
4803
4893
  ...t,
4804
4894
  ...e
4805
4895
  };
@@ -4812,48 +4902,48 @@ function ci(t = {}) {
4812
4902
  }
4813
4903
  //#endregion
4814
4904
  //#region src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
4815
- var li = { class: "tpl:p-4" }, ui = {
4905
+ var hi = { class: "tpl:p-4" }, gi = {
4816
4906
  key: 1,
4817
4907
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
4818
- }, di = {
4908
+ }, _i = {
4819
4909
  class: "tpl:text-xs",
4820
4910
  style: { color: "var(--tpl-text-muted)" }
4821
- }, fi = {
4911
+ }, vi = {
4822
4912
  key: 2,
4823
4913
  class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
4824
- }, pi = ["onClick"], mi = { class: "tpl:aspect-square" }, hi = ["src", "alt"], gi = { class: "tpl:px-2 tpl:py-1.5" }, _i = {
4914
+ }, yi = ["onClick"], bi = { class: "tpl:aspect-square" }, xi = ["src", "alt"], Si = { class: "tpl:px-2 tpl:py-1.5" }, Ci = {
4825
4915
  class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
4826
4916
  style: { color: "var(--tpl-text)" }
4827
- }, vi = {
4917
+ }, wi = {
4828
4918
  class: "tpl:flex tpl:justify-between tpl:text-[9px]",
4829
4919
  style: { color: "var(--tpl-text-muted)" }
4830
- }, yi = { key: 0 }, bi = { 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" }, xi = ["title", "onClick"], Si = ["title", "onClick"], Ci = {
4920
+ }, Ti = { key: 0 }, Ei = { 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" }, Di = ["title", "onClick"], Oi = ["title", "onClick"], ki = {
4831
4921
  key: 0,
4832
4922
  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",
4833
4923
  style: { "background-color": "var(--tpl-primary)" }
4834
- }, wi = {
4924
+ }, Ai = {
4835
4925
  key: 3,
4836
4926
  class: "tpl:flex tpl:flex-col tpl:gap-1"
4837
- }, Ti = ["onClick"], Ei = {
4927
+ }, ji = ["onClick"], Mi = {
4838
4928
  class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
4839
4929
  style: { "background-color": "var(--tpl-bg-hover)" }
4840
- }, Di = ["src", "alt"], Oi = {
4930
+ }, Ni = ["src", "alt"], Pi = {
4841
4931
  key: 1,
4842
4932
  class: "tpl-list-icon tpl:size-full"
4843
- }, ki = { class: "tpl:min-w-0 tpl:flex-1" }, Ai = {
4933
+ }, Fi = { class: "tpl:min-w-0 tpl:flex-1" }, Ii = {
4844
4934
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
4845
4935
  style: { color: "var(--tpl-text)" }
4846
- }, ji = {
4936
+ }, Li = {
4847
4937
  class: "tpl:text-[10px]",
4848
4938
  style: { color: "var(--tpl-text-muted)" }
4849
- }, Mi = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Ni = ["title", "onClick"], Pi = ["title", "onClick"], Fi = {
4939
+ }, Ri = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, zi = ["title", "onClick"], Bi = ["title", "onClick"], Vi = {
4850
4940
  key: 0,
4851
4941
  class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4852
4942
  style: { "background-color": "var(--tpl-primary)" }
4853
- }, Ii = {
4943
+ }, Hi = {
4854
4944
  key: 4,
4855
4945
  class: "tpl:flex tpl:justify-center tpl:py-4"
4856
- }, Li = /*#__PURE__*/ hr(/* @__PURE__ */ m({
4946
+ }, Ui = /*#__PURE__*/ xr(/* @__PURE__ */ m({
4857
4947
  __name: "MediaGrid",
4858
4948
  props: {
4859
4949
  items: {},
@@ -4871,15 +4961,15 @@ var li = { class: "tpl:p-4" }, ui = {
4871
4961
  "replace"
4872
4962
  ],
4873
4963
  setup(n, { emit: a }) {
4874
- let o = n, s = a, { isAcceptedMimeType: c, isImageMimeType: l } = Le();
4964
+ let o = n, s = a, { isAcceptedMimeType: c, isImageMimeType: l } = Ue();
4875
4965
  function u(e) {
4876
4966
  return !o.accept || o.accept.length === 0 || c(e.mime_type, o.accept);
4877
4967
  }
4878
4968
  function d(e) {
4879
4969
  s("select", e);
4880
4970
  }
4881
- let { t: f } = Ae(), m = e(null);
4882
- ai(m, ([{ isIntersecting: e }]) => {
4971
+ let { t: f } = Re(), m = e(null);
4972
+ di(m, ([{ isIntersecting: e }]) => {
4883
4973
  e && o.hasMore && !o.isLoading && s("loadMore");
4884
4974
  }, { threshold: .1 });
4885
4975
  function g(e) {
@@ -4892,7 +4982,7 @@ var li = { class: "tpl:p-4" }, ui = {
4892
4982
  day: "numeric"
4893
4983
  });
4894
4984
  }
4895
- return (e, a) => (z(), t("div", li, [
4985
+ return (e, a) => (z(), t("div", hi, [
4896
4986
  n.isLoading && n.items.length === 0 ? (z(), t("div", {
4897
4987
  key: 0,
4898
4988
  class: O(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
@@ -4900,26 +4990,26 @@ var li = { class: "tpl:p-4" }, ui = {
4900
4990
  key: e,
4901
4991
  class: O(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
4902
4992
  style: { "background-color": "var(--tpl-bg-hover)" }
4903
- }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", ui, [p(A(le), {
4993
+ }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", gi, [p(A(le), {
4904
4994
  class: "tpl:mb-3",
4905
4995
  size: 40,
4906
4996
  "stroke-width": 1,
4907
4997
  style: { color: "var(--tpl-text-dim)" }
4908
- }), i("p", di, I(A(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", wi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
4998
+ }), i("p", _i, I(A(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", Ai, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
4909
4999
  key: e.id,
4910
5000
  class: O(["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", [!u(e) && !n.selectedIds.has(e.id) ? "tpl:opacity-60" : ""]]),
4911
5001
  style: N({ backgroundColor: n.selectedIds.has(e.id) ? "var(--tpl-bg-hover)" : "transparent" }),
4912
5002
  onClick: (t) => d(e)
4913
5003
  }, [
4914
- i("div", Ei, [A(l)(e.mime_type) ? (z(), t("img", {
5004
+ i("div", Mi, [A(l)(e.mime_type) ? (z(), t("img", {
4915
5005
  key: 0,
4916
5006
  src: e.small_url || e.url,
4917
5007
  alt: e.filename,
4918
5008
  class: "tpl:size-full tpl:object-cover",
4919
5009
  loading: "lazy"
4920
- }, null, 8, Di)) : (z(), t("div", Oi, [p(Ar, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
4921
- i("div", ki, [i("p", Ai, I(e.filename), 1), i("p", ji, [j(I(g(e.size)) + " · " + I(_(e.created_at)) + " ", 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.width) + "×" + I(e.height), 1)], 64)) : M("", !0)])]),
4922
- i("div", Mi, [i("button", {
5010
+ }, null, 8, Ni)) : (z(), t("div", Pi, [p(Ir, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
5011
+ i("div", Fi, [i("p", Ii, I(e.filename), 1), i("p", Li, [j(I(g(e.size)) + " · " + I(_(e.created_at)) + " ", 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.width) + "×" + I(e.height), 1)], 64)) : M("", !0)])]),
5012
+ i("div", Ri, [i("button", {
4923
5013
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
4924
5014
  style: { color: "var(--tpl-text-muted)" },
4925
5015
  title: A(f).mediaLibrary.editFile,
@@ -4927,7 +5017,7 @@ var li = { class: "tpl:p-4" }, ui = {
4927
5017
  }, [p(A(he), {
4928
5018
  size: 12,
4929
5019
  "stroke-width": 2
4930
- })], 8, Ni), i("button", {
5020
+ })], 8, zi), i("button", {
4931
5021
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
4932
5022
  style: { color: "var(--tpl-text-muted)" },
4933
5023
  title: A(f).mediaLibrary.replaceFile,
@@ -4935,12 +5025,12 @@ var li = { class: "tpl:p-4" }, ui = {
4935
5025
  }, [p(A(D), {
4936
5026
  size: 12,
4937
5027
  "stroke-width": 2
4938
- })], 8, Pi)]),
4939
- n.selectedIds.has(e.id) ? (z(), t("div", Fi, [p(A(E), {
5028
+ })], 8, Bi)]),
5029
+ n.selectedIds.has(e.id) ? (z(), t("div", Vi, [p(A(E), {
4940
5030
  size: 12,
4941
5031
  "stroke-width": 3
4942
5032
  })])) : M("", !0)
4943
- ], 14, Ti))), 128))])) : (z(), t("div", fi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
5033
+ ], 14, ji))), 128))])) : (z(), t("div", vi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
4944
5034
  key: e.id,
4945
5035
  class: O(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
4946
5036
  "tpl:cursor-pointer",
@@ -4953,18 +5043,18 @@ var li = { class: "tpl:p-4" }, ui = {
4953
5043
  }),
4954
5044
  onClick: (t) => d(e)
4955
5045
  }, [
4956
- i("div", mi, [A(l)(e.mime_type) ? (z(), t("img", {
5046
+ i("div", bi, [A(l)(e.mime_type) ? (z(), t("img", {
4957
5047
  key: 0,
4958
5048
  src: e.small_url || e.url,
4959
5049
  alt: e.filename,
4960
5050
  class: "tpl:size-full tpl:object-cover",
4961
5051
  loading: "lazy"
4962
- }, null, 8, hi)) : (z(), h(Ar, {
5052
+ }, null, 8, xi)) : (z(), h(Ir, {
4963
5053
  key: 1,
4964
5054
  "mime-type": e.mime_type
4965
5055
  }, null, 8, ["mime-type"]))]),
4966
- i("div", gi, [i("p", _i, I(e.filename), 1), i("p", vi, [i("span", null, I(g(e.size)), 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t("span", yi, I(e.width) + "×" + I(e.height), 1)) : M("", !0)])]),
4967
- i("div", bi, [i("button", {
5056
+ i("div", Si, [i("p", Ci, I(e.filename), 1), i("p", wi, [i("span", null, I(g(e.size)), 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t("span", Ti, I(e.width) + "×" + I(e.height), 1)) : M("", !0)])]),
5057
+ i("div", Ei, [i("button", {
4968
5058
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4969
5059
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
4970
5060
  title: A(f).mediaLibrary.editFile,
@@ -4972,7 +5062,7 @@ var li = { class: "tpl:p-4" }, ui = {
4972
5062
  }, [p(A(he), {
4973
5063
  size: 11,
4974
5064
  "stroke-width": 2
4975
- })], 8, xi), i("button", {
5065
+ })], 8, Di), i("button", {
4976
5066
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4977
5067
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
4978
5068
  title: A(f).mediaLibrary.replaceFile,
@@ -4980,18 +5070,18 @@ var li = { class: "tpl:p-4" }, ui = {
4980
5070
  }, [p(A(D), {
4981
5071
  size: 11,
4982
5072
  "stroke-width": 2
4983
- })], 8, Si)]),
4984
- n.selectedIds.has(e.id) ? (z(), t("div", Ci, [p(A(E), {
5073
+ })], 8, Oi)]),
5074
+ n.selectedIds.has(e.id) ? (z(), t("div", ki, [p(A(E), {
4985
5075
  size: 12,
4986
5076
  "stroke-width": 3
4987
5077
  })])) : M("", !0)
4988
- ], 14, pi))), 128))])),
5078
+ ], 14, yi))), 128))])),
4989
5079
  i("div", {
4990
5080
  ref_key: "sentinelRef",
4991
5081
  ref: m,
4992
5082
  class: "tpl:h-4"
4993
5083
  }, null, 512),
4994
- n.isLoading && n.items.length > 0 ? (z(), t("div", Ii, [p(A(ce), {
5084
+ n.isLoading && n.items.length > 0 ? (z(), t("div", Hi, [p(A(ce), {
4995
5085
  class: "tpl-spinner",
4996
5086
  size: 20,
4997
5087
  "stroke-width": 2,
@@ -4999,20 +5089,20 @@ var li = { class: "tpl:p-4" }, ui = {
4999
5089
  })])) : M("", !0)
5000
5090
  ]));
5001
5091
  }
5002
- }), [["__scopeId", "data-v-9db961d1"]]), Ri = ["data-tpl-theme"], zi = {
5092
+ }), [["__scopeId", "data-v-9db961d1"]]), Wi = ["data-tpl-theme"], Gi = {
5003
5093
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
5004
5094
  style: { "background-color": "var(--tpl-bg-elevated)" }
5005
- }, Bi = {
5095
+ }, Ki = {
5006
5096
  class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
5007
5097
  style: { color: "var(--tpl-text)" }
5008
- }, Vi = { class: "tpl:mb-3" }, Hi = ["placeholder", "disabled"], Ui = {
5098
+ }, qi = { class: "tpl:mb-3" }, Ji = ["placeholder", "disabled"], Yi = {
5009
5099
  key: 0,
5010
5100
  class: "tpl:mb-3 tpl:text-xs",
5011
5101
  style: { color: "var(--tpl-danger)" }
5012
- }, Wi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Gi = ["disabled"], Ki = ["disabled"], qi = {
5102
+ }, Xi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Zi = ["disabled"], Qi = ["disabled"], $i = {
5013
5103
  key: 0,
5014
5104
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
5015
- }, Ji = { key: 1 }, Yi = /* @__PURE__ */ m({
5105
+ }, ea = { key: 1 }, ta = /* @__PURE__ */ m({
5016
5106
  __name: "MediaImportUrlModal",
5017
5107
  props: {
5018
5108
  visible: { type: Boolean },
@@ -5021,7 +5111,7 @@ var li = { class: "tpl:p-4" }, ui = {
5021
5111
  },
5022
5112
  emits: ["import", "close"],
5023
5113
  setup(n, { emit: a }) {
5024
- let o = n, c = a, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ie, e(null)), g = e("");
5114
+ let o = n, c = a, { t: d } = Re(), f = l(Fe, null), m = l(Ne, e(null)), g = e("");
5025
5115
  s(() => o.visible, (e) => {
5026
5116
  e && (g.value = "");
5027
5117
  });
@@ -5050,9 +5140,9 @@ var li = { class: "tpl:p-4" }, ui = {
5050
5140
  style: { "background-color": "var(--tpl-overlay)" },
5051
5141
  onClick: r(v, ["self"]),
5052
5142
  onKeydown: y
5053
- }, [i("div", zi, [
5054
- i("h3", Bi, I(A(d).mediaLibrary.importFromUrl), 1),
5055
- i("div", Vi, [u(i("input", {
5143
+ }, [i("div", Gi, [
5144
+ i("h3", Ki, I(A(d).mediaLibrary.importFromUrl), 1),
5145
+ i("div", qi, [u(i("input", {
5056
5146
  "onUpdate:modelValue": a[0] ||= (e) => g.value = e,
5057
5147
  type: "url",
5058
5148
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -5064,9 +5154,9 @@ var li = { class: "tpl:p-4" }, ui = {
5064
5154
  placeholder: A(d).mediaLibrary.importUrlPlaceholder,
5065
5155
  disabled: n.isImporting,
5066
5156
  autofocus: ""
5067
- }, null, 8, Hi), [[te, g.value]])]),
5068
- n.error ? (z(), t("p", Ui, I(n.error), 1)) : M("", !0),
5069
- i("div", Wi, [i("button", {
5157
+ }, null, 8, Ji), [[te, g.value]])]),
5158
+ n.error ? (z(), t("p", Yi, I(n.error), 1)) : M("", !0),
5159
+ i("div", Xi, [i("button", {
5070
5160
  class: O(["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": n.isImporting }]),
5071
5161
  style: {
5072
5162
  "border-color": "var(--tpl-border)",
@@ -5075,25 +5165,25 @@ var li = { class: "tpl:p-4" }, ui = {
5075
5165
  },
5076
5166
  disabled: n.isImporting,
5077
5167
  onClick: v
5078
- }, I(A(d).mediaLibrary.cancel), 11, Gi), i("button", {
5168
+ }, I(A(d).mediaLibrary.cancel), 11, Zi), i("button", {
5079
5169
  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",
5080
5170
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5081
5171
  disabled: !g.value.trim() || n.isImporting,
5082
5172
  onClick: _
5083
- }, [n.isImporting ? (z(), t("span", qi, [p(A(ce), {
5173
+ }, [n.isImporting ? (z(), t("span", $i, [p(A(ce), {
5084
5174
  class: "tpl:animate-spin",
5085
5175
  size: 12,
5086
5176
  "stroke-width": 2
5087
- }), j(" " + I(A(d).mediaLibrary.importing), 1)])) : (z(), t("span", Ji, I(A(d).mediaLibrary.import), 1))], 8, Ki)])
5088
- ])], 40, Ri)) : M("", !0)]),
5177
+ }), j(" " + I(A(d).mediaLibrary.importing), 1)])) : (z(), t("span", ea, I(A(d).mediaLibrary.import), 1))], 8, Qi)])
5178
+ ])], 40, Wi)) : M("", !0)]),
5089
5179
  _: 1
5090
5180
  })], 8, ["to"]));
5091
5181
  }
5092
- }), Xi = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, Zi = ["disabled", "onClick"], Qi = { class: "tpl:truncate" }, $i = {
5182
+ }), na = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, ra = ["disabled", "onClick"], ia = { class: "tpl:truncate" }, aa = {
5093
5183
  key: 0,
5094
5184
  class: "tpl:shrink-0",
5095
5185
  style: { color: "var(--tpl-text-dim)" }
5096
- }, ea = /* @__PURE__ */ m({
5186
+ }, oa = /* @__PURE__ */ m({
5097
5187
  __name: "MediaMovePicker",
5098
5188
  props: {
5099
5189
  folders: {},
@@ -5101,7 +5191,7 @@ var li = { class: "tpl:p-4" }, ui = {
5101
5191
  },
5102
5192
  emits: ["select", "close"],
5103
5193
  setup(n, { emit: r }) {
5104
- let a = r, { t: o } = Ae(), s = e(null);
5194
+ let a = r, { t: o } = Re(), s = e(null);
5105
5195
  function c(e, t = 0) {
5106
5196
  let n = [];
5107
5197
  for (let r of e) n.push({
@@ -5111,7 +5201,7 @@ var li = { class: "tpl:p-4" }, ui = {
5111
5201
  }), r.children?.length && n.push(...c(r.children, t + 1));
5112
5202
  return n;
5113
5203
  }
5114
- return $r(s, () => {
5204
+ return ai(s, () => {
5115
5205
  a("close");
5116
5206
  }), (e, r) => (z(), t("div", {
5117
5207
  ref_key: "pickerRef",
@@ -5121,7 +5211,7 @@ var li = { class: "tpl:p-4" }, ui = {
5121
5211
  "border-color": "var(--tpl-border)",
5122
5212
  "background-color": "var(--tpl-bg-elevated)"
5123
5213
  }
5124
- }, [i("div", Xi, [n.currentFolderId === null ? M("", !0) : (z(), t("button", {
5214
+ }, [i("div", na, [n.currentFolderId === null ? M("", !0) : (z(), t("button", {
5125
5215
  key: 0,
5126
5216
  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",
5127
5217
  style: { color: "var(--tpl-text)" },
@@ -5146,27 +5236,27 @@ var li = { class: "tpl:p-4" }, ui = {
5146
5236
  size: 14,
5147
5237
  "stroke-width": 1.5
5148
5238
  }),
5149
- i("span", Qi, I(e.name), 1),
5150
- e.id === n.currentFolderId ? (z(), t("span", $i, I(A(o).mediaLibrary.currentFolder), 1)) : M("", !0)
5151
- ], 12, Zi))), 128))])], 512));
5239
+ i("span", ia, I(e.name), 1),
5240
+ e.id === n.currentFolderId ? (z(), t("span", aa, I(A(o).mediaLibrary.currentFolder), 1)) : M("", !0)
5241
+ ], 12, ra))), 128))])], 512));
5152
5242
  }
5153
- }), ta = { class: "tpl:flex tpl:items-center tpl:gap-3" }, na = ["src", "alt"], ra = {
5243
+ }), sa = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ca = ["src", "alt"], la = {
5154
5244
  key: 1,
5155
5245
  class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
5156
5246
  style: { border: "1px solid var(--tpl-border)" }
5157
- }, ia = { class: "tpl:min-w-0 tpl:flex-1" }, aa = {
5247
+ }, ua = { class: "tpl:min-w-0 tpl:flex-1" }, da = {
5158
5248
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5159
5249
  style: { color: "var(--tpl-text)" }
5160
- }, oa = {
5250
+ }, fa = {
5161
5251
  class: "tpl:mt-0.5 tpl:text-[10px]",
5162
5252
  style: { color: "var(--tpl-text-muted)" }
5163
- }, sa = {
5253
+ }, pa = {
5164
5254
  key: 2,
5165
5255
  class: "tpl:shrink-0"
5166
- }, ca = {
5256
+ }, ma = {
5167
5257
  class: "tpl:block tpl:text-[10px]",
5168
5258
  style: { color: "var(--tpl-text-muted)" }
5169
- }, la = ["value"], ua = ["value"], da = /*#__PURE__*/ hr(/* @__PURE__ */ m({
5259
+ }, ha = ["value"], ga = ["value"], _a = /*#__PURE__*/ xr(/* @__PURE__ */ m({
5170
5260
  __name: "MediaPreviewPanel",
5171
5261
  props: {
5172
5262
  item: {},
@@ -5175,7 +5265,7 @@ var li = { class: "tpl:p-4" }, ui = {
5175
5265
  },
5176
5266
  emits: ["update:selectedConversion"],
5177
5267
  setup(e, { emit: n }) {
5178
- let r = e, o = n, { t: s } = Ae(), { isImageMimeType: c } = Le(), l = a(() => {
5268
+ let r = e, o = n, { t: s } = Re(), { isImageMimeType: c } = Ue(), l = a(() => {
5179
5269
  if (!g.value || !r.item.conversions_generated) return [];
5180
5270
  let e = [];
5181
5271
  return r.item.small_url && e.push({
@@ -5234,20 +5324,20 @@ var li = { class: "tpl:p-4" }, ui = {
5234
5324
  day: "numeric"
5235
5325
  });
5236
5326
  }
5237
- return (n, r) => (z(), t("div", ta, [
5327
+ return (n, r) => (z(), t("div", sa, [
5238
5328
  g.value ? (z(), t("img", {
5239
5329
  key: 0,
5240
5330
  src: d.value ?? void 0,
5241
5331
  alt: e.item.alt_text || e.item.filename,
5242
5332
  class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
5243
5333
  style: { border: "1px solid var(--tpl-border)" }
5244
- }, null, 8, na)) : (z(), t("div", ra, [p(Ar, {
5334
+ }, null, 8, ca)) : (z(), t("div", la, [p(Ir, {
5245
5335
  "mime-type": e.item.mime_type,
5246
5336
  class: "tpl-preview-icon"
5247
5337
  }, null, 8, ["mime-type"])])),
5248
- i("div", ia, [
5249
- i("p", aa, I(e.item.filename), 1),
5250
- i("p", oa, [
5338
+ i("div", ua, [
5339
+ i("p", da, I(e.item.filename), 1),
5340
+ i("p", fa, [
5251
5341
  j(I(_(e.item.size)) + " · " + I(v(e.item.created_at)) + " ", 1),
5252
5342
  g.value && e.item.width && e.item.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.item.width) + "×" + I(e.item.height) + "px ", 1)], 64)) : M("", !0),
5253
5343
  h.value ? (z(), t(R, { key: 1 }, [
@@ -5266,7 +5356,7 @@ var li = { class: "tpl:p-4" }, ui = {
5266
5356
  style: { color: "var(--tpl-text-dim)" }
5267
5357
  }, I(e.item.alt_text || "\xA0"), 3)) : M("", !0)
5268
5358
  ]),
5269
- u.value ? (z(), t("div", sa, [i("label", ca, I(A(s).mediaLibrary.conversionLabel), 1), i("select", {
5359
+ u.value ? (z(), t("div", pa, [i("label", ma, I(A(s).mediaLibrary.conversionLabel), 1), i("select", {
5270
5360
  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",
5271
5361
  style: {
5272
5362
  "border-color": "var(--tpl-border)",
@@ -5278,36 +5368,36 @@ var li = { class: "tpl:p-4" }, ui = {
5278
5368
  }, [(z(!0), t(R, null, S(l.value, (e) => (z(), t("option", {
5279
5369
  key: e.value,
5280
5370
  value: e.value
5281
- }, I(e.label), 9, ua))), 128))], 40, la)])) : M("", !0)
5371
+ }, I(e.label), 9, ga))), 128))], 40, ha)])) : M("", !0)
5282
5372
  ]));
5283
5373
  }
5284
- }), [["__scopeId", "data-v-060e36cd"]]), fa = ["data-tpl-theme"], pa = {
5374
+ }), [["__scopeId", "data-v-060e36cd"]]), va = ["data-tpl-theme"], ya = {
5285
5375
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
5286
5376
  style: { "background-color": "var(--tpl-bg-elevated)" }
5287
- }, ma = {
5377
+ }, ba = {
5288
5378
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
5289
5379
  style: { color: "var(--tpl-text)" }
5290
- }, ha = {
5380
+ }, xa = {
5291
5381
  class: "tpl:mb-2 tpl:text-xs",
5292
5382
  style: { color: "var(--tpl-text-muted)" }
5293
- }, ga = {
5383
+ }, Sa = {
5294
5384
  key: 0,
5295
5385
  class: "tpl:mb-3 tpl:text-xs",
5296
5386
  style: { color: "var(--tpl-warning)" }
5297
- }, _a = {
5387
+ }, Ca = {
5298
5388
  class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
5299
5389
  style: { "border-color": "var(--tpl-border)" }
5300
- }, va = {
5390
+ }, wa = {
5301
5391
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5302
5392
  style: { color: "var(--tpl-text)" }
5303
- }, ya = { class: "tpl:mb-4" }, ba = {
5393
+ }, Ta = { class: "tpl:mb-4" }, Ea = {
5304
5394
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
5305
5395
  style: { color: "var(--tpl-text-muted)" }
5306
- }, xa = ["accept"], Sa = {
5396
+ }, Da = ["accept"], Oa = {
5307
5397
  key: 1,
5308
5398
  class: "tpl:mb-3 tpl:text-xs",
5309
5399
  style: { color: "var(--tpl-danger)" }
5310
- }, Ca = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, wa = ["disabled"], Ta = ["disabled"], Ea = /* @__PURE__ */ m({
5400
+ }, ka = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Aa = ["disabled"], ja = ["disabled"], Ma = /* @__PURE__ */ m({
5311
5401
  __name: "MediaReplaceModal",
5312
5402
  props: {
5313
5403
  visible: { type: Boolean },
@@ -5318,7 +5408,7 @@ var li = { class: "tpl:p-4" }, ui = {
5318
5408
  },
5319
5409
  emits: ["replace", "close"],
5320
5410
  setup(n, { emit: o }) {
5321
- let c = n, u = o, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ie, e(null)), g = e(null), _ = e(null), v = a(() => {
5411
+ let c = n, u = o, { t: d } = Re(), f = l(Fe, null), m = l(Ne, e(null)), g = e(null), _ = e(null), v = a(() => {
5322
5412
  if (!c.item) return "";
5323
5413
  let e = c.item.filename.split(".");
5324
5414
  return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
@@ -5351,12 +5441,12 @@ var li = { class: "tpl:p-4" }, ui = {
5351
5441
  style: { "background-color": "var(--tpl-overlay)" },
5352
5442
  onClick: a[1] ||= r((e) => u("close"), ["self"]),
5353
5443
  onKeydown: w
5354
- }, [i("div", pa, [
5355
- i("h3", ma, I(A(d).mediaLibrary.replaceWarningTitle), 1),
5356
- i("p", ha, I(A(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
5357
- x.value ? (z(), t("p", ga, I(A(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : M("", !0),
5358
- i("div", _a, [i("p", va, I(n.item.filename), 1)]),
5359
- i("div", ya, [i("label", ba, I(A(d).mediaLibrary.replaceSelectFile), 1), i("input", {
5444
+ }, [i("div", ya, [
5445
+ i("h3", ba, I(A(d).mediaLibrary.replaceWarningTitle), 1),
5446
+ i("p", xa, I(A(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
5447
+ x.value ? (z(), t("p", Sa, I(A(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : M("", !0),
5448
+ i("div", Ca, [i("p", wa, I(n.item.filename), 1)]),
5449
+ i("div", Ta, [i("label", Ea, I(A(d).mediaLibrary.replaceSelectFile), 1), i("input", {
5360
5450
  ref_key: "fileInputRef",
5361
5451
  ref: g,
5362
5452
  type: "file",
@@ -5368,9 +5458,9 @@ var li = { class: "tpl:p-4" }, ui = {
5368
5458
  color: "var(--tpl-text)"
5369
5459
  },
5370
5460
  onChange: S
5371
- }, null, 40, xa)]),
5372
- n.error ? (z(), t("p", Sa, I(n.error), 1)) : M("", !0),
5373
- i("div", Ca, [i("button", {
5461
+ }, null, 40, Da)]),
5462
+ n.error ? (z(), t("p", Oa, I(n.error), 1)) : M("", !0),
5463
+ i("div", ka, [i("button", {
5374
5464
  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",
5375
5465
  style: {
5376
5466
  "border-color": "var(--tpl-border)",
@@ -5379,29 +5469,29 @@ var li = { class: "tpl:p-4" }, ui = {
5379
5469
  },
5380
5470
  disabled: n.isReplacing,
5381
5471
  onClick: a[0] ||= (e) => u("close")
5382
- }, I(A(d).mediaLibrary.cancel), 9, wa), i("button", {
5472
+ }, I(A(d).mediaLibrary.cancel), 9, Aa), i("button", {
5383
5473
  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",
5384
5474
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5385
5475
  disabled: !_.value || n.isReplacing,
5386
5476
  onClick: C
5387
- }, I(n.isReplacing ? A(d).mediaLibrary.replacing : A(d).mediaLibrary.replace), 9, Ta)])
5388
- ])], 40, fa)) : M("", !0)]),
5477
+ }, I(n.isReplacing ? A(d).mediaLibrary.replacing : A(d).mediaLibrary.replace), 9, ja)])
5478
+ ])], 40, va)) : M("", !0)]),
5389
5479
  _: 1
5390
5480
  })], 8, ["to"]));
5391
5481
  }
5392
- }), Da = {
5482
+ }), Na = {
5393
5483
  key: 0,
5394
5484
  class: "tpl:flex tpl:items-center tpl:gap-2"
5395
- }, Oa = {
5485
+ }, Pa = {
5396
5486
  class: "tpl:text-xs",
5397
5487
  style: { color: "var(--tpl-text-muted)" }
5398
- }, ka = {
5488
+ }, Fa = {
5399
5489
  class: "tpl:text-xs",
5400
5490
  style: { color: "var(--tpl-text-muted)" }
5401
- }, Aa = {
5491
+ }, Ia = {
5402
5492
  class: "tpl:mt-1 tpl:text-[10px]",
5403
5493
  style: { color: "var(--tpl-text-dim)" }
5404
- }, ja = /* @__PURE__ */ m({
5494
+ }, La = /* @__PURE__ */ m({
5405
5495
  __name: "MediaUploadZone",
5406
5496
  props: {
5407
5497
  isUploading: { type: Boolean },
@@ -5409,7 +5499,7 @@ var li = { class: "tpl:p-4" }, ui = {
5409
5499
  },
5410
5500
  emits: ["upload"],
5411
5501
  setup(n, { emit: r }) {
5412
- let a = r, { t: o, format: s } = Ae(), { allAcceptedMimeTypes: c, allAcceptedInputString: l, maxFileSize: u } = Le(), d = e();
5502
+ let a = r, { t: o, format: s } = Re(), { allAcceptedMimeTypes: c, allAcceptedInputString: l, maxFileSize: u } = Ue(), d = e();
5413
5503
  function f(e) {
5414
5504
  let t = [];
5415
5505
  for (let n of Array.from(e)) c.value.includes(n.type) && n.size <= u.value && t.push(n);
@@ -5419,9 +5509,9 @@ var li = { class: "tpl:p-4" }, ui = {
5419
5509
  let t = f(e);
5420
5510
  t.length && a("upload", t);
5421
5511
  }
5422
- let { isOverDropZone: h } = ii(d, { onDrop: (e) => {
5512
+ let { isOverDropZone: h } = ui(d, { onDrop: (e) => {
5423
5513
  e?.length && m(e);
5424
- } }), { open: g, onChange: _ } = ci({
5514
+ } }), { open: g, onChange: _ } = mi({
5425
5515
  accept: l.value,
5426
5516
  multiple: !0
5427
5517
  });
@@ -5436,12 +5526,12 @@ var li = { class: "tpl:p-4" }, ui = {
5436
5526
  "background-color": "var(--tpl-bg)"
5437
5527
  },
5438
5528
  onClick: r[0] ||= (e) => A(g)()
5439
- }, [n.isUploading ? (z(), t("div", Da, [p(A(ce), {
5529
+ }, [n.isUploading ? (z(), t("div", Na, [p(A(ce), {
5440
5530
  class: "tpl-spinner",
5441
5531
  size: 20,
5442
5532
  "stroke-width": 2,
5443
5533
  style: { color: "var(--tpl-primary)" }
5444
- }), i("span", Oa, I(n.uploadProgress && n.uploadProgress.total > 1 ? A(s)(A(o).mediaLibrary.uploadingProgress, {
5534
+ }), i("span", Pa, I(n.uploadProgress && n.uploadProgress.total > 1 ? A(s)(A(o).mediaLibrary.uploadingProgress, {
5445
5535
  current: n.uploadProgress.current,
5446
5536
  total: n.uploadProgress.total
5447
5537
  }) : A(o).mediaLibrary.uploading), 1)])) : (z(), t(R, { key: 1 }, [
@@ -5451,20 +5541,20 @@ var li = { class: "tpl:p-4" }, ui = {
5451
5541
  "stroke-width": 1.5,
5452
5542
  style: { color: "var(--tpl-text-dim)" }
5453
5543
  }),
5454
- i("p", ka, I(A(o).mediaLibrary.dropOrClick), 1),
5455
- i("p", Aa, I(A(o).mediaLibrary.acceptedFormats), 1)
5544
+ i("p", Fa, I(A(o).mediaLibrary.dropOrClick), 1),
5545
+ i("p", Ia, I(A(o).mediaLibrary.acceptedFormats), 1)
5456
5546
  ], 64))], 2));
5457
5547
  }
5458
- }), Ma = [
5548
+ }), Ra = [
5459
5549
  "width",
5460
5550
  "height",
5461
5551
  "viewBox"
5462
- ], Na = [
5552
+ ], za = [
5463
5553
  "cx",
5464
5554
  "cy",
5465
5555
  "r",
5466
5556
  "stroke-width"
5467
- ], Pa = [
5557
+ ], Ba = [
5468
5558
  "cx",
5469
5559
  "cy",
5470
5560
  "r",
@@ -5472,14 +5562,14 @@ var li = { class: "tpl:p-4" }, ui = {
5472
5562
  "stroke",
5473
5563
  "stroke-dasharray",
5474
5564
  "stroke-dashoffset"
5475
- ], Fa = {
5565
+ ], Va = {
5476
5566
  key: 0,
5477
5567
  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",
5478
5568
  style: {
5479
5569
  "background-color": "var(--tpl-text)",
5480
5570
  color: "var(--tpl-bg-elevated)"
5481
5571
  }
5482
- }, Ia = /* @__PURE__ */ m({
5572
+ }, Ha = /* @__PURE__ */ m({
5483
5573
  __name: "StorageProgressRing",
5484
5574
  props: {
5485
5575
  usedBytes: {},
@@ -5487,7 +5577,7 @@ var li = { class: "tpl:p-4" }, ui = {
5487
5577
  size: {}
5488
5578
  },
5489
5579
  setup(n) {
5490
- let r = n, { t: o, format: s } = Ae(), c = e(!1), l = a(() => r.size ?? 24), u = a(() => Math.max(2, l.value / 8)), d = a(() => (l.value - u.value) / 2), f = a(() => 2 * Math.PI * d.value), m = a(() => r.limitBytes <= 0 ? 0 : Math.min(100, r.usedBytes / r.limitBytes * 100)), h = a(() => f.value - m.value / 100 * f.value), g = a(() => m.value >= 95 ? "var(--tpl-danger)" : m.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
5580
+ let r = n, { t: o, format: s } = Re(), c = e(!1), l = a(() => r.size ?? 24), u = a(() => Math.max(2, l.value / 8)), d = a(() => (l.value - u.value) / 2), f = a(() => 2 * Math.PI * d.value), m = a(() => r.limitBytes <= 0 ? 0 : Math.min(100, r.usedBytes / r.limitBytes * 100)), h = a(() => f.value - m.value / 100 * f.value), g = a(() => m.value >= 95 ? "var(--tpl-danger)" : m.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
5491
5581
  function _(e) {
5492
5582
  if (e === 0) return "0 B";
5493
5583
  let t = 1024, n = [
@@ -5519,7 +5609,7 @@ var li = { class: "tpl:p-4" }, ui = {
5519
5609
  fill: "none",
5520
5610
  "stroke-width": u.value,
5521
5611
  style: { stroke: "var(--tpl-border)" }
5522
- }, null, 8, Na), i("circle", {
5612
+ }, null, 8, za), i("circle", {
5523
5613
  cx: l.value / 2,
5524
5614
  cy: l.value / 2,
5525
5615
  r: d.value,
@@ -5530,7 +5620,7 @@ var li = { class: "tpl:p-4" }, ui = {
5530
5620
  "stroke-dasharray": f.value,
5531
5621
  "stroke-dashoffset": h.value,
5532
5622
  class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
5533
- }, null, 8, Pa)], 8, Ma)), p(ve, {
5623
+ }, null, 8, Ba)], 8, Ra)), p(ve, {
5534
5624
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
5535
5625
  "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
5536
5626
  "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
@@ -5538,14 +5628,14 @@ var li = { class: "tpl:p-4" }, ui = {
5538
5628
  "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
5539
5629
  "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
5540
5630
  }, {
5541
- default: P(() => [c.value ? (z(), t("div", Fa, [j(I(S.value) + " ", 1), n[2] ||= i("div", {
5631
+ default: P(() => [c.value ? (z(), t("div", Va, [j(I(S.value) + " ", 1), n[2] ||= i("div", {
5542
5632
  class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
5543
5633
  style: { "background-color": "var(--tpl-text)" }
5544
5634
  }, null, -1)])) : M("", !0)]),
5545
5635
  _: 1
5546
5636
  })], 32));
5547
5637
  }
5548
- }), La = class {
5638
+ }), Ua = class {
5549
5639
  authManager;
5550
5640
  constructor(e) {
5551
5641
  this.authManager = e;
@@ -5702,9 +5792,9 @@ var li = { class: "tpl:p-4" }, ui = {
5702
5792
  };
5703
5793
  //#endregion
5704
5794
  //#region src/composable.ts
5705
- function Ra(t) {
5795
+ function Wa(t) {
5706
5796
  if (!t.projectId) throw Error("projectId is required for useMediaLibrary");
5707
- let n = new La(t.authManager), r = e([]), i = e([]), a = e(null), o = e("files"), s = e(""), c = e(null), l = e("newest"), u = e(!1), d = e(!1), f = e(!1), p = e(null), m = e(null), h = e(/* @__PURE__ */ new Set()), g = e(null), _ = e([]), v = e({}), y = e(!1), b = e([]), x = e(!1), S = e(null), C = e(!1), w = e(null), ee = e(!1), T = e(null), E = e(null), D = 0;
5797
+ let n = new Ua(t.authManager), r = e([]), i = e([]), a = e(null), o = e("files"), s = e(""), c = e(null), l = e("newest"), u = e(!1), d = e(!1), f = e(!1), p = e(null), m = e(null), h = e(/* @__PURE__ */ new Set()), g = e(null), _ = e([]), v = e({}), y = e(!1), b = e([]), x = e(!1), S = e(null), C = e(!1), w = e(null), ee = e(!1), T = e(null), E = e(null), D = 0;
5708
5798
  async function O() {
5709
5799
  let e = ++D;
5710
5800
  u.value = !0;
@@ -5999,7 +6089,7 @@ function Ra(t) {
5999
6089
  }
6000
6090
  //#endregion
6001
6091
  //#region src/composables/useMediaLibraryUI.ts
6002
- function za(t) {
6092
+ function Ga(t) {
6003
6093
  let { library: n, translations: r } = t;
6004
6094
  function i() {
6005
6095
  return "value" in r && typeof r.value == "object" ? r.value : r;
@@ -6027,13 +6117,13 @@ function za(t) {
6027
6117
  }), s(() => n.previewItem.value?.id, () => {
6028
6118
  u.value = "original";
6029
6119
  });
6030
- let b = Wr((e) => {
6120
+ let b = Xr((e) => {
6031
6121
  n.search(e);
6032
6122
  }, 300);
6033
6123
  function x(e) {
6034
6124
  l.value = e, b(e);
6035
6125
  }
6036
- let { copy: S, copied: C } = ri({
6126
+ let { copy: S, copied: C } = li({
6037
6127
  copiedDuring: 2e3,
6038
6128
  legacy: !0
6039
6129
  });
@@ -6109,7 +6199,7 @@ function za(t) {
6109
6199
  }
6110
6200
  //#endregion
6111
6201
  //#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
6112
- var Ba = {
6202
+ var Ka = {
6113
6203
  class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
6114
6204
  style: {
6115
6205
  width: "100%",
@@ -6117,59 +6207,59 @@ var Ba = {
6117
6207
  "background-color": "var(--tpl-bg-elevated)",
6118
6208
  border: "1px solid var(--tpl-border)"
6119
6209
  }
6120
- }, Va = {
6210
+ }, qa = {
6121
6211
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
6122
6212
  style: { "border-color": "var(--tpl-border)" }
6123
- }, Ha = {
6213
+ }, Ja = {
6124
6214
  class: "tpl:text-sm tpl:font-semibold",
6125
6215
  style: { color: "var(--tpl-text)" }
6126
- }, Ua = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Wa = { class: "tpl:relative" }, Ga = ["value", "placeholder"], Ka = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, qa = {
6216
+ }, Ya = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Xa = { class: "tpl:relative" }, Za = ["value", "placeholder"], Qa = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, $a = {
6127
6217
  key: 0,
6128
6218
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
6129
6219
  style: {
6130
6220
  "border-color": "var(--tpl-border)",
6131
6221
  "background-color": "var(--tpl-bg)"
6132
6222
  }
6133
- }, Ja = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Ya = {
6223
+ }, eo = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, to = {
6134
6224
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
6135
6225
  style: { "border-color": "var(--tpl-border)" }
6136
- }, Xa = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Za = ["title"], Qa = {
6226
+ }, no = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ro = ["title"], io = {
6137
6227
  key: 0,
6138
6228
  class: "tpl:text-xs tpl:font-medium",
6139
6229
  style: { color: "var(--tpl-text)" }
6140
- }, $a = {
6230
+ }, ao = {
6141
6231
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
6142
6232
  style: {
6143
6233
  border: "1px solid var(--tpl-border)",
6144
6234
  "background-color": "var(--tpl-bg)"
6145
6235
  }
6146
- }, eo = ["title"], to = ["title"], no = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ro = ["value"], io = { value: "" }, ao = ["value"], oo = ["value"], so = { value: "newest" }, co = { value: "oldest" }, lo = { value: "name_asc" }, uo = { value: "name_desc" }, fo = { value: "size_asc" }, po = { value: "size_desc" }, mo = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, ho = {
6236
+ }, oo = ["title"], so = ["title"], co = { class: "tpl:flex tpl:items-center tpl:gap-2" }, lo = ["value"], uo = { value: "" }, fo = ["value"], po = ["value"], mo = { value: "newest" }, ho = { value: "oldest" }, go = { value: "name_asc" }, _o = { value: "name_desc" }, vo = { value: "size_asc" }, yo = { value: "size_desc" }, bo = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, xo = {
6147
6237
  key: 0,
6148
6238
  class: "tpl:px-4 tpl:pt-3"
6149
- }, go = {
6239
+ }, So = {
6150
6240
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
6151
6241
  style: {
6152
6242
  "background-color": "var(--tpl-bg-elevated)",
6153
6243
  "box-shadow": "var(--tpl-shadow-xl)"
6154
6244
  }
6155
- }, _o = {
6245
+ }, Co = {
6156
6246
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
6157
6247
  style: { color: "var(--tpl-text)" }
6158
- }, vo = {
6248
+ }, wo = {
6159
6249
  key: 0,
6160
6250
  class: "tpl:mb-4 tpl:text-xs",
6161
6251
  style: { color: "var(--tpl-text-muted)" }
6162
- }, yo = {
6252
+ }, To = {
6163
6253
  key: 1,
6164
6254
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
6165
6255
  style: { "border-color": "var(--tpl-border)" }
6166
- }, bo = { class: "tpl:font-medium" }, xo = { style: { color: "var(--tpl-text-muted)" } }, So = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Co = {
6256
+ }, Eo = { class: "tpl:font-medium" }, Do = { style: { color: "var(--tpl-text-muted)" } }, Oo = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, ko = {
6167
6257
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
6168
6258
  style: { "border-color": "var(--tpl-border)" }
6169
- }, wo = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, To = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Eo = {
6259
+ }, Ao = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, jo = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Mo = {
6170
6260
  key: 0,
6171
6261
  class: "tpl:flex tpl:items-center tpl:gap-2"
6172
- }, Do = { class: "tpl:relative" }, Oo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ko = ["disabled"], Ao = /* @__PURE__ */ m({
6262
+ }, No = { class: "tpl:relative" }, Po = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Fo = ["disabled"], Io = /* @__PURE__ */ m({
6173
6263
  __name: "MediaLibrary",
6174
6264
  props: {
6175
6265
  authManager: {},
@@ -6182,20 +6272,20 @@ var Ba = {
6182
6272
  emits: ["ready"],
6183
6273
  setup(o, { emit: s }) {
6184
6274
  let c = o, l = s, u = a(() => c.translations);
6185
- n("translations", c.translations);
6186
- let d = e(c.planConfig);
6187
- n(Fe, {
6188
- config: d,
6275
+ n(Pe, e(c.translations));
6276
+ let d = {
6277
+ config: e(c.planConfig),
6189
6278
  isLoading: e(!1),
6190
6279
  hasFeature: (e) => c.planConfig.features[e] ?? !1,
6191
6280
  features: a(() => c.planConfig.features),
6192
6281
  fetchConfig: async () => {}
6193
- });
6194
- let f = a(() => c.planConfig.storage.used_bytes ?? 0), m = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: g } = Le(), _ = Ra({
6282
+ };
6283
+ n(Me, d);
6284
+ let f = a(() => c.planConfig.storage.used_bytes ?? 0), m = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: g } = Ue(d), _ = Wa({
6195
6285
  projectId: c.projectId,
6196
6286
  authManager: c.authManager,
6197
6287
  onError: c.onError
6198
- }), y = za({
6288
+ }), y = Ga({
6199
6289
  library: _,
6200
6290
  translations: u
6201
6291
  });
@@ -6209,12 +6299,12 @@ var Ba = {
6209
6299
  }
6210
6300
  return v(() => {
6211
6301
  _.loadItems(), _.loadFrequentlyUsed(), l("ready");
6212
- }), (e, n) => (z(), t("div", Ba, [
6213
- i("div", Va, [i("h2", Ha, I(u.value.mediaLibrary.title), 1), i("div", Ua, [p(Ia, {
6302
+ }), (e, n) => (z(), t("div", Ka, [
6303
+ i("div", qa, [i("h2", Ja, I(u.value.mediaLibrary.title), 1), i("div", Ya, [p(Ha, {
6214
6304
  "used-bytes": f.value,
6215
6305
  "limit-bytes": m.value,
6216
6306
  size: 22
6217
- }, null, 8, ["used-bytes", "limit-bytes"]), i("div", Wa, [i("input", {
6307
+ }, null, 8, ["used-bytes", "limit-bytes"]), i("div", Xa, [i("input", {
6218
6308
  value: A(y).searchInput.value,
6219
6309
  type: "text",
6220
6310
  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)]",
@@ -6225,13 +6315,13 @@ var Ba = {
6225
6315
  },
6226
6316
  placeholder: u.value.mediaLibrary.searchPlaceholder,
6227
6317
  onInput: n[0] ||= (e) => A(y).handleSearchInput(e.target.value)
6228
- }, null, 40, Ga), p(A(se), {
6318
+ }, null, 40, Za), p(A(se), {
6229
6319
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
6230
6320
  size: 13,
6231
6321
  "stroke-width": 2,
6232
6322
  style: { color: "var(--tpl-text-dim)" }
6233
6323
  })])])]),
6234
- i("div", Ka, [p(ve, {
6324
+ i("div", Qa, [p(ve, {
6235
6325
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
6236
6326
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
6237
6327
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -6239,7 +6329,7 @@ var Ba = {
6239
6329
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
6240
6330
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
6241
6331
  }, {
6242
- default: P(() => [A(y).showSidebar.value ? (z(), t("div", qa, [p(Or, {
6332
+ default: P(() => [A(y).showSidebar.value ? (z(), t("div", $a, [p(Pr, {
6243
6333
  folders: A(_).folders.value,
6244
6334
  "current-folder-id": A(_).currentFolderId.value,
6245
6335
  "view-mode": A(_).viewMode.value,
@@ -6261,7 +6351,7 @@ var Ba = {
6261
6351
  "onShowFrequentlyUsed"
6262
6352
  ])])) : M("", !0)]),
6263
6353
  _: 1
6264
- }), i("div", Ja, [i("div", Ya, [i("div", Xa, [
6354
+ }), i("div", eo, [i("div", to, [i("div", no, [
6265
6355
  i("button", {
6266
6356
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
6267
6357
  style: N({
@@ -6274,8 +6364,8 @@ var Ba = {
6274
6364
  }, [p(A(ne), {
6275
6365
  size: 16,
6276
6366
  "stroke-width": 2
6277
- })], 12, Za),
6278
- A(_).viewMode.value === "frequently-used" ? (z(), t("span", Qa, I(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(Pe, {
6367
+ })], 12, ro),
6368
+ A(_).viewMode.value === "frequently-used" ? (z(), t("span", io, I(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(He, {
6279
6369
  key: 1,
6280
6370
  folders: A(_).folders.value,
6281
6371
  "current-folder-id": A(_).currentFolderId.value,
@@ -6285,7 +6375,7 @@ var Ba = {
6285
6375
  "current-folder-id",
6286
6376
  "onNavigate"
6287
6377
  ])),
6288
- i("div", $a, [i("button", {
6378
+ i("div", ao, [i("button", {
6289
6379
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6290
6380
  style: N({
6291
6381
  color: A(y).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
@@ -6296,7 +6386,7 @@ var Ba = {
6296
6386
  }, [p(A(k), {
6297
6387
  size: 14,
6298
6388
  "stroke-width": 2
6299
- })], 12, eo), i("button", {
6389
+ })], 12, oo), i("button", {
6300
6390
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6301
6391
  style: N({
6302
6392
  color: A(y).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
@@ -6307,8 +6397,8 @@ var Ba = {
6307
6397
  }, [p(A(_e), {
6308
6398
  size: 14,
6309
6399
  "stroke-width": 2
6310
- })], 12, to)])
6311
- ]), i("div", no, [A(g).length > 1 ? (z(), t("select", {
6400
+ })], 12, so)])
6401
+ ]), i("div", co, [A(g).length > 1 ? (z(), t("select", {
6312
6402
  key: 0,
6313
6403
  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",
6314
6404
  style: {
@@ -6318,10 +6408,10 @@ var Ba = {
6318
6408
  },
6319
6409
  value: A(_).categoryFilter.value ?? "",
6320
6410
  onChange: n[4] ||= (e) => A(_).filterByCategory(e.target.value || null)
6321
- }, [i("option", io, I(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(A(g), (e) => (z(), t("option", {
6411
+ }, [i("option", uo, I(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(A(g), (e) => (z(), t("option", {
6322
6412
  key: e,
6323
6413
  value: e
6324
- }, I(A(y).getCategoryLabel(e)), 9, ao))), 128))], 40, ro)) : M("", !0), i("select", {
6414
+ }, I(A(y).getCategoryLabel(e)), 9, fo))), 128))], 40, lo)) : M("", !0), i("select", {
6325
6415
  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",
6326
6416
  style: {
6327
6417
  "border-color": "var(--tpl-border)",
@@ -6331,13 +6421,13 @@ var Ba = {
6331
6421
  value: A(_).sortOption.value,
6332
6422
  onChange: n[5] ||= (e) => A(_).sortBy(e.target.value)
6333
6423
  }, [
6334
- i("option", so, I(u.value.mediaLibrary.sortNewest), 1),
6335
- i("option", co, I(u.value.mediaLibrary.sortOldest), 1),
6336
- i("option", lo, I(u.value.mediaLibrary.sortNameAsc), 1),
6337
- i("option", uo, I(u.value.mediaLibrary.sortNameDesc), 1),
6338
- i("option", fo, I(u.value.mediaLibrary.sortSizeAsc), 1),
6339
- i("option", po, I(u.value.mediaLibrary.sortSizeDesc), 1)
6340
- ], 40, oo)])]), i("div", mo, [A(_).viewMode.value === "files" ? (z(), t("div", ho, [p(ja, {
6424
+ i("option", mo, I(u.value.mediaLibrary.sortNewest), 1),
6425
+ i("option", ho, I(u.value.mediaLibrary.sortOldest), 1),
6426
+ i("option", go, I(u.value.mediaLibrary.sortNameAsc), 1),
6427
+ i("option", _o, I(u.value.mediaLibrary.sortNameDesc), 1),
6428
+ i("option", vo, I(u.value.mediaLibrary.sortSizeAsc), 1),
6429
+ i("option", yo, I(u.value.mediaLibrary.sortSizeDesc), 1)
6430
+ ], 40, po)])]), i("div", bo, [A(_).viewMode.value === "files" ? (z(), t("div", xo, [p(La, {
6341
6431
  "is-uploading": A(_).isUploading.value,
6342
6432
  "upload-progress": A(_).uploadProgress.value,
6343
6433
  onUpload: A(y).handleUpload
@@ -6356,7 +6446,7 @@ var Ba = {
6356
6446
  }, [p(A(re), {
6357
6447
  size: 14,
6358
6448
  "stroke-width": 2
6359
- }), j(" " + I(u.value.mediaLibrary.importFromUrl), 1)])])) : M("", !0), p(Li, {
6449
+ }), j(" " + I(u.value.mediaLibrary.importFromUrl), 1)])])) : M("", !0), p(Ui, {
6360
6450
  items: A(y).displayItems.value,
6361
6451
  "selected-ids": A(_).selectedItems.value,
6362
6452
  "is-loading": A(_).isLoading.value,
@@ -6379,7 +6469,7 @@ var Ba = {
6379
6469
  "onEdit",
6380
6470
  "onReplace"
6381
6471
  ])])])]),
6382
- p(Yi, {
6472
+ p(ta, {
6383
6473
  visible: A(y).showImportUrlModal.value,
6384
6474
  "is-importing": A(_).isImportingFromUrl.value,
6385
6475
  error: A(_).importFromUrlError.value,
@@ -6391,7 +6481,7 @@ var Ba = {
6391
6481
  "error",
6392
6482
  "onImport"
6393
6483
  ]),
6394
- p(gr, {
6484
+ p(Sr, {
6395
6485
  visible: !!A(y).editingItem.value,
6396
6486
  item: A(y).editingItem.value,
6397
6487
  onSave: A(y).handleEditSave,
@@ -6401,7 +6491,7 @@ var Ba = {
6401
6491
  "item",
6402
6492
  "onSave"
6403
6493
  ]),
6404
- p(Ea, {
6494
+ p(Ma, {
6405
6495
  visible: A(_).showReplaceWarning.value,
6406
6496
  item: A(_).pendingReplaceItem.value,
6407
6497
  "usage-info": A(_).replaceUsageInfo.value,
@@ -6435,19 +6525,19 @@ var Ba = {
6435
6525
  "-webkit-backdrop-filter": "blur(8px)"
6436
6526
  },
6437
6527
  onClick: n[11] ||= r((...e) => A(_).cancelDelete && A(_).cancelDelete(...e), ["self"])
6438
- }, [i("div", go, [
6439
- i("h3", _o, I(u.value.mediaLibrary.deleteWarningTitle), 1),
6528
+ }, [i("div", So, [
6529
+ i("h3", Co, I(u.value.mediaLibrary.deleteWarningTitle), 1),
6440
6530
  i("p", {
6441
6531
  class: O(["tpl:text-xs", A(y).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
6442
6532
  style: { color: "var(--tpl-text-muted)" }
6443
6533
  }, I(u.value.mediaLibrary.deleteWarningMessage), 3),
6444
- A(y).hasUsedFiles.value ? (z(), t("p", vo, I(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : M("", !0),
6445
- A(y).hasUsedFiles.value ? (z(), t("div", yo, [(z(!0), t(R, null, S(A(_).deleteUsageInfo.value, (e, n) => (z(), t("div", {
6534
+ A(y).hasUsedFiles.value ? (z(), t("p", wo, I(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : M("", !0),
6535
+ A(y).hasUsedFiles.value ? (z(), t("div", To, [(z(!0), t(R, null, S(A(_).deleteUsageInfo.value, (e, n) => (z(), t("div", {
6446
6536
  key: n,
6447
6537
  class: "tpl:text-xs",
6448
6538
  style: { color: "var(--tpl-text)" }
6449
- }, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", bo, I(A(y).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", xo, " - " + I(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : M("", !0)]))), 128))])) : M("", !0),
6450
- i("div", So, [i("button", {
6539
+ }, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", Eo, I(A(y).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", Do, " - " + I(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : M("", !0)]))), 128))])) : M("", !0),
6540
+ i("div", Oo, [i("button", {
6451
6541
  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",
6452
6542
  style: {
6453
6543
  "border-color": "var(--tpl-border)",
@@ -6467,7 +6557,7 @@ var Ba = {
6467
6557
  ])])) : M("", !0)]),
6468
6558
  _: 1
6469
6559
  }),
6470
- i("div", Co, [i("div", wo, [A(_).previewItem.value ? (z(), h(da, {
6560
+ i("div", ko, [i("div", Ao, [A(_).previewItem.value ? (z(), h(_a, {
6471
6561
  key: 0,
6472
6562
  "selected-conversion": A(y).selectedConversion.value,
6473
6563
  "onUpdate:selectedConversion": n[12] ||= (e) => A(y).selectedConversion.value = e,
@@ -6477,7 +6567,7 @@ var Ba = {
6477
6567
  "selected-conversion",
6478
6568
  "item",
6479
6569
  "folders"
6480
- ])) : M("", !0)]), i("div", To, [A(_).selectedItems.value.size > 0 ? (z(), t("div", Eo, [A(_).previewItem.value ? (z(), t("button", {
6570
+ ])) : M("", !0)]), i("div", jo, [A(_).selectedItems.value.size > 0 ? (z(), t("div", Mo, [A(_).previewItem.value ? (z(), t("button", {
6481
6571
  key: 0,
6482
6572
  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",
6483
6573
  style: N({
@@ -6494,7 +6584,7 @@ var Ba = {
6494
6584
  key: 0,
6495
6585
  size: 12,
6496
6586
  "stroke-width": 2
6497
- })), j(" " + I(A(y).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : M("", !0), i("div", Do, [i("button", {
6587
+ })), j(" " + I(A(y).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : M("", !0), i("div", No, [i("button", {
6498
6588
  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",
6499
6589
  style: {
6500
6590
  "border-color": "var(--tpl-border)",
@@ -6502,7 +6592,7 @@ var Ba = {
6502
6592
  "background-color": "var(--tpl-bg)"
6503
6593
  },
6504
6594
  onClick: n[14] ||= (e) => A(y).showMovePicker.value = !A(y).showMovePicker.value
6505
- }, I(u.value.mediaLibrary.moveSelected), 1), A(y).showMovePicker.value ? (z(), h(ea, {
6595
+ }, I(u.value.mediaLibrary.moveSelected), 1), A(y).showMovePicker.value ? (z(), h(oa, {
6506
6596
  key: 0,
6507
6597
  folders: A(_).folders.value,
6508
6598
  "current-folder-id": A(_).currentFolderId.value,
@@ -6512,7 +6602,7 @@ var Ba = {
6512
6602
  "folders",
6513
6603
  "current-folder-id",
6514
6604
  "onSelect"
6515
- ])) : M("", !0)])])) : M("", !0), i("div", Oo, [A(_).selectedItems.value.size > 0 ? (z(), t("button", {
6605
+ ])) : M("", !0)])])) : M("", !0), i("div", Po, [A(_).selectedItems.value.size > 0 ? (z(), t("button", {
6516
6606
  key: 0,
6517
6607
  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",
6518
6608
  style: {
@@ -6530,85 +6620,85 @@ var Ba = {
6530
6620
  },
6531
6621
  disabled: !A(_).previewItem.value,
6532
6622
  onClick: b
6533
- }, I(u.value.mediaLibrary.selectFile), 9, ko)) : M("", !0)])])])
6623
+ }, I(u.value.mediaLibrary.selectFile), 9, Fo)) : M("", !0)])])])
6534
6624
  ]));
6535
6625
  }
6536
- }), jo = /* #__PURE__ */ Object.assign({
6626
+ }), Lo = /* #__PURE__ */ Object.assign({
6537
6627
  "./locales/ca.ts": () => import("./chunks/ca-DnghH5Xn.js"),
6538
6628
  "./locales/de.ts": () => import("./chunks/de-ByQyu2jv.js"),
6539
- "./locales/en.ts": () => import("./chunks/en-B-xajqfh.js"),
6629
+ "./locales/en.ts": () => Promise.resolve().then(() => Ie),
6540
6630
  "./locales/es.ts": () => import("./chunks/es-Bcp-DbmC.js"),
6541
6631
  "./locales/fr.ts": () => import("./chunks/fr-DXb0cCZG.js"),
6542
6632
  "./locales/nl.ts": () => import("./chunks/nl-DGT1t3Be.js"),
6543
6633
  "./locales/pt-BR.ts": () => import("./chunks/pt-BR-C0Hzc26R.js")
6544
6634
  });
6545
- function Mo(e) {
6635
+ function Ro(e) {
6546
6636
  return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
6547
6637
  }
6548
- var No = Mo(jo);
6549
- function Po(e) {
6638
+ var zo = Ro(Lo);
6639
+ function Bo(e) {
6550
6640
  return e.trim().replace(/_/g, "-").toLowerCase();
6551
6641
  }
6552
- function Fo(e) {
6553
- let t = Po(e);
6554
- return No.find((e) => Po(e) === t);
6642
+ function Vo(e) {
6643
+ let t = Bo(e);
6644
+ return zo.find((e) => Bo(e) === t);
6555
6645
  }
6556
- function Io(e) {
6557
- return Po(e).split("-")[0];
6646
+ function Ho(e) {
6647
+ return Bo(e).split("-")[0];
6558
6648
  }
6559
- function Lo(e) {
6560
- return Fo(e) ?? Fo(Io(e)) ?? "en";
6649
+ function Uo(e) {
6650
+ return Vo(e) ?? Vo(Ho(e)) ?? "en";
6561
6651
  }
6562
- async function Ro(e) {
6563
- let t = jo[`./locales/${Lo(e)}.ts`];
6652
+ async function Wo(e) {
6653
+ let t = Lo[`./locales/${Uo(e)}.ts`];
6564
6654
  return (await t()).default;
6565
6655
  }
6566
6656
  //#endregion
6567
6657
  //#region src/standalone/visual.ts
6568
- var zo = null, Bo = e(null);
6569
- async function Vo(e) {
6658
+ var Go = null, Ko = e(null);
6659
+ async function qo(e) {
6570
6660
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
6571
6661
  if (!t) throw Error(`Container element not found: ${e.container}`);
6572
- let n = Ce(e.auth, e.onError);
6662
+ let n = Te(e.auth, e.onError);
6573
6663
  await n.initialize();
6574
- let r = await new ke(n).fetchConfig(), i = await Ro(e.locale ?? "en");
6575
- return Uo(t, e.theme), zo && Ho(), new Promise((a, s) => {
6664
+ let r = await new je(n).fetchConfig(), i = await Wo(e.locale ?? "en");
6665
+ return Yo(t, e.theme), Go && Jo(), new Promise((a, s) => {
6576
6666
  try {
6577
- zo = be({ setup() {
6667
+ Go = be({ setup() {
6578
6668
  let s = () => {
6579
6669
  a({
6580
- setTheme: (e) => Uo(t, e),
6581
- unmount: Ho
6670
+ setTheme: (e) => Yo(t, e),
6671
+ unmount: Jo
6582
6672
  });
6583
6673
  };
6584
- return () => o(Ao, {
6674
+ return () => o(Io, {
6585
6675
  authManager: n,
6586
6676
  projectId: n.projectId,
6587
6677
  planConfig: r,
6588
6678
  translations: i,
6589
6679
  onSelect: e.onSelect,
6590
6680
  onError: e.onError,
6591
- ref: Bo,
6681
+ ref: Ko,
6592
6682
  onReady: s
6593
6683
  });
6594
- } }), zo.mount(t);
6684
+ } }), Go.mount(t);
6595
6685
  } catch (e) {
6596
6686
  s(e);
6597
6687
  }
6598
6688
  });
6599
6689
  }
6600
- function Ho() {
6601
- zo && (zo.unmount(), zo = null, Bo.value = null);
6690
+ function Jo() {
6691
+ Go && (Go.unmount(), Go = null, Ko.value = null);
6602
6692
  }
6603
- function Uo(e, t) {
6693
+ function Yo(e, t) {
6604
6694
  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`)));
6605
6695
  }
6606
- var Wo = {
6607
- init: Vo,
6608
- unmount: Ho
6696
+ var Xo = {
6697
+ init: qo,
6698
+ unmount: Jo
6609
6699
  };
6610
- typeof window < "u" && (window.TemplaticalMedia = Wo);
6700
+ typeof window < "u" && (window.TemplaticalMedia = Xo);
6611
6701
  //#endregion
6612
- export { Wo as default, Vo as init, Ho as unmount };
6702
+ export { Xo as default, qo as init, Jo as unmount };
6613
6703
 
6614
6704
  //# sourceMappingURL=media-library.js.map