@solidjs/signals 0.10.0 → 0.10.2
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 +24 -20
- package/dist/node.cjs +532 -527
- package/dist/prod.js +551 -546
- package/dist/types/core/error.d.ts +4 -4
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
class NotReadyError extends Error {
|
|
3
|
-
|
|
3
|
+
source;
|
|
4
4
|
constructor(e) {
|
|
5
5
|
super();
|
|
6
|
-
this.
|
|
6
|
+
this.source = e;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
class StatusError extends Error {
|
|
10
|
-
|
|
10
|
+
source;
|
|
11
11
|
constructor(e, t) {
|
|
12
12
|
super(t instanceof Error ? t.message : String(t), { cause: t });
|
|
13
|
-
this.
|
|
13
|
+
this.source = e;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
class NoOwnerError extends Error {
|
|
@@ -43,114 +43,114 @@ const g = typeof Proxy === "function";
|
|
|
43
43
|
const w = {};
|
|
44
44
|
const S = Symbol("refresh");
|
|
45
45
|
function actualInsertIntoHeap(e, t) {
|
|
46
|
-
const n = (e.
|
|
47
|
-
if (n >= e.
|
|
48
|
-
const r = e.
|
|
49
|
-
const i = t.
|
|
50
|
-
if (i === undefined) t.
|
|
46
|
+
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
47
|
+
if (n >= e.o) e.o = n + 1;
|
|
48
|
+
const r = e.o;
|
|
49
|
+
const i = t.l[r];
|
|
50
|
+
if (i === undefined) t.l[r] = e;
|
|
51
51
|
else {
|
|
52
|
-
const t = i.
|
|
53
|
-
t.
|
|
54
|
-
e.
|
|
55
|
-
i.
|
|
52
|
+
const t = i.p;
|
|
53
|
+
t.h = e;
|
|
54
|
+
e.p = t;
|
|
55
|
+
i.p = e;
|
|
56
56
|
}
|
|
57
|
-
if (r > t.
|
|
57
|
+
if (r > t.S) t.S = r;
|
|
58
58
|
}
|
|
59
59
|
function insertIntoHeap(e, o) {
|
|
60
|
-
let u = e.
|
|
60
|
+
let u = e.m;
|
|
61
61
|
if (u & (i | r)) return;
|
|
62
62
|
if (u & t) {
|
|
63
|
-
e.
|
|
64
|
-
} else e.
|
|
63
|
+
e.m = (u & -4) | n | i;
|
|
64
|
+
} else e.m = u | i;
|
|
65
65
|
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
66
66
|
}
|
|
67
67
|
function insertIntoHeapHeight(e, t) {
|
|
68
|
-
let n = e.
|
|
68
|
+
let n = e.m;
|
|
69
69
|
if (n & (i | r | s)) return;
|
|
70
|
-
e.
|
|
70
|
+
e.m = n | s;
|
|
71
71
|
actualInsertIntoHeap(e, t);
|
|
72
72
|
}
|
|
73
73
|
function deleteFromHeap(e, t) {
|
|
74
|
-
const n = e.
|
|
74
|
+
const n = e.m;
|
|
75
75
|
if (!(n & (i | s))) return;
|
|
76
|
-
e.
|
|
77
|
-
const r = e.
|
|
78
|
-
if (e.
|
|
76
|
+
e.m = n & -25;
|
|
77
|
+
const r = e.o;
|
|
78
|
+
if (e.p === e) t.l[r] = undefined;
|
|
79
79
|
else {
|
|
80
|
-
const n = e.
|
|
81
|
-
const i = t.
|
|
80
|
+
const n = e.h;
|
|
81
|
+
const i = t.l[r];
|
|
82
82
|
const s = n ?? i;
|
|
83
|
-
if (e === i) t.
|
|
84
|
-
else e.h
|
|
85
|
-
s.
|
|
83
|
+
if (e === i) t.l[r] = n;
|
|
84
|
+
else e.p.h = n;
|
|
85
|
+
s.p = e.p;
|
|
86
86
|
}
|
|
87
|
-
e.
|
|
88
|
-
e.
|
|
87
|
+
e.p = e;
|
|
88
|
+
e.h = undefined;
|
|
89
89
|
}
|
|
90
90
|
function markHeap(e) {
|
|
91
|
-
if (e.
|
|
92
|
-
e.
|
|
93
|
-
for (let t = 0; t <= e.
|
|
94
|
-
for (let n = e.
|
|
95
|
-
if (n.
|
|
91
|
+
if (e._) return;
|
|
92
|
+
e._ = true;
|
|
93
|
+
for (let t = 0; t <= e.S; t++) {
|
|
94
|
+
for (let n = e.l[t]; n !== undefined; n = n.h) {
|
|
95
|
+
if (n.m & i) markNode(n);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
function markNode(e, r = n) {
|
|
100
|
-
const i = e.
|
|
100
|
+
const i = e.m;
|
|
101
101
|
if ((i & (t | n)) >= r) return;
|
|
102
|
-
e.
|
|
103
|
-
for (let n = e.
|
|
104
|
-
markNode(n.
|
|
102
|
+
e.m = (i & -4) | r;
|
|
103
|
+
for (let n = e.O; n !== null; n = n.P) {
|
|
104
|
+
markNode(n.A, t);
|
|
105
105
|
}
|
|
106
|
-
if (e.
|
|
107
|
-
for (let n = e.
|
|
108
|
-
for (let e = n.
|
|
109
|
-
markNode(e.
|
|
106
|
+
if (e.k !== null) {
|
|
107
|
+
for (let n = e.k; n !== null; n = n.C) {
|
|
108
|
+
for (let e = n.O; e !== null; e = e.P) {
|
|
109
|
+
markNode(e.A, t);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
function runHeap(e, t) {
|
|
115
|
-
e.
|
|
116
|
-
for (e.
|
|
117
|
-
let n = e.
|
|
115
|
+
e._ = false;
|
|
116
|
+
for (e.W = 0; e.W <= e.S; e.W++) {
|
|
117
|
+
let n = e.l[e.W];
|
|
118
118
|
while (n !== undefined) {
|
|
119
|
-
if (n.
|
|
119
|
+
if (n.m & i) t(n);
|
|
120
120
|
else adjustHeight(n, e);
|
|
121
|
-
n = e.
|
|
121
|
+
n = e.l[e.W];
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
e.
|
|
124
|
+
e.S = 0;
|
|
125
125
|
}
|
|
126
126
|
function adjustHeight(e, t) {
|
|
127
127
|
deleteFromHeap(e, t);
|
|
128
|
-
let n = e.
|
|
129
|
-
for (let t = e.
|
|
130
|
-
const e = t.
|
|
131
|
-
const r = e.
|
|
132
|
-
if (r.
|
|
128
|
+
let n = e.o;
|
|
129
|
+
for (let t = e.j; t; t = t.N) {
|
|
130
|
+
const e = t.L;
|
|
131
|
+
const r = e.I || e;
|
|
132
|
+
if (r.H && r.o >= n) n = r.o + 1;
|
|
133
133
|
}
|
|
134
|
-
if (e.
|
|
135
|
-
e.
|
|
136
|
-
for (let n = e.
|
|
137
|
-
insertIntoHeapHeight(n.
|
|
134
|
+
if (e.o !== n) {
|
|
135
|
+
e.o = n;
|
|
136
|
+
for (let n = e.O; n !== null; n = n.P) {
|
|
137
|
+
insertIntoHeapHeight(n.A, t);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
const m = new Set();
|
|
142
|
-
const
|
|
143
|
-
const
|
|
142
|
+
const b = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
143
|
+
const _ = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
144
144
|
let O = 0;
|
|
145
145
|
let x = null;
|
|
146
146
|
let v = false;
|
|
147
147
|
let P = false;
|
|
148
148
|
function runLaneEffects(e) {
|
|
149
149
|
for (const t of C) {
|
|
150
|
-
if (t.
|
|
151
|
-
const n = t.
|
|
150
|
+
if (t.R || t.T.size > 0) continue;
|
|
151
|
+
const n = t.M[e - 1];
|
|
152
152
|
if (n.length) {
|
|
153
|
-
t.
|
|
153
|
+
t.M[e - 1] = [];
|
|
154
154
|
runQueue(n, e);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -161,129 +161,129 @@ function setProjectionWriteActive(e) {
|
|
|
161
161
|
function schedule() {
|
|
162
162
|
if (v) return;
|
|
163
163
|
v = true;
|
|
164
|
-
if (!A.
|
|
164
|
+
if (!A.q) queueMicrotask(flush);
|
|
165
165
|
}
|
|
166
166
|
class Queue {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
i = null;
|
|
168
|
+
F = [[], []];
|
|
169
|
+
V = [];
|
|
170
170
|
created = O;
|
|
171
171
|
addChild(e) {
|
|
172
|
-
this.
|
|
173
|
-
e.
|
|
172
|
+
this.V.push(e);
|
|
173
|
+
e.i = this;
|
|
174
174
|
}
|
|
175
175
|
removeChild(e) {
|
|
176
|
-
const t = this.
|
|
176
|
+
const t = this.V.indexOf(e);
|
|
177
177
|
if (t >= 0) {
|
|
178
|
-
this.
|
|
179
|
-
e.
|
|
178
|
+
this.V.splice(t, 1);
|
|
179
|
+
e.i = null;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
notify(e, t, n, r) {
|
|
183
|
-
if (this.
|
|
183
|
+
if (this.i) return this.i.notify(e, t, n, r);
|
|
184
184
|
return false;
|
|
185
185
|
}
|
|
186
186
|
run(e) {
|
|
187
|
-
if (this.
|
|
188
|
-
const t = this.
|
|
189
|
-
this.
|
|
187
|
+
if (this.F[e - 1].length) {
|
|
188
|
+
const t = this.F[e - 1];
|
|
189
|
+
this.F[e - 1] = [];
|
|
190
190
|
runQueue(t, e);
|
|
191
191
|
}
|
|
192
|
-
for (let t = 0; t < this.
|
|
192
|
+
for (let t = 0; t < this.V.length; t++) this.V[t].run?.(e);
|
|
193
193
|
}
|
|
194
194
|
enqueue(e, t) {
|
|
195
195
|
if (e) {
|
|
196
196
|
if (R) {
|
|
197
197
|
const n = findLane(R);
|
|
198
|
-
n.
|
|
198
|
+
n.M[e - 1].push(t);
|
|
199
199
|
} else {
|
|
200
|
-
this.
|
|
200
|
+
this.F[e - 1].push(t);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
schedule();
|
|
204
204
|
}
|
|
205
205
|
stashQueues(e) {
|
|
206
|
-
e.
|
|
207
|
-
e.
|
|
208
|
-
this.
|
|
209
|
-
for (let t = 0; t < this.
|
|
210
|
-
let n = this.
|
|
211
|
-
let r = e.
|
|
206
|
+
e.F[0].push(...this.F[0]);
|
|
207
|
+
e.F[1].push(...this.F[1]);
|
|
208
|
+
this.F = [[], []];
|
|
209
|
+
for (let t = 0; t < this.V.length; t++) {
|
|
210
|
+
let n = this.V[t];
|
|
211
|
+
let r = e.V[t];
|
|
212
212
|
if (!r) {
|
|
213
|
-
r = {
|
|
214
|
-
e.
|
|
213
|
+
r = { F: [[], []], V: [] };
|
|
214
|
+
e.V[t] = r;
|
|
215
215
|
}
|
|
216
216
|
n.stashQueues(r);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
restoreQueues(e) {
|
|
220
|
-
this.
|
|
221
|
-
this.
|
|
222
|
-
for (let t = 0; t < e.
|
|
223
|
-
const n = e.
|
|
224
|
-
let r = this.
|
|
220
|
+
this.F[0].push(...e.F[0]);
|
|
221
|
+
this.F[1].push(...e.F[1]);
|
|
222
|
+
for (let t = 0; t < e.V.length; t++) {
|
|
223
|
+
const n = e.V[t];
|
|
224
|
+
let r = this.V[t];
|
|
225
225
|
if (r) r.restoreQueues(n);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
class GlobalQueue extends Queue {
|
|
230
|
-
|
|
230
|
+
q = false;
|
|
231
|
+
D = [];
|
|
231
232
|
B = [];
|
|
232
|
-
G =
|
|
233
|
-
K
|
|
233
|
+
G = new Set();
|
|
234
|
+
static K;
|
|
234
235
|
static U;
|
|
235
|
-
static J;
|
|
236
|
-
static X = null;
|
|
236
|
+
static J = null;
|
|
237
237
|
flush() {
|
|
238
|
-
if (this.
|
|
239
|
-
this.
|
|
238
|
+
if (this.q) return;
|
|
239
|
+
this.q = true;
|
|
240
240
|
try {
|
|
241
|
-
runHeap(
|
|
241
|
+
runHeap(b, GlobalQueue.K);
|
|
242
242
|
if (x) {
|
|
243
243
|
const e = transitionComplete(x);
|
|
244
244
|
if (!e) {
|
|
245
245
|
let e = x;
|
|
246
|
-
runHeap(
|
|
246
|
+
runHeap(_, GlobalQueue.K);
|
|
247
|
+
this.D = [];
|
|
247
248
|
this.B = [];
|
|
248
|
-
this.G =
|
|
249
|
-
this.K = new Set();
|
|
249
|
+
this.G = new Set();
|
|
250
250
|
runLaneEffects(d);
|
|
251
251
|
runLaneEffects(p);
|
|
252
|
-
this.stashQueues(x.
|
|
252
|
+
this.stashQueues(x.X);
|
|
253
253
|
O++;
|
|
254
|
-
v =
|
|
255
|
-
reassignPendingTransition(x.
|
|
254
|
+
v = b.S >= b.W;
|
|
255
|
+
reassignPendingTransition(x.D);
|
|
256
256
|
x = null;
|
|
257
257
|
finalizePureQueue(null, true);
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
this.
|
|
261
|
-
this.restoreQueues(x.
|
|
260
|
+
this.D !== x.D && this.D.push(...x.D);
|
|
261
|
+
this.restoreQueues(x.X);
|
|
262
262
|
m.delete(x);
|
|
263
263
|
const t = x;
|
|
264
264
|
x = null;
|
|
265
|
-
reassignPendingTransition(this.
|
|
265
|
+
reassignPendingTransition(this.D);
|
|
266
266
|
finalizePureQueue(t);
|
|
267
267
|
} else {
|
|
268
|
-
if (m.size) runHeap(
|
|
268
|
+
if (m.size) runHeap(_, GlobalQueue.K);
|
|
269
269
|
finalizePureQueue();
|
|
270
270
|
}
|
|
271
271
|
O++;
|
|
272
|
-
v =
|
|
272
|
+
v = b.S >= b.W;
|
|
273
273
|
runLaneEffects(d);
|
|
274
274
|
this.run(d);
|
|
275
275
|
runLaneEffects(p);
|
|
276
276
|
this.run(p);
|
|
277
277
|
} finally {
|
|
278
|
-
this.
|
|
278
|
+
this.q = false;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
notify(e, t, n, r) {
|
|
282
282
|
if (t & l) {
|
|
283
283
|
if (n & l) {
|
|
284
|
-
const t = r !== undefined ? r : e.
|
|
285
|
-
if (x && t && !x
|
|
286
|
-
x
|
|
284
|
+
const t = r !== undefined ? r : e.Y;
|
|
285
|
+
if (x && t && !x.Z.includes(t.source)) {
|
|
286
|
+
x.Z.push(t.source);
|
|
287
287
|
schedule();
|
|
288
288
|
}
|
|
289
289
|
}
|
|
@@ -294,143 +294,143 @@ class GlobalQueue extends Queue {
|
|
|
294
294
|
initTransition(e) {
|
|
295
295
|
if (e) e = currentTransition(e);
|
|
296
296
|
if (e && e === x) return;
|
|
297
|
-
if (!e && x && x
|
|
297
|
+
if (!e && x && x.$ === O) return;
|
|
298
298
|
if (!x) {
|
|
299
299
|
x = e ?? {
|
|
300
|
-
|
|
300
|
+
$: O,
|
|
301
|
+
D: [],
|
|
302
|
+
Z: [],
|
|
301
303
|
B: [],
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
te:
|
|
306
|
-
Y: { V: [[], []], D: [] },
|
|
307
|
-
ne: false
|
|
304
|
+
G: new Set(),
|
|
305
|
+
ee: [],
|
|
306
|
+
X: { F: [[], []], V: [] },
|
|
307
|
+
te: false
|
|
308
308
|
};
|
|
309
309
|
} else if (e) {
|
|
310
310
|
const t = x;
|
|
311
|
-
t.
|
|
312
|
-
e.
|
|
311
|
+
t.te = e;
|
|
312
|
+
e.ee.push(...t.ee);
|
|
313
313
|
for (const n of C) {
|
|
314
|
-
if (n.
|
|
314
|
+
if (n.ne === t) n.ne = e;
|
|
315
315
|
}
|
|
316
|
-
e.
|
|
317
|
-
for (const n of t.
|
|
318
|
-
e.
|
|
316
|
+
e.B.push(...t.B);
|
|
317
|
+
for (const n of t.G) {
|
|
318
|
+
e.G.add(n);
|
|
319
319
|
}
|
|
320
320
|
m.delete(t);
|
|
321
321
|
x = e;
|
|
322
322
|
}
|
|
323
323
|
m.add(x);
|
|
324
|
-
x
|
|
324
|
+
x.$ = O;
|
|
325
|
+
for (let e = 0; e < this.D.length; e++) {
|
|
326
|
+
const t = this.D[e];
|
|
327
|
+
t.ne = x;
|
|
328
|
+
x.D.push(t);
|
|
329
|
+
}
|
|
330
|
+
this.D = x.D;
|
|
325
331
|
for (let e = 0; e < this.B.length; e++) {
|
|
326
332
|
const t = this.B[e];
|
|
327
|
-
t.
|
|
333
|
+
t.ne = x;
|
|
328
334
|
x.B.push(t);
|
|
329
335
|
}
|
|
330
336
|
this.B = x.B;
|
|
331
|
-
for (let e = 0; e < this.G.length; e++) {
|
|
332
|
-
const t = this.G[e];
|
|
333
|
-
t.re = x;
|
|
334
|
-
x.G.push(t);
|
|
335
|
-
}
|
|
336
|
-
this.G = x.G;
|
|
337
337
|
for (const e of C) {
|
|
338
|
-
if (!e.
|
|
338
|
+
if (!e.ne) e.ne = x;
|
|
339
339
|
}
|
|
340
|
-
for (const e of this.
|
|
341
|
-
this.
|
|
340
|
+
for (const e of this.G) x.G.add(e);
|
|
341
|
+
this.G = x.G;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
function insertSubs(e, t = false) {
|
|
345
|
-
const n = e.
|
|
346
|
-
for (let r = e.
|
|
345
|
+
const n = e.re || R;
|
|
346
|
+
for (let r = e.O; r !== null; r = r.P) {
|
|
347
347
|
if (t && n) {
|
|
348
|
-
r.
|
|
349
|
-
assignOrMergeLane(r.
|
|
348
|
+
r.A.m |= f;
|
|
349
|
+
assignOrMergeLane(r.A, n);
|
|
350
350
|
} else if (t) {
|
|
351
|
-
r.
|
|
352
|
-
r.
|
|
351
|
+
r.A.m |= f;
|
|
352
|
+
r.A.re = undefined;
|
|
353
353
|
}
|
|
354
|
-
const e = r.
|
|
355
|
-
if (e.
|
|
356
|
-
if (!e.
|
|
357
|
-
e.
|
|
358
|
-
e.
|
|
354
|
+
const e = r.A;
|
|
355
|
+
if (e.ie === h) {
|
|
356
|
+
if (!e.se) {
|
|
357
|
+
e.se = true;
|
|
358
|
+
e.oe.enqueue(p, e.ue);
|
|
359
359
|
}
|
|
360
360
|
continue;
|
|
361
361
|
}
|
|
362
|
-
const i = r.
|
|
363
|
-
if (i.
|
|
364
|
-
insertIntoHeap(r.
|
|
362
|
+
const i = r.A.m & o ? _ : b;
|
|
363
|
+
if (i.W > r.A.o) i.W = r.A.o;
|
|
364
|
+
insertIntoHeap(r.A, i);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
function finalizePureQueue(e = null, t = false) {
|
|
368
368
|
let n = !t;
|
|
369
369
|
if (!t) checkBoundaryChildren(A);
|
|
370
|
-
if (
|
|
370
|
+
if (b.S >= b.W) runHeap(b, GlobalQueue.K);
|
|
371
371
|
if (n) {
|
|
372
|
-
const t = A.
|
|
372
|
+
const t = A.D;
|
|
373
373
|
for (let e = 0; e < t.length; e++) {
|
|
374
374
|
const n = t[e];
|
|
375
|
-
if (n.
|
|
376
|
-
n.
|
|
377
|
-
n.
|
|
378
|
-
if (n.
|
|
375
|
+
if (n.fe !== y) {
|
|
376
|
+
n.le = n.fe;
|
|
377
|
+
n.fe = y;
|
|
378
|
+
if (n.ie && n.ie !== h) n.se = true;
|
|
379
379
|
}
|
|
380
|
-
n.
|
|
381
|
-
if (n.
|
|
380
|
+
n.ce &= ~a;
|
|
381
|
+
if (n.H) GlobalQueue.U(n, false, true);
|
|
382
382
|
}
|
|
383
383
|
t.length = 0;
|
|
384
|
-
const n = e ? e.
|
|
384
|
+
const n = e ? e.B : A.B;
|
|
385
385
|
for (let e = 0; e < n.length; e++) {
|
|
386
386
|
const t = n[e];
|
|
387
|
-
const r = t.
|
|
388
|
-
t.
|
|
389
|
-
if (r !== y && t.
|
|
390
|
-
t.
|
|
387
|
+
const r = t.fe;
|
|
388
|
+
t.re = undefined;
|
|
389
|
+
if (r !== y && t.le !== r) {
|
|
390
|
+
t.le = r;
|
|
391
391
|
insertSubs(t, true);
|
|
392
392
|
}
|
|
393
|
-
t.
|
|
394
|
-
t.
|
|
393
|
+
t.fe = y;
|
|
394
|
+
t.ne = null;
|
|
395
395
|
}
|
|
396
396
|
n.length = 0;
|
|
397
|
-
const r = e ? e.
|
|
398
|
-
if (GlobalQueue.
|
|
397
|
+
const r = e ? e.G : A.G;
|
|
398
|
+
if (GlobalQueue.J && r.size) {
|
|
399
399
|
for (const e of r) {
|
|
400
|
-
GlobalQueue.
|
|
400
|
+
GlobalQueue.J(e);
|
|
401
401
|
}
|
|
402
402
|
r.clear();
|
|
403
403
|
schedule();
|
|
404
404
|
}
|
|
405
405
|
for (const t of C) {
|
|
406
|
-
const n = e ? t.
|
|
406
|
+
const n = e ? t.ne === e : !t.ne;
|
|
407
407
|
if (!n) continue;
|
|
408
|
-
if (!t.
|
|
409
|
-
if (t.
|
|
410
|
-
if (t.
|
|
411
|
-
}
|
|
412
|
-
if (t.
|
|
413
|
-
t.
|
|
414
|
-
t.
|
|
415
|
-
t.
|
|
408
|
+
if (!t.R) {
|
|
409
|
+
if (t.M[0].length) runQueue(t.M[0], d);
|
|
410
|
+
if (t.M[1].length) runQueue(t.M[1], p);
|
|
411
|
+
}
|
|
412
|
+
if (t.ae.re === t) t.ae.re = undefined;
|
|
413
|
+
t.T.clear();
|
|
414
|
+
t.M[0].length = 0;
|
|
415
|
+
t.M[1].length = 0;
|
|
416
416
|
C.delete(t);
|
|
417
|
-
k.delete(t.
|
|
417
|
+
k.delete(t.ae);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
function checkBoundaryChildren(e) {
|
|
422
|
-
for (const t of e.
|
|
422
|
+
for (const t of e.V) {
|
|
423
423
|
t.checkSources?.();
|
|
424
424
|
checkBoundaryChildren(t);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
function trackOptimisticStore(e) {
|
|
428
|
-
A.
|
|
428
|
+
A.G.add(e);
|
|
429
429
|
schedule();
|
|
430
430
|
}
|
|
431
431
|
function reassignPendingTransition(e) {
|
|
432
432
|
for (let t = 0; t < e.length; t++) {
|
|
433
|
-
e[t].
|
|
433
|
+
e[t].ne = x;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
const A = new GlobalQueue();
|
|
@@ -443,21 +443,21 @@ function runQueue(e, t) {
|
|
|
443
443
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
444
444
|
}
|
|
445
445
|
function transitionComplete(e) {
|
|
446
|
-
if (e.
|
|
447
|
-
if (e.
|
|
446
|
+
if (e.te) return true;
|
|
447
|
+
if (e.ee.length) return false;
|
|
448
448
|
let t = true;
|
|
449
|
-
for (let n = 0; n < e
|
|
450
|
-
const r = e
|
|
451
|
-
if (r.
|
|
449
|
+
for (let n = 0; n < e.Z.length; n++) {
|
|
450
|
+
const r = e.Z[n];
|
|
451
|
+
if (r.ce & l && r.Y?.source === r) {
|
|
452
452
|
t = false;
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
t && (e.
|
|
456
|
+
t && (e.te = true);
|
|
457
457
|
return t;
|
|
458
458
|
}
|
|
459
459
|
function currentTransition(e) {
|
|
460
|
-
while (e.
|
|
460
|
+
while (e.te && typeof e.te === "object") e = e.te;
|
|
461
461
|
return e;
|
|
462
462
|
}
|
|
463
463
|
function setActiveTransition(e) {
|
|
@@ -480,58 +480,58 @@ function getOrCreateLane(e) {
|
|
|
480
480
|
return findLane(t);
|
|
481
481
|
}
|
|
482
482
|
const n = e.de;
|
|
483
|
-
const r = n?.
|
|
484
|
-
t = {
|
|
483
|
+
const r = n?.re ? findLane(n.re) : null;
|
|
484
|
+
t = { ae: e, T: new Set(), M: [[], []], R: null, ne: x, pe: r };
|
|
485
485
|
k.set(e, t);
|
|
486
486
|
C.add(t);
|
|
487
487
|
e.he = e.ye || 0;
|
|
488
488
|
return t;
|
|
489
489
|
}
|
|
490
490
|
function findLane(e) {
|
|
491
|
-
while (e.
|
|
491
|
+
while (e.R) e = e.R;
|
|
492
492
|
return e;
|
|
493
493
|
}
|
|
494
494
|
function mergeLanes(e, t) {
|
|
495
495
|
e = findLane(e);
|
|
496
496
|
t = findLane(t);
|
|
497
497
|
if (e === t) return e;
|
|
498
|
-
t.
|
|
499
|
-
for (const n of t.
|
|
500
|
-
e.
|
|
501
|
-
e.
|
|
498
|
+
t.R = e;
|
|
499
|
+
for (const n of t.T) e.T.add(n);
|
|
500
|
+
e.M[0].push(...t.M[0]);
|
|
501
|
+
e.M[1].push(...t.M[1]);
|
|
502
502
|
return e;
|
|
503
503
|
}
|
|
504
504
|
function resolveLane(e) {
|
|
505
|
-
const t = e.
|
|
505
|
+
const t = e.re;
|
|
506
506
|
if (!t) return undefined;
|
|
507
507
|
const n = findLane(t);
|
|
508
508
|
if (C.has(n)) return n;
|
|
509
|
-
e.
|
|
509
|
+
e.re = undefined;
|
|
510
510
|
return undefined;
|
|
511
511
|
}
|
|
512
512
|
function hasActiveOverride(e) {
|
|
513
|
-
return !!(e.ge && e.
|
|
513
|
+
return !!(e.ge && e.fe !== y);
|
|
514
514
|
}
|
|
515
515
|
function assignOrMergeLane(e, t) {
|
|
516
516
|
const n = findLane(t);
|
|
517
|
-
const r = e.
|
|
517
|
+
const r = e.re;
|
|
518
518
|
if (r) {
|
|
519
|
-
if (r.
|
|
520
|
-
e.
|
|
519
|
+
if (r.R) {
|
|
520
|
+
e.re = t;
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
523
|
const i = findLane(r);
|
|
524
524
|
if (C.has(i)) {
|
|
525
525
|
if (i !== n && !hasActiveOverride(e)) {
|
|
526
526
|
if (n.pe && findLane(n.pe) === i) {
|
|
527
|
-
e.
|
|
527
|
+
e.re = t;
|
|
528
528
|
} else if (i.pe && findLane(i.pe) === n);
|
|
529
529
|
else mergeLanes(n, i);
|
|
530
530
|
}
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
e.
|
|
534
|
+
e.re = t;
|
|
535
535
|
}
|
|
536
536
|
function handleAsync(e, t, r) {
|
|
537
537
|
const i = typeof t === "object" && t !== null;
|
|
@@ -545,32 +545,32 @@ function handleAsync(e, t, r) {
|
|
|
545
545
|
let u;
|
|
546
546
|
const handleError = n => {
|
|
547
547
|
if (e.we !== t) return;
|
|
548
|
-
A.initTransition(e.
|
|
548
|
+
A.initTransition(e.ne);
|
|
549
549
|
notifyStatus(e, n instanceof NotReadyError ? l : c, n);
|
|
550
|
-
e
|
|
550
|
+
e.$ = O;
|
|
551
551
|
};
|
|
552
552
|
const asyncWrite = (i, s) => {
|
|
553
553
|
if (e.we !== t) return;
|
|
554
|
-
if (e.
|
|
555
|
-
A.initTransition(e.
|
|
554
|
+
if (e.m & (n | f)) return;
|
|
555
|
+
A.initTransition(e.ne);
|
|
556
556
|
clearStatus(e);
|
|
557
557
|
const o = resolveLane(e);
|
|
558
|
-
if (o) o.
|
|
558
|
+
if (o) o.T.delete(e);
|
|
559
559
|
if (r) r(i);
|
|
560
560
|
else if (e.ge) {
|
|
561
|
-
const t = e.
|
|
562
|
-
if (e.
|
|
561
|
+
const t = e.fe !== y;
|
|
562
|
+
if (e.H) e.fe = i;
|
|
563
563
|
if (!t) {
|
|
564
|
-
e.
|
|
564
|
+
e.le = i;
|
|
565
565
|
insertSubs(e);
|
|
566
566
|
}
|
|
567
|
-
e
|
|
567
|
+
e.$ = O;
|
|
568
568
|
} else if (o) {
|
|
569
|
-
const t = e.
|
|
569
|
+
const t = e.le;
|
|
570
570
|
const n = e.Se;
|
|
571
571
|
if (!n || !n(i, t)) {
|
|
572
|
-
e.
|
|
573
|
-
e
|
|
572
|
+
e.le = i;
|
|
573
|
+
e.$ = O;
|
|
574
574
|
if (e.me) {
|
|
575
575
|
setSignal(e.me, i);
|
|
576
576
|
}
|
|
@@ -599,7 +599,7 @@ function handleAsync(e, t, r) {
|
|
|
599
599
|
);
|
|
600
600
|
r = false;
|
|
601
601
|
if (!n) {
|
|
602
|
-
A.initTransition(e.
|
|
602
|
+
A.initTransition(e.ne);
|
|
603
603
|
throw new NotReadyError(Q);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
@@ -631,61 +631,61 @@ function handleAsync(e, t, r) {
|
|
|
631
631
|
};
|
|
632
632
|
const i = iterate();
|
|
633
633
|
if (!r && !i) {
|
|
634
|
-
A.initTransition(e.
|
|
634
|
+
A.initTransition(e.ne);
|
|
635
635
|
throw new NotReadyError(Q);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
return u;
|
|
639
639
|
}
|
|
640
640
|
function clearStatus(e) {
|
|
641
|
-
e.
|
|
642
|
-
e.
|
|
641
|
+
e.ce = e.ce & a;
|
|
642
|
+
e.Y = null;
|
|
643
643
|
updatePendingSignal(e);
|
|
644
|
-
e.
|
|
644
|
+
e.be?.();
|
|
645
645
|
}
|
|
646
646
|
function notifyStatus(e, t, n, r, i) {
|
|
647
647
|
if (t === c && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
648
648
|
n = new StatusError(e, n);
|
|
649
|
-
const s = n instanceof NotReadyError && n.
|
|
649
|
+
const s = n instanceof NotReadyError && n.source === e;
|
|
650
650
|
const o = t === l && e.ge && !s;
|
|
651
651
|
const u = o && hasActiveOverride(e);
|
|
652
652
|
if (!r) {
|
|
653
|
-
e.
|
|
654
|
-
e.
|
|
653
|
+
e.ce = t | (t !== c ? e.ce & a : 0);
|
|
654
|
+
e.Y = n;
|
|
655
655
|
updatePendingSignal(e);
|
|
656
656
|
}
|
|
657
657
|
if (i && !r) {
|
|
658
658
|
assignOrMergeLane(e, i);
|
|
659
659
|
}
|
|
660
660
|
if (u && x && n instanceof NotReadyError) {
|
|
661
|
-
const e = n.
|
|
662
|
-
if (!x
|
|
663
|
-
x
|
|
661
|
+
const e = n.source;
|
|
662
|
+
if (!x.Z.includes(e)) {
|
|
663
|
+
x.Z.push(e);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
const f = r || u;
|
|
667
667
|
const d = r || o ? undefined : i;
|
|
668
|
-
if (e.
|
|
668
|
+
if (e.be) {
|
|
669
669
|
if (f) {
|
|
670
|
-
e.
|
|
670
|
+
e.be(t, n);
|
|
671
671
|
} else {
|
|
672
|
-
e.
|
|
672
|
+
e.be();
|
|
673
673
|
}
|
|
674
674
|
return;
|
|
675
675
|
}
|
|
676
|
-
for (let r = e.
|
|
677
|
-
r.
|
|
678
|
-
if (r.
|
|
679
|
-
!r.
|
|
680
|
-
notifyStatus(r.
|
|
676
|
+
for (let r = e.O; r !== null; r = r.P) {
|
|
677
|
+
r.A.$ = O;
|
|
678
|
+
if (r.A.Y !== n) {
|
|
679
|
+
!r.A.ne && A.D.push(r.A);
|
|
680
|
+
notifyStatus(r.A, t, n, f, d);
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
for (let r = e.
|
|
684
|
-
for (let e = r.
|
|
685
|
-
e.
|
|
686
|
-
if (e.
|
|
687
|
-
!e.
|
|
688
|
-
notifyStatus(e.
|
|
683
|
+
for (let r = e.k; r !== null; r = r.C) {
|
|
684
|
+
for (let e = r.O; e !== null; e = e.P) {
|
|
685
|
+
e.A.$ = O;
|
|
686
|
+
if (e.A.Y !== n) {
|
|
687
|
+
!e.A.ne && A.D.push(e.A);
|
|
688
|
+
notifyStatus(e.A, t, n, f, d);
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
}
|
|
@@ -695,24 +695,24 @@ function effect(e, t, n, r, i) {
|
|
|
695
695
|
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
696
696
|
...i,
|
|
697
697
|
equals: () => {
|
|
698
|
-
o.
|
|
699
|
-
if (s) o.
|
|
698
|
+
o.se = !o.Y;
|
|
699
|
+
if (s) o.oe.enqueue(o.ie, runEffect.bind(o));
|
|
700
700
|
return false;
|
|
701
701
|
},
|
|
702
702
|
lazy: true
|
|
703
703
|
});
|
|
704
|
-
o.
|
|
704
|
+
o._e = r;
|
|
705
705
|
o.Oe = t;
|
|
706
706
|
o.xe = n;
|
|
707
707
|
o.ve = undefined;
|
|
708
|
-
o.
|
|
709
|
-
o.
|
|
710
|
-
const n = e !== undefined ? e : o.
|
|
711
|
-
const r = t !== undefined ? t : o.
|
|
708
|
+
o.ie = i?.render ? d : p;
|
|
709
|
+
o.be = (e, t) => {
|
|
710
|
+
const n = e !== undefined ? e : o.ce;
|
|
711
|
+
const r = t !== undefined ? t : o.Y;
|
|
712
712
|
if (n & c) {
|
|
713
713
|
let e = r;
|
|
714
|
-
o.
|
|
715
|
-
if (o.
|
|
714
|
+
o.oe.notify(o, l, 0);
|
|
715
|
+
if (o.ie === p) {
|
|
716
716
|
try {
|
|
717
717
|
return o.xe
|
|
718
718
|
? o.xe(e, () => {
|
|
@@ -724,31 +724,31 @@ function effect(e, t, n, r, i) {
|
|
|
724
724
|
e = t;
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
|
-
if (!o.
|
|
728
|
-
} else if (o.
|
|
727
|
+
if (!o.oe.notify(o, c, c)) throw e;
|
|
728
|
+
} else if (o.ie === d) o.oe.notify(o, l | c, n, r);
|
|
729
729
|
};
|
|
730
730
|
recompute(o, true);
|
|
731
|
-
!i?.defer && (o.
|
|
731
|
+
!i?.defer && (o.ie === p ? o.oe.enqueue(o.ie, runEffect.bind(o)) : runEffect.call(o));
|
|
732
732
|
s = true;
|
|
733
733
|
onCleanup(() => o.ve?.());
|
|
734
734
|
}
|
|
735
735
|
function runEffect() {
|
|
736
|
-
if (!this.
|
|
736
|
+
if (!this.se || this.m & u) return;
|
|
737
737
|
this.ve?.();
|
|
738
738
|
this.ve = undefined;
|
|
739
739
|
try {
|
|
740
|
-
this.ve = this.Oe(this.
|
|
740
|
+
this.ve = this.Oe(this.le, this._e);
|
|
741
741
|
} catch (e) {
|
|
742
|
-
if (!this.
|
|
742
|
+
if (!this.oe.notify(this, c, c)) throw e;
|
|
743
743
|
} finally {
|
|
744
|
-
this.
|
|
745
|
-
this.
|
|
744
|
+
this._e = this.le;
|
|
745
|
+
this.se = false;
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
function trackedEffect(e, t) {
|
|
749
749
|
const run = () => {
|
|
750
|
-
if (!n.
|
|
751
|
-
n.
|
|
750
|
+
if (!n.se || n.m & u) return;
|
|
751
|
+
n.se = false;
|
|
752
752
|
recompute(n);
|
|
753
753
|
};
|
|
754
754
|
const n = computed(
|
|
@@ -764,48 +764,48 @@ function trackedEffect(e, t) {
|
|
|
764
764
|
{ ...t, lazy: true, pureWrite: true }
|
|
765
765
|
);
|
|
766
766
|
n.ve = undefined;
|
|
767
|
-
n.
|
|
768
|
-
n.
|
|
769
|
-
n.
|
|
770
|
-
n.
|
|
767
|
+
n.se = true;
|
|
768
|
+
n.ie = h;
|
|
769
|
+
n.ue = run;
|
|
770
|
+
n.oe.enqueue(p, run);
|
|
771
771
|
onCleanup(() => n.ve?.());
|
|
772
772
|
}
|
|
773
773
|
const W = {};
|
|
774
774
|
function markDisposal(e) {
|
|
775
775
|
let t = e.Pe;
|
|
776
776
|
while (t) {
|
|
777
|
-
t.
|
|
778
|
-
if (t.
|
|
779
|
-
deleteFromHeap(t,
|
|
780
|
-
insertIntoHeap(t,
|
|
777
|
+
t.m |= o;
|
|
778
|
+
if (t.m & i) {
|
|
779
|
+
deleteFromHeap(t, b);
|
|
780
|
+
insertIntoHeap(t, _);
|
|
781
781
|
}
|
|
782
782
|
markDisposal(t);
|
|
783
783
|
t = t.Ae;
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
786
|
function dispose(e) {
|
|
787
|
-
let t = e.
|
|
787
|
+
let t = e.j || null;
|
|
788
788
|
do {
|
|
789
789
|
t = unlinkSubs(t);
|
|
790
790
|
} while (t !== null);
|
|
791
|
-
e.
|
|
791
|
+
e.j = null;
|
|
792
792
|
e.ke = null;
|
|
793
793
|
disposeChildren(e, true);
|
|
794
794
|
}
|
|
795
795
|
function disposeChildren(e, t = false, n) {
|
|
796
|
-
if (e.
|
|
797
|
-
if (t) e.
|
|
796
|
+
if (e.m & u) return;
|
|
797
|
+
if (t) e.m = u;
|
|
798
798
|
let r = n ? e.Ce : e.Pe;
|
|
799
799
|
while (r) {
|
|
800
800
|
const e = r.Ae;
|
|
801
|
-
if (r.
|
|
801
|
+
if (r.j) {
|
|
802
802
|
const e = r;
|
|
803
|
-
deleteFromHeap(e, e.
|
|
804
|
-
let t = e.
|
|
803
|
+
deleteFromHeap(e, e.m & o ? _ : b);
|
|
804
|
+
let t = e.j;
|
|
805
805
|
do {
|
|
806
806
|
t = unlinkSubs(t);
|
|
807
807
|
} while (t !== null);
|
|
808
|
-
e.
|
|
808
|
+
e.j = null;
|
|
809
809
|
e.ke = null;
|
|
810
810
|
}
|
|
811
811
|
disposeChildren(r, true);
|
|
@@ -816,11 +816,12 @@ function disposeChildren(e, t = false, n) {
|
|
|
816
816
|
} else {
|
|
817
817
|
e.Pe = null;
|
|
818
818
|
e.Ae = null;
|
|
819
|
+
e.We = 0;
|
|
819
820
|
}
|
|
820
821
|
runDisposal(e, n);
|
|
821
822
|
}
|
|
822
823
|
function runDisposal(e, t) {
|
|
823
|
-
let n = t ? e.
|
|
824
|
+
let n = t ? e.Ee : e.je;
|
|
824
825
|
if (!n) return;
|
|
825
826
|
if (Array.isArray(n)) {
|
|
826
827
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -830,10 +831,10 @@ function runDisposal(e, t) {
|
|
|
830
831
|
} else {
|
|
831
832
|
n.call(n);
|
|
832
833
|
}
|
|
833
|
-
t ? (e.
|
|
834
|
+
t ? (e.Ee = null) : (e.je = null);
|
|
834
835
|
}
|
|
835
836
|
function getNextChildId(e) {
|
|
836
|
-
if (e.id != null) return formatId(e.id, e.
|
|
837
|
+
if (e.id != null) return formatId(e.id, e.We++);
|
|
837
838
|
throw new Error("Cannot get child id from owner without an id");
|
|
838
839
|
}
|
|
839
840
|
function formatId(e, t) {
|
|
@@ -850,26 +851,26 @@ function getOwner() {
|
|
|
850
851
|
}
|
|
851
852
|
function onCleanup(e) {
|
|
852
853
|
if (!Q) return e;
|
|
853
|
-
if (!Q.
|
|
854
|
-
else if (Array.isArray(Q.
|
|
855
|
-
else Q.
|
|
854
|
+
if (!Q.je) Q.je = e;
|
|
855
|
+
else if (Array.isArray(Q.je)) Q.je.push(e);
|
|
856
|
+
else Q.je = [Q.je, e];
|
|
856
857
|
return e;
|
|
857
858
|
}
|
|
858
859
|
function createOwner(e) {
|
|
859
860
|
const t = Q;
|
|
860
861
|
const n = {
|
|
861
862
|
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
862
|
-
|
|
863
|
-
|
|
863
|
+
t: true,
|
|
864
|
+
u: t?.t ? t.u : t,
|
|
864
865
|
Pe: null,
|
|
865
866
|
Ae: null,
|
|
866
|
-
|
|
867
|
-
|
|
867
|
+
je: null,
|
|
868
|
+
oe: t?.oe ?? A,
|
|
868
869
|
Ne: t?.Ne || w,
|
|
869
|
-
|
|
870
|
-
|
|
870
|
+
We: 0,
|
|
871
|
+
Ee: null,
|
|
871
872
|
Ce: null,
|
|
872
|
-
|
|
873
|
+
i: t,
|
|
873
874
|
dispose(e = true) {
|
|
874
875
|
disposeChildren(n, e);
|
|
875
876
|
}
|
|
@@ -890,65 +891,65 @@ function createRoot(e, t) {
|
|
|
890
891
|
return runWithOwner(n, () => e(n.dispose));
|
|
891
892
|
}
|
|
892
893
|
function unlinkSubs(e) {
|
|
893
|
-
const t = e.
|
|
894
|
-
const n = e.
|
|
895
|
-
const r = e.
|
|
894
|
+
const t = e.L;
|
|
895
|
+
const n = e.N;
|
|
896
|
+
const r = e.P;
|
|
896
897
|
const i = e.Le;
|
|
897
898
|
if (r !== null) r.Le = i;
|
|
898
899
|
else t.Ie = i;
|
|
899
|
-
if (i !== null) i.
|
|
900
|
+
if (i !== null) i.P = r;
|
|
900
901
|
else {
|
|
901
|
-
t.
|
|
902
|
+
t.O = r;
|
|
902
903
|
if (r === null) {
|
|
903
904
|
t.He?.();
|
|
904
|
-
t.
|
|
905
|
+
t.H && !t.Qe && unobserved(t);
|
|
905
906
|
}
|
|
906
907
|
}
|
|
907
908
|
return n;
|
|
908
909
|
}
|
|
909
910
|
function unobserved(e) {
|
|
910
|
-
deleteFromHeap(e, e.
|
|
911
|
-
let t = e.
|
|
911
|
+
deleteFromHeap(e, e.m & o ? _ : b);
|
|
912
|
+
let t = e.j;
|
|
912
913
|
while (t !== null) {
|
|
913
914
|
t = unlinkSubs(t);
|
|
914
915
|
}
|
|
915
|
-
e.
|
|
916
|
+
e.j = null;
|
|
916
917
|
disposeChildren(e, true);
|
|
917
918
|
}
|
|
918
919
|
function link(e, t) {
|
|
919
920
|
const n = t.ke;
|
|
920
|
-
if (n !== null && n.
|
|
921
|
+
if (n !== null && n.L === e) return;
|
|
921
922
|
let i = null;
|
|
922
|
-
const s = t.
|
|
923
|
+
const s = t.m & r;
|
|
923
924
|
if (s) {
|
|
924
|
-
i = n !== null ? n.
|
|
925
|
-
if (i !== null && i.
|
|
925
|
+
i = n !== null ? n.N : t.j;
|
|
926
|
+
if (i !== null && i.L === e) {
|
|
926
927
|
t.ke = i;
|
|
927
928
|
return;
|
|
928
929
|
}
|
|
929
930
|
}
|
|
930
931
|
const o = e.Ie;
|
|
931
|
-
if (o !== null && o.
|
|
932
|
-
const u = (t.ke = e.Ie = {
|
|
933
|
-
if (n !== null) n.
|
|
934
|
-
else t.
|
|
935
|
-
if (o !== null) o.
|
|
936
|
-
else e.
|
|
932
|
+
if (o !== null && o.A === t && (!s || isValidLink(o, t))) return;
|
|
933
|
+
const u = (t.ke = e.Ie = { L: e, A: t, N: i, Le: o, P: null });
|
|
934
|
+
if (n !== null) n.N = u;
|
|
935
|
+
else t.j = u;
|
|
936
|
+
if (o !== null) o.P = u;
|
|
937
|
+
else e.O = u;
|
|
937
938
|
}
|
|
938
939
|
function isValidLink(e, t) {
|
|
939
940
|
const n = t.ke;
|
|
940
941
|
if (n !== null) {
|
|
941
|
-
let r = t.
|
|
942
|
+
let r = t.j;
|
|
942
943
|
do {
|
|
943
944
|
if (r === e) return true;
|
|
944
945
|
if (r === n) break;
|
|
945
|
-
r = r.
|
|
946
|
+
r = r.N;
|
|
946
947
|
} while (r !== null);
|
|
947
948
|
}
|
|
948
949
|
return false;
|
|
949
950
|
}
|
|
950
|
-
GlobalQueue.
|
|
951
|
-
GlobalQueue.
|
|
951
|
+
GlobalQueue.K = recompute;
|
|
952
|
+
GlobalQueue.U = disposeChildren;
|
|
952
953
|
let E = false;
|
|
953
954
|
let j = false;
|
|
954
955
|
let N = false;
|
|
@@ -958,29 +959,30 @@ let H = false;
|
|
|
958
959
|
let Q = null;
|
|
959
960
|
let R = null;
|
|
960
961
|
function recompute(t, n = false) {
|
|
961
|
-
const i = t.
|
|
962
|
+
const i = t.ie;
|
|
962
963
|
if (!n) {
|
|
963
|
-
if (t.
|
|
964
|
-
deleteFromHeap(t, t.
|
|
965
|
-
if (t.
|
|
964
|
+
if (t.ne && (!i || x) && x !== t.ne) A.initTransition(t.ne);
|
|
965
|
+
deleteFromHeap(t, t.m & o ? _ : b);
|
|
966
|
+
if (t.ne || i === h) disposeChildren(t);
|
|
966
967
|
else {
|
|
967
968
|
markDisposal(t);
|
|
968
|
-
t.
|
|
969
|
+
t.Ee = t.je;
|
|
969
970
|
t.Ce = t.Pe;
|
|
970
|
-
t.
|
|
971
|
+
t.je = null;
|
|
971
972
|
t.Pe = null;
|
|
973
|
+
t.We = 0;
|
|
972
974
|
}
|
|
973
975
|
}
|
|
974
|
-
const s = !!(t.
|
|
976
|
+
const s = !!(t.m & f);
|
|
975
977
|
const u = hasActiveOverride(t);
|
|
976
|
-
const a = !!(t.
|
|
978
|
+
const a = !!(t.ce & l);
|
|
977
979
|
const d = Q;
|
|
978
980
|
Q = t;
|
|
979
981
|
t.ke = null;
|
|
980
|
-
t.
|
|
981
|
-
t
|
|
982
|
-
let p = t.
|
|
983
|
-
let g = t.
|
|
982
|
+
t.m = r;
|
|
983
|
+
t.$ = O;
|
|
984
|
+
let p = t.fe === y ? t.le : t.fe;
|
|
985
|
+
let g = t.o;
|
|
984
986
|
let w = E;
|
|
985
987
|
let S = R;
|
|
986
988
|
E = true;
|
|
@@ -989,20 +991,20 @@ function recompute(t, n = false) {
|
|
|
989
991
|
if (e) R = e;
|
|
990
992
|
}
|
|
991
993
|
try {
|
|
992
|
-
p = handleAsync(t, t.
|
|
994
|
+
p = handleAsync(t, t.H(p));
|
|
993
995
|
clearStatus(t);
|
|
994
996
|
const e = resolveLane(t);
|
|
995
997
|
if (e) {
|
|
996
|
-
e.
|
|
997
|
-
updatePendingSignal(e.
|
|
998
|
+
e.T.delete(t);
|
|
999
|
+
updatePendingSignal(e.ae);
|
|
998
1000
|
}
|
|
999
1001
|
} catch (e) {
|
|
1000
1002
|
if (e instanceof NotReadyError && R) {
|
|
1001
1003
|
const e = findLane(R);
|
|
1002
|
-
if (e.
|
|
1003
|
-
e.
|
|
1004
|
-
t.
|
|
1005
|
-
updatePendingSignal(e.
|
|
1004
|
+
if (e.ae !== t) {
|
|
1005
|
+
e.T.add(t);
|
|
1006
|
+
t.re = e;
|
|
1007
|
+
updatePendingSignal(e.ae);
|
|
1006
1008
|
}
|
|
1007
1009
|
}
|
|
1008
1010
|
notifyStatus(
|
|
@@ -1010,66 +1012,66 @@ function recompute(t, n = false) {
|
|
|
1010
1012
|
e instanceof NotReadyError ? l : c,
|
|
1011
1013
|
e,
|
|
1012
1014
|
undefined,
|
|
1013
|
-
e instanceof NotReadyError ? t.
|
|
1015
|
+
e instanceof NotReadyError ? t.re : undefined
|
|
1014
1016
|
);
|
|
1015
1017
|
} finally {
|
|
1016
1018
|
E = w;
|
|
1017
|
-
t.
|
|
1019
|
+
t.m = e;
|
|
1018
1020
|
Q = d;
|
|
1019
1021
|
}
|
|
1020
|
-
if (!t.
|
|
1022
|
+
if (!t.Y) {
|
|
1021
1023
|
const e = t.ke;
|
|
1022
|
-
let r = e !== null ? e.
|
|
1024
|
+
let r = e !== null ? e.N : t.j;
|
|
1023
1025
|
if (r !== null) {
|
|
1024
1026
|
do {
|
|
1025
1027
|
r = unlinkSubs(r);
|
|
1026
1028
|
} while (r !== null);
|
|
1027
|
-
if (e !== null) e.
|
|
1028
|
-
else t.
|
|
1029
|
+
if (e !== null) e.N = null;
|
|
1030
|
+
else t.j = null;
|
|
1029
1031
|
}
|
|
1030
|
-
const f = u ? t.
|
|
1032
|
+
const f = u ? t.le : t.fe === y ? t.le : t.fe;
|
|
1031
1033
|
const l = !t.Se || !t.Se(f, p);
|
|
1032
1034
|
if (l) {
|
|
1033
|
-
const e = u ? t.
|
|
1034
|
-
if (n || (i && x !== t.
|
|
1035
|
-
else t.
|
|
1035
|
+
const e = u ? t.le : undefined;
|
|
1036
|
+
if (n || (i && x !== t.ne) || s) t.le = p;
|
|
1037
|
+
else t.fe = p;
|
|
1036
1038
|
if (u && !s && a) {
|
|
1037
1039
|
const e = t.ye || 0;
|
|
1038
1040
|
const n = t.he || 0;
|
|
1039
|
-
if (e <= n) t.
|
|
1041
|
+
if (e <= n) t.le = p;
|
|
1040
1042
|
}
|
|
1041
|
-
if (!u || s || t.
|
|
1043
|
+
if (!u || s || t.le !== e) {
|
|
1042
1044
|
insertSubs(t, s || u);
|
|
1043
1045
|
}
|
|
1044
1046
|
} else if (u) {
|
|
1045
|
-
t.
|
|
1046
|
-
} else if (t.
|
|
1047
|
-
for (let e = t.
|
|
1048
|
-
insertIntoHeapHeight(e.
|
|
1047
|
+
t.fe = p;
|
|
1048
|
+
} else if (t.o != g) {
|
|
1049
|
+
for (let e = t.O; e !== null; e = e.P) {
|
|
1050
|
+
insertIntoHeapHeight(e.A, e.A.m & o ? _ : b);
|
|
1049
1051
|
}
|
|
1050
1052
|
}
|
|
1051
1053
|
}
|
|
1052
1054
|
R = S;
|
|
1053
|
-
(!n || t.
|
|
1054
|
-
t.
|
|
1055
|
+
(!n || t.ce & l) && !t.ne && !(x && t.ge) && A.D.push(t);
|
|
1056
|
+
t.ne && i && x !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1055
1057
|
}
|
|
1056
1058
|
function updateIfNecessary(r) {
|
|
1057
|
-
if (r.
|
|
1058
|
-
for (let e = r.
|
|
1059
|
-
const t = e.
|
|
1060
|
-
const i = t.
|
|
1061
|
-
if (i.
|
|
1059
|
+
if (r.m & t) {
|
|
1060
|
+
for (let e = r.j; e; e = e.N) {
|
|
1061
|
+
const t = e.L;
|
|
1062
|
+
const i = t.I || t;
|
|
1063
|
+
if (i.H) {
|
|
1062
1064
|
updateIfNecessary(i);
|
|
1063
1065
|
}
|
|
1064
|
-
if (r.
|
|
1066
|
+
if (r.m & n) {
|
|
1065
1067
|
break;
|
|
1066
1068
|
}
|
|
1067
1069
|
}
|
|
1068
1070
|
}
|
|
1069
|
-
if (r.
|
|
1071
|
+
if (r.m & (n | f) || (r.Y && r.$ < O)) {
|
|
1070
1072
|
recompute(r);
|
|
1071
1073
|
}
|
|
1072
|
-
r.
|
|
1074
|
+
r.m = e;
|
|
1073
1075
|
}
|
|
1074
1076
|
function computed(t, n, r) {
|
|
1075
1077
|
const i = {
|
|
@@ -1077,34 +1079,34 @@ function computed(t, n, r) {
|
|
|
1077
1079
|
Se: r?.equals != null ? r.equals : isEqual,
|
|
1078
1080
|
Re: !!r?.pureWrite,
|
|
1079
1081
|
He: r?.unobserved,
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
+
je: null,
|
|
1083
|
+
oe: Q?.oe ?? A,
|
|
1082
1084
|
Ne: Q?.Ne ?? w,
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1085
|
+
We: 0,
|
|
1086
|
+
H: t,
|
|
1087
|
+
le: n,
|
|
1088
|
+
o: 0,
|
|
1089
|
+
k: null,
|
|
1090
|
+
h: undefined,
|
|
1091
|
+
p: null,
|
|
1092
|
+
j: null,
|
|
1091
1093
|
ke: null,
|
|
1092
|
-
|
|
1094
|
+
O: null,
|
|
1093
1095
|
Ie: null,
|
|
1094
|
-
|
|
1096
|
+
i: Q,
|
|
1095
1097
|
Ae: null,
|
|
1096
1098
|
Pe: null,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1099
|
+
m: e,
|
|
1100
|
+
ce: a,
|
|
1101
|
+
$: O,
|
|
1102
|
+
fe: y,
|
|
1103
|
+
Ee: null,
|
|
1102
1104
|
Ce: null,
|
|
1103
1105
|
we: null,
|
|
1104
|
-
|
|
1106
|
+
ne: null
|
|
1105
1107
|
};
|
|
1106
|
-
i.
|
|
1107
|
-
const s = Q?.
|
|
1108
|
+
i.p = i;
|
|
1109
|
+
const s = Q?.t ? Q.u : Q;
|
|
1108
1110
|
if (Q) {
|
|
1109
1111
|
const e = Q.Pe;
|
|
1110
1112
|
if (e === null) {
|
|
@@ -1114,7 +1116,7 @@ function computed(t, n, r) {
|
|
|
1114
1116
|
Q.Pe = i;
|
|
1115
1117
|
}
|
|
1116
1118
|
}
|
|
1117
|
-
if (s) i.
|
|
1119
|
+
if (s) i.o = s.o + 1;
|
|
1118
1120
|
!r?.lazy && recompute(i, true);
|
|
1119
1121
|
return i;
|
|
1120
1122
|
}
|
|
@@ -1123,15 +1125,15 @@ function signal(e, t, n = null) {
|
|
|
1123
1125
|
Se: t?.equals != null ? t.equals : isEqual,
|
|
1124
1126
|
Re: !!t?.pureWrite,
|
|
1125
1127
|
He: t?.unobserved,
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
+
le: e,
|
|
1129
|
+
O: null,
|
|
1128
1130
|
Ie: null,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1131
|
+
$: O,
|
|
1132
|
+
I: n,
|
|
1133
|
+
C: n?.k || null,
|
|
1134
|
+
fe: y
|
|
1133
1135
|
};
|
|
1134
|
-
n && (n.
|
|
1136
|
+
n && (n.k = r);
|
|
1135
1137
|
return r;
|
|
1136
1138
|
}
|
|
1137
1139
|
function optimisticSignal(e, t) {
|
|
@@ -1163,18 +1165,18 @@ function read(e) {
|
|
|
1163
1165
|
H = false;
|
|
1164
1166
|
const r = read(t);
|
|
1165
1167
|
H = n;
|
|
1166
|
-
if (t.
|
|
1167
|
-
if (j && R && t.
|
|
1168
|
-
const n = findLane(t.
|
|
1168
|
+
if (t.ce & l) return e.le;
|
|
1169
|
+
if (j && R && t.re) {
|
|
1170
|
+
const n = findLane(t.re);
|
|
1169
1171
|
const r = findLane(R);
|
|
1170
|
-
if (n !== r && n.
|
|
1171
|
-
return e.
|
|
1172
|
+
if (n !== r && n.T.size > 0) {
|
|
1173
|
+
return e.le;
|
|
1172
1174
|
}
|
|
1173
1175
|
}
|
|
1174
1176
|
return r;
|
|
1175
1177
|
}
|
|
1176
1178
|
if (L) {
|
|
1177
|
-
const t = e.
|
|
1179
|
+
const t = e.I || e;
|
|
1178
1180
|
const n = getPendingSignal(t);
|
|
1179
1181
|
const r = L;
|
|
1180
1182
|
L = false;
|
|
@@ -1182,87 +1184,87 @@ function read(e) {
|
|
|
1182
1184
|
I = true;
|
|
1183
1185
|
}
|
|
1184
1186
|
L = r;
|
|
1185
|
-
return e.
|
|
1187
|
+
return e.le;
|
|
1186
1188
|
}
|
|
1187
1189
|
let t = Q;
|
|
1188
|
-
if (t?.
|
|
1189
|
-
if (N && e.
|
|
1190
|
+
if (t?.t) t = t.u;
|
|
1191
|
+
if (N && e.H) recompute(e);
|
|
1190
1192
|
if (t && E) {
|
|
1191
|
-
if (e.
|
|
1193
|
+
if (e.H && e.m & u) recompute(e);
|
|
1192
1194
|
link(e, t);
|
|
1193
|
-
const n = e.
|
|
1194
|
-
if (n.
|
|
1195
|
-
const r = e.
|
|
1196
|
-
if (n.
|
|
1195
|
+
const n = e.I || e;
|
|
1196
|
+
if (n.H) {
|
|
1197
|
+
const r = e.m & o;
|
|
1198
|
+
if (n.o >= (r ? _.W : b.W)) {
|
|
1197
1199
|
markNode(t);
|
|
1198
|
-
markHeap(r ?
|
|
1200
|
+
markHeap(r ? _ : b);
|
|
1199
1201
|
updateIfNecessary(n);
|
|
1200
1202
|
}
|
|
1201
|
-
const i = n.
|
|
1202
|
-
if (i >= t.
|
|
1203
|
-
t.
|
|
1203
|
+
const i = n.o;
|
|
1204
|
+
if (i >= t.o && e.i !== t) {
|
|
1205
|
+
t.o = i + 1;
|
|
1204
1206
|
}
|
|
1205
1207
|
}
|
|
1206
1208
|
}
|
|
1207
|
-
const n = e.
|
|
1208
|
-
if (t && n.
|
|
1209
|
+
const n = e.I || e;
|
|
1210
|
+
if (t && n.ce & l && !(j && n.ne && x !== n.ne)) {
|
|
1209
1211
|
if (R) {
|
|
1210
|
-
const r = n.
|
|
1212
|
+
const r = n.re;
|
|
1211
1213
|
const i = findLane(R);
|
|
1212
1214
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1213
1215
|
if (!E) link(e, t);
|
|
1214
|
-
throw n.
|
|
1216
|
+
throw n.Y;
|
|
1215
1217
|
}
|
|
1216
1218
|
} else {
|
|
1217
1219
|
if (!E) link(e, t);
|
|
1218
|
-
throw n.
|
|
1220
|
+
throw n.Y;
|
|
1219
1221
|
}
|
|
1220
1222
|
}
|
|
1221
|
-
if (e.
|
|
1222
|
-
if (e
|
|
1223
|
+
if (e.H && e.ce & c) {
|
|
1224
|
+
if (e.$ < O) {
|
|
1223
1225
|
recompute(e, true);
|
|
1224
1226
|
return read(e);
|
|
1225
|
-
} else throw e.
|
|
1227
|
+
} else throw e.Y;
|
|
1226
1228
|
}
|
|
1227
|
-
return !t || R !== null || e.
|
|
1229
|
+
return !t || R !== null || e.fe === y || (j && e.ne && x !== e.ne) ? e.le : e.fe;
|
|
1228
1230
|
}
|
|
1229
1231
|
function setSignal(e, t) {
|
|
1230
|
-
if (e.
|
|
1232
|
+
if (e.ne && x !== e.ne) A.initTransition(e.ne);
|
|
1231
1233
|
const n = e.ge && !P;
|
|
1232
|
-
const r = n ? e.
|
|
1234
|
+
const r = n ? e.le : e.fe === y ? e.le : e.fe;
|
|
1233
1235
|
if (typeof t === "function") t = t(r);
|
|
1234
1236
|
const i = !e.Se || !e.Se(r, t);
|
|
1235
1237
|
if (!i) {
|
|
1236
|
-
if (n && e.
|
|
1238
|
+
if (n && e.fe !== y && e.H) {
|
|
1237
1239
|
insertSubs(e, true);
|
|
1238
1240
|
schedule();
|
|
1239
1241
|
}
|
|
1240
1242
|
return t;
|
|
1241
1243
|
}
|
|
1242
1244
|
if (n) {
|
|
1243
|
-
const n = A.
|
|
1244
|
-
if (e.
|
|
1245
|
-
A.initTransition(e.
|
|
1245
|
+
const n = A.B.includes(e);
|
|
1246
|
+
if (e.ne && n) {
|
|
1247
|
+
A.initTransition(e.ne);
|
|
1246
1248
|
}
|
|
1247
|
-
if (e.
|
|
1248
|
-
e.
|
|
1249
|
+
if (e.fe === y) {
|
|
1250
|
+
e.fe = e.le;
|
|
1249
1251
|
}
|
|
1250
1252
|
if (!n) {
|
|
1251
|
-
A.
|
|
1253
|
+
A.B.push(e);
|
|
1252
1254
|
}
|
|
1253
1255
|
e.ye = (e.ye || 0) + 1;
|
|
1254
1256
|
const r = getOrCreateLane(e);
|
|
1255
|
-
e.
|
|
1256
|
-
e.ce = t;
|
|
1257
|
-
} else {
|
|
1258
|
-
if (e.le === y) A.B.push(e);
|
|
1257
|
+
e.re = r;
|
|
1259
1258
|
e.le = t;
|
|
1259
|
+
} else {
|
|
1260
|
+
if (e.fe === y) A.D.push(e);
|
|
1261
|
+
e.fe = t;
|
|
1260
1262
|
}
|
|
1261
1263
|
updatePendingSignal(e);
|
|
1262
1264
|
if (e.me) {
|
|
1263
1265
|
setSignal(e.me, t);
|
|
1264
1266
|
}
|
|
1265
|
-
e
|
|
1267
|
+
e.$ = O;
|
|
1266
1268
|
insertSubs(e, n);
|
|
1267
1269
|
schedule();
|
|
1268
1270
|
return t;
|
|
@@ -1291,32 +1293,32 @@ function getPendingSignal(e) {
|
|
|
1291
1293
|
}
|
|
1292
1294
|
function computePendingState(e) {
|
|
1293
1295
|
const t = e;
|
|
1294
|
-
if (e.ge && e.
|
|
1295
|
-
if (t.
|
|
1296
|
+
if (e.ge && e.fe !== y) {
|
|
1297
|
+
if (t.ce & l && !(t.ce & a)) return true;
|
|
1296
1298
|
if (e.de) {
|
|
1297
|
-
const t = e.
|
|
1298
|
-
return !!(t && t.
|
|
1299
|
+
const t = e.re ? findLane(e.re) : null;
|
|
1300
|
+
return !!(t && t.T.size > 0);
|
|
1299
1301
|
}
|
|
1300
1302
|
return true;
|
|
1301
1303
|
}
|
|
1302
|
-
if (e.
|
|
1303
|
-
return !!(t.
|
|
1304
|
+
if (e.fe !== y && !(t.ce & a)) return true;
|
|
1305
|
+
return !!(t.ce & l && !(t.ce & a));
|
|
1304
1306
|
}
|
|
1305
1307
|
function updatePendingSignal(e) {
|
|
1306
1308
|
if (e.Te) {
|
|
1307
1309
|
const t = computePendingState(e);
|
|
1308
1310
|
const n = e.Te;
|
|
1309
1311
|
setSignal(n, t);
|
|
1310
|
-
if (!t && n.
|
|
1312
|
+
if (!t && n.re) {
|
|
1311
1313
|
const t = resolveLane(e);
|
|
1312
|
-
if (t && t.
|
|
1313
|
-
const e = findLane(n.
|
|
1314
|
+
if (t && t.T.size > 0) {
|
|
1315
|
+
const e = findLane(n.re);
|
|
1314
1316
|
if (e !== t) {
|
|
1315
1317
|
mergeLanes(t, e);
|
|
1316
1318
|
}
|
|
1317
1319
|
}
|
|
1318
1320
|
k.delete(n);
|
|
1319
|
-
n.
|
|
1321
|
+
n.re = undefined;
|
|
1320
1322
|
}
|
|
1321
1323
|
}
|
|
1322
1324
|
}
|
|
@@ -1425,11 +1427,11 @@ function action(e) {
|
|
|
1425
1427
|
const i = e(...t);
|
|
1426
1428
|
A.initTransition();
|
|
1427
1429
|
let s = x;
|
|
1428
|
-
s.
|
|
1430
|
+
s.ee.push(i);
|
|
1429
1431
|
const done = (e, t) => {
|
|
1430
1432
|
s = currentTransition(s);
|
|
1431
|
-
const o = s.
|
|
1432
|
-
if (o >= 0) s.
|
|
1433
|
+
const o = s.ee.indexOf(i);
|
|
1434
|
+
if (o >= 0) s.ee.splice(o, 1);
|
|
1433
1435
|
setActiveTransition(s);
|
|
1434
1436
|
schedule();
|
|
1435
1437
|
t ? r(t) : n(e);
|
|
@@ -1528,7 +1530,8 @@ function onSettled(e) {
|
|
|
1528
1530
|
function unwrap(e) {
|
|
1529
1531
|
return e?.[F]?.[U] ?? e;
|
|
1530
1532
|
}
|
|
1531
|
-
function getOverrideValue(e, t, n, r) {
|
|
1533
|
+
function getOverrideValue(e, t, n, r, i) {
|
|
1534
|
+
if (i && r in i) return i[r];
|
|
1532
1535
|
return t && r in t ? t[r] : e[r];
|
|
1533
1536
|
}
|
|
1534
1537
|
function getAllKeys(e, t, n) {
|
|
@@ -1541,108 +1544,110 @@ function applyState(e, t, n, r) {
|
|
|
1541
1544
|
if (!i) return;
|
|
1542
1545
|
const s = i[G];
|
|
1543
1546
|
const o = i[K];
|
|
1544
|
-
|
|
1545
|
-
|
|
1547
|
+
const u = i[z];
|
|
1548
|
+
let f = i[U];
|
|
1549
|
+
if (e === s && !o && !u) return;
|
|
1546
1550
|
(i[Y] || ee).set(e, i[V]);
|
|
1547
1551
|
i[G] = e;
|
|
1548
1552
|
i[K] = undefined;
|
|
1549
1553
|
if (Array.isArray(s)) {
|
|
1550
1554
|
let t = false;
|
|
1551
|
-
const
|
|
1552
|
-
if (e.length &&
|
|
1553
|
-
let
|
|
1555
|
+
const l = getOverrideValue(s, o, f, "length", u);
|
|
1556
|
+
if (e.length && l && e[0] && n(e[0]) != null) {
|
|
1557
|
+
let c, a, d, p, h, y, g, w;
|
|
1554
1558
|
for (
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1559
|
+
d = 0, p = Math.min(l, e.length);
|
|
1560
|
+
d < p &&
|
|
1561
|
+
((y = getOverrideValue(s, o, f, d, u)) === e[d] || (y && e[d] && n(y) === n(e[d])));
|
|
1562
|
+
d++
|
|
1558
1563
|
) {
|
|
1559
|
-
applyState(e[
|
|
1564
|
+
applyState(e[d], wrap(y, i), n, r);
|
|
1560
1565
|
}
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1566
|
+
const S = new Array(e.length),
|
|
1567
|
+
m = new Map();
|
|
1563
1568
|
for (
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
((
|
|
1568
|
-
|
|
1569
|
+
p = l - 1, h = e.length - 1;
|
|
1570
|
+
p >= d &&
|
|
1571
|
+
h >= d &&
|
|
1572
|
+
((y = getOverrideValue(s, o, f, p, u)) === e[h] || (y && e[h] && n(y) === n(e[h])));
|
|
1573
|
+
p--, h--
|
|
1569
1574
|
) {
|
|
1570
|
-
|
|
1575
|
+
S[h] = y;
|
|
1571
1576
|
}
|
|
1572
|
-
if (
|
|
1573
|
-
for (
|
|
1577
|
+
if (d > h || d > p) {
|
|
1578
|
+
for (a = d; a <= h; a++) {
|
|
1574
1579
|
t = true;
|
|
1575
|
-
i[U][
|
|
1580
|
+
i[U][a] && setSignal(i[U][a], wrap(e[a], i));
|
|
1576
1581
|
}
|
|
1577
|
-
for (;
|
|
1582
|
+
for (; a < e.length; a++) {
|
|
1578
1583
|
t = true;
|
|
1579
|
-
const s = wrap(
|
|
1580
|
-
i[U][
|
|
1581
|
-
applyState(e[
|
|
1584
|
+
const s = wrap(S[a], i);
|
|
1585
|
+
i[U][a] && setSignal(i[U][a], s);
|
|
1586
|
+
applyState(e[a], s, n, r);
|
|
1582
1587
|
}
|
|
1583
1588
|
t && i[U][M] && setSignal(i[U][M], void 0);
|
|
1584
|
-
|
|
1589
|
+
l !== e.length && i[U].length && setSignal(i[U].length, e.length);
|
|
1585
1590
|
return;
|
|
1586
1591
|
}
|
|
1587
|
-
|
|
1588
|
-
for (
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
}
|
|
1595
|
-
for (
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
if (
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1592
|
+
g = new Array(h + 1);
|
|
1593
|
+
for (a = h; a >= d; a--) {
|
|
1594
|
+
y = e[a];
|
|
1595
|
+
w = y ? n(y) : y;
|
|
1596
|
+
c = m.get(w);
|
|
1597
|
+
g[a] = c === undefined ? -1 : c;
|
|
1598
|
+
m.set(w, a);
|
|
1599
|
+
}
|
|
1600
|
+
for (c = d; c <= p; c++) {
|
|
1601
|
+
y = getOverrideValue(s, o, f, c, u);
|
|
1602
|
+
w = y ? n(y) : y;
|
|
1603
|
+
a = m.get(w);
|
|
1604
|
+
if (a !== undefined && a !== -1) {
|
|
1605
|
+
S[a] = y;
|
|
1606
|
+
a = g[a];
|
|
1607
|
+
m.set(w, a);
|
|
1603
1608
|
}
|
|
1604
1609
|
}
|
|
1605
|
-
for (
|
|
1606
|
-
if (
|
|
1607
|
-
const t = wrap(
|
|
1608
|
-
i[U][
|
|
1609
|
-
applyState(e[
|
|
1610
|
-
} else i[U][
|
|
1610
|
+
for (a = d; a < e.length; a++) {
|
|
1611
|
+
if (a in S) {
|
|
1612
|
+
const t = wrap(S[a], i);
|
|
1613
|
+
i[U][a] && setSignal(i[U][a], t);
|
|
1614
|
+
applyState(e[a], t, n, r);
|
|
1615
|
+
} else i[U][a] && setSignal(i[U][a], wrap(e[a], i));
|
|
1611
1616
|
}
|
|
1612
|
-
if (
|
|
1617
|
+
if (d < e.length) t = true;
|
|
1613
1618
|
} else if (e.length) {
|
|
1614
|
-
for (let t = 0,
|
|
1615
|
-
const
|
|
1616
|
-
isWrappable(
|
|
1619
|
+
for (let t = 0, l = e.length; t < l; t++) {
|
|
1620
|
+
const l = getOverrideValue(s, o, f, t, u);
|
|
1621
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[U][t] && setSignal(i[U][t], e[t]);
|
|
1617
1622
|
}
|
|
1618
1623
|
}
|
|
1619
|
-
if (
|
|
1624
|
+
if (l !== e.length) {
|
|
1620
1625
|
t = true;
|
|
1621
1626
|
i[U].length && setSignal(i[U].length, e.length);
|
|
1622
1627
|
}
|
|
1623
1628
|
t && i[U][M] && setSignal(i[U][M], void 0);
|
|
1624
1629
|
return;
|
|
1625
1630
|
}
|
|
1626
|
-
if (
|
|
1627
|
-
const t =
|
|
1628
|
-
const
|
|
1629
|
-
for (let
|
|
1630
|
-
const
|
|
1631
|
-
const
|
|
1632
|
-
const
|
|
1633
|
-
let
|
|
1634
|
-
if (
|
|
1635
|
-
if (!
|
|
1631
|
+
if (f) {
|
|
1632
|
+
const t = f[M];
|
|
1633
|
+
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1634
|
+
for (let c = 0, a = l.length; c < a; c++) {
|
|
1635
|
+
const a = l[c];
|
|
1636
|
+
const d = f[a];
|
|
1637
|
+
const p = unwrap(getOverrideValue(s, o, f, a, u));
|
|
1638
|
+
let h = unwrap(e[a]);
|
|
1639
|
+
if (p === h) continue;
|
|
1640
|
+
if (!p || !isWrappable(p) || !isWrappable(h) || (n(p) != null && n(p) !== n(h))) {
|
|
1636
1641
|
t && setSignal(t, void 0);
|
|
1637
|
-
|
|
1638
|
-
} else applyState(
|
|
1642
|
+
d && setSignal(d, isWrappable(h) ? wrap(h, i) : h);
|
|
1643
|
+
} else applyState(h, wrap(p, i), n, r);
|
|
1639
1644
|
}
|
|
1640
1645
|
}
|
|
1641
|
-
if ((
|
|
1642
|
-
const t = Object.keys(
|
|
1646
|
+
if ((f = i[J])) {
|
|
1647
|
+
const t = Object.keys(f);
|
|
1643
1648
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1644
1649
|
const r = t[n];
|
|
1645
|
-
setSignal(
|
|
1650
|
+
setSignal(f[r], r in e);
|
|
1646
1651
|
}
|
|
1647
1652
|
}
|
|
1648
1653
|
}
|
|
@@ -1833,7 +1838,7 @@ const re = {
|
|
|
1833
1838
|
if (e && e.get) return e.get.call(n);
|
|
1834
1839
|
}
|
|
1835
1840
|
if (writeOnly(n)) {
|
|
1836
|
-
let n = i && (o || !u) ? (i.
|
|
1841
|
+
let n = i && (o || !u) ? (i.fe !== y ? (i.ge ? i.le : i.fe) : i.le) : f[t];
|
|
1837
1842
|
n === D && (n = undefined);
|
|
1838
1843
|
if (!isWrappable(n)) return n;
|
|
1839
1844
|
const r = wrap(n, e);
|
|
@@ -1865,8 +1870,8 @@ const re = {
|
|
|
1865
1870
|
if (writeOnly(r)) {
|
|
1866
1871
|
if (e[$]) {
|
|
1867
1872
|
const t = e[Z];
|
|
1868
|
-
if (t?.
|
|
1869
|
-
A.initTransition(t.
|
|
1873
|
+
if (t?.ne) {
|
|
1874
|
+
A.initTransition(t.ne);
|
|
1870
1875
|
}
|
|
1871
1876
|
}
|
|
1872
1877
|
untrack(() => {
|
|
@@ -2040,7 +2045,7 @@ function deep(e) {
|
|
|
2040
2045
|
return e[q];
|
|
2041
2046
|
}
|
|
2042
2047
|
function createOptimisticStore(e, t, n) {
|
|
2043
|
-
GlobalQueue.
|
|
2048
|
+
GlobalQueue.J ||= clearOptimisticStore;
|
|
2044
2049
|
const r = typeof e === "function";
|
|
2045
2050
|
const i = (r ? t : e) ?? {};
|
|
2046
2051
|
const s = r ? e : undefined;
|
|
@@ -2057,14 +2062,14 @@ function clearOptimisticStore(e) {
|
|
|
2057
2062
|
if (r) {
|
|
2058
2063
|
for (const e of Reflect.ownKeys(n)) {
|
|
2059
2064
|
if (r[e]) {
|
|
2060
|
-
r[e].
|
|
2065
|
+
r[e].re = undefined;
|
|
2061
2066
|
const n = t[K] && e in t[K] ? t[K][e] : t[G][e];
|
|
2062
2067
|
const i = n === D ? undefined : n;
|
|
2063
2068
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2064
2069
|
}
|
|
2065
2070
|
}
|
|
2066
2071
|
if (r[M]) {
|
|
2067
|
-
r[M].
|
|
2072
|
+
r[M].re = undefined;
|
|
2068
2073
|
setSignal(r[M], undefined);
|
|
2069
2074
|
}
|
|
2070
2075
|
}
|
|
@@ -2498,11 +2503,11 @@ function compare(e, t, n) {
|
|
|
2498
2503
|
}
|
|
2499
2504
|
function boundaryComputed(e, t) {
|
|
2500
2505
|
const n = computed(e, undefined, { lazy: true });
|
|
2501
|
-
n.
|
|
2502
|
-
const r = e !== undefined ? e : n.
|
|
2503
|
-
const i = t !== undefined ? t : n.
|
|
2504
|
-
n.
|
|
2505
|
-
n.
|
|
2506
|
+
n.be = (e, t) => {
|
|
2507
|
+
const r = e !== undefined ? e : n.ce;
|
|
2508
|
+
const i = t !== undefined ? t : n.Y;
|
|
2509
|
+
n.ce &= ~n.$e;
|
|
2510
|
+
n.oe.notify(n, n.$e, r, i);
|
|
2506
2511
|
};
|
|
2507
2512
|
n.$e = t;
|
|
2508
2513
|
n.Qe = true;
|
|
@@ -2510,9 +2515,9 @@ function boundaryComputed(e, t) {
|
|
|
2510
2515
|
return n;
|
|
2511
2516
|
}
|
|
2512
2517
|
function createBoundChildren(e, t, n, r) {
|
|
2513
|
-
const i = e.
|
|
2514
|
-
i.addChild((e.
|
|
2515
|
-
onCleanup(() => i.removeChild(e.
|
|
2518
|
+
const i = e.oe;
|
|
2519
|
+
i.addChild((e.oe = n));
|
|
2520
|
+
onCleanup(() => i.removeChild(e.oe));
|
|
2516
2521
|
return runWithOwner(e, () => {
|
|
2517
2522
|
const e = computed(t);
|
|
2518
2523
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
@@ -2534,7 +2539,7 @@ class CollectionQueue extends Queue {
|
|
|
2534
2539
|
notify(e, t, n, r) {
|
|
2535
2540
|
if (!(t & this.et) || (this.et & l && this.rt)) return super.notify(e, t, n, r);
|
|
2536
2541
|
if (n & this.et) {
|
|
2537
|
-
const t = r?.
|
|
2542
|
+
const t = r?.source || e.Y?.source;
|
|
2538
2543
|
if (t) {
|
|
2539
2544
|
const e = this.tt.size === 0;
|
|
2540
2545
|
this.tt.add(t);
|
|
@@ -2546,7 +2551,7 @@ class CollectionQueue extends Queue {
|
|
|
2546
2551
|
}
|
|
2547
2552
|
checkSources() {
|
|
2548
2553
|
for (const e of this.tt) {
|
|
2549
|
-
if (!(e.
|
|
2554
|
+
if (!(e.ce & this.et)) this.tt.delete(e);
|
|
2550
2555
|
}
|
|
2551
2556
|
if (!this.tt.size) setSignal(this.nt, false);
|
|
2552
2557
|
}
|
|
@@ -2573,7 +2578,7 @@ function createLoadBoundary(e, t) {
|
|
|
2573
2578
|
function createErrorBoundary(e, t) {
|
|
2574
2579
|
return createCollectionBoundary(c, e, e => {
|
|
2575
2580
|
let n = e.tt.values().next().value;
|
|
2576
|
-
const r = n.
|
|
2581
|
+
const r = n.Y?.cause ?? n.Y;
|
|
2577
2582
|
return t(r, () => {
|
|
2578
2583
|
for (const t of e.tt) recompute(t);
|
|
2579
2584
|
schedule();
|