@inpageedit/core 0.16.1 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/InPageEdit.js +1 -1
- package/dist/{PluginImagesUsed-DnPDXczO.js → PluginImagesUsed-D5O8t694.js} +2 -2
- package/dist/{PluginImagesUsed-DnPDXczO.js.map → PluginImagesUsed-D5O8t694.js.map} +1 -1
- package/dist/{PluginPrefSync-CDTFyM8g.js → PluginPrefSync-C8tb5SJJ.js} +2 -2
- package/dist/{PluginPrefSync-CDTFyM8g.js.map → PluginPrefSync-C8tb5SJJ.js.map} +1 -1
- package/dist/{PluginStoreApp-Bng4DFBZ.js → PluginStoreApp-CeKtXL3p.js} +2 -2
- package/dist/{PluginStoreApp-Bng4DFBZ.js.map → PluginStoreApp-CeKtXL3p.js.map} +1 -1
- package/dist/{PluginTemplatesUsed-oM_VzfbH.js → PluginTemplatesUsed-DYv_lbHw.js} +2 -2
- package/dist/{PluginTemplatesUsed-oM_VzfbH.js.map → PluginTemplatesUsed-DYv_lbHw.js.map} +1 -1
- package/dist/core.js +2 -2
- package/dist/{index-42B3CrSO.js → index--IhZKYnh.js} +3 -3
- package/dist/index--IhZKYnh.js.map +1 -0
- package/dist/{index-Bn6y0Eln.js → index-Bf6ewNGZ.js} +101 -113
- package/dist/{index-Bn6y0Eln.js.map → index-Bf6ewNGZ.js.map} +1 -1
- package/dist/{index-BBUv7Lv6.js → index-BuSA1t5R.js} +2 -2
- package/dist/{index-BBUv7Lv6.js.map → index-BuSA1t5R.js.map} +1 -1
- package/dist/{index-D7rUF8vA.js → index-CaTtMzfu.js} +578 -501
- package/dist/index-CaTtMzfu.js.map +1 -0
- package/dist/{index-1sZXko-X.js → index-CxjH0_fO.js} +2 -2
- package/dist/{index-1sZXko-X.js.map → index-CxjH0_fO.js.map} +1 -1
- package/dist/{index-DlCbsA25.js → index-DSh05RaI.js} +3 -3
- package/dist/{index-DlCbsA25.js.map → index-DSh05RaI.js.map} +1 -1
- package/dist/{index-mf_pX14E.js → index-Dp_n8QEV.js} +2 -2
- package/dist/{index-mf_pX14E.js.map → index-Dp_n8QEV.js.map} +1 -1
- package/dist/{index-TG_MTC9y.js → index-Mi3qr9J0.js} +2 -2
- package/dist/{index-TG_MTC9y.js.map → index-Mi3qr9J0.js.map} +1 -1
- package/dist/{index-BllIuJSJ.js → index-QtXlz9l0.js} +3 -3
- package/dist/{index-BllIuJSJ.js.map → index-QtXlz9l0.js.map} +1 -1
- package/dist/{index-BcTomMXW.js → index-_Sydb5MZ.js} +391 -356
- package/dist/index-_Sydb5MZ.js.map +1 -0
- package/dist/{index-CkSHCMRN.js → index-fa8d4Dv_.js} +2 -2
- package/dist/{index-CkSHCMRN.js.map → index-fa8d4Dv_.js.map} +1 -1
- package/dist/{index-CN7r2e0P.js → index-h57rl1RH.js} +11 -11
- package/dist/index-h57rl1RH.js.map +1 -0
- package/dist/{index-CMmEZcB1.js → index-qbW7-LUD.js} +3 -3
- package/dist/index-qbW7-LUD.js.map +1 -0
- package/dist/index.d.ts +77 -39
- package/dist/index.js +2 -2
- package/dist/plugins/index.js +12 -12
- package/dist/services/index.js +14 -12
- package/dist/style.css +1 -1
- package/lib/index.umd.js +15 -15
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +2 -2
- package/dist/index-42B3CrSO.js.map +0 -1
- package/dist/index-BcTomMXW.js.map +0 -1
- package/dist/index-CMmEZcB1.js.map +0 -1
- package/dist/index-CN7r2e0P.js.map +0 -1
- package/dist/index-D7rUF8vA.js.map +0 -1
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { W as
|
|
2
|
-
import { j as N, P as
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
import { W as _i, d as xi, e as ki, r as Si, u as $i, c as Ei, a as Ai, f as Ci } from "./index-C0spLL-i.js";
|
|
2
|
+
import { j as N, P as Oi, p as _t } from "./Promise.withResolvers-C4chhLB1.js";
|
|
3
|
+
var Pi = Object.defineProperty, S = (i, e) => Pi(i, "name", { value: e, configurable: !0 });
|
|
4
|
+
function Ii() {
|
|
5
5
|
}
|
|
6
|
-
S(
|
|
6
|
+
S(Ii, "noop");
|
|
7
7
|
function I(i) {
|
|
8
8
|
return i == null;
|
|
9
9
|
}
|
|
10
10
|
S(I, "isNullable");
|
|
11
|
-
function
|
|
11
|
+
function Li(i) {
|
|
12
12
|
return !I(i);
|
|
13
13
|
}
|
|
14
|
-
S(
|
|
14
|
+
S(Li, "isNonNullable");
|
|
15
15
|
function he(i) {
|
|
16
16
|
return i && typeof i == "object" && !Array.isArray(i);
|
|
17
17
|
}
|
|
18
18
|
S(he, "isPlainObject");
|
|
19
|
-
function
|
|
19
|
+
function xt(i, e) {
|
|
20
20
|
return Object.fromEntries(Object.entries(i).filter(([t, r]) => e(t, r)));
|
|
21
21
|
}
|
|
22
|
-
S(
|
|
22
|
+
S(xt, "filterKeys");
|
|
23
23
|
function K(i, e) {
|
|
24
24
|
return Object.fromEntries(Object.entries(i).map(([t, r]) => [t, e(r, t)]));
|
|
25
25
|
}
|
|
26
26
|
S(K, "mapValues");
|
|
27
|
-
function
|
|
27
|
+
function kt(i, e, t) {
|
|
28
28
|
if (!e) return { ...i };
|
|
29
29
|
const r = {};
|
|
30
30
|
for (const n of e)
|
|
31
31
|
(t || i[n] !== void 0) && (r[n] = i[n]);
|
|
32
32
|
return r;
|
|
33
33
|
}
|
|
34
|
-
S(
|
|
35
|
-
function
|
|
34
|
+
S(kt, "pick");
|
|
35
|
+
function Ri(i, e) {
|
|
36
36
|
if (!e) return { ...i };
|
|
37
37
|
const t = { ...i };
|
|
38
38
|
for (const r of e)
|
|
39
39
|
Reflect.deleteProperty(t, r);
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
S(
|
|
42
|
+
S(Ri, "omit");
|
|
43
43
|
function j(i, e, t) {
|
|
44
44
|
return Object.defineProperty(i, e, { writable: !0, value: t, enumerable: !1 });
|
|
45
45
|
}
|
|
46
46
|
S(j, "defineProperty");
|
|
47
|
-
function
|
|
47
|
+
function ji(i, e) {
|
|
48
48
|
return e.every((t) => i.includes(t));
|
|
49
49
|
}
|
|
50
|
-
S(
|
|
51
|
-
function
|
|
50
|
+
S(ji, "contain");
|
|
51
|
+
function Ti(i, e) {
|
|
52
52
|
return i.filter((t) => e.includes(t));
|
|
53
53
|
}
|
|
54
|
-
S(
|
|
55
|
-
function
|
|
54
|
+
S(Ti, "intersection");
|
|
55
|
+
function Di(i, e) {
|
|
56
56
|
return i.filter((t) => !e.includes(t));
|
|
57
57
|
}
|
|
58
|
-
S(
|
|
59
|
-
function
|
|
58
|
+
S(Di, "difference");
|
|
59
|
+
function Ni(i, e) {
|
|
60
60
|
return Array.from(/* @__PURE__ */ new Set([...i, ...e]));
|
|
61
61
|
}
|
|
62
|
-
S(
|
|
63
|
-
function
|
|
62
|
+
S(Ni, "union");
|
|
63
|
+
function Mi(i) {
|
|
64
64
|
return [...new Set(i)];
|
|
65
65
|
}
|
|
66
|
-
S(
|
|
66
|
+
S(Mi, "deduplicate");
|
|
67
67
|
function W(i, e) {
|
|
68
68
|
const t = i?.indexOf(e);
|
|
69
69
|
return t >= 0 ? (i.splice(t, 1), !0) : !1;
|
|
70
70
|
}
|
|
71
71
|
S(W, "remove");
|
|
72
|
-
function
|
|
72
|
+
function Bi(i) {
|
|
73
73
|
return Array.isArray(i) ? i : I(i) ? [] : [i];
|
|
74
74
|
}
|
|
75
|
-
S(
|
|
75
|
+
S(Bi, "makeArray");
|
|
76
76
|
function G(i, e) {
|
|
77
77
|
return arguments.length === 1 ? (t) => G(i, t) : i in globalThis && e instanceof globalThis[i] || Object.prototype.toString.call(e).slice(8, -1) === i;
|
|
78
78
|
}
|
|
@@ -81,13 +81,13 @@ function se(i) {
|
|
|
81
81
|
return G("ArrayBuffer", i) || G("SharedArrayBuffer", i);
|
|
82
82
|
}
|
|
83
83
|
S(se, "isArrayBufferLike");
|
|
84
|
-
function
|
|
84
|
+
function St(i) {
|
|
85
85
|
return se(i) || ArrayBuffer.isView(i);
|
|
86
86
|
}
|
|
87
|
-
S(
|
|
87
|
+
S(St, "isArrayBufferSource");
|
|
88
88
|
var B;
|
|
89
89
|
((i) => {
|
|
90
|
-
i.is = se, i.isSource =
|
|
90
|
+
i.is = se, i.isSource = St;
|
|
91
91
|
function e(o) {
|
|
92
92
|
return ArrayBuffer.isView(o) ? o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength) : o;
|
|
93
93
|
}
|
|
@@ -161,19 +161,19 @@ function Y(i, e, t) {
|
|
|
161
161
|
}) ?? Object.keys({ ...i, ...e }).every((n) => Y(i[n], e[n], t));
|
|
162
162
|
}
|
|
163
163
|
S(Y, "deepEqual");
|
|
164
|
-
function
|
|
164
|
+
function Ui(i) {
|
|
165
165
|
return i.charAt(0).toUpperCase() + i.slice(1);
|
|
166
166
|
}
|
|
167
|
-
S(
|
|
168
|
-
function
|
|
167
|
+
S(Ui, "capitalize");
|
|
168
|
+
function Fi(i) {
|
|
169
169
|
return i.charAt(0).toLowerCase() + i.slice(1);
|
|
170
170
|
}
|
|
171
|
-
S(
|
|
172
|
-
function
|
|
171
|
+
S(Fi, "uncapitalize");
|
|
172
|
+
function zi(i) {
|
|
173
173
|
return i.replace(/[_-][a-z]/g, (e) => e.slice(1).toUpperCase());
|
|
174
174
|
}
|
|
175
|
-
S(
|
|
176
|
-
function
|
|
175
|
+
S(zi, "camelCase");
|
|
176
|
+
function Be(i, e, t) {
|
|
177
177
|
const r = [];
|
|
178
178
|
let n = 0;
|
|
179
179
|
for (let s = 0; s < i.length; s++) {
|
|
@@ -189,28 +189,28 @@ function Me(i, e, t) {
|
|
|
189
189
|
}
|
|
190
190
|
return String.fromCharCode(...r);
|
|
191
191
|
}
|
|
192
|
-
S(
|
|
193
|
-
function
|
|
194
|
-
return
|
|
192
|
+
S(Be, "tokenize");
|
|
193
|
+
function Hi(i) {
|
|
194
|
+
return Be(i, [45, 95], 45);
|
|
195
195
|
}
|
|
196
|
-
S(
|
|
197
|
-
function
|
|
198
|
-
return
|
|
196
|
+
S(Hi, "paramCase");
|
|
197
|
+
function Ki(i) {
|
|
198
|
+
return Be(i, [45, 95], 95);
|
|
199
199
|
}
|
|
200
|
-
S(
|
|
201
|
-
function
|
|
200
|
+
S(Ki, "snakeCase");
|
|
201
|
+
function qi(i) {
|
|
202
202
|
return typeof i != "string" ? `[${i.toString()}]` : /^[a-z_$][\w$]*$/i.test(i) ? `.${i}` : `[${JSON.stringify(i)}]`;
|
|
203
203
|
}
|
|
204
|
-
S(
|
|
205
|
-
function
|
|
204
|
+
S(qi, "formatProperty");
|
|
205
|
+
function $t(i) {
|
|
206
206
|
return i.replace(/\/$/, "");
|
|
207
207
|
}
|
|
208
|
-
S(
|
|
209
|
-
function
|
|
210
|
-
return i.startsWith("/") || (i = "/" + i),
|
|
208
|
+
S($t, "trimSlash");
|
|
209
|
+
function Wi(i) {
|
|
210
|
+
return i.startsWith("/") || (i = "/" + i), $t(i);
|
|
211
211
|
}
|
|
212
|
-
S(
|
|
213
|
-
var
|
|
212
|
+
S(Wi, "sanitize");
|
|
213
|
+
var ct;
|
|
214
214
|
((i) => {
|
|
215
215
|
i.millisecond = 1, i.second = 1e3, i.minute = i.second * 60, i.hour = i.minute * 60, i.day = i.hour * 24, i.week = i.day * 7;
|
|
216
216
|
let e = (/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
@@ -261,8 +261,8 @@ var at;
|
|
|
261
261
|
return g.replace("yyyy", w.getFullYear().toString()).replace("yy", w.getFullYear().toString().slice(2)).replace("MM", y(w.getMonth() + 1)).replace("dd", y(w.getDate())).replace("hh", y(w.getHours())).replace("mm", y(w.getMinutes())).replace("ss", y(w.getSeconds())).replace("SSS", y(w.getMilliseconds(), 3));
|
|
262
262
|
}
|
|
263
263
|
i.template = _, S(_, "template");
|
|
264
|
-
})(
|
|
265
|
-
var
|
|
264
|
+
})(ct || (ct = {}));
|
|
265
|
+
var Gi = Object.defineProperty, k = (i, e) => Gi(i, "name", { value: e, configurable: !0 }), b = {
|
|
266
266
|
// internal symbols
|
|
267
267
|
shadow: /* @__PURE__ */ Symbol.for("cordis.shadow"),
|
|
268
268
|
receiver: /* @__PURE__ */ Symbol.for("cordis.receiver"),
|
|
@@ -283,36 +283,36 @@ var qi = Object.defineProperty, k = (i, e) => qi(i, "name", { value: e, configur
|
|
|
283
283
|
tracker: /* @__PURE__ */ Symbol.for("cordis.tracker"),
|
|
284
284
|
provide: /* @__PURE__ */ Symbol.for("cordis.provide"),
|
|
285
285
|
immediate: /* @__PURE__ */ Symbol.for("cordis.immediate")
|
|
286
|
-
},
|
|
287
|
-
}.constructor,
|
|
286
|
+
}, Vi = function* () {
|
|
287
|
+
}.constructor, lt = async function* () {
|
|
288
288
|
}.constructor;
|
|
289
|
-
function
|
|
290
|
-
return !(!i.prototype || i instanceof
|
|
289
|
+
function Ue(i) {
|
|
290
|
+
return !(!i.prototype || i instanceof Vi || lt !== Function && i instanceof lt);
|
|
291
291
|
}
|
|
292
|
-
k(
|
|
292
|
+
k(Ue, "isConstructor");
|
|
293
293
|
function oe(i, e) {
|
|
294
294
|
const t = i.Config || i.schema;
|
|
295
295
|
return t && i.schema !== !1 && (e = t(e)), e ?? {};
|
|
296
296
|
}
|
|
297
297
|
k(oe, "resolveConfig");
|
|
298
|
-
function
|
|
298
|
+
function Et(i) {
|
|
299
299
|
return [Map, Set, Date, Promise].some((e) => i instanceof e);
|
|
300
300
|
}
|
|
301
|
-
k(
|
|
302
|
-
function
|
|
301
|
+
k(Et, "isUnproxyable");
|
|
302
|
+
function Fe(i, e) {
|
|
303
303
|
if (i === Object.prototype) return e;
|
|
304
|
-
const t = Object.create(
|
|
304
|
+
const t = Object.create(Fe(Object.getPrototypeOf(i), e));
|
|
305
305
|
for (const r of Reflect.ownKeys(i))
|
|
306
306
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(i, r));
|
|
307
307
|
return t;
|
|
308
308
|
}
|
|
309
|
-
k(
|
|
310
|
-
function
|
|
309
|
+
k(Fe, "joinPrototype");
|
|
310
|
+
function ze(i) {
|
|
311
311
|
return i && (typeof i == "object" || typeof i == "function");
|
|
312
312
|
}
|
|
313
|
-
k(
|
|
313
|
+
k(ze, "isObject");
|
|
314
314
|
function U(i, e, t) {
|
|
315
|
-
if (!
|
|
315
|
+
if (!ze(e)) return e;
|
|
316
316
|
if (Object.hasOwn(e, b.shadow))
|
|
317
317
|
return Object.getPrototypeOf(e);
|
|
318
318
|
const r = e[b.tracker];
|
|
@@ -339,7 +339,7 @@ function Ce(i, e, t, r) {
|
|
|
339
339
|
return n ? fe(r, t, i.extend({ [b.shadow]: n })) : r;
|
|
340
340
|
}
|
|
341
341
|
k(Ce, "createShadow");
|
|
342
|
-
function
|
|
342
|
+
function At(i, e, t, r) {
|
|
343
343
|
return new Proxy(e, {
|
|
344
344
|
apply: /* @__PURE__ */ k((n, s, o) => (s === t && (s = r), o = o.map((a) => typeof a != "function" || a[b.original] ? a : new Proxy(a, {
|
|
345
345
|
get: /* @__PURE__ */ k((f, u, p) => {
|
|
@@ -354,7 +354,7 @@ function $t(i, e, t, r) {
|
|
|
354
354
|
})), U(i, Reflect.apply(n, s, o))), "apply")
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
|
-
k(
|
|
357
|
+
k(At, "createShadowMethod");
|
|
358
358
|
function _e(i, e, t, r) {
|
|
359
359
|
i[b.shadow] && (i = Object.getPrototypeOf(i));
|
|
360
360
|
const n = new Proxy(e, {
|
|
@@ -366,7 +366,7 @@ function _e(i, e, t, r) {
|
|
|
366
366
|
if (t.associate && i[b.internal][`${t.associate}.${o}`])
|
|
367
367
|
return Reflect.get(i, `${t.associate}.${o}`, fe(i, b.receiver, a));
|
|
368
368
|
const f = Ce(i, s, t.property, a), u = Reflect.get(s, o, f), p = u?.[b.tracker];
|
|
369
|
-
return p ? _e(i, u, p) : !r && typeof u == "function" ?
|
|
369
|
+
return p ? _e(i, u, p) : !r && typeof u == "function" ? At(i, u, a, f) : u;
|
|
370
370
|
}, "get"),
|
|
371
371
|
set: /* @__PURE__ */ k((s, o, a, f) => {
|
|
372
372
|
if (o === b.original || o === t.property) return !1;
|
|
@@ -377,24 +377,24 @@ function _e(i, e, t, r) {
|
|
|
377
377
|
const u = Ce(i, s, t.property, f);
|
|
378
378
|
return Reflect.set(s, o, a, u);
|
|
379
379
|
}, "set"),
|
|
380
|
-
apply: /* @__PURE__ */ k((s, o, a) =>
|
|
380
|
+
apply: /* @__PURE__ */ k((s, o, a) => He(n, s, o, a), "apply")
|
|
381
381
|
});
|
|
382
382
|
return n;
|
|
383
383
|
}
|
|
384
384
|
k(_e, "createTraceable");
|
|
385
|
-
function
|
|
385
|
+
function He(i, e, t, r) {
|
|
386
386
|
return e[b.invoke] ? e[b.invoke].apply(i, r) : Reflect.apply(e, t, r);
|
|
387
387
|
}
|
|
388
|
-
k(
|
|
389
|
-
function
|
|
388
|
+
k(He, "applyTraceable");
|
|
389
|
+
function Oe(i, e, t) {
|
|
390
390
|
const r = /* @__PURE__ */ k(function(...n) {
|
|
391
391
|
const s = _e(r.ctx, r, t);
|
|
392
|
-
return
|
|
392
|
+
return He(s, r, this, n);
|
|
393
393
|
}, "self");
|
|
394
394
|
return j(r, "name", i), Object.setPrototypeOf(r, e);
|
|
395
395
|
}
|
|
396
|
-
k(
|
|
397
|
-
var
|
|
396
|
+
k(Oe, "createCallable");
|
|
397
|
+
var Yi = class X {
|
|
398
398
|
constructor(e) {
|
|
399
399
|
this.ctx = e, j(this, b.tracker, {
|
|
400
400
|
associate: "reflect",
|
|
@@ -422,18 +422,18 @@ var Gi = class Q {
|
|
|
422
422
|
if (typeof t != "string") return Reflect.get(e, t, r);
|
|
423
423
|
if (Reflect.has(e, t))
|
|
424
424
|
return U(r, Reflect.get(e, t, r), !0);
|
|
425
|
-
const [n, s] =
|
|
426
|
-
return s ? s.type === "accessor" ? s.get.call(r, r[b.receiver]) : (s.builtin ||
|
|
425
|
+
const [n, s] = X.resolveInject(e, t), o = new Error(`property ${n} is not registered, declare it as \`inject\` to suppress this warning`);
|
|
426
|
+
return s ? s.type === "accessor" ? s.get.call(r, r[b.receiver]) : (s.builtin || X.checkInject(r, n, o), r.reflect.get(n)) : (X.checkInject(r, n, o), Reflect.get(e, n, r));
|
|
427
427
|
}, "get"),
|
|
428
428
|
set: /* @__PURE__ */ k((e, t, r, n) => {
|
|
429
429
|
if (typeof t != "string") return Reflect.set(e, t, r, n);
|
|
430
|
-
const [s, o] =
|
|
430
|
+
const [s, o] = X.resolveInject(e, t);
|
|
431
431
|
return o ? o.type === "accessor" ? o.set ? o.set.call(n, r, n[b.receiver]) : !1 : (n.reflect.set(s, r), !0) : Reflect.set(e, s, r, n);
|
|
432
432
|
}, "set"),
|
|
433
433
|
has: /* @__PURE__ */ k((e, t) => {
|
|
434
434
|
if (typeof t != "string") return Reflect.has(e, t);
|
|
435
435
|
if (Reflect.has(e, t)) return !0;
|
|
436
|
-
const [, r] =
|
|
436
|
+
const [, r] = X.resolveInject(e, t);
|
|
437
437
|
return !!r;
|
|
438
438
|
}, "has")
|
|
439
439
|
};
|
|
@@ -454,7 +454,7 @@ var Gi = class Q {
|
|
|
454
454
|
const o = this.ctx;
|
|
455
455
|
I(t) || (s = o.effect(() => () => {
|
|
456
456
|
o.set(e, void 0);
|
|
457
|
-
})),
|
|
457
|
+
})), Et(t) && o.emit(o, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
|
|
458
458
|
const a = Object.create(o);
|
|
459
459
|
return a[b.filter] = (f) => o[b.isolate][e] === f[b.isolate][e], o.emit(a, "internal/before-service", e, t), o[b.store][r] = { value: t, source: o }, o.emit(a, "internal/service", e, n), s;
|
|
460
460
|
}
|
|
@@ -462,7 +462,7 @@ var Gi = class Q {
|
|
|
462
462
|
const n = this.ctx.root[b.internal];
|
|
463
463
|
if (e in n) return;
|
|
464
464
|
const s = Symbol(e);
|
|
465
|
-
n[e] = { type: "service", builtin: r }, this.ctx.root[b.isolate][e] = s,
|
|
465
|
+
n[e] = { type: "service", builtin: r }, this.ctx.root[b.isolate][e] = s, ze(t) && (this.ctx[b.store][s] = { value: t, source: null }, j(t, b.tracker, {
|
|
466
466
|
associate: e,
|
|
467
467
|
property: "ctx"
|
|
468
468
|
}));
|
|
@@ -507,12 +507,12 @@ var Gi = class Q {
|
|
|
507
507
|
apply: /* @__PURE__ */ k((t, r, n) => t.apply(this.trace(r), n.map((s) => this.trace(s))), "apply")
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
|
-
},
|
|
511
|
-
function
|
|
510
|
+
}, Pe = Yi;
|
|
511
|
+
function Ie(i) {
|
|
512
512
|
return i !== null && i !== !1 && i !== void 0;
|
|
513
513
|
}
|
|
514
|
-
k(
|
|
515
|
-
var
|
|
514
|
+
k(Ie, "isBailed");
|
|
515
|
+
var Ji = class {
|
|
516
516
|
constructor(i) {
|
|
517
517
|
this.ctx = i, j(this, b.tracker, {
|
|
518
518
|
associate: "lifecycle",
|
|
@@ -548,7 +548,7 @@ var Vi = class {
|
|
|
548
548
|
const e = /* @__PURE__ */ k((t, r) => {
|
|
549
549
|
if (!t.runtime.plugin) return !1;
|
|
550
550
|
for (const n in t.runtime.inject)
|
|
551
|
-
if (r ===
|
|
551
|
+
if (r === Pe.resolveInject(t.ctx, n)[0]) return !0;
|
|
552
552
|
return e(t.parent.scope, r);
|
|
553
553
|
}, "checkInject");
|
|
554
554
|
j(this.on("internal/inject", function(t) {
|
|
@@ -585,11 +585,11 @@ var Vi = class {
|
|
|
585
585
|
}
|
|
586
586
|
async serial(...i) {
|
|
587
587
|
for await (const e of this.dispatch("serial", i))
|
|
588
|
-
if (
|
|
588
|
+
if (Ie(e)) return e;
|
|
589
589
|
}
|
|
590
590
|
bail(...i) {
|
|
591
591
|
for (const e of this.dispatch("bail", i))
|
|
592
|
-
if (
|
|
592
|
+
if (Ie(e)) return e;
|
|
593
593
|
}
|
|
594
594
|
register(i, e, t, r) {
|
|
595
595
|
const n = r.prepend ? "unshift" : "push";
|
|
@@ -625,9 +625,9 @@ var Vi = class {
|
|
|
625
625
|
async stop() {
|
|
626
626
|
this.isActive = !1, this.ctx.scope.reset();
|
|
627
627
|
}
|
|
628
|
-
},
|
|
628
|
+
}, Qi = Ji, Xi = /* @__PURE__ */ ((i) => (i[i.PENDING = 0] = "PENDING", i[i.LOADING = 1] = "LOADING", i[i.ACTIVE = 2] = "ACTIVE", i[i.FAILED = 3] = "FAILED", i[i.DISPOSED = 4] = "DISPOSED", i))(Xi || {}), Le = class Ct extends Error {
|
|
629
629
|
constructor(e, t) {
|
|
630
|
-
super(t ??
|
|
630
|
+
super(t ?? Ct.Code[e]), this.code = e;
|
|
631
631
|
}
|
|
632
632
|
static {
|
|
633
633
|
k(this, "CordisError");
|
|
@@ -637,8 +637,8 @@ var Vi = class {
|
|
|
637
637
|
i.Code = {
|
|
638
638
|
INACTIVE_EFFECT: "cannot create effect on inactive context"
|
|
639
639
|
};
|
|
640
|
-
})(
|
|
641
|
-
var
|
|
640
|
+
})(Le || (Le = {}));
|
|
641
|
+
var Ot = class {
|
|
642
642
|
constructor(i, e) {
|
|
643
643
|
this.parent = i, this.config = e, this.uid = i.registry ? i.registry.counter : 0, this.ctx = this.context = i.extend({ scope: this }), this.proxy = new Proxy({}, {
|
|
644
644
|
get: /* @__PURE__ */ k((t, r) => Reflect.get(this.config, r), "get")
|
|
@@ -664,11 +664,11 @@ var Ct = class {
|
|
|
664
664
|
}
|
|
665
665
|
assertActive() {
|
|
666
666
|
if (!(this.uid !== null || this.isActive))
|
|
667
|
-
throw new
|
|
667
|
+
throw new Le("INACTIVE_EFFECT");
|
|
668
668
|
}
|
|
669
669
|
effect(i, e) {
|
|
670
670
|
this.assertActive();
|
|
671
|
-
const t =
|
|
671
|
+
const t = Ue(i) ? new i(this.ctx, e) : i(this.ctx, e);
|
|
672
672
|
let r = !1;
|
|
673
673
|
const n = typeof t == "function" ? t : t.dispose.bind(t), s = /* @__PURE__ */ k((...o) => {
|
|
674
674
|
if (!r)
|
|
@@ -754,7 +754,7 @@ var Ct = class {
|
|
|
754
754
|
}
|
|
755
755
|
return [s, o];
|
|
756
756
|
}
|
|
757
|
-
},
|
|
757
|
+
}, Zi = class extends Ot {
|
|
758
758
|
constructor(i, e, t, r) {
|
|
759
759
|
super(i, t), this.runtime = e, this.dispose = j(i.scope.collect(`fork <${i.runtime.name}>`, () => {
|
|
760
760
|
this.uid = null, this.reset(), this.context.emit("internal/fork", this);
|
|
@@ -783,7 +783,7 @@ var Ct = class {
|
|
|
783
783
|
const [s, o] = r.checkUpdate(n, e);
|
|
784
784
|
this.context.emit("internal/before-update", this, i), this.config = n, r.config = n, s && this.context.emit("internal/update", this, t), o && r.restart();
|
|
785
785
|
}
|
|
786
|
-
},
|
|
786
|
+
}, ht = class extends Ot {
|
|
787
787
|
constructor(i, e, t, r) {
|
|
788
788
|
super(i, t), this.plugin = e, e ? (this.setup(), this.init(r)) : (this.name = "root", this.isActive = !0);
|
|
789
789
|
}
|
|
@@ -803,7 +803,7 @@ var Ct = class {
|
|
|
803
803
|
return this.forkables.length > 0;
|
|
804
804
|
}
|
|
805
805
|
fork(i, e, t) {
|
|
806
|
-
return new
|
|
806
|
+
return new Zi(i, this, e, t);
|
|
807
807
|
}
|
|
808
808
|
dispose() {
|
|
809
809
|
return this.uid = null, this.reset(), this.context.emit("internal/runtime", this), !0;
|
|
@@ -815,7 +815,7 @@ var Ct = class {
|
|
|
815
815
|
apply = /* @__PURE__ */ k((i, e) => {
|
|
816
816
|
if (typeof this.plugin != "function")
|
|
817
817
|
return this.plugin.apply(i, e);
|
|
818
|
-
if (
|
|
818
|
+
if (Ue(this.plugin)) {
|
|
819
819
|
const t = new this.plugin(i, e), r = t[M.expose];
|
|
820
820
|
return r && i.set(r, t), t.fork && this.forkables.push(t.fork.bind(t)), t;
|
|
821
821
|
} else
|
|
@@ -848,10 +848,10 @@ var Ct = class {
|
|
|
848
848
|
this.config = r, o && (this.context.emit("internal/before-update", o, i), o.config = r, n && this.context.emit("internal/update", o, t)), s && this.restart();
|
|
849
849
|
}
|
|
850
850
|
};
|
|
851
|
-
function
|
|
851
|
+
function Pt(i) {
|
|
852
852
|
return i && typeof i == "object" && typeof i.apply == "function";
|
|
853
853
|
}
|
|
854
|
-
k(
|
|
854
|
+
k(Pt, "isApplicable");
|
|
855
855
|
function F(i) {
|
|
856
856
|
return function(e, t) {
|
|
857
857
|
if (t.kind === "class")
|
|
@@ -879,13 +879,13 @@ k(F, "Inject");
|
|
|
879
879
|
}
|
|
880
880
|
i.resolve = e, k(e, "resolve");
|
|
881
881
|
})(F || (F = {}));
|
|
882
|
-
var
|
|
882
|
+
var er = class {
|
|
883
883
|
constructor(i, e) {
|
|
884
884
|
this.ctx = i, j(this, b.tracker, {
|
|
885
885
|
associate: "registry",
|
|
886
886
|
property: "ctx"
|
|
887
887
|
}), this.context = i;
|
|
888
|
-
const t = new
|
|
888
|
+
const t = new ht(i, null, e);
|
|
889
889
|
i.scope = t, t.ctx = i, this.set(null, t);
|
|
890
890
|
}
|
|
891
891
|
static {
|
|
@@ -902,7 +902,7 @@ var Qi = class {
|
|
|
902
902
|
}
|
|
903
903
|
resolve(i, e = !1) {
|
|
904
904
|
if (i === null || typeof i == "function") return i;
|
|
905
|
-
if (
|
|
905
|
+
if (Pt(i)) return i.apply;
|
|
906
906
|
if (e) throw new Error('invalid plugin, expect function or object with an "apply" method, received ' + typeof i);
|
|
907
907
|
}
|
|
908
908
|
get(i) {
|
|
@@ -948,9 +948,9 @@ var Qi = class {
|
|
|
948
948
|
this.context.emit(this.ctx, "internal/error", n), t = n, e = null;
|
|
949
949
|
}
|
|
950
950
|
let r = this.get(i);
|
|
951
|
-
return r ? (r.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${i.name}`)), r.fork(this.ctx, e, t)) : (r = new
|
|
951
|
+
return r ? (r.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${i.name}`)), r.fork(this.ctx, e, t)) : (r = new ht(this.ctx, i, e, t), this.set(i, r), r.fork(this.ctx, e, t));
|
|
952
952
|
}
|
|
953
|
-
},
|
|
953
|
+
}, tr = er, M = class te {
|
|
954
954
|
static {
|
|
955
955
|
k(this, "Context");
|
|
956
956
|
}
|
|
@@ -976,8 +976,8 @@ var Qi = class {
|
|
|
976
976
|
}
|
|
977
977
|
constructor(e) {
|
|
978
978
|
e = oe(this.constructor, e), this[b.store] = /* @__PURE__ */ Object.create(null), this[b.isolate] = /* @__PURE__ */ Object.create(null), this[b.internal] = /* @__PURE__ */ Object.create(null), this[b.intercept] = /* @__PURE__ */ Object.create(null);
|
|
979
|
-
const t = new Proxy(this,
|
|
980
|
-
t.root = t, t.reflect = new
|
|
979
|
+
const t = new Proxy(this, Pe.handler);
|
|
980
|
+
t.root = t, t.reflect = new Pe(t), t.registry = new tr(t, e), t.lifecycle = new Qi(t);
|
|
981
981
|
const r = /* @__PURE__ */ k((n) => {
|
|
982
982
|
if (n) {
|
|
983
983
|
r(Object.getPrototypeOf(n));
|
|
@@ -1019,7 +1019,7 @@ var Qi = class {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
};
|
|
1021
1021
|
M.prototype[M.internal] = /* @__PURE__ */ Object.create(null);
|
|
1022
|
-
var z = class
|
|
1022
|
+
var z = class It {
|
|
1023
1023
|
static {
|
|
1024
1024
|
k(this, "Service");
|
|
1025
1025
|
}
|
|
@@ -1044,7 +1044,7 @@ var z = class Ot {
|
|
|
1044
1044
|
associate: r,
|
|
1045
1045
|
property: "ctx"
|
|
1046
1046
|
};
|
|
1047
|
-
return o[b.invoke] && (o =
|
|
1047
|
+
return o[b.invoke] && (o = Oe(r, Fe(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[b.setup](), o.name = r, o.config = s, j(o, b.tracker, a), o.ctx.provide(r), o.ctx.runtime.name = r, n && (t ? o[b.expose] = r : o.ctx.set(r, o)), o.ctx.on("ready", async () => {
|
|
1048
1048
|
await Promise.resolve(), await o.start(), n || o.ctx.set(r, o);
|
|
1049
1049
|
}), o.ctx.on("dispose", () => o.stop()), o;
|
|
1050
1050
|
}
|
|
@@ -1056,7 +1056,7 @@ var z = class Ot {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
[b.extend](e) {
|
|
1058
1058
|
let t;
|
|
1059
|
-
return this[
|
|
1059
|
+
return this[It.invoke] ? t = Oe(this.name, this, this[b.tracker]) : t = Object.create(this), Object.assign(t, e);
|
|
1060
1060
|
}
|
|
1061
1061
|
static [Symbol.hasInstance](e) {
|
|
1062
1062
|
let t = e.constructor;
|
|
@@ -1066,9 +1066,9 @@ var z = class Ot {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
return !1;
|
|
1068
1068
|
}
|
|
1069
|
-
},
|
|
1070
|
-
return e || (0, i[
|
|
1071
|
-
},
|
|
1069
|
+
}, ir = Object.defineProperty, rr = Object.getOwnPropertyNames, E = (i, e) => ir(i, "name", { value: e, configurable: !0 }), nr = (i, e) => function() {
|
|
1070
|
+
return e || (0, i[rr(i)[0]])((e = { exports: {} }).exports, e), e.exports;
|
|
1071
|
+
}, sr = nr({
|
|
1072
1072
|
"src/index.ts"(i, e) {
|
|
1073
1073
|
var t = /* @__PURE__ */ Symbol.for("schemastery"), r = /* @__PURE__ */ Symbol.for("ValidationError");
|
|
1074
1074
|
globalThis.__schemastery_index__ ??= 0, globalThis.__schemastery_refs__ = void 0;
|
|
@@ -1134,7 +1134,7 @@ var z = class Ot {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
E(a, "getInner");
|
|
1136
1136
|
function f(l) {
|
|
1137
|
-
return
|
|
1137
|
+
return xt(l ?? {}, (c) => !c.startsWith("$"));
|
|
1138
1138
|
}
|
|
1139
1139
|
E(f, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ E(function(c) {
|
|
1140
1140
|
const h = s(this), d = o(h.meta.description, c);
|
|
@@ -1157,7 +1157,7 @@ var z = class Ot {
|
|
|
1157
1157
|
const c = s(this);
|
|
1158
1158
|
return c.meta.badges ||= [], c.meta.badges.push({ text: "experimental", type: "warning" }), c;
|
|
1159
1159
|
}, "experimental"), s.prototype.pattern = /* @__PURE__ */ E(function(c) {
|
|
1160
|
-
const h = s(this), d =
|
|
1160
|
+
const h = s(this), d = kt(c, ["source", "flags"]);
|
|
1161
1161
|
return h.meta = { ...h.meta, pattern: d }, h;
|
|
1162
1162
|
}, "pattern"), s.prototype.simplify = /* @__PURE__ */ E(function(c) {
|
|
1163
1163
|
if (Y(c, this.meta.default, this.type === "dict")) return null;
|
|
@@ -1208,11 +1208,11 @@ var z = class Ot {
|
|
|
1208
1208
|
if (d.ignore?.(c, h)) return [c];
|
|
1209
1209
|
if (I(c) && h.type !== "lazy") {
|
|
1210
1210
|
if (h.meta.required) throw new n("missing required value", d);
|
|
1211
|
-
let x = h,
|
|
1212
|
-
for (; x?.type === "intersect" && I(
|
|
1213
|
-
x = x.list[0],
|
|
1214
|
-
if (I(
|
|
1215
|
-
c = ue(
|
|
1211
|
+
let x = h, C = h.meta.default;
|
|
1212
|
+
for (; x?.type === "intersect" && I(C); )
|
|
1213
|
+
x = x.list[0], C = x?.meta.default;
|
|
1214
|
+
if (I(C)) return [c];
|
|
1215
|
+
c = ue(C);
|
|
1216
1216
|
}
|
|
1217
1217
|
const v = u[h.type];
|
|
1218
1218
|
if (!v) throw new n(`unsupported type "${h.type}"`, d);
|
|
@@ -1383,14 +1383,14 @@ var z = class Ot {
|
|
|
1383
1383
|
if (!he(l)) throw new n(`expected object but got ${l}`, d);
|
|
1384
1384
|
const v = {};
|
|
1385
1385
|
for (const x in l) {
|
|
1386
|
-
let
|
|
1386
|
+
let C;
|
|
1387
1387
|
try {
|
|
1388
|
-
|
|
1388
|
+
C = s.resolve(x, h, d)[0];
|
|
1389
1389
|
} catch (Se) {
|
|
1390
1390
|
if (m) continue;
|
|
1391
1391
|
throw Se;
|
|
1392
1392
|
}
|
|
1393
|
-
v[
|
|
1393
|
+
v[C] = g(l, x, c, d), l[C] = l[x], x !== C && delete l[x];
|
|
1394
1394
|
}
|
|
1395
1395
|
return [v];
|
|
1396
1396
|
}), s.extend("tuple", (l, { list: c }, h, d) => {
|
|
@@ -1421,16 +1421,16 @@ var z = class Ot {
|
|
|
1421
1421
|
if (!c.length) return [l];
|
|
1422
1422
|
let v;
|
|
1423
1423
|
for (const x of c) {
|
|
1424
|
-
const
|
|
1425
|
-
if (!I(
|
|
1424
|
+
const C = s.resolve(l, x, d, !0)[0];
|
|
1425
|
+
if (!I(C))
|
|
1426
1426
|
if (I(v))
|
|
1427
|
-
v =
|
|
1427
|
+
v = C;
|
|
1428
1428
|
else {
|
|
1429
|
-
if (typeof v != typeof
|
|
1429
|
+
if (typeof v != typeof C)
|
|
1430
1430
|
throw new n(`expected ${h()} but got ${JSON.stringify(l)}`, d);
|
|
1431
|
-
if (typeof
|
|
1432
|
-
w(v ??= {},
|
|
1433
|
-
else if (v !==
|
|
1431
|
+
if (typeof C == "object")
|
|
1432
|
+
w(v ??= {}, C);
|
|
1433
|
+
else if (v !== C)
|
|
1434
1434
|
throw new n(`expected ${h()} but got ${JSON.stringify(l)}`, d);
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
@@ -1440,7 +1440,7 @@ var z = class Ot {
|
|
|
1440
1440
|
return d ? [h(v)] : [h(v), h(x)];
|
|
1441
1441
|
});
|
|
1442
1442
|
var O = {};
|
|
1443
|
-
function
|
|
1443
|
+
function A(l, c, h) {
|
|
1444
1444
|
O[l] = h, Object.assign(s, {
|
|
1445
1445
|
[l](...d) {
|
|
1446
1446
|
const m = new s({ type: l });
|
|
@@ -1460,18 +1460,18 @@ var z = class Ot {
|
|
|
1460
1460
|
break;
|
|
1461
1461
|
case "bits": {
|
|
1462
1462
|
m.bits = {};
|
|
1463
|
-
for (const
|
|
1464
|
-
typeof d[x][
|
|
1463
|
+
for (const C in d[x])
|
|
1464
|
+
typeof d[x][C] == "number" && (m.bits[C] = d[x][C]);
|
|
1465
1465
|
break;
|
|
1466
1466
|
}
|
|
1467
1467
|
case "callback": {
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1468
|
+
const C = m.callback = d[x];
|
|
1469
|
+
C.toJSON ||= () => C.toString();
|
|
1470
1470
|
break;
|
|
1471
1471
|
}
|
|
1472
1472
|
case "constructor": {
|
|
1473
|
-
const
|
|
1474
|
-
typeof
|
|
1473
|
+
const C = m.constructor = d[x];
|
|
1474
|
+
typeof C == "function" && (C.toJSON ||= () => C.name);
|
|
1475
1475
|
break;
|
|
1476
1476
|
}
|
|
1477
1477
|
default:
|
|
@@ -1481,24 +1481,24 @@ var z = class Ot {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
});
|
|
1483
1483
|
}
|
|
1484
|
-
E(
|
|
1484
|
+
E(A, "defineMethod"), A("is", ["constructor"], ({ constructor: l }) => typeof l == "function" ? l.name : l), A("any", [], () => "any"), A("never", [], () => "never"), A("const", ["value"], ({ value: l }) => typeof l == "string" ? JSON.stringify(l) : l), A("string", [], () => "string"), A("number", [], () => "number"), A("boolean", [], () => "boolean"), A("bitset", ["bits"], () => "bitset"), A("function", [], () => "function"), A("array", ["inner"], ({ inner: l }) => `${l.toString(!0)}[]`), A("dict", ["inner", "sKey"], ({ inner: l, sKey: c }) => `{ [key: ${c.toString()}]: ${l.toString()} }`), A("tuple", ["list"], ({ list: l }) => `[${l.map((c) => c.toString()).join(", ")}]`), A("object", ["dict"], ({ dict: l }) => Object.keys(l).length === 0 ? "{}" : `{ ${Object.entries(l).map(([c, h]) => `${c}${h.meta.required ? "" : "?"}: ${h.toString()}`).join(", ")} }`), A("union", ["list"], ({ list: l }, c) => {
|
|
1485
1485
|
const h = l.map(({ toString: d }) => d()).join(" | ");
|
|
1486
1486
|
return c ? `(${h})` : h;
|
|
1487
|
-
}),
|
|
1487
|
+
}), A("intersect", ["list"], ({ list: l }) => `${l.map((c) => c.toString(!0)).join(" & ")}`), A("transform", ["inner", "callback", "preserve"], ({ inner: l }, c) => l.toString(c)), e.exports = s;
|
|
1488
1488
|
}
|
|
1489
1489
|
});
|
|
1490
|
-
const $ =
|
|
1491
|
-
var
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
const $e =
|
|
1490
|
+
const $ = sr();
|
|
1491
|
+
var Lt = /* @__PURE__ */ ((i) => (i[i.debug = -1] = "debug", i[i.log = 0] = "log", i[i.info = 1] = "info", i[i.warn = 2] = "warn", i[i.error = 3] = "error", i[i.silent = 4] = "silent", i))(Lt || {});
|
|
1492
|
+
const Re = globalThis || window, je = /* @__PURE__ */ Symbol.for("__IPE_LOGGER_COLOR_MAP__");
|
|
1493
|
+
Re[je] || (Re[je] = /* @__PURE__ */ new Map());
|
|
1494
|
+
const $e = Re[je];
|
|
1495
1495
|
function ae(i) {
|
|
1496
1496
|
let e = 2166136261;
|
|
1497
1497
|
for (let t = 0; t < i.length; t++)
|
|
1498
1498
|
e ^= i.charCodeAt(t), e = (e >>> 0) * 16777619;
|
|
1499
1499
|
return e >>> 0;
|
|
1500
1500
|
}
|
|
1501
|
-
const
|
|
1501
|
+
const ut = [
|
|
1502
1502
|
[350, 360],
|
|
1503
1503
|
[0, 15],
|
|
1504
1504
|
[15, 30],
|
|
@@ -1510,8 +1510,8 @@ const ht = [
|
|
|
1510
1510
|
[140, 160],
|
|
1511
1511
|
[160, 180]
|
|
1512
1512
|
];
|
|
1513
|
-
function
|
|
1514
|
-
const t =
|
|
1513
|
+
function or(i, e) {
|
|
1514
|
+
const t = ut.length, r = ae(i) % t, [n, s] = ut[r], o = s - n, a = ae(i + ":" + e), f = n + a % (o || 1), u = ae(i + ":s"), p = ae(i + ":l");
|
|
1515
1515
|
let y, _;
|
|
1516
1516
|
if (e === "name")
|
|
1517
1517
|
y = 62 + u % 18, _ = 30 + p % 12;
|
|
@@ -1526,16 +1526,16 @@ function ce(i, e) {
|
|
|
1526
1526
|
return $e.set(i, e), e;
|
|
1527
1527
|
const t = $e.get(i);
|
|
1528
1528
|
if (t) return t;
|
|
1529
|
-
const r = i.startsWith("name:") ? "name" : "group", n =
|
|
1529
|
+
const r = i.startsWith("name:") ? "name" : "group", n = or(i, r);
|
|
1530
1530
|
return $e.set(i, n), n;
|
|
1531
1531
|
}
|
|
1532
|
-
class
|
|
1532
|
+
class Ke {
|
|
1533
1533
|
/**
|
|
1534
1534
|
* Note: constructor returns a callable Proxy so that you can do `logger('group')`.
|
|
1535
1535
|
*/
|
|
1536
1536
|
constructor(e = {}) {
|
|
1537
1537
|
this._custom = (t) => {
|
|
1538
|
-
if (!this._enabled(t.level)) return
|
|
1538
|
+
if (!this._enabled(t.level)) return ft;
|
|
1539
1539
|
const [r, n] = this._prefix(t.label);
|
|
1540
1540
|
return this._consoleMethod(t.method).bind(console, r, ...n);
|
|
1541
1541
|
}, this._name = e.name, this._nameColor = e.color, this._groupPath = e._groupPath ? [...e._groupPath] : [], this._dynamicLevels = { ...e._dynamicLevels }, this._levelRef = e._levelRef ?? {
|
|
@@ -1544,7 +1544,7 @@ class He {
|
|
|
1544
1544
|
}, this._name && ce(`name:${this._name}`, this._nameColor), this._installBuiltinLevels();
|
|
1545
1545
|
for (const t of Object.keys(this._dynamicLevels))
|
|
1546
1546
|
this._installLevelGetter(t, this._dynamicLevels[t]);
|
|
1547
|
-
return
|
|
1547
|
+
return cr(this);
|
|
1548
1548
|
}
|
|
1549
1549
|
// ---------- public API ----------
|
|
1550
1550
|
get level() {
|
|
@@ -1555,7 +1555,7 @@ class He {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
/** Create a sub-logger with a group label */
|
|
1557
1557
|
group(e, t) {
|
|
1558
|
-
return e && ce(`group:${e}`, t?.color), new
|
|
1558
|
+
return e && ce(`group:${e}`, t?.color), new Ke({
|
|
1559
1559
|
name: this._name,
|
|
1560
1560
|
color: this._nameColor,
|
|
1561
1561
|
_groupPath: [...this._groupPath, e],
|
|
@@ -1594,8 +1594,8 @@ class He {
|
|
|
1594
1594
|
});
|
|
1595
1595
|
}
|
|
1596
1596
|
_method(e) {
|
|
1597
|
-
const t =
|
|
1598
|
-
if (!this._enabled(t.level)) return
|
|
1597
|
+
const t = ar[e];
|
|
1598
|
+
if (!this._enabled(t.level)) return ft;
|
|
1599
1599
|
const [r, n] = this._prefix(t.label);
|
|
1600
1600
|
return this._consoleMethod(e).bind(console, r, ...n);
|
|
1601
1601
|
}
|
|
@@ -1612,25 +1612,25 @@ class He {
|
|
|
1612
1612
|
const n = ce(`name:${this._name}`, this._nameColor);
|
|
1613
1613
|
r += `%c${this._name}%c`, t.push(
|
|
1614
1614
|
`background:${n}; color:#fff; padding:1px 4px; border-radius:2px; font-weight:700;`,
|
|
1615
|
-
|
|
1615
|
+
dt
|
|
1616
1616
|
);
|
|
1617
1617
|
}
|
|
1618
1618
|
if (e && (r += ` ${e}`), this._groupPath.length) {
|
|
1619
1619
|
const n = this._groupPath.join("/"), s = ce(`group:${n}`);
|
|
1620
|
-
r += ` %c${n}%c`, t.push(`color:${s}; text-decoration: underline;`,
|
|
1620
|
+
r += ` %c${n}%c`, t.push(`color:${s}; text-decoration: underline;`, dt);
|
|
1621
1621
|
}
|
|
1622
1622
|
return [r, t];
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
|
-
const
|
|
1626
|
-
},
|
|
1625
|
+
const ft = () => {
|
|
1626
|
+
}, dt = "color:inherit; background:transparent; text-decoration:none;", ar = {
|
|
1627
1627
|
debug: { level: -1, label: "", method: "debug" },
|
|
1628
1628
|
log: { level: 0, label: "", method: "log" },
|
|
1629
1629
|
info: { level: 1, label: "[I]", method: "info" },
|
|
1630
1630
|
warn: { level: 2, label: "[W]", method: "warn" },
|
|
1631
1631
|
error: { level: 3, label: "[E]", method: "error" }
|
|
1632
1632
|
};
|
|
1633
|
-
function
|
|
1633
|
+
function cr(i) {
|
|
1634
1634
|
const e = function(t, r) {
|
|
1635
1635
|
return i.group(t, r);
|
|
1636
1636
|
};
|
|
@@ -1649,10 +1649,10 @@ function or(i) {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
});
|
|
1651
1651
|
}
|
|
1652
|
-
function
|
|
1653
|
-
return new
|
|
1652
|
+
function lr(i) {
|
|
1653
|
+
return new Ke(i);
|
|
1654
1654
|
}
|
|
1655
|
-
class
|
|
1655
|
+
class Te extends _i {
|
|
1656
1656
|
async clientLogin(e, t, r) {
|
|
1657
1657
|
r ||= {}, !r.logincontinue && !r.loginreturnurl && (r.loginreturnurl = location?.origin);
|
|
1658
1658
|
const n = await this.postWithToken(
|
|
@@ -1669,16 +1669,16 @@ class je extends bi {
|
|
|
1669
1669
|
);
|
|
1670
1670
|
if (n?.data?.clientlogin?.status === "PASS")
|
|
1671
1671
|
return n.data.clientlogin;
|
|
1672
|
-
throw new
|
|
1673
|
-
|
|
1672
|
+
throw new xi(
|
|
1673
|
+
ki.LOGIN_FAILED,
|
|
1674
1674
|
n.data.clientlogin.message,
|
|
1675
1675
|
n
|
|
1676
1676
|
);
|
|
1677
1677
|
}
|
|
1678
1678
|
}
|
|
1679
|
-
class
|
|
1679
|
+
class hr extends Te {
|
|
1680
1680
|
constructor(e, t, r) {
|
|
1681
|
-
const n =
|
|
1681
|
+
const n = Si(
|
|
1682
1682
|
e,
|
|
1683
1683
|
{
|
|
1684
1684
|
credentials: "include",
|
|
@@ -1693,10 +1693,10 @@ class cr extends je {
|
|
|
1693
1693
|
super(n);
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
|
-
class
|
|
1696
|
+
class ur {
|
|
1697
1697
|
constructor(e, t = {}) {
|
|
1698
1698
|
this.ctx = e, this.options = t, this._apiClients = /* @__PURE__ */ new Map(), location?.href && t?.baseURL?.toString()?.startsWith("/") && (t.baseURL = new URL(t.baseURL, location.origin));
|
|
1699
|
-
const r = this.api = new
|
|
1699
|
+
const r = this.api = new Te({
|
|
1700
1700
|
baseURL: t.baseURL.toString(),
|
|
1701
1701
|
fexiosConfigs: {
|
|
1702
1702
|
headers: {
|
|
@@ -1717,7 +1717,7 @@ class lr {
|
|
|
1717
1717
|
const n = t.origin === location.origin, s = {
|
|
1718
1718
|
baseURL: t.toString(),
|
|
1719
1719
|
throwOnApiError: !0
|
|
1720
|
-
}, o = n ? new
|
|
1720
|
+
}, o = n ? new Te(s) : new hr(s);
|
|
1721
1721
|
o.request.on("beforeRequest", (a) => {
|
|
1722
1722
|
a.headers = o.request.mergeHeaders(a.headers, {
|
|
1723
1723
|
"x-api-user-agent": null,
|
|
@@ -1728,21 +1728,21 @@ class lr {
|
|
|
1728
1728
|
return this._apiClients.get(r);
|
|
1729
1729
|
}
|
|
1730
1730
|
}
|
|
1731
|
-
const
|
|
1732
|
-
var
|
|
1731
|
+
const pt = (i, e = document) => e.querySelector(i), vs = (i, e = document) => e.querySelectorAll(i);
|
|
1732
|
+
var fr = Object.create, qe = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, Rt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), jt = (i) => {
|
|
1733
1733
|
throw TypeError(i);
|
|
1734
|
-
},
|
|
1734
|
+
}, pr = (i, e, t) => e in i ? qe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, gr = (i, e) => qe(i, "name", { value: e, configurable: !0 }), mr = (i) => [, , , fr(i?.[Rt("metadata")] ?? null)], yr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Tt = (i) => i !== void 0 && typeof i != "function" ? jt("Function expected") : i, wr = (i, e, t, r, n) => ({ kind: yr[i], name: e, metadata: r, addInitializer: (s) => t._ ? jt("Already initialized") : n.push(Tt(s || null)) }), br = (i, e) => pr(e, Rt("metadata"), i[3]), vr = (i, e, t, r) => {
|
|
1735
1735
|
for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
1736
1736
|
return r;
|
|
1737
|
-
},
|
|
1738
|
-
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
1739
|
-
|
|
1737
|
+
}, _r = (i, e, t, r, n, s) => {
|
|
1738
|
+
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && dr(n, t));
|
|
1739
|
+
gr(n, t);
|
|
1740
1740
|
for (var w = r.length - 1; w >= 0; w--)
|
|
1741
|
-
f =
|
|
1742
|
-
return
|
|
1743
|
-
},
|
|
1744
|
-
|
|
1745
|
-
let de = class Z extends (
|
|
1741
|
+
f = wr(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Tt(o) && (n = o);
|
|
1742
|
+
return br(i, n), g && qe(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
1743
|
+
}, Dt, We, Nt;
|
|
1744
|
+
Dt = [F(["wiki", "wikiTitle"])];
|
|
1745
|
+
let de = class Z extends (Nt = z) {
|
|
1746
1746
|
constructor(e) {
|
|
1747
1747
|
super(e, "currentPage", !1), this.ctx = e, this.#e = this.#r.bind(this), this.url = new URL(window.location.href), this.isMainPage = void 0, this.wikiTitle = void 0;
|
|
1748
1748
|
}
|
|
@@ -1791,33 +1791,34 @@ let de = class Z extends (Dt = z) {
|
|
|
1791
1791
|
return this.url.searchParams;
|
|
1792
1792
|
}
|
|
1793
1793
|
get canonicalUrl() {
|
|
1794
|
-
const e = (
|
|
1794
|
+
const e = (pt('link[rel="alternate"][hreflang="x-default"]') || pt('link[rel="canonical"]'))?.href;
|
|
1795
1795
|
let t = null;
|
|
1796
1796
|
return e && (t = new URL(e, location.origin)), Reflect.defineProperty(this, "canonicalUrl", {
|
|
1797
1797
|
get: () => t
|
|
1798
1798
|
}), t;
|
|
1799
1799
|
}
|
|
1800
1800
|
async #n() {
|
|
1801
|
-
|
|
1802
|
-
return Reflect.defineProperty(this, "isMainPage", {
|
|
1801
|
+
let t = this.wikiTitle?.getMainDBKey() === this.ctx.wiki.mainPageName;
|
|
1802
|
+
return t = this.ctx.bail("current-page/resolve-main-page", t) ?? t, Reflect.defineProperty(this, "isMainPage", {
|
|
1803
1803
|
get: () => t
|
|
1804
1804
|
}), t;
|
|
1805
1805
|
}
|
|
1806
1806
|
async #s() {
|
|
1807
1807
|
let e = null;
|
|
1808
|
-
return this.canonicalUrl ? e = await this.ctx.wikiTitle.newTitleFromUrl(this.canonicalUrl) : e = await this.ctx.wikiTitle.newTitleFromUrl(this.url), Object.freeze(e), Reflect.defineProperty(this, "wikiTitle", {
|
|
1808
|
+
return this.canonicalUrl ? e = await this.ctx.wikiTitle.newTitleFromUrl(this.canonicalUrl) : e = await this.ctx.wikiTitle.newTitleFromUrl(this.url), e = this.ctx.bail("current-page/resolve-title", e) ?? e, Object.freeze(e), Reflect.defineProperty(this, "wikiTitle", {
|
|
1809
1809
|
get: () => e
|
|
1810
1810
|
}), e;
|
|
1811
1811
|
}
|
|
1812
1812
|
get wikiAction() {
|
|
1813
|
-
|
|
1813
|
+
const e = this.params.get("action") || "view";
|
|
1814
|
+
return this.ctx.bail("current-page/resolve-action", e) ?? e;
|
|
1814
1815
|
}
|
|
1815
1816
|
};
|
|
1816
|
-
|
|
1817
|
-
de =
|
|
1818
|
-
|
|
1819
|
-
let
|
|
1820
|
-
class
|
|
1817
|
+
We = mr(Nt);
|
|
1818
|
+
de = _r(We, 0, "CurrentPageService", Dt, de);
|
|
1819
|
+
vr(We, 1, de);
|
|
1820
|
+
let xr = de;
|
|
1821
|
+
class kr extends z {
|
|
1821
1822
|
constructor(e) {
|
|
1822
1823
|
super(e, "resourceLoader", !0), this.ctx = e;
|
|
1823
1824
|
}
|
|
@@ -1867,16 +1868,16 @@ class _r extends z {
|
|
|
1867
1868
|
}
|
|
1868
1869
|
}
|
|
1869
1870
|
const xe = Object.keys;
|
|
1870
|
-
function
|
|
1871
|
+
function Sr(i) {
|
|
1871
1872
|
return typeof i == "boolean";
|
|
1872
1873
|
}
|
|
1873
|
-
function
|
|
1874
|
+
function $r(i) {
|
|
1874
1875
|
return i && typeof i.nodeType == "number";
|
|
1875
1876
|
}
|
|
1876
|
-
function
|
|
1877
|
+
function Ge(i) {
|
|
1877
1878
|
return typeof i == "string";
|
|
1878
1879
|
}
|
|
1879
|
-
function
|
|
1880
|
+
function Mt(i) {
|
|
1880
1881
|
return typeof i == "number";
|
|
1881
1882
|
}
|
|
1882
1883
|
function J(i) {
|
|
@@ -1885,10 +1886,10 @@ function J(i) {
|
|
|
1885
1886
|
function ne(i) {
|
|
1886
1887
|
return typeof i == "function";
|
|
1887
1888
|
}
|
|
1888
|
-
function
|
|
1889
|
+
function Er(i) {
|
|
1889
1890
|
return !!(i && i.isComponent);
|
|
1890
1891
|
}
|
|
1891
|
-
function
|
|
1892
|
+
function Ar(i) {
|
|
1892
1893
|
return J(i) && typeof i.length == "number" && typeof i.nodeType != "number";
|
|
1893
1894
|
}
|
|
1894
1895
|
function De(i, e) {
|
|
@@ -1896,10 +1897,10 @@ function De(i, e) {
|
|
|
1896
1897
|
for (const t of xe(i))
|
|
1897
1898
|
e(i[t], t);
|
|
1898
1899
|
}
|
|
1899
|
-
function
|
|
1900
|
+
function Cr(i) {
|
|
1900
1901
|
return J(i) && "current" in i;
|
|
1901
1902
|
}
|
|
1902
|
-
const
|
|
1903
|
+
const Ne = {
|
|
1903
1904
|
animationIterationCount: 0,
|
|
1904
1905
|
borderImageOutset: 0,
|
|
1905
1906
|
borderImageSlice: 0,
|
|
@@ -1944,30 +1945,30 @@ const Te = {
|
|
|
1944
1945
|
strokeOpacity: 0,
|
|
1945
1946
|
strokeWidth: 0
|
|
1946
1947
|
};
|
|
1947
|
-
function
|
|
1948
|
+
function Or(i, e) {
|
|
1948
1949
|
return i + e.charAt(0).toUpperCase() + e.substring(1);
|
|
1949
1950
|
}
|
|
1950
|
-
const
|
|
1951
|
-
xe(
|
|
1952
|
-
|
|
1953
|
-
|
|
1951
|
+
const Pr = ["Webkit", "ms", "Moz", "O"];
|
|
1952
|
+
xe(Ne).forEach((i) => {
|
|
1953
|
+
Pr.forEach((e) => {
|
|
1954
|
+
Ne[Or(e, i)] = 0;
|
|
1954
1955
|
});
|
|
1955
1956
|
});
|
|
1956
|
-
const
|
|
1957
|
-
var
|
|
1957
|
+
const Ir = /* @__PURE__ */ Symbol.for("jsx-dom:type");
|
|
1958
|
+
var Bt = /* @__PURE__ */ (function(i) {
|
|
1958
1959
|
return i.ShadowRoot = "ShadowRoot", i;
|
|
1959
|
-
})(
|
|
1960
|
-
function
|
|
1961
|
-
return i != null && i[
|
|
1960
|
+
})(Bt || {});
|
|
1961
|
+
function Lr(i) {
|
|
1962
|
+
return i != null && i[Ir] === Bt.ShadowRoot;
|
|
1962
1963
|
}
|
|
1963
|
-
const
|
|
1964
|
-
function
|
|
1965
|
-
return !
|
|
1964
|
+
const Rr = "http://www.w3.org/2000/svg", jr = "http://www.w3.org/1999/xlink", Tr = "http://www.w3.org/XML/1998/namespace";
|
|
1965
|
+
function Ut(i) {
|
|
1966
|
+
return !Sr(i) && i != null;
|
|
1966
1967
|
}
|
|
1967
|
-
function
|
|
1968
|
-
return Array.isArray(i) ? i.map(
|
|
1968
|
+
function Me(i) {
|
|
1969
|
+
return Array.isArray(i) ? i.map(Me).filter(Boolean).join(" ") : J(i) ? Symbol.iterator in i ? Me(Array.from(i)) : xe(i).filter((e) => i[e]).join(" ") : Ut(i) ? "" + i : "";
|
|
1969
1970
|
}
|
|
1970
|
-
const
|
|
1971
|
+
const Dr = {
|
|
1971
1972
|
animate: 0,
|
|
1972
1973
|
circle: 0,
|
|
1973
1974
|
clipPath: 0,
|
|
@@ -2022,28 +2023,28 @@ const jr = {
|
|
|
2022
2023
|
tspan: 0,
|
|
2023
2024
|
use: 0,
|
|
2024
2025
|
view: 0
|
|
2025
|
-
},
|
|
2026
|
-
function
|
|
2026
|
+
}, Nr = /^(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)/;
|
|
2027
|
+
function Mr(i) {
|
|
2027
2028
|
const e = document.createDocumentFragment();
|
|
2028
2029
|
return ke(i.children, e), e;
|
|
2029
2030
|
}
|
|
2030
|
-
function
|
|
2031
|
+
function Br(i, e, t) {
|
|
2031
2032
|
e = {
|
|
2032
2033
|
...e,
|
|
2033
2034
|
children: t
|
|
2034
2035
|
};
|
|
2035
2036
|
const r = new i(e), n = r.render();
|
|
2036
|
-
return "ref" in e &&
|
|
2037
|
+
return "ref" in e && Ve(e.ref, r), n;
|
|
2037
2038
|
}
|
|
2038
2039
|
function P(i, e) {
|
|
2039
2040
|
let { children: t, ...r } = e;
|
|
2040
|
-
!r.namespaceURI &&
|
|
2041
|
+
!r.namespaceURI && Dr[i] === 0 && (r = {
|
|
2041
2042
|
...r,
|
|
2042
|
-
namespaceURI:
|
|
2043
|
+
namespaceURI: Rr
|
|
2043
2044
|
});
|
|
2044
2045
|
let n;
|
|
2045
|
-
if (
|
|
2046
|
-
if (n = r.namespaceURI ? document.createElementNS(r.namespaceURI, i) : document.createElement(i),
|
|
2046
|
+
if (Ge(i)) {
|
|
2047
|
+
if (n = r.namespaceURI ? document.createElementNS(r.namespaceURI, i) : document.createElement(i), zr(r, n), ke(t, n), n instanceof window.HTMLSelectElement && r.value != null)
|
|
2047
2048
|
if (r.multiple === !0 && Array.isArray(r.value)) {
|
|
2048
2049
|
const s = r.value.map((o) => String(o));
|
|
2049
2050
|
n.querySelectorAll("option").forEach(
|
|
@@ -2051,12 +2052,12 @@ function P(i, e) {
|
|
|
2051
2052
|
);
|
|
2052
2053
|
} else
|
|
2053
2054
|
n.value = r.value;
|
|
2054
|
-
|
|
2055
|
+
Ve(r.ref, n);
|
|
2055
2056
|
} else if (ne(i))
|
|
2056
2057
|
J(i.defaultProps) && (r = {
|
|
2057
2058
|
...i.defaultProps,
|
|
2058
2059
|
...r
|
|
2059
|
-
}), n =
|
|
2060
|
+
}), n = Er(i) ? Br(i, r, t) : i({
|
|
2060
2061
|
...r,
|
|
2061
2062
|
children: t
|
|
2062
2063
|
});
|
|
@@ -2064,24 +2065,24 @@ function P(i, e) {
|
|
|
2064
2065
|
throw new TypeError(`Invalid JSX element type: ${i}`);
|
|
2065
2066
|
return n;
|
|
2066
2067
|
}
|
|
2067
|
-
function
|
|
2068
|
-
|
|
2068
|
+
function Ve(i, e) {
|
|
2069
|
+
Cr(i) ? i.current = e : ne(i) && i(e);
|
|
2069
2070
|
}
|
|
2070
2071
|
function ke(i, e) {
|
|
2071
|
-
if (
|
|
2072
|
-
|
|
2073
|
-
else if (
|
|
2072
|
+
if (Ar(i))
|
|
2073
|
+
Ur(i, e);
|
|
2074
|
+
else if (Ge(i) || Mt(i))
|
|
2074
2075
|
Ee(document.createTextNode(i), e);
|
|
2075
2076
|
else if (i === null)
|
|
2076
2077
|
Ee(document.createComment(""), e);
|
|
2077
|
-
else if (
|
|
2078
|
+
else if ($r(i))
|
|
2078
2079
|
Ee(i, e);
|
|
2079
|
-
else if (
|
|
2080
|
+
else if (Lr(i)) {
|
|
2080
2081
|
const t = e.attachShadow(i.attr);
|
|
2081
|
-
ke(i.children, t),
|
|
2082
|
+
ke(i.children, t), Ve(i.ref, t);
|
|
2082
2083
|
}
|
|
2083
2084
|
}
|
|
2084
|
-
function
|
|
2085
|
+
function Ur(i, e) {
|
|
2085
2086
|
for (const t of [...i])
|
|
2086
2087
|
ke(t, e);
|
|
2087
2088
|
return e;
|
|
@@ -2092,12 +2093,12 @@ function Ee(i, e) {
|
|
|
2092
2093
|
function le(i, e) {
|
|
2093
2094
|
return i.replace(/[A-Z]/g, (t) => e + t.toLowerCase());
|
|
2094
2095
|
}
|
|
2095
|
-
function
|
|
2096
|
-
e == null || e === !1 || (Array.isArray(e) ? e.forEach((t) =>
|
|
2097
|
-
r.indexOf("-") === 0 ? i.style.setProperty(r, t) :
|
|
2096
|
+
function Ft(i, e) {
|
|
2097
|
+
e == null || e === !1 || (Array.isArray(e) ? e.forEach((t) => Ft(i, t)) : Ge(e) ? i.setAttribute("style", e) : J(e) && De(e, (t, r) => {
|
|
2098
|
+
r.indexOf("-") === 0 ? i.style.setProperty(r, t) : Mt(t) && Ne[r] !== 0 ? i.style[r] = t + "px" : i.style[r] = t;
|
|
2098
2099
|
}));
|
|
2099
2100
|
}
|
|
2100
|
-
function
|
|
2101
|
+
function Fr(i, e, t) {
|
|
2101
2102
|
switch (i) {
|
|
2102
2103
|
case "xlinkActuate":
|
|
2103
2104
|
case "xlinkArcrole":
|
|
@@ -2106,20 +2107,20 @@ function Br(i, e, t) {
|
|
|
2106
2107
|
case "xlinkShow":
|
|
2107
2108
|
case "xlinkTitle":
|
|
2108
2109
|
case "xlinkType":
|
|
2109
|
-
|
|
2110
|
+
gt(t, jr, le(i, ":"), e);
|
|
2110
2111
|
return;
|
|
2111
2112
|
case "xmlnsXlink":
|
|
2112
|
-
|
|
2113
|
+
Q(t, le(i, ":"), e);
|
|
2113
2114
|
return;
|
|
2114
2115
|
case "xmlBase":
|
|
2115
2116
|
case "xmlLang":
|
|
2116
2117
|
case "xmlSpace":
|
|
2117
|
-
|
|
2118
|
+
gt(t, Tr, le(i, ":"), e);
|
|
2118
2119
|
return;
|
|
2119
2120
|
}
|
|
2120
2121
|
switch (i) {
|
|
2121
2122
|
case "htmlFor":
|
|
2122
|
-
|
|
2123
|
+
Q(t, "for", e);
|
|
2123
2124
|
return;
|
|
2124
2125
|
case "dataset":
|
|
2125
2126
|
De(e, (r, n) => {
|
|
@@ -2129,7 +2130,7 @@ function Br(i, e, t) {
|
|
|
2129
2130
|
case "innerHTML":
|
|
2130
2131
|
case "innerText":
|
|
2131
2132
|
case "textContent":
|
|
2132
|
-
|
|
2133
|
+
Ut(e) && (t[i] = e);
|
|
2133
2134
|
return;
|
|
2134
2135
|
case "dangerouslySetInnerHTML":
|
|
2135
2136
|
J(e) && (t.innerHTML = e.__html);
|
|
@@ -2147,13 +2148,13 @@ function Br(i, e, t) {
|
|
|
2147
2148
|
return;
|
|
2148
2149
|
case "class":
|
|
2149
2150
|
case "className":
|
|
2150
|
-
ne(e) ? e(t) :
|
|
2151
|
+
ne(e) ? e(t) : Q(t, "class", Me(e));
|
|
2151
2152
|
return;
|
|
2152
2153
|
case "ref":
|
|
2153
2154
|
case "namespaceURI":
|
|
2154
2155
|
return;
|
|
2155
2156
|
case "style":
|
|
2156
|
-
|
|
2157
|
+
Ft(t, e);
|
|
2157
2158
|
return;
|
|
2158
2159
|
case "on":
|
|
2159
2160
|
case "onCapture":
|
|
@@ -2179,22 +2180,22 @@ function Br(i, e, t) {
|
|
|
2179
2180
|
r in window ? s = r.substring(2) : s = r[2] + i.slice(3), t.addEventListener(s, e);
|
|
2180
2181
|
}
|
|
2181
2182
|
}
|
|
2182
|
-
} else J(e) ? t[i] = e : e === !0 ?
|
|
2183
|
+
} else J(e) ? t[i] = e : e === !0 ? Q(t, i, "") : e !== !1 && e != null && (t instanceof SVGElement && !Nr.test(i) ? Q(t, le(i, "-"), e) : Q(t, i, e));
|
|
2183
2184
|
}
|
|
2184
|
-
function
|
|
2185
|
+
function Q(i, e, t) {
|
|
2185
2186
|
i.setAttribute(e, t);
|
|
2186
2187
|
}
|
|
2187
|
-
function
|
|
2188
|
+
function gt(i, e, t, r) {
|
|
2188
2189
|
i.setAttributeNS(e, t, r);
|
|
2189
2190
|
}
|
|
2190
|
-
function
|
|
2191
|
+
function zr(i, e) {
|
|
2191
2192
|
for (const t of xe(i))
|
|
2192
|
-
|
|
2193
|
+
Fr(t, i[t], e);
|
|
2193
2194
|
return e;
|
|
2194
2195
|
}
|
|
2195
|
-
var
|
|
2196
|
-
let
|
|
2197
|
-
const
|
|
2196
|
+
var Ye = /* @__PURE__ */ ((i) => (i.Init = "modal.init", i.BeforeShow = "modal.beforeShow", i.Show = "modal.show", i.BeforeClose = "modal.beforeClose", i.Close = "modal.close", i.Destroy = "modal.destroy", i.ToastShow = "toast.show", i.ToastClose = "toast.close", i))(Ye || {});
|
|
2197
|
+
let Hr = 0;
|
|
2198
|
+
const mt = (i) => `${i}-${++Hr}`;
|
|
2198
2199
|
function ee(i) {
|
|
2199
2200
|
return i instanceof Node ? i : document.createTextNode(String(i));
|
|
2200
2201
|
}
|
|
@@ -2202,7 +2203,7 @@ function H(i, e) {
|
|
|
2202
2203
|
if (!i) throw new Error(`${e ?? "Element"} not found`);
|
|
2203
2204
|
return i;
|
|
2204
2205
|
}
|
|
2205
|
-
function
|
|
2206
|
+
function yt(i) {
|
|
2206
2207
|
const e = [
|
|
2207
2208
|
"a[href]",
|
|
2208
2209
|
"button:not([disabled])",
|
|
@@ -2215,14 +2216,14 @@ function mt(i) {
|
|
|
2215
2216
|
(t) => !!(t.offsetWidth || t.offsetHeight || t.getClientRects().length)
|
|
2216
2217
|
);
|
|
2217
2218
|
}
|
|
2218
|
-
function
|
|
2219
|
+
function T(i, e = {}) {
|
|
2219
2220
|
const t = document.createElement(i);
|
|
2220
2221
|
if (e.className && (t.className = e.className), e.html != null && (t.innerHTML = e.html), e.text != null && (t.textContent = e.text), e.attrs)
|
|
2221
2222
|
for (const [r, n] of Object.entries(e.attrs)) t.setAttribute(r, n);
|
|
2222
2223
|
return t;
|
|
2223
2224
|
}
|
|
2224
|
-
const
|
|
2225
|
-
function
|
|
2225
|
+
const Kr = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), zt = ["ctrl", "alt", "shift", "meta"];
|
|
2226
|
+
function qr(i) {
|
|
2226
2227
|
if (!i) return null;
|
|
2227
2228
|
const e = String(i).trim().toLowerCase().split(/[+\-\s]+/g).filter(Boolean), t = [];
|
|
2228
2229
|
let r = null;
|
|
@@ -2248,23 +2249,23 @@ function Hr(i) {
|
|
|
2248
2249
|
continue;
|
|
2249
2250
|
}
|
|
2250
2251
|
if (a === "mod") {
|
|
2251
|
-
n(
|
|
2252
|
+
n(Kr ? "meta" : "ctrl");
|
|
2252
2253
|
continue;
|
|
2253
2254
|
}
|
|
2254
2255
|
a === "esc" && (a = "escape"), a === "return" && (a = "enter"), (a === "space" || a === "spacebar") && (a = "space"), r = a;
|
|
2255
2256
|
}
|
|
2256
|
-
const s =
|
|
2257
|
+
const s = zt.filter((o) => t.includes(o));
|
|
2257
2258
|
return !r || r === "" ? s.length ? s.join("+") : null : s.length ? `${s.join("+")}+${r}` : r;
|
|
2258
2259
|
}
|
|
2259
|
-
function
|
|
2260
|
+
function Wr(i) {
|
|
2260
2261
|
const e = [];
|
|
2261
2262
|
i.ctrlKey && e.push("ctrl"), i.altKey && e.push("alt"), i.shiftKey && e.push("shift"), i.metaKey && e.push("meta");
|
|
2262
2263
|
let t = i.key;
|
|
2263
2264
|
t === " " && (t = "space");
|
|
2264
|
-
const r = (t.length, t.toLowerCase()), n =
|
|
2265
|
+
const r = (t.length, t.toLowerCase()), n = zt.filter((s) => e.includes(s));
|
|
2265
2266
|
return n.length ? `${n.join("+")}+${r}` : r;
|
|
2266
2267
|
}
|
|
2267
|
-
class
|
|
2268
|
+
class Gr {
|
|
2268
2269
|
constructor() {
|
|
2269
2270
|
this.zBase = 1e3, this.stack = [];
|
|
2270
2271
|
}
|
|
@@ -2297,10 +2298,10 @@ class qr {
|
|
|
2297
2298
|
document.body.classList.remove("ipe-modal-no-scroll");
|
|
2298
2299
|
}
|
|
2299
2300
|
}
|
|
2300
|
-
const
|
|
2301
|
+
const D = new Gr();
|
|
2301
2302
|
class pe {
|
|
2302
2303
|
constructor(e = {}) {
|
|
2303
|
-
this.backdropId =
|
|
2304
|
+
this.backdropId = mt("ipe-modal-backdrop"), this.modalId = mt("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 = Ye, this._hooks = [], this.startCloseTimer = (t) => {
|
|
2304
2305
|
this.stopCloseTimer(), this.closeTimer = window.setTimeout(() => this.close(), t);
|
|
2305
2306
|
}, this.stopCloseTimer = () => {
|
|
2306
2307
|
this.closeTimer && window.clearTimeout(this.closeTimer), this.closeTimer = void 0;
|
|
@@ -2350,11 +2351,11 @@ class pe {
|
|
|
2350
2351
|
if (this.$modal) return this;
|
|
2351
2352
|
const e = this.options.backdrop !== !1;
|
|
2352
2353
|
let t;
|
|
2353
|
-
e && (t =
|
|
2354
|
+
e && (t = T("div", {
|
|
2354
2355
|
className: "ipe-modal-backdrop",
|
|
2355
2356
|
attrs: { id: this.backdropId, "data-modal-id": this.modalId }
|
|
2356
2357
|
}));
|
|
2357
|
-
const r =
|
|
2358
|
+
const r = T("div", {
|
|
2358
2359
|
className: "ipe-modal-modal",
|
|
2359
2360
|
attrs: { id: this.modalId, role: "dialog", "aria-modal": "true", tabindex: "-1" }
|
|
2360
2361
|
});
|
|
@@ -2365,18 +2366,18 @@ class pe {
|
|
|
2365
2366
|
r.style.left = `${w + O / 2 - r.offsetWidth / 2}px`;
|
|
2366
2367
|
});
|
|
2367
2368
|
}
|
|
2368
|
-
const n =
|
|
2369
|
+
const n = T("div", {
|
|
2369
2370
|
className: `ipe-modal-modal__window size--${this.options.sizeClass || "auto"} plugin--${this.pluginName}`
|
|
2370
2371
|
});
|
|
2371
2372
|
n.modal = this;
|
|
2372
|
-
const s =
|
|
2373
|
+
const s = T("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, a = T("h2", {
|
|
2373
2374
|
className: "ipe-modal-modal__title",
|
|
2374
2375
|
attrs: { id: o, role: "heading", "aria-level": "2" }
|
|
2375
2376
|
});
|
|
2376
2377
|
r.setAttribute("aria-labelledby", o);
|
|
2377
|
-
const f =
|
|
2378
|
+
const f = T("div", { className: "ipe-modal-modal__icons" });
|
|
2378
2379
|
if (this.options.closeIcon) {
|
|
2379
|
-
const g =
|
|
2380
|
+
const g = T("button", {
|
|
2380
2381
|
className: "ipe-modal-modal__close",
|
|
2381
2382
|
attrs: { type: "button", "aria-label": "Close" },
|
|
2382
2383
|
html: "×"
|
|
@@ -2387,9 +2388,9 @@ class pe {
|
|
|
2387
2388
|
}), f.appendChild(g);
|
|
2388
2389
|
}
|
|
2389
2390
|
s.append(a, f), this.options.draggable && e && (this.options.draggable = !1), this.options.draggable && (s.style.cursor = "move", s.style.userSelect = "none", s.addEventListener("pointerdown", this.onDragStart.bind(this)), r.classList.add("is-draggable"));
|
|
2390
|
-
const u =
|
|
2391
|
+
const u = T("div", { className: "ipe-modal-modal__content" }), p = T("div", { className: "ipe-modal-modal__footer" }), y = T("div", {
|
|
2391
2392
|
className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--left"
|
|
2392
|
-
}), _ =
|
|
2393
|
+
}), _ = T("div", {
|
|
2393
2394
|
className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--right"
|
|
2394
2395
|
});
|
|
2395
2396
|
return p.append(y, _), n.append(s, u, p), r.appendChild(n), this.$backdrop = t, this.$modal = r, this.$window = n, this.$header = s, this.$title = a, this.$icons = f, this.$content = u, this.$footer = p, this.$buttonsLeft = y, this.$buttonsRight = _, 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("pointerup", (g) => {
|
|
@@ -2408,9 +2409,9 @@ class pe {
|
|
|
2408
2409
|
const r = this.emit("modal.beforeShow", !0), n = this.options.beforeShow ? this.options.beforeShow(this) !== !1 : !0;
|
|
2409
2410
|
if (!r || !n) return this;
|
|
2410
2411
|
}
|
|
2411
|
-
this.lastFocused = document.activeElement ?? null, this.$backdrop && document.body.appendChild(this.$backdrop), document.body.appendChild(this.$modal), this.shouldLockBodyOnOpen() &&
|
|
2412
|
+
this.lastFocused = document.activeElement ?? null, this.$backdrop && document.body.appendChild(this.$backdrop), document.body.appendChild(this.$modal), this.shouldLockBodyOnOpen() && D.lockBodyScroll(), requestAnimationFrame(() => {
|
|
2412
2413
|
this.$backdrop?.classList.add("is-open"), this.$modal.classList.add("is-open"), this.applyAnimation(!0), this.focusFirst();
|
|
2413
|
-
}), document.addEventListener("keydown", this.onKeyDown),
|
|
2414
|
+
}), document.addEventListener("keydown", this.onKeyDown), D.push(this), this.isOpen = !0, this.options.onShow?.(this), this.emit(
|
|
2414
2415
|
"modal.show"
|
|
2415
2416
|
/* Show */
|
|
2416
2417
|
);
|
|
@@ -2467,7 +2468,7 @@ class pe {
|
|
|
2467
2468
|
const e = V.indexOf(this);
|
|
2468
2469
|
e !== -1 && V.splice(e, 1);
|
|
2469
2470
|
} else
|
|
2470
|
-
this.$backdrop?.parentElement && this.$backdrop.parentElement.removeChild(this.$backdrop), this.$modal?.parentElement && this.$modal.parentElement.removeChild(this.$modal),
|
|
2471
|
+
this.$backdrop?.parentElement && this.$backdrop.parentElement.removeChild(this.$backdrop), this.$modal?.parentElement && this.$modal.parentElement.removeChild(this.$modal), D.remove(this), this.shouldUnlockBodyOnClose() && D.unlockBodyScroll();
|
|
2471
2472
|
return this.isOpen = !1, this.lastFocused?.focus?.(), this.emit(
|
|
2472
2473
|
"modal.destroy"
|
|
2473
2474
|
/* Destroy */
|
|
@@ -2511,7 +2512,7 @@ class pe {
|
|
|
2511
2512
|
const t = this.get$icons();
|
|
2512
2513
|
t.innerHTML = "";
|
|
2513
2514
|
for (const r of e) {
|
|
2514
|
-
const n =
|
|
2515
|
+
const n = T("button", {
|
|
2515
2516
|
className: `ipe-modal-modal__icon ${r.className}`,
|
|
2516
2517
|
attrs: { type: "button" }
|
|
2517
2518
|
});
|
|
@@ -2535,7 +2536,7 @@ class pe {
|
|
|
2535
2536
|
return this;
|
|
2536
2537
|
}
|
|
2537
2538
|
generateButton(e) {
|
|
2538
|
-
const t = e.type ?? "button", r = t === "link" ?
|
|
2539
|
+
const t = e.type ?? "button", r = t === "link" ? T("a") : T("button", { attrs: { type: "button" } });
|
|
2539
2540
|
e.id && (r.id = e.id), r.className = `ipe-modal-btn ${e.className ?? ""}`.trim();
|
|
2540
2541
|
const n = ee(e.label ?? "OK");
|
|
2541
2542
|
if (r.append(n), t === "link" && e.href && (r.href = e.href), e.method && r.addEventListener("click", (s) => {
|
|
@@ -2556,7 +2557,7 @@ class pe {
|
|
|
2556
2557
|
if (e.keyPress) {
|
|
2557
2558
|
const s = String(e.keyPress).split(/[\,\|]+/g).map((o) => o.trim()).filter(Boolean);
|
|
2558
2559
|
for (const o of s) {
|
|
2559
|
-
const a =
|
|
2560
|
+
const a = qr(o);
|
|
2560
2561
|
a && this.keyMap.set(a, r);
|
|
2561
2562
|
}
|
|
2562
2563
|
}
|
|
@@ -2625,11 +2626,11 @@ class pe {
|
|
|
2625
2626
|
return (!s.dispatchEvent(o) || o.defaultPrevented) && (n = !1), n;
|
|
2626
2627
|
}
|
|
2627
2628
|
focusFirst() {
|
|
2628
|
-
const e = this.get$modal(), t =
|
|
2629
|
+
const e = this.get$modal(), t = yt(e);
|
|
2629
2630
|
t.length ? t[0].focus() : e.focus({ preventScroll: !0 });
|
|
2630
2631
|
}
|
|
2631
2632
|
onKeyDown(e) {
|
|
2632
|
-
if (
|
|
2633
|
+
if (D.top() !== this) return;
|
|
2633
2634
|
if (e.key === "Escape") {
|
|
2634
2635
|
e.preventDefault(), this.close();
|
|
2635
2636
|
return;
|
|
@@ -2637,7 +2638,7 @@ class pe {
|
|
|
2637
2638
|
const t = this.get$modal();
|
|
2638
2639
|
if (!t.contains(document.activeElement)) return;
|
|
2639
2640
|
if (e.key === "Tab") {
|
|
2640
|
-
const a =
|
|
2641
|
+
const a = yt(t);
|
|
2641
2642
|
if (!a.length) return;
|
|
2642
2643
|
const f = a[0], u = a[a.length - 1], p = document.activeElement;
|
|
2643
2644
|
e.shiftKey && p === f ? (e.preventDefault(), u.focus()) : !e.shiftKey && p === u && (e.preventDefault(), f.focus());
|
|
@@ -2645,7 +2646,7 @@ class pe {
|
|
|
2645
2646
|
const r = e.ctrlKey || e.altKey || e.metaKey, n = e.target;
|
|
2646
2647
|
if (!r && (n && ["INPUT", "TEXTAREA"].includes(n.tagName) || n.contentEditable === "true"))
|
|
2647
2648
|
return;
|
|
2648
|
-
const s =
|
|
2649
|
+
const s = Wr(e), o = this.keyMap.get(s);
|
|
2649
2650
|
if (o) {
|
|
2650
2651
|
e.preventDefault(), o.click();
|
|
2651
2652
|
return;
|
|
@@ -2656,19 +2657,19 @@ class pe {
|
|
|
2656
2657
|
}
|
|
2657
2658
|
/** Bring this modal to the top of the stack. */
|
|
2658
2659
|
bringToFront() {
|
|
2659
|
-
return
|
|
2660
|
+
return D.remove(this), D.push(this), this;
|
|
2660
2661
|
}
|
|
2661
2662
|
isAnimationDisabled() {
|
|
2662
2663
|
const e = this.options.modalAnimation ?? this.options.animation;
|
|
2663
2664
|
return e === !1 || e == null;
|
|
2664
2665
|
}
|
|
2665
2666
|
shouldLockBodyOnOpen() {
|
|
2666
|
-
return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !
|
|
2667
|
+
return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !D.stack.some(
|
|
2667
2668
|
(e) => e !== this && e.options.backdrop !== !1 && e.options.bodyScroll === !1
|
|
2668
2669
|
);
|
|
2669
2670
|
}
|
|
2670
2671
|
shouldUnlockBodyOnClose() {
|
|
2671
|
-
return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !
|
|
2672
|
+
return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !D.stack.some(
|
|
2672
2673
|
(e) => e !== this && e.options.backdrop !== !1 && e.options.bodyScroll === !1
|
|
2673
2674
|
);
|
|
2674
2675
|
}
|
|
@@ -2683,7 +2684,7 @@ class pe {
|
|
|
2683
2684
|
/** Show as toast (no backdrop, container stack). */
|
|
2684
2685
|
showToast(e) {
|
|
2685
2686
|
this.$window || this.init();
|
|
2686
|
-
const t =
|
|
2687
|
+
const t = Vr(e.position ?? "top right"), r = this.get$window();
|
|
2687
2688
|
this.isToast = !0, r.style.pointerEvents = "auto", this.applyAnimation(!0), t.appendChild(r);
|
|
2688
2689
|
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;
|
|
2689
2690
|
return n > 0 && (this.startCloseTimer(n), s && (r.addEventListener("mouseenter", this.stopCloseTimer), r.addEventListener("mouseleave", () => this.startCloseTimer(n)))), this.isOpen = !0, this.options.onShow?.(this), V.push(this), this.emit(
|
|
@@ -2703,10 +2704,10 @@ class pe {
|
|
|
2703
2704
|
}
|
|
2704
2705
|
static close(e) {
|
|
2705
2706
|
if (!e) {
|
|
2706
|
-
const s =
|
|
2707
|
+
const s = D.top();
|
|
2707
2708
|
return s?.close(), s;
|
|
2708
2709
|
}
|
|
2709
|
-
const t = typeof e == "string" ? e : e.id, r =
|
|
2710
|
+
const t = typeof e == "string" ? e : e.id, r = D.stack.find((s) => s.modalId === t);
|
|
2710
2711
|
if (r)
|
|
2711
2712
|
return r.close(), r;
|
|
2712
2713
|
const n = V.find((s) => s.modalId === t);
|
|
@@ -2714,13 +2715,13 @@ class pe {
|
|
|
2714
2715
|
}
|
|
2715
2716
|
static closeAll(e, t) {
|
|
2716
2717
|
const r = new Set((Array.isArray(t) ? t : t ? [t] : []).map(String)), n = new Set((Array.isArray(e) ? e : e ? [e] : []).map(String));
|
|
2717
|
-
return
|
|
2718
|
+
return D.closeAll(e, t), [...V].forEach((s) => {
|
|
2718
2719
|
const o = s.modalId, a = n.size ? n.has(s.pluginName) : !0, f = r.has(o);
|
|
2719
2720
|
a && !f && s.close();
|
|
2720
|
-
}),
|
|
2721
|
+
}), D.top() ?? new pe();
|
|
2721
2722
|
}
|
|
2722
2723
|
static removeAll() {
|
|
2723
|
-
|
|
2724
|
+
D.removeAll(), [...V].forEach((e) => e.destroy());
|
|
2724
2725
|
}
|
|
2725
2726
|
static dialog(e, t) {
|
|
2726
2727
|
const r = new this({
|
|
@@ -2880,7 +2881,7 @@ class pe {
|
|
|
2880
2881
|
t.title = a[0].toUpperCase() + a.slice(1).toLowerCase();
|
|
2881
2882
|
}
|
|
2882
2883
|
const n = t.icon ?? this.getDefaultNotifyIcon(e);
|
|
2883
|
-
n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ P(
|
|
2884
|
+
n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ P(Mr, { children: [
|
|
2884
2885
|
n,
|
|
2885
2886
|
t.title
|
|
2886
2887
|
] })), 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, f) => {
|
|
@@ -2907,10 +2908,10 @@ class pe {
|
|
|
2907
2908
|
}
|
|
2908
2909
|
}
|
|
2909
2910
|
const V = [];
|
|
2910
|
-
function
|
|
2911
|
+
function Vr(i = "top right") {
|
|
2911
2912
|
const e = "ipe-modal-toast-container", t = `${e}-${i.replace(/[\s-\.|\/]+/g, "-")}`;
|
|
2912
2913
|
let r = document.getElementById(t);
|
|
2913
|
-
return r || (r =
|
|
2914
|
+
return r || (r = T("div", {
|
|
2914
2915
|
className: `${e} ${i}`,
|
|
2915
2916
|
attrs: { id: t, "data-position": i }
|
|
2916
2917
|
}), document.body.appendChild(r)), r;
|
|
@@ -2946,7 +2947,7 @@ class R extends pe {
|
|
|
2946
2947
|
backgroundColor: "rgba(255, 255, 255, 0.5)",
|
|
2947
2948
|
zIndex: 2e3
|
|
2948
2949
|
},
|
|
2949
|
-
children: /* @__PURE__ */ N(
|
|
2950
|
+
children: /* @__PURE__ */ N(Oi, { style: { width: "80%", maxWidth: "800px" } })
|
|
2950
2951
|
}
|
|
2951
2952
|
)
|
|
2952
2953
|
);
|
|
@@ -2959,14 +2960,14 @@ class R extends pe {
|
|
|
2959
2960
|
}
|
|
2960
2961
|
}
|
|
2961
2962
|
}
|
|
2962
|
-
class
|
|
2963
|
+
class Yr {
|
|
2963
2964
|
constructor(e) {
|
|
2964
|
-
this.ctx = e, this.IPEModal = R, this.IPEModalEvent =
|
|
2965
|
+
this.ctx = e, this.IPEModal = R, this.IPEModalEvent = Ye, this.show = R.show.bind(R), this.createObject = R.createObject.bind(R), this.close = R.close.bind(R), this.closeAll = R.closeAll.bind(R), this.removeAll = R.removeAll.bind(R), this.dialog = R.dialog.bind(R), this.confirm = R.confirm.bind(R), this.notify = R.notify.bind(R), e.set("modal", this), e.on("dispose", () => {
|
|
2965
2966
|
R.closeAll();
|
|
2966
2967
|
});
|
|
2967
2968
|
}
|
|
2968
2969
|
}
|
|
2969
|
-
const
|
|
2970
|
+
const Ht = (i) => {
|
|
2970
2971
|
if (!i)
|
|
2971
2972
|
return new URLSearchParams();
|
|
2972
2973
|
if (i instanceof URLSearchParams)
|
|
@@ -2989,26 +2990,26 @@ const Ft = (i) => {
|
|
|
2989
2990
|
e.set(t, r?.toString());
|
|
2990
2991
|
}
|
|
2991
2992
|
return e;
|
|
2992
|
-
},
|
|
2993
|
-
const r = typeof i == "string" ? new URL(i, window?.location?.origin) : new URL(i), n = new URLSearchParams(r.search), s =
|
|
2993
|
+
}, Kt = (i, e, t) => {
|
|
2994
|
+
const r = typeof i == "string" ? new URL(i, window?.location?.origin) : new URL(i), n = new URLSearchParams(r.search), s = Ht(e);
|
|
2994
2995
|
for (const [o, a] of s.entries())
|
|
2995
2996
|
n.set(o, a);
|
|
2996
2997
|
return r.search = n.toString(), r.hash = "", r;
|
|
2997
2998
|
};
|
|
2998
|
-
var
|
|
2999
|
+
var Jr = Object.create, Je = Object.defineProperty, Qr = Object.getOwnPropertyDescriptor, qt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Wt = (i) => {
|
|
2999
3000
|
throw TypeError(i);
|
|
3000
|
-
},
|
|
3001
|
+
}, Xr = (i, e, t) => e in i ? Je(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Zr = (i, e) => Je(i, "name", { value: e, configurable: !0 }), en = (i) => [, , , Jr(i?.[qt("metadata")] ?? null)], tn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Gt = (i) => i !== void 0 && typeof i != "function" ? Wt("Function expected") : i, rn = (i, e, t, r, n) => ({ kind: tn[i], name: e, metadata: r, addInitializer: (s) => t._ ? Wt("Already initialized") : n.push(Gt(s || null)) }), nn = (i, e) => Xr(e, qt("metadata"), i[3]), sn = (i, e, t, r) => {
|
|
3001
3002
|
for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
3002
3003
|
return r;
|
|
3003
|
-
},
|
|
3004
|
-
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
3005
|
-
|
|
3004
|
+
}, on = (i, e, t, r, n, s) => {
|
|
3005
|
+
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && Qr(n, t));
|
|
3006
|
+
Zr(n, t);
|
|
3006
3007
|
for (var w = r.length - 1; w >= 0; w--)
|
|
3007
|
-
f =
|
|
3008
|
-
return
|
|
3009
|
-
},
|
|
3010
|
-
|
|
3011
|
-
class ge extends (
|
|
3008
|
+
f = rn(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Gt(o) && (n = o);
|
|
3009
|
+
return nn(i, n), g && Je(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
3010
|
+
}, Vt, Qe, Yt;
|
|
3011
|
+
Vt = [F(["api", "storage"])];
|
|
3012
|
+
class ge extends (Yt = z) {
|
|
3012
3013
|
constructor(e) {
|
|
3013
3014
|
super(e, "wiki", !1), this.ctx = e, this._data = {}, this.CACHE_VERSION = 4, this.CACHE_TTL = {
|
|
3014
3015
|
siteinfo: 1e3 * 60 * 60 * 24 * 3,
|
|
@@ -3253,10 +3254,10 @@ class ge extends (Gt = z) {
|
|
|
3253
3254
|
}
|
|
3254
3255
|
/** Get mainpage URL */
|
|
3255
3256
|
getMainpageUrl(e) {
|
|
3256
|
-
return
|
|
3257
|
+
return Kt(this.siteInfo.general.base, e).toString();
|
|
3257
3258
|
}
|
|
3258
3259
|
getUrl(e, t) {
|
|
3259
|
-
const r =
|
|
3260
|
+
const r = Ht(t);
|
|
3260
3261
|
let n;
|
|
3261
3262
|
return typeof e == "string" && e !== "" ? n = new URL(`${this.articleBaseUrl.replace("$1", e)}`) : typeof e == "number" ? (r.set("curid", e.toString()), n = new URL(this.getSciprtUrl("index"))) : n = new URL(this.getSciprtUrl("index")), n.search = r.toString(), n.toString();
|
|
3262
3263
|
}
|
|
@@ -3286,16 +3287,16 @@ class ge extends (Gt = z) {
|
|
|
3286
3287
|
} : null;
|
|
3287
3288
|
}
|
|
3288
3289
|
}
|
|
3289
|
-
|
|
3290
|
-
ge =
|
|
3291
|
-
|
|
3292
|
-
const
|
|
3290
|
+
Qe = en(Yt);
|
|
3291
|
+
ge = on(Qe, 0, "WikiMetadataService", Vt, ge);
|
|
3292
|
+
sn(Qe, 1, ge);
|
|
3293
|
+
const an = (() => {
|
|
3293
3294
|
const i = /* @__PURE__ */ Symbol.for("IPE.GlobalMemoryStorage");
|
|
3294
|
-
return i in globalThis || (globalThis[i] =
|
|
3295
|
+
return i in globalThis || (globalThis[i] = $i()), globalThis[i];
|
|
3295
3296
|
})();
|
|
3296
|
-
class
|
|
3297
|
+
class cn {
|
|
3297
3298
|
constructor(e, t, r = 1 / 0, n, s = "localStorage") {
|
|
3298
|
-
this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.engine = s, typeof r != "number" && (this.ttl = Number(r)), (isNaN(this.ttl) || this.ttl <= 0) && (this.ttl = 1 / 0), this.engine === "localStorage" && "localStorage" in window ? this.db = window.localStorage : this.engine === "sessionStorage" && "sessionStorage" in window ? this.db = window.sessionStorage : this.db =
|
|
3299
|
+
this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.engine = s, typeof r != "number" && (this.ttl = Number(r)), (isNaN(this.ttl) || this.ttl <= 0) && (this.ttl = 1 / 0), this.engine === "localStorage" && "localStorage" in window ? this.db = window.localStorage : this.engine === "sessionStorage" && "sessionStorage" in window ? this.db = window.sessionStorage : this.db = an;
|
|
3299
3300
|
}
|
|
3300
3301
|
// Key builder
|
|
3301
3302
|
makeKey(e) {
|
|
@@ -3445,8 +3446,8 @@ var L;
|
|
|
3445
3446
|
const w = indexedDB.open(u, p);
|
|
3446
3447
|
w.onupgradeneeded = () => {
|
|
3447
3448
|
try {
|
|
3448
|
-
const O = w.result,
|
|
3449
|
-
y?.(O,
|
|
3449
|
+
const O = w.result, A = w.transaction;
|
|
3450
|
+
y?.(O, A);
|
|
3450
3451
|
} catch (O) {
|
|
3451
3452
|
g(O);
|
|
3452
3453
|
}
|
|
@@ -3466,17 +3467,17 @@ var L;
|
|
|
3466
3467
|
async function n(u, p, y) {
|
|
3467
3468
|
let _ = !u.objectStoreNames.contains(p), g = [];
|
|
3468
3469
|
if (!_ && y?.indexes?.length) {
|
|
3469
|
-
const
|
|
3470
|
+
const A = u.transaction(p, "readonly"), l = A.objectStore(p), c = new Set(Array.from(l.indexNames));
|
|
3470
3471
|
g = (y.indexes || []).filter((h) => !c.has(h.name)), await new Promise((h, d) => {
|
|
3471
|
-
|
|
3472
|
+
A.oncomplete = () => h(), A.onabort = () => d(A.error), A.onerror = () => d(A.error);
|
|
3472
3473
|
});
|
|
3473
3474
|
}
|
|
3474
3475
|
if (!_ && g.length === 0) return u;
|
|
3475
3476
|
const w = u.version + 1;
|
|
3476
3477
|
u.close();
|
|
3477
|
-
const O = await r(u.name, w, (
|
|
3478
|
+
const O = await r(u.name, w, (A, l) => {
|
|
3478
3479
|
let c;
|
|
3479
|
-
|
|
3480
|
+
A.objectStoreNames.contains(p) ? c = l.objectStore(p) : c = A.createObjectStore(p, {
|
|
3480
3481
|
keyPath: y?.keyPath ?? void 0,
|
|
3481
3482
|
autoIncrement: !!y?.autoIncrement
|
|
3482
3483
|
});
|
|
@@ -3521,7 +3522,7 @@ var L;
|
|
|
3521
3522
|
}
|
|
3522
3523
|
i.waitTx = f;
|
|
3523
3524
|
})(L || (L = {}));
|
|
3524
|
-
class
|
|
3525
|
+
class ln {
|
|
3525
3526
|
constructor(e, t, r = {}) {
|
|
3526
3527
|
this.dbName = e, this.storeName = t, this.options = r;
|
|
3527
3528
|
}
|
|
@@ -3649,9 +3650,9 @@ class an {
|
|
|
3649
3650
|
await L.closeConnection(this.dbName);
|
|
3650
3651
|
}
|
|
3651
3652
|
}
|
|
3652
|
-
class
|
|
3653
|
+
class hn {
|
|
3653
3654
|
constructor(e, t, r = 1 / 0, n) {
|
|
3654
|
-
this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.db = new
|
|
3655
|
+
this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.db = new ln(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), this._clearExpiredEntries().catch(() => {
|
|
3655
3656
|
});
|
|
3656
3657
|
}
|
|
3657
3658
|
async _clearExpiredEntries() {
|
|
@@ -3737,7 +3738,7 @@ class cn {
|
|
|
3737
3738
|
return await this.db.clear(), this;
|
|
3738
3739
|
}
|
|
3739
3740
|
}
|
|
3740
|
-
class
|
|
3741
|
+
class un extends z {
|
|
3741
3742
|
constructor(e, t) {
|
|
3742
3743
|
super(e, "storage", !1), this.config = t, this.kv = this.createDatabase("key-val", 0, 1, "indexedDB"), this.simpleKV = this.createDatabase("~", 0, 1, "localStorage"), this.memoryKV = this.createDatabase("~", 0, 1, "memory");
|
|
3743
3744
|
}
|
|
@@ -3745,97 +3746,171 @@ class ln extends z {
|
|
|
3745
3746
|
const s = "indexedDB" in window && window.indexedDB !== null;
|
|
3746
3747
|
switch (n === "indexedDB" && !s && (n = "localStorage"), n) {
|
|
3747
3748
|
case "indexedDB":
|
|
3748
|
-
return new
|
|
3749
|
+
return new hn(this.config.dbName, e, t, r);
|
|
3749
3750
|
case "localStorage":
|
|
3750
3751
|
case "sessionStorage":
|
|
3751
3752
|
case "memory":
|
|
3752
|
-
return new
|
|
3753
|
+
return new cn(this.config.dbName, e, t, r, n);
|
|
3753
3754
|
default:
|
|
3754
3755
|
throw new Error(`Unsupported storage engine: ${n}`);
|
|
3755
3756
|
}
|
|
3756
3757
|
}
|
|
3757
3758
|
}
|
|
3758
|
-
function
|
|
3759
|
+
function Jt(i) {
|
|
3759
3760
|
return function(e) {
|
|
3760
3761
|
return e.PreferencesSchema = i, e;
|
|
3761
3762
|
};
|
|
3762
3763
|
}
|
|
3763
|
-
|
|
3764
|
+
function wt(i) {
|
|
3765
|
+
return i === "html" ? [document.documentElement] : i === "body" ? [document.body] : [document.documentElement, document.body];
|
|
3766
|
+
}
|
|
3767
|
+
function Ae(i, e) {
|
|
3768
|
+
return i.some((t) => e.some((r) => t.classList.contains(r)));
|
|
3769
|
+
}
|
|
3770
|
+
function fn(i) {
|
|
3771
|
+
const e = i.target ?? "both", t = i.systemClasses ?? [];
|
|
3772
|
+
let r = null, n = null, s = null;
|
|
3773
|
+
return {
|
|
3774
|
+
name: i.name,
|
|
3775
|
+
match() {
|
|
3776
|
+
return Ae([document.documentElement, document.body], i.skinClasses);
|
|
3777
|
+
},
|
|
3778
|
+
getCurrentTheme() {
|
|
3779
|
+
const o = wt(e);
|
|
3780
|
+
return Ae(o, i.darkClasses) || t.length > 0 && Ae(o, t) && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
3781
|
+
},
|
|
3782
|
+
startObserving(o) {
|
|
3783
|
+
if (!r) {
|
|
3784
|
+
r = new MutationObserver(o);
|
|
3785
|
+
for (const a of wt(e))
|
|
3786
|
+
r.observe(a, { attributes: !0, attributeFilter: ["class"] });
|
|
3787
|
+
t.length > 0 && (n = window.matchMedia("(prefers-color-scheme: dark)"), s = o, n.addEventListener("change", s));
|
|
3788
|
+
}
|
|
3789
|
+
},
|
|
3790
|
+
stopObserving() {
|
|
3791
|
+
r?.disconnect(), r = null, n && s && (n.removeEventListener("change", s), n = null, s = null);
|
|
3792
|
+
}
|
|
3793
|
+
};
|
|
3794
|
+
}
|
|
3795
|
+
const dn = [
|
|
3796
|
+
{
|
|
3797
|
+
name: "MoeSkin",
|
|
3798
|
+
skinClasses: ["skin-moeskin"],
|
|
3799
|
+
darkClasses: ["dark"],
|
|
3800
|
+
target: "html"
|
|
3801
|
+
},
|
|
3802
|
+
{
|
|
3803
|
+
name: "Fandom Desktop",
|
|
3804
|
+
skinClasses: ["skin-fandomdesktop"],
|
|
3805
|
+
darkClasses: ["theme-fandomdesktop-dark"]
|
|
3806
|
+
},
|
|
3807
|
+
{
|
|
3808
|
+
name: "Fandom Mobile",
|
|
3809
|
+
skinClasses: ["skin-fandommobile"],
|
|
3810
|
+
darkClasses: ["theme-fandommobile-dark"]
|
|
3811
|
+
},
|
|
3812
|
+
{
|
|
3813
|
+
name: "Vector 2022",
|
|
3814
|
+
skinClasses: ["skin-vector-2022"],
|
|
3815
|
+
darkClasses: ["skin-theme-clientpref-night"],
|
|
3816
|
+
systemClasses: ["skin-theme-clientpref-os"],
|
|
3817
|
+
target: "html"
|
|
3818
|
+
},
|
|
3819
|
+
{
|
|
3820
|
+
name: "Citizen",
|
|
3821
|
+
skinClasses: ["skin-citizen"],
|
|
3822
|
+
darkClasses: ["skin-theme-clientpref-night"],
|
|
3823
|
+
systemClasses: ["skin-theme-clientpref-os"],
|
|
3824
|
+
target: "html"
|
|
3825
|
+
}
|
|
3826
|
+
];
|
|
3827
|
+
var pn = Object.create, Xe = Object.defineProperty, gn = Object.getOwnPropertyDescriptor, Qt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Xt = (i) => {
|
|
3764
3828
|
throw TypeError(i);
|
|
3765
|
-
},
|
|
3829
|
+
}, mn = (i, e, t) => e in i ? Xe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, yn = (i, e) => Xe(i, "name", { value: e, configurable: !0 }), wn = (i) => [, , , pn(i?.[Qt("metadata")] ?? null)], bn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Zt = (i) => i !== void 0 && typeof i != "function" ? Xt("Function expected") : i, vn = (i, e, t, r, n) => ({ kind: bn[i], name: e, metadata: r, addInitializer: (s) => t._ ? Xt("Already initialized") : n.push(Zt(s || null)) }), _n = (i, e) => mn(e, Qt("metadata"), i[3]), xn = (i, e, t, r) => {
|
|
3766
3830
|
for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
3767
3831
|
return r;
|
|
3768
|
-
},
|
|
3769
|
-
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
3770
|
-
|
|
3832
|
+
}, kn = (i, e, t, r, n, s) => {
|
|
3833
|
+
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && gn(n, t));
|
|
3834
|
+
yn(n, t);
|
|
3771
3835
|
for (var w = r.length - 1; w >= 0; w--)
|
|
3772
|
-
f =
|
|
3773
|
-
return
|
|
3774
|
-
},
|
|
3775
|
-
|
|
3836
|
+
f = vn(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Zt(o) && (n = o);
|
|
3837
|
+
return _n(i, n), g && Xe(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
3838
|
+
}, ei, Ze, ti;
|
|
3839
|
+
ei = [F(["preferences"]), Jt(
|
|
3776
3840
|
$.object({
|
|
3777
3841
|
theme: $.union([
|
|
3778
3842
|
$.const("auto").description("Follow system"),
|
|
3779
3843
|
$.const("light").description("Light mode"),
|
|
3780
3844
|
$.const("dark").description("Dark mode"),
|
|
3781
|
-
$.const("
|
|
3845
|
+
$.const("site").description("Follow site theme")
|
|
3782
3846
|
]).default("auto").description("Theme preference")
|
|
3783
3847
|
}).description("Theme settings").extra("category", "general")
|
|
3784
3848
|
)];
|
|
3785
|
-
class me extends (
|
|
3849
|
+
class me extends (ti = z) {
|
|
3786
3850
|
constructor(e) {
|
|
3787
|
-
super(e, "theme", !1), this.ctx = e, this._mediaQueryList = null, this.
|
|
3851
|
+
super(e, "theme", !1), this.ctx = e, this._mediaQueryList = null, this.adapters = [], this.activeAdapter = null, this._applyingTheme = !1, this._applyThemeQueued = !1, this._handleSystemThemeChange = this._onSystemThemeChange.bind(this);
|
|
3788
3852
|
}
|
|
3789
3853
|
async start() {
|
|
3790
|
-
this._mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)"), this._mediaQueryList.addEventListener("change", this._handleSystemThemeChange)
|
|
3854
|
+
this._mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)"), this._mediaQueryList.addEventListener("change", this._handleSystemThemeChange);
|
|
3855
|
+
for (const e of dn)
|
|
3856
|
+
this.registerSiteThemeAdapter(fn(e));
|
|
3857
|
+
await this.applyTheme(), this.ctx.on("preferences/changed", async ({ changes: e }) => {
|
|
3791
3858
|
"theme" in e && await this.applyTheme();
|
|
3792
3859
|
});
|
|
3793
3860
|
}
|
|
3794
3861
|
stop() {
|
|
3795
|
-
this._mediaQueryList && this._mediaQueryList.removeEventListener("change", this._handleSystemThemeChange), this.
|
|
3862
|
+
this._mediaQueryList && this._mediaQueryList.removeEventListener("change", this._handleSystemThemeChange), this.activeAdapter?.stopObserving();
|
|
3796
3863
|
}
|
|
3797
|
-
|
|
3798
|
-
|
|
3864
|
+
/**
|
|
3865
|
+
* Register a site theme adapter. Returns a dispose function to unregister it.
|
|
3866
|
+
* Custom adapters take priority over previously registered (built-in) ones.
|
|
3867
|
+
*/
|
|
3868
|
+
registerSiteThemeAdapter(e) {
|
|
3869
|
+
return this.adapters.unshift(e), this.resolveActiveAdapter(), this.applyTheme(), () => {
|
|
3870
|
+
this.adapters = this.adapters.filter((t) => t !== e), this.activeAdapter === e && (e.stopObserving(), this.activeAdapter = null, this.resolveActiveAdapter()), this.applyTheme();
|
|
3871
|
+
};
|
|
3799
3872
|
}
|
|
3800
|
-
|
|
3873
|
+
resolveActiveAdapter() {
|
|
3874
|
+
this.activeAdapter = this.adapters.find((e) => e.match()) ?? null;
|
|
3875
|
+
}
|
|
3876
|
+
async _onSystemThemeChange() {
|
|
3801
3877
|
await this.applyTheme();
|
|
3802
3878
|
}
|
|
3803
3879
|
async applyTheme() {
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
}
|
|
3880
|
+
if (this._applyingTheme) {
|
|
3881
|
+
this._applyThemeQueued = !0;
|
|
3882
|
+
return;
|
|
3883
|
+
}
|
|
3884
|
+
this._applyingTheme = !0;
|
|
3885
|
+
try {
|
|
3886
|
+
const e = await this.ctx.preferences.get("theme") || "auto";
|
|
3887
|
+
this.updateSiteObserver(e);
|
|
3888
|
+
const t = this.getTheme(e);
|
|
3889
|
+
this.applyThemeClass(t), this.ctx.emit("theme/changed", { ctx: this.ctx, theme: t });
|
|
3890
|
+
} finally {
|
|
3891
|
+
this._applyingTheme = !1, this._applyThemeQueued && (this._applyThemeQueued = !1, this.applyTheme());
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
updateSiteObserver(e) {
|
|
3895
|
+
e === "site" && this.activeAdapter ? this.activeAdapter.startObserving(() => this.applyTheme()) : this.activeAdapter?.stopObserving();
|
|
3815
3896
|
}
|
|
3816
3897
|
getTheme(e) {
|
|
3817
|
-
|
|
3818
|
-
return this._mediaQueryList?.matches ? "dark" : "light";
|
|
3819
|
-
if (e === "fandom") {
|
|
3820
|
-
const t = document.body;
|
|
3821
|
-
return t.classList.contains("theme-fandomdesktop-dark") || t.classList.contains("theme-fandommobile-dark") ? "dark" : "light";
|
|
3822
|
-
}
|
|
3823
|
-
return e;
|
|
3898
|
+
return e === "auto" ? this._mediaQueryList?.matches ? "dark" : "light" : e === "site" ? this.activeAdapter ? this.activeAdapter.getCurrentTheme() : this._mediaQueryList?.matches ? "dark" : "light" : e;
|
|
3824
3899
|
}
|
|
3825
3900
|
applyThemeClass(e) {
|
|
3826
3901
|
const t = document.body;
|
|
3827
|
-
e === "dark" ? (t.classList.add("ipe-theme-dark"), t.setAttribute("data-ipe-theme", "dark")) : (t.classList.remove("ipe-theme-dark"), t.setAttribute("data-ipe-theme", "light"));
|
|
3902
|
+
t.getAttribute("data-ipe-theme") !== e && (e === "dark" ? (t.classList.add("ipe-theme-dark"), t.setAttribute("data-ipe-theme", "dark")) : (t.classList.remove("ipe-theme-dark"), t.setAttribute("data-ipe-theme", "light")));
|
|
3828
3903
|
}
|
|
3829
3904
|
get currentTheme() {
|
|
3830
3905
|
return document.body.classList.contains("ipe-theme-dark") ? "dark" : "light";
|
|
3831
3906
|
}
|
|
3832
3907
|
}
|
|
3833
|
-
|
|
3834
|
-
me =
|
|
3835
|
-
|
|
3836
|
-
class
|
|
3908
|
+
Ze = wn(ti);
|
|
3909
|
+
me = kn(Ze, 0, "ThemeService", ei, me);
|
|
3910
|
+
xn(Ze, 1, me);
|
|
3911
|
+
class Sn extends z {
|
|
3837
3912
|
constructor(e) {
|
|
3838
|
-
super(e, "wikiPage", !0), this.ctx = e, this.WikiPage =
|
|
3913
|
+
super(e, "wikiPage", !0), this.ctx = e, this.WikiPage = Ei(this.ctx.api);
|
|
3839
3914
|
}
|
|
3840
3915
|
static {
|
|
3841
3916
|
this.inject = ["api"];
|
|
@@ -3856,9 +3931,9 @@ class vn extends z {
|
|
|
3856
3931
|
return this.WikiPage.newBlankPage(e);
|
|
3857
3932
|
}
|
|
3858
3933
|
}
|
|
3859
|
-
class
|
|
3934
|
+
class et extends z {
|
|
3860
3935
|
constructor(e) {
|
|
3861
|
-
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 =
|
|
3936
|
+
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 = Ai(this.ctx.wiki.siteInfo);
|
|
3862
3937
|
}
|
|
3863
3938
|
static {
|
|
3864
3939
|
this.inject = ["wiki", "wikiPage"];
|
|
@@ -3882,7 +3957,7 @@ class Ze extends z {
|
|
|
3882
3957
|
throw new Error("Invalid id or kind", { cause: e });
|
|
3883
3958
|
if (!t && this._cachedTitles.has(`${a}:${o}`))
|
|
3884
3959
|
return await this._cachedTitles.get(`${a}:${o}`);
|
|
3885
|
-
const { promise: f, resolve: u, reject: p } =
|
|
3960
|
+
const { promise: f, resolve: u, reject: p } = _t();
|
|
3886
3961
|
this._cachedTitles.set(`${a}:${o}`, f);
|
|
3887
3962
|
try {
|
|
3888
3963
|
const { wikiPage: y } = this.ctx;
|
|
@@ -3952,12 +4027,12 @@ class Ze extends z {
|
|
|
3952
4027
|
this.REG_SKIPPED_HREF = /^(#|javascript:|vbscript:|file:)/i;
|
|
3953
4028
|
}
|
|
3954
4029
|
validateHrefAttr(e) {
|
|
3955
|
-
return typeof e != "string" ? !1 : !
|
|
4030
|
+
return typeof e != "string" ? !1 : !et.REG_SKIPPED_HREF.test(e);
|
|
3956
4031
|
}
|
|
3957
4032
|
parseWikiLink(e) {
|
|
3958
4033
|
if (!e || typeof e == "string" && !this.validateHrefAttr(e))
|
|
3959
4034
|
return null;
|
|
3960
|
-
const t =
|
|
4035
|
+
const t = Kt(e);
|
|
3961
4036
|
if (!this.isWikiLink(t.toString()))
|
|
3962
4037
|
return null;
|
|
3963
4038
|
const r = t.searchParams, n = t.hash.replace("#", ""), s = r.get("action") || "view", o = r.get("title") || "", a = parseInt(r.get("curid") || "0", 10), f = parseInt(r.get("oldid") || "0", 10);
|
|
@@ -3991,27 +4066,27 @@ class Ze extends z {
|
|
|
3991
4066
|
};
|
|
3992
4067
|
}
|
|
3993
4068
|
}
|
|
3994
|
-
const
|
|
3995
|
-
async function
|
|
3996
|
-
return
|
|
4069
|
+
const ii = (i) => typeof i == "function";
|
|
4070
|
+
async function $n(i) {
|
|
4071
|
+
return ii(i) ? await i() : i;
|
|
3997
4072
|
}
|
|
3998
|
-
function
|
|
3999
|
-
return
|
|
4073
|
+
function _s(i) {
|
|
4074
|
+
return ii(i) ? i() : i;
|
|
4000
4075
|
}
|
|
4001
|
-
var
|
|
4076
|
+
var En = Object.create, tt = Object.defineProperty, An = Object.getOwnPropertyDescriptor, ri = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), ni = (i) => {
|
|
4002
4077
|
throw TypeError(i);
|
|
4003
|
-
},
|
|
4078
|
+
}, Cn = (i, e, t) => e in i ? tt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, On = (i, e) => tt(i, "name", { value: e, configurable: !0 }), Pn = (i) => [, , , En(i?.[ri("metadata")] ?? null)], In = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], si = (i) => i !== void 0 && typeof i != "function" ? ni("Function expected") : i, Ln = (i, e, t, r, n) => ({ kind: In[i], name: e, metadata: r, addInitializer: (s) => t._ ? ni("Already initialized") : n.push(si(s || null)) }), Rn = (i, e) => Cn(e, ri("metadata"), i[3]), jn = (i, e, t, r) => {
|
|
4004
4079
|
for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
4005
4080
|
return r;
|
|
4006
|
-
},
|
|
4007
|
-
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
4008
|
-
|
|
4081
|
+
}, Tn = (i, e, t, r, n, s) => {
|
|
4082
|
+
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && An(n, t));
|
|
4083
|
+
On(n, t);
|
|
4009
4084
|
for (var w = r.length - 1; w >= 0; w--)
|
|
4010
|
-
f =
|
|
4011
|
-
return
|
|
4012
|
-
},
|
|
4013
|
-
|
|
4014
|
-
class ye extends (
|
|
4085
|
+
f = Ln(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, si(o) && (n = o);
|
|
4086
|
+
return Rn(i, n), g && tt(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
4087
|
+
}, oi, it, ai;
|
|
4088
|
+
oi = [F(["storage", "wiki"])];
|
|
4089
|
+
class ye extends (ai = z) {
|
|
4015
4090
|
constructor(e) {
|
|
4016
4091
|
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.createDatabase(`preferences:${e.wiki.userInfo.id}`, 1 / 0);
|
|
4017
4092
|
try {
|
|
@@ -4032,7 +4107,7 @@ class ye extends (si = z) {
|
|
|
4032
4107
|
return this.logger.debug(e, `(fallback value: ${n})`), n;
|
|
4033
4108
|
};
|
|
4034
4109
|
const r = await this.db.get(e, void 0);
|
|
4035
|
-
return r !== null ? r : await
|
|
4110
|
+
return r !== null ? r : await $n(t);
|
|
4036
4111
|
}
|
|
4037
4112
|
/**
|
|
4038
4113
|
* 获取全部注册的配置项以及最终生效的值
|
|
@@ -4124,19 +4199,19 @@ class ye extends (si = z) {
|
|
|
4124
4199
|
return t && this.logger.info(`Migrated ${t} preferences from master DB`), await e.clear(), await e?.db?.disconnect?.(), t;
|
|
4125
4200
|
}
|
|
4126
4201
|
}
|
|
4127
|
-
|
|
4128
|
-
ye =
|
|
4129
|
-
|
|
4130
|
-
var
|
|
4131
|
-
const
|
|
4132
|
-
function
|
|
4202
|
+
it = Pn(ai);
|
|
4203
|
+
ye = Tn(it, 0, "PreferencesService", oi, ye);
|
|
4204
|
+
jn(it, 1, ye);
|
|
4205
|
+
var rt = /* @__PURE__ */ ((i) => (i.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api/v6", i.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", i.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", i.GITHUB_OWNER = "inpageedit", i.GITHUB_REPO = "inpageedit-next", i.HOME_URL = "https://www.ipe.wiki/", i.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", i.PLUGIN_REGISTRY_URL = "https://registry.ipe.wiki/registry.v1.json", i.I18N_INDEX_URL = "https://registry.ipe.wiki/i18n/index.json", i.QQ_GROUP_ID = "1026023666", i))(rt || {});
|
|
4206
|
+
const ci = "", li = "", Dn = /\\\{/g, Nn = /\\\}/g, Mn = new RegExp(ci, "g"), Bn = new RegExp(li, "g");
|
|
4207
|
+
function bt(i) {
|
|
4133
4208
|
const e = i ? { ...i } : void 0;
|
|
4134
|
-
return (r, ...n) =>
|
|
4209
|
+
return (r, ...n) => Un(e, r, ...n);
|
|
4135
4210
|
}
|
|
4136
|
-
function
|
|
4211
|
+
function Un(i, e, ...t) {
|
|
4137
4212
|
if (!e) return "";
|
|
4138
|
-
let r = String(e).replace(
|
|
4139
|
-
t.length === 1 && Array.isArray(t[0]) ? s = t[0] : t.length === 1 &&
|
|
4213
|
+
let r = String(e).replace(Dn, ci).replace(Nn, li), n = {}, s = [];
|
|
4214
|
+
t.length === 1 && Array.isArray(t[0]) ? s = t[0] : t.length === 1 && Fn(t[0]) ? n = t[0] : t.length > 0 && (s = t);
|
|
4140
4215
|
const o = /* @__PURE__ */ Object.create(null);
|
|
4141
4216
|
if (s && s.length)
|
|
4142
4217
|
for (let a = 0; a < s.length; a++)
|
|
@@ -4150,18 +4225,18 @@ function Tn(i, e, ...t) {
|
|
|
4150
4225
|
const u = String(f).trim();
|
|
4151
4226
|
if (!u) return "";
|
|
4152
4227
|
try {
|
|
4153
|
-
const p =
|
|
4228
|
+
const p = zn(u, o);
|
|
4154
4229
|
return p == null ? "" : String(p);
|
|
4155
4230
|
} catch {
|
|
4156
4231
|
return "";
|
|
4157
4232
|
}
|
|
4158
|
-
}), r.replace(
|
|
4233
|
+
}), r.replace(Mn, "{").replace(Bn, "}");
|
|
4159
4234
|
}
|
|
4160
|
-
function
|
|
4235
|
+
function Fn(i) {
|
|
4161
4236
|
return typeof i == "object" && i !== null && i.constructor === Object;
|
|
4162
4237
|
}
|
|
4163
|
-
const
|
|
4164
|
-
function
|
|
4238
|
+
const zn = Hn();
|
|
4239
|
+
function Hn() {
|
|
4165
4240
|
const i = /* @__PURE__ */ new Set([
|
|
4166
4241
|
"eval",
|
|
4167
4242
|
"Object",
|
|
@@ -4206,14 +4281,14 @@ function Bn() {
|
|
|
4206
4281
|
return e(t, n);
|
|
4207
4282
|
};
|
|
4208
4283
|
}
|
|
4209
|
-
function
|
|
4284
|
+
function hi(i) {
|
|
4210
4285
|
return i.charAt(0).toLowerCase() + i.slice(1);
|
|
4211
4286
|
}
|
|
4212
4287
|
function ie(i) {
|
|
4213
|
-
return
|
|
4288
|
+
return hi(i).replace(/_/g, "-").replace(/.[A-Z]+/g, (e) => e[0] + "-" + e.slice(1).toLowerCase());
|
|
4214
4289
|
}
|
|
4215
|
-
function
|
|
4216
|
-
return
|
|
4290
|
+
function xs(i) {
|
|
4291
|
+
return hi(i).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
|
|
4217
4292
|
}
|
|
4218
4293
|
function q(i, e) {
|
|
4219
4294
|
let t = i[0] ?? "";
|
|
@@ -4221,14 +4296,14 @@ function q(i, e) {
|
|
|
4221
4296
|
t += String(e[r]) + (i[r + 1] ?? "");
|
|
4222
4297
|
return t;
|
|
4223
4298
|
}
|
|
4224
|
-
class
|
|
4299
|
+
class Kn {
|
|
4225
4300
|
constructor(e, t) {
|
|
4226
4301
|
this.languages = /* @__PURE__ */ new Map(), this.currentLanguage = "en", this.missingKeys = /* @__PURE__ */ new Map(), this.usedKeys = /* @__PURE__ */ new Set();
|
|
4227
4302
|
const r = t?.language || "en";
|
|
4228
|
-
this.currentLanguage = r, this.interpolate =
|
|
4303
|
+
this.currentLanguage = r, this.interpolate = bt(t?.globals), e && Object.keys(e).length && this.setLanguageData(r, e);
|
|
4229
4304
|
}
|
|
4230
4305
|
setGlobals(e) {
|
|
4231
|
-
return this.interpolate =
|
|
4306
|
+
return this.interpolate = bt(e), this;
|
|
4232
4307
|
}
|
|
4233
4308
|
set(e, t) {
|
|
4234
4309
|
const r = this.currentLanguage, n = this.ensureLanguageMap(r);
|
|
@@ -4415,19 +4490,19 @@ class Un {
|
|
|
4415
4490
|
return e;
|
|
4416
4491
|
}
|
|
4417
4492
|
}
|
|
4418
|
-
var
|
|
4493
|
+
var qn = Object.create, nt = Object.defineProperty, Wn = Object.getOwnPropertyDescriptor, ui = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), fi = (i) => {
|
|
4419
4494
|
throw TypeError(i);
|
|
4420
|
-
},
|
|
4495
|
+
}, Gn = (i, e, t) => e in i ? nt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Vn = (i, e) => nt(i, "name", { value: e, configurable: !0 }), Yn = (i) => [, , , qn(i?.[ui("metadata")] ?? null)], Jn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], di = (i) => i !== void 0 && typeof i != "function" ? fi("Function expected") : i, Qn = (i, e, t, r, n) => ({ kind: Jn[i], name: e, metadata: r, addInitializer: (s) => t._ ? fi("Already initialized") : n.push(di(s || null)) }), Xn = (i, e) => Gn(e, ui("metadata"), i[3]), Zn = (i, e, t, r) => {
|
|
4421
4496
|
for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
4422
4497
|
return r;
|
|
4423
|
-
},
|
|
4424
|
-
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
4425
|
-
|
|
4498
|
+
}, es = (i, e, t, r, n, s) => {
|
|
4499
|
+
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && Wn(n, t));
|
|
4500
|
+
Vn(n, t);
|
|
4426
4501
|
for (var w = r.length - 1; w >= 0; w--)
|
|
4427
|
-
f =
|
|
4428
|
-
return
|
|
4429
|
-
},
|
|
4430
|
-
const
|
|
4502
|
+
f = Qn(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, di(o) && (n = o);
|
|
4503
|
+
return Xn(i, n), g && nt(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
4504
|
+
}, pi, st, gi;
|
|
4505
|
+
const vt = new $(
|
|
4431
4506
|
$.object({
|
|
4432
4507
|
manifest_version: $.const(1).required(),
|
|
4433
4508
|
base_language: $.string().required(),
|
|
@@ -4446,16 +4521,16 @@ const wt = new $(
|
|
|
4446
4521
|
).required()
|
|
4447
4522
|
})
|
|
4448
4523
|
);
|
|
4449
|
-
|
|
4524
|
+
pi = [F(["wiki", "preferences"]), Jt(
|
|
4450
4525
|
$.object({
|
|
4451
4526
|
"i18n.index_url": $.string().description("I18n index URL (DO NOT CHANGE THIS) ").default(
|
|
4452
|
-
|
|
4527
|
+
rt.I18N_INDEX_URL
|
|
4453
4528
|
)
|
|
4454
4529
|
}).description("").extra("category", "general")
|
|
4455
4530
|
)];
|
|
4456
|
-
class we extends (
|
|
4531
|
+
class we extends (gi = z) {
|
|
4457
4532
|
constructor(e) {
|
|
4458
|
-
super(e, "i18n", !1), this.ctx = e, this.logger = void 0, this._indexUrl = void 0, this._indexCache = null, this.manager = void 0, this.i18nIndexDB = void 0, this.i18nDataDB = void 0, this.$ = void 0, this.$raw = void 0, this.$$ = void 0, this.$$raw = void 0, this.logger = this.ctx.logger("I18nService"), this.manager = new
|
|
4533
|
+
super(e, "i18n", !1), this.ctx = e, this.logger = void 0, this._indexUrl = void 0, this._indexCache = null, this.manager = void 0, this.i18nIndexDB = void 0, this.i18nDataDB = void 0, this.$ = void 0, this.$raw = void 0, this.$$ = void 0, this.$$raw = void 0, this.logger = this.ctx.logger("I18nService"), this.manager = new Kn(
|
|
4459
4534
|
{},
|
|
4460
4535
|
{
|
|
4461
4536
|
language: "",
|
|
@@ -4592,7 +4667,7 @@ class we extends (di = z) {
|
|
|
4592
4667
|
const n = await this.i18nIndexDB.get(e);
|
|
4593
4668
|
if (n)
|
|
4594
4669
|
try {
|
|
4595
|
-
return
|
|
4670
|
+
return vt(n);
|
|
4596
4671
|
} catch (s) {
|
|
4597
4672
|
this.logger.error("Failed to parse cached i18n index", s), this.i18nIndexDB.delete(e);
|
|
4598
4673
|
}
|
|
@@ -4602,7 +4677,7 @@ class we extends (di = z) {
|
|
|
4602
4677
|
}
|
|
4603
4678
|
async fetchI18nIndex(e) {
|
|
4604
4679
|
const t = await fetch(e).then((r) => r.json());
|
|
4605
|
-
return
|
|
4680
|
+
return vt(t);
|
|
4606
4681
|
}
|
|
4607
4682
|
async ensureLanguageLoaded(e) {
|
|
4608
4683
|
if (!this.manager || !this._indexCache) throw new Error("I18nManager is not initialized");
|
|
@@ -4641,18 +4716,18 @@ class we extends (di = z) {
|
|
|
4641
4716
|
await this.i18nIndexDB.clear(), await this.i18nDataDB.clear();
|
|
4642
4717
|
}
|
|
4643
4718
|
}
|
|
4644
|
-
|
|
4645
|
-
we =
|
|
4646
|
-
|
|
4647
|
-
const
|
|
4648
|
-
function
|
|
4649
|
-
if (typeof i == "string") return
|
|
4719
|
+
st = Yn(gi);
|
|
4720
|
+
we = es(st, 0, "I18nService", pi, we);
|
|
4721
|
+
Zn(st, 1, we);
|
|
4722
|
+
const ts = new TextEncoder();
|
|
4723
|
+
function is(i) {
|
|
4724
|
+
if (typeof i == "string") return ts.encode(i);
|
|
4650
4725
|
if (i instanceof ArrayBuffer) return new Uint8Array(i);
|
|
4651
4726
|
if (ArrayBuffer.isView(i))
|
|
4652
4727
|
return new Uint8Array(i.buffer, i.byteOffset, i.byteLength);
|
|
4653
4728
|
throw new TypeError("Unsupported input type");
|
|
4654
4729
|
}
|
|
4655
|
-
function
|
|
4730
|
+
function rs(i) {
|
|
4656
4731
|
let e = "";
|
|
4657
4732
|
for (let t = 0; t < i.length; t++) {
|
|
4658
4733
|
const r = i[t].toString(16).padStart(2, "0");
|
|
@@ -4660,10 +4735,10 @@ function Zn(i) {
|
|
|
4660
4735
|
}
|
|
4661
4736
|
return e;
|
|
4662
4737
|
}
|
|
4663
|
-
function
|
|
4738
|
+
function ns(i, e) {
|
|
4664
4739
|
return i << e | i >>> 32 - e;
|
|
4665
4740
|
}
|
|
4666
|
-
const
|
|
4741
|
+
const ss = [
|
|
4667
4742
|
7,
|
|
4668
4743
|
12,
|
|
4669
4744
|
17,
|
|
@@ -4728,42 +4803,42 @@ const ts = [
|
|
|
4728
4803
|
10,
|
|
4729
4804
|
15,
|
|
4730
4805
|
21
|
|
4731
|
-
],
|
|
4732
|
-
function
|
|
4733
|
-
const e =
|
|
4806
|
+
], os = new Array(64).fill(0).map((i, e) => Math.floor(Math.abs(Math.sin(e + 1)) * 2 ** 32) >>> 0);
|
|
4807
|
+
function as(i) {
|
|
4808
|
+
const e = is(i), t = (56 - (e.length + 1) % 64 + 64) % 64, r = e.length + 1 + t + 8, n = new Uint8Array(r);
|
|
4734
4809
|
n.set(e, 0), n[e.length] = 128;
|
|
4735
4810
|
const s = e.length, o = s << 3 >>> 0, a = s >>> 29 >>> 0, f = new DataView(n.buffer);
|
|
4736
4811
|
f.setUint32(r - 8, o, !0), f.setUint32(r - 4, a, !0);
|
|
4737
4812
|
let u = 1732584193, p = 4023233417, y = 2562383102, _ = 271733878;
|
|
4738
4813
|
const g = new Uint32Array(16);
|
|
4739
|
-
for (let
|
|
4740
|
-
for (let m = 0; m < 16; m++) g[m] = f.getUint32(
|
|
4814
|
+
for (let A = 0; A < n.length; A += 64) {
|
|
4815
|
+
for (let m = 0; m < 16; m++) g[m] = f.getUint32(A + m * 4, !0);
|
|
4741
4816
|
let l = u, c = p, h = y, d = _;
|
|
4742
4817
|
for (let m = 0; m < 64; m++) {
|
|
4743
4818
|
let v, x;
|
|
4744
4819
|
m < 16 ? (v = c & h | ~c & d, x = m) : m < 32 ? (v = d & c | ~d & h, x = (5 * m + 1) % 16) : m < 48 ? (v = c ^ h ^ d, x = (3 * m + 5) % 16) : (v = h ^ (c | ~d), x = 7 * m % 16);
|
|
4745
|
-
const
|
|
4746
|
-
d = h, h = c, c = c +
|
|
4820
|
+
const C = d, Se = l + v + os[m] + g[x] >>> 0;
|
|
4821
|
+
d = h, h = c, c = c + ns(Se, ss[m]) >>> 0, l = C;
|
|
4747
4822
|
}
|
|
4748
4823
|
u = u + l >>> 0, p = p + c >>> 0, y = y + h >>> 0, _ = _ + d >>> 0;
|
|
4749
4824
|
}
|
|
4750
4825
|
const w = new Uint8Array(16), O = new DataView(w.buffer);
|
|
4751
4826
|
return O.setUint32(0, u, !0), O.setUint32(4, p, !0), O.setUint32(8, y, !0), O.setUint32(12, _, !0), w;
|
|
4752
4827
|
}
|
|
4753
|
-
var
|
|
4828
|
+
var cs = Object.create, ot = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, mi = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), yi = (i) => {
|
|
4754
4829
|
throw TypeError(i);
|
|
4755
|
-
},
|
|
4830
|
+
}, hs = (i, e, t) => e in i ? ot(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, us = (i, e) => ot(i, "name", { value: e, configurable: !0 }), fs = (i) => [, , , cs(i?.[mi("metadata")] ?? null)], ds = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], wi = (i) => i !== void 0 && typeof i != "function" ? yi("Function expected") : i, ps = (i, e, t, r, n) => ({ kind: ds[i], name: e, metadata: r, addInitializer: (s) => t._ ? yi("Already initialized") : n.push(wi(s || null)) }), gs = (i, e) => hs(e, mi("metadata"), i[3]), ms = (i, e, t, r) => {
|
|
4756
4831
|
for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
4757
4832
|
return r;
|
|
4758
|
-
},
|
|
4759
|
-
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) &&
|
|
4760
|
-
|
|
4833
|
+
}, ys = (i, e, t, r, n, s) => {
|
|
4834
|
+
var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && ls(n, t));
|
|
4835
|
+
us(n, t);
|
|
4761
4836
|
for (var w = r.length - 1; w >= 0; w--)
|
|
4762
|
-
f =
|
|
4763
|
-
return
|
|
4764
|
-
},
|
|
4765
|
-
|
|
4766
|
-
class be extends (
|
|
4837
|
+
f = ps(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, wi(o) && (n = o);
|
|
4838
|
+
return gs(i, n), g && ot(n, t, g), p ? u ^ 4 ? s : g : n;
|
|
4839
|
+
}, bi, at, vi;
|
|
4840
|
+
bi = [F(["wiki", "wikiTitle", "wikiPage", "apiService"])];
|
|
4841
|
+
class be extends (vi = z) {
|
|
4767
4842
|
constructor(e) {
|
|
4768
4843
|
super(e, "wikiFile", !0), this.ctx = e;
|
|
4769
4844
|
}
|
|
@@ -4771,7 +4846,7 @@ class be extends (wi = z) {
|
|
|
4771
4846
|
return this.ctx.wiki.fileRepos || [];
|
|
4772
4847
|
}
|
|
4773
4848
|
get defaultFileRepo() {
|
|
4774
|
-
return this.fileRepos[0];
|
|
4849
|
+
return this.localFileRepo || this.fileRepos[0];
|
|
4775
4850
|
}
|
|
4776
4851
|
get localFileRepo() {
|
|
4777
4852
|
return this.fileRepos.find((e) => e.local);
|
|
@@ -4785,7 +4860,7 @@ class be extends (wi = z) {
|
|
|
4785
4860
|
return e.getMainDBKey().split("/").pop() || "";
|
|
4786
4861
|
}
|
|
4787
4862
|
getHashPath(e, t = 2) {
|
|
4788
|
-
const r = this.getFileName(e), n =
|
|
4863
|
+
const r = this.getFileName(e), n = rs(as(r));
|
|
4789
4864
|
let s = [];
|
|
4790
4865
|
for (let o = 1; o <= t; o++)
|
|
4791
4866
|
s.push(n.slice(0, o));
|
|
@@ -4812,14 +4887,14 @@ class be extends (wi = z) {
|
|
|
4812
4887
|
);
|
|
4813
4888
|
}
|
|
4814
4889
|
}
|
|
4815
|
-
|
|
4816
|
-
be =
|
|
4817
|
-
|
|
4890
|
+
at = fs(vi);
|
|
4891
|
+
be = ys(at, 0, "WikiFileService", bi, be);
|
|
4892
|
+
ms(at, 1, be);
|
|
4818
4893
|
class ve extends M {
|
|
4819
4894
|
constructor(e) {
|
|
4820
4895
|
super({
|
|
4821
4896
|
name: "InPageEdit"
|
|
4822
|
-
}), this.version = "0.
|
|
4897
|
+
}), this.version = "0.17.1", this.Endpoints = rt, this.schema = $, this.config = Ci(ve.DEFAULT_CONFIG, e), this.logger = lr({
|
|
4823
4898
|
name: "IPE",
|
|
4824
4899
|
color: "#33aaff",
|
|
4825
4900
|
level: this.config.logLevel
|
|
@@ -4829,7 +4904,7 @@ class ve extends M {
|
|
|
4829
4904
|
this.DEFAULT_CONFIG = {
|
|
4830
4905
|
apiConfigs: {},
|
|
4831
4906
|
legacyPreferences: {},
|
|
4832
|
-
logLevel:
|
|
4907
|
+
logLevel: Lt.info,
|
|
4833
4908
|
storageNamespace: "InPageEdit",
|
|
4834
4909
|
autoloadStyles: !0,
|
|
4835
4910
|
autoInstallCorePlugins: !0
|
|
@@ -4839,7 +4914,7 @@ class ve extends M {
|
|
|
4839
4914
|
await this.#i(), this.config.autoInstallCorePlugins && this.#e(), this.#n();
|
|
4840
4915
|
}
|
|
4841
4916
|
async #i() {
|
|
4842
|
-
this.plugin(we), this.plugin(
|
|
4917
|
+
this.plugin(we), this.plugin(ur, this.config.apiConfigs), this.plugin(xr), this.plugin(kr), this.plugin(Yr), this.plugin(ye), this.plugin(un, { dbName: this.config.storageNamespace }), this.plugin(me), this.plugin(be), this.plugin(ge), this.plugin(Sn), this.plugin(et), this.#r([
|
|
4843
4918
|
"i18n",
|
|
4844
4919
|
"$",
|
|
4845
4920
|
"$$",
|
|
@@ -4870,26 +4945,26 @@ class ve extends M {
|
|
|
4870
4945
|
// TODO: 这里不应该硬编码,暂时先这样
|
|
4871
4946
|
async #e() {
|
|
4872
4947
|
[
|
|
4873
|
-
import("./index-
|
|
4874
|
-
import("./index-
|
|
4948
|
+
import("./index-Dp_n8QEV.js").then(({ PluginAnalytics: t }) => t),
|
|
4949
|
+
import("./index-CxjH0_fO.js").then(
|
|
4875
4950
|
({ PluginInArticleLinks: t }) => t
|
|
4876
4951
|
),
|
|
4877
|
-
import("./index-
|
|
4878
|
-
import("./index-
|
|
4952
|
+
import("./index-QtXlz9l0.js").then(({ PluginPluginStore: t }) => t),
|
|
4953
|
+
import("./index-_Sydb5MZ.js").then(
|
|
4879
4954
|
({ PluginPreferencesUI: t }) => t
|
|
4880
4955
|
),
|
|
4881
|
-
import("./index-
|
|
4882
|
-
import("./index-
|
|
4883
|
-
import("./index-
|
|
4956
|
+
import("./index-h57rl1RH.js").then(({ PluginQuickEdit: t }) => t),
|
|
4957
|
+
import("./index-fa8d4Dv_.js").then(({ PluginQuickMove: t }) => t),
|
|
4958
|
+
import("./index-qbW7-LUD.js").then(
|
|
4884
4959
|
({ PluginQuickPreview: t }) => t
|
|
4885
4960
|
),
|
|
4886
|
-
import("./index
|
|
4887
|
-
import("./index-
|
|
4961
|
+
import("./index--IhZKYnh.js").then(({ PluginQuickDiff: t }) => t),
|
|
4962
|
+
import("./index-BuSA1t5R.js").then(
|
|
4888
4963
|
({ PluginQuickRedirect: t }) => t
|
|
4889
4964
|
),
|
|
4890
|
-
import("./index-
|
|
4891
|
-
import("./index-
|
|
4892
|
-
import("./index-
|
|
4965
|
+
import("./index-Bf6ewNGZ.js").then(({ PluginQuickUpload: t }) => t),
|
|
4966
|
+
import("./index-DSh05RaI.js").then(({ PluginQuickUsage: t }) => t),
|
|
4967
|
+
import("./index-Mi3qr9J0.js").then(({ PluginToolbox: t }) => t)
|
|
4893
4968
|
].forEach(async (t) => {
|
|
4894
4969
|
this.plugin(await t);
|
|
4895
4970
|
});
|
|
@@ -4901,47 +4976,49 @@ class ve extends M {
|
|
|
4901
4976
|
});
|
|
4902
4977
|
}
|
|
4903
4978
|
async withInject(e) {
|
|
4904
|
-
const { promise: t, resolve: r } =
|
|
4979
|
+
const { promise: t, resolve: r } = _t();
|
|
4905
4980
|
return this.inject(e, (n) => {
|
|
4906
4981
|
r(n);
|
|
4907
4982
|
}), t;
|
|
4908
4983
|
}
|
|
4909
4984
|
}
|
|
4910
4985
|
export {
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4986
|
+
Lt as $,
|
|
4987
|
+
ur as A,
|
|
4988
|
+
dn as B,
|
|
4989
|
+
Le as C,
|
|
4990
|
+
rt as E,
|
|
4991
|
+
Zi as F,
|
|
4916
4992
|
ve as I,
|
|
4917
|
-
|
|
4993
|
+
ht as M,
|
|
4918
4994
|
pe as N,
|
|
4919
|
-
|
|
4920
|
-
|
|
4995
|
+
Ye as P,
|
|
4996
|
+
Jt as R,
|
|
4921
4997
|
$ as S,
|
|
4922
4998
|
me as T,
|
|
4923
4999
|
be as W,
|
|
4924
5000
|
F as a,
|
|
4925
|
-
|
|
4926
|
-
|
|
5001
|
+
Ot as b,
|
|
5002
|
+
Xi as c,
|
|
4927
5003
|
z as d,
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
5004
|
+
Qi as e,
|
|
5005
|
+
lr as f,
|
|
5006
|
+
_s as g,
|
|
5007
|
+
vs as h,
|
|
5008
|
+
xs as i,
|
|
5009
|
+
un as j,
|
|
5010
|
+
xr as k,
|
|
4935
5011
|
R as l,
|
|
4936
|
-
|
|
4937
|
-
|
|
5012
|
+
Ke as m,
|
|
5013
|
+
Yr as n,
|
|
4938
5014
|
ye as o,
|
|
4939
5015
|
ie as p,
|
|
4940
|
-
|
|
4941
|
-
|
|
5016
|
+
pt as q,
|
|
5017
|
+
kr as r,
|
|
4942
5018
|
b as s,
|
|
4943
5019
|
ge as t,
|
|
4944
|
-
|
|
4945
|
-
|
|
5020
|
+
fn as u,
|
|
5021
|
+
Sn as v,
|
|
5022
|
+
et as w
|
|
4946
5023
|
};
|
|
4947
|
-
//# sourceMappingURL=index-
|
|
5024
|
+
//# sourceMappingURL=index-CaTtMzfu.js.map
|