delta-comic-core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/dist/bundle.css +2 -0
- package/dist/bundle.js +4896 -0
- package/dist/bundle.js.map +1 -0
- package/dist/bundle.umd.cjs +3 -0
- package/dist/bundle.umd.cjs.map +1 -0
- package/dist/components/await.vue.d.ts +26 -0
- package/dist/components/content/unitCard.vue.d.ts +317 -0
- package/dist/components/content.vue.d.ts +43 -0
- package/dist/components/floatPopup.vue.d.ts +39 -0
- package/dist/components/image.vue.d.ts +63 -0
- package/dist/components/list.vue.d.ts +53 -0
- package/dist/components/loading.vue.d.ts +18 -0
- package/dist/components/popup.vue.d.ts +41 -0
- package/dist/components/routerTab.vue.d.ts +34 -0
- package/dist/components/text.vue.d.ts +23 -0
- package/dist/components/toggleIcon.vue.d.ts +42 -0
- package/dist/components/user/previewUser.vue.d.ts +94 -0
- package/dist/components/var.vue.d.ts +23 -0
- package/dist/components/waterfall.vue.d.ts +54 -0
- package/dist/config/index.d.ts +38 -0
- package/dist/index.d.ts +1112 -0
- package/dist/layout/user.d.ts +0 -0
- package/dist/plugin.d.ts +189 -0
- package/dist/stores/temp.d.ts +23 -0
- package/dist/struct/comment.d.ts +55 -0
- package/dist/struct/content.d.ts +70 -0
- package/dist/struct/ep.d.ts +14 -0
- package/dist/struct/image.d.ts +44 -0
- package/dist/struct/index.d.ts +14 -0
- package/dist/struct/item.d.ts +56 -0
- package/dist/struct/user.d.ts +21 -0
- package/dist/symbol.d.ts +3 -0
- package/dist/utils/data.d.ts +123 -0
- package/dist/utils/delay.d.ts +1 -0
- package/dist/utils/eventBus.d.ts +34 -0
- package/dist/utils/image.d.ts +5 -0
- package/dist/utils/layout.d.ts +8 -0
- package/dist/utils/message.d.ts +22 -0
- package/dist/utils/plugin.d.ts +1 -0
- package/dist/utils/request.d.ts +48 -0
- package/dist/utils/translate.d.ts +2 -0
- package/package.json +73 -0
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,4896 @@
|
|
|
1
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, customRef, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, hasInjectionContext, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeUnmount, onBeforeUpdate, onDeactivated, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toDisplayString, toRef, toValue, unref, useCssVars, useModel, useTemplateRef, vShow, watch, watchEffect, withCtx, withDirectives, withModifiers } from "vue";
|
|
2
|
+
import { ceil, debounce, defaultsDeep, entries, fromPairs, isArray, isEmpty, isError, isFunction, isNumber, isString, last, noop, random, remove, uniqBy } from "lodash-es";
|
|
3
|
+
import { onBeforeRouteLeave, useRoute } from "vue-router";
|
|
4
|
+
import { NButton, NEmpty, NIcon, NImage, NPopconfirm, NResult, NVirtualList, useThemeVars } from "naive-ui";
|
|
5
|
+
import { showImagePreview } from "vant";
|
|
6
|
+
import { defineStore } from "pinia";
|
|
7
|
+
import axios, { isAxiosError, isCancel } from "axios";
|
|
8
|
+
import { AnimatePresence, motion } from "motion-v";
|
|
9
|
+
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (e, n) => () => (n || e((n = { exports: {} }).exports, n), n.exports), __export = (e) => {
|
|
10
|
+
let n = {};
|
|
11
|
+
for (var r in e) __defProp(n, r, {
|
|
12
|
+
get: e[r],
|
|
13
|
+
enumerable: !0
|
|
14
|
+
});
|
|
15
|
+
return n;
|
|
16
|
+
}, __copyProps = (e, n, r, i) => {
|
|
17
|
+
if (n && typeof n == "object" || typeof n == "function") for (var a = __getOwnPropNames(n), o = 0, s = a.length, c; o < s; o++) c = a[o], !__hasOwnProp.call(e, c) && c !== r && __defProp(e, c, {
|
|
18
|
+
get: ((e) => n[e]).bind(null, c),
|
|
19
|
+
enumerable: !(i = __getOwnPropDesc(n, c)) || i.enumerable
|
|
20
|
+
});
|
|
21
|
+
return e;
|
|
22
|
+
}, __toESM = (e, n, r) => (r = e == null ? {} : __create(__getProtoOf(e)), __copyProps(n || !e || !e.__esModule ? __defProp(r, "default", {
|
|
23
|
+
value: e,
|
|
24
|
+
enumerable: !0
|
|
25
|
+
}) : r, e)), await_default = /* @__PURE__ */ defineComponent({
|
|
26
|
+
__name: "await",
|
|
27
|
+
props: {
|
|
28
|
+
promise: { type: Function },
|
|
29
|
+
autoLoad: { type: Boolean }
|
|
30
|
+
},
|
|
31
|
+
setup(e) {
|
|
32
|
+
let n = e, r = shallowRef(), i = async () => r.value = await n.promise();
|
|
33
|
+
return watch(() => [n.promise, n.autoLoad], (e) => {
|
|
34
|
+
n.autoLoad && i();
|
|
35
|
+
}, { immediate: !0 }), (e, n) => renderSlot(e.$slots, "default", {
|
|
36
|
+
load: i,
|
|
37
|
+
result: r.value
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
function noop$2() {}
|
|
42
|
+
var extend = Object.assign, inBrowser = typeof window < "u", isObject$2 = (e) => typeof e == "object" && !!e, isDef$1 = (e) => e != null, isFunction$1 = (e) => typeof e == "function", isPromise = (e) => isObject$2(e) && isFunction$1(e.then) && isFunction$1(e.catch), isNumeric = (e) => typeof e == "number" || /^\d+(\.\d+)?$/.test(e), isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : !1;
|
|
43
|
+
function get(e, n) {
|
|
44
|
+
let r = n.split("."), i = e;
|
|
45
|
+
return r.forEach((e) => {
|
|
46
|
+
i = isObject$2(i) ? i[e] ?? "" : "";
|
|
47
|
+
}), i;
|
|
48
|
+
}
|
|
49
|
+
function pick(e, n, r) {
|
|
50
|
+
return n.reduce((n, i) => ((!r || e[i] !== void 0) && (n[i] = e[i]), n), {});
|
|
51
|
+
}
|
|
52
|
+
var numericProp = [Number, String], truthProp = {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !0
|
|
55
|
+
}, makeRequiredProp = (e) => ({
|
|
56
|
+
type: e,
|
|
57
|
+
required: !0
|
|
58
|
+
}), makeArrayProp = () => ({
|
|
59
|
+
type: Array,
|
|
60
|
+
default: () => []
|
|
61
|
+
}), makeNumericProp = (e) => ({
|
|
62
|
+
type: numericProp,
|
|
63
|
+
default: e
|
|
64
|
+
}), makeStringProp = (e) => ({
|
|
65
|
+
type: String,
|
|
66
|
+
default: e
|
|
67
|
+
}), inBrowser$1 = typeof window < "u";
|
|
68
|
+
function raf(e) {
|
|
69
|
+
return inBrowser$1 ? requestAnimationFrame(e) : -1;
|
|
70
|
+
}
|
|
71
|
+
function cancelRaf(e) {
|
|
72
|
+
inBrowser$1 && cancelAnimationFrame(e);
|
|
73
|
+
}
|
|
74
|
+
function doubleRaf(e) {
|
|
75
|
+
raf(() => raf(e));
|
|
76
|
+
}
|
|
77
|
+
var isWindow = (e) => e === window, makeDOMRect = (e, n) => ({
|
|
78
|
+
top: 0,
|
|
79
|
+
left: 0,
|
|
80
|
+
right: e,
|
|
81
|
+
bottom: n,
|
|
82
|
+
width: e,
|
|
83
|
+
height: n
|
|
84
|
+
}), useRect = (e) => {
|
|
85
|
+
let n = unref(e);
|
|
86
|
+
if (isWindow(n)) {
|
|
87
|
+
let e = n.innerWidth, r = n.innerHeight;
|
|
88
|
+
return makeDOMRect(e, r);
|
|
89
|
+
}
|
|
90
|
+
return n?.getBoundingClientRect ? n.getBoundingClientRect() : makeDOMRect(0, 0);
|
|
91
|
+
};
|
|
92
|
+
function useParent(e) {
|
|
93
|
+
let n = inject(e, null);
|
|
94
|
+
if (n) {
|
|
95
|
+
let e = getCurrentInstance(), { link: r, unlink: a, internalChildren: o } = n;
|
|
96
|
+
r(e), onUnmounted(() => a(e));
|
|
97
|
+
let s = computed(() => o.indexOf(e));
|
|
98
|
+
return {
|
|
99
|
+
parent: n,
|
|
100
|
+
index: s
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
parent: null,
|
|
105
|
+
index: ref(-1)
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function flattenVNodes(e) {
|
|
109
|
+
let n = [], r = (e) => {
|
|
110
|
+
Array.isArray(e) && e.forEach((e) => {
|
|
111
|
+
isVNode(e) && (n.push(e), e.component?.subTree && (n.push(e.component.subTree), r(e.component.subTree.children)), e.children && r(e.children));
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
return r(e), n;
|
|
115
|
+
}
|
|
116
|
+
var findVNodeIndex = (e, n) => {
|
|
117
|
+
let r = e.indexOf(n);
|
|
118
|
+
return r === -1 ? e.findIndex((e) => n.key !== void 0 && n.key !== null && e.type === n.type && e.key === n.key) : r;
|
|
119
|
+
};
|
|
120
|
+
function sortChildren(e, n, r) {
|
|
121
|
+
let i = flattenVNodes(e.subTree.children);
|
|
122
|
+
r.sort((e, n) => findVNodeIndex(i, e.vnode) - findVNodeIndex(i, n.vnode));
|
|
123
|
+
let a = r.map((e) => e.proxy);
|
|
124
|
+
n.sort((e, n) => {
|
|
125
|
+
let r = a.indexOf(e), i = a.indexOf(n);
|
|
126
|
+
return r - i;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function useChildren(e) {
|
|
130
|
+
let n = reactive([]), r = reactive([]), i = getCurrentInstance();
|
|
131
|
+
return {
|
|
132
|
+
children: n,
|
|
133
|
+
linkChildren: (a) => {
|
|
134
|
+
provide(e, Object.assign({
|
|
135
|
+
link: (e) => {
|
|
136
|
+
e.proxy && (r.push(e), n.push(e.proxy), sortChildren(i, n, r));
|
|
137
|
+
},
|
|
138
|
+
unlink: (e) => {
|
|
139
|
+
let i = r.indexOf(e);
|
|
140
|
+
n.splice(i, 1), r.splice(i, 1);
|
|
141
|
+
},
|
|
142
|
+
children: n,
|
|
143
|
+
internalChildren: r
|
|
144
|
+
}, a));
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function onMountedOrActivated(e) {
|
|
149
|
+
let n;
|
|
150
|
+
onMounted(() => {
|
|
151
|
+
e(), nextTick(() => {
|
|
152
|
+
n = !0;
|
|
153
|
+
});
|
|
154
|
+
}), onActivated(() => {
|
|
155
|
+
n && e();
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function useEventListener(e, n, r = {}) {
|
|
159
|
+
if (!inBrowser$1) return;
|
|
160
|
+
let { target: i = window, passive: a = !1, capture: o = !1 } = r, s = !1, c, l = (r) => {
|
|
161
|
+
if (s) return;
|
|
162
|
+
let i = unref(r);
|
|
163
|
+
i && !c && (i.addEventListener(e, n, {
|
|
164
|
+
capture: o,
|
|
165
|
+
passive: a
|
|
166
|
+
}), c = !0);
|
|
167
|
+
}, u = (r) => {
|
|
168
|
+
if (s) return;
|
|
169
|
+
let i = unref(r);
|
|
170
|
+
i && c && (i.removeEventListener(e, n, o), c = !1);
|
|
171
|
+
};
|
|
172
|
+
onUnmounted(() => u(i)), onDeactivated(() => u(i)), onMountedOrActivated(() => l(i));
|
|
173
|
+
let d;
|
|
174
|
+
return isRef(i) && (d = watch(i, (e, n) => {
|
|
175
|
+
u(n), l(e);
|
|
176
|
+
})), () => {
|
|
177
|
+
d?.(), u(i), s = !0;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
var width, height;
|
|
181
|
+
function useWindowSize$1() {
|
|
182
|
+
if (!width && (width = ref(0), height = ref(0), inBrowser$1)) {
|
|
183
|
+
let e = () => {
|
|
184
|
+
width.value = window.innerWidth, height.value = window.innerHeight;
|
|
185
|
+
};
|
|
186
|
+
e(), window.addEventListener("resize", e, { passive: !0 }), window.addEventListener("orientationchange", e, { passive: !0 });
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
width,
|
|
190
|
+
height
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
var overflowScrollReg = /scroll|auto|overlay/i, defaultRoot = inBrowser$1 ? window : void 0;
|
|
194
|
+
function isElement(e) {
|
|
195
|
+
return e.tagName !== "HTML" && e.tagName !== "BODY" && e.nodeType === 1;
|
|
196
|
+
}
|
|
197
|
+
function getScrollParent(e, n = defaultRoot) {
|
|
198
|
+
let r = e;
|
|
199
|
+
for (; r && r !== n && isElement(r);) {
|
|
200
|
+
let { overflowY: e } = window.getComputedStyle(r);
|
|
201
|
+
if (overflowScrollReg.test(e)) return r;
|
|
202
|
+
r = r.parentNode;
|
|
203
|
+
}
|
|
204
|
+
return n;
|
|
205
|
+
}
|
|
206
|
+
function useScrollParent(e, n = defaultRoot) {
|
|
207
|
+
let r = ref();
|
|
208
|
+
return onMounted(() => {
|
|
209
|
+
e.value && (r.value = getScrollParent(e.value, n));
|
|
210
|
+
}), r;
|
|
211
|
+
}
|
|
212
|
+
var visibility;
|
|
213
|
+
function usePageVisibility() {
|
|
214
|
+
if (!visibility && (visibility = ref("visible"), inBrowser$1)) {
|
|
215
|
+
let e = () => {
|
|
216
|
+
visibility.value = document.hidden ? "hidden" : "visible";
|
|
217
|
+
};
|
|
218
|
+
e(), window.addEventListener("visibilitychange", e);
|
|
219
|
+
}
|
|
220
|
+
return visibility;
|
|
221
|
+
}
|
|
222
|
+
function getScrollTop(e) {
|
|
223
|
+
let n = "scrollTop" in e ? e.scrollTop : e.pageYOffset;
|
|
224
|
+
return Math.max(n, 0);
|
|
225
|
+
}
|
|
226
|
+
function setScrollTop(e, n) {
|
|
227
|
+
"scrollTop" in e ? e.scrollTop = n : e.scrollTo(e.scrollX, n);
|
|
228
|
+
}
|
|
229
|
+
function getRootScrollTop() {
|
|
230
|
+
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
231
|
+
}
|
|
232
|
+
function setRootScrollTop(e) {
|
|
233
|
+
setScrollTop(window, e), setScrollTop(document.body, e);
|
|
234
|
+
}
|
|
235
|
+
function getElementTop(e, n) {
|
|
236
|
+
if (e === window) return 0;
|
|
237
|
+
let r = n ? getScrollTop(n) : getRootScrollTop();
|
|
238
|
+
return useRect(e).top + r;
|
|
239
|
+
}
|
|
240
|
+
isIOS$1();
|
|
241
|
+
var stopPropagation = (e) => e.stopPropagation();
|
|
242
|
+
function preventDefault(e, n) {
|
|
243
|
+
(typeof e.cancelable != "boolean" || e.cancelable) && e.preventDefault(), n && stopPropagation(e);
|
|
244
|
+
}
|
|
245
|
+
function isHidden(e) {
|
|
246
|
+
let n = unref(e);
|
|
247
|
+
if (!n) return !1;
|
|
248
|
+
let r = window.getComputedStyle(n), i = r.display === "none", a = n.offsetParent === null && r.position !== "fixed";
|
|
249
|
+
return i || a;
|
|
250
|
+
}
|
|
251
|
+
var { width: windowWidth, height: windowHeight } = useWindowSize$1();
|
|
252
|
+
function addUnit(e) {
|
|
253
|
+
if (isDef$1(e)) return isNumeric(e) ? `${e}px` : String(e);
|
|
254
|
+
}
|
|
255
|
+
function getSizeStyle(e) {
|
|
256
|
+
if (isDef$1(e)) {
|
|
257
|
+
if (Array.isArray(e)) return {
|
|
258
|
+
width: addUnit(e[0]),
|
|
259
|
+
height: addUnit(e[1])
|
|
260
|
+
};
|
|
261
|
+
let n = addUnit(e);
|
|
262
|
+
return {
|
|
263
|
+
width: n,
|
|
264
|
+
height: n
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function getZIndexStyle(e) {
|
|
269
|
+
let n = {};
|
|
270
|
+
return e !== void 0 && (n.zIndex = +e), n;
|
|
271
|
+
}
|
|
272
|
+
var rootFontSize;
|
|
273
|
+
function getRootFontSize() {
|
|
274
|
+
if (!rootFontSize) {
|
|
275
|
+
let e = document.documentElement, n = e.style.fontSize || window.getComputedStyle(e).fontSize;
|
|
276
|
+
rootFontSize = parseFloat(n);
|
|
277
|
+
}
|
|
278
|
+
return rootFontSize;
|
|
279
|
+
}
|
|
280
|
+
function convertRem(e) {
|
|
281
|
+
return e = e.replace(/rem/g, ""), +e * getRootFontSize();
|
|
282
|
+
}
|
|
283
|
+
function convertVw(e) {
|
|
284
|
+
return e = e.replace(/vw/g, ""), +e * windowWidth.value / 100;
|
|
285
|
+
}
|
|
286
|
+
function convertVh(e) {
|
|
287
|
+
return e = e.replace(/vh/g, ""), +e * windowHeight.value / 100;
|
|
288
|
+
}
|
|
289
|
+
function unitToPx(e) {
|
|
290
|
+
if (typeof e == "number") return e;
|
|
291
|
+
if (inBrowser) {
|
|
292
|
+
if (e.includes("rem")) return convertRem(e);
|
|
293
|
+
if (e.includes("vw")) return convertVw(e);
|
|
294
|
+
if (e.includes("vh")) return convertVh(e);
|
|
295
|
+
}
|
|
296
|
+
return parseFloat(e);
|
|
297
|
+
}
|
|
298
|
+
var camelizeRE$2 = /-(\w)/g, camelize$2 = (e) => e.replace(camelizeRE$2, (e, n) => n.toUpperCase()), kebabCase = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, ""), clamp$1 = (e, n, r) => Math.min(Math.max(e, n), r), { hasOwnProperty } = Object.prototype;
|
|
299
|
+
function assignKey(e, n, r) {
|
|
300
|
+
let i = n[r];
|
|
301
|
+
isDef$1(i) && (!hasOwnProperty.call(e, r) || !isObject$2(i) ? e[r] = i : e[r] = deepAssign(Object(e[r]), i));
|
|
302
|
+
}
|
|
303
|
+
function deepAssign(e, n) {
|
|
304
|
+
return Object.keys(n).forEach((r) => {
|
|
305
|
+
assignKey(e, n, r);
|
|
306
|
+
}), e;
|
|
307
|
+
}
|
|
308
|
+
var stdin_default$15 = {
|
|
309
|
+
name: "姓名",
|
|
310
|
+
tel: "电话",
|
|
311
|
+
save: "保存",
|
|
312
|
+
clear: "清空",
|
|
313
|
+
cancel: "取消",
|
|
314
|
+
confirm: "确认",
|
|
315
|
+
delete: "删除",
|
|
316
|
+
loading: "加载中...",
|
|
317
|
+
noCoupon: "暂无优惠券",
|
|
318
|
+
nameEmpty: "请填写姓名",
|
|
319
|
+
addContact: "添加联系人",
|
|
320
|
+
telInvalid: "请填写正确的电话",
|
|
321
|
+
vanCalendar: {
|
|
322
|
+
end: "结束",
|
|
323
|
+
start: "开始",
|
|
324
|
+
title: "日期选择",
|
|
325
|
+
weekdays: [
|
|
326
|
+
"日",
|
|
327
|
+
"一",
|
|
328
|
+
"二",
|
|
329
|
+
"三",
|
|
330
|
+
"四",
|
|
331
|
+
"五",
|
|
332
|
+
"六"
|
|
333
|
+
],
|
|
334
|
+
monthTitle: (e, n) => `${e}\u5E74${n}\u6708`,
|
|
335
|
+
rangePrompt: (e) => `\u6700\u591A\u9009\u62E9 ${e} \u5929`
|
|
336
|
+
},
|
|
337
|
+
vanCascader: { select: "请选择" },
|
|
338
|
+
vanPagination: {
|
|
339
|
+
prev: "上一页",
|
|
340
|
+
next: "下一页"
|
|
341
|
+
},
|
|
342
|
+
vanPullRefresh: {
|
|
343
|
+
pulling: "下拉即可刷新...",
|
|
344
|
+
loosing: "释放即可刷新..."
|
|
345
|
+
},
|
|
346
|
+
vanSubmitBar: { label: "合计:" },
|
|
347
|
+
vanCoupon: {
|
|
348
|
+
unlimited: "无门槛",
|
|
349
|
+
discount: (e) => `${e}\u6298`,
|
|
350
|
+
condition: (e) => `\u6EE1${e}\u5143\u53EF\u7528`
|
|
351
|
+
},
|
|
352
|
+
vanCouponCell: {
|
|
353
|
+
title: "优惠券",
|
|
354
|
+
count: (e) => `${e}\u5F20\u53EF\u7528`
|
|
355
|
+
},
|
|
356
|
+
vanCouponList: {
|
|
357
|
+
exchange: "兑换",
|
|
358
|
+
close: "不使用",
|
|
359
|
+
enable: "可用",
|
|
360
|
+
disabled: "不可用",
|
|
361
|
+
placeholder: "输入优惠码"
|
|
362
|
+
},
|
|
363
|
+
vanAddressEdit: {
|
|
364
|
+
area: "地区",
|
|
365
|
+
areaEmpty: "请选择地区",
|
|
366
|
+
addressEmpty: "请填写详细地址",
|
|
367
|
+
addressDetail: "详细地址",
|
|
368
|
+
defaultAddress: "设为默认收货地址"
|
|
369
|
+
},
|
|
370
|
+
vanAddressList: { add: "新增地址" }
|
|
371
|
+
}, lang = ref("zh-CN"), messages = reactive({ "zh-CN": stdin_default$15 }), stdin_default$14 = {
|
|
372
|
+
messages() {
|
|
373
|
+
return messages[lang.value];
|
|
374
|
+
},
|
|
375
|
+
use(e, n) {
|
|
376
|
+
lang.value = e, this.add({ [e]: n });
|
|
377
|
+
},
|
|
378
|
+
add(e = {}) {
|
|
379
|
+
deepAssign(messages, e);
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
function createTranslate(e) {
|
|
383
|
+
let n = camelize$2(e) + ".";
|
|
384
|
+
return (e, ...r) => {
|
|
385
|
+
let i = stdin_default$14.messages(), a = get(i, n + e) || get(i, e);
|
|
386
|
+
return isFunction$1(a) ? a(...r) : a;
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function genBem(e, n) {
|
|
390
|
+
return n ? typeof n == "string" ? ` ${e}--${n}` : Array.isArray(n) ? n.reduce((n, r) => n + genBem(e, r), "") : Object.keys(n).reduce((r, i) => r + (n[i] ? genBem(e, i) : ""), "") : "";
|
|
391
|
+
}
|
|
392
|
+
function createBEM(e) {
|
|
393
|
+
return (n, r) => (n && typeof n != "string" && (r = n, n = ""), n = n ? `${e}__${n}` : e, `${n}${genBem(n, r)}`);
|
|
394
|
+
}
|
|
395
|
+
function createNamespace(e) {
|
|
396
|
+
let n = `van-${e}`;
|
|
397
|
+
return [
|
|
398
|
+
n,
|
|
399
|
+
createBEM(n),
|
|
400
|
+
createTranslate(n)
|
|
401
|
+
];
|
|
402
|
+
}
|
|
403
|
+
var BORDER = "van-hairline";
|
|
404
|
+
`${BORDER}`, `${BORDER}`, `${BORDER}`, `${BORDER}`, `${BORDER}`;
|
|
405
|
+
var BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;
|
|
406
|
+
`${BORDER}`;
|
|
407
|
+
var HAPTICS_FEEDBACK = "van-haptics-feedback";
|
|
408
|
+
function callInterceptor(e, { args: n = [], done: r, canceled: i, error: a }) {
|
|
409
|
+
if (e) {
|
|
410
|
+
let o = e.apply(null, n);
|
|
411
|
+
isPromise(o) ? o.then((e) => {
|
|
412
|
+
e ? r() : i && i();
|
|
413
|
+
}).catch(a || noop$2) : o ? r() : i && i();
|
|
414
|
+
} else r();
|
|
415
|
+
}
|
|
416
|
+
function withInstall(e) {
|
|
417
|
+
return e.install = (n) => {
|
|
418
|
+
let { name: r } = e;
|
|
419
|
+
r && (n.component(r, e), n.component(camelize$2(`-${r}`), e));
|
|
420
|
+
}, e;
|
|
421
|
+
}
|
|
422
|
+
function closest(e, n) {
|
|
423
|
+
return e.reduce((e, r) => Math.abs(e - n) < Math.abs(r - n) ? e : r);
|
|
424
|
+
}
|
|
425
|
+
var POPUP_TOGGLE_KEY = Symbol();
|
|
426
|
+
function onPopupReopen(e) {
|
|
427
|
+
let n = inject(POPUP_TOGGLE_KEY, null);
|
|
428
|
+
n && watch(n, (n) => {
|
|
429
|
+
n && e();
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
function useExpose(e) {
|
|
433
|
+
let n = getCurrentInstance();
|
|
434
|
+
n && extend(n.proxy, e);
|
|
435
|
+
}
|
|
436
|
+
var routeProps = {
|
|
437
|
+
to: [String, Object],
|
|
438
|
+
url: String,
|
|
439
|
+
replace: Boolean
|
|
440
|
+
};
|
|
441
|
+
function route({ to: e, url: n, replace: r, $router: i }) {
|
|
442
|
+
e && i ? i[r ? "replace" : "push"](e) : n && (r ? location.replace(n) : location.href = n);
|
|
443
|
+
}
|
|
444
|
+
var [name$14, bem$14] = createNamespace("badge"), badgeProps = {
|
|
445
|
+
dot: Boolean,
|
|
446
|
+
max: numericProp,
|
|
447
|
+
tag: makeStringProp("div"),
|
|
448
|
+
color: String,
|
|
449
|
+
offset: Array,
|
|
450
|
+
content: numericProp,
|
|
451
|
+
showZero: truthProp,
|
|
452
|
+
position: makeStringProp("top-right")
|
|
453
|
+
}, stdin_default$13 = defineComponent({
|
|
454
|
+
name: name$14,
|
|
455
|
+
props: badgeProps,
|
|
456
|
+
setup(e, { slots: n }) {
|
|
457
|
+
let r = () => {
|
|
458
|
+
if (n.content) return !0;
|
|
459
|
+
let { content: r, showZero: i } = e;
|
|
460
|
+
return isDef$1(r) && r !== "" && (i || r !== 0 && r !== "0");
|
|
461
|
+
}, a = () => {
|
|
462
|
+
let { dot: i, max: a, content: o } = e;
|
|
463
|
+
if (!i && r()) return n.content ? n.content() : isDef$1(a) && isNumeric(o) && +o > +a ? `${a}+` : o;
|
|
464
|
+
}, o = (e) => e.startsWith("-") ? e.replace("-", "") : `-${e}`, s = computed(() => {
|
|
465
|
+
let r = { background: e.color };
|
|
466
|
+
if (e.offset) {
|
|
467
|
+
let [i, a] = e.offset, { position: s } = e, [c, l] = s.split("-");
|
|
468
|
+
n.default ? (typeof a == "number" ? r[c] = addUnit(c === "top" ? a : -a) : r[c] = c === "top" ? addUnit(a) : o(a), typeof i == "number" ? r[l] = addUnit(l === "left" ? i : -i) : r[l] = l === "left" ? addUnit(i) : o(i)) : (r.marginTop = addUnit(a), r.marginLeft = addUnit(i));
|
|
469
|
+
}
|
|
470
|
+
return r;
|
|
471
|
+
}), c = () => {
|
|
472
|
+
if (r() || e.dot) return createVNode("div", {
|
|
473
|
+
class: bem$14([e.position, {
|
|
474
|
+
dot: e.dot,
|
|
475
|
+
fixed: !!n.default
|
|
476
|
+
}]),
|
|
477
|
+
style: s.value
|
|
478
|
+
}, [a()]);
|
|
479
|
+
};
|
|
480
|
+
return () => {
|
|
481
|
+
if (n.default) {
|
|
482
|
+
let { tag: r } = e;
|
|
483
|
+
return createVNode(r, { class: bem$14("wrapper") }, { default: () => [n.default(), c()] });
|
|
484
|
+
}
|
|
485
|
+
return c();
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
}), Badge = withInstall(stdin_default$13), globalZIndex = 2e3, useGlobalZIndex = () => ++globalZIndex, setGlobalZIndex = (e) => {
|
|
489
|
+
globalZIndex = e;
|
|
490
|
+
}, [name$13, bem$13] = createNamespace("config-provider"), CONFIG_PROVIDER_KEY = Symbol(name$13), configProviderProps = {
|
|
491
|
+
tag: makeStringProp("div"),
|
|
492
|
+
theme: makeStringProp("light"),
|
|
493
|
+
zIndex: Number,
|
|
494
|
+
themeVars: Object,
|
|
495
|
+
themeVarsDark: Object,
|
|
496
|
+
themeVarsLight: Object,
|
|
497
|
+
themeVarsScope: makeStringProp("local"),
|
|
498
|
+
iconPrefix: String
|
|
499
|
+
};
|
|
500
|
+
function insertDash(e) {
|
|
501
|
+
return e.replace(/([a-zA-Z])(\d)/g, "$1-$2");
|
|
502
|
+
}
|
|
503
|
+
function mapThemeVarsToCSSVars(e) {
|
|
504
|
+
let n = {};
|
|
505
|
+
return Object.keys(e).forEach((r) => {
|
|
506
|
+
let i = insertDash(kebabCase(r));
|
|
507
|
+
n[`--van-${i}`] = e[r];
|
|
508
|
+
}), n;
|
|
509
|
+
}
|
|
510
|
+
function syncThemeVarsOnRoot(e = {}, n = {}) {
|
|
511
|
+
Object.keys(e).forEach((r) => {
|
|
512
|
+
e[r] !== n[r] && document.documentElement.style.setProperty(r, e[r]);
|
|
513
|
+
}), Object.keys(n).forEach((n) => {
|
|
514
|
+
e[n] || document.documentElement.style.removeProperty(n);
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
defineComponent({
|
|
518
|
+
name: name$13,
|
|
519
|
+
props: configProviderProps,
|
|
520
|
+
setup(e, { slots: n }) {
|
|
521
|
+
let r = computed(() => mapThemeVarsToCSSVars(extend({}, e.themeVars, e.theme === "dark" ? e.themeVarsDark : e.themeVarsLight)));
|
|
522
|
+
if (inBrowser) {
|
|
523
|
+
let n = () => {
|
|
524
|
+
document.documentElement.classList.add(`van-theme-${e.theme}`);
|
|
525
|
+
}, i = (n = e.theme) => {
|
|
526
|
+
document.documentElement.classList.remove(`van-theme-${n}`);
|
|
527
|
+
};
|
|
528
|
+
watch(() => e.theme, (e, r) => {
|
|
529
|
+
r && i(r), n();
|
|
530
|
+
}, { immediate: !0 }), onActivated(n), onDeactivated(i), onBeforeUnmount(i), watch(r, (n, r) => {
|
|
531
|
+
e.themeVarsScope === "global" && syncThemeVarsOnRoot(n, r);
|
|
532
|
+
}), watch(() => e.themeVarsScope, (e, n) => {
|
|
533
|
+
n === "global" && syncThemeVarsOnRoot({}, r.value), e === "global" && syncThemeVarsOnRoot(r.value, {});
|
|
534
|
+
}), e.themeVarsScope === "global" && syncThemeVarsOnRoot(r.value, {});
|
|
535
|
+
}
|
|
536
|
+
return provide(CONFIG_PROVIDER_KEY, e), watchEffect(() => {
|
|
537
|
+
e.zIndex !== void 0 && setGlobalZIndex(e.zIndex);
|
|
538
|
+
}), () => createVNode(e.tag, {
|
|
539
|
+
class: bem$13(),
|
|
540
|
+
style: e.themeVarsScope === "local" ? r.value : void 0
|
|
541
|
+
}, { default: () => [n.default?.call(n)] });
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
var [name$12, bem$12] = createNamespace("icon"), isImage = (e) => e?.includes("/"), iconProps = {
|
|
545
|
+
dot: Boolean,
|
|
546
|
+
tag: makeStringProp("i"),
|
|
547
|
+
name: String,
|
|
548
|
+
size: numericProp,
|
|
549
|
+
badge: numericProp,
|
|
550
|
+
color: String,
|
|
551
|
+
badgeProps: Object,
|
|
552
|
+
classPrefix: String
|
|
553
|
+
}, stdin_default$11 = defineComponent({
|
|
554
|
+
name: name$12,
|
|
555
|
+
props: iconProps,
|
|
556
|
+
setup(e, { slots: n }) {
|
|
557
|
+
let r = inject(CONFIG_PROVIDER_KEY, null), a = computed(() => e.classPrefix || r?.iconPrefix || bem$12());
|
|
558
|
+
return () => {
|
|
559
|
+
let { tag: r, dot: i, name: o, size: s, badge: c, color: l } = e, d = isImage(o);
|
|
560
|
+
return createVNode(Badge, mergeProps({
|
|
561
|
+
dot: i,
|
|
562
|
+
tag: r,
|
|
563
|
+
class: [a.value, d ? "" : `${a.value}-${o}`],
|
|
564
|
+
style: {
|
|
565
|
+
color: l,
|
|
566
|
+
fontSize: addUnit(s)
|
|
567
|
+
},
|
|
568
|
+
content: c
|
|
569
|
+
}, e.badgeProps), { default: () => [n.default?.call(n), d && createVNode("img", {
|
|
570
|
+
class: bem$12("image"),
|
|
571
|
+
src: o
|
|
572
|
+
}, null)] });
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
}), Icon = withInstall(stdin_default$11), [name$11, bem$11] = createNamespace("loading"), SpinIcon = Array(12).fill(null).map((e, n) => createVNode("i", { class: bem$11("line", String(n + 1)) }, null)), CircularIcon = createVNode("svg", {
|
|
576
|
+
class: bem$11("circular"),
|
|
577
|
+
viewBox: "25 25 50 50"
|
|
578
|
+
}, [createVNode("circle", {
|
|
579
|
+
cx: "50",
|
|
580
|
+
cy: "50",
|
|
581
|
+
r: "20",
|
|
582
|
+
fill: "none"
|
|
583
|
+
}, null)]), loadingProps = {
|
|
584
|
+
size: numericProp,
|
|
585
|
+
type: makeStringProp("circular"),
|
|
586
|
+
color: String,
|
|
587
|
+
vertical: Boolean,
|
|
588
|
+
textSize: numericProp,
|
|
589
|
+
textColor: String
|
|
590
|
+
}, stdin_default$10 = defineComponent({
|
|
591
|
+
name: name$11,
|
|
592
|
+
props: loadingProps,
|
|
593
|
+
setup(e, { slots: n }) {
|
|
594
|
+
let r = computed(() => extend({ color: e.color }, getSizeStyle(e.size))), a = () => {
|
|
595
|
+
let i = e.type === "spinner" ? SpinIcon : CircularIcon;
|
|
596
|
+
return createVNode("span", {
|
|
597
|
+
class: bem$11("spinner", e.type),
|
|
598
|
+
style: r.value
|
|
599
|
+
}, [n.icon ? n.icon() : i]);
|
|
600
|
+
}, o = () => {
|
|
601
|
+
if (n.default) return createVNode("span", {
|
|
602
|
+
class: bem$11("text"),
|
|
603
|
+
style: {
|
|
604
|
+
fontSize: addUnit(e.textSize),
|
|
605
|
+
color: e.textColor ?? e.color
|
|
606
|
+
}
|
|
607
|
+
}, [n.default()]);
|
|
608
|
+
};
|
|
609
|
+
return () => {
|
|
610
|
+
let { type: n, vertical: r } = e;
|
|
611
|
+
return createVNode("div", {
|
|
612
|
+
class: bem$11([n, { vertical: r }]),
|
|
613
|
+
"aria-live": "polite",
|
|
614
|
+
"aria-busy": !0
|
|
615
|
+
}, [a(), o()]);
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
}), Loading = withInstall(stdin_default$10), popupSharedProps = {
|
|
619
|
+
show: Boolean,
|
|
620
|
+
zIndex: numericProp,
|
|
621
|
+
overlay: truthProp,
|
|
622
|
+
duration: numericProp,
|
|
623
|
+
teleport: [String, Object],
|
|
624
|
+
lockScroll: truthProp,
|
|
625
|
+
lazyRender: truthProp,
|
|
626
|
+
beforeClose: Function,
|
|
627
|
+
overlayProps: Object,
|
|
628
|
+
overlayStyle: Object,
|
|
629
|
+
overlayClass: null,
|
|
630
|
+
transitionAppear: Boolean,
|
|
631
|
+
closeOnClickOverlay: truthProp
|
|
632
|
+
};
|
|
633
|
+
function getDirection(e, n) {
|
|
634
|
+
return e > n ? "horizontal" : n > e ? "vertical" : "";
|
|
635
|
+
}
|
|
636
|
+
function useTouch() {
|
|
637
|
+
let e = ref(0), n = ref(0), r = ref(0), i = ref(0), a = ref(0), o = ref(0), s = ref(""), c = ref(!0), l = () => s.value === "vertical", u = () => s.value === "horizontal", d = () => {
|
|
638
|
+
r.value = 0, i.value = 0, a.value = 0, o.value = 0, s.value = "", c.value = !0;
|
|
639
|
+
};
|
|
640
|
+
return {
|
|
641
|
+
move: (l) => {
|
|
642
|
+
let u = l.touches[0];
|
|
643
|
+
r.value = (u.clientX < 0 ? 0 : u.clientX) - e.value, i.value = u.clientY - n.value, a.value = Math.abs(r.value), o.value = Math.abs(i.value), (!s.value || a.value < 10 && o.value < 10) && (s.value = getDirection(a.value, o.value)), c.value && (a.value > 5 || o.value > 5) && (c.value = !1);
|
|
644
|
+
},
|
|
645
|
+
start: (r) => {
|
|
646
|
+
d(), e.value = r.touches[0].clientX, n.value = r.touches[0].clientY;
|
|
647
|
+
},
|
|
648
|
+
reset: d,
|
|
649
|
+
startX: e,
|
|
650
|
+
startY: n,
|
|
651
|
+
deltaX: r,
|
|
652
|
+
deltaY: i,
|
|
653
|
+
offsetX: a,
|
|
654
|
+
offsetY: o,
|
|
655
|
+
direction: s,
|
|
656
|
+
isVertical: l,
|
|
657
|
+
isHorizontal: u,
|
|
658
|
+
isTap: c
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
var totalLockCount = 0, BODY_LOCK_CLASS = "van-overflow-hidden";
|
|
662
|
+
function useLockScroll(e, n) {
|
|
663
|
+
let r = useTouch(), i = (n) => {
|
|
664
|
+
r.move(n);
|
|
665
|
+
let i = r.deltaY.value > 0 ? "10" : "01", { scrollHeight: a, offsetHeight: o, scrollTop: s } = getScrollParent(n.target, e.value), c = "11";
|
|
666
|
+
s === 0 ? c = o >= a ? "00" : "01" : s + o >= a && (c = "10"), c !== "11" && r.isVertical() && !(parseInt(c, 2) & parseInt(i, 2)) && preventDefault(n, !0);
|
|
667
|
+
}, a = () => {
|
|
668
|
+
document.addEventListener("touchstart", r.start), document.addEventListener("touchmove", i, { passive: !1 }), totalLockCount || document.body.classList.add(BODY_LOCK_CLASS), totalLockCount++;
|
|
669
|
+
}, o = () => {
|
|
670
|
+
totalLockCount && (document.removeEventListener("touchstart", r.start), document.removeEventListener("touchmove", i), totalLockCount--, totalLockCount || document.body.classList.remove(BODY_LOCK_CLASS));
|
|
671
|
+
}, s = () => n() && a(), c = () => n() && o();
|
|
672
|
+
onMountedOrActivated(s), onDeactivated(c), onBeforeUnmount(c), watch(n, (e) => {
|
|
673
|
+
e ? a() : o();
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
function useLazyRender(e) {
|
|
677
|
+
let n = ref(!1);
|
|
678
|
+
return watch(e, (e) => {
|
|
679
|
+
e && (n.value = e);
|
|
680
|
+
}, { immediate: !0 }), (e) => () => n.value ? e() : null;
|
|
681
|
+
}
|
|
682
|
+
var useScopeId = () => {
|
|
683
|
+
let { scopeId: e } = getCurrentInstance()?.vnode || {};
|
|
684
|
+
return e ? { [e]: "" } : null;
|
|
685
|
+
}, [name$10, bem$10] = createNamespace("overlay"), overlayProps = {
|
|
686
|
+
show: Boolean,
|
|
687
|
+
zIndex: numericProp,
|
|
688
|
+
duration: numericProp,
|
|
689
|
+
className: null,
|
|
690
|
+
lockScroll: truthProp,
|
|
691
|
+
lazyRender: truthProp,
|
|
692
|
+
customStyle: Object,
|
|
693
|
+
teleport: [String, Object]
|
|
694
|
+
}, stdin_default$9 = defineComponent({
|
|
695
|
+
name: name$10,
|
|
696
|
+
inheritAttrs: !1,
|
|
697
|
+
props: overlayProps,
|
|
698
|
+
setup(e, { attrs: i, slots: a }) {
|
|
699
|
+
let o = ref(), s = useLazyRender(() => e.show || !e.lazyRender), c = (n) => {
|
|
700
|
+
e.lockScroll && preventDefault(n, !0);
|
|
701
|
+
}, l = s(() => {
|
|
702
|
+
let n = extend(getZIndexStyle(e.zIndex), e.customStyle);
|
|
703
|
+
return isDef$1(e.duration) && (n.animationDuration = `${e.duration}s`), withDirectives(createVNode("div", mergeProps({
|
|
704
|
+
ref: o,
|
|
705
|
+
style: n,
|
|
706
|
+
class: [bem$10(), e.className]
|
|
707
|
+
}, i), [a.default?.call(a)]), [[vShow, e.show]]);
|
|
708
|
+
});
|
|
709
|
+
return useEventListener("touchmove", c, { target: o }), () => {
|
|
710
|
+
let i = createVNode(Transition, {
|
|
711
|
+
name: "van-fade",
|
|
712
|
+
appear: !0
|
|
713
|
+
}, { default: l });
|
|
714
|
+
return e.teleport ? createVNode(Teleport, { to: e.teleport }, { default: () => [i] }) : i;
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
}), Overlay = withInstall(stdin_default$9), popupProps = extend({}, popupSharedProps, {
|
|
718
|
+
round: Boolean,
|
|
719
|
+
position: makeStringProp("center"),
|
|
720
|
+
closeIcon: makeStringProp("cross"),
|
|
721
|
+
closeable: Boolean,
|
|
722
|
+
transition: String,
|
|
723
|
+
iconPrefix: String,
|
|
724
|
+
closeOnPopstate: Boolean,
|
|
725
|
+
closeIconPosition: makeStringProp("top-right"),
|
|
726
|
+
destroyOnClose: Boolean,
|
|
727
|
+
safeAreaInsetTop: Boolean,
|
|
728
|
+
safeAreaInsetBottom: Boolean
|
|
729
|
+
}), [name$9, bem$9] = createNamespace("popup"), stdin_default$8 = defineComponent({
|
|
730
|
+
name: name$9,
|
|
731
|
+
inheritAttrs: !1,
|
|
732
|
+
props: popupProps,
|
|
733
|
+
emits: [
|
|
734
|
+
"open",
|
|
735
|
+
"close",
|
|
736
|
+
"opened",
|
|
737
|
+
"closed",
|
|
738
|
+
"keydown",
|
|
739
|
+
"update:show",
|
|
740
|
+
"clickOverlay",
|
|
741
|
+
"clickCloseIcon"
|
|
742
|
+
],
|
|
743
|
+
setup(a, { emit: o, attrs: s, slots: c }) {
|
|
744
|
+
let l, d, f = ref(), p = ref(), m = useLazyRender(() => a.show || !a.lazyRender), h = computed(() => {
|
|
745
|
+
let e = { zIndex: f.value };
|
|
746
|
+
if (isDef$1(a.duration)) {
|
|
747
|
+
let n = a.position === "center" ? "animationDuration" : "transitionDuration";
|
|
748
|
+
e[n] = `${a.duration}s`;
|
|
749
|
+
}
|
|
750
|
+
return e;
|
|
751
|
+
}), g = () => {
|
|
752
|
+
l || (l = !0, f.value = a.zIndex === void 0 ? useGlobalZIndex() : +a.zIndex, o("open"));
|
|
753
|
+
}, v = () => {
|
|
754
|
+
l && callInterceptor(a.beforeClose, { done() {
|
|
755
|
+
l = !1, o("close"), o("update:show", !1);
|
|
756
|
+
} });
|
|
757
|
+
}, y = (e) => {
|
|
758
|
+
o("clickOverlay", e), a.closeOnClickOverlay && v();
|
|
759
|
+
}, b = () => {
|
|
760
|
+
if (a.overlay) {
|
|
761
|
+
let e = extend({
|
|
762
|
+
show: a.show,
|
|
763
|
+
class: a.overlayClass,
|
|
764
|
+
zIndex: f.value,
|
|
765
|
+
duration: a.duration,
|
|
766
|
+
customStyle: a.overlayStyle,
|
|
767
|
+
role: a.closeOnClickOverlay ? "button" : void 0,
|
|
768
|
+
tabindex: a.closeOnClickOverlay ? 0 : void 0
|
|
769
|
+
}, a.overlayProps);
|
|
770
|
+
return createVNode(Overlay, mergeProps(e, useScopeId(), { onClick: y }), { default: c["overlay-content"] });
|
|
771
|
+
}
|
|
772
|
+
}, S = (e) => {
|
|
773
|
+
o("clickCloseIcon", e), v();
|
|
774
|
+
}, C = () => {
|
|
775
|
+
if (a.closeable) return createVNode(Icon, {
|
|
776
|
+
role: "button",
|
|
777
|
+
tabindex: 0,
|
|
778
|
+
name: a.closeIcon,
|
|
779
|
+
class: [bem$9("close-icon", a.closeIconPosition), HAPTICS_FEEDBACK],
|
|
780
|
+
classPrefix: a.iconPrefix,
|
|
781
|
+
onClick: S
|
|
782
|
+
}, null);
|
|
783
|
+
}, D, O = () => {
|
|
784
|
+
D && clearTimeout(D), D = setTimeout(() => {
|
|
785
|
+
o("opened");
|
|
786
|
+
});
|
|
787
|
+
}, k = () => o("closed"), j = (e) => o("keydown", e), M = m(() => {
|
|
788
|
+
let { destroyOnClose: e, round: n, position: r, safeAreaInsetTop: i, safeAreaInsetBottom: o, show: l } = a;
|
|
789
|
+
if (!(!l && e)) return withDirectives(createVNode("div", mergeProps({
|
|
790
|
+
ref: p,
|
|
791
|
+
style: h.value,
|
|
792
|
+
role: "dialog",
|
|
793
|
+
tabindex: 0,
|
|
794
|
+
class: [bem$9({
|
|
795
|
+
round: n,
|
|
796
|
+
[r]: r
|
|
797
|
+
}), {
|
|
798
|
+
"van-safe-area-top": i,
|
|
799
|
+
"van-safe-area-bottom": o
|
|
800
|
+
}],
|
|
801
|
+
onKeydown: j
|
|
802
|
+
}, s, useScopeId()), [c.default?.call(c), C()]), [[vShow, l]]);
|
|
803
|
+
}), V = () => {
|
|
804
|
+
let { position: e, transition: n, transitionAppear: i } = a, o = e === "center" ? "van-fade" : `van-popup-slide-${e}`;
|
|
805
|
+
return createVNode(Transition, {
|
|
806
|
+
name: n || o,
|
|
807
|
+
appear: i,
|
|
808
|
+
onAfterEnter: O,
|
|
809
|
+
onAfterLeave: k
|
|
810
|
+
}, { default: M });
|
|
811
|
+
};
|
|
812
|
+
return watch(() => a.show, (e) => {
|
|
813
|
+
e && !l && (g(), s.tabindex === 0 && nextTick(() => {
|
|
814
|
+
var e;
|
|
815
|
+
(e = p.value) == null || e.focus();
|
|
816
|
+
})), !e && l && (l = !1, o("close"));
|
|
817
|
+
}), useExpose({ popupRef: p }), useLockScroll(p, () => a.show && a.lockScroll), useEventListener("popstate", () => {
|
|
818
|
+
a.closeOnPopstate && (v(), d = !1);
|
|
819
|
+
}), onMounted(() => {
|
|
820
|
+
a.show && g();
|
|
821
|
+
}), onActivated(() => {
|
|
822
|
+
d &&= (o("update:show", !0), !1);
|
|
823
|
+
}), onDeactivated(() => {
|
|
824
|
+
a.show && a.teleport && (v(), d = !0);
|
|
825
|
+
}), provide(POPUP_TOGGLE_KEY, () => a.show), () => a.teleport ? createVNode(Teleport, { to: a.teleport }, { default: () => [b(), V()] }) : createVNode(Fragment, null, [b(), V()]);
|
|
826
|
+
}
|
|
827
|
+
}), Popup = withInstall(stdin_default$8), useSyncPropRef = (e, n) => {
|
|
828
|
+
let r = ref(e());
|
|
829
|
+
return watch(e, (e) => {
|
|
830
|
+
e !== r.value && (r.value = e);
|
|
831
|
+
}), watch(r, (r) => {
|
|
832
|
+
r !== e() && n(r);
|
|
833
|
+
}), r;
|
|
834
|
+
};
|
|
835
|
+
process.env.NODE_ENV === "production" || Object.freeze({}), process.env.NODE_ENV === "production" || Object.freeze([]);
|
|
836
|
+
var isArray$1 = Array.isArray, isString$1 = (e) => typeof e == "string", isObject$1 = (e) => typeof e == "object" && !!e, cacheStringFunction$1 = (e) => {
|
|
837
|
+
let n = /* @__PURE__ */ Object.create(null);
|
|
838
|
+
return ((r) => n[r] || (n[r] = e(r)));
|
|
839
|
+
}, hyphenateRE$1 = /\B([A-Z])/g, hyphenate$1 = cacheStringFunction$1((e) => e.replace(hyphenateRE$1, "-$1").toLowerCase());
|
|
840
|
+
function normalizeStyle$1(e) {
|
|
841
|
+
if (isArray$1(e)) {
|
|
842
|
+
let n = {};
|
|
843
|
+
for (let r = 0; r < e.length; r++) {
|
|
844
|
+
let i = e[r], a = isString$1(i) ? parseStringStyle(i) : normalizeStyle$1(i);
|
|
845
|
+
if (a) for (let e in a) n[e] = a[e];
|
|
846
|
+
}
|
|
847
|
+
return n;
|
|
848
|
+
} else if (isString$1(e) || isObject$1(e)) return e;
|
|
849
|
+
}
|
|
850
|
+
var listDelimiterRE = /;(?![^(]*\))/g, propertyDelimiterRE = /:([^]+)/, styleCommentRE = /\/\*[^]*?\*\//g;
|
|
851
|
+
function parseStringStyle(e) {
|
|
852
|
+
let n = {};
|
|
853
|
+
return e.replace(styleCommentRE, "").split(listDelimiterRE).forEach((e) => {
|
|
854
|
+
if (e) {
|
|
855
|
+
let r = e.split(propertyDelimiterRE);
|
|
856
|
+
r.length > 1 && (n[r[0].trim()] = r[1].trim());
|
|
857
|
+
}
|
|
858
|
+
}), n;
|
|
859
|
+
}
|
|
860
|
+
function stringifyStyle(e) {
|
|
861
|
+
if (!e) return "";
|
|
862
|
+
if (isString$1(e)) return e;
|
|
863
|
+
let n = "";
|
|
864
|
+
for (let r in e) {
|
|
865
|
+
let i = e[r];
|
|
866
|
+
if (isString$1(i) || typeof i == "number") {
|
|
867
|
+
let e = r.startsWith("--") ? r : hyphenate$1(r);
|
|
868
|
+
n += `${e}:${i};`;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
return n;
|
|
872
|
+
}
|
|
873
|
+
function normalizeClass$1(e) {
|
|
874
|
+
let n = "";
|
|
875
|
+
if (isString$1(e)) n = e;
|
|
876
|
+
else if (isArray$1(e)) for (let r = 0; r < e.length; r++) {
|
|
877
|
+
let i = normalizeClass$1(e[r]);
|
|
878
|
+
i && (n += i + " ");
|
|
879
|
+
}
|
|
880
|
+
else if (isObject$1(e)) for (let r in e) e[r] && (n += r + " ");
|
|
881
|
+
return n.trim();
|
|
882
|
+
}
|
|
883
|
+
function scrollLeftTo(e, n, r) {
|
|
884
|
+
let i, a = 0, o = e.scrollLeft, s = r === 0 ? 1 : Math.round(r * 1e3 / 16), c = o;
|
|
885
|
+
function l() {
|
|
886
|
+
cancelRaf(i);
|
|
887
|
+
}
|
|
888
|
+
function u() {
|
|
889
|
+
c += (n - o) / s, e.scrollLeft = c, ++a < s && (i = raf(u));
|
|
890
|
+
}
|
|
891
|
+
return u(), l;
|
|
892
|
+
}
|
|
893
|
+
function scrollTopTo(e, n, r, i) {
|
|
894
|
+
let a, o = getScrollTop(e), s = o < n, c = r === 0 ? 1 : Math.round(r * 1e3 / 16), l = (n - o) / c;
|
|
895
|
+
function u() {
|
|
896
|
+
cancelRaf(a);
|
|
897
|
+
}
|
|
898
|
+
function d() {
|
|
899
|
+
o += l, (s && o > n || !s && o < n) && (o = n), setScrollTop(e, o), s && o < n || !s && o > n ? a = raf(d) : i && (a = raf(i));
|
|
900
|
+
}
|
|
901
|
+
return d(), u;
|
|
902
|
+
}
|
|
903
|
+
var current = 0;
|
|
904
|
+
function useId() {
|
|
905
|
+
let e = getCurrentInstance(), { name: n = "unknown" } = e?.type || {};
|
|
906
|
+
return process.env.NODE_ENV === "test" ? n : `${n}-${++current}`;
|
|
907
|
+
}
|
|
908
|
+
function useRefs() {
|
|
909
|
+
let e = ref([]), n = [];
|
|
910
|
+
return onBeforeUpdate(() => {
|
|
911
|
+
e.value = [];
|
|
912
|
+
}), [e, (r) => (n[r] || (n[r] = (n) => {
|
|
913
|
+
e.value[r] = n;
|
|
914
|
+
}), n[r])];
|
|
915
|
+
}
|
|
916
|
+
function useVisibilityChange(e, n) {
|
|
917
|
+
if (!inBrowser || !window.IntersectionObserver) return;
|
|
918
|
+
let r = new IntersectionObserver((e) => {
|
|
919
|
+
n(e[0].intersectionRatio > 0);
|
|
920
|
+
}, { root: document.body }), i = () => {
|
|
921
|
+
e.value && r.observe(e.value);
|
|
922
|
+
}, a = () => {
|
|
923
|
+
e.value && r.unobserve(e.value);
|
|
924
|
+
};
|
|
925
|
+
onDeactivated(a), onBeforeUnmount(a), onMountedOrActivated(i);
|
|
926
|
+
}
|
|
927
|
+
var [name$8, bem$8] = createNamespace("sticky"), stickyProps = {
|
|
928
|
+
zIndex: numericProp,
|
|
929
|
+
position: makeStringProp("top"),
|
|
930
|
+
container: Object,
|
|
931
|
+
offsetTop: makeNumericProp(0),
|
|
932
|
+
offsetBottom: makeNumericProp(0)
|
|
933
|
+
}, stdin_default$7 = defineComponent({
|
|
934
|
+
name: name$8,
|
|
935
|
+
props: stickyProps,
|
|
936
|
+
emits: ["scroll", "change"],
|
|
937
|
+
setup(e, { emit: n, slots: r }) {
|
|
938
|
+
let a = ref(), o = useScrollParent(a), s = reactive({
|
|
939
|
+
fixed: !1,
|
|
940
|
+
width: 0,
|
|
941
|
+
height: 0,
|
|
942
|
+
transform: 0
|
|
943
|
+
}), c = ref(!1), l = computed(() => unitToPx(e.position === "top" ? e.offsetTop : e.offsetBottom)), d = computed(() => {
|
|
944
|
+
if (c.value) return;
|
|
945
|
+
let { fixed: e, height: n, width: r } = s;
|
|
946
|
+
if (e) return {
|
|
947
|
+
width: `${r}px`,
|
|
948
|
+
height: `${n}px`
|
|
949
|
+
};
|
|
950
|
+
}), f = computed(() => {
|
|
951
|
+
if (!s.fixed || c.value) return;
|
|
952
|
+
let n = extend(getZIndexStyle(e.zIndex), {
|
|
953
|
+
width: `${s.width}px`,
|
|
954
|
+
height: `${s.height}px`,
|
|
955
|
+
[e.position]: `${l.value}px`
|
|
956
|
+
});
|
|
957
|
+
return s.transform && (n.transform = `translate3d(0, ${s.transform}px, 0)`), n;
|
|
958
|
+
}), p = (e) => n("scroll", {
|
|
959
|
+
scrollTop: e,
|
|
960
|
+
isFixed: s.fixed
|
|
961
|
+
}), m = () => {
|
|
962
|
+
if (!a.value || isHidden(a)) return;
|
|
963
|
+
let { container: n, position: r } = e, i = useRect(a), o = getScrollTop(window);
|
|
964
|
+
if (s.width = i.width, s.height = i.height, r === "top") if (n) {
|
|
965
|
+
let e = useRect(n), r = e.bottom - l.value - s.height;
|
|
966
|
+
s.fixed = l.value > i.top && e.bottom > 0, s.transform = r < 0 ? r : 0;
|
|
967
|
+
} else s.fixed = l.value > i.top;
|
|
968
|
+
else {
|
|
969
|
+
let { clientHeight: e } = document.documentElement;
|
|
970
|
+
if (n) {
|
|
971
|
+
let r = useRect(n), a = e - r.top - l.value - s.height;
|
|
972
|
+
s.fixed = e - l.value < i.bottom && e > r.top, s.transform = a < 0 ? -a : 0;
|
|
973
|
+
} else s.fixed = e - l.value < i.bottom;
|
|
974
|
+
}
|
|
975
|
+
p(o);
|
|
976
|
+
};
|
|
977
|
+
return watch(() => s.fixed, (e) => n("change", e)), useEventListener("scroll", m, {
|
|
978
|
+
target: o,
|
|
979
|
+
passive: !0
|
|
980
|
+
}), useVisibilityChange(a, m), watch([windowWidth, windowHeight], () => {
|
|
981
|
+
!a.value || isHidden(a) || !s.fixed || (c.value = !0, nextTick(() => {
|
|
982
|
+
let e = useRect(a);
|
|
983
|
+
s.width = e.width, s.height = e.height, c.value = !1;
|
|
984
|
+
}));
|
|
985
|
+
}), () => createVNode("div", {
|
|
986
|
+
ref: a,
|
|
987
|
+
style: d.value
|
|
988
|
+
}, [createVNode("div", {
|
|
989
|
+
class: bem$8({ fixed: s.fixed && !c.value }),
|
|
990
|
+
style: f.value
|
|
991
|
+
}, [r.default?.call(r)])]);
|
|
992
|
+
}
|
|
993
|
+
}), Sticky = withInstall(stdin_default$7), [name$7, bem$7] = createNamespace("swipe"), swipeProps = {
|
|
994
|
+
loop: truthProp,
|
|
995
|
+
width: numericProp,
|
|
996
|
+
height: numericProp,
|
|
997
|
+
vertical: Boolean,
|
|
998
|
+
autoplay: makeNumericProp(0),
|
|
999
|
+
duration: makeNumericProp(500),
|
|
1000
|
+
touchable: truthProp,
|
|
1001
|
+
lazyRender: Boolean,
|
|
1002
|
+
initialSwipe: makeNumericProp(0),
|
|
1003
|
+
indicatorColor: String,
|
|
1004
|
+
showIndicators: truthProp,
|
|
1005
|
+
stopPropagation: truthProp
|
|
1006
|
+
}, SWIPE_KEY = Symbol(name$7), stdin_default$6 = defineComponent({
|
|
1007
|
+
name: name$7,
|
|
1008
|
+
props: swipeProps,
|
|
1009
|
+
emits: [
|
|
1010
|
+
"change",
|
|
1011
|
+
"dragStart",
|
|
1012
|
+
"dragEnd"
|
|
1013
|
+
],
|
|
1014
|
+
setup(e, { emit: n, slots: r }) {
|
|
1015
|
+
let a = ref(), o = ref(), s = reactive({
|
|
1016
|
+
rect: null,
|
|
1017
|
+
width: 0,
|
|
1018
|
+
height: 0,
|
|
1019
|
+
offset: 0,
|
|
1020
|
+
active: 0,
|
|
1021
|
+
swiping: !1
|
|
1022
|
+
}), c = !1, l = useTouch(), { children: d, linkChildren: f } = useChildren(SWIPE_KEY), p = computed(() => d.length), m = computed(() => s[e.vertical ? "height" : "width"]), h = computed(() => e.vertical ? l.deltaY.value : l.deltaX.value), g = computed(() => s.rect ? (e.vertical ? s.rect.height : s.rect.width) - m.value * p.value : 0), v = computed(() => m.value ? Math.ceil(Math.abs(g.value) / m.value) : p.value), y = computed(() => p.value * m.value), b = computed(() => (s.active + p.value) % p.value), S = computed(() => {
|
|
1023
|
+
let n = e.vertical ? "vertical" : "horizontal";
|
|
1024
|
+
return l.direction.value === n;
|
|
1025
|
+
}), C = computed(() => {
|
|
1026
|
+
let n = {
|
|
1027
|
+
transitionDuration: `${s.swiping ? 0 : e.duration}ms`,
|
|
1028
|
+
transform: `translate${e.vertical ? "Y" : "X"}(${+s.offset.toFixed(2)}px)`
|
|
1029
|
+
};
|
|
1030
|
+
if (m.value) {
|
|
1031
|
+
let r = e.vertical ? "height" : "width", i = e.vertical ? "width" : "height";
|
|
1032
|
+
n[r] = `${y.value}px`, n[i] = e[i] ? `${e[i]}px` : "";
|
|
1033
|
+
}
|
|
1034
|
+
return n;
|
|
1035
|
+
}), w = (n) => {
|
|
1036
|
+
let { active: r } = s;
|
|
1037
|
+
return n ? e.loop ? clamp$1(r + n, -1, p.value) : clamp$1(r + n, 0, v.value) : r;
|
|
1038
|
+
}, D = (n, r = 0) => {
|
|
1039
|
+
let i = n * m.value;
|
|
1040
|
+
e.loop || (i = Math.min(i, -g.value));
|
|
1041
|
+
let a = r - i;
|
|
1042
|
+
return e.loop || (a = clamp$1(a, g.value, 0)), a;
|
|
1043
|
+
}, O = ({ pace: r = 0, offset: i = 0, emitChange: a }) => {
|
|
1044
|
+
if (p.value <= 1) return;
|
|
1045
|
+
let { active: o } = s, c = w(r), l = D(c, i);
|
|
1046
|
+
if (e.loop) {
|
|
1047
|
+
if (d[0] && l !== g.value) {
|
|
1048
|
+
let e = l < g.value;
|
|
1049
|
+
d[0].setOffset(e ? y.value : 0);
|
|
1050
|
+
}
|
|
1051
|
+
if (d[p.value - 1] && l !== 0) {
|
|
1052
|
+
let e = l > 0;
|
|
1053
|
+
d[p.value - 1].setOffset(e ? -y.value : 0);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
s.active = c, s.offset = l, a && c !== o && n("change", b.value);
|
|
1057
|
+
}, k = () => {
|
|
1058
|
+
s.swiping = !0, s.active <= -1 ? O({ pace: p.value }) : s.active >= p.value && O({ pace: -p.value });
|
|
1059
|
+
}, M = () => {
|
|
1060
|
+
k(), l.reset(), doubleRaf(() => {
|
|
1061
|
+
s.swiping = !1, O({
|
|
1062
|
+
pace: -1,
|
|
1063
|
+
emitChange: !0
|
|
1064
|
+
});
|
|
1065
|
+
});
|
|
1066
|
+
}, V = () => {
|
|
1067
|
+
k(), l.reset(), doubleRaf(() => {
|
|
1068
|
+
s.swiping = !1, O({
|
|
1069
|
+
pace: 1,
|
|
1070
|
+
emitChange: !0
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
1073
|
+
}, H, W = () => clearTimeout(H), K = () => {
|
|
1074
|
+
W(), +e.autoplay > 0 && p.value > 1 && (H = setTimeout(() => {
|
|
1075
|
+
V(), K();
|
|
1076
|
+
}, +e.autoplay));
|
|
1077
|
+
}, J = (n = +e.initialSwipe) => {
|
|
1078
|
+
if (!a.value) return;
|
|
1079
|
+
let r = () => {
|
|
1080
|
+
if (!isHidden(a)) {
|
|
1081
|
+
let n = {
|
|
1082
|
+
width: a.value.offsetWidth,
|
|
1083
|
+
height: a.value.offsetHeight
|
|
1084
|
+
};
|
|
1085
|
+
s.rect = n, s.width = +(e.width ?? n.width), s.height = +(e.height ?? n.height);
|
|
1086
|
+
}
|
|
1087
|
+
p.value && (n = Math.min(p.value - 1, n), n === -1 && (n = p.value - 1)), s.active = n, s.swiping = !0, s.offset = D(n), d.forEach((e) => {
|
|
1088
|
+
e.setOffset(0);
|
|
1089
|
+
}), K();
|
|
1090
|
+
};
|
|
1091
|
+
isHidden(a) ? nextTick().then(r) : r();
|
|
1092
|
+
}, Tc = () => J(s.active), Ec, Dc = (n) => {
|
|
1093
|
+
!e.touchable || n.touches.length > 1 || (l.start(n), c = !1, Ec = Date.now(), W(), k());
|
|
1094
|
+
}, Oc = (r) => {
|
|
1095
|
+
e.touchable && s.swiping && (l.move(r), S.value && (!e.loop && (s.active === 0 && h.value > 0 || s.active === p.value - 1 && h.value < 0) || (preventDefault(r, e.stopPropagation), O({ offset: h.value }), c ||= (n("dragStart", { index: b.value }), !0))));
|
|
1096
|
+
}, kc = () => {
|
|
1097
|
+
if (!e.touchable || !s.swiping) return;
|
|
1098
|
+
let r = Date.now() - Ec, i = h.value / r;
|
|
1099
|
+
if ((Math.abs(i) > .25 || Math.abs(h.value) > m.value / 2) && S.value) {
|
|
1100
|
+
let n = e.vertical ? l.offsetY.value : l.offsetX.value, r = 0;
|
|
1101
|
+
r = e.loop ? n > 0 ? h.value > 0 ? -1 : 1 : 0 : -Math[h.value > 0 ? "ceil" : "floor"](h.value / m.value), O({
|
|
1102
|
+
pace: r,
|
|
1103
|
+
emitChange: !0
|
|
1104
|
+
});
|
|
1105
|
+
} else h.value && O({ pace: 0 });
|
|
1106
|
+
c = !1, s.swiping = !1, n("dragEnd", { index: b.value }), K();
|
|
1107
|
+
}, Ac = (n, r = {}) => {
|
|
1108
|
+
k(), l.reset(), doubleRaf(() => {
|
|
1109
|
+
let i;
|
|
1110
|
+
i = e.loop && n === p.value ? s.active === 0 ? 0 : n : n % p.value, r.immediate ? doubleRaf(() => {
|
|
1111
|
+
s.swiping = !1;
|
|
1112
|
+
}) : s.swiping = !1, O({
|
|
1113
|
+
pace: i - s.active,
|
|
1114
|
+
emitChange: !0
|
|
1115
|
+
});
|
|
1116
|
+
});
|
|
1117
|
+
}, jc = (n, r) => {
|
|
1118
|
+
let i = r === b.value, a = i ? { backgroundColor: e.indicatorColor } : void 0;
|
|
1119
|
+
return createVNode("i", {
|
|
1120
|
+
style: a,
|
|
1121
|
+
class: bem$7("indicator", { active: i })
|
|
1122
|
+
}, null);
|
|
1123
|
+
}, Mc = () => {
|
|
1124
|
+
if (r.indicator) return r.indicator({
|
|
1125
|
+
active: b.value,
|
|
1126
|
+
total: p.value
|
|
1127
|
+
});
|
|
1128
|
+
if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(jc)]);
|
|
1129
|
+
};
|
|
1130
|
+
return useExpose({
|
|
1131
|
+
prev: M,
|
|
1132
|
+
next: V,
|
|
1133
|
+
state: s,
|
|
1134
|
+
resize: Tc,
|
|
1135
|
+
swipeTo: Ac
|
|
1136
|
+
}), f({
|
|
1137
|
+
size: m,
|
|
1138
|
+
props: e,
|
|
1139
|
+
count: p,
|
|
1140
|
+
activeIndicator: b
|
|
1141
|
+
}), watch(() => e.initialSwipe, (e) => J(+e)), watch(p, () => J(s.active)), watch(() => e.autoplay, K), watch([
|
|
1142
|
+
windowWidth,
|
|
1143
|
+
windowHeight,
|
|
1144
|
+
() => e.width,
|
|
1145
|
+
() => e.height
|
|
1146
|
+
], Tc), watch(usePageVisibility(), (e) => {
|
|
1147
|
+
e === "visible" ? K() : W();
|
|
1148
|
+
}), onMounted(J), onActivated(() => J(s.active)), onPopupReopen(() => J(s.active)), onDeactivated(W), onBeforeUnmount(W), useEventListener("touchmove", Oc, { target: o }), () => createVNode("div", {
|
|
1149
|
+
ref: a,
|
|
1150
|
+
class: bem$7()
|
|
1151
|
+
}, [createVNode("div", {
|
|
1152
|
+
ref: o,
|
|
1153
|
+
style: C.value,
|
|
1154
|
+
class: bem$7("track", { vertical: e.vertical }),
|
|
1155
|
+
onTouchstartPassive: Dc,
|
|
1156
|
+
onTouchend: kc,
|
|
1157
|
+
onTouchcancel: kc
|
|
1158
|
+
}, [r.default?.call(r)]), Mc()]);
|
|
1159
|
+
}
|
|
1160
|
+
}), Swipe = withInstall(stdin_default$6), [name$6, bem$6] = createNamespace("tabs"), stdin_default$5 = defineComponent({
|
|
1161
|
+
name: name$6,
|
|
1162
|
+
props: {
|
|
1163
|
+
count: makeRequiredProp(Number),
|
|
1164
|
+
inited: Boolean,
|
|
1165
|
+
animated: Boolean,
|
|
1166
|
+
duration: makeRequiredProp(numericProp),
|
|
1167
|
+
swipeable: Boolean,
|
|
1168
|
+
lazyRender: Boolean,
|
|
1169
|
+
currentIndex: makeRequiredProp(Number)
|
|
1170
|
+
},
|
|
1171
|
+
emits: ["change"],
|
|
1172
|
+
setup(e, { emit: n, slots: r }) {
|
|
1173
|
+
let i = ref(), a = (e) => n("change", e), o = () => {
|
|
1174
|
+
let n = r.default?.call(r);
|
|
1175
|
+
return e.animated || e.swipeable ? createVNode(Swipe, {
|
|
1176
|
+
ref: i,
|
|
1177
|
+
loop: !1,
|
|
1178
|
+
class: bem$6("track"),
|
|
1179
|
+
duration: e.duration * 1e3,
|
|
1180
|
+
touchable: e.swipeable,
|
|
1181
|
+
lazyRender: e.lazyRender,
|
|
1182
|
+
showIndicators: !1,
|
|
1183
|
+
onChange: a
|
|
1184
|
+
}, { default: () => [n] }) : n;
|
|
1185
|
+
}, s = (n) => {
|
|
1186
|
+
let r = i.value;
|
|
1187
|
+
r && r.state.active !== n && r.swipeTo(n, { immediate: !e.inited });
|
|
1188
|
+
};
|
|
1189
|
+
return watch(() => e.currentIndex, s), onMounted(() => {
|
|
1190
|
+
s(e.currentIndex);
|
|
1191
|
+
}), useExpose({ swipeRef: i }), () => createVNode("div", { class: bem$6("content", { animated: e.animated || e.swipeable }) }, [o()]);
|
|
1192
|
+
}
|
|
1193
|
+
}), [name$5, bem$5] = createNamespace("tabs"), tabsProps = {
|
|
1194
|
+
type: makeStringProp("line"),
|
|
1195
|
+
color: String,
|
|
1196
|
+
border: Boolean,
|
|
1197
|
+
sticky: Boolean,
|
|
1198
|
+
shrink: Boolean,
|
|
1199
|
+
active: makeNumericProp(0),
|
|
1200
|
+
duration: makeNumericProp(.3),
|
|
1201
|
+
animated: Boolean,
|
|
1202
|
+
ellipsis: truthProp,
|
|
1203
|
+
swipeable: Boolean,
|
|
1204
|
+
scrollspy: Boolean,
|
|
1205
|
+
offsetTop: makeNumericProp(0),
|
|
1206
|
+
background: String,
|
|
1207
|
+
lazyRender: truthProp,
|
|
1208
|
+
showHeader: truthProp,
|
|
1209
|
+
lineWidth: numericProp,
|
|
1210
|
+
lineHeight: numericProp,
|
|
1211
|
+
beforeChange: Function,
|
|
1212
|
+
swipeThreshold: makeNumericProp(5),
|
|
1213
|
+
titleActiveColor: String,
|
|
1214
|
+
titleInactiveColor: String
|
|
1215
|
+
}, TABS_KEY = Symbol(name$5), stdin_default$2 = defineComponent({
|
|
1216
|
+
name: name$5,
|
|
1217
|
+
props: tabsProps,
|
|
1218
|
+
emits: [
|
|
1219
|
+
"change",
|
|
1220
|
+
"scroll",
|
|
1221
|
+
"rendered",
|
|
1222
|
+
"clickTab",
|
|
1223
|
+
"update:active"
|
|
1224
|
+
],
|
|
1225
|
+
setup(e, { emit: n, slots: r }) {
|
|
1226
|
+
let a, o, s, c, l, d = ref(), f = ref(), p = ref(), m = ref(), h = useId(), g = useScrollParent(d), [v, y] = useRefs(), { children: b, linkChildren: S } = useChildren(TABS_KEY), C = reactive({
|
|
1227
|
+
inited: !1,
|
|
1228
|
+
position: "",
|
|
1229
|
+
lineStyle: {},
|
|
1230
|
+
currentIndex: -1
|
|
1231
|
+
}), w = computed(() => b.length > +e.swipeThreshold || !e.ellipsis || e.shrink), D = computed(() => ({
|
|
1232
|
+
borderColor: e.color,
|
|
1233
|
+
background: e.background
|
|
1234
|
+
})), O = (e, n) => e.name ?? n, k = computed(() => {
|
|
1235
|
+
let e = b[C.currentIndex];
|
|
1236
|
+
if (e) return O(e, C.currentIndex);
|
|
1237
|
+
}), j = computed(() => unitToPx(e.offsetTop)), M = computed(() => e.sticky ? j.value + a : 0), z = (n) => {
|
|
1238
|
+
let r = f.value, i = v.value;
|
|
1239
|
+
if (!w.value || !r || !i || !i[C.currentIndex]) return;
|
|
1240
|
+
let a = i[C.currentIndex].$el, o = a.offsetLeft - (r.offsetWidth - a.offsetWidth) / 2;
|
|
1241
|
+
c && c(), c = scrollLeftTo(r, o, n ? 0 : +e.duration);
|
|
1242
|
+
}, B = () => {
|
|
1243
|
+
let n = C.inited;
|
|
1244
|
+
nextTick(() => {
|
|
1245
|
+
let r = v.value;
|
|
1246
|
+
if (!r || !r[C.currentIndex] || e.type !== "line" || isHidden(d.value)) return;
|
|
1247
|
+
let i = r[C.currentIndex].$el, { lineWidth: a, lineHeight: o } = e, s = i.offsetLeft + i.offsetWidth / 2, c = {
|
|
1248
|
+
width: addUnit(a),
|
|
1249
|
+
backgroundColor: e.color,
|
|
1250
|
+
transform: `translateX(${s}px) translateX(-50%)`
|
|
1251
|
+
};
|
|
1252
|
+
if (n && (c.transitionDuration = `${e.duration}s`), isDef$1(o)) {
|
|
1253
|
+
let e = addUnit(o);
|
|
1254
|
+
c.height = e, c.borderRadius = e;
|
|
1255
|
+
}
|
|
1256
|
+
C.lineStyle = c;
|
|
1257
|
+
});
|
|
1258
|
+
}, V = (e) => {
|
|
1259
|
+
let n = e < C.currentIndex ? -1 : 1;
|
|
1260
|
+
for (; e >= 0 && e < b.length;) {
|
|
1261
|
+
if (!b[e].disabled) return e;
|
|
1262
|
+
e += n;
|
|
1263
|
+
}
|
|
1264
|
+
}, H = (r, i) => {
|
|
1265
|
+
let a = V(r);
|
|
1266
|
+
if (!isDef$1(a)) return;
|
|
1267
|
+
let o = b[a], c = O(o, a), l = C.currentIndex !== null;
|
|
1268
|
+
C.currentIndex !== a && (C.currentIndex = a, i || z(), B()), c !== e.active && (n("update:active", c), l && n("change", c, o.title)), s && !e.scrollspy && setRootScrollTop(Math.ceil(getElementTop(d.value) - j.value));
|
|
1269
|
+
}, W = (e, n) => {
|
|
1270
|
+
let r = b.findIndex((n, r) => O(n, r) === e);
|
|
1271
|
+
H(r === -1 ? 0 : r, n);
|
|
1272
|
+
}, K = (n = !1) => {
|
|
1273
|
+
if (e.scrollspy) {
|
|
1274
|
+
let r = b[C.currentIndex].$el;
|
|
1275
|
+
if (r && g.value) {
|
|
1276
|
+
let i = getElementTop(r, g.value) - M.value;
|
|
1277
|
+
o = !0, l && l(), l = scrollTopTo(g.value, i, n ? 0 : +e.duration, () => {
|
|
1278
|
+
o = !1;
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}, J = (r, i, a) => {
|
|
1283
|
+
let { title: o, disabled: s } = b[i], c = O(b[i], i);
|
|
1284
|
+
s || (callInterceptor(e.beforeChange, {
|
|
1285
|
+
args: [c],
|
|
1286
|
+
done: () => {
|
|
1287
|
+
H(i), K();
|
|
1288
|
+
}
|
|
1289
|
+
}), route(r)), n("clickTab", {
|
|
1290
|
+
name: c,
|
|
1291
|
+
title: o,
|
|
1292
|
+
event: a,
|
|
1293
|
+
disabled: s
|
|
1294
|
+
});
|
|
1295
|
+
}, Tc = (e) => {
|
|
1296
|
+
s = e.isFixed, n("scroll", e);
|
|
1297
|
+
}, Ec = (e) => {
|
|
1298
|
+
nextTick(() => {
|
|
1299
|
+
W(e), K(!0);
|
|
1300
|
+
});
|
|
1301
|
+
}, Dc = () => {
|
|
1302
|
+
for (let e = 0; e < b.length; e++) {
|
|
1303
|
+
let { top: n } = useRect(b[e].$el);
|
|
1304
|
+
if (n > M.value) return e === 0 ? 0 : e - 1;
|
|
1305
|
+
}
|
|
1306
|
+
return b.length - 1;
|
|
1307
|
+
}, Oc = () => {
|
|
1308
|
+
if (e.scrollspy && !o) {
|
|
1309
|
+
let e = Dc();
|
|
1310
|
+
H(e);
|
|
1311
|
+
}
|
|
1312
|
+
}, kc = () => {
|
|
1313
|
+
if (e.type === "line" && b.length) return createVNode("div", {
|
|
1314
|
+
class: bem$5("line"),
|
|
1315
|
+
style: C.lineStyle
|
|
1316
|
+
}, null);
|
|
1317
|
+
}, Ac = () => {
|
|
1318
|
+
let { type: n, border: i, sticky: a } = e, o = [createVNode("div", {
|
|
1319
|
+
ref: a ? void 0 : p,
|
|
1320
|
+
class: [bem$5("wrap"), { [BORDER_TOP_BOTTOM]: n === "line" && i }]
|
|
1321
|
+
}, [createVNode("div", {
|
|
1322
|
+
ref: f,
|
|
1323
|
+
role: "tablist",
|
|
1324
|
+
class: bem$5("nav", [n, {
|
|
1325
|
+
shrink: e.shrink,
|
|
1326
|
+
complete: w.value
|
|
1327
|
+
}]),
|
|
1328
|
+
style: D.value,
|
|
1329
|
+
"aria-orientation": "horizontal"
|
|
1330
|
+
}, [
|
|
1331
|
+
r["nav-left"]?.call(r),
|
|
1332
|
+
b.map((e) => e.renderTitle(J)),
|
|
1333
|
+
kc(),
|
|
1334
|
+
r["nav-right"]?.call(r)
|
|
1335
|
+
])]), r["nav-bottom"]?.call(r)];
|
|
1336
|
+
return a ? createVNode("div", { ref: p }, [o]) : o;
|
|
1337
|
+
}, jc = () => {
|
|
1338
|
+
B(), nextTick(() => {
|
|
1339
|
+
var e;
|
|
1340
|
+
z(!0), (e = m.value?.swipeRef.value) == null || e.resize();
|
|
1341
|
+
});
|
|
1342
|
+
};
|
|
1343
|
+
return watch(() => [
|
|
1344
|
+
e.color,
|
|
1345
|
+
e.duration,
|
|
1346
|
+
e.lineWidth,
|
|
1347
|
+
e.lineHeight
|
|
1348
|
+
], B), watch(windowWidth, jc), watch(() => e.active, (e) => {
|
|
1349
|
+
e !== k.value && W(e);
|
|
1350
|
+
}), watch(() => b.length, () => {
|
|
1351
|
+
C.inited && (W(e.active), B(), nextTick(() => {
|
|
1352
|
+
z(!0);
|
|
1353
|
+
}));
|
|
1354
|
+
}), useExpose({
|
|
1355
|
+
resize: jc,
|
|
1356
|
+
scrollTo: Ec
|
|
1357
|
+
}), onActivated(B), onPopupReopen(B), onMountedOrActivated(() => {
|
|
1358
|
+
W(e.active, !0), nextTick(() => {
|
|
1359
|
+
C.inited = !0, p.value && (a = useRect(p.value).height), z(!0);
|
|
1360
|
+
});
|
|
1361
|
+
}), useVisibilityChange(d, B), useEventListener("scroll", Oc, {
|
|
1362
|
+
target: g,
|
|
1363
|
+
passive: !0
|
|
1364
|
+
}), S({
|
|
1365
|
+
id: h,
|
|
1366
|
+
props: e,
|
|
1367
|
+
setLine: B,
|
|
1368
|
+
scrollable: w,
|
|
1369
|
+
onRendered: (e, r) => n("rendered", e, r),
|
|
1370
|
+
currentName: k,
|
|
1371
|
+
setTitleRefs: y,
|
|
1372
|
+
scrollIntoView: z
|
|
1373
|
+
}), () => createVNode("div", {
|
|
1374
|
+
ref: d,
|
|
1375
|
+
class: bem$5([e.type])
|
|
1376
|
+
}, [e.showHeader ? e.sticky ? createVNode(Sticky, {
|
|
1377
|
+
container: d.value,
|
|
1378
|
+
offsetTop: j.value,
|
|
1379
|
+
onScroll: Tc
|
|
1380
|
+
}, { default: () => [Ac()] }) : Ac() : null, createVNode(stdin_default$5, {
|
|
1381
|
+
ref: m,
|
|
1382
|
+
count: b.length,
|
|
1383
|
+
inited: C.inited,
|
|
1384
|
+
animated: e.animated,
|
|
1385
|
+
duration: e.duration,
|
|
1386
|
+
swipeable: e.swipeable,
|
|
1387
|
+
lazyRender: e.lazyRender,
|
|
1388
|
+
currentIndex: C.currentIndex,
|
|
1389
|
+
onChange: H
|
|
1390
|
+
}, { default: () => [r.default?.call(r)] })]);
|
|
1391
|
+
}
|
|
1392
|
+
}), TAB_STATUS_KEY = Symbol(), ALL_TAB_STATUS_KEY = Symbol(), useAllTabStatus = () => inject(ALL_TAB_STATUS_KEY, null), useProvideTabStatus = (e) => {
|
|
1393
|
+
let n = useAllTabStatus();
|
|
1394
|
+
provide(TAB_STATUS_KEY, e), provide(ALL_TAB_STATUS_KEY, computed(() => (n == null || n.value) && e.value));
|
|
1395
|
+
}, [name$4, bem$4] = createNamespace("tab"), TabTitle = defineComponent({
|
|
1396
|
+
name: name$4,
|
|
1397
|
+
props: {
|
|
1398
|
+
id: String,
|
|
1399
|
+
dot: Boolean,
|
|
1400
|
+
type: String,
|
|
1401
|
+
color: String,
|
|
1402
|
+
title: String,
|
|
1403
|
+
badge: numericProp,
|
|
1404
|
+
shrink: Boolean,
|
|
1405
|
+
isActive: Boolean,
|
|
1406
|
+
disabled: Boolean,
|
|
1407
|
+
controls: String,
|
|
1408
|
+
scrollable: Boolean,
|
|
1409
|
+
activeColor: String,
|
|
1410
|
+
inactiveColor: String,
|
|
1411
|
+
showZeroBadge: truthProp
|
|
1412
|
+
},
|
|
1413
|
+
setup(e, { slots: n }) {
|
|
1414
|
+
let r = computed(() => {
|
|
1415
|
+
let n = {}, { type: r, color: i, disabled: a, isActive: o, activeColor: s, inactiveColor: c } = e;
|
|
1416
|
+
i && r === "card" && (n.borderColor = i, a || (o ? n.backgroundColor = i : n.color = i));
|
|
1417
|
+
let l = o ? s : c;
|
|
1418
|
+
return l && (n.color = l), n;
|
|
1419
|
+
}), a = () => {
|
|
1420
|
+
let r = createVNode("span", { class: bem$4("text", { ellipsis: !e.scrollable }) }, [n.title ? n.title() : e.title]);
|
|
1421
|
+
return e.dot || isDef$1(e.badge) && e.badge !== "" ? createVNode(Badge, {
|
|
1422
|
+
dot: e.dot,
|
|
1423
|
+
content: e.badge,
|
|
1424
|
+
showZero: e.showZeroBadge
|
|
1425
|
+
}, { default: () => [r] }) : r;
|
|
1426
|
+
};
|
|
1427
|
+
return () => createVNode("div", {
|
|
1428
|
+
id: e.id,
|
|
1429
|
+
role: "tab",
|
|
1430
|
+
class: [bem$4([e.type, {
|
|
1431
|
+
grow: e.scrollable && !e.shrink,
|
|
1432
|
+
shrink: e.shrink,
|
|
1433
|
+
active: e.isActive,
|
|
1434
|
+
disabled: e.disabled
|
|
1435
|
+
}])],
|
|
1436
|
+
style: r.value,
|
|
1437
|
+
tabindex: e.disabled ? void 0 : e.isActive ? 0 : -1,
|
|
1438
|
+
"aria-selected": e.isActive,
|
|
1439
|
+
"aria-disabled": e.disabled || void 0,
|
|
1440
|
+
"aria-controls": e.controls,
|
|
1441
|
+
"data-allow-mismatch": "attribute"
|
|
1442
|
+
}, [a()]);
|
|
1443
|
+
}
|
|
1444
|
+
}), [name$3, bem$3] = createNamespace("swipe-item"), stdin_default$4 = defineComponent({
|
|
1445
|
+
name: name$3,
|
|
1446
|
+
setup(e, { slots: n }) {
|
|
1447
|
+
let r, a = reactive({
|
|
1448
|
+
offset: 0,
|
|
1449
|
+
inited: !1,
|
|
1450
|
+
mounted: !1
|
|
1451
|
+
}), { parent: o, index: s } = useParent(SWIPE_KEY);
|
|
1452
|
+
if (!o) {
|
|
1453
|
+
process.env.NODE_ENV !== "production" && console.error("[Vant] <SwipeItem> must be a child component of <Swipe>.");
|
|
1454
|
+
return;
|
|
1455
|
+
}
|
|
1456
|
+
let c = computed(() => {
|
|
1457
|
+
let e = {}, { vertical: n } = o.props;
|
|
1458
|
+
return o.size.value && (e[n ? "height" : "width"] = `${o.size.value}px`), a.offset && (e.transform = `translate${n ? "Y" : "X"}(${a.offset}px)`), e;
|
|
1459
|
+
}), l = computed(() => {
|
|
1460
|
+
let { loop: e, lazyRender: n } = o.props;
|
|
1461
|
+
if (!n || r) return !0;
|
|
1462
|
+
if (!a.mounted) return !1;
|
|
1463
|
+
let i = o.activeIndicator.value, c = o.count.value - 1, l = i === 0 && e ? c : i - 1, u = i === c && e ? 0 : i + 1;
|
|
1464
|
+
return r = s.value === i || s.value === l || s.value === u, r;
|
|
1465
|
+
});
|
|
1466
|
+
return onMounted(() => {
|
|
1467
|
+
nextTick(() => {
|
|
1468
|
+
a.mounted = !0;
|
|
1469
|
+
});
|
|
1470
|
+
}), useExpose({ setOffset: (e) => {
|
|
1471
|
+
a.offset = e;
|
|
1472
|
+
} }), () => createVNode("div", {
|
|
1473
|
+
class: bem$3(),
|
|
1474
|
+
style: c.value
|
|
1475
|
+
}, [l.value ? n.default?.call(n) : null]);
|
|
1476
|
+
}
|
|
1477
|
+
}), SwipeItem = withInstall(stdin_default$4), [name$2, bem$2] = createNamespace("tab"), tabProps = extend({}, routeProps, {
|
|
1478
|
+
dot: Boolean,
|
|
1479
|
+
name: numericProp,
|
|
1480
|
+
badge: numericProp,
|
|
1481
|
+
title: String,
|
|
1482
|
+
disabled: Boolean,
|
|
1483
|
+
titleClass: null,
|
|
1484
|
+
titleStyle: [String, Object],
|
|
1485
|
+
showZeroBadge: truthProp
|
|
1486
|
+
}), stdin_default$3 = defineComponent({
|
|
1487
|
+
name: name$2,
|
|
1488
|
+
props: tabProps,
|
|
1489
|
+
setup(e, { slots: n }) {
|
|
1490
|
+
let r = useId(), a = ref(!1), o = getCurrentInstance(), { parent: s, index: c } = useParent(TABS_KEY);
|
|
1491
|
+
if (!s) {
|
|
1492
|
+
process.env.NODE_ENV !== "production" && console.error("[Vant] <Tab> must be a child component of <Tabs>.");
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
let l = () => e.name ?? c.value, d = () => {
|
|
1496
|
+
a.value = !0, s.props.lazyRender && nextTick(() => {
|
|
1497
|
+
s.onRendered(l(), e.title);
|
|
1498
|
+
});
|
|
1499
|
+
}, f = computed(() => {
|
|
1500
|
+
let e = l() === s.currentName.value;
|
|
1501
|
+
return e && !a.value && d(), e;
|
|
1502
|
+
}), m = ref(""), h = ref("");
|
|
1503
|
+
watchEffect(() => {
|
|
1504
|
+
let { titleClass: n, titleStyle: r } = e;
|
|
1505
|
+
m.value = n ? normalizeClass$1(n) : "", h.value = r && typeof r != "string" ? stringifyStyle(normalizeStyle$1(r)) : r;
|
|
1506
|
+
});
|
|
1507
|
+
let g = (i) => createVNode(TabTitle, mergeProps({
|
|
1508
|
+
key: r,
|
|
1509
|
+
id: `${s.id}-${c.value}`,
|
|
1510
|
+
ref: s.setTitleRefs(c.value),
|
|
1511
|
+
style: h.value,
|
|
1512
|
+
class: m.value,
|
|
1513
|
+
isActive: f.value,
|
|
1514
|
+
controls: r,
|
|
1515
|
+
scrollable: s.scrollable.value,
|
|
1516
|
+
activeColor: s.props.titleActiveColor,
|
|
1517
|
+
inactiveColor: s.props.titleInactiveColor,
|
|
1518
|
+
onClick: (e) => i(o.proxy, c.value, e)
|
|
1519
|
+
}, pick(s.props, [
|
|
1520
|
+
"type",
|
|
1521
|
+
"color",
|
|
1522
|
+
"shrink"
|
|
1523
|
+
]), pick(e, [
|
|
1524
|
+
"dot",
|
|
1525
|
+
"badge",
|
|
1526
|
+
"title",
|
|
1527
|
+
"disabled",
|
|
1528
|
+
"showZeroBadge"
|
|
1529
|
+
])), { title: n.title }), v = ref(!f.value);
|
|
1530
|
+
return watch(f, (e) => {
|
|
1531
|
+
e ? v.value = !1 : doubleRaf(() => {
|
|
1532
|
+
v.value = !0;
|
|
1533
|
+
});
|
|
1534
|
+
}), watch(() => e.title, () => {
|
|
1535
|
+
s.setLine(), s.scrollIntoView();
|
|
1536
|
+
}), useProvideTabStatus(f), useExpose({
|
|
1537
|
+
id: r,
|
|
1538
|
+
renderTitle: g
|
|
1539
|
+
}), () => {
|
|
1540
|
+
let e = `${s.id}-${c.value}`, { animated: i, swipeable: o, scrollspy: l, lazyRender: d } = s.props;
|
|
1541
|
+
if (!n.default && !i) return;
|
|
1542
|
+
let p = l || f.value;
|
|
1543
|
+
if (i || o) return createVNode(SwipeItem, {
|
|
1544
|
+
id: r,
|
|
1545
|
+
role: "tabpanel",
|
|
1546
|
+
class: bem$2("panel-wrapper", { inactive: v.value }),
|
|
1547
|
+
tabindex: f.value ? 0 : -1,
|
|
1548
|
+
"aria-hidden": !f.value,
|
|
1549
|
+
"aria-labelledby": e,
|
|
1550
|
+
"data-allow-mismatch": "attribute"
|
|
1551
|
+
}, { default: () => [createVNode("div", { class: bem$2("panel") }, [n.default?.call(n)])] });
|
|
1552
|
+
let m = a.value || l || !d ? n.default?.call(n) : null;
|
|
1553
|
+
return withDirectives(createVNode("div", {
|
|
1554
|
+
id: r,
|
|
1555
|
+
role: "tabpanel",
|
|
1556
|
+
class: bem$2("panel"),
|
|
1557
|
+
tabindex: p ? 0 : -1,
|
|
1558
|
+
"aria-labelledby": e,
|
|
1559
|
+
"data-allow-mismatch": "attribute"
|
|
1560
|
+
}, [m]), [[vShow, p]]);
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
}), Tab = withInstall(stdin_default$3), Tabs = withInstall(stdin_default$2), floatingPanelProps = {
|
|
1564
|
+
height: makeNumericProp(0),
|
|
1565
|
+
anchors: makeArrayProp(),
|
|
1566
|
+
duration: makeNumericProp(.3),
|
|
1567
|
+
contentDraggable: truthProp,
|
|
1568
|
+
lockScroll: Boolean,
|
|
1569
|
+
safeAreaInsetBottom: truthProp
|
|
1570
|
+
}, [name$1, bem$1] = createNamespace("floating-panel"), stdin_default$1 = defineComponent({
|
|
1571
|
+
name: name$1,
|
|
1572
|
+
props: floatingPanelProps,
|
|
1573
|
+
emits: ["heightChange", "update:height"],
|
|
1574
|
+
setup(e, { emit: n, slots: r }) {
|
|
1575
|
+
let a = .2, o = ref(), s = ref(), c = useSyncPropRef(() => +e.height, (e) => n("update:height", e)), l = computed(() => ({
|
|
1576
|
+
min: e.anchors[0] ?? 100,
|
|
1577
|
+
max: e.anchors[e.anchors.length - 1] ?? Math.round(windowHeight.value * .6)
|
|
1578
|
+
})), d = computed(() => e.anchors.length >= 2 ? e.anchors : [l.value.min, l.value.max]), f = ref(!1), p = computed(() => ({
|
|
1579
|
+
height: addUnit(l.value.max),
|
|
1580
|
+
transform: `translateY(calc(100% + ${addUnit(-c.value)}))`,
|
|
1581
|
+
transition: f.value ? "none" : `transform ${e.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)`
|
|
1582
|
+
})), m = (e) => {
|
|
1583
|
+
let n = Math.abs(e), { min: r, max: i } = l.value;
|
|
1584
|
+
return n > i ? -(i + (n - i) * a) : n < r ? -(r - (r - n) * a) : e;
|
|
1585
|
+
}, h, g = -1, v = useTouch(), y = (e) => {
|
|
1586
|
+
v.start(e), f.value = !0, h = -c.value, g = -1;
|
|
1587
|
+
}, b = (n) => {
|
|
1588
|
+
v.move(n);
|
|
1589
|
+
let r = n.target;
|
|
1590
|
+
if (s.value === r || s.value?.contains(r)) {
|
|
1591
|
+
let { scrollTop: r } = s.value;
|
|
1592
|
+
if (g = Math.max(g, r), !e.contentDraggable) return;
|
|
1593
|
+
if (-h < l.value.max) preventDefault(n, !0);
|
|
1594
|
+
else if (!(r <= 0 && v.deltaY.value > 0) || g > 0) return;
|
|
1595
|
+
}
|
|
1596
|
+
let i = v.deltaY.value + h;
|
|
1597
|
+
c.value = -m(i);
|
|
1598
|
+
}, S = () => {
|
|
1599
|
+
g = -1, f.value = !1, c.value = closest(d.value, c.value), c.value !== -h && n("heightChange", { height: c.value });
|
|
1600
|
+
};
|
|
1601
|
+
watch(l, () => {
|
|
1602
|
+
c.value = closest(d.value, c.value);
|
|
1603
|
+
}, { immediate: !0 }), useLockScroll(o, () => e.lockScroll || f.value), useEventListener("touchmove", b, { target: o });
|
|
1604
|
+
let C = () => r.header ? r.header() : createVNode("div", { class: bem$1("header") }, [createVNode("div", { class: bem$1("header-bar") }, null)]);
|
|
1605
|
+
return () => createVNode("div", {
|
|
1606
|
+
class: [bem$1(), { "van-safe-area-bottom": e.safeAreaInsetBottom }],
|
|
1607
|
+
ref: o,
|
|
1608
|
+
style: p.value,
|
|
1609
|
+
onTouchstartPassive: y,
|
|
1610
|
+
onTouchend: S,
|
|
1611
|
+
onTouchcancel: S
|
|
1612
|
+
}, [C(), createVNode("div", {
|
|
1613
|
+
class: bem$1("content"),
|
|
1614
|
+
ref: s
|
|
1615
|
+
}, [r.default?.call(r)])]);
|
|
1616
|
+
}
|
|
1617
|
+
}), FloatingPanel = withInstall(stdin_default$1), [name, bem, t] = createNamespace("pull-refresh"), TEXT_STATUS = [
|
|
1618
|
+
"pulling",
|
|
1619
|
+
"loosing",
|
|
1620
|
+
"success"
|
|
1621
|
+
], pullRefreshProps = {
|
|
1622
|
+
disabled: Boolean,
|
|
1623
|
+
modelValue: Boolean,
|
|
1624
|
+
headHeight: makeNumericProp(50),
|
|
1625
|
+
successText: String,
|
|
1626
|
+
pullingText: String,
|
|
1627
|
+
loosingText: String,
|
|
1628
|
+
loadingText: String,
|
|
1629
|
+
pullDistance: numericProp,
|
|
1630
|
+
successDuration: makeNumericProp(500),
|
|
1631
|
+
animationDuration: makeNumericProp(300)
|
|
1632
|
+
}, stdin_default = defineComponent({
|
|
1633
|
+
name,
|
|
1634
|
+
props: pullRefreshProps,
|
|
1635
|
+
emits: [
|
|
1636
|
+
"change",
|
|
1637
|
+
"refresh",
|
|
1638
|
+
"update:modelValue"
|
|
1639
|
+
],
|
|
1640
|
+
setup(e, { emit: n, slots: r }) {
|
|
1641
|
+
let i, a = ref(), o = ref(), s = useScrollParent(a), c = reactive({
|
|
1642
|
+
status: "normal",
|
|
1643
|
+
distance: 0,
|
|
1644
|
+
duration: 0
|
|
1645
|
+
}), l = useTouch(), d = () => {
|
|
1646
|
+
if (e.headHeight !== 50) return { height: `${e.headHeight}px` };
|
|
1647
|
+
}, f = () => c.status !== "loading" && c.status !== "success" && !e.disabled, p = (n) => {
|
|
1648
|
+
let r = +(e.pullDistance || e.headHeight);
|
|
1649
|
+
return n > r && (n = n < r * 2 ? r + (n - r) / 2 : r * 1.5 + (n - r * 2) / 4), Math.round(n);
|
|
1650
|
+
}, m = (r, i) => {
|
|
1651
|
+
let a = +(e.pullDistance || e.headHeight);
|
|
1652
|
+
c.distance = r, i ? c.status = "loading" : r === 0 ? c.status = "normal" : r < a ? c.status = "pulling" : c.status = "loosing", n("change", {
|
|
1653
|
+
status: c.status,
|
|
1654
|
+
distance: r
|
|
1655
|
+
});
|
|
1656
|
+
}, h = () => {
|
|
1657
|
+
let { status: n } = c;
|
|
1658
|
+
return n === "normal" ? "" : e[`${n}Text`] || t(n);
|
|
1659
|
+
}, g = () => {
|
|
1660
|
+
let { status: e, distance: n } = c;
|
|
1661
|
+
if (r[e]) return r[e]({ distance: n });
|
|
1662
|
+
let i = [];
|
|
1663
|
+
return TEXT_STATUS.includes(e) && i.push(createVNode("div", { class: bem("text") }, [h()])), e === "loading" && i.push(createVNode(Loading, { class: bem("loading") }, { default: h })), i;
|
|
1664
|
+
}, v = () => {
|
|
1665
|
+
c.status = "success", setTimeout(() => {
|
|
1666
|
+
m(0);
|
|
1667
|
+
}, +e.successDuration);
|
|
1668
|
+
}, y = (e) => {
|
|
1669
|
+
i = getScrollTop(s.value) === 0, i && (c.duration = 0, l.start(e));
|
|
1670
|
+
}, b = (e) => {
|
|
1671
|
+
f() && y(e);
|
|
1672
|
+
}, S = (e) => {
|
|
1673
|
+
if (f()) {
|
|
1674
|
+
i || y(e);
|
|
1675
|
+
let { deltaY: n } = l;
|
|
1676
|
+
l.move(e), i && n.value >= 0 && l.isVertical() && (preventDefault(e), m(p(n.value)));
|
|
1677
|
+
}
|
|
1678
|
+
}, C = () => {
|
|
1679
|
+
i && l.deltaY.value && f() && (c.duration = +e.animationDuration, c.status === "loosing" ? (m(+e.headHeight, !0), n("update:modelValue", !0), nextTick(() => n("refresh"))) : m(0));
|
|
1680
|
+
};
|
|
1681
|
+
return watch(() => e.modelValue, (n) => {
|
|
1682
|
+
c.duration = +e.animationDuration, n ? m(+e.headHeight, !0) : r.success || e.successText ? v() : m(0, !1);
|
|
1683
|
+
}), useEventListener("touchmove", S, { target: o }), () => {
|
|
1684
|
+
let e = {
|
|
1685
|
+
transitionDuration: `${c.duration}ms`,
|
|
1686
|
+
transform: c.distance ? `translate3d(0,${c.distance}px, 0)` : ""
|
|
1687
|
+
};
|
|
1688
|
+
return createVNode("div", {
|
|
1689
|
+
ref: a,
|
|
1690
|
+
class: bem()
|
|
1691
|
+
}, [createVNode("div", {
|
|
1692
|
+
ref: o,
|
|
1693
|
+
class: bem("track"),
|
|
1694
|
+
style: e,
|
|
1695
|
+
onTouchstartPassive: b,
|
|
1696
|
+
onTouchend: C,
|
|
1697
|
+
onTouchcancel: C
|
|
1698
|
+
}, [createVNode("div", {
|
|
1699
|
+
class: bem("head"),
|
|
1700
|
+
style: d()
|
|
1701
|
+
}, [g()]), r.default?.call(r)])]);
|
|
1702
|
+
};
|
|
1703
|
+
}
|
|
1704
|
+
}), PullRefresh = withInstall(stdin_default), loading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1705
|
+
__name: "loading",
|
|
1706
|
+
props: {
|
|
1707
|
+
size: {},
|
|
1708
|
+
type: {},
|
|
1709
|
+
color: {},
|
|
1710
|
+
vertical: { type: Boolean },
|
|
1711
|
+
textSize: {},
|
|
1712
|
+
textColor: {}
|
|
1713
|
+
},
|
|
1714
|
+
setup(e) {
|
|
1715
|
+
useCssVars((e) => ({ "4eb8d787": r.value }));
|
|
1716
|
+
let n = e, r = computed(() => isNumber(n.size) ? `${n.size}px` : n.size);
|
|
1717
|
+
return (e, r) => {
|
|
1718
|
+
let i = Loading;
|
|
1719
|
+
return openBlock(), createBlock(i, normalizeProps(guardReactiveProps(n)), {
|
|
1720
|
+
default: withCtx(() => [renderSlot(e.$slots, "default", {}, void 0, !0)]),
|
|
1721
|
+
_: 3
|
|
1722
|
+
}, 16);
|
|
1723
|
+
};
|
|
1724
|
+
}
|
|
1725
|
+
}), __plugin_vue_export_helper_default = (e, n) => {
|
|
1726
|
+
let r = e.__vccOpts || e;
|
|
1727
|
+
for (let [e, i] of n) r[e] = i;
|
|
1728
|
+
return r;
|
|
1729
|
+
}, loading_default = /* @__PURE__ */ __plugin_vue_export_helper_default(loading_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d003299d"]]);
|
|
1730
|
+
function tryOnScopeDispose(e) {
|
|
1731
|
+
return getCurrentScope() ? (onScopeDispose(e), !0) : !1;
|
|
1732
|
+
}
|
|
1733
|
+
var localProvidedStateMap = /* @__PURE__ */ new WeakMap(), injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
|
|
1734
|
+
let n = e[0], r = getCurrentInstance()?.proxy;
|
|
1735
|
+
if (r == null && !hasInjectionContext()) throw Error("injectLocal must be called in setup");
|
|
1736
|
+
return r && localProvidedStateMap.has(r) && n in localProvidedStateMap.get(r) ? localProvidedStateMap.get(r)[n] : inject(...e);
|
|
1737
|
+
};
|
|
1738
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1739
|
+
function makeDestructurable(e, n) {
|
|
1740
|
+
if (typeof Symbol < "u") {
|
|
1741
|
+
let r = { ...e };
|
|
1742
|
+
return Object.defineProperty(r, Symbol.iterator, {
|
|
1743
|
+
enumerable: !1,
|
|
1744
|
+
value() {
|
|
1745
|
+
let e = 0;
|
|
1746
|
+
return { next: () => ({
|
|
1747
|
+
value: n[e++],
|
|
1748
|
+
done: e > n.length
|
|
1749
|
+
}) };
|
|
1750
|
+
}
|
|
1751
|
+
}), r;
|
|
1752
|
+
} else return Object.assign([...n], e);
|
|
1753
|
+
}
|
|
1754
|
+
var isClient = typeof window < "u" && typeof document < "u";
|
|
1755
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1756
|
+
var notNullish = (e) => e != null, toString = Object.prototype.toString, isObject = (e) => toString.call(e) === "[object Object]", noop$1 = () => {};
|
|
1757
|
+
function toRef$1(...e) {
|
|
1758
|
+
if (e.length !== 1) return toRef(...e);
|
|
1759
|
+
let n = e[0];
|
|
1760
|
+
return typeof n == "function" ? readonly(customRef(() => ({
|
|
1761
|
+
get: n,
|
|
1762
|
+
set: noop$1
|
|
1763
|
+
}))) : ref(n);
|
|
1764
|
+
}
|
|
1765
|
+
function createFilterWrapper(e, n) {
|
|
1766
|
+
function r(...r) {
|
|
1767
|
+
return new Promise((i, a) => {
|
|
1768
|
+
Promise.resolve(e(() => n.apply(this, r), {
|
|
1769
|
+
fn: n,
|
|
1770
|
+
thisArg: this,
|
|
1771
|
+
args: r
|
|
1772
|
+
})).then(i).catch(a);
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
return r;
|
|
1776
|
+
}
|
|
1777
|
+
var bypassFilter = (e) => e();
|
|
1778
|
+
function debounceFilter(e, n = {}) {
|
|
1779
|
+
let r, i, a = noop$1, o = (e) => {
|
|
1780
|
+
clearTimeout(e), a(), a = noop$1;
|
|
1781
|
+
}, s;
|
|
1782
|
+
return (c) => {
|
|
1783
|
+
let l = toValue(e), u = toValue(n.maxWait);
|
|
1784
|
+
return r && o(r), l <= 0 || u !== void 0 && u <= 0 ? (i &&= (o(i), void 0), Promise.resolve(c())) : new Promise((e, d) => {
|
|
1785
|
+
a = n.rejectOnCancel ? d : e, s = c, u && !i && (i = setTimeout(() => {
|
|
1786
|
+
r && o(r), i = void 0, e(s());
|
|
1787
|
+
}, u)), r = setTimeout(() => {
|
|
1788
|
+
i && o(i), i = void 0, e(c());
|
|
1789
|
+
}, l);
|
|
1790
|
+
});
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
function throttleFilter(...e) {
|
|
1794
|
+
let n = 0, r, i = !0, a = noop$1, o, s, c, l, u;
|
|
1795
|
+
!isRef(e[0]) && typeof e[0] == "object" ? {delay: s, trailing: c = !0, leading: l = !0, rejectOnCancel: u = !1} = e[0] : [s, c = !0, l = !0, u = !1] = e;
|
|
1796
|
+
let d = () => {
|
|
1797
|
+
r && (clearTimeout(r), r = void 0, a(), a = noop$1);
|
|
1798
|
+
};
|
|
1799
|
+
return (e) => {
|
|
1800
|
+
let f = toValue(s), p = Date.now() - n, m = () => o = e();
|
|
1801
|
+
return d(), f <= 0 ? (n = Date.now(), m()) : (p > f && (l || !i) ? (n = Date.now(), m()) : c && (o = new Promise((e, o) => {
|
|
1802
|
+
a = u ? o : e, r = setTimeout(() => {
|
|
1803
|
+
n = Date.now(), i = !0, e(m()), d();
|
|
1804
|
+
}, Math.max(0, f - p));
|
|
1805
|
+
})), !l && !r && (r = setTimeout(() => i = !0, f)), i = !1, o);
|
|
1806
|
+
};
|
|
1807
|
+
}
|
|
1808
|
+
function pausableFilter(e = bypassFilter, n = {}) {
|
|
1809
|
+
let { initialState: r = "active" } = n, i = toRef$1(r === "active");
|
|
1810
|
+
function a() {
|
|
1811
|
+
i.value = !1;
|
|
1812
|
+
}
|
|
1813
|
+
function o() {
|
|
1814
|
+
i.value = !0;
|
|
1815
|
+
}
|
|
1816
|
+
return {
|
|
1817
|
+
isActive: readonly(i),
|
|
1818
|
+
pause: a,
|
|
1819
|
+
resume: o,
|
|
1820
|
+
eventFilter: (...n) => {
|
|
1821
|
+
i.value && e(...n);
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
function promiseTimeout(e, n = !1, r = "Timeout") {
|
|
1826
|
+
return new Promise((i, a) => {
|
|
1827
|
+
n ? setTimeout(() => a(r), e) : setTimeout(i, e);
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
function pxValue(e) {
|
|
1831
|
+
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
|
|
1832
|
+
}
|
|
1833
|
+
function toArray(e) {
|
|
1834
|
+
return Array.isArray(e) ? e : [e];
|
|
1835
|
+
}
|
|
1836
|
+
function cacheStringFunction(e) {
|
|
1837
|
+
let n = /* @__PURE__ */ Object.create(null);
|
|
1838
|
+
return (r) => n[r] || (n[r] = e(r));
|
|
1839
|
+
}
|
|
1840
|
+
var camelizeRE = /-(\w)/g, camelize = cacheStringFunction((e) => e.replace(camelizeRE, (e, n) => n ? n.toUpperCase() : ""));
|
|
1841
|
+
function getLifeCycleTarget(e) {
|
|
1842
|
+
return e || getCurrentInstance();
|
|
1843
|
+
}
|
|
1844
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1845
|
+
function useDebounceFn(e, n = 200, r = {}) {
|
|
1846
|
+
return createFilterWrapper(debounceFilter(n, r), e);
|
|
1847
|
+
}
|
|
1848
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1849
|
+
function useThrottleFn(e, n = 200, r = !1, i = !0, a = !1) {
|
|
1850
|
+
return createFilterWrapper(throttleFilter(n, r, i, a), e);
|
|
1851
|
+
}
|
|
1852
|
+
function watchWithFilter(e, n, r = {}) {
|
|
1853
|
+
let { eventFilter: i = bypassFilter,...a } = r;
|
|
1854
|
+
return watch(e, createFilterWrapper(i, n), a);
|
|
1855
|
+
}
|
|
1856
|
+
function watchPausable(e, n, r = {}) {
|
|
1857
|
+
let { eventFilter: i, initialState: a = "active",...o } = r, { eventFilter: s, pause: c, resume: l, isActive: u } = pausableFilter(i, { initialState: a });
|
|
1858
|
+
return {
|
|
1859
|
+
stop: watchWithFilter(e, n, {
|
|
1860
|
+
...o,
|
|
1861
|
+
eventFilter: s
|
|
1862
|
+
}),
|
|
1863
|
+
pause: c,
|
|
1864
|
+
resume: l,
|
|
1865
|
+
isActive: u
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
function tryOnMounted(e, n = !0, r) {
|
|
1869
|
+
getLifeCycleTarget(r) ? onMounted(e, r) : n ? e() : nextTick(e);
|
|
1870
|
+
}
|
|
1871
|
+
function createUntil(e, n = !1) {
|
|
1872
|
+
function r(r, { flush: i = "sync", deep: a = !1, timeout: o, throwOnTimeout: s } = {}) {
|
|
1873
|
+
let c = null, l = [new Promise((o) => {
|
|
1874
|
+
c = watch(e, (e) => {
|
|
1875
|
+
r(e) !== n && (c ? c() : nextTick(() => c?.()), o(e));
|
|
1876
|
+
}, {
|
|
1877
|
+
flush: i,
|
|
1878
|
+
deep: a,
|
|
1879
|
+
immediate: !0
|
|
1880
|
+
});
|
|
1881
|
+
})];
|
|
1882
|
+
return o != null && l.push(promiseTimeout(o, s).then(() => toValue(e)).finally(() => c?.())), Promise.race(l);
|
|
1883
|
+
}
|
|
1884
|
+
function i(i, a) {
|
|
1885
|
+
if (!isRef(i)) return r((e) => e === i, a);
|
|
1886
|
+
let { flush: o = "sync", deep: s = !1, timeout: c, throwOnTimeout: l } = a ?? {}, u = null, d = [new Promise((r) => {
|
|
1887
|
+
u = watch([e, i], ([e, i]) => {
|
|
1888
|
+
n !== (e === i) && (u ? u() : nextTick(() => u?.()), r(e));
|
|
1889
|
+
}, {
|
|
1890
|
+
flush: o,
|
|
1891
|
+
deep: s,
|
|
1892
|
+
immediate: !0
|
|
1893
|
+
});
|
|
1894
|
+
})];
|
|
1895
|
+
return c != null && d.push(promiseTimeout(c, l).then(() => toValue(e)).finally(() => (u?.(), toValue(e)))), Promise.race(d);
|
|
1896
|
+
}
|
|
1897
|
+
function a(e) {
|
|
1898
|
+
return r((e) => !!e, e);
|
|
1899
|
+
}
|
|
1900
|
+
function o(e) {
|
|
1901
|
+
return i(null, e);
|
|
1902
|
+
}
|
|
1903
|
+
function s(e) {
|
|
1904
|
+
return i(void 0, e);
|
|
1905
|
+
}
|
|
1906
|
+
function c(e) {
|
|
1907
|
+
return r(Number.isNaN, e);
|
|
1908
|
+
}
|
|
1909
|
+
function l(e, n) {
|
|
1910
|
+
return r((n) => {
|
|
1911
|
+
let r = Array.from(n);
|
|
1912
|
+
return r.includes(e) || r.includes(toValue(e));
|
|
1913
|
+
}, n);
|
|
1914
|
+
}
|
|
1915
|
+
function u(e) {
|
|
1916
|
+
return d(1, e);
|
|
1917
|
+
}
|
|
1918
|
+
function d(e = 1, n) {
|
|
1919
|
+
let i = -1;
|
|
1920
|
+
return r(() => (i += 1, i >= e), n);
|
|
1921
|
+
}
|
|
1922
|
+
return Array.isArray(toValue(e)) ? {
|
|
1923
|
+
toMatch: r,
|
|
1924
|
+
toContains: l,
|
|
1925
|
+
changed: u,
|
|
1926
|
+
changedTimes: d,
|
|
1927
|
+
get not() {
|
|
1928
|
+
return createUntil(e, !n);
|
|
1929
|
+
}
|
|
1930
|
+
} : {
|
|
1931
|
+
toMatch: r,
|
|
1932
|
+
toBe: i,
|
|
1933
|
+
toBeTruthy: a,
|
|
1934
|
+
toBeNull: o,
|
|
1935
|
+
toBeNaN: c,
|
|
1936
|
+
toBeUndefined: s,
|
|
1937
|
+
changed: u,
|
|
1938
|
+
changedTimes: d,
|
|
1939
|
+
get not() {
|
|
1940
|
+
return createUntil(e, !n);
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
function until(e) {
|
|
1945
|
+
return createUntil(e);
|
|
1946
|
+
}
|
|
1947
|
+
function watchImmediate(e, n, r) {
|
|
1948
|
+
return watch(e, n, {
|
|
1949
|
+
...r,
|
|
1950
|
+
immediate: !0
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
function watchOnce(e, n, r) {
|
|
1954
|
+
return watch(e, n, {
|
|
1955
|
+
...r,
|
|
1956
|
+
once: !0
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
function computedAsync(e, n, r) {
|
|
1960
|
+
let a;
|
|
1961
|
+
a = isRef(r) ? { evaluating: r } : r || {};
|
|
1962
|
+
let { lazy: o = !1, flush: s = "pre", evaluating: c = void 0, shallow: l = !0, onError: u = globalThis.reportError ?? noop$1 } = a, d = shallowRef(!o), f = l ? shallowRef(n) : ref(n), p = 0;
|
|
1963
|
+
return watchEffect(async (n) => {
|
|
1964
|
+
if (!d.value) return;
|
|
1965
|
+
p++;
|
|
1966
|
+
let r = p, i = !1;
|
|
1967
|
+
c && Promise.resolve().then(() => {
|
|
1968
|
+
c.value = !0;
|
|
1969
|
+
});
|
|
1970
|
+
try {
|
|
1971
|
+
let a = await e((e) => {
|
|
1972
|
+
n(() => {
|
|
1973
|
+
c && (c.value = !1), i || e();
|
|
1974
|
+
});
|
|
1975
|
+
});
|
|
1976
|
+
r === p && (f.value = a);
|
|
1977
|
+
} catch (e) {
|
|
1978
|
+
u(e);
|
|
1979
|
+
} finally {
|
|
1980
|
+
c && r === p && (c.value = !1), i = !0;
|
|
1981
|
+
}
|
|
1982
|
+
}, { flush: s }), o ? computed(() => (d.value = !0, f.value)) : f;
|
|
1983
|
+
}
|
|
1984
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1985
|
+
function createReusableTemplate(e = {}) {
|
|
1986
|
+
let { inheritAttrs: n = !0 } = e, r = shallowRef(), i = /* @__PURE__ */ defineComponent({ setup(e, { slots: n }) {
|
|
1987
|
+
return () => {
|
|
1988
|
+
r.value = n.default;
|
|
1989
|
+
};
|
|
1990
|
+
} }), a = /* @__PURE__ */ defineComponent({
|
|
1991
|
+
inheritAttrs: n,
|
|
1992
|
+
props: e.props,
|
|
1993
|
+
setup(i, { attrs: a, slots: o }) {
|
|
1994
|
+
return () => {
|
|
1995
|
+
if (!r.value && process.env.NODE_ENV !== "production") throw Error("[VueUse] Failed to find the definition of reusable template");
|
|
1996
|
+
let s = r.value?.call(r, {
|
|
1997
|
+
...e.props == null ? keysToCamelKebabCase(a) : i,
|
|
1998
|
+
$slots: o
|
|
1999
|
+
});
|
|
2000
|
+
return n && s?.length === 1 ? s[0] : s;
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
});
|
|
2004
|
+
return /* @__PURE__ */ makeDestructurable({
|
|
2005
|
+
define: i,
|
|
2006
|
+
reuse: a
|
|
2007
|
+
}, [i, a]);
|
|
2008
|
+
}
|
|
2009
|
+
function keysToCamelKebabCase(e) {
|
|
2010
|
+
let n = {};
|
|
2011
|
+
for (let r in e) n[camelize(r)] = e[r];
|
|
2012
|
+
return n;
|
|
2013
|
+
}
|
|
2014
|
+
var defaultWindow = isClient ? window : void 0;
|
|
2015
|
+
isClient && window.document, isClient && window.navigator, isClient && window.location;
|
|
2016
|
+
function unrefElement(e) {
|
|
2017
|
+
let n = toValue(e);
|
|
2018
|
+
return n?.$el ?? n;
|
|
2019
|
+
}
|
|
2020
|
+
function useEventListener$1(...e) {
|
|
2021
|
+
let n = [], r = () => {
|
|
2022
|
+
n.forEach((e) => e()), n.length = 0;
|
|
2023
|
+
}, a = (e, n, r, i) => (e.addEventListener(n, r, i), () => e.removeEventListener(n, r, i)), o = computed(() => {
|
|
2024
|
+
let n = toArray(toValue(e[0])).filter((e) => e != null);
|
|
2025
|
+
return n.every((e) => typeof e != "string") ? n : void 0;
|
|
2026
|
+
}), s = watchImmediate(() => [
|
|
2027
|
+
o.value?.map((e) => unrefElement(e)) ?? [defaultWindow].filter((e) => e != null),
|
|
2028
|
+
toArray(toValue(o.value ? e[1] : e[0])),
|
|
2029
|
+
toArray(unref(o.value ? e[2] : e[1])),
|
|
2030
|
+
toValue(o.value ? e[3] : e[2])
|
|
2031
|
+
], ([e, i, o, s]) => {
|
|
2032
|
+
if (r(), !e?.length || !i?.length || !o?.length) return;
|
|
2033
|
+
let c = isObject(s) ? { ...s } : s;
|
|
2034
|
+
n.push(...e.flatMap((e) => i.flatMap((n) => o.map((r) => a(e, n, r, c)))));
|
|
2035
|
+
}, { flush: "post" });
|
|
2036
|
+
return tryOnScopeDispose(r), () => {
|
|
2037
|
+
s(), r();
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2041
|
+
function useMounted() {
|
|
2042
|
+
let e = shallowRef(!1), n = getCurrentInstance();
|
|
2043
|
+
return n && onMounted(() => {
|
|
2044
|
+
e.value = !0;
|
|
2045
|
+
}, n), e;
|
|
2046
|
+
}
|
|
2047
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2048
|
+
function useSupported(e) {
|
|
2049
|
+
let n = /* @__PURE__ */ useMounted();
|
|
2050
|
+
return computed(() => (n.value, !!e()));
|
|
2051
|
+
}
|
|
2052
|
+
function useMutationObserver(e, n, r = {}) {
|
|
2053
|
+
let { window: a = defaultWindow,...o } = r, s, c = /* @__PURE__ */ useSupported(() => a && "MutationObserver" in a), l = () => {
|
|
2054
|
+
s &&= (s.disconnect(), void 0);
|
|
2055
|
+
}, u = computed(() => {
|
|
2056
|
+
let n = toValue(e), r = toArray(n).map(unrefElement).filter(notNullish);
|
|
2057
|
+
return new Set(r);
|
|
2058
|
+
}), d = watch(u, (e) => {
|
|
2059
|
+
l(), c.value && e.size && (s = new MutationObserver(n), e.forEach((e) => s.observe(e, o)));
|
|
2060
|
+
}, {
|
|
2061
|
+
immediate: !0,
|
|
2062
|
+
flush: "post"
|
|
2063
|
+
}), f = () => s?.takeRecords(), p = () => {
|
|
2064
|
+
d(), l();
|
|
2065
|
+
};
|
|
2066
|
+
return tryOnScopeDispose(p), {
|
|
2067
|
+
isSupported: c,
|
|
2068
|
+
stop: p,
|
|
2069
|
+
takeRecords: f
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
function onLongPress(e, n, r) {
|
|
2073
|
+
let a = computed(() => unrefElement(e)), o, s, c, l = !1;
|
|
2074
|
+
function u() {
|
|
2075
|
+
o &&= (clearTimeout(o), void 0), s = void 0, c = void 0, l = !1;
|
|
2076
|
+
}
|
|
2077
|
+
function d(e) {
|
|
2078
|
+
let n = r?.delay;
|
|
2079
|
+
return typeof n == "function" ? n(e) : n ?? 500;
|
|
2080
|
+
}
|
|
2081
|
+
function f(e) {
|
|
2082
|
+
let [n, i, o] = [
|
|
2083
|
+
c,
|
|
2084
|
+
s,
|
|
2085
|
+
l
|
|
2086
|
+
];
|
|
2087
|
+
if (u(), !r?.onMouseUp || !i || !n || r?.modifiers?.self && e.target !== a.value) return;
|
|
2088
|
+
r?.modifiers?.prevent && e.preventDefault(), r?.modifiers?.stop && e.stopPropagation();
|
|
2089
|
+
let d = e.x - i.x, f = e.y - i.y, p = Math.sqrt(d * d + f * f);
|
|
2090
|
+
r.onMouseUp(e.timeStamp - n, p, o);
|
|
2091
|
+
}
|
|
2092
|
+
function p(e) {
|
|
2093
|
+
r?.modifiers?.self && e.target !== a.value || (u(), r?.modifiers?.prevent && e.preventDefault(), r?.modifiers?.stop && e.stopPropagation(), s = {
|
|
2094
|
+
x: e.x,
|
|
2095
|
+
y: e.y
|
|
2096
|
+
}, c = e.timeStamp, o = setTimeout(() => {
|
|
2097
|
+
l = !0, n(e);
|
|
2098
|
+
}, d(e)));
|
|
2099
|
+
}
|
|
2100
|
+
function m(e) {
|
|
2101
|
+
if (r?.modifiers?.self && e.target !== a.value || !s || r?.distanceThreshold === !1) return;
|
|
2102
|
+
r?.modifiers?.prevent && e.preventDefault(), r?.modifiers?.stop && e.stopPropagation();
|
|
2103
|
+
let n = e.x - s.x, i = e.y - s.y;
|
|
2104
|
+
Math.sqrt(n * n + i * i) >= (r?.distanceThreshold ?? 10) && u();
|
|
2105
|
+
}
|
|
2106
|
+
let h = {
|
|
2107
|
+
capture: r?.modifiers?.capture,
|
|
2108
|
+
once: r?.modifiers?.once
|
|
2109
|
+
}, g = [
|
|
2110
|
+
useEventListener$1(a, "pointerdown", p, h),
|
|
2111
|
+
useEventListener$1(a, "pointermove", m, h),
|
|
2112
|
+
useEventListener$1(a, ["pointerup", "pointerleave"], f, h)
|
|
2113
|
+
];
|
|
2114
|
+
return () => g.forEach((e) => e());
|
|
2115
|
+
}
|
|
2116
|
+
var ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
2117
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2118
|
+
function useSSRWidth() {
|
|
2119
|
+
let e = hasInjectionContext() ? /* @__PURE__ */ injectLocal(ssrWidthSymbol, null) : null;
|
|
2120
|
+
return typeof e == "number" ? e : void 0;
|
|
2121
|
+
}
|
|
2122
|
+
function useMediaQuery(e, n = {}) {
|
|
2123
|
+
let { window: r = defaultWindow, ssrWidth: a = /* @__PURE__ */ useSSRWidth() } = n, o = /* @__PURE__ */ useSupported(() => r && "matchMedia" in r && typeof r.matchMedia == "function"), s = shallowRef(typeof a == "number"), c = shallowRef(), l = shallowRef(!1);
|
|
2124
|
+
return watchEffect(() => {
|
|
2125
|
+
if (s.value) {
|
|
2126
|
+
s.value = !o.value, l.value = toValue(e).split(",").some((e) => {
|
|
2127
|
+
let n = e.includes("not all"), r = e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), i = e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), o = !!(r || i);
|
|
2128
|
+
return r && o && (o = a >= pxValue(r[1])), i && o && (o = a <= pxValue(i[1])), n ? !o : o;
|
|
2129
|
+
});
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
o.value && (c.value = r.matchMedia(toValue(e)), l.value = c.value.matches);
|
|
2133
|
+
}), useEventListener$1(c, "change", (e) => {
|
|
2134
|
+
l.value = e.matches;
|
|
2135
|
+
}, { passive: !0 }), computed(() => l.value);
|
|
2136
|
+
}
|
|
2137
|
+
var _global = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, globalKey = "__vueuse_ssr_handlers__", handlers = /* @__PURE__ */ getHandlers();
|
|
2138
|
+
function getHandlers() {
|
|
2139
|
+
return "__vueuse_ssr_handlers__" in _global || (_global[globalKey] = _global.__vueuse_ssr_handlers__ || {}), _global[globalKey];
|
|
2140
|
+
}
|
|
2141
|
+
function getSSRHandler(e, n) {
|
|
2142
|
+
return handlers[e] || n;
|
|
2143
|
+
}
|
|
2144
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2145
|
+
function usePreferredDark(e) {
|
|
2146
|
+
return useMediaQuery("(prefers-color-scheme: dark)", e);
|
|
2147
|
+
}
|
|
2148
|
+
function guessSerializerType(e) {
|
|
2149
|
+
return e == null ? "any" : e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof Date ? "date" : typeof e == "boolean" ? "boolean" : typeof e == "string" ? "string" : typeof e == "object" ? "object" : Number.isNaN(e) ? "any" : "number";
|
|
2150
|
+
}
|
|
2151
|
+
var StorageSerializers = {
|
|
2152
|
+
boolean: {
|
|
2153
|
+
read: (e) => e === "true",
|
|
2154
|
+
write: (e) => String(e)
|
|
2155
|
+
},
|
|
2156
|
+
object: {
|
|
2157
|
+
read: (e) => JSON.parse(e),
|
|
2158
|
+
write: (e) => JSON.stringify(e)
|
|
2159
|
+
},
|
|
2160
|
+
number: {
|
|
2161
|
+
read: (e) => Number.parseFloat(e),
|
|
2162
|
+
write: (e) => String(e)
|
|
2163
|
+
},
|
|
2164
|
+
any: {
|
|
2165
|
+
read: (e) => e,
|
|
2166
|
+
write: (e) => String(e)
|
|
2167
|
+
},
|
|
2168
|
+
string: {
|
|
2169
|
+
read: (e) => e,
|
|
2170
|
+
write: (e) => String(e)
|
|
2171
|
+
},
|
|
2172
|
+
map: {
|
|
2173
|
+
read: (e) => new Map(JSON.parse(e)),
|
|
2174
|
+
write: (e) => JSON.stringify(Array.from(e.entries()))
|
|
2175
|
+
},
|
|
2176
|
+
set: {
|
|
2177
|
+
read: (e) => new Set(JSON.parse(e)),
|
|
2178
|
+
write: (e) => JSON.stringify(Array.from(e))
|
|
2179
|
+
},
|
|
2180
|
+
date: {
|
|
2181
|
+
read: (e) => new Date(e),
|
|
2182
|
+
write: (e) => e.toISOString()
|
|
2183
|
+
}
|
|
2184
|
+
}, customStorageEventName = "vueuse-storage";
|
|
2185
|
+
function useStorage(e, n, r, a = {}) {
|
|
2186
|
+
let { flush: o = "pre", deep: s = !0, listenToStorageChanges: c = !0, writeDefaults: l = !0, mergeDefaults: u = !1, shallow: d, window: f = defaultWindow, eventFilter: p, onError: m = (e) => {
|
|
2187
|
+
console.error(e);
|
|
2188
|
+
}, initOnMounted: h } = a, g = (d ? shallowRef : ref)(typeof n == "function" ? n() : n), v = computed(() => toValue(e));
|
|
2189
|
+
if (!r) try {
|
|
2190
|
+
r = getSSRHandler("getDefaultStorage", () => defaultWindow?.localStorage)();
|
|
2191
|
+
} catch (e) {
|
|
2192
|
+
m(e);
|
|
2193
|
+
}
|
|
2194
|
+
if (!r) return g;
|
|
2195
|
+
let y = toValue(n), b = guessSerializerType(y), S = a.serializer ?? StorageSerializers[b], { pause: C, resume: w } = watchPausable(g, (e) => k(e), {
|
|
2196
|
+
flush: o,
|
|
2197
|
+
deep: s,
|
|
2198
|
+
eventFilter: p
|
|
2199
|
+
});
|
|
2200
|
+
watch(v, () => j(), { flush: o });
|
|
2201
|
+
let D = !1;
|
|
2202
|
+
f && c && (r instanceof Storage ? useEventListener$1(f, "storage", (e) => {
|
|
2203
|
+
h && !D || j(e);
|
|
2204
|
+
}, { passive: !0 }) : useEventListener$1(f, customStorageEventName, (e) => {
|
|
2205
|
+
h && !D || M(e);
|
|
2206
|
+
})), h ? tryOnMounted(() => {
|
|
2207
|
+
D = !0, j();
|
|
2208
|
+
}) : j();
|
|
2209
|
+
function O(e, n) {
|
|
2210
|
+
if (f) {
|
|
2211
|
+
let i = {
|
|
2212
|
+
key: v.value,
|
|
2213
|
+
oldValue: e,
|
|
2214
|
+
newValue: n,
|
|
2215
|
+
storageArea: r
|
|
2216
|
+
};
|
|
2217
|
+
f.dispatchEvent(r instanceof Storage ? new StorageEvent("storage", i) : new CustomEvent(customStorageEventName, { detail: i }));
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
function k(e) {
|
|
2221
|
+
try {
|
|
2222
|
+
let n = r.getItem(v.value);
|
|
2223
|
+
if (e == null) O(n, null), r.removeItem(v.value);
|
|
2224
|
+
else {
|
|
2225
|
+
let i = S.write(e);
|
|
2226
|
+
n !== i && (r.setItem(v.value, i), O(n, i));
|
|
2227
|
+
}
|
|
2228
|
+
} catch (e) {
|
|
2229
|
+
m(e);
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
function A(e) {
|
|
2233
|
+
let n = e ? e.newValue : r.getItem(v.value);
|
|
2234
|
+
if (n == null) return l && y != null && r.setItem(v.value, S.write(y)), y;
|
|
2235
|
+
if (!e && u) {
|
|
2236
|
+
let e = S.read(n);
|
|
2237
|
+
return typeof u == "function" ? u(e, y) : b === "object" && !Array.isArray(e) ? {
|
|
2238
|
+
...y,
|
|
2239
|
+
...e
|
|
2240
|
+
} : e;
|
|
2241
|
+
} else if (typeof n != "string") return n;
|
|
2242
|
+
else return S.read(n);
|
|
2243
|
+
}
|
|
2244
|
+
function j(e) {
|
|
2245
|
+
if (!(e && e.storageArea !== r)) {
|
|
2246
|
+
if (e && e.key == null) {
|
|
2247
|
+
g.value = y;
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
if (!(e && e.key !== v.value)) {
|
|
2251
|
+
C();
|
|
2252
|
+
try {
|
|
2253
|
+
let n = S.write(g.value);
|
|
2254
|
+
(e === void 0 || e?.newValue !== n) && (g.value = A(e));
|
|
2255
|
+
} catch (e) {
|
|
2256
|
+
m(e);
|
|
2257
|
+
} finally {
|
|
2258
|
+
e ? nextTick(w) : w();
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
function M(e) {
|
|
2264
|
+
j(e.detail);
|
|
2265
|
+
}
|
|
2266
|
+
return g;
|
|
2267
|
+
}
|
|
2268
|
+
function useResizeObserver(e, n, r = {}) {
|
|
2269
|
+
let { window: a = defaultWindow,...o } = r, s, c = /* @__PURE__ */ useSupported(() => a && "ResizeObserver" in a), l = () => {
|
|
2270
|
+
s &&= (s.disconnect(), void 0);
|
|
2271
|
+
}, u = computed(() => {
|
|
2272
|
+
let n = toValue(e);
|
|
2273
|
+
return Array.isArray(n) ? n.map((e) => unrefElement(e)) : [unrefElement(n)];
|
|
2274
|
+
}), d = watch(u, (e) => {
|
|
2275
|
+
if (l(), c.value && a) {
|
|
2276
|
+
s = new ResizeObserver(n);
|
|
2277
|
+
for (let n of e) n && s.observe(n, o);
|
|
2278
|
+
}
|
|
2279
|
+
}, {
|
|
2280
|
+
immediate: !0,
|
|
2281
|
+
flush: "post"
|
|
2282
|
+
}), f = () => {
|
|
2283
|
+
l(), d();
|
|
2284
|
+
};
|
|
2285
|
+
return tryOnScopeDispose(f), {
|
|
2286
|
+
isSupported: c,
|
|
2287
|
+
stop: f
|
|
2288
|
+
};
|
|
2289
|
+
}
|
|
2290
|
+
function useElementSize(e, n = {
|
|
2291
|
+
width: 0,
|
|
2292
|
+
height: 0
|
|
2293
|
+
}, r = {}) {
|
|
2294
|
+
let { window: a = defaultWindow, box: o = "content-box" } = r, s = computed(() => (unrefElement(e)?.namespaceURI)?.includes("svg")), c = shallowRef(n.width), l = shallowRef(n.height), { stop: u } = useResizeObserver(e, ([n]) => {
|
|
2295
|
+
let r = o === "border-box" ? n.borderBoxSize : o === "content-box" ? n.contentBoxSize : n.devicePixelContentBoxSize;
|
|
2296
|
+
if (a && s.value) {
|
|
2297
|
+
let n = unrefElement(e);
|
|
2298
|
+
if (n) {
|
|
2299
|
+
let e = n.getBoundingClientRect();
|
|
2300
|
+
c.value = e.width, l.value = e.height;
|
|
2301
|
+
}
|
|
2302
|
+
} else if (r) {
|
|
2303
|
+
let e = toArray(r);
|
|
2304
|
+
c.value = e.reduce((e, { inlineSize: n }) => e + n, 0), l.value = e.reduce((e, { blockSize: n }) => e + n, 0);
|
|
2305
|
+
} else c.value = n.contentRect.width, l.value = n.contentRect.height;
|
|
2306
|
+
}, r);
|
|
2307
|
+
tryOnMounted(() => {
|
|
2308
|
+
let r = unrefElement(e);
|
|
2309
|
+
r && (c.value = "offsetWidth" in r ? r.offsetWidth : n.width, l.value = "offsetHeight" in r ? r.offsetHeight : n.height);
|
|
2310
|
+
});
|
|
2311
|
+
let d = watch(() => unrefElement(e), (e) => {
|
|
2312
|
+
c.value = e ? n.width : 0, l.value = e ? n.height : 0;
|
|
2313
|
+
});
|
|
2314
|
+
function f() {
|
|
2315
|
+
u(), d();
|
|
2316
|
+
}
|
|
2317
|
+
return {
|
|
2318
|
+
width: c,
|
|
2319
|
+
height: l,
|
|
2320
|
+
stop: f
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
2323
|
+
function useScroll(e, n = {}) {
|
|
2324
|
+
let { throttle: r = 0, idle: a = 200, onStop: o = noop$1, onScroll: s = noop$1, offset: c = {
|
|
2325
|
+
left: 0,
|
|
2326
|
+
right: 0,
|
|
2327
|
+
top: 0,
|
|
2328
|
+
bottom: 0
|
|
2329
|
+
}, observe: l = { mutation: !1 }, eventListenerOptions: u = {
|
|
2330
|
+
capture: !1,
|
|
2331
|
+
passive: !0
|
|
2332
|
+
}, behavior: d = "auto", window: f = defaultWindow, onError: p = (e) => {
|
|
2333
|
+
console.error(e);
|
|
2334
|
+
} } = n, m = typeof l == "boolean" ? { mutation: l } : l, h = shallowRef(0), g = shallowRef(0), v = computed({
|
|
2335
|
+
get() {
|
|
2336
|
+
return h.value;
|
|
2337
|
+
},
|
|
2338
|
+
set(e) {
|
|
2339
|
+
b(e, void 0);
|
|
2340
|
+
}
|
|
2341
|
+
}), y = computed({
|
|
2342
|
+
get() {
|
|
2343
|
+
return g.value;
|
|
2344
|
+
},
|
|
2345
|
+
set(e) {
|
|
2346
|
+
b(void 0, e);
|
|
2347
|
+
}
|
|
2348
|
+
});
|
|
2349
|
+
function b(n, r) {
|
|
2350
|
+
var i;
|
|
2351
|
+
if (!f) return;
|
|
2352
|
+
let a = toValue(e);
|
|
2353
|
+
if (!a) return;
|
|
2354
|
+
(i = a instanceof Document ? f.document.body : a) == null || i.scrollTo({
|
|
2355
|
+
top: toValue(r) ?? y.value,
|
|
2356
|
+
left: toValue(n) ?? v.value,
|
|
2357
|
+
behavior: toValue(d)
|
|
2358
|
+
});
|
|
2359
|
+
let o = a?.document?.documentElement || a?.documentElement || a;
|
|
2360
|
+
v != null && (h.value = o.scrollLeft), y != null && (g.value = o.scrollTop);
|
|
2361
|
+
}
|
|
2362
|
+
let S = shallowRef(!1), C = reactive({
|
|
2363
|
+
left: !0,
|
|
2364
|
+
right: !1,
|
|
2365
|
+
top: !0,
|
|
2366
|
+
bottom: !1
|
|
2367
|
+
}), w = reactive({
|
|
2368
|
+
left: !1,
|
|
2369
|
+
right: !1,
|
|
2370
|
+
top: !1,
|
|
2371
|
+
bottom: !1
|
|
2372
|
+
}), E = (e) => {
|
|
2373
|
+
S.value && (S.value = !1, w.left = !1, w.right = !1, w.top = !1, w.bottom = !1, o(e));
|
|
2374
|
+
}, D = /* @__PURE__ */ useDebounceFn(E, r + a), O = (e) => {
|
|
2375
|
+
if (!f) return;
|
|
2376
|
+
let n = e?.document?.documentElement || e?.documentElement || unrefElement(e), { display: r, flexDirection: i, direction: a } = getComputedStyle(n), o = a === "rtl" ? -1 : 1, s = n.scrollLeft;
|
|
2377
|
+
w.left = s < h.value, w.right = s > h.value;
|
|
2378
|
+
let l = Math.abs(s * o) <= (c.left || 0), u = Math.abs(s * o) + n.clientWidth >= n.scrollWidth - (c.right || 0) - 1;
|
|
2379
|
+
r === "flex" && i === "row-reverse" ? (C.left = u, C.right = l) : (C.left = l, C.right = u), h.value = s;
|
|
2380
|
+
let d = n.scrollTop;
|
|
2381
|
+
e === f.document && !d && (d = f.document.body.scrollTop), w.top = d < g.value, w.bottom = d > g.value;
|
|
2382
|
+
let p = Math.abs(d) <= (c.top || 0), m = Math.abs(d) + n.clientHeight >= n.scrollHeight - (c.bottom || 0) - 1;
|
|
2383
|
+
r === "flex" && i === "column-reverse" ? (C.top = m, C.bottom = p) : (C.top = p, C.bottom = m), g.value = d;
|
|
2384
|
+
}, k = (e) => {
|
|
2385
|
+
if (!f) return;
|
|
2386
|
+
let n = e.target.documentElement ?? e.target;
|
|
2387
|
+
O(n), S.value = !0, D(e), s(e);
|
|
2388
|
+
};
|
|
2389
|
+
return useEventListener$1(e, "scroll", r ? /* @__PURE__ */ useThrottleFn(k, r, !0, !1) : k, u), tryOnMounted(() => {
|
|
2390
|
+
try {
|
|
2391
|
+
let n = toValue(e);
|
|
2392
|
+
if (!n) return;
|
|
2393
|
+
O(n);
|
|
2394
|
+
} catch (e) {
|
|
2395
|
+
p(e);
|
|
2396
|
+
}
|
|
2397
|
+
}), m?.mutation && e != null && e !== f && e !== document && useMutationObserver(e, () => {
|
|
2398
|
+
let n = toValue(e);
|
|
2399
|
+
n && O(n);
|
|
2400
|
+
}, {
|
|
2401
|
+
attributes: !0,
|
|
2402
|
+
childList: !0,
|
|
2403
|
+
subtree: !0
|
|
2404
|
+
}), useEventListener$1(e, "scrollend", E, u), {
|
|
2405
|
+
x: v,
|
|
2406
|
+
y,
|
|
2407
|
+
isScrolling: S,
|
|
2408
|
+
arrivedState: C,
|
|
2409
|
+
directions: w,
|
|
2410
|
+
measure() {
|
|
2411
|
+
let n = toValue(e);
|
|
2412
|
+
f && n && O(n);
|
|
2413
|
+
}
|
|
2414
|
+
};
|
|
2415
|
+
}
|
|
2416
|
+
function useLocalStorage(e, n, r = {}) {
|
|
2417
|
+
let { window: i = defaultWindow } = r;
|
|
2418
|
+
return useStorage(e, n, i?.localStorage, r);
|
|
2419
|
+
}
|
|
2420
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2421
|
+
function useWindowSize(e = {}) {
|
|
2422
|
+
let { window: n = defaultWindow, initialWidth: r = Infinity, initialHeight: i = Infinity, listenOrientation: a = !0, includeScrollbar: o = !0, type: s = "inner" } = e, c = shallowRef(r), l = shallowRef(i), u = () => {
|
|
2423
|
+
if (n) if (s === "outer") c.value = n.outerWidth, l.value = n.outerHeight;
|
|
2424
|
+
else if (s === "visual" && n.visualViewport) {
|
|
2425
|
+
let { width: e, height: r, scale: i } = n.visualViewport;
|
|
2426
|
+
c.value = Math.round(e * i), l.value = Math.round(r * i);
|
|
2427
|
+
} else o ? (c.value = n.innerWidth, l.value = n.innerHeight) : (c.value = n.document.documentElement.clientWidth, l.value = n.document.documentElement.clientHeight);
|
|
2428
|
+
};
|
|
2429
|
+
u(), tryOnMounted(u);
|
|
2430
|
+
let d = { passive: !0 };
|
|
2431
|
+
if (useEventListener$1("resize", u, d), n && s === "visual" && n.visualViewport && useEventListener$1(n.visualViewport, "resize", u, d), a) {
|
|
2432
|
+
let e = useMediaQuery("(orientation: portrait)");
|
|
2433
|
+
watch(e, () => u());
|
|
2434
|
+
}
|
|
2435
|
+
return {
|
|
2436
|
+
width: c,
|
|
2437
|
+
height: l
|
|
2438
|
+
};
|
|
2439
|
+
}
|
|
2440
|
+
const useGlobalVar = (e, n) => (window.$api.__core_lib__ ??= {})[n] ??= e;
|
|
2441
|
+
var layout_exports = /* @__PURE__ */ __export({ useZIndex: () => useZIndex }), allLayers = useGlobalVar(shallowReactive([]), "utils/layers");
|
|
2442
|
+
const useZIndex = (e) => {
|
|
2443
|
+
let n = Symbol("layer"), r = toRef$1(e), a = watch(r, (e) => {
|
|
2444
|
+
e ? allLayers.push(n) : remove(allLayers, (e) => e === n);
|
|
2445
|
+
}, { immediate: !0 });
|
|
2446
|
+
try {
|
|
2447
|
+
onUnmounted(a);
|
|
2448
|
+
} catch {}
|
|
2449
|
+
return [
|
|
2450
|
+
computed(() => (allLayers.indexOf(n) + 1) * 10),
|
|
2451
|
+
computed(() => last(allLayers) === n),
|
|
2452
|
+
a
|
|
2453
|
+
];
|
|
2454
|
+
};
|
|
2455
|
+
var floatPopup_default = /* @__PURE__ */ defineComponent({
|
|
2456
|
+
__name: "floatPopup",
|
|
2457
|
+
props: {
|
|
2458
|
+
anchors: { default: "high" },
|
|
2459
|
+
lockScroll: {
|
|
2460
|
+
type: Boolean,
|
|
2461
|
+
default: !1
|
|
2462
|
+
},
|
|
2463
|
+
class: {},
|
|
2464
|
+
style: { type: [
|
|
2465
|
+
Boolean,
|
|
2466
|
+
null,
|
|
2467
|
+
String,
|
|
2468
|
+
Object,
|
|
2469
|
+
Array
|
|
2470
|
+
] },
|
|
2471
|
+
overlay: { type: Boolean }
|
|
2472
|
+
},
|
|
2473
|
+
setup(e, { expose: s }) {
|
|
2474
|
+
let l = window.$router, d = e, f = shallowRef(!1), { height: p } = /* @__PURE__ */ useWindowSize(), m = computed(() => isArray(d.anchors) ? d.anchors : d.anchors === "high" ? [
|
|
2475
|
+
0,
|
|
2476
|
+
Math.round(.4 * p.value),
|
|
2477
|
+
Math.round(.7 * p.value),
|
|
2478
|
+
p.value
|
|
2479
|
+
] : [
|
|
2480
|
+
0,
|
|
2481
|
+
Math.round(.3 * p.value),
|
|
2482
|
+
Math.round(.6 * p.value),
|
|
2483
|
+
Math.round(.9 * p.value)
|
|
2484
|
+
]), h = shallowRef(0), [g, v] = useZIndex(() => h.value > 0), y = noop;
|
|
2485
|
+
return watch(f, () => {
|
|
2486
|
+
f.value ? y = l.beforeEach(() => v.value ? f.value = !1 : void 0) : y();
|
|
2487
|
+
}), onBeforeRouteLeave(y), s({
|
|
2488
|
+
show(e = 2) {
|
|
2489
|
+
h.value = m.value[e], f.value = !0;
|
|
2490
|
+
},
|
|
2491
|
+
close() {
|
|
2492
|
+
f.value = !1;
|
|
2493
|
+
},
|
|
2494
|
+
isShowing: shallowReadonly(f),
|
|
2495
|
+
height: shallowReadonly(h)
|
|
2496
|
+
}), (e, i) => {
|
|
2497
|
+
let s = Overlay, l = FloatingPanel;
|
|
2498
|
+
return openBlock(), createBlock(Teleport, { to: "#popups" }, [e.overlay ? (openBlock(), createBlock(s, {
|
|
2499
|
+
key: 0,
|
|
2500
|
+
zIndex: unref(g),
|
|
2501
|
+
show: f.value,
|
|
2502
|
+
onClick: i[0] ||= (e) => f.value = !1
|
|
2503
|
+
}, null, 8, ["zIndex", "show"])) : createCommentVNode("", !0), createVNode(Transition, {
|
|
2504
|
+
onAfterLeave: i[3] ||= (e) => h.value = 0,
|
|
2505
|
+
name: "van-slide-up"
|
|
2506
|
+
}, {
|
|
2507
|
+
default: withCtx(() => [withDirectives(createVNode(l, {
|
|
2508
|
+
onHeightChange: i[1] ||= ({ height: e }) => e <= 0 && (f.value = !1),
|
|
2509
|
+
anchors: m.value,
|
|
2510
|
+
height: h.value,
|
|
2511
|
+
"onUpdate:height": i[2] ||= (e) => h.value = e,
|
|
2512
|
+
"content-draggable": !1,
|
|
2513
|
+
"lock-scroll": e.lockScroll,
|
|
2514
|
+
style: normalizeStyle([e.style, { zIndex: unref(g) }]),
|
|
2515
|
+
class: normalizeClass([e.class, "overflow-hidden border-0 border-t border-solid border-(--van-border-color)"])
|
|
2516
|
+
}, {
|
|
2517
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
2518
|
+
class: "bg-(--van-background) w-full",
|
|
2519
|
+
style: normalizeStyle({ height: `calc(${h.value}px - var(--van-floating-panel-header-height))` })
|
|
2520
|
+
}, [h.value == 0 ? createCommentVNode("", !0) : renderSlot(e.$slots, "default", {
|
|
2521
|
+
key: 0,
|
|
2522
|
+
height: h.value
|
|
2523
|
+
})], 4)]),
|
|
2524
|
+
_: 3
|
|
2525
|
+
}, 8, [
|
|
2526
|
+
"anchors",
|
|
2527
|
+
"height",
|
|
2528
|
+
"lock-scroll",
|
|
2529
|
+
"style",
|
|
2530
|
+
"class"
|
|
2531
|
+
]), [[vShow, f.value]])]),
|
|
2532
|
+
_: 3
|
|
2533
|
+
})]);
|
|
2534
|
+
};
|
|
2535
|
+
}
|
|
2536
|
+
}), image_exports = /* @__PURE__ */ __export({ showImagePreview: () => showImagePreview$1 });
|
|
2537
|
+
const showImagePreview$1 = (e, n = {}) => {
|
|
2538
|
+
let r = shallowRef(!0), [, , a] = useZIndex(r), o = showImagePreview({
|
|
2539
|
+
images: e,
|
|
2540
|
+
...n,
|
|
2541
|
+
overlayClass: "!z-2147483646",
|
|
2542
|
+
className: "!z-2147483646",
|
|
2543
|
+
onClose() {
|
|
2544
|
+
r.value = !1;
|
|
2545
|
+
},
|
|
2546
|
+
showIndex: e.length > 1,
|
|
2547
|
+
teleport: "#popups"
|
|
2548
|
+
}), s = window.$router.beforeEach(() => r.value = !1);
|
|
2549
|
+
return watchOnce(r, () => {
|
|
2550
|
+
s(), a(), o.show = !1;
|
|
2551
|
+
}), {
|
|
2552
|
+
isShowing: computed(() => o.show),
|
|
2553
|
+
close: () => {
|
|
2554
|
+
r.value = !1;
|
|
2555
|
+
}
|
|
2556
|
+
};
|
|
2557
|
+
}, useTemp = useGlobalVar(defineStore("core:temp", (e) => {
|
|
2558
|
+
let n = shallowReactive(/* @__PURE__ */ new Map()), r = (e, r) => (e = `reactive:${e}`, n.has(e) || n.set(e, reactive(r())), n.get(e)), i = e.action((e) => (e = `reactive:${e}`, n.has(e)), "has"), a = e.action((e) => (e = `reactive:${e}`, n.get(e)), "onlyGet"), o = e.action((e, r) => (e = `raw:${e}`, n.has(e) || n.set(e, r()), n.get(e)), "applyRaw"), s = e.action((e) => (e = `raw:${e}`, n.has(e)), "hasRaw"), c = e.action((e) => (e = `raw:${e}`, n.get(e)), "onlyGetRaw");
|
|
2559
|
+
return {
|
|
2560
|
+
$apply: r,
|
|
2561
|
+
$has: i,
|
|
2562
|
+
$onlyGet: a,
|
|
2563
|
+
$applyRaw: o,
|
|
2564
|
+
$hasRaw: s,
|
|
2565
|
+
$onlyGetRaw: c
|
|
2566
|
+
};
|
|
2567
|
+
}), "store/temp");
|
|
2568
|
+
var image_default = /* @__PURE__ */ defineComponent({
|
|
2569
|
+
__name: "image",
|
|
2570
|
+
props: {
|
|
2571
|
+
src: {},
|
|
2572
|
+
alt: {},
|
|
2573
|
+
previewable: { type: Boolean },
|
|
2574
|
+
retryMax: { default: 6 },
|
|
2575
|
+
round: { type: Boolean },
|
|
2576
|
+
fit: {},
|
|
2577
|
+
class: {},
|
|
2578
|
+
hideLoading: { type: Boolean },
|
|
2579
|
+
hideError: { type: Boolean },
|
|
2580
|
+
inline: { type: Boolean },
|
|
2581
|
+
style: { type: [
|
|
2582
|
+
Boolean,
|
|
2583
|
+
null,
|
|
2584
|
+
String,
|
|
2585
|
+
Object,
|
|
2586
|
+
Array
|
|
2587
|
+
] },
|
|
2588
|
+
imgProp: {},
|
|
2589
|
+
useList: {},
|
|
2590
|
+
fetchpriority: { default: "auto" },
|
|
2591
|
+
fallback: {}
|
|
2592
|
+
},
|
|
2593
|
+
emits: [
|
|
2594
|
+
"load",
|
|
2595
|
+
"click",
|
|
2596
|
+
"error"
|
|
2597
|
+
],
|
|
2598
|
+
setup(n, { expose: r, emit: l }) {
|
|
2599
|
+
let d = n, f = computedAsync(async () => {
|
|
2600
|
+
try {
|
|
2601
|
+
return d.src ? isString(d.src) ? d.src : await d.src.getUrl() : "";
|
|
2602
|
+
} catch (e) {
|
|
2603
|
+
console.error(e);
|
|
2604
|
+
}
|
|
2605
|
+
return "";
|
|
2606
|
+
}, ""), p = l, m = 0, h = async () => {
|
|
2607
|
+
if (m++, m > d.retryMax) return v.error.add(f.value), p("error");
|
|
2608
|
+
y.value = !1, await nextTick(), y.value = !0;
|
|
2609
|
+
}, g = useTemp().$apply("imageState", () => ({
|
|
2610
|
+
loaded: /* @__PURE__ */ new Set(),
|
|
2611
|
+
error: /* @__PURE__ */ new Set()
|
|
2612
|
+
})), v = d.useList ?? g, y = shallowRef(!0), b = () => {
|
|
2613
|
+
m = 0, h();
|
|
2614
|
+
};
|
|
2615
|
+
watch(f, b);
|
|
2616
|
+
let S = computed(() => v.loaded.has(f.value)), C = computedAsync(async () => {
|
|
2617
|
+
try {
|
|
2618
|
+
return d.fallback ? isString(d.fallback) ? d.fallback : await d.fallback.getUrl() : "";
|
|
2619
|
+
} catch (e) {
|
|
2620
|
+
console.error(e);
|
|
2621
|
+
}
|
|
2622
|
+
return "";
|
|
2623
|
+
}, ""), O = (e) => {
|
|
2624
|
+
p("click"), d.previewable && (e.stopPropagation(), showImagePreview$1([f.value], { closeable: !0 }));
|
|
2625
|
+
}, A = (...e) => {
|
|
2626
|
+
p("load", ...e), v.loaded.add(f.value);
|
|
2627
|
+
}, j = useTemplateRef("img");
|
|
2628
|
+
return r({
|
|
2629
|
+
isLoaded: S,
|
|
2630
|
+
imageEl: j.value?.imageRef,
|
|
2631
|
+
imageIns: j.value
|
|
2632
|
+
}), (n, r) => {
|
|
2633
|
+
let i = NImage, l = Icon;
|
|
2634
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
2635
|
+
y.value ? withDirectives((openBlock(), createBlock(i, mergeProps({
|
|
2636
|
+
key: 0,
|
|
2637
|
+
onError: h
|
|
2638
|
+
}, d, {
|
|
2639
|
+
"object-fit": n.fit,
|
|
2640
|
+
"preview-disabled": "",
|
|
2641
|
+
alt: n.alt,
|
|
2642
|
+
ref_key: "img",
|
|
2643
|
+
ref: j,
|
|
2644
|
+
"img-props": {
|
|
2645
|
+
...n.imgProp ?? {},
|
|
2646
|
+
class: "w-full",
|
|
2647
|
+
fetchpriority: d.fetchpriority
|
|
2648
|
+
},
|
|
2649
|
+
class: [
|
|
2650
|
+
{ "!rounded-full": !!n.round },
|
|
2651
|
+
n.inline ? "inline-flex" : "flex",
|
|
2652
|
+
d.class
|
|
2653
|
+
],
|
|
2654
|
+
style: n.style,
|
|
2655
|
+
onLoad: A,
|
|
2656
|
+
onClick: O,
|
|
2657
|
+
src: unref(f)
|
|
2658
|
+
}), null, 16, [
|
|
2659
|
+
"object-fit",
|
|
2660
|
+
"alt",
|
|
2661
|
+
"img-props",
|
|
2662
|
+
"class",
|
|
2663
|
+
"style",
|
|
2664
|
+
"src"
|
|
2665
|
+
])), [[vShow, !unref(v).error.has(unref(f)) && unref(v).loaded.has(unref(f))]]) : createCommentVNode("", !0),
|
|
2666
|
+
!unref(v).loaded.has(unref(f)) && !unref(v).error.has(unref(f)) && !n.hideLoading ? (openBlock(), createElementBlock("div", {
|
|
2667
|
+
key: 1,
|
|
2668
|
+
class: normalizeClass(["justify-center items-center", [
|
|
2669
|
+
{ "!rounded-full": !!n.round },
|
|
2670
|
+
n.inline ? "inline-flex" : "flex",
|
|
2671
|
+
d.class
|
|
2672
|
+
]]),
|
|
2673
|
+
style: normalizeStyle(n.style),
|
|
2674
|
+
onClick: r[0] ||= (e) => p("click")
|
|
2675
|
+
}, [n.$slots.loading ? renderSlot(n.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(loading_default, { key: 1 }))], 6)) : createCommentVNode("", !0),
|
|
2676
|
+
unref(v).error.has(unref(f)) && !n.hideError ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [n.fallback ? (openBlock(), createBlock(i, mergeProps({
|
|
2677
|
+
key: 0,
|
|
2678
|
+
onError: h
|
|
2679
|
+
}, d, {
|
|
2680
|
+
"object-fit": n.fit,
|
|
2681
|
+
"preview-disabled": "",
|
|
2682
|
+
alt: n.alt,
|
|
2683
|
+
"img-props": {
|
|
2684
|
+
...n.imgProp ?? {},
|
|
2685
|
+
class: "w-full",
|
|
2686
|
+
fetchpriority: d.fetchpriority
|
|
2687
|
+
},
|
|
2688
|
+
class: [
|
|
2689
|
+
{ "!rounded-full": !!n.round },
|
|
2690
|
+
n.inline ? "inline-flex" : "flex",
|
|
2691
|
+
d.class
|
|
2692
|
+
],
|
|
2693
|
+
style: n.style,
|
|
2694
|
+
src: unref(C)
|
|
2695
|
+
}), null, 16, [
|
|
2696
|
+
"object-fit",
|
|
2697
|
+
"alt",
|
|
2698
|
+
"img-props",
|
|
2699
|
+
"class",
|
|
2700
|
+
"style",
|
|
2701
|
+
"src"
|
|
2702
|
+
])) : (openBlock(), createElementBlock("div", {
|
|
2703
|
+
key: 1,
|
|
2704
|
+
class: normalizeClass(["justify-center items-center flex-col", [
|
|
2705
|
+
{ "!rounded-full": !!n.round },
|
|
2706
|
+
n.inline ? "inline-flex" : "flex",
|
|
2707
|
+
d.class
|
|
2708
|
+
]]),
|
|
2709
|
+
onClick: r[1] ||= withModifiers(() => {
|
|
2710
|
+
unref(v).error.delete(unref(f)), b();
|
|
2711
|
+
}, ["stop"])
|
|
2712
|
+
}, [n.$slots.loading ? renderSlot(n.$slots, "loading", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(l, {
|
|
2713
|
+
name: "warning-o",
|
|
2714
|
+
size: "2.5rem",
|
|
2715
|
+
color: "var(--van-text-color-2)"
|
|
2716
|
+
}), r[2] ||= createElementVNode("div", { class: "text-sm text-(--van-text-color-2)" }, "点击重试", -1)], 64))], 2))], 64)) : createCommentVNode("", !0)
|
|
2717
|
+
], 64);
|
|
2718
|
+
};
|
|
2719
|
+
}
|
|
2720
|
+
});
|
|
2721
|
+
function mitt_default(e) {
|
|
2722
|
+
return {
|
|
2723
|
+
all: e ||= /* @__PURE__ */ new Map(),
|
|
2724
|
+
on: function(n, r) {
|
|
2725
|
+
var i = e.get(n);
|
|
2726
|
+
i ? i.push(r) : e.set(n, [r]);
|
|
2727
|
+
},
|
|
2728
|
+
off: function(n, r) {
|
|
2729
|
+
var i = e.get(n);
|
|
2730
|
+
i && (r ? i.splice(i.indexOf(r) >>> 0, 1) : e.set(n, []));
|
|
2731
|
+
},
|
|
2732
|
+
emit: function(n, r) {
|
|
2733
|
+
var i = e.get(n);
|
|
2734
|
+
i && i.slice().map(function(e) {
|
|
2735
|
+
e(r);
|
|
2736
|
+
}), (i = e.get("*")) && i.slice().map(function(e) {
|
|
2737
|
+
e(n, r);
|
|
2738
|
+
});
|
|
2739
|
+
}
|
|
2740
|
+
};
|
|
2741
|
+
}
|
|
2742
|
+
var eventBus_exports = /* @__PURE__ */ __export({
|
|
2743
|
+
SharedFunction: () => SharedFunction,
|
|
2744
|
+
eventBus: () => eventBus
|
|
2745
|
+
});
|
|
2746
|
+
const eventBus = useGlobalVar(mitt_default(), "utils/eventBus");
|
|
2747
|
+
var SharedFunction = class {
|
|
2748
|
+
static sharedFunctions = useGlobalVar(/* @__PURE__ */ new Map(), "utils/SharedFunction/sharedFunctions");
|
|
2749
|
+
static define(e, n, r) {
|
|
2750
|
+
return console.log("[SharedFunction.define] defined new function", n, ":", r, "->", e), this.sharedFunctions.set(r, uniqBy([...this.sharedFunctions.get(r) ?? [], {
|
|
2751
|
+
fn: e,
|
|
2752
|
+
plugin: n
|
|
2753
|
+
}], (e) => e.plugin)), e;
|
|
2754
|
+
}
|
|
2755
|
+
static call(e, ...n) {
|
|
2756
|
+
return this.sharedFunctions.get(e)?.map((e) => ({
|
|
2757
|
+
result: e.fn(...n),
|
|
2758
|
+
...e
|
|
2759
|
+
}));
|
|
2760
|
+
}
|
|
2761
|
+
static callRandom(e, ...n) {
|
|
2762
|
+
let r = this.sharedFunctions.get(e) ?? [], i = random(0, r.length - 1), a = r[i];
|
|
2763
|
+
if (!a) throw Error(`[SharedFunction.callRandom] call ${e}, but not resigner any function.`);
|
|
2764
|
+
return console.log(`[SharedFunction.callRandom] call index: ${i} in ${r.length}`, a), {
|
|
2765
|
+
result: a.fn(...n),
|
|
2766
|
+
...a
|
|
2767
|
+
};
|
|
2768
|
+
}
|
|
2769
|
+
static callWitch(e, n, ...r) {
|
|
2770
|
+
let i = (this.sharedFunctions.get(e) ?? []).find((e) => e.plugin === n);
|
|
2771
|
+
if (!i) throw Error(`[SharedFunction.callWitch] not found plugin function (plugin: ${n}, name: ${e})`);
|
|
2772
|
+
return {
|
|
2773
|
+
result: i.fn(...r),
|
|
2774
|
+
...i
|
|
2775
|
+
};
|
|
2776
|
+
}
|
|
2777
|
+
}, delay_exports = /* @__PURE__ */ __export({ delay: () => delay });
|
|
2778
|
+
const delay = (e) => new Promise((n) => setTimeout(n, e));
|
|
2779
|
+
var request_exports = /* @__PURE__ */ __export({
|
|
2780
|
+
SmartAbortController: () => SmartAbortController,
|
|
2781
|
+
createAxios: () => createAxios,
|
|
2782
|
+
requestErrorResult: () => requestErrorResult,
|
|
2783
|
+
requestType: () => requestType,
|
|
2784
|
+
utilInterceptors: () => utilInterceptors
|
|
2785
|
+
}), SmartAbortController = class {
|
|
2786
|
+
_controller = new AbortController();
|
|
2787
|
+
mitt = mitt_default();
|
|
2788
|
+
get signal() {
|
|
2789
|
+
return this._controller.signal;
|
|
2790
|
+
}
|
|
2791
|
+
abort(e) {
|
|
2792
|
+
this._controller.abort(e), this._controller = new AbortController(), this.mitt.emit("abort");
|
|
2793
|
+
}
|
|
2794
|
+
onAbort(e) {
|
|
2795
|
+
return this.mitt.on("abort", e), () => this.mitt.off("abort", e);
|
|
2796
|
+
}
|
|
2797
|
+
onAbortOnce(e) {
|
|
2798
|
+
let n = async () => {
|
|
2799
|
+
await e(), this.mitt.off("abort", n);
|
|
2800
|
+
};
|
|
2801
|
+
this.mitt.on("abort", n);
|
|
2802
|
+
}
|
|
2803
|
+
};
|
|
2804
|
+
const requestErrorResult = (e, n) => (eventBus.emit(e, n), Promise.reject(n));
|
|
2805
|
+
let requestType;
|
|
2806
|
+
(function(e) {
|
|
2807
|
+
e.isPost = (e) => /post/gi.test(e.config.method ?? ""), e.isPut = (e) => /put/gi.test(e.config.method ?? ""), e.isGet = (e) => /get/gi.test(e.config.method ?? "");
|
|
2808
|
+
})(requestType ||= {});
|
|
2809
|
+
let utilInterceptors;
|
|
2810
|
+
(function(e) {
|
|
2811
|
+
let n = e.checkIsAxiosError = (e) => "__isAxiosError" in e ? e.__isAxiosError : e.__isAxiosError = !isCancel(e) && isAxiosError(e), r = e.useUnreadableRetry = async (e, n = 0) => {
|
|
2812
|
+
try {
|
|
2813
|
+
return (await e()).data;
|
|
2814
|
+
} catch (i) {
|
|
2815
|
+
if (i instanceof Error && i.message.includes("Illegal invocation")) {
|
|
2816
|
+
if (n > 20) throw i;
|
|
2817
|
+
return await r(e, n + 1);
|
|
2818
|
+
}
|
|
2819
|
+
throw i;
|
|
2820
|
+
}
|
|
2821
|
+
}, i = e.useForceRetry = async (e, n = 0) => {
|
|
2822
|
+
try {
|
|
2823
|
+
return (await e()).data;
|
|
2824
|
+
} catch (r) {
|
|
2825
|
+
if (r instanceof Error) {
|
|
2826
|
+
if (n > 20) throw r;
|
|
2827
|
+
return await i(e, n + 1);
|
|
2828
|
+
}
|
|
2829
|
+
throw r;
|
|
2830
|
+
}
|
|
2831
|
+
};
|
|
2832
|
+
e.createAutoRetry = (e, r = 3) => async (i) => {
|
|
2833
|
+
if (!n(i)) return Promise.reject(i);
|
|
2834
|
+
if (!i.config || i.config.disretry || (i.config.__retryCount ?? 0) >= r) throw requestErrorResult("networkError_response", i);
|
|
2835
|
+
return i.config.__retryCount = (i.config.__retryCount ?? 0) + 1, await delay(500 * i.config.__retryCount), e(i.config);
|
|
2836
|
+
}, e.createCheckIsUnauth = (e, r) => async (i) => {
|
|
2837
|
+
if (!n(i)) return Promise.reject(i);
|
|
2838
|
+
if (i?.response?.status === 401) {
|
|
2839
|
+
if (r) {
|
|
2840
|
+
if (!await r()) throw requestErrorResult("networkError_unauth", i);
|
|
2841
|
+
return e(i.config ?? {});
|
|
2842
|
+
} else if (!location.pathname.includes("auth")) throw requestErrorResult("networkError_unauth", i);
|
|
2843
|
+
}
|
|
2844
|
+
return Promise.reject(i);
|
|
2845
|
+
}, e.isClientError = (e) => {
|
|
2846
|
+
if (e?.response?.status?.toString().startsWith("4")) throw requestErrorResult("networkError_response", e);
|
|
2847
|
+
return Promise.reject(e);
|
|
2848
|
+
}, e.passCorsError = (e) => {
|
|
2849
|
+
if (!n(e)) return Promise.reject(e);
|
|
2850
|
+
if (e.code === "ERR_NETWORK" && !e.response) throw requestErrorResult("networkError_request", e);
|
|
2851
|
+
return Promise.reject(e);
|
|
2852
|
+
};
|
|
2853
|
+
})(utilInterceptors ||= {});
|
|
2854
|
+
const createAxios = (e, n = {}, r) => {
|
|
2855
|
+
let i = axios.create(n);
|
|
2856
|
+
return r?.(i), i.interceptors.request.use(async (n) => (n.baseURL = await e(), n)), i.interceptors.response.use(void 0, utilInterceptors.isClientError), i.interceptors.response.use(void 0, utilInterceptors.createAutoRetry(i, 10)), {
|
|
2857
|
+
get: async (e, n = {}) => utilInterceptors.useUnreadableRetry(() => i.get(e, n)),
|
|
2858
|
+
post: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.post(e, n, r)),
|
|
2859
|
+
postForm: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.postForm(e, n, r)),
|
|
2860
|
+
put: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.put(e, n, r)),
|
|
2861
|
+
putForm: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.putForm(e, n, r)),
|
|
2862
|
+
delete: async (e, n = {}) => utilInterceptors.useUnreadableRetry(() => i.delete(e, n)),
|
|
2863
|
+
patch: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.patch(e, n, r)),
|
|
2864
|
+
patchForm: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.patchForm(e, n, r))
|
|
2865
|
+
};
|
|
2866
|
+
};
|
|
2867
|
+
var data_exports = /* @__PURE__ */ __export({
|
|
2868
|
+
PromiseContent: () => PromiseContent,
|
|
2869
|
+
Stream: () => Stream,
|
|
2870
|
+
Struct: () => Struct,
|
|
2871
|
+
callbackToPromise: () => callbackToPromise
|
|
2872
|
+
}), Struct = class {
|
|
2873
|
+
toJSON() {
|
|
2874
|
+
return this.$$raw;
|
|
2875
|
+
}
|
|
2876
|
+
constructor(e) {
|
|
2877
|
+
this.$$raw = e;
|
|
2878
|
+
}
|
|
2879
|
+
}, PromiseContent = class e {
|
|
2880
|
+
static _this;
|
|
2881
|
+
static {
|
|
2882
|
+
this._this = useGlobalVar(this, "data/PromiseContent");
|
|
2883
|
+
}
|
|
2884
|
+
static isPromiseContent(e) {
|
|
2885
|
+
return e instanceof this._this;
|
|
2886
|
+
}
|
|
2887
|
+
static fromPromise(e, n = (e) => e) {
|
|
2888
|
+
let r = new this._this(e, n);
|
|
2889
|
+
return markRaw(r);
|
|
2890
|
+
}
|
|
2891
|
+
constructor(e, n = (e) => e) {
|
|
2892
|
+
this.promise = e, this.processor = n, this.loadPromise(e);
|
|
2893
|
+
}
|
|
2894
|
+
async loadPromise(e) {
|
|
2895
|
+
this.data.value = void 0, this.isLoading.value = !0, this.isError.value = !1, this.errorCause.value = void 0, this.isEmpty.value = !0;
|
|
2896
|
+
try {
|
|
2897
|
+
let n = await e;
|
|
2898
|
+
this.data.value = this.processor(n), this.isLoading.value = !1, this.isError.value = !1, this.isEmpty.value = isEmpty(n);
|
|
2899
|
+
} catch (e) {
|
|
2900
|
+
this.data.value = void 0, this.isError.value = !0, this.errorCause.value = isError(e) ? e : Error(String(e));
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
setProcessor(n) {
|
|
2904
|
+
return e.fromPromise(this.promise, n);
|
|
2905
|
+
}
|
|
2906
|
+
catch(e) {
|
|
2907
|
+
return this.promise.catch(e);
|
|
2908
|
+
}
|
|
2909
|
+
then(e, n) {
|
|
2910
|
+
return this.promise.then(e, n);
|
|
2911
|
+
}
|
|
2912
|
+
finally(e) {
|
|
2913
|
+
return this.promise.finally(e);
|
|
2914
|
+
}
|
|
2915
|
+
data = shallowRef();
|
|
2916
|
+
isLoading = shallowRef(!0);
|
|
2917
|
+
isError = shallowRef(!1);
|
|
2918
|
+
errorCause = shallowRef();
|
|
2919
|
+
isEmpty = shallowRef(!0);
|
|
2920
|
+
static fromAsyncFunction(e) {
|
|
2921
|
+
return (...n) => this.fromPromise((() => e(...n))());
|
|
2922
|
+
}
|
|
2923
|
+
static resolve(e) {
|
|
2924
|
+
let n = this.fromPromise(Promise.resolve(e));
|
|
2925
|
+
return n.isLoading.value = !1, n;
|
|
2926
|
+
}
|
|
2927
|
+
static withResolvers(e = !1) {
|
|
2928
|
+
let n = Promise.withResolvers(), r = new this._this(n.promise);
|
|
2929
|
+
return r.isLoading.value = e, {
|
|
2930
|
+
content: r,
|
|
2931
|
+
reject: (e) => {
|
|
2932
|
+
n.reject(e);
|
|
2933
|
+
},
|
|
2934
|
+
resolve: (e) => {
|
|
2935
|
+
n.resolve(e);
|
|
2936
|
+
},
|
|
2937
|
+
reset(e = !1) {
|
|
2938
|
+
n = Promise.withResolvers(), r.loadPromise(n.promise), r.isLoading.value = e;
|
|
2939
|
+
}
|
|
2940
|
+
};
|
|
2941
|
+
}
|
|
2942
|
+
}, generatorMap = /* @__PURE__ */ new Map(), Stream = class {
|
|
2943
|
+
constructor(e) {
|
|
2944
|
+
this.generator = e(this.abortController.signal, this), generatorMap.set(this, e);
|
|
2945
|
+
}
|
|
2946
|
+
static _this;
|
|
2947
|
+
static {
|
|
2948
|
+
this._this = useGlobalVar(this, "data/Stream");
|
|
2949
|
+
}
|
|
2950
|
+
static isStream(e) {
|
|
2951
|
+
return e instanceof this._this;
|
|
2952
|
+
}
|
|
2953
|
+
static create(e) {
|
|
2954
|
+
let n = new this._this(e);
|
|
2955
|
+
return markRaw(n);
|
|
2956
|
+
}
|
|
2957
|
+
abortController = new SmartAbortController();
|
|
2958
|
+
generator;
|
|
2959
|
+
_setupData = [];
|
|
2960
|
+
setupData(e) {
|
|
2961
|
+
return this._setupData.push(...e), this.data.value.unshift(...e), this;
|
|
2962
|
+
}
|
|
2963
|
+
async next(e = !1) {
|
|
2964
|
+
try {
|
|
2965
|
+
if (e || (await until(this.isRequesting).toBe(!1), this.isRequesting.value = !0), this._isDone) return e || (this.isRequesting.value = !1), {
|
|
2966
|
+
done: !0,
|
|
2967
|
+
value: void 0
|
|
2968
|
+
};
|
|
2969
|
+
e && console.log("igRequesting next");
|
|
2970
|
+
let { value: n, done: r } = await this.generator.next(this);
|
|
2971
|
+
return this.isDone.value = r ?? !1, e || (this.isRequesting.value = !1), r ? {
|
|
2972
|
+
done: !0,
|
|
2973
|
+
value: void 0
|
|
2974
|
+
} : (this.data.value.push(...n), {
|
|
2975
|
+
value: n,
|
|
2976
|
+
done: r
|
|
2977
|
+
});
|
|
2978
|
+
} catch (n) {
|
|
2979
|
+
throw e || (this.isRequesting.value = !1), this.error.value = n, n;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
async return() {
|
|
2983
|
+
return await this.generator.return?.() ?? {
|
|
2984
|
+
value: void 0,
|
|
2985
|
+
done: !0
|
|
2986
|
+
};
|
|
2987
|
+
}
|
|
2988
|
+
async throw(e) {
|
|
2989
|
+
return await this.generator.throw?.(e) ?? {
|
|
2990
|
+
value: void 0,
|
|
2991
|
+
done: !0
|
|
2992
|
+
};
|
|
2993
|
+
}
|
|
2994
|
+
reset() {
|
|
2995
|
+
this.generator = generatorMap.get(this)(this.abortController.signal, this), this.total.value = NaN, this.page.value = 0, this.pageSize.value = NaN, this.data.value = this._setupData, this.isDone.value = !1, this.isRequesting.value = !1, this.error.value = void 0;
|
|
2996
|
+
}
|
|
2997
|
+
async retry() {
|
|
2998
|
+
return this.page.value--, this.next();
|
|
2999
|
+
}
|
|
3000
|
+
async nextToDone() {
|
|
3001
|
+
isNaN(this._pages) && await this.next(!0);
|
|
3002
|
+
let e = [];
|
|
3003
|
+
for (let n = this._page + 1; n <= this._pages; n++) e.push(this.next(!0));
|
|
3004
|
+
return await Promise.all(e), this._data;
|
|
3005
|
+
}
|
|
3006
|
+
stop() {
|
|
3007
|
+
this.abortController.abort(), this.isRequesting.value = !1;
|
|
3008
|
+
}
|
|
3009
|
+
[Symbol.asyncIterator]() {
|
|
3010
|
+
return this;
|
|
3011
|
+
}
|
|
3012
|
+
error = shallowRef();
|
|
3013
|
+
data = ref([]);
|
|
3014
|
+
get _data() {
|
|
3015
|
+
return this.data.value;
|
|
3016
|
+
}
|
|
3017
|
+
page = shallowRef(0);
|
|
3018
|
+
get _page() {
|
|
3019
|
+
return this.page.value;
|
|
3020
|
+
}
|
|
3021
|
+
pages = shallowRef(NaN);
|
|
3022
|
+
get _pages() {
|
|
3023
|
+
return this.pages.value;
|
|
3024
|
+
}
|
|
3025
|
+
total = shallowRef(NaN);
|
|
3026
|
+
get _total() {
|
|
3027
|
+
return this.total.value;
|
|
3028
|
+
}
|
|
3029
|
+
pageSize = shallowRef(NaN);
|
|
3030
|
+
get _pageSize() {
|
|
3031
|
+
return this.pageSize.value;
|
|
3032
|
+
}
|
|
3033
|
+
length = computed(() => this.data.value.length);
|
|
3034
|
+
get _length() {
|
|
3035
|
+
return this.data.value.length;
|
|
3036
|
+
}
|
|
3037
|
+
isRequesting = shallowRef(!1);
|
|
3038
|
+
get _isRequesting() {
|
|
3039
|
+
return this.isRequesting.value;
|
|
3040
|
+
}
|
|
3041
|
+
isDone = shallowRef(!1);
|
|
3042
|
+
get _isDone() {
|
|
3043
|
+
return this.isDone.value;
|
|
3044
|
+
}
|
|
3045
|
+
isNoData = computed(() => this.isDone.value && this.isEmpty.value);
|
|
3046
|
+
get _isNoData() {
|
|
3047
|
+
return this.isNoData.value;
|
|
3048
|
+
}
|
|
3049
|
+
isEmpty = computed(() => this.length.value === 0);
|
|
3050
|
+
get _isEmpty() {
|
|
3051
|
+
return this.isEmpty.value;
|
|
3052
|
+
}
|
|
3053
|
+
};
|
|
3054
|
+
const callbackToPromise = (e) => {
|
|
3055
|
+
let { resolve: n, promise: r } = Promise.withResolvers();
|
|
3056
|
+
return e(n), r;
|
|
3057
|
+
};
|
|
3058
|
+
var _hoisted_1$6 = {
|
|
3059
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3060
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
3061
|
+
viewBox: "0 0 1024 1024"
|
|
3062
|
+
}, ReloadOutlined_default = defineComponent({
|
|
3063
|
+
name: "ReloadOutlined",
|
|
3064
|
+
render: function(e, n) {
|
|
3065
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$6, n[0] ||= [createElementVNode("path", {
|
|
3066
|
+
d: "M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92C290 92 102.3 279.5 102 511.5C101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1c1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 0 0-10.1 4.8c-1.8 5-3.8 10-5.9 14.9c-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 0 1 655.9 829c-42.3 17.9-87.4 27-133.8 27c-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 0 1 279 755.2a342.16 342.16 0 0 1-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4c31.6-31.6 68.4-56.4 109.3-73.8c42.3-17.9 87.4-27 133.8-27c46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 0 1 109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z",
|
|
3067
|
+
fill: "currentColor"
|
|
3068
|
+
}, null, -1)]);
|
|
3069
|
+
}
|
|
3070
|
+
}), _hoisted_1$5 = {
|
|
3071
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3072
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
3073
|
+
viewBox: "0 0 24 24"
|
|
3074
|
+
}, MoreVertRound_default = defineComponent({
|
|
3075
|
+
name: "MoreVertRound",
|
|
3076
|
+
render: function(e, n) {
|
|
3077
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$5, n[0] ||= [createElementVNode("path", {
|
|
3078
|
+
d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",
|
|
3079
|
+
fill: "currentColor"
|
|
3080
|
+
}, null, -1)]);
|
|
3081
|
+
}
|
|
3082
|
+
}), _hoisted_1$4 = {
|
|
3083
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3084
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
3085
|
+
viewBox: "0 0 24 24"
|
|
3086
|
+
}, WifiTetheringErrorRound_default = defineComponent({
|
|
3087
|
+
name: "WifiTetheringErrorRound",
|
|
3088
|
+
render: function(e, n) {
|
|
3089
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, n[0] ||= [createElementVNode("path", {
|
|
3090
|
+
d: "M10.66 7.14c-2.24.48-4.04 2.3-4.52 4.54c-.37 1.75.02 3.38.89 4.66c.34.51 1.08.55 1.51.11c.35-.35.37-.88.1-1.28c-.5-.76-.75-1.71-.61-2.73c.23-1.74 1.67-3.17 3.41-3.4A4.003 4.003 0 0 1 16 13c0 .8-.24 1.54-.64 2.16c-.27.41-.25.95.1 1.29c.43.43 1.17.4 1.51-.11C17.62 15.4 18 14.25 18 13c0-3.75-3.45-6.7-7.34-5.86zm-.41-3.99c-4.05.69-7.19 3.69-8.03 7.72c-.66 3.17.2 6.16 1.97 8.38c.37.46 1.07.49 1.49.07c.36-.36.39-.93.07-1.32a8.004 8.004 0 0 1-1.66-6.28c.55-3.47 3.42-6.24 6.92-6.65c2.76-.33 5.27.74 6.93 2.59c.2.21.47.34.76.34c.85 0 1.34-1.01.77-1.65c-2.19-2.45-5.56-3.82-9.22-3.2zM12 11c-1.1 0-2 .9-2 2c0 .55.23 1.05.59 1.41c.36.36.86.59 1.41.59s1.05-.23 1.41-.59c.36-.36.59-.86.59-1.41c0-1.1-.9-2-2-2zm9-1c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1v-4c0-.55.45-1 1-1zm0 8c.55 0 1 .45 1 1s-.45 1-1 1s-1-.45-1-1s.45-1 1-1z",
|
|
3091
|
+
fill: "currentColor"
|
|
3092
|
+
}, null, -1)]);
|
|
3093
|
+
}
|
|
3094
|
+
}), _hoisted_1$3 = { class: "relative size-full overflow-hidden" }, _hoisted_2$1 = { key: 2 }, _hoisted_3$1 = { key: 3 }, _hoisted_4$1 = {
|
|
3095
|
+
key: 4,
|
|
3096
|
+
class: "flex items-center gap-3 justify-around"
|
|
3097
|
+
}, _hoisted_5$1 = { class: "flex gap-2 flex-col justify-center text-white" }, _hoisted_6$1 = { class: "text-xs text-wrap" }, content_default = /* @__PURE__ */ defineComponent({
|
|
3098
|
+
__name: "content",
|
|
3099
|
+
props: {
|
|
3100
|
+
retriable: { type: Boolean },
|
|
3101
|
+
hideError: { type: Boolean },
|
|
3102
|
+
hideEmpty: { type: Boolean },
|
|
3103
|
+
hideLoading: { type: Boolean },
|
|
3104
|
+
source: {},
|
|
3105
|
+
class: {},
|
|
3106
|
+
classError: {},
|
|
3107
|
+
classEmpty: {},
|
|
3108
|
+
classLoading: {},
|
|
3109
|
+
style: { type: [
|
|
3110
|
+
Boolean,
|
|
3111
|
+
null,
|
|
3112
|
+
String,
|
|
3113
|
+
Object,
|
|
3114
|
+
Array
|
|
3115
|
+
] },
|
|
3116
|
+
styleError: { type: [
|
|
3117
|
+
Boolean,
|
|
3118
|
+
null,
|
|
3119
|
+
String,
|
|
3120
|
+
Object,
|
|
3121
|
+
Array
|
|
3122
|
+
] },
|
|
3123
|
+
styleEmpty: { type: [
|
|
3124
|
+
Boolean,
|
|
3125
|
+
null,
|
|
3126
|
+
String,
|
|
3127
|
+
Object,
|
|
3128
|
+
Array
|
|
3129
|
+
] },
|
|
3130
|
+
styleLoading: { type: [
|
|
3131
|
+
Boolean,
|
|
3132
|
+
null,
|
|
3133
|
+
String,
|
|
3134
|
+
Object,
|
|
3135
|
+
Array
|
|
3136
|
+
] }
|
|
3137
|
+
},
|
|
3138
|
+
emits: ["retry", "resetRetry"],
|
|
3139
|
+
setup(e, { expose: n }) {
|
|
3140
|
+
let d = e, f = computed(() => Stream.isStream(d.source) ? {
|
|
3141
|
+
isLoading: d.source.isRequesting.value,
|
|
3142
|
+
isError: d.source.error.value,
|
|
3143
|
+
errorCause: d.source.error.value?.message,
|
|
3144
|
+
isEmpty: d.source.isEmpty.value,
|
|
3145
|
+
data: d.source.data.value,
|
|
3146
|
+
isNoResult: d.source.isNoData.value
|
|
3147
|
+
} : PromiseContent.isPromiseContent(d.source) ? {
|
|
3148
|
+
isLoading: d.source.isLoading.value,
|
|
3149
|
+
isError: d.source.isError.value,
|
|
3150
|
+
errorCause: d.source.errorCause.value?.message,
|
|
3151
|
+
isEmpty: d.source.isEmpty.value,
|
|
3152
|
+
data: d.source.data.value,
|
|
3153
|
+
isNoResult: d.source.isEmpty.value
|
|
3154
|
+
} : {
|
|
3155
|
+
isLoading: !1,
|
|
3156
|
+
isError: !1,
|
|
3157
|
+
errorCause: void 0,
|
|
3158
|
+
isEmpty: isEmpty(d.source),
|
|
3159
|
+
data: d.source,
|
|
3160
|
+
isNoResult: isEmpty(d.source)
|
|
3161
|
+
}), p = useThemeVars(), m = {
|
|
3162
|
+
isLoadingNoData: {
|
|
3163
|
+
opacity: 1,
|
|
3164
|
+
translateY: 0,
|
|
3165
|
+
width: "2.5rem",
|
|
3166
|
+
height: "2.5rem",
|
|
3167
|
+
paddingBlock: "2px",
|
|
3168
|
+
paddingInline: "2px",
|
|
3169
|
+
left: "50%",
|
|
3170
|
+
top: "8px",
|
|
3171
|
+
translateX: "-50%",
|
|
3172
|
+
backgroundColor: "#ffffff"
|
|
3173
|
+
},
|
|
3174
|
+
isErrorNoData: {
|
|
3175
|
+
opacity: 1,
|
|
3176
|
+
translateY: "-50%",
|
|
3177
|
+
width: "70%",
|
|
3178
|
+
height: d.retriable ? "22rem" : "20rem",
|
|
3179
|
+
paddingBlock: "2px",
|
|
3180
|
+
paddingInline: "2px",
|
|
3181
|
+
left: "50%",
|
|
3182
|
+
top: "50%",
|
|
3183
|
+
translateX: "-50%",
|
|
3184
|
+
backgroundColor: "#ffffff",
|
|
3185
|
+
borderRadius: "4px"
|
|
3186
|
+
},
|
|
3187
|
+
isLoadingData: {
|
|
3188
|
+
opacity: .7,
|
|
3189
|
+
translateY: "0%",
|
|
3190
|
+
width: "4rem",
|
|
3191
|
+
height: "1.3rem",
|
|
3192
|
+
paddingBlock: "2px",
|
|
3193
|
+
paddingInline: "8px",
|
|
3194
|
+
left: "4px",
|
|
3195
|
+
top: "calc(100% - 8px - 1rem)",
|
|
3196
|
+
translateX: "0%",
|
|
3197
|
+
backgroundColor: p.value.primaryColor,
|
|
3198
|
+
borderRadius: "1.3rem"
|
|
3199
|
+
},
|
|
3200
|
+
isErrorData: {
|
|
3201
|
+
opacity: .7,
|
|
3202
|
+
translateY: "0%",
|
|
3203
|
+
width: "fit-content",
|
|
3204
|
+
height: "4rem",
|
|
3205
|
+
paddingBlock: "2px",
|
|
3206
|
+
paddingInline: "8px",
|
|
3207
|
+
left: "4px",
|
|
3208
|
+
top: "calc(100% - 8px - 4rem)",
|
|
3209
|
+
translateX: "0%",
|
|
3210
|
+
backgroundColor: p.value.primaryColor,
|
|
3211
|
+
borderRadius: "4px"
|
|
3212
|
+
},
|
|
3213
|
+
isEmpty: {
|
|
3214
|
+
opacity: 1,
|
|
3215
|
+
translateY: "-50%",
|
|
3216
|
+
width: "90%",
|
|
3217
|
+
height: "10rem",
|
|
3218
|
+
paddingBlock: "2px",
|
|
3219
|
+
paddingInline: "2px",
|
|
3220
|
+
left: "50%",
|
|
3221
|
+
top: "50%",
|
|
3222
|
+
translateX: "-50%",
|
|
3223
|
+
backgroundColor: "#ffffff",
|
|
3224
|
+
borderRadius: "4px"
|
|
3225
|
+
},
|
|
3226
|
+
done: {
|
|
3227
|
+
width: "4rem",
|
|
3228
|
+
height: "1.3rem",
|
|
3229
|
+
opacity: 0,
|
|
3230
|
+
translateY: "100%",
|
|
3231
|
+
paddingBlock: "0px",
|
|
3232
|
+
paddingInline: "0px",
|
|
3233
|
+
left: "4px",
|
|
3234
|
+
top: "calc(100% - 8px - 1rem)",
|
|
3235
|
+
translateX: "0%",
|
|
3236
|
+
backgroundColor: p.value.primaryColor,
|
|
3237
|
+
borderRadius: "4px"
|
|
3238
|
+
}
|
|
3239
|
+
}, h = computed(() => !d.hideLoading && f.value.isLoading ? f.value.isEmpty ? "isLoadingNoData" : "isLoadingData" : !d.hideError && f.value.isError ? f.value.isEmpty ? "isErrorNoData" : "isErrorData" : !d.hideEmpty && f.value.isNoResult ? "isEmpty" : "done"), g = useTemplateRef("cont");
|
|
3240
|
+
return n({ cont: g }), (e, n) => {
|
|
3241
|
+
let i = Loading, p = NEmpty, v = NButton, y = NIcon, b = NResult, S = AnimatePresence;
|
|
3242
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [createElementVNode("div", {
|
|
3243
|
+
class: normalizeClass(["relative size-full", [d.class]]),
|
|
3244
|
+
ref_key: "cont",
|
|
3245
|
+
ref: g
|
|
3246
|
+
}, [f.value.isEmpty ? createCommentVNode("", !0) : renderSlot(e.$slots, "default", {
|
|
3247
|
+
key: 0,
|
|
3248
|
+
data: f.value.data
|
|
3249
|
+
})], 2), createVNode(S, null, {
|
|
3250
|
+
default: withCtx(() => [createVNode(unref(motion).div, {
|
|
3251
|
+
initial: {
|
|
3252
|
+
opacity: 0,
|
|
3253
|
+
translateY: "-100%",
|
|
3254
|
+
left: "50%",
|
|
3255
|
+
translateX: "-50%"
|
|
3256
|
+
},
|
|
3257
|
+
variants: m,
|
|
3258
|
+
animate: h.value,
|
|
3259
|
+
class: "rounded-full shadow flex justify-center items-center scale-100 absolute whitespace-nowrap"
|
|
3260
|
+
}, {
|
|
3261
|
+
default: withCtx(() => [createVNode(Transition, { name: "van-fade" }, {
|
|
3262
|
+
default: withCtx(() => [h.value === "isLoadingNoData" ? (openBlock(), createBlock(i, {
|
|
3263
|
+
key: 0,
|
|
3264
|
+
size: "25px",
|
|
3265
|
+
color: "var(--p-color)"
|
|
3266
|
+
})) : h.value === "isLoadingData" ? (openBlock(), createBlock(loading_default, {
|
|
3267
|
+
key: 1,
|
|
3268
|
+
size: "10px",
|
|
3269
|
+
color: "white"
|
|
3270
|
+
}, {
|
|
3271
|
+
default: withCtx(() => [...n[2] ||= [createTextVNode("加载中", -1)]]),
|
|
3272
|
+
_: 1
|
|
3273
|
+
})) : h.value === "isEmpty" ? (openBlock(), createElementBlock("div", _hoisted_2$1, [createVNode(p, {
|
|
3274
|
+
description: "无结果",
|
|
3275
|
+
class: normalizeClass(["w-full !justify-center", [e.classEmpty]]),
|
|
3276
|
+
style: normalizeStyle([e.style, e.styleEmpty])
|
|
3277
|
+
}, null, 8, ["class", "style"])])) : h.value === "isErrorNoData" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [createVNode(b, {
|
|
3278
|
+
class: normalizeClass(["!items-center !justify-center flex flex-col !size-full", [e.classError]]),
|
|
3279
|
+
status: "error",
|
|
3280
|
+
title: "网络错误",
|
|
3281
|
+
style: normalizeStyle([e.style, e.styleError]),
|
|
3282
|
+
description: f.value.errorCause ?? "未知原因"
|
|
3283
|
+
}, {
|
|
3284
|
+
footer: withCtx(() => [e.retriable ? (openBlock(), createBlock(v, {
|
|
3285
|
+
key: 0,
|
|
3286
|
+
onClick: n[0] ||= (n) => e.$emit("resetRetry"),
|
|
3287
|
+
type: "primary"
|
|
3288
|
+
}, {
|
|
3289
|
+
default: withCtx(() => [...n[3] ||= [createTextVNode("重试", -1)]]),
|
|
3290
|
+
_: 1
|
|
3291
|
+
})) : createCommentVNode("", !0)]),
|
|
3292
|
+
icon: withCtx(() => [createVNode(y, {
|
|
3293
|
+
size: "10rem",
|
|
3294
|
+
color: "var(--nui-error-color)"
|
|
3295
|
+
}, {
|
|
3296
|
+
default: withCtx(() => [createVNode(unref(WifiTetheringErrorRound_default))]),
|
|
3297
|
+
_: 1
|
|
3298
|
+
})]),
|
|
3299
|
+
_: 1
|
|
3300
|
+
}, 8, [
|
|
3301
|
+
"class",
|
|
3302
|
+
"style",
|
|
3303
|
+
"description"
|
|
3304
|
+
])])) : h.value === "isErrorData" ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
3305
|
+
createVNode(y, {
|
|
3306
|
+
size: "3rem",
|
|
3307
|
+
color: "white"
|
|
3308
|
+
}, {
|
|
3309
|
+
default: withCtx(() => [createVNode(unref(WifiTetheringErrorRound_default))]),
|
|
3310
|
+
_: 1
|
|
3311
|
+
}),
|
|
3312
|
+
createElementVNode("div", _hoisted_5$1, [n[4] ||= createElementVNode("div", { class: "text-sm" }, "网络错误", -1), createElementVNode("div", _hoisted_6$1, toDisplayString(f.value.errorCause ?? "未知原因"), 1)]),
|
|
3313
|
+
createVNode(v, {
|
|
3314
|
+
circle: "",
|
|
3315
|
+
type: "error",
|
|
3316
|
+
size: "large",
|
|
3317
|
+
onClick: n[1] ||= (n) => e.$emit("retry")
|
|
3318
|
+
}, {
|
|
3319
|
+
icon: withCtx(() => [createVNode(y, { color: "white" }, {
|
|
3320
|
+
default: withCtx(() => [createVNode(unref(ReloadOutlined_default))]),
|
|
3321
|
+
_: 1
|
|
3322
|
+
})]),
|
|
3323
|
+
_: 1
|
|
3324
|
+
})
|
|
3325
|
+
])) : createCommentVNode("", !0)]),
|
|
3326
|
+
_: 1
|
|
3327
|
+
})]),
|
|
3328
|
+
_: 1
|
|
3329
|
+
}, 8, ["animate"])]),
|
|
3330
|
+
_: 1
|
|
3331
|
+
})]);
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
}), var_default = /* @__PURE__ */ defineComponent({
|
|
3335
|
+
__name: "var",
|
|
3336
|
+
props: { value: {} },
|
|
3337
|
+
setup(e) {
|
|
3338
|
+
let n = e;
|
|
3339
|
+
return (e, r) => renderSlot(e.$slots, "default", { value: n.value });
|
|
3340
|
+
}
|
|
3341
|
+
}), list_default = /* @__PURE__ */ defineComponent({
|
|
3342
|
+
__name: "list",
|
|
3343
|
+
props: {
|
|
3344
|
+
source: {},
|
|
3345
|
+
itemHeight: {},
|
|
3346
|
+
listProp: {},
|
|
3347
|
+
goBottom: { type: Boolean },
|
|
3348
|
+
itemResizable: { type: Boolean },
|
|
3349
|
+
dataProcessor: {},
|
|
3350
|
+
style: { type: [
|
|
3351
|
+
Boolean,
|
|
3352
|
+
null,
|
|
3353
|
+
String,
|
|
3354
|
+
Object,
|
|
3355
|
+
Array
|
|
3356
|
+
] },
|
|
3357
|
+
class: {}
|
|
3358
|
+
},
|
|
3359
|
+
emits: [
|
|
3360
|
+
"next",
|
|
3361
|
+
"reset",
|
|
3362
|
+
"retry"
|
|
3363
|
+
],
|
|
3364
|
+
setup(e, { expose: n, emit: r }) {
|
|
3365
|
+
let o = e, s = r, c = (e) => o.dataProcessor?.(e) ?? e, l = computed(() => ({
|
|
3366
|
+
...Stream.isStream(o.source) ? {
|
|
3367
|
+
data: c(o.source.data.value),
|
|
3368
|
+
isDone: o.source.isDone.value,
|
|
3369
|
+
isRequesting: o.source.isRequesting.value,
|
|
3370
|
+
isError: !!o.source.error.value,
|
|
3371
|
+
length: c(o.source.data.value).length,
|
|
3372
|
+
isEmpty: o.source.isEmpty.value,
|
|
3373
|
+
source: o.source
|
|
3374
|
+
} : isArray(o.source) ? {
|
|
3375
|
+
data: c(o.source),
|
|
3376
|
+
isDone: !0,
|
|
3377
|
+
isRequesting: !1,
|
|
3378
|
+
isError: !1,
|
|
3379
|
+
length: c(o.source).length,
|
|
3380
|
+
isEmpty: isEmpty(o.source),
|
|
3381
|
+
source: o.source
|
|
3382
|
+
} : {
|
|
3383
|
+
data: c(o.source.data.data.value ?? []),
|
|
3384
|
+
isDone: o.source.isEnd,
|
|
3385
|
+
isRequesting: o.source.data.isLoading.value,
|
|
3386
|
+
isError: o.source.data.isError.value,
|
|
3387
|
+
length: c(o.source.data.data.value ?? []).length,
|
|
3388
|
+
isEmpty: o.source.data.isEmpty.value,
|
|
3389
|
+
source: o.source.data
|
|
3390
|
+
},
|
|
3391
|
+
next: () => Stream.isStream(o.source) ? o.source.next() : callbackToPromise((e) => s("next", e)),
|
|
3392
|
+
retry: () => Stream.isStream(o.source) ? o.source.retry() : callbackToPromise((e) => s("retry", e)),
|
|
3393
|
+
reset: () => Stream.isStream(o.source) ? o.source.reset() : s("reset")
|
|
3394
|
+
}));
|
|
3395
|
+
watch(() => l.value.data, () => {
|
|
3396
|
+
o.goBottom && d.value?.scrollTo({
|
|
3397
|
+
position: "bottom",
|
|
3398
|
+
behavior: "instant"
|
|
3399
|
+
});
|
|
3400
|
+
}, {
|
|
3401
|
+
flush: "post",
|
|
3402
|
+
deep: !0,
|
|
3403
|
+
immediate: !0
|
|
3404
|
+
}), watch(l, (e) => {
|
|
3405
|
+
e.isRequesting || ceil(window.innerHeight / o.itemHeight) + 2 > e.length && !e.isDone && (e.isError ? e.retry() : e.next());
|
|
3406
|
+
}, { immediate: !0 });
|
|
3407
|
+
let d = useTemplateRef("vList"), { y: f } = useScroll(() => d.value?.getScrollContainer()), p = debounce(async () => {
|
|
3408
|
+
let e = d.value?.virtualListInstRef?.itemsElRef?.querySelector(" .v-vl-visible-items");
|
|
3409
|
+
if (!e) return;
|
|
3410
|
+
let { itemHeight: n } = o, { data: r, isDone: i, isError: a, isRequesting: s, retry: c, next: u, length: p } = l.value;
|
|
3411
|
+
r && !s && !i && n * (p - 2) < f.value + (e?.children?.length ?? window.innerHeight / n) * n && (a ? c() : u());
|
|
3412
|
+
}, 200), m = shallowRef(!1), h = shallowRef(!1), g = async () => {
|
|
3413
|
+
await l.value.retry(), h.value = !1;
|
|
3414
|
+
};
|
|
3415
|
+
return n({
|
|
3416
|
+
scrollTop: f,
|
|
3417
|
+
listInstance: d
|
|
3418
|
+
}), (e, n) => {
|
|
3419
|
+
let r = NVirtualList, i = PullRefresh;
|
|
3420
|
+
return openBlock(), createBlock(i, {
|
|
3421
|
+
modelValue: h.value,
|
|
3422
|
+
"onUpdate:modelValue": n[0] ||= (e) => h.value = e,
|
|
3423
|
+
class: normalizeClass(["relative", o.class]),
|
|
3424
|
+
onRefresh: g,
|
|
3425
|
+
disabled: (unref(Stream).isStream(e.source) ? !1 : unref(isArray)(e.source) ? !0 : e.source.reloadable ?? !0) || l.value.isError || l.value.isRequesting || !!unref(f) && !m.value,
|
|
3426
|
+
onChange: n[1] ||= ({ distance: e }) => m.value = !!e,
|
|
3427
|
+
style: normalizeStyle(e.style)
|
|
3428
|
+
}, {
|
|
3429
|
+
default: withCtx(() => [createVNode(content_default, {
|
|
3430
|
+
retriable: "",
|
|
3431
|
+
source: unref(Stream).isStream(e.source) || unref(isArray)(e.source) ? e.source : e.source.data,
|
|
3432
|
+
"class-loading": "mt-2 !h-[24px]",
|
|
3433
|
+
"class-empty": "!h-full",
|
|
3434
|
+
"class-error": "!h-full",
|
|
3435
|
+
onRetry: g,
|
|
3436
|
+
"hide-loading": m.value && l.value.isRequesting
|
|
3437
|
+
}, {
|
|
3438
|
+
default: withCtx(() => [createVNode(var_default, { value: l.value.data }, {
|
|
3439
|
+
default: withCtx(({ value: n }) => [createVNode(r, mergeProps(e.listProp ?? {}, {
|
|
3440
|
+
"item-resizable": e.itemResizable,
|
|
3441
|
+
"item-size": e.itemHeight,
|
|
3442
|
+
onScroll: unref(p),
|
|
3443
|
+
class: ["overflow-x-hidden h-full", [m.value ? "overflow-y-hidden" : "overflow-y-auto"]],
|
|
3444
|
+
items: n,
|
|
3445
|
+
ref_key: "vList",
|
|
3446
|
+
ref: d
|
|
3447
|
+
}), {
|
|
3448
|
+
default: withCtx(({ item: r }) => [renderSlot(e.$slots, "default", {
|
|
3449
|
+
height: e.itemHeight,
|
|
3450
|
+
data: {
|
|
3451
|
+
item: r,
|
|
3452
|
+
index: n.indexOf(r)
|
|
3453
|
+
}
|
|
3454
|
+
})]),
|
|
3455
|
+
_: 2
|
|
3456
|
+
}, 1040, [
|
|
3457
|
+
"item-resizable",
|
|
3458
|
+
"item-size",
|
|
3459
|
+
"onScroll",
|
|
3460
|
+
"items",
|
|
3461
|
+
"class"
|
|
3462
|
+
])]),
|
|
3463
|
+
_: 3
|
|
3464
|
+
}, 8, ["value"])]),
|
|
3465
|
+
_: 3
|
|
3466
|
+
}, 8, ["source", "hide-loading"])]),
|
|
3467
|
+
_: 3
|
|
3468
|
+
}, 8, [
|
|
3469
|
+
"modelValue",
|
|
3470
|
+
"class",
|
|
3471
|
+
"disabled",
|
|
3472
|
+
"style"
|
|
3473
|
+
]);
|
|
3474
|
+
};
|
|
3475
|
+
}
|
|
3476
|
+
}), popup_default = /* @__PURE__ */ defineComponent({
|
|
3477
|
+
__name: "popup",
|
|
3478
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3479
|
+
show: { type: Boolean },
|
|
3480
|
+
zIndex: {},
|
|
3481
|
+
overlay: { type: Boolean },
|
|
3482
|
+
duration: {},
|
|
3483
|
+
teleport: {},
|
|
3484
|
+
lockScroll: { type: Boolean },
|
|
3485
|
+
lazyRender: { type: Boolean },
|
|
3486
|
+
beforeClose: {},
|
|
3487
|
+
overlayProps: {},
|
|
3488
|
+
overlayStyle: {},
|
|
3489
|
+
overlayClass: {},
|
|
3490
|
+
transitionAppear: { type: Boolean },
|
|
3491
|
+
closeOnClickOverlay: { type: Boolean },
|
|
3492
|
+
round: { type: Boolean },
|
|
3493
|
+
position: { default: "center" },
|
|
3494
|
+
closeIcon: {},
|
|
3495
|
+
closeable: { type: Boolean },
|
|
3496
|
+
transition: {},
|
|
3497
|
+
iconPrefix: {},
|
|
3498
|
+
closeOnPopstate: { type: Boolean },
|
|
3499
|
+
closeIconPosition: {},
|
|
3500
|
+
destroyOnClose: { type: Boolean },
|
|
3501
|
+
safeAreaInsetTop: { type: Boolean },
|
|
3502
|
+
safeAreaInsetBottom: { type: Boolean },
|
|
3503
|
+
noBorder: {
|
|
3504
|
+
type: Boolean,
|
|
3505
|
+
default: !1
|
|
3506
|
+
},
|
|
3507
|
+
useTrulyShow: { type: Boolean },
|
|
3508
|
+
style: { type: [
|
|
3509
|
+
Boolean,
|
|
3510
|
+
null,
|
|
3511
|
+
String,
|
|
3512
|
+
Object,
|
|
3513
|
+
Array
|
|
3514
|
+
] }
|
|
3515
|
+
}, {
|
|
3516
|
+
show: {
|
|
3517
|
+
type: Boolean,
|
|
3518
|
+
required: !0
|
|
3519
|
+
},
|
|
3520
|
+
showModifiers: {}
|
|
3521
|
+
}),
|
|
3522
|
+
emits: /* @__PURE__ */ mergeModels(["closed"], ["update:show"]),
|
|
3523
|
+
setup(e, { expose: n }) {
|
|
3524
|
+
let r = window.$router, s = e, c = useModel(e, "show"), l = shallowRef(c.value), [u, d] = useZIndex(computed(() => s.useTrulyShow ? l.value : c.value)), f = noop;
|
|
3525
|
+
return watch(c, (e) => {
|
|
3526
|
+
e ? f = r.beforeEach(() => {
|
|
3527
|
+
if (console.log("popup:\n", "isLast:", d.value, "show:", c.value), d.value) return c.value ? c.value = !1 : void 0;
|
|
3528
|
+
}) : f();
|
|
3529
|
+
}, { immediate: !0 }), n({
|
|
3530
|
+
zIndex: u,
|
|
3531
|
+
trulyShow: l
|
|
3532
|
+
}), (e, n) => {
|
|
3533
|
+
let r = Popup;
|
|
3534
|
+
return openBlock(), createBlock(r, mergeProps(s, {
|
|
3535
|
+
show: c.value,
|
|
3536
|
+
"onUpdate:show": n[0] ||= (e) => c.value = e,
|
|
3537
|
+
"z-index": unref(u),
|
|
3538
|
+
teleport: "#popups",
|
|
3539
|
+
onOpen: n[1] ||= (e) => l.value = !0,
|
|
3540
|
+
onClosed: n[2] ||= () => {
|
|
3541
|
+
l.value = !1, e.$emit("closed");
|
|
3542
|
+
},
|
|
3543
|
+
class: ["max-h-screen !overflow-y-auto overflow-hidden", !e.noBorder && "border-0 border-t border-solid border-(--van-border-color)"],
|
|
3544
|
+
overlay: "",
|
|
3545
|
+
"close-on-click-overlay": ""
|
|
3546
|
+
}), {
|
|
3547
|
+
default: withCtx(() => [l.value ? renderSlot(e.$slots, "default", { key: 0 }) : createCommentVNode("", !0)]),
|
|
3548
|
+
_: 3
|
|
3549
|
+
}, 16, [
|
|
3550
|
+
"show",
|
|
3551
|
+
"z-index",
|
|
3552
|
+
"class"
|
|
3553
|
+
]);
|
|
3554
|
+
};
|
|
3555
|
+
}
|
|
3556
|
+
}), routerTab_default = /* @__PURE__ */ defineComponent({
|
|
3557
|
+
__name: "routerTab",
|
|
3558
|
+
props: {
|
|
3559
|
+
items: {},
|
|
3560
|
+
routerBase: {}
|
|
3561
|
+
},
|
|
3562
|
+
setup(n) {
|
|
3563
|
+
let r = n, i = useRoute(), o = decodeURI(i.path.replaceAll(r.routerBase + "/", "").split("/")[0]), c = ref(o), l = window.$router, u = useTemplateRef("tab"), d = async (e) => {
|
|
3564
|
+
let n = "?", i = r.items.find((n) => n.name == e);
|
|
3565
|
+
for (let e in i.queries ?? {}) if (Object.prototype.hasOwnProperty.call(i.queries ?? {}, e)) {
|
|
3566
|
+
let r = (i.queries ?? {})[e];
|
|
3567
|
+
n += `${e}=${r}&`;
|
|
3568
|
+
}
|
|
3569
|
+
return n = n.replace(/&$/, ""), await l.force.replace(`${r.routerBase}/${e.split("/").map(encodeURI).join("/")}${n}`), !0;
|
|
3570
|
+
};
|
|
3571
|
+
watch(() => r.items, (e) => {
|
|
3572
|
+
e.find((e) => e.name.startsWith(c.value)) || console.log(c.value, e);
|
|
3573
|
+
});
|
|
3574
|
+
let f = l.afterEach((e) => {
|
|
3575
|
+
if (e.path.startsWith(r.routerBase)) {
|
|
3576
|
+
let n = e.path.replaceAll(r.routerBase + "/", "").split("/")[0];
|
|
3577
|
+
n !== c.value && (c.value = n);
|
|
3578
|
+
}
|
|
3579
|
+
});
|
|
3580
|
+
return onUnmounted(() => {
|
|
3581
|
+
f();
|
|
3582
|
+
}), (n, r) => {
|
|
3583
|
+
let i = Tab, o = Tabs;
|
|
3584
|
+
return openBlock(), createBlock(o, {
|
|
3585
|
+
ref_key: "tab",
|
|
3586
|
+
ref: u,
|
|
3587
|
+
shrink: "",
|
|
3588
|
+
active: c.value,
|
|
3589
|
+
"onUpdate:active": r[0] ||= (e) => c.value = e,
|
|
3590
|
+
beforeChange: d,
|
|
3591
|
+
class: "w-full"
|
|
3592
|
+
}, {
|
|
3593
|
+
"nav-left": withCtx(() => [renderSlot(n.$slots, "left")]),
|
|
3594
|
+
"nav-right": withCtx(() => [renderSlot(n.$slots, "right")]),
|
|
3595
|
+
"nav-bottom": withCtx(() => [renderSlot(n.$slots, "bottom")]),
|
|
3596
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(n.items, (e) => (openBlock(), createBlock(i, {
|
|
3597
|
+
title: e.title,
|
|
3598
|
+
onClick: (n) => c.value = e.name,
|
|
3599
|
+
name: e.name
|
|
3600
|
+
}, null, 8, [
|
|
3601
|
+
"title",
|
|
3602
|
+
"onClick",
|
|
3603
|
+
"name"
|
|
3604
|
+
]))), 256))]),
|
|
3605
|
+
_: 3
|
|
3606
|
+
}, 8, ["active"]);
|
|
3607
|
+
};
|
|
3608
|
+
}
|
|
3609
|
+
}), text_default = /* @__PURE__ */ defineComponent({
|
|
3610
|
+
__name: "text",
|
|
3611
|
+
props: {
|
|
3612
|
+
text: { default: "" },
|
|
3613
|
+
ellipsis: {}
|
|
3614
|
+
},
|
|
3615
|
+
setup(n) {
|
|
3616
|
+
let r = n, c = computed(() => r.text.replace(/(http(s?):\/\/)?([\w-]+\.)+(\.?[a-z]+)+(:\d+)?(\/[\w-.\/?%&=]*)?/gi, (e) => `\u1145[[${e}]]\u1145`).split("ᅅ").filter(Boolean).map((e) => /\[\[[^\[\]]+\]\]/g.test(e) ? {
|
|
3617
|
+
value: e.substring(2, e.length - 2),
|
|
3618
|
+
mode: "link"
|
|
3619
|
+
} : {
|
|
3620
|
+
value: e,
|
|
3621
|
+
mode: "text"
|
|
3622
|
+
}));
|
|
3623
|
+
return (n, r) => {
|
|
3624
|
+
let i = NButton;
|
|
3625
|
+
return openBlock(), createElementBlock("div", {
|
|
3626
|
+
class: normalizeClass([[unref(isNumber)(n.ellipsis) && "overflow-ellipsis overflow-hidden"], "whitespace-pre-wrap text-(--van-text-color)"]),
|
|
3627
|
+
style: normalizeStyle([unref(isNumber)(n.ellipsis) && `line-break: anywhere;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: ${n.ellipsis};`])
|
|
3628
|
+
}, [renderSlot(n.$slots, "default"), (openBlock(!0), createElementBlock(Fragment, null, renderList(c.value, (n) => (openBlock(), createElementBlock(Fragment, null, [n.mode === "link" ? (openBlock(), createBlock(i, {
|
|
3629
|
+
key: 0,
|
|
3630
|
+
tag: "a",
|
|
3631
|
+
class: "underline",
|
|
3632
|
+
onClick: r[0] ||= withModifiers(() => {}, ["stop"]),
|
|
3633
|
+
text: "",
|
|
3634
|
+
type: "primary",
|
|
3635
|
+
target: "_blank",
|
|
3636
|
+
href: /http(s?):\/\/.+/.test(n.value) ? n.value : `https://${n.value}`
|
|
3637
|
+
}, {
|
|
3638
|
+
default: withCtx(() => [createTextVNode(toDisplayString(n.value), 1)]),
|
|
3639
|
+
_: 2
|
|
3640
|
+
}, 1032, ["href"])) : n.mode === "text" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(n.value), 1)], 64)) : createCommentVNode("", !0)], 64))), 256))], 6);
|
|
3641
|
+
};
|
|
3642
|
+
}
|
|
3643
|
+
}), _hoisted_1$2 = { class: "mt-1 text-(--van-text-color-2) text-xs" }, toggleIcon_default = /* @__PURE__ */ defineComponent({
|
|
3644
|
+
__name: "toggleIcon",
|
|
3645
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3646
|
+
icon: {},
|
|
3647
|
+
size: {},
|
|
3648
|
+
disChanged: { type: Boolean },
|
|
3649
|
+
rowMode: { type: Boolean },
|
|
3650
|
+
padding: { type: Boolean }
|
|
3651
|
+
}, {
|
|
3652
|
+
modelValue: {
|
|
3653
|
+
type: Boolean,
|
|
3654
|
+
default: !1
|
|
3655
|
+
},
|
|
3656
|
+
modelModifiers: {}
|
|
3657
|
+
}),
|
|
3658
|
+
emits: /* @__PURE__ */ mergeModels([
|
|
3659
|
+
"change",
|
|
3660
|
+
"click",
|
|
3661
|
+
"longClick"
|
|
3662
|
+
], ["update:modelValue"]),
|
|
3663
|
+
setup(e, { emit: n }) {
|
|
3664
|
+
let r = e, i = n, o = useModel(e, "modelValue");
|
|
3665
|
+
watch(o, (e) => i("change", e));
|
|
3666
|
+
let l = () => {
|
|
3667
|
+
i("click", !o.value), r.disChanged || (o.value = !o.value);
|
|
3668
|
+
}, d = useTemplateRef("htmlRefHook");
|
|
3669
|
+
return onLongPress(d, () => {
|
|
3670
|
+
i("longClick");
|
|
3671
|
+
}, { modifiers: { prevent: !0 } }), (e, n) => {
|
|
3672
|
+
let r = NIcon;
|
|
3673
|
+
return openBlock(), createElementBlock("div", {
|
|
3674
|
+
class: normalizeClass(["flex items-center justify-center **:!transition-colors", [e.rowMode || "flex-col", e.padding && "px-4"]]),
|
|
3675
|
+
onClick: withModifiers(l, ["stop"]),
|
|
3676
|
+
ref_key: "htmlRefHook",
|
|
3677
|
+
ref: d
|
|
3678
|
+
}, [createVNode(r, {
|
|
3679
|
+
size: e.size,
|
|
3680
|
+
color: o.value ? "var(--p-color)" : "var(--van-gray-7)"
|
|
3681
|
+
}, {
|
|
3682
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(e.icon)))]),
|
|
3683
|
+
_: 1
|
|
3684
|
+
}, 8, ["size", "color"]), createElementVNode("span", _hoisted_1$2, [renderSlot(e.$slots, "default")])], 2);
|
|
3685
|
+
};
|
|
3686
|
+
}
|
|
3687
|
+
}), Z = Object.defineProperty, ee = Object.defineProperties, te = Object.getOwnPropertyDescriptors, I = Object.getOwnPropertySymbols, P = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable, N = (e, n, r) => n in e ? Z(e, n, {
|
|
3688
|
+
enumerable: !0,
|
|
3689
|
+
configurable: !0,
|
|
3690
|
+
writable: !0,
|
|
3691
|
+
value: r
|
|
3692
|
+
}) : e[n] = r, T = (e, n) => {
|
|
3693
|
+
for (var r in n ||= {}) P.call(n, r) && N(e, r, n[r]);
|
|
3694
|
+
if (I) for (var r of I(n)) G.call(n, r) && N(e, r, n[r]);
|
|
3695
|
+
return e;
|
|
3696
|
+
}, _ = (e, n) => ee(e, te(n)), L = (e, n) => {
|
|
3697
|
+
var r = {};
|
|
3698
|
+
for (var i in e) P.call(e, i) && n.indexOf(i) < 0 && (r[i] = e[i]);
|
|
3699
|
+
if (e != null && I) for (var i of I(e)) n.indexOf(i) < 0 && G.call(e, i) && (r[i] = e[i]);
|
|
3700
|
+
return r;
|
|
3701
|
+
};
|
|
3702
|
+
function F(e) {
|
|
3703
|
+
return getCurrentScope() ? (onScopeDispose(e), !0) : !1;
|
|
3704
|
+
}
|
|
3705
|
+
var fe = typeof window < "u" && typeof document < "u";
|
|
3706
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
3707
|
+
var pe = (e) => e != null, ve = Object.prototype.toString, he = (e) => ve.call(e) === "[object Object]";
|
|
3708
|
+
function R(e) {
|
|
3709
|
+
return Array.isArray(e) ? e : [e];
|
|
3710
|
+
}
|
|
3711
|
+
function me(e) {
|
|
3712
|
+
return getCurrentInstance();
|
|
3713
|
+
}
|
|
3714
|
+
function Q(e, n = !0, r) {
|
|
3715
|
+
me() ? onMounted(e, r) : n ? e() : nextTick(e);
|
|
3716
|
+
}
|
|
3717
|
+
function ge(e, n, r) {
|
|
3718
|
+
return watch(e, n, _(T({}, r), { immediate: !0 }));
|
|
3719
|
+
}
|
|
3720
|
+
var $ = fe ? window : void 0;
|
|
3721
|
+
function x(e) {
|
|
3722
|
+
let n = toValue(e);
|
|
3723
|
+
return n?.$el ?? n;
|
|
3724
|
+
}
|
|
3725
|
+
function q(...e) {
|
|
3726
|
+
let n = [], r = () => {
|
|
3727
|
+
n.forEach((e) => e()), n.length = 0;
|
|
3728
|
+
}, a = (e, n, r, i) => (e.addEventListener(n, r, i), () => e.removeEventListener(n, r, i)), o = computed(() => {
|
|
3729
|
+
let n = R(toValue(e[0])).filter((e) => e != null);
|
|
3730
|
+
return n.every((e) => typeof e != "string") ? n : void 0;
|
|
3731
|
+
}), s = ge(() => [
|
|
3732
|
+
o.value?.map((e) => x(e)) ?? [$].filter((e) => e != null),
|
|
3733
|
+
R(toValue(o.value ? e[1] : e[0])),
|
|
3734
|
+
R(unref(o.value ? e[2] : e[1])),
|
|
3735
|
+
toValue(o.value ? e[3] : e[2])
|
|
3736
|
+
], ([e, i, o, s]) => {
|
|
3737
|
+
if (r(), !(e != null && e.length) || !(i != null && i.length) || !(o != null && o.length)) return;
|
|
3738
|
+
let c = he(s) ? T({}, s) : s;
|
|
3739
|
+
n.push(...e.flatMap((e) => i.flatMap((n) => o.map((r) => a(e, n, r, c)))));
|
|
3740
|
+
}, { flush: "post" });
|
|
3741
|
+
return F(r), () => {
|
|
3742
|
+
s(), r();
|
|
3743
|
+
};
|
|
3744
|
+
}
|
|
3745
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3746
|
+
function be() {
|
|
3747
|
+
let e = shallowRef(!1), n = getCurrentInstance();
|
|
3748
|
+
return n && onMounted(() => {
|
|
3749
|
+
e.value = !0;
|
|
3750
|
+
}, n), e;
|
|
3751
|
+
}
|
|
3752
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3753
|
+
function X(e) {
|
|
3754
|
+
let n = /* @__PURE__ */ be();
|
|
3755
|
+
return computed(() => (n.value, !!e()));
|
|
3756
|
+
}
|
|
3757
|
+
function we(e, n, r = {}) {
|
|
3758
|
+
let a = r, { window: o = $ } = a, s = L(a, ["window"]), c, l = /* @__PURE__ */ X(() => o && "MutationObserver" in o), u = () => {
|
|
3759
|
+
c &&= (c.disconnect(), void 0);
|
|
3760
|
+
}, d = computed(() => {
|
|
3761
|
+
let n = toValue(e), r = R(n).map(x).filter(pe);
|
|
3762
|
+
return new Set(r);
|
|
3763
|
+
}), f = watch(() => d.value, (e) => {
|
|
3764
|
+
u(), l.value && e.size && (c = new MutationObserver(n), e.forEach((e) => c.observe(e, s)));
|
|
3765
|
+
}, {
|
|
3766
|
+
immediate: !0,
|
|
3767
|
+
flush: "post"
|
|
3768
|
+
}), p = () => c?.takeRecords(), m = () => {
|
|
3769
|
+
f(), u();
|
|
3770
|
+
};
|
|
3771
|
+
return F(m), {
|
|
3772
|
+
isSupported: l,
|
|
3773
|
+
stop: m,
|
|
3774
|
+
takeRecords: p
|
|
3775
|
+
};
|
|
3776
|
+
}
|
|
3777
|
+
function Y(e, n, r = {}) {
|
|
3778
|
+
let a = r, { window: o = $ } = a, s = L(a, ["window"]), c, l = /* @__PURE__ */ X(() => o && "ResizeObserver" in o), u = () => {
|
|
3779
|
+
c &&= (c.disconnect(), void 0);
|
|
3780
|
+
}, d = computed(() => {
|
|
3781
|
+
let n = toValue(e);
|
|
3782
|
+
return Array.isArray(n) ? n.map((e) => x(e)) : [x(n)];
|
|
3783
|
+
}), f = watch(d, (e) => {
|
|
3784
|
+
if (u(), l.value && o) {
|
|
3785
|
+
c = new ResizeObserver(n);
|
|
3786
|
+
for (let n of e) n && c.observe(n, s);
|
|
3787
|
+
}
|
|
3788
|
+
}, {
|
|
3789
|
+
immediate: !0,
|
|
3790
|
+
flush: "post"
|
|
3791
|
+
}), p = () => {
|
|
3792
|
+
u(), f();
|
|
3793
|
+
};
|
|
3794
|
+
return F(p), {
|
|
3795
|
+
isSupported: l,
|
|
3796
|
+
stop: p
|
|
3797
|
+
};
|
|
3798
|
+
}
|
|
3799
|
+
function xe(e, n = {}) {
|
|
3800
|
+
let { reset: r = !0, windowResize: i = !0, windowScroll: a = !0, immediate: o = !0, updateTiming: s = "sync" } = n, c = shallowRef(0), l = shallowRef(0), u = shallowRef(0), d = shallowRef(0), f = shallowRef(0), p = shallowRef(0), m = shallowRef(0), h = shallowRef(0);
|
|
3801
|
+
function g() {
|
|
3802
|
+
let n = x(e);
|
|
3803
|
+
if (!n) {
|
|
3804
|
+
r && (c.value = 0, l.value = 0, u.value = 0, d.value = 0, f.value = 0, p.value = 0, m.value = 0, h.value = 0);
|
|
3805
|
+
return;
|
|
3806
|
+
}
|
|
3807
|
+
let i = n.getBoundingClientRect();
|
|
3808
|
+
c.value = i.height, l.value = i.bottom, u.value = i.left, d.value = i.right, f.value = i.top, p.value = i.width, m.value = i.x, h.value = i.y;
|
|
3809
|
+
}
|
|
3810
|
+
function v() {
|
|
3811
|
+
s === "sync" ? g() : s === "next-frame" && requestAnimationFrame(() => g());
|
|
3812
|
+
}
|
|
3813
|
+
return Y(e, v), watch(() => x(e), (e) => !e && v()), we(e, v, { attributeFilter: ["style", "class"] }), a && q("scroll", v, {
|
|
3814
|
+
capture: !0,
|
|
3815
|
+
passive: !0
|
|
3816
|
+
}), i && q("resize", v, { passive: !0 }), Q(() => {
|
|
3817
|
+
o && v();
|
|
3818
|
+
}), {
|
|
3819
|
+
height: c,
|
|
3820
|
+
bottom: l,
|
|
3821
|
+
left: u,
|
|
3822
|
+
right: d,
|
|
3823
|
+
top: f,
|
|
3824
|
+
width: p,
|
|
3825
|
+
x: m,
|
|
3826
|
+
y: h,
|
|
3827
|
+
update: v
|
|
3828
|
+
};
|
|
3829
|
+
}
|
|
3830
|
+
function ye(e, n = {
|
|
3831
|
+
width: 0,
|
|
3832
|
+
height: 0
|
|
3833
|
+
}, r = {}) {
|
|
3834
|
+
let { window: a = $, box: o = "content-box" } = r, s = computed(() => (x(e)?.namespaceURI)?.includes("svg")), c = shallowRef(n.width), l = shallowRef(n.height), { stop: u } = Y(e, ([n]) => {
|
|
3835
|
+
let r = o === "border-box" ? n.borderBoxSize : o === "content-box" ? n.contentBoxSize : n.devicePixelContentBoxSize;
|
|
3836
|
+
if (a && s.value) {
|
|
3837
|
+
let n = x(e);
|
|
3838
|
+
if (n) {
|
|
3839
|
+
let e = n.getBoundingClientRect();
|
|
3840
|
+
c.value = e.width, l.value = e.height;
|
|
3841
|
+
}
|
|
3842
|
+
} else if (r) {
|
|
3843
|
+
let e = R(r);
|
|
3844
|
+
c.value = e.reduce((e, { inlineSize: n }) => e + n, 0), l.value = e.reduce((e, { blockSize: n }) => e + n, 0);
|
|
3845
|
+
} else c.value = n.contentRect.width, l.value = n.contentRect.height;
|
|
3846
|
+
}, r);
|
|
3847
|
+
Q(() => {
|
|
3848
|
+
let r = x(e);
|
|
3849
|
+
r && (c.value = "offsetWidth" in r ? r.offsetWidth : n.width, l.value = "offsetHeight" in r ? r.offsetHeight : n.height);
|
|
3850
|
+
});
|
|
3851
|
+
let d = watch(() => x(e), (e) => {
|
|
3852
|
+
c.value = e ? n.width : 0, l.value = e ? n.height : 0;
|
|
3853
|
+
});
|
|
3854
|
+
function f() {
|
|
3855
|
+
u(), d();
|
|
3856
|
+
}
|
|
3857
|
+
return {
|
|
3858
|
+
width: c,
|
|
3859
|
+
height: l,
|
|
3860
|
+
stop: f
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
3864
|
+
name: "VirtualWaterfall",
|
|
3865
|
+
__name: "virtual-waterfall",
|
|
3866
|
+
props: {
|
|
3867
|
+
virtual: {
|
|
3868
|
+
type: Boolean,
|
|
3869
|
+
default: !0
|
|
3870
|
+
},
|
|
3871
|
+
rowKey: { default: "id" },
|
|
3872
|
+
enableCache: {
|
|
3873
|
+
type: Boolean,
|
|
3874
|
+
default: !0
|
|
3875
|
+
},
|
|
3876
|
+
gap: { default: 15 },
|
|
3877
|
+
padding: { default: 15 },
|
|
3878
|
+
preloadScreenCount: { default: () => [0, 0] },
|
|
3879
|
+
itemMinWidth: { default: 220 },
|
|
3880
|
+
maxColumnCount: { default: 10 },
|
|
3881
|
+
minColumnCount: { default: 2 },
|
|
3882
|
+
items: { default: () => [] },
|
|
3883
|
+
calcItemHeight: {
|
|
3884
|
+
type: Function,
|
|
3885
|
+
default: (e, n) => 250
|
|
3886
|
+
}
|
|
3887
|
+
},
|
|
3888
|
+
setup(n, { expose: r }) {
|
|
3889
|
+
let a = n, o = ref(), { width: c } = ye(o), { top: l } = xe(o);
|
|
3890
|
+
onMounted(() => {
|
|
3891
|
+
c.value === 0 && (c.value = Number.parseInt(window.getComputedStyle(o.value).width));
|
|
3892
|
+
});
|
|
3893
|
+
function u(e) {
|
|
3894
|
+
return Object.prototype.toString.call(e) === "[object Number]";
|
|
3895
|
+
}
|
|
3896
|
+
let d = computed(() => {
|
|
3897
|
+
if (!c.value) return 0;
|
|
3898
|
+
let e = c.value;
|
|
3899
|
+
if (e >= a.itemMinWidth * 2) {
|
|
3900
|
+
let n = Math.floor(e / a.itemMinWidth);
|
|
3901
|
+
return a.maxColumnCount && n > a.maxColumnCount ? a.maxColumnCount : n;
|
|
3902
|
+
}
|
|
3903
|
+
return a.minColumnCount;
|
|
3904
|
+
}), f = ref(Array(d.value).fill(0)), p = computed(() => {
|
|
3905
|
+
if (!c.value || d.value <= 0) return 0;
|
|
3906
|
+
let e = (d.value - 1) * a.gap;
|
|
3907
|
+
return Math.ceil((c.value - e) / d.value);
|
|
3908
|
+
}), m = shallowRef([]);
|
|
3909
|
+
r({ withItemSpaces: (e) => {
|
|
3910
|
+
e(readonly(m).value);
|
|
3911
|
+
} }), watchEffect(() => {
|
|
3912
|
+
let e = a.items.length;
|
|
3913
|
+
if (!d.value || !e) {
|
|
3914
|
+
m.value = [];
|
|
3915
|
+
return;
|
|
3916
|
+
}
|
|
3917
|
+
let n = Array(e), r = 0, i = a.enableCache && m.value.length && e > m.value.length;
|
|
3918
|
+
i ? r = m.value.length : f.value = Array(d.value).fill(0);
|
|
3919
|
+
for (let o = 0; o < e; o++) {
|
|
3920
|
+
if (i && o < r) {
|
|
3921
|
+
n[o] = m.value[o];
|
|
3922
|
+
continue;
|
|
3923
|
+
}
|
|
3924
|
+
let e = g(), s = a.calcItemHeight(a.items[o], p.value), c = f.value[e], l = (p.value + a.gap) * e, u = {
|
|
3925
|
+
index: o,
|
|
3926
|
+
item: a.items[o],
|
|
3927
|
+
column: e,
|
|
3928
|
+
top: c,
|
|
3929
|
+
left: l,
|
|
3930
|
+
bottom: c + s,
|
|
3931
|
+
height: s
|
|
3932
|
+
};
|
|
3933
|
+
f.value[e] += s + a.gap, n[o] = u;
|
|
3934
|
+
}
|
|
3935
|
+
m.value = n;
|
|
3936
|
+
});
|
|
3937
|
+
let h = computed(() => {
|
|
3938
|
+
let e = m.value.length;
|
|
3939
|
+
if (!e) return [];
|
|
3940
|
+
if (!a.virtual) return m.value;
|
|
3941
|
+
let n = o.value.parentElement.offsetTop, r = -l.value + n, [i, s] = a.preloadScreenCount, c = o.value.parentElement.clientHeight, u = r - i * c, d = r + (s + 1) * c, f = [];
|
|
3942
|
+
for (let n = 0; n < e; n++) {
|
|
3943
|
+
let e = m.value[n], r = e.top, i = e.bottom;
|
|
3944
|
+
(r >= u && r <= d || i >= u && i <= d || r < u && i > d) && f.push(e);
|
|
3945
|
+
}
|
|
3946
|
+
return f;
|
|
3947
|
+
}), g = () => f.value.indexOf(Math.min(...f.value));
|
|
3948
|
+
return (n, r) => (openBlock(), createElementBlock("div", {
|
|
3949
|
+
ref_key: "content",
|
|
3950
|
+
ref: o,
|
|
3951
|
+
style: normalizeStyle({
|
|
3952
|
+
position: "relative",
|
|
3953
|
+
willChange: "height",
|
|
3954
|
+
height: `${Math.max(...f.value)}px`,
|
|
3955
|
+
padding: `${u(n.padding) ? n.padding + "px" : n.padding}`
|
|
3956
|
+
})
|
|
3957
|
+
}, [(openBlock(!0), createElementBlock(Fragment, null, renderList(h.value, (e) => (openBlock(), createElementBlock("div", {
|
|
3958
|
+
key: e.item[n.rowKey] ?? e.index,
|
|
3959
|
+
style: normalizeStyle({
|
|
3960
|
+
position: "absolute",
|
|
3961
|
+
contentVisibility: "auto",
|
|
3962
|
+
width: `${p.value}px`,
|
|
3963
|
+
height: `${e.height}px`,
|
|
3964
|
+
transform: `translate(${e.left}px, ${e.top}px)`,
|
|
3965
|
+
containIntrinsicSize: `${p.value}px ${e.height}px`
|
|
3966
|
+
}),
|
|
3967
|
+
"data-index": e.index
|
|
3968
|
+
}, [renderSlot(n.$slots, "default", {
|
|
3969
|
+
item: e.item,
|
|
3970
|
+
index: e.index
|
|
3971
|
+
})], 12, Ce))), 128))], 4));
|
|
3972
|
+
}
|
|
3973
|
+
}), waterfall_default = /* @__PURE__ */ defineComponent({
|
|
3974
|
+
__name: "waterfall",
|
|
3975
|
+
props: {
|
|
3976
|
+
source: {},
|
|
3977
|
+
style: { type: [
|
|
3978
|
+
Boolean,
|
|
3979
|
+
null,
|
|
3980
|
+
String,
|
|
3981
|
+
Object,
|
|
3982
|
+
Array
|
|
3983
|
+
] },
|
|
3984
|
+
class: {},
|
|
3985
|
+
col: { default: 2 },
|
|
3986
|
+
padding: { default: 4 },
|
|
3987
|
+
gap: { default: 4 },
|
|
3988
|
+
minHeight: { default: 0 },
|
|
3989
|
+
dataProcessor: {},
|
|
3990
|
+
unReloadable: { type: Boolean }
|
|
3991
|
+
},
|
|
3992
|
+
emits: [
|
|
3993
|
+
"next",
|
|
3994
|
+
"reset",
|
|
3995
|
+
"retry",
|
|
3996
|
+
"col"
|
|
3997
|
+
],
|
|
3998
|
+
setup(e, { expose: n, emit: r }) {
|
|
3999
|
+
let s = e, c = r, l = (e) => s.dataProcessor?.(e) ?? e, d = computed(() => isArray(s.col) ? s.col : [s.col, s.col]), f = computed(() => ({
|
|
4000
|
+
...Stream.isStream(s.source) ? {
|
|
4001
|
+
data: l(s.source.data.value),
|
|
4002
|
+
isDone: s.source.isDone.value,
|
|
4003
|
+
isRequesting: s.source.isRequesting.value,
|
|
4004
|
+
isError: !!s.source.error.value,
|
|
4005
|
+
length: l(s.source.data.value).length,
|
|
4006
|
+
isEmpty: s.source.isEmpty.value,
|
|
4007
|
+
source: s.source
|
|
4008
|
+
} : {
|
|
4009
|
+
data: l(s.source.data.data.value ?? []),
|
|
4010
|
+
isDone: s.source.isEnd,
|
|
4011
|
+
isRequesting: s.source.data.isLoading.value,
|
|
4012
|
+
isError: s.source.data.isError.value,
|
|
4013
|
+
length: l(s.source.data.data.value ?? []).length,
|
|
4014
|
+
isEmpty: s.source.data.isEmpty.value,
|
|
4015
|
+
source: s.source.data
|
|
4016
|
+
},
|
|
4017
|
+
next: () => Stream.isStream(s.source) ? s.source.next() : callbackToPromise((e) => c("next", e)),
|
|
4018
|
+
retry: () => Stream.isStream(s.source) ? s.source.retry() : callbackToPromise((e) => c("retry", e)),
|
|
4019
|
+
reset: () => Stream.isStream(s.source) ? s.source.reset() : c("reset")
|
|
4020
|
+
})), p = shallowRef(!1), m = shallowRef(!1), h = async () => {
|
|
4021
|
+
f.value.reset(), console.log("reset done"), await f.value.next(), m.value = !1;
|
|
4022
|
+
}, g = useTemplateRef("content"), v = computed(() => g.value?.cont), { y } = useScroll(v);
|
|
4023
|
+
useEventListener("scroll", () => {
|
|
4024
|
+
let { isDone: e, isError: n, isRequesting: r, retry: i, next: a } = f.value;
|
|
4025
|
+
if (r || e) return;
|
|
4026
|
+
let o = v.value;
|
|
4027
|
+
if (!o) return;
|
|
4028
|
+
let s = o.scrollHeight, c = o.scrollTop, l = o.clientHeight;
|
|
4029
|
+
s - c - l <= 100 && (n ? i() : a());
|
|
4030
|
+
}, { target: v }), watch(() => s.source, () => {
|
|
4031
|
+
let { isError: e, retry: n, next: r, isEmpty: i } = f.value;
|
|
4032
|
+
i && (e ? n() : r());
|
|
4033
|
+
}, {
|
|
4034
|
+
deep: 1,
|
|
4035
|
+
immediate: !0
|
|
4036
|
+
});
|
|
4037
|
+
let b = useTemplateRef("waterfallEl"), S = useTemp().$applyRaw("waterfall", () => shallowReactive(/* @__PURE__ */ new Map())), C = [], w = new MutationObserver(([e]) => {
|
|
4038
|
+
for (let e of C) e();
|
|
4039
|
+
if (!(e.target instanceof HTMLDivElement) || !f.value.data) return;
|
|
4040
|
+
let n = [...e.target.children];
|
|
4041
|
+
for (let e of n) {
|
|
4042
|
+
let n = Number(e.dataset.index), r = f.value.data[n], i = () => {
|
|
4043
|
+
let n = e.firstElementChild?.getBoundingClientRect();
|
|
4044
|
+
S.set(r, n?.height ?? s.minHeight);
|
|
4045
|
+
}, a = useResizeObserver(e.firstElementChild, i);
|
|
4046
|
+
i(), C.push(() => a.stop());
|
|
4047
|
+
}
|
|
4048
|
+
});
|
|
4049
|
+
watch(b, (e) => {
|
|
4050
|
+
if (!e) return w.disconnect();
|
|
4051
|
+
w.observe(e.$el, { childList: !0 });
|
|
4052
|
+
}), onUnmounted(() => {
|
|
4053
|
+
w.disconnect();
|
|
4054
|
+
for (let e of C) e();
|
|
4055
|
+
});
|
|
4056
|
+
let O = shallowRef(!0);
|
|
4057
|
+
return n({
|
|
4058
|
+
scrollTop: y,
|
|
4059
|
+
scrollParent: v,
|
|
4060
|
+
async reloadList() {
|
|
4061
|
+
O.value = !1, S.clear(), await nextTick(), O.value = !0;
|
|
4062
|
+
}
|
|
4063
|
+
}), (e, n) => {
|
|
4064
|
+
let r = PullRefresh;
|
|
4065
|
+
return O.value ? (openBlock(), createBlock(r, {
|
|
4066
|
+
key: 0,
|
|
4067
|
+
modelValue: m.value,
|
|
4068
|
+
"onUpdate:modelValue": n[0] ||= (e) => m.value = e,
|
|
4069
|
+
class: normalizeClass(["relative h-full", s.class]),
|
|
4070
|
+
disabled: e.unReloadable || f.value.isRequesting || !!unref(y) && !p.value,
|
|
4071
|
+
onRefresh: h,
|
|
4072
|
+
onChange: n[1] ||= ({ distance: e }) => p.value = !!e,
|
|
4073
|
+
style: normalizeStyle(e.style)
|
|
4074
|
+
}, {
|
|
4075
|
+
default: withCtx(() => [createVNode(content_default, {
|
|
4076
|
+
retriable: "",
|
|
4077
|
+
source: unref(Stream).isStream(e.source) ? e.source : e.source.data,
|
|
4078
|
+
"class-loading": "mt-2 !h-[24px]",
|
|
4079
|
+
"class-empty": "!h-full",
|
|
4080
|
+
"class-error": "!h-full",
|
|
4081
|
+
class: "h-full overflow-auto w-full",
|
|
4082
|
+
onRetry: h,
|
|
4083
|
+
onResetRetry: h,
|
|
4084
|
+
"hide-loading": p.value && f.value.isRequesting,
|
|
4085
|
+
ref_key: "content",
|
|
4086
|
+
ref: g
|
|
4087
|
+
}, {
|
|
4088
|
+
default: withCtx(() => [createVNode(unref(U), {
|
|
4089
|
+
items: f.value.data,
|
|
4090
|
+
gap: e.gap,
|
|
4091
|
+
padding: e.padding,
|
|
4092
|
+
"preload-screen-count": [0, 1],
|
|
4093
|
+
ref_key: "waterfallEl",
|
|
4094
|
+
ref: b,
|
|
4095
|
+
"calc-item-height": (n) => unref(S).get(n) ?? e.minHeight,
|
|
4096
|
+
class: "waterfall",
|
|
4097
|
+
"min-column-count": d.value[0],
|
|
4098
|
+
"max-column-count": d.value[1]
|
|
4099
|
+
}, {
|
|
4100
|
+
default: withCtx(({ item: n, index: r }) => [renderSlot(e.$slots, "default", {
|
|
4101
|
+
item: n,
|
|
4102
|
+
index: r,
|
|
4103
|
+
height: unref(S).get(n),
|
|
4104
|
+
length: f.value.length,
|
|
4105
|
+
minHeight: e.minHeight
|
|
4106
|
+
})]),
|
|
4107
|
+
_: 3
|
|
4108
|
+
}, 8, [
|
|
4109
|
+
"items",
|
|
4110
|
+
"gap",
|
|
4111
|
+
"padding",
|
|
4112
|
+
"calc-item-height",
|
|
4113
|
+
"min-column-count",
|
|
4114
|
+
"max-column-count"
|
|
4115
|
+
])]),
|
|
4116
|
+
_: 3
|
|
4117
|
+
}, 8, ["source", "hide-loading"])]),
|
|
4118
|
+
_: 3
|
|
4119
|
+
}, 8, [
|
|
4120
|
+
"modelValue",
|
|
4121
|
+
"class",
|
|
4122
|
+
"disabled",
|
|
4123
|
+
"style"
|
|
4124
|
+
])) : createCommentVNode("", !0);
|
|
4125
|
+
};
|
|
4126
|
+
}
|
|
4127
|
+
}), _hoisted_1$1 = { class: "overflow-hidden" }, previewUser_default = /* @__PURE__ */ defineComponent({
|
|
4128
|
+
__name: "previewUser",
|
|
4129
|
+
setup(e, { expose: n }) {
|
|
4130
|
+
let r = useTemplateRef("floatPopup"), o = useTemplateRef("contentBox"), { height: s } = useElementSize(o), l = shallowRef();
|
|
4131
|
+
n({
|
|
4132
|
+
show(e) {
|
|
4133
|
+
r.value?.show(1), l.value = e;
|
|
4134
|
+
},
|
|
4135
|
+
isShowing: computed(() => r.value?.isShowing),
|
|
4136
|
+
close() {
|
|
4137
|
+
r.value?.close();
|
|
4138
|
+
}
|
|
4139
|
+
});
|
|
4140
|
+
let u = computed(() => [
|
|
4141
|
+
0,
|
|
4142
|
+
(s.value || Math.floor(window.innerHeight * .2)) + 30,
|
|
4143
|
+
72 + (s.value || Math.floor(window.innerHeight * .2))
|
|
4144
|
+
]);
|
|
4145
|
+
return (e, n) => (openBlock(), createBlock(floatPopup_default, {
|
|
4146
|
+
ref_key: "floatPopup",
|
|
4147
|
+
ref: r,
|
|
4148
|
+
anchors: u.value,
|
|
4149
|
+
overlay: "",
|
|
4150
|
+
class: "overflow-hidden"
|
|
4151
|
+
}, {
|
|
4152
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$1, [createElementVNode("div", {
|
|
4153
|
+
ref_key: "contentBox",
|
|
4154
|
+
ref: o,
|
|
4155
|
+
class: "w-full flex justify-center items-start backdrop-blur-lg van-hairline--bottom"
|
|
4156
|
+
}, null, 512)])]),
|
|
4157
|
+
_: 1
|
|
4158
|
+
}, 8, ["anchors"]));
|
|
4159
|
+
}
|
|
4160
|
+
}), image_exports$1 = /* @__PURE__ */ __export({ Image: () => Image$1 }), Image$1 = class e extends Struct {
|
|
4161
|
+
static processInstances = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/image/processInstances");
|
|
4162
|
+
static setProcess(e, n, r) {
|
|
4163
|
+
let i = `${e}:${n}`;
|
|
4164
|
+
this.processInstances.set(i, {
|
|
4165
|
+
func: r,
|
|
4166
|
+
plugin: e,
|
|
4167
|
+
referenceName: n,
|
|
4168
|
+
fullName: i
|
|
4169
|
+
});
|
|
4170
|
+
}
|
|
4171
|
+
static fork = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/image/fork");
|
|
4172
|
+
static activeFork = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/image/activeFork");
|
|
4173
|
+
static setFork(e, n, r) {
|
|
4174
|
+
let i = `${e}:${n}`;
|
|
4175
|
+
this.fork.set(i, r);
|
|
4176
|
+
}
|
|
4177
|
+
static is(e) {
|
|
4178
|
+
return e instanceof this;
|
|
4179
|
+
}
|
|
4180
|
+
static create(e, n) {
|
|
4181
|
+
return new this(e, n);
|
|
4182
|
+
}
|
|
4183
|
+
constructor(e, n) {
|
|
4184
|
+
super(e), this.aspect = n, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.path = e.path, this.forkNamespace = e.forkNamespace, this.processSteps = (e.processSteps ?? []).map((e) => isString(e) ? {
|
|
4185
|
+
referenceName: e,
|
|
4186
|
+
ignoreExit: !1
|
|
4187
|
+
} : e);
|
|
4188
|
+
}
|
|
4189
|
+
forkNamespace;
|
|
4190
|
+
path;
|
|
4191
|
+
processSteps;
|
|
4192
|
+
$$meta;
|
|
4193
|
+
$$plugin;
|
|
4194
|
+
async getUrl() {
|
|
4195
|
+
let n = this.path;
|
|
4196
|
+
for (let r of this.processSteps) {
|
|
4197
|
+
let i = `${this.$$plugin}:${r.referenceName}`, a = e.processInstances.get(i);
|
|
4198
|
+
if (!a) {
|
|
4199
|
+
console.warn(`[Image.getUrl] process not found, fullname: "${i}"`);
|
|
4200
|
+
continue;
|
|
4201
|
+
}
|
|
4202
|
+
let o = await a.func(n, this);
|
|
4203
|
+
if (n = o[0], r.ignoreExit || !o[1]) continue;
|
|
4204
|
+
break;
|
|
4205
|
+
}
|
|
4206
|
+
return `${e.activeFork.get(`${this.$$plugin}:${this.forkNamespace}`)}/${n}`;
|
|
4207
|
+
}
|
|
4208
|
+
}, require_dayjs_min = /* @__PURE__ */ __commonJSMin(((exports, n) => {
|
|
4209
|
+
(function(r, i) {
|
|
4210
|
+
typeof exports == "object" && n !== void 0 ? n.exports = i() : typeof define == "function" && define.amd ? define(i) : (r = typeof globalThis < "u" ? globalThis : r || self).dayjs = i();
|
|
4211
|
+
})(exports, (function() {
|
|
4212
|
+
var e = 1e3, n = 6e4, r = 36e5, i = "millisecond", a = "second", o = "minute", s = "hour", c = "day", l = "week", u = "month", d = "quarter", f = "year", p = "date", m = "Invalid Date", h = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, g = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, v = {
|
|
4213
|
+
name: "en",
|
|
4214
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
4215
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
4216
|
+
ordinal: function(e) {
|
|
4217
|
+
var n = [
|
|
4218
|
+
"th",
|
|
4219
|
+
"st",
|
|
4220
|
+
"nd",
|
|
4221
|
+
"rd"
|
|
4222
|
+
], r = e % 100;
|
|
4223
|
+
return "[" + e + (n[(r - 20) % 10] || n[r] || n[0]) + "]";
|
|
4224
|
+
}
|
|
4225
|
+
}, y = function(e, n, r) {
|
|
4226
|
+
var i = String(e);
|
|
4227
|
+
return !i || i.length >= n ? e : "" + Array(n + 1 - i.length).join(r) + e;
|
|
4228
|
+
}, b = {
|
|
4229
|
+
s: y,
|
|
4230
|
+
z: function(e) {
|
|
4231
|
+
var n = -e.utcOffset(), r = Math.abs(n), i = Math.floor(r / 60), a = r % 60;
|
|
4232
|
+
return (n <= 0 ? "+" : "-") + y(i, 2, "0") + ":" + y(a, 2, "0");
|
|
4233
|
+
},
|
|
4234
|
+
m: function e(n, r) {
|
|
4235
|
+
if (n.date() < r.date()) return -e(r, n);
|
|
4236
|
+
var i = 12 * (r.year() - n.year()) + (r.month() - n.month()), a = n.clone().add(i, u), o = r - a < 0, s = n.clone().add(i + (o ? -1 : 1), u);
|
|
4237
|
+
return +(-(i + (r - a) / (o ? a - s : s - a)) || 0);
|
|
4238
|
+
},
|
|
4239
|
+
a: function(e) {
|
|
4240
|
+
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
|
|
4241
|
+
},
|
|
4242
|
+
p: function(e) {
|
|
4243
|
+
return {
|
|
4244
|
+
M: u,
|
|
4245
|
+
y: f,
|
|
4246
|
+
w: l,
|
|
4247
|
+
d: c,
|
|
4248
|
+
D: p,
|
|
4249
|
+
h: s,
|
|
4250
|
+
m: o,
|
|
4251
|
+
s: a,
|
|
4252
|
+
ms: i,
|
|
4253
|
+
Q: d
|
|
4254
|
+
}[e] || String(e || "").toLowerCase().replace(/s$/, "");
|
|
4255
|
+
},
|
|
4256
|
+
u: function(e) {
|
|
4257
|
+
return e === void 0;
|
|
4258
|
+
}
|
|
4259
|
+
}, S = "en", C = {};
|
|
4260
|
+
C[S] = v;
|
|
4261
|
+
var w = "$isDayjsObject", E = function(e) {
|
|
4262
|
+
return e instanceof A || !(!e || !e[w]);
|
|
4263
|
+
}, D = function e(n, r, i) {
|
|
4264
|
+
var a;
|
|
4265
|
+
if (!n) return S;
|
|
4266
|
+
if (typeof n == "string") {
|
|
4267
|
+
var o = n.toLowerCase();
|
|
4268
|
+
C[o] && (a = o), r && (C[o] = r, a = o);
|
|
4269
|
+
var s = n.split("-");
|
|
4270
|
+
if (!a && s.length > 1) return e(s[0]);
|
|
4271
|
+
} else {
|
|
4272
|
+
var c = n.name;
|
|
4273
|
+
C[c] = n, a = c;
|
|
4274
|
+
}
|
|
4275
|
+
return !i && a && (S = a), a || !i && S;
|
|
4276
|
+
}, O = function(e, n) {
|
|
4277
|
+
if (E(e)) return e.clone();
|
|
4278
|
+
var r = typeof n == "object" ? n : {};
|
|
4279
|
+
return r.date = e, r.args = arguments, new A(r);
|
|
4280
|
+
}, k = b;
|
|
4281
|
+
k.l = D, k.i = E, k.w = function(e, n) {
|
|
4282
|
+
return O(e, {
|
|
4283
|
+
locale: n.$L,
|
|
4284
|
+
utc: n.$u,
|
|
4285
|
+
x: n.$x,
|
|
4286
|
+
$offset: n.$offset
|
|
4287
|
+
});
|
|
4288
|
+
};
|
|
4289
|
+
var A = function() {
|
|
4290
|
+
function v(e) {
|
|
4291
|
+
this.$L = D(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[w] = !0;
|
|
4292
|
+
}
|
|
4293
|
+
var y = v.prototype;
|
|
4294
|
+
return y.parse = function(e) {
|
|
4295
|
+
this.$d = function(e) {
|
|
4296
|
+
var n = e.date, r = e.utc;
|
|
4297
|
+
if (n === null) return /* @__PURE__ */ new Date(NaN);
|
|
4298
|
+
if (k.u(n)) return /* @__PURE__ */ new Date();
|
|
4299
|
+
if (n instanceof Date) return new Date(n);
|
|
4300
|
+
if (typeof n == "string" && !/Z$/i.test(n)) {
|
|
4301
|
+
var i = n.match(h);
|
|
4302
|
+
if (i) {
|
|
4303
|
+
var a = i[2] - 1 || 0, o = (i[7] || "0").substring(0, 3);
|
|
4304
|
+
return r ? new Date(Date.UTC(i[1], a, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, o)) : new Date(i[1], a, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, o);
|
|
4305
|
+
}
|
|
4306
|
+
}
|
|
4307
|
+
return new Date(n);
|
|
4308
|
+
}(e), this.init();
|
|
4309
|
+
}, y.init = function() {
|
|
4310
|
+
var e = this.$d;
|
|
4311
|
+
this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
|
|
4312
|
+
}, y.$utils = function() {
|
|
4313
|
+
return k;
|
|
4314
|
+
}, y.isValid = function() {
|
|
4315
|
+
return this.$d.toString() !== m;
|
|
4316
|
+
}, y.isSame = function(e, n) {
|
|
4317
|
+
var r = O(e);
|
|
4318
|
+
return this.startOf(n) <= r && r <= this.endOf(n);
|
|
4319
|
+
}, y.isAfter = function(e, n) {
|
|
4320
|
+
return O(e) < this.startOf(n);
|
|
4321
|
+
}, y.isBefore = function(e, n) {
|
|
4322
|
+
return this.endOf(n) < O(e);
|
|
4323
|
+
}, y.$g = function(e, n, r) {
|
|
4324
|
+
return k.u(e) ? this[n] : this.set(r, e);
|
|
4325
|
+
}, y.unix = function() {
|
|
4326
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
4327
|
+
}, y.valueOf = function() {
|
|
4328
|
+
return this.$d.getTime();
|
|
4329
|
+
}, y.startOf = function(e, n) {
|
|
4330
|
+
var r = this, i = !!k.u(n) || n, d = k.p(e), m = function(e, n) {
|
|
4331
|
+
var a = k.w(r.$u ? Date.UTC(r.$y, n, e) : new Date(r.$y, n, e), r);
|
|
4332
|
+
return i ? a : a.endOf(c);
|
|
4333
|
+
}, h = function(e, n) {
|
|
4334
|
+
return k.w(r.toDate()[e].apply(r.toDate("s"), (i ? [
|
|
4335
|
+
0,
|
|
4336
|
+
0,
|
|
4337
|
+
0,
|
|
4338
|
+
0
|
|
4339
|
+
] : [
|
|
4340
|
+
23,
|
|
4341
|
+
59,
|
|
4342
|
+
59,
|
|
4343
|
+
999
|
|
4344
|
+
]).slice(n)), r);
|
|
4345
|
+
}, g = this.$W, v = this.$M, y = this.$D, b = "set" + (this.$u ? "UTC" : "");
|
|
4346
|
+
switch (d) {
|
|
4347
|
+
case f: return i ? m(1, 0) : m(31, 11);
|
|
4348
|
+
case u: return i ? m(1, v) : m(0, v + 1);
|
|
4349
|
+
case l:
|
|
4350
|
+
var S = this.$locale().weekStart || 0, C = (g < S ? g + 7 : g) - S;
|
|
4351
|
+
return m(i ? y - C : y + (6 - C), v);
|
|
4352
|
+
case c:
|
|
4353
|
+
case p: return h(b + "Hours", 0);
|
|
4354
|
+
case s: return h(b + "Minutes", 1);
|
|
4355
|
+
case o: return h(b + "Seconds", 2);
|
|
4356
|
+
case a: return h(b + "Milliseconds", 3);
|
|
4357
|
+
default: return this.clone();
|
|
4358
|
+
}
|
|
4359
|
+
}, y.endOf = function(e) {
|
|
4360
|
+
return this.startOf(e, !1);
|
|
4361
|
+
}, y.$set = function(e, n) {
|
|
4362
|
+
var r, l = k.p(e), d = "set" + (this.$u ? "UTC" : ""), m = (r = {}, r[c] = d + "Date", r[p] = d + "Date", r[u] = d + "Month", r[f] = d + "FullYear", r[s] = d + "Hours", r[o] = d + "Minutes", r[a] = d + "Seconds", r[i] = d + "Milliseconds", r)[l], h = l === c ? this.$D + (n - this.$W) : n;
|
|
4363
|
+
if (l === u || l === f) {
|
|
4364
|
+
var g = this.clone().set(p, 1);
|
|
4365
|
+
g.$d[m](h), g.init(), this.$d = g.set(p, Math.min(this.$D, g.daysInMonth())).$d;
|
|
4366
|
+
} else m && this.$d[m](h);
|
|
4367
|
+
return this.init(), this;
|
|
4368
|
+
}, y.set = function(e, n) {
|
|
4369
|
+
return this.clone().$set(e, n);
|
|
4370
|
+
}, y.get = function(e) {
|
|
4371
|
+
return this[k.p(e)]();
|
|
4372
|
+
}, y.add = function(i, d) {
|
|
4373
|
+
var p, m = this;
|
|
4374
|
+
i = Number(i);
|
|
4375
|
+
var h = k.p(d), g = function(e) {
|
|
4376
|
+
var n = O(m);
|
|
4377
|
+
return k.w(n.date(n.date() + Math.round(e * i)), m);
|
|
4378
|
+
};
|
|
4379
|
+
if (h === u) return this.set(u, this.$M + i);
|
|
4380
|
+
if (h === f) return this.set(f, this.$y + i);
|
|
4381
|
+
if (h === c) return g(1);
|
|
4382
|
+
if (h === l) return g(7);
|
|
4383
|
+
var v = (p = {}, p[o] = n, p[s] = r, p[a] = e, p)[h] || 1, y = this.$d.getTime() + i * v;
|
|
4384
|
+
return k.w(y, this);
|
|
4385
|
+
}, y.subtract = function(e, n) {
|
|
4386
|
+
return this.add(-1 * e, n);
|
|
4387
|
+
}, y.format = function(e) {
|
|
4388
|
+
var n = this, r = this.$locale();
|
|
4389
|
+
if (!this.isValid()) return r.invalidDate || m;
|
|
4390
|
+
var i = e || "YYYY-MM-DDTHH:mm:ssZ", a = k.z(this), o = this.$H, s = this.$m, c = this.$M, l = r.weekdays, u = r.months, d = r.meridiem, f = function(e, r, a, o) {
|
|
4391
|
+
return e && (e[r] || e(n, i)) || a[r].slice(0, o);
|
|
4392
|
+
}, p = function(e) {
|
|
4393
|
+
return k.s(o % 12 || 12, e, "0");
|
|
4394
|
+
}, h = d || function(e, n, r) {
|
|
4395
|
+
var i = e < 12 ? "AM" : "PM";
|
|
4396
|
+
return r ? i.toLowerCase() : i;
|
|
4397
|
+
};
|
|
4398
|
+
return i.replace(g, (function(e, i) {
|
|
4399
|
+
return i || function(e) {
|
|
4400
|
+
switch (e) {
|
|
4401
|
+
case "YY": return String(n.$y).slice(-2);
|
|
4402
|
+
case "YYYY": return k.s(n.$y, 4, "0");
|
|
4403
|
+
case "M": return c + 1;
|
|
4404
|
+
case "MM": return k.s(c + 1, 2, "0");
|
|
4405
|
+
case "MMM": return f(r.monthsShort, c, u, 3);
|
|
4406
|
+
case "MMMM": return f(u, c);
|
|
4407
|
+
case "D": return n.$D;
|
|
4408
|
+
case "DD": return k.s(n.$D, 2, "0");
|
|
4409
|
+
case "d": return String(n.$W);
|
|
4410
|
+
case "dd": return f(r.weekdaysMin, n.$W, l, 2);
|
|
4411
|
+
case "ddd": return f(r.weekdaysShort, n.$W, l, 3);
|
|
4412
|
+
case "dddd": return l[n.$W];
|
|
4413
|
+
case "H": return String(o);
|
|
4414
|
+
case "HH": return k.s(o, 2, "0");
|
|
4415
|
+
case "h": return p(1);
|
|
4416
|
+
case "hh": return p(2);
|
|
4417
|
+
case "a": return h(o, s, !0);
|
|
4418
|
+
case "A": return h(o, s, !1);
|
|
4419
|
+
case "m": return String(s);
|
|
4420
|
+
case "mm": return k.s(s, 2, "0");
|
|
4421
|
+
case "s": return String(n.$s);
|
|
4422
|
+
case "ss": return k.s(n.$s, 2, "0");
|
|
4423
|
+
case "SSS": return k.s(n.$ms, 3, "0");
|
|
4424
|
+
case "Z": return a;
|
|
4425
|
+
}
|
|
4426
|
+
return null;
|
|
4427
|
+
}(e) || a.replace(":", "");
|
|
4428
|
+
}));
|
|
4429
|
+
}, y.utcOffset = function() {
|
|
4430
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
4431
|
+
}, y.diff = function(i, p, m) {
|
|
4432
|
+
var h, g = this, v = k.p(p), y = O(i), b = (y.utcOffset() - this.utcOffset()) * n, S = this - y, C = function() {
|
|
4433
|
+
return k.m(g, y);
|
|
4434
|
+
};
|
|
4435
|
+
switch (v) {
|
|
4436
|
+
case f:
|
|
4437
|
+
h = C() / 12;
|
|
4438
|
+
break;
|
|
4439
|
+
case u:
|
|
4440
|
+
h = C();
|
|
4441
|
+
break;
|
|
4442
|
+
case d:
|
|
4443
|
+
h = C() / 3;
|
|
4444
|
+
break;
|
|
4445
|
+
case l:
|
|
4446
|
+
h = (S - b) / 6048e5;
|
|
4447
|
+
break;
|
|
4448
|
+
case c:
|
|
4449
|
+
h = (S - b) / 864e5;
|
|
4450
|
+
break;
|
|
4451
|
+
case s:
|
|
4452
|
+
h = S / r;
|
|
4453
|
+
break;
|
|
4454
|
+
case o:
|
|
4455
|
+
h = S / n;
|
|
4456
|
+
break;
|
|
4457
|
+
case a:
|
|
4458
|
+
h = S / e;
|
|
4459
|
+
break;
|
|
4460
|
+
default: h = S;
|
|
4461
|
+
}
|
|
4462
|
+
return m ? h : k.a(h);
|
|
4463
|
+
}, y.daysInMonth = function() {
|
|
4464
|
+
return this.endOf(u).$D;
|
|
4465
|
+
}, y.$locale = function() {
|
|
4466
|
+
return C[this.$L];
|
|
4467
|
+
}, y.locale = function(e, n) {
|
|
4468
|
+
if (!e) return this.$L;
|
|
4469
|
+
var r = this.clone(), i = D(e, n, !0);
|
|
4470
|
+
return i && (r.$L = i), r;
|
|
4471
|
+
}, y.clone = function() {
|
|
4472
|
+
return k.w(this.$d, this);
|
|
4473
|
+
}, y.toDate = function() {
|
|
4474
|
+
return new Date(this.valueOf());
|
|
4475
|
+
}, y.toJSON = function() {
|
|
4476
|
+
return this.isValid() ? this.toISOString() : null;
|
|
4477
|
+
}, y.toISOString = function() {
|
|
4478
|
+
return this.$d.toISOString();
|
|
4479
|
+
}, y.toString = function() {
|
|
4480
|
+
return this.$d.toUTCString();
|
|
4481
|
+
}, v;
|
|
4482
|
+
}(), j = A.prototype;
|
|
4483
|
+
return O.prototype = j, [
|
|
4484
|
+
["$ms", i],
|
|
4485
|
+
["$s", a],
|
|
4486
|
+
["$m", o],
|
|
4487
|
+
["$H", s],
|
|
4488
|
+
["$W", c],
|
|
4489
|
+
["$M", u],
|
|
4490
|
+
["$y", f],
|
|
4491
|
+
["$D", p]
|
|
4492
|
+
].forEach((function(e) {
|
|
4493
|
+
j[e[1]] = function(n) {
|
|
4494
|
+
return this.$g(n, e[0], e[1]);
|
|
4495
|
+
};
|
|
4496
|
+
})), O.extend = function(e, n) {
|
|
4497
|
+
return e.$i ||= (e(n, A, O), !0), O;
|
|
4498
|
+
}, O.locale = D, O.isDayjs = E, O.unix = function(e) {
|
|
4499
|
+
return O(1e3 * e);
|
|
4500
|
+
}, O.en = C[S], O.Ls = C, O.p = {}, O;
|
|
4501
|
+
}));
|
|
4502
|
+
})), import_dayjs_min$2 = /* @__PURE__ */ __toESM(require_dayjs_min()), content_exports = /* @__PURE__ */ __export({ ContentPage: () => ContentPage }), ContentPage = class {
|
|
4503
|
+
static viewLayout = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/viewLayout");
|
|
4504
|
+
static setViewLayout(e, n) {
|
|
4505
|
+
let r = this.toContentTypeString(e);
|
|
4506
|
+
return this.viewLayout.set(r, n), r;
|
|
4507
|
+
}
|
|
4508
|
+
static getViewLayout(e) {
|
|
4509
|
+
let n = this.toContentTypeString(e);
|
|
4510
|
+
return this.viewLayout.get(n);
|
|
4511
|
+
}
|
|
4512
|
+
static tabbar = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/tabbar");
|
|
4513
|
+
static setTabbar(e, ...n) {
|
|
4514
|
+
this.tabbar.set(e, this.getTabbar(e).concat(n));
|
|
4515
|
+
}
|
|
4516
|
+
static getTabbar(e) {
|
|
4517
|
+
return this.tabbar.get(e) ?? [];
|
|
4518
|
+
}
|
|
4519
|
+
static categories = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/categories");
|
|
4520
|
+
static setCategories(e, ...n) {
|
|
4521
|
+
this.categories.set(e, this.getCategories(e).concat(n));
|
|
4522
|
+
}
|
|
4523
|
+
static getCategories(e) {
|
|
4524
|
+
return this.categories.get(e) ?? [];
|
|
4525
|
+
}
|
|
4526
|
+
static itemCard = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/itemCard");
|
|
4527
|
+
static setItemCard(e, n) {
|
|
4528
|
+
let r = this.toContentTypeString(e);
|
|
4529
|
+
return this.itemCard.set(r, n), r;
|
|
4530
|
+
}
|
|
4531
|
+
static getItemCard(e) {
|
|
4532
|
+
let n = this.toContentTypeString(e);
|
|
4533
|
+
return this.itemCard.get(n);
|
|
4534
|
+
}
|
|
4535
|
+
static contentPage = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/contentPage");
|
|
4536
|
+
static setContentPage(e, n) {
|
|
4537
|
+
this.contentPage.set(this.toContentTypeString(e), n);
|
|
4538
|
+
}
|
|
4539
|
+
static getContentPage(e) {
|
|
4540
|
+
let n = this.toContentTypeString(e), r = this.contentPage.get(n);
|
|
4541
|
+
if (!r) throw Error(`[ContentPage.getContentPage] not found ContentPage (contentType: ${e})`);
|
|
4542
|
+
return r;
|
|
4543
|
+
}
|
|
4544
|
+
static toContentType(e) {
|
|
4545
|
+
if (isString(e)) {
|
|
4546
|
+
let [n, r] = e.split(":");
|
|
4547
|
+
return {
|
|
4548
|
+
name: r,
|
|
4549
|
+
plugin: n
|
|
4550
|
+
};
|
|
4551
|
+
}
|
|
4552
|
+
return e;
|
|
4553
|
+
}
|
|
4554
|
+
static toContentTypeString(e) {
|
|
4555
|
+
return isString(e) ? e : `${e.plugin}:${e.name}`;
|
|
4556
|
+
}
|
|
4557
|
+
constructor(e, n, r) {
|
|
4558
|
+
this.id = n, this.ep = r, this.preload.value = e;
|
|
4559
|
+
}
|
|
4560
|
+
pid = PromiseContent.withResolvers();
|
|
4561
|
+
preload = shallowRef(void 0);
|
|
4562
|
+
detail = PromiseContent.withResolvers();
|
|
4563
|
+
union = computed(() => this.detail.content.data.value ?? this.preload.value);
|
|
4564
|
+
recommends = PromiseContent.withResolvers();
|
|
4565
|
+
eps = PromiseContent.withResolvers();
|
|
4566
|
+
}, ep_exports = /* @__PURE__ */ __export({ Ep: () => Ep }), Ep = class extends Struct {
|
|
4567
|
+
name;
|
|
4568
|
+
index;
|
|
4569
|
+
$$plugin;
|
|
4570
|
+
$$meta;
|
|
4571
|
+
constructor(e) {
|
|
4572
|
+
super(e), this.name = e.name, this.index = e.index, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta;
|
|
4573
|
+
}
|
|
4574
|
+
}, item_exports = /* @__PURE__ */ __export({ Item: () => Item }), Item = class extends Struct {
|
|
4575
|
+
static is(e) {
|
|
4576
|
+
return e instanceof this;
|
|
4577
|
+
}
|
|
4578
|
+
cover;
|
|
4579
|
+
get $cover() {
|
|
4580
|
+
return Image$1.create(this.cover);
|
|
4581
|
+
}
|
|
4582
|
+
title;
|
|
4583
|
+
id;
|
|
4584
|
+
categories;
|
|
4585
|
+
author;
|
|
4586
|
+
viewNumber;
|
|
4587
|
+
likeNumber;
|
|
4588
|
+
commentNumber;
|
|
4589
|
+
isLiked;
|
|
4590
|
+
description;
|
|
4591
|
+
updateTime;
|
|
4592
|
+
get $updateTime() {
|
|
4593
|
+
return (0, import_dayjs_min$2.default)(this.updateTime);
|
|
4594
|
+
}
|
|
4595
|
+
contentType;
|
|
4596
|
+
length;
|
|
4597
|
+
epLength;
|
|
4598
|
+
$$plugin;
|
|
4599
|
+
$$meta;
|
|
4600
|
+
thisEp;
|
|
4601
|
+
get $thisEp() {
|
|
4602
|
+
return new Ep(this.thisEp);
|
|
4603
|
+
}
|
|
4604
|
+
constructor(e) {
|
|
4605
|
+
super(e), this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.thisEp = e.thisEp, this.updateTime = e.updateTime, this.cover = e.cover, this.title = e.title, this.id = e.id, this.categories = e.categories, this.author = e.author, this.viewNumber = e.viewNumber, this.likeNumber = e.likeNumber, this.commentNumber = e.commentNumber, this.isLiked = e.isLiked, this.customIsAI = e.customIsAI, this.contentType = ContentPage.toContentType(e.contentType), this.length = e.length, this.epLength = e.epLength, this.description = e.description, this.commentSendable = e.commentSendable;
|
|
4606
|
+
}
|
|
4607
|
+
commentSendable;
|
|
4608
|
+
customIsAI;
|
|
4609
|
+
get $isAi() {
|
|
4610
|
+
let e = (e) => /(^|[\((\[\s【])ai[】\))\]\s]?/gi.test(e);
|
|
4611
|
+
return this.customIsAI || e(this.title) || this.author.some((n) => e(n));
|
|
4612
|
+
}
|
|
4613
|
+
}, comment_exports = /* @__PURE__ */ __export({ Comment: () => Comment }), import_dayjs_min$1 = /* @__PURE__ */ __toESM(require_dayjs_min()), Comment = class extends Struct {
|
|
4614
|
+
static commentRow = shallowReactive(/* @__PURE__ */ new Map());
|
|
4615
|
+
static setCommentRow(e, n) {
|
|
4616
|
+
let r = uni.content.ContentPage.toContentTypeString(e);
|
|
4617
|
+
return this.commentRow.set(r, n), r;
|
|
4618
|
+
}
|
|
4619
|
+
static getCommentRow(e) {
|
|
4620
|
+
let n = uni.content.ContentPage.toContentTypeString(e);
|
|
4621
|
+
return this.commentRow.get(n);
|
|
4622
|
+
}
|
|
4623
|
+
constructor(e) {
|
|
4624
|
+
super(e), this.content = e.content, this.time = e.time, this.id = e.id, this.childrenCount = e.childrenCount, this.likeCount = e.likeCount, this.isLiked = e.isLiked, this.reported = e.reported, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.isTop = e.isTop;
|
|
4625
|
+
}
|
|
4626
|
+
content;
|
|
4627
|
+
time;
|
|
4628
|
+
$time() {
|
|
4629
|
+
return (0, import_dayjs_min$1.default)(this.time);
|
|
4630
|
+
}
|
|
4631
|
+
id;
|
|
4632
|
+
childrenCount;
|
|
4633
|
+
likeCount;
|
|
4634
|
+
isTop;
|
|
4635
|
+
isLiked;
|
|
4636
|
+
reported;
|
|
4637
|
+
$$plugin;
|
|
4638
|
+
$$meta;
|
|
4639
|
+
}, user_exports = /* @__PURE__ */ __export({ User: () => User }), User = class {
|
|
4640
|
+
static userBase = shallowReactive(/* @__PURE__ */ new Map());
|
|
4641
|
+
static userEditorBase = shallowReactive(/* @__PURE__ */ new Map());
|
|
4642
|
+
constructor(e) {
|
|
4643
|
+
e.avatar && (this.avatar = Image$1.create(e.avatar)), this.name = e.name, this.id = e.id;
|
|
4644
|
+
}
|
|
4645
|
+
avatar;
|
|
4646
|
+
name;
|
|
4647
|
+
id;
|
|
4648
|
+
};
|
|
4649
|
+
let uni;
|
|
4650
|
+
(function(e) {
|
|
4651
|
+
e.user = user_exports, e.comment = comment_exports, e.content = content_exports, e.image = image_exports$1, e.item = item_exports, e.ep = ep_exports;
|
|
4652
|
+
})(uni ||= {});
|
|
4653
|
+
var _hoisted_1 = ["disabled"], _hoisted_2 = { class: "flex absolute flex-col w-[calc(70%-14px)] h-[calc(100%-8px)] *:text-justify right-2" }, _hoisted_3 = { class: "van-multi-ellipsis--l2" }, _hoisted_4 = { class: "absolute bottom-2 text-(--van-text-color-2) text-sm" }, _hoisted_5 = ["disabled"], _hoisted_6 = { class: "w-full flex items-center relative" }, _hoisted_7 = { class: "absolute w-full h-6 !text-[10px] text-white bg-[linear-gradient(transparent,rgba(0,0,0,0.9))] bottom-0 flex pb-0.5 gap-1 pl-1 items-end justify-start *:flex *:items-center" }, _hoisted_8 = { class: "w-full overflow-hidden p-1 flex flex-col text-(--van-text-color)" }, _hoisted_9 = { class: "flex flex-nowrap" }, _hoisted_10 = { class: "text-start text-sm" }, _hoisted_11 = { class: "my-1 w-full h-auto flex-nowrap flex items-center" }, unitCard_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4654
|
+
__name: "unitCard",
|
|
4655
|
+
props: {
|
|
4656
|
+
item: {},
|
|
4657
|
+
freeHeight: { type: Boolean },
|
|
4658
|
+
disabled: { type: Boolean },
|
|
4659
|
+
type: { default: "default" },
|
|
4660
|
+
class: {},
|
|
4661
|
+
style: { type: [
|
|
4662
|
+
Boolean,
|
|
4663
|
+
null,
|
|
4664
|
+
String,
|
|
4665
|
+
Object,
|
|
4666
|
+
Array
|
|
4667
|
+
] }
|
|
4668
|
+
},
|
|
4669
|
+
emits: ["click"],
|
|
4670
|
+
setup(n, { emit: r }) {
|
|
4671
|
+
useCssVars((e) => ({ a7da52b2: h.value }));
|
|
4672
|
+
let d = n, f = r, p = useTemplateRef("cover"), m = computed(() => uni.item.Item.is(d.item) ? d.item.$cover : uni.image.Image.create(d.item.cover)), h = computed(() => p.value?.isLoaded ? "unset" : `${m.value.aspect?.width || 3} / ${m.value.aspect?.height || 4}`), [g, v] = /* @__PURE__ */ createReusableTemplate(), y = () => {
|
|
4673
|
+
SharedFunction.callWitch("addRecent", "core", d.item);
|
|
4674
|
+
};
|
|
4675
|
+
return (n, r) => {
|
|
4676
|
+
let i = NIcon, h = NButton, b = NPopconfirm;
|
|
4677
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(g), null, {
|
|
4678
|
+
default: withCtx(() => [createVNode(b, { onPositiveClick: y }, {
|
|
4679
|
+
trigger: withCtx(() => [createVNode(h, {
|
|
4680
|
+
onClick: r[0] ||= withModifiers(() => {}, ["stop"]),
|
|
4681
|
+
text: "",
|
|
4682
|
+
class: "!absolute bottom-2 right-2"
|
|
4683
|
+
}, {
|
|
4684
|
+
default: withCtx(() => [createVNode(i, {
|
|
4685
|
+
color: "var(--van-text-color-2)",
|
|
4686
|
+
size: "1rem"
|
|
4687
|
+
}, {
|
|
4688
|
+
default: withCtx(() => [createVNode(unref(MoreVertRound_default))]),
|
|
4689
|
+
_: 1
|
|
4690
|
+
})]),
|
|
4691
|
+
_: 1
|
|
4692
|
+
})]),
|
|
4693
|
+
default: withCtx(() => [r[3] ||= createTextVNode(" 加入\"稍后再看\"? ", -1)]),
|
|
4694
|
+
_: 1
|
|
4695
|
+
})]),
|
|
4696
|
+
_: 1
|
|
4697
|
+
}), n.type == "small" ? (openBlock(), createElementBlock("div", {
|
|
4698
|
+
key: 1,
|
|
4699
|
+
style: normalizeStyle([{ height: n.freeHeight ? "auto" : "140px" }, n.style]),
|
|
4700
|
+
onClick: r[2] ||= (e) => f("click"),
|
|
4701
|
+
disabled: n.disabled,
|
|
4702
|
+
class: normalizeClass([[{ "van-haptics-feedback": !n.disabled }, d.class], "overflow-hidden w-full rounded-lg block van-hairline--top-bottom bg-center bg-(--van-background-2) text-(--van-text-color) border-none relative p-0 items-center"]),
|
|
4703
|
+
ref: "container"
|
|
4704
|
+
}, [
|
|
4705
|
+
createElementVNode("div", _hoisted_6, [n.$slots.cover ? createCommentVNode("", !0) : (openBlock(), createBlock(image_default, {
|
|
4706
|
+
key: 0,
|
|
4707
|
+
src: m.value,
|
|
4708
|
+
class: "rounded-t-lg w-full image-size",
|
|
4709
|
+
fit: "cover",
|
|
4710
|
+
ref_key: "cover",
|
|
4711
|
+
ref: p
|
|
4712
|
+
}, null, 8, ["src"])), createElementVNode("div", _hoisted_7, [renderSlot(n.$slots, "smallTopInfo", {}, void 0, !0)])]),
|
|
4713
|
+
createElementVNode("div", _hoisted_8, [createElementVNode("div", _hoisted_9, [createElementVNode("span", _hoisted_10, toDisplayString(n.item.title), 1)]), createElementVNode("div", _hoisted_11, [renderSlot(n.$slots, "default", {}, void 0, !0)])]),
|
|
4714
|
+
createVNode(unref(v))
|
|
4715
|
+
], 14, _hoisted_5)) : (openBlock(), createElementBlock("div", {
|
|
4716
|
+
key: 0,
|
|
4717
|
+
ref: "container",
|
|
4718
|
+
onClick: r[1] ||= (e) => f("click"),
|
|
4719
|
+
disabled: n.disabled,
|
|
4720
|
+
class: normalizeClass(["overflow-hidden w-full van-hairline--top-bottom bg-(--van-background-2) text-(--van-text-color) relative p-2 flex", [{ "van-haptics-feedback": !n.disabled }, d.class]]),
|
|
4721
|
+
style: normalizeStyle([{ height: n.freeHeight ? "auto" : "140px" }, n.style])
|
|
4722
|
+
}, [
|
|
4723
|
+
n.type === "big" ? (openBlock(), createBlock(image_default, {
|
|
4724
|
+
key: 0,
|
|
4725
|
+
src: m.value,
|
|
4726
|
+
class: "blur-lg absolute top-0 left-0 w-full h-full",
|
|
4727
|
+
fit: "cover"
|
|
4728
|
+
}, null, 8, ["src"])) : createCommentVNode("", !0),
|
|
4729
|
+
createVNode(image_default, {
|
|
4730
|
+
src: m.value,
|
|
4731
|
+
class: "!rounded-lg image-size z-2 w-3/10",
|
|
4732
|
+
fit: "contain",
|
|
4733
|
+
ref_key: "cover",
|
|
4734
|
+
ref: p
|
|
4735
|
+
}, null, 8, ["src"]),
|
|
4736
|
+
createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(n.item.title), 1), createElementVNode("div", _hoisted_4, [renderSlot(n.$slots, "default", {}, void 0, !0)])]),
|
|
4737
|
+
createVNode(unref(v))
|
|
4738
|
+
], 14, _hoisted_1))], 64);
|
|
4739
|
+
};
|
|
4740
|
+
}
|
|
4741
|
+
}), unitCard_default = /* @__PURE__ */ __plugin_vue_export_helper_default(unitCard_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-631189ad"]]), translate_exports = /* @__PURE__ */ __export({ createDateString: () => createDateString }), import_dayjs_min = /* @__PURE__ */ __toESM(require_dayjs_min());
|
|
4742
|
+
const createDateString = (e = (0, import_dayjs_min.default)()) => {
|
|
4743
|
+
let n = (0, import_dayjs_min.default)(), r = e.isSame(n, "year"), i = r && e.isSame(n, "month"), a = i && e.date() === n.date(), o = i && e.date() === n.date() - 1, s = "";
|
|
4744
|
+
return r || (s += "YYYY年 "), a ? s += "今天 " : o ? s += "昨天 " : s += "M月D日 ", s += "HH:mm", e.format(s);
|
|
4745
|
+
};
|
|
4746
|
+
var message_exports = /* @__PURE__ */ __export({
|
|
4747
|
+
createDialog: () => createDialog,
|
|
4748
|
+
createLoadingMessage: () => createLoadingMessage
|
|
4749
|
+
});
|
|
4750
|
+
const createLoadingMessage = (e = "加载中", n = window.$message) => {
|
|
4751
|
+
let r = computed(() => isRef(e) ? e.value : isFunction(e) ? e() : e), a = n.loading(r.value, { duration: 0 }), o = watch(r, (e) => {
|
|
4752
|
+
a.content = e;
|
|
4753
|
+
}), s = !1;
|
|
4754
|
+
async function c(e, n = !0, r, i) {
|
|
4755
|
+
try {
|
|
4756
|
+
let n = await e;
|
|
4757
|
+
return l.success(r), n;
|
|
4758
|
+
} catch (e) {
|
|
4759
|
+
if (l.fail(i), n) throw e;
|
|
4760
|
+
return;
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
let l = {
|
|
4764
|
+
bind: c,
|
|
4765
|
+
async success(e = "成功!", n = 500) {
|
|
4766
|
+
o(), !(s || !a) && (s = !0, a.type = "success", a.content = e, await delay(n), a.destroy());
|
|
4767
|
+
},
|
|
4768
|
+
async fail(e = "失败!", n = 500) {
|
|
4769
|
+
o(), !(s || !a) && (s = !0, a.type = "error", a.content = e, await delay(n), a.destroy());
|
|
4770
|
+
},
|
|
4771
|
+
async info(e, n = 500) {
|
|
4772
|
+
o(), !(s || !a) && (s = !0, a.type = "info", a.content = e, await delay(n), a.destroy());
|
|
4773
|
+
},
|
|
4774
|
+
destroy() {
|
|
4775
|
+
o(), !(s || !a) && (s = !0, a.destroy());
|
|
4776
|
+
},
|
|
4777
|
+
[Symbol.dispose]() {
|
|
4778
|
+
this.destroy();
|
|
4779
|
+
},
|
|
4780
|
+
instance: a
|
|
4781
|
+
};
|
|
4782
|
+
return l;
|
|
4783
|
+
}, createDialog = (e) => {
|
|
4784
|
+
let n = noop$1, r = noop$1, i = new Promise((e, i) => {
|
|
4785
|
+
n = e, r = i;
|
|
4786
|
+
}), a = shallowRef(!0), [o, s, c] = useZIndex(a);
|
|
4787
|
+
console.log("[createDialog] after useZIndex");
|
|
4788
|
+
let l = watch(o, (e) => m.style.zIndex = e);
|
|
4789
|
+
console.log("[createDialog] after stopStyleWatch");
|
|
4790
|
+
let u = window.$router.beforeEach(() => s ? f() : !0);
|
|
4791
|
+
console.log("[createDialog] after stopRouterBreak");
|
|
4792
|
+
let d = () => (l(), c(), u(), m.destroy(), a.value = !1);
|
|
4793
|
+
console.log("[createDialog] after stop");
|
|
4794
|
+
let f = () => (r(), d(), !1);
|
|
4795
|
+
console.log("[createDialog] after failStop");
|
|
4796
|
+
let p = () => {
|
|
4797
|
+
n(), d();
|
|
4798
|
+
};
|
|
4799
|
+
console.log("[createDialog] after successStop");
|
|
4800
|
+
let m = window.$dialog.create({
|
|
4801
|
+
positiveText: "确定",
|
|
4802
|
+
negativeText: "取消",
|
|
4803
|
+
...e,
|
|
4804
|
+
style: {
|
|
4805
|
+
...e.style ?? {},
|
|
4806
|
+
zIndex: o.value
|
|
4807
|
+
},
|
|
4808
|
+
async onClose() {
|
|
4809
|
+
if (await e.onClose?.() === !1) return !1;
|
|
4810
|
+
a.value = !1, f();
|
|
4811
|
+
},
|
|
4812
|
+
async onPositiveClick(n) {
|
|
4813
|
+
if (await (e.onPositiveClick ?? noop$1)(n) === !1) return !1;
|
|
4814
|
+
p();
|
|
4815
|
+
},
|
|
4816
|
+
async onNegativeClick(n) {
|
|
4817
|
+
let r = await (e.onNegativeClick ?? noop$1)(n);
|
|
4818
|
+
if (r) return r;
|
|
4819
|
+
f();
|
|
4820
|
+
},
|
|
4821
|
+
onEsc() {
|
|
4822
|
+
e.onEsc?.(), f();
|
|
4823
|
+
},
|
|
4824
|
+
onMaskClick(n) {
|
|
4825
|
+
e.onMaskClick?.(n), f();
|
|
4826
|
+
},
|
|
4827
|
+
onAfterLeave() {
|
|
4828
|
+
e.onAfterLeave?.(), d();
|
|
4829
|
+
}
|
|
4830
|
+
});
|
|
4831
|
+
return console.log("[createDialog] after const dialog"), i.ins = m, i;
|
|
4832
|
+
};
|
|
4833
|
+
var defaultConfig = {
|
|
4834
|
+
"app.read.preloadImageNumbers": 2,
|
|
4835
|
+
"app.read.watchFullscreen": !0,
|
|
4836
|
+
"app.read.twoImage": !1,
|
|
4837
|
+
"app.search.showAIProject": !0,
|
|
4838
|
+
"app.darkMode": !1,
|
|
4839
|
+
"app.recordHistory": !0
|
|
4840
|
+
};
|
|
4841
|
+
const useConfig = defineStore("config", (e) => {
|
|
4842
|
+
let n = useLocalStorage("app.config", defaultConfig);
|
|
4843
|
+
n.value = defaultsDeep(n.value, defaultConfig);
|
|
4844
|
+
let r = /* @__PURE__ */ usePreferredDark(), a = computed(() => n.value["app.darkMode"] || r.value), o = e.action((e, n) => useLocalStorage(`${e}.config`, fromPairs(entries(n).map(([n, r]) => [`${e}.${n}`, r]))).value, "useCustomConfig");
|
|
4845
|
+
return {
|
|
4846
|
+
...n.value,
|
|
4847
|
+
isDark: a,
|
|
4848
|
+
$useCustomConfig: o
|
|
4849
|
+
};
|
|
4850
|
+
}), definePlugin = (e) => {
|
|
4851
|
+
if (isFunction(e)) var n = e(window.$$safe$$);
|
|
4852
|
+
else var n = e;
|
|
4853
|
+
console.log("[definePlugin] new plugin defining...", n);
|
|
4854
|
+
let { name: r, content: i, image: a, search: o, user: s } = n;
|
|
4855
|
+
if (i) {
|
|
4856
|
+
for (let [e, n] of entries(i.layout)) ContentPage.setViewLayout(e, n);
|
|
4857
|
+
for (let [e, n] of entries(i.itemCard)) ContentPage.setItemCard(e, n);
|
|
4858
|
+
for (let [e, n] of entries(i.contentPage)) ContentPage.setContentPage(e, n);
|
|
4859
|
+
for (let [e, n] of entries(i.commentRow)) Comment.setCommentRow(e, n);
|
|
4860
|
+
}
|
|
4861
|
+
if (a) {
|
|
4862
|
+
if (a.forks) for (let [e, n] of entries(a.forks)) Image$1.setFork(r, e, n);
|
|
4863
|
+
if (a.process) for (let [e, n] of entries(a.process)) Image$1.setProcess(r, e, n);
|
|
4864
|
+
}
|
|
4865
|
+
if (o) {
|
|
4866
|
+
if (o.categories) for (let e of o.categories) ContentPage.setCategories(r, e);
|
|
4867
|
+
if (o.tabbar) for (let e of o.tabbar) ContentPage.setTabbar(r, e);
|
|
4868
|
+
}
|
|
4869
|
+
s && User.userEditorBase.set(r, s.edit), SharedFunction.callWitch("addPlugin", "core", n);
|
|
4870
|
+
}, Comp = {
|
|
4871
|
+
Await: await_default,
|
|
4872
|
+
Loading: loading_default,
|
|
4873
|
+
Content: content_default,
|
|
4874
|
+
FloatPopup: floatPopup_default,
|
|
4875
|
+
Image: image_default,
|
|
4876
|
+
List: list_default,
|
|
4877
|
+
Popup: popup_default,
|
|
4878
|
+
RouterTab: routerTab_default,
|
|
4879
|
+
Text: text_default,
|
|
4880
|
+
ToggleIcon: toggleIcon_default,
|
|
4881
|
+
Var: var_default,
|
|
4882
|
+
Waterfall: waterfall_default,
|
|
4883
|
+
user: { PreviewUser: previewUser_default },
|
|
4884
|
+
content: { UnitCard: unitCard_default }
|
|
4885
|
+
};
|
|
4886
|
+
let Utils;
|
|
4887
|
+
(function(e) {
|
|
4888
|
+
e.data = data_exports, e.delay = delay_exports, e.eventBus = eventBus_exports, e.image = image_exports, e.layout = layout_exports, e.request = request_exports, e.translate = translate_exports, e.message = message_exports;
|
|
4889
|
+
})(Utils ||= {});
|
|
4890
|
+
const Store = {
|
|
4891
|
+
useTemp,
|
|
4892
|
+
useConfig
|
|
4893
|
+
};
|
|
4894
|
+
export { Comp, Store, Utils, definePlugin, uni };
|
|
4895
|
+
|
|
4896
|
+
//# sourceMappingURL=bundle.js.map
|