@tempots/dom 33.1.1 → 34.1.0
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/dom/dom-context.d.ts +2 -9
- package/dom/dom-utils.d.ts +1 -0
- package/dom/headless-context.d.ts +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +4 -8
- package/index.js +999 -970
- package/package.json +4 -1
- package/renderable/attribute.d.ts +20 -20
- package/renderable/bind.d.ts +1 -1
- package/renderable/conjunction.d.ts +1 -2
- package/renderable/domnode.d.ts +1 -1
- package/renderable/element.d.ts +8 -8
- package/renderable/empty.d.ts +2 -2
- package/renderable/ensure.d.ts +1 -2
- package/renderable/foreach.d.ts +1 -3
- package/renderable/fragment.d.ts +1 -1
- package/renderable/map-signal.d.ts +1 -1
- package/renderable/not-empty.d.ts +1 -2
- package/renderable/on-dispose.d.ts +2 -2
- package/renderable/oneof.d.ts +1 -2
- package/renderable/provider.d.ts +1 -1
- package/renderable/render.d.ts +2 -2
- package/renderable/repeat.d.ts +1 -2
- package/renderable/shadow-root.d.ts +9 -0
- package/renderable/task.d.ts +1 -1
- package/renderable/text.d.ts +1 -2
- package/renderable/utils.d.ts +1 -2
- package/renderable/when.d.ts +1 -1
- package/renderable/with-browser-ctx.d.ts +1 -1
- package/renderable/with-ctx.d.ts +1 -1
- package/renderable/with-headless-ctx.d.ts +1 -1
- package/renderable/with-scope.d.ts +1 -1
- package/types/domain.d.ts +44 -85
- package/std/disposal-scope.d.ts +0 -97
- package/std/element-position.d.ts +0 -64
- package/std/interpolate.d.ts +0 -56
- package/std/scope-stack.d.ts +0 -76
- package/std/signal-utils.d.ts +0 -301
- package/std/signal.d.ts +0 -605
- package/std/value.d.ts +0 -131
package/index.js
CHANGED
|
@@ -1,24 +1,297 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ke = (t) => Symbol(t);
|
|
2
|
+
function ze(t, e) {
|
|
3
|
+
return {
|
|
4
|
+
type: t,
|
|
5
|
+
render: e
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function ve(t) {
|
|
9
|
+
return t != null && t !== !1 && t !== 0 && t !== "";
|
|
10
|
+
}
|
|
11
|
+
function Ye(t) {
|
|
12
|
+
return !ve(t);
|
|
13
|
+
}
|
|
14
|
+
function Xe(t) {
|
|
15
|
+
return t == null;
|
|
16
|
+
}
|
|
17
|
+
function Qe(t) {
|
|
18
|
+
return t != null;
|
|
19
|
+
}
|
|
20
|
+
const w = {
|
|
21
|
+
/**
|
|
22
|
+
* Maps a value or a Signal to a new value.
|
|
23
|
+
* If the value is a Signal, it returns a new Signal with the mapped value.
|
|
24
|
+
* If the value is not a Signal, it returns the mapped value.
|
|
25
|
+
*
|
|
26
|
+
* @typeParam T - The type of the value.
|
|
27
|
+
* @typeParam U - The type of the new value.
|
|
28
|
+
* @param value - The value or Signal to map.
|
|
29
|
+
* @param fn - The function to map the value.
|
|
30
|
+
* @returns The mapped value.
|
|
31
|
+
*/
|
|
32
|
+
map: (t, e) => m.is(t) ? t.map(e) : e(t),
|
|
33
|
+
/**
|
|
34
|
+
* Wraps a value or a Signal instance into a Signal.
|
|
35
|
+
* If the value is already a Signal, it returns the value itself.
|
|
36
|
+
* If the value is not a Signal, it creates a new Signal instance with the given value.
|
|
37
|
+
*
|
|
38
|
+
* @typeParam O - The type of the value.
|
|
39
|
+
* @param value - The value or Signal instance to wrap.
|
|
40
|
+
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
41
|
+
* @returns A Signal instance.
|
|
42
|
+
*/
|
|
43
|
+
toSignal: (t, e) => m.is(t) ? t.derive() : se(t, e),
|
|
44
|
+
/**
|
|
45
|
+
* Wraps a value in a `Signal` if it is not already a `Signal`.
|
|
46
|
+
* If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
|
|
47
|
+
* @param value - The value to wrap or check.
|
|
48
|
+
* @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
|
|
49
|
+
*/
|
|
50
|
+
maybeToSignal: (t, e) => {
|
|
51
|
+
if (t != null)
|
|
52
|
+
return w.toSignal(t, e);
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Gets the value from a `Signal` or the value itself if it is not a `Signal`.
|
|
56
|
+
* @param value - The value or Signal instance to get the value from.
|
|
57
|
+
* @returns The value.
|
|
58
|
+
*/
|
|
59
|
+
get: (t) => m.is(t) ? t.get() : t,
|
|
60
|
+
/**
|
|
61
|
+
* Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
|
|
62
|
+
* @param value - The value or Signal instance to add the listener to.
|
|
63
|
+
* @param listener - The listener to call when the value changes.
|
|
64
|
+
* @returns A function to remove the listener.
|
|
65
|
+
*/
|
|
66
|
+
on: (t, e) => m.is(t) ? t.on(e) : (e(t), () => {
|
|
67
|
+
}),
|
|
68
|
+
/**
|
|
69
|
+
* Disposes of a value or a Signal.
|
|
70
|
+
* If the value is a Signal, it disposes of the Signal.
|
|
71
|
+
* If the value is not a Signal, it does nothing.
|
|
72
|
+
* @param value - The value or Signal instance to dispose of.
|
|
73
|
+
*/
|
|
74
|
+
dispose: (t) => {
|
|
75
|
+
m.is(t) && t.dispose();
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Returns a function that disposes of a value or a Signal.
|
|
79
|
+
* If the value is a Signal, it returns a function that disposes of the Signal.
|
|
80
|
+
* If the value is not a Signal, it returns a function that does nothing.
|
|
81
|
+
* @param value - The value or Signal instance to dispose of.
|
|
82
|
+
* @returns A function to dispose of the value or Signal.
|
|
83
|
+
*/
|
|
84
|
+
disposeFn: (t) => () => w.dispose(t),
|
|
85
|
+
/**
|
|
86
|
+
* Derives a Prop from a Signal.
|
|
87
|
+
* If the value is a Signal, it returns a new Prop with the derived value.
|
|
88
|
+
* If the value is not a Signal, it returns a new Prop with the value.
|
|
89
|
+
* @param value - The value or Signal instance to derive the Prop from.
|
|
90
|
+
* @param options - The options for the derived Prop.
|
|
91
|
+
* @param options.autoDisposeProp - Determines whether the derived Prop should be automatically disposed.
|
|
92
|
+
* @param options.equals - A function that determines if two values are equal.
|
|
93
|
+
* @returns A Prop instance.
|
|
94
|
+
*/
|
|
95
|
+
deriveProp: (t, {
|
|
96
|
+
autoDisposeProp: e = !0,
|
|
97
|
+
equals: s
|
|
98
|
+
} = {}) => m.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : T(t, s),
|
|
99
|
+
/**
|
|
100
|
+
* Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
|
|
101
|
+
* @param value - The value or signal to check.
|
|
102
|
+
* @returns A signal that emits `true` if the value is truthy, `false` otherwise.
|
|
103
|
+
*/
|
|
104
|
+
truthy: (t) => w.map(t, ve),
|
|
105
|
+
/**
|
|
106
|
+
* Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
|
|
107
|
+
* @param value - The value or signal to check.
|
|
108
|
+
* @returns A signal that emits `true` if the value is falsy, `false` otherwise.
|
|
109
|
+
*/
|
|
110
|
+
falsy: (t) => w.map(t, Ye),
|
|
111
|
+
/**
|
|
112
|
+
* Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
113
|
+
* @param value - The value or signal to check.
|
|
114
|
+
* @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
115
|
+
*/
|
|
116
|
+
nil: (t) => w.map(t, Xe),
|
|
117
|
+
/**
|
|
118
|
+
* Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
119
|
+
* @param value - The value or signal to check.
|
|
120
|
+
* @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
121
|
+
*/
|
|
122
|
+
defined: (t) => w.map(t, Qe)
|
|
123
|
+
}, Z = (...t) => (e, s) => {
|
|
124
|
+
if (t.length === 1)
|
|
125
|
+
return w.toSignal(t[0]).map(e);
|
|
126
|
+
const n = t.filter((r) => m.is(r));
|
|
127
|
+
return te(
|
|
128
|
+
() => e(...t.map((r) => w.get(r))),
|
|
129
|
+
n,
|
|
130
|
+
s
|
|
131
|
+
);
|
|
132
|
+
}, ts = (t) => {
|
|
133
|
+
const e = Object.keys(t);
|
|
134
|
+
return Z(...Object.values(t))(
|
|
135
|
+
(...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
|
|
136
|
+
);
|
|
137
|
+
}, Ze = (...t) => (e, s = {}) => {
|
|
138
|
+
const n = t.filter((r) => m.is(r));
|
|
139
|
+
return be(
|
|
140
|
+
() => e(...t.map(w.get)),
|
|
141
|
+
n,
|
|
142
|
+
s
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
class q {
|
|
146
|
+
_signals = /* @__PURE__ */ new Set();
|
|
147
|
+
_callbacks = [];
|
|
148
|
+
_disposed = !1;
|
|
149
|
+
/**
|
|
150
|
+
* Register a signal with this scope for automatic disposal.
|
|
151
|
+
*
|
|
152
|
+
* @param signal - The signal to track
|
|
153
|
+
* @throws Error if the scope has already been disposed
|
|
154
|
+
* @throws Error if the signal has already been disposed
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
track(e) {
|
|
158
|
+
if (this._disposed)
|
|
159
|
+
throw new Error("Cannot track signal in disposed scope");
|
|
160
|
+
if (e.isDisposed())
|
|
161
|
+
throw new Error("Cannot track already disposed signal");
|
|
162
|
+
this._signals.add(e);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Register a disposal callback to be called when this scope is disposed.
|
|
166
|
+
* Callbacks are called before signals are disposed.
|
|
167
|
+
* Use this for cleanup that doesn't need the `removeTree` parameter.
|
|
168
|
+
*
|
|
169
|
+
* @param callback - The callback to call on disposal
|
|
170
|
+
* @throws Error if the scope has already been disposed
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
onDispose(e) {
|
|
174
|
+
if (this._disposed)
|
|
175
|
+
throw new Error("Cannot register callback in disposed scope");
|
|
176
|
+
this._callbacks.push(e);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Dispose all signals tracked by this scope.
|
|
180
|
+
* This method is idempotent - calling it multiple times is safe.
|
|
181
|
+
*
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
dispose() {
|
|
185
|
+
if (!this._disposed) {
|
|
186
|
+
this._disposed = !0;
|
|
187
|
+
for (const e of this._callbacks)
|
|
188
|
+
try {
|
|
189
|
+
e();
|
|
190
|
+
} catch (s) {
|
|
191
|
+
console.error("Error in disposal callback:", s);
|
|
192
|
+
}
|
|
193
|
+
this._callbacks.length = 0;
|
|
194
|
+
for (const e of this._signals)
|
|
195
|
+
e.dispose();
|
|
196
|
+
this._signals.clear();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Check if this scope has been disposed.
|
|
201
|
+
*
|
|
202
|
+
* @returns true if the scope has been disposed
|
|
203
|
+
* @public
|
|
204
|
+
*/
|
|
205
|
+
get disposed() {
|
|
206
|
+
return this._disposed;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Creates a prop signal and tracks it in this scope.
|
|
210
|
+
* Use this method in async contexts where automatic tracking doesn't work.
|
|
211
|
+
*
|
|
212
|
+
* @param value - The initial value
|
|
213
|
+
* @param equals - Optional equality function
|
|
214
|
+
* @returns A tracked Prop signal
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
prop(e, s) {
|
|
218
|
+
const n = ce(() => T(e, s));
|
|
219
|
+
return this.track(n), n;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Creates a computed signal and tracks it in this scope.
|
|
223
|
+
* Use this method in async contexts where automatic tracking doesn't work.
|
|
224
|
+
*
|
|
225
|
+
* @param fn - The computation function
|
|
226
|
+
* @param dependencies - Array of signals this computed depends on
|
|
227
|
+
* @param equals - Optional equality function
|
|
228
|
+
* @returns A tracked Computed signal
|
|
229
|
+
* @public
|
|
230
|
+
*/
|
|
231
|
+
computed(e, s, n) {
|
|
232
|
+
const r = ce(() => te(e, s, n));
|
|
233
|
+
return this.track(r), r;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Creates an effect and tracks it in this scope.
|
|
237
|
+
* Use this method in async contexts where automatic tracking doesn't work.
|
|
238
|
+
*
|
|
239
|
+
* @param fn - The effect function
|
|
240
|
+
* @param signals - Array of signals to listen to
|
|
241
|
+
* @param options - Optional listener options
|
|
242
|
+
* @returns A clear function (the effect itself is tracked in the scope)
|
|
243
|
+
* @public
|
|
244
|
+
*/
|
|
245
|
+
effect(e, s, n) {
|
|
246
|
+
return O(this, () => be(e, s, n));
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Creates a computed signal with curried signature and tracks it in this scope.
|
|
250
|
+
* Use this method in async contexts where automatic tracking doesn't work.
|
|
251
|
+
*
|
|
252
|
+
* @param args - Values or signals to compute from
|
|
253
|
+
* @returns A function that takes the computation function and returns a tracked Computed signal
|
|
254
|
+
* @public
|
|
255
|
+
*/
|
|
256
|
+
computedOf(...e) {
|
|
257
|
+
return (s, n) => {
|
|
258
|
+
const r = ce(() => Z(...e)(s, n));
|
|
259
|
+
return this.track(r), r;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Creates an effect with curried signature and tracks it in this scope.
|
|
264
|
+
* Use this method in async contexts where automatic tracking doesn't work.
|
|
265
|
+
*
|
|
266
|
+
* @param args - Values or signals to listen to
|
|
267
|
+
* @returns A function that takes the effect function and returns a clear function
|
|
268
|
+
* @public
|
|
269
|
+
*/
|
|
270
|
+
effectOf(...e) {
|
|
271
|
+
return (s, n) => O(this, () => Ze(...e)(s, n));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const _ = [], et = (t) => {
|
|
2
275
|
_.push(t);
|
|
3
|
-
},
|
|
276
|
+
}, tt = () => {
|
|
4
277
|
if (_.length === 0)
|
|
5
278
|
throw new Error("Cannot pop from empty scope stack");
|
|
6
279
|
_.pop();
|
|
7
|
-
},
|
|
8
|
-
|
|
280
|
+
}, de = () => _[_.length - 1] ?? null, ss = () => _, ns = () => _[_.length - 2] ?? null, O = (t, e) => {
|
|
281
|
+
et(t);
|
|
9
282
|
try {
|
|
10
283
|
return e();
|
|
11
284
|
} finally {
|
|
12
|
-
|
|
285
|
+
tt();
|
|
13
286
|
}
|
|
14
|
-
},
|
|
15
|
-
const e = new
|
|
287
|
+
}, rs = (t) => {
|
|
288
|
+
const e = new q();
|
|
16
289
|
try {
|
|
17
|
-
return
|
|
290
|
+
return O(e, () => t(e));
|
|
18
291
|
} finally {
|
|
19
292
|
e.dispose();
|
|
20
293
|
}
|
|
21
|
-
},
|
|
294
|
+
}, ce = (t) => {
|
|
22
295
|
const e = _.slice();
|
|
23
296
|
_.length = 0;
|
|
24
297
|
try {
|
|
@@ -27,7 +300,7 @@ const _ = [], We = (t) => {
|
|
|
27
300
|
_.length = 0, _.push(...e);
|
|
28
301
|
}
|
|
29
302
|
};
|
|
30
|
-
class
|
|
303
|
+
class m {
|
|
31
304
|
/**
|
|
32
305
|
* Represents a signal with a value of type T.
|
|
33
306
|
*
|
|
@@ -80,7 +353,7 @@ class g {
|
|
|
80
353
|
* @returns A Signal that represents the result of the Promise
|
|
81
354
|
*/
|
|
82
355
|
static ofPromise = (e, s, n, r = (o, i) => o === i) => {
|
|
83
|
-
const o = new
|
|
356
|
+
const o = new m(s, r);
|
|
84
357
|
return e.then((i) => o._setAndNotify(i)).catch((i) => {
|
|
85
358
|
n != null ? o._setAndNotify(n(i)) : console.error(
|
|
86
359
|
"Unhandled promise rejection in Signal.ofPromise:",
|
|
@@ -173,11 +446,7 @@ class g {
|
|
|
173
446
|
const o = this._onValueListeners.indexOf(n);
|
|
174
447
|
o !== -1 && this._onValueListeners.splice(o, 1), s.abortSignal != null && s.abortSignal.removeEventListener("abort", r);
|
|
175
448
|
};
|
|
176
|
-
|
|
177
|
-
const o = ue();
|
|
178
|
-
o?.onDispose(r);
|
|
179
|
-
}
|
|
180
|
-
return r;
|
|
449
|
+
return s.abortSignal != null && s.abortSignal.addEventListener("abort", r), !s.noAutoDispose && de()?.onDispose(r), r;
|
|
181
450
|
};
|
|
182
451
|
/**
|
|
183
452
|
* Registers a listener function to be called whenever the value of the signal changes.
|
|
@@ -200,7 +469,7 @@ class g {
|
|
|
200
469
|
_setAndNotify = (e) => {
|
|
201
470
|
if (this._disposed) return;
|
|
202
471
|
const s = this._value;
|
|
203
|
-
this.equals(s, e) || (this._value = e, this._onValueListeners.forEach((
|
|
472
|
+
this.equals(s, e) || (this._value = e, this._onValueListeners.forEach((n) => n(e, s)));
|
|
204
473
|
};
|
|
205
474
|
/**
|
|
206
475
|
* @internal
|
|
@@ -289,7 +558,7 @@ class g {
|
|
|
289
558
|
* @returns A new computed signal with the transformed value (auto-registered with current scope)
|
|
290
559
|
*/
|
|
291
560
|
map = (e, s = (n, r) => n === r) => {
|
|
292
|
-
const n = new
|
|
561
|
+
const n = new $(() => {
|
|
293
562
|
try {
|
|
294
563
|
return e(this.get());
|
|
295
564
|
} catch (r) {
|
|
@@ -309,7 +578,7 @@ class g {
|
|
|
309
578
|
* @returns A new Signal that emits the values of the resulting Signal.
|
|
310
579
|
*/
|
|
311
580
|
flatMap = (e, s = (n, r) => n === r) => {
|
|
312
|
-
const n = new
|
|
581
|
+
const n = new $(() => {
|
|
313
582
|
try {
|
|
314
583
|
return e(this.get()).get();
|
|
315
584
|
} catch (r) {
|
|
@@ -347,7 +616,7 @@ class g {
|
|
|
347
616
|
}
|
|
348
617
|
filter = (e, s) => {
|
|
349
618
|
let n = s ?? this.get();
|
|
350
|
-
const r = new
|
|
619
|
+
const r = new $(() => {
|
|
351
620
|
try {
|
|
352
621
|
const o = this.get();
|
|
353
622
|
return n = e(o) ? o : n;
|
|
@@ -369,10 +638,10 @@ class g {
|
|
|
369
638
|
*/
|
|
370
639
|
filterMap = (e, s, n = (r, o) => r === o) => {
|
|
371
640
|
let r = s;
|
|
372
|
-
const o = new
|
|
641
|
+
const o = new $(() => {
|
|
373
642
|
try {
|
|
374
|
-
const i = this.get()
|
|
375
|
-
return r =
|
|
643
|
+
const i = this.get();
|
|
644
|
+
return r = e(i) ?? r;
|
|
376
645
|
} catch (i) {
|
|
377
646
|
throw console.error("Error in Signal.filterMap:", i), i;
|
|
378
647
|
}
|
|
@@ -393,7 +662,7 @@ class g {
|
|
|
393
662
|
* @returns A property that holds the mapped value and can be observed for changes.
|
|
394
663
|
*/
|
|
395
664
|
mapAsync = (e, s, n, r = (o, i) => o === i) => {
|
|
396
|
-
const o =
|
|
665
|
+
const o = T(s, r);
|
|
397
666
|
let i = 0, l = new AbortController();
|
|
398
667
|
return o.onDispose(
|
|
399
668
|
this.on(async (c) => {
|
|
@@ -443,7 +712,7 @@ class g {
|
|
|
443
712
|
deriveProp = ({
|
|
444
713
|
autoDisposeProp: e = !0,
|
|
445
714
|
equals: s
|
|
446
|
-
} = {}) => this.feedProp(
|
|
715
|
+
} = {}) => this.feedProp(T(this.get(), s), e);
|
|
447
716
|
/**
|
|
448
717
|
* Derives a new signal from the current signal. Useful to create a new signal that emits the same values as the current signal but can be disposed independently.
|
|
449
718
|
* @returns A new signal that emits the same values as the current signal.
|
|
@@ -472,8 +741,8 @@ class g {
|
|
|
472
741
|
}), e.onDispose(this.on(e.setDirty, { noAutoDispose: !0 })), this.onDispose(e.dispose);
|
|
473
742
|
};
|
|
474
743
|
}
|
|
475
|
-
const
|
|
476
|
-
class
|
|
744
|
+
const st = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
|
|
745
|
+
class $ extends m {
|
|
477
746
|
/**
|
|
478
747
|
* Creates a new Computed signal.
|
|
479
748
|
*
|
|
@@ -499,9 +768,7 @@ class N extends g {
|
|
|
499
768
|
* @see {@link untracked} - Create signals outside of scope tracking
|
|
500
769
|
*/
|
|
501
770
|
constructor(e, s) {
|
|
502
|
-
super(void 0, s), this._fn = e, this.setDirty();
|
|
503
|
-
const n = ue();
|
|
504
|
-
n?.track(this);
|
|
771
|
+
super(void 0, s), this._fn = e, this.setDirty(), de()?.track(this);
|
|
505
772
|
}
|
|
506
773
|
/**
|
|
507
774
|
* Checks if a value is an instance of `Computed`.
|
|
@@ -532,468 +799,152 @@ class N extends g {
|
|
|
532
799
|
* @internal
|
|
533
800
|
*/
|
|
534
801
|
_scheduleCount = 0;
|
|
535
|
-
/**
|
|
536
|
-
* Schedules a notification to be executed asynchronously.
|
|
537
|
-
* If the signal is dirty, it will be updated and notified.
|
|
538
|
-
* @internal
|
|
539
|
-
*/
|
|
540
|
-
_scheduleNotify = () => {
|
|
541
|
-
const e = ++this._scheduleCount;
|
|
542
|
-
Ge(() => {
|
|
543
|
-
this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
|
|
544
|
-
});
|
|
545
|
-
};
|
|
546
|
-
/** {@inheritDoc Signal.get} */
|
|
547
|
-
get = () => (this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn())), this._value);
|
|
548
|
-
/** {@inheritDoc Signal.value} */
|
|
549
|
-
get value() {
|
|
550
|
-
return this.get();
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* Disposes the computed signal and cancels any pending recomputations.
|
|
554
|
-
* This override increments the schedule count to invalidate all pending
|
|
555
|
-
* microtasks before disposing the signal.
|
|
556
|
-
*/
|
|
557
|
-
dispose = () => {
|
|
558
|
-
this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
class Z extends g {
|
|
562
|
-
/**
|
|
563
|
-
* Checks if a value is a Prop.
|
|
564
|
-
* @param value - The value to check.
|
|
565
|
-
* @returns `true` if the value is a Prop, `false` otherwise.
|
|
566
|
-
*/
|
|
567
|
-
static is = (e) => (
|
|
568
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
569
|
-
e != null && e.$__prop__ === !0
|
|
570
|
-
);
|
|
571
|
-
/**
|
|
572
|
-
* @internal
|
|
573
|
-
*/
|
|
574
|
-
$__prop__ = !0;
|
|
575
|
-
/**
|
|
576
|
-
* Changes the value of the property and notifies its listeners.
|
|
577
|
-
*
|
|
578
|
-
* @param value - The new value of the property.
|
|
579
|
-
*/
|
|
580
|
-
set = (e) => {
|
|
581
|
-
this._setAndNotify(e);
|
|
582
|
-
};
|
|
583
|
-
/**
|
|
584
|
-
* Updates the value of the signal by applying the provided function to the current value.
|
|
585
|
-
* @param fn - The function to apply to the current value.
|
|
586
|
-
*/
|
|
587
|
-
update = (e) => {
|
|
588
|
-
this._setAndNotify(e(this.get()));
|
|
589
|
-
};
|
|
590
|
-
/**
|
|
591
|
-
* Creates a reducer function that combines the provided reducer function and effects.
|
|
592
|
-
* @param fn - The reducer function that takes the current state and an action, and returns the new state.
|
|
593
|
-
* @param effects - An array of effects to be executed after the state is updated.
|
|
594
|
-
* @returns A dispatch function that can be used to update the state and trigger the effects.
|
|
595
|
-
*/
|
|
596
|
-
reducer = (e, ...s) => {
|
|
597
|
-
const n = this;
|
|
598
|
-
return function r(o) {
|
|
599
|
-
const i = n.value;
|
|
600
|
-
n.update((l) => e(l, o)), !n.equals(i, n.value) && s.forEach(
|
|
601
|
-
(l) => l({
|
|
602
|
-
previousState: i,
|
|
603
|
-
state: n.value,
|
|
604
|
-
action: o,
|
|
605
|
-
dispatch: r
|
|
606
|
-
})
|
|
607
|
-
);
|
|
608
|
-
};
|
|
609
|
-
};
|
|
610
|
-
/**
|
|
611
|
-
* Creates an isomorphism for the Signal.
|
|
612
|
-
* An isomorphism is a pair of functions that convert values between two types,
|
|
613
|
-
* along with an equality function to compare values of the second type.
|
|
614
|
-
*
|
|
615
|
-
* @param to - A function that converts values from type T to type O.
|
|
616
|
-
* @param from - A function that converts values from type O to type T.
|
|
617
|
-
* @param equals - An optional function that compares values of type O for equality.
|
|
618
|
-
* Defaults to a strict equality check (===).
|
|
619
|
-
* @returns A Prop object representing the isomorphism.
|
|
620
|
-
*/
|
|
621
|
-
iso = (e, s, n = (r, o) => r === o) => {
|
|
622
|
-
const r = new Z(e(this.get()), n);
|
|
623
|
-
return r.onDispose(this.on((o) => r.set(e(o)))), r.on((o) => this._setAndNotify(s(o))), r;
|
|
624
|
-
};
|
|
625
|
-
/**
|
|
626
|
-
* Returns a `Prop` that represents the value at the specified key of the current value.
|
|
627
|
-
*
|
|
628
|
-
* @param key - The key of the value to access.
|
|
629
|
-
* @returns A `Prop` that represents the value at the specified key.
|
|
630
|
-
*/
|
|
631
|
-
atProp = (e) => this.iso(
|
|
632
|
-
(s) => s[e],
|
|
633
|
-
(s) => ({ ...this.value, [e]: s })
|
|
634
|
-
);
|
|
635
|
-
/**
|
|
636
|
-
* Access for the current value of the property.
|
|
637
|
-
*/
|
|
638
|
-
get value() {
|
|
639
|
-
return this.get();
|
|
640
|
-
}
|
|
641
|
-
set value(e) {
|
|
642
|
-
this._setAndNotify(e);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
const z = (t, e, s = (n, r) => n === r) => {
|
|
646
|
-
const n = new N(t, s);
|
|
647
|
-
return e.forEach((r) => r.setDerivative(n)), n;
|
|
648
|
-
}, Se = (t, e, s = {}) => {
|
|
649
|
-
let n = s.once ? () => {
|
|
650
|
-
o(), t();
|
|
651
|
-
} : t;
|
|
652
|
-
if (s.skipInitial) {
|
|
653
|
-
let i = !1;
|
|
654
|
-
const l = n;
|
|
655
|
-
n = () => {
|
|
656
|
-
i ? l() : i = !0;
|
|
657
|
-
};
|
|
658
|
-
}
|
|
659
|
-
const r = z(n, e), o = () => {
|
|
660
|
-
r.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", o);
|
|
661
|
-
};
|
|
662
|
-
return s.abortSignal != null && s.abortSignal.addEventListener("abort", o), o;
|
|
663
|
-
}, A = (t, e = (s, n) => s === n) => {
|
|
664
|
-
const s = new Z(t, e), n = ue();
|
|
665
|
-
return n?.track(s), s;
|
|
666
|
-
}, K = (t, e = (s, n) => s === n) => new g(t, e);
|
|
667
|
-
function we(t) {
|
|
668
|
-
return t != null && t !== !1 && t !== 0 && t !== "";
|
|
669
|
-
}
|
|
670
|
-
function Je(t) {
|
|
671
|
-
return !we(t);
|
|
672
|
-
}
|
|
673
|
-
function Xe(t) {
|
|
674
|
-
return t == null;
|
|
675
|
-
}
|
|
676
|
-
function Ye(t) {
|
|
677
|
-
return t != null;
|
|
678
|
-
}
|
|
679
|
-
const y = {
|
|
680
|
-
/**
|
|
681
|
-
* Maps a value or a Signal to a new value.
|
|
682
|
-
* If the value is a Signal, it returns a new Signal with the mapped value.
|
|
683
|
-
* If the value is not a Signal, it returns the mapped value.
|
|
684
|
-
*
|
|
685
|
-
* @typeParam T - The type of the value.
|
|
686
|
-
* @typeParam U - The type of the new value.
|
|
687
|
-
* @param value - The value or Signal to map.
|
|
688
|
-
* @param fn - The function to map the value.
|
|
689
|
-
* @returns The mapped value.
|
|
690
|
-
*/
|
|
691
|
-
map: (t, e) => g.is(t) ? t.map(e) : e(t),
|
|
692
|
-
/**
|
|
693
|
-
* Wraps a value or a Signal instance into a Signal.
|
|
694
|
-
* If the value is already a Signal, it returns the value itself.
|
|
695
|
-
* If the value is not a Signal, it creates a new Signal instance with the given value.
|
|
696
|
-
*
|
|
697
|
-
* @typeParam O - The type of the value.
|
|
698
|
-
* @param value - The value or Signal instance to wrap.
|
|
699
|
-
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
700
|
-
* @returns A Signal instance.
|
|
701
|
-
*/
|
|
702
|
-
toSignal: (t, e) => g.is(t) ? t.derive() : K(t, e),
|
|
703
|
-
/**
|
|
704
|
-
* Wraps a value in a `Signal` if it is not already a `Signal`.
|
|
705
|
-
* If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
|
|
706
|
-
* @param value - The value to wrap or check.
|
|
707
|
-
* @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
|
|
708
|
-
*/
|
|
709
|
-
maybeToSignal: (t, e) => {
|
|
710
|
-
if (t != null)
|
|
711
|
-
return y.toSignal(t, e);
|
|
712
|
-
},
|
|
713
|
-
/**
|
|
714
|
-
* Gets the value from a `Signal` or the value itself if it is not a `Signal`.
|
|
715
|
-
* @param value - The value or Signal instance to get the value from.
|
|
716
|
-
* @returns The value.
|
|
717
|
-
*/
|
|
718
|
-
get: (t) => g.is(t) ? t.get() : t,
|
|
719
|
-
/**
|
|
720
|
-
* Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
|
|
721
|
-
* @param value - The value or Signal instance to add the listener to.
|
|
722
|
-
* @param listener - The listener to call when the value changes.
|
|
723
|
-
* @returns A function to remove the listener.
|
|
724
|
-
*/
|
|
725
|
-
on: (t, e) => g.is(t) ? t.on(e) : (e(t), () => {
|
|
726
|
-
}),
|
|
727
|
-
/**
|
|
728
|
-
* Disposes of a value or a Signal.
|
|
729
|
-
* If the value is a Signal, it disposes of the Signal.
|
|
730
|
-
* If the value is not a Signal, it does nothing.
|
|
731
|
-
* @param value - The value or Signal instance to dispose of.
|
|
732
|
-
*/
|
|
733
|
-
dispose: (t) => {
|
|
734
|
-
g.is(t) && t.dispose();
|
|
735
|
-
},
|
|
736
|
-
/**
|
|
737
|
-
* Returns a function that disposes of a value or a Signal.
|
|
738
|
-
* If the value is a Signal, it returns a function that disposes of the Signal.
|
|
739
|
-
* If the value is not a Signal, it returns a function that does nothing.
|
|
740
|
-
* @param value - The value or Signal instance to dispose of.
|
|
741
|
-
* @returns A function to dispose of the value or Signal.
|
|
742
|
-
*/
|
|
743
|
-
disposeFn: (t) => () => y.dispose(t),
|
|
744
|
-
/**
|
|
745
|
-
* Derives a Prop from a Signal.
|
|
746
|
-
* If the value is a Signal, it returns a new Prop with the derived value.
|
|
747
|
-
* If the value is not a Signal, it returns a new Prop with the value.
|
|
748
|
-
* @param value - The value or Signal instance to derive the Prop from.
|
|
749
|
-
* @param options - The options for the derived Prop.
|
|
750
|
-
* @param options.autoDisposeProp - Determines whether the derived Prop should be automatically disposed.
|
|
751
|
-
* @param options.equals - A function that determines if two values are equal.
|
|
752
|
-
* @returns A Prop instance.
|
|
753
|
-
*/
|
|
754
|
-
deriveProp: (t, {
|
|
755
|
-
autoDisposeProp: e = !0,
|
|
756
|
-
equals: s
|
|
757
|
-
} = {}) => g.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : A(t, s),
|
|
758
|
-
/**
|
|
759
|
-
* Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
|
|
760
|
-
* @param value - The value or signal to check.
|
|
761
|
-
* @returns A signal that emits `true` if the value is truthy, `false` otherwise.
|
|
762
|
-
*/
|
|
763
|
-
truthy: (t) => y.map(t, we),
|
|
764
|
-
/**
|
|
765
|
-
* Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
|
|
766
|
-
* @param value - The value or signal to check.
|
|
767
|
-
* @returns A signal that emits `true` if the value is falsy, `false` otherwise.
|
|
768
|
-
*/
|
|
769
|
-
falsy: (t) => y.map(t, Je),
|
|
770
|
-
/**
|
|
771
|
-
* Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
772
|
-
* @param value - The value or signal to check.
|
|
773
|
-
* @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
774
|
-
*/
|
|
775
|
-
nil: (t) => y.map(t, Xe),
|
|
776
|
-
/**
|
|
777
|
-
* Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
778
|
-
* @param value - The value or signal to check.
|
|
779
|
-
* @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
780
|
-
*/
|
|
781
|
-
defined: (t) => y.map(t, Ye)
|
|
782
|
-
}, ee = (...t) => (e, s) => {
|
|
783
|
-
if (t.length === 1)
|
|
784
|
-
return y.toSignal(t[0]).map(e);
|
|
785
|
-
const n = t.filter((r) => g.is(r));
|
|
786
|
-
return z(
|
|
787
|
-
() => e(...t.map((r) => y.get(r))),
|
|
788
|
-
n,
|
|
789
|
-
s
|
|
790
|
-
);
|
|
791
|
-
}, es = (t) => {
|
|
792
|
-
const e = Object.keys(t);
|
|
793
|
-
return ee(...Object.values(t))(
|
|
794
|
-
(...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
|
|
795
|
-
);
|
|
796
|
-
}, Qe = (...t) => (e, s = {}) => {
|
|
797
|
-
const n = t.filter((r) => g.is(r));
|
|
798
|
-
return Se(
|
|
799
|
-
() => e(...t.map(y.get)),
|
|
800
|
-
n,
|
|
801
|
-
s
|
|
802
|
-
);
|
|
803
|
-
};
|
|
804
|
-
class j {
|
|
805
|
-
_signals = /* @__PURE__ */ new Set();
|
|
806
|
-
_callbacks = [];
|
|
807
|
-
_disposed = !1;
|
|
808
|
-
/**
|
|
809
|
-
* Register a signal with this scope for automatic disposal.
|
|
810
|
-
*
|
|
811
|
-
* @param signal - The signal to track
|
|
812
|
-
* @throws Error if the scope has already been disposed
|
|
813
|
-
* @throws Error if the signal has already been disposed
|
|
814
|
-
* @public
|
|
815
|
-
*/
|
|
816
|
-
track(e) {
|
|
817
|
-
if (this._disposed)
|
|
818
|
-
throw new Error("Cannot track signal in disposed scope");
|
|
819
|
-
if (e.isDisposed())
|
|
820
|
-
throw new Error("Cannot track already disposed signal");
|
|
821
|
-
this._signals.add(e);
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Register a disposal callback to be called when this scope is disposed.
|
|
825
|
-
* Callbacks are called before signals are disposed.
|
|
826
|
-
* Use this for cleanup that doesn't need the `removeTree` parameter.
|
|
827
|
-
*
|
|
828
|
-
* @param callback - The callback to call on disposal
|
|
829
|
-
* @throws Error if the scope has already been disposed
|
|
830
|
-
* @public
|
|
831
|
-
*/
|
|
832
|
-
onDispose(e) {
|
|
833
|
-
if (this._disposed)
|
|
834
|
-
throw new Error("Cannot register callback in disposed scope");
|
|
835
|
-
this._callbacks.push(e);
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Dispose all signals tracked by this scope.
|
|
839
|
-
* This method is idempotent - calling it multiple times is safe.
|
|
840
|
-
*
|
|
841
|
-
* @public
|
|
842
|
-
*/
|
|
843
|
-
dispose() {
|
|
844
|
-
if (!this._disposed) {
|
|
845
|
-
this._disposed = !0;
|
|
846
|
-
for (const e of this._callbacks)
|
|
847
|
-
try {
|
|
848
|
-
e();
|
|
849
|
-
} catch (s) {
|
|
850
|
-
console.error("Error in disposal callback:", s);
|
|
851
|
-
}
|
|
852
|
-
this._callbacks.length = 0;
|
|
853
|
-
for (const e of this._signals)
|
|
854
|
-
e.dispose();
|
|
855
|
-
this._signals.clear();
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
/**
|
|
859
|
-
* Check if this scope has been disposed.
|
|
860
|
-
*
|
|
861
|
-
* @returns true if the scope has been disposed
|
|
862
|
-
* @public
|
|
863
|
-
*/
|
|
864
|
-
get disposed() {
|
|
865
|
-
return this._disposed;
|
|
866
|
-
}
|
|
867
|
-
/**
|
|
868
|
-
* Creates a prop signal and tracks it in this scope.
|
|
869
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
870
|
-
*
|
|
871
|
-
* @param value - The initial value
|
|
872
|
-
* @param equals - Optional equality function
|
|
873
|
-
* @returns A tracked Prop signal
|
|
874
|
-
* @public
|
|
875
|
-
*/
|
|
876
|
-
prop(e, s) {
|
|
877
|
-
const n = ie(() => A(e, s));
|
|
878
|
-
return this.track(n), n;
|
|
879
|
-
}
|
|
880
|
-
/**
|
|
881
|
-
* Creates a computed signal and tracks it in this scope.
|
|
882
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
883
|
-
*
|
|
884
|
-
* @param fn - The computation function
|
|
885
|
-
* @param dependencies - Array of signals this computed depends on
|
|
886
|
-
* @param equals - Optional equality function
|
|
887
|
-
* @returns A tracked Computed signal
|
|
888
|
-
* @public
|
|
889
|
-
*/
|
|
890
|
-
computed(e, s, n) {
|
|
891
|
-
const r = ie(() => z(e, s, n));
|
|
892
|
-
return this.track(r), r;
|
|
893
|
-
}
|
|
894
|
-
/**
|
|
895
|
-
* Creates an effect and tracks it in this scope.
|
|
896
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
897
|
-
*
|
|
898
|
-
* @param fn - The effect function
|
|
899
|
-
* @param signals - Array of signals to listen to
|
|
900
|
-
* @param options - Optional listener options
|
|
901
|
-
* @returns A clear function (the effect itself is tracked in the scope)
|
|
902
|
-
* @public
|
|
903
|
-
*/
|
|
904
|
-
effect(e, s, n) {
|
|
905
|
-
return P(this, () => Se(e, s, n));
|
|
906
|
-
}
|
|
907
|
-
/**
|
|
908
|
-
* Creates a computed signal with curried signature and tracks it in this scope.
|
|
909
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
910
|
-
*
|
|
911
|
-
* @param args - Values or signals to compute from
|
|
912
|
-
* @returns A function that takes the computation function and returns a tracked Computed signal
|
|
913
|
-
* @public
|
|
802
|
+
/**
|
|
803
|
+
* Schedules a notification to be executed asynchronously.
|
|
804
|
+
* If the signal is dirty, it will be updated and notified.
|
|
805
|
+
* @internal
|
|
914
806
|
*/
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
};
|
|
807
|
+
_scheduleNotify = () => {
|
|
808
|
+
const e = ++this._scheduleCount;
|
|
809
|
+
st(() => {
|
|
810
|
+
this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
|
|
811
|
+
});
|
|
812
|
+
};
|
|
813
|
+
/** {@inheritDoc Signal.get} */
|
|
814
|
+
get = () => (this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn())), this._value);
|
|
815
|
+
/** {@inheritDoc Signal.value} */
|
|
816
|
+
get value() {
|
|
817
|
+
return this.get();
|
|
920
818
|
}
|
|
921
819
|
/**
|
|
922
|
-
*
|
|
923
|
-
*
|
|
924
|
-
*
|
|
925
|
-
* @param args - Values or signals to listen to
|
|
926
|
-
* @returns A function that takes the effect function and returns a clear function
|
|
927
|
-
* @public
|
|
820
|
+
* Disposes the computed signal and cancels any pending recomputations.
|
|
821
|
+
* This override increments the schedule count to invalidate all pending
|
|
822
|
+
* microtasks before disposing the signal.
|
|
928
823
|
*/
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}
|
|
824
|
+
dispose = () => {
|
|
825
|
+
this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
|
|
826
|
+
};
|
|
932
827
|
}
|
|
933
|
-
|
|
934
|
-
const n = Math.max(t.length, e.length);
|
|
935
|
-
let r = "";
|
|
936
|
-
for (let o = 0; o < n; o++) {
|
|
937
|
-
let i = t.charCodeAt(o);
|
|
938
|
-
isNaN(i) && (i = ge);
|
|
939
|
-
let l = e.charCodeAt(o);
|
|
940
|
-
isNaN(l) && (l = ge), r += String.fromCharCode(i + (l - i) * s);
|
|
941
|
-
}
|
|
942
|
-
return r;
|
|
943
|
-
}, Ke = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), et = (t, e) => e, tt = (t) => typeof t == "number" ? Ze : typeof t == "string" ? ze : t instanceof Date ? Ke : et;
|
|
944
|
-
class le {
|
|
828
|
+
class ee extends m {
|
|
945
829
|
/**
|
|
946
|
-
*
|
|
947
|
-
* @param
|
|
948
|
-
* @
|
|
830
|
+
* Checks if a value is a Prop.
|
|
831
|
+
* @param value - The value to check.
|
|
832
|
+
* @returns `true` if the value is a Prop, `false` otherwise.
|
|
949
833
|
*/
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
834
|
+
static is = (e) => (
|
|
835
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
836
|
+
e != null && e.$__prop__ === !0
|
|
837
|
+
);
|
|
953
838
|
/**
|
|
954
|
-
*
|
|
839
|
+
* @internal
|
|
955
840
|
*/
|
|
956
|
-
|
|
841
|
+
$__prop__ = !0;
|
|
957
842
|
/**
|
|
958
|
-
*
|
|
959
|
-
*
|
|
843
|
+
* Changes the value of the property and notifies its listeners.
|
|
844
|
+
*
|
|
845
|
+
* @param value - The new value of the property.
|
|
960
846
|
*/
|
|
961
|
-
|
|
847
|
+
set = (e) => {
|
|
848
|
+
this._setAndNotify(e);
|
|
849
|
+
};
|
|
962
850
|
/**
|
|
963
|
-
*
|
|
964
|
-
* @
|
|
851
|
+
* Updates the value of the signal by applying the provided function to the current value.
|
|
852
|
+
* @param fn - The function to apply to the current value.
|
|
965
853
|
*/
|
|
966
|
-
|
|
854
|
+
update = (e) => {
|
|
855
|
+
this._setAndNotify(e(this.get()));
|
|
856
|
+
};
|
|
967
857
|
/**
|
|
968
|
-
*
|
|
969
|
-
* @
|
|
858
|
+
* Creates a reducer function that combines the provided reducer function and effects.
|
|
859
|
+
* @param fn - The reducer function that takes the current state and an action, and returns the new state.
|
|
860
|
+
* @param effects - An array of effects to be executed after the state is updated.
|
|
861
|
+
* @returns A dispatch function that can be used to update the state and trigger the effects.
|
|
970
862
|
*/
|
|
971
|
-
|
|
972
|
-
|
|
863
|
+
reducer = (e, ...s) => {
|
|
864
|
+
const n = this;
|
|
865
|
+
return function r(o) {
|
|
866
|
+
const i = n.value;
|
|
867
|
+
n.update((l) => e(l, o)), !n.equals(i, n.value) && s.forEach(
|
|
868
|
+
(l) => l({
|
|
869
|
+
previousState: i,
|
|
870
|
+
state: n.value,
|
|
871
|
+
action: o,
|
|
872
|
+
dispatch: r
|
|
873
|
+
})
|
|
874
|
+
);
|
|
875
|
+
};
|
|
876
|
+
};
|
|
973
877
|
/**
|
|
974
|
-
*
|
|
975
|
-
*
|
|
878
|
+
* Creates an isomorphism for the Signal.
|
|
879
|
+
* An isomorphism is a pair of functions that convert values between two types,
|
|
880
|
+
* along with an equality function to compare values of the second type.
|
|
881
|
+
*
|
|
882
|
+
* @param to - A function that converts values from type T to type O.
|
|
883
|
+
* @param from - A function that converts values from type O to type T.
|
|
884
|
+
* @param equals - An optional function that compares values of type O for equality.
|
|
885
|
+
* Defaults to a strict equality check (===).
|
|
886
|
+
* @returns A Prop object representing the isomorphism.
|
|
976
887
|
*/
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
888
|
+
iso = (e, s, n = (r, o) => r === o) => {
|
|
889
|
+
const r = new ee(e(this.get()), n);
|
|
890
|
+
return r.onDispose(this.on((o) => r.set(e(o)))), r.on((o) => this._setAndNotify(s(o))), r;
|
|
891
|
+
};
|
|
980
892
|
/**
|
|
981
|
-
*
|
|
893
|
+
* Returns a `Prop` that represents the value at the specified key of the current value.
|
|
982
894
|
*
|
|
983
|
-
*
|
|
984
|
-
*
|
|
985
|
-
* automatically tracked and disposed when the scope ends. This method is kept for
|
|
986
|
-
* backward compatibility and for cases where ElementPosition is used outside a scope.
|
|
895
|
+
* @param key - The key of the value to access.
|
|
896
|
+
* @returns A `Prop` that represents the value at the specified key.
|
|
987
897
|
*/
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
898
|
+
atProp = (e) => this.iso(
|
|
899
|
+
(s) => s[e],
|
|
900
|
+
(s) => ({ ...this.value, [e]: s })
|
|
901
|
+
);
|
|
902
|
+
/**
|
|
903
|
+
* Access for the current value of the property.
|
|
904
|
+
*/
|
|
905
|
+
get value() {
|
|
906
|
+
return this.get();
|
|
907
|
+
}
|
|
908
|
+
set value(e) {
|
|
909
|
+
this._setAndNotify(e);
|
|
910
|
+
}
|
|
991
911
|
}
|
|
992
|
-
const
|
|
912
|
+
const te = (t, e, s = (n, r) => n === r) => {
|
|
913
|
+
const n = new $(t, s);
|
|
914
|
+
return e.forEach((r) => r.setDerivative(n)), n;
|
|
915
|
+
}, be = (t, e, s = {}) => {
|
|
916
|
+
let n = s.once ? () => {
|
|
917
|
+
o(), t();
|
|
918
|
+
} : t;
|
|
919
|
+
if (s.skipInitial) {
|
|
920
|
+
let i = !1;
|
|
921
|
+
const l = n;
|
|
922
|
+
n = () => {
|
|
923
|
+
i ? l() : i = !0;
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
const r = te(n, e), o = () => {
|
|
927
|
+
r.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", o);
|
|
928
|
+
};
|
|
929
|
+
return s.abortSignal != null && s.abortSignal.addEventListener("abort", o), o;
|
|
930
|
+
}, T = (t, e = (s, n) => s === n) => {
|
|
931
|
+
const s = new ee(t, e);
|
|
932
|
+
return de()?.track(s), s;
|
|
933
|
+
}, se = (t, e = (s, n) => s === n) => new m(t, e), pe = () => (
|
|
993
934
|
/* c8 ignore next */
|
|
994
935
|
typeof window < "u" ? window : void 0
|
|
995
|
-
)
|
|
996
|
-
|
|
936
|
+
), nt = (t, e, s) => t + (e - t) * s, me = 97, rt = (t, e, s) => {
|
|
937
|
+
const n = Math.max(t.length, e.length);
|
|
938
|
+
let r = "";
|
|
939
|
+
for (let o = 0; o < n; o++) {
|
|
940
|
+
let i = t.charCodeAt(o);
|
|
941
|
+
isNaN(i) && (i = me);
|
|
942
|
+
let l = e.charCodeAt(o);
|
|
943
|
+
isNaN(l) && (l = me), r += String.fromCharCode(i + (l - i) * s);
|
|
944
|
+
}
|
|
945
|
+
return r;
|
|
946
|
+
}, ot = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), it = (t, e) => e, lt = (t) => typeof t == "number" ? nt : typeof t == "string" ? rt : t instanceof Date ? ot : it;
|
|
947
|
+
class Se {
|
|
997
948
|
_store = /* @__PURE__ */ new Map();
|
|
998
949
|
/**
|
|
999
950
|
* Retrieves the value associated with the specified key from the memory store.
|
|
@@ -1010,8 +961,8 @@ class be {
|
|
|
1010
961
|
this._store.set(e, s);
|
|
1011
962
|
};
|
|
1012
963
|
}
|
|
1013
|
-
let
|
|
1014
|
-
const
|
|
964
|
+
let ae = null, ue = null;
|
|
965
|
+
const ct = () => (ae || (ae = new Se()), ae), at = () => (ue || (ue = new Se()), ue), _e = ({
|
|
1015
966
|
key: t,
|
|
1016
967
|
defaultValue: e,
|
|
1017
968
|
store: s,
|
|
@@ -1022,118 +973,118 @@ const st = () => (ce || (ce = new be()), ce), nt = () => (ae || (ae = new be()),
|
|
|
1022
973
|
syncTabs: l = !0,
|
|
1023
974
|
onKeyChange: c = "load"
|
|
1024
975
|
}) => {
|
|
1025
|
-
let a =
|
|
1026
|
-
const u = s.getItem(a), h = new
|
|
976
|
+
let a = w.get(t);
|
|
977
|
+
const u = s.getItem(a), h = new ee(
|
|
1027
978
|
u != null ? i(r(u)) : typeof e == "function" ? e() : e,
|
|
1028
979
|
o
|
|
1029
|
-
),
|
|
1030
|
-
let
|
|
980
|
+
), f = pe(), p = l && typeof f?.BroadcastChannel == "function";
|
|
981
|
+
let y = !1, v = null, P = null;
|
|
1031
982
|
const b = (S) => {
|
|
1032
|
-
if (!
|
|
1033
|
-
const M = `tempo:storedProp:${S}`,
|
|
1034
|
-
const
|
|
1035
|
-
if (!(
|
|
983
|
+
if (!p) return null;
|
|
984
|
+
const M = `tempo:storedProp:${S}`, C = new f.BroadcastChannel(M), I = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, L = (W) => {
|
|
985
|
+
const A = W.data;
|
|
986
|
+
if (!(A == null || typeof A != "object" || A.key !== S || typeof A.value != "string" || A.sourceId != null && A.sourceId === I))
|
|
1036
987
|
try {
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
h.set(
|
|
1040
|
-
} catch (
|
|
988
|
+
y = !0;
|
|
989
|
+
const le = i(r(A.value));
|
|
990
|
+
h.set(le);
|
|
991
|
+
} catch (le) {
|
|
1041
992
|
console.warn(
|
|
1042
993
|
`Failed to sync storedProp for key "${S}" via BroadcastChannel`,
|
|
1043
|
-
|
|
994
|
+
le
|
|
1044
995
|
);
|
|
1045
996
|
} finally {
|
|
1046
|
-
|
|
997
|
+
y = !1;
|
|
1047
998
|
}
|
|
1048
999
|
};
|
|
1049
|
-
return
|
|
1050
|
-
|
|
1051
|
-
}), { channel:
|
|
1000
|
+
return C.addEventListener("message", L), h.onDispose(() => {
|
|
1001
|
+
C?.removeEventListener("message", L), C?.close();
|
|
1002
|
+
}), { channel: C, instanceId: I, handleMessage: L };
|
|
1052
1003
|
}, x = b(a);
|
|
1053
|
-
x && (
|
|
1054
|
-
const
|
|
1004
|
+
x && (v = x.channel, P = x.instanceId);
|
|
1005
|
+
const F = (S) => {
|
|
1055
1006
|
const M = a;
|
|
1056
1007
|
if (M === S) return;
|
|
1057
|
-
const
|
|
1058
|
-
if (s.setItem(M,
|
|
1059
|
-
const
|
|
1060
|
-
if (
|
|
1008
|
+
const C = h.get(), I = n(C);
|
|
1009
|
+
if (s.setItem(M, I), v != null && (v.close(), v = null, P = null), a = S, c === "load") {
|
|
1010
|
+
const W = s.getItem(S);
|
|
1011
|
+
if (W != null)
|
|
1061
1012
|
try {
|
|
1062
|
-
const
|
|
1063
|
-
h.set(
|
|
1064
|
-
} catch (
|
|
1013
|
+
const A = i(r(W));
|
|
1014
|
+
h.set(A);
|
|
1015
|
+
} catch (A) {
|
|
1065
1016
|
console.warn(
|
|
1066
1017
|
`Failed to load storedProp from new key "${S}"`,
|
|
1067
|
-
|
|
1018
|
+
A
|
|
1068
1019
|
);
|
|
1069
1020
|
}
|
|
1070
1021
|
else
|
|
1071
|
-
s.setItem(S,
|
|
1072
|
-
} else c === "migrate" && s.setItem(S,
|
|
1022
|
+
s.setItem(S, I);
|
|
1023
|
+
} else c === "migrate" && s.setItem(S, I);
|
|
1073
1024
|
const L = b(S);
|
|
1074
|
-
L && (
|
|
1025
|
+
L && (v = L.channel, P = L.instanceId);
|
|
1075
1026
|
};
|
|
1076
|
-
return
|
|
1077
|
-
const
|
|
1078
|
-
s.setItem(a,
|
|
1027
|
+
return m.is(t) && h.onDispose(t.on(F)), h.on((S, M) => {
|
|
1028
|
+
const C = n(S);
|
|
1029
|
+
s.setItem(a, C), v != null && !y && M !== void 0 && P != null && v.postMessage({
|
|
1079
1030
|
key: a,
|
|
1080
|
-
value:
|
|
1081
|
-
sourceId:
|
|
1031
|
+
value: C,
|
|
1032
|
+
sourceId: P
|
|
1082
1033
|
});
|
|
1083
1034
|
}), h;
|
|
1084
|
-
},
|
|
1085
|
-
const
|
|
1035
|
+
}, os = (t) => {
|
|
1036
|
+
const e = pe()?.localStorage, s = e && typeof e.getItem == "function" ? e : ct();
|
|
1086
1037
|
return _e({
|
|
1087
1038
|
...t,
|
|
1088
|
-
store:
|
|
1039
|
+
store: s
|
|
1089
1040
|
});
|
|
1090
|
-
},
|
|
1091
|
-
const
|
|
1041
|
+
}, is = (t) => {
|
|
1042
|
+
const e = pe()?.sessionStorage, s = e && typeof e.getItem == "function" ? e : at();
|
|
1092
1043
|
return _e({
|
|
1093
1044
|
...t,
|
|
1094
|
-
store:
|
|
1045
|
+
store: s
|
|
1095
1046
|
});
|
|
1096
1047
|
};
|
|
1097
|
-
function
|
|
1048
|
+
function ye(t) {
|
|
1098
1049
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
|
|
1099
1050
|
}
|
|
1100
|
-
const
|
|
1051
|
+
const ut = (t, e, s, n) => {
|
|
1101
1052
|
const r = n?.duration ?? 300, o = n?.easing ?? ((b) => b), i = n?.equals ?? ((b, x) => b === x);
|
|
1102
|
-
let l = n?.interpolate, c = t, a = e(), u = performance.now(), h = null,
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1053
|
+
let l = n?.interpolate, c = t, a = e(), u = performance.now(), h = null, f = !0;
|
|
1054
|
+
const p = new $(e, i), y = T(t, i);
|
|
1055
|
+
y.onDispose(() => {
|
|
1105
1056
|
h !== null && cancelAnimationFrame(h);
|
|
1106
|
-
}),
|
|
1107
|
-
b.setDerivative(
|
|
1057
|
+
}), y.onDispose(p.dispose), s.forEach((b) => {
|
|
1058
|
+
b.setDerivative(p), b.onDispose(y.dispose);
|
|
1108
1059
|
});
|
|
1109
|
-
const
|
|
1110
|
-
a = b, u = performance.now(), c =
|
|
1111
|
-
},
|
|
1112
|
-
const
|
|
1113
|
-
l == null && (l =
|
|
1114
|
-
let
|
|
1115
|
-
|
|
1116
|
-
};
|
|
1117
|
-
return
|
|
1118
|
-
},
|
|
1060
|
+
const v = (b) => {
|
|
1061
|
+
a = b, u = performance.now(), c = y.value, f && (f = !1, h = ye(P));
|
|
1062
|
+
}, P = () => {
|
|
1063
|
+
const b = (performance.now() - u) / w.get(r), x = o(b);
|
|
1064
|
+
l == null && (l = lt(c));
|
|
1065
|
+
let F = l(c, a, x);
|
|
1066
|
+
b >= 1 ? (f = !0, F = a) : h = ye(P), y.set(F);
|
|
1067
|
+
};
|
|
1068
|
+
return p.on(v), y;
|
|
1069
|
+
}, ls = (t, e) => {
|
|
1119
1070
|
const { initialValue: s, ...n } = e ?? {};
|
|
1120
|
-
return
|
|
1071
|
+
return ut(
|
|
1121
1072
|
/* c8 ignore next 2 */
|
|
1122
1073
|
s ?? t.get(),
|
|
1123
1074
|
t.get,
|
|
1124
1075
|
[t],
|
|
1125
1076
|
n
|
|
1126
1077
|
);
|
|
1127
|
-
},
|
|
1128
|
-
const s = Object.values(t).filter(
|
|
1129
|
-
return
|
|
1078
|
+
}, ht = (t, e) => {
|
|
1079
|
+
const s = Object.values(t).filter(m.is), n = Object.keys(t);
|
|
1080
|
+
return te(() => {
|
|
1130
1081
|
const r = {};
|
|
1131
1082
|
for (const o of n)
|
|
1132
|
-
r[o] =
|
|
1083
|
+
r[o] = w.get(t[o]);
|
|
1133
1084
|
return e(r);
|
|
1134
1085
|
}, s);
|
|
1135
|
-
},
|
|
1136
|
-
const s =
|
|
1086
|
+
}, cs = (t) => ht(t, (e) => e), as = (t, e) => {
|
|
1087
|
+
const s = T(t.get());
|
|
1137
1088
|
let n = null;
|
|
1138
1089
|
const r = t.on(
|
|
1139
1090
|
(o) => {
|
|
@@ -1149,33 +1100,81 @@ const rt = (t, e, s, n) => {
|
|
|
1149
1100
|
return s.onDispose(() => {
|
|
1150
1101
|
r(), n != null && clearTimeout(n);
|
|
1151
1102
|
}), s;
|
|
1152
|
-
},
|
|
1103
|
+
}, us = (t) => {
|
|
1153
1104
|
let e;
|
|
1154
1105
|
return t.map((s) => {
|
|
1155
1106
|
const n = e;
|
|
1156
1107
|
return e = s, n;
|
|
1157
1108
|
});
|
|
1158
|
-
},
|
|
1109
|
+
}, hs = ({
|
|
1159
1110
|
size: t = void 0,
|
|
1160
1111
|
signal: e
|
|
1161
1112
|
}) => {
|
|
1162
1113
|
const s = [];
|
|
1163
1114
|
return e.map((n) => (s.push(n), t != null && s.length > t && s.shift(), s.slice()));
|
|
1164
|
-
},
|
|
1115
|
+
}, ds = (t) => (...e) => Z(
|
|
1165
1116
|
t,
|
|
1166
1117
|
...e
|
|
1167
1118
|
)((s, ...n) => s(...n));
|
|
1168
|
-
function
|
|
1169
|
-
return
|
|
1119
|
+
function ps(...t) {
|
|
1120
|
+
return Z(...t)((...e) => {
|
|
1170
1121
|
for (const s of e) if (s != null) return s;
|
|
1171
1122
|
});
|
|
1172
1123
|
}
|
|
1173
|
-
|
|
1124
|
+
class he {
|
|
1125
|
+
/**
|
|
1126
|
+
* Creates a new instance of `ElementPosition`.
|
|
1127
|
+
* @param index - The index of the element.
|
|
1128
|
+
* @param total - The total number of elements in the collection.
|
|
1129
|
+
*/
|
|
1130
|
+
constructor(e, s) {
|
|
1131
|
+
this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* The counter of the element starting from 1.
|
|
1135
|
+
*/
|
|
1136
|
+
counter;
|
|
1137
|
+
/**
|
|
1138
|
+
* Checks if the element is the first element in the collection.
|
|
1139
|
+
* @returns `true` if the element is the first element, `false` otherwise.
|
|
1140
|
+
*/
|
|
1141
|
+
isFirst;
|
|
1142
|
+
/**
|
|
1143
|
+
* Checks if the counter of the element is even.
|
|
1144
|
+
* @returns `true` if the counter is even, `false` otherwise.
|
|
1145
|
+
*/
|
|
1146
|
+
isEven;
|
|
1147
|
+
/**
|
|
1148
|
+
* Checks if the counter of the element is odd.
|
|
1149
|
+
* @returns `true` if the counter is odd, `false` otherwise.
|
|
1150
|
+
*/
|
|
1151
|
+
isOdd;
|
|
1152
|
+
#e;
|
|
1153
|
+
/**
|
|
1154
|
+
* Checks if the element is the last element in the collection.
|
|
1155
|
+
* @returns `true` if the element is the last element, `false` otherwise.
|
|
1156
|
+
*/
|
|
1157
|
+
get isLast() {
|
|
1158
|
+
return this.#e == null && (this.#e = this.total.map((e) => this.counter === e)), this.#e;
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Disposes the internal signal created by `isLast`.
|
|
1162
|
+
*
|
|
1163
|
+
* **Note:** With automatic signal disposal, this method is now a no-op when used within
|
|
1164
|
+
* a disposal scope (e.g., inside a renderable). The signal created by `isLast` is
|
|
1165
|
+
* automatically tracked and disposed when the scope ends. This method is kept for
|
|
1166
|
+
* backward compatibility and for cases where ElementPosition is used outside a scope.
|
|
1167
|
+
*/
|
|
1168
|
+
dispose = () => {
|
|
1169
|
+
this.#e?.dispose(), this.#e = void 0;
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
const Ae = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Te = /* @__PURE__ */ new Set(["selected"]), Ee = /* @__PURE__ */ new Set([
|
|
1174
1173
|
"rowSpan",
|
|
1175
1174
|
"colSpan",
|
|
1176
1175
|
"tabIndex",
|
|
1177
1176
|
"valueAsNumber"
|
|
1178
|
-
]),
|
|
1177
|
+
]), Ce = /* @__PURE__ */ new Set(["valueAsDate"]), De = /* @__PURE__ */ new Set([
|
|
1179
1178
|
"value",
|
|
1180
1179
|
"textContent",
|
|
1181
1180
|
"innerText",
|
|
@@ -1183,28 +1182,28 @@ const ve = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Ae = /* @
|
|
|
1183
1182
|
"outerHTML",
|
|
1184
1183
|
"className",
|
|
1185
1184
|
"classList"
|
|
1186
|
-
]),
|
|
1185
|
+
]), dt = (t, e) => Te.has(t) ? (s) => {
|
|
1187
1186
|
s == null || s !== !0 ? e.removeAttribute(t) : e.setAttribute(t, "");
|
|
1188
|
-
} :
|
|
1187
|
+
} : Ae.has(t) ? (s) => {
|
|
1189
1188
|
s == null ? e[t] = null : e[t] = !!s;
|
|
1190
|
-
} : Te.has(t) ? (s) => {
|
|
1191
|
-
s == null ? e[t] = null : e[t] = Number(s);
|
|
1192
1189
|
} : Ee.has(t) ? (s) => {
|
|
1193
|
-
s == null ? e[t] = null : e[t] = s;
|
|
1190
|
+
s == null ? e[t] = null : e[t] = Number(s);
|
|
1194
1191
|
} : Ce.has(t) ? (s) => {
|
|
1192
|
+
s == null ? e[t] = null : e[t] = s;
|
|
1193
|
+
} : De.has(t) ? (s) => {
|
|
1195
1194
|
s == null ? e[t] = null : e[t] = String(s);
|
|
1196
1195
|
} : (s) => {
|
|
1197
1196
|
s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
|
|
1198
|
-
},
|
|
1197
|
+
}, pt = (t, e) => Te.has(t) ? () => e.hasAttribute(t) : Ae.has(t) ? () => !!e[t] : Ee.has(t) ? () => Number(e[t]) : Ce.has(t) ? () => e[t] : De.has(t) ? () => String(e[t]) : () => e.getAttribute(t), J = (t) => {
|
|
1199
1198
|
const e = t;
|
|
1200
|
-
e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.
|
|
1201
|
-
},
|
|
1202
|
-
class
|
|
1199
|
+
e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentNode && t.parentNode.removeChild(t);
|
|
1200
|
+
}, ft = (t) => Pe(t) || xe(t) ? t : t.parentElement, Pe = (t) => t.nodeType === 1, xe = (t) => t.nodeType === 11;
|
|
1201
|
+
class Le extends Error {
|
|
1203
1202
|
constructor(e) {
|
|
1204
1203
|
super(`Provider not found: ${e.description}`);
|
|
1205
1204
|
}
|
|
1206
1205
|
}
|
|
1207
|
-
class
|
|
1206
|
+
class R {
|
|
1208
1207
|
/**
|
|
1209
1208
|
* Constructs a new `DOMContext` instance.
|
|
1210
1209
|
*
|
|
@@ -1226,7 +1225,7 @@ class $ {
|
|
|
1226
1225
|
* @returns A new `DOMContext` instance.
|
|
1227
1226
|
*/
|
|
1228
1227
|
static of(e, s, n) {
|
|
1229
|
-
return new
|
|
1228
|
+
return new R(e.ownerDocument, e, s, n);
|
|
1230
1229
|
}
|
|
1231
1230
|
/**
|
|
1232
1231
|
* Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
|
|
@@ -1311,7 +1310,7 @@ class $ {
|
|
|
1311
1310
|
* @param element - The DOM element to use in the new `DOMContext` instance.
|
|
1312
1311
|
* @returns A new `DOMContext` instance with the provided `element`.
|
|
1313
1312
|
*/
|
|
1314
|
-
withElement = (e) => new
|
|
1313
|
+
withElement = (e) => new R(this.document, e, void 0, this.providers);
|
|
1315
1314
|
/**
|
|
1316
1315
|
* Creates a portal to render content in a different part of the DOM tree.
|
|
1317
1316
|
*
|
|
@@ -1368,7 +1367,7 @@ class $ {
|
|
|
1368
1367
|
* @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
|
|
1369
1368
|
* @returns A new `DOMContext` instance with the specified reference.
|
|
1370
1369
|
*/
|
|
1371
|
-
withReference = (e) => new
|
|
1370
|
+
withReference = (e) => new R(this.document, this.element, e, this.providers);
|
|
1372
1371
|
/**
|
|
1373
1372
|
* Sets a provider for the given provider mark.
|
|
1374
1373
|
*
|
|
@@ -1376,7 +1375,7 @@ class $ {
|
|
|
1376
1375
|
* @param value - The provider to set for the given mark.
|
|
1377
1376
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1378
1377
|
*/
|
|
1379
|
-
setProvider = (e, s, n) => new
|
|
1378
|
+
setProvider = (e, s, n) => new R(this.document, this.element, this.reference, {
|
|
1380
1379
|
...this.providers,
|
|
1381
1380
|
[e]: [s, n]
|
|
1382
1381
|
});
|
|
@@ -1389,12 +1388,12 @@ class $ {
|
|
|
1389
1388
|
*/
|
|
1390
1389
|
getProvider = (e) => {
|
|
1391
1390
|
if (this.providers[e] === void 0)
|
|
1392
|
-
throw new
|
|
1391
|
+
throw new Le(e);
|
|
1393
1392
|
const [s, n] = this.providers[e];
|
|
1394
1393
|
return { value: s, onUse: n };
|
|
1395
1394
|
};
|
|
1396
1395
|
clear = (e) => {
|
|
1397
|
-
e && (this.reference !== void 0 ?
|
|
1396
|
+
e && (this.reference !== void 0 ? J(this.reference) : J(this.element));
|
|
1398
1397
|
};
|
|
1399
1398
|
/**
|
|
1400
1399
|
* Adds classes to the element.
|
|
@@ -1464,28 +1463,28 @@ class $ {
|
|
|
1464
1463
|
*/
|
|
1465
1464
|
getStyle = (e) => this.element.style[e];
|
|
1466
1465
|
makeAccessors = (e) => ({
|
|
1467
|
-
get:
|
|
1468
|
-
set:
|
|
1466
|
+
get: pt(e, this.element),
|
|
1467
|
+
set: dt(e, this.element)
|
|
1469
1468
|
});
|
|
1470
1469
|
getWindow = () => this.document.defaultView;
|
|
1471
1470
|
}
|
|
1472
|
-
const
|
|
1473
|
-
const s = new
|
|
1471
|
+
const ne = (t, e) => {
|
|
1472
|
+
const s = new q(), n = O(s, () => t.render(e));
|
|
1474
1473
|
return (r = !0) => {
|
|
1475
1474
|
s.dispose(), n(r);
|
|
1476
1475
|
};
|
|
1477
|
-
},
|
|
1476
|
+
}, fs = (t, e, { doc: s, clear: n, disposeWithParent: r = !0, providers: o = {} } = {}) => {
|
|
1478
1477
|
const i = typeof e == "string" ? (s ?? document).querySelector(e) : e;
|
|
1479
1478
|
if (i === null)
|
|
1480
|
-
throw new
|
|
1479
|
+
throw new gt(
|
|
1481
1480
|
`Cannot find element by selector for render: ${e}`
|
|
1482
1481
|
);
|
|
1483
|
-
n !== !1 && (s ?? i.ownerDocument) != null && i.nodeType === 1 && (i.innerHTML = "");
|
|
1484
|
-
const l =
|
|
1482
|
+
n !== !1 && (s ?? i.ownerDocument) != null && (i.nodeType === 1 || i.nodeType === 11) && (i.innerHTML = "");
|
|
1483
|
+
const l = ft(i), c = Pe(i) || xe(i) ? void 0 : i, a = R.of(l, c, o), u = ne(t, a);
|
|
1485
1484
|
let h;
|
|
1486
|
-
return r && (h = new MutationObserver((
|
|
1487
|
-
|
|
1488
|
-
|
|
1485
|
+
return r && i.parentElement != null && (h = new MutationObserver((f) => {
|
|
1486
|
+
f[0]?.removedNodes.forEach((p) => {
|
|
1487
|
+
p === i && (h?.disconnect(), u(i.nodeType !== 1));
|
|
1489
1488
|
});
|
|
1490
1489
|
}), h.observe(i.parentElement, {
|
|
1491
1490
|
childList: !0,
|
|
@@ -1494,27 +1493,27 @@ const at = (t) => Symbol(t), fe = (t, e) => {
|
|
|
1494
1493
|
})), () => {
|
|
1495
1494
|
h?.disconnect(), u(!0);
|
|
1496
1495
|
};
|
|
1497
|
-
},
|
|
1496
|
+
}, gs = (t, {
|
|
1498
1497
|
startUrl: e = "https://example.com",
|
|
1499
1498
|
selector: s,
|
|
1500
1499
|
providers: n = {}
|
|
1501
1500
|
} = {
|
|
1502
1501
|
selector: "body"
|
|
1503
1502
|
}) => {
|
|
1504
|
-
const r =
|
|
1503
|
+
const r = w.toSignal(e).deriveProp(), o = new He(s, void 0), i = new j(o, void 0, { currentURL: r }, n);
|
|
1505
1504
|
return {
|
|
1506
|
-
clear:
|
|
1505
|
+
clear: ne(t(), i),
|
|
1507
1506
|
root: o,
|
|
1508
1507
|
currentURL: r
|
|
1509
1508
|
};
|
|
1510
1509
|
};
|
|
1511
|
-
class
|
|
1510
|
+
class gt extends Error {
|
|
1512
1511
|
constructor(e) {
|
|
1513
1512
|
super(e);
|
|
1514
1513
|
}
|
|
1515
1514
|
}
|
|
1516
|
-
const
|
|
1517
|
-
class
|
|
1515
|
+
const Oe = "data-tts-node", K = "data-tts-class", z = "data-tts-style", Y = "data-tts-html", X = "data-tts-text", Q = "data-tts-attrs";
|
|
1516
|
+
class ms {
|
|
1518
1517
|
/**
|
|
1519
1518
|
* Selects elements from the headless environment.
|
|
1520
1519
|
* @param selector - The selector to select elements from. The supported selectors are CSS selectors whose complexity depends on the adapter implementation.
|
|
@@ -1600,9 +1599,9 @@ class fs {
|
|
|
1600
1599
|
getInnerHTML: a,
|
|
1601
1600
|
setInnerHTML: u,
|
|
1602
1601
|
getInnerText: h,
|
|
1603
|
-
setInnerText:
|
|
1602
|
+
setInnerText: f
|
|
1604
1603
|
}) {
|
|
1605
|
-
this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = u, this.getInnerText = h, this.setInnerText =
|
|
1604
|
+
this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = u, this.getInnerText = h, this.setInnerText = f;
|
|
1606
1605
|
}
|
|
1607
1606
|
/**
|
|
1608
1607
|
* Sets the content of the root element from a HeadlessPortal. Generally this will be the same instance that is
|
|
@@ -1623,21 +1622,21 @@ class fs {
|
|
|
1623
1622
|
if (r.hasChildren() && this.appendHTML(i, r.contentToHTML(s)), r.hasInnerHTML()) {
|
|
1624
1623
|
if (s) {
|
|
1625
1624
|
const l = this.getInnerHTML(i);
|
|
1626
|
-
l != null && this.setAttribute(i,
|
|
1625
|
+
l != null && this.setAttribute(i, Y, l);
|
|
1627
1626
|
}
|
|
1628
1627
|
this.setInnerHTML(i, r.getInnerHTML());
|
|
1629
1628
|
}
|
|
1630
1629
|
if (r.hasInnerText()) {
|
|
1631
1630
|
if (s) {
|
|
1632
1631
|
const l = this.getInnerText(i);
|
|
1633
|
-
l != null && this.setAttribute(i,
|
|
1632
|
+
l != null && this.setAttribute(i, X, l);
|
|
1634
1633
|
}
|
|
1635
1634
|
this.setInnerText(i, r.getInnerText());
|
|
1636
1635
|
}
|
|
1637
1636
|
if (r.hasClasses()) {
|
|
1638
1637
|
if (s) {
|
|
1639
1638
|
const l = this.getClass(i);
|
|
1640
|
-
l != null && this.setAttribute(i,
|
|
1639
|
+
l != null && this.setAttribute(i, K, l);
|
|
1641
1640
|
}
|
|
1642
1641
|
this.setClass(i, r.getClasses().join(" "));
|
|
1643
1642
|
}
|
|
@@ -1646,7 +1645,7 @@ class fs {
|
|
|
1646
1645
|
const l = this.getStyles(i);
|
|
1647
1646
|
Object.keys(l).length > 0 && this.setAttribute(
|
|
1648
1647
|
i,
|
|
1649
|
-
|
|
1648
|
+
z,
|
|
1650
1649
|
JSON.stringify(l)
|
|
1651
1650
|
);
|
|
1652
1651
|
}
|
|
@@ -1673,56 +1672,56 @@ class fs {
|
|
|
1673
1672
|
});
|
|
1674
1673
|
};
|
|
1675
1674
|
}
|
|
1676
|
-
const
|
|
1677
|
-
document.querySelectorAll(`[${
|
|
1678
|
-
},
|
|
1679
|
-
const e = t.getAttribute(
|
|
1680
|
-
t.removeAttribute(
|
|
1681
|
-
},
|
|
1682
|
-
document.querySelectorAll(`[${
|
|
1683
|
-
},
|
|
1684
|
-
const e = t.getAttribute(X);
|
|
1685
|
-
t.removeAttribute(X), e != null && (t.innerHTML = e);
|
|
1686
|
-
}, gt = () => {
|
|
1687
|
-
document.querySelectorAll(`[${X}]`).forEach((e) => pt(e));
|
|
1688
|
-
}, mt = (t) => {
|
|
1675
|
+
const mt = () => {
|
|
1676
|
+
document.querySelectorAll(`[${Oe}]`).forEach(J);
|
|
1677
|
+
}, yt = (t) => {
|
|
1678
|
+
const e = t.getAttribute(K);
|
|
1679
|
+
t.removeAttribute(K), e != null && t.setAttribute("class", e);
|
|
1680
|
+
}, wt = () => {
|
|
1681
|
+
document.querySelectorAll(`[${K}]`).forEach((e) => yt(e));
|
|
1682
|
+
}, vt = (t) => {
|
|
1689
1683
|
const e = t.getAttribute(Y);
|
|
1690
|
-
t.removeAttribute(Y), e != null && (t.
|
|
1691
|
-
},
|
|
1692
|
-
document.querySelectorAll(`[${Y}]`).forEach((e) =>
|
|
1693
|
-
},
|
|
1694
|
-
const e = t.getAttribute(
|
|
1695
|
-
|
|
1696
|
-
|
|
1684
|
+
t.removeAttribute(Y), e != null && (t.innerHTML = e);
|
|
1685
|
+
}, bt = () => {
|
|
1686
|
+
document.querySelectorAll(`[${Y}]`).forEach((e) => vt(e));
|
|
1687
|
+
}, St = (t) => {
|
|
1688
|
+
const e = t.getAttribute(X);
|
|
1689
|
+
t.removeAttribute(X), e != null && (t.innerText = e);
|
|
1690
|
+
}, _t = () => {
|
|
1691
|
+
document.querySelectorAll(`[${X}]`).forEach((e) => St(e));
|
|
1692
|
+
}, ke = (t) => JSON.parse(t.replace(/"/g, '"')), At = (t) => {
|
|
1693
|
+
const e = t.getAttribute(z);
|
|
1694
|
+
if (t.removeAttribute(z), e != null) {
|
|
1695
|
+
const s = ke(e);
|
|
1697
1696
|
Object.entries(s).forEach(([n, r]) => {
|
|
1698
1697
|
t.style.setProperty(n, r);
|
|
1699
1698
|
});
|
|
1700
1699
|
}
|
|
1701
|
-
},
|
|
1702
|
-
document.querySelectorAll(`[${
|
|
1703
|
-
},
|
|
1700
|
+
}, Tt = () => {
|
|
1701
|
+
document.querySelectorAll(`[${z}]`).forEach((e) => At(e));
|
|
1702
|
+
}, Et = (t) => {
|
|
1704
1703
|
const e = t.getAttribute(Q);
|
|
1705
1704
|
if (t.removeAttribute(Q), e != null) {
|
|
1706
|
-
const s =
|
|
1705
|
+
const s = ke(e);
|
|
1707
1706
|
Object.entries(s).forEach(([n, r]) => {
|
|
1708
1707
|
r == null ? t.removeAttribute(n) : t.setAttribute(n, r);
|
|
1709
1708
|
});
|
|
1710
1709
|
}
|
|
1711
|
-
},
|
|
1712
|
-
document.querySelectorAll(`[${Q}]`).forEach((e) =>
|
|
1713
|
-
},
|
|
1714
|
-
|
|
1715
|
-
},
|
|
1716
|
-
class
|
|
1710
|
+
}, Ct = () => {
|
|
1711
|
+
document.querySelectorAll(`[${Q}]`).forEach((e) => Et(e));
|
|
1712
|
+
}, ys = () => {
|
|
1713
|
+
mt(), wt(), _t(), bt(), Tt(), Ct();
|
|
1714
|
+
}, H = Symbol("class"), N = Symbol("style"), U = Symbol("handler"), Me = () => Math.random().toString(36).substring(2, 15), Dt = (t) => t.replace(/<[^>]*>?/g, "");
|
|
1715
|
+
class Ie {
|
|
1717
1716
|
constructor(e) {
|
|
1718
1717
|
this.parent = e;
|
|
1719
1718
|
}
|
|
1720
|
-
id =
|
|
1719
|
+
id = Me();
|
|
1721
1720
|
properties = {};
|
|
1722
1721
|
children = [];
|
|
1723
1722
|
isElement = () => !0;
|
|
1724
1723
|
isText = () => !1;
|
|
1725
|
-
getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ?
|
|
1724
|
+
getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? Dt(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
|
|
1726
1725
|
removeChild = (e) => {
|
|
1727
1726
|
const s = this.children.indexOf(e);
|
|
1728
1727
|
s !== -1 && this.children.splice(s, 1);
|
|
@@ -1743,10 +1742,10 @@ class Me {
|
|
|
1743
1742
|
getInnerText = () => this.properties.innerText ?? "";
|
|
1744
1743
|
hasInnerText = () => this.properties.innerText != null;
|
|
1745
1744
|
hasChildren = () => this.children.length > 0;
|
|
1746
|
-
hasClasses = () => this.properties[
|
|
1747
|
-
hasStyles = () => this.properties[
|
|
1745
|
+
hasClasses = () => this.properties[H] != null;
|
|
1746
|
+
hasStyles = () => this.properties[N] != null;
|
|
1748
1747
|
hasAttributes = () => Object.keys(this.properties).length > 0;
|
|
1749
|
-
hasHandlers = () => this.properties[
|
|
1748
|
+
hasHandlers = () => this.properties[U] != null;
|
|
1750
1749
|
hasRenderableProperties = () => this.hasClasses() || this.hasAttributes() || this.hasStyles();
|
|
1751
1750
|
getById = (e) => {
|
|
1752
1751
|
if (this.properties.id === e)
|
|
@@ -1758,26 +1757,26 @@ class Me {
|
|
|
1758
1757
|
}
|
|
1759
1758
|
};
|
|
1760
1759
|
trigger = (e, s) => {
|
|
1761
|
-
((this.properties[
|
|
1760
|
+
((this.properties[U] ?? {})[e] ?? []).forEach((r) => r(s));
|
|
1762
1761
|
};
|
|
1763
1762
|
click = () => {
|
|
1764
1763
|
this.trigger("click", {});
|
|
1765
1764
|
};
|
|
1766
1765
|
on = (e, s, n, r) => {
|
|
1767
|
-
const o = this.properties[
|
|
1766
|
+
const o = this.properties[U] ??= {}, i = r?.once ? (c) => {
|
|
1768
1767
|
l(), s(c, n);
|
|
1769
1768
|
} : (c) => s(c, n);
|
|
1770
1769
|
o[e] = [...o[e] ?? [], i];
|
|
1771
1770
|
const l = () => {
|
|
1772
1771
|
const c = o[e] ?? [], a = c.indexOf(i);
|
|
1773
|
-
a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[
|
|
1772
|
+
a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[U]) : o[e] = c, r?.signal != null && r.signal.removeEventListener("abort", l));
|
|
1774
1773
|
};
|
|
1775
1774
|
return r?.signal != null && r.signal.addEventListener("abort", l), l;
|
|
1776
1775
|
};
|
|
1777
1776
|
addClasses = (e) => {
|
|
1778
1777
|
if (e.length === 0)
|
|
1779
1778
|
return;
|
|
1780
|
-
const s = this.properties[
|
|
1779
|
+
const s = this.properties[H] ??= [];
|
|
1781
1780
|
e.forEach((n) => {
|
|
1782
1781
|
s.includes(n) || s.push(n);
|
|
1783
1782
|
});
|
|
@@ -1785,25 +1784,25 @@ class Me {
|
|
|
1785
1784
|
removeClasses = (e) => {
|
|
1786
1785
|
if (e.length === 0)
|
|
1787
1786
|
return;
|
|
1788
|
-
const s = this.properties[
|
|
1787
|
+
const s = this.properties[H] ??= [];
|
|
1789
1788
|
e.forEach((n) => {
|
|
1790
1789
|
const r = s.indexOf(n);
|
|
1791
1790
|
r !== -1 && s.splice(r, 1);
|
|
1792
|
-
}), s.length === 0 && delete this.properties[
|
|
1791
|
+
}), s.length === 0 && delete this.properties[H];
|
|
1793
1792
|
};
|
|
1794
|
-
getClasses = () => this.properties[
|
|
1793
|
+
getClasses = () => this.properties[H] ?? [];
|
|
1795
1794
|
getAttributes = () => Object.entries(this.properties).filter(
|
|
1796
1795
|
([e]) => !["innerText", "innerHTML"].includes(e)
|
|
1797
1796
|
);
|
|
1798
1797
|
getVisibleAttributes = () => Reflect.ownKeys(this.properties).flatMap(
|
|
1799
|
-
(e) => e ===
|
|
1798
|
+
(e) => e === H ? [["class", this.getClasses()]] : e === N ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
|
|
1800
1799
|
);
|
|
1801
1800
|
setStyle = (e, s) => {
|
|
1802
|
-
const n = this.properties[
|
|
1803
|
-
n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[
|
|
1801
|
+
const n = this.properties[N] ??= {};
|
|
1802
|
+
n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[N]);
|
|
1804
1803
|
};
|
|
1805
|
-
getStyle = (e) => this.properties[
|
|
1806
|
-
getStyles = () => this.properties[
|
|
1804
|
+
getStyle = (e) => this.properties[N]?.[e] ?? "";
|
|
1805
|
+
getStyles = () => this.properties[N] ?? {};
|
|
1807
1806
|
makeAccessors = (e) => {
|
|
1808
1807
|
const s = this.properties;
|
|
1809
1808
|
return {
|
|
@@ -1812,8 +1811,8 @@ class Me {
|
|
|
1812
1811
|
};
|
|
1813
1812
|
};
|
|
1814
1813
|
}
|
|
1815
|
-
const
|
|
1816
|
-
class
|
|
1814
|
+
const Pt = (t) => t.replace(/"/g, """), xt = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1815
|
+
class Lt extends Ie {
|
|
1817
1816
|
constructor(e, s, n) {
|
|
1818
1817
|
super(n), this.tagName = e, this.namespace = s;
|
|
1819
1818
|
}
|
|
@@ -1821,11 +1820,11 @@ class Et extends Me {
|
|
|
1821
1820
|
toHTML = (e = !1) => {
|
|
1822
1821
|
const s = this.children.map((l) => l.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
|
|
1823
1822
|
let r = null;
|
|
1824
|
-
const o = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, u]) => `${a}: ${u};`).join(" ")}"` :
|
|
1825
|
-
return
|
|
1823
|
+
const o = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, u]) => `${a}: ${u};`).join(" ")}"` : kt.has(l) ? ` ${l}` : l === "innerHTML" ? (r = c, "") : l === "innerText" ? (r = xt(c), "") : ` ${l}="${Pt(c)}"`).join(""), i = e ? ` ${Oe}` : "";
|
|
1824
|
+
return Mt.has(this.tagName) && s === "" ? `<${this.tagName}${n}${o}${i} />` : `<${this.tagName}${n}${o}${i}>${r ?? s}</${this.tagName}>`;
|
|
1826
1825
|
};
|
|
1827
1826
|
}
|
|
1828
|
-
class
|
|
1827
|
+
class He extends Ie {
|
|
1829
1828
|
constructor(e, s) {
|
|
1830
1829
|
super(s), this.selector = e;
|
|
1831
1830
|
}
|
|
@@ -1833,30 +1832,30 @@ class ke extends Me {
|
|
|
1833
1832
|
toHTML = () => "";
|
|
1834
1833
|
contentToHTML = (e = !1) => this.children.map((s) => s.toHTML(e)).join("");
|
|
1835
1834
|
}
|
|
1836
|
-
class
|
|
1835
|
+
class Ot {
|
|
1837
1836
|
constructor(e) {
|
|
1838
1837
|
this.text = e;
|
|
1839
1838
|
}
|
|
1840
|
-
id =
|
|
1839
|
+
id = Me();
|
|
1841
1840
|
isElement = () => !1;
|
|
1842
1841
|
isText = () => !0;
|
|
1843
1842
|
getText = () => this.text;
|
|
1844
1843
|
toHTML = () => this.text;
|
|
1845
1844
|
}
|
|
1846
|
-
class
|
|
1845
|
+
class j {
|
|
1847
1846
|
constructor(e, s, n, r) {
|
|
1848
1847
|
this.element = e, this.reference = s, this.container = n, this.providers = r;
|
|
1849
1848
|
}
|
|
1850
1849
|
appendOrInsert = (e) => {
|
|
1851
1850
|
if (this.reference != null) {
|
|
1852
1851
|
const s = this.element.children.indexOf(this.reference);
|
|
1853
|
-
this.element.children.splice(s, 0, e);
|
|
1852
|
+
s >= 0 && this.element.children.splice(s, 0, e);
|
|
1854
1853
|
} else
|
|
1855
1854
|
this.element.children.push(e);
|
|
1856
1855
|
};
|
|
1857
1856
|
makeChildElement = (e, s) => {
|
|
1858
|
-
const n = new
|
|
1859
|
-
return this.appendOrInsert(n), new
|
|
1857
|
+
const n = new Lt(e, s, this.element);
|
|
1858
|
+
return this.appendOrInsert(n), new j(
|
|
1860
1859
|
n,
|
|
1861
1860
|
void 0,
|
|
1862
1861
|
this.container,
|
|
@@ -1864,8 +1863,8 @@ class R {
|
|
|
1864
1863
|
);
|
|
1865
1864
|
};
|
|
1866
1865
|
makeChildText = (e) => {
|
|
1867
|
-
const s = new
|
|
1868
|
-
return this.appendOrInsert(s), new
|
|
1866
|
+
const s = new Ot(e);
|
|
1867
|
+
return this.appendOrInsert(s), new j(
|
|
1869
1868
|
this.element,
|
|
1870
1869
|
s,
|
|
1871
1870
|
this.container,
|
|
@@ -1878,8 +1877,8 @@ class R {
|
|
|
1878
1877
|
getText = () => this.reference?.getText() ?? this.element.getText();
|
|
1879
1878
|
makeRef = () => this.makeChildText("");
|
|
1880
1879
|
makePortal = (e) => {
|
|
1881
|
-
const s = new
|
|
1882
|
-
return this.appendOrInsert(s), new
|
|
1880
|
+
const s = new He(e, this.element);
|
|
1881
|
+
return this.appendOrInsert(s), new j(
|
|
1883
1882
|
s,
|
|
1884
1883
|
void 0,
|
|
1885
1884
|
this.container,
|
|
@@ -1893,13 +1892,13 @@ class R {
|
|
|
1893
1892
|
* @param value - The provider to set for the given mark.
|
|
1894
1893
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1895
1894
|
*/
|
|
1896
|
-
setProvider = (e, s, n) => new
|
|
1895
|
+
setProvider = (e, s, n) => new j(this.element, this.reference, this.container, {
|
|
1897
1896
|
...this.providers,
|
|
1898
1897
|
[e]: [s, n]
|
|
1899
1898
|
});
|
|
1900
1899
|
getProvider = (e) => {
|
|
1901
1900
|
if (this.providers[e] === void 0)
|
|
1902
|
-
throw new
|
|
1901
|
+
throw new Le(e);
|
|
1903
1902
|
const [s, n] = this.providers[e];
|
|
1904
1903
|
return { value: s, onUse: n };
|
|
1905
1904
|
};
|
|
@@ -1918,27 +1917,30 @@ class R {
|
|
|
1918
1917
|
getStyle = (e) => this.element.getStyle(e);
|
|
1919
1918
|
makeAccessors = (e) => this.element.makeAccessors(e);
|
|
1920
1919
|
}
|
|
1921
|
-
const
|
|
1920
|
+
const kt = /* @__PURE__ */ new Set([
|
|
1922
1921
|
"checked",
|
|
1923
1922
|
"disabled",
|
|
1924
1923
|
"multiple",
|
|
1925
1924
|
"readonly",
|
|
1926
1925
|
"required",
|
|
1927
1926
|
"selected"
|
|
1928
|
-
]),
|
|
1927
|
+
]), Mt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), ws = () => (
|
|
1928
|
+
/* c8 ignore next */
|
|
1929
|
+
typeof window < "u" ? window : void 0
|
|
1930
|
+
), It = Symbol("DOM_RENDERABLE"), g = (t) => ze(It, t), Ne = (t) => g((e) => e.makeChildText(t).clear), $e = (t) => g((e) => {
|
|
1929
1931
|
const s = e.makeChildText(t.value), n = t.on(s.setText);
|
|
1930
1932
|
return (r) => {
|
|
1931
1933
|
n(), s.clear(r);
|
|
1932
1934
|
};
|
|
1933
|
-
},
|
|
1934
|
-
const s = t.map((n) =>
|
|
1935
|
+
}), vs = (t) => m.is(t) ? $e(t) : Ne(t), E = (...t) => g((e) => {
|
|
1936
|
+
const s = t.map((n) => d(n).render(e));
|
|
1935
1937
|
return (n) => {
|
|
1936
1938
|
s.forEach((r) => r(n));
|
|
1937
1939
|
};
|
|
1938
|
-
},
|
|
1939
|
-
},
|
|
1940
|
+
}), D = g(() => () => {
|
|
1941
|
+
}), Ht = (t) => g((e) => (e.addClasses(t), (s) => {
|
|
1940
1942
|
s && e.removeClasses(t);
|
|
1941
|
-
}),
|
|
1943
|
+
})), Nt = (t) => g((e) => {
|
|
1942
1944
|
let s = [];
|
|
1943
1945
|
const n = t.on(
|
|
1944
1946
|
(r) => {
|
|
@@ -1949,20 +1951,20 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
1949
1951
|
return (r) => {
|
|
1950
1952
|
n(), r && e.removeClasses(s), s.length = 0;
|
|
1951
1953
|
};
|
|
1952
|
-
},
|
|
1954
|
+
}), $t = (t, e) => g((s) => {
|
|
1953
1955
|
const { get: n, set: r } = s.makeAccessors(t), o = n();
|
|
1954
1956
|
return r(e), (i) => {
|
|
1955
1957
|
i && r(o);
|
|
1956
1958
|
};
|
|
1957
|
-
},
|
|
1959
|
+
}), Rt = (t, e) => g((s) => {
|
|
1958
1960
|
const { get: n, set: r } = s.makeAccessors(t), o = n(), i = e.on(r, { noAutoDispose: !0 });
|
|
1959
1961
|
return (l) => {
|
|
1960
1962
|
i(), l && r(o);
|
|
1961
1963
|
};
|
|
1962
|
-
},
|
|
1964
|
+
}), B = (t, e) => m.is(e) ? Rt(t, e) : $t(t, e), jt = (t, e) => t === "class" ? m.is(e) ? Nt(e) : Ht(
|
|
1963
1965
|
/* c8 ignore next */
|
|
1964
1966
|
(e ?? "").split(" ").filter((s) => s.length > 0)
|
|
1965
|
-
) :
|
|
1967
|
+
) : B(t, e), V = new Proxy(
|
|
1966
1968
|
{},
|
|
1967
1969
|
{
|
|
1968
1970
|
/**
|
|
@@ -1976,9 +1978,9 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
1976
1978
|
* @returns The renderable component for the specified attribute.
|
|
1977
1979
|
*
|
|
1978
1980
|
*/
|
|
1979
|
-
get: (t, e) => (s) =>
|
|
1981
|
+
get: (t, e) => (s) => jt(e, s)
|
|
1980
1982
|
}
|
|
1981
|
-
),
|
|
1983
|
+
), Vt = (t, e) => B(`data-${t}`, e), bs = new Proxy(
|
|
1982
1984
|
{},
|
|
1983
1985
|
{
|
|
1984
1986
|
/**
|
|
@@ -1989,9 +1991,9 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
1989
1991
|
* @returns The renderable component for the specified attribute.
|
|
1990
1992
|
*
|
|
1991
1993
|
*/
|
|
1992
|
-
get: (t, e) => (s) =>
|
|
1994
|
+
get: (t, e) => (s) => Vt(e, s)
|
|
1993
1995
|
}
|
|
1994
|
-
),
|
|
1996
|
+
), qt = (t, e) => B(`aria-${t}`, e), Ss = new Proxy(
|
|
1995
1997
|
{},
|
|
1996
1998
|
{
|
|
1997
1999
|
/**
|
|
@@ -2002,9 +2004,9 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2002
2004
|
* @returns The renderable component for the specified attribute.
|
|
2003
2005
|
*
|
|
2004
2006
|
*/
|
|
2005
|
-
get: (t, e) => (s) =>
|
|
2007
|
+
get: (t, e) => (s) => qt(e, s)
|
|
2006
2008
|
}
|
|
2007
|
-
),
|
|
2009
|
+
), Bt = (t, e) => B(t, e), _s = new Proxy(
|
|
2008
2010
|
{},
|
|
2009
2011
|
{
|
|
2010
2012
|
/**
|
|
@@ -2015,9 +2017,9 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2015
2017
|
* @returns The renderable component for the specified attribute.
|
|
2016
2018
|
*
|
|
2017
2019
|
*/
|
|
2018
|
-
get: (t, e) => (s) =>
|
|
2020
|
+
get: (t, e) => (s) => Bt(e, s)
|
|
2019
2021
|
}
|
|
2020
|
-
),
|
|
2022
|
+
), Ft = (t, e) => B(t, e), As = new Proxy(
|
|
2021
2023
|
{},
|
|
2022
2024
|
{
|
|
2023
2025
|
/**
|
|
@@ -2027,31 +2029,31 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2027
2029
|
* @returns The renderable component for the specified attribute.
|
|
2028
2030
|
*
|
|
2029
2031
|
*/
|
|
2030
|
-
get: (t, e) => (s) =>
|
|
2032
|
+
get: (t, e) => (s) => Ft(e, s)
|
|
2031
2033
|
}
|
|
2032
|
-
),
|
|
2034
|
+
), d = (t) => {
|
|
2033
2035
|
if (t == null)
|
|
2034
|
-
return
|
|
2036
|
+
return D;
|
|
2035
2037
|
if (Array.isArray(t))
|
|
2036
|
-
return E(...t.map(
|
|
2038
|
+
return E(...t.map(d));
|
|
2037
2039
|
if (typeof t == "string")
|
|
2038
|
-
return
|
|
2039
|
-
if (
|
|
2040
|
-
return
|
|
2041
|
-
if (typeof t == "
|
|
2040
|
+
return Ne(t);
|
|
2041
|
+
if (m.is(t))
|
|
2042
|
+
return $e(t);
|
|
2043
|
+
if (typeof t == "object" && "render" in t && "type" in t)
|
|
2042
2044
|
return t;
|
|
2043
2045
|
throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
|
|
2044
|
-
},
|
|
2045
|
-
const n = s.makeChildElement(t, void 0), r = e.map((o) =>
|
|
2046
|
+
}, Re = (t, ...e) => g((s) => {
|
|
2047
|
+
const n = s.makeChildElement(t, void 0), r = e.map((o) => d(o).render(n));
|
|
2046
2048
|
return (o) => {
|
|
2047
2049
|
r.forEach((i) => i(!1)), n.clear(o);
|
|
2048
2050
|
};
|
|
2049
|
-
},
|
|
2050
|
-
const r = n.makeChildElement(t, e), o = s.map((i) =>
|
|
2051
|
+
}), re = (t, e, ...s) => g((n) => {
|
|
2052
|
+
const r = n.makeChildElement(t, e), o = s.map((i) => d(i).render(r));
|
|
2051
2053
|
return (i) => {
|
|
2052
2054
|
o.forEach((l) => l(!1)), r.clear(i);
|
|
2053
2055
|
};
|
|
2054
|
-
},
|
|
2056
|
+
}), Ts = new Proxy(
|
|
2055
2057
|
{},
|
|
2056
2058
|
{
|
|
2057
2059
|
/**
|
|
@@ -2059,9 +2061,9 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2059
2061
|
* @param tagName - The HTML tag name.
|
|
2060
2062
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
2061
2063
|
*/
|
|
2062
|
-
get: (t, e) => (...s) =>
|
|
2064
|
+
get: (t, e) => (...s) => Re(e, s.flatMap(d))
|
|
2063
2065
|
}
|
|
2064
|
-
),
|
|
2066
|
+
), Es = new Proxy(
|
|
2065
2067
|
{},
|
|
2066
2068
|
{
|
|
2067
2069
|
/**
|
|
@@ -2069,9 +2071,9 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2069
2071
|
* @param type - The input type name.
|
|
2070
2072
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
2071
2073
|
*/
|
|
2072
|
-
get: (t, e) => (...s) =>
|
|
2074
|
+
get: (t, e) => (...s) => Re("input", V.type(e), ...s)
|
|
2073
2075
|
}
|
|
2074
|
-
),
|
|
2076
|
+
), je = "http://www.w3.org/2000/svg", Cs = (t, ...e) => re(t, je, ...e), Ds = new Proxy(
|
|
2075
2077
|
{},
|
|
2076
2078
|
{
|
|
2077
2079
|
/**
|
|
@@ -2079,9 +2081,9 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2079
2081
|
* @param tagName - The SVG tag name.
|
|
2080
2082
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
2081
2083
|
*/
|
|
2082
|
-
get: (t, e) => (...s) =>
|
|
2084
|
+
get: (t, e) => (...s) => re(e, je, s.flatMap(d))
|
|
2083
2085
|
}
|
|
2084
|
-
),
|
|
2086
|
+
), Ve = "http://www.w3.org/1998/Math/MathML", Ps = (t, ...e) => re(t, Ve, ...e), xs = new Proxy(
|
|
2085
2087
|
{},
|
|
2086
2088
|
{
|
|
2087
2089
|
/**
|
|
@@ -2089,35 +2091,35 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2089
2091
|
* @param tagName - The Math tag name.
|
|
2090
2092
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
2091
2093
|
*/
|
|
2092
|
-
get: (t, e) => (...s) =>
|
|
2094
|
+
get: (t, e) => (...s) => re(e, Ve, s.flatMap(d))
|
|
2093
2095
|
}
|
|
2094
|
-
),
|
|
2096
|
+
), qe = (t, e) => {
|
|
2095
2097
|
if (typeof e == "function")
|
|
2096
|
-
return
|
|
2097
|
-
const s = e.pending != null ?
|
|
2098
|
-
return (o) => {
|
|
2098
|
+
return qe(t, { then: e });
|
|
2099
|
+
const s = e.pending != null ? d(e.pending()) : D, n = e.then, r = e.error != null ? (o) => d(e.error(o)) : () => D;
|
|
2100
|
+
return g((o) => {
|
|
2099
2101
|
let i = !0;
|
|
2100
2102
|
const l = t(), c = o.makeRef();
|
|
2101
|
-
let a =
|
|
2103
|
+
let a = d(s).render(c);
|
|
2102
2104
|
return l.then(
|
|
2103
2105
|
(u) => {
|
|
2104
|
-
i && (a(!0), a =
|
|
2106
|
+
i && (a(!0), a = d(n(u)).render(c));
|
|
2105
2107
|
},
|
|
2106
2108
|
(u) => {
|
|
2107
|
-
i && (a(!0), a =
|
|
2109
|
+
i && (a(!0), a = d(r(u)).render(c));
|
|
2108
2110
|
}
|
|
2109
2111
|
), (u) => {
|
|
2110
2112
|
i = !1, a(u), c.clear(u);
|
|
2111
2113
|
};
|
|
2112
|
-
};
|
|
2113
|
-
},
|
|
2114
|
+
});
|
|
2115
|
+
}, Ls = (t, e) => qe(() => t, e), Be = (t, e, s) => g((n) => n.on(t, e, s)), Wt = (t) => Be("click", (e, s) => {
|
|
2114
2116
|
e.preventDefault();
|
|
2115
2117
|
const n = e.target;
|
|
2116
2118
|
setTimeout(() => {
|
|
2117
2119
|
const r = n.ownerDocument != null ? n?.checked : void 0;
|
|
2118
2120
|
r != null && t(!r, s);
|
|
2119
2121
|
}, 0);
|
|
2120
|
-
}),
|
|
2122
|
+
}), oe = new Proxy(
|
|
2121
2123
|
{},
|
|
2122
2124
|
{
|
|
2123
2125
|
/**
|
|
@@ -2125,20 +2127,20 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2125
2127
|
* @param fn - The function to call when the event is triggered.
|
|
2126
2128
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
2127
2129
|
*/
|
|
2128
|
-
get: (t, e) => (s) =>
|
|
2130
|
+
get: (t, e) => (s) => Be(e, s)
|
|
2129
2131
|
}
|
|
2130
|
-
),
|
|
2132
|
+
), Ut = (t, e) => (s) => {
|
|
2131
2133
|
e?.preventDefault === !0 && s.preventDefault(), e?.stopPropagation === !0 && s.stopPropagation(), e?.stopImmediatePropagation === !0 && s.stopImmediatePropagation(), t(s);
|
|
2132
|
-
},
|
|
2134
|
+
}, k = (t, e) => Ut((s) => {
|
|
2133
2135
|
const n = s.target;
|
|
2134
2136
|
t(n, s);
|
|
2135
|
-
}, e),
|
|
2137
|
+
}, e), Gt = (t, e) => k(
|
|
2136
2138
|
(s, n) => t(s.value, n),
|
|
2137
2139
|
e
|
|
2138
|
-
),
|
|
2140
|
+
), Jt = (t, e) => k(
|
|
2139
2141
|
(s, n) => t(s.valueAsNumber, n),
|
|
2140
2142
|
e
|
|
2141
|
-
),
|
|
2143
|
+
), Kt = (t, e) => k((s, n) => {
|
|
2142
2144
|
if (s.value === "")
|
|
2143
2145
|
return;
|
|
2144
2146
|
const r = s.value.split("-"), o = new Date(
|
|
@@ -2147,7 +2149,7 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2147
2149
|
Number(r[2].substring(0, 2))
|
|
2148
2150
|
);
|
|
2149
2151
|
t(o, n);
|
|
2150
|
-
}, e),
|
|
2152
|
+
}, e), Os = (t, e) => k((s, n) => {
|
|
2151
2153
|
if (s.value === "") {
|
|
2152
2154
|
t(null, n);
|
|
2153
2155
|
return;
|
|
@@ -2158,7 +2160,7 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2158
2160
|
Number(r[2].substring(0, 2))
|
|
2159
2161
|
);
|
|
2160
2162
|
t(o, n);
|
|
2161
|
-
}, e),
|
|
2163
|
+
}, e), zt = (t, e) => k((s, n) => {
|
|
2162
2164
|
if (s.value === "")
|
|
2163
2165
|
return;
|
|
2164
2166
|
const r = s.value.split("T"), o = r[0].split("-"), i = new Date(
|
|
@@ -2167,7 +2169,7 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2167
2169
|
Number(o[2])
|
|
2168
2170
|
), l = r[1].split(":");
|
|
2169
2171
|
i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), t(i, n);
|
|
2170
|
-
}, e),
|
|
2172
|
+
}, e), ks = (t, e) => k((s, n) => {
|
|
2171
2173
|
if (s.value === "") {
|
|
2172
2174
|
t(null, n);
|
|
2173
2175
|
return;
|
|
@@ -2183,17 +2185,17 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2183
2185
|
Number(o[2])
|
|
2184
2186
|
), l = r[1].split(":");
|
|
2185
2187
|
i.setHours(Number(l[0] ?? 0)), i.setMinutes(Number(l[1] ?? 0)), i.setSeconds(Number(l[2] ?? 0)), t(i, n);
|
|
2186
|
-
}, e),
|
|
2188
|
+
}, e), Ms = (t, e) => k((s, n) => {
|
|
2187
2189
|
t(s.checked, n);
|
|
2188
|
-
}, e),
|
|
2190
|
+
}, e), Is = (t, e = "input") => E(V.valueAsDate(t), oe[e](Kt(t.set))), Hs = (t, e = "input") => E(V.valueAsDate(t), oe[e](zt(t.set))), Ns = (t, e = "input") => E(V.valueAsNumber(t), oe[e](Jt(t.set))), $s = (t, e = "input") => E(V.value(t), oe[e](Gt(t.set))), Rs = (t) => E(V.checked(t), Wt(t.set)), fe = (t, e, s) => m.is(t) ? e(t) : s(t), Yt = (t, e, s) => {
|
|
2189
2191
|
const n = t.makeRef();
|
|
2190
2192
|
let r = () => {
|
|
2191
2193
|
}, o = null;
|
|
2192
2194
|
const i = e.on(
|
|
2193
2195
|
(l) => {
|
|
2194
|
-
o?.dispose(), r(!0), o = new
|
|
2196
|
+
o?.dispose(), r(!0), o = new q(), r = O(
|
|
2195
2197
|
o,
|
|
2196
|
-
() =>
|
|
2198
|
+
() => d(s(l)).render(n)
|
|
2197
2199
|
);
|
|
2198
2200
|
},
|
|
2199
2201
|
{ noAutoDispose: !0 }
|
|
@@ -2201,43 +2203,45 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2201
2203
|
return (l) => {
|
|
2202
2204
|
o?.dispose(), r(l), i(), n.clear(l);
|
|
2203
2205
|
};
|
|
2204
|
-
},
|
|
2206
|
+
}, ie = (t, e) => {
|
|
2205
2207
|
function s(r) {
|
|
2206
|
-
return (o) => {
|
|
2208
|
+
return g((o) => {
|
|
2207
2209
|
const i = o.makeRef();
|
|
2208
2210
|
let l, c;
|
|
2209
|
-
const a = r.map((
|
|
2211
|
+
const a = r.map((f) => Object.keys(f)[0]);
|
|
2210
2212
|
let u;
|
|
2211
|
-
const h = a.on((
|
|
2212
|
-
if (
|
|
2213
|
-
u =
|
|
2214
|
-
const
|
|
2215
|
-
l =
|
|
2213
|
+
const h = a.on((f) => {
|
|
2214
|
+
if (f !== u) {
|
|
2215
|
+
u = f, c?.dispose(), l?.(!0), c = r.map((y) => y[f]);
|
|
2216
|
+
const p = e[f](c);
|
|
2217
|
+
l = d(p).render(i);
|
|
2216
2218
|
}
|
|
2217
2219
|
});
|
|
2218
|
-
return (
|
|
2219
|
-
c?.dispose(), h(), i.clear(
|
|
2220
|
+
return (f) => {
|
|
2221
|
+
c?.dispose(), h(), i.clear(f), l?.(f);
|
|
2220
2222
|
};
|
|
2221
|
-
};
|
|
2223
|
+
});
|
|
2222
2224
|
}
|
|
2223
2225
|
function n(r) {
|
|
2224
2226
|
const o = Object.keys(r)[0];
|
|
2225
|
-
return
|
|
2227
|
+
return d(e[o](se(r[o])));
|
|
2226
2228
|
}
|
|
2227
|
-
return
|
|
2228
|
-
},
|
|
2229
|
-
|
|
2229
|
+
return fe(t, s, n);
|
|
2230
|
+
}, Fe = (t, e, s) => ie(
|
|
2231
|
+
w.map(t, (n) => ({ [n[e]]: n })),
|
|
2230
2232
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2231
2233
|
s
|
|
2232
|
-
),
|
|
2233
|
-
const s =
|
|
2234
|
-
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2234
|
+
), js = (t, e) => Fe(t, "kind", e), Vs = (t, e) => {
|
|
2235
|
+
const s = w.map(t, ([n, r]) => ({
|
|
2236
|
+
[n]: r
|
|
2237
|
+
}));
|
|
2238
|
+
return ie(s, e);
|
|
2239
|
+
}, qs = (t, e) => Fe(t, "type", e), Xt = (t, e) => ie(
|
|
2240
|
+
w.map(t, (s) => ({ [s]: !0 })),
|
|
2237
2241
|
e
|
|
2238
|
-
),
|
|
2242
|
+
), Bs = (t, e = {}) => (s) => {
|
|
2239
2243
|
const n = e?.firstSeparator ?? t, r = e?.lastSeparator ?? t;
|
|
2240
|
-
return
|
|
2244
|
+
return Xt(
|
|
2241
2245
|
s.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
|
|
2242
2246
|
{
|
|
2243
2247
|
first: n,
|
|
@@ -2245,111 +2249,111 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2245
2249
|
other: t
|
|
2246
2250
|
}
|
|
2247
2251
|
);
|
|
2248
|
-
},
|
|
2249
|
-
s &&
|
|
2250
|
-
}),
|
|
2252
|
+
}, Fs = (t) => g((e) => (e.appendOrInsert(t), (s) => {
|
|
2253
|
+
s && J(t);
|
|
2254
|
+
})), Ws = (t, e, s) => {
|
|
2251
2255
|
function n(o) {
|
|
2252
|
-
return (i) => {
|
|
2256
|
+
return g((i) => {
|
|
2253
2257
|
const l = i.makeRef();
|
|
2254
2258
|
let c = () => {
|
|
2255
2259
|
}, a = !1, u = null;
|
|
2256
|
-
const h = o.on((
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
), a = !0);
|
|
2260
|
+
const h = o.on((f) => {
|
|
2261
|
+
f == null ? (c(!0), c = d(s?.()).render(l), a = !1, u?.dispose(), u = null) : a ? u.set(f) : (u = T(f), c(!0), c = d(
|
|
2262
|
+
e(u)
|
|
2263
|
+
).render(l), a = !0);
|
|
2260
2264
|
});
|
|
2261
|
-
return (
|
|
2262
|
-
u?.dispose(), h(), c?.(
|
|
2265
|
+
return (f) => {
|
|
2266
|
+
u?.dispose(), h(), c?.(f), l.clear(f);
|
|
2263
2267
|
};
|
|
2264
|
-
};
|
|
2268
|
+
});
|
|
2265
2269
|
}
|
|
2266
2270
|
function r(o) {
|
|
2267
2271
|
if (o == null) {
|
|
2268
2272
|
const i = s?.();
|
|
2269
|
-
return i != null ?
|
|
2273
|
+
return i != null ? d(i) : D;
|
|
2270
2274
|
}
|
|
2271
|
-
return
|
|
2275
|
+
return d(e(se(o)));
|
|
2272
2276
|
}
|
|
2273
|
-
return
|
|
2277
|
+
return fe(
|
|
2274
2278
|
t,
|
|
2275
2279
|
n,
|
|
2276
2280
|
r
|
|
2277
2281
|
);
|
|
2278
|
-
},
|
|
2282
|
+
}, Us = (...t) => (e, s) => g((n) => {
|
|
2279
2283
|
const r = n.makeRef();
|
|
2280
2284
|
if (t.some(
|
|
2281
|
-
(
|
|
2285
|
+
(p) => !m.is(p) && p == null
|
|
2282
2286
|
))
|
|
2283
|
-
return (s != null ?
|
|
2284
|
-
r
|
|
2285
|
-
);
|
|
2287
|
+
return (s != null ? d(s?.()) : D).render(r);
|
|
2286
2288
|
const i = t.map(() => null), l = t.map(
|
|
2287
|
-
(
|
|
2289
|
+
(p) => m.is(p) ? p.value != null : p != null
|
|
2288
2290
|
);
|
|
2289
2291
|
let c = null;
|
|
2290
|
-
const a =
|
|
2291
|
-
if (
|
|
2292
|
-
if (i[
|
|
2293
|
-
const
|
|
2294
|
-
i[
|
|
2292
|
+
const a = T(l.every((p) => p)), u = (p, y) => {
|
|
2293
|
+
if (p.value != null) {
|
|
2294
|
+
if (i[y] == null) {
|
|
2295
|
+
const v = T(p.value);
|
|
2296
|
+
i[y] = v;
|
|
2295
2297
|
} else
|
|
2296
|
-
i[
|
|
2297
|
-
l[
|
|
2298
|
+
i[y].value = p.value;
|
|
2299
|
+
l[y] = !0;
|
|
2298
2300
|
} else
|
|
2299
|
-
l[
|
|
2301
|
+
l[y] = !1;
|
|
2300
2302
|
};
|
|
2301
2303
|
let h = t.length - 1;
|
|
2302
|
-
const
|
|
2303
|
-
if (!
|
|
2304
|
-
const
|
|
2305
|
-
return i[
|
|
2304
|
+
const f = t.map((p, y) => {
|
|
2305
|
+
if (!m.is(p)) {
|
|
2306
|
+
const v = T(p);
|
|
2307
|
+
return i[y] = v, () => {
|
|
2306
2308
|
};
|
|
2307
2309
|
}
|
|
2308
|
-
return
|
|
2309
|
-
u(
|
|
2310
|
+
return p.on(() => {
|
|
2311
|
+
u(p, y), h === 0 ? a.value = l.every((v) => v) : h--;
|
|
2310
2312
|
});
|
|
2311
2313
|
});
|
|
2312
|
-
return a.on((
|
|
2313
|
-
c?.(!0), c = null,
|
|
2314
|
-
}), (
|
|
2315
|
-
i.forEach((
|
|
2314
|
+
return a.on((p) => {
|
|
2315
|
+
c?.(!0), c = null, p ? c = d(e(...i)).render(r) : c = d(s?.() ?? D).render(r);
|
|
2316
|
+
}), (p) => {
|
|
2317
|
+
i.forEach((y) => y?.dispose()), a.dispose(), f.forEach((y) => y()), c?.(p), r.clear(p);
|
|
2316
2318
|
};
|
|
2317
|
-
},
|
|
2319
|
+
}), We = (t, e, s) => fe(
|
|
2318
2320
|
t,
|
|
2319
|
-
(n) => (
|
|
2320
|
-
r
|
|
2321
|
-
|
|
2322
|
-
|
|
2321
|
+
(n) => g(
|
|
2322
|
+
(r) => Yt(
|
|
2323
|
+
r,
|
|
2324
|
+
n,
|
|
2325
|
+
(o) => o ? e() : s?.()
|
|
2326
|
+
)
|
|
2323
2327
|
),
|
|
2324
2328
|
(n) => {
|
|
2325
2329
|
if (n) {
|
|
2326
2330
|
const r = e();
|
|
2327
|
-
return r != null ?
|
|
2331
|
+
return r != null ? d(r) : D;
|
|
2328
2332
|
}
|
|
2329
|
-
return
|
|
2333
|
+
return d(s?.());
|
|
2330
2334
|
}
|
|
2331
|
-
),
|
|
2332
|
-
|
|
2335
|
+
), Gs = (t, e, s) => We(
|
|
2336
|
+
w.map(t, (n) => !n),
|
|
2333
2337
|
e,
|
|
2334
2338
|
s
|
|
2335
|
-
),
|
|
2339
|
+
), Ue = (t, e, s) => {
|
|
2336
2340
|
if (s != null)
|
|
2337
|
-
return
|
|
2338
|
-
const r = new
|
|
2341
|
+
return Ue(t, (n) => {
|
|
2342
|
+
const r = new he(
|
|
2339
2343
|
n.index,
|
|
2340
2344
|
n.total.map((o) => o - 1)
|
|
2341
2345
|
);
|
|
2342
2346
|
return E(
|
|
2343
|
-
|
|
2344
|
-
|
|
2347
|
+
d(e(n)),
|
|
2348
|
+
We(
|
|
2345
2349
|
n.isLast,
|
|
2346
|
-
() =>
|
|
2350
|
+
() => D,
|
|
2347
2351
|
() => s(r)
|
|
2348
2352
|
)
|
|
2349
2353
|
);
|
|
2350
2354
|
});
|
|
2351
|
-
if (
|
|
2352
|
-
return (n) => {
|
|
2355
|
+
if (m.is(t))
|
|
2356
|
+
return g((n) => {
|
|
2353
2357
|
const r = t.derive(), o = n.makeRef(), i = [], l = [];
|
|
2354
2358
|
return r.on((c) => {
|
|
2355
2359
|
const a = i.splice(c), u = l.splice(c);
|
|
@@ -2358,9 +2362,12 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2358
2362
|
for (const h of a)
|
|
2359
2363
|
h(!0);
|
|
2360
2364
|
for (let h = i.length; h < c; h++) {
|
|
2361
|
-
const
|
|
2362
|
-
l.push(
|
|
2363
|
-
|
|
2365
|
+
const f = new he(h, r), p = new q();
|
|
2366
|
+
l.push(p), i.push(
|
|
2367
|
+
O(
|
|
2368
|
+
p,
|
|
2369
|
+
() => d(e(f)).render(o)
|
|
2370
|
+
)
|
|
2364
2371
|
);
|
|
2365
2372
|
}
|
|
2366
2373
|
}), (c) => {
|
|
@@ -2371,47 +2378,49 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2371
2378
|
a(c);
|
|
2372
2379
|
i.length = 0, o.clear(c);
|
|
2373
2380
|
};
|
|
2374
|
-
};
|
|
2381
|
+
});
|
|
2375
2382
|
{
|
|
2376
|
-
const n =
|
|
2383
|
+
const n = se(t);
|
|
2377
2384
|
return E(
|
|
2378
2385
|
...Array.from({ length: t }, (r, o) => o).map((r) => {
|
|
2379
|
-
const o = new
|
|
2380
|
-
return
|
|
2386
|
+
const o = new he(r, n);
|
|
2387
|
+
return d(e(o));
|
|
2381
2388
|
})
|
|
2382
2389
|
);
|
|
2383
2390
|
}
|
|
2384
|
-
},
|
|
2385
|
-
const n =
|
|
2386
|
-
return
|
|
2391
|
+
}, Js = (t, e, s) => {
|
|
2392
|
+
const n = w.map(t, (o) => o.length), r = w.toSignal(t);
|
|
2393
|
+
return Ue(
|
|
2387
2394
|
n,
|
|
2388
2395
|
(o) => {
|
|
2389
2396
|
const i = r.map((l) => l[o.index]);
|
|
2390
|
-
return
|
|
2397
|
+
return d(e(i, o));
|
|
2391
2398
|
},
|
|
2392
2399
|
s
|
|
2393
2400
|
);
|
|
2394
|
-
},
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2401
|
+
}, Ge = (...t) => g(
|
|
2402
|
+
(e) => (s) => t.forEach((n) => {
|
|
2403
|
+
typeof n == "function" ? n(s, e) : n.dispose(s, e);
|
|
2404
|
+
})
|
|
2405
|
+
), Ks = (t, e) => {
|
|
2406
|
+
if (m.is(t)) {
|
|
2398
2407
|
const s = t;
|
|
2399
|
-
return (n) => {
|
|
2408
|
+
return g((n) => {
|
|
2400
2409
|
n = n.makeRef();
|
|
2401
|
-
const r = s.map((l) =>
|
|
2410
|
+
const r = s.map((l) => d(e(l)));
|
|
2402
2411
|
let o = () => {
|
|
2403
2412
|
};
|
|
2404
2413
|
const i = r.on((l) => {
|
|
2405
|
-
o(!0), o = l(n);
|
|
2414
|
+
o(!0), o = l.render(n);
|
|
2406
2415
|
});
|
|
2407
2416
|
return (l) => {
|
|
2408
2417
|
i(), o(l);
|
|
2409
2418
|
};
|
|
2410
|
-
};
|
|
2419
|
+
});
|
|
2411
2420
|
}
|
|
2412
|
-
return
|
|
2413
|
-
},
|
|
2414
|
-
|
|
2421
|
+
return d(e(t));
|
|
2422
|
+
}, zs = (t, e, s = () => D) => ie(
|
|
2423
|
+
w.map(
|
|
2415
2424
|
t,
|
|
2416
2425
|
(n) => n.length > 0 ? { notEmpty: n } : { whenEmpty: null }
|
|
2417
2426
|
),
|
|
@@ -2419,40 +2428,63 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2419
2428
|
notEmpty: (n) => e(n),
|
|
2420
2429
|
whenEmpty: () => s()
|
|
2421
2430
|
}
|
|
2422
|
-
),
|
|
2423
|
-
const n = s.makePortal(t), r =
|
|
2431
|
+
), Ys = (t, e) => g((s) => {
|
|
2432
|
+
const n = s.makePortal(t), r = ne(d(e), n);
|
|
2424
2433
|
return () => r(!0);
|
|
2425
|
-
},
|
|
2426
|
-
mark:
|
|
2434
|
+
}), G = /* @__PURE__ */ new Map(), Qt = (t) => ({
|
|
2435
|
+
mark: Ke(`Probe(${t.description})`),
|
|
2427
2436
|
create: ({ callback: e = () => {
|
|
2428
2437
|
}, timeout: s = 10 } = {}) => {
|
|
2429
2438
|
const n = (l) => {
|
|
2430
|
-
clearTimeout(r),
|
|
2439
|
+
clearTimeout(r), G.delete(t), e(l);
|
|
2431
2440
|
};
|
|
2432
|
-
if (
|
|
2441
|
+
if (G.has(t))
|
|
2433
2442
|
throw new Error(`Probe already exists: ${t.description}`);
|
|
2434
2443
|
const r = setTimeout(() => n("timeout"), s), o = { counter: 0, timeoutId: r };
|
|
2435
|
-
return
|
|
2444
|
+
return G.set(t, o), {
|
|
2436
2445
|
value: () => {
|
|
2437
2446
|
clearTimeout(r);
|
|
2438
|
-
const l =
|
|
2447
|
+
const l = G.get(t);
|
|
2439
2448
|
l != null && --l.counter === 0 && n("resolved");
|
|
2440
2449
|
},
|
|
2441
2450
|
dispose: () => n("disposed"),
|
|
2442
2451
|
onUse: () => o.counter++
|
|
2443
2452
|
};
|
|
2444
2453
|
}
|
|
2445
|
-
}),
|
|
2454
|
+
}), Xs = Qt(Symbol("GlobalProbe")), Je = (t) => g((e) => {
|
|
2455
|
+
if (e.isBrowser()) {
|
|
2456
|
+
const s = t(e);
|
|
2457
|
+
if (s != null)
|
|
2458
|
+
return d(s).render(e);
|
|
2459
|
+
}
|
|
2460
|
+
return () => {
|
|
2461
|
+
};
|
|
2462
|
+
});
|
|
2463
|
+
function Qs({
|
|
2464
|
+
mode: t,
|
|
2465
|
+
delegatesFocus: e,
|
|
2466
|
+
slotAssignment: s,
|
|
2467
|
+
clonable: n,
|
|
2468
|
+
serializable: r
|
|
2469
|
+
}, ...o) {
|
|
2470
|
+
return Je((i) => {
|
|
2471
|
+
const l = { mode: t };
|
|
2472
|
+
e !== void 0 && (l.delegatesFocus = e), s !== void 0 && (l.slotAssignment = s), n !== void 0 && (l.clonable = n), r !== void 0 && (l.serializable = r);
|
|
2473
|
+
const c = i.element.attachShadow(l), a = i.withElement(c), u = ne(E(...o), a);
|
|
2474
|
+
return Ge(() => u(!0));
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
const Zt = (t, e) => g((s) => {
|
|
2446
2478
|
const n = s.getStyle(t);
|
|
2447
2479
|
return s.setStyle(t, e), (r) => {
|
|
2448
2480
|
r && s.setStyle(t, n);
|
|
2449
2481
|
};
|
|
2450
|
-
},
|
|
2482
|
+
}), es = (t, e) => g((s) => {
|
|
2451
2483
|
const n = s.getStyle(t), r = e.on((o) => s.setStyle(t, o));
|
|
2452
2484
|
return (o) => {
|
|
2453
2485
|
r(), o && s.setStyle(t, n);
|
|
2454
2486
|
};
|
|
2455
|
-
},
|
|
2487
|
+
}), we = (t, e) => m.is(e) ? es(t, e) : Zt(t, e), Zs = new Proxy({}, {
|
|
2456
2488
|
/**
|
|
2457
2489
|
* Creates a renderable component for the specified `style` property.
|
|
2458
2490
|
*
|
|
@@ -2461,33 +2493,28 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2461
2493
|
* @returns The renderable component for the specified attribute.
|
|
2462
2494
|
*
|
|
2463
2495
|
*/
|
|
2464
|
-
get: (t, e) => e === "variable" ? (s, n) =>
|
|
2465
|
-
}),
|
|
2466
|
-
if (e.isBrowser()) {
|
|
2467
|
-
const s = t(e);
|
|
2468
|
-
if (s != null)
|
|
2469
|
-
return f(s)(e);
|
|
2470
|
-
}
|
|
2471
|
-
return () => {
|
|
2472
|
-
};
|
|
2473
|
-
}, Xs = (t) => (e) => {
|
|
2496
|
+
get: (t, e) => e === "variable" ? (s, n) => we(s, n) : (s) => we(e, s)
|
|
2497
|
+
}), en = (t) => g((e) => {
|
|
2474
2498
|
const s = t(e);
|
|
2475
2499
|
return s == null ? () => {
|
|
2476
|
-
} :
|
|
2477
|
-
},
|
|
2500
|
+
} : d(s).render(e);
|
|
2501
|
+
}), tn = (t) => Je((e) => t(e.element)), sn = (t) => g((e) => {
|
|
2478
2502
|
if (e.isHeadlessDOM()) {
|
|
2479
2503
|
const s = t(e);
|
|
2480
2504
|
if (s)
|
|
2481
|
-
return
|
|
2505
|
+
return d(s).render(e);
|
|
2482
2506
|
}
|
|
2483
2507
|
return () => {
|
|
2484
2508
|
};
|
|
2485
|
-
},
|
|
2486
|
-
const s = new
|
|
2509
|
+
}), nn = (t) => g((e) => {
|
|
2510
|
+
const s = new q(), n = O(
|
|
2511
|
+
s,
|
|
2512
|
+
() => d(t(s)).render(e)
|
|
2513
|
+
);
|
|
2487
2514
|
return (r) => {
|
|
2488
2515
|
s.dispose(), n(r);
|
|
2489
2516
|
};
|
|
2490
|
-
},
|
|
2517
|
+
}), ge = (t) => g((e) => {
|
|
2491
2518
|
let s = e;
|
|
2492
2519
|
function n() {
|
|
2493
2520
|
return s;
|
|
@@ -2501,151 +2528,153 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
2501
2528
|
return a?.(), c;
|
|
2502
2529
|
},
|
|
2503
2530
|
set: ({ mark: l, create: c }, a) => {
|
|
2504
|
-
const { value: u, dispose: h, onUse:
|
|
2505
|
-
o.push(h), r(n().setProvider(l, u,
|
|
2531
|
+
const { value: u, dispose: h, onUse: f } = c(a, n());
|
|
2532
|
+
o.push(h), r(n().setProvider(l, u, f));
|
|
2506
2533
|
}
|
|
2507
2534
|
});
|
|
2508
2535
|
return i == null ? () => {
|
|
2509
2536
|
} : E(
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
)(n());
|
|
2513
|
-
},
|
|
2537
|
+
d(i),
|
|
2538
|
+
Ge(() => o.forEach((l) => l()))
|
|
2539
|
+
).render(n());
|
|
2540
|
+
}), rn = (t, e, s) => ge(({ set: n }) => (n(t, e), s())), on = (t, e) => ge(({ use: s }) => e(s(t))), ln = (...t) => (e) => ge(({ use: s }) => {
|
|
2514
2541
|
const n = t.map(s);
|
|
2515
2542
|
return e(...n);
|
|
2516
2543
|
});
|
|
2517
2544
|
export {
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2545
|
+
qt as Aria,
|
|
2546
|
+
Ls as Async,
|
|
2547
|
+
jt as Attr,
|
|
2548
|
+
Rs as BindChecked,
|
|
2549
|
+
Is as BindDate,
|
|
2550
|
+
Hs as BindDateTime,
|
|
2551
|
+
Ns as BindNumber,
|
|
2552
|
+
$s as BindText,
|
|
2553
|
+
R as BrowserContext,
|
|
2554
|
+
K as CLASS_PLACEHOLDER_ATTR,
|
|
2555
|
+
$ as Computed,
|
|
2556
|
+
Bs as Conjunction,
|
|
2557
|
+
Fs as DOMNode,
|
|
2558
|
+
Vt as DataAttr,
|
|
2559
|
+
q as DisposalScope,
|
|
2560
|
+
Re as El,
|
|
2561
|
+
re as ElNS,
|
|
2562
|
+
he as ElementPosition,
|
|
2563
|
+
D as Empty,
|
|
2564
|
+
Ws as Ensure,
|
|
2565
|
+
Us as EnsureAll,
|
|
2566
|
+
Js as ForEach,
|
|
2540
2567
|
E as Fragment,
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2568
|
+
Xs as GlobalProbe,
|
|
2569
|
+
ms as HeadlessAdapter,
|
|
2570
|
+
j as HeadlessContext,
|
|
2571
|
+
Lt as HeadlessElement,
|
|
2572
|
+
He as HeadlessPortal,
|
|
2573
|
+
Ot as HeadlessText,
|
|
2574
|
+
Ks as MapSignal,
|
|
2575
|
+
Ft as MathAttr,
|
|
2576
|
+
Ps as MathEl,
|
|
2577
|
+
Se as MemoryStore,
|
|
2578
|
+
zs as NotEmpty,
|
|
2579
|
+
Wt as OnChecked,
|
|
2580
|
+
Ge as OnDispose,
|
|
2581
|
+
ie as OneOf,
|
|
2582
|
+
Fe as OneOfField,
|
|
2583
|
+
js as OneOfKind,
|
|
2584
|
+
Vs as OneOfTuple,
|
|
2585
|
+
qs as OneOfType,
|
|
2586
|
+
Xt as OneOfValue,
|
|
2587
|
+
Ys as Portal,
|
|
2588
|
+
ee as Prop,
|
|
2589
|
+
rn as Provide,
|
|
2590
|
+
Le as ProviderNotFoundError,
|
|
2591
|
+
gt as RenderingError,
|
|
2592
|
+
Ue as Repeat,
|
|
2593
|
+
Bt as SVGAttr,
|
|
2594
|
+
Cs as SVGEl,
|
|
2595
|
+
Qs as ShadowRoot,
|
|
2596
|
+
m as Signal,
|
|
2597
|
+
qe as Task,
|
|
2598
|
+
vs as TextNode,
|
|
2599
|
+
Gs as Unless,
|
|
2600
|
+
on as Use,
|
|
2601
|
+
ln as UseMany,
|
|
2602
|
+
w as Value,
|
|
2603
|
+
We as When,
|
|
2604
|
+
Je as WithBrowserCtx,
|
|
2605
|
+
en as WithCtx,
|
|
2606
|
+
tn as WithElement,
|
|
2607
|
+
sn as WithHeadlessCtx,
|
|
2608
|
+
ge as WithProvider,
|
|
2609
|
+
nn as WithScope,
|
|
2610
|
+
Oe as _NODE_PLACEHOLDER_ATTR,
|
|
2611
|
+
ft as _getSelfOrParentElement,
|
|
2612
|
+
Pe as _isElement,
|
|
2613
|
+
xe as _isFragment,
|
|
2614
|
+
pt as _makeGetter,
|
|
2615
|
+
dt as _makeSetter,
|
|
2616
|
+
J as _removeDOMNode,
|
|
2617
|
+
$e as _signalText,
|
|
2618
|
+
Ne as _staticText,
|
|
2619
|
+
ls as animateSignal,
|
|
2620
|
+
ut as animateSignals,
|
|
2621
|
+
Ss as aria,
|
|
2593
2622
|
V as attr,
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
ts as
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2623
|
+
ds as bind,
|
|
2624
|
+
ps as coalesce,
|
|
2625
|
+
te as computed,
|
|
2626
|
+
Z as computedOf,
|
|
2627
|
+
ht as computedRecord,
|
|
2628
|
+
ze as createRenderable,
|
|
2629
|
+
bs as dataAttr,
|
|
2630
|
+
as as delaySignal,
|
|
2631
|
+
be as effect,
|
|
2632
|
+
Ze as effectOf,
|
|
2633
|
+
Ut as emit,
|
|
2634
|
+
Ms as emitChecked,
|
|
2635
|
+
k as emitTarget,
|
|
2636
|
+
Gt as emitValue,
|
|
2637
|
+
Kt as emitValueAsDate,
|
|
2638
|
+
zt as emitValueAsDateTime,
|
|
2639
|
+
Os as emitValueAsNullableDate,
|
|
2640
|
+
ks as emitValueAsNullableDateTime,
|
|
2641
|
+
Jt as emitValueAsNumber,
|
|
2642
|
+
it as endInterpolate,
|
|
2643
|
+
de as getCurrentScope,
|
|
2644
|
+
ns as getParentScope,
|
|
2645
|
+
ss as getScopeStack,
|
|
2646
|
+
ws as getWindow,
|
|
2647
|
+
lt as guessInterpolate,
|
|
2648
|
+
Ts as html,
|
|
2649
|
+
Es as input,
|
|
2650
|
+
ot as interpolateDate,
|
|
2651
|
+
nt as interpolateNumber,
|
|
2652
|
+
rt as interpolateString,
|
|
2653
|
+
ts as joinSignals,
|
|
2654
|
+
os as localStorageProp,
|
|
2655
|
+
Qt as makeProbe,
|
|
2656
|
+
Ke as makeProviderMark,
|
|
2657
|
+
xs as math,
|
|
2658
|
+
As as mathAttr,
|
|
2659
|
+
cs as merge,
|
|
2660
|
+
oe as on,
|
|
2661
|
+
tt as popScope,
|
|
2662
|
+
us as previousSignal,
|
|
2663
|
+
T as prop,
|
|
2664
|
+
et as pushScope,
|
|
2665
|
+
fs as render,
|
|
2666
|
+
ne as renderWithContext,
|
|
2667
|
+
d as renderableOfTNode,
|
|
2668
|
+
ys as restoreTempoPlaceholders,
|
|
2669
|
+
gs as runHeadless,
|
|
2670
|
+
rs as scoped,
|
|
2671
|
+
is as sessionStorageProp,
|
|
2672
|
+
se as signal,
|
|
2673
|
+
hs as slidingWindowSignal,
|
|
2645
2674
|
_e as storedProp,
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2675
|
+
Zs as style,
|
|
2676
|
+
Ds as svg,
|
|
2677
|
+
_s as svgAttr,
|
|
2678
|
+
ce as untracked,
|
|
2679
|
+
O as withScope
|
|
2651
2680
|
};
|