@gx-design-vue/image 0.2.0-beta.1 → 0.2.0-beta.10

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.
package/dist/image.mjs CHANGED
@@ -1,275 +1,135 @@
1
- import { computed as M, isRef as et, createVNode as c, defineComponent as _e, shallowRef as ze, ref as x, watch as ue, nextTick as Ue, Teleport as tt, Transition as Oe, withDirectives as Le, vShow as Ne, mergeProps as Ze, cloneVNode as nt, watchEffect as at, Fragment as rt, createTextVNode as it } from "vue";
2
- import { ExpandOutlined as ot, OneToOneOutlined as st, CloseOutlined as lt, ZoomInOutlined as ut, ZoomOutOutlined as ct, RotateRightOutlined as ft, RotateLeftOutlined as dt, LeftOutlined as ht, RightOutlined as gt } from "@ant-design/icons-vue";
3
- import { getPrefixCls as Q, isServer as q, getSlotVNode as De, isInContainer as vt, isString as pt, getScrollContainer as mt, isNumber as bt } from "@gx-design-vue/pro-utils";
4
- import { useState as Ee, onMountedOrActivated as Xe } from "@gx-design-vue/pro-hooks";
5
- import { useStyleRegister as Re, theme as yt } from "ant-design-vue";
6
- import { createTypes as wt } from "vue-types";
7
- import { useThrottleFn as St, useEventListener as He } from "@vueuse/core";
8
- const xt = (e, t) => {
9
- const { fontFamily: n, fontSize: a } = e, r = `[class^="${t}"], [class*=" ${t}"]`;
10
- return {
11
- [r]: {
12
- fontFamily: n,
13
- fontSize: a,
14
- boxSizing: "border-box",
15
- "&::before, &::after": {
16
- boxSizing: "border-box"
17
- },
18
- [r]: {
19
- boxSizing: "border-box",
20
- "&::before, &::after": {
21
- boxSizing: "border-box"
22
- }
23
- }
24
- }
25
- };
26
- }, It = (e) => ({
27
- a: {
28
- color: e.colorLink,
29
- textDecoration: e.linkDecoration,
30
- backgroundColor: "transparent",
31
- outline: "none",
32
- cursor: "pointer",
33
- transition: `color ${e.motionDurationSlow}`,
34
- "-webkit-text-decoration-skip": "objects",
35
- "&:hover": {
36
- color: e.colorLinkHover
37
- },
38
- "&:active": {
39
- color: e.colorLinkActive
40
- },
41
- [`&:active,
42
- &:hover`]: {
43
- textDecoration: e.linkHoverDecoration,
44
- outline: 0
45
- },
46
- // https://github.com/ant-design/ant-design/issues/22503
47
- "&:focus": {
48
- textDecoration: e.linkFocusDecoration,
49
- outline: 0
50
- },
51
- "&[disabled]": {
52
- color: e.colorTextDisabled,
53
- cursor: "not-allowed"
54
- }
55
- }
56
- }), qe = (
57
- // @ts-ignore
58
- process.env.NODE_ENV !== "production" || typeof CSSINJS_STATISTIC < "u"
59
- );
60
- let Ae = !0;
61
- function Te(...e) {
62
- if (!qe)
63
- return Object.assign({}, ...e);
64
- Ae = !1;
65
- const t = {};
66
- return e.forEach((n) => {
67
- Object.keys(n).forEach((a) => {
68
- Object.defineProperty(t, a, {
69
- configurable: !0,
70
- enumerable: !0,
71
- get: () => n[a]
72
- });
73
- });
74
- }), Ae = !0, t;
75
- }
76
- function Mt() {
77
- }
78
- function Ct(e) {
79
- let t, n = e, a = Mt;
80
- return qe && (t = /* @__PURE__ */ new Set(), n = new Proxy(e, {
81
- get(r, i) {
82
- return Ae && t.add(i), r[i];
83
- }
84
- }), a = (r, i) => {
85
- Array.from(t);
86
- }), { token: n, keys: t, flush: a };
87
- }
88
- class de {
89
- constructor(t, n) {
90
- this._keyframe = !0, this.name = t, this.style = n;
91
- }
92
- getName(t = "") {
93
- return t ? `${t}-${this.name}` : this.name;
94
- }
95
- }
96
- const Fe = (e, t = {}) => e ? {
97
- name: e,
98
- appear: !0,
99
- // type: 'animation',
100
- // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
101
- // appearActiveClass: `antdv-base-transtion`,
102
- // appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
103
- enterFromClass: `${e}-enter ${e}-enter-prepare ${e}-enter-start`,
104
- enterActiveClass: `${e}-enter ${e}-enter-prepare`,
105
- enterToClass: `${e}-enter ${e}-enter-active`,
106
- leaveFromClass: ` ${e}-leave`,
107
- leaveActiveClass: `${e}-leave ${e}-leave-active`,
108
- leaveToClass: `${e}-leave ${e}-leave-active`,
109
- ...t
110
- } : { css: !1, ...t }, { useToken: At } = yt;
111
- function Qe(e, t) {
112
- return (n) => {
113
- const a = Q({}), r = M(() => et(n) ? n == null ? void 0 : n.value : n || a), { token: i, hashId: o, theme: l } = At(), u = M(() => Q({})), p = M(() => ({
114
- theme: l.value,
115
- token: i.value,
116
- hashId: o.value,
117
- path: ["Shared", u.value]
118
- }));
119
- Re(p, () => [
120
- {
121
- "&": It(i.value)
122
- }
123
- ]);
124
- const v = M(() => ({
125
- theme: l.value,
126
- token: i.value,
127
- hashId: o.value,
128
- path: [e, r.value]
129
- }));
130
- return [
131
- Re(v, () => {
132
- const { token: z, flush: C } = Ct(i.value), m = `.${r.value}`, A = Te(z, {
133
- antCls: ".ant",
134
- componentCls: m,
135
- proComponentsCls: Q({
136
- isPor: !0
137
- })
138
- }), d = t(A, {
139
- hashId: o.value,
140
- prefixCls: r.value
141
- });
142
- return C(e, {}), [xt(i.value, r.value), d];
143
- }),
144
- o
145
- ];
146
- };
147
- }
1
+ import { createVNode as u, defineComponent as Ve, shallowRef as Te, ref as w, computed as L, watch as le, nextTick as Ye, Teleport as _e, Transition as ke, withDirectives as ze, vShow as Oe, mergeProps as We, cloneVNode as qe, watchEffect as Qe, Fragment as Je, createTextVNode as Ke } from "vue";
2
+ import { ExpandOutlined as et, OneToOneOutlined as tt, CloseOutlined as nt, ZoomInOutlined as at, ZoomOutOutlined as it, RotateRightOutlined as rt, RotateLeftOutlined as ot, LeftOutlined as st, RightOutlined as lt } from "@ant-design/icons-vue";
3
+ import { isServer as q, getPrefixCls as Ge, getSlotVNode as Le, isInContainer as ut, isString as ct, getScrollContainer as ft, isNumber as dt } from "@gx-design-vue/pro-utils";
4
+ import { useState as Ne, onMountedOrActivated as Ue } from "@gx-design-vue/pro-hooks";
5
+ import { Keyframe as fe, useStyle as ht, mergeToken as gt, getTransitionProps as $e, useProStyle as vt } from "@gx-design-vue/pro-provider";
6
+ import { createTypes as pt } from "vue-types";
7
+ import { useThrottleFn as mt, useEventListener as Ee } from "@vueuse/core";
148
8
  function g(e, t) {
149
- kt(e) && (e = "100%");
150
- var n = Tt(e);
9
+ bt(e) && (e = "100%");
10
+ var n = yt(e);
151
11
  return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
152
12
  }
153
- function oe(e) {
13
+ function re(e) {
154
14
  return Math.min(1, Math.max(0, e));
155
15
  }
156
- function kt(e) {
16
+ function bt(e) {
157
17
  return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
158
18
  }
159
- function Tt(e) {
19
+ function yt(e) {
160
20
  return typeof e == "string" && e.indexOf("%") !== -1;
161
21
  }
162
- function Je(e) {
22
+ function Ze(e) {
163
23
  return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
164
24
  }
165
- function se(e) {
25
+ function oe(e) {
166
26
  return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
167
27
  }
168
28
  function H(e) {
169
29
  return e.length === 1 ? "0" + e : String(e);
170
30
  }
171
- function $t(e, t, n) {
31
+ function wt(e, t, n) {
172
32
  return {
173
33
  r: g(e, 255) * 255,
174
34
  g: g(t, 255) * 255,
175
35
  b: g(n, 255) * 255
176
36
  };
177
37
  }
178
- function Pe(e, t, n) {
38
+ function Re(e, t, n) {
179
39
  e = g(e, 255), t = g(t, 255), n = g(n, 255);
180
- var a = Math.max(e, t, n), r = Math.min(e, t, n), i = 0, o = 0, l = (a + r) / 2;
181
- if (a === r)
182
- o = 0, i = 0;
40
+ var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = 0, l = (a + i) / 2;
41
+ if (a === i)
42
+ o = 0, r = 0;
183
43
  else {
184
- var u = a - r;
185
- switch (o = l > 0.5 ? u / (2 - a - r) : u / (a + r), a) {
44
+ var c = a - i;
45
+ switch (o = l > 0.5 ? c / (2 - a - i) : c / (a + i), a) {
186
46
  case e:
187
- i = (t - n) / u + (t < n ? 6 : 0);
47
+ r = (t - n) / c + (t < n ? 6 : 0);
188
48
  break;
189
49
  case t:
190
- i = (n - e) / u + 2;
50
+ r = (n - e) / c + 2;
191
51
  break;
192
52
  case n:
193
- i = (e - t) / u + 4;
53
+ r = (e - t) / c + 4;
194
54
  break;
195
55
  }
196
- i /= 6;
56
+ r /= 6;
197
57
  }
198
- return { h: i, s: o, l };
58
+ return { h: r, s: o, l };
199
59
  }
200
- function ye(e, t, n) {
60
+ function be(e, t, n) {
201
61
  return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
202
62
  }
203
- function zt(e, t, n) {
204
- var a, r, i;
63
+ function St(e, t, n) {
64
+ var a, i, r;
205
65
  if (e = g(e, 360), t = g(t, 100), n = g(n, 100), t === 0)
206
- r = n, i = n, a = n;
66
+ i = n, r = n, a = n;
207
67
  else {
208
68
  var o = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - o;
209
- a = ye(l, o, e + 1 / 3), r = ye(l, o, e), i = ye(l, o, e - 1 / 3);
69
+ a = be(l, o, e + 1 / 3), i = be(l, o, e), r = be(l, o, e - 1 / 3);
210
70
  }
211
- return { r: a * 255, g: r * 255, b: i * 255 };
71
+ return { r: a * 255, g: i * 255, b: r * 255 };
212
72
  }
213
- function je(e, t, n) {
73
+ function De(e, t, n) {
214
74
  e = g(e, 255), t = g(t, 255), n = g(n, 255);
215
- var a = Math.max(e, t, n), r = Math.min(e, t, n), i = 0, o = a, l = a - r, u = a === 0 ? 0 : l / a;
216
- if (a === r)
217
- i = 0;
75
+ var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = a, l = a - i, c = a === 0 ? 0 : l / a;
76
+ if (a === i)
77
+ r = 0;
218
78
  else {
219
79
  switch (a) {
220
80
  case e:
221
- i = (t - n) / l + (t < n ? 6 : 0);
81
+ r = (t - n) / l + (t < n ? 6 : 0);
222
82
  break;
223
83
  case t:
224
- i = (n - e) / l + 2;
84
+ r = (n - e) / l + 2;
225
85
  break;
226
86
  case n:
227
- i = (e - t) / l + 4;
87
+ r = (e - t) / l + 4;
228
88
  break;
229
89
  }
230
- i /= 6;
90
+ r /= 6;
231
91
  }
232
- return { h: i, s: u, v: o };
92
+ return { h: r, s: c, v: o };
233
93
  }
234
- function Ot(e, t, n) {
94
+ function xt(e, t, n) {
235
95
  e = g(e, 360) * 6, t = g(t, 100), n = g(n, 100);
236
- var a = Math.floor(e), r = e - a, i = n * (1 - t), o = n * (1 - r * t), l = n * (1 - (1 - r) * t), u = a % 6, p = [n, o, i, i, l, n][u], v = [l, n, n, o, i, i][u], z = [i, i, l, n, n, o][u];
237
- return { r: p * 255, g: v * 255, b: z * 255 };
96
+ var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t), c = a % 6, S = [n, o, r, r, l, n][c], p = [l, n, n, o, r, r][c], $ = [r, r, l, n, n, o][c];
97
+ return { r: S * 255, g: p * 255, b: $ * 255 };
238
98
  }
239
- function Be(e, t, n, a) {
240
- var r = [
99
+ function He(e, t, n, a) {
100
+ var i = [
241
101
  H(Math.round(e).toString(16)),
242
102
  H(Math.round(t).toString(16)),
243
103
  H(Math.round(n).toString(16))
244
104
  ];
245
- return a && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join("");
105
+ return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
246
106
  }
247
- function Lt(e, t, n, a, r) {
248
- var i = [
107
+ function Mt(e, t, n, a, i) {
108
+ var r = [
249
109
  H(Math.round(e).toString(16)),
250
110
  H(Math.round(t).toString(16)),
251
111
  H(Math.round(n).toString(16)),
252
- H(Nt(a))
112
+ H(It(a))
253
113
  ];
254
- return r && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join("");
114
+ return i && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) && r[3].startsWith(r[3].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) + r[3].charAt(0) : r.join("");
255
115
  }
256
- function Nt(e) {
116
+ function It(e) {
257
117
  return Math.round(parseFloat(e) * 255).toString(16);
258
118
  }
259
- function Ve(e) {
260
- return S(e) / 255;
119
+ function Pe(e) {
120
+ return y(e) / 255;
261
121
  }
262
- function S(e) {
122
+ function y(e) {
263
123
  return parseInt(e, 16);
264
124
  }
265
- function Dt(e) {
125
+ function At(e) {
266
126
  return {
267
127
  r: e >> 16,
268
128
  g: (e & 65280) >> 8,
269
129
  b: e & 255
270
130
  };
271
131
  }
272
- var ke = {
132
+ var Ae = {
273
133
  aliceblue: "#f0f8ff",
274
134
  antiquewhite: "#faebd7",
275
135
  aqua: "#00ffff",
@@ -419,9 +279,9 @@ var ke = {
419
279
  yellow: "#ffff00",
420
280
  yellowgreen: "#9acd32"
421
281
  };
422
- function Et(e) {
423
- var t = { r: 0, g: 0, b: 0 }, n = 1, a = null, r = null, i = null, o = !1, l = !1;
424
- return typeof e == "string" && (e = Ft(e)), typeof e == "object" && (O(e.r) && O(e.g) && O(e.b) ? (t = $t(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : O(e.h) && O(e.s) && O(e.v) ? (a = se(e.s), r = se(e.v), t = Ot(e.h, a, r), o = !0, l = "hsv") : O(e.h) && O(e.s) && O(e.l) && (a = se(e.s), i = se(e.l), t = zt(e.h, a, i), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Je(n), {
282
+ function Ct(e) {
283
+ var t = { r: 0, g: 0, b: 0 }, n = 1, a = null, i = null, r = null, o = !1, l = !1;
284
+ return typeof e == "string" && (e = zt(e)), typeof e == "object" && (z(e.r) && z(e.g) && z(e.b) ? (t = wt(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : z(e.h) && z(e.s) && z(e.v) ? (a = oe(e.s), i = oe(e.v), t = xt(e.h, a, i), o = !0, l = "hsv") : z(e.h) && z(e.s) && z(e.l) && (a = oe(e.s), r = oe(e.l), t = St(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ze(n), {
425
285
  ok: o,
426
286
  format: e.format || l,
427
287
  r: Math.min(255, Math.max(t.r, 0)),
@@ -430,56 +290,56 @@ function Et(e) {
430
290
  a: n
431
291
  };
432
292
  }
433
- var Rt = "[-\\+]?\\d+%?", Ht = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(Ht, ")|(?:").concat(Rt, ")"), we = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), Se = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), k = {
293
+ var Tt = "[-\\+]?\\d+%?", kt = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(kt, ")|(?:").concat(Tt, ")"), ye = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), we = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), I = {
434
294
  CSS_UNIT: new RegExp(N),
435
- rgb: new RegExp("rgb" + we),
436
- rgba: new RegExp("rgba" + Se),
437
- hsl: new RegExp("hsl" + we),
438
- hsla: new RegExp("hsla" + Se),
439
- hsv: new RegExp("hsv" + we),
440
- hsva: new RegExp("hsva" + Se),
295
+ rgb: new RegExp("rgb" + ye),
296
+ rgba: new RegExp("rgba" + we),
297
+ hsl: new RegExp("hsl" + ye),
298
+ hsla: new RegExp("hsla" + we),
299
+ hsv: new RegExp("hsv" + ye),
300
+ hsva: new RegExp("hsva" + we),
441
301
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
442
302
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
443
303
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
444
304
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
445
305
  };
446
- function Ft(e) {
306
+ function zt(e) {
447
307
  if (e = e.trim().toLowerCase(), e.length === 0)
448
308
  return !1;
449
309
  var t = !1;
450
- if (ke[e])
451
- e = ke[e], t = !0;
310
+ if (Ae[e])
311
+ e = Ae[e], t = !0;
452
312
  else if (e === "transparent")
453
313
  return { r: 0, g: 0, b: 0, a: 0, format: "name" };
454
- var n = k.rgb.exec(e);
455
- return n ? { r: n[1], g: n[2], b: n[3] } : (n = k.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = k.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = k.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = k.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = k.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = k.hex8.exec(e), n ? {
456
- r: S(n[1]),
457
- g: S(n[2]),
458
- b: S(n[3]),
459
- a: Ve(n[4]),
314
+ var n = I.rgb.exec(e);
315
+ return n ? { r: n[1], g: n[2], b: n[3] } : (n = I.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = I.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = I.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = I.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = I.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = I.hex8.exec(e), n ? {
316
+ r: y(n[1]),
317
+ g: y(n[2]),
318
+ b: y(n[3]),
319
+ a: Pe(n[4]),
460
320
  format: t ? "name" : "hex8"
461
- } : (n = k.hex6.exec(e), n ? {
462
- r: S(n[1]),
463
- g: S(n[2]),
464
- b: S(n[3]),
321
+ } : (n = I.hex6.exec(e), n ? {
322
+ r: y(n[1]),
323
+ g: y(n[2]),
324
+ b: y(n[3]),
465
325
  format: t ? "name" : "hex"
466
- } : (n = k.hex4.exec(e), n ? {
467
- r: S(n[1] + n[1]),
468
- g: S(n[2] + n[2]),
469
- b: S(n[3] + n[3]),
470
- a: Ve(n[4] + n[4]),
326
+ } : (n = I.hex4.exec(e), n ? {
327
+ r: y(n[1] + n[1]),
328
+ g: y(n[2] + n[2]),
329
+ b: y(n[3] + n[3]),
330
+ a: Pe(n[4] + n[4]),
471
331
  format: t ? "name" : "hex8"
472
- } : (n = k.hex3.exec(e), n ? {
473
- r: S(n[1] + n[1]),
474
- g: S(n[2] + n[2]),
475
- b: S(n[3] + n[3]),
332
+ } : (n = I.hex3.exec(e), n ? {
333
+ r: y(n[1] + n[1]),
334
+ g: y(n[2] + n[2]),
335
+ b: y(n[3] + n[3]),
476
336
  format: t ? "name" : "hex"
477
337
  } : !1)))))))));
478
338
  }
479
- function O(e) {
480
- return !!k.CSS_UNIT.exec(String(e));
339
+ function z(e) {
340
+ return !!I.CSS_UNIT.exec(String(e));
481
341
  }
482
- var J = (
342
+ var Q = (
483
343
  /** @class */
484
344
  function() {
485
345
  function e(t, n) {
@@ -487,9 +347,9 @@ var J = (
487
347
  var a;
488
348
  if (t instanceof e)
489
349
  return t;
490
- typeof t == "number" && (t = Dt(t)), this.originalInput = t;
491
- var r = Et(t);
492
- this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (a = n.format) !== null && a !== void 0 ? a : r.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
350
+ typeof t == "number" && (t = At(t)), this.originalInput = t;
351
+ var i = Ct(t);
352
+ this.originalInput = t, this.r = i.r, this.g = i.g, this.b = i.b, this.a = i.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (a = n.format) !== null && a !== void 0 ? a : i.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = i.ok;
493
353
  }
494
354
  return e.prototype.isDark = function() {
495
355
  return this.getBrightness() < 128;
@@ -499,33 +359,33 @@ var J = (
499
359
  var t = this.toRgb();
500
360
  return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
501
361
  }, e.prototype.getLuminance = function() {
502
- var t = this.toRgb(), n, a, r, i = t.r / 255, o = t.g / 255, l = t.b / 255;
503
- return i <= 0.03928 ? n = i / 12.92 : n = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? a = o / 12.92 : a = Math.pow((o + 0.055) / 1.055, 2.4), l <= 0.03928 ? r = l / 12.92 : r = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * a + 0.0722 * r;
362
+ var t = this.toRgb(), n, a, i, r = t.r / 255, o = t.g / 255, l = t.b / 255;
363
+ return r <= 0.03928 ? n = r / 12.92 : n = Math.pow((r + 0.055) / 1.055, 2.4), o <= 0.03928 ? a = o / 12.92 : a = Math.pow((o + 0.055) / 1.055, 2.4), l <= 0.03928 ? i = l / 12.92 : i = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * a + 0.0722 * i;
504
364
  }, e.prototype.getAlpha = function() {
505
365
  return this.a;
506
366
  }, e.prototype.setAlpha = function(t) {
507
- return this.a = Je(t), this.roundA = Math.round(100 * this.a) / 100, this;
367
+ return this.a = Ze(t), this.roundA = Math.round(100 * this.a) / 100, this;
508
368
  }, e.prototype.isMonochrome = function() {
509
369
  var t = this.toHsl().s;
510
370
  return t === 0;
511
371
  }, e.prototype.toHsv = function() {
512
- var t = je(this.r, this.g, this.b);
372
+ var t = De(this.r, this.g, this.b);
513
373
  return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
514
374
  }, e.prototype.toHsvString = function() {
515
- var t = je(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), r = Math.round(t.v * 100);
516
- return this.a === 1 ? "hsv(".concat(n, ", ").concat(a, "%, ").concat(r, "%)") : "hsva(".concat(n, ", ").concat(a, "%, ").concat(r, "%, ").concat(this.roundA, ")");
375
+ var t = De(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), i = Math.round(t.v * 100);
376
+ return this.a === 1 ? "hsv(".concat(n, ", ").concat(a, "%, ").concat(i, "%)") : "hsva(".concat(n, ", ").concat(a, "%, ").concat(i, "%, ").concat(this.roundA, ")");
517
377
  }, e.prototype.toHsl = function() {
518
- var t = Pe(this.r, this.g, this.b);
378
+ var t = Re(this.r, this.g, this.b);
519
379
  return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
520
380
  }, e.prototype.toHslString = function() {
521
- var t = Pe(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), r = Math.round(t.l * 100);
522
- return this.a === 1 ? "hsl(".concat(n, ", ").concat(a, "%, ").concat(r, "%)") : "hsla(".concat(n, ", ").concat(a, "%, ").concat(r, "%, ").concat(this.roundA, ")");
381
+ var t = Re(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), i = Math.round(t.l * 100);
382
+ return this.a === 1 ? "hsl(".concat(n, ", ").concat(a, "%, ").concat(i, "%)") : "hsla(".concat(n, ", ").concat(a, "%, ").concat(i, "%, ").concat(this.roundA, ")");
523
383
  }, e.prototype.toHex = function(t) {
524
- return t === void 0 && (t = !1), Be(this.r, this.g, this.b, t);
384
+ return t === void 0 && (t = !1), He(this.r, this.g, this.b, t);
525
385
  }, e.prototype.toHexString = function(t) {
526
386
  return t === void 0 && (t = !1), "#" + this.toHex(t);
527
387
  }, e.prototype.toHex8 = function(t) {
528
- return t === void 0 && (t = !1), Lt(this.r, this.g, this.b, this.a, t);
388
+ return t === void 0 && (t = !1), Mt(this.r, this.g, this.b, this.a, t);
529
389
  }, e.prototype.toHex8String = function(t) {
530
390
  return t === void 0 && (t = !1), "#" + this.toHex8(t);
531
391
  }, e.prototype.toRgb = function() {
@@ -558,17 +418,17 @@ var J = (
558
418
  return "transparent";
559
419
  if (this.a < 1)
560
420
  return !1;
561
- for (var t = "#" + Be(this.r, this.g, this.b, !1), n = 0, a = Object.entries(ke); n < a.length; n++) {
562
- var r = a[n], i = r[0], o = r[1];
421
+ for (var t = "#" + He(this.r, this.g, this.b, !1), n = 0, a = Object.entries(Ae); n < a.length; n++) {
422
+ var i = a[n], r = i[0], o = i[1];
563
423
  if (t === o)
564
- return i;
424
+ return r;
565
425
  }
566
426
  return !1;
567
427
  }, e.prototype.toString = function(t) {
568
428
  var n = !!t;
569
429
  t = t ?? this.format;
570
- var a = !1, r = this.a < 1 && this.a >= 0, i = !n && r && (t.startsWith("hex") || t === "name");
571
- return i ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (a = this.toRgbString()), t === "prgb" && (a = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (a = this.toHexString()), t === "hex3" && (a = this.toHexString(!0)), t === "hex4" && (a = this.toHex8String(!0)), t === "hex8" && (a = this.toHex8String()), t === "name" && (a = this.toName()), t === "hsl" && (a = this.toHslString()), t === "hsv" && (a = this.toHsvString()), a || this.toHexString());
430
+ var a = !1, i = this.a < 1 && this.a >= 0, r = !n && i && (t.startsWith("hex") || t === "name");
431
+ return r ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (a = this.toRgbString()), t === "prgb" && (a = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (a = this.toHexString()), t === "hex3" && (a = this.toHexString(!0)), t === "hex4" && (a = this.toHex8String(!0)), t === "hex8" && (a = this.toHex8String()), t === "name" && (a = this.toName()), t === "hsl" && (a = this.toHslString()), t === "hsv" && (a = this.toHsvString()), a || this.toHexString());
572
432
  }, e.prototype.toNumber = function() {
573
433
  return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
574
434
  }, e.prototype.clone = function() {
@@ -576,7 +436,7 @@ var J = (
576
436
  }, e.prototype.lighten = function(t) {
577
437
  t === void 0 && (t = 10);
578
438
  var n = this.toHsl();
579
- return n.l += t / 100, n.l = oe(n.l), new e(n);
439
+ return n.l += t / 100, n.l = re(n.l), new e(n);
580
440
  }, e.prototype.brighten = function(t) {
581
441
  t === void 0 && (t = 10);
582
442
  var n = this.toRgb();
@@ -584,7 +444,7 @@ var J = (
584
444
  }, e.prototype.darken = function(t) {
585
445
  t === void 0 && (t = 10);
586
446
  var n = this.toHsl();
587
- return n.l -= t / 100, n.l = oe(n.l), new e(n);
447
+ return n.l -= t / 100, n.l = re(n.l), new e(n);
588
448
  }, e.prototype.tint = function(t) {
589
449
  return t === void 0 && (t = 10), this.mix("white", t);
590
450
  }, e.prototype.shade = function(t) {
@@ -592,11 +452,11 @@ var J = (
592
452
  }, e.prototype.desaturate = function(t) {
593
453
  t === void 0 && (t = 10);
594
454
  var n = this.toHsl();
595
- return n.s -= t / 100, n.s = oe(n.s), new e(n);
455
+ return n.s -= t / 100, n.s = re(n.s), new e(n);
596
456
  }, e.prototype.saturate = function(t) {
597
457
  t === void 0 && (t = 10);
598
458
  var n = this.toHsl();
599
- return n.s += t / 100, n.s = oe(n.s), new e(n);
459
+ return n.s += t / 100, n.s = re(n.s), new e(n);
600
460
  }, e.prototype.greyscale = function() {
601
461
  return this.desaturate(100);
602
462
  }, e.prototype.spin = function(t) {
@@ -604,26 +464,26 @@ var J = (
604
464
  return n.h = a < 0 ? 360 + a : a, new e(n);
605
465
  }, e.prototype.mix = function(t, n) {
606
466
  n === void 0 && (n = 50);
607
- var a = this.toRgb(), r = new e(t).toRgb(), i = n / 100, o = {
608
- r: (r.r - a.r) * i + a.r,
609
- g: (r.g - a.g) * i + a.g,
610
- b: (r.b - a.b) * i + a.b,
611
- a: (r.a - a.a) * i + a.a
467
+ var a = this.toRgb(), i = new e(t).toRgb(), r = n / 100, o = {
468
+ r: (i.r - a.r) * r + a.r,
469
+ g: (i.g - a.g) * r + a.g,
470
+ b: (i.b - a.b) * r + a.b,
471
+ a: (i.a - a.a) * r + a.a
612
472
  };
613
473
  return new e(o);
614
474
  }, e.prototype.analogous = function(t, n) {
615
475
  t === void 0 && (t = 6), n === void 0 && (n = 30);
616
- var a = this.toHsl(), r = 360 / n, i = [this];
617
- for (a.h = (a.h - (r * t >> 1) + 720) % 360; --t; )
618
- a.h = (a.h + r) % 360, i.push(new e(a));
619
- return i;
476
+ var a = this.toHsl(), i = 360 / n, r = [this];
477
+ for (a.h = (a.h - (i * t >> 1) + 720) % 360; --t; )
478
+ a.h = (a.h + i) % 360, r.push(new e(a));
479
+ return r;
620
480
  }, e.prototype.complement = function() {
621
481
  var t = this.toHsl();
622
482
  return t.h = (t.h + 180) % 360, new e(t);
623
483
  }, e.prototype.monochromatic = function(t) {
624
484
  t === void 0 && (t = 6);
625
- for (var n = this.toHsv(), a = n.h, r = n.s, i = n.v, o = [], l = 1 / t; t--; )
626
- o.push(new e({ h: a, s: r, v: i })), i = (i + l) % 1;
485
+ for (var n = this.toHsv(), a = n.h, i = n.s, r = n.v, o = [], l = 1 / t; t--; )
486
+ o.push(new e({ h: a, s: i, v: r })), r = (r + l) % 1;
627
487
  return o;
628
488
  }, e.prototype.splitcomplement = function() {
629
489
  var t = this.toHsl(), n = t.h;
@@ -644,29 +504,29 @@ var J = (
644
504
  }, e.prototype.tetrad = function() {
645
505
  return this.polyad(4);
646
506
  }, e.prototype.polyad = function(t) {
647
- for (var n = this.toHsl(), a = n.h, r = [this], i = 360 / t, o = 1; o < t; o++)
648
- r.push(new e({ h: (a + o * i) % 360, s: n.s, l: n.l }));
649
- return r;
507
+ for (var n = this.toHsl(), a = n.h, i = [this], r = 360 / t, o = 1; o < t; o++)
508
+ i.push(new e({ h: (a + o * r) % 360, s: n.s, l: n.l }));
509
+ return i;
650
510
  }, e.prototype.equals = function(t) {
651
511
  return this.toRgbString() === new e(t).toRgbString();
652
512
  }, e;
653
513
  }()
654
514
  );
655
- const Pt = new de("viewFadeIn", {
515
+ const Ot = new fe("viewFadeIn", {
656
516
  "0%": {
657
517
  opacity: 0
658
518
  },
659
519
  "100%": {
660
520
  opacity: 1
661
521
  }
662
- }), jt = new de("viewFadeOut", {
522
+ }), Lt = new fe("viewFadeOut", {
663
523
  "0%": {
664
524
  opacity: 1
665
525
  },
666
526
  "100%": {
667
527
  opacity: 0
668
528
  }
669
- }), Bt = new de("viewZoomBadgeIn", {
529
+ }), Nt = new fe("viewZoomBadgeIn", {
670
530
  "0%": {
671
531
  transform: "scale(0.2)",
672
532
  opacity: 0
@@ -675,7 +535,7 @@ const Pt = new de("viewFadeIn", {
675
535
  transform: "scale(1)",
676
536
  opacity: 1
677
537
  }
678
- }), Vt = new de("viewZoomBadgeOut", {
538
+ }), $t = new fe("viewZoomBadgeOut", {
679
539
  "0%": {
680
540
  transform: "scale(1)"
681
541
  },
@@ -683,11 +543,11 @@ const Pt = new de("viewFadeIn", {
683
543
  transform: "scale(0.2)",
684
544
  opacity: 0
685
545
  }
686
- }), Ye = (e) => ({
546
+ }), Fe = (e) => ({
687
547
  position: e || "absolute",
688
548
  inset: 0
689
549
  });
690
- function xe(e) {
550
+ function Se(e) {
691
551
  return {
692
552
  position: e,
693
553
  top: 0,
@@ -696,7 +556,7 @@ function xe(e) {
696
556
  insetInlineStart: 0
697
557
  };
698
558
  }
699
- const Yt = (e) => ({
559
+ const Et = (e) => ({
700
560
  boxSizing: "border-box",
701
561
  margin: 0,
702
562
  padding: 0,
@@ -705,11 +565,11 @@ const Yt = (e) => ({
705
565
  lineHeight: e.lineHeight,
706
566
  listStyle: "none",
707
567
  fontFamily: e.fontFamily
708
- }), Wt = (e) => {
709
- const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: r, motionDurationSlow: i } = e, o = new J(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
568
+ }), Rt = (e) => {
569
+ const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new Q(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
710
570
  return {
711
571
  [`${t}-operations`]: {
712
- ...Yt(e),
572
+ ...Et(e),
713
573
  display: "flex",
714
574
  flexDirection: "row-reverse",
715
575
  alignItems: "center",
@@ -721,13 +581,13 @@ const Yt = (e) => ({
721
581
  marginInlineStart: a,
722
582
  padding: a,
723
583
  cursor: "pointer",
724
- transition: `all ${i}`,
584
+ transition: `all ${r}`,
725
585
  userSelect: "none",
726
586
  "&:hover": {
727
587
  background: l.toRgbString()
728
588
  },
729
589
  "&-disabled": {
730
- color: r,
590
+ color: i,
731
591
  pointerEvents: "none"
732
592
  },
733
593
  "&:last-of-type": {
@@ -744,8 +604,8 @@ const Yt = (e) => ({
744
604
  }
745
605
  }
746
606
  };
747
- }, Gt = (e) => {
748
- const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: r } = e, i = new J(t).setAlpha(0.1), o = i.clone().setAlpha(0.2);
607
+ }, Dt = (e) => {
608
+ const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new Q(t).setAlpha(0.1), o = r.clone().setAlpha(0.2);
749
609
  return {
750
610
  [`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]: {
751
611
  position: "fixed",
@@ -758,11 +618,11 @@ const Yt = (e) => ({
758
618
  height: e.imagePreviewSwitchSize,
759
619
  marginTop: -e.imagePreviewSwitchSize / 2,
760
620
  color: e.previewOperationColor,
761
- background: i.toRgbString(),
621
+ background: r.toRgbString(),
762
622
  borderRadius: "50%",
763
623
  transform: "translateY(-50%)",
764
624
  cursor: "pointer",
765
- transition: `all ${r}`,
625
+ transition: `all ${i}`,
766
626
  pointerEvents: "auto",
767
627
  userSelect: "none",
768
628
  "&:hover": {
@@ -789,24 +649,24 @@ const Yt = (e) => ({
789
649
  insetInlineEnd: e.marginSM
790
650
  }
791
651
  };
792
- }, _t = (e) => ({
652
+ }, Ht = (e) => ({
793
653
  [e.componentCls]: {
794
654
  ["&-root"]: {
795
- ...xe("fixed"),
655
+ ...Se("fixed"),
796
656
  zIndex: e.zIndexPopup,
797
657
  overflow: "auto",
798
658
  outline: 0,
799
659
  WebkitOverflowScrolling: "touch"
800
660
  },
801
661
  ["&-wrapper"]: {
802
- ...xe("fixed"),
662
+ ...Se("fixed"),
803
663
  zIndex: e.zIndexPopup,
804
664
  overflow: "auto",
805
665
  outline: 0,
806
666
  WebkitOverflowScrolling: "touch"
807
667
  },
808
668
  ["&-mask"]: {
809
- ...xe("fixed"),
669
+ ...Se("fixed"),
810
670
  zIndex: e.zIndexPopupBase,
811
671
  height: "100%",
812
672
  backgroundColor: e.colorBgMask
@@ -817,11 +677,11 @@ const Yt = (e) => ({
817
677
  pointerEvents: "none"
818
678
  },
819
679
  ["&-body"]: {
820
- ...Ye(),
680
+ ...Fe(),
821
681
  overflow: "hidden"
822
682
  },
823
683
  ["&-canvas"]: {
824
- ...Ye(),
684
+ ...Fe(),
825
685
  display: "flex",
826
686
  justifyContent: "center",
827
687
  alignItems: "center",
@@ -844,17 +704,17 @@ const Yt = (e) => ({
844
704
  pointerEvents: "auto"
845
705
  },
846
706
  ["&-fade-appear, &-fade-enter"]: {
847
- animationName: Pt,
707
+ animationName: Ot,
848
708
  animationDuration: e.motionDurationSlow,
849
709
  animationTimingFunction: "linear"
850
710
  },
851
711
  ["&-fade-leave"]: {
852
- animationName: jt,
712
+ animationName: Lt,
853
713
  animationDuration: e.motionDurationSlow,
854
714
  animationTimingFunction: "linear"
855
715
  },
856
716
  ["&-zoom-appear, &-zoom-enter"]: {
857
- animationName: Bt,
717
+ animationName: Nt,
858
718
  opacity: 0,
859
719
  animationTimingFunction: e.motionEaseOutCirc,
860
720
  animationFillMode: "both",
@@ -866,7 +726,7 @@ const Yt = (e) => ({
866
726
  animationPlayState: "running"
867
727
  },
868
728
  ["&-zoom-leave"]: {
869
- animationName: Vt,
729
+ animationName: $t,
870
730
  animationDuration: e.motionDurationSlow,
871
731
  animationTimingFunction: e.motionEaseOutBack,
872
732
  animationFillMode: "both"
@@ -884,19 +744,23 @@ const Yt = (e) => ({
884
744
  zIndex: e.zIndexPopup + 1,
885
745
  width: "100%"
886
746
  },
887
- "&": [Wt(e), Gt(e)]
888
- }), Ut = Qe("ImageView", (e) => {
889
- const t = Te(e, {
890
- zIndexPopup: e.zIndexPopupBase + 80,
891
- previewOperationColorDisabled: new J(e.colorTextLightSolid).setAlpha(0.25).toRgbString(),
892
- modalMaskBg: new J("#000").setAlpha(0.45).toRgbString(),
893
- previewOperationColor: new J(e.colorTextLightSolid).toRgbString(),
894
- previewOperationSize: e.fontSizeIcon * 1.5,
895
- imagePreviewSwitchSize: e.controlHeightLG,
896
- iconCls: "anticon"
897
- });
898
- return [_t(t)];
899
- }), Ke = wt({
747
+ "&": [Rt(e), Dt(e)]
748
+ });
749
+ function Pt(e) {
750
+ return ht("ImageView", (t) => {
751
+ const n = gt(t, {
752
+ zIndexPopup: t.zIndexPopupBase + 80,
753
+ previewOperationColorDisabled: new Q(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
754
+ modalMaskBg: new Q("#000").setAlpha(0.45).toRgbString(),
755
+ previewOperationColor: new Q(t.colorTextLightSolid).toRgbString(),
756
+ previewOperationSize: t.fontSizeIcon * 1.5,
757
+ imagePreviewSwitchSize: t.controlHeightLG,
758
+ iconCls: "anticon"
759
+ });
760
+ return [Ht(n)];
761
+ }, e);
762
+ }
763
+ const Xe = pt({
900
764
  func: void 0,
901
765
  bool: void 0,
902
766
  string: void 0,
@@ -905,7 +769,7 @@ const Yt = (e) => ({
905
769
  object: void 0,
906
770
  integer: void 0
907
771
  });
908
- Ke.extend([{
772
+ Xe.extend([{
909
773
  name: "looseBool",
910
774
  getter: !0,
911
775
  type: Boolean,
@@ -920,7 +784,7 @@ Ke.extend([{
920
784
  getter: !0,
921
785
  type: null
922
786
  }]);
923
- const B = Ke, F = {
787
+ const B = Xe, P = {
924
788
  infinite: {
925
789
  type: Boolean,
926
790
  default: !0
@@ -936,7 +800,7 @@ const B = Ke, F = {
936
800
  getContainer: {
937
801
  type: String
938
802
  }
939
- }, ce = {
803
+ }, ue = {
940
804
  previewTeleported: {
941
805
  type: Boolean,
942
806
  default: !0
@@ -945,8 +809,6 @@ const B = Ke, F = {
945
809
  type: Boolean,
946
810
  default: !0
947
811
  },
948
- wrapperClassName: String,
949
- wrapperStyle: { type: Object, default: void 0 },
950
812
  src: {
951
813
  type: String,
952
814
  default: ""
@@ -991,21 +853,21 @@ const B = Ke, F = {
991
853
  imageStyle: B.style,
992
854
  width: B.number,
993
855
  height: B.number,
994
- zIndex: F.zIndex,
995
- infinite: F.infinite,
996
- getContainer: F.getContainer,
997
- initialIndex: F.initialIndex
998
- }, Zt = {
856
+ zIndex: P.zIndex,
857
+ infinite: P.infinite,
858
+ getContainer: P.getContainer,
859
+ initialIndex: P.initialIndex
860
+ }, Ft = {
999
861
  urlList: {
1000
862
  type: Array,
1001
863
  default: () => []
1002
864
  },
1003
- teleported: ce.previewTeleported,
1004
- zIndex: F.zIndex,
1005
- initialIndex: F.initialIndex,
1006
- infinite: F.infinite,
1007
- getContainer: ce.getContainer,
1008
- onHideOnClickModal: ce.hideOnClickModal,
865
+ teleported: ue.previewTeleported,
866
+ zIndex: P.zIndex,
867
+ initialIndex: P.initialIndex,
868
+ infinite: P.infinite,
869
+ getContainer: ue.getContainer,
870
+ onHideOnClickModal: ue.hideOnClickModal,
1009
871
  icons: {
1010
872
  type: Object,
1011
873
  default: () => ({})
@@ -1021,22 +883,22 @@ const B = Ke, F = {
1021
883
  esc: "Escape",
1022
884
  delete: "Delete",
1023
885
  backspace: "Backspace"
1024
- }, le = function(e, t, n, a = !1) {
886
+ }, se = function(e, t, n, a = !1) {
1025
887
  e && t && n && e.addEventListener(t, n, a);
1026
- }, Ie = function(e, t, n, a = !1) {
888
+ }, xe = function(e, t, n, a = !1) {
1027
889
  e && t && n && e.removeEventListener(t, n, a);
1028
- }, X = {
890
+ }, _ = {
1029
891
  CONTAIN: {
1030
892
  name: "contain",
1031
- icon: c(ot, null, null)
893
+ icon: u(et, null, null)
1032
894
  },
1033
895
  ORIGINAL: {
1034
896
  name: "original",
1035
- icon: c(st, null, null)
897
+ icon: u(tt, null, null)
1036
898
  }
1037
- }, Xt = function() {
899
+ }, jt = function() {
1038
900
  return !q && !!window.navigator.userAgent.match(/firefox/i);
1039
- }, We = Xt() ? "DOMMouseScroll" : "mousewheel";
901
+ }, je = jt() ? "DOMMouseScroll" : "mousewheel";
1040
902
  function Me(e) {
1041
903
  let t = !1;
1042
904
  return function(...n) {
@@ -1045,105 +907,108 @@ function Me(e) {
1045
907
  }));
1046
908
  };
1047
909
  }
1048
- const qt = /* @__PURE__ */ _e({
1049
- props: Zt,
910
+ const Bt = /* @__PURE__ */ Ve({
911
+ props: Ft,
1050
912
  emits: ["close", "switch"],
1051
913
  setup: function(e, {
1052
914
  emit: t,
1053
915
  expose: n
1054
916
  }) {
1055
- var re, ie, R, Z, $e;
1056
- let a = null, r = null, i = null;
1057
- const o = Q({
917
+ var ae, ie, D, X, Ce;
918
+ let a = null, i = null, r = null;
919
+ const o = Ge({
1058
920
  suffixCls: "image-viewer"
1059
- }), [l, u] = Ut(o), p = ze(!1), [v, z] = Ee(!1), [C, m] = Ee(!1), A = x(!0), d = x(e.initialIndex), Y = x(null), P = x(null), W = x(X.CONTAIN), h = x({
921
+ }), {
922
+ wrapSSR: l,
923
+ hashId: c
924
+ } = Pt(o), S = Te(!1), [p, $] = Ne(!1), [T, x] = Ne(!1), k = w(!0), h = w(e.initialIndex), Y = w(null), F = w(null), W = w(_.CONTAIN), d = w({
1060
925
  scale: 1,
1061
926
  deg: 0,
1062
927
  offsetX: 0,
1063
928
  offsetY: 0,
1064
929
  enableTransition: !1
1065
- }), G = M(() => e.urlList.length > 1), K = M(() => d.value === 0), ee = M(() => d.value === e.urlList.length - 1), te = M(() => e.urlList[d.value]), he = M(() => {
930
+ }), G = L(() => e.urlList.length > 1), J = L(() => h.value === 0), K = L(() => h.value === e.urlList.length - 1), ee = L(() => e.urlList[h.value]), de = L(() => {
1066
931
  const {
1067
932
  scale: s,
1068
- deg: y,
1069
- offsetX: w,
1070
- offsetY: $,
1071
- enableTransition: b
1072
- } = h.value, I = {
1073
- transform: `scale(${s}) rotate(${y}deg)`,
1074
- transition: b ? "transform .3s" : "",
1075
- marginLeft: `${w}px`,
1076
- marginTop: `${$}px`
933
+ deg: m,
934
+ offsetX: b,
935
+ offsetY: C,
936
+ enableTransition: v
937
+ } = d.value, M = {
938
+ transform: `scale(${s}) rotate(${m}deg)`,
939
+ transition: v ? "transform .3s" : "",
940
+ marginLeft: `${b}px`,
941
+ marginTop: `${C}px`
1077
942
  };
1078
- return W.value.name === X.CONTAIN.name && (I.maxWidth = I.maxHeight = "100%"), I;
1079
- }), ne = () => {
1080
- pe(), t("close"), h.value = {
943
+ return W.value.name === _.CONTAIN.name && (M.maxWidth = M.maxHeight = "100%"), M;
944
+ }), te = () => {
945
+ ve(), t("close"), d.value = {
1081
946
  scale: 1,
1082
947
  deg: 0,
1083
948
  offsetX: 0,
1084
949
  offsetY: 0,
1085
950
  enableTransition: !1
1086
951
  };
1087
- }, ge = (s) => {
1088
- p.value ? p.value = !1 : Y.value === (s == null ? void 0 : s.target) && (m(!1), d.value = e.initialIndex);
1089
- }, ve = () => {
952
+ }, he = (s) => {
953
+ S.value ? S.value = !1 : Y.value === (s == null ? void 0 : s.target) && (x(!1), h.value = e.initialIndex);
954
+ }, ge = () => {
1090
955
  a = Me((s) => {
1091
956
  switch (s.code) {
1092
957
  case V.esc:
1093
- m(!1);
958
+ x(!1);
1094
959
  break;
1095
960
  case V.space:
1096
961
  j();
1097
962
  break;
1098
963
  case V.left:
1099
- ae();
964
+ ne();
1100
965
  break;
1101
966
  case V.up:
1102
- T("zoomIn");
967
+ A("zoomIn");
1103
968
  break;
1104
969
  case V.right:
1105
- U();
970
+ Z();
1106
971
  break;
1107
972
  case V.down:
1108
- T("zoomOut");
973
+ A("zoomOut");
1109
974
  break;
1110
975
  }
1111
- }), r = Me((s) => {
1112
- (s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? T("zoomIn", {
976
+ }), i = Me((s) => {
977
+ (s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? A("zoomIn", {
1113
978
  zoomRate: 0.015,
1114
979
  enableTransition: !1
1115
- }) : T("zoomOut", {
980
+ }) : A("zoomOut", {
1116
981
  zoomRate: 0.015,
1117
982
  enableTransition: !1
1118
983
  });
1119
- }), le(document, "keydown", a), le(document, We, r);
1120
- }, pe = () => {
1121
- Ie(document, "keydown", a), Ie(document, We, r), a = null, r = null;
1122
- }, _ = () => {
1123
- A.value = !1;
984
+ }), se(document, "keydown", a), se(document, je, i);
985
+ }, ve = () => {
986
+ xe(document, "keydown", a), xe(document, je, i), a = null, i = null;
987
+ }, U = () => {
988
+ k.value = !1;
1124
989
  }, f = (s) => {
1125
- A.value = !1, s.target.alt = "加载失败";
1126
- }, D = ze(), L = (s) => {
1127
- if (A.value || s.button !== 0)
990
+ k.value = !1, s.target.alt = "加载失败";
991
+ }, E = Te(), O = (s) => {
992
+ if (k.value || s.button !== 0)
1128
993
  return;
1129
- s.preventDefault(), s.stopPropagation(), clearTimeout(D.value), p.value = !0;
994
+ s.preventDefault(), s.stopPropagation(), clearTimeout(E.value), S.value = !0;
1130
995
  const {
1131
- offsetX: y,
1132
- offsetY: w
1133
- } = h.value, $ = s.pageX, b = s.pageY;
1134
- i = Me((I) => {
1135
- h.value = {
1136
- ...h.value,
1137
- offsetX: y + I.pageX - $,
1138
- offsetY: w + I.pageY - b
996
+ offsetX: m,
997
+ offsetY: b
998
+ } = d.value, C = s.pageX, v = s.pageY;
999
+ r = Me((M) => {
1000
+ d.value = {
1001
+ ...d.value,
1002
+ offsetX: m + M.pageX - C,
1003
+ offsetY: b + M.pageY - v
1139
1004
  };
1140
- }), le(document, "mousemove", i), le(document, "mouseup", () => {
1141
- Ie(document, "mousemove", i), v.value && C.value && (D.value = setTimeout(() => {
1142
- p.value = !1;
1005
+ }), se(document, "mousemove", r), se(document, "mouseup", () => {
1006
+ xe(document, "mousemove", r), p.value && T.value && (E.value = setTimeout(() => {
1007
+ S.value = !1;
1143
1008
  }));
1144
1009
  });
1145
- }, E = () => {
1146
- h.value = {
1010
+ }, R = () => {
1011
+ d.value = {
1147
1012
  scale: 1,
1148
1013
  deg: 0,
1149
1014
  offsetX: 0,
@@ -1151,176 +1016,176 @@ const qt = /* @__PURE__ */ _e({
1151
1016
  enableTransition: !1
1152
1017
  };
1153
1018
  }, j = () => {
1154
- if (A.value)
1019
+ if (k.value)
1155
1020
  return;
1156
- const s = Object.keys(X), y = Object.values(X), w = W.value.name, b = (y.findIndex((I) => I.name === w) + 1) % s.length;
1157
- W.value = X[s[b]], E();
1158
- }, ae = () => {
1159
- if (K.value && !e.infinite)
1021
+ const s = Object.keys(_), m = Object.values(_), b = W.value.name, v = (m.findIndex((M) => M.name === b) + 1) % s.length;
1022
+ W.value = _[s[v]], R();
1023
+ }, ne = () => {
1024
+ if (J.value && !e.infinite)
1160
1025
  return;
1161
1026
  const s = e.urlList.length;
1162
- d.value = (d.value - 1 + s) % s;
1163
- }, U = () => {
1164
- if (ee.value && !e.infinite)
1027
+ h.value = (h.value - 1 + s) % s;
1028
+ }, Z = () => {
1029
+ if (K.value && !e.infinite)
1165
1030
  return;
1166
1031
  const s = e.urlList.length;
1167
- d.value = (d.value + 1) % s;
1168
- }, T = (s, y = {}) => {
1169
- if (A.value)
1032
+ h.value = (h.value + 1) % s;
1033
+ }, A = (s, m = {}) => {
1034
+ if (k.value)
1170
1035
  return;
1171
1036
  const {
1172
- zoomRate: w,
1173
- rotateDeg: $,
1174
- enableTransition: b
1037
+ zoomRate: b,
1038
+ rotateDeg: C,
1039
+ enableTransition: v
1175
1040
  } = {
1176
1041
  zoomRate: 0.2,
1177
1042
  rotateDeg: 90,
1178
1043
  enableTransition: !0,
1179
- ...y
1044
+ ...m
1180
1045
  };
1181
1046
  switch (s) {
1182
1047
  case "zoomOut":
1183
- h.value.scale > 0.2 && (h.value.scale = parseFloat((h.value.scale - w).toFixed(3)));
1048
+ d.value.scale > 0.2 && (d.value.scale = parseFloat((d.value.scale - b).toFixed(3)));
1184
1049
  break;
1185
1050
  case "zoomIn":
1186
- h.value.scale = parseFloat((h.value.scale + w).toFixed(3));
1051
+ d.value.scale = parseFloat((d.value.scale + b).toFixed(3));
1187
1052
  break;
1188
1053
  case "clocelise":
1189
- h.value.deg += $;
1054
+ d.value.deg += C;
1190
1055
  break;
1191
1056
  case "anticlocelise":
1192
- h.value.deg -= $;
1057
+ d.value.deg -= C;
1193
1058
  break;
1194
1059
  }
1195
- h.value.enableTransition = b;
1196
- }, me = [{
1197
- icon: ((re = e.icons) == null ? void 0 : re.close) || c(lt, null, null),
1060
+ d.value.enableTransition = v;
1061
+ }, pe = [{
1062
+ icon: ((ae = e.icons) == null ? void 0 : ae.close) || u(nt, null, null),
1198
1063
  onClick: (s) => {
1199
- s.stopPropagation(), m(!1);
1064
+ s.stopPropagation(), x(!1);
1200
1065
  },
1201
1066
  type: "close"
1202
1067
  }, {
1203
- icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || c(ut, null, null),
1068
+ icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || u(at, null, null),
1204
1069
  onClick: (s) => {
1205
- s.stopPropagation(), T("zoomIn");
1070
+ s.stopPropagation(), A("zoomIn");
1206
1071
  },
1207
1072
  type: "zoomIn"
1208
1073
  }, {
1209
- icon: ((R = e.icons) == null ? void 0 : R.zoomOut) || c(ct, null, null),
1074
+ icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || u(it, null, null),
1210
1075
  onClick: (s) => {
1211
- s.stopPropagation(), T("zoomOut");
1076
+ s.stopPropagation(), A("zoomOut");
1212
1077
  },
1213
1078
  type: "zoomOut"
1214
1079
  }, {
1215
- icon: ((Z = e.icons) == null ? void 0 : Z.rotateRight) || c(ft, null, null),
1080
+ icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || u(rt, null, null),
1216
1081
  onClick: (s) => {
1217
- s.stopPropagation(), T("anticlocelise");
1082
+ s.stopPropagation(), A("anticlocelise");
1218
1083
  },
1219
1084
  type: "rotateRight"
1220
1085
  }, {
1221
- icon: (($e = e.icons) == null ? void 0 : $e.rotateLeft) || c(dt, null, null),
1086
+ icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || u(ot, null, null),
1222
1087
  onClick: (s) => {
1223
- s.stopPropagation(), T("clocelise");
1088
+ s.stopPropagation(), A("clocelise");
1224
1089
  },
1225
1090
  type: "rotateLeft"
1226
1091
  }];
1227
- return ue(te, () => {
1228
- Ue(() => {
1229
- P.value.complete || (A.value = !0);
1092
+ return le(ee, () => {
1093
+ Ye(() => {
1094
+ F.value.complete || (k.value = !0);
1230
1095
  });
1231
- }), ue(d, (s) => {
1232
- E(), t("switch", s);
1233
- }), ue(v, (s) => {
1234
- s && (C.value = s);
1235
- }), Xe(() => {
1236
- var s, y;
1237
- ve(), (y = (s = Y.value) == null ? void 0 : s.focus) == null || y.call(s);
1096
+ }), le(h, (s) => {
1097
+ R(), t("switch", s);
1098
+ }), le(p, (s) => {
1099
+ s && (T.value = s);
1100
+ }), Ue(() => {
1101
+ var s, m;
1102
+ ge(), (m = (s = Y.value) == null ? void 0 : s.focus) == null || m.call(s);
1238
1103
  }), n({
1239
- setOpen: z
1104
+ setOpen: $
1240
1105
  }), () => {
1241
- const s = Fe(`${o}-fade`), y = Fe(`${o}-zoom`);
1242
- return l(c(tt, {
1106
+ const s = $e(`${o}-fade`), m = $e(`${o}-zoom`);
1107
+ return l(u(_e, {
1243
1108
  to: e.getContainer || "body",
1244
1109
  disabled: !e.teleported
1245
1110
  }, {
1246
- default: () => [v.value && c("div", {
1247
- class: `${o}-root ${u.value}`
1248
- }, [c(Oe, s, {
1249
- default: () => [Le(c("div", {
1250
- class: `${o}-mask ${u.value}`
1251
- }, null), [[Ne, v.value && C.value]])]
1252
- }), c("div", {
1111
+ default: () => [p.value && u("div", {
1112
+ class: `${o}-root ${c.value}`
1113
+ }, [u(ke, s, {
1114
+ default: () => [ze(u("div", {
1115
+ class: `${o}-mask ${c.value}`
1116
+ }, null), [[Oe, p.value && T.value]])]
1117
+ }), u("div", {
1253
1118
  ref: Y,
1254
1119
  tabindex: -1,
1255
- class: [`${o}-wrapper`, `${u.value}`],
1256
- onClick: (w) => e.onHideOnClickModal && ge(w)
1257
- }, [c(Oe, Ze(y, {
1258
- onAfterLeave: () => ne()
1120
+ class: [`${o}-wrapper`, `${c.value}`],
1121
+ onClick: (b) => e.onHideOnClickModal && he(b)
1122
+ }, [u(ke, We(m, {
1123
+ onAfterLeave: () => te()
1259
1124
  }), {
1260
1125
  default: () => {
1261
- var w, $;
1262
- return [Le(c("div", {
1263
- class: `${o}-block ${u.value}`
1264
- }, [c("div", {
1265
- class: `${o}-content ${u.value}`
1266
- }, [c("div", {
1267
- class: `${o}-body ${u.value}`
1268
- }, [c("div", {
1269
- class: `${o}-operations-wrapper ${u.value}`,
1270
- onClick: (b) => b.stopPropagation()
1271
- }, [c("ul", {
1272
- class: `${o}-operations ${u.value}`
1273
- }, [me.map(({
1274
- icon: b,
1275
- onClick: I,
1276
- type: be
1277
- }) => c("li", {
1278
- class: `${o}-operations-operation ${u.value}`,
1279
- onClick: I,
1280
- key: be
1281
- }, [nt(b, {
1282
- class: `${o}-operations-icon ${u.value}`
1283
- })]))])]), c("div", {
1284
- class: `${o}-canvas ${u.value}`
1285
- }, [e.urlList.map((b, I) => c("img", {
1286
- ref: P,
1287
- class: `${o}-img ${u.value}`,
1126
+ var b, C;
1127
+ return [ze(u("div", {
1128
+ class: `${o}-block ${c.value}`
1129
+ }, [u("div", {
1130
+ class: `${o}-content ${c.value}`
1131
+ }, [u("div", {
1132
+ class: `${o}-body ${c.value}`
1133
+ }, [u("div", {
1134
+ class: `${o}-operations-wrapper ${c.value}`,
1135
+ onClick: (v) => v.stopPropagation()
1136
+ }, [u("ul", {
1137
+ class: `${o}-operations ${c.value}`
1138
+ }, [pe.map(({
1139
+ icon: v,
1140
+ onClick: M,
1141
+ type: me
1142
+ }) => u("li", {
1143
+ class: `${o}-operations-operation ${c.value}`,
1144
+ onClick: M,
1145
+ key: me
1146
+ }, [qe(v, {
1147
+ class: `${o}-operations-icon ${c.value}`
1148
+ })]))])]), u("div", {
1149
+ class: `${o}-canvas ${c.value}`
1150
+ }, [e.urlList.map((v, M) => u("img", {
1151
+ ref: F,
1152
+ class: `${o}-img ${c.value}`,
1288
1153
  style: {
1289
- ...he.value,
1290
- display: I === d.value ? "block" : "none"
1154
+ ...de.value,
1155
+ display: M === h.value ? "block" : "none"
1291
1156
  },
1292
- key: b,
1293
- src: b,
1294
- onLoad: () => _(),
1295
- onError: (be) => f(be),
1296
- onMousedown: L
1297
- }, null))]), G.value && c("div", {
1298
- class: [`${o}-switch-left`, d.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${u.value}`],
1299
- onClick: ae
1300
- }, [((w = e.icons) == null ? void 0 : w.left) || c(ht, null, null)]), G.value && c("div", {
1301
- class: [`${o}-switch-right`, d.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${u.value}`],
1302
- onClick: U
1303
- }, [(($ = e.icons) == null ? void 0 : $.right) || c(gt, null, null)])])])]), [[Ne, v.value && C.value]])];
1157
+ key: v,
1158
+ src: v,
1159
+ onLoad: () => U(),
1160
+ onError: (me) => f(me),
1161
+ onMousedown: O
1162
+ }, null))]), G.value && u("div", {
1163
+ class: [`${o}-switch-left`, h.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${c.value}`],
1164
+ onClick: ne
1165
+ }, [((b = e.icons) == null ? void 0 : b.left) || u(st, null, null)]), G.value && u("div", {
1166
+ class: [`${o}-switch-right`, h.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${c.value}`],
1167
+ onClick: Z
1168
+ }, [((C = e.icons) == null ? void 0 : C.right) || u(lt, null, null)])])])]), [[Oe, p.value && T.value]])];
1304
1169
  }
1305
1170
  })])])]
1306
1171
  }));
1307
1172
  };
1308
1173
  }
1309
- }), Ce = {
1174
+ }), Ie = {
1310
1175
  width: "100%",
1311
1176
  height: "100%"
1312
- }, Qt = (e) => ({
1177
+ }, Vt = (e) => ({
1313
1178
  [e.componentCls]: {
1314
1179
  display: "inline-block",
1315
1180
  position: "relative",
1316
1181
  overflow: "hidden",
1317
1182
  ["&-inner"]: {
1318
- ...Ce,
1183
+ ...Ie,
1319
1184
  verticalAlign: "top",
1320
1185
  opacity: 1
1321
1186
  },
1322
1187
  ["&-placeholder"]: {
1323
- ...Ce,
1188
+ ...Ie,
1324
1189
  backgroundColor: e.colorBgContainerDisabled,
1325
1190
  backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
1326
1191
  backgroundRepeat: "no-repeat",
@@ -1328,7 +1193,7 @@ const qt = /* @__PURE__ */ _e({
1328
1193
  backgroundSize: "30%"
1329
1194
  },
1330
1195
  ["&-error"]: {
1331
- ...Ce,
1196
+ ...Ie,
1332
1197
  display: "flex",
1333
1198
  alignItems: "center",
1334
1199
  justifyContent: "center",
@@ -1339,13 +1204,10 @@ const qt = /* @__PURE__ */ _e({
1339
1204
  cursor: "pointer"
1340
1205
  }
1341
1206
  }
1342
- }), Jt = Qe("Image", (e) => {
1343
- const t = Te(e);
1344
- return [Qt(t)];
1345
- }), Kt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1346
- let Ge = "";
1347
- const fe = /* @__PURE__ */ _e({
1348
- props: ce,
1207
+ }), Yt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1208
+ let Be = "";
1209
+ const ce = /* @__PURE__ */ Ve({
1210
+ props: ue,
1349
1211
  name: "GImage",
1350
1212
  emits: ["error", "click", "load"],
1351
1213
  setup(e, {
@@ -1353,127 +1215,129 @@ const fe = /* @__PURE__ */ _e({
1353
1215
  emit: n,
1354
1216
  attrs: a
1355
1217
  }) {
1356
- const r = Q({
1218
+ const i = Ge({
1357
1219
  suffixCls: "image"
1358
- }), [i, o] = Jt(r), l = x(), u = x(""), p = x(!1), v = x(!0), z = x(!1), C = x(null), m = x();
1359
- let A, d;
1360
- const Y = M(() => !q && e.fit ? {
1220
+ }), {
1221
+ wrapSSR: r,
1222
+ hashId: o
1223
+ } = vt("Image", [Vt], i), l = w(), c = w(""), S = w(!1), p = w(!0), $ = w(!1), T = w(null), x = w();
1224
+ let k, h;
1225
+ const Y = L(() => !q && e.fit ? {
1361
1226
  "object-fit": e.fit
1362
- } : {}), P = M(() => {
1227
+ } : {}), F = L(() => {
1363
1228
  const {
1364
1229
  previewSrcList: f
1365
1230
  } = e;
1366
1231
  return Array.isArray(f) && f.length > 0;
1367
- }), W = M(() => {
1232
+ }), W = L(() => {
1368
1233
  const {
1369
1234
  src: f,
1370
- previewSrcList: D,
1371
- initialIndex: L
1235
+ previewSrcList: E,
1236
+ initialIndex: O
1372
1237
  } = e;
1373
- if (L || L === 0)
1374
- return D.length >= L ? L : 0;
1375
- let E = 0;
1376
- const j = D.indexOf(f);
1377
- return j >= 0 && (E = j), E;
1378
- }), h = () => {
1379
- q || (v.value = !0, p.value = !1, e.src ? u.value = e.src : ne());
1238
+ if (O || O === 0)
1239
+ return E.length >= O ? O : 0;
1240
+ let R = 0;
1241
+ const j = E.indexOf(f);
1242
+ return j >= 0 && (R = j), R;
1243
+ }), d = () => {
1244
+ q || (p.value = !0, S.value = !1, e.src ? c.value = e.src : te());
1380
1245
  };
1381
1246
  function G() {
1382
- vt(C.value, m.value) && (h(), te());
1247
+ ut(T.value, x.value) && (d(), ee());
1383
1248
  }
1384
- const K = St(G, 200), ee = async () => {
1249
+ const J = mt(G, 200), K = async () => {
1385
1250
  if (q)
1386
1251
  return;
1387
- await Ue();
1252
+ await Ye();
1388
1253
  const {
1389
1254
  scrollContainer: f
1390
1255
  } = e;
1391
- Kt(f) ? m.value = f : pt(f) && f !== "" ? m.value = document.querySelector(f) ?? void 0 : C.value && (m.value = mt(C.value)), m.value && (A = He(m, "scroll", K), setTimeout(() => G(), 200));
1392
- }, te = () => {
1393
- q || !m.value || !K || (A(), m.value = void 0);
1256
+ Yt(f) ? x.value = f : ct(f) && f !== "" ? x.value = document.querySelector(f) ?? void 0 : T.value && (x.value = ft(T.value)), x.value && (k = Ee(x, "scroll", J), setTimeout(() => G(), 200));
1257
+ }, ee = () => {
1258
+ q || !x.value || !J || (k(), x.value = void 0);
1259
+ }, de = (f) => {
1260
+ p.value = !1, S.value = !1, n("load", f);
1261
+ }, te = (f) => {
1262
+ p.value = !1, S.value = !0, n("error", f);
1394
1263
  }, he = (f) => {
1395
- v.value = !1, p.value = !1, n("load", f);
1396
- }, ne = (f) => {
1397
- v.value = !1, p.value = !0, n("error", f);
1398
- }, ge = (f) => {
1399
1264
  if (f.ctrlKey) {
1400
1265
  if (f.deltaY < 0)
1401
1266
  return f.preventDefault(), !1;
1402
1267
  if (f.deltaY > 0)
1403
1268
  return f.preventDefault(), !1;
1404
1269
  }
1405
- }, ve = () => {
1406
- !P.value || e.disablePreview || (d = He("wheel", ge, {
1270
+ }, ge = () => {
1271
+ !F.value || e.disablePreview || (h = Ee("wheel", he, {
1407
1272
  passive: !1
1408
- }), Ge = document.body.style.overflow, document.body.style.overflow = "hidden", z.value = !0);
1409
- }, pe = () => {
1410
- d == null || d(), document.body.style.overflow = Ge, z.value = !1;
1273
+ }), Be = document.body.style.overflow, document.body.style.overflow = "hidden", $.value = !0);
1274
+ }, ve = () => {
1275
+ h == null || h(), document.body.style.overflow = Be, $.value = !1;
1411
1276
  };
1412
- ue(() => e.src, () => {
1413
- e.lazy ? (v.value = !0, p.value = !1, te(), ee()) : h();
1277
+ le(() => e.src, () => {
1278
+ e.lazy ? (p.value = !0, S.value = !1, ee(), K()) : d();
1414
1279
  });
1415
- const _ = (f) => bt(f) ? f + "px" : f;
1416
- return Xe(() => {
1417
- e.lazy ? ee() : h();
1280
+ const U = (f) => dt(f) ? f + "px" : f;
1281
+ return Ue(() => {
1282
+ e.lazy ? K() : d();
1418
1283
  }), () => {
1419
1284
  const {
1420
1285
  crossorigin: f,
1421
- decoding: D,
1422
- alt: L,
1423
- sizes: E,
1286
+ decoding: E,
1287
+ alt: O,
1288
+ sizes: R,
1424
1289
  srcset: j,
1425
- usemap: ae,
1426
- class: U,
1427
- style: T
1428
- } = a, me = {
1290
+ usemap: ne,
1291
+ class: Z,
1292
+ style: A = {}
1293
+ } = a, pe = {
1429
1294
  crossorigin: f,
1430
- decoding: D,
1431
- alt: L,
1432
- sizes: E,
1295
+ decoding: E,
1296
+ alt: O,
1297
+ sizes: R,
1433
1298
  srcset: j,
1434
- usemap: ae,
1299
+ usemap: ne,
1435
1300
  style: {
1436
1301
  ...Y.value,
1437
- height: e.height ? _(e.height) : void 0,
1438
- ...T
1302
+ height: e.height ? U(e.height) : void 0
1439
1303
  }
1440
- }, re = De(t, e, "fallback"), ie = De(t, e, "placeholder");
1441
- return at(() => {
1442
- var R, Z;
1443
- P.value && z.value ? (R = l.value) == null || R.setOpen(!0) : (Z = l.value) == null || Z.setOpen(!1);
1444
- }), i(c(rt, null, [c("div", {
1304
+ }, ae = Le(t, e, "fallback"), ie = Le(t, e, "placeholder");
1305
+ return Qe(() => {
1306
+ var D, X;
1307
+ F.value && $.value ? (D = l.value) == null || D.setOpen(!0) : (X = l.value) == null || X.setOpen(!1);
1308
+ }), r(u(Je, null, [u("div", {
1445
1309
  class: {
1446
1310
  [`${o.value}`]: !0,
1447
- [`${r}`]: !0,
1448
- [`${e.wrapperClassName}`]: e.wrapperClassName
1311
+ [`${i}`]: !0,
1312
+ [`${Z}`]: !!Z
1449
1313
  },
1450
- ref: (R) => C.value = R,
1314
+ ref: (D) => T.value = D,
1451
1315
  style: {
1452
- ...e.wrapperStyle,
1453
- width: e.width ? _(e.width) : void 0,
1454
- height: e.height ? _(e.height) : void 0,
1316
+ ...A,
1317
+ width: e.width ? U(e.width) : void 0,
1318
+ height: e.height ? U(e.height) : void 0,
1455
1319
  display: e.lazy ? "block" : void 0
1456
1320
  },
1457
1321
  onClick: () => {
1458
1322
  n("click");
1459
1323
  }
1460
- }, [v.value && (ie || c("div", {
1461
- class: `${r}-placeholder ${o.value}`
1462
- }, null)), p.value ? re || c("div", {
1463
- class: `${r}-error ${o.value}`
1464
- }, [it("加载失败")]) : u.value && c("img", Ze(me, {
1324
+ }, [p.value && (ie || u("div", {
1325
+ class: `${i}-placeholder ${o.value}`
1326
+ }, null)), S.value ? ae || u("div", {
1327
+ class: `${i}-error ${o.value}`
1328
+ }, [Ke("加载失败")]) : c.value && u("img", We(pe, {
1465
1329
  class: {
1466
1330
  [`${o.value}`]: !0,
1467
- [`${r}-inner`]: !0,
1468
- [`${r}-preview`]: P.value,
1469
- [`${U}`]: !!U
1331
+ [`${e.imageClassName}`]: !!e.imageClassName,
1332
+ [`${i}-inner`]: !0,
1333
+ [`${i}-preview`]: F.value
1470
1334
  },
1471
1335
  alt: e.alt,
1472
- src: u.value,
1473
- onLoad: he,
1474
- onError: ne,
1475
- onClick: () => ve()
1476
- }), null), c(qt, {
1336
+ src: c.value,
1337
+ onLoad: de,
1338
+ onError: te,
1339
+ onClick: () => ge()
1340
+ }), null), u(Bt, {
1477
1341
  ref: l,
1478
1342
  zIndex: e.zIndex,
1479
1343
  infinite: e.infinite,
@@ -1481,15 +1345,15 @@ const fe = /* @__PURE__ */ _e({
1481
1345
  urlList: e.previewSrcList,
1482
1346
  getContainer: e.getContainer,
1483
1347
  onHideOnClickModal: e.hideOnClickModal,
1484
- onClose: () => pe()
1348
+ onClose: () => ve()
1485
1349
  }, null)])]));
1486
1350
  };
1487
1351
  }
1488
1352
  });
1489
- fe.isWImage = !0;
1490
- fe.install = (e) => (e.component(fe.name, fe), e);
1353
+ ce.isWImage = !0;
1354
+ ce.install = (e) => (e.component(ce.name, ce), e);
1491
1355
  export {
1492
- fe as GImage,
1493
- qt as ImageViewer,
1494
- fe as default
1356
+ ce as GImage,
1357
+ Bt as ImageViewer,
1358
+ ce as default
1495
1359
  };