@inpageedit/core 0.6.0 → 0.7.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 (52) hide show
  1. package/dist/IconQuickEdit-YVn1ANbm.js +27 -0
  2. package/dist/IconQuickEdit-YVn1ANbm.js.map +1 -0
  3. package/dist/InPageEdit.d.ts +7 -5
  4. package/dist/components/Icon/IconEdit.d.ts +2 -0
  5. package/dist/components/Icon/IconQuickEdit.d.ts +2 -0
  6. package/dist/components/MwUserLinks.d.ts +2 -0
  7. package/dist/index-1JtE4urY.js +1256 -0
  8. package/dist/{index-5zB57uWM.js.map → index-1JtE4urY.js.map} +1 -1
  9. package/dist/{index-CPCQc37I.js → index-2AEdgbUL.js} +4 -4
  10. package/dist/index-2AEdgbUL.js.map +1 -0
  11. package/dist/index-2kN4SKmT.js +116 -0
  12. package/dist/index-2kN4SKmT.js.map +1 -0
  13. package/dist/{index-BqqQgaGG.js → index-B3Bsg_nE.js} +5 -4
  14. package/dist/index-B3Bsg_nE.js.map +1 -0
  15. package/dist/{index-clwjxJi5.js → index-BCMwmSfQ.js} +2 -2
  16. package/dist/{index-clwjxJi5.js.map → index-BCMwmSfQ.js.map} +1 -1
  17. package/dist/{index-ClYojws9.js → index-C0ci6Ll1.js} +3 -2
  18. package/dist/index-C0ci6Ll1.js.map +1 -0
  19. package/dist/{index-BHruEVsx.js → index-CZnu6cRK.js} +2 -2
  20. package/dist/{index-BHruEVsx.js.map → index-CZnu6cRK.js.map} +1 -1
  21. package/dist/{index-B7Ok-t-3.js → index-CheNjwas.js} +2 -2
  22. package/dist/{index-B7Ok-t-3.js.map → index-CheNjwas.js.map} +1 -1
  23. package/dist/{index-SDBp__LY.js → index-CrWxZ0yl.js} +66 -63
  24. package/dist/{index-SDBp__LY.js.map → index-CrWxZ0yl.js.map} +1 -1
  25. package/dist/{index-BnRuHI16.js → index-DqfQ7hp6.js} +1018 -925
  26. package/dist/index-DqfQ7hp6.js.map +1 -0
  27. package/dist/index-sfkutNHj.js +201 -0
  28. package/dist/index-sfkutNHj.js.map +1 -0
  29. package/dist/index.js +1 -1
  30. package/dist/models/WikiTitle/index.d.ts +1 -0
  31. package/dist/plugins/in-article-links/index.d.ts +19 -1
  32. package/dist/plugins/quick-diff/PluginQuickDiffCore.d.ts +2 -0
  33. package/dist/plugins/quick-diff/components/DiffTable.d.ts +17 -0
  34. package/dist/plugins/quick-preview/index.d.ts +2 -2
  35. package/dist/services/ApiService.d.ts +2 -2
  36. package/dist/services/ModalService/IPEModal.d.ts +1 -1
  37. package/dist/services/SiteMetadataService.d.ts +36 -1
  38. package/dist/style.css +1 -1
  39. package/dist/utils/url.d.ts +24 -0
  40. package/lib/index.umd.js +28 -28
  41. package/lib/index.umd.js.map +1 -1
  42. package/lib/style.css +1 -1
  43. package/package.json +10 -1
  44. package/dist/index-5zB57uWM.js +0 -1142
  45. package/dist/index-BnRuHI16.js.map +0 -1
  46. package/dist/index-BqqQgaGG.js.map +0 -1
  47. package/dist/index-Bs5MFAHs.js +0 -110
  48. package/dist/index-Bs5MFAHs.js.map +0 -1
  49. package/dist/index-C9QOZJ8o.js +0 -167
  50. package/dist/index-C9QOZJ8o.js.map +0 -1
  51. package/dist/index-CPCQc37I.js.map +0 -1
  52. package/dist/index-ClYojws9.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { j as q, F as Dn, P as Cn } from "./index-CvhkVj_L.js";
1
+ import { j as q, F as Cn, P as Ln } from "./index-CvhkVj_L.js";
2
2
  const fr = () => {
3
3
  let r, e;
4
4
  return { promise: new Promise((n, i) => {
@@ -6,18 +6,18 @@ const fr = () => {
6
6
  }), resolve: r, reject: e };
7
7
  };
8
8
  Promise.withResolvers || (Promise.withResolvers = fr);
9
- var Ln = Object.defineProperty, B = (r, e) => Ln(r, "name", { value: e, configurable: !0 });
10
- function Bn() {
9
+ var Bn = Object.defineProperty, B = (r, e) => Bn(r, "name", { value: e, configurable: !0 });
10
+ function jn() {
11
11
  }
12
- B(Bn, "noop");
12
+ B(jn, "noop");
13
13
  function Y(r) {
14
14
  return r == null;
15
15
  }
16
16
  B(Y, "isNullable");
17
- function jn(r) {
17
+ function Un(r) {
18
18
  return !Y(r);
19
19
  }
20
- B(jn, "isNonNullable");
20
+ B(Un, "isNonNullable");
21
21
  function Ve(r) {
22
22
  return r && typeof r == "object" && !Array.isArray(r);
23
23
  }
@@ -50,35 +50,35 @@ function J(r, e, t) {
50
50
  return Object.defineProperty(r, e, { writable: !0, value: t, enumerable: !1 });
51
51
  }
52
52
  B(J, "defineProperty");
53
- function Un(r, e) {
53
+ function Fn(r, e) {
54
54
  return e.every((t) => r.includes(t));
55
55
  }
56
- B(Un, "contain");
57
- function Fn(r, e) {
56
+ B(Fn, "contain");
57
+ function zn(r, e) {
58
58
  return r.filter((t) => e.includes(t));
59
59
  }
60
- B(Fn, "intersection");
61
- function zn(r, e) {
60
+ B(zn, "intersection");
61
+ function Hn(r, e) {
62
62
  return r.filter((t) => !e.includes(t));
63
63
  }
64
- B(zn, "difference");
65
- function Hn(r, e) {
64
+ B(Hn, "difference");
65
+ function qn(r, e) {
66
66
  return Array.from(/* @__PURE__ */ new Set([...r, ...e]));
67
67
  }
68
- B(Hn, "union");
69
- function qn(r) {
68
+ B(qn, "union");
69
+ function Wn(r) {
70
70
  return [...new Set(r)];
71
71
  }
72
- B(qn, "deduplicate");
72
+ B(Wn, "deduplicate");
73
73
  function be(r, e) {
74
74
  const t = r?.indexOf(e);
75
75
  return t >= 0 ? (r.splice(t, 1), !0) : !1;
76
76
  }
77
77
  B(be, "remove");
78
- function Wn(r) {
78
+ function Kn(r) {
79
79
  return Array.isArray(r) ? r : Y(r) ? [] : [r];
80
80
  }
81
- B(Wn, "makeArray");
81
+ B(Kn, "makeArray");
82
82
  function ve(r, e) {
83
83
  return arguments.length === 1 ? (t) => ve(r, t) : r in globalThis && e instanceof globalThis[r] || Object.prototype.toString.call(e).slice(8, -1) === r;
84
84
  }
@@ -101,26 +101,26 @@ var le;
101
101
  function t(o) {
102
102
  if (typeof Buffer < "u")
103
103
  return Buffer.from(o).toString("base64");
104
- let l = "";
104
+ let c = "";
105
105
  const y = new Uint8Array(o);
106
106
  for (let v = 0; v < y.byteLength; v++)
107
- l += String.fromCharCode(y[v]);
108
- return btoa(l);
107
+ c += String.fromCharCode(y[v]);
108
+ return btoa(c);
109
109
  }
110
110
  r.toBase64 = t, B(t, "toBase64");
111
111
  function n(o) {
112
- return typeof Buffer < "u" ? e(Buffer.from(o, "base64")) : Uint8Array.from(atob(o), (l) => l.charCodeAt(0));
112
+ return typeof Buffer < "u" ? e(Buffer.from(o, "base64")) : Uint8Array.from(atob(o), (c) => c.charCodeAt(0));
113
113
  }
114
114
  r.fromBase64 = n, B(n, "fromBase64");
115
115
  function i(o) {
116
- return typeof Buffer < "u" ? Buffer.from(o).toString("hex") : Array.from(new Uint8Array(o), (l) => l.toString(16).padStart(2, "0")).join("");
116
+ return typeof Buffer < "u" ? Buffer.from(o).toString("hex") : Array.from(new Uint8Array(o), (c) => c.toString(16).padStart(2, "0")).join("");
117
117
  }
118
118
  r.toHex = i, B(i, "toHex");
119
119
  function s(o) {
120
120
  if (typeof Buffer < "u") return e(Buffer.from(o, "hex"));
121
- const l = o.length % 2 === 0 ? o : o.slice(0, o.length - 1), y = [];
122
- for (let v = 0; v < l.length; v += 2)
123
- y.push(parseInt(`${l[v]}${l[v + 1]}`, 16));
121
+ const c = o.length % 2 === 0 ? o : o.slice(0, o.length - 1), y = [];
122
+ for (let v = 0; v < c.length; v += 2)
123
+ y.push(parseInt(`${c[v]}${c[v + 1]}`, 16));
124
124
  return Uint8Array.from(y).buffer;
125
125
  }
126
126
  r.fromHex = s, B(s, "fromHex");
@@ -158,27 +158,27 @@ function _e(r, e, t) {
158
158
  function n(i, s) {
159
159
  return i(r) ? i(e) ? s(r, e) : !1 : i(e) ? !1 : void 0;
160
160
  }
161
- return B(n, "check"), n(Array.isArray, (i, s) => i.length === s.length && i.every((o, l) => _e(o, s[l]))) ?? n(ve("Date"), (i, s) => i.valueOf() === s.valueOf()) ?? n(ve("RegExp"), (i, s) => i.source === s.source && i.flags === s.flags) ?? n(je, (i, s) => {
161
+ return B(n, "check"), n(Array.isArray, (i, s) => i.length === s.length && i.every((o, c) => _e(o, s[c]))) ?? n(ve("Date"), (i, s) => i.valueOf() === s.valueOf()) ?? n(ve("RegExp"), (i, s) => i.source === s.source && i.flags === s.flags) ?? n(je, (i, s) => {
162
162
  if (i.byteLength !== s.byteLength) return !1;
163
- const o = new Uint8Array(i), l = new Uint8Array(s);
163
+ const o = new Uint8Array(i), c = new Uint8Array(s);
164
164
  for (let y = 0; y < o.length; y++)
165
- if (o[y] !== l[y]) return !1;
165
+ if (o[y] !== c[y]) return !1;
166
166
  return !0;
167
167
  }) ?? Object.keys({ ...r, ...e }).every((i) => _e(r[i], e[i], t));
168
168
  }
169
169
  B(_e, "deepEqual");
170
- function Kn(r) {
170
+ function Yn(r) {
171
171
  return r.charAt(0).toUpperCase() + r.slice(1);
172
172
  }
173
- B(Kn, "capitalize");
174
- function Yn(r) {
173
+ B(Yn, "capitalize");
174
+ function Vn(r) {
175
175
  return r.charAt(0).toLowerCase() + r.slice(1);
176
176
  }
177
- B(Yn, "uncapitalize");
178
- function Vn(r) {
177
+ B(Vn, "uncapitalize");
178
+ function Gn(r) {
179
179
  return r.replace(/[_-][a-z]/g, (e) => e.slice(1).toUpperCase());
180
180
  }
181
- B(Vn, "camelCase");
181
+ B(Gn, "camelCase");
182
182
  function _t(r, e, t) {
183
183
  const n = [];
184
184
  let i = 0;
@@ -186,8 +186,8 @@ function _t(r, e, t) {
186
186
  const o = r.charCodeAt(s);
187
187
  if (o >= 65 && o <= 90) {
188
188
  if (i === 1) {
189
- const l = r.charCodeAt(s + 1);
190
- l >= 97 && l <= 122 && n.push(t), n.push(o + 32);
189
+ const c = r.charCodeAt(s + 1);
190
+ c >= 97 && c <= 122 && n.push(t), n.push(o + 32);
191
191
  } else
192
192
  i !== 0 && n.push(t), n.push(o + 32);
193
193
  i = 1;
@@ -196,26 +196,26 @@ function _t(r, e, t) {
196
196
  return String.fromCharCode(...n);
197
197
  }
198
198
  B(_t, "tokenize");
199
- function Gn(r) {
199
+ function Xn(r) {
200
200
  return _t(r, [45, 95], 45);
201
201
  }
202
- B(Gn, "paramCase");
203
- function Xn(r) {
202
+ B(Xn, "paramCase");
203
+ function Jn(r) {
204
204
  return _t(r, [45, 95], 95);
205
205
  }
206
- B(Xn, "snakeCase");
207
- function Jn(r) {
206
+ B(Jn, "snakeCase");
207
+ function Qn(r) {
208
208
  return typeof r != "string" ? `[${r.toString()}]` : /^[a-z_$][\w$]*$/i.test(r) ? `.${r}` : `[${JSON.stringify(r)}]`;
209
209
  }
210
- B(Jn, "formatProperty");
210
+ B(Qn, "formatProperty");
211
211
  function mr(r) {
212
212
  return r.replace(/\/$/, "");
213
213
  }
214
214
  B(mr, "trimSlash");
215
- function Qn(r) {
215
+ function Zn(r) {
216
216
  return r.startsWith("/") || (r = "/" + r), mr(r);
217
217
  }
218
- B(Qn, "sanitize");
218
+ B(Zn, "sanitize");
219
219
  var Qt;
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;
@@ -228,16 +228,16 @@ var Qt;
228
228
  return e;
229
229
  }
230
230
  r.getTimezoneOffset = n, B(n, "getTimezoneOffset");
231
- function i(O = /* @__PURE__ */ new Date(), P) {
232
- return typeof O == "number" && (O = new Date(O)), P === void 0 && (P = e), Math.floor((O.valueOf() / r.minute - P) / 1440);
231
+ function i(O = /* @__PURE__ */ new Date(), N) {
232
+ return typeof O == "number" && (O = new Date(O)), N === void 0 && (N = e), Math.floor((O.valueOf() / r.minute - N) / 1440);
233
233
  }
234
234
  r.getDateNumber = i, B(i, "getDateNumber");
235
- function s(O, P) {
235
+ function s(O, N) {
236
236
  const W = new Date(O * r.day);
237
- return P === void 0 && (P = e), new Date(+W + P * r.minute);
237
+ return N === void 0 && (N = e), new Date(+W + N * r.minute);
238
238
  }
239
239
  r.fromDateNumber = s, B(s, "fromDateNumber");
240
- const o = /\d+(?:\.\d+)?/.source, l = new RegExp(`^${[
240
+ const o = /\d+(?:\.\d+)?/.source, c = new RegExp(`^${[
241
241
  "w(?:eek(?:s)?)?",
242
242
  "d(?:ay(?:s)?)?",
243
243
  "h(?:our(?:s)?)?",
@@ -245,30 +245,30 @@ var Qt;
245
245
  "s(?:ec(?:ond)?(?:s)?)?"
246
246
  ].map((O) => `(${o}${O})?`).join("")}$`);
247
247
  function y(O) {
248
- const P = l.exec(O);
249
- return P ? (parseFloat(P[1]) * r.week || 0) + (parseFloat(P[2]) * r.day || 0) + (parseFloat(P[3]) * r.hour || 0) + (parseFloat(P[4]) * r.minute || 0) + (parseFloat(P[5]) * r.second || 0) : 0;
248
+ const N = c.exec(O);
249
+ return N ? (parseFloat(N[1]) * r.week || 0) + (parseFloat(N[2]) * r.day || 0) + (parseFloat(N[3]) * r.hour || 0) + (parseFloat(N[4]) * r.minute || 0) + (parseFloat(N[5]) * r.second || 0) : 0;
250
250
  }
251
251
  r.parseTime = y, B(y, "parseTime");
252
252
  function v(O) {
253
- const P = y(O);
254
- return P ? O = Date.now() + P : /^\d{1,2}(:\d{1,2}){1,2}$/.test(O) ? O = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${O}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(O) && (O = `${(/* @__PURE__ */ new Date()).getFullYear()}-${O}`), O ? new Date(O) : /* @__PURE__ */ new Date();
253
+ const N = y(O);
254
+ return N ? O = Date.now() + N : /^\d{1,2}(:\d{1,2}){1,2}$/.test(O) ? O = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${O}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(O) && (O = `${(/* @__PURE__ */ new Date()).getFullYear()}-${O}`), O ? new Date(O) : /* @__PURE__ */ new Date();
255
255
  }
256
256
  r.parseDate = v, B(v, "parseDate");
257
257
  function S(O) {
258
- const P = Math.abs(O);
259
- return P >= r.day - r.hour / 2 ? Math.round(O / r.day) + "d" : P >= r.hour - r.minute / 2 ? Math.round(O / r.hour) + "h" : P >= r.minute - r.second / 2 ? Math.round(O / r.minute) + "m" : P >= r.second ? Math.round(O / r.second) + "s" : O + "ms";
258
+ const N = Math.abs(O);
259
+ return N >= r.day - r.hour / 2 ? Math.round(O / r.day) + "d" : N >= r.hour - r.minute / 2 ? Math.round(O / r.hour) + "h" : N >= r.minute - r.second / 2 ? Math.round(O / r.minute) + "m" : N >= r.second ? Math.round(O / r.second) + "s" : O + "ms";
260
260
  }
261
261
  r.format = S, B(S, "format");
262
- function w(O, P = 2) {
263
- return O.toString().padStart(P, "0");
262
+ function w(O, N = 2) {
263
+ return O.toString().padStart(N, "0");
264
264
  }
265
265
  r.toDigits = w, B(w, "toDigits");
266
- function N(O, P = /* @__PURE__ */ new Date()) {
267
- return O.replace("yyyy", P.getFullYear().toString()).replace("yy", P.getFullYear().toString().slice(2)).replace("MM", w(P.getMonth() + 1)).replace("dd", w(P.getDate())).replace("hh", w(P.getHours())).replace("mm", w(P.getMinutes())).replace("ss", w(P.getSeconds())).replace("SSS", w(P.getMilliseconds(), 3));
266
+ function P(O, N = /* @__PURE__ */ new Date()) {
267
+ return O.replace("yyyy", N.getFullYear().toString()).replace("yy", N.getFullYear().toString().slice(2)).replace("MM", w(N.getMonth() + 1)).replace("dd", w(N.getDate())).replace("hh", w(N.getHours())).replace("mm", w(N.getMinutes())).replace("ss", w(N.getSeconds())).replace("SSS", w(N.getMilliseconds(), 3));
268
268
  }
269
- r.template = N, B(N, "template");
269
+ r.template = P, B(P, "template");
270
270
  })(Qt || (Qt = {}));
271
- var Zn = Object.defineProperty, C = (r, e) => Zn(r, "name", { value: e, configurable: !0 }), T = {
271
+ var ei = Object.defineProperty, C = (r, e) => ei(r, "name", { value: e, configurable: !0 }), T = {
272
272
  // internal symbols
273
273
  shadow: Symbol.for("cordis.shadow"),
274
274
  receiver: Symbol.for("cordis.receiver"),
@@ -289,18 +289,18 @@ var Zn = Object.defineProperty, C = (r, e) => Zn(r, "name", { value: e, configur
289
289
  tracker: Symbol.for("cordis.tracker"),
290
290
  provide: Symbol.for("cordis.provide"),
291
291
  immediate: Symbol.for("cordis.immediate")
292
- }, ei = function* () {
292
+ }, ti = function* () {
293
293
  }.constructor, Zt = async function* () {
294
294
  }.constructor;
295
295
  function St(r) {
296
- return !(!r.prototype || r instanceof ei || Zt !== Function && r instanceof Zt);
296
+ return !(!r.prototype || r instanceof ti || Zt !== Function && r instanceof Zt);
297
297
  }
298
298
  C(St, "isConstructor");
299
- function Me(r, e) {
299
+ function Ue(r, e) {
300
300
  const t = r.Config || r.schema;
301
301
  return t && r.schema !== !1 && (e = t(e)), e ?? {};
302
302
  }
303
- C(Me, "resolveConfig");
303
+ C(Ue, "resolveConfig");
304
304
  function gr(r) {
305
305
  return [Map, Set, Date, Promise].some((e) => r instanceof e);
306
306
  }
@@ -347,12 +347,12 @@ function pt(r, e, t, n) {
347
347
  C(pt, "createShadow");
348
348
  function yr(r, e, t, n) {
349
349
  return new Proxy(e, {
350
- apply: /* @__PURE__ */ C((i, s, o) => (s === t && (s = n), o = o.map((l) => typeof l != "function" || l[T.original] ? l : new Proxy(l, {
350
+ apply: /* @__PURE__ */ C((i, s, o) => (s === t && (s = n), o = o.map((c) => typeof c != "function" || c[T.original] ? c : new Proxy(c, {
351
351
  get: /* @__PURE__ */ C((y, v, S) => {
352
352
  if (v === T.original) return y;
353
353
  const w = Reflect.get(y, v, S);
354
- return v === "toString" && w === Function.prototype.toString ? function(...N) {
355
- return Reflect.apply(w, this === S ? y : this, N);
354
+ return v === "toString" && w === Function.prototype.toString ? function(...P) {
355
+ return Reflect.apply(w, this === S ? y : this, P);
356
356
  } : w;
357
357
  }, "get"),
358
358
  apply: /* @__PURE__ */ C((y, v, S) => Reflect.apply(y, ue(r, v), S.map((w) => ue(r, w))), "apply"),
@@ -364,26 +364,26 @@ C(yr, "createShadowMethod");
364
364
  function et(r, e, t, n) {
365
365
  r[T.shadow] && (r = Object.getPrototypeOf(r));
366
366
  const i = new Proxy(e, {
367
- get: /* @__PURE__ */ C((s, o, l) => {
367
+ get: /* @__PURE__ */ C((s, o, c) => {
368
368
  if (o === T.original) return s;
369
369
  if (o === t.property) return r;
370
370
  if (typeof o == "symbol")
371
- return Reflect.get(s, o, l);
371
+ return Reflect.get(s, o, c);
372
372
  if (t.associate && r[T.internal][`${t.associate}.${o}`])
373
- return Reflect.get(r, `${t.associate}.${o}`, Qe(r, T.receiver, l));
374
- const y = pt(r, s, t.property, l), v = Reflect.get(s, o, y), S = v?.[T.tracker];
375
- return S ? et(r, v, S) : !n && typeof v == "function" ? yr(r, v, l, y) : v;
373
+ return Reflect.get(r, `${t.associate}.${o}`, Qe(r, T.receiver, c));
374
+ const y = pt(r, s, t.property, c), v = Reflect.get(s, o, y), S = v?.[T.tracker];
375
+ return S ? et(r, v, S) : !n && typeof v == "function" ? yr(r, v, c, y) : v;
376
376
  }, "get"),
377
- set: /* @__PURE__ */ C((s, o, l, y) => {
377
+ set: /* @__PURE__ */ C((s, o, c, y) => {
378
378
  if (o === T.original || o === t.property) return !1;
379
379
  if (typeof o == "symbol")
380
- return Reflect.set(s, o, l, y);
380
+ return Reflect.set(s, o, c, y);
381
381
  if (t.associate && r[T.internal][`${t.associate}.${o}`])
382
- return Reflect.set(r, `${t.associate}.${o}`, l, Qe(r, T.receiver, y));
382
+ return Reflect.set(r, `${t.associate}.${o}`, c, Qe(r, T.receiver, y));
383
383
  const v = pt(r, s, t.property, y);
384
- return Reflect.set(s, o, l, v);
384
+ return Reflect.set(s, o, c, v);
385
385
  }, "set"),
386
- apply: /* @__PURE__ */ C((s, o, l) => kt(i, s, o, l), "apply")
386
+ apply: /* @__PURE__ */ C((s, o, c) => kt(i, s, o, c), "apply")
387
387
  });
388
388
  return i;
389
389
  }
@@ -400,7 +400,7 @@ function mt(r, e, t) {
400
400
  return J(n, "name", r), Object.setPrototypeOf(n, e);
401
401
  }
402
402
  C(mt, "createCallable");
403
- var ti = class ke {
403
+ var ri = class ke {
404
404
  constructor(e) {
405
405
  this.ctx = e, J(this, T.tracker, {
406
406
  associate: "reflect",
@@ -461,8 +461,8 @@ var ti = class ke {
461
461
  Y(t) || (s = o.effect(() => () => {
462
462
  o.set(e, void 0);
463
463
  })), gr(t) && o.emit(o, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
464
- const l = Object.create(o);
465
- return l[T.filter] = (y) => o[T.isolate][e] === y[T.isolate][e], o.emit(l, "internal/before-service", e, t), o[T.store][n] = { value: t, source: o }, o.emit(l, "internal/service", e, i), s;
464
+ const c = Object.create(o);
465
+ return c[T.filter] = (y) => o[T.isolate][e] === y[T.isolate][e], o.emit(c, "internal/before-service", e, t), o[T.store][n] = { value: t, source: o }, o.emit(c, "internal/service", e, i), s;
466
466
  }
467
467
  provide(e, t, n) {
468
468
  const i = this.ctx.root[T.internal];
@@ -488,7 +488,7 @@ var ti = class ke {
488
488
  n[i] ||= { type: "alias", name: e };
489
489
  }
490
490
  _mixin(e, t) {
491
- const n = Array.isArray(t) ? t.map((o) => [o, o]) : Object.entries(t), i = typeof e == "string" ? (o) => o[e] : () => e, s = n.map(([o, l]) => this._accessor(l, {
491
+ const n = Array.isArray(t) ? t.map((o) => [o, o]) : Object.entries(t), i = typeof e == "string" ? (o) => o[e] : () => e, s = n.map(([o, c]) => this._accessor(c, {
492
492
  get(y) {
493
493
  const v = i(this);
494
494
  if (Y(v)) return v;
@@ -513,12 +513,12 @@ var ti = class ke {
513
513
  apply: /* @__PURE__ */ C((t, n, i) => t.apply(this.trace(n), i.map((s) => this.trace(s))), "apply")
514
514
  });
515
515
  }
516
- }, gt = ti;
516
+ }, gt = ri;
517
517
  function yt(r) {
518
518
  return r !== null && r !== !1 && r !== void 0;
519
519
  }
520
520
  C(yt, "isBailed");
521
- var ri = class {
521
+ var ni = class {
522
522
  constructor(r) {
523
523
  this.ctx = r, J(this, T.tracker, {
524
524
  associate: "lifecycle",
@@ -631,7 +631,7 @@ var ri = class {
631
631
  async stop() {
632
632
  this.isActive = !1, this.ctx.scope.reset();
633
633
  }
634
- }, ni = ri, bt = class br extends Error {
634
+ }, ii = ni, bt = class br extends Error {
635
635
  constructor(e, t) {
636
636
  super(t ?? br.Code[e]), this.code = e;
637
637
  }
@@ -739,28 +739,28 @@ var vr = class {
739
739
  const v = t[y] ??= !_e(this.config[y], r[y]);
740
740
  return s ||= v, v;
741
741
  }, "checkPropertyUpdate"), i = /* @__PURE__ */ new Set();
742
- let s = !1, o = !1, l = this.runtime.isReactive || null;
742
+ let s = !1, o = !1, c = this.runtime.isReactive || null;
743
743
  for (const { keys: y, callback: v, passive: S } of this.acceptors) {
744
744
  if (!y)
745
- l ||= !S;
745
+ c ||= !S;
746
746
  else if (S)
747
- y?.forEach((N) => i.add(N));
747
+ y?.forEach((P) => i.add(P));
748
748
  else {
749
- let N = !1;
749
+ let P = !1;
750
750
  for (const O of y)
751
- N ||= n(O);
752
- if (!N) continue;
751
+ P ||= n(O);
752
+ if (!P) continue;
753
753
  }
754
754
  v?.(r) && (o = !0);
755
755
  }
756
756
  for (const y in { ...this.config, ...r })
757
- if (l !== !1 && !(y in t) && !i.has(y)) {
757
+ if (c !== !1 && !(y in t) && !i.has(y)) {
758
758
  const v = n(y);
759
- l === null && (o ||= v);
759
+ c === null && (o ||= v);
760
760
  }
761
761
  return [s, o];
762
762
  }
763
- }, ii = class extends vr {
763
+ }, si = class extends vr {
764
764
  constructor(r, e, t, n) {
765
765
  super(r, t), this.runtime = e, this.dispose = J(r.scope.collect(`fork <${r.runtime.name}>`, () => {
766
766
  this.uid = null, this.reset(), this.context.emit("internal/fork", this);
@@ -782,9 +782,9 @@ var vr = class {
782
782
  if (n.config !== t) return;
783
783
  let i;
784
784
  try {
785
- i = Me(this.runtime.plugin, r);
786
- } catch (l) {
787
- return this.context.emit("internal/error", l), this.cancel(l);
785
+ i = Ue(this.runtime.plugin, r);
786
+ } catch (c) {
787
+ return this.context.emit("internal/error", c), this.cancel(c);
788
788
  }
789
789
  const [s, o] = n.checkUpdate(i, e);
790
790
  this.context.emit("internal/before-update", this, r), this.config = i, n.config = i, s && this.context.emit("internal/update", this, t), o && n.restart();
@@ -809,7 +809,7 @@ var vr = class {
809
809
  return this.forkables.length > 0;
810
810
  }
811
811
  fork(r, e, t) {
812
- return new ii(r, this, e, t);
812
+ return new si(r, this, e, t);
813
813
  }
814
814
  dispose() {
815
815
  return this.uid = null, this.reset(), this.context.emit("internal/runtime", this), !0;
@@ -840,17 +840,17 @@ var vr = class {
840
840
  }
841
841
  update(r, e) {
842
842
  if (this.isForkable) {
843
- const l = new Error(`attempting to update forkable plugin "${this.plugin.name}", which may lead to unexpected behavior`);
844
- this.context.emit(this.ctx, "internal/warning", l);
843
+ const c = new Error(`attempting to update forkable plugin "${this.plugin.name}", which may lead to unexpected behavior`);
844
+ this.context.emit(this.ctx, "internal/warning", c);
845
845
  }
846
846
  const t = this.config;
847
847
  let n;
848
848
  try {
849
- n = Me(this.runtime.plugin || this.context.constructor, r);
850
- } catch (l) {
851
- return this.context.emit("internal/error", l), this.cancel(l);
849
+ n = Ue(this.runtime.plugin || this.context.constructor, r);
850
+ } catch (c) {
851
+ return this.context.emit("internal/error", c), this.cancel(c);
852
852
  }
853
- const [i, s] = this.checkUpdate(n, e), o = this.children.find((l) => l.config === t);
853
+ const [i, s] = this.checkUpdate(n, e), o = this.children.find((c) => c.config === t);
854
854
  this.config = n, o && (this.context.emit("internal/before-update", o, r), o.config = n, i && this.context.emit("internal/update", o, t)), s && this.restart();
855
855
  }
856
856
  };
@@ -885,7 +885,7 @@ C(Ce, "Inject");
885
885
  }
886
886
  r.resolve = e, C(e, "resolve");
887
887
  })(Ce || (Ce = {}));
888
- var si = class {
888
+ var oi = class {
889
889
  constructor(r, e) {
890
890
  this.ctx = r, J(this, T.tracker, {
891
891
  associate: "registry",
@@ -949,14 +949,14 @@ var si = class {
949
949
  plugin(r, e, t) {
950
950
  if (this.resolve(r, !0), this.ctx.scope.assertActive(), !t)
951
951
  try {
952
- e = Me(r, e);
952
+ e = Ue(r, e);
953
953
  } catch (i) {
954
954
  this.context.emit(this.ctx, "internal/error", i), t = i, e = null;
955
955
  }
956
956
  let n = this.get(r);
957
957
  return n ? (n.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${r.name}`)), n.fork(this.ctx, e, t)) : (n = new er(this.ctx, r, e, t), this.set(r, n), n.fork(this.ctx, e, t));
958
958
  }
959
- }, oi = si, re = class Te {
959
+ }, ai = oi, re = class Te {
960
960
  static {
961
961
  C(this, "Context");
962
962
  }
@@ -981,9 +981,9 @@ var si = class {
981
981
  return e;
982
982
  }
983
983
  constructor(e) {
984
- e = Me(this.constructor, e), this[T.store] = /* @__PURE__ */ Object.create(null), this[T.isolate] = /* @__PURE__ */ Object.create(null), this[T.internal] = /* @__PURE__ */ Object.create(null), this[T.intercept] = /* @__PURE__ */ Object.create(null);
984
+ e = Ue(this.constructor, e), this[T.store] = /* @__PURE__ */ Object.create(null), this[T.isolate] = /* @__PURE__ */ Object.create(null), this[T.internal] = /* @__PURE__ */ Object.create(null), this[T.intercept] = /* @__PURE__ */ Object.create(null);
985
985
  const t = new Proxy(this, gt.handler);
986
- t.root = t, t.reflect = new gt(t), t.registry = new oi(t, e), t.lifecycle = new ni(t);
986
+ t.root = t, t.reflect = new gt(t), t.registry = new ai(t, e), t.lifecycle = new ii(t);
987
987
  const n = /* @__PURE__ */ C((i) => {
988
988
  if (i) {
989
989
  n(Object.getPrototypeOf(i));
@@ -1025,7 +1025,7 @@ var si = class {
1025
1025
  }
1026
1026
  };
1027
1027
  re.prototype[re.internal] = /* @__PURE__ */ Object.create(null);
1028
- var Ue = class _r {
1028
+ var Me = class _r {
1029
1029
  static {
1030
1030
  C(this, "Service");
1031
1031
  }
@@ -1046,11 +1046,11 @@ var Ue = class _r {
1046
1046
  let t, n, i, s;
1047
1047
  re.is(e[0]) ? (t = e[0], typeof e[1] == "string" ? (n = e[1], i = e[2]) : s = e[1]) : s = e[0], n ??= this.constructor[T.provide], i ??= this.constructor[T.immediate];
1048
1048
  let o = this;
1049
- const l = {
1049
+ const c = {
1050
1050
  associate: n,
1051
1051
  property: "ctx"
1052
1052
  };
1053
- return o[T.invoke] && (o = mt(n, xt(Object.getPrototypeOf(this), Function.prototype), l)), t ? o.ctx = t : o[T.setup](), o.name = n, o.config = s, J(o, T.tracker, l), o.ctx.provide(n), o.ctx.runtime.name = n, i && (t ? o[T.expose] = n : o.ctx.set(n, o)), o.ctx.on("ready", async () => {
1053
+ return o[T.invoke] && (o = mt(n, xt(Object.getPrototypeOf(this), Function.prototype), c)), t ? o.ctx = t : o[T.setup](), o.name = n, o.config = s, J(o, T.tracker, c), o.ctx.provide(n), o.ctx.runtime.name = n, i && (t ? o[T.expose] = n : o.ctx.set(n, o)), o.ctx.on("ready", async () => {
1054
1054
  await Promise.resolve(), await o.start(), i || o.ctx.set(n, o);
1055
1055
  }), o.ctx.on("dispose", () => o.stop()), o;
1056
1056
  }
@@ -1072,9 +1072,9 @@ var Ue = class _r {
1072
1072
  }
1073
1073
  return !1;
1074
1074
  }
1075
- }, ai = Object.defineProperty, ci = Object.getOwnPropertyNames, U = (r, e) => ai(r, "name", { value: e, configurable: !0 }), li = (r, e) => function() {
1076
- return e || (0, r[ci(r)[0]])((e = { exports: {} }).exports, e), e.exports;
1077
- }, ui = li({
1075
+ }, ci = Object.defineProperty, li = Object.getOwnPropertyNames, M = (r, e) => ci(r, "name", { value: e, configurable: !0 }), ui = (r, e) => function() {
1076
+ return e || (0, r[li(r)[0]])((e = { exports: {} }).exports, e), e.exports;
1077
+ }, fi = ui({
1078
1078
  "src/index.ts"(r, e) {
1079
1079
  var t = Symbol.for("schemastery"), n = Symbol.for("ValidationError");
1080
1080
  globalThis.__schemastery_index__ ??= 0;
@@ -1086,7 +1086,7 @@ var Ue = class _r {
1086
1086
  g.startsWith(".") && (g = g.slice(1)), super((g === "$" ? "" : `${g} `) + u), this.options = d;
1087
1087
  }
1088
1088
  static {
1089
- U(this, "ValidationError");
1089
+ M(this, "ValidationError");
1090
1090
  }
1091
1091
  name = "ValidationError";
1092
1092
  static is(u) {
@@ -1096,12 +1096,12 @@ var Ue = class _r {
1096
1096
  Object.defineProperty(i.prototype, n, {
1097
1097
  value: !0
1098
1098
  });
1099
- var s = /* @__PURE__ */ U(function(u) {
1100
- const d = /* @__PURE__ */ U(function(g, h = {}) {
1099
+ var s = /* @__PURE__ */ M(function(u) {
1100
+ const d = /* @__PURE__ */ M(function(g, h = {}) {
1101
1101
  return s.resolve(g, d, h)[0];
1102
1102
  }, "schema");
1103
1103
  if (u.refs) {
1104
- const g = pe(u.refs, (_) => new s(_)), h = /* @__PURE__ */ U((_) => g[_], "getRef");
1104
+ const g = pe(u.refs, (_) => new s(_)), h = /* @__PURE__ */ M((_) => g[_], "getRef");
1105
1105
  for (const _ in g) {
1106
1106
  const E = g[_];
1107
1107
  E.sKey = h(E.sKey), E.inner = h(E.inner), E.list = E.list && E.list.map(h), E.dict = E.dict && pe(E.dict, h);
@@ -1117,18 +1117,18 @@ var Ue = class _r {
1117
1117
  }, "Schema");
1118
1118
  s.prototype = Object.create(Function.prototype), s.prototype[t] = !0, s.ValidationError = i;
1119
1119
  var o;
1120
- s.prototype.toJSON = /* @__PURE__ */ U(function() {
1120
+ s.prototype.toJSON = /* @__PURE__ */ M(function() {
1121
1121
  if (o)
1122
1122
  return o[this.uid] ??= JSON.parse(JSON.stringify({ ...this })), this.uid;
1123
1123
  o = { [this.uid]: { ...this } }, o[this.uid] = JSON.parse(JSON.stringify({ ...this }));
1124
1124
  const d = { uid: this.uid, refs: o };
1125
1125
  return o = void 0, d;
1126
- }, "toJSON"), s.prototype.set = /* @__PURE__ */ U(function(d, g) {
1126
+ }, "toJSON"), s.prototype.set = /* @__PURE__ */ M(function(d, g) {
1127
1127
  return this.dict[d] = g, this;
1128
- }, "set"), s.prototype.push = /* @__PURE__ */ U(function(d) {
1128
+ }, "set"), s.prototype.push = /* @__PURE__ */ M(function(d) {
1129
1129
  return this.list.push(d), this;
1130
1130
  }, "push");
1131
- function l(u, d) {
1131
+ function c(u, d) {
1132
1132
  const g = typeof u == "string" ? { "": u } : { ...u };
1133
1133
  for (const h in d) {
1134
1134
  const _ = d[h];
@@ -1136,18 +1136,18 @@ var Ue = class _r {
1136
1136
  }
1137
1137
  return g;
1138
1138
  }
1139
- U(l, "mergeDesc");
1139
+ M(c, "mergeDesc");
1140
1140
  function y(u) {
1141
1141
  return u?.$value ?? u?.$inner;
1142
1142
  }
1143
- U(y, "getInner");
1143
+ M(y, "getInner");
1144
1144
  function v(u) {
1145
1145
  return hr(u ?? {}, (d) => !d.startsWith("$"));
1146
1146
  }
1147
- U(v, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ U(function(d) {
1148
- const g = s(this), h = l(g.meta.description, d);
1147
+ M(v, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ M(function(d) {
1148
+ const g = s(this), h = c(g.meta.description, d);
1149
1149
  return Object.keys(h).length && (g.meta.description = h), g.dict && (g.dict = pe(g.dict, (_, E) => _.i18n(pe(d, (A) => y(A)?.[E] ?? A?.[E])))), g.list && (g.list = g.list.map((_, E) => _.i18n(pe(d, (A = {}) => Array.isArray(y(A)) ? y(A)[E] : Array.isArray(A) ? A[E] : v(A))))), g.inner && (g.inner = g.inner.i18n(pe(d, (_) => y(_) ? y(_) : v(_)))), g.sKey && (g.sKey = g.sKey.i18n(pe(d, (_) => _?.$key))), g;
1150
- }, "i18n"), s.prototype.extra = /* @__PURE__ */ U(function(d, g) {
1150
+ }, "i18n"), s.prototype.extra = /* @__PURE__ */ M(function(d, g) {
1151
1151
  const h = s(this);
1152
1152
  return h.meta = { ...h.meta, [d]: g }, h;
1153
1153
  }, "extra");
@@ -1158,16 +1158,16 @@ var Ue = class _r {
1158
1158
  return g.meta = { ...g.meta, [u]: d }, g;
1159
1159
  }
1160
1160
  });
1161
- s.prototype.deprecated = /* @__PURE__ */ U(function() {
1161
+ s.prototype.deprecated = /* @__PURE__ */ M(function() {
1162
1162
  const d = s(this);
1163
1163
  return d.meta.badges ||= [], d.meta.badges.push({ text: "deprecated", type: "danger" }), d;
1164
- }, "deprecated"), s.prototype.experimental = /* @__PURE__ */ U(function() {
1164
+ }, "deprecated"), s.prototype.experimental = /* @__PURE__ */ M(function() {
1165
1165
  const d = s(this);
1166
1166
  return d.meta.badges ||= [], d.meta.badges.push({ text: "experimental", type: "warning" }), d;
1167
- }, "experimental"), s.prototype.pattern = /* @__PURE__ */ U(function(d) {
1167
+ }, "experimental"), s.prototype.pattern = /* @__PURE__ */ M(function(d) {
1168
1168
  const g = s(this), h = dr(d, ["source", "flags"]);
1169
1169
  return g.meta = { ...g.meta, pattern: h }, g;
1170
- }, "pattern"), s.prototype.simplify = /* @__PURE__ */ U(function(d) {
1170
+ }, "pattern"), s.prototype.simplify = /* @__PURE__ */ M(function(d) {
1171
1171
  if (_e(d, this.meta.default, this.type === "dict")) return null;
1172
1172
  if (Y(d)) return d;
1173
1173
  if (this.type === "object" || this.type === "dict") {
@@ -1195,9 +1195,9 @@ var Ue = class _r {
1195
1195
  } catch {
1196
1196
  }
1197
1197
  return d;
1198
- }, "simplify"), s.prototype.toString = /* @__PURE__ */ U(function(d) {
1198
+ }, "simplify"), s.prototype.toString = /* @__PURE__ */ M(function(d) {
1199
1199
  return H[this.type]?.(this, d) ?? `Schema<${this.type}>`;
1200
- }, "toString"), s.prototype.role = /* @__PURE__ */ U(function(u, d) {
1200
+ }, "toString"), s.prototype.role = /* @__PURE__ */ M(function(u, d) {
1201
1201
  const g = s(this);
1202
1202
  return g.meta = { ...g.meta, role: u, extra: d }, g;
1203
1203
  }, "role");
@@ -1209,9 +1209,9 @@ var Ue = class _r {
1209
1209
  }
1210
1210
  });
1211
1211
  var S = {};
1212
- s.extend = /* @__PURE__ */ U(function(d, g) {
1212
+ s.extend = /* @__PURE__ */ M(function(d, g) {
1213
1213
  S[d] = g;
1214
- }, "extend"), s.resolve = /* @__PURE__ */ U(function(d, g, h = {}, _ = !1) {
1214
+ }, "extend"), s.resolve = /* @__PURE__ */ M(function(d, g, h = {}, _ = !1) {
1215
1215
  if (!g) return [d];
1216
1216
  if (h.ignore?.(d, g)) return [d];
1217
1217
  if (Y(d) && g.type !== "lazy") {
@@ -1230,7 +1230,7 @@ var Ue = class _r {
1230
1230
  if (!g.meta.loose) throw A;
1231
1231
  return [g.meta.default];
1232
1232
  }
1233
- }, "resolve"), s.from = /* @__PURE__ */ U(function(d) {
1233
+ }, "resolve"), s.from = /* @__PURE__ */ M(function(d) {
1234
1234
  if (Y(d))
1235
1235
  return s.any();
1236
1236
  if (["string", "number", "boolean"].includes(typeof d))
@@ -1252,14 +1252,14 @@ var Ue = class _r {
1252
1252
  }
1253
1253
  else
1254
1254
  throw new TypeError(`cannot infer schema from ${d}`);
1255
- }, "from"), s.lazy = /* @__PURE__ */ U(function(d) {
1256
- const g = /* @__PURE__ */ U(() => (h.inner[t] || (h.inner = h.builder(), h.inner.meta = { ...h.meta, ...h.inner.meta }), h.inner.toJSON()), "toJSON"), h = new s({ type: "lazy", builder: d, inner: { toJSON: g } });
1255
+ }, "from"), s.lazy = /* @__PURE__ */ M(function(d) {
1256
+ const g = /* @__PURE__ */ M(() => (h.inner[t] || (h.inner = h.builder(), h.inner.meta = { ...h.meta, ...h.inner.meta }), h.inner.toJSON()), "toJSON"), h = new s({ type: "lazy", builder: d, inner: { toJSON: g } });
1257
1257
  return h;
1258
- }, "lazy"), s.natural = /* @__PURE__ */ U(function() {
1258
+ }, "lazy"), s.natural = /* @__PURE__ */ M(function() {
1259
1259
  return s.number().step(1).min(0);
1260
- }, "natural"), s.percent = /* @__PURE__ */ U(function() {
1260
+ }, "natural"), s.percent = /* @__PURE__ */ M(function() {
1261
1261
  return s.number().step(0.01).min(0).max(1).role("slider");
1262
- }, "percent"), s.date = /* @__PURE__ */ U(function() {
1262
+ }, "percent"), s.date = /* @__PURE__ */ M(function() {
1263
1263
  return s.union([
1264
1264
  s.is(Date),
1265
1265
  s.transform(s.string().role("datetime"), (d, g) => {
@@ -1268,7 +1268,7 @@ var Ue = class _r {
1268
1268
  return h;
1269
1269
  }, !0)
1270
1270
  ]);
1271
- }, "date"), s.regExp = /* @__PURE__ */ U(function(d = "") {
1271
+ }, "date"), s.regExp = /* @__PURE__ */ M(function(d = "") {
1272
1272
  return s.union([
1273
1273
  s.is(RegExp),
1274
1274
  s.transform(s.string().role("regexp", { flag: d }), (g, h) => {
@@ -1279,7 +1279,7 @@ var Ue = class _r {
1279
1279
  }
1280
1280
  }, !0)
1281
1281
  ]);
1282
- }, "regExp"), s.arrayBuffer = /* @__PURE__ */ U(function(d) {
1282
+ }, "regExp"), s.arrayBuffer = /* @__PURE__ */ M(function(d) {
1283
1283
  return s.union([
1284
1284
  s.is(ArrayBuffer),
1285
1285
  s.is(SharedArrayBuffer),
@@ -1306,7 +1306,7 @@ var Ue = class _r {
1306
1306
  if (u > E) throw new i(`expected ${g} <= ${E} but got ${u}`, h);
1307
1307
  if (u < A && !_) throw new i(`expected ${g} >= ${A} but got ${u}`, h);
1308
1308
  }
1309
- U(w, "checkWithinRange"), s.extend("string", (u, { meta: d }, g) => {
1309
+ M(w, "checkWithinRange"), s.extend("string", (u, { meta: d }, g) => {
1310
1310
  if (typeof u != "string") throw new i(`expected string but got ${u}`, g);
1311
1311
  if (d.pattern) {
1312
1312
  const h = new RegExp(d.pattern.source, d.pattern.flags);
@@ -1314,7 +1314,7 @@ var Ue = class _r {
1314
1314
  }
1315
1315
  return w(u.length, d, "string length", g), [u];
1316
1316
  });
1317
- function N(u, d) {
1317
+ function P(u, d) {
1318
1318
  const g = u.toString();
1319
1319
  if (g.includes("e")) return u * Math.pow(10, d);
1320
1320
  const h = g.indexOf(".");
@@ -1322,14 +1322,14 @@ var Ue = class _r {
1322
1322
  const _ = g.slice(h + 1), E = g.slice(0, h);
1323
1323
  return _.length <= d ? +(E + _.padEnd(d, "0")) : +(E + _.slice(0, d) + "." + _.slice(d));
1324
1324
  }
1325
- U(N, "decimalShift");
1325
+ M(P, "decimalShift");
1326
1326
  function O(u, d, g) {
1327
1327
  if (g = Math.abs(g), !/^\d+\.\d+$/.test(g.toString()))
1328
1328
  return (u - d) % g === 0;
1329
1329
  const h = g.toString().indexOf("."), _ = g.toString().slice(h + 1).length;
1330
- return Math.abs(N(u, _) - N(d, _)) % N(g, _) === 0;
1330
+ return Math.abs(P(u, _) - P(d, _)) % P(g, _) === 0;
1331
1331
  }
1332
- U(O, "isMultipleOf"), s.extend("number", (u, { meta: d }, g) => {
1332
+ M(O, "isMultipleOf"), s.extend("number", (u, { meta: d }, g) => {
1333
1333
  if (typeof u != "number") throw new i(`expected number but got ${u}`, g);
1334
1334
  w(u, d, "number", g);
1335
1335
  const { step: h } = d;
@@ -1372,7 +1372,7 @@ var Ue = class _r {
1372
1372
  throw new i(`expected ${d} but got ${u}`, g);
1373
1373
  }
1374
1374
  });
1375
- function P(u, d, g, h) {
1375
+ function N(u, d, g, h) {
1376
1376
  try {
1377
1377
  const [_, E] = s.resolve(u[d], g, {
1378
1378
  ...h,
@@ -1384,9 +1384,9 @@ var Ue = class _r {
1384
1384
  return delete u[d], g.meta.default;
1385
1385
  }
1386
1386
  }
1387
- U(P, "property"), s.extend("array", (u, { inner: d, meta: g }, h) => {
1387
+ M(N, "property"), s.extend("array", (u, { inner: d, meta: g }, h) => {
1388
1388
  if (!Array.isArray(u)) throw new i(`expected array but got ${u}`, h);
1389
- return w(u.length, g, "array length", h, !Y(d.meta.default)), [u.map((_, E) => P(u, E, d, h))];
1389
+ return w(u.length, g, "array length", h, !Y(d.meta.default)), [u.map((_, E) => N(u, E, d, h))];
1390
1390
  }), s.extend("dict", (u, { inner: d, sKey: g }, h, _) => {
1391
1391
  if (!Ve(u)) throw new i(`expected object but got ${u}`, h);
1392
1392
  const E = {};
@@ -1398,23 +1398,23 @@ var Ue = class _r {
1398
1398
  if (_) continue;
1399
1399
  throw Q;
1400
1400
  }
1401
- E[L] = P(u, A, d, h), u[L] = u[A], A !== L && delete u[A];
1401
+ E[L] = N(u, A, d, h), u[L] = u[A], A !== L && delete u[A];
1402
1402
  }
1403
1403
  return [E];
1404
1404
  }), s.extend("tuple", (u, { list: d }, g, h) => {
1405
1405
  if (!Array.isArray(u)) throw new i(`expected array but got ${u}`, g);
1406
- const _ = d.map((E, A) => P(u, A, E, g));
1406
+ const _ = d.map((E, A) => N(u, A, E, g));
1407
1407
  return h ? [_] : (_.push(...u.slice(d.length)), [_]);
1408
1408
  });
1409
1409
  function W(u, d) {
1410
1410
  for (const g in d)
1411
1411
  g in u || (u[g] = d[g]);
1412
1412
  }
1413
- U(W, "merge"), s.extend("object", (u, { dict: d }, g, h) => {
1413
+ M(W, "merge"), s.extend("object", (u, { dict: d }, g, h) => {
1414
1414
  if (!Ve(u)) throw new i(`expected object but got ${u}`, g);
1415
1415
  const _ = {};
1416
1416
  for (const E in d) {
1417
- const A = P(u, E, d[E], g);
1417
+ const A = N(u, E, d[E], g);
1418
1418
  (!Y(A) || E in u) && (_[E] = A);
1419
1419
  }
1420
1420
  return h || W(_, u), [_];
@@ -1448,7 +1448,7 @@ var Ue = class _r {
1448
1448
  return h ? [g(E)] : [g(E), g(A)];
1449
1449
  });
1450
1450
  var H = {};
1451
- function M(u, d, g) {
1451
+ function U(u, d, g) {
1452
1452
  H[u] = g, Object.assign(s, {
1453
1453
  [u](...h) {
1454
1454
  const _ = new s({ type: u });
@@ -1489,13 +1489,13 @@ var Ue = class _r {
1489
1489
  }
1490
1490
  });
1491
1491
  }
1492
- U(M, "defineMethod"), M("is", ["constructor"], ({ constructor: u }) => typeof u == "function" ? u.name : u), M("any", [], () => "any"), M("never", [], () => "never"), M("const", ["value"], ({ value: u }) => typeof u == "string" ? JSON.stringify(u) : u), M("string", [], () => "string"), M("number", [], () => "number"), M("boolean", [], () => "boolean"), M("bitset", ["bits"], () => "bitset"), M("function", [], () => "function"), M("array", ["inner"], ({ inner: u }) => `${u.toString(!0)}[]`), M("dict", ["inner", "sKey"], ({ inner: u, sKey: d }) => `{ [key: ${d.toString()}]: ${u.toString()} }`), M("tuple", ["list"], ({ list: u }) => `[${u.map((d) => d.toString()).join(", ")}]`), M("object", ["dict"], ({ dict: u }) => Object.keys(u).length === 0 ? "{}" : `{ ${Object.entries(u).map(([d, g]) => `${d}${g.meta.required ? "" : "?"}: ${g.toString()}`).join(", ")} }`), M("union", ["list"], ({ list: u }, d) => {
1492
+ M(U, "defineMethod"), U("is", ["constructor"], ({ constructor: u }) => typeof u == "function" ? u.name : u), U("any", [], () => "any"), U("never", [], () => "never"), U("const", ["value"], ({ value: u }) => typeof u == "string" ? JSON.stringify(u) : u), U("string", [], () => "string"), U("number", [], () => "number"), U("boolean", [], () => "boolean"), U("bitset", ["bits"], () => "bitset"), U("function", [], () => "function"), U("array", ["inner"], ({ inner: u }) => `${u.toString(!0)}[]`), U("dict", ["inner", "sKey"], ({ inner: u, sKey: d }) => `{ [key: ${d.toString()}]: ${u.toString()} }`), U("tuple", ["list"], ({ list: u }) => `[${u.map((d) => d.toString()).join(", ")}]`), U("object", ["dict"], ({ dict: u }) => Object.keys(u).length === 0 ? "{}" : `{ ${Object.entries(u).map(([d, g]) => `${d}${g.meta.required ? "" : "?"}: ${g.toString()}`).join(", ")} }`), U("union", ["list"], ({ list: u }, d) => {
1493
1493
  const g = u.map(({ toString: h }) => h()).join(" | ");
1494
1494
  return d ? `(${g})` : g;
1495
- }), M("intersect", ["list"], ({ list: u }) => `${u.map((d) => d.toString(!0)).join(" & ")}`), M("transform", ["inner", "callback", "preserve"], ({ inner: u }, d) => u.toString(d)), e.exports = s;
1495
+ }), U("intersect", ["list"], ({ list: u }) => `${u.map((d) => d.toString(!0)).join(" & ")}`), U("transform", ["inner", "callback", "preserve"], ({ inner: u }, d) => u.toString(d)), e.exports = s;
1496
1496
  }
1497
1497
  });
1498
- const fi = ui();
1498
+ const hi = fi();
1499
1499
  /**
1500
1500
  * @inpageedit/logger
1501
1501
  *
@@ -1526,23 +1526,23 @@ const tr = [
1526
1526
  [140, 160],
1527
1527
  [160, 180]
1528
1528
  ];
1529
- function hi(r, e) {
1530
- const t = tr.length, n = qe(r) % t, [i, s] = tr[n], o = s - i, l = qe(r + ":" + e), y = i + l % (o || 1), v = qe(r + ":s"), S = qe(r + ":l");
1531
- let w, N;
1529
+ function di(r, e) {
1530
+ const t = tr.length, n = qe(r) % t, [i, s] = tr[n], o = s - i, c = qe(r + ":" + e), y = i + c % (o || 1), v = qe(r + ":s"), S = qe(r + ":l");
1531
+ let w, P;
1532
1532
  if (e === "name")
1533
- w = 62 + v % 18, N = 30 + S % 12;
1533
+ w = 62 + v % 18, P = 30 + S % 12;
1534
1534
  else {
1535
- const O = y >= 0 && y < 50 || y > 330 && y < 360, P = y >= 200 && y <= 300;
1536
- w = 55 + v % 20, P ? N = 55 + S % 8 : O ? N = 48 + S % 6 : N = 50 + S % 8, w < 60 && (w += 5);
1535
+ const O = y >= 0 && y < 50 || y > 330 && y < 360, N = y >= 200 && y <= 300;
1536
+ w = 55 + v % 20, N ? P = 55 + S % 8 : O ? P = 48 + S % 6 : P = 50 + S % 8, w < 60 && (w += 5);
1537
1537
  }
1538
- return `hsl(${y}, ${w}%, ${N}%)`;
1538
+ return `hsl(${y}, ${w}%, ${P}%)`;
1539
1539
  }
1540
1540
  function We(r, e) {
1541
1541
  if (e)
1542
1542
  return ft.set(r, e), e;
1543
1543
  const t = ft.get(r);
1544
1544
  if (t) return t;
1545
- const n = r.startsWith("name:") ? "name" : "group", i = hi(r, n);
1545
+ const n = r.startsWith("name:") ? "name" : "group", i = di(r, n);
1546
1546
  return ft.set(r, i), i;
1547
1547
  }
1548
1548
  /**
@@ -1565,7 +1565,7 @@ function We(r, e) {
1565
1565
  * logger.success('User created successfully')
1566
1566
  * ```
1567
1567
  */
1568
- let di = class xr {
1568
+ let pi = class xr {
1569
1569
  /**
1570
1570
  * Note: constructor returns a callable Proxy so that you can do `logger('group')`.
1571
1571
  */
@@ -1580,7 +1580,7 @@ let di = class xr {
1580
1580
  }, this._name && We(`name:${this._name}`, this._nameColor), this._installBuiltinLevels();
1581
1581
  for (const t of Object.keys(this._dynamicLevels))
1582
1582
  this._installLevelGetter(t, this._dynamicLevels[t]);
1583
- return mi(this);
1583
+ return gi(this);
1584
1584
  }
1585
1585
  // ---------- public API ----------
1586
1586
  get level() {
@@ -1630,7 +1630,7 @@ let di = class xr {
1630
1630
  });
1631
1631
  }
1632
1632
  _method(e) {
1633
- const t = pi[e];
1633
+ const t = mi[e];
1634
1634
  if (!this._enabled(t.level)) return rr;
1635
1635
  const [n, i] = this._prefix(t.label);
1636
1636
  return this._consoleMethod(e).bind(console, n, ...i);
@@ -1659,14 +1659,14 @@ let di = class xr {
1659
1659
  }
1660
1660
  };
1661
1661
  const rr = () => {
1662
- }, nr = "color:inherit; background:transparent; text-decoration:none;", pi = {
1662
+ }, nr = "color:inherit; background:transparent; text-decoration:none;", mi = {
1663
1663
  debug: { level: -1, label: "", method: "debug" },
1664
1664
  log: { level: 0, label: "", method: "log" },
1665
1665
  info: { level: 1, label: "[I]", method: "info" },
1666
1666
  warn: { level: 2, label: "[W]", method: "warn" },
1667
1667
  error: { level: 3, label: "[E]", method: "error" }
1668
1668
  };
1669
- function mi(r) {
1669
+ function gi(r) {
1670
1670
  const e = function(t, n) {
1671
1671
  return r.group(t, n);
1672
1672
  };
@@ -1685,8 +1685,8 @@ function mi(r) {
1685
1685
  }
1686
1686
  });
1687
1687
  }
1688
- function gi(r) {
1689
- return new di(r);
1688
+ function yi(r) {
1689
+ return new pi(r);
1690
1690
  }
1691
1691
  var ne = /* @__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))(ne || {});
1692
1692
  class te extends Error {
@@ -1694,12 +1694,12 @@ class te extends Error {
1694
1694
  super(t, i), this.code = e, this.context = n, this.name = "FexiosError";
1695
1695
  }
1696
1696
  }
1697
- class yi extends te {
1697
+ class bi extends te {
1698
1698
  constructor(e, t, n) {
1699
1699
  super(t.statusText, e, void 0, n), this.response = t, this.name = "FexiosResponseError";
1700
1700
  }
1701
1701
  }
1702
- function bi(r, e = 2048) {
1702
+ function vi(r, e = 2048) {
1703
1703
  if (!(r instanceof Uint8Array))
1704
1704
  throw new TypeError("Input must be a Uint8Array");
1705
1705
  if (r.length === 0)
@@ -1708,23 +1708,23 @@ function bi(r, e = 2048) {
1708
1708
  Math.max(r.length, 256),
1709
1709
  e
1710
1710
  ), n = r.slice(0, t);
1711
- if (vi(n))
1711
+ if (wi(n))
1712
1712
  return !1;
1713
- const i = wi(n);
1713
+ const i = _i(n);
1714
1714
  if (i.nullByteRatio > 0.05 || i.highByteRatio > 0.95)
1715
1715
  return !1;
1716
1716
  const s = ["utf-8", "utf-16le", "utf-16be", "iso-8859-1"];
1717
- let o = -1, l = !1;
1717
+ let o = -1, c = !1;
1718
1718
  for (const y of s)
1719
1719
  try {
1720
- const v = new TextDecoder(y, { fatal: !0 }).decode(n), S = _i(v);
1721
- S > o && (o = S, l = S > 0.7);
1720
+ const v = new TextDecoder(y, { fatal: !0 }).decode(n), S = Si(v);
1721
+ S > o && (o = S, c = S > 0.7);
1722
1722
  } catch {
1723
1723
  continue;
1724
1724
  }
1725
- return l;
1725
+ return c;
1726
1726
  }
1727
- function vi(r) {
1727
+ function wi(r) {
1728
1728
  if (r.length < 4) return !1;
1729
1729
  const e = [
1730
1730
  [137, 80, 78, 71],
@@ -1764,7 +1764,7 @@ function vi(r) {
1764
1764
  }
1765
1765
  return !1;
1766
1766
  }
1767
- function wi(r) {
1767
+ function _i(r) {
1768
1768
  let e = 0, t = 0, n = 0;
1769
1769
  for (const i of r)
1770
1770
  i === 0 && e++, i > 127 && t++, (i < 32 && i !== 9 && i !== 10 && i !== 13 || i === 127) && n++;
@@ -1774,23 +1774,23 @@ function wi(r) {
1774
1774
  controlCharRatio: n / r.length
1775
1775
  };
1776
1776
  }
1777
- function _i(r) {
1777
+ function Si(r) {
1778
1778
  if (r.length === 0) return 1;
1779
1779
  let e = 1, t = 0;
1780
1780
  for (let i = 0; i < r.length; i++) {
1781
1781
  const s = r[i].charCodeAt(0);
1782
- s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !Si(s) && !xi(s) && t++ : e -= 0.1;
1782
+ s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !xi(s) && !Ei(s) && t++ : e -= 0.1;
1783
1783
  }
1784
1784
  const n = t / r.length;
1785
- return e *= n, Ei(r) && (e *= 1.1), Math.max(0, Math.min(1, e));
1785
+ return e *= n, ki(r) && (e *= 1.1), Math.max(0, Math.min(1, e));
1786
1786
  }
1787
- function Si(r) {
1787
+ function xi(r) {
1788
1788
  return r >= 0 && r <= 31 || r >= 127 && r <= 159;
1789
1789
  }
1790
- function xi(r) {
1790
+ function Ei(r) {
1791
1791
  return r >= 57344 && r <= 63743 || r >= 983040 && r <= 1048573 || r >= 1048576 && r <= 1114109;
1792
1792
  }
1793
- function Ei(r) {
1793
+ function ki(r) {
1794
1794
  return [
1795
1795
  /\b\w+\b/,
1796
1796
  // Words
@@ -1818,26 +1818,26 @@ function ir(r, e = {}) {
1818
1818
  i != null && (e.dropEmptyString && i === "" || (t[n] = i));
1819
1819
  }), t;
1820
1820
  }
1821
- class Ne {
1821
+ class Pe {
1822
1822
  constructor(e, t, n) {
1823
1823
  this.rawResponse = e, this.data = t, this.ok = e.ok, this.status = e.status, this.statusText = e.statusText, this.headers = e.headers, Object.entries(n || {}).forEach(([i, s]) => {
1824
1824
  this[i] = s;
1825
1825
  });
1826
1826
  }
1827
1827
  }
1828
- async function ki(r, e, t) {
1828
+ async function Oi(r, e, t) {
1829
1829
  var n;
1830
1830
  if (r.bodyUsed)
1831
1831
  throw new te(
1832
1832
  ne.BODY_USED,
1833
1833
  "Response body has already been used or locked"
1834
1834
  );
1835
- const i = r.headers.get("content-type") || "", s = Number(r.headers.get("content-length")) || 0, o = (y, v) => v === "json" || y.startsWith("application/json"), l = (y, v, S) => S === "blob" || y.startsWith("image/") && !y.startsWith("image/svg") || y.startsWith("video/") || y.startsWith("audio/") || !bi(v);
1835
+ const i = r.headers.get("content-type") || "", s = Number(r.headers.get("content-length")) || 0, o = (y, v) => v === "json" || y.startsWith("application/json"), c = (y, v, S) => S === "blob" || y.startsWith("image/") && !y.startsWith("image/svg") || y.startsWith("video/") || y.startsWith("audio/") || !vi(v);
1836
1836
  if ((r.status === 101 || r.status === 426 || r.headers.get("upgrade")) && typeof globalThis.WebSocket < "u") {
1837
1837
  const y = new WebSocket(r.url);
1838
1838
  return await new Promise((v, S) => {
1839
1839
  y.onopen = v, y.onerror = S;
1840
- }), new Ne(r, y, {
1840
+ }), new Pe(r, y, {
1841
1841
  ok: !0,
1842
1842
  status: 101,
1843
1843
  statusText: "Switching Protocols"
@@ -1846,10 +1846,10 @@ async function ki(r, e, t) {
1846
1846
  const y = new EventSource(r.url);
1847
1847
  return await new Promise((v, S) => {
1848
1848
  y.onopen = v, y.onerror = S;
1849
- }), new Ne(r, y);
1849
+ }), new Pe(r, y);
1850
1850
  } else {
1851
1851
  if (e === "stream")
1852
- return new Ne(
1852
+ return new Pe(
1853
1853
  r,
1854
1854
  r.body
1855
1855
  );
@@ -1862,14 +1862,14 @@ async function ki(r, e, t) {
1862
1862
  );
1863
1863
  let v = new Uint8Array();
1864
1864
  for (; ; ) {
1865
- const { done: w, value: N } = await y.read();
1865
+ const { done: w, value: P } = await y.read();
1866
1866
  if (w) break;
1867
- if (N && (v = new Uint8Array([...v, ...N]), t && s > 0)) {
1867
+ if (P && (v = new Uint8Array([...v, ...P]), t && s > 0)) {
1868
1868
  const O = Math.min(v.length / s, 1);
1869
1869
  t(O, v);
1870
1870
  }
1871
1871
  }
1872
- const S = new Ne(r, void 0);
1872
+ const S = new Pe(r, void 0);
1873
1873
  if (e === "arrayBuffer")
1874
1874
  return S.data = v.buffer, S;
1875
1875
  if (o(i, e))
@@ -1878,11 +1878,11 @@ async function ki(r, e, t) {
1878
1878
  S.data = JSON.parse(w);
1879
1879
  } catch {
1880
1880
  }
1881
- if (typeof S.data != "string" && l(i, v, e) ? S.data = new Blob([v], {
1881
+ if (typeof S.data != "string" && c(i, v, e) ? S.data = new Blob([v], {
1882
1882
  type: r.headers.get("content-type") || void 0
1883
1883
  }) : S.data = new TextDecoder().decode(v), typeof S.data == "string" && e !== "text") {
1884
- const w = S.data.trim(), N = w[0], O = w[w.length - 1];
1885
- if (N === "{" && O === "}" || N === "[" && O === "]")
1884
+ const w = S.data.trim(), P = w[0], O = w[w.length - 1];
1885
+ if (P === "{" && O === "}" || P === "[" && O === "]")
1886
1886
  try {
1887
1887
  S.data = JSON.parse(S.data);
1888
1888
  } catch {
@@ -1890,14 +1890,14 @@ async function ki(r, e, t) {
1890
1890
  }
1891
1891
  if (typeof S.data > "u" && (S.data = v.length > 0 ? v : void 0), S.ok)
1892
1892
  return S;
1893
- throw new yi(
1893
+ throw new bi(
1894
1894
  `Request failed with status code ${r.status}`,
1895
1895
  S
1896
1896
  );
1897
1897
  }
1898
1898
  }
1899
1899
  }
1900
- class Oi {
1900
+ class Ri {
1901
1901
  /**
1902
1902
  * Build URLSearchParams from a record object with proper array handling
1903
1903
  * @param query - The query object containing key-value pairs
@@ -1922,7 +1922,7 @@ function Ii(r) {
1922
1922
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
1923
1923
  }
1924
1924
  var ht, sr;
1925
- function Ri() {
1925
+ function Ai() {
1926
1926
  if (sr) return ht;
1927
1927
  sr = 1;
1928
1928
  function r(e) {
@@ -1935,8 +1935,8 @@ function Ri() {
1935
1935
  }
1936
1936
  return r.prototype = Object.create(Function.prototype), ht = r, ht;
1937
1937
  }
1938
- var Ai = Ri();
1939
- const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
1938
+ var $i = Ai();
1939
+ const Ti = /* @__PURE__ */ Ii($i), Xe = class ye extends Ti {
1940
1940
  constructor(e = {}) {
1941
1941
  super("request"), this.baseConfigs = e, this.hooks = [], this.interceptors = {
1942
1942
  request: this.createInterceptor("beforeRequest"),
@@ -1945,54 +1945,54 @@ const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
1945
1945
  }
1946
1946
  async request(e, t) {
1947
1947
  var n, i, s, o;
1948
- let l = t = t || {};
1949
- typeof e == "string" || e instanceof URL ? l.url = e.toString() : typeof e == "object" && (l = { ...e, ...l }), l = await this.emit("beforeInit", l);
1950
- const y = t.baseURL || this.baseConfigs.baseURL || ((n = globalThis.location) == null ? void 0 : n.href), v = y ? new URL(y, (i = globalThis.location) == null ? void 0 : i.href) : void 0, S = new URL(l.url.toString(), v);
1951
- l.url = S.href, l.baseURL = v ? v.href : S.origin, l.headers = this.mergeHeaders(
1948
+ let c = t = t || {};
1949
+ typeof e == "string" || e instanceof URL ? c.url = e.toString() : typeof e == "object" && (c = { ...e, ...c }), c = await this.emit("beforeInit", c);
1950
+ const y = t.baseURL || this.baseConfigs.baseURL || ((n = globalThis.location) == null ? void 0 : n.href), v = y ? new URL(y, (i = globalThis.location) == null ? void 0 : i.href) : void 0, S = new URL(c.url.toString(), v);
1951
+ c.url = S.href, c.baseURL = v ? v.href : S.origin, c.headers = this.mergeHeaders(
1952
1952
  this.baseConfigs.headers,
1953
1953
  t.headers
1954
1954
  );
1955
- const w = v?.searchParams, N = new URLSearchParams(S.searchParams);
1956
- if (S.search = "", l.url = S.href, l.query = this.mergeQuery(
1955
+ const w = v?.searchParams, P = new URLSearchParams(S.searchParams);
1956
+ if (S.search = "", c.url = S.href, c.query = this.mergeQuery(
1957
1957
  w,
1958
1958
  // baseURL query (lowest priority)
1959
1959
  this.baseConfigs.query,
1960
1960
  // defaultOptions (baseOptions)
1961
- N,
1961
+ P,
1962
1962
  // requestURL query (urlParams)
1963
1963
  t.query
1964
1964
  // requestOptions (highest priority)
1965
- ), S.search = Oi.makeQueryString(l.query), l.url = S.toString(), ye.METHODS_WITHOUT_BODY.includes(
1966
- (s = l.method) == null ? void 0 : s.toLocaleLowerCase()
1967
- ) && l.body)
1965
+ ), S.search = Ri.makeQueryString(c.query), c.url = S.toString(), ye.METHODS_WITHOUT_BODY.includes(
1966
+ (s = c.method) == null ? void 0 : s.toLocaleLowerCase()
1967
+ ) && c.body)
1968
1968
  throw new te(
1969
1969
  ne.BODY_NOT_ALLOWED,
1970
- `Request method "${l.method}" does not allow body`
1970
+ `Request method "${c.method}" does not allow body`
1971
1971
  );
1972
- l = await this.emit("beforeRequest", l);
1972
+ c = await this.emit("beforeRequest", c);
1973
1973
  let O;
1974
- typeof l.body < "u" && l.body !== null && (l.body instanceof Blob || l.body instanceof FormData || l.body instanceof URLSearchParams ? O = l.body : typeof l.body == "object" && l.body !== null ? (O = JSON.stringify(l.body), l.headers["content-type"] = "application/json") : O = l.body), !((o = t.headers) != null && o["content-type"]) && O && (O instanceof FormData || O instanceof URLSearchParams ? delete l.headers["content-type"] : typeof O == "string" && typeof l.body == "object" ? l.headers["content-type"] = "application/json" : O instanceof Blob && (l.headers["content-type"] = O.type)), l.body = O, l = await this.emit("afterBodyTransformed", l);
1975
- const P = l.abortController || globalThis.AbortController ? new AbortController() : void 0, W = new Request(l.url, {
1976
- method: l.method || "GET",
1977
- credentials: l.credentials,
1978
- cache: l.cache,
1979
- mode: l.mode,
1980
- headers: l.headers,
1981
- body: l.body,
1982
- signal: P?.signal
1974
+ typeof c.body < "u" && c.body !== null && (c.body instanceof Blob || c.body instanceof FormData || c.body instanceof URLSearchParams ? O = c.body : typeof c.body == "object" && c.body !== null ? (O = JSON.stringify(c.body), c.headers["content-type"] = "application/json") : O = c.body), !((o = t.headers) != null && o["content-type"]) && O && (O instanceof FormData || O instanceof URLSearchParams ? delete c.headers["content-type"] : typeof O == "string" && typeof c.body == "object" ? c.headers["content-type"] = "application/json" : O instanceof Blob && (c.headers["content-type"] = O.type)), c.body = O, c = await this.emit("afterBodyTransformed", c);
1975
+ const N = c.abortController || globalThis.AbortController ? new AbortController() : void 0, W = new Request(c.url, {
1976
+ method: c.method || "GET",
1977
+ credentials: c.credentials,
1978
+ cache: c.cache,
1979
+ mode: c.mode,
1980
+ headers: c.headers,
1981
+ body: c.body,
1982
+ signal: N?.signal
1983
1983
  });
1984
- l.rawRequest = W, l = await this.emit("beforeActualFetch", l);
1985
- const H = l.timeout || this.baseConfigs.timeout || 60 * 1e3;
1986
- if (l.url.startsWith("ws"))
1984
+ c.rawRequest = W, c = await this.emit("beforeActualFetch", c);
1985
+ const H = c.timeout || this.baseConfigs.timeout || 60 * 1e3;
1986
+ if (c.url.startsWith("ws"))
1987
1987
  try {
1988
- const u = new WebSocket(l.url);
1988
+ const u = new WebSocket(c.url);
1989
1989
  return await new Promise((d, g) => {
1990
1990
  const h = setTimeout(() => {
1991
1991
  g(
1992
1992
  new te(
1993
1993
  ne.TIMEOUT,
1994
1994
  `WebSocket connection timed out after ${H}ms`,
1995
- l
1995
+ c
1996
1996
  )
1997
1997
  );
1998
1998
  }, H);
@@ -2003,7 +2003,7 @@ const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
2003
2003
  new te(
2004
2004
  ne.NETWORK_ERROR,
2005
2005
  "WebSocket connection failed",
2006
- l
2006
+ c
2007
2007
  )
2008
2008
  );
2009
2009
  }, u.onclose = (_) => {
@@ -2011,52 +2011,52 @@ const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
2011
2011
  new te(
2012
2012
  ne.NETWORK_ERROR,
2013
2013
  `WebSocket closed with code ${_.code}`,
2014
- l
2014
+ c
2015
2015
  )
2016
2016
  ));
2017
2017
  };
2018
- }), l.rawResponse = new Response(), l.response = new Ne(l.rawResponse, u, {
2018
+ }), c.rawResponse = new Response(), c.response = new Pe(c.rawResponse, u, {
2019
2019
  ok: !0,
2020
2020
  status: 101,
2021
2021
  statusText: "Switching Protocols"
2022
- }), l.data = u, l.headers = new Headers(), this.emit("afterResponse", l);
2022
+ }), c.data = u, c.headers = new Headers(), this.emit("afterResponse", c);
2023
2023
  } catch (u) {
2024
2024
  throw u instanceof te ? u : new te(
2025
2025
  ne.NETWORK_ERROR,
2026
2026
  `WebSocket creation failed: ${u}`,
2027
- l
2027
+ c
2028
2028
  );
2029
2029
  }
2030
- let M;
2030
+ let U;
2031
2031
  try {
2032
- P && (M = setTimeout(() => {
2033
- P.abort();
2032
+ N && (U = setTimeout(() => {
2033
+ N.abort();
2034
2034
  }, H));
2035
- const u = await (t.fetch || this.baseConfigs.fetch || globalThis.fetch)(l.rawRequest).catch((d) => {
2036
- throw M && clearTimeout(M), P != null && P.signal.aborted ? new te(
2035
+ const u = await (t.fetch || this.baseConfigs.fetch || globalThis.fetch)(c.rawRequest).catch((d) => {
2036
+ throw U && clearTimeout(U), N != null && N.signal.aborted ? new te(
2037
2037
  ne.TIMEOUT,
2038
2038
  `Request timed out after ${H}ms`,
2039
- l
2040
- ) : new te(ne.NETWORK_ERROR, d.message, l);
2039
+ c
2040
+ ) : new te(ne.NETWORK_ERROR, d.message, c);
2041
2041
  });
2042
- return M && clearTimeout(M), l.rawResponse = u, l.response = await ki(
2042
+ return U && clearTimeout(U), c.rawResponse = u, c.response = await Oi(
2043
2043
  u,
2044
- l.responseType,
2044
+ c.responseType,
2045
2045
  (d, g) => {
2046
2046
  var h;
2047
2047
  (h = t?.onProgress) == null || h.call(t, d, g);
2048
2048
  }
2049
- ), l.data = l.response.data, l.headers = l.response.headers, this.emit("afterResponse", l);
2049
+ ), c.data = c.response.data, c.headers = c.response.headers, this.emit("afterResponse", c);
2050
2050
  } catch (u) {
2051
- throw M && clearTimeout(M), u;
2051
+ throw U && clearTimeout(U), u;
2052
2052
  }
2053
2053
  }
2054
2054
  mergeQuery(e, ...t) {
2055
2055
  const n = {}, i = (s) => {
2056
- s && (Ge(s) ? Object.entries(s).forEach(([o, l]) => {
2057
- l == null ? delete n[o] : Array.isArray(l) ? (o.endsWith("[]"), n[o] = l.map(String)) : n[o] = String(l);
2058
- }) : new URLSearchParams(s).forEach((o, l) => {
2059
- n[l] = o;
2056
+ s && (Ge(s) ? Object.entries(s).forEach(([o, c]) => {
2057
+ c == null ? delete n[o] : Array.isArray(c) ? (o.endsWith("[]"), n[o] = c.map(String)) : n[o] = String(c);
2058
+ }) : new URLSearchParams(s).forEach((o, c) => {
2059
+ n[c] = o;
2060
2060
  }));
2061
2061
  };
2062
2062
  return i(e), t.forEach(i), n;
@@ -2068,12 +2068,12 @@ const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
2068
2068
  if (Ge(s)) {
2069
2069
  const o = ir(s);
2070
2070
  if (Object.keys(o).length === 0) continue;
2071
- new Headers(o).forEach((l, y) => {
2072
- i.set(y, l);
2071
+ new Headers(o).forEach((c, y) => {
2072
+ i.set(y, c);
2073
2073
  });
2074
2074
  } else
2075
- new Headers(s).forEach((o, l) => {
2076
- i.set(l, o);
2075
+ new Headers(s).forEach((o, c) => {
2076
+ i.set(c, o);
2077
2077
  });
2078
2078
  return i.forEach((s, o) => {
2079
2079
  n[o] = s;
@@ -2084,8 +2084,8 @@ const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
2084
2084
  try {
2085
2085
  let i = 0;
2086
2086
  for (const s of n) {
2087
- const o = `${e}#${s.action.name || `anonymous#${i}`}`, l = Symbol("FexiosHookContext");
2088
- t[l] = l;
2087
+ const o = `${e}#${s.action.name || `anonymous#${i}`}`, c = Symbol("FexiosHookContext");
2088
+ t[c] = c;
2089
2089
  let y = await s.action.call(this, t);
2090
2090
  if (y === void 0 && (y = t), y === !1)
2091
2091
  throw new te(
@@ -2093,7 +2093,7 @@ const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
2093
2093
  `Request aborted by hook "${o}"`,
2094
2094
  t
2095
2095
  );
2096
- if (typeof y == "object" && y[l] === l)
2096
+ if (typeof y == "object" && y[c] === c)
2097
2097
  t = y;
2098
2098
  else {
2099
2099
  const v = globalThis["".concat("console")];
@@ -2106,7 +2106,7 @@ const $i = /* @__PURE__ */ Ii(Ai), Xe = class ye extends $i {
2106
2106
  v.warn(S.stack || S);
2107
2107
  }
2108
2108
  }
2109
- delete t[l], i++;
2109
+ delete t[c], i++;
2110
2110
  }
2111
2111
  } catch (i) {
2112
2112
  return Promise.reject(i);
@@ -2187,7 +2187,7 @@ let Er = Xe;
2187
2187
  * @license MIT
2188
2188
  * @author dragon-fish <dragon-fish@qq.com>
2189
2189
  */
2190
- const Ti = Er.create, or = Ti();
2190
+ const Pi = Er.create, or = Pi();
2191
2191
  typeof globalThis < "u" ? globalThis.fexios = or : typeof window < "u" && (window.fexios = or);
2192
2192
  /**
2193
2193
  * MediaWiki Api
@@ -2351,13 +2351,13 @@ const kr = class X {
2351
2351
  "TOKEN_RETRY_LIMIT_EXCEEDED",
2352
2352
  "The limit of the number of times to automatically re-acquire the token has been exceeded"
2353
2353
  );
2354
- const l = await this.token(e, o), y = () => this.postWithToken(e, t, {
2354
+ const c = await this.token(e, o), y = () => this.postWithToken(e, t, {
2355
2355
  tokenName: i,
2356
2356
  retry: s - 1,
2357
2357
  noCache: !0
2358
2358
  });
2359
2359
  return this.post({
2360
- [i]: l,
2360
+ [i]: c,
2361
2361
  ...t
2362
2362
  }).then((v) => {
2363
2363
  const S = v.data;
@@ -2441,20 +2441,20 @@ class Ee extends Error {
2441
2441
  */
2442
2442
  class Or extends Ni {
2443
2443
  }
2444
- class Pi {
2445
- constructor(e, t) {
2446
- this.ctx = e;
2447
- let n = typeof t?.baseURL == "string" ? t.baseURL : t?.baseURL?.toString();
2448
- n?.startsWith("/") && (n = new URL(n, location.origin).href);
2449
- const i = new Or(n, {
2444
+ class Di {
2445
+ constructor(e, t = {}) {
2446
+ this.ctx = e, t?.baseURL?.startsWith("/") && (t.baseURL = new URL(t.baseURL, location.origin).href);
2447
+ const n = new Or(t.baseURL, {
2450
2448
  headers: {
2451
- "x-api-user-agent": `InPageEdit-NEXT ${e.version}`
2452
- }
2449
+ "x-api-user-agent": `InPageEdit-NEXT ${e.version}`,
2450
+ ...t.headers
2451
+ },
2452
+ ...t
2453
2453
  });
2454
- e.set("api", i);
2454
+ e.set("api", n);
2455
2455
  }
2456
2456
  }
2457
- class Di extends Ue {
2457
+ class Ci extends Me {
2458
2458
  constructor(e) {
2459
2459
  super(e, "resourceLoader", !0), this.ctx = e;
2460
2460
  }
@@ -2464,25 +2464,25 @@ class Di extends Ue {
2464
2464
  if (!e)
2465
2465
  return Promise.resolve(null);
2466
2466
  const n = `script:${e}`, i = document.querySelector(`[data-ipe="${n}"]`);
2467
- return i ? Promise.resolve(i) : new Promise((o, l) => {
2467
+ return i ? Promise.resolve(i) : new Promise((o, c) => {
2468
2468
  const y = document.createElement("script");
2469
2469
  y.src = e, y.dataset.ipe = n, t && Object.entries(t).forEach(([v, S]) => {
2470
2470
  typeof S > "u" || S === !1 || S === null ? y.removeAttribute(v) : y.setAttribute(v, S);
2471
- }), document.body.appendChild(y), y.onload = () => o(y), y.onerror = (v) => l(v);
2471
+ }), document.body.appendChild(y), y.onload = () => o(y), y.onerror = (v) => c(v);
2472
2472
  });
2473
2473
  }
2474
2474
  loadStyle(e, t) {
2475
2475
  if (!e)
2476
2476
  return Promise.resolve(null);
2477
2477
  const n = `style:${e}`, i = document.querySelector(`[data-ipe="${n}"]`);
2478
- return i ? Promise.resolve(i) : new Promise((o, l) => {
2478
+ return i ? Promise.resolve(i) : new Promise((o, c) => {
2479
2479
  const y = document.createElement("link");
2480
2480
  y.rel = "stylesheet", y.href = e, y.dataset.ipe = n, t && Object.entries(t).forEach(([S, w]) => {
2481
2481
  typeof w > "u" || w === !1 || w === null ? y.removeAttribute(S) : y.setAttribute(S, w);
2482
2482
  }), (document.querySelector('meta[name="ipe-styles"]') || (() => {
2483
2483
  const S = document.createElement("meta");
2484
2484
  return S.id = "ipe-styles", S.name = "ipe-styles", document.head.insertAdjacentElement("afterbegin", S), S;
2485
- })()).before(y), y.onload = () => o(y), y.onerror = (S) => l(S);
2485
+ })()).before(y), y.onload = () => o(y), y.onerror = (S) => c(S);
2486
2486
  });
2487
2487
  }
2488
2488
  resolveImportPath(e) {
@@ -2490,8 +2490,8 @@ class Di extends Ue {
2490
2490
  }
2491
2491
  }
2492
2492
  var Ot = /* @__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))(Ot || {});
2493
- let Ci = 0;
2494
- const ar = (r) => `${r}-${++Ci}`;
2493
+ let Li = 0;
2494
+ const ar = (r) => `${r}-${++Li}`;
2495
2495
  function $e(r) {
2496
2496
  return r instanceof Node ? r : document.createTextNode(String(r));
2497
2497
  }
@@ -2518,7 +2518,7 @@ function Z(r, e = {}) {
2518
2518
  for (const [n, i] of Object.entries(e.attrs)) t.setAttribute(n, i);
2519
2519
  return t;
2520
2520
  }
2521
- class Li {
2521
+ class Bi {
2522
2522
  constructor() {
2523
2523
  this.zBase = 1e3, this.stack = [];
2524
2524
  }
@@ -2534,8 +2534,8 @@ class Li {
2534
2534
  closeAll(e, t) {
2535
2535
  const n = new Set((Array.isArray(t) ? t : t ? [t] : []).map(String)), i = new Set((Array.isArray(e) ? e : e ? [e] : []).map(String));
2536
2536
  [...this.stack].reverse().forEach((s) => {
2537
- const o = s.modalId, l = i.size ? i.has(s.pluginName) : !0, y = n.has(o);
2538
- l && !y && s.close();
2537
+ const o = s.modalId, c = i.size ? i.has(s.pluginName) : !0, y = n.has(o);
2538
+ c && !y && s.close();
2539
2539
  });
2540
2540
  }
2541
2541
  removeAll() {
@@ -2551,8 +2551,8 @@ class Li {
2551
2551
  document.documentElement.classList.remove("ipe-modal-no-scroll");
2552
2552
  }
2553
2553
  }
2554
- const ee = new Li();
2555
- class It {
2554
+ const ee = new Bi();
2555
+ class Rt {
2556
2556
  constructor(e = {}) {
2557
2557
  this.backdropId = ar("ipe-modal-backdrop"), this.modalId = ar("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 = Ot, this.DEFAULT_OPTIONS = {
2558
2558
  className: "",
@@ -2574,8 +2574,8 @@ class It {
2574
2574
  }, this.onDragMove = (t) => {
2575
2575
  if (!this.isDragging) return;
2576
2576
  t.preventDefault();
2577
- const n = t.clientX - this.dragStartX, i = t.clientY - this.dragStartY, s = this.get$modal(), o = this.modalStartX + n, l = this.modalStartY + i;
2578
- s.style.left = `${o}px`, s.style.top = `${l}px`;
2577
+ const n = t.clientX - this.dragStartX, i = t.clientY - this.dragStartY, s = this.get$modal(), o = this.modalStartX + n, c = this.modalStartY + i;
2578
+ s.style.left = `${o}px`, s.style.top = `${c}px`;
2579
2579
  }, this.onDragEnd = () => {
2580
2580
  if (!this.isDragging) return;
2581
2581
  this.isDragging = !1, document.removeEventListener("pointermove", this.onDragMove), document.removeEventListener("pointerup", this.onDragEnd);
@@ -2603,16 +2603,16 @@ class It {
2603
2603
  });
2604
2604
  if (n.modal = this, !e) {
2605
2605
  n.classList.add("no-backdrop");
2606
- const O = window.pageYOffset || document.documentElement.scrollTop, P = window.pageXOffset || document.documentElement.scrollLeft, W = window.innerWidth;
2606
+ const O = window.pageYOffset || document.documentElement.scrollTop, N = window.pageXOffset || document.documentElement.scrollLeft, W = window.innerWidth;
2607
2607
  n.style.top = `${O + 60}px`, this.once("modal.show", () => {
2608
- n.style.left = `${P + W / 2 - n.offsetWidth / 2}px`;
2608
+ n.style.left = `${N + W / 2 - n.offsetWidth / 2}px`;
2609
2609
  });
2610
2610
  }
2611
2611
  const i = Z("div", {
2612
2612
  className: `ipe-modal-modal__window size--${this.options.sizeClass || "auto"} plugin--${this.pluginName}`
2613
2613
  });
2614
2614
  i.modal = this;
2615
- const s = Z("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, l = Z("h2", {
2615
+ const s = Z("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, c = Z("h2", {
2616
2616
  className: "ipe-modal-modal__title",
2617
2617
  attrs: { id: o, role: "heading", "aria-level": "2" }
2618
2618
  });
@@ -2625,17 +2625,17 @@ class It {
2625
2625
  html: "&times;"
2626
2626
  });
2627
2627
  O.addEventListener("click", () => {
2628
- let P = !0;
2629
- typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (P = !1) : this.options.onClickClose === !1 && (P = !1), P && this.close();
2628
+ let N = !0;
2629
+ typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (N = !1) : this.options.onClickClose === !1 && (N = !1), N && this.close();
2630
2630
  }), y.appendChild(O);
2631
2631
  }
2632
- s.append(l, y), !e && this.options.draggable && (s.style.cursor = "move", s.style.userSelect = "none", s.addEventListener("pointerdown", this.onDragStart.bind(this)));
2632
+ s.append(c, y), !e && this.options.draggable && (s.style.cursor = "move", s.style.userSelect = "none", s.addEventListener("pointerdown", this.onDragStart.bind(this)));
2633
2633
  const v = Z("div", { className: "ipe-modal-modal__content" }), S = Z("div", { className: "ipe-modal-modal__footer" }), w = Z("div", {
2634
2634
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--left"
2635
- }), N = Z("div", {
2635
+ }), P = Z("div", {
2636
2636
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--right"
2637
2637
  });
2638
- return S.append(w, N), i.append(s, v, S), n.appendChild(i), this.$backdrop = t, this.$modal = n, this.$window = i, this.$header = s, this.$title = l, this.$icons = y, this.$content = v, this.$footer = S, this.$buttonsLeft = w, this.$buttonsRight = N, 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) : S.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", (O) => {
2638
+ return S.append(w, P), i.append(s, v, S), n.appendChild(i), this.$backdrop = t, this.$modal = n, this.$window = i, this.$header = s, this.$title = c, this.$icons = y, this.$content = v, this.$footer = S, this.$buttonsLeft = w, this.$buttonsRight = P, 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) : S.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", (O) => {
2639
2639
  this.options.outSideClose && O.target === t && this.close();
2640
2640
  }), this.onKeyDown = this.onKeyDown.bind(this), this.emit(
2641
2641
  "modal.init"
@@ -2674,15 +2674,15 @@ class It {
2674
2674
  );
2675
2675
  const s = this.isAnimationDisabled() ? 0 : this.options.animationSpeed ?? 200;
2676
2676
  let o = !1;
2677
- const l = () => {
2677
+ const c = () => {
2678
2678
  o || (o = !0, this.destroy(), this.options.onClose?.(this));
2679
2679
  }, y = (v, S) => {
2680
2680
  const w = () => {
2681
- v.removeEventListener(S, w), l();
2681
+ v.removeEventListener(S, w), c();
2682
2682
  };
2683
2683
  v.addEventListener(S, w, { once: !0 });
2684
2684
  };
2685
- return s > 0 && this.$window ? (y(this.$window, "transitionend"), y(this.$window, "animationend"), window.setTimeout(l, s + 20)) : window.setTimeout(l, s), this;
2685
+ return s > 0 && this.$window ? (y(this.$window, "transitionend"), y(this.$window, "animationend"), window.setTimeout(c, s + 20)) : window.setTimeout(c, s), this;
2686
2686
  }
2687
2687
  this.applyAnimation(!1), this.$backdrop?.classList.remove("is-open"), this.$modal?.classList.remove("is-open"), this.emit(
2688
2688
  "modal.close"
@@ -2693,10 +2693,10 @@ class It {
2693
2693
  const n = () => {
2694
2694
  t || (t = !0, this.destroy(), this.options.onClose?.(this));
2695
2695
  }, i = (s, o) => {
2696
- const l = () => {
2697
- s.removeEventListener(o, l), n();
2696
+ const c = () => {
2697
+ s.removeEventListener(o, c), n();
2698
2698
  };
2699
- s.addEventListener(o, l, { once: !0 });
2699
+ s.addEventListener(o, c, { once: !0 });
2700
2700
  };
2701
2701
  return e > 0 && this.$window ? (i(this.$window, "transitionend"), i(this.$window, "animationend"), window.setTimeout(n, e + 20)) : window.setTimeout(n, e), this;
2702
2702
  }
@@ -2769,8 +2769,8 @@ class It {
2769
2769
  else {
2770
2770
  s.innerHTML = "";
2771
2771
  for (const o of e) {
2772
- const l = this.generateButton(o);
2773
- s.appendChild(l);
2772
+ const c = this.generateButton(o);
2773
+ s.appendChild(c);
2774
2774
  }
2775
2775
  }
2776
2776
  return this;
@@ -2799,15 +2799,19 @@ class It {
2799
2799
  /** Dynamically add button(s) into footer. Supports insertion index per side. */
2800
2800
  addButton(e, t) {
2801
2801
  this.$footer && (this.$footer.style.display = "");
2802
- const n = e.side ?? "right", i = n === "left" ? this.$buttonsLeft : this.$buttonsRight, s = n === "left" ? this.buttonElsLeft : this.buttonElsRight, o = this.generateButton(e), l = Math.max(0, Math.min(t ?? s.length, s.length));
2803
- return l >= i.children.length ? i.appendChild(o) : i.insertBefore(o, i.children[l]), s.splice(l, 0, o), this;
2802
+ const n = e.side ?? "right", i = n === "left" ? this.$buttonsLeft : this.$buttonsRight, s = n === "left" ? this.buttonElsLeft : this.buttonElsRight, o = this.generateButton(e), c = Math.max(0, Math.min(t ?? s.length, s.length));
2803
+ return c >= i.children.length ? i.appendChild(o) : i.insertBefore(o, i.children[c]), s.splice(c, 0, o), this;
2804
2804
  }
2805
2805
  /** Remove button by element / id / global index (left first, then right). */
2806
2806
  removeButton(e) {
2807
2807
  const t = this.buttonElsLeft, n = this.buttonElsRight, i = [...t, ...n];
2808
2808
  let s = null;
2809
- if (typeof e == "number" ? s = i[e] ?? null : typeof e == "string" ? s = i.find((l) => l.id === e) ?? null : e instanceof HTMLElement && (s = i.find((l) => l === e) ?? null), !s) return this;
2810
- for (const [l, y] of this.keyMap.entries()) y === s && this.keyMap.delete(l);
2809
+ if (e === "*")
2810
+ return i.forEach((c) => {
2811
+ this.keyMap.delete(c.id), c.parentElement?.removeChild(c);
2812
+ }), this.$footer && (this.$footer.style.display = "none"), this;
2813
+ if (typeof e == "number" ? s = i[e] ?? null : typeof e == "string" ? s = i.find((c) => c.id === e) ?? null : e instanceof HTMLElement && (s = i.find((c) => c === e) ?? null), !s) return this;
2814
+ for (const [c, y] of this.keyMap.entries()) y === s && this.keyMap.delete(c);
2811
2815
  let o = t.indexOf(s);
2812
2816
  return o !== -1 ? (t.splice(o, 1), s.parentElement?.removeChild(s)) : (o = n.indexOf(s), o !== -1 && (n.splice(o, 1), s.parentElement?.removeChild(s))), t.length === 0 && n.length === 0 && this.$footer && (this.$footer.style.display = "none"), this;
2813
2817
  }
@@ -2829,7 +2833,7 @@ class It {
2829
2833
  }
2830
2834
  // ------------------------------ helpers ------------------------------- //
2831
2835
  applyAnimation(e) {
2832
- const t = this.get$modal(), n = this.get$window(), i = this.$backdrop, s = this.options.modalAnimation ?? this.options.animation, o = typeof s == "string" ? s : s && (e ? s.show : s.hide), l = this.options.backdropAnimation ?? this.options.animation, y = typeof l == "string" ? l : l && (e ? l.show : l.hide);
2836
+ const t = this.get$modal(), n = this.get$window(), i = this.$backdrop, s = this.options.modalAnimation ?? this.options.animation, o = typeof s == "string" ? s : s && (e ? s.show : s.hide), c = this.options.backdropAnimation ?? this.options.animation, y = typeof c == "string" ? c : c && (e ? c.show : c.hide);
2833
2837
  !o || o === !1 ? (t.style.transition = "none", n.style.animation = "none", n.style.removeProperty("--ipe-modal-anim")) : (t.style.removeProperty("transition"), n.style.setProperty("--ipe-modal-anim", o)), i && (!y || y === !1 ? i.style.transition = "none" : i.style.removeProperty("transition"));
2834
2838
  }
2835
2839
  on(e, t) {
@@ -2869,8 +2873,8 @@ class It {
2869
2873
  if (e.key === "Tab") {
2870
2874
  const i = cr(t);
2871
2875
  if (!i.length) return;
2872
- const s = i[0], o = i[i.length - 1], l = document.activeElement;
2873
- e.shiftKey && l === s ? (e.preventDefault(), o.focus()) : !e.shiftKey && l === o && (e.preventDefault(), s.focus());
2876
+ const s = i[0], o = i[i.length - 1], c = document.activeElement;
2877
+ e.shiftKey && c === s ? (e.preventDefault(), o.focus()) : !e.shiftKey && c === o && (e.preventDefault(), s.focus());
2874
2878
  }
2875
2879
  const n = this.keyMap.get(e.key.toLowerCase());
2876
2880
  n && n.click();
@@ -2907,7 +2911,7 @@ class It {
2907
2911
  /** Show as toast (no backdrop, container stack). */
2908
2912
  showToast(e) {
2909
2913
  this.$window || this.init();
2910
- const t = Bi(e.position ?? "top right"), n = this.get$window();
2914
+ const t = ji(e.position ?? "top right"), n = this.get$window();
2911
2915
  this.isToast = !0, n.style.pointerEvents = "auto", this.applyAnimation(!0), t.appendChild(n);
2912
2916
  const i = (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;
2913
2917
  return i > 0 && (this.startCloseTimer(i), s && (n.addEventListener("mouseenter", this.stopCloseTimer), n.addEventListener("mouseleave", () => this.startCloseTimer(i)))), this.isOpen = !0, this.options.onShow?.(this), we.push(this), this.emit(
@@ -2939,9 +2943,9 @@ class It {
2939
2943
  static closeAll(e, t) {
2940
2944
  const n = new Set((Array.isArray(t) ? t : t ? [t] : []).map(String)), i = new Set((Array.isArray(e) ? e : e ? [e] : []).map(String));
2941
2945
  return ee.closeAll(e, t), [...we].forEach((s) => {
2942
- const o = s.modalId, l = i.size ? i.has(s.pluginName) : !0, y = n.has(o);
2943
- l && !y && s.close();
2944
- }), ee.top() ?? new It();
2946
+ const o = s.modalId, c = i.size ? i.has(s.pluginName) : !0, y = n.has(o);
2947
+ c && !y && s.close();
2948
+ }), ee.top() ?? new Rt();
2945
2949
  }
2946
2950
  static removeAll() {
2947
2951
  ee.removeAll(), [...we].forEach((e) => e.destroy());
@@ -3097,12 +3101,12 @@ class It {
3097
3101
  }
3098
3102
  }
3099
3103
  static notify(e, t, n) {
3100
- if (t?.overrideOther && [...we].forEach((l) => l.close()), typeof t.title > "u") {
3101
- const l = e || "Notification";
3102
- t.title = l[0].toUpperCase() + l.slice(1).toLowerCase();
3104
+ if (t?.overrideOther && [...we].forEach((c) => c.close()), typeof t.title > "u") {
3105
+ const c = e || "Notification";
3106
+ t.title = c[0].toUpperCase() + c.slice(1).toLowerCase();
3103
3107
  }
3104
3108
  const i = t.icon ?? this.getDefaultNotifyIcon(e);
3105
- i && (i instanceof Element && i.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ q(Dn, { children: [
3109
+ i && (i instanceof Element && i.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ q(Cn, { children: [
3106
3110
  i,
3107
3111
  t.title
3108
3112
  ] })), t.okBtn && (t.okBtn.label ??= "OK", t.okBtn.className ??= "is-primary is-ghost ok-btn", t.okBtn.method = () => {
@@ -3133,7 +3137,7 @@ class It {
3133
3137
  }
3134
3138
  }
3135
3139
  const we = [];
3136
- function Bi(r = "top right") {
3140
+ function ji(r = "top right") {
3137
3141
  const e = "ipe-modal-toast-container", t = `${e}-${r.replace(/[\s-\.|\/]+/g, "-")}`;
3138
3142
  let n = document.getElementById(t);
3139
3143
  return n || (n = Z("div", {
@@ -3141,7 +3145,7 @@ function Bi(r = "top right") {
3141
3145
  attrs: { id: t, "data-position": r }
3142
3146
  }), document.body.appendChild(n)), n;
3143
3147
  }
3144
- class G extends It {
3148
+ class G extends Rt {
3145
3149
  constructor(e = {}) {
3146
3150
  e.className ||= "", e.className += " theme-ipe", e.modalAnimation ||= {
3147
3151
  show: "ipe-modal-fade-in",
@@ -3172,7 +3176,7 @@ class G extends It {
3172
3176
  backgroundColor: "rgba(255, 255, 255, 0.5)",
3173
3177
  zIndex: 2e3
3174
3178
  },
3175
- children: /* @__PURE__ */ q(Cn, { style: { width: "80%", maxWidth: "800px" } })
3179
+ children: /* @__PURE__ */ q(Ln, { style: { width: "80%", maxWidth: "800px" } })
3176
3180
  }
3177
3181
  )
3178
3182
  );
@@ -3185,25 +3189,54 @@ class G extends It {
3185
3189
  }
3186
3190
  }
3187
3191
  }
3188
- class ji {
3192
+ class Ui {
3189
3193
  constructor(e) {
3190
3194
  this.ctx = e, this.IPEModal = G, this.IPEModalEvent = Ot, this.show = G.show.bind(G), this.createObject = G.createObject.bind(G), this.close = G.close.bind(G), this.closeAll = G.closeAll.bind(G), this.removeAll = G.removeAll.bind(G), this.dialog = G.dialog.bind(G), this.confirm = G.confirm.bind(G), this.notify = G.notify.bind(G), e.set("modal", this);
3191
3195
  }
3192
3196
  }
3193
- var Mi = Object.create, Rt = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Ir = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), Rr = (r) => {
3197
+ const Rr = (r) => {
3198
+ if (!r)
3199
+ return new URLSearchParams();
3200
+ if (r instanceof URLSearchParams)
3201
+ return r;
3202
+ if (typeof r != "object" || r?.constructor !== Object)
3203
+ throw new TypeError("only plain object is supported");
3204
+ const e = new URLSearchParams();
3205
+ for (const [t, n] of Object.entries(r))
3206
+ if (n != null) {
3207
+ if (Array.isArray(n)) {
3208
+ for (const i of n)
3209
+ e.append(t, i?.toString());
3210
+ continue;
3211
+ }
3212
+ if (typeof n == "object" && n !== null && n.constructor === Object) {
3213
+ for (const [i, s] of Object.entries(n))
3214
+ s != null && e.set(`${t}[${i}]`, s?.toString());
3215
+ continue;
3216
+ }
3217
+ e.set(t, n?.toString());
3218
+ }
3219
+ return e;
3220
+ }, Mi = (r, e, t) => {
3221
+ const n = typeof r == "string" ? new URL(r, window?.location?.origin) : new URL(r), i = new URLSearchParams(n.search), s = Rr(e);
3222
+ for (const [o, c] of s.entries())
3223
+ i.set(o, c);
3224
+ return n.search = i.toString(), n.hash = "", n;
3225
+ };
3226
+ var Fi = Object.create, It = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Ir = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), Ar = (r) => {
3194
3227
  throw TypeError(r);
3195
- }, Fi = (r, e, t) => e in r ? Rt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, zi = (r, e) => Rt(r, "name", { value: e, configurable: !0 }), Hi = (r) => [, , , Mi(r?.[Ir("metadata")] ?? null)], qi = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ar = (r) => r !== void 0 && typeof r != "function" ? Rr("Function expected") : r, Wi = (r, e, t, n, i) => ({ kind: qi[r], name: e, metadata: n, addInitializer: (s) => t._ ? Rr("Already initialized") : i.push(Ar(s || null)) }), Ki = (r, e) => Fi(e, Ir("metadata"), r[3]), Yi = (r, e, t, n) => {
3228
+ }, Hi = (r, e, t) => e in r ? It(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, qi = (r, e) => It(r, "name", { value: e, configurable: !0 }), Wi = (r) => [, , , Fi(r?.[Ir("metadata")] ?? null)], Ki = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], $r = (r) => r !== void 0 && typeof r != "function" ? Ar("Function expected") : r, Yi = (r, e, t, n, i) => ({ kind: Ki[r], name: e, metadata: n, addInitializer: (s) => t._ ? Ar("Already initialized") : i.push($r(s || null)) }), Vi = (r, e) => Hi(e, Ir("metadata"), r[3]), Gi = (r, e, t, n) => {
3196
3229
  for (var i = 0, s = r[e >> 1], o = s && s.length; i < o; i++) s[i].call(t);
3197
3230
  return n;
3198
- }, Vi = (r, e, t, n, i, s) => {
3199
- var o, l, y, v = e & 7, S = !1, w = 0, N = r[w] || (r[w] = []), O = v && (i = i.prototype, v < 5 && (v > 3 || !S) && Ui(i, t));
3200
- zi(i, t);
3201
- for (var P = n.length - 1; P >= 0; P--)
3202
- y = Wi(v, t, l = {}, r[3], N), o = (0, n[P])(i, y), l._ = 1, Ar(o) && (i = o);
3203
- return Ki(r, i), O && Rt(i, t, O), S ? v ^ 4 ? s : O : i;
3204
- }, $r, At, Tr;
3205
- $r = [Ce(["api", "storage"])];
3206
- class Ze extends (Tr = Ue) {
3231
+ }, Xi = (r, e, t, n, i, s) => {
3232
+ var o, c, y, v = e & 7, S = !1, w = 0, P = r[w] || (r[w] = []), O = v && (i = i.prototype, v < 5 && (v > 3 || !S) && zi(i, t));
3233
+ qi(i, t);
3234
+ for (var N = n.length - 1; N >= 0; N--)
3235
+ y = Yi(v, t, c = {}, r[3], P), o = (0, n[N])(i, y), c._ = 1, $r(o) && (i = o);
3236
+ return Vi(r, i), O && It(i, t, O), S ? v ^ 4 ? s : O : i;
3237
+ }, Tr, At, Pr;
3238
+ Tr = [Ce(["api", "storage"])];
3239
+ class Ze extends (Pr = Me) {
3207
3240
  constructor(e) {
3208
3241
  super(e, "sitemeta", !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 = {
3209
3242
  meta: "siteinfo|userinfo",
@@ -3222,12 +3255,13 @@ class Ze extends (Tr = Ue) {
3222
3255
  }
3223
3256
  async start() {
3224
3257
  const e = await this.fetchFromCache();
3225
- if (e) {
3258
+ if (e)
3226
3259
  this.logger.info("Using cached metadata", e), this._data = e;
3227
- return;
3260
+ else {
3261
+ const t = await this.fetchFromApi();
3262
+ this.saveToCache(t), this._data = t;
3228
3263
  }
3229
- const t = await this.fetchFromApi();
3230
- this.saveToCache(t), this._data = t;
3264
+ this.ctx.set("getUrl", this.getUrl.bind(this)), this.ctx.set("getSciprtUrl", this.getSciprtUrl.bind(this)), this.ctx.set("getMainpageUrl", this.getMainpageUrl.bind(this));
3231
3265
  }
3232
3266
  computeSiteIdentity() {
3233
3267
  let e;
@@ -3270,7 +3304,7 @@ class Ze extends (Tr = Ue) {
3270
3304
  get _raw() {
3271
3305
  return this._data;
3272
3306
  }
3273
- get siteInfo() {
3307
+ get general() {
3274
3308
  return this._data.general;
3275
3309
  }
3276
3310
  get specialPageAliases() {
@@ -3313,7 +3347,55 @@ class Ze extends (Tr = Ue) {
3313
3347
  get userRights() {
3314
3348
  return this.userInfo.rights;
3315
3349
  }
3350
+ /**
3351
+ * Base URL, without trailing slash
3352
+ * @example "https://example.com"
3353
+ */
3354
+ get baseUrl() {
3355
+ const e = this.general.server;
3356
+ return e.startsWith("//") ? `${window?.location?.protocol || "https:"}//${e.slice(2)}` : e;
3357
+ }
3358
+ /**
3359
+ * Article path, with the $1 placeholder
3360
+ * @example "/wiki/$1"
3361
+ */
3362
+ get articlePath() {
3363
+ return this.general.articlepath;
3364
+ }
3365
+ /**
3366
+ * Script path, without trailing slash
3367
+ * @example "/w"
3368
+ */
3369
+ get scriptPath() {
3370
+ return this.general.scriptpath;
3371
+ }
3372
+ /**
3373
+ * Article base URL, with the $1 placeholder
3374
+ * @example "https://example.com/wiki/$1"
3375
+ */
3376
+ get articleBaseUrl() {
3377
+ return `${this.baseUrl}${this.articlePath}`;
3378
+ }
3379
+ /**
3380
+ * Script base URL, without trailing slash
3381
+ * @example "https://example.com/w"
3382
+ */
3383
+ get scriptBaseUrl() {
3384
+ return `${this.baseUrl}${this.scriptPath}`;
3385
+ }
3316
3386
  // utils
3387
+ getSciprtUrl(e = "index") {
3388
+ return `${this.scriptBaseUrl}/${e.replace(/\.php$/, "")}.php`;
3389
+ }
3390
+ /** Get mainpage URL */
3391
+ getMainpageUrl(e) {
3392
+ return Mi(this._data.general.base, e).toString();
3393
+ }
3394
+ getUrl(e, t) {
3395
+ const n = Rr(t);
3396
+ let i;
3397
+ return e === "" ? i = new URL(this.getSciprtUrl("index")) : typeof e == "string" ? i = new URL(`${this.articleBaseUrl.replace("$1", e)}`) : (n.set("curid", e.toString()), i = new URL(this.getSciprtUrl("index"))), i.search = n.toString(), i.toString();
3398
+ }
3317
3399
  hasRight(e) {
3318
3400
  return this.userRights.includes(e);
3319
3401
  }
@@ -3340,11 +3422,11 @@ class Ze extends (Tr = Ue) {
3340
3422
  } : null;
3341
3423
  }
3342
3424
  }
3343
- At = Hi(Tr);
3344
- Ze = Vi(At, 0, "SiteMetadataService", $r, Ze);
3345
- Yi(At, 1, Ze);
3425
+ At = Wi(Pr);
3426
+ Ze = Xi(At, 0, "SiteMetadataService", Tr, Ze);
3427
+ Gi(At, 1, Ze);
3346
3428
  var Ke = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3347
- function Gi(r) {
3429
+ function Ji(r) {
3348
3430
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
3349
3431
  }
3350
3432
  function Ye(r) {
@@ -3358,7 +3440,7 @@ var dt = { exports: {} };
3358
3440
  (c) 2013-2017 Mozilla, Apache License 2.0
3359
3441
  */
3360
3442
  var lr;
3361
- function Xi() {
3443
+ function Qi() {
3362
3444
  return lr || (lr = 1, function(r, e) {
3363
3445
  (function(t) {
3364
3446
  r.exports = t();
@@ -3369,63 +3451,63 @@ function Xi() {
3369
3451
  if (!n[v]) {
3370
3452
  var w = typeof Ye == "function" && Ye;
3371
3453
  if (!S && w) return w(v, !0);
3372
- if (l) return l(v, !0);
3373
- var N = new Error("Cannot find module '" + v + "'");
3374
- throw N.code = "MODULE_NOT_FOUND", N;
3454
+ if (c) return c(v, !0);
3455
+ var P = new Error("Cannot find module '" + v + "'");
3456
+ throw P.code = "MODULE_NOT_FOUND", P;
3375
3457
  }
3376
3458
  var O = i[v] = { exports: {} };
3377
- n[v][0].call(O.exports, function(P) {
3378
- var W = n[v][1][P];
3379
- return o(W || P);
3459
+ n[v][0].call(O.exports, function(N) {
3460
+ var W = n[v][1][N];
3461
+ return o(W || N);
3380
3462
  }, O, O.exports, t, n, i, s);
3381
3463
  }
3382
3464
  return i[v].exports;
3383
3465
  }
3384
- for (var l = typeof Ye == "function" && Ye, y = 0; y < s.length; y++) o(s[y]);
3466
+ for (var c = typeof Ye == "function" && Ye, y = 0; y < s.length; y++) o(s[y]);
3385
3467
  return o;
3386
3468
  }({ 1: [function(t, n, i) {
3387
3469
  (function(s) {
3388
- var o = s.MutationObserver || s.WebKitMutationObserver, l;
3470
+ var o = s.MutationObserver || s.WebKitMutationObserver, c;
3389
3471
  if (o) {
3390
- var y = 0, v = new o(P), S = s.document.createTextNode("");
3472
+ var y = 0, v = new o(N), S = s.document.createTextNode("");
3391
3473
  v.observe(S, {
3392
3474
  characterData: !0
3393
- }), l = function() {
3475
+ }), c = function() {
3394
3476
  S.data = y = ++y % 2;
3395
3477
  };
3396
3478
  } else if (!s.setImmediate && typeof s.MessageChannel < "u") {
3397
3479
  var w = new s.MessageChannel();
3398
- w.port1.onmessage = P, l = function() {
3480
+ w.port1.onmessage = N, c = function() {
3399
3481
  w.port2.postMessage(0);
3400
3482
  };
3401
- } else "document" in s && "onreadystatechange" in s.document.createElement("script") ? l = function() {
3483
+ } else "document" in s && "onreadystatechange" in s.document.createElement("script") ? c = function() {
3402
3484
  var H = s.document.createElement("script");
3403
3485
  H.onreadystatechange = function() {
3404
- P(), H.onreadystatechange = null, H.parentNode.removeChild(H), H = null;
3486
+ N(), H.onreadystatechange = null, H.parentNode.removeChild(H), H = null;
3405
3487
  }, s.document.documentElement.appendChild(H);
3406
- } : l = function() {
3407
- setTimeout(P, 0);
3488
+ } : c = function() {
3489
+ setTimeout(N, 0);
3408
3490
  };
3409
- var N, O = [];
3410
- function P() {
3411
- N = !0;
3412
- for (var H, M, u = O.length; u; ) {
3413
- for (M = O, O = [], H = -1; ++H < u; )
3414
- M[H]();
3491
+ var P, O = [];
3492
+ function N() {
3493
+ P = !0;
3494
+ for (var H, U, u = O.length; u; ) {
3495
+ for (U = O, O = [], H = -1; ++H < u; )
3496
+ U[H]();
3415
3497
  u = O.length;
3416
3498
  }
3417
- N = !1;
3499
+ P = !1;
3418
3500
  }
3419
3501
  n.exports = W;
3420
3502
  function W(H) {
3421
- O.push(H) === 1 && !N && l();
3503
+ O.push(H) === 1 && !P && c();
3422
3504
  }
3423
3505
  }).call(this, typeof Ke < "u" ? Ke : typeof self < "u" ? self : typeof window < "u" ? window : {});
3424
3506
  }, {}], 2: [function(t, n, i) {
3425
3507
  var s = t(1);
3426
3508
  function o() {
3427
3509
  }
3428
- var l = {}, y = ["REJECTED"], v = ["FULFILLED"], S = ["PENDING"];
3510
+ var c = {}, y = ["REJECTED"], v = ["FULFILLED"], S = ["PENDING"];
3429
3511
  n.exports = w;
3430
3512
  function w(h) {
3431
3513
  if (typeof h != "function")
@@ -3442,19 +3524,19 @@ function Xi() {
3442
3524
  var A = this.state === v ? h : _;
3443
3525
  O(E, A, this.outcome);
3444
3526
  } else
3445
- this.queue.push(new N(E, h, _));
3527
+ this.queue.push(new P(E, h, _));
3446
3528
  return E;
3447
3529
  };
3448
- function N(h, _, E) {
3530
+ function P(h, _, E) {
3449
3531
  this.promise = h, typeof _ == "function" && (this.onFulfilled = _, this.callFulfilled = this.otherCallFulfilled), typeof E == "function" && (this.onRejected = E, this.callRejected = this.otherCallRejected);
3450
3532
  }
3451
- N.prototype.callFulfilled = function(h) {
3452
- l.resolve(this.promise, h);
3453
- }, N.prototype.otherCallFulfilled = function(h) {
3533
+ P.prototype.callFulfilled = function(h) {
3534
+ c.resolve(this.promise, h);
3535
+ }, P.prototype.otherCallFulfilled = function(h) {
3454
3536
  O(this.promise, this.onFulfilled, h);
3455
- }, N.prototype.callRejected = function(h) {
3456
- l.reject(this.promise, h);
3457
- }, N.prototype.otherCallRejected = function(h) {
3537
+ }, P.prototype.callRejected = function(h) {
3538
+ c.reject(this.promise, h);
3539
+ }, P.prototype.otherCallRejected = function(h) {
3458
3540
  O(this.promise, this.onRejected, h);
3459
3541
  };
3460
3542
  function O(h, _, E) {
@@ -3463,15 +3545,15 @@ function Xi() {
3463
3545
  try {
3464
3546
  A = _(E);
3465
3547
  } catch (L) {
3466
- return l.reject(h, L);
3548
+ return c.reject(h, L);
3467
3549
  }
3468
- A === h ? l.reject(h, new TypeError("Cannot resolve promise with itself")) : l.resolve(h, A);
3550
+ A === h ? c.reject(h, new TypeError("Cannot resolve promise with itself")) : c.resolve(h, A);
3469
3551
  });
3470
3552
  }
3471
- l.resolve = function(h, _) {
3472
- var E = H(P, _);
3553
+ c.resolve = function(h, _) {
3554
+ var E = H(N, _);
3473
3555
  if (E.status === "error")
3474
- return l.reject(h, E.value);
3556
+ return c.reject(h, E.value);
3475
3557
  var A = E.value;
3476
3558
  if (A)
3477
3559
  W(h, A);
@@ -3481,13 +3563,13 @@ function Xi() {
3481
3563
  h.queue[L].callFulfilled(_);
3482
3564
  }
3483
3565
  return h;
3484
- }, l.reject = function(h, _) {
3566
+ }, c.reject = function(h, _) {
3485
3567
  h.state = y, h.outcome = _;
3486
3568
  for (var E = -1, A = h.queue.length; ++E < A; )
3487
3569
  h.queue[E].callRejected(_);
3488
3570
  return h;
3489
3571
  };
3490
- function P(h) {
3572
+ function N(h) {
3491
3573
  var _ = h && h.then;
3492
3574
  if (h && (typeof h == "object" || typeof h == "function") && typeof _ == "function")
3493
3575
  return function() {
@@ -3497,10 +3579,10 @@ function Xi() {
3497
3579
  function W(h, _) {
3498
3580
  var E = !1;
3499
3581
  function A(se) {
3500
- E || (E = !0, l.reject(h, se));
3582
+ E || (E = !0, c.reject(h, se));
3501
3583
  }
3502
3584
  function L(se) {
3503
- E || (E = !0, l.resolve(h, se));
3585
+ E || (E = !0, c.resolve(h, se));
3504
3586
  }
3505
3587
  function Q() {
3506
3588
  _(L, A);
@@ -3517,14 +3599,14 @@ function Xi() {
3517
3599
  }
3518
3600
  return E;
3519
3601
  }
3520
- w.resolve = M;
3521
- function M(h) {
3522
- return h instanceof this ? h : l.resolve(new this(o), h);
3602
+ w.resolve = U;
3603
+ function U(h) {
3604
+ return h instanceof this ? h : c.resolve(new this(o), h);
3523
3605
  }
3524
3606
  w.reject = u;
3525
3607
  function u(h) {
3526
3608
  var _ = new this(o);
3527
- return l.reject(_, h);
3609
+ return c.reject(_, h);
3528
3610
  }
3529
3611
  w.all = d;
3530
3612
  function d(h) {
@@ -3537,12 +3619,12 @@ function Xi() {
3537
3619
  for (var L = new Array(E), Q = 0, ie = -1, se = new this(o); ++ie < E; )
3538
3620
  fe(h[ie], ie);
3539
3621
  return se;
3540
- function fe(Ie, Fe) {
3541
- _.resolve(Ie).then(tt, function(Se) {
3542
- A || (A = !0, l.reject(se, Se));
3622
+ function fe(Re, Fe) {
3623
+ _.resolve(Re).then(tt, function(Se) {
3624
+ A || (A = !0, c.reject(se, Se));
3543
3625
  });
3544
3626
  function tt(Se) {
3545
- L[Fe] = Se, ++Q === E && !A && (A = !0, l.resolve(se, L));
3627
+ L[Fe] = Se, ++Q === E && !A && (A = !0, c.resolve(se, L));
3546
3628
  }
3547
3629
  }
3548
3630
  }
@@ -3559,9 +3641,9 @@ function Xi() {
3559
3641
  return Q;
3560
3642
  function ie(se) {
3561
3643
  _.resolve(se).then(function(fe) {
3562
- A || (A = !0, l.resolve(Q, fe));
3644
+ A || (A = !0, c.resolve(Q, fe));
3563
3645
  }, function(fe) {
3564
- A || (A = !0, l.reject(Q, fe));
3646
+ A || (A = !0, c.reject(Q, fe));
3565
3647
  });
3566
3648
  }
3567
3649
  }
@@ -3579,7 +3661,7 @@ function Xi() {
3579
3661
  if (!(a instanceof f))
3580
3662
  throw new TypeError("Cannot call a class as a function");
3581
3663
  }
3582
- function l() {
3664
+ function c() {
3583
3665
  try {
3584
3666
  if (typeof indexedDB < "u")
3585
3667
  return indexedDB;
@@ -3595,7 +3677,7 @@ function Xi() {
3595
3677
  return;
3596
3678
  }
3597
3679
  }
3598
- var y = l();
3680
+ var y = c();
3599
3681
  function v() {
3600
3682
  try {
3601
3683
  if (!y || !y.open)
@@ -3617,42 +3699,42 @@ function Xi() {
3617
3699
  } catch (p) {
3618
3700
  if (p.name !== "TypeError")
3619
3701
  throw p;
3620
- for (var c = typeof BlobBuilder < "u" ? BlobBuilder : typeof MSBlobBuilder < "u" ? MSBlobBuilder : typeof MozBlobBuilder < "u" ? MozBlobBuilder : WebKitBlobBuilder, m = new c(), b = 0; b < a.length; b += 1)
3702
+ for (var l = typeof BlobBuilder < "u" ? BlobBuilder : typeof MSBlobBuilder < "u" ? MSBlobBuilder : typeof MozBlobBuilder < "u" ? MozBlobBuilder : WebKitBlobBuilder, m = new l(), b = 0; b < a.length; b += 1)
3621
3703
  m.append(a[b]);
3622
3704
  return m.getBlob(f.type);
3623
3705
  }
3624
3706
  }
3625
3707
  typeof Promise > "u" && t(3);
3626
3708
  var w = Promise;
3627
- function N(a, f) {
3628
- f && a.then(function(c) {
3629
- f(null, c);
3630
- }, function(c) {
3631
- f(c);
3709
+ function P(a, f) {
3710
+ f && a.then(function(l) {
3711
+ f(null, l);
3712
+ }, function(l) {
3713
+ f(l);
3632
3714
  });
3633
3715
  }
3634
- function O(a, f, c) {
3635
- typeof f == "function" && a.then(f), typeof c == "function" && a.catch(c);
3716
+ function O(a, f, l) {
3717
+ typeof f == "function" && a.then(f), typeof l == "function" && a.catch(l);
3636
3718
  }
3637
- function P(a) {
3719
+ function N(a) {
3638
3720
  return typeof a != "string" && (a = String(a)), a;
3639
3721
  }
3640
3722
  function W() {
3641
3723
  if (arguments.length && typeof arguments[arguments.length - 1] == "function")
3642
3724
  return arguments[arguments.length - 1];
3643
3725
  }
3644
- var H = "local-forage-detect-blob-support", M = void 0, u = {}, d = Object.prototype.toString, g = "readonly", h = "readwrite";
3726
+ var H = "local-forage-detect-blob-support", U = void 0, u = {}, d = Object.prototype.toString, g = "readonly", h = "readwrite";
3645
3727
  function _(a) {
3646
- for (var f = a.length, c = new ArrayBuffer(f), m = new Uint8Array(c), b = 0; b < f; b++)
3728
+ for (var f = a.length, l = new ArrayBuffer(f), m = new Uint8Array(l), b = 0; b < f; b++)
3647
3729
  m[b] = a.charCodeAt(b);
3648
- return c;
3730
+ return l;
3649
3731
  }
3650
3732
  function E(a) {
3651
3733
  return new w(function(f) {
3652
- var c = a.transaction(H, h), m = S([""]);
3653
- c.objectStore(H).put(m, "key"), c.onabort = function(b) {
3734
+ var l = a.transaction(H, h), m = S([""]);
3735
+ l.objectStore(H).put(m, "key"), l.onabort = function(b) {
3654
3736
  b.preventDefault(), b.stopPropagation(), f(!1);
3655
- }, c.oncomplete = function() {
3737
+ }, l.oncomplete = function() {
3656
3738
  var b = navigator.userAgent.match(/Chrome\/(\d+)/), p = navigator.userAgent.match(/Edge\//);
3657
3739
  f(p || !b || parseInt(b[1], 10) >= 43);
3658
3740
  };
@@ -3661,35 +3743,35 @@ function Xi() {
3661
3743
  });
3662
3744
  }
3663
3745
  function A(a) {
3664
- return typeof M == "boolean" ? w.resolve(M) : E(a).then(function(f) {
3665
- return M = f, M;
3746
+ return typeof U == "boolean" ? w.resolve(U) : E(a).then(function(f) {
3747
+ return U = f, U;
3666
3748
  });
3667
3749
  }
3668
3750
  function L(a) {
3669
- var f = u[a.name], c = {};
3670
- c.promise = new w(function(m, b) {
3671
- c.resolve = m, c.reject = b;
3672
- }), f.deferredOperations.push(c), f.dbReady ? f.dbReady = f.dbReady.then(function() {
3673
- return c.promise;
3674
- }) : f.dbReady = c.promise;
3751
+ var f = u[a.name], l = {};
3752
+ l.promise = new w(function(m, b) {
3753
+ l.resolve = m, l.reject = b;
3754
+ }), f.deferredOperations.push(l), f.dbReady ? f.dbReady = f.dbReady.then(function() {
3755
+ return l.promise;
3756
+ }) : f.dbReady = l.promise;
3675
3757
  }
3676
3758
  function Q(a) {
3677
- var f = u[a.name], c = f.deferredOperations.pop();
3678
- if (c)
3679
- return c.resolve(), c.promise;
3759
+ var f = u[a.name], l = f.deferredOperations.pop();
3760
+ if (l)
3761
+ return l.resolve(), l.promise;
3680
3762
  }
3681
3763
  function ie(a, f) {
3682
- var c = u[a.name], m = c.deferredOperations.pop();
3764
+ var l = u[a.name], m = l.deferredOperations.pop();
3683
3765
  if (m)
3684
3766
  return m.reject(f), m.promise;
3685
3767
  }
3686
3768
  function se(a, f) {
3687
- return new w(function(c, m) {
3688
- if (u[a.name] = u[a.name] || Nt(), a.db)
3769
+ return new w(function(l, m) {
3770
+ if (u[a.name] = u[a.name] || Pt(), a.db)
3689
3771
  if (f)
3690
3772
  L(a), a.db.close();
3691
3773
  else
3692
- return c(a.db);
3774
+ return l(a.db);
3693
3775
  var b = [a.name];
3694
3776
  f && b.push(a.version);
3695
3777
  var p = y.open.apply(y, b);
@@ -3697,9 +3779,9 @@ function Xi() {
3697
3779
  var k = p.result;
3698
3780
  try {
3699
3781
  k.createObjectStore(a.storeName), x.oldVersion <= 1 && k.createObjectStore(H);
3700
- } catch (I) {
3701
- if (I.name !== "ConstraintError")
3702
- throw I;
3782
+ } catch (R) {
3783
+ if (R.name !== "ConstraintError")
3784
+ throw R;
3703
3785
  }
3704
3786
  }), p.onerror = function(x) {
3705
3787
  x.preventDefault(), m(p.error);
@@ -3707,22 +3789,22 @@ function Xi() {
3707
3789
  var x = p.result;
3708
3790
  x.onversionchange = function(k) {
3709
3791
  k.target.close();
3710
- }, c(x), Q(a);
3792
+ }, l(x), Q(a);
3711
3793
  };
3712
3794
  });
3713
3795
  }
3714
3796
  function fe(a) {
3715
3797
  return se(a, !1);
3716
3798
  }
3717
- function Ie(a) {
3799
+ function Re(a) {
3718
3800
  return se(a, !0);
3719
3801
  }
3720
3802
  function Fe(a, f) {
3721
3803
  if (!a.db)
3722
3804
  return !0;
3723
- var c = !a.db.objectStoreNames.contains(a.storeName), m = a.version < a.db.version, b = a.version > a.db.version;
3724
- if (m && (a.version, a.version = a.db.version), b || c) {
3725
- if (c) {
3805
+ var l = !a.db.objectStoreNames.contains(a.storeName), m = a.version < a.db.version, b = a.version > a.db.version;
3806
+ if (m && (a.version, a.version = a.db.version), b || l) {
3807
+ if (l) {
3726
3808
  var p = a.db.version + 1;
3727
3809
  p > a.version && (a.version = p);
3728
3810
  }
@@ -3731,9 +3813,9 @@ function Xi() {
3731
3813
  return !1;
3732
3814
  }
3733
3815
  function tt(a) {
3734
- return new w(function(f, c) {
3816
+ return new w(function(f, l) {
3735
3817
  var m = new FileReader();
3736
- m.onerror = c, m.onloadend = function(b) {
3818
+ m.onerror = l, m.onloadend = function(b) {
3737
3819
  var p = btoa(b.target.result || "");
3738
3820
  f({
3739
3821
  __local_forage_encoded_blob: !0,
@@ -3750,49 +3832,49 @@ function Xi() {
3750
3832
  function Tt(a) {
3751
3833
  return a && a.__local_forage_encoded_blob;
3752
3834
  }
3753
- function Dr(a) {
3754
- var f = this, c = f._initReady().then(function() {
3835
+ function Cr(a) {
3836
+ var f = this, l = f._initReady().then(function() {
3755
3837
  var m = u[f._dbInfo.name];
3756
3838
  if (m && m.dbReady)
3757
3839
  return m.dbReady;
3758
3840
  });
3759
- return O(c, a, a), c;
3841
+ return O(l, a, a), l;
3760
3842
  }
3761
- function Cr(a) {
3843
+ function Lr(a) {
3762
3844
  L(a);
3763
- for (var f = u[a.name], c = f.forages, m = 0; m < c.length; m++) {
3764
- var b = c[m];
3845
+ for (var f = u[a.name], l = f.forages, m = 0; m < l.length; m++) {
3846
+ var b = l[m];
3765
3847
  b._dbInfo.db && (b._dbInfo.db.close(), b._dbInfo.db = null);
3766
3848
  }
3767
3849
  return a.db = null, fe(a).then(function(p) {
3768
- return a.db = p, Fe(a) ? Ie(a) : p;
3850
+ return a.db = p, Fe(a) ? Re(a) : p;
3769
3851
  }).then(function(p) {
3770
3852
  a.db = f.db = p;
3771
- for (var x = 0; x < c.length; x++)
3772
- c[x]._dbInfo.db = p;
3853
+ for (var x = 0; x < l.length; x++)
3854
+ l[x]._dbInfo.db = p;
3773
3855
  }).catch(function(p) {
3774
3856
  throw ie(a, p), p;
3775
3857
  });
3776
3858
  }
3777
- function he(a, f, c, m) {
3859
+ function he(a, f, l, m) {
3778
3860
  m === void 0 && (m = 1);
3779
3861
  try {
3780
3862
  var b = a.db.transaction(a.storeName, f);
3781
- c(null, b);
3863
+ l(null, b);
3782
3864
  } catch (p) {
3783
3865
  if (m > 0 && (!a.db || p.name === "InvalidStateError" || p.name === "NotFoundError"))
3784
3866
  return w.resolve().then(function() {
3785
3867
  if (!a.db || p.name === "NotFoundError" && !a.db.objectStoreNames.contains(a.storeName) && a.version <= a.db.version)
3786
- return a.db && (a.version = a.db.version + 1), Ie(a);
3868
+ return a.db && (a.version = a.db.version + 1), Re(a);
3787
3869
  }).then(function() {
3788
- return Cr(a).then(function() {
3789
- he(a, f, c, m - 1);
3870
+ return Lr(a).then(function() {
3871
+ he(a, f, l, m - 1);
3790
3872
  });
3791
- }).catch(c);
3792
- c(p);
3873
+ }).catch(l);
3874
+ l(p);
3793
3875
  }
3794
3876
  }
3795
- function Nt() {
3877
+ function Pt() {
3796
3878
  return {
3797
3879
  // Running localForages sharing a database.
3798
3880
  forages: [],
@@ -3804,51 +3886,51 @@ function Xi() {
3804
3886
  deferredOperations: []
3805
3887
  };
3806
3888
  }
3807
- function Lr(a) {
3808
- var f = this, c = {
3889
+ function Br(a) {
3890
+ var f = this, l = {
3809
3891
  db: null
3810
3892
  };
3811
3893
  if (a)
3812
3894
  for (var m in a)
3813
- c[m] = a[m];
3814
- var b = u[c.name];
3815
- b || (b = Nt(), u[c.name] = b), b.forages.push(f), f._initReady || (f._initReady = f.ready, f.ready = Dr);
3895
+ l[m] = a[m];
3896
+ var b = u[l.name];
3897
+ b || (b = Pt(), u[l.name] = b), b.forages.push(f), f._initReady || (f._initReady = f.ready, f.ready = Cr);
3816
3898
  var p = [];
3817
3899
  function x() {
3818
3900
  return w.resolve();
3819
3901
  }
3820
3902
  for (var k = 0; k < b.forages.length; k++) {
3821
- var I = b.forages[k];
3822
- I !== f && p.push(I._initReady().catch(x));
3903
+ var R = b.forages[k];
3904
+ R !== f && p.push(R._initReady().catch(x));
3823
3905
  }
3824
- var R = b.forages.slice(0);
3906
+ var I = b.forages.slice(0);
3825
3907
  return w.all(p).then(function() {
3826
- return c.db = b.db, fe(c);
3908
+ return l.db = b.db, fe(l);
3827
3909
  }).then(function($) {
3828
- return c.db = $, Fe(c, f._defaultConfig.version) ? Ie(c) : $;
3910
+ return l.db = $, Fe(l, f._defaultConfig.version) ? Re(l) : $;
3829
3911
  }).then(function($) {
3830
- c.db = b.db = $, f._dbInfo = c;
3831
- for (var D = 0; D < R.length; D++) {
3832
- var j = R[D];
3833
- j !== f && (j._dbInfo.db = c.db, j._dbInfo.version = c.version);
3912
+ l.db = b.db = $, f._dbInfo = l;
3913
+ for (var D = 0; D < I.length; D++) {
3914
+ var j = I[D];
3915
+ j !== f && (j._dbInfo.db = l.db, j._dbInfo.version = l.version);
3834
3916
  }
3835
3917
  });
3836
3918
  }
3837
- function Br(a, f) {
3838
- var c = this;
3839
- a = P(a);
3919
+ function jr(a, f) {
3920
+ var l = this;
3921
+ a = N(a);
3840
3922
  var m = new w(function(b, p) {
3841
- c.ready().then(function() {
3842
- he(c._dbInfo, g, function(x, k) {
3923
+ l.ready().then(function() {
3924
+ he(l._dbInfo, g, function(x, k) {
3843
3925
  if (x)
3844
3926
  return p(x);
3845
3927
  try {
3846
- var I = k.objectStore(c._dbInfo.storeName), R = I.get(a);
3847
- R.onsuccess = function() {
3848
- var $ = R.result;
3928
+ var R = k.objectStore(l._dbInfo.storeName), I = R.get(a);
3929
+ I.onsuccess = function() {
3930
+ var $ = I.result;
3849
3931
  $ === void 0 && ($ = null), Tt($) && ($ = Se($)), b($);
3850
- }, R.onerror = function() {
3851
- p(R.error);
3932
+ }, I.onerror = function() {
3933
+ p(I.error);
3852
3934
  };
3853
3935
  } catch ($) {
3854
3936
  p($);
@@ -3856,18 +3938,18 @@ function Xi() {
3856
3938
  });
3857
3939
  }).catch(p);
3858
3940
  });
3859
- return N(m, f), m;
3941
+ return P(m, f), m;
3860
3942
  }
3861
- function jr(a, f) {
3862
- var c = this, m = new w(function(b, p) {
3863
- c.ready().then(function() {
3864
- he(c._dbInfo, g, function(x, k) {
3943
+ function Ur(a, f) {
3944
+ var l = this, m = new w(function(b, p) {
3945
+ l.ready().then(function() {
3946
+ he(l._dbInfo, g, function(x, k) {
3865
3947
  if (x)
3866
3948
  return p(x);
3867
3949
  try {
3868
- var I = k.objectStore(c._dbInfo.storeName), R = I.openCursor(), $ = 1;
3869
- R.onsuccess = function() {
3870
- var D = R.result;
3950
+ var R = k.objectStore(l._dbInfo.storeName), I = R.openCursor(), $ = 1;
3951
+ I.onsuccess = function() {
3952
+ var D = I.result;
3871
3953
  if (D) {
3872
3954
  var j = D.value;
3873
3955
  Tt(j) && (j = Se(j));
@@ -3875,8 +3957,8 @@ function Xi() {
3875
3957
  F !== void 0 ? b(F) : D.continue();
3876
3958
  } else
3877
3959
  b();
3878
- }, R.onerror = function() {
3879
- p(R.error);
3960
+ }, I.onerror = function() {
3961
+ p(I.error);
3880
3962
  };
3881
3963
  } catch (D) {
3882
3964
  p(D);
@@ -3884,27 +3966,27 @@ function Xi() {
3884
3966
  });
3885
3967
  }).catch(p);
3886
3968
  });
3887
- return N(m, f), m;
3969
+ return P(m, f), m;
3888
3970
  }
3889
- function Mr(a, f, c) {
3971
+ function Mr(a, f, l) {
3890
3972
  var m = this;
3891
- a = P(a);
3973
+ a = N(a);
3892
3974
  var b = new w(function(p, x) {
3893
3975
  var k;
3894
3976
  m.ready().then(function() {
3895
- return k = m._dbInfo, d.call(f) === "[object Blob]" ? A(k.db).then(function(I) {
3896
- return I ? f : tt(f);
3977
+ return k = m._dbInfo, d.call(f) === "[object Blob]" ? A(k.db).then(function(R) {
3978
+ return R ? f : tt(f);
3897
3979
  }) : f;
3898
- }).then(function(I) {
3899
- he(m._dbInfo, h, function(R, $) {
3900
- if (R)
3901
- return x(R);
3980
+ }).then(function(R) {
3981
+ he(m._dbInfo, h, function(I, $) {
3982
+ if (I)
3983
+ return x(I);
3902
3984
  try {
3903
3985
  var D = $.objectStore(m._dbInfo.storeName);
3904
- I === null && (I = void 0);
3905
- var j = D.put(I, a);
3986
+ R === null && (R = void 0);
3987
+ var j = D.put(R, a);
3906
3988
  $.oncomplete = function() {
3907
- I === void 0 && (I = null), p(I);
3989
+ R === void 0 && (R = null), p(R);
3908
3990
  }, $.onabort = $.onerror = function() {
3909
3991
  var F = j.error ? j.error : j.transaction.error;
3910
3992
  x(F);
@@ -3915,24 +3997,24 @@ function Xi() {
3915
3997
  });
3916
3998
  }).catch(x);
3917
3999
  });
3918
- return N(b, c), b;
4000
+ return P(b, l), b;
3919
4001
  }
3920
- function Ur(a, f) {
3921
- var c = this;
3922
- a = P(a);
4002
+ function Fr(a, f) {
4003
+ var l = this;
4004
+ a = N(a);
3923
4005
  var m = new w(function(b, p) {
3924
- c.ready().then(function() {
3925
- he(c._dbInfo, h, function(x, k) {
4006
+ l.ready().then(function() {
4007
+ he(l._dbInfo, h, function(x, k) {
3926
4008
  if (x)
3927
4009
  return p(x);
3928
4010
  try {
3929
- var I = k.objectStore(c._dbInfo.storeName), R = I.delete(a);
4011
+ var R = k.objectStore(l._dbInfo.storeName), I = R.delete(a);
3930
4012
  k.oncomplete = function() {
3931
4013
  b();
3932
4014
  }, k.onerror = function() {
3933
- p(R.error);
4015
+ p(I.error);
3934
4016
  }, k.onabort = function() {
3935
- var $ = R.error ? R.error : R.transaction.error;
4017
+ var $ = I.error ? I.error : I.transaction.error;
3936
4018
  p($);
3937
4019
  };
3938
4020
  } catch ($) {
@@ -3941,70 +4023,70 @@ function Xi() {
3941
4023
  });
3942
4024
  }).catch(p);
3943
4025
  });
3944
- return N(m, f), m;
4026
+ return P(m, f), m;
3945
4027
  }
3946
- function Fr(a) {
3947
- var f = this, c = new w(function(m, b) {
4028
+ function zr(a) {
4029
+ var f = this, l = new w(function(m, b) {
3948
4030
  f.ready().then(function() {
3949
4031
  he(f._dbInfo, h, function(p, x) {
3950
4032
  if (p)
3951
4033
  return b(p);
3952
4034
  try {
3953
- var k = x.objectStore(f._dbInfo.storeName), I = k.clear();
4035
+ var k = x.objectStore(f._dbInfo.storeName), R = k.clear();
3954
4036
  x.oncomplete = function() {
3955
4037
  m();
3956
4038
  }, x.onabort = x.onerror = function() {
3957
- var R = I.error ? I.error : I.transaction.error;
3958
- b(R);
4039
+ var I = R.error ? R.error : R.transaction.error;
4040
+ b(I);
3959
4041
  };
3960
- } catch (R) {
3961
- b(R);
4042
+ } catch (I) {
4043
+ b(I);
3962
4044
  }
3963
4045
  });
3964
4046
  }).catch(b);
3965
4047
  });
3966
- return N(c, a), c;
4048
+ return P(l, a), l;
3967
4049
  }
3968
- function zr(a) {
3969
- var f = this, c = new w(function(m, b) {
4050
+ function Hr(a) {
4051
+ var f = this, l = new w(function(m, b) {
3970
4052
  f.ready().then(function() {
3971
4053
  he(f._dbInfo, g, function(p, x) {
3972
4054
  if (p)
3973
4055
  return b(p);
3974
4056
  try {
3975
- var k = x.objectStore(f._dbInfo.storeName), I = k.count();
3976
- I.onsuccess = function() {
3977
- m(I.result);
3978
- }, I.onerror = function() {
3979
- b(I.error);
4057
+ var k = x.objectStore(f._dbInfo.storeName), R = k.count();
4058
+ R.onsuccess = function() {
4059
+ m(R.result);
4060
+ }, R.onerror = function() {
4061
+ b(R.error);
3980
4062
  };
3981
- } catch (R) {
3982
- b(R);
4063
+ } catch (I) {
4064
+ b(I);
3983
4065
  }
3984
4066
  });
3985
4067
  }).catch(b);
3986
4068
  });
3987
- return N(c, a), c;
4069
+ return P(l, a), l;
3988
4070
  }
3989
- function Hr(a, f) {
3990
- var c = this, m = new w(function(b, p) {
4071
+ function qr(a, f) {
4072
+ var l = this, m = new w(function(b, p) {
3991
4073
  if (a < 0) {
3992
4074
  b(null);
3993
4075
  return;
3994
4076
  }
3995
- c.ready().then(function() {
3996
- he(c._dbInfo, g, function(x, k) {
4077
+ l.ready().then(function() {
4078
+ he(l._dbInfo, g, function(x, k) {
3997
4079
  if (x)
3998
4080
  return p(x);
3999
4081
  try {
4000
- var I = k.objectStore(c._dbInfo.storeName), R = !1, $ = I.openKeyCursor();
4082
+ var R = k.objectStore(l._dbInfo.storeName), I = !1, $ = R.openKeyCursor();
4001
4083
  $.onsuccess = function() {
4002
4084
  var D = $.result;
4003
4085
  if (!D) {
4004
4086
  b(null);
4005
4087
  return;
4006
4088
  }
4007
- a === 0 || R ? b(D.key) : (R = !0, D.advance(a));
4089
+ a === 0 || I ? b(D.key) : (I = !0, D.advance(a));
4008
4090
  }, $.onerror = function() {
4009
4091
  p($.error);
4010
4092
  };
@@ -4014,25 +4096,25 @@ function Xi() {
4014
4096
  });
4015
4097
  }).catch(p);
4016
4098
  });
4017
- return N(m, f), m;
4099
+ return P(m, f), m;
4018
4100
  }
4019
- function qr(a) {
4020
- var f = this, c = new w(function(m, b) {
4101
+ function Wr(a) {
4102
+ var f = this, l = new w(function(m, b) {
4021
4103
  f.ready().then(function() {
4022
4104
  he(f._dbInfo, g, function(p, x) {
4023
4105
  if (p)
4024
4106
  return b(p);
4025
4107
  try {
4026
- var k = x.objectStore(f._dbInfo.storeName), I = k.openKeyCursor(), R = [];
4027
- I.onsuccess = function() {
4028
- var $ = I.result;
4108
+ var k = x.objectStore(f._dbInfo.storeName), R = k.openKeyCursor(), I = [];
4109
+ R.onsuccess = function() {
4110
+ var $ = R.result;
4029
4111
  if (!$) {
4030
- m(R);
4112
+ m(I);
4031
4113
  return;
4032
4114
  }
4033
- R.push($.key), $.continue();
4034
- }, I.onerror = function() {
4035
- b(I.error);
4115
+ I.push($.key), $.continue();
4116
+ }, R.onerror = function() {
4117
+ b(R.error);
4036
4118
  };
4037
4119
  } catch ($) {
4038
4120
  b($);
@@ -4040,35 +4122,35 @@ function Xi() {
4040
4122
  });
4041
4123
  }).catch(b);
4042
4124
  });
4043
- return N(c, a), c;
4125
+ return P(l, a), l;
4044
4126
  }
4045
- function Wr(a, f) {
4127
+ function Kr(a, f) {
4046
4128
  f = W.apply(this, arguments);
4047
- var c = this.config();
4048
- a = typeof a != "function" && a || {}, a.name || (a.name = a.name || c.name, a.storeName = a.storeName || c.storeName);
4129
+ var l = this.config();
4130
+ a = typeof a != "function" && a || {}, a.name || (a.name = a.name || l.name, a.storeName = a.storeName || l.storeName);
4049
4131
  var m = this, b;
4050
4132
  if (!a.name)
4051
4133
  b = w.reject("Invalid arguments");
4052
4134
  else {
4053
- var p = a.name === c.name && m._dbInfo.db, x = p ? w.resolve(m._dbInfo.db) : fe(a).then(function(k) {
4054
- var I = u[a.name], R = I.forages;
4055
- I.db = k;
4056
- for (var $ = 0; $ < R.length; $++)
4057
- R[$]._dbInfo.db = k;
4135
+ var p = a.name === l.name && m._dbInfo.db, x = p ? w.resolve(m._dbInfo.db) : fe(a).then(function(k) {
4136
+ var R = u[a.name], I = R.forages;
4137
+ R.db = k;
4138
+ for (var $ = 0; $ < I.length; $++)
4139
+ I[$]._dbInfo.db = k;
4058
4140
  return k;
4059
4141
  });
4060
4142
  a.storeName ? b = x.then(function(k) {
4061
4143
  if (k.objectStoreNames.contains(a.storeName)) {
4062
- var I = k.version + 1;
4144
+ var R = k.version + 1;
4063
4145
  L(a);
4064
- var R = u[a.name], $ = R.forages;
4146
+ var I = u[a.name], $ = I.forages;
4065
4147
  k.close();
4066
4148
  for (var D = 0; D < $.length; D++) {
4067
4149
  var j = $[D];
4068
- j._dbInfo.db = null, j._dbInfo.version = I;
4150
+ j._dbInfo.db = null, j._dbInfo.version = R;
4069
4151
  }
4070
4152
  var F = new w(function(z, V) {
4071
- var K = y.open(a.name, I);
4153
+ var K = y.open(a.name, R);
4072
4154
  K.onerror = function(oe) {
4073
4155
  var Ae = K.result;
4074
4156
  Ae.close(), V(oe);
@@ -4081,7 +4163,7 @@ function Xi() {
4081
4163
  };
4082
4164
  });
4083
4165
  return F.then(function(z) {
4084
- R.db = z;
4166
+ I.db = z;
4085
4167
  for (var V = 0; V < $.length; V++) {
4086
4168
  var K = $[V];
4087
4169
  K._dbInfo.db = z, Q(K._dbInfo);
@@ -4093,10 +4175,10 @@ function Xi() {
4093
4175
  }
4094
4176
  }) : b = x.then(function(k) {
4095
4177
  L(a);
4096
- var I = u[a.name], R = I.forages;
4178
+ var R = u[a.name], I = R.forages;
4097
4179
  k.close();
4098
- for (var $ = 0; $ < R.length; $++) {
4099
- var D = R[$];
4180
+ for (var $ = 0; $ < I.length; $++) {
4181
+ var D = I[$];
4100
4182
  D._dbInfo.db = null;
4101
4183
  }
4102
4184
  var j = new w(function(F, z) {
@@ -4111,9 +4193,9 @@ function Xi() {
4111
4193
  };
4112
4194
  });
4113
4195
  return j.then(function(F) {
4114
- I.db = F;
4115
- for (var z = 0; z < R.length; z++) {
4116
- var V = R[z];
4196
+ R.db = F;
4197
+ for (var z = 0; z < I.length; z++) {
4198
+ var V = I[z];
4117
4199
  Q(V._dbInfo);
4118
4200
  }
4119
4201
  }).catch(function(F) {
@@ -4122,49 +4204,49 @@ function Xi() {
4122
4204
  });
4123
4205
  });
4124
4206
  }
4125
- return N(b, f), b;
4207
+ return P(b, f), b;
4126
4208
  }
4127
- var Kr = {
4209
+ var Yr = {
4128
4210
  _driver: "asyncStorage",
4129
- _initStorage: Lr,
4211
+ _initStorage: Br,
4130
4212
  _support: v(),
4131
- iterate: jr,
4132
- getItem: Br,
4213
+ iterate: Ur,
4214
+ getItem: jr,
4133
4215
  setItem: Mr,
4134
- removeItem: Ur,
4135
- clear: Fr,
4136
- length: zr,
4137
- key: Hr,
4138
- keys: qr,
4139
- dropInstance: Wr
4216
+ removeItem: Fr,
4217
+ clear: zr,
4218
+ length: Hr,
4219
+ key: qr,
4220
+ keys: Wr,
4221
+ dropInstance: Kr
4140
4222
  };
4141
- function Yr() {
4223
+ function Vr() {
4142
4224
  return typeof openDatabase == "function";
4143
4225
  }
4144
- var me = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Vr = "~~local_forage_type~", Pt = /^~~local_forage_type~([^~]+)~/, ze = "__lfsc__:", rt = ze.length, nt = "arbf", it = "blob", Dt = "si08", Ct = "ui08", Lt = "uic8", Bt = "si16", jt = "si32", Mt = "ur16", Ut = "ui32", Ft = "fl32", zt = "fl64", Ht = rt + nt.length, qt = Object.prototype.toString;
4226
+ var me = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Gr = "~~local_forage_type~", Nt = /^~~local_forage_type~([^~]+)~/, ze = "__lfsc__:", rt = ze.length, nt = "arbf", it = "blob", Dt = "si08", Ct = "ui08", Lt = "uic8", Bt = "si16", jt = "si32", Ut = "ur16", Mt = "ui32", Ft = "fl32", zt = "fl64", Ht = rt + nt.length, qt = Object.prototype.toString;
4145
4227
  function Wt(a) {
4146
- var f = a.length * 0.75, c = a.length, m, b = 0, p, x, k, I;
4228
+ var f = a.length * 0.75, l = a.length, m, b = 0, p, x, k, R;
4147
4229
  a[a.length - 1] === "=" && (f--, a[a.length - 2] === "=" && f--);
4148
- var R = new ArrayBuffer(f), $ = new Uint8Array(R);
4149
- for (m = 0; m < c; m += 4)
4150
- p = me.indexOf(a[m]), x = me.indexOf(a[m + 1]), k = me.indexOf(a[m + 2]), I = me.indexOf(a[m + 3]), $[b++] = p << 2 | x >> 4, $[b++] = (x & 15) << 4 | k >> 2, $[b++] = (k & 3) << 6 | I & 63;
4151
- return R;
4230
+ var I = new ArrayBuffer(f), $ = new Uint8Array(I);
4231
+ for (m = 0; m < l; m += 4)
4232
+ p = me.indexOf(a[m]), x = me.indexOf(a[m + 1]), k = me.indexOf(a[m + 2]), R = me.indexOf(a[m + 3]), $[b++] = p << 2 | x >> 4, $[b++] = (x & 15) << 4 | k >> 2, $[b++] = (k & 3) << 6 | R & 63;
4233
+ return I;
4152
4234
  }
4153
4235
  function st(a) {
4154
- var f = new Uint8Array(a), c = "", m;
4236
+ var f = new Uint8Array(a), l = "", m;
4155
4237
  for (m = 0; m < f.length; m += 3)
4156
- c += me[f[m] >> 2], c += me[(f[m] & 3) << 4 | f[m + 1] >> 4], c += me[(f[m + 1] & 15) << 2 | f[m + 2] >> 6], c += me[f[m + 2] & 63];
4157
- return f.length % 3 === 2 ? c = c.substring(0, c.length - 1) + "=" : f.length % 3 === 1 && (c = c.substring(0, c.length - 2) + "=="), c;
4238
+ l += me[f[m] >> 2], l += me[(f[m] & 3) << 4 | f[m + 1] >> 4], l += me[(f[m + 1] & 15) << 2 | f[m + 2] >> 6], l += me[f[m + 2] & 63];
4239
+ return f.length % 3 === 2 ? l = l.substring(0, l.length - 1) + "=" : f.length % 3 === 1 && (l = l.substring(0, l.length - 2) + "=="), l;
4158
4240
  }
4159
- function Gr(a, f) {
4160
- var c = "";
4161
- if (a && (c = qt.call(a)), a && (c === "[object ArrayBuffer]" || a.buffer && qt.call(a.buffer) === "[object ArrayBuffer]")) {
4241
+ function Xr(a, f) {
4242
+ var l = "";
4243
+ if (a && (l = qt.call(a)), a && (l === "[object ArrayBuffer]" || a.buffer && qt.call(a.buffer) === "[object ArrayBuffer]")) {
4162
4244
  var m, b = ze;
4163
- a instanceof ArrayBuffer ? (m = a, b += nt) : (m = a.buffer, c === "[object Int8Array]" ? b += Dt : c === "[object Uint8Array]" ? b += Ct : c === "[object Uint8ClampedArray]" ? b += Lt : c === "[object Int16Array]" ? b += Bt : c === "[object Uint16Array]" ? b += Mt : c === "[object Int32Array]" ? b += jt : c === "[object Uint32Array]" ? b += Ut : c === "[object Float32Array]" ? b += Ft : c === "[object Float64Array]" ? b += zt : f(new Error("Failed to get type for BinaryArray"))), f(b + st(m));
4164
- } else if (c === "[object Blob]") {
4245
+ a instanceof ArrayBuffer ? (m = a, b += nt) : (m = a.buffer, l === "[object Int8Array]" ? b += Dt : l === "[object Uint8Array]" ? b += Ct : l === "[object Uint8ClampedArray]" ? b += Lt : l === "[object Int16Array]" ? b += Bt : l === "[object Uint16Array]" ? b += Ut : l === "[object Int32Array]" ? b += jt : l === "[object Uint32Array]" ? b += Mt : l === "[object Float32Array]" ? b += Ft : l === "[object Float64Array]" ? b += zt : f(new Error("Failed to get type for BinaryArray"))), f(b + st(m));
4246
+ } else if (l === "[object Blob]") {
4165
4247
  var p = new FileReader();
4166
4248
  p.onload = function() {
4167
- var x = Vr + a.type + "~" + st(this.result);
4249
+ var x = Gr + a.type + "~" + st(this.result);
4168
4250
  f(ze + it + x);
4169
4251
  }, p.readAsArrayBuffer(a);
4170
4252
  } else
@@ -4174,16 +4256,16 @@ function Xi() {
4174
4256
  f(null, x);
4175
4257
  }
4176
4258
  }
4177
- function Xr(a) {
4259
+ function Jr(a) {
4178
4260
  if (a.substring(0, rt) !== ze)
4179
4261
  return JSON.parse(a);
4180
- var f = a.substring(Ht), c = a.substring(rt, Ht), m;
4181
- if (c === it && Pt.test(f)) {
4182
- var b = f.match(Pt);
4262
+ var f = a.substring(Ht), l = a.substring(rt, Ht), m;
4263
+ if (l === it && Nt.test(f)) {
4264
+ var b = f.match(Nt);
4183
4265
  m = b[1], f = f.substring(b[0].length);
4184
4266
  }
4185
4267
  var p = Wt(f);
4186
- switch (c) {
4268
+ switch (l) {
4187
4269
  case nt:
4188
4270
  return p;
4189
4271
  case it:
@@ -4196,86 +4278,86 @@ function Xi() {
4196
4278
  return new Uint8ClampedArray(p);
4197
4279
  case Bt:
4198
4280
  return new Int16Array(p);
4199
- case Mt:
4281
+ case Ut:
4200
4282
  return new Uint16Array(p);
4201
4283
  case jt:
4202
4284
  return new Int32Array(p);
4203
- case Ut:
4285
+ case Mt:
4204
4286
  return new Uint32Array(p);
4205
4287
  case Ft:
4206
4288
  return new Float32Array(p);
4207
4289
  case zt:
4208
4290
  return new Float64Array(p);
4209
4291
  default:
4210
- throw new Error("Unkown type: " + c);
4292
+ throw new Error("Unkown type: " + l);
4211
4293
  }
4212
4294
  }
4213
4295
  var ot = {
4214
- serialize: Gr,
4215
- deserialize: Xr,
4296
+ serialize: Xr,
4297
+ deserialize: Jr,
4216
4298
  stringToBuffer: Wt,
4217
4299
  bufferToString: st
4218
4300
  };
4219
- function Kt(a, f, c, m) {
4220
- a.executeSql("CREATE TABLE IF NOT EXISTS " + f.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], c, m);
4301
+ function Kt(a, f, l, m) {
4302
+ a.executeSql("CREATE TABLE IF NOT EXISTS " + f.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], l, m);
4221
4303
  }
4222
- function Jr(a) {
4223
- var f = this, c = {
4304
+ function Qr(a) {
4305
+ var f = this, l = {
4224
4306
  db: null
4225
4307
  };
4226
4308
  if (a)
4227
4309
  for (var m in a)
4228
- c[m] = typeof a[m] != "string" ? a[m].toString() : a[m];
4310
+ l[m] = typeof a[m] != "string" ? a[m].toString() : a[m];
4229
4311
  var b = new w(function(p, x) {
4230
4312
  try {
4231
- c.db = openDatabase(c.name, String(c.version), c.description, c.size);
4313
+ l.db = openDatabase(l.name, String(l.version), l.description, l.size);
4232
4314
  } catch (k) {
4233
4315
  return x(k);
4234
4316
  }
4235
- c.db.transaction(function(k) {
4236
- Kt(k, c, function() {
4237
- f._dbInfo = c, p();
4238
- }, function(I, R) {
4239
- x(R);
4317
+ l.db.transaction(function(k) {
4318
+ Kt(k, l, function() {
4319
+ f._dbInfo = l, p();
4320
+ }, function(R, I) {
4321
+ x(I);
4240
4322
  });
4241
4323
  }, x);
4242
4324
  });
4243
- return c.serializer = ot, b;
4325
+ return l.serializer = ot, b;
4244
4326
  }
4245
- function ge(a, f, c, m, b, p) {
4246
- a.executeSql(c, m, b, function(x, k) {
4247
- k.code === k.SYNTAX_ERR ? x.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [f.storeName], function(I, R) {
4248
- R.rows.length ? p(I, k) : Kt(I, f, function() {
4249
- I.executeSql(c, m, b, p);
4327
+ function ge(a, f, l, m, b, p) {
4328
+ a.executeSql(l, m, b, function(x, k) {
4329
+ k.code === k.SYNTAX_ERR ? x.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [f.storeName], function(R, I) {
4330
+ I.rows.length ? p(R, k) : Kt(R, f, function() {
4331
+ R.executeSql(l, m, b, p);
4250
4332
  }, p);
4251
4333
  }, p) : p(x, k);
4252
4334
  }, p);
4253
4335
  }
4254
- function Qr(a, f) {
4255
- var c = this;
4256
- a = P(a);
4336
+ function Zr(a, f) {
4337
+ var l = this;
4338
+ a = N(a);
4257
4339
  var m = new w(function(b, p) {
4258
- c.ready().then(function() {
4259
- var x = c._dbInfo;
4340
+ l.ready().then(function() {
4341
+ var x = l._dbInfo;
4260
4342
  x.db.transaction(function(k) {
4261
- ge(k, x, "SELECT * FROM " + x.storeName + " WHERE key = ? LIMIT 1", [a], function(I, R) {
4262
- var $ = R.rows.length ? R.rows.item(0).value : null;
4343
+ ge(k, x, "SELECT * FROM " + x.storeName + " WHERE key = ? LIMIT 1", [a], function(R, I) {
4344
+ var $ = I.rows.length ? I.rows.item(0).value : null;
4263
4345
  $ && ($ = x.serializer.deserialize($)), b($);
4264
- }, function(I, R) {
4265
- p(R);
4346
+ }, function(R, I) {
4347
+ p(I);
4266
4348
  });
4267
4349
  });
4268
4350
  }).catch(p);
4269
4351
  });
4270
- return N(m, f), m;
4352
+ return P(m, f), m;
4271
4353
  }
4272
- function Zr(a, f) {
4273
- var c = this, m = new w(function(b, p) {
4274
- c.ready().then(function() {
4275
- var x = c._dbInfo;
4354
+ function en(a, f) {
4355
+ var l = this, m = new w(function(b, p) {
4356
+ l.ready().then(function() {
4357
+ var x = l._dbInfo;
4276
4358
  x.db.transaction(function(k) {
4277
- ge(k, x, "SELECT * FROM " + x.storeName, [], function(I, R) {
4278
- for (var $ = R.rows, D = $.length, j = 0; j < D; j++) {
4359
+ ge(k, x, "SELECT * FROM " + x.storeName, [], function(R, I) {
4360
+ for (var $ = I.rows, D = $.length, j = 0; j < D; j++) {
4279
4361
  var F = $.item(j), z = F.value;
4280
4362
  if (z && (z = x.serializer.deserialize(z)), z = a(z, F.key, j + 1), z !== void 0) {
4281
4363
  b(z);
@@ -4283,32 +4365,32 @@ function Xi() {
4283
4365
  }
4284
4366
  }
4285
4367
  b();
4286
- }, function(I, R) {
4287
- p(R);
4368
+ }, function(R, I) {
4369
+ p(I);
4288
4370
  });
4289
4371
  });
4290
4372
  }).catch(p);
4291
4373
  });
4292
- return N(m, f), m;
4374
+ return P(m, f), m;
4293
4375
  }
4294
- function Yt(a, f, c, m) {
4376
+ function Yt(a, f, l, m) {
4295
4377
  var b = this;
4296
- a = P(a);
4378
+ a = N(a);
4297
4379
  var p = new w(function(x, k) {
4298
4380
  b.ready().then(function() {
4299
4381
  f === void 0 && (f = null);
4300
- var I = f, R = b._dbInfo;
4301
- R.serializer.serialize(f, function($, D) {
4302
- D ? k(D) : R.db.transaction(function(j) {
4303
- ge(j, R, "INSERT OR REPLACE INTO " + R.storeName + " (key, value) VALUES (?, ?)", [a, $], function() {
4304
- x(I);
4382
+ var R = f, I = b._dbInfo;
4383
+ I.serializer.serialize(f, function($, D) {
4384
+ D ? k(D) : I.db.transaction(function(j) {
4385
+ ge(j, I, "INSERT OR REPLACE INTO " + I.storeName + " (key, value) VALUES (?, ?)", [a, $], function() {
4386
+ x(R);
4305
4387
  }, function(F, z) {
4306
4388
  k(z);
4307
4389
  });
4308
4390
  }, function(j) {
4309
4391
  if (j.code === j.QUOTA_ERR) {
4310
4392
  if (m > 0) {
4311
- x(Yt.apply(b, [a, I, c, m - 1]));
4393
+ x(Yt.apply(b, [a, R, l, m - 1]));
4312
4394
  return;
4313
4395
  }
4314
4396
  k(j);
@@ -4317,94 +4399,94 @@ function Xi() {
4317
4399
  });
4318
4400
  }).catch(k);
4319
4401
  });
4320
- return N(p, c), p;
4402
+ return P(p, l), p;
4321
4403
  }
4322
- function en(a, f, c) {
4323
- return Yt.apply(this, [a, f, c, 1]);
4404
+ function tn(a, f, l) {
4405
+ return Yt.apply(this, [a, f, l, 1]);
4324
4406
  }
4325
- function tn(a, f) {
4326
- var c = this;
4327
- a = P(a);
4407
+ function rn(a, f) {
4408
+ var l = this;
4409
+ a = N(a);
4328
4410
  var m = new w(function(b, p) {
4329
- c.ready().then(function() {
4330
- var x = c._dbInfo;
4411
+ l.ready().then(function() {
4412
+ var x = l._dbInfo;
4331
4413
  x.db.transaction(function(k) {
4332
4414
  ge(k, x, "DELETE FROM " + x.storeName + " WHERE key = ?", [a], function() {
4333
4415
  b();
4334
- }, function(I, R) {
4335
- p(R);
4416
+ }, function(R, I) {
4417
+ p(I);
4336
4418
  });
4337
4419
  });
4338
4420
  }).catch(p);
4339
4421
  });
4340
- return N(m, f), m;
4422
+ return P(m, f), m;
4341
4423
  }
4342
- function rn(a) {
4343
- var f = this, c = new w(function(m, b) {
4424
+ function nn(a) {
4425
+ var f = this, l = new w(function(m, b) {
4344
4426
  f.ready().then(function() {
4345
4427
  var p = f._dbInfo;
4346
4428
  p.db.transaction(function(x) {
4347
4429
  ge(x, p, "DELETE FROM " + p.storeName, [], function() {
4348
4430
  m();
4349
- }, function(k, I) {
4350
- b(I);
4431
+ }, function(k, R) {
4432
+ b(R);
4351
4433
  });
4352
4434
  });
4353
4435
  }).catch(b);
4354
4436
  });
4355
- return N(c, a), c;
4437
+ return P(l, a), l;
4356
4438
  }
4357
- function nn(a) {
4358
- var f = this, c = new w(function(m, b) {
4439
+ function sn(a) {
4440
+ var f = this, l = new w(function(m, b) {
4359
4441
  f.ready().then(function() {
4360
4442
  var p = f._dbInfo;
4361
4443
  p.db.transaction(function(x) {
4362
- ge(x, p, "SELECT COUNT(key) as c FROM " + p.storeName, [], function(k, I) {
4363
- var R = I.rows.item(0).c;
4364
- m(R);
4365
- }, function(k, I) {
4366
- b(I);
4444
+ ge(x, p, "SELECT COUNT(key) as c FROM " + p.storeName, [], function(k, R) {
4445
+ var I = R.rows.item(0).c;
4446
+ m(I);
4447
+ }, function(k, R) {
4448
+ b(R);
4367
4449
  });
4368
4450
  });
4369
4451
  }).catch(b);
4370
4452
  });
4371
- return N(c, a), c;
4453
+ return P(l, a), l;
4372
4454
  }
4373
- function sn(a, f) {
4374
- var c = this, m = new w(function(b, p) {
4375
- c.ready().then(function() {
4376
- var x = c._dbInfo;
4455
+ function on(a, f) {
4456
+ var l = this, m = new w(function(b, p) {
4457
+ l.ready().then(function() {
4458
+ var x = l._dbInfo;
4377
4459
  x.db.transaction(function(k) {
4378
- ge(k, x, "SELECT key FROM " + x.storeName + " WHERE id = ? LIMIT 1", [a + 1], function(I, R) {
4379
- var $ = R.rows.length ? R.rows.item(0).key : null;
4460
+ ge(k, x, "SELECT key FROM " + x.storeName + " WHERE id = ? LIMIT 1", [a + 1], function(R, I) {
4461
+ var $ = I.rows.length ? I.rows.item(0).key : null;
4380
4462
  b($);
4381
- }, function(I, R) {
4382
- p(R);
4463
+ }, function(R, I) {
4464
+ p(I);
4383
4465
  });
4384
4466
  });
4385
4467
  }).catch(p);
4386
4468
  });
4387
- return N(m, f), m;
4469
+ return P(m, f), m;
4388
4470
  }
4389
- function on(a) {
4390
- var f = this, c = new w(function(m, b) {
4471
+ function an(a) {
4472
+ var f = this, l = new w(function(m, b) {
4391
4473
  f.ready().then(function() {
4392
4474
  var p = f._dbInfo;
4393
4475
  p.db.transaction(function(x) {
4394
- ge(x, p, "SELECT key FROM " + p.storeName, [], function(k, I) {
4395
- for (var R = [], $ = 0; $ < I.rows.length; $++)
4396
- R.push(I.rows.item($).key);
4397
- m(R);
4398
- }, function(k, I) {
4399
- b(I);
4476
+ ge(x, p, "SELECT key FROM " + p.storeName, [], function(k, R) {
4477
+ for (var I = [], $ = 0; $ < R.rows.length; $++)
4478
+ I.push(R.rows.item($).key);
4479
+ m(I);
4480
+ }, function(k, R) {
4481
+ b(R);
4400
4482
  });
4401
4483
  });
4402
4484
  }).catch(b);
4403
4485
  });
4404
- return N(c, a), c;
4486
+ return P(l, a), l;
4405
4487
  }
4406
- function an(a) {
4407
- return new w(function(f, c) {
4488
+ function cn(a) {
4489
+ return new w(function(f, l) {
4408
4490
  a.transaction(function(m) {
4409
4491
  m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(b, p) {
4410
4492
  for (var x = [], k = 0; k < p.rows.length; k++)
@@ -4414,30 +4496,30 @@ function Xi() {
4414
4496
  storeNames: x
4415
4497
  });
4416
4498
  }, function(b, p) {
4417
- c(p);
4499
+ l(p);
4418
4500
  });
4419
4501
  }, function(m) {
4420
- c(m);
4502
+ l(m);
4421
4503
  });
4422
4504
  });
4423
4505
  }
4424
- function cn(a, f) {
4506
+ function ln(a, f) {
4425
4507
  f = W.apply(this, arguments);
4426
- var c = this.config();
4427
- a = typeof a != "function" && a || {}, a.name || (a.name = a.name || c.name, a.storeName = a.storeName || c.storeName);
4508
+ var l = this.config();
4509
+ a = typeof a != "function" && a || {}, a.name || (a.name = a.name || l.name, a.storeName = a.storeName || l.storeName);
4428
4510
  var m = this, b;
4429
4511
  return a.name ? b = new w(function(p) {
4430
4512
  var x;
4431
- a.name === c.name ? x = m._dbInfo.db : x = openDatabase(a.name, "", "", 0), a.storeName ? p({
4513
+ a.name === l.name ? x = m._dbInfo.db : x = openDatabase(a.name, "", "", 0), a.storeName ? p({
4432
4514
  db: x,
4433
4515
  storeNames: [a.storeName]
4434
- }) : p(an(x));
4516
+ }) : p(cn(x));
4435
4517
  }).then(function(p) {
4436
4518
  return new w(function(x, k) {
4437
- p.db.transaction(function(I) {
4438
- function R(F) {
4519
+ p.db.transaction(function(R) {
4520
+ function I(F) {
4439
4521
  return new w(function(z, V) {
4440
- I.executeSql("DROP TABLE IF EXISTS " + F, [], function() {
4522
+ R.executeSql("DROP TABLE IF EXISTS " + F, [], function() {
4441
4523
  z();
4442
4524
  }, function(K, oe) {
4443
4525
  V(oe);
@@ -4445,33 +4527,33 @@ function Xi() {
4445
4527
  });
4446
4528
  }
4447
4529
  for (var $ = [], D = 0, j = p.storeNames.length; D < j; D++)
4448
- $.push(R(p.storeNames[D]));
4530
+ $.push(I(p.storeNames[D]));
4449
4531
  w.all($).then(function() {
4450
4532
  x();
4451
4533
  }).catch(function(F) {
4452
4534
  k(F);
4453
4535
  });
4454
- }, function(I) {
4455
- k(I);
4536
+ }, function(R) {
4537
+ k(R);
4456
4538
  });
4457
4539
  });
4458
- }) : b = w.reject("Invalid arguments"), N(b, f), b;
4540
+ }) : b = w.reject("Invalid arguments"), P(b, f), b;
4459
4541
  }
4460
- var ln = {
4542
+ var un = {
4461
4543
  _driver: "webSQLStorage",
4462
- _initStorage: Jr,
4463
- _support: Yr(),
4464
- iterate: Zr,
4465
- getItem: Qr,
4466
- setItem: en,
4467
- removeItem: tn,
4468
- clear: rn,
4469
- length: nn,
4470
- key: sn,
4471
- keys: on,
4472
- dropInstance: cn
4544
+ _initStorage: Qr,
4545
+ _support: Vr(),
4546
+ iterate: en,
4547
+ getItem: Zr,
4548
+ setItem: tn,
4549
+ removeItem: rn,
4550
+ clear: nn,
4551
+ length: sn,
4552
+ key: on,
4553
+ keys: an,
4554
+ dropInstance: ln
4473
4555
  };
4474
- function un() {
4556
+ function fn() {
4475
4557
  try {
4476
4558
  return typeof localStorage < "u" && "setItem" in localStorage && // in IE8 typeof localStorage.setItem === 'object'
4477
4559
  !!localStorage.setItem;
@@ -4480,10 +4562,10 @@ function Xi() {
4480
4562
  }
4481
4563
  }
4482
4564
  function Vt(a, f) {
4483
- var c = a.name + "/";
4484
- return a.storeName !== f.storeName && (c += a.storeName + "/"), c;
4565
+ var l = a.name + "/";
4566
+ return a.storeName !== f.storeName && (l += a.storeName + "/"), l;
4485
4567
  }
4486
- function fn() {
4568
+ function hn() {
4487
4569
  var a = "_localforage_support_test";
4488
4570
  try {
4489
4571
  return localStorage.setItem(a, !0), localStorage.removeItem(a), !1;
@@ -4491,50 +4573,50 @@ function Xi() {
4491
4573
  return !0;
4492
4574
  }
4493
4575
  }
4494
- function hn() {
4495
- return !fn() || localStorage.length > 0;
4576
+ function dn() {
4577
+ return !hn() || localStorage.length > 0;
4496
4578
  }
4497
- function dn(a) {
4498
- var f = this, c = {};
4579
+ function pn(a) {
4580
+ var f = this, l = {};
4499
4581
  if (a)
4500
4582
  for (var m in a)
4501
- c[m] = a[m];
4502
- return c.keyPrefix = Vt(a, f._defaultConfig), hn() ? (f._dbInfo = c, c.serializer = ot, w.resolve()) : w.reject();
4583
+ l[m] = a[m];
4584
+ return l.keyPrefix = Vt(a, f._defaultConfig), dn() ? (f._dbInfo = l, l.serializer = ot, w.resolve()) : w.reject();
4503
4585
  }
4504
- function pn(a) {
4505
- var f = this, c = f.ready().then(function() {
4586
+ function mn(a) {
4587
+ var f = this, l = f.ready().then(function() {
4506
4588
  for (var m = f._dbInfo.keyPrefix, b = localStorage.length - 1; b >= 0; b--) {
4507
4589
  var p = localStorage.key(b);
4508
4590
  p.indexOf(m) === 0 && localStorage.removeItem(p);
4509
4591
  }
4510
4592
  });
4511
- return N(c, a), c;
4593
+ return P(l, a), l;
4512
4594
  }
4513
- function mn(a, f) {
4514
- var c = this;
4515
- a = P(a);
4516
- var m = c.ready().then(function() {
4517
- var b = c._dbInfo, p = localStorage.getItem(b.keyPrefix + a);
4595
+ function gn(a, f) {
4596
+ var l = this;
4597
+ a = N(a);
4598
+ var m = l.ready().then(function() {
4599
+ var b = l._dbInfo, p = localStorage.getItem(b.keyPrefix + a);
4518
4600
  return p && (p = b.serializer.deserialize(p)), p;
4519
4601
  });
4520
- return N(m, f), m;
4602
+ return P(m, f), m;
4521
4603
  }
4522
- function gn(a, f) {
4523
- var c = this, m = c.ready().then(function() {
4524
- for (var b = c._dbInfo, p = b.keyPrefix, x = p.length, k = localStorage.length, I = 1, R = 0; R < k; R++) {
4525
- var $ = localStorage.key(R);
4604
+ function yn(a, f) {
4605
+ var l = this, m = l.ready().then(function() {
4606
+ for (var b = l._dbInfo, p = b.keyPrefix, x = p.length, k = localStorage.length, R = 1, I = 0; I < k; I++) {
4607
+ var $ = localStorage.key(I);
4526
4608
  if ($.indexOf(p) === 0) {
4527
4609
  var D = localStorage.getItem($);
4528
- if (D && (D = b.serializer.deserialize(D)), D = a(D, $.substring(x), I++), D !== void 0)
4610
+ if (D && (D = b.serializer.deserialize(D)), D = a(D, $.substring(x), R++), D !== void 0)
4529
4611
  return D;
4530
4612
  }
4531
4613
  }
4532
4614
  });
4533
- return N(m, f), m;
4615
+ return P(m, f), m;
4534
4616
  }
4535
- function yn(a, f) {
4536
- var c = this, m = c.ready().then(function() {
4537
- var b = c._dbInfo, p;
4617
+ function bn(a, f) {
4618
+ var l = this, m = l.ready().then(function() {
4619
+ var b = l._dbInfo, p;
4538
4620
  try {
4539
4621
  p = localStorage.key(a);
4540
4622
  } catch {
@@ -4542,59 +4624,59 @@ function Xi() {
4542
4624
  }
4543
4625
  return p && (p = p.substring(b.keyPrefix.length)), p;
4544
4626
  });
4545
- return N(m, f), m;
4627
+ return P(m, f), m;
4546
4628
  }
4547
- function bn(a) {
4548
- var f = this, c = f.ready().then(function() {
4629
+ function vn(a) {
4630
+ var f = this, l = f.ready().then(function() {
4549
4631
  for (var m = f._dbInfo, b = localStorage.length, p = [], x = 0; x < b; x++) {
4550
4632
  var k = localStorage.key(x);
4551
4633
  k.indexOf(m.keyPrefix) === 0 && p.push(k.substring(m.keyPrefix.length));
4552
4634
  }
4553
4635
  return p;
4554
4636
  });
4555
- return N(c, a), c;
4637
+ return P(l, a), l;
4556
4638
  }
4557
- function vn(a) {
4558
- var f = this, c = f.keys().then(function(m) {
4639
+ function wn(a) {
4640
+ var f = this, l = f.keys().then(function(m) {
4559
4641
  return m.length;
4560
4642
  });
4561
- return N(c, a), c;
4643
+ return P(l, a), l;
4562
4644
  }
4563
- function wn(a, f) {
4564
- var c = this;
4565
- a = P(a);
4566
- var m = c.ready().then(function() {
4567
- var b = c._dbInfo;
4645
+ function _n(a, f) {
4646
+ var l = this;
4647
+ a = N(a);
4648
+ var m = l.ready().then(function() {
4649
+ var b = l._dbInfo;
4568
4650
  localStorage.removeItem(b.keyPrefix + a);
4569
4651
  });
4570
- return N(m, f), m;
4652
+ return P(m, f), m;
4571
4653
  }
4572
- function _n(a, f, c) {
4654
+ function Sn(a, f, l) {
4573
4655
  var m = this;
4574
- a = P(a);
4656
+ a = N(a);
4575
4657
  var b = m.ready().then(function() {
4576
4658
  f === void 0 && (f = null);
4577
4659
  var p = f;
4578
4660
  return new w(function(x, k) {
4579
- var I = m._dbInfo;
4580
- I.serializer.serialize(f, function(R, $) {
4661
+ var R = m._dbInfo;
4662
+ R.serializer.serialize(f, function(I, $) {
4581
4663
  if ($)
4582
4664
  k($);
4583
4665
  else
4584
4666
  try {
4585
- localStorage.setItem(I.keyPrefix + a, R), x(p);
4667
+ localStorage.setItem(R.keyPrefix + a, I), x(p);
4586
4668
  } catch (D) {
4587
4669
  (D.name === "QuotaExceededError" || D.name === "NS_ERROR_DOM_QUOTA_REACHED") && k(D), k(D);
4588
4670
  }
4589
4671
  });
4590
4672
  });
4591
4673
  });
4592
- return N(b, c), b;
4674
+ return P(b, l), b;
4593
4675
  }
4594
- function Sn(a, f) {
4676
+ function xn(a, f) {
4595
4677
  if (f = W.apply(this, arguments), a = typeof a != "function" && a || {}, !a.name) {
4596
- var c = this.config();
4597
- a.name = a.name || c.name, a.storeName = a.storeName || c.storeName;
4678
+ var l = this.config();
4679
+ a.name = a.name || l.name, a.storeName = a.storeName || l.storeName;
4598
4680
  }
4599
4681
  var m = this, b;
4600
4682
  return a.name ? b = new w(function(p) {
@@ -4604,39 +4686,39 @@ function Xi() {
4604
4686
  var k = localStorage.key(x);
4605
4687
  k.indexOf(p) === 0 && localStorage.removeItem(k);
4606
4688
  }
4607
- }) : b = w.reject("Invalid arguments"), N(b, f), b;
4689
+ }) : b = w.reject("Invalid arguments"), P(b, f), b;
4608
4690
  }
4609
- var xn = {
4691
+ var En = {
4610
4692
  _driver: "localStorageWrapper",
4611
- _initStorage: dn,
4612
- _support: un(),
4613
- iterate: gn,
4614
- getItem: mn,
4615
- setItem: _n,
4616
- removeItem: wn,
4617
- clear: pn,
4618
- length: vn,
4619
- key: yn,
4620
- keys: bn,
4621
- dropInstance: Sn
4622
- }, En = function(f, c) {
4623
- return f === c || typeof f == "number" && typeof c == "number" && isNaN(f) && isNaN(c);
4624
- }, kn = function(f, c) {
4693
+ _initStorage: pn,
4694
+ _support: fn(),
4695
+ iterate: yn,
4696
+ getItem: gn,
4697
+ setItem: Sn,
4698
+ removeItem: _n,
4699
+ clear: mn,
4700
+ length: wn,
4701
+ key: bn,
4702
+ keys: vn,
4703
+ dropInstance: xn
4704
+ }, kn = function(f, l) {
4705
+ return f === l || typeof f == "number" && typeof l == "number" && isNaN(f) && isNaN(l);
4706
+ }, On = function(f, l) {
4625
4707
  for (var m = f.length, b = 0; b < m; ) {
4626
- if (En(f[b], c))
4708
+ if (kn(f[b], l))
4627
4709
  return !0;
4628
4710
  b++;
4629
4711
  }
4630
4712
  return !1;
4631
4713
  }, Gt = Array.isArray || function(a) {
4632
4714
  return Object.prototype.toString.call(a) === "[object Array]";
4633
- }, Re = {}, Xt = {}, xe = {
4634
- INDEXEDDB: Kr,
4635
- WEBSQL: ln,
4636
- LOCALSTORAGE: xn
4637
- }, On = [xe.INDEXEDDB._driver, xe.WEBSQL._driver, xe.LOCALSTORAGE._driver], He = ["dropInstance"], at = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(He), In = {
4715
+ }, Ie = {}, Xt = {}, xe = {
4716
+ INDEXEDDB: Yr,
4717
+ WEBSQL: un,
4718
+ LOCALSTORAGE: En
4719
+ }, Rn = [xe.INDEXEDDB._driver, xe.WEBSQL._driver, xe.LOCALSTORAGE._driver], He = ["dropInstance"], at = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(He), In = {
4638
4720
  description: "",
4639
- driver: On.slice(),
4721
+ driver: Rn.slice(),
4640
4722
  name: "localforage",
4641
4723
  // Default DB size is _JUST UNDER_ 5MB, as it's the highest size
4642
4724
  // we can use without a prompt.
@@ -4644,11 +4726,11 @@ function Xi() {
4644
4726
  storeName: "keyvaluepairs",
4645
4727
  version: 1
4646
4728
  };
4647
- function Rn(a, f) {
4729
+ function An(a, f) {
4648
4730
  a[f] = function() {
4649
- var c = arguments;
4731
+ var l = arguments;
4650
4732
  return a.ready().then(function() {
4651
- return a[f].apply(a, c);
4733
+ return a[f].apply(a, l);
4652
4734
  });
4653
4735
  };
4654
4736
  }
@@ -4656,64 +4738,64 @@ function Xi() {
4656
4738
  for (var a = 1; a < arguments.length; a++) {
4657
4739
  var f = arguments[a];
4658
4740
  if (f)
4659
- for (var c in f)
4660
- f.hasOwnProperty(c) && (Gt(f[c]) ? arguments[0][c] = f[c].slice() : arguments[0][c] = f[c]);
4741
+ for (var l in f)
4742
+ f.hasOwnProperty(l) && (Gt(f[l]) ? arguments[0][l] = f[l].slice() : arguments[0][l] = f[l]);
4661
4743
  }
4662
4744
  return arguments[0];
4663
4745
  }
4664
- var An = function() {
4746
+ var $n = function() {
4665
4747
  function a(f) {
4666
4748
  o(this, a);
4667
- for (var c in xe)
4668
- if (xe.hasOwnProperty(c)) {
4669
- var m = xe[c], b = m._driver;
4670
- this[c] = b, Re[b] || this.defineDriver(m);
4749
+ for (var l in xe)
4750
+ if (xe.hasOwnProperty(l)) {
4751
+ var m = xe[l], b = m._driver;
4752
+ this[l] = b, Ie[b] || this.defineDriver(m);
4671
4753
  }
4672
4754
  this._defaultConfig = ct({}, In), this._config = ct({}, this._defaultConfig, f), this._driverSet = null, this._initDriver = null, this._ready = !1, this._dbInfo = null, this._wrapLibraryMethodsWithReady(), this.setDriver(this._config.driver).catch(function() {
4673
4755
  });
4674
4756
  }
4675
- return a.prototype.config = function(c) {
4676
- if ((typeof c > "u" ? "undefined" : s(c)) === "object") {
4757
+ return a.prototype.config = function(l) {
4758
+ if ((typeof l > "u" ? "undefined" : s(l)) === "object") {
4677
4759
  if (this._ready)
4678
4760
  return new Error("Can't call config() after localforage has been used.");
4679
- for (var m in c) {
4680
- if (m === "storeName" && (c[m] = c[m].replace(/\W/g, "_")), m === "version" && typeof c[m] != "number")
4761
+ for (var m in l) {
4762
+ if (m === "storeName" && (l[m] = l[m].replace(/\W/g, "_")), m === "version" && typeof l[m] != "number")
4681
4763
  return new Error("Database version must be a number.");
4682
- this._config[m] = c[m];
4764
+ this._config[m] = l[m];
4683
4765
  }
4684
- return "driver" in c && c.driver ? this.setDriver(this._config.driver) : !0;
4685
- } else return typeof c == "string" ? this._config[c] : this._config;
4686
- }, a.prototype.defineDriver = function(c, m, b) {
4766
+ return "driver" in l && l.driver ? this.setDriver(this._config.driver) : !0;
4767
+ } else return typeof l == "string" ? this._config[l] : this._config;
4768
+ }, a.prototype.defineDriver = function(l, m, b) {
4687
4769
  var p = new w(function(x, k) {
4688
4770
  try {
4689
- var I = c._driver, R = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
4690
- if (!c._driver) {
4691
- k(R);
4771
+ var R = l._driver, I = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
4772
+ if (!l._driver) {
4773
+ k(I);
4692
4774
  return;
4693
4775
  }
4694
4776
  for (var $ = at.concat("_initStorage"), D = 0, j = $.length; D < j; D++) {
4695
- var F = $[D], z = !kn(He, F);
4696
- if ((z || c[F]) && typeof c[F] != "function") {
4697
- k(R);
4777
+ var F = $[D], z = !On(He, F);
4778
+ if ((z || l[F]) && typeof l[F] != "function") {
4779
+ k(I);
4698
4780
  return;
4699
4781
  }
4700
4782
  }
4701
4783
  var V = function() {
4702
4784
  for (var Ae = function(Nn) {
4703
4785
  return function() {
4704
- var Pn = new Error("Method " + Nn + " is not implemented by the current driver"), Jt = w.reject(Pn);
4705
- return N(Jt, arguments[arguments.length - 1]), Jt;
4786
+ var Dn = new Error("Method " + Nn + " is not implemented by the current driver"), Jt = w.reject(Dn);
4787
+ return P(Jt, arguments[arguments.length - 1]), Jt;
4706
4788
  };
4707
- }, lt = 0, Tn = He.length; lt < Tn; lt++) {
4789
+ }, lt = 0, Pn = He.length; lt < Pn; lt++) {
4708
4790
  var ut = He[lt];
4709
- c[ut] || (c[ut] = Ae(ut));
4791
+ l[ut] || (l[ut] = Ae(ut));
4710
4792
  }
4711
4793
  };
4712
4794
  V();
4713
4795
  var K = function(Ae) {
4714
- Re[I], Re[I] = c, Xt[I] = Ae, x();
4796
+ Ie[R], Ie[R] = l, Xt[R] = Ae, x();
4715
4797
  };
4716
- "_support" in c ? c._support && typeof c._support == "function" ? c._support().then(K, k) : K(!!c._support) : K(!0);
4798
+ "_support" in l ? l._support && typeof l._support == "function" ? l._support().then(K, k) : K(!!l._support) : K(!0);
4717
4799
  } catch (oe) {
4718
4800
  k(oe);
4719
4801
  }
@@ -4721,34 +4803,34 @@ function Xi() {
4721
4803
  return O(p, m, b), p;
4722
4804
  }, a.prototype.driver = function() {
4723
4805
  return this._driver || null;
4724
- }, a.prototype.getDriver = function(c, m, b) {
4725
- var p = Re[c] ? w.resolve(Re[c]) : w.reject(new Error("Driver not found."));
4806
+ }, a.prototype.getDriver = function(l, m, b) {
4807
+ var p = Ie[l] ? w.resolve(Ie[l]) : w.reject(new Error("Driver not found."));
4726
4808
  return O(p, m, b), p;
4727
- }, a.prototype.getSerializer = function(c) {
4809
+ }, a.prototype.getSerializer = function(l) {
4728
4810
  var m = w.resolve(ot);
4729
- return O(m, c), m;
4730
- }, a.prototype.ready = function(c) {
4811
+ return O(m, l), m;
4812
+ }, a.prototype.ready = function(l) {
4731
4813
  var m = this, b = m._driverSet.then(function() {
4732
4814
  return m._ready === null && (m._ready = m._initDriver()), m._ready;
4733
4815
  });
4734
- return O(b, c, c), b;
4735
- }, a.prototype.setDriver = function(c, m, b) {
4816
+ return O(b, l, l), b;
4817
+ }, a.prototype.setDriver = function(l, m, b) {
4736
4818
  var p = this;
4737
- Gt(c) || (c = [c]);
4738
- var x = this._getSupportedDrivers(c);
4819
+ Gt(l) || (l = [l]);
4820
+ var x = this._getSupportedDrivers(l);
4739
4821
  function k() {
4740
4822
  p._config.driver = p.driver();
4741
4823
  }
4742
- function I(D) {
4824
+ function R(D) {
4743
4825
  return p._extend(D), k(), p._ready = p._initStorage(p._config), p._ready;
4744
4826
  }
4745
- function R(D) {
4827
+ function I(D) {
4746
4828
  return function() {
4747
4829
  var j = 0;
4748
4830
  function F() {
4749
4831
  for (; j < D.length; ) {
4750
4832
  var z = D[j];
4751
- return j++, p._dbInfo = null, p._ready = null, p.getDriver(z).then(I).catch(F);
4833
+ return j++, p._dbInfo = null, p._ready = null, p.getDriver(z).then(R).catch(F);
4752
4834
  }
4753
4835
  k();
4754
4836
  var V = new Error("No available storage method found.");
@@ -4763,38 +4845,38 @@ function Xi() {
4763
4845
  return this._driverSet = $.then(function() {
4764
4846
  var D = x[0];
4765
4847
  return p._dbInfo = null, p._ready = null, p.getDriver(D).then(function(j) {
4766
- p._driver = j._driver, k(), p._wrapLibraryMethodsWithReady(), p._initDriver = R(x);
4848
+ p._driver = j._driver, k(), p._wrapLibraryMethodsWithReady(), p._initDriver = I(x);
4767
4849
  });
4768
4850
  }).catch(function() {
4769
4851
  k();
4770
4852
  var D = new Error("No available storage method found.");
4771
4853
  return p._driverSet = w.reject(D), p._driverSet;
4772
4854
  }), O(this._driverSet, m, b), this._driverSet;
4773
- }, a.prototype.supports = function(c) {
4774
- return !!Xt[c];
4775
- }, a.prototype._extend = function(c) {
4776
- ct(this, c);
4777
- }, a.prototype._getSupportedDrivers = function(c) {
4778
- for (var m = [], b = 0, p = c.length; b < p; b++) {
4779
- var x = c[b];
4855
+ }, a.prototype.supports = function(l) {
4856
+ return !!Xt[l];
4857
+ }, a.prototype._extend = function(l) {
4858
+ ct(this, l);
4859
+ }, a.prototype._getSupportedDrivers = function(l) {
4860
+ for (var m = [], b = 0, p = l.length; b < p; b++) {
4861
+ var x = l[b];
4780
4862
  this.supports(x) && m.push(x);
4781
4863
  }
4782
4864
  return m;
4783
4865
  }, a.prototype._wrapLibraryMethodsWithReady = function() {
4784
- for (var c = 0, m = at.length; c < m; c++)
4785
- Rn(this, at[c]);
4786
- }, a.prototype.createInstance = function(c) {
4787
- return new a(c);
4866
+ for (var l = 0, m = at.length; l < m; l++)
4867
+ An(this, at[l]);
4868
+ }, a.prototype.createInstance = function(l) {
4869
+ return new a(l);
4788
4870
  }, a;
4789
- }(), $n = new An();
4790
- n.exports = $n;
4871
+ }(), Tn = new $n();
4872
+ n.exports = Tn;
4791
4873
  }, { 3: 3 }] }, {}, [4])(4);
4792
4874
  });
4793
4875
  }(dt)), dt.exports;
4794
4876
  }
4795
- var Ji = Xi();
4796
- const Nr = /* @__PURE__ */ Gi(Ji);
4797
- class Qi extends Ue {
4877
+ var Zi = Qi();
4878
+ const Nr = /* @__PURE__ */ Ji(Zi);
4879
+ class es extends Me {
4798
4880
  constructor(e) {
4799
4881
  super(e, "storage", !1), e.set("localforage", Nr);
4800
4882
  }
@@ -4892,8 +4974,8 @@ class Le {
4892
4974
  return await this.db.clear(), this;
4893
4975
  }
4894
4976
  }
4895
- var Pr = /* @__PURE__ */ ((r) => (r.preferences = "preferences", r.watch = "watch", r.unwatch = "unwatch", r.nochange = "nochange", r))(Pr || {});
4896
- class Pe {
4977
+ var Dr = /* @__PURE__ */ ((r) => (r.preferences = "preferences", r.watch = "watch", r.unwatch = "unwatch", r.nochange = "nochange", r))(Dr || {});
4978
+ class Ne {
4897
4979
  static {
4898
4980
  this.DEFAULT_PAGE_INFO = {
4899
4981
  pageid: 0,
@@ -4924,7 +5006,7 @@ class Pe {
4924
5006
  }
4925
5007
  constructor(e, t) {
4926
5008
  this.pageInfo = {
4927
- ...Pe.DEFAULT_PAGE_INFO,
5009
+ ...Ne.DEFAULT_PAGE_INFO,
4928
5010
  ...e
4929
5011
  }, this.api = t || new Or();
4930
5012
  }
@@ -4985,7 +5067,7 @@ class Pe {
4985
5067
  prependtext: i,
4986
5068
  appendtext: s,
4987
5069
  summary: o = "",
4988
- watchlist: l = Pr.preferences,
5070
+ watchlist: c = Dr.preferences,
4989
5071
  section: y
4990
5072
  } = e;
4991
5073
  return this.api.postWithEditToken({
@@ -4997,7 +5079,7 @@ class Pe {
4997
5079
  prependtext: i,
4998
5080
  appendtext: s,
4999
5081
  summary: o,
5000
- watchlist: l,
5082
+ watchlist: c,
5001
5083
  section: y,
5002
5084
  ...t
5003
5085
  });
@@ -5073,7 +5155,7 @@ class Pe {
5073
5155
  return this.pageInfo.images || [];
5074
5156
  }
5075
5157
  }
5076
- class Zi extends Ue {
5158
+ class ts extends Me {
5077
5159
  constructor(e) {
5078
5160
  super(e, "wikiPage", !0), this.ctx = e;
5079
5161
  }
@@ -5081,7 +5163,7 @@ class Zi extends Ue {
5081
5163
  this.inject = ["api"];
5082
5164
  }
5083
5165
  get WikiPage() {
5084
- return Pe;
5166
+ return Ne;
5085
5167
  }
5086
5168
  async createInstance(e) {
5087
5169
  const {
@@ -5104,7 +5186,7 @@ class Zi extends Ue {
5104
5186
  rvprop: "ids|timestamp|user|userid|content",
5105
5187
  ...e
5106
5188
  });
5107
- return new Pe(t, this.ctx.api);
5189
+ return new Ne(t, this.ctx.api);
5108
5190
  }
5109
5191
  async newFromTitle(e, t = !1, n) {
5110
5192
  return this.createInstance({ titles: e, converttitles: t, rvsection: n });
@@ -5116,7 +5198,7 @@ class Zi extends Ue {
5116
5198
  return this.createInstance({ revids: e, rvsection: t });
5117
5199
  }
5118
5200
  newBlankPage(e = {}) {
5119
- return new Pe(e, this.ctx.api);
5201
+ return new Ne(e, this.ctx.api);
5120
5202
  }
5121
5203
  }
5122
5204
  const ur = /* @__PURE__ */ new WeakMap(), ae = {
@@ -5138,9 +5220,9 @@ const ur = /* @__PURE__ */ new WeakMap(), ae = {
5138
5220
  e.set(s, s);
5139
5221
  const o = Oe.normalizeSpecialPageName(s);
5140
5222
  n.set(o, s);
5141
- for (const l of i.aliases) {
5142
- t.set(l, s);
5143
- const y = Oe.normalizeSpecialPageName(l);
5223
+ for (const c of i.aliases) {
5224
+ t.set(c, s);
5225
+ const y = Oe.normalizeSpecialPageName(c);
5144
5226
  n.set(y, s);
5145
5227
  }
5146
5228
  }
@@ -5165,10 +5247,10 @@ const ur = /* @__PURE__ */ new WeakMap(), ae = {
5165
5247
  buildIndex: (r) => {
5166
5248
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
5167
5249
  for (const [s, o] of Object.entries(r.namespaces)) {
5168
- const l = parseInt(s);
5169
- e.set(o.name, l), t.set(o.canonical ?? "", l);
5250
+ const c = parseInt(s);
5251
+ e.set(o.name, c), t.set(o.canonical ?? "", c);
5170
5252
  const y = ce.normalizeNamespaceText(o.name), v = ce.normalizeNamespaceText(o.canonical ?? "");
5171
- i.set(y, l), i.set(v, l);
5253
+ i.set(y, c), i.set(v, c);
5172
5254
  }
5173
5255
  for (const s of r.namespacealiases) {
5174
5256
  n.set(s.alias, s.id);
@@ -5195,14 +5277,14 @@ const ur = /* @__PURE__ */ new WeakMap(), ae = {
5195
5277
  subpages: !1
5196
5278
  })
5197
5279
  };
5198
- function es(r) {
5280
+ function rs(r) {
5199
5281
  const e = ur.get(r);
5200
5282
  if (e)
5201
5283
  return e;
5202
5284
  const t = ce.buildIndex(r), n = Oe.buildSpecialPageIndex(r);
5203
5285
  class i {
5204
- constructor(o, l) {
5205
- this.toText = this.getPrefixedText.bind(this), this.toString = this.getPrefixedDBKey.bind(this), this._title = o || "", this._ns = l ?? 0, l === void 0 && this.fixNSByTitle();
5286
+ constructor(o, c) {
5287
+ this.newTitle = i.create.bind(i), this.toText = this.getPrefixedText.bind(this), this.toString = this.getPrefixedDBKey.bind(this), this._title = o || "", this._ns = c ?? 0, c === void 0 && this.fixNSByTitle();
5206
5288
  }
5207
5289
  static {
5208
5290
  this._meta = r;
@@ -5213,6 +5295,9 @@ function es(r) {
5213
5295
  static {
5214
5296
  this._specialPageIndex = n;
5215
5297
  }
5298
+ static create(o, c) {
5299
+ return new i(o, c);
5300
+ }
5216
5301
  fixNSByTitle() {
5217
5302
  const o = this._title.indexOf(":");
5218
5303
  if (o === -1)
@@ -5221,8 +5306,8 @@ function es(r) {
5221
5306
  this._title = this._title.substring(1);
5222
5307
  return;
5223
5308
  }
5224
- const l = this._title.substring(0, o), y = this._title.substring(o + 1), v = ce.findNamespaceId(
5225
- l,
5309
+ const c = this._title.substring(0, o), y = this._title.substring(o + 1), v = ce.findNamespaceId(
5310
+ c,
5226
5311
  i._namespaceIndex
5227
5312
  );
5228
5313
  v !== null && (this._title = y, this._ns = v);
@@ -5233,12 +5318,12 @@ function es(r) {
5233
5318
  getMainDBKey() {
5234
5319
  const o = this.getNamespaceInfo();
5235
5320
  if (this._ns === -1) {
5236
- const l = Oe.findSpecialPageRealName(
5321
+ const c = Oe.findSpecialPageRealName(
5237
5322
  this._title,
5238
5323
  i._specialPageIndex
5239
5324
  );
5240
- if (l) {
5241
- const y = this._title.includes("/") ? this._title.substring(this._title.indexOf("/")) : "", v = l + y;
5325
+ if (c) {
5326
+ const y = this._title.includes("/") ? this._title.substring(this._title.indexOf("/")) : "", v = c + y;
5242
5327
  return ae.ensureCase(ae.toDBKey(v), o.case);
5243
5328
  }
5244
5329
  }
@@ -5247,12 +5332,12 @@ function es(r) {
5247
5332
  getMainText() {
5248
5333
  const o = this.getNamespaceInfo();
5249
5334
  if (this._ns === -1) {
5250
- const l = Oe.findSpecialPageRealName(
5335
+ const c = Oe.findSpecialPageRealName(
5251
5336
  this._title,
5252
5337
  i._specialPageIndex
5253
5338
  );
5254
- if (l) {
5255
- const y = this._title.includes("/") ? this._title.substring(this._title.indexOf("/")) : "", v = l + y;
5339
+ if (c) {
5340
+ const y = this._title.includes("/") ? this._title.substring(this._title.indexOf("/")) : "", v = c + y;
5256
5341
  return ae.ensureCase(ae.toNormalText(v), o.case);
5257
5342
  }
5258
5343
  }
@@ -5293,9 +5378,9 @@ function es(r) {
5293
5378
  return i._meta.namespaces[o.toString()] ? new i(this._title, o) : null;
5294
5379
  }
5295
5380
  getURL(o) {
5296
- const l = i._meta.general.articlepath, y = this.getPrefixedDBKey(), v = l.replace("$1", y), S = new URL(v, i._meta.general.base);
5297
- return o && (o instanceof URLSearchParams ? o : new URLSearchParams(o)).forEach((N, O) => {
5298
- S.searchParams.set(O, N);
5381
+ const c = i._meta.general.articlepath, y = this.getPrefixedDBKey(), v = c.replace("$1", y), S = new URL(v, i._meta.general.base);
5382
+ return o && (o instanceof URLSearchParams ? o : new URLSearchParams(o)).forEach((P, O) => {
5383
+ S.searchParams.set(O, P);
5299
5384
  }), S;
5300
5385
  }
5301
5386
  /**
@@ -5309,8 +5394,8 @@ function es(r) {
5309
5394
  return this._title = o, this;
5310
5395
  }
5311
5396
  setNamespaceText(o) {
5312
- const l = ce.findNamespaceId(o, i._namespaceIndex);
5313
- return l !== null && (this._ns = l), this;
5397
+ const c = ce.findNamespaceId(o, i._namespaceIndex);
5398
+ return c !== null && (this._ns = c), this;
5314
5399
  }
5315
5400
  setNamespaceId(o) {
5316
5401
  return this._ns = o, this;
@@ -5321,15 +5406,15 @@ function es(r) {
5321
5406
  isSpecial(o) {
5322
5407
  if (this._ns !== -1)
5323
5408
  return !1;
5324
- const l = new i(o, -1);
5325
- return this.getMainRootText() === l.getMainRootText();
5409
+ const c = new i(o, -1);
5410
+ return this.getMainRootText() === c.getMainRootText();
5326
5411
  }
5327
5412
  }
5328
5413
  return ur.set(r, i), i;
5329
5414
  }
5330
- class ts extends Ue {
5415
+ class ns extends Me {
5331
5416
  constructor(e) {
5332
- super(e, "wikiTitle", !0), this.ctx = e, this.WikiTitle = es(this.ctx.sitemeta._raw);
5417
+ super(e, "wikiTitle", !0), this.ctx = e, this.WikiTitle = rs(this.ctx.sitemeta._raw);
5333
5418
  }
5334
5419
  static {
5335
5420
  this.inject = ["sitemeta"];
@@ -5353,10 +5438,10 @@ class Be extends re {
5353
5438
  constructor(e) {
5354
5439
  super({
5355
5440
  name: "InPageEdit"
5356
- }), this.version = "0.6.0", this.Endpoints = $t, this.schema = fi, this.config = {
5441
+ }), this.version = "0.7.0", this.Endpoints = $t, this.schema = hi, this.config = {
5357
5442
  ...Be.DEFAULT_CONFIG,
5358
5443
  ...e
5359
- }, this.logger = gi({
5444
+ }, this.logger = yi({
5360
5445
  name: "IPE",
5361
5446
  color: "#33aaff",
5362
5447
  level: this.config.logLevel
@@ -5364,20 +5449,25 @@ class Be extends re {
5364
5449
  }
5365
5450
  static {
5366
5451
  this.DEFAULT_CONFIG = {
5367
- baseURL: "",
5452
+ apiConfigs: {},
5368
5453
  legacyPreferences: {},
5369
- logLevel: Sr.info
5454
+ logLevel: Sr.info,
5455
+ autoloadStyles: !0
5370
5456
  };
5371
5457
  }
5372
5458
  async #e() {
5373
- this.plugin(Pi, { baseURL: this.config.baseURL }), this.plugin(Di), this.plugin(ji), this.plugin(Qi), this.plugin(Ze), this.plugin(Zi), this.plugin(ts), this.#t([
5459
+ this.plugin(Di, this.config.apiConfigs), this.plugin(Ci), this.plugin(Ui), this.plugin(es), this.plugin(Ze), this.plugin(ts), this.plugin(ns), this.#t([
5374
5460
  "api",
5375
5461
  "resourceLoader",
5376
5462
  "modal",
5377
5463
  "storage",
5378
- // 'sitemeta', // 故意未标记此服务,因为数据是异步加载的
5379
5464
  "wikiPage",
5380
- "wikiTitle"
5465
+ "wikiTitle",
5466
+ // SiteMetadataService
5467
+ "sitemeta",
5468
+ "getUrl",
5469
+ "getSciprtUrl",
5470
+ "getMainpageUrl"
5381
5471
  ]);
5382
5472
  }
5383
5473
  #t(e) {
@@ -5391,21 +5481,21 @@ class Be extends re {
5391
5481
  // TODO: 这里不应该硬编码,暂时先这样
5392
5482
  async #r() {
5393
5483
  [
5394
- import("./index-C9QOZJ8o.js").then(
5484
+ import("./index-sfkutNHj.js").then(
5395
5485
  ({ PluginInArticleLinks: t }) => t
5396
5486
  ),
5397
- import("./index-CPCQc37I.js").then(({ PluginPreferences: t }) => t),
5398
- import("./index-BHruEVsx.js").then(({ PluginQuickEdit: t }) => t),
5399
- import("./index-clwjxJi5.js").then(({ PluginQuickDelete: t }) => t),
5400
- import("./index-ClYojws9.js").then(({ PluginQuickMove: t }) => t),
5401
- import("./index-Bs5MFAHs.js").then(
5487
+ import("./index-2AEdgbUL.js").then(({ PluginPreferences: t }) => t),
5488
+ import("./index-CZnu6cRK.js").then(({ PluginQuickEdit: t }) => t),
5489
+ import("./index-BCMwmSfQ.js").then(({ PluginQuickDelete: t }) => t),
5490
+ import("./index-C0ci6Ll1.js").then(({ PluginQuickMove: t }) => t),
5491
+ import("./index-2kN4SKmT.js").then(
5402
5492
  ({ PluginQuickPreview: t }) => t
5403
5493
  ),
5404
- import("./index-5zB57uWM.js").then(({ PluginQuickDiff: t }) => t),
5405
- import("./index-BqqQgaGG.js").then(
5494
+ import("./index-1JtE4urY.js").then(({ PluginQuickDiff: t }) => t),
5495
+ import("./index-B3Bsg_nE.js").then(
5406
5496
  ({ PluginQuickRedirect: t }) => t
5407
5497
  ),
5408
- import("./index-B7Ok-t-3.js").then(({ PluginToolbox: t }) => t)
5498
+ import("./index-CheNjwas.js").then(({ PluginToolbox: t }) => t)
5409
5499
  ].forEach(async (t) => {
5410
5500
  this.plugin(await t);
5411
5501
  });
@@ -5413,7 +5503,7 @@ class Be extends re {
5413
5503
  // TODO: 应该抽象到 PluginTheme 中去,暂时先硬编码
5414
5504
  async #n() {
5415
5505
  this.inject(["resourceLoader"], (e) => {
5416
- e.resourceLoader.loadStyle(import.meta.resolve("./style.css"));
5506
+ this.config.autoloadStyles && e.resourceLoader.loadStyle(import.meta.resolve("./style.css"));
5417
5507
  });
5418
5508
  }
5419
5509
  async useScope(e) {
@@ -5423,32 +5513,32 @@ class Be extends re {
5423
5513
  }), t;
5424
5514
  }
5425
5515
  }
5426
- function rs(r) {
5516
+ function is(r) {
5427
5517
  return r.charAt(0).toLowerCase() + r.slice(1);
5428
5518
  }
5429
- function ns(r) {
5430
- return rs(r).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
5519
+ function ss(r) {
5520
+ return is(r).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
5431
5521
  }
5432
- class cs {
5522
+ class us {
5433
5523
  constructor(e, t = void 0, n) {
5434
5524
  this.ctx = e, this.disposeHandlers = [], this.name = n || this.constructor.name, this.config = t || {};
5435
5525
  const { promise: i, resolve: s, reject: o } = Promise.withResolvers();
5436
5526
  queueMicrotask(() => {
5437
5527
  try {
5438
- const l = this.start();
5439
- l && typeof l.then == "function" ? l.then(() => s()).catch((y) => {
5528
+ const c = this.start();
5529
+ c && typeof c.then == "function" ? c.then(() => s()).catch((y) => {
5440
5530
  this.logger.error("Plugin start failed", y), o(y);
5441
5531
  }) : s();
5442
- } catch (l) {
5443
- this.logger.error("Plugin start threw synchronously", l), o(l);
5532
+ } catch (c) {
5533
+ this.logger.error("Plugin start threw synchronously", c), o(c);
5444
5534
  }
5445
5535
  i.then(() => {
5446
5536
  this.logger.debug("Plugin started");
5447
- }), i.catch((l) => {
5448
- this.logger.error("Plugin start failed", l), this.ctx.scope.dispose();
5537
+ }), i.catch((c) => {
5538
+ this.logger.error("Plugin start failed", c), this.ctx.scope.dispose();
5449
5539
  });
5450
5540
  }), this.ctx.once("dispose", () => {
5451
- this.disposeHandlers.forEach((l) => l(this.ctx)), this.stop(), this.logger.info("Plugin disposed");
5541
+ this.disposeHandlers.forEach((c) => c(this.ctx)), this.stop(), this.logger.info("Plugin disposed");
5452
5542
  });
5453
5543
  }
5454
5544
  #e;
@@ -5469,7 +5559,7 @@ class cs {
5469
5559
  this.disposeHandlers = this.disposeHandlers.filter((t) => t !== e);
5470
5560
  }
5471
5561
  set name(e) {
5472
- this.#e = ns(e).toUpperCase();
5562
+ this.#e = ss(e).toUpperCase();
5473
5563
  }
5474
5564
  get name() {
5475
5565
  return this.#e;
@@ -5480,16 +5570,18 @@ class cs {
5480
5570
  }
5481
5571
  window.RLQ ||= [];
5482
5572
  window.__IPE_MODULES__ ||= [];
5483
- ss("InPageEdit#autoload", () => {
5484
- window.RLQ.push(is);
5573
+ as("InPageEdit#autoload", () => {
5574
+ window.RLQ.push(os);
5485
5575
  });
5486
- async function is() {
5576
+ async function os() {
5487
5577
  typeof window?.ipe?.stop == "function" && await window.ipe.stop();
5488
5578
  const r = window.InPageEdit || {}, e = new Be({
5489
- baseURL: window.mw?.util.wikiScript("api"),
5579
+ apiConfigs: {
5580
+ baseURL: window.mw?.util.wikiScript("api")
5581
+ },
5490
5582
  legacyPreferences: r?.myPreferences || {}
5491
5583
  });
5492
- if (window.InPageEdit = Be, window.ipe = e, window.mw.hook("InPageEdit.ready").fire(e), await e.start(), Array.isArray(window.__IPE_MODULES__)) {
5584
+ if (window.InPageEdit = Be, window.ipe = e, await e.start(), typeof window?.mw?.hook == "function" && window.mw.hook("InPageEdit.ready").fire(e), Array.isArray(window.__IPE_MODULES__)) {
5493
5585
  const t = [];
5494
5586
  for (; window.__IPE_MODULES__.length; )
5495
5587
  try {
@@ -5515,19 +5607,20 @@ async function is() {
5515
5607
  /____/ v` + e.version
5516
5608
  );
5517
5609
  }
5518
- function ss(r, e) {
5610
+ function as(r, e) {
5519
5611
  const t = Symbol.for(r);
5520
5612
  return window[t] ? !1 : (window[t] = !0, e(), !0);
5521
5613
  }
5522
5614
  export {
5523
5615
  Sr as $,
5524
- cs as B,
5616
+ us as B,
5525
5617
  Ce as I,
5526
- fi as S,
5527
- Pr as W,
5618
+ hi as S,
5619
+ Dr as W,
5528
5620
  Be as a,
5529
- Ue as b,
5530
- gi as c,
5531
- di as m
5621
+ Me as b,
5622
+ pi as c,
5623
+ yi as d,
5624
+ Mi as m
5532
5625
  };
5533
- //# sourceMappingURL=index-BnRuHI16.js.map
5626
+ //# sourceMappingURL=index-DqfQ7hp6.js.map