@inpageedit/core 0.9.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +62 -55
- package/dist/ActionButton-BgbTKTg7.js.map +1 -1
- package/dist/CheckBox-D3rHnX7I.js.map +1 -1
- package/dist/IconQuickEdit-CAL1HXIb.js.map +1 -1
- package/dist/InputBox-BV4m05Xs.js.map +1 -1
- package/dist/PluginPrefSync-PIoKRRu2.js +254 -0
- package/dist/PluginPrefSync-PIoKRRu2.js.map +1 -0
- package/dist/Preferences-DS4-CFWe.js.map +1 -1
- package/dist/RadioBox-nJqWsxW2.js.map +1 -1
- package/dist/__test__/utils/constants.d.ts +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/endpoints.d.ts +1 -1
- package/dist/{index-D968kDLW.js → index-B5vDBMEh.js} +44 -38
- package/dist/index-B5vDBMEh.js.map +1 -0
- package/dist/{index-DRaYlg2d.js → index-BP-e8PeH.js} +2 -2
- package/dist/{index-DRaYlg2d.js.map → index-BP-e8PeH.js.map} +1 -1
- package/dist/{index-D8zKl2eU.js → index-BVkdBJNf.js} +6 -2
- package/dist/index-BVkdBJNf.js.map +1 -0
- package/dist/index-Bh70Udzi.js.map +1 -1
- package/dist/{index-BJ2aqva1.js → index-BjwVNZ_h.js} +46 -35
- package/dist/index-BjwVNZ_h.js.map +1 -0
- package/dist/{index-CMuITxgX.js → index-BzCqww16.js} +22 -21
- package/dist/index-BzCqww16.js.map +1 -0
- package/dist/index-CFb1PSJg.js +185 -0
- package/dist/index-CFb1PSJg.js.map +1 -0
- package/dist/index-CvhkVj_L.js.map +1 -1
- package/dist/{index-CNsfHvio.js → index-D7NpqwUe.js} +148 -110
- package/dist/index-D7NpqwUe.js.map +1 -0
- package/dist/{index-BKxuoVoX.js → index-DFPN4uYd.js} +771 -683
- package/dist/index-DFPN4uYd.js.map +1 -0
- package/dist/index-DGOY4X1J.js +4912 -0
- package/dist/{index-DtLiqtR8.js.map → index-DGOY4X1J.js.map} +1 -1
- package/dist/{index-CiceXP5j.js → index-DKDtc9IF.js} +42 -42
- package/dist/index-DKDtc9IF.js.map +1 -0
- package/dist/index-DkQLtTG0.js +211 -0
- package/dist/index-DkQLtTG0.js.map +1 -0
- package/dist/index-lZkYoUca.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
- package/dist/models/WikiTitle/index.d.ts +2 -2
- package/dist/noop-ClDc6zv4.js.map +1 -1
- package/dist/plugins/analytics/index.d.ts +41 -0
- package/dist/plugins/in-article-links/index.d.ts +14 -0
- package/dist/plugins/preferences-ui/PluginPrefSync.d.ts +27 -0
- package/dist/plugins/preferences-ui/index.d.ts +7 -1
- package/dist/plugins/quick-delete/index.d.ts +3 -0
- package/dist/plugins/quick-diff/index.d.ts +17 -0
- package/dist/plugins/quick-edit/index.d.ts +8 -0
- package/dist/plugins/quick-move/index.d.ts +16 -0
- package/dist/plugins/quick-redirect/index.d.ts +15 -0
- package/dist/plugins/toolbox/index.d.ts +9 -0
- package/dist/services/PreferencesService.d.ts +14 -0
- package/dist/services/WikiMetadataService.d.ts +23 -23
- package/dist/services/storage/IPEStorageManager.d.ts +25 -0
- package/dist/services/storage/index.d.ts +3 -26
- package/dist/style.css +1 -1
- package/dist/types/WikiMetadata.d.ts +6 -8
- package/lib/index.umd.js +27 -20
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +2 -1
- package/dist/index-BJ2aqva1.js.map +0 -1
- package/dist/index-BKxuoVoX.js.map +0 -1
- package/dist/index-CA_JNRF8.js +0 -193
- package/dist/index-CA_JNRF8.js.map +0 -1
- package/dist/index-CMuITxgX.js.map +0 -1
- package/dist/index-CNsfHvio.js.map +0 -1
- package/dist/index-CiceXP5j.js.map +0 -1
- package/dist/index-D8zKl2eU.js.map +0 -1
- package/dist/index-D968kDLW.js.map +0 -1
- package/dist/index-DtLiqtR8.js +0 -4853
- package/dist/services/storage/IDBStorage.d.ts +0 -90
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as H, P as Er } from "./index-CvhkVj_L.js";
|
|
2
2
|
const ot = () => {
|
|
3
3
|
let r, e;
|
|
4
4
|
return { promise: new Promise((i, n) => {
|
|
@@ -6,98 +6,98 @@ const ot = () => {
|
|
|
6
6
|
}), resolve: r, reject: e };
|
|
7
7
|
};
|
|
8
8
|
Promise.withResolvers || (Promise.withResolvers = ot);
|
|
9
|
-
var
|
|
10
|
-
function
|
|
9
|
+
var Or = Object.defineProperty, k = (r, e) => Or(r, "name", { value: e, configurable: !0 });
|
|
10
|
+
function Rr() {
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
function
|
|
12
|
+
k(Rr, "noop");
|
|
13
|
+
function T(r) {
|
|
14
14
|
return r == null;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
return !
|
|
16
|
+
k(T, "isNullable");
|
|
17
|
+
function $r(r) {
|
|
18
|
+
return !T(r);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
function
|
|
20
|
+
k($r, "isNonNullable");
|
|
21
|
+
function Ce(r) {
|
|
22
22
|
return r && typeof r == "object" && !Array.isArray(r);
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
k(Ce, "isPlainObject");
|
|
25
25
|
function Dt(r, e) {
|
|
26
26
|
return Object.fromEntries(Object.entries(r).filter(([t, i]) => e(t, i)));
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
k(Dt, "filterKeys");
|
|
29
29
|
function te(r, e) {
|
|
30
30
|
return Object.fromEntries(Object.entries(r).map(([t, i]) => [t, e(i, t)]));
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
function
|
|
32
|
+
k(te, "mapValues");
|
|
33
|
+
function Nt(r, e, t) {
|
|
34
34
|
if (!e) return { ...r };
|
|
35
35
|
const i = {};
|
|
36
36
|
for (const n of e)
|
|
37
37
|
(t || r[n] !== void 0) && (i[n] = r[n]);
|
|
38
38
|
return i;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
function
|
|
40
|
+
k(Nt, "pick");
|
|
41
|
+
function Ar(r, e) {
|
|
42
42
|
if (!e) return { ...r };
|
|
43
43
|
const t = { ...r };
|
|
44
44
|
for (const i of e)
|
|
45
45
|
Reflect.deleteProperty(t, i);
|
|
46
46
|
return t;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
function
|
|
48
|
+
k(Ar, "omit");
|
|
49
|
+
function N(r, e, t) {
|
|
50
50
|
return Object.defineProperty(r, e, { writable: !0, value: t, enumerable: !1 });
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
function
|
|
52
|
+
k(N, "defineProperty");
|
|
53
|
+
function Pr(r, e) {
|
|
54
54
|
return e.every((t) => r.includes(t));
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
function
|
|
56
|
+
k(Pr, "contain");
|
|
57
|
+
function Ir(r, e) {
|
|
58
58
|
return r.filter((t) => e.includes(t));
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
function
|
|
60
|
+
k(Ir, "intersection");
|
|
61
|
+
function Tr(r, e) {
|
|
62
62
|
return r.filter((t) => !e.includes(t));
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
function
|
|
64
|
+
k(Tr, "difference");
|
|
65
|
+
function Cr(r, e) {
|
|
66
66
|
return Array.from(/* @__PURE__ */ new Set([...r, ...e]));
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
function
|
|
68
|
+
k(Cr, "union");
|
|
69
|
+
function Lr(r) {
|
|
70
70
|
return [...new Set(r)];
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
k(Lr, "deduplicate");
|
|
73
73
|
function ne(r, e) {
|
|
74
74
|
const t = r?.indexOf(e);
|
|
75
75
|
return t >= 0 ? (r.splice(t, 1), !0) : !1;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
function
|
|
79
|
-
return Array.isArray(r) ? r :
|
|
77
|
+
k(ne, "remove");
|
|
78
|
+
function jr(r) {
|
|
79
|
+
return Array.isArray(r) ? r : T(r) ? [] : [r];
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
k(jr, "makeArray");
|
|
82
82
|
function se(r, e) {
|
|
83
83
|
return arguments.length === 1 ? (t) => se(r, t) : r in globalThis && e instanceof globalThis[r] || Object.prototype.toString.call(e).slice(8, -1) === r;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
k(se, "is");
|
|
86
86
|
function Oe(r) {
|
|
87
87
|
return se("ArrayBuffer", r) || se("SharedArrayBuffer", r);
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
function
|
|
89
|
+
k(Oe, "isArrayBufferLike");
|
|
90
|
+
function Ut(r) {
|
|
91
91
|
return Oe(r) || ArrayBuffer.isView(r);
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
var
|
|
93
|
+
k(Ut, "isArrayBufferSource");
|
|
94
|
+
var J;
|
|
95
95
|
((r) => {
|
|
96
|
-
r.is = Oe, r.isSource =
|
|
96
|
+
r.is = Oe, r.isSource = Ut;
|
|
97
97
|
function e(o) {
|
|
98
98
|
return ArrayBuffer.isView(o) ? o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength) : o;
|
|
99
99
|
}
|
|
100
|
-
r.fromSource = e,
|
|
100
|
+
r.fromSource = e, k(e, "fromSource");
|
|
101
101
|
function t(o) {
|
|
102
102
|
if (typeof Buffer < "u")
|
|
103
103
|
return Buffer.from(o).toString("base64");
|
|
@@ -107,15 +107,15 @@ var Q;
|
|
|
107
107
|
a += String.fromCharCode(c[u]);
|
|
108
108
|
return btoa(a);
|
|
109
109
|
}
|
|
110
|
-
r.toBase64 = t,
|
|
110
|
+
r.toBase64 = t, k(t, "toBase64");
|
|
111
111
|
function i(o) {
|
|
112
112
|
return typeof Buffer < "u" ? e(Buffer.from(o, "base64")) : Uint8Array.from(atob(o), (a) => a.charCodeAt(0));
|
|
113
113
|
}
|
|
114
|
-
r.fromBase64 = i,
|
|
114
|
+
r.fromBase64 = i, k(i, "fromBase64");
|
|
115
115
|
function n(o) {
|
|
116
116
|
return typeof Buffer < "u" ? Buffer.from(o).toString("hex") : Array.from(new Uint8Array(o), (a) => a.toString(16).padStart(2, "0")).join("");
|
|
117
117
|
}
|
|
118
|
-
r.toHex = n,
|
|
118
|
+
r.toHex = n, k(n, "toHex");
|
|
119
119
|
function s(o) {
|
|
120
120
|
if (typeof Buffer < "u") return e(Buffer.from(o, "hex"));
|
|
121
121
|
const a = o.length % 2 === 0 ? o : o.slice(0, o.length - 1), c = [];
|
|
@@ -123,13 +123,13 @@ var Q;
|
|
|
123
123
|
c.push(parseInt(`${a[u]}${a[u + 1]}`, 16));
|
|
124
124
|
return Uint8Array.from(c).buffer;
|
|
125
125
|
}
|
|
126
|
-
r.fromHex = s,
|
|
127
|
-
})(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
function
|
|
126
|
+
r.fromHex = s, k(s, "fromHex");
|
|
127
|
+
})(J || (J = {}));
|
|
128
|
+
J.fromBase64;
|
|
129
|
+
J.toBase64;
|
|
130
|
+
J.fromHex;
|
|
131
|
+
J.toHex;
|
|
132
|
+
function Le(r, e = /* @__PURE__ */ new Map()) {
|
|
133
133
|
if (!r || typeof r != "object") return r;
|
|
134
134
|
if (se("Date", r)) return new Date(r.valueOf());
|
|
135
135
|
if (se("RegExp", r)) return new RegExp(r.source, r.flags);
|
|
@@ -140,25 +140,25 @@ function Ce(r, e = /* @__PURE__ */ new Map()) {
|
|
|
140
140
|
if (Array.isArray(r)) {
|
|
141
141
|
const n = [];
|
|
142
142
|
return e.set(r, n), r.forEach((s, o) => {
|
|
143
|
-
n[o] = Reflect.apply(
|
|
143
|
+
n[o] = Reflect.apply(Le, null, [s, e]);
|
|
144
144
|
}), n;
|
|
145
145
|
}
|
|
146
146
|
const i = Object.create(Object.getPrototypeOf(r));
|
|
147
147
|
e.set(r, i);
|
|
148
148
|
for (const n of Reflect.ownKeys(r)) {
|
|
149
149
|
const s = { ...Reflect.getOwnPropertyDescriptor(r, n) };
|
|
150
|
-
"value" in s && (s.value = Reflect.apply(
|
|
150
|
+
"value" in s && (s.value = Reflect.apply(Le, null, [s.value, e])), Reflect.defineProperty(i, n, s);
|
|
151
151
|
}
|
|
152
152
|
return i;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
k(Le, "clone");
|
|
155
155
|
function ce(r, e, t) {
|
|
156
|
-
if (r === e || !t &&
|
|
156
|
+
if (r === e || !t && T(r) && T(e)) return !0;
|
|
157
157
|
if (typeof r != typeof e || typeof r != "object" || !r || !e) return !1;
|
|
158
158
|
function i(n, s) {
|
|
159
159
|
return n(r) ? n(e) ? s(r, e) : !1 : n(e) ? !1 : void 0;
|
|
160
160
|
}
|
|
161
|
-
return
|
|
161
|
+
return k(i, "check"), i(Array.isArray, (n, s) => n.length === s.length && n.every((o, a) => ce(o, s[a]))) ?? i(se("Date"), (n, s) => n.valueOf() === s.valueOf()) ?? i(se("RegExp"), (n, s) => n.source === s.source && n.flags === s.flags) ?? i(Oe, (n, s) => {
|
|
162
162
|
if (n.byteLength !== s.byteLength) return !1;
|
|
163
163
|
const o = new Uint8Array(n), a = new Uint8Array(s);
|
|
164
164
|
for (let c = 0; c < o.length; c++)
|
|
@@ -166,19 +166,19 @@ function ce(r, e, t) {
|
|
|
166
166
|
return !0;
|
|
167
167
|
}) ?? Object.keys({ ...r, ...e }).every((n) => ce(r[n], e[n], t));
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
function
|
|
169
|
+
k(ce, "deepEqual");
|
|
170
|
+
function Dr(r) {
|
|
171
171
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
function
|
|
173
|
+
k(Dr, "capitalize");
|
|
174
|
+
function Nr(r) {
|
|
175
175
|
return r.charAt(0).toLowerCase() + r.slice(1);
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
k(Nr, "uncapitalize");
|
|
178
178
|
function Ur(r) {
|
|
179
179
|
return r.replace(/[_-][a-z]/g, (e) => e.slice(1).toUpperCase());
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
k(Ur, "camelCase");
|
|
182
182
|
function at(r, e, t) {
|
|
183
183
|
const i = [];
|
|
184
184
|
let n = 0;
|
|
@@ -195,27 +195,27 @@ function at(r, e, t) {
|
|
|
195
195
|
}
|
|
196
196
|
return String.fromCharCode(...i);
|
|
197
197
|
}
|
|
198
|
-
|
|
199
|
-
function
|
|
198
|
+
k(at, "tokenize");
|
|
199
|
+
function Mr(r) {
|
|
200
200
|
return at(r, [45, 95], 45);
|
|
201
201
|
}
|
|
202
|
-
|
|
203
|
-
function
|
|
202
|
+
k(Mr, "paramCase");
|
|
203
|
+
function Br(r) {
|
|
204
204
|
return at(r, [45, 95], 95);
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
function
|
|
206
|
+
k(Br, "snakeCase");
|
|
207
|
+
function Hr(r) {
|
|
208
208
|
return typeof r != "string" ? `[${r.toString()}]` : /^[a-z_$][\w$]*$/i.test(r) ? `.${r}` : `[${JSON.stringify(r)}]`;
|
|
209
209
|
}
|
|
210
|
-
|
|
210
|
+
k(Hr, "formatProperty");
|
|
211
211
|
function Mt(r) {
|
|
212
212
|
return r.replace(/\/$/, "");
|
|
213
213
|
}
|
|
214
|
-
|
|
214
|
+
k(Mt, "trimSlash");
|
|
215
215
|
function Fr(r) {
|
|
216
216
|
return r.startsWith("/") || (r = "/" + r), Mt(r);
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
k(Fr, "sanitize");
|
|
219
219
|
var St;
|
|
220
220
|
((r) => {
|
|
221
221
|
r.millisecond = 1, r.second = 1e3, r.minute = r.second * 60, r.hour = r.minute * 60, r.day = r.hour * 24, r.week = r.day * 7;
|
|
@@ -223,20 +223,20 @@ var St;
|
|
|
223
223
|
function t(g) {
|
|
224
224
|
e = g;
|
|
225
225
|
}
|
|
226
|
-
r.setTimezoneOffset = t,
|
|
226
|
+
r.setTimezoneOffset = t, k(t, "setTimezoneOffset");
|
|
227
227
|
function i() {
|
|
228
228
|
return e;
|
|
229
229
|
}
|
|
230
|
-
r.getTimezoneOffset = i,
|
|
231
|
-
function n(g = /* @__PURE__ */ new Date(),
|
|
232
|
-
return typeof g == "number" && (g = new Date(g)),
|
|
230
|
+
r.getTimezoneOffset = i, k(i, "getTimezoneOffset");
|
|
231
|
+
function n(g = /* @__PURE__ */ new Date(), b) {
|
|
232
|
+
return typeof g == "number" && (g = new Date(g)), b === void 0 && (b = e), Math.floor((g.valueOf() / r.minute - b) / 1440);
|
|
233
233
|
}
|
|
234
|
-
r.getDateNumber = n,
|
|
235
|
-
function s(g,
|
|
234
|
+
r.getDateNumber = n, k(n, "getDateNumber");
|
|
235
|
+
function s(g, b) {
|
|
236
236
|
const R = new Date(g * r.day);
|
|
237
|
-
return
|
|
237
|
+
return b === void 0 && (b = e), new Date(+R + b * r.minute);
|
|
238
238
|
}
|
|
239
|
-
r.fromDateNumber = s,
|
|
239
|
+
r.fromDateNumber = s, k(s, "fromDateNumber");
|
|
240
240
|
const o = /\d+(?:\.\d+)?/.source, a = new RegExp(`^${[
|
|
241
241
|
"w(?:eek(?:s)?)?",
|
|
242
242
|
"d(?:ay(?:s)?)?",
|
|
@@ -245,30 +245,30 @@ var St;
|
|
|
245
245
|
"s(?:ec(?:ond)?(?:s)?)?"
|
|
246
246
|
].map((g) => `(${o}${g})?`).join("")}$`);
|
|
247
247
|
function c(g) {
|
|
248
|
-
const
|
|
249
|
-
return
|
|
248
|
+
const b = a.exec(g);
|
|
249
|
+
return b ? (parseFloat(b[1]) * r.week || 0) + (parseFloat(b[2]) * r.day || 0) + (parseFloat(b[3]) * r.hour || 0) + (parseFloat(b[4]) * r.minute || 0) + (parseFloat(b[5]) * r.second || 0) : 0;
|
|
250
250
|
}
|
|
251
|
-
r.parseTime = c,
|
|
251
|
+
r.parseTime = c, k(c, "parseTime");
|
|
252
252
|
function u(g) {
|
|
253
|
-
const
|
|
254
|
-
return
|
|
253
|
+
const b = c(g);
|
|
254
|
+
return b ? g = Date.now() + b : /^\d{1,2}(:\d{1,2}){1,2}$/.test(g) ? g = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${g}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(g) && (g = `${(/* @__PURE__ */ new Date()).getFullYear()}-${g}`), g ? new Date(g) : /* @__PURE__ */ new Date();
|
|
255
255
|
}
|
|
256
|
-
r.parseDate = u,
|
|
256
|
+
r.parseDate = u, k(u, "parseDate");
|
|
257
257
|
function p(g) {
|
|
258
|
-
const
|
|
259
|
-
return
|
|
258
|
+
const b = Math.abs(g);
|
|
259
|
+
return b >= r.day - r.hour / 2 ? Math.round(g / r.day) + "d" : b >= r.hour - r.minute / 2 ? Math.round(g / r.hour) + "h" : b >= r.minute - r.second / 2 ? Math.round(g / r.minute) + "m" : b >= r.second ? Math.round(g / r.second) + "s" : g + "ms";
|
|
260
260
|
}
|
|
261
|
-
r.format = p,
|
|
262
|
-
function y(g,
|
|
263
|
-
return g.toString().padStart(
|
|
261
|
+
r.format = p, k(p, "format");
|
|
262
|
+
function y(g, b = 2) {
|
|
263
|
+
return g.toString().padStart(b, "0");
|
|
264
264
|
}
|
|
265
|
-
r.toDigits = y,
|
|
266
|
-
function w(g,
|
|
267
|
-
return g.replace("yyyy",
|
|
265
|
+
r.toDigits = y, k(y, "toDigits");
|
|
266
|
+
function w(g, b = /* @__PURE__ */ new Date()) {
|
|
267
|
+
return g.replace("yyyy", b.getFullYear().toString()).replace("yy", b.getFullYear().toString().slice(2)).replace("MM", y(b.getMonth() + 1)).replace("dd", y(b.getDate())).replace("hh", y(b.getHours())).replace("mm", y(b.getMinutes())).replace("ss", y(b.getSeconds())).replace("SSS", y(b.getMilliseconds(), 3));
|
|
268
268
|
}
|
|
269
|
-
r.template = w,
|
|
269
|
+
r.template = w, k(w, "template");
|
|
270
270
|
})(St || (St = {}));
|
|
271
|
-
var
|
|
271
|
+
var zr = Object.defineProperty, x = (r, e) => zr(r, "name", { value: e, configurable: !0 }), _ = {
|
|
272
272
|
// internal symbols
|
|
273
273
|
shadow: Symbol.for("cordis.shadow"),
|
|
274
274
|
receiver: Symbol.for("cordis.receiver"),
|
|
@@ -289,22 +289,22 @@ var qr = Object.defineProperty, k = (r, e) => qr(r, "name", { value: e, configur
|
|
|
289
289
|
tracker: Symbol.for("cordis.tracker"),
|
|
290
290
|
provide: Symbol.for("cordis.provide"),
|
|
291
291
|
immediate: Symbol.for("cordis.immediate")
|
|
292
|
-
},
|
|
293
|
-
}.constructor,
|
|
292
|
+
}, qr = function* () {
|
|
293
|
+
}.constructor, xt = async function* () {
|
|
294
294
|
}.constructor;
|
|
295
295
|
function ct(r) {
|
|
296
|
-
return !(!r.prototype || r instanceof
|
|
296
|
+
return !(!r.prototype || r instanceof qr || xt !== Function && r instanceof xt);
|
|
297
297
|
}
|
|
298
|
-
|
|
298
|
+
x(ct, "isConstructor");
|
|
299
299
|
function Re(r, e) {
|
|
300
300
|
const t = r.Config || r.schema;
|
|
301
301
|
return t && r.schema !== !1 && (e = t(e)), e ?? {};
|
|
302
302
|
}
|
|
303
|
-
|
|
303
|
+
x(Re, "resolveConfig");
|
|
304
304
|
function Bt(r) {
|
|
305
305
|
return [Map, Set, Date, Promise].some((e) => r instanceof e);
|
|
306
306
|
}
|
|
307
|
-
|
|
307
|
+
x(Bt, "isUnproxyable");
|
|
308
308
|
function lt(r, e) {
|
|
309
309
|
if (r === Object.prototype) return e;
|
|
310
310
|
const t = Object.create(lt(Object.getPrototypeOf(r), e));
|
|
@@ -312,11 +312,11 @@ function lt(r, e) {
|
|
|
312
312
|
Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(r, i));
|
|
313
313
|
return t;
|
|
314
314
|
}
|
|
315
|
-
|
|
315
|
+
x(lt, "joinPrototype");
|
|
316
316
|
function ut(r) {
|
|
317
317
|
return r && (typeof r == "object" || typeof r == "function");
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
x(ut, "isObject");
|
|
320
320
|
function Z(r, e, t) {
|
|
321
321
|
if (!ut(e)) return e;
|
|
322
322
|
if (Object.hasOwn(e, _.shadow))
|
|
@@ -324,47 +324,47 @@ function Z(r, e, t) {
|
|
|
324
324
|
const i = e[_.tracker];
|
|
325
325
|
return i ? ze(r, e, i, t) : e;
|
|
326
326
|
}
|
|
327
|
-
|
|
328
|
-
function
|
|
327
|
+
x(Z, "getTraceable");
|
|
328
|
+
function ke(r, e) {
|
|
329
329
|
return e ? new Proxy(r, {
|
|
330
|
-
get: /* @__PURE__ */
|
|
331
|
-
set: /* @__PURE__ */
|
|
330
|
+
get: /* @__PURE__ */ x((t, i, n) => i in e && i !== "constructor" ? Reflect.get(e, i, n) : Reflect.get(t, i, n), "get"),
|
|
331
|
+
set: /* @__PURE__ */ x((t, i, n, s) => i in e && i !== "constructor" ? Reflect.set(e, i, n, s) : Reflect.set(t, i, n, s), "set")
|
|
332
332
|
}) : r;
|
|
333
333
|
}
|
|
334
|
-
|
|
334
|
+
x(ke, "withProps");
|
|
335
335
|
function je(r, e, t) {
|
|
336
|
-
return
|
|
336
|
+
return ke(r, Object.defineProperty(/* @__PURE__ */ Object.create(null), e, {
|
|
337
337
|
value: t,
|
|
338
338
|
writable: !1
|
|
339
339
|
}));
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
x(je, "withProp");
|
|
342
342
|
function Ge(r, e, t, i) {
|
|
343
343
|
if (!t) return i;
|
|
344
344
|
const n = Reflect.getOwnPropertyDescriptor(e, t)?.value;
|
|
345
345
|
return n ? je(i, t, r.extend({ [_.shadow]: n })) : i;
|
|
346
346
|
}
|
|
347
|
-
|
|
348
|
-
function
|
|
347
|
+
x(Ge, "createShadow");
|
|
348
|
+
function Ht(r, e, t, i) {
|
|
349
349
|
return new Proxy(e, {
|
|
350
|
-
apply: /* @__PURE__ */
|
|
351
|
-
get: /* @__PURE__ */
|
|
350
|
+
apply: /* @__PURE__ */ x((n, s, o) => (s === t && (s = i), o = o.map((a) => typeof a != "function" || a[_.original] ? a : new Proxy(a, {
|
|
351
|
+
get: /* @__PURE__ */ x((c, u, p) => {
|
|
352
352
|
if (u === _.original) return c;
|
|
353
353
|
const y = Reflect.get(c, u, p);
|
|
354
354
|
return u === "toString" && y === Function.prototype.toString ? function(...w) {
|
|
355
355
|
return Reflect.apply(y, this === p ? c : this, w);
|
|
356
356
|
} : y;
|
|
357
357
|
}, "get"),
|
|
358
|
-
apply: /* @__PURE__ */
|
|
359
|
-
construct: /* @__PURE__ */
|
|
358
|
+
apply: /* @__PURE__ */ x((c, u, p) => Reflect.apply(c, Z(r, u), p.map((y) => Z(r, y))), "apply"),
|
|
359
|
+
construct: /* @__PURE__ */ x((c, u, p) => Reflect.construct(c, u.map((y) => Z(r, y)), p), "construct")
|
|
360
360
|
})), Z(r, Reflect.apply(n, s, o))), "apply")
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
|
|
363
|
+
x(Ht, "createShadowMethod");
|
|
364
364
|
function ze(r, e, t, i) {
|
|
365
365
|
r[_.shadow] && (r = Object.getPrototypeOf(r));
|
|
366
366
|
const n = new Proxy(e, {
|
|
367
|
-
get: /* @__PURE__ */
|
|
367
|
+
get: /* @__PURE__ */ x((s, o, a) => {
|
|
368
368
|
if (o === _.original) return s;
|
|
369
369
|
if (o === t.property) return r;
|
|
370
370
|
if (typeof o == "symbol")
|
|
@@ -372,9 +372,9 @@ function ze(r, e, t, i) {
|
|
|
372
372
|
if (t.associate && r[_.internal][`${t.associate}.${o}`])
|
|
373
373
|
return Reflect.get(r, `${t.associate}.${o}`, je(r, _.receiver, a));
|
|
374
374
|
const c = Ge(r, s, t.property, a), u = Reflect.get(s, o, c), p = u?.[_.tracker];
|
|
375
|
-
return p ? ze(r, u, p) : !i && typeof u == "function" ?
|
|
375
|
+
return p ? ze(r, u, p) : !i && typeof u == "function" ? Ht(r, u, a, c) : u;
|
|
376
376
|
}, "get"),
|
|
377
|
-
set: /* @__PURE__ */
|
|
377
|
+
set: /* @__PURE__ */ x((s, o, a, c) => {
|
|
378
378
|
if (o === _.original || o === t.property) return !1;
|
|
379
379
|
if (typeof o == "symbol")
|
|
380
380
|
return Reflect.set(s, o, a, c);
|
|
@@ -383,32 +383,32 @@ function ze(r, e, t, i) {
|
|
|
383
383
|
const u = Ge(r, s, t.property, c);
|
|
384
384
|
return Reflect.set(s, o, a, u);
|
|
385
385
|
}, "set"),
|
|
386
|
-
apply: /* @__PURE__ */
|
|
386
|
+
apply: /* @__PURE__ */ x((s, o, a) => ht(n, s, o, a), "apply")
|
|
387
387
|
});
|
|
388
388
|
return n;
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
x(ze, "createTraceable");
|
|
391
391
|
function ht(r, e, t, i) {
|
|
392
392
|
return e[_.invoke] ? e[_.invoke].apply(r, i) : Reflect.apply(e, t, i);
|
|
393
393
|
}
|
|
394
|
-
|
|
394
|
+
x(ht, "applyTraceable");
|
|
395
395
|
function Xe(r, e, t) {
|
|
396
|
-
const i = /* @__PURE__ */
|
|
396
|
+
const i = /* @__PURE__ */ x(function(...n) {
|
|
397
397
|
const s = ze(i.ctx, i, t);
|
|
398
398
|
return ht(s, i, this, n);
|
|
399
399
|
}, "self");
|
|
400
|
-
return
|
|
400
|
+
return N(i, "name", r), Object.setPrototypeOf(i, e);
|
|
401
401
|
}
|
|
402
|
-
|
|
403
|
-
var
|
|
402
|
+
x(Xe, "createCallable");
|
|
403
|
+
var Kr = class de {
|
|
404
404
|
constructor(e) {
|
|
405
|
-
this.ctx = e,
|
|
405
|
+
this.ctx = e, N(this, _.tracker, {
|
|
406
406
|
associate: "reflect",
|
|
407
407
|
property: "ctx"
|
|
408
408
|
}), this._mixin("reflect", ["get", "set", "provide", "accessor", "mixin", "alias"]), this._mixin("scope", ["config", "runtime", "effect", "collect", "accept", "decline"]), this._mixin("registry", ["using", "inject", "plugin"]), this._mixin("lifecycle", ["on", "once", "parallel", "emit", "serial", "bail", "start", "stop"]);
|
|
409
409
|
}
|
|
410
410
|
static {
|
|
411
|
-
|
|
411
|
+
x(this, "ReflectService");
|
|
412
412
|
}
|
|
413
413
|
static resolveInject(e, t) {
|
|
414
414
|
let i = e[_.internal][t];
|
|
@@ -424,19 +424,19 @@ var Hr = class de {
|
|
|
424
424
|
`), e.emit(e, "internal/warning", i);
|
|
425
425
|
}
|
|
426
426
|
static handler = {
|
|
427
|
-
get: /* @__PURE__ */
|
|
427
|
+
get: /* @__PURE__ */ x((e, t, i) => {
|
|
428
428
|
if (typeof t != "string") return Reflect.get(e, t, i);
|
|
429
429
|
if (Reflect.has(e, t))
|
|
430
430
|
return Z(i, Reflect.get(e, t, i), !0);
|
|
431
431
|
const [n, s] = de.resolveInject(e, t), o = new Error(`property ${n} is not registered, declare it as \`inject\` to suppress this warning`);
|
|
432
432
|
return s ? s.type === "accessor" ? s.get.call(i, i[_.receiver]) : (s.builtin || de.checkInject(i, n, o), i.reflect.get(n)) : (de.checkInject(i, n, o), Reflect.get(e, n, i));
|
|
433
433
|
}, "get"),
|
|
434
|
-
set: /* @__PURE__ */
|
|
434
|
+
set: /* @__PURE__ */ x((e, t, i, n) => {
|
|
435
435
|
if (typeof t != "string") return Reflect.set(e, t, i, n);
|
|
436
436
|
const [s, o] = de.resolveInject(e, t);
|
|
437
437
|
return o ? o.type === "accessor" ? o.set ? o.set.call(n, i, n[_.receiver]) : !1 : (n.reflect.set(s, i), !0) : Reflect.set(e, s, i, n);
|
|
438
438
|
}, "set"),
|
|
439
|
-
has: /* @__PURE__ */
|
|
439
|
+
has: /* @__PURE__ */ x((e, t) => {
|
|
440
440
|
if (typeof t != "string") return Reflect.has(e, t);
|
|
441
441
|
if (Reflect.has(e, t)) return !0;
|
|
442
442
|
const [, i] = de.resolveInject(e, t);
|
|
@@ -452,13 +452,13 @@ var Hr = class de {
|
|
|
452
452
|
this.provide(e);
|
|
453
453
|
const i = this.ctx[_.isolate][e], n = this.ctx[_.store][i]?.value;
|
|
454
454
|
t ??= void 0;
|
|
455
|
-
let s = /* @__PURE__ */
|
|
455
|
+
let s = /* @__PURE__ */ x(() => {
|
|
456
456
|
}, "dispose");
|
|
457
457
|
if (n === t) return s;
|
|
458
|
-
if (!
|
|
458
|
+
if (!T(t) && !T(n))
|
|
459
459
|
throw new Error(`service ${e} has been registered`);
|
|
460
460
|
const o = this.ctx;
|
|
461
|
-
|
|
461
|
+
T(t) || (s = o.effect(() => () => {
|
|
462
462
|
o.set(e, void 0);
|
|
463
463
|
})), Bt(t) && o.emit(o, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
|
|
464
464
|
const a = Object.create(o);
|
|
@@ -468,7 +468,7 @@ var Hr = class de {
|
|
|
468
468
|
const n = this.ctx.root[_.internal];
|
|
469
469
|
if (e in n) return;
|
|
470
470
|
const s = Symbol(e);
|
|
471
|
-
n[e] = { type: "service", builtin: i }, this.ctx.root[_.isolate][e] = s, ut(t) && (this.ctx[_.store][s] = { value: t, source: null },
|
|
471
|
+
n[e] = { type: "service", builtin: i }, this.ctx.root[_.isolate][e] = s, ut(t) && (this.ctx[_.store][s] = { value: t, source: null }, N(t, _.tracker, {
|
|
472
472
|
associate: e,
|
|
473
473
|
property: "ctx"
|
|
474
474
|
}));
|
|
@@ -491,12 +491,12 @@ var Hr = class de {
|
|
|
491
491
|
const i = Array.isArray(t) ? t.map((o) => [o, o]) : Object.entries(t), n = typeof e == "string" ? (o) => o[e] : () => e, s = i.map(([o, a]) => this._accessor(a, {
|
|
492
492
|
get(c) {
|
|
493
493
|
const u = n(this);
|
|
494
|
-
if (
|
|
495
|
-
const p = c ?
|
|
494
|
+
if (T(u)) return u;
|
|
495
|
+
const p = c ? ke(c, u) : u, y = Reflect.get(u, o, p);
|
|
496
496
|
return typeof y != "function" ? y : y.bind(p ?? u);
|
|
497
497
|
},
|
|
498
498
|
set(c, u) {
|
|
499
|
-
const p = n(this), y = u ?
|
|
499
|
+
const p = n(this), y = u ? ke(u, p) : p;
|
|
500
500
|
return Reflect.set(p, o, c, y);
|
|
501
501
|
}
|
|
502
502
|
}));
|
|
@@ -510,59 +510,59 @@ var Hr = class de {
|
|
|
510
510
|
}
|
|
511
511
|
bind(e) {
|
|
512
512
|
return new Proxy(e, {
|
|
513
|
-
apply: /* @__PURE__ */
|
|
513
|
+
apply: /* @__PURE__ */ x((t, i, n) => t.apply(this.trace(i), n.map((s) => this.trace(s))), "apply")
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
|
-
}, Ve =
|
|
517
|
-
function
|
|
516
|
+
}, Ve = Kr;
|
|
517
|
+
function Qe(r) {
|
|
518
518
|
return r !== null && r !== !1 && r !== void 0;
|
|
519
519
|
}
|
|
520
|
-
|
|
521
|
-
var
|
|
520
|
+
x(Qe, "isBailed");
|
|
521
|
+
var Wr = class {
|
|
522
522
|
constructor(r) {
|
|
523
|
-
this.ctx = r,
|
|
523
|
+
this.ctx = r, N(this, _.tracker, {
|
|
524
524
|
associate: "lifecycle",
|
|
525
525
|
property: "ctx"
|
|
526
|
-
}),
|
|
526
|
+
}), N(this.on("internal/listener", function(t, i, n) {
|
|
527
527
|
const s = n.prepend ? "unshift" : "push";
|
|
528
528
|
if (t === "ready")
|
|
529
529
|
return this.lifecycle.isActive ? (this.scope.ensure(async () => i()), () => !1) : void 0;
|
|
530
530
|
if (t === "dispose")
|
|
531
|
-
return this.scope.disposables[s](i),
|
|
531
|
+
return this.scope.disposables[s](i), N(i, "name", "event <dispose>"), () => ne(this.scope.disposables, i);
|
|
532
532
|
if (t === "fork")
|
|
533
533
|
return this.scope.runtime.forkables[s](i), this.scope.collect("event <fork>", () => ne(this.scope.runtime.forkables, i));
|
|
534
|
-
}),
|
|
534
|
+
}), q.static, r.scope);
|
|
535
535
|
for (const t of ["info", "error", "warning"])
|
|
536
|
-
|
|
536
|
+
N(this.on(`internal/${t}`, (i, ...n) => {
|
|
537
537
|
this._hooks[`internal/${t}`].length > 1;
|
|
538
|
-
}),
|
|
539
|
-
|
|
538
|
+
}), q.static, r.scope);
|
|
539
|
+
N(this.on("internal/before-service", function(t) {
|
|
540
540
|
for (const i of this.registry.values()) {
|
|
541
541
|
if (!i.inject[t]?.required) continue;
|
|
542
542
|
const n = i.isReusable ? i.children : [i];
|
|
543
543
|
for (const s of n)
|
|
544
544
|
this[_.filter](s.ctx) && (s.updateStatus(), s.reset());
|
|
545
545
|
}
|
|
546
|
-
}, { global: !0 }),
|
|
546
|
+
}, { global: !0 }), q.static, r.scope), N(this.on("internal/service", function(t) {
|
|
547
547
|
for (const i of this.registry.values()) {
|
|
548
548
|
if (!i.inject[t]?.required) continue;
|
|
549
549
|
const n = i.isReusable ? i.children : [i];
|
|
550
550
|
for (const s of n)
|
|
551
551
|
this[_.filter](s.ctx) && s.start();
|
|
552
552
|
}
|
|
553
|
-
}, { global: !0 }),
|
|
554
|
-
const e = /* @__PURE__ */
|
|
553
|
+
}, { global: !0 }), q.static, r.scope);
|
|
554
|
+
const e = /* @__PURE__ */ x((t, i) => {
|
|
555
555
|
if (!t.runtime.plugin) return !1;
|
|
556
556
|
for (const n in t.runtime.inject)
|
|
557
557
|
if (i === Ve.resolveInject(t.ctx, n)[0]) return !0;
|
|
558
558
|
return e(t.parent.scope, i);
|
|
559
559
|
}, "checkInject");
|
|
560
|
-
|
|
560
|
+
N(this.on("internal/inject", function(t) {
|
|
561
561
|
return e(this.scope, t);
|
|
562
|
-
}, { global: !0 }),
|
|
562
|
+
}, { global: !0 }), q.static, r.scope);
|
|
563
563
|
}
|
|
564
564
|
static {
|
|
565
|
-
|
|
565
|
+
x(this, "Lifecycle");
|
|
566
566
|
}
|
|
567
567
|
isActive = !1;
|
|
568
568
|
_tasks = /* @__PURE__ */ new Set();
|
|
@@ -573,7 +573,7 @@ var Kr = class {
|
|
|
573
573
|
}
|
|
574
574
|
filterHooks(r, e) {
|
|
575
575
|
return e = Z(this.ctx, e), r.slice().filter((t) => {
|
|
576
|
-
const i = e?.[
|
|
576
|
+
const i = e?.[q.filter];
|
|
577
577
|
return t.global || !i || i.call(e, t.ctx);
|
|
578
578
|
});
|
|
579
579
|
}
|
|
@@ -591,11 +591,11 @@ var Kr = class {
|
|
|
591
591
|
}
|
|
592
592
|
async serial(...r) {
|
|
593
593
|
for await (const e of this.dispatch("serial", r))
|
|
594
|
-
if (
|
|
594
|
+
if (Qe(e)) return e;
|
|
595
595
|
}
|
|
596
596
|
bail(...r) {
|
|
597
597
|
for (const e of this.dispatch("bail", r))
|
|
598
|
-
if (
|
|
598
|
+
if (Qe(e)) return e;
|
|
599
599
|
}
|
|
600
600
|
register(r, e, t, i) {
|
|
601
601
|
const n = i.prepend ? "unshift" : "push";
|
|
@@ -631,27 +631,27 @@ var Kr = class {
|
|
|
631
631
|
async stop() {
|
|
632
632
|
this.isActive = !1, this.ctx.scope.reset();
|
|
633
633
|
}
|
|
634
|
-
},
|
|
634
|
+
}, Yr = Wr, Je = class Ft extends Error {
|
|
635
635
|
constructor(e, t) {
|
|
636
|
-
super(t ??
|
|
636
|
+
super(t ?? Ft.Code[e]), this.code = e;
|
|
637
637
|
}
|
|
638
638
|
static {
|
|
639
|
-
|
|
639
|
+
x(this, "CordisError");
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
642
|
((r) => {
|
|
643
643
|
r.Code = {
|
|
644
644
|
INACTIVE_EFFECT: "cannot create effect on inactive context"
|
|
645
645
|
};
|
|
646
|
-
})(
|
|
646
|
+
})(Je || (Je = {}));
|
|
647
647
|
var zt = class {
|
|
648
648
|
constructor(r, e) {
|
|
649
649
|
this.parent = r, this.config = e, this.uid = r.registry ? r.registry.counter : 0, this.ctx = this.context = r.extend({ scope: this }), this.proxy = new Proxy({}, {
|
|
650
|
-
get: /* @__PURE__ */
|
|
650
|
+
get: /* @__PURE__ */ x((t, i) => Reflect.get(this.config, i), "get")
|
|
651
651
|
});
|
|
652
652
|
}
|
|
653
653
|
static {
|
|
654
|
-
|
|
654
|
+
x(this, "EffectScope");
|
|
655
655
|
}
|
|
656
656
|
uid;
|
|
657
657
|
ctx;
|
|
@@ -670,20 +670,20 @@ var zt = class {
|
|
|
670
670
|
}
|
|
671
671
|
assertActive() {
|
|
672
672
|
if (!(this.uid !== null || this.isActive))
|
|
673
|
-
throw new
|
|
673
|
+
throw new Je("INACTIVE_EFFECT");
|
|
674
674
|
}
|
|
675
675
|
effect(r, e) {
|
|
676
676
|
this.assertActive();
|
|
677
677
|
const t = ct(r) ? new r(this.ctx, e) : r(this.ctx, e);
|
|
678
678
|
let i = !1;
|
|
679
|
-
const n = typeof t == "function" ? t : t.dispose.bind(t), s = /* @__PURE__ */
|
|
679
|
+
const n = typeof t == "function" ? t : t.dispose.bind(t), s = /* @__PURE__ */ x((...o) => {
|
|
680
680
|
if (!i)
|
|
681
681
|
return i = !0, ne(this.disposables, s), n(...o);
|
|
682
682
|
}, "wrapped");
|
|
683
683
|
return this.disposables.push(s), typeof t == "function" ? s : (t.dispose = s, t);
|
|
684
684
|
}
|
|
685
685
|
collect(r, e) {
|
|
686
|
-
const t =
|
|
686
|
+
const t = N(() => (ne(this.disposables, t), e()), "name", r);
|
|
687
687
|
return this.disposables.push(t), t;
|
|
688
688
|
}
|
|
689
689
|
restart() {
|
|
@@ -708,11 +708,11 @@ var zt = class {
|
|
|
708
708
|
this.error = r, this.updateStatus(() => this.hasError = !0), this.reset();
|
|
709
709
|
}
|
|
710
710
|
get ready() {
|
|
711
|
-
return Object.entries(this.runtime.inject).every(([r, e]) => !e.required || !
|
|
711
|
+
return Object.entries(this.runtime.inject).every(([r, e]) => !e.required || !T(this.ctx.get(r)));
|
|
712
712
|
}
|
|
713
713
|
reset() {
|
|
714
714
|
this.isActive = !1, this.disposables = this.disposables.splice(0).filter((r) => {
|
|
715
|
-
if (this.uid !== null && r[
|
|
715
|
+
if (this.uid !== null && r[q.static] === this) return !0;
|
|
716
716
|
(async () => r())().catch((e) => {
|
|
717
717
|
this.context.emit(this.ctx, "internal/error", e);
|
|
718
718
|
});
|
|
@@ -735,7 +735,7 @@ var zt = class {
|
|
|
735
735
|
checkUpdate(r, e) {
|
|
736
736
|
if (e || !this.config) return [!0, !0];
|
|
737
737
|
if (e === !1) return [!1, !1];
|
|
738
|
-
const t = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */
|
|
738
|
+
const t = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ x((c) => {
|
|
739
739
|
const u = t[c] ??= !ce(this.config[c], r[c]);
|
|
740
740
|
return s ||= u, u;
|
|
741
741
|
}, "checkPropertyUpdate"), n = /* @__PURE__ */ new Set();
|
|
@@ -760,16 +760,16 @@ var zt = class {
|
|
|
760
760
|
}
|
|
761
761
|
return [s, o];
|
|
762
762
|
}
|
|
763
|
-
},
|
|
763
|
+
}, Gr = class extends zt {
|
|
764
764
|
constructor(r, e, t, i) {
|
|
765
|
-
super(r, t), this.runtime = e, this.dispose =
|
|
765
|
+
super(r, t), this.runtime = e, this.dispose = N(r.scope.collect(`fork <${r.runtime.name}>`, () => {
|
|
766
766
|
this.uid = null, this.reset(), this.context.emit("internal/fork", this);
|
|
767
767
|
const n = ne(e.disposables, this.dispose);
|
|
768
768
|
return ne(e.children, this) && !e.children.length && r.registry.delete(e.plugin), n;
|
|
769
|
-
}),
|
|
769
|
+
}), q.static, e), e.children.push(this), e.disposables.push(this.dispose), this.context.emit("internal/fork", this), this.init(i);
|
|
770
770
|
}
|
|
771
771
|
static {
|
|
772
|
-
|
|
772
|
+
x(this, "ForkScope");
|
|
773
773
|
}
|
|
774
774
|
dispose;
|
|
775
775
|
start() {
|
|
@@ -789,12 +789,12 @@ var zt = class {
|
|
|
789
789
|
const [s, o] = i.checkUpdate(n, e);
|
|
790
790
|
this.context.emit("internal/before-update", this, r), this.config = n, i.config = n, s && this.context.emit("internal/update", this, t), o && i.restart();
|
|
791
791
|
}
|
|
792
|
-
},
|
|
792
|
+
}, kt = class extends zt {
|
|
793
793
|
constructor(r, e, t, i) {
|
|
794
794
|
super(r, t), this.plugin = e, e ? (this.setup(), this.init(i)) : (this.name = "root", this.isActive = !0);
|
|
795
795
|
}
|
|
796
796
|
static {
|
|
797
|
-
|
|
797
|
+
x(this, "MainScope");
|
|
798
798
|
}
|
|
799
799
|
value;
|
|
800
800
|
runtime = this;
|
|
@@ -809,7 +809,7 @@ var zt = class {
|
|
|
809
809
|
return this.forkables.length > 0;
|
|
810
810
|
}
|
|
811
811
|
fork(r, e, t) {
|
|
812
|
-
return new
|
|
812
|
+
return new Gr(r, this, e, t);
|
|
813
813
|
}
|
|
814
814
|
dispose() {
|
|
815
815
|
return this.uid = null, this.reset(), this.context.emit("internal/runtime", this), !0;
|
|
@@ -818,11 +818,11 @@ var zt = class {
|
|
|
818
818
|
const { name: r } = this.plugin;
|
|
819
819
|
r && r !== "apply" && (this.name = r), this.schema = this.plugin.Config || this.plugin.schema, this.inject = le.resolve(this.plugin.using || this.plugin.inject), this.isReusable = this.plugin.reusable, this.isReactive = this.plugin.reactive, this.context.emit("internal/runtime", this), this.isReusable && this.forkables.push(this.apply);
|
|
820
820
|
}
|
|
821
|
-
apply = /* @__PURE__ */
|
|
821
|
+
apply = /* @__PURE__ */ x((r, e) => {
|
|
822
822
|
if (typeof this.plugin != "function")
|
|
823
823
|
return this.plugin.apply(r, e);
|
|
824
824
|
if (ct(this.plugin)) {
|
|
825
|
-
const t = new this.plugin(r, e), i = t[
|
|
825
|
+
const t = new this.plugin(r, e), i = t[q.expose];
|
|
826
826
|
return i && r.set(i, t), t.fork && this.forkables.push(t.fork.bind(t)), t;
|
|
827
827
|
} else
|
|
828
828
|
return this.plugin(r, e);
|
|
@@ -854,10 +854,10 @@ var zt = class {
|
|
|
854
854
|
this.config = i, o && (this.context.emit("internal/before-update", o, r), o.config = i, n && this.context.emit("internal/update", o, t)), s && this.restart();
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
|
-
function
|
|
857
|
+
function qt(r) {
|
|
858
858
|
return r && typeof r == "object" && typeof r.apply == "function";
|
|
859
859
|
}
|
|
860
|
-
|
|
860
|
+
x(qt, "isApplicable");
|
|
861
861
|
function le(r) {
|
|
862
862
|
return function(e, t) {
|
|
863
863
|
if (t.kind === "class")
|
|
@@ -867,14 +867,14 @@ function le(r) {
|
|
|
867
867
|
const i = this[_.tracker]?.property;
|
|
868
868
|
if (!i) throw new Error("missing context tracker");
|
|
869
869
|
this[i].inject(r, (n) => {
|
|
870
|
-
e.call(
|
|
870
|
+
e.call(ke(this, { [i]: n }));
|
|
871
871
|
});
|
|
872
872
|
});
|
|
873
873
|
else
|
|
874
874
|
throw new Error("@Inject can only be used on class or class methods");
|
|
875
875
|
};
|
|
876
876
|
}
|
|
877
|
-
|
|
877
|
+
x(le, "Inject");
|
|
878
878
|
((r) => {
|
|
879
879
|
function e(t) {
|
|
880
880
|
if (!t) return {};
|
|
@@ -883,19 +883,19 @@ k(le, "Inject");
|
|
|
883
883
|
const { required: i, optional: n, ...s } = t;
|
|
884
884
|
return Array.isArray(i) && Object.assign(s, Object.fromEntries(i.map((o) => [o, { required: !0 }]))), Array.isArray(n) && Object.assign(s, Object.fromEntries(n.map((o) => [o, { required: !1 }]))), s;
|
|
885
885
|
}
|
|
886
|
-
r.resolve = e,
|
|
886
|
+
r.resolve = e, x(e, "resolve");
|
|
887
887
|
})(le || (le = {}));
|
|
888
|
-
var
|
|
888
|
+
var Xr = class {
|
|
889
889
|
constructor(r, e) {
|
|
890
|
-
this.ctx = r,
|
|
890
|
+
this.ctx = r, N(this, _.tracker, {
|
|
891
891
|
associate: "registry",
|
|
892
892
|
property: "ctx"
|
|
893
893
|
}), this.context = r;
|
|
894
|
-
const t = new
|
|
894
|
+
const t = new kt(r, null, e);
|
|
895
895
|
r.scope = t, t.ctx = r, this.set(null, t);
|
|
896
896
|
}
|
|
897
897
|
static {
|
|
898
|
-
|
|
898
|
+
x(this, "Registry");
|
|
899
899
|
}
|
|
900
900
|
_counter = 0;
|
|
901
901
|
_internal = /* @__PURE__ */ new Map();
|
|
@@ -908,7 +908,7 @@ var Gr = class {
|
|
|
908
908
|
}
|
|
909
909
|
resolve(r, e = !1) {
|
|
910
910
|
if (r === null || typeof r == "function") return r;
|
|
911
|
-
if (
|
|
911
|
+
if (qt(r)) return r.apply;
|
|
912
912
|
if (e) throw new Error('invalid plugin, expect function or object with an "apply" method, received ' + typeof r);
|
|
913
913
|
}
|
|
914
914
|
get(r) {
|
|
@@ -954,11 +954,11 @@ var Gr = class {
|
|
|
954
954
|
this.context.emit(this.ctx, "internal/error", n), t = n, e = null;
|
|
955
955
|
}
|
|
956
956
|
let i = this.get(r);
|
|
957
|
-
return i ? (i.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${r.name}`)), i.fork(this.ctx, e, t)) : (i = new
|
|
957
|
+
return i ? (i.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${r.name}`)), i.fork(this.ctx, e, t)) : (i = new kt(this.ctx, r, e, t), this.set(r, i), i.fork(this.ctx, e, t));
|
|
958
958
|
}
|
|
959
|
-
},
|
|
959
|
+
}, Vr = Xr, q = class we {
|
|
960
960
|
static {
|
|
961
|
-
|
|
961
|
+
x(this, "Context");
|
|
962
962
|
}
|
|
963
963
|
static store = _.store;
|
|
964
964
|
static events = _.events;
|
|
@@ -983,13 +983,13 @@ var Gr = class {
|
|
|
983
983
|
constructor(e) {
|
|
984
984
|
e = Re(this.constructor, e), this[_.store] = /* @__PURE__ */ Object.create(null), this[_.isolate] = /* @__PURE__ */ Object.create(null), this[_.internal] = /* @__PURE__ */ Object.create(null), this[_.intercept] = /* @__PURE__ */ Object.create(null);
|
|
985
985
|
const t = new Proxy(this, Ve.handler);
|
|
986
|
-
t.root = t, t.reflect = new Ve(t), t.registry = new
|
|
987
|
-
const i = /* @__PURE__ */
|
|
986
|
+
t.root = t, t.reflect = new Ve(t), t.registry = new Vr(t, e), t.lifecycle = new Yr(t);
|
|
987
|
+
const i = /* @__PURE__ */ x((n) => {
|
|
988
988
|
if (n) {
|
|
989
989
|
i(Object.getPrototypeOf(n));
|
|
990
990
|
for (const s of Object.getOwnPropertyNames(n)) {
|
|
991
991
|
const o = n[s].prototype?.constructor;
|
|
992
|
-
o && (t[n[s].key] = new o(t, e),
|
|
992
|
+
o && (t[n[s].key] = new o(t, e), N(t[n[s].key], "ctx", t));
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
995
|
}, "attach");
|
|
@@ -1024,10 +1024,10 @@ var Gr = class {
|
|
|
1024
1024
|
return i[e] = t, this.extend({ [_.intercept]: i });
|
|
1025
1025
|
}
|
|
1026
1026
|
};
|
|
1027
|
-
|
|
1027
|
+
q.prototype[q.internal] = /* @__PURE__ */ Object.create(null);
|
|
1028
1028
|
var he = class Kt {
|
|
1029
1029
|
static {
|
|
1030
|
-
|
|
1030
|
+
x(this, "Service");
|
|
1031
1031
|
}
|
|
1032
1032
|
static setup = _.setup;
|
|
1033
1033
|
static invoke = _.invoke;
|
|
@@ -1044,13 +1044,13 @@ var he = class Kt {
|
|
|
1044
1044
|
config;
|
|
1045
1045
|
constructor(...e) {
|
|
1046
1046
|
let t, i, n, s;
|
|
1047
|
-
|
|
1047
|
+
q.is(e[0]) ? (t = e[0], typeof e[1] == "string" ? (i = e[1], n = e[2]) : s = e[1]) : s = e[0], i ??= this.constructor[_.provide], n ??= this.constructor[_.immediate];
|
|
1048
1048
|
let o = this;
|
|
1049
1049
|
const a = {
|
|
1050
1050
|
associate: i,
|
|
1051
1051
|
property: "ctx"
|
|
1052
1052
|
};
|
|
1053
|
-
return o[_.invoke] && (o = Xe(i, lt(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[_.setup](), o.name = i, o.config = s,
|
|
1053
|
+
return o[_.invoke] && (o = Xe(i, lt(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[_.setup](), o.name = i, o.config = s, N(o, _.tracker, a), o.ctx.provide(i), o.ctx.runtime.name = i, n && (t ? o[_.expose] = i : o.ctx.set(i, o)), o.ctx.on("ready", async () => {
|
|
1054
1054
|
await Promise.resolve(), await o.start(), n || o.ctx.set(i, o);
|
|
1055
1055
|
}), o.ctx.on("dispose", () => o.stop()), o;
|
|
1056
1056
|
}
|
|
@@ -1058,7 +1058,7 @@ var he = class Kt {
|
|
|
1058
1058
|
return e[_.isolate][this.name] === this.ctx[_.isolate][this.name];
|
|
1059
1059
|
}
|
|
1060
1060
|
[_.setup]() {
|
|
1061
|
-
this.ctx = new
|
|
1061
|
+
this.ctx = new q();
|
|
1062
1062
|
}
|
|
1063
1063
|
[_.extend](e) {
|
|
1064
1064
|
let t;
|
|
@@ -1072,9 +1072,9 @@ var he = class Kt {
|
|
|
1072
1072
|
}
|
|
1073
1073
|
return !1;
|
|
1074
1074
|
}
|
|
1075
|
-
},
|
|
1075
|
+
}, Qr = Object.defineProperty, Jr = Object.getOwnPropertyNames, O = (r, e) => Qr(r, "name", { value: e, configurable: !0 }), Zr = (r, e) => function() {
|
|
1076
1076
|
return e || (0, r[Jr(r)[0]])((e = { exports: {} }).exports, e), e.exports;
|
|
1077
|
-
},
|
|
1077
|
+
}, ei = Zr({
|
|
1078
1078
|
"src/index.ts"(r, e) {
|
|
1079
1079
|
var t = Symbol.for("schemastery"), i = Symbol.for("ValidationError");
|
|
1080
1080
|
globalThis.__schemastery_index__ ??= 0;
|
|
@@ -1103,8 +1103,8 @@ var he = class Kt {
|
|
|
1103
1103
|
if (f.refs) {
|
|
1104
1104
|
const l = te(f.refs, (m) => new s(m)), d = /* @__PURE__ */ O((m) => l[m], "getRef");
|
|
1105
1105
|
for (const m in l) {
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1106
|
+
const v = l[m];
|
|
1107
|
+
v.sKey = d(v.sKey), v.inner = d(v.inner), v.list = v.list && v.list.map(d), v.dict = v.dict && te(v.dict, d);
|
|
1108
1108
|
}
|
|
1109
1109
|
return l[f.uid];
|
|
1110
1110
|
}
|
|
@@ -1146,7 +1146,7 @@ var he = class Kt {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
O(u, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ O(function(h) {
|
|
1148
1148
|
const l = s(this), d = a(l.meta.description, h);
|
|
1149
|
-
return Object.keys(d).length && (l.meta.description = d), l.dict && (l.dict = te(l.dict, (m,
|
|
1149
|
+
return Object.keys(d).length && (l.meta.description = d), l.dict && (l.dict = te(l.dict, (m, v) => m.i18n(te(h, (S) => c(S)?.[v] ?? S?.[v])))), l.list && (l.list = l.list.map((m, v) => m.i18n(te(h, (S = {}) => Array.isArray(c(S)) ? c(S)[v] : Array.isArray(S) ? S[v] : u(S))))), l.inner && (l.inner = l.inner.i18n(te(h, (m) => c(m) ? c(m) : u(m)))), l.sKey && (l.sKey = l.sKey.i18n(te(h, (m) => m?.$key))), l;
|
|
1150
1150
|
}, "i18n"), s.prototype.extra = /* @__PURE__ */ O(function(h, l) {
|
|
1151
1151
|
const d = s(this);
|
|
1152
1152
|
return d.meta = { ...d.meta, [h]: l }, d;
|
|
@@ -1165,22 +1165,22 @@ var he = class Kt {
|
|
|
1165
1165
|
const h = s(this);
|
|
1166
1166
|
return h.meta.badges ||= [], h.meta.badges.push({ text: "experimental", type: "warning" }), h;
|
|
1167
1167
|
}, "experimental"), s.prototype.pattern = /* @__PURE__ */ O(function(h) {
|
|
1168
|
-
const l = s(this), d =
|
|
1168
|
+
const l = s(this), d = Nt(h, ["source", "flags"]);
|
|
1169
1169
|
return l.meta = { ...l.meta, pattern: d }, l;
|
|
1170
1170
|
}, "pattern"), s.prototype.simplify = /* @__PURE__ */ O(function(h) {
|
|
1171
1171
|
if (ce(h, this.meta.default, this.type === "dict")) return null;
|
|
1172
|
-
if (
|
|
1172
|
+
if (T(h)) return h;
|
|
1173
1173
|
if (this.type === "object" || this.type === "dict") {
|
|
1174
1174
|
const l = {};
|
|
1175
1175
|
for (const d in h) {
|
|
1176
|
-
const
|
|
1177
|
-
(this.type === "dict" || !
|
|
1176
|
+
const v = (this.type === "object" ? this.dict[d] : this.inner)?.simplify(h[d]);
|
|
1177
|
+
(this.type === "dict" || !T(v)) && (l[d] = v);
|
|
1178
1178
|
}
|
|
1179
1179
|
return ce(l, this.meta.default, this.type === "dict") ? null : l;
|
|
1180
1180
|
} else if (this.type === "array" || this.type === "tuple") {
|
|
1181
1181
|
const l = [];
|
|
1182
1182
|
return h.forEach((d, m) => {
|
|
1183
|
-
const
|
|
1183
|
+
const v = this.type === "array" ? this.inner : this.list[m], S = v ? v.simplify(d) : d;
|
|
1184
1184
|
l.push(S);
|
|
1185
1185
|
}), l;
|
|
1186
1186
|
} else if (this.type === "intersect") {
|
|
@@ -1196,7 +1196,7 @@ var he = class Kt {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
return h;
|
|
1198
1198
|
}, "simplify"), s.prototype.toString = /* @__PURE__ */ O(function(h) {
|
|
1199
|
-
return
|
|
1199
|
+
return L[this.type]?.(this, h) ?? `Schema<${this.type}>`;
|
|
1200
1200
|
}, "toString"), s.prototype.role = /* @__PURE__ */ O(function(f, h) {
|
|
1201
1201
|
const l = s(this);
|
|
1202
1202
|
return l.meta = { ...l.meta, role: f, extra: h }, l;
|
|
@@ -1214,24 +1214,24 @@ var he = class Kt {
|
|
|
1214
1214
|
}, "extend"), s.resolve = /* @__PURE__ */ O(function(h, l, d = {}, m = !1) {
|
|
1215
1215
|
if (!l) return [h];
|
|
1216
1216
|
if (d.ignore?.(h, l)) return [h];
|
|
1217
|
-
if (
|
|
1217
|
+
if (T(h) && l.type !== "lazy") {
|
|
1218
1218
|
if (l.meta.required) throw new n("missing required value", d);
|
|
1219
1219
|
let S = l, E = l.meta.default;
|
|
1220
|
-
for (; S?.type === "intersect" &&
|
|
1220
|
+
for (; S?.type === "intersect" && T(E); )
|
|
1221
1221
|
S = S.list[0], E = S?.meta.default;
|
|
1222
|
-
if (
|
|
1223
|
-
h =
|
|
1222
|
+
if (T(E)) return [h];
|
|
1223
|
+
h = Le(E);
|
|
1224
1224
|
}
|
|
1225
|
-
const
|
|
1226
|
-
if (!
|
|
1225
|
+
const v = p[l.type];
|
|
1226
|
+
if (!v) throw new n(`unsupported type "${l.type}"`, d);
|
|
1227
1227
|
try {
|
|
1228
|
-
return
|
|
1228
|
+
return v(h, l, d, m);
|
|
1229
1229
|
} catch (S) {
|
|
1230
1230
|
if (!l.meta.loose) throw S;
|
|
1231
1231
|
return [l.meta.default];
|
|
1232
1232
|
}
|
|
1233
1233
|
}, "resolve"), s.from = /* @__PURE__ */ O(function(h) {
|
|
1234
|
-
if (
|
|
1234
|
+
if (T(h))
|
|
1235
1235
|
return s.any();
|
|
1236
1236
|
if (["string", "number", "boolean"].includes(typeof h))
|
|
1237
1237
|
return s.const(h).required();
|
|
@@ -1284,12 +1284,12 @@ var he = class Kt {
|
|
|
1284
1284
|
s.is(ArrayBuffer),
|
|
1285
1285
|
s.is(SharedArrayBuffer),
|
|
1286
1286
|
s.transform(s.any(), (l, d) => {
|
|
1287
|
-
if (
|
|
1287
|
+
if (J.isSource(l)) return J.fromSource(l);
|
|
1288
1288
|
throw new n(`expected ArrayBufferSource but got ${l}`, d);
|
|
1289
1289
|
}, !0),
|
|
1290
1290
|
...h ? [s.transform(s.string(), (l, d) => {
|
|
1291
1291
|
try {
|
|
1292
|
-
return h === "base64" ?
|
|
1292
|
+
return h === "base64" ? J.fromBase64(l) : J.fromHex(l);
|
|
1293
1293
|
} catch (m) {
|
|
1294
1294
|
throw new n(m.message, d);
|
|
1295
1295
|
}
|
|
@@ -1302,8 +1302,8 @@ var he = class Kt {
|
|
|
1302
1302
|
throw new n(`expected ${h} but got ${f}`, l);
|
|
1303
1303
|
});
|
|
1304
1304
|
function y(f, h, l, d, m = !1) {
|
|
1305
|
-
const { max:
|
|
1306
|
-
if (f >
|
|
1305
|
+
const { max: v = 1 / 0, min: S = -1 / 0 } = h;
|
|
1306
|
+
if (f > v) throw new n(`expected ${l} <= ${v} but got ${f}`, d);
|
|
1307
1307
|
if (f < S && !m) throw new n(`expected ${l} >= ${S} but got ${f}`, d);
|
|
1308
1308
|
}
|
|
1309
1309
|
O(y, "checkWithinRange"), s.extend("string", (f, { meta: h }, l) => {
|
|
@@ -1319,8 +1319,8 @@ var he = class Kt {
|
|
|
1319
1319
|
if (l.includes("e")) return f * Math.pow(10, h);
|
|
1320
1320
|
const d = l.indexOf(".");
|
|
1321
1321
|
if (d === -1) return f * Math.pow(10, h);
|
|
1322
|
-
const m = l.slice(d + 1),
|
|
1323
|
-
return m.length <= h ? +(
|
|
1322
|
+
const m = l.slice(d + 1), v = l.slice(0, d);
|
|
1323
|
+
return m.length <= h ? +(v + m.padEnd(h, "0")) : +(v + m.slice(0, h) + "." + m.slice(h));
|
|
1324
1324
|
}
|
|
1325
1325
|
O(w, "decimalShift");
|
|
1326
1326
|
function g(f, h, l) {
|
|
@@ -1340,20 +1340,20 @@ var he = class Kt {
|
|
|
1340
1340
|
if (typeof f == "boolean") return [f];
|
|
1341
1341
|
throw new n(`expected boolean but got ${f}`, l);
|
|
1342
1342
|
}), s.extend("bitset", (f, { bits: h, meta: l }, d) => {
|
|
1343
|
-
let m = 0,
|
|
1343
|
+
let m = 0, v = [];
|
|
1344
1344
|
if (typeof f == "number") {
|
|
1345
1345
|
m = f;
|
|
1346
1346
|
for (const S in h)
|
|
1347
|
-
f & h[S] &&
|
|
1347
|
+
f & h[S] && v.push(S);
|
|
1348
1348
|
} else if (Array.isArray(f)) {
|
|
1349
|
-
|
|
1350
|
-
for (const S of
|
|
1349
|
+
v = f;
|
|
1350
|
+
for (const S of v) {
|
|
1351
1351
|
if (typeof S != "string") throw new n(`expected string but got ${S}`, d);
|
|
1352
1352
|
S in h && (m |= h[S]);
|
|
1353
1353
|
}
|
|
1354
1354
|
} else
|
|
1355
1355
|
throw new n(`expected number or array but got ${f}`, d);
|
|
1356
|
-
return m === l.default ? [m] : [m,
|
|
1356
|
+
return m === l.default ? [m] : [m, v];
|
|
1357
1357
|
}), s.extend("function", (f, h, l) => {
|
|
1358
1358
|
if (typeof f == "function") return [f];
|
|
1359
1359
|
throw new n(`expected function but got ${f}`, l);
|
|
@@ -1362,7 +1362,7 @@ var he = class Kt {
|
|
|
1362
1362
|
if (f instanceof h) return [f];
|
|
1363
1363
|
throw new n(`expected ${h.name} but got ${f}`, l);
|
|
1364
1364
|
} else {
|
|
1365
|
-
if (
|
|
1365
|
+
if (T(f))
|
|
1366
1366
|
throw new n(`expected ${h} but got ${f}`, l);
|
|
1367
1367
|
let d = Object.getPrototypeOf(f);
|
|
1368
1368
|
for (; d; ) {
|
|
@@ -1372,38 +1372,38 @@ var he = class Kt {
|
|
|
1372
1372
|
throw new n(`expected ${h} but got ${f}`, l);
|
|
1373
1373
|
}
|
|
1374
1374
|
});
|
|
1375
|
-
function
|
|
1375
|
+
function b(f, h, l, d) {
|
|
1376
1376
|
try {
|
|
1377
|
-
const [m,
|
|
1377
|
+
const [m, v] = s.resolve(f[h], l, {
|
|
1378
1378
|
...d,
|
|
1379
1379
|
path: [...d.path || [], h]
|
|
1380
1380
|
});
|
|
1381
|
-
return
|
|
1381
|
+
return v !== void 0 && (f[h] = v), m;
|
|
1382
1382
|
} catch (m) {
|
|
1383
1383
|
if (!d?.autofix) throw m;
|
|
1384
1384
|
return delete f[h], l.meta.default;
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
|
-
O(
|
|
1387
|
+
O(b, "property"), s.extend("array", (f, { inner: h, meta: l }, d) => {
|
|
1388
1388
|
if (!Array.isArray(f)) throw new n(`expected array but got ${f}`, d);
|
|
1389
|
-
return y(f.length, l, "array length", d, !
|
|
1389
|
+
return y(f.length, l, "array length", d, !T(h.meta.default)), [f.map((m, v) => b(f, v, h, d))];
|
|
1390
1390
|
}), s.extend("dict", (f, { inner: h, sKey: l }, d, m) => {
|
|
1391
|
-
if (!
|
|
1392
|
-
const
|
|
1391
|
+
if (!Ce(f)) throw new n(`expected object but got ${f}`, d);
|
|
1392
|
+
const v = {};
|
|
1393
1393
|
for (const S in f) {
|
|
1394
1394
|
let E;
|
|
1395
1395
|
try {
|
|
1396
1396
|
E = s.resolve(S, l, d)[0];
|
|
1397
|
-
} catch (
|
|
1397
|
+
} catch (M) {
|
|
1398
1398
|
if (m) continue;
|
|
1399
|
-
throw
|
|
1399
|
+
throw M;
|
|
1400
1400
|
}
|
|
1401
|
-
|
|
1401
|
+
v[E] = b(f, S, h, d), f[E] = f[S], S !== E && delete f[S];
|
|
1402
1402
|
}
|
|
1403
|
-
return [
|
|
1403
|
+
return [v];
|
|
1404
1404
|
}), s.extend("tuple", (f, { list: h }, l, d) => {
|
|
1405
1405
|
if (!Array.isArray(f)) throw new n(`expected array but got ${f}`, l);
|
|
1406
|
-
const m = h.map((
|
|
1406
|
+
const m = h.map((v, S) => b(f, S, v, l));
|
|
1407
1407
|
return d ? [m] : (m.push(...f.slice(h.length)), [m]);
|
|
1408
1408
|
});
|
|
1409
1409
|
function R(f, h) {
|
|
@@ -1411,49 +1411,49 @@ var he = class Kt {
|
|
|
1411
1411
|
l in f || (f[l] = h[l]);
|
|
1412
1412
|
}
|
|
1413
1413
|
O(R, "merge"), s.extend("object", (f, { dict: h }, l, d) => {
|
|
1414
|
-
if (!
|
|
1414
|
+
if (!Ce(f)) throw new n(`expected object but got ${f}`, l);
|
|
1415
1415
|
const m = {};
|
|
1416
|
-
for (const
|
|
1417
|
-
const S =
|
|
1418
|
-
(!
|
|
1416
|
+
for (const v in h) {
|
|
1417
|
+
const S = b(f, v, h[v], l);
|
|
1418
|
+
(!T(S) || v in f) && (m[v] = S);
|
|
1419
1419
|
}
|
|
1420
1420
|
return d || R(m, f), [m];
|
|
1421
1421
|
}), s.extend("union", (f, { list: h, toString: l }, d, m) => {
|
|
1422
|
-
for (const
|
|
1422
|
+
for (const v of h)
|
|
1423
1423
|
try {
|
|
1424
|
-
return s.resolve(f,
|
|
1424
|
+
return s.resolve(f, v, d, m);
|
|
1425
1425
|
} catch {
|
|
1426
1426
|
}
|
|
1427
1427
|
throw new n(`expected ${l()} but got ${JSON.stringify(f)}`, d);
|
|
1428
1428
|
}), s.extend("intersect", (f, { list: h, toString: l }, d, m) => {
|
|
1429
1429
|
if (!h.length) return [f];
|
|
1430
|
-
let
|
|
1430
|
+
let v;
|
|
1431
1431
|
for (const S of h) {
|
|
1432
1432
|
const E = s.resolve(f, S, d, !0)[0];
|
|
1433
|
-
if (!
|
|
1434
|
-
if (
|
|
1435
|
-
|
|
1433
|
+
if (!T(E))
|
|
1434
|
+
if (T(v))
|
|
1435
|
+
v = E;
|
|
1436
1436
|
else {
|
|
1437
|
-
if (typeof
|
|
1437
|
+
if (typeof v != typeof E)
|
|
1438
1438
|
throw new n(`expected ${l()} but got ${JSON.stringify(f)}`, d);
|
|
1439
1439
|
if (typeof E == "object")
|
|
1440
|
-
R(
|
|
1441
|
-
else if (
|
|
1440
|
+
R(v ??= {}, E);
|
|
1441
|
+
else if (v !== E)
|
|
1442
1442
|
throw new n(`expected ${l()} but got ${JSON.stringify(f)}`, d);
|
|
1443
1443
|
}
|
|
1444
1444
|
}
|
|
1445
|
-
return !m &&
|
|
1445
|
+
return !m && Ce(f) && R(v, f), [v];
|
|
1446
1446
|
}), s.extend("transform", (f, { inner: h, callback: l, preserve: d }, m) => {
|
|
1447
|
-
const [
|
|
1448
|
-
return d ? [l(
|
|
1447
|
+
const [v, S = f] = s.resolve(f, h, m, !0);
|
|
1448
|
+
return d ? [l(v)] : [l(v), l(S)];
|
|
1449
1449
|
});
|
|
1450
|
-
var
|
|
1450
|
+
var L = {};
|
|
1451
1451
|
function $(f, h, l) {
|
|
1452
|
-
|
|
1452
|
+
L[f] = l, Object.assign(s, {
|
|
1453
1453
|
[f](...d) {
|
|
1454
1454
|
const m = new s({ type: f });
|
|
1455
|
-
return h.forEach((
|
|
1456
|
-
switch (
|
|
1455
|
+
return h.forEach((v, S) => {
|
|
1456
|
+
switch (v) {
|
|
1457
1457
|
case "sKey":
|
|
1458
1458
|
m.sKey = d[S] ?? s.string();
|
|
1459
1459
|
break;
|
|
@@ -1483,7 +1483,7 @@ var he = class Kt {
|
|
|
1483
1483
|
break;
|
|
1484
1484
|
}
|
|
1485
1485
|
default:
|
|
1486
|
-
m[
|
|
1486
|
+
m[v] = d[S];
|
|
1487
1487
|
}
|
|
1488
1488
|
}), f === "object" || f === "dict" ? m.meta.default = {} : f === "array" || f === "tuple" ? m.meta.default = [] : f === "bitset" && (m.meta.default = 0), m;
|
|
1489
1489
|
}
|
|
@@ -1495,7 +1495,7 @@ var he = class Kt {
|
|
|
1495
1495
|
}), $("intersect", ["list"], ({ list: f }) => `${f.map((h) => h.toString(!0)).join(" & ")}`), $("transform", ["inner", "callback", "preserve"], ({ inner: f }, h) => f.toString(h)), e.exports = s;
|
|
1496
1496
|
}
|
|
1497
1497
|
});
|
|
1498
|
-
const Ze =
|
|
1498
|
+
const Ze = ei();
|
|
1499
1499
|
/**
|
|
1500
1500
|
* @inpageedit/logger
|
|
1501
1501
|
*
|
|
@@ -1526,14 +1526,14 @@ const Et = [
|
|
|
1526
1526
|
[140, 160],
|
|
1527
1527
|
[160, 180]
|
|
1528
1528
|
];
|
|
1529
|
-
function
|
|
1529
|
+
function ti(r, e) {
|
|
1530
1530
|
const t = Et.length, i = Pe(r) % t, [n, s] = Et[i], o = s - n, a = Pe(r + ":" + e), c = n + a % (o || 1), u = Pe(r + ":s"), p = Pe(r + ":l");
|
|
1531
1531
|
let y, w;
|
|
1532
1532
|
if (e === "name")
|
|
1533
1533
|
y = 62 + u % 18, w = 30 + p % 12;
|
|
1534
1534
|
else {
|
|
1535
|
-
const g = c >= 0 && c < 50 || c > 330 && c < 360,
|
|
1536
|
-
y = 55 + u % 20,
|
|
1535
|
+
const g = c >= 0 && c < 50 || c > 330 && c < 360, b = c >= 200 && c <= 300;
|
|
1536
|
+
y = 55 + u % 20, b ? w = 55 + p % 8 : g ? w = 48 + p % 6 : w = 50 + p % 8, y < 60 && (y += 5);
|
|
1537
1537
|
}
|
|
1538
1538
|
return `hsl(${c}, ${y}%, ${w}%)`;
|
|
1539
1539
|
}
|
|
@@ -1542,7 +1542,7 @@ function Ie(r, e) {
|
|
|
1542
1542
|
return We.set(r, e), e;
|
|
1543
1543
|
const t = We.get(r);
|
|
1544
1544
|
if (t) return t;
|
|
1545
|
-
const i = r.startsWith("name:") ? "name" : "group", n =
|
|
1545
|
+
const i = r.startsWith("name:") ? "name" : "group", n = ti(r, i);
|
|
1546
1546
|
return We.set(r, n), n;
|
|
1547
1547
|
}
|
|
1548
1548
|
/**
|
|
@@ -1565,7 +1565,7 @@ function Ie(r, e) {
|
|
|
1565
1565
|
* logger.success('User created successfully')
|
|
1566
1566
|
* ```
|
|
1567
1567
|
*/
|
|
1568
|
-
let
|
|
1568
|
+
let ri = class Yt {
|
|
1569
1569
|
/**
|
|
1570
1570
|
* Note: constructor returns a callable Proxy so that you can do `logger('group')`.
|
|
1571
1571
|
*/
|
|
@@ -1580,7 +1580,7 @@ let ti = class Yt {
|
|
|
1580
1580
|
}, this._name && Ie(`name:${this._name}`, this._nameColor), this._installBuiltinLevels();
|
|
1581
1581
|
for (const t of Object.keys(this._dynamicLevels))
|
|
1582
1582
|
this._installLevelGetter(t, this._dynamicLevels[t]);
|
|
1583
|
-
return
|
|
1583
|
+
return ni(this);
|
|
1584
1584
|
}
|
|
1585
1585
|
// ---------- public API ----------
|
|
1586
1586
|
get level() {
|
|
@@ -1630,7 +1630,7 @@ let ti = class Yt {
|
|
|
1630
1630
|
});
|
|
1631
1631
|
}
|
|
1632
1632
|
_method(e) {
|
|
1633
|
-
const t =
|
|
1633
|
+
const t = ii[e];
|
|
1634
1634
|
if (!this._enabled(t.level)) return Ot;
|
|
1635
1635
|
const [i, n] = this._prefix(t.label);
|
|
1636
1636
|
return this._consoleMethod(e).bind(console, i, ...n);
|
|
@@ -1659,14 +1659,14 @@ let ti = class Yt {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
};
|
|
1661
1661
|
const Ot = () => {
|
|
1662
|
-
}, Rt = "color:inherit; background:transparent; text-decoration:none;",
|
|
1662
|
+
}, Rt = "color:inherit; background:transparent; text-decoration:none;", ii = {
|
|
1663
1663
|
debug: { level: -1, label: "", method: "debug" },
|
|
1664
1664
|
log: { level: 0, label: "", method: "log" },
|
|
1665
1665
|
info: { level: 1, label: "[I]", method: "info" },
|
|
1666
1666
|
warn: { level: 2, label: "[W]", method: "warn" },
|
|
1667
1667
|
error: { level: 3, label: "[E]", method: "error" }
|
|
1668
1668
|
};
|
|
1669
|
-
function
|
|
1669
|
+
function ni(r) {
|
|
1670
1670
|
const e = function(t, i) {
|
|
1671
1671
|
return r.group(t, i);
|
|
1672
1672
|
};
|
|
@@ -1685,8 +1685,8 @@ function ii(r) {
|
|
|
1685
1685
|
}
|
|
1686
1686
|
});
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return new
|
|
1688
|
+
function si(r) {
|
|
1689
|
+
return new ri(r);
|
|
1690
1690
|
}
|
|
1691
1691
|
var Y = /* @__PURE__ */ ((r) => (r.BODY_USED = "BODY_USED", r.NO_BODY_READER = "NO_BODY_READER", r.TIMEOUT = "TIMEOUT", r.NETWORK_ERROR = "NETWORK_ERROR", r.BODY_NOT_ALLOWED = "BODY_NOT_ALLOWED", r.HOOK_CONTEXT_CHANGED = "HOOK_CONTEXT_CHANGED", r.ABORTED_BY_HOOK = "ABORTED_BY_HOOK", r.INVALID_HOOK_CALLBACK = "INVALID_HOOK_CALLBACK", r.UNEXPECTED_HOOK_RETURN = "UNEXPECTED_HOOK_RETURN", r))(Y || {});
|
|
1692
1692
|
let F = class Gt extends Error {
|
|
@@ -1697,7 +1697,7 @@ let F = class Gt extends Error {
|
|
|
1697
1697
|
static is(e) {
|
|
1698
1698
|
return e?.constructor === Gt;
|
|
1699
1699
|
}
|
|
1700
|
-
},
|
|
1700
|
+
}, oi = class Xt extends F {
|
|
1701
1701
|
constructor(e, t, i) {
|
|
1702
1702
|
super(t.statusText, e, void 0, i), this.response = t;
|
|
1703
1703
|
}
|
|
@@ -1706,7 +1706,7 @@ let F = class Gt extends Error {
|
|
|
1706
1706
|
return e?.constructor === Xt;
|
|
1707
1707
|
}
|
|
1708
1708
|
};
|
|
1709
|
-
function
|
|
1709
|
+
function ai(r, e = 2048) {
|
|
1710
1710
|
if (!(r instanceof Uint8Array))
|
|
1711
1711
|
throw new TypeError("Input must be a Uint8Array");
|
|
1712
1712
|
if (r.length === 0)
|
|
@@ -1715,23 +1715,23 @@ function oi(r, e = 2048) {
|
|
|
1715
1715
|
Math.max(r.length, 256),
|
|
1716
1716
|
e
|
|
1717
1717
|
), i = r.slice(0, t);
|
|
1718
|
-
if (
|
|
1718
|
+
if (ci(i))
|
|
1719
1719
|
return !1;
|
|
1720
|
-
const n =
|
|
1720
|
+
const n = li(i);
|
|
1721
1721
|
if (n.nullByteRatio > 0.05 || n.highByteRatio > 0.95)
|
|
1722
1722
|
return !1;
|
|
1723
1723
|
const s = ["utf-8", "utf-16le", "utf-16be", "iso-8859-1"];
|
|
1724
1724
|
let o = -1, a = !1;
|
|
1725
1725
|
for (const c of s)
|
|
1726
1726
|
try {
|
|
1727
|
-
const u = new TextDecoder(c, { fatal: !0 }).decode(i), p =
|
|
1727
|
+
const u = new TextDecoder(c, { fatal: !0 }).decode(i), p = ui(u);
|
|
1728
1728
|
p > o && (o = p, a = p > 0.7);
|
|
1729
1729
|
} catch {
|
|
1730
1730
|
continue;
|
|
1731
1731
|
}
|
|
1732
1732
|
return a;
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function ci(r) {
|
|
1735
1735
|
if (r.length < 4) return !1;
|
|
1736
1736
|
const e = [
|
|
1737
1737
|
[137, 80, 78, 71],
|
|
@@ -1771,7 +1771,7 @@ function ai(r) {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
return !1;
|
|
1773
1773
|
}
|
|
1774
|
-
function
|
|
1774
|
+
function li(r) {
|
|
1775
1775
|
let e = 0, t = 0, i = 0;
|
|
1776
1776
|
for (const n of r)
|
|
1777
1777
|
n === 0 && e++, n > 127 && t++, (n < 32 && n !== 9 && n !== 10 && n !== 13 || n === 127) && i++;
|
|
@@ -1781,23 +1781,23 @@ function ci(r) {
|
|
|
1781
1781
|
controlCharRatio: i / r.length
|
|
1782
1782
|
};
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1784
|
+
function ui(r) {
|
|
1785
1785
|
if (r.length === 0) return 1;
|
|
1786
1786
|
let e = 1, t = 0;
|
|
1787
1787
|
for (let n = 0; n < r.length; n++) {
|
|
1788
1788
|
const s = r[n].charCodeAt(0);
|
|
1789
|
-
s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !
|
|
1789
|
+
s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !hi(s) && !fi(s) && t++ : e -= 0.1;
|
|
1790
1790
|
}
|
|
1791
1791
|
const i = t / r.length;
|
|
1792
|
-
return e *= i,
|
|
1792
|
+
return e *= i, di(r) && (e *= 1.1), Math.max(0, Math.min(1, e));
|
|
1793
1793
|
}
|
|
1794
|
-
function
|
|
1794
|
+
function hi(r) {
|
|
1795
1795
|
return r >= 0 && r <= 31 || r >= 127 && r <= 159;
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1797
|
+
function fi(r) {
|
|
1798
1798
|
return r >= 57344 && r <= 63743 || r >= 983040 && r <= 1048573 || r >= 1048576 && r <= 1114109;
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1800
|
+
function di(r) {
|
|
1801
1801
|
return [
|
|
1802
1802
|
/\b\w+\b/,
|
|
1803
1803
|
// Words
|
|
@@ -1813,7 +1813,7 @@ function fi(r) {
|
|
|
1813
1813
|
// Numbers
|
|
1814
1814
|
].some((e) => e.test(r));
|
|
1815
1815
|
}
|
|
1816
|
-
function
|
|
1816
|
+
function V(r) {
|
|
1817
1817
|
if (typeof r != "object" || r === null || Object.prototype.toString.call(r) !== "[object Object]")
|
|
1818
1818
|
return !1;
|
|
1819
1819
|
const e = Object.getPrototypeOf(r);
|
|
@@ -1822,7 +1822,7 @@ function X(r) {
|
|
|
1822
1822
|
const _e = (r, ...e) => {
|
|
1823
1823
|
const t = (n) => {
|
|
1824
1824
|
if (Array.isArray(n)) return n.slice();
|
|
1825
|
-
if (
|
|
1825
|
+
if (V(n)) {
|
|
1826
1826
|
const s = {};
|
|
1827
1827
|
for (const o of Reflect.ownKeys(n)) s[o] = t(n[o]);
|
|
1828
1828
|
return s;
|
|
@@ -1835,7 +1835,7 @@ const _e = (r, ...e) => {
|
|
|
1835
1835
|
const o = n[s];
|
|
1836
1836
|
if (typeof o > "u") continue;
|
|
1837
1837
|
const a = i[s];
|
|
1838
|
-
|
|
1838
|
+
V(a) && V(o) ? i[s] = _e(a, o) : i[s] = t(o);
|
|
1839
1839
|
}
|
|
1840
1840
|
return i;
|
|
1841
1841
|
};
|
|
@@ -1856,7 +1856,7 @@ async function $t(r, e, t) {
|
|
|
1856
1856
|
Y.BODY_USED,
|
|
1857
1857
|
"Response body has already been used or locked"
|
|
1858
1858
|
);
|
|
1859
|
-
const i = r.headers.get("content-type") || "", n = Number(r.headers.get("content-length")) || 0, s = (a, c) => c === "json" || a.startsWith("application/json"), o = (a, c, u) => u === "blob" || a.startsWith("image/") && !a.startsWith("image/svg") || a.startsWith("video/") || a.startsWith("audio/") || !
|
|
1859
|
+
const i = r.headers.get("content-type") || "", n = Number(r.headers.get("content-length")) || 0, s = (a, c) => c === "json" || a.startsWith("application/json"), o = (a, c, u) => u === "blob" || a.startsWith("image/") && !a.startsWith("image/svg") || a.startsWith("video/") || a.startsWith("audio/") || !ai(c);
|
|
1860
1860
|
if ((r.status === 101 || r.status === 426 || r.headers.get("upgrade")) && typeof globalThis.WebSocket < "u") {
|
|
1861
1861
|
const a = new WebSocket(r.url);
|
|
1862
1862
|
return await new Promise((c, u) => {
|
|
@@ -1914,7 +1914,7 @@ async function $t(r, e, t) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
if (typeof u.data > "u" && (u.data = c.length > 0 ? c : void 0), u.ok)
|
|
1916
1916
|
return u;
|
|
1917
|
-
throw new
|
|
1917
|
+
throw new oi(
|
|
1918
1918
|
`Request failed with status code ${r.status}`,
|
|
1919
1919
|
u
|
|
1920
1920
|
);
|
|
@@ -1943,14 +1943,14 @@ var De;
|
|
|
1943
1943
|
if (typeof p == "object" && p.constructor === Object) {
|
|
1944
1944
|
for (const [y, w] of Object.entries(p)) {
|
|
1945
1945
|
if (w == null) continue;
|
|
1946
|
-
const g = y.endsWith("[]"),
|
|
1946
|
+
const g = y.endsWith("[]"), b = g ? y.slice(0, -2) : y, R = `${u}[${b}]`;
|
|
1947
1947
|
if (g) {
|
|
1948
|
-
const
|
|
1948
|
+
const L = `${R}[]`;
|
|
1949
1949
|
if (Array.isArray(w))
|
|
1950
|
-
for (const $ of w) o(
|
|
1951
|
-
else typeof w == "object" && w !== null && w.constructor === Object ? c(`${R}[]`, w) : o(
|
|
1950
|
+
for (const $ of w) o(L, $?.toString());
|
|
1951
|
+
else typeof w == "object" && w !== null && w.constructor === Object ? c(`${R}[]`, w) : o(L, w?.toString());
|
|
1952
1952
|
} else if (Array.isArray(w))
|
|
1953
|
-
for (const
|
|
1953
|
+
for (const L of w) o(R, L?.toString());
|
|
1954
1954
|
else typeof w == "object" && w !== null && w.constructor === Object ? c(R, w) : a(R, w?.toString());
|
|
1955
1955
|
}
|
|
1956
1956
|
return;
|
|
@@ -1976,8 +1976,8 @@ var De;
|
|
|
1976
1976
|
}, a = (c, u, p, y) => {
|
|
1977
1977
|
let w = c;
|
|
1978
1978
|
for (let g = 0; g < u.length; g++) {
|
|
1979
|
-
const
|
|
1980
|
-
g === u.length - 1 ? y ? w[
|
|
1979
|
+
const b = u[g];
|
|
1980
|
+
g === u.length - 1 ? y ? w[b] === void 0 ? w[b] = [p] : Array.isArray(w[b]) ? w[b].push(p) : w[b] = [w[b], p] : w[b] === void 0 ? w[b] = p : Array.isArray(w[b]) ? w[b].push(p) : w[b] = [w[b], p] : ((w[b] === void 0 || typeof w[b] != "object" || Array.isArray(w[b])) && (w[b] = {}), w = w[b]);
|
|
1981
1981
|
}
|
|
1982
1982
|
};
|
|
1983
1983
|
for (const [c, u] of n.entries()) {
|
|
@@ -2003,7 +2003,7 @@ var De;
|
|
|
2003
2003
|
};
|
|
2004
2004
|
function e(n) {
|
|
2005
2005
|
if (Array.isArray(n)) return n.map(e);
|
|
2006
|
-
if (
|
|
2006
|
+
if (V(n)) {
|
|
2007
2007
|
const s = {};
|
|
2008
2008
|
for (const [o, a] of Object.entries(n)) s[o] = e(a);
|
|
2009
2009
|
return s;
|
|
@@ -2020,7 +2020,7 @@ var De;
|
|
|
2020
2020
|
if (n instanceof URLSearchParams || n instanceof FormData || n instanceof Map)
|
|
2021
2021
|
return (0, r.toQueryRecord)(n);
|
|
2022
2022
|
if (typeof n == "string") return (0, r.toQueryRecord)((0, r.fromString)(n));
|
|
2023
|
-
if (
|
|
2023
|
+
if (V(n)) return n;
|
|
2024
2024
|
throw new TypeError(
|
|
2025
2025
|
`unsupported type transformation, got: ${Object.prototype.toString.call(
|
|
2026
2026
|
n
|
|
@@ -2035,7 +2035,7 @@ var De;
|
|
|
2035
2035
|
continue;
|
|
2036
2036
|
}
|
|
2037
2037
|
const c = n[o];
|
|
2038
|
-
|
|
2038
|
+
V(c) && V(a) ? i(c, a) : n[o] = e(a);
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
2041
2041
|
})(De || (De = {}));
|
|
@@ -2068,7 +2068,7 @@ var Se;
|
|
|
2068
2068
|
t.append(i, String(n));
|
|
2069
2069
|
return t;
|
|
2070
2070
|
}
|
|
2071
|
-
if (
|
|
2071
|
+
if (V(e)) {
|
|
2072
2072
|
for (const [i, n] of Object.entries(e))
|
|
2073
2073
|
if (n != null)
|
|
2074
2074
|
if (Array.isArray(n))
|
|
@@ -2130,7 +2130,7 @@ var Se;
|
|
|
2130
2130
|
});
|
|
2131
2131
|
continue;
|
|
2132
2132
|
}
|
|
2133
|
-
if (
|
|
2133
|
+
if (V(s)) {
|
|
2134
2134
|
n(s);
|
|
2135
2135
|
continue;
|
|
2136
2136
|
}
|
|
@@ -2238,8 +2238,8 @@ let rt = class D extends Vt {
|
|
|
2238
2238
|
if (i.url.startsWith("ws"))
|
|
2239
2239
|
try {
|
|
2240
2240
|
const g = new WebSocket(i.url);
|
|
2241
|
-
return await new Promise((
|
|
2242
|
-
const
|
|
2241
|
+
return await new Promise((b, R) => {
|
|
2242
|
+
const L = setTimeout(() => {
|
|
2243
2243
|
R(
|
|
2244
2244
|
new F(
|
|
2245
2245
|
Y.TIMEOUT,
|
|
@@ -2249,9 +2249,9 @@ let rt = class D extends Vt {
|
|
|
2249
2249
|
);
|
|
2250
2250
|
}, y);
|
|
2251
2251
|
g.onopen = () => {
|
|
2252
|
-
clearTimeout(
|
|
2252
|
+
clearTimeout(L), b();
|
|
2253
2253
|
}, g.onerror = ($) => {
|
|
2254
|
-
clearTimeout(
|
|
2254
|
+
clearTimeout(L), R(
|
|
2255
2255
|
new F(
|
|
2256
2256
|
Y.NETWORK_ERROR,
|
|
2257
2257
|
"WebSocket connection failed",
|
|
@@ -2259,7 +2259,7 @@ let rt = class D extends Vt {
|
|
|
2259
2259
|
)
|
|
2260
2260
|
);
|
|
2261
2261
|
}, g.onclose = ($) => {
|
|
2262
|
-
$.code !== 1e3 && (clearTimeout(
|
|
2262
|
+
$.code !== 1e3 && (clearTimeout(L), R(
|
|
2263
2263
|
new F(
|
|
2264
2264
|
Y.NETWORK_ERROR,
|
|
2265
2265
|
`WebSocket closed with code ${$.code}`,
|
|
@@ -2284,18 +2284,18 @@ let rt = class D extends Vt {
|
|
|
2284
2284
|
o && (w = setTimeout(() => {
|
|
2285
2285
|
o.abort();
|
|
2286
2286
|
}, y));
|
|
2287
|
-
const g = await (t.fetch || this.baseConfigs.fetch || globalThis.fetch)(i.rawRequest).catch((
|
|
2287
|
+
const g = await (t.fetch || this.baseConfigs.fetch || globalThis.fetch)(i.rawRequest).catch((b) => {
|
|
2288
2288
|
throw w && clearTimeout(w), o?.signal.aborted ? new F(
|
|
2289
2289
|
Y.TIMEOUT,
|
|
2290
2290
|
`Request timed out after ${y}ms`,
|
|
2291
2291
|
i
|
|
2292
|
-
) : new F(Y.NETWORK_ERROR,
|
|
2292
|
+
) : new F(Y.NETWORK_ERROR, b.message, i);
|
|
2293
2293
|
});
|
|
2294
2294
|
return w && clearTimeout(w), i.rawResponse = g, i.response = await $t(
|
|
2295
2295
|
g,
|
|
2296
2296
|
i.responseType,
|
|
2297
|
-
(
|
|
2298
|
-
t?.onProgress?.(
|
|
2297
|
+
(b, R) => {
|
|
2298
|
+
t?.onProgress?.(b, R);
|
|
2299
2299
|
}
|
|
2300
2300
|
), i.data = i.response.data, i.headers = i.response.headers, this.emit("afterResponse", i);
|
|
2301
2301
|
} catch (g) {
|
|
@@ -2357,14 +2357,14 @@ let rt = class D extends Vt {
|
|
|
2357
2357
|
t
|
|
2358
2358
|
);
|
|
2359
2359
|
if (y instanceof Response) {
|
|
2360
|
-
const w = y, g = { ...t, rawResponse: w },
|
|
2360
|
+
const w = y, g = { ...t, rawResponse: w }, b = await $t(
|
|
2361
2361
|
w,
|
|
2362
2362
|
t.responseType,
|
|
2363
|
-
(R,
|
|
2364
|
-
t.onProgress?.(R,
|
|
2363
|
+
(R, L) => {
|
|
2364
|
+
t.onProgress?.(R, L);
|
|
2365
2365
|
}
|
|
2366
2366
|
);
|
|
2367
|
-
if (g.response =
|
|
2367
|
+
if (g.response = b, g.data = b.data, g.headers = b.headers, e !== "afterResponse") {
|
|
2368
2368
|
const R = await this.emit("afterResponse", g);
|
|
2369
2369
|
return R[D.FINAL_SYMBOL] = !0, R;
|
|
2370
2370
|
} else
|
|
@@ -2388,18 +2388,18 @@ let rt = class D extends Vt {
|
|
|
2388
2388
|
t.url.toString(),
|
|
2389
2389
|
w
|
|
2390
2390
|
);
|
|
2391
|
-
let
|
|
2391
|
+
let b = {};
|
|
2392
2392
|
if (p)
|
|
2393
2393
|
try {
|
|
2394
|
-
|
|
2394
|
+
b = JSON.parse(p);
|
|
2395
2395
|
} catch {
|
|
2396
2396
|
}
|
|
2397
|
-
const R = t.query || {},
|
|
2398
|
-
|
|
2397
|
+
const R = t.query || {}, L = this.mergeQueries(
|
|
2398
|
+
b,
|
|
2399
2399
|
g.search,
|
|
2400
2400
|
R
|
|
2401
2401
|
);
|
|
2402
|
-
t.query =
|
|
2402
|
+
t.query = L;
|
|
2403
2403
|
const $ = new URL(g);
|
|
2404
2404
|
$.search = "", t.url = $.toString();
|
|
2405
2405
|
} catch {
|
|
@@ -2473,7 +2473,7 @@ let rt = class D extends Vt {
|
|
|
2473
2473
|
}
|
|
2474
2474
|
// 版本弃子们.jpg
|
|
2475
2475
|
/** @deprecated Use checkIsPlainObject from utils instead */
|
|
2476
|
-
checkIsPlainObject =
|
|
2476
|
+
checkIsPlainObject = V;
|
|
2477
2477
|
/** @deprecated Use `mergeQueries` instead */
|
|
2478
2478
|
mergeQuery = this.mergeQueries;
|
|
2479
2479
|
};
|
|
@@ -2484,10 +2484,10 @@ let rt = class D extends Vt {
|
|
|
2484
2484
|
* @license MIT
|
|
2485
2485
|
* @author dragon-fish <dragon-fish@qq.com>
|
|
2486
2486
|
*/
|
|
2487
|
-
const
|
|
2487
|
+
const pi = rt.create, At = pi();
|
|
2488
2488
|
/* v8 ignore else -- @preserve */
|
|
2489
2489
|
typeof globalThis < "u" ? globalThis.fexios = At : typeof window < "u" && (window.fexios = At);
|
|
2490
|
-
var
|
|
2490
|
+
var Ne;
|
|
2491
2491
|
((r) => {
|
|
2492
2492
|
function e(i) {
|
|
2493
2493
|
return Array.isArray(i) ? i.join("|") : typeof i == "boolean" || i === null ? i ? "1" : void 0 : typeof i == "number" ? "" + i : i;
|
|
@@ -2503,25 +2503,25 @@ var Ue;
|
|
|
2503
2503
|
const c = e(o);
|
|
2504
2504
|
c != null && s.append(a, c);
|
|
2505
2505
|
}), s;
|
|
2506
|
-
if (
|
|
2506
|
+
if (V(i))
|
|
2507
2507
|
return Object.entries(i).forEach(([o, a]) => {
|
|
2508
2508
|
const c = e(a);
|
|
2509
2509
|
c != null && s.append(o, c);
|
|
2510
2510
|
}), s;
|
|
2511
2511
|
}
|
|
2512
2512
|
r.normalizeBody = t;
|
|
2513
|
-
})(
|
|
2514
|
-
var
|
|
2515
|
-
let
|
|
2513
|
+
})(Ne || (Ne = {}));
|
|
2514
|
+
var xe = /* @__PURE__ */ ((r) => (r.HTTP_ERROR = "HTTP_ERROR", r.LOGIN_FAILED = "LOGIN_FAILED", r.LOGIN_RETRY_LIMIT_EXCEEDED = "LOGIN_RETRY_LIMIT_EXCEEDED", r.TOKEN_RETRY_LIMIT_EXCEEDED = "TOKEN_RETRY_LIMIT_EXCEEDED", r))(xe || {});
|
|
2515
|
+
let z = class extends Error {
|
|
2516
2516
|
constructor(e, t = "", i) {
|
|
2517
2517
|
super(), this.code = e, this.message = t, this.cause = i, this.name = "WikiSaikouError";
|
|
2518
2518
|
}
|
|
2519
2519
|
static is(e, t) {
|
|
2520
2520
|
return e instanceof this && (t === void 0 || e.code === t);
|
|
2521
2521
|
}
|
|
2522
|
-
}, pe = class
|
|
2522
|
+
}, pe = class Qt extends Error {
|
|
2523
2523
|
constructor(e, t) {
|
|
2524
|
-
super(), this.errors = e, this.cause = t, this.name = "MediaWikiApiError", this.errors =
|
|
2524
|
+
super(), this.errors = e, this.cause = t, this.name = "MediaWikiApiError", this.errors = Qt.normalizeErrors(e), this.message = e.map((i) => i.text).filter(Boolean).join(`
|
|
2525
2525
|
`), this.code = this.isBadTokenError() ? "badtoken" : this.errors[0]?.code || "Unknown Error";
|
|
2526
2526
|
}
|
|
2527
2527
|
get firstError() {
|
|
@@ -2569,7 +2569,7 @@ let q = class extends Error {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
}
|
|
2571
2571
|
r.isBadTokenError = n;
|
|
2572
|
-
})(
|
|
2572
|
+
})(z || (z = {}));
|
|
2573
2573
|
const Pt = Symbol.for("__FEXIOS_SAIKOU__");
|
|
2574
2574
|
/**
|
|
2575
2575
|
* FexiosSaikou
|
|
@@ -2585,7 +2585,7 @@ const Pt = Symbol.for("__FEXIOS_SAIKOU__");
|
|
|
2585
2585
|
* @param {string|URL} payload create a new FexiosSaikou instance with the given baseURL
|
|
2586
2586
|
* @param {Fexios} payload or make the given Fexios instance a FexiosSaikou instance
|
|
2587
2587
|
*/
|
|
2588
|
-
function
|
|
2588
|
+
function Jt(r) {
|
|
2589
2589
|
const e = r instanceof rt ? r : new rt({
|
|
2590
2590
|
baseURL: r instanceof URL ? r.toString() : String(r),
|
|
2591
2591
|
responseType: "json"
|
|
@@ -2596,7 +2596,7 @@ function Qt(r) {
|
|
|
2596
2596
|
configurable: !1
|
|
2597
2597
|
}), e._tokens = /* @__PURE__ */ new Map(), e.on("afterResponse", (t) => {
|
|
2598
2598
|
const { data: i, rawRequest: n } = t, s = n?.headers.get("x-mw-token-name");
|
|
2599
|
-
s &&
|
|
2599
|
+
s && z.isBadTokenError(i) && e._tokens.delete(s);
|
|
2600
2600
|
const o = i?.query?.tokens;
|
|
2601
2601
|
o && typeof o == "object" && Object.entries(o).forEach(([c, u]) => {
|
|
2602
2602
|
typeof u == "string" && e._tokens.set(c.replace(/token$/i, "").toLowerCase(), u);
|
|
@@ -2608,9 +2608,9 @@ function Qt(r) {
|
|
|
2608
2608
|
return t;
|
|
2609
2609
|
if (t.body === void 0 || t.body === null)
|
|
2610
2610
|
return t.body = void 0, t;
|
|
2611
|
-
const i = t.body =
|
|
2611
|
+
const i = t.body = Ne.normalizeBody(t.body), n = new URLSearchParams(t.query);
|
|
2612
2612
|
return i.has("format") && n.delete("format"), i.has("formatversion") && n.delete("formatversion"), i.has("action") && n.delete("action"), i.has("origin") && (n.set("origin", "" + i.get("origin")), i.delete("origin")), t.query = Object.fromEntries(n.entries()), t;
|
|
2613
|
-
}), e.on("beforeInit", (t) => (t.query =
|
|
2613
|
+
}), e.on("beforeInit", (t) => (t.query = Ne.normalizeBody(t.query) || {}, t)), e.on("beforeRequest", (t) => {
|
|
2614
2614
|
const i = new URL(t.url), n = i.searchParams;
|
|
2615
2615
|
if (globalThis.location && (!n.has("origin") && location.origin !== i.origin ? (n.set("origin", location.origin), e.baseConfigs.credentials = "include", e.baseConfigs.mode = "cors") : location.origin === i.origin && (n.delete("origin"), e.baseConfigs.credentials = void 0, e.baseConfigs.mode = void 0)), i.searchParams.has("origin")) {
|
|
2616
2616
|
const s = encodeURIComponent(
|
|
@@ -2640,7 +2640,7 @@ const ae = (r, ...e) => {
|
|
|
2640
2640
|
t(c) && t(a) ? n[o] = ae(c, a) : n[o] = i(a);
|
|
2641
2641
|
}
|
|
2642
2642
|
return n;
|
|
2643
|
-
},
|
|
2643
|
+
}, mi = (r, e, t) => {
|
|
2644
2644
|
let i = { ...Zt.DEFAULT_CONFIGS };
|
|
2645
2645
|
if (typeof r == "string" ? i = ae(i, {
|
|
2646
2646
|
baseURL: r,
|
|
@@ -2653,10 +2653,10 @@ const ae = (r, ...e) => {
|
|
|
2653
2653
|
if (typeof i.baseURL != "string")
|
|
2654
2654
|
throw new Error("baseURL is required");
|
|
2655
2655
|
return i;
|
|
2656
|
-
},
|
|
2657
|
-
},
|
|
2656
|
+
}, gi = () => {
|
|
2657
|
+
}, yi = async (r, e) => {
|
|
2658
2658
|
let t = 0;
|
|
2659
|
-
const { retry: i = 3, onRetry: n =
|
|
2659
|
+
const { retry: i = 3, onRetry: n = gi, shouldRetry: s = () => !0 } = e;
|
|
2660
2660
|
let o;
|
|
2661
2661
|
do
|
|
2662
2662
|
try {
|
|
@@ -2679,12 +2679,12 @@ const ae = (r, ...e) => {
|
|
|
2679
2679
|
const ve = class {
|
|
2680
2680
|
constructor(e, t, i) {
|
|
2681
2681
|
this.version = "7.1.2", this.token = this.getToken;
|
|
2682
|
-
const n = this.config =
|
|
2682
|
+
const n = this.config = mi(
|
|
2683
2683
|
e,
|
|
2684
2684
|
t,
|
|
2685
2685
|
i
|
|
2686
2686
|
);
|
|
2687
|
-
this.request =
|
|
2687
|
+
this.request = Jt(n.baseURL);
|
|
2688
2688
|
}
|
|
2689
2689
|
setBaseURL(e) {
|
|
2690
2690
|
return this.config.baseURL = e, this.request.baseConfigs.baseURL = e, this;
|
|
@@ -2729,14 +2729,14 @@ const ve = class {
|
|
|
2729
2729
|
const t = await e();
|
|
2730
2730
|
return this.handleApiResponse(t);
|
|
2731
2731
|
} catch (t) {
|
|
2732
|
-
throw this.config.throwOnApiError &&
|
|
2733
|
-
|
|
2732
|
+
throw this.config.throwOnApiError && z.includesMediaWikiApiError(t) ? new pe(
|
|
2733
|
+
z.extractMediaWikiApiErrors(t),
|
|
2734
2734
|
t
|
|
2735
2735
|
) : t;
|
|
2736
2736
|
}
|
|
2737
2737
|
}
|
|
2738
2738
|
throwIfApiError(e) {
|
|
2739
|
-
const t =
|
|
2739
|
+
const t = z.extractMediaWikiApiErrors(e);
|
|
2740
2740
|
if (t.length > 0)
|
|
2741
2741
|
throw new pe(t, e);
|
|
2742
2742
|
}
|
|
@@ -2768,12 +2768,12 @@ const ve = class {
|
|
|
2768
2768
|
fexiosOptions: a
|
|
2769
2769
|
} = i || {};
|
|
2770
2770
|
if (s < 1)
|
|
2771
|
-
throw new
|
|
2772
|
-
|
|
2771
|
+
throw new z(
|
|
2772
|
+
xe.TOKEN_RETRY_LIMIT_EXCEEDED,
|
|
2773
2773
|
"The limit of the number of times to automatically re-acquire the token has been exceeded"
|
|
2774
2774
|
);
|
|
2775
2775
|
let c = 0;
|
|
2776
|
-
return
|
|
2776
|
+
return yi(
|
|
2777
2777
|
async () => {
|
|
2778
2778
|
const u = await this.getToken(
|
|
2779
2779
|
e,
|
|
@@ -2789,12 +2789,12 @@ const ve = class {
|
|
|
2789
2789
|
headers: { "x-mw-token-name": e }
|
|
2790
2790
|
})
|
|
2791
2791
|
);
|
|
2792
|
-
if (
|
|
2792
|
+
if (z.isBadTokenError(p.data))
|
|
2793
2793
|
throw p;
|
|
2794
2794
|
return p;
|
|
2795
2795
|
} catch (p) {
|
|
2796
|
-
throw
|
|
2797
|
-
|
|
2796
|
+
throw z.isBadTokenError(p) || p?.ok === !1 || pe.is(p) ? p : new z(
|
|
2797
|
+
xe.HTTP_ERROR,
|
|
2798
2798
|
"Network/transport or SDK-internal error (not a MediaWiki API error)",
|
|
2799
2799
|
p
|
|
2800
2800
|
);
|
|
@@ -2805,11 +2805,11 @@ const ve = class {
|
|
|
2805
2805
|
onRetry: (u, p) => {
|
|
2806
2806
|
c = p + 1;
|
|
2807
2807
|
},
|
|
2808
|
-
shouldRetry: (u) =>
|
|
2808
|
+
shouldRetry: (u) => z.isBadTokenError(u) || u?.ok === !1
|
|
2809
2809
|
}
|
|
2810
2810
|
).catch((u) => {
|
|
2811
|
-
throw
|
|
2812
|
-
|
|
2811
|
+
throw z.isBadTokenError(u) || u?.ok === !1 ? new z(
|
|
2812
|
+
xe.TOKEN_RETRY_LIMIT_EXCEEDED,
|
|
2813
2813
|
"Retry attempts for acquiring/using token exhausted",
|
|
2814
2814
|
u
|
|
2815
2815
|
) : u;
|
|
@@ -2844,7 +2844,7 @@ ve.INIT_DEFAULT_PARAMS = {
|
|
|
2844
2844
|
},
|
|
2845
2845
|
defaultParams: ve.INIT_DEFAULT_PARAMS,
|
|
2846
2846
|
throwOnApiError: !1
|
|
2847
|
-
}, ve.createRequestHandler =
|
|
2847
|
+
}, ve.createRequestHandler = Jt;
|
|
2848
2848
|
let Zt = ve;
|
|
2849
2849
|
/**
|
|
2850
2850
|
* WikiSaikou
|
|
@@ -2852,7 +2852,7 @@ let Zt = ve;
|
|
|
2852
2852
|
* @author Dragon-Fish <dragon-fish@qq.com>
|
|
2853
2853
|
* @license MIT
|
|
2854
2854
|
*/
|
|
2855
|
-
let
|
|
2855
|
+
let wi = class extends Zt {
|
|
2856
2856
|
async clientLogin(e, t, i) {
|
|
2857
2857
|
i ||= {}, !i.logincontinue && !i.loginreturnurl && (i.loginreturnurl = location?.origin);
|
|
2858
2858
|
const n = await this.postWithToken(
|
|
@@ -2869,17 +2869,17 @@ let yi = class extends Zt {
|
|
|
2869
2869
|
);
|
|
2870
2870
|
if (n?.data?.clientlogin?.status === "PASS")
|
|
2871
2871
|
return n.data.clientlogin;
|
|
2872
|
-
throw new
|
|
2873
|
-
|
|
2872
|
+
throw new z(
|
|
2873
|
+
xe.LOGIN_FAILED,
|
|
2874
2874
|
n.data.clientlogin.message,
|
|
2875
2875
|
n
|
|
2876
2876
|
);
|
|
2877
2877
|
}
|
|
2878
2878
|
};
|
|
2879
|
-
class
|
|
2879
|
+
class bi {
|
|
2880
2880
|
constructor(e, t = {}) {
|
|
2881
2881
|
this.ctx = e, location?.href && t?.baseURL?.toString()?.startsWith("/") && (t.baseURL = new URL(t.baseURL, location.origin));
|
|
2882
|
-
const i = new
|
|
2882
|
+
const i = new wi({
|
|
2883
2883
|
baseURL: t.baseURL.toString(),
|
|
2884
2884
|
fexiosConfigs: {
|
|
2885
2885
|
headers: {
|
|
@@ -2893,20 +2893,20 @@ class wi {
|
|
|
2893
2893
|
e.set("api", i);
|
|
2894
2894
|
}
|
|
2895
2895
|
}
|
|
2896
|
-
var
|
|
2896
|
+
var vi = Object.create, ft = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, er = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), tr = (r) => {
|
|
2897
2897
|
throw TypeError(r);
|
|
2898
|
-
},
|
|
2898
|
+
}, Si = (r, e, t) => e in r ? ft(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, xi = (r, e) => ft(r, "name", { value: e, configurable: !0 }), ki = (r) => [, , , vi(r?.[er("metadata")] ?? null)], Ei = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], rr = (r) => r !== void 0 && typeof r != "function" ? tr("Function expected") : r, Oi = (r, e, t, i, n) => ({ kind: Ei[r], name: e, metadata: i, addInitializer: (s) => t._ ? tr("Already initialized") : n.push(rr(s || null)) }), Ri = (r, e) => Si(e, er("metadata"), r[3]), $i = (r, e, t, i) => {
|
|
2899
2899
|
for (var n = 0, s = r[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
2900
2900
|
return i;
|
|
2901
|
-
},
|
|
2902
|
-
var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
2903
|
-
|
|
2904
|
-
for (var
|
|
2905
|
-
c =
|
|
2906
|
-
return
|
|
2901
|
+
}, Ai = (r, e, t, i, n, s) => {
|
|
2902
|
+
var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && _i(n, t));
|
|
2903
|
+
xi(n, t);
|
|
2904
|
+
for (var b = i.length - 1; b >= 0; b--)
|
|
2905
|
+
c = Oi(u, t, a = {}, r[3], w), o = (0, i[b])(n, c), a._ = 1, rr(o) && (n = o);
|
|
2906
|
+
return Ri(r, n), g && ft(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
2907
2907
|
}, ir, dt, nr;
|
|
2908
2908
|
ir = [le(["wiki", "wikiTitle"])];
|
|
2909
|
-
class
|
|
2909
|
+
class Ue extends (nr = he) {
|
|
2910
2910
|
constructor(e) {
|
|
2911
2911
|
super(e, "currentPage", !1), this.ctx = e, this.url = new URL(window.location.href), this.isMainPage = void 0, this.wikiTitle = void 0;
|
|
2912
2912
|
}
|
|
@@ -2964,9 +2964,9 @@ class Ne extends (nr = he) {
|
|
|
2964
2964
|
}
|
|
2965
2965
|
}
|
|
2966
2966
|
dt = ki(nr);
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
class
|
|
2967
|
+
Ue = Ai(dt, 0, "CurrentPageService", ir, Ue);
|
|
2968
|
+
$i(dt, 1, Ue);
|
|
2969
|
+
class Pi extends he {
|
|
2970
2970
|
constructor(e) {
|
|
2971
2971
|
super(e, "resourceLoader", !0), this.ctx = e;
|
|
2972
2972
|
}
|
|
@@ -3001,11 +3001,11 @@ class Ai extends he {
|
|
|
3001
3001
|
return e.startsWith("http") || e.startsWith("//") ? e : import.meta.resolve(e);
|
|
3002
3002
|
}
|
|
3003
3003
|
}
|
|
3004
|
-
const
|
|
3005
|
-
function
|
|
3004
|
+
const qe = Object.keys;
|
|
3005
|
+
function Ii(r) {
|
|
3006
3006
|
return typeof r == "boolean";
|
|
3007
3007
|
}
|
|
3008
|
-
function
|
|
3008
|
+
function Ti(r) {
|
|
3009
3009
|
return r && typeof r.nodeType == "number";
|
|
3010
3010
|
}
|
|
3011
3011
|
function pt(r) {
|
|
@@ -3020,18 +3020,18 @@ function ue(r) {
|
|
|
3020
3020
|
function Ee(r) {
|
|
3021
3021
|
return typeof r == "function";
|
|
3022
3022
|
}
|
|
3023
|
-
function
|
|
3023
|
+
function Ci(r) {
|
|
3024
3024
|
return !!(r && r.isComponent);
|
|
3025
3025
|
}
|
|
3026
|
-
function
|
|
3026
|
+
function Li(r) {
|
|
3027
3027
|
return ue(r) && typeof r.length == "number" && typeof r.nodeType != "number";
|
|
3028
3028
|
}
|
|
3029
3029
|
function it(r, e) {
|
|
3030
3030
|
if (r)
|
|
3031
|
-
for (const t of
|
|
3031
|
+
for (const t of qe(r))
|
|
3032
3032
|
e(r[t], t);
|
|
3033
3033
|
}
|
|
3034
|
-
function
|
|
3034
|
+
function ji(r) {
|
|
3035
3035
|
return ue(r) && "current" in r;
|
|
3036
3036
|
}
|
|
3037
3037
|
const nt = {
|
|
@@ -3079,30 +3079,30 @@ const nt = {
|
|
|
3079
3079
|
strokeOpacity: 0,
|
|
3080
3080
|
strokeWidth: 0
|
|
3081
3081
|
};
|
|
3082
|
-
function
|
|
3082
|
+
function Di(r, e) {
|
|
3083
3083
|
return r + e.charAt(0).toUpperCase() + e.substring(1);
|
|
3084
3084
|
}
|
|
3085
|
-
const
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
nt[
|
|
3085
|
+
const Ni = ["Webkit", "ms", "Moz", "O"];
|
|
3086
|
+
qe(nt).forEach((r) => {
|
|
3087
|
+
Ni.forEach((e) => {
|
|
3088
|
+
nt[Di(e, r)] = 0;
|
|
3089
3089
|
});
|
|
3090
3090
|
});
|
|
3091
3091
|
const Ui = Symbol.for("jsx-dom:type");
|
|
3092
3092
|
var or = /* @__PURE__ */ function(r) {
|
|
3093
3093
|
return r.ShadowRoot = "ShadowRoot", r;
|
|
3094
3094
|
}(or || {});
|
|
3095
|
-
function
|
|
3095
|
+
function Mi(r) {
|
|
3096
3096
|
return r != null && r[Ui] === or.ShadowRoot;
|
|
3097
3097
|
}
|
|
3098
|
-
const
|
|
3098
|
+
const Bi = "http://www.w3.org/2000/svg", Hi = "http://www.w3.org/1999/xlink", Fi = "http://www.w3.org/XML/1998/namespace";
|
|
3099
3099
|
function ar(r) {
|
|
3100
|
-
return !
|
|
3100
|
+
return !Ii(r) && r != null;
|
|
3101
3101
|
}
|
|
3102
3102
|
function st(r) {
|
|
3103
|
-
return Array.isArray(r) ? r.map(st).filter(Boolean).join(" ") : ue(r) ? Symbol.iterator in r ? st(Array.from(r)) :
|
|
3103
|
+
return Array.isArray(r) ? r.map(st).filter(Boolean).join(" ") : ue(r) ? Symbol.iterator in r ? st(Array.from(r)) : qe(r).filter((e) => r[e]).join(" ") : ar(r) ? "" + r : "";
|
|
3104
3104
|
}
|
|
3105
|
-
const
|
|
3105
|
+
const zi = {
|
|
3106
3106
|
animate: 0,
|
|
3107
3107
|
circle: 0,
|
|
3108
3108
|
clipPath: 0,
|
|
@@ -3157,12 +3157,12 @@ const qi = {
|
|
|
3157
3157
|
tspan: 0,
|
|
3158
3158
|
use: 0,
|
|
3159
3159
|
view: 0
|
|
3160
|
-
},
|
|
3161
|
-
function
|
|
3160
|
+
}, qi = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;
|
|
3161
|
+
function Ki(r) {
|
|
3162
3162
|
const e = document.createDocumentFragment();
|
|
3163
3163
|
return Ke(r.children, e), e;
|
|
3164
3164
|
}
|
|
3165
|
-
function
|
|
3165
|
+
function Wi(r, e, t) {
|
|
3166
3166
|
e = {
|
|
3167
3167
|
...e,
|
|
3168
3168
|
children: t
|
|
@@ -3172,13 +3172,13 @@ function Ki(r, e, t) {
|
|
|
3172
3172
|
}
|
|
3173
3173
|
function A(r, e) {
|
|
3174
3174
|
let { children: t, ...i } = e;
|
|
3175
|
-
!i.namespaceURI &&
|
|
3175
|
+
!i.namespaceURI && zi[r] === 0 && (i = {
|
|
3176
3176
|
...i,
|
|
3177
|
-
namespaceURI:
|
|
3177
|
+
namespaceURI: Bi
|
|
3178
3178
|
});
|
|
3179
3179
|
let n;
|
|
3180
3180
|
if (pt(r)) {
|
|
3181
|
-
if (n = i.namespaceURI ? document.createElementNS(i.namespaceURI, r) : document.createElement(r),
|
|
3181
|
+
if (n = i.namespaceURI ? document.createElementNS(i.namespaceURI, r) : document.createElement(r), Xi(i, n), Ke(t, n), n instanceof window.HTMLSelectElement && i.value != null)
|
|
3182
3182
|
if (i.multiple === !0 && Array.isArray(i.value)) {
|
|
3183
3183
|
const s = i.value.map((o) => String(o));
|
|
3184
3184
|
n.querySelectorAll("option").forEach(
|
|
@@ -3191,7 +3191,7 @@ function A(r, e) {
|
|
|
3191
3191
|
ue(r.defaultProps) && (i = {
|
|
3192
3192
|
...r.defaultProps,
|
|
3193
3193
|
...i
|
|
3194
|
-
}), n =
|
|
3194
|
+
}), n = Ci(r) ? Wi(r, i, t) : r({
|
|
3195
3195
|
...i,
|
|
3196
3196
|
children: t
|
|
3197
3197
|
});
|
|
@@ -3200,23 +3200,23 @@ function A(r, e) {
|
|
|
3200
3200
|
return n;
|
|
3201
3201
|
}
|
|
3202
3202
|
function mt(r, e) {
|
|
3203
|
-
|
|
3203
|
+
ji(r) ? r.current = e : Ee(r) && r(e);
|
|
3204
3204
|
}
|
|
3205
3205
|
function Ke(r, e) {
|
|
3206
|
-
if (
|
|
3207
|
-
|
|
3206
|
+
if (Li(r))
|
|
3207
|
+
Yi(r, e);
|
|
3208
3208
|
else if (pt(r) || sr(r))
|
|
3209
3209
|
Ye(document.createTextNode(r), e);
|
|
3210
3210
|
else if (r === null)
|
|
3211
3211
|
Ye(document.createComment(""), e);
|
|
3212
|
-
else if (
|
|
3212
|
+
else if (Ti(r))
|
|
3213
3213
|
Ye(r, e);
|
|
3214
|
-
else if (
|
|
3214
|
+
else if (Mi(r)) {
|
|
3215
3215
|
const t = e.attachShadow(r.attr);
|
|
3216
3216
|
Ke(r.children, t), mt(r.ref, t);
|
|
3217
3217
|
}
|
|
3218
3218
|
}
|
|
3219
|
-
function
|
|
3219
|
+
function Yi(r, e) {
|
|
3220
3220
|
for (const t of [...r])
|
|
3221
3221
|
Ke(t, e);
|
|
3222
3222
|
return e;
|
|
@@ -3224,7 +3224,7 @@ function Wi(r, e) {
|
|
|
3224
3224
|
function Ye(r, e) {
|
|
3225
3225
|
e instanceof window.HTMLTemplateElement ? e.content.appendChild(r) : e.appendChild(r);
|
|
3226
3226
|
}
|
|
3227
|
-
function
|
|
3227
|
+
function Te(r, e) {
|
|
3228
3228
|
return r.replace(/[A-Z]/g, (t) => e + t.toLowerCase());
|
|
3229
3229
|
}
|
|
3230
3230
|
function cr(r, e) {
|
|
@@ -3232,7 +3232,7 @@ function cr(r, e) {
|
|
|
3232
3232
|
i.indexOf("-") === 0 ? r.style.setProperty(i, t) : sr(t) && nt[i] !== 0 ? r.style[i] = t + "px" : r.style[i] = t;
|
|
3233
3233
|
}));
|
|
3234
3234
|
}
|
|
3235
|
-
function
|
|
3235
|
+
function Gi(r, e, t) {
|
|
3236
3236
|
switch (r) {
|
|
3237
3237
|
case "xlinkActuate":
|
|
3238
3238
|
case "xlinkArcrole":
|
|
@@ -3241,15 +3241,15 @@ function Yi(r, e, t) {
|
|
|
3241
3241
|
case "xlinkShow":
|
|
3242
3242
|
case "xlinkTitle":
|
|
3243
3243
|
case "xlinkType":
|
|
3244
|
-
It(t,
|
|
3244
|
+
It(t, Hi, Te(r, ":"), e);
|
|
3245
3245
|
return;
|
|
3246
3246
|
case "xmlnsXlink":
|
|
3247
|
-
fe(t,
|
|
3247
|
+
fe(t, Te(r, ":"), e);
|
|
3248
3248
|
return;
|
|
3249
3249
|
case "xmlBase":
|
|
3250
3250
|
case "xmlLang":
|
|
3251
3251
|
case "xmlSpace":
|
|
3252
|
-
It(t, Fi,
|
|
3252
|
+
It(t, Fi, Te(r, ":"), e);
|
|
3253
3253
|
return;
|
|
3254
3254
|
}
|
|
3255
3255
|
switch (r) {
|
|
@@ -3314,7 +3314,7 @@ function Yi(r, e, t) {
|
|
|
3314
3314
|
i in window ? s = i.substring(2) : s = i[2] + r.slice(3), t.addEventListener(s, e);
|
|
3315
3315
|
}
|
|
3316
3316
|
}
|
|
3317
|
-
} else ue(e) ? t[r] = e : e === !0 ? fe(t, r, "") : e !== !1 && e != null && (t instanceof SVGElement && !
|
|
3317
|
+
} else ue(e) ? t[r] = e : e === !0 ? fe(t, r, "") : e !== !1 && e != null && (t instanceof SVGElement && !qi.test(r) ? fe(t, Te(r, "-"), e) : fe(t, r, e));
|
|
3318
3318
|
}
|
|
3319
3319
|
function fe(r, e, t) {
|
|
3320
3320
|
r.setAttribute(e, t);
|
|
@@ -3322,14 +3322,14 @@ function fe(r, e, t) {
|
|
|
3322
3322
|
function It(r, e, t, i) {
|
|
3323
3323
|
r.setAttributeNS(e, t, i);
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3326
|
-
for (const t of
|
|
3327
|
-
|
|
3325
|
+
function Xi(r, e) {
|
|
3326
|
+
for (const t of qe(r))
|
|
3327
|
+
Gi(t, r[t], e);
|
|
3328
3328
|
return e;
|
|
3329
3329
|
}
|
|
3330
3330
|
var gt = /* @__PURE__ */ ((r) => (r.Init = "modal.init", r.BeforeShow = "modal.beforeShow", r.Show = "modal.show", r.BeforeClose = "modal.beforeClose", r.Close = "modal.close", r.Destroy = "modal.destroy", r.ToastShow = "toast.show", r.ToastClose = "toast.close", r))(gt || {});
|
|
3331
|
-
let
|
|
3332
|
-
const
|
|
3331
|
+
let Vi = 0;
|
|
3332
|
+
const Tt = (r) => `${r}-${++Vi}`;
|
|
3333
3333
|
function ye(r) {
|
|
3334
3334
|
return r instanceof Node ? r : document.createTextNode(String(r));
|
|
3335
3335
|
}
|
|
@@ -3337,7 +3337,7 @@ function ee(r, e) {
|
|
|
3337
3337
|
if (!r) throw new Error(`${e ?? "Element"} not found`);
|
|
3338
3338
|
return r;
|
|
3339
3339
|
}
|
|
3340
|
-
function
|
|
3340
|
+
function Ct(r) {
|
|
3341
3341
|
const e = [
|
|
3342
3342
|
"a[href]",
|
|
3343
3343
|
"button:not([disabled])",
|
|
@@ -3350,13 +3350,13 @@ function Tt(r) {
|
|
|
3350
3350
|
(t) => !!(t.offsetWidth || t.offsetHeight || t.getClientRects().length)
|
|
3351
3351
|
);
|
|
3352
3352
|
}
|
|
3353
|
-
function
|
|
3353
|
+
function U(r, e = {}) {
|
|
3354
3354
|
const t = document.createElement(r);
|
|
3355
3355
|
if (e.className && (t.className = e.className), e.html != null && (t.innerHTML = e.html), e.text != null && (t.textContent = e.text), e.attrs)
|
|
3356
3356
|
for (const [i, n] of Object.entries(e.attrs)) t.setAttribute(i, n);
|
|
3357
3357
|
return t;
|
|
3358
3358
|
}
|
|
3359
|
-
const
|
|
3359
|
+
const Qi = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), lr = ["ctrl", "alt", "shift", "meta"];
|
|
3360
3360
|
function Ji(r) {
|
|
3361
3361
|
if (!r) return null;
|
|
3362
3362
|
const e = String(r).trim().toLowerCase().split(/[+\-\s]+/g).filter(Boolean), t = [];
|
|
@@ -3383,7 +3383,7 @@ function Ji(r) {
|
|
|
3383
3383
|
continue;
|
|
3384
3384
|
}
|
|
3385
3385
|
if (a === "mod") {
|
|
3386
|
-
n(
|
|
3386
|
+
n(Qi ? "meta" : "ctrl");
|
|
3387
3387
|
continue;
|
|
3388
3388
|
}
|
|
3389
3389
|
a === "esc" && (a = "escape"), a === "return" && (a = "enter"), (a === "space" || a === "spacebar") && (a = "space"), i = a;
|
|
@@ -3391,7 +3391,7 @@ function Ji(r) {
|
|
|
3391
3391
|
const s = lr.filter((o) => t.includes(o));
|
|
3392
3392
|
return !i || i === "" ? s.length ? s.join("+") : null : s.length ? `${s.join("+")}+${i}` : i;
|
|
3393
3393
|
}
|
|
3394
|
-
function
|
|
3394
|
+
function Zi(r) {
|
|
3395
3395
|
const e = [];
|
|
3396
3396
|
r.ctrlKey && e.push("ctrl"), r.altKey && e.push("alt"), r.shiftKey && e.push("shift"), r.metaKey && e.push("meta");
|
|
3397
3397
|
let t = r.key;
|
|
@@ -3399,7 +3399,7 @@ function Qi(r) {
|
|
|
3399
3399
|
const i = (t.length, t.toLowerCase()), n = lr.filter((s) => e.includes(s));
|
|
3400
3400
|
return n.length ? `${n.join("+")}+${i}` : i;
|
|
3401
3401
|
}
|
|
3402
|
-
class
|
|
3402
|
+
class en {
|
|
3403
3403
|
constructor() {
|
|
3404
3404
|
this.zBase = 1e3, this.stack = [];
|
|
3405
3405
|
}
|
|
@@ -3432,10 +3432,10 @@ class Zi {
|
|
|
3432
3432
|
document.body.classList.remove("ipe-modal-no-scroll");
|
|
3433
3433
|
}
|
|
3434
3434
|
}
|
|
3435
|
-
const B = new
|
|
3435
|
+
const B = new en();
|
|
3436
3436
|
class Me {
|
|
3437
3437
|
constructor(e = {}) {
|
|
3438
|
-
this.backdropId =
|
|
3438
|
+
this.backdropId = Tt("ipe-modal-backdrop"), this.modalId = Tt("ipe-modal"), this.numberId = this.modalId.split("-")[1], this._isDestroyed = !1, this.pluginName = "normalModal", this.buttonElsLeft = [], this.buttonElsRight = [], this.keyMap = /* @__PURE__ */ new Map(), this.isOpen = !1, this.isToast = !1, this.isDragging = !1, this.dragStartX = 0, this.dragStartY = 0, this.modalStartX = 0, this.modalStartY = 0, this.Event = gt, this._hooks = [], this.startCloseTimer = (t) => {
|
|
3439
3439
|
this.stopCloseTimer(), this.closeTimer = window.setTimeout(() => this.close(), t);
|
|
3440
3440
|
}, this.stopCloseTimer = () => {
|
|
3441
3441
|
this.closeTimer && window.clearTimeout(this.closeTimer), this.closeTimer = void 0;
|
|
@@ -3485,46 +3485,46 @@ class Me {
|
|
|
3485
3485
|
if (this.$modal) return this;
|
|
3486
3486
|
const e = this.options.backdrop !== !1;
|
|
3487
3487
|
let t;
|
|
3488
|
-
e && (t =
|
|
3488
|
+
e && (t = U("div", {
|
|
3489
3489
|
className: "ipe-modal-backdrop",
|
|
3490
3490
|
attrs: { id: this.backdropId, "data-modal-id": this.modalId }
|
|
3491
3491
|
}));
|
|
3492
|
-
const i =
|
|
3492
|
+
const i = U("div", {
|
|
3493
3493
|
className: "ipe-modal-modal",
|
|
3494
3494
|
attrs: { id: this.modalId, role: "dialog", "aria-modal": "true", tabindex: "-1" }
|
|
3495
3495
|
});
|
|
3496
3496
|
if (i.modal = this, !e) {
|
|
3497
3497
|
i.classList.add("no-backdrop");
|
|
3498
|
-
const g = window.pageYOffset || document.documentElement.scrollTop,
|
|
3498
|
+
const g = window.pageYOffset || document.documentElement.scrollTop, b = window.pageXOffset || document.documentElement.scrollLeft, R = window.innerWidth;
|
|
3499
3499
|
i.style.top = `${g + 60}px`, this.once("modal.show", () => {
|
|
3500
|
-
i.style.left = `${
|
|
3500
|
+
i.style.left = `${b + R / 2 - i.offsetWidth / 2}px`;
|
|
3501
3501
|
});
|
|
3502
3502
|
}
|
|
3503
|
-
const n =
|
|
3503
|
+
const n = U("div", {
|
|
3504
3504
|
className: `ipe-modal-modal__window size--${this.options.sizeClass || "auto"} plugin--${this.pluginName}`
|
|
3505
3505
|
});
|
|
3506
3506
|
n.modal = this;
|
|
3507
|
-
const s =
|
|
3507
|
+
const s = U("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, a = U("h2", {
|
|
3508
3508
|
className: "ipe-modal-modal__title",
|
|
3509
3509
|
attrs: { id: o, role: "heading", "aria-level": "2" }
|
|
3510
3510
|
});
|
|
3511
3511
|
i.setAttribute("aria-labelledby", o);
|
|
3512
|
-
const c =
|
|
3512
|
+
const c = U("div", { className: "ipe-modal-modal__icons" });
|
|
3513
3513
|
if (this.options.closeIcon) {
|
|
3514
|
-
const g =
|
|
3514
|
+
const g = U("button", {
|
|
3515
3515
|
className: "ipe-modal-modal__close",
|
|
3516
3516
|
attrs: { type: "button", "aria-label": "Close" },
|
|
3517
3517
|
html: "×"
|
|
3518
3518
|
});
|
|
3519
3519
|
g.addEventListener("click", () => {
|
|
3520
|
-
let
|
|
3521
|
-
typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (
|
|
3520
|
+
let b = !0;
|
|
3521
|
+
typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (b = !1) : this.options.onClickClose === !1 && (b = !1), b && this.close();
|
|
3522
3522
|
}), c.appendChild(g);
|
|
3523
3523
|
}
|
|
3524
3524
|
s.append(a, c), !e && this.options.draggable && (s.style.cursor = "move", s.style.userSelect = "none", s.addEventListener("pointerdown", this.onDragStart.bind(this)));
|
|
3525
|
-
const u =
|
|
3525
|
+
const u = U("div", { className: "ipe-modal-modal__content" }), p = U("div", { className: "ipe-modal-modal__footer" }), y = U("div", {
|
|
3526
3526
|
className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--left"
|
|
3527
|
-
}), w =
|
|
3527
|
+
}), w = U("div", {
|
|
3528
3528
|
className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--right"
|
|
3529
3529
|
});
|
|
3530
3530
|
return p.append(y, w), n.append(s, u, p), i.appendChild(n), this.$backdrop = t, this.$modal = i, this.$window = n, this.$header = s, this.$title = a, this.$icons = c, this.$content = u, this.$footer = p, this.$buttonsLeft = y, this.$buttonsRight = w, this.options.title && this.setTitle(this.options.title), this.options.content && this.setContent(this.options.content), this.options.buttons?.length ? this.setButtons(this.options.buttons) : p.style.display = "none", this.options.center && this.$modal.classList.add("is-centered"), this.options.fitScreen && this.$modal.classList.add("is-fullscreen"), this.options.iconButtons && this.$header.classList.add("has-icon-buttons"), this.options.className && this.$window.classList.add(...this.options.className.split(/[\s\.#+]+/g).filter(Boolean)), typeof this.options.fixedHeight == "number" ? this.$window.style.height = `${Math.max(0, this.options.fixedHeight)}px` : this.options.fixedHeight === !0 && this.$window.classList.add("is-fixed-height"), t && t.addEventListener("pointerdown", (g) => {
|
|
@@ -3644,7 +3644,7 @@ class Me {
|
|
|
3644
3644
|
const t = this.get$icons();
|
|
3645
3645
|
t.innerHTML = "";
|
|
3646
3646
|
for (const i of e) {
|
|
3647
|
-
const n =
|
|
3647
|
+
const n = U("button", {
|
|
3648
3648
|
className: `ipe-modal-modal__icon ${i.className}`,
|
|
3649
3649
|
attrs: { type: "button" }
|
|
3650
3650
|
});
|
|
@@ -3668,7 +3668,7 @@ class Me {
|
|
|
3668
3668
|
return this;
|
|
3669
3669
|
}
|
|
3670
3670
|
generateButton(e) {
|
|
3671
|
-
const t = e.type ?? "button", i = t === "link" ?
|
|
3671
|
+
const t = e.type ?? "button", i = t === "link" ? U("a") : U("button", { attrs: { type: "button" } });
|
|
3672
3672
|
e.id && (i.id = e.id), i.className = `ipe-modal-btn ${e.className ?? ""}`.trim();
|
|
3673
3673
|
const n = ye(e.label ?? "OK");
|
|
3674
3674
|
if (i.append(n), t === "link" && e.href && (i.href = e.href), e.method && i.addEventListener("click", (s) => {
|
|
@@ -3758,7 +3758,7 @@ class Me {
|
|
|
3758
3758
|
return (!s.dispatchEvent(o) || o.defaultPrevented) && (n = !1), n;
|
|
3759
3759
|
}
|
|
3760
3760
|
focusFirst() {
|
|
3761
|
-
const e = this.get$modal(), t =
|
|
3761
|
+
const e = this.get$modal(), t = Ct(e);
|
|
3762
3762
|
t.length ? t[0].focus() : e.focus({ preventScroll: !0 });
|
|
3763
3763
|
}
|
|
3764
3764
|
onKeyDown(e) {
|
|
@@ -3770,7 +3770,7 @@ class Me {
|
|
|
3770
3770
|
const t = this.get$modal();
|
|
3771
3771
|
if (!t.contains(document.activeElement)) return;
|
|
3772
3772
|
if (e.key === "Tab") {
|
|
3773
|
-
const a =
|
|
3773
|
+
const a = Ct(t);
|
|
3774
3774
|
if (!a.length) return;
|
|
3775
3775
|
const c = a[0], u = a[a.length - 1], p = document.activeElement;
|
|
3776
3776
|
e.shiftKey && p === c ? (e.preventDefault(), u.focus()) : !e.shiftKey && p === u && (e.preventDefault(), c.focus());
|
|
@@ -3778,7 +3778,7 @@ class Me {
|
|
|
3778
3778
|
const i = e.ctrlKey || e.altKey || e.metaKey, n = e.target;
|
|
3779
3779
|
if (!i && (n && ["INPUT", "TEXTAREA"].includes(n.tagName) || n.contentEditable === "true"))
|
|
3780
3780
|
return;
|
|
3781
|
-
const s =
|
|
3781
|
+
const s = Zi(e), o = this.keyMap.get(s);
|
|
3782
3782
|
if (o) {
|
|
3783
3783
|
e.preventDefault(), o.click();
|
|
3784
3784
|
return;
|
|
@@ -3816,7 +3816,7 @@ class Me {
|
|
|
3816
3816
|
/** Show as toast (no backdrop, container stack). */
|
|
3817
3817
|
showToast(e) {
|
|
3818
3818
|
this.$window || this.init();
|
|
3819
|
-
const t =
|
|
3819
|
+
const t = tn(e.position ?? "top right"), i = this.get$window();
|
|
3820
3820
|
this.isToast = !0, i.style.pointerEvents = "auto", this.applyAnimation(!0), t.appendChild(i);
|
|
3821
3821
|
const n = (typeof this.options.closeAfter == "number" ? this.options.closeAfter : this.options.closeAfter?.time) ?? 3e3, s = (typeof this.options.closeAfter == "number" ? !0 : this.options.closeAfter?.resetOnHover) ?? !0;
|
|
3822
3822
|
return n > 0 && (this.startCloseTimer(n), s && (i.addEventListener("mouseenter", this.stopCloseTimer), i.addEventListener("mouseleave", () => this.startCloseTimer(n)))), this.isOpen = !0, this.options.onShow?.(this), oe.push(this), this.emit(
|
|
@@ -4013,7 +4013,7 @@ class Me {
|
|
|
4013
4013
|
t.title = a[0].toUpperCase() + a.slice(1).toLowerCase();
|
|
4014
4014
|
}
|
|
4015
4015
|
const n = t.icon ?? this.getDefaultNotifyIcon(e);
|
|
4016
|
-
n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ A(
|
|
4016
|
+
n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ A(Ki, { children: [
|
|
4017
4017
|
n,
|
|
4018
4018
|
t.title
|
|
4019
4019
|
] })), e === "confirm" && (typeof t.closeAfter > "u" && (t.closeAfter = 0), t.okBtn || (t.okBtn = { label: "OK" })), t.okBtn && (typeof t.okBtn != "object" && (t.okBtn = { label: "OK" }), t.okBtn.label ??= "OK", t.okBtn.className ??= "is-primary is-text ok-btn", t.okBtn.method = (a, c) => {
|
|
@@ -4040,15 +4040,15 @@ class Me {
|
|
|
4040
4040
|
}
|
|
4041
4041
|
}
|
|
4042
4042
|
const oe = [];
|
|
4043
|
-
function
|
|
4043
|
+
function tn(r = "top right") {
|
|
4044
4044
|
const e = "ipe-modal-toast-container", t = `${e}-${r.replace(/[\s-\.|\/]+/g, "-")}`;
|
|
4045
4045
|
let i = document.getElementById(t);
|
|
4046
|
-
return i || (i =
|
|
4046
|
+
return i || (i = U("div", {
|
|
4047
4047
|
className: `${e} ${r}`,
|
|
4048
4048
|
attrs: { id: t, "data-position": r }
|
|
4049
4049
|
}), document.body.appendChild(i)), i;
|
|
4050
4050
|
}
|
|
4051
|
-
class
|
|
4051
|
+
class C extends Me {
|
|
4052
4052
|
constructor(e = {}) {
|
|
4053
4053
|
e.className ||= "", e.className += " theme-ipe", e.modalAnimation ||= {
|
|
4054
4054
|
show: "ipe-modal-fade-in",
|
|
@@ -4063,7 +4063,7 @@ class T extends Me {
|
|
|
4063
4063
|
this._tmpDisabledActiveInputs = t, t.forEach((i) => {
|
|
4064
4064
|
i.disabled = !0;
|
|
4065
4065
|
}), this.get$content().append(
|
|
4066
|
-
/* @__PURE__ */
|
|
4066
|
+
/* @__PURE__ */ H(
|
|
4067
4067
|
"div",
|
|
4068
4068
|
{
|
|
4069
4069
|
id: "ipe-modalLoadingWrapper",
|
|
@@ -4079,7 +4079,7 @@ class T extends Me {
|
|
|
4079
4079
|
backgroundColor: "rgba(255, 255, 255, 0.5)",
|
|
4080
4080
|
zIndex: 2e3
|
|
4081
4081
|
},
|
|
4082
|
-
children: /* @__PURE__ */
|
|
4082
|
+
children: /* @__PURE__ */ H(Er, { style: { width: "80%", maxWidth: "800px" } })
|
|
4083
4083
|
}
|
|
4084
4084
|
)
|
|
4085
4085
|
);
|
|
@@ -4092,10 +4092,10 @@ class T extends Me {
|
|
|
4092
4092
|
}
|
|
4093
4093
|
}
|
|
4094
4094
|
}
|
|
4095
|
-
class
|
|
4095
|
+
class rn {
|
|
4096
4096
|
constructor(e) {
|
|
4097
|
-
this.ctx = e, this.IPEModal =
|
|
4098
|
-
|
|
4097
|
+
this.ctx = e, this.IPEModal = C, this.IPEModalEvent = gt, this.show = C.show.bind(C), this.createObject = C.createObject.bind(C), this.close = C.close.bind(C), this.closeAll = C.closeAll.bind(C), this.removeAll = C.removeAll.bind(C), this.dialog = C.dialog.bind(C), this.confirm = C.confirm.bind(C), this.notify = C.notify.bind(C), e.set("modal", this), e.on("dispose", () => {
|
|
4098
|
+
C.closeAll();
|
|
4099
4099
|
});
|
|
4100
4100
|
}
|
|
4101
4101
|
}
|
|
@@ -4128,132 +4128,161 @@ const ur = (r) => {
|
|
|
4128
4128
|
n.set(o, a);
|
|
4129
4129
|
return i.search = n.toString(), i.hash = "", i;
|
|
4130
4130
|
};
|
|
4131
|
-
var
|
|
4131
|
+
var nn = Object.create, yt = Object.defineProperty, sn = Object.getOwnPropertyDescriptor, fr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), dr = (r) => {
|
|
4132
4132
|
throw TypeError(r);
|
|
4133
|
-
},
|
|
4133
|
+
}, on = (r, e, t) => e in r ? yt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, an = (r, e) => yt(r, "name", { value: e, configurable: !0 }), cn = (r) => [, , , nn(r?.[fr("metadata")] ?? null)], ln = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], pr = (r) => r !== void 0 && typeof r != "function" ? dr("Function expected") : r, un = (r, e, t, i, n) => ({ kind: ln[r], name: e, metadata: i, addInitializer: (s) => t._ ? dr("Already initialized") : n.push(pr(s || null)) }), hn = (r, e) => on(e, fr("metadata"), r[3]), fn = (r, e, t, i) => {
|
|
4134
4134
|
for (var n = 0, s = r[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
4135
4135
|
return i;
|
|
4136
|
-
},
|
|
4137
|
-
var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
4138
|
-
|
|
4139
|
-
for (var
|
|
4140
|
-
c =
|
|
4141
|
-
return
|
|
4136
|
+
}, dn = (r, e, t, i, n, s) => {
|
|
4137
|
+
var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && sn(n, t));
|
|
4138
|
+
an(n, t);
|
|
4139
|
+
for (var b = i.length - 1; b >= 0; b--)
|
|
4140
|
+
c = un(u, t, a = {}, r[3], w), o = (0, i[b])(n, c), a._ = 1, pr(o) && (n = o);
|
|
4141
|
+
return hn(r, n), g && yt(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
4142
4142
|
}, mr, wt, gr;
|
|
4143
4143
|
mr = [le(["api", "storage"])];
|
|
4144
4144
|
class Be extends (gr = he) {
|
|
4145
4145
|
constructor(e) {
|
|
4146
|
-
super(e, "wiki", !1), this.ctx = e, this._data =
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4146
|
+
super(e, "wiki", !1), this.ctx = e, this._data = {}, this.CACHE_VERSION = 3, this.CACHE_TTL = {
|
|
4147
|
+
siteinfo: 1e3 * 60 * 60 * 24 * 3,
|
|
4148
|
+
// 3 days
|
|
4149
|
+
userinfo: 1e3 * 60 * 30
|
|
4150
|
+
// 30 minutes
|
|
4151
|
+
}, this.QUERY_DATA = {
|
|
4152
|
+
siteinfo: {
|
|
4153
|
+
meta: "siteinfo",
|
|
4154
|
+
siprop: "general|specialpagealiases|namespacealiases|namespaces|magicwords"
|
|
4155
|
+
},
|
|
4156
|
+
userinfo: { meta: "userinfo", uiprop: "groups|rights|blockinfo|options" }
|
|
4157
|
+
}, this.CACHE_DB = void 0, this.mwConfig = {
|
|
4151
4158
|
get: (t, i) => window?.mw?.config?.get?.(t, i) ?? i,
|
|
4152
4159
|
has: (t) => window?.mw?.config?.exists?.(t) ?? !1,
|
|
4153
4160
|
get values() {
|
|
4154
4161
|
return window?.mw?.config?.values || {};
|
|
4155
4162
|
}
|
|
4156
|
-
}, this.
|
|
4163
|
+
}, this.CACHE_DB = e.storage.createDatabse(
|
|
4164
|
+
"wiki-metadata",
|
|
4165
|
+
1 / 0,
|
|
4166
|
+
this.CACHE_VERSION
|
|
4167
|
+
);
|
|
4168
|
+
}
|
|
4169
|
+
get logger() {
|
|
4170
|
+
return this.ctx.logger("WIKI_METADATA");
|
|
4157
4171
|
}
|
|
4158
4172
|
get api() {
|
|
4159
4173
|
return this.ctx.api;
|
|
4160
4174
|
}
|
|
4161
4175
|
async start() {
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
const t = await this.fetchFromApi();
|
|
4167
|
-
this.saveToCache(t), this._data = t, this.logger.debug("Fetched from API");
|
|
4168
|
-
}
|
|
4169
|
-
this.logger.info("loaded", this._data), this.ctx.set("getUrl", this.getUrl.bind(this)), this.ctx.set("getSciprtUrl", this.getSciprtUrl.bind(this)), this.ctx.set("getMainpageUrl", this.getMainpageUrl.bind(this)), this.ctx.inject(["preferences"], (t) => {
|
|
4170
|
-
t.preferences.registerCustomConfig(
|
|
4176
|
+
await Promise.all(
|
|
4177
|
+
Object.keys(this.QUERY_DATA).map((e) => this.initData(e))
|
|
4178
|
+
), this.ctx.set("getUrl", this.getUrl.bind(this)), this.ctx.set("getSciprtUrl", this.getSciprtUrl.bind(this)), this.ctx.set("getMainpageUrl", this.getMainpageUrl.bind(this)), this.ctx.inject(["preferences"], (e) => {
|
|
4179
|
+
e.preferences.registerCustomConfig(
|
|
4171
4180
|
"WikiMetadataService",
|
|
4172
4181
|
Ze.object({
|
|
4173
4182
|
WikiMetadataService: Ze.const(
|
|
4174
|
-
/* @__PURE__ */
|
|
4175
|
-
/* @__PURE__ */
|
|
4176
|
-
/* @__PURE__ */
|
|
4177
|
-
/* @__PURE__ */
|
|
4178
|
-
/* @__PURE__ */
|
|
4183
|
+
/* @__PURE__ */ H("div", { children: [
|
|
4184
|
+
/* @__PURE__ */ H("h3", { children: "Wiki Informations" }),
|
|
4185
|
+
/* @__PURE__ */ H("ul", { children: [
|
|
4186
|
+
/* @__PURE__ */ H("li", { children: [
|
|
4187
|
+
/* @__PURE__ */ H("strong", { children: "Site:" }),
|
|
4179
4188
|
" ",
|
|
4180
4189
|
this.general.sitename,
|
|
4181
4190
|
" (",
|
|
4182
4191
|
this.landingPageUrl,
|
|
4183
4192
|
")"
|
|
4184
4193
|
] }),
|
|
4185
|
-
/* @__PURE__ */
|
|
4186
|
-
/* @__PURE__ */
|
|
4194
|
+
/* @__PURE__ */ H("li", { children: [
|
|
4195
|
+
/* @__PURE__ */ H("strong", { children: "User" }),
|
|
4187
4196
|
": ",
|
|
4188
4197
|
this.userInfo.name,
|
|
4189
4198
|
" (ID: ",
|
|
4190
4199
|
this.userInfo.id,
|
|
4191
4200
|
")"
|
|
4192
4201
|
] }),
|
|
4193
|
-
/* @__PURE__ */
|
|
4194
|
-
/* @__PURE__ */
|
|
4202
|
+
/* @__PURE__ */ H("li", { children: [
|
|
4203
|
+
/* @__PURE__ */ H("strong", { children: "Groups" }),
|
|
4195
4204
|
": ",
|
|
4196
4205
|
this.userGroups.join(", ") || "None"
|
|
4197
4206
|
] })
|
|
4198
4207
|
] }),
|
|
4199
|
-
/* @__PURE__ */
|
|
4200
|
-
"button",
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4208
|
+
/* @__PURE__ */ H("div", { children: [
|
|
4209
|
+
/* @__PURE__ */ H("p", { style: { fontStyle: "italic" }, children: "If the information shown above is incorrect (for example, the user is not you), click the button below." }),
|
|
4210
|
+
/* @__PURE__ */ H(
|
|
4211
|
+
"button",
|
|
4212
|
+
{
|
|
4213
|
+
onClick: (t) => {
|
|
4214
|
+
t.preventDefault(), Promise.all(
|
|
4215
|
+
Object.keys(this.QUERY_DATA).map(
|
|
4216
|
+
(i) => this.invalidateCache(i)
|
|
4217
|
+
)
|
|
4218
|
+
).then(() => {
|
|
4219
|
+
window.location.reload();
|
|
4220
|
+
});
|
|
4221
|
+
},
|
|
4222
|
+
children: "🧹 Clear caches & Reload"
|
|
4223
|
+
}
|
|
4224
|
+
)
|
|
4225
|
+
] })
|
|
4210
4226
|
] })
|
|
4211
4227
|
).role("raw-html")
|
|
4212
4228
|
}).description("WikiMetadataService"),
|
|
4213
4229
|
"general"
|
|
4214
4230
|
);
|
|
4215
|
-
});
|
|
4231
|
+
}), this.logger.info("All initialized", this._data);
|
|
4232
|
+
}
|
|
4233
|
+
async initData(e, t = !1) {
|
|
4234
|
+
const i = t ? null : await this.fetchFromCache(e);
|
|
4235
|
+
if (i)
|
|
4236
|
+
return this._data[e] = i, this.logger.debug("Using cached", e, i), i;
|
|
4237
|
+
{
|
|
4238
|
+
const n = await this.fetchFromApi(e);
|
|
4239
|
+
return this.saveToCache(e, n), this._data[e] = n, this.logger.debug("Fetched from API", e, n), n;
|
|
4240
|
+
}
|
|
4216
4241
|
}
|
|
4217
|
-
|
|
4218
|
-
return this.ctx.api.config.baseURL
|
|
4242
|
+
getCacheKey(e) {
|
|
4243
|
+
return `${e}:${new URL(this.ctx.api.config.baseURL).pathname.replace(/^\//, "")}`;
|
|
4219
4244
|
}
|
|
4220
|
-
async fetchFromApi() {
|
|
4245
|
+
async fetchFromApi(e) {
|
|
4221
4246
|
return this.api.get({
|
|
4222
4247
|
action: "query",
|
|
4223
|
-
...this.
|
|
4224
|
-
}).then(({ data:
|
|
4225
|
-
if (typeof
|
|
4226
|
-
throw new Error("Invalid
|
|
4227
|
-
return e.query;
|
|
4228
|
-
}).catch((
|
|
4229
|
-
}
|
|
4230
|
-
async fetchFromCache() {
|
|
4231
|
-
const
|
|
4232
|
-
return
|
|
4233
|
-
}
|
|
4234
|
-
async saveToCache(e) {
|
|
4235
|
-
const
|
|
4236
|
-
return this.
|
|
4237
|
-
}
|
|
4238
|
-
async invalidateCache() {
|
|
4239
|
-
const
|
|
4240
|
-
return this.
|
|
4241
|
-
}
|
|
4242
|
-
// shortcuts
|
|
4248
|
+
...this.QUERY_DATA[e]
|
|
4249
|
+
}).then(({ data: t }) => {
|
|
4250
|
+
if (typeof t?.query != "object" || t.query === null)
|
|
4251
|
+
throw new Error("Invalid query data", { cause: t });
|
|
4252
|
+
return e === "siteinfo" ? t.query : t.query?.[e] || t.query;
|
|
4253
|
+
}).catch((t) => (this.logger.error("Failed to fetch", t), Promise.reject(t)));
|
|
4254
|
+
}
|
|
4255
|
+
async fetchFromCache(e) {
|
|
4256
|
+
const t = this.getCacheKey(e);
|
|
4257
|
+
return await this.CACHE_DB.get(t, this.CACHE_TTL[e]);
|
|
4258
|
+
}
|
|
4259
|
+
async saveToCache(e, t) {
|
|
4260
|
+
const i = this.getCacheKey(e);
|
|
4261
|
+
return this.CACHE_DB.set(i, t);
|
|
4262
|
+
}
|
|
4263
|
+
async invalidateCache(e) {
|
|
4264
|
+
const t = this.getCacheKey(e);
|
|
4265
|
+
return this.CACHE_DB.delete(t);
|
|
4266
|
+
}
|
|
4267
|
+
// ====== shortcuts ======
|
|
4243
4268
|
get _raw() {
|
|
4244
4269
|
return this._data;
|
|
4245
4270
|
}
|
|
4271
|
+
// siteInfo
|
|
4272
|
+
get siteInfo() {
|
|
4273
|
+
return this._data.siteinfo;
|
|
4274
|
+
}
|
|
4246
4275
|
get general() {
|
|
4247
|
-
return this.
|
|
4276
|
+
return this.siteInfo.general;
|
|
4248
4277
|
}
|
|
4249
4278
|
get specialPageAliases() {
|
|
4250
|
-
return this.
|
|
4279
|
+
return this.siteInfo.specialpagealiases;
|
|
4251
4280
|
}
|
|
4252
4281
|
get namespaceAliases() {
|
|
4253
|
-
return this.
|
|
4282
|
+
return this.siteInfo.namespacealiases;
|
|
4254
4283
|
}
|
|
4255
4284
|
get namespaces() {
|
|
4256
|
-
return this.
|
|
4285
|
+
return this.siteInfo.namespaces;
|
|
4257
4286
|
}
|
|
4258
4287
|
get namespaceMap() {
|
|
4259
4288
|
const e = Object.values(this.namespaces).map((t) => ({
|
|
@@ -4266,8 +4295,9 @@ class Be extends (gr = he) {
|
|
|
4266
4295
|
}), e;
|
|
4267
4296
|
}
|
|
4268
4297
|
get magicWords() {
|
|
4269
|
-
return this.
|
|
4298
|
+
return this.siteInfo.magicwords;
|
|
4270
4299
|
}
|
|
4300
|
+
// userInfo
|
|
4271
4301
|
get userInfo() {
|
|
4272
4302
|
return this._data.userinfo;
|
|
4273
4303
|
}
|
|
@@ -4346,7 +4376,7 @@ class Be extends (gr = he) {
|
|
|
4346
4376
|
}
|
|
4347
4377
|
/** Get mainpage URL */
|
|
4348
4378
|
getMainpageUrl(e) {
|
|
4349
|
-
return hr(this.
|
|
4379
|
+
return hr(this.siteInfo.general.base, e).toString();
|
|
4350
4380
|
}
|
|
4351
4381
|
getUrl(e, t) {
|
|
4352
4382
|
const i = ur(t);
|
|
@@ -4379,9 +4409,9 @@ class Be extends (gr = he) {
|
|
|
4379
4409
|
} : null;
|
|
4380
4410
|
}
|
|
4381
4411
|
}
|
|
4382
|
-
wt =
|
|
4383
|
-
Be =
|
|
4384
|
-
|
|
4412
|
+
wt = cn(gr);
|
|
4413
|
+
Be = dn(wt, 0, "WikiMetadataService", mr, Be);
|
|
4414
|
+
fn(wt, 1, Be);
|
|
4385
4415
|
var I;
|
|
4386
4416
|
((r) => {
|
|
4387
4417
|
function e(l) {
|
|
@@ -4392,12 +4422,12 @@ var I;
|
|
|
4392
4422
|
r.promisifyRequest = e;
|
|
4393
4423
|
const t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
4394
4424
|
function n(l, d) {
|
|
4395
|
-
const
|
|
4425
|
+
const m = (i.get(l) ?? Promise.resolve()).then(d, d);
|
|
4396
4426
|
return i.set(
|
|
4397
4427
|
l,
|
|
4398
|
-
|
|
4428
|
+
m.catch(() => {
|
|
4399
4429
|
})
|
|
4400
|
-
),
|
|
4430
|
+
), m;
|
|
4401
4431
|
}
|
|
4402
4432
|
function s(l) {
|
|
4403
4433
|
return new Promise((d) => setTimeout(d, l + Math.floor(Math.random() * 8)));
|
|
@@ -4412,18 +4442,18 @@ var I;
|
|
|
4412
4442
|
function a(l) {
|
|
4413
4443
|
const d = t.get(l);
|
|
4414
4444
|
if (d) return d;
|
|
4415
|
-
const m = new Promise((
|
|
4445
|
+
const m = new Promise((v, S) => {
|
|
4416
4446
|
const E = indexedDB.open(l);
|
|
4417
4447
|
E.onupgradeneeded = () => {
|
|
4418
4448
|
}, E.onsuccess = () => {
|
|
4419
|
-
const
|
|
4420
|
-
|
|
4449
|
+
const M = E.result;
|
|
4450
|
+
M.onversionchange = () => {
|
|
4421
4451
|
try {
|
|
4422
|
-
|
|
4452
|
+
M.close();
|
|
4423
4453
|
} finally {
|
|
4424
4454
|
t.delete(l);
|
|
4425
4455
|
}
|
|
4426
|
-
},
|
|
4456
|
+
}, v(M);
|
|
4427
4457
|
}, E.onerror = () => S(E.error), E.onblocked = () => {
|
|
4428
4458
|
};
|
|
4429
4459
|
});
|
|
@@ -4447,22 +4477,22 @@ var I;
|
|
|
4447
4477
|
r.closeAllDatabases = u;
|
|
4448
4478
|
async function p(l) {
|
|
4449
4479
|
await c(l), await new Promise((d, m) => {
|
|
4450
|
-
const
|
|
4451
|
-
|
|
4480
|
+
const v = indexedDB.deleteDatabase(l);
|
|
4481
|
+
v.onsuccess = () => d(), v.onerror = () => m(v.error), v.onblocked = () => {
|
|
4452
4482
|
};
|
|
4453
4483
|
});
|
|
4454
4484
|
}
|
|
4455
4485
|
r.deleteDatabase = p;
|
|
4456
4486
|
async function y(l, d, m = {}) {
|
|
4457
4487
|
return n(l, async () => {
|
|
4458
|
-
let
|
|
4459
|
-
const S = !
|
|
4488
|
+
let v = await a(l);
|
|
4489
|
+
const S = !v.objectStoreNames.contains(d), E = !S && m.indexes && m.indexes.length > 0;
|
|
4460
4490
|
if (!S && !E)
|
|
4461
|
-
return
|
|
4462
|
-
const
|
|
4463
|
-
|
|
4464
|
-
const re = new Promise((ie,
|
|
4465
|
-
const j = indexedDB.open(l,
|
|
4491
|
+
return v;
|
|
4492
|
+
const M = v.version + 1;
|
|
4493
|
+
v.close();
|
|
4494
|
+
const re = new Promise((ie, K) => {
|
|
4495
|
+
const j = indexedDB.open(l, M);
|
|
4466
4496
|
j.onupgradeneeded = () => {
|
|
4467
4497
|
const P = j.result;
|
|
4468
4498
|
let G;
|
|
@@ -4470,8 +4500,8 @@ var I;
|
|
|
4470
4500
|
keyPath: m.keyPath ?? void 0,
|
|
4471
4501
|
autoIncrement: !!m.autoIncrement
|
|
4472
4502
|
}), m.indexes && m.indexes.length > 0)
|
|
4473
|
-
for (const { name: $e, keyPath:
|
|
4474
|
-
G.indexNames.contains($e) || G.createIndex($e,
|
|
4503
|
+
for (const { name: $e, keyPath: W, options: Ae } of m.indexes)
|
|
4504
|
+
G.indexNames.contains($e) || G.createIndex($e, W, Ae);
|
|
4475
4505
|
}, j.onsuccess = () => {
|
|
4476
4506
|
const P = j.result;
|
|
4477
4507
|
P.onversionchange = () => {
|
|
@@ -4481,7 +4511,7 @@ var I;
|
|
|
4481
4511
|
t.delete(l);
|
|
4482
4512
|
}
|
|
4483
4513
|
}, ie(P);
|
|
4484
|
-
}, j.onerror = () =>
|
|
4514
|
+
}, j.onerror = () => K(j.error), j.onblocked = () => {
|
|
4485
4515
|
};
|
|
4486
4516
|
});
|
|
4487
4517
|
return t.set(l, re), re;
|
|
@@ -4496,47 +4526,47 @@ var I;
|
|
|
4496
4526
|
};
|
|
4497
4527
|
}
|
|
4498
4528
|
r.createStore = w;
|
|
4499
|
-
async function g(l, d, m,
|
|
4500
|
-
const { dbName: S, storeName: E } = l,
|
|
4529
|
+
async function g(l, d, m, v = {}) {
|
|
4530
|
+
const { dbName: S, storeName: E } = l, M = v.attempts ?? 2, re = v.baseDelayMs ?? 16;
|
|
4501
4531
|
let ie;
|
|
4502
|
-
for (let
|
|
4532
|
+
for (let K = 0; K <= M; K++)
|
|
4503
4533
|
try {
|
|
4504
|
-
|
|
4534
|
+
K === 0 && await y(S, E);
|
|
4505
4535
|
const j = await a(S);
|
|
4506
4536
|
let P;
|
|
4507
4537
|
try {
|
|
4508
4538
|
P = j.transaction(E, d);
|
|
4509
|
-
} catch (
|
|
4510
|
-
if (o(
|
|
4511
|
-
await c(S), await s(re * (1 <<
|
|
4539
|
+
} catch (W) {
|
|
4540
|
+
if (o(W) && K < M) {
|
|
4541
|
+
await c(S), await s(re * (1 << K)), ie = W;
|
|
4512
4542
|
continue;
|
|
4513
4543
|
}
|
|
4514
|
-
throw
|
|
4544
|
+
throw W;
|
|
4515
4545
|
}
|
|
4516
|
-
const G = P.objectStore(E), $e = new Promise((
|
|
4517
|
-
P.oncomplete = () =>
|
|
4546
|
+
const G = P.objectStore(E), $e = new Promise((W, Ae) => {
|
|
4547
|
+
P.oncomplete = () => W(), P.onerror = () => Ae(P.error), P.onabort = () => Ae(P.error);
|
|
4518
4548
|
});
|
|
4519
4549
|
try {
|
|
4520
|
-
const
|
|
4521
|
-
return await $e,
|
|
4522
|
-
} catch (
|
|
4523
|
-
if (o(
|
|
4550
|
+
const W = await m(G);
|
|
4551
|
+
return await $e, W;
|
|
4552
|
+
} catch (W) {
|
|
4553
|
+
if (o(W) && K < M) {
|
|
4524
4554
|
try {
|
|
4525
4555
|
P.abort();
|
|
4526
4556
|
} catch {
|
|
4527
4557
|
}
|
|
4528
|
-
await c(S), await s(re * (1 <<
|
|
4558
|
+
await c(S), await s(re * (1 << K)), ie = W;
|
|
4529
4559
|
continue;
|
|
4530
4560
|
}
|
|
4531
4561
|
try {
|
|
4532
4562
|
P.abort();
|
|
4533
4563
|
} catch {
|
|
4534
4564
|
}
|
|
4535
|
-
throw
|
|
4565
|
+
throw W;
|
|
4536
4566
|
}
|
|
4537
4567
|
} catch (j) {
|
|
4538
|
-
if (o(j) &&
|
|
4539
|
-
await c(S), await s(re * (1 <<
|
|
4568
|
+
if (o(j) && K < M) {
|
|
4569
|
+
await c(S), await s(re * (1 << K)), ie = j;
|
|
4540
4570
|
continue;
|
|
4541
4571
|
}
|
|
4542
4572
|
throw j;
|
|
@@ -4544,27 +4574,27 @@ var I;
|
|
|
4544
4574
|
throw ie;
|
|
4545
4575
|
}
|
|
4546
4576
|
r.withObjectStore = g;
|
|
4547
|
-
async function
|
|
4577
|
+
async function b(l, d) {
|
|
4548
4578
|
return g(l, "readonly", async (m) => {
|
|
4549
|
-
const
|
|
4550
|
-
return e(
|
|
4579
|
+
const v = m.get(d);
|
|
4580
|
+
return e(v);
|
|
4551
4581
|
});
|
|
4552
4582
|
}
|
|
4553
|
-
r.get =
|
|
4583
|
+
r.get = b;
|
|
4554
4584
|
async function R(l, d, m) {
|
|
4555
|
-
return g(l, "readwrite", async (
|
|
4556
|
-
const S =
|
|
4585
|
+
return g(l, "readwrite", async (v) => {
|
|
4586
|
+
const S = v.put(m, d);
|
|
4557
4587
|
await e(S);
|
|
4558
4588
|
});
|
|
4559
4589
|
}
|
|
4560
4590
|
r.set = R;
|
|
4561
|
-
async function
|
|
4591
|
+
async function L(l, d) {
|
|
4562
4592
|
return g(l, "readwrite", async (m) => {
|
|
4563
|
-
const
|
|
4564
|
-
await e(
|
|
4593
|
+
const v = m.delete(d);
|
|
4594
|
+
await e(v);
|
|
4565
4595
|
});
|
|
4566
4596
|
}
|
|
4567
|
-
r.del =
|
|
4597
|
+
r.del = L;
|
|
4568
4598
|
async function $(l) {
|
|
4569
4599
|
return g(l, "readwrite", async (d) => {
|
|
4570
4600
|
const m = d.clear();
|
|
@@ -4575,17 +4605,17 @@ var I;
|
|
|
4575
4605
|
function f(l, d = 100) {
|
|
4576
4606
|
return {
|
|
4577
4607
|
[Symbol.asyncIterator]() {
|
|
4578
|
-
let m = [],
|
|
4608
|
+
let m = [], v = !1, S;
|
|
4579
4609
|
const E = async () => {
|
|
4580
|
-
|
|
4610
|
+
v || (m = [], await g(l, "readonly", async (M) => {
|
|
4581
4611
|
const re = S === void 0 ? void 0 : IDBKeyRange.lowerBound(
|
|
4582
4612
|
S,
|
|
4583
4613
|
/* open */
|
|
4584
4614
|
!0
|
|
4585
4615
|
);
|
|
4586
|
-
await new Promise((ie,
|
|
4616
|
+
await new Promise((ie, K) => {
|
|
4587
4617
|
let j = 0;
|
|
4588
|
-
const P =
|
|
4618
|
+
const P = M.openCursor(re, "next");
|
|
4589
4619
|
P.onsuccess = () => {
|
|
4590
4620
|
const G = P.result;
|
|
4591
4621
|
if (!G || j >= d) {
|
|
@@ -4593,13 +4623,13 @@ var I;
|
|
|
4593
4623
|
return;
|
|
4594
4624
|
}
|
|
4595
4625
|
m.push([G.key, G.value]), S = G.key, j++, G.continue();
|
|
4596
|
-
}, P.onerror = () =>
|
|
4597
|
-
}), m.length === 0 && (
|
|
4626
|
+
}, P.onerror = () => K(P.error);
|
|
4627
|
+
}), m.length === 0 && (v = !0);
|
|
4598
4628
|
}));
|
|
4599
4629
|
};
|
|
4600
4630
|
return {
|
|
4601
4631
|
async next() {
|
|
4602
|
-
return m.length === 0 && !
|
|
4632
|
+
return m.length === 0 && !v && await E(), m.length === 0 ? { value: void 0, done: !0 } : { value: m.shift(), done: !1 };
|
|
4603
4633
|
}
|
|
4604
4634
|
};
|
|
4605
4635
|
}
|
|
@@ -4610,10 +4640,10 @@ var I;
|
|
|
4610
4640
|
const m = f(l, d);
|
|
4611
4641
|
return {
|
|
4612
4642
|
[Symbol.asyncIterator]() {
|
|
4613
|
-
const
|
|
4643
|
+
const v = m[Symbol.asyncIterator]();
|
|
4614
4644
|
return {
|
|
4615
4645
|
async next() {
|
|
4616
|
-
const S = await
|
|
4646
|
+
const S = await v.next();
|
|
4617
4647
|
return S.done ? { value: void 0, done: !0 } : { value: S.value[0], done: !1 };
|
|
4618
4648
|
}
|
|
4619
4649
|
};
|
|
@@ -4622,19 +4652,28 @@ var I;
|
|
|
4622
4652
|
}
|
|
4623
4653
|
r.keys = h;
|
|
4624
4654
|
})(I || (I = {}));
|
|
4625
|
-
|
|
4655
|
+
/**
|
|
4656
|
+
* IDB Plus
|
|
4657
|
+
*
|
|
4658
|
+
* 🗄️ Minimal Promise based IndexedDB Wrapper with Map-like API
|
|
4659
|
+
*
|
|
4660
|
+
* @author dragon-fish <dragon-fish@qq.com>
|
|
4661
|
+
* @license MIT
|
|
4662
|
+
*/
|
|
4663
|
+
class pn {
|
|
4626
4664
|
constructor(e, t, i = {}) {
|
|
4627
4665
|
this.dbName = e, this.storeName = t, this.iterBatch = (i.iterBatch ?? 100) | 0, this.retry = i.retry, this.inlineKey = !!i.ensure?.keyPath, this.idbStoreHandle = I.createStore(e, t, i.ensure ?? {});
|
|
4628
4666
|
}
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4667
|
+
iterBatch;
|
|
4668
|
+
retry;
|
|
4669
|
+
inlineKey;
|
|
4670
|
+
idbStoreHandle;
|
|
4632
4671
|
async get(e) {
|
|
4633
|
-
const t = await this.
|
|
4672
|
+
const t = await this.idbStoreHandle;
|
|
4634
4673
|
return I.get(t, e);
|
|
4635
4674
|
}
|
|
4636
4675
|
async set(e, t) {
|
|
4637
|
-
const i = await this.
|
|
4676
|
+
const i = await this.idbStoreHandle;
|
|
4638
4677
|
return this.inlineKey ? I.withObjectStore(
|
|
4639
4678
|
i,
|
|
4640
4679
|
"readwrite",
|
|
@@ -4646,15 +4685,15 @@ class dn {
|
|
|
4646
4685
|
) : I.set(i, e, t);
|
|
4647
4686
|
}
|
|
4648
4687
|
async delete(e) {
|
|
4649
|
-
const t = await this.
|
|
4688
|
+
const t = await this.idbStoreHandle;
|
|
4650
4689
|
return I.del(t, e);
|
|
4651
4690
|
}
|
|
4652
4691
|
async clear() {
|
|
4653
|
-
const e = await this.
|
|
4692
|
+
const e = await this.idbStoreHandle;
|
|
4654
4693
|
return I.clear(e);
|
|
4655
4694
|
}
|
|
4656
4695
|
async has(e) {
|
|
4657
|
-
const t = await this.
|
|
4696
|
+
const t = await this.idbStoreHandle;
|
|
4658
4697
|
return I.withObjectStore(
|
|
4659
4698
|
t,
|
|
4660
4699
|
"readonly",
|
|
@@ -4666,7 +4705,7 @@ class dn {
|
|
|
4666
4705
|
);
|
|
4667
4706
|
}
|
|
4668
4707
|
async count() {
|
|
4669
|
-
const e = await this.
|
|
4708
|
+
const e = await this.idbStoreHandle;
|
|
4670
4709
|
return I.withObjectStore(
|
|
4671
4710
|
e,
|
|
4672
4711
|
"readonly",
|
|
@@ -4685,8 +4724,8 @@ class dn {
|
|
|
4685
4724
|
return {
|
|
4686
4725
|
async next() {
|
|
4687
4726
|
if (!t) {
|
|
4688
|
-
const
|
|
4689
|
-
t = I.entries(
|
|
4727
|
+
const i = await e.idbStoreHandle;
|
|
4728
|
+
t = I.entries(i, e.iterBatch)[Symbol.asyncIterator]();
|
|
4690
4729
|
}
|
|
4691
4730
|
return await t.next();
|
|
4692
4731
|
}
|
|
@@ -4702,8 +4741,8 @@ class dn {
|
|
|
4702
4741
|
return {
|
|
4703
4742
|
async next() {
|
|
4704
4743
|
if (!t) {
|
|
4705
|
-
const
|
|
4706
|
-
t = I.keys(
|
|
4744
|
+
const i = await e.idbStoreHandle;
|
|
4745
|
+
t = I.keys(i, e.iterBatch)[Symbol.asyncIterator]();
|
|
4707
4746
|
}
|
|
4708
4747
|
return await t.next();
|
|
4709
4748
|
}
|
|
@@ -4733,12 +4772,12 @@ class dn {
|
|
|
4733
4772
|
await e(i, t, this);
|
|
4734
4773
|
}
|
|
4735
4774
|
async setMany(e) {
|
|
4736
|
-
const t = await this.
|
|
4775
|
+
const t = await this.idbStoreHandle;
|
|
4737
4776
|
await I.withObjectStore(
|
|
4738
4777
|
t,
|
|
4739
4778
|
"readwrite",
|
|
4740
4779
|
async (i) => {
|
|
4741
|
-
for await (const [n, s] of
|
|
4780
|
+
for await (const [n, s] of Lt(e)) {
|
|
4742
4781
|
const o = this.inlineKey ? i.put(s) : i.put(s, n);
|
|
4743
4782
|
await I.promisifyRequest(o);
|
|
4744
4783
|
}
|
|
@@ -4747,12 +4786,12 @@ class dn {
|
|
|
4747
4786
|
);
|
|
4748
4787
|
}
|
|
4749
4788
|
async deleteMany(e) {
|
|
4750
|
-
const t = await this.
|
|
4789
|
+
const t = await this.idbStoreHandle;
|
|
4751
4790
|
await I.withObjectStore(
|
|
4752
4791
|
t,
|
|
4753
4792
|
"readwrite",
|
|
4754
4793
|
async (i) => {
|
|
4755
|
-
for await (const n of
|
|
4794
|
+
for await (const n of Lt(e)) {
|
|
4756
4795
|
const s = i.delete(n);
|
|
4757
4796
|
await I.promisifyRequest(s);
|
|
4758
4797
|
}
|
|
@@ -4761,31 +4800,23 @@ class dn {
|
|
|
4761
4800
|
);
|
|
4762
4801
|
}
|
|
4763
4802
|
async tx(e, t) {
|
|
4764
|
-
const i = await this.
|
|
4803
|
+
const i = await this.idbStoreHandle;
|
|
4765
4804
|
return I.withObjectStore(i, e, t, this.retry);
|
|
4766
4805
|
}
|
|
4767
4806
|
async close() {
|
|
4768
4807
|
await I.closeDatabase(this.dbName);
|
|
4769
4808
|
}
|
|
4770
4809
|
}
|
|
4771
|
-
function
|
|
4810
|
+
function Lt(r) {
|
|
4772
4811
|
return r[Symbol.asyncIterator] ? r : {
|
|
4773
4812
|
async *[Symbol.asyncIterator]() {
|
|
4774
4813
|
for (const e of r) yield e;
|
|
4775
4814
|
}
|
|
4776
4815
|
};
|
|
4777
4816
|
}
|
|
4778
|
-
class pn extends he {
|
|
4779
|
-
constructor(e) {
|
|
4780
|
-
super(e, "storage", !1);
|
|
4781
|
-
}
|
|
4782
|
-
createDatabse(e, t, i) {
|
|
4783
|
-
return new mn("InPageEdit", e, t, i);
|
|
4784
|
-
}
|
|
4785
|
-
}
|
|
4786
4817
|
class mn {
|
|
4787
4818
|
constructor(e, t, i = 1 / 0, n) {
|
|
4788
|
-
this.dbName = e, this.storeName = t, this.ttl = i, this.version = n, this.db = new
|
|
4819
|
+
this.dbName = e, this.storeName = t, this.ttl = i, this.version = n, this.db = new pn(e, t), this.keys = this.db.keys.bind(this.db), this.values = this.db.values.bind(this.db), this.entries = this.db.entries.bind(this.db), typeof this.ttl != "number" && (this.ttl = Number(this.ttl)), (isNaN(this.ttl) || this.ttl <= 0) && (this.ttl = 1 / 0);
|
|
4789
4820
|
}
|
|
4790
4821
|
async get(e, t = this.ttl, i) {
|
|
4791
4822
|
const n = await this.loadFromDB(e), s = this.checkIfExpired(n, t);
|
|
@@ -4846,8 +4877,16 @@ class mn {
|
|
|
4846
4877
|
return await this.db.clear(), this;
|
|
4847
4878
|
}
|
|
4848
4879
|
}
|
|
4880
|
+
class gn extends he {
|
|
4881
|
+
constructor(e) {
|
|
4882
|
+
super(e, "storage", !1);
|
|
4883
|
+
}
|
|
4884
|
+
createDatabse(e, t, i) {
|
|
4885
|
+
return new mn("InPageEdit", e, t, i);
|
|
4886
|
+
}
|
|
4887
|
+
}
|
|
4849
4888
|
var yr = /* @__PURE__ */ ((r) => (r.preferences = "preferences", r.watch = "watch", r.unwatch = "unwatch", r.nochange = "nochange", r))(yr || {});
|
|
4850
|
-
function
|
|
4889
|
+
function yn(r) {
|
|
4851
4890
|
class e {
|
|
4852
4891
|
constructor(i, n = !0) {
|
|
4853
4892
|
this._loaded = n, this.api = r, i.revisions?.forEach((s) => {
|
|
@@ -5038,9 +5077,9 @@ function gn(r) {
|
|
|
5038
5077
|
}
|
|
5039
5078
|
return e;
|
|
5040
5079
|
}
|
|
5041
|
-
class
|
|
5080
|
+
class wn extends he {
|
|
5042
5081
|
constructor(e) {
|
|
5043
|
-
super(e, "wikiPage", !0), this.ctx = e, this.WikiPage =
|
|
5082
|
+
super(e, "wikiPage", !0), this.ctx = e, this.WikiPage = yn(this.ctx.api);
|
|
5044
5083
|
}
|
|
5045
5084
|
static {
|
|
5046
5085
|
this.inject = ["api"];
|
|
@@ -5061,7 +5100,7 @@ class yn extends he {
|
|
|
5061
5100
|
return this.WikiPage.newBlankPage(e);
|
|
5062
5101
|
}
|
|
5063
5102
|
}
|
|
5064
|
-
const jt = /* @__PURE__ */ new WeakMap(),
|
|
5103
|
+
const jt = /* @__PURE__ */ new WeakMap(), Q = {
|
|
5065
5104
|
toDBKey: (r) => r.replace(/ /g, "_"),
|
|
5066
5105
|
toNormalText: (r) => r.replace(/_/g, " "),
|
|
5067
5106
|
ensureCase: (r, e) => e === "first-letter" ? r.charAt(0).toUpperCase() + r.slice(1) : r
|
|
@@ -5099,7 +5138,7 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
|
|
|
5099
5138
|
const n = me.normalizeSpecialPageName(t);
|
|
5100
5139
|
return e.byNormalized.get(n) ?? null;
|
|
5101
5140
|
}
|
|
5102
|
-
},
|
|
5141
|
+
}, X = {
|
|
5103
5142
|
/**
|
|
5104
5143
|
* 标准化命名空间文本:转换为全小写+下划线格式
|
|
5105
5144
|
*/
|
|
@@ -5109,12 +5148,12 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
|
|
|
5109
5148
|
for (const [s, o] of Object.entries(r.namespaces)) {
|
|
5110
5149
|
const a = parseInt(s);
|
|
5111
5150
|
e.set(o.name, a), t.set(o.canonical ?? "", a);
|
|
5112
|
-
const c =
|
|
5151
|
+
const c = X.normalizeNamespaceText(o.name), u = X.normalizeNamespaceText(o.canonical ?? "");
|
|
5113
5152
|
n.set(c, a), n.set(u, a);
|
|
5114
5153
|
}
|
|
5115
5154
|
for (const s of r.namespacealiases) {
|
|
5116
5155
|
i.set(s.alias, s.id);
|
|
5117
|
-
const o =
|
|
5156
|
+
const o = X.normalizeNamespaceText(s.alias);
|
|
5118
5157
|
n.set(o, s.id);
|
|
5119
5158
|
}
|
|
5120
5159
|
return { byName: e, byCanonical: t, byAlias: i, byNormalized: n };
|
|
@@ -5123,7 +5162,7 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
|
|
|
5123
5162
|
let t = e.byName.get(r) ?? e.byCanonical.get(r) ?? e.byAlias.get(r);
|
|
5124
5163
|
if (t !== void 0)
|
|
5125
5164
|
return t;
|
|
5126
|
-
const i =
|
|
5165
|
+
const i = X.normalizeNamespaceText(r);
|
|
5127
5166
|
return e.byNormalized.get(i) ?? null;
|
|
5128
5167
|
},
|
|
5129
5168
|
isTalkPage: (r) => r % 2 === 1 && r > 0,
|
|
@@ -5137,14 +5176,14 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
|
|
|
5137
5176
|
subpages: !1
|
|
5138
5177
|
})
|
|
5139
5178
|
};
|
|
5140
|
-
function
|
|
5179
|
+
function bn(r) {
|
|
5141
5180
|
const e = jt.get(r);
|
|
5142
5181
|
if (e)
|
|
5143
5182
|
return e;
|
|
5144
|
-
const t =
|
|
5183
|
+
const t = X.buildIndex(r), i = me.buildSpecialPageIndex(r);
|
|
5145
5184
|
class n {
|
|
5146
5185
|
constructor(o, a) {
|
|
5147
|
-
if (this.newTitle = n.create.bind(n), this.toText = this.getPrefixedText.bind(this), this.toString = this.getPrefixedDBKey.bind(this), this.#e = o || "", this.#t = a ?? 0, a === void 0
|
|
5186
|
+
if (this.newTitle = n.create.bind(n), this.toText = this.getPrefixedText.bind(this), this.toString = this.getPrefixedDBKey.bind(this), this.#e = o || "", this.#t = a ?? 0, a === void 0 ? this.fixNSByTitle() : this.stripNamespaceFromTitle(), this.getMainText() === "")
|
|
5148
5187
|
throw new Error("Invalid title");
|
|
5149
5188
|
}
|
|
5150
5189
|
static {
|
|
@@ -5171,14 +5210,28 @@ function wn(r) {
|
|
|
5171
5210
|
this.#e = this.#e.substring(1);
|
|
5172
5211
|
return;
|
|
5173
5212
|
}
|
|
5174
|
-
const a = this.#e.substring(0, o), c = this.#e.substring(o + 1), u =
|
|
5213
|
+
const a = this.#e.substring(0, o), c = this.#e.substring(o + 1), u = X.findNamespaceId(
|
|
5175
5214
|
a,
|
|
5176
5215
|
n._namespaceIndex
|
|
5177
5216
|
);
|
|
5178
5217
|
u !== null && (this.#e = c, this.#t = u);
|
|
5179
5218
|
}
|
|
5219
|
+
stripNamespaceFromTitle() {
|
|
5220
|
+
const o = this.#e.indexOf(":");
|
|
5221
|
+
if (o === -1)
|
|
5222
|
+
return;
|
|
5223
|
+
if (o === 0) {
|
|
5224
|
+
this.#e = this.#e.substring(1);
|
|
5225
|
+
return;
|
|
5226
|
+
}
|
|
5227
|
+
const a = this.#e.substring(0, o), c = this.#e.substring(o + 1);
|
|
5228
|
+
X.findNamespaceId(
|
|
5229
|
+
a,
|
|
5230
|
+
n._namespaceIndex
|
|
5231
|
+
) !== null && (this.#e = c);
|
|
5232
|
+
}
|
|
5180
5233
|
getNamespaceInfo() {
|
|
5181
|
-
return n._meta.namespaces[this.#t] ??
|
|
5234
|
+
return n._meta.namespaces[this.#t] ?? X.getDefaultNamespaceInfo(this.#t);
|
|
5182
5235
|
}
|
|
5183
5236
|
getMainDBKey() {
|
|
5184
5237
|
const o = this.getNamespaceInfo();
|
|
@@ -5189,10 +5242,10 @@ function wn(r) {
|
|
|
5189
5242
|
);
|
|
5190
5243
|
if (a) {
|
|
5191
5244
|
const c = this.#e.includes("/") ? this.#e.substring(this.#e.indexOf("/")) : "", u = a + c;
|
|
5192
|
-
return
|
|
5245
|
+
return Q.ensureCase(Q.toDBKey(u), o.case);
|
|
5193
5246
|
}
|
|
5194
5247
|
}
|
|
5195
|
-
return
|
|
5248
|
+
return Q.ensureCase(Q.toDBKey(this.#e), o.case);
|
|
5196
5249
|
}
|
|
5197
5250
|
getMainText() {
|
|
5198
5251
|
const o = this.getNamespaceInfo();
|
|
@@ -5203,10 +5256,10 @@ function wn(r) {
|
|
|
5203
5256
|
);
|
|
5204
5257
|
if (a) {
|
|
5205
5258
|
const c = this.#e.includes("/") ? this.#e.substring(this.#e.indexOf("/")) : "", u = a + c;
|
|
5206
|
-
return
|
|
5259
|
+
return Q.ensureCase(Q.toNormalText(u), o.case);
|
|
5207
5260
|
}
|
|
5208
5261
|
}
|
|
5209
|
-
return
|
|
5262
|
+
return Q.ensureCase(Q.toNormalText(this.#e), o.case);
|
|
5210
5263
|
}
|
|
5211
5264
|
getMainRootText() {
|
|
5212
5265
|
return this.getMainText().split("/")[0];
|
|
@@ -5225,17 +5278,17 @@ function wn(r) {
|
|
|
5225
5278
|
}
|
|
5226
5279
|
getNamespaceDBKey() {
|
|
5227
5280
|
const o = this.getNamespaceInfo();
|
|
5228
|
-
return
|
|
5281
|
+
return Q.ensureCase(Q.toDBKey(this.getNamespaceText()), o.case);
|
|
5229
5282
|
}
|
|
5230
5283
|
getSubjectPage() {
|
|
5231
|
-
if (
|
|
5284
|
+
if (X.isTalkPage(this.#t)) {
|
|
5232
5285
|
const o = this.#t - 1;
|
|
5233
5286
|
return new n(this.#e, o);
|
|
5234
5287
|
}
|
|
5235
5288
|
return this;
|
|
5236
5289
|
}
|
|
5237
5290
|
getTalkPage() {
|
|
5238
|
-
if (
|
|
5291
|
+
if (X.isTalkPage(this.#t))
|
|
5239
5292
|
return this;
|
|
5240
5293
|
if (this.#t < 0)
|
|
5241
5294
|
return null;
|
|
@@ -5243,7 +5296,7 @@ function wn(r) {
|
|
|
5243
5296
|
return n._meta.namespaces[o.toString()] ? new n(this.#e, o) : null;
|
|
5244
5297
|
}
|
|
5245
5298
|
getURL(o) {
|
|
5246
|
-
const a = n._meta.general.articlepath, c = this.getPrefixedDBKey(), u = a.replace("$1", c), p = new URL(u,
|
|
5299
|
+
const a = n._meta.general.articlepath, c = this.getPrefixedDBKey(), u = a.replace("$1", c), p = new URL(u, location.origin);
|
|
5247
5300
|
return o && (o instanceof URLSearchParams ? o : new URLSearchParams(o)).forEach((w, g) => {
|
|
5248
5301
|
p.searchParams.set(g, w);
|
|
5249
5302
|
}), p;
|
|
@@ -5259,7 +5312,7 @@ function wn(r) {
|
|
|
5259
5312
|
return this.#e = o, this;
|
|
5260
5313
|
}
|
|
5261
5314
|
setNamespaceText(o) {
|
|
5262
|
-
const a =
|
|
5315
|
+
const a = X.findNamespaceId(o, n._namespaceIndex);
|
|
5263
5316
|
return a !== null && (this.#t = a), this;
|
|
5264
5317
|
}
|
|
5265
5318
|
setNamespaceId(o) {
|
|
@@ -5288,7 +5341,7 @@ function wn(r) {
|
|
|
5288
5341
|
}
|
|
5289
5342
|
class bt extends he {
|
|
5290
5343
|
constructor(e) {
|
|
5291
|
-
super(e, "wikiTitle", !0), this.ctx = e, this.logger = this.ctx.logger("WikiTitleService"), this._cachedTitles = /* @__PURE__ */ new Map(), this.wiki = this.ctx.wiki, this.wikiBaseUrl = this.wiki.baseUrl, this.wikiArticlePath = this.wiki.articlePath.replace("$1", ""), this.wikiArticleBaseUrl = this.wiki.articleBaseUrl.replace("$1", ""), this.wikiIndexPhpUrl = this.wiki.getSciprtUrl("index.php"), this.Title =
|
|
5344
|
+
super(e, "wikiTitle", !0), this.ctx = e, this.logger = this.ctx.logger("WikiTitleService"), this._cachedTitles = /* @__PURE__ */ new Map(), this.wiki = this.ctx.wiki, this.wikiBaseUrl = this.wiki.baseUrl, this.wikiArticlePath = this.wiki.articlePath.replace("$1", ""), this.wikiArticleBaseUrl = this.wiki.articleBaseUrl.replace("$1", ""), this.wikiIndexPhpUrl = this.wiki.getSciprtUrl("index.php"), this.Title = bn(this.ctx.wiki.siteInfo);
|
|
5292
5345
|
}
|
|
5293
5346
|
static {
|
|
5294
5347
|
this.inject = ["wiki"];
|
|
@@ -5420,26 +5473,26 @@ class bt extends he {
|
|
|
5420
5473
|
};
|
|
5421
5474
|
}
|
|
5422
5475
|
}
|
|
5423
|
-
const
|
|
5424
|
-
async function
|
|
5425
|
-
return
|
|
5476
|
+
const vn = (r) => typeof r == "function";
|
|
5477
|
+
async function _n(r) {
|
|
5478
|
+
return vn(r) ? await r() : r;
|
|
5426
5479
|
}
|
|
5427
|
-
var
|
|
5480
|
+
var Sn = Object.create, vt = Object.defineProperty, xn = Object.getOwnPropertyDescriptor, wr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), br = (r) => {
|
|
5428
5481
|
throw TypeError(r);
|
|
5429
|
-
}, kn = (r, e, t) => e in r ? vt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t,
|
|
5482
|
+
}, kn = (r, e, t) => e in r ? vt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, En = (r, e) => vt(r, "name", { value: e, configurable: !0 }), On = (r) => [, , , Sn(r?.[wr("metadata")] ?? null)], Rn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], vr = (r) => r !== void 0 && typeof r != "function" ? br("Function expected") : r, $n = (r, e, t, i, n) => ({ kind: Rn[r], name: e, metadata: i, addInitializer: (s) => t._ ? br("Already initialized") : n.push(vr(s || null)) }), An = (r, e) => kn(e, wr("metadata"), r[3]), Pn = (r, e, t, i) => {
|
|
5430
5483
|
for (var n = 0, s = r[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
5431
5484
|
return i;
|
|
5432
|
-
},
|
|
5433
|
-
var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
5434
|
-
|
|
5435
|
-
for (var
|
|
5436
|
-
c =
|
|
5437
|
-
return
|
|
5485
|
+
}, In = (r, e, t, i, n, s) => {
|
|
5486
|
+
var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && xn(n, t));
|
|
5487
|
+
En(n, t);
|
|
5488
|
+
for (var b = i.length - 1; b >= 0; b--)
|
|
5489
|
+
c = $n(u, t, a = {}, r[3], w), o = (0, i[b])(n, c), a._ = 1, vr(o) && (n = o);
|
|
5490
|
+
return An(r, n), g && vt(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
5438
5491
|
}, _r, _t, Sr;
|
|
5439
5492
|
_r = [le(["storage"])];
|
|
5440
|
-
class
|
|
5493
|
+
class He extends (Sr = he) {
|
|
5441
5494
|
constructor(e) {
|
|
5442
|
-
super(e, "preferences", !0), this.ctx = e, this.db = void 0, this.customRegistries = [], this.categoryDefinitions = [], this._defaultPreferences = {}, this.db = e.storage.createDatabse("preferences", 1 / 0);
|
|
5495
|
+
super(e, "preferences", !0), this.ctx = e, this.db = void 0, this.customRegistries = [], this.categoryDefinitions = [], this._defaultPreferences = {}, e.set("prefs", this), this.db = e.storage.createDatabse("preferences", 1 / 0);
|
|
5443
5496
|
}
|
|
5444
5497
|
get logger() {
|
|
5445
5498
|
return this.ctx.logger("PREFERENCES");
|
|
@@ -5461,7 +5514,7 @@ class Fe extends (Sr = he) {
|
|
|
5461
5514
|
return this.logger.debug(e, `(fallback value: ${n})`), n;
|
|
5462
5515
|
};
|
|
5463
5516
|
const i = await this.db.get(e, void 0);
|
|
5464
|
-
return i !== null ? i : await
|
|
5517
|
+
return i !== null ? i : await _n(t);
|
|
5465
5518
|
}
|
|
5466
5519
|
getDefaultValue(e) {
|
|
5467
5520
|
return this._defaultPreferences[e] ??= this.loadDefaultConfigs()[e];
|
|
@@ -5470,12 +5523,40 @@ class Fe extends (Sr = he) {
|
|
|
5470
5523
|
const i = this.getDefaultValue(e);
|
|
5471
5524
|
return t === i ? this.db.delete(e) : this.db.set(e, t);
|
|
5472
5525
|
}
|
|
5526
|
+
async setMany(e) {
|
|
5527
|
+
const t = this.loadDefaultConfigs(), i = Object.fromEntries(
|
|
5528
|
+
Object.entries(e).filter(([n, s]) => {
|
|
5529
|
+
const o = t[n];
|
|
5530
|
+
return s !== void 0 && s !== o;
|
|
5531
|
+
})
|
|
5532
|
+
);
|
|
5533
|
+
return await Promise.all(
|
|
5534
|
+
Object.entries(i).map(([n, s]) => this.set(n, s))
|
|
5535
|
+
), i;
|
|
5536
|
+
}
|
|
5537
|
+
/**
|
|
5538
|
+
* 获取全部注册的配置项,以及正在生效的值
|
|
5539
|
+
*/
|
|
5473
5540
|
async getAll() {
|
|
5474
5541
|
const e = this.loadDefaultConfigs();
|
|
5475
5542
|
for await (const [t, i] of this.db.entries())
|
|
5476
5543
|
t !== "_touched" && (e[t] = i.value);
|
|
5477
5544
|
return e;
|
|
5478
5545
|
}
|
|
5546
|
+
/**
|
|
5547
|
+
* Get exportable configurations
|
|
5548
|
+
* - exclude values that are the same as the default value
|
|
5549
|
+
* - exclude invalid or undefined values
|
|
5550
|
+
* - sort by keys
|
|
5551
|
+
*/
|
|
5552
|
+
async getExportableRecord(e) {
|
|
5553
|
+
e ??= await this.getAll();
|
|
5554
|
+
const t = this.loadDefaultConfigs(), i = {};
|
|
5555
|
+
return Object.entries(t).sort(([n], [s]) => n.localeCompare(s)).forEach(([n, s]) => {
|
|
5556
|
+
const o = e[n];
|
|
5557
|
+
o !== void 0 && o !== s && (i[n] = o);
|
|
5558
|
+
}), i;
|
|
5559
|
+
}
|
|
5479
5560
|
loadDefaultConfigs() {
|
|
5480
5561
|
const e = {};
|
|
5481
5562
|
return this.getConfigRegistries().forEach((t) => {
|
|
@@ -5517,10 +5598,10 @@ class Fe extends (Sr = he) {
|
|
|
5517
5598
|
return this.categoryDefinitions;
|
|
5518
5599
|
}
|
|
5519
5600
|
}
|
|
5520
|
-
_t =
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
var
|
|
5601
|
+
_t = On(Sr);
|
|
5602
|
+
He = In(_t, 0, "PreferencesService", _r, He);
|
|
5603
|
+
Pn(_t, 1, He);
|
|
5604
|
+
var Fe = /* @__PURE__ */ ((r) => (r.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api/v6", r.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", r.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", r.HOME_URL = "https://www.ipe.wiki/", r.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", r))(Fe || {});
|
|
5524
5605
|
/**
|
|
5525
5606
|
* ✏️ InPageEdit NEXT
|
|
5526
5607
|
*
|
|
@@ -5531,11 +5612,11 @@ var qe = /* @__PURE__ */ ((r) => (r.ANALYTICS_API_BASE = "https://analytics.ipe.
|
|
|
5531
5612
|
* @see https://github.com/inpageedit/inpageedit-next
|
|
5532
5613
|
* @see https://www.ipe.wiki/
|
|
5533
5614
|
*/
|
|
5534
|
-
class ge extends
|
|
5615
|
+
class ge extends q {
|
|
5535
5616
|
constructor(e) {
|
|
5536
5617
|
super({
|
|
5537
5618
|
name: "InPageEdit"
|
|
5538
|
-
}), this.version = "0.
|
|
5619
|
+
}), this.version = "0.11.0", this.Endpoints = Fe, this.schema = Ze, this.config = _e(ge.DEFAULT_CONFIG, e), this.logger = si({
|
|
5539
5620
|
name: "IPE",
|
|
5540
5621
|
color: "#33aaff",
|
|
5541
5622
|
level: this.config.logLevel
|
|
@@ -5550,7 +5631,7 @@ class ge extends z {
|
|
|
5550
5631
|
};
|
|
5551
5632
|
}
|
|
5552
5633
|
async #e() {
|
|
5553
|
-
this.plugin(
|
|
5634
|
+
this.plugin(bi, this.config.apiConfigs), this.plugin(Ue), this.plugin(Pi), this.plugin(rn), this.plugin(He), this.plugin(gn), this.plugin(Be), this.plugin(wn), this.plugin(bt), this.#t([
|
|
5554
5635
|
"api",
|
|
5555
5636
|
"currentPage",
|
|
5556
5637
|
"resourceLoader",
|
|
@@ -5577,23 +5658,24 @@ class ge extends z {
|
|
|
5577
5658
|
// TODO: 这里不应该硬编码,暂时先这样
|
|
5578
5659
|
async #r() {
|
|
5579
5660
|
[
|
|
5580
|
-
import("./index-
|
|
5661
|
+
import("./index-CFb1PSJg.js").then(({ PluginAnalytics: t }) => t),
|
|
5662
|
+
import("./index-DkQLtTG0.js").then(
|
|
5581
5663
|
({ PluginInArticleLinks: t }) => t
|
|
5582
5664
|
),
|
|
5583
|
-
import("./index-
|
|
5665
|
+
import("./index-DGOY4X1J.js").then(
|
|
5584
5666
|
({ PluginPreferencesUI: t }) => t
|
|
5585
5667
|
),
|
|
5586
|
-
import("./index-
|
|
5587
|
-
import("./index-
|
|
5588
|
-
import("./index-
|
|
5589
|
-
import("./index-
|
|
5668
|
+
import("./index-D7NpqwUe.js").then(({ PluginQuickEdit: t }) => t),
|
|
5669
|
+
import("./index-BVkdBJNf.js").then(({ PluginQuickDelete: t }) => t),
|
|
5670
|
+
import("./index-DKDtc9IF.js").then(({ PluginQuickMove: t }) => t),
|
|
5671
|
+
import("./index-BP-e8PeH.js").then(
|
|
5590
5672
|
({ PluginQuickPreview: t }) => t
|
|
5591
5673
|
),
|
|
5592
|
-
import("./index-
|
|
5593
|
-
import("./index-
|
|
5674
|
+
import("./index-BjwVNZ_h.js").then(({ PluginQuickDiff: t }) => t),
|
|
5675
|
+
import("./index-BzCqww16.js").then(
|
|
5594
5676
|
({ PluginQuickRedirect: t }) => t
|
|
5595
5677
|
),
|
|
5596
|
-
import("./index-
|
|
5678
|
+
import("./index-B5vDBMEh.js").then(({ PluginToolbox: t }) => t)
|
|
5597
5679
|
].forEach(async (t) => {
|
|
5598
5680
|
this.plugin(await t);
|
|
5599
5681
|
});
|
|
@@ -5611,13 +5693,16 @@ class ge extends z {
|
|
|
5611
5693
|
}), t;
|
|
5612
5694
|
}
|
|
5613
5695
|
}
|
|
5614
|
-
function
|
|
5696
|
+
function xr(r) {
|
|
5615
5697
|
return r.charAt(0).toLowerCase() + r.slice(1);
|
|
5616
5698
|
}
|
|
5617
|
-
function
|
|
5618
|
-
return
|
|
5699
|
+
function Bn(r) {
|
|
5700
|
+
return xr(r).replace(/_/g, "-").replace(/.[A-Z]+/g, (e) => e[0] + "-" + e.slice(1).toLowerCase());
|
|
5701
|
+
}
|
|
5702
|
+
function Tn(r) {
|
|
5703
|
+
return xr(r).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
|
|
5619
5704
|
}
|
|
5620
|
-
class
|
|
5705
|
+
class Hn {
|
|
5621
5706
|
constructor(e, t = void 0, i) {
|
|
5622
5707
|
this.ctx = e, this.disposeHandlers = [], this.name = i || "", this.config = t || {};
|
|
5623
5708
|
const { promise: n, resolve: s, reject: o } = Promise.withResolvers();
|
|
@@ -5658,7 +5743,7 @@ class Bn {
|
|
|
5658
5743
|
this.disposeHandlers = this.disposeHandlers.filter((t) => t !== e);
|
|
5659
5744
|
}
|
|
5660
5745
|
set name(e) {
|
|
5661
|
-
this.#e =
|
|
5746
|
+
this.#e = Tn(e).toUpperCase();
|
|
5662
5747
|
}
|
|
5663
5748
|
get name() {
|
|
5664
5749
|
return this.#e;
|
|
@@ -5669,14 +5754,14 @@ class Bn {
|
|
|
5669
5754
|
}
|
|
5670
5755
|
window.RLQ ||= [];
|
|
5671
5756
|
window.__IPE_MODULES__ ||= [];
|
|
5672
|
-
|
|
5757
|
+
Ln("InPageEdit#autoload", () => {
|
|
5673
5758
|
const r = kr();
|
|
5674
|
-
r &&
|
|
5759
|
+
r && Cn({
|
|
5675
5760
|
baseURL: r,
|
|
5676
5761
|
CoreClass: ge
|
|
5677
5762
|
});
|
|
5678
5763
|
});
|
|
5679
|
-
async function
|
|
5764
|
+
async function Cn(r = { baseURL: kr(), CoreClass: ge }) {
|
|
5680
5765
|
const { baseURL: e, CoreClass: t } = r;
|
|
5681
5766
|
typeof window?.ipe?.stop == "function" && await window.ipe.stop();
|
|
5682
5767
|
const i = window.InPageEdit || {}, n = new t({
|
|
@@ -5712,27 +5797,30 @@ async function Tn(r = { baseURL: kr(), CoreClass: ge }) {
|
|
|
5712
5797
|
/___/_/ /_/_/ \\__,_/\\__, /\\___/_____/\\__,_/_/\\__/
|
|
5713
5798
|
/____/ v` + n.version + `
|
|
5714
5799
|
- Wiki API Endpoint: ${e}
|
|
5715
|
-
- Documentation: ${
|
|
5716
|
-
- Bug Reports: ${
|
|
5800
|
+
- Documentation: ${Fe.HOME_URL}
|
|
5801
|
+
- Bug Reports: ${Fe.GITHUB_URL}`
|
|
5717
5802
|
);
|
|
5718
5803
|
}
|
|
5719
5804
|
function kr() {
|
|
5720
5805
|
const r = document.querySelector('meta[name="generator"][content^="MediaWiki"]') !== null, e = document.querySelector('link[rel="EditURI"]')?.href?.split("?")[0];
|
|
5721
5806
|
return r && e ? e : void 0;
|
|
5722
5807
|
}
|
|
5723
|
-
function
|
|
5808
|
+
function Ln(r, e) {
|
|
5724
5809
|
const t = Symbol.for(r);
|
|
5725
5810
|
return window[t] ? !1 : (window[t] = !0, e(), !0);
|
|
5726
5811
|
}
|
|
5727
5812
|
export {
|
|
5728
5813
|
Wt as $,
|
|
5729
|
-
|
|
5814
|
+
Hn as B,
|
|
5815
|
+
Fe as E,
|
|
5730
5816
|
le as I,
|
|
5731
5817
|
Ze as S,
|
|
5732
5818
|
yr as W,
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5819
|
+
ot as a,
|
|
5820
|
+
he as b,
|
|
5821
|
+
ge as c,
|
|
5822
|
+
si as d,
|
|
5823
|
+
ri as m,
|
|
5824
|
+
Bn as p
|
|
5737
5825
|
};
|
|
5738
|
-
//# sourceMappingURL=index-
|
|
5826
|
+
//# sourceMappingURL=index-DFPN4uYd.js.map
|