@fest-lib/object 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -10
- package/dist/object.js +230 -230
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -405,16 +405,15 @@ Legacy function for creating reactive Sets.
|
|
|
405
405
|
|
|
406
406
|
## Modules
|
|
407
407
|
|
|
408
|
-
- [core/Assigned](
|
|
409
|
-
- [core/
|
|
410
|
-
- [core/
|
|
411
|
-
- [core/
|
|
412
|
-
- [core/
|
|
413
|
-
- [
|
|
414
|
-
- [
|
|
415
|
-
- [wrap/
|
|
416
|
-
- [wrap/
|
|
417
|
-
- [wrap/Utils](docs/wrap/Utils/README.md) - Utility functions and types
|
|
408
|
+
- [core/Assigned](src/core/Assigned.ts) - Assignment and binding utilities
|
|
409
|
+
- [core/Mainline](src/core/Mainline.ts) - Core subscription and reactivity system
|
|
410
|
+
- [core/Primitives](src/core/Primitives.ts) - Primitive reactive references
|
|
411
|
+
- [core/Specific](src/core/Specific.ts) - Specific object type handlers
|
|
412
|
+
- [core/Subscript](src/core/Subscript.ts) - Subscription registry system
|
|
413
|
+
- [index](src/index.ts) - Main exports
|
|
414
|
+
- [wrap/AssignObject](src/wrap/AssignObject.ts) - Object assignment proxy
|
|
415
|
+
- [wrap/Symbol](src/wrap/Symbol.ts) - Internal symbols and triggers
|
|
416
|
+
- [wrap/Utils](src/wrap/Utils.ts) - Utility functions and types
|
|
418
417
|
|
|
419
418
|
---
|
|
420
419
|
|
package/dist/object.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ze = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" || typeof e > "u" || e == null, E = (e, t) => m(e) ? t == "number" ? Number(e) || 0 : t == "string" ? String(e) || "" : t == "boolean" ? !!e : e : null, ke = (e, t = "value") => (typeof e == "object" || typeof e == "function") && e != null && (t in e || e?.[t] != null), I = (e) => ke(e, "value"), He = (e) => m(e) ? e : I(e) ? e?.value : e, S = (e, t) => e?.[Ze] ?? e ?? t ?? t, yt = (e) => {
|
|
2
2
|
if (typeof e == "function" || e == null) return e;
|
|
3
3
|
const t = function() {
|
|
4
4
|
};
|
|
5
|
-
return t[
|
|
6
|
-
},
|
|
7
|
-
ke(e, r) && (e[
|
|
5
|
+
return t[Ze] = e, t;
|
|
6
|
+
}, Q = /* @__PURE__ */ Symbol.for("@trigger-lock"), ye = (e, t, r = "value") => {
|
|
7
|
+
ke(e, r) && (e[Q] = !0);
|
|
8
8
|
let n;
|
|
9
9
|
try {
|
|
10
10
|
n = t?.();
|
|
11
11
|
} finally {
|
|
12
|
-
ke(e, r) && delete e[
|
|
12
|
+
ke(e, r) && delete e[Q];
|
|
13
13
|
}
|
|
14
14
|
return n;
|
|
15
15
|
}, at = (e, t) => e instanceof Promise || typeof e?.then == "function" ? e?.then?.(t) : t?.(e), ht = (e, t) => e instanceof Promise || typeof e?.then == "function" ? e?.then?.(t) : t?.(e), pe = function(e) {
|
|
16
16
|
return (t) => {
|
|
17
|
-
e[
|
|
17
|
+
e[Q] = !0;
|
|
18
18
|
let r;
|
|
19
19
|
try {
|
|
20
20
|
r = t?.();
|
|
21
21
|
} finally {
|
|
22
|
-
e[
|
|
22
|
+
e[Q] = !1;
|
|
23
23
|
}
|
|
24
24
|
return r;
|
|
25
25
|
};
|
|
@@ -40,14 +40,14 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
40
40
|
case "bigint":
|
|
41
41
|
return 0n;
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, j = (e) => typeof e?.[Symbol.iterator] == "function", C = (e) => [
|
|
44
44
|
"symbol",
|
|
45
45
|
"string",
|
|
46
46
|
"number"
|
|
47
47
|
].indexOf(typeof e) >= 0, vt = (e, t, r = null) => {
|
|
48
48
|
const n = r != null && (typeof e == "object" || typeof e == "function") ? e?.[r] ?? e : e;
|
|
49
49
|
let i = [];
|
|
50
|
-
t instanceof Set || t instanceof Map || Array.isArray(t) ||
|
|
50
|
+
t instanceof Set || t instanceof Map || Array.isArray(t) || j(t) ? i = (n instanceof Set || n instanceof WeakSet ? t?.values?.() : t?.entries?.()) || (Array.isArray(t) || j(t) ? t : []) : (typeof t == "object" || typeof t == "function") && (i = n instanceof Set || n instanceof WeakSet ? Object.values(t) : Object.entries(t));
|
|
51
51
|
let s = [];
|
|
52
52
|
Array.isArray(n) ? s = n.entries() : n instanceof Map || n instanceof WeakMap ? s = n?.entries?.() : n instanceof Set || n instanceof WeakSet ? s = n?.values?.() : (typeof n == "object" || typeof n == "function") && (s = Object.entries(n));
|
|
53
53
|
const u = new Set(Array.from(i).map((o) => o?.[0])), l = new Set(Array.from(s).map((o) => o?.[0])), f = u?.difference?.(l);
|
|
@@ -60,7 +60,7 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
60
60
|
}, ie = (e, t, r = null, n = !0, i = "id") => {
|
|
61
61
|
const s = r != null && (typeof e == "object" || typeof e == "function") ? e?.[r] ?? e : e;
|
|
62
62
|
let u = null;
|
|
63
|
-
if (n && vt(s, t), t instanceof Set || t instanceof Map || Array.isArray(t) ||
|
|
63
|
+
if (n && vt(s, t), t instanceof Set || t instanceof Map || Array.isArray(t) || j(t) ? u = (s instanceof Set || s instanceof WeakSet ? t?.values?.() : t?.entries?.()) || (Array.isArray(t) || j(t) ? t : []) : (typeof t == "object" || typeof t == "function") && (u = s instanceof Set || s instanceof WeakSet ? Object.values(t) : Object.entries(t)), s && u && (typeof u == "object" || typeof u == "function")) {
|
|
64
64
|
if (s instanceof Map || s instanceof WeakMap) {
|
|
65
65
|
for (const l of u) s.set(...l);
|
|
66
66
|
return s;
|
|
@@ -73,7 +73,7 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
73
73
|
return s;
|
|
74
74
|
}
|
|
75
75
|
if (typeof s == "object" || typeof s == "function") {
|
|
76
|
-
if (Array.isArray(s) ||
|
|
76
|
+
if (Array.isArray(s) || j(s)) {
|
|
77
77
|
let l = 0;
|
|
78
78
|
for (const f of u) l < s.length ? s[l++] = f?.[1] : s?.push?.(f?.[1]);
|
|
79
79
|
return s;
|
|
@@ -82,7 +82,7 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
return r != null ? (Reflect.set(e, r, t), e) : typeof t == "object" || typeof t == "function" ? Object.assign(e, t) : t;
|
|
85
|
-
}, bt = (e, t) => pt.getOrInsert(e, /* @__PURE__ */ new WeakMap()).getOrInsert(t, t?.bind?.(e)),
|
|
85
|
+
}, bt = (e, t) => pt.getOrInsert(e, /* @__PURE__ */ new WeakMap()).getOrInsert(t, t?.bind?.(e)), H = (e, t) => (typeof t == "function" ? bt(e, t) : t) ?? t, ae = (e, t, r, n) => {
|
|
86
86
|
if (t == Symbol.iterator) return Ve(e, r, n);
|
|
87
87
|
if (t == null || typeof t == "symbol" || typeof t == "object" || typeof t == "function") return;
|
|
88
88
|
const i = (s, ...u) => {
|
|
@@ -102,14 +102,14 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
102
102
|
if (e == null) return;
|
|
103
103
|
let n = [];
|
|
104
104
|
if (e instanceof Set || e instanceof Map || typeof e?.keys == "function") return [...e?.keys?.() || n].forEach?.((i) => ae(e, i, t, r));
|
|
105
|
-
if (Array.isArray(e) ||
|
|
105
|
+
if (Array.isArray(e) || j(e)) return [...e].forEach?.((i, s) => ae(e, s, t, r));
|
|
106
106
|
if (typeof e == "object" || typeof e == "function") return [...Object.keys(e) || n].forEach?.((i) => ae(e, i, t, r));
|
|
107
107
|
}, x = (e, t) => e == null && t == null ? !1 : e == null || t == null ? !0 : typeof e == "boolean" && typeof t == "boolean" ? e != t : typeof e == "number" && typeof t == "number" ? !(e == t || Math.abs(e - t) < 1e-9) : typeof e == "string" && typeof t == "string" ? e != "" && t != "" && e != t || e !== t : typeof e != typeof t ? e !== t : e && t && e != t || e !== t, pt = /* @__PURE__ */ new WeakMap(), le = (e, t) => {
|
|
108
108
|
const r = e == null || e < 0 || typeof e != "number" || e == Symbol.iterator || (t != null ? e >= (t?.length || 0) : !1);
|
|
109
109
|
return t != null ? Array.isArray(t) && r : !1;
|
|
110
|
-
},
|
|
110
|
+
}, $ = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), P = (e, t) => e instanceof Promise || typeof e?.then == "function" ? $?.has?.(e) ? t($?.get?.(e)) : Promise.try?.(async () => {
|
|
111
111
|
const r = await e;
|
|
112
|
-
return
|
|
112
|
+
return $?.set?.(e, r), r;
|
|
113
113
|
})?.then?.(t) : t(e), mt = class {
|
|
114
114
|
#t;
|
|
115
115
|
#e;
|
|
@@ -117,35 +117,35 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
117
117
|
this.#t = e, this.#e = t;
|
|
118
118
|
}
|
|
119
119
|
defineProperty(e, t, r) {
|
|
120
|
-
return S(e) instanceof Promise ? Reflect.defineProperty(e, t, r) :
|
|
120
|
+
return S(e) instanceof Promise ? Reflect.defineProperty(e, t, r) : P(S(e), (n) => Reflect.defineProperty(n, t, r));
|
|
121
121
|
}
|
|
122
122
|
deleteProperty(e, t) {
|
|
123
|
-
return S(e) instanceof Promise ? Reflect.deleteProperty(e, t) :
|
|
123
|
+
return S(e) instanceof Promise ? Reflect.deleteProperty(e, t) : P(S(e), (r) => Reflect.deleteProperty(r, t));
|
|
124
124
|
}
|
|
125
125
|
getPrototypeOf(e) {
|
|
126
|
-
return S(e) instanceof Promise ? Reflect.getPrototypeOf(e) :
|
|
126
|
+
return S(e) instanceof Promise ? Reflect.getPrototypeOf(e) : P(S(e), (t) => Reflect.getPrototypeOf(t));
|
|
127
127
|
}
|
|
128
128
|
setPrototypeOf(e, t) {
|
|
129
|
-
return S(e) instanceof Promise ? Reflect.setPrototypeOf(e, t) :
|
|
129
|
+
return S(e) instanceof Promise ? Reflect.setPrototypeOf(e, t) : P(S(e), (r) => Reflect.setPrototypeOf(r, t));
|
|
130
130
|
}
|
|
131
131
|
isExtensible(e) {
|
|
132
|
-
return S(e) instanceof Promise ? Reflect.isExtensible(e) :
|
|
132
|
+
return S(e) instanceof Promise ? Reflect.isExtensible(e) : P(S(e), (t) => Reflect.isExtensible(t));
|
|
133
133
|
}
|
|
134
134
|
preventExtensions(e) {
|
|
135
|
-
return S(e) instanceof Promise ? Reflect.ownKeys(e) :
|
|
135
|
+
return S(e) instanceof Promise ? Reflect.ownKeys(e) : P(S(e), (t) => Reflect.preventExtensions(t));
|
|
136
136
|
}
|
|
137
137
|
ownKeys(e) {
|
|
138
138
|
const t = S(e);
|
|
139
|
-
return t instanceof Promise ? Object.keys(t) :
|
|
139
|
+
return t instanceof Promise ? Object.keys(t) : P(t, (r) => (typeof r == "object" || typeof r == "function") && r != null ? Object.keys(r) : []) ?? [];
|
|
140
140
|
}
|
|
141
141
|
getOwnPropertyDescriptor(e, t) {
|
|
142
|
-
return S(e) instanceof Promise ? Reflect.getOwnPropertyDescriptor(e, t) :
|
|
142
|
+
return S(e) instanceof Promise ? Reflect.getOwnPropertyDescriptor(e, t) : P(S(e), (r) => Reflect.getOwnPropertyDescriptor(r, t));
|
|
143
143
|
}
|
|
144
144
|
construct(e, t, r) {
|
|
145
|
-
return
|
|
145
|
+
return P(S(e), (n) => Reflect.construct(n, t, r));
|
|
146
146
|
}
|
|
147
147
|
has(e, t) {
|
|
148
|
-
return S(e) instanceof Promise ? Reflect.has(e, t) :
|
|
148
|
+
return S(e) instanceof Promise ? Reflect.has(e, t) : P(S(e), (r) => Reflect.has(r, t));
|
|
149
149
|
}
|
|
150
150
|
get(e, t, r) {
|
|
151
151
|
if (e = S(e), t == "promise") return e;
|
|
@@ -165,7 +165,7 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
let n;
|
|
168
|
-
return
|
|
168
|
+
return $?.has?.(e) && (n = $?.get?.(e))?.[t] != null ? n = $?.get?.(e)?.[t] : n = Ee(P(e, async (i) => {
|
|
169
169
|
if (S(i) instanceof Promise) return Reflect.get(i, t, r);
|
|
170
170
|
if (m(i)) return t == Symbol.toPrimitive || t == Symbol.toStringTag ? i : void 0;
|
|
171
171
|
let s;
|
|
@@ -180,28 +180,28 @@ var je = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" ||
|
|
|
180
180
|
} : n;
|
|
181
181
|
}
|
|
182
182
|
set(e, t, r) {
|
|
183
|
-
return
|
|
183
|
+
return P(S(e), (n) => Reflect.set(n, t, r));
|
|
184
184
|
}
|
|
185
185
|
apply(e, t, r) {
|
|
186
186
|
if (this.#t) {
|
|
187
187
|
const n = this.#t?.(...r);
|
|
188
188
|
return this.#t = null, n;
|
|
189
189
|
}
|
|
190
|
-
return
|
|
190
|
+
return P(S(e, this.#t), (n) => {
|
|
191
191
|
if (typeof n == "function")
|
|
192
192
|
return S(n) instanceof Promise, Reflect.apply(n, t, r);
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
function Ee(e, t, r) {
|
|
197
|
-
return e instanceof Promise || typeof e?.then == "function" ?
|
|
197
|
+
return e instanceof Promise || typeof e?.then == "function" ? $?.has?.(e) ? $?.get?.(e) : (Ke?.has?.(e) || e?.then?.((n) => $?.set?.(e, n)), Ke?.getOrInsertComputed?.(e, () => new Proxy(yt(e), new mt(t, r)))) : e;
|
|
198
198
|
}
|
|
199
199
|
Symbol.observable ||= /* @__PURE__ */ Symbol.for("observable");
|
|
200
200
|
Symbol.subscribe ||= /* @__PURE__ */ Symbol.for("subscribe");
|
|
201
201
|
Symbol.unsubscribe ||= /* @__PURE__ */ Symbol.for("unsubscribe");
|
|
202
|
-
var d = /* @__PURE__ */ Symbol.for("@value"), g = /* @__PURE__ */ Symbol.for("@extract"),
|
|
202
|
+
var d = /* @__PURE__ */ Symbol.for("@value"), g = /* @__PURE__ */ Symbol.for("@extract"), _ = /* @__PURE__ */ Symbol.for("@origin"), se = /* @__PURE__ */ Symbol.for("@registry"), K = /* @__PURE__ */ Symbol.for("@behavior"), oe = /* @__PURE__ */ Symbol.for("@promise"), me = /* @__PURE__ */ Symbol.for("@trigger-less"), h = /* @__PURE__ */ Symbol.for("@trigger-lock"), gt = /* @__PURE__ */ Symbol.for("@trigger-control"), D = /* @__PURE__ */ Symbol.for("@trigger"), ue = /* @__PURE__ */ Symbol.for("@subscribe"), At = /* @__PURE__ */ Symbol.for("@isNotEqual"), de = /* @__PURE__ */ Symbol.for("@realProp"), qe = /* @__PURE__ */ new WeakMap(), he = (e) => {
|
|
203
203
|
const t = typeof e == "object" || typeof e == "function" ? e?.[g] ?? e : e, r = (n) => he(n);
|
|
204
|
-
return Array.isArray(t) ? t?.map?.(r) || Array.from(t || [])?.map?.(r) || [] : t instanceof Map || t instanceof WeakMap ? new Map(Array.from(t?.entries?.() || [])?.map?.(([n, i]) => [n, he(i)])) : t instanceof Set || t instanceof WeakSet ? new Set(Array.from(t?.values?.() || [])?.map?.(r)) : t != null && typeof t == "function" || typeof t == "object" ? Object.fromEntries(Array.from(Object.entries(t || {}) || [])?.filter?.(([n]) => n != g && n !=
|
|
204
|
+
return Array.isArray(t) ? t?.map?.(r) || Array.from(t || [])?.map?.(r) || [] : t instanceof Map || t instanceof WeakMap ? new Map(Array.from(t?.entries?.() || [])?.map?.(([n, i]) => [n, he(i)])) : t instanceof Set || t instanceof WeakSet ? new Set(Array.from(t?.values?.() || [])?.map?.(r)) : t != null && typeof t == "function" || typeof t == "object" ? Object.fromEntries(Array.from(Object.entries(t || {}) || [])?.filter?.(([n]) => n != g && n != _ && n != se)?.map?.(([n, i]) => [n, he(i)])) : t;
|
|
205
205
|
}, Ot = (e) => e?.[g] ?? e?.["@target"] ?? e, V = (e, t = !1) => {
|
|
206
206
|
const r = e;
|
|
207
207
|
if (m(e) || typeof e == "symbol") return e;
|
|
@@ -234,7 +234,7 @@ var ee = (e) => {
|
|
|
234
234
|
const t = Number(e);
|
|
235
235
|
return Number.isInteger(t) && t >= 0 && String(t) === e;
|
|
236
236
|
};
|
|
237
|
-
function
|
|
237
|
+
function Sr(e = [], t = {}) {
|
|
238
238
|
let r = /* @__PURE__ */ new Set();
|
|
239
239
|
const n = (l, f, o) => {
|
|
240
240
|
t.onDuplicate?.({
|
|
@@ -411,13 +411,13 @@ var Rt = class {
|
|
|
411
411
|
get(e, t, r) {
|
|
412
412
|
return typeof t == "symbol" ? e?.[t] ?? e : Reflect.get(e, t, r);
|
|
413
413
|
}
|
|
414
|
-
},
|
|
415
|
-
if (e?.[
|
|
414
|
+
}, pr = (e) => {
|
|
415
|
+
if (e?.[_] || qe.has(e)) return e;
|
|
416
416
|
const t = new Proxy(e, new Rt());
|
|
417
417
|
return qe.set(t, e), t;
|
|
418
418
|
}, Le = /* @__PURE__ */ Symbol.for("object.ts@withUnsub");
|
|
419
419
|
globalThis[Le] ??= /* @__PURE__ */ new WeakMap();
|
|
420
|
-
var
|
|
420
|
+
var Tt = globalThis[Le], Pt = (e, t, r) => Tt.getOrInsert(e, () => {
|
|
421
421
|
const n = t?.deref?.();
|
|
422
422
|
n?.affected?.(r);
|
|
423
423
|
const i = e?.complete?.bind?.(e), s = () => {
|
|
@@ -433,7 +433,7 @@ var Pt = globalThis[Le], Tt = (e, t, r) => Pt.getOrInsert(e, () => {
|
|
|
433
433
|
globalThis[et] ??= /* @__PURE__ */ new WeakMap();
|
|
434
434
|
var p = globalThis[et] ??= /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ Symbol.for("object.ts@globalEffectListeners");
|
|
435
435
|
globalThis[tt] ??= /* @__PURE__ */ new Map();
|
|
436
|
-
var ve = globalThis[tt],
|
|
436
|
+
var ve = globalThis[tt], je = (e, t = ["*"]) => {
|
|
437
437
|
if (e == null || typeof e != "function") return;
|
|
438
438
|
const r = ut(t);
|
|
439
439
|
return ve.set(e, r.affectTypes), () => ve.delete(e);
|
|
@@ -443,7 +443,7 @@ var Mt = globalThis[rt], It = (e, t) => {
|
|
|
443
443
|
const r = e?.[g] ?? e;
|
|
444
444
|
let n = p.get(r);
|
|
445
445
|
return n ? n.bindSource(r) : (n = new Et(r), p.set(r, n)), t;
|
|
446
|
-
}, ce = (e, t) => (e = V(e?.[g] ?? e), typeof e == "symbol" || !(typeof e == "object" || typeof e == "function") || e == null ? e : Mt.getOrInsertComputed(e, () => new Proxy(e, It(e, t)))), te = /* @__PURE__ */ Symbol.for("@allProps"), nt = /* @__PURE__ */ new Set(["*", "all"]),
|
|
446
|
+
}, ce = (e, t) => (e = V(e?.[g] ?? e), typeof e == "symbol" || !(typeof e == "object" || typeof e == "function") || e == null ? e : Mt.getOrInsertComputed(e, () => new Proxy(e, It(e, t)))), te = /* @__PURE__ */ Symbol.for("@allProps"), nt = /* @__PURE__ */ new Set(["*", "all"]), ze = /* @__PURE__ */ new Map([
|
|
447
447
|
["set", ["setter", "@set"]],
|
|
448
448
|
["add", ["@add"]],
|
|
449
449
|
["delete", ["@delete"]],
|
|
@@ -454,38 +454,38 @@ var Mt = globalThis[rt], It = (e, t) => {
|
|
|
454
454
|
["addAll", ["@addAll"]],
|
|
455
455
|
["deleteAll", ["@deleteAll", "@clear"]]
|
|
456
456
|
]), it = /* @__PURE__ */ Symbol.for("object.ts@triggerCanonicalNames");
|
|
457
|
-
globalThis[it] ??= new Map(Array.from(
|
|
457
|
+
globalThis[it] ??= new Map(Array.from(ze.entries()).flatMap(([e, t]) => t.map((r) => [r, e])));
|
|
458
458
|
var kt = globalThis[it], fe = (e = "set") => {
|
|
459
459
|
if (e == null) return e;
|
|
460
460
|
const t = String(e || "set");
|
|
461
461
|
return kt.get(t) ?? t;
|
|
462
462
|
}, lt = (e) => {
|
|
463
463
|
const t = e == null ? "all" : String(fe(e) ?? "all");
|
|
464
|
-
return [t, ...
|
|
465
|
-
},
|
|
464
|
+
return [t, ...ze.get(t) ?? []];
|
|
465
|
+
}, Je = (e = ["*"]) => new Set([...X(e)].flatMap((t) => [t, ...ze.get(t) ?? []])), X = (e = ["*"]) => {
|
|
466
466
|
const t = typeof e == "string" ? [e] : Array.from(e ?? ["*"]), r = new Set(t.map((n) => {
|
|
467
467
|
const i = String(n || "*");
|
|
468
468
|
return nt.has(i) ? i : String(fe(i) ?? i);
|
|
469
469
|
}));
|
|
470
470
|
return r.size ? r : /* @__PURE__ */ new Set(["*"]);
|
|
471
|
-
},
|
|
472
|
-
const r = e instanceof Set ? e :
|
|
471
|
+
}, J = (e, t) => {
|
|
472
|
+
const r = e instanceof Set ? e : X(e);
|
|
473
473
|
return [...nt].some((n) => r.has(n)) || lt(t).some((n) => r.has(n));
|
|
474
474
|
}, st = (e) => !!e && typeof e == "object" && !Array.isArray(e) && ("affectTypes" in e || "triggers" in e || "triggerImmediately" in e), ge = (e = ["*"]) => {
|
|
475
475
|
if (st(e)) return {
|
|
476
|
-
affectTypes:
|
|
476
|
+
affectTypes: X(e.affectTypes ?? e.triggers ?? ["*"]),
|
|
477
477
|
triggerImmediately: e.triggerImmediately !== !1
|
|
478
478
|
};
|
|
479
|
-
const t =
|
|
479
|
+
const t = X(e);
|
|
480
480
|
return {
|
|
481
481
|
affectTypes: t,
|
|
482
|
-
triggerImmediately:
|
|
482
|
+
triggerImmediately: J(t, "initial")
|
|
483
483
|
};
|
|
484
484
|
}, ut = (e = ["*"]) => st(e) ? {
|
|
485
|
-
affectTypes:
|
|
485
|
+
affectTypes: X(e.affectTypes ?? e.triggers ?? ["*"]),
|
|
486
486
|
triggerImmediately: e.triggerImmediately === !0
|
|
487
487
|
} : {
|
|
488
|
-
affectTypes:
|
|
488
|
+
affectTypes: X(e),
|
|
489
489
|
triggerImmediately: !1
|
|
490
490
|
}, ft = /* @__PURE__ */ Symbol.for("object.ts@Subscript");
|
|
491
491
|
globalThis[ft] ??= class {
|
|
@@ -514,7 +514,7 @@ globalThis[ft] ??= class {
|
|
|
514
514
|
} };
|
|
515
515
|
const r = new WeakRef(this), n = function(i) {
|
|
516
516
|
const s = i?.next?.bind?.(i);
|
|
517
|
-
return
|
|
517
|
+
return Pt(i, r, s);
|
|
518
518
|
};
|
|
519
519
|
this.#f = typeof Observable < "u" ? new Observable(n) : null, this.compatible = () => this.#f;
|
|
520
520
|
}
|
|
@@ -542,7 +542,7 @@ globalThis[ft] ??= class {
|
|
|
542
542
|
i = fe(i) ?? i;
|
|
543
543
|
const u = this.#e;
|
|
544
544
|
if (u?.size)
|
|
545
|
-
for (const [l, f] of u.entries()) (f.prop === t || f.prop === te || f.prop === null) &&
|
|
545
|
+
for (const [l, f] of u.entries()) (f.prop === t || f.prop === te || f.prop === null) && J(f.triggers, i) && this.$safeExec(l, r, t, n, i, ...s);
|
|
546
546
|
if (ve.size) {
|
|
547
547
|
const l = {
|
|
548
548
|
source: this.#t,
|
|
@@ -554,7 +554,7 @@ globalThis[ft] ??= class {
|
|
|
554
554
|
trigger: i,
|
|
555
555
|
args: s
|
|
556
556
|
};
|
|
557
|
-
for (const [f, o] of ve.entries())
|
|
557
|
+
for (const [f, o] of ve.entries()) J(o, i) && this.$safeExec(f, l);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
wrap(t) {
|
|
@@ -564,14 +564,14 @@ globalThis[ft] ??= class {
|
|
|
564
564
|
return this.#c;
|
|
565
565
|
}
|
|
566
566
|
isTriggerEnabled(t) {
|
|
567
|
-
return !
|
|
567
|
+
return !J(this.#n, "all") && !lt(t).some((r) => this.#n.has(r));
|
|
568
568
|
}
|
|
569
569
|
setTriggersEnabled(t = ["*"], r = !0) {
|
|
570
|
-
const n =
|
|
570
|
+
const n = Je(t);
|
|
571
571
|
for (const i of n) r ? this.#n.delete(i) : this.#n.add(i);
|
|
572
572
|
}
|
|
573
573
|
withTriggers(t, r, n) {
|
|
574
|
-
const i = [...
|
|
574
|
+
const i = [...Je(t)], s = new Map(i.map((l) => [l, this.#n.has(l)])), u = () => {
|
|
575
575
|
s.forEach((l, f) => {
|
|
576
576
|
l ? this.#n.add(f) : this.#n.delete(f);
|
|
577
577
|
});
|
|
@@ -636,7 +636,7 @@ globalThis[ft] ??= class {
|
|
|
636
636
|
return this.#o;
|
|
637
637
|
}
|
|
638
638
|
};
|
|
639
|
-
var Et = globalThis[ft], Wt = /* @__PURE__ */ new Set([
|
|
639
|
+
var Et = globalThis[ft], Wt = /* @__PURE__ */ Symbol.for("object.ts@__safeGetGuard"), _t = /* @__PURE__ */ new Set([
|
|
640
640
|
Symbol.toStringTag,
|
|
641
641
|
Symbol.iterator,
|
|
642
642
|
Symbol.asyncIterator,
|
|
@@ -652,10 +652,10 @@ var Et = globalThis[ft], Wt = /* @__PURE__ */ new Set([
|
|
|
652
652
|
"finally",
|
|
653
653
|
"next"
|
|
654
654
|
]), re = (e, t) => {
|
|
655
|
-
if (!
|
|
655
|
+
if (!_t.has(t)) return null;
|
|
656
656
|
const r = c(e, t);
|
|
657
|
-
return typeof r == "function" ?
|
|
658
|
-
}, R = /* @__PURE__ */ new WeakMap();
|
|
657
|
+
return typeof r == "function" ? H(e, r) : r;
|
|
658
|
+
}, R = globalThis[Wt] ??= /* @__PURE__ */ new WeakMap();
|
|
659
659
|
function $t(e, t) {
|
|
660
660
|
let r = !0;
|
|
661
661
|
try {
|
|
@@ -667,22 +667,22 @@ function $t(e, t) {
|
|
|
667
667
|
}
|
|
668
668
|
return r;
|
|
669
669
|
}
|
|
670
|
-
var
|
|
670
|
+
var G = (e, t) => {
|
|
671
671
|
if (m(e)) return e;
|
|
672
672
|
const r = c(e, t);
|
|
673
673
|
if (r == null && t != "value") {
|
|
674
674
|
const n = c(e, "value");
|
|
675
|
-
return n != null && !m(n) ?
|
|
676
|
-
} else if (t == "value" && r != null && !m(r) && typeof r != "function") return
|
|
675
|
+
return n != null && !m(n) ? G(n, t) : r;
|
|
676
|
+
} else if (t == "value" && r != null && !m(r) && typeof r != "function") return G(r, t) ?? r ?? e;
|
|
677
677
|
return r ?? e;
|
|
678
|
-
},
|
|
678
|
+
}, Vt = (e, t, r) => {
|
|
679
679
|
if (e == null) return !1;
|
|
680
|
-
let n = __safeSetGuard
|
|
680
|
+
let n = __safeSetGuard?.getOrInsert?.(e, /* @__PURE__ */ new Set());
|
|
681
681
|
return n?.has?.(t) ? !1 : (n?.add?.(t), Reflect.set(e, t, r));
|
|
682
682
|
}, c = (e, t, r) => {
|
|
683
683
|
let n;
|
|
684
684
|
if (e == null) return e;
|
|
685
|
-
let i = R
|
|
685
|
+
let i = R?.getOrInsert?.(e, /* @__PURE__ */ new Set());
|
|
686
686
|
if (i?.has?.(t)) return null;
|
|
687
687
|
if (!$t(e, t)) n ??= Reflect.get(e, t, r ?? e);
|
|
688
688
|
else {
|
|
@@ -695,15 +695,15 @@ var H = (e, t) => {
|
|
|
695
695
|
i.delete(t), i?.size === 0 && R?.delete?.(e);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
return typeof n == "function" ?
|
|
699
|
-
}, W = (e, t) => Object.prototype.hasOwnProperty.call(e, t),
|
|
698
|
+
return typeof n == "function" ? H(e, n) : n;
|
|
699
|
+
}, W = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Te = (e, t = !1) => !!e && typeof e == "object" && !Array.isArray(e) && (W(e, "key") || W(e, "name") || W(e, "oldValue") || W(e, "old") || W(e, "op") || W(e, "trigger") || t && W(e, "value")), N = (e, t, r) => W(e, t) ? e[t] : t == "oldValue" && W(e, "old") ? e.old : r(), Ae = (e, t = "manual") => fe(e.trigger ?? e.op ?? t), zt = (e) => typeof e == "string" || typeof e == "number" || typeof e == "symbol", be = (e) => {
|
|
700
700
|
const t = c(e, de) ?? c(e, "realProp");
|
|
701
|
-
return
|
|
702
|
-
},
|
|
701
|
+
return zt(t) ? t : null;
|
|
702
|
+
}, Qe = (e, t) => t == "value" ? be(e) ?? t : t, Ct = (e, t) => {
|
|
703
703
|
const r = be(e);
|
|
704
704
|
return r != null && t == r ? c(e, "value") ?? c(e, d) ?? c(e, t) : t == null ? void 0 : c(e, t);
|
|
705
705
|
}, Oe = (e, t) => {
|
|
706
|
-
const r = (i, s, u) => (
|
|
706
|
+
const r = (i, s, u) => (Te(s) || (u ??= s), t(Te(i) ? i : Te(s, !0) ? {
|
|
707
707
|
key: i,
|
|
708
708
|
trigger: u,
|
|
709
709
|
...s
|
|
@@ -723,11 +723,11 @@ var H = (e, t) => {
|
|
|
723
723
|
"deref",
|
|
724
724
|
"bind",
|
|
725
725
|
"@target",
|
|
726
|
-
|
|
726
|
+
_,
|
|
727
727
|
g,
|
|
728
728
|
se
|
|
729
729
|
].indexOf(t) < 0 ? c(e, t)?.bind?.(e) : null) != null) return null;
|
|
730
|
-
if ([g,
|
|
730
|
+
if ([g, _].indexOf(t) >= 0) return c(e, t) ?? e;
|
|
731
731
|
if (t == d) return c(e, t) ?? c(e, "value");
|
|
732
732
|
if (t == se) return r;
|
|
733
733
|
if (t == gt) return r?.triggerControl;
|
|
@@ -765,7 +765,7 @@ var H = (e, t) => {
|
|
|
765
765
|
let n = [], i = [], s = [], u = [...this.#e], l = -1;
|
|
766
766
|
const f = Reflect.apply(e, t || this.#e, r);
|
|
767
767
|
if (this.#r?.[h])
|
|
768
|
-
return Array.isArray(f) ?
|
|
768
|
+
return Array.isArray(f) ? _e(f) : f;
|
|
769
769
|
switch (this.#t) {
|
|
770
770
|
case "push":
|
|
771
771
|
l = u?.length, n = r;
|
|
@@ -818,9 +818,9 @@ var H = (e, t) => {
|
|
|
818
818
|
break;
|
|
819
819
|
}
|
|
820
820
|
const o = p.get(this.#e);
|
|
821
|
-
return n?.length == 1 ? o?.trigger?.(l, n[0], null, "add") : n?.length > 1 && (o?.trigger?.(l, n, null, "addAll"), n.forEach((y, a) => o?.trigger?.(l + a, y, null, "add"))), s?.length == 1 ? o?.trigger?.(s[0]?.[0] ?? l, s[0]?.[1], s[0]?.[2], s[0]?.[3] === !1 ? "add" : "set") : s?.length > 1 && (o?.trigger?.(l, s, u, "setAll"), s.forEach((y, a) => o?.trigger?.(y?.[0] ?? l + a, y?.[1], y?.[2], y?.[3] === !1 ? "add" : "set"))), i?.length == 1 ? o?.trigger?.(l, null, i[0], "delete") : i?.length > 1 && (o?.trigger?.(l, null, i, "deleteAll"), i.forEach((y, a) => o?.trigger?.(l + a, null, y, "delete"))), f == e ? new Proxy(f, this.#r) : Array.isArray(f) ?
|
|
821
|
+
return n?.length == 1 ? o?.trigger?.(l, n[0], null, "add") : n?.length > 1 && (o?.trigger?.(l, n, null, "addAll"), n.forEach((y, a) => o?.trigger?.(l + a, y, null, "add"))), s?.length == 1 ? o?.trigger?.(s[0]?.[0] ?? l, s[0]?.[1], s[0]?.[2], s[0]?.[3] === !1 ? "add" : "set") : s?.length > 1 && (o?.trigger?.(l, s, u, "setAll"), s.forEach((y, a) => o?.trigger?.(y?.[0] ?? l + a, y?.[1], y?.[2], y?.[3] === !1 ? "add" : "set"))), i?.length == 1 ? o?.trigger?.(l, null, i[0], "delete") : i?.length > 1 && (o?.trigger?.(l, null, i, "deleteAll"), i.forEach((y, a) => o?.trigger?.(l + a, null, y, "delete"))), f == e ? new Proxy(f, this.#r) : Array.isArray(f) ? _e(f) : f;
|
|
822
822
|
}
|
|
823
|
-
},
|
|
823
|
+
}, Dt = (e, t, r, n) => {
|
|
824
824
|
const i = Number.isInteger(r) && Number.isInteger(n) && n < r ? t.slice(n, r) : [];
|
|
825
825
|
if (!e[h] && r !== n) {
|
|
826
826
|
const s = p.get(t);
|
|
@@ -832,7 +832,7 @@ var H = (e, t) => {
|
|
|
832
832
|
s?.trigger?.(r, l, null, "addAll"), l.forEach((f, o) => s?.trigger?.(r + o, void 0, null, "add"));
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
|
-
},
|
|
835
|
+
}, Bt = class {
|
|
836
836
|
[h];
|
|
837
837
|
constructor() {
|
|
838
838
|
}
|
|
@@ -844,7 +844,7 @@ var H = (e, t) => {
|
|
|
844
844
|
if (n != null) return n;
|
|
845
845
|
if ([
|
|
846
846
|
g,
|
|
847
|
-
|
|
847
|
+
_,
|
|
848
848
|
"@target",
|
|
849
849
|
"deref"
|
|
850
850
|
].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? c(e, t)?.bind?.(e) : c(e, t);
|
|
@@ -854,7 +854,7 @@ var H = (e, t) => {
|
|
|
854
854
|
if (u != null) return u;
|
|
855
855
|
if (t == me) return pe.call(this, this);
|
|
856
856
|
if (t == D) return Oe(i, (f) => {
|
|
857
|
-
const o = f.key ?? f.name ?? 0, y =
|
|
857
|
+
const o = f.key ?? f.name ?? 0, y = N(f, "value", () => c(e, o)), a = N(f, "oldValue", () => {
|
|
858
858
|
});
|
|
859
859
|
return i?.trigger?.(o, y, a, Ae(f, "manual"));
|
|
860
860
|
});
|
|
@@ -887,7 +887,7 @@ var H = (e, t) => {
|
|
|
887
887
|
"a"
|
|
888
888
|
], u = i.indexOf(t), l = s.indexOf(t);
|
|
889
889
|
let f = !1;
|
|
890
|
-
return u >= 0 ? f = Reflect.set(e, u, r) : l >= 0 ? f = Reflect.set(e, l, r) : f = Reflect.set(e, t, r), t == "length" && x(n, r) &&
|
|
890
|
+
return u >= 0 ? f = Reflect.set(e, u, r) : l >= 0 ? f = Reflect.set(e, l, r) : f = Reflect.set(e, t, r), t == "length" && x(n, r) && Dt(this, e, n, r), !this[h] && typeof t != "symbol" && x(n, r) && p?.get?.(e)?.trigger?.(t, r, n, "set"), f;
|
|
891
891
|
}
|
|
892
892
|
deleteProperty(e, t) {
|
|
893
893
|
if (typeof t != "symbol" && Number.isInteger(parseInt(t)) && (t = parseInt(t) ?? t), t == h)
|
|
@@ -895,40 +895,40 @@ var H = (e, t) => {
|
|
|
895
895
|
const r = c(e, t), n = Reflect.deleteProperty(e, t);
|
|
896
896
|
return !this[h] && t != "length" && t != h && typeof t != "symbol" && r != null && p.get(e)?.trigger?.(t, t, r, "delete"), n;
|
|
897
897
|
}
|
|
898
|
-
},
|
|
898
|
+
}, Ft = class {
|
|
899
899
|
[h];
|
|
900
900
|
constructor() {
|
|
901
901
|
}
|
|
902
902
|
get(e, t, r) {
|
|
903
903
|
if ([
|
|
904
904
|
g,
|
|
905
|
-
|
|
905
|
+
_,
|
|
906
906
|
"@target",
|
|
907
907
|
"deref",
|
|
908
908
|
"then",
|
|
909
909
|
"catch",
|
|
910
910
|
"finally"
|
|
911
|
-
].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ?
|
|
911
|
+
].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? H(e, c(e, t)) : c(e, t);
|
|
912
912
|
const n = p.get(e) ?? p.get(c(e, "value") ?? e), i = xe(e, t, n);
|
|
913
913
|
if (i != null) return i;
|
|
914
914
|
c(e, t) == null && t != "value" && I(e) && c(e, "value") != null && (typeof c(e, "value") == "object" || typeof c(e, "value") == "function") && c(c(e, "value"), t) != null && (e = c(e, "value") ?? e);
|
|
915
915
|
const s = we(e, t, n);
|
|
916
916
|
return s ?? (t == me ? pe.call(this, this) : t == D ? Oe(n, (u) => {
|
|
917
|
-
const l =
|
|
917
|
+
const l = Qe(e, u.key ?? u.name ?? be(e) ?? "value"), f = N(u, "oldValue", () => l == "value" || l == be(e) ? c(e, d) : void 0), o = N(u, "value", () => Ct(e, l));
|
|
918
918
|
return n?.trigger?.(l, o, f, Ae(u, "manual"));
|
|
919
919
|
}) : t == Symbol.toPrimitive ? (u) => {
|
|
920
|
-
const l =
|
|
920
|
+
const l = G(e, t);
|
|
921
921
|
return c(l, t) ? c(l, t)?.(u) : m(l) ? E(l, u) : m(c(l, "value")) ? E(c(l, "value"), u) : E(c(l, "value") ?? l, u);
|
|
922
922
|
} : t == Symbol.toStringTag ? () => {
|
|
923
|
-
const u =
|
|
923
|
+
const u = G(e, t);
|
|
924
924
|
return c(u, t) ? c(u, t)?.() : m(u) ? String(u ?? "") || "" : m(c(u, "value")) ? String(c(u, "value") ?? "") || "" : String(c(u, "value") ?? u ?? "") || "";
|
|
925
925
|
} : t == "toString" ? () => {
|
|
926
|
-
const u =
|
|
926
|
+
const u = G(e, t);
|
|
927
927
|
return c(u, t) ? c(u, t)?.() : c(u, Symbol.toStringTag) ? c(u, Symbol.toStringTag)?.() : m(u) ? String(u ?? "") || "" : m(c(u, "value")) ? String(c(u, "value") ?? "") || "" : String(c(u, "value") ?? u ?? "") || "";
|
|
928
928
|
} : t == "valueOf" ? () => {
|
|
929
|
-
const u =
|
|
929
|
+
const u = G(e, t);
|
|
930
930
|
return c(u, t) ? c(u, t)?.() : c(u, Symbol.toPrimitive) ? c(u, Symbol.toPrimitive)?.() : m(u) ? u : m(c(u, "value")) ? c(u, "value") : c(u, "value") ?? u;
|
|
931
|
-
} : typeof t == "symbol" && (t in e || c(e, t) != null) ? c(e, t) :
|
|
931
|
+
} : typeof t == "symbol" && (t in e || c(e, t) != null) ? c(e, t) : G(e, t));
|
|
932
932
|
}
|
|
933
933
|
apply(e, t, r) {
|
|
934
934
|
return Reflect.apply(e, t, r);
|
|
@@ -967,7 +967,7 @@ var H = (e, t) => {
|
|
|
967
967
|
return delete this[h], !0;
|
|
968
968
|
const u = e;
|
|
969
969
|
if (c(e, t) == null && t != "value" && I(e) && c(e, "value") != null && (typeof c(e, "value") == "object" || typeof c(e, "value") == "function") && c(c(e, "value"), t) != null && (e = c(e, "value") ?? e), typeof t == "symbol" && !(c(e, t) != null && t in e)) return;
|
|
970
|
-
const l =
|
|
970
|
+
const l = Qe(e, t), f = t == "value" ? c(e, d) ?? c(e, t) : c(e, t);
|
|
971
971
|
e[t] = i;
|
|
972
972
|
const o = c(e, t) ?? i;
|
|
973
973
|
return !this[h] && typeof t != "symbol" && (c(e, At) ?? x)?.(f, o) && (p.get(e) ?? p.get(u))?.trigger?.(l, i, f), !0;
|
|
@@ -987,7 +987,7 @@ var H = (e, t) => {
|
|
|
987
987
|
enumerable: r.enumerable ?? !0,
|
|
988
988
|
configurable: r.configurable ?? !0
|
|
989
989
|
});
|
|
990
|
-
return
|
|
990
|
+
return Vt(e, t, i), s;
|
|
991
991
|
}
|
|
992
992
|
deleteProperty(e, t) {
|
|
993
993
|
if (t == h)
|
|
@@ -996,29 +996,29 @@ var H = (e, t) => {
|
|
|
996
996
|
const r = c(e, t), n = Reflect.deleteProperty(e, t);
|
|
997
997
|
return !this[h] && t != h && typeof t != "symbol" && p.get(e)?.trigger?.(t, null, r, "delete"), n;
|
|
998
998
|
}
|
|
999
|
-
},
|
|
999
|
+
}, Gt = class {
|
|
1000
1000
|
[h];
|
|
1001
1001
|
constructor() {
|
|
1002
1002
|
}
|
|
1003
1003
|
get(e, t, r) {
|
|
1004
1004
|
if ([
|
|
1005
1005
|
g,
|
|
1006
|
-
|
|
1006
|
+
_,
|
|
1007
1007
|
"@target",
|
|
1008
1008
|
"deref"
|
|
1009
|
-
].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ?
|
|
1009
|
+
].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? H(e, c(e, t)) : c(e, t);
|
|
1010
1010
|
const n = p.get(e), i = xe(e, t, n);
|
|
1011
1011
|
if (i != null) return i;
|
|
1012
1012
|
const s = we(e, t, n);
|
|
1013
1013
|
if (s != null) return s;
|
|
1014
|
-
e = c(e, g) ?? c(e,
|
|
1015
|
-
const u =
|
|
1014
|
+
e = c(e, g) ?? c(e, _) ?? e;
|
|
1015
|
+
const u = H(e, c(e, t));
|
|
1016
1016
|
return typeof t == "symbol" && (t in e || c(e, t) != null) ? u : t == me ? pe.call(this, this) : t == D ? Oe(n, (l) => {
|
|
1017
1017
|
const f = l.key ?? l.name;
|
|
1018
1018
|
if (f == null) return;
|
|
1019
|
-
const o =
|
|
1019
|
+
const o = N(l, "value", () => e.get(f));
|
|
1020
1020
|
if (o == null && !W(l, "value")) return;
|
|
1021
|
-
const y =
|
|
1021
|
+
const y = N(l, "oldValue", () => {
|
|
1022
1022
|
});
|
|
1023
1023
|
return n?.trigger?.(f, o, y, Ae(l, "manual"));
|
|
1024
1024
|
}) : t == "clear" ? () => {
|
|
@@ -1073,20 +1073,20 @@ var H = (e, t) => {
|
|
|
1073
1073
|
get(e, t, r) {
|
|
1074
1074
|
if ([
|
|
1075
1075
|
g,
|
|
1076
|
-
|
|
1076
|
+
_,
|
|
1077
1077
|
"@target",
|
|
1078
1078
|
"deref"
|
|
1079
|
-
].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ?
|
|
1079
|
+
].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? H(e, c(e, t)) : c(e, t);
|
|
1080
1080
|
const n = p.get(e), i = xe(e, t, n);
|
|
1081
1081
|
if (i != null) return i;
|
|
1082
1082
|
const s = we(e, t, n);
|
|
1083
1083
|
if (s != null) return s;
|
|
1084
|
-
e = c(e, g) ?? c(e,
|
|
1085
|
-
const u =
|
|
1084
|
+
e = c(e, g) ?? c(e, _) ?? e;
|
|
1085
|
+
const u = H(e, c(e, t));
|
|
1086
1086
|
return typeof t == "symbol" && (t in e || c(e, t) != null) ? u : t == me ? pe.call(this, this) : t == D ? Oe(n, (l) => {
|
|
1087
1087
|
const f = l.key ?? l.name;
|
|
1088
1088
|
if (f == null) return;
|
|
1089
|
-
const o =
|
|
1089
|
+
const o = N(l, "value", () => e.has(f)), y = N(l, "oldValue", () => {
|
|
1090
1090
|
});
|
|
1091
1091
|
return n?.trigger?.(f, o, y, Ae(l, "manual"));
|
|
1092
1092
|
}) : t == "clear" ? () => {
|
|
@@ -1134,11 +1134,11 @@ var H = (e, t) => {
|
|
|
1134
1134
|
deleteProperty(e, t) {
|
|
1135
1135
|
return t == h ? (delete this[h], !0) : Reflect.deleteProperty(e, t);
|
|
1136
1136
|
}
|
|
1137
|
-
},
|
|
1138
|
-
const r = e instanceof Promise || typeof e?.then == "function", n =
|
|
1137
|
+
}, Y = (e) => !!((typeof e == "object" || typeof e == "function") && e != null && (e?.[g] || e?.[ue])), _e = (e) => Y(e) ? e : ce(e, new Bt()), Kt = (e) => Y(e) ? e : ce(e, new Ft()), qt = (e) => Y(e) ? e : ce(e, new Gt()), Ut = (e) => Y(e) ? e : ce(e, new Ht()), jt = (e, t) => {
|
|
1138
|
+
const r = e instanceof Promise || typeof e?.then == "function", n = T({
|
|
1139
1139
|
[oe]: r ? e : null,
|
|
1140
1140
|
[d]: r ? 0 : Number(V(e) || 0) || 0,
|
|
1141
|
-
[
|
|
1141
|
+
[K]: t,
|
|
1142
1142
|
[Symbol?.toStringTag]() {
|
|
1143
1143
|
return String(this?.[d] ?? "") || "";
|
|
1144
1144
|
},
|
|
@@ -1154,10 +1154,10 @@ var H = (e, t) => {
|
|
|
1154
1154
|
});
|
|
1155
1155
|
return e?.then?.((i) => n.value = i), n;
|
|
1156
1156
|
}, Jt = (e, t) => {
|
|
1157
|
-
const r = e instanceof Promise || typeof e?.then == "function", n =
|
|
1157
|
+
const r = e instanceof Promise || typeof e?.then == "function", n = T({
|
|
1158
1158
|
[oe]: r ? e : null,
|
|
1159
1159
|
[d]: (r ? "" : String(V(typeof e == "number" ? String(e) : e || ""))) ?? "",
|
|
1160
|
-
[
|
|
1160
|
+
[K]: t,
|
|
1161
1161
|
[Symbol?.toStringTag]() {
|
|
1162
1162
|
return String(this?.[d] ?? "") ?? "";
|
|
1163
1163
|
},
|
|
@@ -1173,10 +1173,10 @@ var H = (e, t) => {
|
|
|
1173
1173
|
});
|
|
1174
1174
|
return e?.then?.((i) => n.value = i), n;
|
|
1175
1175
|
}, Qt = (e, t) => {
|
|
1176
|
-
const r = e instanceof Promise || typeof e?.then == "function", n =
|
|
1176
|
+
const r = e instanceof Promise || typeof e?.then == "function", n = T({
|
|
1177
1177
|
[oe]: r ? e : null,
|
|
1178
1178
|
[d]: (r ? !1 : (V(e) != null ? typeof V(e) == "string" ? !0 : !!V(e) : !1) || !1) || !1,
|
|
1179
|
-
[
|
|
1179
|
+
[K]: t,
|
|
1180
1180
|
[Symbol?.toStringTag]() {
|
|
1181
1181
|
return String(this?.[d] ?? "") || "";
|
|
1182
1182
|
},
|
|
@@ -1191,10 +1191,10 @@ var H = (e, t) => {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
});
|
|
1193
1193
|
return e?.then?.((i) => n.value = i), n;
|
|
1194
|
-
},
|
|
1195
|
-
const r = e instanceof Promise || typeof e?.then == "function", n =
|
|
1194
|
+
}, Xe = (e, t) => {
|
|
1195
|
+
const r = e instanceof Promise || typeof e?.then == "function", n = T({
|
|
1196
1196
|
[oe]: r ? e : null,
|
|
1197
|
-
[
|
|
1197
|
+
[K]: t,
|
|
1198
1198
|
[Symbol?.toStringTag]() {
|
|
1199
1199
|
return String(this.value ?? "") || "";
|
|
1200
1200
|
},
|
|
@@ -1206,7 +1206,7 @@ var H = (e, t) => {
|
|
|
1206
1206
|
return e?.then?.((i) => n.value = i), b(e, (i) => {
|
|
1207
1207
|
n?.[D]?.();
|
|
1208
1208
|
}), n;
|
|
1209
|
-
},
|
|
1209
|
+
}, Pe = (e, t) => {
|
|
1210
1210
|
if (e == null || typeof e != "object" && typeof e != "function") return e;
|
|
1211
1211
|
try {
|
|
1212
1212
|
Object.defineProperty(e, de, {
|
|
@@ -1243,12 +1243,12 @@ var H = (e, t) => {
|
|
|
1243
1243
|
const u = () => i ? e.get(t) : s ? e.has(t) : e?.[t], l = (a) => i ? (e.set(t, a), a) : s ? (a ? e.add(t) : e.delete(t), e.has(t)) : e[t] = a;
|
|
1244
1244
|
i && r !== void 0 && !e.has(t) ? e.set(t, r) : s && r && !e.has(t) && e.add(t);
|
|
1245
1245
|
const f = u();
|
|
1246
|
-
if (!s && t != null && I(f) &&
|
|
1247
|
-
if (!i && !s && t && typeof e?.getProperty == "function" &&
|
|
1246
|
+
if (!s && t != null && I(f) && z(f)) return Pe(Lt(f), t);
|
|
1247
|
+
if (!i && !s && t && typeof e?.getProperty == "function" && z(e?.getProperty?.(t))) return Pe(e?.getProperty?.(t), t);
|
|
1248
1248
|
!i && !s && (e[t] ??= r ?? e[t]);
|
|
1249
|
-
const o =
|
|
1249
|
+
const o = T({
|
|
1250
1250
|
[d]: s ? !!u() : u() ?? r,
|
|
1251
|
-
[
|
|
1251
|
+
[K]: n,
|
|
1252
1252
|
[Symbol?.toStringTag]() {
|
|
1253
1253
|
return String(u() ?? this[d] ?? "") || "";
|
|
1254
1254
|
},
|
|
@@ -1256,19 +1256,19 @@ var H = (e, t) => {
|
|
|
1256
1256
|
return E(u(), a);
|
|
1257
1257
|
},
|
|
1258
1258
|
set value(a) {
|
|
1259
|
-
if (o[
|
|
1259
|
+
if (o[Q] = !0, s) this[d] = l(a);
|
|
1260
1260
|
else {
|
|
1261
1261
|
const v = a ?? dt(u());
|
|
1262
1262
|
this[d] = l(v);
|
|
1263
1263
|
}
|
|
1264
|
-
o[
|
|
1264
|
+
o[Q] = !1;
|
|
1265
1265
|
},
|
|
1266
1266
|
get value() {
|
|
1267
1267
|
const a = u();
|
|
1268
1268
|
return this[d] = s ? !!a : a ?? this[d];
|
|
1269
1269
|
}
|
|
1270
1270
|
});
|
|
1271
|
-
|
|
1271
|
+
Pe(o, t);
|
|
1272
1272
|
const y = b(e, (a, v, A, w) => {
|
|
1273
1273
|
if (v === t) {
|
|
1274
1274
|
const O = s ? a != null : a, k = s ? A != null : A;
|
|
@@ -1286,40 +1286,40 @@ var H = (e, t) => {
|
|
|
1286
1286
|
case "boolean":
|
|
1287
1287
|
return Qt(e, t);
|
|
1288
1288
|
case "number":
|
|
1289
|
-
return
|
|
1289
|
+
return jt(e, t);
|
|
1290
1290
|
case "string":
|
|
1291
1291
|
return Jt(e, t);
|
|
1292
1292
|
case "object":
|
|
1293
|
-
if (e != null) return
|
|
1293
|
+
if (e != null) return Xe(T(e), t);
|
|
1294
1294
|
default:
|
|
1295
|
-
return
|
|
1295
|
+
return Xe(e, t);
|
|
1296
1296
|
}
|
|
1297
1297
|
}, Zt = (e, t = "value", r) => {
|
|
1298
|
-
const n =
|
|
1298
|
+
const n = z(e) ? e : Yt(e, r);
|
|
1299
1299
|
return t != null ? Xt(n, t, r) : n;
|
|
1300
|
-
},
|
|
1300
|
+
}, gr = (e, t) => Zt(e, t), Ce = (e, t, r = 100) => {
|
|
1301
1301
|
if (e?.value ?? e) return setTimeout(() => {
|
|
1302
1302
|
e.value && t?.();
|
|
1303
1303
|
}, r);
|
|
1304
|
-
},
|
|
1305
|
-
let i =
|
|
1304
|
+
}, Ar = (e = 100) => (t, [r], [n]) => {
|
|
1305
|
+
let i = Ce(r, t, e);
|
|
1306
1306
|
n?.addEventListener?.("abort", () => {
|
|
1307
1307
|
i && clearTimeout(i);
|
|
1308
1308
|
}, { once: !0 });
|
|
1309
|
-
},
|
|
1310
|
-
let i =
|
|
1309
|
+
}, Or = (e = 100) => (t, [r], [n]) => {
|
|
1310
|
+
let i = Ce(r, t, e);
|
|
1311
1311
|
n?.addEventListener?.("abort", () => {
|
|
1312
1312
|
i && clearTimeout(i);
|
|
1313
1313
|
}, { once: !0 }), i || t?.();
|
|
1314
1314
|
};
|
|
1315
|
-
function
|
|
1316
|
-
if (e == null || typeof e == "symbol" || !(typeof e == "object" || typeof e == "function") ||
|
|
1315
|
+
function T(e, t) {
|
|
1316
|
+
if (e == null || typeof e == "symbol" || !(typeof e == "object" || typeof e == "function") || Y(e) || (e = V?.(e)) == null || e instanceof Promise || e instanceof WeakRef || Y(e)) return e;
|
|
1317
1317
|
const r = e;
|
|
1318
1318
|
if (r == null || typeof r == "symbol" || !(typeof r == "object" || typeof r == "function") || r instanceof Promise || r instanceof WeakRef) return r;
|
|
1319
1319
|
let n = r;
|
|
1320
|
-
return Array.isArray(r) ? (n =
|
|
1320
|
+
return Array.isArray(r) ? (n = _e(r), n) : r instanceof Map ? (n = qt(r), n) : r instanceof Set ? (n = Ut(r), n) : ((typeof r == "function" || typeof r == "object") && (n = Kt(r)), n);
|
|
1321
1321
|
}
|
|
1322
|
-
var
|
|
1322
|
+
var z = (e) => typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ? !0 : !!((typeof e == "object" || typeof e == "function") && e != null && (e?.[g] || e?.[ue] || p?.has?.(e))), Lt = (e) => z(e) ? T(e) : null, xr = (e) => {
|
|
1323
1323
|
if (e == null || typeof e != "object" && typeof e != "function" || e?.[Symbol.observable] != null) return e;
|
|
1324
1324
|
try {
|
|
1325
1325
|
e[Symbol.observable] = self?.compatible;
|
|
@@ -1330,18 +1330,18 @@ var C = (e) => typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ?
|
|
|
1330
1330
|
const i = e?.[Symbol?.observable];
|
|
1331
1331
|
return i?.()?.affected?.(t, r, n), () => i?.()?.unaffected?.(t, r);
|
|
1332
1332
|
}, e;
|
|
1333
|
-
}, U = /* @__PURE__ */ new WeakMap(),
|
|
1333
|
+
}, er = /* @__PURE__ */ Symbol.for("object.ts@specializedSubscribe"), U = globalThis[er] ??= /* @__PURE__ */ new WeakMap(), Ne = (e) => {
|
|
1334
1334
|
if (!(typeof e == "symbol" || e == null || !(typeof e == "object" || typeof e == "function")))
|
|
1335
1335
|
return e;
|
|
1336
1336
|
}, Se = "initial", De = (e) => {
|
|
1337
1337
|
const t = e?.[de] ?? e?.realProp;
|
|
1338
|
-
return
|
|
1338
|
+
return C(t) ? t : null;
|
|
1339
1339
|
}, Be = (e, t) => {
|
|
1340
1340
|
const r = De(e);
|
|
1341
1341
|
return r != null && (t == null || t == "value") ? r : t;
|
|
1342
|
-
},
|
|
1342
|
+
}, tr = (e, t) => t != null && t == De(e) ? e?.value : e?.[t], $e = (e, t, r, n) => {
|
|
1343
1343
|
if (t != null && t == De(e)) {
|
|
1344
|
-
const i =
|
|
1344
|
+
const i = tr(e, t);
|
|
1345
1345
|
if (i != null) return r?.(i, t, null, "set");
|
|
1346
1346
|
}
|
|
1347
1347
|
return ae(e, t, r, n);
|
|
@@ -1349,27 +1349,27 @@ var C = (e) => typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ?
|
|
|
1349
1349
|
const n = ge(t);
|
|
1350
1350
|
if (r == Se) {
|
|
1351
1351
|
if (!n.triggerImmediately) return;
|
|
1352
|
-
} else if (!
|
|
1352
|
+
} else if (!J(n.affectTypes, r)) return;
|
|
1353
1353
|
return (i, s, u, ...l) => e?.(i, s, u, r, ...l);
|
|
1354
|
-
},
|
|
1355
|
-
if (!e || !
|
|
1354
|
+
}, rr = (e, t, r, n = ["*"]) => {
|
|
1355
|
+
if (!e || !Ne(e)) return;
|
|
1356
1356
|
const i = t != Symbol.iterator ? Be(e, t) : null;
|
|
1357
1357
|
let s = e?.[se] ?? p.get(e);
|
|
1358
1358
|
e = e?.[g] ?? e, queueMicrotask(() => {
|
|
1359
1359
|
const l = ot(r, n, Se);
|
|
1360
|
-
l && (i != null && i != Symbol.iterator ?
|
|
1360
|
+
l && (i != null && i != Symbol.iterator ? $e(e, i, l, null) : Ve(e, l, null));
|
|
1361
1361
|
});
|
|
1362
1362
|
let u = s?.affected?.(r, i, n);
|
|
1363
1363
|
return e?.[Symbol.dispose] || (M(u, Symbol.dispose, u), M(u, Symbol.asyncDispose, u), M(e, Symbol.dispose, u), M(e, Symbol.asyncDispose, u)), u;
|
|
1364
|
-
},
|
|
1364
|
+
}, nr = (e, t, r, n = ["*"]) => {
|
|
1365
1365
|
const i = ge(n).affectTypes, s = {};
|
|
1366
1366
|
let u = e?.value;
|
|
1367
1367
|
const l = (f) => {
|
|
1368
1368
|
const o = f?.target?.value;
|
|
1369
|
-
|
|
1369
|
+
J(i, "set") && r?.(o, "value", u, "set", f), u = o;
|
|
1370
1370
|
};
|
|
1371
1371
|
return e?.addEventListener?.("change", l, s), () => e?.removeEventListener?.("change", l, s);
|
|
1372
|
-
}, ne = (e) => Array.isArray(e) && e?.length == 2 &&
|
|
1372
|
+
}, ne = (e) => Array.isArray(e) && e?.length == 2 && Ne(e?.[0]) && (C(e?.[1]) || e?.[1] == Symbol.iterator), ir = (e) => !!e && typeof e == "object" && !Array.isArray(e) && ("affectTypes" in e || "triggers" in e || "triggerImmediately" in e), lr = (e) => e == null ? [] : Array.isArray(e) && !ne(e) && !z(e) ? e : [e], sr = (e) => {
|
|
1373
1373
|
if (ne(e)) {
|
|
1374
1374
|
const t = e?.[0];
|
|
1375
1375
|
return {
|
|
@@ -1383,7 +1383,7 @@ var C = (e) => typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ?
|
|
|
1383
1383
|
target: e,
|
|
1384
1384
|
prop: null
|
|
1385
1385
|
};
|
|
1386
|
-
},
|
|
1386
|
+
}, ur = (e, t, r, n, i, s, u) => ({
|
|
1387
1387
|
source: e,
|
|
1388
1388
|
target: t,
|
|
1389
1389
|
value: r,
|
|
@@ -1392,42 +1392,42 @@ var C = (e) => typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ?
|
|
|
1392
1392
|
oldValue: i,
|
|
1393
1393
|
trigger: s,
|
|
1394
1394
|
args: u
|
|
1395
|
-
}),
|
|
1396
|
-
const i =
|
|
1395
|
+
}), fr = (e, t, r, n = ["*"]) => {
|
|
1396
|
+
const i = C(e?.[1]) ? e?.[1] : null;
|
|
1397
1397
|
return b(e?.[0], i, r, n);
|
|
1398
|
-
},
|
|
1398
|
+
}, or = (e, t, r, n = ["*"]) => e?.then?.((i) => b?.(i, t, r, n))?.catch?.((i) => (console.warn(i), null)), b = (e, t, r = () => {
|
|
1399
1399
|
}, n) => {
|
|
1400
1400
|
if (typeof t == "function" ? (n = r, r = t, t = null) : t = Be(e, t), (typeof r == "object" || Array.isArray(r)) && (n = r, r = () => {
|
|
1401
1401
|
}), (m(e) || typeof e == "symbol") && ge(n).triggerImmediately)
|
|
1402
1402
|
return Ee(globalThis?.Promise?.try?.(() => r?.(e, null, null, null, Se)));
|
|
1403
1403
|
if (typeof e?.[ue] == "function") return e?.[ue]?.(r, t, n);
|
|
1404
|
-
if (
|
|
1404
|
+
if (Ne(e)) {
|
|
1405
1405
|
const i = e;
|
|
1406
1406
|
if (U?.has?.(e = e?.[g] ?? e)) return U?.get?.(e)?.(i, t, r, n);
|
|
1407
|
-
if (
|
|
1407
|
+
if (z(i) || ne(e) && z(e?.[0])) return We(e) ? U?.getOrInsert?.(e, or)?.(e, t, r, n) : ne(e) ? U?.getOrInsert?.(e, fr)?.(e, t, r, n) : typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ? U?.getOrInsert?.(e, nr)?.(e, t, r, n) : U?.getOrInsert?.(e, rr)?.(i, t, r, n);
|
|
1408
1408
|
{
|
|
1409
1409
|
const s = ot(r, n, Se);
|
|
1410
|
-
return s ? Ee(globalThis?.Promise?.try?.(() => ne(e) ?
|
|
1410
|
+
return s ? Ee(globalThis?.Promise?.try?.(() => ne(e) ? $e?.(e?.[0], e?.[1], s, null) : t != null && t != Symbol.iterator ? $e?.(e, t, s, null) : Ve?.(e, s, null))) : void 0;
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
1413
|
};
|
|
1414
|
-
function
|
|
1414
|
+
function cr(e, t, r) {
|
|
1415
1415
|
if (e == null || typeof e != "function") return;
|
|
1416
|
-
if (
|
|
1417
|
-
if (t == null) return
|
|
1416
|
+
if (ir(t) && r === void 0) return je(e, t);
|
|
1417
|
+
if (t == null) return je(e, r);
|
|
1418
1418
|
const n = ut(r), i = {
|
|
1419
1419
|
affectTypes: n.affectTypes,
|
|
1420
1420
|
triggerImmediately: n.triggerImmediately
|
|
1421
|
-
}, s =
|
|
1422
|
-
const l =
|
|
1423
|
-
return b(l.target, l.prop, (f, o, y, a, ...v) => e(
|
|
1421
|
+
}, s = lr(t).map((u) => {
|
|
1422
|
+
const l = sr(u);
|
|
1423
|
+
return b(l.target, l.prop, (f, o, y, a, ...v) => e(ur(l.source, l.target, f, o, y, a ?? null, v)), i);
|
|
1424
1424
|
}).filter((u) => typeof u == "function");
|
|
1425
1425
|
return () => s.forEach((u) => u?.());
|
|
1426
1426
|
}
|
|
1427
|
-
function
|
|
1428
|
-
return
|
|
1427
|
+
function wr(e, t, r) {
|
|
1428
|
+
return cr(t, e, r);
|
|
1429
1429
|
}
|
|
1430
|
-
var
|
|
1430
|
+
var Rr = (e) => e instanceof Set ? ct(e) : e instanceof Map ? vr(e) : e, yr = class {
|
|
1431
1431
|
#t = /* @__PURE__ */ new WeakMap();
|
|
1432
1432
|
#e(e) {
|
|
1433
1433
|
let t = this.#t.get(e);
|
|
@@ -1474,8 +1474,8 @@ var xr = (e) => e instanceof Set ? ct(e) : e instanceof Map ? hr(e) : e, or = cl
|
|
|
1474
1474
|
const s = t([r, n]);
|
|
1475
1475
|
return i.set(n, s), s;
|
|
1476
1476
|
}
|
|
1477
|
-
}, Me = new
|
|
1478
|
-
function
|
|
1477
|
+
}, Me = new yr();
|
|
1478
|
+
function ar(e, t, r = ["*"]) {
|
|
1479
1479
|
if (!e) return;
|
|
1480
1480
|
if (Me.has([e, t])) return Me.get([e, t]);
|
|
1481
1481
|
const n = (i, s, u, l) => {
|
|
@@ -1485,31 +1485,31 @@ function cr(e, t, r = ["*"]) {
|
|
|
1485
1485
|
const v = a ?? (u?.value ?? u)?.[y] ?? null, A = o?.[y];
|
|
1486
1486
|
v == null && A != null ? t(A, y, null, "add") : v != null && A == null ? t(null, y, v, "delete") : x(v, A) && t(A, y, v, "set");
|
|
1487
1487
|
}
|
|
1488
|
-
return
|
|
1488
|
+
return ar(i ?? e?.value, t, r);
|
|
1489
1489
|
}
|
|
1490
1490
|
return s == null ? void 0 : e[s];
|
|
1491
1491
|
};
|
|
1492
|
-
return Me.getOrInsertComputed([e, t], () => e instanceof Set ? b([ct(e), Symbol.iterator], t, r) : e instanceof Map ? b(e, t, r) : I(e) ? b(e, n, r) : Array.isArray(e) && !(e?.length == 2 &&
|
|
1492
|
+
return Me.getOrInsertComputed([e, t], () => e instanceof Set ? b([ct(e), Symbol.iterator], t, r) : e instanceof Map ? b(e, t, r) : I(e) ? b(e, n, r) : Array.isArray(e) && !(e?.length == 2 && C(e?.[1]) && z(e?.[0])) ? b([e, Symbol.iterator], t, r) : b(e, t, r));
|
|
1493
1493
|
}
|
|
1494
1494
|
function Ie(e, t) {
|
|
1495
1495
|
return xt(e, (r) => {
|
|
1496
|
-
const n = Array.isArray(r) && r?.length == 2 && ["object", "function"].indexOf(typeof r?.[0]) >= 0 &&
|
|
1496
|
+
const n = Array.isArray(r) && r?.length == 2 && ["object", "function"].indexOf(typeof r?.[0]) >= 0 && C(r?.[1]), i = n ? r?.[1] : null;
|
|
1497
1497
|
r = n && i != null ? r?.[0] ?? r : r;
|
|
1498
1498
|
const s = typeof r == "object" || typeof r == "function" ? r?.[g] ?? r : r;
|
|
1499
1499
|
(r?.[se] ?? p.get(s))?.unaffected?.(t, i);
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
|
-
var
|
|
1502
|
+
var hr = (e, t, r) => (b(t, null, (n, i) => {
|
|
1503
1503
|
ie(e, n, i, !0);
|
|
1504
1504
|
}), r?.(() => e, (n) => {
|
|
1505
1505
|
for (const i in n) ie(t, n[i], i, !0);
|
|
1506
|
-
}, { deep: !0 }), e),
|
|
1506
|
+
}, { deep: !0 }), e), Tr = (e, t, r) => hr(t(he(e)), e, r), Pr = (e, t, r = () => "") => b(t, null, (n, i) => {
|
|
1507
1507
|
i == r() && ie(e, n, null, !0);
|
|
1508
|
-
}),
|
|
1509
|
-
const t =
|
|
1508
|
+
}), Mr = (e = []) => {
|
|
1509
|
+
const t = T({ value: 0 }), r = (l) => typeof l == "function" ? l() : I(l) ? l.value : l, i = br([t, "value"], () => e.findIndex((l) => !!r(l)), "value"), s = () => {
|
|
1510
1510
|
t.value++;
|
|
1511
1511
|
}, u = [];
|
|
1512
|
-
|
|
1512
|
+
z(e) && u.push(b(e, s, {
|
|
1513
1513
|
affectTypes: [
|
|
1514
1514
|
"add",
|
|
1515
1515
|
"set",
|
|
@@ -1522,11 +1522,11 @@ var yr = (e, t, r) => (b(t, null, (n, i) => {
|
|
|
1522
1522
|
triggerImmediately: !1
|
|
1523
1523
|
}));
|
|
1524
1524
|
return M(i, Symbol.dispose, () => u.forEach((l) => l?.())), i;
|
|
1525
|
-
},
|
|
1525
|
+
}, dr = (e, t, r, n) => {
|
|
1526
1526
|
if (m(e)) return e ? t : r;
|
|
1527
|
-
const i = () => t, s = () => r, u = (o) => (o != null && (e.value = I(o) ? o?.value : o), (I(e) ? e?.value : e) ? i() : s()), l =
|
|
1527
|
+
const i = () => t, s = () => r, u = (o) => (o != null && (e.value = I(o) ? o?.value : o), (I(e) ? e?.value : e) ? i() : s()), l = T({
|
|
1528
1528
|
[d]: u(),
|
|
1529
|
-
[
|
|
1529
|
+
[K]: n,
|
|
1530
1530
|
[Symbol?.toStringTag]() {
|
|
1531
1531
|
return String(u() ?? this[d] ?? "") || "";
|
|
1532
1532
|
},
|
|
@@ -1549,21 +1549,21 @@ var yr = (e, t, r) => (b(t, null, (n, i) => {
|
|
|
1549
1549
|
});
|
|
1550
1550
|
});
|
|
1551
1551
|
return M(l, Symbol.dispose, f), l;
|
|
1552
|
-
},
|
|
1553
|
-
r || (r =
|
|
1552
|
+
}, Ir = dr, kr = (e, t, r) => {
|
|
1553
|
+
r || (r = T({}));
|
|
1554
1554
|
const n = b(e, (i, s, u) => {
|
|
1555
1555
|
if (s == null) return;
|
|
1556
1556
|
const l = t?.(i, s, u);
|
|
1557
1557
|
typeof l == "object" ? St(r, l) : x(r[s], l) && (r[s] = l);
|
|
1558
1558
|
});
|
|
1559
1559
|
return r && M(r, Symbol.dispose, n), r;
|
|
1560
|
-
},
|
|
1561
|
-
const t =
|
|
1560
|
+
}, Er = (...e) => {
|
|
1561
|
+
const t = T({});
|
|
1562
1562
|
return e?.forEach?.((r) => b(r, (n, i, s) => {
|
|
1563
1563
|
i != null && x(t[i], n) && (t[i] = n);
|
|
1564
1564
|
})), t;
|
|
1565
1565
|
}, ct = (e) => {
|
|
1566
|
-
const t =
|
|
1566
|
+
const t = T([]);
|
|
1567
1567
|
return t.push(...Array.from(e?.values?.() || [])), M(t, Symbol.dispose, b(e, (r, n, i) => {
|
|
1568
1568
|
if (x(r, i)) if (i == null && r != null) t.push(r);
|
|
1569
1569
|
else if (i != null && r == null) {
|
|
@@ -1574,8 +1574,8 @@ var yr = (e, t, r) => (b(t, null, (n, i) => {
|
|
|
1574
1574
|
s >= 0 && x(t[s], r) && (t[s] = r);
|
|
1575
1575
|
}
|
|
1576
1576
|
})), t;
|
|
1577
|
-
},
|
|
1578
|
-
const t =
|
|
1577
|
+
}, vr = (e) => {
|
|
1578
|
+
const t = T([]), r = Array.from(e.entries());
|
|
1579
1579
|
return t.push(...r), M(t, Symbol.dispose, b(e, (n, i, s) => {
|
|
1580
1580
|
if (x(n, s) || s == null && n != null || s != null && n == null) if (s != null && n == null) {
|
|
1581
1581
|
let u = t.findIndex(([l, f]) => l == i);
|
|
@@ -1585,11 +1585,11 @@ var yr = (e, t, r) => (b(t, null, (n, i) => {
|
|
|
1585
1585
|
u >= 0 && u < t.length ? x(t[u]?.[1], n) && (t[u] = [i, n]) : t.push([i, n]);
|
|
1586
1586
|
}
|
|
1587
1587
|
})), t;
|
|
1588
|
-
}, F = /* @__PURE__ */ new WeakMap(),
|
|
1589
|
-
const n = typeof e?.[1] == "function" && e?.length == 2, i = typeof t?.[1] == "function" && t?.length == 2, s = i ? t?.[1] : null, u = (
|
|
1588
|
+
}, F = /* @__PURE__ */ new WeakMap(), Ye = (e, t, r = "value") => {
|
|
1589
|
+
const n = typeof e?.[1] == "function" && e?.length == 2, i = typeof t?.[1] == "function" && t?.length == 2, s = i ? t?.[1] : null, u = (C(e?.[1]) || e?.[1] == Symbol.iterator) && e?.length == 2;
|
|
1590
1590
|
let l = u && !n ? e?.[1] : Array.isArray(e) ? null : r;
|
|
1591
1591
|
!u && !n && (e = [e, l]), n && (e[1] = l);
|
|
1592
|
-
const f = (
|
|
1592
|
+
const f = (C(t?.[1]) || t?.[1] == Symbol.iterator) && t?.length == 2;
|
|
1593
1593
|
let o = f && !i ? t?.[1] : Array.isArray(t) ? null : r;
|
|
1594
1594
|
if (!f && !i && (t = [t, o]), i && (t[1] = o), l == null || o == null || le(l, e?.[0]) || le(o, t?.[0])) return;
|
|
1595
1595
|
if (!((typeof t?.[0] == "object" || typeof t?.[0] == "function") && t?.[0] != null) && !Array.isArray(e[0]))
|
|
@@ -1597,22 +1597,22 @@ var yr = (e, t, r) => (b(t, null, (n, i) => {
|
|
|
1597
1597
|
e[0][l] = t?.[0];
|
|
1598
1598
|
}), () => {
|
|
1599
1599
|
};
|
|
1600
|
-
const y = (q,
|
|
1600
|
+
const y = (q, Z) => {
|
|
1601
1601
|
const B = A?.deref?.(), L = v?.deref?.();
|
|
1602
1602
|
if (F?.get?.(B)?.get?.(l)?.bound == L) {
|
|
1603
1603
|
let Re = null;
|
|
1604
1604
|
const Fe = F?.get?.(B)?.get?.(l)?.cmpfx;
|
|
1605
1605
|
ye(L, () => {
|
|
1606
|
-
typeof Fe == "function" ? Re = Fe?.(
|
|
1606
|
+
typeof Fe == "function" ? Re = Fe?.(He(L) ?? q, Z, null) : Re = L?.[Z] ?? q;
|
|
1607
1607
|
});
|
|
1608
|
-
const
|
|
1609
|
-
x(B[l],
|
|
1610
|
-
B[l] =
|
|
1608
|
+
const Ge = He(Re);
|
|
1609
|
+
x(B[l], Ge) && ye(L, () => {
|
|
1610
|
+
B[l] = Ge;
|
|
1611
1611
|
});
|
|
1612
1612
|
} else F?.get?.(B)?.get?.(l)?.dispose?.();
|
|
1613
1613
|
}, a = () => {
|
|
1614
|
-
const q = A?.deref?.(),
|
|
1615
|
-
|
|
1614
|
+
const q = A?.deref?.(), Z = F?.get?.(q), B = Z?.get?.(l);
|
|
1615
|
+
Z?.delete?.(l), B?.unsub?.();
|
|
1616
1616
|
}, v = t?.[0] != null && (typeof t?.[0] == "object" || typeof t?.[0] == "function") && !(t?.[0] instanceof WeakRef || typeof t?.[0]?.deref == "function") ? new WeakRef(t?.[0]) : t?.[0], A = e?.[0] != null && (typeof e?.[0] == "object" || typeof e?.[0] == "function") && !(e?.[0] instanceof WeakRef || typeof e?.[0]?.deref == "function") ? new WeakRef(e?.[0]) : e?.[0];
|
|
1617
1617
|
let w = {
|
|
1618
1618
|
compute: y,
|
|
@@ -1629,20 +1629,20 @@ var yr = (e, t, r) => (b(t, null, (n, i) => {
|
|
|
1629
1629
|
})), w.unsub = b(t, y), w.cmpfx = s, M(O, Symbol.dispose, w?.dispose), M(k, Symbol.dispose, w?.dispose)), k && !Array.isArray(k) && ye(O, () => {
|
|
1630
1630
|
k[o] ??= O?.[l] ?? k[o];
|
|
1631
1631
|
}), w?.dispose;
|
|
1632
|
-
},
|
|
1633
|
-
const n = [
|
|
1632
|
+
}, Wr = (e, t, r = "value") => {
|
|
1633
|
+
const n = [Ye(e, t, r), Ye(t, e, r)];
|
|
1634
1634
|
return () => n?.map?.((i) => i?.());
|
|
1635
|
-
},
|
|
1636
|
-
const i = typeof e?.[1] == "function" && e?.length == 2, s = (
|
|
1635
|
+
}, br = (e, t, r, n = "value") => {
|
|
1636
|
+
const i = typeof e?.[1] == "function" && e?.length == 2, s = (C(e?.[1]) || e?.[1] == Symbol.iterator) && e?.length == 2;
|
|
1637
1637
|
let u = s && !i ? e?.[1] : Array.isArray(e) ? null : n;
|
|
1638
1638
|
if (!s && !i && (e = [s ? e?.[0] : e, u]), i && (e[1] = u), u == null || le(u, e?.[0])) return;
|
|
1639
1639
|
const l = (a) => {
|
|
1640
1640
|
let v;
|
|
1641
1641
|
return a != null && (v = e[0][u], e[0][u] = a), t?.(e?.[0]?.[u], u, v);
|
|
1642
|
-
}, f = l(), o =
|
|
1642
|
+
}, f = l(), o = T({
|
|
1643
1643
|
[oe]: void 0,
|
|
1644
1644
|
[d]: f,
|
|
1645
|
-
[
|
|
1645
|
+
[K]: r,
|
|
1646
1646
|
[Symbol?.toStringTag]() {
|
|
1647
1647
|
return String(l() ?? this[d] ?? "") || "";
|
|
1648
1648
|
},
|
|
@@ -1665,10 +1665,10 @@ var yr = (e, t, r) => (b(t, null, (n, i) => {
|
|
|
1665
1665
|
});
|
|
1666
1666
|
});
|
|
1667
1667
|
return M(o, Symbol.dispose, y), o;
|
|
1668
|
-
},
|
|
1668
|
+
}, _r = (e, t, r = 100) => {
|
|
1669
1669
|
let n;
|
|
1670
1670
|
return b(e, "value", (i) => {
|
|
1671
|
-
!i && n ? (clearTimeout(n), n = null) : i && !n && (n =
|
|
1671
|
+
!i && n ? (clearTimeout(n), n = null) : i && !n && (n = Ce(e, t, r) ?? n);
|
|
1672
1672
|
});
|
|
1673
1673
|
};
|
|
1674
1674
|
export {
|
|
@@ -1679,51 +1679,51 @@ export {
|
|
|
1679
1679
|
me as $triggerLess,
|
|
1680
1680
|
h as $triggerLock,
|
|
1681
1681
|
Rt as AssignObjectHandler,
|
|
1682
|
-
|
|
1682
|
+
yr as DoubleWeakMap,
|
|
1683
1683
|
M as addToCallChain,
|
|
1684
1684
|
b as affected,
|
|
1685
|
-
|
|
1685
|
+
Ye as assign,
|
|
1686
1686
|
F as assignMap,
|
|
1687
|
-
|
|
1688
|
-
|
|
1687
|
+
hr as bindBy,
|
|
1688
|
+
Pr as bindByKey,
|
|
1689
1689
|
Qt as booleanRef,
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1690
|
+
br as computed,
|
|
1691
|
+
Ir as conditional,
|
|
1692
|
+
Mr as conditionalIndex,
|
|
1693
|
+
dr as conditionalRef,
|
|
1694
|
+
Ar as delayedBehavior,
|
|
1695
|
+
Or as delayedOrInstantBehavior,
|
|
1696
|
+
_r as delayedSubscribe,
|
|
1697
1697
|
V as deref,
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1698
|
+
Tr as derivate,
|
|
1699
|
+
cr as effect,
|
|
1700
|
+
wr as effected,
|
|
1701
|
+
z as isObservable,
|
|
1702
|
+
ar as iterated,
|
|
1703
|
+
Wr as link,
|
|
1704
|
+
Rr as makeArrayObservable,
|
|
1705
|
+
pr as makeObjectAssignable,
|
|
1706
|
+
jt as numberRef,
|
|
1707
|
+
vr as observableByMap,
|
|
1708
1708
|
ct as observableBySet,
|
|
1709
|
-
|
|
1710
|
-
|
|
1709
|
+
T as observe,
|
|
1710
|
+
gr as promised,
|
|
1711
1711
|
Xt as propRef,
|
|
1712
|
-
|
|
1712
|
+
Lt as recoverReactive,
|
|
1713
1713
|
Zt as ref,
|
|
1714
|
-
|
|
1714
|
+
kr as remap,
|
|
1715
1715
|
he as safe,
|
|
1716
1716
|
U as specializedSubscribe,
|
|
1717
1717
|
Jt as stringRef,
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1718
|
+
rr as subscribeDirectly,
|
|
1719
|
+
nr as subscribeInput,
|
|
1720
|
+
fr as subscribePaired,
|
|
1721
|
+
or as subscribeThenable,
|
|
1722
|
+
Ce as triggerWithDelay,
|
|
1723
1723
|
Ie as unaffected,
|
|
1724
|
-
|
|
1724
|
+
Er as unified,
|
|
1725
1725
|
Ot as unwrap,
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1726
|
+
xr as useObservable,
|
|
1727
|
+
Xe as wrapRef,
|
|
1728
|
+
Sr as wrapSetAsArray
|
|
1729
1729
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fest-lib/object",
|
|
3
3
|
"description": "Reactive object utilities and helpers (fest-lib)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"./package.json": "./package.json"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@fest-lib/core": "
|
|
43
|
+
"@fest-lib/core": ">=0.1.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"test": "npm run test:node && npm run test:deno && npm run test:browser",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"build:publish": "FEST_NPM_IMPORTS=1 vite build --config vite.config.js",
|
|
57
57
|
"prepack": "npm run build:publish",
|
|
58
58
|
"preview": "vite preview",
|
|
59
|
-
"
|
|
59
|
+
"release": "PUPPETEER_SKIP_DOWNLOAD=1 npm run build:publish && npm publish --access public --ignore-scripts",
|
|
60
|
+
"publish": "npm run release",
|
|
60
61
|
"docs": "typedoc ./src/index.ts --options ./typedoc.json --out ./docs --tsconfig ./tsconfig.json --excludeExternals --excludePrivate --excludeProtected --skipErrorChecking",
|
|
61
62
|
"docs:clean": "rm -rf ./docs && typedoc --options ./typedoc.json",
|
|
62
63
|
"docs:md": "typedoc --options ./typedoc.md.json",
|
|
@@ -75,6 +76,6 @@
|
|
|
75
76
|
"vite-plugin-optimizer": ">=1.4.3"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
|
-
"@fest-lib/core": "
|
|
79
|
+
"@fest-lib/core": ">=0.1.0"
|
|
79
80
|
}
|
|
80
81
|
}
|