@inpageedit/core 0.13.0 → 0.14.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 (74) hide show
  1. package/LICENSE +20 -20
  2. package/dist/{BasePlugin-Bf2UuIHF.js → BasePlugin-CU8beLYu.js} +17 -26
  3. package/dist/BasePlugin-CU8beLYu.js.map +1 -0
  4. package/dist/IconQuickEdit-CMCQncyj.js.map +1 -1
  5. package/dist/InputBox-nQKtiWtZ.js.map +1 -1
  6. package/dist/{PluginPrefSync-Dn1Xsiqz.js → PluginPrefSync-B-gPsC2n.js} +124 -128
  7. package/dist/PluginPrefSync-B-gPsC2n.js.map +1 -0
  8. package/dist/PluginStoreApp-CDteVCBG.js +453 -0
  9. package/dist/PluginStoreApp-CDteVCBG.js.map +1 -0
  10. package/dist/{endpoints-DgyuoRZd.js → Preferences-85Q9FAmb.js} +589 -565
  11. package/dist/Preferences-85Q9FAmb.js.map +1 -0
  12. package/dist/WatchlistAction-BbNAyryN.js.map +1 -1
  13. package/dist/components/index.js.map +1 -1
  14. package/dist/{index-BuYNq7f3.js → index-19CgGBI0.js} +1419 -921
  15. package/dist/index-19CgGBI0.js.map +1 -0
  16. package/dist/{index-B7c6jL9x.js → index-BKIf3i0I.js} +146 -137
  17. package/dist/index-BKIf3i0I.js.map +1 -0
  18. package/dist/{index-CCRMmnwk.js → index-BrtFJ-M0.js} +67 -66
  19. package/dist/index-BrtFJ-M0.js.map +1 -0
  20. package/dist/index-CG38LlAh.js.map +1 -1
  21. package/dist/index-CM_6yF2v.js.map +1 -1
  22. package/dist/index-CQr1DJ8n.js +173 -0
  23. package/dist/index-CQr1DJ8n.js.map +1 -0
  24. package/dist/{index-BQ-cHWkJ.js → index-CVTBg5O9.js} +66 -48
  25. package/dist/index-CVTBg5O9.js.map +1 -0
  26. package/dist/index-Ci82vLXg.js +179 -0
  27. package/dist/index-Ci82vLXg.js.map +1 -0
  28. package/dist/{index-BwdWyHLe.js → index-D3iZhRMJ.js} +93 -93
  29. package/dist/index-D3iZhRMJ.js.map +1 -0
  30. package/dist/index-DD5CVCfD.js.map +1 -1
  31. package/dist/{index-BJ7_Q1mB.js → index-DGtq21uW.js} +17 -16
  32. package/dist/index-DGtq21uW.js.map +1 -0
  33. package/dist/index-DXL7teb0.js +394 -0
  34. package/dist/index-DXL7teb0.js.map +1 -0
  35. package/dist/index-DjPpAyfE.js +116 -0
  36. package/dist/index-DjPpAyfE.js.map +1 -0
  37. package/dist/{index-eSlbrNqF.js → index-rpiO9fpc.js} +4 -5
  38. package/dist/{index-eSlbrNqF.js.map → index-rpiO9fpc.js.map} +1 -1
  39. package/dist/index.d.ts +327 -26
  40. package/dist/index.js +32 -26
  41. package/dist/index.js.map +1 -1
  42. package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
  43. package/dist/models/index.js +174 -154
  44. package/dist/models/index.js.map +1 -1
  45. package/dist/noop-ClDc6zv4.js.map +1 -1
  46. package/dist/plugins/index.js +10 -10
  47. package/dist/services/index.js +1 -1
  48. package/dist/style.css +1 -1
  49. package/dist/vueHooks-l04s8cIl.js.map +1 -1
  50. package/lib/index.umd.js +20 -12
  51. package/lib/index.umd.js.map +1 -1
  52. package/lib/style.css +1 -1
  53. package/package.json +4 -4
  54. package/dist/BasePlugin-Bf2UuIHF.js.map +0 -1
  55. package/dist/PluginPrefSync-Dn1Xsiqz.js.map +0 -1
  56. package/dist/PluginStoreApp-CpOLArL7.js +0 -452
  57. package/dist/PluginStoreApp-CpOLArL7.js.map +0 -1
  58. package/dist/Preferences-DS4-CFWe.js +0 -9
  59. package/dist/Preferences-DS4-CFWe.js.map +0 -1
  60. package/dist/endpoints-DgyuoRZd.js.map +0 -1
  61. package/dist/index-2RfILgXm.js +0 -180
  62. package/dist/index-2RfILgXm.js.map +0 -1
  63. package/dist/index-B7c6jL9x.js.map +0 -1
  64. package/dist/index-BJ7_Q1mB.js.map +0 -1
  65. package/dist/index-BNh95-x2.js +0 -115
  66. package/dist/index-BNh95-x2.js.map +0 -1
  67. package/dist/index-BQ-cHWkJ.js.map +0 -1
  68. package/dist/index-BuYNq7f3.js.map +0 -1
  69. package/dist/index-BwdWyHLe.js.map +0 -1
  70. package/dist/index-CCRMmnwk.js.map +0 -1
  71. package/dist/index-CnIpUF9x.js +0 -173
  72. package/dist/index-CnIpUF9x.js.map +0 -1
  73. package/dist/index-CyG7_IYz.js +0 -394
  74. package/dist/index-CyG7_IYz.js.map +0 -1
@@ -1,102 +1,102 @@
1
- const wt = () => {
2
- let t, e;
1
+ const xe = () => {
2
+ let e, t;
3
3
  return { promise: new Promise((n, c) => {
4
- t = n, e = c;
5
- }), resolve: t, reject: e };
4
+ e = n, t = c;
5
+ }), resolve: e, reject: t };
6
6
  };
7
- Promise.withResolvers || (Promise.withResolvers = wt);
8
- var xt = Object.defineProperty, w = (t, e) => xt(t, "name", { value: e, configurable: !0 });
9
- function vt() {
7
+ Promise.withResolvers || (Promise.withResolvers = xe);
8
+ var ve = Object.defineProperty, w = (e, t) => ve(e, "name", { value: t, configurable: !0 });
9
+ function ke() {
10
10
  }
11
- w(vt, "noop");
12
- function $(t) {
13
- return t == null;
11
+ w(ke, "noop");
12
+ function $(e) {
13
+ return e == null;
14
14
  }
15
15
  w($, "isNullable");
16
- function St(t) {
17
- return !$(t);
16
+ function Oe(e) {
17
+ return !$(e);
18
18
  }
19
- w(St, "isNonNullable");
20
- function J(t) {
21
- return t && typeof t == "object" && !Array.isArray(t);
19
+ w(Oe, "isNonNullable");
20
+ function J(e) {
21
+ return e && typeof e == "object" && !Array.isArray(e);
22
22
  }
23
23
  w(J, "isPlainObject");
24
- function ft(t, e) {
25
- return Object.fromEntries(Object.entries(t).filter(([r, n]) => e(r, n)));
24
+ function fe(e, t) {
25
+ return Object.fromEntries(Object.entries(e).filter(([r, n]) => t(r, n)));
26
26
  }
27
- w(ft, "filterKeys");
28
- function N(t, e) {
29
- return Object.fromEntries(Object.entries(t).map(([r, n]) => [r, e(n, r)]));
27
+ w(fe, "filterKeys");
28
+ function C(e, t) {
29
+ return Object.fromEntries(Object.entries(e).map(([r, n]) => [r, t(n, r)]));
30
30
  }
31
- w(N, "mapValues");
32
- function at(t, e, r) {
33
- if (!e) return { ...t };
31
+ w(C, "mapValues");
32
+ function ae(e, t, r) {
33
+ if (!t) return { ...e };
34
34
  const n = {};
35
- for (const c of e)
36
- (r || t[c] !== void 0) && (n[c] = t[c]);
35
+ for (const c of t)
36
+ (r || e[c] !== void 0) && (n[c] = e[c]);
37
37
  return n;
38
38
  }
39
- w(at, "pick");
40
- function kt(t, e) {
41
- if (!e) return { ...t };
42
- const r = { ...t };
43
- for (const n of e)
39
+ w(ae, "pick");
40
+ function Se(e, t) {
41
+ if (!t) return { ...e };
42
+ const r = { ...e };
43
+ for (const n of t)
44
44
  Reflect.deleteProperty(r, n);
45
45
  return r;
46
46
  }
47
- w(kt, "omit");
48
- function A(t, e, r) {
49
- return Object.defineProperty(t, e, { writable: !0, value: r, enumerable: !1 });
47
+ w(Se, "omit");
48
+ function A(e, t, r) {
49
+ return Object.defineProperty(e, t, { writable: !0, value: r, enumerable: !1 });
50
50
  }
51
51
  w(A, "defineProperty");
52
- function Ot(t, e) {
53
- return e.every((r) => t.includes(r));
52
+ function je(e, t) {
53
+ return t.every((r) => e.includes(r));
54
54
  }
55
- w(Ot, "contain");
56
- function jt(t, e) {
57
- return t.filter((r) => e.includes(r));
55
+ w(je, "contain");
56
+ function $e(e, t) {
57
+ return e.filter((r) => t.includes(r));
58
58
  }
59
- w(jt, "intersection");
60
- function $t(t, e) {
61
- return t.filter((r) => !e.includes(r));
59
+ w($e, "intersection");
60
+ function _e(e, t) {
61
+ return e.filter((r) => !t.includes(r));
62
62
  }
63
- w($t, "difference");
64
- function _t(t, e) {
65
- return Array.from(/* @__PURE__ */ new Set([...t, ...e]));
63
+ w(_e, "difference");
64
+ function Ae(e, t) {
65
+ return Array.from(/* @__PURE__ */ new Set([...e, ...t]));
66
66
  }
67
- w(_t, "union");
68
- function At(t) {
69
- return [...new Set(t)];
67
+ w(Ae, "union");
68
+ function Re(e) {
69
+ return [...new Set(e)];
70
70
  }
71
- w(At, "deduplicate");
72
- function D(t, e) {
73
- const r = t?.indexOf(e);
74
- return r >= 0 ? (t.splice(r, 1), !0) : !1;
71
+ w(Re, "deduplicate");
72
+ function N(e, t) {
73
+ const r = e?.indexOf(t);
74
+ return r >= 0 ? (e.splice(r, 1), !0) : !1;
75
75
  }
76
- w(D, "remove");
77
- function Rt(t) {
78
- return Array.isArray(t) ? t : $(t) ? [] : [t];
76
+ w(N, "remove");
77
+ function Pe(e) {
78
+ return Array.isArray(e) ? e : $(e) ? [] : [e];
79
79
  }
80
- w(Rt, "makeArray");
81
- function B(t, e) {
82
- return arguments.length === 1 ? (r) => B(t, r) : t in globalThis && e instanceof globalThis[t] || Object.prototype.toString.call(e).slice(8, -1) === t;
80
+ w(Pe, "makeArray");
81
+ function I(e, t) {
82
+ return arguments.length === 1 ? (r) => I(e, r) : e in globalThis && t instanceof globalThis[e] || Object.prototype.toString.call(t).slice(8, -1) === e;
83
83
  }
84
- w(B, "is");
85
- function q(t) {
86
- return B("ArrayBuffer", t) || B("SharedArrayBuffer", t);
84
+ w(I, "is");
85
+ function M(e) {
86
+ return I("ArrayBuffer", e) || I("SharedArrayBuffer", e);
87
87
  }
88
- w(q, "isArrayBufferLike");
89
- function ut(t) {
90
- return q(t) || ArrayBuffer.isView(t);
88
+ w(M, "isArrayBufferLike");
89
+ function ue(e) {
90
+ return M(e) || ArrayBuffer.isView(e);
91
91
  }
92
- w(ut, "isArrayBufferSource");
92
+ w(ue, "isArrayBufferSource");
93
93
  var E;
94
- ((t) => {
95
- t.is = q, t.isSource = ut;
96
- function e(a) {
94
+ ((e) => {
95
+ e.is = M, e.isSource = ue;
96
+ function t(a) {
97
97
  return ArrayBuffer.isView(a) ? a.buffer.slice(a.byteOffset, a.byteOffset + a.byteLength) : a;
98
98
  }
99
- t.fromSource = e, w(e, "fromSource");
99
+ e.fromSource = t, w(t, "fromSource");
100
100
  function r(a) {
101
101
  if (typeof Buffer < "u")
102
102
  return Buffer.from(a).toString("base64");
@@ -106,136 +106,136 @@ var E;
106
106
  y += String.fromCharCode(d[b]);
107
107
  return btoa(y);
108
108
  }
109
- t.toBase64 = r, w(r, "toBase64");
109
+ e.toBase64 = r, w(r, "toBase64");
110
110
  function n(a) {
111
- return typeof Buffer < "u" ? e(Buffer.from(a, "base64")) : Uint8Array.from(atob(a), (y) => y.charCodeAt(0));
111
+ return typeof Buffer < "u" ? t(Buffer.from(a, "base64")) : Uint8Array.from(atob(a), (y) => y.charCodeAt(0));
112
112
  }
113
- t.fromBase64 = n, w(n, "fromBase64");
113
+ e.fromBase64 = n, w(n, "fromBase64");
114
114
  function c(a) {
115
115
  return typeof Buffer < "u" ? Buffer.from(a).toString("hex") : Array.from(new Uint8Array(a), (y) => y.toString(16).padStart(2, "0")).join("");
116
116
  }
117
- t.toHex = c, w(c, "toHex");
117
+ e.toHex = c, w(c, "toHex");
118
118
  function i(a) {
119
- if (typeof Buffer < "u") return e(Buffer.from(a, "hex"));
119
+ if (typeof Buffer < "u") return t(Buffer.from(a, "hex"));
120
120
  const y = a.length % 2 === 0 ? a : a.slice(0, a.length - 1), d = [];
121
121
  for (let b = 0; b < y.length; b += 2)
122
122
  d.push(parseInt(`${y[b]}${y[b + 1]}`, 16));
123
123
  return Uint8Array.from(d).buffer;
124
124
  }
125
- t.fromHex = i, w(i, "fromHex");
125
+ e.fromHex = i, w(i, "fromHex");
126
126
  })(E || (E = {}));
127
127
  E.fromBase64;
128
128
  E.toBase64;
129
129
  E.fromHex;
130
130
  E.toHex;
131
- function V(t, e = /* @__PURE__ */ new Map()) {
132
- if (!t || typeof t != "object") return t;
133
- if (B("Date", t)) return new Date(t.valueOf());
134
- if (B("RegExp", t)) return new RegExp(t.source, t.flags);
135
- if (q(t)) return t.slice(0);
136
- if (ArrayBuffer.isView(t)) return t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength);
137
- const r = e.get(t);
131
+ function V(e, t = /* @__PURE__ */ new Map()) {
132
+ if (!e || typeof e != "object") return e;
133
+ if (I("Date", e)) return new Date(e.valueOf());
134
+ if (I("RegExp", e)) return new RegExp(e.source, e.flags);
135
+ if (M(e)) return e.slice(0);
136
+ if (ArrayBuffer.isView(e)) return e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength);
137
+ const r = t.get(e);
138
138
  if (r) return r;
139
- if (Array.isArray(t)) {
139
+ if (Array.isArray(e)) {
140
140
  const c = [];
141
- return e.set(t, c), t.forEach((i, a) => {
142
- c[a] = Reflect.apply(V, null, [i, e]);
141
+ return t.set(e, c), e.forEach((i, a) => {
142
+ c[a] = Reflect.apply(V, null, [i, t]);
143
143
  }), c;
144
144
  }
145
- const n = Object.create(Object.getPrototypeOf(t));
146
- e.set(t, n);
147
- for (const c of Reflect.ownKeys(t)) {
148
- const i = { ...Reflect.getOwnPropertyDescriptor(t, c) };
149
- "value" in i && (i.value = Reflect.apply(V, null, [i.value, e])), Reflect.defineProperty(n, c, i);
145
+ const n = Object.create(Object.getPrototypeOf(e));
146
+ t.set(e, n);
147
+ for (const c of Reflect.ownKeys(e)) {
148
+ const i = { ...Reflect.getOwnPropertyDescriptor(e, c) };
149
+ "value" in i && (i.value = Reflect.apply(V, null, [i.value, t])), Reflect.defineProperty(n, c, i);
150
150
  }
151
151
  return n;
152
152
  }
153
153
  w(V, "clone");
154
- function I(t, e, r) {
155
- if (t === e || !r && $(t) && $(e)) return !0;
156
- if (typeof t != typeof e || typeof t != "object" || !t || !e) return !1;
154
+ function B(e, t, r) {
155
+ if (e === t || !r && $(e) && $(t)) return !0;
156
+ if (typeof e != typeof t || typeof e != "object" || !e || !t) return !1;
157
157
  function n(c, i) {
158
- return c(t) ? c(e) ? i(t, e) : !1 : c(e) ? !1 : void 0;
158
+ return c(e) ? c(t) ? i(e, t) : !1 : c(t) ? !1 : void 0;
159
159
  }
160
- return w(n, "check"), n(Array.isArray, (c, i) => c.length === i.length && c.every((a, y) => I(a, i[y]))) ?? n(B("Date"), (c, i) => c.valueOf() === i.valueOf()) ?? n(B("RegExp"), (c, i) => c.source === i.source && c.flags === i.flags) ?? n(q, (c, i) => {
160
+ return w(n, "check"), n(Array.isArray, (c, i) => c.length === i.length && c.every((a, y) => B(a, i[y]))) ?? n(I("Date"), (c, i) => c.valueOf() === i.valueOf()) ?? n(I("RegExp"), (c, i) => c.source === i.source && c.flags === i.flags) ?? n(M, (c, i) => {
161
161
  if (c.byteLength !== i.byteLength) return !1;
162
162
  const a = new Uint8Array(c), y = new Uint8Array(i);
163
163
  for (let d = 0; d < a.length; d++)
164
164
  if (a[d] !== y[d]) return !1;
165
165
  return !0;
166
- }) ?? Object.keys({ ...t, ...e }).every((c) => I(t[c], e[c], r));
166
+ }) ?? Object.keys({ ...e, ...t }).every((c) => B(e[c], t[c], r));
167
167
  }
168
- w(I, "deepEqual");
169
- function Pt(t) {
170
- return t.charAt(0).toUpperCase() + t.slice(1);
168
+ w(B, "deepEqual");
169
+ function Ee(e) {
170
+ return e.charAt(0).toUpperCase() + e.slice(1);
171
171
  }
172
- w(Pt, "capitalize");
173
- function Et(t) {
174
- return t.charAt(0).toLowerCase() + t.slice(1);
172
+ w(Ee, "capitalize");
173
+ function De(e) {
174
+ return e.charAt(0).toLowerCase() + e.slice(1);
175
175
  }
176
- w(Et, "uncapitalize");
177
- function Ct(t) {
178
- return t.replace(/[_-][a-z]/g, (e) => e.slice(1).toUpperCase());
176
+ w(De, "uncapitalize");
177
+ function Ce(e) {
178
+ return e.replace(/[_-][a-z]/g, (t) => t.slice(1).toUpperCase());
179
179
  }
180
- w(Ct, "camelCase");
181
- function T(t, e, r) {
180
+ w(Ce, "camelCase");
181
+ function X(e, t, r) {
182
182
  const n = [];
183
183
  let c = 0;
184
- for (let i = 0; i < t.length; i++) {
185
- const a = t.charCodeAt(i);
184
+ for (let i = 0; i < e.length; i++) {
185
+ const a = e.charCodeAt(i);
186
186
  if (a >= 65 && a <= 90) {
187
187
  if (c === 1) {
188
- const y = t.charCodeAt(i + 1);
188
+ const y = e.charCodeAt(i + 1);
189
189
  y >= 97 && y <= 122 && n.push(r), n.push(a + 32);
190
190
  } else
191
191
  c !== 0 && n.push(r), n.push(a + 32);
192
192
  c = 1;
193
- } else a >= 97 && a <= 122 ? (n.push(a), c = 2) : e.includes(a) ? (c !== 0 && n.push(r), c = 0) : n.push(a);
193
+ } else a >= 97 && a <= 122 ? (n.push(a), c = 2) : t.includes(a) ? (c !== 0 && n.push(r), c = 0) : n.push(a);
194
194
  }
195
195
  return String.fromCharCode(...n);
196
196
  }
197
- w(T, "tokenize");
198
- function Nt(t) {
199
- return T(t, [45, 95], 45);
197
+ w(X, "tokenize");
198
+ function Ne(e) {
199
+ return X(e, [45, 95], 45);
200
200
  }
201
- w(Nt, "paramCase");
202
- function Dt(t) {
203
- return T(t, [45, 95], 95);
201
+ w(Ne, "paramCase");
202
+ function Ie(e) {
203
+ return X(e, [45, 95], 95);
204
204
  }
205
- w(Dt, "snakeCase");
206
- function Bt(t) {
207
- return typeof t != "string" ? `[${t.toString()}]` : /^[a-z_$][\w$]*$/i.test(t) ? `.${t}` : `[${JSON.stringify(t)}]`;
205
+ w(Ie, "snakeCase");
206
+ function Be(e) {
207
+ return typeof e != "string" ? `[${e.toString()}]` : /^[a-z_$][\w$]*$/i.test(e) ? `.${e}` : `[${JSON.stringify(e)}]`;
208
208
  }
209
- w(Bt, "formatProperty");
210
- function lt(t) {
211
- return t.replace(/\/$/, "");
209
+ w(Be, "formatProperty");
210
+ function le(e) {
211
+ return e.replace(/\/$/, "");
212
212
  }
213
- w(lt, "trimSlash");
214
- function It(t) {
215
- return t.startsWith("/") || (t = "/" + t), lt(t);
213
+ w(le, "trimSlash");
214
+ function Ue(e) {
215
+ return e.startsWith("/") || (e = "/" + e), le(e);
216
216
  }
217
- w(It, "sanitize");
218
- var st;
219
- ((t) => {
220
- t.millisecond = 1, t.second = 1e3, t.minute = t.second * 60, t.hour = t.minute * 60, t.day = t.hour * 24, t.week = t.day * 7;
221
- let e = (/* @__PURE__ */ new Date()).getTimezoneOffset();
217
+ w(Ue, "sanitize");
218
+ var se;
219
+ ((e) => {
220
+ e.millisecond = 1, e.second = 1e3, e.minute = e.second * 60, e.hour = e.minute * 60, e.day = e.hour * 24, e.week = e.day * 7;
221
+ let t = (/* @__PURE__ */ new Date()).getTimezoneOffset();
222
222
  function r(x) {
223
- e = x;
223
+ t = x;
224
224
  }
225
- t.setTimezoneOffset = r, w(r, "setTimezoneOffset");
225
+ e.setTimezoneOffset = r, w(r, "setTimezoneOffset");
226
226
  function n() {
227
- return e;
227
+ return t;
228
228
  }
229
- t.getTimezoneOffset = n, w(n, "getTimezoneOffset");
229
+ e.getTimezoneOffset = n, w(n, "getTimezoneOffset");
230
230
  function c(x = /* @__PURE__ */ new Date(), v) {
231
- return typeof x == "number" && (x = new Date(x)), v === void 0 && (v = e), Math.floor((x.valueOf() / t.minute - v) / 1440);
231
+ return typeof x == "number" && (x = new Date(x)), v === void 0 && (v = t), Math.floor((x.valueOf() / e.minute - v) / 1440);
232
232
  }
233
- t.getDateNumber = c, w(c, "getDateNumber");
233
+ e.getDateNumber = c, w(c, "getDateNumber");
234
234
  function i(x, v) {
235
- const z = new Date(x * t.day);
236
- return v === void 0 && (v = e), new Date(+z + v * t.minute);
235
+ const U = new Date(x * e.day);
236
+ return v === void 0 && (v = t), new Date(+U + v * e.minute);
237
237
  }
238
- t.fromDateNumber = i, w(i, "fromDateNumber");
238
+ e.fromDateNumber = i, w(i, "fromDateNumber");
239
239
  const a = /\d+(?:\.\d+)?/.source, y = new RegExp(`^${[
240
240
  "w(?:eek(?:s)?)?",
241
241
  "d(?:ay(?:s)?)?",
@@ -245,29 +245,29 @@ var st;
245
245
  ].map((x) => `(${a}${x})?`).join("")}$`);
246
246
  function d(x) {
247
247
  const v = y.exec(x);
248
- return v ? (parseFloat(v[1]) * t.week || 0) + (parseFloat(v[2]) * t.day || 0) + (parseFloat(v[3]) * t.hour || 0) + (parseFloat(v[4]) * t.minute || 0) + (parseFloat(v[5]) * t.second || 0) : 0;
248
+ return v ? (parseFloat(v[1]) * e.week || 0) + (parseFloat(v[2]) * e.day || 0) + (parseFloat(v[3]) * e.hour || 0) + (parseFloat(v[4]) * e.minute || 0) + (parseFloat(v[5]) * e.second || 0) : 0;
249
249
  }
250
- t.parseTime = d, w(d, "parseTime");
250
+ e.parseTime = d, w(d, "parseTime");
251
251
  function b(x) {
252
252
  const v = d(x);
253
253
  return v ? x = Date.now() + v : /^\d{1,2}(:\d{1,2}){1,2}$/.test(x) ? x = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${x}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(x) && (x = `${(/* @__PURE__ */ new Date()).getFullYear()}-${x}`), x ? new Date(x) : /* @__PURE__ */ new Date();
254
254
  }
255
- t.parseDate = b, w(b, "parseDate");
255
+ e.parseDate = b, w(b, "parseDate");
256
256
  function j(x) {
257
257
  const v = Math.abs(x);
258
- return v >= t.day - t.hour / 2 ? Math.round(x / t.day) + "d" : v >= t.hour - t.minute / 2 ? Math.round(x / t.hour) + "h" : v >= t.minute - t.second / 2 ? Math.round(x / t.minute) + "m" : v >= t.second ? Math.round(x / t.second) + "s" : x + "ms";
258
+ return v >= e.day - e.hour / 2 ? Math.round(x / e.day) + "d" : v >= e.hour - e.minute / 2 ? Math.round(x / e.hour) + "h" : v >= e.minute - e.second / 2 ? Math.round(x / e.minute) + "m" : v >= e.second ? Math.round(x / e.second) + "s" : x + "ms";
259
259
  }
260
- t.format = j, w(j, "format");
261
- function k(x, v = 2) {
260
+ e.format = j, w(j, "format");
261
+ function O(x, v = 2) {
262
262
  return x.toString().padStart(v, "0");
263
263
  }
264
- t.toDigits = k, w(k, "toDigits");
264
+ e.toDigits = O, w(O, "toDigits");
265
265
  function R(x, v = /* @__PURE__ */ new Date()) {
266
- return x.replace("yyyy", v.getFullYear().toString()).replace("yy", v.getFullYear().toString().slice(2)).replace("MM", k(v.getMonth() + 1)).replace("dd", k(v.getDate())).replace("hh", k(v.getHours())).replace("mm", k(v.getMinutes())).replace("ss", k(v.getSeconds())).replace("SSS", k(v.getMilliseconds(), 3));
266
+ return x.replace("yyyy", v.getFullYear().toString()).replace("yy", v.getFullYear().toString().slice(2)).replace("MM", O(v.getMonth() + 1)).replace("dd", O(v.getDate())).replace("hh", O(v.getHours())).replace("mm", O(v.getMinutes())).replace("ss", O(v.getSeconds())).replace("SSS", O(v.getMilliseconds(), 3));
267
267
  }
268
- t.template = R, w(R, "template");
269
- })(st || (st = {}));
270
- var zt = Object.defineProperty, g = (t, e) => zt(t, "name", { value: e, configurable: !0 }), h = {
268
+ e.template = R, w(R, "template");
269
+ })(se || (se = {}));
270
+ var ze = Object.defineProperty, g = (e, t) => ze(e, "name", { value: t, configurable: !0 }), h = {
271
271
  // internal symbols
272
272
  shadow: Symbol.for("cordis.shadow"),
273
273
  receiver: Symbol.for("cordis.receiver"),
@@ -288,120 +288,120 @@ var zt = Object.defineProperty, g = (t, e) => zt(t, "name", { value: e, configur
288
288
  tracker: Symbol.for("cordis.tracker"),
289
289
  provide: Symbol.for("cordis.provide"),
290
290
  immediate: Symbol.for("cordis.immediate")
291
- }, Ut = function* () {
292
- }.constructor, ot = async function* () {
291
+ }, Fe = function* () {
292
+ }.constructor, oe = async function* () {
293
293
  }.constructor;
294
- function tt(t) {
295
- return !(!t.prototype || t instanceof Ut || ot !== Function && t instanceof ot);
294
+ function ee(e) {
295
+ return !(!e.prototype || e instanceof Fe || oe !== Function && e instanceof oe);
296
296
  }
297
- g(tt, "isConstructor");
298
- function L(t, e) {
299
- const r = t.Config || t.schema;
300
- return r && t.schema !== !1 && (e = r(e)), e ?? {};
297
+ g(ee, "isConstructor");
298
+ function q(e, t) {
299
+ const r = e.Config || e.schema;
300
+ return r && e.schema !== !1 && (t = r(t)), t ?? {};
301
301
  }
302
- g(L, "resolveConfig");
303
- function ht(t) {
304
- return [Map, Set, Date, Promise].some((e) => t instanceof e);
302
+ g(q, "resolveConfig");
303
+ function he(e) {
304
+ return [Map, Set, Date, Promise].some((t) => e instanceof t);
305
305
  }
306
- g(ht, "isUnproxyable");
307
- function et(t, e) {
308
- if (t === Object.prototype) return e;
309
- const r = Object.create(et(Object.getPrototypeOf(t), e));
310
- for (const n of Reflect.ownKeys(t))
311
- Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
306
+ g(he, "isUnproxyable");
307
+ function te(e, t) {
308
+ if (e === Object.prototype) return t;
309
+ const r = Object.create(te(Object.getPrototypeOf(e), t));
310
+ for (const n of Reflect.ownKeys(e))
311
+ Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(e, n));
312
312
  return r;
313
313
  }
314
- g(et, "joinPrototype");
315
- function rt(t) {
316
- return t && (typeof t == "object" || typeof t == "function");
314
+ g(te, "joinPrototype");
315
+ function re(e) {
316
+ return e && (typeof e == "object" || typeof e == "function");
317
317
  }
318
- g(rt, "isObject");
319
- function C(t, e, r) {
320
- if (!rt(e)) return e;
321
- if (Object.hasOwn(e, h.shadow))
322
- return Object.getPrototypeOf(e);
323
- const n = e[h.tracker];
324
- return n ? G(t, e, n, r) : e;
318
+ g(re, "isObject");
319
+ function D(e, t, r) {
320
+ if (!re(t)) return t;
321
+ if (Object.hasOwn(t, h.shadow))
322
+ return Object.getPrototypeOf(t);
323
+ const n = t[h.tracker];
324
+ return n ? G(e, t, n, r) : t;
325
325
  }
326
- g(C, "getTraceable");
327
- function F(t, e) {
328
- return e ? new Proxy(t, {
329
- get: /* @__PURE__ */ g((r, n, c) => n in e && n !== "constructor" ? Reflect.get(e, n, c) : Reflect.get(r, n, c), "get"),
330
- set: /* @__PURE__ */ g((r, n, c, i) => n in e && n !== "constructor" ? Reflect.set(e, n, c, i) : Reflect.set(r, n, c, i), "set")
331
- }) : t;
326
+ g(D, "getTraceable");
327
+ function L(e, t) {
328
+ return t ? new Proxy(e, {
329
+ get: /* @__PURE__ */ g((r, n, c) => n in t && n !== "constructor" ? Reflect.get(t, n, c) : Reflect.get(r, n, c), "get"),
330
+ set: /* @__PURE__ */ g((r, n, c, i) => n in t && n !== "constructor" ? Reflect.set(t, n, c, i) : Reflect.set(r, n, c, i), "set")
331
+ }) : e;
332
332
  }
333
- g(F, "withProps");
334
- function H(t, e, r) {
335
- return F(t, Object.defineProperty(/* @__PURE__ */ Object.create(null), e, {
333
+ g(L, "withProps");
334
+ function H(e, t, r) {
335
+ return L(e, Object.defineProperty(/* @__PURE__ */ Object.create(null), t, {
336
336
  value: r,
337
337
  writable: !1
338
338
  }));
339
339
  }
340
340
  g(H, "withProp");
341
- function W(t, e, r, n) {
341
+ function W(e, t, r, n) {
342
342
  if (!r) return n;
343
- const c = Reflect.getOwnPropertyDescriptor(e, r)?.value;
344
- return c ? H(n, r, t.extend({ [h.shadow]: c })) : n;
343
+ const c = Reflect.getOwnPropertyDescriptor(t, r)?.value;
344
+ return c ? H(n, r, e.extend({ [h.shadow]: c })) : n;
345
345
  }
346
346
  g(W, "createShadow");
347
- function pt(t, e, r, n) {
348
- return new Proxy(e, {
347
+ function pe(e, t, r, n) {
348
+ return new Proxy(t, {
349
349
  apply: /* @__PURE__ */ g((c, i, a) => (i === r && (i = n), a = a.map((y) => typeof y != "function" || y[h.original] ? y : new Proxy(y, {
350
350
  get: /* @__PURE__ */ g((d, b, j) => {
351
351
  if (b === h.original) return d;
352
- const k = Reflect.get(d, b, j);
353
- return b === "toString" && k === Function.prototype.toString ? function(...R) {
354
- return Reflect.apply(k, this === j ? d : this, R);
355
- } : k;
352
+ const O = Reflect.get(d, b, j);
353
+ return b === "toString" && O === Function.prototype.toString ? function(...R) {
354
+ return Reflect.apply(O, this === j ? d : this, R);
355
+ } : O;
356
356
  }, "get"),
357
- apply: /* @__PURE__ */ g((d, b, j) => Reflect.apply(d, C(t, b), j.map((k) => C(t, k))), "apply"),
358
- construct: /* @__PURE__ */ g((d, b, j) => Reflect.construct(d, b.map((k) => C(t, k)), j), "construct")
359
- })), C(t, Reflect.apply(c, i, a))), "apply")
357
+ apply: /* @__PURE__ */ g((d, b, j) => Reflect.apply(d, D(e, b), j.map((O) => D(e, O))), "apply"),
358
+ construct: /* @__PURE__ */ g((d, b, j) => Reflect.construct(d, b.map((O) => D(e, O)), j), "construct")
359
+ })), D(e, Reflect.apply(c, i, a))), "apply")
360
360
  });
361
361
  }
362
- g(pt, "createShadowMethod");
363
- function G(t, e, r, n) {
364
- t[h.shadow] && (t = Object.getPrototypeOf(t));
365
- const c = new Proxy(e, {
362
+ g(pe, "createShadowMethod");
363
+ function G(e, t, r, n) {
364
+ e[h.shadow] && (e = Object.getPrototypeOf(e));
365
+ const c = new Proxy(t, {
366
366
  get: /* @__PURE__ */ g((i, a, y) => {
367
367
  if (a === h.original) return i;
368
- if (a === r.property) return t;
368
+ if (a === r.property) return e;
369
369
  if (typeof a == "symbol")
370
370
  return Reflect.get(i, a, y);
371
- if (r.associate && t[h.internal][`${r.associate}.${a}`])
372
- return Reflect.get(t, `${r.associate}.${a}`, H(t, h.receiver, y));
373
- const d = W(t, i, r.property, y), b = Reflect.get(i, a, d), j = b?.[h.tracker];
374
- return j ? G(t, b, j) : !n && typeof b == "function" ? pt(t, b, y, d) : b;
371
+ if (r.associate && e[h.internal][`${r.associate}.${a}`])
372
+ return Reflect.get(e, `${r.associate}.${a}`, H(e, h.receiver, y));
373
+ const d = W(e, i, r.property, y), b = Reflect.get(i, a, d), j = b?.[h.tracker];
374
+ return j ? G(e, b, j) : !n && typeof b == "function" ? pe(e, b, y, d) : b;
375
375
  }, "get"),
376
376
  set: /* @__PURE__ */ g((i, a, y, d) => {
377
377
  if (a === h.original || a === r.property) return !1;
378
378
  if (typeof a == "symbol")
379
379
  return Reflect.set(i, a, y, d);
380
- if (r.associate && t[h.internal][`${r.associate}.${a}`])
381
- return Reflect.set(t, `${r.associate}.${a}`, y, H(t, h.receiver, d));
382
- const b = W(t, i, r.property, d);
380
+ if (r.associate && e[h.internal][`${r.associate}.${a}`])
381
+ return Reflect.set(e, `${r.associate}.${a}`, y, H(e, h.receiver, d));
382
+ const b = W(e, i, r.property, d);
383
383
  return Reflect.set(i, a, y, b);
384
384
  }, "set"),
385
- apply: /* @__PURE__ */ g((i, a, y) => nt(c, i, a, y), "apply")
385
+ apply: /* @__PURE__ */ g((i, a, y) => ne(c, i, a, y), "apply")
386
386
  });
387
387
  return c;
388
388
  }
389
389
  g(G, "createTraceable");
390
- function nt(t, e, r, n) {
391
- return e[h.invoke] ? e[h.invoke].apply(t, n) : Reflect.apply(e, r, n);
390
+ function ne(e, t, r, n) {
391
+ return t[h.invoke] ? t[h.invoke].apply(e, n) : Reflect.apply(t, r, n);
392
392
  }
393
- g(nt, "applyTraceable");
394
- function Y(t, e, r) {
393
+ g(ne, "applyTraceable");
394
+ function Y(e, t, r) {
395
395
  const n = /* @__PURE__ */ g(function(...c) {
396
396
  const i = G(n.ctx, n, r);
397
- return nt(i, n, this, c);
397
+ return ne(i, n, this, c);
398
398
  }, "self");
399
- return A(n, "name", t), Object.setPrototypeOf(n, e);
399
+ return A(n, "name", e), Object.setPrototypeOf(n, t);
400
400
  }
401
401
  g(Y, "createCallable");
402
- var Mt = class U {
403
- constructor(e) {
404
- this.ctx = e, A(this, h.tracker, {
402
+ var Le = class z {
403
+ constructor(t) {
404
+ this.ctx = t, A(this, h.tracker, {
405
405
  associate: "reflect",
406
406
  property: "ctx"
407
407
  }), this._mixin("reflect", ["get", "set", "provide", "accessor", "mixin", "alias"]), this._mixin("scope", ["config", "runtime", "effect", "collect", "accept", "decline"]), this._mixin("registry", ["using", "inject", "plugin"]), this._mixin("lifecycle", ["on", "once", "parallel", "emit", "serial", "bail", "start", "stop"]);
@@ -409,117 +409,117 @@ var Mt = class U {
409
409
  static {
410
410
  g(this, "ReflectService");
411
411
  }
412
- static resolveInject(e, r) {
413
- let n = e[h.internal][r];
412
+ static resolveInject(t, r) {
413
+ let n = t[h.internal][r];
414
414
  for (; n?.type === "alias"; )
415
- r = n.name, n = e[h.internal][r];
415
+ r = n.name, n = t[h.internal][r];
416
416
  return [r, n];
417
417
  }
418
- static checkInject(e, r, n) {
419
- if (e = e[h.shadow] ?? e, ["prototype", "then", "registry", "lifecycle"].includes(r) || r[0] === "$" || r[0] === "_" || !e.runtime.plugin || e.bail(e, "internal/inject", r)) return;
418
+ static checkInject(t, r, n) {
419
+ if (t = t[h.shadow] ?? t, ["prototype", "then", "registry", "lifecycle"].includes(r) || r[0] === "$" || r[0] === "_" || !t.runtime.plugin || t.bail(t, "internal/inject", r)) return;
420
420
  const c = n.stack.split(`
421
421
  `);
422
422
  c.splice(1, 1), n.stack = c.join(`
423
- `), e.emit(e, "internal/warning", n);
423
+ `), t.emit(t, "internal/warning", n);
424
424
  }
425
425
  static handler = {
426
- get: /* @__PURE__ */ g((e, r, n) => {
427
- if (typeof r != "string") return Reflect.get(e, r, n);
428
- if (Reflect.has(e, r))
429
- return C(n, Reflect.get(e, r, n), !0);
430
- const [c, i] = U.resolveInject(e, r), a = new Error(`property ${c} is not registered, declare it as \`inject\` to suppress this warning`);
431
- return i ? i.type === "accessor" ? i.get.call(n, n[h.receiver]) : (i.builtin || U.checkInject(n, c, a), n.reflect.get(c)) : (U.checkInject(n, c, a), Reflect.get(e, c, n));
426
+ get: /* @__PURE__ */ g((t, r, n) => {
427
+ if (typeof r != "string") return Reflect.get(t, r, n);
428
+ if (Reflect.has(t, r))
429
+ return D(n, Reflect.get(t, r, n), !0);
430
+ const [c, i] = z.resolveInject(t, r), a = new Error(`property ${c} is not registered, declare it as \`inject\` to suppress this warning`);
431
+ return i ? i.type === "accessor" ? i.get.call(n, n[h.receiver]) : (i.builtin || z.checkInject(n, c, a), n.reflect.get(c)) : (z.checkInject(n, c, a), Reflect.get(t, c, n));
432
432
  }, "get"),
433
- set: /* @__PURE__ */ g((e, r, n, c) => {
434
- if (typeof r != "string") return Reflect.set(e, r, n, c);
435
- const [i, a] = U.resolveInject(e, r);
436
- return a ? a.type === "accessor" ? a.set ? a.set.call(c, n, c[h.receiver]) : !1 : (c.reflect.set(i, n), !0) : Reflect.set(e, i, n, c);
433
+ set: /* @__PURE__ */ g((t, r, n, c) => {
434
+ if (typeof r != "string") return Reflect.set(t, r, n, c);
435
+ const [i, a] = z.resolveInject(t, r);
436
+ return a ? a.type === "accessor" ? a.set ? a.set.call(c, n, c[h.receiver]) : !1 : (c.reflect.set(i, n), !0) : Reflect.set(t, i, n, c);
437
437
  }, "set"),
438
- has: /* @__PURE__ */ g((e, r) => {
439
- if (typeof r != "string") return Reflect.has(e, r);
440
- if (Reflect.has(e, r)) return !0;
441
- const [, n] = U.resolveInject(e, r);
438
+ has: /* @__PURE__ */ g((t, r) => {
439
+ if (typeof r != "string") return Reflect.has(t, r);
440
+ if (Reflect.has(t, r)) return !0;
441
+ const [, n] = z.resolveInject(t, r);
442
442
  return !!n;
443
443
  }, "has")
444
444
  };
445
- get(e) {
446
- if (this.ctx[h.internal][e]?.type !== "service") return;
447
- const n = this.ctx[h.isolate][e], c = this.ctx[h.store][n]?.value;
448
- return C(this.ctx, c);
445
+ get(t) {
446
+ if (this.ctx[h.internal][t]?.type !== "service") return;
447
+ const n = this.ctx[h.isolate][t], c = this.ctx[h.store][n]?.value;
448
+ return D(this.ctx, c);
449
449
  }
450
- set(e, r) {
451
- this.provide(e);
452
- const n = this.ctx[h.isolate][e], c = this.ctx[h.store][n]?.value;
450
+ set(t, r) {
451
+ this.provide(t);
452
+ const n = this.ctx[h.isolate][t], c = this.ctx[h.store][n]?.value;
453
453
  r ??= void 0;
454
454
  let i = /* @__PURE__ */ g(() => {
455
455
  }, "dispose");
456
456
  if (c === r) return i;
457
457
  if (!$(r) && !$(c))
458
- throw new Error(`service ${e} has been registered`);
458
+ throw new Error(`service ${t} has been registered`);
459
459
  const a = this.ctx;
460
460
  $(r) || (i = a.effect(() => () => {
461
- a.set(e, void 0);
462
- })), ht(r) && a.emit(a, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
461
+ a.set(t, void 0);
462
+ })), he(r) && a.emit(a, "internal/warning", new Error(`service ${t} is an unproxyable object, which may lead to unexpected behavior`));
463
463
  const y = Object.create(a);
464
- return y[h.filter] = (d) => a[h.isolate][e] === d[h.isolate][e], a.emit(y, "internal/before-service", e, r), a[h.store][n] = { value: r, source: a }, a.emit(y, "internal/service", e, c), i;
464
+ return y[h.filter] = (d) => a[h.isolate][t] === d[h.isolate][t], a.emit(y, "internal/before-service", t, r), a[h.store][n] = { value: r, source: a }, a.emit(y, "internal/service", t, c), i;
465
465
  }
466
- provide(e, r, n) {
466
+ provide(t, r, n) {
467
467
  const c = this.ctx.root[h.internal];
468
- if (e in c) return;
469
- const i = Symbol(e);
470
- c[e] = { type: "service", builtin: n }, this.ctx.root[h.isolate][e] = i, rt(r) && (this.ctx[h.store][i] = { value: r, source: null }, A(r, h.tracker, {
471
- associate: e,
468
+ if (t in c) return;
469
+ const i = Symbol(t);
470
+ c[t] = { type: "service", builtin: n }, this.ctx.root[h.isolate][t] = i, re(r) && (this.ctx[h.store][i] = { value: r, source: null }, A(r, h.tracker, {
471
+ associate: t,
472
472
  property: "ctx"
473
473
  }));
474
474
  }
475
- _accessor(e, r) {
475
+ _accessor(t, r) {
476
476
  const n = this.ctx.root[h.internal];
477
- return e in n ? () => {
478
- } : (n[e] = { type: "accessor", ...r }, () => delete this.ctx.root[h.isolate][e]);
477
+ return t in n ? () => {
478
+ } : (n[t] = { type: "accessor", ...r }, () => delete this.ctx.root[h.isolate][t]);
479
479
  }
480
- accessor(e, r) {
481
- this.ctx.scope.effect(() => this._accessor(e, r));
480
+ accessor(t, r) {
481
+ this.ctx.scope.effect(() => this._accessor(t, r));
482
482
  }
483
- alias(e, r) {
483
+ alias(t, r) {
484
484
  const n = this.ctx.root[h.internal];
485
- if (!(e in n))
485
+ if (!(t in n))
486
486
  for (const c of r)
487
- n[c] ||= { type: "alias", name: e };
487
+ n[c] ||= { type: "alias", name: t };
488
488
  }
489
- _mixin(e, r) {
490
- const n = Array.isArray(r) ? r.map((a) => [a, a]) : Object.entries(r), c = typeof e == "string" ? (a) => a[e] : () => e, i = n.map(([a, y]) => this._accessor(y, {
489
+ _mixin(t, r) {
490
+ const n = Array.isArray(r) ? r.map((a) => [a, a]) : Object.entries(r), c = typeof t == "string" ? (a) => a[t] : () => t, i = n.map(([a, y]) => this._accessor(y, {
491
491
  get(d) {
492
492
  const b = c(this);
493
493
  if ($(b)) return b;
494
- const j = d ? F(d, b) : b, k = Reflect.get(b, a, j);
495
- return typeof k != "function" ? k : k.bind(j ?? b);
494
+ const j = d ? L(d, b) : b, O = Reflect.get(b, a, j);
495
+ return typeof O != "function" ? O : O.bind(j ?? b);
496
496
  },
497
497
  set(d, b) {
498
- const j = c(this), k = b ? F(b, j) : j;
499
- return Reflect.set(j, a, d, k);
498
+ const j = c(this), O = b ? L(b, j) : j;
499
+ return Reflect.set(j, a, d, O);
500
500
  }
501
501
  }));
502
502
  return () => i.forEach((a) => a());
503
503
  }
504
- mixin(e, r) {
505
- this.ctx.scope.effect(() => this._mixin(e, r));
504
+ mixin(t, r) {
505
+ this.ctx.scope.effect(() => this._mixin(t, r));
506
506
  }
507
- trace(e) {
508
- return C(this.ctx, e);
507
+ trace(t) {
508
+ return D(this.ctx, t);
509
509
  }
510
- bind(e) {
511
- return new Proxy(e, {
510
+ bind(t) {
511
+ return new Proxy(t, {
512
512
  apply: /* @__PURE__ */ g((r, n, c) => r.apply(this.trace(n), c.map((i) => this.trace(i))), "apply")
513
513
  });
514
514
  }
515
- }, Q = Mt;
516
- function X(t) {
517
- return t !== null && t !== !1 && t !== void 0;
515
+ }, Q = Le;
516
+ function Z(e) {
517
+ return e !== null && e !== !1 && e !== void 0;
518
518
  }
519
- g(X, "isBailed");
520
- var Ft = class {
521
- constructor(t) {
522
- this.ctx = t, A(this, h.tracker, {
519
+ g(Z, "isBailed");
520
+ var Me = class {
521
+ constructor(e) {
522
+ this.ctx = e, A(this, h.tracker, {
523
523
  associate: "lifecycle",
524
524
  property: "ctx"
525
525
  }), A(this.on("internal/listener", function(r, n, c) {
@@ -527,14 +527,14 @@ var Ft = class {
527
527
  if (r === "ready")
528
528
  return this.lifecycle.isActive ? (this.scope.ensure(async () => n()), () => !1) : void 0;
529
529
  if (r === "dispose")
530
- return this.scope.disposables[i](n), A(n, "name", "event <dispose>"), () => D(this.scope.disposables, n);
530
+ return this.scope.disposables[i](n), A(n, "name", "event <dispose>"), () => N(this.scope.disposables, n);
531
531
  if (r === "fork")
532
- return this.scope.runtime.forkables[i](n), this.scope.collect("event <fork>", () => D(this.scope.runtime.forkables, n));
533
- }), P.static, t.scope);
532
+ return this.scope.runtime.forkables[i](n), this.scope.collect("event <fork>", () => N(this.scope.runtime.forkables, n));
533
+ }), P.static, e.scope);
534
534
  for (const r of ["info", "error", "warning"])
535
535
  A(this.on(`internal/${r}`, (n, ...c) => {
536
536
  this._hooks[`internal/${r}`].length > 1;
537
- }), P.static, t.scope);
537
+ }), P.static, e.scope);
538
538
  A(this.on("internal/before-service", function(r) {
539
539
  for (const n of this.registry.values()) {
540
540
  if (!n.inject[r]?.required) continue;
@@ -542,23 +542,23 @@ var Ft = class {
542
542
  for (const i of c)
543
543
  this[h.filter](i.ctx) && (i.updateStatus(), i.reset());
544
544
  }
545
- }, { global: !0 }), P.static, t.scope), A(this.on("internal/service", function(r) {
545
+ }, { global: !0 }), P.static, e.scope), A(this.on("internal/service", function(r) {
546
546
  for (const n of this.registry.values()) {
547
547
  if (!n.inject[r]?.required) continue;
548
548
  const c = n.isReusable ? n.children : [n];
549
549
  for (const i of c)
550
550
  this[h.filter](i.ctx) && i.start();
551
551
  }
552
- }, { global: !0 }), P.static, t.scope);
553
- const e = /* @__PURE__ */ g((r, n) => {
552
+ }, { global: !0 }), P.static, e.scope);
553
+ const t = /* @__PURE__ */ g((r, n) => {
554
554
  if (!r.runtime.plugin) return !1;
555
555
  for (const c in r.runtime.inject)
556
556
  if (n === Q.resolveInject(r.ctx, c)[0]) return !0;
557
- return e(r.parent.scope, n);
557
+ return t(r.parent.scope, n);
558
558
  }, "checkInject");
559
559
  A(this.on("internal/inject", function(r) {
560
- return e(this.scope, r);
561
- }, { global: !0 }), P.static, t.scope);
560
+ return t(this.scope, r);
561
+ }, { global: !0 }), P.static, e.scope);
562
562
  }
563
563
  static {
564
564
  g(this, "Lifecycle");
@@ -570,82 +570,82 @@ var Ft = class {
570
570
  for (; this._tasks.size; )
571
571
  await Promise.all(Array.from(this._tasks));
572
572
  }
573
- filterHooks(t, e) {
574
- return e = C(this.ctx, e), t.slice().filter((r) => {
575
- const n = e?.[P.filter];
576
- return r.global || !n || n.call(e, r.ctx);
573
+ filterHooks(e, t) {
574
+ return t = D(this.ctx, t), e.slice().filter((r) => {
575
+ const n = t?.[P.filter];
576
+ return r.global || !n || n.call(t, r.ctx);
577
577
  });
578
578
  }
579
- *dispatch(t, e) {
580
- const r = typeof e[0] == "object" || typeof e[0] == "function" ? e.shift() : null, n = e.shift();
581
- n !== "internal/event" && this.emit("internal/event", t, n, e, r);
579
+ *dispatch(e, t) {
580
+ const r = typeof t[0] == "object" || typeof t[0] == "function" ? t.shift() : null, n = t.shift();
581
+ n !== "internal/event" && this.emit("internal/event", e, n, t, r);
582
582
  for (const c of this.filterHooks(this._hooks[n] || [], r))
583
- yield c.callback.apply(r, e);
583
+ yield c.callback.apply(r, t);
584
584
  }
585
- async parallel(...t) {
586
- await Promise.all(this.dispatch("emit", t));
585
+ async parallel(...e) {
586
+ await Promise.all(this.dispatch("emit", e));
587
587
  }
588
- emit(...t) {
589
- Array.from(this.dispatch("emit", t));
588
+ emit(...e) {
589
+ Array.from(this.dispatch("emit", e));
590
590
  }
591
- async serial(...t) {
592
- for await (const e of this.dispatch("serial", t))
593
- if (X(e)) return e;
591
+ async serial(...e) {
592
+ for await (const t of this.dispatch("serial", e))
593
+ if (Z(t)) return t;
594
594
  }
595
- bail(...t) {
596
- for (const e of this.dispatch("bail", t))
597
- if (X(e)) return e;
595
+ bail(...e) {
596
+ for (const t of this.dispatch("bail", e))
597
+ if (Z(t)) return t;
598
598
  }
599
- register(t, e, r, n) {
599
+ register(e, t, r, n) {
600
600
  const c = n.prepend ? "unshift" : "push";
601
- return e[c]({ ctx: this.ctx, callback: r, ...n }), this.ctx.state.collect(t, () => this.unregister(e, r));
601
+ return t[c]({ ctx: this.ctx, callback: r, ...n }), this.ctx.state.collect(e, () => this.unregister(t, r));
602
602
  }
603
- unregister(t, e) {
604
- const r = t.findIndex((n) => n.callback === e);
603
+ unregister(e, t) {
604
+ const r = e.findIndex((n) => n.callback === t);
605
605
  if (r >= 0)
606
- return t.splice(r, 1), !0;
606
+ return e.splice(r, 1), !0;
607
607
  }
608
- on(t, e, r) {
609
- typeof r != "object" && (r = { prepend: r }), this.ctx.scope.assertActive(), e = this.ctx.reflect.bind(e);
610
- const n = this.bail(this.ctx, "internal/listener", t, e, r);
608
+ on(e, t, r) {
609
+ typeof r != "object" && (r = { prepend: r }), this.ctx.scope.assertActive(), t = this.ctx.reflect.bind(t);
610
+ const n = this.bail(this.ctx, "internal/listener", e, t, r);
611
611
  if (n) return n;
612
- const c = this._hooks[t] ||= [], i = typeof t == "string" ? `event <${t}>` : "event (Symbol)";
613
- return this.register(i, c, e, r);
612
+ const c = this._hooks[e] ||= [], i = typeof e == "string" ? `event <${e}>` : "event (Symbol)";
613
+ return this.register(i, c, t, r);
614
614
  }
615
- once(t, e, r) {
616
- const n = this.on(t, function(...c) {
617
- return n(), e.apply(this, c);
615
+ once(e, t, r) {
616
+ const n = this.on(e, function(...c) {
617
+ return n(), t.apply(this, c);
618
618
  }, r);
619
619
  return n;
620
620
  }
621
621
  async start() {
622
622
  this.isActive = !0;
623
- const t = this._hooks.ready || [];
624
- for (; t.length; ) {
625
- const { ctx: e, callback: r } = t.shift();
626
- e.scope.ensure(async () => r());
623
+ const e = this._hooks.ready || [];
624
+ for (; e.length; ) {
625
+ const { ctx: t, callback: r } = e.shift();
626
+ t.scope.ensure(async () => r());
627
627
  }
628
628
  await this.flush();
629
629
  }
630
630
  async stop() {
631
631
  this.isActive = !1, this.ctx.scope.reset();
632
632
  }
633
- }, qt = Ft, Z = class yt extends Error {
634
- constructor(e, r) {
635
- super(r ?? yt.Code[e]), this.code = e;
633
+ }, qe = Me, Je = /* @__PURE__ */ ((e) => (e[e.PENDING = 0] = "PENDING", e[e.LOADING = 1] = "LOADING", e[e.ACTIVE = 2] = "ACTIVE", e[e.FAILED = 3] = "FAILED", e[e.DISPOSED = 4] = "DISPOSED", e))(Je || {}), T = class ye extends Error {
634
+ constructor(t, r) {
635
+ super(r ?? ye.Code[t]), this.code = t;
636
636
  }
637
637
  static {
638
638
  g(this, "CordisError");
639
639
  }
640
640
  };
641
- ((t) => {
642
- t.Code = {
641
+ ((e) => {
642
+ e.Code = {
643
643
  INACTIVE_EFFECT: "cannot create effect on inactive context"
644
644
  };
645
- })(Z || (Z = {}));
646
- var dt = class {
647
- constructor(t, e) {
648
- this.parent = t, this.config = e, this.uid = t.registry ? t.registry.counter : 0, this.ctx = this.context = t.extend({ scope: this }), this.proxy = new Proxy({}, {
645
+ })(T || (T = {}));
646
+ var de = class {
647
+ constructor(e, t) {
648
+ this.parent = e, this.config = t, this.uid = e.registry ? e.registry.counter : 0, this.ctx = this.context = e.extend({ scope: this }), this.proxy = new Proxy({}, {
649
649
  get: /* @__PURE__ */ g((r, n) => Reflect.get(this.config, n), "get")
650
650
  });
651
651
  }
@@ -669,20 +669,20 @@ var dt = class {
669
669
  }
670
670
  assertActive() {
671
671
  if (!(this.uid !== null || this.isActive))
672
- throw new Z("INACTIVE_EFFECT");
672
+ throw new T("INACTIVE_EFFECT");
673
673
  }
674
- effect(t, e) {
674
+ effect(e, t) {
675
675
  this.assertActive();
676
- const r = tt(t) ? new t(this.ctx, e) : t(this.ctx, e);
676
+ const r = ee(e) ? new e(this.ctx, t) : e(this.ctx, t);
677
677
  let n = !1;
678
678
  const c = typeof r == "function" ? r : r.dispose.bind(r), i = /* @__PURE__ */ g((...a) => {
679
679
  if (!n)
680
- return n = !0, D(this.disposables, i), c(...a);
680
+ return n = !0, N(this.disposables, i), c(...a);
681
681
  }, "wrapped");
682
682
  return this.disposables.push(i), typeof r == "function" ? i : (r.dispose = i, r);
683
683
  }
684
- collect(t, e) {
685
- const r = A(() => (D(this.disposables, r), e()), "name", t);
684
+ collect(e, t) {
685
+ const r = A(() => (N(this.disposables, r), t()), "name", e);
686
686
  return this.disposables.push(r), r;
687
687
  }
688
688
  restart() {
@@ -691,51 +691,51 @@ var dt = class {
691
691
  _getStatus() {
692
692
  return this.uid === null ? 4 : this.hasError ? 3 : this.tasks.size ? 1 : this.ready ? 2 : 0;
693
693
  }
694
- updateStatus(t) {
695
- const e = this.status;
696
- t?.(), this.status = this._getStatus(), e !== this.status && this.context.emit("internal/status", this, e);
694
+ updateStatus(e) {
695
+ const t = this.status;
696
+ e?.(), this.status = this._getStatus(), t !== this.status && this.context.emit("internal/status", this, t);
697
697
  }
698
- ensure(t) {
699
- const e = t().catch((r) => {
698
+ ensure(e) {
699
+ const t = e().catch((r) => {
700
700
  this.context.emit(this.ctx, "internal/error", r), this.cancel(r);
701
701
  }).finally(() => {
702
- this.updateStatus(() => this.tasks.delete(e)), this.context.events._tasks.delete(e);
702
+ this.updateStatus(() => this.tasks.delete(t)), this.context.events._tasks.delete(t);
703
703
  });
704
- this.updateStatus(() => this.tasks.add(e)), this.context.events._tasks.add(e);
704
+ this.updateStatus(() => this.tasks.add(t)), this.context.events._tasks.add(t);
705
705
  }
706
- cancel(t) {
707
- this.error = t, this.updateStatus(() => this.hasError = !0), this.reset();
706
+ cancel(e) {
707
+ this.error = e, this.updateStatus(() => this.hasError = !0), this.reset();
708
708
  }
709
709
  get ready() {
710
- return Object.entries(this.runtime.inject).every(([t, e]) => !e.required || !$(this.ctx.get(t)));
710
+ return Object.entries(this.runtime.inject).every(([e, t]) => !t.required || !$(this.ctx.get(e)));
711
711
  }
712
712
  reset() {
713
- this.isActive = !1, this.disposables = this.disposables.splice(0).filter((t) => {
714
- if (this.uid !== null && t[P.static] === this) return !0;
715
- (async () => t())().catch((e) => {
716
- this.context.emit(this.ctx, "internal/error", e);
713
+ this.isActive = !1, this.disposables = this.disposables.splice(0).filter((e) => {
714
+ if (this.uid !== null && e[P.static] === this) return !0;
715
+ (async () => e())().catch((t) => {
716
+ this.context.emit(this.ctx, "internal/error", t);
717
717
  });
718
718
  });
719
719
  }
720
- init(t) {
721
- this.config ? this.start() : this.cancel(t);
720
+ init(e) {
721
+ this.config ? this.start() : this.cancel(e);
722
722
  }
723
723
  start() {
724
724
  if (!this.ready || this.isActive || this.uid === null) return !0;
725
725
  this.isActive = !0, this.updateStatus(() => this.hasError = !1);
726
726
  }
727
- accept(...t) {
728
- const r = { keys: Array.isArray(t[0]) ? t.shift() : null, callback: t[0], ...t[1] };
729
- return this.effect(() => (this.acceptors.push(r), r.immediate && r.callback?.(this.config), () => D(this.acceptors, r)));
727
+ accept(...e) {
728
+ const r = { keys: Array.isArray(e[0]) ? e.shift() : null, callback: e[0], ...e[1] };
729
+ return this.effect(() => (this.acceptors.push(r), r.immediate && r.callback?.(this.config), () => N(this.acceptors, r)));
730
730
  }
731
- decline(t) {
732
- return this.accept(t, () => !0);
731
+ decline(e) {
732
+ return this.accept(e, () => !0);
733
733
  }
734
- checkUpdate(t, e) {
735
- if (e || !this.config) return [!0, !0];
736
- if (e === !1) return [!1, !1];
734
+ checkUpdate(e, t) {
735
+ if (t || !this.config) return [!0, !0];
736
+ if (t === !1) return [!1, !1];
737
737
  const r = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ g((d) => {
738
- const b = r[d] ??= !I(this.config[d], t[d]);
738
+ const b = r[d] ??= !B(this.config[d], e[d]);
739
739
  return i ||= b, b;
740
740
  }, "checkPropertyUpdate"), c = /* @__PURE__ */ new Set();
741
741
  let i = !1, a = !1, y = this.runtime.isReactive || null;
@@ -750,22 +750,22 @@ var dt = class {
750
750
  R ||= n(x);
751
751
  if (!R) continue;
752
752
  }
753
- b?.(t) && (a = !0);
753
+ b?.(e) && (a = !0);
754
754
  }
755
- for (const d in { ...this.config, ...t })
755
+ for (const d in { ...this.config, ...e })
756
756
  if (y !== !1 && !(d in r) && !c.has(d)) {
757
757
  const b = n(d);
758
758
  y === null && (a ||= b);
759
759
  }
760
760
  return [i, a];
761
761
  }
762
- }, Lt = class extends dt {
763
- constructor(t, e, r, n) {
764
- super(t, r), this.runtime = e, this.dispose = A(t.scope.collect(`fork <${t.runtime.name}>`, () => {
762
+ }, Ve = class extends de {
763
+ constructor(e, t, r, n) {
764
+ super(e, r), this.runtime = t, this.dispose = A(e.scope.collect(`fork <${e.runtime.name}>`, () => {
765
765
  this.uid = null, this.reset(), this.context.emit("internal/fork", this);
766
- const c = D(e.disposables, this.dispose);
767
- return D(e.children, this) && !e.children.length && t.registry.delete(e.plugin), c;
768
- }), P.static, e), e.children.push(this), e.disposables.push(this.dispose), this.context.emit("internal/fork", this), this.init(n);
766
+ const c = N(t.disposables, this.dispose);
767
+ return N(t.children, this) && !t.children.length && e.registry.delete(t.plugin), c;
768
+ }), P.static, t), t.children.push(this), t.disposables.push(this.dispose), this.context.emit("internal/fork", this), this.init(n);
769
769
  }
770
770
  static {
771
771
  g(this, "ForkScope");
@@ -773,24 +773,24 @@ var dt = class {
773
773
  dispose;
774
774
  start() {
775
775
  if (super.start()) return !0;
776
- for (const t of this.runtime.forkables)
777
- this.ensure(async () => t(this.context, this._config));
776
+ for (const e of this.runtime.forkables)
777
+ this.ensure(async () => e(this.context, this._config));
778
778
  }
779
- update(t, e) {
779
+ update(e, t) {
780
780
  const r = this.config, n = this.runtime.isForkable ? this : this.runtime;
781
781
  if (n.config !== r) return;
782
782
  let c;
783
783
  try {
784
- c = L(this.runtime.plugin, t);
784
+ c = q(this.runtime.plugin, e);
785
785
  } catch (y) {
786
786
  return this.context.emit("internal/error", y), this.cancel(y);
787
787
  }
788
- const [i, a] = n.checkUpdate(c, e);
789
- this.context.emit("internal/before-update", this, t), this.config = c, n.config = c, i && this.context.emit("internal/update", this, r), a && n.restart();
788
+ const [i, a] = n.checkUpdate(c, t);
789
+ this.context.emit("internal/before-update", this, e), this.config = c, n.config = c, i && this.context.emit("internal/update", this, r), a && n.restart();
790
790
  }
791
- }, ct = class extends dt {
792
- constructor(t, e, r, n) {
793
- super(t, r), this.plugin = e, e ? (this.setup(), this.init(n)) : (this.name = "root", this.isActive = !0);
791
+ }, ce = class extends de {
792
+ constructor(e, t, r, n) {
793
+ super(e, r), this.plugin = t, t ? (this.setup(), this.init(n)) : (this.name = "root", this.isActive = !0);
794
794
  }
795
795
  static {
796
796
  g(this, "MainScope");
@@ -807,37 +807,37 @@ var dt = class {
807
807
  get isForkable() {
808
808
  return this.forkables.length > 0;
809
809
  }
810
- fork(t, e, r) {
811
- return new Lt(t, this, e, r);
810
+ fork(e, t, r) {
811
+ return new Ve(e, this, t, r);
812
812
  }
813
813
  dispose() {
814
814
  return this.uid = null, this.reset(), this.context.emit("internal/runtime", this), !0;
815
815
  }
816
816
  setup() {
817
- const { name: t } = this.plugin;
818
- t && t !== "apply" && (this.name = t), this.schema = this.plugin.Config || this.plugin.schema, this.inject = K.resolve(this.plugin.using || this.plugin.inject), this.isReusable = this.plugin.reusable, this.isReactive = this.plugin.reactive, this.context.emit("internal/runtime", this), this.isReusable && this.forkables.push(this.apply);
817
+ const { name: e } = this.plugin;
818
+ e && e !== "apply" && (this.name = e), this.schema = this.plugin.Config || this.plugin.schema, this.inject = K.resolve(this.plugin.using || this.plugin.inject), this.isReusable = this.plugin.reusable, this.isReactive = this.plugin.reactive, this.context.emit("internal/runtime", this), this.isReusable && this.forkables.push(this.apply);
819
819
  }
820
- apply = /* @__PURE__ */ g((t, e) => {
820
+ apply = /* @__PURE__ */ g((e, t) => {
821
821
  if (typeof this.plugin != "function")
822
- return this.plugin.apply(t, e);
823
- if (tt(this.plugin)) {
824
- const r = new this.plugin(t, e), n = r[P.expose];
825
- return n && t.set(n, r), r.fork && this.forkables.push(r.fork.bind(r)), r;
822
+ return this.plugin.apply(e, t);
823
+ if (ee(this.plugin)) {
824
+ const r = new this.plugin(e, t), n = r[P.expose];
825
+ return n && e.set(n, r), r.fork && this.forkables.push(r.fork.bind(r)), r;
826
826
  } else
827
- return this.plugin(t, e);
827
+ return this.plugin(e, t);
828
828
  }, "apply");
829
829
  reset() {
830
830
  super.reset();
831
- for (const t of this.children)
832
- t.reset();
831
+ for (const e of this.children)
832
+ e.reset();
833
833
  }
834
834
  start() {
835
835
  if (super.start()) return !0;
836
836
  !this.isReusable && this.plugin && this.ensure(async () => this.value = this.apply(this.ctx, this._config));
837
- for (const t of this.children)
838
- t.start();
837
+ for (const e of this.children)
838
+ e.start();
839
839
  }
840
- update(t, e) {
840
+ update(e, t) {
841
841
  if (this.isForkable) {
842
842
  const y = new Error(`attempting to update forkable plugin "${this.plugin.name}", which may lead to unexpected behavior`);
843
843
  this.context.emit(this.ctx, "internal/warning", y);
@@ -845,28 +845,28 @@ var dt = class {
845
845
  const r = this.config;
846
846
  let n;
847
847
  try {
848
- n = L(this.runtime.plugin || this.context.constructor, t);
848
+ n = q(this.runtime.plugin || this.context.constructor, e);
849
849
  } catch (y) {
850
850
  return this.context.emit("internal/error", y), this.cancel(y);
851
851
  }
852
- const [c, i] = this.checkUpdate(n, e), a = this.children.find((y) => y.config === r);
853
- this.config = n, a && (this.context.emit("internal/before-update", a, t), a.config = n, c && this.context.emit("internal/update", a, r)), i && this.restart();
852
+ const [c, i] = this.checkUpdate(n, t), a = this.children.find((y) => y.config === r);
853
+ this.config = n, a && (this.context.emit("internal/before-update", a, e), a.config = n, c && this.context.emit("internal/update", a, r)), i && this.restart();
854
854
  }
855
855
  };
856
- function mt(t) {
857
- return t && typeof t == "object" && typeof t.apply == "function";
856
+ function me(e) {
857
+ return e && typeof e == "object" && typeof e.apply == "function";
858
858
  }
859
- g(mt, "isApplicable");
860
- function K(t) {
861
- return function(e, r) {
859
+ g(me, "isApplicable");
860
+ function K(e) {
861
+ return function(t, r) {
862
862
  if (r.kind === "class")
863
- e.inject = t;
863
+ t.inject = e;
864
864
  else if (r.kind === "method")
865
865
  r.addInitializer(function() {
866
866
  const n = this[h.tracker]?.property;
867
867
  if (!n) throw new Error("missing context tracker");
868
- this[n].inject(t, (c) => {
869
- e.call(F(this, { [n]: c }));
868
+ this[n].inject(e, (c) => {
869
+ t.call(L(this, { [n]: c }));
870
870
  });
871
871
  });
872
872
  else
@@ -874,24 +874,24 @@ function K(t) {
874
874
  };
875
875
  }
876
876
  g(K, "Inject");
877
- ((t) => {
878
- function e(r) {
877
+ ((e) => {
878
+ function t(r) {
879
879
  if (!r) return {};
880
880
  if (Array.isArray(r))
881
881
  return Object.fromEntries(r.map((a) => [a, { required: !0 }]));
882
882
  const { required: n, optional: c, ...i } = r;
883
883
  return Array.isArray(n) && Object.assign(i, Object.fromEntries(n.map((a) => [a, { required: !0 }]))), Array.isArray(c) && Object.assign(i, Object.fromEntries(c.map((a) => [a, { required: !1 }]))), i;
884
884
  }
885
- t.resolve = e, g(e, "resolve");
885
+ e.resolve = t, g(t, "resolve");
886
886
  })(K || (K = {}));
887
- var Jt = class {
888
- constructor(t, e) {
889
- this.ctx = t, A(this, h.tracker, {
887
+ var He = class {
888
+ constructor(e, t) {
889
+ this.ctx = e, A(this, h.tracker, {
890
890
  associate: "registry",
891
891
  property: "ctx"
892
- }), this.context = t;
893
- const r = new ct(t, null, e);
894
- t.scope = r, r.ctx = t, this.set(null, r);
892
+ }), this.context = e;
893
+ const r = new ce(e, null, t);
894
+ e.scope = r, r.ctx = e, this.set(null, r);
895
895
  }
896
896
  static {
897
897
  g(this, "Registry");
@@ -905,27 +905,27 @@ var Jt = class {
905
905
  get size() {
906
906
  return this._internal.size;
907
907
  }
908
- resolve(t, e = !1) {
909
- if (t === null || typeof t == "function") return t;
910
- if (mt(t)) return t.apply;
911
- if (e) throw new Error('invalid plugin, expect function or object with an "apply" method, received ' + typeof t);
908
+ resolve(e, t = !1) {
909
+ if (e === null || typeof e == "function") return e;
910
+ if (me(e)) return e.apply;
911
+ if (t) throw new Error('invalid plugin, expect function or object with an "apply" method, received ' + typeof e);
912
912
  }
913
- get(t) {
914
- const e = this.resolve(t);
915
- return e && this._internal.get(e);
913
+ get(e) {
914
+ const t = this.resolve(e);
915
+ return t && this._internal.get(t);
916
916
  }
917
- has(t) {
918
- const e = this.resolve(t);
919
- return !!e && this._internal.has(e);
917
+ has(e) {
918
+ const t = this.resolve(e);
919
+ return !!t && this._internal.has(t);
920
920
  }
921
- set(t, e) {
922
- const r = this.resolve(t);
923
- this._internal.set(r, e);
921
+ set(e, t) {
922
+ const r = this.resolve(e);
923
+ this._internal.set(r, t);
924
924
  }
925
- delete(t) {
926
- const e = this.resolve(t), r = e && this._internal.get(e);
925
+ delete(e) {
926
+ const t = this.resolve(e), r = t && this._internal.get(t);
927
927
  if (r)
928
- return this._internal.delete(e), r.dispose(), r;
928
+ return this._internal.delete(t), r.dispose(), r;
929
929
  }
930
930
  keys() {
931
931
  return this._internal.keys();
@@ -936,26 +936,26 @@ var Jt = class {
936
936
  entries() {
937
937
  return this._internal.entries();
938
938
  }
939
- forEach(t) {
940
- return this._internal.forEach(t);
939
+ forEach(e) {
940
+ return this._internal.forEach(e);
941
941
  }
942
- using(t, e) {
943
- return this.inject(t, e);
942
+ using(e, t) {
943
+ return this.inject(e, t);
944
944
  }
945
- inject(t, e) {
946
- return this.plugin({ inject: t, apply: e, name: e.name });
945
+ inject(e, t) {
946
+ return this.plugin({ inject: e, apply: t, name: t.name });
947
947
  }
948
- plugin(t, e, r) {
949
- if (this.resolve(t, !0), this.ctx.scope.assertActive(), !r)
948
+ plugin(e, t, r) {
949
+ if (this.resolve(e, !0), this.ctx.scope.assertActive(), !r)
950
950
  try {
951
- e = L(t, e);
951
+ t = q(e, t);
952
952
  } catch (c) {
953
- this.context.emit(this.ctx, "internal/error", c), r = c, e = null;
953
+ this.context.emit(this.ctx, "internal/error", c), r = c, t = null;
954
954
  }
955
- let n = this.get(t);
956
- return n ? (n.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${t.name}`)), n.fork(this.ctx, e, r)) : (n = new ct(this.ctx, t, e, r), this.set(t, n), n.fork(this.ctx, e, r));
955
+ let n = this.get(e);
956
+ return n ? (n.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${e.name}`)), n.fork(this.ctx, t, r)) : (n = new ce(this.ctx, e, t, r), this.set(e, n), n.fork(this.ctx, t, r));
957
957
  }
958
- }, Vt = Jt, P = class M {
958
+ }, Ke = He, P = class F {
959
959
  static {
960
960
  g(this, "Context");
961
961
  }
@@ -969,26 +969,26 @@ var Jt = class {
969
969
  static intercept = h.intercept;
970
970
  static origin = "ctx";
971
971
  static current = "ctx";
972
- static is(e) {
973
- return !!e?.[M.is];
972
+ static is(t) {
973
+ return !!t?.[F.is];
974
974
  }
975
975
  static {
976
- M.is[Symbol.toPrimitive] = () => Symbol.for("cordis.is"), M.prototype[M.is] = !0;
976
+ F.is[Symbol.toPrimitive] = () => Symbol.for("cordis.is"), F.prototype[F.is] = !0;
977
977
  }
978
978
  /** @deprecated use `Service.traceable` instead */
979
- static associate(e, r) {
980
- return e;
979
+ static associate(t, r) {
980
+ return t;
981
981
  }
982
- constructor(e) {
983
- e = L(this.constructor, e), this[h.store] = /* @__PURE__ */ Object.create(null), this[h.isolate] = /* @__PURE__ */ Object.create(null), this[h.internal] = /* @__PURE__ */ Object.create(null), this[h.intercept] = /* @__PURE__ */ Object.create(null);
982
+ constructor(t) {
983
+ t = q(this.constructor, t), this[h.store] = /* @__PURE__ */ Object.create(null), this[h.isolate] = /* @__PURE__ */ Object.create(null), this[h.internal] = /* @__PURE__ */ Object.create(null), this[h.intercept] = /* @__PURE__ */ Object.create(null);
984
984
  const r = new Proxy(this, Q.handler);
985
- r.root = r, r.reflect = new Q(r), r.registry = new Vt(r, e), r.lifecycle = new qt(r);
985
+ r.root = r, r.reflect = new Q(r), r.registry = new Ke(r, t), r.lifecycle = new qe(r);
986
986
  const n = /* @__PURE__ */ g((c) => {
987
987
  if (c) {
988
988
  n(Object.getPrototypeOf(c));
989
989
  for (const i of Object.getOwnPropertyNames(c)) {
990
990
  const a = c[i].prototype?.constructor;
991
- a && (r[c[i].key] = new a(r, e), A(r[c[i].key], "ctx", r));
991
+ a && (r[c[i].key] = new a(r, t), A(r[c[i].key], "ctx", r));
992
992
  }
993
993
  }
994
994
  }, "attach");
@@ -998,10 +998,10 @@ var Jt = class {
998
998
  return `Context <${this.name}>`;
999
999
  }
1000
1000
  get name() {
1001
- let e = this.runtime;
1002
- for (; e && !e.name; )
1003
- e = e.parent.runtime;
1004
- return e?.name;
1001
+ let t = this.runtime;
1002
+ for (; t && !t.name; )
1003
+ t = t.parent.runtime;
1004
+ return t?.name;
1005
1005
  }
1006
1006
  get events() {
1007
1007
  return this.lifecycle;
@@ -1010,21 +1010,21 @@ var Jt = class {
1010
1010
  get state() {
1011
1011
  return this.scope;
1012
1012
  }
1013
- extend(e = {}) {
1014
- const r = Reflect.getOwnPropertyDescriptor(this, h.shadow)?.value, n = Object.assign(Object.create(C(this, this)), e);
1013
+ extend(t = {}) {
1014
+ const r = Reflect.getOwnPropertyDescriptor(this, h.shadow)?.value, n = Object.assign(Object.create(D(this, this)), t);
1015
1015
  return r ? Object.assign(Object.create(n), { [h.shadow]: r }) : n;
1016
1016
  }
1017
- isolate(e, r) {
1017
+ isolate(t, r) {
1018
1018
  const n = Object.create(this[h.isolate]);
1019
- return n[e] = r ?? Symbol(e), this.extend({ [h.isolate]: n });
1019
+ return n[t] = r ?? Symbol(t), this.extend({ [h.isolate]: n });
1020
1020
  }
1021
- intercept(e, r) {
1021
+ intercept(t, r) {
1022
1022
  const n = Object.create(this[h.intercept]);
1023
- return n[e] = r, this.extend({ [h.intercept]: n });
1023
+ return n[t] = r, this.extend({ [h.intercept]: n });
1024
1024
  }
1025
1025
  };
1026
1026
  P.prototype[P.internal] = /* @__PURE__ */ Object.create(null);
1027
- var Qt = class bt {
1027
+ var Te = class be {
1028
1028
  static {
1029
1029
  g(this, "Service");
1030
1030
  }
@@ -1041,40 +1041,40 @@ var Qt = class bt {
1041
1041
  ctx;
1042
1042
  name;
1043
1043
  config;
1044
- constructor(...e) {
1044
+ constructor(...t) {
1045
1045
  let r, n, c, i;
1046
- P.is(e[0]) ? (r = e[0], typeof e[1] == "string" ? (n = e[1], c = e[2]) : i = e[1]) : i = e[0], n ??= this.constructor[h.provide], c ??= this.constructor[h.immediate];
1046
+ P.is(t[0]) ? (r = t[0], typeof t[1] == "string" ? (n = t[1], c = t[2]) : i = t[1]) : i = t[0], n ??= this.constructor[h.provide], c ??= this.constructor[h.immediate];
1047
1047
  let a = this;
1048
1048
  const y = {
1049
1049
  associate: n,
1050
1050
  property: "ctx"
1051
1051
  };
1052
- return a[h.invoke] && (a = Y(n, et(Object.getPrototypeOf(this), Function.prototype), y)), r ? a.ctx = r : a[h.setup](), a.name = n, a.config = i, A(a, h.tracker, y), a.ctx.provide(n), a.ctx.runtime.name = n, c && (r ? a[h.expose] = n : a.ctx.set(n, a)), a.ctx.on("ready", async () => {
1052
+ return a[h.invoke] && (a = Y(n, te(Object.getPrototypeOf(this), Function.prototype), y)), r ? a.ctx = r : a[h.setup](), a.name = n, a.config = i, A(a, h.tracker, y), a.ctx.provide(n), a.ctx.runtime.name = n, c && (r ? a[h.expose] = n : a.ctx.set(n, a)), a.ctx.on("ready", async () => {
1053
1053
  await Promise.resolve(), await a.start(), c || a.ctx.set(n, a);
1054
1054
  }), a.ctx.on("dispose", () => a.stop()), a;
1055
1055
  }
1056
- [h.filter](e) {
1057
- return e[h.isolate][this.name] === this.ctx[h.isolate][this.name];
1056
+ [h.filter](t) {
1057
+ return t[h.isolate][this.name] === this.ctx[h.isolate][this.name];
1058
1058
  }
1059
1059
  [h.setup]() {
1060
1060
  this.ctx = new P();
1061
1061
  }
1062
- [h.extend](e) {
1062
+ [h.extend](t) {
1063
1063
  let r;
1064
- return this[bt.invoke] ? r = Y(this.name, this, this[h.tracker]) : r = Object.create(this), Object.assign(r, e);
1064
+ return this[be.invoke] ? r = Y(this.name, this, this[h.tracker]) : r = Object.create(this), Object.assign(r, t);
1065
1065
  }
1066
- static [Symbol.hasInstance](e) {
1067
- let r = e.constructor;
1066
+ static [Symbol.hasInstance](t) {
1067
+ let r = t.constructor;
1068
1068
  for (; r; ) {
1069
1069
  if (r = r.prototype?.constructor, r === this) return !0;
1070
1070
  r = Object.getPrototypeOf(r);
1071
1071
  }
1072
1072
  return !1;
1073
1073
  }
1074
- }, Ht = Object.defineProperty, Kt = Object.getOwnPropertyNames, S = (t, e) => Ht(t, "name", { value: e, configurable: !0 }), Gt = (t, e) => function() {
1075
- return e || (0, t[Kt(t)[0]])((e = { exports: {} }).exports, e), e.exports;
1076
- }, Wt = Gt({
1077
- "src/index.ts"(t, e) {
1074
+ }, Ge = Object.defineProperty, We = Object.getOwnPropertyNames, k = (e, t) => Ge(e, "name", { value: t, configurable: !0 }), Ye = (e, t) => function() {
1075
+ return t || (0, e[We(e)[0]])((t = { exports: {} }).exports, t), t.exports;
1076
+ }, Qe = Ye({
1077
+ "src/index.ts"(e, t) {
1078
1078
  var r = Symbol.for("schemastery"), n = Symbol.for("ValidationError");
1079
1079
  globalThis.__schemastery_index__ ??= 0;
1080
1080
  var c = class extends TypeError {
@@ -1085,7 +1085,7 @@ var Qt = class bt {
1085
1085
  f.startsWith(".") && (f = f.slice(1)), super((f === "$" ? "" : `${f} `) + o), this.options = s;
1086
1086
  }
1087
1087
  static {
1088
- S(this, "ValidationError");
1088
+ k(this, "ValidationError");
1089
1089
  }
1090
1090
  name = "ValidationError";
1091
1091
  static is(o) {
@@ -1095,15 +1095,15 @@ var Qt = class bt {
1095
1095
  Object.defineProperty(c.prototype, n, {
1096
1096
  value: !0
1097
1097
  });
1098
- var i = /* @__PURE__ */ S(function(o) {
1099
- const s = /* @__PURE__ */ S(function(f, u = {}) {
1098
+ var i = /* @__PURE__ */ k(function(o) {
1099
+ const s = /* @__PURE__ */ k(function(f, u = {}) {
1100
1100
  return i.resolve(f, s, u)[0];
1101
1101
  }, "schema");
1102
1102
  if (o.refs) {
1103
- const f = N(o.refs, (l) => new i(l)), u = /* @__PURE__ */ S((l) => f[l], "getRef");
1103
+ const f = C(o.refs, (l) => new i(l)), u = /* @__PURE__ */ k((l) => f[l], "getRef");
1104
1104
  for (const l in f) {
1105
1105
  const p = f[l];
1106
- p.sKey = u(p.sKey), p.inner = u(p.inner), p.list = p.list && p.list.map(u), p.dict = p.dict && N(p.dict, u);
1106
+ p.sKey = u(p.sKey), p.inner = u(p.inner), p.list = p.list && p.list.map(u), p.dict = p.dict && C(p.dict, u);
1107
1107
  }
1108
1108
  return f[o.uid];
1109
1109
  }
@@ -1116,15 +1116,15 @@ var Qt = class bt {
1116
1116
  }, "Schema");
1117
1117
  i.prototype = Object.create(Function.prototype), i.prototype[r] = !0, i.ValidationError = c;
1118
1118
  var a;
1119
- i.prototype.toJSON = /* @__PURE__ */ S(function() {
1119
+ i.prototype.toJSON = /* @__PURE__ */ k(function() {
1120
1120
  if (a)
1121
1121
  return a[this.uid] ??= JSON.parse(JSON.stringify({ ...this })), this.uid;
1122
1122
  a = { [this.uid]: { ...this } }, a[this.uid] = JSON.parse(JSON.stringify({ ...this }));
1123
1123
  const s = { uid: this.uid, refs: a };
1124
1124
  return a = void 0, s;
1125
- }, "toJSON"), i.prototype.set = /* @__PURE__ */ S(function(s, f) {
1125
+ }, "toJSON"), i.prototype.set = /* @__PURE__ */ k(function(s, f) {
1126
1126
  return this.dict[s] = f, this;
1127
- }, "set"), i.prototype.push = /* @__PURE__ */ S(function(s) {
1127
+ }, "set"), i.prototype.push = /* @__PURE__ */ k(function(s) {
1128
1128
  return this.list.push(s), this;
1129
1129
  }, "push");
1130
1130
  function y(o, s) {
@@ -1135,18 +1135,18 @@ var Qt = class bt {
1135
1135
  }
1136
1136
  return f;
1137
1137
  }
1138
- S(y, "mergeDesc");
1138
+ k(y, "mergeDesc");
1139
1139
  function d(o) {
1140
1140
  return o?.$value ?? o?.$inner;
1141
1141
  }
1142
- S(d, "getInner");
1142
+ k(d, "getInner");
1143
1143
  function b(o) {
1144
- return ft(o ?? {}, (s) => !s.startsWith("$"));
1144
+ return fe(o ?? {}, (s) => !s.startsWith("$"));
1145
1145
  }
1146
- S(b, "extractKeys"), i.prototype.i18n = /* @__PURE__ */ S(function(s) {
1146
+ k(b, "extractKeys"), i.prototype.i18n = /* @__PURE__ */ k(function(s) {
1147
1147
  const f = i(this), u = y(f.meta.description, s);
1148
- return Object.keys(u).length && (f.meta.description = u), f.dict && (f.dict = N(f.dict, (l, p) => l.i18n(N(s, (m) => d(m)?.[p] ?? m?.[p])))), f.list && (f.list = f.list.map((l, p) => l.i18n(N(s, (m = {}) => Array.isArray(d(m)) ? d(m)[p] : Array.isArray(m) ? m[p] : b(m))))), f.inner && (f.inner = f.inner.i18n(N(s, (l) => d(l) ? d(l) : b(l)))), f.sKey && (f.sKey = f.sKey.i18n(N(s, (l) => l?.$key))), f;
1149
- }, "i18n"), i.prototype.extra = /* @__PURE__ */ S(function(s, f) {
1148
+ return Object.keys(u).length && (f.meta.description = u), f.dict && (f.dict = C(f.dict, (l, p) => l.i18n(C(s, (m) => d(m)?.[p] ?? m?.[p])))), f.list && (f.list = f.list.map((l, p) => l.i18n(C(s, (m = {}) => Array.isArray(d(m)) ? d(m)[p] : Array.isArray(m) ? m[p] : b(m))))), f.inner && (f.inner = f.inner.i18n(C(s, (l) => d(l) ? d(l) : b(l)))), f.sKey && (f.sKey = f.sKey.i18n(C(s, (l) => l?.$key))), f;
1149
+ }, "i18n"), i.prototype.extra = /* @__PURE__ */ k(function(s, f) {
1150
1150
  const u = i(this);
1151
1151
  return u.meta = { ...u.meta, [s]: f }, u;
1152
1152
  }, "extra");
@@ -1157,17 +1157,17 @@ var Qt = class bt {
1157
1157
  return f.meta = { ...f.meta, [o]: s }, f;
1158
1158
  }
1159
1159
  });
1160
- i.prototype.deprecated = /* @__PURE__ */ S(function() {
1160
+ i.prototype.deprecated = /* @__PURE__ */ k(function() {
1161
1161
  const s = i(this);
1162
1162
  return s.meta.badges ||= [], s.meta.badges.push({ text: "deprecated", type: "danger" }), s;
1163
- }, "deprecated"), i.prototype.experimental = /* @__PURE__ */ S(function() {
1163
+ }, "deprecated"), i.prototype.experimental = /* @__PURE__ */ k(function() {
1164
1164
  const s = i(this);
1165
1165
  return s.meta.badges ||= [], s.meta.badges.push({ text: "experimental", type: "warning" }), s;
1166
- }, "experimental"), i.prototype.pattern = /* @__PURE__ */ S(function(s) {
1167
- const f = i(this), u = at(s, ["source", "flags"]);
1166
+ }, "experimental"), i.prototype.pattern = /* @__PURE__ */ k(function(s) {
1167
+ const f = i(this), u = ae(s, ["source", "flags"]);
1168
1168
  return f.meta = { ...f.meta, pattern: u }, f;
1169
- }, "pattern"), i.prototype.simplify = /* @__PURE__ */ S(function(s) {
1170
- if (I(s, this.meta.default, this.type === "dict")) return null;
1169
+ }, "pattern"), i.prototype.simplify = /* @__PURE__ */ k(function(s) {
1170
+ if (B(s, this.meta.default, this.type === "dict")) return null;
1171
1171
  if ($(s)) return s;
1172
1172
  if (this.type === "object" || this.type === "dict") {
1173
1173
  const f = {};
@@ -1175,7 +1175,7 @@ var Qt = class bt {
1175
1175
  const p = (this.type === "object" ? this.dict[u] : this.inner)?.simplify(s[u]);
1176
1176
  (this.type === "dict" || !$(p)) && (f[u] = p);
1177
1177
  }
1178
- return I(f, this.meta.default, this.type === "dict") ? null : f;
1178
+ return B(f, this.meta.default, this.type === "dict") ? null : f;
1179
1179
  } else if (this.type === "array" || this.type === "tuple") {
1180
1180
  const f = [];
1181
1181
  return s.forEach((u, l) => {
@@ -1194,9 +1194,9 @@ var Qt = class bt {
1194
1194
  } catch {
1195
1195
  }
1196
1196
  return s;
1197
- }, "simplify"), i.prototype.toString = /* @__PURE__ */ S(function(s) {
1198
- return it[this.type]?.(this, s) ?? `Schema<${this.type}>`;
1199
- }, "toString"), i.prototype.role = /* @__PURE__ */ S(function(o, s) {
1197
+ }, "simplify"), i.prototype.toString = /* @__PURE__ */ k(function(s) {
1198
+ return ie[this.type]?.(this, s) ?? `Schema<${this.type}>`;
1199
+ }, "toString"), i.prototype.role = /* @__PURE__ */ k(function(o, s) {
1200
1200
  const f = i(this);
1201
1201
  return f.meta = { ...f.meta, role: o, extra: s }, f;
1202
1202
  }, "role");
@@ -1208,18 +1208,18 @@ var Qt = class bt {
1208
1208
  }
1209
1209
  });
1210
1210
  var j = {};
1211
- i.extend = /* @__PURE__ */ S(function(s, f) {
1211
+ i.extend = /* @__PURE__ */ k(function(s, f) {
1212
1212
  j[s] = f;
1213
- }, "extend"), i.resolve = /* @__PURE__ */ S(function(s, f, u = {}, l = !1) {
1213
+ }, "extend"), i.resolve = /* @__PURE__ */ k(function(s, f, u = {}, l = !1) {
1214
1214
  if (!f) return [s];
1215
1215
  if (u.ignore?.(s, f)) return [s];
1216
1216
  if ($(s) && f.type !== "lazy") {
1217
1217
  if (f.meta.required) throw new c("missing required value", u);
1218
- let m = f, O = f.meta.default;
1219
- for (; m?.type === "intersect" && $(O); )
1220
- m = m.list[0], O = m?.meta.default;
1221
- if ($(O)) return [s];
1222
- s = V(O);
1218
+ let m = f, S = f.meta.default;
1219
+ for (; m?.type === "intersect" && $(S); )
1220
+ m = m.list[0], S = m?.meta.default;
1221
+ if ($(S)) return [s];
1222
+ s = V(S);
1223
1223
  }
1224
1224
  const p = j[f.type];
1225
1225
  if (!p) throw new c(`unsupported type "${f.type}"`, u);
@@ -1229,7 +1229,7 @@ var Qt = class bt {
1229
1229
  if (!f.meta.loose) throw m;
1230
1230
  return [f.meta.default];
1231
1231
  }
1232
- }, "resolve"), i.from = /* @__PURE__ */ S(function(s) {
1232
+ }, "resolve"), i.from = /* @__PURE__ */ k(function(s) {
1233
1233
  if ($(s))
1234
1234
  return i.any();
1235
1235
  if (["string", "number", "boolean"].includes(typeof s))
@@ -1251,14 +1251,14 @@ var Qt = class bt {
1251
1251
  }
1252
1252
  else
1253
1253
  throw new TypeError(`cannot infer schema from ${s}`);
1254
- }, "from"), i.lazy = /* @__PURE__ */ S(function(s) {
1255
- const f = /* @__PURE__ */ S(() => (u.inner[r] || (u.inner = u.builder(), u.inner.meta = { ...u.meta, ...u.inner.meta }), u.inner.toJSON()), "toJSON"), u = new i({ type: "lazy", builder: s, inner: { toJSON: f } });
1254
+ }, "from"), i.lazy = /* @__PURE__ */ k(function(s) {
1255
+ const f = /* @__PURE__ */ k(() => (u.inner[r] || (u.inner = u.builder(), u.inner.meta = { ...u.meta, ...u.inner.meta }), u.inner.toJSON()), "toJSON"), u = new i({ type: "lazy", builder: s, inner: { toJSON: f } });
1256
1256
  return u;
1257
- }, "lazy"), i.natural = /* @__PURE__ */ S(function() {
1257
+ }, "lazy"), i.natural = /* @__PURE__ */ k(function() {
1258
1258
  return i.number().step(1).min(0);
1259
- }, "natural"), i.percent = /* @__PURE__ */ S(function() {
1259
+ }, "natural"), i.percent = /* @__PURE__ */ k(function() {
1260
1260
  return i.number().step(0.01).min(0).max(1).role("slider");
1261
- }, "percent"), i.date = /* @__PURE__ */ S(function() {
1261
+ }, "percent"), i.date = /* @__PURE__ */ k(function() {
1262
1262
  return i.union([
1263
1263
  i.is(Date),
1264
1264
  i.transform(i.string().role("datetime"), (s, f) => {
@@ -1267,7 +1267,7 @@ var Qt = class bt {
1267
1267
  return u;
1268
1268
  }, !0)
1269
1269
  ]);
1270
- }, "date"), i.regExp = /* @__PURE__ */ S(function(s = "") {
1270
+ }, "date"), i.regExp = /* @__PURE__ */ k(function(s = "") {
1271
1271
  return i.union([
1272
1272
  i.is(RegExp),
1273
1273
  i.transform(i.string().role("regexp", { flag: s }), (f, u) => {
@@ -1278,7 +1278,7 @@ var Qt = class bt {
1278
1278
  }
1279
1279
  }, !0)
1280
1280
  ]);
1281
- }, "regExp"), i.arrayBuffer = /* @__PURE__ */ S(function(s) {
1281
+ }, "regExp"), i.arrayBuffer = /* @__PURE__ */ k(function(s) {
1282
1282
  return i.union([
1283
1283
  i.is(ArrayBuffer),
1284
1284
  i.is(SharedArrayBuffer),
@@ -1297,21 +1297,21 @@ var Qt = class bt {
1297
1297
  }, "arrayBuffer"), i.extend("lazy", (o, s, f, u) => (s.inner[r] || (s.inner = s.builder(), s.inner.meta = { ...s.meta, ...s.inner.meta }), i.resolve(o, s.inner, f, u))), i.extend("any", (o) => [o]), i.extend("never", (o, s, f) => {
1298
1298
  throw new c(`expected nullable but got ${o}`, f);
1299
1299
  }), i.extend("const", (o, { value: s }, f) => {
1300
- if (I(o, s)) return [s];
1300
+ if (B(o, s)) return [s];
1301
1301
  throw new c(`expected ${s} but got ${o}`, f);
1302
1302
  });
1303
- function k(o, s, f, u, l = !1) {
1303
+ function O(o, s, f, u, l = !1) {
1304
1304
  const { max: p = 1 / 0, min: m = -1 / 0 } = s;
1305
1305
  if (o > p) throw new c(`expected ${f} <= ${p} but got ${o}`, u);
1306
1306
  if (o < m && !l) throw new c(`expected ${f} >= ${m} but got ${o}`, u);
1307
1307
  }
1308
- S(k, "checkWithinRange"), i.extend("string", (o, { meta: s }, f) => {
1308
+ k(O, "checkWithinRange"), i.extend("string", (o, { meta: s }, f) => {
1309
1309
  if (typeof o != "string") throw new c(`expected string but got ${o}`, f);
1310
1310
  if (s.pattern) {
1311
1311
  const u = new RegExp(s.pattern.source, s.pattern.flags);
1312
1312
  if (!u.test(o)) throw new c(`expect string to match regexp ${u}`, f);
1313
1313
  }
1314
- return k(o.length, s, "string length", f), [o];
1314
+ return O(o.length, s, "string length", f), [o];
1315
1315
  });
1316
1316
  function R(o, s) {
1317
1317
  const f = o.toString();
@@ -1321,16 +1321,16 @@ var Qt = class bt {
1321
1321
  const l = f.slice(u + 1), p = f.slice(0, u);
1322
1322
  return l.length <= s ? +(p + l.padEnd(s, "0")) : +(p + l.slice(0, s) + "." + l.slice(s));
1323
1323
  }
1324
- S(R, "decimalShift");
1324
+ k(R, "decimalShift");
1325
1325
  function x(o, s, f) {
1326
1326
  if (f = Math.abs(f), !/^\d+\.\d+$/.test(f.toString()))
1327
1327
  return (o - s) % f === 0;
1328
1328
  const u = f.toString().indexOf("."), l = f.toString().slice(u + 1).length;
1329
1329
  return Math.abs(R(o, l) - R(s, l)) % R(f, l) === 0;
1330
1330
  }
1331
- S(x, "isMultipleOf"), i.extend("number", (o, { meta: s }, f) => {
1331
+ k(x, "isMultipleOf"), i.extend("number", (o, { meta: s }, f) => {
1332
1332
  if (typeof o != "number") throw new c(`expected number but got ${o}`, f);
1333
- k(o, s, "number", f);
1333
+ O(o, s, "number", f);
1334
1334
  const { step: u } = s;
1335
1335
  if (u && !x(o, s.min ?? 0, u))
1336
1336
  throw new c(`expected number multiple of ${u} but got ${o}`, f);
@@ -1383,21 +1383,21 @@ var Qt = class bt {
1383
1383
  return delete o[s], f.meta.default;
1384
1384
  }
1385
1385
  }
1386
- S(v, "property"), i.extend("array", (o, { inner: s, meta: f }, u) => {
1386
+ k(v, "property"), i.extend("array", (o, { inner: s, meta: f }, u) => {
1387
1387
  if (!Array.isArray(o)) throw new c(`expected array but got ${o}`, u);
1388
- return k(o.length, f, "array length", u, !$(s.meta.default)), [o.map((l, p) => v(o, p, s, u))];
1388
+ return O(o.length, f, "array length", u, !$(s.meta.default)), [o.map((l, p) => v(o, p, s, u))];
1389
1389
  }), i.extend("dict", (o, { inner: s, sKey: f }, u, l) => {
1390
1390
  if (!J(o)) throw new c(`expected object but got ${o}`, u);
1391
1391
  const p = {};
1392
1392
  for (const m in o) {
1393
- let O;
1393
+ let S;
1394
1394
  try {
1395
- O = i.resolve(m, f, u)[0];
1396
- } catch (gt) {
1395
+ S = i.resolve(m, f, u)[0];
1396
+ } catch (we) {
1397
1397
  if (l) continue;
1398
- throw gt;
1398
+ throw we;
1399
1399
  }
1400
- p[O] = v(o, m, s, u), o[O] = o[m], m !== O && delete o[m];
1400
+ p[S] = v(o, m, s, u), o[S] = o[m], m !== S && delete o[m];
1401
1401
  }
1402
1402
  return [p];
1403
1403
  }), i.extend("tuple", (o, { list: s }, f, u) => {
@@ -1405,18 +1405,18 @@ var Qt = class bt {
1405
1405
  const l = s.map((p, m) => v(o, m, p, f));
1406
1406
  return u ? [l] : (l.push(...o.slice(s.length)), [l]);
1407
1407
  });
1408
- function z(o, s) {
1408
+ function U(o, s) {
1409
1409
  for (const f in s)
1410
1410
  f in o || (o[f] = s[f]);
1411
1411
  }
1412
- S(z, "merge"), i.extend("object", (o, { dict: s }, f, u) => {
1412
+ k(U, "merge"), i.extend("object", (o, { dict: s }, f, u) => {
1413
1413
  if (!J(o)) throw new c(`expected object but got ${o}`, f);
1414
1414
  const l = {};
1415
1415
  for (const p in s) {
1416
1416
  const m = v(o, p, s[p], f);
1417
1417
  (!$(m) || p in o) && (l[p] = m);
1418
1418
  }
1419
- return u || z(l, o), [l];
1419
+ return u || U(l, o), [l];
1420
1420
  }), i.extend("union", (o, { list: s, toString: f }, u, l) => {
1421
1421
  for (const p of s)
1422
1422
  try {
@@ -1428,27 +1428,27 @@ var Qt = class bt {
1428
1428
  if (!s.length) return [o];
1429
1429
  let p;
1430
1430
  for (const m of s) {
1431
- const O = i.resolve(o, m, u, !0)[0];
1432
- if (!$(O))
1431
+ const S = i.resolve(o, m, u, !0)[0];
1432
+ if (!$(S))
1433
1433
  if ($(p))
1434
- p = O;
1434
+ p = S;
1435
1435
  else {
1436
- if (typeof p != typeof O)
1436
+ if (typeof p != typeof S)
1437
1437
  throw new c(`expected ${f()} but got ${JSON.stringify(o)}`, u);
1438
- if (typeof O == "object")
1439
- z(p ??= {}, O);
1440
- else if (p !== O)
1438
+ if (typeof S == "object")
1439
+ U(p ??= {}, S);
1440
+ else if (p !== S)
1441
1441
  throw new c(`expected ${f()} but got ${JSON.stringify(o)}`, u);
1442
1442
  }
1443
1443
  }
1444
- return !l && J(o) && z(p, o), [p];
1444
+ return !l && J(o) && U(p, o), [p];
1445
1445
  }), i.extend("transform", (o, { inner: s, callback: f, preserve: u }, l) => {
1446
1446
  const [p, m = o] = i.resolve(o, s, l, !0);
1447
1447
  return u ? [f(p)] : [f(p), f(m)];
1448
1448
  });
1449
- var it = {};
1449
+ var ie = {};
1450
1450
  function _(o, s, f) {
1451
- it[o] = f, Object.assign(i, {
1451
+ ie[o] = f, Object.assign(i, {
1452
1452
  [o](...u) {
1453
1453
  const l = new i({ type: o });
1454
1454
  return s.forEach((p, m) => {
@@ -1463,22 +1463,22 @@ var Qt = class bt {
1463
1463
  l.list = u[m].map(i.from);
1464
1464
  break;
1465
1465
  case "dict":
1466
- l.dict = N(u[m], i.from);
1466
+ l.dict = C(u[m], i.from);
1467
1467
  break;
1468
1468
  case "bits": {
1469
1469
  l.bits = {};
1470
- for (const O in u[m])
1471
- typeof u[m][O] == "number" && (l.bits[O] = u[m][O]);
1470
+ for (const S in u[m])
1471
+ typeof u[m][S] == "number" && (l.bits[S] = u[m][S]);
1472
1472
  break;
1473
1473
  }
1474
1474
  case "callback": {
1475
- const O = l.callback = u[m];
1476
- O.toJSON ||= () => O.toString();
1475
+ const S = l.callback = u[m];
1476
+ S.toJSON ||= () => S.toString();
1477
1477
  break;
1478
1478
  }
1479
1479
  case "constructor": {
1480
- const O = l.constructor = u[m];
1481
- typeof O == "function" && (O.toJSON ||= () => O.name);
1480
+ const S = l.constructor = u[m];
1481
+ typeof S == "function" && (S.toJSON ||= () => S.name);
1482
1482
  break;
1483
1483
  }
1484
1484
  default:
@@ -1488,20 +1488,44 @@ var Qt = class bt {
1488
1488
  }
1489
1489
  });
1490
1490
  }
1491
- S(_, "defineMethod"), _("is", ["constructor"], ({ constructor: o }) => typeof o == "function" ? o.name : o), _("any", [], () => "any"), _("never", [], () => "never"), _("const", ["value"], ({ value: o }) => typeof o == "string" ? JSON.stringify(o) : o), _("string", [], () => "string"), _("number", [], () => "number"), _("boolean", [], () => "boolean"), _("bitset", ["bits"], () => "bitset"), _("function", [], () => "function"), _("array", ["inner"], ({ inner: o }) => `${o.toString(!0)}[]`), _("dict", ["inner", "sKey"], ({ inner: o, sKey: s }) => `{ [key: ${s.toString()}]: ${o.toString()} }`), _("tuple", ["list"], ({ list: o }) => `[${o.map((s) => s.toString()).join(", ")}]`), _("object", ["dict"], ({ dict: o }) => Object.keys(o).length === 0 ? "{}" : `{ ${Object.entries(o).map(([s, f]) => `${s}${f.meta.required ? "" : "?"}: ${f.toString()}`).join(", ")} }`), _("union", ["list"], ({ list: o }, s) => {
1491
+ k(_, "defineMethod"), _("is", ["constructor"], ({ constructor: o }) => typeof o == "function" ? o.name : o), _("any", [], () => "any"), _("never", [], () => "never"), _("const", ["value"], ({ value: o }) => typeof o == "string" ? JSON.stringify(o) : o), _("string", [], () => "string"), _("number", [], () => "number"), _("boolean", [], () => "boolean"), _("bitset", ["bits"], () => "bitset"), _("function", [], () => "function"), _("array", ["inner"], ({ inner: o }) => `${o.toString(!0)}[]`), _("dict", ["inner", "sKey"], ({ inner: o, sKey: s }) => `{ [key: ${s.toString()}]: ${o.toString()} }`), _("tuple", ["list"], ({ list: o }) => `[${o.map((s) => s.toString()).join(", ")}]`), _("object", ["dict"], ({ dict: o }) => Object.keys(o).length === 0 ? "{}" : `{ ${Object.entries(o).map(([s, f]) => `${s}${f.meta.required ? "" : "?"}: ${f.toString()}`).join(", ")} }`), _("union", ["list"], ({ list: o }, s) => {
1492
1492
  const f = o.map(({ toString: u }) => u()).join(" | ");
1493
1493
  return s ? `(${f})` : f;
1494
- }), _("intersect", ["list"], ({ list: o }) => `${o.map((s) => s.toString(!0)).join(" & ")}`), _("transform", ["inner", "callback", "preserve"], ({ inner: o }, s) => o.toString(s)), e.exports = i;
1494
+ }), _("intersect", ["list"], ({ list: o }) => `${o.map((s) => s.toString(!0)).join(" & ")}`), _("transform", ["inner", "callback", "preserve"], ({ inner: o }, s) => o.toString(s)), t.exports = i;
1495
1495
  }
1496
1496
  });
1497
- const Xt = Wt();
1498
- var Yt = /* @__PURE__ */ ((t) => (t.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api/v6", t.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", t.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", t.HOME_URL = "https://www.ipe.wiki/", t.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", t.PLUGIN_REGISTRY_URL = "https://registry.ipe.wiki/registry.v1.json", t))(Yt || {});
1497
+ const Xe = Qe();
1498
+ var Ze = /* @__PURE__ */ ((e) => (e.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api/v6", e.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", e.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", e.GITHUB_OWNER = "inpageedit", e.GITHUB_REPO = "inpageedit-next", e.HOME_URL = "https://www.ipe.wiki/", e.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", e.PLUGIN_REGISTRY_URL = "https://registry.ipe.wiki/registry.v1.json", e.I18N_INDEX_URL = "https://registry.ipe.wiki/i18n/index.json", e.QQ_GROUP_ID = "1026023666", e))(Ze || {});
1499
+ function ge(e) {
1500
+ return e.charAt(0).toLowerCase() + e.slice(1);
1501
+ }
1502
+ function et(e) {
1503
+ return ge(e).replace(/_/g, "-").replace(/.[A-Z]+/g, (t) => t[0] + "-" + t.slice(1).toLowerCase());
1504
+ }
1505
+ function tt(e) {
1506
+ return ge(e).replace(/-/g, "_").replace(/.[A-Z]+/g, (t) => t[0] + "_" + t.slice(1).toLowerCase());
1507
+ }
1508
+ function rt(e) {
1509
+ return function(t) {
1510
+ return t.PreferencesSchema = e, t;
1511
+ };
1512
+ }
1499
1513
  export {
1500
- P as C,
1501
- Yt as E,
1514
+ T as C,
1515
+ Ze as E,
1516
+ Ve as F,
1502
1517
  K as I,
1503
- Xt as S,
1504
- Qt as a,
1505
- wt as p
1518
+ ce as M,
1519
+ rt as R,
1520
+ Xe as S,
1521
+ de as a,
1522
+ Je as b,
1523
+ Te as c,
1524
+ xe as d,
1525
+ qe as e,
1526
+ tt as f,
1527
+ P as g,
1528
+ et as p,
1529
+ h as s
1506
1530
  };
1507
- //# sourceMappingURL=endpoints-DgyuoRZd.js.map
1531
+ //# sourceMappingURL=Preferences-85Q9FAmb.js.map