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