@delta-comic/model 0.0.5 → 1.3.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 +1 -1
- package/dist/index.js +141 -461
- package/dist/index.js.map +1 -1
- package/dist/lib/model/comment.d.ts +4 -6
- package/dist/lib/model/content.d.ts +17 -23
- package/dist/lib/model/download.d.ts +3 -1
- package/dist/lib/model/ep.d.ts +5 -7
- package/dist/lib/model/image.d.ts +4 -6
- package/dist/lib/model/item.d.ts +11 -15
- package/dist/lib/model/resource.d.ts +3 -5
- package/dist/lib/model/user.d.ts +6 -4
- package/dist/lib/struct/index.d.ts +1 -3
- package/dist/lib/struct/meta.d.ts +12 -0
- package/dist/lib/struct/store.d.ts +6 -5
- package/dist/pack.tgz +0 -0
- package/package.json +12 -15
- package/dist/index.umd.cjs +0 -2
- package/dist/index.umd.cjs.map +0 -1
- package/dist/lib/struct/promise.d.ts +0 -49
- package/dist/lib/struct/stream.d.ts +0 -83
package/dist/index.js
CHANGED
|
@@ -1,169 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
var
|
|
1
|
+
import { shallowReactive as e } from "vue";
|
|
2
|
+
import { useGlobalVar as t } from "@delta-comic/utils";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var n = Object.create, r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.getPrototypeOf, s = Object.prototype.hasOwnProperty, c = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), l = (e, t) => {
|
|
5
5
|
let n = {};
|
|
6
|
-
for (var
|
|
7
|
-
get: e[
|
|
6
|
+
for (var i in e) r(n, i, {
|
|
7
|
+
get: e[i],
|
|
8
8
|
enumerable: !0
|
|
9
9
|
});
|
|
10
|
-
return t ||
|
|
11
|
-
},
|
|
12
|
-
if (t && typeof t == "object" || typeof t == "function") for (var
|
|
13
|
-
get: ((e) => t[e]).bind(null,
|
|
14
|
-
enumerable: !(
|
|
10
|
+
return t || r(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
11
|
+
}, u = (e, t, n, o) => {
|
|
12
|
+
if (t && typeof t == "object" || typeof t == "function") for (var c = a(t), l = 0, u = c.length, d; l < u; l++) d = c[l], !s.call(e, d) && d !== n && r(e, d, {
|
|
13
|
+
get: ((e) => t[e]).bind(null, d),
|
|
14
|
+
enumerable: !(o = i(t, d)) || o.enumerable
|
|
15
15
|
});
|
|
16
16
|
return e;
|
|
17
|
-
},
|
|
17
|
+
}, d = (e, t, i) => (i = e == null ? {} : n(o(e)), u(t || !e || !e.__esModule ? r(i, "default", {
|
|
18
18
|
value: e,
|
|
19
19
|
enumerable: !0
|
|
20
|
-
}) :
|
|
21
|
-
|
|
20
|
+
}) : i, e));
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
23
|
+
function f(e) {
|
|
22
24
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
28
|
+
function p(e) {
|
|
25
29
|
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function C(e) {
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isLength.mjs
|
|
33
|
+
function m(e) {
|
|
31
34
|
return Number.isSafeInteger(e) && e >= 0;
|
|
32
35
|
}
|
|
33
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isString.mjs
|
|
38
|
+
function h(e) {
|
|
34
39
|
return typeof e == "string";
|
|
35
40
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function E(e) {
|
|
40
|
-
return typeof e == "object" && !!e && x(e) === "[object Arguments]";
|
|
41
|
-
}
|
|
42
|
-
function D(e) {
|
|
43
|
-
return typeof e == "string" || e instanceof String;
|
|
44
|
-
}
|
|
45
|
-
function O(e) {
|
|
46
|
-
let t = e?.constructor;
|
|
47
|
-
return e === (typeof t == "function" ? t.prototype : Object.prototype);
|
|
48
|
-
}
|
|
49
|
-
function k(e) {
|
|
50
|
-
return b(e);
|
|
51
|
-
}
|
|
52
|
-
function A(e) {
|
|
53
|
-
if (e == null) return !0;
|
|
54
|
-
if (T(e)) return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !k(e) && !E(e) ? !1 : e.length === 0;
|
|
55
|
-
if (typeof e == "object") {
|
|
56
|
-
if (e instanceof Map || e instanceof Set) return e.size === 0;
|
|
57
|
-
let t = Object.keys(e);
|
|
58
|
-
return O(e) ? t.filter((e) => e !== "constructor").length === 0 : t.length === 0;
|
|
59
|
-
}
|
|
60
|
-
return !0;
|
|
61
|
-
}
|
|
62
|
-
function j(e) {
|
|
63
|
-
return {
|
|
64
|
-
all: e ||= new Map(),
|
|
65
|
-
on: function(t, n) {
|
|
66
|
-
var r = e.get(t);
|
|
67
|
-
r ? r.push(n) : e.set(t, [n]);
|
|
68
|
-
},
|
|
69
|
-
off: function(t, n) {
|
|
70
|
-
var r = e.get(t);
|
|
71
|
-
r && (n ? r.splice(r.indexOf(n) >>> 0, 1) : e.set(t, []));
|
|
72
|
-
},
|
|
73
|
-
emit: function(t, n) {
|
|
74
|
-
var r = e.get(t);
|
|
75
|
-
r && r.slice().map(function(e) {
|
|
76
|
-
e(n);
|
|
77
|
-
}), (r = e.get("*")) && r.slice().map(function(e) {
|
|
78
|
-
e(t, n);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
var M = class t {
|
|
84
|
-
[Symbol.toStringTag] = "PromiseContent";
|
|
85
|
-
static _this;
|
|
86
|
-
static {
|
|
87
|
-
this._this = e(this, "data/PromiseContent");
|
|
88
|
-
}
|
|
89
|
-
static isPromiseContent(e) {
|
|
90
|
-
return e instanceof this._this;
|
|
91
|
-
}
|
|
92
|
-
static fromPromise(e, t = (e) => e) {
|
|
93
|
-
return r(new this._this(e, t));
|
|
94
|
-
}
|
|
95
|
-
constructor(e, t = (e) => e) {
|
|
96
|
-
this.promise = e, this.processor = t, this.loadPromise(e);
|
|
97
|
-
}
|
|
98
|
-
async loadPromise(e) {
|
|
99
|
-
this.data.value = void 0, this.isLoading.value = !0, this.isError.value = !1, this.errorCause.value = void 0, this.isEmpty.value = !0;
|
|
100
|
-
try {
|
|
101
|
-
let t = await e;
|
|
102
|
-
this.data.value = this.processor(t), this.isLoading.value = !1, this.isError.value = !1, this.isEmpty.value = A(t), this.emitter.emit("success", this.data.value);
|
|
103
|
-
} catch (e) {
|
|
104
|
-
this.data.value = void 0, this.isError.value = !0, this.errorCause.value = S(e) ? e : Error(String(e)), console.error("Non-throw Error [PromiseContent]", e), this.emitter.emit("error", e);
|
|
105
|
-
}
|
|
106
|
-
this.emitter.emit("finial", void 0);
|
|
107
|
-
}
|
|
108
|
-
emitter = j();
|
|
109
|
-
onError(e) {
|
|
110
|
-
return this.emitter.on("error", e), () => this.emitter.off("error", e);
|
|
111
|
-
}
|
|
112
|
-
onSuccess(e) {
|
|
113
|
-
return this.emitter.on("success", e), () => this.emitter.off("success", e);
|
|
114
|
-
}
|
|
115
|
-
onFinal(e) {
|
|
116
|
-
return this.emitter.on("finial", e), () => this.emitter.off("finial", e);
|
|
117
|
-
}
|
|
118
|
-
setProcessor(e) {
|
|
119
|
-
return t.fromPromise(this.promise, e);
|
|
120
|
-
}
|
|
121
|
-
catch(e) {
|
|
122
|
-
return this.promise.catch(e);
|
|
123
|
-
}
|
|
124
|
-
then(e, t) {
|
|
125
|
-
return this.promise.then(e, t);
|
|
126
|
-
}
|
|
127
|
-
finally(e) {
|
|
128
|
-
return this.promise.finally(e);
|
|
129
|
-
}
|
|
130
|
-
data = s();
|
|
131
|
-
isLoading = s(!0);
|
|
132
|
-
isError = s(!1);
|
|
133
|
-
errorCause = s();
|
|
134
|
-
isEmpty = s(!0);
|
|
135
|
-
static fromAsyncFunction(e) {
|
|
136
|
-
return (...t) => this.fromPromise(e(...t));
|
|
137
|
-
}
|
|
138
|
-
static resolve(e) {
|
|
139
|
-
let t = this.fromPromise(Promise.resolve(e));
|
|
140
|
-
return t.isLoading.value = !1, t;
|
|
141
|
-
}
|
|
142
|
-
static withResolvers(e = !1) {
|
|
143
|
-
let t = Promise.withResolvers(), n = new this._this(t.promise);
|
|
144
|
-
return n.isLoading.value = e, {
|
|
145
|
-
content: n,
|
|
146
|
-
reject: (e) => {
|
|
147
|
-
t.reject(e);
|
|
148
|
-
},
|
|
149
|
-
resolve: (e) => {
|
|
150
|
-
t.resolve(e);
|
|
151
|
-
},
|
|
152
|
-
reset(e = !1) {
|
|
153
|
-
t = Promise.withResolvers(), n.loadPromise(t.promise), n.isLoading.value = e;
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}, N = class {
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region lib/struct/store.ts
|
|
43
|
+
var g = class {
|
|
158
44
|
toJSON(e) {
|
|
159
|
-
return
|
|
45
|
+
return h(e) ? this.parse(e) : e;
|
|
160
46
|
}
|
|
161
47
|
parse(e) {
|
|
162
48
|
let t = e.split(this.separator);
|
|
163
49
|
return [t[0], t.slice(1).join(this.separator)];
|
|
164
50
|
}
|
|
165
51
|
toString(e) {
|
|
166
|
-
return
|
|
52
|
+
return h(e) ? e : this.stringify(e);
|
|
167
53
|
}
|
|
168
54
|
stringify(e) {
|
|
169
55
|
return e.join(this.separator);
|
|
@@ -171,14 +57,15 @@ var M = class t {
|
|
|
171
57
|
constructor(e = ":") {
|
|
172
58
|
this.separator = e;
|
|
173
59
|
}
|
|
174
|
-
},
|
|
175
|
-
static
|
|
176
|
-
return
|
|
60
|
+
}, _ = class {
|
|
61
|
+
static createReactive(t = ":") {
|
|
62
|
+
return e(new this(t));
|
|
177
63
|
}
|
|
178
64
|
constructor(e = ":") {
|
|
179
|
-
|
|
65
|
+
this.key = new g(e);
|
|
180
66
|
}
|
|
181
|
-
|
|
67
|
+
key;
|
|
68
|
+
store = e(/* @__PURE__ */ new Map());
|
|
182
69
|
get size() {
|
|
183
70
|
return this.store.size;
|
|
184
71
|
}
|
|
@@ -187,7 +74,7 @@ var M = class t {
|
|
|
187
74
|
this.store.clear();
|
|
188
75
|
}
|
|
189
76
|
delete(e) {
|
|
190
|
-
return this.store.delete(this.toString(e));
|
|
77
|
+
return this.store.delete(this.key.toString(e));
|
|
191
78
|
}
|
|
192
79
|
forEach(e, t) {
|
|
193
80
|
this.store.forEach((n, r) => {
|
|
@@ -195,13 +82,13 @@ var M = class t {
|
|
|
195
82
|
});
|
|
196
83
|
}
|
|
197
84
|
get(e) {
|
|
198
|
-
return this.store.get(this.toString(e));
|
|
85
|
+
return this.store.get(this.key.toString(e));
|
|
199
86
|
}
|
|
200
87
|
has(e) {
|
|
201
|
-
return this.store.has(this.toString(e));
|
|
88
|
+
return this.store.has(this.key.toString(e));
|
|
202
89
|
}
|
|
203
90
|
set(e, t) {
|
|
204
|
-
return this.store.set(this.toString(e), t), this;
|
|
91
|
+
return this.store.set(this.key.toString(e), t), this;
|
|
205
92
|
}
|
|
206
93
|
entries() {
|
|
207
94
|
return this.store.entries();
|
|
@@ -215,252 +102,7 @@ var M = class t {
|
|
|
215
102
|
[Symbol.iterator]() {
|
|
216
103
|
return this.entries();
|
|
217
104
|
}
|
|
218
|
-
}
|
|
219
|
-
function ee(e) {
|
|
220
|
-
return {
|
|
221
|
-
all: e ||= new Map(),
|
|
222
|
-
on: function(t, n) {
|
|
223
|
-
var r = e.get(t);
|
|
224
|
-
r ? r.push(n) : e.set(t, [n]);
|
|
225
|
-
},
|
|
226
|
-
off: function(t, n) {
|
|
227
|
-
var r = e.get(t);
|
|
228
|
-
r && (n ? r.splice(r.indexOf(n) >>> 0, 1) : e.set(t, []));
|
|
229
|
-
},
|
|
230
|
-
emit: function(t, n) {
|
|
231
|
-
var r = e.get(t);
|
|
232
|
-
r && r.slice().map(function(e) {
|
|
233
|
-
e(n);
|
|
234
|
-
}), (r = e.get("*")) && r.slice().map(function(e) {
|
|
235
|
-
e(t, n);
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
var F = class {
|
|
241
|
-
_controller = new AbortController();
|
|
242
|
-
mitt = ee();
|
|
243
|
-
get signal() {
|
|
244
|
-
return this._controller.signal;
|
|
245
|
-
}
|
|
246
|
-
abort(e) {
|
|
247
|
-
this._controller.abort(e), this._controller = new AbortController(), this.mitt.emit("abort");
|
|
248
|
-
}
|
|
249
|
-
onAbort(e) {
|
|
250
|
-
return this.mitt.on("abort", e), () => this.mitt.off("abort", e);
|
|
251
|
-
}
|
|
252
|
-
onAbortOnce(e) {
|
|
253
|
-
let t = async () => {
|
|
254
|
-
await e(), this.mitt.off("abort", t);
|
|
255
|
-
};
|
|
256
|
-
this.mitt.on("abort", t);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
Error, typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
260
|
-
function I(e, t = !1, n = "Timeout") {
|
|
261
|
-
return new Promise((r, i) => {
|
|
262
|
-
t ? setTimeout(() => i(n), e) : setTimeout(r, e);
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
function L(e, t = !1) {
|
|
266
|
-
function r(n, { flush: r = "sync", deep: a = !1, timeout: o, throwOnTimeout: s } = {}) {
|
|
267
|
-
let u = null, d = [new Promise((o) => {
|
|
268
|
-
u = l(e, (e) => {
|
|
269
|
-
n(e) !== t && (u ? u() : i(() => u?.()), o(e));
|
|
270
|
-
}, {
|
|
271
|
-
flush: r,
|
|
272
|
-
deep: a,
|
|
273
|
-
immediate: !0
|
|
274
|
-
});
|
|
275
|
-
})];
|
|
276
|
-
return o != null && d.push(I(o, s).then(() => c(e)).finally(() => u?.())), Promise.race(d);
|
|
277
|
-
}
|
|
278
|
-
function a(a, o) {
|
|
279
|
-
if (!n(a)) return r((e) => e === a, o);
|
|
280
|
-
let { flush: s = "sync", deep: u = !1, timeout: d, throwOnTimeout: f } = o ?? {}, p = null, m = [new Promise((n) => {
|
|
281
|
-
p = l([e, a], ([e, r]) => {
|
|
282
|
-
t !== (e === r) && (p ? p() : i(() => p?.()), n(e));
|
|
283
|
-
}, {
|
|
284
|
-
flush: s,
|
|
285
|
-
deep: u,
|
|
286
|
-
immediate: !0
|
|
287
|
-
});
|
|
288
|
-
})];
|
|
289
|
-
return d != null && m.push(I(d, f).then(() => c(e)).finally(() => (p?.(), c(e)))), Promise.race(m);
|
|
290
|
-
}
|
|
291
|
-
function o(e) {
|
|
292
|
-
return r((e) => !!e, e);
|
|
293
|
-
}
|
|
294
|
-
function s(e) {
|
|
295
|
-
return a(null, e);
|
|
296
|
-
}
|
|
297
|
-
function u(e) {
|
|
298
|
-
return a(void 0, e);
|
|
299
|
-
}
|
|
300
|
-
function d(e) {
|
|
301
|
-
return r(Number.isNaN, e);
|
|
302
|
-
}
|
|
303
|
-
function f(e, t) {
|
|
304
|
-
return r((t) => {
|
|
305
|
-
let n = Array.from(t);
|
|
306
|
-
return n.includes(e) || n.includes(c(e));
|
|
307
|
-
}, t);
|
|
308
|
-
}
|
|
309
|
-
function p(e) {
|
|
310
|
-
return m(1, e);
|
|
311
|
-
}
|
|
312
|
-
function m(e = 1, t) {
|
|
313
|
-
let n = -1;
|
|
314
|
-
return r(() => (n += 1, n >= e), t);
|
|
315
|
-
}
|
|
316
|
-
return Array.isArray(c(e)) ? {
|
|
317
|
-
toMatch: r,
|
|
318
|
-
toContains: f,
|
|
319
|
-
changed: p,
|
|
320
|
-
changedTimes: m,
|
|
321
|
-
get not() {
|
|
322
|
-
return L(e, !t);
|
|
323
|
-
}
|
|
324
|
-
} : {
|
|
325
|
-
toMatch: r,
|
|
326
|
-
toBe: a,
|
|
327
|
-
toBeTruthy: o,
|
|
328
|
-
toBeNull: s,
|
|
329
|
-
toBeNaN: d,
|
|
330
|
-
toBeUndefined: u,
|
|
331
|
-
changed: p,
|
|
332
|
-
changedTimes: m,
|
|
333
|
-
get not() {
|
|
334
|
-
return L(e, !t);
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
function R(e) {
|
|
339
|
-
return L(e);
|
|
340
|
-
}
|
|
341
|
-
var z = new Map(), B = class {
|
|
342
|
-
constructor(e) {
|
|
343
|
-
this.generator = e.bind(this)(this.abortController.signal, this), z.set(this, e);
|
|
344
|
-
}
|
|
345
|
-
static _this;
|
|
346
|
-
static {
|
|
347
|
-
this._this = e(this, "data/Stream");
|
|
348
|
-
}
|
|
349
|
-
static isStream(e) {
|
|
350
|
-
return e instanceof this._this;
|
|
351
|
-
}
|
|
352
|
-
static create(e) {
|
|
353
|
-
return r(new this._this(e));
|
|
354
|
-
}
|
|
355
|
-
abortController = new F();
|
|
356
|
-
generator;
|
|
357
|
-
_setupData = [];
|
|
358
|
-
setupData(e) {
|
|
359
|
-
return this._setupData.push(...e), this.data.value.unshift(...e), this;
|
|
360
|
-
}
|
|
361
|
-
async next(e = !1) {
|
|
362
|
-
try {
|
|
363
|
-
if (e || (await R(this.isRequesting).toBe(!1), this.isRequesting.value = !0), this._isDone) return e || (this.isRequesting.value = !1), {
|
|
364
|
-
done: !0,
|
|
365
|
-
value: void 0
|
|
366
|
-
};
|
|
367
|
-
e && console.log("igRequesting next");
|
|
368
|
-
let { value: t, done: n } = await this.generator.next(this);
|
|
369
|
-
return this.isDone.value = n ?? !1, e || (this.isRequesting.value = !1), n ? {
|
|
370
|
-
done: !0,
|
|
371
|
-
value: void 0
|
|
372
|
-
} : (this.data.value.push(...t), {
|
|
373
|
-
value: t,
|
|
374
|
-
done: n
|
|
375
|
-
});
|
|
376
|
-
} catch (t) {
|
|
377
|
-
throw e || (this.isRequesting.value = !1), this.error.value = t, t;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
async return() {
|
|
381
|
-
return await this.generator.return?.() ?? {
|
|
382
|
-
value: void 0,
|
|
383
|
-
done: !0
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
async throw(e) {
|
|
387
|
-
return await this.generator.throw?.(e) ?? {
|
|
388
|
-
value: void 0,
|
|
389
|
-
done: !0
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
toReadableStream() {
|
|
393
|
-
let e = this;
|
|
394
|
-
return new ReadableStream({ async pull(t) {
|
|
395
|
-
let { value: n, done: r } = await e.next();
|
|
396
|
-
r ? t.close() : t.enqueue(n);
|
|
397
|
-
} });
|
|
398
|
-
}
|
|
399
|
-
reset() {
|
|
400
|
-
this.generator = z.get(this).bind(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;
|
|
401
|
-
}
|
|
402
|
-
async retry() {
|
|
403
|
-
return this.page.value--, this.next();
|
|
404
|
-
}
|
|
405
|
-
async nextToDone() {
|
|
406
|
-
isNaN(this._pages) && await this.next(!0);
|
|
407
|
-
let e = [];
|
|
408
|
-
for (let t = this._page + 1; t <= this._pages; t++) e.push(this.next(!0));
|
|
409
|
-
return await Promise.all(e), this._data;
|
|
410
|
-
}
|
|
411
|
-
stop() {
|
|
412
|
-
this.abortController.abort(), this.isRequesting.value = !1;
|
|
413
|
-
}
|
|
414
|
-
[Symbol.asyncIterator]() {
|
|
415
|
-
return this;
|
|
416
|
-
}
|
|
417
|
-
error = s();
|
|
418
|
-
data = a([]);
|
|
419
|
-
get _data() {
|
|
420
|
-
return this.data.value;
|
|
421
|
-
}
|
|
422
|
-
page = s(0);
|
|
423
|
-
get _page() {
|
|
424
|
-
return this.page.value;
|
|
425
|
-
}
|
|
426
|
-
pages = s(NaN);
|
|
427
|
-
get _pages() {
|
|
428
|
-
return this.pages.value;
|
|
429
|
-
}
|
|
430
|
-
total = s(NaN);
|
|
431
|
-
get _total() {
|
|
432
|
-
return this.total.value;
|
|
433
|
-
}
|
|
434
|
-
pageSize = s(NaN);
|
|
435
|
-
get _pageSize() {
|
|
436
|
-
return this.pageSize.value;
|
|
437
|
-
}
|
|
438
|
-
length = t(() => this.data.value.length);
|
|
439
|
-
get _length() {
|
|
440
|
-
return this.data.value.length;
|
|
441
|
-
}
|
|
442
|
-
isRequesting = s(!1);
|
|
443
|
-
get _isRequesting() {
|
|
444
|
-
return this.isRequesting.value;
|
|
445
|
-
}
|
|
446
|
-
isDone = s(!1);
|
|
447
|
-
get _isDone() {
|
|
448
|
-
return this.isDone.value;
|
|
449
|
-
}
|
|
450
|
-
isNoData = t(() => this.isDone.value && this.isEmpty.value);
|
|
451
|
-
get _isNoData() {
|
|
452
|
-
return this.isNoData.value;
|
|
453
|
-
}
|
|
454
|
-
isEmpty = t(() => this.length.value === 0);
|
|
455
|
-
get _isEmpty() {
|
|
456
|
-
return this.isEmpty.value;
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
const V = (e) => {
|
|
460
|
-
let { resolve: t, promise: n } = Promise.withResolvers();
|
|
461
|
-
return e(t), n;
|
|
462
|
-
};
|
|
463
|
-
var H = class e {
|
|
105
|
+
}, v = class e {
|
|
464
106
|
toJSON() {
|
|
465
107
|
return JSON.parse(JSON.stringify(this.$$raw));
|
|
466
108
|
}
|
|
@@ -470,7 +112,7 @@ var H = class e {
|
|
|
470
112
|
static toRaw(t) {
|
|
471
113
|
return t instanceof e ? t.toJSON() : t;
|
|
472
114
|
}
|
|
473
|
-
},
|
|
115
|
+
}, y = /* @__PURE__ */ c(((e, t) => {
|
|
474
116
|
(function(n, r) {
|
|
475
117
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
476
118
|
})(e, (function() {
|
|
@@ -559,8 +201,8 @@ var H = class e {
|
|
|
559
201
|
return _.parse = function(e) {
|
|
560
202
|
this.$d = function(e) {
|
|
561
203
|
var t = e.date, n = e.utc;
|
|
562
|
-
if (t === null) return new Date(NaN);
|
|
563
|
-
if (T.u(t)) return new Date();
|
|
204
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
205
|
+
if (T.u(t)) return /* @__PURE__ */ new Date();
|
|
564
206
|
if (t instanceof Date) return new Date(t);
|
|
565
207
|
if (typeof t == "string" && !/Z$/i.test(t)) {
|
|
566
208
|
var r = t.match(m);
|
|
@@ -764,15 +406,15 @@ var H = class e {
|
|
|
764
406
|
return w(1e3 * e);
|
|
765
407
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
766
408
|
}));
|
|
767
|
-
})),
|
|
768
|
-
static commentRow =
|
|
409
|
+
})), b = /* @__PURE__ */ l({ Comment: () => S }), x = /* @__PURE__ */ d(y(), 1), S = class extends v {
|
|
410
|
+
static commentRow = _.createReactive();
|
|
769
411
|
constructor(e) {
|
|
770
412
|
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;
|
|
771
413
|
}
|
|
772
414
|
content;
|
|
773
415
|
time;
|
|
774
416
|
get $time() {
|
|
775
|
-
return (0,
|
|
417
|
+
return (0, x.default)(this.time);
|
|
776
418
|
}
|
|
777
419
|
id;
|
|
778
420
|
childrenCount;
|
|
@@ -782,18 +424,59 @@ var H = class e {
|
|
|
782
424
|
reported;
|
|
783
425
|
$$plugin;
|
|
784
426
|
$$meta;
|
|
785
|
-
},
|
|
427
|
+
}, C = /* @__PURE__ */ l({ Ep: () => w }), w = class extends v {
|
|
786
428
|
name;
|
|
787
|
-
|
|
429
|
+
id;
|
|
788
430
|
$$plugin;
|
|
789
431
|
$$meta;
|
|
790
432
|
constructor(e) {
|
|
791
|
-
super(e), this.name = e.name, this.
|
|
433
|
+
super(e), this.name = e.name, this.id = e.id, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta;
|
|
792
434
|
}
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
435
|
+
};
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs
|
|
438
|
+
function T(e) {
|
|
439
|
+
return e != null && typeof e != "function" && m(e.length);
|
|
440
|
+
}
|
|
441
|
+
//#endregion
|
|
442
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs
|
|
443
|
+
function E(e) {
|
|
444
|
+
return typeof e == "object" && !!e && p(e) === "[object Arguments]";
|
|
445
|
+
}
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isString.mjs
|
|
448
|
+
function D(e) {
|
|
449
|
+
return typeof e == "string" || e instanceof String;
|
|
450
|
+
}
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs
|
|
453
|
+
function O(e) {
|
|
454
|
+
let t = e?.constructor;
|
|
455
|
+
return e === (typeof t == "function" ? t.prototype : Object.prototype);
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs
|
|
459
|
+
function k(e) {
|
|
460
|
+
return f(e);
|
|
461
|
+
}
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isEmpty.mjs
|
|
464
|
+
function A(e) {
|
|
465
|
+
if (e == null) return !0;
|
|
466
|
+
if (T(e)) return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !k(e) && !E(e) ? !1 : e.length === 0;
|
|
467
|
+
if (typeof e == "object") {
|
|
468
|
+
if (e instanceof Map || e instanceof Set) return e.size === 0;
|
|
469
|
+
let t = Object.keys(e);
|
|
470
|
+
return O(e) ? t.filter((e) => e !== "constructor").length === 0 : t.length === 0;
|
|
471
|
+
}
|
|
472
|
+
return !0;
|
|
473
|
+
}
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region lib/model/resource.ts
|
|
476
|
+
var j = /* @__PURE__ */ l({ Resource: () => M }), M = class n extends v {
|
|
477
|
+
static processInstances = t(_.createReactive(), "uni/resource/processInstances");
|
|
478
|
+
static fork = t(_.createReactive(), "uni/resource/fork");
|
|
479
|
+
static precedenceFork = t(_.createReactive(), "uni/resource/precedenceFork");
|
|
797
480
|
static is(e) {
|
|
798
481
|
return e instanceof this;
|
|
799
482
|
}
|
|
@@ -813,30 +496,30 @@ var H = class e {
|
|
|
813
496
|
$$plugin;
|
|
814
497
|
async getUrl() {
|
|
815
498
|
let e = this.pathname;
|
|
816
|
-
for (let
|
|
817
|
-
let r =
|
|
499
|
+
for (let t of this.processSteps) {
|
|
500
|
+
let r = n.processInstances.get([this.$$plugin, t.referenceName]);
|
|
818
501
|
if (!r) {
|
|
819
|
-
console.warn(`[Resource.getUrl] process not found, fullname: [${this.$$plugin}, ${
|
|
502
|
+
console.warn(`[Resource.getUrl] process not found, fullname: [${this.$$plugin}, ${t.referenceName}]`);
|
|
820
503
|
continue;
|
|
821
504
|
}
|
|
822
505
|
let i = await r(e, this);
|
|
823
|
-
if (e = i[0], !(
|
|
506
|
+
if (e = i[0], !(t.ignoreExit || !i[1])) break;
|
|
824
507
|
}
|
|
825
508
|
return URL.canParse(e) ? e : `${this.getThisFork()}/${e}`;
|
|
826
509
|
}
|
|
827
|
-
omittedForks =
|
|
510
|
+
omittedForks = e(/* @__PURE__ */ new Set());
|
|
828
511
|
getThisFork() {
|
|
829
|
-
let e = new Set(
|
|
830
|
-
if (
|
|
831
|
-
return
|
|
512
|
+
let e = new Set(n.fork.get([this.$$plugin, this.type])?.urls ?? []), t;
|
|
513
|
+
if (t = A(this.omittedForks) ? n.precedenceFork.get([this.$$plugin, this.type]) : Array.from(e.difference(this.omittedForks).values())[0], !t) throw Error(`[Resource.getThisFork] fork not found, type: [${this.$$plugin}, ${this.type}]`);
|
|
514
|
+
return t;
|
|
832
515
|
}
|
|
833
516
|
localChangeFork() {
|
|
834
|
-
let e = new Set(
|
|
517
|
+
let e = new Set(n.fork.get([this.$$plugin, this.type])?.urls ?? []);
|
|
835
518
|
this.omittedForks.add(this.getThisFork());
|
|
836
|
-
let
|
|
837
|
-
return
|
|
519
|
+
let t = A(e.difference(this.omittedForks));
|
|
520
|
+
return t && this.omittedForks.clear(), t;
|
|
838
521
|
}
|
|
839
|
-
},
|
|
522
|
+
}, N = /* @__PURE__ */ l({ Image: () => P }), P = class extends M {
|
|
840
523
|
static is(e) {
|
|
841
524
|
return e instanceof this;
|
|
842
525
|
}
|
|
@@ -848,7 +531,7 @@ var H = class e {
|
|
|
848
531
|
$$plugin: e.$$plugin,
|
|
849
532
|
$$meta: {
|
|
850
533
|
...e.$$meta,
|
|
851
|
-
|
|
534
|
+
aspect: t
|
|
852
535
|
},
|
|
853
536
|
pathname: e.path,
|
|
854
537
|
type: e.forkNamespace,
|
|
@@ -856,26 +539,26 @@ var H = class e {
|
|
|
856
539
|
}) : super(e);
|
|
857
540
|
}
|
|
858
541
|
get aspect() {
|
|
859
|
-
return this.$$meta;
|
|
542
|
+
return this.$$meta.aspect;
|
|
860
543
|
}
|
|
861
544
|
set aspect(e) {
|
|
862
|
-
this.$$meta ??= {}, this.$$meta.width = e.width, this.$$meta.height = e.height;
|
|
545
|
+
e && (this.$$meta ??= {}, this.$$meta.aspect ??= {}, this.$$meta.aspect.width = e.width, this.$$meta.aspect.height = e.height);
|
|
863
546
|
}
|
|
864
|
-
},
|
|
865
|
-
static itemTranslator =
|
|
547
|
+
}, F = /* @__PURE__ */ l({ Item: () => I }), I = class extends v {
|
|
548
|
+
static itemTranslator = _.createReactive();
|
|
866
549
|
static create(e) {
|
|
867
550
|
let t = this.itemTranslator.get(e.contentType);
|
|
868
|
-
if (!t) throw Error(`can not found itemTranslator contentType:"${
|
|
551
|
+
if (!t) throw Error(`can not found itemTranslator contentType:"${R.contentPages.key.toString(e.contentType)}"`);
|
|
869
552
|
return t(e);
|
|
870
553
|
}
|
|
871
|
-
static authorIcon =
|
|
872
|
-
static
|
|
554
|
+
static authorIcon = _.createReactive();
|
|
555
|
+
static itemCards = t(_.createReactive(), "uni/item/itemCards");
|
|
873
556
|
static is(e) {
|
|
874
557
|
return e instanceof this;
|
|
875
558
|
}
|
|
876
559
|
cover;
|
|
877
560
|
get $cover() {
|
|
878
|
-
return
|
|
561
|
+
return P.create(this.cover);
|
|
879
562
|
}
|
|
880
563
|
title;
|
|
881
564
|
id;
|
|
@@ -888,7 +571,7 @@ var H = class e {
|
|
|
888
571
|
description;
|
|
889
572
|
updateTime;
|
|
890
573
|
get $updateTime() {
|
|
891
|
-
return (0,
|
|
574
|
+
return (0, x.default)(this.updateTime);
|
|
892
575
|
}
|
|
893
576
|
contentType;
|
|
894
577
|
length;
|
|
@@ -898,10 +581,10 @@ var H = class e {
|
|
|
898
581
|
thisEp;
|
|
899
582
|
customIsSafe;
|
|
900
583
|
get $thisEp() {
|
|
901
|
-
return new
|
|
584
|
+
return new w(this.thisEp);
|
|
902
585
|
}
|
|
903
586
|
constructor(e) {
|
|
904
|
-
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 =
|
|
587
|
+
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 = R.contentPages.key.toJSON(e.contentType), this.length = e.length, this.epLength = e.epLength, this.description = e.description, this.commentSendable = e.commentSendable, this.customIsSafe = e.customIsSafe;
|
|
905
588
|
}
|
|
906
589
|
commentSendable;
|
|
907
590
|
customIsAI;
|
|
@@ -909,38 +592,35 @@ var H = class e {
|
|
|
909
592
|
let e = (e) => /(^|[\((\[\s【])ai[】\))\]\s]?/gi.test(e);
|
|
910
593
|
return this.customIsAI || e(this.title) || this.author.some((t) => e(`${t.label}\u1145${t.description}`));
|
|
911
594
|
}
|
|
912
|
-
},
|
|
913
|
-
static
|
|
914
|
-
static
|
|
595
|
+
}, L = /* @__PURE__ */ l({ ContentPage: () => R }), R = class {
|
|
596
|
+
static layouts = t(_.createReactive(), "uni/contentPage/layouts");
|
|
597
|
+
static contentPages = t(_.createReactive(), "uni/contentPage/contentPages");
|
|
915
598
|
constructor(e, t, n) {
|
|
916
|
-
this.
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
recommends = M.withResolvers();
|
|
923
|
-
eps = M.withResolvers();
|
|
924
|
-
}, ie = _({ Downloader: () => ae }), ae = class {}, oe = _({ User: () => se }), se = class {
|
|
925
|
-
static userBase = o(new Map());
|
|
926
|
-
static userEditorBase = o(new Map());
|
|
599
|
+
this.preload = e, this.id = t, this.ep = n;
|
|
600
|
+
}
|
|
601
|
+
}, z = /* @__PURE__ */ l({ Downloader: () => B }), B = class {}, V = /* @__PURE__ */ l({ User: () => H }), H = class {
|
|
602
|
+
static userBase = e(/* @__PURE__ */ new Map());
|
|
603
|
+
static userEditorBase = e(/* @__PURE__ */ new Map());
|
|
604
|
+
static userCards = e(/* @__PURE__ */ new Map());
|
|
927
605
|
constructor(e) {
|
|
928
|
-
e.avatar && (this.avatar =
|
|
606
|
+
e.avatar && (this.avatar = P.create(e.avatar)), this.name = e.name, this.id = e.id, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta;
|
|
929
607
|
}
|
|
930
608
|
avatar;
|
|
931
609
|
name;
|
|
932
610
|
id;
|
|
933
611
|
$$plugin;
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
612
|
+
$$meta;
|
|
613
|
+
}, U = /* @__PURE__ */ l({
|
|
614
|
+
comment: () => b,
|
|
615
|
+
content: () => L,
|
|
616
|
+
download: () => z,
|
|
617
|
+
ep: () => C,
|
|
618
|
+
image: () => N,
|
|
619
|
+
item: () => F,
|
|
620
|
+
resource: () => j,
|
|
621
|
+
user: () => V
|
|
943
622
|
});
|
|
944
|
-
|
|
623
|
+
//#endregion
|
|
624
|
+
export { _ as SourcedKeyMap, g as SourcedValue, v as Struct, U as uni };
|
|
945
625
|
|
|
946
626
|
//# sourceMappingURL=index.js.map
|