@manyducks.co/dolla 2.0.0-alpha.49 → 2.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/context.d.ts +7 -1
- package/dist/core/nodes/html.d.ts +1 -0
- package/dist/core/nodes/view.d.ts +22 -0
- package/dist/{fragment-CTSra5ph.js → fragment-DjTOSAcw.js} +2 -2
- package/dist/{fragment-CTSra5ph.js.map → fragment-DjTOSAcw.js.map} +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/{markup-D67RWnAp.js → markup-DZdmoqTk.js} +573 -548
- package/dist/markup-DZdmoqTk.js.map +1 -0
- package/package.json +1 -1
- package/dist/markup-D67RWnAp.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var Ne = Object.defineProperty;
|
|
2
|
-
var xe = (t, e,
|
|
3
|
-
var
|
|
2
|
+
var xe = (t, e, n) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var c = (t, e, n) => xe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
var E = /* @__PURE__ */ ((t) => (t[t.Computed = 1] = "Computed", t[t.Effect = 2] = "Effect", t[t.Tracking = 4] = "Tracking", t[t.Notified = 8] = "Notified", t[t.Recursed = 16] = "Recursed", t[t.Dirty = 32] = "Dirty", t[t.PendingComputed = 64] = "PendingComputed", t[t.PendingEffect = 128] = "PendingEffect", t[t.Propagated = 224] = "Propagated", t))(E || {});
|
|
5
|
-
function
|
|
5
|
+
function re({
|
|
6
6
|
updateComputed: t,
|
|
7
7
|
notifyEffect: e
|
|
8
8
|
}) {
|
|
9
|
-
let
|
|
9
|
+
let n, s;
|
|
10
10
|
return {
|
|
11
11
|
/**
|
|
12
12
|
* Links a given dependency and subscriber if they are not already linked.
|
|
@@ -15,18 +15,18 @@ function oe({
|
|
|
15
15
|
* @param sub - The subscriber that depends on this dependency.
|
|
16
16
|
* @returns The newly created link object if the two are not already linked; otherwise `undefined`.
|
|
17
17
|
*/
|
|
18
|
-
link(
|
|
18
|
+
link(r, u) {
|
|
19
19
|
const l = u.depsTail;
|
|
20
|
-
if (l !== void 0 && l.dep ===
|
|
20
|
+
if (l !== void 0 && l.dep === r)
|
|
21
21
|
return;
|
|
22
22
|
const d = l !== void 0 ? l.nextDep : u.deps;
|
|
23
|
-
if (d !== void 0 && d.dep ===
|
|
23
|
+
if (d !== void 0 && d.dep === r) {
|
|
24
24
|
u.depsTail = d;
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const a =
|
|
27
|
+
const a = r.subsTail;
|
|
28
28
|
if (!(a !== void 0 && a.sub === u && p(a, u)))
|
|
29
|
-
return i(
|
|
29
|
+
return i(r, u, d, l);
|
|
30
30
|
},
|
|
31
31
|
/**
|
|
32
32
|
* Traverses and marks subscribers starting from the provided link.
|
|
@@ -37,27 +37,27 @@ function oe({
|
|
|
37
37
|
*
|
|
38
38
|
* @param link - The starting link from which propagation begins.
|
|
39
39
|
*/
|
|
40
|
-
propagate(
|
|
41
|
-
let u = 32, l =
|
|
40
|
+
propagate(r) {
|
|
41
|
+
let u = 32, l = r, d = 0;
|
|
42
42
|
e: do {
|
|
43
|
-
const a =
|
|
44
|
-
if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
43
|
+
const a = r.sub, h = a.flags;
|
|
44
|
+
if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(r, a) && (a.flags = h | 16 | u | 8, a.subs !== void 0)) {
|
|
45
|
+
const b = a.subs;
|
|
46
|
+
if (b !== void 0) {
|
|
47
|
+
b.nextSub !== void 0 ? (b.prevSub = l, r = l = b, u = 64, ++d) : (r = b, u = h & 2 ? 128 : 64);
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
|
-
h & 2 && (
|
|
51
|
-
} else h & (4 | u) ? !(h & u) && h & 224 && p(
|
|
52
|
-
if ((
|
|
53
|
-
l =
|
|
50
|
+
h & 2 && (s !== void 0 ? s.depsTail.nextDep = a.deps : n = a, s = a);
|
|
51
|
+
} else h & (4 | u) ? !(h & u) && h & 224 && p(r, a) && (a.flags = h | u) : (a.flags = h | u | 8, (h & 10) === 2 && (s !== void 0 ? s.depsTail.nextDep = a.deps : n = a, s = a));
|
|
52
|
+
if ((r = l.nextSub) !== void 0) {
|
|
53
|
+
l = r, u = d ? 64 : 32;
|
|
54
54
|
continue;
|
|
55
55
|
}
|
|
56
56
|
for (; d; ) {
|
|
57
57
|
--d;
|
|
58
58
|
const W = l.dep.subs;
|
|
59
|
-
if (l = W.prevSub, W.prevSub = void 0, (
|
|
60
|
-
l =
|
|
59
|
+
if (l = W.prevSub, W.prevSub = void 0, (r = l.nextSub) !== void 0) {
|
|
60
|
+
l = r, u = d ? 64 : 32;
|
|
61
61
|
continue e;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -72,8 +72,8 @@ function oe({
|
|
|
72
72
|
*
|
|
73
73
|
* @param sub - The subscriber to start tracking.
|
|
74
74
|
*/
|
|
75
|
-
startTracking(
|
|
76
|
-
|
|
75
|
+
startTracking(r) {
|
|
76
|
+
r.depsTail = void 0, r.flags = r.flags & -249 | 4;
|
|
77
77
|
},
|
|
78
78
|
/**
|
|
79
79
|
* Concludes tracking of dependencies for the specified subscriber.
|
|
@@ -83,13 +83,13 @@ function oe({
|
|
|
83
83
|
*
|
|
84
84
|
* @param sub - The subscriber whose tracking is ending.
|
|
85
85
|
*/
|
|
86
|
-
endTracking(
|
|
87
|
-
const u =
|
|
86
|
+
endTracking(r) {
|
|
87
|
+
const u = r.depsTail;
|
|
88
88
|
if (u !== void 0) {
|
|
89
89
|
const l = u.nextDep;
|
|
90
90
|
l !== void 0 && (g(l), u.nextDep = void 0);
|
|
91
|
-
} else
|
|
92
|
-
|
|
91
|
+
} else r.deps !== void 0 && (g(r.deps), r.deps = void 0);
|
|
92
|
+
r.flags &= -5;
|
|
93
93
|
},
|
|
94
94
|
/**
|
|
95
95
|
* Updates the dirty flag for the given subscriber based on its dependencies.
|
|
@@ -101,8 +101,8 @@ function oe({
|
|
|
101
101
|
* @param flags - The current flag set for this subscriber.
|
|
102
102
|
* @returns `true` if the subscriber is marked as Dirty; otherwise `false`.
|
|
103
103
|
*/
|
|
104
|
-
updateDirtyFlag(
|
|
105
|
-
return r
|
|
104
|
+
updateDirtyFlag(r, u) {
|
|
105
|
+
return o(r.deps) ? (r.flags = u | 32, !0) : (r.flags = u & -65, !1);
|
|
106
106
|
},
|
|
107
107
|
/**
|
|
108
108
|
* Updates the computed subscriber if necessary before its value is accessed.
|
|
@@ -114,10 +114,10 @@ function oe({
|
|
|
114
114
|
* @param computed - The computed subscriber to update.
|
|
115
115
|
* @param flags - The current flag set for this subscriber.
|
|
116
116
|
*/
|
|
117
|
-
processComputedUpdate(
|
|
118
|
-
if ((u & 32 || (r
|
|
119
|
-
const l =
|
|
120
|
-
l !== void 0 &&
|
|
117
|
+
processComputedUpdate(r, u) {
|
|
118
|
+
if ((u & 32 || (o(r.deps) || (r.flags = u & -65, !1))) && t(r)) {
|
|
119
|
+
const l = r.subs;
|
|
120
|
+
l !== void 0 && f(l);
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
/**
|
|
@@ -131,10 +131,10 @@ function oe({
|
|
|
131
131
|
* @param sub - The subscriber which may have pending effects.
|
|
132
132
|
* @param flags - The current flags on the subscriber to check.
|
|
133
133
|
*/
|
|
134
|
-
processPendingInnerEffects(
|
|
134
|
+
processPendingInnerEffects(r, u) {
|
|
135
135
|
if (u & 128) {
|
|
136
|
-
|
|
137
|
-
let l =
|
|
136
|
+
r.flags = u & -129;
|
|
137
|
+
let l = r.deps;
|
|
138
138
|
do {
|
|
139
139
|
const d = l.dep;
|
|
140
140
|
"flags" in d && d.flags & 2 && d.flags & 224 && e(d), l = l.nextDep;
|
|
@@ -149,70 +149,70 @@ function oe({
|
|
|
149
149
|
* notifications may be triggered until fully handled.
|
|
150
150
|
*/
|
|
151
151
|
processEffectNotifications() {
|
|
152
|
-
for (;
|
|
153
|
-
const
|
|
154
|
-
l !== void 0 ? (u.nextDep = void 0,
|
|
152
|
+
for (; n !== void 0; ) {
|
|
153
|
+
const r = n, u = r.depsTail, l = u.nextDep;
|
|
154
|
+
l !== void 0 ? (u.nextDep = void 0, n = l.sub) : (n = void 0, s = void 0), e(r) || (r.flags &= -9);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
function i(
|
|
158
|
+
function i(r, u, l, d) {
|
|
159
159
|
const a = {
|
|
160
|
-
dep:
|
|
160
|
+
dep: r,
|
|
161
161
|
sub: u,
|
|
162
162
|
nextDep: l,
|
|
163
163
|
prevSub: void 0,
|
|
164
164
|
nextSub: void 0
|
|
165
165
|
};
|
|
166
|
-
if (d === void 0 ? u.deps = a : d.nextDep = a,
|
|
167
|
-
|
|
166
|
+
if (d === void 0 ? u.deps = a : d.nextDep = a, r.subs === void 0)
|
|
167
|
+
r.subs = a;
|
|
168
168
|
else {
|
|
169
|
-
const h =
|
|
169
|
+
const h = r.subsTail;
|
|
170
170
|
a.prevSub = h, h.nextSub = a;
|
|
171
171
|
}
|
|
172
|
-
return u.depsTail = a,
|
|
172
|
+
return u.depsTail = a, r.subsTail = a, a;
|
|
173
173
|
}
|
|
174
|
-
function r
|
|
174
|
+
function o(r) {
|
|
175
175
|
let u = 0, l;
|
|
176
176
|
e: do {
|
|
177
177
|
l = !1;
|
|
178
|
-
const d =
|
|
178
|
+
const d = r.dep;
|
|
179
179
|
if ("flags" in d) {
|
|
180
180
|
const a = d.flags;
|
|
181
181
|
if ((a & 33) === 33) {
|
|
182
182
|
if (t(d)) {
|
|
183
183
|
const h = d.subs;
|
|
184
|
-
h.nextSub !== void 0 &&
|
|
184
|
+
h.nextSub !== void 0 && f(h), l = !0;
|
|
185
185
|
}
|
|
186
186
|
} else if ((a & 65) === 65) {
|
|
187
187
|
const h = d.subs;
|
|
188
|
-
h.nextSub !== void 0 && (h.prevSub =
|
|
188
|
+
h.nextSub !== void 0 && (h.prevSub = r), r = d.deps, ++u;
|
|
189
189
|
continue;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
if (!l &&
|
|
193
|
-
|
|
192
|
+
if (!l && r.nextDep !== void 0) {
|
|
193
|
+
r = r.nextDep;
|
|
194
194
|
continue;
|
|
195
195
|
}
|
|
196
196
|
if (u) {
|
|
197
|
-
let a =
|
|
197
|
+
let a = r.sub;
|
|
198
198
|
do {
|
|
199
199
|
--u;
|
|
200
200
|
const h = a.subs;
|
|
201
201
|
if (l) {
|
|
202
202
|
if (t(a)) {
|
|
203
|
-
(
|
|
203
|
+
(r = h.prevSub) !== void 0 ? (h.prevSub = void 0, f(a.subs), a = r.sub) : a = h.sub;
|
|
204
204
|
continue;
|
|
205
205
|
}
|
|
206
206
|
} else
|
|
207
207
|
a.flags &= -65;
|
|
208
|
-
if ((
|
|
209
|
-
if (h.prevSub = void 0,
|
|
210
|
-
|
|
208
|
+
if ((r = h.prevSub) !== void 0) {
|
|
209
|
+
if (h.prevSub = void 0, r.nextDep !== void 0) {
|
|
210
|
+
r = r.nextDep;
|
|
211
211
|
continue e;
|
|
212
212
|
}
|
|
213
|
-
a =
|
|
213
|
+
a = r.sub;
|
|
214
214
|
} else {
|
|
215
|
-
if ((
|
|
215
|
+
if ((r = h.nextDep) !== void 0)
|
|
216
216
|
continue e;
|
|
217
217
|
a = h.sub;
|
|
218
218
|
}
|
|
@@ -222,18 +222,18 @@ function oe({
|
|
|
222
222
|
return l;
|
|
223
223
|
} while (!0);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function f(r) {
|
|
226
226
|
do {
|
|
227
|
-
const u =
|
|
228
|
-
(l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (
|
|
229
|
-
} while (
|
|
227
|
+
const u = r.sub, l = u.flags;
|
|
228
|
+
(l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (s !== void 0 ? s.depsTail.nextDep = u.deps : n = u, s = u)), r = r.nextSub;
|
|
229
|
+
} while (r !== void 0);
|
|
230
230
|
}
|
|
231
|
-
function p(
|
|
231
|
+
function p(r, u) {
|
|
232
232
|
const l = u.depsTail;
|
|
233
233
|
if (l !== void 0) {
|
|
234
234
|
let d = u.deps;
|
|
235
235
|
do {
|
|
236
|
-
if (d ===
|
|
236
|
+
if (d === r)
|
|
237
237
|
return !0;
|
|
238
238
|
if (d === l)
|
|
239
239
|
break;
|
|
@@ -242,47 +242,47 @@ function oe({
|
|
|
242
242
|
}
|
|
243
243
|
return !1;
|
|
244
244
|
}
|
|
245
|
-
function g(
|
|
245
|
+
function g(r) {
|
|
246
246
|
do {
|
|
247
|
-
const u =
|
|
247
|
+
const u = r.dep, l = r.nextDep, d = r.nextSub, a = r.prevSub;
|
|
248
248
|
if (d !== void 0 ? d.prevSub = a : u.subsTail = a, a !== void 0 ? a.nextSub = d : u.subs = d, u.subs === void 0 && "deps" in u) {
|
|
249
249
|
const h = u.flags;
|
|
250
250
|
h & 32 || (u.flags = h | 32);
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
|
|
251
|
+
const b = u.deps;
|
|
252
|
+
if (b !== void 0) {
|
|
253
|
+
r = b, u.depsTail.nextDep = l, u.deps = void 0, u.depsTail = void 0;
|
|
254
254
|
continue;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
} while (
|
|
257
|
+
r = l;
|
|
258
|
+
} while (r !== void 0);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
var {
|
|
262
262
|
link: Je,
|
|
263
263
|
propagate: Qe,
|
|
264
264
|
updateDirtyFlag: Ee,
|
|
265
|
-
startTracking:
|
|
265
|
+
startTracking: oe,
|
|
266
266
|
endTracking: ue,
|
|
267
267
|
processEffectNotifications: Ye,
|
|
268
268
|
processComputedUpdate: et,
|
|
269
269
|
processPendingInnerEffects: ce
|
|
270
|
-
} =
|
|
270
|
+
} = re({
|
|
271
271
|
updateComputed(t) {
|
|
272
|
-
|
|
272
|
+
oe(t);
|
|
273
273
|
try {
|
|
274
|
-
const e = t.currentValue,
|
|
275
|
-
return e !==
|
|
274
|
+
const e = t.currentValue, n = t.getter(e);
|
|
275
|
+
return e !== n ? (t.currentValue = n, !0) : !1;
|
|
276
276
|
} finally {
|
|
277
277
|
ue(t);
|
|
278
278
|
}
|
|
279
279
|
},
|
|
280
280
|
notifyEffect(t) {
|
|
281
|
-
return "isScope" in t ?
|
|
281
|
+
return "isScope" in t ? ke(t) : Me(t);
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
284
|
function Se(t) {
|
|
285
|
-
|
|
285
|
+
oe(t);
|
|
286
286
|
try {
|
|
287
287
|
t.fn();
|
|
288
288
|
} finally {
|
|
@@ -293,10 +293,10 @@ function Me(t) {
|
|
|
293
293
|
const e = t.flags;
|
|
294
294
|
return e & 32 || e & 64 && Ee(t, e) ? Se(t) : ce(t, t.flags), !0;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function ke(t) {
|
|
297
297
|
return t.flags & 128 ? (ce(t, t.flags), !0) : !1;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function k(t) {
|
|
300
300
|
const e = typeof t;
|
|
301
301
|
switch (e) {
|
|
302
302
|
case "undefined":
|
|
@@ -311,41 +311,41 @@ function T(t) {
|
|
|
311
311
|
return e;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function T(t) {
|
|
315
315
|
return Array.isArray(t);
|
|
316
316
|
}
|
|
317
317
|
function V(t, e) {
|
|
318
|
-
return
|
|
318
|
+
return T(e) && e.every((n) => t(n));
|
|
319
319
|
}
|
|
320
|
-
function tt(t, e,
|
|
320
|
+
function tt(t, e, n) {
|
|
321
321
|
if (V(t, e))
|
|
322
322
|
return !0;
|
|
323
|
-
throw new TypeError(I(e,
|
|
323
|
+
throw new TypeError(I(e, n));
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function L(t) {
|
|
326
326
|
return typeof t == "string";
|
|
327
327
|
}
|
|
328
328
|
function st(t, e) {
|
|
329
|
-
if (
|
|
329
|
+
if (L(t))
|
|
330
330
|
return !0;
|
|
331
331
|
throw new TypeError(I(t, e ?? "Expected a string. Got type: %t, value: %v"));
|
|
332
332
|
}
|
|
333
333
|
function m(t) {
|
|
334
|
-
return
|
|
334
|
+
return k(t) === "function";
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Te(t) {
|
|
337
337
|
return typeof t == "number" && !isNaN(t);
|
|
338
338
|
}
|
|
339
339
|
function nt(...t) {
|
|
340
|
-
const e = t[0],
|
|
340
|
+
const e = t[0], n = L(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, s = (i) => {
|
|
341
341
|
if (i instanceof e)
|
|
342
342
|
return !0;
|
|
343
|
-
throw new TypeError(I(i,
|
|
343
|
+
throw new TypeError(I(i, n));
|
|
344
344
|
};
|
|
345
|
-
return t.length < 2 ?
|
|
345
|
+
return t.length < 2 ? s : s(t[1]);
|
|
346
346
|
}
|
|
347
347
|
function R(t) {
|
|
348
|
-
return t != null && typeof t == "object" && !
|
|
348
|
+
return t != null && typeof t == "object" && !T(t);
|
|
349
349
|
}
|
|
350
350
|
function it(t, e) {
|
|
351
351
|
if (R(t))
|
|
@@ -354,27 +354,27 @@ function it(t, e) {
|
|
|
354
354
|
}
|
|
355
355
|
function I(t, e) {
|
|
356
356
|
var i;
|
|
357
|
-
const
|
|
358
|
-
return e.replaceAll("%t",
|
|
357
|
+
const n = k(t), s = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
|
|
358
|
+
return e.replaceAll("%t", n).replaceAll("%v", s);
|
|
359
359
|
}
|
|
360
360
|
const {
|
|
361
361
|
link: B,
|
|
362
|
-
propagate:
|
|
362
|
+
propagate: Le,
|
|
363
363
|
updateDirtyFlag: Ce,
|
|
364
364
|
startTracking: G,
|
|
365
365
|
endTracking: z,
|
|
366
366
|
processEffectNotifications: Ae,
|
|
367
367
|
processComputedUpdate: De,
|
|
368
368
|
processPendingInnerEffects: Oe
|
|
369
|
-
} =
|
|
369
|
+
} = re({
|
|
370
370
|
updateComputed(t) {
|
|
371
|
-
const e =
|
|
372
|
-
|
|
371
|
+
const e = y;
|
|
372
|
+
y = t, G(t);
|
|
373
373
|
try {
|
|
374
|
-
const
|
|
375
|
-
return t.equals(
|
|
374
|
+
const n = t.current, s = t.getter(n);
|
|
375
|
+
return t.equals(n, s) ? !1 : (t.current = s, !0);
|
|
376
376
|
} finally {
|
|
377
|
-
|
|
377
|
+
y = e, z(t);
|
|
378
378
|
}
|
|
379
379
|
},
|
|
380
380
|
notifyEffect(t) {
|
|
@@ -382,19 +382,19 @@ const {
|
|
|
382
382
|
return e & E.Dirty || e & E.PendingComputed && Ce(t, e) ? fe(t) : Oe(t, t.flags), !0;
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
|
-
let
|
|
385
|
+
let y;
|
|
386
386
|
const S = [];
|
|
387
387
|
let q = !1;
|
|
388
388
|
function Pe() {
|
|
389
389
|
q || (q = !0, queueMicrotask(() => {
|
|
390
390
|
q = !1;
|
|
391
391
|
for (let t = 0; t < S.length; t++) {
|
|
392
|
-
const e = S[t],
|
|
393
|
-
|
|
392
|
+
const e = S[t], n = y;
|
|
393
|
+
y = e, G(e);
|
|
394
394
|
try {
|
|
395
395
|
e.cleanup && (ae(), e.cleanup(), de()), e.cleanup = e.fn() ?? void 0;
|
|
396
396
|
} finally {
|
|
397
|
-
|
|
397
|
+
y = n, z(e);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
S.length = 0;
|
|
@@ -410,20 +410,20 @@ function $e() {
|
|
|
410
410
|
}
|
|
411
411
|
const le = [];
|
|
412
412
|
function ae() {
|
|
413
|
-
le.push(
|
|
413
|
+
le.push(y), y = void 0;
|
|
414
414
|
}
|
|
415
415
|
function de() {
|
|
416
|
-
|
|
416
|
+
y = le.pop();
|
|
417
417
|
}
|
|
418
418
|
const Z = Symbol("SIGNAL"), he = Symbol("SOURCE");
|
|
419
419
|
function _(t) {
|
|
420
420
|
let e;
|
|
421
|
-
return ae(), e =
|
|
421
|
+
return ae(), e = w(t), de(), e;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function w(t) {
|
|
424
424
|
return m(t) ? t() : t;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function v(t) {
|
|
427
427
|
const e = {
|
|
428
428
|
fn: t,
|
|
429
429
|
subs: void 0,
|
|
@@ -432,33 +432,33 @@ function y(t) {
|
|
|
432
432
|
depsTail: void 0,
|
|
433
433
|
flags: E.Effect
|
|
434
434
|
};
|
|
435
|
-
return
|
|
435
|
+
return y !== void 0 && B(e, y), fe(e), $e.bind(e);
|
|
436
436
|
}
|
|
437
437
|
function D(t, e) {
|
|
438
438
|
return m(t) ? Ie(t, e) : H(t === void 0 ? void 0 : t, e);
|
|
439
439
|
}
|
|
440
440
|
function H(t, e) {
|
|
441
|
-
const
|
|
441
|
+
const n = {
|
|
442
442
|
current: t,
|
|
443
443
|
subs: void 0,
|
|
444
444
|
subsTail: void 0
|
|
445
|
-
},
|
|
445
|
+
}, s = (e == null ? void 0 : e.equals) ?? Object.is, i = function() {
|
|
446
446
|
if (arguments.length > 0) {
|
|
447
|
-
let
|
|
448
|
-
if (typeof
|
|
449
|
-
|
|
450
|
-
const
|
|
451
|
-
|
|
447
|
+
let o = arguments[0];
|
|
448
|
+
if (typeof o == "function" && (o = o(n.current)), !s(n.current, o)) {
|
|
449
|
+
n.current = o;
|
|
450
|
+
const f = n.subs;
|
|
451
|
+
f !== void 0 && (Le(f), Ae());
|
|
452
452
|
}
|
|
453
453
|
} else
|
|
454
|
-
return
|
|
454
|
+
return y !== void 0 && B(n, y), n.current;
|
|
455
455
|
};
|
|
456
456
|
return i._type = he, i;
|
|
457
457
|
}
|
|
458
458
|
function Ie(t, e) {
|
|
459
459
|
if (m(t) && t._type === Z)
|
|
460
460
|
return t._type === he ? () => t() : t;
|
|
461
|
-
const
|
|
461
|
+
const n = {
|
|
462
462
|
current: void 0,
|
|
463
463
|
equals: (e == null ? void 0 : e.equals) ?? Object.is,
|
|
464
464
|
subs: void 0,
|
|
@@ -467,40 +467,40 @@ function Ie(t, e) {
|
|
|
467
467
|
depsTail: void 0,
|
|
468
468
|
flags: E.Computed | E.Dirty,
|
|
469
469
|
getter: (i) => {
|
|
470
|
-
const
|
|
471
|
-
return
|
|
470
|
+
const o = t(i);
|
|
471
|
+
return w(o);
|
|
472
472
|
}
|
|
473
|
-
},
|
|
473
|
+
}, s = function() {
|
|
474
474
|
if (arguments.length > 0)
|
|
475
475
|
throw new Error("Signals cannot be set as their values are derived from the sources they depend on.");
|
|
476
|
-
|
|
477
|
-
const i =
|
|
478
|
-
return i & (E.Dirty | E.PendingComputed) && De(
|
|
476
|
+
y !== void 0 && B(n, y);
|
|
477
|
+
const i = n.flags;
|
|
478
|
+
return i & (E.Dirty | E.PendingComputed) && De(n, i), n.current;
|
|
479
479
|
};
|
|
480
|
-
return
|
|
480
|
+
return s._type = Z, s;
|
|
481
481
|
}
|
|
482
|
-
const
|
|
482
|
+
const rt = () => {
|
|
483
483
|
};
|
|
484
484
|
let U = 1;
|
|
485
485
|
function pe() {
|
|
486
486
|
return U = U % Number.MAX_SAFE_INTEGER + 1, U.toString(36) + Date.now().toString(36);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function ot(t, e) {
|
|
489
489
|
return Object.is(t, e);
|
|
490
490
|
}
|
|
491
491
|
function ut(t, e) {
|
|
492
492
|
if (Object.is(t, e)) return !0;
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
493
|
+
const n = k(t);
|
|
494
|
+
if (n !== k(e))
|
|
495
495
|
return !1;
|
|
496
|
-
switch (
|
|
496
|
+
switch (n) {
|
|
497
497
|
case "object":
|
|
498
|
-
let
|
|
498
|
+
let s = 0;
|
|
499
499
|
for (const i in t) {
|
|
500
500
|
if (t[i] !== e[i]) return !1;
|
|
501
|
-
|
|
501
|
+
s++;
|
|
502
502
|
}
|
|
503
|
-
return Object.keys(e).length ===
|
|
503
|
+
return Object.keys(e).length === s;
|
|
504
504
|
case "array":
|
|
505
505
|
if (t.length !== e.length) return !1;
|
|
506
506
|
for (let i = 0; i < t.length; i++)
|
|
@@ -524,73 +524,73 @@ function C(t, e) {
|
|
|
524
524
|
if (t === e) return !0;
|
|
525
525
|
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
526
526
|
if (t.constructor !== e.constructor) return !1;
|
|
527
|
-
var
|
|
527
|
+
var n, s, i;
|
|
528
528
|
if (Array.isArray(t)) {
|
|
529
|
-
if (
|
|
530
|
-
for (
|
|
529
|
+
if (n = t.length, n != e.length) return !1;
|
|
530
|
+
for (s = n; s-- !== 0; ) if (!C(t[s], e[s])) return !1;
|
|
531
531
|
return !0;
|
|
532
532
|
}
|
|
533
533
|
if (t instanceof Map && e instanceof Map) {
|
|
534
534
|
if (t.size !== e.size) return !1;
|
|
535
|
-
for (
|
|
536
|
-
for (
|
|
535
|
+
for (s of t.entries()) if (!e.has(s[0])) return !1;
|
|
536
|
+
for (s of t.entries()) if (!C(s[1], e.get(s[0]))) return !1;
|
|
537
537
|
return !0;
|
|
538
538
|
}
|
|
539
539
|
if (t instanceof Set && e instanceof Set) {
|
|
540
540
|
if (t.size !== e.size) return !1;
|
|
541
|
-
for (
|
|
541
|
+
for (s of t.entries()) if (!e.has(s[0])) return !1;
|
|
542
542
|
return !0;
|
|
543
543
|
}
|
|
544
544
|
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(e)) {
|
|
545
|
-
if (
|
|
546
|
-
for (
|
|
545
|
+
if (n = t.length, n != e.length) return !1;
|
|
546
|
+
for (s = n; s-- !== 0; ) if (t[s] !== e[s]) return !1;
|
|
547
547
|
return !0;
|
|
548
548
|
}
|
|
549
549
|
if (t.constructor === RegExp) return t.source === e.source && t.flags === e.flags;
|
|
550
550
|
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === e.valueOf();
|
|
551
551
|
if (t.toString !== Object.prototype.toString) return t.toString() === e.toString();
|
|
552
|
-
if (i = Object.keys(t),
|
|
553
|
-
for (
|
|
554
|
-
for (
|
|
555
|
-
var
|
|
556
|
-
if (!C(t[
|
|
552
|
+
if (i = Object.keys(t), n = i.length, n !== Object.keys(e).length) return !1;
|
|
553
|
+
for (s = n; s-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, i[s])) return !1;
|
|
554
|
+
for (s = n; s-- !== 0; ) {
|
|
555
|
+
var o = i[s];
|
|
556
|
+
if (!C(t[o], e[o])) return !1;
|
|
557
557
|
}
|
|
558
558
|
return !0;
|
|
559
559
|
}
|
|
560
560
|
return t !== t && e !== e;
|
|
561
561
|
}
|
|
562
562
|
function _e(t, e) {
|
|
563
|
-
const
|
|
564
|
-
for (const
|
|
565
|
-
t.includes(
|
|
566
|
-
return
|
|
563
|
+
const n = {};
|
|
564
|
+
for (const s in e)
|
|
565
|
+
t.includes(s) || (n[s] = e[s]);
|
|
566
|
+
return n;
|
|
567
567
|
}
|
|
568
568
|
function ct(t) {
|
|
569
569
|
let e = 0;
|
|
570
|
-
for (let
|
|
571
|
-
e = (e + t.charCodeAt(
|
|
570
|
+
for (let n = 0; n < t.length; n++)
|
|
571
|
+
e = (e + t.charCodeAt(n) * 10) % 360;
|
|
572
572
|
return `oklch(0.68 0.15 ${e}deg)`;
|
|
573
573
|
}
|
|
574
574
|
function ft(t) {
|
|
575
575
|
if (t instanceof RegExp)
|
|
576
|
-
return (
|
|
576
|
+
return (s) => t.test(s);
|
|
577
577
|
const e = {
|
|
578
578
|
positive: [],
|
|
579
579
|
negative: []
|
|
580
|
-
},
|
|
581
|
-
for (let
|
|
580
|
+
}, n = t.split(",").map((s) => s.trim()).filter((s) => s !== "");
|
|
581
|
+
for (let s of n) {
|
|
582
582
|
let i = "positive";
|
|
583
|
-
|
|
583
|
+
s.startsWith("-") && (i = "negative", s = s.slice(1)), s === "*" ? e[i].push(function() {
|
|
584
584
|
return !0;
|
|
585
|
-
}) :
|
|
586
|
-
return
|
|
587
|
-
}) : e[i].push(function(
|
|
588
|
-
return
|
|
585
|
+
}) : s.endsWith("*") ? e[i].push(function(o) {
|
|
586
|
+
return o.startsWith(s.slice(0, s.length - 1));
|
|
587
|
+
}) : e[i].push(function(o) {
|
|
588
|
+
return o === s;
|
|
589
589
|
});
|
|
590
590
|
}
|
|
591
|
-
return function(
|
|
592
|
-
const { positive: i, negative:
|
|
593
|
-
return !(
|
|
591
|
+
return function(s) {
|
|
592
|
+
const { positive: i, negative: o } = e;
|
|
593
|
+
return !(o.some((f) => f(s)) || i.length > 0 && !i.some((f) => f(s)));
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
596
|
const x = Symbol.for("DollaMarkupElement"), lt = Symbol.for("DollaRouter");
|
|
@@ -598,15 +598,15 @@ var J;
|
|
|
598
598
|
J = x;
|
|
599
599
|
class K {
|
|
600
600
|
constructor(e) {
|
|
601
|
-
|
|
602
|
-
|
|
601
|
+
c(this, J, !0);
|
|
602
|
+
c(this, "domNode");
|
|
603
603
|
this.domNode = e;
|
|
604
604
|
}
|
|
605
605
|
get isMounted() {
|
|
606
606
|
return this.domNode.parentNode != null;
|
|
607
607
|
}
|
|
608
|
-
mount(e,
|
|
609
|
-
e.insertBefore(this.domNode, (
|
|
608
|
+
mount(e, n) {
|
|
609
|
+
e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null);
|
|
610
610
|
}
|
|
611
611
|
unmount(e = !1) {
|
|
612
612
|
this.domNode.parentNode && !e && this.domNode.parentNode.removeChild(this.domNode);
|
|
@@ -616,68 +616,73 @@ var Q;
|
|
|
616
616
|
Q = x;
|
|
617
617
|
class je {
|
|
618
618
|
constructor(e) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
619
|
+
c(this, Q, !0);
|
|
620
|
+
c(this, "domNode", document.createTextNode(""));
|
|
621
|
+
c(this, "children", []);
|
|
622
|
+
c(this, "elementContext");
|
|
623
|
+
c(this, "source");
|
|
624
|
+
c(this, "unsubscribe");
|
|
625
625
|
this.source = e.source, this.elementContext = e.elementContext;
|
|
626
626
|
}
|
|
627
627
|
get isMounted() {
|
|
628
628
|
return this.domNode.parentNode != null;
|
|
629
629
|
}
|
|
630
|
-
mount(e,
|
|
631
|
-
this.isMounted || (e.insertBefore(this.domNode, (
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
630
|
+
mount(e, n) {
|
|
631
|
+
this.isMounted || (e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), this.unsubscribe = v(() => {
|
|
632
|
+
try {
|
|
633
|
+
const s = this.source();
|
|
634
|
+
if (!be(s))
|
|
635
|
+
throw console.error(s), new TypeError(
|
|
636
|
+
`Dynamic received invalid value to render. Got type: ${k(s)}, value: ${s}`
|
|
637
|
+
);
|
|
638
|
+
_(() => {
|
|
639
|
+
this.update(T(s) ? s : [s]);
|
|
640
|
+
});
|
|
641
|
+
} catch (s) {
|
|
642
|
+
const i = this.elementContext.view.logger;
|
|
643
|
+
i.error(s), i.crash(s);
|
|
644
|
+
}
|
|
640
645
|
}));
|
|
641
646
|
}
|
|
642
647
|
unmount(e = !1) {
|
|
643
|
-
var
|
|
644
|
-
(
|
|
648
|
+
var n, s;
|
|
649
|
+
(n = this.unsubscribe) == null || n.call(this), this.isMounted && (this.cleanup(e), (s = this.domNode.parentNode) == null || s.removeChild(this.domNode));
|
|
645
650
|
}
|
|
646
651
|
cleanup(e) {
|
|
647
|
-
for (const
|
|
648
|
-
|
|
652
|
+
for (const n of this.children)
|
|
653
|
+
n.unmount(e);
|
|
649
654
|
this.children = [];
|
|
650
655
|
}
|
|
651
656
|
update(e) {
|
|
652
|
-
var
|
|
657
|
+
var o, f, p;
|
|
653
658
|
if (this.cleanup(!1), e == null || e.length === 0 || !this.isMounted)
|
|
654
659
|
return;
|
|
655
|
-
const
|
|
656
|
-
for (const g of
|
|
657
|
-
const
|
|
658
|
-
g.mount(this.domNode.parentNode,
|
|
660
|
+
const n = e.flatMap((g) => ve(g) ? g : M(this.elementContext, j(g)));
|
|
661
|
+
for (const g of n) {
|
|
662
|
+
const r = ((o = this.children.at(-1)) == null ? void 0 : o.domNode) || this.domNode;
|
|
663
|
+
g.mount(this.domNode.parentNode, r), this.children.push(g);
|
|
659
664
|
}
|
|
660
|
-
const
|
|
661
|
-
"moveBefore" in
|
|
665
|
+
const s = this.domNode.parentNode, i = ((p = (f = this.children.at(-1)) == null ? void 0 : f.domNode) == null ? void 0 : p.nextSibling) ?? null;
|
|
666
|
+
"moveBefore" in s ? s.moveBefore(this.domNode, i) : s.insertBefore(this.domNode, i);
|
|
662
667
|
}
|
|
663
668
|
}
|
|
664
669
|
var Y;
|
|
665
670
|
Y = x;
|
|
666
671
|
class me {
|
|
667
672
|
constructor(e) {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
673
|
+
c(this, Y, !0);
|
|
674
|
+
c(this, "domNode", document.createTextNode(""));
|
|
675
|
+
c(this, "isMounted", !1);
|
|
676
|
+
c(this, "source");
|
|
677
|
+
c(this, "elements", []);
|
|
678
|
+
c(this, "unsubscribe");
|
|
674
679
|
this.source = e;
|
|
675
680
|
}
|
|
676
|
-
mount(e,
|
|
677
|
-
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (
|
|
678
|
-
const
|
|
681
|
+
mount(e, n) {
|
|
682
|
+
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), m(this.source) ? this.unsubscribe = v(() => {
|
|
683
|
+
const s = w(this.source);
|
|
679
684
|
_(() => {
|
|
680
|
-
this.update(
|
|
685
|
+
this.update(s);
|
|
681
686
|
});
|
|
682
687
|
}) : this.update(this.elements));
|
|
683
688
|
}
|
|
@@ -685,18 +690,18 @@ class me {
|
|
|
685
690
|
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
|
|
686
691
|
}
|
|
687
692
|
cleanup(e) {
|
|
688
|
-
for (const
|
|
689
|
-
|
|
693
|
+
for (const n of this.elements)
|
|
694
|
+
n.unmount(e);
|
|
690
695
|
this.elements = [];
|
|
691
696
|
}
|
|
692
697
|
update(e) {
|
|
693
|
-
var
|
|
698
|
+
var n, s;
|
|
694
699
|
if (this.cleanup(!1), e.length > 0) {
|
|
695
700
|
for (let i = 0; i < e.length; i++) {
|
|
696
|
-
const
|
|
697
|
-
|
|
701
|
+
const o = e[i], f = i > 0 ? this.elements[i - 1] : void 0;
|
|
702
|
+
o.mount(this.domNode.parentElement, f == null ? void 0 : f.domNode), this.elements.push(o);
|
|
698
703
|
}
|
|
699
|
-
(
|
|
704
|
+
(s = this.domNode.parentNode) == null || s.insertBefore(this.domNode, ((n = this.elements.at(-1)) == null ? void 0 : n.domNode) ?? null);
|
|
700
705
|
}
|
|
701
706
|
}
|
|
702
707
|
}
|
|
@@ -704,255 +709,260 @@ const qe = (t) => /^on[A-Z]/.test(t);
|
|
|
704
709
|
var ee;
|
|
705
710
|
ee = x;
|
|
706
711
|
class Ue {
|
|
707
|
-
constructor({ tag: e, props:
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
712
|
+
constructor({ tag: e, props: n, children: s, elementContext: i }) {
|
|
713
|
+
c(this, ee, !0);
|
|
714
|
+
c(this, "domNode");
|
|
715
|
+
c(this, "props");
|
|
716
|
+
c(this, "childMarkup", []);
|
|
717
|
+
c(this, "children", []);
|
|
718
|
+
c(this, "unsubscribers", []);
|
|
719
|
+
c(this, "elementContext");
|
|
720
|
+
c(this, "logger");
|
|
715
721
|
// Track the ref so we can nullify it on unmount.
|
|
716
|
-
|
|
722
|
+
c(this, "ref");
|
|
717
723
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
718
|
-
|
|
724
|
+
c(this, "canClickAway", !1);
|
|
719
725
|
if (e.toLowerCase() === "svg" && (i = {
|
|
720
726
|
...i,
|
|
721
727
|
isSVG: !0
|
|
722
|
-
}), i.isSVG ? this.domNode = document.createElementNS("http://www.w3.org/2000/svg", e) : this.domNode = document.createElement(e), i.root.getEnv() === "development" && i.
|
|
723
|
-
if (m(
|
|
724
|
-
this.ref =
|
|
728
|
+
}), this.logger = i.view.logger, i.isSVG ? this.domNode = document.createElementNS("http://www.w3.org/2000/svg", e) : this.domNode = document.createElement(e), i.root.getEnv() === "development" && i.view.name && (this.domNode.dataset.view = i.view.name), n.ref)
|
|
729
|
+
if (m(n.ref))
|
|
730
|
+
this.ref = n.ref, this.ref(this.domNode);
|
|
725
731
|
else
|
|
726
|
-
throw new Error("Expected ref to be a function. Got: " +
|
|
732
|
+
throw new Error("Expected ref to be a function. Got: " + n.ref);
|
|
727
733
|
this.props = {
|
|
728
|
-
..._e(["ref", "class", "className"],
|
|
729
|
-
class:
|
|
730
|
-
},
|
|
734
|
+
..._e(["ref", "class", "className"], n),
|
|
735
|
+
class: n.className ?? n.class
|
|
736
|
+
}, s && (this.childMarkup = j(s)), this.elementContext = i;
|
|
731
737
|
}
|
|
732
738
|
get isMounted() {
|
|
733
739
|
return this.domNode.parentNode != null;
|
|
734
740
|
}
|
|
735
|
-
mount(e,
|
|
741
|
+
mount(e, n) {
|
|
736
742
|
if (e == null)
|
|
737
743
|
throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
|
|
738
744
|
if (!this.isMounted) {
|
|
739
745
|
this.childMarkup.length > 0 && (this.children = M(this.elementContext, this.childMarkup));
|
|
740
|
-
for (let
|
|
741
|
-
const i = this.children[
|
|
742
|
-
i.mount(this.domNode,
|
|
746
|
+
for (let s = 0; s < this.children.length; s++) {
|
|
747
|
+
const i = this.children[s], o = s > 0 ? this.children[s - 1].domNode : void 0;
|
|
748
|
+
i.mount(this.domNode, o);
|
|
743
749
|
}
|
|
744
750
|
this.applyProps(this.domNode, this.props), this.props.style && this.applyStyles(this.domNode, this.props.style, this.unsubscribers), this.props.class && this.applyClasses(this.domNode, this.props.class, this.unsubscribers);
|
|
745
751
|
}
|
|
746
|
-
e.insertBefore(this.domNode, (
|
|
752
|
+
e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), setTimeout(() => {
|
|
747
753
|
this.canClickAway = !0;
|
|
748
754
|
}, 0);
|
|
749
755
|
}
|
|
750
756
|
unmount(e = !1) {
|
|
751
|
-
var
|
|
757
|
+
var n;
|
|
752
758
|
if (this.isMounted) {
|
|
753
|
-
e || (
|
|
754
|
-
for (const
|
|
755
|
-
|
|
759
|
+
e || (n = this.domNode.parentNode) == null || n.removeChild(this.domNode);
|
|
760
|
+
for (const s of this.children)
|
|
761
|
+
s.unmount(!0);
|
|
756
762
|
this.ref && this.ref(void 0), this.canClickAway = !1;
|
|
757
|
-
for (const
|
|
758
|
-
|
|
763
|
+
for (const s of this.unsubscribers)
|
|
764
|
+
s();
|
|
759
765
|
this.unsubscribers.length = 0;
|
|
760
766
|
}
|
|
761
767
|
}
|
|
762
|
-
attachProp(e,
|
|
768
|
+
attachProp(e, n) {
|
|
763
769
|
m(e) ? this.unsubscribers.push(
|
|
764
|
-
|
|
765
|
-
|
|
770
|
+
v(() => {
|
|
771
|
+
try {
|
|
772
|
+
n(e());
|
|
773
|
+
} catch (s) {
|
|
774
|
+
this.logger.error(s), this.logger.crash(s);
|
|
775
|
+
}
|
|
766
776
|
})
|
|
767
|
-
) :
|
|
777
|
+
) : n(e);
|
|
768
778
|
}
|
|
769
|
-
applyProps(e,
|
|
770
|
-
for (const
|
|
771
|
-
const i = s
|
|
772
|
-
if (
|
|
773
|
-
const
|
|
779
|
+
applyProps(e, n) {
|
|
780
|
+
for (const s in n) {
|
|
781
|
+
const i = n[s];
|
|
782
|
+
if (s === "on:clickoutside" || s === "onClickOutside" || s === "onclickoutside") {
|
|
783
|
+
const o = (p) => {
|
|
774
784
|
this.canClickAway && !e.contains(p.target) && i(p);
|
|
775
|
-
},
|
|
776
|
-
window.addEventListener("click",
|
|
777
|
-
window.removeEventListener("click",
|
|
785
|
+
}, f = { capture: !0 };
|
|
786
|
+
window.addEventListener("click", o, f), this.unsubscribers.push(() => {
|
|
787
|
+
window.removeEventListener("click", o, f);
|
|
778
788
|
});
|
|
779
|
-
} else if (m(i) && qe(
|
|
780
|
-
const
|
|
781
|
-
e.addEventListener(
|
|
782
|
-
e.removeEventListener(
|
|
789
|
+
} else if (m(i) && qe(s)) {
|
|
790
|
+
const o = s.slice(2).toLowerCase(), f = i;
|
|
791
|
+
e.addEventListener(o, f), this.unsubscribers.push(() => {
|
|
792
|
+
e.removeEventListener(o, f);
|
|
783
793
|
});
|
|
784
|
-
} else if (m(i) && Re.includes(
|
|
785
|
-
const
|
|
786
|
-
e.addEventListener(
|
|
787
|
-
e.removeEventListener(
|
|
794
|
+
} else if (m(i) && Re.includes(s)) {
|
|
795
|
+
const o = s.substring(2);
|
|
796
|
+
e.addEventListener(o, i), this.unsubscribers.push(() => {
|
|
797
|
+
e.removeEventListener(o, i);
|
|
788
798
|
});
|
|
789
|
-
} else if (
|
|
790
|
-
this.attachProp(i, (
|
|
791
|
-
|
|
799
|
+
} else if (s.includes("-"))
|
|
800
|
+
this.attachProp(i, (o) => {
|
|
801
|
+
o == null ? e.removeAttribute(s) : e.setAttribute(s, String(o));
|
|
792
802
|
});
|
|
793
|
-
else if (!Ve.includes(
|
|
803
|
+
else if (!Ve.includes(s))
|
|
794
804
|
if (this.elementContext.isSVG)
|
|
795
|
-
this.attachProp(i, (
|
|
796
|
-
|
|
805
|
+
this.attachProp(i, (o) => {
|
|
806
|
+
o != null ? e.setAttribute(s, String(n[s])) : e.removeAttribute(s);
|
|
797
807
|
});
|
|
798
808
|
else
|
|
799
|
-
switch (
|
|
809
|
+
switch (s) {
|
|
800
810
|
case "contentEditable":
|
|
801
811
|
case "value":
|
|
802
|
-
this.attachProp(i, (
|
|
803
|
-
e[
|
|
812
|
+
this.attachProp(i, (o) => {
|
|
813
|
+
e[s] = String(o);
|
|
804
814
|
});
|
|
805
815
|
break;
|
|
806
816
|
case "for":
|
|
807
|
-
this.attachProp(i, (
|
|
808
|
-
e.htmlFor =
|
|
817
|
+
this.attachProp(i, (o) => {
|
|
818
|
+
e.htmlFor = o;
|
|
809
819
|
});
|
|
810
820
|
break;
|
|
811
821
|
case "title":
|
|
812
|
-
this.attachProp(i, (
|
|
813
|
-
|
|
822
|
+
this.attachProp(i, (o) => {
|
|
823
|
+
o == null ? e.removeAttribute(s) : e.setAttribute(s, String(o));
|
|
814
824
|
});
|
|
815
825
|
case "checked":
|
|
816
|
-
this.attachProp(i, (
|
|
817
|
-
e.checked =
|
|
826
|
+
this.attachProp(i, (o) => {
|
|
827
|
+
e.checked = o, o ? e.setAttribute("checked", "") : e.removeAttribute("checked");
|
|
818
828
|
});
|
|
819
829
|
break;
|
|
820
830
|
case "autocomplete":
|
|
821
831
|
case "autocapitalize":
|
|
822
|
-
this.attachProp(i, (
|
|
823
|
-
typeof
|
|
832
|
+
this.attachProp(i, (o) => {
|
|
833
|
+
typeof o == "string" ? e[s] = o : o ? e[s] = "on" : e[s] = "off";
|
|
824
834
|
});
|
|
825
835
|
break;
|
|
826
836
|
default: {
|
|
827
|
-
if (
|
|
828
|
-
const
|
|
829
|
-
this.attachProp(i, (
|
|
830
|
-
e[
|
|
837
|
+
if (s.startsWith("prop:")) {
|
|
838
|
+
const o = s.substring(5);
|
|
839
|
+
this.attachProp(i, (f) => {
|
|
840
|
+
e[o] = f;
|
|
831
841
|
});
|
|
832
|
-
} else if (
|
|
833
|
-
const
|
|
834
|
-
let
|
|
835
|
-
m(i) ? (e.addEventListener(
|
|
836
|
-
e.removeEventListener(
|
|
842
|
+
} else if (s.startsWith("on:")) {
|
|
843
|
+
const o = s.substring(3);
|
|
844
|
+
let f;
|
|
845
|
+
m(i) ? (e.addEventListener(o, i), this.unsubscribers.push(() => {
|
|
846
|
+
e.removeEventListener(o, i);
|
|
837
847
|
})) : this.attachProp(i, (p) => {
|
|
838
|
-
!p &&
|
|
848
|
+
!p && f ? e.removeEventListener(o, f) : p != null && (f && f !== p && e.removeEventListener(o, f), e.addEventListener(o, p)), f = p;
|
|
839
849
|
});
|
|
840
|
-
} else if (
|
|
841
|
-
const
|
|
842
|
-
this.attachProp(i, (
|
|
843
|
-
|
|
850
|
+
} else if (s.startsWith("attr:")) {
|
|
851
|
+
const o = s.substring(5).toLowerCase();
|
|
852
|
+
this.attachProp(i, (f) => {
|
|
853
|
+
f != null ? e.setAttribute(o, String(f)) : e.removeAttribute(o);
|
|
844
854
|
});
|
|
845
855
|
} else
|
|
846
|
-
this.attachProp(i, (
|
|
847
|
-
e[
|
|
856
|
+
this.attachProp(i, (o) => {
|
|
857
|
+
e[s] = o;
|
|
848
858
|
});
|
|
849
859
|
break;
|
|
850
860
|
}
|
|
851
861
|
}
|
|
852
862
|
}
|
|
853
863
|
}
|
|
854
|
-
applyStyles(e,
|
|
864
|
+
applyStyles(e, n, s) {
|
|
855
865
|
const i = [];
|
|
856
|
-
if (m(
|
|
857
|
-
let
|
|
858
|
-
const
|
|
859
|
-
m(
|
|
866
|
+
if (m(n)) {
|
|
867
|
+
let o;
|
|
868
|
+
const f = v(() => {
|
|
869
|
+
m(o) && o(), e.style.cssText = "", o = this.applyStyles(e, w(n), s);
|
|
860
870
|
});
|
|
861
|
-
|
|
871
|
+
s.push(f), i.push(f);
|
|
862
872
|
} else {
|
|
863
|
-
const
|
|
864
|
-
for (const
|
|
865
|
-
const { value: p, priority: g } =
|
|
873
|
+
const o = ye(n);
|
|
874
|
+
for (const f in o) {
|
|
875
|
+
const { value: p, priority: g } = o[f];
|
|
866
876
|
if (m(p)) {
|
|
867
|
-
const
|
|
868
|
-
|
|
877
|
+
const r = v(() => {
|
|
878
|
+
w(p) ? e.style.setProperty(f, String(w(p)), g) : e.style.removeProperty(f);
|
|
869
879
|
});
|
|
870
|
-
|
|
871
|
-
} else p != null && e.style.setProperty(
|
|
880
|
+
s.push(r), i.push(r);
|
|
881
|
+
} else p != null && e.style.setProperty(f, String(p));
|
|
872
882
|
}
|
|
873
883
|
}
|
|
874
884
|
return function() {
|
|
875
|
-
for (const
|
|
876
|
-
|
|
885
|
+
for (const f of i)
|
|
886
|
+
f(), s.splice(s.indexOf(f), 1);
|
|
877
887
|
};
|
|
878
888
|
}
|
|
879
|
-
applyClasses(e,
|
|
889
|
+
applyClasses(e, n, s) {
|
|
880
890
|
const i = [];
|
|
881
|
-
if (m(
|
|
882
|
-
let
|
|
883
|
-
const
|
|
884
|
-
m(
|
|
891
|
+
if (m(n)) {
|
|
892
|
+
let o;
|
|
893
|
+
const f = v(() => {
|
|
894
|
+
m(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, w(n), s);
|
|
885
895
|
});
|
|
886
|
-
|
|
896
|
+
s.push(f), i.push(f);
|
|
887
897
|
} else {
|
|
888
|
-
const
|
|
889
|
-
for (const
|
|
890
|
-
const p =
|
|
898
|
+
const o = ge(n);
|
|
899
|
+
for (const f in o) {
|
|
900
|
+
const p = o[f];
|
|
891
901
|
if (m(p)) {
|
|
892
|
-
const g =
|
|
893
|
-
|
|
902
|
+
const g = v(() => {
|
|
903
|
+
w(p) ? e.classList.add(f) : e.classList.remove(f);
|
|
894
904
|
});
|
|
895
|
-
|
|
896
|
-
} else p && e.classList.add(
|
|
905
|
+
s.push(g), i.push(g);
|
|
906
|
+
} else p && e.classList.add(f);
|
|
897
907
|
}
|
|
898
908
|
}
|
|
899
909
|
return function() {
|
|
900
|
-
for (const
|
|
901
|
-
|
|
910
|
+
for (const f of i)
|
|
911
|
+
f(), s.splice(s.indexOf(f), 1);
|
|
902
912
|
};
|
|
903
913
|
}
|
|
904
914
|
}
|
|
905
915
|
function ge(t) {
|
|
906
916
|
let e = {};
|
|
907
|
-
if (
|
|
908
|
-
const
|
|
909
|
-
for (const
|
|
910
|
-
e[
|
|
911
|
-
} else R(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((
|
|
912
|
-
Object.assign(e, ge(
|
|
917
|
+
if (L(t)) {
|
|
918
|
+
const n = t.split(" ");
|
|
919
|
+
for (const s of n)
|
|
920
|
+
e[s] = !0;
|
|
921
|
+
} else R(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((n) => {
|
|
922
|
+
Object.assign(e, ge(n));
|
|
913
923
|
});
|
|
914
924
|
return delete e.undefined, e;
|
|
915
925
|
}
|
|
916
|
-
function
|
|
926
|
+
function ye(t) {
|
|
917
927
|
let e = {};
|
|
918
|
-
if (
|
|
919
|
-
const
|
|
920
|
-
for (const
|
|
921
|
-
const [i,
|
|
922
|
-
value:
|
|
928
|
+
if (L(t)) {
|
|
929
|
+
const n = t.split(";").filter((s) => s.trim() !== "");
|
|
930
|
+
for (const s of n) {
|
|
931
|
+
const [i, o] = s.split(":"), f = {
|
|
932
|
+
value: o
|
|
923
933
|
};
|
|
924
|
-
|
|
934
|
+
o.includes("!important") ? (f.priority = "important", f.value = o.replace("!important", "").trim()) : f.value = o.trim(), e[X(i.trim())] = f;
|
|
925
935
|
}
|
|
926
936
|
}
|
|
927
937
|
if (R(t))
|
|
928
|
-
for (const
|
|
929
|
-
|
|
930
|
-
else Array.isArray(t) && Array.from(t).filter((
|
|
931
|
-
Object.assign(e,
|
|
938
|
+
for (const n in t)
|
|
939
|
+
n.startsWith("--") ? e[n] = { value: t[n] } : e[X(n)] = { value: t[n] };
|
|
940
|
+
else Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
|
|
941
|
+
Object.assign(e, ye(n));
|
|
932
942
|
});
|
|
933
943
|
return e;
|
|
934
944
|
}
|
|
935
945
|
function X(t) {
|
|
936
|
-
return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e,
|
|
946
|
+
return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, n) => (n ? "-" : "") + e.toLowerCase());
|
|
937
947
|
}
|
|
938
948
|
const Ve = ["ref", "children", "class", "style", "data"], Re = ["onsubmit", "onclick", "ontransitionend"];
|
|
939
949
|
var te;
|
|
940
950
|
te = x;
|
|
941
951
|
class Be {
|
|
942
952
|
constructor(e) {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
953
|
+
c(this, te, !0);
|
|
954
|
+
c(this, "domNode", document.createTextNode(""));
|
|
955
|
+
c(this, "isMounted", !1);
|
|
956
|
+
c(this, "view");
|
|
957
|
+
c(this, "mountedView");
|
|
958
|
+
c(this, "unsubscribe");
|
|
949
959
|
this.view = e;
|
|
950
960
|
}
|
|
951
|
-
mount(e,
|
|
952
|
-
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (
|
|
953
|
-
const
|
|
961
|
+
mount(e, n) {
|
|
962
|
+
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), this.unsubscribe = v(() => {
|
|
963
|
+
const s = this.view();
|
|
954
964
|
_(() => {
|
|
955
|
-
this.update(
|
|
965
|
+
this.update(s);
|
|
956
966
|
});
|
|
957
967
|
}));
|
|
958
968
|
}
|
|
@@ -970,30 +980,30 @@ var se;
|
|
|
970
980
|
se = x;
|
|
971
981
|
class Ge {
|
|
972
982
|
constructor(e) {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
983
|
+
c(this, se, !0);
|
|
984
|
+
c(this, "config");
|
|
985
|
+
c(this, "element");
|
|
976
986
|
this.config = e;
|
|
977
987
|
}
|
|
978
988
|
get isMounted() {
|
|
979
989
|
return this.element ? this.element.isMounted : !1;
|
|
980
990
|
}
|
|
981
|
-
mount(e,
|
|
982
|
-
const { content:
|
|
983
|
-
|
|
991
|
+
mount(e, n) {
|
|
992
|
+
const { content: s, parent: i } = this.config;
|
|
993
|
+
ve(s) ? this.element = s : this.element = A(M(this.config.elementContext, j(s))), this.element.mount(i);
|
|
984
994
|
}
|
|
985
995
|
unmount(e = !1) {
|
|
986
|
-
var
|
|
987
|
-
(
|
|
996
|
+
var n;
|
|
997
|
+
(n = this.element) != null && n.isMounted && this.element.unmount(!1);
|
|
988
998
|
}
|
|
989
999
|
}
|
|
990
1000
|
let ze = class {
|
|
991
1001
|
constructor(e) {
|
|
992
|
-
|
|
1002
|
+
c(this, "store");
|
|
993
1003
|
this.store = e;
|
|
994
|
-
const
|
|
995
|
-
for (const
|
|
996
|
-
|
|
1004
|
+
const n = Object.getOwnPropertyDescriptors(this.store.logger);
|
|
1005
|
+
for (const s in n)
|
|
1006
|
+
s !== "setName" && Object.defineProperty(this, s, n[s]);
|
|
997
1007
|
}
|
|
998
1008
|
get isMounted() {
|
|
999
1009
|
return this.store.isMounted;
|
|
@@ -1006,12 +1016,12 @@ let ze = class {
|
|
|
1006
1016
|
}
|
|
1007
1017
|
get(e) {
|
|
1008
1018
|
if (m(e)) {
|
|
1009
|
-
let
|
|
1010
|
-
for (;
|
|
1011
|
-
|
|
1012
|
-
if (
|
|
1019
|
+
let n = this.store.elementContext, s;
|
|
1020
|
+
for (; s = n.stores.get(e), s == null && n.parent != null; )
|
|
1021
|
+
n = n.parent;
|
|
1022
|
+
if (s == null)
|
|
1013
1023
|
throw new O(`Store '${e.name}' is not provided on this context.`);
|
|
1014
|
-
return
|
|
1024
|
+
return s.value;
|
|
1015
1025
|
} else
|
|
1016
1026
|
throw new O("Invalid store.");
|
|
1017
1027
|
}
|
|
@@ -1022,35 +1032,41 @@ let ze = class {
|
|
|
1022
1032
|
this.store.lifecycleListeners.unmount.push(e);
|
|
1023
1033
|
}
|
|
1024
1034
|
effect(e) {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1035
|
+
const n = this.store, s = () => {
|
|
1036
|
+
try {
|
|
1037
|
+
e();
|
|
1038
|
+
} catch (i) {
|
|
1039
|
+
i instanceof Error ? this.crash(i) : typeof i == "string" ? this.crash(new Error(i)) : (this.error(i), this.crash(new Error("Unknown error thrown in effect callback")));
|
|
1040
|
+
}
|
|
1041
|
+
};
|
|
1042
|
+
if (n.isMounted) {
|
|
1043
|
+
const i = v(s);
|
|
1044
|
+
return n.lifecycleListeners.unmount.push(i), i;
|
|
1029
1045
|
} else {
|
|
1030
|
-
let
|
|
1031
|
-
return
|
|
1032
|
-
|
|
1046
|
+
let i, o = !1;
|
|
1047
|
+
return n.lifecycleListeners.mount.push(() => {
|
|
1048
|
+
o || (i = v(s), n.lifecycleListeners.unmount.push(i));
|
|
1033
1049
|
}), () => {
|
|
1034
|
-
|
|
1050
|
+
i != null && (o = !0, i());
|
|
1035
1051
|
};
|
|
1036
1052
|
}
|
|
1037
1053
|
}
|
|
1038
1054
|
};
|
|
1039
1055
|
class Fe {
|
|
1040
|
-
constructor(e,
|
|
1041
|
-
|
|
1042
|
-
|
|
1056
|
+
constructor(e, n) {
|
|
1057
|
+
c(this, "fn");
|
|
1058
|
+
c(this, "_options");
|
|
1043
1059
|
/**
|
|
1044
1060
|
* Value is guaranteed to be set after `attach` is called.
|
|
1045
1061
|
*/
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
this.fn = e, this.name = e.name, this._options =
|
|
1062
|
+
c(this, "value");
|
|
1063
|
+
c(this, "isMounted", !1);
|
|
1064
|
+
c(this, "elementContext");
|
|
1065
|
+
c(this, "lifecycleListeners", { mount: [], unmount: [] });
|
|
1066
|
+
c(this, "logger");
|
|
1067
|
+
c(this, "id", pe());
|
|
1068
|
+
c(this, "name");
|
|
1069
|
+
this.fn = e, this.name = e.name, this._options = n;
|
|
1054
1070
|
}
|
|
1055
1071
|
/**
|
|
1056
1072
|
* Attaches this Store to the elementContext.
|
|
@@ -1060,11 +1076,11 @@ class Fe {
|
|
|
1060
1076
|
if (e.stores.has(this.fn))
|
|
1061
1077
|
return !1;
|
|
1062
1078
|
this.elementContext = e, this.logger = e.root.createLogger(this.name);
|
|
1063
|
-
const
|
|
1079
|
+
const n = new ze(this);
|
|
1064
1080
|
try {
|
|
1065
|
-
this.value = this.fn.call(
|
|
1066
|
-
} catch (
|
|
1067
|
-
throw this.logger.crash(
|
|
1081
|
+
this.value = this.fn.call(n, this._options, n);
|
|
1082
|
+
} catch (s) {
|
|
1083
|
+
throw this.logger.crash(s), s;
|
|
1068
1084
|
}
|
|
1069
1085
|
return e.stores.set(this.fn, this), !0;
|
|
1070
1086
|
}
|
|
@@ -1085,11 +1101,11 @@ class O extends Error {
|
|
|
1085
1101
|
}
|
|
1086
1102
|
class We {
|
|
1087
1103
|
constructor(e) {
|
|
1088
|
-
|
|
1104
|
+
c(this, "view");
|
|
1089
1105
|
this.view = e;
|
|
1090
|
-
const
|
|
1091
|
-
for (const
|
|
1092
|
-
|
|
1106
|
+
const n = Object.getOwnPropertyDescriptors(this.view.logger);
|
|
1107
|
+
for (const s in n)
|
|
1108
|
+
s !== "setName" && Object.defineProperty(this, s, n[s]);
|
|
1093
1109
|
}
|
|
1094
1110
|
get uid() {
|
|
1095
1111
|
return this.view.uniqueId;
|
|
@@ -1098,32 +1114,32 @@ class We {
|
|
|
1098
1114
|
return this.view.isMounted;
|
|
1099
1115
|
}
|
|
1100
1116
|
get name() {
|
|
1101
|
-
return this.view.
|
|
1117
|
+
return this.view.name || this.uid;
|
|
1102
1118
|
}
|
|
1103
1119
|
set name(e) {
|
|
1104
|
-
this.view.
|
|
1120
|
+
this.view.name = e, this.view.logger.setName(e);
|
|
1105
1121
|
}
|
|
1106
|
-
provide(e,
|
|
1107
|
-
const
|
|
1108
|
-
if (
|
|
1122
|
+
provide(e, n) {
|
|
1123
|
+
const s = new Fe(e, n);
|
|
1124
|
+
if (s.attach(this.view.elementContext))
|
|
1109
1125
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1110
|
-
|
|
1126
|
+
s.handleMount();
|
|
1111
1127
|
}), this.view.lifecycleListeners.unmount.push(() => {
|
|
1112
|
-
|
|
1113
|
-
}),
|
|
1128
|
+
s.handleUnmount();
|
|
1129
|
+
}), s.value;
|
|
1114
1130
|
{
|
|
1115
|
-
let
|
|
1116
|
-
return this.view.logger.warn(`An instance of ${
|
|
1131
|
+
let o = e.name ? `'${e.name}'` : "this store";
|
|
1132
|
+
return this.view.logger.warn(`An instance of ${o} was already attached to this context.`), this.get(e);
|
|
1117
1133
|
}
|
|
1118
1134
|
}
|
|
1119
1135
|
get(e) {
|
|
1120
1136
|
if (m(e)) {
|
|
1121
|
-
let
|
|
1122
|
-
for (;
|
|
1123
|
-
|
|
1124
|
-
if (
|
|
1137
|
+
let n = this.view.elementContext, s;
|
|
1138
|
+
for (; s = n.stores.get(e), s == null && n.parent != null; )
|
|
1139
|
+
n = n.parent;
|
|
1140
|
+
if (s == null)
|
|
1125
1141
|
throw new O(`Store '${e.name}' is not provided on this context.`);
|
|
1126
|
-
return
|
|
1142
|
+
return s.value;
|
|
1127
1143
|
} else
|
|
1128
1144
|
throw new O("Invalid store.");
|
|
1129
1145
|
}
|
|
@@ -1140,15 +1156,22 @@ class We {
|
|
|
1140
1156
|
this.view.lifecycleListeners.unmount.push(e);
|
|
1141
1157
|
}
|
|
1142
1158
|
effect(e) {
|
|
1159
|
+
const n = () => {
|
|
1160
|
+
try {
|
|
1161
|
+
e();
|
|
1162
|
+
} catch (s) {
|
|
1163
|
+
this.error(s), s instanceof Error ? this.crash(s) : typeof s == "string" ? this.crash(new Error(s)) : this.crash(new Error("Unknown error thrown in effect callback"));
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1143
1166
|
if (this.view.isMounted) {
|
|
1144
|
-
const s =
|
|
1167
|
+
const s = v(n);
|
|
1145
1168
|
return this.view.lifecycleListeners.unmount.push(s), s;
|
|
1146
1169
|
} else {
|
|
1147
|
-
let s,
|
|
1170
|
+
let s, i = !1;
|
|
1148
1171
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1149
|
-
|
|
1172
|
+
i || (s = v(n), this.view.lifecycleListeners.unmount.push(s));
|
|
1150
1173
|
}), () => {
|
|
1151
|
-
s != null && (
|
|
1174
|
+
s != null && (i = !0, s());
|
|
1152
1175
|
};
|
|
1153
1176
|
}
|
|
1154
1177
|
}
|
|
@@ -1159,26 +1182,28 @@ class We {
|
|
|
1159
1182
|
var ne;
|
|
1160
1183
|
ne = x;
|
|
1161
1184
|
const F = class F {
|
|
1162
|
-
constructor(e,
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
this
|
|
1185
|
+
constructor(e, n, s, i) {
|
|
1186
|
+
c(this, ne, !0);
|
|
1187
|
+
c(this, "uniqueId", pe());
|
|
1188
|
+
c(this, "elementContext");
|
|
1189
|
+
c(this, "logger");
|
|
1190
|
+
c(this, "props");
|
|
1191
|
+
c(this, "fn");
|
|
1192
|
+
c(this, "element");
|
|
1193
|
+
c(this, "name");
|
|
1194
|
+
c(this, "context");
|
|
1195
|
+
c(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
|
|
1196
|
+
c(this, "isMounted", !1);
|
|
1197
|
+
this.name = n.name || "🌇 anonymous view", this.elementContext = {
|
|
1173
1198
|
...e,
|
|
1174
1199
|
parent: e,
|
|
1175
|
-
|
|
1200
|
+
view: this,
|
|
1176
1201
|
stores: /* @__PURE__ */ new Map(),
|
|
1177
1202
|
route: D()
|
|
1178
|
-
}, this.logger = e.root.createLogger(
|
|
1179
|
-
...
|
|
1203
|
+
}, this.logger = e.root.createLogger(this.name, { uid: this.uniqueId }), this.props = {
|
|
1204
|
+
...s,
|
|
1180
1205
|
children: i
|
|
1181
|
-
}, this.fn =
|
|
1206
|
+
}, this.fn = n, this.context = new We(this);
|
|
1182
1207
|
}
|
|
1183
1208
|
/*===============================*\
|
|
1184
1209
|
|| "Public" API ||
|
|
@@ -1187,54 +1212,54 @@ const F = class F {
|
|
|
1187
1212
|
var e;
|
|
1188
1213
|
return (e = this.element) == null ? void 0 : e.domNode;
|
|
1189
1214
|
}
|
|
1190
|
-
mount(e,
|
|
1191
|
-
const
|
|
1192
|
-
if (!
|
|
1215
|
+
mount(e, n) {
|
|
1216
|
+
const s = this.isMounted;
|
|
1217
|
+
if (!s) {
|
|
1193
1218
|
this._initialize();
|
|
1194
1219
|
for (const i of this.lifecycleListeners.beforeMount)
|
|
1195
1220
|
i();
|
|
1196
1221
|
}
|
|
1197
|
-
this.element && this.element.mount(e,
|
|
1222
|
+
this.element && this.element.mount(e, n), s || (this.isMounted = !0, requestAnimationFrame(() => {
|
|
1198
1223
|
for (const i of this.lifecycleListeners.mount)
|
|
1199
1224
|
i();
|
|
1200
1225
|
}));
|
|
1201
1226
|
}
|
|
1202
1227
|
unmount(e = !1) {
|
|
1203
|
-
for (const
|
|
1204
|
-
|
|
1228
|
+
for (const n of this.lifecycleListeners.beforeUnmount)
|
|
1229
|
+
n();
|
|
1205
1230
|
this.element && this.element.unmount(e), this.isMounted = !1;
|
|
1206
|
-
for (const
|
|
1207
|
-
|
|
1231
|
+
for (const n of this.lifecycleListeners.unmount)
|
|
1232
|
+
n();
|
|
1208
1233
|
this.lifecycleListeners.beforeMount.length = 0, this.lifecycleListeners.mount.length = 0, this.lifecycleListeners.beforeUnmount.length = 0, this.lifecycleListeners.unmount.length = 0;
|
|
1209
1234
|
}
|
|
1210
1235
|
setRouteView(e) {
|
|
1211
|
-
const
|
|
1212
|
-
return this.elementContext.route(
|
|
1236
|
+
const n = new F(this.elementContext, e, {});
|
|
1237
|
+
return this.elementContext.route(n), n;
|
|
1213
1238
|
}
|
|
1214
1239
|
/*===============================*\
|
|
1215
1240
|
|| Internal ||
|
|
1216
1241
|
\*===============================*/
|
|
1217
1242
|
_initialize() {
|
|
1218
|
-
const e =
|
|
1219
|
-
let
|
|
1243
|
+
const { context: e } = this;
|
|
1244
|
+
let n;
|
|
1220
1245
|
try {
|
|
1221
|
-
|
|
1222
|
-
} catch (
|
|
1223
|
-
throw
|
|
1246
|
+
n = this.fn.call(e, this.props, e);
|
|
1247
|
+
} catch (s) {
|
|
1248
|
+
throw s instanceof Error && this.logger.crash(s), s;
|
|
1224
1249
|
}
|
|
1225
|
-
if (
|
|
1226
|
-
this.element = A(M(this.elementContext, N("$node", { value:
|
|
1227
|
-
else if (m(
|
|
1250
|
+
if (n !== null) if (n instanceof Node)
|
|
1251
|
+
this.element = A(M(this.elementContext, N("$node", { value: n })));
|
|
1252
|
+
else if (m(n))
|
|
1228
1253
|
this.element = A(
|
|
1229
|
-
M(this.elementContext, N("$dynamic", { source:
|
|
1254
|
+
M(this.elementContext, N("$dynamic", { source: n }))
|
|
1230
1255
|
);
|
|
1231
|
-
else if ($(
|
|
1232
|
-
this.element = A(M(this.elementContext,
|
|
1256
|
+
else if ($(n) || V($, n))
|
|
1257
|
+
this.element = A(M(this.elementContext, n));
|
|
1233
1258
|
else {
|
|
1234
|
-
const
|
|
1235
|
-
`Expected '${this.fn.name}' function to return a DOM node, Markup element, Signal or null. Got: ${
|
|
1259
|
+
const s = new TypeError(
|
|
1260
|
+
`Expected '${this.fn.name}' function to return a DOM node, Markup element, Signal or null. Got: ${k(n)}`
|
|
1236
1261
|
);
|
|
1237
|
-
this.logger.crash(
|
|
1262
|
+
this.logger.crash(s);
|
|
1238
1263
|
}
|
|
1239
1264
|
}
|
|
1240
1265
|
};
|
|
@@ -1242,60 +1267,60 @@ let P = F;
|
|
|
1242
1267
|
var ie;
|
|
1243
1268
|
ie = x;
|
|
1244
1269
|
class Ze {
|
|
1245
|
-
constructor({ elementContext: e, items:
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
this.elementContext = e, this.items =
|
|
1270
|
+
constructor({ elementContext: e, items: n, renderFn: s, keyFn: i }) {
|
|
1271
|
+
c(this, ie, !0);
|
|
1272
|
+
c(this, "domNode", document.createTextNode(""));
|
|
1273
|
+
c(this, "items");
|
|
1274
|
+
c(this, "unsubscribe", null);
|
|
1275
|
+
c(this, "connectedItems", []);
|
|
1276
|
+
c(this, "elementContext");
|
|
1277
|
+
c(this, "renderFn");
|
|
1278
|
+
c(this, "keyFn");
|
|
1279
|
+
this.elementContext = e, this.items = n, this.renderFn = s, this.keyFn = i;
|
|
1255
1280
|
}
|
|
1256
1281
|
get isMounted() {
|
|
1257
1282
|
return this.domNode.parentNode != null;
|
|
1258
1283
|
}
|
|
1259
|
-
mount(e,
|
|
1260
|
-
this.isMounted || (e.insertBefore(this.domNode, (
|
|
1261
|
-
let
|
|
1262
|
-
|
|
1263
|
-
this._update(Array.from(
|
|
1284
|
+
mount(e, n) {
|
|
1285
|
+
this.isMounted || (e.insertBefore(this.domNode, (n == null ? void 0 : n.nextSibling) ?? null), this.unsubscribe = v(() => {
|
|
1286
|
+
let s = this.items();
|
|
1287
|
+
s == null && (s = [], console.log("repeat received empty value", s, this)), _(() => {
|
|
1288
|
+
this._update(Array.from(s));
|
|
1264
1289
|
});
|
|
1265
1290
|
}));
|
|
1266
1291
|
}
|
|
1267
1292
|
unmount(e = !1) {
|
|
1268
|
-
var
|
|
1269
|
-
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = null), !e && this.isMounted && ((
|
|
1293
|
+
var n;
|
|
1294
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = null), !e && this.isMounted && ((n = this.domNode.parentNode) == null || n.removeChild(this.domNode)), this._cleanup(e);
|
|
1270
1295
|
}
|
|
1271
1296
|
_cleanup(e) {
|
|
1272
|
-
for (const
|
|
1273
|
-
|
|
1297
|
+
for (const n of this.connectedItems)
|
|
1298
|
+
n.element.unmount(e);
|
|
1274
1299
|
this.connectedItems = [];
|
|
1275
1300
|
}
|
|
1276
1301
|
_update(e) {
|
|
1277
|
-
var
|
|
1302
|
+
var f, p, g;
|
|
1278
1303
|
if (e.length === 0 || !this.isMounted)
|
|
1279
1304
|
return this._cleanup(!1);
|
|
1280
|
-
const
|
|
1281
|
-
let
|
|
1282
|
-
for (const
|
|
1283
|
-
|
|
1284
|
-
key: this.keyFn(
|
|
1285
|
-
value:
|
|
1286
|
-
index:
|
|
1305
|
+
const n = [];
|
|
1306
|
+
let s = 0;
|
|
1307
|
+
for (const r of e)
|
|
1308
|
+
n.push({
|
|
1309
|
+
key: this.keyFn(r, s),
|
|
1310
|
+
value: r,
|
|
1311
|
+
index: s++
|
|
1287
1312
|
});
|
|
1288
1313
|
const i = [];
|
|
1289
|
-
for (const
|
|
1290
|
-
|
|
1291
|
-
for (const
|
|
1292
|
-
const u = this.connectedItems.find((l) => l.key ===
|
|
1314
|
+
for (const r of this.connectedItems)
|
|
1315
|
+
n.find((l) => l.key === r.key) || r.element.unmount(!1);
|
|
1316
|
+
for (const r of n) {
|
|
1317
|
+
const u = this.connectedItems.find((l) => l.key === r.key);
|
|
1293
1318
|
if (u)
|
|
1294
|
-
u.item(
|
|
1319
|
+
u.item(r.value), u.index(r.index), i[r.index] = u;
|
|
1295
1320
|
else {
|
|
1296
|
-
const l = D(
|
|
1297
|
-
i[
|
|
1298
|
-
key:
|
|
1321
|
+
const l = D(r.value, { equals: C }), d = D(r.index);
|
|
1322
|
+
i[r.index] = {
|
|
1323
|
+
key: r.key,
|
|
1299
1324
|
item: l,
|
|
1300
1325
|
index: d,
|
|
1301
1326
|
element: new P(this.elementContext, He, {
|
|
@@ -1306,93 +1331,93 @@ class Ze {
|
|
|
1306
1331
|
};
|
|
1307
1332
|
}
|
|
1308
1333
|
}
|
|
1309
|
-
for (let
|
|
1310
|
-
const u = i[
|
|
1334
|
+
for (let r = 0; r < i.length; r++) {
|
|
1335
|
+
const u = i[r], l = ((f = i[r - 1]) == null ? void 0 : f.element.domNode) ?? this.domNode;
|
|
1311
1336
|
u.element.mount(this.domNode.parentNode, l);
|
|
1312
1337
|
}
|
|
1313
1338
|
this.connectedItems = i;
|
|
1314
|
-
const
|
|
1315
|
-
(g = this.domNode.parentNode) == null || g.insertBefore(this.domNode,
|
|
1339
|
+
const o = ((p = i.at(-1)) == null ? void 0 : p.element.domNode) ?? this.domNode;
|
|
1340
|
+
(g = this.domNode.parentNode) == null || g.insertBefore(this.domNode, o.nextSibling);
|
|
1316
1341
|
}
|
|
1317
1342
|
}
|
|
1318
1343
|
function He(t, e) {
|
|
1319
1344
|
return e.name = "@RepeatItem", t.renderFn.call(e, t.item, t.index, e);
|
|
1320
1345
|
}
|
|
1321
1346
|
function $(t) {
|
|
1322
|
-
return t instanceof
|
|
1347
|
+
return t instanceof we;
|
|
1323
1348
|
}
|
|
1324
|
-
function
|
|
1349
|
+
function ve(t) {
|
|
1325
1350
|
return (t == null ? void 0 : t[x]) === !0;
|
|
1326
1351
|
}
|
|
1327
1352
|
function j(t) {
|
|
1328
|
-
|
|
1353
|
+
T(t) || (t = [t]);
|
|
1329
1354
|
const e = [];
|
|
1330
|
-
for (const
|
|
1331
|
-
if (!(
|
|
1332
|
-
if (
|
|
1333
|
-
e.push(N("$node", { value:
|
|
1355
|
+
for (const n of t)
|
|
1356
|
+
if (!(n == null || n === !1)) {
|
|
1357
|
+
if (n instanceof Node) {
|
|
1358
|
+
e.push(N("$node", { value: n }));
|
|
1334
1359
|
continue;
|
|
1335
1360
|
}
|
|
1336
|
-
if ($(
|
|
1337
|
-
e.push(
|
|
1361
|
+
if ($(n)) {
|
|
1362
|
+
e.push(n);
|
|
1338
1363
|
continue;
|
|
1339
1364
|
}
|
|
1340
|
-
if (m(
|
|
1341
|
-
e.push(N("$dynamic", { source:
|
|
1365
|
+
if (m(n)) {
|
|
1366
|
+
e.push(N("$dynamic", { source: n }));
|
|
1342
1367
|
continue;
|
|
1343
1368
|
}
|
|
1344
|
-
if (
|
|
1345
|
-
e.push(...j(
|
|
1369
|
+
if (T(n)) {
|
|
1370
|
+
e.push(...j(n));
|
|
1346
1371
|
continue;
|
|
1347
1372
|
}
|
|
1348
|
-
e.push(N("$text", { value:
|
|
1373
|
+
e.push(N("$text", { value: n }));
|
|
1349
1374
|
}
|
|
1350
1375
|
return e;
|
|
1351
1376
|
}
|
|
1352
|
-
function N(t, e, ...
|
|
1353
|
-
return new
|
|
1377
|
+
function N(t, e, ...n) {
|
|
1378
|
+
return new we(t, e, ...n);
|
|
1354
1379
|
}
|
|
1355
|
-
class
|
|
1356
|
-
constructor(e,
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
this.type = e, this.props =
|
|
1380
|
+
class we {
|
|
1381
|
+
constructor(e, n, ...s) {
|
|
1382
|
+
c(this, "type");
|
|
1383
|
+
c(this, "props");
|
|
1384
|
+
c(this, "children");
|
|
1385
|
+
this.type = e, this.props = n, this.children = s;
|
|
1361
1386
|
}
|
|
1362
1387
|
}
|
|
1363
|
-
function Ke(t, e,
|
|
1388
|
+
function Ke(t, e, n) {
|
|
1364
1389
|
return N("$dynamic", {
|
|
1365
1390
|
source: D(() => {
|
|
1366
|
-
const
|
|
1367
|
-
return
|
|
1391
|
+
const s = w(t);
|
|
1392
|
+
return s && e ? e : !s && n ? n : null;
|
|
1368
1393
|
})
|
|
1369
1394
|
});
|
|
1370
1395
|
}
|
|
1371
|
-
function dt(t, e,
|
|
1372
|
-
return Ke(t,
|
|
1396
|
+
function dt(t, e, n) {
|
|
1397
|
+
return Ke(t, n, e);
|
|
1373
1398
|
}
|
|
1374
|
-
function ht(t, e,
|
|
1375
|
-
return N("$repeat", { items: () =>
|
|
1399
|
+
function ht(t, e, n) {
|
|
1400
|
+
return N("$repeat", { items: () => w(t), keyFn: e, renderFn: n });
|
|
1376
1401
|
}
|
|
1377
1402
|
function pt(t, e) {
|
|
1378
1403
|
return N("$portal", { parent: t, content: e });
|
|
1379
1404
|
}
|
|
1380
1405
|
function M(t, e) {
|
|
1381
|
-
return (
|
|
1382
|
-
if (m(
|
|
1383
|
-
return new P(t,
|
|
1384
|
-
if (
|
|
1385
|
-
switch (
|
|
1406
|
+
return (T(e) ? e : [e]).map((s) => {
|
|
1407
|
+
if (m(s.type))
|
|
1408
|
+
return new P(t, s.type, s.props, s.children);
|
|
1409
|
+
if (L(s.type))
|
|
1410
|
+
switch (s.type) {
|
|
1386
1411
|
case "$node": {
|
|
1387
|
-
const i =
|
|
1412
|
+
const i = s.props;
|
|
1388
1413
|
return new K(i.value);
|
|
1389
1414
|
}
|
|
1390
1415
|
case "$text": {
|
|
1391
|
-
const i =
|
|
1416
|
+
const i = s.props;
|
|
1392
1417
|
return new K(document.createTextNode(String(i.value)));
|
|
1393
1418
|
}
|
|
1394
1419
|
case "$repeat": {
|
|
1395
|
-
const i =
|
|
1420
|
+
const i = s.props;
|
|
1396
1421
|
return new Ze({
|
|
1397
1422
|
items: i.items,
|
|
1398
1423
|
keyFn: i.keyFn,
|
|
@@ -1401,22 +1426,22 @@ function M(t, e) {
|
|
|
1401
1426
|
});
|
|
1402
1427
|
}
|
|
1403
1428
|
case "$dynamic": {
|
|
1404
|
-
const i =
|
|
1429
|
+
const i = s.props;
|
|
1405
1430
|
return new je({
|
|
1406
1431
|
source: i.source,
|
|
1407
1432
|
elementContext: t
|
|
1408
1433
|
});
|
|
1409
1434
|
}
|
|
1410
1435
|
case "$fragment": {
|
|
1411
|
-
const i =
|
|
1436
|
+
const i = s.props;
|
|
1412
1437
|
return new me(i.children);
|
|
1413
1438
|
}
|
|
1414
1439
|
case "$outlet": {
|
|
1415
|
-
const i =
|
|
1440
|
+
const i = s.props;
|
|
1416
1441
|
return new Be(i.view);
|
|
1417
1442
|
}
|
|
1418
1443
|
case "$portal": {
|
|
1419
|
-
const i =
|
|
1444
|
+
const i = s.props;
|
|
1420
1445
|
return new Ge({
|
|
1421
1446
|
content: i.content,
|
|
1422
1447
|
parent: i.parent,
|
|
@@ -1425,21 +1450,21 @@ function M(t, e) {
|
|
|
1425
1450
|
}
|
|
1426
1451
|
default:
|
|
1427
1452
|
return new Ue({
|
|
1428
|
-
tag:
|
|
1429
|
-
props:
|
|
1430
|
-
children:
|
|
1453
|
+
tag: s.type,
|
|
1454
|
+
props: s.props ?? {},
|
|
1455
|
+
children: s.children,
|
|
1431
1456
|
elementContext: t
|
|
1432
1457
|
});
|
|
1433
1458
|
}
|
|
1434
1459
|
else
|
|
1435
|
-
throw new TypeError(`Expected a string or view function. Got: ${
|
|
1460
|
+
throw new TypeError(`Expected a string or view function. Got: ${s.type}`);
|
|
1436
1461
|
});
|
|
1437
1462
|
}
|
|
1438
1463
|
function A(t) {
|
|
1439
1464
|
return t.length === 1 ? t[0] : new me(t);
|
|
1440
1465
|
}
|
|
1441
|
-
function
|
|
1442
|
-
return t == null || t === !1 || m(t) ||
|
|
1466
|
+
function be(t) {
|
|
1467
|
+
return t == null || t === !1 || m(t) || L(t) || Te(t) || $(t) || V(be, t);
|
|
1443
1468
|
}
|
|
1444
1469
|
export {
|
|
1445
1470
|
D as $,
|
|
@@ -1449,11 +1474,11 @@ export {
|
|
|
1449
1474
|
tt as a,
|
|
1450
1475
|
st as b,
|
|
1451
1476
|
it as c,
|
|
1452
|
-
|
|
1477
|
+
T as d,
|
|
1453
1478
|
R as e,
|
|
1454
|
-
|
|
1479
|
+
L as f,
|
|
1455
1480
|
C as g,
|
|
1456
|
-
|
|
1481
|
+
w as h,
|
|
1457
1482
|
m as i,
|
|
1458
1483
|
ft as j,
|
|
1459
1484
|
O as k,
|
|
@@ -1462,15 +1487,15 @@ export {
|
|
|
1462
1487
|
A as n,
|
|
1463
1488
|
M as o,
|
|
1464
1489
|
_ as p,
|
|
1465
|
-
|
|
1490
|
+
rt as q,
|
|
1466
1491
|
ct as r,
|
|
1467
1492
|
ut as s,
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1493
|
+
k as t,
|
|
1494
|
+
v as u,
|
|
1495
|
+
ot as v,
|
|
1471
1496
|
Ke as w,
|
|
1472
1497
|
pt as x,
|
|
1473
1498
|
ht as y,
|
|
1474
1499
|
dt as z
|
|
1475
1500
|
};
|
|
1476
|
-
//# sourceMappingURL=markup-
|
|
1501
|
+
//# sourceMappingURL=markup-DZdmoqTk.js.map
|