@templatical/media-library 0.26.3 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,13 @@
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 T, Z as E, _ as D, a as O, at as k, b as ee, c as te, d as ne, et as re, f as ie, 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 {
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 \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,51 +149,51 @@ 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
- "snapshots.index": `${V}/snapshots`,
157
- "snapshots.store": `${V}/snapshots`,
158
- "snapshots.show": `${V}/snapshots/{snapshot}`,
159
- "snapshots.restore": `${V}/snapshots/{snapshot}/restore`,
163
+ "versions.index": `${V}/versions`,
164
+ "versions.store": `${V}/versions`,
165
+ "versions.show": `${V}/versions/{version}`,
166
+ "versions.restore": `${V}/versions/{version}/restore`,
160
167
  "comments.index": `${V}/comments`,
161
168
  "comments.store": `${V}/comments`,
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
  }
@@ -225,10 +232,13 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
225
232
  }
226
233
  return e.message;
227
234
  }
228
- async createTemplate(e) {
235
+ async createTemplate(e, t) {
229
236
  return this.request(B(H["templates.store"], this.baseParams), {
230
237
  method: "POST",
231
- body: JSON.stringify({ content: e })
238
+ body: JSON.stringify(t === void 0 ? { content: e } : {
239
+ content: e,
240
+ name: t
241
+ })
232
242
  });
233
243
  }
234
244
  async getTemplate(e) {
@@ -243,16 +253,19 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
243
253
  template: e
244
254
  }), {
245
255
  method: "PUT",
246
- body: JSON.stringify({ content: t })
256
+ body: JSON.stringify(t)
247
257
  });
248
258
  }
249
- async createSnapshot(e, t) {
250
- return this.request(B(H["snapshots.store"], {
259
+ async createVersion(e, t, n) {
260
+ return this.request(B(H["versions.store"], {
251
261
  ...this.baseParams,
252
262
  template: e
253
263
  }), {
254
264
  method: "POST",
255
- body: JSON.stringify({ content: t })
265
+ body: JSON.stringify(n === void 0 ? { content: t } : {
266
+ content: t,
267
+ label: n
268
+ })
256
269
  });
257
270
  }
258
271
  async deleteTemplate(e) {
@@ -261,17 +274,24 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
261
274
  template: e
262
275
  }), { method: "DELETE" });
263
276
  }
264
- async getSnapshots(e) {
265
- return this.request(B(H["snapshots.index"], {
277
+ async getVersions(e) {
278
+ return this.request(B(H["versions.index"], {
266
279
  ...this.baseParams,
267
280
  template: e
268
281
  }));
269
282
  }
270
- async restoreSnapshot(e, t) {
271
- return this.request(B(H["snapshots.restore"], {
283
+ async getVersion(e, t) {
284
+ return this.request(B(H["versions.show"], {
272
285
  ...this.baseParams,
273
286
  template: e,
274
- snapshot: t
287
+ version: t
288
+ }));
289
+ }
290
+ async restoreVersion(e, t) {
291
+ return this.request(B(H["versions.restore"], {
292
+ ...this.baseParams,
293
+ template: e,
294
+ version: t
275
295
  }), { method: "POST" });
276
296
  }
277
297
  async exportTemplate(e, t) {
@@ -371,11 +391,94 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
371
391
  savedModule: e
372
392
  }), { method: "DELETE" });
373
393
  }
374
- };
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
+ } };
375
478
  //#endregion
376
479
  //#region src/composables/useI18n.ts
377
- function Ae(e) {
378
- 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;
379
482
  function r(e, t) {
380
483
  return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
381
484
  }
@@ -386,14 +489,14 @@ function Ae(e) {
386
489
  }
387
490
  //#endregion
388
491
  //#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
389
- var je = {
492
+ var ze = {
390
493
  key: 0,
391
494
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
392
495
  style: { color: "var(--tpl-text-muted)" }
393
- }, Me = ["onClick"], Ne = {
496
+ }, Be = ["onClick"], Ve = {
394
497
  key: 1,
395
498
  style: { color: "var(--tpl-text)" }
396
- }, Pe = /* @__PURE__ */ m({
499
+ }, He = /* @__PURE__ */ m({
397
500
  __name: "MediaBreadcrumb",
398
501
  props: {
399
502
  folders: {},
@@ -401,7 +504,7 @@ var je = {
401
504
  },
402
505
  emits: ["navigate"],
403
506
  setup(e, { emit: n }) {
404
- let r = e, o = n, { t: s } = Ae(), c = a(() => {
507
+ let r = e, o = n, { t: s } = Re(), c = a(() => {
405
508
  if (!r.currentFolderId) return [];
406
509
  let e = [];
407
510
  return l(r.folders, r.currentFolderId, e), e;
@@ -413,7 +516,7 @@ var je = {
413
516
  }
414
517
  return !1;
415
518
  }
416
- 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", {
417
520
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
418
521
  style: { color: "var(--tpl-primary)" },
419
522
  onClick: n[0] ||= (e) => o("navigate", null)
@@ -425,45 +528,47 @@ var je = {
425
528
  class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
426
529
  style: { color: "var(--tpl-primary)" },
427
530
  onClick: (t) => o("navigate", e.id)
428
- }, 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);
429
532
  }
430
533
  });
431
534
  //#endregion
432
535
  //#region src/composables/useMediaCategories.ts
433
- function Fe() {
434
- let e = l("planConfig"), 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);
435
- function c(e, t) {
436
- return r.value ? !t || t.length === 0 ? i.value.includes(e) : t.some((t) => r.value[t]?.mime_types.includes(e)) : !1;
437
- }
438
- function u(e) {
439
- 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;
440
542
  }
441
543
  function d(e) {
442
- if (!r.value) return null;
443
- 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;
444
549
  return null;
445
550
  }
446
551
  return {
447
- isMediaLibraryEnabled: n,
448
- allAcceptedMimeTypes: i,
449
- allAcceptedInputString: o,
450
- maxFileSize: s,
451
- availableCategories: a(() => r.value ? Object.keys(r.value) : []),
452
- isAcceptedMimeType: c,
453
- isImageMimeType: u,
454
- 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
455
560
  };
456
561
  }
457
562
  //#endregion
458
563
  //#region src/composables/useImageCrop.ts
459
- var Ie = {
564
+ var We = {
460
565
  free: void 0,
461
566
  square: 1,
462
567
  landscape43: 4 / 3,
463
568
  landscape169: 16 / 9,
464
569
  original: void 0
465
570
  };
466
- function Le(e) {
571
+ function Ge(e) {
467
572
  return e === "image/png" || e === "image/gif" ? {
468
573
  mimeType: "image/png",
469
574
  quality: 1
@@ -475,7 +580,7 @@ function Le(e) {
475
580
  quality: .92
476
581
  };
477
582
  }
478
- function Re(e, t, n) {
583
+ function Ke(e, t, n) {
479
584
  let r = e.width, i = e.height;
480
585
  if (!t && !n) return e;
481
586
  let a = r, o = i;
@@ -489,7 +594,7 @@ function Re(e, t, n) {
489
594
  let c = s.getContext("2d");
490
595
  return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
491
596
  }
492
- function ze(e, t, n) {
597
+ function qe(e, t, n) {
493
598
  return new Promise((r, i) => {
494
599
  e.toBlob((e) => {
495
600
  if (!e) {
@@ -501,7 +606,7 @@ function ze(e, t, n) {
501
606
  }, n.mimeType, n.quality);
502
607
  });
503
608
  }
504
- function Be(e, t, n, r) {
609
+ function Je(e, t, n, r) {
505
610
  let i = e, a = t;
506
611
  if (n && i > n) {
507
612
  let e = n / i;
@@ -517,11 +622,8 @@ function Be(e, t, n, r) {
517
622
  };
518
623
  }
519
624
  //#endregion
520
- //#region src/keys.ts
521
- var Ve = Symbol("templaticalMediaPopoverTarget");
522
- //#endregion
523
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
524
- function He(e, t) {
626
+ function Ye(e, t) {
525
627
  var n = Object.keys(e);
526
628
  if (Object.getOwnPropertySymbols) {
527
629
  var r = Object.getOwnPropertySymbols(e);
@@ -534,9 +636,9 @@ function He(e, t) {
534
636
  function U(e) {
535
637
  for (var t = 1; t < arguments.length; t++) {
536
638
  var n = arguments[t] == null ? {} : arguments[t];
537
- t % 2 ? He(Object(n), !0).forEach((function(t) {
639
+ t % 2 ? Ye(Object(n), !0).forEach((function(t) {
538
640
  W(e, t, n[t]);
539
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : He(Object(n)).forEach((function(t) {
641
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ye(Object(n)).forEach((function(t) {
540
642
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
541
643
  }));
542
644
  }
@@ -550,7 +652,7 @@ function W(e, t, n) {
550
652
  writable: !0
551
653
  }) : e[t] = n, e;
552
654
  }
553
- function Ue(e, t) {
655
+ function Xe(e, t) {
554
656
  if (e == null) return {};
555
657
  var n, r, i = function(e, t) {
556
658
  if (e == null) return {};
@@ -564,28 +666,28 @@ function Ue(e, t) {
564
666
  }
565
667
  return i;
566
668
  }
567
- function We(e) {
669
+ function Ze(e) {
568
670
  return function(e) {
569
- if (Array.isArray(e)) return Ge(e);
671
+ if (Array.isArray(e)) return Qe(e);
570
672
  }(e) || function(e) {
571
673
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
572
674
  }(e) || function(e, t) {
573
675
  if (e) {
574
- if (typeof e == "string") return Ge(e, t);
676
+ if (typeof e == "string") return Qe(e, t);
575
677
  var n = Object.prototype.toString.call(e).slice(8, -1);
576
678
  if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
577
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ge(e, t);
679
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Qe(e, t);
578
680
  }
579
681
  }(e) || function() {
580
682
  throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
581
683
  }();
582
684
  }
583
- function Ge(e, t) {
685
+ function Qe(e, t) {
584
686
  (t == null || t > e.length) && (t = e.length);
585
687
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
586
688
  return r;
587
689
  }
588
- var Ke, qe, Je, G = (Ke = function(e) {
690
+ var $e, et, tt, G = ($e = function(e) {
589
691
  (function() {
590
692
  var t = {}.hasOwnProperty;
591
693
  function n() {
@@ -609,15 +711,15 @@ var Ke, qe, Je, G = (Ke = function(e) {
609
711
  }
610
712
  e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
611
713
  })();
612
- }, Ke(Je = {
613
- path: qe,
714
+ }, $e(tt = {
715
+ path: et,
614
716
  exports: {},
615
717
  require: function(e, t) {
616
718
  return function() {
617
719
  throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
618
- }(t == null && Je.path);
720
+ }(t == null && tt.path);
619
721
  }
620
- }, Je.exports), Je.exports), Ye = function(e) {
722
+ }, tt.exports), tt.exports), nt = function(e) {
621
723
  return function(t, n) {
622
724
  if (!t) return e;
623
725
  var r;
@@ -629,7 +731,7 @@ var Ke, qe, Je, G = (Ke = function(e) {
629
731
  }), "") : "");
630
732
  };
631
733
  };
632
- function Xe(e, t, n) {
734
+ function rt(e, t, n) {
633
735
  var r, i, a, o, s;
634
736
  function c() {
635
737
  var l = Date.now() - o;
@@ -647,65 +749,65 @@ function Xe(e, t, n) {
647
749
  r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
648
750
  }, l;
649
751
  }
650
- Xe.debounce = Xe;
651
- var Ze = Xe, K = function() {
752
+ rt.debounce = rt;
753
+ var it = rt, K = function() {
652
754
  return K = Object.assign || function(e) {
653
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]);
654
756
  return e;
655
757
  }, K.apply(this, arguments);
656
758
  };
657
- function Qe(e, t) {
759
+ function at(e, t) {
658
760
  var n, r;
659
761
  return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
660
762
  name: n,
661
763
  classname: r
662
764
  };
663
765
  }
664
- function $e(e) {
766
+ function ot(e) {
665
767
  return /^blob:/.test(e);
666
768
  }
667
- function et(e) {
668
- return $e(e) || function(e) {
769
+ function st(e) {
770
+ return ot(e) || function(e) {
669
771
  return /^data:/.test(e);
670
772
  }(e);
671
773
  }
672
- function tt(e) {
774
+ function ct(e) {
673
775
  return !!(e && e.constructor && e.call && e.apply);
674
776
  }
675
777
  function q(e) {
676
778
  return e === void 0;
677
779
  }
678
- function nt(e) {
780
+ function lt(e) {
679
781
  return typeof e == "object" && !!e;
680
782
  }
681
- function rt(e, t, n) {
783
+ function ut(e, t, n) {
682
784
  var r = {};
683
- return nt(e) ? (Object.keys(t).forEach((function(i) {
684
- r[i] = q(e[i]) ? t[i] : nt(t[i]) ? nt(e[i]) ? rt(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];
685
787
  })), r) : e ? t : n;
686
788
  }
687
- function it(e) {
789
+ function dt(e) {
688
790
  var t = Number(e);
689
791
  return Number.isNaN(t) ? e : t;
690
792
  }
691
- function at(e) {
793
+ function ft(e) {
692
794
  return typeof (e == "number" || function(e) {
693
795
  return typeof e == "object" && !!e;
694
- }(e) && toString.call(e) == "[object Number]") && !ot(e);
796
+ }(e) && toString.call(e) == "[object Number]") && !pt(e);
695
797
  }
696
- function ot(e) {
798
+ function pt(e) {
697
799
  return e != e;
698
800
  }
699
- function st(e, t) {
801
+ function mt(e, t) {
700
802
  return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
701
803
  }
702
- var ct = function(e, t) {
804
+ var ht = function(e, t) {
703
805
  e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
704
- }, lt = function(e, t) {
806
+ }, gt = function(e, t) {
705
807
  t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
706
- }, ut = function(e) {
808
+ }, _t = function(e) {
707
809
  this.type = "move", this.directions = e;
708
- }, dt = function() {
810
+ }, vt = function() {
709
811
  function e(e, t, n, r, i) {
710
812
  this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
711
813
  }
@@ -723,7 +825,7 @@ var ct = function(e, t) {
723
825
  top: 0
724
826
  };
725
827
  }, e;
726
- }(), ft = {
828
+ }(), yt = {
727
829
  name: "DraggableElement",
728
830
  props: { classname: { type: String } },
729
831
  beforeMount: function() {
@@ -744,7 +846,7 @@ var ct = function(e, t) {
744
846
  this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
745
847
  },
746
848
  onTouchStart: function(e) {
747
- e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = We(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) {
748
850
  return {
749
851
  clientX: t.clientX + n.clientX / e.touches.length,
750
852
  clientY: t.clientY + n.clientY / e.touches.length
@@ -790,11 +892,11 @@ var ct = function(e, t) {
790
892
  };
791
893
  },
792
894
  processMove: function(e, t) {
793
- var n = We(t);
895
+ var n = Ze(t);
794
896
  if (this.touches.length) {
795
897
  if (this.touches.length === 1 && n.length === 1) {
796
898
  var r = this.$refs.draggable;
797
- this.$emit("drag", new dt(e, r, {
899
+ this.$emit("drag", new vt(e, r, {
798
900
  left: n[0].clientX,
799
901
  top: n[0].clientY
800
902
  }, {
@@ -816,7 +918,7 @@ var ct = function(e, t) {
816
918
  "enter"
817
919
  ]
818
920
  };
819
- ft.render = function(e, t, n, r, i, a) {
921
+ yt.render = function(e, t, n, r, i, a) {
820
922
  return z(), h("div", {
821
923
  ref: "draggable",
822
924
  class: n.classname,
@@ -834,9 +936,9 @@ ft.render = function(e, t, n, r, i, a) {
834
936
  }
835
937
  }, [c(e.$slots, "default")], 34);
836
938
  };
837
- var pt = Ye("vue-handler-wrapper"), mt = {
939
+ var bt = nt("vue-handler-wrapper"), xt = {
838
940
  name: "HandlerWrapper",
839
- components: { DraggableElement: ft },
941
+ components: { DraggableElement: yt },
840
942
  props: {
841
943
  horizontalPosition: { type: String },
842
944
  verticalPosition: { type: String },
@@ -848,12 +950,12 @@ var pt = Ye("vue-handler-wrapper"), mt = {
848
950
  computed: { classes: function() {
849
951
  var e;
850
952
  if (this.horizontalPosition || this.verticalPosition) {
851
- var t, n = Qe(this.horizontalPosition, this.verticalPosition);
852
- e = pt((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
853
- } else e = pt({ 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 });
854
956
  return {
855
957
  root: e,
856
- draggable: pt("draggable")
958
+ draggable: bt("draggable")
857
959
  };
858
960
  } },
859
961
  emits: [
@@ -863,7 +965,7 @@ var pt = Ye("vue-handler-wrapper"), mt = {
863
965
  "drag-end"
864
966
  ]
865
967
  };
866
- mt.render = function(e, t, n, r, i, a) {
968
+ xt.render = function(e, t, n, r, i, a) {
867
969
  var o = x("DraggableElement");
868
970
  return z(), h("div", { class: a.classes.root }, [p(o, {
869
971
  class: a.classes.draggable,
@@ -886,9 +988,9 @@ mt.render = function(e, t, n, r, i, a) {
886
988
  _: 3
887
989
  }, 8, ["class"])], 2);
888
990
  };
889
- var ht = Ye("vue-line-wrapper"), gt = {
991
+ var St = nt("vue-line-wrapper"), Ct = {
890
992
  name: "LineWrapper",
891
- components: { DraggableElement: ft },
993
+ components: { DraggableElement: yt },
892
994
  props: {
893
995
  position: {
894
996
  type: String,
@@ -901,7 +1003,7 @@ var ht = Ye("vue-line-wrapper"), gt = {
901
1003
  },
902
1004
  computed: { classname: function() {
903
1005
  var e;
904
- return ht((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));
905
1007
  } },
906
1008
  emits: [
907
1009
  "leave",
@@ -910,7 +1012,7 @@ var ht = Ye("vue-line-wrapper"), gt = {
910
1012
  "drag-end"
911
1013
  ]
912
1014
  };
913
- gt.render = function(e, t, n, r, i, a) {
1015
+ Ct.render = function(e, t, n, r, i, a) {
914
1016
  var o = x("DraggableElement");
915
1017
  return z(), h(o, {
916
1018
  class: a.classname,
@@ -933,23 +1035,23 @@ gt.render = function(e, t, n, r, i, a) {
933
1035
  _: 3
934
1036
  }, 8, ["class"]);
935
1037
  };
936
- var _t = [
1038
+ var wt = [
937
1039
  "left",
938
1040
  "right",
939
1041
  "top",
940
1042
  "bottom"
941
- ], vt = ["left", "right"], yt = ["top", "bottom"], bt = ["left", "top"], xt = [
1043
+ ], Tt = ["left", "right"], Et = ["top", "bottom"], Dt = ["left", "top"], Ot = [
942
1044
  "fill-area",
943
1045
  "fit-area",
944
1046
  "stencil",
945
1047
  "none"
946
- ], St = {
1048
+ ], kt = {
947
1049
  left: 0,
948
1050
  top: 0,
949
1051
  width: 0,
950
1052
  height: 0
951
1053
  };
952
- function Ct(e, t, n) {
1054
+ function At(e, t, n) {
953
1055
  return !(n ||= [
954
1056
  "width",
955
1057
  "height",
@@ -959,7 +1061,7 @@ function Ct(e, t, n) {
959
1061
  return e[n] !== t[n];
960
1062
  }));
961
1063
  }
962
- function wt(e) {
1064
+ function jt(e) {
963
1065
  return {
964
1066
  left: e.left,
965
1067
  top: e.top,
@@ -967,7 +1069,7 @@ function wt(e) {
967
1069
  bottom: e.top + e.height
968
1070
  };
969
1071
  }
970
- function Tt(e, t) {
1072
+ function Mt(e, t) {
971
1073
  return {
972
1074
  left: e.left - t.left,
973
1075
  top: e.top - t.top
@@ -979,19 +1081,19 @@ function J(e) {
979
1081
  top: e.top + e.height / 2
980
1082
  };
981
1083
  }
982
- function Et(e, t) {
1084
+ function Nt(e, t) {
983
1085
  var n = {
984
1086
  left: 0,
985
1087
  top: 0,
986
1088
  right: 0,
987
1089
  bottom: 0
988
1090
  };
989
- return _t.forEach((function(r) {
990
- var i = t[r], a = wt(e)[r];
1091
+ return wt.forEach((function(r) {
1092
+ var i = t[r], a = jt(e)[r];
991
1093
  n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
992
1094
  })), n;
993
1095
  }
994
- function Dt(e, t) {
1096
+ function Pt(e, t) {
995
1097
  return {
996
1098
  left: e.left - t.left,
997
1099
  top: e.top - t.top,
@@ -999,7 +1101,7 @@ function Dt(e, t) {
999
1101
  height: e.height + t.top + t.bottom
1000
1102
  };
1001
1103
  }
1002
- function Ot(e) {
1104
+ function Ft(e) {
1003
1105
  return {
1004
1106
  left: -e.left,
1005
1107
  top: -e.top
@@ -1034,21 +1136,21 @@ function X(e, t, n, r) {
1034
1136
  function Z(e) {
1035
1137
  return e.width / e.height;
1036
1138
  }
1037
- function kt(e, t) {
1139
+ function It(e, t) {
1038
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);
1039
1141
  }
1040
- function At(e, t) {
1142
+ function Lt(e, t) {
1041
1143
  var n = {
1042
1144
  left: 0,
1043
1145
  top: 0
1044
- }, r = Et(e, t);
1146
+ }, r = Nt(e, t);
1045
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;
1046
1148
  }
1047
- function jt(e, t) {
1149
+ function Rt(e, t) {
1048
1150
  var n;
1049
1151
  return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
1050
1152
  }
1051
- function Mt(e, t) {
1153
+ function zt(e, t) {
1052
1154
  var n = Z(e), r = Z(t);
1053
1155
  return t.width < 1 / 0 && t.height < 1 / 0 ? n > r ? {
1054
1156
  width: t.width,
@@ -1064,36 +1166,36 @@ function Mt(e, t) {
1064
1166
  height: t.height
1065
1167
  } : e;
1066
1168
  }
1067
- function Nt(e, t) {
1169
+ function Bt(e, t) {
1068
1170
  var n = t * Math.PI / 180;
1069
1171
  return {
1070
1172
  width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
1071
1173
  height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
1072
1174
  };
1073
1175
  }
1074
- function Pt(e, t) {
1176
+ function Vt(e, t) {
1075
1177
  var n = t * Math.PI / 180;
1076
1178
  return {
1077
1179
  left: e.left * Math.cos(n) - e.top * Math.sin(n),
1078
1180
  top: e.left * Math.sin(n) + e.top * Math.cos(n)
1079
1181
  };
1080
1182
  }
1081
- function Ft(e, t) {
1082
- var n = Et(Q(e, t), t);
1083
- 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, kt(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, kt(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;
1084
1186
  }
1085
1187
  function Q(e, t, n) {
1086
1188
  n === void 0 && (n = !1);
1087
- var r = At(e, t);
1088
- return Y(e, n ? Ot(r) : r);
1189
+ var r = Lt(e, t);
1190
+ return Y(e, n ? Ft(r) : r);
1089
1191
  }
1090
- function It(e) {
1192
+ function Ut(e) {
1091
1193
  return {
1092
1194
  width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0,
1093
1195
  height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0
1094
1196
  };
1095
1197
  }
1096
- function Lt(e, t) {
1198
+ function Wt(e, t) {
1097
1199
  return K(K({}, e), {
1098
1200
  minWidth: Math.min(t.width, e.minWidth),
1099
1201
  minHeight: Math.min(t.height, e.minHeight),
@@ -1101,25 +1203,25 @@ function Lt(e, t) {
1101
1203
  maxHeight: Math.min(t.height, e.maxHeight)
1102
1204
  });
1103
1205
  }
1104
- function Rt(e, t, n) {
1206
+ function Gt(e, t, n) {
1105
1207
  n === void 0 && (n = !0);
1106
1208
  var r = {};
1107
- return _t.forEach((function(i) {
1209
+ return wt.forEach((function(i) {
1108
1210
  var a = e[i], o = t[i];
1109
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;
1110
1212
  })), r;
1111
1213
  }
1112
- function zt(e, t) {
1113
- return Rt(e, t, !0);
1214
+ function Kt(e, t) {
1215
+ return Gt(e, t, !0);
1114
1216
  }
1115
- function Bt(e) {
1217
+ function qt(e) {
1116
1218
  var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
1117
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));
1118
1220
  }
1119
- function Vt(e, t) {
1221
+ function Jt(e, t) {
1120
1222
  return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
1121
1223
  }
1122
- function Ht(e) {
1224
+ function Yt(e) {
1123
1225
  var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
1124
1226
  minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
1125
1227
  maximum: e.aspectRatio && e.aspectRatio.maximum || 1 / 0
@@ -1129,15 +1231,15 @@ function Ht(e) {
1129
1231
  };
1130
1232
  function o(e, a) {
1131
1233
  return a === void 0 && (a = !1), e.reduce((function(e, o) {
1132
- return Bt({
1234
+ return qt({
1133
1235
  size: o,
1134
1236
  aspectRatio: i,
1135
1237
  sizeRestrictions: r,
1136
1238
  ignoreMinimum: a
1137
- }) && (!e || Vt(o, {
1239
+ }) && (!e || Jt(o, {
1138
1240
  width: t,
1139
1241
  height: n
1140
- }) < Vt(e, {
1242
+ }) < Jt(e, {
1141
1243
  width: t,
1142
1244
  height: n
1143
1245
  })) ? o : e;
@@ -1154,7 +1256,7 @@ function Ht(e) {
1154
1256
  height: a.height,
1155
1257
  correctRatio: !0
1156
1258
  });
1157
- })), Bt({
1259
+ })), qt({
1158
1260
  size: a,
1159
1261
  aspectRatio: i,
1160
1262
  sizeRestrictions: r
@@ -1165,16 +1267,16 @@ function Ht(e) {
1165
1267
  height: c.height
1166
1268
  };
1167
1269
  }
1168
- function Ut(e) {
1270
+ function Xt(e) {
1169
1271
  var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = Y(n, t.directions);
1170
- return Y(a, At(a, i));
1272
+ return Y(a, Lt(a, i));
1171
1273
  }
1172
- function Wt(e) {
1274
+ function Zt(e) {
1173
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) {
1174
- return Ut({
1276
+ return Xt({
1175
1277
  coordinates: e,
1176
1278
  positionRestrictions: a,
1177
- event: new ut({
1279
+ event: new _t({
1178
1280
  left: t.left - e.left,
1179
1281
  top: t.top - e.top
1180
1282
  })
@@ -1187,7 +1289,7 @@ function Wt(e) {
1187
1289
  imageSize: r,
1188
1290
  visibleArea: s
1189
1291
  }) : e).width) && q(t.height) || (l = function(e, t) {
1190
- return c(K(K(K({}, e), Ht({
1292
+ return c(K(K(K({}, e), Yt({
1191
1293
  width: t.width,
1192
1294
  height: t.height,
1193
1295
  sizeRestrictions: i,
@@ -1202,9 +1304,9 @@ function Wt(e) {
1202
1304
  }(l, K(K({}, l), t))), q(t.left) && q(t.top) || (l = c(l, K(K({}, l), t)));
1203
1305
  })), l;
1204
1306
  }
1205
- function Gt(e) {
1307
+ function Qt(e) {
1206
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);
1207
- 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), Ht({
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({
1208
1310
  sizeRestrictions: o,
1209
1311
  width: d.width,
1210
1312
  height: d.height,
@@ -1213,19 +1315,19 @@ function Gt(e) {
1213
1315
  maximum: Z(p)
1214
1316
  }
1215
1317
  })));
1216
- var m = Ft(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({
1217
1319
  visibleArea: f,
1218
1320
  type: "resize"
1219
1321
  }));
1220
- return m !== 1 && (f = X(f, m), d = X(d, m)), f = Q(f = Y(f, Tt(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({
1221
1323
  visibleArea: f,
1222
1324
  type: "move"
1223
1325
  })), {
1224
- coordinates: d = Q(d, zt(wt(f), s)),
1326
+ coordinates: d = Q(d, Kt(jt(f), s)),
1225
1327
  visibleArea: f
1226
1328
  };
1227
1329
  }
1228
- function Kt(e) {
1330
+ function $t(e) {
1229
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);
1230
1332
  if (i && a && t.type !== "manipulateImage") {
1231
1333
  var l = {
@@ -1233,31 +1335,31 @@ function Kt(e) {
1233
1335
  height: 0
1234
1336
  };
1235
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));
1236
- var u = Ft(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({
1237
1339
  visibleArea: c,
1238
1340
  type: "resize"
1239
1341
  }));
1240
- c = X(c, u), u !== 1 && (l.height /= u, l.width /= u), c = Q(c = Y(c, Tt(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({
1241
1343
  visibleArea: c,
1242
1344
  type: "move"
1243
- })), s = Q(s, zt(wt(c), o));
1345
+ })), s = Q(s, Kt(jt(c), o));
1244
1346
  }
1245
1347
  return {
1246
1348
  coordinates: s,
1247
1349
  visibleArea: c
1248
1350
  };
1249
1351
  }
1250
- function qt(e) {
1352
+ function en(e) {
1251
1353
  var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = K({}, r), o = K({}, n);
1252
1354
  if (t.type === "setCoordinates") {
1253
1355
  var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
1254
- s > c ? a = X(a, Math.min(o.width / a.width, kt(a, i({
1356
+ s > c ? a = X(a, Math.min(o.width / a.width, It(a, i({
1255
1357
  visibleArea: a,
1256
1358
  type: "resize"
1257
- })))) : c > s && (a = X(a, Math.min(o.height / a.height, kt(a, i({
1359
+ })))) : c > s && (a = X(a, Math.min(o.height / a.height, It(a, i({
1258
1360
  visibleArea: a,
1259
1361
  type: "resize"
1260
- }))))), a = Q(a = Y(a, Ot(At(o, wt(a)))), i({
1362
+ }))))), a = Q(a = Y(a, Ft(Lt(o, jt(a)))), i({
1261
1363
  visibleArea: a,
1262
1364
  type: "move"
1263
1365
  }));
@@ -1267,14 +1369,14 @@ function qt(e) {
1267
1369
  coordinates: o
1268
1370
  };
1269
1371
  }
1270
- function Jt(e) {
1372
+ function tn(e) {
1271
1373
  var t = e.imageSize, n = e.visibleArea, r = e.coordinates, i = n || t;
1272
1374
  return {
1273
1375
  left: (n ? n.left : 0) + i.width / 2 - r.width / 2,
1274
1376
  top: (n ? n.top : 0) + i.height / 2 - r.height / 2
1275
1377
  };
1276
1378
  }
1277
- function Yt(e) {
1379
+ function nn(e) {
1278
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 ? {
1279
1381
  width: .8 * a.width,
1280
1382
  height: .8 * a.width / o
@@ -1282,35 +1384,35 @@ function Yt(e) {
1282
1384
  height: .8 * a.height,
1283
1385
  width: .8 * a.height * o
1284
1386
  };
1285
- return Ht(K(K({}, s), {
1387
+ return Yt(K(K({}, s), {
1286
1388
  aspectRatio: r,
1287
1389
  sizeRestrictions: i
1288
1390
  }));
1289
1391
  }
1290
- function Xt(e) {
1392
+ function rn(e) {
1291
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;
1292
- 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), Ht({
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({
1293
1395
  width: n,
1294
1396
  height: t,
1295
1397
  aspectRatio: o,
1296
1398
  sizeRestrictions: s
1297
1399
  });
1298
1400
  }
1299
- function Zt(e) {
1401
+ function an(e) {
1300
1402
  var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = Z(e.boundaries);
1301
1403
  if (n) {
1302
1404
  var a = {
1303
1405
  height: Math.max(n.height, r.height),
1304
1406
  width: Math.max(n.width, r.width)
1305
- }, o = Mt({
1407
+ }, o = zt({
1306
1408
  width: Z(a) > i ? a.width : a.height * i,
1307
1409
  height: Z(a) > i ? a.width / i : a.height
1308
- }, It(t())), s = {
1410
+ }, Ut(t())), s = {
1309
1411
  left: n.left + n.width / 2 - o.width / 2,
1310
1412
  top: n.top + n.height / 2 - o.height / 2,
1311
1413
  width: o.width,
1312
1414
  height: o.height
1313
- }, c = Et(n, wt(K({
1415
+ }, c = Nt(n, jt(K({
1314
1416
  left: 0,
1315
1417
  top: 0
1316
1418
  }, r))), l = {};
@@ -1327,10 +1429,10 @@ function Zt(e) {
1327
1429
  height: o.height
1328
1430
  };
1329
1431
  }
1330
- function Qt(e, t) {
1331
- return Rt(e, wt(t));
1432
+ function on(e, t) {
1433
+ return Gt(e, jt(t));
1332
1434
  }
1333
- function $t(e) {
1435
+ function sn(e) {
1334
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;
1335
1437
  u = Y(u, {
1336
1438
  left: l.left || 0,
@@ -1339,16 +1441,16 @@ function $t(e) {
1339
1441
  var h = {
1340
1442
  stencil: {
1341
1443
  minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
1342
- maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0, kt(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))
1343
1445
  },
1344
- area: { maximum: kt(u, a({
1446
+ area: { maximum: It(u, a({
1345
1447
  visibleArea: u,
1346
1448
  type: "resize"
1347
1449
  })) }
1348
1450
  };
1349
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));
1350
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);
1351
- return u = Q(u = Y(u, At(u, {
1453
+ return u = Q(u = Y(u, Lt(u, {
1352
1454
  left: o.left === void 0 ? void 0 : o.left - g * p,
1353
1455
  top: o.top === void 0 ? void 0 : o.top - v * p,
1354
1456
  bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
@@ -1356,46 +1458,46 @@ function $t(e) {
1356
1458
  })), a({
1357
1459
  visibleArea: u,
1358
1460
  type: "move"
1359
- })), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Q(d, zt(wt(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({
1360
1462
  visibleArea: u,
1361
1463
  type: "move"
1362
- })), Ot(At(d, wt(u)))))), {
1464
+ })), Ft(Lt(d, jt(u)))))), {
1363
1465
  coordinates: d,
1364
1466
  visibleArea: u
1365
1467
  };
1366
1468
  }
1367
- function en(e) {
1368
- 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 = Pt(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({
1369
1471
  left: 0,
1370
1472
  top: 0
1371
1473
  }, c)), l);
1372
- return (u = K(K({}, Ht({
1474
+ return (u = K(K({}, Yt({
1373
1475
  sizeRestrictions: a,
1374
1476
  aspectRatio: t,
1375
1477
  width: u.width,
1376
1478
  height: u.height
1377
- })), Pt(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, Ft(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({
1378
1480
  visibleArea: d,
1379
1481
  type: "resize"
1380
1482
  }))), {
1381
1483
  coordinates: u = Q(u, o),
1382
- visibleArea: d = Q(d = Y(d, Tt(J(u), J(r))), n({
1484
+ visibleArea: d = Q(d = Y(d, Mt(J(u), J(r))), n({
1383
1485
  visibleArea: d,
1384
1486
  type: "move"
1385
1487
  }))
1386
1488
  };
1387
1489
  }
1388
- function tn(e) {
1490
+ function ln(e) {
1389
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;
1390
1492
  if (u || d) {
1391
- var f = Pt({
1493
+ var f = Vt({
1392
1494
  left: s.width / 2,
1393
1495
  top: s.height / 2
1394
- }, -r), p = Pt(J(c), -r), m = Pt({
1496
+ }, -r), p = Vt(J(c), -r), m = Vt({
1395
1497
  left: u ? f.left - (p.left - f.left) : p.left,
1396
1498
  top: d ? f.top - (p.top - f.top) : p.top
1397
1499
  }, r);
1398
- c = Y(c, Tt(m, J(c))), p = Pt(J(l), -r), l = Q(l = Y(l, Tt(m = Pt({
1500
+ c = Y(c, Mt(m, J(c))), p = Vt(J(l), -r), l = Q(l = Y(l, Mt(m = Vt({
1399
1501
  left: u ? f.left - (p.left - f.left) : p.left,
1400
1502
  top: d ? f.top - (p.top - f.top) : p.top
1401
1503
  }, r), J(l))), i({
@@ -1408,11 +1510,11 @@ function tn(e) {
1408
1510
  visibleArea: l
1409
1511
  };
1410
1512
  }
1411
- function nn(e) {
1412
- 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 = Dt(n, c).width, u = Dt(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;
1413
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)));
1414
- var d = Et(Dt(n, c), i);
1415
- 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 = Et(Dt(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));
1416
1518
  var f = {
1417
1519
  width: 1 / 0,
1418
1520
  height: 1 / 0,
@@ -1421,37 +1523,37 @@ function nn(e) {
1421
1523
  top: 1 / 0,
1422
1524
  bottom: 1 / 0
1423
1525
  };
1424
- if (_t.forEach((function(e) {
1526
+ if (wt.forEach((function(e) {
1425
1527
  var t = d[e];
1426
1528
  t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
1427
1529
  })), o) {
1428
- var p = Math.min.apply(null, _t.map((function(e) {
1530
+ var p = Math.min.apply(null, wt.map((function(e) {
1429
1531
  return f[e];
1430
1532
  })));
1431
- p !== 1 / 0 && _t.forEach((function(e) {
1533
+ p !== 1 / 0 && wt.forEach((function(e) {
1432
1534
  c[e] *= p;
1433
1535
  }));
1434
- } else _t.forEach((function(e) {
1536
+ } else wt.forEach((function(e) {
1435
1537
  f[e] !== 1 / 0 && (c[e] *= f[e]);
1436
1538
  }));
1437
- if (l = Dt(n, c).width, u = Dt(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) {
1438
1540
  var m = Math.min(f.width, f.height);
1439
- m !== 1 / 0 && _t.forEach((function(e) {
1541
+ m !== 1 / 0 && wt.forEach((function(e) {
1440
1542
  c[e] *= m;
1441
1543
  }));
1442
- } else f.width !== 1 / 0 && vt.forEach((function(e) {
1544
+ } else f.width !== 1 / 0 && Tt.forEach((function(e) {
1443
1545
  c[e] *= f.width;
1444
- })), f.height !== 1 / 0 && yt.forEach((function(e) {
1546
+ })), f.height !== 1 / 0 && Et.forEach((function(e) {
1445
1547
  c[e] *= f.height;
1446
1548
  }));
1447
1549
  return c;
1448
1550
  }
1449
- function rn(e, t, n) {
1551
+ function dn(e, t, n) {
1450
1552
  return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
1451
1553
  }
1452
- var an = Ye("vue-simple-handler"), on = Ye("vue-simple-handler-wrapper"), sn = {
1554
+ var fn = nt("vue-simple-handler"), pn = nt("vue-simple-handler-wrapper"), mn = {
1453
1555
  name: "SimpleHandler",
1454
- components: { HandlerWrapper: mt },
1556
+ components: { HandlerWrapper: xt },
1455
1557
  props: {
1456
1558
  defaultClass: { type: String },
1457
1559
  hoverClass: { type: String },
@@ -1469,8 +1571,8 @@ var an = Ye("vue-simple-handler"), on = Ye("vue-simple-handler-wrapper"), sn = {
1469
1571
  computed: { classes: function() {
1470
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);
1471
1573
  return {
1472
- default: G(an(t), this.defaultClass, this.hover && this.hoverClass),
1473
- wrapper: G(on(t), this.wrapperClass)
1574
+ default: G(fn(t), this.defaultClass, this.hover && this.hoverClass),
1575
+ wrapper: G(pn(t), this.wrapperClass)
1474
1576
  };
1475
1577
  } },
1476
1578
  methods: {
@@ -1489,7 +1591,7 @@ var an = Ye("vue-simple-handler"), on = Ye("vue-simple-handler-wrapper"), sn = {
1489
1591
  },
1490
1592
  emits: ["drag", "drag-end"]
1491
1593
  };
1492
- sn.render = function(e, t, n, r, i, a) {
1594
+ mn.render = function(e, t, n, r, i, a) {
1493
1595
  var o = x("HandlerWrapper");
1494
1596
  return z(), h(o, {
1495
1597
  class: a.classes.wrapper,
@@ -1516,9 +1618,9 @@ sn.render = function(e, t, n, r, i, a) {
1516
1618
  "onLeave"
1517
1619
  ]);
1518
1620
  };
1519
- var cn = Ye("vue-simple-line"), ln = Ye("vue-simple-line-wrapper"), un = {
1621
+ var hn = nt("vue-simple-line"), gn = nt("vue-simple-line-wrapper"), _n = {
1520
1622
  name: "SimpleLine",
1521
- components: { LineWrapper: gt },
1623
+ components: { LineWrapper: Ct },
1522
1624
  props: {
1523
1625
  defaultClass: { type: String },
1524
1626
  hoverClass: { type: String },
@@ -1534,8 +1636,8 @@ var cn = Ye("vue-simple-line"), ln = Ye("vue-simple-line-wrapper"), un = {
1534
1636
  },
1535
1637
  computed: { classes: function() {
1536
1638
  return {
1537
- root: G(cn(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
1538
- wrapper: G(ln(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)
1539
1641
  };
1540
1642
  } },
1541
1643
  methods: {
@@ -1554,7 +1656,7 @@ var cn = Ye("vue-simple-line"), ln = Ye("vue-simple-line-wrapper"), un = {
1554
1656
  },
1555
1657
  emits: ["drag", "drag-end"]
1556
1658
  };
1557
- un.render = function(e, t, n, r, i, a) {
1659
+ _n.render = function(e, t, n, r, i, a) {
1558
1660
  var o = x("LineWrapper");
1559
1661
  return z(), h(o, {
1560
1662
  class: a.classes.wrapper,
@@ -1579,15 +1681,15 @@ un.render = function(e, t, n, r, i, a) {
1579
1681
  "onLeave"
1580
1682
  ]);
1581
1683
  };
1582
- var dn = Ye("vue-bounding-box"), fn = [
1684
+ var vn = nt("vue-bounding-box"), yn = [
1583
1685
  "east",
1584
1686
  "west",
1585
1687
  null
1586
- ], pn = [
1688
+ ], bn = [
1587
1689
  "south",
1588
1690
  "north",
1589
1691
  null
1590
- ], mn = {
1692
+ ], xn = {
1591
1693
  name: "BoundingBox",
1592
1694
  props: {
1593
1695
  width: { type: Number },
@@ -1611,7 +1713,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1611
1713
  handlersComponent: {
1612
1714
  type: [Object, String],
1613
1715
  default: function() {
1614
- return sn;
1716
+ return mn;
1615
1717
  }
1616
1718
  },
1617
1719
  handlersClasses: {
@@ -1640,7 +1742,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1640
1742
  linesComponent: {
1641
1743
  type: [Object, String],
1642
1744
  default: function() {
1643
- return un;
1745
+ return _n;
1644
1746
  }
1645
1747
  },
1646
1748
  linesClasses: {
@@ -1662,10 +1764,10 @@ var dn = Ye("vue-bounding-box"), fn = [
1662
1764
  },
1663
1765
  data: function() {
1664
1766
  var e = [];
1665
- return fn.forEach((function(t) {
1666
- pn.forEach((function(n) {
1767
+ return yn.forEach((function(t) {
1768
+ bn.forEach((function(n) {
1667
1769
  if (t !== n) {
1668
- var r = Qe(t, n);
1770
+ var r = at(t, n);
1669
1771
  e.push({
1670
1772
  name: r.name,
1671
1773
  classname: r.classname,
@@ -1684,7 +1786,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1684
1786
  classes: function() {
1685
1787
  var e = this.handlersClasses, t = this.handlersWrappersClasses, n = this.linesClasses, r = this.linesWrappersClasses;
1686
1788
  return {
1687
- root: dn(),
1789
+ root: vn(),
1688
1790
  handlers: e,
1689
1791
  handlersWrappers: t,
1690
1792
  lines: n,
@@ -1722,8 +1824,8 @@ var dn = Ye("vue-bounding-box"), fn = [
1722
1824
  };
1723
1825
  if (n && r) {
1724
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;
1725
- a.wrapperClass = dn("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
1726
- } else a.wrapperClass = dn("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));
1727
1829
  t.push(a);
1728
1830
  }
1729
1831
  })), t;
@@ -1749,7 +1851,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1749
1851
  top: 0,
1750
1852
  bottom: 0
1751
1853
  };
1752
- 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 lt(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, {
1753
1855
  allowedDirections: {
1754
1856
  left: t === "west" || !t,
1755
1857
  right: t === "east" || !t,
@@ -1763,7 +1865,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1763
1865
  },
1764
1866
  emits: ["resize", "resize-end"]
1765
1867
  };
1766
- mn.render = function(e, t, n, r, i, a) {
1868
+ xn.render = function(e, t, n, r, i, a) {
1767
1869
  return z(), h("div", {
1768
1870
  ref: "box",
1769
1871
  class: a.classes.root,
@@ -1823,7 +1925,7 @@ mn.render = function(e, t, n, r, i, a) {
1823
1925
  })), 128))
1824
1926
  ], 6);
1825
1927
  };
1826
- var hn = Ye("vue-draggable-area"), gn = {
1928
+ var Sn = nt("vue-draggable-area"), Cn = {
1827
1929
  name: "DraggableArea",
1828
1930
  props: {
1829
1931
  movable: {
@@ -1836,7 +1938,7 @@ var hn = Ye("vue-draggable-area"), gn = {
1836
1938
  }
1837
1939
  },
1838
1940
  computed: { classnames: function() {
1839
- return { default: hn() };
1941
+ return { default: Sn() };
1840
1942
  } },
1841
1943
  beforeMount: function() {
1842
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 });
@@ -1851,14 +1953,14 @@ var hn = Ye("vue-draggable-area"), gn = {
1851
1953
  onTouchStart: function(e) {
1852
1954
  if (e.cancelable) {
1853
1955
  var t = this.movable && e.touches.length === 1;
1854
- t && (this.touches = We(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1956
+ t && (this.touches = Ze(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1855
1957
  }
1856
1958
  },
1857
1959
  onTouchEnd: function() {
1858
1960
  this.touchStarted = !1, this.processEnd();
1859
1961
  },
1860
1962
  onTouchMove: function(e) {
1861
- this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : st({
1963
+ this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : mt({
1862
1964
  x: this.touches[0].clientX,
1863
1965
  y: this.touches[0].clientY
1864
1966
  }, {
@@ -1897,10 +1999,10 @@ var hn = Ye("vue-draggable-area"), gn = {
1897
1999
  };
1898
2000
  },
1899
2001
  processMove: function(e, t) {
1900
- var n = We(t);
2002
+ var n = Ze(t);
1901
2003
  if (this.touches.length) {
1902
2004
  var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
1903
- this.touches.length === 1 && n.length === 1 && this.$emit("move", new ut({
2005
+ this.touches.length === 1 && n.length === 1 && this.$emit("move", new _t({
1904
2006
  left: n[0].clientX - (i + this.anchor.x),
1905
2007
  top: n[0].clientY - (a + this.anchor.y)
1906
2008
  }));
@@ -1912,7 +2014,7 @@ var hn = Ye("vue-draggable-area"), gn = {
1912
2014
  },
1913
2015
  emits: ["move", "move-end"]
1914
2016
  };
1915
- gn.render = function(e, t, n, r, i, a) {
2017
+ Cn.render = function(e, t, n, r, i, a) {
1916
2018
  return z(), h("div", {
1917
2019
  ref: "container",
1918
2020
  onTouchstart: t[1] ||= function() {
@@ -1923,7 +2025,7 @@ gn.render = function(e, t, n, r, i, a) {
1923
2025
  }
1924
2026
  }, [c(e.$slots, "default")], 544);
1925
2027
  };
1926
- function _n(e) {
2028
+ function wn(e) {
1927
2029
  return {
1928
2030
  rotate: e.rotate || 0,
1929
2031
  flip: {
@@ -1932,7 +2034,7 @@ function _n(e) {
1932
2034
  }
1933
2035
  };
1934
2036
  }
1935
- function vn(e) {
2037
+ function Tn(e) {
1936
2038
  return new Promise((function(t, n) {
1937
2039
  try {
1938
2040
  if (e) {
@@ -1965,11 +2067,11 @@ function vn(e) {
1965
2067
  var a, o, s;
1966
2068
  }));
1967
2069
  }
1968
- function yn(e) {
2070
+ function En(e) {
1969
2071
  var t = e.rotate, n = e.flip, r = e.scaleX, i = e.scaleY, a = "";
1970
2072
  return a += " rotate(" + t + "deg) ", a += " scaleX(" + r * (n.horizontal ? -1 : 1) + ") ", a += " scaleY(" + i * (n.vertical ? -1 : 1) + ") ";
1971
2073
  }
1972
- function bn(e) {
2074
+ function Dn(e) {
1973
2075
  try {
1974
2076
  var t, n = new DataView(e), r = void 0, i = void 0, a = void 0, o = void 0;
1975
2077
  if (n.getUint8(0) === 255 && n.getUint8(1) === 216) for (var s = n.byteLength, c = 2; c + 1 < s;) {
@@ -2001,7 +2103,7 @@ function bn(e) {
2001
2103
  return null;
2002
2104
  }
2003
2105
  }
2004
- function xn(e, t) {
2106
+ function On(e, t) {
2005
2107
  var n = t.getBoundingClientRect(), r = n.left, i = n.top, a = {
2006
2108
  left: 0,
2007
2109
  top: 0
@@ -2009,7 +2111,7 @@ function xn(e, t) {
2009
2111
  return e.forEach((function(t) {
2010
2112
  a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
2011
2113
  })), e.forEach((function(e) {
2012
- o += st({
2114
+ o += mt({
2013
2115
  x: a.left,
2014
2116
  y: a.top
2015
2117
  }, {
@@ -2022,7 +2124,7 @@ function xn(e, t) {
2022
2124
  count: e.length
2023
2125
  };
2024
2126
  }
2025
- var Sn = {
2127
+ var kn = {
2026
2128
  props: {
2027
2129
  touchMove: {
2028
2130
  type: Boolean,
@@ -2052,18 +2154,18 @@ var Sn = {
2052
2154
  window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
2053
2155
  },
2054
2156
  created: function() {
2055
- this.transforming = !1, this.debouncedProcessEnd = Ze(this.processEnd), this.touches = [];
2157
+ this.transforming = !1, this.debouncedProcessEnd = it(this.processEnd), this.touches = [];
2056
2158
  },
2057
2159
  methods: {
2058
2160
  processMove: function(e, t) {
2059
2161
  if (this.touches.length) {
2060
- if (this.touches.length === 1 && t.length === 1) this.$emit("move", new ct({
2162
+ if (this.touches.length === 1 && t.length === 1) this.$emit("move", new ht({
2061
2163
  left: this.touches[0].clientX - t[0].clientX,
2062
2164
  top: this.touches[0].clientY - t[0].clientY
2063
2165
  }));
2064
2166
  else if (this.touches.length > 1 && this.touchResize) {
2065
- var n = xn(t, this.$refs.container), r = this.oldGeometricProperties;
2066
- r.count === n.count && r.count > 1 && this.$emit("resize", new ct({
2167
+ var n = On(t, this.$refs.container), r = this.oldGeometricProperties;
2168
+ r.count === n.count && r.count > 1 && this.$emit("resize", new ht({
2067
2169
  left: r.centerMass.left - n.centerMass.left,
2068
2170
  top: r.centerMass.top - n.centerMass.top
2069
2171
  }, {
@@ -2086,9 +2188,9 @@ var Sn = {
2086
2188
  onTouchStart: function(e) {
2087
2189
  if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
2088
2190
  var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
2089
- this.touches = We(e.touches).filter((function(e) {
2191
+ this.touches = Ze(e.touches).filter((function(e) {
2090
2192
  return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
2091
- })), this.oldGeometricProperties = xn(this.touches, t);
2193
+ })), this.oldGeometricProperties = On(this.touches, t);
2092
2194
  }
2093
2195
  },
2094
2196
  onTouchEnd: function(e) {
@@ -2097,7 +2199,7 @@ var Sn = {
2097
2199
  onTouchMove: function(e) {
2098
2200
  var t = this;
2099
2201
  if (this.touches.length) {
2100
- var n = We(e.touches).filter((function(e) {
2202
+ var n = Ze(e.touches).filter((function(e) {
2101
2203
  return !e.identifier || t.touches.find((function(t) {
2102
2204
  return t.identifier === e.identifier;
2103
2205
  }));
@@ -2126,11 +2228,11 @@ var Sn = {
2126
2228
  },
2127
2229
  onWheel: function(e) {
2128
2230
  if (this.wheelResize && this.processEvent(e)) {
2129
- 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 || ot(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 = {
2130
2232
  left: e.clientX - n,
2131
2233
  top: e.clientY - r
2132
2234
  };
2133
- this.$emit("resize", new ct({}, {
2235
+ this.$emit("resize", new ht({}, {
2134
2236
  factor: i,
2135
2237
  center: a
2136
2238
  })), this.touches.length || this.debouncedProcessEnd();
@@ -2144,7 +2246,7 @@ var Sn = {
2144
2246
  "transform-end"
2145
2247
  ]
2146
2248
  };
2147
- Sn.render = function(e, t, n, r, i, a) {
2249
+ kn.render = function(e, t, n, r, i, a) {
2148
2250
  return z(), h("div", {
2149
2251
  ref: "container",
2150
2252
  onTouchstart: t[1] ||= function() {
@@ -2158,8 +2260,8 @@ Sn.render = function(e, t, n, r, i, a) {
2158
2260
  }
2159
2261
  }, [c(e.$slots, "default")], 544);
2160
2262
  };
2161
- var Cn = {
2162
- components: { TransformableImage: Sn },
2263
+ var An = {
2264
+ components: { TransformableImage: kn },
2163
2265
  props: {
2164
2266
  touchMove: {
2165
2267
  type: Boolean,
@@ -2180,7 +2282,7 @@ var Cn = {
2180
2282
  },
2181
2283
  emits: ["resize", "move"]
2182
2284
  };
2183
- Cn.render = function(e, t, n, r, i, a) {
2285
+ An.render = function(e, t, n, r, i, a) {
2184
2286
  var o = x("transformable-image");
2185
2287
  return z(), h(o, {
2186
2288
  "touch-move": n.touchMove,
@@ -2205,7 +2307,7 @@ Cn.render = function(e, t, n, r, i, a) {
2205
2307
  "wheel-resize"
2206
2308
  ]);
2207
2309
  };
2208
- var wn = Ye("vue-preview"), Tn = {
2310
+ var jn = nt("vue-preview"), Mn = {
2209
2311
  props: {
2210
2312
  coordinates: { type: Object },
2211
2313
  transitions: { type: Object },
@@ -2235,10 +2337,10 @@ var wn = Ye("vue-preview"), Tn = {
2235
2337
  computed: {
2236
2338
  classes: function() {
2237
2339
  return {
2238
- root: wn({ fill: this.fill }),
2239
- wrapper: wn("wrapper"),
2240
- imageWrapper: wn("image-wrapper"),
2241
- image: G(wn("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)
2242
2344
  };
2243
2345
  },
2244
2346
  style: function() {
@@ -2266,7 +2368,7 @@ var wn = Ye("vue-preview"), Tn = {
2266
2368
  }, this.image.transforms), {}, {
2267
2369
  scaleX: 1 / e,
2268
2370
  scaleY: 1 / e
2269
- }), n = this.imageSize.width, r = this.imageSize.height, i = Nt({
2371
+ }), n = this.imageSize.width, r = this.imageSize.height, i = Bt({
2270
2372
  width: n,
2271
2373
  height: r
2272
2374
  }, t.rotate), a = {
@@ -2285,7 +2387,7 @@ var wn = Ye("vue-preview"), Tn = {
2285
2387
  }
2286
2388
  };
2287
2389
  return a.transform = `translate(
2288
- ${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + yn(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;
2289
2391
  }
2290
2392
  return {};
2291
2393
  },
@@ -2329,7 +2431,7 @@ var wn = Ye("vue-preview"), Tn = {
2329
2431
  }
2330
2432
  }
2331
2433
  };
2332
- Tn.render = function(e, t, n, r, i, a) {
2434
+ Mn.render = function(e, t, n, r, i, a) {
2333
2435
  return z(), h("div", {
2334
2436
  ref: "root",
2335
2437
  class: a.classes.root,
@@ -2345,20 +2447,20 @@ Tn.render = function(e, t, n, r, i, a) {
2345
2447
  style: a.imageStyle
2346
2448
  }, null, 14, ["src"]), [[ye, n.image && n.image.src]])], 6)], 6);
2347
2449
  };
2348
- var En = {
2349
- components: { Preview: Tn },
2450
+ var Nn = {
2451
+ components: { Preview: Mn },
2350
2452
  inheritAttrs: !1
2351
2453
  };
2352
- En.render = function(e, t, n, r, i, a) {
2454
+ Nn.render = function(e, t, n, r, i, a) {
2353
2455
  var o = x("preview");
2354
2456
  return z(), h(o, f(e.$attrs, { fill: !0 }), null, 16);
2355
2457
  };
2356
- var Dn = Ye("vue-rectangle-stencil"), On = {
2458
+ var Pn = nt("vue-rectangle-stencil"), Fn = {
2357
2459
  name: "RectangleStencil",
2358
2460
  components: {
2359
- StencilPreview: En,
2360
- BoundingBox: mn,
2361
- DraggableArea: gn
2461
+ StencilPreview: Nn,
2462
+ BoundingBox: xn,
2463
+ DraggableArea: Cn
2362
2464
  },
2363
2465
  props: {
2364
2466
  image: { type: Object },
@@ -2368,14 +2470,14 @@ var Dn = Ye("vue-rectangle-stencil"), On = {
2368
2470
  handlersComponent: {
2369
2471
  type: [Object, String],
2370
2472
  default: function() {
2371
- return sn;
2473
+ return mn;
2372
2474
  }
2373
2475
  },
2374
2476
  lines: { type: Object },
2375
2477
  linesComponent: {
2376
2478
  type: [Object, String],
2377
2479
  default: function() {
2378
- return un;
2480
+ return _n;
2379
2481
  }
2380
2482
  },
2381
2483
  aspectRatio: { type: [Number, String] },
@@ -2428,13 +2530,13 @@ var Dn = Ye("vue-rectangle-stencil"), On = {
2428
2530
  computed: {
2429
2531
  classes: function() {
2430
2532
  return {
2431
- stencil: G(Dn({
2533
+ stencil: G(Pn({
2432
2534
  movable: this.movable,
2433
2535
  moving: this.moving,
2434
2536
  resizing: this.resizing
2435
2537
  }), this.moving && this.movingClass, this.resizing && this.resizingClass),
2436
- preview: G(Dn("preview"), this.previewClass),
2437
- boundingBox: G(Dn("bounding-box"), this.boundingBoxClass)
2538
+ preview: G(Pn("preview"), this.previewClass),
2539
+ boundingBox: G(Pn("bounding-box"), this.boundingBoxClass)
2438
2540
  };
2439
2541
  },
2440
2542
  style: function() {
@@ -2473,7 +2575,7 @@ var Dn = Ye("vue-rectangle-stencil"), On = {
2473
2575
  "move-end"
2474
2576
  ]
2475
2577
  };
2476
- On.render = function(e, t, n, r, i, a) {
2578
+ Fn.render = function(e, t, n, r, i, a) {
2477
2579
  var o = x("stencil-preview"), s = x("draggable-area"), c = x("bounding-box");
2478
2580
  return z(), h("div", {
2479
2581
  class: a.classes.stencil,
@@ -2544,9 +2646,9 @@ On.render = function(e, t, n, r, i, a) {
2544
2646
  "onResizeEnd"
2545
2647
  ])], 6);
2546
2648
  };
2547
- var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2649
+ var In = ["transitions"], Ln = nt("vue-advanced-cropper"), Rn = {
2548
2650
  name: "Cropper",
2549
- components: { BackgroundWrapper: Cn },
2651
+ components: { BackgroundWrapper: An },
2550
2652
  props: {
2551
2653
  src: {
2552
2654
  type: String,
@@ -2555,13 +2657,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2555
2657
  stencilComponent: {
2556
2658
  type: [Object, String],
2557
2659
  default: function() {
2558
- return On;
2660
+ return Fn;
2559
2661
  }
2560
2662
  },
2561
2663
  backgroundWrapperComponent: {
2562
2664
  type: [Object, String],
2563
2665
  default: function() {
2564
- return Cn;
2666
+ return An;
2565
2667
  }
2566
2668
  },
2567
2669
  stencilProps: {
@@ -2610,7 +2712,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2610
2712
  type: String,
2611
2713
  default: "fit-area",
2612
2714
  validator: function(e) {
2613
- return xt.indexOf(e) !== -1;
2715
+ return Ot.indexOf(e) !== -1;
2614
2716
  }
2615
2717
  },
2616
2718
  roundResult: {
@@ -2653,31 +2755,31 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2653
2755
  bottom: !0,
2654
2756
  top: !0
2655
2757
  };
2656
- a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), _t.forEach((function(e) {
2758
+ a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), wt.forEach((function(e) {
2657
2759
  l[e] || (c[e] = 0);
2658
2760
  }));
2659
- var u = Dt(o, c = nn({
2761
+ var u = Pt(o, c = un({
2660
2762
  coordinates: o,
2661
2763
  directions: c,
2662
2764
  sizeRestrictions: a,
2663
2765
  positionRestrictions: i
2664
- })).width, d = Dt(o, c).height, f = s.preserveRatio ? Z(o) : jt(u / d, r);
2766
+ })).width, d = Pt(o, c).height, f = s.preserveRatio ? Z(o) : Rt(u / d, r);
2665
2767
  if (f) {
2666
2768
  var p = s.respectDirection;
2667
2769
  if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
2668
2770
  var m = u / f - o.height;
2669
2771
  if (l.top && l.bottom) {
2670
2772
  var h = c.top, g = c.bottom;
2671
- c.bottom = rn(m, g, h), c.top = rn(m, h, g);
2773
+ c.bottom = dn(m, g, h), c.top = dn(m, h, g);
2672
2774
  } else l.bottom ? c.bottom = m : l.top ? c.top = m : l.right ? c.right = 0 : l.left && (c.left = 0);
2673
2775
  } else if (p === "height") {
2674
2776
  var _ = o.width - d * f;
2675
2777
  if (l.left && l.right) {
2676
2778
  var v = c.left, y = c.right;
2677
- c.left = -rn(_, v, y), c.right = -rn(_, y, v);
2779
+ c.left = -dn(_, v, y), c.right = -dn(_, y, v);
2678
2780
  } else l.left ? c.left = -_ : l.right ? c.right = -_ : l.top ? c.top = 0 : l.bottom && (c.bottom = 0);
2679
2781
  }
2680
- c = nn({
2782
+ c = un({
2681
2783
  directions: c,
2682
2784
  coordinates: o,
2683
2785
  sizeRestrictions: a,
@@ -2686,10 +2788,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2686
2788
  compensate: s.compensate
2687
2789
  });
2688
2790
  }
2689
- return u = Dt(o, c).width, d = Dt(o, c).height, (f = s.preserveRatio ? Z(o) : jt(u / d, r)) && Math.abs(f - u / d) > .001 && _t.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) {
2690
2792
  l[e] || (c[e] = 0);
2691
- })), Ut({
2692
- event: new ut({
2793
+ })), Xt({
2794
+ event: new _t({
2693
2795
  left: -c.left,
2694
2796
  top: -c.top
2695
2797
  }),
@@ -2705,7 +2807,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2705
2807
  },
2706
2808
  moveAlgorithm: {
2707
2809
  type: Function,
2708
- default: Ut
2810
+ default: Xt
2709
2811
  },
2710
2812
  initStretcher: {
2711
2813
  type: Function,
@@ -2717,7 +2819,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2717
2819
  fitCoordinates: {
2718
2820
  type: Function,
2719
2821
  default: function(e) {
2720
- var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), Ht({
2822
+ var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), Yt({
2721
2823
  width: n.width,
2722
2824
  height: n.height,
2723
2825
  aspectRatio: r,
@@ -2728,7 +2830,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2728
2830
  minWidth: Math.min(t.width, i.minWidth)
2729
2831
  }
2730
2832
  }));
2731
- return o = Q(o = Y(o, Tt(J(n), J(o))), zt(wt(t), a));
2833
+ return o = Q(o = Y(o, Mt(J(n), J(o))), Kt(jt(t), a));
2732
2834
  }
2733
2835
  },
2734
2836
  fitVisibleArea: {
@@ -2736,7 +2838,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2736
2838
  default: function(e) {
2737
2839
  var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = K({}, t);
2738
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)));
2739
- var o = Ot(At(i, wt(a = X(a, Ft(a, r({
2841
+ var o = Ft(Lt(i, jt(a = X(a, Ht(a, r({
2740
2842
  visibleArea: a,
2741
2843
  type: "resize"
2742
2844
  }))))));
@@ -2817,7 +2919,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2817
2919
  height: 0
2818
2920
  },
2819
2921
  visibleArea: null,
2820
- coordinates: U({}, St)
2922
+ coordinates: U({}, kt)
2821
2923
  };
2822
2924
  },
2823
2925
  computed: {
@@ -2855,7 +2957,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2855
2957
  return !!(this.visibleArea && this.imageLoaded);
2856
2958
  },
2857
2959
  settings: function() {
2858
- var e = rt(this.resizeImage, {
2960
+ var e = ut(this.resizeImage, {
2859
2961
  touch: !0,
2860
2962
  wheel: { ratio: .1 },
2861
2963
  adjustStencil: !0
@@ -2865,7 +2967,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2865
2967
  adjustStencil: !1
2866
2968
  });
2867
2969
  return {
2868
- moveImage: rt(this.moveImage, {
2970
+ moveImage: ut(this.moveImage, {
2869
2971
  touch: !0,
2870
2972
  mouse: !0
2871
2973
  }, {
@@ -2896,10 +2998,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2896
2998
  if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
2897
2999
  var e = this.sizeRestrictionsAlgorithm({
2898
3000
  imageSize: this.imageSize,
2899
- minWidth: q(this.minWidth) ? 0 : it(this.minWidth),
2900
- minHeight: q(this.minHeight) ? 0 : it(this.minHeight),
2901
- maxWidth: q(this.maxWidth) ? 1 / 0 : it(this.maxWidth),
2902
- maxHeight: q(this.maxHeight) ? 1 / 0 : it(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)
2903
3005
  });
2904
3006
  if (e = function(e) {
2905
3007
  var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = K(K({}, n), {
@@ -2909,7 +3011,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2909
3011
  maxHeight: n.maxHeight === void 0 ? 1 / 0 : n.maxHeight
2910
3012
  });
2911
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));
2912
- var o = It(t), s = Mt(r, o);
3014
+ var o = Ut(t), s = zt(r, o);
2913
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;
2914
3016
  }({
2915
3017
  sizeRestrictions: e,
@@ -2924,7 +3026,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2924
3026
  visibleArea: this.visibleArea,
2925
3027
  stencilSize: this.getStencilSize()
2926
3028
  }), this.visibleArea && this.stencilSize) {
2927
- var t = this.getStencilSize(), n = It(this.getAreaRestrictions({
3029
+ var t = this.getStencilSize(), n = Ut(this.getAreaRestrictions({
2928
3030
  visibleArea: this.visibleArea,
2929
3031
  type: "resize"
2930
3032
  }));
@@ -2947,15 +3049,15 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2947
3049
  },
2948
3050
  classes: function() {
2949
3051
  return {
2950
- cropper: An(),
2951
- image: G(An("image"), this.imageClass),
2952
- stencil: An("stencil"),
2953
- boundaries: G(An("boundaries"), this.boundariesClass),
2954
- stretcher: G(An("stretcher")),
2955
- background: G(An("background"), this.backgroundClass),
2956
- foreground: G(An("foreground"), this.foregroundClass),
2957
- imageWrapper: G(An("image-wrapper")),
2958
- cropperWrapper: G(An("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"))
2959
3061
  };
2960
3062
  },
2961
3063
  stencilCoordinates: function() {
@@ -3000,7 +3102,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3000
3102
  height: `${e.height}px`,
3001
3103
  left: "0px",
3002
3104
  top: "0px",
3003
- transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + yn(r)
3105
+ transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + En(r)
3004
3106
  };
3005
3107
  return this.transitionsOptions.enabled && (i.transition = `${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`), i;
3006
3108
  }
@@ -3041,7 +3143,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3041
3143
  }
3042
3144
  },
3043
3145
  created: function() {
3044
- this.debouncedUpdate = Ze(this.update, this.debounce), this.debouncedDisableTransitions = Ze(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;
3045
3147
  },
3046
3148
  mounted: function() {
3047
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);
@@ -3077,7 +3179,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3077
3179
  },
3078
3180
  zoom: function(e, t) {
3079
3181
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3080
- this.onManipulateImage(new ct({}, {
3182
+ this.onManipulateImage(new ht({}, {
3081
3183
  factor: 1 / e,
3082
3184
  center: t
3083
3185
  }), {
@@ -3087,7 +3189,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3087
3189
  },
3088
3190
  move: function(e, t) {
3089
3191
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3090
- this.onManipulateImage(new ct({
3192
+ this.onManipulateImage(new ht({
3091
3193
  left: e || 0,
3092
3194
  top: t || 0
3093
3195
  }), {
@@ -3131,13 +3233,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3131
3233
  };
3132
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);
3133
3235
  }(U(U({}, this.getPublicProperties()), {}, {
3134
- positionRestrictions: Qt(this.positionRestrictions, this.visibleArea),
3236
+ positionRestrictions: on(this.positionRestrictions, this.visibleArea),
3135
3237
  coordinates: e
3136
3238
  })) : e;
3137
3239
  },
3138
3240
  processAutoZoom: function(e, t, n, r) {
3139
3241
  var i = this.autoZoomAlgorithm;
3140
- i ||= this.stencilSize ? Gt : this.autoZoom ? Kt : qt;
3242
+ i ||= this.stencilSize ? Qt : this.autoZoom ? $t : en;
3141
3243
  var a = i({
3142
3244
  event: {
3143
3245
  type: e,
@@ -3152,10 +3254,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3152
3254
  sizeRestrictions: this.sizeRestrictions,
3153
3255
  stencilSize: this.getStencilSize()
3154
3256
  });
3155
- return U(U({}, a), {}, { changed: !Ct(a.visibleArea, t) || !Ct(a.coordinates, n) });
3257
+ return U(U({}, a), {}, { changed: !At(a.visibleArea, t) || !At(a.coordinates, n) });
3156
3258
  },
3157
3259
  runAutoZoom: function(e) {
3158
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Ue(t, kn), 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;
3159
3261
  r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
3160
3262
  },
3161
3263
  normalizeEvent: function(e) {
@@ -3176,13 +3278,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3176
3278
  });
3177
3279
  if (t.type === "resize") {
3178
3280
  var i = K(K({}, t), { directions: K({}, t.directions) });
3179
- return _t.forEach((function(e) {
3281
+ return wt.forEach((function(e) {
3180
3282
  i.directions[e] *= r;
3181
3283
  })), i;
3182
3284
  }
3183
3285
  if (t.type === "move") {
3184
3286
  var a = K(K({}, t), { directions: K({}, t.directions) });
3185
- return bt.forEach((function(e) {
3287
+ return Dt.forEach((function(e) {
3186
3288
  a.directions[e] *= r;
3187
3289
  })), a;
3188
3290
  }
@@ -3195,9 +3297,9 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3195
3297
  var r = n.rotate, i = n.flip, a = {
3196
3298
  width: t.naturalWidth,
3197
3299
  height: t.naturalHeight
3198
- }, o = Nt(a, r), s = e.getContext("2d");
3300
+ }, o = Bt(a, r), s = e.getContext("2d");
3199
3301
  e.height = o.height, e.width = o.width, s.save();
3200
- var c = Pt(J(K({
3302
+ var c = Vt(J(K({
3201
3303
  left: 0,
3202
3304
  top: 0
3203
3305
  }, a)), r);
@@ -3216,7 +3318,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3216
3318
  return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
3217
3319
  var t;
3218
3320
  }));
3219
- }, a = Ht({
3321
+ }, a = Yt({
3220
3322
  sizeRestrictions: {
3221
3323
  minWidth: i([r.width, r.minWidth]) || 0,
3222
3324
  minHeight: i([r.height, r.minHeight]) || 0,
@@ -3250,8 +3352,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3250
3352
  this.$emit("change", this.getResult());
3251
3353
  },
3252
3354
  applyTransform: function(e) {
3253
- var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Lt(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? Qt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
3254
- return Wt({
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({
3255
3357
  transform: e,
3256
3358
  coordinates: this.coordinates,
3257
3359
  imageSize: this.imageSize,
@@ -3266,23 +3368,23 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3266
3368
  if (this.$refs.image) {
3267
3369
  this.$refs.cropper, this.$refs.image;
3268
3370
  var t = this.defaultSize;
3269
- t ||= this.stencilSize ? Xt : Yt, this.sizeRestrictions;
3270
- var n = tt(t) ? t({
3371
+ t ||= this.stencilSize ? rn : nn, this.sizeRestrictions;
3372
+ var n = ct(t) ? t({
3271
3373
  boundaries: this.boundaries,
3272
3374
  imageSize: this.imageSize,
3273
3375
  aspectRatio: this.getAspectRatio(),
3274
3376
  sizeRestrictions: this.sizeRestrictions,
3275
3377
  stencilSize: this.getStencilSize(),
3276
3378
  visibleArea: this.visibleArea
3277
- }) : t, r = this.defaultPosition || Jt, i = [n, function(t) {
3379
+ }) : t, r = this.defaultPosition || tn, i = [n, function(t) {
3278
3380
  var n = t.coordinates;
3279
- return U({}, tt(r) ? r({
3381
+ return U({}, ct(r) ? r({
3280
3382
  coordinates: n,
3281
3383
  imageSize: e.imageSize,
3282
3384
  visibleArea: e.visibleArea
3283
3385
  }) : e.defaultPosition);
3284
3386
  }];
3285
- this.delayedTransforms && i.push.apply(i, We(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;
3286
3388
  }
3287
3389
  },
3288
3390
  clearImage: function() {
@@ -3312,7 +3414,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3312
3414
  cropper: n,
3313
3415
  imageSize: e.imageSize
3314
3416
  };
3315
- if (e.boundaries = tt(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) {
3316
3418
  var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
3317
3419
  return o > i && (o = i, a = n.height * i / n.width), {
3318
3420
  width: o,
@@ -3331,8 +3433,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3331
3433
  var e = this;
3332
3434
  return this.appliedImageTransforms = U(U({}, this.defaultImageTransforms), {}, { flip: U({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
3333
3435
  e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
3334
- var t, n, r, i, a, o, s = e.defaultVisibleArea || Zt;
3335
- e.visibleArea = tt(s) ? s({
3436
+ var t, n, r, i, a, o, s = e.defaultVisibleArea || an;
3437
+ e.visibleArea = ct(s) ? s({
3336
3438
  imageSize: e.imageSize,
3337
3439
  boundaries: e.boundaries,
3338
3440
  coordinates: e.priority === "visible-area" ? null : e.coordinates,
@@ -3383,7 +3485,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3383
3485
  var e, t = this;
3384
3486
  if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
3385
3487
  if (function(e) {
3386
- if (et(e)) return !1;
3488
+ if (st(e)) return !1;
3387
3489
  var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
3388
3490
  protocol: n[1] || "",
3389
3491
  host: n[2] || "",
@@ -3398,8 +3500,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3398
3500
  }
3399
3501
  if (this.checkOrientation) {
3400
3502
  var r = (e = this.src, new Promise((function(t) {
3401
- vn(e).then((function(n) {
3402
- var r = bn(n);
3503
+ Tn(e).then((function(n) {
3504
+ var r = Dn(n);
3403
3505
  t(n ? {
3404
3506
  source: e,
3405
3507
  arrayBuffer: n,
@@ -3436,14 +3538,14 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3436
3538
  },
3437
3539
  onParseImage: function(e) {
3438
3540
  var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
3439
- this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? $e(n) || !et(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) {
3440
3542
  for (var t = [], n = new Uint8Array(e); n.length > 0;) {
3441
3543
  var r = n.subarray(0, 8192);
3442
3544
  t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
3443
3545
  }
3444
3546
  return "data:image/jpeg;base64," + btoa(t.join(""));
3445
- }(r) : this.imageAttributes.src = n, this.appliedImageTransforms = tt(this.defaultTransforms) ? _n(this.defaultTransforms()) : nt(this.defaultTransforms) ? _n(this.defaultTransforms) : function(e) {
3446
- var t = _n({});
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({});
3447
3549
  if (e) switch (e) {
3448
3550
  case 2:
3449
3551
  t.flip.horizontal = !0;
@@ -3483,7 +3585,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3483
3585
  var t = this;
3484
3586
  this.transitionsOptions.enabled || this.awaitRender((function() {
3485
3587
  t.coordinates = t.moveAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3486
- positionRestrictions: Qt(t.positionRestrictions, t.visibleArea),
3588
+ positionRestrictions: on(t.positionRestrictions, t.visibleArea),
3487
3589
  coordinates: t.coordinates,
3488
3590
  event: t.normalizeEvent(e)
3489
3591
  })), t.onChange();
@@ -3494,7 +3596,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3494
3596
  this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
3495
3597
  var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
3496
3598
  t.coordinates = t.resizeAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3497
- positionRestrictions: Qt(t.positionRestrictions, t.visibleArea),
3599
+ positionRestrictions: on(t.positionRestrictions, t.visibleArea),
3498
3600
  sizeRestrictions: {
3499
3601
  maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
3500
3602
  maxHeight: Math.min(n.maxHeight, t.visibleArea.height),
@@ -3510,7 +3612,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3510
3612
  if (!this.transitionsOptions.enabled) {
3511
3613
  var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
3512
3614
  r && this.enableTransitions();
3513
- var o = $t(U(U({}, this.getPublicProperties()), {}, {
3615
+ var o = sn(U(U({}, this.getPublicProperties()), {}, {
3514
3616
  event: a ? this.normalizeEvent(e) : e,
3515
3617
  getAreaRestrictions: this.getAreaRestrictions,
3516
3618
  imageRestriction: this.imageRestriction,
@@ -3540,7 +3642,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3540
3642
  }
3541
3643
  if (q(t) && (t = q(i) ? a : i), q(n) && (n = q(i) ? o : i), !e && (q(t) || q(n))) {
3542
3644
  var c = this.getStencilSize(), l = c ? Z(c) : null;
3543
- q(t) && (t = at(l) ? l : void 0), q(n) && (n = at(l) ? l : void 0);
3645
+ q(t) && (t = ft(l) ? l : void 0), q(n) && (n = ft(l) ? l : void 0);
3544
3646
  }
3545
3647
  return {
3546
3648
  minimum: t,
@@ -3558,10 +3660,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3558
3660
  coefficient: this.coefficient,
3559
3661
  coordinates: this.coordinates,
3560
3662
  aspectRatio: this.getAspectRatio(!0)
3561
- }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, jt(Z(i = tt(n) ? n({
3663
+ }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, Rt(Z(i = ct(n) ? n({
3562
3664
  boundaries: t,
3563
3665
  aspectRatio: r
3564
- }) : n), r) && (i = Ht({
3666
+ }) : n), r) && (i = Yt({
3565
3667
  sizeRestrictions: {
3566
3668
  maxWidth: t.width,
3567
3669
  maxHeight: t.height,
@@ -3574,7 +3676,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3574
3676
  minimum: r.minimum,
3575
3677
  maximum: r.maximum
3576
3678
  }
3577
- })), (i.width > t.width || i.height > t.height) && (i = Ht({
3679
+ })), (i.width > t.width || i.height > t.height) && (i = Yt({
3578
3680
  sizeRestrictions: {
3579
3681
  maxWidth: t.width,
3580
3682
  maxHeight: t.height,
@@ -3603,13 +3705,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3603
3705
  };
3604
3706
  },
3605
3707
  defaultCoordinates: function() {
3606
- return U({}, St);
3708
+ return U({}, kt);
3607
3709
  },
3608
3710
  flip: function(e, t) {
3609
3711
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3610
3712
  if (!this.transitionsActive) {
3611
3713
  r && this.enableTransitions();
3612
- var i = U({}, this.imageTransforms.flip), a = tn({
3714
+ var i = U({}, this.imageTransforms.flip), a = ln({
3613
3715
  flip: {
3614
3716
  horizontal: e ? !i.horizontal : i.horizontal,
3615
3717
  vertical: t ? !i.vertical : i.vertical
@@ -3633,7 +3735,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3633
3735
  n && this.enableTransitions();
3634
3736
  var r = U({}, this.imageSize);
3635
3737
  this.appliedImageTransforms.rotate += e;
3636
- var i = en({
3738
+ var i = cn({
3637
3739
  visibleArea: this.visibleArea,
3638
3740
  coordinates: this.coordinates,
3639
3741
  previousImageSize: r,
@@ -3653,16 +3755,16 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3653
3755
  "error",
3654
3756
  "ready"
3655
3757
  ]
3656
- }, Mn = {
3758
+ }, zn = {
3657
3759
  key: 0,
3658
3760
  ref: "canvas",
3659
3761
  style: { display: "none" }
3660
- }, Nn = {
3762
+ }, Bn = {
3661
3763
  key: 1,
3662
3764
  ref: "sourceCanvas",
3663
3765
  style: { display: "none" }
3664
3766
  };
3665
- jn.render = function(e, t, n, i, a, o) {
3767
+ Rn.render = function(e, t, n, i, a, o) {
3666
3768
  return z(), h("div", {
3667
3769
  ref: "cropper",
3668
3770
  class: o.classes.cropper
@@ -3720,8 +3822,8 @@ jn.render = function(e, t, n, i, a, o) {
3720
3822
  "onMove",
3721
3823
  "onMoveEnd"
3722
3824
  ])), [[ye, a.imageLoaded]]),
3723
- n.canvas ? (z(), h("canvas", Mn, null, 512)) : M("", !0),
3724
- n.canvas ? (z(), h("canvas", Nn, 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)
3725
3827
  ];
3726
3828
  })),
3727
3829
  _: 1
@@ -3737,57 +3839,57 @@ jn.render = function(e, t, n, i, a, o) {
3737
3839
  };
3738
3840
  //#endregion
3739
3841
  //#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
3740
- var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In = {
3842
+ var Vn = ["data-tpl-theme"], Hn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Un = {
3741
3843
  class: "tpl:text-sm tpl:font-semibold",
3742
3844
  style: { color: "var(--tpl-text)" }
3743
- }, Ln = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Rn = {
3845
+ }, Wn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Gn = {
3744
3846
  key: 0,
3745
3847
  class: "tpl:mb-4"
3746
- }, zn = {
3848
+ }, Kn = {
3747
3849
  class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
3748
3850
  style: {
3749
3851
  "border-color": "var(--tpl-border)",
3750
3852
  height: "300px",
3751
3853
  "background-color": "var(--tpl-bg)"
3752
3854
  }
3753
- }, Bn = { class: "tpl:space-y-3" }, Vn = {
3855
+ }, qn = { class: "tpl:space-y-3" }, Jn = {
3754
3856
  class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
3755
3857
  style: { color: "var(--tpl-text-muted)" }
3756
- }, Hn = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Un = ["onClick"], Wn = { class: "tpl:flex tpl:gap-3" }, Gn = { class: "tpl:flex-1" }, Kn = {
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 = {
3757
3859
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3758
3860
  style: { color: "var(--tpl-text-muted)" }
3759
- }, qn = {
3861
+ }, er = {
3760
3862
  class: "tpl:font-normal",
3761
3863
  style: { color: "var(--tpl-text-dim)" }
3762
- }, Jn = { class: "tpl:relative" }, Yn = ["value", "placeholder"], Xn = {
3864
+ }, tr = { class: "tpl:relative" }, nr = ["value", "placeholder"], rr = {
3763
3865
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
3764
3866
  style: { color: "var(--tpl-text-dim)" }
3765
- }, Zn = { class: "tpl:flex-1" }, Qn = {
3867
+ }, ir = { class: "tpl:flex-1" }, ar = {
3766
3868
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3767
3869
  style: { color: "var(--tpl-text-muted)" }
3768
- }, $n = {
3870
+ }, or = {
3769
3871
  class: "tpl:font-normal",
3770
3872
  style: { color: "var(--tpl-text-dim)" }
3771
- }, er = { class: "tpl:relative" }, tr = ["value", "placeholder"], nr = {
3873
+ }, sr = { class: "tpl:relative" }, cr = ["value", "placeholder"], lr = {
3772
3874
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
3773
3875
  style: { color: "var(--tpl-text-dim)" }
3774
- }, rr = {
3876
+ }, ur = {
3775
3877
  key: 0,
3776
3878
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
3777
3879
  style: { color: "var(--tpl-text-muted)" }
3778
- }, ir = {
3880
+ }, dr = {
3779
3881
  class: "tpl:font-medium",
3780
3882
  style: { color: "var(--tpl-text)" }
3781
- }, ar = { class: "tpl:mb-3" }, or = {
3883
+ }, fr = { class: "tpl:mb-3" }, pr = {
3782
3884
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3783
3885
  style: { color: "var(--tpl-text-muted)" }
3784
- }, sr = ["autofocus"], cr = {
3886
+ }, mr = ["autofocus"], hr = {
3785
3887
  key: 1,
3786
3888
  class: "tpl:mb-4"
3787
- }, lr = {
3889
+ }, gr = {
3788
3890
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3789
3891
  style: { color: "var(--tpl-text-muted)" }
3790
- }, ur = ["placeholder"], dr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, fr = ["disabled"], pr = /*@__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({
3791
3893
  __name: "MediaEditModal",
3792
3894
  props: {
3793
3895
  visible: { type: Boolean },
@@ -3795,54 +3897,54 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3795
3897
  },
3796
3898
  emits: ["save", "close"],
3797
3899
  setup(n, { emit: o }) {
3798
- let c = n, d = o, { t: f } = Ae(), m = l("tplUiTheme"), g = l(Ve, e(null)), _ = f.mediaLibrary, { isImageMimeType: v } = Fe(), y = e(""), x = e(""), C = e(null), w = e("free"), T = e(void 0), E = e(void 0), D = e(""), O = e(""), te = e(void 0), ne = e(null), re = e(!1), ie = 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 ? [
3799
3901
  "image/jpeg",
3800
3902
  "image/png",
3801
3903
  "image/webp",
3802
3904
  "image/gif"
3803
- ].includes(c.item.mime_type) : !1), se = a(() => w.value === "original" ? te.value : Ie[w.value]), ce = a(() => ne.value ? Be(ne.value.width, ne.value.height, T.value, E.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);
3804
3906
  s(() => c.visible, (e) => {
3805
- e && c.item && (y.value = c.item.filename, x.value = c.item.alt_text || "", w.value = "free", T.value = void 0, E.value = void 0, D.value = "", O.value = "", te.value = void 0, ne.value = null, re.value = !1, ae.value = !1, c.item.width && c.item.height && (te.value = c.item.width / c.item.height));
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));
3806
3908
  });
3807
3909
  function le(e) {
3808
- e.coordinates && (ne.value = {
3910
+ e.coordinates && (re.value = {
3809
3911
  width: Math.round(e.coordinates.width),
3810
3912
  height: Math.round(e.coordinates.height)
3811
3913
  }, ae.value = !0);
3812
3914
  }
3813
3915
  function ue() {
3814
- re.value = !0, !te.value && c.item?.width && c.item?.height && (te.value = c.item.width / c.item.height);
3916
+ ie.value = !0, !ne.value && c.item?.width && c.item?.height && (ne.value = c.item.width / c.item.height);
3815
3917
  }
3816
3918
  function de(e) {
3817
3919
  let t = e.target.value;
3818
- D.value = t, T.value = t && parseInt(t, 10) || void 0;
3920
+ E.value = t, ee.value = t && parseInt(t, 10) || void 0;
3819
3921
  }
3820
3922
  function fe(e) {
3821
3923
  let t = e.target.value;
3822
- O.value = t, E.value = t && parseInt(t, 10) || void 0;
3924
+ D.value = t, T.value = t && parseInt(t, 10) || void 0;
3823
3925
  }
3824
3926
  async function pe() {
3825
3927
  let e = y.value.trim();
3826
- if (!e || !c.item || ie.value) return;
3928
+ if (!e || !c.item || k.value) return;
3827
3929
  let t = v(c.item.mime_type), n;
3828
3930
  if (oe.value && C.value && ae.value) {
3829
- ie.value = !0;
3931
+ k.value = !0;
3830
3932
  try {
3831
3933
  let { canvas: e } = C.value.getResult();
3832
3934
  if (e) {
3833
- let t = Re(e, T.value, E.value), r = Le(c.item.mime_type);
3834
- n = { file: await ze(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) };
3835
3937
  }
3836
3938
  } catch {
3837
- ie.value = !1;
3939
+ k.value = !1;
3838
3940
  return;
3839
3941
  }
3840
- ie.value = !1;
3942
+ k.value = !1;
3841
3943
  }
3842
3944
  d("save", c.item.id, e, t ? x.value : void 0, n), d("close");
3843
3945
  }
3844
3946
  function me(e) {
3845
- e.key === "Enter" && !ie.value && (e.preventDefault(), pe()), e.key === "Escape" && d("close");
3947
+ e.key === "Enter" && !k.value && (e.preventDefault(), pe()), e.key === "Escape" && d("close");
3846
3948
  }
3847
3949
  return (e, a) => (z(), h(b, { to: A(g) || "body" }, [p(ve, {
3848
3950
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
@@ -3860,12 +3962,12 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3860
3962
  onClick: a[3] ||= r((e) => d("close"), ["self"]),
3861
3963
  onKeydown: me
3862
3964
  }, [i("div", {
3863
- class: k(["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"]),
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"]),
3864
3966
  style: { "background-color": "var(--tpl-bg-elevated)" }
3865
3967
  }, [
3866
- i("div", Fn, [i("h3", In, I(A(f).mediaLibrary.editFile), 1)]),
3867
- i("div", Ln, [
3868
- oe.value ? (z(), t("div", Rn, [i("div", zn, [p(A(jn), {
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), {
3869
3971
  ref_key: "cropperRef",
3870
3972
  ref: C,
3871
3973
  src: n.item.url,
@@ -3874,8 +3976,8 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3874
3976
  "background-class": "tpl-cropper-background",
3875
3977
  onChange: le,
3876
3978
  onReady: ue
3877
- }, null, 8, ["src", "stencil-props"])]), i("div", Bn, [
3878
- i("div", null, [i("label", Vn, I(A(f).mediaLibrary.cropAspectRatio), 1), i("div", Hn, [(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([
3879
3981
  "free",
3880
3982
  "square",
3881
3983
  "landscape43",
@@ -3891,9 +3993,9 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3891
3993
  color: w.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
3892
3994
  }),
3893
3995
  onClick: (t) => w.value = e
3894
- }, I(A(_)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Un)), 64))])]),
3895
- i("div", Wn, [i("div", Gn, [i("label", Kn, [j(I(A(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", qn, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", Jn, [i("input", {
3896
- value: D.value,
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", {
3998
+ value: E.value,
3897
3999
  type: "number",
3898
4000
  min: "1",
3899
4001
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -3902,10 +4004,10 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3902
4004
  "background-color": "var(--tpl-bg)",
3903
4005
  color: "var(--tpl-text)"
3904
4006
  },
3905
- placeholder: ne.value?.width?.toString() || "",
4007
+ placeholder: re.value?.width?.toString() || "",
3906
4008
  onInput: de
3907
- }, null, 40, Yn), i("span", Xn, I(A(f).mediaLibrary.cropPixels), 1)])]), i("div", Zn, [i("label", Qn, [j(I(A(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", $n, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", er, [i("input", {
3908
- value: O.value,
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", {
4010
+ value: D.value,
3909
4011
  type: "number",
3910
4012
  min: "1",
3911
4013
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -3914,12 +4016,12 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3914
4016
  "background-color": "var(--tpl-bg)",
3915
4017
  color: "var(--tpl-text)"
3916
4018
  },
3917
- placeholder: ne.value?.height?.toString() || "",
4019
+ placeholder: re.value?.height?.toString() || "",
3918
4020
  onInput: fe
3919
- }, null, 40, tr), i("span", nr, I(A(f).mediaLibrary.cropPixels), 1)])])]),
3920
- ce.value ? (z(), t("div", rr, [i("span", null, I(A(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", ir, 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)
3921
4023
  ])])) : M("", !0),
3922
- i("div", ar, [i("label", or, 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", {
3923
4025
  "onUpdate:modelValue": a[0] ||= (e) => y.value = e,
3924
4026
  type: "text",
3925
4027
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -3929,8 +4031,8 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3929
4031
  color: "var(--tpl-text)"
3930
4032
  },
3931
4033
  autofocus: !oe.value
3932
- }, null, 8, sr), [[ee, y.value]])]),
3933
- A(v)(n.item.mime_type) ? (z(), t("div", cr, [i("label", lr, 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", {
3934
4036
  "onUpdate:modelValue": a[1] ||= (e) => x.value = e,
3935
4037
  type: "text",
3936
4038
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -3940,9 +4042,9 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3940
4042
  color: "var(--tpl-text)"
3941
4043
  },
3942
4044
  placeholder: A(f).mediaLibrary.altTextPlaceholder
3943
- }, null, 8, ur), [[ee, x.value]])])) : M("", !0)
4045
+ }, null, 8, _r), [[te, x.value]])])) : M("", !0)
3944
4046
  ]),
3945
- i("div", dr, [i("button", {
4047
+ i("div", vr, [i("button", {
3946
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",
3947
4049
  style: {
3948
4050
  "border-color": "var(--tpl-border)",
@@ -3953,27 +4055,27 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3953
4055
  }, I(A(f).mediaLibrary.cancel), 1), i("button", {
3954
4056
  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",
3955
4057
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
3956
- disabled: ie.value,
4058
+ disabled: k.value,
3957
4059
  onClick: pe
3958
- }, I(ie.value ? A(f).mediaLibrary.saving : A(f).mediaLibrary.saveChanges), 9, fr)])
3959
- ], 2)], 40, Pn)) : M("", !0)]),
4060
+ }, I(k.value ? A(f).mediaLibrary.saving : A(f).mediaLibrary.saveChanges), 9, yr)])
4061
+ ], 2)], 40, Vn)) : M("", !0)]),
3960
4062
  _: 1
3961
4063
  })], 8, ["to"]));
3962
4064
  }
3963
- }), mr = (e, t) => {
4065
+ }), xr = (e, t) => {
3964
4066
  let n = e.__vccOpts || e;
3965
4067
  for (let [e, r] of t) n[e] = r;
3966
4068
  return n;
3967
- }, hr = /*#__PURE__*/ mr(pr, [["__scopeId", "data-v-6b677237"]]), gr = {
4069
+ }, Sr = /*#__PURE__*/ xr(br, [["__scopeId", "data-v-a5653cc1"]]), Cr = {
3968
4070
  key: 1,
3969
4071
  class: "tpl:size-4 tpl:shrink-0"
3970
- }, _r = {
4072
+ }, wr = {
3971
4073
  key: 0,
3972
4074
  class: "tpl:truncate"
3973
- }, vr = {
4075
+ }, Tr = {
3974
4076
  key: 3,
3975
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"
3976
- }, yr = ["title"], br = ["title"], xr = { key: 0 }, Sr = ["placeholder"], Cr = /* @__PURE__ */ m({
4078
+ }, Er = ["title"], Dr = ["title"], Or = { key: 0 }, kr = ["placeholder"], Ar = /* @__PURE__ */ m({
3977
4079
  __name: "MediaFolderTreeNode",
3978
4080
  props: {
3979
4081
  folder: {},
@@ -3987,28 +4089,28 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3987
4089
  "deleteFolder"
3988
4090
  ],
3989
4091
  setup(n, { emit: o }) {
3990
- 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 : E(s.folder.children, s.currentFolderId)), T = a(() => d.value || w.value);
3991
- function E(e, t) {
3992
- for (let n of e) if (n.id === t || n.children && E(n.children, t)) return !0;
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);
4093
+ function T(e, t) {
4094
+ for (let n of e) if (n.id === t || n.children && T(n.children, t)) return !0;
3993
4095
  return !1;
3994
4096
  }
3995
- function D() {
4097
+ function E() {
3996
4098
  d.value = !d.value;
3997
4099
  }
3998
- function O() {
4100
+ function D() {
3999
4101
  f.value = !0, m.value = s.folder.name;
4000
4102
  }
4001
- function te() {
4103
+ function ne() {
4002
4104
  let e = m.value.trim();
4003
4105
  e && e !== s.folder.name && c("renameFolder", s.folder.id, e), f.value = !1, m.value = "";
4004
4106
  }
4005
- function ne() {
4107
+ function re() {
4006
4108
  f.value = !1, m.value = "";
4007
4109
  }
4008
- function re() {
4110
+ function ie() {
4009
4111
  g.value = !0, _.value = "", d.value = !0;
4010
4112
  }
4011
- function ie() {
4113
+ function k() {
4012
4114
  _.value.trim() && c("createFolder", _.value.trim(), s.folder.id), g.value = !1, _.value = "";
4013
4115
  }
4014
4116
  function oe() {
@@ -4027,12 +4129,12 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4027
4129
  v.value || g.value ? (z(), t("button", {
4028
4130
  key: 0,
4029
4131
  class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4030
- onClick: r(D, ["stop"])
4132
+ onClick: r(E, ["stop"])
4031
4133
  }, [p(A(ae), {
4032
- class: k(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": T.value }]),
4134
+ class: O(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": ee.value }]),
4033
4135
  size: 10,
4034
4136
  "stroke-width": 2
4035
- }, null, 8, ["class"])])) : (z(), t("span", gr)),
4137
+ }, null, 8, ["class"])])) : (z(), t("span", Cr)),
4036
4138
  i("button", {
4037
4139
  class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
4038
4140
  onClick: a[0] ||= (e) => c("navigate", n.folder.id)
@@ -4040,7 +4142,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4040
4142
  class: "tpl:shrink-0",
4041
4143
  size: 14,
4042
4144
  "stroke-width": 1.5
4043
- }), f.value ? M("", !0) : (z(), t("span", _r, I(n.folder.name), 1))]),
4145
+ }), f.value ? M("", !0) : (z(), t("span", wr, I(n.folder.name), 1))]),
4044
4146
  f.value ? u((z(), t("input", {
4045
4147
  key: 2,
4046
4148
  "onUpdate:modelValue": a[1] ||= (e) => m.value = e,
@@ -4052,28 +4154,28 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4052
4154
  color: "var(--tpl-text)"
4053
4155
  },
4054
4156
  autofocus: "",
4055
- onKeydown: [y(te, ["enter"]), y(ne, ["escape"])],
4056
- onBlur: te,
4157
+ onKeydown: [y(ne, ["enter"]), y(re, ["escape"])],
4158
+ onBlur: ne,
4057
4159
  onClick: a[2] ||= r(() => {}, ["stop"])
4058
- }, null, 544)), [[ee, m.value]]) : M("", !0),
4059
- f.value ? M("", !0) : (z(), t("span", vr, [
4160
+ }, null, 544)), [[te, m.value]]) : M("", !0),
4161
+ f.value ? M("", !0) : (z(), t("span", Tr, [
4060
4162
  b.value ? (z(), t("button", {
4061
4163
  key: 0,
4062
4164
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4063
4165
  title: A(l).mediaLibrary.addSubfolder,
4064
- onClick: r(re, ["stop"])
4166
+ onClick: r(ie, ["stop"])
4065
4167
  }, [p(A(fe), {
4066
4168
  size: 12,
4067
4169
  "stroke-width": 2
4068
- })], 8, yr)) : M("", !0),
4170
+ })], 8, Er)) : M("", !0),
4069
4171
  i("button", {
4070
4172
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4071
4173
  title: A(l).mediaLibrary.renameFolder,
4072
- onClick: r(O, ["stop"])
4174
+ onClick: r(D, ["stop"])
4073
4175
  }, [p(A(he), {
4074
4176
  size: 12,
4075
4177
  "stroke-width": 2
4076
- })], 8, br),
4178
+ })], 8, Dr),
4077
4179
  i("button", {
4078
4180
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4079
4181
  onClick: a[3] ||= r((e) => c("deleteFolder", n.folder.id), ["stop"])
@@ -4083,7 +4185,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4083
4185
  style: { color: "var(--tpl-danger)" }
4084
4186
  })])
4085
4187
  ]))
4086
- ], 4), T.value ? (z(), t("div", xr, [(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, {
4087
4189
  key: e.id,
4088
4190
  folder: e,
4089
4191
  "current-folder-id": n.currentFolderId,
@@ -4111,15 +4213,15 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4111
4213
  },
4112
4214
  placeholder: A(l).mediaLibrary.subfolderName,
4113
4215
  autofocus: "",
4114
- onKeydown: [y(ie, ["enter"]), y(oe, ["escape"])],
4115
- onBlur: ie
4116
- }, null, 40, Sr), [[ee, _.value]])], 4)) : M("", !0)])) : M("", !0)]);
4216
+ onKeydown: [y(k, ["enter"]), y(oe, ["escape"])],
4217
+ onBlur: k
4218
+ }, null, 40, kr), [[te, _.value]])], 4)) : M("", !0)])) : M("", !0)]);
4117
4219
  };
4118
4220
  }
4119
- }), wr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Tr = {
4221
+ }), jr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Mr = {
4120
4222
  key: 0,
4121
4223
  class: "tpl:px-3 tpl:py-2"
4122
- }, Er = ["placeholder"], Dr = /* @__PURE__ */ m({
4224
+ }, Nr = ["placeholder"], Pr = /* @__PURE__ */ m({
4123
4225
  __name: "MediaFolderTree",
4124
4226
  props: {
4125
4227
  folders: {},
@@ -4135,7 +4237,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4135
4237
  "showFrequentlyUsed"
4136
4238
  ],
4137
4239
  setup(n, { emit: r }) {
4138
- let a = r, { t: o } = Ae(), s = e(!1), c = e("");
4240
+ let a = r, { t: o } = Re(), s = e(!1), c = e("");
4139
4241
  function l() {
4140
4242
  s.value = !0, c.value = "";
4141
4243
  }
@@ -4145,7 +4247,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4145
4247
  function f() {
4146
4248
  s.value = !1, c.value = "";
4147
4249
  }
4148
- return (e, r) => (z(), t("div", wr, [
4250
+ return (e, r) => (z(), t("div", jr, [
4149
4251
  i("button", {
4150
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",
4151
4253
  style: N({
@@ -4157,7 +4259,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4157
4259
  size: 14,
4158
4260
  "stroke-width": 1.5
4159
4261
  }), j(" " + I(A(o).mediaLibrary.allFiles), 1)], 4),
4160
- (z(!0), t(R, null, S(n.folders, (e) => (z(), h(Cr, {
4262
+ (z(!0), t(R, null, S(n.folders, (e) => (z(), h(Ar, {
4161
4263
  key: e.id,
4162
4264
  folder: e,
4163
4265
  "current-folder-id": n.currentFolderId,
@@ -4167,7 +4269,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4167
4269
  onRenameFolder: r[3] ||= (e, t) => a("renameFolder", e, t),
4168
4270
  onDeleteFolder: r[4] ||= (e) => a("deleteFolder", e)
4169
4271
  }, null, 8, ["folder", "current-folder-id"]))), 128)),
4170
- s.value ? (z(), t("div", Tr, [u(i("input", {
4272
+ s.value ? (z(), t("div", Mr, [u(i("input", {
4171
4273
  "onUpdate:modelValue": r[5] ||= (e) => c.value = e,
4172
4274
  type: "text",
4173
4275
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -4180,7 +4282,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4180
4282
  autofocus: "",
4181
4283
  onKeydown: [y(d, ["enter"]), y(f, ["escape"])],
4182
4284
  onBlur: d
4183
- }, null, 40, Er), [[ee, c.value]])])) : M("", !0),
4285
+ }, null, 40, Nr), [[te, c.value]])])) : M("", !0),
4184
4286
  s.value ? M("", !0) : (z(), t("button", {
4185
4287
  key: 1,
4186
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",
@@ -4206,7 +4308,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4206
4308
  }), j(" " + I(A(o).mediaLibrary.frequentlyUsed), 1)], 4)) : M("", !0)
4207
4309
  ]));
4208
4310
  }
4209
- }), Or = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, kr = /* @__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({
4210
4312
  __name: "MediaFileIcon",
4211
4313
  props: { mimeType: {} },
4212
4314
  setup(e) {
@@ -4307,7 +4409,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4307
4409
  bgColor: "#f9fafb",
4308
4410
  icon: "document"
4309
4411
  }, s = a(() => r[n.mimeType] ?? o);
4310
- return (e, n) => (z(), t("div", Or, [s.value.icon === "document" ? (z(), t("svg", {
4412
+ return (e, n) => (z(), t("div", Fr, [s.value.icon === "document" ? (z(), t("svg", {
4311
4413
  key: 0,
4312
4414
  width: "60",
4313
4415
  height: "60",
@@ -4379,10 +4481,10 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4379
4481
  });
4380
4482
  //#endregion
4381
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
4382
- function Ar(e, t) {
4383
- return T() ? (E(e, t), !0) : !1;
4484
+ function Lr(e, t) {
4485
+ return ee() ? (T(e, t), !0) : !1;
4384
4486
  }
4385
- function jr() {
4487
+ function Rr() {
4386
4488
  let e = /* @__PURE__ */ new Set(), t = (t) => {
4387
4489
  e.delete(t);
4388
4490
  };
@@ -4390,7 +4492,7 @@ function jr() {
4390
4492
  on: (n) => {
4391
4493
  e.add(n);
4392
4494
  let r = () => t(n);
4393
- return Ar(r), { off: r };
4495
+ return Lr(r), { off: r };
4394
4496
  },
4395
4497
  off: t,
4396
4498
  trigger: (...t) => Promise.all(Array.from(e).map((e) => e(...t))),
@@ -4399,14 +4501,14 @@ function jr() {
4399
4501
  }
4400
4502
  };
4401
4503
  }
4402
- var Mr = typeof window < "u" && typeof document < "u";
4504
+ var zr = typeof window < "u" && typeof document < "u";
4403
4505
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4404
- var Nr = (e) => e != null, Pr = Object.prototype.toString, Fr = (e) => Pr.call(e) === "[object Object]", $ = () => {}, Ir = (e, t) => Object.hasOwn(e, t), Lr = /* #__PURE__ */ Rr();
4405
- function Rr() {
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() {
4406
4508
  var e, t;
4407
- return Mr && !!((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));
4408
4510
  }
4409
- function zr(e, t) {
4511
+ function Kr(e, t) {
4410
4512
  function n(...n) {
4411
4513
  return new Promise((r, i) => {
4412
4514
  Promise.resolve(e(() => t.apply(this, n), {
@@ -4422,7 +4524,7 @@ function zr(e, t) {
4422
4524
  isPending: e.isPending
4423
4525
  }), n;
4424
4526
  }
4425
- function Br(e, t = {}) {
4527
+ function qr(e, t = {}) {
4426
4528
  let n, r, i = $, a = $, o = L(!1), s = (e) => {
4427
4529
  clearTimeout(e), i(), i = $;
4428
4530
  }, c;
@@ -4446,10 +4548,10 @@ function Br(e, t = {}) {
4446
4548
  i = $, a = $, e(c());
4447
4549
  }
4448
4550
  },
4449
- isPending: re(o)
4551
+ isPending: ie(o)
4450
4552
  });
4451
4553
  }
4452
- function Vr(e) {
4554
+ function Jr(e) {
4453
4555
  let t;
4454
4556
  function n() {
4455
4557
  return t ||= e(), t;
@@ -4459,13 +4561,13 @@ function Vr(e) {
4459
4561
  t = void 0, e && await e;
4460
4562
  }, n;
4461
4563
  }
4462
- function Hr(e) {
4564
+ function Yr(e) {
4463
4565
  return Array.isArray(e) ? e : [e];
4464
4566
  }
4465
- function Ur(e, t = 200, n = {}) {
4466
- return zr(Br(t, n), e);
4567
+ function Xr(e, t = 200, n = {}) {
4568
+ return Kr(qr(t, n), e);
4467
4569
  }
4468
- function Wr(e, t, n = {}) {
4570
+ function Zr(e, t, n = {}) {
4469
4571
  let { immediate: r = !0, immediateCallback: i = !1 } = n, a = L(!1), o;
4470
4572
  function s() {
4471
4573
  o &&= (clearTimeout(o), void 0);
@@ -4478,13 +4580,13 @@ function Wr(e, t, n = {}) {
4478
4580
  a.value = !1, o = void 0, e(...n);
4479
4581
  }, F(t));
4480
4582
  }
4481
- return r && (a.value = !0, Mr && l()), Ar(c), {
4482
- isPending: re(a),
4583
+ return r && (a.value = !0, zr && l()), Lr(c), {
4584
+ isPending: ie(a),
4483
4585
  start: l,
4484
4586
  stop: c
4485
4587
  };
4486
4588
  }
4487
- function Gr(e, t, n) {
4589
+ function Qr(e, t, n) {
4488
4590
  return s(e, t, {
4489
4591
  ...n,
4490
4592
  immediate: !0
@@ -4492,46 +4594,46 @@ function Gr(e, t, n) {
4492
4594
  }
4493
4595
  //#endregion
4494
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
4495
- var Kr = Mr ? window : void 0, qr = Mr ? window.document : void 0, Jr = Mr ? window.navigator : void 0;
4496
- function Yr(e) {
4597
+ var $r = zr ? window : void 0, ei = zr ? window.document : void 0, ti = zr ? window.navigator : void 0;
4598
+ function ni(e) {
4497
4599
  let t = F(e);
4498
4600
  return t?.$el ?? t;
4499
4601
  }
4500
- function Xr(...e) {
4602
+ function ri(...e) {
4501
4603
  let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = a(() => {
4502
- let t = Hr(F(e[0])).filter((e) => e != null);
4604
+ let t = Yr(F(e[0])).filter((e) => e != null);
4503
4605
  return t.every((e) => typeof e != "string") ? t : void 0;
4504
4606
  });
4505
- return Gr(() => [
4506
- n.value?.map((e) => Yr(e)) ?? [Kr].filter((e) => e != null),
4507
- Hr(F(n.value ? e[1] : e[0])),
4508
- Hr(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])),
4509
4611
  F(n.value ? e[3] : e[2])
4510
4612
  ], ([e, n, r, i], a, o) => {
4511
4613
  if (!e?.length || !n?.length || !r?.length) return;
4512
- let s = Fr(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))));
4513
4615
  o(() => {
4514
4616
  c.forEach((e) => e());
4515
4617
  });
4516
4618
  }, { flush: "post" });
4517
4619
  }
4518
- var Zr = !1;
4519
- function Qr(e, t, n = {}) {
4520
- let { window: r = Kr, 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;
4521
4623
  if (!r) return s ? {
4522
4624
  stop: $,
4523
4625
  cancel: $,
4524
4626
  trigger: $
4525
4627
  } : $;
4526
- if (Lr && !Zr) {
4527
- Zr = !0;
4628
+ if (Wr && !ii) {
4629
+ ii = !0;
4528
4630
  let e = { passive: !0 };
4529
4631
  Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", $, e)), r.document.documentElement.addEventListener("click", $, e);
4530
4632
  }
4531
4633
  let c = !0, l = (e) => F(i).some((t) => {
4532
4634
  if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
4533
4635
  {
4534
- let n = Yr(t);
4636
+ let n = ni(t);
4535
4637
  return n && (e.target === n || e.composedPath().includes(n));
4536
4638
  }
4537
4639
  });
@@ -4544,7 +4646,7 @@ function Qr(e, t, n = {}) {
4544
4646
  return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
4545
4647
  }
4546
4648
  let f = (n) => {
4547
- let r = Yr(e);
4649
+ let r = ni(e);
4548
4650
  if (n.target != null && !(!(r instanceof Element) && u(e) && d(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
4549
4651
  if ("detail" in n && n.detail === 0 && (c = !l(n)), !c) {
4550
4652
  c = !0;
@@ -4553,7 +4655,7 @@ function Qr(e, t, n = {}) {
4553
4655
  t(n);
4554
4656
  }
4555
4657
  }, p = !1, m = [
4556
- Xr(r, "click", (e) => {
4658
+ ri(r, "click", (e) => {
4557
4659
  p || (p = !0, setTimeout(() => {
4558
4660
  p = !1;
4559
4661
  }, 0), f(e));
@@ -4561,13 +4663,13 @@ function Qr(e, t, n = {}) {
4561
4663
  passive: !0,
4562
4664
  capture: a
4563
4665
  }),
4564
- Xr(r, "pointerdown", (t) => {
4565
- let n = Yr(e);
4666
+ ri(r, "pointerdown", (t) => {
4667
+ let n = ni(e);
4566
4668
  c = !l(t) && !!(n && !t.composedPath().includes(n));
4567
4669
  }, { passive: !0 }),
4568
- o && Xr(r, "blur", (n) => {
4670
+ o && ri(r, "blur", (n) => {
4569
4671
  setTimeout(() => {
4570
- let i = Yr(e), a = r.document.activeElement;
4672
+ let i = ni(e), a = r.document.activeElement;
4571
4673
  for (; a?.shadowRoot;) a = a.shadowRoot.activeElement;
4572
4674
  a?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
4573
4675
  }, 0);
@@ -4583,22 +4685,22 @@ function Qr(e, t, n = {}) {
4583
4685
  }
4584
4686
  } : h;
4585
4687
  }
4586
- function $r() {
4688
+ function oi() {
4587
4689
  let e = L(!1), t = g();
4588
4690
  return t && v(() => {
4589
4691
  e.value = !0;
4590
4692
  }, t), e;
4591
4693
  }
4592
4694
  /* @__NO_SIDE_EFFECTS__ */
4593
- function ei(e) {
4594
- return $r(), a(() => !!e());
4695
+ function si(e) {
4696
+ return oi(), a(() => !!e());
4595
4697
  }
4596
- function ti(e, t = {}) {
4597
- let { controls: n = !1, navigator: r = Jr } = t, i = /* @__PURE__ */ ei(() => 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 = () => {
4598
4700
  s.value = a.value?.state ?? "prompt";
4599
4701
  };
4600
- Xr(a, "change", c, { passive: !0 });
4601
- let l = Vr(async () => {
4702
+ ri(a, "change", c, { passive: !0 });
4703
+ let l = Jr(async () => {
4602
4704
  if (i.value) {
4603
4705
  if (!a.value) try {
4604
4706
  a.value = await r.permissions.query(o);
@@ -4616,8 +4718,8 @@ function ti(e, t = {}) {
4616
4718
  query: l
4617
4719
  } : s;
4618
4720
  }
4619
- function ni(e = {}) {
4620
- let { navigator: t = Jr, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ ei(() => t && "clipboard" in t), c = ti("clipboard-read"), l = ti("clipboard-write"), u = a(() => s.value || o), d = L(""), f = L(!1), p = L(!1), m = Wr(() => 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;
4621
4723
  async function g() {
4622
4724
  let e = !(s.value && x(c.value));
4623
4725
  if (!e) try {
@@ -4627,7 +4729,7 @@ function ni(e = {}) {
4627
4729
  }
4628
4730
  e && (d.value = b());
4629
4731
  }
4630
- u.value && n && Xr(["copy", "cut"], g, { passive: !0 });
4732
+ u.value && n && ri(["copy", "cut"], g, { passive: !0 });
4631
4733
  async function _(e) {
4632
4734
  let n = e ?? F(r);
4633
4735
  if (u.value && n != null) {
@@ -4664,16 +4766,16 @@ function ni(e = {}) {
4664
4766
  return e === "granted" || e === "prompt";
4665
4767
  }
4666
4768
  return {
4667
- copyPending: re(p),
4769
+ copyPending: ie(p),
4668
4770
  isSupported: u,
4669
- text: re(d),
4670
- copied: re(f),
4771
+ text: ie(d),
4772
+ copied: ie(f),
4671
4773
  copy: _
4672
4774
  };
4673
4775
  }
4674
- function ri(e, t = {}) {
4776
+ function ui(e, t = {}) {
4675
4777
  let n = L(!1), r = L(null), i = 0, a = !0;
4676
- if (Mr) {
4778
+ if (zr) {
4677
4779
  let o = typeof t == "function" ? { onDrop: t } : t, s = o.multiple ?? !0, c = o.preventDefaultForUnhandled ?? !1, l = (e) => {
4678
4780
  let t = Array.from(e.dataTransfer?.files ?? []);
4679
4781
  return t.length === 0 ? null : s ? t : [t[0]];
@@ -4711,23 +4813,23 @@ function ri(e, t = {}) {
4711
4813
  }
4712
4814
  }
4713
4815
  };
4714
- Xr(e, "dragenter", (e) => p(e, "enter")), Xr(e, "dragover", (e) => p(e, "over")), Xr(e, "dragleave", (e) => p(e, "leave")), Xr(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"));
4715
4817
  }
4716
4818
  return {
4717
4819
  files: r,
4718
4820
  isOverDropZone: n
4719
4821
  };
4720
4822
  }
4721
- function ii(e, t, n = {}) {
4722
- let { root: r, rootMargin: i, threshold: o = 0, window: c = Kr, immediate: l = !0 } = n, u = /* @__PURE__ */ ei(() => c && "IntersectionObserver" in c), d = a(() => Hr(F(e)).map(Yr).filter(Nr)), 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(() => [
4723
4825
  d.value,
4724
- Yr(r),
4826
+ ni(r),
4725
4827
  F(i),
4726
4828
  p.value
4727
4829
  ], ([e, n, r]) => {
4728
4830
  if (f(), !p.value || !e.length) return;
4729
4831
  let i = new IntersectionObserver(t, {
4730
- root: Yr(n),
4832
+ root: ni(n),
4731
4833
  rootMargin: r,
4732
4834
  threshold: o
4733
4835
  });
@@ -4740,7 +4842,7 @@ function ii(e, t, n = {}) {
4740
4842
  }) : $, h = () => {
4741
4843
  f(), m(), p.value = !1;
4742
4844
  };
4743
- return Ar(h), {
4845
+ return Lr(h), {
4744
4846
  isSupported: u,
4745
4847
  isActive: p,
4746
4848
  pause() {
@@ -4752,22 +4854,22 @@ function ii(e, t, n = {}) {
4752
4854
  stop: h
4753
4855
  };
4754
4856
  }
4755
- var ai = {
4857
+ var fi = {
4756
4858
  multiple: !0,
4757
4859
  accept: "*",
4758
4860
  reset: !1,
4759
4861
  directory: !1
4760
4862
  };
4761
- function oi(e) {
4863
+ function pi(e) {
4762
4864
  if (!e) return null;
4763
4865
  if (e instanceof FileList) return e;
4764
4866
  let t = new DataTransfer();
4765
4867
  for (let n of e) t.items.add(n);
4766
4868
  return t.files;
4767
4869
  }
4768
- function si(t = {}) {
4769
- let { document: n = qr } = t, r = e(oi(t.initialFiles)), { on: i, trigger: o } = jr(), { on: s, trigger: c } = jr(), l = a(() => {
4770
- let e = Yr(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);
4771
4873
  return e && (e.type = "file", e.onchange = (e) => {
4772
4874
  r.value = e.target.files, o(r.value);
4773
4875
  }, e.oncancel = () => {
@@ -4777,7 +4879,7 @@ function si(t = {}) {
4777
4879
  r.value = null, l.value && l.value.value && (l.value.value = "", o(null));
4778
4880
  }, f = (e) => {
4779
4881
  let t = l.value;
4780
- t && (t.multiple = F(e.multiple), t.accept = F(e.accept), t.webkitdirectory = F(e.directory), Ir(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)));
4781
4883
  };
4782
4884
  return d(() => {
4783
4885
  f(t);
@@ -4787,7 +4889,7 @@ function si(t = {}) {
4787
4889
  let n = l.value;
4788
4890
  if (!n) return;
4789
4891
  let r = {
4790
- ...ai,
4892
+ ...fi,
4791
4893
  ...t,
4792
4894
  ...e
4793
4895
  };
@@ -4800,48 +4902,48 @@ function si(t = {}) {
4800
4902
  }
4801
4903
  //#endregion
4802
4904
  //#region src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
4803
- var ci = { class: "tpl:p-4" }, li = {
4905
+ var hi = { class: "tpl:p-4" }, gi = {
4804
4906
  key: 1,
4805
4907
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
4806
- }, ui = {
4908
+ }, _i = {
4807
4909
  class: "tpl:text-xs",
4808
4910
  style: { color: "var(--tpl-text-muted)" }
4809
- }, di = {
4911
+ }, vi = {
4810
4912
  key: 2,
4811
4913
  class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
4812
- }, fi = ["onClick"], pi = { class: "tpl:aspect-square" }, mi = ["src", "alt"], hi = { class: "tpl:px-2 tpl:py-1.5" }, gi = {
4914
+ }, yi = ["onClick"], bi = { class: "tpl:aspect-square" }, xi = ["src", "alt"], Si = { class: "tpl:px-2 tpl:py-1.5" }, Ci = {
4813
4915
  class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
4814
4916
  style: { color: "var(--tpl-text)" }
4815
- }, _i = {
4917
+ }, wi = {
4816
4918
  class: "tpl:flex tpl:justify-between tpl:text-[9px]",
4817
4919
  style: { color: "var(--tpl-text-muted)" }
4818
- }, vi = { key: 0 }, yi = { 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" }, bi = ["title", "onClick"], xi = ["title", "onClick"], Si = {
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 = {
4819
4921
  key: 0,
4820
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",
4821
4923
  style: { "background-color": "var(--tpl-primary)" }
4822
- }, Ci = {
4924
+ }, Ai = {
4823
4925
  key: 3,
4824
4926
  class: "tpl:flex tpl:flex-col tpl:gap-1"
4825
- }, wi = ["onClick"], Ti = {
4927
+ }, ji = ["onClick"], Mi = {
4826
4928
  class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
4827
4929
  style: { "background-color": "var(--tpl-bg-hover)" }
4828
- }, Ei = ["src", "alt"], Di = {
4930
+ }, Ni = ["src", "alt"], Pi = {
4829
4931
  key: 1,
4830
4932
  class: "tpl-list-icon tpl:size-full"
4831
- }, Oi = { class: "tpl:min-w-0 tpl:flex-1" }, ki = {
4933
+ }, Fi = { class: "tpl:min-w-0 tpl:flex-1" }, Ii = {
4832
4934
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
4833
4935
  style: { color: "var(--tpl-text)" }
4834
- }, Ai = {
4936
+ }, Li = {
4835
4937
  class: "tpl:text-[10px]",
4836
4938
  style: { color: "var(--tpl-text-muted)" }
4837
- }, ji = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Mi = ["title", "onClick"], Ni = ["title", "onClick"], Pi = {
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 = {
4838
4940
  key: 0,
4839
4941
  class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4840
4942
  style: { "background-color": "var(--tpl-primary)" }
4841
- }, Fi = {
4943
+ }, Hi = {
4842
4944
  key: 4,
4843
4945
  class: "tpl:flex tpl:justify-center tpl:py-4"
4844
- }, Ii = /*#__PURE__*/ mr(/* @__PURE__ */ m({
4946
+ }, Ui = /*#__PURE__*/ xr(/* @__PURE__ */ m({
4845
4947
  __name: "MediaGrid",
4846
4948
  props: {
4847
4949
  items: {},
@@ -4859,15 +4961,15 @@ var ci = { class: "tpl:p-4" }, li = {
4859
4961
  "replace"
4860
4962
  ],
4861
4963
  setup(n, { emit: a }) {
4862
- let o = n, s = a, { isAcceptedMimeType: c, isImageMimeType: l } = Fe();
4964
+ let o = n, s = a, { isAcceptedMimeType: c, isImageMimeType: l } = Ue();
4863
4965
  function u(e) {
4864
4966
  return !o.accept || o.accept.length === 0 || c(e.mime_type, o.accept);
4865
4967
  }
4866
4968
  function d(e) {
4867
4969
  s("select", e);
4868
4970
  }
4869
- let { t: f } = Ae(), m = e(null);
4870
- ii(m, ([{ isIntersecting: e }]) => {
4971
+ let { t: f } = Re(), m = e(null);
4972
+ di(m, ([{ isIntersecting: e }]) => {
4871
4973
  e && o.hasMore && !o.isLoading && s("loadMore");
4872
4974
  }, { threshold: .1 });
4873
4975
  function g(e) {
@@ -4880,34 +4982,34 @@ var ci = { class: "tpl:p-4" }, li = {
4880
4982
  day: "numeric"
4881
4983
  });
4882
4984
  }
4883
- return (e, a) => (z(), t("div", ci, [
4985
+ return (e, a) => (z(), t("div", hi, [
4884
4986
  n.isLoading && n.items.length === 0 ? (z(), t("div", {
4885
4987
  key: 0,
4886
- class: k(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
4988
+ class: O(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
4887
4989
  }, [(z(), t(R, null, S(8, (e) => i("div", {
4888
4990
  key: e,
4889
- class: k(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
4991
+ class: O(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
4890
4992
  style: { "background-color": "var(--tpl-bg-hover)" }
4891
- }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", li, [p(A(le), {
4993
+ }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", gi, [p(A(le), {
4892
4994
  class: "tpl:mb-3",
4893
4995
  size: 40,
4894
4996
  "stroke-width": 1,
4895
4997
  style: { color: "var(--tpl-text-dim)" }
4896
- }), i("p", ui, I(A(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", Ci, [(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", {
4897
4999
  key: e.id,
4898
- class: k(["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" : ""]]),
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" : ""]]),
4899
5001
  style: N({ backgroundColor: n.selectedIds.has(e.id) ? "var(--tpl-bg-hover)" : "transparent" }),
4900
5002
  onClick: (t) => d(e)
4901
5003
  }, [
4902
- i("div", Ti, [A(l)(e.mime_type) ? (z(), t("img", {
5004
+ i("div", Mi, [A(l)(e.mime_type) ? (z(), t("img", {
4903
5005
  key: 0,
4904
5006
  src: e.small_url || e.url,
4905
5007
  alt: e.filename,
4906
5008
  class: "tpl:size-full tpl:object-cover",
4907
5009
  loading: "lazy"
4908
- }, null, 8, Ei)) : (z(), t("div", Di, [p(kr, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
4909
- i("div", Oi, [i("p", ki, I(e.filename), 1), i("p", Ai, [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)])]),
4910
- i("div", ji, [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", {
4911
5013
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
4912
5014
  style: { color: "var(--tpl-text-muted)" },
4913
5015
  title: A(f).mediaLibrary.editFile,
@@ -4915,22 +5017,22 @@ var ci = { class: "tpl:p-4" }, li = {
4915
5017
  }, [p(A(he), {
4916
5018
  size: 12,
4917
5019
  "stroke-width": 2
4918
- })], 8, Mi), i("button", {
5020
+ })], 8, zi), i("button", {
4919
5021
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
4920
5022
  style: { color: "var(--tpl-text-muted)" },
4921
5023
  title: A(f).mediaLibrary.replaceFile,
4922
5024
  onClick: r((t) => s("replace", e), ["stop"])
4923
- }, [p(A(O), {
5025
+ }, [p(A(D), {
4924
5026
  size: 12,
4925
5027
  "stroke-width": 2
4926
- })], 8, Ni)]),
4927
- n.selectedIds.has(e.id) ? (z(), t("div", Pi, [p(A(D), {
5028
+ })], 8, Bi)]),
5029
+ n.selectedIds.has(e.id) ? (z(), t("div", Vi, [p(A(E), {
4928
5030
  size: 12,
4929
5031
  "stroke-width": 3
4930
5032
  })])) : M("", !0)
4931
- ], 14, wi))), 128))])) : (z(), t("div", di, [(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", {
4932
5034
  key: e.id,
4933
- class: k(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
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", [
4934
5036
  "tpl:cursor-pointer",
4935
5037
  !u(e) && !n.selectedIds.has(e.id) ? "tpl:opacity-60" : "",
4936
5038
  n.selectedIds.has(e.id) ? "tpl-media-item--selected" : ""
@@ -4941,18 +5043,18 @@ var ci = { class: "tpl:p-4" }, li = {
4941
5043
  }),
4942
5044
  onClick: (t) => d(e)
4943
5045
  }, [
4944
- i("div", pi, [A(l)(e.mime_type) ? (z(), t("img", {
5046
+ i("div", bi, [A(l)(e.mime_type) ? (z(), t("img", {
4945
5047
  key: 0,
4946
5048
  src: e.small_url || e.url,
4947
5049
  alt: e.filename,
4948
5050
  class: "tpl:size-full tpl:object-cover",
4949
5051
  loading: "lazy"
4950
- }, null, 8, mi)) : (z(), h(kr, {
5052
+ }, null, 8, xi)) : (z(), h(Ir, {
4951
5053
  key: 1,
4952
5054
  "mime-type": e.mime_type
4953
5055
  }, null, 8, ["mime-type"]))]),
4954
- i("div", hi, [i("p", gi, I(e.filename), 1), i("p", _i, [i("span", null, I(g(e.size)), 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t("span", vi, I(e.width) + "×" + I(e.height), 1)) : M("", !0)])]),
4955
- i("div", yi, [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", {
4956
5058
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4957
5059
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
4958
5060
  title: A(f).mediaLibrary.editFile,
@@ -4960,26 +5062,26 @@ var ci = { class: "tpl:p-4" }, li = {
4960
5062
  }, [p(A(he), {
4961
5063
  size: 11,
4962
5064
  "stroke-width": 2
4963
- })], 8, bi), i("button", {
5065
+ })], 8, Di), i("button", {
4964
5066
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4965
5067
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
4966
5068
  title: A(f).mediaLibrary.replaceFile,
4967
5069
  onClick: r((t) => s("replace", e), ["stop"])
4968
- }, [p(A(O), {
5070
+ }, [p(A(D), {
4969
5071
  size: 11,
4970
5072
  "stroke-width": 2
4971
- })], 8, xi)]),
4972
- n.selectedIds.has(e.id) ? (z(), t("div", Si, [p(A(D), {
5073
+ })], 8, Oi)]),
5074
+ n.selectedIds.has(e.id) ? (z(), t("div", ki, [p(A(E), {
4973
5075
  size: 12,
4974
5076
  "stroke-width": 3
4975
5077
  })])) : M("", !0)
4976
- ], 14, fi))), 128))])),
5078
+ ], 14, yi))), 128))])),
4977
5079
  i("div", {
4978
5080
  ref_key: "sentinelRef",
4979
5081
  ref: m,
4980
5082
  class: "tpl:h-4"
4981
5083
  }, null, 512),
4982
- n.isLoading && n.items.length > 0 ? (z(), t("div", Fi, [p(A(ce), {
5084
+ n.isLoading && n.items.length > 0 ? (z(), t("div", Hi, [p(A(ce), {
4983
5085
  class: "tpl-spinner",
4984
5086
  size: 20,
4985
5087
  "stroke-width": 2,
@@ -4987,20 +5089,20 @@ var ci = { class: "tpl:p-4" }, li = {
4987
5089
  })])) : M("", !0)
4988
5090
  ]));
4989
5091
  }
4990
- }), [["__scopeId", "data-v-9db961d1"]]), Li = ["data-tpl-theme"], Ri = {
5092
+ }), [["__scopeId", "data-v-9db961d1"]]), Wi = ["data-tpl-theme"], Gi = {
4991
5093
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
4992
5094
  style: { "background-color": "var(--tpl-bg-elevated)" }
4993
- }, zi = {
5095
+ }, Ki = {
4994
5096
  class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
4995
5097
  style: { color: "var(--tpl-text)" }
4996
- }, Bi = { class: "tpl:mb-3" }, Vi = ["placeholder", "disabled"], Hi = {
5098
+ }, qi = { class: "tpl:mb-3" }, Ji = ["placeholder", "disabled"], Yi = {
4997
5099
  key: 0,
4998
5100
  class: "tpl:mb-3 tpl:text-xs",
4999
5101
  style: { color: "var(--tpl-danger)" }
5000
- }, Ui = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Wi = ["disabled"], Gi = ["disabled"], Ki = {
5102
+ }, Xi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Zi = ["disabled"], Qi = ["disabled"], $i = {
5001
5103
  key: 0,
5002
5104
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
5003
- }, qi = { key: 1 }, Ji = /* @__PURE__ */ m({
5105
+ }, ea = { key: 1 }, ta = /* @__PURE__ */ m({
5004
5106
  __name: "MediaImportUrlModal",
5005
5107
  props: {
5006
5108
  visible: { type: Boolean },
@@ -5009,7 +5111,7 @@ var ci = { class: "tpl:p-4" }, li = {
5009
5111
  },
5010
5112
  emits: ["import", "close"],
5011
5113
  setup(n, { emit: a }) {
5012
- let o = n, c = a, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ve, e(null)), g = e("");
5114
+ let o = n, c = a, { t: d } = Re(), f = l(Fe, null), m = l(Ne, e(null)), g = e("");
5013
5115
  s(() => o.visible, (e) => {
5014
5116
  e && (g.value = "");
5015
5117
  });
@@ -5038,9 +5140,9 @@ var ci = { class: "tpl:p-4" }, li = {
5038
5140
  style: { "background-color": "var(--tpl-overlay)" },
5039
5141
  onClick: r(v, ["self"]),
5040
5142
  onKeydown: y
5041
- }, [i("div", Ri, [
5042
- i("h3", zi, I(A(d).mediaLibrary.importFromUrl), 1),
5043
- i("div", Bi, [u(i("input", {
5143
+ }, [i("div", Gi, [
5144
+ i("h3", Ki, I(A(d).mediaLibrary.importFromUrl), 1),
5145
+ i("div", qi, [u(i("input", {
5044
5146
  "onUpdate:modelValue": a[0] ||= (e) => g.value = e,
5045
5147
  type: "url",
5046
5148
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -5052,10 +5154,10 @@ var ci = { class: "tpl:p-4" }, li = {
5052
5154
  placeholder: A(d).mediaLibrary.importUrlPlaceholder,
5053
5155
  disabled: n.isImporting,
5054
5156
  autofocus: ""
5055
- }, null, 8, Vi), [[ee, g.value]])]),
5056
- n.error ? (z(), t("p", Hi, I(n.error), 1)) : M("", !0),
5057
- i("div", Ui, [i("button", {
5058
- class: k(["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 }]),
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", {
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 }]),
5059
5161
  style: {
5060
5162
  "border-color": "var(--tpl-border)",
5061
5163
  color: "var(--tpl-text)",
@@ -5063,25 +5165,25 @@ var ci = { class: "tpl:p-4" }, li = {
5063
5165
  },
5064
5166
  disabled: n.isImporting,
5065
5167
  onClick: v
5066
- }, I(A(d).mediaLibrary.cancel), 11, Wi), i("button", {
5168
+ }, I(A(d).mediaLibrary.cancel), 11, Zi), i("button", {
5067
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",
5068
5170
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5069
5171
  disabled: !g.value.trim() || n.isImporting,
5070
5172
  onClick: _
5071
- }, [n.isImporting ? (z(), t("span", Ki, [p(A(ce), {
5173
+ }, [n.isImporting ? (z(), t("span", $i, [p(A(ce), {
5072
5174
  class: "tpl:animate-spin",
5073
5175
  size: 12,
5074
5176
  "stroke-width": 2
5075
- }), j(" " + I(A(d).mediaLibrary.importing), 1)])) : (z(), t("span", qi, I(A(d).mediaLibrary.import), 1))], 8, Gi)])
5076
- ])], 40, Li)) : 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)]),
5077
5179
  _: 1
5078
5180
  })], 8, ["to"]));
5079
5181
  }
5080
- }), Yi = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, Xi = ["disabled", "onClick"], Zi = { class: "tpl:truncate" }, Qi = {
5182
+ }), na = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, ra = ["disabled", "onClick"], ia = { class: "tpl:truncate" }, aa = {
5081
5183
  key: 0,
5082
5184
  class: "tpl:shrink-0",
5083
5185
  style: { color: "var(--tpl-text-dim)" }
5084
- }, $i = /* @__PURE__ */ m({
5186
+ }, oa = /* @__PURE__ */ m({
5085
5187
  __name: "MediaMovePicker",
5086
5188
  props: {
5087
5189
  folders: {},
@@ -5089,7 +5191,7 @@ var ci = { class: "tpl:p-4" }, li = {
5089
5191
  },
5090
5192
  emits: ["select", "close"],
5091
5193
  setup(n, { emit: r }) {
5092
- let a = r, { t: o } = Ae(), s = e(null);
5194
+ let a = r, { t: o } = Re(), s = e(null);
5093
5195
  function c(e, t = 0) {
5094
5196
  let n = [];
5095
5197
  for (let r of e) n.push({
@@ -5099,7 +5201,7 @@ var ci = { class: "tpl:p-4" }, li = {
5099
5201
  }), r.children?.length && n.push(...c(r.children, t + 1));
5100
5202
  return n;
5101
5203
  }
5102
- return Qr(s, () => {
5204
+ return ai(s, () => {
5103
5205
  a("close");
5104
5206
  }), (e, r) => (z(), t("div", {
5105
5207
  ref_key: "pickerRef",
@@ -5109,7 +5211,7 @@ var ci = { class: "tpl:p-4" }, li = {
5109
5211
  "border-color": "var(--tpl-border)",
5110
5212
  "background-color": "var(--tpl-bg-elevated)"
5111
5213
  }
5112
- }, [i("div", Yi, [n.currentFolderId === null ? M("", !0) : (z(), t("button", {
5214
+ }, [i("div", na, [n.currentFolderId === null ? M("", !0) : (z(), t("button", {
5113
5215
  key: 0,
5114
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",
5115
5217
  style: { color: "var(--tpl-text)" },
@@ -5134,27 +5236,27 @@ var ci = { class: "tpl:p-4" }, li = {
5134
5236
  size: 14,
5135
5237
  "stroke-width": 1.5
5136
5238
  }),
5137
- i("span", Zi, I(e.name), 1),
5138
- e.id === n.currentFolderId ? (z(), t("span", Qi, I(A(o).mediaLibrary.currentFolder), 1)) : M("", !0)
5139
- ], 12, Xi))), 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));
5140
5242
  }
5141
- }), ea = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ta = ["src", "alt"], na = {
5243
+ }), sa = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ca = ["src", "alt"], la = {
5142
5244
  key: 1,
5143
5245
  class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
5144
5246
  style: { border: "1px solid var(--tpl-border)" }
5145
- }, ra = { class: "tpl:min-w-0 tpl:flex-1" }, ia = {
5247
+ }, ua = { class: "tpl:min-w-0 tpl:flex-1" }, da = {
5146
5248
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5147
5249
  style: { color: "var(--tpl-text)" }
5148
- }, aa = {
5250
+ }, fa = {
5149
5251
  class: "tpl:mt-0.5 tpl:text-[10px]",
5150
5252
  style: { color: "var(--tpl-text-muted)" }
5151
- }, oa = {
5253
+ }, pa = {
5152
5254
  key: 2,
5153
5255
  class: "tpl:shrink-0"
5154
- }, sa = {
5256
+ }, ma = {
5155
5257
  class: "tpl:block tpl:text-[10px]",
5156
5258
  style: { color: "var(--tpl-text-muted)" }
5157
- }, ca = ["value"], la = ["value"], ua = /*#__PURE__*/ mr(/* @__PURE__ */ m({
5259
+ }, ha = ["value"], ga = ["value"], _a = /*#__PURE__*/ xr(/* @__PURE__ */ m({
5158
5260
  __name: "MediaPreviewPanel",
5159
5261
  props: {
5160
5262
  item: {},
@@ -5163,7 +5265,7 @@ var ci = { class: "tpl:p-4" }, li = {
5163
5265
  },
5164
5266
  emits: ["update:selectedConversion"],
5165
5267
  setup(e, { emit: n }) {
5166
- let r = e, o = n, { t: s } = Ae(), { isImageMimeType: c } = Fe(), l = a(() => {
5268
+ let r = e, o = n, { t: s } = Re(), { isImageMimeType: c } = Ue(), l = a(() => {
5167
5269
  if (!g.value || !r.item.conversions_generated) return [];
5168
5270
  let e = [];
5169
5271
  return r.item.small_url && e.push({
@@ -5222,20 +5324,20 @@ var ci = { class: "tpl:p-4" }, li = {
5222
5324
  day: "numeric"
5223
5325
  });
5224
5326
  }
5225
- return (n, r) => (z(), t("div", ea, [
5327
+ return (n, r) => (z(), t("div", sa, [
5226
5328
  g.value ? (z(), t("img", {
5227
5329
  key: 0,
5228
5330
  src: d.value ?? void 0,
5229
5331
  alt: e.item.alt_text || e.item.filename,
5230
5332
  class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
5231
5333
  style: { border: "1px solid var(--tpl-border)" }
5232
- }, null, 8, ta)) : (z(), t("div", na, [p(kr, {
5334
+ }, null, 8, ca)) : (z(), t("div", la, [p(Ir, {
5233
5335
  "mime-type": e.item.mime_type,
5234
5336
  class: "tpl-preview-icon"
5235
5337
  }, null, 8, ["mime-type"])])),
5236
- i("div", ra, [
5237
- i("p", ia, I(e.item.filename), 1),
5238
- i("p", aa, [
5338
+ i("div", ua, [
5339
+ i("p", da, I(e.item.filename), 1),
5340
+ i("p", fa, [
5239
5341
  j(I(_(e.item.size)) + " · " + I(v(e.item.created_at)) + " ", 1),
5240
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),
5241
5343
  h.value ? (z(), t(R, { key: 1 }, [
@@ -5250,11 +5352,11 @@ var ci = { class: "tpl:p-4" }, li = {
5250
5352
  ]),
5251
5353
  g.value ? (z(), t("p", {
5252
5354
  key: 0,
5253
- class: k(["tpl:mt-0.5 tpl:truncate tpl:text-[10px] tpl:italic", { "tpl:invisible": !e.item.alt_text }]),
5355
+ class: O(["tpl:mt-0.5 tpl:truncate tpl:text-[10px] tpl:italic", { "tpl:invisible": !e.item.alt_text }]),
5254
5356
  style: { color: "var(--tpl-text-dim)" }
5255
5357
  }, I(e.item.alt_text || "\xA0"), 3)) : M("", !0)
5256
5358
  ]),
5257
- u.value ? (z(), t("div", oa, [i("label", sa, 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", {
5258
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",
5259
5361
  style: {
5260
5362
  "border-color": "var(--tpl-border)",
@@ -5266,36 +5368,36 @@ var ci = { class: "tpl:p-4" }, li = {
5266
5368
  }, [(z(!0), t(R, null, S(l.value, (e) => (z(), t("option", {
5267
5369
  key: e.value,
5268
5370
  value: e.value
5269
- }, I(e.label), 9, la))), 128))], 40, ca)])) : M("", !0)
5371
+ }, I(e.label), 9, ga))), 128))], 40, ha)])) : M("", !0)
5270
5372
  ]));
5271
5373
  }
5272
- }), [["__scopeId", "data-v-060e36cd"]]), da = ["data-tpl-theme"], fa = {
5374
+ }), [["__scopeId", "data-v-060e36cd"]]), va = ["data-tpl-theme"], ya = {
5273
5375
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
5274
5376
  style: { "background-color": "var(--tpl-bg-elevated)" }
5275
- }, pa = {
5377
+ }, ba = {
5276
5378
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
5277
5379
  style: { color: "var(--tpl-text)" }
5278
- }, ma = {
5380
+ }, xa = {
5279
5381
  class: "tpl:mb-2 tpl:text-xs",
5280
5382
  style: { color: "var(--tpl-text-muted)" }
5281
- }, ha = {
5383
+ }, Sa = {
5282
5384
  key: 0,
5283
5385
  class: "tpl:mb-3 tpl:text-xs",
5284
5386
  style: { color: "var(--tpl-warning)" }
5285
- }, ga = {
5387
+ }, Ca = {
5286
5388
  class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
5287
5389
  style: { "border-color": "var(--tpl-border)" }
5288
- }, _a = {
5390
+ }, wa = {
5289
5391
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5290
5392
  style: { color: "var(--tpl-text)" }
5291
- }, va = { class: "tpl:mb-4" }, ya = {
5393
+ }, Ta = { class: "tpl:mb-4" }, Ea = {
5292
5394
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
5293
5395
  style: { color: "var(--tpl-text-muted)" }
5294
- }, ba = ["accept"], xa = {
5396
+ }, Da = ["accept"], Oa = {
5295
5397
  key: 1,
5296
5398
  class: "tpl:mb-3 tpl:text-xs",
5297
5399
  style: { color: "var(--tpl-danger)" }
5298
- }, Sa = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ca = ["disabled"], wa = ["disabled"], Ta = /* @__PURE__ */ m({
5400
+ }, ka = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Aa = ["disabled"], ja = ["disabled"], Ma = /* @__PURE__ */ m({
5299
5401
  __name: "MediaReplaceModal",
5300
5402
  props: {
5301
5403
  visible: { type: Boolean },
@@ -5306,7 +5408,7 @@ var ci = { class: "tpl:p-4" }, li = {
5306
5408
  },
5307
5409
  emits: ["replace", "close"],
5308
5410
  setup(n, { emit: o }) {
5309
- let c = n, u = o, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ve, 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(() => {
5310
5412
  if (!c.item) return "";
5311
5413
  let e = c.item.filename.split(".");
5312
5414
  return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
@@ -5339,12 +5441,12 @@ var ci = { class: "tpl:p-4" }, li = {
5339
5441
  style: { "background-color": "var(--tpl-overlay)" },
5340
5442
  onClick: a[1] ||= r((e) => u("close"), ["self"]),
5341
5443
  onKeydown: w
5342
- }, [i("div", fa, [
5343
- i("h3", pa, I(A(d).mediaLibrary.replaceWarningTitle), 1),
5344
- i("p", ma, I(A(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
5345
- x.value ? (z(), t("p", ha, I(A(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : M("", !0),
5346
- i("div", ga, [i("p", _a, I(n.item.filename), 1)]),
5347
- i("div", va, [i("label", ya, 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", {
5348
5450
  ref_key: "fileInputRef",
5349
5451
  ref: g,
5350
5452
  type: "file",
@@ -5356,9 +5458,9 @@ var ci = { class: "tpl:p-4" }, li = {
5356
5458
  color: "var(--tpl-text)"
5357
5459
  },
5358
5460
  onChange: S
5359
- }, null, 40, ba)]),
5360
- n.error ? (z(), t("p", xa, I(n.error), 1)) : M("", !0),
5361
- i("div", Sa, [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", {
5362
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",
5363
5465
  style: {
5364
5466
  "border-color": "var(--tpl-border)",
@@ -5367,29 +5469,29 @@ var ci = { class: "tpl:p-4" }, li = {
5367
5469
  },
5368
5470
  disabled: n.isReplacing,
5369
5471
  onClick: a[0] ||= (e) => u("close")
5370
- }, I(A(d).mediaLibrary.cancel), 9, Ca), i("button", {
5472
+ }, I(A(d).mediaLibrary.cancel), 9, Aa), i("button", {
5371
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",
5372
5474
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5373
5475
  disabled: !_.value || n.isReplacing,
5374
5476
  onClick: C
5375
- }, I(n.isReplacing ? A(d).mediaLibrary.replacing : A(d).mediaLibrary.replace), 9, wa)])
5376
- ])], 40, da)) : M("", !0)]),
5477
+ }, I(n.isReplacing ? A(d).mediaLibrary.replacing : A(d).mediaLibrary.replace), 9, ja)])
5478
+ ])], 40, va)) : M("", !0)]),
5377
5479
  _: 1
5378
5480
  })], 8, ["to"]));
5379
5481
  }
5380
- }), Ea = {
5482
+ }), Na = {
5381
5483
  key: 0,
5382
5484
  class: "tpl:flex tpl:items-center tpl:gap-2"
5383
- }, Da = {
5485
+ }, Pa = {
5384
5486
  class: "tpl:text-xs",
5385
5487
  style: { color: "var(--tpl-text-muted)" }
5386
- }, Oa = {
5488
+ }, Fa = {
5387
5489
  class: "tpl:text-xs",
5388
5490
  style: { color: "var(--tpl-text-muted)" }
5389
- }, ka = {
5491
+ }, Ia = {
5390
5492
  class: "tpl:mt-1 tpl:text-[10px]",
5391
5493
  style: { color: "var(--tpl-text-dim)" }
5392
- }, Aa = /* @__PURE__ */ m({
5494
+ }, La = /* @__PURE__ */ m({
5393
5495
  __name: "MediaUploadZone",
5394
5496
  props: {
5395
5497
  isUploading: { type: Boolean },
@@ -5397,7 +5499,7 @@ var ci = { class: "tpl:p-4" }, li = {
5397
5499
  },
5398
5500
  emits: ["upload"],
5399
5501
  setup(n, { emit: r }) {
5400
- let a = r, { t: o, format: s } = Ae(), { allAcceptedMimeTypes: c, allAcceptedInputString: l, maxFileSize: u } = Fe(), d = e();
5502
+ let a = r, { t: o, format: s } = Re(), { allAcceptedMimeTypes: c, allAcceptedInputString: l, maxFileSize: u } = Ue(), d = e();
5401
5503
  function f(e) {
5402
5504
  let t = [];
5403
5505
  for (let n of Array.from(e)) c.value.includes(n.type) && n.size <= u.value && t.push(n);
@@ -5407,9 +5509,9 @@ var ci = { class: "tpl:p-4" }, li = {
5407
5509
  let t = f(e);
5408
5510
  t.length && a("upload", t);
5409
5511
  }
5410
- let { isOverDropZone: h } = ri(d, { onDrop: (e) => {
5512
+ let { isOverDropZone: h } = ui(d, { onDrop: (e) => {
5411
5513
  e?.length && m(e);
5412
- } }), { open: g, onChange: _ } = si({
5514
+ } }), { open: g, onChange: _ } = mi({
5413
5515
  accept: l.value,
5414
5516
  multiple: !0
5415
5517
  });
@@ -5418,18 +5520,18 @@ var ci = { class: "tpl:p-4" }, li = {
5418
5520
  }), (e, r) => (z(), t("div", {
5419
5521
  ref_key: "dropZoneRef",
5420
5522
  ref: d,
5421
- class: k(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", A(h) ? "tpl-upload-zone-active" : ""]),
5523
+ class: O(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", A(h) ? "tpl-upload-zone-active" : ""]),
5422
5524
  style: {
5423
5525
  "border-color": "var(--tpl-border-light)",
5424
5526
  "background-color": "var(--tpl-bg)"
5425
5527
  },
5426
5528
  onClick: r[0] ||= (e) => A(g)()
5427
- }, [n.isUploading ? (z(), t("div", Ea, [p(A(ce), {
5529
+ }, [n.isUploading ? (z(), t("div", Na, [p(A(ce), {
5428
5530
  class: "tpl-spinner",
5429
5531
  size: 20,
5430
5532
  "stroke-width": 2,
5431
5533
  style: { color: "var(--tpl-primary)" }
5432
- }), i("span", Da, 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, {
5433
5535
  current: n.uploadProgress.current,
5434
5536
  total: n.uploadProgress.total
5435
5537
  }) : A(o).mediaLibrary.uploading), 1)])) : (z(), t(R, { key: 1 }, [
@@ -5439,20 +5541,20 @@ var ci = { class: "tpl:p-4" }, li = {
5439
5541
  "stroke-width": 1.5,
5440
5542
  style: { color: "var(--tpl-text-dim)" }
5441
5543
  }),
5442
- i("p", Oa, I(A(o).mediaLibrary.dropOrClick), 1),
5443
- i("p", ka, 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)
5444
5546
  ], 64))], 2));
5445
5547
  }
5446
- }), ja = [
5548
+ }), Ra = [
5447
5549
  "width",
5448
5550
  "height",
5449
5551
  "viewBox"
5450
- ], Ma = [
5552
+ ], za = [
5451
5553
  "cx",
5452
5554
  "cy",
5453
5555
  "r",
5454
5556
  "stroke-width"
5455
- ], Na = [
5557
+ ], Ba = [
5456
5558
  "cx",
5457
5559
  "cy",
5458
5560
  "r",
@@ -5460,14 +5562,14 @@ var ci = { class: "tpl:p-4" }, li = {
5460
5562
  "stroke",
5461
5563
  "stroke-dasharray",
5462
5564
  "stroke-dashoffset"
5463
- ], Pa = {
5565
+ ], Va = {
5464
5566
  key: 0,
5465
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",
5466
5568
  style: {
5467
5569
  "background-color": "var(--tpl-text)",
5468
5570
  color: "var(--tpl-bg-elevated)"
5469
5571
  }
5470
- }, Fa = /* @__PURE__ */ m({
5572
+ }, Ha = /* @__PURE__ */ m({
5471
5573
  __name: "StorageProgressRing",
5472
5574
  props: {
5473
5575
  usedBytes: {},
@@ -5475,7 +5577,7 @@ var ci = { class: "tpl:p-4" }, li = {
5475
5577
  size: {}
5476
5578
  },
5477
5579
  setup(n) {
5478
- 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)");
5479
5581
  function _(e) {
5480
5582
  if (e === 0) return "0 B";
5481
5583
  let t = 1024, n = [
@@ -5507,7 +5609,7 @@ var ci = { class: "tpl:p-4" }, li = {
5507
5609
  fill: "none",
5508
5610
  "stroke-width": u.value,
5509
5611
  style: { stroke: "var(--tpl-border)" }
5510
- }, null, 8, Ma), i("circle", {
5612
+ }, null, 8, za), i("circle", {
5511
5613
  cx: l.value / 2,
5512
5614
  cy: l.value / 2,
5513
5615
  r: d.value,
@@ -5518,7 +5620,7 @@ var ci = { class: "tpl:p-4" }, li = {
5518
5620
  "stroke-dasharray": f.value,
5519
5621
  "stroke-dashoffset": h.value,
5520
5622
  class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
5521
- }, null, 8, Na)], 8, ja)), p(ve, {
5623
+ }, null, 8, Ba)], 8, Ra)), p(ve, {
5522
5624
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
5523
5625
  "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
5524
5626
  "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
@@ -5526,14 +5628,14 @@ var ci = { class: "tpl:p-4" }, li = {
5526
5628
  "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
5527
5629
  "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
5528
5630
  }, {
5529
- default: P(() => [c.value ? (z(), t("div", Pa, [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", {
5530
5632
  class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
5531
5633
  style: { "background-color": "var(--tpl-text)" }
5532
5634
  }, null, -1)])) : M("", !0)]),
5533
5635
  _: 1
5534
5636
  })], 32));
5535
5637
  }
5536
- }), Ia = class {
5638
+ }), Ua = class {
5537
5639
  authManager;
5538
5640
  constructor(e) {
5539
5641
  this.authManager = e;
@@ -5690,11 +5792,11 @@ var ci = { class: "tpl:p-4" }, li = {
5690
5792
  };
5691
5793
  //#endregion
5692
5794
  //#region src/composable.ts
5693
- function La(t) {
5795
+ function Wa(t) {
5694
5796
  if (!t.projectId) throw Error("projectId is required for useMediaLibrary");
5695
- let n = new Ia(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), T = e(!1), E = e(null), D = e(null), O = 0;
5696
- async function k() {
5697
- let e = ++O;
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;
5798
+ async function O() {
5799
+ let e = ++D;
5698
5800
  u.value = !0;
5699
5801
  try {
5700
5802
  let t = await n.browseMedia({
@@ -5703,18 +5805,18 @@ function La(t) {
5703
5805
  category: c.value || void 0,
5704
5806
  sort: l.value === "newest" ? void 0 : l.value
5705
5807
  });
5706
- if (e !== O) return;
5808
+ if (e !== D) return;
5707
5809
  r.value = t.data, p.value = t.meta.next_cursor, f.value = !!t.meta.next_cursor;
5708
5810
  } catch (n) {
5709
- if (e !== O) return;
5811
+ if (e !== D) return;
5710
5812
  t.onError?.(n);
5711
5813
  } finally {
5712
- e === O && (u.value = !1);
5814
+ e === D && (u.value = !1);
5713
5815
  }
5714
5816
  }
5715
- async function ee() {
5817
+ async function te() {
5716
5818
  if (!f.value || !p.value || u.value) return;
5717
- let e = ++O;
5819
+ let e = ++D;
5718
5820
  u.value = !0;
5719
5821
  try {
5720
5822
  let t = await n.browseMedia({
@@ -5724,26 +5826,26 @@ function La(t) {
5724
5826
  sort: l.value === "newest" ? void 0 : l.value,
5725
5827
  cursor: p.value
5726
5828
  });
5727
- if (e !== O) return;
5829
+ if (e !== D) return;
5728
5830
  r.value = [...r.value, ...t.data], p.value = t.meta.next_cursor, f.value = !!t.meta.next_cursor;
5729
5831
  } catch (n) {
5730
- if (e !== O) return;
5832
+ if (e !== D) return;
5731
5833
  t.onError?.(n);
5732
5834
  } finally {
5733
- e === O && (u.value = !1);
5835
+ e === D && (u.value = !1);
5734
5836
  }
5735
5837
  }
5736
- async function te(e) {
5737
- s.value = e, await k();
5738
- }
5739
5838
  async function ne(e) {
5740
- c.value = e, await k();
5839
+ s.value = e, await O();
5741
5840
  }
5742
5841
  async function re(e) {
5743
- l.value = e, await k();
5842
+ c.value = e, await O();
5744
5843
  }
5745
5844
  async function ie(e) {
5746
- o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
5845
+ l.value = e, await O();
5846
+ }
5847
+ async function k(e) {
5848
+ o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await O();
5747
5849
  }
5748
5850
  async function ae() {
5749
5851
  o.value = "frequently-used", a.value = null, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await ce();
@@ -5893,29 +5995,29 @@ function La(t) {
5893
5995
  async function ge(e) {
5894
5996
  try {
5895
5997
  let t = he(i.value, e)?.parent_id ?? null;
5896
- await n.deleteMediaFolder(e), a.value === e && (a.value = t), await me(), await k();
5998
+ await n.deleteMediaFolder(e), a.value === e && (a.value = t), await me(), await O();
5897
5999
  } catch (e) {
5898
6000
  t.onError?.(e);
5899
6001
  }
5900
6002
  }
5901
6003
  async function L(e) {
5902
- E.value = e, w.value = null;
6004
+ T.value = e, w.value = null;
5903
6005
  try {
5904
6006
  let t = await n.checkMediaUsage([e.id]);
5905
- D.value = t.data[e.id] ?? null, T.value = !0;
6007
+ E.value = t.data[e.id] ?? null, ee.value = !0;
5906
6008
  } catch (e) {
5907
6009
  t.onError?.(e);
5908
6010
  }
5909
6011
  }
5910
6012
  function _e() {
5911
- T.value = !1, E.value = null, D.value = null, w.value = null;
6013
+ ee.value = !1, T.value = null, E.value = null, w.value = null;
5912
6014
  }
5913
6015
  async function ve(e) {
5914
- if (!E.value) return null;
6016
+ if (!T.value) return null;
5915
6017
  C.value = !0, w.value = null;
5916
6018
  try {
5917
- let t = await n.replaceMedia(E.value.id, e);
5918
- return r.value = r.value.map((e) => e.id === t.id ? t : e), _.value = _.value.map((e) => e.id === t.id ? t : e), g.value?.id === t.id && (g.value = t), T.value = !1, E.value = null, D.value = null, t;
6019
+ let t = await n.replaceMedia(T.value.id, e);
6020
+ return r.value = r.value.map((e) => e.id === t.id ? t : e), _.value = _.value.map((e) => e.id === t.id ? t : e), g.value?.id === t.id && (g.value = t), ee.value = !1, T.value = null, E.value = null, t;
5919
6021
  } catch (e) {
5920
6022
  return w.value = e instanceof Error ? e.message : "Replace failed", t.onError?.(e), null;
5921
6023
  } finally {
@@ -5947,12 +6049,12 @@ function La(t) {
5947
6049
  frequentlyUsedItems: _,
5948
6050
  deleteUsageInfo: v,
5949
6051
  showDeleteWarning: y,
5950
- loadItems: k,
5951
- loadMore: ee,
5952
- search: te,
5953
- filterByCategory: ne,
5954
- sortBy: re,
5955
- navigateToFolder: ie,
6052
+ loadItems: O,
6053
+ loadMore: te,
6054
+ search: ne,
6055
+ filterByCategory: re,
6056
+ sortBy: ie,
6057
+ navigateToFolder: k,
5956
6058
  showFrequentlyUsed: ae,
5957
6059
  uploadFile: oe,
5958
6060
  uploadFiles: se,
@@ -5976,9 +6078,9 @@ function La(t) {
5976
6078
  cancelDelete: de,
5977
6079
  isReplacing: C,
5978
6080
  replaceError: w,
5979
- showReplaceWarning: T,
5980
- pendingReplaceItem: E,
5981
- replaceUsageInfo: D,
6081
+ showReplaceWarning: ee,
6082
+ pendingReplaceItem: T,
6083
+ replaceUsageInfo: E,
5982
6084
  checkUsageBeforeReplace: L,
5983
6085
  cancelReplace: _e,
5984
6086
  replaceFile: ve,
@@ -5987,117 +6089,117 @@ function La(t) {
5987
6089
  }
5988
6090
  //#endregion
5989
6091
  //#region src/composables/useMediaLibraryUI.ts
5990
- function Ra(t) {
5991
- let { library: n, canUseMediaFolders: r, translations: i } = t;
5992
- function o() {
5993
- return "value" in i && typeof i.value == "object" ? i.value : i;
6092
+ function Ga(t) {
6093
+ let { library: n, translations: r } = t;
6094
+ function i() {
6095
+ return "value" in r && typeof r.value == "object" ? r.value : r;
5994
6096
  }
5995
- let c = e("grid"), l = e(!1), u = e(""), d = e("original"), f = e(null), p = e(!1), m = e(!1), h = a(() => {
6097
+ let o = e("grid"), c = e(!1), l = e(""), u = e("original"), d = e(null), f = e(!1), p = e(!1), m = a(() => {
5996
6098
  let e = n.previewItem.value;
5997
6099
  if (!e) return null;
5998
- switch (d.value) {
6100
+ switch (u.value) {
5999
6101
  case "small": return e.small_url || e.url;
6000
6102
  case "medium": return e.medium_url || e.url;
6001
6103
  case "large": return e.large_url || e.url;
6002
6104
  default: return e.url;
6003
6105
  }
6004
- }), g = a(() => n.frequentlyUsedItems.value.length > 0), _ = a(() => n.viewMode.value === "frequently-used" ? n.frequentlyUsedItems.value : n.items.value), v = a(() => Object.values(n.deleteUsageInfo.value).some((e) => e.template_count > 0)), y = {
6005
- images: () => o().mediaLibrary.filterImages,
6006
- documents: () => o().mediaLibrary.filterDocuments,
6007
- videos: () => o().mediaLibrary.filterVideos,
6008
- audio: () => o().mediaLibrary.filterAudio
6106
+ }), h = a(() => n.frequentlyUsedItems.value.length > 0), g = a(() => n.viewMode.value === "frequently-used" ? n.frequentlyUsedItems.value : n.items.value), _ = a(() => Object.values(n.deleteUsageInfo.value).some((e) => e.template_count > 0)), v = {
6107
+ images: () => i().mediaLibrary.filterImages,
6108
+ documents: () => i().mediaLibrary.filterDocuments,
6109
+ videos: () => i().mediaLibrary.filterVideos,
6110
+ audio: () => i().mediaLibrary.filterAudio
6009
6111
  };
6010
- function b(e) {
6011
- return y[e]?.() ?? e;
6112
+ function y(e) {
6113
+ return v[e]?.() ?? e;
6012
6114
  }
6013
- s(l, (e) => {
6014
- e && r.value && n.loadFolders();
6115
+ s(c, (e) => {
6116
+ e && n.loadFolders();
6015
6117
  }), s(() => n.previewItem.value?.id, () => {
6016
- d.value = "original";
6118
+ u.value = "original";
6017
6119
  });
6018
- let x = Ur((e) => {
6120
+ let b = Xr((e) => {
6019
6121
  n.search(e);
6020
6122
  }, 300);
6021
- function S(e) {
6022
- u.value = e, x(e);
6123
+ function x(e) {
6124
+ l.value = e, b(e);
6023
6125
  }
6024
- let { copy: C, copied: w } = ni({
6126
+ let { copy: S, copied: C } = li({
6025
6127
  copiedDuring: 2e3,
6026
6128
  legacy: !0
6027
6129
  });
6028
- async function T(e) {
6130
+ async function w(e) {
6029
6131
  await n.uploadFiles(e);
6030
6132
  }
6031
- function E(e) {
6133
+ function ee(e) {
6032
6134
  n.selectItem(e);
6033
6135
  }
6034
- async function D(e, t) {
6136
+ async function T(e, t) {
6035
6137
  await n.createFolder(e, t);
6036
6138
  }
6037
- async function O(e, t) {
6139
+ async function E(e, t) {
6038
6140
  await n.renameFolder(e, t);
6039
6141
  }
6040
- async function k(e) {
6142
+ async function D(e) {
6041
6143
  await n.deleteFolder(e);
6042
6144
  }
6043
- function ee(e) {
6044
- f.value = e;
6145
+ function O(e) {
6146
+ d.value = e;
6045
6147
  }
6046
6148
  async function te(e, t, r, i) {
6047
- i && await n.replaceMediaDirectly(e, i.file), await n.updateFile(e, t, r), f.value = null;
6149
+ i && await n.replaceMediaDirectly(e, i.file), await n.updateFile(e, t, r), d.value = null;
6048
6150
  }
6049
6151
  async function ne(e) {
6050
- await n.importFromUrl(e) && (p.value = !1);
6152
+ await n.importFromUrl(e) && (f.value = !1);
6051
6153
  }
6052
6154
  async function re(e) {
6053
- m.value = !1, await n.moveSelected(e);
6155
+ p.value = !1, await n.moveSelected(e);
6054
6156
  }
6055
6157
  async function ie() {
6056
6158
  await n.checkUsageBeforeDelete();
6057
6159
  }
6058
- function ae(e) {
6160
+ function k(e) {
6059
6161
  n.checkUsageBeforeReplace(e);
6060
6162
  }
6061
- async function oe(e) {
6163
+ async function ae(e) {
6062
6164
  await n.replaceFile(e);
6063
6165
  }
6064
- function se() {
6065
- n.clearSelection(), n.cancelDelete(), n.cancelReplace(), u.value = "", n.categoryFilter.value = null, n.sortOption.value = "newest", n.viewMode.value = "files", f.value = null, p.value = !1, d.value = "original";
6166
+ function oe() {
6167
+ n.clearSelection(), n.cancelDelete(), n.cancelReplace(), l.value = "", n.categoryFilter.value = null, n.sortOption.value = "newest", n.viewMode.value = "files", d.value = null, f.value = !1, u.value = "original";
6066
6168
  }
6067
6169
  return {
6068
- layoutMode: c,
6069
- showSidebar: l,
6070
- searchInput: u,
6071
- selectedConversion: d,
6072
- editingItem: f,
6073
- showImportUrlModal: p,
6074
- showMovePicker: m,
6075
- selectedUrl: h,
6076
- hasFrequentlyUsed: g,
6077
- displayItems: _,
6078
- hasUsedFiles: v,
6079
- copy: C,
6080
- copied: w,
6081
- getCategoryLabel: b,
6082
- handleSearchInput: S,
6083
- handleUpload: T,
6084
- handleSelect: E,
6085
- handleCreateFolder: D,
6086
- handleRenameFolder: O,
6087
- handleDeleteFolder: k,
6088
- handleEditItem: ee,
6170
+ layoutMode: o,
6171
+ showSidebar: c,
6172
+ searchInput: l,
6173
+ selectedConversion: u,
6174
+ editingItem: d,
6175
+ showImportUrlModal: f,
6176
+ showMovePicker: p,
6177
+ selectedUrl: m,
6178
+ hasFrequentlyUsed: h,
6179
+ displayItems: g,
6180
+ hasUsedFiles: _,
6181
+ copy: S,
6182
+ copied: C,
6183
+ getCategoryLabel: y,
6184
+ handleSearchInput: x,
6185
+ handleUpload: w,
6186
+ handleSelect: ee,
6187
+ handleCreateFolder: T,
6188
+ handleRenameFolder: E,
6189
+ handleDeleteFolder: D,
6190
+ handleEditItem: O,
6089
6191
  handleEditSave: te,
6090
6192
  handleImportFromUrl: ne,
6091
6193
  handleMoveToFolder: re,
6092
6194
  handleDeleteClick: ie,
6093
- handleReplaceItem: ae,
6094
- handleReplaceFile: oe,
6095
- resetUI: se
6195
+ handleReplaceItem: k,
6196
+ handleReplaceFile: ae,
6197
+ resetUI: oe
6096
6198
  };
6097
6199
  }
6098
6200
  //#endregion
6099
6201
  //#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
6100
- var za = {
6202
+ var Ka = {
6101
6203
  class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
6102
6204
  style: {
6103
6205
  width: "100%",
@@ -6105,62 +6207,59 @@ var za = {
6105
6207
  "background-color": "var(--tpl-bg-elevated)",
6106
6208
  border: "1px solid var(--tpl-border)"
6107
6209
  }
6108
- }, Ba = {
6210
+ }, qa = {
6109
6211
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
6110
6212
  style: { "border-color": "var(--tpl-border)" }
6111
- }, Va = {
6213
+ }, Ja = {
6112
6214
  class: "tpl:text-sm tpl:font-semibold",
6113
6215
  style: { color: "var(--tpl-text)" }
6114
- }, Ha = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Ua = { class: "tpl:relative" }, Wa = ["value", "placeholder"], Ga = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Ka = {
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 = {
6115
6217
  key: 0,
6116
6218
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
6117
6219
  style: {
6118
6220
  "border-color": "var(--tpl-border)",
6119
6221
  "background-color": "var(--tpl-bg)"
6120
6222
  }
6121
- }, qa = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Ja = {
6223
+ }, eo = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, to = {
6122
6224
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
6123
6225
  style: { "border-color": "var(--tpl-border)" }
6124
- }, Ya = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Xa = ["title"], Za = {
6125
- key: 1,
6226
+ }, no = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ro = ["title"], io = {
6227
+ key: 0,
6126
6228
  class: "tpl:text-xs tpl:font-medium",
6127
6229
  style: { color: "var(--tpl-text)" }
6128
- }, Qa = {
6230
+ }, ao = {
6129
6231
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
6130
6232
  style: {
6131
6233
  border: "1px solid var(--tpl-border)",
6132
6234
  "background-color": "var(--tpl-bg)"
6133
6235
  }
6134
- }, $a = ["title"], eo = ["title"], to = { class: "tpl:flex tpl:items-center tpl:gap-2" }, no = ["value"], ro = { value: "" }, io = ["value"], ao = ["value"], oo = { value: "newest" }, so = { value: "oldest" }, co = { value: "name_asc" }, lo = { value: "name_desc" }, uo = { value: "size_asc" }, fo = { value: "size_desc" }, po = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, mo = {
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 = {
6135
6237
  key: 0,
6136
6238
  class: "tpl:px-4 tpl:pt-3"
6137
- }, ho = {
6239
+ }, So = {
6138
6240
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
6139
6241
  style: {
6140
6242
  "background-color": "var(--tpl-bg-elevated)",
6141
6243
  "box-shadow": "var(--tpl-shadow-xl)"
6142
6244
  }
6143
- }, go = {
6245
+ }, Co = {
6144
6246
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
6145
6247
  style: { color: "var(--tpl-text)" }
6146
- }, _o = {
6248
+ }, wo = {
6147
6249
  key: 0,
6148
6250
  class: "tpl:mb-4 tpl:text-xs",
6149
6251
  style: { color: "var(--tpl-text-muted)" }
6150
- }, vo = {
6252
+ }, To = {
6151
6253
  key: 1,
6152
6254
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
6153
6255
  style: { "border-color": "var(--tpl-border)" }
6154
- }, yo = { class: "tpl:font-medium" }, bo = { style: { color: "var(--tpl-text-muted)" } }, xo = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, So = {
6256
+ }, Eo = { class: "tpl:font-medium" }, Do = { style: { color: "var(--tpl-text-muted)" } }, Oo = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, ko = {
6155
6257
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
6156
6258
  style: { "border-color": "var(--tpl-border)" }
6157
- }, Co = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, wo = { class: "tpl:flex tpl:items-center tpl:gap-5" }, To = {
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 = {
6158
6260
  key: 0,
6159
6261
  class: "tpl:flex tpl:items-center tpl:gap-2"
6160
- }, Eo = {
6161
- key: 1,
6162
- class: "tpl:relative"
6163
- }, Do = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Oo = ["disabled"], ko = /* @__PURE__ */ m({
6262
+ }, No = { class: "tpl:relative" }, Po = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Fo = ["disabled"], Io = /* @__PURE__ */ m({
6164
6263
  __name: "MediaLibrary",
6165
6264
  props: {
6166
6265
  authManager: {},
@@ -6173,41 +6272,40 @@ var za = {
6173
6272
  emits: ["ready"],
6174
6273
  setup(o, { emit: s }) {
6175
6274
  let c = o, l = s, u = a(() => c.translations);
6176
- n("translations", c.translations), n("authManager", c.authManager), n("projectId", a(() => c.projectId));
6177
- let d = e(c.planConfig);
6178
- n("planConfig", {
6179
- config: d,
6275
+ n(Pe, e(c.translations));
6276
+ let d = {
6277
+ config: e(c.planConfig),
6180
6278
  isLoading: e(!1),
6181
6279
  hasFeature: (e) => c.planConfig.features[e] ?? !1,
6182
6280
  features: a(() => c.planConfig.features),
6183
6281
  fetchConfig: async () => {}
6184
- });
6185
- let f = a(() => c.planConfig.features.media_folders ?? !1), m = a(() => c.planConfig.features.import_from_url ?? !1), g = a(() => c.planConfig.storage.used_bytes ?? 0), _ = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: y } = Fe(), b = La({
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({
6186
6285
  projectId: c.projectId,
6187
6286
  authManager: c.authManager,
6188
6287
  onError: c.onError
6189
- }), x = Ra({
6190
- library: b,
6191
- canUseMediaFolders: f,
6288
+ }), y = Ga({
6289
+ library: _,
6192
6290
  translations: u
6193
6291
  });
6194
- function C() {
6195
- if (!b.previewItem.value) return;
6196
- let e = b.previewItem.value;
6292
+ function b() {
6293
+ if (!_.previewItem.value) return;
6294
+ let e = _.previewItem.value;
6197
6295
  c.onSelect?.({
6198
6296
  ...e,
6199
- url: x.selectedUrl.value || e.url
6297
+ url: y.selectedUrl.value || e.url
6200
6298
  });
6201
6299
  }
6202
6300
  return v(() => {
6203
- b.loadItems(), b.loadFrequentlyUsed(), l("ready");
6204
- }), (e, n) => (z(), t("div", za, [
6205
- i("div", Ba, [i("h2", Va, I(u.value.mediaLibrary.title), 1), i("div", Ha, [p(Fa, {
6206
- "used-bytes": g.value,
6207
- "limit-bytes": _.value,
6301
+ _.loadItems(), _.loadFrequentlyUsed(), l("ready");
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, {
6304
+ "used-bytes": f.value,
6305
+ "limit-bytes": m.value,
6208
6306
  size: 22
6209
- }, null, 8, ["used-bytes", "limit-bytes"]), i("div", Ua, [i("input", {
6210
- value: A(x).searchInput.value,
6307
+ }, null, 8, ["used-bytes", "limit-bytes"]), i("div", Xa, [i("input", {
6308
+ value: A(y).searchInput.value,
6211
6309
  type: "text",
6212
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)]",
6213
6311
  style: {
@@ -6216,14 +6314,14 @@ var za = {
6216
6314
  color: "var(--tpl-text)"
6217
6315
  },
6218
6316
  placeholder: u.value.mediaLibrary.searchPlaceholder,
6219
- onInput: n[0] ||= (e) => A(x).handleSearchInput(e.target.value)
6220
- }, null, 40, Wa), p(A(se), {
6317
+ onInput: n[0] ||= (e) => A(y).handleSearchInput(e.target.value)
6318
+ }, null, 40, Za), p(A(se), {
6221
6319
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
6222
6320
  size: 13,
6223
6321
  "stroke-width": 2,
6224
6322
  style: { color: "var(--tpl-text-dim)" }
6225
6323
  })])])]),
6226
- i("div", Ga, [p(ve, {
6324
+ i("div", Qa, [p(ve, {
6227
6325
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
6228
6326
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
6229
6327
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -6231,16 +6329,16 @@ var za = {
6231
6329
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
6232
6330
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
6233
6331
  }, {
6234
- default: P(() => [f.value && A(x).showSidebar.value ? (z(), t("div", Ka, [p(Dr, {
6235
- folders: A(b).folders.value,
6236
- "current-folder-id": A(b).currentFolderId.value,
6237
- "view-mode": A(b).viewMode.value,
6238
- "has-frequently-used": A(x).hasFrequentlyUsed.value,
6239
- onNavigate: A(b).navigateToFolder,
6240
- onCreateFolder: A(x).handleCreateFolder,
6241
- onRenameFolder: A(x).handleRenameFolder,
6242
- onDeleteFolder: A(x).handleDeleteFolder,
6243
- onShowFrequentlyUsed: A(b).showFrequentlyUsed
6332
+ default: P(() => [A(y).showSidebar.value ? (z(), t("div", $a, [p(Pr, {
6333
+ folders: A(_).folders.value,
6334
+ "current-folder-id": A(_).currentFolderId.value,
6335
+ "view-mode": A(_).viewMode.value,
6336
+ "has-frequently-used": A(y).hasFrequentlyUsed.value,
6337
+ onNavigate: A(_).navigateToFolder,
6338
+ onCreateFolder: A(y).handleCreateFolder,
6339
+ onRenameFolder: A(y).handleRenameFolder,
6340
+ onDeleteFolder: A(y).handleDeleteFolder,
6341
+ onShowFrequentlyUsed: A(_).showFrequentlyUsed
6244
6342
  }, null, 8, [
6245
6343
  "folders",
6246
6344
  "current-folder-id",
@@ -6253,55 +6351,54 @@ var za = {
6253
6351
  "onShowFrequentlyUsed"
6254
6352
  ])])) : M("", !0)]),
6255
6353
  _: 1
6256
- }), i("div", qa, [i("div", Ja, [i("div", Ya, [
6257
- f.value ? (z(), t("button", {
6258
- key: 0,
6354
+ }), i("div", eo, [i("div", to, [i("div", no, [
6355
+ i("button", {
6259
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",
6260
6357
  style: N({
6261
- color: A(x).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6262
- backgroundColor: A(x).showSidebar.value ? "var(--tpl-bg)" : "transparent",
6263
- border: A(x).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
6358
+ color: A(y).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6359
+ backgroundColor: A(y).showSidebar.value ? "var(--tpl-bg)" : "transparent",
6360
+ border: A(y).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
6264
6361
  }),
6265
- title: A(x).showSidebar.value ? u.value.mediaLibrary.hideFolders : u.value.mediaLibrary.showFolders,
6266
- onClick: n[1] ||= (e) => A(x).showSidebar.value = !A(x).showSidebar.value
6267
- }, [p(A(te), {
6362
+ title: A(y).showSidebar.value ? u.value.mediaLibrary.hideFolders : u.value.mediaLibrary.showFolders,
6363
+ onClick: n[1] ||= (e) => A(y).showSidebar.value = !A(y).showSidebar.value
6364
+ }, [p(A(ne), {
6268
6365
  size: 16,
6269
6366
  "stroke-width": 2
6270
- })], 12, Xa)) : M("", !0),
6271
- A(b).viewMode.value === "frequently-used" ? (z(), t("span", Za, I(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(Pe, {
6272
- key: 2,
6273
- folders: A(b).folders.value,
6274
- "current-folder-id": A(b).currentFolderId.value,
6275
- onNavigate: A(b).navigateToFolder
6367
+ })], 12, ro),
6368
+ A(_).viewMode.value === "frequently-used" ? (z(), t("span", io, I(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(He, {
6369
+ key: 1,
6370
+ folders: A(_).folders.value,
6371
+ "current-folder-id": A(_).currentFolderId.value,
6372
+ onNavigate: A(_).navigateToFolder
6276
6373
  }, null, 8, [
6277
6374
  "folders",
6278
6375
  "current-folder-id",
6279
6376
  "onNavigate"
6280
6377
  ])),
6281
- i("div", Qa, [i("button", {
6378
+ i("div", ao, [i("button", {
6282
6379
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6283
6380
  style: N({
6284
- color: A(x).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6285
- backgroundColor: A(x).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
6381
+ color: A(y).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6382
+ backgroundColor: A(y).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
6286
6383
  }),
6287
6384
  title: u.value.mediaLibrary.viewGrid,
6288
- onClick: n[2] ||= (e) => A(x).layoutMode.value = "grid"
6289
- }, [p(A(ie), {
6385
+ onClick: n[2] ||= (e) => A(y).layoutMode.value = "grid"
6386
+ }, [p(A(k), {
6290
6387
  size: 14,
6291
6388
  "stroke-width": 2
6292
- })], 12, $a), i("button", {
6389
+ })], 12, oo), i("button", {
6293
6390
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6294
6391
  style: N({
6295
- color: A(x).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6296
- backgroundColor: A(x).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
6392
+ color: A(y).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6393
+ backgroundColor: A(y).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
6297
6394
  }),
6298
6395
  title: u.value.mediaLibrary.viewList,
6299
- onClick: n[3] ||= (e) => A(x).layoutMode.value = "list"
6396
+ onClick: n[3] ||= (e) => A(y).layoutMode.value = "list"
6300
6397
  }, [p(A(_e), {
6301
6398
  size: 14,
6302
6399
  "stroke-width": 2
6303
- })], 12, eo)])
6304
- ]), i("div", to, [A(y).length > 1 ? (z(), t("select", {
6400
+ })], 12, so)])
6401
+ ]), i("div", co, [A(g).length > 1 ? (z(), t("select", {
6305
6402
  key: 0,
6306
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",
6307
6404
  style: {
@@ -6309,58 +6406,57 @@ var za = {
6309
6406
  "background-color": "var(--tpl-bg)",
6310
6407
  color: "var(--tpl-text)"
6311
6408
  },
6312
- value: A(b).categoryFilter.value ?? "",
6313
- onChange: n[4] ||= (e) => A(b).filterByCategory(e.target.value || null)
6314
- }, [i("option", ro, I(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(A(y), (e) => (z(), t("option", {
6409
+ value: A(_).categoryFilter.value ?? "",
6410
+ onChange: n[4] ||= (e) => A(_).filterByCategory(e.target.value || null)
6411
+ }, [i("option", uo, I(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(A(g), (e) => (z(), t("option", {
6315
6412
  key: e,
6316
6413
  value: e
6317
- }, I(A(x).getCategoryLabel(e)), 9, io))), 128))], 40, no)) : M("", !0), i("select", {
6414
+ }, I(A(y).getCategoryLabel(e)), 9, fo))), 128))], 40, lo)) : M("", !0), i("select", {
6318
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",
6319
6416
  style: {
6320
6417
  "border-color": "var(--tpl-border)",
6321
6418
  "background-color": "var(--tpl-bg)",
6322
6419
  color: "var(--tpl-text)"
6323
6420
  },
6324
- value: A(b).sortOption.value,
6325
- onChange: n[5] ||= (e) => A(b).sortBy(e.target.value)
6421
+ value: A(_).sortOption.value,
6422
+ onChange: n[5] ||= (e) => A(_).sortBy(e.target.value)
6326
6423
  }, [
6327
- i("option", oo, I(u.value.mediaLibrary.sortNewest), 1),
6328
- i("option", so, I(u.value.mediaLibrary.sortOldest), 1),
6329
- i("option", co, I(u.value.mediaLibrary.sortNameAsc), 1),
6330
- i("option", lo, I(u.value.mediaLibrary.sortNameDesc), 1),
6331
- i("option", uo, I(u.value.mediaLibrary.sortSizeAsc), 1),
6332
- i("option", fo, I(u.value.mediaLibrary.sortSizeDesc), 1)
6333
- ], 40, ao)])]), i("div", po, [A(b).viewMode.value === "files" ? (z(), t("div", mo, [p(Aa, {
6334
- "is-uploading": A(b).isUploading.value,
6335
- "upload-progress": A(b).uploadProgress.value,
6336
- onUpload: A(x).handleUpload
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, {
6431
+ "is-uploading": A(_).isUploading.value,
6432
+ "upload-progress": A(_).uploadProgress.value,
6433
+ onUpload: A(y).handleUpload
6337
6434
  }, null, 8, [
6338
6435
  "is-uploading",
6339
6436
  "upload-progress",
6340
6437
  "onUpload"
6341
- ]), m.value ? (z(), t("button", {
6342
- key: 0,
6438
+ ]), i("button", {
6343
6439
  class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6344
6440
  style: {
6345
6441
  "border-color": "var(--tpl-border)",
6346
6442
  color: "var(--tpl-text-muted)",
6347
6443
  "background-color": "var(--tpl-bg)"
6348
6444
  },
6349
- onClick: n[6] ||= (e) => A(x).showImportUrlModal.value = !0
6350
- }, [p(A(ne), {
6445
+ onClick: n[6] ||= (e) => A(y).showImportUrlModal.value = !0
6446
+ }, [p(A(re), {
6351
6447
  size: 14,
6352
6448
  "stroke-width": 2
6353
- }), j(" " + I(u.value.mediaLibrary.importFromUrl), 1)])) : M("", !0)])) : M("", !0), p(Ii, {
6354
- items: A(x).displayItems.value,
6355
- "selected-ids": A(b).selectedItems.value,
6356
- "is-loading": A(b).isLoading.value,
6357
- "has-more": A(b).viewMode.value === "files" && A(b).hasMore.value,
6358
- layout: A(x).layoutMode.value,
6359
- onSelect: A(x).handleSelect,
6360
- onToggle: A(b).toggleSelection,
6361
- onLoadMore: A(b).loadMore,
6362
- onEdit: A(x).handleEditItem,
6363
- onReplace: A(x).handleReplaceItem
6449
+ }), j(" " + I(u.value.mediaLibrary.importFromUrl), 1)])])) : M("", !0), p(Ui, {
6450
+ items: A(y).displayItems.value,
6451
+ "selected-ids": A(_).selectedItems.value,
6452
+ "is-loading": A(_).isLoading.value,
6453
+ "has-more": A(_).viewMode.value === "files" && A(_).hasMore.value,
6454
+ layout: A(y).layoutMode.value,
6455
+ onSelect: A(y).handleSelect,
6456
+ onToggle: A(_).toggleSelection,
6457
+ onLoadMore: A(_).loadMore,
6458
+ onEdit: A(y).handleEditItem,
6459
+ onReplace: A(y).handleReplaceItem
6364
6460
  }, null, 8, [
6365
6461
  "items",
6366
6462
  "selected-ids",
@@ -6373,36 +6469,36 @@ var za = {
6373
6469
  "onEdit",
6374
6470
  "onReplace"
6375
6471
  ])])])]),
6376
- p(Ji, {
6377
- visible: A(x).showImportUrlModal.value,
6378
- "is-importing": A(b).isImportingFromUrl.value,
6379
- error: A(b).importFromUrlError.value,
6380
- onImport: A(x).handleImportFromUrl,
6381
- onClose: n[7] ||= (e) => A(x).showImportUrlModal.value = !1
6472
+ p(ta, {
6473
+ visible: A(y).showImportUrlModal.value,
6474
+ "is-importing": A(_).isImportingFromUrl.value,
6475
+ error: A(_).importFromUrlError.value,
6476
+ onImport: A(y).handleImportFromUrl,
6477
+ onClose: n[7] ||= (e) => A(y).showImportUrlModal.value = !1
6382
6478
  }, null, 8, [
6383
6479
  "visible",
6384
6480
  "is-importing",
6385
6481
  "error",
6386
6482
  "onImport"
6387
6483
  ]),
6388
- p(hr, {
6389
- visible: !!A(x).editingItem.value,
6390
- item: A(x).editingItem.value,
6391
- onSave: A(x).handleEditSave,
6392
- onClose: n[8] ||= (e) => A(x).editingItem.value = null
6484
+ p(Sr, {
6485
+ visible: !!A(y).editingItem.value,
6486
+ item: A(y).editingItem.value,
6487
+ onSave: A(y).handleEditSave,
6488
+ onClose: n[8] ||= (e) => A(y).editingItem.value = null
6393
6489
  }, null, 8, [
6394
6490
  "visible",
6395
6491
  "item",
6396
6492
  "onSave"
6397
6493
  ]),
6398
- p(Ta, {
6399
- visible: A(b).showReplaceWarning.value,
6400
- item: A(b).pendingReplaceItem.value,
6401
- "usage-info": A(b).replaceUsageInfo.value,
6402
- "is-replacing": A(b).isReplacing.value,
6403
- error: A(b).replaceError.value,
6404
- onReplace: A(x).handleReplaceFile,
6405
- onClose: A(b).cancelReplace
6494
+ p(Ma, {
6495
+ visible: A(_).showReplaceWarning.value,
6496
+ item: A(_).pendingReplaceItem.value,
6497
+ "usage-info": A(_).replaceUsageInfo.value,
6498
+ "is-replacing": A(_).isReplacing.value,
6499
+ error: A(_).replaceError.value,
6500
+ onReplace: A(y).handleReplaceFile,
6501
+ onClose: A(_).cancelReplace
6406
6502
  }, null, 8, [
6407
6503
  "visible",
6408
6504
  "item",
@@ -6420,7 +6516,7 @@ var za = {
6420
6516
  "leave-from-class": "tpl:opacity-100",
6421
6517
  "leave-to-class": "tpl:opacity-0"
6422
6518
  }, {
6423
- default: P(() => [A(b).showDeleteWarning.value ? (z(), t("div", {
6519
+ default: P(() => [A(_).showDeleteWarning.value ? (z(), t("div", {
6424
6520
  key: 0,
6425
6521
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
6426
6522
  style: {
@@ -6428,27 +6524,27 @@ var za = {
6428
6524
  "backdrop-filter": "blur(8px)",
6429
6525
  "-webkit-backdrop-filter": "blur(8px)"
6430
6526
  },
6431
- onClick: n[11] ||= r((...e) => A(b).cancelDelete && A(b).cancelDelete(...e), ["self"])
6432
- }, [i("div", ho, [
6433
- i("h3", go, I(u.value.mediaLibrary.deleteWarningTitle), 1),
6527
+ onClick: n[11] ||= r((...e) => A(_).cancelDelete && A(_).cancelDelete(...e), ["self"])
6528
+ }, [i("div", So, [
6529
+ i("h3", Co, I(u.value.mediaLibrary.deleteWarningTitle), 1),
6434
6530
  i("p", {
6435
- class: k(["tpl:text-xs", A(x).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
6531
+ class: O(["tpl:text-xs", A(y).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
6436
6532
  style: { color: "var(--tpl-text-muted)" }
6437
6533
  }, I(u.value.mediaLibrary.deleteWarningMessage), 3),
6438
- A(x).hasUsedFiles.value ? (z(), t("p", _o, I(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : M("", !0),
6439
- A(x).hasUsedFiles.value ? (z(), t("div", vo, [(z(!0), t(R, null, S(A(b).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", {
6440
6536
  key: n,
6441
6537
  class: "tpl:text-xs",
6442
6538
  style: { color: "var(--tpl-text)" }
6443
- }, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", yo, I(A(x).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", bo, " - " + I(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : M("", !0)]))), 128))])) : M("", !0),
6444
- i("div", xo, [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", {
6445
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",
6446
6542
  style: {
6447
6543
  "border-color": "var(--tpl-border)",
6448
6544
  color: "var(--tpl-text)",
6449
6545
  "background-color": "var(--tpl-bg)"
6450
6546
  },
6451
- onClick: n[9] ||= (...e) => A(b).cancelDelete && A(b).cancelDelete(...e)
6547
+ onClick: n[9] ||= (...e) => A(_).cancelDelete && A(_).cancelDelete(...e)
6452
6548
  }, I(u.value.mediaLibrary.cancel), 1), i("button", {
6453
6549
  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",
6454
6550
  style: {
@@ -6456,31 +6552,31 @@ var za = {
6456
6552
  color: "var(--tpl-danger)",
6457
6553
  "background-color": "var(--tpl-danger-light)"
6458
6554
  },
6459
- onClick: n[10] ||= (...e) => A(b).confirmDelete && A(b).confirmDelete(...e)
6460
- }, I(A(x).hasUsedFiles.value ? u.value.mediaLibrary.deleteAnyway : u.value.mediaLibrary.confirmDelete), 1)])
6555
+ onClick: n[10] ||= (...e) => A(_).confirmDelete && A(_).confirmDelete(...e)
6556
+ }, I(A(y).hasUsedFiles.value ? u.value.mediaLibrary.deleteAnyway : u.value.mediaLibrary.confirmDelete), 1)])
6461
6557
  ])])) : M("", !0)]),
6462
6558
  _: 1
6463
6559
  }),
6464
- i("div", So, [i("div", Co, [A(b).previewItem.value ? (z(), h(ua, {
6560
+ i("div", ko, [i("div", Ao, [A(_).previewItem.value ? (z(), h(_a, {
6465
6561
  key: 0,
6466
- "selected-conversion": A(x).selectedConversion.value,
6467
- "onUpdate:selectedConversion": n[12] ||= (e) => A(x).selectedConversion.value = e,
6468
- item: A(b).previewItem.value,
6469
- folders: A(b).folders.value
6562
+ "selected-conversion": A(y).selectedConversion.value,
6563
+ "onUpdate:selectedConversion": n[12] ||= (e) => A(y).selectedConversion.value = e,
6564
+ item: A(_).previewItem.value,
6565
+ folders: A(_).folders.value
6470
6566
  }, null, 8, [
6471
6567
  "selected-conversion",
6472
6568
  "item",
6473
6569
  "folders"
6474
- ])) : M("", !0)]), i("div", wo, [A(b).selectedItems.value.size > 0 ? (z(), t("div", To, [A(b).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", {
6475
6571
  key: 0,
6476
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",
6477
6573
  style: N({
6478
- borderColor: A(x).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
6479
- color: A(x).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
6574
+ borderColor: A(y).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
6575
+ color: A(y).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
6480
6576
  backgroundColor: "var(--tpl-bg)"
6481
6577
  }),
6482
- onClick: n[13] ||= (e) => A(x).copy(A(x).selectedUrl.value)
6483
- }, [A(x).copied.value ? (z(), h(A(D), {
6578
+ onClick: n[13] ||= (e) => A(y).copy(A(y).selectedUrl.value)
6579
+ }, [A(y).copied.value ? (z(), h(A(E), {
6484
6580
  key: 1,
6485
6581
  size: 12,
6486
6582
  "stroke-width": 2
@@ -6488,25 +6584,25 @@ var za = {
6488
6584
  key: 0,
6489
6585
  size: 12,
6490
6586
  "stroke-width": 2
6491
- })), j(" " + I(A(x).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : M("", !0), f.value ? (z(), t("div", Eo, [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", {
6492
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",
6493
6589
  style: {
6494
6590
  "border-color": "var(--tpl-border)",
6495
6591
  color: "var(--tpl-text)",
6496
6592
  "background-color": "var(--tpl-bg)"
6497
6593
  },
6498
- onClick: n[14] ||= (e) => A(x).showMovePicker.value = !A(x).showMovePicker.value
6499
- }, I(u.value.mediaLibrary.moveSelected), 1), A(x).showMovePicker.value ? (z(), h($i, {
6594
+ onClick: n[14] ||= (e) => A(y).showMovePicker.value = !A(y).showMovePicker.value
6595
+ }, I(u.value.mediaLibrary.moveSelected), 1), A(y).showMovePicker.value ? (z(), h(oa, {
6500
6596
  key: 0,
6501
- folders: A(b).folders.value,
6502
- "current-folder-id": A(b).currentFolderId.value,
6503
- onSelect: A(x).handleMoveToFolder,
6504
- onClose: n[15] ||= (e) => A(x).showMovePicker.value = !1
6597
+ folders: A(_).folders.value,
6598
+ "current-folder-id": A(_).currentFolderId.value,
6599
+ onSelect: A(y).handleMoveToFolder,
6600
+ onClose: n[15] ||= (e) => A(y).showMovePicker.value = !1
6505
6601
  }, null, 8, [
6506
6602
  "folders",
6507
6603
  "current-folder-id",
6508
6604
  "onSelect"
6509
- ])) : M("", !0)])) : M("", !0)])) : M("", !0), i("div", Do, [A(b).selectedItems.value.size > 0 ? (z(), t("button", {
6605
+ ])) : M("", !0)])])) : M("", !0), i("div", Po, [A(_).selectedItems.value.size > 0 ? (z(), t("button", {
6510
6606
  key: 0,
6511
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",
6512
6608
  style: {
@@ -6514,7 +6610,7 @@ var za = {
6514
6610
  color: "var(--tpl-danger)",
6515
6611
  "background-color": "var(--tpl-danger-light)"
6516
6612
  },
6517
- onClick: n[16] ||= (...e) => A(x).handleDeleteClick && A(x).handleDeleteClick(...e)
6613
+ onClick: n[16] ||= (...e) => A(y).handleDeleteClick && A(y).handleDeleteClick(...e)
6518
6614
  }, I(u.value.mediaLibrary.deleteSelected), 1)) : M("", !0), o.onSelect ? (z(), t("button", {
6519
6615
  key: 1,
6520
6616
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
@@ -6522,87 +6618,87 @@ var za = {
6522
6618
  "background-color": "var(--tpl-primary)",
6523
6619
  color: "var(--tpl-bg)"
6524
6620
  },
6525
- disabled: !A(b).previewItem.value,
6526
- onClick: C
6527
- }, I(u.value.mediaLibrary.selectFile), 9, Oo)) : M("", !0)])])])
6621
+ disabled: !A(_).previewItem.value,
6622
+ onClick: b
6623
+ }, I(u.value.mediaLibrary.selectFile), 9, Fo)) : M("", !0)])])])
6528
6624
  ]));
6529
6625
  }
6530
- }), Ao = /* #__PURE__ */ Object.assign({
6626
+ }), Lo = /* #__PURE__ */ Object.assign({
6531
6627
  "./locales/ca.ts": () => import("./chunks/ca-DnghH5Xn.js"),
6532
6628
  "./locales/de.ts": () => import("./chunks/de-ByQyu2jv.js"),
6533
- "./locales/en.ts": () => import("./chunks/en-B-xajqfh.js"),
6629
+ "./locales/en.ts": () => Promise.resolve().then(() => Ie),
6534
6630
  "./locales/es.ts": () => import("./chunks/es-Bcp-DbmC.js"),
6535
6631
  "./locales/fr.ts": () => import("./chunks/fr-DXb0cCZG.js"),
6536
6632
  "./locales/nl.ts": () => import("./chunks/nl-DGT1t3Be.js"),
6537
6633
  "./locales/pt-BR.ts": () => import("./chunks/pt-BR-C0Hzc26R.js")
6538
6634
  });
6539
- function jo(e) {
6635
+ function Ro(e) {
6540
6636
  return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
6541
6637
  }
6542
- var Mo = jo(Ao);
6543
- function No(e) {
6638
+ var zo = Ro(Lo);
6639
+ function Bo(e) {
6544
6640
  return e.trim().replace(/_/g, "-").toLowerCase();
6545
6641
  }
6546
- function Po(e) {
6547
- let t = No(e);
6548
- return Mo.find((e) => No(e) === t);
6642
+ function Vo(e) {
6643
+ let t = Bo(e);
6644
+ return zo.find((e) => Bo(e) === t);
6549
6645
  }
6550
- function Fo(e) {
6551
- return No(e).split("-")[0];
6646
+ function Ho(e) {
6647
+ return Bo(e).split("-")[0];
6552
6648
  }
6553
- function Io(e) {
6554
- return Po(e) ?? Po(Fo(e)) ?? "en";
6649
+ function Uo(e) {
6650
+ return Vo(e) ?? Vo(Ho(e)) ?? "en";
6555
6651
  }
6556
- async function Lo(e) {
6557
- let t = Ao[`./locales/${Io(e)}.ts`];
6652
+ async function Wo(e) {
6653
+ let t = Lo[`./locales/${Uo(e)}.ts`];
6558
6654
  return (await t()).default;
6559
6655
  }
6560
6656
  //#endregion
6561
6657
  //#region src/standalone/visual.ts
6562
- var Ro = null, zo = e(null);
6563
- async function Bo(e) {
6658
+ var Go = null, Ko = e(null);
6659
+ async function qo(e) {
6564
6660
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
6565
6661
  if (!t) throw Error(`Container element not found: ${e.container}`);
6566
- let n = Ce(e.auth, e.onError);
6662
+ let n = Te(e.auth, e.onError);
6567
6663
  await n.initialize();
6568
- let r = await new ke(n).fetchConfig(), i = await Lo(e.locale ?? "en");
6569
- return Ho(t, e.theme), Ro && Vo(), 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) => {
6570
6666
  try {
6571
- Ro = be({ setup() {
6667
+ Go = be({ setup() {
6572
6668
  let s = () => {
6573
6669
  a({
6574
- setTheme: (e) => Ho(t, e),
6575
- unmount: Vo
6670
+ setTheme: (e) => Yo(t, e),
6671
+ unmount: Jo
6576
6672
  });
6577
6673
  };
6578
- return () => o(ko, {
6674
+ return () => o(Io, {
6579
6675
  authManager: n,
6580
6676
  projectId: n.projectId,
6581
6677
  planConfig: r,
6582
6678
  translations: i,
6583
6679
  onSelect: e.onSelect,
6584
6680
  onError: e.onError,
6585
- ref: zo,
6681
+ ref: Ko,
6586
6682
  onReady: s
6587
6683
  });
6588
- } }), Ro.mount(t);
6684
+ } }), Go.mount(t);
6589
6685
  } catch (e) {
6590
6686
  s(e);
6591
6687
  }
6592
6688
  });
6593
6689
  }
6594
- function Vo() {
6595
- Ro && (Ro.unmount(), Ro = null, zo.value = null);
6690
+ function Jo() {
6691
+ Go && (Go.unmount(), Go = null, Ko.value = null);
6596
6692
  }
6597
- function Ho(e, t) {
6693
+ function Yo(e, t) {
6598
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`)));
6599
6695
  }
6600
- var Uo = {
6601
- init: Bo,
6602
- unmount: Vo
6696
+ var Xo = {
6697
+ init: qo,
6698
+ unmount: Jo
6603
6699
  };
6604
- typeof window < "u" && (window.TemplaticalMedia = Uo);
6700
+ typeof window < "u" && (window.TemplaticalMedia = Xo);
6605
6701
  //#endregion
6606
- export { Uo as default, Bo as init, Vo as unmount };
6702
+ export { Xo as default, qo as init, Jo as unmount };
6607
6703
 
6608
6704
  //# sourceMappingURL=media-library.js.map