zan-layer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1150 @@
1
+ import { defineComponent as A, computed as I, openBlock as d, createElementBlock as m, normalizeStyle as V, createCommentVNode as p, createBlock as M, resolveDynamicComponent as lt, h as He, renderSlot as ee, createVNode as te, unref as x, withModifiers as re, normalizeClass as N, createElementVNode as B, toDisplayString as P, ref as b, watch as _, onMounted as ye, nextTick as D, Fragment as j, renderList as Ee, shallowRef as at, withDirectives as ke, vModelText as ot, vModelDynamic as st, useSlots as it, onUnmounted as ut, Teleport as rt, Transition as ct, withCtx as ce, render as Z, isVNode as Se } from "vue";
2
+ const dt = /* @__PURE__ */ A({
3
+ name: "Shade",
4
+ __name: "Shade",
5
+ props: {
6
+ visible: { type: [Boolean, String] },
7
+ opacity: {},
8
+ index: { type: [Number, Function] },
9
+ teleport: {},
10
+ teleportDisabled: { type: Boolean },
11
+ shadeStyle: { type: [Boolean, null, String, Object, Array] }
12
+ },
13
+ emits: ["shadeClick"],
14
+ setup(e, { emit: n }) {
15
+ const l = e, t = n, a = I(() => [
16
+ {
17
+ opacity: l.opacity,
18
+ position: l.teleportDisabled || l.teleport != "body" ? "absolute" : "fixed",
19
+ zIndex: l.index
20
+ },
21
+ l.shadeStyle
22
+ ]), i = () => {
23
+ t("shadeClick");
24
+ };
25
+ return (c, o) => e.visible ? (d(), m("div", {
26
+ key: 0,
27
+ class: "zan-layer-shade",
28
+ style: V(a.value),
29
+ onClick: i
30
+ }, null, 4)) : p("", !0);
31
+ }
32
+ }), ft = ["src"], mt = /* @__PURE__ */ A({
33
+ name: "Iframe",
34
+ __name: "Iframe",
35
+ props: {
36
+ src: {}
37
+ },
38
+ setup(e) {
39
+ const n = e, l = I(() => n.src);
40
+ return (t, a) => (d(), m("iframe", {
41
+ scrolling: "auto",
42
+ class: "zan-layer-iframe",
43
+ allowtransparency: "true",
44
+ frameborder: "0",
45
+ src: l.value
46
+ }, null, 8, ft));
47
+ }
48
+ }), oe = /* @__PURE__ */ A({
49
+ name: "ZanRender",
50
+ __name: "Render",
51
+ props: {
52
+ render: { type: Function }
53
+ },
54
+ setup(e) {
55
+ const n = e;
56
+ return (l, t) => (d(), M(lt(n.render())));
57
+ }
58
+ }), ne = function(e) {
59
+ return typeof e == "function" ? e() : typeof e == "string" ? He("span", e) : e;
60
+ };
61
+ function Me() {
62
+ const e = [], n = "0123456789abcdef";
63
+ for (let t = 0; t < 36; t++)
64
+ e[t] = n.substr(Math.floor(Math.random() * 16), 1);
65
+ return e[14] = "4", e[19] = n.substr(e[19] & 3 | 8, 1), e[8] = e[13] = e[18] = e[23] = "-", e.join("").replaceAll("-", "");
66
+ }
67
+ function vt(e, n, l) {
68
+ return e != "drawer" || e != 4 ? yt(n) : Ae(l, n);
69
+ }
70
+ function yt(e) {
71
+ return e === void 0 || e === "auto" ? [] : typeof e == "string" ? [e] : e[1] && e[1] === "auto" ? e[0] && e[0] === "auto" ? [] : [e[0]] : e[0] && e[0] === "auto" ? e[1] && e[1] != "auto" ? [void 0, e[1]] : [] : [...e];
72
+ }
73
+ function Ae(e, n = "30%") {
74
+ return n instanceof Array ? n : (n === "auto" && (n = "30%"), e === "l" || e === "r" || e === "lt" || e === "lb" || e === "rt" || e === "rb" ? [n, "100%"] : e === "t" || e === "b" || e === "tr" || e === "tl" || e === "br" || e === "bl" ? ["100%", n] : [n, "100%"]);
75
+ }
76
+ function de(e, n, l) {
77
+ const t = [
78
+ "t",
79
+ "r",
80
+ "b",
81
+ "l",
82
+ "lt",
83
+ "tl",
84
+ "lb",
85
+ "bl",
86
+ "rt",
87
+ "tr",
88
+ "rb",
89
+ "br"
90
+ ], a = [];
91
+ return e === "auto" && l == 4 && (e = "r"), typeof e == "string" ? t.indexOf(e) > -1 ? (e === "t" && (a[0] = "0px", a[1] = "calc(50% - " + n[0] + "/2)"), e === "l" && (a[0] = "calc(50% - " + n[1] + "/2)", a[1] = "0px"), e === "b" && (a[0] = "calc(100% - " + n[1] + ")", a[1] = "calc(50% - " + n[0] + "/2)"), e === "r" && (a[0] = "calc(50% - " + n[1] + "/2)", a[1] = "calc(100% - " + n[0] + ")"), (e === "lt" || e === "tl") && (a[0] = "0px", a[1] = "0px"), (e === "lb" || e === "bl") && (a[0] = "calc(100% - " + n[1] + ")", a[1] = "0px"), (e === "rt" || e === "tr") && (a[0] = "0px", a[1] = "calc(100% - " + n[0] + ")"), (e === "rb" || e === "br") && (a[0] = "calc(100% - " + n[1] + ")", a[1] = "calc(100% - " + n[0] + ")")) : e == "auto" ? (a[0] = "calc(50% - " + n[1] + "/2)", a[1] = "calc(50% - " + n[0] + "/2)") : (a[0] = e, a[1] = "calc(50% - " + n[0] + "/2)") : (a[0] = e[0], a[1] = e[1]), a;
92
+ }
93
+ function pt(e) {
94
+ return e === "dialog" || e == 0 ? 0 : e === "page" || e == 1 ? 1 : e === "iframe" || e == 2 ? 2 : e === "loading" || e == 3 ? 3 : e === "drawer" || e == 4 ? 4 : e === "photos" || e == 5 ? 5 : e === "notify" || e == 6 ? 6 : e === "prompt" || e == 7 ? 7 : 0;
95
+ }
96
+ function Le() {
97
+ return { w: "100%", h: "100%" };
98
+ }
99
+ function $e() {
100
+ return { t: "0px", l: "0px" };
101
+ }
102
+ function Ie(e) {
103
+ var t, a;
104
+ const n = (t = getComputedStyle(e, null)) == null ? void 0 : t.width, l = (a = getComputedStyle(e, null)) == null ? void 0 : a.height;
105
+ return [n, l];
106
+ }
107
+ const Q = [];
108
+ function q(e, n) {
109
+ let l = 0;
110
+ if (n) {
111
+ const t = Q.findIndex((a) => a === void 0);
112
+ t === -1 ? (Q.push(e), l = Q.length - 1) : (Q[t] = e, l = t);
113
+ } else
114
+ delete Q[Q.findIndex((t) => t == e)], l = -1;
115
+ return l;
116
+ }
117
+ function Be(e, n = !1) {
118
+ const l = ["rl"], t = "zan-layer-drawer-anim zan-layer-anim";
119
+ return e === "l" || e === "lt" || e === "lb" ? l[0] = "lr" : e === "r" || e === "rt" || e === "rb" ? l[0] = "rl" : e === "t" || e === "tr" || e === "tl" ? l[0] = "tb" : (e === "b" || e === "br" || e === "bl") && (l[0] = "bt"), n ? `${t}-${l[0]}-close` : `${t}-${l[0]}`;
120
+ }
121
+ async function Oe(e, n) {
122
+ const l = new Image();
123
+ return l.src = e, new Promise((a, i) => {
124
+ if (l.complete) {
125
+ a(t(l));
126
+ return;
127
+ }
128
+ const c = L.load(2, { shadeOpacity: "0" });
129
+ l.onload = () => {
130
+ L.close(c), a(t(l));
131
+ }, l.onerror = () => {
132
+ L.close(c), L.msg("图片加载失败"), i(!1);
133
+ };
134
+ });
135
+ function t(a) {
136
+ const i = [a.width, a.height], c = [window.innerWidth - 250, window.innerHeight - 250];
137
+ if (i[0] > c[0] || i[1] > c[1]) {
138
+ const o = [i[0] / c[0], i[1] / c[1]];
139
+ o[0] > o[1] ? (i[0] = i[0] / o[0], i[1] = i[1] / o[0]) : o[0] < o[1] && (i[0] = i[0] / o[1], i[1] = i[1] / o[1]);
140
+ }
141
+ return [i[0] + "px", i[1] + "px"];
142
+ }
143
+ }
144
+ function me(e, n) {
145
+ const l = document.getElementsByClassName(e);
146
+ for (let t = 0; t < l.length; t++) {
147
+ const a = l[t];
148
+ if (a.id === n)
149
+ return a;
150
+ }
151
+ }
152
+ function ht(e, n, l) {
153
+ const t = ["lt", "lb", "rt", "rb"];
154
+ let a = "0", i = "0", o = 15;
155
+ window.NotifiyQueen = window.NotifiyQueen || [];
156
+ const s = window.NotifiyQueen;
157
+ (typeof e != "string" || t.indexOf(e) === -1) && (e = "rt");
158
+ const f = s.filter((u) => {
159
+ if (u.offset === e)
160
+ return u;
161
+ });
162
+ let r = f.length > 0 ? f[f.length - 1] : null;
163
+ if (r)
164
+ if (r = me("zan-layer", r.id), e === "rt" || e === "lt")
165
+ o += r.offsetHeight + parseFloat(r.style.top);
166
+ else {
167
+ const u = parseFloat(r.style.top.split(" - ")[1]);
168
+ o += r.offsetHeight + u;
169
+ }
170
+ else
171
+ (e === "rb" || e === "lb") && (o += parseFloat(n[1]));
172
+ return e === "rt" ? (a = o + "px", i = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "rb" ? (a = "calc(100% - " + o + "px)", i = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "lt" ? (a = o + "px", i = "15px") : e === "lb" && (a = "calc(100% - " + o + "px)", i = "15px"), s.push({
173
+ id: l,
174
+ offset: e
175
+ }), [a, i];
176
+ }
177
+ function gt(e) {
178
+ const n = me("zan-layer", e);
179
+ if (!n) return;
180
+ const l = 15, t = n.offsetHeight;
181
+ window.NotifiyQueen = window.NotifiyQueen || [];
182
+ const a = window.NotifiyQueen, i = a.findIndex((r) => r.id === e), c = a[i].offset, o = a.filter((r) => {
183
+ if (r.offset === c)
184
+ return r;
185
+ }), s = o.findIndex((r) => r.id === e);
186
+ o.slice(s + 1).forEach((r) => {
187
+ const u = me("zan-layer", r.id);
188
+ if (c === "rt" || c === "lt")
189
+ u.style.top = parseFloat(u.style.top) - l - t + "px";
190
+ else {
191
+ const y = parseFloat(u.style.top.split(" - ")[1]) - l - t;
192
+ u.style.top = "calc(100% - " + y + "px)";
193
+ }
194
+ }), a.splice(i, 1);
195
+ }
196
+ function xt(e) {
197
+ const n = "zan-layer-drawer-anim zan-layer-anim";
198
+ let l = "";
199
+ return e === "lt" || e === "lb" ? l = "lr" : l = "rl", `${n}-${l}`;
200
+ }
201
+ const bt = /* @__PURE__ */ A({
202
+ name: "Header",
203
+ __name: "Header",
204
+ props: {
205
+ title: { type: [String, Object, Symbol, Function, Boolean] },
206
+ titleStyle: { type: [String, Boolean, null, Object, Array] },
207
+ move: { type: Boolean }
208
+ },
209
+ setup(e) {
210
+ const n = e, l = I(() => [n.move ? "cursor: move" : "", n.titleStyle]);
211
+ return (t, a) => (d(), m("div", {
212
+ class: "zan-layer-title",
213
+ style: V(l.value)
214
+ }, [
215
+ ee(t.$slots, "default", {}, () => [
216
+ te(oe, {
217
+ render: () => x(ne)(e.title)
218
+ }, null, 8, ["render"])
219
+ ])
220
+ ], 4));
221
+ }
222
+ }), zt = /* @__PURE__ */ A({
223
+ name: "Footer",
224
+ __name: "Footer",
225
+ props: {
226
+ footer: { type: [String, Object, Symbol, Function, Boolean] },
227
+ footerStyle: { type: [String, Boolean, null, Object, Array] }
228
+ },
229
+ setup(e) {
230
+ return (n, l) => (d(), m("div", {
231
+ class: "zan-layer-footer",
232
+ style: V(e.footerStyle)
233
+ }, [
234
+ ee(n.$slots, "default", {}, () => [
235
+ te(oe, {
236
+ render: () => x(ne)(e.footer)
237
+ }, null, 8, ["render"])
238
+ ])
239
+ ], 4));
240
+ }
241
+ }), Ct = { class: "zan-layer-setwin" }, wt = { class: "zan-tooltip" }, kt = { class: "zan-tooltip" }, St = /* @__PURE__ */ A({
242
+ name: "HeaderBtn",
243
+ __name: "HeaderBtn",
244
+ props: {
245
+ maxmin: { type: Boolean },
246
+ min: { type: Boolean },
247
+ max: { type: Boolean },
248
+ closeBtn: { type: [String, Boolean], default: "1" }
249
+ },
250
+ emits: ["onMin", "onMax", "onClose"],
251
+ setup(e, { emit: n }) {
252
+ const l = e, t = n, a = () => {
253
+ t("onMin");
254
+ }, i = () => {
255
+ t("onMax");
256
+ }, c = () => {
257
+ t("onClose");
258
+ };
259
+ return (o, s) => (d(), m("span", Ct, [
260
+ l.maxmin && !l.max ? (d(), m("i", {
261
+ key: 0,
262
+ class: N(["zan-icon-btn", l.min ? "zan-icon-full" : "zan-icon-min"]),
263
+ onClick: re(a, ["stop"])
264
+ }, [
265
+ B("span", wt, P(l.min ? "还原" : "最小化"), 1)
266
+ ], 2)) : p("", !0),
267
+ l.maxmin && !l.min ? (d(), m("i", {
268
+ key: 1,
269
+ class: N(["zan-icon-btn", l.max ? "zan-icon-restore" : "zan-icon-max"]),
270
+ onClick: re(i, ["stop"])
271
+ }, [
272
+ B("span", kt, P(l.max ? "还原" : "最大化"), 1)
273
+ ], 2)) : p("", !0),
274
+ l.closeBtn ? (d(), m("i", {
275
+ key: 2,
276
+ class: N(["zan-icon-btn zan-icon-close-btn", `zan-layer-close${e.closeBtn}`]),
277
+ onClick: re(c, ["stop"])
278
+ }, [...s[0] || (s[0] = [
279
+ B("span", { class: "zan-tooltip" }, "关闭", -1)
280
+ ])], 2)) : p("", !0)
281
+ ]));
282
+ }
283
+ }), Lt = (e, n) => {
284
+ const l = e.__vccOpts || e;
285
+ for (const [t, a] of n)
286
+ l[t] = a;
287
+ return l;
288
+ }, $t = /* @__PURE__ */ Lt(St, [["__scopeId", "data-v-8d683fcb"]]), It = { class: "zan-layer-phimg" }, Bt = ["src"], Ot = {
289
+ key: 0,
290
+ class: "zan-layer-imgsee"
291
+ }, Ft = {
292
+ key: 0,
293
+ class: "zan-layer-imguide"
294
+ }, Ht = {
295
+ key: 0,
296
+ class: "thumb-row"
297
+ }, Et = ["onClick"], Mt = ["src"], At = {
298
+ key: 1,
299
+ class: "zan-layer-imgtit"
300
+ }, Dt = { key: 0 }, Nt = { key: 1 }, Vt = /* @__PURE__ */ A({
301
+ name: "Photos",
302
+ __name: "Photos",
303
+ props: {
304
+ imgList: {},
305
+ startIndex: { default: 0 }
306
+ },
307
+ emits: ["resetCalculationPohtosArea"],
308
+ setup(e, { emit: n }) {
309
+ const l = n, t = e, a = b(t.startIndex);
310
+ _(a, () => {
311
+ l("resetCalculationPohtosArea", a.value);
312
+ });
313
+ const i = (s) => {
314
+ let r = a.value + s;
315
+ r < 0 && (r = t.imgList.length - 1), r >= t.imgList.length && (r = 0), a.value = r;
316
+ }, c = b(!1);
317
+ ye(() => {
318
+ D(() => {
319
+ setTimeout(() => {
320
+ c.value = !0;
321
+ }, 400);
322
+ });
323
+ });
324
+ const o = I(() => {
325
+ let s = !1;
326
+ return t.imgList.forEach((f) => {
327
+ f.thumb && (s = !0);
328
+ }), s;
329
+ });
330
+ return (s, f) => (d(), m("div", It, [
331
+ B("img", {
332
+ src: e.imgList[a.value].src
333
+ }, null, 8, Bt),
334
+ e.imgList.length > 0 ? (d(), m("div", Ot, [
335
+ e.imgList.length > 1 ? (d(), m("span", Ft, [
336
+ B("a", {
337
+ href: "javascript:;",
338
+ class: "zan-layer-iconext zan-layer-imgprev",
339
+ onClick: f[0] || (f[0] = (r) => i(-1))
340
+ }, "‹"),
341
+ B("a", {
342
+ href: "javascript:;",
343
+ class: "zan-layer-iconext zan-layer-imgnext",
344
+ onClick: f[1] || (f[1] = (r) => i(1))
345
+ }, "›")
346
+ ])) : p("", !0),
347
+ e.imgList.length > 1 || e.imgList[a.value].alt ? (d(), m("div", {
348
+ key: 1,
349
+ class: "zan-layer-imgbar",
350
+ style: V({ opacity: c.value ? 1 : 0 })
351
+ }, [
352
+ o.value ? (d(), m("div", Ht, [
353
+ (d(!0), m(j, null, Ee(e.imgList, (r, u) => (d(), m("div", {
354
+ class: "thumb-box",
355
+ key: "thumb-box" + u,
356
+ onClick: (y) => a.value = u
357
+ }, [
358
+ B("img", {
359
+ src: r.thumb
360
+ }, null, 8, Mt)
361
+ ], 8, Et))), 128)),
362
+ B("div", {
363
+ class: "thumb-box-border",
364
+ style: V({
365
+ left: `calc(calc( calc(100% - ${100 * e.imgList.length}px) / 2) + ${a.value * 100}px)`
366
+ })
367
+ }, null, 4)
368
+ ])) : (d(), m("span", At, [
369
+ e.imgList[a.value].alt ? (d(), m("span", Dt, P(e.imgList[a.value].alt), 1)) : p("", !0),
370
+ e.imgList.length > 1 ? (d(), m("em", Nt, P(a.value + 1) + " / " + P(e.imgList.length), 1)) : p("", !0)
371
+ ]))
372
+ ], 4)) : p("", !0)
373
+ ])) : p("", !0)
374
+ ]));
375
+ }
376
+ }), Pt = { class: "title" }, Tt = {
377
+ key: 0,
378
+ class: "content"
379
+ }, _t = ["innerHTML"], jt = /* @__PURE__ */ A({
380
+ name: "Notifiy",
381
+ __name: "Notifiy",
382
+ props: {
383
+ title: {},
384
+ content: {},
385
+ isHtmlFragment: { type: Boolean, default: !1 },
386
+ icon: {},
387
+ iconClass: {}
388
+ },
389
+ emits: ["close"],
390
+ setup(e, { emit: n }) {
391
+ const l = e, t = n, a = at(null), i = () => {
392
+ t("close");
393
+ };
394
+ function c(o, s) {
395
+ let f = o.className, r = f != "" ? " " : "", u = f + r + s;
396
+ o.className = u;
397
+ }
398
+ return ye(() => {
399
+ D(() => {
400
+ setTimeout(() => {
401
+ var o, s, f, r;
402
+ (s = (o = a.value) == null ? void 0 : o.parentElement) != null && s.parentElement && c(
403
+ (r = (f = a.value) == null ? void 0 : f.parentElement) == null ? void 0 : r.parentElement,
404
+ "zan-layer-notifiy-transition"
405
+ );
406
+ }, 300);
407
+ });
408
+ }), (o, s) => (d(), m("div", {
409
+ class: "zan-layer-notifiy-wrapper",
410
+ ref_key: "notifyRef",
411
+ ref: a
412
+ }, [
413
+ B("h2", Pt, [
414
+ e.icon ? (d(), m("i", {
415
+ key: 0,
416
+ class: N(e.iconClass)
417
+ }, null, 2)) : p("", !0),
418
+ B("span", null, P(e.title), 1)
419
+ ]),
420
+ !e.isHtmlFragment && e.content ? (d(), m("div", Tt, [
421
+ te(oe, {
422
+ render: () => x(ne)(l.content)
423
+ }, null, 8, ["render"])
424
+ ])) : e.isHtmlFragment && e.content ? (d(), m("div", {
425
+ key: 1,
426
+ class: "content",
427
+ innerHTML: e.content
428
+ }, null, 8, _t)) : p("", !0),
429
+ B("i", {
430
+ class: "zan-icon-close",
431
+ onClick: i
432
+ }, [...s[0] || (s[0] = [
433
+ B("svg", {
434
+ viewBox: "0 0 1024 1024",
435
+ width: "16",
436
+ height: "16"
437
+ }, [
438
+ B("path", {
439
+ d: "M810.666667 273.493333L750.506667 213.333333 512 451.84 273.493333 213.333333 213.333333 273.493333 451.84 512 213.333333 750.506667 273.493333 810.666667 512 572.16 750.506667 810.666667 810.666667 750.506667 572.16 512z",
440
+ fill: "currentColor"
441
+ })
442
+ ], -1)
443
+ ])])
444
+ ], 512));
445
+ }
446
+ }), Rt = ["maxlength", "placeholder"], Wt = ["type", "placeholder"], Xt = /* @__PURE__ */ A({
447
+ name: "Prompt",
448
+ __name: "Prompt",
449
+ props: {
450
+ promptValue: {},
451
+ formType: { default: "text" },
452
+ maxLength: {},
453
+ placeholder: { default: "" }
454
+ },
455
+ emits: ["update:promptValue"],
456
+ setup(e, { emit: n }) {
457
+ const l = e, t = b(l.promptValue), a = I(() => {
458
+ switch (typeof l.formType) {
459
+ case "string":
460
+ return l.formType === "textarea";
461
+ case "number":
462
+ return l.formType === 2;
463
+ default:
464
+ return !1;
465
+ }
466
+ }), i = I(
467
+ () => l.formType == 1 || l.formType == "password"
468
+ );
469
+ return (c, o) => a.value ? ke((d(), m("textarea", {
470
+ key: 0,
471
+ onInput: o[0] || (o[0] = (s) => c.$emit("update:promptValue", t.value)),
472
+ "onUpdate:modelValue": o[1] || (o[1] = (s) => t.value = s),
473
+ maxlength: l.maxLength,
474
+ placeholder: l.placeholder,
475
+ class: "zan-textarea"
476
+ }, null, 40, Rt)), [
477
+ [ot, t.value]
478
+ ]) : ke((d(), m("input", {
479
+ key: 1,
480
+ onInput: o[2] || (o[2] = (s) => c.$emit("update:promptValue", t.value)),
481
+ "onUpdate:modelValue": o[3] || (o[3] = (s) => t.value = s),
482
+ type: i.value ? "password" : "text",
483
+ placeholder: l.placeholder,
484
+ class: "zan-input"
485
+ }, null, 40, Wt)), [
486
+ [st, t.value]
487
+ ]);
488
+ }
489
+ });
490
+ function Yt(e) {
491
+ for (; e && e.parentNode; )
492
+ if (e = e.parentNode, e && getComputedStyle(e).position === "relative")
493
+ return e;
494
+ return null;
495
+ }
496
+ const ae = (e) => {
497
+ document.querySelectorAll(".zan-layer iframe").forEach((l) => {
498
+ l.style.pointerEvents = e;
499
+ });
500
+ }, Qt = function(e, n, l, t, a) {
501
+ let i, c, o = 0, s = 0, f = !0;
502
+ e != null && e.addEventListener("mousedown", function(r) {
503
+ if ((r.composedPath && r.composedPath() || r.path)[0].className === "zan-layer-title" && r.button == 0 && e != null) {
504
+ ae("none");
505
+ const y = getComputedStyle(e);
506
+ i = r.pageX - e.offsetLeft + parseInt(y["margin-left"]), c = r.pageY - e.offsetTop + parseInt(y["margin-right"]), o = r.clientX, s = r.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "move";
507
+ const $ = function(C) {
508
+ if (e != null) {
509
+ (C.clientX - o != 0 || C.clientY - s != 0) && f && (f = !1, a());
510
+ let h = C.pageX - i, g = C.pageY - c;
511
+ const k = document.documentElement.clientWidth, S = document.documentElement.clientHeight;
512
+ if (!n) {
513
+ let O = k - e.offsetWidth, F = S - e.offsetHeight;
514
+ if (e.style.position === "absolute") {
515
+ const E = Yt(e);
516
+ E != null && (O = E.clientWidth - e.offsetWidth, F = E.clientHeight - e.offsetHeight);
517
+ }
518
+ h < 0 ? h = 0 : h > O && (h = O), g < 0 ? g = 0 : g > F && (g = F);
519
+ }
520
+ e.style.top = g + "px", e.style.left = h + "px", l(e.style.left, e.style.top);
521
+ }
522
+ return !1;
523
+ }, H = function() {
524
+ f = !0, document.body.style.userSelect = "", document.body.style.cursor = "", t(), ae("auto"), document.removeEventListener("mousemove", $), document.removeEventListener("mouseup", H);
525
+ };
526
+ document.addEventListener("mousemove", $, { passive: !1 }), document.addEventListener("mouseup", H);
527
+ }
528
+ return !1;
529
+ });
530
+ }, Gt = function(e, n, l, t) {
531
+ let a = 0, i = 0, c = !0;
532
+ e != null && e.addEventListener("mousedown", function(o) {
533
+ if ((o.composedPath && o.composedPath() || o.path)[0].className === "zan-layer-resize" && o.button == 0 && e != null) {
534
+ ae("none");
535
+ const f = e.getBoundingClientRect(), r = f.left, u = f.top;
536
+ a = o.clientX, i = o.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "se-resize";
537
+ const y = function(H) {
538
+ var C;
539
+ if (window.getSelection != null && ((C = window.getSelection()) == null || C.removeAllRanges()), e != null) {
540
+ const h = H.clientX, g = H.clientY;
541
+ (h - a != 0 || g - i != 0) && c && (c = !1, t());
542
+ let k = h - r, S = g - u;
543
+ k < 260 && (k = 260), S < 115 && (S = 115), e.style.width = k + "px", e.style.height = S + "px", n(e.style.width, e.style.height);
544
+ }
545
+ return !1;
546
+ };
547
+ document.addEventListener("mousemove", y, { passive: !1 });
548
+ const $ = function() {
549
+ c = !0, document.body.style.userSelect = "", document.body.style.cursor = "", l(), ae("auto"), document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", $);
550
+ };
551
+ document.addEventListener("mouseup", $);
552
+ }
553
+ return !1;
554
+ });
555
+ }, Ut = Symbol("zIndex");
556
+ let Zt = 99999;
557
+ function Fe() {
558
+ return ++Zt;
559
+ }
560
+ const qt = ["id"], Kt = {
561
+ key: 1,
562
+ class: "slot-fragment"
563
+ }, Jt = ["innerHTML"], en = ["onClick"], tn = {
564
+ key: 2,
565
+ class: "zan-layer-resize"
566
+ }, ve = /* @__PURE__ */ A({
567
+ name: "ZanLayer",
568
+ __name: "ZanLayer",
569
+ props: {
570
+ modelValue: { type: Boolean, default: !1 },
571
+ type: { default: 1 },
572
+ title: { type: [String, Object, Symbol, Function, Boolean], default: "标题" },
573
+ footer: { type: [String, Object, Symbol, Function, Boolean] },
574
+ titleStyle: { type: [String, Boolean, null, Object, Array], default: "" },
575
+ footerStyle: { type: [String, Boolean, null, Object, Array] },
576
+ content: {},
577
+ isHtmlFragment: { type: Boolean, default: !1 },
578
+ offset: { default: () => "auto" },
579
+ area: { default: () => "auto" },
580
+ move: { type: Boolean, default: !0 },
581
+ maxmin: { type: Boolean, default: !1 },
582
+ resize: { type: Boolean, default: !1 },
583
+ shade: { type: Boolean, default: !0 },
584
+ shadeClose: { type: Boolean, default: !0 },
585
+ shadeStyle: { type: [Boolean, null, String, Object, Array] },
586
+ shadeOpacity: { default: "0.1" },
587
+ layerClasses: {},
588
+ zIndex: {},
589
+ closeBtn: { type: [Boolean, String], default: "1" },
590
+ btn: {},
591
+ btnAlign: { default: "r" },
592
+ anim: { default: 0 },
593
+ isOutAnim: { type: Boolean, default: !0 },
594
+ icon: {},
595
+ imgList: { default: () => [] },
596
+ startIndex: { default: 0 },
597
+ animDuration: { default: "0.3s" },
598
+ moveOut: { type: Boolean, default: !1 },
599
+ teleport: { default: "body" },
600
+ teleportDisabled: { type: Boolean, default: !1 },
601
+ lastPosition: { type: Boolean, default: !0 },
602
+ time: { default: 0 },
603
+ load: { default: 0 },
604
+ yesText: { default: "确定" },
605
+ formType: { default: "text" },
606
+ value: { default: "" },
607
+ maxLength: {},
608
+ placeholder: { default: "请输入内容" },
609
+ isMessage: { type: Boolean, default: !1 },
610
+ id: {},
611
+ isFunction: { type: Boolean, default: !1 },
612
+ appContext: {},
613
+ success: { type: Function, default: () => {
614
+ } },
615
+ end: { type: Function, default: () => {
616
+ } },
617
+ yes: {},
618
+ beforeClose: { type: Function, default: () => !0 },
619
+ close: { type: Function, default: () => {
620
+ } },
621
+ min: { type: Function, default: () => {
622
+ } },
623
+ full: { type: Function, default: () => {
624
+ } },
625
+ revert: { type: Function, default: () => {
626
+ } },
627
+ moveStart: { type: Function, default: () => {
628
+ } },
629
+ moving: { type: Function, default: () => {
630
+ } },
631
+ moveEnd: { type: Function, default: () => {
632
+ } },
633
+ resizeStart: { type: Function, default: () => {
634
+ } },
635
+ resizing: { type: Function, default: () => {
636
+ } },
637
+ resizeEnd: { type: Function, default: () => {
638
+ } },
639
+ internalDestroy: {}
640
+ },
641
+ emits: ["close", "update:modelValue"],
642
+ setup(e, { expose: n, emit: l }) {
643
+ const t = e, a = l, i = it(), c = b(!1), o = b(!1), s = b(t.id || Me()), f = b(null), r = b(), u = pt(t.type), y = b(
644
+ vt(t.type, t.area, t.offset)
645
+ ), $ = b(
646
+ de(t.offset, y.value, u)
647
+ ), H = b(99999), C = b(!1), h = b(y.value[0]), g = b(y.value[1]), k = b($.value[0]), S = b($.value[1]), O = b(""), F = b(""), E = b(""), R = b(""), G = b(t.value);
648
+ _(
649
+ () => t.value,
650
+ () => {
651
+ G.value = t.value;
652
+ }
653
+ );
654
+ const pe = () => {
655
+ H.value = t.zIndex ?? Fe();
656
+ };
657
+ _(
658
+ () => t.zIndex,
659
+ () => {
660
+ pe();
661
+ },
662
+ { immediate: !0 }
663
+ );
664
+ const he = function() {
665
+ D(async () => {
666
+ u == 4 && (y.value = Ae(t.offset, t.area)), u == 5 && (y.value = await Oe(
667
+ t.imgList[t.startIndex].src
668
+ ));
669
+ let v = y.value;
670
+ (v[0] == null || v[1] == null) && (v = Ie(f.value)), u == 6 && ($.value = ht(t.offset, v, s.value)), U(), we(), Ve();
671
+ });
672
+ }, De = function() {
673
+ o.value && ze(), c.value && xe(), O.value = "", F.value = "", E.value = "", R.value = "";
674
+ }, ge = () => {
675
+ E.value = k.value, R.value = S.value, O.value = h.value, F.value = g.value, h.value = Le().w, g.value = Le().h, k.value = $e().t, S.value = $e().l;
676
+ }, xe = () => {
677
+ c.value ? (X(), h.value = O.value, g.value = F.value, t.revert(s.value)) : (Y(), ge(), t.full(s.value)), c.value = !c.value;
678
+ }, be = () => {
679
+ let ue = 10 + 190 * q(s.value, !0);
680
+ const nt = document.documentElement.clientWidth;
681
+ ue + 180 > nt && (ue = 10), O.value = h.value, F.value = g.value, E.value = k.value, R.value = S.value, g.value = "51px", h.value = "180px", k.value = "calc(100% - 51px)", S.value = ue + "px";
682
+ }, ze = async () => {
683
+ o.value ? (X(), q(s.value, !1), h.value = O.value, g.value = F.value, t.revert(s.value)) : (Y(), be(), t.min(s.value)), o.value = !o.value;
684
+ };
685
+ _(
686
+ () => t.modelValue,
687
+ () => {
688
+ C.value = t.modelValue, C.value ? (he(), pe()) : De();
689
+ },
690
+ { deep: !0, immediate: !0 }
691
+ ), _(
692
+ () => C.value,
693
+ () => {
694
+ C.value && (t.isFunction && he(), D(() => {
695
+ t.success(s.value);
696
+ }));
697
+ },
698
+ { immediate: !0, flush: "post" }
699
+ ), _(
700
+ () => C.value,
701
+ () => {
702
+ C.value || t.end(s.value);
703
+ }
704
+ );
705
+ const Ne = I(() => [
706
+ {
707
+ "zan-layer-dialog": u === 0 || u === 7,
708
+ "zan-layer-page": u === 1,
709
+ "zan-layer-iframe": u === 2,
710
+ "zan-layer-loading": u === 3,
711
+ "zan-layer-drawer": u === 4,
712
+ "zan-layer-photos": u === 5,
713
+ "zan-layer-notifiy": u === 6,
714
+ "zan-layer-msg": t.isMessage,
715
+ "zan-layer-hui": t.isMessage && !t.icon
716
+ },
717
+ t.layerClasses
718
+ ]), Ve = function() {
719
+ t.move && u != 4 && D(() => {
720
+ f.value && (Qt(
721
+ f.value,
722
+ t.moveOut,
723
+ (v, z) => {
724
+ S.value = v, k.value = z, o.value || (R.value = v, E.value = z), t.moving(s.value, { top: z, left: v });
725
+ },
726
+ () => {
727
+ const v = {
728
+ left: S.value,
729
+ top: k.value,
730
+ isMin: o.value,
731
+ isMax: c.value
732
+ }, [z, w] = t.moveEnd(s.value, v) || [];
733
+ w && z && (S.value = z, k.value = w);
734
+ },
735
+ () => {
736
+ t.moveStart(s.value);
737
+ }
738
+ ), Gt(
739
+ f.value,
740
+ (v, z) => {
741
+ g.value = z, h.value = v, F.value = z, O.value = v, t.resizing(s.value, { width: v, height: z });
742
+ },
743
+ () => {
744
+ const v = {
745
+ width: h.value,
746
+ height: g.value
747
+ }, [z, w] = t.resizeEnd(s.value, v) || [];
748
+ z && w && (h.value = z, g.value = w);
749
+ },
750
+ () => {
751
+ t.resizeStart(s.value);
752
+ }
753
+ ));
754
+ });
755
+ }, Pe = I(() => ({
756
+ position: t.teleportDisabled || t.teleport != "body" ? "absolute" : "fixed",
757
+ top: k.value,
758
+ left: S.value,
759
+ height: g.value,
760
+ width: h.value,
761
+ animationDuration: t.animDuration,
762
+ zIndex: H.value
763
+ })), Te = I(() => [
764
+ u === 3 ? `zan-layer-loading${t.load}` : "",
765
+ t.icon ? "zan-layer-padding" : ""
766
+ ]), le = () => {
767
+ if (typeof t.beforeClose == "function") {
768
+ const v = t.beforeClose(s.value);
769
+ (v === void 0 || v != null && v === !0) && (t.close(s.value), a("close"), a("update:modelValue", !1), t.internalDestroy && t.internalDestroy(), o.value && q(s.value, !o.value));
770
+ }
771
+ }, _e = (...v) => {
772
+ typeof t.yes == "function" ? t.yes(...v) : le();
773
+ }, je = () => {
774
+ t.shadeClose && le();
775
+ }, Ce = I(() => ["zan-icon", `zan-icon-ico${t.icon}`]), Re = I(() => u === 4 ? Be(t.offset) : u === 6 ? xt(t.offset) : `zan-layer-anim-0${t.anim}`), We = I(() => u === 4 ? Be(t.offset, !0) : t.isOutAnim ? "zan-layer-anim-close" : ""), Xe = () => {
776
+ C.value = !0;
777
+ }, Ye = () => {
778
+ C.value = !1, u === 6 && gt(s.value);
779
+ }, Qe = I(() => C.value && t.shade && !o.value), Ge = I(() => t.resize && !c.value && !o.value), Ue = I(() => t.title && u != 3 && u != 5 && u != 6), Ze = function(v) {
780
+ D(async () => {
781
+ y.value = await Oe(t.imgList[v].src), $.value = de(t.offset, y.value, u), h.value = y.value[0], g.value = y.value[1], k.value = $.value[0], S.value = $.value[1], O.value = y.value[0], F.value = y.value[1];
782
+ });
783
+ }, qe = function() {
784
+ t.zIndex || (H.value = Fe());
785
+ };
786
+ ye(() => {
787
+ X();
788
+ }), ut(() => {
789
+ Y();
790
+ }), _(
791
+ () => t.modelValue,
792
+ () => {
793
+ t.modelValue ? X() : Y();
794
+ }
795
+ );
796
+ let W;
797
+ const X = function() {
798
+ D(() => {
799
+ r.value && !W && u != 6 && (W = new ResizeObserver((v) => {
800
+ f.value && ($.value = de(
801
+ t.offset,
802
+ Ie(f.value),
803
+ u
804
+ ), U(!0));
805
+ }), W.observe(r.value));
806
+ });
807
+ }, Y = function() {
808
+ W && r.value && (W.unobserve(r.value), W = void 0);
809
+ }, U = function(v = !1) {
810
+ k.value = v && t.lastPosition && E.value || $.value[0], S.value = v && t.lastPosition && R.value || $.value[1];
811
+ }, we = function() {
812
+ h.value = y.value[0], g.value = y.value[1], O.value = y.value[0], F.value = y.value[1];
813
+ }, Ke = function() {
814
+ X(), q(s.value, !1), o.value = !1, c.value = !1, E.value = "", R.value = "", U(), we(), t.modelValue || a("update:modelValue", !0);
815
+ }, Je = async function() {
816
+ o.value && (se(), U(!0)), c.value || (await D(), Y(), ge(), c.value = !0);
817
+ }, et = async function() {
818
+ c.value && (se(), U(!0)), o.value || (await D(), Y(), be(), o.value = !0);
819
+ }, se = () => {
820
+ X(), q(s.value, !1), o.value = !1, c.value = !1, h.value = O.value, g.value = F.value;
821
+ };
822
+ return n({ reset: Ke, open: Xe, close: Ye, full: Je, min: et, revert: se }), (v, z) => (d(), M(rt, {
823
+ to: e.teleport,
824
+ disabled: e.teleportDisabled
825
+ }, [
826
+ te(dt, {
827
+ index: H.value,
828
+ "shade-style": e.shadeStyle,
829
+ visible: Qe.value,
830
+ opacity: e.shadeOpacity,
831
+ teleport: e.teleport,
832
+ teleportDisabled: e.teleportDisabled,
833
+ onShadeClick: je
834
+ }, null, 8, ["index", "shade-style", "visible", "opacity", "teleport", "teleportDisabled"]),
835
+ te(ct, {
836
+ "enter-active-class": Re.value,
837
+ "leave-active-class": We.value
838
+ }, {
839
+ default: ce(() => [
840
+ C.value ? (d(), m("div", {
841
+ key: 0,
842
+ ref_key: "layerRef",
843
+ ref: f,
844
+ class: N(["zan-layer zan-layer-border", [Ne.value, { "zan-layer-min": o.value }]]),
845
+ id: s.value,
846
+ style: V(Pe.value)
847
+ }, [
848
+ Ue.value ? (d(), M(bt, {
849
+ key: 0,
850
+ title: e.title,
851
+ titleStyle: e.titleStyle,
852
+ move: e.move,
853
+ onMousedown: qe
854
+ }, {
855
+ default: ce(() => [
856
+ ee(v.$slots, "title")
857
+ ]),
858
+ _: 3
859
+ }, 8, ["title", "titleStyle", "move"])) : p("", !0),
860
+ B("div", {
861
+ ref_key: "contentRef",
862
+ ref: r,
863
+ class: N(["zan-layer-content", Te.value]),
864
+ style: V(o.value === !0 ? "display:none" : "")
865
+ }, [
866
+ x(u) === 0 || x(u) === 1 || x(u) === 4 ? (d(), m(j, { key: 0 }, [
867
+ e.icon ? (d(), m("i", {
868
+ key: 0,
869
+ class: N(Ce.value)
870
+ }, null, 2)) : p("", !0),
871
+ x(i).default ? (d(), m("div", Kt, [
872
+ ee(v.$slots, "default")
873
+ ])) : (d(), m(j, { key: 2 }, [
874
+ e.isHtmlFragment ? (d(), m("div", {
875
+ key: 0,
876
+ class: "html-fragment",
877
+ innerHTML: x(ne)(t.content)
878
+ }, null, 8, Jt)) : (d(), m(j, { key: 1 }, [
879
+ t.content ? (d(), M(oe, {
880
+ key: 0,
881
+ render: () => x(ne)(t.content)
882
+ }, null, 8, ["render"])) : p("", !0)
883
+ ], 64))
884
+ ], 64))
885
+ ], 64)) : p("", !0),
886
+ x(u) === 7 ? (d(), M(Xt, {
887
+ key: 1,
888
+ "prompt-value": G.value,
889
+ "onUpdate:promptValue": z[0] || (z[0] = (w) => G.value = w),
890
+ formType: t.formType,
891
+ maxLength: t.maxLength,
892
+ placeholder: t.placeholder
893
+ }, null, 8, ["prompt-value", "formType", "maxLength", "placeholder"])) : p("", !0),
894
+ x(u) === 2 ? (d(), M(mt, {
895
+ key: 2,
896
+ src: t.content
897
+ }, null, 8, ["src"])) : p("", !0),
898
+ x(u) === 5 ? (d(), M(Vt, {
899
+ key: 3,
900
+ imgList: t.imgList,
901
+ startIndex: t.startIndex,
902
+ onResetCalculationPohtosArea: Ze
903
+ }, null, 8, ["imgList", "startIndex"])) : p("", !0),
904
+ x(u) === 6 ? (d(), M(jt, {
905
+ key: 4,
906
+ onClose: le,
907
+ title: t.title,
908
+ content: t.content,
909
+ isHtmlFragment: t.isHtmlFragment,
910
+ icon: t.icon,
911
+ iconClass: Ce.value
912
+ }, null, 8, ["title", "content", "isHtmlFragment", "icon", "iconClass"])) : p("", !0)
913
+ ], 6),
914
+ x(u) != 3 && x(u) != 5 && x(u) != 6 ? (d(), M($t, {
915
+ key: 1,
916
+ maxmin: e.maxmin,
917
+ max: c.value,
918
+ min: o.value,
919
+ closeBtn: e.closeBtn,
920
+ onOnMin: ze,
921
+ onOnMax: xe,
922
+ onOnClose: le
923
+ }, null, 8, ["maxmin", "max", "min", "closeBtn"])) : p("", !0),
924
+ B("div", {
925
+ style: V(o.value === !0 ? "display:none" : "")
926
+ }, [
927
+ x(i).footer || t.footer ? (d(), M(zt, {
928
+ key: 0,
929
+ footer: t.footer,
930
+ footerStyle: t.footerStyle
931
+ }, {
932
+ default: ce(() => [
933
+ ee(v.$slots, "footer")
934
+ ]),
935
+ _: 3
936
+ }, 8, ["footer", "footerStyle"])) : (d(), m(j, { key: 1 }, [
937
+ (e.btn && e.btn.length > 0 || x(u) === 0 || x(u) === 7) && !e.isMessage ? (d(), m("div", {
938
+ key: 0,
939
+ class: N(["zan-layer-btn", [`zan-layer-btn-${e.btnAlign}`]])
940
+ }, [
941
+ e.btn && e.btn.length > 0 ? (d(!0), m(j, { key: 0 }, Ee(e.btn, (w, ie) => (d(), m("a", {
942
+ key: ie,
943
+ style: V(w.style),
944
+ class: N([
945
+ w.class,
946
+ `zan-layer-btn${ie}`,
947
+ { "zan-layer-btn-disabled": w.disabled }
948
+ ]),
949
+ onClick: (tt) => !w.disabled && (x(u) === 7 ? w.callback(s.value, G.value) : w.callback(s.value))
950
+ }, P(w.text), 15, en))), 128)) : (d(), m(j, { key: 1 }, [
951
+ x(u) === 0 || x(u) === 7 ? (d(), m("a", {
952
+ key: 0,
953
+ class: "zan-layer-btn0",
954
+ onClick: z[1] || (z[1] = (w) => _e(s.value, G.value))
955
+ }, P(e.yesText), 1)) : p("", !0)
956
+ ], 64))
957
+ ], 2)) : p("", !0)
958
+ ], 64))
959
+ ], 4),
960
+ Ge.value ? (d(), m("span", tn)) : p("", !0)
961
+ ], 14, qt)) : p("", !0)
962
+ ]),
963
+ _: 3
964
+ }, 8, ["enter-active-class", "leave-active-class"])
965
+ ], 8, ["to", "disabled"]));
966
+ }
967
+ }), T = [], nn = (e) => {
968
+ T.push(e);
969
+ }, fe = (e) => {
970
+ T.forEach((n, l) => {
971
+ n.modalContainer.id === e && T.splice(l, 1);
972
+ });
973
+ }, ln = () => {
974
+ T.splice(0, T.length);
975
+ }, K = (e) => {
976
+ let n = !1;
977
+ return T.forEach((l, t) => {
978
+ l.modalContainer.id == e && (n = !0);
979
+ }), n;
980
+ }, J = (e) => {
981
+ let n = null;
982
+ return T.forEach((l, t) => {
983
+ l.modalContainer.id === e && (n = l);
984
+ }), n;
985
+ }, an = (e, n) => (e && (n = Object.assign(n, e)), n), on = (e) => {
986
+ const n = document.createElement("div");
987
+ return n.id = e.id, document.body.appendChild(n), n;
988
+ }, sn = (e) => typeof e == "function" ? Se(e()) ? { default: () => e() } : void 0 : Se(e) ? { default: () => e } : void 0, L = {
989
+ _context: null,
990
+ // 打开弹窗
991
+ open: (e) => {
992
+ const n = {};
993
+ return L.create(e, n);
994
+ },
995
+ // 抽屉
996
+ drawer: (e) => {
997
+ const n = {
998
+ type: "drawer"
999
+ };
1000
+ return L.create(e, n);
1001
+ },
1002
+ // 消息
1003
+ msg: (e, n = {}, l) => {
1004
+ const t = {
1005
+ type: 0,
1006
+ title: !1,
1007
+ content: e,
1008
+ shadeClose: !1,
1009
+ closeBtn: !1,
1010
+ isMessage: !0,
1011
+ shade: !1,
1012
+ btn: void 0,
1013
+ time: 2e3
1014
+ };
1015
+ return L.create(n, t, l);
1016
+ },
1017
+ // 加载
1018
+ load: (e = 0, n = {}) => {
1019
+ const l = {
1020
+ type: 3,
1021
+ load: e,
1022
+ anim: 5,
1023
+ isOutAnim: !1,
1024
+ shadeClose: !1,
1025
+ shade: !0,
1026
+ shadeOpacity: "0.3"
1027
+ };
1028
+ return L.create(n, l);
1029
+ },
1030
+ // 确认
1031
+ confirm: (e, n = {}) => {
1032
+ const l = {
1033
+ type: 0,
1034
+ content: e,
1035
+ shadeClose: !1
1036
+ };
1037
+ return L.create(n, l);
1038
+ },
1039
+ // 通知
1040
+ notify: (e, n) => {
1041
+ e.type = 6;
1042
+ const l = {
1043
+ offset: "rt",
1044
+ time: 3e3,
1045
+ area: "auto",
1046
+ shade: !1
1047
+ };
1048
+ return L.create(e, l, n);
1049
+ },
1050
+ // 图片预览
1051
+ photos: (e) => {
1052
+ typeof e == "string" && (e = {
1053
+ imgList: [{ src: e }]
1054
+ });
1055
+ const n = {
1056
+ type: 5,
1057
+ anim: 2,
1058
+ startIndex: 0,
1059
+ isOutAnim: !0,
1060
+ shadeClose: !0,
1061
+ shadeOpacity: "0.2"
1062
+ };
1063
+ return L.create(e, n);
1064
+ },
1065
+ // 输入层
1066
+ prompt: (e) => {
1067
+ e.type = 7;
1068
+ const n = {
1069
+ type: "prompt",
1070
+ shadeClose: !1,
1071
+ shadeOpacity: "0.2"
1072
+ };
1073
+ return L.create(e, n);
1074
+ },
1075
+ // 创建弹窗
1076
+ create: (e, n, l) => {
1077
+ var o, s;
1078
+ let t;
1079
+ const a = an(e, n);
1080
+ a.hasOwnProperty("id") ? L.close(a.id) : a.id = Me();
1081
+ const i = on(a), c = He(
1082
+ ve,
1083
+ {
1084
+ ...a,
1085
+ isFunction: !0,
1086
+ internalDestroy() {
1087
+ var f, r;
1088
+ t && clearTimeout(t), (r = (f = c.component) == null ? void 0 : f.exposed) == null || r.close(), setTimeout(() => {
1089
+ Z(null, i), document.body.contains(i) && document.body.removeChild(i);
1090
+ }, 500), fe(i.id);
1091
+ }
1092
+ },
1093
+ sn(a.content)
1094
+ );
1095
+ return c.appContext = a.appContext || L._context, Z(c, i), (s = (o = c.component) == null ? void 0 : o.exposed) == null || s.open(), n && n.time != null && n.time != 0 && (t = setTimeout(() => {
1096
+ var f, r;
1097
+ (r = (f = c.component) == null ? void 0 : f.exposed) == null || r.close(), l && l(i.id), setTimeout(() => {
1098
+ Z(null, i), document.body.contains(i) && document.body.removeChild(i);
1099
+ }, 500), fe(i.id);
1100
+ }, n.time)), nn({ modalContainer: i, modalInstance: c }), i.id;
1101
+ },
1102
+ // 关闭弹窗
1103
+ close: (e) => {
1104
+ var n, l;
1105
+ if (e != null && K(e)) {
1106
+ const t = J(e);
1107
+ (l = (n = t.modalInstance.component) == null ? void 0 : n.exposed) == null || l.close(), setTimeout(() => {
1108
+ Z(null, t.modalContainer), document.body.contains(t.modalContainer) && document.body.removeChild(t.modalContainer);
1109
+ }, 500);
1110
+ }
1111
+ fe(e);
1112
+ },
1113
+ // 关闭所有弹窗
1114
+ closeAll: () => {
1115
+ T.forEach((e) => {
1116
+ var n, l;
1117
+ (l = (n = e.modalInstance.component) == null ? void 0 : n.exposed) == null || l.close(), setTimeout(() => {
1118
+ Z(null, e.modalContainer), document.body.contains(e.modalContainer) && document.body.removeChild(e.modalContainer);
1119
+ }, 500);
1120
+ }), ln();
1121
+ },
1122
+ // 重置位置
1123
+ reset: (e) => {
1124
+ var n, l;
1125
+ e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.reset());
1126
+ },
1127
+ // 最小化
1128
+ min: (e) => {
1129
+ var n, l;
1130
+ e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.min());
1131
+ },
1132
+ // 最大化
1133
+ full: (e) => {
1134
+ var n, l;
1135
+ e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.full());
1136
+ },
1137
+ // 复原最小/最大化
1138
+ revert: (e) => {
1139
+ var n, l;
1140
+ e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.revert());
1141
+ }
1142
+ }, un = (e, n) => {
1143
+ L._context = e._context, e.component(ve.name, ve), e.config.globalProperties.$layer = L, n && typeof n.zIndex == "number" && e.provide(Ut, b(n.zIndex));
1144
+ }, cn = { install: un };
1145
+ export {
1146
+ ve as ZanLayer,
1147
+ cn as default,
1148
+ L as layer,
1149
+ L as zanLayer
1150
+ };