@solidjs/signals 0.8.3 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.js +761 -815
- package/dist/node.cjs +1614 -1858
- package/dist/prod.js +1635 -1790
- package/dist/types/boundaries.d.ts +1 -1
- package/dist/types/core/constants.d.ts +16 -21
- package/dist/types/core/core.d.ts +6 -5
- package/dist/types/core/heap.d.ts +1 -2
- package/dist/types/core/scheduler.d.ts +3 -3
- package/package.json +8 -3
package/dist/node.cjs
CHANGED
|
@@ -1,2264 +1,2020 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor(cause) {
|
|
1
|
+
"use strict";
|
|
2
|
+
class NotReadyError extends Error {
|
|
3
|
+
cause;
|
|
4
|
+
constructor(e) {
|
|
6
5
|
super();
|
|
7
|
-
this.cause =
|
|
6
|
+
this.cause = e;
|
|
8
7
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
8
|
+
}
|
|
9
|
+
class NoOwnerError extends Error {
|
|
11
10
|
constructor() {
|
|
12
11
|
super("");
|
|
13
12
|
}
|
|
14
|
-
};
|
|
15
|
-
var ContextNotFoundError = class extends Error {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(
|
|
18
|
-
""
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// src/core/constants.ts
|
|
24
|
-
var NOT_PENDING = {};
|
|
25
|
-
var SUPPORTS_PROXY = typeof Proxy === "function";
|
|
26
|
-
|
|
27
|
-
// src/core/heap.ts
|
|
28
|
-
function actualInsertIntoHeap(n, heap) {
|
|
29
|
-
var _a, _b, _c;
|
|
30
|
-
const parentHeight = (((_a = n.w) == null ? void 0 : _a.$) ? (_b = n.w.aa) == null ? void 0 : _b.c : (_c = n.w) == null ? void 0 : _c.c) ?? -1;
|
|
31
|
-
if (parentHeight >= n.c)
|
|
32
|
-
n.c = parentHeight + 1;
|
|
33
|
-
const height = n.c;
|
|
34
|
-
const heapAtHeight = heap.s[height];
|
|
35
|
-
if (heapAtHeight === void 0) {
|
|
36
|
-
heap.s[height] = n;
|
|
37
|
-
} else {
|
|
38
|
-
const tail = heapAtHeight.z;
|
|
39
|
-
tail.Q = n;
|
|
40
|
-
n.z = tail;
|
|
41
|
-
heapAtHeight.z = n;
|
|
42
|
-
}
|
|
43
|
-
if (height > heap.L) {
|
|
44
|
-
heap.L = height;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function insertIntoHeap(n, heap) {
|
|
48
|
-
let flags = n.b;
|
|
49
|
-
if (flags & (8 /* InHeap */ | 4 /* RecomputingDeps */))
|
|
50
|
-
return;
|
|
51
|
-
if (flags & 1 /* Check */) {
|
|
52
|
-
n.b = flags & ~(1 /* Check */ | 2 /* Dirty */) | 2 /* Dirty */ | 8 /* InHeap */;
|
|
53
|
-
} else
|
|
54
|
-
n.b = flags | 8 /* InHeap */;
|
|
55
|
-
if (!(flags & 16 /* InHeapHeight */)) {
|
|
56
|
-
actualInsertIntoHeap(n, heap);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function insertIntoHeapHeight(n, heap) {
|
|
60
|
-
let flags = n.b;
|
|
61
|
-
if (flags & (8 /* InHeap */ | 4 /* RecomputingDeps */ | 16 /* InHeapHeight */))
|
|
62
|
-
return;
|
|
63
|
-
n.b = flags | 16 /* InHeapHeight */;
|
|
64
|
-
actualInsertIntoHeap(n, heap);
|
|
65
|
-
}
|
|
66
|
-
function deleteFromHeap(n, heap) {
|
|
67
|
-
const flags = n.b;
|
|
68
|
-
if (!(flags & (8 /* InHeap */ | 16 /* InHeapHeight */)))
|
|
69
|
-
return;
|
|
70
|
-
n.b = flags & ~(8 /* InHeap */ | 16 /* InHeapHeight */);
|
|
71
|
-
const height = n.c;
|
|
72
|
-
if (n.z === n) {
|
|
73
|
-
heap.s[height] = void 0;
|
|
74
|
-
} else {
|
|
75
|
-
const next = n.Q;
|
|
76
|
-
const dhh = heap.s[height];
|
|
77
|
-
const end = next ?? dhh;
|
|
78
|
-
if (n === dhh) {
|
|
79
|
-
heap.s[height] = next;
|
|
80
|
-
} else {
|
|
81
|
-
n.z.Q = next;
|
|
82
|
-
}
|
|
83
|
-
end.z = n.z;
|
|
84
|
-
}
|
|
85
|
-
n.z = n;
|
|
86
|
-
n.Q = void 0;
|
|
87
13
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
heap.ba = true;
|
|
92
|
-
for (let i = 0; i <= heap.L; i++) {
|
|
93
|
-
for (let el = heap.s[i]; el !== void 0; el = el.Q) {
|
|
94
|
-
if (el.b & 8 /* InHeap */)
|
|
95
|
-
markNode(el);
|
|
96
|
-
}
|
|
14
|
+
class ContextNotFoundError extends Error {
|
|
15
|
+
constructor() {
|
|
16
|
+
super("");
|
|
97
17
|
}
|
|
98
18
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
19
|
+
const e = 0;
|
|
20
|
+
const t = 1 << 0;
|
|
21
|
+
const n = 1 << 1;
|
|
22
|
+
const r = 1 << 2;
|
|
23
|
+
const i = 1 << 3;
|
|
24
|
+
const s = 1 << 4;
|
|
25
|
+
const o = 1 << 5;
|
|
26
|
+
const u = 1 << 6;
|
|
27
|
+
const l = 0;
|
|
28
|
+
const f = 1 << 0;
|
|
29
|
+
const c = 1 << 1;
|
|
30
|
+
const a = 1 << 2;
|
|
31
|
+
const d = 1;
|
|
32
|
+
const h = 2;
|
|
33
|
+
const p = {};
|
|
34
|
+
const y = typeof Proxy === "function";
|
|
35
|
+
const g = {};
|
|
36
|
+
function actualInsertIntoHeap(e, t) {
|
|
37
|
+
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
38
|
+
if (n >= e.o) e.o = n + 1;
|
|
39
|
+
const r = e.o;
|
|
40
|
+
const i = t.l[r];
|
|
41
|
+
if (i === undefined) t.l[r] = e;
|
|
42
|
+
else {
|
|
43
|
+
const t = i.h;
|
|
44
|
+
t.p = e;
|
|
45
|
+
e.h = t;
|
|
46
|
+
i.h = e;
|
|
47
|
+
}
|
|
48
|
+
if (r > t._) t._ = r;
|
|
49
|
+
}
|
|
50
|
+
function insertIntoHeap(e, o) {
|
|
51
|
+
let u = e.S;
|
|
52
|
+
if (u & (i | r)) return;
|
|
53
|
+
if (u & t) {
|
|
54
|
+
e.S = (u & -4) | n | i;
|
|
55
|
+
} else e.S = u | i;
|
|
56
|
+
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
57
|
+
}
|
|
58
|
+
function insertIntoHeapHeight(e, t) {
|
|
59
|
+
let n = e.S;
|
|
60
|
+
if (n & (i | r | s)) return;
|
|
61
|
+
e.S = n | s;
|
|
62
|
+
actualInsertIntoHeap(e, t);
|
|
63
|
+
}
|
|
64
|
+
function deleteFromHeap(e, t) {
|
|
65
|
+
const n = e.S;
|
|
66
|
+
if (!(n & (i | s))) return;
|
|
67
|
+
e.S = n & -25;
|
|
68
|
+
const r = e.o;
|
|
69
|
+
if (e.h === e) t.l[r] = undefined;
|
|
70
|
+
else {
|
|
71
|
+
const n = e.p;
|
|
72
|
+
const i = t.l[r];
|
|
73
|
+
const s = n ?? i;
|
|
74
|
+
if (e === i) t.l[r] = n;
|
|
75
|
+
else e.h.p = n;
|
|
76
|
+
s.h = e.h;
|
|
77
|
+
}
|
|
78
|
+
e.h = e;
|
|
79
|
+
e.p = undefined;
|
|
80
|
+
}
|
|
81
|
+
function markHeap(e) {
|
|
82
|
+
if (e.m) return;
|
|
83
|
+
e.m = true;
|
|
84
|
+
for (let t = 0; t <= e._; t++) {
|
|
85
|
+
for (let n = e.l[t]; n !== undefined; n = n.p) {
|
|
86
|
+
if (n.S & i) markNode(n);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function markNode(e, r = n) {
|
|
91
|
+
const i = e.S;
|
|
92
|
+
if ((i & (t | n)) >= r) return;
|
|
93
|
+
e.S = (i & -4) | r;
|
|
94
|
+
for (let n = e.O; n !== null; n = n.C) {
|
|
95
|
+
markNode(n.N, t);
|
|
96
|
+
}
|
|
97
|
+
if (e.k !== null) {
|
|
98
|
+
for (let n = e.k; n !== null; n = n.j) {
|
|
99
|
+
for (let e = n.O; e !== null; e = e.C) {
|
|
100
|
+
markNode(e.N, t);
|
|
111
101
|
}
|
|
112
102
|
}
|
|
113
103
|
}
|
|
114
104
|
}
|
|
115
|
-
function runHeap(
|
|
116
|
-
|
|
117
|
-
for (
|
|
118
|
-
let
|
|
119
|
-
while (
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
adjustHeight(el, heap);
|
|
124
|
-
}
|
|
125
|
-
el = heap.s[heap.q];
|
|
105
|
+
function runHeap(e, t) {
|
|
106
|
+
e.m = false;
|
|
107
|
+
for (e.A = 0; e.A <= e._; e.A++) {
|
|
108
|
+
let n = e.l[e.A];
|
|
109
|
+
while (n !== undefined) {
|
|
110
|
+
if (n.S & i) t(n);
|
|
111
|
+
else adjustHeight(n, e);
|
|
112
|
+
n = e.l[e.A];
|
|
126
113
|
}
|
|
127
114
|
}
|
|
128
|
-
|
|
115
|
+
e._ = 0;
|
|
129
116
|
}
|
|
130
|
-
function adjustHeight(
|
|
131
|
-
deleteFromHeap(
|
|
132
|
-
let
|
|
133
|
-
for (let
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
if (dep.c >= newHeight) {
|
|
138
|
-
newHeight = dep.c + 1;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
117
|
+
function adjustHeight(e, t) {
|
|
118
|
+
deleteFromHeap(e, t);
|
|
119
|
+
let n = e.o;
|
|
120
|
+
for (let t = e.W; t; t = t.P) {
|
|
121
|
+
const e = t.H;
|
|
122
|
+
const r = e.I || e;
|
|
123
|
+
if (r.F && r.o >= n) n = r.o + 1;
|
|
141
124
|
}
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
for (let
|
|
145
|
-
insertIntoHeapHeight(
|
|
125
|
+
if (e.o !== n) {
|
|
126
|
+
e.o = n;
|
|
127
|
+
for (let n = e.O; n !== null; n = n.C) {
|
|
128
|
+
insertIntoHeapHeight(n.N, t);
|
|
146
129
|
}
|
|
147
130
|
}
|
|
148
131
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
132
|
+
const w = new Set();
|
|
133
|
+
const _ = { l: new Array(2e3).fill(undefined), m: false, A: 0, _: 0 };
|
|
134
|
+
const S = { l: new Array(2e3).fill(undefined), m: false, A: 0, _: 0 };
|
|
135
|
+
let b = 0;
|
|
136
|
+
let m = null;
|
|
137
|
+
let x = false;
|
|
155
138
|
function schedule() {
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
created = clock;
|
|
179
|
-
addChild(child) {
|
|
180
|
-
this.m.push(child);
|
|
181
|
-
child.w = this;
|
|
182
|
-
}
|
|
183
|
-
removeChild(child) {
|
|
184
|
-
const index = this.m.indexOf(child);
|
|
185
|
-
if (index >= 0) {
|
|
186
|
-
this.m.splice(index, 1);
|
|
187
|
-
child.w = null;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
notify(node, mask, flags) {
|
|
191
|
-
if (this.w)
|
|
192
|
-
return this.w.notify(node, mask, flags);
|
|
139
|
+
if (x) return;
|
|
140
|
+
x = true;
|
|
141
|
+
if (!O.R) queueMicrotask(flush);
|
|
142
|
+
}
|
|
143
|
+
class Queue {
|
|
144
|
+
i = null;
|
|
145
|
+
V = [[], []];
|
|
146
|
+
q = [];
|
|
147
|
+
created = b;
|
|
148
|
+
addChild(e) {
|
|
149
|
+
this.q.push(e);
|
|
150
|
+
e.i = this;
|
|
151
|
+
}
|
|
152
|
+
removeChild(e) {
|
|
153
|
+
const t = this.q.indexOf(e);
|
|
154
|
+
if (t >= 0) {
|
|
155
|
+
this.q.splice(t, 1);
|
|
156
|
+
e.i = null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
notify(e, t, n) {
|
|
160
|
+
if (this.i) return this.i.notify(e, t, n);
|
|
193
161
|
return false;
|
|
194
162
|
}
|
|
195
|
-
run(
|
|
196
|
-
if (this.
|
|
197
|
-
const
|
|
198
|
-
this.
|
|
199
|
-
runQueue(
|
|
163
|
+
run(e) {
|
|
164
|
+
if (this.V[e - 1].length) {
|
|
165
|
+
const t = this.V[e - 1];
|
|
166
|
+
this.V[e - 1] = [];
|
|
167
|
+
runQueue(t, e);
|
|
200
168
|
}
|
|
201
|
-
for (let
|
|
202
|
-
this.
|
|
169
|
+
for (let t = 0; t < this.q.length; t++) {
|
|
170
|
+
this.q[t].run(e);
|
|
203
171
|
}
|
|
204
172
|
}
|
|
205
|
-
enqueue(
|
|
206
|
-
if (
|
|
207
|
-
this.k[type - 1].push(fn);
|
|
173
|
+
enqueue(e, t) {
|
|
174
|
+
if (e) this.V[e - 1].push(t);
|
|
208
175
|
schedule();
|
|
209
176
|
}
|
|
210
|
-
stashQueues(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
this.
|
|
214
|
-
for (let
|
|
215
|
-
let
|
|
216
|
-
let
|
|
217
|
-
if (!
|
|
218
|
-
|
|
219
|
-
|
|
177
|
+
stashQueues(e) {
|
|
178
|
+
e.V[0].push(...this.V[0]);
|
|
179
|
+
e.V[1].push(...this.V[1]);
|
|
180
|
+
this.V = [[], []];
|
|
181
|
+
for (let t = 0; t < this.q.length; t++) {
|
|
182
|
+
let n = this.q[t];
|
|
183
|
+
let r = e.q[t];
|
|
184
|
+
if (!r) {
|
|
185
|
+
r = { V: [[], []], q: [] };
|
|
186
|
+
e.q[t] = r;
|
|
220
187
|
}
|
|
221
|
-
|
|
188
|
+
n.stashQueues(r);
|
|
222
189
|
}
|
|
223
190
|
}
|
|
224
|
-
restoreQueues(
|
|
225
|
-
this.
|
|
226
|
-
this.
|
|
227
|
-
for (let
|
|
228
|
-
const
|
|
229
|
-
let
|
|
230
|
-
if (
|
|
231
|
-
child.restoreQueues(childStub);
|
|
191
|
+
restoreQueues(e) {
|
|
192
|
+
this.V[0].push(...e.V[0]);
|
|
193
|
+
this.V[1].push(...e.V[1]);
|
|
194
|
+
for (let t = 0; t < e.q.length; t++) {
|
|
195
|
+
const n = e.q[t];
|
|
196
|
+
let r = this.q[t];
|
|
197
|
+
if (r) r.restoreQueues(n);
|
|
232
198
|
}
|
|
233
199
|
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
static
|
|
239
|
-
static
|
|
200
|
+
}
|
|
201
|
+
class GlobalQueue extends Queue {
|
|
202
|
+
R = false;
|
|
203
|
+
M = [];
|
|
204
|
+
static D;
|
|
205
|
+
static B;
|
|
240
206
|
flush() {
|
|
241
|
-
if (this.
|
|
242
|
-
|
|
243
|
-
this.da = true;
|
|
207
|
+
if (this.R) return;
|
|
208
|
+
this.R = true;
|
|
244
209
|
try {
|
|
245
|
-
runHeap(
|
|
246
|
-
if (
|
|
247
|
-
if (!transitionComplete(
|
|
248
|
-
runHeap(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
runPending(
|
|
254
|
-
|
|
210
|
+
runHeap(_, GlobalQueue.D);
|
|
211
|
+
if (m) {
|
|
212
|
+
if (!transitionComplete(m)) {
|
|
213
|
+
runHeap(S, GlobalQueue.D);
|
|
214
|
+
this.M = [];
|
|
215
|
+
this.stashQueues(m.queueStash);
|
|
216
|
+
b++;
|
|
217
|
+
x = false;
|
|
218
|
+
runPending(m.pendingNodes, true);
|
|
219
|
+
m = null;
|
|
255
220
|
return;
|
|
256
221
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if (runPending(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
n.e = NOT_PENDING;
|
|
222
|
+
this.M.push(...m.pendingNodes);
|
|
223
|
+
this.restoreQueues(m.queueStash);
|
|
224
|
+
w.delete(m);
|
|
225
|
+
m = null;
|
|
226
|
+
if (runPending(this.M, false)) runHeap(_, GlobalQueue.D);
|
|
227
|
+
} else if (w.size) runHeap(S, GlobalQueue.D);
|
|
228
|
+
for (let e = 0; e < this.M.length; e++) {
|
|
229
|
+
const t = this.M[e];
|
|
230
|
+
if (t.K !== p) {
|
|
231
|
+
t.G = t.K;
|
|
232
|
+
t.K = p;
|
|
233
|
+
if (t.T) t.U = true;
|
|
270
234
|
}
|
|
271
|
-
if (
|
|
272
|
-
_GlobalQueue.la(n, false, true);
|
|
235
|
+
if (t.F) GlobalQueue.B(t, false, true);
|
|
273
236
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
this.run(
|
|
278
|
-
this.run(
|
|
237
|
+
this.M.length = 0;
|
|
238
|
+
b++;
|
|
239
|
+
x = false;
|
|
240
|
+
this.run(d);
|
|
241
|
+
this.run(h);
|
|
279
242
|
} finally {
|
|
280
|
-
this.
|
|
243
|
+
this.R = false;
|
|
281
244
|
}
|
|
282
245
|
}
|
|
283
|
-
notify(
|
|
284
|
-
if (
|
|
285
|
-
if (
|
|
286
|
-
if (
|
|
287
|
-
|
|
246
|
+
notify(e, t, n) {
|
|
247
|
+
if (t & f) {
|
|
248
|
+
if (n & f) {
|
|
249
|
+
if (m && !m.asyncNodes.includes(e.L.cause)) {
|
|
250
|
+
m.asyncNodes.push(e.L.cause);
|
|
251
|
+
schedule();
|
|
252
|
+
}
|
|
288
253
|
}
|
|
289
254
|
return true;
|
|
290
255
|
}
|
|
291
256
|
return false;
|
|
292
257
|
}
|
|
293
|
-
initTransition(
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
activeTransition = node.T ?? {
|
|
298
|
-
time: clock,
|
|
299
|
-
pendingNodes: [],
|
|
300
|
-
asyncNodes: [],
|
|
301
|
-
queueStash: { k: [[], []], m: [] }
|
|
302
|
-
};
|
|
258
|
+
initTransition(e) {
|
|
259
|
+
if (m && m.time === b) return;
|
|
260
|
+
if (!m) {
|
|
261
|
+
m = e.J ?? { time: b, pendingNodes: [], asyncNodes: [], queueStash: { V: [[], []], q: [] } };
|
|
303
262
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
for (let
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
263
|
+
w.add(m);
|
|
264
|
+
m.time = b;
|
|
265
|
+
for (let e = 0; e < this.M.length; e++) {
|
|
266
|
+
const t = this.M[e];
|
|
267
|
+
t.J = m;
|
|
268
|
+
m.pendingNodes.push(t);
|
|
310
269
|
}
|
|
311
|
-
|
|
270
|
+
this.M = m.pendingNodes;
|
|
312
271
|
}
|
|
313
|
-
}
|
|
314
|
-
function runPending(
|
|
315
|
-
let
|
|
316
|
-
const
|
|
317
|
-
for (let
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
if (
|
|
321
|
-
|
|
322
|
-
|
|
272
|
+
}
|
|
273
|
+
function runPending(e, t) {
|
|
274
|
+
let n = false;
|
|
275
|
+
const r = e.slice();
|
|
276
|
+
for (let e = 0; e < r.length; e++) {
|
|
277
|
+
const i = r[e];
|
|
278
|
+
i.J = m;
|
|
279
|
+
if (i.X) {
|
|
280
|
+
i.X.Y(t);
|
|
281
|
+
n = true;
|
|
282
|
+
}
|
|
283
|
+
if (i.Z && i.Z.K !== p) {
|
|
284
|
+
i.Z.Y(i.Z.K);
|
|
285
|
+
i.Z.K = p;
|
|
286
|
+
n = true;
|
|
323
287
|
}
|
|
324
288
|
}
|
|
325
|
-
return
|
|
289
|
+
return n;
|
|
326
290
|
}
|
|
327
|
-
|
|
291
|
+
const O = new GlobalQueue();
|
|
328
292
|
function flush() {
|
|
329
|
-
while (
|
|
330
|
-
|
|
293
|
+
while (x) {
|
|
294
|
+
O.flush();
|
|
331
295
|
}
|
|
332
296
|
}
|
|
333
|
-
function runQueue(
|
|
334
|
-
for (let
|
|
335
|
-
queue[i](type);
|
|
297
|
+
function runQueue(e, t) {
|
|
298
|
+
for (let n = 0; n < e.length; n++) e[n](t);
|
|
336
299
|
}
|
|
337
|
-
function transitionComplete(
|
|
338
|
-
let
|
|
339
|
-
for (let
|
|
340
|
-
if (
|
|
341
|
-
|
|
300
|
+
function transitionComplete(e) {
|
|
301
|
+
let t = true;
|
|
302
|
+
for (let n = 0; n < e.asyncNodes.length; n++) {
|
|
303
|
+
if (e.asyncNodes[n].$ & f) {
|
|
304
|
+
t = false;
|
|
342
305
|
break;
|
|
343
306
|
}
|
|
344
307
|
}
|
|
345
|
-
return
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
308
|
+
return t;
|
|
309
|
+
}
|
|
310
|
+
function runInTransition(e, t) {
|
|
311
|
+
const n = m;
|
|
312
|
+
m = e.J;
|
|
313
|
+
t(e);
|
|
314
|
+
m = n;
|
|
315
|
+
}
|
|
316
|
+
GlobalQueue.D = recompute;
|
|
317
|
+
GlobalQueue.B = disposeChildren;
|
|
318
|
+
let C = false;
|
|
319
|
+
let v = false;
|
|
320
|
+
let N = false;
|
|
321
|
+
let k = null;
|
|
322
|
+
let E = null;
|
|
323
|
+
function notifySubs(e) {
|
|
324
|
+
for (let t = e.O; t !== null; t = t.C) {
|
|
325
|
+
const e = t.N.S & o ? S : _;
|
|
326
|
+
if (e.A > t.N.o) e.A = t.N.o;
|
|
327
|
+
insertIntoHeap(t.N, e);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function recompute(t, n = false) {
|
|
331
|
+
deleteFromHeap(t, t.S & o ? S : _);
|
|
332
|
+
if (t.K !== p || t.ee || t.te) disposeChildren(t);
|
|
370
333
|
else {
|
|
371
|
-
markDisposal(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
let
|
|
384
|
-
let
|
|
385
|
-
let
|
|
386
|
-
let
|
|
387
|
-
let
|
|
388
|
-
|
|
389
|
-
|
|
334
|
+
markDisposal(t);
|
|
335
|
+
O.M.push(t);
|
|
336
|
+
t.te = t.ne;
|
|
337
|
+
t.ee = t.re;
|
|
338
|
+
t.ne = null;
|
|
339
|
+
t.re = null;
|
|
340
|
+
}
|
|
341
|
+
const i = E;
|
|
342
|
+
E = t;
|
|
343
|
+
t.ie = null;
|
|
344
|
+
t.S = r;
|
|
345
|
+
t.se = b;
|
|
346
|
+
let s = t.K === p ? t.G : t.K;
|
|
347
|
+
let u = t.o;
|
|
348
|
+
let d = t.$;
|
|
349
|
+
let h = t.L;
|
|
350
|
+
let y = C;
|
|
351
|
+
setStatusFlags(t, l | (d & a));
|
|
352
|
+
C = true;
|
|
390
353
|
try {
|
|
391
|
-
|
|
354
|
+
s = t.F(s);
|
|
355
|
+
t.$ &= ~a;
|
|
392
356
|
} catch (e) {
|
|
393
357
|
if (e instanceof NotReadyError) {
|
|
394
|
-
if (e.cause !==
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
} else {
|
|
398
|
-
setError(el, e);
|
|
399
|
-
}
|
|
358
|
+
if (e.cause !== t) link(e.cause, t);
|
|
359
|
+
setStatusFlags(t, (d & ~c) | f, e);
|
|
360
|
+
} else setStatusFlags(t, c, e);
|
|
400
361
|
} finally {
|
|
401
|
-
|
|
362
|
+
C = y;
|
|
402
363
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
let
|
|
407
|
-
if (
|
|
364
|
+
t.S = e;
|
|
365
|
+
E = i;
|
|
366
|
+
const g = t.ie;
|
|
367
|
+
let w = g !== null ? g.P : t.W;
|
|
368
|
+
if (w !== null) {
|
|
408
369
|
do {
|
|
409
|
-
|
|
410
|
-
} while (
|
|
411
|
-
if (
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
if (valueChanged) {
|
|
422
|
-
if (create || el.ja || el.K)
|
|
423
|
-
el.g = value;
|
|
370
|
+
w = unlinkSubs(w);
|
|
371
|
+
} while (w !== null);
|
|
372
|
+
if (g !== null) g.P = null;
|
|
373
|
+
else t.W = null;
|
|
374
|
+
}
|
|
375
|
+
const x = t.T && t.J != m;
|
|
376
|
+
const v = !t.oe || !t.oe(t.K === p || t.ue || x ? t.G : t.K, s);
|
|
377
|
+
const N = t.$ !== d || t.L !== h;
|
|
378
|
+
t.le?.(N, d);
|
|
379
|
+
if (v || N) {
|
|
380
|
+
if (v) {
|
|
381
|
+
if (n || t.ue || x) t.G = s;
|
|
424
382
|
else {
|
|
425
|
-
if (
|
|
426
|
-
|
|
427
|
-
el.e = value;
|
|
383
|
+
if (t.K === p) O.M.push(t);
|
|
384
|
+
t.K = s;
|
|
428
385
|
}
|
|
429
|
-
if (
|
|
430
|
-
el.C.ea(value);
|
|
386
|
+
if (t.Z) t.Z.Y(s);
|
|
431
387
|
}
|
|
432
|
-
for (let
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
|
|
436
|
-
insertIntoHeap(s.j, queue);
|
|
388
|
+
for (let e = t.O; e !== null; e = e.C) {
|
|
389
|
+
const n = e.N.S & o ? S : _;
|
|
390
|
+
if (e.N.o < t.o && n.A > e.N.o) n.A = e.N.o;
|
|
391
|
+
insertIntoHeap(e.N, n);
|
|
437
392
|
}
|
|
438
|
-
} else if (
|
|
439
|
-
for (let
|
|
440
|
-
insertIntoHeapHeight(
|
|
393
|
+
} else if (t.o != u) {
|
|
394
|
+
for (let e = t.O; e !== null; e = e.C) {
|
|
395
|
+
insertIntoHeapHeight(e.N, e.N.S & o ? S : _);
|
|
441
396
|
}
|
|
442
397
|
}
|
|
398
|
+
if (t.J && x) runInTransition(t, recompute);
|
|
443
399
|
}
|
|
444
|
-
function updateIfNecessary(
|
|
445
|
-
if (
|
|
446
|
-
for (let
|
|
447
|
-
const
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
450
|
-
updateIfNecessary(
|
|
400
|
+
function updateIfNecessary(r) {
|
|
401
|
+
if (r.S & t) {
|
|
402
|
+
for (let e = r.W; e; e = e.P) {
|
|
403
|
+
const t = e.H;
|
|
404
|
+
const i = t.I || t;
|
|
405
|
+
if (i.F) {
|
|
406
|
+
updateIfNecessary(i);
|
|
451
407
|
}
|
|
452
|
-
if (
|
|
408
|
+
if (r.S & n) {
|
|
453
409
|
break;
|
|
454
410
|
}
|
|
455
411
|
}
|
|
456
412
|
}
|
|
457
|
-
if (
|
|
458
|
-
recompute(
|
|
459
|
-
}
|
|
460
|
-
el.b = 0 /* None */;
|
|
461
|
-
}
|
|
462
|
-
function unlinkSubs(link2) {
|
|
463
|
-
var _a;
|
|
464
|
-
const dep = link2.R;
|
|
465
|
-
const nextDep = link2.E;
|
|
466
|
-
const nextSub = link2.A;
|
|
467
|
-
const prevSub = link2.na;
|
|
468
|
-
if (nextSub !== null) {
|
|
469
|
-
nextSub.na = prevSub;
|
|
470
|
-
} else {
|
|
471
|
-
dep.W = prevSub;
|
|
472
|
-
}
|
|
473
|
-
if (prevSub !== null) {
|
|
474
|
-
prevSub.A = nextSub;
|
|
475
|
-
} else {
|
|
476
|
-
dep.x = nextSub;
|
|
477
|
-
if (nextSub === null) {
|
|
478
|
-
(_a = dep.ta) == null ? void 0 : _a.call(dep);
|
|
479
|
-
dep.H && unobserved(dep);
|
|
480
|
-
}
|
|
413
|
+
if (r.S & n) {
|
|
414
|
+
recompute(r);
|
|
481
415
|
}
|
|
482
|
-
|
|
416
|
+
r.S = e;
|
|
483
417
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
418
|
+
function unlinkSubs(e) {
|
|
419
|
+
const t = e.H;
|
|
420
|
+
const n = e.P;
|
|
421
|
+
const r = e.C;
|
|
422
|
+
const i = e.fe;
|
|
423
|
+
if (r !== null) r.fe = i;
|
|
424
|
+
else t.ce = i;
|
|
425
|
+
if (i !== null) i.C = r;
|
|
426
|
+
else {
|
|
427
|
+
t.O = r;
|
|
428
|
+
if (r === null) {
|
|
429
|
+
t.ae?.();
|
|
430
|
+
t.F && unobserved(t);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return n;
|
|
434
|
+
}
|
|
435
|
+
function unobserved(e) {
|
|
436
|
+
deleteFromHeap(e, e.S & o ? S : _);
|
|
437
|
+
let t = e.W;
|
|
438
|
+
while (t !== null) {
|
|
439
|
+
t = unlinkSubs(t);
|
|
440
|
+
}
|
|
441
|
+
e.W = null;
|
|
442
|
+
runDisposal(e);
|
|
443
|
+
}
|
|
444
|
+
function link(e, t) {
|
|
445
|
+
const n = t.ie;
|
|
446
|
+
if (n !== null && n.H === e) return;
|
|
447
|
+
let i = null;
|
|
448
|
+
const s = t.S & r;
|
|
449
|
+
if (s) {
|
|
450
|
+
i = n !== null ? n.P : t.W;
|
|
451
|
+
if (i !== null && i.H === e) {
|
|
452
|
+
t.ie = i;
|
|
504
453
|
return;
|
|
505
454
|
}
|
|
506
455
|
}
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
E: nextDep,
|
|
515
|
-
na: prevSub,
|
|
516
|
-
A: null
|
|
517
|
-
};
|
|
518
|
-
if (prevDep !== null) {
|
|
519
|
-
prevDep.E = newLink;
|
|
520
|
-
} else {
|
|
521
|
-
sub.l = newLink;
|
|
522
|
-
}
|
|
523
|
-
if (prevSub !== null) {
|
|
524
|
-
prevSub.A = newLink;
|
|
525
|
-
} else {
|
|
526
|
-
dep.x = newLink;
|
|
527
|
-
}
|
|
456
|
+
const o = e.ce;
|
|
457
|
+
if (o !== null && o.N === t && (!s || isValidLink(o, t))) return;
|
|
458
|
+
const u = (t.ie = e.ce = { H: e, N: t, P: i, fe: o, C: null });
|
|
459
|
+
if (n !== null) n.P = u;
|
|
460
|
+
else t.W = u;
|
|
461
|
+
if (o !== null) o.C = u;
|
|
462
|
+
else e.O = u;
|
|
528
463
|
}
|
|
529
|
-
function isValidLink(
|
|
530
|
-
const
|
|
531
|
-
if (
|
|
532
|
-
let
|
|
464
|
+
function isValidLink(e, t) {
|
|
465
|
+
const n = t.ie;
|
|
466
|
+
if (n !== null) {
|
|
467
|
+
let r = t.W;
|
|
533
468
|
do {
|
|
534
|
-
if (
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
break;
|
|
539
|
-
}
|
|
540
|
-
link2 = link2.E;
|
|
541
|
-
} while (link2 !== null);
|
|
469
|
+
if (r === e) return true;
|
|
470
|
+
if (r === n) break;
|
|
471
|
+
r = r.P;
|
|
472
|
+
} while (r !== null);
|
|
542
473
|
}
|
|
543
474
|
return false;
|
|
544
475
|
}
|
|
545
|
-
function setStatusFlags(
|
|
546
|
-
|
|
547
|
-
|
|
476
|
+
function setStatusFlags(e, t, n = null) {
|
|
477
|
+
e.$ = t;
|
|
478
|
+
e.L = n;
|
|
548
479
|
}
|
|
549
|
-
function
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
let child = el.r;
|
|
557
|
-
while (child) {
|
|
558
|
-
child.b |= 32 /* Zombie */;
|
|
559
|
-
const inHeap = child.b & 8 /* InHeap */;
|
|
560
|
-
if (inHeap) {
|
|
561
|
-
deleteFromHeap(child, dirtyQueue);
|
|
562
|
-
insertIntoHeap(child, zombieQueue);
|
|
480
|
+
function markDisposal(e) {
|
|
481
|
+
let t = e.re;
|
|
482
|
+
while (t) {
|
|
483
|
+
t.S |= o;
|
|
484
|
+
if (t.S & i) {
|
|
485
|
+
deleteFromHeap(t, _);
|
|
486
|
+
insertIntoHeap(t, S);
|
|
563
487
|
}
|
|
564
|
-
markDisposal(
|
|
565
|
-
|
|
488
|
+
markDisposal(t);
|
|
489
|
+
t = t.de;
|
|
566
490
|
}
|
|
567
491
|
}
|
|
568
|
-
function dispose(
|
|
569
|
-
let
|
|
492
|
+
function dispose(e) {
|
|
493
|
+
let t = e.W || null;
|
|
570
494
|
do {
|
|
571
|
-
|
|
572
|
-
} while (
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
disposeChildren(
|
|
576
|
-
}
|
|
577
|
-
function disposeChildren(
|
|
578
|
-
if (
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
deleteFromHeap(n, n.b & 32 /* Zombie */ ? zombieQueue : dirtyQueue);
|
|
588
|
-
let toRemove = n.l;
|
|
495
|
+
t = unlinkSubs(t);
|
|
496
|
+
} while (t !== null);
|
|
497
|
+
e.W = null;
|
|
498
|
+
e.ie = null;
|
|
499
|
+
disposeChildren(e, true);
|
|
500
|
+
}
|
|
501
|
+
function disposeChildren(e, t = false, n) {
|
|
502
|
+
if (e.S & u) return;
|
|
503
|
+
if (t) e.S = u;
|
|
504
|
+
let r = n ? e.ee : e.re;
|
|
505
|
+
while (r) {
|
|
506
|
+
const e = r.de;
|
|
507
|
+
if (r.W) {
|
|
508
|
+
const e = r;
|
|
509
|
+
deleteFromHeap(e, e.S & o ? S : _);
|
|
510
|
+
let t = e.W;
|
|
589
511
|
do {
|
|
590
|
-
|
|
591
|
-
} while (
|
|
592
|
-
|
|
593
|
-
|
|
512
|
+
t = unlinkSubs(t);
|
|
513
|
+
} while (t !== null);
|
|
514
|
+
e.W = null;
|
|
515
|
+
e.ie = null;
|
|
594
516
|
}
|
|
595
|
-
disposeChildren(
|
|
596
|
-
|
|
517
|
+
disposeChildren(r, true);
|
|
518
|
+
r = e;
|
|
597
519
|
}
|
|
598
|
-
if (
|
|
599
|
-
|
|
520
|
+
if (n) {
|
|
521
|
+
e.ee = null;
|
|
600
522
|
} else {
|
|
601
|
-
|
|
602
|
-
|
|
523
|
+
e.re = null;
|
|
524
|
+
e.de = null;
|
|
603
525
|
}
|
|
604
|
-
runDisposal(
|
|
526
|
+
runDisposal(e, n);
|
|
605
527
|
}
|
|
606
|
-
function runDisposal(
|
|
607
|
-
let
|
|
608
|
-
if (!
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
callable.call(callable);
|
|
528
|
+
function runDisposal(e, t) {
|
|
529
|
+
let n = t ? e.te : e.ne;
|
|
530
|
+
if (!n) return;
|
|
531
|
+
if (Array.isArray(n)) {
|
|
532
|
+
for (let e = 0; e < n.length; e++) {
|
|
533
|
+
const t = n[e];
|
|
534
|
+
t.call(t);
|
|
614
535
|
}
|
|
615
536
|
} else {
|
|
616
|
-
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
function withOptions(obj, options) {
|
|
621
|
-
obj.id = (options == null ? void 0 : options.id) ?? ((context == null ? void 0 : context.id) != null ? getNextChildId(context) : void 0);
|
|
622
|
-
obj.fa = (options == null ? void 0 : options.equals) != null ? options.equals : isEqual;
|
|
623
|
-
obj.za = !!(options == null ? void 0 : options.pureWrite);
|
|
624
|
-
obj.ta = options == null ? void 0 : options.unobserved;
|
|
625
|
-
if (options == null ? void 0 : options.ka)
|
|
626
|
-
Object.assign(obj, options.ka);
|
|
627
|
-
return obj;
|
|
628
|
-
}
|
|
629
|
-
function getNextChildId(owner) {
|
|
630
|
-
if (owner.id != null)
|
|
631
|
-
return formatId(owner.id, owner.oa++);
|
|
632
|
-
throw new Error("Cannot get child id from owner without an id");
|
|
537
|
+
n.call(n);
|
|
538
|
+
}
|
|
539
|
+
t ? (e.te = null) : (e.ne = null);
|
|
633
540
|
}
|
|
634
|
-
function
|
|
635
|
-
|
|
636
|
-
|
|
541
|
+
function getNextChildId(e) {
|
|
542
|
+
if (e.id != null) return formatId(e.id, e.he++);
|
|
543
|
+
throw new Error("Cannot get child id from owner without an id");
|
|
637
544
|
}
|
|
638
|
-
function
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
545
|
+
function formatId(e, t) {
|
|
546
|
+
const n = t.toString(36),
|
|
547
|
+
r = n.length - 1;
|
|
548
|
+
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
549
|
+
}
|
|
550
|
+
function computed(t, n, r) {
|
|
551
|
+
const i = {
|
|
552
|
+
id: r?.id ?? (E?.id != null ? getNextChildId(E) : undefined),
|
|
553
|
+
oe: r?.equals != null ? r.equals : isEqual,
|
|
554
|
+
pe: !!r?.pureWrite,
|
|
555
|
+
ae: r?.unobserved,
|
|
556
|
+
ne: null,
|
|
557
|
+
ye: E?.ye ?? O,
|
|
558
|
+
ge: E?.ge ?? g,
|
|
559
|
+
he: 0,
|
|
560
|
+
F: t,
|
|
561
|
+
G: n,
|
|
562
|
+
o: 0,
|
|
563
|
+
k: null,
|
|
564
|
+
p: undefined,
|
|
565
|
+
h: null,
|
|
566
|
+
W: null,
|
|
567
|
+
ie: null,
|
|
568
|
+
O: null,
|
|
569
|
+
ce: null,
|
|
570
|
+
i: E,
|
|
571
|
+
de: null,
|
|
572
|
+
re: null,
|
|
573
|
+
S: e,
|
|
574
|
+
$: a,
|
|
575
|
+
se: b,
|
|
576
|
+
K: p,
|
|
577
|
+
te: null,
|
|
578
|
+
ee: null,
|
|
579
|
+
J: null
|
|
580
|
+
};
|
|
581
|
+
if (r?.we) Object.assign(i, r.we);
|
|
582
|
+
i.h = i;
|
|
583
|
+
const s = E?.t ? E.u : E;
|
|
584
|
+
if (E) {
|
|
585
|
+
const e = E.re;
|
|
586
|
+
if (e === null) {
|
|
587
|
+
E.re = i;
|
|
675
588
|
} else {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
if (
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
let
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
globalQueue.initTransition(self);
|
|
702
|
-
setSignal(self, () => v);
|
|
589
|
+
i.de = e;
|
|
590
|
+
E.re = i;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
if (s) i.o = s.o + 1;
|
|
594
|
+
recompute(i, true);
|
|
595
|
+
return i;
|
|
596
|
+
}
|
|
597
|
+
function asyncComputed(e, t, n) {
|
|
598
|
+
let r = undefined;
|
|
599
|
+
let i = false;
|
|
600
|
+
const fn = t => {
|
|
601
|
+
const n = e(t, i);
|
|
602
|
+
i = false;
|
|
603
|
+
r = n;
|
|
604
|
+
const o = n instanceof Promise;
|
|
605
|
+
const u = n[Symbol.asyncIterator];
|
|
606
|
+
if (!o && !u) {
|
|
607
|
+
return n;
|
|
608
|
+
}
|
|
609
|
+
if (o) {
|
|
610
|
+
n.then(e => {
|
|
611
|
+
if (r !== n) return;
|
|
612
|
+
O.initTransition(s);
|
|
613
|
+
setSignal(s, () => e);
|
|
703
614
|
flush();
|
|
704
|
-
}).catch(
|
|
705
|
-
if (
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
notifySubs(self);
|
|
615
|
+
}).catch(e => {
|
|
616
|
+
if (r !== n) return;
|
|
617
|
+
O.initTransition(s);
|
|
618
|
+
setStatusFlags(s, c, e);
|
|
619
|
+
s.se = b;
|
|
620
|
+
notifySubs(s);
|
|
711
621
|
schedule();
|
|
712
622
|
flush();
|
|
713
623
|
});
|
|
714
624
|
} else {
|
|
715
625
|
(async () => {
|
|
716
626
|
try {
|
|
717
|
-
for await (let
|
|
718
|
-
if (
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
setSignal(self, () => value);
|
|
627
|
+
for await (let e of n) {
|
|
628
|
+
if (r !== n) return;
|
|
629
|
+
O.initTransition(s);
|
|
630
|
+
setSignal(s, () => e);
|
|
722
631
|
flush();
|
|
723
632
|
}
|
|
724
|
-
} catch (
|
|
725
|
-
if (
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
notifySubs(self);
|
|
633
|
+
} catch (e) {
|
|
634
|
+
if (r !== n) return;
|
|
635
|
+
O.initTransition(s);
|
|
636
|
+
setStatusFlags(s, c, e);
|
|
637
|
+
s.se = b;
|
|
638
|
+
notifySubs(s);
|
|
731
639
|
schedule();
|
|
732
640
|
flush();
|
|
733
641
|
}
|
|
734
642
|
})();
|
|
735
643
|
}
|
|
736
|
-
|
|
737
|
-
throw new NotReadyError(
|
|
644
|
+
O.initTransition(E);
|
|
645
|
+
throw new NotReadyError(E);
|
|
738
646
|
};
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
recompute(
|
|
647
|
+
const s = computed(fn, t, n);
|
|
648
|
+
s._e = () => {
|
|
649
|
+
i = true;
|
|
650
|
+
recompute(s);
|
|
651
|
+
schedule();
|
|
743
652
|
flush();
|
|
744
653
|
};
|
|
745
|
-
return
|
|
746
|
-
}
|
|
747
|
-
function signal(
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
{
|
|
765
|
-
g: v,
|
|
766
|
-
x: null,
|
|
767
|
-
W: null,
|
|
768
|
-
f: 0 /* None */,
|
|
769
|
-
J: clock,
|
|
770
|
-
e: NOT_PENDING
|
|
771
|
-
},
|
|
772
|
-
options
|
|
773
|
-
);
|
|
774
|
-
}
|
|
654
|
+
return s;
|
|
655
|
+
}
|
|
656
|
+
function signal(e, t, n = null) {
|
|
657
|
+
const r = {
|
|
658
|
+
id: t?.id ?? (E?.id != null ? getNextChildId(E) : undefined),
|
|
659
|
+
oe: t?.equals != null ? t.equals : isEqual,
|
|
660
|
+
pe: !!t?.pureWrite,
|
|
661
|
+
ae: t?.unobserved,
|
|
662
|
+
G: e,
|
|
663
|
+
O: null,
|
|
664
|
+
ce: null,
|
|
665
|
+
$: l,
|
|
666
|
+
se: b,
|
|
667
|
+
I: n,
|
|
668
|
+
j: n?.k || null,
|
|
669
|
+
K: p
|
|
670
|
+
};
|
|
671
|
+
n && (n.k = r);
|
|
672
|
+
return r;
|
|
775
673
|
}
|
|
776
|
-
function isEqual(
|
|
777
|
-
return
|
|
674
|
+
function isEqual(e, t) {
|
|
675
|
+
return e === t;
|
|
778
676
|
}
|
|
779
|
-
function untrack(
|
|
780
|
-
if (!
|
|
781
|
-
|
|
782
|
-
tracking = false;
|
|
677
|
+
function untrack(e) {
|
|
678
|
+
if (!C) return e();
|
|
679
|
+
C = false;
|
|
783
680
|
try {
|
|
784
|
-
return
|
|
681
|
+
return e();
|
|
785
682
|
} finally {
|
|
786
|
-
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
function read(
|
|
790
|
-
let
|
|
791
|
-
if (
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
updateIfNecessary(owner);
|
|
683
|
+
C = true;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
function read(e) {
|
|
687
|
+
let t = E;
|
|
688
|
+
if (t?.t) t = t.u;
|
|
689
|
+
if (t && C && !k && !N) {
|
|
690
|
+
link(e, t);
|
|
691
|
+
const n = e.I || e;
|
|
692
|
+
if (n.F) {
|
|
693
|
+
const r = e.S & o;
|
|
694
|
+
if (n.o >= (r ? S.A : _.A)) {
|
|
695
|
+
markNode(t);
|
|
696
|
+
markHeap(r ? S : _);
|
|
697
|
+
updateIfNecessary(n);
|
|
802
698
|
}
|
|
803
|
-
const
|
|
804
|
-
if (
|
|
805
|
-
|
|
699
|
+
const i = n.o;
|
|
700
|
+
if (i >= t.o && e.i !== t) {
|
|
701
|
+
t.o = i + 1;
|
|
806
702
|
}
|
|
807
703
|
}
|
|
808
704
|
}
|
|
809
|
-
if (
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
el.I.ea = (v) => setSignal(el.I, v);
|
|
705
|
+
if (k) {
|
|
706
|
+
if (!e.X) {
|
|
707
|
+
e.X = signal(false);
|
|
708
|
+
e.X.ue = true;
|
|
709
|
+
e.X.Y = t => setSignal(e.X, t);
|
|
815
710
|
}
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
read(
|
|
819
|
-
|
|
820
|
-
prev.g = pendingResult || prev.g;
|
|
711
|
+
const t = k;
|
|
712
|
+
k = null;
|
|
713
|
+
t.G = read(e.X) || t.G;
|
|
714
|
+
k = t;
|
|
821
715
|
}
|
|
822
|
-
if (
|
|
823
|
-
if (!
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
);
|
|
827
|
-
el.C.ja = true;
|
|
828
|
-
el.C.ea = (v) => queueMicrotask(() => queueMicrotask(() => setSignal(el.C, v)));
|
|
716
|
+
if (N) {
|
|
717
|
+
if (!e.Z) {
|
|
718
|
+
e.Z = signal(e.G);
|
|
719
|
+
e.Z.ue = true;
|
|
720
|
+
e.Z.Y = t => setSignal(e.Z, t);
|
|
829
721
|
}
|
|
830
|
-
|
|
722
|
+
N = false;
|
|
831
723
|
try {
|
|
832
|
-
return read(
|
|
724
|
+
return read(e.Z);
|
|
833
725
|
} finally {
|
|
834
|
-
|
|
726
|
+
N = true;
|
|
835
727
|
}
|
|
836
728
|
}
|
|
837
|
-
if (
|
|
838
|
-
if (
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
setStatusFlags(
|
|
842
|
-
c,
|
|
843
|
-
c.f | 1,
|
|
844
|
-
el.B
|
|
845
|
-
);
|
|
729
|
+
if (e.$ & f && !k) {
|
|
730
|
+
if ((t && !v) || e.$ & a) throw e.L;
|
|
731
|
+
else if (t && v) {
|
|
732
|
+
setStatusFlags(t, t.$ | 1, e.L);
|
|
846
733
|
}
|
|
847
734
|
}
|
|
848
|
-
if (
|
|
849
|
-
if (
|
|
850
|
-
recompute(
|
|
851
|
-
return read(
|
|
735
|
+
if (e.$ & c) {
|
|
736
|
+
if (e.se < b) {
|
|
737
|
+
recompute(e, true);
|
|
738
|
+
return read(e);
|
|
852
739
|
} else {
|
|
853
|
-
throw
|
|
740
|
+
throw e.L;
|
|
854
741
|
}
|
|
855
742
|
}
|
|
856
|
-
return !
|
|
743
|
+
return !t || e.ue || e.K === p || (v && !k && e.J && m !== e.J) ? e.G : e.K;
|
|
857
744
|
}
|
|
858
|
-
function setSignal(
|
|
859
|
-
if (typeof
|
|
860
|
-
|
|
861
|
-
el.e === NOT_PENDING ? el.g : el.e
|
|
862
|
-
);
|
|
745
|
+
function setSignal(e, t) {
|
|
746
|
+
if (typeof t === "function") {
|
|
747
|
+
t = t(e.K === p ? e.G : e.K);
|
|
863
748
|
}
|
|
864
|
-
const
|
|
865
|
-
if (!
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
if (el.ja)
|
|
869
|
-
el.g = v;
|
|
749
|
+
const n = !e.oe || !e.oe(e.K === p || e.ue ? e.G : e.K, t);
|
|
750
|
+
if (!n && !e.$) return t;
|
|
751
|
+
if (n) {
|
|
752
|
+
if (e.ue) e.G = t;
|
|
870
753
|
else {
|
|
871
|
-
if (
|
|
872
|
-
|
|
873
|
-
el.e = v;
|
|
754
|
+
if (e.K === p) O.M.push(e);
|
|
755
|
+
e.K = t;
|
|
874
756
|
}
|
|
875
|
-
if (
|
|
876
|
-
el.C.ea(v);
|
|
757
|
+
if (e.Z) e.Z.K = t;
|
|
877
758
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
notifySubs(
|
|
759
|
+
setStatusFlags(e, l);
|
|
760
|
+
e.se = b;
|
|
761
|
+
notifySubs(e);
|
|
881
762
|
schedule();
|
|
882
|
-
return
|
|
763
|
+
return t;
|
|
883
764
|
}
|
|
884
765
|
function getObserver() {
|
|
885
|
-
return
|
|
766
|
+
return C ? E : null;
|
|
886
767
|
}
|
|
887
768
|
function getOwner() {
|
|
888
|
-
return
|
|
889
|
-
}
|
|
890
|
-
function onCleanup(
|
|
891
|
-
if (!
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
node.t.push(fn);
|
|
769
|
+
return E;
|
|
770
|
+
}
|
|
771
|
+
function onCleanup(e) {
|
|
772
|
+
if (!E) return e;
|
|
773
|
+
const t = E;
|
|
774
|
+
if (!t.ne) {
|
|
775
|
+
t.ne = e;
|
|
776
|
+
} else if (Array.isArray(t.ne)) {
|
|
777
|
+
t.ne.push(e);
|
|
898
778
|
} else {
|
|
899
|
-
|
|
900
|
-
}
|
|
901
|
-
return
|
|
902
|
-
}
|
|
903
|
-
function createOwner(
|
|
904
|
-
const
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
id:
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
dispose(
|
|
919
|
-
disposeChildren(
|
|
779
|
+
t.ne = [t.ne, e];
|
|
780
|
+
}
|
|
781
|
+
return e;
|
|
782
|
+
}
|
|
783
|
+
function createOwner(e) {
|
|
784
|
+
const t = E;
|
|
785
|
+
const n = {
|
|
786
|
+
t: true,
|
|
787
|
+
u: t?.t ? t.u : t,
|
|
788
|
+
re: null,
|
|
789
|
+
de: null,
|
|
790
|
+
ne: null,
|
|
791
|
+
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
792
|
+
ye: t?.ye ?? O,
|
|
793
|
+
ge: t?.ge || g,
|
|
794
|
+
he: 0,
|
|
795
|
+
te: null,
|
|
796
|
+
ee: null,
|
|
797
|
+
i: t,
|
|
798
|
+
dispose(e = true) {
|
|
799
|
+
disposeChildren(n, e);
|
|
920
800
|
}
|
|
921
801
|
};
|
|
922
|
-
if (
|
|
923
|
-
const
|
|
924
|
-
if (
|
|
925
|
-
|
|
802
|
+
if (t) {
|
|
803
|
+
const e = t.re;
|
|
804
|
+
if (e === null) {
|
|
805
|
+
t.re = n;
|
|
926
806
|
} else {
|
|
927
|
-
|
|
928
|
-
|
|
807
|
+
n.de = e;
|
|
808
|
+
t.re = n;
|
|
929
809
|
}
|
|
930
810
|
}
|
|
931
|
-
return
|
|
811
|
+
return n;
|
|
932
812
|
}
|
|
933
|
-
function createRoot(
|
|
934
|
-
const
|
|
935
|
-
return runWithOwner(
|
|
813
|
+
function createRoot(e, t) {
|
|
814
|
+
const n = createOwner(t);
|
|
815
|
+
return runWithOwner(n, () => e(n.dispose));
|
|
936
816
|
}
|
|
937
|
-
function runWithOwner(
|
|
938
|
-
const
|
|
939
|
-
|
|
817
|
+
function runWithOwner(e, t) {
|
|
818
|
+
const n = E;
|
|
819
|
+
E = e;
|
|
940
820
|
try {
|
|
941
|
-
return
|
|
821
|
+
return t();
|
|
942
822
|
} finally {
|
|
943
|
-
|
|
823
|
+
E = n;
|
|
944
824
|
}
|
|
945
825
|
}
|
|
946
|
-
function staleValues(
|
|
947
|
-
const
|
|
948
|
-
|
|
826
|
+
function staleValues(e, t = true) {
|
|
827
|
+
const n = v;
|
|
828
|
+
v = t;
|
|
949
829
|
try {
|
|
950
|
-
return
|
|
830
|
+
return e();
|
|
951
831
|
} finally {
|
|
952
|
-
|
|
832
|
+
v = n;
|
|
953
833
|
}
|
|
954
834
|
}
|
|
955
|
-
function pending(
|
|
956
|
-
const
|
|
957
|
-
|
|
835
|
+
function pending(e) {
|
|
836
|
+
const t = N;
|
|
837
|
+
N = true;
|
|
958
838
|
try {
|
|
959
|
-
return staleValues(
|
|
839
|
+
return staleValues(e, false);
|
|
960
840
|
} finally {
|
|
961
|
-
|
|
841
|
+
N = t;
|
|
962
842
|
}
|
|
963
843
|
}
|
|
964
|
-
function isPending(
|
|
965
|
-
const
|
|
966
|
-
|
|
844
|
+
function isPending(e) {
|
|
845
|
+
const t = k;
|
|
846
|
+
k = { G: false };
|
|
967
847
|
try {
|
|
968
|
-
staleValues(
|
|
969
|
-
return
|
|
970
|
-
} catch (
|
|
971
|
-
if (!(
|
|
972
|
-
|
|
973
|
-
if (loadingValue !== void 0)
|
|
974
|
-
return loadingValue;
|
|
975
|
-
throw err;
|
|
848
|
+
staleValues(e);
|
|
849
|
+
return k.G;
|
|
850
|
+
} catch (e) {
|
|
851
|
+
if (!(e instanceof NotReadyError)) return false;
|
|
852
|
+
throw e;
|
|
976
853
|
} finally {
|
|
977
|
-
|
|
854
|
+
k = t;
|
|
978
855
|
}
|
|
979
856
|
}
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
function createContext(defaultValue, description) {
|
|
983
|
-
return { id: Symbol(description), defaultValue };
|
|
857
|
+
function createContext(e, t) {
|
|
858
|
+
return { id: Symbol(t), defaultValue: e };
|
|
984
859
|
}
|
|
985
|
-
function getContext(
|
|
986
|
-
if (!
|
|
860
|
+
function getContext(e, t = getOwner()) {
|
|
861
|
+
if (!t) {
|
|
987
862
|
throw new NoOwnerError();
|
|
988
863
|
}
|
|
989
|
-
const
|
|
990
|
-
if (isUndefined(
|
|
864
|
+
const n = hasContext(e, t) ? t.ge[e.id] : e.defaultValue;
|
|
865
|
+
if (isUndefined(n)) {
|
|
991
866
|
throw new ContextNotFoundError();
|
|
992
867
|
}
|
|
993
|
-
return
|
|
868
|
+
return n;
|
|
994
869
|
}
|
|
995
|
-
function setContext(
|
|
996
|
-
if (!
|
|
870
|
+
function setContext(e, t, n = getOwner()) {
|
|
871
|
+
if (!n) {
|
|
997
872
|
throw new NoOwnerError();
|
|
998
873
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
}
|
|
1004
|
-
function
|
|
1005
|
-
return
|
|
1006
|
-
}
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
i: ((_a = getOwner()) == null ? void 0 : _a.i) ?? globalQueue,
|
|
1024
|
-
K: (options == null ? void 0 : options.render) ? 1 /* Render */ : 2 /* User */,
|
|
1025
|
-
ma(statusFlagsChanged, prevStatusFlags) {
|
|
1026
|
-
if (initialized) {
|
|
1027
|
-
const errorChanged = this.f && this.f === prevStatusFlags && statusFlagsChanged;
|
|
1028
|
-
this.ga = !(this.f & 2 /* Error */) && !(this.f & 1 /* Pending */ & ~prevStatusFlags) && !errorChanged;
|
|
1029
|
-
if (this.ga)
|
|
1030
|
-
this.i.enqueue(this.K, runEffect.bind(this));
|
|
874
|
+
n.ge = { ...n.ge, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
875
|
+
}
|
|
876
|
+
function hasContext(e, t) {
|
|
877
|
+
return !isUndefined(t?.ge[e.id]);
|
|
878
|
+
}
|
|
879
|
+
function isUndefined(e) {
|
|
880
|
+
return typeof e === "undefined";
|
|
881
|
+
}
|
|
882
|
+
function effect(e, t, n, r, i) {
|
|
883
|
+
let s = false;
|
|
884
|
+
const o = computed(e, r, {
|
|
885
|
+
...i,
|
|
886
|
+
we: {
|
|
887
|
+
U: true,
|
|
888
|
+
Se: r,
|
|
889
|
+
be: t,
|
|
890
|
+
me: n,
|
|
891
|
+
xe: undefined,
|
|
892
|
+
T: i?.render ? d : h,
|
|
893
|
+
le(e, t) {
|
|
894
|
+
if (s) {
|
|
895
|
+
const n = this.$ && this.$ === t && e;
|
|
896
|
+
this.U = !(this.$ & c) && !(this.$ & f & ~t) && !n;
|
|
897
|
+
if (this.U) this.ye.enqueue(this.T, runEffect.bind(this));
|
|
1031
898
|
}
|
|
1032
|
-
if (this
|
|
1033
|
-
let
|
|
1034
|
-
this.
|
|
1035
|
-
if (this.
|
|
899
|
+
if (this.$ & c) {
|
|
900
|
+
let e = this.L;
|
|
901
|
+
this.ye.notify(this, f, 0);
|
|
902
|
+
if (this.T === h) {
|
|
1036
903
|
try {
|
|
1037
|
-
return this.
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
904
|
+
return this.me
|
|
905
|
+
? this.me(e, () => {
|
|
906
|
+
this.xe?.();
|
|
907
|
+
this.xe = undefined;
|
|
908
|
+
})
|
|
909
|
+
: console.error(e);
|
|
910
|
+
} catch (t) {
|
|
911
|
+
e = t;
|
|
1044
912
|
}
|
|
1045
913
|
}
|
|
1046
|
-
if (!this.
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
this.i.notify(
|
|
1050
|
-
this,
|
|
1051
|
-
1 /* Pending */ | 2 /* Error */,
|
|
1052
|
-
this.f
|
|
1053
|
-
);
|
|
914
|
+
if (!this.ye.notify(this, c, c)) throw e;
|
|
915
|
+
} else if (this.T === d) {
|
|
916
|
+
this.ye.notify(this, f | c, this.$);
|
|
1054
917
|
}
|
|
1055
918
|
}
|
|
1056
919
|
}
|
|
1057
920
|
});
|
|
1058
|
-
|
|
1059
|
-
if (
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
return (_a2 = node.N) == null ? void 0 : _a2.call(node);
|
|
1065
|
-
});
|
|
921
|
+
s = true;
|
|
922
|
+
if (o.T === d) o.F = t => staleValues(() => e(t));
|
|
923
|
+
!i?.defer &&
|
|
924
|
+
!(o.$ & (c | f)) &&
|
|
925
|
+
(o.T === h ? o.ye.enqueue(o.T, runEffect.bind(o)) : runEffect.call(o));
|
|
926
|
+
onCleanup(() => o.xe?.());
|
|
1066
927
|
}
|
|
1067
928
|
function runEffect() {
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
(_a = this.N) == null ? void 0 : _a.call(this);
|
|
1072
|
-
this.N = void 0;
|
|
929
|
+
if (!this.U || this.S & u) return;
|
|
930
|
+
this.xe?.();
|
|
931
|
+
this.xe = undefined;
|
|
1073
932
|
try {
|
|
1074
|
-
this.
|
|
1075
|
-
} catch (
|
|
1076
|
-
if (!this.
|
|
1077
|
-
throw error;
|
|
933
|
+
this.xe = this.be(this.G, this.Se);
|
|
934
|
+
} catch (e) {
|
|
935
|
+
if (!this.ye.notify(this, c, c)) throw e;
|
|
1078
936
|
} finally {
|
|
1079
|
-
this.
|
|
1080
|
-
this.
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
);
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
}
|
|
1129
|
-
function createTrackedEffect(compute, options) {
|
|
1130
|
-
}
|
|
1131
|
-
function createReaction(effectFn, options) {
|
|
1132
|
-
let cleanup = void 0;
|
|
1133
|
-
onCleanup(() => cleanup == null ? void 0 : cleanup());
|
|
1134
|
-
return (tracking2) => {
|
|
1135
|
-
effect(
|
|
1136
|
-
() => (tracking2(), getOwner()),
|
|
1137
|
-
(node) => {
|
|
1138
|
-
var _a;
|
|
1139
|
-
cleanup == null ? void 0 : cleanup();
|
|
1140
|
-
cleanup = (_a = effectFn.effect || effectFn) == null ? void 0 : _a();
|
|
1141
|
-
dispose(node);
|
|
1142
|
-
},
|
|
1143
|
-
effectFn.error,
|
|
1144
|
-
void 0,
|
|
1145
|
-
{
|
|
1146
|
-
defer: true,
|
|
1147
|
-
...options
|
|
1148
|
-
}
|
|
1149
|
-
);
|
|
937
|
+
this.Se = this.G;
|
|
938
|
+
this.U = false;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
function createSignal(e, t, n) {
|
|
942
|
+
if (typeof e === "function") {
|
|
943
|
+
const r = computed(e, t, n);
|
|
944
|
+
return [read.bind(null, r), setSignal.bind(null, r)];
|
|
945
|
+
}
|
|
946
|
+
const r = getOwner();
|
|
947
|
+
const i = r?.id != null;
|
|
948
|
+
const s = signal(e, i ? { id: getNextChildId(r), ...t } : t);
|
|
949
|
+
return [read.bind(null, s), setSignal.bind(null, s)];
|
|
950
|
+
}
|
|
951
|
+
function createMemo(e, t, n) {
|
|
952
|
+
let r = computed(e, t, n);
|
|
953
|
+
return read.bind(null, r);
|
|
954
|
+
}
|
|
955
|
+
function createAsync(e, t, n) {
|
|
956
|
+
const r = asyncComputed(e, t, n);
|
|
957
|
+
const i = read.bind(null, r);
|
|
958
|
+
i.refresh = r._e;
|
|
959
|
+
return i;
|
|
960
|
+
}
|
|
961
|
+
function createEffect(e, t, n, r) {
|
|
962
|
+
void effect(e, t.effect || t, t.error, n, r);
|
|
963
|
+
}
|
|
964
|
+
function createRenderEffect(e, t, n, r) {
|
|
965
|
+
void effect(e, t, undefined, n, { render: true, ...r });
|
|
966
|
+
}
|
|
967
|
+
function createTrackedEffect(e, t) {}
|
|
968
|
+
function createReaction(e, t) {
|
|
969
|
+
let n = undefined;
|
|
970
|
+
onCleanup(() => n?.());
|
|
971
|
+
const r = getOwner();
|
|
972
|
+
return i => {
|
|
973
|
+
runWithOwner(r, () => {
|
|
974
|
+
effect(
|
|
975
|
+
() => (i(), getOwner()),
|
|
976
|
+
t => {
|
|
977
|
+
n?.();
|
|
978
|
+
n = (e.effect || e)?.();
|
|
979
|
+
dispose(t);
|
|
980
|
+
},
|
|
981
|
+
e.error,
|
|
982
|
+
undefined,
|
|
983
|
+
{ defer: true, ...(false ? { ...t, name: t?.name ?? "effect" } : t) }
|
|
984
|
+
);
|
|
985
|
+
});
|
|
1150
986
|
};
|
|
1151
987
|
}
|
|
1152
|
-
function resolve(
|
|
1153
|
-
return new Promise((
|
|
1154
|
-
createRoot(
|
|
988
|
+
function resolve(e) {
|
|
989
|
+
return new Promise((t, n) => {
|
|
990
|
+
createRoot(r => {
|
|
1155
991
|
computed(() => {
|
|
1156
992
|
try {
|
|
1157
|
-
|
|
1158
|
-
} catch (
|
|
1159
|
-
if (
|
|
1160
|
-
|
|
1161
|
-
rej(err);
|
|
993
|
+
t(e());
|
|
994
|
+
} catch (e) {
|
|
995
|
+
if (e instanceof NotReadyError) throw e;
|
|
996
|
+
n(e);
|
|
1162
997
|
}
|
|
1163
|
-
|
|
998
|
+
r();
|
|
1164
999
|
});
|
|
1165
1000
|
});
|
|
1166
1001
|
});
|
|
1167
1002
|
}
|
|
1168
|
-
function createOptimistic(
|
|
1003
|
+
function createOptimistic(e, t, n) {
|
|
1169
1004
|
return {};
|
|
1170
1005
|
}
|
|
1171
|
-
function onSettled(
|
|
1172
|
-
let
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
!o && (cleanup == null ? void 0 : cleanup());
|
|
1006
|
+
function onSettled(e) {
|
|
1007
|
+
let t;
|
|
1008
|
+
const n = getOwner();
|
|
1009
|
+
if (n) onCleanup(() => t?.());
|
|
1010
|
+
O.enqueue(h, () => {
|
|
1011
|
+
t = e();
|
|
1012
|
+
!n && t?.();
|
|
1179
1013
|
});
|
|
1180
1014
|
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
return
|
|
1186
|
-
}
|
|
1187
|
-
function
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
if (
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
applyState(next[start], wrap(item, target), keyFn, all);
|
|
1015
|
+
function unwrap(e) {
|
|
1016
|
+
return e?.[W]?.[R] ?? e;
|
|
1017
|
+
}
|
|
1018
|
+
function getOverrideValue(e, t, n, r) {
|
|
1019
|
+
return n && r in n ? read(n[r]) : t && r in t ? t[r] : e[r];
|
|
1020
|
+
}
|
|
1021
|
+
function getAllKeys(e, t, n) {
|
|
1022
|
+
const r = getKeys(e, t);
|
|
1023
|
+
const i = Object.keys(n);
|
|
1024
|
+
return Array.from(new Set([...r, ...i]));
|
|
1025
|
+
}
|
|
1026
|
+
function applyState(e, t, n, r) {
|
|
1027
|
+
const i = t?.[W];
|
|
1028
|
+
if (!i) return;
|
|
1029
|
+
const s = i[F];
|
|
1030
|
+
const o = i[Q];
|
|
1031
|
+
let u = i[R];
|
|
1032
|
+
if (e === s && !o) return;
|
|
1033
|
+
(i[M] || B).set(e, i[P]);
|
|
1034
|
+
i[F] = e;
|
|
1035
|
+
i[Q] = undefined;
|
|
1036
|
+
if (Array.isArray(s)) {
|
|
1037
|
+
let t = false;
|
|
1038
|
+
const l = getOverrideValue(s, o, u, "length");
|
|
1039
|
+
if (e.length && l && e[0] && n(e[0]) != null) {
|
|
1040
|
+
let f, c, a, d, h, p, y, g;
|
|
1041
|
+
for (
|
|
1042
|
+
a = 0, d = Math.min(l, e.length);
|
|
1043
|
+
a < d && ((p = getOverrideValue(s, o, u, a)) === e[a] || (p && e[a] && n(p) === n(e[a])));
|
|
1044
|
+
a++
|
|
1045
|
+
) {
|
|
1046
|
+
applyState(e[a], wrap(p, i), n, r);
|
|
1214
1047
|
}
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1217
|
-
|
|
1048
|
+
const w = new Array(e.length),
|
|
1049
|
+
_ = new Map();
|
|
1050
|
+
for (
|
|
1051
|
+
d = l - 1, h = e.length - 1;
|
|
1052
|
+
d >= a &&
|
|
1053
|
+
h >= a &&
|
|
1054
|
+
((p = getOverrideValue(s, o, u, d)) === e[h] || (p && e[h] && n(p) === n(e[h])));
|
|
1055
|
+
d--, h--
|
|
1056
|
+
) {
|
|
1057
|
+
w[h] = p;
|
|
1218
1058
|
}
|
|
1219
|
-
if (
|
|
1220
|
-
for (
|
|
1221
|
-
|
|
1222
|
-
|
|
1059
|
+
if (a > h || a > d) {
|
|
1060
|
+
for (c = a; c <= h; c++) {
|
|
1061
|
+
t = true;
|
|
1062
|
+
i[R][c] && setSignal(i[R][c], wrap(e[c], i));
|
|
1223
1063
|
}
|
|
1224
|
-
for (;
|
|
1225
|
-
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
applyState(
|
|
1064
|
+
for (; c < e.length; c++) {
|
|
1065
|
+
t = true;
|
|
1066
|
+
const s = wrap(w[c], i);
|
|
1067
|
+
i[R][c] && setSignal(i[R][c], s);
|
|
1068
|
+
applyState(e[c], s, n, r);
|
|
1229
1069
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1070
|
+
t && i[R][j] && setSignal(i[R][j], void 0);
|
|
1071
|
+
l !== e.length && i[R].length && setSignal(i[R].length, e.length);
|
|
1232
1072
|
return;
|
|
1233
1073
|
}
|
|
1234
|
-
|
|
1235
|
-
for (
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1074
|
+
y = new Array(h + 1);
|
|
1075
|
+
for (c = h; c >= a; c--) {
|
|
1076
|
+
p = e[c];
|
|
1077
|
+
g = p ? n(p) : p;
|
|
1078
|
+
f = _.get(g);
|
|
1079
|
+
y[c] = f === undefined ? -1 : f;
|
|
1080
|
+
_.set(g, c);
|
|
1241
1081
|
}
|
|
1242
|
-
for (
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
if (
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1082
|
+
for (f = a; f <= d; f++) {
|
|
1083
|
+
p = getOverrideValue(s, o, u, f);
|
|
1084
|
+
g = p ? n(p) : p;
|
|
1085
|
+
c = _.get(g);
|
|
1086
|
+
if (c !== undefined && c !== -1) {
|
|
1087
|
+
w[c] = p;
|
|
1088
|
+
c = y[c];
|
|
1089
|
+
_.set(g, c);
|
|
1250
1090
|
}
|
|
1251
1091
|
}
|
|
1252
|
-
for (
|
|
1253
|
-
if (
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
-
applyState(
|
|
1257
|
-
} else
|
|
1258
|
-
target[STORE_NODE][j] && setSignal(target[STORE_NODE][j], wrap(next[j], target));
|
|
1092
|
+
for (c = a; c < e.length; c++) {
|
|
1093
|
+
if (c in w) {
|
|
1094
|
+
const t = wrap(w[c], i);
|
|
1095
|
+
i[R][c] && setSignal(i[R][c], t);
|
|
1096
|
+
applyState(e[c], t, n, r);
|
|
1097
|
+
} else i[R][c] && setSignal(i[R][c], wrap(e[c], i));
|
|
1259
1098
|
}
|
|
1260
|
-
if (
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
isWrappable(item) && applyState(next[i], wrap(item, target), keyFn, all);
|
|
1099
|
+
if (a < e.length) t = true;
|
|
1100
|
+
} else if (l && e.length) {
|
|
1101
|
+
for (let t = 0, l = e.length; t < l; t++) {
|
|
1102
|
+
const l = getOverrideValue(s, o, u, t);
|
|
1103
|
+
isWrappable(l) && applyState(e[t], wrap(l, i), n, r);
|
|
1266
1104
|
}
|
|
1267
1105
|
}
|
|
1268
|
-
if (
|
|
1269
|
-
|
|
1270
|
-
|
|
1106
|
+
if (l !== e.length) {
|
|
1107
|
+
t = true;
|
|
1108
|
+
i[R].length && setSignal(i[R].length, e.length);
|
|
1271
1109
|
}
|
|
1272
|
-
|
|
1110
|
+
t && i[R][j] && setSignal(i[R][j], void 0);
|
|
1273
1111
|
return;
|
|
1274
1112
|
}
|
|
1275
|
-
if (
|
|
1276
|
-
const
|
|
1277
|
-
const
|
|
1278
|
-
for (let
|
|
1279
|
-
const
|
|
1280
|
-
const
|
|
1281
|
-
const
|
|
1282
|
-
let
|
|
1283
|
-
if (
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
const keyFn = typeof key === "string" ? (item) => item[key] : key;
|
|
1305
|
-
const eq = keyFn(state);
|
|
1306
|
-
if (eq !== void 0 && keyFn(value) !== keyFn(state))
|
|
1113
|
+
if (u) {
|
|
1114
|
+
const t = u[j];
|
|
1115
|
+
const l = t || r ? getAllKeys(s, o, e) : Object.keys(u);
|
|
1116
|
+
for (let f = 0, c = l.length; f < c; f++) {
|
|
1117
|
+
const c = l[f];
|
|
1118
|
+
const a = u[c];
|
|
1119
|
+
const d = unwrap(getOverrideValue(s, o, u, c));
|
|
1120
|
+
let h = unwrap(e[c]);
|
|
1121
|
+
if (d === h) continue;
|
|
1122
|
+
if (!d || !isWrappable(d) || (n(d) != null && n(d) !== n(h))) {
|
|
1123
|
+
t && setSignal(t, void 0);
|
|
1124
|
+
a && setSignal(a, isWrappable(h) ? wrap(h, i) : h);
|
|
1125
|
+
} else applyState(h, wrap(d, i), n, r);
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
if ((u = i[V])) {
|
|
1129
|
+
const t = Object.keys(u);
|
|
1130
|
+
for (let n = 0, r = t.length; n < r; n++) {
|
|
1131
|
+
const r = t[n];
|
|
1132
|
+
setSignal(u[r], r in e);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
function reconcile(e, t, n = false) {
|
|
1137
|
+
return r => {
|
|
1138
|
+
if (r == null) throw new Error("Cannot reconcile null or undefined state");
|
|
1139
|
+
const i = typeof t === "string" ? e => e[t] : t;
|
|
1140
|
+
const s = i(r);
|
|
1141
|
+
if (s !== undefined && i(e) !== i(r))
|
|
1307
1142
|
throw new Error("Cannot reconcile states with different identity");
|
|
1308
|
-
applyState(
|
|
1143
|
+
applyState(e, r, i, n);
|
|
1309
1144
|
};
|
|
1310
1145
|
}
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
const wrapped = createStoreProxy(source, storeTraps, {
|
|
1323
|
-
[STORE_WRAP]: wrapProjection,
|
|
1324
|
-
[STORE_LOOKUP]: wrappedMap,
|
|
1325
|
-
[STORE_FIREWALL]() {
|
|
1326
|
-
return node;
|
|
1146
|
+
function createProjectionInternal(e, t = {}, n) {
|
|
1147
|
+
let r;
|
|
1148
|
+
const i = new WeakMap();
|
|
1149
|
+
const wrapProjection = e => {
|
|
1150
|
+
if (i.has(e)) return i.get(e);
|
|
1151
|
+
if (e[W]?.[q] === wrapProjection) return e;
|
|
1152
|
+
const t = createStoreProxy(e, G, {
|
|
1153
|
+
[q]: wrapProjection,
|
|
1154
|
+
[M]: i,
|
|
1155
|
+
[D]() {
|
|
1156
|
+
return r;
|
|
1327
1157
|
}
|
|
1328
1158
|
});
|
|
1329
|
-
|
|
1330
|
-
return
|
|
1159
|
+
i.set(e, t);
|
|
1160
|
+
return t;
|
|
1331
1161
|
};
|
|
1332
|
-
const
|
|
1333
|
-
|
|
1334
|
-
storeSetter(
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1337
|
-
reconcile(
|
|
1162
|
+
const s = wrapProjection(t);
|
|
1163
|
+
r = computed(() => {
|
|
1164
|
+
storeSetter(s, t => {
|
|
1165
|
+
const r = e(t);
|
|
1166
|
+
if (r !== t && r !== undefined) {
|
|
1167
|
+
reconcile(r, n?.key || "id", n?.all)(t);
|
|
1338
1168
|
}
|
|
1339
1169
|
});
|
|
1340
1170
|
});
|
|
1341
|
-
return { store:
|
|
1342
|
-
}
|
|
1343
|
-
function createProjection(
|
|
1344
|
-
return createProjectionInternal(
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
return
|
|
1382
|
-
}
|
|
1383
|
-
function
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
return nodes;
|
|
1388
|
-
}
|
|
1389
|
-
function getNode(nodes, property, value, firewall, equals = isEqual) {
|
|
1390
|
-
if (nodes[property])
|
|
1391
|
-
return nodes[property];
|
|
1392
|
-
return nodes[property] = signal(
|
|
1393
|
-
value,
|
|
1171
|
+
return { store: s, node: r };
|
|
1172
|
+
}
|
|
1173
|
+
function createProjection(e, t = {}, n) {
|
|
1174
|
+
return createProjectionInternal(e, t, n).store;
|
|
1175
|
+
}
|
|
1176
|
+
const j = Symbol(0),
|
|
1177
|
+
A = Symbol(0),
|
|
1178
|
+
W = Symbol(0),
|
|
1179
|
+
P = Symbol(0),
|
|
1180
|
+
H = Symbol(0);
|
|
1181
|
+
const I = new WeakMap();
|
|
1182
|
+
const F = "v",
|
|
1183
|
+
Q = "o",
|
|
1184
|
+
R = "n",
|
|
1185
|
+
V = "h",
|
|
1186
|
+
q = "w",
|
|
1187
|
+
M = "l",
|
|
1188
|
+
D = "f";
|
|
1189
|
+
function createStoreProxy(e, t = G, n) {
|
|
1190
|
+
let r;
|
|
1191
|
+
if (Array.isArray(e)) {
|
|
1192
|
+
r = [];
|
|
1193
|
+
r.v = e;
|
|
1194
|
+
} else r = { v: e };
|
|
1195
|
+
n && Object.assign(r, n);
|
|
1196
|
+
return (r[P] = new Proxy(r, t));
|
|
1197
|
+
}
|
|
1198
|
+
const B = new WeakMap();
|
|
1199
|
+
function wrap(e, t) {
|
|
1200
|
+
if (t?.[q]) return t[q](e, t);
|
|
1201
|
+
let n = e[P] || B.get(e);
|
|
1202
|
+
if (!n) B.set(e, (n = createStoreProxy(e)));
|
|
1203
|
+
return n;
|
|
1204
|
+
}
|
|
1205
|
+
function isWrappable(e) {
|
|
1206
|
+
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1207
|
+
}
|
|
1208
|
+
function getNodes(e, t) {
|
|
1209
|
+
let n = e[t];
|
|
1210
|
+
if (!n) e[t] = n = Object.create(null);
|
|
1211
|
+
return n;
|
|
1212
|
+
}
|
|
1213
|
+
function getNode(e, t, n, r, i = isEqual) {
|
|
1214
|
+
if (e[t]) return e[t];
|
|
1215
|
+
return (e[t] = signal(
|
|
1216
|
+
n,
|
|
1394
1217
|
{
|
|
1395
|
-
equals,
|
|
1218
|
+
equals: i,
|
|
1396
1219
|
unobserved() {
|
|
1397
|
-
delete
|
|
1220
|
+
delete e[t];
|
|
1398
1221
|
}
|
|
1399
1222
|
},
|
|
1400
|
-
|
|
1401
|
-
);
|
|
1402
|
-
}
|
|
1403
|
-
function trackSelf(
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
);
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
if (
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
if (
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
return value2;
|
|
1460
|
-
const wrapped = wrap(value2, target);
|
|
1461
|
-
Writing.add(wrapped);
|
|
1462
|
-
return wrapped;
|
|
1463
|
-
}
|
|
1464
|
-
let value = tracked ? overridden || !proxySource ? read(nodes[property]) : (read(nodes[property]), storeValue[property]) : storeValue[property];
|
|
1465
|
-
value === $DELETED && (value = void 0);
|
|
1466
|
-
if (!tracked) {
|
|
1467
|
-
if (!overridden && typeof value === "function" && !storeValue.hasOwnProperty(property)) {
|
|
1468
|
-
let proto;
|
|
1469
|
-
return !Array.isArray(target[STORE_VALUE]) && (proto = Object.getPrototypeOf(target[STORE_VALUE])) && proto !== Object.prototype ? value.bind(storeValue) : value;
|
|
1223
|
+
r
|
|
1224
|
+
));
|
|
1225
|
+
}
|
|
1226
|
+
function trackSelf(e, t = j) {
|
|
1227
|
+
getObserver() && read(getNode(getNodes(e, R), t, undefined, e[D]?.(), false));
|
|
1228
|
+
}
|
|
1229
|
+
function getKeys(e, t, n = true) {
|
|
1230
|
+
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
1231
|
+
if (!t) return r;
|
|
1232
|
+
const i = new Set(r);
|
|
1233
|
+
const s = Reflect.ownKeys(t);
|
|
1234
|
+
for (const e of s) {
|
|
1235
|
+
if (t[e] !== H) i.add(e);
|
|
1236
|
+
else i.delete(e);
|
|
1237
|
+
}
|
|
1238
|
+
return Array.from(i);
|
|
1239
|
+
}
|
|
1240
|
+
function getPropertyDescriptor(e, t, n) {
|
|
1241
|
+
let r = e;
|
|
1242
|
+
if (t && n in t) {
|
|
1243
|
+
if (r[n] === H) return void 0;
|
|
1244
|
+
if (!(n in r)) r = t;
|
|
1245
|
+
}
|
|
1246
|
+
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1247
|
+
}
|
|
1248
|
+
let K = null;
|
|
1249
|
+
const G = {
|
|
1250
|
+
get(e, t, n) {
|
|
1251
|
+
if (t === W) return e;
|
|
1252
|
+
if (t === P) return n;
|
|
1253
|
+
if (t === j || t === A) {
|
|
1254
|
+
trackSelf(e, t);
|
|
1255
|
+
return n;
|
|
1256
|
+
}
|
|
1257
|
+
const r = getNodes(e, R);
|
|
1258
|
+
const i = r[t];
|
|
1259
|
+
const s = e[Q] && t in e[Q];
|
|
1260
|
+
const o = !!e[F][W];
|
|
1261
|
+
const u = s ? e[Q] : e[F];
|
|
1262
|
+
if (!i) {
|
|
1263
|
+
const e = Object.getOwnPropertyDescriptor(u, t);
|
|
1264
|
+
if (e && e.get) return e.get.call(n);
|
|
1265
|
+
}
|
|
1266
|
+
if (K?.has(n)) {
|
|
1267
|
+
let n = i && (s || !o) ? (i.K !== p ? i.K : i.G) : u[t];
|
|
1268
|
+
n === H && (n = undefined);
|
|
1269
|
+
if (!isWrappable(n)) return n;
|
|
1270
|
+
const r = wrap(n, e);
|
|
1271
|
+
K.add(r);
|
|
1272
|
+
return r;
|
|
1273
|
+
}
|
|
1274
|
+
let l = i ? (s || !o ? read(r[t]) : (read(r[t]), u[t])) : u[t];
|
|
1275
|
+
l === H && (l = undefined);
|
|
1276
|
+
if (!i) {
|
|
1277
|
+
if (!s && typeof l === "function" && !u.hasOwnProperty(t)) {
|
|
1278
|
+
let t;
|
|
1279
|
+
return !Array.isArray(e[F]) && (t = Object.getPrototypeOf(e[F])) && t !== Object.prototype
|
|
1280
|
+
? l.bind(u)
|
|
1281
|
+
: l;
|
|
1470
1282
|
} else if (getObserver()) {
|
|
1471
|
-
return read(
|
|
1472
|
-
getNode(
|
|
1473
|
-
nodes,
|
|
1474
|
-
property,
|
|
1475
|
-
isWrappable(value) ? wrap(value, target) : value,
|
|
1476
|
-
(_a = target[STORE_FIREWALL]) == null ? void 0 : _a.call(target)
|
|
1477
|
-
)
|
|
1478
|
-
);
|
|
1283
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[D]?.()));
|
|
1479
1284
|
}
|
|
1480
1285
|
}
|
|
1481
|
-
return isWrappable(
|
|
1286
|
+
return isWrappable(l) ? wrap(l, e) : l;
|
|
1482
1287
|
},
|
|
1483
|
-
has(
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
getObserver() && read(getNode(getNodes(target, STORE_HAS), property, has, (_a = target[STORE_FIREWALL]) == null ? void 0 : _a.call(target)));
|
|
1489
|
-
return has;
|
|
1288
|
+
has(e, t) {
|
|
1289
|
+
if (t === P || t === j || t === "__proto__") return true;
|
|
1290
|
+
const n = e[Q] && t in e[Q] ? e[Q][t] !== H : t in e[F];
|
|
1291
|
+
getObserver() && read(getNode(getNodes(e, V), t, n, e[D]?.()));
|
|
1292
|
+
return n;
|
|
1490
1293
|
},
|
|
1491
|
-
set(
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1294
|
+
set(e, t, n) {
|
|
1295
|
+
const r = e[P];
|
|
1296
|
+
if (K?.has(e[P])) {
|
|
1494
1297
|
untrack(() => {
|
|
1495
|
-
|
|
1496
|
-
const
|
|
1497
|
-
const
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
const wrappable = isWrappable(value);
|
|
1508
|
-
if (isWrappable(prev)) {
|
|
1509
|
-
const parents = PARENTS.get(prev);
|
|
1510
|
-
parents && (parents instanceof Set ? parents.delete(store) : PARENTS.delete(prev));
|
|
1298
|
+
const i = e[F];
|
|
1299
|
+
const s = i[t];
|
|
1300
|
+
const o = e[Q] && t in e[Q] ? e[Q][t] : s;
|
|
1301
|
+
const u = n?.[W]?.[F] ?? n;
|
|
1302
|
+
if (o === u) return true;
|
|
1303
|
+
const l = e[Q]?.length || i.length;
|
|
1304
|
+
if (u !== undefined && u === s) delete e[Q][t];
|
|
1305
|
+
else (e[Q] || (e[Q] = Object.create(null)))[t] = u;
|
|
1306
|
+
const f = isWrappable(u);
|
|
1307
|
+
if (isWrappable(o)) {
|
|
1308
|
+
const e = I.get(o);
|
|
1309
|
+
e && (e instanceof Set ? e.delete(r) : I.delete(o));
|
|
1511
1310
|
}
|
|
1512
|
-
if (recursivelyNotify(
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
if (index > len)
|
|
1520
|
-
nodes.length && setSignal(nodes.length, index);
|
|
1311
|
+
if (recursivelyNotify(r, B) && f) recursivelyAddParent(u, r);
|
|
1312
|
+
e[V]?.[t] && setSignal(e[V][t], true);
|
|
1313
|
+
const c = getNodes(e, R);
|
|
1314
|
+
c[t] && setSignal(c[t], () => (f ? wrap(u, e) : u));
|
|
1315
|
+
if (Array.isArray(i)) {
|
|
1316
|
+
const e = parseInt(t) + 1;
|
|
1317
|
+
if (e > l) c.length && setSignal(c.length, e);
|
|
1521
1318
|
}
|
|
1522
|
-
|
|
1319
|
+
c[j] && setSignal(c[j], undefined);
|
|
1523
1320
|
});
|
|
1524
1321
|
}
|
|
1525
1322
|
return true;
|
|
1526
1323
|
},
|
|
1527
|
-
deleteProperty(
|
|
1528
|
-
|
|
1529
|
-
if ((Writing == null ? void 0 : Writing.has(target[$PROXY])) && ((_a = target[STORE_OVERRIDE]) == null ? void 0 : _a[property]) !== $DELETED) {
|
|
1324
|
+
deleteProperty(e, t) {
|
|
1325
|
+
if (K?.has(e[P]) && e[Q]?.[t] !== H) {
|
|
1530
1326
|
untrack(() => {
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
const parents = PARENTS.get(prev);
|
|
1541
|
-
parents && (parents instanceof Set ? parents.delete(target) : PARENTS.delete(prev));
|
|
1327
|
+
const n = e[Q] && t in e[Q] ? e[Q][t] : e[F][t];
|
|
1328
|
+
if (t in e[F]) {
|
|
1329
|
+
(e[Q] || (e[Q] = Object.create(null)))[t] = H;
|
|
1330
|
+
} else if (e[Q] && t in e[Q]) {
|
|
1331
|
+
delete e[Q][t];
|
|
1332
|
+
} else return true;
|
|
1333
|
+
if (isWrappable(n)) {
|
|
1334
|
+
const t = I.get(n);
|
|
1335
|
+
t && (t instanceof Set ? t.delete(e) : I.delete(n));
|
|
1542
1336
|
}
|
|
1543
|
-
if (
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
nodes[$TRACK] && setSignal(nodes[$TRACK], void 0);
|
|
1337
|
+
if (e[V]?.[t]) setSignal(e[V][t], false);
|
|
1338
|
+
const r = getNodes(e, R);
|
|
1339
|
+
r[t] && setSignal(r[t], undefined);
|
|
1340
|
+
r[j] && setSignal(r[j], undefined);
|
|
1548
1341
|
});
|
|
1549
1342
|
}
|
|
1550
1343
|
return true;
|
|
1551
1344
|
},
|
|
1552
|
-
ownKeys(
|
|
1553
|
-
trackSelf(
|
|
1554
|
-
return getKeys(
|
|
1345
|
+
ownKeys(e) {
|
|
1346
|
+
trackSelf(e);
|
|
1347
|
+
return getKeys(e[F], e[Q], false);
|
|
1555
1348
|
},
|
|
1556
|
-
getOwnPropertyDescriptor(
|
|
1557
|
-
if (
|
|
1558
|
-
|
|
1559
|
-
return getPropertyDescriptor(target[STORE_VALUE], target[STORE_OVERRIDE], property);
|
|
1349
|
+
getOwnPropertyDescriptor(e, t) {
|
|
1350
|
+
if (t === P) return { value: e[P], writable: true, configurable: true };
|
|
1351
|
+
return getPropertyDescriptor(e[F], e[Q], t);
|
|
1560
1352
|
},
|
|
1561
|
-
getPrototypeOf(
|
|
1562
|
-
return Object.getPrototypeOf(
|
|
1353
|
+
getPrototypeOf(e) {
|
|
1354
|
+
return Object.getPrototypeOf(e[F]);
|
|
1563
1355
|
}
|
|
1564
1356
|
};
|
|
1565
|
-
function storeSetter(
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1568
|
-
|
|
1357
|
+
function storeSetter(e, t) {
|
|
1358
|
+
const n = K;
|
|
1359
|
+
K = new Set();
|
|
1360
|
+
K.add(e);
|
|
1569
1361
|
try {
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1572
|
-
if (Array.isArray(
|
|
1573
|
-
for (let
|
|
1574
|
-
|
|
1575
|
-
store.length = value.length;
|
|
1362
|
+
const n = t(e);
|
|
1363
|
+
if (n !== e && n !== undefined) {
|
|
1364
|
+
if (Array.isArray(n)) {
|
|
1365
|
+
for (let t = 0, r = n.length; t < r; t++) e[t] = n[t];
|
|
1366
|
+
e.length = n.length;
|
|
1576
1367
|
} else {
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1579
|
-
if (
|
|
1580
|
-
|
|
1581
|
-
else
|
|
1582
|
-
delete store[key];
|
|
1368
|
+
const t = new Set([...Object.keys(e), ...Object.keys(n)]);
|
|
1369
|
+
t.forEach(t => {
|
|
1370
|
+
if (t in n) e[t] = n[t];
|
|
1371
|
+
else delete e[t];
|
|
1583
1372
|
});
|
|
1584
1373
|
}
|
|
1585
1374
|
}
|
|
1586
1375
|
} finally {
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
function createStore(
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
let
|
|
1598
|
-
let
|
|
1599
|
-
if (
|
|
1600
|
-
const
|
|
1601
|
-
if (
|
|
1602
|
-
setSignal(
|
|
1603
|
-
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
}
|
|
1607
|
-
const
|
|
1608
|
-
if (!
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
else
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
return;
|
|
1636
|
-
}
|
|
1637
|
-
if (Array.isArray(state)) {
|
|
1638
|
-
const len = (override == null ? void 0 : override.length) || state.length;
|
|
1639
|
-
for (let i = 0; i < len; i++) {
|
|
1640
|
-
const item = override && i in override ? override[i] : state[i];
|
|
1641
|
-
isWrappable(item) && recursivelyAddParent(item, state);
|
|
1376
|
+
K.clear();
|
|
1377
|
+
K = n;
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
function createStore(e, t, n) {
|
|
1381
|
+
const r = typeof e === "function",
|
|
1382
|
+
i = r ? createProjectionInternal(e, t, n).store : wrap(e);
|
|
1383
|
+
return [i, e => storeSetter(i, e)];
|
|
1384
|
+
}
|
|
1385
|
+
function recursivelyNotify(e, t) {
|
|
1386
|
+
let n = e[W] || t?.get(e)?.[W];
|
|
1387
|
+
let r = false;
|
|
1388
|
+
if (n) {
|
|
1389
|
+
const e = getNodes(n, R)[A];
|
|
1390
|
+
if (e) {
|
|
1391
|
+
setSignal(e, undefined);
|
|
1392
|
+
r = true;
|
|
1393
|
+
}
|
|
1394
|
+
t = n[M] || t;
|
|
1395
|
+
}
|
|
1396
|
+
const i = I.get(n?.[F] || e);
|
|
1397
|
+
if (!i) return r;
|
|
1398
|
+
if (i instanceof Set) {
|
|
1399
|
+
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
1400
|
+
} else r = recursivelyNotify(i, t) || r;
|
|
1401
|
+
return r;
|
|
1402
|
+
}
|
|
1403
|
+
function recursivelyAddParent(e, t) {
|
|
1404
|
+
let n;
|
|
1405
|
+
const r = e[W];
|
|
1406
|
+
if (r) {
|
|
1407
|
+
n = r[Q];
|
|
1408
|
+
e = r[F];
|
|
1409
|
+
}
|
|
1410
|
+
if (t) {
|
|
1411
|
+
let n = I.get(e);
|
|
1412
|
+
if (!n) I.set(e, t);
|
|
1413
|
+
else if (n !== t) {
|
|
1414
|
+
if (!(n instanceof Set)) I.set(e, (n = new Set([n])));
|
|
1415
|
+
else if (n.has(t)) return;
|
|
1416
|
+
n.add(t);
|
|
1417
|
+
} else return;
|
|
1418
|
+
}
|
|
1419
|
+
if (Array.isArray(e)) {
|
|
1420
|
+
const t = n?.length || e.length;
|
|
1421
|
+
for (let r = 0; r < t; r++) {
|
|
1422
|
+
const t = n && r in n ? n[r] : e[r];
|
|
1423
|
+
isWrappable(t) && recursivelyAddParent(t, e);
|
|
1642
1424
|
}
|
|
1643
1425
|
} else {
|
|
1644
|
-
const
|
|
1645
|
-
for (let
|
|
1646
|
-
const
|
|
1647
|
-
const
|
|
1648
|
-
isWrappable(
|
|
1426
|
+
const t = getKeys(e, n);
|
|
1427
|
+
for (let r = 0; r < t.length; r++) {
|
|
1428
|
+
const i = t[r];
|
|
1429
|
+
const s = n && i in n ? n[i] : e[i];
|
|
1430
|
+
isWrappable(s) && recursivelyAddParent(s, e);
|
|
1649
1431
|
}
|
|
1650
1432
|
}
|
|
1651
1433
|
}
|
|
1652
|
-
function deep(
|
|
1653
|
-
recursivelyAddParent(
|
|
1654
|
-
return
|
|
1434
|
+
function deep(e) {
|
|
1435
|
+
recursivelyAddParent(e);
|
|
1436
|
+
return e[A];
|
|
1655
1437
|
}
|
|
1656
|
-
|
|
1657
|
-
// src/store/optimistic.ts
|
|
1658
|
-
function createOptimisticStore(first, second, options) {
|
|
1438
|
+
function createOptimisticStore(e, t, n) {
|
|
1659
1439
|
return [];
|
|
1660
1440
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
if (
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
if (target = item[$TARGET] || ((_a = lookup == null ? void 0 : lookup.get(item)) == null ? void 0 : _a[$TARGET])) {
|
|
1673
|
-
override = target[STORE_OVERRIDE];
|
|
1674
|
-
isArray = Array.isArray(target[STORE_VALUE]);
|
|
1675
|
-
map.set(
|
|
1676
|
-
item,
|
|
1677
|
-
override ? result = isArray ? [] : Object.create(Object.getPrototypeOf(target[STORE_VALUE])) : target[STORE_VALUE]
|
|
1678
|
-
);
|
|
1679
|
-
item = target[STORE_VALUE];
|
|
1680
|
-
lookup = storeLookup;
|
|
1441
|
+
function snapshot(e, t, n) {
|
|
1442
|
+
let r, i, s, o, u, l;
|
|
1443
|
+
if (!isWrappable(e)) return e;
|
|
1444
|
+
if (t && t.has(e)) return t.get(e);
|
|
1445
|
+
if (!t) t = new Map();
|
|
1446
|
+
if ((r = e[W] || n?.get(e)?.[W])) {
|
|
1447
|
+
s = r[Q];
|
|
1448
|
+
i = Array.isArray(r[F]);
|
|
1449
|
+
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[F]))) : r[F]);
|
|
1450
|
+
e = r[F];
|
|
1451
|
+
n = B;
|
|
1681
1452
|
} else {
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
}
|
|
1685
|
-
if (
|
|
1686
|
-
const
|
|
1687
|
-
for (let i = 0; i <
|
|
1688
|
-
|
|
1689
|
-
if (
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
map.set(item, result = [...item]);
|
|
1694
|
-
result[i] = unwrapped;
|
|
1453
|
+
i = Array.isArray(e);
|
|
1454
|
+
t.set(e, e);
|
|
1455
|
+
}
|
|
1456
|
+
if (i) {
|
|
1457
|
+
const r = s?.length || e.length;
|
|
1458
|
+
for (let i = 0; i < r; i++) {
|
|
1459
|
+
l = s && i in s ? s[i] : e[i];
|
|
1460
|
+
if (l === H) continue;
|
|
1461
|
+
if ((u = snapshot(l, t, n)) !== l || o) {
|
|
1462
|
+
if (!o) t.set(e, (o = [...e]));
|
|
1463
|
+
o[i] = u;
|
|
1695
1464
|
}
|
|
1696
1465
|
}
|
|
1697
1466
|
} else {
|
|
1698
|
-
const
|
|
1699
|
-
for (let i = 0,
|
|
1700
|
-
let
|
|
1701
|
-
const
|
|
1702
|
-
if (
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
Object.assign(result, item);
|
|
1467
|
+
const r = getKeys(e, s);
|
|
1468
|
+
for (let i = 0, f = r.length; i < f; i++) {
|
|
1469
|
+
let f = r[i];
|
|
1470
|
+
const c = getPropertyDescriptor(e, s, f);
|
|
1471
|
+
if (c.get) continue;
|
|
1472
|
+
l = s && f in s ? s[f] : e[f];
|
|
1473
|
+
if ((u = snapshot(l, t, n)) !== e[f] || o) {
|
|
1474
|
+
if (!o) {
|
|
1475
|
+
o = Object.create(Object.getPrototypeOf(e));
|
|
1476
|
+
Object.assign(o, e);
|
|
1709
1477
|
}
|
|
1710
|
-
|
|
1478
|
+
o[f] = u;
|
|
1711
1479
|
}
|
|
1712
1480
|
}
|
|
1713
1481
|
}
|
|
1714
|
-
return
|
|
1482
|
+
return o || e;
|
|
1715
1483
|
}
|
|
1716
1484
|
function trueFn() {
|
|
1717
1485
|
return true;
|
|
1718
1486
|
}
|
|
1719
|
-
|
|
1720
|
-
get(
|
|
1721
|
-
if (
|
|
1722
|
-
|
|
1723
|
-
return _.get(property);
|
|
1487
|
+
const T = {
|
|
1488
|
+
get(e, t, n) {
|
|
1489
|
+
if (t === P) return n;
|
|
1490
|
+
return e.get(t);
|
|
1724
1491
|
},
|
|
1725
|
-
has(
|
|
1726
|
-
if (
|
|
1727
|
-
|
|
1728
|
-
return _.has(property);
|
|
1492
|
+
has(e, t) {
|
|
1493
|
+
if (t === P) return true;
|
|
1494
|
+
return e.has(t);
|
|
1729
1495
|
},
|
|
1730
1496
|
set: trueFn,
|
|
1731
1497
|
deleteProperty: trueFn,
|
|
1732
|
-
getOwnPropertyDescriptor(
|
|
1498
|
+
getOwnPropertyDescriptor(e, t) {
|
|
1733
1499
|
return {
|
|
1734
1500
|
configurable: true,
|
|
1735
1501
|
enumerable: true,
|
|
1736
1502
|
get() {
|
|
1737
|
-
return
|
|
1503
|
+
return e.get(t);
|
|
1738
1504
|
},
|
|
1739
1505
|
set: trueFn,
|
|
1740
1506
|
deleteProperty: trueFn
|
|
1741
1507
|
};
|
|
1742
1508
|
},
|
|
1743
|
-
ownKeys(
|
|
1744
|
-
return
|
|
1509
|
+
ownKeys(e) {
|
|
1510
|
+
return e.keys();
|
|
1745
1511
|
}
|
|
1746
1512
|
};
|
|
1747
|
-
function resolveSource(
|
|
1748
|
-
return !(
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
function merge(...
|
|
1752
|
-
if (
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
flattened.push(
|
|
1764
|
-
typeof s === "function" ? (proxy = true, createMemo(s)) : s
|
|
1765
|
-
);
|
|
1766
|
-
}
|
|
1767
|
-
if (SUPPORTS_PROXY && proxy) {
|
|
1513
|
+
function resolveSource(e) {
|
|
1514
|
+
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
1515
|
+
}
|
|
1516
|
+
const U = Symbol(0);
|
|
1517
|
+
function merge(...e) {
|
|
1518
|
+
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
1519
|
+
let t = false;
|
|
1520
|
+
const n = [];
|
|
1521
|
+
for (let r = 0; r < e.length; r++) {
|
|
1522
|
+
const i = e[r];
|
|
1523
|
+
t = t || (!!i && P in i);
|
|
1524
|
+
const s = !!i && i[U];
|
|
1525
|
+
if (s) n.push(...s);
|
|
1526
|
+
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
1527
|
+
}
|
|
1528
|
+
if (y && t) {
|
|
1768
1529
|
return new Proxy(
|
|
1769
1530
|
{
|
|
1770
|
-
get(
|
|
1771
|
-
if (
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
if (property in s)
|
|
1776
|
-
return s[property];
|
|
1531
|
+
get(e) {
|
|
1532
|
+
if (e === U) return n;
|
|
1533
|
+
for (let t = n.length - 1; t >= 0; t--) {
|
|
1534
|
+
const r = resolveSource(n[t]);
|
|
1535
|
+
if (e in r) return r[e];
|
|
1777
1536
|
}
|
|
1778
1537
|
},
|
|
1779
|
-
has(
|
|
1780
|
-
for (let
|
|
1781
|
-
if (
|
|
1782
|
-
return true;
|
|
1538
|
+
has(e) {
|
|
1539
|
+
for (let t = n.length - 1; t >= 0; t--) {
|
|
1540
|
+
if (e in resolveSource(n[t])) return true;
|
|
1783
1541
|
}
|
|
1784
1542
|
return false;
|
|
1785
1543
|
},
|
|
1786
1544
|
keys() {
|
|
1787
|
-
const
|
|
1788
|
-
for (let
|
|
1789
|
-
|
|
1790
|
-
return [...new Set(keys)];
|
|
1545
|
+
const e = [];
|
|
1546
|
+
for (let t = 0; t < n.length; t++) e.push(...Object.keys(resolveSource(n[t])));
|
|
1547
|
+
return [...new Set(e)];
|
|
1791
1548
|
}
|
|
1792
1549
|
},
|
|
1793
|
-
|
|
1550
|
+
T
|
|
1794
1551
|
);
|
|
1795
1552
|
}
|
|
1796
|
-
const
|
|
1797
|
-
let
|
|
1798
|
-
let
|
|
1799
|
-
for (let
|
|
1800
|
-
const
|
|
1801
|
-
if (!
|
|
1802
|
-
|
|
1553
|
+
const r = Object.create(null);
|
|
1554
|
+
let i = false;
|
|
1555
|
+
let s = n.length - 1;
|
|
1556
|
+
for (let e = s; e >= 0; e--) {
|
|
1557
|
+
const t = n[e];
|
|
1558
|
+
if (!t) {
|
|
1559
|
+
e === s && s--;
|
|
1803
1560
|
continue;
|
|
1804
1561
|
}
|
|
1805
|
-
const
|
|
1806
|
-
for (let
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
defined[key] = desc.get ? {
|
|
1814
|
-
enumerable: true,
|
|
1815
|
-
configurable: true,
|
|
1816
|
-
get: desc.get.bind(source)
|
|
1817
|
-
} : desc;
|
|
1562
|
+
const o = Object.getOwnPropertyNames(t);
|
|
1563
|
+
for (let n = o.length - 1; n >= 0; n--) {
|
|
1564
|
+
const u = o[n];
|
|
1565
|
+
if (u === "__proto__" || u === "constructor") continue;
|
|
1566
|
+
if (!r[u]) {
|
|
1567
|
+
i = i || e !== s;
|
|
1568
|
+
const n = Object.getOwnPropertyDescriptor(t, u);
|
|
1569
|
+
r[u] = n.get ? { enumerable: true, configurable: true, get: n.get.bind(t) } : n;
|
|
1818
1570
|
}
|
|
1819
1571
|
}
|
|
1820
1572
|
}
|
|
1821
|
-
if (!
|
|
1822
|
-
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1829
|
-
else
|
|
1830
|
-
target[key] = desc.value;
|
|
1573
|
+
if (!i) return n[s];
|
|
1574
|
+
const o = {};
|
|
1575
|
+
const u = Object.keys(r);
|
|
1576
|
+
for (let e = u.length - 1; e >= 0; e--) {
|
|
1577
|
+
const t = u[e],
|
|
1578
|
+
n = r[t];
|
|
1579
|
+
if (n.get) Object.defineProperty(o, t, n);
|
|
1580
|
+
else o[t] = n.value;
|
|
1831
1581
|
}
|
|
1832
|
-
|
|
1833
|
-
return
|
|
1582
|
+
o[U] = n;
|
|
1583
|
+
return o;
|
|
1834
1584
|
}
|
|
1835
|
-
function omit(
|
|
1836
|
-
const
|
|
1837
|
-
if (
|
|
1585
|
+
function omit(e, ...t) {
|
|
1586
|
+
const n = new Set(t);
|
|
1587
|
+
if (y && P in e) {
|
|
1838
1588
|
return new Proxy(
|
|
1839
1589
|
{
|
|
1840
|
-
get(
|
|
1841
|
-
return
|
|
1590
|
+
get(t) {
|
|
1591
|
+
return n.has(t) ? undefined : e[t];
|
|
1842
1592
|
},
|
|
1843
|
-
has(
|
|
1844
|
-
return !
|
|
1593
|
+
has(t) {
|
|
1594
|
+
return !n.has(t) && t in e;
|
|
1845
1595
|
},
|
|
1846
1596
|
keys() {
|
|
1847
|
-
return Object.keys(
|
|
1597
|
+
return Object.keys(e).filter(e => !n.has(e));
|
|
1848
1598
|
}
|
|
1849
1599
|
},
|
|
1850
|
-
|
|
1600
|
+
T
|
|
1851
1601
|
);
|
|
1852
1602
|
}
|
|
1853
|
-
const
|
|
1854
|
-
for (const
|
|
1855
|
-
if (!
|
|
1856
|
-
const
|
|
1857
|
-
!
|
|
1603
|
+
const r = {};
|
|
1604
|
+
for (const t of Object.getOwnPropertyNames(e)) {
|
|
1605
|
+
if (!n.has(t)) {
|
|
1606
|
+
const n = Object.getOwnPropertyDescriptor(e, t);
|
|
1607
|
+
!n.get && !n.set && n.enumerable && n.writable && n.configurable
|
|
1608
|
+
? (r[t] = n.value)
|
|
1609
|
+
: Object.defineProperty(r, t, n);
|
|
1858
1610
|
}
|
|
1859
1611
|
}
|
|
1860
|
-
return
|
|
1612
|
+
return r;
|
|
1861
1613
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
function mapArray(list, map, options) {
|
|
1865
|
-
const keyFn = typeof (options == null ? void 0 : options.keyed) === "function" ? options.keyed : void 0;
|
|
1614
|
+
function mapArray(e, t, n) {
|
|
1615
|
+
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
1866
1616
|
return createMemo(
|
|
1867
1617
|
updateKeyedMap.bind({
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1618
|
+
Oe: createOwner(),
|
|
1619
|
+
Ce: 0,
|
|
1620
|
+
ve: e,
|
|
1621
|
+
Ne: [],
|
|
1622
|
+
ke: t,
|
|
1623
|
+
Ee: [],
|
|
1624
|
+
je: [],
|
|
1625
|
+
Ae: r,
|
|
1626
|
+
We: r || n?.keyed === false ? [] : undefined,
|
|
1627
|
+
Pe: t.length > 1 ? [] : undefined,
|
|
1628
|
+
He: n?.fallback
|
|
1879
1629
|
})
|
|
1880
1630
|
);
|
|
1881
1631
|
}
|
|
1882
|
-
|
|
1632
|
+
const L = { pureWrite: true };
|
|
1883
1633
|
function updateKeyedMap() {
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
this.
|
|
1912
|
-
this.
|
|
1913
|
-
this.
|
|
1634
|
+
const e = this.ve() || [],
|
|
1635
|
+
t = e.length;
|
|
1636
|
+
e[j];
|
|
1637
|
+
runWithOwner(this.Oe, () => {
|
|
1638
|
+
let n,
|
|
1639
|
+
r,
|
|
1640
|
+
i = this.We
|
|
1641
|
+
? () => {
|
|
1642
|
+
this.We[r] = signal(e[r], L);
|
|
1643
|
+
this.Pe && (this.Pe[r] = signal(r, L));
|
|
1644
|
+
return this.ke(
|
|
1645
|
+
read.bind(null, this.We[r]),
|
|
1646
|
+
this.Pe ? read.bind(null, this.Pe[r]) : undefined
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1649
|
+
: this.Pe
|
|
1650
|
+
? () => {
|
|
1651
|
+
const t = e[r];
|
|
1652
|
+
this.Pe[r] = signal(r, L);
|
|
1653
|
+
return this.ke(() => t, read.bind(null, this.Pe[r]));
|
|
1654
|
+
}
|
|
1655
|
+
: () => {
|
|
1656
|
+
const t = e[r];
|
|
1657
|
+
return this.ke(() => t);
|
|
1658
|
+
};
|
|
1659
|
+
if (t === 0) {
|
|
1660
|
+
if (this.Ce !== 0) {
|
|
1661
|
+
this.Oe.dispose(false);
|
|
1662
|
+
this.je = [];
|
|
1663
|
+
this.Ne = [];
|
|
1664
|
+
this.Ee = [];
|
|
1665
|
+
this.Ce = 0;
|
|
1666
|
+
this.We && (this.We = []);
|
|
1667
|
+
this.Pe && (this.Pe = []);
|
|
1914
1668
|
}
|
|
1915
|
-
if (this.
|
|
1916
|
-
this.
|
|
1917
|
-
this.a[0] = createOwner(),
|
|
1918
|
-
this.Y
|
|
1919
|
-
);
|
|
1669
|
+
if (this.He && !this.Ee[0]) {
|
|
1670
|
+
this.Ee[0] = runWithOwner((this.je[0] = createOwner()), this.He);
|
|
1920
1671
|
}
|
|
1921
|
-
} else if (this.
|
|
1922
|
-
if (this.
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
this.
|
|
1927
|
-
this.d[j] = runWithOwner(this.a[j] = createOwner(), mapper);
|
|
1672
|
+
} else if (this.Ce === 0) {
|
|
1673
|
+
if (this.je[0]) this.je[0].dispose();
|
|
1674
|
+
this.Ee = new Array(t);
|
|
1675
|
+
for (r = 0; r < t; r++) {
|
|
1676
|
+
this.Ne[r] = e[r];
|
|
1677
|
+
this.Ee[r] = runWithOwner((this.je[r] = createOwner()), i);
|
|
1928
1678
|
}
|
|
1929
|
-
this.
|
|
1679
|
+
this.Ce = t;
|
|
1930
1680
|
} else {
|
|
1931
|
-
let
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1681
|
+
let s,
|
|
1682
|
+
o,
|
|
1683
|
+
u,
|
|
1684
|
+
l,
|
|
1685
|
+
f,
|
|
1686
|
+
c,
|
|
1687
|
+
a,
|
|
1688
|
+
d = new Array(t),
|
|
1689
|
+
h = new Array(t),
|
|
1690
|
+
p = this.We ? new Array(t) : undefined,
|
|
1691
|
+
y = this.Pe ? new Array(t) : undefined;
|
|
1692
|
+
for (
|
|
1693
|
+
s = 0, o = Math.min(this.Ce, t);
|
|
1694
|
+
s < o && (this.Ne[s] === e[s] || (this.We && compare(this.Ae, this.Ne[s], e[s])));
|
|
1695
|
+
s++
|
|
1696
|
+
) {
|
|
1697
|
+
if (this.We) setSignal(this.We[s], e[s]);
|
|
1935
1698
|
}
|
|
1936
|
-
for (
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1699
|
+
for (
|
|
1700
|
+
o = this.Ce - 1, u = t - 1;
|
|
1701
|
+
o >= s &&
|
|
1702
|
+
u >= s &&
|
|
1703
|
+
(this.Ne[o] === e[u] || (this.We && compare(this.Ae, this.Ne[o], e[u])));
|
|
1704
|
+
o--, u--
|
|
1705
|
+
) {
|
|
1706
|
+
d[u] = this.Ee[o];
|
|
1707
|
+
h[u] = this.je[o];
|
|
1708
|
+
p && (p[u] = this.We[o]);
|
|
1709
|
+
y && (y[u] = this.Pe[o]);
|
|
1941
1710
|
}
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
for (
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1711
|
+
c = new Map();
|
|
1712
|
+
a = new Array(u + 1);
|
|
1713
|
+
for (r = u; r >= s; r--) {
|
|
1714
|
+
l = e[r];
|
|
1715
|
+
f = this.Ae ? this.Ae(l) : l;
|
|
1716
|
+
n = c.get(f);
|
|
1717
|
+
a[r] = n === undefined ? -1 : n;
|
|
1718
|
+
c.set(f, r);
|
|
1950
1719
|
}
|
|
1951
|
-
for (
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
if (
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
} else
|
|
1963
|
-
this.a[i].dispose();
|
|
1720
|
+
for (n = s; n <= o; n++) {
|
|
1721
|
+
l = this.Ne[n];
|
|
1722
|
+
f = this.Ae ? this.Ae(l) : l;
|
|
1723
|
+
r = c.get(f);
|
|
1724
|
+
if (r !== undefined && r !== -1) {
|
|
1725
|
+
d[r] = this.Ee[n];
|
|
1726
|
+
h[r] = this.je[n];
|
|
1727
|
+
p && (p[r] = this.We[n]);
|
|
1728
|
+
y && (y[r] = this.Pe[n]);
|
|
1729
|
+
r = a[r];
|
|
1730
|
+
c.set(f, r);
|
|
1731
|
+
} else this.je[n].dispose();
|
|
1964
1732
|
}
|
|
1965
|
-
for (
|
|
1966
|
-
if (
|
|
1967
|
-
this.
|
|
1968
|
-
this.
|
|
1969
|
-
if (
|
|
1970
|
-
this.
|
|
1971
|
-
setSignal(this.
|
|
1733
|
+
for (r = s; r < t; r++) {
|
|
1734
|
+
if (r in d) {
|
|
1735
|
+
this.Ee[r] = d[r];
|
|
1736
|
+
this.je[r] = h[r];
|
|
1737
|
+
if (p) {
|
|
1738
|
+
this.We[r] = p[r];
|
|
1739
|
+
setSignal(this.We[r], e[r]);
|
|
1972
1740
|
}
|
|
1973
|
-
if (
|
|
1974
|
-
this.
|
|
1975
|
-
setSignal(this.
|
|
1741
|
+
if (y) {
|
|
1742
|
+
this.Pe[r] = y[r];
|
|
1743
|
+
setSignal(this.Pe[r], r);
|
|
1976
1744
|
}
|
|
1977
1745
|
} else {
|
|
1978
|
-
this.
|
|
1746
|
+
this.Ee[r] = runWithOwner((this.je[r] = createOwner()), i);
|
|
1979
1747
|
}
|
|
1980
1748
|
}
|
|
1981
|
-
this.
|
|
1982
|
-
this.
|
|
1749
|
+
this.Ee = this.Ee.slice(0, (this.Ce = t));
|
|
1750
|
+
this.Ne = e.slice(0);
|
|
1983
1751
|
}
|
|
1984
1752
|
});
|
|
1985
|
-
return this.
|
|
1753
|
+
return this.Ee;
|
|
1986
1754
|
}
|
|
1987
|
-
function repeat(
|
|
1755
|
+
function repeat(e, t, n) {
|
|
1988
1756
|
return updateRepeat.bind({
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1757
|
+
Oe: createOwner(),
|
|
1758
|
+
Ce: 0,
|
|
1759
|
+
Ie: 0,
|
|
1760
|
+
Fe: e,
|
|
1761
|
+
ke: t,
|
|
1762
|
+
je: [],
|
|
1763
|
+
Ee: [],
|
|
1764
|
+
Qe: n?.from,
|
|
1765
|
+
He: n?.fallback
|
|
1998
1766
|
});
|
|
1999
1767
|
}
|
|
2000
1768
|
function updateRepeat() {
|
|
2001
|
-
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
this.
|
|
2008
|
-
this.
|
|
2009
|
-
this.
|
|
2010
|
-
this.n = 0;
|
|
1769
|
+
const e = this.Fe();
|
|
1770
|
+
const t = this.Qe?.() || 0;
|
|
1771
|
+
runWithOwner(this.Oe, () => {
|
|
1772
|
+
if (e === 0) {
|
|
1773
|
+
if (this.Ce !== 0) {
|
|
1774
|
+
this.Oe.dispose(false);
|
|
1775
|
+
this.je = [];
|
|
1776
|
+
this.Ee = [];
|
|
1777
|
+
this.Ce = 0;
|
|
2011
1778
|
}
|
|
2012
|
-
if (this.
|
|
2013
|
-
this.
|
|
2014
|
-
this.a[0] = createOwner(),
|
|
2015
|
-
this.Y
|
|
2016
|
-
);
|
|
1779
|
+
if (this.He && !this.Ee[0]) {
|
|
1780
|
+
this.Ee[0] = runWithOwner((this.je[0] = createOwner()), this.He);
|
|
2017
1781
|
}
|
|
2018
1782
|
return;
|
|
2019
1783
|
}
|
|
2020
|
-
const
|
|
2021
|
-
const
|
|
2022
|
-
if (this.
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
this.
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
this.a[i] = this.a[i - difference];
|
|
2038
|
-
this.d[i] = this.d[i - difference];
|
|
2039
|
-
i--;
|
|
1784
|
+
const n = t + e;
|
|
1785
|
+
const r = this.Ie + this.Ce;
|
|
1786
|
+
if (this.Ce === 0 && this.je[0]) this.je[0].dispose();
|
|
1787
|
+
for (let e = n; e < r; e++) this.je[e - this.Ie].dispose();
|
|
1788
|
+
if (this.Ie < t) {
|
|
1789
|
+
let e = this.Ie;
|
|
1790
|
+
while (e < t && e < this.Ce) this.je[e++].dispose();
|
|
1791
|
+
this.je.splice(0, t - this.Ie);
|
|
1792
|
+
this.Ee.splice(0, t - this.Ie);
|
|
1793
|
+
} else if (this.Ie > t) {
|
|
1794
|
+
let n = r - this.Ie - 1;
|
|
1795
|
+
let i = this.Ie - t;
|
|
1796
|
+
this.je.length = this.Ee.length = e;
|
|
1797
|
+
while (n >= i) {
|
|
1798
|
+
this.je[n] = this.je[n - i];
|
|
1799
|
+
this.Ee[n] = this.Ee[n - i];
|
|
1800
|
+
n--;
|
|
2040
1801
|
}
|
|
2041
|
-
for (let
|
|
2042
|
-
this.
|
|
2043
|
-
this.a[i2] = createOwner(),
|
|
2044
|
-
() => this.O(i2 + from)
|
|
2045
|
-
);
|
|
1802
|
+
for (let e = 0; e < i; e++) {
|
|
1803
|
+
this.Ee[e] = runWithOwner((this.je[e] = createOwner()), () => this.ke(e + t));
|
|
2046
1804
|
}
|
|
2047
1805
|
}
|
|
2048
|
-
for (let
|
|
2049
|
-
this.
|
|
2050
|
-
this.a[i - from] = createOwner(),
|
|
2051
|
-
() => this.O(i)
|
|
2052
|
-
);
|
|
1806
|
+
for (let e = r; e < n; e++) {
|
|
1807
|
+
this.Ee[e - t] = runWithOwner((this.je[e - t] = createOwner()), () => this.ke(e));
|
|
2053
1808
|
}
|
|
2054
|
-
this.
|
|
2055
|
-
this.
|
|
2056
|
-
this.
|
|
1809
|
+
this.Ee = this.Ee.slice(0, e);
|
|
1810
|
+
this.Ie = t;
|
|
1811
|
+
this.Ce = e;
|
|
2057
1812
|
});
|
|
2058
|
-
return this.
|
|
2059
|
-
}
|
|
2060
|
-
function compare(
|
|
2061
|
-
return
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
if (this.Z & 1 /* Pending */ && !(this.f & 4 /* Uninitialized */)) {
|
|
2072
|
-
flags &= ~1 /* Pending */;
|
|
1813
|
+
return this.Ee;
|
|
1814
|
+
}
|
|
1815
|
+
function compare(e, t, n) {
|
|
1816
|
+
return e ? e(t) === e(n) : true;
|
|
1817
|
+
}
|
|
1818
|
+
function boundaryComputed(e, t) {
|
|
1819
|
+
const n = computed(e, undefined, {
|
|
1820
|
+
we: {
|
|
1821
|
+
le() {
|
|
1822
|
+
let e = this.$;
|
|
1823
|
+
this.$ &= ~this.Re;
|
|
1824
|
+
if (this.Re & f && !(this.$ & a)) {
|
|
1825
|
+
e &= ~f;
|
|
2073
1826
|
}
|
|
2074
|
-
this.
|
|
1827
|
+
this.ye.notify(this, this.Re, e);
|
|
2075
1828
|
},
|
|
2076
|
-
|
|
1829
|
+
Re: t
|
|
2077
1830
|
}
|
|
2078
1831
|
});
|
|
2079
|
-
|
|
2080
|
-
return
|
|
2081
|
-
}
|
|
2082
|
-
function createBoundChildren(
|
|
2083
|
-
const
|
|
2084
|
-
|
|
2085
|
-
onCleanup(() =>
|
|
2086
|
-
return runWithOwner(
|
|
2087
|
-
const
|
|
2088
|
-
return boundaryComputed(() => staleValues(() => flatten(read(
|
|
1832
|
+
n.Re = t;
|
|
1833
|
+
return n;
|
|
1834
|
+
}
|
|
1835
|
+
function createBoundChildren(e, t, n, r) {
|
|
1836
|
+
const i = e.ye;
|
|
1837
|
+
i.addChild((e.ye = n));
|
|
1838
|
+
onCleanup(() => i.removeChild(e.ye));
|
|
1839
|
+
return runWithOwner(e, () => {
|
|
1840
|
+
const e = computed(t);
|
|
1841
|
+
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2089
1842
|
});
|
|
2090
1843
|
}
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
constructor(
|
|
1844
|
+
class ConditionalQueue extends Queue {
|
|
1845
|
+
Ve;
|
|
1846
|
+
qe = new Set();
|
|
1847
|
+
M = new Set();
|
|
1848
|
+
constructor(e) {
|
|
2096
1849
|
super();
|
|
2097
|
-
this.
|
|
2098
|
-
}
|
|
2099
|
-
run(
|
|
2100
|
-
if (!
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
} else if (this.h.delete(node))
|
|
2111
|
-
type &= ~1 /* Pending */;
|
|
1850
|
+
this.Ve = e;
|
|
1851
|
+
}
|
|
1852
|
+
run(e) {
|
|
1853
|
+
if (!e || read(this.Ve)) return;
|
|
1854
|
+
return super.run(e);
|
|
1855
|
+
}
|
|
1856
|
+
notify(e, t, n) {
|
|
1857
|
+
if (read(this.Ve)) {
|
|
1858
|
+
if (t & f) {
|
|
1859
|
+
if (n & f) {
|
|
1860
|
+
this.M.add(e);
|
|
1861
|
+
t &= ~f;
|
|
1862
|
+
} else if (this.M.delete(e)) t &= ~f;
|
|
2112
1863
|
}
|
|
2113
|
-
if (
|
|
2114
|
-
if (
|
|
2115
|
-
this.
|
|
2116
|
-
|
|
2117
|
-
} else if (this.
|
|
2118
|
-
type &= ~2 /* Error */;
|
|
1864
|
+
if (t & c) {
|
|
1865
|
+
if (n & c) {
|
|
1866
|
+
this.qe.add(e);
|
|
1867
|
+
t &= ~c;
|
|
1868
|
+
} else if (this.qe.delete(e)) t &= ~c;
|
|
2119
1869
|
}
|
|
2120
1870
|
}
|
|
2121
|
-
return
|
|
1871
|
+
return t ? super.notify(e, t, n) : true;
|
|
2122
1872
|
}
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
constructor(
|
|
1873
|
+
}
|
|
1874
|
+
class CollectionQueue extends Queue {
|
|
1875
|
+
Me;
|
|
1876
|
+
je = new Set();
|
|
1877
|
+
Ve = signal(false, { pureWrite: true });
|
|
1878
|
+
De = false;
|
|
1879
|
+
constructor(e) {
|
|
2130
1880
|
super();
|
|
2131
|
-
this.
|
|
2132
|
-
}
|
|
2133
|
-
run(
|
|
2134
|
-
if (!
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
if (
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
const
|
|
2157
|
-
const
|
|
1881
|
+
this.Me = e;
|
|
1882
|
+
}
|
|
1883
|
+
run(e) {
|
|
1884
|
+
if (!e || read(this.Ve)) return;
|
|
1885
|
+
return super.run(e);
|
|
1886
|
+
}
|
|
1887
|
+
notify(e, t, n) {
|
|
1888
|
+
if (!(t & this.Me) || (this.Me & f && this.De)) return super.notify(e, t, n);
|
|
1889
|
+
if (n & this.Me) {
|
|
1890
|
+
this.je.add(e);
|
|
1891
|
+
if (this.je.size === 1) setSignal(this.Ve, true);
|
|
1892
|
+
} else if (this.je.size > 0) {
|
|
1893
|
+
this.je.delete(e);
|
|
1894
|
+
if (this.je.size === 0) setSignal(this.Ve, false);
|
|
1895
|
+
}
|
|
1896
|
+
t &= ~this.Me;
|
|
1897
|
+
return t ? super.notify(e, t, n) : true;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
var z;
|
|
1901
|
+
(function (e) {
|
|
1902
|
+
e["VISIBLE"] = "visible";
|
|
1903
|
+
e["HIDDEN"] = "hidden";
|
|
1904
|
+
})(z || (z = {}));
|
|
1905
|
+
function createBoundary(e, t) {
|
|
1906
|
+
const n = createOwner();
|
|
1907
|
+
const r = new ConditionalQueue(computed(() => t() === z.HIDDEN));
|
|
1908
|
+
const i = createBoundChildren(n, e, r, 0);
|
|
2158
1909
|
computed(() => {
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
if (!
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
);
|
|
2165
|
-
|
|
2166
|
-
queue.h.clear();
|
|
2167
|
-
queue.ha.clear();
|
|
1910
|
+
const e = read(r.Ve);
|
|
1911
|
+
i.Re = e ? c | f : 0;
|
|
1912
|
+
if (!e) {
|
|
1913
|
+
r.M.forEach(e => r.notify(e, f, f));
|
|
1914
|
+
r.qe.forEach(e => r.notify(e, c, c));
|
|
1915
|
+
r.M.clear();
|
|
1916
|
+
r.qe.clear();
|
|
2168
1917
|
}
|
|
2169
1918
|
});
|
|
2170
|
-
return () => read(
|
|
2171
|
-
}
|
|
2172
|
-
function createCollectionBoundary(
|
|
2173
|
-
const
|
|
2174
|
-
const
|
|
2175
|
-
const
|
|
2176
|
-
const
|
|
2177
|
-
if (!read(
|
|
2178
|
-
const
|
|
2179
|
-
if (!untrack(() => read(
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
return fallback(queue);
|
|
1919
|
+
return () => (read(r.Ve) ? undefined : read(i));
|
|
1920
|
+
}
|
|
1921
|
+
function createCollectionBoundary(e, t, n) {
|
|
1922
|
+
const r = createOwner();
|
|
1923
|
+
const i = new CollectionQueue(e);
|
|
1924
|
+
const s = createBoundChildren(r, t, i, e);
|
|
1925
|
+
const o = computed(() => {
|
|
1926
|
+
if (!read(i.Ve)) {
|
|
1927
|
+
const e = read(s);
|
|
1928
|
+
if (!untrack(() => read(i.Ve))) i.De = true;
|
|
1929
|
+
return e;
|
|
1930
|
+
}
|
|
1931
|
+
return n(i);
|
|
2184
1932
|
});
|
|
2185
|
-
return read.bind(null,
|
|
2186
|
-
}
|
|
2187
|
-
function createLoadBoundary(
|
|
2188
|
-
return createCollectionBoundary(
|
|
2189
|
-
}
|
|
2190
|
-
function
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
1933
|
+
return read.bind(null, o);
|
|
1934
|
+
}
|
|
1935
|
+
function createLoadBoundary(e, t) {
|
|
1936
|
+
return createCollectionBoundary(f, e, () => t());
|
|
1937
|
+
}
|
|
1938
|
+
function collectErrorSources(e, t) {
|
|
1939
|
+
let n = true;
|
|
1940
|
+
let r = e.W;
|
|
1941
|
+
while (r !== null) {
|
|
1942
|
+
const e = r.H;
|
|
1943
|
+
if (e.W && e.$ & c) {
|
|
1944
|
+
n = false;
|
|
1945
|
+
collectErrorSources(e, t);
|
|
1946
|
+
}
|
|
1947
|
+
r = r.P;
|
|
1948
|
+
}
|
|
1949
|
+
n && t.push(e);
|
|
1950
|
+
}
|
|
1951
|
+
function createErrorBoundary(e, t) {
|
|
1952
|
+
return createCollectionBoundary(c, e, e => {
|
|
1953
|
+
let n = e.je.values().next().value;
|
|
1954
|
+
return t(n.L, () => {
|
|
1955
|
+
const t = [];
|
|
1956
|
+
for (const n of e.je) collectErrorSources(n, t);
|
|
1957
|
+
for (const e of t) recompute(e);
|
|
1958
|
+
schedule();
|
|
2197
1959
|
});
|
|
2198
1960
|
});
|
|
2199
1961
|
}
|
|
2200
|
-
function flatten(
|
|
2201
|
-
if (typeof
|
|
2202
|
-
if (
|
|
2203
|
-
return children;
|
|
1962
|
+
function flatten(e, t) {
|
|
1963
|
+
if (typeof e === "function" && !e.length) {
|
|
1964
|
+
if (t?.doNotUnwrap) return e;
|
|
2204
1965
|
do {
|
|
2205
|
-
|
|
2206
|
-
} while (typeof
|
|
1966
|
+
e = e();
|
|
1967
|
+
} while (typeof e === "function" && !e.length);
|
|
2207
1968
|
}
|
|
2208
|
-
if (
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
if (flattenArray(children, results, options)) {
|
|
1969
|
+
if (t?.skipNonRendered && (e == null || e === true || e === false || e === "")) return;
|
|
1970
|
+
if (Array.isArray(e)) {
|
|
1971
|
+
let n = [];
|
|
1972
|
+
if (flattenArray(e, n, t)) {
|
|
2213
1973
|
return () => {
|
|
2214
|
-
let
|
|
2215
|
-
flattenArray(
|
|
2216
|
-
return
|
|
1974
|
+
let e = [];
|
|
1975
|
+
flattenArray(n, e, { ...t, doNotUnwrap: false });
|
|
1976
|
+
return e;
|
|
2217
1977
|
};
|
|
2218
1978
|
}
|
|
2219
|
-
return
|
|
1979
|
+
return n;
|
|
2220
1980
|
}
|
|
2221
|
-
return
|
|
1981
|
+
return e;
|
|
2222
1982
|
}
|
|
2223
|
-
function flattenArray(
|
|
2224
|
-
let
|
|
2225
|
-
let
|
|
2226
|
-
for (let
|
|
1983
|
+
function flattenArray(e, t = [], n) {
|
|
1984
|
+
let r = null;
|
|
1985
|
+
let i = false;
|
|
1986
|
+
for (let s = 0; s < e.length; s++) {
|
|
2227
1987
|
try {
|
|
2228
|
-
let
|
|
2229
|
-
if (typeof
|
|
2230
|
-
if (
|
|
2231
|
-
|
|
2232
|
-
|
|
1988
|
+
let r = e[s];
|
|
1989
|
+
if (typeof r === "function" && !r.length) {
|
|
1990
|
+
if (n?.doNotUnwrap) {
|
|
1991
|
+
t.push(r);
|
|
1992
|
+
i = true;
|
|
2233
1993
|
continue;
|
|
2234
1994
|
}
|
|
2235
1995
|
do {
|
|
2236
|
-
|
|
2237
|
-
} while (typeof
|
|
1996
|
+
r = r();
|
|
1997
|
+
} while (typeof r === "function" && !r.length);
|
|
2238
1998
|
}
|
|
2239
|
-
if (Array.isArray(
|
|
2240
|
-
|
|
2241
|
-
} else if (
|
|
2242
|
-
} else
|
|
2243
|
-
results.push(child);
|
|
1999
|
+
if (Array.isArray(r)) {
|
|
2000
|
+
i = flattenArray(r, t, n);
|
|
2001
|
+
} else if (n?.skipNonRendered && (r == null || r === true || r === false || r === "")) {
|
|
2002
|
+
} else t.push(r);
|
|
2244
2003
|
} catch (e) {
|
|
2245
|
-
if (!(e instanceof NotReadyError))
|
|
2246
|
-
|
|
2247
|
-
notReady = e;
|
|
2004
|
+
if (!(e instanceof NotReadyError)) throw e;
|
|
2005
|
+
r = e;
|
|
2248
2006
|
}
|
|
2249
2007
|
}
|
|
2250
|
-
if (
|
|
2251
|
-
|
|
2252
|
-
return needsUnwrap;
|
|
2008
|
+
if (r) throw r;
|
|
2009
|
+
return i;
|
|
2253
2010
|
}
|
|
2254
|
-
|
|
2255
|
-
exports.$
|
|
2256
|
-
exports.$
|
|
2257
|
-
exports.$TRACK = $TRACK;
|
|
2011
|
+
exports.$PROXY = P;
|
|
2012
|
+
exports.$TARGET = W;
|
|
2013
|
+
exports.$TRACK = j;
|
|
2258
2014
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2259
2015
|
exports.NoOwnerError = NoOwnerError;
|
|
2260
2016
|
exports.NotReadyError = NotReadyError;
|
|
2261
|
-
exports.SUPPORTS_PROXY =
|
|
2017
|
+
exports.SUPPORTS_PROXY = y;
|
|
2262
2018
|
exports.createAsync = createAsync;
|
|
2263
2019
|
exports.createBoundary = createBoundary;
|
|
2264
2020
|
exports.createContext = createContext;
|