@solidjs/universal 2.0.0-beta.3 → 2.0.0-beta.4
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.cjs +598 -440
- package/dist/dev.js +598 -440
- package/dist/universal.cjs +598 -440
- package/dist/universal.js +598 -440
- package/package.json +3 -3
package/dist/universal.cjs
CHANGED
|
@@ -72,9 +72,9 @@ function deleteFromHeap(e, t) {
|
|
|
72
72
|
if (e.T === e) t.l[i] = undefined;else {
|
|
73
73
|
const n = e.S;
|
|
74
74
|
const r = t.l[i];
|
|
75
|
-
const
|
|
75
|
+
const s = n ?? r;
|
|
76
76
|
if (e === r) t.l[i] = n;else e.T.S = n;
|
|
77
|
-
|
|
77
|
+
s.T = e.T;
|
|
78
78
|
}
|
|
79
79
|
e.T = e;
|
|
80
80
|
e.S = undefined;
|
|
@@ -145,34 +145,94 @@ const zombieQueue = {
|
|
|
145
145
|
let clock = 0;
|
|
146
146
|
let activeTransition = null;
|
|
147
147
|
let scheduled = false;
|
|
148
|
+
let stashedOptimisticReads = null;
|
|
148
149
|
function runLaneEffects(e) {
|
|
149
150
|
for (const t of activeLanes) {
|
|
150
|
-
if (t.
|
|
151
|
-
const n = t.
|
|
151
|
+
if (t.U || t.k.size > 0) continue;
|
|
152
|
+
const n = t.G[e - 1];
|
|
152
153
|
if (n.length) {
|
|
153
|
-
t.
|
|
154
|
+
t.G[e - 1] = [];
|
|
154
155
|
runQueue(n, e);
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}
|
|
159
|
+
function queueStashedOptimisticEffects(e) {
|
|
160
|
+
for (let t = e.I; t !== null; t = t.p) {
|
|
161
|
+
const e = t.h;
|
|
162
|
+
if (!e.W) continue;
|
|
163
|
+
if (e.W === EFFECT_TRACKED) {
|
|
164
|
+
if (!e.H) {
|
|
165
|
+
e.H = true;
|
|
166
|
+
e.F.enqueue(EFFECT_USER, e.M);
|
|
167
|
+
}
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const n = e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
171
|
+
if (n.P > e.o) n.P = e.o;
|
|
172
|
+
insertIntoHeap(e, n);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function mergeTransitionState(e, t) {
|
|
176
|
+
t.$ = e;
|
|
177
|
+
e.j.push(...t.j);
|
|
178
|
+
for (const n of activeLanes) {
|
|
179
|
+
if (n.K === t) n.K = e;
|
|
180
|
+
}
|
|
181
|
+
e.Y.push(...t.Y);
|
|
182
|
+
for (const n of t.Z) e.Z.add(n);
|
|
183
|
+
for (const n of t.B) {
|
|
184
|
+
if (!e.B.includes(n)) e.B.push(n);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function resolveOptimisticNodes(e) {
|
|
188
|
+
for (let t = 0; t < e.length; t++) {
|
|
189
|
+
const n = e[t];
|
|
190
|
+
n.q = undefined;
|
|
191
|
+
if (n.X !== NOT_PENDING) {
|
|
192
|
+
n.J = n.X;
|
|
193
|
+
n.X = NOT_PENDING;
|
|
194
|
+
}
|
|
195
|
+
const i = n.ee;
|
|
196
|
+
n.ee = NOT_PENDING;
|
|
197
|
+
if (i !== NOT_PENDING && n.J !== i) insertSubs(n, true);
|
|
198
|
+
n.K = null;
|
|
199
|
+
}
|
|
200
|
+
e.length = 0;
|
|
201
|
+
}
|
|
202
|
+
function cleanupCompletedLanes(e) {
|
|
203
|
+
for (const t of activeLanes) {
|
|
204
|
+
const n = e ? t.K === e : !t.K;
|
|
205
|
+
if (!n) continue;
|
|
206
|
+
if (!t.U) {
|
|
207
|
+
if (t.G[0].length) runQueue(t.G[0], EFFECT_RENDER);
|
|
208
|
+
if (t.G[1].length) runQueue(t.G[1], EFFECT_USER);
|
|
209
|
+
}
|
|
210
|
+
if (t.te.q === t) t.te.q = undefined;
|
|
211
|
+
t.k.clear();
|
|
212
|
+
t.G[0].length = 0;
|
|
213
|
+
t.G[1].length = 0;
|
|
214
|
+
activeLanes.delete(t);
|
|
215
|
+
signalLanes.delete(t.te);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
158
218
|
function schedule() {
|
|
159
219
|
if (scheduled) return;
|
|
160
220
|
scheduled = true;
|
|
161
|
-
if (!globalQueue.
|
|
221
|
+
if (!globalQueue.ne && true) queueMicrotask(flush);
|
|
162
222
|
}
|
|
163
223
|
class Queue {
|
|
164
224
|
i = null;
|
|
165
|
-
|
|
166
|
-
|
|
225
|
+
ie = [[], []];
|
|
226
|
+
re = [];
|
|
167
227
|
created = clock;
|
|
168
228
|
addChild(e) {
|
|
169
|
-
this.
|
|
229
|
+
this.re.push(e);
|
|
170
230
|
e.i = this;
|
|
171
231
|
}
|
|
172
232
|
removeChild(e) {
|
|
173
|
-
const t = this.
|
|
233
|
+
const t = this.re.indexOf(e);
|
|
174
234
|
if (t >= 0) {
|
|
175
|
-
this.
|
|
235
|
+
this.re.splice(t, 1);
|
|
176
236
|
e.i = null;
|
|
177
237
|
}
|
|
178
238
|
}
|
|
@@ -181,91 +241,104 @@ class Queue {
|
|
|
181
241
|
return false;
|
|
182
242
|
}
|
|
183
243
|
run(e) {
|
|
184
|
-
if (this.
|
|
185
|
-
const t = this.
|
|
186
|
-
this.
|
|
244
|
+
if (this.ie[e - 1].length) {
|
|
245
|
+
const t = this.ie[e - 1];
|
|
246
|
+
this.ie[e - 1] = [];
|
|
187
247
|
runQueue(t, e);
|
|
188
248
|
}
|
|
189
|
-
for (let t = 0; t < this.
|
|
249
|
+
for (let t = 0; t < this.re.length; t++) this.re[t].run?.(e);
|
|
190
250
|
}
|
|
191
251
|
enqueue(e, t) {
|
|
192
252
|
if (e) {
|
|
193
253
|
if (currentOptimisticLane) {
|
|
194
254
|
const n = findLane(currentOptimisticLane);
|
|
195
|
-
n.
|
|
255
|
+
n.G[e - 1].push(t);
|
|
196
256
|
} else {
|
|
197
|
-
this.
|
|
257
|
+
this.ie[e - 1].push(t);
|
|
198
258
|
}
|
|
199
259
|
}
|
|
200
260
|
schedule();
|
|
201
261
|
}
|
|
202
262
|
stashQueues(e) {
|
|
203
|
-
e.
|
|
204
|
-
e.
|
|
205
|
-
this.
|
|
206
|
-
for (let t = 0; t < this.
|
|
207
|
-
let n = this.
|
|
208
|
-
let i = e.
|
|
263
|
+
e.ie[0].push(...this.ie[0]);
|
|
264
|
+
e.ie[1].push(...this.ie[1]);
|
|
265
|
+
this.ie = [[], []];
|
|
266
|
+
for (let t = 0; t < this.re.length; t++) {
|
|
267
|
+
let n = this.re[t];
|
|
268
|
+
let i = e.re[t];
|
|
209
269
|
if (!i) {
|
|
210
270
|
i = {
|
|
211
|
-
|
|
212
|
-
|
|
271
|
+
ie: [[], []],
|
|
272
|
+
re: []
|
|
213
273
|
};
|
|
214
|
-
e.
|
|
274
|
+
e.re[t] = i;
|
|
215
275
|
}
|
|
216
276
|
n.stashQueues(i);
|
|
217
277
|
}
|
|
218
278
|
}
|
|
219
279
|
restoreQueues(e) {
|
|
220
|
-
this.
|
|
221
|
-
this.
|
|
222
|
-
for (let t = 0; t < e.
|
|
223
|
-
const n = e.
|
|
224
|
-
let i = this.
|
|
280
|
+
this.ie[0].push(...e.ie[0]);
|
|
281
|
+
this.ie[1].push(...e.ie[1]);
|
|
282
|
+
for (let t = 0; t < e.re.length; t++) {
|
|
283
|
+
const n = e.re[t];
|
|
284
|
+
let i = this.re[t];
|
|
225
285
|
if (i) i.restoreQueues(n);
|
|
226
286
|
}
|
|
227
287
|
}
|
|
228
288
|
}
|
|
229
289
|
class GlobalQueue extends Queue {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
static
|
|
235
|
-
static
|
|
236
|
-
static
|
|
290
|
+
ne = false;
|
|
291
|
+
se = [];
|
|
292
|
+
Y = [];
|
|
293
|
+
Z = new Set();
|
|
294
|
+
static oe;
|
|
295
|
+
static ue;
|
|
296
|
+
static ce = null;
|
|
237
297
|
flush() {
|
|
238
|
-
if (this.
|
|
239
|
-
this.
|
|
298
|
+
if (this.ne) return;
|
|
299
|
+
this.ne = true;
|
|
240
300
|
try {
|
|
241
|
-
runHeap(dirtyQueue, GlobalQueue.
|
|
301
|
+
runHeap(dirtyQueue, GlobalQueue.oe);
|
|
242
302
|
if (activeTransition) {
|
|
243
303
|
const e = transitionComplete(activeTransition);
|
|
244
304
|
if (!e) {
|
|
245
|
-
|
|
246
|
-
runHeap(zombieQueue, GlobalQueue.
|
|
247
|
-
this.
|
|
248
|
-
this
|
|
249
|
-
this.
|
|
305
|
+
const e = activeTransition;
|
|
306
|
+
runHeap(zombieQueue, GlobalQueue.oe);
|
|
307
|
+
this.se = [];
|
|
308
|
+
this.Y = [];
|
|
309
|
+
this.Z = new Set();
|
|
250
310
|
runLaneEffects(EFFECT_RENDER);
|
|
251
311
|
runLaneEffects(EFFECT_USER);
|
|
252
|
-
this.stashQueues(
|
|
312
|
+
this.stashQueues(e.ae);
|
|
253
313
|
clock++;
|
|
254
314
|
scheduled = dirtyQueue.R >= dirtyQueue.P;
|
|
255
|
-
reassignPendingTransition(
|
|
315
|
+
reassignPendingTransition(e.se);
|
|
256
316
|
activeTransition = null;
|
|
257
|
-
|
|
317
|
+
if (!e.j.length && e.Y.length) {
|
|
318
|
+
stashedOptimisticReads = new Set();
|
|
319
|
+
for (let t = 0; t < e.Y.length; t++) {
|
|
320
|
+
const n = e.Y[t];
|
|
321
|
+
if (n.L || n.fe) continue;
|
|
322
|
+
stashedOptimisticReads.add(n);
|
|
323
|
+
queueStashedOptimisticEffects(n);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
finalizePureQueue(null, true);
|
|
328
|
+
} finally {
|
|
329
|
+
stashedOptimisticReads = null;
|
|
330
|
+
}
|
|
258
331
|
return;
|
|
259
332
|
}
|
|
260
|
-
this.
|
|
261
|
-
this.restoreQueues(activeTransition.
|
|
333
|
+
this.se !== activeTransition.se && this.se.push(...activeTransition.se);
|
|
334
|
+
this.restoreQueues(activeTransition.ae);
|
|
262
335
|
transitions.delete(activeTransition);
|
|
263
336
|
const t = activeTransition;
|
|
264
337
|
activeTransition = null;
|
|
265
|
-
reassignPendingTransition(this.
|
|
338
|
+
reassignPendingTransition(this.se);
|
|
266
339
|
finalizePureQueue(t);
|
|
267
340
|
} else {
|
|
268
|
-
if (transitions.size) runHeap(zombieQueue, GlobalQueue.
|
|
341
|
+
if (transitions.size) runHeap(zombieQueue, GlobalQueue.oe);
|
|
269
342
|
finalizePureQueue();
|
|
270
343
|
}
|
|
271
344
|
clock++;
|
|
@@ -275,16 +348,19 @@ class GlobalQueue extends Queue {
|
|
|
275
348
|
runLaneEffects(EFFECT_USER);
|
|
276
349
|
this.run(EFFECT_USER);
|
|
277
350
|
} finally {
|
|
278
|
-
this.
|
|
351
|
+
this.ne = false;
|
|
279
352
|
}
|
|
280
353
|
}
|
|
281
354
|
notify(e, t, n, i) {
|
|
282
355
|
if (t & STATUS_PENDING) {
|
|
283
356
|
if (n & STATUS_PENDING) {
|
|
284
|
-
const t = i !== undefined ? i : e.
|
|
285
|
-
if (activeTransition && t
|
|
286
|
-
|
|
287
|
-
|
|
357
|
+
const t = i !== undefined ? i : e.le;
|
|
358
|
+
if (activeTransition && t) {
|
|
359
|
+
const e = t.source;
|
|
360
|
+
if (!activeTransition.B.includes(e)) {
|
|
361
|
+
activeTransition.B.push(e);
|
|
362
|
+
schedule();
|
|
363
|
+
}
|
|
288
364
|
}
|
|
289
365
|
}
|
|
290
366
|
return true;
|
|
@@ -294,61 +370,59 @@ class GlobalQueue extends Queue {
|
|
|
294
370
|
initTransition(e) {
|
|
295
371
|
if (e) e = currentTransition(e);
|
|
296
372
|
if (e && e === activeTransition) return;
|
|
297
|
-
if (!e && activeTransition && activeTransition.
|
|
373
|
+
if (!e && activeTransition && activeTransition.Ee === clock) return;
|
|
298
374
|
if (!activeTransition) {
|
|
299
375
|
activeTransition = e ?? {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
376
|
+
Ee: clock,
|
|
377
|
+
se: [],
|
|
378
|
+
B: [],
|
|
379
|
+
Y: [],
|
|
380
|
+
Z: new Set(),
|
|
381
|
+
j: [],
|
|
382
|
+
ae: {
|
|
383
|
+
ie: [[], []],
|
|
384
|
+
re: []
|
|
309
385
|
},
|
|
310
|
-
|
|
386
|
+
$: false
|
|
311
387
|
};
|
|
312
388
|
} else if (e) {
|
|
313
389
|
const t = activeTransition;
|
|
314
|
-
t
|
|
315
|
-
e.ee.push(...t.ee);
|
|
316
|
-
for (const n of activeLanes) {
|
|
317
|
-
if (n.ne === t) n.ne = e;
|
|
318
|
-
}
|
|
319
|
-
e.$.push(...t.$);
|
|
320
|
-
for (const n of t.j) {
|
|
321
|
-
e.j.add(n);
|
|
322
|
-
}
|
|
390
|
+
mergeTransitionState(e, t);
|
|
323
391
|
transitions.delete(t);
|
|
324
392
|
activeTransition = e;
|
|
325
393
|
}
|
|
326
394
|
transitions.add(activeTransition);
|
|
327
|
-
activeTransition.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
395
|
+
activeTransition.Ee = clock;
|
|
396
|
+
if (this.se !== activeTransition.se) {
|
|
397
|
+
for (let e = 0; e < this.se.length; e++) {
|
|
398
|
+
const t = this.se[e];
|
|
399
|
+
t.K = activeTransition;
|
|
400
|
+
activeTransition.se.push(t);
|
|
401
|
+
}
|
|
402
|
+
this.se = activeTransition.se;
|
|
332
403
|
}
|
|
333
|
-
this.
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
404
|
+
if (this.Y !== activeTransition.Y) {
|
|
405
|
+
for (let e = 0; e < this.Y.length; e++) {
|
|
406
|
+
const t = this.Y[e];
|
|
407
|
+
t.K = activeTransition;
|
|
408
|
+
activeTransition.Y.push(t);
|
|
409
|
+
}
|
|
410
|
+
this.Y = activeTransition.Y;
|
|
338
411
|
}
|
|
339
|
-
this.$ = activeTransition.$;
|
|
340
412
|
for (const e of activeLanes) {
|
|
341
|
-
if (!e.
|
|
413
|
+
if (!e.K) e.K = activeTransition;
|
|
414
|
+
}
|
|
415
|
+
if (this.Z !== activeTransition.Z) {
|
|
416
|
+
for (const e of this.Z) activeTransition.Z.add(e);
|
|
417
|
+
this.Z = activeTransition.Z;
|
|
342
418
|
}
|
|
343
|
-
for (const e of this.j) activeTransition.j.add(e);
|
|
344
|
-
this.j = activeTransition.j;
|
|
345
419
|
}
|
|
346
420
|
}
|
|
347
421
|
function insertSubs(e, t = false) {
|
|
348
|
-
const n = e.
|
|
349
|
-
const i = e.
|
|
422
|
+
const n = e.q || currentOptimisticLane;
|
|
423
|
+
const i = e.Te !== undefined;
|
|
350
424
|
for (let r = e.I; r !== null; r = r.p) {
|
|
351
|
-
if (i && r.h.
|
|
425
|
+
if (i && r.h.de) {
|
|
352
426
|
r.h.O |= REACTIVE_SNAPSHOT_STALE;
|
|
353
427
|
continue;
|
|
354
428
|
}
|
|
@@ -357,93 +431,64 @@ function insertSubs(e, t = false) {
|
|
|
357
431
|
assignOrMergeLane(r.h, n);
|
|
358
432
|
} else if (t) {
|
|
359
433
|
r.h.O |= REACTIVE_OPTIMISTIC_DIRTY;
|
|
360
|
-
r.h.
|
|
434
|
+
r.h.q = undefined;
|
|
361
435
|
}
|
|
362
436
|
const e = r.h;
|
|
363
|
-
if (e.
|
|
364
|
-
if (!e.
|
|
365
|
-
e.
|
|
366
|
-
e.
|
|
437
|
+
if (e.W === EFFECT_TRACKED) {
|
|
438
|
+
if (!e.H) {
|
|
439
|
+
e.H = true;
|
|
440
|
+
e.F.enqueue(EFFECT_USER, e.M);
|
|
367
441
|
}
|
|
368
442
|
continue;
|
|
369
443
|
}
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
372
|
-
insertIntoHeap(r.h,
|
|
444
|
+
const s = r.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
445
|
+
if (s.P > r.h.o) s.P = r.h.o;
|
|
446
|
+
insertIntoHeap(r.h, s);
|
|
373
447
|
}
|
|
374
448
|
}
|
|
375
449
|
function commitPendingNodes() {
|
|
376
|
-
const e = globalQueue.
|
|
450
|
+
const e = globalQueue.se;
|
|
377
451
|
for (let t = 0; t < e.length; t++) {
|
|
378
452
|
const n = e[t];
|
|
379
|
-
if (n.
|
|
380
|
-
n.
|
|
381
|
-
n.
|
|
382
|
-
if (n.
|
|
453
|
+
if (n.X !== NOT_PENDING) {
|
|
454
|
+
n.J = n.X;
|
|
455
|
+
n.X = NOT_PENDING;
|
|
456
|
+
if (n.W && n.W !== EFFECT_TRACKED) n.H = true;
|
|
383
457
|
}
|
|
384
|
-
if (n.
|
|
385
|
-
|
|
386
|
-
if (e && !(e.Ee & STATUS_PENDING)) {
|
|
387
|
-
n.Ee &= -6;
|
|
388
|
-
n.q = null;
|
|
389
|
-
}
|
|
390
|
-
} else n.Ee &= ~STATUS_UNINITIALIZED;
|
|
391
|
-
if (n.L) GlobalQueue.Y(n, false, true);
|
|
458
|
+
if (!(n.Se & STATUS_PENDING)) n.Se &= ~STATUS_UNINITIALIZED;
|
|
459
|
+
if (n.L) GlobalQueue.ue(n, false, true);
|
|
392
460
|
}
|
|
393
461
|
e.length = 0;
|
|
394
462
|
}
|
|
395
463
|
function finalizePureQueue(e = null, t = false) {
|
|
396
|
-
|
|
464
|
+
const n = !t;
|
|
397
465
|
if (n) commitPendingNodes();
|
|
398
466
|
if (!t) checkBoundaryChildren(globalQueue);
|
|
399
|
-
if (dirtyQueue.R >= dirtyQueue.P) runHeap(dirtyQueue, GlobalQueue.
|
|
467
|
+
if (dirtyQueue.R >= dirtyQueue.P) runHeap(dirtyQueue, GlobalQueue.oe);
|
|
400
468
|
if (n) {
|
|
401
469
|
commitPendingNodes();
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
n.ie = undefined;
|
|
406
|
-
if (n.le !== NOT_PENDING) {
|
|
407
|
-
n.fe = n.le;
|
|
408
|
-
n.le = NOT_PENDING;
|
|
409
|
-
}
|
|
410
|
-
const i = n.Te;
|
|
411
|
-
n.Te = NOT_PENDING;
|
|
412
|
-
if (i !== NOT_PENDING && n.fe !== i) insertSubs(n, true);
|
|
413
|
-
n.ne = null;
|
|
414
|
-
}
|
|
415
|
-
t.length = 0;
|
|
416
|
-
e ? e.j : globalQueue.j;
|
|
417
|
-
for (const t of activeLanes) {
|
|
418
|
-
const n = e ? t.ne === e : !t.ne;
|
|
419
|
-
if (!n) continue;
|
|
420
|
-
if (!t.k) {
|
|
421
|
-
if (t.W[0].length) runQueue(t.W[0], EFFECT_RENDER);
|
|
422
|
-
if (t.W[1].length) runQueue(t.W[1], EFFECT_USER);
|
|
423
|
-
}
|
|
424
|
-
if (t.de.ie === t) t.de.ie = undefined;
|
|
425
|
-
t.U.clear();
|
|
426
|
-
t.W[0].length = 0;
|
|
427
|
-
t.W[1].length = 0;
|
|
428
|
-
activeLanes.delete(t);
|
|
429
|
-
signalLanes.delete(t.de);
|
|
430
|
-
}
|
|
470
|
+
resolveOptimisticNodes(e ? e.Y : globalQueue.Y);
|
|
471
|
+
e ? e.Z : globalQueue.Z;
|
|
472
|
+
cleanupCompletedLanes(e);
|
|
431
473
|
}
|
|
432
474
|
}
|
|
433
475
|
function checkBoundaryChildren(e) {
|
|
434
|
-
for (const t of e.
|
|
476
|
+
for (const t of e.re) {
|
|
435
477
|
t.checkSources?.();
|
|
436
478
|
checkBoundaryChildren(t);
|
|
437
479
|
}
|
|
438
480
|
}
|
|
439
481
|
function reassignPendingTransition(e) {
|
|
440
482
|
for (let t = 0; t < e.length; t++) {
|
|
441
|
-
e[t].
|
|
483
|
+
e[t].K = activeTransition;
|
|
442
484
|
}
|
|
443
485
|
}
|
|
444
486
|
const globalQueue = new GlobalQueue();
|
|
445
487
|
function flush() {
|
|
446
|
-
|
|
488
|
+
if (globalQueue.ne) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
while (scheduled || activeTransition) {
|
|
447
492
|
globalQueue.flush();
|
|
448
493
|
}
|
|
449
494
|
}
|
|
@@ -451,21 +496,30 @@ function runQueue(e, t) {
|
|
|
451
496
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
452
497
|
}
|
|
453
498
|
function transitionComplete(e) {
|
|
454
|
-
if (e
|
|
455
|
-
if (e.
|
|
499
|
+
if (e.$) return true;
|
|
500
|
+
if (e.j.length) return false;
|
|
456
501
|
let t = true;
|
|
457
|
-
for (let n = 0; n < e.
|
|
458
|
-
const i = e.
|
|
459
|
-
if (i.
|
|
502
|
+
for (let n = 0; n < e.B.length; n++) {
|
|
503
|
+
const i = e.B[n];
|
|
504
|
+
if (i.Se & STATUS_PENDING && i.le?.source === i) {
|
|
460
505
|
t = false;
|
|
461
506
|
break;
|
|
462
507
|
}
|
|
463
508
|
}
|
|
464
|
-
|
|
509
|
+
if (t) {
|
|
510
|
+
for (let n = 0; n < e.Y.length; n++) {
|
|
511
|
+
const i = e.Y[n];
|
|
512
|
+
if (hasActiveOverride(i) && "Se" in i && i.Se & STATUS_PENDING && i.le instanceof NotReadyError && i.le.source !== i) {
|
|
513
|
+
t = false;
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
t && (e.$ = true);
|
|
465
519
|
return t;
|
|
466
520
|
}
|
|
467
521
|
function currentTransition(e) {
|
|
468
|
-
while (e
|
|
522
|
+
while (e.$ && typeof e.$ === "object") e = e.$;
|
|
469
523
|
return e;
|
|
470
524
|
}
|
|
471
525
|
function runInTransition(e, t) {
|
|
@@ -484,119 +538,213 @@ function getOrCreateLane(e) {
|
|
|
484
538
|
if (t) {
|
|
485
539
|
return findLane(t);
|
|
486
540
|
}
|
|
487
|
-
const n = e.
|
|
488
|
-
const i = n?.
|
|
541
|
+
const n = e.Re;
|
|
542
|
+
const i = n?.q ? findLane(n.q) : null;
|
|
489
543
|
t = {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
544
|
+
te: e,
|
|
545
|
+
k: new Set(),
|
|
546
|
+
G: [[], []],
|
|
547
|
+
U: null,
|
|
548
|
+
K: activeTransition,
|
|
549
|
+
Oe: i
|
|
496
550
|
};
|
|
497
551
|
signalLanes.set(e, t);
|
|
498
552
|
activeLanes.add(t);
|
|
499
|
-
e.
|
|
553
|
+
e._e = false;
|
|
500
554
|
return t;
|
|
501
555
|
}
|
|
502
556
|
function findLane(e) {
|
|
503
|
-
while (e.
|
|
557
|
+
while (e.U) e = e.U;
|
|
504
558
|
return e;
|
|
505
559
|
}
|
|
506
560
|
function mergeLanes(e, t) {
|
|
507
561
|
e = findLane(e);
|
|
508
562
|
t = findLane(t);
|
|
509
563
|
if (e === t) return e;
|
|
510
|
-
t.
|
|
511
|
-
for (const n of t.
|
|
512
|
-
e.
|
|
513
|
-
e.
|
|
564
|
+
t.U = e;
|
|
565
|
+
for (const n of t.k) e.k.add(n);
|
|
566
|
+
e.G[0].push(...t.G[0]);
|
|
567
|
+
e.G[1].push(...t.G[1]);
|
|
514
568
|
return e;
|
|
515
569
|
}
|
|
516
570
|
function resolveLane(e) {
|
|
517
|
-
const t = e.
|
|
571
|
+
const t = e.q;
|
|
518
572
|
if (!t) return undefined;
|
|
519
573
|
const n = findLane(t);
|
|
520
574
|
if (activeLanes.has(n)) return n;
|
|
521
|
-
e.
|
|
575
|
+
e.q = undefined;
|
|
522
576
|
return undefined;
|
|
523
577
|
}
|
|
578
|
+
function resolveTransition(e) {
|
|
579
|
+
return resolveLane(e)?.K ?? e.K;
|
|
580
|
+
}
|
|
524
581
|
function hasActiveOverride(e) {
|
|
525
|
-
return !!(e.
|
|
582
|
+
return !!(e.ee !== undefined && e.ee !== NOT_PENDING);
|
|
526
583
|
}
|
|
527
584
|
function assignOrMergeLane(e, t) {
|
|
528
585
|
const n = findLane(t);
|
|
529
|
-
const i = e.
|
|
586
|
+
const i = e.q;
|
|
530
587
|
if (i) {
|
|
531
|
-
if (i.
|
|
532
|
-
e.
|
|
588
|
+
if (i.U) {
|
|
589
|
+
e.q = t;
|
|
533
590
|
return;
|
|
534
591
|
}
|
|
535
592
|
const r = findLane(i);
|
|
536
593
|
if (activeLanes.has(r)) {
|
|
537
594
|
if (r !== n && !hasActiveOverride(e)) {
|
|
538
|
-
if (n.
|
|
539
|
-
e.
|
|
540
|
-
} else if (r.
|
|
595
|
+
if (n.Oe && findLane(n.Oe) === r) {
|
|
596
|
+
e.q = t;
|
|
597
|
+
} else if (r.Oe && findLane(r.Oe) === n) ;else mergeLanes(n, r);
|
|
541
598
|
}
|
|
542
599
|
return;
|
|
543
600
|
}
|
|
544
601
|
}
|
|
545
|
-
e.
|
|
602
|
+
e.q = t;
|
|
603
|
+
}
|
|
604
|
+
function addPendingSource(e, t) {
|
|
605
|
+
if (e.Ie === t || e.pe?.has(t)) return false;
|
|
606
|
+
if (!e.Ie) {
|
|
607
|
+
e.Ie = t;
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
if (!e.pe) {
|
|
611
|
+
e.pe = new Set([e.Ie, t]);
|
|
612
|
+
} else {
|
|
613
|
+
e.pe.add(t);
|
|
614
|
+
}
|
|
615
|
+
e.Ie = undefined;
|
|
616
|
+
return true;
|
|
617
|
+
}
|
|
618
|
+
function removePendingSource(e, t) {
|
|
619
|
+
if (e.Ie) {
|
|
620
|
+
if (e.Ie !== t) return false;
|
|
621
|
+
e.Ie = undefined;
|
|
622
|
+
return true;
|
|
623
|
+
}
|
|
624
|
+
if (!e.pe?.delete(t)) return false;
|
|
625
|
+
if (e.pe.size === 1) {
|
|
626
|
+
e.Ie = e.pe.values().next().value;
|
|
627
|
+
e.pe = undefined;
|
|
628
|
+
} else if (e.pe.size === 0) {
|
|
629
|
+
e.pe = undefined;
|
|
630
|
+
}
|
|
631
|
+
return true;
|
|
632
|
+
}
|
|
633
|
+
function clearPendingSources(e) {
|
|
634
|
+
e.Ie = undefined;
|
|
635
|
+
e.pe?.clear();
|
|
636
|
+
e.pe = undefined;
|
|
637
|
+
}
|
|
638
|
+
function setPendingError(e, t, n) {
|
|
639
|
+
if (!t) {
|
|
640
|
+
e.le = null;
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (n instanceof NotReadyError && n.source === t) {
|
|
644
|
+
e.le = n;
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const i = e.le;
|
|
648
|
+
if (!(i instanceof NotReadyError) || i.source !== t) {
|
|
649
|
+
e.le = new NotReadyError(t);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function forEachDependent(e, t) {
|
|
653
|
+
for (let n = e.I; n !== null; n = n.p) t(n.h);
|
|
654
|
+
for (let n = e.A; n !== null; n = n.N) {
|
|
655
|
+
for (let e = n.I; e !== null; e = e.p) t(e.h);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function settlePendingSource(e) {
|
|
659
|
+
let t = false;
|
|
660
|
+
const n = new Set();
|
|
661
|
+
const settle = i => {
|
|
662
|
+
if (n.has(i) || !removePendingSource(i, e)) return;
|
|
663
|
+
n.add(i);
|
|
664
|
+
i.Ee = clock;
|
|
665
|
+
const r = i.Ie ?? i.pe?.values().next().value;
|
|
666
|
+
if (r) {
|
|
667
|
+
setPendingError(i, r);
|
|
668
|
+
updatePendingSignal(i);
|
|
669
|
+
} else {
|
|
670
|
+
i.Se &= ~STATUS_PENDING;
|
|
671
|
+
setPendingError(i);
|
|
672
|
+
updatePendingSignal(i);
|
|
673
|
+
if (i.he) {
|
|
674
|
+
if (i.W === EFFECT_TRACKED) {
|
|
675
|
+
const e = i;
|
|
676
|
+
if (!e.H) {
|
|
677
|
+
e.H = true;
|
|
678
|
+
e.F.enqueue(EFFECT_USER, e.M);
|
|
679
|
+
}
|
|
680
|
+
} else {
|
|
681
|
+
const e = i.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
682
|
+
if (e.P > i.o) e.P = i.o;
|
|
683
|
+
insertIntoHeap(i, e);
|
|
684
|
+
}
|
|
685
|
+
t = true;
|
|
686
|
+
}
|
|
687
|
+
i.he = false;
|
|
688
|
+
}
|
|
689
|
+
forEachDependent(i, settle);
|
|
690
|
+
};
|
|
691
|
+
forEachDependent(e, settle);
|
|
692
|
+
if (t) schedule();
|
|
546
693
|
}
|
|
547
694
|
function handleAsync(e, t, n) {
|
|
548
695
|
const i = typeof t === "object" && t !== null;
|
|
549
696
|
const r = i && untrack(() => t[Symbol.asyncIterator]);
|
|
550
|
-
const
|
|
551
|
-
if (!
|
|
552
|
-
e.
|
|
697
|
+
const s = !r && i && untrack(() => typeof t.then === "function");
|
|
698
|
+
if (!s && !r) {
|
|
699
|
+
e.Ae = null;
|
|
553
700
|
return t;
|
|
554
701
|
}
|
|
555
|
-
e.
|
|
556
|
-
let
|
|
702
|
+
e.Ae = t;
|
|
703
|
+
let o;
|
|
557
704
|
const handleError = n => {
|
|
558
|
-
if (e.
|
|
559
|
-
globalQueue.initTransition(e
|
|
705
|
+
if (e.Ae !== t) return;
|
|
706
|
+
globalQueue.initTransition(resolveTransition(e));
|
|
560
707
|
notifyStatus(e, n instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, n);
|
|
561
|
-
e.
|
|
708
|
+
e.Ee = clock;
|
|
562
709
|
};
|
|
563
710
|
const asyncWrite = (i, r) => {
|
|
564
|
-
if (e.
|
|
711
|
+
if (e.Ae !== t) return;
|
|
565
712
|
if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
|
|
566
|
-
globalQueue.initTransition(e
|
|
713
|
+
globalQueue.initTransition(resolveTransition(e));
|
|
567
714
|
clearStatus(e);
|
|
568
|
-
const
|
|
569
|
-
if (
|
|
570
|
-
if (e.
|
|
571
|
-
if (e.
|
|
572
|
-
e.
|
|
715
|
+
const s = resolveLane(e);
|
|
716
|
+
if (s) s.k.delete(e);
|
|
717
|
+
if (e.ee !== undefined) {
|
|
718
|
+
if (e.ee !== undefined && e.ee !== NOT_PENDING) e.X = i;else {
|
|
719
|
+
e.J = i;
|
|
573
720
|
insertSubs(e);
|
|
574
721
|
}
|
|
575
|
-
e.
|
|
576
|
-
} else if (
|
|
577
|
-
const t = e.
|
|
578
|
-
const n = e.
|
|
722
|
+
e.Ee = clock;
|
|
723
|
+
} else if (s) {
|
|
724
|
+
const t = e.J;
|
|
725
|
+
const n = e.Ne;
|
|
579
726
|
if (!n || !n(i, t)) {
|
|
580
|
-
e.
|
|
581
|
-
e.
|
|
582
|
-
if (e.
|
|
583
|
-
setSignal(e.
|
|
727
|
+
e.J = i;
|
|
728
|
+
e.Ee = clock;
|
|
729
|
+
if (e.Pe) {
|
|
730
|
+
setSignal(e.Pe, i);
|
|
584
731
|
}
|
|
585
732
|
insertSubs(e, true);
|
|
586
733
|
}
|
|
587
734
|
} else {
|
|
588
735
|
setSignal(e, () => i);
|
|
589
736
|
}
|
|
737
|
+
settlePendingSource(e);
|
|
590
738
|
schedule();
|
|
591
739
|
flush();
|
|
592
740
|
r?.();
|
|
593
741
|
};
|
|
594
|
-
if (
|
|
742
|
+
if (s) {
|
|
595
743
|
let n = false,
|
|
596
744
|
i = true;
|
|
597
745
|
t.then(e => {
|
|
598
746
|
if (i) {
|
|
599
|
-
|
|
747
|
+
o = e;
|
|
600
748
|
n = true;
|
|
601
749
|
} else asyncWrite(e);
|
|
602
750
|
}, e => {
|
|
@@ -604,7 +752,7 @@ function handleAsync(e, t, n) {
|
|
|
604
752
|
});
|
|
605
753
|
i = false;
|
|
606
754
|
if (!n) {
|
|
607
|
-
globalQueue.initTransition(e
|
|
755
|
+
globalQueue.initTransition(resolveTransition(e));
|
|
608
756
|
throw new NotReadyError(context);
|
|
609
757
|
}
|
|
610
758
|
}
|
|
@@ -628,7 +776,7 @@ function handleAsync(e, t, n) {
|
|
|
628
776
|
});
|
|
629
777
|
r = false;
|
|
630
778
|
if (t && !e.done) {
|
|
631
|
-
|
|
779
|
+
o = e.value;
|
|
632
780
|
i = true;
|
|
633
781
|
return iterate();
|
|
634
782
|
}
|
|
@@ -636,75 +784,126 @@ function handleAsync(e, t, n) {
|
|
|
636
784
|
};
|
|
637
785
|
const r = iterate();
|
|
638
786
|
if (!i && !r) {
|
|
639
|
-
globalQueue.initTransition(e
|
|
787
|
+
globalQueue.initTransition(resolveTransition(e));
|
|
640
788
|
throw new NotReadyError(context);
|
|
641
789
|
}
|
|
642
790
|
}
|
|
643
|
-
return
|
|
791
|
+
return o;
|
|
644
792
|
}
|
|
645
|
-
function clearStatus(e) {
|
|
646
|
-
e
|
|
647
|
-
e.
|
|
793
|
+
function clearStatus(e, t = false) {
|
|
794
|
+
clearPendingSources(e);
|
|
795
|
+
e.he = false;
|
|
796
|
+
e.Se = t ? 0 : e.Se & STATUS_UNINITIALIZED;
|
|
797
|
+
setPendingError(e);
|
|
648
798
|
updatePendingSignal(e);
|
|
649
|
-
e.
|
|
799
|
+
e.ge?.();
|
|
650
800
|
}
|
|
651
801
|
function notifyStatus(e, t, n, i, r) {
|
|
652
802
|
if (t === STATUS_ERROR && !(n instanceof StatusError) && !(n instanceof NotReadyError)) n = new StatusError(e, n);
|
|
653
|
-
const
|
|
654
|
-
const
|
|
655
|
-
const u =
|
|
803
|
+
const s = t === STATUS_PENDING && n instanceof NotReadyError ? n.source : undefined;
|
|
804
|
+
const o = s === e;
|
|
805
|
+
const u = t === STATUS_PENDING && e.ee !== undefined && !o;
|
|
806
|
+
const c = u && hasActiveOverride(e);
|
|
656
807
|
if (!i) {
|
|
657
|
-
|
|
658
|
-
|
|
808
|
+
if (t === STATUS_PENDING && s) {
|
|
809
|
+
addPendingSource(e, s);
|
|
810
|
+
e.Se = STATUS_PENDING | e.Se & STATUS_UNINITIALIZED;
|
|
811
|
+
setPendingError(e, s, n);
|
|
812
|
+
} else {
|
|
813
|
+
clearPendingSources(e);
|
|
814
|
+
e.Se = t | (t !== STATUS_ERROR ? e.Se & STATUS_UNINITIALIZED : 0);
|
|
815
|
+
e.le = n;
|
|
816
|
+
}
|
|
659
817
|
updatePendingSignal(e);
|
|
660
818
|
}
|
|
661
819
|
if (r && !i) {
|
|
662
820
|
assignOrMergeLane(e, r);
|
|
663
821
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
822
|
+
const a = i || c;
|
|
823
|
+
const f = i || u ? undefined : r;
|
|
824
|
+
if (e.ge) {
|
|
825
|
+
if (i && t === STATUS_PENDING) {
|
|
826
|
+
return;
|
|
668
827
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
const a = i || s ? undefined : r;
|
|
672
|
-
if (e.he) {
|
|
673
|
-
if (c) {
|
|
674
|
-
e.he(t, n);
|
|
828
|
+
if (a) {
|
|
829
|
+
e.ge(t, n);
|
|
675
830
|
} else {
|
|
676
|
-
e.
|
|
831
|
+
e.ge();
|
|
677
832
|
}
|
|
678
833
|
return;
|
|
679
834
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
if (
|
|
683
|
-
!
|
|
684
|
-
notifyStatus(
|
|
835
|
+
forEachDependent(e, e => {
|
|
836
|
+
e.Ee = clock;
|
|
837
|
+
if (t === STATUS_PENDING && s && e.Ie !== s && !e.pe?.has(s) || t !== STATUS_PENDING && (e.le !== n || e.Ie || e.pe)) {
|
|
838
|
+
if (!a && !e.K) globalQueue.se.push(e);
|
|
839
|
+
notifyStatus(e, t, n, a, f);
|
|
685
840
|
}
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
let externalSourceConfig = null;
|
|
844
|
+
function markDisposal(e) {
|
|
845
|
+
let t = e.Ce;
|
|
846
|
+
while (t) {
|
|
847
|
+
t.O |= REACTIVE_ZOMBIE;
|
|
848
|
+
if (t.O & REACTIVE_IN_HEAP) {
|
|
849
|
+
deleteFromHeap(t, dirtyQueue);
|
|
850
|
+
insertIntoHeap(t, zombieQueue);
|
|
851
|
+
}
|
|
852
|
+
markDisposal(t);
|
|
853
|
+
t = t.De;
|
|
686
854
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
855
|
+
}
|
|
856
|
+
function disposeChildren(e, t = false, n) {
|
|
857
|
+
if (e.O & REACTIVE_DISPOSED) return;
|
|
858
|
+
if (t) e.O = REACTIVE_DISPOSED;
|
|
859
|
+
let i = n ? e.me : e.Ce;
|
|
860
|
+
while (i) {
|
|
861
|
+
const e = i.De;
|
|
862
|
+
if (i.C) {
|
|
863
|
+
const e = i;
|
|
864
|
+
deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
865
|
+
let t = e.C;
|
|
866
|
+
do {
|
|
867
|
+
t = unlinkSubs(t);
|
|
868
|
+
} while (t !== null);
|
|
869
|
+
e.C = null;
|
|
870
|
+
e.ye = null;
|
|
871
|
+
}
|
|
872
|
+
disposeChildren(i, true);
|
|
873
|
+
i = e;
|
|
874
|
+
}
|
|
875
|
+
if (n) {
|
|
876
|
+
e.me = null;
|
|
877
|
+
} else {
|
|
878
|
+
e.Ce = null;
|
|
879
|
+
e.ve = 0;
|
|
880
|
+
}
|
|
881
|
+
runDisposal(e, n);
|
|
882
|
+
}
|
|
883
|
+
function runDisposal(e, t) {
|
|
884
|
+
let n = t ? e.we : e.be;
|
|
885
|
+
if (!n) return;
|
|
886
|
+
if (Array.isArray(n)) {
|
|
887
|
+
for (let e = 0; e < n.length; e++) {
|
|
888
|
+
const t = n[e];
|
|
889
|
+
t.call(t);
|
|
694
890
|
}
|
|
891
|
+
} else {
|
|
892
|
+
n.call(n);
|
|
695
893
|
}
|
|
894
|
+
t ? e.we = null : e.be = null;
|
|
696
895
|
}
|
|
697
896
|
function unlinkSubs(e) {
|
|
698
897
|
const t = e.m;
|
|
699
898
|
const n = e.D;
|
|
700
899
|
const i = e.p;
|
|
701
|
-
const r = e.
|
|
702
|
-
if (i !== null) i.
|
|
900
|
+
const r = e.Ue;
|
|
901
|
+
if (i !== null) i.Ue = r;else t.ke = r;
|
|
703
902
|
if (r !== null) r.p = i;else {
|
|
704
903
|
t.I = i;
|
|
705
904
|
if (i === null) {
|
|
706
|
-
t.
|
|
707
|
-
t.L && !t.
|
|
905
|
+
t.Ge?.();
|
|
906
|
+
t.L && !t.xe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
|
|
708
907
|
}
|
|
709
908
|
}
|
|
710
909
|
return n;
|
|
@@ -719,31 +918,31 @@ function unobserved(e) {
|
|
|
719
918
|
disposeChildren(e, true);
|
|
720
919
|
}
|
|
721
920
|
function link(e, t) {
|
|
722
|
-
const n = t.
|
|
921
|
+
const n = t.ye;
|
|
723
922
|
if (n !== null && n.m === e) return;
|
|
724
923
|
let i = null;
|
|
725
924
|
const r = t.O & REACTIVE_RECOMPUTING_DEPS;
|
|
726
925
|
if (r) {
|
|
727
926
|
i = n !== null ? n.D : t.C;
|
|
728
927
|
if (i !== null && i.m === e) {
|
|
729
|
-
t.
|
|
928
|
+
t.ye = i;
|
|
730
929
|
return;
|
|
731
930
|
}
|
|
732
931
|
}
|
|
733
|
-
const
|
|
734
|
-
if (
|
|
735
|
-
const
|
|
932
|
+
const s = e.ke;
|
|
933
|
+
if (s !== null && s.h === t && (!r || isValidLink(s, t))) return;
|
|
934
|
+
const o = t.ye = e.ke = {
|
|
736
935
|
m: e,
|
|
737
936
|
h: t,
|
|
738
937
|
D: i,
|
|
739
|
-
|
|
938
|
+
Ue: s,
|
|
740
939
|
p: null
|
|
741
940
|
};
|
|
742
|
-
if (n !== null) n.D =
|
|
743
|
-
if (
|
|
941
|
+
if (n !== null) n.D = o;else t.C = o;
|
|
942
|
+
if (s !== null) s.p = o;else e.I = o;
|
|
744
943
|
}
|
|
745
944
|
function isValidLink(e, t) {
|
|
746
|
-
const n = t.
|
|
945
|
+
const n = t.ye;
|
|
747
946
|
if (n !== null) {
|
|
748
947
|
let i = t.C;
|
|
749
948
|
do {
|
|
@@ -754,91 +953,38 @@ function isValidLink(e, t) {
|
|
|
754
953
|
}
|
|
755
954
|
return false;
|
|
756
955
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
while (t) {
|
|
760
|
-
t.O |= REACTIVE_ZOMBIE;
|
|
761
|
-
if (t.O & REACTIVE_IN_HEAP) {
|
|
762
|
-
deleteFromHeap(t, dirtyQueue);
|
|
763
|
-
insertIntoHeap(t, zombieQueue);
|
|
764
|
-
}
|
|
765
|
-
markDisposal(t);
|
|
766
|
-
t = t.ye;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
function disposeChildren(e, t = false, n) {
|
|
770
|
-
if (e.O & REACTIVE_DISPOSED) return;
|
|
771
|
-
if (t) e.O = REACTIVE_DISPOSED;
|
|
772
|
-
let i = n ? e.ve : e.De;
|
|
773
|
-
while (i) {
|
|
774
|
-
const e = i.ye;
|
|
775
|
-
if (i.C) {
|
|
776
|
-
const e = i;
|
|
777
|
-
deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
778
|
-
let t = e.C;
|
|
779
|
-
do {
|
|
780
|
-
t = unlinkSubs(t);
|
|
781
|
-
} while (t !== null);
|
|
782
|
-
e.C = null;
|
|
783
|
-
e.Ce = null;
|
|
784
|
-
}
|
|
785
|
-
disposeChildren(i, true);
|
|
786
|
-
i = e;
|
|
787
|
-
}
|
|
788
|
-
if (n) {
|
|
789
|
-
e.ve = null;
|
|
790
|
-
} else {
|
|
791
|
-
e.De = null;
|
|
792
|
-
e.we = 0;
|
|
793
|
-
}
|
|
794
|
-
runDisposal(e, n);
|
|
795
|
-
}
|
|
796
|
-
function runDisposal(e, t) {
|
|
797
|
-
let n = t ? e.be : e.me;
|
|
798
|
-
if (!n) return;
|
|
799
|
-
if (Array.isArray(n)) {
|
|
800
|
-
for (let e = 0; e < n.length; e++) {
|
|
801
|
-
const t = n[e];
|
|
802
|
-
t.call(t);
|
|
803
|
-
}
|
|
804
|
-
} else {
|
|
805
|
-
n.call(n);
|
|
806
|
-
}
|
|
807
|
-
t ? e.be = null : e.me = null;
|
|
808
|
-
}
|
|
809
|
-
let externalSourceConfig = null;
|
|
810
|
-
GlobalQueue.K = recompute;
|
|
811
|
-
GlobalQueue.Y = disposeChildren;
|
|
956
|
+
GlobalQueue.oe = recompute;
|
|
957
|
+
GlobalQueue.ue = disposeChildren;
|
|
812
958
|
let tracking = false;
|
|
813
959
|
let stale = false;
|
|
814
960
|
let context = null;
|
|
815
961
|
let currentOptimisticLane = null;
|
|
816
962
|
function recompute(e, t = false) {
|
|
817
|
-
const n = e.
|
|
963
|
+
const n = e.W;
|
|
818
964
|
if (!t) {
|
|
819
|
-
if (e.
|
|
965
|
+
if (e.K && (!n || activeTransition) && activeTransition !== e.K) globalQueue.initTransition(e.K);
|
|
820
966
|
deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
821
|
-
if (e.
|
|
967
|
+
if (e.K || n === EFFECT_TRACKED) disposeChildren(e);else {
|
|
822
968
|
markDisposal(e);
|
|
823
|
-
e.
|
|
824
|
-
e.
|
|
825
|
-
e.
|
|
826
|
-
e.
|
|
827
|
-
e.
|
|
969
|
+
e.we = e.be;
|
|
970
|
+
e.me = e.Ce;
|
|
971
|
+
e.be = null;
|
|
972
|
+
e.Ce = null;
|
|
973
|
+
e.ve = 0;
|
|
828
974
|
}
|
|
829
975
|
}
|
|
830
976
|
const i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
|
|
831
|
-
const r = e.
|
|
832
|
-
const
|
|
833
|
-
const
|
|
977
|
+
const r = e.ee !== undefined && e.ee !== NOT_PENDING;
|
|
978
|
+
const s = !!(e.Se & STATUS_PENDING);
|
|
979
|
+
const o = context;
|
|
834
980
|
context = e;
|
|
835
|
-
e.
|
|
981
|
+
e.ye = null;
|
|
836
982
|
e.O = REACTIVE_RECOMPUTING_DEPS;
|
|
837
|
-
e.
|
|
838
|
-
let u = e.
|
|
983
|
+
e.Ee = clock;
|
|
984
|
+
let u = e.X === NOT_PENDING ? e.J : e.X;
|
|
839
985
|
let c = e.o;
|
|
840
986
|
let a = tracking;
|
|
841
|
-
let
|
|
987
|
+
let f = currentOptimisticLane;
|
|
842
988
|
tracking = true;
|
|
843
989
|
if (i) {
|
|
844
990
|
const t = resolveLane(e);
|
|
@@ -846,60 +992,61 @@ function recompute(e, t = false) {
|
|
|
846
992
|
}
|
|
847
993
|
try {
|
|
848
994
|
u = handleAsync(e, e.L(u));
|
|
849
|
-
clearStatus(e);
|
|
850
|
-
const
|
|
851
|
-
if (
|
|
852
|
-
|
|
853
|
-
updatePendingSignal(
|
|
995
|
+
clearStatus(e, t);
|
|
996
|
+
const n = resolveLane(e);
|
|
997
|
+
if (n) {
|
|
998
|
+
n.k.delete(e);
|
|
999
|
+
updatePendingSignal(n.te);
|
|
854
1000
|
}
|
|
855
1001
|
} catch (t) {
|
|
856
1002
|
if (t instanceof NotReadyError && currentOptimisticLane) {
|
|
857
1003
|
const t = findLane(currentOptimisticLane);
|
|
858
|
-
if (t.
|
|
859
|
-
t.
|
|
860
|
-
e.
|
|
861
|
-
updatePendingSignal(t.
|
|
1004
|
+
if (t.te !== e) {
|
|
1005
|
+
t.k.add(e);
|
|
1006
|
+
e.q = t;
|
|
1007
|
+
updatePendingSignal(t.te);
|
|
862
1008
|
}
|
|
863
1009
|
}
|
|
864
|
-
|
|
1010
|
+
if (t instanceof NotReadyError) e.he = true;
|
|
1011
|
+
notifyStatus(e, t instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, t, undefined, t instanceof NotReadyError ? e.q : undefined);
|
|
865
1012
|
} finally {
|
|
866
1013
|
tracking = a;
|
|
867
1014
|
e.O = REACTIVE_NONE | (t ? e.O & REACTIVE_SNAPSHOT_STALE : 0);
|
|
868
|
-
context =
|
|
1015
|
+
context = o;
|
|
869
1016
|
}
|
|
870
|
-
if (!e.
|
|
871
|
-
const
|
|
872
|
-
let a =
|
|
1017
|
+
if (!e.le) {
|
|
1018
|
+
const o = e.ye;
|
|
1019
|
+
let a = o !== null ? o.D : e.C;
|
|
873
1020
|
if (a !== null) {
|
|
874
1021
|
do {
|
|
875
1022
|
a = unlinkSubs(a);
|
|
876
1023
|
} while (a !== null);
|
|
877
|
-
if (
|
|
1024
|
+
if (o !== null) o.D = null;else e.C = null;
|
|
878
1025
|
}
|
|
879
|
-
const
|
|
880
|
-
const
|
|
881
|
-
if (
|
|
882
|
-
const
|
|
883
|
-
if (t || n && activeTransition !== e.
|
|
884
|
-
e.
|
|
1026
|
+
const f = r ? e.ee : e.X === NOT_PENDING ? e.J : e.X;
|
|
1027
|
+
const l = !e.Ne || !e.Ne(f, u);
|
|
1028
|
+
if (l) {
|
|
1029
|
+
const o = r ? e.ee : undefined;
|
|
1030
|
+
if (t || n && activeTransition !== e.K || i) {
|
|
1031
|
+
e.J = u;
|
|
885
1032
|
if (r && i) {
|
|
886
|
-
e.
|
|
887
|
-
e.
|
|
1033
|
+
e.ee = u;
|
|
1034
|
+
e.X = u;
|
|
888
1035
|
}
|
|
889
|
-
} else e.
|
|
890
|
-
if (r && !i &&
|
|
891
|
-
if (!r || i || e.
|
|
1036
|
+
} else e.X = u;
|
|
1037
|
+
if (r && !i && s && !e._e) e.ee = u;
|
|
1038
|
+
if (!r || i || e.ee !== o) insertSubs(e, i || r);
|
|
892
1039
|
} else if (r) {
|
|
893
|
-
e.
|
|
1040
|
+
e.X = u;
|
|
894
1041
|
} else if (e.o != c) {
|
|
895
1042
|
for (let t = e.I; t !== null; t = t.p) {
|
|
896
1043
|
insertIntoHeapHeight(t.h, t.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
897
1044
|
}
|
|
898
1045
|
}
|
|
899
1046
|
}
|
|
900
|
-
currentOptimisticLane =
|
|
901
|
-
(!t || e.
|
|
902
|
-
e.
|
|
1047
|
+
currentOptimisticLane = f;
|
|
1048
|
+
(!t || e.Se & STATUS_PENDING) && !e.K && !(activeTransition && r) && globalQueue.se.push(e);
|
|
1049
|
+
e.K && n && activeTransition !== e.K && runInTransition(e.K, () => recompute(e));
|
|
903
1050
|
}
|
|
904
1051
|
function updateIfNecessary(e) {
|
|
905
1052
|
if (e.O & REACTIVE_CHECK) {
|
|
@@ -914,7 +1061,7 @@ function updateIfNecessary(e) {
|
|
|
914
1061
|
}
|
|
915
1062
|
}
|
|
916
1063
|
}
|
|
917
|
-
if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || e.
|
|
1064
|
+
if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || e.le && e.Ee < clock && !e.Ae) {
|
|
918
1065
|
recompute(e);
|
|
919
1066
|
}
|
|
920
1067
|
e.O = REACTIVE_NONE | e.O & REACTIVE_SNAPSHOT_STALE;
|
|
@@ -924,47 +1071,47 @@ function computed(e, t, n) {
|
|
|
924
1071
|
const r = {
|
|
925
1072
|
id: n?.id ?? (context?.id ),
|
|
926
1073
|
Ve: i,
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1074
|
+
Ne: n?.equals != null ? n.equals : isEqual,
|
|
1075
|
+
fe: !!n?.pureWrite,
|
|
1076
|
+
Ge: n?.unobserved,
|
|
1077
|
+
be: null,
|
|
1078
|
+
F: context?.F ?? globalQueue,
|
|
932
1079
|
Le: context?.Le ?? defaultContext,
|
|
933
|
-
|
|
1080
|
+
ve: 0,
|
|
934
1081
|
L: e,
|
|
935
|
-
|
|
1082
|
+
J: t,
|
|
936
1083
|
o: 0,
|
|
937
1084
|
A: null,
|
|
938
1085
|
S: undefined,
|
|
939
1086
|
T: null,
|
|
940
1087
|
C: null,
|
|
941
|
-
|
|
1088
|
+
ye: null,
|
|
942
1089
|
I: null,
|
|
943
|
-
|
|
1090
|
+
ke: null,
|
|
944
1091
|
i: context,
|
|
945
|
-
ye: null,
|
|
946
1092
|
De: null,
|
|
1093
|
+
Ce: null,
|
|
947
1094
|
O: n?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1095
|
+
Se: STATUS_UNINITIALIZED,
|
|
1096
|
+
Ee: clock,
|
|
1097
|
+
X: NOT_PENDING,
|
|
1098
|
+
we: null,
|
|
1099
|
+
me: null,
|
|
1100
|
+
Ae: null,
|
|
1101
|
+
K: null
|
|
955
1102
|
};
|
|
956
1103
|
r.T = r;
|
|
957
|
-
const
|
|
1104
|
+
const s = context?.t ? context.u : context;
|
|
958
1105
|
if (context) {
|
|
959
|
-
const e = context.
|
|
1106
|
+
const e = context.Ce;
|
|
960
1107
|
if (e === null) {
|
|
961
|
-
context.
|
|
1108
|
+
context.Ce = r;
|
|
962
1109
|
} else {
|
|
963
|
-
r.
|
|
964
|
-
context.
|
|
1110
|
+
r.De = e;
|
|
1111
|
+
context.Ce = r;
|
|
965
1112
|
}
|
|
966
1113
|
}
|
|
967
|
-
if (
|
|
1114
|
+
if (s) r.o = s.o + 1;
|
|
968
1115
|
!n?.lazy && recompute(r, true);
|
|
969
1116
|
return r;
|
|
970
1117
|
}
|
|
@@ -1006,41 +1153,45 @@ function read(e) {
|
|
|
1006
1153
|
}
|
|
1007
1154
|
}
|
|
1008
1155
|
}
|
|
1009
|
-
if (n.
|
|
1010
|
-
|
|
1011
|
-
if (i && !(i.Ee & STATUS_PENDING)) clearStatus(n);else if (t && true) {
|
|
1156
|
+
if (n.Se & STATUS_PENDING) {
|
|
1157
|
+
if (t && true) {
|
|
1012
1158
|
if (currentOptimisticLane) {
|
|
1013
|
-
const i = n.
|
|
1159
|
+
const i = n.q;
|
|
1014
1160
|
const r = findLane(currentOptimisticLane);
|
|
1015
1161
|
if (i && findLane(i) === r && !hasActiveOverride(n)) {
|
|
1016
1162
|
if (!tracking && e !== t) link(e, t);
|
|
1017
|
-
throw n.
|
|
1163
|
+
throw n.le;
|
|
1018
1164
|
}
|
|
1019
1165
|
} else {
|
|
1020
1166
|
if (!tracking && e !== t) link(e, t);
|
|
1021
|
-
throw n.
|
|
1167
|
+
throw n.le;
|
|
1022
1168
|
}
|
|
1023
|
-
} else if (
|
|
1024
|
-
|
|
1169
|
+
} else if (t && n !== e && n.Se & STATUS_UNINITIALIZED) {
|
|
1170
|
+
if (!tracking && e !== t) link(e, t);
|
|
1171
|
+
throw n.le;
|
|
1172
|
+
} else if (!t && n.Se & STATUS_UNINITIALIZED) {
|
|
1173
|
+
throw n.le;
|
|
1025
1174
|
}
|
|
1026
1175
|
}
|
|
1027
|
-
if (e.L && e.
|
|
1028
|
-
if (e.
|
|
1176
|
+
if (e.L && e.Se & STATUS_ERROR) {
|
|
1177
|
+
if (e.Ee < clock) {
|
|
1029
1178
|
recompute(e, true);
|
|
1030
1179
|
return read(e);
|
|
1031
|
-
} else throw e.
|
|
1180
|
+
} else throw e.le;
|
|
1181
|
+
}
|
|
1182
|
+
if (e.ee !== undefined && e.ee !== NOT_PENDING) {
|
|
1183
|
+
return e.ee;
|
|
1032
1184
|
}
|
|
1033
|
-
|
|
1034
|
-
return !t || currentOptimisticLane !== null && (e.Te !== undefined || e.ie || n === e && stale || !!(n.Ee & STATUS_PENDING)) || e.le === NOT_PENDING || stale ? e.fe : e.le;
|
|
1185
|
+
return !t || currentOptimisticLane !== null && (e.ee !== undefined || e.q || n === e && stale || !!(n.Se & STATUS_PENDING)) || e.X === NOT_PENDING || stale ? e.J : e.X;
|
|
1035
1186
|
}
|
|
1036
1187
|
function setSignal(e, t) {
|
|
1037
|
-
if (e.
|
|
1038
|
-
const n = e.
|
|
1039
|
-
const i = e.
|
|
1040
|
-
const r = n ? i ? e.
|
|
1188
|
+
if (e.K && activeTransition !== e.K) globalQueue.initTransition(e.K);
|
|
1189
|
+
const n = e.ee !== undefined && true;
|
|
1190
|
+
const i = e.ee !== undefined && e.ee !== NOT_PENDING;
|
|
1191
|
+
const r = n ? i ? e.ee : e.J : e.X === NOT_PENDING ? e.J : e.X;
|
|
1041
1192
|
if (typeof t === "function") t = t(r);
|
|
1042
|
-
const
|
|
1043
|
-
if (!
|
|
1193
|
+
const s = !e.Ne || !e.Ne(r, t) || !!(e.Se & STATUS_UNINITIALIZED);
|
|
1194
|
+
if (!s) {
|
|
1044
1195
|
if (n && i && e.L) {
|
|
1045
1196
|
insertSubs(e, true);
|
|
1046
1197
|
schedule();
|
|
@@ -1048,57 +1199,64 @@ function setSignal(e, t) {
|
|
|
1048
1199
|
return t;
|
|
1049
1200
|
}
|
|
1050
1201
|
if (n) {
|
|
1051
|
-
const n = e.
|
|
1052
|
-
if (!n
|
|
1202
|
+
const n = e.ee === NOT_PENDING;
|
|
1203
|
+
if (!n) globalQueue.initTransition(resolveTransition(e));
|
|
1053
1204
|
if (n) {
|
|
1054
|
-
e.
|
|
1055
|
-
globalQueue
|
|
1205
|
+
e.X = e.J;
|
|
1206
|
+
globalQueue.Y.push(e);
|
|
1056
1207
|
}
|
|
1057
|
-
e.
|
|
1208
|
+
e._e = true;
|
|
1058
1209
|
const i = getOrCreateLane(e);
|
|
1059
|
-
e.
|
|
1060
|
-
e.
|
|
1210
|
+
e.q = i;
|
|
1211
|
+
e.ee = t;
|
|
1061
1212
|
} else {
|
|
1062
|
-
if (e.
|
|
1063
|
-
e.
|
|
1213
|
+
if (e.X === NOT_PENDING) globalQueue.se.push(e);
|
|
1214
|
+
e.X = t;
|
|
1064
1215
|
}
|
|
1065
1216
|
updatePendingSignal(e);
|
|
1066
|
-
if (e.
|
|
1067
|
-
setSignal(e.
|
|
1217
|
+
if (e.Pe) {
|
|
1218
|
+
setSignal(e.Pe, t);
|
|
1068
1219
|
}
|
|
1069
|
-
e.
|
|
1220
|
+
e.Ee = clock;
|
|
1070
1221
|
insertSubs(e, n);
|
|
1071
1222
|
schedule();
|
|
1072
1223
|
return t;
|
|
1073
1224
|
}
|
|
1074
1225
|
function computePendingState(e) {
|
|
1075
1226
|
const t = e;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1227
|
+
const n = e.V;
|
|
1228
|
+
if (n && e.X !== NOT_PENDING) {
|
|
1229
|
+
return !n.Ae && !(n.Se & STATUS_PENDING);
|
|
1230
|
+
}
|
|
1231
|
+
if (e.ee !== undefined && e.ee !== NOT_PENDING) {
|
|
1232
|
+
if (t.Se & STATUS_PENDING && !(t.Se & STATUS_UNINITIALIZED)) return true;
|
|
1233
|
+
if (e.Re) {
|
|
1234
|
+
const t = e.q ? findLane(e.q) : null;
|
|
1235
|
+
return !!(t && t.k.size > 0);
|
|
1081
1236
|
}
|
|
1082
1237
|
return true;
|
|
1083
1238
|
}
|
|
1084
|
-
if (e.
|
|
1085
|
-
|
|
1239
|
+
if (e.ee !== undefined && e.ee === NOT_PENDING && !e.Re) {
|
|
1240
|
+
return false;
|
|
1241
|
+
}
|
|
1242
|
+
if (e.X !== NOT_PENDING && !(t.Se & STATUS_UNINITIALIZED)) return true;
|
|
1243
|
+
return !!(t.Se & STATUS_PENDING && !(t.Se & STATUS_UNINITIALIZED));
|
|
1086
1244
|
}
|
|
1087
1245
|
function updatePendingSignal(e) {
|
|
1088
|
-
if (e.
|
|
1246
|
+
if (e.Qe) {
|
|
1089
1247
|
const t = computePendingState(e);
|
|
1090
|
-
const n = e.
|
|
1248
|
+
const n = e.Qe;
|
|
1091
1249
|
setSignal(n, t);
|
|
1092
|
-
if (!t && n.
|
|
1250
|
+
if (!t && n.q) {
|
|
1093
1251
|
const t = resolveLane(e);
|
|
1094
|
-
if (t && t.
|
|
1095
|
-
const e = findLane(n.
|
|
1252
|
+
if (t && t.k.size > 0) {
|
|
1253
|
+
const e = findLane(n.q);
|
|
1096
1254
|
if (e !== t) {
|
|
1097
1255
|
mergeLanes(t, e);
|
|
1098
1256
|
}
|
|
1099
1257
|
}
|
|
1100
1258
|
signalLanes.delete(n);
|
|
1101
|
-
n.
|
|
1259
|
+
n.q = undefined;
|
|
1102
1260
|
}
|
|
1103
1261
|
}
|
|
1104
1262
|
}
|
|
@@ -1120,8 +1278,8 @@ function updatePath(e, t, n = 0) {
|
|
|
1120
1278
|
r = e;
|
|
1121
1279
|
if (n < t.length - 1) {
|
|
1122
1280
|
i = t[n];
|
|
1123
|
-
const
|
|
1124
|
-
const
|
|
1281
|
+
const s = typeof i;
|
|
1282
|
+
const o = Array.isArray(e);
|
|
1125
1283
|
if (Array.isArray(i)) {
|
|
1126
1284
|
for (let r = 0; r < i.length; r++) {
|
|
1127
1285
|
t[n] = i[r];
|
|
@@ -1129,7 +1287,7 @@ function updatePath(e, t, n = 0) {
|
|
|
1129
1287
|
}
|
|
1130
1288
|
t[n] = i;
|
|
1131
1289
|
return;
|
|
1132
|
-
} else if (
|
|
1290
|
+
} else if (o && s === "function") {
|
|
1133
1291
|
for (let r = 0; r < e.length; r++) {
|
|
1134
1292
|
if (i(e[r], r)) {
|
|
1135
1293
|
t[n] = r;
|
|
@@ -1138,13 +1296,13 @@ function updatePath(e, t, n = 0) {
|
|
|
1138
1296
|
}
|
|
1139
1297
|
t[n] = i;
|
|
1140
1298
|
return;
|
|
1141
|
-
} else if (
|
|
1299
|
+
} else if (o && s === "object") {
|
|
1142
1300
|
const {
|
|
1143
1301
|
from: r = 0,
|
|
1144
|
-
to:
|
|
1145
|
-
by:
|
|
1302
|
+
to: s = e.length - 1,
|
|
1303
|
+
by: o = 1
|
|
1146
1304
|
} = i;
|
|
1147
|
-
for (let i = r; i <=
|
|
1305
|
+
for (let i = r; i <= s; i += o) {
|
|
1148
1306
|
t[n] = i;
|
|
1149
1307
|
updatePath(e, t, n);
|
|
1150
1308
|
}
|
|
@@ -1156,20 +1314,20 @@ function updatePath(e, t, n = 0) {
|
|
|
1156
1314
|
}
|
|
1157
1315
|
r = e[i];
|
|
1158
1316
|
}
|
|
1159
|
-
let
|
|
1160
|
-
if (typeof
|
|
1161
|
-
|
|
1162
|
-
if (
|
|
1317
|
+
let s = t[t.length - 1];
|
|
1318
|
+
if (typeof s === "function") {
|
|
1319
|
+
s = s(r);
|
|
1320
|
+
if (s === r) return;
|
|
1163
1321
|
}
|
|
1164
|
-
if (i === undefined &&
|
|
1165
|
-
if (
|
|
1322
|
+
if (i === undefined && s == undefined) return;
|
|
1323
|
+
if (s === DELETE) {
|
|
1166
1324
|
delete e[i];
|
|
1167
|
-
} else if (i === undefined || isWrappable(r) && isWrappable(
|
|
1325
|
+
} else if (i === undefined || isWrappable(r) && isWrappable(s) && !Array.isArray(s)) {
|
|
1168
1326
|
const t = i !== undefined ? e[i] : e;
|
|
1169
|
-
const n = Object.keys(
|
|
1170
|
-
for (let e = 0; e < n.length; e++) t[n[e]] =
|
|
1327
|
+
const n = Object.keys(s);
|
|
1328
|
+
for (let e = 0; e < n.length; e++) t[n[e]] = s[n[e]];
|
|
1171
1329
|
} else {
|
|
1172
|
-
e[i] =
|
|
1330
|
+
e[i] = s;
|
|
1173
1331
|
}
|
|
1174
1332
|
}
|
|
1175
1333
|
Object.assign(function storePath(...e) {
|