@solidjs/signals 2.0.0-beta.13 → 2.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/dist/dev.js +376 -217
- package/dist/node.cjs +1634 -1528
- package/dist/prod.js +1400 -1299
- package/dist/types/core/core.d.ts +6 -22
- package/dist/types/core/dev.d.ts +1 -1
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/projection.d.ts +2 -2
- package/dist/types/store/store.d.ts +7 -2
- package/dist/types-cjs/core/core.d.cts +6 -22
- package/dist/types-cjs/core/dev.d.cts +1 -1
- package/dist/types-cjs/core/index.d.cts +1 -1
- package/dist/types-cjs/index.d.cts +1 -1
- package/dist/types-cjs/store/index.d.cts +1 -1
- package/dist/types-cjs/store/projection.d.cts +2 -2
- package/dist/types-cjs/store/store.d.cts +7 -2
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -31,465 +31,360 @@ const i = 1 << 3;
|
|
|
31
31
|
const s = 1 << 4;
|
|
32
32
|
const o = 1 << 5;
|
|
33
33
|
const u = 1 << 6;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
34
|
+
const f = 1 << 7;
|
|
35
|
+
const l = 1 << 8;
|
|
36
36
|
const c = 1 << 9;
|
|
37
37
|
const a = 1 << 10;
|
|
38
38
|
const d = 1 << 0;
|
|
39
39
|
const p = 1 << 1;
|
|
40
40
|
const h = 1 << 2;
|
|
41
|
-
const
|
|
41
|
+
const y = 1 << 3;
|
|
42
42
|
const S = 1 << 4;
|
|
43
|
-
const
|
|
43
|
+
const g = 1 << 5;
|
|
44
44
|
const w = 1 << 6;
|
|
45
|
-
const
|
|
46
|
-
const
|
|
45
|
+
const _ = 1 << 0;
|
|
46
|
+
const m = 1 << 1;
|
|
47
47
|
const b = 1 << 2;
|
|
48
48
|
const O = 1;
|
|
49
49
|
const v = 2;
|
|
50
50
|
const P = 3;
|
|
51
51
|
const x = {};
|
|
52
|
-
const
|
|
53
|
-
const
|
|
52
|
+
const N = {};
|
|
53
|
+
const C = "sp";
|
|
54
54
|
const E = typeof Proxy === "function";
|
|
55
55
|
const k = {};
|
|
56
56
|
const j = Symbol("refresh");
|
|
57
|
-
const W =
|
|
58
|
-
const R = new
|
|
59
|
-
|
|
60
|
-
const I = undefined;
|
|
61
|
-
function emitDiagnostic(e) {
|
|
62
|
-
const t = { sequence: ++A, ...e };
|
|
63
|
-
for (const e of W) e(t);
|
|
64
|
-
for (const e of R) e.push(t);
|
|
65
|
-
return t;
|
|
66
|
-
}
|
|
67
|
-
function actualInsertIntoHeap(e, t) {
|
|
68
|
-
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
69
|
-
if (n >= e.o) e.o = n + 1;
|
|
70
|
-
const r = e.o;
|
|
71
|
-
const i = t.l[r];
|
|
72
|
-
if (i === undefined) t.l[r] = e;
|
|
73
|
-
else {
|
|
74
|
-
const t = i.p;
|
|
75
|
-
t.h = e;
|
|
76
|
-
e.p = t;
|
|
77
|
-
i.p = e;
|
|
78
|
-
}
|
|
79
|
-
if (r > t.S) t.S = r;
|
|
80
|
-
}
|
|
81
|
-
function insertIntoHeap(e, o) {
|
|
82
|
-
let u = e.m;
|
|
83
|
-
if (u & (i | r | a)) return;
|
|
84
|
-
if (u & t) {
|
|
85
|
-
e.m = (u & -4) | n | i;
|
|
86
|
-
} else e.m = u | i;
|
|
87
|
-
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
88
|
-
}
|
|
89
|
-
function insertIntoHeapHeight(e, t) {
|
|
90
|
-
let n = e.m;
|
|
91
|
-
if (n & (i | r | s | a)) return;
|
|
92
|
-
e.m = n | s;
|
|
93
|
-
actualInsertIntoHeap(e, t);
|
|
94
|
-
}
|
|
95
|
-
function deleteFromHeap(e, t) {
|
|
96
|
-
const n = e.m;
|
|
97
|
-
if (!(n & (i | s))) return;
|
|
98
|
-
e.m = n & -25;
|
|
99
|
-
const r = e.o;
|
|
100
|
-
if (e.p === e) t.l[r] = undefined;
|
|
101
|
-
else {
|
|
102
|
-
const n = e.h;
|
|
103
|
-
const i = t.l[r];
|
|
104
|
-
const s = n ?? i;
|
|
105
|
-
if (e === i) t.l[r] = n;
|
|
106
|
-
else e.p.h = n;
|
|
107
|
-
s.p = e.p;
|
|
108
|
-
}
|
|
109
|
-
e.p = e;
|
|
110
|
-
e.h = undefined;
|
|
111
|
-
}
|
|
112
|
-
function markHeap(e) {
|
|
113
|
-
if (e._) return;
|
|
114
|
-
e._ = true;
|
|
115
|
-
for (let t = 0; t <= e.S; t++) {
|
|
116
|
-
for (let n = e.l[t]; n !== undefined; n = n.h) {
|
|
117
|
-
if (n.m & i) markNode(n);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function markNode(e, r = n) {
|
|
122
|
-
const i = e.m;
|
|
123
|
-
if ((i & (t | n)) >= r) return;
|
|
124
|
-
e.m = (i & -4) | r;
|
|
125
|
-
for (let n = e.O; n !== null; n = n.P) {
|
|
126
|
-
markNode(n.C, t);
|
|
127
|
-
}
|
|
128
|
-
if (e.N !== null) {
|
|
129
|
-
for (let n = e.N; n !== null; n = n.k) {
|
|
130
|
-
for (let e = n.O; e !== null; e = e.P) {
|
|
131
|
-
markNode(e.C, t);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function runHeap(e, t) {
|
|
137
|
-
e._ = false;
|
|
138
|
-
for (e.j = 0; e.j <= e.S; e.j++) {
|
|
139
|
-
let n = e.l[e.j];
|
|
140
|
-
while (n !== undefined) {
|
|
141
|
-
if (n.m & i) t(n);
|
|
142
|
-
else adjustHeight(n, e);
|
|
143
|
-
n = e.l[e.j];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
e.S = 0;
|
|
147
|
-
}
|
|
148
|
-
function adjustHeight(e, t) {
|
|
149
|
-
deleteFromHeap(e, t);
|
|
150
|
-
let n = e.o;
|
|
151
|
-
for (let t = e.W; t; t = t.R) {
|
|
152
|
-
const e = t.A;
|
|
153
|
-
const r = e.I || e;
|
|
154
|
-
if (r.L && r.o >= n) n = r.o + 1;
|
|
155
|
-
}
|
|
156
|
-
if (e.o !== n) {
|
|
157
|
-
e.o = n;
|
|
158
|
-
for (let n = e.O; n !== null; n = n.P) {
|
|
159
|
-
insertIntoHeapHeight(n.C, t);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
const L = new WeakMap();
|
|
164
|
-
const T = new Set();
|
|
57
|
+
const W = undefined;
|
|
58
|
+
const R = new WeakMap();
|
|
59
|
+
const A = new Set();
|
|
165
60
|
function getOrCreateLane(e) {
|
|
166
|
-
let t =
|
|
61
|
+
let t = R.get(e);
|
|
167
62
|
if (t) {
|
|
168
63
|
return findLane(t);
|
|
169
64
|
}
|
|
170
|
-
const n = e.
|
|
171
|
-
const r = n?.
|
|
172
|
-
t = {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
e.
|
|
65
|
+
const n = e.t;
|
|
66
|
+
const r = n?.i ? findLane(n.i) : null;
|
|
67
|
+
t = { o: e, u: new Set(), l: [[], []], p: null, h: q, S: r };
|
|
68
|
+
R.set(e, t);
|
|
69
|
+
A.add(t);
|
|
70
|
+
e._ = false;
|
|
176
71
|
return t;
|
|
177
72
|
}
|
|
178
73
|
function findLane(e) {
|
|
179
|
-
while (e.
|
|
74
|
+
while (e.p) e = e.p;
|
|
180
75
|
return e;
|
|
181
76
|
}
|
|
182
77
|
function mergeLanes(e, t) {
|
|
183
78
|
e = findLane(e);
|
|
184
79
|
t = findLane(t);
|
|
185
80
|
if (e === t) return e;
|
|
186
|
-
t.
|
|
187
|
-
for (const n of t.
|
|
188
|
-
e.
|
|
189
|
-
e.
|
|
81
|
+
t.p = e;
|
|
82
|
+
for (const n of t.u) e.u.add(n);
|
|
83
|
+
e.l[0].push(...t.l[0]);
|
|
84
|
+
e.l[1].push(...t.l[1]);
|
|
190
85
|
return e;
|
|
191
86
|
}
|
|
192
87
|
function resolveLane(e) {
|
|
193
|
-
const t = e.
|
|
88
|
+
const t = e.i;
|
|
194
89
|
if (!t) return undefined;
|
|
195
90
|
const n = findLane(t);
|
|
196
|
-
if (
|
|
197
|
-
e.
|
|
91
|
+
if (A.has(n)) return n;
|
|
92
|
+
e.i = undefined;
|
|
198
93
|
return undefined;
|
|
199
94
|
}
|
|
200
95
|
function resolveTransition(e) {
|
|
201
|
-
return resolveLane(e)?.
|
|
96
|
+
return resolveLane(e)?.h ?? e.h;
|
|
202
97
|
}
|
|
203
98
|
function hasActiveOverride(e) {
|
|
204
|
-
return !!(e.
|
|
99
|
+
return !!(e.m !== undefined && e.m !== x);
|
|
205
100
|
}
|
|
206
101
|
function assignOrMergeLane(e, t) {
|
|
207
102
|
const n = findLane(t);
|
|
208
|
-
const r = e.
|
|
103
|
+
const r = e.i;
|
|
209
104
|
if (r) {
|
|
210
|
-
if (r.
|
|
211
|
-
e.
|
|
105
|
+
if (r.p) {
|
|
106
|
+
e.i = t;
|
|
212
107
|
return;
|
|
213
108
|
}
|
|
214
109
|
const i = findLane(r);
|
|
215
|
-
if (
|
|
110
|
+
if (A.has(i)) {
|
|
216
111
|
if (i !== n && !hasActiveOverride(e)) {
|
|
217
|
-
if (n.
|
|
218
|
-
e.
|
|
219
|
-
} else if (i.
|
|
112
|
+
if (n.S && findLane(n.S) === i) {
|
|
113
|
+
e.i = t;
|
|
114
|
+
} else if (i.S && findLane(i.S) === n);
|
|
220
115
|
else mergeLanes(n, i);
|
|
221
116
|
}
|
|
222
117
|
return;
|
|
223
118
|
}
|
|
224
119
|
}
|
|
225
|
-
e.
|
|
120
|
+
e.i = t;
|
|
226
121
|
}
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
const
|
|
122
|
+
const I = new Set();
|
|
123
|
+
const L = { O: new Array(2e3).fill(undefined), P: false, N: 0, C: 0 };
|
|
124
|
+
const T = { O: new Array(2e3).fill(undefined), P: false, N: 0, C: 0 };
|
|
125
|
+
let H = 0;
|
|
126
|
+
let q = null;
|
|
127
|
+
let Q = false;
|
|
230
128
|
let F = 0;
|
|
231
|
-
let M =
|
|
232
|
-
let
|
|
233
|
-
|
|
234
|
-
let K = false;
|
|
235
|
-
let B = null;
|
|
236
|
-
const G = new Set();
|
|
129
|
+
let M = false;
|
|
130
|
+
let V = null;
|
|
131
|
+
const D = new Set();
|
|
237
132
|
function registerTransientStoreNode(e) {
|
|
238
|
-
|
|
133
|
+
D.add(e);
|
|
239
134
|
}
|
|
240
135
|
function canUseSimpleSyncFlush(e) {
|
|
241
136
|
return (
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
e.
|
|
245
|
-
e.
|
|
246
|
-
e.
|
|
247
|
-
|
|
137
|
+
I.size === 0 &&
|
|
138
|
+
A.size === 0 &&
|
|
139
|
+
e.k.length === 0 &&
|
|
140
|
+
e.j.length === 0 &&
|
|
141
|
+
e.W.size === 0 &&
|
|
142
|
+
D.size === 0
|
|
248
143
|
);
|
|
249
144
|
}
|
|
250
145
|
function sweepTransientStoreNodes() {
|
|
251
|
-
if (
|
|
252
|
-
for (const e of
|
|
253
|
-
if (e.
|
|
254
|
-
|
|
146
|
+
if (D.size === 0) return;
|
|
147
|
+
for (const e of D) {
|
|
148
|
+
if (e.R !== null) {
|
|
149
|
+
D.delete(e);
|
|
255
150
|
continue;
|
|
256
151
|
}
|
|
257
|
-
if (e.
|
|
258
|
-
if (e.
|
|
259
|
-
|
|
260
|
-
e.
|
|
152
|
+
if (e.A !== x) continue;
|
|
153
|
+
if (e.m !== undefined && e.m !== x) continue;
|
|
154
|
+
D.delete(e);
|
|
155
|
+
e.I?.();
|
|
261
156
|
}
|
|
262
157
|
}
|
|
263
158
|
function enforceLoadingBoundary(e) {}
|
|
264
159
|
function shouldReadStashedOptimisticValue(e) {
|
|
265
|
-
return !!
|
|
160
|
+
return !!V?.has(e);
|
|
266
161
|
}
|
|
267
162
|
function runLaneEffects(e) {
|
|
268
|
-
for (const t of
|
|
269
|
-
if (t.
|
|
270
|
-
const n = t.
|
|
163
|
+
for (const t of A) {
|
|
164
|
+
if (t.p || t.u.size > 0) continue;
|
|
165
|
+
const n = t.l[e - 1];
|
|
271
166
|
if (n.length) {
|
|
272
|
-
t.
|
|
167
|
+
t.l[e - 1] = [];
|
|
273
168
|
runQueue(n, e);
|
|
274
169
|
}
|
|
275
170
|
}
|
|
276
171
|
}
|
|
277
172
|
function queueStashedOptimisticEffects(e) {
|
|
278
|
-
for (let t = e.
|
|
279
|
-
const e = t.
|
|
280
|
-
if (!e
|
|
281
|
-
if (e
|
|
282
|
-
if (!e.
|
|
283
|
-
e.
|
|
284
|
-
e.
|
|
173
|
+
for (let t = e.R; t !== null; t = t.L) {
|
|
174
|
+
const e = t.T;
|
|
175
|
+
if (!e.H) continue;
|
|
176
|
+
if (e.H === P) {
|
|
177
|
+
if (!e.q) {
|
|
178
|
+
e.q = true;
|
|
179
|
+
e.F.enqueue(v, e.M);
|
|
285
180
|
}
|
|
286
181
|
continue;
|
|
287
182
|
}
|
|
288
|
-
const n = e.
|
|
289
|
-
if (n.
|
|
183
|
+
const n = e.V & o ? T : L;
|
|
184
|
+
if (n.N > e.D) n.N = e.D;
|
|
290
185
|
insertIntoHeap(e, n);
|
|
291
186
|
}
|
|
292
187
|
}
|
|
293
188
|
function setProjectionWriteActive(e) {
|
|
294
|
-
|
|
189
|
+
M = e;
|
|
295
190
|
}
|
|
296
191
|
function mergeTransitionState(e, t) {
|
|
297
|
-
t.
|
|
298
|
-
e.
|
|
299
|
-
for (const n of
|
|
300
|
-
e.
|
|
301
|
-
for (const n of t.
|
|
302
|
-
for (const [n, r] of t.
|
|
303
|
-
let t = e.
|
|
304
|
-
if (!t) e.
|
|
192
|
+
t.K = e;
|
|
193
|
+
e.B.push(...t.B);
|
|
194
|
+
for (const n of A) if (n.h === t) n.h = e;
|
|
195
|
+
e.j.push(...t.j);
|
|
196
|
+
for (const n of t.W) e.W.add(n);
|
|
197
|
+
for (const [n, r] of t.G) {
|
|
198
|
+
let t = e.G.get(n);
|
|
199
|
+
if (!t) e.G.set(n, (t = new Set()));
|
|
305
200
|
for (const e of r) t.add(e);
|
|
306
201
|
}
|
|
307
|
-
for (const n of t.
|
|
202
|
+
for (const n of t.U) e.U.add(n);
|
|
308
203
|
}
|
|
309
204
|
function resolveOptimisticNodes(e) {
|
|
310
205
|
for (let t = 0; t < e.length; t++) {
|
|
311
206
|
const n = e[t];
|
|
312
|
-
n.
|
|
313
|
-
if (n.
|
|
314
|
-
n
|
|
315
|
-
n.
|
|
207
|
+
n.i = undefined;
|
|
208
|
+
if (n.A !== x) {
|
|
209
|
+
n.$ = n.A;
|
|
210
|
+
n.A = x;
|
|
316
211
|
}
|
|
317
|
-
const r = n.
|
|
318
|
-
n.
|
|
319
|
-
if (r !== x && n
|
|
320
|
-
n.
|
|
212
|
+
const r = n.m;
|
|
213
|
+
n.m = x;
|
|
214
|
+
if (r !== x && n.$ !== r) insertSubs(n, true);
|
|
215
|
+
n.h = null;
|
|
321
216
|
}
|
|
322
217
|
e.length = 0;
|
|
323
218
|
}
|
|
324
219
|
function cleanupCompletedLanes(e) {
|
|
325
|
-
for (const t of
|
|
326
|
-
const n = e ? t.
|
|
220
|
+
for (const t of A) {
|
|
221
|
+
const n = e ? t.h === e : !t.h;
|
|
327
222
|
if (!n) continue;
|
|
328
|
-
if (!t.
|
|
329
|
-
if (t.
|
|
330
|
-
if (t.
|
|
223
|
+
if (!t.p) {
|
|
224
|
+
if (t.l[0].length) runQueue(t.l[0], O);
|
|
225
|
+
if (t.l[1].length) runQueue(t.l[1], v);
|
|
331
226
|
}
|
|
332
|
-
if (t.
|
|
333
|
-
t.
|
|
334
|
-
t.
|
|
335
|
-
t.
|
|
336
|
-
|
|
337
|
-
|
|
227
|
+
if (t.o.i === t) t.o.i = undefined;
|
|
228
|
+
t.u.clear();
|
|
229
|
+
t.l[0].length = 0;
|
|
230
|
+
t.l[1].length = 0;
|
|
231
|
+
A.delete(t);
|
|
232
|
+
R.delete(t.o);
|
|
338
233
|
}
|
|
339
234
|
}
|
|
340
235
|
function schedule() {
|
|
341
|
-
if (
|
|
342
|
-
|
|
343
|
-
if (!
|
|
236
|
+
if (Q) return;
|
|
237
|
+
Q = true;
|
|
238
|
+
if (!F && !K.J && !M) queueMicrotask(flush);
|
|
344
239
|
}
|
|
345
240
|
class Queue {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
created =
|
|
241
|
+
X = null;
|
|
242
|
+
Y = [[], []];
|
|
243
|
+
k = [];
|
|
244
|
+
created = H;
|
|
350
245
|
addChild(e) {
|
|
351
|
-
this.
|
|
352
|
-
e.
|
|
246
|
+
this.k.push(e);
|
|
247
|
+
e.X = this;
|
|
353
248
|
}
|
|
354
249
|
removeChild(e) {
|
|
355
|
-
const t = this.
|
|
250
|
+
const t = this.k.indexOf(e);
|
|
356
251
|
if (t >= 0) {
|
|
357
|
-
this.
|
|
358
|
-
e.
|
|
252
|
+
this.k.splice(t, 1);
|
|
253
|
+
e.X = null;
|
|
359
254
|
}
|
|
360
255
|
}
|
|
361
256
|
notify(e, t, n, r) {
|
|
362
|
-
if (this.
|
|
257
|
+
if (this.X) return this.X.notify(e, t, n, r);
|
|
363
258
|
return false;
|
|
364
259
|
}
|
|
365
260
|
run(e) {
|
|
366
|
-
if (this.
|
|
367
|
-
const t = this.
|
|
368
|
-
this.
|
|
261
|
+
if (this.Y[e - 1].length) {
|
|
262
|
+
const t = this.Y[e - 1];
|
|
263
|
+
this.Y[e - 1] = [];
|
|
369
264
|
runQueue(t, e);
|
|
370
265
|
}
|
|
371
|
-
for (let t = 0; t < this.
|
|
266
|
+
for (let t = 0; t < this.k.length; t++) this.k[t].run?.(e);
|
|
372
267
|
}
|
|
373
268
|
enqueue(e, t) {
|
|
374
269
|
if (e) {
|
|
375
|
-
if (
|
|
376
|
-
const n = findLane(
|
|
377
|
-
n.
|
|
270
|
+
if (Z) {
|
|
271
|
+
const n = findLane(Z);
|
|
272
|
+
n.l[e - 1].push(t);
|
|
378
273
|
} else {
|
|
379
|
-
this.
|
|
274
|
+
this.Y[e - 1].push(t);
|
|
380
275
|
}
|
|
381
276
|
}
|
|
382
277
|
schedule();
|
|
383
278
|
}
|
|
384
279
|
stashQueues(e) {
|
|
385
|
-
e.
|
|
386
|
-
e.
|
|
387
|
-
this.
|
|
388
|
-
for (let t = 0; t < this.
|
|
389
|
-
let n = this.
|
|
390
|
-
let r = e.
|
|
280
|
+
e.Y[0].push(...this.Y[0]);
|
|
281
|
+
e.Y[1].push(...this.Y[1]);
|
|
282
|
+
this.Y = [[], []];
|
|
283
|
+
for (let t = 0; t < this.k.length; t++) {
|
|
284
|
+
let n = this.k[t];
|
|
285
|
+
let r = e.k[t];
|
|
391
286
|
if (!r) {
|
|
392
|
-
r = {
|
|
393
|
-
e.
|
|
287
|
+
r = { Y: [[], []], k: [] };
|
|
288
|
+
e.k[t] = r;
|
|
394
289
|
}
|
|
395
290
|
n.stashQueues(r);
|
|
396
291
|
}
|
|
397
292
|
}
|
|
398
293
|
restoreQueues(e) {
|
|
399
|
-
this.
|
|
400
|
-
this.
|
|
401
|
-
for (let t = 0; t < e.
|
|
402
|
-
const n = e.
|
|
403
|
-
let r = this.
|
|
294
|
+
this.Y[0].push(...e.Y[0]);
|
|
295
|
+
this.Y[1].push(...e.Y[1]);
|
|
296
|
+
for (let t = 0; t < e.k.length; t++) {
|
|
297
|
+
const n = e.k[t];
|
|
298
|
+
let r = this.k[t];
|
|
404
299
|
if (r) r.restoreQueues(n);
|
|
405
300
|
}
|
|
406
301
|
}
|
|
407
302
|
}
|
|
408
303
|
class GlobalQueue extends Queue {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
static
|
|
415
|
-
static
|
|
416
|
-
static
|
|
417
|
-
static
|
|
304
|
+
J = false;
|
|
305
|
+
Z = null;
|
|
306
|
+
ee = [];
|
|
307
|
+
j = [];
|
|
308
|
+
W = new Set();
|
|
309
|
+
static te;
|
|
310
|
+
static ne;
|
|
311
|
+
static re;
|
|
312
|
+
static ie = null;
|
|
418
313
|
flush() {
|
|
419
|
-
if (this.
|
|
420
|
-
this.
|
|
314
|
+
if (this.J) return;
|
|
315
|
+
this.J = true;
|
|
421
316
|
try {
|
|
422
|
-
runHeap(
|
|
423
|
-
if (
|
|
424
|
-
const e = transitionComplete(
|
|
317
|
+
runHeap(L, GlobalQueue.te);
|
|
318
|
+
if (q) {
|
|
319
|
+
const e = transitionComplete(q);
|
|
425
320
|
if (!e) {
|
|
426
|
-
const e =
|
|
427
|
-
runHeap(
|
|
428
|
-
this.
|
|
429
|
-
this.
|
|
430
|
-
this.
|
|
431
|
-
this.
|
|
321
|
+
const e = q;
|
|
322
|
+
runHeap(T, GlobalQueue.te);
|
|
323
|
+
this.Z = null;
|
|
324
|
+
this.ee = [];
|
|
325
|
+
this.j = [];
|
|
326
|
+
this.W = new Set();
|
|
432
327
|
runLaneEffects(O);
|
|
433
328
|
runLaneEffects(v);
|
|
434
|
-
this.stashQueues(e.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
reassignPendingTransition(e.
|
|
438
|
-
|
|
439
|
-
if (!e.
|
|
440
|
-
|
|
441
|
-
for (let t = 0; t < e.
|
|
442
|
-
const n = e.
|
|
443
|
-
if (n.
|
|
444
|
-
|
|
329
|
+
this.stashQueues(e.se);
|
|
330
|
+
H++;
|
|
331
|
+
Q = L.C >= L.N;
|
|
332
|
+
reassignPendingTransition(e.ee);
|
|
333
|
+
q = null;
|
|
334
|
+
if (!e.B.length && !e.G.size && e.j.length) {
|
|
335
|
+
V = new Set();
|
|
336
|
+
for (let t = 0; t < e.j.length; t++) {
|
|
337
|
+
const n = e.j[t];
|
|
338
|
+
if (n.oe || n.ue & d) continue;
|
|
339
|
+
V.add(n);
|
|
445
340
|
queueStashedOptimisticEffects(n);
|
|
446
341
|
}
|
|
447
342
|
}
|
|
448
343
|
try {
|
|
449
344
|
finalizePureQueue(null, true);
|
|
450
345
|
} finally {
|
|
451
|
-
|
|
346
|
+
V = null;
|
|
452
347
|
}
|
|
453
348
|
return;
|
|
454
349
|
}
|
|
455
|
-
this.
|
|
456
|
-
this.restoreQueues(
|
|
457
|
-
|
|
458
|
-
const t =
|
|
459
|
-
|
|
460
|
-
reassignPendingTransition(this.
|
|
350
|
+
this.ee !== q.ee && this.ee.push(...q.ee);
|
|
351
|
+
this.restoreQueues(q.se);
|
|
352
|
+
I.delete(q);
|
|
353
|
+
const t = q;
|
|
354
|
+
q = null;
|
|
355
|
+
reassignPendingTransition(this.ee);
|
|
461
356
|
finalizePureQueue(t);
|
|
462
357
|
} else {
|
|
463
358
|
if (canUseSimpleSyncFlush(this)) {
|
|
464
359
|
commitPendingNodes();
|
|
465
|
-
if (
|
|
466
|
-
runHeap(
|
|
360
|
+
if (L.C >= L.N) {
|
|
361
|
+
runHeap(L, GlobalQueue.te);
|
|
467
362
|
commitPendingNodes();
|
|
468
363
|
}
|
|
469
364
|
} else {
|
|
470
|
-
if (
|
|
365
|
+
if (I.size) runHeap(T, GlobalQueue.te);
|
|
471
366
|
finalizePureQueue();
|
|
472
367
|
}
|
|
473
368
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
369
|
+
H++;
|
|
370
|
+
Q = L.C >= L.N;
|
|
371
|
+
A.size && runLaneEffects(O);
|
|
477
372
|
this.run(O);
|
|
478
|
-
|
|
373
|
+
A.size && runLaneEffects(v);
|
|
479
374
|
this.run(v);
|
|
480
375
|
if (false);
|
|
481
376
|
} finally {
|
|
482
|
-
this.
|
|
377
|
+
this.J = false;
|
|
483
378
|
}
|
|
484
379
|
}
|
|
485
380
|
notify(e, t, n, r) {
|
|
486
|
-
if (t &
|
|
487
|
-
if (n &
|
|
488
|
-
const t = r !== undefined ? r : e.
|
|
489
|
-
if (
|
|
381
|
+
if (t & _) {
|
|
382
|
+
if (n & _) {
|
|
383
|
+
const t = r !== undefined ? r : e.fe;
|
|
384
|
+
if (q && t) {
|
|
490
385
|
const n = t.source;
|
|
491
|
-
let r =
|
|
492
|
-
if (!r)
|
|
386
|
+
let r = q.G.get(n);
|
|
387
|
+
if (!r) q.G.set(n, (r = new Set()));
|
|
493
388
|
const i = r.size;
|
|
494
389
|
r.add(e);
|
|
495
390
|
if (r.size !== i) schedule();
|
|
@@ -501,125 +396,125 @@ class GlobalQueue extends Queue {
|
|
|
501
396
|
}
|
|
502
397
|
initTransition(e) {
|
|
503
398
|
if (e) e = currentTransition(e);
|
|
504
|
-
if (e && e ===
|
|
505
|
-
if (!e &&
|
|
506
|
-
if (!
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
399
|
+
if (e && e === q) return;
|
|
400
|
+
if (!e && q && q.le === H) return;
|
|
401
|
+
if (!q) {
|
|
402
|
+
q = e ?? {
|
|
403
|
+
le: H,
|
|
404
|
+
ee: [],
|
|
405
|
+
G: new Map(),
|
|
406
|
+
j: [],
|
|
407
|
+
W: new Set(),
|
|
408
|
+
B: [],
|
|
409
|
+
se: { Y: [[], []], k: [] },
|
|
410
|
+
K: false,
|
|
411
|
+
U: new Set()
|
|
517
412
|
};
|
|
518
413
|
} else if (e) {
|
|
519
|
-
const t =
|
|
414
|
+
const t = q;
|
|
520
415
|
mergeTransitionState(e, t);
|
|
521
|
-
|
|
522
|
-
|
|
416
|
+
I.delete(t);
|
|
417
|
+
q = e;
|
|
523
418
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
if (this.
|
|
527
|
-
this.
|
|
528
|
-
|
|
529
|
-
this.
|
|
419
|
+
I.add(q);
|
|
420
|
+
q.le = H;
|
|
421
|
+
if (this.Z !== null) {
|
|
422
|
+
this.Z.h = q;
|
|
423
|
+
q.ee.push(this.Z);
|
|
424
|
+
this.Z = null;
|
|
530
425
|
}
|
|
531
|
-
if (this.
|
|
532
|
-
for (let e = 0; e < this.
|
|
533
|
-
const t = this.
|
|
534
|
-
t.
|
|
535
|
-
|
|
426
|
+
if (this.ee !== q.ee) {
|
|
427
|
+
for (let e = 0; e < this.ee.length; e++) {
|
|
428
|
+
const t = this.ee[e];
|
|
429
|
+
t.h = q;
|
|
430
|
+
q.ee.push(t);
|
|
536
431
|
}
|
|
537
|
-
this.
|
|
432
|
+
this.ee = q.ee;
|
|
538
433
|
}
|
|
539
|
-
if (this.
|
|
540
|
-
for (let e = 0; e < this.
|
|
541
|
-
const t = this.
|
|
542
|
-
t.
|
|
543
|
-
|
|
434
|
+
if (this.j !== q.j) {
|
|
435
|
+
for (let e = 0; e < this.j.length; e++) {
|
|
436
|
+
const t = this.j[e];
|
|
437
|
+
t.h = q;
|
|
438
|
+
q.j.push(t);
|
|
544
439
|
}
|
|
545
|
-
this.
|
|
440
|
+
this.j = q.j;
|
|
546
441
|
}
|
|
547
|
-
for (const e of
|
|
548
|
-
if (!e.
|
|
442
|
+
for (const e of A) {
|
|
443
|
+
if (!e.h) e.h = q;
|
|
549
444
|
}
|
|
550
|
-
if (this.
|
|
551
|
-
for (const e of this.
|
|
552
|
-
this.
|
|
445
|
+
if (this.W !== q.W) {
|
|
446
|
+
for (const e of this.W) q.W.add(e);
|
|
447
|
+
this.W = q.W;
|
|
553
448
|
}
|
|
554
449
|
}
|
|
555
450
|
}
|
|
556
451
|
function queuePendingNode(e) {
|
|
557
|
-
if (
|
|
558
|
-
|
|
452
|
+
if (q) {
|
|
453
|
+
K.ee.push(e);
|
|
559
454
|
return;
|
|
560
455
|
}
|
|
561
|
-
if (
|
|
562
|
-
|
|
456
|
+
if (K.Z === null && K.ee.length === 0) {
|
|
457
|
+
K.Z = e;
|
|
563
458
|
return;
|
|
564
459
|
}
|
|
565
|
-
if (
|
|
566
|
-
|
|
567
|
-
|
|
460
|
+
if (K.Z !== null) {
|
|
461
|
+
K.ee.push(K.Z);
|
|
462
|
+
K.Z = null;
|
|
568
463
|
}
|
|
569
|
-
|
|
464
|
+
K.ee.push(e);
|
|
570
465
|
}
|
|
571
466
|
function insertSubs(e, t = false) {
|
|
572
|
-
const n = e.
|
|
573
|
-
const r = e.
|
|
574
|
-
for (let i = e.
|
|
575
|
-
if (r && i.
|
|
576
|
-
i.
|
|
467
|
+
const n = e.i || Z;
|
|
468
|
+
const r = e.ce !== undefined;
|
|
469
|
+
for (let i = e.R; i !== null; i = i.L) {
|
|
470
|
+
if (r && i.T.ue & y) {
|
|
471
|
+
i.T.V |= l;
|
|
577
472
|
continue;
|
|
578
473
|
}
|
|
579
474
|
if (t && n) {
|
|
580
|
-
i.
|
|
581
|
-
assignOrMergeLane(i.
|
|
475
|
+
i.T.V |= f;
|
|
476
|
+
assignOrMergeLane(i.T, n);
|
|
582
477
|
} else if (t) {
|
|
583
|
-
i.
|
|
584
|
-
i.
|
|
478
|
+
i.T.V |= f;
|
|
479
|
+
i.T.i = undefined;
|
|
585
480
|
}
|
|
586
|
-
const e = i.
|
|
587
|
-
if (e
|
|
588
|
-
if (!e.
|
|
589
|
-
e.
|
|
590
|
-
e.
|
|
481
|
+
const e = i.T;
|
|
482
|
+
if (e.H === P) {
|
|
483
|
+
if (!e.q) {
|
|
484
|
+
e.q = true;
|
|
485
|
+
e.F.enqueue(v, e.M);
|
|
591
486
|
}
|
|
592
487
|
continue;
|
|
593
488
|
}
|
|
594
|
-
const s = i.
|
|
595
|
-
if (s.
|
|
596
|
-
insertIntoHeap(i.
|
|
489
|
+
const s = i.T.V & o ? T : L;
|
|
490
|
+
if (s.N > i.T.D) s.N = i.T.D;
|
|
491
|
+
insertIntoHeap(i.T, s);
|
|
597
492
|
}
|
|
598
493
|
}
|
|
599
494
|
function commitPendingNode(e) {
|
|
600
495
|
const t = e;
|
|
601
|
-
if (!t.
|
|
602
|
-
if (e.
|
|
603
|
-
e
|
|
604
|
-
e.
|
|
496
|
+
if (!t.oe) {
|
|
497
|
+
if (e.A !== x) {
|
|
498
|
+
e.$ = e.A;
|
|
499
|
+
e.A = x;
|
|
605
500
|
}
|
|
606
501
|
return;
|
|
607
502
|
}
|
|
608
|
-
if (e.
|
|
609
|
-
e
|
|
610
|
-
e.
|
|
611
|
-
if (e
|
|
503
|
+
if (e.A !== x) {
|
|
504
|
+
e.$ = e.A;
|
|
505
|
+
e.A = x;
|
|
506
|
+
if (e.H && e.H !== P) e.q = true;
|
|
612
507
|
}
|
|
613
|
-
t.
|
|
614
|
-
if (!(t.
|
|
615
|
-
if (t.
|
|
508
|
+
t.V &= ~a;
|
|
509
|
+
if (!(t.ae & _)) t.ae &= ~b;
|
|
510
|
+
if (t.de !== null || t.pe !== null) GlobalQueue.ne(t, false, true);
|
|
616
511
|
}
|
|
617
512
|
function commitPendingNodes() {
|
|
618
|
-
if (
|
|
619
|
-
commitPendingNode(
|
|
620
|
-
|
|
513
|
+
if (K.Z !== null) {
|
|
514
|
+
commitPendingNode(K.Z);
|
|
515
|
+
K.Z = null;
|
|
621
516
|
}
|
|
622
|
-
const e =
|
|
517
|
+
const e = K.ee;
|
|
623
518
|
for (let t = 0; t < e.length; t++) {
|
|
624
519
|
commitPendingNode(e[t]);
|
|
625
520
|
}
|
|
@@ -628,32 +523,32 @@ function commitPendingNodes() {
|
|
|
628
523
|
function finalizePureQueue(e = null, t = false) {
|
|
629
524
|
const n = !t;
|
|
630
525
|
if (n) commitPendingNodes();
|
|
631
|
-
if (!t &&
|
|
632
|
-
const r =
|
|
633
|
-
if (r) runHeap(
|
|
526
|
+
if (!t && K.k.length) checkBoundaryChildren(K);
|
|
527
|
+
const r = L.C >= L.N;
|
|
528
|
+
if (r) runHeap(L, GlobalQueue.te);
|
|
634
529
|
if (n) {
|
|
635
530
|
if (r) commitPendingNodes();
|
|
636
|
-
resolveOptimisticNodes(e ? e.
|
|
637
|
-
if (e && e.
|
|
638
|
-
for (const t of e.
|
|
639
|
-
if (t.
|
|
640
|
-
if (t
|
|
641
|
-
if (!t.
|
|
642
|
-
t.
|
|
643
|
-
t.
|
|
531
|
+
resolveOptimisticNodes(e ? e.j : K.j);
|
|
532
|
+
if (e && e.U.size) {
|
|
533
|
+
for (const t of e.U) {
|
|
534
|
+
if (t.V & u) continue;
|
|
535
|
+
if (t.H === P) {
|
|
536
|
+
if (!t.q) {
|
|
537
|
+
t.q = true;
|
|
538
|
+
t.F.enqueue(v, t.M);
|
|
644
539
|
}
|
|
645
540
|
continue;
|
|
646
541
|
}
|
|
647
|
-
const e = t.
|
|
648
|
-
if (e.
|
|
542
|
+
const e = t.V & o ? T : L;
|
|
543
|
+
if (e.N > t.D) e.N = t.D;
|
|
649
544
|
insertIntoHeap(t, e);
|
|
650
545
|
}
|
|
651
|
-
e.
|
|
546
|
+
e.U.clear();
|
|
652
547
|
}
|
|
653
|
-
const t = e ? e.
|
|
654
|
-
if (GlobalQueue.
|
|
548
|
+
const t = e ? e.W : K.W;
|
|
549
|
+
if (GlobalQueue.ie && t.size) {
|
|
655
550
|
for (const e of t) {
|
|
656
|
-
GlobalQueue.
|
|
551
|
+
GlobalQueue.ie(e);
|
|
657
552
|
}
|
|
658
553
|
t.clear();
|
|
659
554
|
schedule();
|
|
@@ -663,58 +558,61 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
663
558
|
}
|
|
664
559
|
}
|
|
665
560
|
function checkBoundaryChildren(e) {
|
|
666
|
-
for (const t of e.
|
|
561
|
+
for (const t of e.k) {
|
|
667
562
|
t.checkSources?.();
|
|
668
563
|
checkBoundaryChildren(t);
|
|
669
564
|
}
|
|
670
565
|
}
|
|
671
566
|
function trackOptimisticStore(e) {
|
|
672
|
-
|
|
567
|
+
K.W.add(e);
|
|
673
568
|
schedule();
|
|
674
569
|
}
|
|
675
570
|
function reassignPendingTransition(e) {
|
|
676
571
|
for (let t = 0; t < e.length; t++) {
|
|
677
|
-
e[t].
|
|
572
|
+
e[t].h = q;
|
|
678
573
|
}
|
|
679
574
|
}
|
|
680
|
-
const
|
|
575
|
+
const K = new GlobalQueue();
|
|
681
576
|
function flush(e) {
|
|
682
577
|
if (e) {
|
|
683
|
-
|
|
578
|
+
F++;
|
|
684
579
|
try {
|
|
685
580
|
return e();
|
|
686
581
|
} finally {
|
|
687
|
-
|
|
688
|
-
|
|
582
|
+
try {
|
|
583
|
+
flush();
|
|
584
|
+
} finally {
|
|
585
|
+
F--;
|
|
586
|
+
}
|
|
689
587
|
}
|
|
690
588
|
}
|
|
691
|
-
if (
|
|
589
|
+
if (K.J) {
|
|
692
590
|
return;
|
|
693
591
|
}
|
|
694
|
-
while (
|
|
695
|
-
|
|
592
|
+
while (Q || q) {
|
|
593
|
+
K.flush();
|
|
696
594
|
}
|
|
697
595
|
}
|
|
698
596
|
function runQueue(e, t) {
|
|
699
597
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
700
598
|
}
|
|
701
599
|
function reporterBlocksSource(e, t) {
|
|
702
|
-
if (e.
|
|
703
|
-
if (e.
|
|
704
|
-
for (let n = e.
|
|
705
|
-
let e = n.
|
|
600
|
+
if (e.V & (o | u)) return false;
|
|
601
|
+
if (e.he === t || e.ye?.has(t)) return true;
|
|
602
|
+
for (let n = e.Se; n; n = n.ge) {
|
|
603
|
+
let e = n.we;
|
|
706
604
|
while (e) {
|
|
707
|
-
if (e === t || e.
|
|
708
|
-
e = e.
|
|
605
|
+
if (e === t || e._e === t) return true;
|
|
606
|
+
e = e.t;
|
|
709
607
|
}
|
|
710
608
|
}
|
|
711
|
-
return !!(e.
|
|
609
|
+
return !!(e.ae & _ && e.fe instanceof NotReadyError && e.fe.source === t);
|
|
712
610
|
}
|
|
713
611
|
function transitionComplete(e) {
|
|
714
|
-
if (e.
|
|
715
|
-
if (e.
|
|
612
|
+
if (e.K) return true;
|
|
613
|
+
if (e.B.length) return false;
|
|
716
614
|
let t = true;
|
|
717
|
-
for (const [n, r] of e.
|
|
615
|
+
for (const [n, r] of e.G) {
|
|
718
616
|
let i = false;
|
|
719
617
|
for (const e of r) {
|
|
720
618
|
if (reporterBlocksSource(e, n)) {
|
|
@@ -723,107 +621,205 @@ function transitionComplete(e) {
|
|
|
723
621
|
}
|
|
724
622
|
r.delete(e);
|
|
725
623
|
}
|
|
726
|
-
if (!i) e.
|
|
727
|
-
else if (n.
|
|
624
|
+
if (!i) e.G.delete(n);
|
|
625
|
+
else if (n.ae & _ && n.fe?.source === n) {
|
|
728
626
|
t = false;
|
|
729
627
|
break;
|
|
730
628
|
}
|
|
731
629
|
}
|
|
732
630
|
if (t) {
|
|
733
|
-
for (let n = 0; n < e.
|
|
734
|
-
const r = e.
|
|
631
|
+
for (let n = 0; n < e.j.length; n++) {
|
|
632
|
+
const r = e.j[n];
|
|
735
633
|
if (
|
|
736
634
|
hasActiveOverride(r) &&
|
|
737
|
-
"
|
|
738
|
-
r.
|
|
739
|
-
r.
|
|
740
|
-
r.
|
|
635
|
+
"ae" in r &&
|
|
636
|
+
r.ae & _ &&
|
|
637
|
+
r.fe instanceof NotReadyError &&
|
|
638
|
+
r.fe.source !== r
|
|
741
639
|
) {
|
|
742
640
|
t = false;
|
|
743
641
|
break;
|
|
744
642
|
}
|
|
745
643
|
}
|
|
746
644
|
}
|
|
747
|
-
t && (e.
|
|
645
|
+
t && (e.K = true);
|
|
748
646
|
return t;
|
|
749
647
|
}
|
|
750
648
|
function currentTransition(e) {
|
|
751
|
-
while (e.
|
|
649
|
+
while (e.K && typeof e.K === "object") e = e.K;
|
|
752
650
|
return e;
|
|
753
651
|
}
|
|
754
652
|
function setActiveTransition(e) {
|
|
755
|
-
|
|
653
|
+
q = e;
|
|
756
654
|
}
|
|
757
655
|
function runInTransition(e, t) {
|
|
758
|
-
const n =
|
|
656
|
+
const n = q;
|
|
759
657
|
try {
|
|
760
|
-
|
|
658
|
+
q = currentTransition(e);
|
|
761
659
|
return t();
|
|
762
660
|
} finally {
|
|
763
|
-
|
|
661
|
+
q = n;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
function actualInsertIntoHeap(e, t) {
|
|
665
|
+
const n = (e.X?.me ? e.X.be?.D : e.X?.D) ?? -1;
|
|
666
|
+
if (n >= e.D) e.D = n + 1;
|
|
667
|
+
const r = e.D;
|
|
668
|
+
const i = t.O[r];
|
|
669
|
+
if (i === undefined) t.O[r] = e;
|
|
670
|
+
else {
|
|
671
|
+
const t = i.Oe;
|
|
672
|
+
t.ve = e;
|
|
673
|
+
e.Oe = t;
|
|
674
|
+
i.Oe = e;
|
|
675
|
+
}
|
|
676
|
+
if (r > t.C) t.C = r;
|
|
677
|
+
}
|
|
678
|
+
function insertIntoHeap(e, o) {
|
|
679
|
+
let u = e.V;
|
|
680
|
+
if (u & (i | r | a)) return;
|
|
681
|
+
if (u & t) {
|
|
682
|
+
e.V = (u & -4) | n | i;
|
|
683
|
+
} else e.V = u | i;
|
|
684
|
+
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
685
|
+
}
|
|
686
|
+
function insertIntoHeapHeight(e, t) {
|
|
687
|
+
let n = e.V;
|
|
688
|
+
if (n & (i | r | s | a)) return;
|
|
689
|
+
e.V = n | s;
|
|
690
|
+
actualInsertIntoHeap(e, t);
|
|
691
|
+
}
|
|
692
|
+
function deleteFromHeap(e, t) {
|
|
693
|
+
const n = e.V;
|
|
694
|
+
if (!(n & (i | s))) return;
|
|
695
|
+
e.V = n & -25;
|
|
696
|
+
const r = e.D;
|
|
697
|
+
if (e.Oe === e) t.O[r] = undefined;
|
|
698
|
+
else {
|
|
699
|
+
const n = e.ve;
|
|
700
|
+
const i = t.O[r];
|
|
701
|
+
const s = n ?? i;
|
|
702
|
+
if (e === i) t.O[r] = n;
|
|
703
|
+
else e.Oe.ve = n;
|
|
704
|
+
s.Oe = e.Oe;
|
|
764
705
|
}
|
|
706
|
+
e.Oe = e;
|
|
707
|
+
e.ve = undefined;
|
|
765
708
|
}
|
|
766
|
-
|
|
709
|
+
function markHeap(e) {
|
|
710
|
+
if (e.P) return;
|
|
711
|
+
e.P = true;
|
|
712
|
+
for (let t = 0; t <= e.C; t++) {
|
|
713
|
+
for (let n = e.O[t]; n !== undefined; n = n.ve) {
|
|
714
|
+
if (n.V & i) markNode(n);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
function markNode(e, r = n) {
|
|
719
|
+
const i = e.V;
|
|
720
|
+
if ((i & (t | n)) >= r) return;
|
|
721
|
+
e.V = (i & -4) | r;
|
|
722
|
+
for (let n = e.R; n !== null; n = n.L) {
|
|
723
|
+
markNode(n.T, t);
|
|
724
|
+
}
|
|
725
|
+
if (e.Pe !== null) {
|
|
726
|
+
for (let n = e.Pe; n !== null; n = n.xe) {
|
|
727
|
+
for (let e = n.R; e !== null; e = e.L) {
|
|
728
|
+
markNode(e.T, t);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
function runHeap(e, t) {
|
|
734
|
+
e.P = false;
|
|
735
|
+
for (e.N = 0; e.N <= e.C; e.N++) {
|
|
736
|
+
let n = e.O[e.N];
|
|
737
|
+
while (n !== undefined) {
|
|
738
|
+
if (n.V & i) t(n);
|
|
739
|
+
else adjustHeight(n, e);
|
|
740
|
+
n = e.O[e.N];
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
e.C = 0;
|
|
744
|
+
}
|
|
745
|
+
function adjustHeight(e, t) {
|
|
746
|
+
deleteFromHeap(e, t);
|
|
747
|
+
let n = e.D;
|
|
748
|
+
for (let t = e.Se; t; t = t.ge) {
|
|
749
|
+
const e = t.we;
|
|
750
|
+
const r = e._e || e;
|
|
751
|
+
if (r.oe && r.D >= n) n = r.D + 1;
|
|
752
|
+
}
|
|
753
|
+
if (e.D !== n) {
|
|
754
|
+
e.D = n;
|
|
755
|
+
for (let t = e.R; t !== null; t = t.L) {
|
|
756
|
+
insertIntoHeapHeight(t.T, t.T.V & o ? T : L);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const B = {};
|
|
767
761
|
function markDisposal(e) {
|
|
768
|
-
let t = e.
|
|
762
|
+
let t = e.Ne;
|
|
769
763
|
while (t) {
|
|
770
|
-
t.
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
764
|
+
const e = t.V;
|
|
765
|
+
t.V = e | o;
|
|
766
|
+
if (e & (i | s)) {
|
|
767
|
+
deleteFromHeap(t, e & o ? T : L);
|
|
768
|
+
if (e & i) insertIntoHeap(t, T);
|
|
769
|
+
else insertIntoHeapHeight(t, T);
|
|
774
770
|
}
|
|
775
771
|
markDisposal(t);
|
|
776
|
-
t = t.
|
|
772
|
+
t = t.Ce;
|
|
777
773
|
}
|
|
778
774
|
}
|
|
779
775
|
function dispose(e) {
|
|
780
|
-
let t = e.
|
|
781
|
-
|
|
776
|
+
let t = e.Se;
|
|
777
|
+
while (t !== null) {
|
|
782
778
|
t = unlinkSubs(t);
|
|
783
|
-
}
|
|
784
|
-
e.
|
|
779
|
+
}
|
|
780
|
+
e.Se = null;
|
|
785
781
|
e.Ee = null;
|
|
786
782
|
disposeChildren(e, true);
|
|
787
783
|
}
|
|
788
784
|
function disposeChildren(e, t = false, n) {
|
|
789
|
-
const r = e.
|
|
785
|
+
const r = e.V;
|
|
790
786
|
if (r & u) return;
|
|
791
|
-
if (t) e.
|
|
792
|
-
if (t && e.
|
|
793
|
-
let i = n ? e.
|
|
787
|
+
if (t) e.V = r | u;
|
|
788
|
+
if (t && e.oe) e.ke = null;
|
|
789
|
+
let i = n ? e.de : e.Ne;
|
|
794
790
|
while (i) {
|
|
795
|
-
const e = i.
|
|
796
|
-
if (i.
|
|
791
|
+
const e = i.Ce;
|
|
792
|
+
if (i.Se) {
|
|
797
793
|
const e = i;
|
|
798
|
-
deleteFromHeap(e, e.
|
|
799
|
-
let t = e.
|
|
794
|
+
deleteFromHeap(e, e.V & o ? T : L);
|
|
795
|
+
let t = e.Se;
|
|
800
796
|
do {
|
|
801
797
|
t = unlinkSubs(t);
|
|
802
798
|
} while (t !== null);
|
|
803
|
-
e.
|
|
799
|
+
e.Se = null;
|
|
804
800
|
e.Ee = null;
|
|
805
801
|
}
|
|
806
802
|
disposeChildren(i, true);
|
|
807
803
|
i = e;
|
|
808
804
|
}
|
|
809
805
|
if (n) {
|
|
810
|
-
e.
|
|
806
|
+
e.de = null;
|
|
811
807
|
} else {
|
|
812
|
-
e.
|
|
808
|
+
e.Ne = null;
|
|
813
809
|
e.je = 0;
|
|
814
810
|
}
|
|
815
|
-
if (t && !n && !(r & o) && e.
|
|
811
|
+
if (t && !n && !(r & o) && e.X !== null && !(e.X.V & u)) {
|
|
816
812
|
const t = e.We;
|
|
817
|
-
const n = e.
|
|
818
|
-
if (t !== null) t.
|
|
819
|
-
else e.
|
|
813
|
+
const n = e.Ce;
|
|
814
|
+
if (t !== null) t.Ce = n;
|
|
815
|
+
else e.X.Ne = n;
|
|
820
816
|
if (n !== null) n.We = t;
|
|
821
817
|
e.We = null;
|
|
822
818
|
}
|
|
823
819
|
runDisposal(e, n);
|
|
824
820
|
}
|
|
825
821
|
function runDisposal(e, t) {
|
|
826
|
-
let n = t ? e.
|
|
822
|
+
let n = t ? e.pe : e.Re;
|
|
827
823
|
if (!n) return;
|
|
828
824
|
if (Array.isArray(n)) {
|
|
829
825
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -833,11 +829,11 @@ function runDisposal(e, t) {
|
|
|
833
829
|
} else {
|
|
834
830
|
n.call(n);
|
|
835
831
|
}
|
|
836
|
-
t ? (e.
|
|
832
|
+
t ? (e.pe = null) : (e.Re = null);
|
|
837
833
|
}
|
|
838
834
|
function childId(e, t) {
|
|
839
835
|
let n = e;
|
|
840
|
-
while (n.
|
|
836
|
+
while (n.ue & h && n.X) n = n.X;
|
|
841
837
|
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
842
838
|
throw new Error("Cannot get child id from owner without an id");
|
|
843
839
|
}
|
|
@@ -853,53 +849,53 @@ function formatId(e, t) {
|
|
|
853
849
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
854
850
|
}
|
|
855
851
|
function getObserver() {
|
|
856
|
-
if ($ ||
|
|
857
|
-
return
|
|
852
|
+
if ($ || X) return B;
|
|
853
|
+
return z ? Y : null;
|
|
858
854
|
}
|
|
859
855
|
function getOwner() {
|
|
860
|
-
return
|
|
856
|
+
return Y;
|
|
861
857
|
}
|
|
862
858
|
function cleanup(e) {
|
|
863
|
-
if (!
|
|
864
|
-
if (!
|
|
865
|
-
else if (Array.isArray(
|
|
866
|
-
else
|
|
859
|
+
if (!Y) return e;
|
|
860
|
+
if (!Y.Re) Y.Re = e;
|
|
861
|
+
else if (Array.isArray(Y.Re)) Y.Re.push(e);
|
|
862
|
+
else Y.Re = [Y.Re, e];
|
|
867
863
|
return e;
|
|
868
864
|
}
|
|
869
865
|
function isDisposed(e) {
|
|
870
|
-
return !!(e.
|
|
866
|
+
return !!(e.V & (u | o));
|
|
871
867
|
}
|
|
872
868
|
function disposeRootSelf(e = true) {
|
|
873
869
|
disposeChildren(this, e);
|
|
874
870
|
}
|
|
875
871
|
function createOwner(e) {
|
|
876
|
-
const t =
|
|
872
|
+
const t = Y;
|
|
877
873
|
const n = e?.transparent ?? false;
|
|
878
874
|
const r = {
|
|
879
875
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
Ce: null,
|
|
876
|
+
ue: n ? h : 0,
|
|
877
|
+
me: true,
|
|
878
|
+
be: t?.me ? t.be : t,
|
|
884
879
|
Ne: null,
|
|
880
|
+
Ce: null,
|
|
885
881
|
We: null,
|
|
886
882
|
Re: null,
|
|
887
|
-
|
|
883
|
+
F: t?.F ?? K,
|
|
888
884
|
Ae: t?.Ae || k,
|
|
889
885
|
je: 0,
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
886
|
+
pe: null,
|
|
887
|
+
de: null,
|
|
888
|
+
X: t,
|
|
893
889
|
dispose: disposeRootSelf
|
|
894
890
|
};
|
|
895
891
|
if (t) {
|
|
896
|
-
const e = t.
|
|
892
|
+
const e = t.Ne;
|
|
897
893
|
if (e === null) {
|
|
898
|
-
t.
|
|
894
|
+
t.Ne = r;
|
|
899
895
|
} else {
|
|
900
|
-
r.
|
|
896
|
+
r.Ce = e;
|
|
901
897
|
e.We = r;
|
|
902
|
-
t.
|
|
898
|
+
t.Ne = r;
|
|
903
899
|
}
|
|
904
900
|
}
|
|
905
901
|
return r;
|
|
@@ -909,128 +905,128 @@ function createRoot(e, t) {
|
|
|
909
905
|
return runWithOwner(n, () => e(() => n.dispose()));
|
|
910
906
|
}
|
|
911
907
|
function unlinkSubs(e) {
|
|
912
|
-
const t = e.
|
|
913
|
-
const n = e.
|
|
914
|
-
const r = e.
|
|
908
|
+
const t = e.we;
|
|
909
|
+
const n = e.ge;
|
|
910
|
+
const r = e.L;
|
|
915
911
|
const i = e.Ie;
|
|
916
912
|
if (r !== null) r.Ie = i;
|
|
917
913
|
else t.Le = i;
|
|
918
|
-
if (i !== null) i.
|
|
914
|
+
if (i !== null) i.L = r;
|
|
919
915
|
else {
|
|
920
|
-
t.
|
|
916
|
+
t.R = r;
|
|
921
917
|
if (r === null) {
|
|
922
|
-
t.
|
|
918
|
+
t.I?.();
|
|
923
919
|
const e = t;
|
|
924
|
-
e.
|
|
920
|
+
e.oe && e.ue & g && !(e.V & o) && unobserved(e);
|
|
925
921
|
}
|
|
926
922
|
}
|
|
927
923
|
return n;
|
|
928
924
|
}
|
|
929
925
|
function trimStaleDeps(e) {
|
|
930
926
|
const t = e.Ee;
|
|
931
|
-
let n = t !== null ? t.
|
|
927
|
+
let n = t !== null ? t.ge : e.Se;
|
|
932
928
|
if (n !== null) {
|
|
933
929
|
do {
|
|
934
930
|
n = unlinkSubs(n);
|
|
935
931
|
} while (n !== null);
|
|
936
|
-
if (t !== null) t.
|
|
937
|
-
else e.
|
|
932
|
+
if (t !== null) t.ge = null;
|
|
933
|
+
else e.Se = null;
|
|
938
934
|
}
|
|
939
935
|
}
|
|
940
936
|
function unobserved(e) {
|
|
941
|
-
deleteFromHeap(e, e.
|
|
942
|
-
let t = e.
|
|
937
|
+
deleteFromHeap(e, e.V & o ? T : L);
|
|
938
|
+
let t = e.Se;
|
|
943
939
|
while (t !== null) {
|
|
944
940
|
t = unlinkSubs(t);
|
|
945
941
|
}
|
|
946
|
-
e.
|
|
942
|
+
e.Se = null;
|
|
947
943
|
e.Ee = null;
|
|
948
944
|
disposeChildren(e, true);
|
|
949
945
|
}
|
|
950
946
|
function link(e, t) {
|
|
951
947
|
const n = t.Ee;
|
|
952
|
-
if (n !== null && n.
|
|
948
|
+
if (n !== null && n.we === e) return;
|
|
953
949
|
let i = null;
|
|
954
|
-
const s = t.
|
|
950
|
+
const s = t.V & r;
|
|
955
951
|
if (s) {
|
|
956
|
-
i = n !== null ? n.
|
|
957
|
-
if (i !== null && i.
|
|
952
|
+
i = n !== null ? n.ge : t.Se;
|
|
953
|
+
if (i !== null && i.we === e) {
|
|
958
954
|
t.Ee = i;
|
|
959
955
|
return;
|
|
960
956
|
}
|
|
961
957
|
}
|
|
962
958
|
const o = e.Le;
|
|
963
|
-
if (o !== null && o.
|
|
964
|
-
const u = (t.Ee = e.Le = {
|
|
965
|
-
if (n !== null) n.
|
|
966
|
-
else t.
|
|
967
|
-
if (o !== null) o.
|
|
968
|
-
else e.
|
|
959
|
+
if (o !== null && o.T === t && (!s || isValidLink(o, t))) return;
|
|
960
|
+
const u = (t.Ee = e.Le = { we: e, T: t, ge: i, Ie: o, L: null });
|
|
961
|
+
if (n !== null) n.ge = u;
|
|
962
|
+
else t.Se = u;
|
|
963
|
+
if (o !== null) o.L = u;
|
|
964
|
+
else e.R = u;
|
|
969
965
|
}
|
|
970
966
|
function isValidLink(e, t) {
|
|
971
967
|
const n = t.Ee;
|
|
972
968
|
if (n !== null) {
|
|
973
|
-
let r = t.
|
|
969
|
+
let r = t.Se;
|
|
974
970
|
do {
|
|
975
971
|
if (r === e) return true;
|
|
976
972
|
if (r === n) break;
|
|
977
|
-
r = r.
|
|
973
|
+
r = r.ge;
|
|
978
974
|
} while (r !== null);
|
|
979
975
|
}
|
|
980
976
|
return false;
|
|
981
977
|
}
|
|
982
978
|
function addPendingSource(e, t) {
|
|
983
|
-
if (e.
|
|
984
|
-
if (!e.
|
|
985
|
-
e.
|
|
979
|
+
if (e.he === t || e.ye?.has(t)) return false;
|
|
980
|
+
if (!e.he) {
|
|
981
|
+
e.he = t;
|
|
986
982
|
return true;
|
|
987
983
|
}
|
|
988
|
-
if (!e.
|
|
989
|
-
e.
|
|
984
|
+
if (!e.ye) {
|
|
985
|
+
e.ye = new Set([e.he, t]);
|
|
990
986
|
} else {
|
|
991
|
-
e.
|
|
987
|
+
e.ye.add(t);
|
|
992
988
|
}
|
|
993
|
-
e.
|
|
989
|
+
e.he = undefined;
|
|
994
990
|
return true;
|
|
995
991
|
}
|
|
996
992
|
function removePendingSource(e, t) {
|
|
997
|
-
if (e.
|
|
998
|
-
if (e.
|
|
999
|
-
e.
|
|
993
|
+
if (e.he) {
|
|
994
|
+
if (e.he !== t) return false;
|
|
995
|
+
e.he = undefined;
|
|
1000
996
|
return true;
|
|
1001
997
|
}
|
|
1002
|
-
if (!e.
|
|
1003
|
-
if (e.
|
|
1004
|
-
e.
|
|
1005
|
-
e.
|
|
1006
|
-
} else if (e.
|
|
1007
|
-
e.
|
|
998
|
+
if (!e.ye?.delete(t)) return false;
|
|
999
|
+
if (e.ye.size === 1) {
|
|
1000
|
+
e.he = e.ye.values().next().value;
|
|
1001
|
+
e.ye = undefined;
|
|
1002
|
+
} else if (e.ye.size === 0) {
|
|
1003
|
+
e.ye = undefined;
|
|
1008
1004
|
}
|
|
1009
1005
|
return true;
|
|
1010
1006
|
}
|
|
1011
1007
|
function clearPendingSources(e) {
|
|
1012
|
-
e.
|
|
1013
|
-
e.
|
|
1014
|
-
e.
|
|
1008
|
+
e.he = undefined;
|
|
1009
|
+
e.ye?.clear();
|
|
1010
|
+
e.ye = undefined;
|
|
1015
1011
|
}
|
|
1016
1012
|
function setPendingError(e, t, n) {
|
|
1017
1013
|
if (!t) {
|
|
1018
|
-
e.
|
|
1014
|
+
e.fe = null;
|
|
1019
1015
|
return;
|
|
1020
1016
|
}
|
|
1021
1017
|
if (n instanceof NotReadyError && n.source === t) {
|
|
1022
|
-
e.
|
|
1018
|
+
e.fe = n;
|
|
1023
1019
|
return;
|
|
1024
1020
|
}
|
|
1025
|
-
const r = e.
|
|
1021
|
+
const r = e.fe;
|
|
1026
1022
|
if (!(r instanceof NotReadyError) || r.source !== t) {
|
|
1027
|
-
e.
|
|
1023
|
+
e.fe = new NotReadyError(t);
|
|
1028
1024
|
}
|
|
1029
1025
|
}
|
|
1030
1026
|
function forEachDependent(e, t) {
|
|
1031
|
-
for (let n = e.
|
|
1032
|
-
for (let n = e.
|
|
1033
|
-
for (let e = n.
|
|
1027
|
+
for (let n = e.R; n !== null; n = n.L) t(n.T);
|
|
1028
|
+
for (let n = e.Pe; n !== null; n = n.xe) {
|
|
1029
|
+
for (let e = n.R; e !== null; e = e.L) t(e.T);
|
|
1034
1030
|
}
|
|
1035
1031
|
}
|
|
1036
1032
|
function settlePendingSource(e) {
|
|
@@ -1039,25 +1035,25 @@ function settlePendingSource(e) {
|
|
|
1039
1035
|
const settle = r => {
|
|
1040
1036
|
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
1041
1037
|
n.add(r);
|
|
1042
|
-
r.
|
|
1043
|
-
const i = r.
|
|
1038
|
+
r.le = H;
|
|
1039
|
+
const i = r.he ?? r.ye?.values().next().value;
|
|
1044
1040
|
if (i) {
|
|
1045
1041
|
setPendingError(r, i);
|
|
1046
1042
|
updatePendingSignal(r);
|
|
1047
1043
|
} else {
|
|
1048
|
-
r.
|
|
1044
|
+
r.ae &= ~_;
|
|
1049
1045
|
setPendingError(r);
|
|
1050
1046
|
updatePendingSignal(r);
|
|
1051
1047
|
if (r.Te) {
|
|
1052
|
-
if (r
|
|
1048
|
+
if (r.H === P) {
|
|
1053
1049
|
const e = r;
|
|
1054
|
-
if (!e.
|
|
1055
|
-
e.
|
|
1056
|
-
e.
|
|
1050
|
+
if (!e.q) {
|
|
1051
|
+
e.q = true;
|
|
1052
|
+
e.F.enqueue(v, e.M);
|
|
1057
1053
|
}
|
|
1058
1054
|
} else {
|
|
1059
|
-
const e = r.
|
|
1060
|
-
if (e.
|
|
1055
|
+
const e = r.V & o ? T : L;
|
|
1056
|
+
if (e.N > r.D) e.N = r.D;
|
|
1061
1057
|
insertIntoHeap(r, e);
|
|
1062
1058
|
}
|
|
1063
1059
|
t = true;
|
|
@@ -1086,34 +1082,36 @@ function handleAsync(e, t, r) {
|
|
|
1086
1082
|
let o;
|
|
1087
1083
|
const handleError = n => {
|
|
1088
1084
|
if (e.ke !== t) return;
|
|
1089
|
-
|
|
1090
|
-
notifyStatus(e, n instanceof NotReadyError ?
|
|
1091
|
-
e.
|
|
1085
|
+
K.initTransition(resolveTransition(e));
|
|
1086
|
+
notifyStatus(e, n instanceof NotReadyError ? _ : m, n);
|
|
1087
|
+
e.le = H;
|
|
1092
1088
|
};
|
|
1093
1089
|
const asyncWrite = (i, s) => {
|
|
1094
1090
|
if (e.ke !== t) return;
|
|
1095
|
-
if (e.
|
|
1096
|
-
|
|
1097
|
-
const o = !!(e.
|
|
1091
|
+
if (e.V & (n | f)) return;
|
|
1092
|
+
K.initTransition(resolveTransition(e));
|
|
1093
|
+
const o = !!(e.ae & b);
|
|
1098
1094
|
trimStaleDeps(e);
|
|
1099
1095
|
clearStatus(e);
|
|
1100
1096
|
const u = resolveLane(e);
|
|
1101
|
-
if (u) u.
|
|
1102
|
-
if (r)
|
|
1103
|
-
|
|
1104
|
-
if (
|
|
1097
|
+
if (u) u.u.delete(e);
|
|
1098
|
+
if (r) {
|
|
1099
|
+
r(i);
|
|
1100
|
+
if (o) clearStatus(e, true);
|
|
1101
|
+
} else if (e.m !== undefined) {
|
|
1102
|
+
if (e.m !== undefined && e.m !== x) e.A = i;
|
|
1105
1103
|
else {
|
|
1106
|
-
e
|
|
1104
|
+
e.$ = i;
|
|
1107
1105
|
insertSubs(e);
|
|
1108
1106
|
}
|
|
1109
|
-
e.
|
|
1107
|
+
e.le = H;
|
|
1110
1108
|
} else if (u) {
|
|
1111
|
-
const t = e
|
|
1112
|
-
const n = e
|
|
1109
|
+
const t = e.H;
|
|
1110
|
+
const n = e.$;
|
|
1113
1111
|
const r = e.He;
|
|
1114
1112
|
if ((!t && o) || !r || !r(i, n)) {
|
|
1115
|
-
e
|
|
1116
|
-
e.
|
|
1113
|
+
e.$ = i;
|
|
1114
|
+
e.le = H;
|
|
1117
1115
|
if (e.qe) {
|
|
1118
1116
|
setSignal(e.qe, i);
|
|
1119
1117
|
}
|
|
@@ -1143,8 +1141,8 @@ function handleAsync(e, t, r) {
|
|
|
1143
1141
|
);
|
|
1144
1142
|
r = false;
|
|
1145
1143
|
if (!n) {
|
|
1146
|
-
|
|
1147
|
-
throw new NotReadyError(
|
|
1144
|
+
K.initTransition(resolveTransition(e));
|
|
1145
|
+
throw new NotReadyError(Y);
|
|
1148
1146
|
}
|
|
1149
1147
|
}
|
|
1150
1148
|
if (i) {
|
|
@@ -1164,10 +1162,10 @@ function handleAsync(e, t, r) {
|
|
|
1164
1162
|
const iterate = () => {
|
|
1165
1163
|
let s,
|
|
1166
1164
|
u = false,
|
|
1167
|
-
|
|
1165
|
+
f = true;
|
|
1168
1166
|
n.next().then(
|
|
1169
1167
|
n => {
|
|
1170
|
-
if (
|
|
1168
|
+
if (f) {
|
|
1171
1169
|
s = n;
|
|
1172
1170
|
u = true;
|
|
1173
1171
|
if (n.done) i = true;
|
|
@@ -1181,13 +1179,13 @@ function handleAsync(e, t, r) {
|
|
|
1181
1179
|
}
|
|
1182
1180
|
},
|
|
1183
1181
|
n => {
|
|
1184
|
-
if (!
|
|
1182
|
+
if (!f && e.ke === t) {
|
|
1185
1183
|
i = true;
|
|
1186
1184
|
handleError(n);
|
|
1187
1185
|
}
|
|
1188
1186
|
}
|
|
1189
1187
|
);
|
|
1190
|
-
|
|
1188
|
+
f = false;
|
|
1191
1189
|
if (u && !s.done) {
|
|
1192
1190
|
o = s.value;
|
|
1193
1191
|
r = true;
|
|
@@ -1197,49 +1195,49 @@ function handleAsync(e, t, r) {
|
|
|
1197
1195
|
};
|
|
1198
1196
|
const s = iterate();
|
|
1199
1197
|
if (!r && !s) {
|
|
1200
|
-
|
|
1201
|
-
throw new NotReadyError(
|
|
1198
|
+
K.initTransition(resolveTransition(e));
|
|
1199
|
+
throw new NotReadyError(Y);
|
|
1202
1200
|
}
|
|
1203
1201
|
}
|
|
1204
1202
|
return o;
|
|
1205
1203
|
}
|
|
1206
1204
|
function clearStatus(e, t = false) {
|
|
1207
|
-
if (e.
|
|
1205
|
+
if (e.he || e.ye) clearPendingSources(e);
|
|
1208
1206
|
if (e.Te) e.Te = false;
|
|
1209
|
-
e.
|
|
1210
|
-
if (e.
|
|
1207
|
+
e.ae = t ? 0 : e.ae & b;
|
|
1208
|
+
if (e.fe) setPendingError(e);
|
|
1211
1209
|
if (e.Qe) updatePendingSignal(e);
|
|
1212
1210
|
if (e.Fe) e.Fe();
|
|
1213
1211
|
}
|
|
1214
1212
|
function notifyStatus(e, t, n, r, i) {
|
|
1215
|
-
if (t ===
|
|
1213
|
+
if (t === m && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
1216
1214
|
n = new StatusError(e, n);
|
|
1217
|
-
const s = t ===
|
|
1215
|
+
const s = t === _ && n instanceof NotReadyError ? n.source : undefined;
|
|
1218
1216
|
const o = s === e;
|
|
1219
|
-
const u = t ===
|
|
1220
|
-
const
|
|
1217
|
+
const u = t === _ && e.m !== undefined && !o;
|
|
1218
|
+
const f = u && hasActiveOverride(e);
|
|
1221
1219
|
if (!r) {
|
|
1222
|
-
if (t ===
|
|
1220
|
+
if (t === _ && s) {
|
|
1223
1221
|
addPendingSource(e, s);
|
|
1224
|
-
e.
|
|
1222
|
+
e.ae = _ | (e.ae & b);
|
|
1225
1223
|
setPendingError(e, s, n);
|
|
1226
1224
|
} else {
|
|
1227
1225
|
clearPendingSources(e);
|
|
1228
|
-
e.
|
|
1229
|
-
e.
|
|
1226
|
+
e.ae = t | (t !== m ? e.ae & b : 0);
|
|
1227
|
+
e.fe = n;
|
|
1230
1228
|
}
|
|
1231
1229
|
updatePendingSignal(e);
|
|
1232
1230
|
}
|
|
1233
1231
|
if (i && !r) {
|
|
1234
1232
|
assignOrMergeLane(e, i);
|
|
1235
1233
|
}
|
|
1236
|
-
const
|
|
1234
|
+
const l = r || f;
|
|
1237
1235
|
const c = r || u ? undefined : i;
|
|
1238
1236
|
if (e.Fe) {
|
|
1239
|
-
if (r && t ===
|
|
1237
|
+
if (r && t === _) {
|
|
1240
1238
|
return;
|
|
1241
1239
|
}
|
|
1242
|
-
if (
|
|
1240
|
+
if (l) {
|
|
1243
1241
|
e.Fe(t, n);
|
|
1244
1242
|
} else {
|
|
1245
1243
|
e.Fe();
|
|
@@ -1247,22 +1245,22 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
1247
1245
|
return;
|
|
1248
1246
|
}
|
|
1249
1247
|
forEachDependent(e, e => {
|
|
1250
|
-
e.
|
|
1248
|
+
e.le = H;
|
|
1251
1249
|
if (
|
|
1252
|
-
(t ===
|
|
1253
|
-
(t !==
|
|
1250
|
+
(t === _ && s && e.he !== s && !e.ye?.has(s)) ||
|
|
1251
|
+
(t !== _ && (e.fe !== n || e.he || e.ye))
|
|
1254
1252
|
) {
|
|
1255
|
-
if (!
|
|
1256
|
-
notifyStatus(e, t, n,
|
|
1253
|
+
if (!l && !e.h) queuePendingNode(e);
|
|
1254
|
+
notifyStatus(e, t, n, l, c);
|
|
1257
1255
|
}
|
|
1258
1256
|
});
|
|
1259
1257
|
}
|
|
1260
|
-
let
|
|
1258
|
+
let G = null;
|
|
1261
1259
|
function enableExternalSource(e) {
|
|
1262
1260
|
const { factory: t, untrack: n = e => e() } = e;
|
|
1263
|
-
if (
|
|
1264
|
-
const { factory: e, untrack: r } =
|
|
1265
|
-
|
|
1261
|
+
if (G) {
|
|
1262
|
+
const { factory: e, untrack: r } = G;
|
|
1263
|
+
G = {
|
|
1266
1264
|
factory: (n, r) => {
|
|
1267
1265
|
const i = e(n, r);
|
|
1268
1266
|
const s = t(e => i.track(e), r);
|
|
@@ -1277,32 +1275,31 @@ function enableExternalSource(e) {
|
|
|
1277
1275
|
untrack: e => r(() => n(e))
|
|
1278
1276
|
};
|
|
1279
1277
|
} else {
|
|
1280
|
-
|
|
1278
|
+
G = { factory: t, untrack: n };
|
|
1281
1279
|
}
|
|
1282
1280
|
}
|
|
1283
|
-
GlobalQueue.
|
|
1284
|
-
GlobalQueue.
|
|
1285
|
-
let
|
|
1286
|
-
let
|
|
1287
|
-
let Z = false;
|
|
1281
|
+
GlobalQueue.te = recompute;
|
|
1282
|
+
GlobalQueue.ne = disposeChildren;
|
|
1283
|
+
let z = false;
|
|
1284
|
+
let U = false;
|
|
1288
1285
|
let $ = false;
|
|
1289
|
-
let
|
|
1286
|
+
let J = false;
|
|
1287
|
+
let X = false;
|
|
1288
|
+
let Y = null;
|
|
1289
|
+
let Z = null;
|
|
1290
|
+
let ee = null;
|
|
1290
1291
|
let te = false;
|
|
1291
1292
|
let ne = null;
|
|
1292
|
-
let re = null;
|
|
1293
|
-
let ie = false;
|
|
1294
|
-
let se = false;
|
|
1295
|
-
let oe = null;
|
|
1296
1293
|
function ownerInSnapshotScope(e) {
|
|
1297
1294
|
while (e) {
|
|
1298
1295
|
if (e.Me) return true;
|
|
1299
|
-
e = e.
|
|
1296
|
+
e = e.X;
|
|
1300
1297
|
}
|
|
1301
1298
|
return false;
|
|
1302
1299
|
}
|
|
1303
1300
|
function setSnapshotCapture(e) {
|
|
1304
|
-
|
|
1305
|
-
if (e && !
|
|
1301
|
+
te = e;
|
|
1302
|
+
if (e && !ne) ne = new Set();
|
|
1306
1303
|
}
|
|
1307
1304
|
function markSnapshotScope(e) {
|
|
1308
1305
|
e.Me = true;
|
|
@@ -1313,218 +1310,218 @@ function releaseSnapshotScope(e) {
|
|
|
1313
1310
|
schedule();
|
|
1314
1311
|
}
|
|
1315
1312
|
function releaseSubtree(e) {
|
|
1316
|
-
let t = e.
|
|
1313
|
+
let t = e.Ne;
|
|
1317
1314
|
while (t) {
|
|
1318
1315
|
if (t.Me) {
|
|
1319
|
-
t = t.
|
|
1316
|
+
t = t.Ce;
|
|
1320
1317
|
continue;
|
|
1321
1318
|
}
|
|
1322
|
-
if (t.
|
|
1319
|
+
if (t.oe) {
|
|
1323
1320
|
const e = t;
|
|
1324
|
-
e.
|
|
1325
|
-
if (e.
|
|
1326
|
-
e.
|
|
1327
|
-
e.
|
|
1328
|
-
if (
|
|
1329
|
-
insertIntoHeap(e,
|
|
1321
|
+
e.ue &= ~y;
|
|
1322
|
+
if (e.V & l) {
|
|
1323
|
+
e.V &= ~l;
|
|
1324
|
+
e.V |= n;
|
|
1325
|
+
if (L.N > e.D) L.N = e.D;
|
|
1326
|
+
insertIntoHeap(e, L);
|
|
1330
1327
|
}
|
|
1331
1328
|
}
|
|
1332
1329
|
releaseSubtree(t);
|
|
1333
|
-
t = t.
|
|
1330
|
+
t = t.Ce;
|
|
1334
1331
|
}
|
|
1335
1332
|
}
|
|
1336
1333
|
function clearSnapshots() {
|
|
1337
|
-
if (
|
|
1338
|
-
for (const e of
|
|
1339
|
-
delete e.
|
|
1340
|
-
delete e[
|
|
1334
|
+
if (ne) {
|
|
1335
|
+
for (const e of ne) {
|
|
1336
|
+
delete e.ce;
|
|
1337
|
+
delete e[C];
|
|
1341
1338
|
}
|
|
1342
|
-
|
|
1339
|
+
ne = null;
|
|
1343
1340
|
}
|
|
1344
|
-
|
|
1341
|
+
te = false;
|
|
1345
1342
|
}
|
|
1346
1343
|
function recompute(t, n = false) {
|
|
1347
|
-
const i = t
|
|
1344
|
+
const i = t.H;
|
|
1348
1345
|
if (!n) {
|
|
1349
|
-
if (t.
|
|
1350
|
-
deleteFromHeap(t, t.
|
|
1346
|
+
if (t.h && (!i || q) && q !== t.h) K.initTransition(t.h);
|
|
1347
|
+
deleteFromHeap(t, t.V & o ? T : L);
|
|
1351
1348
|
t.ke = null;
|
|
1352
|
-
if (t.
|
|
1353
|
-
else if (t.
|
|
1349
|
+
if (t.h || i === P) disposeChildren(t);
|
|
1350
|
+
else if (t.Ne !== null || t.Re !== null) {
|
|
1354
1351
|
markDisposal(t);
|
|
1355
|
-
t.
|
|
1356
|
-
t.
|
|
1352
|
+
t.pe = t.Re;
|
|
1353
|
+
t.de = t.Ne;
|
|
1357
1354
|
t.Re = null;
|
|
1358
|
-
t.
|
|
1355
|
+
t.Ne = null;
|
|
1359
1356
|
t.je = 0;
|
|
1360
1357
|
} else;
|
|
1361
1358
|
}
|
|
1362
|
-
let s = !!(t.
|
|
1363
|
-
const u = t.
|
|
1364
|
-
const c = !!(t.
|
|
1365
|
-
const a = !!(t.
|
|
1366
|
-
const d =
|
|
1367
|
-
|
|
1359
|
+
let s = !!(t.V & f);
|
|
1360
|
+
const u = t.m !== undefined && t.m !== x;
|
|
1361
|
+
const c = !!(t.ae & _);
|
|
1362
|
+
const a = !!(t.ae & b);
|
|
1363
|
+
const d = Y;
|
|
1364
|
+
Y = t;
|
|
1368
1365
|
t.Ee = null;
|
|
1369
|
-
t.
|
|
1370
|
-
t.
|
|
1371
|
-
let p = t.
|
|
1372
|
-
let h = t.
|
|
1373
|
-
let
|
|
1374
|
-
let S =
|
|
1375
|
-
|
|
1366
|
+
t.V = r;
|
|
1367
|
+
t.le = H;
|
|
1368
|
+
let p = t.A === x ? t.$ : t.A;
|
|
1369
|
+
let h = t.D;
|
|
1370
|
+
let y = z;
|
|
1371
|
+
let S = Z;
|
|
1372
|
+
z = true;
|
|
1376
1373
|
if (s) {
|
|
1377
1374
|
const e = resolveLane(t);
|
|
1378
|
-
if (e)
|
|
1379
|
-
} else if (
|
|
1380
|
-
for (let e = t.
|
|
1381
|
-
const n = e.
|
|
1382
|
-
if (n.
|
|
1375
|
+
if (e) Z = e;
|
|
1376
|
+
} else if (q && !n && q.j.length) {
|
|
1377
|
+
for (let e = t.Se; e; e = e.ge) {
|
|
1378
|
+
const n = e.we;
|
|
1379
|
+
if (n.V & f) {
|
|
1383
1380
|
const e = resolveLane(n);
|
|
1384
1381
|
if (e) {
|
|
1385
1382
|
s = true;
|
|
1386
|
-
|
|
1387
|
-
t.
|
|
1383
|
+
Z = e;
|
|
1384
|
+
t.V |= f;
|
|
1388
1385
|
assignOrMergeLane(t, e);
|
|
1389
1386
|
break;
|
|
1390
1387
|
}
|
|
1391
1388
|
}
|
|
1392
1389
|
}
|
|
1393
1390
|
}
|
|
1394
|
-
const
|
|
1395
|
-
const O =
|
|
1396
|
-
if (
|
|
1391
|
+
const g = i && i !== v;
|
|
1392
|
+
const O = U;
|
|
1393
|
+
if (g) U = true;
|
|
1397
1394
|
try {
|
|
1398
|
-
if (!false && t.
|
|
1399
|
-
p = t.
|
|
1395
|
+
if (!false && t.ue & w) {
|
|
1396
|
+
p = t.oe(p);
|
|
1400
1397
|
t.ke = null;
|
|
1401
1398
|
} else {
|
|
1402
1399
|
const e = t.ke;
|
|
1403
|
-
const n = t.
|
|
1400
|
+
const n = t.oe(p);
|
|
1404
1401
|
const r = typeof n === "object" && n !== null;
|
|
1405
1402
|
const i = t.ke !== e;
|
|
1406
1403
|
p = i || !r ? n : handleAsync(t, n);
|
|
1407
1404
|
if (!i && !r) t.ke = null;
|
|
1408
1405
|
}
|
|
1409
1406
|
clearStatus(t, n);
|
|
1410
|
-
if (t.
|
|
1407
|
+
if (t.i) {
|
|
1411
1408
|
const e = resolveLane(t);
|
|
1412
1409
|
if (e) {
|
|
1413
|
-
e.
|
|
1414
|
-
updatePendingSignal(e.
|
|
1410
|
+
e.u.delete(t);
|
|
1411
|
+
updatePendingSignal(e.o);
|
|
1415
1412
|
}
|
|
1416
1413
|
}
|
|
1417
1414
|
} catch (e) {
|
|
1418
|
-
if (e instanceof NotReadyError &&
|
|
1419
|
-
const e = findLane(
|
|
1420
|
-
if (e.
|
|
1421
|
-
e.
|
|
1422
|
-
t.
|
|
1423
|
-
updatePendingSignal(e.
|
|
1415
|
+
if (e instanceof NotReadyError && Z) {
|
|
1416
|
+
const e = findLane(Z);
|
|
1417
|
+
if (e.o !== t) {
|
|
1418
|
+
e.u.add(t);
|
|
1419
|
+
t.i = e;
|
|
1420
|
+
updatePendingSignal(e.o);
|
|
1424
1421
|
}
|
|
1425
1422
|
}
|
|
1426
1423
|
if (e instanceof NotReadyError) t.Te = true;
|
|
1427
1424
|
notifyStatus(
|
|
1428
1425
|
t,
|
|
1429
|
-
e instanceof NotReadyError ?
|
|
1426
|
+
e instanceof NotReadyError ? _ : m,
|
|
1430
1427
|
e,
|
|
1431
1428
|
undefined,
|
|
1432
|
-
e instanceof NotReadyError ? t.
|
|
1429
|
+
e instanceof NotReadyError ? t.i : undefined
|
|
1433
1430
|
);
|
|
1434
1431
|
} finally {
|
|
1435
|
-
|
|
1436
|
-
if (
|
|
1437
|
-
t.
|
|
1438
|
-
|
|
1432
|
+
z = y;
|
|
1433
|
+
if (g) U = O;
|
|
1434
|
+
t.V = e | (n ? t.V & l : 0);
|
|
1435
|
+
Y = d;
|
|
1439
1436
|
}
|
|
1440
|
-
if (!t.
|
|
1437
|
+
if (!t.fe) {
|
|
1441
1438
|
trimStaleDeps(t);
|
|
1442
|
-
const e = u ? t.
|
|
1439
|
+
const e = u ? t.m : t.A === x ? t.$ : t.A;
|
|
1443
1440
|
const r = (!i && a) || !t.He || !t.He(e, p);
|
|
1444
1441
|
if (i && r) {
|
|
1445
|
-
t.
|
|
1446
|
-
if (!n) t.
|
|
1442
|
+
t.q = !t.fe;
|
|
1443
|
+
if (!n) t.F.enqueue(i, GlobalQueue.re.bind(null, t));
|
|
1447
1444
|
}
|
|
1448
1445
|
if (r) {
|
|
1449
|
-
const e = u ? t.
|
|
1450
|
-
if (n || (i &&
|
|
1451
|
-
t
|
|
1446
|
+
const e = u ? t.m : undefined;
|
|
1447
|
+
if (n || (i && q !== t.h) || s) {
|
|
1448
|
+
t.$ = p;
|
|
1452
1449
|
if (u && s) {
|
|
1453
|
-
t.
|
|
1454
|
-
t.
|
|
1450
|
+
t.m = p;
|
|
1451
|
+
t.A = p;
|
|
1455
1452
|
}
|
|
1456
|
-
} else t.
|
|
1457
|
-
if (u && !s && c && !t.
|
|
1458
|
-
if (!u || s || t.
|
|
1453
|
+
} else t.A = p;
|
|
1454
|
+
if (u && !s && c && !t._) t.m = p;
|
|
1455
|
+
if (!u || s || t.m !== e) insertSubs(t, s || u);
|
|
1459
1456
|
} else if (u) {
|
|
1460
|
-
t.
|
|
1461
|
-
} else if (t.
|
|
1462
|
-
for (let e = t.
|
|
1463
|
-
insertIntoHeapHeight(e.
|
|
1457
|
+
t.A = p;
|
|
1458
|
+
} else if (t.D != h) {
|
|
1459
|
+
for (let e = t.R; e !== null; e = e.L) {
|
|
1460
|
+
insertIntoHeapHeight(e.T, e.T.V & o ? T : L);
|
|
1464
1461
|
}
|
|
1465
1462
|
}
|
|
1466
1463
|
}
|
|
1467
|
-
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
t.
|
|
1464
|
+
Z = S;
|
|
1465
|
+
const N = t.A !== x || t.de !== null || t.pe !== null || !!(t.ae & (_ | b));
|
|
1466
|
+
N && (!n || t.ae & _) && !t.h && !(q && u) && queuePendingNode(t);
|
|
1467
|
+
t.h && i && q !== t.h && runInTransition(t.h, () => recompute(t));
|
|
1471
1468
|
}
|
|
1472
1469
|
function updateIfNecessary(e) {
|
|
1473
|
-
if (e.
|
|
1474
|
-
for (let t = e.
|
|
1475
|
-
const r = t.
|
|
1476
|
-
const i = r.
|
|
1477
|
-
if (i.
|
|
1470
|
+
if (e.V & t) {
|
|
1471
|
+
for (let t = e.Se; t; t = t.ge) {
|
|
1472
|
+
const r = t.we;
|
|
1473
|
+
const i = r._e || r;
|
|
1474
|
+
if (i.oe) {
|
|
1478
1475
|
updateIfNecessary(i);
|
|
1479
1476
|
}
|
|
1480
|
-
if (e.
|
|
1477
|
+
if (e.V & n) {
|
|
1481
1478
|
break;
|
|
1482
1479
|
}
|
|
1483
1480
|
}
|
|
1484
1481
|
}
|
|
1485
|
-
if (e.
|
|
1482
|
+
if (e.V & (n | f) || (e.fe && e.le < H && !e.ke)) {
|
|
1486
1483
|
recompute(e);
|
|
1487
1484
|
}
|
|
1488
|
-
e.
|
|
1485
|
+
e.V = e.V & (l | i | s);
|
|
1489
1486
|
}
|
|
1490
1487
|
function computed(t, n) {
|
|
1491
1488
|
const r = n?.transparent ?? false;
|
|
1492
1489
|
const i = {
|
|
1493
|
-
id: n?.id ?? (r ?
|
|
1494
|
-
|
|
1490
|
+
id: n?.id ?? (r ? Y?.id : Y?.id != null ? getNextChildId(Y) : undefined),
|
|
1491
|
+
ue:
|
|
1495
1492
|
(r ? h : 0) |
|
|
1496
1493
|
(n?.ownedWrite ? d : 0) |
|
|
1497
|
-
(!
|
|
1494
|
+
(!Y || n?.lazy ? g : 0) |
|
|
1498
1495
|
(n?.sync ? w : 0) |
|
|
1499
|
-
(
|
|
1496
|
+
(te && ownerInSnapshotScope(Y) ? y : 0),
|
|
1500
1497
|
He: n?.equals != null ? n.equals : isEqual,
|
|
1501
|
-
|
|
1498
|
+
I: n?.unobserved,
|
|
1502
1499
|
Re: null,
|
|
1503
|
-
|
|
1504
|
-
Ae:
|
|
1500
|
+
F: Y?.F ?? K,
|
|
1501
|
+
Ae: Y?.Ae ?? k,
|
|
1505
1502
|
je: 0,
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1503
|
+
oe: t,
|
|
1504
|
+
$: undefined,
|
|
1505
|
+
D: 0,
|
|
1506
|
+
Pe: null,
|
|
1507
|
+
ve: undefined,
|
|
1508
|
+
Oe: null,
|
|
1509
|
+
Se: null,
|
|
1513
1510
|
Ee: null,
|
|
1514
|
-
|
|
1511
|
+
R: null,
|
|
1515
1512
|
Le: null,
|
|
1516
|
-
|
|
1517
|
-
Ne: null,
|
|
1518
|
-
We: null,
|
|
1513
|
+
X: Y,
|
|
1519
1514
|
Ce: null,
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1515
|
+
We: null,
|
|
1516
|
+
Ne: null,
|
|
1517
|
+
V: n?.lazy ? c : e,
|
|
1518
|
+
ae: b,
|
|
1519
|
+
le: H,
|
|
1520
|
+
A: x,
|
|
1521
|
+
pe: null,
|
|
1522
|
+
de: null,
|
|
1526
1523
|
ke: null,
|
|
1527
|
-
|
|
1524
|
+
h: null
|
|
1528
1525
|
};
|
|
1529
1526
|
setupComputedNode(i, n);
|
|
1530
1527
|
return i;
|
|
@@ -1532,321 +1529,337 @@ function computed(t, n) {
|
|
|
1532
1529
|
function createEffectNode(e, t, n, r, i, s) {
|
|
1533
1530
|
const o = s?.transparent ?? false;
|
|
1534
1531
|
const u = {
|
|
1535
|
-
id: s?.id ?? (o ?
|
|
1536
|
-
|
|
1532
|
+
id: s?.id ?? (o ? Y?.id : Y?.id != null ? getNextChildId(Y) : undefined),
|
|
1533
|
+
ue:
|
|
1537
1534
|
(o ? h : 0) |
|
|
1538
1535
|
(s?.ownedWrite ? d : 0) |
|
|
1539
1536
|
(s?.sync ? w : 0) |
|
|
1540
|
-
(
|
|
1537
|
+
(te && ownerInSnapshotScope(Y) ? y : 0),
|
|
1541
1538
|
He: false,
|
|
1542
|
-
|
|
1539
|
+
I: s?.unobserved,
|
|
1543
1540
|
Re: null,
|
|
1544
|
-
|
|
1545
|
-
Ae:
|
|
1541
|
+
F: Y?.F ?? K,
|
|
1542
|
+
Ae: Y?.Ae ?? k,
|
|
1546
1543
|
je: 0,
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1544
|
+
oe: e,
|
|
1545
|
+
$: undefined,
|
|
1546
|
+
D: 0,
|
|
1547
|
+
Pe: null,
|
|
1548
|
+
ve: undefined,
|
|
1549
|
+
Oe: null,
|
|
1550
|
+
Se: null,
|
|
1554
1551
|
Ee: null,
|
|
1555
|
-
|
|
1552
|
+
R: null,
|
|
1556
1553
|
Le: null,
|
|
1557
|
-
|
|
1558
|
-
Ne: null,
|
|
1559
|
-
We: null,
|
|
1554
|
+
X: Y,
|
|
1560
1555
|
Ce: null,
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1556
|
+
We: null,
|
|
1557
|
+
Ne: null,
|
|
1558
|
+
V: c,
|
|
1559
|
+
ae: b,
|
|
1560
|
+
le: H,
|
|
1561
|
+
A: x,
|
|
1562
|
+
pe: null,
|
|
1563
|
+
de: null,
|
|
1567
1564
|
ke: null,
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1565
|
+
h: null,
|
|
1566
|
+
q: false,
|
|
1567
|
+
Ve: undefined,
|
|
1568
|
+
De: t,
|
|
1572
1569
|
Ke: n,
|
|
1573
1570
|
Be: undefined,
|
|
1574
1571
|
Ge: false,
|
|
1575
|
-
|
|
1572
|
+
H: r,
|
|
1576
1573
|
Fe: i
|
|
1577
1574
|
};
|
|
1578
|
-
setupComputedNode(u,
|
|
1575
|
+
setupComputedNode(u, re);
|
|
1579
1576
|
return u;
|
|
1580
1577
|
}
|
|
1581
|
-
const
|
|
1578
|
+
const re = { lazy: true };
|
|
1582
1579
|
function setupComputedNode(e, t) {
|
|
1583
|
-
e.
|
|
1584
|
-
const n =
|
|
1585
|
-
if (
|
|
1586
|
-
const t =
|
|
1580
|
+
e.Oe = e;
|
|
1581
|
+
const n = Y?.me ? Y.be : Y;
|
|
1582
|
+
if (Y) {
|
|
1583
|
+
const t = Y.Ne;
|
|
1587
1584
|
if (t === null) {
|
|
1588
|
-
|
|
1585
|
+
Y.Ne = e;
|
|
1589
1586
|
} else {
|
|
1590
|
-
e.
|
|
1587
|
+
e.Ce = t;
|
|
1591
1588
|
t.We = e;
|
|
1592
|
-
|
|
1589
|
+
Y.Ne = e;
|
|
1593
1590
|
}
|
|
1594
1591
|
}
|
|
1595
|
-
if (n) e.
|
|
1596
|
-
if (
|
|
1592
|
+
if (n) e.D = n.D + 1;
|
|
1593
|
+
if (G) {
|
|
1597
1594
|
const t = signal(undefined, { equals: false, ownedWrite: true });
|
|
1598
|
-
const n =
|
|
1595
|
+
const n = G.factory(e.oe, () => {
|
|
1599
1596
|
setSignal(t, undefined);
|
|
1600
1597
|
});
|
|
1601
1598
|
cleanup(() => n.dispose());
|
|
1602
|
-
e.
|
|
1599
|
+
e.oe = e => {
|
|
1603
1600
|
read(t);
|
|
1604
1601
|
return n.track(e);
|
|
1605
1602
|
};
|
|
1606
1603
|
}
|
|
1607
1604
|
!t?.lazy && recompute(e, true);
|
|
1608
|
-
if (
|
|
1609
|
-
if (!(e.
|
|
1610
|
-
e.
|
|
1611
|
-
|
|
1605
|
+
if (te && !t?.lazy) {
|
|
1606
|
+
if (!(e.ae & _)) {
|
|
1607
|
+
e.ce = e.$ === undefined ? N : e.$;
|
|
1608
|
+
ne.add(e);
|
|
1612
1609
|
}
|
|
1613
1610
|
}
|
|
1614
1611
|
}
|
|
1615
1612
|
function signal(e, t, n = null) {
|
|
1616
1613
|
const r = {
|
|
1617
1614
|
He: t?.equals != null ? t.equals : isEqual,
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1615
|
+
ue: (t?.ownedWrite ? d : 0) | (t?.ze ? p : 0),
|
|
1616
|
+
I: t?.unobserved,
|
|
1617
|
+
$: e,
|
|
1618
|
+
R: null,
|
|
1622
1619
|
Le: null,
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1620
|
+
le: H,
|
|
1621
|
+
_e: n,
|
|
1622
|
+
xe: n?.Pe || null,
|
|
1623
|
+
A: x
|
|
1627
1624
|
};
|
|
1628
|
-
n && (n.
|
|
1629
|
-
if (
|
|
1630
|
-
r.
|
|
1631
|
-
|
|
1625
|
+
n && (n.Pe = r);
|
|
1626
|
+
if (te && !(r.ue & p) && !((n?.ae ?? 0) & _)) {
|
|
1627
|
+
r.ce = e === undefined ? N : e;
|
|
1628
|
+
ne.add(r);
|
|
1632
1629
|
}
|
|
1633
1630
|
return r;
|
|
1634
1631
|
}
|
|
1635
1632
|
function optimisticSignal(e, t) {
|
|
1636
1633
|
const n = signal(e, t);
|
|
1637
|
-
n.
|
|
1634
|
+
n.m = x;
|
|
1638
1635
|
return n;
|
|
1639
1636
|
}
|
|
1640
1637
|
function optimisticComputed(e, t) {
|
|
1641
1638
|
const n = computed(e, t);
|
|
1642
|
-
n.
|
|
1639
|
+
n.m = x;
|
|
1643
1640
|
return n;
|
|
1644
1641
|
}
|
|
1645
1642
|
function isEqual(e, t) {
|
|
1646
1643
|
return e === t;
|
|
1647
1644
|
}
|
|
1648
1645
|
function untrack(e, t) {
|
|
1649
|
-
if (!
|
|
1650
|
-
const n =
|
|
1651
|
-
|
|
1646
|
+
if (!G && !z && true) return e();
|
|
1647
|
+
const n = z;
|
|
1648
|
+
z = false;
|
|
1652
1649
|
try {
|
|
1653
|
-
if (
|
|
1650
|
+
if (G) return G.untrack(e);
|
|
1654
1651
|
return e();
|
|
1655
1652
|
} finally {
|
|
1656
|
-
|
|
1653
|
+
z = n;
|
|
1657
1654
|
}
|
|
1658
1655
|
}
|
|
1659
1656
|
function read(e) {
|
|
1660
|
-
if (
|
|
1657
|
+
if (X) {
|
|
1661
1658
|
const t = getLatestValueComputed(e);
|
|
1662
|
-
const n =
|
|
1663
|
-
|
|
1664
|
-
const r = e.
|
|
1659
|
+
const n = X;
|
|
1660
|
+
X = false;
|
|
1661
|
+
const r = e.m !== undefined && e.m !== x ? e.m : e.$;
|
|
1665
1662
|
let i;
|
|
1666
1663
|
try {
|
|
1667
1664
|
i = read(t);
|
|
1668
1665
|
} catch (e) {
|
|
1669
|
-
if (!
|
|
1666
|
+
if (!Y && e instanceof NotReadyError) return r;
|
|
1670
1667
|
throw e;
|
|
1671
1668
|
} finally {
|
|
1672
|
-
|
|
1669
|
+
X = n;
|
|
1673
1670
|
}
|
|
1674
|
-
if (t.
|
|
1675
|
-
if (
|
|
1676
|
-
const e = findLane(t.
|
|
1677
|
-
const n = findLane(
|
|
1678
|
-
if (e !== n && e.
|
|
1671
|
+
if (t.ae & _) return r;
|
|
1672
|
+
if (U && Z && t.i) {
|
|
1673
|
+
const e = findLane(t.i);
|
|
1674
|
+
const n = findLane(Z);
|
|
1675
|
+
if (e !== n && e.u.size > 0) {
|
|
1679
1676
|
return r;
|
|
1680
1677
|
}
|
|
1681
1678
|
}
|
|
1682
1679
|
return i;
|
|
1683
1680
|
}
|
|
1684
1681
|
if ($) {
|
|
1685
|
-
const t = e.
|
|
1682
|
+
const t = e._e;
|
|
1686
1683
|
const n = $;
|
|
1687
1684
|
$ = false;
|
|
1688
|
-
|
|
1689
|
-
if (
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1685
|
+
let r = Y;
|
|
1686
|
+
if (r?.me) r = r.be;
|
|
1687
|
+
const i = t || e;
|
|
1688
|
+
const s = e;
|
|
1689
|
+
if (typeof s.oe === "function") {
|
|
1690
|
+
const t = e;
|
|
1691
|
+
if (t.V & c) {
|
|
1692
|
+
t.V &= ~c;
|
|
1693
|
+
recompute(t, true);
|
|
1694
|
+
} else if (t.V & u) {
|
|
1695
|
+
recompute(t, true);
|
|
1696
|
+
} else {
|
|
1697
|
+
updateIfNecessary(t);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
if (r && i.ae & _ && i.ae & b) {
|
|
1701
|
+
if (z && e !== r) link(e, r);
|
|
1693
1702
|
$ = n;
|
|
1694
|
-
throw
|
|
1703
|
+
throw i.fe;
|
|
1695
1704
|
}
|
|
1696
|
-
if (t && e.
|
|
1697
|
-
if (e.
|
|
1698
|
-
|
|
1705
|
+
if (t && e.m !== undefined) {
|
|
1706
|
+
if (e.m !== x && (t.ke || !!(t.ae & _))) {
|
|
1707
|
+
J = true;
|
|
1699
1708
|
}
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
if (
|
|
1703
|
-
read(getPendingSignal(e));
|
|
1704
|
-
read(getPendingSignal(t));
|
|
1709
|
+
collectPendingSources(e);
|
|
1710
|
+
collectPendingSources(t);
|
|
1711
|
+
if (r && z) link(e, r);
|
|
1705
1712
|
} else {
|
|
1706
|
-
|
|
1707
|
-
if (t
|
|
1713
|
+
collectPendingSources(e);
|
|
1714
|
+
if (t) collectPendingSources(t);
|
|
1708
1715
|
}
|
|
1709
1716
|
$ = n;
|
|
1710
|
-
return e.ue;
|
|
1711
1717
|
}
|
|
1712
|
-
let t =
|
|
1713
|
-
if (t?.
|
|
1718
|
+
let t = Y;
|
|
1719
|
+
if (t?.me) t = t.be;
|
|
1714
1720
|
const n = e;
|
|
1715
|
-
if (typeof n.
|
|
1721
|
+
if (typeof n.oe === "function") {
|
|
1716
1722
|
const t = e;
|
|
1717
|
-
if (t.
|
|
1718
|
-
t.
|
|
1723
|
+
if (t.V & c) {
|
|
1724
|
+
t.V &= ~c;
|
|
1719
1725
|
recompute(t, true);
|
|
1720
|
-
} else if (t.
|
|
1726
|
+
} else if (t.V & u) {
|
|
1721
1727
|
recompute(t, true);
|
|
1722
1728
|
}
|
|
1723
1729
|
}
|
|
1724
|
-
const r = e.
|
|
1730
|
+
const r = e._e || e;
|
|
1725
1731
|
if (
|
|
1726
|
-
!n.
|
|
1732
|
+
!n.oe &&
|
|
1727
1733
|
r === e &&
|
|
1728
|
-
e.
|
|
1729
|
-
e.
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
!
|
|
1734
|
+
e.m === undefined &&
|
|
1735
|
+
e.ce === undefined &&
|
|
1736
|
+
q === null &&
|
|
1737
|
+
Z === null &&
|
|
1738
|
+
!te &&
|
|
1733
1739
|
true
|
|
1734
1740
|
) {
|
|
1735
|
-
if (t &&
|
|
1736
|
-
return !t || e.
|
|
1741
|
+
if (t && z) link(e, t);
|
|
1742
|
+
return !t || e.A === x ? e.$ : e.A;
|
|
1737
1743
|
}
|
|
1738
|
-
if (t &&
|
|
1744
|
+
if (t && z) {
|
|
1739
1745
|
link(e, t);
|
|
1740
|
-
if (r.
|
|
1741
|
-
const n = e.
|
|
1742
|
-
if (r.
|
|
1746
|
+
if (r.oe) {
|
|
1747
|
+
const n = e.V & o;
|
|
1748
|
+
if (r.D >= (n ? T.N : L.N)) {
|
|
1743
1749
|
markNode(t);
|
|
1744
|
-
markHeap(n ?
|
|
1750
|
+
markHeap(n ? T : L);
|
|
1745
1751
|
updateIfNecessary(r);
|
|
1746
1752
|
}
|
|
1747
|
-
const i = r.
|
|
1748
|
-
if (i >= t.
|
|
1749
|
-
t.
|
|
1753
|
+
const i = r.D;
|
|
1754
|
+
if (i >= t.D && e.X !== t) {
|
|
1755
|
+
t.D = i + 1;
|
|
1750
1756
|
}
|
|
1751
1757
|
}
|
|
1752
1758
|
}
|
|
1753
|
-
if (r.
|
|
1754
|
-
if (t && !(
|
|
1755
|
-
if (
|
|
1756
|
-
const n = r.
|
|
1757
|
-
const i = findLane(
|
|
1759
|
+
if (r.ae & _) {
|
|
1760
|
+
if (t && !(U && r.h && q !== r.h)) {
|
|
1761
|
+
if (Z) {
|
|
1762
|
+
const n = r.i;
|
|
1763
|
+
const i = findLane(Z);
|
|
1758
1764
|
if (n && findLane(n) === i && !hasActiveOverride(r)) {
|
|
1759
|
-
if (!
|
|
1760
|
-
throw r.
|
|
1765
|
+
if (!z && e !== t) link(e, t);
|
|
1766
|
+
throw r.fe;
|
|
1761
1767
|
}
|
|
1762
1768
|
} else {
|
|
1763
|
-
if (!
|
|
1764
|
-
throw r.
|
|
1769
|
+
if (!z && e !== t) link(e, t);
|
|
1770
|
+
throw r.fe;
|
|
1765
1771
|
}
|
|
1766
|
-
} else if (t && r !== e && r.
|
|
1767
|
-
if (!
|
|
1768
|
-
throw r.
|
|
1769
|
-
} else if (!t && r.
|
|
1770
|
-
throw r.
|
|
1772
|
+
} else if (t && r !== e && r.ae & b) {
|
|
1773
|
+
if (!z && e !== t) link(e, t);
|
|
1774
|
+
throw r.fe;
|
|
1775
|
+
} else if (!t && r.ae & b) {
|
|
1776
|
+
throw r.fe;
|
|
1771
1777
|
}
|
|
1772
1778
|
}
|
|
1773
|
-
if (e.
|
|
1774
|
-
if (e.
|
|
1779
|
+
if (e.oe && e.ae & m) {
|
|
1780
|
+
if (e.le < H) {
|
|
1775
1781
|
recompute(e);
|
|
1776
1782
|
return read(e);
|
|
1777
|
-
} else throw e.
|
|
1783
|
+
} else throw e.fe;
|
|
1778
1784
|
}
|
|
1779
|
-
if (
|
|
1780
|
-
const n = e.
|
|
1785
|
+
if (te && t && t.ue & y) {
|
|
1786
|
+
const n = e.ce;
|
|
1781
1787
|
if (n !== undefined) {
|
|
1782
|
-
const r = n ===
|
|
1783
|
-
const i = e.
|
|
1784
|
-
if (i !== r) t.
|
|
1788
|
+
const r = n === N ? undefined : n;
|
|
1789
|
+
const i = e.A !== x ? e.A : e.$;
|
|
1790
|
+
if (i !== r) t.V |= l;
|
|
1785
1791
|
return r;
|
|
1786
1792
|
}
|
|
1787
1793
|
}
|
|
1788
|
-
if (e.
|
|
1789
|
-
if (t &&
|
|
1790
|
-
return e.
|
|
1794
|
+
if (e.m !== undefined && e.m !== x) {
|
|
1795
|
+
if (t && U && shouldReadStashedOptimisticValue(e)) return e.$;
|
|
1796
|
+
return e.m;
|
|
1791
1797
|
}
|
|
1792
|
-
if (
|
|
1793
|
-
|
|
1794
|
-
return e
|
|
1798
|
+
if (q !== null && Z !== null && !X && e.A !== x && (r === e || !!(r.V & a)) && !e.oe && t) {
|
|
1799
|
+
q.U.add(t);
|
|
1800
|
+
return e.$;
|
|
1795
1801
|
}
|
|
1796
1802
|
const i =
|
|
1797
1803
|
!t ||
|
|
1798
|
-
(
|
|
1799
|
-
e.
|
|
1800
|
-
(
|
|
1801
|
-
? e
|
|
1802
|
-
: e.
|
|
1803
|
-
if (!t && r === e && typeof n.
|
|
1804
|
+
(Z !== null && (e.m !== undefined || e.i || (r === e && U) || !!(r.ae & _))) ||
|
|
1805
|
+
e.A === x ||
|
|
1806
|
+
(U && e.h && q !== e.h)
|
|
1807
|
+
? e.$
|
|
1808
|
+
: e.A;
|
|
1809
|
+
if (!t && r === e && typeof n.oe === "function" && e.ue & g && !(r.ae & _) && !e.R) {
|
|
1804
1810
|
unobserved(e);
|
|
1805
1811
|
}
|
|
1806
1812
|
return i;
|
|
1807
1813
|
}
|
|
1808
1814
|
function setSignal(e, t) {
|
|
1809
|
-
if (e.
|
|
1810
|
-
const n = e.
|
|
1811
|
-
const r = e.
|
|
1812
|
-
const i = n ? (r ? e.
|
|
1815
|
+
if (e.h && q !== e.h) K.initTransition(e.h);
|
|
1816
|
+
const n = e.m !== undefined && !M;
|
|
1817
|
+
const r = e.m !== undefined && e.m !== x;
|
|
1818
|
+
const i = n ? (r ? e.m : e.$) : e.A === x ? e.$ : e.A;
|
|
1813
1819
|
if (typeof t === "function") t = t(i);
|
|
1814
|
-
const s = !e.He || !e.He(i, t) || !!(e.
|
|
1820
|
+
const s = !e.He || !e.He(i, t) || !!(e.ae & b);
|
|
1815
1821
|
if (!s) {
|
|
1816
|
-
if (n && r
|
|
1817
|
-
|
|
1818
|
-
|
|
1822
|
+
if (n && r) {
|
|
1823
|
+
const t = resolveTransition(e);
|
|
1824
|
+
if (t && q !== t) K.initTransition(t);
|
|
1825
|
+
if (e.oe) {
|
|
1826
|
+
insertSubs(e, true);
|
|
1827
|
+
schedule();
|
|
1828
|
+
}
|
|
1819
1829
|
}
|
|
1820
1830
|
return t;
|
|
1821
1831
|
}
|
|
1822
1832
|
if (n) {
|
|
1823
|
-
const n = e.
|
|
1824
|
-
if (!n)
|
|
1833
|
+
const n = e.m === x;
|
|
1834
|
+
if (!n) K.initTransition(resolveTransition(e));
|
|
1825
1835
|
if (n) {
|
|
1826
|
-
e.
|
|
1827
|
-
|
|
1836
|
+
e.A = e.$;
|
|
1837
|
+
K.j.push(e);
|
|
1828
1838
|
}
|
|
1829
|
-
e.
|
|
1839
|
+
e._ = true;
|
|
1830
1840
|
const r = getOrCreateLane(e);
|
|
1831
|
-
e.
|
|
1832
|
-
e.
|
|
1841
|
+
e.i = r;
|
|
1842
|
+
e.m = t;
|
|
1833
1843
|
} else {
|
|
1834
|
-
if (e.
|
|
1835
|
-
e.
|
|
1844
|
+
if (e.A === x) queuePendingNode(e);
|
|
1845
|
+
e.A = t;
|
|
1836
1846
|
}
|
|
1837
1847
|
if (e.Qe) updatePendingSignal(e);
|
|
1838
1848
|
if (e.qe) {
|
|
1839
1849
|
setSignal(e.qe, t);
|
|
1840
1850
|
}
|
|
1841
|
-
e.
|
|
1851
|
+
e.le = H;
|
|
1842
1852
|
insertSubs(e, n);
|
|
1843
1853
|
schedule();
|
|
1844
1854
|
return t;
|
|
1845
1855
|
}
|
|
1846
1856
|
function suppressComputedRecompute(e) {
|
|
1847
|
-
deleteFromHeap(e, e.
|
|
1848
|
-
if (!(e.
|
|
1849
|
-
|
|
1857
|
+
deleteFromHeap(e, e.V & o ? T : L);
|
|
1858
|
+
if (!(e.V & a) && e.A === x) {
|
|
1859
|
+
queuePendingNode(e);
|
|
1860
|
+
schedule();
|
|
1861
|
+
}
|
|
1862
|
+
e.V = (e.V & -4) | a;
|
|
1850
1863
|
}
|
|
1851
1864
|
function setMemo(e, t) {
|
|
1852
1865
|
const n = setSignal(e, t);
|
|
@@ -1854,137 +1867,153 @@ function setMemo(e, t) {
|
|
|
1854
1867
|
return n;
|
|
1855
1868
|
}
|
|
1856
1869
|
function runWithOwner(e, t) {
|
|
1857
|
-
const n =
|
|
1858
|
-
const r =
|
|
1859
|
-
|
|
1860
|
-
|
|
1870
|
+
const n = Y;
|
|
1871
|
+
const r = z;
|
|
1872
|
+
Y = e;
|
|
1873
|
+
z = false;
|
|
1861
1874
|
try {
|
|
1862
1875
|
return t();
|
|
1863
1876
|
} finally {
|
|
1864
|
-
|
|
1865
|
-
|
|
1877
|
+
Y = n;
|
|
1878
|
+
z = r;
|
|
1866
1879
|
}
|
|
1867
1880
|
}
|
|
1868
1881
|
function getPendingSignal(e) {
|
|
1869
1882
|
if (!e.Qe) {
|
|
1870
1883
|
e.Qe = optimisticSignal(false, { ownedWrite: true });
|
|
1871
|
-
if (e.
|
|
1872
|
-
e.Qe.
|
|
1884
|
+
if (e.t) {
|
|
1885
|
+
e.Qe.t = e;
|
|
1873
1886
|
}
|
|
1874
1887
|
if (computePendingState(e)) setSignal(e.Qe, true);
|
|
1875
1888
|
}
|
|
1876
1889
|
return e.Qe;
|
|
1877
1890
|
}
|
|
1891
|
+
function collectPendingSources(e) {
|
|
1892
|
+
ee?.add(e);
|
|
1893
|
+
const t = e._e || e;
|
|
1894
|
+
if (t !== e) ee?.add(t);
|
|
1895
|
+
}
|
|
1878
1896
|
function computePendingState(e) {
|
|
1879
1897
|
const t = e;
|
|
1880
|
-
const n = e.
|
|
1881
|
-
if (
|
|
1882
|
-
|
|
1898
|
+
const n = e._e;
|
|
1899
|
+
if (e.t) {
|
|
1900
|
+
const n = e.t;
|
|
1901
|
+
if (n.ae & _ && !(n.ae & b)) return true;
|
|
1902
|
+
return e.A !== x && !(t.ae & b);
|
|
1903
|
+
}
|
|
1904
|
+
if (n && e.A !== x) {
|
|
1905
|
+
return !!(n.V & a) || (!n.ke && !(n.ae & _));
|
|
1883
1906
|
}
|
|
1884
|
-
if (e.
|
|
1885
|
-
if (t.
|
|
1886
|
-
if (e.
|
|
1887
|
-
const t = e.
|
|
1888
|
-
return !!(t && t.
|
|
1907
|
+
if (e.m !== undefined && e.m !== x) {
|
|
1908
|
+
if (t.ae & _ && !(t.ae & b)) return true;
|
|
1909
|
+
if (e.t) {
|
|
1910
|
+
const t = e.i ? findLane(e.i) : null;
|
|
1911
|
+
return !!(t && t.u.size > 0);
|
|
1889
1912
|
}
|
|
1890
1913
|
return true;
|
|
1891
1914
|
}
|
|
1892
|
-
if (e.
|
|
1915
|
+
if (e.m !== undefined && e.m === x && !e.t) {
|
|
1893
1916
|
return false;
|
|
1894
1917
|
}
|
|
1895
|
-
if (e.
|
|
1896
|
-
return !!(t.
|
|
1918
|
+
if (e.A !== x && !(t.ae & b)) return true;
|
|
1919
|
+
return !!(t.ae & _ && !(t.ae & b));
|
|
1897
1920
|
}
|
|
1898
1921
|
function updatePendingSignal(e) {
|
|
1899
1922
|
if (e.Qe) {
|
|
1900
1923
|
const t = computePendingState(e);
|
|
1901
1924
|
const n = e.Qe;
|
|
1902
1925
|
setSignal(n, t);
|
|
1903
|
-
if (!t && n.
|
|
1926
|
+
if (!t && n.i) {
|
|
1904
1927
|
const t = resolveLane(e);
|
|
1905
|
-
if (t && t.
|
|
1906
|
-
const e = findLane(n.
|
|
1928
|
+
if (t && t.u.size > 0) {
|
|
1929
|
+
const e = findLane(n.i);
|
|
1907
1930
|
if (e !== t) {
|
|
1908
1931
|
mergeLanes(t, e);
|
|
1909
1932
|
}
|
|
1910
1933
|
}
|
|
1911
|
-
|
|
1912
|
-
n.
|
|
1934
|
+
R.delete(n);
|
|
1935
|
+
n.i = undefined;
|
|
1913
1936
|
}
|
|
1914
1937
|
}
|
|
1915
1938
|
}
|
|
1916
1939
|
function getLatestValueComputed(e) {
|
|
1917
1940
|
if (!e.qe) {
|
|
1918
|
-
const t =
|
|
1919
|
-
|
|
1941
|
+
const t = X;
|
|
1942
|
+
X = false;
|
|
1920
1943
|
const n = $;
|
|
1921
1944
|
$ = false;
|
|
1922
|
-
const r =
|
|
1923
|
-
|
|
1945
|
+
const r = Y;
|
|
1946
|
+
Y = null;
|
|
1924
1947
|
e.qe = optimisticComputed(() => read(e));
|
|
1925
|
-
e.qe.
|
|
1926
|
-
|
|
1948
|
+
e.qe.t = e;
|
|
1949
|
+
Y = r;
|
|
1927
1950
|
$ = n;
|
|
1928
|
-
|
|
1951
|
+
X = t;
|
|
1929
1952
|
}
|
|
1930
1953
|
return e.qe;
|
|
1931
1954
|
}
|
|
1932
1955
|
function staleValues(e, t = true) {
|
|
1933
|
-
const n =
|
|
1934
|
-
|
|
1956
|
+
const n = U;
|
|
1957
|
+
U = t;
|
|
1935
1958
|
try {
|
|
1936
1959
|
return e();
|
|
1937
1960
|
} finally {
|
|
1938
|
-
|
|
1961
|
+
U = n;
|
|
1939
1962
|
}
|
|
1940
1963
|
}
|
|
1941
1964
|
function latest(e) {
|
|
1942
|
-
const t =
|
|
1943
|
-
|
|
1965
|
+
const t = X;
|
|
1966
|
+
X = true;
|
|
1944
1967
|
try {
|
|
1945
1968
|
return e();
|
|
1946
1969
|
} finally {
|
|
1947
|
-
|
|
1970
|
+
X = t;
|
|
1948
1971
|
}
|
|
1949
1972
|
}
|
|
1950
|
-
function isPending(e
|
|
1951
|
-
const
|
|
1952
|
-
const
|
|
1953
|
-
const
|
|
1954
|
-
const s = t === true;
|
|
1973
|
+
function isPending(e) {
|
|
1974
|
+
const t = $;
|
|
1975
|
+
const n = J;
|
|
1976
|
+
const r = ee;
|
|
1955
1977
|
$ = true;
|
|
1956
|
-
|
|
1957
|
-
ee =
|
|
1978
|
+
J = false;
|
|
1979
|
+
ee = new Set();
|
|
1980
|
+
const collectPending = () => {
|
|
1981
|
+
$ = false;
|
|
1982
|
+
try {
|
|
1983
|
+
ee.forEach(e => {
|
|
1984
|
+
if (read(getPendingSignal(e))) J = true;
|
|
1985
|
+
});
|
|
1986
|
+
} finally {
|
|
1987
|
+
$ = true;
|
|
1988
|
+
}
|
|
1989
|
+
};
|
|
1958
1990
|
try {
|
|
1959
1991
|
e();
|
|
1960
|
-
|
|
1992
|
+
collectPending();
|
|
1993
|
+
return J;
|
|
1961
1994
|
} catch (e) {
|
|
1962
|
-
|
|
1963
|
-
|
|
1995
|
+
collectPending();
|
|
1996
|
+
if (e instanceof NotReadyError) {
|
|
1997
|
+
if (J && !(e.source?.ae & b)) return true;
|
|
1998
|
+
if (Y) throw e;
|
|
1999
|
+
}
|
|
2000
|
+
return J;
|
|
1964
2001
|
} finally {
|
|
1965
|
-
$ =
|
|
1966
|
-
|
|
1967
|
-
ee =
|
|
2002
|
+
$ = t;
|
|
2003
|
+
J = n;
|
|
2004
|
+
ee = r;
|
|
1968
2005
|
}
|
|
1969
2006
|
}
|
|
1970
2007
|
function refresh(e) {
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
} finally {
|
|
1980
|
-
Z = t;
|
|
1981
|
-
if (!t) {
|
|
1982
|
-
schedule();
|
|
1983
|
-
}
|
|
2008
|
+
const r = e?.[j];
|
|
2009
|
+
if (!r) {
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
if (typeof r.oe === "function" && !(r.V & (u | a))) {
|
|
2013
|
+
r.V = (r.V & ~t) | n;
|
|
2014
|
+
insertIntoHeap(r, r.V & o ? T : L);
|
|
2015
|
+
schedule();
|
|
1984
2016
|
}
|
|
1985
|
-
}
|
|
1986
|
-
function isRefreshing() {
|
|
1987
|
-
return Z;
|
|
1988
2017
|
}
|
|
1989
2018
|
function createContext(e, t) {
|
|
1990
2019
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -2016,15 +2045,15 @@ function effect(e, t, n, r) {
|
|
|
2016
2045
|
const s = createEffectNode(e, t, n, i ? v : O, notifyEffectStatus, r);
|
|
2017
2046
|
recompute(s, true);
|
|
2018
2047
|
!r?.defer &&
|
|
2019
|
-
(s
|
|
2048
|
+
(s.H === v || r?.schedule ? s.F.enqueue(s.H, runEffect.bind(null, s)) : runEffect(s));
|
|
2020
2049
|
}
|
|
2021
2050
|
function notifyEffectStatus(e, t) {
|
|
2022
|
-
const n = e !== undefined ? e : this.
|
|
2023
|
-
const r = t !== undefined ? t : this.
|
|
2024
|
-
if (n &
|
|
2051
|
+
const n = e !== undefined ? e : this.ae;
|
|
2052
|
+
const r = t !== undefined ? t : this.fe;
|
|
2053
|
+
if (n & m) {
|
|
2025
2054
|
let e = r;
|
|
2026
|
-
this.
|
|
2027
|
-
if (this
|
|
2055
|
+
this.F.notify(this, _, 0);
|
|
2056
|
+
if (this.H === v) {
|
|
2028
2057
|
try {
|
|
2029
2058
|
return this.Ke
|
|
2030
2059
|
? this.Ke(e, () => {
|
|
@@ -2036,38 +2065,38 @@ function notifyEffectStatus(e, t) {
|
|
|
2036
2065
|
e = t;
|
|
2037
2066
|
}
|
|
2038
2067
|
}
|
|
2039
|
-
if (!this.
|
|
2040
|
-
} else if (this
|
|
2041
|
-
this.
|
|
2068
|
+
if (!this.F.notify(this, m, m)) throw e;
|
|
2069
|
+
} else if (this.H === O) {
|
|
2070
|
+
this.F.notify(this, _ | m, n, r);
|
|
2042
2071
|
}
|
|
2043
2072
|
}
|
|
2044
2073
|
function runEffect(e) {
|
|
2045
|
-
if (!e.
|
|
2074
|
+
if (!e.q || e.V & u) return;
|
|
2046
2075
|
e.Be?.();
|
|
2047
2076
|
e.Be = undefined;
|
|
2048
2077
|
try {
|
|
2049
|
-
const t = e.
|
|
2078
|
+
const t = e.De(e.$, e.Ve);
|
|
2050
2079
|
if (false && t !== undefined && typeof t !== "function");
|
|
2051
2080
|
e.Be = t;
|
|
2052
2081
|
if (e.Be && !e.Ge) {
|
|
2053
2082
|
e.Ge = true;
|
|
2054
|
-
runWithOwner(e.
|
|
2083
|
+
runWithOwner(e.X, () => cleanup(() => e.Be?.()));
|
|
2055
2084
|
}
|
|
2056
2085
|
} catch (t) {
|
|
2057
|
-
e.
|
|
2058
|
-
e.
|
|
2059
|
-
if (!e.
|
|
2086
|
+
e.fe = new StatusError(e, t);
|
|
2087
|
+
e.ae |= m;
|
|
2088
|
+
if (!e.F.notify(e, m, m)) throw t;
|
|
2060
2089
|
} finally {
|
|
2061
|
-
e.
|
|
2062
|
-
e.
|
|
2090
|
+
e.Ve = e.$;
|
|
2091
|
+
e.q = false;
|
|
2063
2092
|
}
|
|
2064
2093
|
}
|
|
2065
|
-
GlobalQueue.
|
|
2094
|
+
GlobalQueue.re = runEffect;
|
|
2066
2095
|
function trackedEffect(e, t) {
|
|
2067
2096
|
const run = () => {
|
|
2068
|
-
if (!n.
|
|
2097
|
+
if (!n.q || n.V & u) return;
|
|
2069
2098
|
try {
|
|
2070
|
-
n.
|
|
2099
|
+
n.q = false;
|
|
2071
2100
|
recompute(n);
|
|
2072
2101
|
} finally {
|
|
2073
2102
|
}
|
|
@@ -2082,23 +2111,23 @@ function trackedEffect(e, t) {
|
|
|
2082
2111
|
{ ...t, lazy: true }
|
|
2083
2112
|
);
|
|
2084
2113
|
n.Be = undefined;
|
|
2085
|
-
n.
|
|
2086
|
-
n.
|
|
2087
|
-
n
|
|
2114
|
+
n.ue = (n.ue & ~g) | S;
|
|
2115
|
+
n.q = true;
|
|
2116
|
+
n.H = P;
|
|
2088
2117
|
n.Fe = (e, t) => {
|
|
2089
|
-
const r = e !== undefined ? e : n.
|
|
2090
|
-
if (r &
|
|
2091
|
-
n.
|
|
2092
|
-
const e = t !== undefined ? t : n.
|
|
2093
|
-
if (!n.
|
|
2118
|
+
const r = e !== undefined ? e : n.ae;
|
|
2119
|
+
if (r & m) {
|
|
2120
|
+
n.F.notify(n, _, 0);
|
|
2121
|
+
const e = t !== undefined ? t : n.fe;
|
|
2122
|
+
if (!n.F.notify(n, m, m)) throw e;
|
|
2094
2123
|
}
|
|
2095
2124
|
};
|
|
2096
|
-
n.
|
|
2097
|
-
n.
|
|
2125
|
+
n.M = run;
|
|
2126
|
+
n.F.enqueue(v, run);
|
|
2098
2127
|
cleanup(() => n.Be?.());
|
|
2099
2128
|
}
|
|
2100
2129
|
function restoreTransition(e, t) {
|
|
2101
|
-
|
|
2130
|
+
K.initTransition(e);
|
|
2102
2131
|
const n = t();
|
|
2103
2132
|
flush();
|
|
2104
2133
|
return n;
|
|
@@ -2107,13 +2136,13 @@ function action(e) {
|
|
|
2107
2136
|
return (...t) =>
|
|
2108
2137
|
new Promise((n, r) => {
|
|
2109
2138
|
const i = e(...t);
|
|
2110
|
-
|
|
2111
|
-
let s =
|
|
2112
|
-
s.
|
|
2139
|
+
K.initTransition();
|
|
2140
|
+
let s = q;
|
|
2141
|
+
s.B.push(i);
|
|
2113
2142
|
const done = (e, t) => {
|
|
2114
2143
|
s = currentTransition(s);
|
|
2115
|
-
const o = s.
|
|
2116
|
-
if (o >= 0) s.
|
|
2144
|
+
const o = s.B.indexOf(i);
|
|
2145
|
+
if (o >= 0) s.B.splice(o, 1);
|
|
2117
2146
|
setActiveTransition(s);
|
|
2118
2147
|
schedule();
|
|
2119
2148
|
t ? r(t) : n(e);
|
|
@@ -2152,7 +2181,7 @@ function accessor(e) {
|
|
|
2152
2181
|
function createSignal(e, t) {
|
|
2153
2182
|
if (typeof e === "function") {
|
|
2154
2183
|
const n = computed(e, t);
|
|
2155
|
-
n.
|
|
2184
|
+
n.ue &= ~g;
|
|
2156
2185
|
return [accessor(n), setMemo.bind(null, n)];
|
|
2157
2186
|
}
|
|
2158
2187
|
const n = signal(e, t);
|
|
@@ -2209,7 +2238,7 @@ function resolve(e) {
|
|
|
2209
2238
|
function createOptimistic(e, t) {
|
|
2210
2239
|
if (typeof e === "function") {
|
|
2211
2240
|
const n = optimisticComputed(e, t);
|
|
2212
|
-
n.
|
|
2241
|
+
n.ue &= ~g;
|
|
2213
2242
|
return [accessor(n), setSignal.bind(null, n)];
|
|
2214
2243
|
}
|
|
2215
2244
|
const n = optimisticSignal(e, t);
|
|
@@ -2217,15 +2246,15 @@ function createOptimistic(e, t) {
|
|
|
2217
2246
|
}
|
|
2218
2247
|
function onSettled(e) {
|
|
2219
2248
|
const t = getOwner();
|
|
2220
|
-
t && !(t.
|
|
2249
|
+
t && !(t.ue & S)
|
|
2221
2250
|
? createTrackedEffect(() => untrack(e), undefined)
|
|
2222
|
-
:
|
|
2251
|
+
: K.enqueue(v, () => {
|
|
2223
2252
|
const t = e();
|
|
2224
2253
|
t?.();
|
|
2225
2254
|
});
|
|
2226
2255
|
}
|
|
2227
2256
|
function unwrap(e) {
|
|
2228
|
-
return e?.[
|
|
2257
|
+
return e?.[se]?.[ae] ?? e;
|
|
2229
2258
|
}
|
|
2230
2259
|
function getOverrideValue(e, t, n, r) {
|
|
2231
2260
|
if (r && n in r) return r[n];
|
|
@@ -2237,208 +2266,219 @@ function getAllKeys(e, t, n) {
|
|
|
2237
2266
|
return Array.from(new Set([...r, ...i]));
|
|
2238
2267
|
}
|
|
2239
2268
|
function applyState(e, t, n) {
|
|
2240
|
-
const r = t?.[
|
|
2269
|
+
const r = t?.[se];
|
|
2241
2270
|
if (!r) return;
|
|
2242
|
-
if (r[
|
|
2271
|
+
if (r[le] || r[ce]) {
|
|
2243
2272
|
applyStateSlow(e, r, n);
|
|
2244
2273
|
} else {
|
|
2245
2274
|
applyStateFast(e, r, n);
|
|
2246
2275
|
}
|
|
2247
2276
|
}
|
|
2248
2277
|
function applyStateFast(e, t, n) {
|
|
2249
|
-
const r = t[
|
|
2278
|
+
const r = t[fe];
|
|
2250
2279
|
if (e === r) return;
|
|
2251
|
-
|
|
2252
|
-
t[
|
|
2280
|
+
const i = t[ae];
|
|
2281
|
+
(t[ye] || _e).set(e, t[oe]);
|
|
2282
|
+
t[fe] = e;
|
|
2253
2283
|
if (Array.isArray(r)) {
|
|
2254
|
-
let
|
|
2255
|
-
const
|
|
2256
|
-
if (e.length &&
|
|
2257
|
-
let
|
|
2284
|
+
let s = false;
|
|
2285
|
+
const o = r.length;
|
|
2286
|
+
if (e.length && o && e[0] && n(e[0]) != null) {
|
|
2287
|
+
let u, f, l, c, a, d, p, h;
|
|
2258
2288
|
for (
|
|
2259
|
-
l = 0,
|
|
2260
|
-
l <
|
|
2289
|
+
l = 0, c = Math.min(o, e.length);
|
|
2290
|
+
l < c && ((d = r[l]) === e[l] || (d && e[l] && n(d) === n(e[l])));
|
|
2261
2291
|
l++
|
|
2262
2292
|
) {
|
|
2263
|
-
applyState(e[l], wrap(
|
|
2293
|
+
applyState(e[l], wrap(d, t), n);
|
|
2264
2294
|
}
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2295
|
+
const y = new Array(e.length),
|
|
2296
|
+
S = new Map();
|
|
2267
2297
|
for (
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2298
|
+
c = o - 1, a = e.length - 1;
|
|
2299
|
+
c >= l && a >= l && ((d = r[c]) === e[a] || (d && e[a] && n(d) === n(e[a])));
|
|
2300
|
+
c--, a--
|
|
2271
2301
|
) {
|
|
2272
|
-
|
|
2302
|
+
y[a] = d;
|
|
2273
2303
|
}
|
|
2274
|
-
if (l >
|
|
2275
|
-
for (
|
|
2276
|
-
|
|
2277
|
-
|
|
2304
|
+
if (l > a || l > c) {
|
|
2305
|
+
for (f = l; f <= a; f++) {
|
|
2306
|
+
s = true;
|
|
2307
|
+
i?.[f] && setSignal(i[f], wrap(e[f], t));
|
|
2278
2308
|
}
|
|
2279
|
-
for (;
|
|
2280
|
-
|
|
2281
|
-
const r = wrap(
|
|
2282
|
-
|
|
2283
|
-
applyState(e[
|
|
2309
|
+
for (; f < e.length; f++) {
|
|
2310
|
+
s = true;
|
|
2311
|
+
const r = wrap(y[f], t);
|
|
2312
|
+
i?.[f] && setSignal(i[f], r);
|
|
2313
|
+
applyState(e[f], r, n);
|
|
2284
2314
|
}
|
|
2285
|
-
|
|
2286
|
-
|
|
2315
|
+
s && notifySelf(t);
|
|
2316
|
+
o !== e.length && i?.length && setSignal(i.length, e.length);
|
|
2287
2317
|
return;
|
|
2288
2318
|
}
|
|
2289
|
-
|
|
2290
|
-
for (
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
}
|
|
2297
|
-
for (
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
if (
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2319
|
+
p = new Array(a + 1);
|
|
2320
|
+
for (f = a; f >= l; f--) {
|
|
2321
|
+
d = e[f];
|
|
2322
|
+
h = d ? n(d) : d;
|
|
2323
|
+
u = S.get(h);
|
|
2324
|
+
p[f] = u === undefined ? -1 : u;
|
|
2325
|
+
S.set(h, f);
|
|
2326
|
+
}
|
|
2327
|
+
for (u = l; u <= c; u++) {
|
|
2328
|
+
d = r[u];
|
|
2329
|
+
h = d ? n(d) : d;
|
|
2330
|
+
f = S.get(h);
|
|
2331
|
+
if (f !== undefined && f !== -1) {
|
|
2332
|
+
y[f] = d;
|
|
2333
|
+
f = p[f];
|
|
2334
|
+
S.set(h, f);
|
|
2305
2335
|
}
|
|
2306
2336
|
}
|
|
2307
|
-
for (
|
|
2308
|
-
if (
|
|
2309
|
-
const r = wrap(
|
|
2310
|
-
|
|
2311
|
-
applyState(e[
|
|
2312
|
-
} else
|
|
2337
|
+
for (f = l; f < e.length; f++) {
|
|
2338
|
+
if (f in y) {
|
|
2339
|
+
const r = wrap(y[f], t);
|
|
2340
|
+
i?.[f] && setSignal(i[f], r);
|
|
2341
|
+
applyState(e[f], r, n);
|
|
2342
|
+
} else i?.[f] && setSignal(i[f], wrap(e[f], t));
|
|
2313
2343
|
}
|
|
2314
|
-
if (l < e.length)
|
|
2344
|
+
if (l < e.length) s = true;
|
|
2315
2345
|
} else if (e.length) {
|
|
2316
|
-
for (let
|
|
2317
|
-
const
|
|
2318
|
-
isWrappable(
|
|
2346
|
+
for (let o = 0, u = e.length; o < u; o++) {
|
|
2347
|
+
const u = r[o];
|
|
2348
|
+
if (isWrappable(u)) applyState(e[o], wrap(u, t), n);
|
|
2349
|
+
else {
|
|
2350
|
+
if (u !== e[o]) s = true;
|
|
2351
|
+
i?.[o] && setSignal(i[o], e[o]);
|
|
2352
|
+
}
|
|
2319
2353
|
}
|
|
2320
2354
|
}
|
|
2321
|
-
if (
|
|
2322
|
-
|
|
2323
|
-
|
|
2355
|
+
if (o !== e.length) {
|
|
2356
|
+
s = true;
|
|
2357
|
+
i?.length && setSignal(i.length, e.length);
|
|
2324
2358
|
}
|
|
2325
|
-
|
|
2359
|
+
s && notifySelf(t);
|
|
2326
2360
|
return;
|
|
2327
2361
|
}
|
|
2328
|
-
let
|
|
2329
|
-
if (
|
|
2330
|
-
const
|
|
2331
|
-
const o =
|
|
2332
|
-
for (let u = 0,
|
|
2333
|
-
const
|
|
2334
|
-
const
|
|
2335
|
-
const c = unwrap(r[
|
|
2336
|
-
let a = unwrap(e[
|
|
2362
|
+
let s = t[ae];
|
|
2363
|
+
if (s) {
|
|
2364
|
+
const i = s[ie];
|
|
2365
|
+
const o = i ? getAllKeys(r, undefined, e) : Object.keys(s);
|
|
2366
|
+
for (let u = 0, f = o.length; u < f; u++) {
|
|
2367
|
+
const f = o[u];
|
|
2368
|
+
const l = s[f];
|
|
2369
|
+
const c = unwrap(r[f]);
|
|
2370
|
+
let a = unwrap(e[f]);
|
|
2337
2371
|
if (c === a) continue;
|
|
2338
2372
|
if (!c || !isWrappable(c) || !isWrappable(a) || (n(c) != null && n(c) !== n(a))) {
|
|
2339
|
-
|
|
2340
|
-
|
|
2373
|
+
i && setSignal(i, void 0);
|
|
2374
|
+
l && setSignal(l, isWrappable(a) ? wrap(a, t) : a);
|
|
2341
2375
|
} else applyState(a, wrap(c, t), n);
|
|
2342
2376
|
}
|
|
2343
2377
|
}
|
|
2344
|
-
if ((
|
|
2345
|
-
const t = Object.keys(
|
|
2378
|
+
if ((s = t[de])) {
|
|
2379
|
+
const t = Object.keys(s);
|
|
2346
2380
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2347
2381
|
const r = t[n];
|
|
2348
|
-
setSignal(
|
|
2382
|
+
setSignal(s[r], r in e);
|
|
2349
2383
|
}
|
|
2350
2384
|
}
|
|
2351
2385
|
}
|
|
2352
2386
|
function applyStateSlow(e, t, n) {
|
|
2353
|
-
const r = t[
|
|
2354
|
-
const i = t[
|
|
2355
|
-
const s = t[
|
|
2356
|
-
let o = t[
|
|
2357
|
-
(t[
|
|
2358
|
-
t[
|
|
2359
|
-
t[
|
|
2387
|
+
const r = t[fe];
|
|
2388
|
+
const i = t[le];
|
|
2389
|
+
const s = t[ce];
|
|
2390
|
+
let o = t[ae];
|
|
2391
|
+
(t[ye] || _e).set(e, t[oe]);
|
|
2392
|
+
t[fe] = e;
|
|
2393
|
+
t[le] = undefined;
|
|
2360
2394
|
if (Array.isArray(r)) {
|
|
2361
|
-
let
|
|
2362
|
-
const
|
|
2363
|
-
if (e.length &&
|
|
2364
|
-
let l,
|
|
2395
|
+
let u = false;
|
|
2396
|
+
const f = getOverrideValue(r, i, "length", s);
|
|
2397
|
+
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
2398
|
+
let l, c, a, d, p, h, y, S;
|
|
2365
2399
|
for (
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2400
|
+
a = 0, d = Math.min(f, e.length);
|
|
2401
|
+
a < d && ((h = getOverrideValue(r, i, a, s)) === e[a] || (h && e[a] && n(h) === n(e[a])));
|
|
2402
|
+
a++
|
|
2369
2403
|
) {
|
|
2370
|
-
applyState(e[
|
|
2404
|
+
applyState(e[a], wrap(h, t), n);
|
|
2371
2405
|
}
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2406
|
+
const g = new Array(e.length),
|
|
2407
|
+
w = new Map();
|
|
2374
2408
|
for (
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
((
|
|
2379
|
-
|
|
2409
|
+
d = f - 1, p = e.length - 1;
|
|
2410
|
+
d >= a &&
|
|
2411
|
+
p >= a &&
|
|
2412
|
+
((h = getOverrideValue(r, i, d, s)) === e[p] || (h && e[p] && n(h) === n(e[p])));
|
|
2413
|
+
d--, p--
|
|
2380
2414
|
) {
|
|
2381
|
-
|
|
2415
|
+
g[p] = h;
|
|
2382
2416
|
}
|
|
2383
|
-
if (
|
|
2384
|
-
for (
|
|
2385
|
-
|
|
2386
|
-
|
|
2417
|
+
if (a > p || a > d) {
|
|
2418
|
+
for (c = a; c <= p; c++) {
|
|
2419
|
+
u = true;
|
|
2420
|
+
o?.[c] && setSignal(o[c], wrap(e[c], t));
|
|
2387
2421
|
}
|
|
2388
|
-
for (;
|
|
2389
|
-
|
|
2390
|
-
const r = wrap(
|
|
2391
|
-
|
|
2392
|
-
applyState(e[
|
|
2422
|
+
for (; c < e.length; c++) {
|
|
2423
|
+
u = true;
|
|
2424
|
+
const r = wrap(g[c], t);
|
|
2425
|
+
o?.[c] && setSignal(o[c], r);
|
|
2426
|
+
applyState(e[c], r, n);
|
|
2393
2427
|
}
|
|
2394
|
-
|
|
2395
|
-
u
|
|
2428
|
+
const r = e.length;
|
|
2429
|
+
u && notifySelf(t);
|
|
2430
|
+
f !== r && o?.length && setSignal(o.length, r);
|
|
2396
2431
|
return;
|
|
2397
2432
|
}
|
|
2398
|
-
|
|
2399
|
-
for (
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
l =
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
}
|
|
2406
|
-
for (l =
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
if (
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2433
|
+
y = new Array(p + 1);
|
|
2434
|
+
for (c = p; c >= a; c--) {
|
|
2435
|
+
h = e[c];
|
|
2436
|
+
S = h ? n(h) : h;
|
|
2437
|
+
l = w.get(S);
|
|
2438
|
+
y[c] = l === undefined ? -1 : l;
|
|
2439
|
+
w.set(S, c);
|
|
2440
|
+
}
|
|
2441
|
+
for (l = a; l <= d; l++) {
|
|
2442
|
+
h = getOverrideValue(r, i, l, s);
|
|
2443
|
+
S = h ? n(h) : h;
|
|
2444
|
+
c = w.get(S);
|
|
2445
|
+
if (c !== undefined && c !== -1) {
|
|
2446
|
+
g[c] = h;
|
|
2447
|
+
c = y[c];
|
|
2448
|
+
w.set(S, c);
|
|
2414
2449
|
}
|
|
2415
2450
|
}
|
|
2416
|
-
for (
|
|
2417
|
-
if (
|
|
2418
|
-
const r = wrap(
|
|
2419
|
-
|
|
2420
|
-
applyState(e[
|
|
2421
|
-
} else
|
|
2451
|
+
for (c = a; c < e.length; c++) {
|
|
2452
|
+
if (c in g) {
|
|
2453
|
+
const r = wrap(g[c], t);
|
|
2454
|
+
o?.[c] && setSignal(o[c], r);
|
|
2455
|
+
applyState(e[c], r, n);
|
|
2456
|
+
} else o?.[c] && setSignal(o[c], wrap(e[c], t));
|
|
2422
2457
|
}
|
|
2423
|
-
if (
|
|
2458
|
+
if (a < e.length) u = true;
|
|
2424
2459
|
} else if (e.length) {
|
|
2425
|
-
for (let
|
|
2426
|
-
const
|
|
2427
|
-
isWrappable(
|
|
2460
|
+
for (let f = 0, l = e.length; f < l; f++) {
|
|
2461
|
+
const l = getOverrideValue(r, i, f, s);
|
|
2462
|
+
if (isWrappable(l)) applyState(e[f], wrap(l, t), n);
|
|
2463
|
+
else {
|
|
2464
|
+
if (l !== e[f]) u = true;
|
|
2465
|
+
o?.[f] && setSignal(o[f], e[f]);
|
|
2466
|
+
}
|
|
2428
2467
|
}
|
|
2429
2468
|
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2469
|
+
const l = e.length;
|
|
2470
|
+
if (f !== l) {
|
|
2471
|
+
u = true;
|
|
2472
|
+
o?.length && setSignal(o.length, l);
|
|
2433
2473
|
}
|
|
2434
|
-
|
|
2474
|
+
u && notifySelf(t);
|
|
2435
2475
|
return;
|
|
2436
2476
|
}
|
|
2437
2477
|
if (o) {
|
|
2438
|
-
const u = o[
|
|
2439
|
-
const
|
|
2440
|
-
for (let
|
|
2441
|
-
const c = l
|
|
2478
|
+
const u = o[ie];
|
|
2479
|
+
const f = u ? getAllKeys(r, i, e) : Object.keys(o);
|
|
2480
|
+
for (let l = 0, c = f.length; l < c; l++) {
|
|
2481
|
+
const c = f[l];
|
|
2442
2482
|
const a = o[c];
|
|
2443
2483
|
const d = unwrap(getOverrideValue(r, i, c, s));
|
|
2444
2484
|
let p = unwrap(e[c]);
|
|
@@ -2449,7 +2489,7 @@ function applyStateSlow(e, t, n) {
|
|
|
2449
2489
|
} else applyState(p, wrap(d, t), n);
|
|
2450
2490
|
}
|
|
2451
2491
|
}
|
|
2452
|
-
if ((o = t[
|
|
2492
|
+
if ((o = t[de])) {
|
|
2453
2493
|
const t = Object.keys(o);
|
|
2454
2494
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2455
2495
|
const r = t[n];
|
|
@@ -2462,7 +2502,7 @@ function reconcile(e, t) {
|
|
|
2462
2502
|
if (n == null) throw new Error("Cannot reconcile null or undefined state");
|
|
2463
2503
|
const r = typeof t === "string" ? e => e[t] : t;
|
|
2464
2504
|
const i = r(n);
|
|
2465
|
-
if (i !== undefined && r(e) !==
|
|
2505
|
+
if (i !== undefined && r(e) !== i)
|
|
2466
2506
|
throw new Error("Cannot reconcile states with different identity");
|
|
2467
2507
|
applyState(e, n, r);
|
|
2468
2508
|
};
|
|
@@ -2471,9 +2511,9 @@ function createProjectionInternal(e, t, n) {
|
|
|
2471
2511
|
let r;
|
|
2472
2512
|
const i = new WeakMap();
|
|
2473
2513
|
const wrapper = e => {
|
|
2474
|
-
e[
|
|
2475
|
-
e[
|
|
2476
|
-
Object.defineProperty(e,
|
|
2514
|
+
e[he] = wrapProjection;
|
|
2515
|
+
e[ye] = i;
|
|
2516
|
+
Object.defineProperty(e, Se, {
|
|
2477
2517
|
get() {
|
|
2478
2518
|
return r;
|
|
2479
2519
|
},
|
|
@@ -2482,8 +2522,8 @@ function createProjectionInternal(e, t, n) {
|
|
|
2482
2522
|
};
|
|
2483
2523
|
const wrapProjection = e => {
|
|
2484
2524
|
if (i.has(e)) return i.get(e);
|
|
2485
|
-
if (e[
|
|
2486
|
-
const t = createStoreProxy(e,
|
|
2525
|
+
if (e[se]?.[he] === wrapProjection) return e;
|
|
2526
|
+
const t = createStoreProxy(e, Oe, wrapper);
|
|
2487
2527
|
i.set(e, t);
|
|
2488
2528
|
return t;
|
|
2489
2529
|
};
|
|
@@ -2492,45 +2532,46 @@ function createProjectionInternal(e, t, n) {
|
|
|
2492
2532
|
if (!r) r = getOwner();
|
|
2493
2533
|
runProjectionComputed(s, e, n?.key || "id");
|
|
2494
2534
|
}, undefined);
|
|
2495
|
-
r.
|
|
2535
|
+
r.ue &= ~g;
|
|
2496
2536
|
return { store: s, node: r };
|
|
2497
2537
|
}
|
|
2498
2538
|
function createProjection(e, t, n) {
|
|
2499
2539
|
return createProjectionInternal(e, t, n).store;
|
|
2500
2540
|
}
|
|
2501
|
-
function runProjectionComputed(e, t, n, r) {
|
|
2502
|
-
const
|
|
2503
|
-
let
|
|
2504
|
-
let
|
|
2505
|
-
const
|
|
2541
|
+
function runProjectionComputed(e, t, n, r, i) {
|
|
2542
|
+
const s = getOwner();
|
|
2543
|
+
let o = false;
|
|
2544
|
+
let u;
|
|
2545
|
+
const f = new Proxy(
|
|
2506
2546
|
e,
|
|
2507
|
-
createWriteTraps(() => !
|
|
2547
|
+
createWriteTraps(() => !o || s.ke === u, i)
|
|
2508
2548
|
);
|
|
2509
|
-
storeSetter(
|
|
2510
|
-
|
|
2511
|
-
|
|
2549
|
+
storeSetter(f, i => {
|
|
2550
|
+
u = t(i);
|
|
2551
|
+
o = true;
|
|
2512
2552
|
const commit = t => {
|
|
2513
|
-
if (t ===
|
|
2553
|
+
if (t === i || t === undefined) return;
|
|
2514
2554
|
const write = () => storeSetter(e, reconcile(t, n));
|
|
2515
2555
|
r ? r(write) : write();
|
|
2516
2556
|
};
|
|
2517
|
-
commit(handleAsync(
|
|
2557
|
+
commit(handleAsync(s, u, commit));
|
|
2518
2558
|
});
|
|
2519
|
-
return
|
|
2559
|
+
return s;
|
|
2520
2560
|
}
|
|
2521
|
-
function createWriteTraps(e) {
|
|
2522
|
-
const
|
|
2523
|
-
get(e,
|
|
2561
|
+
function createWriteTraps(e, t) {
|
|
2562
|
+
const n = {
|
|
2563
|
+
get(e, t) {
|
|
2524
2564
|
let r;
|
|
2525
2565
|
setWriteOverride(true);
|
|
2526
2566
|
setProjectionWriteActive(true);
|
|
2527
2567
|
try {
|
|
2528
|
-
r = e[
|
|
2568
|
+
r = e[t];
|
|
2529
2569
|
} finally {
|
|
2530
2570
|
setWriteOverride(false);
|
|
2531
2571
|
setProjectionWriteActive(false);
|
|
2532
2572
|
}
|
|
2533
|
-
|
|
2573
|
+
if (t === se) return r;
|
|
2574
|
+
return typeof r === "object" && r !== null ? new Proxy(r, n) : r;
|
|
2534
2575
|
},
|
|
2535
2576
|
has(e, t) {
|
|
2536
2577
|
let n;
|
|
@@ -2544,24 +2585,26 @@ function createWriteTraps(e) {
|
|
|
2544
2585
|
}
|
|
2545
2586
|
return n;
|
|
2546
2587
|
},
|
|
2547
|
-
set(
|
|
2588
|
+
set(n, r, i) {
|
|
2548
2589
|
if (e && !e()) return true;
|
|
2549
2590
|
setWriteOverride(true);
|
|
2550
2591
|
setProjectionWriteActive(true);
|
|
2551
2592
|
try {
|
|
2552
|
-
|
|
2593
|
+
n[r] = i;
|
|
2594
|
+
t?.();
|
|
2553
2595
|
} finally {
|
|
2554
2596
|
setWriteOverride(false);
|
|
2555
2597
|
setProjectionWriteActive(false);
|
|
2556
2598
|
}
|
|
2557
2599
|
return true;
|
|
2558
2600
|
},
|
|
2559
|
-
deleteProperty(
|
|
2601
|
+
deleteProperty(n, r) {
|
|
2560
2602
|
if (e && !e()) return true;
|
|
2561
2603
|
setWriteOverride(true);
|
|
2562
2604
|
setProjectionWriteActive(true);
|
|
2563
2605
|
try {
|
|
2564
|
-
delete
|
|
2606
|
+
delete n[r];
|
|
2607
|
+
t?.();
|
|
2565
2608
|
} finally {
|
|
2566
2609
|
setWriteOverride(false);
|
|
2567
2610
|
setProjectionWriteActive(false);
|
|
@@ -2569,58 +2612,86 @@ function createWriteTraps(e) {
|
|
|
2569
2612
|
return true;
|
|
2570
2613
|
}
|
|
2571
2614
|
};
|
|
2572
|
-
return
|
|
2615
|
+
return n;
|
|
2573
2616
|
}
|
|
2574
|
-
const
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
const
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2617
|
+
const ie = Symbol(0),
|
|
2618
|
+
se = Symbol(0),
|
|
2619
|
+
oe = Symbol(0),
|
|
2620
|
+
ue = Symbol(0);
|
|
2621
|
+
const fe = "v",
|
|
2622
|
+
le = "o",
|
|
2623
|
+
ce = "x",
|
|
2624
|
+
ae = "n",
|
|
2625
|
+
de = "h",
|
|
2626
|
+
pe = "c",
|
|
2627
|
+
he = "w",
|
|
2628
|
+
ye = "l",
|
|
2629
|
+
Se = "f",
|
|
2630
|
+
ge = "p";
|
|
2631
|
+
const we = Symbol(0);
|
|
2632
|
+
function createStoreProxy(e, t = Oe, n) {
|
|
2589
2633
|
let r;
|
|
2590
2634
|
if (Array.isArray(e)) {
|
|
2591
2635
|
r = [];
|
|
2592
2636
|
r.v = e;
|
|
2593
2637
|
} else {
|
|
2594
2638
|
r = { v: e };
|
|
2595
|
-
const t = e?.[
|
|
2639
|
+
const t = e?.[se]?.[fe] ?? e;
|
|
2596
2640
|
const n = Object.getPrototypeOf(t);
|
|
2597
2641
|
if (n !== null && n !== Object.prototype) {
|
|
2598
|
-
r[
|
|
2642
|
+
r[pe] = true;
|
|
2599
2643
|
}
|
|
2600
2644
|
}
|
|
2601
2645
|
n && n(r);
|
|
2602
|
-
return (r[
|
|
2646
|
+
return (r[oe] = new Proxy(r, t));
|
|
2603
2647
|
}
|
|
2604
|
-
const
|
|
2648
|
+
const _e = new WeakMap();
|
|
2605
2649
|
function wrap(e, t) {
|
|
2606
|
-
if (t?.[
|
|
2607
|
-
let n = e[
|
|
2608
|
-
if (!n)
|
|
2650
|
+
if (t?.[he]) return t[he](e, t);
|
|
2651
|
+
let n = e[oe] || _e.get(e);
|
|
2652
|
+
if (!n) _e.set(e, (n = createStoreProxy(e)));
|
|
2609
2653
|
return n;
|
|
2610
2654
|
}
|
|
2611
2655
|
function isWrappable(e) {
|
|
2612
2656
|
if (e == null || typeof e !== "object" || Object.isFrozen(e)) return false;
|
|
2613
2657
|
return typeof Node === "undefined" || !(e instanceof Node);
|
|
2614
2658
|
}
|
|
2615
|
-
let
|
|
2659
|
+
let me = false;
|
|
2616
2660
|
function setWriteOverride(e) {
|
|
2617
|
-
|
|
2661
|
+
me = e;
|
|
2618
2662
|
}
|
|
2619
2663
|
function writeOnly(e) {
|
|
2620
|
-
return
|
|
2664
|
+
return me || !!be?.has(e);
|
|
2665
|
+
}
|
|
2666
|
+
function unwrapStoreValue(e, t, n) {
|
|
2667
|
+
const r = e?.[se] || n?.get(e)?.[se];
|
|
2668
|
+
if (!r) return e;
|
|
2669
|
+
const i = r[le];
|
|
2670
|
+
if (!i) return r[fe];
|
|
2671
|
+
if (!t) t = new Map();
|
|
2672
|
+
if (t.has(e)) return t.get(e);
|
|
2673
|
+
const s = r[fe];
|
|
2674
|
+
const o = Array.isArray(s);
|
|
2675
|
+
const u = o ? [] : Object.create(Object.getPrototypeOf(s));
|
|
2676
|
+
t.set(e, u);
|
|
2677
|
+
n = r[ye] ?? _e;
|
|
2678
|
+
for (const e of getKeys(s, i)) {
|
|
2679
|
+
if (o && e === "length") continue;
|
|
2680
|
+
const r = e in i ? i[e] : s[e];
|
|
2681
|
+
if (r !== ue) u[e] = unwrapStoreValue(r, t, n);
|
|
2682
|
+
}
|
|
2683
|
+
if (o) u.length = i.length ?? s.length;
|
|
2684
|
+
return u;
|
|
2685
|
+
}
|
|
2686
|
+
function isPrototypePollutionKey$1(e) {
|
|
2687
|
+
return e === "__proto__" || e === "constructor" || e === "prototype";
|
|
2621
2688
|
}
|
|
2622
|
-
function
|
|
2623
|
-
|
|
2689
|
+
function hasOwnStoreProperty(e, t) {
|
|
2690
|
+
const n = e[ce];
|
|
2691
|
+
if (n && Object.prototype.hasOwnProperty.call(n, t) && n[t] !== ue) return true;
|
|
2692
|
+
const r = e[le];
|
|
2693
|
+
if (r && Object.prototype.hasOwnProperty.call(r, t) && r[t] !== ue) return true;
|
|
2694
|
+
return Object.prototype.hasOwnProperty.call(unwrapStoreValue(e[fe]), t);
|
|
2624
2695
|
}
|
|
2625
2696
|
function hasInheritedAccessor(e, t) {
|
|
2626
2697
|
let n = Object.getPrototypeOf(e);
|
|
@@ -2649,17 +2720,21 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2649
2720
|
r
|
|
2650
2721
|
);
|
|
2651
2722
|
if (s) {
|
|
2652
|
-
u.
|
|
2723
|
+
u.m = x;
|
|
2653
2724
|
}
|
|
2654
2725
|
if (o && t in o) {
|
|
2655
2726
|
const e = o[t];
|
|
2656
|
-
u.
|
|
2657
|
-
|
|
2727
|
+
u.ce = e === undefined ? N : e;
|
|
2728
|
+
ne?.add(u);
|
|
2658
2729
|
}
|
|
2659
2730
|
return (e[t] = u);
|
|
2660
2731
|
}
|
|
2661
|
-
function trackSelf(e, t =
|
|
2662
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2732
|
+
function trackSelf(e, t = ie) {
|
|
2733
|
+
getObserver() && read(getNode(getNodes(e, ae), t, undefined, e[Se], false, e[ge]));
|
|
2734
|
+
}
|
|
2735
|
+
function notifySelf(e) {
|
|
2736
|
+
const t = e[ae]?.[ie];
|
|
2737
|
+
t && setSignal(t, e[ge] && !M ? we : undefined);
|
|
2663
2738
|
}
|
|
2664
2739
|
function getKeys(e, t, n = true) {
|
|
2665
2740
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -2667,195 +2742,199 @@ function getKeys(e, t, n = true) {
|
|
|
2667
2742
|
const i = new Set(r);
|
|
2668
2743
|
const s = Reflect.ownKeys(t);
|
|
2669
2744
|
for (const e of s) {
|
|
2670
|
-
if (t[e] !==
|
|
2745
|
+
if (t[e] !== ue) i.add(e);
|
|
2671
2746
|
else i.delete(e);
|
|
2672
2747
|
}
|
|
2673
2748
|
return Array.from(i);
|
|
2674
2749
|
}
|
|
2675
2750
|
function getPropertyDescriptor(e, t, n) {
|
|
2676
2751
|
if (t && n in t) {
|
|
2677
|
-
if (t[n] ===
|
|
2752
|
+
if (t[n] === ue) return void 0;
|
|
2678
2753
|
const r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2679
2754
|
if (r?.get || r?.set || !(n in e)) return r;
|
|
2680
2755
|
}
|
|
2681
2756
|
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2682
2757
|
}
|
|
2683
2758
|
function prepareStoreWrite(e, t, n) {
|
|
2684
|
-
if (e[
|
|
2685
|
-
const t = e[
|
|
2686
|
-
if (t?.
|
|
2687
|
-
|
|
2759
|
+
if (e[ge]) {
|
|
2760
|
+
const t = e[Se];
|
|
2761
|
+
if (t?.h) {
|
|
2762
|
+
K.initTransition(t.h);
|
|
2688
2763
|
}
|
|
2689
2764
|
}
|
|
2690
|
-
const r = e[
|
|
2765
|
+
const r = e[fe];
|
|
2691
2766
|
const i = r[n];
|
|
2692
|
-
if (
|
|
2693
|
-
if (!e[
|
|
2694
|
-
e[
|
|
2695
|
-
|
|
2767
|
+
if (te && typeof n !== "symbol" && !((e[Se]?.ae ?? 0) & _)) {
|
|
2768
|
+
if (!e[C]) {
|
|
2769
|
+
e[C] = Object.create(null);
|
|
2770
|
+
ne?.add(e);
|
|
2696
2771
|
}
|
|
2697
|
-
if (!(n in e[
|
|
2698
|
-
e[
|
|
2772
|
+
if (!(n in e[C])) {
|
|
2773
|
+
e[C][n] = i;
|
|
2699
2774
|
}
|
|
2700
2775
|
}
|
|
2701
|
-
const s = e[
|
|
2702
|
-
const o = s ?
|
|
2776
|
+
const s = e[ge] && !M;
|
|
2777
|
+
const o = s ? ce : le;
|
|
2703
2778
|
if (s) trackOptimisticStore(t);
|
|
2704
2779
|
return { base: i, overrideKey: o, state: r };
|
|
2705
2780
|
}
|
|
2706
2781
|
function upsertStoreNode(e, t, n, r, i) {
|
|
2707
2782
|
if (t[n]) return t[n];
|
|
2708
2783
|
const s = isWrappable(r) ? wrap(r, e) : r;
|
|
2709
|
-
const o = getNode(t, n, s, e[
|
|
2784
|
+
const o = getNode(t, n, s, e[Se], isEqual, e[ge], i);
|
|
2710
2785
|
registerTransientStoreNode(o);
|
|
2711
2786
|
return o;
|
|
2712
2787
|
}
|
|
2713
2788
|
function notifyStoreProperty(e, t, n, r, i, s) {
|
|
2714
|
-
const o =
|
|
2789
|
+
const o = M || e[ge];
|
|
2715
2790
|
const u = n !== "delete";
|
|
2716
|
-
const
|
|
2717
|
-
if (
|
|
2718
|
-
setSignal(
|
|
2791
|
+
const f = e[de]?.[t];
|
|
2792
|
+
if (f) {
|
|
2793
|
+
setSignal(f, u);
|
|
2719
2794
|
} else if (!o && n !== "invalidate" && s !== u) {
|
|
2720
|
-
const n = upsertStoreNode(e, getNodes(e,
|
|
2795
|
+
const n = upsertStoreNode(e, getNodes(e, de), t, s);
|
|
2721
2796
|
setSignal(n, u);
|
|
2722
2797
|
}
|
|
2723
|
-
const
|
|
2798
|
+
const l = getNodes(e, ae);
|
|
2724
2799
|
if (n === "set") {
|
|
2725
|
-
if (
|
|
2726
|
-
setSignal(
|
|
2800
|
+
if (l[t]) {
|
|
2801
|
+
setSignal(l[t], () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2727
2802
|
} else if (!o) {
|
|
2728
|
-
const n = upsertStoreNode(e,
|
|
2803
|
+
const n = upsertStoreNode(e, l, t, i, e[C]);
|
|
2729
2804
|
setSignal(n, () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2730
2805
|
}
|
|
2731
2806
|
} else if (n === "invalidate") {
|
|
2732
|
-
if (
|
|
2733
|
-
setSignal(
|
|
2734
|
-
delete
|
|
2807
|
+
if (l[t]) {
|
|
2808
|
+
setSignal(l[t], {});
|
|
2809
|
+
delete l[t];
|
|
2735
2810
|
}
|
|
2736
2811
|
} else {
|
|
2737
|
-
if (
|
|
2738
|
-
setSignal(
|
|
2812
|
+
if (l[t]) {
|
|
2813
|
+
setSignal(l[t], undefined);
|
|
2739
2814
|
} else if (!o) {
|
|
2740
|
-
const n = upsertStoreNode(e,
|
|
2815
|
+
const n = upsertStoreNode(e, l, t, i, e[C]);
|
|
2741
2816
|
setSignal(n, undefined);
|
|
2742
2817
|
}
|
|
2743
2818
|
}
|
|
2744
|
-
|
|
2819
|
+
notifySelf(e);
|
|
2745
2820
|
}
|
|
2746
|
-
let
|
|
2747
|
-
const
|
|
2821
|
+
let be = null;
|
|
2822
|
+
const Oe = {
|
|
2748
2823
|
get(e, t, n) {
|
|
2749
|
-
if (t ===
|
|
2750
|
-
if (t ===
|
|
2751
|
-
if (t === j) return e[
|
|
2752
|
-
if (t ===
|
|
2824
|
+
if (t === se) return e;
|
|
2825
|
+
if (t === oe) return n;
|
|
2826
|
+
if (t === j) return e[Se];
|
|
2827
|
+
if (t === ie) {
|
|
2753
2828
|
trackSelf(e);
|
|
2754
2829
|
return n;
|
|
2755
2830
|
}
|
|
2756
|
-
const r =
|
|
2757
|
-
const i =
|
|
2758
|
-
const s =
|
|
2831
|
+
const r = getObserver() === e[Se];
|
|
2832
|
+
const i = getNodes(e, ae);
|
|
2833
|
+
const s = r ? undefined : i[t];
|
|
2834
|
+
const o = e[fe];
|
|
2759
2835
|
if (
|
|
2760
|
-
!
|
|
2836
|
+
!s &&
|
|
2837
|
+
!e[le] &&
|
|
2838
|
+
!e[ce] &&
|
|
2761
2839
|
!e[pe] &&
|
|
2762
|
-
!e[
|
|
2763
|
-
!e[
|
|
2764
|
-
!
|
|
2765
|
-
!
|
|
2766
|
-
!s[fe] &&
|
|
2767
|
-
!(t in s) &&
|
|
2840
|
+
!e[ge] &&
|
|
2841
|
+
!e[C] &&
|
|
2842
|
+
!o[se] &&
|
|
2843
|
+
!(t in o) &&
|
|
2768
2844
|
getObserver() &&
|
|
2845
|
+
!r &&
|
|
2769
2846
|
!writeOnly(n)
|
|
2770
2847
|
) {
|
|
2771
|
-
return read(getNode(
|
|
2772
|
-
}
|
|
2773
|
-
const
|
|
2774
|
-
const
|
|
2775
|
-
const l = !!e[
|
|
2776
|
-
const
|
|
2777
|
-
if (!
|
|
2778
|
-
const r = Object.getOwnPropertyDescriptor(
|
|
2848
|
+
return read(getNode(i, t, undefined, e[Se]));
|
|
2849
|
+
}
|
|
2850
|
+
const u = e[ce] && t in e[ce];
|
|
2851
|
+
const f = u || (e[le] && t in e[le]);
|
|
2852
|
+
const l = !!e[fe][se];
|
|
2853
|
+
const c = u ? e[ce] : e[le] && t in e[le] ? e[le] : e[fe];
|
|
2854
|
+
if (!s) {
|
|
2855
|
+
const r = Object.getOwnPropertyDescriptor(c, t);
|
|
2779
2856
|
if (r && r.get) return r.get.call(n);
|
|
2780
|
-
if (!r && !
|
|
2781
|
-
const e = unwrapStoreValue(
|
|
2857
|
+
if (!r && !f && e[pe]) {
|
|
2858
|
+
const e = unwrapStoreValue(c);
|
|
2782
2859
|
if (hasInheritedAccessor(e, t)) {
|
|
2783
|
-
return Reflect.get(
|
|
2860
|
+
return Reflect.get(c, t, n);
|
|
2784
2861
|
}
|
|
2785
2862
|
}
|
|
2786
2863
|
}
|
|
2787
2864
|
if (writeOnly(n)) {
|
|
2865
|
+
if (isPrototypePollutionKey$1(t) && !hasOwnStoreProperty(e, t)) return undefined;
|
|
2788
2866
|
let n =
|
|
2789
|
-
|
|
2790
|
-
n ===
|
|
2867
|
+
s && (f || !l) ? (s.m !== undefined && s.m !== x ? s.m : s.A !== x ? s.A : s.$) : c[t];
|
|
2868
|
+
n === ue && (n = undefined);
|
|
2791
2869
|
if (!isWrappable(n)) return n;
|
|
2792
2870
|
const r = wrap(n, e);
|
|
2793
|
-
|
|
2871
|
+
be?.add(r);
|
|
2794
2872
|
return r;
|
|
2795
2873
|
}
|
|
2796
|
-
let
|
|
2797
|
-
|
|
2798
|
-
if (!
|
|
2799
|
-
if (!
|
|
2874
|
+
let a = s ? (f || !l ? read(i[t]) : (read(i[t]), c[t])) : c[t];
|
|
2875
|
+
a === ue && (a = undefined);
|
|
2876
|
+
if (!s) {
|
|
2877
|
+
if (!f && typeof a === "function" && !c.hasOwnProperty(t)) {
|
|
2800
2878
|
let t;
|
|
2801
|
-
return !Array.isArray(e[
|
|
2802
|
-
?
|
|
2803
|
-
:
|
|
2804
|
-
} else if (getObserver()) {
|
|
2805
|
-
return read(getNode(
|
|
2879
|
+
return !Array.isArray(e[fe]) && (t = Object.getPrototypeOf(e[fe])) && t !== Object.prototype
|
|
2880
|
+
? a.bind(c)
|
|
2881
|
+
: a;
|
|
2882
|
+
} else if (getObserver() && !r) {
|
|
2883
|
+
return read(getNode(i, t, isWrappable(a) ? wrap(a, e) : a, e[Se], isEqual, e[ge], e[C]));
|
|
2806
2884
|
}
|
|
2807
2885
|
}
|
|
2808
|
-
return isWrappable(
|
|
2886
|
+
return isWrappable(a) ? wrap(a, e) : a;
|
|
2809
2887
|
},
|
|
2810
2888
|
has(e, t) {
|
|
2811
|
-
if (t ===
|
|
2889
|
+
if (t === oe || t === ie || t === "__proto__") return true;
|
|
2812
2890
|
const n =
|
|
2813
|
-
e[
|
|
2814
|
-
if (writeOnly(e[
|
|
2815
|
-
const r = getNodes(e,
|
|
2891
|
+
e[ce] && t in e[ce] ? e[ce][t] !== ue : e[le] && t in e[le] ? e[le][t] !== ue : t in e[fe];
|
|
2892
|
+
if (writeOnly(e[oe]) || getObserver() === e[Se]) return n;
|
|
2893
|
+
const r = getNodes(e, de);
|
|
2816
2894
|
if (r[t]) return read(r[t]);
|
|
2817
2895
|
if (getObserver()) {
|
|
2818
|
-
return read(getNode(r, t, n, e[
|
|
2896
|
+
return read(getNode(r, t, n, e[Se], isEqual, e[ge]));
|
|
2819
2897
|
}
|
|
2820
2898
|
return n;
|
|
2821
2899
|
},
|
|
2822
2900
|
set(e, t, n) {
|
|
2823
|
-
|
|
2901
|
+
if (t === "__proto__") return true;
|
|
2902
|
+
const r = e[oe];
|
|
2824
2903
|
if (writeOnly(r)) {
|
|
2825
2904
|
untrack(() => {
|
|
2826
2905
|
const { base: i, overrideKey: s, state: o } = prepareStoreWrite(e, r, t);
|
|
2827
|
-
const u = e[
|
|
2828
|
-
const
|
|
2829
|
-
e[
|
|
2830
|
-
? e[
|
|
2831
|
-
: e[
|
|
2832
|
-
? e[
|
|
2833
|
-
: t in e[
|
|
2834
|
-
const
|
|
2906
|
+
const u = e[ce] && t in e[ce] ? e[ce][t] : e[le] && t in e[le] ? e[le][t] : i;
|
|
2907
|
+
const f =
|
|
2908
|
+
e[ce] && t in e[ce]
|
|
2909
|
+
? e[ce][t] !== ue
|
|
2910
|
+
: e[le] && t in e[le]
|
|
2911
|
+
? e[le][t] !== ue
|
|
2912
|
+
: t in e[fe];
|
|
2913
|
+
const l = unwrapStoreValue(n);
|
|
2835
2914
|
const c = Array.isArray(o) && t !== "length";
|
|
2836
2915
|
const a = c ? parseInt(t) + 1 : 0;
|
|
2837
2916
|
const d =
|
|
2838
2917
|
c &&
|
|
2839
|
-
(e[
|
|
2840
|
-
? e[
|
|
2841
|
-
: e[
|
|
2842
|
-
? e[
|
|
2918
|
+
(e[ce] && "length" in e[ce]
|
|
2919
|
+
? e[ce].length
|
|
2920
|
+
: e[le] && "length" in e[le]
|
|
2921
|
+
? e[le].length
|
|
2843
2922
|
: o.length);
|
|
2844
2923
|
const p = c && a > d ? a : undefined;
|
|
2845
|
-
if (u ===
|
|
2846
|
-
if (
|
|
2924
|
+
if (u === l && p === undefined) return true;
|
|
2925
|
+
if (l !== undefined && l === i && p === undefined) delete e[s]?.[t];
|
|
2847
2926
|
else {
|
|
2848
2927
|
const n = e[s] || (e[s] = Object.create(null));
|
|
2849
|
-
n[t] =
|
|
2928
|
+
n[t] = l;
|
|
2850
2929
|
if (p !== undefined) n.length = p;
|
|
2851
2930
|
}
|
|
2852
|
-
notifyStoreProperty(e, t, "set",
|
|
2931
|
+
notifyStoreProperty(e, t, "set", l, u, f);
|
|
2853
2932
|
if (Array.isArray(o) && t !== "length" && p !== undefined) {
|
|
2854
|
-
const t = getNodes(e,
|
|
2933
|
+
const t = getNodes(e, ae);
|
|
2855
2934
|
if (t.length) {
|
|
2856
2935
|
setSignal(t.length, p);
|
|
2857
|
-
} else if (!
|
|
2858
|
-
const n = upsertStoreNode(e, t, "length", d, e[
|
|
2936
|
+
} else if (!M && !e[ge]) {
|
|
2937
|
+
const n = upsertStoreNode(e, t, "length", d, e[C]);
|
|
2859
2938
|
setSignal(n, p);
|
|
2860
2939
|
}
|
|
2861
2940
|
}
|
|
@@ -2865,7 +2944,8 @@ const xe = {
|
|
|
2865
2944
|
return true;
|
|
2866
2945
|
},
|
|
2867
2946
|
defineProperty(e, t, n) {
|
|
2868
|
-
|
|
2947
|
+
if (t === "__proto__") return true;
|
|
2948
|
+
const r = e[oe];
|
|
2869
2949
|
if (writeOnly(r)) {
|
|
2870
2950
|
untrack(() => {
|
|
2871
2951
|
const { base: i, overrideKey: s } = prepareStoreWrite(e, r, t);
|
|
@@ -2878,16 +2958,17 @@ const xe = {
|
|
|
2878
2958
|
return true;
|
|
2879
2959
|
},
|
|
2880
2960
|
deleteProperty(e, t) {
|
|
2881
|
-
|
|
2882
|
-
const
|
|
2883
|
-
|
|
2961
|
+
if (t === "__proto__") return true;
|
|
2962
|
+
const n = e[ce]?.[t] === ue;
|
|
2963
|
+
const r = e[le]?.[t] === ue;
|
|
2964
|
+
if (writeOnly(e[oe]) && !n && !r) {
|
|
2884
2965
|
untrack(() => {
|
|
2885
|
-
const n = e[
|
|
2886
|
-
const r = n ?
|
|
2887
|
-
if (n) trackOptimisticStore(e[
|
|
2888
|
-
const i = e[
|
|
2889
|
-
if (t in e[
|
|
2890
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2966
|
+
const n = e[ge] && !M;
|
|
2967
|
+
const r = n ? ce : le;
|
|
2968
|
+
if (n) trackOptimisticStore(e[oe]);
|
|
2969
|
+
const i = e[ce] && t in e[ce] ? e[ce][t] : e[le] && t in e[le] ? e[le][t] : e[fe][t];
|
|
2970
|
+
if (t in e[fe] || (e[le] && t in e[le])) {
|
|
2971
|
+
(e[r] || (e[r] = Object.create(null)))[t] = ue;
|
|
2891
2972
|
} else if (e[r] && t in e[r]) {
|
|
2892
2973
|
delete e[r][t];
|
|
2893
2974
|
} else return true;
|
|
@@ -2897,12 +2978,12 @@ const xe = {
|
|
|
2897
2978
|
return true;
|
|
2898
2979
|
},
|
|
2899
2980
|
ownKeys(e) {
|
|
2900
|
-
trackSelf(e);
|
|
2901
|
-
let t = getKeys(e[
|
|
2902
|
-
if (e[
|
|
2981
|
+
if (getObserver() !== e[Se]) trackSelf(e);
|
|
2982
|
+
let t = getKeys(e[fe], e[le], false);
|
|
2983
|
+
if (e[ce]) {
|
|
2903
2984
|
const n = new Set(t);
|
|
2904
|
-
for (const t of Reflect.ownKeys(e[
|
|
2905
|
-
if (e[
|
|
2985
|
+
for (const t of Reflect.ownKeys(e[ce])) {
|
|
2986
|
+
if (e[ce][t] !== ue) n.add(t);
|
|
2906
2987
|
else n.delete(t);
|
|
2907
2988
|
}
|
|
2908
2989
|
t = Array.from(n);
|
|
@@ -2910,27 +2991,27 @@ const xe = {
|
|
|
2910
2991
|
return t;
|
|
2911
2992
|
},
|
|
2912
2993
|
getOwnPropertyDescriptor(e, t) {
|
|
2913
|
-
if (t ===
|
|
2914
|
-
if (e[
|
|
2915
|
-
if (e[
|
|
2916
|
-
const n = Reflect.getOwnPropertyDescriptor(e[
|
|
2917
|
-
if (n?.get || n?.set || !(t in e[
|
|
2918
|
-
const r = getPropertyDescriptor(e[
|
|
2994
|
+
if (t === oe) return { value: e[oe], writable: true, configurable: true };
|
|
2995
|
+
if (e[ce] && t in e[ce]) {
|
|
2996
|
+
if (e[ce][t] === ue) return undefined;
|
|
2997
|
+
const n = Reflect.getOwnPropertyDescriptor(e[ce], t);
|
|
2998
|
+
if (n?.get || n?.set || !(t in e[fe])) return n;
|
|
2999
|
+
const r = getPropertyDescriptor(e[fe], e[le], t);
|
|
2919
3000
|
if (r) {
|
|
2920
|
-
return { ...r, value: e[
|
|
3001
|
+
return { ...r, value: e[ce][t] };
|
|
2921
3002
|
}
|
|
2922
|
-
return { value: e[
|
|
3003
|
+
return { value: e[ce][t], writable: true, enumerable: true, configurable: true };
|
|
2923
3004
|
}
|
|
2924
|
-
return getPropertyDescriptor(e[
|
|
3005
|
+
return getPropertyDescriptor(e[fe], e[le], t);
|
|
2925
3006
|
},
|
|
2926
3007
|
getPrototypeOf(e) {
|
|
2927
|
-
return Object.getPrototypeOf(e[
|
|
3008
|
+
return Object.getPrototypeOf(e[fe]);
|
|
2928
3009
|
}
|
|
2929
3010
|
};
|
|
2930
3011
|
function storeSetter(e, t) {
|
|
2931
|
-
const n =
|
|
2932
|
-
|
|
2933
|
-
|
|
3012
|
+
const n = be;
|
|
3013
|
+
be = new Set();
|
|
3014
|
+
be.add(e);
|
|
2934
3015
|
try {
|
|
2935
3016
|
const n = t(e);
|
|
2936
3017
|
if (n !== e && n !== undefined) {
|
|
@@ -2946,8 +3027,8 @@ function storeSetter(e, t) {
|
|
|
2946
3027
|
}
|
|
2947
3028
|
}
|
|
2948
3029
|
} finally {
|
|
2949
|
-
|
|
2950
|
-
|
|
3030
|
+
be.clear();
|
|
3031
|
+
be = n;
|
|
2951
3032
|
}
|
|
2952
3033
|
}
|
|
2953
3034
|
function createStore(e, t, n) {
|
|
@@ -2955,11 +3036,16 @@ function createStore(e, t, n) {
|
|
|
2955
3036
|
i = r ? createProjectionInternal(e, t, n).store : wrap(e);
|
|
2956
3037
|
return [
|
|
2957
3038
|
i,
|
|
2958
|
-
r
|
|
3039
|
+
r
|
|
3040
|
+
? e => {
|
|
3041
|
+
suppressComputedRecompute(i[j]);
|
|
3042
|
+
storeSetter(i, e);
|
|
3043
|
+
}
|
|
3044
|
+
: e => storeSetter(i, e)
|
|
2959
3045
|
];
|
|
2960
3046
|
}
|
|
2961
3047
|
function createOptimisticStore(e, t, n) {
|
|
2962
|
-
GlobalQueue.
|
|
3048
|
+
GlobalQueue.ie ||= clearOptimisticStore;
|
|
2963
3049
|
const r = typeof e === "function";
|
|
2964
3050
|
const i = r ? t : e;
|
|
2965
3051
|
const s = r ? e : undefined;
|
|
@@ -2967,39 +3053,53 @@ function createOptimisticStore(e, t, n) {
|
|
|
2967
3053
|
return [o, e => storeSetter(o, e)];
|
|
2968
3054
|
}
|
|
2969
3055
|
function clearOptimisticStore(e) {
|
|
2970
|
-
const t = e[
|
|
2971
|
-
if (!t || !t[
|
|
2972
|
-
|
|
2973
|
-
|
|
3056
|
+
const t = e[se];
|
|
3057
|
+
if (!t || !t[ce]) return;
|
|
3058
|
+
clearOptimisticOverride(t);
|
|
3059
|
+
}
|
|
3060
|
+
function clearOptimisticOverride(e) {
|
|
3061
|
+
const t = e[ce];
|
|
3062
|
+
if (!t) return;
|
|
3063
|
+
const n = e[ae];
|
|
3064
|
+
delete e[ce];
|
|
3065
|
+
const r = M;
|
|
2974
3066
|
setProjectionWriteActive(true);
|
|
2975
3067
|
try {
|
|
2976
|
-
if (
|
|
2977
|
-
for (const
|
|
2978
|
-
if (r
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
const i =
|
|
2982
|
-
|
|
3068
|
+
if (n) {
|
|
3069
|
+
for (const r of Reflect.ownKeys(t)) {
|
|
3070
|
+
if (n[r]) {
|
|
3071
|
+
const t = n[r];
|
|
3072
|
+
t.i = undefined;
|
|
3073
|
+
const i = e[le] && r in e[le] ? e[le][r] : e[fe][r];
|
|
3074
|
+
const s = i === ue ? undefined : i;
|
|
3075
|
+
const o = isWrappable(s) ? wrap(s, e) : s;
|
|
3076
|
+
const u = t.m !== undefined && t.m !== x ? t.m : t.A !== x ? t.A : t.$;
|
|
3077
|
+
t.m = x;
|
|
3078
|
+
t.A = x;
|
|
3079
|
+
t.$ = o;
|
|
3080
|
+
if (!t.He || !t.He(u, o)) {
|
|
3081
|
+
insertSubs(t, true);
|
|
3082
|
+
schedule();
|
|
3083
|
+
}
|
|
2983
3084
|
}
|
|
2984
3085
|
}
|
|
2985
|
-
if (
|
|
2986
|
-
|
|
2987
|
-
|
|
3086
|
+
if (n[ie]) {
|
|
3087
|
+
n[ie].i = undefined;
|
|
3088
|
+
notifySelf(e);
|
|
2988
3089
|
}
|
|
2989
3090
|
}
|
|
2990
3091
|
} finally {
|
|
2991
|
-
setProjectionWriteActive(
|
|
3092
|
+
setProjectionWriteActive(r);
|
|
2992
3093
|
}
|
|
2993
|
-
delete t[he];
|
|
2994
3094
|
}
|
|
2995
3095
|
function createOptimisticProjectionInternal(e, t, n) {
|
|
2996
3096
|
let r;
|
|
2997
3097
|
const i = new WeakMap();
|
|
2998
3098
|
const wrapper = e => {
|
|
2999
|
-
e[
|
|
3000
|
-
e[
|
|
3001
|
-
e[
|
|
3002
|
-
Object.defineProperty(e,
|
|
3099
|
+
e[he] = wrapProjection;
|
|
3100
|
+
e[ye] = i;
|
|
3101
|
+
e[ge] = true;
|
|
3102
|
+
Object.defineProperty(e, Se, {
|
|
3003
3103
|
get() {
|
|
3004
3104
|
return r;
|
|
3005
3105
|
},
|
|
@@ -3008,34 +3108,40 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
3008
3108
|
};
|
|
3009
3109
|
const wrapProjection = e => {
|
|
3010
3110
|
if (i.has(e)) return i.get(e);
|
|
3011
|
-
if (e[
|
|
3012
|
-
const t = createStoreProxy(e,
|
|
3111
|
+
if (e[se]?.[he] === wrapProjection) return e;
|
|
3112
|
+
const t = createStoreProxy(e, Oe, wrapper);
|
|
3013
3113
|
i.set(e, t);
|
|
3014
3114
|
return t;
|
|
3015
3115
|
};
|
|
3016
3116
|
const s = wrapProjection(t);
|
|
3017
3117
|
if (e) {
|
|
3118
|
+
const clearProjectionOverride = () => {
|
|
3119
|
+
const e = s[se];
|
|
3120
|
+
if (e?.[ce]) clearOptimisticOverride(e);
|
|
3121
|
+
};
|
|
3018
3122
|
const wrapCommit = e => {
|
|
3123
|
+
const t = M;
|
|
3019
3124
|
setProjectionWriteActive(true);
|
|
3020
3125
|
try {
|
|
3021
3126
|
e();
|
|
3127
|
+
clearProjectionOverride();
|
|
3022
3128
|
} finally {
|
|
3023
|
-
setProjectionWriteActive(
|
|
3129
|
+
setProjectionWriteActive(t);
|
|
3024
3130
|
}
|
|
3025
3131
|
};
|
|
3026
3132
|
r = computed(() => {
|
|
3027
3133
|
setProjectionWriteActive(true);
|
|
3028
3134
|
try {
|
|
3029
|
-
runProjectionComputed(s, e, n?.key || "id", wrapCommit);
|
|
3135
|
+
runProjectionComputed(s, e, n?.key || "id", wrapCommit, clearProjectionOverride);
|
|
3030
3136
|
} finally {
|
|
3031
3137
|
setProjectionWriteActive(false);
|
|
3032
3138
|
}
|
|
3033
3139
|
}, undefined);
|
|
3034
|
-
r.
|
|
3140
|
+
r.ue &= ~g;
|
|
3035
3141
|
}
|
|
3036
3142
|
return { store: s, node: r };
|
|
3037
3143
|
}
|
|
3038
|
-
const
|
|
3144
|
+
const ve = Symbol(0);
|
|
3039
3145
|
function isPrototypePollutionKey(e) {
|
|
3040
3146
|
return e === "__proto__" || e === "constructor" || e === "prototype";
|
|
3041
3147
|
}
|
|
@@ -3083,7 +3189,7 @@ function updatePath(e, t, n = 0) {
|
|
|
3083
3189
|
if (s === i) return;
|
|
3084
3190
|
}
|
|
3085
3191
|
if (r === undefined && s == undefined) return;
|
|
3086
|
-
if (s ===
|
|
3192
|
+
if (s === ve) {
|
|
3087
3193
|
delete e[r];
|
|
3088
3194
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
3089
3195
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -3099,39 +3205,39 @@ function updatePath(e, t, n = 0) {
|
|
|
3099
3205
|
e[r] = s;
|
|
3100
3206
|
}
|
|
3101
3207
|
}
|
|
3102
|
-
const
|
|
3208
|
+
const Pe = Object.assign(
|
|
3103
3209
|
function storePath(...e) {
|
|
3104
3210
|
return t => {
|
|
3105
3211
|
updatePath(t, e);
|
|
3106
3212
|
};
|
|
3107
3213
|
},
|
|
3108
|
-
{ DELETE:
|
|
3214
|
+
{ DELETE: ve }
|
|
3109
3215
|
);
|
|
3110
3216
|
function snapshotImpl(e, t, n, r) {
|
|
3111
|
-
let i, s, o, u,
|
|
3217
|
+
let i, s, o, u, f, l;
|
|
3112
3218
|
if (!isWrappable(e)) return e;
|
|
3113
3219
|
if (n && n.has(e)) return n.get(e);
|
|
3114
3220
|
if (!n) n = new Map();
|
|
3115
|
-
if ((i = e[
|
|
3116
|
-
if (t) trackSelf(i,
|
|
3117
|
-
o = i[
|
|
3118
|
-
s = Array.isArray(i[
|
|
3119
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
3120
|
-
e = i[
|
|
3121
|
-
r =
|
|
3221
|
+
if ((i = e[se] || r?.get(e)?.[se])) {
|
|
3222
|
+
if (t) trackSelf(i, ie);
|
|
3223
|
+
o = i[le];
|
|
3224
|
+
s = Array.isArray(i[fe]);
|
|
3225
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[fe]))) : i[fe]);
|
|
3226
|
+
e = i[fe];
|
|
3227
|
+
r = i[ye] ?? _e;
|
|
3122
3228
|
} else {
|
|
3123
3229
|
s = Array.isArray(e);
|
|
3124
3230
|
n.set(e, e);
|
|
3125
3231
|
}
|
|
3126
3232
|
if (s) {
|
|
3127
|
-
const s = o?.length
|
|
3233
|
+
const s = o?.length ?? e.length;
|
|
3128
3234
|
for (let c = 0; c < s; c++) {
|
|
3129
|
-
|
|
3130
|
-
if (
|
|
3131
|
-
if (t && isWrappable(
|
|
3132
|
-
if ((
|
|
3235
|
+
l = o && c in o ? o[c] : e[c];
|
|
3236
|
+
if (l === ue) continue;
|
|
3237
|
+
if (t && isWrappable(l)) wrap(l, i);
|
|
3238
|
+
if ((f = snapshotImpl(l, t, n, r)) !== l || u) {
|
|
3133
3239
|
if (!u) n.set(e, (u = [...e]));
|
|
3134
|
-
u[c] =
|
|
3240
|
+
u[c] = f;
|
|
3135
3241
|
}
|
|
3136
3242
|
}
|
|
3137
3243
|
} else {
|
|
@@ -3140,14 +3246,14 @@ function snapshotImpl(e, t, n, r) {
|
|
|
3140
3246
|
let a = s[c];
|
|
3141
3247
|
const d = getPropertyDescriptor(e, o, a);
|
|
3142
3248
|
if (d.get) continue;
|
|
3143
|
-
|
|
3144
|
-
if (t && isWrappable(
|
|
3145
|
-
if ((
|
|
3249
|
+
l = o && a in o ? o[a] : e[a];
|
|
3250
|
+
if (t && isWrappable(l)) wrap(l, i);
|
|
3251
|
+
if ((f = snapshotImpl(l, t, n, r)) !== e[a] || u) {
|
|
3146
3252
|
if (!u) {
|
|
3147
3253
|
u = Object.create(Object.getPrototypeOf(e));
|
|
3148
3254
|
Object.assign(u, e);
|
|
3149
3255
|
}
|
|
3150
|
-
u[a] =
|
|
3256
|
+
u[a] = f;
|
|
3151
3257
|
}
|
|
3152
3258
|
}
|
|
3153
3259
|
}
|
|
@@ -3162,13 +3268,13 @@ function deep(e) {
|
|
|
3162
3268
|
function trueFn() {
|
|
3163
3269
|
return true;
|
|
3164
3270
|
}
|
|
3165
|
-
const
|
|
3271
|
+
const xe = {
|
|
3166
3272
|
get(e, t, n) {
|
|
3167
|
-
if (t ===
|
|
3273
|
+
if (t === oe) return n;
|
|
3168
3274
|
return e.get(t);
|
|
3169
3275
|
},
|
|
3170
3276
|
has(e, t) {
|
|
3171
|
-
if (t ===
|
|
3277
|
+
if (t === oe) return true;
|
|
3172
3278
|
return e.has(t);
|
|
3173
3279
|
},
|
|
3174
3280
|
set: trueFn,
|
|
@@ -3191,15 +3297,15 @@ const Ee = {
|
|
|
3191
3297
|
function resolveSource(e) {
|
|
3192
3298
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
3193
3299
|
}
|
|
3194
|
-
const
|
|
3300
|
+
const Ne = Symbol(0);
|
|
3195
3301
|
function merge(...e) {
|
|
3196
3302
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
3197
3303
|
let t = false;
|
|
3198
3304
|
const n = [];
|
|
3199
3305
|
for (let r = 0; r < e.length; r++) {
|
|
3200
3306
|
const i = e[r];
|
|
3201
|
-
t = t || (!!i &&
|
|
3202
|
-
const s = !!i && i[
|
|
3307
|
+
t = t || (!!i && oe in i);
|
|
3308
|
+
const s = !!i && i[Ne];
|
|
3203
3309
|
if (s) {
|
|
3204
3310
|
for (let e = 0; e < s.length; e++) n.push(s[e]);
|
|
3205
3311
|
} else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
@@ -3208,7 +3314,7 @@ function merge(...e) {
|
|
|
3208
3314
|
return new Proxy(
|
|
3209
3315
|
{
|
|
3210
3316
|
get(e) {
|
|
3211
|
-
if (e ===
|
|
3317
|
+
if (e === Ne) return n;
|
|
3212
3318
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
3213
3319
|
const r = resolveSource(n[t]);
|
|
3214
3320
|
if (e in r) return r[e];
|
|
@@ -3229,7 +3335,7 @@ function merge(...e) {
|
|
|
3229
3335
|
return [...e];
|
|
3230
3336
|
}
|
|
3231
3337
|
},
|
|
3232
|
-
|
|
3338
|
+
xe
|
|
3233
3339
|
);
|
|
3234
3340
|
}
|
|
3235
3341
|
const r = Object.create(null);
|
|
@@ -3261,11 +3367,11 @@ function merge(...e) {
|
|
|
3261
3367
|
if (n.get) Object.defineProperty(o, t, n);
|
|
3262
3368
|
else o[t] = n.value;
|
|
3263
3369
|
}
|
|
3264
|
-
o[
|
|
3370
|
+
o[Ne] = n;
|
|
3265
3371
|
return o;
|
|
3266
3372
|
}
|
|
3267
3373
|
function omit(e, ...t) {
|
|
3268
|
-
if (E &&
|
|
3374
|
+
if (E && oe in e) {
|
|
3269
3375
|
return new Proxy(
|
|
3270
3376
|
{
|
|
3271
3377
|
get(n) {
|
|
@@ -3278,7 +3384,7 @@ function omit(e, ...t) {
|
|
|
3278
3384
|
return Object.keys(e).filter(e => !t.includes(e));
|
|
3279
3385
|
}
|
|
3280
3386
|
},
|
|
3281
|
-
|
|
3387
|
+
xe
|
|
3282
3388
|
);
|
|
3283
3389
|
}
|
|
3284
3390
|
const n = {};
|
|
@@ -3300,11 +3406,11 @@ function mapArray(e, t, n) {
|
|
|
3300
3406
|
const s = t;
|
|
3301
3407
|
const o = {
|
|
3302
3408
|
Ue: createOwner(),
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3409
|
+
$e: 0,
|
|
3410
|
+
Je: e,
|
|
3411
|
+
Xe: [],
|
|
3412
|
+
Ye: s,
|
|
3413
|
+
Ze: [],
|
|
3308
3414
|
et: [],
|
|
3309
3415
|
tt: r,
|
|
3310
3416
|
nt: r || n?.keyed === false ? [] : undefined,
|
|
@@ -3313,199 +3419,200 @@ function mapArray(e, t, n) {
|
|
|
3313
3419
|
st: n?.fallback
|
|
3314
3420
|
};
|
|
3315
3421
|
const u = computed(updateKeyedMap.bind(o));
|
|
3316
|
-
o.Ue.
|
|
3317
|
-
u.
|
|
3422
|
+
o.Ue.be = u;
|
|
3423
|
+
u.ue &= ~g;
|
|
3318
3424
|
return accessor(u);
|
|
3319
3425
|
}
|
|
3320
|
-
const
|
|
3426
|
+
const Ce = { ownedWrite: true };
|
|
3321
3427
|
function updateKeyedMap() {
|
|
3322
|
-
const e = this.
|
|
3428
|
+
const e = this.Je() || [],
|
|
3323
3429
|
t = e.length;
|
|
3324
|
-
e[
|
|
3430
|
+
e[ie];
|
|
3325
3431
|
runWithOwner(this.Ue, () => {
|
|
3326
3432
|
let n,
|
|
3327
3433
|
r,
|
|
3328
3434
|
i = this.nt
|
|
3329
3435
|
? this.it
|
|
3330
3436
|
? () => {
|
|
3331
|
-
this.nt[r] = signal(e[r],
|
|
3332
|
-
return this.
|
|
3437
|
+
this.nt[r] = signal(e[r], Ce);
|
|
3438
|
+
return this.Ye(accessor(this.nt[r]), r);
|
|
3333
3439
|
}
|
|
3334
3440
|
: () => {
|
|
3335
|
-
this.nt[r] = signal(e[r],
|
|
3336
|
-
this.rt && (this.rt[r] = signal(r,
|
|
3337
|
-
return this.
|
|
3441
|
+
this.nt[r] = signal(e[r], Ce);
|
|
3442
|
+
this.rt && (this.rt[r] = signal(r, Ce));
|
|
3443
|
+
return this.Ye(accessor(this.nt[r]), this.rt ? accessor(this.rt[r]) : undefined);
|
|
3338
3444
|
}
|
|
3339
3445
|
: this.rt
|
|
3340
3446
|
? () => {
|
|
3341
3447
|
const t = e[r];
|
|
3342
|
-
this.rt[r] = signal(r,
|
|
3343
|
-
return this.
|
|
3448
|
+
this.rt[r] = signal(r, Ce);
|
|
3449
|
+
return this.Ye(t, accessor(this.rt[r]));
|
|
3344
3450
|
}
|
|
3345
3451
|
: () => {
|
|
3346
3452
|
const t = e[r];
|
|
3347
|
-
return this.
|
|
3453
|
+
return this.Ye(t);
|
|
3348
3454
|
};
|
|
3349
3455
|
if (t === 0) {
|
|
3350
|
-
if (this
|
|
3456
|
+
if (this.$e !== 0) {
|
|
3351
3457
|
this.Ue.dispose(false);
|
|
3352
3458
|
this.et = [];
|
|
3353
|
-
this.
|
|
3354
|
-
this
|
|
3355
|
-
this
|
|
3459
|
+
this.Xe = [];
|
|
3460
|
+
this.Ze = [];
|
|
3461
|
+
this.$e = 0;
|
|
3356
3462
|
this.nt && (this.nt = []);
|
|
3357
3463
|
this.rt && (this.rt = []);
|
|
3358
3464
|
}
|
|
3359
|
-
if (this.st && !this
|
|
3360
|
-
this
|
|
3465
|
+
if (this.st && !this.Ze[0]) {
|
|
3466
|
+
this.Ze[0] = runWithOwner((this.et[0] = createOwner()), this.st);
|
|
3361
3467
|
}
|
|
3362
|
-
} else if (this
|
|
3468
|
+
} else if (this.$e === 0) {
|
|
3363
3469
|
if (this.et[0]) this.et[0].dispose();
|
|
3364
|
-
this
|
|
3470
|
+
this.Ze = new Array(t);
|
|
3365
3471
|
for (r = 0; r < t; r++) {
|
|
3366
|
-
this.
|
|
3367
|
-
this
|
|
3472
|
+
this.Xe[r] = e[r];
|
|
3473
|
+
this.Ze[r] = runWithOwner((this.et[r] = createOwner()), i);
|
|
3368
3474
|
}
|
|
3369
|
-
this
|
|
3475
|
+
this.$e = t;
|
|
3370
3476
|
} else {
|
|
3371
3477
|
let s,
|
|
3372
3478
|
o,
|
|
3373
3479
|
u,
|
|
3374
|
-
l,
|
|
3375
3480
|
f,
|
|
3481
|
+
l,
|
|
3376
3482
|
c,
|
|
3377
3483
|
a,
|
|
3378
3484
|
d = new Array(t),
|
|
3379
3485
|
p = new Array(t),
|
|
3380
3486
|
h = this.nt ? new Array(t) : undefined,
|
|
3381
|
-
|
|
3487
|
+
y = this.rt ? new Array(t) : undefined;
|
|
3382
3488
|
for (
|
|
3383
|
-
s = 0, o = Math.min(this
|
|
3384
|
-
s < o && (this.
|
|
3489
|
+
s = 0, o = Math.min(this.$e, t);
|
|
3490
|
+
s < o && (this.Xe[s] === e[s] || (this.nt && compare(this.tt, this.Xe[s], e[s])));
|
|
3385
3491
|
s++
|
|
3386
3492
|
) {
|
|
3387
3493
|
if (this.nt) setSignal(this.nt[s], e[s]);
|
|
3388
3494
|
}
|
|
3389
3495
|
for (
|
|
3390
|
-
o = this
|
|
3496
|
+
o = this.$e - 1, u = t - 1;
|
|
3391
3497
|
o >= s &&
|
|
3392
3498
|
u >= s &&
|
|
3393
|
-
(this.
|
|
3499
|
+
(this.Xe[o] === e[u] || (this.nt && compare(this.tt, this.Xe[o], e[u])));
|
|
3394
3500
|
o--, u--
|
|
3395
3501
|
) {
|
|
3396
|
-
d[u] = this
|
|
3502
|
+
d[u] = this.Ze[o];
|
|
3397
3503
|
p[u] = this.et[o];
|
|
3398
3504
|
h && (h[u] = this.nt[o]);
|
|
3399
|
-
|
|
3505
|
+
y && (y[u] = this.rt[o]);
|
|
3400
3506
|
}
|
|
3401
3507
|
c = new Map();
|
|
3402
3508
|
a = new Array(u + 1);
|
|
3403
3509
|
for (r = u; r >= s; r--) {
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
n = c.get(
|
|
3510
|
+
f = e[r];
|
|
3511
|
+
l = this.tt ? this.tt(f) : f;
|
|
3512
|
+
n = c.get(l);
|
|
3407
3513
|
a[r] = n === undefined ? -1 : n;
|
|
3408
|
-
c.set(
|
|
3514
|
+
c.set(l, r);
|
|
3409
3515
|
}
|
|
3410
3516
|
for (n = s; n <= o; n++) {
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
r = c.get(
|
|
3517
|
+
f = this.Xe[n];
|
|
3518
|
+
l = this.tt ? this.tt(f) : f;
|
|
3519
|
+
r = c.get(l);
|
|
3414
3520
|
if (r !== undefined && r !== -1) {
|
|
3415
|
-
d[r] = this
|
|
3521
|
+
d[r] = this.Ze[n];
|
|
3416
3522
|
p[r] = this.et[n];
|
|
3417
3523
|
h && (h[r] = this.nt[n]);
|
|
3418
|
-
|
|
3524
|
+
y && (y[r] = this.rt[n]);
|
|
3419
3525
|
r = a[r];
|
|
3420
|
-
c.set(
|
|
3526
|
+
c.set(l, r);
|
|
3421
3527
|
} else this.et[n].dispose();
|
|
3422
3528
|
}
|
|
3423
3529
|
for (r = s; r < t; r++) {
|
|
3424
3530
|
if (r in d) {
|
|
3425
|
-
this
|
|
3531
|
+
this.Ze[r] = d[r];
|
|
3426
3532
|
this.et[r] = p[r];
|
|
3427
3533
|
if (h) {
|
|
3428
3534
|
this.nt[r] = h[r];
|
|
3429
3535
|
setSignal(this.nt[r], e[r]);
|
|
3430
3536
|
}
|
|
3431
|
-
if (
|
|
3432
|
-
this.rt[r] =
|
|
3537
|
+
if (y) {
|
|
3538
|
+
this.rt[r] = y[r];
|
|
3433
3539
|
setSignal(this.rt[r], r);
|
|
3434
3540
|
}
|
|
3435
3541
|
} else {
|
|
3436
|
-
this
|
|
3542
|
+
this.Ze[r] = runWithOwner((this.et[r] = createOwner()), i);
|
|
3437
3543
|
}
|
|
3438
3544
|
}
|
|
3439
|
-
this
|
|
3440
|
-
this.
|
|
3545
|
+
this.Ze = this.Ze.slice(0, (this.$e = t));
|
|
3546
|
+
this.Xe = e.slice(0);
|
|
3441
3547
|
}
|
|
3442
3548
|
});
|
|
3443
|
-
return this
|
|
3549
|
+
return this.Ze;
|
|
3444
3550
|
}
|
|
3445
3551
|
function repeat(e, t, n) {
|
|
3446
3552
|
const r = t;
|
|
3447
3553
|
const i = computed(
|
|
3448
3554
|
updateRepeat.bind({
|
|
3449
3555
|
Ue: createOwner(),
|
|
3450
|
-
|
|
3556
|
+
$e: 0,
|
|
3451
3557
|
ot: 0,
|
|
3452
3558
|
ut: e,
|
|
3453
|
-
|
|
3559
|
+
Ye: r,
|
|
3454
3560
|
et: [],
|
|
3455
|
-
|
|
3456
|
-
|
|
3561
|
+
Ze: [],
|
|
3562
|
+
ft: n?.from,
|
|
3457
3563
|
st: n?.fallback
|
|
3458
3564
|
})
|
|
3459
3565
|
);
|
|
3460
|
-
i.
|
|
3566
|
+
i.ue &= ~g;
|
|
3461
3567
|
return accessor(i);
|
|
3462
3568
|
}
|
|
3463
3569
|
function updateRepeat() {
|
|
3464
3570
|
const e = this.ut();
|
|
3465
|
-
const t = this.
|
|
3571
|
+
const t = this.ft?.() || 0;
|
|
3466
3572
|
runWithOwner(this.Ue, () => {
|
|
3467
3573
|
if (e === 0) {
|
|
3468
|
-
if (this
|
|
3574
|
+
if (this.$e !== 0) {
|
|
3469
3575
|
this.Ue.dispose(false);
|
|
3470
3576
|
this.et = [];
|
|
3471
|
-
this
|
|
3472
|
-
this
|
|
3577
|
+
this.Ze = [];
|
|
3578
|
+
this.$e = 0;
|
|
3579
|
+
this.ot = 0;
|
|
3473
3580
|
}
|
|
3474
|
-
if (this.st && !this
|
|
3475
|
-
this
|
|
3581
|
+
if (this.st && !this.Ze[0]) {
|
|
3582
|
+
this.Ze[0] = runWithOwner((this.et[0] = createOwner()), this.st);
|
|
3476
3583
|
}
|
|
3477
3584
|
return;
|
|
3478
3585
|
}
|
|
3479
3586
|
const n = t + e;
|
|
3480
|
-
const r = this.ot + this
|
|
3481
|
-
if (this
|
|
3587
|
+
const r = this.ot + this.$e;
|
|
3588
|
+
if (this.$e === 0 && this.et[0]) this.et[0].dispose();
|
|
3482
3589
|
for (let e = n; e < r; e++) this.et[e - this.ot].dispose();
|
|
3483
3590
|
if (this.ot < t) {
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
this.et.splice(0,
|
|
3487
|
-
this
|
|
3591
|
+
const e = t - this.ot;
|
|
3592
|
+
for (let t = 0; t < e && t < this.$e; t++) this.et[t].dispose();
|
|
3593
|
+
this.et.splice(0, e);
|
|
3594
|
+
this.Ze.splice(0, e);
|
|
3488
3595
|
} else if (this.ot > t) {
|
|
3489
3596
|
let n = r - this.ot - 1;
|
|
3490
3597
|
let i = this.ot - t;
|
|
3491
|
-
this.et.length = this
|
|
3598
|
+
this.et.length = this.Ze.length = e;
|
|
3492
3599
|
while (n >= i) {
|
|
3493
3600
|
this.et[n] = this.et[n - i];
|
|
3494
|
-
this
|
|
3601
|
+
this.Ze[n] = this.Ze[n - i];
|
|
3495
3602
|
n--;
|
|
3496
3603
|
}
|
|
3497
3604
|
for (let e = 0; e < i; e++) {
|
|
3498
|
-
this
|
|
3605
|
+
this.Ze[e] = runWithOwner((this.et[e] = createOwner()), () => this.Ye(e + t));
|
|
3499
3606
|
}
|
|
3500
3607
|
}
|
|
3501
3608
|
for (let e = r; e < n; e++) {
|
|
3502
|
-
this
|
|
3609
|
+
this.Ze[e - t] = runWithOwner((this.et[e - t] = createOwner()), () => this.Ye(e));
|
|
3503
3610
|
}
|
|
3504
|
-
this
|
|
3611
|
+
this.Ze = this.Ze.slice(0, e);
|
|
3505
3612
|
this.ot = t;
|
|
3506
|
-
this
|
|
3613
|
+
this.$e = e;
|
|
3507
3614
|
});
|
|
3508
|
-
return this
|
|
3615
|
+
return this.Ze;
|
|
3509
3616
|
}
|
|
3510
3617
|
function compare(e, t, n) {
|
|
3511
3618
|
return e ? e(t) === e(n) : true;
|
|
@@ -3513,28 +3620,28 @@ function compare(e, t, n) {
|
|
|
3513
3620
|
function boundaryComputed(e, t) {
|
|
3514
3621
|
const n = computed(e, { lazy: true });
|
|
3515
3622
|
n.Fe = (e, t) => {
|
|
3516
|
-
const r = e !== undefined ? e : n.
|
|
3517
|
-
const i = t !== undefined ? t : n.
|
|
3518
|
-
n.
|
|
3519
|
-
n.
|
|
3623
|
+
const r = e !== undefined ? e : n.ae;
|
|
3624
|
+
const i = t !== undefined ? t : n.fe;
|
|
3625
|
+
n.ae &= ~n.lt;
|
|
3626
|
+
n.F.notify(n, n.lt, r, i);
|
|
3520
3627
|
};
|
|
3521
|
-
n.
|
|
3522
|
-
n.
|
|
3628
|
+
n.lt = t;
|
|
3629
|
+
n.ue &= ~g;
|
|
3523
3630
|
recompute(n, true);
|
|
3524
3631
|
return n;
|
|
3525
3632
|
}
|
|
3526
3633
|
function createBoundChildren(e, t, n, r) {
|
|
3527
|
-
const i = e.
|
|
3528
|
-
i.addChild((e.
|
|
3529
|
-
cleanup(() => i.removeChild(e.
|
|
3634
|
+
const i = e.F;
|
|
3635
|
+
i.addChild((e.F = n));
|
|
3636
|
+
cleanup(() => i.removeChild(e.F));
|
|
3530
3637
|
return runWithOwner(e, () => {
|
|
3531
3638
|
const e = computed(t);
|
|
3532
|
-
return boundaryComputed(() =>
|
|
3639
|
+
return boundaryComputed(() => flatten(read(e)), r);
|
|
3533
3640
|
});
|
|
3534
3641
|
}
|
|
3535
|
-
const
|
|
3536
|
-
const
|
|
3537
|
-
let
|
|
3642
|
+
const Ee = Symbol();
|
|
3643
|
+
const ke = createContext(null);
|
|
3644
|
+
let je = false;
|
|
3538
3645
|
const FALSE_ACCESSOR = () => false;
|
|
3539
3646
|
const SEQUENTIAL_ACCESSOR = () => "sequential";
|
|
3540
3647
|
function isRevealController(e) {
|
|
@@ -3548,12 +3655,12 @@ function isSlotMinimallyReady(e) {
|
|
|
3548
3655
|
}
|
|
3549
3656
|
function setSlotState(e, t, n, r) {
|
|
3550
3657
|
setSignal(e.ht, n);
|
|
3551
|
-
setSignal(e.
|
|
3658
|
+
setSignal(e.yt, r);
|
|
3552
3659
|
if (isRevealController(e)) {
|
|
3553
3660
|
if (!n && e.St === t) e.St = undefined;
|
|
3554
3661
|
return e.evaluate(n, r);
|
|
3555
3662
|
}
|
|
3556
|
-
if (!n && e.
|
|
3663
|
+
if (!n && e.gt === t && e.wt) e.gt = undefined;
|
|
3557
3664
|
}
|
|
3558
3665
|
class RevealController {
|
|
3559
3666
|
_t;
|
|
@@ -3561,7 +3668,7 @@ class RevealController {
|
|
|
3561
3668
|
Ot = [];
|
|
3562
3669
|
St;
|
|
3563
3670
|
ht = signal(false, { ownedWrite: true, ze: true });
|
|
3564
|
-
|
|
3671
|
+
yt = signal(false, { ownedWrite: true, ze: true });
|
|
3565
3672
|
vt = true;
|
|
3566
3673
|
Pt = true;
|
|
3567
3674
|
xt = false;
|
|
@@ -3569,16 +3676,16 @@ class RevealController {
|
|
|
3569
3676
|
this._t = e;
|
|
3570
3677
|
this.bt = t;
|
|
3571
3678
|
}
|
|
3572
|
-
|
|
3679
|
+
Nt(e) {
|
|
3573
3680
|
for (let t = 0; t < this.Ot.length; t++) {
|
|
3574
3681
|
const n = this.Ot[t];
|
|
3575
|
-
if ((isRevealController(n) ? n.St : n.
|
|
3682
|
+
if ((isRevealController(n) ? n.St : n.gt) !== this) continue;
|
|
3576
3683
|
if (e(n) === false) return false;
|
|
3577
3684
|
}
|
|
3578
3685
|
return true;
|
|
3579
3686
|
}
|
|
3580
3687
|
isReady() {
|
|
3581
|
-
return this.
|
|
3688
|
+
return this.Nt(isSlotReady);
|
|
3582
3689
|
}
|
|
3583
3690
|
isMinimallyReady() {
|
|
3584
3691
|
const e = untrack(this._t);
|
|
@@ -3586,7 +3693,7 @@ class RevealController {
|
|
|
3586
3693
|
if (e === "natural") {
|
|
3587
3694
|
let e = false;
|
|
3588
3695
|
let t = false;
|
|
3589
|
-
this.
|
|
3696
|
+
this.Nt(n => {
|
|
3590
3697
|
e = true;
|
|
3591
3698
|
if (isSlotMinimallyReady(n)) {
|
|
3592
3699
|
t = true;
|
|
@@ -3596,7 +3703,7 @@ class RevealController {
|
|
|
3596
3703
|
return !e || t;
|
|
3597
3704
|
}
|
|
3598
3705
|
let t = true;
|
|
3599
|
-
this.
|
|
3706
|
+
this.Nt(e => {
|
|
3600
3707
|
t = isSlotMinimallyReady(e);
|
|
3601
3708
|
return false;
|
|
3602
3709
|
});
|
|
@@ -3606,7 +3713,7 @@ class RevealController {
|
|
|
3606
3713
|
if (this.Ot.includes(e)) return;
|
|
3607
3714
|
this.Ot.push(e);
|
|
3608
3715
|
const t = untrack(this._t);
|
|
3609
|
-
(setSignal(e.ht, true), setSignal(e.
|
|
3716
|
+
(setSignal(e.ht, true), setSignal(e.yt, t === "sequential" ? !!untrack(this.bt) : false));
|
|
3610
3717
|
untrack(() => this.evaluate());
|
|
3611
3718
|
}
|
|
3612
3719
|
unregister(e) {
|
|
@@ -3625,11 +3732,11 @@ class RevealController {
|
|
|
3625
3732
|
i = r === "sequential" && !!untrack(this.bt),
|
|
3626
3733
|
s = t ?? i;
|
|
3627
3734
|
if (n) {
|
|
3628
|
-
this.
|
|
3735
|
+
this.Nt(e => setSlotState(e, this, true, s));
|
|
3629
3736
|
} else if (r === "natural") {
|
|
3630
|
-
this.
|
|
3737
|
+
this.Nt(e => {
|
|
3631
3738
|
if (isRevealController(e)) {
|
|
3632
|
-
setSignal(e.
|
|
3739
|
+
setSignal(e.yt, false);
|
|
3633
3740
|
setSignal(e.ht, false);
|
|
3634
3741
|
e.evaluate(false, false);
|
|
3635
3742
|
} else {
|
|
@@ -3637,16 +3744,16 @@ class RevealController {
|
|
|
3637
3744
|
}
|
|
3638
3745
|
});
|
|
3639
3746
|
} else if (r === "together") {
|
|
3640
|
-
const e = this.
|
|
3641
|
-
this.
|
|
3747
|
+
const e = this.Nt(isSlotMinimallyReady);
|
|
3748
|
+
this.Nt(t => setSlotState(t, this, !e, false));
|
|
3642
3749
|
} else {
|
|
3643
3750
|
let e = false;
|
|
3644
|
-
this.
|
|
3751
|
+
this.Nt(t => {
|
|
3645
3752
|
if (e) return setSlotState(t, this, true, i);
|
|
3646
3753
|
if (isSlotReady(t)) return setSlotState(t, this, false, false);
|
|
3647
3754
|
e = true;
|
|
3648
3755
|
if (isRevealController(t)) {
|
|
3649
|
-
setSignal(t.
|
|
3756
|
+
setSignal(t.yt, false);
|
|
3650
3757
|
setSignal(t.ht, false);
|
|
3651
3758
|
t.evaluate(false, false);
|
|
3652
3759
|
} else {
|
|
@@ -3663,33 +3770,33 @@ class RevealController {
|
|
|
3663
3770
|
}
|
|
3664
3771
|
}
|
|
3665
3772
|
class CollectionQueue extends Queue {
|
|
3666
|
-
|
|
3773
|
+
Ct;
|
|
3667
3774
|
ct = new Set();
|
|
3668
3775
|
Et;
|
|
3669
3776
|
dt = true;
|
|
3670
3777
|
ht = signal(false, { ownedWrite: true, ze: true });
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3778
|
+
fe;
|
|
3779
|
+
yt = signal(false, { ownedWrite: true, ze: true });
|
|
3780
|
+
gt;
|
|
3674
3781
|
wt = false;
|
|
3675
3782
|
kt;
|
|
3676
|
-
jt =
|
|
3783
|
+
jt = Ee;
|
|
3677
3784
|
constructor(e) {
|
|
3678
3785
|
super();
|
|
3679
|
-
this.
|
|
3786
|
+
this.Ct = e;
|
|
3680
3787
|
}
|
|
3681
3788
|
run(e) {
|
|
3682
|
-
if (!e || (read(this.ht) && (!
|
|
3789
|
+
if (!e || (read(this.ht) && (!je || read(this.yt)))) return;
|
|
3683
3790
|
return super.run(e);
|
|
3684
3791
|
}
|
|
3685
3792
|
notify(e, t, n, r) {
|
|
3686
|
-
if (!(t & this.
|
|
3793
|
+
if (!(t & this.Ct)) return super.notify(e, t, n, r);
|
|
3687
3794
|
if (this.wt && this.kt) {
|
|
3688
3795
|
const e = untrack(() => {
|
|
3689
3796
|
try {
|
|
3690
3797
|
return this.kt();
|
|
3691
3798
|
} catch {
|
|
3692
|
-
return
|
|
3799
|
+
return Ee;
|
|
3693
3800
|
}
|
|
3694
3801
|
});
|
|
3695
3802
|
if (e !== this.jt) {
|
|
@@ -3698,32 +3805,32 @@ class CollectionQueue extends Queue {
|
|
|
3698
3805
|
this.ct.clear();
|
|
3699
3806
|
}
|
|
3700
3807
|
}
|
|
3701
|
-
if (this.
|
|
3702
|
-
if (this.
|
|
3703
|
-
return super.notify(e,
|
|
3808
|
+
if (this.Ct & _ && this.wt) return super.notify(e, t, n, r);
|
|
3809
|
+
if (this.Ct & _ && n & m) {
|
|
3810
|
+
return super.notify(e, m, n, r);
|
|
3704
3811
|
}
|
|
3705
|
-
if (n & this.
|
|
3812
|
+
if (n & this.Ct) {
|
|
3706
3813
|
this.dt = true;
|
|
3707
|
-
const t = r?.source || e.
|
|
3814
|
+
const t = r?.source || e.fe?.source;
|
|
3708
3815
|
if (t) {
|
|
3709
3816
|
const e = this.ct.size === 0;
|
|
3710
3817
|
this.ct.add(t);
|
|
3711
3818
|
if (e) setSignal(this.ht, true);
|
|
3712
|
-
if (this.
|
|
3713
|
-
setSignal(this.
|
|
3819
|
+
if (this.Ct & m) {
|
|
3820
|
+
setSignal(this.fe, t.fe?.cause ?? t.fe);
|
|
3714
3821
|
}
|
|
3715
3822
|
}
|
|
3716
3823
|
}
|
|
3717
|
-
t &= ~this.
|
|
3824
|
+
t &= ~this.Ct;
|
|
3718
3825
|
return t ? super.notify(e, t, n, r) : true;
|
|
3719
3826
|
}
|
|
3720
3827
|
checkSources() {
|
|
3721
3828
|
for (const e of this.ct) {
|
|
3722
|
-
if (e.
|
|
3829
|
+
if (e.V & u || (!(e.ae & this.Ct) && !(this.Ct & m && e.ae & _))) this.ct.delete(e);
|
|
3723
3830
|
}
|
|
3724
3831
|
if (!this.ct.size) {
|
|
3725
|
-
if (this.
|
|
3726
|
-
this.dt = !!(this.Et.
|
|
3832
|
+
if (this.Ct & _ && this.dt && !this.wt && this.Et) {
|
|
3833
|
+
this.dt = !!(this.Et.ae & this.Ct);
|
|
3727
3834
|
} else {
|
|
3728
3835
|
this.dt = false;
|
|
3729
3836
|
}
|
|
@@ -3736,14 +3843,14 @@ class CollectionQueue extends Queue {
|
|
|
3736
3843
|
}
|
|
3737
3844
|
}
|
|
3738
3845
|
}
|
|
3739
|
-
if (
|
|
3846
|
+
if (je) this.gt?.evaluate();
|
|
3740
3847
|
}
|
|
3741
3848
|
}
|
|
3742
3849
|
function createCollectionBoundary(e, t, n, r) {
|
|
3743
3850
|
const i = createOwner();
|
|
3744
|
-
if (
|
|
3851
|
+
if (je) setContext(ke, null, i);
|
|
3745
3852
|
const s = new CollectionQueue(e);
|
|
3746
|
-
if (e ===
|
|
3853
|
+
if (e === m) s.fe = signal(undefined, { ownedWrite: true, ze: true });
|
|
3747
3854
|
if (r) s.kt = r;
|
|
3748
3855
|
const o = (s.Et = createBoundChildren(i, t, s, e));
|
|
3749
3856
|
untrack(() => {
|
|
@@ -3754,11 +3861,11 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3754
3861
|
if (e instanceof NotReadyError) t = true;
|
|
3755
3862
|
else throw e;
|
|
3756
3863
|
}
|
|
3757
|
-
s.dt = t || !!(o.
|
|
3864
|
+
s.dt = t || !!(o.ae & e) || o.fe instanceof NotReadyError;
|
|
3758
3865
|
});
|
|
3759
|
-
const u =
|
|
3866
|
+
const u = je && e === _ ? getContext(ke) : null;
|
|
3760
3867
|
if (u) {
|
|
3761
|
-
s.
|
|
3868
|
+
s.gt = u;
|
|
3762
3869
|
u.register(s);
|
|
3763
3870
|
cleanup(() => u.unregister(s));
|
|
3764
3871
|
}
|
|
@@ -3768,30 +3875,30 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3768
3875
|
const e = read(o);
|
|
3769
3876
|
if (!untrack(() => read(s.ht))) return ((s.wt = true), e);
|
|
3770
3877
|
}
|
|
3771
|
-
if (
|
|
3878
|
+
if (je && read(s.yt)) return undefined;
|
|
3772
3879
|
return n(s);
|
|
3773
3880
|
})
|
|
3774
3881
|
);
|
|
3775
3882
|
}
|
|
3776
3883
|
function createLoadingBoundary(e, t, n) {
|
|
3777
|
-
return createCollectionBoundary(
|
|
3884
|
+
return createCollectionBoundary(_, e, () => t(), n?.on);
|
|
3778
3885
|
}
|
|
3779
3886
|
function createErrorBoundary(e, t) {
|
|
3780
|
-
return createCollectionBoundary(
|
|
3781
|
-
t(accessor(e.
|
|
3887
|
+
return createCollectionBoundary(m, e, e =>
|
|
3888
|
+
t(accessor(e.fe), () => {
|
|
3782
3889
|
for (const t of e.ct) recompute(t);
|
|
3783
3890
|
schedule();
|
|
3784
3891
|
})
|
|
3785
3892
|
);
|
|
3786
3893
|
}
|
|
3787
3894
|
function createRevealOrder(e, t) {
|
|
3788
|
-
|
|
3895
|
+
je = true;
|
|
3789
3896
|
const n = createOwner();
|
|
3790
|
-
const r = getContext(
|
|
3897
|
+
const r = getContext(ke);
|
|
3791
3898
|
const i = t?.order || SEQUENTIAL_ACCESSOR,
|
|
3792
3899
|
s = t?.collapsed || FALSE_ACCESSOR;
|
|
3793
3900
|
const o = new RevealController(i, s);
|
|
3794
|
-
setContext(
|
|
3901
|
+
setContext(ke, o, n);
|
|
3795
3902
|
return runWithOwner(n, () => {
|
|
3796
3903
|
const t = e();
|
|
3797
3904
|
computed(() => {
|
|
@@ -3856,13 +3963,13 @@ function flattenArray(e, t = [], n) {
|
|
|
3856
3963
|
if (r) throw r;
|
|
3857
3964
|
return i;
|
|
3858
3965
|
}
|
|
3859
|
-
const
|
|
3860
|
-
exports.$PROXY =
|
|
3966
|
+
const We = undefined;
|
|
3967
|
+
exports.$PROXY = oe;
|
|
3861
3968
|
exports.$REFRESH = j;
|
|
3862
|
-
exports.$TARGET =
|
|
3863
|
-
exports.$TRACK =
|
|
3969
|
+
exports.$TARGET = se;
|
|
3970
|
+
exports.$TRACK = ie;
|
|
3864
3971
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
3865
|
-
exports.DEV =
|
|
3972
|
+
exports.DEV = We;
|
|
3866
3973
|
exports.NoOwnerError = NoOwnerError;
|
|
3867
3974
|
exports.NotReadyError = NotReadyError;
|
|
3868
3975
|
exports.SUPPORTS_PROXY = E;
|
|
@@ -3896,7 +4003,6 @@ exports.getOwner = getOwner;
|
|
|
3896
4003
|
exports.isDisposed = isDisposed;
|
|
3897
4004
|
exports.isEqual = isEqual;
|
|
3898
4005
|
exports.isPending = isPending;
|
|
3899
|
-
exports.isRefreshing = isRefreshing;
|
|
3900
4006
|
exports.isWrappable = isWrappable;
|
|
3901
4007
|
exports.latest = latest;
|
|
3902
4008
|
exports.mapArray = mapArray;
|
|
@@ -3915,5 +4021,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
3915
4021
|
exports.setContext = setContext;
|
|
3916
4022
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
3917
4023
|
exports.snapshot = snapshot;
|
|
3918
|
-
exports.storePath =
|
|
4024
|
+
exports.storePath = Pe;
|
|
3919
4025
|
exports.untrack = untrack;
|