@lazycatcloud/vue-media-preview 0.1.1 → 0.1.3

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.
Files changed (37) hide show
  1. package/README.md +2 -2
  2. package/dist/components/MediaPreview.vue.d.ts +2 -2
  3. package/dist/components/PreviewStage.vue.d.ts +8 -4
  4. package/dist/core/gestures/dismissGesture.d.ts +3 -0
  5. package/dist/core/gestures/openingGesture.d.ts +18 -0
  6. package/dist/core/gestures/pointerVelocity.d.ts +7 -0
  7. package/dist/core/gestures/zoomBounds.d.ts +5 -0
  8. package/dist/core/rendering/image.d.ts +17 -0
  9. package/dist/core/resources/bitmap/client.d.ts +4 -0
  10. package/dist/core/resources/bitmap/decode.worker.d.ts +1 -0
  11. package/dist/core/resources/bitmap/types.d.ts +14 -0
  12. package/dist/core/resources/imageLimits.d.ts +1 -1
  13. package/dist/core/resources/imageOwnership.d.ts +9 -0
  14. package/dist/core/resources/imageRequest.d.ts +1 -1
  15. package/dist/core/resources/imageResource.d.ts +11 -0
  16. package/dist/core/resources/imageStore.d.ts +3 -0
  17. package/dist/core/resources/imageTransport.d.ts +4 -4
  18. package/dist/core/resources/validation/image.d.ts +13 -0
  19. package/dist/core/types.d.ts +6 -0
  20. package/dist/core/usePreviewViewport.d.ts +1 -1
  21. package/dist/core/video/source/session.d.ts +8 -0
  22. package/dist/core/video/source/types.d.ts +8 -0
  23. package/dist/core/video/timeline/buffered.d.ts +12 -0
  24. package/dist/core/video/timeline/index.d.ts +15 -0
  25. package/dist/core/video/timeline/time.d.ts +3 -0
  26. package/dist/core/video/useVideoPlayback.d.ts +22 -6
  27. package/dist/core/video/useVideoSource.d.ts +3 -3
  28. package/dist/index.d.ts +3 -1
  29. package/dist/renderers/ImageCanvasRenderer.vue.d.ts +15 -4
  30. package/dist/renderers/LivePhotoRenderer.vue.d.ts +7 -2
  31. package/dist/renderers/VideoDomRenderer.vue.d.ts +29 -8
  32. package/dist/vue-media-preview.cjs +2 -1
  33. package/dist/vue-media-preview.css +1 -1
  34. package/dist/vue-media-preview.js +1907 -1516
  35. package/docs/testing.md +12 -2
  36. package/docs/vue-media-preview.md +35 -7
  37. package/package.json +1 -1
@@ -1,87 +1,184 @@
1
- var qt = Object.defineProperty;
2
- var zt = (a, t, e) => t in a ? qt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var tt = (a, t, e) => zt(a, typeof t != "symbol" ? t + "" : t, e);
4
- import { ref as R, onMounted as ze, watch as ee, onBeforeUnmount as Re, shallowRef as gt, reactive as mt, computed as U, defineComponent as Le, nextTick as ye, openBlock as z, createElementBlock as H, Fragment as De, createElementVNode as $, createCommentVNode as ie, withModifiers as J, toDisplayString as le, unref as g, normalizeClass as qe, normalizeStyle as Se, mergeProps as Ue, toHandlers as pt, createVNode as Be, renderList as ot, createTextVNode as It, withKeys as at, createBlock as rt, Teleport as Ct, resolveDynamicComponent as At, useAttrs as Ot, getCurrentInstance as _t, withDirectives as Vt, vShow as Yt, renderSlot as ft } from "vue";
5
- function Ae(a) {
6
- return a instanceof Error ? a : new Error(String(a));
1
+ var Zt = Object.defineProperty;
2
+ var jt = (t, n, o) => n in t ? Zt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[n] = o;
3
+ var et = (t, n, o) => jt(t, typeof n != "symbol" ? n + "" : n, o);
4
+ import { ref as L, onMounted as qe, watch as ee, onBeforeUnmount as $e, shallowRef as ft, reactive as gt, computed as X, defineComponent as Te, nextTick as Me, openBlock as O, createElementBlock as A, Fragment as Fe, createElementVNode as B, createCommentVNode as le, withModifiers as ae, unref as f, normalizeClass as Ie, normalizeStyle as Le, mergeProps as We, toHandlers as mt, createVNode as De, renderList as Ne, createTextVNode as Kt, toDisplayString as fe, withKeys as tt, createBlock as at, Teleport as Ct, resolveDynamicComponent as Gt, useAttrs as Qt, getCurrentInstance as Jt, withDirectives as en, vShow as tn, renderSlot as ut } from "vue";
5
+ function He(t, n) {
6
+ return Math.hypot(t.x - n.x, t.y - n.y);
7
7
  }
8
- const lt = (a, t) => (a.src = t.videoSrc || t.src, () => {
9
- a.removeAttribute("src"), a.load();
8
+ function yt(t, n) {
9
+ return { x: (t.x + n.x) / 2, y: (t.y + n.y) / 2 };
10
+ }
11
+ function Lt(t, n, o) {
12
+ return Math.hypot(t, n) < 9 ? "pending" : o > 1.01 ? "pan" : Math.abs(t) > Math.abs(n) * 1.1 ? "page" : n > 0 && Math.abs(n) > Math.abs(t) * 1.1 ? "dismiss" : "pending";
13
+ }
14
+ function Ft(t, n, o) {
15
+ return t > Math.min(o.width, o.height) * 0.14 || t > 16 && n > 0.35;
16
+ }
17
+ function $t() {
18
+ let t = { x: 0, y: 0, time: 0 }, n = { x: 0, y: 0 };
19
+ return {
20
+ reset(o, e) {
21
+ t = { ...o, time: e }, n = { x: 0, y: 0 };
22
+ },
23
+ move(o, e) {
24
+ const i = Math.max(8, e - t.time);
25
+ n = { x: (o.x - t.x) / i, y: (o.y - t.y) / i }, t = { ...o, time: e };
26
+ },
27
+ read(o) {
28
+ return o - t.time < 100 ? n : { x: 0, y: 0 };
29
+ }
30
+ };
31
+ }
32
+ function nn() {
33
+ const t = /* @__PURE__ */ new Map();
34
+ let n = !1;
35
+ function o() {
36
+ t.clear(), n = !1;
37
+ }
38
+ function e() {
39
+ const a = !n && t.size === 1 ? { kind: "pointer", ...t.values().next().value } : { kind: "empty" };
40
+ return o(), a;
41
+ }
42
+ function i(a) {
43
+ if (!t.has(a.pointerId)) return;
44
+ const l = t.get(a.pointerId);
45
+ l.latest = a, l.velocity.move({ x: a.clientX, y: a.clientY }, a.timeStamp);
46
+ }
47
+ return {
48
+ clear: o,
49
+ take: e,
50
+ move: i,
51
+ start(a) {
52
+ if (a.pointerType === "mouse" && a.button !== 0) return;
53
+ const l = a.target;
54
+ if (l.closest("button, input, a, select")) return;
55
+ const r = $t();
56
+ r.reset({ x: a.clientX, y: a.clientY }, a.timeStamp), t.set(a.pointerId, { down: a, latest: a, target: l, velocity: r }), n || (n = t.size > 1);
57
+ },
58
+ finish(a, l) {
59
+ if (!t.has(a.pointerId)) return !1;
60
+ if (n)
61
+ return t.delete(a.pointerId), t.size === 0 && o(), !1;
62
+ const r = e();
63
+ if (r.kind === "empty") return !1;
64
+ const u = a.clientX - r.down.clientX, p = a.clientY - r.down.clientY, d = r.velocity.read(a.timeStamp).y;
65
+ return Lt(u, p, 1) === "dismiss" && Ft(p, d, l);
66
+ }
67
+ };
68
+ }
69
+ function _e(t) {
70
+ return t instanceof Error ? t : new Error(String(t));
71
+ }
72
+ function an(t) {
73
+ let n = 0, o = () => {
74
+ };
75
+ function e() {
76
+ n += 1;
77
+ const a = o;
78
+ o = () => {
79
+ }, a();
80
+ }
81
+ function i() {
82
+ e(), t.reset();
83
+ }
84
+ return {
85
+ clear: i,
86
+ dispose: e,
87
+ start(a, l, r) {
88
+ i();
89
+ const u = n;
90
+ o = r(
91
+ a,
92
+ l,
93
+ (p) => {
94
+ u === n && t.error(p);
95
+ },
96
+ (p) => {
97
+ u === n && t.duration(p);
98
+ }
99
+ );
100
+ }
101
+ };
102
+ }
103
+ const it = (t, n) => (t.src = n.videoSrc || n.src, () => {
104
+ t.removeAttribute("src"), t.load();
10
105
  });
11
- function Et(a, t, e, n, o) {
12
- const i = R(0);
13
- let s = () => {
14
- }, r = () => {
106
+ function Tt(t, n, o, e, i) {
107
+ const a = L(0), l = an(i);
108
+ let r = () => {
15
109
  };
16
- return ze(() => {
110
+ return qe(() => {
17
111
  r = ee(
18
- () => [t().id, t().src, t().videoSrc, e(), n(), i.value],
112
+ () => [n().id, n().src, n().videoSrc, o(), e(), a.value],
19
113
  () => {
20
- s(), s = () => {
21
- }, e() && (s = n()(a(), t(), o));
114
+ o() ? l.start(t(), n(), e()) : l.clear();
22
115
  },
23
116
  { immediate: !0, flush: "post" }
24
117
  );
25
- }), Re(() => {
26
- r(), s();
27
- }), () => i.value++;
118
+ }), $e(() => {
119
+ r(), l.dispose();
120
+ }), () => a.value++;
28
121
  }
29
- function de(a, t, e) {
30
- return Math.min(Math.max(a, t), e);
122
+ function Q(t, n, o) {
123
+ return Math.min(Math.max(t, n), o);
31
124
  }
32
- function yt(a, t = 2) {
33
- return Number(a.toFixed(t));
125
+ function wt(t, n = 2) {
126
+ return Number(t.toFixed(n));
34
127
  }
35
- function Ht(a, t) {
36
- return a.width <= 0 || a.height <= 0 || t.width <= 0 || t.height <= 0 ? 1 : Math.min(t.width / a.width, t.height / a.height);
128
+ function on(t, n) {
129
+ return t.width <= 0 || t.height <= 0 || n.width <= 0 || n.height <= 0 ? 1 : Math.min(n.width / t.width, n.height / t.height);
37
130
  }
38
- function wt(a) {
39
- const t = (a % 360 + 360) % 360;
40
- return t === 90 || t === 180 || t === 270 ? t : 0;
131
+ function bt(t) {
132
+ const n = (t % 360 + 360) % 360;
133
+ return n === 90 || n === 180 || n === 270 ? n : 0;
41
134
  }
42
- function Xt(a, t) {
43
- return t === 90 || t === 270 ? { width: a.height, height: a.width } : a;
135
+ function rn(t, n) {
136
+ return n === 90 || n === 270 ? { width: t.height, height: t.width } : t;
44
137
  }
45
- function Ut(a, t, e) {
46
- return `translate3d(${yt(a)}px, ${yt(t)}px, 0) scale3d(${e}, ${e}, 1)`;
138
+ function ln(t, n, o) {
139
+ return `translate3d(${wt(t)}px, ${wt(n)}px, 0) scale3d(${o}, ${o}, 1)`;
47
140
  }
48
- function Wt(a) {
49
- return 1 - (1 - a) ** 3;
141
+ function sn(t) {
142
+ return 1 - (1 - t) ** 3;
50
143
  }
51
- function nt(a, t) {
52
- return Math.hypot(a.x - t.x, a.y - t.y);
144
+ const un = 16;
145
+ function cn(t, n) {
146
+ const o = t < 1 ? 1 : n;
147
+ if (t >= 1 && t <= n) return t;
148
+ const e = Math.abs(t - o), i = o * 0.25;
149
+ return o + Math.sign(t - o) * (i * e) / (i + e);
53
150
  }
54
- function bt(a, t) {
55
- return { x: (a.x + t.x) / 2, y: (a.y + t.y) / 2 };
151
+ function dn(t, n) {
152
+ const o = t < 1 ? 1 : n;
153
+ if (t >= 1 && t <= n) return t;
154
+ const e = Math.abs(t - o), i = o * 0.25;
155
+ return o + Math.sign(t - o) * (i * e) / Math.max(Number.EPSILON, i - e);
56
156
  }
57
- function Nt(a, t, e) {
58
- return Math.hypot(a, t) < 9 ? "pending" : e > 1.01 ? "pan" : Math.abs(a) > Math.abs(t) * 1.1 ? "page" : t > 0 && Math.abs(t) > Math.abs(a) * 1.1 ? "dismiss" : "pending";
157
+ function fn(t, n) {
158
+ return t.deltaMode === 1 ? 2 ** (-t.deltaY * 0.05) : t.deltaMode === 2 ? 2 ** -t.deltaY : n || Math.abs(t.deltaY) >= 40 ? 2 ** (-t.deltaY * 2e-3) : Math.exp(-t.deltaY * 8e-3);
59
159
  }
60
- function Zt(a, t) {
61
- return a.deltaMode === 1 ? 2 ** (-a.deltaY * 0.05) : a.deltaMode === 2 ? 2 ** -a.deltaY : t || Math.abs(a.deltaY) >= 40 ? 2 ** (-a.deltaY * 2e-3) : Math.exp(-a.deltaY * 8e-3);
62
- }
63
- function jt(a, t, e = 650) {
64
- let n = { kind: "idle" };
65
- function o() {
66
- const s = n;
67
- n = { kind: "idle" }, s.kind === "pending" && clearTimeout(s.timer), s.kind === "active" && t();
68
- }
160
+ function gn(t, n, o = 650) {
161
+ let e = { kind: "idle" };
69
162
  function i() {
70
- o(), n = {
163
+ const l = e;
164
+ e = { kind: "idle" }, l.kind === "pending" && clearTimeout(l.timer), l.kind === "active" && n();
165
+ }
166
+ function a() {
167
+ i(), e = {
71
168
  kind: "pending",
72
169
  timer: setTimeout(() => {
73
- n = { kind: "active" }, a();
74
- }, e)
170
+ e = { kind: "active" }, t();
171
+ }, o)
75
172
  };
76
173
  }
77
- return { arm: i, cancel: o };
174
+ return { arm: a, cancel: i };
78
175
  }
79
- function Kt(a, t, e) {
80
- const n = de(a, -t, t);
81
- return { offsetX: n, pageOffset: e ? a - n : 0 };
176
+ function mn(t, n, o) {
177
+ const e = Q(t, -n, n);
178
+ return { offsetX: e, pageOffset: o ? t - e : 0 };
82
179
  }
83
- function Gt(a = {}) {
84
- const t = {
180
+ function pn(t = {}) {
181
+ const n = {
85
182
  motionActive: () => !1,
86
183
  onTap: () => {
87
184
  },
@@ -99,20 +196,20 @@ function Gt(a = {}) {
99
196
  },
100
197
  onPageDrag: (c) => {
101
198
  },
102
- onPageRelease: (c, F) => {
103
- Math.abs(c) < 60 || (c < 0 ? t.onSwipeLeft() : t.onSwipeRight());
199
+ onPageRelease: (c, T) => {
200
+ Math.abs(c) < 60 || (c < 0 ? n.onSwipeLeft() : n.onSwipeRight());
104
201
  },
105
202
  interactive: () => !0,
106
203
  zoomable: () => !0,
107
204
  doubleTapZoom: () => 2.5,
108
- zoomLimit: () => 8,
205
+ zoomLimit: () => un,
109
206
  holdable: () => !1,
110
207
  onHoldStart: () => {
111
208
  },
112
209
  onHoldEnd: () => {
113
210
  },
114
- ...a
115
- }, e = R(), n = R(), o = gt(), i = R({ width: 1, height: 1 }), s = R({ width: 1, height: 1 }), r = mt({
211
+ ...t
212
+ }, o = L(), e = L(), i = ft(), a = L({ width: 1, height: 1 }), l = L({ width: 1, height: 1 }), r = gt({
116
213
  level: 1,
117
214
  offsetX: 0,
118
215
  offsetY: 0,
@@ -122,233 +219,298 @@ function Gt(a = {}) {
122
219
  downOffsetX: 0,
123
220
  downOffsetY: 0,
124
221
  downScale: 1
125
- }), f = U(() => Xt(s.value, r.rotation)), y = U(() => Ht(f.value, i.value)), m = U(() => y.value * r.level), b = U(() => ({
126
- width: f.value.width * m.value,
127
- height: f.value.height * m.value
128
- })), B = U(() => ({
129
- transform: Ut(r.downOffsetX, r.downOffsetY, r.downScale)
130
- })), L = /* @__PURE__ */ new Set(), P = R(!1), p = R(!1), v = R(!1), T = U(
131
- () => P.value || p.value || v.value || t.motionActive()
222
+ }), u = X(() => rn(l.value, r.rotation)), p = X(() => on(u.value, a.value)), d = X(() => p.value * r.level), S = X(() => ({
223
+ width: u.value.width * d.value,
224
+ height: u.value.height * d.value
225
+ })), C = X(() => ({
226
+ transform: ln(r.downOffsetX, r.downOffsetY, r.downScale)
227
+ })), P = /* @__PURE__ */ new Set(), R = L(!1), x = L(!1), m = L(!1), F = X(
228
+ () => R.value || x.value || m.value || n.motionActive()
132
229
  );
133
- let I, w = 0, u = 0, k = setTimeout(() => {
134
- }, 0), h = -1e3, d = { x: 0, y: 0 }, M = !1, C = "idle", E = !0, A = !1, V = 0;
135
- const _ = /* @__PURE__ */ new Map();
136
- let N = { x: 0, y: 0 }, Y = { x: 0, y: 0, time: 0 }, Pe = 0, se = 0, fe = 0, K = { left: 0, top: 0 }, Ze = 1, Oe = { x: 0, y: 0 }, D = Q();
137
- const q = jt(
230
+ let q, v = 0, k = 0, g = setTimeout(() => {
231
+ }, 0), w = -1e3, E = { x: 0, y: 0 }, y = !1, h = "idle", $ = !0, D = !1, I = 0;
232
+ const H = /* @__PURE__ */ new Map();
233
+ let Z = { x: 0, y: 0 };
234
+ const J = $t();
235
+ let ie = 0, Ee = { left: 0, top: 0 }, oe = 1, se = 1, ce = { x: 0, y: 0 }, de = he();
236
+ const z = gn(
138
237
  () => {
139
- C = "hold", clearTimeout(k), h = -1e3, t.onHoldStart();
238
+ h = "hold", clearTimeout(g), w = -1e3, n.onHoldStart();
140
239
  },
141
- () => t.onHoldEnd()
142
- ), W = new ResizeObserver((c) => {
143
- for (const F of c) G(F.contentRect);
144
- }), Ce = /* @__PURE__ */ new Set(), je = (c) => {
145
- (c.key === "Control" || c.key === "Meta") && Ce.add(c.key);
146
- }, te = (c) => Ce.delete(c.key), ge = () => {
147
- q.cancel(), Ce.clear();
148
- }, $e = () => {
149
- document.hidden && q.cancel();
240
+ () => n.onHoldEnd()
241
+ ), V = new ResizeObserver((c) => {
242
+ for (const T of c) ge(T.contentRect);
243
+ }), _ = /* @__PURE__ */ new Set(), Oe = (c) => {
244
+ (c.key === "Control" || c.key === "Meta") && _.add(c.key);
245
+ }, Ge = (c) => _.delete(c.key), te = () => {
246
+ z.cancel(), _.clear();
247
+ }, pe = () => {
248
+ document.hidden && z.cancel();
150
249
  };
151
- ze(() => {
152
- W.observe(e.value), G(e.value.getBoundingClientRect()), window.addEventListener("keydown", je), window.addEventListener("keyup", te), window.addEventListener("blur", ge), document.addEventListener("visibilitychange", $e);
153
- }), Re(() => {
154
- M = !0, q.cancel(), window.removeEventListener("keydown", je), window.removeEventListener("keyup", te), window.removeEventListener("blur", ge), document.removeEventListener("visibilitychange", $e), W.disconnect(), cancelAnimationFrame(w), cancelAnimationFrame(u), clearTimeout(k), clearTimeout(I);
250
+ qe(() => {
251
+ V.observe(o.value), ge(o.value.getBoundingClientRect()), window.addEventListener("keydown", Oe), window.addEventListener("keyup", Ge), window.addEventListener("blur", te), document.addEventListener("visibilitychange", pe);
252
+ }), $e(() => {
253
+ y = !0, z.cancel(), window.removeEventListener("keydown", Oe), window.removeEventListener("keyup", Ge), window.removeEventListener("blur", te), document.removeEventListener("visibilitychange", pe), V.disconnect(), cancelAnimationFrame(v), cancelAnimationFrame(k), clearTimeout(g), clearTimeout(q);
155
254
  });
156
- function G(c) {
157
- i.value = { width: c.width, height: c.height }, Object.assign(r, ve(r.offsetX, r.offsetY, r.level)), pe();
255
+ function ge(c) {
256
+ a.value = { width: c.width, height: c.height }, Object.assign(r, K(r.offsetX, r.offsetY, r.level)), be();
158
257
  }
159
- function pe() {
160
- M || w || (w = requestAnimationFrame(() => {
161
- w = 0, L.forEach((c) => c());
258
+ function be() {
259
+ y || v || (v = requestAnimationFrame(() => {
260
+ v = 0, P.forEach((c) => c());
162
261
  }));
163
262
  }
164
- function Q() {
263
+ function he() {
165
264
  return { level: r.level, offsetX: r.offsetX, offsetY: r.offsetY };
166
265
  }
167
- function ve(c, F, X) {
168
- const Z = Math.max(
266
+ function K(c, T, Y) {
267
+ const j = Math.max(
169
268
  0,
170
- (f.value.width * y.value * X - i.value.width) / 2
171
- ), ae = Math.max(
269
+ (u.value.width * p.value * Y - a.value.width) / 2
270
+ ), N = Math.max(
172
271
  0,
173
- (f.value.height * y.value * X - i.value.height) / 2
272
+ (u.value.height * p.value * Y - a.value.height) / 2
174
273
  );
175
- return { offsetX: de(c, -Z, Z), offsetY: de(F, -ae, ae) };
176
- }
177
- function me(c) {
178
- Object.assign(r, c), t.onScale(r.level), pe();
179
- }
180
- function xe(c, F = 250) {
181
- cancelAnimationFrame(u), P.value = !0;
182
- const X = Q(), Z = performance.now(), ae = matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : F, oe = (we) => {
183
- const re = ae === 0 ? 1 : de((we - Z) / ae, 0, 1), be = Wt(re);
184
- me({
185
- level: X.level + (c.level - X.level) * be,
186
- offsetX: X.offsetX + (c.offsetX - X.offsetX) * be,
187
- offsetY: X.offsetY + (c.offsetY - X.offsetY) * be
188
- }), re < 1 ? u = requestAnimationFrame(oe) : P.value = !1;
274
+ return { offsetX: Q(c, -j, j), offsetY: Q(T, -N, N) };
275
+ }
276
+ function ke(c) {
277
+ Object.assign(r, c), n.onScale(r.level), be();
278
+ }
279
+ function re(c, T = 250) {
280
+ cancelAnimationFrame(k), R.value = !0;
281
+ const Y = he(), j = performance.now(), N = matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : T, G = (we) => {
282
+ const xe = N === 0 ? 1 : Q((we - j) / N, 0, 1), Ce = sn(xe);
283
+ ke({
284
+ level: Y.level + (c.level - Y.level) * Ce,
285
+ offsetX: Y.offsetX + (c.offsetX - Y.offsetX) * Ce,
286
+ offsetY: Y.offsetY + (c.offsetY - Y.offsetY) * Ce
287
+ }), xe < 1 ? k = requestAnimationFrame(G) : R.value = !1;
189
288
  };
190
- u = requestAnimationFrame(oe);
191
- }
192
- function ne() {
193
- return { x: i.value.width / 2, y: i.value.height / 2 };
194
- }
195
- function he(c, F = ne(), X = !1) {
196
- if (!t.zoomable()) return;
197
- cancelAnimationFrame(u), P.value = !1;
198
- const Z = de(c, 1, t.zoomLimit()), ae = Z / r.level, oe = ne(), we = ve(
199
- F.x - oe.x - (F.x - oe.x - r.offsetX) * ae,
200
- F.y - oe.y - (F.y - oe.y - r.offsetY) * ae,
201
- Z
202
- ), re = { level: Z, ...we };
203
- X ? xe(re) : me(re);
204
- }
205
- function Ee() {
206
- r.draggingDown = !1, r.downOffsetX = 0, r.downOffsetY = 0, r.downScale = 1, t.onSwipeDownProgress(0);
207
- }
208
- function Me(c = !1) {
209
- c && (cancelAnimationFrame(u), P.value = !1), q.cancel(), _.clear(), p.value = !1, v.value = !1, clearTimeout(I), C = "idle", V = 0, r.zooming = !1, c || (Ee(), t.onPageDrag(0)), clearTimeout(k), h = -1e3;
210
- }
211
- function Fe(c = 0) {
212
- cancelAnimationFrame(u), P.value = !1, Me();
213
- const F = { level: 1, offsetX: 0, offsetY: 0 };
214
- c > 0 && (r.level !== 1 || r.offsetX !== 0 || r.offsetY !== 0) ? xe(F, c) : me(F);
215
- }
216
- function Te(c, F = K) {
217
- return { x: c.clientX - F.left, y: c.clientY - F.top };
218
- }
219
- function st() {
220
- q.cancel(), E = !1, A = !1, V = 0;
221
- const [c, F] = [..._.values()];
222
- Ze = Math.max(1, nt(c, F)), Oe = bt(c, F), D = Q(), C = "pinch", r.zooming = !0, Ee(), t.onPageDrag(0), clearTimeout(k), h = -1e3;
223
- }
224
- function ut(c, F = e.value.getBoundingClientRect()) {
225
- if (!t.interactive() || c.pointerType === "mouse" && c.button !== 0)
226
- return !1;
227
- const X = c.target;
228
- if (X.closest("button, input, a, select") || X instanceof HTMLVideoElement && X.controls && c.clientY > X.getBoundingClientRect().bottom - 48)
289
+ k = requestAnimationFrame(G);
290
+ }
291
+ function me() {
292
+ return { x: a.value.width / 2, y: a.value.height / 2 };
293
+ }
294
+ function ve(c, T = me(), Y = !1) {
295
+ if (!n.zoomable()) return;
296
+ cancelAnimationFrame(k), R.value = !1;
297
+ const j = Q(c, 1, n.zoomLimit()), N = j / r.level, G = me(), we = K(
298
+ T.x - G.x - (T.x - G.x - r.offsetX) * N,
299
+ T.y - G.y - (T.y - G.y - r.offsetY) * N,
300
+ j
301
+ ), xe = { level: j, ...we };
302
+ Y ? re(xe) : ke(xe);
303
+ }
304
+ function Se() {
305
+ r.draggingDown = !1, r.downOffsetX = 0, r.downOffsetY = 0, r.downScale = 1, n.onSwipeDownProgress(0);
306
+ }
307
+ function ye(c = !1) {
308
+ c && (cancelAnimationFrame(k), R.value = !1), z.cancel(), H.clear(), x.value = !1, m.value = !1, clearTimeout(q), h = "idle", I = 0, r.zooming = !1, c || (Se(), n.onPageDrag(0)), clearTimeout(g), w = -1e3;
309
+ }
310
+ function Be(c = 0) {
311
+ cancelAnimationFrame(k), R.value = !1, ye();
312
+ const T = { level: 1, offsetX: 0, offsetY: 0 };
313
+ c > 0 && (r.level !== 1 || r.offsetX !== 0 || r.offsetY !== 0) ? re(T, c) : ke(T);
314
+ }
315
+ function Pe(c, T = Ee) {
316
+ return { x: c.clientX - T.left, y: c.clientY - T.top };
317
+ }
318
+ function ze() {
319
+ z.cancel(), $ = !1, D = !1, I = 0;
320
+ const [c, T] = [...H.values()];
321
+ oe = dn(r.level, n.zoomLimit()), se = Math.max(1, He(c, T)), ce = yt(c, T), de = he(), h = "pinch", r.zooming = !0, Se(), n.onPageDrag(0), clearTimeout(g), w = -1e3;
322
+ }
323
+ function Ae(c, T = o.value.getBoundingClientRect(), Y = c.target) {
324
+ if (!n.interactive() || c.pointerType === "mouse" && c.button !== 0 || Y.closest("button, input, a, select") || Y instanceof HTMLVideoElement && Y.controls && c.clientY > Y.getBoundingClientRect().bottom - 48)
229
325
  return !1;
230
- if (cancelAnimationFrame(u), P.value = !1, p.value = !0, _.size === 0 && (K = F), _.set(c.pointerId, Te(c)), e.value.setPointerCapture(c.pointerId), _.size >= 2)
231
- return st(), !0;
232
- N = Te(c), Y = { ...N, time: performance.now() }, Pe = Y.time, se = 0, fe = 0, D = Q(), C = "pending", E = !0, A = !1, V = 0;
233
- const Z = b.value.width / 2, ae = b.value.height / 2, oe = ne();
234
- return t.holdable() && Math.abs(N.x - oe.x - r.offsetX) <= Z && Math.abs(N.y - oe.y - r.offsetY) <= ae && (clearTimeout(k), q.arm()), !0;
235
- }
236
- function ct(c) {
237
- if (!_.has(c.pointerId)) return;
238
- const F = Te(c);
239
- if (_.set(c.pointerId, F), C === "pinch" && _.size >= 2) {
240
- if (!t.zoomable()) return;
241
- const [we, re] = [..._.values()], be = ne(), Qe = bt(we, re), Ye = de(
242
- D.level * nt(we, re) / Ze,
243
- 0.75,
244
- t.zoomLimit()
245
- ), Je = Ye / D.level;
246
- me({
247
- level: Ye,
248
- ...ve(
249
- Qe.x - be.x - (Oe.x - be.x - D.offsetX) * Je,
250
- Qe.y - be.y - (Oe.y - be.y - D.offsetY) * Je,
251
- Ye
326
+ if (cancelAnimationFrame(k), R.value = !1, x.value = !0, H.size === 0 && (Ee = T), H.set(c.pointerId, Pe(c)), o.value.setPointerCapture(c.pointerId), H.size >= 2)
327
+ return ze(), !0;
328
+ Z = Pe(c), ie = performance.now(), J.reset(Z, c.timeStamp), de = he(), h = "pending", $ = !0, D = !1, I = 0;
329
+ const j = S.value.width / 2, N = S.value.height / 2, G = me();
330
+ return n.holdable() && Math.abs(Z.x - G.x - r.offsetX) <= j && Math.abs(Z.y - G.y - r.offsetY) <= N && (clearTimeout(g), z.arm()), !0;
331
+ }
332
+ function ot(c) {
333
+ if (!H.has(c.pointerId)) return;
334
+ const T = Pe(c);
335
+ if (H.set(c.pointerId, T), h === "pinch" && H.size >= 2) {
336
+ if (!n.zoomable()) return;
337
+ const [N, G] = [...H.values()], we = me(), xe = yt(N, G);
338
+ oe *= Math.max(1, He(N, G)) / se;
339
+ const Ce = cn(oe, n.zoomLimit()), Qe = Ce / de.level;
340
+ ke({
341
+ level: Ce,
342
+ ...K(
343
+ xe.x - we.x - (ce.x - we.x - de.offsetX) * Qe,
344
+ xe.y - we.y - (ce.y - we.y - de.offsetY) * Qe,
345
+ Ce
252
346
  )
253
- }), c.preventDefault();
347
+ }), de = he(), se = Math.max(1, He(N, G)), ce = xe, c.preventDefault();
254
348
  return;
255
349
  }
256
- if (C === "idle") return;
257
- const X = F.x - N.x, Z = F.y - N.y;
258
- if (C === "hold") {
259
- if (c.preventDefault(), Math.hypot(X, Z) < 9) return;
260
- q.cancel(), C = "pending";
261
- }
262
- Math.hypot(X, Z) >= 9 && q.cancel();
263
- const ae = performance.now(), oe = Math.max(8, ae - Y.time);
264
- if (se = (F.x - Y.x) / oe, fe = (F.y - Y.y) / oe, Y = { ...F, time: ae }, C === "pending" && (C = Nt(X, Z, r.level), A = C === "pan" && E && Math.abs(X) > Math.abs(Z) * 1.1), C !== "pending")
265
- if (clearTimeout(k), h = -1e3, c.preventDefault(), C === "pan") {
266
- const we = Math.max(0, (b.value.width - i.value.width) / 2), re = Kt(D.offsetX + X, we, A);
267
- me({ level: r.level, ...ve(re.offsetX, D.offsetY + Z, r.level) }), re.pageOffset !== V && (V = re.pageOffset, t.onPageDrag(V));
268
- } else C === "page" ? t.onPageDrag(X) : C === "dismiss" && (r.draggingDown = !0, r.downOffsetX = X * 0.65, r.downOffsetY = Math.max(0, Z), r.downScale = de(1 - Math.max(0, Z) / i.value.height * 0.6, 0.65, 1), t.onSwipeDownProgress(de(Z / (i.value.height * 0.55), 0, 0.85)));
269
- }
270
- function j(c) {
271
- if (!_.has(c.pointerId)) return;
272
- if (q.cancel(), _.delete(c.pointerId), p.value = _.size > 0, C === "pinch") {
273
- _.size > 0 ? (N = [..._.values()][0], D = Q(), C = "pan") : (C = "idle", r.zooming = !1, he(Math.max(1, r.level), ne(), !0));
350
+ if (h === "idle") return;
351
+ const Y = T.x - Z.x, j = T.y - Z.y;
352
+ if (h === "hold") {
353
+ if (c.preventDefault(), Math.hypot(Y, j) < 9) return;
354
+ z.cancel(), h = "pending";
355
+ }
356
+ if (Math.hypot(Y, j) >= 9 && z.cancel(), J.move(T, c.timeStamp), h === "pending" && (h = Lt(Y, j, r.level), D = h === "pan" && $ && Math.abs(Y) > Math.abs(j) * 1.1), h !== "pending")
357
+ if (clearTimeout(g), w = -1e3, c.preventDefault(), h === "pan") {
358
+ const N = Math.max(0, (S.value.width - a.value.width) / 2), G = mn(de.offsetX + Y, N, D);
359
+ ke({ level: r.level, ...K(G.offsetX, de.offsetY + j, r.level) }), G.pageOffset !== I && (I = G.pageOffset, n.onPageDrag(I));
360
+ } else h === "page" ? n.onPageDrag(Y) : h === "dismiss" && (r.draggingDown = !0, r.downOffsetX = Y * 0.65, r.downOffsetY = Math.max(0, j), r.downScale = Q(1 - Math.max(0, j) / a.value.height * 0.6, 0.65, 1), n.onSwipeDownProgress(Q(j / (a.value.height * 0.55), 0, 0.85)));
361
+ }
362
+ function rt(c) {
363
+ if (!H.has(c.pointerId)) return;
364
+ if (z.cancel(), H.delete(c.pointerId), x.value = H.size > 0, h === "pinch") {
365
+ H.size > 0 ? (Z = [...H.values()][0], de = he(), h = "pan") : (h = "idle", r.zooming = !1, ve(Math.max(1, r.level), me(), !0));
274
366
  return;
275
367
  }
276
- if (_.size > 0) return;
277
- const F = Te(c), X = F.x - N.x, Z = F.y - N.y, ae = performance.now() - Y.time < 100;
278
- C === "page" || C === "pan" && V !== 0 ? t.onPageRelease(C === "page" ? X : V, ae ? se : 0) : C === "dismiss" ? Z > i.value.height * 0.18 || Z > 45 && ae && fe > 0.7 ? t.onSwipeDownClose() : Ee() : C === "pending" && performance.now() - Pe < 300 && nt(N, F) < 9 ? Ge(F) : r.level < 1 && he(1, ne(), !0), r.zooming = !1, C = "idle";
368
+ if (H.size > 0) return;
369
+ const T = Pe(c), Y = T.x - Z.x, j = T.y - Z.y, N = J.read(c.timeStamp);
370
+ h === "page" || h === "pan" && I !== 0 ? n.onPageRelease(h === "page" ? Y : I, N.x) : h === "dismiss" ? Ft(j, N.y, a.value) ? n.onSwipeDownClose() : Se() : h === "pending" && performance.now() - ie < 300 && He(Z, T) < 9 ? st(T) : (r.level < 1 || r.level > n.zoomLimit()) && ve(r.level, me(), !0), r.zooming = !1, h = "idle";
279
371
  }
280
- function Ke(c) {
281
- if (!_.has(c.pointerId)) return;
282
- const F = C === "page" || C === "pan" && V !== 0;
283
- Me(), F && t.onPageRelease(0, 0), r.level < 1 && he(1, ne(), !0);
372
+ function lt(c) {
373
+ if (!H.has(c.pointerId)) return;
374
+ const T = h === "page" || h === "pan" && I !== 0;
375
+ ye(), T && n.onPageRelease(0, 0), (r.level < 1 || r.level > n.zoomLimit()) && ve(r.level, me(), !0);
284
376
  }
285
- function Ge(c) {
286
- const F = performance.now();
287
- F - h < 280 && nt(c, d) < 36 ? (clearTimeout(k), h = -1e3, t.onDoubleTap(), he(r.level > 1.01 ? 1 : t.doubleTapZoom(), c, !0)) : (h = F, d = c, k = setTimeout(t.onTap, 280));
377
+ function st(c) {
378
+ const T = performance.now();
379
+ T - w < 280 && He(c, E) < 36 ? (clearTimeout(g), w = -1e3, n.onDoubleTap(), ve(r.level > 1.01 ? 1 : n.doubleTapZoom(), c, !0)) : (w = T, E = c, g = setTimeout(n.onTap, 280));
288
380
  }
289
- function _e(c) {
290
- if (t.interactive()) {
291
- if (q.cancel(), v.value = !0, clearTimeout(I), I = setTimeout(() => {
292
- v.value = !1;
381
+ function W(c) {
382
+ if (n.interactive()) {
383
+ if (z.cancel(), m.value = !0, clearTimeout(q), q = setTimeout(() => {
384
+ m.value = !1;
293
385
  }, 120), c.ctrlKey || c.metaKey)
294
- c.preventDefault(), he(
295
- r.level * Zt(c, Ce.size > 0),
296
- Te(c, e.value.getBoundingClientRect())
386
+ c.preventDefault(), ve(
387
+ r.level * fn(c, _.size > 0),
388
+ Pe(c, o.value.getBoundingClientRect())
297
389
  );
298
390
  else if (r.level > 1) {
299
391
  c.preventDefault();
300
- const F = c.deltaMode === 1 ? 16 : 1;
301
- me({
392
+ const T = c.deltaMode === 1 ? 16 : 1;
393
+ ke({
302
394
  level: r.level,
303
- ...ve(
304
- r.offsetX - c.deltaX * F,
305
- r.offsetY - c.deltaY * F,
395
+ ...K(
396
+ r.offsetX - c.deltaX * T,
397
+ r.offsetY - c.deltaY * T,
306
398
  r.level
307
399
  )
308
400
  });
309
401
  }
310
402
  }
311
403
  }
312
- const Ve = {
404
+ const Ye = {
313
405
  state: r,
314
- motionActive: T,
315
- containerRef: e,
316
- canvasRef: n,
317
- mediaRef: o,
318
- viewportSize: i,
319
- mediaSize: s,
320
- visualMediaSize: f,
321
- displaySize: b,
322
- displayScale: m,
323
- downDragStyle: B,
324
- requestRender: pe,
325
- renderNow: () => L.forEach((c) => c()),
326
- zoomTo: he,
327
- resetTransform: Fe,
328
- cancelGesture: Me,
406
+ motionActive: F,
407
+ containerRef: o,
408
+ canvasRef: e,
409
+ mediaRef: i,
410
+ viewportSize: a,
411
+ mediaSize: l,
412
+ visualMediaSize: u,
413
+ displaySize: S,
414
+ displayScale: d,
415
+ downDragStyle: C,
416
+ requestRender: be,
417
+ renderNow: () => P.forEach((c) => c()),
418
+ zoomTo: ve,
419
+ resetTransform: Be,
420
+ cancelGesture: ye,
329
421
  setMediaElement(c) {
330
- o.value = c, c instanceof HTMLVideoElement && pe();
422
+ i.value = c, c instanceof HTMLVideoElement && be();
331
423
  },
332
424
  setMediaSize(c) {
333
- s.value = c, pe();
425
+ l.value = c, be();
334
426
  },
335
427
  clearMedia() {
336
- o.value = void 0;
428
+ i.value = void 0;
337
429
  },
338
430
  registerRenderHandler(c) {
339
- return L.add(c), () => L.delete(c);
431
+ return P.add(c), () => P.delete(c);
340
432
  },
341
- setRotation(c, F = !0) {
342
- r.rotation = wt(c), F && Fe(), pe();
433
+ setRotation(c, T = !0) {
434
+ r.rotation = bt(c), T && Be(), be();
343
435
  },
344
436
  rotateBy(c = 90) {
345
- Ve.setRotation(wt(r.rotation + c));
437
+ Ye.setRotation(bt(r.rotation + c));
438
+ }
439
+ };
440
+ return { core: Ye, onPointerDown: Ae, onPointerMove: ot, onPointerUp: rt, onPointerCancel: lt, onWheel: W };
441
+ }
442
+ function hn(t) {
443
+ const n = t.rotation * Math.PI / 180, o = Math.round(Math.cos(n)), e = Math.round(Math.sin(n)), i = t.size.width / 2 - o * t.offsetX - e * t.offsetY, a = t.size.height / 2 + e * t.offsetX - o * t.offsetY, l = (Math.abs(o) * t.viewport.width + Math.abs(e) * t.viewport.height) / 2, r = (Math.abs(e) * t.viewport.width + Math.abs(o) * t.viewport.height) / 2, u = Q(i - l, 0, t.size.width), p = Q(a - r, 0, t.size.height);
444
+ return {
445
+ x: u,
446
+ y: p,
447
+ width: Q(i + l, 0, t.size.width) - u,
448
+ height: Q(a + r, 0, t.size.height) - p
449
+ };
450
+ }
451
+ function vn(t, n, o, e) {
452
+ const i = hn(o);
453
+ if (i.width <= 0 || i.height <= 0) return;
454
+ t.imageSmoothingEnabled = !0, t.imageSmoothingQuality = e ? "low" : "high", t.translate(
455
+ o.viewport.width / 2 + o.offsetX,
456
+ o.viewport.height / 2 + o.offsetY
457
+ ), t.rotate(o.rotation * Math.PI / 180);
458
+ const { width: a, height: l } = o.size, r = "naturalWidth" in n ? n.naturalWidth : n.width, u = "naturalHeight" in n ? n.naturalHeight : n.height;
459
+ if (i.width === a && i.height === l) {
460
+ t.drawImage(n, -a / 2, -l / 2, a, l);
461
+ return;
462
+ }
463
+ t.drawImage(
464
+ n,
465
+ i.x / a * r,
466
+ i.y / l * u,
467
+ i.width / a * r,
468
+ i.height / l * u,
469
+ i.x - a / 2,
470
+ i.y - l / 2,
471
+ i.width,
472
+ i.height
473
+ );
474
+ }
475
+ function yn() {
476
+ const t = /* @__PURE__ */ new Set();
477
+ let n = [];
478
+ const o = /* @__PURE__ */ new Map();
479
+ let e = { kind: "empty" };
480
+ function i() {
481
+ for (const a of t)
482
+ o.has(a) || n.includes(a) || e.kind === "owned" && e.lease === a || (a.release(), t.delete(a));
483
+ }
484
+ return {
485
+ replace(a) {
486
+ n = a, a.forEach((l) => t.add(l)), i();
487
+ },
488
+ display(a) {
489
+ e = { kind: "owned", lease: a }, i();
490
+ },
491
+ retainDisplay() {
492
+ if (e.kind === "empty") return () => {
493
+ };
494
+ const a = e.lease;
495
+ o.set(a, o.has(a) ? o.get(a) + 1 : 1);
496
+ let l = !1;
497
+ return () => {
498
+ if (l) return;
499
+ l = !0;
500
+ const r = o.get(a) - 1;
501
+ r === 0 ? o.delete(a) : o.set(a, r), i();
502
+ };
503
+ },
504
+ clearDisplay() {
505
+ e = { kind: "empty" }, i();
506
+ },
507
+ dispose() {
508
+ n = [], e = { kind: "empty" }, i();
346
509
  }
347
510
  };
348
- return { core: Ve, onPointerDown: ut, onPointerMove: ct, onPointerUp: j, onPointerCancel: Ke, onWheel: _e };
349
511
  }
350
512
  const ue = {
351
- maxDecodedPixels: 24e6,
513
+ maxDecodedPixels: 64e6,
352
514
  maxCanvasPixels: 6e6,
353
515
  maxDevicePixelRatio: 2.5,
354
516
  maxOriginalBytes: 32 * 1024 * 1024,
@@ -357,196 +519,304 @@ const ue = {
357
519
  cacheEntries: 24,
358
520
  concurrency: 3
359
521
  };
360
- class Xe extends Error {
361
- constructor(t) {
362
- super(t), this.name = "ImageLimitError";
522
+ class Ze extends Error {
523
+ constructor(n) {
524
+ super(n), this.name = "ImageLimitError";
363
525
  }
364
526
  }
365
- const Qt = async (a, t) => {
366
- const e = await fetch(a, { signal: t.signal, credentials: "same-origin" });
367
- if (!e.ok) throw new Error(`图片加载失败:HTTP ${e.status}`);
368
- if (Number(e.headers.get("content-length")) > t.maxBytes)
369
- throw await e.body.cancel(), new Xe("资源超过下载保护限制,请使用适屏图或下载原文件");
370
- const o = e.body.getReader(), i = [];
371
- let s = 0;
527
+ function Bt(t, n) {
528
+ if (t.naturalWidth * t.naturalHeight > n)
529
+ throw new Ze("图片像素超过解码保护限制,请提供较小的适屏资源");
530
+ }
531
+ const ct = "原图超过资源限制";
532
+ function wn(t) {
533
+ return t instanceof Ze ? { status: "blocked", reason: ct } : {
534
+ status: "error",
535
+ reason: t instanceof Error ? t.message : "原图加载失败,可重试"
536
+ };
537
+ }
538
+ const zt = `(function(){"use strict";self.onmessage=async({data:a})=>{try{const t=await createImageBitmap(a.blob);let e=t;try{const s=Math.min(1,Math.sqrt(a.maxMotionPixels/(t.width*t.height)));s<1&&(e=await createImageBitmap(t,{resizeWidth:Math.max(1,Math.floor(t.width*s)),resizeHeight:Math.max(1,Math.floor(t.height*s)),resizeQuality:"high"}));const r=e===t?[t]:[t,e];self.postMessage({status:"ready",full:t,motion:e},{transfer:r})}catch(s){throw e!==t&&e.close(),t.close(),s}}catch(t){self.postMessage({status:"error",message:t instanceof Error?t.message:"图片位图准备失败"})}}})();
539
+ `, kt = typeof self < "u" && self.Blob && new Blob([zt], { type: "text/javascript;charset=utf-8" });
540
+ function bn(t) {
541
+ let n;
542
+ try {
543
+ if (n = kt && (self.URL || self.webkitURL).createObjectURL(kt), !n) throw "";
544
+ const o = new Worker(n, {
545
+ name: t == null ? void 0 : t.name
546
+ });
547
+ return o.addEventListener("error", () => {
548
+ (self.URL || self.webkitURL).revokeObjectURL(n);
549
+ }), o;
550
+ } catch {
551
+ return new Worker(
552
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(zt),
553
+ {
554
+ name: t == null ? void 0 : t.name
555
+ }
556
+ );
557
+ } finally {
558
+ n && (self.URL || self.webkitURL).revokeObjectURL(n);
559
+ }
560
+ }
561
+ function dt({ full: t, motion: n }) {
562
+ n !== t && n.close(), t.close();
563
+ }
564
+ function kn(t, n, o) {
565
+ return o.throwIfAborted(), new Promise((e, i) => {
566
+ const a = new bn(), l = () => {
567
+ o.removeEventListener("abort", r), a.terminate();
568
+ }, r = () => {
569
+ l(), i(o.reason);
570
+ };
571
+ a.onmessage = ({ data: u }) => {
572
+ if (l(), u.status === "error") {
573
+ i(new Error(u.message));
574
+ return;
575
+ }
576
+ if (o.aborted) {
577
+ dt(u), i(o.reason);
578
+ return;
579
+ }
580
+ e(u);
581
+ }, a.onerror = (u) => {
582
+ l(), i(new Error(u.message || "图片位图准备失败"));
583
+ }, o.addEventListener("abort", r, { once: !0 });
584
+ try {
585
+ a.postMessage({ blob: t, maxMotionPixels: n });
586
+ } catch (u) {
587
+ l(), i(u);
588
+ }
589
+ });
590
+ }
591
+ function Dt(t) {
592
+ return {
593
+ image: t,
594
+ source: t,
595
+ motionSource: t,
596
+ bytes: t.naturalWidth * t.naturalHeight * 4,
597
+ dispose: () => {
598
+ }
599
+ };
600
+ }
601
+ async function xn(t, n, o) {
602
+ const e = new Uint8Array(await n.slice(0, 3).arrayBuffer());
603
+ if (o.throwIfAborted(), !(e[0] === 255 && e[1] === 216 && e[2] === 255))
604
+ return await t.decode(), o.throwIfAborted(), Dt(t);
605
+ const i = await kn(n, ue.maxCanvasPixels, o);
606
+ try {
607
+ o.throwIfAborted();
608
+ const { full: a, motion: l } = i, r = l === a ? 0 : l.width * l.height * 4;
609
+ return {
610
+ image: t,
611
+ source: a,
612
+ motionSource: l,
613
+ // Include the DOM image and both retained pixel sizes in the cache budget.
614
+ bytes: (t.naturalWidth * t.naturalHeight + a.width * a.height) * 4 + r,
615
+ dispose: () => dt(i)
616
+ };
617
+ } catch (a) {
618
+ throw dt(i), a;
619
+ }
620
+ }
621
+ const Mn = async (t, n) => {
622
+ const o = await fetch(t, { signal: n.signal, credentials: "same-origin" });
623
+ if (!o.ok) throw new Error(`图片加载失败:HTTP ${o.status}`);
624
+ if (Number(o.headers.get("content-length")) > n.maxBytes)
625
+ throw await o.body.cancel(), new Ze("资源超过下载保护限制,请使用适屏图或下载原文件");
626
+ const i = o.body.getReader(), a = [];
627
+ let l = 0;
372
628
  try {
373
629
  for (; ; ) {
374
- const m = await o.read();
375
- if (m.done) break;
376
- if (s += m.value.byteLength, s > t.maxBytes)
377
- throw new Xe("资源超过下载保护限制,请使用适屏图或下载原文件");
378
- i.push(new Uint8Array(m.value));
379
- }
380
- } catch (m) {
381
- throw await o.cancel(), m;
630
+ const d = await i.read();
631
+ if (d.done) break;
632
+ if (l += d.value.byteLength, l > n.maxBytes)
633
+ throw new Ze("资源超过下载保护限制,请使用适屏图或下载原文件");
634
+ a.push(new Uint8Array(d.value));
635
+ }
636
+ } catch (d) {
637
+ throw await i.cancel(), d;
382
638
  } finally {
383
- o.releaseLock();
639
+ i.releaseLock();
384
640
  }
385
- t.signal.throwIfAborted();
386
- const r = new Blob(i, { type: e.headers.get("content-type") }), f = URL.createObjectURL(r), y = new Image();
387
- y.decoding = "async";
641
+ n.signal.throwIfAborted();
642
+ const r = new Blob(a, { type: o.headers.get("content-type") }), u = URL.createObjectURL(r), p = new Image();
643
+ p.decoding = "async";
388
644
  try {
389
- if (await new Promise((m, b) => {
390
- const B = () => {
391
- y.removeAttribute("src"), b(new DOMException("请求已取消", "AbortError"));
645
+ return await new Promise((d, S) => {
646
+ const C = () => {
647
+ p.removeAttribute("src"), S(new DOMException("请求已取消", "AbortError"));
392
648
  };
393
- y.onload = () => {
394
- t.signal.removeEventListener("abort", B), m();
395
- }, y.onerror = () => {
396
- t.signal.removeEventListener("abort", B), b(new Error("图片解码失败或格式不受支持"));
397
- }, t.signal.addEventListener("abort", B, { once: !0 }), y.src = f;
398
- }), t.signal.throwIfAborted(), y.naturalWidth * y.naturalHeight > ue.maxDecodedPixels)
399
- throw new Xe("图片像素超过解码保护限制,请提供较小的适屏资源");
400
- return await y.decode(), t.signal.throwIfAborted(), y;
649
+ p.onload = () => {
650
+ n.signal.removeEventListener("abort", C), d();
651
+ }, p.onerror = () => {
652
+ n.signal.removeEventListener("abort", C), S(new Error("图片解码失败或格式不受支持"));
653
+ }, n.signal.addEventListener("abort", C, { once: !0 }), p.src = u;
654
+ }), n.signal.throwIfAborted(), Bt(p, n.maxPixels), await xn(p, r, n.signal);
401
655
  } finally {
402
- URL.revokeObjectURL(f);
656
+ URL.revokeObjectURL(u);
403
657
  }
404
658
  };
405
- class Jt {
406
- constructor(t = ue.cacheBytes, e = ue.concurrency, n = Qt) {
407
- tt(this, "entries", /* @__PURE__ */ new Map());
408
- tt(this, "active", 0);
409
- tt(this, "cancelled", 0);
410
- this.budget = t, this.concurrency = e, this.loader = n;
659
+ class Sn {
660
+ constructor(n = ue.cacheBytes, o = ue.concurrency, e = Mn) {
661
+ et(this, "entries", /* @__PURE__ */ new Map());
662
+ et(this, "active", 0);
663
+ et(this, "cancelled", 0);
664
+ this.budget = n, this.concurrency = o, this.loader = e;
411
665
  }
412
666
  get stats() {
413
667
  return {
414
668
  active: this.active,
415
- queued: [...this.entries.values()].filter((t) => t.state === "queued").length,
669
+ queued: [...this.entries.values()].filter((n) => n.state === "queued").length,
416
670
  entries: this.entries.size,
417
- bytes: [...this.entries.values()].reduce((t, e) => t + e.bytes, 0),
671
+ bytes: [...this.entries.values()].reduce((n, o) => n + o.bytes, 0),
418
672
  cancelled: this.cancelled
419
673
  };
420
674
  }
421
- acquire(t, e = {}) {
422
- const n = { priority: 0, maxBytes: ue.maxOriginalBytes, ...e };
423
- if (this.entries.has(t) && ["error", "aborted"].includes(this.entries.get(t).state) && this.entries.delete(t), !this.entries.has(t)) {
424
- let s, r;
425
- const f = new Promise((y, m) => {
426
- s = y, r = m;
675
+ acquire(n, o = {}) {
676
+ const e = {
677
+ priority: 0,
678
+ maxBytes: ue.maxOriginalBytes,
679
+ maxPixels: ue.maxDecodedPixels,
680
+ ...o
681
+ };
682
+ if (this.entries.has(n) && ["error", "aborted"].includes(this.entries.get(n).state) && this.entries.delete(n), !this.entries.has(n)) {
683
+ let u, p;
684
+ const d = new Promise((S, C) => {
685
+ u = S, p = C;
427
686
  });
428
- f.catch(() => {
429
- }), this.entries.set(t, {
430
- promise: f,
431
- resolve: s,
432
- reject: r,
687
+ d.catch(() => {
688
+ }), this.entries.set(n, {
689
+ promise: d,
690
+ resolve: u,
691
+ reject: p,
433
692
  controller: new AbortController(),
434
693
  users: 0,
435
694
  bytes: 0,
436
- priority: n.priority,
437
- maxBytes: n.maxBytes,
695
+ dispose: () => {
696
+ },
697
+ priority: e.priority,
698
+ maxBytes: e.maxBytes,
699
+ maxPixels: e.maxPixels,
438
700
  state: "queued"
439
701
  });
440
702
  }
441
- const o = this.entries.get(t);
442
- o.users++, o.priority = Math.min(o.priority, n.priority), o.maxBytes = Math.max(o.maxBytes, n.maxBytes), this.entries.delete(t), this.entries.set(t, o), this.pump();
443
- let i = !1;
444
- return {
445
- ready: o.promise,
703
+ const i = this.entries.get(n);
704
+ i.users++, i.priority = Math.min(i.priority, e.priority), i.maxBytes = Math.max(i.maxBytes, e.maxBytes), i.maxPixels = Math.max(i.maxPixels, e.maxPixels), this.entries.delete(n), this.entries.set(n, i), this.pump();
705
+ let a = !1;
706
+ const l = i.promise.then((u) => (Bt(u.image, e.maxPixels), u)), r = l.then((u) => u.image);
707
+ return l.catch(() => {
708
+ }), r.catch(() => {
709
+ }), {
710
+ ready: r,
711
+ resource: l,
446
712
  release: () => {
447
- i || (i = !0, o.users--, o.users === 0 && (o.state === "queued" || o.state === "loading") && (o.state = "aborted", this.cancelled++, o.controller.abort(), o.reject(new DOMException("请求已取消", "AbortError")), this.entries.get(t) === o && this.entries.delete(t)), o.users === 0 && o.state === "error" && this.entries.get(t) === o && this.entries.delete(t), this.trim(), this.pump());
713
+ a || (a = !0, i.users--, i.users === 0 && (i.state === "queued" || i.state === "loading") && (i.state = "aborted", this.cancelled++, i.controller.abort(), i.reject(new DOMException("请求已取消", "AbortError")), this.entries.get(n) === i && this.entries.delete(n)), i.users === 0 && i.state === "error" && this.entries.get(n) === i && this.entries.delete(n), this.trim(), this.pump());
448
714
  }
449
715
  };
450
716
  }
451
717
  pump() {
452
718
  for (; this.active < this.concurrency; ) {
453
- const t = [...this.entries].filter(([, o]) => o.state === "queued" && o.users > 0).sort((o, i) => o[1].priority - i[1].priority);
454
- if (t.length === 0) return;
455
- const [e, n] = t[0];
456
- n.state = "loading", this.active++, this.loader(e, {
457
- signal: n.controller.signal,
719
+ const n = [...this.entries].filter(([, i]) => i.state === "queued" && i.users > 0).sort((i, a) => i[1].priority - a[1].priority);
720
+ if (n.length === 0) return;
721
+ const [o, e] = n[0];
722
+ e.state = "loading", this.active++, this.loader(o, {
723
+ signal: e.controller.signal,
458
724
  get maxBytes() {
459
- return n.maxBytes;
725
+ return e.maxBytes;
726
+ },
727
+ get maxPixels() {
728
+ return e.maxPixels;
460
729
  }
461
- }).then((o) => {
462
- n.state !== "aborted" && (n.bytes = o.naturalWidth * o.naturalHeight * 4, n.state = "ready", n.resolve(o));
463
- }).catch((o) => {
464
- n.state !== "aborted" && (n.state = "error", n.reject(Ae(o)));
730
+ }).then((i) => {
731
+ if (e.state === "aborted") {
732
+ i.dispose();
733
+ return;
734
+ }
735
+ e.bytes = i.bytes, e.dispose = i.dispose, e.state = "ready", e.resolve(i);
736
+ }).catch((i) => {
737
+ e.state !== "aborted" && (e.state = "error", e.reject(_e(i)));
465
738
  }).finally(() => {
466
739
  this.active--, this.trim(), this.pump();
467
740
  });
468
741
  }
469
742
  }
470
743
  trim() {
471
- let t = this.stats.bytes;
472
- for (const [e, n] of this.entries)
473
- if (!(n.users > 0 || n.state === "loading" || n.state === "queued")) {
474
- if (t <= this.budget && this.entries.size <= ue.cacheEntries) break;
475
- t -= n.bytes, this.entries.delete(e);
744
+ let n = this.stats.bytes;
745
+ for (const [o, e] of this.entries)
746
+ if (!(e.users > 0 || e.state === "loading" || e.state === "queued")) {
747
+ if (n <= this.budget && this.entries.size <= ue.cacheEntries) break;
748
+ n -= e.bytes, e.dispose(), this.entries.delete(o);
476
749
  }
477
750
  }
478
751
  }
479
- const ea = new Jt(), ke = { kind: "empty" };
480
- function ta(a) {
481
- return a.kind === "element" && a.element instanceof HTMLImageElement && a.element.complete && a.element.naturalWidth > 0 ? { kind: "image", image: a.element } : ke;
752
+ const Pn = new Sn(), Re = { kind: "empty" };
753
+ function Rn(t) {
754
+ return t.kind === "element" && t.element instanceof HTMLImageElement && t.element.complete && t.element.naturalWidth > 0 ? { kind: "image", image: t.element } : Re;
482
755
  }
483
- function kt() {
484
- const a = document.createElement("canvas");
485
- a.width = a.height = 1;
486
- const t = a.getContext("2d");
487
- return t.fillStyle = "#f3f4f5", t.fillRect(0, 0, 1, 1), a;
756
+ function xt() {
757
+ const t = document.createElement("canvas");
758
+ t.width = t.height = 1;
759
+ const n = t.getContext("2d");
760
+ return n.fillStyle = "#f3f4f5", n.fillRect(0, 0, 1, 1), t;
488
761
  }
489
- const Rt = ["thumbnail", "screen", "full"], We = {
762
+ const It = ["thumbnail", "screen", "full"], je = {
490
763
  maxOriginalPixels: ue.maxDecodedPixels,
491
764
  maxOriginalBytes: ue.maxOriginalBytes,
492
765
  maxPreviewBytes: ue.maxPreviewBytes
493
- }, Ne = (a, t) => t === "full" ? a.src : t === "screen" ? a.previewSrc : a.thumbnail;
494
- function aa(a, t) {
495
- return a.width * a.height <= t.maxOriginalPixels;
766
+ }, Ke = (t, n) => n === "full" ? t.src : n === "screen" ? t.previewSrc : t.thumbnail;
767
+ function En(t, n) {
768
+ return t.width * t.height <= n.maxOriginalPixels;
496
769
  }
497
- function xt(a, t) {
498
- const e = Math.min(t.width / a.width, t.height / a.height);
770
+ function Cn(t, n) {
771
+ const o = Math.min(n.width / t.width, n.height / t.height);
499
772
  return Math.min(
500
773
  8,
501
774
  Math.max(
502
775
  2,
503
776
  Math.min(
504
- 1 / e,
505
- Math.max(t.width / (a.width * e), t.height / (a.height * e))
777
+ 1 / o,
778
+ Math.max(n.width / (t.width * o), n.height / (t.height * o))
506
779
  )
507
780
  )
508
781
  );
509
782
  }
510
- function na(a, t, e, n, o) {
511
- const i = aa(a, e), s = {
783
+ function Ln(t, n, o, e, i, a = !0) {
784
+ const l = En(t, o), r = {
512
785
  sources: [],
513
- originalStatus: t === "full" ? i ? "loading" : "blocked" : "idle",
786
+ originalStatus: a && n === "full" ? l ? "loading" : "blocked" : "idle",
514
787
  originalReason: ""
515
788
  };
516
- s.originalStatus === "blocked" && (s.originalReason = "原图像素过大,当前显示适屏预览,可下载原文件");
517
- for (const [r, f] of Rt.entries()) {
518
- if (f === "screen" && t === "thumbnail" || f === "full" && (t !== "full" || !i)) continue;
519
- const y = n(a, f, o);
520
- if (!i && y === a.src) {
521
- s.originalStatus = "blocked", s.originalReason = "大原图需要独立的适屏资源,请从相册生成预览或下载文件";
789
+ r.originalStatus === "blocked" && (r.originalReason = ct);
790
+ for (const [u, p] of It.entries()) {
791
+ if (p === "screen" && n === "thumbnail" || p === "full" && (!a || n !== "full" || !l))
792
+ continue;
793
+ const d = e(t, p, i);
794
+ if (a && !l && d === t.src) {
795
+ r.originalStatus = "blocked", r.originalReason = ct;
522
796
  continue;
523
797
  }
524
- s.sources.push({ url: y, quality: f, rank: r });
798
+ r.sources.push({ url: d, quality: p, rank: u });
525
799
  }
526
- return s;
800
+ return r;
527
801
  }
528
- const ia = ["aria-label"], oa = {
802
+ const Fn = ["aria-label"], $n = {
529
803
  key: 0,
530
804
  class: "mp-resource-state",
531
805
  role: "status",
532
806
  "aria-label": "加载中"
533
- }, ra = /* @__PURE__ */ $("span", {
807
+ }, Tn = /* @__PURE__ */ B("span", {
534
808
  class: "mp-spinner",
535
809
  "aria-hidden": "true"
536
- }, null, -1), la = [
537
- ra
538
- ], sa = {
810
+ }, null, -1), Bn = [
811
+ Tn
812
+ ], zn = {
539
813
  key: 1,
540
814
  class: "mp-resource-state",
541
815
  role: "alert"
542
- }, ua = /* @__PURE__ */ $("span", null, "图片暂时无法加载", -1), ca = {
816
+ }, Dn = /* @__PURE__ */ B("span", null, "图片暂时无法加载", -1), In = {
543
817
  key: 2,
544
- class: "mp-quality-notice",
545
- role: "status"
546
- }, da = {
547
- key: 3,
548
818
  class: "mp-quality-notice"
549
- }, vt = /* @__PURE__ */ Le({
819
+ }, pt = /* @__PURE__ */ Te({
550
820
  inheritAttrs: !1,
551
821
  __name: "ImageCanvasRenderer",
552
822
  props: {
@@ -556,48 +826,51 @@ const ia = ["aria-label"], oa = {
556
826
  rendering: { type: Boolean, default: !0 },
557
827
  requestVersion: { default: 0 },
558
828
  loadEnabled: { type: Boolean, default: !0 },
829
+ originalEnabled: { type: Boolean, default: !0 },
559
830
  priority: { default: 0 },
560
- resourcePolicy: { default: () => We },
561
- resolveSource: { type: Function, default: Ne },
562
- initialImage: { default: () => ke }
831
+ resourcePolicy: { default: () => je },
832
+ resolveSource: { type: Function, default: Ke },
833
+ initialImage: { default: () => Re }
563
834
  },
564
835
  emits: ["ready", "error", "originalState"],
565
- setup(a, { emit: t }) {
566
- const e = a, n = t, o = R(), i = gt({ status: "empty" }), s = R("loading"), r = R(!1), f = R("idle"), y = R("");
836
+ setup(t, { expose: n, emit: o }) {
837
+ const e = t, i = o, a = L(), l = ft({ status: "empty" }), r = L("loading"), u = L(!1), p = L("idle"), d = L("");
567
838
  ee(
568
- [f, y],
569
- () => n("originalState", f.value, y.value)
839
+ [p, d],
840
+ () => i("originalState", p.value, d.value)
570
841
  );
571
- let m = !0, b = 0, B = e.media.id, L = [], P = () => {
572
- }, p, v = !1, T = { kind: "empty" };
573
- function I() {
574
- if (e.core.motionActive.value && e.loadEnabled && B === e.media.id) {
575
- v = !0;
842
+ let S = !0, C = 0, P = e.media.id;
843
+ const R = yn();
844
+ let x = () => {
845
+ }, m, F = !1, q = { kind: "empty" };
846
+ function v() {
847
+ if (e.core.motionActive.value && e.loadEnabled && P === e.media.id) {
848
+ F = !0;
576
849
  return;
577
850
  }
578
- v = !1, k();
851
+ F = !1, w();
579
852
  }
580
- function w(d, M, C) {
581
- i.value = { status: "ready", image: d, rank: M }, e.core.setMediaElement(d), s.value = "ready", r.value = !1, C === "full" && (f.value = "ready"), e.core.requestRender(), n("ready", C);
853
+ function k(h, $, D, I) {
854
+ l.value = { status: "ready", value: h, rank: D }, R.display($), e.core.setMediaElement(h.image), r.value = "ready", u.value = !1, I === "full" && (p.value = "ready"), e.core.requestRender(), i("ready", I);
582
855
  }
583
856
  ee(
584
857
  () => e.core.motionActive.value,
585
- (d) => {
586
- if (!d) {
587
- if (T.kind === "ready") {
588
- const M = T;
589
- T = { kind: "empty" }, M.token === b && w(M.image, M.rank, M.quality);
858
+ (h) => {
859
+ if (e.core.requestRender(), !h) {
860
+ if (q.kind === "ready") {
861
+ const $ = q;
862
+ q = { kind: "empty" }, $.token === C && k($.value, $.lease, $.rank, $.quality);
590
863
  }
591
- v && I();
864
+ F && v();
592
865
  }
593
866
  }
594
- ), ze(() => {
595
- const d = o.value;
596
- p = d.getContext("2d"), e.core.canvasRef.value = d, P = e.core.registerRenderHandler(h), u(), ye(() => {
597
- m && I();
867
+ ), qe(() => {
868
+ const h = a.value;
869
+ m = h.getContext("2d"), e.core.canvasRef.value = h, x = e.core.registerRenderHandler(E), g(), Me(() => {
870
+ S && v();
598
871
  });
599
- }), Re(() => {
600
- m = !1, b += 1, P(), L.forEach((d) => d.release());
872
+ }), $e(() => {
873
+ S = !1, C += 1, x(), R.dispose();
601
874
  }), ee(
602
875
  [
603
876
  () => e.media.id,
@@ -608,169 +881,259 @@ const ia = ["aria-label"], oa = {
608
881
  () => e.loadEnabled,
609
882
  () => e.priority,
610
883
  () => e.resolveSource,
884
+ () => e.resourcePolicy,
885
+ () => e.originalEnabled,
611
886
  () => e.requestVersion
612
887
  ],
613
888
  () => {
614
- I();
889
+ v();
615
890
  }
616
- ), ee(() => e.initialImage, u), ee(
891
+ ), ee(() => e.initialImage, g), ee(
617
892
  () => e.rendering,
618
- (d) => {
619
- d && e.core.requestRender();
893
+ (h) => {
894
+ h && e.core.requestRender();
620
895
  }
621
896
  );
622
- function u() {
623
- e.initialImage.kind !== "image" || i.value.status === "ready" || (i.value = { status: "ready", image: e.initialImage.image, rank: 0 }, e.core.setMediaElement(e.initialImage.image), s.value = "ready", e.core.requestRender(), n("ready", "thumbnail"));
624
- }
625
- async function k() {
626
- const d = ++b;
627
- if (T = { kind: "empty" }, r.value = !1, B !== e.media.id && (B = e.media.id, i.value = { status: "empty" }, s.value = "loading", e.core.clearMedia(), u()), !e.loadEnabled) {
628
- L.forEach((Y) => Y.release()), L = [];
897
+ function g() {
898
+ e.initialImage.kind !== "image" || l.value.status === "ready" || (l.value = {
899
+ status: "ready",
900
+ value: Dt(e.initialImage.image),
901
+ rank: 0
902
+ }, e.core.setMediaElement(e.initialImage.image), r.value = "ready", e.core.requestRender(), i("ready", "thumbnail"));
903
+ }
904
+ async function w() {
905
+ const h = ++C;
906
+ if (q = { kind: "empty" }, u.value = !1, P !== e.media.id && (P = e.media.id, l.value = { status: "empty" }, R.clearDisplay(), r.value = "loading", e.core.clearMedia(), g()), !e.loadEnabled) {
907
+ R.replace([]);
629
908
  return;
630
909
  }
631
- const M = Math.ceil(
910
+ const $ = Math.ceil(
632
911
  e.core.viewportSize.value.width * Math.min(devicePixelRatio, ue.maxDevicePixelRatio) * e.core.state.level
633
- ), C = na(
912
+ ), D = Ln(
634
913
  e.media,
635
914
  e.quality,
636
915
  e.resourcePolicy,
637
916
  e.resolveSource,
638
- M
917
+ $,
918
+ e.originalEnabled
639
919
  );
640
- y.value = C.originalReason, f.value = C.originalStatus;
641
- const { sources: E } = C, A = E.map(
642
- (Y) => ea.acquire(Y.url, {
920
+ d.value = D.originalReason, p.value = D.originalStatus;
921
+ const { sources: I } = D, H = I.map(
922
+ (ie) => Pn.acquire(ie.url, {
643
923
  priority: e.priority,
644
- maxBytes: Y.quality === "full" ? e.resourcePolicy.maxOriginalBytes : e.resourcePolicy.maxPreviewBytes
924
+ maxPixels: e.resourcePolicy.maxOriginalPixels,
925
+ maxBytes: ie.quality === "full" ? e.resourcePolicy.maxOriginalBytes : e.resourcePolicy.maxPreviewBytes
645
926
  })
646
- ), V = L;
647
- L = A, V.forEach((Y) => Y.release()), E.length === 0 && i.value.status === "empty" && (s.value = "error", n("error", new Xe(y.value))), i.value.status === "ready" && n("ready", Rt[i.value.rank]);
648
- let _ = i.value.status === "ready" ? i.value.rank : -1, N = 0;
927
+ );
928
+ R.replace(H), I.length === 0 && l.value.status === "empty" && (r.value = "error", i("error", new Ze(d.value))), l.value.status === "ready" && i("ready", It[l.value.rank]);
929
+ let Z = l.value.status === "ready" ? l.value.rank : -1, J = 0;
649
930
  await Promise.all(
650
- E.map(async (Y, Pe) => {
651
- const se = Y.rank, fe = A[Pe];
931
+ I.map(async (ie, Ee) => {
932
+ const oe = ie.rank, se = H[Ee];
652
933
  try {
653
- const K = await fe.ready;
654
- if (d !== b || se < _) return;
655
- _ = se, e.core.motionActive.value && i.value.status === "ready" ? T = { kind: "ready", token: d, image: K, rank: se, quality: Y.quality } : w(K, se, Y.quality);
656
- } catch (K) {
657
- if (d !== b || K instanceof Error && K.name === "AbortError") return;
658
- Y.quality === "full" && (f.value = K instanceof Xe ? "blocked" : "error", y.value = K instanceof Error ? K.message : "原图加载失败,可重试"), N += 1, se > _ && i.value.status === "ready" && (r.value = !0), N === E.length && i.value.status === "empty" && (s.value = "error"), n("error", Ae(K));
934
+ const ce = await se.resource;
935
+ if (h !== C || oe < Z) return;
936
+ Z = oe, e.core.motionActive.value && l.value.status === "ready" ? q = {
937
+ kind: "ready",
938
+ token: h,
939
+ value: ce,
940
+ lease: se,
941
+ rank: oe,
942
+ quality: ie.quality
943
+ } : k(ce, se, oe, ie.quality);
944
+ } catch (ce) {
945
+ if (h !== C || ce instanceof Error && ce.name === "AbortError") return;
946
+ if (ie.quality === "full") {
947
+ const de = wn(ce);
948
+ p.value = de.status, d.value = de.reason;
949
+ }
950
+ J += 1, oe > Z && l.value.status === "ready" && (u.value = !0), J === I.length && l.value.status === "empty" && (r.value = "error"), i("error", _e(ce));
659
951
  }
660
952
  })
661
953
  );
662
954
  }
663
- function h() {
664
- if (!e.rendering || i.value.status !== "ready") return;
665
- const d = o.value, M = e.core.viewportSize.value;
666
- if (M.width <= 0 || M.height <= 0) return;
667
- const C = Math.min(
955
+ function E() {
956
+ if (!e.rendering || l.value.status !== "ready") return;
957
+ const h = a.value, $ = e.core.viewportSize.value;
958
+ if ($.width <= 0 || $.height <= 0) return;
959
+ const D = Math.min(
668
960
  devicePixelRatio,
669
961
  ue.maxDevicePixelRatio,
670
- Math.sqrt(ue.maxCanvasPixels / (M.width * M.height))
671
- ), E = Math.max(1, Math.round(M.width * C)), A = Math.max(1, Math.round(M.height * C));
672
- (d.width !== E || d.height !== A) && (d.width = E, d.height = A), p.setTransform(C, 0, 0, C, 0, 0), p.clearRect(0, 0, M.width, M.height), p.imageSmoothingEnabled = !0, p.imageSmoothingQuality = "high", p.translate(
673
- M.width / 2 + e.core.state.offsetX,
674
- M.height / 2 + e.core.state.offsetY
675
- ), p.rotate(e.core.state.rotation * Math.PI / 180);
676
- const { width: V, height: _ } = e.core.mediaSize.value, N = e.core.displayScale.value;
677
- p.drawImage(
678
- i.value.image,
679
- -V * N / 2,
680
- -_ * N / 2,
681
- V * N,
682
- _ * N
962
+ Math.sqrt(ue.maxCanvasPixels / ($.width * $.height))
963
+ ), I = Math.max(1, Math.round($.width * D)), H = Math.max(1, Math.round($.height * D));
964
+ (h.width !== I || h.height !== H) && (h.width = I, h.height = H), m.setTransform(D, 0, 0, D, 0, 0), m.clearRect(0, 0, $.width, $.height);
965
+ const { width: Z, height: J } = e.core.mediaSize.value, ie = e.core.displayScale.value;
966
+ vn(
967
+ m,
968
+ e.core.motionActive.value ? l.value.value.motionSource : l.value.value.source,
969
+ {
970
+ viewport: $,
971
+ size: { width: Z * ie, height: J * ie },
972
+ offsetX: e.core.state.offsetX,
973
+ offsetY: e.core.state.offsetY,
974
+ rotation: e.core.state.rotation
975
+ },
976
+ e.core.motionActive.value
683
977
  );
684
978
  }
685
- return (d, M) => (z(), H(De, null, [
686
- $("canvas", {
979
+ function y() {
980
+ if (l.value.status !== "ready") throw new Error("图片画面尚未就绪");
981
+ return { image: l.value.value.motionSource, scale: 1 };
982
+ }
983
+ return n({
984
+ captureFrame: y,
985
+ retainFrame: () => ({
986
+ ...y(),
987
+ release: R.retainDisplay()
988
+ })
989
+ }), (h, $) => (O(), A(Fe, null, [
990
+ B("canvas", {
687
991
  ref_key: "canvasRef",
688
- ref: o,
992
+ ref: a,
689
993
  class: "mp-canvas-renderer",
690
- "aria-label": d.media.title
691
- }, null, 8, ia),
692
- s.value === "loading" ? (z(), H("div", oa, la)) : ie("", !0),
693
- s.value === "error" ? (z(), H("div", sa, [
694
- ua,
695
- $("button", {
994
+ "aria-label": h.media.title
995
+ }, null, 8, Fn),
996
+ r.value === "loading" ? (O(), A("div", $n, Bn)) : le("", !0),
997
+ r.value === "error" ? (O(), A("div", zn, [
998
+ Dn,
999
+ B("button", {
696
1000
  type: "button",
697
- onClick: J(k, ["stop"])
1001
+ onClick: ae(w, ["stop"])
698
1002
  }, "重新加载")
699
- ])) : ie("", !0),
700
- f.value === "blocked" ? (z(), H("span", ca, le(y.value), 1)) : r.value ? (z(), H("span", da, "高清图加载失败,当前显示预览图")) : ie("", !0)
1003
+ ])) : le("", !0),
1004
+ u.value && p.value !== "blocked" ? (O(), A("span", In, " 高清图加载失败,当前显示预览图 ")) : le("", !0)
701
1005
  ], 64));
702
1006
  }
703
1007
  });
704
- function Ie(a) {
705
- const t = Math.max(0, Math.floor(Number.isFinite(a) ? a : 0));
706
- return `${String(Math.floor(t / 60)).padStart(2, "0")}:${String(t % 60).padStart(2, "0")}`;
1008
+ function qn(t, n, o) {
1009
+ const { buffered: e } = t;
1010
+ if (!Number.isFinite(n) || n <= 0) return [];
1011
+ const i = [], a = Math.min(0.25, n * 0.05);
1012
+ for (let l = 0; l < e.length; l++) {
1013
+ const r = Q(e.start(l), 0, n);
1014
+ let u = Q(e.end(l), r, n);
1015
+ l === e.length - 1 && (t.ended || o.kind === "retained" && e.end(l) >= o.end || t.readyState >= 4 && n - u <= a) && (u = n), u > r && i.push({ start: r, end: u });
1016
+ }
1017
+ return i;
1018
+ }
1019
+ function Ve(t) {
1020
+ const n = Math.max(0, Math.floor(Number.isFinite(t) ? t : 0));
1021
+ return `${String(Math.floor(n / 60)).padStart(2, "0")}:${String(n % 60).padStart(2, "0")}`;
1022
+ }
1023
+ function Mt(t) {
1024
+ return Number.isFinite(t) && t > 0 ? t : 0;
1025
+ }
1026
+ function St() {
1027
+ return { duration: 0, time: 0, buffered: 0, bufferedRanges: [] };
1028
+ }
1029
+ function On() {
1030
+ let t = 0, n = { kind: "pending" };
1031
+ return {
1032
+ setDuration(o) {
1033
+ t = Mt(o);
1034
+ },
1035
+ complete(o) {
1036
+ const { buffered: e } = o;
1037
+ n = e.length > 0 ? { kind: "retained", end: e.end(e.length - 1) } : { kind: "pending" };
1038
+ },
1039
+ reset() {
1040
+ t = 0, n = { kind: "pending" };
1041
+ },
1042
+ read(o, e) {
1043
+ const i = t > 0 ? t : Mt(o.duration), a = qn(o, i, n);
1044
+ return {
1045
+ duration: i,
1046
+ time: e ? i : Q(o.currentTime, 0, i),
1047
+ buffered: a.length > 0 ? a[a.length - 1].end : 0,
1048
+ bufferedRanges: a
1049
+ };
1050
+ }
1051
+ };
707
1052
  }
708
- function Lt(a, t) {
709
- const e = mt({
1053
+ function qt(t, n) {
1054
+ const o = On(), e = gt({
710
1055
  playing: !1,
711
1056
  buffering: !1,
712
- duration: 0,
713
- time: 0,
714
- buffered: 0,
1057
+ ...St(),
715
1058
  muted: !1,
716
1059
  ended: !1,
717
1060
  scrubbing: !1,
718
1061
  scrubTime: 0,
719
1062
  status: "loading"
720
1063
  });
721
- let n = !1, o = 0, i = !1;
722
- const s = U(() => e.duration > 0 && e.status !== "error"), r = U(() => e.scrubbing ? e.scrubTime : e.time), f = U(() => s.value ? r.value / e.duration * 100 : 0), y = U(
723
- () => s.value ? e.buffered / e.duration * 100 : 0
1064
+ let i = !1, a = 0, l = !1;
1065
+ const r = X(() => e.duration > 0 && e.status !== "error"), u = X(() => e.scrubbing ? e.scrubTime : e.time), p = X(() => r.value ? u.value / e.duration * 100 : 0), d = X(
1066
+ () => r.value ? e.buffered / e.duration * 100 : 0
1067
+ ), S = X(
1068
+ () => e.bufferedRanges.map(({ start: D, end: I }) => ({
1069
+ left: D / e.duration * 100,
1070
+ width: (I - D) / e.duration * 100
1071
+ }))
724
1072
  );
725
- function m() {
726
- const h = a();
727
- e.time = h.currentTime, e.duration = Number.isFinite(h.duration) ? h.duration : 0;
728
- const d = h.buffered;
729
- e.buffered = d.length > 0 ? d.end(d.length - 1) : 0;
730
- }
731
- async function b() {
732
- if (i) return;
733
- const h = ++o;
734
- e.ended && (a().currentTime = 0), e.ended = !1, e.buffering = !0;
1073
+ function C() {
1074
+ Object.assign(e, o.read(t(), e.ended));
1075
+ }
1076
+ function P(D) {
1077
+ l || (o.setDuration(D), C(), e.scrubTime = Q(e.scrubTime, 0, e.duration));
1078
+ }
1079
+ function R() {
1080
+ o.reset(), i = !1, a += 1, Object.assign(e, {
1081
+ playing: !1,
1082
+ buffering: !1,
1083
+ ...St(),
1084
+ ended: !1,
1085
+ scrubbing: !1,
1086
+ scrubTime: 0,
1087
+ status: "loading"
1088
+ });
1089
+ }
1090
+ async function x() {
1091
+ if (l) return;
1092
+ const D = ++a;
1093
+ e.ended && (t().currentTime = 0, e.time = 0), e.ended = !1, e.buffering = !0;
735
1094
  try {
736
- await a().play();
737
- } catch (d) {
738
- if (h !== o) return;
739
- e.buffering = !1, e.playing = !1, d instanceof Error && d.name !== "NotAllowedError" && d.name !== "AbortError" && t(d);
1095
+ await t().play();
1096
+ } catch (I) {
1097
+ if (D !== a) return;
1098
+ e.buffering = !1, e.playing = !1, I instanceof Error && I.name !== "NotAllowedError" && I.name !== "AbortError" && n(I);
740
1099
  }
741
1100
  }
742
- function B() {
743
- o += 1, n = !1, e.scrubbing = !1, e.buffering = !1, a().pause();
1101
+ function m() {
1102
+ a += 1, i = !1, e.scrubbing = !1, e.buffering = !1, t().pause();
744
1103
  }
745
- function L() {
746
- e.playing ? B() : b();
1104
+ function F() {
1105
+ e.playing ? m() : x();
747
1106
  }
748
- function P() {
749
- !s.value || e.scrubbing || (n = e.playing, e.scrubbing = !0, e.scrubTime = e.time, a().pause());
1107
+ function q() {
1108
+ !r.value || e.scrubbing || (i = e.playing, e.scrubbing = !0, e.scrubTime = e.time, t().pause());
750
1109
  }
751
- function p(h) {
752
- e.scrubTime = de(h, 0, e.duration);
1110
+ function v(D) {
1111
+ e.scrubTime = Q(D, 0, e.duration);
753
1112
  }
754
- function v(h = !0) {
1113
+ function k(D = !0) {
755
1114
  if (!e.scrubbing) return;
756
- const d = n;
757
- n = !1, e.scrubbing = !1, h && (a().currentTime = e.scrubTime, e.time = e.scrubTime, e.ended = !1), d && b();
1115
+ const I = i;
1116
+ i = !1, e.scrubbing = !1, D && (t().currentTime = e.scrubTime, e.time = e.scrubTime, e.ended = !1), I && x();
1117
+ }
1118
+ function g() {
1119
+ t().muted = !t().muted, e.muted = t().muted;
758
1120
  }
759
- function T() {
760
- a().muted = !a().muted, e.muted = a().muted;
1121
+ function w(D) {
1122
+ e.status = "error", e.playing = !1, e.buffering = !1, n(D);
761
1123
  }
762
- const w = Object.fromEntries(
1124
+ const y = Object.fromEntries(
763
1125
  Object.entries({
764
- loadedmetadata: m,
765
- durationchange: m,
766
- timeupdate: m,
767
- progress: m,
1126
+ loadedmetadata: C,
1127
+ durationchange: C,
1128
+ timeupdate: C,
1129
+ progress: C,
768
1130
  loadeddata: () => {
769
- m(), e.status = "ready", e.buffering = !1;
1131
+ C(), e.status = "ready", e.buffering = !1;
770
1132
  },
771
1133
  canplay: () => {
772
- e.buffering = !1;
1134
+ C(), e.buffering = !1;
773
1135
  },
1136
+ canplaythrough: C,
774
1137
  play: () => {
775
1138
  e.playing = !0, e.ended = !1;
776
1139
  },
@@ -781,7 +1144,7 @@ function Lt(a, t) {
781
1144
  e.playing = !1, e.buffering = !1;
782
1145
  },
783
1146
  ended: () => {
784
- e.playing = !1, e.ended = !0, e.buffering = !1, m();
1147
+ e.playing = !1, e.ended = !0, e.buffering = !1, o.complete(t()), C();
785
1148
  },
786
1149
  waiting: () => {
787
1150
  e.buffering = e.playing;
@@ -790,46 +1153,50 @@ function Lt(a, t) {
790
1153
  e.buffering = !0;
791
1154
  },
792
1155
  seeked: () => {
793
- e.buffering = !1, m();
1156
+ e.buffering = !1, C();
794
1157
  },
795
1158
  volumechange: () => {
796
- e.muted = a().muted;
1159
+ e.muted = t().muted;
797
1160
  },
798
1161
  error: () => {
799
- e.status = "error", e.playing = !1, e.buffering = !1, t(new Error("视频暂时无法播放,请重试或检查资源格式"));
1162
+ w(new Error("视频暂时无法播放,请重试或检查资源格式"));
800
1163
  }
801
- }).map(([h, d]) => [
802
- h,
1164
+ }).map(([D, I]) => [
1165
+ D,
803
1166
  () => {
804
- i || d();
1167
+ l || I();
805
1168
  }
806
1169
  ])
807
1170
  );
808
- function u() {
809
- i = !0, B();
1171
+ function h() {
1172
+ l = !0, m();
810
1173
  }
811
- function k() {
812
- e.status = "loading", e.buffering = !0, a().load();
1174
+ function $() {
1175
+ R(), e.buffering = !0, t().load();
813
1176
  }
814
1177
  return {
815
1178
  state: e,
816
- seekable: s,
817
- displayTime: r,
818
- progress: f,
819
- bufferedProgress: y,
820
- events: w,
821
- play: b,
822
- pause: B,
823
- toggle: L,
824
- beginScrub: P,
825
- scrub: p,
826
- endScrub: v,
827
- toggleMuted: T,
828
- retry: k,
829
- dispose: u
1179
+ seekable: r,
1180
+ displayTime: u,
1181
+ progress: p,
1182
+ bufferedProgress: d,
1183
+ bufferedRanges: S,
1184
+ events: y,
1185
+ play: x,
1186
+ pause: m,
1187
+ toggle: F,
1188
+ beginScrub: q,
1189
+ scrub: v,
1190
+ endScrub: k,
1191
+ toggleMuted: g,
1192
+ retry: $,
1193
+ setSourceDuration: P,
1194
+ resetSource: R,
1195
+ sourceObserver: { error: w, duration: P, reset: R },
1196
+ dispose: h
830
1197
  };
831
1198
  }
832
- const fa = ["data-live-state"], ga = { class: "mp-dom-renderer mp-live-photo__motion" }, ma = ["preload"], pa = /* @__PURE__ */ Le({
1199
+ const An = ["data-live-state"], Vn = { class: "mp-dom-renderer mp-live-photo__motion" }, _n = ["preload"], Yn = /* @__PURE__ */ Te({
833
1200
  __name: "LivePhotoRenderer",
834
1201
  props: {
835
1202
  media: {},
@@ -840,139 +1207,140 @@ const fa = ["data-live-state"], ga = { class: "mp-dom-renderer mp-live-photo__mo
840
1207
  requestVersion: { default: 0 },
841
1208
  loadEnabled: { type: Boolean, default: !0 },
842
1209
  priority: { default: 0 },
843
- resourcePolicy: { default: () => We },
844
- resolveSource: { type: Function, default: Ne },
1210
+ resourcePolicy: { default: () => je },
1211
+ resolveSource: { type: Function, default: Ke },
845
1212
  rendering: { type: Boolean, default: !0 },
846
- initialImage: { default: () => ke },
1213
+ initialImage: { default: () => Re },
847
1214
  quality: { default: "screen" }
848
1215
  },
849
1216
  emits: ["ready", "error", "originalState", "liveState", "liveEnded"],
850
- setup(a, { expose: t, emit: e }) {
851
- const n = a, o = e, i = R(), s = R(), r = R(), f = Lt(
852
- () => i.value,
853
- (u) => o("error", u)
854
- ), { state: y } = f;
855
- Et(
856
- () => i.value,
857
- () => n.media,
858
- () => n.active && n.loadEnabled,
859
- () => lt,
860
- (u) => {
861
- y.status = "error", o("error", u);
862
- }
1217
+ setup(t, { expose: n, emit: o }) {
1218
+ const e = t, i = o, a = L(), l = L(), r = L(), u = L(), p = qt(
1219
+ () => a.value,
1220
+ (g) => i("error", g)
1221
+ ), { state: d } = p;
1222
+ Tt(
1223
+ () => a.value,
1224
+ () => e.media,
1225
+ () => e.active && e.loadEnabled,
1226
+ () => it,
1227
+ p.sourceObserver
863
1228
  );
864
- let m = !1, b = () => {
1229
+ let S = !1, C = () => {
865
1230
  };
866
- const B = U(
867
- () => n.active && n.enabled && y.playing && y.status === "ready" && !y.buffering
868
- ), L = U(() => ({
869
- transform: `translate(-50%, -50%) translate3d(${n.core.state.offsetX}px, ${n.core.state.offsetY}px, 0)`
870
- })), P = U(() => ({
871
- width: `${n.core.mediaSize.value.width * n.core.displayScale.value}px`,
872
- height: `${n.core.mediaSize.value.height * n.core.displayScale.value}px`,
873
- transform: `rotate(${n.core.state.rotation}deg)`
1231
+ const P = X(
1232
+ () => e.active && e.enabled && d.playing && d.status === "ready" && !d.buffering
1233
+ ), R = X(() => ({
1234
+ transform: `translate(-50%, -50%) translate3d(${e.core.state.offsetX}px, ${e.core.state.offsetY}px, 0)`
1235
+ })), x = X(() => ({
1236
+ width: `${e.core.mediaSize.value.width * e.core.displayScale.value}px`,
1237
+ height: `${e.core.mediaSize.value.height * e.core.displayScale.value}px`,
1238
+ transform: `rotate(${e.core.state.rotation}deg)`
874
1239
  }));
875
- function p() {
876
- f.pause(), i.value.readyState >= HTMLMediaElement.HAVE_METADATA && (i.value.currentTime = 0);
1240
+ function m() {
1241
+ p.pause(), a.value.readyState >= HTMLMediaElement.HAVE_METADATA && (a.value.currentTime = 0);
877
1242
  }
878
- function v() {
879
- !n.active || !n.enabled || !n.loadEnabled || !n.playing || y.status !== "ready" || y.buffering ? p() : f.play().then(() => {
880
- !m && !y.playing && n.playing && o("liveEnded");
1243
+ function F() {
1244
+ !e.active || !e.enabled || !e.loadEnabled || !e.playing || d.status !== "ready" || d.buffering ? m() : p.play().then(() => {
1245
+ !S && !d.playing && e.playing && i("liveEnded");
881
1246
  });
882
1247
  }
883
1248
  ee(
884
- () => [y.status, y.playing, y.buffering],
1249
+ () => [d.status, d.playing, d.buffering],
885
1250
  () => {
886
- const u = y.status === "error" ? "error" : y.buffering || y.status === "loading" ? "loading" : B.value ? "playing" : "idle";
887
- o("liveState", u);
1251
+ const g = d.status === "error" ? "error" : d.buffering || d.status === "loading" ? "loading" : P.value ? "playing" : "idle";
1252
+ i("liveState", g);
888
1253
  },
889
1254
  { immediate: !0 }
890
1255
  );
891
- function T() {
892
- m || (p(), o("liveEnded"));
1256
+ function q() {
1257
+ S || (m(), i("liveEnded"));
893
1258
  }
894
- function I() {
895
- document.hidden && (p(), o("liveEnded"));
1259
+ function v() {
1260
+ document.hidden && (m(), i("liveEnded"));
896
1261
  }
897
- ze(() => {
898
- b = ee(() => [n.active, n.enabled, n.loadEnabled, n.playing], v, {
1262
+ qe(() => {
1263
+ C = ee(() => [e.active, e.enabled, e.loadEnabled, e.playing], F, {
899
1264
  flush: "post"
900
- }), v(), document.addEventListener("visibilitychange", I);
901
- }), Re(() => {
902
- b(), m = !0, f.dispose(), document.removeEventListener("visibilitychange", I);
1265
+ }), F(), document.addEventListener("visibilitychange", v);
1266
+ }), $e(() => {
1267
+ C(), S = !0, p.dispose(), document.removeEventListener("visibilitychange", v);
903
1268
  });
904
- function w() {
905
- const u = document.createElement("canvas"), k = Math.min(
1269
+ function k() {
1270
+ const g = document.createElement("canvas"), w = Math.min(
906
1271
  1,
907
- Math.sqrt(ue.maxCanvasPixels / (n.media.width * n.media.height))
1272
+ Math.sqrt(ue.maxCanvasPixels / (e.media.width * e.media.height))
908
1273
  );
909
- u.width = Math.round(n.media.width * k), u.height = Math.round(n.media.height * k);
910
- const h = u.getContext("2d"), d = Number(getComputedStyle(r.value).opacity);
911
- h.drawImage(n.core.mediaRef.value, 0, 0, u.width, u.height), d < 1 && i.value.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && (h.globalAlpha = 1 - d, h.drawImage(i.value, 0, 0, u.width, u.height));
912
- const M = new DOMMatrixReadOnly(getComputedStyle(s.value).transform).a;
913
- return f.pause(), { image: u, scale: M };
914
- }
915
- return t({ captureFrame: w }), (u, k) => (z(), H("div", {
1274
+ g.width = Math.round(e.media.width * w), g.height = Math.round(e.media.height * w);
1275
+ const E = g.getContext("2d"), y = Number(getComputedStyle(r.value).opacity);
1276
+ E.drawImage(u.value.captureFrame().image, 0, 0, g.width, g.height), y < 1 && a.value.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && (E.globalAlpha = 1 - y, E.drawImage(a.value, 0, 0, g.width, g.height));
1277
+ const h = new DOMMatrixReadOnly(getComputedStyle(l.value).transform).a;
1278
+ return p.pause(), { image: g, scale: h };
1279
+ }
1280
+ return n({ captureFrame: k, retainFrame: () => ({ ...k(), release: () => {
1281
+ } }) }), (g, w) => (O(), A("div", {
916
1282
  class: "mp-live-photo-renderer",
917
- "data-live-state": g(y).status === "error" ? "error" : B.value ? "playing" : "idle"
1283
+ "data-live-state": f(d).status === "error" ? "error" : P.value ? "playing" : "idle"
918
1284
  }, [
919
- $("div", {
1285
+ B("div", {
920
1286
  ref_key: "effectsRef",
921
- ref: s,
922
- class: qe(["mp-live-photo__effects", { "is-playing": B.value }])
1287
+ ref: l,
1288
+ class: Ie(["mp-live-photo__effects", { "is-playing": P.value }])
923
1289
  }, [
924
- $("div", ga, [
925
- $("div", {
1290
+ B("div", Vn, [
1291
+ B("div", {
926
1292
  class: "mp-dom-renderer__frame",
927
- style: Se(L.value)
1293
+ style: Le(R.value)
928
1294
  }, [
929
- $("video", Ue({
1295
+ B("video", We({
930
1296
  ref_key: "videoRef",
931
- ref: i,
1297
+ ref: a,
932
1298
  class: "mp-dom-renderer__node",
933
- style: P.value,
934
- preload: u.active && u.enabled && u.loadEnabled ? "auto" : "none",
1299
+ style: x.value,
1300
+ preload: g.active && g.enabled && g.loadEnabled ? "auto" : "none",
935
1301
  playsinline: "",
936
1302
  "webkit-playsinline": "true",
937
1303
  crossorigin: "anonymous"
938
- }, pt(g(f).events, !0), {
939
- onEnded: T,
940
- onError: k[0] || (k[0] = (h) => o("liveEnded"))
941
- }), null, 16, ma)
1304
+ }, mt(f(p).events, !0), {
1305
+ onEnded: q,
1306
+ onError: w[0] || (w[0] = (E) => i("liveEnded"))
1307
+ }), null, 16, _n)
942
1308
  ], 4)
943
1309
  ]),
944
- $("div", {
1310
+ B("div", {
945
1311
  ref_key: "stillRef",
946
1312
  ref: r,
947
- class: qe(["mp-live-photo__still", { "is-playing": B.value }])
1313
+ class: Ie(["mp-live-photo__still", { "is-playing": P.value }])
948
1314
  }, [
949
- Be(vt, {
950
- "request-version": u.requestVersion,
951
- "load-enabled": u.loadEnabled,
952
- priority: u.priority,
953
- "resource-policy": u.resourcePolicy,
954
- "resolve-source": u.resolveSource,
955
- onOriginalState: k[1] || (k[1] = (h, d) => o("originalState", h, d)),
956
- media: u.media,
957
- "initial-image": u.initialImage,
958
- rendering: u.rendering,
959
- core: u.core,
960
- quality: u.quality,
961
- onReady: k[2] || (k[2] = (h) => o("ready", h)),
962
- onError: k[3] || (k[3] = (h) => o("error", h))
1315
+ De(pt, {
1316
+ ref_key: "imageRendererRef",
1317
+ ref: u,
1318
+ "request-version": g.requestVersion,
1319
+ "load-enabled": g.loadEnabled,
1320
+ priority: g.priority,
1321
+ "resource-policy": g.resourcePolicy,
1322
+ "resolve-source": g.resolveSource,
1323
+ onOriginalState: w[1] || (w[1] = (E, y) => i("originalState", E, y)),
1324
+ media: g.media,
1325
+ "initial-image": g.initialImage,
1326
+ rendering: g.rendering,
1327
+ core: g.core,
1328
+ quality: g.quality,
1329
+ onReady: w[2] || (w[2] = (E) => i("ready", E)),
1330
+ onError: w[3] || (w[3] = (E) => i("error", E))
963
1331
  }, null, 8, ["request-version", "load-enabled", "priority", "resource-policy", "resolve-source", "media", "initial-image", "rendering", "core", "quality"])
964
1332
  ], 2)
965
1333
  ], 2)
966
- ], 8, fa));
1334
+ ], 8, An));
967
1335
  }
968
1336
  });
969
- function va(a, t) {
970
- const e = document.createElement("canvas"), n = Math.min(1, Math.sqrt(ue.maxCanvasPixels / (t.width * t.height)));
971
- e.width = Math.max(1, Math.round(t.width * n)), e.height = Math.max(1, Math.round(t.height * n));
972
- const o = Math.min(e.width / a.videoWidth, e.height / a.videoHeight), i = a.videoWidth * o, s = a.videoHeight * o;
973
- return e.getContext("2d").drawImage(a, (e.width - i) / 2, (e.height - s) / 2, i, s), a.pause(), e;
1337
+ function Un(t, n) {
1338
+ const o = document.createElement("canvas"), e = Math.min(1, Math.sqrt(ue.maxCanvasPixels / (n.width * n.height)));
1339
+ o.width = Math.max(1, Math.round(n.width * e)), o.height = Math.max(1, Math.round(n.height * e));
1340
+ const i = Math.min(o.width / t.videoWidth, o.height / t.videoHeight), a = t.videoWidth * i, l = t.videoHeight * i;
1341
+ return o.getContext("2d").drawImage(t, (o.width - a) / 2, (o.height - l) / 2, a, l), t.pause(), o;
974
1342
  }
975
- const ha = {
1343
+ const Xn = {
976
1344
  class: "mp-video-icon--generic",
977
1345
  width: "22",
978
1346
  height: "22",
@@ -983,19 +1351,19 @@ const ha = {
983
1351
  "stroke-linecap": "round",
984
1352
  "stroke-linejoin": "round",
985
1353
  "aria-hidden": "true"
986
- }, ya = ["d", "fill"], wa = ["src"], ba = ["src"], it = /* @__PURE__ */ Le({
1354
+ }, Hn = ["d", "fill"], Wn = ["src"], Nn = ["src"], nt = /* @__PURE__ */ Te({
987
1355
  __name: "VideoIcon",
988
1356
  props: {
989
1357
  name: {}
990
1358
  },
991
- setup(a) {
992
- const t = a, e = {
1359
+ setup(t) {
1360
+ const n = t, o = {
993
1361
  play: ["mobile-play", "pc-play"],
994
1362
  replay: ["mobile-play", "pc-play"],
995
1363
  pause: ["mobile-pause", "pc-pause"],
996
1364
  fullscreen: ["mobile-fullscreen", "pc-fullscreen"],
997
1365
  exit: ["mobile-fullscreen", "pc-exit"]
998
- }, n = {
1366
+ }, e = {
999
1367
  "mobile-play": new URL("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='18px'%20height='18px'%20viewBox='0%200%2018%2018'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e三角形%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='2时间轴-查看视频'%20transform='translate(-18.000000,%20-687.000000)'%20fill='%23333333'%3e%3cg%20id='编组-5'%20transform='translate(0.000000,%20672.000000)'%3e%3cg%20id='编组-4'%20transform='translate(18.000000,%2012.913043)'%3e%3cpath%20d='M13.5185936,7.08213339%20L18.1443888,14.1750193%20C19.2003225,15.7941177%2018.7437874,17.9626598%2017.1246889,19.0185936%20C16.5559936,19.3894818%2015.8917011,19.5869565%2015.2127517,19.5869565%20L5.96116137,19.5869565%20C4.02816475,19.5869565%202.46116137,18.0199531%202.46116137,16.0869565%20C2.46116137,15.4080071%202.65863607,14.7437145%203.02952428,14.1750193%20L7.65531943,7.08213339%20C8.71125321,5.46303494%2010.8797953,5.00649976%2012.4988938,6.06243353%20C12.9058908,6.3278664%2013.2531607,6.67513633%2013.5185936,7.08213339%20Z'%20id='三角形'%20transform='translate(10.586957,%2011.086957)%20rotate(90.000000)%20translate(-10.586957,%20-11.086957)%20'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", import.meta.url).href,
1000
1368
  "mobile-pause": new URL("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='18px'%20height='18px'%20viewBox='0%200%2018%2018'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e暂停%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='2时间轴-观看视频'%20transform='translate(-17.000000,%20-687.000000)'%20fill='%23333333'%3e%3cg%20id='编组-5'%20transform='translate(0.000000,%20672.000000)'%3e%3cg%20id='编组-3'%20transform='translate(17.000000,%2012.913043)'%3e%3cg%20id='暂停-2'%20transform='translate(0.000000,%202.086957)'%3e%3cg%20id='暂停'%20transform='translate(3.000000,%201.500000)'%3e%3crect%20id='矩形'%20x='0'%20y='0'%20width='3.5'%20height='15'%20rx='1.75'%3e%3c/rect%3e%3crect%20id='矩形备份-7'%20x='9'%20y='0'%20width='3.5'%20height='15'%20rx='1.75'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", import.meta.url).href,
1001
1369
  "mobile-fullscreen": new URL("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e横竖屏备份%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='懒猫微服-图标库2.0'%20transform='translate(-449.000000,%20-196.000000)'%20stroke='%23333333'%20stroke-width='1.5'%3e%3cg%20id='横竖屏'%20transform='translate(449.000000,%20196.000000)'%3e%3crect%20id='矩形'%20x='3.75'%20y='9.75'%20width='16.5'%20height='10.5'%20rx='4'%3e%3c/rect%3e%3crect%20id='矩形'%20fill='%23FFFFFF'%20x='3.75'%20y='3.75'%20width='10.5'%20height='16.5'%20rx='4'%3e%3c/rect%3e%3cline%20x1='7.5'%20y1='7'%20x2='10.5'%20y2='7'%20id='路径-83'%20stroke-linecap='round'%3e%3c/line%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", import.meta.url).href,
@@ -1004,7 +1372,7 @@ const ha = {
1004
1372
  "pc-pause": new URL("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e暂停%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='2.11查看视频'%20transform='translate(-737.000000,%20-1017.000000)'%20fill='%23FFFFFF'%3e%3cg%20id='编组-7'%20transform='translate(68.000000,%200.000000)'%3e%3cg%20id='编组'%20transform='translate(646.000000,%20970.000000)'%3e%3cg%20id='暂停-2'%20transform='translate(23.000000,%2047.000000)'%3e%3cg%20id='暂停'%20transform='translate(1.000000,%200.000000)'%3e%3crect%20id='矩形'%20x='0'%20y='0'%20width='4'%20height='16'%20rx='2'%3e%3c/rect%3e%3crect%20id='矩形备份-4'%20x='10'%20y='0'%20width='4'%20height='16'%20rx='2'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", import.meta.url).href,
1005
1373
  "pc-fullscreen": new URL("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e形状%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='2.11查看视频'%20transform='translate(-1236.000000,%20-1017.000000)'%20fill='%23FFFFFF'%20fill-rule='nonzero'%3e%3cg%20id='编组-7'%20transform='translate(68.000000,%200.000000)'%3e%3cg%20id='编组'%20transform='translate(646.000000,%20970.000000)'%3e%3cg%20id='形状-2'%20transform='translate(522.000000,%2047.000000)'%3e%3cpath%20d='M2.64896326,8.31181102%20C3.0069116,8.31181102%203.29792652,8.60254391%203.29792652,8.96014537%20L3.297,11.774%20L6.30847581,8.766808%20C6.56165879,8.51387038%206.97344489,8.51387038%207.22662786,8.766808%20C7.47981084,9.01974561%207.47981084,9.43113265%207.22662786,9.68407026%20L4.204,12.701%20L7.04328847,12.7018776%20C7.40123681,12.7018776%207.69225716,12.9926105%207.69225716,13.350212%20C7.6937068,13.7092671%207.40269189,14%207.04328847,14%20L3.79410695,14%20C2.80465624,14%202,13.1961236%202,12.2076317%20L2,8.96014537%20C2,8.60254391%202.29101491,8.31181102%202.64896326,8.31181102%20Z%20M12.2058931,2%20C12.6893524,2%2013.1286932,2.19192028%2013.4516066,2.50352194%20C13.4593844,2.50982425%2013.4671226,2.51718474%2013.4747181,2.52477286%20L13.4959896,2.54786191%20C13.8078935,2.87046237%2014,3.30937746%2014,3.79236826%20L14,7.03985463%20C14,7.39745609%2013.7089851,7.68818898%2013.3510367,7.68818898%20C12.9930884,7.68818898%2012.7020735,7.39745609%2012.7020735,7.03985463%20L12.702,4.213%20L9.67842852,7.23464567%20C9.55183703,7.36111448%209.38450346,7.42507571%209.21862495,7.42507571%20C9.05274645,7.42507571%208.88686795,7.36111448%208.76027646,7.23464567%20C8.50709349,6.98170806%208.50709349,6.57032102%208.76027646,6.3173834%20L11.783,3.296%20L8.95525646,3.29666869%20C8.59730811,3.29666869%208.3062932,3.0059358%208.3062932,2.64833434%20C8.3062932,2.29073289%208.59730811,2%208.95525646,2%20L12.2058931,2%20Z'%20id='全屏'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", import.meta.url).href,
1006
1374
  "pc-exit": new URL("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e形状备份%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='2.11查看视频'%20transform='translate(-1275.000000,%20-1007.000000)'%20fill='%23FFFFFF'%20fill-rule='nonzero'%3e%3cg%20id='编组-7'%20transform='translate(68.000000,%200.000000)'%3e%3cg%20id='编组备份'%20transform='translate(601.000000,%20987.000000)'%3e%3cg%20id='形状-2'%20transform='translate(606.000000,%2020.000000)'%3e%3cpath%20d='M5.89959985,8.31181102%20C6.88905056,8.31181102%207.6937068,9.11568746%207.6937068,10.1041793%20L7.6937068,13.3516657%20C7.6937068,13.7092671%207.40269189,14%207.04474354,14%20C6.6867952,14%206.39578028,13.7092671%206.39578028,13.3516657%20L6.395,10.514%20L3.43761368,13.4679588%20C3.31102219,13.5958813%203.14514369,13.6583889%202.97926519,13.6583889%20C2.81338669,13.6583889%202.64750818,13.5944276%202.5209167,13.4679588%20C2.26773372,13.2150212%202.26773372,12.8036342%202.5209167,12.5506965%20L5.465,9.608%20L2.64896326,9.60847971%20C2.29101491,9.60847971%202,9.31774682%202,8.96014537%20C2,8.60254391%202.29101491,8.31181102%202.64896326,8.31181102%20L5.89959985,8.31181102%20Z%20M8.9567061,2%20C9.31465444,2%209.60566936,2.29073289%209.60566936,2.64833434%20L9.605,5.473%20L12.556566,2.52477286%20C12.809749,2.27183525%2013.2215351,2.27183525%2013.4747181,2.52477286%20C13.7279011,2.77771048%2013.7279011,3.18909752%2013.4747181,3.44203513%20L10.523,6.39%20L13.3510313,6.39006663%20C13.7089797,6.39006663%2014,6.68079952%2014,7.03840097%20C14.0014496,7.39745609%2013.7104347,7.68818898%2013.3510313,7.68818898%20L10.1018498,7.68818898%20C9.11239908,7.68818898%208.30774284,6.88431254%208.30774284,5.89582071%20L8.30774284,2.64833434%20C8.30774284,2.29073289%208.59875775,2%208.9567061,2%20Z'%20id='全屏'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", import.meta.url).href
1007
- }, o = {
1375
+ }, i = {
1008
1376
  play: ["m9 5 11 7-11 7Z"],
1009
1377
  pause: ["M8 5v14M16 5v14"],
1010
1378
  replay: ["M4 10a8 8 0 1 1 1 7", "M4 4v6h6"],
@@ -1013,38 +1381,38 @@ const ha = {
1013
1381
  volume: ["m11 4-6 5H2v6h3l6 5Z", "M15 8a6 6 0 0 1 0 8M18 5a10 10 0 0 1 0 14"],
1014
1382
  muted: ["m11 4-6 5H2v6h3l6 5Z", "m16 9 6 6m0-6-6 6"]
1015
1383
  };
1016
- return (i, s) => (z(), H("span", {
1017
- class: qe(["mp-video-icon", { "has-album-icon": t.name in e }])
1384
+ return (a, l) => (O(), A("span", {
1385
+ class: Ie(["mp-video-icon", { "has-album-icon": n.name in o }])
1018
1386
  }, [
1019
- (z(), H("svg", ha, [
1020
- (z(!0), H(De, null, ot(o[i.name], (r, f) => (z(), H("path", {
1021
- key: f,
1387
+ (O(), A("svg", Xn, [
1388
+ (O(!0), A(Fe, null, Ne(i[a.name], (r, u) => (O(), A("path", {
1389
+ key: u,
1022
1390
  d: r,
1023
- fill: i.name === "play" ? "currentColor" : "none"
1024
- }, null, 8, ya))), 128))
1391
+ fill: a.name === "play" ? "currentColor" : "none"
1392
+ }, null, 8, Hn))), 128))
1025
1393
  ])),
1026
- i.name in e ? (z(), H(De, { key: 0 }, [
1027
- $("img", {
1394
+ a.name in o ? (O(), A(Fe, { key: 0 }, [
1395
+ B("img", {
1028
1396
  class: "mp-video-icon--mobile",
1029
- src: n[e[i.name][0]],
1397
+ src: e[o[a.name][0]],
1030
1398
  alt: "",
1031
1399
  "aria-hidden": "true",
1032
1400
  draggable: "false"
1033
- }, null, 8, wa),
1034
- $("img", {
1401
+ }, null, 8, Wn),
1402
+ B("img", {
1035
1403
  class: "mp-video-icon--desktop",
1036
- src: n[e[i.name][1]],
1404
+ src: e[o[a.name][1]],
1037
1405
  alt: "",
1038
1406
  "aria-hidden": "true",
1039
1407
  draggable: "false"
1040
- }, null, 8, ba)
1041
- ], 64)) : ie("", !0)
1408
+ }, null, 8, Nn)
1409
+ ], 64)) : le("", !0)
1042
1410
  ], 2));
1043
1411
  }
1044
- }), ka = {
1412
+ }), Zn = {
1045
1413
  key: 0,
1046
1414
  class: "mp-video-seek-preview"
1047
- }, xa = ["aria-label", "disabled"], Ma = { class: "mp-video-time" }, Sa = ["tabindex", "aria-disabled", "aria-valuemax", "aria-valuenow", "aria-valuetext"], Pa = /* @__PURE__ */ $("span", { class: "mp-video-progress__rail" }, null, -1), Ca = { class: "mp-video-time" }, Ea = ["aria-label", "aria-pressed"], Ra = ["aria-label", "disabled"], La = /* @__PURE__ */ Le({
1415
+ }, jn = ["aria-label", "disabled"], Kn = { class: "mp-video-time" }, Gn = ["tabindex", "aria-disabled", "aria-valuemax", "aria-valuenow", "aria-valuetext"], Qn = /* @__PURE__ */ B("span", { class: "mp-video-progress__rail" }, null, -1), Jn = { class: "mp-video-time" }, ea = ["aria-label", "aria-pressed"], ta = ["aria-label", "disabled"], na = /* @__PURE__ */ Te({
1048
1416
  __name: "VideoControls",
1049
1417
  props: {
1050
1418
  playback: {},
@@ -1052,145 +1420,146 @@ const ha = {
1052
1420
  canFullscreen: { type: Boolean }
1053
1421
  },
1054
1422
  emits: ["fullscreen"],
1055
- setup(a, { emit: t }) {
1056
- const e = a, n = t, o = R(), { state: i, seekable: s, displayTime: r, progress: f, bufferedProgress: y } = e.playback;
1057
- function m(p) {
1058
- const v = o.value.getBoundingClientRect();
1059
- e.playback.scrub((p.clientX - v.left) / Math.max(1, v.width) * i.duration);
1423
+ setup(t, { emit: n }) {
1424
+ const o = t, e = n, i = L(), { state: a, seekable: l, displayTime: r, progress: u, bufferedRanges: p } = o.playback;
1425
+ function d(x) {
1426
+ const m = i.value.getBoundingClientRect();
1427
+ o.playback.scrub((x.clientX - m.left) / Math.max(1, m.width) * a.duration);
1060
1428
  }
1061
- function b(p) {
1062
- !s.value || p.pointerType === "mouse" && p.button !== 0 || (o.value.setPointerCapture(p.pointerId), e.playback.beginScrub(), m(p));
1429
+ function S(x) {
1430
+ !l.value || x.pointerType === "mouse" && x.button !== 0 || (i.value.setPointerCapture(x.pointerId), o.playback.beginScrub(), d(x));
1063
1431
  }
1064
- function B(p) {
1065
- i.scrubbing && m(p);
1432
+ function C(x) {
1433
+ a.scrubbing && d(x);
1066
1434
  }
1067
- function L(p) {
1068
- i.scrubbing && (m(p), e.playback.endScrub());
1435
+ function P(x) {
1436
+ a.scrubbing && (d(x), o.playback.endScrub());
1069
1437
  }
1070
- function P(p) {
1071
- e.playback.beginScrub(), e.playback.scrub(r.value + p), e.playback.endScrub();
1438
+ function R(x) {
1439
+ o.playback.beginScrub(), o.playback.scrub(r.value + x), o.playback.endScrub();
1072
1440
  }
1073
- return (p, v) => (z(), H("div", {
1441
+ return (x, m) => (O(), A("div", {
1074
1442
  class: "mp-video-controls",
1075
1443
  "data-preview-control": "",
1076
- onPointerdown: v[9] || (v[9] = J(() => {
1444
+ onPointerdown: m[9] || (m[9] = ae(() => {
1077
1445
  }, ["stop"])),
1078
- onPointermove: v[10] || (v[10] = J(() => {
1446
+ onPointermove: m[10] || (m[10] = ae(() => {
1079
1447
  }, ["stop"])),
1080
- onPointerup: v[11] || (v[11] = J(() => {
1448
+ onPointerup: m[11] || (m[11] = ae(() => {
1081
1449
  }, ["stop"])),
1082
- onPointercancel: v[12] || (v[12] = J(() => {
1450
+ onPointercancel: m[12] || (m[12] = ae(() => {
1083
1451
  }, ["stop"])),
1084
- onClick: v[13] || (v[13] = J(() => {
1452
+ onClick: m[13] || (m[13] = ae(() => {
1085
1453
  }, ["stop"])),
1086
- onDblclick: v[14] || (v[14] = J(() => {
1454
+ onDblclick: m[14] || (m[14] = ae(() => {
1087
1455
  }, ["stop"])),
1088
- onKeydown: v[15] || (v[15] = J(() => {
1456
+ onKeydown: m[15] || (m[15] = ae(() => {
1089
1457
  }, ["stop"]))
1090
1458
  }, [
1091
- g(i).scrubbing ? (z(), H("div", ka, [
1092
- It(le(g(Ie)(g(r))), 1),
1093
- $("span", null, " / " + le(g(Ie)(g(i).duration)), 1)
1094
- ])) : ie("", !0),
1095
- $("button", {
1459
+ f(a).scrubbing ? (O(), A("div", Zn, [
1460
+ Kt(fe(f(Ve)(f(r))), 1),
1461
+ B("span", null, " / " + fe(f(Ve)(f(a).duration)), 1)
1462
+ ])) : le("", !0),
1463
+ B("button", {
1096
1464
  type: "button",
1097
- "aria-label": g(i).ended ? "重新播放视频" : g(i).playing ? "暂停视频" : "播放视频",
1098
- disabled: g(i).status === "error",
1099
- onClick: v[0] || (v[0] = //@ts-ignore
1100
- (...T) => p.playback.toggle && p.playback.toggle(...T))
1465
+ "aria-label": f(a).ended ? "重新播放视频" : f(a).playing ? "暂停视频" : "播放视频",
1466
+ disabled: f(a).status === "error",
1467
+ onClick: m[0] || (m[0] = //@ts-ignore
1468
+ (...F) => x.playback.toggle && x.playback.toggle(...F))
1101
1469
  }, [
1102
- Be(it, {
1103
- name: g(i).ended ? "replay" : g(i).playing ? "pause" : "play"
1470
+ De(nt, {
1471
+ name: f(a).ended ? "replay" : f(a).playing ? "pause" : "play"
1104
1472
  }, null, 8, ["name"])
1105
- ], 8, xa),
1106
- $("time", Ma, le(g(Ie)(g(r))), 1),
1107
- $("div", {
1473
+ ], 8, jn),
1474
+ B("time", Kn, fe(f(Ve)(f(r))), 1),
1475
+ B("div", {
1108
1476
  ref_key: "track",
1109
- ref: o,
1110
- class: qe(["mp-video-progress", { "is-scrubbing": g(i).scrubbing }]),
1477
+ ref: i,
1478
+ class: Ie(["mp-video-progress", { "is-scrubbing": f(a).scrubbing }]),
1111
1479
  role: "slider",
1112
1480
  "aria-label": "视频进度",
1113
- tabindex: g(s) ? 0 : -1,
1114
- "aria-disabled": !g(s),
1481
+ tabindex: f(l) ? 0 : -1,
1482
+ "aria-disabled": !f(l),
1115
1483
  "aria-valuemin": "0",
1116
- "aria-valuemax": g(i).duration,
1117
- "aria-valuenow": g(r),
1118
- "aria-valuetext": `${g(Ie)(g(r))} / ${g(Ie)(g(i).duration)}`,
1119
- onPointerdown: J(b, ["prevent"]),
1120
- onPointermove: J(B, ["prevent"]),
1121
- onPointerup: J(L, ["prevent"]),
1122
- onPointercancel: v[1] || (v[1] = (T) => p.playback.endScrub(!1)),
1123
- onLostpointercapture: v[2] || (v[2] = (T) => p.playback.endScrub(!1)),
1484
+ "aria-valuemax": f(a).duration,
1485
+ "aria-valuenow": f(r),
1486
+ "aria-valuetext": `${f(Ve)(f(r))} / ${f(Ve)(f(a).duration)}`,
1487
+ onPointerdown: ae(S, ["prevent"]),
1488
+ onPointermove: ae(C, ["prevent"]),
1489
+ onPointerup: ae(P, ["prevent"]),
1490
+ onPointercancel: m[1] || (m[1] = (F) => x.playback.endScrub(!1)),
1491
+ onLostpointercapture: m[2] || (m[2] = (F) => x.playback.endScrub(!1)),
1124
1492
  onKeydown: [
1125
- v[3] || (v[3] = at(J((T) => P(-5), ["prevent"]), ["left"])),
1126
- v[4] || (v[4] = at(J((T) => P(5), ["prevent"]), ["right"])),
1127
- v[5] || (v[5] = at(J((T) => P(-g(i).duration), ["prevent"]), ["home"])),
1128
- v[6] || (v[6] = at(J((T) => P(g(i).duration), ["prevent"]), ["end"]))
1493
+ m[3] || (m[3] = tt(ae((F) => R(-5), ["prevent"]), ["left"])),
1494
+ m[4] || (m[4] = tt(ae((F) => R(5), ["prevent"]), ["right"])),
1495
+ m[5] || (m[5] = tt(ae((F) => R(-f(a).duration), ["prevent"]), ["home"])),
1496
+ m[6] || (m[6] = tt(ae((F) => R(f(a).duration), ["prevent"]), ["end"]))
1129
1497
  ]
1130
1498
  }, [
1131
- Pa,
1132
- $("span", {
1499
+ Qn,
1500
+ (O(!0), A(Fe, null, Ne(f(p), (F, q) => (O(), A("span", {
1501
+ key: q,
1133
1502
  class: "mp-video-progress__buffered",
1134
- style: Se({ width: `${g(y)}%` })
1135
- }, null, 4),
1136
- $("span", {
1503
+ style: Le({ left: `${F.left}%`, width: `${F.width}%` })
1504
+ }, null, 4))), 128)),
1505
+ B("span", {
1137
1506
  class: "mp-video-progress__played",
1138
- style: Se({ width: `${g(f)}%` })
1507
+ style: Le({ width: `${f(u)}%` })
1139
1508
  }, null, 4),
1140
- $("span", {
1509
+ B("span", {
1141
1510
  class: "mp-video-progress__thumb",
1142
- style: Se({ left: `${g(f)}%` })
1511
+ style: Le({ left: `${f(u)}%` })
1143
1512
  }, null, 4)
1144
- ], 42, Sa),
1145
- $("time", Ca, le(g(Ie)(g(i).duration)), 1),
1146
- $("button", {
1513
+ ], 42, Gn),
1514
+ B("time", Jn, fe(f(Ve)(f(a).duration)), 1),
1515
+ B("button", {
1147
1516
  type: "button",
1148
1517
  class: "mp-video-volume",
1149
- "aria-label": g(i).muted ? "开启声音" : "静音视频",
1150
- "aria-pressed": g(i).muted,
1151
- onClick: v[7] || (v[7] = //@ts-ignore
1152
- (...T) => p.playback.toggleMuted && p.playback.toggleMuted(...T))
1518
+ "aria-label": f(a).muted ? "开启声音" : "静音视频",
1519
+ "aria-pressed": f(a).muted,
1520
+ onClick: m[7] || (m[7] = //@ts-ignore
1521
+ (...F) => x.playback.toggleMuted && x.playback.toggleMuted(...F))
1153
1522
  }, [
1154
- Be(it, {
1155
- name: g(i).muted ? "muted" : "volume"
1523
+ De(nt, {
1524
+ name: f(a).muted ? "muted" : "volume"
1156
1525
  }, null, 8, ["name"])
1157
- ], 8, Ea),
1158
- $("button", {
1526
+ ], 8, ea),
1527
+ B("button", {
1159
1528
  type: "button",
1160
- "aria-label": p.fullscreen ? "退出视频全屏" : "视频全屏",
1161
- disabled: !p.canFullscreen,
1162
- onClick: v[8] || (v[8] = (T) => n("fullscreen"))
1529
+ "aria-label": x.fullscreen ? "退出视频全屏" : "视频全屏",
1530
+ disabled: !x.canFullscreen,
1531
+ onClick: m[8] || (m[8] = (F) => e("fullscreen"))
1163
1532
  }, [
1164
- Be(it, {
1165
- name: p.fullscreen ? "exit" : "fullscreen"
1533
+ De(nt, {
1534
+ name: x.fullscreen ? "exit" : "fullscreen"
1166
1535
  }, null, 8, ["name"])
1167
- ], 8, Ra)
1536
+ ], 8, ta)
1168
1537
  ], 32));
1169
1538
  }
1170
- }), $a = ["data-playback"], Fa = ["muted", "loop", "preload"], Ta = {
1539
+ }), aa = ["data-playback"], ia = ["muted", "loop", "preload"], oa = {
1171
1540
  key: 1,
1172
1541
  class: "mp-video-loading",
1173
1542
  role: "status",
1174
1543
  "aria-label": "视频缓冲中"
1175
- }, Ba = /* @__PURE__ */ $("span", { class: "mp-spinner" }, null, -1), Da = [
1176
- Ba
1177
- ], qa = ["aria-label"], za = {
1544
+ }, ra = /* @__PURE__ */ B("span", { class: "mp-spinner" }, null, -1), la = [
1545
+ ra
1546
+ ], sa = ["aria-label"], ua = {
1178
1547
  key: 3,
1179
- class: "mp-resource-state",
1548
+ class: "mp-video-error",
1180
1549
  role: "alert"
1181
- }, Ia = /* @__PURE__ */ $("span", null, "视频暂时无法播放", -1), Aa = ["inert"], Oa = /* @__PURE__ */ Le({
1550
+ }, ca = ["inert"], da = /* @__PURE__ */ Te({
1182
1551
  inheritAttrs: !1,
1183
1552
  __name: "VideoDomRenderer",
1184
1553
  props: {
1185
- initialImage: { default: () => ke },
1554
+ initialImage: { default: () => Re },
1186
1555
  rendering: { type: Boolean, default: !0 },
1187
1556
  quality: { default: "screen" },
1188
1557
  requestVersion: { default: 0 },
1189
1558
  priority: { default: 0 },
1190
- resourcePolicy: { default: () => We },
1191
- resolveSource: { type: Function, default: Ne },
1559
+ resourcePolicy: { default: () => je },
1560
+ resolveSource: { type: Function, default: Ke },
1192
1561
  media: {},
1193
- videoLoader: { type: Function, default: lt },
1562
+ videoLoader: { type: Function, default: it },
1194
1563
  core: {},
1195
1564
  active: { type: Boolean, default: !0 },
1196
1565
  enabled: { type: Boolean, default: !0 },
@@ -1204,169 +1573,167 @@ const ha = {
1204
1573
  controlsTarget: { default: "body" }
1205
1574
  },
1206
1575
  emits: ["originalState", "ready", "error"],
1207
- setup(a, { expose: t, emit: e }) {
1208
- const n = a, o = e, i = R(!1), s = U(() => ({
1209
- ...n.media,
1576
+ setup(t, { expose: n, emit: o }) {
1577
+ const e = t, i = o, a = L(!1), l = X(() => ({
1578
+ ...e.media,
1210
1579
  type: "image",
1211
- src: n.media.poster || n.media.previewSrc || n.media.thumbnail
1212
- })), r = R(), f = R(), y = R(!1), m = R(!1), b = Lt(
1580
+ src: e.media.poster || e.media.previewSrc || e.media.thumbnail
1581
+ })), r = L(), u = L(), p = L(!1), d = L(!1), S = qt(
1213
1582
  () => r.value,
1214
- (E) => o("error", E)
1215
- ), B = Et(
1583
+ (y) => i("error", y)
1584
+ );
1585
+ Tt(
1216
1586
  () => r.value,
1217
- () => n.media,
1218
- () => n.active && n.loadEnabled,
1219
- () => n.videoLoader,
1220
- (E) => {
1221
- b.state.status = "error", b.state.buffering = !1, o("error", E);
1222
- }
1587
+ () => e.media,
1588
+ () => e.active && e.loadEnabled,
1589
+ () => e.videoLoader,
1590
+ S.sourceObserver
1223
1591
  );
1224
- function L() {
1225
- b.state.status = "loading", b.state.buffering = !0, B();
1226
- }
1227
- let P = () => {
1592
+ let C = () => {
1228
1593
  };
1229
- const { state: p } = b, v = U(
1230
- () => n.controls && n.active && n.enabled && n.controlsVisible
1594
+ const { state: P } = S, R = X(
1595
+ () => e.controls && e.active && e.enabled && e.controlsVisible
1231
1596
  );
1232
- function T() {
1233
- return n.teleportControls ? f.value.closest(".mp-viewer") : n.core.containerRef.value;
1597
+ function x() {
1598
+ return e.teleportControls ? u.value.closest(".mp-viewer") : e.core.containerRef.value;
1234
1599
  }
1235
- async function I() {
1236
- if (m.value)
1600
+ async function m() {
1601
+ if (d.value)
1237
1602
  try {
1238
- document.fullscreenElement === T() ? await document.exitFullscreen() : document.fullscreenEnabled ? await T().requestFullscreen() : r.value.webkitEnterFullscreen();
1239
- } catch (E) {
1240
- o("error", Ae(E));
1603
+ document.fullscreenElement === x() ? await document.exitFullscreen() : document.fullscreenEnabled ? await x().requestFullscreen() : r.value.webkitEnterFullscreen();
1604
+ } catch (y) {
1605
+ i("error", _e(y));
1241
1606
  }
1242
1607
  }
1243
- function w() {
1244
- y.value = document.fullscreenElement === T();
1608
+ function F() {
1609
+ p.value = document.fullscreenElement === x();
1245
1610
  }
1246
- function u() {
1247
- !n.active || !n.enabled ? b.pause() : n.autoplay && b.play();
1611
+ function q() {
1612
+ !e.active || !e.enabled ? S.pause() : e.autoplay && S.play();
1248
1613
  }
1249
- function k() {
1250
- document.hidden && b.pause();
1614
+ function v() {
1615
+ document.hidden && S.pause();
1251
1616
  }
1252
- ze(() => {
1253
- p.muted = r.value.muted, m.value = document.fullscreenEnabled || "webkitEnterFullscreen" in r.value, document.addEventListener("fullscreenchange", w), document.addEventListener("visibilitychange", k), P = ee(() => [n.active, n.enabled, n.autoplay], u, {
1617
+ qe(() => {
1618
+ P.muted = r.value.muted, d.value = document.fullscreenEnabled || "webkitEnterFullscreen" in r.value, document.addEventListener("fullscreenchange", F), document.addEventListener("visibilitychange", v), C = ee(() => [e.active, e.enabled, e.autoplay], q, {
1254
1619
  flush: "post"
1255
- }), u();
1256
- }), Re(() => {
1257
- P(), b.dispose(), document.removeEventListener("fullscreenchange", w), document.removeEventListener("visibilitychange", k), document.fullscreenElement === T() && document.exitFullscreen().catch(() => {
1620
+ }), q();
1621
+ }), $e(() => {
1622
+ C(), S.dispose(), document.removeEventListener("fullscreenchange", F), document.removeEventListener("visibilitychange", v), document.fullscreenElement === x() && document.exitFullscreen().catch(() => {
1258
1623
  });
1259
1624
  });
1260
- const h = U(() => ({
1261
- transform: `translate(-50%, -50%) translate3d(${n.core.state.offsetX}px, ${n.core.state.offsetY}px, 0)`
1262
- })), d = U(() => ({
1263
- width: `${n.core.mediaSize.value.width * n.core.displayScale.value}px`,
1264
- height: `${n.core.mediaSize.value.height * n.core.displayScale.value}px`,
1265
- transform: `rotate(${n.core.state.rotation}deg)`
1625
+ const k = X(() => ({
1626
+ transform: `translate(-50%, -50%) translate3d(${e.core.state.offsetX}px, ${e.core.state.offsetY}px, 0)`
1627
+ })), g = X(() => ({
1628
+ width: `${e.core.mediaSize.value.width * e.core.displayScale.value}px`,
1629
+ height: `${e.core.mediaSize.value.height * e.core.displayScale.value}px`,
1630
+ transform: `rotate(${e.core.state.rotation}deg)`
1266
1631
  }));
1267
- function M() {
1268
- i.value = !0, n.core.setMediaElement(r.value), o("ready", "screen");
1269
- }
1270
- function C() {
1271
- return { image: i.value ? va(r.value, n.core.mediaSize.value) : n.core.mediaRef.value, scale: 1 };
1272
- }
1273
- return t({ togglePlayback: b.toggle, toggleFullscreen: I, playback: b, captureFrame: C }), (E, A) => (z(), H("div", {
1632
+ function w() {
1633
+ a.value = !0, e.core.setMediaElement(r.value), i("ready", "screen");
1634
+ }
1635
+ function E() {
1636
+ return { image: a.value ? Un(r.value, e.core.mediaSize.value) : e.core.mediaRef.value, scale: 1 };
1637
+ }
1638
+ return n({
1639
+ togglePlayback: S.toggle,
1640
+ toggleFullscreen: m,
1641
+ playback: S,
1642
+ captureFrame: E,
1643
+ retainFrame: () => ({ ...E(), release: () => {
1644
+ } })
1645
+ }), (y, h) => (O(), A("div", {
1274
1646
  ref_key: "host",
1275
- ref: f,
1647
+ ref: u,
1276
1648
  class: "mp-dom-renderer mp-video-player",
1277
- "data-playback": g(p).ended ? "ended" : g(p).playing ? "playing" : "paused"
1649
+ "data-playback": f(P).ended ? "ended" : f(P).playing ? "playing" : "paused"
1278
1650
  }, [
1279
- i.value ? ie("", !0) : (z(), rt(vt, {
1651
+ a.value ? le("", !0) : (O(), at(pt, {
1280
1652
  key: 0,
1281
- media: s.value,
1282
- core: E.core,
1283
- "initial-image": E.initialImage,
1284
- rendering: E.rendering,
1285
- quality: E.quality,
1286
- "request-version": E.requestVersion,
1287
- "load-enabled": E.loadEnabled,
1288
- priority: E.priority,
1289
- "resource-policy": E.resourcePolicy,
1290
- "resolve-source": E.resolveSource,
1291
- onReady: A[0] || (A[0] = (V) => o("ready", V)),
1292
- onError: A[1] || (A[1] = (V) => o("error", V)),
1293
- onOriginalState: A[2] || (A[2] = (V, _) => o("originalState", V, _))
1653
+ media: l.value,
1654
+ "original-enabled": !1,
1655
+ core: y.core,
1656
+ "initial-image": y.initialImage,
1657
+ rendering: y.rendering,
1658
+ quality: y.quality,
1659
+ "request-version": y.requestVersion,
1660
+ "load-enabled": y.loadEnabled,
1661
+ priority: y.priority,
1662
+ "resource-policy": y.resourcePolicy,
1663
+ "resolve-source": y.resolveSource,
1664
+ onReady: h[0] || (h[0] = ($) => i("ready", $)),
1665
+ onError: h[1] || (h[1] = ($) => i("error", $)),
1666
+ onOriginalState: h[2] || (h[2] = ($, D) => i("originalState", $, D))
1294
1667
  }, null, 8, ["media", "core", "initial-image", "rendering", "quality", "request-version", "load-enabled", "priority", "resource-policy", "resolve-source"])),
1295
- $("div", {
1668
+ B("div", {
1296
1669
  class: "mp-dom-renderer__frame",
1297
- style: Se([h.value, { visibility: i.value ? "inherit" : "hidden" }])
1670
+ style: Le([k.value, { visibility: a.value ? "inherit" : "hidden" }])
1298
1671
  }, [
1299
- $("video", Ue({
1672
+ B("video", We({
1300
1673
  ref_key: "videoRef",
1301
1674
  ref: r,
1302
1675
  class: "mp-dom-renderer__node",
1303
- muted: E.muted,
1304
- loop: E.loop,
1676
+ muted: y.muted,
1677
+ loop: y.loop,
1305
1678
  playsinline: "",
1306
1679
  "webkit-playsinline": "true",
1307
1680
  crossorigin: "anonymous",
1308
- preload: E.active && E.loadEnabled ? "auto" : "none",
1309
- style: d.value
1310
- }, pt(g(b).events, !0), { onPlaying: M }), null, 16, Fa)
1681
+ preload: y.active && y.loadEnabled ? "auto" : "none",
1682
+ style: g.value
1683
+ }, mt(f(S).events, !0), { onPlaying: w }), null, 16, ia)
1311
1684
  ], 4),
1312
- E.active && E.enabled && g(p).buffering && g(p).status !== "error" ? (z(), H("div", Ta, Da)) : ie("", !0),
1313
- v.value && !g(p).playing && !g(p).buffering && g(p).status !== "error" ? (z(), H("button", {
1685
+ y.active && y.enabled && f(P).buffering && f(P).status !== "error" ? (O(), A("div", oa, la)) : le("", !0),
1686
+ R.value && !f(P).playing && !f(P).buffering && f(P).status !== "error" ? (O(), A("button", {
1314
1687
  key: 2,
1315
1688
  type: "button",
1316
1689
  class: "mp-video-center-play",
1317
1690
  "data-preview-control": "",
1318
- "aria-label": g(p).ended ? "重新播放" : "开始播放视频",
1319
- onPointerdown: A[3] || (A[3] = J(() => {
1691
+ "aria-label": f(P).ended ? "重新播放" : "开始播放视频",
1692
+ onPointerdown: h[3] || (h[3] = ae(() => {
1320
1693
  }, ["stop"])),
1321
- onPointerup: A[4] || (A[4] = J(() => {
1694
+ onPointerup: h[4] || (h[4] = ae(() => {
1322
1695
  }, ["stop"])),
1323
- onClick: A[5] || (A[5] = J(
1696
+ onClick: h[5] || (h[5] = ae(
1324
1697
  //@ts-ignore
1325
- (...V) => g(b).toggle && g(b).toggle(...V),
1698
+ (...$) => f(S).toggle && f(S).toggle(...$),
1326
1699
  ["stop"]
1327
1700
  ))
1328
1701
  }, [
1329
- Be(it, {
1330
- name: g(p).ended ? "replay" : "play"
1702
+ De(nt, {
1703
+ name: f(P).ended ? "replay" : "play"
1331
1704
  }, null, 8, ["name"])
1332
- ], 40, qa)) : ie("", !0),
1333
- g(p).status === "error" ? (z(), H("div", za, [
1334
- Ia,
1335
- $("button", {
1336
- type: "button",
1337
- onClick: J(L, ["stop"])
1338
- }, "重新加载视频")
1339
- ])) : ie("", !0),
1340
- E.controls && E.active && E.enabled ? (z(), rt(Ct, {
1705
+ ], 40, sa)) : le("", !0),
1706
+ f(P).status === "error" ? (O(), A("div", ua, "视频暂时无法播放")) : le("", !0),
1707
+ y.controls && y.active && y.enabled ? (O(), at(Ct, {
1341
1708
  key: 4,
1342
- to: E.controlsTarget,
1343
- disabled: !E.teleportControls
1709
+ to: y.controlsTarget,
1710
+ disabled: !y.teleportControls
1344
1711
  }, [
1345
- $("div", {
1346
- class: qe(["mp-video-control-layer", { "is-hidden": !v.value }]),
1347
- inert: !v.value
1712
+ B("div", {
1713
+ class: Ie(["mp-video-control-layer", { "is-hidden": !R.value }]),
1714
+ inert: !R.value
1348
1715
  }, [
1349
- Be(La, {
1350
- playback: g(b),
1351
- fullscreen: y.value,
1352
- "can-fullscreen": m.value,
1353
- onFullscreen: I
1716
+ De(na, {
1717
+ playback: f(S),
1718
+ fullscreen: p.value,
1719
+ "can-fullscreen": d.value,
1720
+ onFullscreen: m
1354
1721
  }, null, 8, ["playback", "fullscreen", "can-fullscreen"])
1355
- ], 10, Aa)
1356
- ], 8, ["to", "disabled"])) : ie("", !0)
1357
- ], 8, $a));
1722
+ ], 10, ca)
1723
+ ], 8, ["to", "disabled"])) : le("", !0)
1724
+ ], 8, aa));
1358
1725
  }
1359
- }), _a = ["data-scale", "data-rotation", "data-live-holding"], Va = /* @__PURE__ */ Le({
1726
+ }), fa = ["data-scale", "data-rotation", "data-live-holding"], ga = /* @__PURE__ */ Te({
1360
1727
  __name: "PreviewStage",
1361
1728
  props: {
1362
1729
  media: {},
1363
- videoLoader: { type: Function, default: lt },
1730
+ videoLoader: { type: Function, default: it },
1364
1731
  livePlaying: { type: Boolean, default: !1 },
1365
1732
  active: { type: Boolean, default: !0 },
1366
1733
  requestVersion: { default: 0 },
1367
1734
  loadEnabled: { type: Boolean, default: !0 },
1368
- resourcePolicy: { default: () => We },
1369
- resolveSource: { type: Function, default: Ne },
1735
+ resourcePolicy: { default: () => je },
1736
+ resolveSource: { type: Function, default: Ke },
1370
1737
  inactiveResetDuration: { default: 0 },
1371
1738
  disabled: { type: Boolean, default: !1 },
1372
1739
  externalGestures: { type: Boolean, default: !1 },
@@ -1375,84 +1742,83 @@ const ha = {
1375
1742
  controlsTarget: { default: "body" },
1376
1743
  rendering: { type: Boolean, default: !0 },
1377
1744
  paging: { type: Boolean, default: !1 },
1378
- initialImage: { default: () => ke },
1745
+ initialImage: { default: () => Re },
1379
1746
  quality: { default: "screen" }
1380
1747
  },
1381
1748
  emits: ["tap", "doubleTap", "scale", "swipeDownProgress", "close", "previous", "next", "pageDrag", "pageRelease", "ready", "error", "originalState", "liveState", "liveEnded"],
1382
- setup(a, { expose: t, emit: e }) {
1383
- const n = a, o = e, i = R(!1), s = R("loading"), r = Gt({
1384
- motionActive: () => n.paging,
1385
- interactive: () => n.active && !n.disabled,
1749
+ setup(t, { expose: n, emit: o }) {
1750
+ const e = t, i = o, a = L(!1), l = L("loading"), r = pn({
1751
+ motionActive: () => e.paging,
1752
+ interactive: () => e.active && !e.disabled,
1386
1753
  zoomable: () => !0,
1387
- doubleTapZoom: () => xt(n.media, r.core.viewportSize.value),
1388
- zoomLimit: () => Math.max(8, xt(n.media, r.core.viewportSize.value) * 2),
1389
- holdable: () => n.media.type === "live-photo" && b.value === "ready" && s.value === "idle",
1754
+ doubleTapZoom: () => Cn(e.media, r.core.viewportSize.value),
1755
+ holdable: () => e.media.type === "live-photo" && S.value === "ready" && l.value === "idle",
1390
1756
  onHoldStart: () => {
1391
- i.value = !0;
1757
+ a.value = !0;
1392
1758
  },
1393
1759
  onHoldEnd: () => {
1394
- i.value = !1, o("liveEnded");
1760
+ a.value = !1, i("liveEnded");
1395
1761
  },
1396
- onTap: () => o("tap"),
1397
- onDoubleTap: () => o("doubleTap"),
1398
- onScale: (w) => {
1399
- n.active && o("scale", w);
1762
+ onTap: () => i("tap"),
1763
+ onDoubleTap: () => i("doubleTap"),
1764
+ onScale: (v) => {
1765
+ e.active && i("scale", v);
1400
1766
  },
1401
- onSwipeDownProgress: (w) => {
1402
- n.active && o("swipeDownProgress", w);
1767
+ onSwipeDownProgress: (v) => {
1768
+ e.active && i("swipeDownProgress", v);
1403
1769
  },
1404
- onSwipeDownClose: () => o("close"),
1405
- onSwipeLeft: () => o("next"),
1406
- onSwipeRight: () => o("previous"),
1407
- onPageDrag: (w) => {
1408
- n.active && o("pageDrag", w);
1770
+ onSwipeDownClose: () => i("close"),
1771
+ onSwipeLeft: () => i("next"),
1772
+ onSwipeRight: () => i("previous"),
1773
+ onPageDrag: (v) => {
1774
+ e.active && i("pageDrag", v);
1409
1775
  },
1410
- onPageRelease: (w, u) => o("pageRelease", w, u)
1411
- }), f = r.core.containerRef, y = r.core.downDragStyle, m = r.core.state, b = R("loading"), B = R("thumbnail"), L = R(), P = U(
1412
- () => n.media.type === "video" ? Oa : n.media.type === "live-photo" ? pa : vt
1413
- ), p = U(
1414
- () => B.value === "full" || n.quality === "full" ? "full" : n.quality
1776
+ onPageRelease: (v, k) => i("pageRelease", v, k)
1777
+ }), u = r.core.containerRef, p = r.core.downDragStyle, d = r.core.state, S = L("loading"), C = L("thumbnail"), P = L(), R = X(
1778
+ () => e.media.type === "video" ? da : e.media.type === "live-photo" ? Yn : pt
1779
+ ), x = X(
1780
+ () => C.value === "full" || e.quality === "full" ? "full" : e.quality
1415
1781
  );
1416
1782
  ee(
1417
1783
  [
1418
- () => n.media.id,
1419
- () => n.media.src,
1420
- () => n.media.previewSrc,
1421
- () => n.media.thumbnail
1784
+ () => e.media.id,
1785
+ () => e.media.src,
1786
+ () => e.media.previewSrc,
1787
+ () => e.media.thumbnail
1422
1788
  ],
1423
1789
  () => {
1424
- B.value = "thumbnail";
1790
+ C.value = "thumbnail";
1425
1791
  }
1426
1792
  ), ee(
1427
- () => n.media.id,
1793
+ () => e.media.id,
1428
1794
  () => {
1429
- b.value = "loading", r.core.setRotation(0);
1795
+ S.value = "loading", r.core.setRotation(0);
1430
1796
  }
1431
1797
  ), ee(
1432
- [() => n.media.width, () => n.media.height],
1433
- ([w, u]) => {
1434
- r.core.setMediaSize({ width: w, height: u });
1798
+ [() => e.media.width, () => e.media.height],
1799
+ ([v, k]) => {
1800
+ r.core.setMediaSize({ width: v, height: k });
1435
1801
  },
1436
1802
  { immediate: !0 }
1437
1803
  ), ee(
1438
- () => n.active,
1439
- (w) => {
1440
- w || r.core.resetTransform(n.inactiveResetDuration);
1804
+ () => e.active,
1805
+ (v) => {
1806
+ v || r.core.resetTransform(e.inactiveResetDuration);
1441
1807
  }
1442
1808
  ), ee(
1443
- () => n.disabled,
1444
- (w) => {
1445
- w && r.core.cancelGesture(!0);
1809
+ () => e.disabled,
1810
+ (v) => {
1811
+ v && r.core.cancelGesture(!0);
1446
1812
  }
1447
1813
  );
1448
- function v(w) {
1449
- w === "full" && (B.value = w), b.value = "ready", o("ready", w);
1814
+ function m(v) {
1815
+ v === "full" && (C.value = v), S.value = "ready", i("ready", v);
1450
1816
  }
1451
- function T(w) {
1452
- s.value = w, o("liveState", w);
1817
+ function F(v) {
1818
+ l.value = v, i("liveState", v);
1453
1819
  }
1454
- const I = U(
1455
- () => n.externalGestures ? {} : {
1820
+ const q = X(
1821
+ () => e.externalGestures ? {} : {
1456
1822
  wheel: r.onWheel,
1457
1823
  pointerdown: r.onPointerDown,
1458
1824
  pointermove: r.onPointerMove,
@@ -1461,311 +1827,312 @@ const ha = {
1461
1827
  lostpointercapture: r.onPointerCancel
1462
1828
  }
1463
1829
  );
1464
- return t({
1830
+ return n({
1465
1831
  onPointerDown: r.onPointerDown,
1466
1832
  onPointerMove: r.onPointerMove,
1467
1833
  onPointerUp: r.onPointerUp,
1468
1834
  onPointerCancel: r.onPointerCancel,
1469
1835
  onWheel: r.onWheel,
1470
- readiness: b,
1836
+ readiness: S,
1471
1837
  core: r.core,
1472
1838
  rotateBy: r.core.rotateBy,
1473
1839
  resetTransform: r.core.resetTransform,
1474
- zoomIn: () => r.core.zoomTo(m.level * 1.5, void 0, !0),
1475
- zoomOut: () => r.core.zoomTo(m.level / 1.5, void 0, !0),
1476
- togglePlayback: () => L.value.togglePlayback(),
1477
- toggleFullscreen: () => L.value.toggleFullscreen(),
1478
- captureFrame: () => n.media.type === "live-photo" || n.media.type === "video" ? L.value.captureFrame() : { image: r.core.mediaRef.value, scale: 1 }
1479
- }), (w, u) => (z(), H("div", Ue({
1840
+ zoomIn: () => r.core.zoomTo(d.level * 1.5, void 0, !0),
1841
+ zoomOut: () => r.core.zoomTo(d.level / 1.5, void 0, !0),
1842
+ togglePlayback: () => P.value.togglePlayback(),
1843
+ toggleFullscreen: () => P.value.toggleFullscreen(),
1844
+ captureFrame: () => P.value.captureFrame(),
1845
+ retainFrame: () => P.value.retainFrame()
1846
+ }), (v, k) => (O(), A("div", We({
1480
1847
  ref_key: "containerRef",
1481
- ref: f,
1482
- class: ["mp-stage", { "is-zoomed": g(m).level > 1, "is-dismissing": g(m).draggingDown }],
1483
- style: g(y),
1484
- "data-scale": g(m).level.toFixed(3),
1485
- "data-rotation": g(m).rotation,
1486
- "data-live-holding": i.value,
1487
- onContextmenu: u[3] || (u[3] = (k) => {
1488
- w.media.type === "live-photo" && k.preventDefault();
1848
+ ref: u,
1849
+ class: ["mp-stage", { "is-zoomed": f(d).level > 1, "is-dismissing": f(d).draggingDown }],
1850
+ style: f(p),
1851
+ "data-scale": f(d).level.toFixed(3),
1852
+ "data-rotation": f(d).rotation,
1853
+ "data-live-holding": a.value,
1854
+ onContextmenu: k[3] || (k[3] = (g) => {
1855
+ v.media.type === "live-photo" && g.preventDefault();
1489
1856
  })
1490
- }, pt(I.value, !0)), [
1491
- (z(), rt(At(P.value), Ue({
1857
+ }, mt(q.value, !0)), [
1858
+ (O(), at(Gt(R.value), We({
1492
1859
  ref_key: "rendererRef",
1493
- ref: L,
1494
- media: w.media
1495
- }, w.media.type === "video" ? { videoLoader: w.videoLoader } : {}, {
1496
- "initial-image": w.initialImage,
1497
- rendering: w.rendering,
1498
- core: g(r).core,
1499
- quality: p.value,
1500
- "request-version": w.requestVersion,
1501
- "load-enabled": w.loadEnabled,
1502
- priority: w.active ? 0 : 2,
1503
- "resource-policy": w.resourcePolicy,
1504
- "resolve-source": w.resolveSource,
1505
- playing: (w.livePlaying || i.value) && w.active,
1506
- enabled: !w.disabled,
1507
- "controls-visible": w.controlsVisible,
1508
- "teleport-controls": w.teleportControls,
1509
- "controls-target": w.controlsTarget,
1510
- active: w.active,
1511
- onReady: v,
1512
- onError: u[0] || (u[0] = (k) => o("error", k)),
1513
- onOriginalState: u[1] || (u[1] = (k, h) => o("originalState", k, h)),
1514
- onLiveState: T,
1515
- onLiveEnded: u[2] || (u[2] = (k) => o("liveEnded"))
1860
+ ref: P,
1861
+ media: v.media
1862
+ }, v.media.type === "video" ? { videoLoader: v.videoLoader } : {}, {
1863
+ "initial-image": v.initialImage,
1864
+ rendering: v.rendering,
1865
+ core: f(r).core,
1866
+ quality: x.value,
1867
+ "request-version": v.requestVersion,
1868
+ "load-enabled": v.loadEnabled,
1869
+ priority: v.active ? 0 : 2,
1870
+ "resource-policy": v.resourcePolicy,
1871
+ "resolve-source": v.resolveSource,
1872
+ playing: (v.livePlaying || a.value) && v.active,
1873
+ enabled: !v.disabled,
1874
+ "controls-visible": v.controlsVisible,
1875
+ "teleport-controls": v.teleportControls,
1876
+ "controls-target": v.controlsTarget,
1877
+ active: v.active,
1878
+ onReady: m,
1879
+ onError: k[0] || (k[0] = (g) => i("error", g)),
1880
+ onOriginalState: k[1] || (k[1] = (g, w) => i("originalState", g, w)),
1881
+ onLiveState: F,
1882
+ onLiveEnded: k[2] || (k[2] = (g) => i("liveEnded"))
1516
1883
  }), null, 16, ["media", "initial-image", "rendering", "core", "quality", "request-version", "load-enabled", "priority", "resource-policy", "resolve-source", "playing", "enabled", "controls-visible", "teleport-controls", "controls-target", "active"]))
1517
- ], 16, _a));
1884
+ ], 16, fa));
1518
1885
  }
1519
1886
  });
1520
- function Ya(a, t) {
1521
- const e = R(/* @__PURE__ */ new Set()), n = R("idle"), o = R(""), i = R(0), s = R("");
1887
+ function ma(t, n) {
1888
+ const o = L(/* @__PURE__ */ new Set()), e = L("idle"), i = L(""), a = L(0), l = L("");
1522
1889
  function r() {
1523
- s.value = "", n.value = "idle", o.value = "", i.value = 0;
1890
+ l.value = "", e.value = "idle", i.value = "", a.value = 0;
1524
1891
  }
1525
- function f() {
1526
- n.value !== "ready" && (n.value = "loading", o.value = "", i.value++, e.value = /* @__PURE__ */ new Set([...e.value, a().id]));
1892
+ function u() {
1893
+ e.value !== "ready" && (e.value = "loading", i.value = "", a.value++, o.value = /* @__PURE__ */ new Set([...o.value, t().id]));
1527
1894
  }
1528
- function y(m, b) {
1529
- n.value = m, o.value = b, t(a(), m, b);
1895
+ function p(d, S) {
1896
+ e.value = d, i.value = S, n(t(), d, S);
1530
1897
  }
1531
1898
  return {
1532
- originalIds: e,
1533
- originalStatus: n,
1534
- originalReason: o,
1535
- originalRequest: i,
1536
- readyId: s,
1899
+ originalIds: o,
1900
+ originalStatus: e,
1901
+ originalReason: i,
1902
+ originalRequest: a,
1903
+ readyId: l,
1537
1904
  reset: r,
1538
- requestOriginal: f,
1539
- updateOriginal: y
1905
+ requestOriginal: u,
1906
+ updateOriginal: p
1540
1907
  };
1541
1908
  }
1542
- function Ha(a, t, e, n = {}) {
1543
- const o = R(0), i = mt({
1909
+ function pa(t, n, o, e = {}) {
1910
+ const i = L(0), a = gt({
1544
1911
  offset: 0,
1545
1912
  dragging: !1,
1546
1913
  settling: !1,
1547
1914
  preparing: !1,
1548
1915
  grabbed: !1,
1549
1916
  duration: 360
1550
- }), s = { readOffset: () => i.offset, flushLayout: () => {
1551
- }, ...n }, r = 16, f = () => t() + r, y = U(
1552
- () => [o.value - 1, o.value, o.value + 1].filter((d) => d >= 0 && d < a())
1917
+ }), l = { readOffset: () => a.offset, flushLayout: () => {
1918
+ }, ...e }, r = 16, u = () => n() + r, p = X(
1919
+ () => [i.value - 1, i.value, i.value + 1].filter((E) => E >= 0 && E < t())
1553
1920
  );
1554
- let m = setTimeout(() => {
1555
- }, 0), b = () => {
1556
- }, B = 0, L = 0;
1557
- function P() {
1558
- B += 1, clearTimeout(m), b(), i.settling = !1, i.preparing = !1;
1559
- }
1560
- Re(P);
1561
- function p() {
1562
- if (!i.settling && !i.preparing) return;
1563
- const d = i.preparing ? i.offset : s.readOffset();
1564
- P(), i.offset = d, i.grabbed = !0;
1565
- }
1566
- function v(d) {
1567
- if (d === 0) {
1568
- P(), i.dragging = !1, i.grabbed = !1, i.offset = 0, L = 0;
1921
+ let d = setTimeout(() => {
1922
+ }, 0), S = () => {
1923
+ }, C = 0, P = 0;
1924
+ function R() {
1925
+ C += 1, clearTimeout(d), S(), a.settling = !1, a.preparing = !1;
1926
+ }
1927
+ $e(R);
1928
+ function x() {
1929
+ if (!a.settling && !a.preparing) return;
1930
+ const E = a.preparing ? a.offset : l.readOffset();
1931
+ R(), a.offset = E, a.grabbed = !0;
1932
+ }
1933
+ function m(E) {
1934
+ if (E === 0) {
1935
+ R(), a.dragging = !1, a.grabbed = !1, a.offset = 0, P = 0;
1569
1936
  return;
1570
1937
  }
1571
- i.dragging || (p(), L = i.offset, P(), i.dragging = !0, i.grabbed = !0);
1572
- const M = L + d, C = o.value === 0 && M > 0 || o.value === a() - 1 && M < 0;
1573
- i.offset = C ? Math.sign(M) * Math.sqrt(Math.abs(M)) * 6 : M;
1574
- }
1575
- async function T(d, M = 0) {
1576
- P();
1577
- const C = B, E = o.value;
1578
- i.offset += (d - E) * f();
1579
- const A = Math.abs(i.offset), V = de(A / f(), 0, 1), _ = de(220 + V * 140 - Math.min(Math.abs(M), 2) * 35, 240, 360);
1580
- i.duration = matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : _, o.value = d, i.dragging = !1, i.grabbed = !1, i.preparing = !0, d !== E && e(d), await ye(), C === B && (s.flushLayout(), i.preparing = !1, i.settling = !0, i.offset = 0, await new Promise((N) => {
1581
- b = N, m = setTimeout(N, i.duration);
1582
- }), C === B && (i.settling = !1, b = () => {
1938
+ a.dragging || (x(), P = a.offset, R(), a.dragging = !0, a.grabbed = !0);
1939
+ const y = P + E, h = i.value === 0 && y > 0 || i.value === t() - 1 && y < 0;
1940
+ a.offset = h ? Math.sign(y) * Math.sqrt(Math.abs(y)) * 6 : y;
1941
+ }
1942
+ async function F(E, y = 0) {
1943
+ R();
1944
+ const h = C, $ = i.value;
1945
+ a.offset += (E - $) * u();
1946
+ const D = Math.abs(a.offset), I = Q(D / u(), 0, 1), H = Q(220 + I * 140 - Math.min(Math.abs(y), 2) * 35, 240, 360);
1947
+ a.duration = matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : H, i.value = E, a.dragging = !1, a.grabbed = !1, a.preparing = !0, E !== $ && o(E), await Me(), h === C && (l.flushLayout(), a.preparing = !1, a.settling = !0, a.offset = 0, await new Promise((Z) => {
1948
+ S = Z, d = setTimeout(Z, a.duration);
1949
+ }), h === C && (a.settling = !1, S = () => {
1583
1950
  }));
1584
1951
  }
1585
- function I(d, M) {
1586
- const C = i.offset, E = Math.abs(M) > 0.35 && Math.abs(d) > 16, A = Math.sign(E ? M : C), V = E || Math.abs(C) > t() * 0.14;
1587
- T(de(o.value - (V ? A : 0), 0, a() - 1), M);
1952
+ function q(E, y) {
1953
+ const h = a.offset, $ = Math.abs(y) > 0.35 && Math.abs(E) > 16, D = Math.sign($ ? y : h), I = $ || Math.abs(h) > n() * 0.14;
1954
+ F(Q(i.value - (I ? D : 0), 0, t() - 1), y);
1588
1955
  }
1589
- function w() {
1590
- i.grabbed && !i.dragging && T(o.value);
1956
+ function v() {
1957
+ a.grabbed && !a.dragging && F(i.value);
1591
1958
  }
1592
- function u(d) {
1593
- if (i.dragging) return;
1594
- p();
1595
- const M = de(o.value + d, 0, a() - 1);
1596
- M !== o.value ? T(M) : w();
1959
+ function k(E) {
1960
+ if (a.dragging) return;
1961
+ x();
1962
+ const y = Q(i.value + E, 0, t() - 1);
1963
+ y !== i.value ? F(y) : v();
1597
1964
  }
1598
- function k(d) {
1599
- P(), o.value = d, i.offset = 0, i.dragging = !1, i.grabbed = !1;
1965
+ function g(E) {
1966
+ R(), i.value = E, a.offset = 0, a.dragging = !1, a.grabbed = !1;
1600
1967
  }
1601
- function h(d) {
1602
- o.value = d;
1968
+ function w(E) {
1969
+ i.value = E;
1603
1970
  }
1604
- return { index: o, state: i, slots: y, stride: f, drag: v, release: I, go: u, grab: p, resume: w, reset: k, rebase: h, cancel: P };
1971
+ return { index: i, state: a, slots: p, stride: u, drag: m, release: q, go: k, grab: x, resume: v, reset: g, rebase: w, cancel: R };
1605
1972
  }
1606
- function $t(a, t, e) {
1607
- const n = Math[e === "cover" ? "max" : "min"](
1608
- t.width / a.width,
1609
- t.height / a.height
1973
+ function Ot(t, n, o) {
1974
+ const e = Math[o === "cover" ? "max" : "min"](
1975
+ n.width / t.width,
1976
+ n.height / t.height
1610
1977
  );
1611
1978
  return {
1612
- x: t.left + t.width / 2,
1613
- y: t.top + t.height / 2,
1614
- width: a.width * n,
1615
- height: a.height * n,
1979
+ x: n.left + n.width / 2,
1980
+ y: n.top + n.height / 2,
1981
+ width: t.width * e,
1982
+ height: t.height * e,
1616
1983
  rotation: 0,
1617
- clip: { left: t.left, top: t.top, width: t.width, height: t.height },
1984
+ clip: { left: n.left, top: n.top, width: n.width, height: n.height },
1618
1985
  radius: 0
1619
1986
  };
1620
1987
  }
1621
- function Xa(a, t, e) {
1622
- const n = (o, i) => o + (i - o) * e;
1988
+ function ha(t, n, o) {
1989
+ const e = (i, a) => i + (a - i) * o;
1623
1990
  return {
1624
- x: n(a.x, t.x),
1625
- y: n(a.y, t.y),
1626
- width: n(a.width, t.width),
1627
- height: n(a.height, t.height),
1628
- rotation: n(a.rotation, t.rotation),
1629
- radius: n(a.radius, t.radius),
1991
+ x: e(t.x, n.x),
1992
+ y: e(t.y, n.y),
1993
+ width: e(t.width, n.width),
1994
+ height: e(t.height, n.height),
1995
+ rotation: e(t.rotation, n.rotation),
1996
+ radius: e(t.radius, n.radius),
1630
1997
  clip: {
1631
- left: n(a.clip.left, t.clip.left),
1632
- top: n(a.clip.top, t.clip.top),
1633
- width: n(a.clip.width, t.clip.width),
1634
- height: n(a.clip.height, t.clip.height)
1998
+ left: e(t.clip.left, n.clip.left),
1999
+ top: e(t.clip.top, n.clip.top),
2000
+ width: e(t.clip.width, n.clip.width),
2001
+ height: e(t.clip.height, n.clip.height)
1635
2002
  }
1636
2003
  };
1637
2004
  }
1638
- function Mt(a) {
1639
- const t = a.rotation * Math.PI / 180, e = Math.abs(Math.cos(t)) * a.width + Math.abs(Math.sin(t)) * a.height, n = Math.abs(Math.sin(t)) * a.width + Math.abs(Math.cos(t)) * a.height, o = Math.max(a.x - e / 2, a.clip.left), i = Math.max(a.y - n / 2, a.clip.top);
2005
+ function Pt(t) {
2006
+ const n = t.rotation * Math.PI / 180, o = Math.abs(Math.cos(n)) * t.width + Math.abs(Math.sin(n)) * t.height, e = Math.abs(Math.sin(n)) * t.width + Math.abs(Math.cos(n)) * t.height, i = Math.max(t.x - o / 2, t.clip.left), a = Math.max(t.y - e / 2, t.clip.top);
1640
2007
  return {
1641
- left: o,
1642
- top: i,
1643
- width: Math.max(0, Math.min(a.x + e / 2, a.clip.left + a.clip.width) - o),
1644
- height: Math.max(0, Math.min(a.y + n / 2, a.clip.top + a.clip.height) - i)
2008
+ left: i,
2009
+ top: a,
2010
+ width: Math.max(0, Math.min(t.x + o / 2, t.clip.left + t.clip.width) - i),
2011
+ height: Math.max(0, Math.min(t.y + e / 2, t.clip.top + t.clip.height) - a)
1645
2012
  };
1646
2013
  }
1647
- function Ua(a, t, e, n, o) {
1648
- const i = Mt(a), s = Mt(t), r = Math.min(i.width / s.width, i.height / s.height), f = {
1649
- width: Math.max(i.width, s.width, 1),
1650
- height: Math.max(i.height, s.height, 1)
1651
- }, y = 128, m = [], b = [];
1652
- for (let B = 0; B <= y; B += 1) {
1653
- const L = B / y, P = Xa(a, t, L);
1654
- let p;
1655
- if (o)
1656
- p = {
1657
- left: i.left + (s.left - i.left) * L,
1658
- top: i.top + (s.top - i.top) * L,
1659
- width: i.width + (s.width - i.width) * L,
1660
- height: i.height + (s.height - i.height) * L
2014
+ function va(t, n, o, e, i) {
2015
+ const a = Pt(t), l = Pt(n), r = Math.min(a.width / l.width, a.height / l.height), u = {
2016
+ width: Math.max(a.width, l.width, 1),
2017
+ height: Math.max(a.height, l.height, 1)
2018
+ }, p = 128, d = [], S = [];
2019
+ for (let C = 0; C <= p; C += 1) {
2020
+ const P = C / p, R = ha(t, n, P);
2021
+ let x;
2022
+ if (i)
2023
+ x = {
2024
+ left: a.left + (l.left - a.left) * P,
2025
+ top: a.top + (l.top - a.top) * P,
2026
+ width: a.width + (l.width - a.width) * P,
2027
+ height: a.height + (l.height - a.height) * P
1661
2028
  };
1662
2029
  else {
1663
- const I = Math.min(L / 0.78, 1), w = 1 - I * I * I * (I * (I * 6 - 15) + 10), u = r + (1 - r) * L, k = s.width * u + (i.width - s.width * r) * w, h = s.height * u + (i.height - s.height * r) * w;
1664
- p = {
1665
- left: i.left + i.width / 2 + (s.left + s.width / 2 - i.left - i.width / 2) * L - k / 2,
1666
- top: i.top + i.height / 2 + (s.top + s.height / 2 - i.top - i.height / 2) * L - h / 2,
1667
- width: k,
1668
- height: h
2030
+ const q = Math.min(P / 0.78, 1), v = 1 - q * q * q * (q * (q * 6 - 15) + 10), k = r + (1 - r) * P, g = l.width * k + (a.width - l.width * r) * v, w = l.height * k + (a.height - l.height * r) * v;
2031
+ x = {
2032
+ left: a.left + a.width / 2 + (l.left + l.width / 2 - a.left - a.width / 2) * P - g / 2,
2033
+ top: a.top + a.height / 2 + (l.top + l.height / 2 - a.top - a.height / 2) * P - w / 2,
2034
+ width: g,
2035
+ height: w
1669
2036
  };
1670
2037
  }
1671
- const v = Math.max(p.width, 1e-3) / f.width, T = Math.max(p.height, 1e-3) / f.height;
1672
- m.push({
1673
- transform: `scale(${1 / v},${1 / T}) translate3d(${P.x - p.left}px,${P.y - p.top}px,0) rotate(${P.rotation}deg) scale(${P.width / n.width}) translate3d(${-n.width / 2}px,${-n.height / 2}px,0)`,
1674
- offset: L
1675
- }), b.push({
1676
- transform: `translate3d(${p.left - e.left}px,${p.top - e.top}px,0) scale(${v},${T})`,
1677
- ...a.radius === 0 && t.radius === 0 ? {} : { borderRadius: `${P.radius / v}px / ${P.radius / T}px` },
1678
- offset: L
2038
+ const m = Math.max(x.width, 1e-3) / u.width, F = Math.max(x.height, 1e-3) / u.height;
2039
+ d.push({
2040
+ transform: `scale(${1 / m},${1 / F}) translate3d(${R.x - x.left}px,${R.y - x.top}px,0) rotate(${R.rotation}deg) scale(${R.width / e.width}) translate3d(${-e.width / 2}px,${-e.height / 2}px,0)`,
2041
+ offset: P
2042
+ }), S.push({
2043
+ transform: `translate3d(${x.left - o.left}px,${x.top - o.top}px,0) scale(${m},${F})`,
2044
+ ...t.radius === 0 && n.radius === 0 ? {} : { borderRadius: `${R.radius / m}px / ${R.radius / F}px` },
2045
+ offset: P
1679
2046
  });
1680
2047
  }
1681
- return { pictures: m, masks: b, maskSize: f };
2048
+ return { pictures: d, masks: S, maskSize: u };
1682
2049
  }
1683
- function Wa() {
1684
- let a = { kind: "idle" };
1685
- function t() {
1686
- a.kind === "playing" && a.animations.forEach((o) => o.cancel()), a = { kind: "idle" };
2050
+ function ya() {
2051
+ let t = { kind: "idle" };
2052
+ function n() {
2053
+ t.kind === "playing" && t.animations.forEach((i) => i.cancel()), t = { kind: "idle" };
1687
2054
  }
1688
- function e() {
1689
- return a.kind !== "playing" || !a.entering ? { kind: "inactive" } : (a.entering = !1, a.animations.forEach((o) => o.reverse()), a.finished = Promise.all(a.animations.map((o) => o.finished)).then(() => {
2055
+ function o() {
2056
+ return t.kind !== "playing" || !t.entering ? { kind: "inactive" } : (t.entering = !1, t.animations.forEach((i) => i.reverse()), t.finished = Promise.all(t.animations.map((i) => i.finished)).then(() => {
1690
2057
  }).catch(() => {
1691
- }), { kind: "reversing", finished: a.finished });
2058
+ }), { kind: "reversing", finished: t.finished });
1692
2059
  }
1693
- async function n(o, i, s, r, f, y, m, b, B = b ? 0 : 1, L = 340) {
1694
- t();
1695
- const P = Math.max(r.width, f.width), p = P * f.height / f.width, v = Math.min(
2060
+ async function e(i, a, l, r, u, p, d, S, C = S ? 0 : 1, P = 340) {
2061
+ n();
2062
+ const R = Math.max(r.width, u.width), x = R * u.height / u.width, m = Math.min(
1696
2063
  devicePixelRatio,
1697
2064
  2,
1698
- Math.sqrt(ue.maxCanvasPixels / (P * p))
2065
+ Math.sqrt(ue.maxCanvasPixels / (R * x))
1699
2066
  );
1700
- o.width = Math.max(1, Math.round(P * v)), o.height = Math.max(1, Math.round(p * v)), o.style.width = `${P}px`, o.style.height = `${p}px`;
1701
- const T = o.getContext("2d");
1702
- ((M) => {
1703
- T.clearRect(0, 0, o.width, o.height), T.imageSmoothingEnabled = !0, T.imageSmoothingQuality = "high", T.drawImage(M, 0, 0, o.width, o.height);
1704
- })(s);
1705
- const w = Ua(r, f, y, { width: P, height: p }, b);
1706
- i.style.width = `${w.maskSize.width}px`, i.style.height = `${w.maskSize.height}px`, i.style.borderRadius = "0";
1707
- const k = {
1708
- duration: matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : Math.max(0, L),
2067
+ i.width = Math.max(1, Math.round(R * m)), i.height = Math.max(1, Math.round(x * m)), i.style.width = `${R}px`, i.style.height = `${x}px`;
2068
+ const F = i.getContext("2d");
2069
+ ((y) => {
2070
+ F.clearRect(0, 0, i.width, i.height), F.imageSmoothingEnabled = !0, F.imageSmoothingQuality = "high", F.drawImage(y, 0, 0, i.width, i.height);
2071
+ })(l);
2072
+ const v = va(r, u, p, { width: R, height: x }, S);
2073
+ a.style.width = `${v.maskSize.width}px`, a.style.height = `${v.maskSize.height}px`, a.style.borderRadius = "0";
2074
+ const g = {
2075
+ duration: matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : Math.max(0, P),
1709
2076
  easing: "cubic-bezier(.2,.78,.2,1)",
1710
2077
  fill: "both"
1711
- }, h = [
1712
- o.animate(w.pictures, k),
1713
- i.animate(w.masks, k),
1714
- m.animate([{ opacity: B }, { opacity: b ? 1 : 0 }], k)
1715
- ], d = Promise.all(h.map((M) => M.finished)).then(() => {
2078
+ }, w = [
2079
+ i.animate(v.pictures, g),
2080
+ a.animate(v.masks, g),
2081
+ d.animate([{ opacity: C }, { opacity: S ? 1 : 0 }], g)
2082
+ ], E = Promise.all(w.map((y) => y.finished)).then(() => {
1716
2083
  }).catch(() => {
1717
2084
  });
1718
- a = { kind: "playing", entering: b, animations: h, finished: d }, await d;
2085
+ t = { kind: "playing", entering: S, animations: w, finished: E }, await E;
1719
2086
  }
1720
- return { play: n, cancel: t, reverseOpening: e };
2087
+ return { play: e, cancel: n, reverseOpening: o };
1721
2088
  }
1722
- function Ft(a, t) {
1723
- const e = Math.max(a.left, t.left), n = Math.max(a.top, t.top);
2089
+ function At(t, n) {
2090
+ const o = Math.max(t.left, n.left), e = Math.max(t.top, n.top);
1724
2091
  return {
1725
- left: e,
1726
- top: n,
1727
- width: Math.max(0, Math.min(a.left + a.width, t.left + t.width) - e),
1728
- height: Math.max(0, Math.min(a.top + a.height, t.top + t.height) - n)
2092
+ left: o,
2093
+ top: e,
2094
+ width: Math.max(0, Math.min(t.left + t.width, n.left + n.width) - o),
2095
+ height: Math.max(0, Math.min(t.top + t.height, n.top + n.height) - e)
1729
2096
  };
1730
2097
  }
1731
- function Na(a, t) {
1732
- let e = { ...t };
1733
- const n = /^(auto|scroll|overlay)$/;
1734
- for (let o = a.parentElement; o !== document.documentElement; o = o.parentElement) {
1735
- const i = getComputedStyle(o), s = n.test(i.overflowX), r = n.test(i.overflowY);
1736
- if (!s && !r) continue;
1737
- const f = o.getBoundingClientRect(), y = Number(o.style.getPropertyValue("--mp-transition-inset-top"));
1738
- e = Ft(e, {
1739
- left: s ? f.left : e.left,
1740
- top: r ? f.top + y : e.top,
1741
- width: s ? f.width : e.width,
1742
- height: r ? Math.max(0, f.height - y) : e.height
2098
+ function wa(t, n) {
2099
+ let o = { ...n };
2100
+ const e = /^(auto|scroll|overlay)$/;
2101
+ for (let i = t.parentElement; i !== document.documentElement; i = i.parentElement) {
2102
+ const a = getComputedStyle(i), l = e.test(a.overflowX), r = e.test(a.overflowY);
2103
+ if (!l && !r) continue;
2104
+ const u = i.getBoundingClientRect(), p = Number(i.style.getPropertyValue("--mp-transition-inset-top"));
2105
+ o = At(o, {
2106
+ left: l ? u.left : o.left,
2107
+ top: r ? u.top + p : o.top,
2108
+ width: l ? u.width : o.width,
2109
+ height: r ? Math.max(0, u.height - p) : o.height
1743
2110
  });
1744
2111
  }
1745
- return e;
2112
+ return o;
1746
2113
  }
1747
- function St(a, t, e) {
1748
- if (a.kind === "unavailable") return a;
1749
- const n = $t(t, a.element.getBoundingClientRect(), "cover");
1750
- return n.clip = Ft(n.clip, Na(a.element, e)), n.clip.width <= 0 || n.clip.height <= 0 ? { kind: "unavailable" } : (n.radius = parseFloat(getComputedStyle(a.element).borderTopLeftRadius) || 0, { kind: "element", element: a.element, frame: n, viewport: e });
2114
+ function Rt(t, n, o) {
2115
+ if (t.kind === "unavailable") return t;
2116
+ const e = Ot(n, t.element.getBoundingClientRect(), "cover");
2117
+ return e.clip = At(e.clip, wa(t.element, o)), e.clip.width <= 0 || e.clip.height <= 0 ? { kind: "unavailable" } : (e.radius = parseFloat(getComputedStyle(t.element).borderTopLeftRadius) || 0, { kind: "element", element: t.element, frame: e, viewport: o });
1751
2118
  }
1752
- const Za = ["aria-label", "data-phase", "data-chrome", "inert"], ja = ["aria-hidden", "inert", "data-media-id"], Ka = {
2119
+ const ba = ["aria-label", "data-phase", "data-chrome", "inert"], ka = ["aria-hidden", "inert", "data-media-id"], xa = {
1753
2120
  key: 0,
1754
2121
  class: "mp-resource-state mp-viewer__loading mp-viewer__pages",
1755
2122
  role: "status",
1756
2123
  "aria-label": "加载中"
1757
- }, Ga = /* @__PURE__ */ $("span", {
2124
+ }, Ma = /* @__PURE__ */ B("span", {
1758
2125
  class: "mp-spinner",
1759
2126
  "aria-hidden": "true"
1760
- }, null, -1), Qa = [
1761
- Ga
1762
- ], Ja = ["inert"], en = { class: "mp-viewer__toolbar" }, tn = { class: "mp-viewer__title" }, an = ["disabled"], nn = { class: "mp-viewer__footer" }, on = {
2127
+ }, null, -1), Sa = [
2128
+ Ma
2129
+ ], Pa = ["inert"], Ra = { class: "mp-viewer__toolbar" }, Ea = { class: "mp-viewer__title" }, Ca = ["disabled"], La = { class: "mp-viewer__footer" }, Fa = {
1763
2130
  class: "mp-viewer__counter",
1764
2131
  "aria-live": "polite"
1765
- }, rn = {
2132
+ }, $a = {
1766
2133
  key: 1,
1767
2134
  class: "mp-viewer__detail"
1768
- }, gn = /* @__PURE__ */ Le({
2135
+ }, Oa = /* @__PURE__ */ Te({
1769
2136
  inheritAttrs: !1,
1770
2137
  __name: "MediaPreview",
1771
2138
  props: {
@@ -1775,9 +2142,9 @@ const Za = ["aria-label", "data-phase", "data-chrome", "inert"], ja = ["aria-hid
1775
2142
  keyboardEnabled: { type: Boolean, default: !0 },
1776
2143
  gesturesEnabled: { type: Boolean, default: !0 },
1777
2144
  persistentChrome: { type: Boolean, default: !1 },
1778
- videoLoader: { type: Function, default: lt },
1779
- resourcePolicy: { default: () => We },
1780
- resolveImageSource: { type: Function, default: Ne },
2145
+ videoLoader: { type: Function, default: it },
2146
+ resourcePolicy: { default: () => je },
2147
+ resolveImageSource: { type: Function, default: Ke },
1781
2148
  hasMore: { type: Boolean, default: !1 },
1782
2149
  appearance: { default: "dark" },
1783
2150
  closeDuration: { default: 240 },
@@ -1785,520 +2152,544 @@ const Za = ["aria-label", "data-phase", "data-chrome", "inert"], ja = ["aria-hid
1785
2152
  resolveAnchor: { type: Function, default: () => ({ kind: "unavailable" }) }
1786
2153
  },
1787
2154
  emits: ["open", "opened", "ready", "closing", "close", "change", "error", "originalState", "loadMore", "phaseChange", "chromeChange"],
1788
- setup(a, { expose: t, emit: e }) {
1789
- const n = Ot(), o = a, i = e, s = R("closed");
1790
- ee(s, (l) => i("phaseChange", l), { flush: "sync" });
1791
- const r = `mp-video-controls-${_t().uid}`, f = R(), y = R(), m = Ya(
1792
- () => W.value,
1793
- (l, x, S) => i("originalState", l, x, S)
1794
- ), { originalIds: b, originalStatus: B, originalReason: L, originalRequest: P, readyId: p } = m;
1795
- let v = "", T = -1;
1796
- const I = R(), w = R(), u = R(), k = R(!1), h = R(0), d = R(!0);
1797
- ee(d, (l) => i("chromeChange", l), { flush: "sync" });
1798
- const M = R(!1), C = R("loading"), E = R(1), A = R(!1), V = R(1), _ = R(!1), N = R(!1), Y = gt(ke);
1799
- let Pe = "", se = { kind: "unavailable" };
1800
- const fe = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map();
1801
- function Ze(l) {
1802
- return (x) => {
1803
- K.set(l, x);
2155
+ setup(t, { expose: n, emit: o }) {
2156
+ const e = Qt(), i = t, a = o, l = L("closed");
2157
+ ee(l, (s) => a("phaseChange", s), { flush: "sync" });
2158
+ const r = `mp-video-controls-${Jt().uid}`, u = L(), p = L(), d = ma(
2159
+ () => _.value,
2160
+ (s, b, M) => a("originalState", s, b, M)
2161
+ ), { originalIds: S, originalStatus: C, originalReason: P, originalRequest: R, readyId: x } = d;
2162
+ let m = "", F = -1;
2163
+ const q = L(), v = L(), k = L(), g = L(!1), w = L(0), E = L(!0);
2164
+ ee(E, (s) => a("chromeChange", s), { flush: "sync" });
2165
+ const y = L(!1), h = L("loading"), $ = L(1), D = L(!1), I = L(1), H = L(!1), Z = L(!1), J = ft(Re);
2166
+ let ie = "", Ee = { kind: "unavailable" };
2167
+ const oe = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map();
2168
+ function ce(s) {
2169
+ return (b) => {
2170
+ se.set(s, b);
1804
2171
  };
1805
2172
  }
1806
- function Oe(l) {
1807
- return (x) => {
1808
- fe.set(l, x);
2173
+ function de(s) {
2174
+ return (b) => {
2175
+ oe.set(s, b);
1809
2176
  };
1810
2177
  }
1811
- const D = Ha(
1812
- () => o.items.length,
1813
- () => V.value,
1814
- (l) => {
1815
- v = o.items[l].id, m.reset(), E.value = 1, M.value = !1, C.value = "loading", i("change", l), Fe(l);
2178
+ const z = pa(
2179
+ () => i.items.length,
2180
+ () => I.value,
2181
+ (s) => {
2182
+ m = i.items[s].id, d.reset(), $.value = 1, y.value = !1, h.value = "loading", a("change", s), Ae(s);
1816
2183
  },
1817
2184
  {
1818
- readOffset: () => new DOMMatrixReadOnly(getComputedStyle(K.get(v)).transform).m41,
2185
+ readOffset: () => new DOMMatrixReadOnly(getComputedStyle(se.get(m)).transform).m41,
1819
2186
  flushLayout: () => {
1820
- K.get(v).getBoundingClientRect();
2187
+ se.get(m).getBoundingClientRect();
1821
2188
  }
1822
2189
  }
1823
- ), q = D.index, W = U(() => o.items[q.value]), Ce = D.slots, je = U(
1824
- () => s.value === "opening" || k.value ? [q.value] : Ce.value
2190
+ ), V = z.index, _ = X(() => i.items[V.value]), Oe = z.slots, Ge = X(
2191
+ () => l.value === "opening" || g.value ? [V.value] : Oe.value
1825
2192
  );
1826
- ee(Ce, () => {
1827
- ye(() => {
1828
- const l = new Set(Ce.value.map((x) => o.items[x].id));
1829
- for (const x of fe.keys()) l.has(x) || fe.delete(x);
1830
- for (const x of K.keys()) l.has(x) || K.delete(x);
2193
+ ee(Oe, () => {
2194
+ Me(() => {
2195
+ const s = new Set(Oe.value.map((b) => i.items[b].id));
2196
+ for (const b of oe.keys()) s.has(b) || oe.delete(b);
2197
+ for (const b of se.keys()) s.has(b) || se.delete(b);
1831
2198
  });
1832
2199
  });
1833
2200
  const te = {
1834
- close: F,
1835
- setChromeVisible: (l) => {
1836
- d.value = l;
2201
+ close: N,
2202
+ setChromeVisible: (s) => {
2203
+ E.value = s;
1837
2204
  },
1838
- goTo: ut,
1839
- previous: () => D.go(-1),
1840
- next: () => D.go(1),
1841
- rotate: (l = 90) => j().rotateBy(l),
1842
- reset: () => j().resetTransform(),
1843
- zoomIn: () => j().zoomIn(),
1844
- zoomOut: () => j().zoomOut(),
1845
- original: m.requestOriginal,
1846
- fullscreen: ae,
1847
- togglePlayback: () => j().togglePlayback(),
2205
+ goTo: lt,
2206
+ previous: () => z.go(-1),
2207
+ next: () => z.go(1),
2208
+ rotate: (s = 90) => W().rotateBy(s),
2209
+ reset: () => W().resetTransform(),
2210
+ zoomIn: () => W().zoomIn(),
2211
+ zoomOut: () => W().zoomOut(),
2212
+ original: d.requestOriginal,
2213
+ fullscreen: xe,
2214
+ togglePlayback: () => W().togglePlayback(),
1848
2215
  toggleLive: () => {
1849
- s.value !== "open" || C.value === "loading" || C.value === "error" || (M.value = !M.value);
2216
+ l.value !== "open" || h.value === "loading" || h.value === "error" || (y.value = !y.value);
1850
2217
  },
1851
2218
  toggleDetail: () => {
1852
- A.value = !A.value;
2219
+ D.value = !D.value;
1853
2220
  }
1854
- }, ge = Wa();
1855
- let $e = Promise.resolve(), G = 0, pe = "", Q = !1, ve = "", me = "", xe = () => {
1856
- }, ne = { kind: "idle" }, he = 0;
1857
- const Ee = () => new Promise((l) => requestAnimationFrame(() => l())), Me = new ResizeObserver(() => {
1858
- const l = `${y.value.clientWidth}:${y.value.clientHeight}`, x = `${f.value.clientWidth}:${f.value.clientHeight}`, S = ve !== "" && ve !== l, O = me !== "" && me !== x;
1859
- ve = l, me = x, V.value = y.value.clientWidth, S && s.value === "open" && D.reset(q.value), O && ge.cancel();
2221
+ }, pe = ya(), ge = nn();
2222
+ let be = Promise.resolve(), he = () => {
2223
+ }, K = 0, ke = "", re = !1, me = "", ve = "", Se = () => {
2224
+ }, ye = { kind: "idle" }, Be = 0;
2225
+ const Pe = () => new Promise((s) => requestAnimationFrame(() => s())), ze = new ResizeObserver(() => {
2226
+ const s = `${p.value.clientWidth}:${p.value.clientHeight}`, b = `${u.value.clientWidth}:${u.value.clientHeight}`, M = me !== "" && me !== s, U = ve !== "" && ve !== b;
2227
+ me = s, ve = b, I.value = p.value.clientWidth, M && l.value === "open" && z.reset(V.value), U && pe.cancel();
1860
2228
  });
1861
- function Fe(l) {
1862
- o.hasMore && l >= o.items.length - 3 && T !== o.items.length && (T = o.items.length, i("loadMore", l));
2229
+ function Ae(s) {
2230
+ i.hasMore && s >= i.items.length - 3 && F !== i.items.length && (F = i.items.length, a("loadMore", s));
1863
2231
  }
1864
- function Te(l, x) {
1865
- l === q.value && (N.value && (p.value = W.value.id), i("ready", l, x));
2232
+ function ot(s, b) {
2233
+ s === V.value && (Z.value && (x.value = _.value.id), a("ready", s, b));
1866
2234
  }
1867
- function st(l, x, S) {
1868
- l === q.value && m.updateOriginal(x, S);
2235
+ function rt(s, b, M) {
2236
+ s === V.value && d.updateOriginal(b, M);
1869
2237
  }
1870
2238
  ee(
1871
- () => o.items.map((l) => l.id),
1872
- (l) => {
1873
- if (s.value === "closed") return;
1874
- if (l.length === 0) {
1875
- G++, ge.cancel(), D.cancel(), he++, ne.kind === "active" && ne.animation.cancel(), Me.disconnect(), ve = "", me = "", xe(), i("closing"), s.value = "closed", Y.value = ke, fe.clear(), K.clear(), document.body.style.overflow = pe, i("close");
2239
+ () => i.items.map((s) => s.id),
2240
+ (s) => {
2241
+ if (l.value === "closed") return;
2242
+ if (s.length === 0) {
2243
+ K++, pe.cancel(), he(), ge.clear(), z.cancel(), Be++, ye.kind === "active" && ye.animation.cancel(), ze.disconnect(), me = "", ve = "", Se(), a("closing"), l.value = "closed", J.value = Re, oe.clear(), se.clear(), document.body.style.overflow = ke, a("close");
1876
2244
  return;
1877
2245
  }
1878
- const x = l.indexOf(v), S = x >= 0 ? x : Math.min(q.value, l.length - 1);
1879
- (S !== q.value || x < 0) && (x >= 0 ? D.rebase(S) : (D.reset(S), v = l[S], m.reset(), E.value = 1, M.value = !1, i("change", S))), Fe(S);
2246
+ const b = s.indexOf(m), M = b >= 0 ? b : Math.min(V.value, s.length - 1);
2247
+ (M !== V.value || b < 0) && (b >= 0 ? z.rebase(M) : (z.reset(M), m = s[M], d.reset(), $.value = 1, y.value = !1, a("change", M))), Ae(M);
1880
2248
  },
1881
2249
  { flush: "sync" }
1882
2250
  );
1883
- function ut(l) {
1884
- if (!Number.isInteger(l) || l < 0 || l >= o.items.length)
2251
+ function lt(s) {
2252
+ if (!Number.isInteger(s) || s < 0 || s >= i.items.length)
1885
2253
  throw new RangeError("无效的预览下标");
1886
- if (!(s.value !== "open" || l === q.value)) {
1887
- if (Math.abs(l - q.value) === 1) {
1888
- D.go(l - q.value);
2254
+ if (!(l.value !== "open" || s === V.value)) {
2255
+ if (Math.abs(s - V.value) === 1) {
2256
+ z.go(s - V.value);
1889
2257
  return;
1890
2258
  }
1891
- D.reset(l), v = o.items[l].id, m.reset(), E.value = 1, M.value = !1, C.value = "loading", i("change", l), Fe(l);
2259
+ z.reset(s), m = i.items[s].id, d.reset(), $.value = 1, y.value = !1, h.value = "loading", a("change", s), Ae(s);
1892
2260
  }
1893
2261
  }
1894
- function ct() {
1895
- o.persistentChrome || (d.value = !d.value);
2262
+ function st() {
2263
+ i.persistentChrome || (E.value = !E.value);
1896
2264
  }
1897
- function j() {
1898
- return fe.get(v);
2265
+ function W() {
2266
+ return oe.get(m);
1899
2267
  }
1900
- function Ke(l) {
1901
- xe();
1902
- const x = l.element.classList.contains("mp-transition-source");
1903
- l.element.classList.add("mp-transition-source"), xe = () => {
1904
- l.element.classList.toggle("mp-transition-source", x);
2268
+ function Ye(s) {
2269
+ Se();
2270
+ const b = s.element.classList.contains("mp-transition-source");
2271
+ s.element.classList.add("mp-transition-source"), Se = () => {
2272
+ s.element.classList.toggle("mp-transition-source", b);
1905
2273
  };
1906
2274
  }
1907
- function Ge() {
1908
- const l = f.value.getBoundingClientRect();
1909
- return { left: l.left, top: l.top, width: l.width, height: l.height };
2275
+ function c() {
2276
+ const s = u.value.getBoundingClientRect();
2277
+ return { left: s.left, top: s.top, width: s.width, height: s.height };
1910
2278
  }
1911
- function _e() {
1912
- return y.value.getBoundingClientRect();
2279
+ function T() {
2280
+ return p.value.getBoundingClientRect();
1913
2281
  }
1914
- function Ve(l = 1) {
1915
- const x = _e(), S = j().core, O = S.state, ce = O.downScale;
2282
+ function Y(s = 1) {
2283
+ const b = T(), M = W().core, U = M.state, ne = U.downScale;
1916
2284
  return {
1917
- x: x.left + x.width / 2 + D.state.offset + O.offsetX * ce * l + O.downOffsetX,
1918
- y: x.top + x.height / 2 + O.offsetY * ce * l + O.downOffsetY,
1919
- width: S.mediaSize.value.width * S.displayScale.value * ce * l,
1920
- height: S.mediaSize.value.height * S.displayScale.value * ce * l,
1921
- rotation: O.rotation,
1922
- clip: x,
2285
+ x: b.left + b.width / 2 + z.state.offset + U.offsetX * ne * s + U.downOffsetX,
2286
+ y: b.top + b.height / 2 + U.offsetY * ne * s + U.downOffsetY,
2287
+ width: M.mediaSize.value.width * M.displayScale.value * ne * s,
2288
+ height: M.mediaSize.value.height * M.displayScale.value * ne * s,
2289
+ rotation: U.rotation,
2290
+ clip: b,
1923
2291
  radius: 0
1924
2292
  };
1925
2293
  }
1926
- async function c(l = 0) {
1927
- if (!Number.isInteger(l) || l < 0 || l >= o.items.length)
2294
+ async function j(s = 0) {
2295
+ if (!Number.isInteger(s) || s < 0 || s >= i.items.length)
1928
2296
  throw new RangeError("无效的预览下标");
1929
- if (s.value === "closing" && await $e, s.value !== "closed" || Q) return;
1930
- const x = ++G;
1931
- if (pe = document.body.style.overflow, document.body.style.overflow = "hidden", D.reset(l), v = o.items[l].id, m.reset(), E.value = 1, d.value = !0, M.value = !1, C.value = "loading", A.value = !1, h.value = 0, N.value = !1, s.value = "opening", Y.value = ke, _.value = !1, Pe = W.value.id, se = { kind: "unavailable" }, k.value = !1, i("open", l), await ye(), !(x !== G || Q)) {
1932
- V.value = y.value.clientWidth, Me.observe(f.value), Me.observe(y.value);
2297
+ if (l.value === "closing" && await be, l.value !== "closed" || re) return;
2298
+ const b = ++K;
2299
+ if (ge.clear(), ke = document.body.style.overflow, document.body.style.overflow = "hidden", z.reset(s), m = i.items[s].id, d.reset(), $.value = 1, E.value = !0, y.value = !1, h.value = "loading", D.value = !1, w.value = 0, Z.value = !1, l.value = "opening", J.value = Re, H.value = !1, ie = _.value.id, Ee = { kind: "unavailable" }, g.value = !1, a("open", s), await Me(), b !== K || re) return;
2300
+ I.value = p.value.clientWidth, ze.observe(u.value), ze.observe(p.value);
2301
+ try {
2302
+ const U = await i.resolveAnchor(_.value);
2303
+ if (b !== K) return;
2304
+ const ne = Rt(U, _.value, c());
2305
+ Ee = ne, J.value = Rn(ne), H.value = J.value.kind === "image" || W().readiness === "ready";
2306
+ const Ue = T();
2307
+ if (ne.kind === "element") {
2308
+ const Xe = W().readiness === "ready" ? W().core.mediaRef.value : J.value.kind === "image" ? J.value.image : xt();
2309
+ if (g.value = !0, await Me(), b !== K || re) return;
2310
+ Ye(ne), await pe.play(
2311
+ q.value,
2312
+ v.value,
2313
+ Xe,
2314
+ ne.frame,
2315
+ Ot(_.value, Ue, "contain"),
2316
+ ne.viewport,
2317
+ k.value,
2318
+ !0,
2319
+ 0,
2320
+ i.transitionDuration
2321
+ );
2322
+ } else
2323
+ w.value = 1, g.value = !1, await we(!0);
2324
+ } catch (U) {
2325
+ if (b !== K) return;
2326
+ a("error", _e(U), _.value);
2327
+ }
2328
+ if (b !== K || re || (w.value = 1, l.value = "open", await Me(), b !== K || re)) return;
2329
+ const M = ge.take();
2330
+ M.kind === "pointer" && i.gesturesEnabled && (W().onPointerDown(M.down, T(), M.target), W().onPointerMove(M.latest)), W().core.renderNow(), await Pe(), !(b !== K || re) && (g.value = !1, pe.cancel(), Se(), a("opened", s), await Pe(), !(b !== K || re || l.value !== "open") && (Z.value = !0, Ae(s)));
2331
+ }
2332
+ function N() {
2333
+ return l.value === "closed" || l.value === "closing" || (be = G()), be;
2334
+ }
2335
+ async function G() {
2336
+ ge.clear(), z.grab();
2337
+ const s = w.value, b = l.value === "opening", M = !b && W().readiness === "ready" ? W().retainFrame() : {
2338
+ image: J.value.kind === "image" && _.value.id === ie ? J.value.image : xt(),
2339
+ scale: 1,
2340
+ release: () => {
2341
+ }
2342
+ };
2343
+ he = M.release;
2344
+ try {
2345
+ let U = b ? { kind: "opening" } : { kind: "captured", frame: Y(M.scale) };
2346
+ b || W().core.cancelGesture(!0);
2347
+ const ne = ++K, Ue = b ? pe.reverseOpening() : { kind: "inactive" };
2348
+ Ue.kind === "inactive" && pe.cancel(), z.cancel(), y.value = !1, l.value = "closing", a("closing");
1933
2349
  try {
1934
- const S = await o.resolveAnchor(W.value);
1935
- if (x !== G) return;
1936
- const O = St(S, W.value, Ge());
1937
- se = O, Y.value = ta(O), _.value = Y.value.kind === "image" || j().readiness === "ready";
1938
- const ce = _e();
1939
- if (O.kind === "element") {
1940
- const He = j().readiness === "ready" ? j().core.mediaRef.value : Y.value.kind === "image" ? Y.value.image : kt();
1941
- if (k.value = !0, await ye(), x !== G || Q) return;
1942
- Ke(O), await ge.play(
1943
- I.value,
1944
- w.value,
1945
- He,
1946
- O.frame,
1947
- $t(W.value, ce, "contain"),
1948
- O.viewport,
1949
- u.value,
1950
- !0,
1951
- 0,
1952
- o.transitionDuration
2350
+ if (await Me(), ne !== K || re || (document.fullscreenElement === u.value && (await document.exitFullscreen(), await Pe(), await Pe(), U.kind === "captured" && (U.frame = Y(M.scale))), ne !== K || re)) return;
2351
+ const Xe = b ? Ee : await i.resolveAnchor(_.value);
2352
+ if (ne !== K || re) return;
2353
+ const Je = b ? Ee : Rt(Xe, _.value, c());
2354
+ if (Ue.kind === "reversing")
2355
+ await Ue.finished;
2356
+ else if (U.kind === "captured" && Je.kind === "element") {
2357
+ const Nt = M.image;
2358
+ Ye(Je), g.value = !0, await Me(), await pe.play(
2359
+ q.value,
2360
+ v.value,
2361
+ Nt,
2362
+ U.frame,
2363
+ Je.frame,
2364
+ Je.viewport,
2365
+ k.value,
2366
+ !1,
2367
+ s,
2368
+ i.closeDuration
1953
2369
  );
1954
2370
  } else
1955
- h.value = 1, k.value = !1, await Z(!0);
1956
- } catch (S) {
1957
- if (x !== G) return;
1958
- i("error", Ae(S), W.value);
2371
+ g.value = !1, await we(!1);
2372
+ } catch (Xe) {
2373
+ a("error", _e(Xe), _.value), await we(!1);
1959
2374
  }
1960
- x !== G || Q || (h.value = 1, s.value = "open", await ye(), !(x !== G || Q) && (j().core.renderNow(), await Ee(), !(x !== G || Q) && (k.value = !1, ge.cancel(), xe(), i("opened", l), await Ee(), !(x !== G || Q || s.value !== "open") && (N.value = !0, Fe(l)))));
1961
- }
1962
- }
1963
- function F() {
1964
- return s.value === "closed" || s.value === "closing" || ($e = X()), $e;
1965
- }
1966
- async function X() {
1967
- D.grab();
1968
- const l = h.value, x = s.value === "opening", S = !x && j().readiness === "ready" ? j().captureFrame() : {
1969
- image: Y.value.kind === "image" && W.value.id === Pe ? Y.value.image : kt(),
1970
- scale: 1
1971
- };
1972
- let O = x ? { kind: "opening" } : { kind: "captured", frame: Ve(S.scale) };
1973
- x || j().core.cancelGesture(!0);
1974
- const ce = ++G, He = x ? ge.reverseOpening() : { kind: "inactive" };
1975
- He.kind === "inactive" && ge.cancel(), D.cancel(), M.value = !1, s.value = "closing", i("closing");
1976
- try {
1977
- if (await ye(), ce !== G || Q || (document.fullscreenElement === f.value && (await document.exitFullscreen(), await Ee(), await Ee(), O.kind === "captured" && (O.frame = Ve(S.scale))), ce !== G || Q)) return;
1978
- const dt = x ? se : await o.resolveAnchor(W.value);
1979
- if (ce !== G || Q) return;
1980
- const et = x ? se : St(dt, W.value, Ge());
1981
- if (He.kind === "reversing")
1982
- await He.finished;
1983
- else if (O.kind === "captured" && et.kind === "element") {
1984
- const Dt = S.image;
1985
- Ke(et), k.value = !0, await ye(), await ge.play(
1986
- I.value,
1987
- w.value,
1988
- Dt,
1989
- O.frame,
1990
- et.frame,
1991
- et.viewport,
1992
- u.value,
1993
- !1,
1994
- l,
1995
- o.closeDuration
1996
- );
1997
- } else
1998
- k.value = !1, await Z(!1);
1999
- } catch (dt) {
2000
- i("error", Ae(dt), W.value), await Z(!1);
2375
+ if (ne !== K || re) return;
2376
+ ze.disconnect(), me = "", ve = "", w.value = 0, l.value = "closed", J.value = Re, oe.clear(), se.clear(), Se(), document.body.style.overflow = ke, a("close"), await Me(), pe.cancel();
2377
+ } finally {
2378
+ M.release(), he === M.release && (he = () => {
2379
+ });
2001
2380
  }
2002
- ce !== G || Q || (Me.disconnect(), ve = "", me = "", h.value = 0, s.value = "closed", Y.value = ke, fe.clear(), K.clear(), xe(), document.body.style.overflow = pe, i("close"), await ye(), ge.cancel());
2003
2381
  }
2004
- async function Z(l) {
2005
- const x = ++he, S = l ? 0 : Number(getComputedStyle(f.value).opacity);
2006
- ne.kind === "active" && ne.animation.cancel(), f.value.style.opacity = String(S);
2007
- const O = f.value.animate([{ opacity: S }, { opacity: l ? 1 : 0 }], {
2382
+ async function we(s) {
2383
+ const b = ++Be, M = s ? 0 : Number(getComputedStyle(u.value).opacity);
2384
+ ye.kind === "active" && ye.animation.cancel(), u.value.style.opacity = String(M);
2385
+ const U = u.value.animate([{ opacity: M }, { opacity: s ? 1 : 0 }], {
2008
2386
  duration: matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : 180,
2009
2387
  fill: "forwards"
2010
2388
  });
2011
- ne = { kind: "active", animation: O }, await O.finished.catch(() => {
2012
- }), !(x !== he || Q) && (f.value.style.opacity = l ? "1" : "0", O.cancel(), ne = { kind: "idle" });
2389
+ ye = { kind: "active", animation: U }, await U.finished.catch(() => {
2390
+ }), !(b !== Be || re) && (u.value.style.opacity = s ? "1" : "0", U.cancel(), ye = { kind: "idle" });
2013
2391
  }
2014
- async function ae() {
2392
+ async function xe() {
2015
2393
  if (document.fullscreenEnabled)
2016
2394
  try {
2017
- document.fullscreenElement === f.value ? await document.exitFullscreen() : await f.value.requestFullscreen();
2018
- } catch (l) {
2019
- i("error", Ae(l), W.value);
2395
+ document.fullscreenElement === u.value ? await document.exitFullscreen() : await u.value.requestFullscreen();
2396
+ } catch (s) {
2397
+ a("error", _e(s), _.value);
2020
2398
  }
2021
2399
  }
2022
- function oe(l) {
2023
- s.value !== "open" || !o.gesturesEnabled || j().onPointerDown(l, _e()) && D.grab();
2400
+ function Ce(s) {
2401
+ if (i.gesturesEnabled) {
2402
+ if (l.value === "opening") {
2403
+ ge.start(s);
2404
+ return;
2405
+ }
2406
+ l.value === "open" && W().onPointerDown(s, T()) && z.grab();
2407
+ }
2408
+ }
2409
+ function Qe(s) {
2410
+ if (l.value === "opening") {
2411
+ i.gesturesEnabled && ge.finish(s, T()) && N();
2412
+ return;
2413
+ }
2414
+ l.value === "open" && (W().onPointerUp(s), l.value === "open" && z.resume());
2024
2415
  }
2025
- function we(l) {
2026
- s.value === "open" && (j().onPointerUp(l), s.value === "open" && D.resume());
2416
+ function ht(s) {
2417
+ ge.clear(), l.value === "open" && (W().onPointerCancel(s), l.value === "open" && z.resume());
2027
2418
  }
2028
- function re(l) {
2029
- s.value === "open" && (j().onPointerCancel(l), s.value === "open" && D.resume());
2419
+ function Vt(s) {
2420
+ l.value === "opening" && ge.clear(), l.value === "open" && s.target === W().core.containerRef.value && ht(s);
2030
2421
  }
2031
- function be(l) {
2032
- s.value === "open" && j().onPointerMove(l);
2422
+ function _t(s) {
2423
+ l.value === "opening" && ge.move(s), l.value === "open" && W().onPointerMove(s);
2033
2424
  }
2034
- function Qe(l) {
2035
- s.value === "open" && o.gesturesEnabled && j().onWheel(l);
2425
+ function Yt(s) {
2426
+ l.value === "open" && i.gesturesEnabled && W().onWheel(s);
2036
2427
  }
2037
- function Ye(l) {
2038
- s.value === "open" && (h.value = 1 - l);
2428
+ function Ut(s) {
2429
+ l.value === "open" && (w.value = 1 - s);
2039
2430
  }
2040
- function Je(l) {
2041
- s.value === "open" && D.drag(l);
2431
+ function Xt(s) {
2432
+ l.value === "open" && z.drag(s);
2042
2433
  }
2043
- function Tt(l, x) {
2044
- s.value === "open" && (M.value = !1, D.release(l, x));
2434
+ function Ht(s, b) {
2435
+ l.value === "open" && (y.value = !1, z.release(s, b));
2045
2436
  }
2046
- function Bt(l) {
2047
- E.value = l, l > 1.02 && !o.persistentChrome && (d.value = !1);
2437
+ function Wt(s) {
2438
+ $.value = s, s > 1.02 && !i.persistentChrome && (E.value = !1);
2048
2439
  }
2049
- function ht(l) {
2050
- if (!(s.value === "closed" || !o.keyboardEnabled) && !(l.key === "Escape" && document.fullscreenElement === f.value)) {
2051
- if (l.key === "Escape") {
2052
- l.preventDefault(), F();
2440
+ function vt(s) {
2441
+ if (!(l.value === "closed" || !i.keyboardEnabled) && !(s.key === "Escape" && document.fullscreenElement === u.value)) {
2442
+ if (s.key === "Escape") {
2443
+ s.preventDefault(), N();
2053
2444
  return;
2054
2445
  }
2055
- if (!(s.value !== "open" || l.target.matches("input, textarea, select, button, [role='slider']"))) {
2056
- if (W.value.type === "video") {
2057
- if (l.code === "Space") {
2058
- l.preventDefault(), j().togglePlayback();
2446
+ if (!(l.value !== "open" || s.target.matches("input, textarea, select, button, [role='slider']"))) {
2447
+ if (_.value.type === "video") {
2448
+ if (s.code === "Space") {
2449
+ s.preventDefault(), W().togglePlayback();
2059
2450
  return;
2060
2451
  }
2061
- if (l.key === "Enter") {
2062
- l.preventDefault(), j().toggleFullscreen();
2452
+ if (s.key === "Enter") {
2453
+ s.preventDefault(), W().toggleFullscreen();
2063
2454
  return;
2064
2455
  }
2065
2456
  }
2066
- if (W.value.type === "live-photo" && l.code === "Space") {
2067
- l.preventDefault(), te.toggleLive();
2457
+ if (_.value.type === "live-photo" && s.code === "Space") {
2458
+ s.preventDefault(), te.toggleLive();
2068
2459
  return;
2069
2460
  }
2070
- l.key === "ArrowLeft" && (l.preventDefault(), D.go(-1)), l.key === "ArrowRight" && (l.preventDefault(), D.go(1)), (l.key === "+" || l.key === "=") && te.zoomIn(), l.key === "-" && te.zoomOut(), l.key === "0" && te.reset();
2461
+ s.key === "ArrowLeft" && (s.preventDefault(), z.go(-1)), s.key === "ArrowRight" && (s.preventDefault(), z.go(1)), (s.key === "+" || s.key === "=") && te.zoomIn(), s.key === "-" && te.zoomOut(), s.key === "0" && te.reset();
2071
2462
  }
2072
2463
  }
2073
2464
  }
2074
- return ze(() => {
2075
- document.addEventListener("keydown", ht);
2076
- }), Re(() => {
2077
- Q = !0, G += 1, ge.cancel(), he += 1, ne.kind === "active" && ne.animation.cancel(), xe(), Me.disconnect(), document.removeEventListener("keydown", ht), s.value !== "closed" && (document.body.style.overflow = pe);
2078
- }), t({
2079
- open: c,
2465
+ return qe(() => {
2466
+ document.addEventListener("keydown", vt);
2467
+ }), $e(() => {
2468
+ re = !0, K += 1, pe.cancel(), he(), ge.clear(), Be += 1, ye.kind === "active" && ye.animation.cancel(), Se(), ze.disconnect(), document.removeEventListener("keydown", vt), l.value !== "closed" && (document.body.style.overflow = ke);
2469
+ }), n({
2470
+ open: j,
2080
2471
  ...te,
2081
- currentIndex: q,
2082
- phase: s,
2083
- element: f,
2084
- mediaElement: () => j().core.mediaRef.value,
2085
- canvasElement: () => j().core.canvasRef.value
2086
- }), (l, x) => (z(), rt(Ct, {
2472
+ currentIndex: V,
2473
+ phase: l,
2474
+ element: u,
2475
+ mediaElement: () => W().core.mediaRef.value,
2476
+ canvasElement: () => W().core.canvasRef.value
2477
+ }), (s, b) => (O(), at(Ct, {
2087
2478
  to: "body",
2088
- disabled: l.teleportDisabled
2479
+ disabled: s.teleportDisabled
2089
2480
  }, [
2090
- s.value !== "closed" ? (z(), H("div", Ue({
2481
+ l.value !== "closed" ? (O(), A("div", We({
2091
2482
  key: 0,
2092
2483
  ref_key: "root",
2093
- ref: f
2094
- }, g(n), {
2095
- class: ["mp-viewer", { "is-mobile": l.mobile, "is-album": l.appearance === "album" }],
2484
+ ref: u
2485
+ }, f(e), {
2486
+ class: ["mp-viewer", { "is-mobile": s.mobile, "is-album": s.appearance === "album" }],
2096
2487
  role: "dialog",
2097
2488
  "aria-modal": "true",
2098
- "aria-label": W.value.title,
2099
- "data-phase": s.value,
2100
- "data-chrome": d.value ? "visible" : "hidden",
2101
- inert: s.value === "closing",
2102
- onPointerdown: oe,
2103
- onPointermove: be,
2104
- onPointerup: we,
2105
- onPointercancel: re,
2106
- onLostpointercapture: re,
2107
- onWheel: Qe
2489
+ "aria-label": _.value.title,
2490
+ "data-phase": l.value,
2491
+ "data-chrome": E.value ? "visible" : "hidden",
2492
+ inert: l.value === "closing",
2493
+ onPointerdown: Ce,
2494
+ onPointermove: _t,
2495
+ onPointerup: Qe,
2496
+ onPointercancel: ht,
2497
+ onLostpointercapture: Vt,
2498
+ onWheel: Yt
2108
2499
  }), [
2109
- $("div", {
2500
+ B("div", {
2110
2501
  ref_key: "backdrop",
2111
- ref: u,
2502
+ ref: k,
2112
2503
  class: "mp-viewer__backdrop",
2113
- style: Se({ opacity: h.value })
2504
+ style: Le({ opacity: w.value })
2114
2505
  }, null, 4),
2115
- $("div", {
2506
+ B("div", {
2116
2507
  id: r,
2117
2508
  class: "mp-viewer__video-controls"
2118
2509
  }),
2119
- $("div", {
2510
+ B("div", {
2120
2511
  ref_key: "mediaViewport",
2121
- ref: y,
2122
- class: qe(["mp-viewer__pages", { "is-transitioning": k.value }])
2512
+ ref: p,
2513
+ class: Ie(["mp-viewer__pages", { "is-transitioning": g.value }])
2123
2514
  }, [
2124
- (z(!0), H(De, null, ot(je.value, (S) => (z(), H("div", {
2125
- key: l.items[S].id,
2515
+ (O(!0), A(Fe, null, Ne(Ge.value, (M) => (O(), A("div", {
2516
+ key: s.items[M].id,
2126
2517
  ref_for: !0,
2127
- ref: Ze(l.items[S].id),
2518
+ ref: ce(s.items[M].id),
2128
2519
  class: "mp-viewer__page",
2129
- style: Se({
2130
- transform: `translate3d(${(S - g(q)) * g(D).stride() + g(D).state.offset}px,0,0)`,
2131
- transition: g(D).state.settling ? `transform ${g(D).state.duration}ms cubic-bezier(.22,.61,.36,1)` : "none"
2520
+ style: Le({
2521
+ transform: `translate3d(${(M - f(V)) * f(z).stride() + f(z).state.offset}px,0,0)`,
2522
+ transition: f(z).state.settling ? `transform ${f(z).state.duration}ms cubic-bezier(.22,.61,.36,1)` : "none"
2132
2523
  }),
2133
- "aria-hidden": S !== g(q),
2134
- inert: S !== g(q),
2135
- "data-media-id": l.items[S].id
2524
+ "aria-hidden": M !== f(V),
2525
+ inert: M !== f(V),
2526
+ "data-media-id": s.items[M].id
2136
2527
  }, [
2137
- Be(Va, {
2528
+ De(ga, {
2138
2529
  ref_for: !0,
2139
- ref: Oe(l.items[S].id),
2140
- media: l.items[S],
2141
- "video-loader": l.videoLoader,
2142
- rendering: s.value === "open",
2143
- paging: g(D).state.dragging || g(D).state.preparing || g(D).state.settling || g(D).state.grabbed,
2530
+ ref: de(s.items[M].id),
2531
+ media: s.items[M],
2532
+ "video-loader": s.videoLoader,
2533
+ rendering: l.value === "open",
2534
+ paging: f(z).state.dragging || f(z).state.preparing || f(z).state.settling || f(z).state.grabbed,
2144
2535
  "external-gestures": "",
2145
- active: S === g(q),
2146
- disabled: s.value !== "open" || !l.gesturesEnabled,
2147
- "inactive-reset-duration": g(D).state.duration,
2148
- "resource-policy": l.resourcePolicy,
2149
- "resolve-source": l.resolveImageSource,
2150
- "request-version": S === g(q) ? g(P) : 0,
2151
- "load-enabled": S === g(q) ? N.value && s.value === "open" : s.value === "open" && !k.value && g(p) === W.value.id,
2536
+ active: M === f(V),
2537
+ disabled: l.value !== "open" || !s.gesturesEnabled,
2538
+ "inactive-reset-duration": f(z).state.duration,
2539
+ "resource-policy": s.resourcePolicy,
2540
+ "resolve-source": s.resolveImageSource,
2541
+ "request-version": M === f(V) ? f(R) : 0,
2542
+ "load-enabled": M === f(V) ? Z.value && l.value === "open" : l.value === "open" && !g.value && f(x) === _.value.id,
2152
2543
  "teleport-controls": "",
2153
2544
  "controls-target": `#${r}`,
2154
- "controls-visible": d.value && h.value === 1,
2155
- "initial-image": l.items[S].id === g(Pe) ? Y.value : g(ke),
2156
- quality: S === g(q) && g(b).has(l.items[S].id) ? "full" : S === g(q) ? "screen" : "thumbnail",
2157
- "live-playing": M.value,
2158
- onTap: ct,
2159
- onScale: Bt,
2160
- onPageDrag: Je,
2161
- onPageRelease: Tt,
2162
- onClose: F,
2163
- onSwipeDownProgress: Ye,
2164
- onLiveState: (O) => {
2165
- S === g(q) && (C.value = O);
2545
+ "controls-visible": E.value && w.value === 1,
2546
+ "initial-image": s.items[M].id === f(ie) ? J.value : f(Re),
2547
+ quality: M === f(V) && f(S).has(s.items[M].id) ? "full" : M === f(V) ? "screen" : "thumbnail",
2548
+ "live-playing": y.value,
2549
+ onTap: st,
2550
+ onScale: Wt,
2551
+ onPageDrag: Xt,
2552
+ onPageRelease: Ht,
2553
+ onClose: N,
2554
+ onSwipeDownProgress: Ut,
2555
+ onLiveState: (U) => {
2556
+ M === f(V) && (h.value = U);
2166
2557
  },
2167
2558
  onLiveEnded: () => {
2168
- S === g(q) && (M.value = !1);
2559
+ M === f(V) && (y.value = !1);
2169
2560
  },
2170
- onReady: (O) => Te(S, O),
2171
- onOriginalState: (O, ce) => st(S, O, ce),
2172
- onError: (O) => i("error", O, l.items[S])
2561
+ onReady: (U) => ot(M, U),
2562
+ onOriginalState: (U, ne) => rt(M, U, ne),
2563
+ onError: (U) => a("error", U, s.items[M])
2173
2564
  }, null, 8, ["media", "video-loader", "rendering", "paging", "active", "disabled", "inactive-reset-duration", "resource-policy", "resolve-source", "request-version", "load-enabled", "controls-target", "controls-visible", "initial-image", "quality", "live-playing", "onLiveState", "onLiveEnded", "onReady", "onOriginalState", "onError"])
2174
- ], 12, ja))), 128))
2565
+ ], 12, ka))), 128))
2175
2566
  ], 2),
2176
- Vt($("div", {
2567
+ en(B("div", {
2177
2568
  ref_key: "transitionMask",
2178
- ref: w,
2569
+ ref: v,
2179
2570
  class: "mp-shared-clip",
2180
2571
  "aria-hidden": "true"
2181
2572
  }, [
2182
- $("canvas", {
2573
+ B("canvas", {
2183
2574
  ref_key: "transitionCanvas",
2184
- ref: I,
2575
+ ref: q,
2185
2576
  class: "mp-shared-transition"
2186
2577
  }, null, 512)
2187
2578
  ], 512), [
2188
- [Yt, k.value]
2579
+ [tn, g.value]
2189
2580
  ]),
2190
- s.value === "opening" && !_.value ? (z(), H("div", Ka, Qa)) : ie("", !0),
2191
- $("div", {
2192
- class: qe(["mp-viewer__chrome", { "is-hidden": !d.value || s.value !== "open" || h.value < 1 }]),
2193
- inert: !d.value || s.value !== "open" || h.value < 1
2581
+ l.value === "opening" && !H.value ? (O(), A("div", xa, Sa)) : le("", !0),
2582
+ B("div", {
2583
+ class: Ie(["mp-viewer__chrome", { "is-hidden": !E.value || l.value !== "open" || w.value < 1 }]),
2584
+ inert: !E.value || l.value !== "open" || w.value < 1
2194
2585
  }, [
2195
- ft(l.$slots, "toolbar", {
2196
- media: W.value,
2197
- index: g(q),
2198
- total: l.items.length,
2199
- scale: E.value,
2586
+ ut(s.$slots, "toolbar", {
2587
+ media: _.value,
2588
+ index: f(V),
2589
+ total: s.items.length,
2590
+ scale: $.value,
2200
2591
  controls: te,
2201
- originalStatus: g(B),
2202
- originalReason: g(L),
2203
- livePlaying: M.value,
2204
- liveStatus: C.value
2592
+ originalStatus: f(C),
2593
+ originalReason: f(P),
2594
+ livePlaying: y.value,
2595
+ liveStatus: h.value
2205
2596
  }, () => [
2206
- $("header", en, [
2207
- $("button", {
2597
+ B("header", Ra, [
2598
+ B("button", {
2208
2599
  type: "button",
2209
2600
  "aria-label": "关闭预览",
2210
- onClick: F
2601
+ onClick: N
2211
2602
  }, "‹"),
2212
- $("div", tn, [
2213
- $("strong", null, le(W.value.title), 1),
2214
- $("span", null, le(g(q) + 1) + " / " + le(l.items.length), 1)
2603
+ B("div", Ea, [
2604
+ B("strong", null, fe(_.value.title), 1),
2605
+ B("span", null, fe(f(V) + 1) + " / " + fe(s.items.length), 1)
2215
2606
  ]),
2216
- $("button", {
2607
+ B("button", {
2217
2608
  type: "button",
2218
2609
  "aria-label": "旋转图片",
2219
- disabled: W.value.type === "video",
2220
- onClick: x[0] || (x[0] = (S) => te.rotate())
2221
- }, " ↻ ", 8, an)
2610
+ disabled: _.value.type === "video",
2611
+ onClick: b[0] || (b[0] = (M) => te.rotate())
2612
+ }, " ↻ ", 8, Ca)
2222
2613
  ]),
2223
- $("footer", nn, [
2224
- W.value.type !== "video" ? (z(), H(De, { key: 0 }, [
2225
- $("button", {
2614
+ B("footer", La, [
2615
+ _.value.type !== "video" ? (O(), A(Fe, { key: 0 }, [
2616
+ B("button", {
2226
2617
  type: "button",
2227
2618
  "aria-label": "缩小",
2228
- onClick: x[1] || (x[1] = //@ts-ignore
2229
- (...S) => te.zoomOut && te.zoomOut(...S))
2619
+ onClick: b[1] || (b[1] = //@ts-ignore
2620
+ (...M) => te.zoomOut && te.zoomOut(...M))
2230
2621
  }, "−"),
2231
- $("button", {
2622
+ B("button", {
2232
2623
  type: "button",
2233
2624
  "aria-label": "放大",
2234
- onClick: x[2] || (x[2] = //@ts-ignore
2235
- (...S) => te.zoomIn && te.zoomIn(...S))
2625
+ onClick: b[2] || (b[2] = //@ts-ignore
2626
+ (...M) => te.zoomIn && te.zoomIn(...M))
2236
2627
  }, "+"),
2237
- $("button", {
2628
+ B("button", {
2238
2629
  type: "button",
2239
2630
  "aria-label": "复位",
2240
- onClick: x[3] || (x[3] = //@ts-ignore
2241
- (...S) => te.reset && te.reset(...S))
2631
+ onClick: b[3] || (b[3] = //@ts-ignore
2632
+ (...M) => te.reset && te.reset(...M))
2242
2633
  }, "复位")
2243
- ], 64)) : ie("", !0),
2244
- $("button", {
2634
+ ], 64)) : le("", !0),
2635
+ B("button", {
2245
2636
  type: "button",
2246
2637
  "aria-label": "图片详情",
2247
- onClick: x[4] || (x[4] = //@ts-ignore
2248
- (...S) => te.toggleDetail && te.toggleDetail(...S))
2638
+ onClick: b[4] || (b[4] = //@ts-ignore
2639
+ (...M) => te.toggleDetail && te.toggleDetail(...M))
2249
2640
  }, "ⓘ")
2250
2641
  ])
2251
2642
  ]),
2252
- !l.mobile && g(q) > 0 ? (z(), H("button", {
2643
+ !s.mobile && f(V) > 0 ? (O(), A("button", {
2253
2644
  key: 0,
2254
2645
  class: "mp-viewer__arrow is-left",
2255
2646
  "aria-label": "上一张",
2256
- onClick: x[5] || (x[5] = (S) => g(D).go(-1))
2257
- }, " ‹ ")) : ie("", !0),
2258
- !l.mobile && g(q) < l.items.length - 1 ? (z(), H("button", {
2647
+ onClick: b[5] || (b[5] = (M) => f(z).go(-1))
2648
+ }, " ‹ ")) : le("", !0),
2649
+ !s.mobile && f(V) < s.items.length - 1 ? (O(), A("button", {
2259
2650
  key: 1,
2260
2651
  class: "mp-viewer__arrow is-right",
2261
2652
  "aria-label": "下一张",
2262
- onClick: x[6] || (x[6] = (S) => g(D).go(1))
2263
- }, " › ")) : ie("", !0),
2264
- $("div", on, le(g(q) + 1) + " / " + le(l.items.length), 1)
2265
- ], 10, Ja),
2266
- A.value ? (z(), H("aside", rn, [
2267
- $("button", {
2653
+ onClick: b[6] || (b[6] = (M) => f(z).go(1))
2654
+ }, " › ")) : le("", !0),
2655
+ B("div", Fa, fe(f(V) + 1) + " / " + fe(s.items.length), 1)
2656
+ ], 10, Pa),
2657
+ D.value ? (O(), A("aside", $a, [
2658
+ B("button", {
2268
2659
  type: "button",
2269
2660
  "aria-label": "关闭详情",
2270
- onClick: x[7] || (x[7] = (S) => A.value = !1)
2661
+ onClick: b[7] || (b[7] = (M) => D.value = !1)
2271
2662
  }, "×"),
2272
- $("strong", null, le(W.value.title), 1),
2273
- $("span", null, le(W.value.width) + " × " + le(W.value.height), 1),
2274
- $("span", null, le(W.value.type) + " · " + le(E.value.toFixed(2)) + "×", 1)
2275
- ])) : ie("", !0)
2276
- ], 16, Za)) : ie("", !0)
2663
+ B("strong", null, fe(_.value.title), 1),
2664
+ B("span", null, fe(_.value.width) + " × " + fe(_.value.height), 1),
2665
+ B("span", null, fe(_.value.type) + " · " + fe($.value.toFixed(2)) + "×", 1)
2666
+ ])) : le("", !0)
2667
+ ], 16, ba)) : le("", !0)
2277
2668
  ], 8, ["disabled"]));
2278
2669
  }
2279
2670
  });
2280
- function ln(a, t, e, n = 2) {
2281
- const o = Math.max(1, (t - n * (e - 1)) / e), i = [], s = /* @__PURE__ */ new Map();
2282
- let r = 0, f = 0;
2283
- return a.forEach((y, m) => {
2284
- m > 0 && (i.push({ kind: "header", group: m, first: 0, count: 0, start: r, end: r + 52 }), r += 52);
2285
- for (let b = 0; b < y.items.length; b += e) {
2286
- const B = Math.min(e, y.items.length - b), L = i.length;
2287
- i.push({ kind: "items", group: m, first: b, count: B, start: r, end: r + o });
2288
- for (let P = 0; P < B; P++) s.set(y.items[b + P].id, L);
2289
- f += B, r += o + (b + B < y.items.length ? n : 0);
2290
- }
2291
- }), { rows: i, locations: s, height: r, size: o, total: f };
2671
+ function Ta(t, n, o, e = 2) {
2672
+ const i = Math.max(1, (n - e * (o - 1)) / o), a = [], l = /* @__PURE__ */ new Map();
2673
+ let r = 0, u = 0;
2674
+ return t.forEach((p, d) => {
2675
+ d > 0 && (a.push({ kind: "header", group: d, first: 0, count: 0, start: r, end: r + 52 }), r += 52);
2676
+ for (let S = 0; S < p.items.length; S += o) {
2677
+ const C = Math.min(o, p.items.length - S), P = a.length;
2678
+ a.push({ kind: "items", group: d, first: S, count: C, start: r, end: r + i });
2679
+ for (let R = 0; R < C; R++) l.set(p.items[S + R].id, P);
2680
+ u += C, r += i + (S + C < p.items.length ? e : 0);
2681
+ }
2682
+ }), { rows: a, locations: l, height: r, size: i, total: u };
2292
2683
  }
2293
- function Pt(a, t) {
2294
- let e = 0, n = a.length;
2295
- for (; e < n; ) {
2296
- const o = e + n >>> 1;
2297
- a[o].end < t ? e = o + 1 : n = o;
2684
+ function Et(t, n) {
2685
+ let o = 0, e = t.length;
2686
+ for (; o < e; ) {
2687
+ const i = o + e >>> 1;
2688
+ t[i].end < n ? o = i + 1 : e = i;
2298
2689
  }
2299
- return Math.min(e, Math.max(0, a.length - 1));
2690
+ return Math.min(o, Math.max(0, t.length - 1));
2300
2691
  }
2301
- const sn = ["data-total-items", "data-rendered-items"], un = /* @__PURE__ */ Le({
2692
+ const Ba = ["data-total-items", "data-rendered-items"], za = /* @__PURE__ */ Te({
2302
2693
  __name: "VirtualTimeline",
2303
2694
  props: {
2304
2695
  groups: {},
@@ -2307,97 +2698,97 @@ const sn = ["data-total-items", "data-rendered-items"], un = /* @__PURE__ */ Le(
2307
2698
  hasMore: { type: Boolean, default: !1 }
2308
2699
  },
2309
2700
  emits: ["loadMore", "date"],
2310
- setup(a, { expose: t, emit: e }) {
2311
- const n = a, o = e, i = R(), s = R(390), r = R(844), f = R(0), y = U(
2312
- () => n.mobile ? s.value >= 640 ? 5 : s.value >= 480 ? 4 : 3 : Math.max(1, Math.floor((s.value + 2) / 172))
2313
- ), m = U(() => ln(n.groups, s.value, y.value)), b = U(() => {
2314
- const u = m.value.rows, k = Pt(u, Math.max(0, f.value - m.value.size * 3)), h = f.value + r.value + m.value.size * 3;
2315
- let d = k;
2316
- for (; d < u.length && u[d].start <= h; ) d++;
2317
- return u.slice(k, d);
2318
- }), B = U(() => b.value.reduce((u, k) => u + k.count, 0));
2319
- let L = 0, P = !1, p = () => {
2701
+ setup(t, { expose: n, emit: o }) {
2702
+ const e = t, i = o, a = L(), l = L(390), r = L(844), u = L(0), p = X(
2703
+ () => e.mobile ? l.value >= 640 ? 5 : l.value >= 480 ? 4 : 3 : Math.max(1, Math.floor((l.value + 2) / 172))
2704
+ ), d = X(() => Ta(e.groups, l.value, p.value)), S = X(() => {
2705
+ const k = d.value.rows, g = Et(k, Math.max(0, u.value - d.value.size * 3)), w = u.value + r.value + d.value.size * 3;
2706
+ let E = g;
2707
+ for (; E < k.length && k[E].start <= w; ) E++;
2708
+ return k.slice(g, E);
2709
+ }), C = X(() => S.value.reduce((k, g) => k + g.count, 0));
2710
+ let P = 0, R = !1, x = () => {
2320
2711
  };
2321
- function v() {
2322
- const u = n.scrollElement();
2323
- s.value = u.clientWidth, r.value = u.clientHeight, f.value = u.scrollTop, m.value.rows.length > 0 && o("date", n.groups[m.value.rows[Pt(m.value.rows, f.value)].group].key);
2324
- const k = f.value + r.value >= m.value.height - m.value.size * 3;
2325
- k && n.hasMore && !P && (P = !0, o("loadMore")), k || (P = !1);
2712
+ function m() {
2713
+ const k = e.scrollElement();
2714
+ l.value = k.clientWidth, r.value = k.clientHeight, u.value = k.scrollTop, d.value.rows.length > 0 && i("date", e.groups[d.value.rows[Et(d.value.rows, u.value)].group].key);
2715
+ const g = u.value + r.value >= d.value.height - d.value.size * 3;
2716
+ g && e.hasMore && !R && (R = !0, i("loadMore")), g || (R = !1);
2326
2717
  }
2327
- function T() {
2328
- L === 0 && (L = requestAnimationFrame(() => {
2329
- L = 0, v();
2718
+ function F() {
2719
+ P === 0 && (P = requestAnimationFrame(() => {
2720
+ P = 0, m();
2330
2721
  }));
2331
2722
  }
2332
- const I = new ResizeObserver(v);
2333
- ze(() => {
2334
- const u = n.scrollElement(), k = u.style.overflowAnchor;
2335
- u.style.overflowAnchor = "none", p = () => {
2336
- u.style.overflowAnchor = k;
2337
- }, u.addEventListener("scroll", T, { passive: !0 }), I.observe(u), v();
2338
- }), Re(() => {
2339
- n.scrollElement().removeEventListener("scroll", T), I.disconnect(), cancelAnimationFrame(L), p();
2723
+ const q = new ResizeObserver(m);
2724
+ qe(() => {
2725
+ const k = e.scrollElement(), g = k.style.overflowAnchor;
2726
+ k.style.overflowAnchor = "none", x = () => {
2727
+ k.style.overflowAnchor = g;
2728
+ }, k.addEventListener("scroll", F, { passive: !0 }), q.observe(k), m();
2729
+ }), $e(() => {
2730
+ e.scrollElement().removeEventListener("scroll", F), q.disconnect(), cancelAnimationFrame(P), x();
2340
2731
  }), ee(
2341
- () => n.groups,
2732
+ () => e.groups,
2342
2733
  () => {
2343
- P = !1, ye(v);
2734
+ R = !1, Me(m);
2344
2735
  }
2345
2736
  );
2346
- async function w(u) {
2347
- if (!m.value.locations.has(u)) return { kind: "unavailable" };
2348
- const k = m.value.rows[m.value.locations.get(u)], h = n.scrollElement();
2349
- return (k.start < h.scrollTop || k.end > h.scrollTop + h.clientHeight) && (h.scrollTop = Math.max(0, k.start - (h.clientHeight - m.value.size) / 2)), v(), await ye(), await new Promise((M) => requestAnimationFrame(() => M())), { kind: "element", element: [...i.value.querySelectorAll("[data-id]")].find(
2350
- (M) => M.dataset.id === u
2737
+ async function v(k) {
2738
+ if (!d.value.locations.has(k)) return { kind: "unavailable" };
2739
+ const g = d.value.rows[d.value.locations.get(k)], w = e.scrollElement();
2740
+ return (g.start < w.scrollTop || g.end > w.scrollTop + w.clientHeight) && (w.scrollTop = Math.max(0, g.start - (w.clientHeight - d.value.size) / 2)), m(), await Me(), await new Promise((y) => requestAnimationFrame(() => y())), { kind: "element", element: [...a.value.querySelectorAll("[data-id]")].find(
2741
+ (y) => y.dataset.id === k
2351
2742
  ).querySelector("img") };
2352
2743
  }
2353
- return t({ resolveAnchor: w, rendered: B, total: U(() => m.value.total) }), (u, k) => (z(), H("div", {
2744
+ return n({ resolveAnchor: v, rendered: C, total: X(() => d.value.total) }), (k, g) => (O(), A("div", {
2354
2745
  ref_key: "root",
2355
- ref: i,
2746
+ ref: a,
2356
2747
  class: "mp-virtual-timeline",
2357
- style: Se({ height: m.value.height + "px" }),
2358
- "data-total-items": m.value.total,
2359
- "data-rendered-items": B.value
2748
+ style: Le({ height: d.value.height + "px" }),
2749
+ "data-total-items": d.value.total,
2750
+ "data-rendered-items": C.value
2360
2751
  }, [
2361
- (z(!0), H(De, null, ot(b.value, (h) => (z(), H("div", {
2362
- key: u.groups[h.group].key + ":" + h.kind + ":" + h.first,
2752
+ (O(!0), A(Fe, null, Ne(S.value, (w) => (O(), A("div", {
2753
+ key: k.groups[w.group].key + ":" + w.kind + ":" + w.first,
2363
2754
  class: "mp-timeline-row",
2364
- style: Se({
2365
- top: h.start + "px",
2366
- height: h.end - h.start + "px",
2367
- display: h.kind === "items" ? "grid" : "block",
2368
- gridTemplateColumns: `repeat(${y.value},minmax(0,1fr))`,
2755
+ style: Le({
2756
+ top: w.start + "px",
2757
+ height: w.end - w.start + "px",
2758
+ display: w.kind === "items" ? "grid" : "block",
2759
+ gridTemplateColumns: `repeat(${p.value},minmax(0,1fr))`,
2369
2760
  gap: "2px"
2370
2761
  })
2371
2762
  }, [
2372
- h.kind === "header" ? ft(u.$slots, "header", {
2763
+ w.kind === "header" ? ut(k.$slots, "header", {
2373
2764
  key: 0,
2374
- group: u.groups[h.group],
2375
- index: h.group
2376
- }, void 0, !0) : (z(!0), H(De, { key: 1 }, ot(u.groups[h.group].items.slice(h.first, h.first + h.count), (d) => ft(u.$slots, "item", {
2377
- key: d.id,
2378
- item: d
2765
+ group: k.groups[w.group],
2766
+ index: w.group
2767
+ }, void 0, !0) : (O(!0), A(Fe, { key: 1 }, Ne(k.groups[w.group].items.slice(w.first, w.first + w.count), (E) => ut(k.$slots, "item", {
2768
+ key: E.id,
2769
+ item: E
2379
2770
  }, void 0, !0)), 128))
2380
2771
  ], 4))), 128))
2381
- ], 12, sn));
2382
- }
2383
- }), cn = (a, t) => {
2384
- const e = a.__vccOpts || a;
2385
- for (const [n, o] of t)
2386
- e[n] = o;
2387
- return e;
2388
- }, mn = /* @__PURE__ */ cn(un, [["__scopeId", "data-v-05c756fb"]]);
2772
+ ], 12, Ba));
2773
+ }
2774
+ }), Da = (t, n) => {
2775
+ const o = t.__vccOpts || t;
2776
+ for (const [e, i] of n)
2777
+ o[e] = i;
2778
+ return o;
2779
+ }, Aa = /* @__PURE__ */ Da(za, [["__scopeId", "data-v-05c756fb"]]);
2389
2780
  export {
2390
- vt as ImageCanvasRenderer,
2391
- Jt as ImageStore,
2392
- pa as LivePhotoRenderer,
2393
- gn as MediaPreview,
2394
- Va as PreviewStage,
2395
- Oa as VideoDomRenderer,
2396
- mn as VirtualTimeline,
2397
- We as defaultImagePolicy,
2398
- Ne as defaultImageSource,
2399
- Ie as formatVideoTime,
2400
- lt as nativeVideoSource,
2401
- ea as previewImageStore,
2402
- Gt as usePreviewViewport
2781
+ pt as ImageCanvasRenderer,
2782
+ Sn as ImageStore,
2783
+ Yn as LivePhotoRenderer,
2784
+ Oa as MediaPreview,
2785
+ ga as PreviewStage,
2786
+ da as VideoDomRenderer,
2787
+ Aa as VirtualTimeline,
2788
+ je as defaultImagePolicy,
2789
+ Ke as defaultImageSource,
2790
+ Ve as formatVideoTime,
2791
+ it as nativeVideoSource,
2792
+ Pn as previewImageStore,
2793
+ pn as usePreviewViewport
2403
2794
  };