@inpageedit/core 0.9.3 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +55 -55
  3. package/dist/ActionButton-BgbTKTg7.js.map +1 -1
  4. package/dist/CheckBox-D3rHnX7I.js.map +1 -1
  5. package/dist/IconQuickEdit-CAL1HXIb.js.map +1 -1
  6. package/dist/InputBox-BV4m05Xs.js.map +1 -1
  7. package/dist/PluginPrefSync-CNCU2DJU.js +171 -0
  8. package/dist/PluginPrefSync-CNCU2DJU.js.map +1 -0
  9. package/dist/Preferences-DS4-CFWe.js.map +1 -1
  10. package/dist/RadioBox-nJqWsxW2.js.map +1 -1
  11. package/dist/components/index.js.map +1 -1
  12. package/dist/{index-CA_JNRF8.js → index-2mNdeL-V.js} +27 -27
  13. package/dist/index-2mNdeL-V.js.map +1 -0
  14. package/dist/{index-D968kDLW.js → index-BR6gK_ki.js} +2 -2
  15. package/dist/index-BR6gK_ki.js.map +1 -0
  16. package/dist/index-Bh70Udzi.js.map +1 -1
  17. package/dist/{index-DRaYlg2d.js → index-BnAhw94L.js} +2 -2
  18. package/dist/{index-DRaYlg2d.js.map → index-BnAhw94L.js.map} +1 -1
  19. package/dist/{index-CNsfHvio.js → index-ByJfEsN8.js} +2 -2
  20. package/dist/index-ByJfEsN8.js.map +1 -0
  21. package/dist/{index-D8zKl2eU.js → index-ByzgI28q.js} +2 -2
  22. package/dist/index-ByzgI28q.js.map +1 -0
  23. package/dist/{index-CiceXP5j.js → index-CAiGct8U.js} +2 -2
  24. package/dist/index-CAiGct8U.js.map +1 -0
  25. package/dist/index-CvhkVj_L.js.map +1 -1
  26. package/dist/{index-CMuITxgX.js → index-Cx-YiN1j.js} +2 -2
  27. package/dist/{index-CMuITxgX.js.map → index-Cx-YiN1j.js.map} +1 -1
  28. package/dist/{index-DtLiqtR8.js → index-DqJUIV2e.js} +151 -143
  29. package/dist/{index-DtLiqtR8.js.map → index-DqJUIV2e.js.map} +1 -1
  30. package/dist/{index-BKxuoVoX.js → index-Z-_kjibx.js} +704 -675
  31. package/dist/index-Z-_kjibx.js.map +1 -0
  32. package/dist/{index-BJ2aqva1.js → index-eOIVMf9E.js} +2 -2
  33. package/dist/index-eOIVMf9E.js.map +1 -0
  34. package/dist/index-lZkYoUca.js.map +1 -1
  35. package/dist/index.js +1 -1
  36. package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
  37. package/dist/noop-ClDc6zv4.js.map +1 -1
  38. package/dist/plugins/preferences-ui/PluginPrefSync.d.ts +25 -0
  39. package/dist/plugins/preferences-ui/index.d.ts +4 -0
  40. package/dist/services/PreferencesService.d.ts +7 -0
  41. package/dist/services/storage/IPEStorageManager.d.ts +25 -0
  42. package/dist/services/storage/index.d.ts +3 -26
  43. package/dist/style.css +1 -1
  44. package/lib/index.umd.js +30 -23
  45. package/lib/index.umd.js.map +1 -1
  46. package/lib/style.css +1 -1
  47. package/package.json +4 -3
  48. package/dist/index-BJ2aqva1.js.map +0 -1
  49. package/dist/index-BKxuoVoX.js.map +0 -1
  50. package/dist/index-CA_JNRF8.js.map +0 -1
  51. package/dist/index-CNsfHvio.js.map +0 -1
  52. package/dist/index-CiceXP5j.js.map +0 -1
  53. package/dist/index-D8zKl2eU.js.map +0 -1
  54. package/dist/index-D968kDLW.js.map +0 -1
  55. package/dist/services/storage/IDBStorage.d.ts +0 -90
@@ -1,27 +1,27 @@
1
1
  import { j as W, P as xr } from "./index-CvhkVj_L.js";
2
- const ot = () => {
2
+ const st = () => {
3
3
  let r, e;
4
4
  return { promise: new Promise((i, n) => {
5
5
  r = i, e = n;
6
6
  }), resolve: r, reject: e };
7
7
  };
8
- Promise.withResolvers || (Promise.withResolvers = ot);
8
+ Promise.withResolvers || (Promise.withResolvers = st);
9
9
  var Er = Object.defineProperty, x = (r, e) => Er(r, "name", { value: e, configurable: !0 });
10
10
  function Or() {
11
11
  }
12
12
  x(Or, "noop");
13
- function L(r) {
13
+ function T(r) {
14
14
  return r == null;
15
15
  }
16
- x(L, "isNullable");
17
- function Rr(r) {
18
- return !L(r);
16
+ x(T, "isNullable");
17
+ function $r(r) {
18
+ return !T(r);
19
19
  }
20
- x(Rr, "isNonNullable");
21
- function Te(r) {
20
+ x($r, "isNonNullable");
21
+ function Le(r) {
22
22
  return r && typeof r == "object" && !Array.isArray(r);
23
23
  }
24
- x(Te, "isPlainObject");
24
+ x(Le, "isPlainObject");
25
25
  function Dt(r, e) {
26
26
  return Object.fromEntries(Object.entries(r).filter(([t, i]) => e(t, i)));
27
27
  }
@@ -38,45 +38,45 @@ function Ut(r, e, t) {
38
38
  return i;
39
39
  }
40
40
  x(Ut, "pick");
41
- function $r(r, e) {
41
+ function Rr(r, e) {
42
42
  if (!e) return { ...r };
43
43
  const t = { ...r };
44
44
  for (const i of e)
45
45
  Reflect.deleteProperty(t, i);
46
46
  return t;
47
47
  }
48
- x($r, "omit");
49
- function U(r, e, t) {
48
+ x(Rr, "omit");
49
+ function D(r, e, t) {
50
50
  return Object.defineProperty(r, e, { writable: !0, value: t, enumerable: !1 });
51
51
  }
52
- x(U, "defineProperty");
53
- function Ar(r, e) {
52
+ x(D, "defineProperty");
53
+ function Pr(r, e) {
54
54
  return e.every((t) => r.includes(t));
55
55
  }
56
- x(Ar, "contain");
57
- function Pr(r, e) {
56
+ x(Pr, "contain");
57
+ function Ar(r, e) {
58
58
  return r.filter((t) => e.includes(t));
59
59
  }
60
- x(Pr, "intersection");
60
+ x(Ar, "intersection");
61
61
  function Ir(r, e) {
62
62
  return r.filter((t) => !e.includes(t));
63
63
  }
64
64
  x(Ir, "difference");
65
- function Lr(r, e) {
65
+ function Tr(r, e) {
66
66
  return Array.from(/* @__PURE__ */ new Set([...r, ...e]));
67
67
  }
68
- x(Lr, "union");
69
- function Tr(r) {
68
+ x(Tr, "union");
69
+ function Lr(r) {
70
70
  return [...new Set(r)];
71
71
  }
72
- x(Tr, "deduplicate");
72
+ x(Lr, "deduplicate");
73
73
  function ne(r, e) {
74
74
  const t = r?.indexOf(e);
75
75
  return t >= 0 ? (r.splice(t, 1), !0) : !1;
76
76
  }
77
77
  x(ne, "remove");
78
78
  function Cr(r) {
79
- return Array.isArray(r) ? r : L(r) ? [] : [r];
79
+ return Array.isArray(r) ? r : T(r) ? [] : [r];
80
80
  }
81
81
  x(Cr, "makeArray");
82
82
  function se(r, e) {
@@ -87,13 +87,13 @@ function Oe(r) {
87
87
  return se("ArrayBuffer", r) || se("SharedArrayBuffer", r);
88
88
  }
89
89
  x(Oe, "isArrayBufferLike");
90
- function Nt(r) {
90
+ function Mt(r) {
91
91
  return Oe(r) || ArrayBuffer.isView(r);
92
92
  }
93
- x(Nt, "isArrayBufferSource");
93
+ x(Mt, "isArrayBufferSource");
94
94
  var Q;
95
95
  ((r) => {
96
- r.is = Oe, r.isSource = Nt;
96
+ r.is = Oe, r.isSource = Mt;
97
97
  function e(o) {
98
98
  return ArrayBuffer.isView(o) ? o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength) : o;
99
99
  }
@@ -153,7 +153,7 @@ function Ce(r, e = /* @__PURE__ */ new Map()) {
153
153
  }
154
154
  x(Ce, "clone");
155
155
  function ce(r, e, t) {
156
- if (r === e || !t && L(r) && L(e)) return !0;
156
+ if (r === e || !t && T(r) && T(e)) return !0;
157
157
  if (typeof r != typeof e || typeof r != "object" || !r || !e) return !1;
158
158
  function i(n, s) {
159
159
  return n(r) ? n(e) ? s(r, e) : !1 : n(e) ? !1 : void 0;
@@ -171,15 +171,15 @@ function jr(r) {
171
171
  return r.charAt(0).toUpperCase() + r.slice(1);
172
172
  }
173
173
  x(jr, "capitalize");
174
- function Dr(r) {
174
+ function Nr(r) {
175
175
  return r.charAt(0).toLowerCase() + r.slice(1);
176
176
  }
177
- x(Dr, "uncapitalize");
178
- function Ur(r) {
177
+ x(Nr, "uncapitalize");
178
+ function Dr(r) {
179
179
  return r.replace(/[_-][a-z]/g, (e) => e.slice(1).toUpperCase());
180
180
  }
181
- x(Ur, "camelCase");
182
- function at(r, e, t) {
181
+ x(Dr, "camelCase");
182
+ function ot(r, e, t) {
183
183
  const i = [];
184
184
  let n = 0;
185
185
  for (let s = 0; s < r.length; s++) {
@@ -195,28 +195,28 @@ function at(r, e, t) {
195
195
  }
196
196
  return String.fromCharCode(...i);
197
197
  }
198
- x(at, "tokenize");
199
- function Nr(r) {
200
- return at(r, [45, 95], 45);
198
+ x(ot, "tokenize");
199
+ function Ur(r) {
200
+ return ot(r, [45, 95], 45);
201
201
  }
202
- x(Nr, "paramCase");
202
+ x(Ur, "paramCase");
203
203
  function Mr(r) {
204
- return at(r, [45, 95], 95);
204
+ return ot(r, [45, 95], 95);
205
205
  }
206
206
  x(Mr, "snakeCase");
207
207
  function Br(r) {
208
208
  return typeof r != "string" ? `[${r.toString()}]` : /^[a-z_$][\w$]*$/i.test(r) ? `.${r}` : `[${JSON.stringify(r)}]`;
209
209
  }
210
210
  x(Br, "formatProperty");
211
- function Mt(r) {
211
+ function Bt(r) {
212
212
  return r.replace(/\/$/, "");
213
213
  }
214
- x(Mt, "trimSlash");
214
+ x(Bt, "trimSlash");
215
215
  function Fr(r) {
216
- return r.startsWith("/") || (r = "/" + r), Mt(r);
216
+ return r.startsWith("/") || (r = "/" + r), Bt(r);
217
217
  }
218
218
  x(Fr, "sanitize");
219
- var St;
219
+ var kt;
220
220
  ((r) => {
221
221
  r.millisecond = 1, r.second = 1e3, r.minute = r.second * 60, r.hour = r.minute * 60, r.day = r.hour * 24, r.week = r.day * 7;
222
222
  let e = (/* @__PURE__ */ new Date()).getTimezoneOffset();
@@ -228,13 +228,13 @@ var St;
228
228
  return e;
229
229
  }
230
230
  r.getTimezoneOffset = i, x(i, "getTimezoneOffset");
231
- function n(g = /* @__PURE__ */ new Date(), v) {
232
- return typeof g == "number" && (g = new Date(g)), v === void 0 && (v = e), Math.floor((g.valueOf() / r.minute - v) / 1440);
231
+ function n(g = /* @__PURE__ */ new Date(), b) {
232
+ return typeof g == "number" && (g = new Date(g)), b === void 0 && (b = e), Math.floor((g.valueOf() / r.minute - b) / 1440);
233
233
  }
234
234
  r.getDateNumber = n, x(n, "getDateNumber");
235
- function s(g, v) {
236
- const R = new Date(g * r.day);
237
- return v === void 0 && (v = e), new Date(+R + v * r.minute);
235
+ function s(g, b) {
236
+ const $ = new Date(g * r.day);
237
+ return b === void 0 && (b = e), new Date(+$ + b * r.minute);
238
238
  }
239
239
  r.fromDateNumber = s, x(s, "fromDateNumber");
240
240
  const o = /\d+(?:\.\d+)?/.source, a = new RegExp(`^${[
@@ -245,30 +245,30 @@ var St;
245
245
  "s(?:ec(?:ond)?(?:s)?)?"
246
246
  ].map((g) => `(${o}${g})?`).join("")}$`);
247
247
  function c(g) {
248
- const v = a.exec(g);
249
- return v ? (parseFloat(v[1]) * r.week || 0) + (parseFloat(v[2]) * r.day || 0) + (parseFloat(v[3]) * r.hour || 0) + (parseFloat(v[4]) * r.minute || 0) + (parseFloat(v[5]) * r.second || 0) : 0;
248
+ const b = a.exec(g);
249
+ return b ? (parseFloat(b[1]) * r.week || 0) + (parseFloat(b[2]) * r.day || 0) + (parseFloat(b[3]) * r.hour || 0) + (parseFloat(b[4]) * r.minute || 0) + (parseFloat(b[5]) * r.second || 0) : 0;
250
250
  }
251
251
  r.parseTime = c, x(c, "parseTime");
252
252
  function u(g) {
253
- const v = c(g);
254
- return v ? g = Date.now() + v : /^\d{1,2}(:\d{1,2}){1,2}$/.test(g) ? g = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${g}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(g) && (g = `${(/* @__PURE__ */ new Date()).getFullYear()}-${g}`), g ? new Date(g) : /* @__PURE__ */ new Date();
253
+ const b = c(g);
254
+ return b ? g = Date.now() + b : /^\d{1,2}(:\d{1,2}){1,2}$/.test(g) ? g = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${g}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(g) && (g = `${(/* @__PURE__ */ new Date()).getFullYear()}-${g}`), g ? new Date(g) : /* @__PURE__ */ new Date();
255
255
  }
256
256
  r.parseDate = u, x(u, "parseDate");
257
257
  function p(g) {
258
- const v = Math.abs(g);
259
- return v >= r.day - r.hour / 2 ? Math.round(g / r.day) + "d" : v >= r.hour - r.minute / 2 ? Math.round(g / r.hour) + "h" : v >= r.minute - r.second / 2 ? Math.round(g / r.minute) + "m" : v >= r.second ? Math.round(g / r.second) + "s" : g + "ms";
258
+ const b = Math.abs(g);
259
+ return b >= r.day - r.hour / 2 ? Math.round(g / r.day) + "d" : b >= r.hour - r.minute / 2 ? Math.round(g / r.hour) + "h" : b >= r.minute - r.second / 2 ? Math.round(g / r.minute) + "m" : b >= r.second ? Math.round(g / r.second) + "s" : g + "ms";
260
260
  }
261
261
  r.format = p, x(p, "format");
262
- function y(g, v = 2) {
263
- return g.toString().padStart(v, "0");
262
+ function y(g, b = 2) {
263
+ return g.toString().padStart(b, "0");
264
264
  }
265
265
  r.toDigits = y, x(y, "toDigits");
266
- function w(g, v = /* @__PURE__ */ new Date()) {
267
- return g.replace("yyyy", v.getFullYear().toString()).replace("yy", v.getFullYear().toString().slice(2)).replace("MM", y(v.getMonth() + 1)).replace("dd", y(v.getDate())).replace("hh", y(v.getHours())).replace("mm", y(v.getMinutes())).replace("ss", y(v.getSeconds())).replace("SSS", y(v.getMilliseconds(), 3));
266
+ function w(g, b = /* @__PURE__ */ new Date()) {
267
+ return g.replace("yyyy", b.getFullYear().toString()).replace("yy", b.getFullYear().toString().slice(2)).replace("MM", y(b.getMonth() + 1)).replace("dd", y(b.getDate())).replace("hh", y(b.getHours())).replace("mm", y(b.getMinutes())).replace("ss", y(b.getSeconds())).replace("SSS", y(b.getMilliseconds(), 3));
268
268
  }
269
269
  r.template = w, x(w, "template");
270
- })(St || (St = {}));
271
- var qr = Object.defineProperty, k = (r, e) => qr(r, "name", { value: e, configurable: !0 }), _ = {
270
+ })(kt || (kt = {}));
271
+ var Hr = Object.defineProperty, k = (r, e) => Hr(r, "name", { value: e, configurable: !0 }), _ = {
272
272
  // internal symbols
273
273
  shadow: Symbol.for("cordis.shadow"),
274
274
  receiver: Symbol.for("cordis.receiver"),
@@ -290,39 +290,39 @@ var qr = Object.defineProperty, k = (r, e) => qr(r, "name", { value: e, configur
290
290
  provide: Symbol.for("cordis.provide"),
291
291
  immediate: Symbol.for("cordis.immediate")
292
292
  }, zr = function* () {
293
- }.constructor, kt = async function* () {
293
+ }.constructor, xt = async function* () {
294
294
  }.constructor;
295
- function ct(r) {
296
- return !(!r.prototype || r instanceof zr || kt !== Function && r instanceof kt);
295
+ function at(r) {
296
+ return !(!r.prototype || r instanceof zr || xt !== Function && r instanceof xt);
297
297
  }
298
- k(ct, "isConstructor");
299
- function Re(r, e) {
298
+ k(at, "isConstructor");
299
+ function $e(r, e) {
300
300
  const t = r.Config || r.schema;
301
301
  return t && r.schema !== !1 && (e = t(e)), e ?? {};
302
302
  }
303
- k(Re, "resolveConfig");
304
- function Bt(r) {
303
+ k($e, "resolveConfig");
304
+ function Ft(r) {
305
305
  return [Map, Set, Date, Promise].some((e) => r instanceof e);
306
306
  }
307
- k(Bt, "isUnproxyable");
308
- function lt(r, e) {
307
+ k(Ft, "isUnproxyable");
308
+ function ct(r, e) {
309
309
  if (r === Object.prototype) return e;
310
- const t = Object.create(lt(Object.getPrototypeOf(r), e));
310
+ const t = Object.create(ct(Object.getPrototypeOf(r), e));
311
311
  for (const i of Reflect.ownKeys(r))
312
312
  Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(r, i));
313
313
  return t;
314
314
  }
315
- k(lt, "joinPrototype");
316
- function ut(r) {
315
+ k(ct, "joinPrototype");
316
+ function lt(r) {
317
317
  return r && (typeof r == "object" || typeof r == "function");
318
318
  }
319
- k(ut, "isObject");
319
+ k(lt, "isObject");
320
320
  function Z(r, e, t) {
321
- if (!ut(e)) return e;
321
+ if (!lt(e)) return e;
322
322
  if (Object.hasOwn(e, _.shadow))
323
323
  return Object.getPrototypeOf(e);
324
324
  const i = e[_.tracker];
325
- return i ? ze(r, e, i, t) : e;
325
+ return i ? He(r, e, i, t) : e;
326
326
  }
327
327
  k(Z, "getTraceable");
328
328
  function xe(r, e) {
@@ -339,13 +339,13 @@ function je(r, e, t) {
339
339
  }));
340
340
  }
341
341
  k(je, "withProp");
342
- function Ge(r, e, t, i) {
342
+ function Ye(r, e, t, i) {
343
343
  if (!t) return i;
344
344
  const n = Reflect.getOwnPropertyDescriptor(e, t)?.value;
345
345
  return n ? je(i, t, r.extend({ [_.shadow]: n })) : i;
346
346
  }
347
- k(Ge, "createShadow");
348
- function Ft(r, e, t, i) {
347
+ k(Ye, "createShadow");
348
+ function Ht(r, e, t, i) {
349
349
  return new Proxy(e, {
350
350
  apply: /* @__PURE__ */ k((n, s, o) => (s === t && (s = i), o = o.map((a) => typeof a != "function" || a[_.original] ? a : new Proxy(a, {
351
351
  get: /* @__PURE__ */ k((c, u, p) => {
@@ -360,8 +360,8 @@ function Ft(r, e, t, i) {
360
360
  })), Z(r, Reflect.apply(n, s, o))), "apply")
361
361
  });
362
362
  }
363
- k(Ft, "createShadowMethod");
364
- function ze(r, e, t, i) {
363
+ k(Ht, "createShadowMethod");
364
+ function He(r, e, t, i) {
365
365
  r[_.shadow] && (r = Object.getPrototypeOf(r));
366
366
  const n = new Proxy(e, {
367
367
  get: /* @__PURE__ */ k((s, o, a) => {
@@ -371,8 +371,8 @@ function ze(r, e, t, i) {
371
371
  return Reflect.get(s, o, a);
372
372
  if (t.associate && r[_.internal][`${t.associate}.${o}`])
373
373
  return Reflect.get(r, `${t.associate}.${o}`, je(r, _.receiver, a));
374
- const c = Ge(r, s, t.property, a), u = Reflect.get(s, o, c), p = u?.[_.tracker];
375
- return p ? ze(r, u, p) : !i && typeof u == "function" ? Ft(r, u, a, c) : u;
374
+ const c = Ye(r, s, t.property, a), u = Reflect.get(s, o, c), p = u?.[_.tracker];
375
+ return p ? He(r, u, p) : !i && typeof u == "function" ? Ht(r, u, a, c) : u;
376
376
  }, "get"),
377
377
  set: /* @__PURE__ */ k((s, o, a, c) => {
378
378
  if (o === _.original || o === t.property) return !1;
@@ -380,29 +380,29 @@ function ze(r, e, t, i) {
380
380
  return Reflect.set(s, o, a, c);
381
381
  if (t.associate && r[_.internal][`${t.associate}.${o}`])
382
382
  return Reflect.set(r, `${t.associate}.${o}`, a, je(r, _.receiver, c));
383
- const u = Ge(r, s, t.property, c);
383
+ const u = Ye(r, s, t.property, c);
384
384
  return Reflect.set(s, o, a, u);
385
385
  }, "set"),
386
- apply: /* @__PURE__ */ k((s, o, a) => ht(n, s, o, a), "apply")
386
+ apply: /* @__PURE__ */ k((s, o, a) => ut(n, s, o, a), "apply")
387
387
  });
388
388
  return n;
389
389
  }
390
- k(ze, "createTraceable");
391
- function ht(r, e, t, i) {
390
+ k(He, "createTraceable");
391
+ function ut(r, e, t, i) {
392
392
  return e[_.invoke] ? e[_.invoke].apply(r, i) : Reflect.apply(e, t, i);
393
393
  }
394
- k(ht, "applyTraceable");
395
- function Xe(r, e, t) {
394
+ k(ut, "applyTraceable");
395
+ function Ge(r, e, t) {
396
396
  const i = /* @__PURE__ */ k(function(...n) {
397
- const s = ze(i.ctx, i, t);
398
- return ht(s, i, this, n);
397
+ const s = He(i.ctx, i, t);
398
+ return ut(s, i, this, n);
399
399
  }, "self");
400
- return U(i, "name", r), Object.setPrototypeOf(i, e);
400
+ return D(i, "name", r), Object.setPrototypeOf(i, e);
401
401
  }
402
- k(Xe, "createCallable");
403
- var Hr = class de {
402
+ k(Ge, "createCallable");
403
+ var qr = class de {
404
404
  constructor(e) {
405
- this.ctx = e, U(this, _.tracker, {
405
+ this.ctx = e, D(this, _.tracker, {
406
406
  associate: "reflect",
407
407
  property: "ctx"
408
408
  }), this._mixin("reflect", ["get", "set", "provide", "accessor", "mixin", "alias"]), this._mixin("scope", ["config", "runtime", "effect", "collect", "accept", "decline"]), this._mixin("registry", ["using", "inject", "plugin"]), this._mixin("lifecycle", ["on", "once", "parallel", "emit", "serial", "bail", "start", "stop"]);
@@ -455,12 +455,12 @@ var Hr = class de {
455
455
  let s = /* @__PURE__ */ k(() => {
456
456
  }, "dispose");
457
457
  if (n === t) return s;
458
- if (!L(t) && !L(n))
458
+ if (!T(t) && !T(n))
459
459
  throw new Error(`service ${e} has been registered`);
460
460
  const o = this.ctx;
461
- L(t) || (s = o.effect(() => () => {
461
+ T(t) || (s = o.effect(() => () => {
462
462
  o.set(e, void 0);
463
- })), Bt(t) && o.emit(o, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
463
+ })), Ft(t) && o.emit(o, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
464
464
  const a = Object.create(o);
465
465
  return a[_.filter] = (c) => o[_.isolate][e] === c[_.isolate][e], o.emit(a, "internal/before-service", e, t), o[_.store][i] = { value: t, source: o }, o.emit(a, "internal/service", e, n), s;
466
466
  }
@@ -468,7 +468,7 @@ var Hr = class de {
468
468
  const n = this.ctx.root[_.internal];
469
469
  if (e in n) return;
470
470
  const s = Symbol(e);
471
- n[e] = { type: "service", builtin: i }, this.ctx.root[_.isolate][e] = s, ut(t) && (this.ctx[_.store][s] = { value: t, source: null }, U(t, _.tracker, {
471
+ n[e] = { type: "service", builtin: i }, this.ctx.root[_.isolate][e] = s, lt(t) && (this.ctx[_.store][s] = { value: t, source: null }, D(t, _.tracker, {
472
472
  associate: e,
473
473
  property: "ctx"
474
474
  }));
@@ -491,7 +491,7 @@ var Hr = class de {
491
491
  const i = Array.isArray(t) ? t.map((o) => [o, o]) : Object.entries(t), n = typeof e == "string" ? (o) => o[e] : () => e, s = i.map(([o, a]) => this._accessor(a, {
492
492
  get(c) {
493
493
  const u = n(this);
494
- if (L(u)) return u;
494
+ if (T(u)) return u;
495
495
  const p = c ? xe(c, u) : u, y = Reflect.get(u, o, p);
496
496
  return typeof y != "function" ? y : y.bind(p ?? u);
497
497
  },
@@ -513,37 +513,37 @@ var Hr = class de {
513
513
  apply: /* @__PURE__ */ k((t, i, n) => t.apply(this.trace(i), n.map((s) => this.trace(s))), "apply")
514
514
  });
515
515
  }
516
- }, Ve = Hr;
517
- function Je(r) {
516
+ }, Xe = qr;
517
+ function Ve(r) {
518
518
  return r !== null && r !== !1 && r !== void 0;
519
519
  }
520
- k(Je, "isBailed");
520
+ k(Ve, "isBailed");
521
521
  var Kr = class {
522
522
  constructor(r) {
523
- this.ctx = r, U(this, _.tracker, {
523
+ this.ctx = r, D(this, _.tracker, {
524
524
  associate: "lifecycle",
525
525
  property: "ctx"
526
- }), U(this.on("internal/listener", function(t, i, n) {
526
+ }), D(this.on("internal/listener", function(t, i, n) {
527
527
  const s = n.prepend ? "unshift" : "push";
528
528
  if (t === "ready")
529
529
  return this.lifecycle.isActive ? (this.scope.ensure(async () => i()), () => !1) : void 0;
530
530
  if (t === "dispose")
531
- return this.scope.disposables[s](i), U(i, "name", "event <dispose>"), () => ne(this.scope.disposables, i);
531
+ return this.scope.disposables[s](i), D(i, "name", "event <dispose>"), () => ne(this.scope.disposables, i);
532
532
  if (t === "fork")
533
533
  return this.scope.runtime.forkables[s](i), this.scope.collect("event <fork>", () => ne(this.scope.runtime.forkables, i));
534
534
  }), z.static, r.scope);
535
535
  for (const t of ["info", "error", "warning"])
536
- U(this.on(`internal/${t}`, (i, ...n) => {
536
+ D(this.on(`internal/${t}`, (i, ...n) => {
537
537
  this._hooks[`internal/${t}`].length > 1;
538
538
  }), z.static, r.scope);
539
- U(this.on("internal/before-service", function(t) {
539
+ D(this.on("internal/before-service", function(t) {
540
540
  for (const i of this.registry.values()) {
541
541
  if (!i.inject[t]?.required) continue;
542
542
  const n = i.isReusable ? i.children : [i];
543
543
  for (const s of n)
544
544
  this[_.filter](s.ctx) && (s.updateStatus(), s.reset());
545
545
  }
546
- }, { global: !0 }), z.static, r.scope), U(this.on("internal/service", function(t) {
546
+ }, { global: !0 }), z.static, r.scope), D(this.on("internal/service", function(t) {
547
547
  for (const i of this.registry.values()) {
548
548
  if (!i.inject[t]?.required) continue;
549
549
  const n = i.isReusable ? i.children : [i];
@@ -554,10 +554,10 @@ var Kr = class {
554
554
  const e = /* @__PURE__ */ k((t, i) => {
555
555
  if (!t.runtime.plugin) return !1;
556
556
  for (const n in t.runtime.inject)
557
- if (i === Ve.resolveInject(t.ctx, n)[0]) return !0;
557
+ if (i === Xe.resolveInject(t.ctx, n)[0]) return !0;
558
558
  return e(t.parent.scope, i);
559
559
  }, "checkInject");
560
- U(this.on("internal/inject", function(t) {
560
+ D(this.on("internal/inject", function(t) {
561
561
  return e(this.scope, t);
562
562
  }, { global: !0 }), z.static, r.scope);
563
563
  }
@@ -591,11 +591,11 @@ var Kr = class {
591
591
  }
592
592
  async serial(...r) {
593
593
  for await (const e of this.dispatch("serial", r))
594
- if (Je(e)) return e;
594
+ if (Ve(e)) return e;
595
595
  }
596
596
  bail(...r) {
597
597
  for (const e of this.dispatch("bail", r))
598
- if (Je(e)) return e;
598
+ if (Ve(e)) return e;
599
599
  }
600
600
  register(r, e, t, i) {
601
601
  const n = i.prepend ? "unshift" : "push";
@@ -631,9 +631,9 @@ var Kr = class {
631
631
  async stop() {
632
632
  this.isActive = !1, this.ctx.scope.reset();
633
633
  }
634
- }, Wr = Kr, Qe = class qt extends Error {
634
+ }, Wr = Kr, Je = class zt extends Error {
635
635
  constructor(e, t) {
636
- super(t ?? qt.Code[e]), this.code = e;
636
+ super(t ?? zt.Code[e]), this.code = e;
637
637
  }
638
638
  static {
639
639
  k(this, "CordisError");
@@ -643,8 +643,8 @@ var Kr = class {
643
643
  r.Code = {
644
644
  INACTIVE_EFFECT: "cannot create effect on inactive context"
645
645
  };
646
- })(Qe || (Qe = {}));
647
- var zt = class {
646
+ })(Je || (Je = {}));
647
+ var qt = class {
648
648
  constructor(r, e) {
649
649
  this.parent = r, this.config = e, this.uid = r.registry ? r.registry.counter : 0, this.ctx = this.context = r.extend({ scope: this }), this.proxy = new Proxy({}, {
650
650
  get: /* @__PURE__ */ k((t, i) => Reflect.get(this.config, i), "get")
@@ -670,11 +670,11 @@ var zt = class {
670
670
  }
671
671
  assertActive() {
672
672
  if (!(this.uid !== null || this.isActive))
673
- throw new Qe("INACTIVE_EFFECT");
673
+ throw new Je("INACTIVE_EFFECT");
674
674
  }
675
675
  effect(r, e) {
676
676
  this.assertActive();
677
- const t = ct(r) ? new r(this.ctx, e) : r(this.ctx, e);
677
+ const t = at(r) ? new r(this.ctx, e) : r(this.ctx, e);
678
678
  let i = !1;
679
679
  const n = typeof t == "function" ? t : t.dispose.bind(t), s = /* @__PURE__ */ k((...o) => {
680
680
  if (!i)
@@ -683,7 +683,7 @@ var zt = class {
683
683
  return this.disposables.push(s), typeof t == "function" ? s : (t.dispose = s, t);
684
684
  }
685
685
  collect(r, e) {
686
- const t = U(() => (ne(this.disposables, t), e()), "name", r);
686
+ const t = D(() => (ne(this.disposables, t), e()), "name", r);
687
687
  return this.disposables.push(t), t;
688
688
  }
689
689
  restart() {
@@ -708,7 +708,7 @@ var zt = class {
708
708
  this.error = r, this.updateStatus(() => this.hasError = !0), this.reset();
709
709
  }
710
710
  get ready() {
711
- return Object.entries(this.runtime.inject).every(([r, e]) => !e.required || !L(this.ctx.get(r)));
711
+ return Object.entries(this.runtime.inject).every(([r, e]) => !e.required || !T(this.ctx.get(r)));
712
712
  }
713
713
  reset() {
714
714
  this.isActive = !1, this.disposables = this.disposables.splice(0).filter((r) => {
@@ -760,9 +760,9 @@ var zt = class {
760
760
  }
761
761
  return [s, o];
762
762
  }
763
- }, Yr = class extends zt {
763
+ }, Yr = class extends qt {
764
764
  constructor(r, e, t, i) {
765
- super(r, t), this.runtime = e, this.dispose = U(r.scope.collect(`fork <${r.runtime.name}>`, () => {
765
+ super(r, t), this.runtime = e, this.dispose = D(r.scope.collect(`fork <${r.runtime.name}>`, () => {
766
766
  this.uid = null, this.reset(), this.context.emit("internal/fork", this);
767
767
  const n = ne(e.disposables, this.dispose);
768
768
  return ne(e.children, this) && !e.children.length && r.registry.delete(e.plugin), n;
@@ -782,14 +782,14 @@ var zt = class {
782
782
  if (i.config !== t) return;
783
783
  let n;
784
784
  try {
785
- n = Re(this.runtime.plugin, r);
785
+ n = $e(this.runtime.plugin, r);
786
786
  } catch (a) {
787
787
  return this.context.emit("internal/error", a), this.cancel(a);
788
788
  }
789
789
  const [s, o] = i.checkUpdate(n, e);
790
790
  this.context.emit("internal/before-update", this, r), this.config = n, i.config = n, s && this.context.emit("internal/update", this, t), o && i.restart();
791
791
  }
792
- }, xt = class extends zt {
792
+ }, Et = class extends qt {
793
793
  constructor(r, e, t, i) {
794
794
  super(r, t), this.plugin = e, e ? (this.setup(), this.init(i)) : (this.name = "root", this.isActive = !0);
795
795
  }
@@ -821,7 +821,7 @@ var zt = class {
821
821
  apply = /* @__PURE__ */ k((r, e) => {
822
822
  if (typeof this.plugin != "function")
823
823
  return this.plugin.apply(r, e);
824
- if (ct(this.plugin)) {
824
+ if (at(this.plugin)) {
825
825
  const t = new this.plugin(r, e), i = t[z.expose];
826
826
  return i && r.set(i, t), t.fork && this.forkables.push(t.fork.bind(t)), t;
827
827
  } else
@@ -846,7 +846,7 @@ var zt = class {
846
846
  const t = this.config;
847
847
  let i;
848
848
  try {
849
- i = Re(this.runtime.plugin || this.context.constructor, r);
849
+ i = $e(this.runtime.plugin || this.context.constructor, r);
850
850
  } catch (a) {
851
851
  return this.context.emit("internal/error", a), this.cancel(a);
852
852
  }
@@ -854,10 +854,10 @@ var zt = class {
854
854
  this.config = i, o && (this.context.emit("internal/before-update", o, r), o.config = i, n && this.context.emit("internal/update", o, t)), s && this.restart();
855
855
  }
856
856
  };
857
- function Ht(r) {
857
+ function Kt(r) {
858
858
  return r && typeof r == "object" && typeof r.apply == "function";
859
859
  }
860
- k(Ht, "isApplicable");
860
+ k(Kt, "isApplicable");
861
861
  function le(r) {
862
862
  return function(e, t) {
863
863
  if (t.kind === "class")
@@ -887,11 +887,11 @@ k(le, "Inject");
887
887
  })(le || (le = {}));
888
888
  var Gr = class {
889
889
  constructor(r, e) {
890
- this.ctx = r, U(this, _.tracker, {
890
+ this.ctx = r, D(this, _.tracker, {
891
891
  associate: "registry",
892
892
  property: "ctx"
893
893
  }), this.context = r;
894
- const t = new xt(r, null, e);
894
+ const t = new Et(r, null, e);
895
895
  r.scope = t, t.ctx = r, this.set(null, t);
896
896
  }
897
897
  static {
@@ -908,7 +908,7 @@ var Gr = class {
908
908
  }
909
909
  resolve(r, e = !1) {
910
910
  if (r === null || typeof r == "function") return r;
911
- if (Ht(r)) return r.apply;
911
+ if (Kt(r)) return r.apply;
912
912
  if (e) throw new Error('invalid plugin, expect function or object with an "apply" method, received ' + typeof r);
913
913
  }
914
914
  get(r) {
@@ -949,12 +949,12 @@ var Gr = class {
949
949
  plugin(r, e, t) {
950
950
  if (this.resolve(r, !0), this.ctx.scope.assertActive(), !t)
951
951
  try {
952
- e = Re(r, e);
952
+ e = $e(r, e);
953
953
  } catch (n) {
954
954
  this.context.emit(this.ctx, "internal/error", n), t = n, e = null;
955
955
  }
956
956
  let i = this.get(r);
957
- return i ? (i.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${r.name}`)), i.fork(this.ctx, e, t)) : (i = new xt(this.ctx, r, e, t), this.set(r, i), i.fork(this.ctx, e, t));
957
+ return i ? (i.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${r.name}`)), i.fork(this.ctx, e, t)) : (i = new Et(this.ctx, r, e, t), this.set(r, i), i.fork(this.ctx, e, t));
958
958
  }
959
959
  }, Xr = Gr, z = class we {
960
960
  static {
@@ -981,15 +981,15 @@ var Gr = class {
981
981
  return e;
982
982
  }
983
983
  constructor(e) {
984
- e = Re(this.constructor, e), this[_.store] = /* @__PURE__ */ Object.create(null), this[_.isolate] = /* @__PURE__ */ Object.create(null), this[_.internal] = /* @__PURE__ */ Object.create(null), this[_.intercept] = /* @__PURE__ */ Object.create(null);
985
- const t = new Proxy(this, Ve.handler);
986
- t.root = t, t.reflect = new Ve(t), t.registry = new Xr(t, e), t.lifecycle = new Wr(t);
984
+ e = $e(this.constructor, e), this[_.store] = /* @__PURE__ */ Object.create(null), this[_.isolate] = /* @__PURE__ */ Object.create(null), this[_.internal] = /* @__PURE__ */ Object.create(null), this[_.intercept] = /* @__PURE__ */ Object.create(null);
985
+ const t = new Proxy(this, Xe.handler);
986
+ t.root = t, t.reflect = new Xe(t), t.registry = new Xr(t, e), t.lifecycle = new Wr(t);
987
987
  const i = /* @__PURE__ */ k((n) => {
988
988
  if (n) {
989
989
  i(Object.getPrototypeOf(n));
990
990
  for (const s of Object.getOwnPropertyNames(n)) {
991
991
  const o = n[s].prototype?.constructor;
992
- o && (t[n[s].key] = new o(t, e), U(t[n[s].key], "ctx", t));
992
+ o && (t[n[s].key] = new o(t, e), D(t[n[s].key], "ctx", t));
993
993
  }
994
994
  }
995
995
  }, "attach");
@@ -1025,7 +1025,7 @@ var Gr = class {
1025
1025
  }
1026
1026
  };
1027
1027
  z.prototype[z.internal] = /* @__PURE__ */ Object.create(null);
1028
- var he = class Kt {
1028
+ var he = class Wt {
1029
1029
  static {
1030
1030
  k(this, "Service");
1031
1031
  }
@@ -1050,7 +1050,7 @@ var he = class Kt {
1050
1050
  associate: i,
1051
1051
  property: "ctx"
1052
1052
  };
1053
- return o[_.invoke] && (o = Xe(i, lt(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[_.setup](), o.name = i, o.config = s, U(o, _.tracker, a), o.ctx.provide(i), o.ctx.runtime.name = i, n && (t ? o[_.expose] = i : o.ctx.set(i, o)), o.ctx.on("ready", async () => {
1053
+ return o[_.invoke] && (o = Ge(i, ct(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[_.setup](), o.name = i, o.config = s, D(o, _.tracker, a), o.ctx.provide(i), o.ctx.runtime.name = i, n && (t ? o[_.expose] = i : o.ctx.set(i, o)), o.ctx.on("ready", async () => {
1054
1054
  await Promise.resolve(), await o.start(), n || o.ctx.set(i, o);
1055
1055
  }), o.ctx.on("dispose", () => o.stop()), o;
1056
1056
  }
@@ -1062,7 +1062,7 @@ var he = class Kt {
1062
1062
  }
1063
1063
  [_.extend](e) {
1064
1064
  let t;
1065
- return this[Kt.invoke] ? t = Xe(this.name, this, this[_.tracker]) : t = Object.create(this), Object.assign(t, e);
1065
+ return this[Wt.invoke] ? t = Ge(this.name, this, this[_.tracker]) : t = Object.create(this), Object.assign(t, e);
1066
1066
  }
1067
1067
  static [Symbol.hasInstance](e) {
1068
1068
  let t = e.constructor;
@@ -1103,8 +1103,8 @@ var he = class Kt {
1103
1103
  if (f.refs) {
1104
1104
  const l = te(f.refs, (m) => new s(m)), d = /* @__PURE__ */ O((m) => l[m], "getRef");
1105
1105
  for (const m in l) {
1106
- const b = l[m];
1107
- b.sKey = d(b.sKey), b.inner = d(b.inner), b.list = b.list && b.list.map(d), b.dict = b.dict && te(b.dict, d);
1106
+ const v = l[m];
1107
+ v.sKey = d(v.sKey), v.inner = d(v.inner), v.list = v.list && v.list.map(d), v.dict = v.dict && te(v.dict, d);
1108
1108
  }
1109
1109
  return l[f.uid];
1110
1110
  }
@@ -1146,7 +1146,7 @@ var he = class Kt {
1146
1146
  }
1147
1147
  O(u, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ O(function(h) {
1148
1148
  const l = s(this), d = a(l.meta.description, h);
1149
- return Object.keys(d).length && (l.meta.description = d), l.dict && (l.dict = te(l.dict, (m, b) => m.i18n(te(h, (S) => c(S)?.[b] ?? S?.[b])))), l.list && (l.list = l.list.map((m, b) => m.i18n(te(h, (S = {}) => Array.isArray(c(S)) ? c(S)[b] : Array.isArray(S) ? S[b] : u(S))))), l.inner && (l.inner = l.inner.i18n(te(h, (m) => c(m) ? c(m) : u(m)))), l.sKey && (l.sKey = l.sKey.i18n(te(h, (m) => m?.$key))), l;
1149
+ return Object.keys(d).length && (l.meta.description = d), l.dict && (l.dict = te(l.dict, (m, v) => m.i18n(te(h, (S) => c(S)?.[v] ?? S?.[v])))), l.list && (l.list = l.list.map((m, v) => m.i18n(te(h, (S = {}) => Array.isArray(c(S)) ? c(S)[v] : Array.isArray(S) ? S[v] : u(S))))), l.inner && (l.inner = l.inner.i18n(te(h, (m) => c(m) ? c(m) : u(m)))), l.sKey && (l.sKey = l.sKey.i18n(te(h, (m) => m?.$key))), l;
1150
1150
  }, "i18n"), s.prototype.extra = /* @__PURE__ */ O(function(h, l) {
1151
1151
  const d = s(this);
1152
1152
  return d.meta = { ...d.meta, [h]: l }, d;
@@ -1169,18 +1169,18 @@ var he = class Kt {
1169
1169
  return l.meta = { ...l.meta, pattern: d }, l;
1170
1170
  }, "pattern"), s.prototype.simplify = /* @__PURE__ */ O(function(h) {
1171
1171
  if (ce(h, this.meta.default, this.type === "dict")) return null;
1172
- if (L(h)) return h;
1172
+ if (T(h)) return h;
1173
1173
  if (this.type === "object" || this.type === "dict") {
1174
1174
  const l = {};
1175
1175
  for (const d in h) {
1176
- const b = (this.type === "object" ? this.dict[d] : this.inner)?.simplify(h[d]);
1177
- (this.type === "dict" || !L(b)) && (l[d] = b);
1176
+ const v = (this.type === "object" ? this.dict[d] : this.inner)?.simplify(h[d]);
1177
+ (this.type === "dict" || !T(v)) && (l[d] = v);
1178
1178
  }
1179
1179
  return ce(l, this.meta.default, this.type === "dict") ? null : l;
1180
1180
  } else if (this.type === "array" || this.type === "tuple") {
1181
1181
  const l = [];
1182
1182
  return h.forEach((d, m) => {
1183
- const b = this.type === "array" ? this.inner : this.list[m], S = b ? b.simplify(d) : d;
1183
+ const v = this.type === "array" ? this.inner : this.list[m], S = v ? v.simplify(d) : d;
1184
1184
  l.push(S);
1185
1185
  }), l;
1186
1186
  } else if (this.type === "intersect") {
@@ -1214,24 +1214,24 @@ var he = class Kt {
1214
1214
  }, "extend"), s.resolve = /* @__PURE__ */ O(function(h, l, d = {}, m = !1) {
1215
1215
  if (!l) return [h];
1216
1216
  if (d.ignore?.(h, l)) return [h];
1217
- if (L(h) && l.type !== "lazy") {
1217
+ if (T(h) && l.type !== "lazy") {
1218
1218
  if (l.meta.required) throw new n("missing required value", d);
1219
1219
  let S = l, E = l.meta.default;
1220
- for (; S?.type === "intersect" && L(E); )
1220
+ for (; S?.type === "intersect" && T(E); )
1221
1221
  S = S.list[0], E = S?.meta.default;
1222
- if (L(E)) return [h];
1222
+ if (T(E)) return [h];
1223
1223
  h = Ce(E);
1224
1224
  }
1225
- const b = p[l.type];
1226
- if (!b) throw new n(`unsupported type "${l.type}"`, d);
1225
+ const v = p[l.type];
1226
+ if (!v) throw new n(`unsupported type "${l.type}"`, d);
1227
1227
  try {
1228
- return b(h, l, d, m);
1228
+ return v(h, l, d, m);
1229
1229
  } catch (S) {
1230
1230
  if (!l.meta.loose) throw S;
1231
1231
  return [l.meta.default];
1232
1232
  }
1233
1233
  }, "resolve"), s.from = /* @__PURE__ */ O(function(h) {
1234
- if (L(h))
1234
+ if (T(h))
1235
1235
  return s.any();
1236
1236
  if (["string", "number", "boolean"].includes(typeof h))
1237
1237
  return s.const(h).required();
@@ -1302,8 +1302,8 @@ var he = class Kt {
1302
1302
  throw new n(`expected ${h} but got ${f}`, l);
1303
1303
  });
1304
1304
  function y(f, h, l, d, m = !1) {
1305
- const { max: b = 1 / 0, min: S = -1 / 0 } = h;
1306
- if (f > b) throw new n(`expected ${l} <= ${b} but got ${f}`, d);
1305
+ const { max: v = 1 / 0, min: S = -1 / 0 } = h;
1306
+ if (f > v) throw new n(`expected ${l} <= ${v} but got ${f}`, d);
1307
1307
  if (f < S && !m) throw new n(`expected ${l} >= ${S} but got ${f}`, d);
1308
1308
  }
1309
1309
  O(y, "checkWithinRange"), s.extend("string", (f, { meta: h }, l) => {
@@ -1319,8 +1319,8 @@ var he = class Kt {
1319
1319
  if (l.includes("e")) return f * Math.pow(10, h);
1320
1320
  const d = l.indexOf(".");
1321
1321
  if (d === -1) return f * Math.pow(10, h);
1322
- const m = l.slice(d + 1), b = l.slice(0, d);
1323
- return m.length <= h ? +(b + m.padEnd(h, "0")) : +(b + m.slice(0, h) + "." + m.slice(h));
1322
+ const m = l.slice(d + 1), v = l.slice(0, d);
1323
+ return m.length <= h ? +(v + m.padEnd(h, "0")) : +(v + m.slice(0, h) + "." + m.slice(h));
1324
1324
  }
1325
1325
  O(w, "decimalShift");
1326
1326
  function g(f, h, l) {
@@ -1340,20 +1340,20 @@ var he = class Kt {
1340
1340
  if (typeof f == "boolean") return [f];
1341
1341
  throw new n(`expected boolean but got ${f}`, l);
1342
1342
  }), s.extend("bitset", (f, { bits: h, meta: l }, d) => {
1343
- let m = 0, b = [];
1343
+ let m = 0, v = [];
1344
1344
  if (typeof f == "number") {
1345
1345
  m = f;
1346
1346
  for (const S in h)
1347
- f & h[S] && b.push(S);
1347
+ f & h[S] && v.push(S);
1348
1348
  } else if (Array.isArray(f)) {
1349
- b = f;
1350
- for (const S of b) {
1349
+ v = f;
1350
+ for (const S of v) {
1351
1351
  if (typeof S != "string") throw new n(`expected string but got ${S}`, d);
1352
1352
  S in h && (m |= h[S]);
1353
1353
  }
1354
1354
  } else
1355
1355
  throw new n(`expected number or array but got ${f}`, d);
1356
- return m === l.default ? [m] : [m, b];
1356
+ return m === l.default ? [m] : [m, v];
1357
1357
  }), s.extend("function", (f, h, l) => {
1358
1358
  if (typeof f == "function") return [f];
1359
1359
  throw new n(`expected function but got ${f}`, l);
@@ -1362,7 +1362,7 @@ var he = class Kt {
1362
1362
  if (f instanceof h) return [f];
1363
1363
  throw new n(`expected ${h.name} but got ${f}`, l);
1364
1364
  } else {
1365
- if (L(f))
1365
+ if (T(f))
1366
1366
  throw new n(`expected ${h} but got ${f}`, l);
1367
1367
  let d = Object.getPrototypeOf(f);
1368
1368
  for (; d; ) {
@@ -1372,88 +1372,88 @@ var he = class Kt {
1372
1372
  throw new n(`expected ${h} but got ${f}`, l);
1373
1373
  }
1374
1374
  });
1375
- function v(f, h, l, d) {
1375
+ function b(f, h, l, d) {
1376
1376
  try {
1377
- const [m, b] = s.resolve(f[h], l, {
1377
+ const [m, v] = s.resolve(f[h], l, {
1378
1378
  ...d,
1379
1379
  path: [...d.path || [], h]
1380
1380
  });
1381
- return b !== void 0 && (f[h] = b), m;
1381
+ return v !== void 0 && (f[h] = v), m;
1382
1382
  } catch (m) {
1383
1383
  if (!d?.autofix) throw m;
1384
1384
  return delete f[h], l.meta.default;
1385
1385
  }
1386
1386
  }
1387
- O(v, "property"), s.extend("array", (f, { inner: h, meta: l }, d) => {
1387
+ O(b, "property"), s.extend("array", (f, { inner: h, meta: l }, d) => {
1388
1388
  if (!Array.isArray(f)) throw new n(`expected array but got ${f}`, d);
1389
- return y(f.length, l, "array length", d, !L(h.meta.default)), [f.map((m, b) => v(f, b, h, d))];
1389
+ return y(f.length, l, "array length", d, !T(h.meta.default)), [f.map((m, v) => b(f, v, h, d))];
1390
1390
  }), s.extend("dict", (f, { inner: h, sKey: l }, d, m) => {
1391
- if (!Te(f)) throw new n(`expected object but got ${f}`, d);
1392
- const b = {};
1391
+ if (!Le(f)) throw new n(`expected object but got ${f}`, d);
1392
+ const v = {};
1393
1393
  for (const S in f) {
1394
1394
  let E;
1395
1395
  try {
1396
1396
  E = s.resolve(S, l, d)[0];
1397
- } catch (N) {
1397
+ } catch (M) {
1398
1398
  if (m) continue;
1399
- throw N;
1399
+ throw M;
1400
1400
  }
1401
- b[E] = v(f, S, h, d), f[E] = f[S], S !== E && delete f[S];
1401
+ v[E] = b(f, S, h, d), f[E] = f[S], S !== E && delete f[S];
1402
1402
  }
1403
- return [b];
1403
+ return [v];
1404
1404
  }), s.extend("tuple", (f, { list: h }, l, d) => {
1405
1405
  if (!Array.isArray(f)) throw new n(`expected array but got ${f}`, l);
1406
- const m = h.map((b, S) => v(f, S, b, l));
1406
+ const m = h.map((v, S) => b(f, S, v, l));
1407
1407
  return d ? [m] : (m.push(...f.slice(h.length)), [m]);
1408
1408
  });
1409
- function R(f, h) {
1409
+ function $(f, h) {
1410
1410
  for (const l in h)
1411
1411
  l in f || (f[l] = h[l]);
1412
1412
  }
1413
- O(R, "merge"), s.extend("object", (f, { dict: h }, l, d) => {
1414
- if (!Te(f)) throw new n(`expected object but got ${f}`, l);
1413
+ O($, "merge"), s.extend("object", (f, { dict: h }, l, d) => {
1414
+ if (!Le(f)) throw new n(`expected object but got ${f}`, l);
1415
1415
  const m = {};
1416
- for (const b in h) {
1417
- const S = v(f, b, h[b], l);
1418
- (!L(S) || b in f) && (m[b] = S);
1416
+ for (const v in h) {
1417
+ const S = b(f, v, h[v], l);
1418
+ (!T(S) || v in f) && (m[v] = S);
1419
1419
  }
1420
- return d || R(m, f), [m];
1420
+ return d || $(m, f), [m];
1421
1421
  }), s.extend("union", (f, { list: h, toString: l }, d, m) => {
1422
- for (const b of h)
1422
+ for (const v of h)
1423
1423
  try {
1424
- return s.resolve(f, b, d, m);
1424
+ return s.resolve(f, v, d, m);
1425
1425
  } catch {
1426
1426
  }
1427
1427
  throw new n(`expected ${l()} but got ${JSON.stringify(f)}`, d);
1428
1428
  }), s.extend("intersect", (f, { list: h, toString: l }, d, m) => {
1429
1429
  if (!h.length) return [f];
1430
- let b;
1430
+ let v;
1431
1431
  for (const S of h) {
1432
1432
  const E = s.resolve(f, S, d, !0)[0];
1433
- if (!L(E))
1434
- if (L(b))
1435
- b = E;
1433
+ if (!T(E))
1434
+ if (T(v))
1435
+ v = E;
1436
1436
  else {
1437
- if (typeof b != typeof E)
1437
+ if (typeof v != typeof E)
1438
1438
  throw new n(`expected ${l()} but got ${JSON.stringify(f)}`, d);
1439
1439
  if (typeof E == "object")
1440
- R(b ??= {}, E);
1441
- else if (b !== E)
1440
+ $(v ??= {}, E);
1441
+ else if (v !== E)
1442
1442
  throw new n(`expected ${l()} but got ${JSON.stringify(f)}`, d);
1443
1443
  }
1444
1444
  }
1445
- return !m && Te(f) && R(b, f), [b];
1445
+ return !m && Le(f) && $(v, f), [v];
1446
1446
  }), s.extend("transform", (f, { inner: h, callback: l, preserve: d }, m) => {
1447
- const [b, S = f] = s.resolve(f, h, m, !0);
1448
- return d ? [l(b)] : [l(b), l(S)];
1447
+ const [v, S = f] = s.resolve(f, h, m, !0);
1448
+ return d ? [l(v)] : [l(v), l(S)];
1449
1449
  });
1450
1450
  var C = {};
1451
- function $(f, h, l) {
1451
+ function R(f, h, l) {
1452
1452
  C[f] = l, Object.assign(s, {
1453
1453
  [f](...d) {
1454
1454
  const m = new s({ type: f });
1455
- return h.forEach((b, S) => {
1456
- switch (b) {
1455
+ return h.forEach((v, S) => {
1456
+ switch (v) {
1457
1457
  case "sKey":
1458
1458
  m.sKey = d[S] ?? s.string();
1459
1459
  break;
@@ -1483,19 +1483,19 @@ var he = class Kt {
1483
1483
  break;
1484
1484
  }
1485
1485
  default:
1486
- m[b] = d[S];
1486
+ m[v] = d[S];
1487
1487
  }
1488
1488
  }), f === "object" || f === "dict" ? m.meta.default = {} : f === "array" || f === "tuple" ? m.meta.default = [] : f === "bitset" && (m.meta.default = 0), m;
1489
1489
  }
1490
1490
  });
1491
1491
  }
1492
- O($, "defineMethod"), $("is", ["constructor"], ({ constructor: f }) => typeof f == "function" ? f.name : f), $("any", [], () => "any"), $("never", [], () => "never"), $("const", ["value"], ({ value: f }) => typeof f == "string" ? JSON.stringify(f) : f), $("string", [], () => "string"), $("number", [], () => "number"), $("boolean", [], () => "boolean"), $("bitset", ["bits"], () => "bitset"), $("function", [], () => "function"), $("array", ["inner"], ({ inner: f }) => `${f.toString(!0)}[]`), $("dict", ["inner", "sKey"], ({ inner: f, sKey: h }) => `{ [key: ${h.toString()}]: ${f.toString()} }`), $("tuple", ["list"], ({ list: f }) => `[${f.map((h) => h.toString()).join(", ")}]`), $("object", ["dict"], ({ dict: f }) => Object.keys(f).length === 0 ? "{}" : `{ ${Object.entries(f).map(([h, l]) => `${h}${l.meta.required ? "" : "?"}: ${l.toString()}`).join(", ")} }`), $("union", ["list"], ({ list: f }, h) => {
1492
+ O(R, "defineMethod"), R("is", ["constructor"], ({ constructor: f }) => typeof f == "function" ? f.name : f), R("any", [], () => "any"), R("never", [], () => "never"), R("const", ["value"], ({ value: f }) => typeof f == "string" ? JSON.stringify(f) : f), R("string", [], () => "string"), R("number", [], () => "number"), R("boolean", [], () => "boolean"), R("bitset", ["bits"], () => "bitset"), R("function", [], () => "function"), R("array", ["inner"], ({ inner: f }) => `${f.toString(!0)}[]`), R("dict", ["inner", "sKey"], ({ inner: f, sKey: h }) => `{ [key: ${h.toString()}]: ${f.toString()} }`), R("tuple", ["list"], ({ list: f }) => `[${f.map((h) => h.toString()).join(", ")}]`), R("object", ["dict"], ({ dict: f }) => Object.keys(f).length === 0 ? "{}" : `{ ${Object.entries(f).map(([h, l]) => `${h}${l.meta.required ? "" : "?"}: ${l.toString()}`).join(", ")} }`), R("union", ["list"], ({ list: f }, h) => {
1493
1493
  const l = f.map(({ toString: d }) => d()).join(" | ");
1494
1494
  return h ? `(${l})` : l;
1495
- }), $("intersect", ["list"], ({ list: f }) => `${f.map((h) => h.toString(!0)).join(" & ")}`), $("transform", ["inner", "callback", "preserve"], ({ inner: f }, h) => f.toString(h)), e.exports = s;
1495
+ }), R("intersect", ["list"], ({ list: f }) => `${f.map((h) => h.toString(!0)).join(" & ")}`), R("transform", ["inner", "callback", "preserve"], ({ inner: f }, h) => f.toString(h)), e.exports = s;
1496
1496
  }
1497
1497
  });
1498
- const Ze = Zr();
1498
+ const Qe = Zr();
1499
1499
  /**
1500
1500
  * @inpageedit/logger
1501
1501
  *
@@ -1504,17 +1504,17 @@ const Ze = Zr();
1504
1504
  * @author dragon-fish <dragon-fish@qq.com>
1505
1505
  * @license MIT
1506
1506
  */
1507
- var Wt = /* @__PURE__ */ ((r) => (r[r.debug = -1] = "debug", r[r.log = 0] = "log", r[r.info = 1] = "info", r[r.warn = 2] = "warn", r[r.error = 3] = "error", r[r.silent = 4] = "silent", r))(Wt || {});
1508
- const et = globalThis || window, tt = Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1509
- et[tt] || (et[tt] = /* @__PURE__ */ new Map());
1510
- const We = et[tt];
1511
- function Pe(r) {
1507
+ var Yt = /* @__PURE__ */ ((r) => (r[r.debug = -1] = "debug", r[r.log = 0] = "log", r[r.info = 1] = "info", r[r.warn = 2] = "warn", r[r.error = 3] = "error", r[r.silent = 4] = "silent", r))(Yt || {});
1508
+ const Ze = globalThis || window, et = Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1509
+ Ze[et] || (Ze[et] = /* @__PURE__ */ new Map());
1510
+ const Ke = Ze[et];
1511
+ function Ae(r) {
1512
1512
  let e = 2166136261;
1513
1513
  for (let t = 0; t < r.length; t++)
1514
1514
  e ^= r.charCodeAt(t), e = (e >>> 0) * 16777619;
1515
1515
  return e >>> 0;
1516
1516
  }
1517
- const Et = [
1517
+ const Ot = [
1518
1518
  [350, 360],
1519
1519
  [0, 15],
1520
1520
  [15, 30],
@@ -1527,23 +1527,23 @@ const Et = [
1527
1527
  [160, 180]
1528
1528
  ];
1529
1529
  function ei(r, e) {
1530
- const t = Et.length, i = Pe(r) % t, [n, s] = Et[i], o = s - n, a = Pe(r + ":" + e), c = n + a % (o || 1), u = Pe(r + ":s"), p = Pe(r + ":l");
1530
+ const t = Ot.length, i = Ae(r) % t, [n, s] = Ot[i], o = s - n, a = Ae(r + ":" + e), c = n + a % (o || 1), u = Ae(r + ":s"), p = Ae(r + ":l");
1531
1531
  let y, w;
1532
1532
  if (e === "name")
1533
1533
  y = 62 + u % 18, w = 30 + p % 12;
1534
1534
  else {
1535
- const g = c >= 0 && c < 50 || c > 330 && c < 360, v = c >= 200 && c <= 300;
1536
- y = 55 + u % 20, v ? w = 55 + p % 8 : g ? w = 48 + p % 6 : w = 50 + p % 8, y < 60 && (y += 5);
1535
+ const g = c >= 0 && c < 50 || c > 330 && c < 360, b = c >= 200 && c <= 300;
1536
+ y = 55 + u % 20, b ? w = 55 + p % 8 : g ? w = 48 + p % 6 : w = 50 + p % 8, y < 60 && (y += 5);
1537
1537
  }
1538
1538
  return `hsl(${c}, ${y}%, ${w}%)`;
1539
1539
  }
1540
1540
  function Ie(r, e) {
1541
1541
  if (e)
1542
- return We.set(r, e), e;
1543
- const t = We.get(r);
1542
+ return Ke.set(r, e), e;
1543
+ const t = Ke.get(r);
1544
1544
  if (t) return t;
1545
1545
  const i = r.startsWith("name:") ? "name" : "group", n = ei(r, i);
1546
- return We.set(r, n), n;
1546
+ return Ke.set(r, n), n;
1547
1547
  }
1548
1548
  /**
1549
1549
  * @inpageedit/logger
@@ -1565,13 +1565,13 @@ function Ie(r, e) {
1565
1565
  * logger.success('User created successfully')
1566
1566
  * ```
1567
1567
  */
1568
- let ti = class Yt {
1568
+ let ti = class Gt {
1569
1569
  /**
1570
1570
  * Note: constructor returns a callable Proxy so that you can do `logger('group')`.
1571
1571
  */
1572
1572
  constructor(e = {}) {
1573
1573
  this._custom = (t) => {
1574
- if (!this._enabled(t.level)) return Ot;
1574
+ if (!this._enabled(t.level)) return $t;
1575
1575
  const [i, n] = this._prefix(t.label);
1576
1576
  return this._consoleMethod(t.method).bind(console, i, ...n);
1577
1577
  }, this._name = e.name, this._nameColor = e.color, this._groupPath = e._groupPath ? [...e._groupPath] : [], this._dynamicLevels = { ...e._dynamicLevels }, this._levelRef = e._levelRef ?? {
@@ -1591,7 +1591,7 @@ let ti = class Yt {
1591
1591
  }
1592
1592
  /** Create a sub-logger with a group label */
1593
1593
  group(e, t) {
1594
- return e && Ie(`group:${e}`, t?.color), new Yt({
1594
+ return e && Ie(`group:${e}`, t?.color), new Gt({
1595
1595
  name: this._name,
1596
1596
  color: this._nameColor,
1597
1597
  _groupPath: [...this._groupPath, e],
@@ -1631,7 +1631,7 @@ let ti = class Yt {
1631
1631
  }
1632
1632
  _method(e) {
1633
1633
  const t = ri[e];
1634
- if (!this._enabled(t.level)) return Ot;
1634
+ if (!this._enabled(t.level)) return $t;
1635
1635
  const [i, n] = this._prefix(t.label);
1636
1636
  return this._consoleMethod(e).bind(console, i, ...n);
1637
1637
  }
@@ -1658,7 +1658,7 @@ let ti = class Yt {
1658
1658
  return [i, t];
1659
1659
  }
1660
1660
  };
1661
- const Ot = () => {
1661
+ const $t = () => {
1662
1662
  }, Rt = "color:inherit; background:transparent; text-decoration:none;", ri = {
1663
1663
  debug: { level: -1, label: "", method: "debug" },
1664
1664
  log: { level: 0, label: "", method: "log" },
@@ -1689,24 +1689,25 @@ function ni(r) {
1689
1689
  return new ti(r);
1690
1690
  }
1691
1691
  var Y = /* @__PURE__ */ ((r) => (r.BODY_USED = "BODY_USED", r.NO_BODY_READER = "NO_BODY_READER", r.TIMEOUT = "TIMEOUT", r.NETWORK_ERROR = "NETWORK_ERROR", r.BODY_NOT_ALLOWED = "BODY_NOT_ALLOWED", r.HOOK_CONTEXT_CHANGED = "HOOK_CONTEXT_CHANGED", r.ABORTED_BY_HOOK = "ABORTED_BY_HOOK", r.INVALID_HOOK_CALLBACK = "INVALID_HOOK_CALLBACK", r.UNEXPECTED_HOOK_RETURN = "UNEXPECTED_HOOK_RETURN", r))(Y || {});
1692
- let F = class Gt extends Error {
1692
+ let F = class Xt extends Error {
1693
1693
  constructor(e, t, i, n) {
1694
1694
  super(t, n), this.code = e, this.context = i;
1695
1695
  }
1696
1696
  name = "FexiosError";
1697
1697
  static is(e) {
1698
- return e?.constructor === Gt;
1698
+ return e?.constructor === Xt;
1699
1699
  }
1700
- }, si = class Xt extends F {
1700
+ };
1701
+ class ht extends F {
1701
1702
  constructor(e, t, i) {
1702
1703
  super(t.statusText, e, void 0, i), this.response = t;
1703
1704
  }
1704
1705
  name = "FexiosResponseError";
1705
1706
  static is(e) {
1706
- return e?.constructor === Xt;
1707
+ return e?.constructor === ht;
1707
1708
  }
1708
- };
1709
- function oi(r, e = 2048) {
1709
+ }
1710
+ function si(r, e = 2048) {
1710
1711
  if (!(r instanceof Uint8Array))
1711
1712
  throw new TypeError("Input must be a Uint8Array");
1712
1713
  if (r.length === 0)
@@ -1715,23 +1716,23 @@ function oi(r, e = 2048) {
1715
1716
  Math.max(r.length, 256),
1716
1717
  e
1717
1718
  ), i = r.slice(0, t);
1718
- if (ai(i))
1719
+ if (oi(i))
1719
1720
  return !1;
1720
- const n = ci(i);
1721
+ const n = ai(i);
1721
1722
  if (n.nullByteRatio > 0.05 || n.highByteRatio > 0.95)
1722
1723
  return !1;
1723
1724
  const s = ["utf-8", "utf-16le", "utf-16be", "iso-8859-1"];
1724
1725
  let o = -1, a = !1;
1725
1726
  for (const c of s)
1726
1727
  try {
1727
- const u = new TextDecoder(c, { fatal: !0 }).decode(i), p = li(u);
1728
+ const u = new TextDecoder(c, { fatal: !0 }).decode(i), p = ci(u);
1728
1729
  p > o && (o = p, a = p > 0.7);
1729
1730
  } catch {
1730
1731
  continue;
1731
1732
  }
1732
1733
  return a;
1733
1734
  }
1734
- function ai(r) {
1735
+ function oi(r) {
1735
1736
  if (r.length < 4) return !1;
1736
1737
  const e = [
1737
1738
  [137, 80, 78, 71],
@@ -1771,7 +1772,7 @@ function ai(r) {
1771
1772
  }
1772
1773
  return !1;
1773
1774
  }
1774
- function ci(r) {
1775
+ function ai(r) {
1775
1776
  let e = 0, t = 0, i = 0;
1776
1777
  for (const n of r)
1777
1778
  n === 0 && e++, n > 127 && t++, (n < 32 && n !== 9 && n !== 10 && n !== 13 || n === 127) && i++;
@@ -1781,23 +1782,23 @@ function ci(r) {
1781
1782
  controlCharRatio: i / r.length
1782
1783
  };
1783
1784
  }
1784
- function li(r) {
1785
+ function ci(r) {
1785
1786
  if (r.length === 0) return 1;
1786
1787
  let e = 1, t = 0;
1787
1788
  for (let n = 0; n < r.length; n++) {
1788
1789
  const s = r[n].charCodeAt(0);
1789
- s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !ui(s) && !hi(s) && t++ : e -= 0.1;
1790
+ s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !li(s) && !ui(s) && t++ : e -= 0.1;
1790
1791
  }
1791
1792
  const i = t / r.length;
1792
- return e *= i, fi(r) && (e *= 1.1), Math.max(0, Math.min(1, e));
1793
+ return e *= i, hi(r) && (e *= 1.1), Math.max(0, Math.min(1, e));
1793
1794
  }
1794
- function ui(r) {
1795
+ function li(r) {
1795
1796
  return r >= 0 && r <= 31 || r >= 127 && r <= 159;
1796
1797
  }
1797
- function hi(r) {
1798
+ function ui(r) {
1798
1799
  return r >= 57344 && r <= 63743 || r >= 983040 && r <= 1048573 || r >= 1048576 && r <= 1114109;
1799
1800
  }
1800
- function fi(r) {
1801
+ function hi(r) {
1801
1802
  return [
1802
1803
  /\b\w+\b/,
1803
1804
  // Words
@@ -1813,7 +1814,7 @@ function fi(r) {
1813
1814
  // Numbers
1814
1815
  ].some((e) => e.test(r));
1815
1816
  }
1816
- function X(r) {
1817
+ function V(r) {
1817
1818
  if (typeof r != "object" || r === null || Object.prototype.toString.call(r) !== "[object Object]")
1818
1819
  return !1;
1819
1820
  const e = Object.getPrototypeOf(r);
@@ -1822,7 +1823,7 @@ function X(r) {
1822
1823
  const _e = (r, ...e) => {
1823
1824
  const t = (n) => {
1824
1825
  if (Array.isArray(n)) return n.slice();
1825
- if (X(n)) {
1826
+ if (V(n)) {
1826
1827
  const s = {};
1827
1828
  for (const o of Reflect.ownKeys(n)) s[o] = t(n[o]);
1828
1829
  return s;
@@ -1835,7 +1836,7 @@ const _e = (r, ...e) => {
1835
1836
  const o = n[s];
1836
1837
  if (typeof o > "u") continue;
1837
1838
  const a = i[s];
1838
- X(a) && X(o) ? i[s] = _e(a, o) : i[s] = t(o);
1839
+ V(a) && V(o) ? i[s] = _e(a, o) : i[s] = t(o);
1839
1840
  }
1840
1841
  return i;
1841
1842
  };
@@ -1850,13 +1851,13 @@ let be = class {
1850
1851
  statusText;
1851
1852
  headers;
1852
1853
  };
1853
- async function $t(r, e, t) {
1854
+ async function Pt(r, e, t) {
1854
1855
  if (r.bodyUsed)
1855
1856
  throw new F(
1856
1857
  Y.BODY_USED,
1857
1858
  "Response body has already been used or locked"
1858
1859
  );
1859
- const i = r.headers.get("content-type") || "", n = Number(r.headers.get("content-length")) || 0, s = (a, c) => c === "json" || a.startsWith("application/json"), o = (a, c, u) => u === "blob" || a.startsWith("image/") && !a.startsWith("image/svg") || a.startsWith("video/") || a.startsWith("audio/") || !oi(c);
1860
+ const i = r.headers.get("content-type") || "", n = Number(r.headers.get("content-length")) || 0, s = (a, c) => c === "json" || a.startsWith("application/json"), o = (a, c, u) => u === "blob" || a.startsWith("image/") && !a.startsWith("image/svg") || a.startsWith("video/") || a.startsWith("audio/") || !si(c);
1860
1861
  if ((r.status === 101 || r.status === 426 || r.headers.get("upgrade")) && typeof globalThis.WebSocket < "u") {
1861
1862
  const a = new WebSocket(r.url);
1862
1863
  return await new Promise((c, u) => {
@@ -1914,14 +1915,14 @@ async function $t(r, e, t) {
1914
1915
  }
1915
1916
  if (typeof u.data > "u" && (u.data = c.length > 0 ? c : void 0), u.ok)
1916
1917
  return u;
1917
- throw new si(
1918
+ throw new ht(
1918
1919
  `Request failed with status code ${r.status}`,
1919
1920
  u
1920
1921
  );
1921
1922
  }
1922
1923
  }
1923
1924
  }
1924
- var De;
1925
+ var Ne;
1925
1926
  ((r) => {
1926
1927
  r.makeSearchParams = (n) => {
1927
1928
  if (!n)
@@ -1943,15 +1944,15 @@ var De;
1943
1944
  if (typeof p == "object" && p.constructor === Object) {
1944
1945
  for (const [y, w] of Object.entries(p)) {
1945
1946
  if (w == null) continue;
1946
- const g = y.endsWith("[]"), v = g ? y.slice(0, -2) : y, R = `${u}[${v}]`;
1947
+ const g = y.endsWith("[]"), b = g ? y.slice(0, -2) : y, $ = `${u}[${b}]`;
1947
1948
  if (g) {
1948
- const C = `${R}[]`;
1949
+ const C = `${$}[]`;
1949
1950
  if (Array.isArray(w))
1950
- for (const $ of w) o(C, $?.toString());
1951
- else typeof w == "object" && w !== null && w.constructor === Object ? c(`${R}[]`, w) : o(C, w?.toString());
1951
+ for (const R of w) o(C, R?.toString());
1952
+ else typeof w == "object" && w !== null && w.constructor === Object ? c(`${$}[]`, w) : o(C, w?.toString());
1952
1953
  } else if (Array.isArray(w))
1953
- for (const C of w) o(R, C?.toString());
1954
- else typeof w == "object" && w !== null && w.constructor === Object ? c(R, w) : a(R, w?.toString());
1954
+ for (const C of w) o($, C?.toString());
1955
+ else typeof w == "object" && w !== null && w.constructor === Object ? c($, w) : a($, w?.toString());
1955
1956
  }
1956
1957
  return;
1957
1958
  }
@@ -1976,8 +1977,8 @@ var De;
1976
1977
  }, a = (c, u, p, y) => {
1977
1978
  let w = c;
1978
1979
  for (let g = 0; g < u.length; g++) {
1979
- const v = u[g];
1980
- g === u.length - 1 ? y ? w[v] === void 0 ? w[v] = [p] : Array.isArray(w[v]) ? w[v].push(p) : w[v] = [w[v], p] : w[v] === void 0 ? w[v] = p : Array.isArray(w[v]) ? w[v].push(p) : w[v] = [w[v], p] : ((w[v] === void 0 || typeof w[v] != "object" || Array.isArray(w[v])) && (w[v] = {}), w = w[v]);
1980
+ const b = u[g];
1981
+ g === u.length - 1 ? y ? w[b] === void 0 ? w[b] = [p] : Array.isArray(w[b]) ? w[b].push(p) : w[b] = [w[b], p] : w[b] === void 0 ? w[b] = p : Array.isArray(w[b]) ? w[b].push(p) : w[b] = [w[b], p] : ((w[b] === void 0 || typeof w[b] != "object" || Array.isArray(w[b])) && (w[b] = {}), w = w[b]);
1981
1982
  }
1982
1983
  };
1983
1984
  for (const [c, u] of n.entries()) {
@@ -2003,7 +2004,7 @@ var De;
2003
2004
  };
2004
2005
  function e(n) {
2005
2006
  if (Array.isArray(n)) return n.map(e);
2006
- if (X(n)) {
2007
+ if (V(n)) {
2007
2008
  const s = {};
2008
2009
  for (const [o, a] of Object.entries(n)) s[o] = e(a);
2009
2010
  return s;
@@ -2020,7 +2021,7 @@ var De;
2020
2021
  if (n instanceof URLSearchParams || n instanceof FormData || n instanceof Map)
2021
2022
  return (0, r.toQueryRecord)(n);
2022
2023
  if (typeof n == "string") return (0, r.toQueryRecord)((0, r.fromString)(n));
2023
- if (X(n)) return n;
2024
+ if (V(n)) return n;
2024
2025
  throw new TypeError(
2025
2026
  `unsupported type transformation, got: ${Object.prototype.toString.call(
2026
2027
  n
@@ -2035,10 +2036,10 @@ var De;
2035
2036
  continue;
2036
2037
  }
2037
2038
  const c = n[o];
2038
- X(c) && X(a) ? i(c, a) : n[o] = e(a);
2039
+ V(c) && V(a) ? i(c, a) : n[o] = e(a);
2039
2040
  }
2040
2041
  }
2041
- })(De || (De = {}));
2042
+ })(Ne || (Ne = {}));
2042
2043
  const Vt = function(r) {
2043
2044
  const e = this.constructor.prototype, t = Reflect.get(e, r, e);
2044
2045
  function i(...n) {
@@ -2068,7 +2069,7 @@ var Se;
2068
2069
  t.append(i, String(n));
2069
2070
  return t;
2070
2071
  }
2071
- if (X(e)) {
2072
+ if (V(e)) {
2072
2073
  for (const [i, n] of Object.entries(e))
2073
2074
  if (n != null)
2074
2075
  if (Array.isArray(n))
@@ -2130,7 +2131,7 @@ var Se;
2130
2131
  });
2131
2132
  continue;
2132
2133
  }
2133
- if (X(s)) {
2134
+ if (V(s)) {
2134
2135
  n(s);
2135
2136
  continue;
2136
2137
  }
@@ -2143,7 +2144,7 @@ var Se;
2143
2144
  return i;
2144
2145
  };
2145
2146
  })(Se || (Se = {}));
2146
- let rt = class D extends Vt {
2147
+ let tt = class N extends Vt {
2147
2148
  static FINAL_SYMBOL = Symbol("FEXIOS_FINAL_CONTEXT");
2148
2149
  static NORMALIZED_SYMBOL = Symbol("FEXIOS_NORMALIZED_QUERY");
2149
2150
  baseConfigs;
@@ -2174,7 +2175,7 @@ let rt = class D extends Vt {
2174
2175
  "trace"
2175
2176
  ];
2176
2177
  constructor(e = {}) {
2177
- super("request"), this.baseConfigs = _e(D.DEFAULT_CONFIGS, e), D.ALL_METHODS.forEach(
2178
+ super("request"), this.baseConfigs = _e(N.DEFAULT_CONFIGS, e), N.ALL_METHODS.forEach(
2178
2179
  (t) => this.createMethodShortcut(t.toLowerCase())
2179
2180
  );
2180
2181
  }
@@ -2183,8 +2184,8 @@ let rt = class D extends Vt {
2183
2184
  if (typeof e == "string" || e instanceof URL ? i.url = e.toString() : typeof e == "object" && (i = _e(e, i)), i = await this.emit("beforeInit", i, {
2184
2185
  shouldAdjustRequestParams: !0,
2185
2186
  shouldHandleShortCircuitResponse: !0
2186
- }), i[D.FINAL_SYMBOL]) return i;
2187
- if (D.METHODS_WITHOUT_BODY.includes(
2187
+ }), i[N.FINAL_SYMBOL]) return i;
2188
+ if (N.METHODS_WITHOUT_BODY.includes(
2188
2189
  i.method?.toLocaleLowerCase()
2189
2190
  ) && i.body)
2190
2191
  throw new F(
@@ -2198,7 +2199,7 @@ let rt = class D extends Vt {
2198
2199
  requestOptionsOverridesURLSearchParams: !0,
2199
2200
  preRequestOptionsOverridesURLSearchParams: !0,
2200
2201
  postRequestOptionsOverridesURLSearchParams: !0
2201
- }), i[D.FINAL_SYMBOL]) return i;
2202
+ }), i[N.FINAL_SYMBOL]) return i;
2202
2203
  let n;
2203
2204
  const s = {};
2204
2205
  if (typeof i.body < "u" && i.body !== null && (i.body instanceof Blob || i.body instanceof FormData || i.body instanceof URLSearchParams ? n = i.body : typeof i.body == "object" && i.body !== null ? (n = JSON.stringify(i.body), i.headers = this.mergeHeaders(i.headers, {
@@ -2210,11 +2211,11 @@ let rt = class D extends Vt {
2210
2211
  shouldHandleShortCircuitResponse: !0,
2211
2212
  preAdjust: !0,
2212
2213
  postRequestOptionsOverridesURLSearchParams: !0
2213
- }), i[D.FINAL_SYMBOL]) return i;
2214
+ }), i[N.FINAL_SYMBOL]) return i;
2214
2215
  const o = i.abortController || globalThis.AbortController ? new AbortController() : void 0, a = i.baseURL || this.baseConfigs.baseURL || globalThis.location?.href || "http://localhost", c = new URL(
2215
2216
  i.url.toString(),
2216
2217
  a
2217
- ), u = De.makeURL(
2218
+ ), u = Ne.makeURL(
2218
2219
  c,
2219
2220
  i.query,
2220
2221
  c.hash
@@ -2233,14 +2234,14 @@ let rt = class D extends Vt {
2233
2234
  });
2234
2235
  if (i.rawRequest = p, i = await this.emit("beforeActualFetch", i, {
2235
2236
  shouldHandleShortCircuitResponse: !0
2236
- }), i[D.FINAL_SYMBOL]) return i;
2237
+ }), i[N.FINAL_SYMBOL]) return i;
2237
2238
  const y = i.timeout || this.baseConfigs.timeout || 60 * 1e3;
2238
2239
  if (i.url.startsWith("ws"))
2239
2240
  try {
2240
2241
  const g = new WebSocket(i.url);
2241
- return await new Promise((v, R) => {
2242
+ return await new Promise((b, $) => {
2242
2243
  const C = setTimeout(() => {
2243
- R(
2244
+ $(
2244
2245
  new F(
2245
2246
  Y.TIMEOUT,
2246
2247
  `WebSocket connection timed out after ${y}ms`,
@@ -2249,20 +2250,20 @@ let rt = class D extends Vt {
2249
2250
  );
2250
2251
  }, y);
2251
2252
  g.onopen = () => {
2252
- clearTimeout(C), v();
2253
- }, g.onerror = ($) => {
2254
- clearTimeout(C), R(
2253
+ clearTimeout(C), b();
2254
+ }, g.onerror = (R) => {
2255
+ clearTimeout(C), $(
2255
2256
  new F(
2256
2257
  Y.NETWORK_ERROR,
2257
2258
  "WebSocket connection failed",
2258
2259
  i
2259
2260
  )
2260
2261
  );
2261
- }, g.onclose = ($) => {
2262
- $.code !== 1e3 && (clearTimeout(C), R(
2262
+ }, g.onclose = (R) => {
2263
+ R.code !== 1e3 && (clearTimeout(C), $(
2263
2264
  new F(
2264
2265
  Y.NETWORK_ERROR,
2265
- `WebSocket closed with code ${$.code}`,
2266
+ `WebSocket closed with code ${R.code}`,
2266
2267
  i
2267
2268
  )
2268
2269
  ));
@@ -2284,31 +2285,31 @@ let rt = class D extends Vt {
2284
2285
  o && (w = setTimeout(() => {
2285
2286
  o.abort();
2286
2287
  }, y));
2287
- const g = await (t.fetch || this.baseConfigs.fetch || globalThis.fetch)(i.rawRequest).catch((v) => {
2288
+ const g = await (t.fetch || this.baseConfigs.fetch || globalThis.fetch)(i.rawRequest).catch((b) => {
2288
2289
  throw w && clearTimeout(w), o?.signal.aborted ? new F(
2289
2290
  Y.TIMEOUT,
2290
2291
  `Request timed out after ${y}ms`,
2291
2292
  i
2292
- ) : new F(Y.NETWORK_ERROR, v.message, i);
2293
+ ) : new F(Y.NETWORK_ERROR, b.message, i);
2293
2294
  });
2294
- return w && clearTimeout(w), i.rawResponse = g, i.response = await $t(
2295
+ return w && clearTimeout(w), i.rawResponse = g, i.response = await Pt(
2295
2296
  g,
2296
2297
  i.responseType,
2297
- (v, R) => {
2298
- t?.onProgress?.(v, R);
2298
+ (b, $) => {
2299
+ t?.onProgress?.(b, $);
2299
2300
  }
2300
2301
  ), i.data = i.response.data, i.headers = i.response.headers, this.emit("afterResponse", i);
2301
2302
  } catch (g) {
2302
2303
  throw w && clearTimeout(w), g;
2303
2304
  }
2304
2305
  }
2305
- mergeQueries = De.mergeQueries;
2306
+ mergeQueries = Ne.mergeQueries;
2306
2307
  mergeHeaders = Se.mergeHeaders;
2307
2308
  normalizeContext(e, t = {}) {
2308
2309
  const i = e, n = i.baseURL || this.baseConfigs.baseURL || globalThis.location?.href || "http://localhost", s = new URL(
2309
2310
  n,
2310
2311
  globalThis.location?.href || "http://localhost"
2311
- ), o = new URL(i.url.toString(), s), a = !!i[D.NORMALIZED_SYMBOL];
2312
+ ), o = new URL(i.url.toString(), s), a = !!i[N.NORMALIZED_SYMBOL];
2312
2313
  i.baseURL = s ? s.origin : o.origin;
2313
2314
  let c;
2314
2315
  a ? c = t.requestOptionsOverridesURLSearchParams ? this.mergeQueries({}, o.search, i.query) : this.mergeQueries({}, i.query, o.search) : (c = t.requestOptionsOverridesURLSearchParams ? this.mergeQueries(
@@ -2321,7 +2322,7 @@ let rt = class D extends Vt {
2321
2322
  this.baseConfigs.query,
2322
2323
  i.query,
2323
2324
  o.search
2324
- ), i[D.NORMALIZED_SYMBOL] = !0), i.query = c;
2325
+ ), i[N.NORMALIZED_SYMBOL] = !0), i.query = c;
2325
2326
  const u = new URL(o);
2326
2327
  return u.search = "", i.url = u.toString(), i;
2327
2328
  }
@@ -2357,18 +2358,18 @@ let rt = class D extends Vt {
2357
2358
  t
2358
2359
  );
2359
2360
  if (y instanceof Response) {
2360
- const w = y, g = { ...t, rawResponse: w }, v = await $t(
2361
+ const w = y, g = { ...t, rawResponse: w }, b = await Pt(
2361
2362
  w,
2362
2363
  t.responseType,
2363
- (R, C) => {
2364
- t.onProgress?.(R, C);
2364
+ ($, C) => {
2365
+ t.onProgress?.($, C);
2365
2366
  }
2366
2367
  );
2367
- if (g.response = v, g.data = v.data, g.headers = v.headers, e !== "afterResponse") {
2368
- const R = await this.emit("afterResponse", g);
2369
- return R[D.FINAL_SYMBOL] = !0, R;
2368
+ if (g.response = b, g.data = b.data, g.headers = b.headers, e !== "afterResponse") {
2369
+ const $ = await this.emit("afterResponse", g);
2370
+ return $[N.FINAL_SYMBOL] = !0, $;
2370
2371
  } else
2371
- return g[D.FINAL_SYMBOL] = !0, g;
2372
+ return g[N.FINAL_SYMBOL] = !0, g;
2372
2373
  } else if (typeof y == "object" && y[c] === c)
2373
2374
  t = y;
2374
2375
  else {
@@ -2388,20 +2389,20 @@ let rt = class D extends Vt {
2388
2389
  t.url.toString(),
2389
2390
  w
2390
2391
  );
2391
- let v = {};
2392
+ let b = {};
2392
2393
  if (p)
2393
2394
  try {
2394
- v = JSON.parse(p);
2395
+ b = JSON.parse(p);
2395
2396
  } catch {
2396
2397
  }
2397
- const R = t.query || {}, C = this.mergeQueries(
2398
- v,
2398
+ const $ = t.query || {}, C = this.mergeQueries(
2399
+ b,
2399
2400
  g.search,
2400
- R
2401
+ $
2401
2402
  );
2402
2403
  t.query = C;
2403
- const $ = new URL(g);
2404
- $.search = "", t.url = $.toString();
2404
+ const R = new URL(g);
2405
+ R.search = "", t.url = R.toString();
2405
2406
  } catch {
2406
2407
  }
2407
2408
  delete t[c], s++;
@@ -2442,7 +2443,7 @@ let rt = class D extends Vt {
2442
2443
  };
2443
2444
  createMethodShortcut(e) {
2444
2445
  return Reflect.defineProperty(this, e, {
2445
- get: () => (t, i, n) => (D.METHODS_WITHOUT_BODY.includes(
2446
+ get: () => (t, i, n) => (N.METHODS_WITHOUT_BODY.includes(
2446
2447
  e.toLocaleLowerCase()
2447
2448
  ) ? n = i : (n = n || {}, n.body = i), this.request(t, {
2448
2449
  ...n,
@@ -2451,14 +2452,14 @@ let rt = class D extends Vt {
2451
2452
  }), this;
2452
2453
  }
2453
2454
  extends(e) {
2454
- const t = new D(_e(this.baseConfigs, e));
2455
+ const t = new N(_e(this.baseConfigs, e));
2455
2456
  return t.hooks = [...this.hooks], t._plugins = new Map(this._plugins), t._plugins.forEach(async (i) => {
2456
2457
  await t.plugin(i);
2457
2458
  }), t;
2458
2459
  }
2459
- create = D.create;
2460
+ create = N.create;
2460
2461
  static create(e) {
2461
- return new D(e);
2462
+ return new N(e);
2462
2463
  }
2463
2464
  _plugins = /* @__PURE__ */ new Map();
2464
2465
  async plugin(e) {
@@ -2466,14 +2467,14 @@ let rt = class D extends Vt {
2466
2467
  if (this._plugins.has(e.name))
2467
2468
  return this;
2468
2469
  const t = await e.install(this);
2469
- if (this._plugins.set(e.name, e), t instanceof D)
2470
+ if (this._plugins.set(e.name, e), t instanceof N)
2470
2471
  return t;
2471
2472
  }
2472
2473
  return this;
2473
2474
  }
2474
2475
  // 版本弃子们.jpg
2475
2476
  /** @deprecated Use checkIsPlainObject from utils instead */
2476
- checkIsPlainObject = X;
2477
+ checkIsPlainObject = V;
2477
2478
  /** @deprecated Use `mergeQueries` instead */
2478
2479
  mergeQuery = this.mergeQueries;
2479
2480
  };
@@ -2484,10 +2485,10 @@ let rt = class D extends Vt {
2484
2485
  * @license MIT
2485
2486
  * @author dragon-fish <dragon-fish@qq.com>
2486
2487
  */
2487
- const di = rt.create, At = di();
2488
+ const fi = tt.create, At = fi();
2488
2489
  /* v8 ignore else -- @preserve */
2489
2490
  typeof globalThis < "u" ? globalThis.fexios = At : typeof window < "u" && (window.fexios = At);
2490
- var Ue;
2491
+ var De;
2491
2492
  ((r) => {
2492
2493
  function e(i) {
2493
2494
  return Array.isArray(i) ? i.join("|") : typeof i == "boolean" || i === null ? i ? "1" : void 0 : typeof i == "number" ? "" + i : i;
@@ -2503,23 +2504,24 @@ var Ue;
2503
2504
  const c = e(o);
2504
2505
  c != null && s.append(a, c);
2505
2506
  }), s;
2506
- if (X(i))
2507
+ if (V(i))
2507
2508
  return Object.entries(i).forEach(([o, a]) => {
2508
2509
  const c = e(a);
2509
2510
  c != null && s.append(o, c);
2510
2511
  }), s;
2511
2512
  }
2512
2513
  r.normalizeBody = t;
2513
- })(Ue || (Ue = {}));
2514
+ })(De || (De = {}));
2514
2515
  var ke = /* @__PURE__ */ ((r) => (r.HTTP_ERROR = "HTTP_ERROR", r.LOGIN_FAILED = "LOGIN_FAILED", r.LOGIN_RETRY_LIMIT_EXCEEDED = "LOGIN_RETRY_LIMIT_EXCEEDED", r.TOKEN_RETRY_LIMIT_EXCEEDED = "TOKEN_RETRY_LIMIT_EXCEEDED", r))(ke || {});
2515
- let q = class extends Error {
2516
+ class H extends Error {
2516
2517
  constructor(e, t = "", i) {
2517
2518
  super(), this.code = e, this.message = t, this.cause = i, this.name = "WikiSaikouError";
2518
2519
  }
2519
2520
  static is(e, t) {
2520
2521
  return e instanceof this && (t === void 0 || e.code === t);
2521
2522
  }
2522
- }, pe = class Jt extends Error {
2523
+ }
2524
+ let pe = class Jt extends Error {
2523
2525
  constructor(e, t) {
2524
2526
  super(), this.errors = e, this.cause = t, this.name = "MediaWikiApiError", this.errors = Jt.normalizeErrors(e), this.message = e.map((i) => i.text).filter(Boolean).join(`
2525
2527
  `), this.code = this.isBadTokenError() ? "badtoken" : this.errors[0]?.code || "Unknown Error";
@@ -2569,8 +2571,8 @@ let q = class extends Error {
2569
2571
  }
2570
2572
  }
2571
2573
  r.isBadTokenError = n;
2572
- })(q || (q = {}));
2573
- const Pt = Symbol.for("__FEXIOS_SAIKOU__");
2574
+ })(H || (H = {}));
2575
+ const It = Symbol.for("__FEXIOS_SAIKOU__");
2574
2576
  /**
2575
2577
  * FexiosSaikou
2576
2578
  *
@@ -2586,17 +2588,17 @@ const Pt = Symbol.for("__FEXIOS_SAIKOU__");
2586
2588
  * @param {Fexios} payload or make the given Fexios instance a FexiosSaikou instance
2587
2589
  */
2588
2590
  function Qt(r) {
2589
- const e = r instanceof rt ? r : new rt({
2591
+ const e = r instanceof tt ? r : new tt({
2590
2592
  baseURL: r instanceof URL ? r.toString() : String(r),
2591
2593
  responseType: "json"
2592
2594
  });
2593
- return e[Pt] || (Reflect.defineProperty(e, Pt, {
2595
+ return e[It] || (Reflect.defineProperty(e, It, {
2594
2596
  get: () => !0,
2595
2597
  enumerable: !1,
2596
2598
  configurable: !1
2597
2599
  }), e._tokens = /* @__PURE__ */ new Map(), e.on("afterResponse", (t) => {
2598
2600
  const { data: i, rawRequest: n } = t, s = n?.headers.get("x-mw-token-name");
2599
- s && q.isBadTokenError(i) && e._tokens.delete(s);
2601
+ s && H.isBadTokenError(i) && e._tokens.delete(s);
2600
2602
  const o = i?.query?.tokens;
2601
2603
  o && typeof o == "object" && Object.entries(o).forEach(([c, u]) => {
2602
2604
  typeof u == "string" && e._tokens.set(c.replace(/token$/i, "").toLowerCase(), u);
@@ -2608,9 +2610,9 @@ function Qt(r) {
2608
2610
  return t;
2609
2611
  if (t.body === void 0 || t.body === null)
2610
2612
  return t.body = void 0, t;
2611
- const i = t.body = Ue.normalizeBody(t.body), n = new URLSearchParams(t.query);
2613
+ const i = t.body = De.normalizeBody(t.body), n = new URLSearchParams(t.query);
2612
2614
  return i.has("format") && n.delete("format"), i.has("formatversion") && n.delete("formatversion"), i.has("action") && n.delete("action"), i.has("origin") && (n.set("origin", "" + i.get("origin")), i.delete("origin")), t.query = Object.fromEntries(n.entries()), t;
2613
- }), e.on("beforeInit", (t) => (t.query = Ue.normalizeBody(t.query) || {}, t)), e.on("beforeRequest", (t) => {
2615
+ }), e.on("beforeInit", (t) => (t.query = De.normalizeBody(t.query) || {}, t)), e.on("beforeRequest", (t) => {
2614
2616
  const i = new URL(t.url), n = i.searchParams;
2615
2617
  if (globalThis.location && (!n.has("origin") && location.origin !== i.origin ? (n.set("origin", location.origin), e.baseConfigs.credentials = "include", e.baseConfigs.mode = "cors") : location.origin === i.origin && (n.delete("origin"), e.baseConfigs.credentials = void 0, e.baseConfigs.mode = void 0)), i.searchParams.has("origin")) {
2616
2618
  const s = encodeURIComponent(
@@ -2640,7 +2642,7 @@ const ae = (r, ...e) => {
2640
2642
  t(c) && t(a) ? n[o] = ae(c, a) : n[o] = i(a);
2641
2643
  }
2642
2644
  return n;
2643
- }, pi = (r, e, t) => {
2645
+ }, di = (r, e, t) => {
2644
2646
  let i = { ...Zt.DEFAULT_CONFIGS };
2645
2647
  if (typeof r == "string" ? i = ae(i, {
2646
2648
  baseURL: r,
@@ -2653,10 +2655,10 @@ const ae = (r, ...e) => {
2653
2655
  if (typeof i.baseURL != "string")
2654
2656
  throw new Error("baseURL is required");
2655
2657
  return i;
2656
- }, mi = () => {
2657
- }, gi = async (r, e) => {
2658
+ }, pi = () => {
2659
+ }, mi = async (r, e) => {
2658
2660
  let t = 0;
2659
- const { retry: i = 3, onRetry: n = mi, shouldRetry: s = () => !0 } = e;
2661
+ const { retry: i = 3, onRetry: n = pi, shouldRetry: s = () => !0 } = e;
2660
2662
  let o;
2661
2663
  do
2662
2664
  try {
@@ -2679,7 +2681,7 @@ const ae = (r, ...e) => {
2679
2681
  const ve = class {
2680
2682
  constructor(e, t, i) {
2681
2683
  this.version = "7.1.2", this.token = this.getToken;
2682
- const n = this.config = pi(
2684
+ const n = this.config = di(
2683
2685
  e,
2684
2686
  t,
2685
2687
  i
@@ -2729,14 +2731,14 @@ const ve = class {
2729
2731
  const t = await e();
2730
2732
  return this.handleApiResponse(t);
2731
2733
  } catch (t) {
2732
- throw this.config.throwOnApiError && q.includesMediaWikiApiError(t) ? new pe(
2733
- q.extractMediaWikiApiErrors(t),
2734
+ throw this.config.throwOnApiError && H.includesMediaWikiApiError(t) ? new pe(
2735
+ H.extractMediaWikiApiErrors(t),
2734
2736
  t
2735
2737
  ) : t;
2736
2738
  }
2737
2739
  }
2738
2740
  throwIfApiError(e) {
2739
- const t = q.extractMediaWikiApiErrors(e);
2741
+ const t = H.extractMediaWikiApiErrors(e);
2740
2742
  if (t.length > 0)
2741
2743
  throw new pe(t, e);
2742
2744
  }
@@ -2768,12 +2770,12 @@ const ve = class {
2768
2770
  fexiosOptions: a
2769
2771
  } = i || {};
2770
2772
  if (s < 1)
2771
- throw new q(
2773
+ throw new H(
2772
2774
  ke.TOKEN_RETRY_LIMIT_EXCEEDED,
2773
2775
  "The limit of the number of times to automatically re-acquire the token has been exceeded"
2774
2776
  );
2775
2777
  let c = 0;
2776
- return gi(
2778
+ return mi(
2777
2779
  async () => {
2778
2780
  const u = await this.getToken(
2779
2781
  e,
@@ -2789,11 +2791,11 @@ const ve = class {
2789
2791
  headers: { "x-mw-token-name": e }
2790
2792
  })
2791
2793
  );
2792
- if (q.isBadTokenError(p.data))
2794
+ if (H.isBadTokenError(p.data))
2793
2795
  throw p;
2794
2796
  return p;
2795
2797
  } catch (p) {
2796
- throw q.isBadTokenError(p) || p?.ok === !1 || pe.is(p) ? p : new q(
2798
+ throw H.isBadTokenError(p) || p?.ok === !1 || pe.is(p) ? p : new H(
2797
2799
  ke.HTTP_ERROR,
2798
2800
  "Network/transport or SDK-internal error (not a MediaWiki API error)",
2799
2801
  p
@@ -2805,10 +2807,10 @@ const ve = class {
2805
2807
  onRetry: (u, p) => {
2806
2808
  c = p + 1;
2807
2809
  },
2808
- shouldRetry: (u) => q.isBadTokenError(u) || u?.ok === !1
2810
+ shouldRetry: (u) => H.isBadTokenError(u) || u?.ok === !1
2809
2811
  }
2810
2812
  ).catch((u) => {
2811
- throw q.isBadTokenError(u) || u?.ok === !1 ? new q(
2813
+ throw H.isBadTokenError(u) || u?.ok === !1 ? new H(
2812
2814
  ke.TOKEN_RETRY_LIMIT_EXCEEDED,
2813
2815
  "Retry attempts for acquiring/using token exhausted",
2814
2816
  u
@@ -2852,7 +2854,7 @@ let Zt = ve;
2852
2854
  * @author Dragon-Fish <dragon-fish@qq.com>
2853
2855
  * @license MIT
2854
2856
  */
2855
- let yi = class extends Zt {
2857
+ let gi = class extends Zt {
2856
2858
  async clientLogin(e, t, i) {
2857
2859
  i ||= {}, !i.logincontinue && !i.loginreturnurl && (i.loginreturnurl = location?.origin);
2858
2860
  const n = await this.postWithToken(
@@ -2869,17 +2871,17 @@ let yi = class extends Zt {
2869
2871
  );
2870
2872
  if (n?.data?.clientlogin?.status === "PASS")
2871
2873
  return n.data.clientlogin;
2872
- throw new q(
2874
+ throw new H(
2873
2875
  ke.LOGIN_FAILED,
2874
2876
  n.data.clientlogin.message,
2875
2877
  n
2876
2878
  );
2877
2879
  }
2878
2880
  };
2879
- class wi {
2881
+ class yi {
2880
2882
  constructor(e, t = {}) {
2881
2883
  this.ctx = e, location?.href && t?.baseURL?.toString()?.startsWith("/") && (t.baseURL = new URL(t.baseURL, location.origin));
2882
- const i = new yi({
2884
+ const i = new gi({
2883
2885
  baseURL: t.baseURL.toString(),
2884
2886
  fexiosConfigs: {
2885
2887
  headers: {
@@ -2893,20 +2895,20 @@ class wi {
2893
2895
  e.set("api", i);
2894
2896
  }
2895
2897
  }
2896
- var bi = Object.create, ft = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, er = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), tr = (r) => {
2898
+ var wi = Object.create, ft = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, er = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), tr = (r) => {
2897
2899
  throw TypeError(r);
2898
- }, _i = (r, e, t) => e in r ? ft(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Si = (r, e) => ft(r, "name", { value: e, configurable: !0 }), ki = (r) => [, , , bi(r?.[er("metadata")] ?? null)], xi = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], rr = (r) => r !== void 0 && typeof r != "function" ? tr("Function expected") : r, Ei = (r, e, t, i, n) => ({ kind: xi[r], name: e, metadata: i, addInitializer: (s) => t._ ? tr("Already initialized") : n.push(rr(s || null)) }), Oi = (r, e) => _i(e, er("metadata"), r[3]), Ri = (r, e, t, i) => {
2900
+ }, vi = (r, e, t) => e in r ? ft(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, _i = (r, e) => ft(r, "name", { value: e, configurable: !0 }), Si = (r) => [, , , wi(r?.[er("metadata")] ?? null)], ki = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], rr = (r) => r !== void 0 && typeof r != "function" ? tr("Function expected") : r, xi = (r, e, t, i, n) => ({ kind: ki[r], name: e, metadata: i, addInitializer: (s) => t._ ? tr("Already initialized") : n.push(rr(s || null)) }), Ei = (r, e) => vi(e, er("metadata"), r[3]), Oi = (r, e, t, i) => {
2899
2901
  for (var n = 0, s = r[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
2900
2902
  return i;
2901
2903
  }, $i = (r, e, t, i, n, s) => {
2902
- var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && vi(n, t));
2903
- Si(n, t);
2904
- for (var v = i.length - 1; v >= 0; v--)
2905
- c = Ei(u, t, a = {}, r[3], w), o = (0, i[v])(n, c), a._ = 1, rr(o) && (n = o);
2906
- return Oi(r, n), g && ft(n, t, g), p ? u ^ 4 ? s : g : n;
2904
+ var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && bi(n, t));
2905
+ _i(n, t);
2906
+ for (var b = i.length - 1; b >= 0; b--)
2907
+ c = xi(u, t, a = {}, r[3], w), o = (0, i[b])(n, c), a._ = 1, rr(o) && (n = o);
2908
+ return Ei(r, n), g && ft(n, t, g), p ? u ^ 4 ? s : g : n;
2907
2909
  }, ir, dt, nr;
2908
2910
  ir = [le(["wiki", "wikiTitle"])];
2909
- class Ne extends (nr = he) {
2911
+ class Ue extends (nr = he) {
2910
2912
  constructor(e) {
2911
2913
  super(e, "currentPage", !1), this.ctx = e, this.url = new URL(window.location.href), this.isMainPage = void 0, this.wikiTitle = void 0;
2912
2914
  }
@@ -2963,10 +2965,10 @@ class Ne extends (nr = he) {
2963
2965
  return this.params.get("action") || "view";
2964
2966
  }
2965
2967
  }
2966
- dt = ki(nr);
2967
- Ne = $i(dt, 0, "CurrentPageService", ir, Ne);
2968
- Ri(dt, 1, Ne);
2969
- class Ai extends he {
2968
+ dt = Si(nr);
2969
+ Ue = $i(dt, 0, "CurrentPageService", ir, Ue);
2970
+ Oi(dt, 1, Ue);
2971
+ class Ri extends he {
2970
2972
  constructor(e) {
2971
2973
  super(e, "resourceLoader", !0), this.ctx = e;
2972
2974
  }
@@ -3001,11 +3003,11 @@ class Ai extends he {
3001
3003
  return e.startsWith("http") || e.startsWith("//") ? e : import.meta.resolve(e);
3002
3004
  }
3003
3005
  }
3004
- const He = Object.keys;
3006
+ const ze = Object.keys;
3005
3007
  function Pi(r) {
3006
3008
  return typeof r == "boolean";
3007
3009
  }
3008
- function Ii(r) {
3010
+ function Ai(r) {
3009
3011
  return r && typeof r.nodeType == "number";
3010
3012
  }
3011
3013
  function pt(r) {
@@ -3020,21 +3022,21 @@ function ue(r) {
3020
3022
  function Ee(r) {
3021
3023
  return typeof r == "function";
3022
3024
  }
3023
- function Li(r) {
3025
+ function Ii(r) {
3024
3026
  return !!(r && r.isComponent);
3025
3027
  }
3026
3028
  function Ti(r) {
3027
3029
  return ue(r) && typeof r.length == "number" && typeof r.nodeType != "number";
3028
3030
  }
3029
- function it(r, e) {
3031
+ function rt(r, e) {
3030
3032
  if (r)
3031
- for (const t of He(r))
3033
+ for (const t of ze(r))
3032
3034
  e(r[t], t);
3033
3035
  }
3034
- function Ci(r) {
3036
+ function Li(r) {
3035
3037
  return ue(r) && "current" in r;
3036
3038
  }
3037
- const nt = {
3039
+ const it = {
3038
3040
  animationIterationCount: 0,
3039
3041
  borderImageOutset: 0,
3040
3042
  borderImageSlice: 0,
@@ -3079,30 +3081,30 @@ const nt = {
3079
3081
  strokeOpacity: 0,
3080
3082
  strokeWidth: 0
3081
3083
  };
3082
- function ji(r, e) {
3084
+ function Ci(r, e) {
3083
3085
  return r + e.charAt(0).toUpperCase() + e.substring(1);
3084
3086
  }
3085
- const Di = ["Webkit", "ms", "Moz", "O"];
3086
- He(nt).forEach((r) => {
3087
- Di.forEach((e) => {
3088
- nt[ji(e, r)] = 0;
3087
+ const ji = ["Webkit", "ms", "Moz", "O"];
3088
+ ze(it).forEach((r) => {
3089
+ ji.forEach((e) => {
3090
+ it[Ci(e, r)] = 0;
3089
3091
  });
3090
3092
  });
3091
- const Ui = Symbol.for("jsx-dom:type");
3093
+ const Ni = Symbol.for("jsx-dom:type");
3092
3094
  var or = /* @__PURE__ */ function(r) {
3093
3095
  return r.ShadowRoot = "ShadowRoot", r;
3094
3096
  }(or || {});
3095
- function Ni(r) {
3096
- return r != null && r[Ui] === or.ShadowRoot;
3097
+ function Di(r) {
3098
+ return r != null && r[Ni] === or.ShadowRoot;
3097
3099
  }
3098
- const Mi = "http://www.w3.org/2000/svg", Bi = "http://www.w3.org/1999/xlink", Fi = "http://www.w3.org/XML/1998/namespace";
3100
+ const Ui = "http://www.w3.org/2000/svg", Mi = "http://www.w3.org/1999/xlink", Bi = "http://www.w3.org/XML/1998/namespace";
3099
3101
  function ar(r) {
3100
3102
  return !Pi(r) && r != null;
3101
3103
  }
3102
- function st(r) {
3103
- return Array.isArray(r) ? r.map(st).filter(Boolean).join(" ") : ue(r) ? Symbol.iterator in r ? st(Array.from(r)) : He(r).filter((e) => r[e]).join(" ") : ar(r) ? "" + r : "";
3104
+ function nt(r) {
3105
+ return Array.isArray(r) ? r.map(nt).filter(Boolean).join(" ") : ue(r) ? Symbol.iterator in r ? nt(Array.from(r)) : ze(r).filter((e) => r[e]).join(" ") : ar(r) ? "" + r : "";
3104
3106
  }
3105
- const qi = {
3107
+ const Fi = {
3106
3108
  animate: 0,
3107
3109
  circle: 0,
3108
3110
  clipPath: 0,
@@ -3157,12 +3159,12 @@ const qi = {
3157
3159
  tspan: 0,
3158
3160
  use: 0,
3159
3161
  view: 0
3160
- }, zi = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;
3161
- function Hi(r) {
3162
+ }, Hi = /^(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)/;
3163
+ function zi(r) {
3162
3164
  const e = document.createDocumentFragment();
3163
- return Ke(r.children, e), e;
3165
+ return qe(r.children, e), e;
3164
3166
  }
3165
- function Ki(r, e, t) {
3167
+ function qi(r, e, t) {
3166
3168
  e = {
3167
3169
  ...e,
3168
3170
  children: t
@@ -3170,15 +3172,15 @@ function Ki(r, e, t) {
3170
3172
  const i = new r(e), n = i.render();
3171
3173
  return "ref" in e && mt(e.ref, i), n;
3172
3174
  }
3173
- function A(r, e) {
3175
+ function P(r, e) {
3174
3176
  let { children: t, ...i } = e;
3175
- !i.namespaceURI && qi[r] === 0 && (i = {
3177
+ !i.namespaceURI && Fi[r] === 0 && (i = {
3176
3178
  ...i,
3177
- namespaceURI: Mi
3179
+ namespaceURI: Ui
3178
3180
  });
3179
3181
  let n;
3180
3182
  if (pt(r)) {
3181
- if (n = i.namespaceURI ? document.createElementNS(i.namespaceURI, r) : document.createElement(r), Gi(i, n), Ke(t, n), n instanceof window.HTMLSelectElement && i.value != null)
3183
+ if (n = i.namespaceURI ? document.createElementNS(i.namespaceURI, r) : document.createElement(r), Yi(i, n), qe(t, n), n instanceof window.HTMLSelectElement && i.value != null)
3182
3184
  if (i.multiple === !0 && Array.isArray(i.value)) {
3183
3185
  const s = i.value.map((o) => String(o));
3184
3186
  n.querySelectorAll("option").forEach(
@@ -3191,7 +3193,7 @@ function A(r, e) {
3191
3193
  ue(r.defaultProps) && (i = {
3192
3194
  ...r.defaultProps,
3193
3195
  ...i
3194
- }), n = Li(r) ? Ki(r, i, t) : r({
3196
+ }), n = Ii(r) ? qi(r, i, t) : r({
3195
3197
  ...i,
3196
3198
  children: t
3197
3199
  });
@@ -3200,39 +3202,39 @@ function A(r, e) {
3200
3202
  return n;
3201
3203
  }
3202
3204
  function mt(r, e) {
3203
- Ci(r) ? r.current = e : Ee(r) && r(e);
3205
+ Li(r) ? r.current = e : Ee(r) && r(e);
3204
3206
  }
3205
- function Ke(r, e) {
3207
+ function qe(r, e) {
3206
3208
  if (Ti(r))
3207
- Wi(r, e);
3209
+ Ki(r, e);
3208
3210
  else if (pt(r) || sr(r))
3209
- Ye(document.createTextNode(r), e);
3211
+ We(document.createTextNode(r), e);
3210
3212
  else if (r === null)
3211
- Ye(document.createComment(""), e);
3212
- else if (Ii(r))
3213
- Ye(r, e);
3214
- else if (Ni(r)) {
3213
+ We(document.createComment(""), e);
3214
+ else if (Ai(r))
3215
+ We(r, e);
3216
+ else if (Di(r)) {
3215
3217
  const t = e.attachShadow(r.attr);
3216
- Ke(r.children, t), mt(r.ref, t);
3218
+ qe(r.children, t), mt(r.ref, t);
3217
3219
  }
3218
3220
  }
3219
- function Wi(r, e) {
3221
+ function Ki(r, e) {
3220
3222
  for (const t of [...r])
3221
- Ke(t, e);
3223
+ qe(t, e);
3222
3224
  return e;
3223
3225
  }
3224
- function Ye(r, e) {
3226
+ function We(r, e) {
3225
3227
  e instanceof window.HTMLTemplateElement ? e.content.appendChild(r) : e.appendChild(r);
3226
3228
  }
3227
- function Le(r, e) {
3229
+ function Te(r, e) {
3228
3230
  return r.replace(/[A-Z]/g, (t) => e + t.toLowerCase());
3229
3231
  }
3230
3232
  function cr(r, e) {
3231
- e == null || e === !1 || (Array.isArray(e) ? e.forEach((t) => cr(r, t)) : pt(e) ? r.setAttribute("style", e) : ue(e) && it(e, (t, i) => {
3232
- i.indexOf("-") === 0 ? r.style.setProperty(i, t) : sr(t) && nt[i] !== 0 ? r.style[i] = t + "px" : r.style[i] = t;
3233
+ e == null || e === !1 || (Array.isArray(e) ? e.forEach((t) => cr(r, t)) : pt(e) ? r.setAttribute("style", e) : ue(e) && rt(e, (t, i) => {
3234
+ i.indexOf("-") === 0 ? r.style.setProperty(i, t) : sr(t) && it[i] !== 0 ? r.style[i] = t + "px" : r.style[i] = t;
3233
3235
  }));
3234
3236
  }
3235
- function Yi(r, e, t) {
3237
+ function Wi(r, e, t) {
3236
3238
  switch (r) {
3237
3239
  case "xlinkActuate":
3238
3240
  case "xlinkArcrole":
@@ -3241,15 +3243,15 @@ function Yi(r, e, t) {
3241
3243
  case "xlinkShow":
3242
3244
  case "xlinkTitle":
3243
3245
  case "xlinkType":
3244
- It(t, Bi, Le(r, ":"), e);
3246
+ Tt(t, Mi, Te(r, ":"), e);
3245
3247
  return;
3246
3248
  case "xmlnsXlink":
3247
- fe(t, Le(r, ":"), e);
3249
+ fe(t, Te(r, ":"), e);
3248
3250
  return;
3249
3251
  case "xmlBase":
3250
3252
  case "xmlLang":
3251
3253
  case "xmlSpace":
3252
- It(t, Fi, Le(r, ":"), e);
3254
+ Tt(t, Bi, Te(r, ":"), e);
3253
3255
  return;
3254
3256
  }
3255
3257
  switch (r) {
@@ -3257,7 +3259,7 @@ function Yi(r, e, t) {
3257
3259
  fe(t, "for", e);
3258
3260
  return;
3259
3261
  case "dataset":
3260
- it(e, (i, n) => {
3262
+ rt(e, (i, n) => {
3261
3263
  i != null && (t.dataset[n] = i);
3262
3264
  });
3263
3265
  return;
@@ -3282,7 +3284,7 @@ function Yi(r, e, t) {
3282
3284
  return;
3283
3285
  case "class":
3284
3286
  case "className":
3285
- Ee(e) ? e(t) : fe(t, "class", st(e));
3287
+ Ee(e) ? e(t) : fe(t, "class", nt(e));
3286
3288
  return;
3287
3289
  case "ref":
3288
3290
  case "namespaceURI":
@@ -3292,7 +3294,7 @@ function Yi(r, e, t) {
3292
3294
  return;
3293
3295
  case "on":
3294
3296
  case "onCapture":
3295
- it(e, (i, n) => {
3297
+ rt(e, (i, n) => {
3296
3298
  t.addEventListener(n, i, r === "onCapture");
3297
3299
  });
3298
3300
  return;
@@ -3314,22 +3316,22 @@ function Yi(r, e, t) {
3314
3316
  i in window ? s = i.substring(2) : s = i[2] + r.slice(3), t.addEventListener(s, e);
3315
3317
  }
3316
3318
  }
3317
- } else ue(e) ? t[r] = e : e === !0 ? fe(t, r, "") : e !== !1 && e != null && (t instanceof SVGElement && !zi.test(r) ? fe(t, Le(r, "-"), e) : fe(t, r, e));
3319
+ } else ue(e) ? t[r] = e : e === !0 ? fe(t, r, "") : e !== !1 && e != null && (t instanceof SVGElement && !Hi.test(r) ? fe(t, Te(r, "-"), e) : fe(t, r, e));
3318
3320
  }
3319
3321
  function fe(r, e, t) {
3320
3322
  r.setAttribute(e, t);
3321
3323
  }
3322
- function It(r, e, t, i) {
3324
+ function Tt(r, e, t, i) {
3323
3325
  r.setAttributeNS(e, t, i);
3324
3326
  }
3325
- function Gi(r, e) {
3326
- for (const t of He(r))
3327
- Yi(t, r[t], e);
3327
+ function Yi(r, e) {
3328
+ for (const t of ze(r))
3329
+ Wi(t, r[t], e);
3328
3330
  return e;
3329
3331
  }
3330
3332
  var gt = /* @__PURE__ */ ((r) => (r.Init = "modal.init", r.BeforeShow = "modal.beforeShow", r.Show = "modal.show", r.BeforeClose = "modal.beforeClose", r.Close = "modal.close", r.Destroy = "modal.destroy", r.ToastShow = "toast.show", r.ToastClose = "toast.close", r))(gt || {});
3331
- let Xi = 0;
3332
- const Lt = (r) => `${r}-${++Xi}`;
3333
+ let Gi = 0;
3334
+ const Lt = (r) => `${r}-${++Gi}`;
3333
3335
  function ye(r) {
3334
3336
  return r instanceof Node ? r : document.createTextNode(String(r));
3335
3337
  }
@@ -3337,7 +3339,7 @@ function ee(r, e) {
3337
3339
  if (!r) throw new Error(`${e ?? "Element"} not found`);
3338
3340
  return r;
3339
3341
  }
3340
- function Tt(r) {
3342
+ function Ct(r) {
3341
3343
  const e = [
3342
3344
  "a[href]",
3343
3345
  "button:not([disabled])",
@@ -3350,14 +3352,14 @@ function Tt(r) {
3350
3352
  (t) => !!(t.offsetWidth || t.offsetHeight || t.getClientRects().length)
3351
3353
  );
3352
3354
  }
3353
- function M(r, e = {}) {
3355
+ function U(r, e = {}) {
3354
3356
  const t = document.createElement(r);
3355
3357
  if (e.className && (t.className = e.className), e.html != null && (t.innerHTML = e.html), e.text != null && (t.textContent = e.text), e.attrs)
3356
3358
  for (const [i, n] of Object.entries(e.attrs)) t.setAttribute(i, n);
3357
3359
  return t;
3358
3360
  }
3359
- const Vi = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), lr = ["ctrl", "alt", "shift", "meta"];
3360
- function Ji(r) {
3361
+ const Xi = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), lr = ["ctrl", "alt", "shift", "meta"];
3362
+ function Vi(r) {
3361
3363
  if (!r) return null;
3362
3364
  const e = String(r).trim().toLowerCase().split(/[+\-\s]+/g).filter(Boolean), t = [];
3363
3365
  let i = null;
@@ -3383,7 +3385,7 @@ function Ji(r) {
3383
3385
  continue;
3384
3386
  }
3385
3387
  if (a === "mod") {
3386
- n(Vi ? "meta" : "ctrl");
3388
+ n(Xi ? "meta" : "ctrl");
3387
3389
  continue;
3388
3390
  }
3389
3391
  a === "esc" && (a = "escape"), a === "return" && (a = "enter"), (a === "space" || a === "spacebar") && (a = "space"), i = a;
@@ -3391,7 +3393,7 @@ function Ji(r) {
3391
3393
  const s = lr.filter((o) => t.includes(o));
3392
3394
  return !i || i === "" ? s.length ? s.join("+") : null : s.length ? `${s.join("+")}+${i}` : i;
3393
3395
  }
3394
- function Qi(r) {
3396
+ function Ji(r) {
3395
3397
  const e = [];
3396
3398
  r.ctrlKey && e.push("ctrl"), r.altKey && e.push("alt"), r.shiftKey && e.push("shift"), r.metaKey && e.push("meta");
3397
3399
  let t = r.key;
@@ -3399,7 +3401,7 @@ function Qi(r) {
3399
3401
  const i = (t.length, t.toLowerCase()), n = lr.filter((s) => e.includes(s));
3400
3402
  return n.length ? `${n.join("+")}+${i}` : i;
3401
3403
  }
3402
- class Zi {
3404
+ class Qi {
3403
3405
  constructor() {
3404
3406
  this.zBase = 1e3, this.stack = [];
3405
3407
  }
@@ -3432,10 +3434,23 @@ class Zi {
3432
3434
  document.body.classList.remove("ipe-modal-no-scroll");
3433
3435
  }
3434
3436
  }
3435
- const B = new Zi();
3436
- class Me {
3437
+ const B = new Qi();
3438
+ class yt {
3437
3439
  constructor(e = {}) {
3438
- this.backdropId = Lt("ipe-modal-backdrop"), this.modalId = Lt("ipe-modal"), this.numberId = this.modalId.split("-")[1], this._isDestroyed = !1, this.pluginName = "normalModal", this.buttonElsLeft = [], this.buttonElsRight = [], this.keyMap = /* @__PURE__ */ new Map(), this.isOpen = !1, this.isToast = !1, this.isDragging = !1, this.dragStartX = 0, this.dragStartY = 0, this.modalStartX = 0, this.modalStartY = 0, this.Event = gt, this._hooks = [], this.startCloseTimer = (t) => {
3440
+ this.backdropId = Lt("ipe-modal-backdrop"), this.modalId = Lt("ipe-modal"), this.numberId = this.modalId.split("-")[1], this._isDestroyed = !1, this.pluginName = "normalModal", this.buttonElsLeft = [], this.buttonElsRight = [], this.keyMap = /* @__PURE__ */ new Map(), this.isOpen = !1, this.isToast = !1, this.isDragging = !1, this.dragStartX = 0, this.dragStartY = 0, this.modalStartX = 0, this.modalStartY = 0, this.Event = gt, this.DEFAULT_OPTIONS = {
3441
+ className: "",
3442
+ sizeClass: "auto",
3443
+ center: !0,
3444
+ fitScreen: !1,
3445
+ closeIcon: !0,
3446
+ bodyScroll: !1,
3447
+ // lock body scroll by default
3448
+ outSideClose: !0,
3449
+ backdrop: !0,
3450
+ animation: !1,
3451
+ // no transitions by default
3452
+ animationSpeed: 200
3453
+ }, this._hooks = [], this.startCloseTimer = (t) => {
3439
3454
  this.stopCloseTimer(), this.closeTimer = window.setTimeout(() => this.close(), t);
3440
3455
  }, this.stopCloseTimer = () => {
3441
3456
  this.closeTimer && window.clearTimeout(this.closeTimer), this.closeTimer = void 0;
@@ -3451,80 +3466,56 @@ class Me {
3451
3466
  t.classList.remove("is-dragging"), i.style.animation = "none", requestAnimationFrame(() => {
3452
3467
  this.applyAnimation(!0);
3453
3468
  });
3454
- }, this.options = { ...Me.DEFAULT_OPTIONS, ...e }, this.options.backdrop === !1 && e.bodyScroll === void 0 && (this.options.bodyScroll = !0);
3469
+ }, this.options = { ...this.DEFAULT_OPTIONS, ...e }, this.options.backdrop === !1 && e.bodyScroll === void 0 && (this.options.bodyScroll = !0);
3455
3470
  }
3456
3471
  get isDestroyed() {
3457
3472
  return this._isDestroyed;
3458
3473
  }
3459
- static {
3460
- this.DEFAULT_OPTIONS = {
3461
- className: "",
3462
- sizeClass: "auto",
3463
- center: !0,
3464
- fitScreen: !1,
3465
- closeIcon: !0,
3466
- bodyScroll: !1,
3467
- outSideClose: !0,
3468
- backdrop: !0,
3469
- animation: {
3470
- show: "ipe-modal-fade-in",
3471
- hide: "ipe-modal-fade-out"
3472
- },
3473
- animationSpeed: 200
3474
- };
3475
- }
3476
- static extends(e = {}) {
3477
- return class extends this {
3478
- constructor(t = {}) {
3479
- super({ ...e, ...t });
3480
- }
3481
- };
3482
- }
3483
3474
  // ------------------------------ lifecycle ------------------------------ //
3484
3475
  init() {
3485
3476
  if (this.$modal) return this;
3486
3477
  const e = this.options.backdrop !== !1;
3487
3478
  let t;
3488
- e && (t = M("div", {
3479
+ e && (t = U("div", {
3489
3480
  className: "ipe-modal-backdrop",
3490
3481
  attrs: { id: this.backdropId, "data-modal-id": this.modalId }
3491
3482
  }));
3492
- const i = M("div", {
3483
+ const i = U("div", {
3493
3484
  className: "ipe-modal-modal",
3494
3485
  attrs: { id: this.modalId, role: "dialog", "aria-modal": "true", tabindex: "-1" }
3495
3486
  });
3496
3487
  if (i.modal = this, !e) {
3497
3488
  i.classList.add("no-backdrop");
3498
- const g = window.pageYOffset || document.documentElement.scrollTop, v = window.pageXOffset || document.documentElement.scrollLeft, R = window.innerWidth;
3489
+ const g = window.pageYOffset || document.documentElement.scrollTop, b = window.pageXOffset || document.documentElement.scrollLeft, $ = window.innerWidth;
3499
3490
  i.style.top = `${g + 60}px`, this.once("modal.show", () => {
3500
- i.style.left = `${v + R / 2 - i.offsetWidth / 2}px`;
3491
+ i.style.left = `${b + $ / 2 - i.offsetWidth / 2}px`;
3501
3492
  });
3502
3493
  }
3503
- const n = M("div", {
3494
+ const n = U("div", {
3504
3495
  className: `ipe-modal-modal__window size--${this.options.sizeClass || "auto"} plugin--${this.pluginName}`
3505
3496
  });
3506
3497
  n.modal = this;
3507
- const s = M("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, a = M("h2", {
3498
+ const s = U("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, a = U("h2", {
3508
3499
  className: "ipe-modal-modal__title",
3509
3500
  attrs: { id: o, role: "heading", "aria-level": "2" }
3510
3501
  });
3511
3502
  i.setAttribute("aria-labelledby", o);
3512
- const c = M("div", { className: "ipe-modal-modal__icons" });
3503
+ const c = U("div", { className: "ipe-modal-modal__icons" });
3513
3504
  if (this.options.closeIcon) {
3514
- const g = M("button", {
3505
+ const g = U("button", {
3515
3506
  className: "ipe-modal-modal__close",
3516
3507
  attrs: { type: "button", "aria-label": "Close" },
3517
3508
  html: "&times;"
3518
3509
  });
3519
3510
  g.addEventListener("click", () => {
3520
- let v = !0;
3521
- typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (v = !1) : this.options.onClickClose === !1 && (v = !1), v && this.close();
3511
+ let b = !0;
3512
+ typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (b = !1) : this.options.onClickClose === !1 && (b = !1), b && this.close();
3522
3513
  }), c.appendChild(g);
3523
3514
  }
3524
3515
  s.append(a, c), !e && this.options.draggable && (s.style.cursor = "move", s.style.userSelect = "none", s.addEventListener("pointerdown", this.onDragStart.bind(this)));
3525
- const u = M("div", { className: "ipe-modal-modal__content" }), p = M("div", { className: "ipe-modal-modal__footer" }), y = M("div", {
3516
+ const u = U("div", { className: "ipe-modal-modal__content" }), p = U("div", { className: "ipe-modal-modal__footer" }), y = U("div", {
3526
3517
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--left"
3527
- }), w = M("div", {
3518
+ }), w = U("div", {
3528
3519
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--right"
3529
3520
  });
3530
3521
  return p.append(y, w), n.append(s, u, p), i.appendChild(n), this.$backdrop = t, this.$modal = i, this.$window = n, this.$header = s, this.$title = a, this.$icons = c, this.$content = u, this.$footer = p, this.$buttonsLeft = y, this.$buttonsRight = w, this.options.title && this.setTitle(this.options.title), this.options.content && this.setContent(this.options.content), this.options.buttons?.length ? this.setButtons(this.options.buttons) : p.style.display = "none", this.options.center && this.$modal.classList.add("is-centered"), this.options.fitScreen && this.$modal.classList.add("is-fullscreen"), this.options.iconButtons && this.$header.classList.add("has-icon-buttons"), this.options.className && this.$window.classList.add(...this.options.className.split(/[\s\.#+]+/g).filter(Boolean)), typeof this.options.fixedHeight == "number" ? this.$window.style.height = `${Math.max(0, this.options.fixedHeight)}px` : this.options.fixedHeight === !0 && this.$window.classList.add("is-fixed-height"), t && t.addEventListener("pointerdown", (g) => {
@@ -3644,7 +3635,7 @@ class Me {
3644
3635
  const t = this.get$icons();
3645
3636
  t.innerHTML = "";
3646
3637
  for (const i of e) {
3647
- const n = M("button", {
3638
+ const n = U("button", {
3648
3639
  className: `ipe-modal-modal__icon ${i.className}`,
3649
3640
  attrs: { type: "button" }
3650
3641
  });
@@ -3668,7 +3659,7 @@ class Me {
3668
3659
  return this;
3669
3660
  }
3670
3661
  generateButton(e) {
3671
- const t = e.type ?? "button", i = t === "link" ? M("a") : M("button", { attrs: { type: "button" } });
3662
+ const t = e.type ?? "button", i = t === "link" ? U("a") : U("button", { attrs: { type: "button" } });
3672
3663
  e.id && (i.id = e.id), i.className = `ipe-modal-btn ${e.className ?? ""}`.trim();
3673
3664
  const n = ye(e.label ?? "OK");
3674
3665
  if (i.append(n), t === "link" && e.href && (i.href = e.href), e.method && i.addEventListener("click", (s) => {
@@ -3689,7 +3680,7 @@ class Me {
3689
3680
  if (e.keyPress) {
3690
3681
  const s = String(e.keyPress).split(/[\,\|]+/g).map((o) => o.trim()).filter(Boolean);
3691
3682
  for (const o of s) {
3692
- const a = Ji(o);
3683
+ const a = Vi(o);
3693
3684
  a && this.keyMap.set(a, i);
3694
3685
  }
3695
3686
  }
@@ -3758,7 +3749,7 @@ class Me {
3758
3749
  return (!s.dispatchEvent(o) || o.defaultPrevented) && (n = !1), n;
3759
3750
  }
3760
3751
  focusFirst() {
3761
- const e = this.get$modal(), t = Tt(e);
3752
+ const e = this.get$modal(), t = Ct(e);
3762
3753
  t.length ? t[0].focus() : e.focus({ preventScroll: !0 });
3763
3754
  }
3764
3755
  onKeyDown(e) {
@@ -3770,7 +3761,7 @@ class Me {
3770
3761
  const t = this.get$modal();
3771
3762
  if (!t.contains(document.activeElement)) return;
3772
3763
  if (e.key === "Tab") {
3773
- const a = Tt(t);
3764
+ const a = Ct(t);
3774
3765
  if (!a.length) return;
3775
3766
  const c = a[0], u = a[a.length - 1], p = document.activeElement;
3776
3767
  e.shiftKey && p === c ? (e.preventDefault(), u.focus()) : !e.shiftKey && p === u && (e.preventDefault(), c.focus());
@@ -3778,7 +3769,7 @@ class Me {
3778
3769
  const i = e.ctrlKey || e.altKey || e.metaKey, n = e.target;
3779
3770
  if (!i && (n && ["INPUT", "TEXTAREA"].includes(n.tagName) || n.contentEditable === "true"))
3780
3771
  return;
3781
- const s = Qi(e), o = this.keyMap.get(s);
3772
+ const s = Ji(e), o = this.keyMap.get(s);
3782
3773
  if (o) {
3783
3774
  e.preventDefault(), o.click();
3784
3775
  return;
@@ -3816,7 +3807,7 @@ class Me {
3816
3807
  /** Show as toast (no backdrop, container stack). */
3817
3808
  showToast(e) {
3818
3809
  this.$window || this.init();
3819
- const t = en(e.position ?? "top right"), i = this.get$window();
3810
+ const t = Zi(e.position ?? "top right"), i = this.get$window();
3820
3811
  this.isToast = !0, i.style.pointerEvents = "auto", this.applyAnimation(!0), t.appendChild(i);
3821
3812
  const n = (typeof this.options.closeAfter == "number" ? this.options.closeAfter : this.options.closeAfter?.time) ?? 3e3, s = (typeof this.options.closeAfter == "number" ? !0 : this.options.closeAfter?.resetOnHover) ?? !0;
3822
3813
  return n > 0 && (this.startCloseTimer(n), s && (i.addEventListener("mouseenter", this.stopCloseTimer), i.addEventListener("mouseleave", () => this.startCloseTimer(n)))), this.isOpen = !0, this.options.onShow?.(this), oe.push(this), this.emit(
@@ -3850,7 +3841,7 @@ class Me {
3850
3841
  return B.closeAll(e, t), [...oe].forEach((s) => {
3851
3842
  const o = s.modalId, a = n.size ? n.has(s.pluginName) : !0, c = i.has(o);
3852
3843
  a && !c && s.close();
3853
- }), B.top() ?? new Me();
3844
+ }), B.top() ?? new yt();
3854
3845
  }
3855
3846
  static removeAll() {
3856
3847
  B.removeAll(), [...oe].forEach((e) => e.destroy());
@@ -3874,8 +3865,7 @@ class Me {
3874
3865
  }
3875
3866
  static confirm(e, t) {
3876
3867
  e.title ??= "Confirm", e.content ??= "Are you sure you want to perform this action?";
3877
- const i = e.okBtn ?? { label: "OK", className: "is-primary is-ghost" }, n = e.cancelBtn ?? { label: "Cancel", className: "is-danger is-ghost" };
3878
- return new this({
3868
+ const i = e.okBtn ?? { label: "OK", className: "is-primary is-ghost" }, n = e.cancelBtn ?? { label: "Cancel", className: "is-danger is-ghost" }, s = new this({
3879
3869
  sizeClass: "dialog",
3880
3870
  ...e,
3881
3871
  buttons: [
@@ -3883,25 +3873,24 @@ class Me {
3883
3873
  label: n.label,
3884
3874
  className: n.className,
3885
3875
  keyPress: "n",
3886
- method: (s, o) => {
3887
- t?.(!1, o, s), o.close();
3888
- }
3876
+ method: () => s.close()
3889
3877
  },
3890
3878
  {
3891
3879
  label: i.label,
3892
3880
  className: i.className,
3893
3881
  keyPress: "y",
3894
- method: (s, o) => {
3895
- t?.(!0, o, s), s.defaultPrevented || o.close();
3882
+ method: (o) => {
3883
+ t?.(o, s), o.defaultPrevented || s.close();
3896
3884
  }
3897
3885
  }
3898
3886
  ]
3899
- }).init().show();
3887
+ });
3888
+ return s.init().show();
3900
3889
  }
3901
3890
  static getDefaultNotifyIcon(e) {
3902
3891
  switch (e) {
3903
3892
  case "success":
3904
- return /* @__PURE__ */ A(
3893
+ return /* @__PURE__ */ P(
3905
3894
  "svg",
3906
3895
  {
3907
3896
  xmlns: "http://www.w3.org/2000/svg",
@@ -3911,13 +3900,13 @@ class Me {
3911
3900
  fill: "currentColor",
3912
3901
  class: "icon icon-tabler icons-tabler-filled icon-tabler-circle-check",
3913
3902
  children: [
3914
- /* @__PURE__ */ A("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3915
- /* @__PURE__ */ A("path", { d: "M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" })
3903
+ /* @__PURE__ */ P("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3904
+ /* @__PURE__ */ P("path", { d: "M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" })
3916
3905
  ]
3917
3906
  }
3918
3907
  );
3919
3908
  case "error":
3920
- return /* @__PURE__ */ A(
3909
+ return /* @__PURE__ */ P(
3921
3910
  "svg",
3922
3911
  {
3923
3912
  xmlns: "http://www.w3.org/2000/svg",
@@ -3927,13 +3916,13 @@ class Me {
3927
3916
  fill: "currentColor",
3928
3917
  class: "icon icon-tabler icons-tabler-filled icon-tabler-alert-triangle",
3929
3918
  children: [
3930
- /* @__PURE__ */ A("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3931
- /* @__PURE__ */ A("path", { d: "M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" })
3919
+ /* @__PURE__ */ P("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3920
+ /* @__PURE__ */ P("path", { d: "M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" })
3932
3921
  ]
3933
3922
  }
3934
3923
  );
3935
3924
  case "warning":
3936
- return /* @__PURE__ */ A(
3925
+ return /* @__PURE__ */ P(
3937
3926
  "svg",
3938
3927
  {
3939
3928
  xmlns: "http://www.w3.org/2000/svg",
@@ -3943,13 +3932,13 @@ class Me {
3943
3932
  fill: "currentColor",
3944
3933
  class: "icon icon-tabler icons-tabler-filled icon-tabler-alert-circle",
3945
3934
  children: [
3946
- /* @__PURE__ */ A("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3947
- /* @__PURE__ */ A("path", { d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" })
3935
+ /* @__PURE__ */ P("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3936
+ /* @__PURE__ */ P("path", { d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" })
3948
3937
  ]
3949
3938
  }
3950
3939
  );
3951
3940
  case "info":
3952
- return /* @__PURE__ */ A(
3941
+ return /* @__PURE__ */ P(
3953
3942
  "svg",
3954
3943
  {
3955
3944
  xmlns: "http://www.w3.org/2000/svg",
@@ -3959,13 +3948,13 @@ class Me {
3959
3948
  fill: "currentColor",
3960
3949
  class: "icon icon-tabler icons-tabler-filled icon-tabler-info-circle",
3961
3950
  children: [
3962
- /* @__PURE__ */ A("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3963
- /* @__PURE__ */ A("path", { d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z" })
3951
+ /* @__PURE__ */ P("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3952
+ /* @__PURE__ */ P("path", { d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z" })
3964
3953
  ]
3965
3954
  }
3966
3955
  );
3967
3956
  case "dialog":
3968
- return /* @__PURE__ */ A(
3957
+ return /* @__PURE__ */ P(
3969
3958
  "svg",
3970
3959
  {
3971
3960
  xmlns: "http://www.w3.org/2000/svg",
@@ -3979,16 +3968,16 @@ class Me {
3979
3968
  "stroke-linejoin": "round",
3980
3969
  class: "icon icon-tabler icons-tabler-outline icon-tabler-message-dots",
3981
3970
  children: [
3982
- /* @__PURE__ */ A("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3983
- /* @__PURE__ */ A("path", { d: "M12 11v.01" }),
3984
- /* @__PURE__ */ A("path", { d: "M8 11v.01" }),
3985
- /* @__PURE__ */ A("path", { d: "M16 11v.01" }),
3986
- /* @__PURE__ */ A("path", { d: "M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z" })
3971
+ /* @__PURE__ */ P("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3972
+ /* @__PURE__ */ P("path", { d: "M12 11v.01" }),
3973
+ /* @__PURE__ */ P("path", { d: "M8 11v.01" }),
3974
+ /* @__PURE__ */ P("path", { d: "M16 11v.01" }),
3975
+ /* @__PURE__ */ P("path", { d: "M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z" })
3987
3976
  ]
3988
3977
  }
3989
3978
  );
3990
3979
  case "confirm":
3991
- return /* @__PURE__ */ A(
3980
+ return /* @__PURE__ */ P(
3992
3981
  "svg",
3993
3982
  {
3994
3983
  xmlns: "http://www.w3.org/2000/svg",
@@ -3998,8 +3987,8 @@ class Me {
3998
3987
  fill: "currentColor",
3999
3988
  class: "icon icon-tabler icons-tabler-filled icon-tabler-copy-check",
4000
3989
  children: [
4001
- /* @__PURE__ */ A("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
4002
- /* @__PURE__ */ A("path", { d: "M18.333 6a3.667 3.667 0 0 1 3.667 3.667v8.666a3.667 3.667 0 0 1 -3.667 3.667h-8.666a3.667 3.667 0 0 1 -3.667 -3.667v-8.666a3.667 3.667 0 0 1 3.667 -3.667zm-3.333 -4c1.094 0 1.828 .533 2.374 1.514a1 1 0 1 1 -1.748 .972c-.221 -.398 -.342 -.486 -.626 -.486h-10c-.548 0 -1 .452 -1 1v9.998c0 .32 .154 .618 .407 .805l.1 .065a1 1 0 1 1 -.99 1.738a3 3 0 0 1 -1.517 -2.606v-10c0 -1.652 1.348 -3 3 -3zm1.293 9.293l-3.293 3.292l-1.293 -1.292a1 1 0 0 0 -1.414 1.414l2 2a1 1 0 0 0 1.414 0l4 -4a1 1 0 0 0 -1.414 -1.414" })
3990
+ /* @__PURE__ */ P("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
3991
+ /* @__PURE__ */ P("path", { d: "M18.333 6a3.667 3.667 0 0 1 3.667 3.667v8.666a3.667 3.667 0 0 1 -3.667 3.667h-8.666a3.667 3.667 0 0 1 -3.667 -3.667v-8.666a3.667 3.667 0 0 1 3.667 -3.667zm-3.333 -4c1.094 0 1.828 .533 2.374 1.514a1 1 0 1 1 -1.748 .972c-.221 -.398 -.342 -.486 -.626 -.486h-10c-.548 0 -1 .452 -1 1v9.998c0 .32 .154 .618 .407 .805l.1 .065a1 1 0 1 1 -.99 1.738a3 3 0 0 1 -1.517 -2.606v-10c0 -1.652 1.348 -3 3 -3zm1.293 9.293l-3.293 3.292l-1.293 -1.292a1 1 0 0 0 -1.414 1.414l2 2a1 1 0 0 0 1.414 0l4 -4a1 1 0 0 0 -1.414 -1.414" })
4003
3992
  ]
4004
3993
  }
4005
3994
  );
@@ -4013,13 +4002,13 @@ class Me {
4013
4002
  t.title = a[0].toUpperCase() + a.slice(1).toLowerCase();
4014
4003
  }
4015
4004
  const n = t.icon ?? this.getDefaultNotifyIcon(e);
4016
- n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ A(Hi, { children: [
4005
+ n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ P(zi, { children: [
4017
4006
  n,
4018
4007
  t.title
4019
- ] })), e === "confirm" && (typeof t.closeAfter > "u" && (t.closeAfter = 0), t.okBtn || (t.okBtn = { label: "OK" })), t.okBtn && (typeof t.okBtn != "object" && (t.okBtn = { label: "OK" }), t.okBtn.label ??= "OK", t.okBtn.className ??= "is-primary is-text ok-btn", t.okBtn.method = (a, c) => {
4020
- i?.(!0, c, a), c.close();
4021
- }), t.cancelBtn && (typeof t.cancelBtn != "object" && (t.cancelBtn = { label: "Cancel" }), t.cancelBtn.label ??= "Cancel", t.cancelBtn.className ??= "is-danger is-text cancel-btn", t.cancelBtn.method = (a, c) => {
4022
- i?.(!1, c, a), c.close();
4008
+ ] })), t.okBtn && (t.okBtn.label ??= "OK", t.okBtn.className ??= "is-primary is-ghost ok-btn", t.okBtn.method = () => {
4009
+ i?.(!0), o.close();
4010
+ }), t.cancelBtn && (t.cancelBtn.label ??= "Cancel", t.cancelBtn.className ??= "is-danger is-ghost cancel-btn", t.cancelBtn.method = () => {
4011
+ i?.(!1), o.close();
4023
4012
  }), t.buttons = [t.cancelBtn, t.okBtn, ...t.buttons ?? []].filter(
4024
4013
  Boolean
4025
4014
  );
@@ -4032,6 +4021,10 @@ class Me {
4032
4021
  closeIcon: !0,
4033
4022
  outSideClose: !1,
4034
4023
  bodyScroll: !0,
4024
+ animation: t.animation ?? {
4025
+ show: "fadeIn",
4026
+ hide: "fadeOut"
4027
+ },
4035
4028
  buttons: t.buttons ?? []
4036
4029
  });
4037
4030
  return o.setPluginName("toast"), o.showToast({
@@ -4040,15 +4033,15 @@ class Me {
4040
4033
  }
4041
4034
  }
4042
4035
  const oe = [];
4043
- function en(r = "top right") {
4036
+ function Zi(r = "top right") {
4044
4037
  const e = "ipe-modal-toast-container", t = `${e}-${r.replace(/[\s-\.|\/]+/g, "-")}`;
4045
4038
  let i = document.getElementById(t);
4046
- return i || (i = M("div", {
4039
+ return i || (i = U("div", {
4047
4040
  className: `${e} ${r}`,
4048
4041
  attrs: { id: t, "data-position": r }
4049
4042
  }), document.body.appendChild(i)), i;
4050
4043
  }
4051
- class T extends Me {
4044
+ class L extends yt {
4052
4045
  constructor(e = {}) {
4053
4046
  e.className ||= "", e.className += " theme-ipe", e.modalAnimation ||= {
4054
4047
  show: "ipe-modal-fade-in",
@@ -4092,10 +4085,10 @@ class T extends Me {
4092
4085
  }
4093
4086
  }
4094
4087
  }
4095
- class tn {
4088
+ class en {
4096
4089
  constructor(e) {
4097
- this.ctx = e, this.IPEModal = T, this.IPEModalEvent = gt, this.show = T.show.bind(T), this.createObject = T.createObject.bind(T), this.close = T.close.bind(T), this.closeAll = T.closeAll.bind(T), this.removeAll = T.removeAll.bind(T), this.dialog = T.dialog.bind(T), this.confirm = T.confirm.bind(T), this.notify = T.notify.bind(T), e.set("modal", this), e.on("dispose", () => {
4098
- T.closeAll();
4090
+ this.ctx = e, this.IPEModal = L, this.IPEModalEvent = gt, this.show = L.show.bind(L), this.createObject = L.createObject.bind(L), this.close = L.close.bind(L), this.closeAll = L.closeAll.bind(L), this.removeAll = L.removeAll.bind(L), this.dialog = L.dialog.bind(L), this.confirm = L.confirm.bind(L), this.notify = L.notify.bind(L), e.set("modal", this), e.on("dispose", () => {
4091
+ L.closeAll();
4099
4092
  });
4100
4093
  }
4101
4094
  }
@@ -4128,20 +4121,20 @@ const ur = (r) => {
4128
4121
  n.set(o, a);
4129
4122
  return i.search = n.toString(), i.hash = "", i;
4130
4123
  };
4131
- var rn = Object.create, yt = Object.defineProperty, nn = Object.getOwnPropertyDescriptor, fr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), dr = (r) => {
4124
+ var tn = Object.create, wt = Object.defineProperty, rn = Object.getOwnPropertyDescriptor, fr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), dr = (r) => {
4132
4125
  throw TypeError(r);
4133
- }, sn = (r, e, t) => e in r ? yt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, on = (r, e) => yt(r, "name", { value: e, configurable: !0 }), an = (r) => [, , , rn(r?.[fr("metadata")] ?? null)], cn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], pr = (r) => r !== void 0 && typeof r != "function" ? dr("Function expected") : r, ln = (r, e, t, i, n) => ({ kind: cn[r], name: e, metadata: i, addInitializer: (s) => t._ ? dr("Already initialized") : n.push(pr(s || null)) }), un = (r, e) => sn(e, fr("metadata"), r[3]), hn = (r, e, t, i) => {
4126
+ }, nn = (r, e, t) => e in r ? wt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, sn = (r, e) => wt(r, "name", { value: e, configurable: !0 }), on = (r) => [, , , tn(r?.[fr("metadata")] ?? null)], an = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], pr = (r) => r !== void 0 && typeof r != "function" ? dr("Function expected") : r, cn = (r, e, t, i, n) => ({ kind: an[r], name: e, metadata: i, addInitializer: (s) => t._ ? dr("Already initialized") : n.push(pr(s || null)) }), ln = (r, e) => nn(e, fr("metadata"), r[3]), un = (r, e, t, i) => {
4134
4127
  for (var n = 0, s = r[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
4135
4128
  return i;
4136
- }, fn = (r, e, t, i, n, s) => {
4137
- var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && nn(n, t));
4138
- on(n, t);
4139
- for (var v = i.length - 1; v >= 0; v--)
4140
- c = ln(u, t, a = {}, r[3], w), o = (0, i[v])(n, c), a._ = 1, pr(o) && (n = o);
4141
- return un(r, n), g && yt(n, t, g), p ? u ^ 4 ? s : g : n;
4142
- }, mr, wt, gr;
4129
+ }, hn = (r, e, t, i, n, s) => {
4130
+ var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && rn(n, t));
4131
+ sn(n, t);
4132
+ for (var b = i.length - 1; b >= 0; b--)
4133
+ c = cn(u, t, a = {}, r[3], w), o = (0, i[b])(n, c), a._ = 1, pr(o) && (n = o);
4134
+ return ln(r, n), g && wt(n, t, g), p ? u ^ 4 ? s : g : n;
4135
+ }, mr, bt, gr;
4143
4136
  mr = [le(["api", "storage"])];
4144
- class Be extends (gr = he) {
4137
+ class Me extends (gr = he) {
4145
4138
  constructor(e) {
4146
4139
  super(e, "wiki", !1), this.ctx = e, this._data = void 0, this.CACHE_TTL = 1e3 * 60 * 60 * 24, this.VERSION = 2, this.db = void 0, this.logger = void 0, this.queryData = {
4147
4140
  meta: "siteinfo|userinfo",
@@ -4169,8 +4162,8 @@ class Be extends (gr = he) {
4169
4162
  this.logger.info("loaded", this._data), this.ctx.set("getUrl", this.getUrl.bind(this)), this.ctx.set("getSciprtUrl", this.getSciprtUrl.bind(this)), this.ctx.set("getMainpageUrl", this.getMainpageUrl.bind(this)), this.ctx.inject(["preferences"], (t) => {
4170
4163
  t.preferences.registerCustomConfig(
4171
4164
  "WikiMetadataService",
4172
- Ze.object({
4173
- WikiMetadataService: Ze.const(
4165
+ Qe.object({
4166
+ WikiMetadataService: Qe.const(
4174
4167
  /* @__PURE__ */ W("div", { children: [
4175
4168
  /* @__PURE__ */ W("h3", { children: "Wiki Informations" }),
4176
4169
  /* @__PURE__ */ W("ul", { children: [
@@ -4379,9 +4372,9 @@ class Be extends (gr = he) {
4379
4372
  } : null;
4380
4373
  }
4381
4374
  }
4382
- wt = an(gr);
4383
- Be = fn(wt, 0, "WikiMetadataService", mr, Be);
4384
- hn(wt, 1, Be);
4375
+ bt = on(gr);
4376
+ Me = hn(bt, 0, "WikiMetadataService", mr, Me);
4377
+ un(bt, 1, Me);
4385
4378
  var I;
4386
4379
  ((r) => {
4387
4380
  function e(l) {
@@ -4392,12 +4385,12 @@ var I;
4392
4385
  r.promisifyRequest = e;
4393
4386
  const t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
4394
4387
  function n(l, d) {
4395
- const b = (i.get(l) ?? Promise.resolve()).then(d, d);
4388
+ const m = (i.get(l) ?? Promise.resolve()).then(d, d);
4396
4389
  return i.set(
4397
4390
  l,
4398
- b.catch(() => {
4391
+ m.catch(() => {
4399
4392
  })
4400
- ), b;
4393
+ ), m;
4401
4394
  }
4402
4395
  function s(l) {
4403
4396
  return new Promise((d) => setTimeout(d, l + Math.floor(Math.random() * 8)));
@@ -4412,18 +4405,18 @@ var I;
4412
4405
  function a(l) {
4413
4406
  const d = t.get(l);
4414
4407
  if (d) return d;
4415
- const m = new Promise((b, S) => {
4408
+ const m = new Promise((v, S) => {
4416
4409
  const E = indexedDB.open(l);
4417
4410
  E.onupgradeneeded = () => {
4418
4411
  }, E.onsuccess = () => {
4419
- const N = E.result;
4420
- N.onversionchange = () => {
4412
+ const M = E.result;
4413
+ M.onversionchange = () => {
4421
4414
  try {
4422
- N.close();
4415
+ M.close();
4423
4416
  } finally {
4424
4417
  t.delete(l);
4425
4418
  }
4426
- }, b(N);
4419
+ }, v(M);
4427
4420
  }, E.onerror = () => S(E.error), E.onblocked = () => {
4428
4421
  };
4429
4422
  });
@@ -4447,41 +4440,41 @@ var I;
4447
4440
  r.closeAllDatabases = u;
4448
4441
  async function p(l) {
4449
4442
  await c(l), await new Promise((d, m) => {
4450
- const b = indexedDB.deleteDatabase(l);
4451
- b.onsuccess = () => d(), b.onerror = () => m(b.error), b.onblocked = () => {
4443
+ const v = indexedDB.deleteDatabase(l);
4444
+ v.onsuccess = () => d(), v.onerror = () => m(v.error), v.onblocked = () => {
4452
4445
  };
4453
4446
  });
4454
4447
  }
4455
4448
  r.deleteDatabase = p;
4456
4449
  async function y(l, d, m = {}) {
4457
4450
  return n(l, async () => {
4458
- let b = await a(l);
4459
- const S = !b.objectStoreNames.contains(d), E = !S && m.indexes && m.indexes.length > 0;
4451
+ let v = await a(l);
4452
+ const S = !v.objectStoreNames.contains(d), E = !S && m.indexes && m.indexes.length > 0;
4460
4453
  if (!S && !E)
4461
- return b;
4462
- const N = b.version + 1;
4463
- b.close();
4464
- const re = new Promise((ie, H) => {
4465
- const j = indexedDB.open(l, N);
4454
+ return v;
4455
+ const M = v.version + 1;
4456
+ v.close();
4457
+ const re = new Promise((ie, q) => {
4458
+ const j = indexedDB.open(l, M);
4466
4459
  j.onupgradeneeded = () => {
4467
- const P = j.result;
4460
+ const A = j.result;
4468
4461
  let G;
4469
- if (P.objectStoreNames.contains(d) ? G = j.transaction.objectStore(d) : G = P.createObjectStore(d, {
4462
+ if (A.objectStoreNames.contains(d) ? G = j.transaction.objectStore(d) : G = A.createObjectStore(d, {
4470
4463
  keyPath: m.keyPath ?? void 0,
4471
4464
  autoIncrement: !!m.autoIncrement
4472
4465
  }), m.indexes && m.indexes.length > 0)
4473
- for (const { name: $e, keyPath: K, options: Ae } of m.indexes)
4474
- G.indexNames.contains($e) || G.createIndex($e, K, Ae);
4466
+ for (const { name: Re, keyPath: K, options: Pe } of m.indexes)
4467
+ G.indexNames.contains(Re) || G.createIndex(Re, K, Pe);
4475
4468
  }, j.onsuccess = () => {
4476
- const P = j.result;
4477
- P.onversionchange = () => {
4469
+ const A = j.result;
4470
+ A.onversionchange = () => {
4478
4471
  try {
4479
- P.close();
4472
+ A.close();
4480
4473
  } finally {
4481
4474
  t.delete(l);
4482
4475
  }
4483
- }, ie(P);
4484
- }, j.onerror = () => H(j.error), j.onblocked = () => {
4476
+ }, ie(A);
4477
+ }, j.onerror = () => q(j.error), j.onblocked = () => {
4485
4478
  };
4486
4479
  });
4487
4480
  return t.set(l, re), re;
@@ -4496,47 +4489,47 @@ var I;
4496
4489
  };
4497
4490
  }
4498
4491
  r.createStore = w;
4499
- async function g(l, d, m, b = {}) {
4500
- const { dbName: S, storeName: E } = l, N = b.attempts ?? 2, re = b.baseDelayMs ?? 16;
4492
+ async function g(l, d, m, v = {}) {
4493
+ const { dbName: S, storeName: E } = l, M = v.attempts ?? 2, re = v.baseDelayMs ?? 16;
4501
4494
  let ie;
4502
- for (let H = 0; H <= N; H++)
4495
+ for (let q = 0; q <= M; q++)
4503
4496
  try {
4504
- H === 0 && await y(S, E);
4497
+ q === 0 && await y(S, E);
4505
4498
  const j = await a(S);
4506
- let P;
4499
+ let A;
4507
4500
  try {
4508
- P = j.transaction(E, d);
4501
+ A = j.transaction(E, d);
4509
4502
  } catch (K) {
4510
- if (o(K) && H < N) {
4511
- await c(S), await s(re * (1 << H)), ie = K;
4503
+ if (o(K) && q < M) {
4504
+ await c(S), await s(re * (1 << q)), ie = K;
4512
4505
  continue;
4513
4506
  }
4514
4507
  throw K;
4515
4508
  }
4516
- const G = P.objectStore(E), $e = new Promise((K, Ae) => {
4517
- P.oncomplete = () => K(), P.onerror = () => Ae(P.error), P.onabort = () => Ae(P.error);
4509
+ const G = A.objectStore(E), Re = new Promise((K, Pe) => {
4510
+ A.oncomplete = () => K(), A.onerror = () => Pe(A.error), A.onabort = () => Pe(A.error);
4518
4511
  });
4519
4512
  try {
4520
4513
  const K = await m(G);
4521
- return await $e, K;
4514
+ return await Re, K;
4522
4515
  } catch (K) {
4523
- if (o(K) && H < N) {
4516
+ if (o(K) && q < M) {
4524
4517
  try {
4525
- P.abort();
4518
+ A.abort();
4526
4519
  } catch {
4527
4520
  }
4528
- await c(S), await s(re * (1 << H)), ie = K;
4521
+ await c(S), await s(re * (1 << q)), ie = K;
4529
4522
  continue;
4530
4523
  }
4531
4524
  try {
4532
- P.abort();
4525
+ A.abort();
4533
4526
  } catch {
4534
4527
  }
4535
4528
  throw K;
4536
4529
  }
4537
4530
  } catch (j) {
4538
- if (o(j) && H < N) {
4539
- await c(S), await s(re * (1 << H)), ie = j;
4531
+ if (o(j) && q < M) {
4532
+ await c(S), await s(re * (1 << q)), ie = j;
4540
4533
  continue;
4541
4534
  }
4542
4535
  throw j;
@@ -4544,62 +4537,62 @@ var I;
4544
4537
  throw ie;
4545
4538
  }
4546
4539
  r.withObjectStore = g;
4547
- async function v(l, d) {
4540
+ async function b(l, d) {
4548
4541
  return g(l, "readonly", async (m) => {
4549
- const b = m.get(d);
4550
- return e(b);
4542
+ const v = m.get(d);
4543
+ return e(v);
4551
4544
  });
4552
4545
  }
4553
- r.get = v;
4554
- async function R(l, d, m) {
4555
- return g(l, "readwrite", async (b) => {
4556
- const S = b.put(m, d);
4546
+ r.get = b;
4547
+ async function $(l, d, m) {
4548
+ return g(l, "readwrite", async (v) => {
4549
+ const S = v.put(m, d);
4557
4550
  await e(S);
4558
4551
  });
4559
4552
  }
4560
- r.set = R;
4553
+ r.set = $;
4561
4554
  async function C(l, d) {
4562
4555
  return g(l, "readwrite", async (m) => {
4563
- const b = m.delete(d);
4564
- await e(b);
4556
+ const v = m.delete(d);
4557
+ await e(v);
4565
4558
  });
4566
4559
  }
4567
4560
  r.del = C;
4568
- async function $(l) {
4561
+ async function R(l) {
4569
4562
  return g(l, "readwrite", async (d) => {
4570
4563
  const m = d.clear();
4571
4564
  await e(m);
4572
4565
  });
4573
4566
  }
4574
- r.clear = $;
4567
+ r.clear = R;
4575
4568
  function f(l, d = 100) {
4576
4569
  return {
4577
4570
  [Symbol.asyncIterator]() {
4578
- let m = [], b = !1, S;
4571
+ let m = [], v = !1, S;
4579
4572
  const E = async () => {
4580
- b || (m = [], await g(l, "readonly", async (N) => {
4573
+ v || (m = [], await g(l, "readonly", async (M) => {
4581
4574
  const re = S === void 0 ? void 0 : IDBKeyRange.lowerBound(
4582
4575
  S,
4583
4576
  /* open */
4584
4577
  !0
4585
4578
  );
4586
- await new Promise((ie, H) => {
4579
+ await new Promise((ie, q) => {
4587
4580
  let j = 0;
4588
- const P = N.openCursor(re, "next");
4589
- P.onsuccess = () => {
4590
- const G = P.result;
4581
+ const A = M.openCursor(re, "next");
4582
+ A.onsuccess = () => {
4583
+ const G = A.result;
4591
4584
  if (!G || j >= d) {
4592
4585
  ie();
4593
4586
  return;
4594
4587
  }
4595
4588
  m.push([G.key, G.value]), S = G.key, j++, G.continue();
4596
- }, P.onerror = () => H(P.error);
4597
- }), m.length === 0 && (b = !0);
4589
+ }, A.onerror = () => q(A.error);
4590
+ }), m.length === 0 && (v = !0);
4598
4591
  }));
4599
4592
  };
4600
4593
  return {
4601
4594
  async next() {
4602
- return m.length === 0 && !b && await E(), m.length === 0 ? { value: void 0, done: !0 } : { value: m.shift(), done: !1 };
4595
+ return m.length === 0 && !v && await E(), m.length === 0 ? { value: void 0, done: !0 } : { value: m.shift(), done: !1 };
4603
4596
  }
4604
4597
  };
4605
4598
  }
@@ -4610,10 +4603,10 @@ var I;
4610
4603
  const m = f(l, d);
4611
4604
  return {
4612
4605
  [Symbol.asyncIterator]() {
4613
- const b = m[Symbol.asyncIterator]();
4606
+ const v = m[Symbol.asyncIterator]();
4614
4607
  return {
4615
4608
  async next() {
4616
- const S = await b.next();
4609
+ const S = await v.next();
4617
4610
  return S.done ? { value: void 0, done: !0 } : { value: S.value[0], done: !1 };
4618
4611
  }
4619
4612
  };
@@ -4622,19 +4615,28 @@ var I;
4622
4615
  }
4623
4616
  r.keys = h;
4624
4617
  })(I || (I = {}));
4625
- class dn {
4618
+ /**
4619
+ * IDB Plus
4620
+ *
4621
+ * 🗄️ Minimal Promise based IndexedDB Wrapper with Map-like API
4622
+ *
4623
+ * @author dragon-fish <dragon-fish@qq.com>
4624
+ * @license MIT
4625
+ */
4626
+ class fn {
4626
4627
  constructor(e, t, i = {}) {
4627
4628
  this.dbName = e, this.storeName = t, this.iterBatch = (i.iterBatch ?? 100) | 0, this.retry = i.retry, this.inlineKey = !!i.ensure?.keyPath, this.idbStoreHandle = I.createStore(e, t, i.ensure ?? {});
4628
4629
  }
4629
- handle() {
4630
- return this.idbStoreHandle;
4631
- }
4630
+ iterBatch;
4631
+ retry;
4632
+ inlineKey;
4633
+ idbStoreHandle;
4632
4634
  async get(e) {
4633
- const t = await this.handle();
4635
+ const t = await this.idbStoreHandle;
4634
4636
  return I.get(t, e);
4635
4637
  }
4636
4638
  async set(e, t) {
4637
- const i = await this.handle();
4639
+ const i = await this.idbStoreHandle;
4638
4640
  return this.inlineKey ? I.withObjectStore(
4639
4641
  i,
4640
4642
  "readwrite",
@@ -4646,15 +4648,15 @@ class dn {
4646
4648
  ) : I.set(i, e, t);
4647
4649
  }
4648
4650
  async delete(e) {
4649
- const t = await this.handle();
4651
+ const t = await this.idbStoreHandle;
4650
4652
  return I.del(t, e);
4651
4653
  }
4652
4654
  async clear() {
4653
- const e = await this.handle();
4655
+ const e = await this.idbStoreHandle;
4654
4656
  return I.clear(e);
4655
4657
  }
4656
4658
  async has(e) {
4657
- const t = await this.handle();
4659
+ const t = await this.idbStoreHandle;
4658
4660
  return I.withObjectStore(
4659
4661
  t,
4660
4662
  "readonly",
@@ -4666,7 +4668,7 @@ class dn {
4666
4668
  );
4667
4669
  }
4668
4670
  async count() {
4669
- const e = await this.handle();
4671
+ const e = await this.idbStoreHandle;
4670
4672
  return I.withObjectStore(
4671
4673
  e,
4672
4674
  "readonly",
@@ -4685,8 +4687,8 @@ class dn {
4685
4687
  return {
4686
4688
  async next() {
4687
4689
  if (!t) {
4688
- const n = await e.handle();
4689
- t = I.entries(n, e.iterBatch)[Symbol.asyncIterator]();
4690
+ const i = await e.idbStoreHandle;
4691
+ t = I.entries(i, e.iterBatch)[Symbol.asyncIterator]();
4690
4692
  }
4691
4693
  return await t.next();
4692
4694
  }
@@ -4702,8 +4704,8 @@ class dn {
4702
4704
  return {
4703
4705
  async next() {
4704
4706
  if (!t) {
4705
- const n = await e.handle();
4706
- t = I.keys(n, e.iterBatch)[Symbol.asyncIterator]();
4707
+ const i = await e.idbStoreHandle;
4708
+ t = I.keys(i, e.iterBatch)[Symbol.asyncIterator]();
4707
4709
  }
4708
4710
  return await t.next();
4709
4711
  }
@@ -4733,12 +4735,12 @@ class dn {
4733
4735
  await e(i, t, this);
4734
4736
  }
4735
4737
  async setMany(e) {
4736
- const t = await this.handle();
4738
+ const t = await this.idbStoreHandle;
4737
4739
  await I.withObjectStore(
4738
4740
  t,
4739
4741
  "readwrite",
4740
4742
  async (i) => {
4741
- for await (const [n, s] of Ct(e)) {
4743
+ for await (const [n, s] of jt(e)) {
4742
4744
  const o = this.inlineKey ? i.put(s) : i.put(s, n);
4743
4745
  await I.promisifyRequest(o);
4744
4746
  }
@@ -4747,12 +4749,12 @@ class dn {
4747
4749
  );
4748
4750
  }
4749
4751
  async deleteMany(e) {
4750
- const t = await this.handle();
4752
+ const t = await this.idbStoreHandle;
4751
4753
  await I.withObjectStore(
4752
4754
  t,
4753
4755
  "readwrite",
4754
4756
  async (i) => {
4755
- for await (const n of Ct(e)) {
4757
+ for await (const n of jt(e)) {
4756
4758
  const s = i.delete(n);
4757
4759
  await I.promisifyRequest(s);
4758
4760
  }
@@ -4761,31 +4763,23 @@ class dn {
4761
4763
  );
4762
4764
  }
4763
4765
  async tx(e, t) {
4764
- const i = await this.handle();
4766
+ const i = await this.idbStoreHandle;
4765
4767
  return I.withObjectStore(i, e, t, this.retry);
4766
4768
  }
4767
4769
  async close() {
4768
4770
  await I.closeDatabase(this.dbName);
4769
4771
  }
4770
4772
  }
4771
- function Ct(r) {
4773
+ function jt(r) {
4772
4774
  return r[Symbol.asyncIterator] ? r : {
4773
4775
  async *[Symbol.asyncIterator]() {
4774
4776
  for (const e of r) yield e;
4775
4777
  }
4776
4778
  };
4777
4779
  }
4778
- class pn extends he {
4779
- constructor(e) {
4780
- super(e, "storage", !1);
4781
- }
4782
- createDatabse(e, t, i) {
4783
- return new mn("InPageEdit", e, t, i);
4784
- }
4785
- }
4786
- class mn {
4780
+ class dn {
4787
4781
  constructor(e, t, i = 1 / 0, n) {
4788
- this.dbName = e, this.storeName = t, this.ttl = i, this.version = n, this.db = new dn(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);
4782
+ this.dbName = e, this.storeName = t, this.ttl = i, this.version = n, this.db = new fn(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);
4789
4783
  }
4790
4784
  async get(e, t = this.ttl, i) {
4791
4785
  const n = await this.loadFromDB(e), s = this.checkIfExpired(n, t);
@@ -4846,8 +4840,16 @@ class mn {
4846
4840
  return await this.db.clear(), this;
4847
4841
  }
4848
4842
  }
4843
+ class pn extends he {
4844
+ constructor(e) {
4845
+ super(e, "storage", !1);
4846
+ }
4847
+ createDatabse(e, t, i) {
4848
+ return new dn("InPageEdit", e, t, i);
4849
+ }
4850
+ }
4849
4851
  var yr = /* @__PURE__ */ ((r) => (r.preferences = "preferences", r.watch = "watch", r.unwatch = "unwatch", r.nochange = "nochange", r))(yr || {});
4850
- function gn(r) {
4852
+ function mn(r) {
4851
4853
  class e {
4852
4854
  constructor(i, n = !0) {
4853
4855
  this._loaded = n, this.api = r, i.revisions?.forEach((s) => {
@@ -5038,9 +5040,9 @@ function gn(r) {
5038
5040
  }
5039
5041
  return e;
5040
5042
  }
5041
- class yn extends he {
5043
+ class gn extends he {
5042
5044
  constructor(e) {
5043
- super(e, "wikiPage", !0), this.ctx = e, this.WikiPage = gn(this.ctx.api);
5045
+ super(e, "wikiPage", !0), this.ctx = e, this.WikiPage = mn(this.ctx.api);
5044
5046
  }
5045
5047
  static {
5046
5048
  this.inject = ["api"];
@@ -5061,7 +5063,7 @@ class yn extends he {
5061
5063
  return this.WikiPage.newBlankPage(e);
5062
5064
  }
5063
5065
  }
5064
- const jt = /* @__PURE__ */ new WeakMap(), V = {
5066
+ const Nt = /* @__PURE__ */ new WeakMap(), J = {
5065
5067
  toDBKey: (r) => r.replace(/ /g, "_"),
5066
5068
  toNormalText: (r) => r.replace(/_/g, " "),
5067
5069
  ensureCase: (r, e) => e === "first-letter" ? r.charAt(0).toUpperCase() + r.slice(1) : r
@@ -5099,7 +5101,7 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
5099
5101
  const n = me.normalizeSpecialPageName(t);
5100
5102
  return e.byNormalized.get(n) ?? null;
5101
5103
  }
5102
- }, J = {
5104
+ }, X = {
5103
5105
  /**
5104
5106
  * 标准化命名空间文本:转换为全小写+下划线格式
5105
5107
  */
@@ -5109,12 +5111,12 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
5109
5111
  for (const [s, o] of Object.entries(r.namespaces)) {
5110
5112
  const a = parseInt(s);
5111
5113
  e.set(o.name, a), t.set(o.canonical ?? "", a);
5112
- const c = J.normalizeNamespaceText(o.name), u = J.normalizeNamespaceText(o.canonical ?? "");
5114
+ const c = X.normalizeNamespaceText(o.name), u = X.normalizeNamespaceText(o.canonical ?? "");
5113
5115
  n.set(c, a), n.set(u, a);
5114
5116
  }
5115
5117
  for (const s of r.namespacealiases) {
5116
5118
  i.set(s.alias, s.id);
5117
- const o = J.normalizeNamespaceText(s.alias);
5119
+ const o = X.normalizeNamespaceText(s.alias);
5118
5120
  n.set(o, s.id);
5119
5121
  }
5120
5122
  return { byName: e, byCanonical: t, byAlias: i, byNormalized: n };
@@ -5123,7 +5125,7 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
5123
5125
  let t = e.byName.get(r) ?? e.byCanonical.get(r) ?? e.byAlias.get(r);
5124
5126
  if (t !== void 0)
5125
5127
  return t;
5126
- const i = J.normalizeNamespaceText(r);
5128
+ const i = X.normalizeNamespaceText(r);
5127
5129
  return e.byNormalized.get(i) ?? null;
5128
5130
  },
5129
5131
  isTalkPage: (r) => r % 2 === 1 && r > 0,
@@ -5137,14 +5139,14 @@ const jt = /* @__PURE__ */ new WeakMap(), V = {
5137
5139
  subpages: !1
5138
5140
  })
5139
5141
  };
5140
- function wn(r) {
5141
- const e = jt.get(r);
5142
+ function yn(r) {
5143
+ const e = Nt.get(r);
5142
5144
  if (e)
5143
5145
  return e;
5144
- const t = J.buildIndex(r), i = me.buildSpecialPageIndex(r);
5146
+ const t = X.buildIndex(r), i = me.buildSpecialPageIndex(r);
5145
5147
  class n {
5146
5148
  constructor(o, a) {
5147
- if (this.newTitle = n.create.bind(n), this.toText = this.getPrefixedText.bind(this), this.toString = this.getPrefixedDBKey.bind(this), this.#e = o || "", this.#t = a ?? 0, a === void 0 && this.fixNSByTitle(), this.getMainText() === "")
5149
+ if (this.newTitle = n.create.bind(n), this.toText = this.getPrefixedText.bind(this), this.toString = this.getPrefixedDBKey.bind(this), this.#e = o || "", this.#t = a ?? 0, a === void 0 ? this.fixNSByTitle() : this.stripNamespaceFromTitle(), this.getMainText() === "")
5148
5150
  throw new Error("Invalid title");
5149
5151
  }
5150
5152
  static {
@@ -5171,14 +5173,28 @@ function wn(r) {
5171
5173
  this.#e = this.#e.substring(1);
5172
5174
  return;
5173
5175
  }
5174
- const a = this.#e.substring(0, o), c = this.#e.substring(o + 1), u = J.findNamespaceId(
5176
+ const a = this.#e.substring(0, o), c = this.#e.substring(o + 1), u = X.findNamespaceId(
5175
5177
  a,
5176
5178
  n._namespaceIndex
5177
5179
  );
5178
5180
  u !== null && (this.#e = c, this.#t = u);
5179
5181
  }
5182
+ stripNamespaceFromTitle() {
5183
+ const o = this.#e.indexOf(":");
5184
+ if (o === -1)
5185
+ return;
5186
+ if (o === 0) {
5187
+ this.#e = this.#e.substring(1);
5188
+ return;
5189
+ }
5190
+ const a = this.#e.substring(0, o), c = this.#e.substring(o + 1);
5191
+ X.findNamespaceId(
5192
+ a,
5193
+ n._namespaceIndex
5194
+ ) !== null && (this.#e = c);
5195
+ }
5180
5196
  getNamespaceInfo() {
5181
- return n._meta.namespaces[this.#t] ?? J.getDefaultNamespaceInfo(this.#t);
5197
+ return n._meta.namespaces[this.#t] ?? X.getDefaultNamespaceInfo(this.#t);
5182
5198
  }
5183
5199
  getMainDBKey() {
5184
5200
  const o = this.getNamespaceInfo();
@@ -5189,10 +5205,10 @@ function wn(r) {
5189
5205
  );
5190
5206
  if (a) {
5191
5207
  const c = this.#e.includes("/") ? this.#e.substring(this.#e.indexOf("/")) : "", u = a + c;
5192
- return V.ensureCase(V.toDBKey(u), o.case);
5208
+ return J.ensureCase(J.toDBKey(u), o.case);
5193
5209
  }
5194
5210
  }
5195
- return V.ensureCase(V.toDBKey(this.#e), o.case);
5211
+ return J.ensureCase(J.toDBKey(this.#e), o.case);
5196
5212
  }
5197
5213
  getMainText() {
5198
5214
  const o = this.getNamespaceInfo();
@@ -5203,10 +5219,10 @@ function wn(r) {
5203
5219
  );
5204
5220
  if (a) {
5205
5221
  const c = this.#e.includes("/") ? this.#e.substring(this.#e.indexOf("/")) : "", u = a + c;
5206
- return V.ensureCase(V.toNormalText(u), o.case);
5222
+ return J.ensureCase(J.toNormalText(u), o.case);
5207
5223
  }
5208
5224
  }
5209
- return V.ensureCase(V.toNormalText(this.#e), o.case);
5225
+ return J.ensureCase(J.toNormalText(this.#e), o.case);
5210
5226
  }
5211
5227
  getMainRootText() {
5212
5228
  return this.getMainText().split("/")[0];
@@ -5225,17 +5241,17 @@ function wn(r) {
5225
5241
  }
5226
5242
  getNamespaceDBKey() {
5227
5243
  const o = this.getNamespaceInfo();
5228
- return V.ensureCase(V.toDBKey(this.getNamespaceText()), o.case);
5244
+ return J.ensureCase(J.toDBKey(this.getNamespaceText()), o.case);
5229
5245
  }
5230
5246
  getSubjectPage() {
5231
- if (J.isTalkPage(this.#t)) {
5247
+ if (X.isTalkPage(this.#t)) {
5232
5248
  const o = this.#t - 1;
5233
5249
  return new n(this.#e, o);
5234
5250
  }
5235
5251
  return this;
5236
5252
  }
5237
5253
  getTalkPage() {
5238
- if (J.isTalkPage(this.#t))
5254
+ if (X.isTalkPage(this.#t))
5239
5255
  return this;
5240
5256
  if (this.#t < 0)
5241
5257
  return null;
@@ -5243,7 +5259,7 @@ function wn(r) {
5243
5259
  return n._meta.namespaces[o.toString()] ? new n(this.#e, o) : null;
5244
5260
  }
5245
5261
  getURL(o) {
5246
- const a = n._meta.general.articlepath, c = this.getPrefixedDBKey(), u = a.replace("$1", c), p = new URL(u, n._meta.general.base);
5262
+ const a = n._meta.general.articlepath, c = this.getPrefixedDBKey(), u = a.replace("$1", c), p = new URL(u, location.origin);
5247
5263
  return o && (o instanceof URLSearchParams ? o : new URLSearchParams(o)).forEach((w, g) => {
5248
5264
  p.searchParams.set(g, w);
5249
5265
  }), p;
@@ -5259,7 +5275,7 @@ function wn(r) {
5259
5275
  return this.#e = o, this;
5260
5276
  }
5261
5277
  setNamespaceText(o) {
5262
- const a = J.findNamespaceId(o, n._namespaceIndex);
5278
+ const a = X.findNamespaceId(o, n._namespaceIndex);
5263
5279
  return a !== null && (this.#t = a), this;
5264
5280
  }
5265
5281
  setNamespaceId(o) {
@@ -5284,11 +5300,11 @@ function wn(r) {
5284
5300
  };
5285
5301
  }
5286
5302
  }
5287
- return jt.set(r, n), n;
5303
+ return Nt.set(r, n), n;
5288
5304
  }
5289
- class bt extends he {
5305
+ class vt extends he {
5290
5306
  constructor(e) {
5291
- super(e, "wikiTitle", !0), this.ctx = e, this.logger = this.ctx.logger("WikiTitleService"), this._cachedTitles = /* @__PURE__ */ new Map(), this.wiki = this.ctx.wiki, this.wikiBaseUrl = this.wiki.baseUrl, this.wikiArticlePath = this.wiki.articlePath.replace("$1", ""), this.wikiArticleBaseUrl = this.wiki.articleBaseUrl.replace("$1", ""), this.wikiIndexPhpUrl = this.wiki.getSciprtUrl("index.php"), this.Title = wn(this.ctx.wiki._raw);
5307
+ 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 = yn(this.ctx.wiki._raw);
5292
5308
  }
5293
5309
  static {
5294
5310
  this.inject = ["wiki"];
@@ -5312,7 +5328,7 @@ class bt extends he {
5312
5328
  throw new Error("Invalid id or kind", { cause: e });
5313
5329
  if (!t && this._cachedTitles.has(`${a}:${o}`))
5314
5330
  return await this._cachedTitles.get(`${a}:${o}`);
5315
- const { promise: c, resolve: u, reject: p } = ot();
5331
+ const { promise: c, resolve: u, reject: p } = st();
5316
5332
  this._cachedTitles.set(`${a}:${o}`, c);
5317
5333
  try {
5318
5334
  const { wikiPage: y } = await this.ctx.useScope(["wikiPage"]);
@@ -5381,7 +5397,7 @@ class bt extends he {
5381
5397
  this.REG_SKIPPED_HREF = /^(#|javascript:|vbscript:|file:)/i;
5382
5398
  }
5383
5399
  validateHrefAttr(e) {
5384
- return typeof e != "string" ? !1 : !bt.REG_SKIPPED_HREF.test(e);
5400
+ return typeof e != "string" ? !1 : !vt.REG_SKIPPED_HREF.test(e);
5385
5401
  }
5386
5402
  parseWikiLink(e) {
5387
5403
  if (!e || typeof e == "string" && !this.validateHrefAttr(e))
@@ -5420,24 +5436,24 @@ class bt extends he {
5420
5436
  };
5421
5437
  }
5422
5438
  }
5423
- const bn = (r) => typeof r == "function";
5424
- async function vn(r) {
5425
- return bn(r) ? await r() : r;
5439
+ const wn = (r) => typeof r == "function";
5440
+ async function bn(r) {
5441
+ return wn(r) ? await r() : r;
5426
5442
  }
5427
- var _n = Object.create, vt = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, wr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), br = (r) => {
5443
+ var vn = Object.create, _t = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, wr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), br = (r) => {
5428
5444
  throw TypeError(r);
5429
- }, kn = (r, e, t) => e in r ? vt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, xn = (r, e) => vt(r, "name", { value: e, configurable: !0 }), En = (r) => [, , , _n(r?.[wr("metadata")] ?? null)], On = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], vr = (r) => r !== void 0 && typeof r != "function" ? br("Function expected") : r, Rn = (r, e, t, i, n) => ({ kind: On[r], name: e, metadata: i, addInitializer: (s) => t._ ? br("Already initialized") : n.push(vr(s || null)) }), $n = (r, e) => kn(e, wr("metadata"), r[3]), An = (r, e, t, i) => {
5445
+ }, Sn = (r, e, t) => e in r ? _t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, kn = (r, e) => _t(r, "name", { value: e, configurable: !0 }), xn = (r) => [, , , vn(r?.[wr("metadata")] ?? null)], En = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], vr = (r) => r !== void 0 && typeof r != "function" ? br("Function expected") : r, On = (r, e, t, i, n) => ({ kind: En[r], name: e, metadata: i, addInitializer: (s) => t._ ? br("Already initialized") : n.push(vr(s || null)) }), $n = (r, e) => Sn(e, wr("metadata"), r[3]), Rn = (r, e, t, i) => {
5430
5446
  for (var n = 0, s = r[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
5431
5447
  return i;
5432
5448
  }, Pn = (r, e, t, i, n, s) => {
5433
- var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && Sn(n, t));
5434
- xn(n, t);
5435
- for (var v = i.length - 1; v >= 0; v--)
5436
- c = Rn(u, t, a = {}, r[3], w), o = (0, i[v])(n, c), a._ = 1, vr(o) && (n = o);
5437
- return $n(r, n), g && vt(n, t, g), p ? u ^ 4 ? s : g : n;
5438
- }, _r, _t, Sr;
5449
+ var o, a, c, u = e & 7, p = !1, y = 0, w = r[y] || (r[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && _n(n, t));
5450
+ kn(n, t);
5451
+ for (var b = i.length - 1; b >= 0; b--)
5452
+ c = On(u, t, a = {}, r[3], w), o = (0, i[b])(n, c), a._ = 1, vr(o) && (n = o);
5453
+ return $n(r, n), g && _t(n, t, g), p ? u ^ 4 ? s : g : n;
5454
+ }, _r, St, Sr;
5439
5455
  _r = [le(["storage"])];
5440
- class Fe extends (Sr = he) {
5456
+ class Be extends (Sr = he) {
5441
5457
  constructor(e) {
5442
5458
  super(e, "preferences", !0), this.ctx = e, this.db = void 0, this.customRegistries = [], this.categoryDefinitions = [], this._defaultPreferences = {}, this.db = e.storage.createDatabse("preferences", 1 / 0);
5443
5459
  }
@@ -5461,7 +5477,7 @@ class Fe extends (Sr = he) {
5461
5477
  return this.logger.debug(e, `(fallback value: ${n})`), n;
5462
5478
  };
5463
5479
  const i = await this.db.get(e, void 0);
5464
- return i !== null ? i : await vn(t);
5480
+ return i !== null ? i : await bn(t);
5465
5481
  }
5466
5482
  getDefaultValue(e) {
5467
5483
  return this._defaultPreferences[e] ??= this.loadDefaultConfigs()[e];
@@ -5470,12 +5486,25 @@ class Fe extends (Sr = he) {
5470
5486
  const i = this.getDefaultValue(e);
5471
5487
  return t === i ? this.db.delete(e) : this.db.set(e, t);
5472
5488
  }
5489
+ /**
5490
+ * 获取全部注册的配置项,以及正在生效的值
5491
+ */
5473
5492
  async getAll() {
5474
5493
  const e = this.loadDefaultConfigs();
5475
5494
  for await (const [t, i] of this.db.entries())
5476
5495
  t !== "_touched" && (e[t] = i.value);
5477
5496
  return e;
5478
5497
  }
5498
+ /**
5499
+ * 获取可导出的配置项,去除了与默认值相同的项
5500
+ */
5501
+ async getExportable() {
5502
+ const e = await this.getAll(), t = this.loadDefaultConfigs(), i = {};
5503
+ return Object.entries(t).forEach(([n, s]) => {
5504
+ const o = e[n];
5505
+ o !== s && (i[n] = o);
5506
+ }), i;
5507
+ }
5479
5508
  loadDefaultConfigs() {
5480
5509
  const e = {};
5481
5510
  return this.getConfigRegistries().forEach((t) => {
@@ -5517,10 +5546,10 @@ class Fe extends (Sr = he) {
5517
5546
  return this.categoryDefinitions;
5518
5547
  }
5519
5548
  }
5520
- _t = En(Sr);
5521
- Fe = Pn(_t, 0, "PreferencesService", _r, Fe);
5522
- An(_t, 1, Fe);
5523
- var qe = /* @__PURE__ */ ((r) => (r.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api", r.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", r.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", r.HOME_URL = "https://www.ipe.wiki/", r.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", r))(qe || {});
5549
+ St = xn(Sr);
5550
+ Be = Pn(St, 0, "PreferencesService", _r, Be);
5551
+ Rn(St, 1, Be);
5552
+ var Fe = /* @__PURE__ */ ((r) => (r.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api", r.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", r.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", r.HOME_URL = "https://www.ipe.wiki/", r.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", r))(Fe || {});
5524
5553
  /**
5525
5554
  * ✏️ InPageEdit NEXT
5526
5555
  *
@@ -5535,7 +5564,7 @@ class ge extends z {
5535
5564
  constructor(e) {
5536
5565
  super({
5537
5566
  name: "InPageEdit"
5538
- }), this.version = "0.9.3", this.Endpoints = qe, this.schema = Ze, this.config = _e(ge.DEFAULT_CONFIG, e), this.logger = ni({
5567
+ }), this.version = "0.10.0", this.Endpoints = Fe, this.schema = Qe, this.config = _e(ge.DEFAULT_CONFIG, e), this.logger = ni({
5539
5568
  name: "IPE",
5540
5569
  color: "#33aaff",
5541
5570
  level: this.config.logLevel
@@ -5545,12 +5574,12 @@ class ge extends z {
5545
5574
  this.DEFAULT_CONFIG = {
5546
5575
  apiConfigs: {},
5547
5576
  legacyPreferences: {},
5548
- logLevel: Wt.info,
5577
+ logLevel: Yt.info,
5549
5578
  autoloadStyles: !0
5550
5579
  };
5551
5580
  }
5552
5581
  async #e() {
5553
- this.plugin(wi, this.config.apiConfigs), this.plugin(Ne), this.plugin(Ai), this.plugin(tn), this.plugin(Fe), this.plugin(pn), this.plugin(Be), this.plugin(yn), this.plugin(bt), this.#t([
5582
+ this.plugin(yi, this.config.apiConfigs), this.plugin(Ue), this.plugin(Ri), this.plugin(en), this.plugin(Be), this.plugin(pn), this.plugin(Me), this.plugin(gn), this.plugin(vt), this.#t([
5554
5583
  "api",
5555
5584
  "currentPage",
5556
5585
  "resourceLoader",
@@ -5577,23 +5606,23 @@ class ge extends z {
5577
5606
  // TODO: 这里不应该硬编码,暂时先这样
5578
5607
  async #r() {
5579
5608
  [
5580
- import("./index-CA_JNRF8.js").then(
5609
+ import("./index-2mNdeL-V.js").then(
5581
5610
  ({ PluginInArticleLinks: t }) => t
5582
5611
  ),
5583
- import("./index-DtLiqtR8.js").then(
5612
+ import("./index-DqJUIV2e.js").then(
5584
5613
  ({ PluginPreferencesUI: t }) => t
5585
5614
  ),
5586
- import("./index-CNsfHvio.js").then(({ PluginQuickEdit: t }) => t),
5587
- import("./index-D8zKl2eU.js").then(({ PluginQuickDelete: t }) => t),
5588
- import("./index-CiceXP5j.js").then(({ PluginQuickMove: t }) => t),
5589
- import("./index-DRaYlg2d.js").then(
5615
+ import("./index-ByJfEsN8.js").then(({ PluginQuickEdit: t }) => t),
5616
+ import("./index-ByzgI28q.js").then(({ PluginQuickDelete: t }) => t),
5617
+ import("./index-CAiGct8U.js").then(({ PluginQuickMove: t }) => t),
5618
+ import("./index-BnAhw94L.js").then(
5590
5619
  ({ PluginQuickPreview: t }) => t
5591
5620
  ),
5592
- import("./index-BJ2aqva1.js").then(({ PluginQuickDiff: t }) => t),
5593
- import("./index-CMuITxgX.js").then(
5621
+ import("./index-eOIVMf9E.js").then(({ PluginQuickDiff: t }) => t),
5622
+ import("./index-Cx-YiN1j.js").then(
5594
5623
  ({ PluginQuickRedirect: t }) => t
5595
5624
  ),
5596
- import("./index-D968kDLW.js").then(({ PluginToolbox: t }) => t)
5625
+ import("./index-BR6gK_ki.js").then(({ PluginToolbox: t }) => t)
5597
5626
  ].forEach(async (t) => {
5598
5627
  this.plugin(await t);
5599
5628
  });
@@ -5605,19 +5634,19 @@ class ge extends z {
5605
5634
  });
5606
5635
  }
5607
5636
  async useScope(e) {
5608
- const { promise: t, resolve: i } = ot();
5637
+ const { promise: t, resolve: i } = st();
5609
5638
  return this.inject(e, (n) => {
5610
5639
  i(n);
5611
5640
  }), t;
5612
5641
  }
5613
5642
  }
5614
- function In(r) {
5643
+ function An(r) {
5615
5644
  return r.charAt(0).toLowerCase() + r.slice(1);
5616
5645
  }
5617
- function Ln(r) {
5618
- return In(r).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
5646
+ function In(r) {
5647
+ return An(r).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
5619
5648
  }
5620
- class Bn {
5649
+ class Un {
5621
5650
  constructor(e, t = void 0, i) {
5622
5651
  this.ctx = e, this.disposeHandlers = [], this.name = i || "", this.config = t || {};
5623
5652
  const { promise: n, resolve: s, reject: o } = Promise.withResolvers();
@@ -5658,7 +5687,7 @@ class Bn {
5658
5687
  this.disposeHandlers = this.disposeHandlers.filter((t) => t !== e);
5659
5688
  }
5660
5689
  set name(e) {
5661
- this.#e = Ln(e).toUpperCase();
5690
+ this.#e = In(e).toUpperCase();
5662
5691
  }
5663
5692
  get name() {
5664
5693
  return this.#e;
@@ -5669,7 +5698,7 @@ class Bn {
5669
5698
  }
5670
5699
  window.RLQ ||= [];
5671
5700
  window.__IPE_MODULES__ ||= [];
5672
- Cn("InPageEdit#autoload", () => {
5701
+ Ln("InPageEdit#autoload", () => {
5673
5702
  const r = kr();
5674
5703
  r && Tn({
5675
5704
  baseURL: r,
@@ -5712,27 +5741,27 @@ async function Tn(r = { baseURL: kr(), CoreClass: ge }) {
5712
5741
  /___/_/ /_/_/ \\__,_/\\__, /\\___/_____/\\__,_/_/\\__/
5713
5742
  /____/ v` + n.version + `
5714
5743
  - Wiki API Endpoint: ${e}
5715
- - Documentation: ${qe.HOME_URL}
5716
- - Bug Reports: ${qe.GITHUB_URL}`
5744
+ - Documentation: ${Fe.HOME_URL}
5745
+ - Bug Reports: ${Fe.GITHUB_URL}`
5717
5746
  );
5718
5747
  }
5719
5748
  function kr() {
5720
5749
  const r = document.querySelector('meta[name="generator"][content^="MediaWiki"]') !== null, e = document.querySelector('link[rel="EditURI"]')?.href?.split("?")[0];
5721
5750
  return r && e ? e : void 0;
5722
5751
  }
5723
- function Cn(r, e) {
5752
+ function Ln(r, e) {
5724
5753
  const t = Symbol.for(r);
5725
5754
  return window[t] ? !1 : (window[t] = !0, e(), !0);
5726
5755
  }
5727
5756
  export {
5728
- Wt as $,
5729
- Bn as B,
5757
+ Yt as $,
5758
+ Un as B,
5730
5759
  le as I,
5731
- Ze as S,
5760
+ Qe as S,
5732
5761
  yr as W,
5733
5762
  he as a,
5734
5763
  ge as b,
5735
5764
  ni as c,
5736
5765
  ti as m
5737
5766
  };
5738
- //# sourceMappingURL=index-BKxuoVoX.js.map
5767
+ //# sourceMappingURL=index-Z-_kjibx.js.map