@templatical/media-library 0.25.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
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-BO_46mh_.js";
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
2
  //#region ../types/src/config.ts
3
3
  var xe = class extends Error {
4
4
  statusCode;
@@ -599,8 +599,10 @@ var Ke, qe, Je, G = (Ke = function(e) {
599
599
  var o = n.apply(null, i);
600
600
  o && e.push(o);
601
601
  }
602
- } else if (a === "object") if (i.toString === Object.prototype.toString) for (var s in i) t.call(i, s) && i[s] && e.push(s);
603
- else e.push(i.toString());
602
+ } else if (a === "object") {
603
+ if (i.toString === Object.prototype.toString) for (var s in i) t.call(i, s) && i[s] && e.push(s);
604
+ else e.push(i.toString());
605
+ }
604
606
  }
605
607
  }
606
608
  return e.join(" ");
@@ -1033,7 +1035,7 @@ function Z(e) {
1033
1035
  return e.width / e.height;
1034
1036
  }
1035
1037
  function kt(e, t) {
1036
- return Math.min(t.right !== void 0 && t.left !== void 0 ? (t.right - t.left) / e.width : Infinity, t.bottom !== void 0 && t.top !== void 0 ? (t.bottom - t.top) / e.height : Infinity);
1038
+ 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);
1037
1039
  }
1038
1040
  function At(e, t) {
1039
1041
  var n = {
@@ -1048,16 +1050,16 @@ function jt(e, t) {
1048
1050
  }
1049
1051
  function Mt(e, t) {
1050
1052
  var n = Z(e), r = Z(t);
1051
- return t.width < Infinity && t.height < Infinity ? n > r ? {
1053
+ return t.width < 1 / 0 && t.height < 1 / 0 ? n > r ? {
1052
1054
  width: t.width,
1053
1055
  height: t.width / n
1054
1056
  } : {
1055
1057
  width: t.height * n,
1056
1058
  height: t.height
1057
- } : t.width < Infinity ? {
1059
+ } : t.width < 1 / 0 ? {
1058
1060
  width: t.width,
1059
1061
  height: t.width / n
1060
- } : t.height < Infinity ? {
1062
+ } : t.height < 1 / 0 ? {
1061
1063
  width: t.height * n,
1062
1064
  height: t.height
1063
1065
  } : e;
@@ -1087,8 +1089,8 @@ function Q(e, t, n) {
1087
1089
  }
1088
1090
  function It(e) {
1089
1091
  return {
1090
- width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : Infinity,
1091
- height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : Infinity
1092
+ width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0,
1093
+ height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0
1092
1094
  };
1093
1095
  }
1094
1096
  function Lt(e, t) {
@@ -1120,7 +1122,7 @@ function Vt(e, t) {
1120
1122
  function Ht(e) {
1121
1123
  var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
1122
1124
  minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
1123
- maximum: e.aspectRatio && e.aspectRatio.maximum || Infinity
1125
+ maximum: e.aspectRatio && e.aspectRatio.maximum || 1 / 0
1124
1126
  }, a = {
1125
1127
  width: Math.max(r.minWidth, Math.min(r.maxWidth, t)),
1126
1128
  height: Math.max(r.minHeight, Math.min(r.maxHeight, n))
@@ -1273,7 +1275,7 @@ function Jt(e) {
1273
1275
  };
1274
1276
  }
1275
1277
  function Yt(e) {
1276
- var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || Infinity, Math.max(r.minimum || 0, Z(a))), s = a.width < a.height ? {
1278
+ 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 ? {
1277
1279
  width: .8 * a.width,
1278
1280
  height: .8 * a.width / o
1279
1281
  } : {
@@ -1337,7 +1339,7 @@ function $t(e) {
1337
1339
  var h = {
1338
1340
  stencil: {
1339
1341
  minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
1340
- maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity, kt(d, o))
1342
+ maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0, kt(d, o))
1341
1343
  },
1342
1344
  area: { maximum: kt(u, a({
1343
1345
  visibleArea: u,
@@ -1412,12 +1414,12 @@ function nn(e) {
1412
1414
  var d = Et(Dt(n, c), i);
1413
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));
1414
1416
  var f = {
1415
- width: Infinity,
1416
- height: Infinity,
1417
- left: Infinity,
1418
- right: Infinity,
1419
- top: Infinity,
1420
- bottom: Infinity
1417
+ width: 1 / 0,
1418
+ height: 1 / 0,
1419
+ left: 1 / 0,
1420
+ right: 1 / 0,
1421
+ top: 1 / 0,
1422
+ bottom: 1 / 0
1421
1423
  };
1422
1424
  if (_t.forEach((function(e) {
1423
1425
  var t = d[e];
@@ -1426,20 +1428,20 @@ function nn(e) {
1426
1428
  var p = Math.min.apply(null, _t.map((function(e) {
1427
1429
  return f[e];
1428
1430
  })));
1429
- p !== Infinity && _t.forEach((function(e) {
1431
+ p !== 1 / 0 && _t.forEach((function(e) {
1430
1432
  c[e] *= p;
1431
1433
  }));
1432
1434
  } else _t.forEach((function(e) {
1433
- f[e] !== Infinity && (c[e] *= f[e]);
1435
+ f[e] !== 1 / 0 && (c[e] *= f[e]);
1434
1436
  }));
1435
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) {
1436
1438
  var m = Math.min(f.width, f.height);
1437
- m !== Infinity && _t.forEach((function(e) {
1439
+ m !== 1 / 0 && _t.forEach((function(e) {
1438
1440
  c[e] *= m;
1439
1441
  }));
1440
- } else f.width !== Infinity && vt.forEach((function(e) {
1442
+ } else f.width !== 1 / 0 && vt.forEach((function(e) {
1441
1443
  c[e] *= f.width;
1442
- })), f.height !== Infinity && yt.forEach((function(e) {
1444
+ })), f.height !== 1 / 0 && yt.forEach((function(e) {
1443
1445
  c[e] *= f.height;
1444
1446
  }));
1445
1447
  return c;
@@ -1933,29 +1935,30 @@ function _n(e) {
1933
1935
  function vn(e) {
1934
1936
  return new Promise((function(t, n) {
1935
1937
  try {
1936
- if (e) if (/^data:/i.test(e)) t(function(e) {
1937
- e = e.replace(/^data:([^;]+);base64,/gim, "");
1938
- for (var t = atob(e), n = t.length, r = new ArrayBuffer(n), i = new Uint8Array(r), a = 0; a < n; a++) i[a] = t.charCodeAt(a);
1939
- return r;
1940
- }(e));
1941
- else if (/^blob:/i.test(e)) {
1942
- var r = new FileReader();
1943
- r.onload = function(e) {
1944
- t(e.target.result);
1945
- }, a = e, o = function(e) {
1946
- r.readAsArrayBuffer(e);
1947
- }, (s = new XMLHttpRequest()).open("GET", a, !0), s.responseType = "blob", s.onload = function() {
1948
- this.status != 200 && this.status !== 0 || o(this.response);
1949
- }, s.send();
1950
- } else {
1951
- var i = new XMLHttpRequest();
1952
- i.onreadystatechange = function() {
1953
- i.readyState === 4 && (i.status === 200 || i.status === 0 ? t(i.response) : n("Warning: could not load an image to parse its orientation"), i = null);
1954
- }, i.onprogress = function() {
1955
- i.getResponseHeader("content-type") !== "image/jpeg" && i.abort();
1956
- }, i.withCredentials = !1, i.open("GET", e, !0), i.responseType = "arraybuffer", i.send(null);
1957
- }
1958
- else n("Error: the image is empty");
1938
+ if (e) {
1939
+ if (/^data:/i.test(e)) t(function(e) {
1940
+ e = e.replace(/^data:([^;]+);base64,/gim, "");
1941
+ for (var t = atob(e), n = t.length, r = new ArrayBuffer(n), i = new Uint8Array(r), a = 0; a < n; a++) i[a] = t.charCodeAt(a);
1942
+ return r;
1943
+ }(e));
1944
+ else if (/^blob:/i.test(e)) {
1945
+ var r = new FileReader();
1946
+ r.onload = function(e) {
1947
+ t(e.target.result);
1948
+ }, a = e, o = function(e) {
1949
+ r.readAsArrayBuffer(e);
1950
+ }, (s = new XMLHttpRequest()).open("GET", a, !0), s.responseType = "blob", s.onload = function() {
1951
+ this.status != 200 && this.status !== 0 || o(this.response);
1952
+ }, s.send();
1953
+ } else {
1954
+ var i = new XMLHttpRequest();
1955
+ i.onreadystatechange = function() {
1956
+ i.readyState === 4 && (i.status === 200 || i.status === 0 ? t(i.response) : n("Warning: could not load an image to parse its orientation"), i = null);
1957
+ }, i.onprogress = function() {
1958
+ i.getResponseHeader("content-type") !== "image/jpeg" && i.abort();
1959
+ }, i.withCredentials = !1, i.open("GET", e, !0), i.responseType = "arraybuffer", i.send(null);
1960
+ }
1961
+ } else n("Error: the image is empty");
1959
1962
  } catch (e) {
1960
1963
  n(e);
1961
1964
  }
@@ -2895,19 +2898,19 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2895
2898
  imageSize: this.imageSize,
2896
2899
  minWidth: q(this.minWidth) ? 0 : it(this.minWidth),
2897
2900
  minHeight: q(this.minHeight) ? 0 : it(this.minHeight),
2898
- maxWidth: q(this.maxWidth) ? Infinity : it(this.maxWidth),
2899
- maxHeight: q(this.maxHeight) ? Infinity : it(this.maxHeight)
2901
+ maxWidth: q(this.maxWidth) ? 1 / 0 : it(this.maxWidth),
2902
+ maxHeight: q(this.maxHeight) ? 1 / 0 : it(this.maxHeight)
2900
2903
  });
2901
2904
  if (e = function(e) {
2902
2905
  var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = K(K({}, n), {
2903
2906
  minWidth: n.minWidth === void 0 ? 0 : n.minWidth,
2904
2907
  minHeight: n.minHeight === void 0 ? 0 : n.minHeight,
2905
- maxWidth: n.maxWidth === void 0 ? Infinity : n.maxWidth,
2906
- maxHeight: n.maxHeight === void 0 ? Infinity : n.maxHeight
2908
+ maxWidth: n.maxWidth === void 0 ? 1 / 0 : n.maxWidth,
2909
+ maxHeight: n.maxHeight === void 0 ? 1 / 0 : n.maxHeight
2907
2910
  });
2908
2911
  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));
2909
2912
  var o = It(t), s = Mt(r, o);
2910
- return o.width < Infinity && (!a.maxWidth || a.maxWidth > s.width) && (a.maxWidth = Math.min(a.maxWidth, s.width)), o.height < Infinity && (!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;
2913
+ 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;
2911
2914
  }({
2912
2915
  sizeRestrictions: e,
2913
2916
  areaRestrictions: this.getAreaRestrictions({
@@ -3202,8 +3205,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3202
3205
  }(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r = U({
3203
3206
  minWidth: 0,
3204
3207
  minHeight: 0,
3205
- maxWidth: Infinity,
3206
- maxHeight: Infinity,
3208
+ maxWidth: 1 / 0,
3209
+ maxHeight: 1 / 0,
3207
3210
  maxArea: this.maxCanvasSize,
3208
3211
  imageSmoothingEnabled: !0,
3209
3212
  imageSmoothingQuality: "high",
@@ -3217,8 +3220,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3217
3220
  sizeRestrictions: {
3218
3221
  minWidth: i([r.width, r.minWidth]) || 0,
3219
3222
  minHeight: i([r.height, r.minHeight]) || 0,
3220
- maxWidth: i([r.width, r.maxWidth]) || Infinity,
3221
- maxHeight: i([r.height, r.maxHeight]) || Infinity
3223
+ maxWidth: i([r.width, r.maxWidth]) || 1 / 0,
3224
+ maxHeight: i([r.height, r.maxHeight]) || 1 / 0
3222
3225
  },
3223
3226
  width: this.coordinates.width,
3224
3227
  height: this.coordinates.height,
@@ -4636,10 +4639,12 @@ function ni(e = {}) {
4636
4639
  } catch {
4637
4640
  e = !0;
4638
4641
  }
4639
- if (e) if (typeof n == "string") d.value = n, y(n);
4640
- else {
4641
- let e = ++h, t = await n();
4642
- t != null && e === h && (d.value = t, y(t));
4642
+ if (e) {
4643
+ if (typeof n == "string") d.value = n, y(n);
4644
+ else {
4645
+ let e = ++h, t = await n();
4646
+ t != null && e === h && (d.value = t, y(t));
4647
+ }
4643
4648
  }
4644
4649
  f.value = !0, m.start(), p.value = !1;
4645
4650
  }