@tempots/dom 36.0.0 → 37.0.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/README.md +47 -0
- package/dom/browser-context.d.ts +44 -31
- package/dom/dom-context.d.ts +37 -3
- package/dom/headless-context.d.ts +68 -62
- package/index.cjs +1 -1
- package/index.d.ts +5 -2
- package/index.js +1185 -2372
- package/package.json +4 -3
- package/renderable/attribute.d.ts +27 -1
- package/renderable/delegate.d.ts +169 -0
- package/renderable/keyed-foreach.d.ts +1 -0
- package/renderable/map-text.d.ts +1 -0
- package/renderable/shared.d.ts +2 -2
- package/renderable/text.d.ts +4 -4
- package/template/builder.d.ts +11 -0
- package/template/engine.d.ts +12 -0
- package/template/hydrator.d.ts +21 -0
- package/template/types.d.ts +85 -0
- package/types/domain.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,1306 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
function Ie(s) {
|
|
9
|
-
return s != null && s !== !1 && s !== 0 && s !== "";
|
|
10
|
-
}
|
|
11
|
-
function rt(s) {
|
|
12
|
-
return !Ie(s);
|
|
13
|
-
}
|
|
14
|
-
function it(s) {
|
|
15
|
-
return s == null;
|
|
16
|
-
}
|
|
17
|
-
function ot(s) {
|
|
18
|
-
return s != null;
|
|
19
|
-
}
|
|
20
|
-
const C = {
|
|
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: (s, e) => _.is(s) ? s.map(e) : e(s),
|
|
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: (s, e) => _.is(s) ? s.derive() : ye(s, 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: (s, e) => {
|
|
51
|
-
if (s != null)
|
|
52
|
-
return C.toSignal(s, 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: (s) => _.is(s) ? s.get() : s,
|
|
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: (s, e) => _.is(s) ? s.on(e) : (e(s), () => {
|
|
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: (s) => {
|
|
75
|
-
_.is(s) && s.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: (s) => () => C.dispose(s),
|
|
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: (s, {
|
|
96
|
-
autoDisposeProp: e = !0,
|
|
97
|
-
equals: t
|
|
98
|
-
} = {}) => _.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : B(s, t),
|
|
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: (s) => C.map(s, Ie),
|
|
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: (s) => C.map(s, rt),
|
|
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: (s) => C.map(s, it),
|
|
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: (s) => C.map(s, ot)
|
|
123
|
-
}, ne = (...s) => (e, t) => {
|
|
124
|
-
if (s.length === 1)
|
|
125
|
-
return C.toSignal(s[0]).map(e);
|
|
126
|
-
const n = s.filter((r) => _.is(r));
|
|
127
|
-
return be(
|
|
128
|
-
() => e(...s.map((r) => C.get(r))),
|
|
129
|
-
n,
|
|
130
|
-
t
|
|
131
|
-
);
|
|
132
|
-
}, ls = (...s) => (e, t, n, r = (i, o) => i === o) => ne(...s)((...i) => i).mapAsync(
|
|
133
|
-
([...i], o) => e(
|
|
134
|
-
...i,
|
|
135
|
-
o
|
|
136
|
-
),
|
|
137
|
-
t,
|
|
138
|
-
n,
|
|
139
|
-
r
|
|
140
|
-
), as = (...s) => (e, t, n, r = (i, o) => i === o) => ne(...s)((...i) => i).mapAsyncGenerator(
|
|
141
|
-
([...i], o) => e(
|
|
142
|
-
...i,
|
|
143
|
-
o
|
|
144
|
-
),
|
|
145
|
-
t,
|
|
146
|
-
n,
|
|
147
|
-
r
|
|
148
|
-
), cs = (s) => {
|
|
149
|
-
const e = Object.keys(s);
|
|
150
|
-
return ne(...Object.values(s))(
|
|
151
|
-
(...t) => Object.fromEntries(e.map((n, r) => [n, t[r]]))
|
|
152
|
-
);
|
|
153
|
-
}, lt = (...s) => (e, t = {}) => {
|
|
154
|
-
const n = s.filter((r) => _.is(r));
|
|
155
|
-
return $e(
|
|
156
|
-
() => e(...s.map(C.get)),
|
|
157
|
-
n,
|
|
158
|
-
t
|
|
159
|
-
);
|
|
160
|
-
};
|
|
161
|
-
class ie {
|
|
162
|
-
_signals = /* @__PURE__ */ new Set();
|
|
163
|
-
_callbacks = [];
|
|
164
|
-
_disposed = !1;
|
|
165
|
-
/**
|
|
166
|
-
* Register a signal with this scope for automatic disposal.
|
|
167
|
-
*
|
|
168
|
-
* @param signal - The signal to track
|
|
169
|
-
* @throws Error if the scope has already been disposed
|
|
170
|
-
* @throws Error if the signal has already been disposed
|
|
171
|
-
* @public
|
|
172
|
-
*/
|
|
173
|
-
track(e) {
|
|
174
|
-
if (this._disposed)
|
|
175
|
-
throw new Error("Cannot track signal in disposed scope");
|
|
176
|
-
if (e.isDisposed())
|
|
177
|
-
throw new Error("Cannot track already disposed signal");
|
|
178
|
-
this._signals.add(e);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Register a disposal callback to be called when this scope is disposed.
|
|
182
|
-
* Callbacks are called before signals are disposed.
|
|
183
|
-
* Use this for cleanup that doesn't need the `removeTree` parameter.
|
|
184
|
-
*
|
|
185
|
-
* @param callback - The callback to call on disposal
|
|
186
|
-
* @throws Error if the scope has already been disposed
|
|
187
|
-
* @public
|
|
188
|
-
*/
|
|
189
|
-
onDispose(e) {
|
|
190
|
-
if (this._disposed)
|
|
191
|
-
throw new Error("Cannot register callback in disposed scope");
|
|
192
|
-
this._callbacks.push(e);
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Dispose all signals tracked by this scope.
|
|
196
|
-
* This method is idempotent - calling it multiple times is safe.
|
|
197
|
-
*
|
|
198
|
-
* @public
|
|
199
|
-
*/
|
|
200
|
-
dispose() {
|
|
201
|
-
if (!this._disposed) {
|
|
202
|
-
this._disposed = !0;
|
|
203
|
-
for (const e of this._callbacks)
|
|
204
|
-
try {
|
|
205
|
-
e();
|
|
206
|
-
} catch (t) {
|
|
207
|
-
const n = t instanceof Error ? t.message : String(t);
|
|
208
|
-
console.error("Error in disposal callback:", n);
|
|
209
|
-
}
|
|
210
|
-
this._callbacks.length = 0;
|
|
211
|
-
for (const e of this._signals)
|
|
212
|
-
e.dispose();
|
|
213
|
-
this._signals.clear();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Check if this scope has been disposed.
|
|
218
|
-
*
|
|
219
|
-
* @returns true if the scope has been disposed
|
|
220
|
-
* @public
|
|
221
|
-
*/
|
|
222
|
-
get disposed() {
|
|
223
|
-
return this._disposed;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Creates a prop signal and tracks it in this scope.
|
|
227
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
228
|
-
*
|
|
229
|
-
* @param value - The initial value
|
|
230
|
-
* @param equals - Optional equality function
|
|
231
|
-
* @returns A tracked Prop signal
|
|
232
|
-
* @public
|
|
233
|
-
*/
|
|
234
|
-
prop(e, t) {
|
|
235
|
-
const n = Ae(() => B(e, t));
|
|
236
|
-
return this.track(n), n;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Creates a computed signal and tracks it in this scope.
|
|
240
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
241
|
-
*
|
|
242
|
-
* @param fn - The computation function
|
|
243
|
-
* @param dependencies - Array of signals this computed depends on
|
|
244
|
-
* @param equals - Optional equality function
|
|
245
|
-
* @returns A tracked Computed signal
|
|
246
|
-
* @public
|
|
247
|
-
*/
|
|
248
|
-
computed(e, t, n) {
|
|
249
|
-
const r = Ae(() => be(e, t, n));
|
|
250
|
-
return this.track(r), r;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Creates an effect and tracks it in this scope.
|
|
254
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
255
|
-
*
|
|
256
|
-
* @param fn - The effect function
|
|
257
|
-
* @param signals - Array of signals to listen to
|
|
258
|
-
* @param options - Optional listener options
|
|
259
|
-
* @returns A clear function (the effect itself is tracked in the scope)
|
|
260
|
-
* @public
|
|
261
|
-
*/
|
|
262
|
-
effect(e, t, n) {
|
|
263
|
-
return z(this, () => $e(e, t, n));
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Creates a computed signal with curried signature and tracks it in this scope.
|
|
267
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
268
|
-
*
|
|
269
|
-
* @param args - Values or signals to compute from
|
|
270
|
-
* @returns A function that takes the computation function and returns a tracked Computed signal
|
|
271
|
-
* @public
|
|
272
|
-
*/
|
|
273
|
-
computedOf(...e) {
|
|
274
|
-
return (t, n) => {
|
|
275
|
-
const r = Ae(() => ne(...e)(t, n));
|
|
276
|
-
return this.track(r), r;
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Creates an effect with curried signature and tracks it in this scope.
|
|
281
|
-
* Use this method in async contexts where automatic tracking doesn't work.
|
|
282
|
-
*
|
|
283
|
-
* @param args - Values or signals to listen to
|
|
284
|
-
* @returns A function that takes the effect function and returns a clear function
|
|
285
|
-
* @public
|
|
286
|
-
*/
|
|
287
|
-
effectOf(...e) {
|
|
288
|
-
return (t, n) => z(this, () => lt(...e)(t, n));
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
const j = [], at = (s) => {
|
|
292
|
-
j.push(s);
|
|
293
|
-
}, ct = () => {
|
|
294
|
-
if (j.length === 0)
|
|
295
|
-
throw new Error("Cannot pop from empty scope stack");
|
|
296
|
-
j.pop();
|
|
297
|
-
}, Oe = () => j[j.length - 1] ?? null, us = () => j, hs = () => j[j.length - 2] ?? null, z = (s, e) => {
|
|
298
|
-
at(s);
|
|
299
|
-
try {
|
|
300
|
-
return e();
|
|
301
|
-
} finally {
|
|
302
|
-
ct();
|
|
303
|
-
}
|
|
304
|
-
}, ds = (s) => {
|
|
305
|
-
const e = new ie();
|
|
306
|
-
try {
|
|
307
|
-
return z(e, () => s(e));
|
|
308
|
-
} finally {
|
|
309
|
-
e.dispose();
|
|
310
|
-
}
|
|
311
|
-
}, Ae = (s) => {
|
|
312
|
-
const e = j.slice();
|
|
313
|
-
j.length = 0;
|
|
314
|
-
try {
|
|
315
|
-
return s();
|
|
316
|
-
} finally {
|
|
317
|
-
j.length = 0, j.push(...e);
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
class _ {
|
|
321
|
-
/**
|
|
322
|
-
* Represents a signal with a value of type T.
|
|
323
|
-
*
|
|
324
|
-
* @param value - The initial value of the signal.
|
|
325
|
-
* @param equals - A function that determines whether two values of type T are equal.
|
|
326
|
-
* @public
|
|
327
|
-
*/
|
|
328
|
-
constructor(e, t) {
|
|
329
|
-
this.equals = t, this._value = e;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Creates a Signal that holds the result of a Promise, with proper error handling.
|
|
333
|
-
*
|
|
334
|
-
* This static method creates a signal that starts with an initial value and updates
|
|
335
|
-
* when the promise resolves. If the promise rejects, an optional recovery function
|
|
336
|
-
* can provide a fallback value.
|
|
337
|
-
*
|
|
338
|
-
* @example
|
|
339
|
-
* ```typescript
|
|
340
|
-
* // Basic usage with API call
|
|
341
|
-
* const userData = Signal.ofPromise(
|
|
342
|
-
* fetch('/api/user').then(r => r.json()),
|
|
343
|
-
* { loading: true }, // initial state
|
|
344
|
-
* error => ({ error: error.message, loading: false }) // error recovery
|
|
345
|
-
* )
|
|
346
|
-
*
|
|
347
|
-
* // Use in UI
|
|
348
|
-
* Ensure(userData,
|
|
349
|
-
* (user) => html.div('Welcome, ', user.map(u => u.name)),
|
|
350
|
-
* () => html.div('Loading...')
|
|
351
|
-
* )
|
|
352
|
-
* ```
|
|
353
|
-
*
|
|
354
|
-
* @example
|
|
355
|
-
* ```typescript
|
|
356
|
-
* // With custom equality function
|
|
357
|
-
* const config = Signal.ofPromise(
|
|
358
|
-
* loadConfig(),
|
|
359
|
-
* {},
|
|
360
|
-
* () => ({}),
|
|
361
|
-
* (a, b) => JSON.stringify(a) === JSON.stringify(b) // deep equality
|
|
362
|
-
* )
|
|
363
|
-
* ```
|
|
364
|
-
*
|
|
365
|
-
* @typeParam O - The type of the value returned by the Promise
|
|
366
|
-
* @param promise - The Promise to use to feed the Signal
|
|
367
|
-
* @param init - The initial value of the Signal before the Promise resolves
|
|
368
|
-
* @param recover - Optional function to recover from Promise rejection and provide an alternative value
|
|
369
|
-
* @param equals - Function to compare two values for equality (defaults to strict equality)
|
|
370
|
-
* @returns A Signal that represents the result of the Promise
|
|
371
|
-
*/
|
|
372
|
-
static ofPromise = (e, t, n, r = (i, o) => i === o) => {
|
|
373
|
-
const i = new _(t, r);
|
|
374
|
-
return e.then((o) => i._setAndNotify(o)).catch((o) => {
|
|
375
|
-
n != null ? i._setAndNotify(n(o)) : console.error(
|
|
376
|
-
"Unhandled promise rejection in Signal.ofPromise:",
|
|
377
|
-
o
|
|
378
|
-
);
|
|
379
|
-
}), i;
|
|
380
|
-
};
|
|
381
|
-
/**
|
|
382
|
-
* Checks if a value is a Signal.
|
|
383
|
-
*
|
|
384
|
-
* @param value - The value to check.
|
|
385
|
-
* @returns `true` if the value is a Signal, `false` otherwise.
|
|
386
|
-
*/
|
|
387
|
-
static is = (e) => (
|
|
388
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
389
|
-
e != null && e.$__signal__ === !0
|
|
390
|
-
);
|
|
391
|
-
/**
|
|
392
|
-
* @internal
|
|
393
|
-
*/
|
|
394
|
-
$__signal__ = !0;
|
|
395
|
-
/**
|
|
396
|
-
* @internal
|
|
397
|
-
*/
|
|
398
|
-
_value;
|
|
399
|
-
/**
|
|
400
|
-
* @internal
|
|
401
|
-
*/
|
|
402
|
-
_derivatives = [];
|
|
403
|
-
/**
|
|
404
|
-
* @internal
|
|
405
|
-
*/
|
|
406
|
-
_onValueListeners = [];
|
|
407
|
-
/**
|
|
408
|
-
* @internal
|
|
409
|
-
*/
|
|
410
|
-
_onDisposeListeners = [];
|
|
411
|
-
/**
|
|
412
|
-
* Gets the current value of the signal.
|
|
413
|
-
* @returns The current value of the signal.
|
|
414
|
-
*/
|
|
415
|
-
get = () => this._value;
|
|
416
|
-
/**
|
|
417
|
-
* Gets the value of the signal.
|
|
418
|
-
* @returns The current value of the signal.
|
|
419
|
-
*/
|
|
420
|
-
get value() {
|
|
421
|
-
return this._value;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Checks if the signal has any registered listeners.
|
|
425
|
-
* @returns `true` if the signal has listeners, `false` otherwise.
|
|
426
|
-
*/
|
|
427
|
-
hasListeners = () => this._onValueListeners.length > 0;
|
|
428
|
-
/**
|
|
429
|
-
* Registers a listener function to be called whenever the value of the signal changes.
|
|
430
|
-
* The listener function will be immediately called with the current value of the signal.
|
|
431
|
-
* Returns a function that can be called to unregister the listener.
|
|
432
|
-
*
|
|
433
|
-
* When called within a DisposalScope (e.g., inside a renderable), the listener is
|
|
434
|
-
* automatically cleaned up when the scope is disposed. This prevents memory leaks
|
|
435
|
-
* when listening to outer-scope signals from inner scopes.
|
|
436
|
-
*
|
|
437
|
-
* @param listener - The listener function to be called when the value of the signal changes.
|
|
438
|
-
* @param options - Options for the listener.
|
|
439
|
-
*
|
|
440
|
-
* @example
|
|
441
|
-
* ```typescript
|
|
442
|
-
* // Automatic cleanup when scope disposes
|
|
443
|
-
* const MyComponent = () => {
|
|
444
|
-
* const outerSignal = prop(0)
|
|
445
|
-
*
|
|
446
|
-
* return html.div(
|
|
447
|
-
* When(someCondition, () => {
|
|
448
|
-
* // This listener is automatically cleaned up when the When() disposes
|
|
449
|
-
* outerSignal.on(value => console.log(value))
|
|
450
|
-
* return html.span('Inner content')
|
|
451
|
-
* })
|
|
452
|
-
* )
|
|
453
|
-
* }
|
|
454
|
-
* ```
|
|
455
|
-
*/
|
|
456
|
-
on = (e, t = {}) => {
|
|
457
|
-
t.skipInitial || e(this.get(), void 0);
|
|
458
|
-
const n = t.once ? (i, o) => {
|
|
459
|
-
r(), e(i, o);
|
|
460
|
-
} : e;
|
|
461
|
-
this._onValueListeners.push(n);
|
|
462
|
-
const r = () => {
|
|
463
|
-
const i = this._onValueListeners.indexOf(n);
|
|
464
|
-
i !== -1 && this._onValueListeners.splice(i, 1), t.abortSignal != null && t.abortSignal.removeEventListener("abort", r);
|
|
465
|
-
};
|
|
466
|
-
return t.abortSignal != null && t.abortSignal.addEventListener("abort", r), !t.noAutoDispose && Oe()?.onDispose(r), r;
|
|
467
|
-
};
|
|
468
|
-
/**
|
|
469
|
-
* Registers a listener function to be called whenever the value of the signal changes.
|
|
470
|
-
* The listener function will not be called with the current value of the signal.
|
|
471
|
-
* Returns a function that can be called to unregister the listener.
|
|
472
|
-
*
|
|
473
|
-
* @param listener - The listener function to be called when the value of the signal changes.
|
|
474
|
-
* @param options - Options for the listener.
|
|
475
|
-
*/
|
|
476
|
-
onChange = (e, t = {}) => {
|
|
477
|
-
let n = 0;
|
|
478
|
-
const r = (i, o) => {
|
|
479
|
-
n++ > 0 && e(i, o);
|
|
480
|
-
};
|
|
481
|
-
return this.on(r, t);
|
|
482
|
-
};
|
|
483
|
-
/**
|
|
484
|
-
* @internal
|
|
485
|
-
*/
|
|
486
|
-
_setAndNotify = (e) => {
|
|
487
|
-
if (this._disposed) return;
|
|
488
|
-
const t = this._value;
|
|
489
|
-
this.equals(t, e) || (this._value = e, this._onValueListeners.forEach((n) => n(e, t)));
|
|
490
|
-
};
|
|
491
|
-
/**
|
|
492
|
-
* @internal
|
|
493
|
-
*/
|
|
494
|
-
_disposed = !1;
|
|
495
|
-
/**
|
|
496
|
-
* Checks whether the signal is disposed.
|
|
497
|
-
* @returns True if the signal is disposed, false otherwise.
|
|
498
|
-
*/
|
|
499
|
-
isDisposed = () => this._disposed;
|
|
500
|
-
/**
|
|
501
|
-
* Adds a listener function to be called when the object is disposed.
|
|
502
|
-
* @param listener - The listener function to be called when the object is disposed.
|
|
503
|
-
* @returns A function that can be called to remove the listener.
|
|
504
|
-
*/
|
|
505
|
-
onDispose = (e) => {
|
|
506
|
-
this._onDisposeListeners.push(e);
|
|
507
|
-
};
|
|
508
|
-
/**
|
|
509
|
-
* Disposes the signal, releasing any resources associated with it.
|
|
510
|
-
* This clears all listeners, derivatives, and disposal callbacks.
|
|
511
|
-
*/
|
|
512
|
-
dispose = () => {
|
|
513
|
-
this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0, this._onValueListeners.length = 0);
|
|
514
|
-
};
|
|
515
|
-
/**
|
|
516
|
-
* Creates a new computed signal by applying a transformation function to this signal's value.
|
|
517
|
-
*
|
|
518
|
-
* The `map` method is one of the most commonly used signal operations. It creates a new
|
|
519
|
-
* computed signal that automatically updates whenever the source signal changes. The
|
|
520
|
-
* transformation function is called with the current value and should return the new value.
|
|
521
|
-
*
|
|
522
|
-
* @example
|
|
523
|
-
* ```typescript
|
|
524
|
-
* const count = prop(5)
|
|
525
|
-
*
|
|
526
|
-
* // Transform to different types
|
|
527
|
-
* const doubled = count.map(n => n * 2)
|
|
528
|
-
* const message = count.map(n => `Count is ${n}`)
|
|
529
|
-
* const isEven = count.map(n => n % 2 === 0)
|
|
530
|
-
*
|
|
531
|
-
* // Use in UI
|
|
532
|
-
* html.div(
|
|
533
|
-
* html.div('Original: ', count.map(String)),
|
|
534
|
-
* html.div('Doubled: ', doubled.map(String)),
|
|
535
|
-
* html.div('Message: ', message),
|
|
536
|
-
* html.div('Is even: ', isEven.map(String))
|
|
537
|
-
* )
|
|
538
|
-
* ```
|
|
539
|
-
*
|
|
540
|
-
* @example
|
|
541
|
-
* ```typescript
|
|
542
|
-
* // Chain multiple transformations
|
|
543
|
-
* const user = prop({ name: 'John', age: 30 })
|
|
544
|
-
* const greeting = user
|
|
545
|
-
* .map(u => u.name)
|
|
546
|
-
* .map(name => name.toUpperCase())
|
|
547
|
-
* .map(name => `Hello, ${name}!`)
|
|
548
|
-
* ```
|
|
549
|
-
*
|
|
550
|
-
* @example
|
|
551
|
-
* ```typescript
|
|
552
|
-
* // With custom equality function for objects
|
|
553
|
-
* const items = prop([{ id: 1, name: 'Item 1' }])
|
|
554
|
-
* const itemNames = items.map(
|
|
555
|
-
* items => items.map(item => item.name),
|
|
556
|
-
* (a, b) => JSON.stringify(a) === JSON.stringify(b) // deep equality
|
|
557
|
-
* )
|
|
558
|
-
* ```
|
|
559
|
-
*
|
|
560
|
-
* **Auto-Disposal:** The returned computed signal is automatically registered with the current
|
|
561
|
-
* disposal scope (if one exists). When used within a renderable or `WithScope()`, the signal
|
|
562
|
-
* will be automatically disposed when the component unmounts. No manual `OnDispose()` needed!
|
|
563
|
-
*
|
|
564
|
-
* ```typescript
|
|
565
|
-
* const MyComponent: Renderable = (ctx) => {
|
|
566
|
-
* const count = prop(0);
|
|
567
|
-
* const doubled = count.map(x => x * 2); // ✅ Auto-disposed
|
|
568
|
-
* return html.div(doubled);
|
|
569
|
-
* };
|
|
570
|
-
* ```
|
|
571
|
-
*
|
|
572
|
-
* @typeParam O - The type of the transformed value
|
|
573
|
-
* @param fn - Function that transforms the signal's value to a new value
|
|
574
|
-
* @param equals - Optional function to determine if two transformed values are equal (defaults to strict equality)
|
|
575
|
-
* @returns A new computed signal with the transformed value (auto-registered with current scope)
|
|
576
|
-
*/
|
|
577
|
-
map = (e, t = (n, r) => n === r) => {
|
|
578
|
-
const n = new ee(() => {
|
|
579
|
-
try {
|
|
580
|
-
return e(this.get());
|
|
581
|
-
} catch (r) {
|
|
582
|
-
throw console.error("Error in Signal.map:", r), r;
|
|
583
|
-
}
|
|
584
|
-
}, t);
|
|
585
|
-
return this.setDerivative(n), n;
|
|
586
|
-
};
|
|
587
|
-
/**
|
|
588
|
-
* Returns a new Signal that applies the given function to the value of the current Signal,
|
|
589
|
-
* and then flattens the resulting Signal.
|
|
590
|
-
*
|
|
591
|
-
* @typeParam O - The type of the value emitted by the resulting Signal.
|
|
592
|
-
* @param fn - The function to apply to the value of the current Signal.
|
|
593
|
-
* @param equals - A function that determines whether two values of type O are equal.
|
|
594
|
-
* Defaults to a strict equality check (===).
|
|
595
|
-
* @returns A new Signal that emits the values of the resulting Signal.
|
|
596
|
-
*/
|
|
597
|
-
flatMap = (e, t = (n, r) => n === r) => {
|
|
598
|
-
const n = new ee(() => {
|
|
599
|
-
try {
|
|
600
|
-
return e(this.get()).get();
|
|
601
|
-
} catch (r) {
|
|
602
|
-
throw console.error("Error in Signal.flatMap:", r), r;
|
|
603
|
-
}
|
|
604
|
-
}, t);
|
|
605
|
-
return this.setDerivative(n), n;
|
|
606
|
-
};
|
|
607
|
-
/**
|
|
608
|
-
* Invokes a callback function with the current value of the signal, without modifying the signal.
|
|
609
|
-
*
|
|
610
|
-
* @param fn - The callback function to be invoked with the current value of the signal.
|
|
611
|
-
* @returns A new signal that emits the same value as the original signal and invokes the callback function.
|
|
612
|
-
*/
|
|
613
|
-
tap = (e) => this.map((t) => (e(t), t));
|
|
614
|
-
/**
|
|
615
|
-
* Returns a new Signal that emits the value at the specified key of the current value.
|
|
616
|
-
*
|
|
617
|
-
* @param key - The key of the value to retrieve.
|
|
618
|
-
* @returns A new Signal that emits the value at the specified key.
|
|
619
|
-
*/
|
|
620
|
-
at = (e) => this.map((t) => t[e]);
|
|
621
|
-
/**
|
|
622
|
-
* @internal
|
|
623
|
-
*/
|
|
624
|
-
_$;
|
|
625
|
-
/**
|
|
626
|
-
* Represents a collection of signals mapping to each key/field in the wrapped value.
|
|
627
|
-
* @typeParam T - The type of the signals.
|
|
628
|
-
*/
|
|
629
|
-
get $() {
|
|
630
|
-
return this._$ !== void 0 ? this._$ : this._$ = new Proxy(this, {
|
|
631
|
-
get: (e, t) => this.at(t)
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
filter = (e, t) => {
|
|
635
|
-
let n = t ?? this.get();
|
|
636
|
-
const r = new ee(() => {
|
|
637
|
-
try {
|
|
638
|
-
const i = this.get();
|
|
639
|
-
return n = e(i) ? i : n;
|
|
640
|
-
} catch (i) {
|
|
641
|
-
throw console.error("Error in Signal.filter:", i), i;
|
|
642
|
-
}
|
|
643
|
-
}, this.equals);
|
|
644
|
-
return this.setDerivative(r), r;
|
|
645
|
-
};
|
|
646
|
-
/**
|
|
647
|
-
* Returns a new Computed object that applies the provided mapping function to the value of this Signal,
|
|
648
|
-
* and filters out values that are `undefined` or `null`.
|
|
649
|
-
*
|
|
650
|
-
* @typeParam O - The type of the mapped value.
|
|
651
|
-
* @param fn - The mapping function to apply to the value of this Signal.
|
|
652
|
-
* @param startValue - The initial value for the Computed object.
|
|
653
|
-
* @param equals - Optional equality function to determine if two values are equal.
|
|
654
|
-
* @returns - A new Computed object with the mapped and filtered values.
|
|
655
|
-
*/
|
|
656
|
-
filterMap = (e, t, n = (r, i) => r === i) => {
|
|
657
|
-
let r = t;
|
|
658
|
-
const i = new ee(() => {
|
|
659
|
-
try {
|
|
660
|
-
const o = this.get();
|
|
661
|
-
return r = e(o) ?? r;
|
|
662
|
-
} catch (o) {
|
|
663
|
-
throw console.error("Error in Signal.filterMap:", o), o;
|
|
664
|
-
}
|
|
665
|
-
}, n);
|
|
666
|
-
return this.setDerivative(i), i;
|
|
667
|
-
};
|
|
668
|
-
/**
|
|
669
|
-
* Maps the values emitted by the signal to a new value asynchronously using the provided function.
|
|
670
|
-
* If the function throws an error, it will be caught and logged.
|
|
671
|
-
* If a recovery function is provided, it will be called with the error and its return value will be used as the mapped value.
|
|
672
|
-
* If no recovery function is provided, the error will be logged as an unhandled promise rejection.
|
|
673
|
-
*
|
|
674
|
-
* @typeParam O - The type of the mapped value.
|
|
675
|
-
* @param fn - The function to map the values emitted by the signal. The second argument to this function allows to cancel the previously running mapping function if it has not completed by the time a new value is emitted.
|
|
676
|
-
* @param alt - The alternate value to use if the signal is disposed or the mapping function throws an error.
|
|
677
|
-
* @param recover - The recovery function to handle errors thrown by the mapping function.
|
|
678
|
-
* @param equals - The equality function to compare the mapped values for equality.
|
|
679
|
-
* @returns A property that holds the mapped value and can be observed for changes.
|
|
680
|
-
*/
|
|
681
|
-
mapAsync = (e, t, n, r = (i, o) => i === o) => {
|
|
682
|
-
const i = B(t, r);
|
|
683
|
-
let o = 0, l = new AbortController();
|
|
684
|
-
return i.onDispose(
|
|
685
|
-
this.on(async (f) => {
|
|
686
|
-
const d = ++o;
|
|
687
|
-
l.abort(), l = new AbortController();
|
|
688
|
-
try {
|
|
689
|
-
const v = await e(f, { abortSignal: l.signal });
|
|
690
|
-
d === o && i.set(v);
|
|
691
|
-
} catch (v) {
|
|
692
|
-
if (d === o)
|
|
693
|
-
if (n != null)
|
|
694
|
-
i.set(n(v));
|
|
695
|
-
else
|
|
696
|
-
throw v;
|
|
697
|
-
}
|
|
698
|
-
})
|
|
699
|
-
), i;
|
|
700
|
-
};
|
|
701
|
-
/**
|
|
702
|
-
* Maps the values emitted by the signal to multiple values over time using an async generator.
|
|
703
|
-
* Each time the source signal changes, a new async generator is created and iterated.
|
|
704
|
-
* Previous generators are aborted when a new value arrives.
|
|
705
|
-
*
|
|
706
|
-
* This is useful for streaming data, such as:
|
|
707
|
-
* - AI/LLM streaming responses
|
|
708
|
-
* - Server-Sent Events (SSE)
|
|
709
|
-
* - Paginated data loading
|
|
710
|
-
* - WebSocket message streams
|
|
711
|
-
*
|
|
712
|
-
* @example
|
|
713
|
-
* ```typescript
|
|
714
|
-
* const query = prop('hello')
|
|
715
|
-
*
|
|
716
|
-
* // Stream AI response tokens
|
|
717
|
-
* const streamingResponse = query.mapAsyncGenerator(
|
|
718
|
-
* async function* (q, { abortSignal }) {
|
|
719
|
-
* const response = await fetch('/api/stream?q=' + q, { signal: abortSignal })
|
|
720
|
-
* const reader = response.body!.getReader()
|
|
721
|
-
* let accumulated = ''
|
|
722
|
-
*
|
|
723
|
-
* while (true) {
|
|
724
|
-
* const { done, value } = await reader.read()
|
|
725
|
-
* if (done) break
|
|
726
|
-
* accumulated += new TextDecoder().decode(value)
|
|
727
|
-
* yield accumulated // Update signal with each chunk
|
|
728
|
-
* }
|
|
729
|
-
* },
|
|
730
|
-
* '', // alt: empty string while loading
|
|
731
|
-
* (err) => 'Error: ' + err // recover
|
|
732
|
-
* )
|
|
733
|
-
* ```
|
|
734
|
-
*
|
|
735
|
-
* @typeParam O - The type of the yielded values.
|
|
736
|
-
* @param fn - The async generator function that yields values over time. The second argument provides an AbortSignal to cancel the generator when a new value arrives.
|
|
737
|
-
* @param alt - The initial value to use before the first yield.
|
|
738
|
-
* @param recover - Optional function to handle errors thrown by the generator.
|
|
739
|
-
* @param equals - Optional equality function to compare yielded values.
|
|
740
|
-
* @returns A property that updates each time the generator yields a value.
|
|
741
|
-
*/
|
|
742
|
-
mapAsyncGenerator = (e, t, n, r = (i, o) => i === o) => {
|
|
743
|
-
const i = B(t, r);
|
|
744
|
-
let o = 0, l = new AbortController();
|
|
745
|
-
return i.onDispose(
|
|
746
|
-
this.on(async (f) => {
|
|
747
|
-
const d = ++o;
|
|
748
|
-
l.abort(), l = new AbortController();
|
|
749
|
-
try {
|
|
750
|
-
const v = e(f, { abortSignal: l.signal });
|
|
751
|
-
for await (const S of v) {
|
|
752
|
-
if (d !== o) return;
|
|
753
|
-
i.set(S);
|
|
754
|
-
}
|
|
755
|
-
} catch (v) {
|
|
756
|
-
if (d === o)
|
|
757
|
-
if (n != null)
|
|
758
|
-
i.set(n(v));
|
|
759
|
-
else
|
|
760
|
-
throw v;
|
|
761
|
-
}
|
|
762
|
-
})
|
|
763
|
-
), i;
|
|
764
|
-
};
|
|
765
|
-
/**
|
|
766
|
-
* Maps the values of the signal using the provided function `fn`, and returns a new signal
|
|
767
|
-
* containing the mapped values. If the mapped value is `undefined` or `null`, it is replaced
|
|
768
|
-
* with the provided `alt` value.
|
|
769
|
-
*
|
|
770
|
-
* @typeParam O - The type of the mapped value.
|
|
771
|
-
* @param fn - The function used to map the values of the signal.
|
|
772
|
-
* @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
|
|
773
|
-
* @returns A new signal containing the mapped values.
|
|
774
|
-
*/
|
|
775
|
-
mapMaybe = (e, t) => this.map((n) => e(n) ?? t);
|
|
776
|
-
/**
|
|
777
|
-
* Feeds a property into the signal and sets up disposal behavior.
|
|
778
|
-
* @param prop - The property to feed into the signal.
|
|
779
|
-
* @param autoDisposeProp - Determines whether the property should be automatically disposed when the signal is disposed.
|
|
780
|
-
* @returns The input property.
|
|
781
|
-
*/
|
|
782
|
-
feedProp = (e, t = !1) => {
|
|
783
|
-
const n = this.on(e.set, { noAutoDispose: !t });
|
|
784
|
-
return e.onDispose(n), t ? this.onDispose(e.dispose) : this.onDispose(n), e;
|
|
785
|
-
};
|
|
786
|
-
/**
|
|
787
|
-
* Derives a new property from the current signal.
|
|
788
|
-
* @param options - The options for the derived property.
|
|
789
|
-
* @param options.autoDisposeProp - Determines whether the derived property should be automatically disposed.
|
|
790
|
-
* @param options.equals - A function that determines if two values are equal.
|
|
791
|
-
* @returns The derived property.
|
|
792
|
-
*/
|
|
793
|
-
deriveProp = ({
|
|
794
|
-
autoDisposeProp: e = !0,
|
|
795
|
-
equals: t
|
|
796
|
-
} = {}) => this.feedProp(B(this.get(), t), e);
|
|
797
|
-
/**
|
|
798
|
-
* 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.
|
|
799
|
-
* @returns A new signal that emits the same values as the current signal.
|
|
800
|
-
*/
|
|
801
|
-
derive = () => this.map((e) => e);
|
|
802
|
-
/**
|
|
803
|
-
* Returns a signal that emits the count of values received so far.
|
|
804
|
-
* @returns A signal that emits the count of values received so far.
|
|
805
|
-
*/
|
|
806
|
-
count = () => {
|
|
807
|
-
let e = 0;
|
|
808
|
-
return this.map(() => ++e);
|
|
809
|
-
};
|
|
810
|
-
/**
|
|
811
|
-
* Adds a computed value as a derivative of the signal.
|
|
812
|
-
* When the computed value is disposed, it is automatically removed from the derivatives list.
|
|
813
|
-
* Additionally, when the computed value is disposed, it sets the signal as dirty.
|
|
814
|
-
* @param computed - The computed value to add as a derivative.
|
|
815
|
-
*/
|
|
816
|
-
setDerivative = (e) => {
|
|
817
|
-
this._derivatives.push(e), e.onDispose(() => {
|
|
818
|
-
this._derivatives.splice(
|
|
819
|
-
this._derivatives.indexOf(e),
|
|
820
|
-
1
|
|
821
|
-
);
|
|
822
|
-
}), e.onDispose(this.on(e.setDirty, { noAutoDispose: !0 })), this.onDispose(e.dispose);
|
|
823
|
-
};
|
|
824
|
-
}
|
|
825
|
-
const ut = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
|
|
826
|
-
class ee extends _ {
|
|
827
|
-
/**
|
|
828
|
-
* Creates a new Computed signal.
|
|
829
|
-
*
|
|
830
|
-
* **Auto-Registration:** This constructor automatically registers the signal with the current
|
|
831
|
-
* disposal scope (if one exists). This ensures that computed signals created by methods like
|
|
832
|
-
* `.map()`, `.flatMap()`, `.filter()`, etc. are automatically tracked and disposed.
|
|
833
|
-
*
|
|
834
|
-
* When a computed signal is created within a renderable or `WithScope()`, it will be
|
|
835
|
-
* automatically disposed when the component unmounts or the scope is disposed.
|
|
836
|
-
*
|
|
837
|
-
* To create a computed signal that outlives the current scope, use `untracked()`:
|
|
838
|
-
* ```typescript
|
|
839
|
-
* const globalSignal = untracked(() => mySignal.map(x => x * 2));
|
|
840
|
-
* // Remember to dispose manually: globalSignal.dispose()
|
|
841
|
-
* ```
|
|
842
|
-
*
|
|
843
|
-
* @param _fn - The function that computes the value of the signal.
|
|
844
|
-
* @param equals - The function used to compare two values of type T for equality.
|
|
845
|
-
*
|
|
846
|
-
* @see {@link computed} - Factory function for creating computed signals with explicit dependencies
|
|
847
|
-
* @see {@link Signal.map} - Creates a computed signal by transforming values
|
|
848
|
-
* @see {@link getCurrentScope} - Get the current disposal scope
|
|
849
|
-
* @see {@link untracked} - Create signals outside of scope tracking
|
|
850
|
-
*/
|
|
851
|
-
constructor(e, t) {
|
|
852
|
-
super(void 0, t), this._fn = e, this.setDirty(), Oe()?.track(this);
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* Checks if a value is an instance of `Computed`.
|
|
856
|
-
*
|
|
857
|
-
* @param value - The value to check.
|
|
858
|
-
* @returns `true` if the value is an instance of `Computed`, `false` otherwise.
|
|
859
|
-
*/
|
|
860
|
-
static is(e) {
|
|
861
|
-
return e != null && e.$__computed__ === !0;
|
|
862
|
-
}
|
|
863
|
-
/**
|
|
864
|
-
* @internal
|
|
865
|
-
*/
|
|
866
|
-
$__computed__ = !0;
|
|
867
|
-
/**
|
|
868
|
-
* @internal
|
|
869
|
-
*/
|
|
870
|
-
_isDirty = !1;
|
|
871
|
-
/**
|
|
872
|
-
* Marks the signal as dirty, indicating that its value has changed and needs to be recalculated.
|
|
873
|
-
* If the signal is already dirty or disposed, this method does nothing.
|
|
874
|
-
* It also marks all dependent signals as dirty and schedules a notification to update their values.
|
|
875
|
-
*/
|
|
876
|
-
setDirty = () => {
|
|
877
|
-
this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((e) => e.setDirty()), this._scheduleNotify());
|
|
878
|
-
};
|
|
879
|
-
/**
|
|
880
|
-
* @internal
|
|
881
|
-
*/
|
|
882
|
-
_scheduleCount = 0;
|
|
883
|
-
/**
|
|
884
|
-
* Schedules a notification to be executed asynchronously.
|
|
885
|
-
* If the signal is dirty, it will be updated and notified.
|
|
886
|
-
* @internal
|
|
887
|
-
*/
|
|
888
|
-
_scheduleNotify = () => {
|
|
889
|
-
const e = ++this._scheduleCount;
|
|
890
|
-
ut(() => {
|
|
891
|
-
this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
|
|
892
|
-
});
|
|
893
|
-
};
|
|
894
|
-
/** {@inheritDoc Signal.get} */
|
|
895
|
-
get = () => (this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn())), this._value);
|
|
896
|
-
/** {@inheritDoc Signal.value} */
|
|
897
|
-
get value() {
|
|
898
|
-
return this.get();
|
|
899
|
-
}
|
|
900
|
-
/**
|
|
901
|
-
* Disposes the computed signal and cancels any pending recomputations.
|
|
902
|
-
* This override increments the schedule count to invalidate all pending
|
|
903
|
-
* microtasks before disposing the signal.
|
|
904
|
-
*/
|
|
905
|
-
dispose = () => {
|
|
906
|
-
this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
class we extends _ {
|
|
910
|
-
/**
|
|
911
|
-
* Checks if a value is a Prop.
|
|
912
|
-
* @param value - The value to check.
|
|
913
|
-
* @returns `true` if the value is a Prop, `false` otherwise.
|
|
914
|
-
*/
|
|
915
|
-
static is = (e) => (
|
|
916
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
917
|
-
e != null && e.$__prop__ === !0
|
|
918
|
-
);
|
|
919
|
-
/**
|
|
920
|
-
* @internal
|
|
921
|
-
*/
|
|
922
|
-
$__prop__ = !0;
|
|
923
|
-
/**
|
|
924
|
-
* Changes the value of the property and notifies its listeners.
|
|
925
|
-
*
|
|
926
|
-
* @param value - The new value of the property.
|
|
927
|
-
*/
|
|
928
|
-
set = (e) => {
|
|
929
|
-
this._setAndNotify(e);
|
|
930
|
-
};
|
|
931
|
-
/**
|
|
932
|
-
* Updates the value of the signal by applying the provided function to the current value.
|
|
933
|
-
* @param fn - The function to apply to the current value.
|
|
934
|
-
*/
|
|
935
|
-
update = (e) => {
|
|
936
|
-
this._setAndNotify(e(this.get()));
|
|
937
|
-
};
|
|
938
|
-
/**
|
|
939
|
-
* Creates a reducer function that combines the provided reducer function and effects.
|
|
940
|
-
* @param fn - The reducer function that takes the current state and an action, and returns the new state.
|
|
941
|
-
* @param effects - An array of effects to be executed after the state is updated.
|
|
942
|
-
* @returns A dispatch function that can be used to update the state and trigger the effects.
|
|
943
|
-
*/
|
|
944
|
-
reducer = (e, ...t) => {
|
|
945
|
-
const n = this;
|
|
946
|
-
return function r(i) {
|
|
947
|
-
const o = n.value;
|
|
948
|
-
n.update((l) => e(l, i)), !n.equals(o, n.value) && t.forEach(
|
|
949
|
-
(l) => l({
|
|
950
|
-
previousState: o,
|
|
951
|
-
state: n.value,
|
|
952
|
-
action: i,
|
|
953
|
-
dispatch: r
|
|
954
|
-
})
|
|
955
|
-
);
|
|
956
|
-
};
|
|
957
|
-
};
|
|
958
|
-
/**
|
|
959
|
-
* Creates an isomorphism for the Signal.
|
|
960
|
-
* An isomorphism is a pair of functions that convert values between two types,
|
|
961
|
-
* along with an equality function to compare values of the second type.
|
|
962
|
-
*
|
|
963
|
-
* @param to - A function that converts values from type T to type O.
|
|
964
|
-
* @param from - A function that converts values from type O to type T.
|
|
965
|
-
* @param equals - An optional function that compares values of type O for equality.
|
|
966
|
-
* Defaults to a strict equality check (===).
|
|
967
|
-
* @returns A Prop object representing the isomorphism.
|
|
968
|
-
*/
|
|
969
|
-
iso = (e, t, n = (r, i) => r === i) => {
|
|
970
|
-
const r = new we(e(this.get()), n);
|
|
971
|
-
return r.onDispose(this.on((i) => r.set(e(i)))), r.on((i) => this._setAndNotify(t(i))), r;
|
|
972
|
-
};
|
|
973
|
-
/**
|
|
974
|
-
* Returns a `Prop` that represents the value at the specified key of the current value.
|
|
975
|
-
*
|
|
976
|
-
* @param key - The key of the value to access.
|
|
977
|
-
* @returns A `Prop` that represents the value at the specified key.
|
|
978
|
-
*/
|
|
979
|
-
atProp = (e) => this.iso(
|
|
980
|
-
(t) => t[e],
|
|
981
|
-
(t) => ({ ...this.value, [e]: t })
|
|
982
|
-
);
|
|
983
|
-
/**
|
|
984
|
-
* Access for the current value of the property.
|
|
985
|
-
*/
|
|
986
|
-
get value() {
|
|
987
|
-
return this.get();
|
|
988
|
-
}
|
|
989
|
-
set value(e) {
|
|
990
|
-
this._setAndNotify(e);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
const be = (s, e, t = (n, r) => n === r) => {
|
|
994
|
-
const n = new ee(s, t);
|
|
995
|
-
return e.forEach((r) => r.setDerivative(n)), n;
|
|
996
|
-
}, $e = (s, e, t = {}) => {
|
|
997
|
-
let n = t.once ? () => {
|
|
998
|
-
i(), s();
|
|
999
|
-
} : s;
|
|
1000
|
-
if (t.skipInitial) {
|
|
1001
|
-
let o = !1;
|
|
1002
|
-
const l = n;
|
|
1003
|
-
n = () => {
|
|
1004
|
-
o ? l() : o = !0;
|
|
1005
|
-
};
|
|
1006
|
-
}
|
|
1007
|
-
const r = be(n, e), i = () => {
|
|
1008
|
-
r.dispose(), t.abortSignal != null && t.abortSignal.removeEventListener("abort", i);
|
|
1009
|
-
};
|
|
1010
|
-
return t.abortSignal != null && t.abortSignal.addEventListener("abort", i), i;
|
|
1011
|
-
}, B = (s, e = (t, n) => t === n) => {
|
|
1012
|
-
const t = new we(s, e);
|
|
1013
|
-
return Oe()?.track(t), t;
|
|
1014
|
-
}, ye = (s, e = (t, n) => t === n) => new _(s, e), Se = () => (
|
|
1015
|
-
/* c8 ignore next */
|
|
1016
|
-
typeof window < "u" ? window : void 0
|
|
1017
|
-
), ht = (s, e, t) => s + (e - s) * t, Pe = 97, dt = (s, e, t) => {
|
|
1018
|
-
const n = Math.max(s.length, e.length);
|
|
1019
|
-
let r = "";
|
|
1020
|
-
for (let i = 0; i < n; i++) {
|
|
1021
|
-
let o = s.charCodeAt(i);
|
|
1022
|
-
isNaN(o) && (o = Pe);
|
|
1023
|
-
let l = e.charCodeAt(i);
|
|
1024
|
-
isNaN(l) && (l = Pe), r += String.fromCharCode(o + (l - o) * t);
|
|
1025
|
-
}
|
|
1026
|
-
return r;
|
|
1027
|
-
}, ft = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), pt = (s, e) => e, mt = (s) => typeof s == "number" ? ht : typeof s == "string" ? dt : s instanceof Date ? ft : pt;
|
|
1028
|
-
class He {
|
|
1029
|
-
_store = /* @__PURE__ */ new Map();
|
|
1030
|
-
/**
|
|
1031
|
-
* Retrieves the value associated with the specified key from the memory store.
|
|
1032
|
-
* @param key - The key to retrieve the value for.
|
|
1033
|
-
* @returns The value associated with the key, or `null` if the key is not found.
|
|
1034
|
-
*/
|
|
1035
|
-
getItem = (e) => this._store.get(e) ?? null;
|
|
1036
|
-
/**
|
|
1037
|
-
* Sets the value associated with the specified key in the memory store.
|
|
1038
|
-
* @param key - The key to set the value for.
|
|
1039
|
-
* @param value - The value to set.
|
|
1040
|
-
*/
|
|
1041
|
-
setItem = (e, t) => {
|
|
1042
|
-
this._store.set(e, t);
|
|
1043
|
-
};
|
|
1044
|
-
}
|
|
1045
|
-
let _e = null, Ee = null;
|
|
1046
|
-
const gt = () => (_e || (_e = new He()), _e), yt = () => (Ee || (Ee = new He()), Ee), Ne = ({
|
|
1047
|
-
key: s,
|
|
1048
|
-
defaultValue: e,
|
|
1049
|
-
store: t,
|
|
1050
|
-
serialize: n = JSON.stringify,
|
|
1051
|
-
deserialize: r = JSON.parse,
|
|
1052
|
-
equals: i = (d, v) => d === v,
|
|
1053
|
-
onLoad: o = (d) => d,
|
|
1054
|
-
syncTabs: l = !0,
|
|
1055
|
-
onKeyChange: f = "load"
|
|
1056
|
-
}) => {
|
|
1057
|
-
let d = C.get(s);
|
|
1058
|
-
const v = t.getItem(d), S = new we(
|
|
1059
|
-
v != null ? o(r(v)) : typeof e == "function" ? e() : e,
|
|
1060
|
-
i
|
|
1061
|
-
), O = Se(), T = l && typeof O?.BroadcastChannel == "function";
|
|
1062
|
-
let A = !1, $ = null, M = null;
|
|
1063
|
-
const x = (k) => {
|
|
1064
|
-
if (!T) return null;
|
|
1065
|
-
const U = `tempo:storedProp:${k}`, V = new O.BroadcastChannel(U), q = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, F = (K) => {
|
|
1066
|
-
const H = K.data;
|
|
1067
|
-
if (!(H == null || typeof H != "object" || H.key !== k || typeof H.value != "string" || H.sourceId != null && H.sourceId === q))
|
|
1068
|
-
try {
|
|
1069
|
-
A = !0;
|
|
1070
|
-
const re = o(r(H.value));
|
|
1071
|
-
S.set(re);
|
|
1072
|
-
} catch (re) {
|
|
1073
|
-
console.warn(
|
|
1074
|
-
`Failed to sync storedProp for key "${k}" via BroadcastChannel`,
|
|
1075
|
-
re
|
|
1076
|
-
);
|
|
1077
|
-
} finally {
|
|
1078
|
-
A = !1;
|
|
1079
|
-
}
|
|
1080
|
-
};
|
|
1081
|
-
return V.addEventListener("message", F), S.onDispose(() => {
|
|
1082
|
-
V?.removeEventListener("message", F), V?.close();
|
|
1083
|
-
}), { channel: V, instanceId: q, handleMessage: F };
|
|
1084
|
-
}, R = x(d);
|
|
1085
|
-
R && ($ = R.channel, M = R.instanceId);
|
|
1086
|
-
const X = (k) => {
|
|
1087
|
-
const U = d;
|
|
1088
|
-
if (U === k) return;
|
|
1089
|
-
const V = S.get(), q = n(V);
|
|
1090
|
-
if (t.setItem(U, q), $ != null && ($.close(), $ = null, M = null), d = k, f === "load") {
|
|
1091
|
-
const K = t.getItem(k);
|
|
1092
|
-
if (K != null)
|
|
1093
|
-
try {
|
|
1094
|
-
const H = o(r(K));
|
|
1095
|
-
S.set(H);
|
|
1096
|
-
} catch (H) {
|
|
1097
|
-
console.warn(
|
|
1098
|
-
`Failed to load storedProp from new key "${k}"`,
|
|
1099
|
-
H
|
|
1100
|
-
);
|
|
1101
|
-
}
|
|
1102
|
-
else
|
|
1103
|
-
t.setItem(k, q);
|
|
1104
|
-
} else f === "migrate" && t.setItem(k, q);
|
|
1105
|
-
const F = x(k);
|
|
1106
|
-
F && ($ = F.channel, M = F.instanceId);
|
|
1107
|
-
};
|
|
1108
|
-
return _.is(s) && S.onDispose(s.on(X)), S.on((k, U) => {
|
|
1109
|
-
const V = n(k);
|
|
1110
|
-
t.setItem(d, V), $ != null && !A && U !== void 0 && M != null && $.postMessage({
|
|
1111
|
-
key: d,
|
|
1112
|
-
value: V,
|
|
1113
|
-
sourceId: M
|
|
1114
|
-
});
|
|
1115
|
-
}), S;
|
|
1116
|
-
}, fs = (s) => {
|
|
1117
|
-
const e = Se()?.localStorage, t = e && typeof e.getItem == "function" ? e : gt();
|
|
1118
|
-
return Ne({
|
|
1119
|
-
...s,
|
|
1120
|
-
store: t
|
|
1121
|
-
});
|
|
1122
|
-
}, ps = (s) => {
|
|
1123
|
-
const e = Se()?.sessionStorage, t = e && typeof e.getItem == "function" ? e : yt();
|
|
1124
|
-
return Ne({
|
|
1125
|
-
...s,
|
|
1126
|
-
store: t
|
|
1127
|
-
});
|
|
1128
|
-
};
|
|
1129
|
-
function Le(s) {
|
|
1130
|
-
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
|
|
1131
|
-
}
|
|
1132
|
-
const vt = (s, e, t, n) => {
|
|
1133
|
-
const r = n?.duration ?? 300, i = n?.easing ?? ((x) => x), o = n?.equals ?? ((x, R) => x === R);
|
|
1134
|
-
let l = n?.interpolate, f = s, d = e(), v = performance.now(), S = null, O = !0;
|
|
1135
|
-
const T = new ee(e, o), A = B(s, o);
|
|
1136
|
-
A.onDispose(() => {
|
|
1137
|
-
S !== null && cancelAnimationFrame(S);
|
|
1138
|
-
}), A.onDispose(T.dispose), t.forEach((x) => {
|
|
1139
|
-
x.setDerivative(T), x.onDispose(A.dispose);
|
|
1140
|
-
});
|
|
1141
|
-
const $ = (x) => {
|
|
1142
|
-
d = x, v = performance.now(), f = A.value, O && (O = !1, S = Le(M));
|
|
1143
|
-
}, M = () => {
|
|
1144
|
-
const x = (performance.now() - v) / C.get(r), R = i(x);
|
|
1145
|
-
l == null && (l = mt(f));
|
|
1146
|
-
let X = l(f, d, R);
|
|
1147
|
-
x >= 1 ? (O = !0, X = d) : S = Le(M), A.set(X);
|
|
1148
|
-
};
|
|
1149
|
-
return T.on($), A;
|
|
1150
|
-
}, ms = (s, e) => {
|
|
1151
|
-
const { initialValue: t, ...n } = e ?? {};
|
|
1152
|
-
return vt(
|
|
1153
|
-
/* c8 ignore next 2 */
|
|
1154
|
-
t ?? s.get(),
|
|
1155
|
-
s.get,
|
|
1156
|
-
[s],
|
|
1157
|
-
n
|
|
1158
|
-
);
|
|
1159
|
-
}, wt = (s, e) => {
|
|
1160
|
-
const t = Object.values(s).filter(_.is), n = Object.keys(s);
|
|
1161
|
-
return be(() => {
|
|
1162
|
-
const r = {};
|
|
1163
|
-
for (const i of n)
|
|
1164
|
-
r[i] = C.get(s[i]);
|
|
1165
|
-
return e(r);
|
|
1166
|
-
}, t);
|
|
1167
|
-
}, gs = (s) => wt(s, (e) => e), ys = (s, e) => {
|
|
1168
|
-
const t = B(s.get());
|
|
1169
|
-
let n = null;
|
|
1170
|
-
const r = s.on(
|
|
1171
|
-
(i) => {
|
|
1172
|
-
n != null && clearTimeout(n), n = setTimeout(
|
|
1173
|
-
() => {
|
|
1174
|
-
n = null, t.set(i);
|
|
1175
|
-
},
|
|
1176
|
-
typeof e == "function" ? e(i) : e
|
|
1177
|
-
);
|
|
1178
|
-
},
|
|
1179
|
-
{ noAutoDispose: !0 }
|
|
1180
|
-
);
|
|
1181
|
-
return t.onDispose(() => {
|
|
1182
|
-
r(), n != null && clearTimeout(n);
|
|
1183
|
-
}), t;
|
|
1184
|
-
}, vs = (s) => {
|
|
1185
|
-
let e;
|
|
1186
|
-
return s.map((t) => {
|
|
1187
|
-
const n = e;
|
|
1188
|
-
return e = t, n;
|
|
1189
|
-
});
|
|
1190
|
-
}, ws = ({
|
|
1191
|
-
size: s = void 0,
|
|
1192
|
-
signal: e
|
|
1193
|
-
}) => {
|
|
1194
|
-
const t = [];
|
|
1195
|
-
return e.map((n) => (t.push(n), s != null && t.length > s && t.shift(), t.slice()));
|
|
1196
|
-
}, bs = (s) => (...e) => ne(
|
|
1197
|
-
s,
|
|
1198
|
-
...e
|
|
1199
|
-
)((t, ...n) => t(...n));
|
|
1200
|
-
function Ss(...s) {
|
|
1201
|
-
return ne(...s)((...e) => {
|
|
1202
|
-
for (const t of e) if (t != null) return t;
|
|
1203
|
-
});
|
|
1204
|
-
}
|
|
1205
|
-
const Ts = (s, {
|
|
1206
|
-
channel: e,
|
|
1207
|
-
serialize: t = JSON.stringify,
|
|
1208
|
-
deserialize: n = JSON.parse,
|
|
1209
|
-
equals: r = (i, o) => i === o
|
|
1210
|
-
}) => {
|
|
1211
|
-
const i = Se();
|
|
1212
|
-
if (typeof i?.BroadcastChannel != "function")
|
|
1213
|
-
return () => {
|
|
1214
|
-
};
|
|
1215
|
-
const o = new i.BroadcastChannel(
|
|
1216
|
-
`tempo:syncProp:${e}`
|
|
1217
|
-
), l = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
1218
|
-
let f = !1;
|
|
1219
|
-
const d = (O) => {
|
|
1220
|
-
const T = O.data;
|
|
1221
|
-
if (!(T == null || typeof T != "object" || typeof T.value != "string" || T.sourceId != null && T.sourceId === l))
|
|
1222
|
-
try {
|
|
1223
|
-
f = !0;
|
|
1224
|
-
const A = n(T.value);
|
|
1225
|
-
r(s.get(), A) || s.set(A);
|
|
1226
|
-
} catch (A) {
|
|
1227
|
-
console.warn(
|
|
1228
|
-
`Failed to sync prop for channel "${e}" via BroadcastChannel`,
|
|
1229
|
-
A
|
|
1230
|
-
);
|
|
1231
|
-
} finally {
|
|
1232
|
-
f = !1;
|
|
1233
|
-
}
|
|
1234
|
-
};
|
|
1235
|
-
o.addEventListener("message", d);
|
|
1236
|
-
const v = s.on((O, T) => {
|
|
1237
|
-
if (!f && T !== void 0 && !r(O, T))
|
|
1238
|
-
try {
|
|
1239
|
-
const A = t(O);
|
|
1240
|
-
o.postMessage({
|
|
1241
|
-
value: A,
|
|
1242
|
-
sourceId: l
|
|
1243
|
-
});
|
|
1244
|
-
} catch (A) {
|
|
1245
|
-
console.warn(
|
|
1246
|
-
`Failed to serialize prop for channel "${e}" via BroadcastChannel`,
|
|
1247
|
-
A
|
|
1248
|
-
);
|
|
1249
|
-
}
|
|
1250
|
-
}), S = () => {
|
|
1251
|
-
v(), o.removeEventListener("message", d), o.close();
|
|
1252
|
-
};
|
|
1253
|
-
return s.onDispose(S), S;
|
|
1254
|
-
};
|
|
1255
|
-
class De {
|
|
1256
|
-
/**
|
|
1257
|
-
* Creates a new instance of `ElementPosition`.
|
|
1258
|
-
* @param index - The index of the element.
|
|
1259
|
-
* @param total - The total number of elements in the collection.
|
|
1260
|
-
*/
|
|
1261
|
-
constructor(e, t) {
|
|
1262
|
-
this.index = e, this.total = t, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
|
|
1263
|
-
}
|
|
1264
|
-
/**
|
|
1265
|
-
* The counter of the element starting from 1.
|
|
1266
|
-
*/
|
|
1267
|
-
counter;
|
|
1268
|
-
/**
|
|
1269
|
-
* Checks if the element is the first element in the collection.
|
|
1270
|
-
* @returns `true` if the element is the first element, `false` otherwise.
|
|
1271
|
-
*/
|
|
1272
|
-
isFirst;
|
|
1273
|
-
/**
|
|
1274
|
-
* Checks if the counter of the element is even.
|
|
1275
|
-
* @returns `true` if the counter is even, `false` otherwise.
|
|
1276
|
-
*/
|
|
1277
|
-
isEven;
|
|
1278
|
-
/**
|
|
1279
|
-
* Checks if the counter of the element is odd.
|
|
1280
|
-
* @returns `true` if the counter is odd, `false` otherwise.
|
|
1281
|
-
*/
|
|
1282
|
-
isOdd;
|
|
1283
|
-
#e;
|
|
1284
|
-
/**
|
|
1285
|
-
* Checks if the element is the last element in the collection.
|
|
1286
|
-
* @returns `true` if the element is the last element, `false` otherwise.
|
|
1287
|
-
*/
|
|
1288
|
-
get isLast() {
|
|
1289
|
-
return this.#e == null && (this.#e = this.total.map((e) => this.counter === e)), this.#e;
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* Disposes the internal signal created by `isLast`.
|
|
1293
|
-
*
|
|
1294
|
-
* **Note:** With automatic signal disposal, this method is now a no-op when used within
|
|
1295
|
-
* a disposal scope (e.g., inside a renderable). The signal created by `isLast` is
|
|
1296
|
-
* automatically tracked and disposed when the scope ends. This method is kept for
|
|
1297
|
-
* backward compatibility and for cases where ElementPosition is used outside a scope.
|
|
1298
|
-
*/
|
|
1299
|
-
dispose = () => {
|
|
1300
|
-
this.#e?.dispose(), this.#e = void 0;
|
|
1301
|
-
};
|
|
1302
|
-
}
|
|
1303
|
-
const Re = /* @__PURE__ */ new Set([
|
|
1
|
+
import { DisposalScope as pe, withScope as me, Value as _, createRenderable as ge, Signal as B, createSelector as be, makeProviderMark as ye } from "@tempots/core";
|
|
2
|
+
import { Computed as vn, DisposalScope as Cn, ElementPosition as En, KeyedPosition as Pn, MemoryStore as Mn, Prop as On, Signal as Ln, Value as Hn, animateSignal as Nn, animateSignals as Dn, bind as In, coalesce as Rn, computed as _n, computedOf as $n, computedOfAsync as Bn, computedOfAsyncGenerator as jn, computedRecord as Vn, createRenderable as Wn, createSelector as Fn, delaySignal as Kn, effect as qn, effectOf as Gn, endInterpolate as Un, getCurrentScope as Jn, getParentScope as Yn, getScopeStack as Xn, guessInterpolate as zn, interpolateDate as Qn, interpolateNumber as Zn, interpolateString as er, joinSignals as tr, localStorageProp as nr, makeProviderMark as rr, merge as sr, popScope as ir, previousSignal as or, prop as lr, pushScope as cr, scoped as ar, sessionStorageProp as ur, signal as dr, slidingWindowSignal as hr, storedProp as fr, strictEquals as pr, syncProp as mr, untracked as gr, withScope as br } from "@tempots/core";
|
|
3
|
+
import { ProviderNotFoundError as J, createRenderKit as Te } from "@tempots/render";
|
|
4
|
+
import { ProviderNotFoundError as Tr, createRenderKit as Sr } from "@tempots/render";
|
|
5
|
+
const Y = /* @__PURE__ */ new Set([
|
|
1304
6
|
"checked",
|
|
1305
7
|
"disabled",
|
|
1306
8
|
"hidden",
|
|
@@ -1308,14 +10,14 @@ const Re = /* @__PURE__ */ new Set([
|
|
|
1308
10
|
"readonly",
|
|
1309
11
|
"required",
|
|
1310
12
|
"autofocus"
|
|
1311
|
-
]),
|
|
13
|
+
]), X = /* @__PURE__ */ new Set(["selected"]), z = /* @__PURE__ */ new Set([
|
|
1312
14
|
"rowSpan",
|
|
1313
15
|
"colSpan",
|
|
1314
16
|
"tabIndex",
|
|
1315
17
|
"valueAsNumber"
|
|
1316
|
-
]),
|
|
18
|
+
]), Q = /* @__PURE__ */ new Set(["valueAsDate"]), Z = {
|
|
1317
19
|
readonly: "readOnly"
|
|
1318
|
-
},
|
|
20
|
+
}, ee = /* @__PURE__ */ new Set([
|
|
1319
21
|
"value",
|
|
1320
22
|
"textContent",
|
|
1321
23
|
"innerText",
|
|
@@ -1324,391 +26,33 @@ const Re = /* @__PURE__ */ new Set([
|
|
|
1324
26
|
"outerHTML",
|
|
1325
27
|
"className",
|
|
1326
28
|
"classList"
|
|
1327
|
-
]),
|
|
1328
|
-
if (
|
|
29
|
+
]), Se = (n, e) => {
|
|
30
|
+
if (X.has(n))
|
|
1329
31
|
return (t) => {
|
|
1330
|
-
t == null || t !== !0 ? e.removeAttribute(
|
|
1331
|
-
};
|
|
1332
|
-
if (Re.has(s)) {
|
|
1333
|
-
const t = qe[s] || s;
|
|
1334
|
-
return (n) => {
|
|
1335
|
-
n == null ? e[t] = null : e[t] = !!n;
|
|
1336
|
-
};
|
|
1337
|
-
} else return Ve.has(s) ? (t) => {
|
|
1338
|
-
t == null ? e[s] = null : e[s] = Number(t);
|
|
1339
|
-
} : Be.has(s) ? (t) => {
|
|
1340
|
-
t == null ? e[s] = null : e[s] = t;
|
|
1341
|
-
} : Fe.has(s) ? (t) => {
|
|
1342
|
-
t == null ? e[s] = null : e[s] = String(t);
|
|
1343
|
-
} : (t) => {
|
|
1344
|
-
t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
|
|
1345
|
-
};
|
|
1346
|
-
}, St = (s, e) => je.has(s) ? () => e.hasAttribute(s) : Re.has(s) ? () => (
|
|
1347
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1348
|
-
!!e[qe[s] || s]
|
|
1349
|
-
) : Ve.has(s) ? () => Number(e[s]) : Be.has(s) ? () => e[s] : Fe.has(s) ? () => String(e[s]) : () => e.getAttribute(s), ve = (s) => {
|
|
1350
|
-
const e = s;
|
|
1351
|
-
e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentNode && s.parentNode.removeChild(s);
|
|
1352
|
-
}, Tt = (s) => We(s) || Ue(s) ? s : s.parentElement, We = (s) => s.nodeType === 1, Ue = (s) => s.nodeType === 11;
|
|
1353
|
-
class Je extends Error {
|
|
1354
|
-
constructor(e) {
|
|
1355
|
-
super(`Provider not found: ${e.description}`);
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
function At(s) {
|
|
1359
|
-
const { create: e } = s, t = (a) => e((c) => c.makeChildText(a).clear), n = (a) => e((c) => {
|
|
1360
|
-
const h = c.makeChildText(a.value), u = a.on(h.setText);
|
|
1361
|
-
return (m) => {
|
|
1362
|
-
u(), h.clear(m);
|
|
1363
|
-
};
|
|
1364
|
-
}), r = (a, c, h) => _.is(a) ? c(a) : h(a), i = (a) => {
|
|
1365
|
-
if (a == null)
|
|
1366
|
-
return l;
|
|
1367
|
-
if (Array.isArray(a))
|
|
1368
|
-
return f(...a.map(i));
|
|
1369
|
-
if (typeof a == "string")
|
|
1370
|
-
return t(a);
|
|
1371
|
-
if (_.is(a))
|
|
1372
|
-
return n(a);
|
|
1373
|
-
if (typeof a == "object" && "render" in a && "type" in a)
|
|
1374
|
-
return a;
|
|
1375
|
-
throw new Error(`Unknown type: '${typeof a}' for child: ${a}`);
|
|
1376
|
-
}, o = (a, c, h) => {
|
|
1377
|
-
const u = a.makeRef();
|
|
1378
|
-
let m = () => {
|
|
1379
|
-
}, p = null;
|
|
1380
|
-
const b = c.on(
|
|
1381
|
-
(y) => {
|
|
1382
|
-
p?.dispose(), m(!0), p = new ie(), m = z(
|
|
1383
|
-
p,
|
|
1384
|
-
() => i(h(y)).render(u)
|
|
1385
|
-
);
|
|
1386
|
-
},
|
|
1387
|
-
{ noAutoDispose: !0 }
|
|
1388
|
-
);
|
|
1389
|
-
return (y) => {
|
|
1390
|
-
p?.dispose(), m(y), b(), u.clear(y);
|
|
1391
|
-
};
|
|
1392
|
-
}, l = e(() => () => {
|
|
1393
|
-
}), f = (...a) => e((c) => {
|
|
1394
|
-
const h = a.map(
|
|
1395
|
-
(u) => i(u).render(c)
|
|
1396
|
-
);
|
|
1397
|
-
return (u) => {
|
|
1398
|
-
h.forEach((m) => m(u));
|
|
1399
|
-
};
|
|
1400
|
-
}), d = (a, c, h) => r(
|
|
1401
|
-
a,
|
|
1402
|
-
(u) => e(
|
|
1403
|
-
(m) => o(
|
|
1404
|
-
m,
|
|
1405
|
-
u,
|
|
1406
|
-
(p) => p ? c() : h?.()
|
|
1407
|
-
)
|
|
1408
|
-
),
|
|
1409
|
-
(u) => {
|
|
1410
|
-
if (u) {
|
|
1411
|
-
const m = c();
|
|
1412
|
-
return m != null ? i(m) : l;
|
|
1413
|
-
}
|
|
1414
|
-
return i(h?.());
|
|
1415
|
-
}
|
|
1416
|
-
), v = (a, c, h) => d(
|
|
1417
|
-
C.map(a, (u) => !u),
|
|
1418
|
-
c,
|
|
1419
|
-
h
|
|
1420
|
-
), S = (a, c, h) => {
|
|
1421
|
-
if (h != null)
|
|
1422
|
-
return S(a, (u) => {
|
|
1423
|
-
const m = new De(
|
|
1424
|
-
u.index,
|
|
1425
|
-
u.total.map((p) => p - 1)
|
|
1426
|
-
);
|
|
1427
|
-
return f(
|
|
1428
|
-
i(c(u)),
|
|
1429
|
-
d(
|
|
1430
|
-
u.isLast,
|
|
1431
|
-
() => l,
|
|
1432
|
-
() => h(m)
|
|
1433
|
-
)
|
|
1434
|
-
);
|
|
1435
|
-
});
|
|
1436
|
-
if (_.is(a))
|
|
1437
|
-
return e((u) => {
|
|
1438
|
-
const m = a.derive(), p = u.makeRef(), b = [], y = [];
|
|
1439
|
-
return m.on((w) => {
|
|
1440
|
-
const E = b.splice(w), D = y.splice(w);
|
|
1441
|
-
for (const I of D)
|
|
1442
|
-
I.dispose();
|
|
1443
|
-
for (const I of E)
|
|
1444
|
-
I(!0);
|
|
1445
|
-
for (let I = b.length; I < w; I++) {
|
|
1446
|
-
const g = new De(I, m), P = new ie();
|
|
1447
|
-
y.push(P), b.push(
|
|
1448
|
-
z(
|
|
1449
|
-
P,
|
|
1450
|
-
() => i(c(g)).render(p)
|
|
1451
|
-
)
|
|
1452
|
-
);
|
|
1453
|
-
}
|
|
1454
|
-
}), (w) => {
|
|
1455
|
-
for (const E of y)
|
|
1456
|
-
E.dispose();
|
|
1457
|
-
y.length = 0, m.dispose();
|
|
1458
|
-
for (const E of b)
|
|
1459
|
-
E(w);
|
|
1460
|
-
b.length = 0, p.clear(w);
|
|
1461
|
-
};
|
|
1462
|
-
});
|
|
1463
|
-
{
|
|
1464
|
-
const u = ye(a);
|
|
1465
|
-
return f(
|
|
1466
|
-
...Array.from({ length: a }, (m, p) => p).map((m) => {
|
|
1467
|
-
const p = new De(m, u);
|
|
1468
|
-
return i(c(p));
|
|
1469
|
-
})
|
|
1470
|
-
);
|
|
1471
|
-
}
|
|
1472
|
-
}, O = (a, c, h) => {
|
|
1473
|
-
const u = C.map(a, (p) => p.length), m = C.toSignal(a);
|
|
1474
|
-
return S(
|
|
1475
|
-
u,
|
|
1476
|
-
(p) => {
|
|
1477
|
-
const b = m.map((y) => y[p.index]);
|
|
1478
|
-
return i(c(b, p));
|
|
1479
|
-
},
|
|
1480
|
-
h
|
|
1481
|
-
);
|
|
1482
|
-
}, T = (a, c) => {
|
|
1483
|
-
function h(m) {
|
|
1484
|
-
return e((p) => {
|
|
1485
|
-
const b = p.makeRef();
|
|
1486
|
-
let y, w;
|
|
1487
|
-
const E = m.map((g) => Object.keys(g)[0]);
|
|
1488
|
-
let D;
|
|
1489
|
-
const I = E.on((g) => {
|
|
1490
|
-
if (g !== D) {
|
|
1491
|
-
D = g, w?.dispose(), y?.(!0), w = m.map((G) => G[g]);
|
|
1492
|
-
const P = c[g](w);
|
|
1493
|
-
y = i(P).render(b);
|
|
1494
|
-
}
|
|
1495
|
-
});
|
|
1496
|
-
return (g) => {
|
|
1497
|
-
w?.dispose(), I(), b.clear(g), y?.(g);
|
|
1498
|
-
};
|
|
1499
|
-
});
|
|
1500
|
-
}
|
|
1501
|
-
function u(m) {
|
|
1502
|
-
const p = Object.keys(m)[0];
|
|
1503
|
-
return i(c[p](ye(m[p])));
|
|
1504
|
-
}
|
|
1505
|
-
return r(a, h, u);
|
|
1506
|
-
}, A = (a, c, h) => T(
|
|
1507
|
-
C.map(a, (u) => ({ [u[c]]: u })),
|
|
1508
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1509
|
-
h
|
|
1510
|
-
), $ = (a, c) => A(a, "kind", c), M = (a, c) => A(a, "type", c), x = (a, c) => {
|
|
1511
|
-
const h = C.map(a, ([u, m]) => ({
|
|
1512
|
-
[u]: m
|
|
1513
|
-
}));
|
|
1514
|
-
return T(h, c);
|
|
1515
|
-
}, R = (a, c) => T(
|
|
1516
|
-
C.map(a, (h) => ({ [h]: !0 })),
|
|
1517
|
-
c
|
|
1518
|
-
), X = (a, c) => {
|
|
1519
|
-
if (_.is(a)) {
|
|
1520
|
-
const h = a;
|
|
1521
|
-
return e((u) => {
|
|
1522
|
-
const m = u.makeRef(), p = h.map((w) => i(c(w)));
|
|
1523
|
-
let b = () => {
|
|
1524
|
-
};
|
|
1525
|
-
const y = p.on((w) => {
|
|
1526
|
-
b(!0), b = w.render(m);
|
|
1527
|
-
});
|
|
1528
|
-
return (w) => {
|
|
1529
|
-
y(), b(w);
|
|
1530
|
-
};
|
|
1531
|
-
});
|
|
1532
|
-
}
|
|
1533
|
-
return i(c(a));
|
|
1534
|
-
}, k = (a, c, h) => {
|
|
1535
|
-
function u(p) {
|
|
1536
|
-
return e((b) => {
|
|
1537
|
-
const y = b.makeRef();
|
|
1538
|
-
let w = () => {
|
|
1539
|
-
}, E = !1, D = null;
|
|
1540
|
-
const I = p.on((g) => {
|
|
1541
|
-
g == null ? (w(!0), w = i(h?.()).render(y), E = !1, D?.dispose(), D = null) : E ? D.set(g) : (D = B(g), w(!0), w = i(
|
|
1542
|
-
c(D)
|
|
1543
|
-
).render(y), E = !0);
|
|
1544
|
-
});
|
|
1545
|
-
return (g) => {
|
|
1546
|
-
D?.dispose(), I(), w?.(g), y.clear(g);
|
|
1547
|
-
};
|
|
1548
|
-
});
|
|
1549
|
-
}
|
|
1550
|
-
function m(p) {
|
|
1551
|
-
if (p == null) {
|
|
1552
|
-
const b = h?.();
|
|
1553
|
-
return b != null ? i(b) : l;
|
|
1554
|
-
}
|
|
1555
|
-
return i(c(ye(p)));
|
|
1556
|
-
}
|
|
1557
|
-
return r(
|
|
1558
|
-
a,
|
|
1559
|
-
u,
|
|
1560
|
-
m
|
|
1561
|
-
);
|
|
1562
|
-
}, U = (...a) => (c, h) => e((u) => {
|
|
1563
|
-
const m = u.makeRef();
|
|
1564
|
-
if (a.some(
|
|
1565
|
-
(g) => !_.is(g) && g == null
|
|
1566
|
-
))
|
|
1567
|
-
return (h != null ? i(h?.()) : l).render(m);
|
|
1568
|
-
const p = a.map(
|
|
1569
|
-
() => null
|
|
1570
|
-
), b = a.map(
|
|
1571
|
-
(g) => _.is(g) ? g.value != null : g != null
|
|
1572
|
-
);
|
|
1573
|
-
let y = null;
|
|
1574
|
-
const w = B(b.every((g) => g)), E = (g, P) => {
|
|
1575
|
-
if (g.value != null) {
|
|
1576
|
-
if (p[P] == null) {
|
|
1577
|
-
const G = B(g.value);
|
|
1578
|
-
p[P] = G;
|
|
1579
|
-
} else
|
|
1580
|
-
p[P].value = g.value;
|
|
1581
|
-
b[P] = !0;
|
|
1582
|
-
} else
|
|
1583
|
-
b[P] = !1;
|
|
1584
|
-
};
|
|
1585
|
-
let D = a.length - 1;
|
|
1586
|
-
const I = a.map((g, P) => {
|
|
1587
|
-
if (!_.is(g)) {
|
|
1588
|
-
const G = B(g);
|
|
1589
|
-
return p[P] = G, () => {
|
|
1590
|
-
};
|
|
1591
|
-
}
|
|
1592
|
-
return g.on(() => {
|
|
1593
|
-
E(g, P), D === 0 ? w.value = b.every((G) => G) : D--;
|
|
1594
|
-
});
|
|
1595
|
-
});
|
|
1596
|
-
return w.on((g) => {
|
|
1597
|
-
y?.(!0), y = null, g ? y = i(c(...p)).render(
|
|
1598
|
-
m
|
|
1599
|
-
) : y = i(h?.() ?? l).render(m);
|
|
1600
|
-
}), (g) => {
|
|
1601
|
-
p.forEach((P) => P?.dispose()), w.dispose(), I.forEach((P) => P()), y?.(g), m.clear(g);
|
|
32
|
+
t == null || t !== !0 ? e.removeAttribute(n) : e.setAttribute(n, "");
|
|
1602
33
|
};
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
),
|
|
1608
|
-
{
|
|
1609
|
-
notEmpty: (u) => c(u),
|
|
1610
|
-
whenEmpty: () => h()
|
|
1611
|
-
}
|
|
1612
|
-
), q = (a, c) => {
|
|
1613
|
-
if (typeof c == "function")
|
|
1614
|
-
return q(a, { then: c });
|
|
1615
|
-
const h = c.pending != null ? i(c.pending()) : l, u = c.then, m = c.error != null ? (p) => i(c.error(p)) : () => l;
|
|
1616
|
-
return e((p) => {
|
|
1617
|
-
let b = !0;
|
|
1618
|
-
const y = a(), w = p.makeRef();
|
|
1619
|
-
let E = i(h).render(w);
|
|
1620
|
-
return y.then(
|
|
1621
|
-
(D) => {
|
|
1622
|
-
b && (E(!0), E = i(u(D)).render(w));
|
|
1623
|
-
},
|
|
1624
|
-
(D) => {
|
|
1625
|
-
b && (E(!0), E = i(m(D)).render(w));
|
|
1626
|
-
}
|
|
1627
|
-
), (D) => {
|
|
1628
|
-
b = !1, E(D), w.clear(D);
|
|
1629
|
-
};
|
|
1630
|
-
});
|
|
1631
|
-
}, F = (a, c) => q(() => a, c), K = (...a) => e(
|
|
1632
|
-
(c) => (h) => a.forEach((u) => {
|
|
1633
|
-
typeof u == "function" ? u(h, c) : u.dispose(h, c);
|
|
1634
|
-
})
|
|
1635
|
-
), H = (a, c = {}) => (h) => {
|
|
1636
|
-
const u = c?.firstSeparator ?? a, m = c?.lastSeparator ?? a;
|
|
1637
|
-
return R(
|
|
1638
|
-
h.map((p) => p.isFirst ? "first" : p.isLast ? "last" : "other"),
|
|
1639
|
-
{
|
|
1640
|
-
first: u,
|
|
1641
|
-
last: m,
|
|
1642
|
-
other: a
|
|
1643
|
-
}
|
|
1644
|
-
);
|
|
1645
|
-
}, re = (a) => e((c) => {
|
|
1646
|
-
const h = new ie(), u = z(
|
|
1647
|
-
h,
|
|
1648
|
-
() => i(a(h)).render(c)
|
|
1649
|
-
);
|
|
1650
|
-
return (m) => {
|
|
1651
|
-
h.dispose(), u(m);
|
|
34
|
+
if (Y.has(n)) {
|
|
35
|
+
const t = Z[n] || n;
|
|
36
|
+
return (r) => {
|
|
37
|
+
r == null ? e[t] = null : e[t] = !!r;
|
|
1652
38
|
};
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
const p = [], b = a({
|
|
1662
|
-
use: ({ mark: y }) => {
|
|
1663
|
-
const { value: w, onUse: E } = u().getProvider(y);
|
|
1664
|
-
return E?.(), w;
|
|
1665
|
-
},
|
|
1666
|
-
set: ({ mark: y, create: w }, E) => {
|
|
1667
|
-
const { value: D, dispose: I, onUse: g } = w(E, u());
|
|
1668
|
-
p.push(I), m(u().setProvider(y, D, g));
|
|
1669
|
-
}
|
|
1670
|
-
});
|
|
1671
|
-
return b == null ? () => {
|
|
1672
|
-
} : f(
|
|
1673
|
-
i(b),
|
|
1674
|
-
K(() => p.forEach((y) => y()))
|
|
1675
|
-
).render(u());
|
|
1676
|
-
});
|
|
1677
|
-
return {
|
|
1678
|
-
Empty: l,
|
|
1679
|
-
Fragment: f,
|
|
1680
|
-
When: d,
|
|
1681
|
-
Unless: v,
|
|
1682
|
-
ForEach: O,
|
|
1683
|
-
Repeat: S,
|
|
1684
|
-
OneOf: T,
|
|
1685
|
-
OneOfField: A,
|
|
1686
|
-
OneOfKind: $,
|
|
1687
|
-
OneOfType: M,
|
|
1688
|
-
OneOfValue: R,
|
|
1689
|
-
OneOfTuple: x,
|
|
1690
|
-
MapSignal: X,
|
|
1691
|
-
Ensure: k,
|
|
1692
|
-
EnsureAll: U,
|
|
1693
|
-
NotEmpty: V,
|
|
1694
|
-
Task: q,
|
|
1695
|
-
Async: F,
|
|
1696
|
-
OnDispose: K,
|
|
1697
|
-
Conjunction: H,
|
|
1698
|
-
WithScope: re,
|
|
1699
|
-
WithProvider: pe,
|
|
1700
|
-
Provide: (a, c, h) => pe(({ set: u }) => (u(a, c), h())),
|
|
1701
|
-
Use: (a, c) => pe(({ use: h }) => c(h(a))),
|
|
1702
|
-
UseMany: (...a) => (c) => pe(({ use: h }) => {
|
|
1703
|
-
const u = a.map(h);
|
|
1704
|
-
return c(...u);
|
|
1705
|
-
}),
|
|
1706
|
-
handleValueOrSignal: r,
|
|
1707
|
-
createReactiveRenderable: o,
|
|
1708
|
-
renderableOfTNode: i
|
|
39
|
+
} else return z.has(n) ? (t) => {
|
|
40
|
+
t == null ? e[n] = null : e[n] = Number(t);
|
|
41
|
+
} : Q.has(n) ? (t) => {
|
|
42
|
+
t == null ? e[n] = null : e[n] = t;
|
|
43
|
+
} : ee.has(n) ? (t) => {
|
|
44
|
+
t == null ? e[n] = null : e[n] = String(t);
|
|
45
|
+
} : (t) => {
|
|
46
|
+
t == null ? e.removeAttribute(n) : e.setAttribute(n, t);
|
|
1709
47
|
};
|
|
1710
|
-
}
|
|
1711
|
-
|
|
48
|
+
}, xe = (n, e) => X.has(n) ? () => e.hasAttribute(n) : Y.has(n) ? () => (
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
+
!!e[Z[n] || n]
|
|
51
|
+
) : z.has(n) ? () => Number(e[n]) : Q.has(n) ? () => e[n] : ee.has(n) ? () => String(e[n]) : () => e.getAttribute(n), $ = (n) => {
|
|
52
|
+
const e = n;
|
|
53
|
+
e && e.onblur && (e.onblur = null), !(!n || n.ownerDocument === void 0) && n.parentNode && n.parentNode.removeChild(n);
|
|
54
|
+
}, we = (n) => te(n) || ne(n) ? n : n.parentElement, te = (n) => n.nodeType === 1, ne = (n) => n.nodeType === 11;
|
|
55
|
+
class T {
|
|
1712
56
|
/**
|
|
1713
57
|
* Constructs a new `DOMContext` instance.
|
|
1714
58
|
*
|
|
@@ -1718,8 +62,8 @@ class te {
|
|
|
1718
62
|
* @param providers - The `Providers` instance associated with this context.
|
|
1719
63
|
* @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
|
|
1720
64
|
*/
|
|
1721
|
-
constructor(e, t,
|
|
1722
|
-
this.document = e, this.element = t, this.reference =
|
|
65
|
+
constructor(e, t, r, s) {
|
|
66
|
+
this.document = e, this.element = t, this.reference = r, this.providers = s;
|
|
1723
67
|
}
|
|
1724
68
|
/**
|
|
1725
69
|
* Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
|
|
@@ -1729,8 +73,8 @@ class te {
|
|
|
1729
73
|
* @param providers - The providers to associate with the `DOMContext`.
|
|
1730
74
|
* @returns A new `DOMContext` instance.
|
|
1731
75
|
*/
|
|
1732
|
-
static of(e, t,
|
|
1733
|
-
return new
|
|
76
|
+
static of(e, t, r) {
|
|
77
|
+
return new T(e.ownerDocument, e, t, r);
|
|
1734
78
|
}
|
|
1735
79
|
/**
|
|
1736
80
|
* Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
|
|
@@ -1739,7 +83,9 @@ class te {
|
|
|
1739
83
|
* @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
|
|
1740
84
|
* @returns The newly created element.
|
|
1741
85
|
*/
|
|
1742
|
-
createElement
|
|
86
|
+
createElement(e, t) {
|
|
87
|
+
return t !== void 0 ? this.document.createElementNS(t, e) : this.document.createElement(e);
|
|
88
|
+
}
|
|
1743
89
|
/**
|
|
1744
90
|
* Creates a new child element and appends it to the current element, returning a new context.
|
|
1745
91
|
*
|
|
@@ -1762,65 +108,78 @@ class te {
|
|
|
1762
108
|
* @param namespace - The namespace URI for the element, or undefined for HTML elements
|
|
1763
109
|
* @returns A new DOMContext focused on the newly created child element
|
|
1764
110
|
*/
|
|
1765
|
-
makeChildElement
|
|
1766
|
-
const
|
|
1767
|
-
return this.appendOrInsert(
|
|
1768
|
-
}
|
|
111
|
+
makeChildElement(e, t) {
|
|
112
|
+
const r = this.createElement(e, t);
|
|
113
|
+
return this.appendOrInsert(r), this.withElement(r);
|
|
114
|
+
}
|
|
1769
115
|
/**
|
|
1770
116
|
* Creates a new text node with the specified text content.
|
|
1771
117
|
* @param text - The text content for the new text node.
|
|
1772
118
|
* @returns A new `Text` node with the specified text content.
|
|
1773
119
|
*/
|
|
1774
|
-
createText
|
|
120
|
+
createText(e) {
|
|
121
|
+
return this.document.createTextNode(e);
|
|
122
|
+
}
|
|
1775
123
|
/**
|
|
1776
124
|
* Creates a new text node with the specified text content and appends it to the current element.
|
|
1777
|
-
* @param text - The text content for the new text node.
|
|
125
|
+
* @param text - The text content for the new text node. Primitives are coerced to strings by the DOM.
|
|
1778
126
|
* @returns A new `DOMContext` with a reference to the new text node.
|
|
1779
127
|
*/
|
|
1780
|
-
makeChildText
|
|
128
|
+
makeChildText(e) {
|
|
1781
129
|
const t = this.createText(e);
|
|
1782
130
|
return this.appendOrInsert(t), this.withReference(t);
|
|
1783
|
-
}
|
|
131
|
+
}
|
|
1784
132
|
/**
|
|
1785
133
|
* Sets the text content of the current element.
|
|
1786
|
-
* @param text - The text content to set.
|
|
134
|
+
* @param text - The text content to set. Primitives are coerced to strings by the DOM.
|
|
1787
135
|
*/
|
|
1788
|
-
setText
|
|
136
|
+
setText(e) {
|
|
1789
137
|
this.reference.nodeValue = e;
|
|
1790
|
-
}
|
|
138
|
+
}
|
|
1791
139
|
/**
|
|
1792
140
|
* Gets the text content of the current element or text node.
|
|
1793
141
|
* @returns The text content of the current element or text node.
|
|
1794
142
|
*/
|
|
1795
|
-
getText
|
|
143
|
+
getText() {
|
|
144
|
+
return this.reference?.nodeValue ?? this.element.textContent ?? "";
|
|
145
|
+
}
|
|
1796
146
|
/**
|
|
1797
|
-
* Creates a new `DOMContext` with a reference to a newly created
|
|
1798
|
-
* The
|
|
147
|
+
* Creates a new `DOMContext` with a reference to a newly created Comment node.
|
|
148
|
+
* The Comment node is appended or inserted to the current `DOMContext`.
|
|
1799
149
|
* The new `DOMContext` with the reference is returned.
|
|
1800
150
|
*/
|
|
1801
|
-
makeRef
|
|
1802
|
-
const e = this.
|
|
151
|
+
makeRef() {
|
|
152
|
+
const e = this.document.createComment("");
|
|
1803
153
|
return this.appendOrInsert(e), this.withReference(e);
|
|
1804
|
-
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Creates a lightweight Comment marker node and appends/inserts it.
|
|
157
|
+
* Used as boundary references for keyed list items and conditional renderables.
|
|
158
|
+
*/
|
|
159
|
+
makeMarker() {
|
|
160
|
+
return this.makeRef();
|
|
161
|
+
}
|
|
1805
162
|
/**
|
|
1806
163
|
* Appends or inserts a child node to the element, depending on whether a reference node is provided.
|
|
1807
164
|
*
|
|
1808
165
|
* @param child - The child node to append or insert.
|
|
1809
166
|
*/
|
|
1810
|
-
appendOrInsert
|
|
167
|
+
appendOrInsert(e) {
|
|
1811
168
|
this.reference === void 0 ? this.element.appendChild(e) : this.element.insertBefore(e, this.reference);
|
|
1812
|
-
}
|
|
169
|
+
}
|
|
1813
170
|
/**
|
|
1814
171
|
* Creates a new `DOMContext` instance with the provided `element`.
|
|
1815
172
|
* @param element - The DOM element to use in the new `DOMContext` instance.
|
|
1816
173
|
* @returns A new `DOMContext` instance with the provided `element`.
|
|
1817
174
|
*/
|
|
1818
|
-
withElement
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
175
|
+
withElement(e) {
|
|
176
|
+
return new T(
|
|
177
|
+
e.ownerDocument ?? this.document,
|
|
178
|
+
e,
|
|
179
|
+
void 0,
|
|
180
|
+
this.providers
|
|
181
|
+
);
|
|
182
|
+
}
|
|
1824
183
|
/**
|
|
1825
184
|
* Creates a portal to render content in a different part of the DOM tree.
|
|
1826
185
|
*
|
|
@@ -1865,19 +224,26 @@ class te {
|
|
|
1865
224
|
* @returns A new DOMContext focused on the portal target element
|
|
1866
225
|
* @throws {Error} When the selector doesn't match any element in the document
|
|
1867
226
|
*/
|
|
1868
|
-
makePortal
|
|
227
|
+
makePortal(e) {
|
|
1869
228
|
const t = typeof e == "string" ? this.document.querySelector(e) : e;
|
|
1870
229
|
if (t == null)
|
|
1871
230
|
throw new Error(`Cannot find element by selector for portal: ${e}`);
|
|
1872
231
|
return this.withElement(t);
|
|
1873
|
-
}
|
|
232
|
+
}
|
|
1874
233
|
/**
|
|
1875
234
|
* Creates a new `DOMContext` instance with the specified reference.
|
|
1876
235
|
*
|
|
1877
|
-
* @param reference - The optional `
|
|
236
|
+
* @param reference - The optional `Node` to use as the reference for the new `DOMContext`.
|
|
1878
237
|
* @returns A new `DOMContext` instance with the specified reference.
|
|
1879
238
|
*/
|
|
1880
|
-
withReference
|
|
239
|
+
withReference(e) {
|
|
240
|
+
return new T(
|
|
241
|
+
this.document,
|
|
242
|
+
this.element,
|
|
243
|
+
e,
|
|
244
|
+
this.providers
|
|
245
|
+
);
|
|
246
|
+
}
|
|
1881
247
|
/**
|
|
1882
248
|
* Sets a provider for the given provider mark.
|
|
1883
249
|
*
|
|
@@ -1885,10 +251,12 @@ class te {
|
|
|
1885
251
|
* @param value - The provider to set for the given mark.
|
|
1886
252
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1887
253
|
*/
|
|
1888
|
-
setProvider
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
254
|
+
setProvider(e, t, r) {
|
|
255
|
+
return new T(this.document, this.element, this.reference, {
|
|
256
|
+
...this.providers,
|
|
257
|
+
[e]: [t, r]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
1892
260
|
/**
|
|
1893
261
|
* Retrieves a provider for the given provider mark.
|
|
1894
262
|
*
|
|
@@ -1896,34 +264,36 @@ class te {
|
|
|
1896
264
|
* @returns The provider for the given mark.
|
|
1897
265
|
* @throws Throws `ProviderNotFoundError` if the provider for the given mark is not found.
|
|
1898
266
|
*/
|
|
1899
|
-
getProvider
|
|
267
|
+
getProvider(e) {
|
|
1900
268
|
if (this.providers[e] === void 0)
|
|
1901
|
-
throw new
|
|
1902
|
-
const [t,
|
|
1903
|
-
return { value: t, onUse:
|
|
1904
|
-
}
|
|
1905
|
-
clear
|
|
1906
|
-
e && (this.reference !== void 0 ?
|
|
1907
|
-
}
|
|
269
|
+
throw new J(e);
|
|
270
|
+
const [t, r] = this.providers[e];
|
|
271
|
+
return { value: t, onUse: r };
|
|
272
|
+
}
|
|
273
|
+
clear(e) {
|
|
274
|
+
e && (this.reference !== void 0 ? $(this.reference) : $(this.element));
|
|
275
|
+
}
|
|
1908
276
|
/**
|
|
1909
277
|
* Adds classes to the element.
|
|
1910
278
|
* @param tokens - The class names to add.
|
|
1911
279
|
*/
|
|
1912
|
-
addClasses
|
|
280
|
+
addClasses(e) {
|
|
1913
281
|
this.element.classList.add(...e);
|
|
1914
|
-
}
|
|
282
|
+
}
|
|
1915
283
|
/**
|
|
1916
284
|
* Removes classes from the element.
|
|
1917
285
|
* @param tokens - The class names to remove.
|
|
1918
286
|
*/
|
|
1919
|
-
removeClasses
|
|
287
|
+
removeClasses(e) {
|
|
1920
288
|
this.element.classList.remove(...e);
|
|
1921
|
-
}
|
|
289
|
+
}
|
|
1922
290
|
/**
|
|
1923
291
|
* Gets the classes of the element.
|
|
1924
292
|
* @returns The classes of the element.
|
|
1925
293
|
*/
|
|
1926
|
-
getClasses
|
|
294
|
+
getClasses() {
|
|
295
|
+
return Array.from(this.element.classList);
|
|
296
|
+
}
|
|
1927
297
|
/**
|
|
1928
298
|
* Adds an event listener to the element.
|
|
1929
299
|
* @param event - The event to listen for.
|
|
@@ -1931,99 +301,146 @@ class te {
|
|
|
1931
301
|
* @param options - The options for the event listener.
|
|
1932
302
|
* @returns A function to remove the event listener.
|
|
1933
303
|
*/
|
|
1934
|
-
on
|
|
1935
|
-
const
|
|
1936
|
-
return this.element.addEventListener(e,
|
|
1937
|
-
|
|
304
|
+
on(e, t, r) {
|
|
305
|
+
const s = (o) => t(o, this);
|
|
306
|
+
return this.element.addEventListener(e, s, r), (o) => {
|
|
307
|
+
o && this.element.removeEventListener(e, s, r);
|
|
1938
308
|
};
|
|
1939
|
-
}
|
|
309
|
+
}
|
|
1940
310
|
/**
|
|
1941
311
|
* Returns `true` if the context is a browser DOM context.
|
|
1942
312
|
* @returns `true` if the context is a browser DOM context.
|
|
1943
313
|
* @deprecated Use `isBrowser()` instead.
|
|
1944
314
|
*/
|
|
1945
|
-
isBrowserDOM
|
|
315
|
+
isBrowserDOM() {
|
|
316
|
+
return !0;
|
|
317
|
+
}
|
|
1946
318
|
/**
|
|
1947
319
|
* Returns `true` if the context is a browser context.
|
|
1948
320
|
* @returns `true` if the context is a browser context.
|
|
1949
321
|
*/
|
|
1950
|
-
isBrowser
|
|
322
|
+
isBrowser() {
|
|
323
|
+
return !0;
|
|
324
|
+
}
|
|
1951
325
|
/**
|
|
1952
326
|
* Returns `true` if the context is a headless DOM context.
|
|
1953
327
|
* @returns `true` if the context is a headless DOM context.
|
|
1954
328
|
*/
|
|
1955
|
-
isHeadlessDOM
|
|
329
|
+
isHeadlessDOM() {
|
|
330
|
+
return !1;
|
|
331
|
+
}
|
|
1956
332
|
/**
|
|
1957
333
|
* Returns `true` if the context is a headless context.
|
|
1958
334
|
* @returns `true` if the context is a headless context.
|
|
1959
335
|
*/
|
|
1960
|
-
isHeadless
|
|
336
|
+
isHeadless() {
|
|
337
|
+
return !1;
|
|
338
|
+
}
|
|
1961
339
|
/**
|
|
1962
340
|
* Sets the style of the element.
|
|
1963
341
|
* @param name - The name of the style to set.
|
|
1964
342
|
* @param value - The value of the style to set.
|
|
1965
343
|
*/
|
|
1966
|
-
setStyle
|
|
344
|
+
setStyle(e, t) {
|
|
1967
345
|
this.element.style[e] = t;
|
|
1968
|
-
}
|
|
346
|
+
}
|
|
1969
347
|
/**
|
|
1970
348
|
* Gets the style of the element.
|
|
1971
349
|
* @param name - The name of the style to get.
|
|
1972
350
|
* @returns The value of the style.
|
|
1973
351
|
*/
|
|
1974
|
-
getStyle
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
352
|
+
getStyle(e) {
|
|
353
|
+
return this.element.style[e];
|
|
354
|
+
}
|
|
355
|
+
makeAccessors(e) {
|
|
356
|
+
return {
|
|
357
|
+
get: xe(e, this.element),
|
|
358
|
+
set: Se(e, this.element)
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
getWindow() {
|
|
362
|
+
return this.document.defaultView;
|
|
363
|
+
}
|
|
364
|
+
moveRangeBefore(e, t, r) {
|
|
365
|
+
const s = e.reference, o = t.reference, i = r.reference, l = this.element;
|
|
366
|
+
let c = s;
|
|
367
|
+
for (; c !== null; ) {
|
|
368
|
+
const a = c.nextSibling;
|
|
369
|
+
if (l.insertBefore(c, i), c === o) break;
|
|
370
|
+
c = a;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
removeRange(e, t) {
|
|
374
|
+
const r = e.reference, s = t.reference, o = this.element;
|
|
375
|
+
let i = r;
|
|
376
|
+
for (; i !== null; ) {
|
|
377
|
+
const l = i.nextSibling;
|
|
378
|
+
if (o.removeChild(i), i === s) break;
|
|
379
|
+
i = l;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
removeAllBefore(e) {
|
|
383
|
+
const t = e.reference, r = this.element;
|
|
384
|
+
if (!r.firstChild || r.firstChild === t) return;
|
|
385
|
+
const s = this.document.createRange();
|
|
386
|
+
s.setStartBefore(r.firstChild), s.setEndBefore(t), s.deleteContents();
|
|
387
|
+
}
|
|
388
|
+
_detachedParent = null;
|
|
389
|
+
_detachedNext = null;
|
|
390
|
+
detach() {
|
|
391
|
+
const e = this.element;
|
|
392
|
+
e.parentNode && (this._detachedParent = e.parentNode, this._detachedNext = e.nextSibling, e.remove());
|
|
393
|
+
}
|
|
394
|
+
reattach() {
|
|
395
|
+
this._detachedParent && (this._detachedParent.insertBefore(this.element, this._detachedNext), this._detachedParent = null, this._detachedNext = null);
|
|
396
|
+
}
|
|
1980
397
|
}
|
|
1981
|
-
const
|
|
1982
|
-
const t = new
|
|
1983
|
-
return (
|
|
1984
|
-
t.dispose(),
|
|
1985
|
-
};
|
|
1986
|
-
},
|
|
1987
|
-
const
|
|
1988
|
-
if (
|
|
1989
|
-
throw new
|
|
398
|
+
const H = (n, e) => {
|
|
399
|
+
const t = new pe(), r = me(t, () => n.render(e));
|
|
400
|
+
return (s = !0) => {
|
|
401
|
+
t.dispose(), r(s);
|
|
402
|
+
};
|
|
403
|
+
}, gt = (n, e, { doc: t, clear: r, disposeWithParent: s = !0, providers: o = {} } = {}) => {
|
|
404
|
+
const i = typeof e == "string" ? (t ?? document).querySelector(e) : e;
|
|
405
|
+
if (i === null)
|
|
406
|
+
throw new Ae(
|
|
1990
407
|
`Cannot find element by selector for render: ${e}`
|
|
1991
408
|
);
|
|
1992
|
-
|
|
1993
|
-
const l =
|
|
1994
|
-
let
|
|
1995
|
-
return
|
|
1996
|
-
|
|
1997
|
-
|
|
409
|
+
r !== !1 && (t ?? i.ownerDocument) != null && (i.nodeType === 1 || i.nodeType === 11) && (i.innerHTML = "");
|
|
410
|
+
const l = we(i), c = te(i) || ne(i) ? void 0 : i, a = T.of(l, c, o), d = H(n, a);
|
|
411
|
+
let m;
|
|
412
|
+
return s && i.parentElement != null && (m = new MutationObserver((u) => {
|
|
413
|
+
u[0]?.removedNodes.forEach((h) => {
|
|
414
|
+
h === i && (m?.disconnect(), d(i.nodeType !== 1));
|
|
1998
415
|
});
|
|
1999
|
-
}),
|
|
416
|
+
}), m.observe(i.parentElement, {
|
|
2000
417
|
childList: !0,
|
|
2001
418
|
subtree: !1,
|
|
2002
419
|
attributes: !1
|
|
2003
420
|
})), () => {
|
|
2004
|
-
|
|
421
|
+
m?.disconnect(), d(!0);
|
|
2005
422
|
};
|
|
2006
|
-
},
|
|
423
|
+
}, bt = (n, {
|
|
2007
424
|
startUrl: e = "https://example.com",
|
|
2008
425
|
selector: t,
|
|
2009
|
-
providers:
|
|
426
|
+
providers: r = {}
|
|
2010
427
|
} = {
|
|
2011
428
|
selector: "body"
|
|
2012
429
|
}) => {
|
|
2013
|
-
const
|
|
430
|
+
const s = _.toSignal(e).deriveProp(), o = new oe(t, void 0), i = new v(o, void 0, { currentURL: s }, r);
|
|
2014
431
|
return {
|
|
2015
|
-
clear:
|
|
2016
|
-
root:
|
|
2017
|
-
currentURL:
|
|
432
|
+
clear: H(n(), i),
|
|
433
|
+
root: o,
|
|
434
|
+
currentURL: s
|
|
2018
435
|
};
|
|
2019
436
|
};
|
|
2020
|
-
class
|
|
437
|
+
class Ae extends Error {
|
|
2021
438
|
constructor(e) {
|
|
2022
439
|
super(e);
|
|
2023
440
|
}
|
|
2024
441
|
}
|
|
2025
|
-
const
|
|
2026
|
-
class
|
|
442
|
+
const V = "data-tts-node", E = "data-tts-class", P = "data-tts-style", M = "data-tts-html", O = "data-tts-text", L = "data-tts-attrs";
|
|
443
|
+
class yt {
|
|
2027
444
|
/**
|
|
2028
445
|
* Selects elements from the headless environment.
|
|
2029
446
|
* @param selector - The selector to select elements from. The supported selectors are CSS selectors whose complexity depends on the adapter implementation.
|
|
@@ -2100,18 +517,18 @@ class Es {
|
|
|
2100
517
|
constructor({
|
|
2101
518
|
select: e,
|
|
2102
519
|
getAttribute: t,
|
|
2103
|
-
setAttribute:
|
|
2104
|
-
getClass:
|
|
2105
|
-
setClass:
|
|
2106
|
-
getStyles:
|
|
520
|
+
setAttribute: r,
|
|
521
|
+
getClass: s,
|
|
522
|
+
setClass: o,
|
|
523
|
+
getStyles: i,
|
|
2107
524
|
setStyles: l,
|
|
2108
|
-
appendHTML:
|
|
2109
|
-
getInnerHTML:
|
|
2110
|
-
setInnerHTML:
|
|
2111
|
-
getInnerText:
|
|
2112
|
-
setInnerText:
|
|
525
|
+
appendHTML: c,
|
|
526
|
+
getInnerHTML: a,
|
|
527
|
+
setInnerHTML: d,
|
|
528
|
+
getInnerText: m,
|
|
529
|
+
setInnerText: u
|
|
2113
530
|
}) {
|
|
2114
|
-
this.select = e, this.getAttribute = t, this.setAttribute =
|
|
531
|
+
this.select = e, this.getAttribute = t, this.setAttribute = r, this.getClass = s, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = d, this.getInnerText = m, this.setInnerText = u;
|
|
2115
532
|
}
|
|
2116
533
|
/**
|
|
2117
534
|
* Sets the content of the root element from a HeadlessPortal. Generally this will be the same instance that is
|
|
@@ -2122,224 +539,264 @@ class Es {
|
|
|
2122
539
|
* when you render on the server and then hydrate on the client.
|
|
2123
540
|
*/
|
|
2124
541
|
setFromRoot = (e, t) => {
|
|
2125
|
-
e.getPortals().forEach((
|
|
2126
|
-
const
|
|
2127
|
-
for (const
|
|
2128
|
-
if (
|
|
542
|
+
e.getPortals().forEach((s) => {
|
|
543
|
+
const o = typeof s.selector == "string" ? this.select(s.selector) : [s.selector];
|
|
544
|
+
for (const i of o) {
|
|
545
|
+
if (i == null)
|
|
2129
546
|
throw new Error(
|
|
2130
|
-
`Cannot find element by selector for render: ${
|
|
547
|
+
`Cannot find element by selector for render: ${s.selector}`
|
|
2131
548
|
);
|
|
2132
|
-
if (
|
|
549
|
+
if (s.hasChildren() && this.appendHTML(i, s.contentToHTML(t)), s.hasInnerHTML()) {
|
|
2133
550
|
if (t) {
|
|
2134
|
-
const l = this.getInnerHTML(
|
|
2135
|
-
l != null && this.setAttribute(
|
|
551
|
+
const l = this.getInnerHTML(i);
|
|
552
|
+
l != null && this.setAttribute(i, M, l);
|
|
2136
553
|
}
|
|
2137
|
-
this.setInnerHTML(
|
|
554
|
+
this.setInnerHTML(i, s.getInnerHTML());
|
|
2138
555
|
}
|
|
2139
|
-
if (
|
|
556
|
+
if (s.hasInnerText()) {
|
|
2140
557
|
if (t) {
|
|
2141
|
-
const l = this.getInnerText(
|
|
2142
|
-
l != null && this.setAttribute(
|
|
558
|
+
const l = this.getInnerText(i);
|
|
559
|
+
l != null && this.setAttribute(i, O, l);
|
|
2143
560
|
}
|
|
2144
|
-
this.setInnerText(
|
|
561
|
+
this.setInnerText(i, s.getInnerText());
|
|
2145
562
|
}
|
|
2146
|
-
if (
|
|
563
|
+
if (s.hasClasses()) {
|
|
2147
564
|
if (t) {
|
|
2148
|
-
const l = this.getClass(
|
|
2149
|
-
l != null && this.setAttribute(
|
|
565
|
+
const l = this.getClass(i);
|
|
566
|
+
l != null && this.setAttribute(i, E, l);
|
|
2150
567
|
}
|
|
2151
|
-
this.setClass(
|
|
568
|
+
this.setClass(i, s.getClasses().join(" "));
|
|
2152
569
|
}
|
|
2153
|
-
if (
|
|
570
|
+
if (s.hasStyles()) {
|
|
2154
571
|
if (t) {
|
|
2155
|
-
const l = this.getStyles(
|
|
572
|
+
const l = this.getStyles(i);
|
|
2156
573
|
Object.keys(l).length > 0 && this.setAttribute(
|
|
2157
|
-
|
|
2158
|
-
|
|
574
|
+
i,
|
|
575
|
+
P,
|
|
2159
576
|
JSON.stringify(l)
|
|
2160
577
|
);
|
|
2161
578
|
}
|
|
2162
|
-
this.setStyles(
|
|
579
|
+
this.setStyles(i, s.getStyles());
|
|
2163
580
|
}
|
|
2164
|
-
if (
|
|
2165
|
-
const l =
|
|
581
|
+
if (s.hasAttributes()) {
|
|
582
|
+
const l = s.getAttributes();
|
|
2166
583
|
if (t) {
|
|
2167
|
-
const
|
|
2168
|
-
l.forEach(([
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2171
|
-
}),
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
JSON.stringify(Object.fromEntries(
|
|
584
|
+
const c = [];
|
|
585
|
+
l.forEach(([a]) => {
|
|
586
|
+
const d = this.getAttribute(i, a);
|
|
587
|
+
d != null && c.push([a, d]);
|
|
588
|
+
}), c.length > 0 && this.setAttribute(
|
|
589
|
+
i,
|
|
590
|
+
L,
|
|
591
|
+
JSON.stringify(Object.fromEntries(c))
|
|
2175
592
|
);
|
|
2176
593
|
}
|
|
2177
|
-
l.forEach(([
|
|
2178
|
-
this.setAttribute(
|
|
594
|
+
l.forEach(([c, a]) => {
|
|
595
|
+
this.setAttribute(i, c, a);
|
|
2179
596
|
});
|
|
2180
597
|
}
|
|
2181
598
|
}
|
|
2182
599
|
});
|
|
2183
600
|
};
|
|
2184
601
|
}
|
|
2185
|
-
const
|
|
2186
|
-
const e =
|
|
2187
|
-
|
|
2188
|
-
},
|
|
2189
|
-
const e =
|
|
2190
|
-
|
|
2191
|
-
},
|
|
2192
|
-
const e =
|
|
2193
|
-
|
|
2194
|
-
},
|
|
2195
|
-
const e =
|
|
2196
|
-
if (
|
|
2197
|
-
const t =
|
|
2198
|
-
|
|
2199
|
-
}
|
|
2200
|
-
},
|
|
2201
|
-
const e =
|
|
2202
|
-
if (
|
|
2203
|
-
const t =
|
|
2204
|
-
Object.entries(t).forEach(([
|
|
2205
|
-
|
|
602
|
+
const re = (n) => JSON.parse(n.replace(/"/g, '"')), ke = (n) => {
|
|
603
|
+
const e = n.getAttribute(E);
|
|
604
|
+
n.removeAttribute(E), e != null && n.setAttribute("class", e);
|
|
605
|
+
}, ve = (n) => {
|
|
606
|
+
const e = n.getAttribute(M);
|
|
607
|
+
n.removeAttribute(M), e != null && (n.innerHTML = e);
|
|
608
|
+
}, Ce = (n) => {
|
|
609
|
+
const e = n.getAttribute(O);
|
|
610
|
+
n.removeAttribute(O), e != null && (n.innerText = e);
|
|
611
|
+
}, Ee = (n) => {
|
|
612
|
+
const e = n.getAttribute(P);
|
|
613
|
+
if (n.removeAttribute(P), e != null) {
|
|
614
|
+
const t = re(e), r = Object.entries(t);
|
|
615
|
+
r.length > 0 && (n.style.cssText = r.map(([s, o]) => `${s}: ${o}`).join("; "));
|
|
616
|
+
}
|
|
617
|
+
}, Pe = (n) => {
|
|
618
|
+
const e = n.getAttribute(L);
|
|
619
|
+
if (n.removeAttribute(L), e != null) {
|
|
620
|
+
const t = re(e);
|
|
621
|
+
Object.entries(t).forEach(([r, s]) => {
|
|
622
|
+
s == null ? n.removeAttribute(r) : n.setAttribute(r, s);
|
|
2206
623
|
});
|
|
2207
624
|
}
|
|
2208
|
-
},
|
|
625
|
+
}, Tt = () => {
|
|
2209
626
|
const e = [
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
].map((
|
|
2217
|
-
document.querySelectorAll(e).forEach((
|
|
2218
|
-
const
|
|
2219
|
-
if (
|
|
2220
|
-
|
|
627
|
+
V,
|
|
628
|
+
E,
|
|
629
|
+
M,
|
|
630
|
+
O,
|
|
631
|
+
P,
|
|
632
|
+
L
|
|
633
|
+
].map((r) => `[${r}]`).join(",");
|
|
634
|
+
document.querySelectorAll(e).forEach((r) => {
|
|
635
|
+
const s = r;
|
|
636
|
+
if (s.hasAttribute(V)) {
|
|
637
|
+
$(s);
|
|
2221
638
|
return;
|
|
2222
639
|
}
|
|
2223
|
-
|
|
640
|
+
s.hasAttribute(E) && ke(s), s.hasAttribute(O) && Ce(s), s.hasAttribute(M) && ve(s), s.hasAttribute(P) && Ee(s), s.hasAttribute(L) && Pe(s);
|
|
2224
641
|
});
|
|
2225
|
-
},
|
|
2226
|
-
class
|
|
642
|
+
}, Me = "data-tempo-id", A = /* @__PURE__ */ Symbol("class"), k = /* @__PURE__ */ Symbol("style"), I = /* @__PURE__ */ Symbol("handler"), se = () => Math.random().toString(36).substring(2, 15), Oe = (n) => n.replace(/<[^>]*>?/g, "");
|
|
643
|
+
class ie {
|
|
2227
644
|
constructor(e) {
|
|
2228
645
|
this.parent = e;
|
|
2229
646
|
}
|
|
2230
|
-
id =
|
|
647
|
+
id = se();
|
|
2231
648
|
properties = {};
|
|
2232
649
|
children = [];
|
|
2233
|
-
isElement
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
650
|
+
isElement() {
|
|
651
|
+
return !0;
|
|
652
|
+
}
|
|
653
|
+
isText() {
|
|
654
|
+
return !1;
|
|
655
|
+
}
|
|
656
|
+
getText() {
|
|
657
|
+
return this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? Oe(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
|
|
658
|
+
}
|
|
659
|
+
removeChild(e) {
|
|
2237
660
|
const t = this.children.indexOf(e);
|
|
2238
661
|
t !== -1 && this.children.splice(t, 1);
|
|
2239
|
-
}
|
|
2240
|
-
remove
|
|
662
|
+
}
|
|
663
|
+
remove() {
|
|
2241
664
|
if (this.parent != null)
|
|
2242
665
|
this.parent.removeChild(this);
|
|
2243
666
|
else
|
|
2244
667
|
throw new Error("Parent is undefined");
|
|
2245
|
-
}
|
|
2246
|
-
getPortals
|
|
668
|
+
}
|
|
669
|
+
getPortals() {
|
|
2247
670
|
const e = this.elements().flatMap((t) => t.isPortal() ? [t, ...t.getPortals()] : t.getPortals());
|
|
2248
671
|
return this.isPortal() && e.unshift(this), e;
|
|
2249
|
-
}
|
|
2250
|
-
elements
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
672
|
+
}
|
|
673
|
+
elements() {
|
|
674
|
+
return this.children.filter((e) => e.isElement());
|
|
675
|
+
}
|
|
676
|
+
hasInnerHTML() {
|
|
677
|
+
return this.properties.innerHTML != null;
|
|
678
|
+
}
|
|
679
|
+
getInnerHTML() {
|
|
680
|
+
return this.properties.innerHTML ?? "";
|
|
681
|
+
}
|
|
682
|
+
getInnerText() {
|
|
683
|
+
return this.properties.innerText ?? "";
|
|
684
|
+
}
|
|
685
|
+
hasInnerText() {
|
|
686
|
+
return this.properties.innerText != null;
|
|
687
|
+
}
|
|
688
|
+
hasChildren() {
|
|
689
|
+
return this.children.length > 0;
|
|
690
|
+
}
|
|
691
|
+
hasClasses() {
|
|
692
|
+
return this.properties[A] != null;
|
|
693
|
+
}
|
|
694
|
+
hasStyles() {
|
|
695
|
+
return this.properties[k] != null;
|
|
696
|
+
}
|
|
697
|
+
hasAttributes() {
|
|
698
|
+
return Object.keys(this.properties).length > 0;
|
|
699
|
+
}
|
|
700
|
+
hasHandlers() {
|
|
701
|
+
return this.properties[I] != null;
|
|
702
|
+
}
|
|
703
|
+
hasRenderableProperties() {
|
|
704
|
+
return this.hasClasses() || this.hasAttributes() || this.hasStyles();
|
|
705
|
+
}
|
|
706
|
+
getById(e) {
|
|
2262
707
|
if (this.properties.id === e)
|
|
2263
708
|
return this;
|
|
2264
709
|
for (const t of this.elements()) {
|
|
2265
|
-
const
|
|
2266
|
-
if (
|
|
2267
|
-
return
|
|
710
|
+
const r = t.getById(e);
|
|
711
|
+
if (r != null)
|
|
712
|
+
return r;
|
|
2268
713
|
}
|
|
2269
|
-
}
|
|
2270
|
-
trigger
|
|
2271
|
-
((this.properties[
|
|
2272
|
-
}
|
|
2273
|
-
click
|
|
714
|
+
}
|
|
715
|
+
trigger(e, t) {
|
|
716
|
+
((this.properties[I] ?? {})[e] ?? []).forEach((s) => s(t));
|
|
717
|
+
}
|
|
718
|
+
click() {
|
|
2274
719
|
this.trigger("click", {});
|
|
2275
|
-
}
|
|
2276
|
-
on
|
|
2277
|
-
const
|
|
2278
|
-
l(), t(
|
|
2279
|
-
} : (
|
|
2280
|
-
|
|
720
|
+
}
|
|
721
|
+
on(e, t, r, s) {
|
|
722
|
+
const o = this.properties[I] ??= {}, i = s?.once ? (c) => {
|
|
723
|
+
l(), t(c, r);
|
|
724
|
+
} : (c) => t(c, r);
|
|
725
|
+
o[e] = [...o[e] ?? [], i];
|
|
2281
726
|
const l = () => {
|
|
2282
|
-
const
|
|
2283
|
-
|
|
727
|
+
const c = o[e] ?? [], a = c.indexOf(i);
|
|
728
|
+
a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[I]) : o[e] = c, s?.signal != null && s.signal.removeEventListener("abort", l));
|
|
2284
729
|
};
|
|
2285
|
-
return
|
|
2286
|
-
}
|
|
2287
|
-
addClasses
|
|
730
|
+
return s?.signal != null && s.signal.addEventListener("abort", l), l;
|
|
731
|
+
}
|
|
732
|
+
addClasses(e) {
|
|
2288
733
|
if (e.length === 0)
|
|
2289
734
|
return;
|
|
2290
|
-
const t = this.properties[
|
|
2291
|
-
for (const
|
|
2292
|
-
|
|
2293
|
-
}
|
|
2294
|
-
removeClasses
|
|
735
|
+
const t = this.properties[A] ??= [], r = new Set(t);
|
|
736
|
+
for (const s of e)
|
|
737
|
+
r.has(s) || (t.push(s), r.add(s));
|
|
738
|
+
}
|
|
739
|
+
removeClasses(e) {
|
|
2295
740
|
if (e.length === 0)
|
|
2296
741
|
return;
|
|
2297
|
-
const t = this.properties[
|
|
2298
|
-
let
|
|
2299
|
-
for (let
|
|
2300
|
-
|
|
2301
|
-
t.length =
|
|
2302
|
-
}
|
|
2303
|
-
getClasses
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
)
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
742
|
+
const t = this.properties[A] ??= [], r = new Set(e);
|
|
743
|
+
let s = 0;
|
|
744
|
+
for (let o = 0; o < t.length; o++)
|
|
745
|
+
r.has(t[o]) || (t[s] = t[o], s++);
|
|
746
|
+
t.length = s, t.length === 0 && delete this.properties[A];
|
|
747
|
+
}
|
|
748
|
+
getClasses() {
|
|
749
|
+
return this.properties[A] ?? [];
|
|
750
|
+
}
|
|
751
|
+
getAttributes() {
|
|
752
|
+
return Object.entries(this.properties).filter(
|
|
753
|
+
([e]) => !["innerText", "innerHTML"].includes(e)
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
getVisibleAttributes() {
|
|
757
|
+
return Reflect.ownKeys(this.properties).flatMap(
|
|
758
|
+
(e) => e === A ? [["class", this.getClasses()]] : e === k ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
setStyle(e, t) {
|
|
762
|
+
const r = this.properties[k] ??= {};
|
|
763
|
+
r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[k]);
|
|
764
|
+
}
|
|
765
|
+
getStyle(e) {
|
|
766
|
+
return this.properties[k]?.[e] ?? "";
|
|
767
|
+
}
|
|
768
|
+
getStyles() {
|
|
769
|
+
return this.properties[k] ?? {};
|
|
770
|
+
}
|
|
771
|
+
makeAccessors(e) {
|
|
2317
772
|
const t = this.properties;
|
|
2318
773
|
return {
|
|
2319
774
|
get: () => t[e],
|
|
2320
|
-
set: (
|
|
775
|
+
set: (r) => t[e] = r
|
|
2321
776
|
};
|
|
2322
|
-
}
|
|
777
|
+
}
|
|
2323
778
|
}
|
|
2324
|
-
const
|
|
2325
|
-
class
|
|
2326
|
-
constructor(e, t,
|
|
2327
|
-
super(
|
|
779
|
+
const Le = (n) => n.replace(/"/g, """), He = (n) => n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
780
|
+
class Ne extends ie {
|
|
781
|
+
constructor(e, t, r) {
|
|
782
|
+
super(r), this.tagName = e, this.namespace = t;
|
|
783
|
+
}
|
|
784
|
+
isPortal() {
|
|
785
|
+
return !1;
|
|
2328
786
|
}
|
|
2329
|
-
isPortal = () => !1;
|
|
2330
787
|
/**
|
|
2331
788
|
* Builds the attributes string for this element.
|
|
2332
789
|
* Returns an object containing the attributes string and any innerHTML value.
|
|
2333
790
|
*/
|
|
2334
|
-
buildAttributesString
|
|
791
|
+
buildAttributesString(e) {
|
|
2335
792
|
let t = null;
|
|
2336
|
-
const
|
|
2337
|
-
return { attrs: `${
|
|
2338
|
-
}
|
|
2339
|
-
toHTML
|
|
2340
|
-
const t = this.children.map((
|
|
2341
|
-
return
|
|
2342
|
-
}
|
|
793
|
+
const r = this.namespace ? ` xmlns="${this.namespace}"` : "", s = this.getVisibleAttributes().map(([i, l]) => i === "class" ? ` class="${l.join(" ")}"` : i === "style" ? typeof l == "string" ? ` style="${l}"` : ` style="${Object.entries(l).map(([c, a]) => `${c}: ${a};`).join(" ")}"` : Ie.has(i) ? ` ${i}` : i === "innerHTML" ? (t = l, "") : i === "innerText" ? (t = He(l), "") : ` ${i}="${Le(l)}"`).join(""), o = e ? ` ${V} ${Me}="${this.id}"` : "";
|
|
794
|
+
return { attrs: `${r}${s}${o}`, innerHTML: t };
|
|
795
|
+
}
|
|
796
|
+
toHTML(e = !1) {
|
|
797
|
+
const t = this.children.map((o) => o.toHTML()).join(""), { attrs: r, innerHTML: s } = this.buildAttributesString(e);
|
|
798
|
+
return K.has(this.tagName) && t === "" ? `<${this.tagName}${r} />` : `<${this.tagName}${r}>${s ?? t}</${this.tagName}>`;
|
|
799
|
+
}
|
|
2343
800
|
/**
|
|
2344
801
|
* Generates HTML output as an async stream of string chunks.
|
|
2345
802
|
* Yields the opening tag, then each child's content, then the closing tag.
|
|
@@ -2348,25 +805,29 @@ class It extends ze {
|
|
|
2348
805
|
* @yields String chunks of HTML content.
|
|
2349
806
|
*/
|
|
2350
807
|
async *toHTMLStream(e) {
|
|
2351
|
-
const t = e?.generatePlaceholders ?? !1, { attrs:
|
|
2352
|
-
if (
|
|
2353
|
-
yield `<${this.tagName}${
|
|
808
|
+
const t = e?.generatePlaceholders ?? !1, { attrs: r, innerHTML: s } = this.buildAttributesString(t);
|
|
809
|
+
if (K.has(this.tagName) && this.children.length === 0) {
|
|
810
|
+
yield `<${this.tagName}${r} />`;
|
|
2354
811
|
return;
|
|
2355
812
|
}
|
|
2356
|
-
if (yield `<${this.tagName}${
|
|
2357
|
-
yield
|
|
813
|
+
if (yield `<${this.tagName}${r}>`, s !== null)
|
|
814
|
+
yield s;
|
|
2358
815
|
else
|
|
2359
|
-
for (const
|
|
2360
|
-
yield*
|
|
816
|
+
for (const o of this.children)
|
|
817
|
+
yield* o.toHTMLStream(e);
|
|
2361
818
|
yield `</${this.tagName}>`;
|
|
2362
819
|
}
|
|
2363
820
|
}
|
|
2364
|
-
class
|
|
821
|
+
class oe extends ie {
|
|
2365
822
|
constructor(e, t) {
|
|
2366
823
|
super(t), this.selector = e;
|
|
2367
824
|
}
|
|
2368
|
-
isPortal
|
|
2369
|
-
|
|
825
|
+
isPortal() {
|
|
826
|
+
return !0;
|
|
827
|
+
}
|
|
828
|
+
toHTML() {
|
|
829
|
+
return "";
|
|
830
|
+
}
|
|
2370
831
|
/**
|
|
2371
832
|
* Portals don't render inline - they render at their target selector.
|
|
2372
833
|
* This method yields nothing for the inline position.
|
|
@@ -2374,7 +835,9 @@ class Ye extends ze {
|
|
|
2374
835
|
// eslint-disable-next-line require-yield
|
|
2375
836
|
async *toHTMLStream(e) {
|
|
2376
837
|
}
|
|
2377
|
-
contentToHTML
|
|
838
|
+
contentToHTML(e = !1) {
|
|
839
|
+
return this.children.map((t) => t.toHTML(e)).join("");
|
|
840
|
+
}
|
|
2378
841
|
/**
|
|
2379
842
|
* Streams the portal's content HTML.
|
|
2380
843
|
* Unlike toHTMLStream, this yields the actual content for rendering at the target location.
|
|
@@ -2387,15 +850,23 @@ class Ye extends ze {
|
|
|
2387
850
|
yield* t.toHTMLStream(e);
|
|
2388
851
|
}
|
|
2389
852
|
}
|
|
2390
|
-
class
|
|
853
|
+
class De {
|
|
2391
854
|
constructor(e) {
|
|
2392
855
|
this.text = e;
|
|
2393
856
|
}
|
|
2394
|
-
id =
|
|
2395
|
-
isElement
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
857
|
+
id = se();
|
|
858
|
+
isElement() {
|
|
859
|
+
return !1;
|
|
860
|
+
}
|
|
861
|
+
isText() {
|
|
862
|
+
return !0;
|
|
863
|
+
}
|
|
864
|
+
getText() {
|
|
865
|
+
return this.text;
|
|
866
|
+
}
|
|
867
|
+
toHTML() {
|
|
868
|
+
return this.text;
|
|
869
|
+
}
|
|
2399
870
|
/**
|
|
2400
871
|
* Streams the text content as a single chunk.
|
|
2401
872
|
*
|
|
@@ -2406,49 +877,56 @@ class $t {
|
|
|
2406
877
|
yield this.text;
|
|
2407
878
|
}
|
|
2408
879
|
}
|
|
2409
|
-
class
|
|
2410
|
-
constructor(e, t,
|
|
2411
|
-
this.element = e, this.reference = t, this.container =
|
|
880
|
+
class v {
|
|
881
|
+
constructor(e, t, r, s) {
|
|
882
|
+
this.element = e, this.reference = t, this.container = r, this.providers = s;
|
|
2412
883
|
}
|
|
2413
|
-
appendOrInsert
|
|
884
|
+
appendOrInsert(e) {
|
|
2414
885
|
if (this.reference != null) {
|
|
2415
886
|
const t = this.element.children.indexOf(this.reference);
|
|
2416
887
|
t >= 0 && this.element.children.splice(t, 0, e);
|
|
2417
888
|
} else
|
|
2418
889
|
this.element.children.push(e);
|
|
2419
|
-
}
|
|
2420
|
-
makeChildElement
|
|
2421
|
-
const
|
|
2422
|
-
return this.appendOrInsert(
|
|
2423
|
-
|
|
890
|
+
}
|
|
891
|
+
makeChildElement(e, t) {
|
|
892
|
+
const r = new Ne(e, t, this.element);
|
|
893
|
+
return this.appendOrInsert(r), new v(
|
|
894
|
+
r,
|
|
2424
895
|
void 0,
|
|
2425
896
|
this.container,
|
|
2426
897
|
this.providers
|
|
2427
898
|
);
|
|
2428
|
-
}
|
|
2429
|
-
makeChildText
|
|
2430
|
-
const t = new
|
|
2431
|
-
return this.appendOrInsert(t), new
|
|
899
|
+
}
|
|
900
|
+
makeChildText(e) {
|
|
901
|
+
const t = new De(String(e));
|
|
902
|
+
return this.appendOrInsert(t), new v(
|
|
2432
903
|
this.element,
|
|
2433
904
|
t,
|
|
2434
905
|
this.container,
|
|
2435
906
|
this.providers
|
|
2436
907
|
);
|
|
2437
|
-
}
|
|
2438
|
-
setText
|
|
2439
|
-
this.reference && this.reference.isText() && (this.reference.text = e);
|
|
2440
|
-
}
|
|
2441
|
-
getText
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
return this.
|
|
908
|
+
}
|
|
909
|
+
setText(e) {
|
|
910
|
+
this.reference && this.reference.isText() && (this.reference.text = String(e));
|
|
911
|
+
}
|
|
912
|
+
getText() {
|
|
913
|
+
return this.reference?.getText() ?? this.element.getText();
|
|
914
|
+
}
|
|
915
|
+
makeRef() {
|
|
916
|
+
return this.makeChildText("");
|
|
917
|
+
}
|
|
918
|
+
makeMarker() {
|
|
919
|
+
return this.makeChildText("");
|
|
920
|
+
}
|
|
921
|
+
makePortal(e) {
|
|
922
|
+
const t = new oe(e, this.element);
|
|
923
|
+
return this.appendOrInsert(t), new v(
|
|
2446
924
|
t,
|
|
2447
925
|
void 0,
|
|
2448
926
|
this.container,
|
|
2449
927
|
this.providers
|
|
2450
928
|
);
|
|
2451
|
-
}
|
|
929
|
+
}
|
|
2452
930
|
/**
|
|
2453
931
|
* Sets a provider for the given provider mark.
|
|
2454
932
|
*
|
|
@@ -2456,105 +934,361 @@ class se {
|
|
|
2456
934
|
* @param value - The provider to set for the given mark.
|
|
2457
935
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
2458
936
|
*/
|
|
2459
|
-
setProvider
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
937
|
+
setProvider(e, t, r) {
|
|
938
|
+
return new v(this.element, this.reference, this.container, {
|
|
939
|
+
...this.providers,
|
|
940
|
+
[e]: [t, r]
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
getProvider(e) {
|
|
2464
944
|
if (this.providers[e] === void 0)
|
|
2465
|
-
throw new
|
|
2466
|
-
const [t,
|
|
2467
|
-
return { value: t, onUse:
|
|
2468
|
-
}
|
|
2469
|
-
clear
|
|
945
|
+
throw new J(e);
|
|
946
|
+
const [t, r] = this.providers[e];
|
|
947
|
+
return { value: t, onUse: r };
|
|
948
|
+
}
|
|
949
|
+
clear(e) {
|
|
2470
950
|
e && (this.reference !== void 0 ? this.element.removeChild(this.reference) : this.element.remove());
|
|
2471
|
-
}
|
|
2472
|
-
on
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
951
|
+
}
|
|
952
|
+
on(e, t) {
|
|
953
|
+
return this.element.on(e, t, this);
|
|
954
|
+
}
|
|
955
|
+
addClasses(e) {
|
|
956
|
+
this.element.addClasses(e);
|
|
957
|
+
}
|
|
958
|
+
removeClasses(e) {
|
|
959
|
+
this.element.removeClasses(e);
|
|
960
|
+
}
|
|
961
|
+
getClasses() {
|
|
962
|
+
return this.element.getClasses();
|
|
963
|
+
}
|
|
964
|
+
isBrowserDOM() {
|
|
965
|
+
return !1;
|
|
966
|
+
}
|
|
967
|
+
isBrowser() {
|
|
968
|
+
return !1;
|
|
969
|
+
}
|
|
970
|
+
isHeadlessDOM() {
|
|
971
|
+
return !0;
|
|
972
|
+
}
|
|
973
|
+
isHeadless() {
|
|
974
|
+
return !0;
|
|
975
|
+
}
|
|
976
|
+
setStyle(e, t) {
|
|
977
|
+
this.element.setStyle(e, t);
|
|
978
|
+
}
|
|
979
|
+
getStyle(e) {
|
|
980
|
+
return this.element.getStyle(e);
|
|
981
|
+
}
|
|
982
|
+
makeAccessors(e) {
|
|
983
|
+
return this.element.makeAccessors(e);
|
|
984
|
+
}
|
|
985
|
+
moveRangeBefore(e, t, r) {
|
|
986
|
+
const s = e.reference, o = t.reference, i = r.reference, l = this.element.children, c = l.indexOf(s), d = l.indexOf(o) - c + 1, m = l.splice(c, d), u = l.indexOf(i);
|
|
987
|
+
l.splice(u, 0, ...m);
|
|
988
|
+
}
|
|
989
|
+
removeRange(e, t) {
|
|
990
|
+
const r = e.reference, s = t.reference, o = this.element.children, i = o.indexOf(r), c = o.indexOf(s) - i + 1;
|
|
991
|
+
o.splice(i, c);
|
|
992
|
+
}
|
|
993
|
+
removeAllBefore(e) {
|
|
994
|
+
const t = e.reference, r = this.element.children, s = r.indexOf(t);
|
|
995
|
+
s > 0 && r.splice(0, s);
|
|
996
|
+
}
|
|
997
|
+
detach() {
|
|
998
|
+
}
|
|
999
|
+
reattach() {
|
|
1000
|
+
}
|
|
2483
1001
|
}
|
|
2484
|
-
const
|
|
1002
|
+
const Ie = /* @__PURE__ */ new Set([
|
|
2485
1003
|
"checked",
|
|
2486
1004
|
"disabled",
|
|
2487
1005
|
"multiple",
|
|
2488
1006
|
"readonly",
|
|
2489
1007
|
"required",
|
|
2490
1008
|
"selected"
|
|
2491
|
-
]),
|
|
1009
|
+
]), K = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), St = () => (
|
|
2492
1010
|
/* c8 ignore next */
|
|
2493
1011
|
typeof window < "u" ? window : void 0
|
|
2494
|
-
),
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
1012
|
+
), le = /* @__PURE__ */ Symbol("DOM_RENDERABLE"), p = (n) => ge(le, n);
|
|
1013
|
+
function Re(n, e) {
|
|
1014
|
+
const t = [], r = e.createDocumentFragment();
|
|
1015
|
+
return W(n, r, [], { count: 0 }, t, e) ? { fragment: r, slots: t, topNodeCount: r.childNodes.length } : null;
|
|
1016
|
+
}
|
|
1017
|
+
function W(n, e, t, r, s, o) {
|
|
1018
|
+
switch (n.kind) {
|
|
1019
|
+
case "element": {
|
|
1020
|
+
const { tag: i, ns: l, children: c } = n, a = l != null ? o.createElementNS(l, i) : o.createElement(i), d = [...t, r.count++];
|
|
1021
|
+
let m = "";
|
|
1022
|
+
for (let h = 0; h < c.length; h++) {
|
|
1023
|
+
const f = c[h];
|
|
1024
|
+
f.kind === "static-attr" && (f.name === "class" ? m += (m ? " " : "") + f.value : a.setAttribute(f.name, f.value));
|
|
1025
|
+
}
|
|
1026
|
+
m && a.setAttribute("class", m), e.appendChild(a);
|
|
1027
|
+
for (let h = 0; h < c.length; h++)
|
|
1028
|
+
c[h].kind === "dynamic-attr" && s.push({ path: d, kind: "dynamic-attr" });
|
|
1029
|
+
const u = { count: 0 };
|
|
1030
|
+
for (let h = 0; h < c.length; h++) {
|
|
1031
|
+
const f = c[h];
|
|
1032
|
+
if (!(f.kind === "static-attr" || f.kind === "dynamic-attr") && !W(f, a, d, u, s, o))
|
|
1033
|
+
return !1;
|
|
1034
|
+
}
|
|
1035
|
+
return !0;
|
|
1036
|
+
}
|
|
1037
|
+
case "static-text":
|
|
1038
|
+
return e.appendChild(o.createTextNode(n.text)), r.count++, !0;
|
|
1039
|
+
case "dynamic-text":
|
|
1040
|
+
return e.appendChild(o.createTextNode("")), s.push({
|
|
1041
|
+
path: [...t, r.count++],
|
|
1042
|
+
kind: "dynamic-text"
|
|
1043
|
+
}), !0;
|
|
1044
|
+
case "fragment": {
|
|
1045
|
+
const { children: i } = n;
|
|
1046
|
+
for (let l = 0; l < i.length; l++)
|
|
1047
|
+
if (!W(i[l], e, t, r, s, o))
|
|
1048
|
+
return !1;
|
|
1049
|
+
return !0;
|
|
1050
|
+
}
|
|
1051
|
+
case "empty":
|
|
1052
|
+
return !0;
|
|
1053
|
+
default:
|
|
1054
|
+
return n.kind === void 0 ? (e.appendChild(o.createComment("")), s.push({
|
|
1055
|
+
path: [...t, r.count++],
|
|
1056
|
+
kind: "slot"
|
|
1057
|
+
}), !0) : !1;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
function _e(n, e) {
|
|
1061
|
+
let t = n;
|
|
1062
|
+
for (let r = 0; r < e.length; r++)
|
|
1063
|
+
t = t.childNodes[e[r]];
|
|
1064
|
+
return t;
|
|
1065
|
+
}
|
|
1066
|
+
function $e(n, e, t) {
|
|
1067
|
+
const r = e, s = n.fragment.cloneNode(!0), o = n.topNodeCount, i = new Array(o);
|
|
1068
|
+
let l = s.firstChild;
|
|
1069
|
+
for (let u = 0; u < o; u++)
|
|
1070
|
+
i[u] = l, l = l.nextSibling;
|
|
1071
|
+
const c = n.slots.length, a = new Array(c);
|
|
1072
|
+
for (let u = 0; u < c; u++)
|
|
1073
|
+
a[u] = _e(s, n.slots[u].path);
|
|
1074
|
+
r.appendOrInsert(s);
|
|
1075
|
+
const d = new Array(c);
|
|
1076
|
+
for (let u = 0; u < c; u++) {
|
|
1077
|
+
const h = n.slots[u], f = a[u];
|
|
1078
|
+
if (h.kind === "dynamic-text") {
|
|
1079
|
+
const y = t[u], g = f;
|
|
1080
|
+
g.textContent = y.transform(y.source.value), d[u] = y.source.onChange((w) => {
|
|
1081
|
+
g.textContent = y.transform(w);
|
|
1082
|
+
});
|
|
1083
|
+
} else if (h.kind === "dynamic-attr") {
|
|
1084
|
+
const y = t[u], g = new T(
|
|
1085
|
+
r.document,
|
|
1086
|
+
f,
|
|
1087
|
+
void 0,
|
|
1088
|
+
r.providers
|
|
1089
|
+
);
|
|
1090
|
+
d[u] = y.render(g);
|
|
1091
|
+
} else {
|
|
1092
|
+
const y = t[u], g = f, w = new T(
|
|
1093
|
+
r.document,
|
|
1094
|
+
g.parentNode,
|
|
1095
|
+
g,
|
|
1096
|
+
r.providers
|
|
1097
|
+
);
|
|
1098
|
+
d[u] = y.render(w), g.remove();
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
const m = new T(
|
|
1102
|
+
r.document,
|
|
1103
|
+
r.element,
|
|
1104
|
+
i[0],
|
|
1105
|
+
r.providers
|
|
2540
1106
|
);
|
|
2541
|
-
return
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
}
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
o(), l && r(i);
|
|
1107
|
+
return {
|
|
1108
|
+
clear: (u) => {
|
|
1109
|
+
for (let h = 0; h < c; h++)
|
|
1110
|
+
d[h](u);
|
|
1111
|
+
if (u)
|
|
1112
|
+
for (let h = 0; h < o; h++) {
|
|
1113
|
+
const f = i[h];
|
|
1114
|
+
f.parentNode && f.parentNode.removeChild(f);
|
|
1115
|
+
}
|
|
1116
|
+
},
|
|
1117
|
+
startCtx: m
|
|
2553
1118
|
};
|
|
2554
|
-
}
|
|
1119
|
+
}
|
|
1120
|
+
function Be(n) {
|
|
1121
|
+
const e = [];
|
|
1122
|
+
function t(r) {
|
|
1123
|
+
switch (r.kind) {
|
|
1124
|
+
case "element": {
|
|
1125
|
+
const { tag: s, children: o } = r;
|
|
1126
|
+
e.push(`E:${s}`);
|
|
1127
|
+
for (const i of o) if (!t(i)) return !1;
|
|
1128
|
+
e.push("/E");
|
|
1129
|
+
break;
|
|
1130
|
+
}
|
|
1131
|
+
case "static-attr":
|
|
1132
|
+
e.push(`SA:${r.name}=${r.value}`);
|
|
1133
|
+
break;
|
|
1134
|
+
case "dynamic-attr":
|
|
1135
|
+
e.push("DA");
|
|
1136
|
+
break;
|
|
1137
|
+
case "static-text":
|
|
1138
|
+
e.push(`ST:${r.text}`);
|
|
1139
|
+
break;
|
|
1140
|
+
case "dynamic-text":
|
|
1141
|
+
e.push("DT");
|
|
1142
|
+
break;
|
|
1143
|
+
case "fragment": {
|
|
1144
|
+
const { children: s } = r;
|
|
1145
|
+
for (const o of s) if (!t(o)) return !1;
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1148
|
+
case "empty":
|
|
1149
|
+
break;
|
|
1150
|
+
default:
|
|
1151
|
+
if (r.kind === void 0) {
|
|
1152
|
+
e.push("S");
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
return !1;
|
|
1156
|
+
}
|
|
1157
|
+
return !0;
|
|
1158
|
+
}
|
|
1159
|
+
return t(n) ? e.join("|") : null;
|
|
1160
|
+
}
|
|
1161
|
+
function je(n) {
|
|
1162
|
+
const e = [];
|
|
1163
|
+
function t(r) {
|
|
1164
|
+
switch (r.kind) {
|
|
1165
|
+
case "element": {
|
|
1166
|
+
const { children: s } = r;
|
|
1167
|
+
for (const o of s)
|
|
1168
|
+
if (o.kind !== "static-attr") {
|
|
1169
|
+
if (o.kind === "dynamic-attr") {
|
|
1170
|
+
e.push(o);
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
t(o);
|
|
1174
|
+
}
|
|
1175
|
+
break;
|
|
1176
|
+
}
|
|
1177
|
+
case "fragment": {
|
|
1178
|
+
const { children: s } = r;
|
|
1179
|
+
for (const o of s) t(o);
|
|
1180
|
+
break;
|
|
1181
|
+
}
|
|
1182
|
+
case "static-text":
|
|
1183
|
+
case "empty":
|
|
1184
|
+
break;
|
|
1185
|
+
case "dynamic-text":
|
|
1186
|
+
e.push(r);
|
|
1187
|
+
break;
|
|
1188
|
+
default:
|
|
1189
|
+
r.kind === void 0 && e.push(r);
|
|
1190
|
+
break;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
return t(n), e;
|
|
1194
|
+
}
|
|
1195
|
+
const Ve = {
|
|
1196
|
+
build(n, e) {
|
|
1197
|
+
if (!e.isBrowser()) return null;
|
|
1198
|
+
const t = n;
|
|
1199
|
+
if (t.kind === void 0) return null;
|
|
1200
|
+
const r = e.document;
|
|
1201
|
+
return Re(t, r);
|
|
1202
|
+
},
|
|
1203
|
+
cloneAndHydrate(n, e, t) {
|
|
1204
|
+
return $e(n, e, t);
|
|
1205
|
+
},
|
|
1206
|
+
fingerprint(n) {
|
|
1207
|
+
return Be(n);
|
|
1208
|
+
},
|
|
1209
|
+
extractSlots(n) {
|
|
1210
|
+
return je(n);
|
|
1211
|
+
}
|
|
1212
|
+
}, We = Te({
|
|
1213
|
+
type: le,
|
|
1214
|
+
create: p,
|
|
1215
|
+
templateEngine: Ve
|
|
1216
|
+
}), {
|
|
1217
|
+
Empty: Fe,
|
|
1218
|
+
Fragment: S,
|
|
1219
|
+
When: xt,
|
|
1220
|
+
Unless: wt,
|
|
1221
|
+
ForEach: At,
|
|
1222
|
+
KeyedForEach: kt,
|
|
1223
|
+
Repeat: vt,
|
|
1224
|
+
OneOf: Ct,
|
|
1225
|
+
OneOfField: Et,
|
|
1226
|
+
OneOfKind: Pt,
|
|
1227
|
+
OneOfType: Mt,
|
|
1228
|
+
OneOfValue: Ot,
|
|
1229
|
+
OneOfTuple: Lt,
|
|
1230
|
+
MapSignal: Ht,
|
|
1231
|
+
MapText: Nt,
|
|
1232
|
+
Ensure: Dt,
|
|
1233
|
+
EnsureAll: It,
|
|
1234
|
+
NotEmpty: Rt,
|
|
1235
|
+
Task: _t,
|
|
1236
|
+
Async: $t,
|
|
1237
|
+
OnDispose: ce,
|
|
1238
|
+
Conjunction: Bt,
|
|
1239
|
+
WithScope: jt,
|
|
1240
|
+
WithProvider: Vt,
|
|
1241
|
+
Provide: Wt,
|
|
1242
|
+
Use: Ft,
|
|
1243
|
+
UseMany: Kt,
|
|
1244
|
+
handleValueOrSignal: qt,
|
|
1245
|
+
createReactiveRenderable: Gt,
|
|
1246
|
+
renderableOfTNode: C
|
|
1247
|
+
} = We, q = /* @__PURE__ */ new Map();
|
|
1248
|
+
function Ke(n) {
|
|
1249
|
+
let e = q.get(n);
|
|
1250
|
+
return e === void 0 && (e = n.split(" ").filter((t) => t.length > 0), q.set(n, e)), e;
|
|
1251
|
+
}
|
|
1252
|
+
const qe = (n) => {
|
|
1253
|
+
const e = p((t) => (t.addClasses(n), (r) => {
|
|
1254
|
+
r && t.removeClasses(n);
|
|
1255
|
+
}));
|
|
1256
|
+
return e.kind = "static-attr", e.name = "class", e.value = n.join(" "), e;
|
|
1257
|
+
}, Ge = (n) => {
|
|
1258
|
+
const e = p((t) => {
|
|
1259
|
+
let r = [];
|
|
1260
|
+
const s = n.on(
|
|
1261
|
+
(o) => {
|
|
1262
|
+
const i = (o ?? "").split(" ").filter((l) => l.length > 0);
|
|
1263
|
+
r.length > 0 && t.removeClasses(r), i.length > 0 && t.addClasses(i), r = i;
|
|
1264
|
+
},
|
|
1265
|
+
{ noAutoDispose: !0 }
|
|
1266
|
+
);
|
|
1267
|
+
return (o) => {
|
|
1268
|
+
s(), o && t.removeClasses(r), r = [];
|
|
1269
|
+
};
|
|
1270
|
+
});
|
|
1271
|
+
return e.kind = "dynamic-attr", e;
|
|
1272
|
+
}, Ue = (n, e) => {
|
|
1273
|
+
const t = p((r) => {
|
|
1274
|
+
const { get: s, set: o } = r.makeAccessors(n), i = s();
|
|
1275
|
+
return o(e), (l) => {
|
|
1276
|
+
l && o(i);
|
|
1277
|
+
};
|
|
1278
|
+
});
|
|
1279
|
+
return t.kind = "static-attr", t.name = n, t.value = String(e), t;
|
|
1280
|
+
}, Je = (n, e) => {
|
|
1281
|
+
const t = p((r) => {
|
|
1282
|
+
const { get: s, set: o } = r.makeAccessors(n), i = s(), l = e.on(o, { noAutoDispose: !0 });
|
|
1283
|
+
return (c) => {
|
|
1284
|
+
l(), c && o(i);
|
|
1285
|
+
};
|
|
1286
|
+
});
|
|
1287
|
+
return t.kind = "dynamic-attr", t;
|
|
1288
|
+
}, N = (n, e) => B.is(e) ? Je(n, e) : Ue(n, e), Ye = (n, e) => n === "class" ? B.is(e) ? Ge(e) : qe(
|
|
2555
1289
|
/* c8 ignore next */
|
|
2556
1290
|
(e ?? "").split(" ").filter((t) => t.length > 0)
|
|
2557
|
-
) :
|
|
1291
|
+
) : N(n, e), b = new Proxy(
|
|
2558
1292
|
{},
|
|
2559
1293
|
{
|
|
2560
1294
|
/**
|
|
@@ -2568,9 +1302,9 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2568
1302
|
* @returns The renderable component for the specified attribute.
|
|
2569
1303
|
*
|
|
2570
1304
|
*/
|
|
2571
|
-
get: (
|
|
1305
|
+
get: (n, e) => (t) => Ye(e, t)
|
|
2572
1306
|
}
|
|
2573
|
-
),
|
|
1307
|
+
), Xe = (n, e) => N(`data-${n}`, e), Ut = new Proxy(
|
|
2574
1308
|
{},
|
|
2575
1309
|
{
|
|
2576
1310
|
/**
|
|
@@ -2581,9 +1315,9 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2581
1315
|
* @returns The renderable component for the specified attribute.
|
|
2582
1316
|
*
|
|
2583
1317
|
*/
|
|
2584
|
-
get: (
|
|
1318
|
+
get: (n, e) => (t) => Xe(e, t)
|
|
2585
1319
|
}
|
|
2586
|
-
),
|
|
1320
|
+
), ze = (n, e) => N(`aria-${n}`, e), Jt = new Proxy(
|
|
2587
1321
|
{},
|
|
2588
1322
|
{
|
|
2589
1323
|
/**
|
|
@@ -2594,9 +1328,9 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2594
1328
|
* @returns The renderable component for the specified attribute.
|
|
2595
1329
|
*
|
|
2596
1330
|
*/
|
|
2597
|
-
get: (
|
|
1331
|
+
get: (n, e) => (t) => ze(e, t)
|
|
2598
1332
|
}
|
|
2599
|
-
),
|
|
1333
|
+
), Qe = (n, e) => N(n, e), Yt = new Proxy(
|
|
2600
1334
|
{},
|
|
2601
1335
|
{
|
|
2602
1336
|
/**
|
|
@@ -2607,9 +1341,9 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2607
1341
|
* @returns The renderable component for the specified attribute.
|
|
2608
1342
|
*
|
|
2609
1343
|
*/
|
|
2610
|
-
get: (
|
|
1344
|
+
get: (n, e) => (t) => Qe(e, t)
|
|
2611
1345
|
}
|
|
2612
|
-
),
|
|
1346
|
+
), Ze = (n, e) => N(n, e), Xt = new Proxy(
|
|
2613
1347
|
{},
|
|
2614
1348
|
{
|
|
2615
1349
|
/**
|
|
@@ -2619,16 +1353,42 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2619
1353
|
* @returns The renderable component for the specified attribute.
|
|
2620
1354
|
*
|
|
2621
1355
|
*/
|
|
2622
|
-
get: (
|
|
1356
|
+
get: (n, e) => (t) => Ze(e, t)
|
|
2623
1357
|
}
|
|
2624
|
-
),
|
|
1358
|
+
), G = /* @__PURE__ */ new WeakMap();
|
|
1359
|
+
function et(n, e) {
|
|
1360
|
+
let t = G.get(n);
|
|
1361
|
+
return t || (t = be(n, e), G.set(
|
|
1362
|
+
n,
|
|
1363
|
+
t
|
|
1364
|
+
)), t;
|
|
1365
|
+
}
|
|
1366
|
+
const zt = (n, e, t = "danger", r) => {
|
|
1367
|
+
const s = Ke(t), o = p((i) => {
|
|
1368
|
+
const a = et(n, r)(e).on(
|
|
1369
|
+
(d) => {
|
|
1370
|
+
d ? i.addClasses(s) : i.removeClasses(s);
|
|
1371
|
+
},
|
|
1372
|
+
{ noAutoDispose: !0 }
|
|
1373
|
+
);
|
|
1374
|
+
return (d) => {
|
|
1375
|
+
a(), d && i.removeClasses(s);
|
|
1376
|
+
};
|
|
1377
|
+
});
|
|
1378
|
+
return o.kind = "dynamic-attr", o;
|
|
1379
|
+
}, ae = (n, e, t) => {
|
|
1380
|
+
const r = p(
|
|
1381
|
+
(s) => s.on(n, e, t)
|
|
1382
|
+
);
|
|
1383
|
+
return r.kind = "dynamic-attr", r;
|
|
1384
|
+
}, tt = (n) => ae("click", (e, t) => {
|
|
2625
1385
|
e.preventDefault();
|
|
2626
|
-
const
|
|
1386
|
+
const r = e.target;
|
|
2627
1387
|
setTimeout(() => {
|
|
2628
|
-
const
|
|
2629
|
-
|
|
1388
|
+
const s = r.ownerDocument != null ? r?.checked : void 0;
|
|
1389
|
+
s != null && n(!s, t);
|
|
2630
1390
|
}, 0);
|
|
2631
|
-
}),
|
|
1391
|
+
}), D = new Proxy(
|
|
2632
1392
|
{},
|
|
2633
1393
|
{
|
|
2634
1394
|
/**
|
|
@@ -2636,79 +1396,116 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2636
1396
|
* @param fn - The function to call when the event is triggered.
|
|
2637
1397
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
2638
1398
|
*/
|
|
2639
|
-
get: (
|
|
2640
|
-
}
|
|
2641
|
-
),
|
|
2642
|
-
e?.preventDefault === !0 && t.preventDefault(), e?.stopPropagation === !0 && t.stopPropagation(), e?.stopImmediatePropagation === !0 && t.stopImmediatePropagation(),
|
|
2643
|
-
},
|
|
2644
|
-
const
|
|
2645
|
-
|
|
2646
|
-
}, e),
|
|
2647
|
-
(t,
|
|
1399
|
+
get: (n, e) => (t) => ae(e, t)
|
|
1400
|
+
}
|
|
1401
|
+
), nt = (n, e) => (t) => {
|
|
1402
|
+
e?.preventDefault === !0 && t.preventDefault(), e?.stopPropagation === !0 && t.stopPropagation(), e?.stopImmediatePropagation === !0 && t.stopImmediatePropagation(), n(t);
|
|
1403
|
+
}, x = (n, e) => nt((t) => {
|
|
1404
|
+
const r = t.target;
|
|
1405
|
+
n(r, t);
|
|
1406
|
+
}, e), rt = (n, e) => x(
|
|
1407
|
+
(t, r) => n(t.value, r),
|
|
2648
1408
|
e
|
|
2649
|
-
),
|
|
2650
|
-
(t,
|
|
1409
|
+
), st = (n, e) => x(
|
|
1410
|
+
(t, r) => n(t.valueAsNumber, r),
|
|
2651
1411
|
e
|
|
2652
|
-
),
|
|
1412
|
+
), it = (n, e) => x((t, r) => {
|
|
2653
1413
|
if (t.value === "")
|
|
2654
1414
|
return;
|
|
2655
|
-
const
|
|
2656
|
-
Number(
|
|
2657
|
-
Number(
|
|
2658
|
-
Number(
|
|
1415
|
+
const s = t.value.split("-"), o = new Date(
|
|
1416
|
+
Number(s[0]),
|
|
1417
|
+
Number(s[1]) - 1,
|
|
1418
|
+
Number(s[2].substring(0, 2))
|
|
2659
1419
|
);
|
|
2660
|
-
|
|
2661
|
-
}, e),
|
|
1420
|
+
n(o, r);
|
|
1421
|
+
}, e), Qt = (n, e) => x((t, r) => {
|
|
2662
1422
|
if (t.value === "") {
|
|
2663
|
-
|
|
1423
|
+
n(null, r);
|
|
2664
1424
|
return;
|
|
2665
1425
|
}
|
|
2666
|
-
const
|
|
2667
|
-
Number(
|
|
2668
|
-
Number(
|
|
2669
|
-
Number(
|
|
1426
|
+
const s = t.value.split("-"), o = new Date(
|
|
1427
|
+
Number(s[0]),
|
|
1428
|
+
Number(s[1]) - 1,
|
|
1429
|
+
Number(s[2].substring(0, 2))
|
|
2670
1430
|
);
|
|
2671
|
-
|
|
2672
|
-
}, e),
|
|
1431
|
+
n(o, r);
|
|
1432
|
+
}, e), ot = (n, e) => x((t, r) => {
|
|
2673
1433
|
if (t.value === "")
|
|
2674
1434
|
return;
|
|
2675
|
-
const
|
|
2676
|
-
Number(
|
|
2677
|
-
Number(
|
|
2678
|
-
Number(
|
|
2679
|
-
), l =
|
|
2680
|
-
|
|
2681
|
-
}, e),
|
|
1435
|
+
const s = t.value.split("T"), o = s[0].split("-"), i = new Date(
|
|
1436
|
+
Number(o[0]),
|
|
1437
|
+
Number(o[1]) - 1,
|
|
1438
|
+
Number(o[2])
|
|
1439
|
+
), l = s[1].split(":");
|
|
1440
|
+
i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), n(i, r);
|
|
1441
|
+
}, e), Zt = (n, e) => x((t, r) => {
|
|
2682
1442
|
if (t.value === "") {
|
|
2683
|
-
|
|
1443
|
+
n(null, r);
|
|
2684
1444
|
return;
|
|
2685
1445
|
}
|
|
2686
|
-
const
|
|
2687
|
-
if (
|
|
2688
|
-
|
|
1446
|
+
const s = t.value.split("T");
|
|
1447
|
+
if (s.length !== 2) {
|
|
1448
|
+
n(null, r);
|
|
2689
1449
|
return;
|
|
2690
1450
|
}
|
|
2691
|
-
const
|
|
2692
|
-
Number(
|
|
2693
|
-
Number(
|
|
2694
|
-
Number(
|
|
2695
|
-
), l =
|
|
2696
|
-
|
|
2697
|
-
}, e),
|
|
2698
|
-
|
|
2699
|
-
}, e),
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
1451
|
+
const o = s[0].split("-"), i = new Date(
|
|
1452
|
+
Number(o[0]),
|
|
1453
|
+
Number(o[1]) - 1,
|
|
1454
|
+
Number(o[2])
|
|
1455
|
+
), l = s[1].split(":");
|
|
1456
|
+
i.setHours(Number(l[0] ?? 0)), i.setMinutes(Number(l[1] ?? 0)), i.setSeconds(Number(l[2] ?? 0)), n(i, r);
|
|
1457
|
+
}, e), en = (n, e) => x((t, r) => {
|
|
1458
|
+
n(t.checked, r);
|
|
1459
|
+
}, e), tn = (n, e = "input") => S(
|
|
1460
|
+
b.valueAsDate(n),
|
|
1461
|
+
D[e](it((t) => n.set(t)))
|
|
1462
|
+
), nn = (n, e = "input") => S(
|
|
1463
|
+
b.valueAsDate(n),
|
|
1464
|
+
D[e](ot((t) => n.set(t)))
|
|
1465
|
+
), rn = (n, e = "input") => S(
|
|
1466
|
+
b.valueAsNumber(n),
|
|
1467
|
+
D[e](st((t) => n.set(t)))
|
|
1468
|
+
), sn = (n, e = "input") => S(b.value(n), D[e](rt((t) => n.set(t)))), on = (n) => S(
|
|
1469
|
+
b.checked(n),
|
|
1470
|
+
tt((e) => n.set(e))
|
|
1471
|
+
), lt = (n, e, t, r) => {
|
|
1472
|
+
const s = p((o) => {
|
|
1473
|
+
if (!o.isBrowser())
|
|
1474
|
+
return () => {
|
|
1475
|
+
};
|
|
1476
|
+
const i = o.element, l = (c) => {
|
|
1477
|
+
const a = c.target?.closest(e);
|
|
1478
|
+
a != null && i.contains(a) && t(c, o);
|
|
1479
|
+
};
|
|
1480
|
+
return i.addEventListener(n, l, r), (c) => {
|
|
1481
|
+
c && i.removeEventListener(n, l, r);
|
|
1482
|
+
};
|
|
1483
|
+
});
|
|
1484
|
+
return s.kind = "dynamic-attr", s;
|
|
1485
|
+
}, ln = new Proxy(
|
|
1486
|
+
{},
|
|
1487
|
+
{
|
|
1488
|
+
get: (n, e) => (t, r, s) => lt(e, t, r, s)
|
|
1489
|
+
}
|
|
1490
|
+
), cn = (n) => p((e) => (e.appendOrInsert(n), (t) => {
|
|
1491
|
+
t && $(n);
|
|
1492
|
+
})), ue = (n, ...e) => {
|
|
1493
|
+
const t = e.map(C), r = p((s) => {
|
|
1494
|
+
const o = s.makeChildElement(n, void 0), i = t.map((l) => l.render(o));
|
|
1495
|
+
return (l) => {
|
|
1496
|
+
i.forEach((c) => c(!1)), o.clear(l);
|
|
1497
|
+
};
|
|
1498
|
+
});
|
|
1499
|
+
return r.kind = "element", r.tag = n, r.children = t, r;
|
|
1500
|
+
}, j = (n, e, ...t) => {
|
|
1501
|
+
const r = t.map(C), s = p((o) => {
|
|
1502
|
+
const i = o.makeChildElement(n, e), l = r.map((c) => c.render(i));
|
|
1503
|
+
return (c) => {
|
|
1504
|
+
l.forEach((a) => a(!1)), i.clear(c);
|
|
1505
|
+
};
|
|
1506
|
+
});
|
|
1507
|
+
return s.kind = "element", s.tag = n, s.ns = e, s.children = r, s;
|
|
1508
|
+
}, ct = new Proxy(
|
|
2712
1509
|
{},
|
|
2713
1510
|
{
|
|
2714
1511
|
/**
|
|
@@ -2716,9 +1513,9 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2716
1513
|
* @param tagName - The HTML tag name.
|
|
2717
1514
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
2718
1515
|
*/
|
|
2719
|
-
get: (
|
|
1516
|
+
get: (n, e) => (...t) => ue(e, ...t)
|
|
2720
1517
|
}
|
|
2721
|
-
),
|
|
1518
|
+
), an = new Proxy(
|
|
2722
1519
|
{},
|
|
2723
1520
|
{
|
|
2724
1521
|
/**
|
|
@@ -2726,9 +1523,9 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2726
1523
|
* @param type - The input type name.
|
|
2727
1524
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
2728
1525
|
*/
|
|
2729
|
-
get: (
|
|
1526
|
+
get: (n, e) => (...t) => ue("input", b.type(e), ...t)
|
|
2730
1527
|
}
|
|
2731
|
-
),
|
|
1528
|
+
), de = "http://www.w3.org/2000/svg", un = (n, ...e) => j(n, de, ...e), dn = new Proxy(
|
|
2732
1529
|
{},
|
|
2733
1530
|
{
|
|
2734
1531
|
/**
|
|
@@ -2736,9 +1533,9 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2736
1533
|
* @param tagName - The SVG tag name.
|
|
2737
1534
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
2738
1535
|
*/
|
|
2739
|
-
get: (
|
|
1536
|
+
get: (n, e) => (...t) => j(e, de, ...t)
|
|
2740
1537
|
}
|
|
2741
|
-
),
|
|
1538
|
+
), he = "http://www.w3.org/1998/Math/MathML", hn = (n, ...e) => j(n, he, ...e), fn = new Proxy(
|
|
2742
1539
|
{},
|
|
2743
1540
|
{
|
|
2744
1541
|
/**
|
|
@@ -2746,117 +1543,123 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
2746
1543
|
* @param tagName - The Math tag name.
|
|
2747
1544
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
2748
1545
|
*/
|
|
2749
|
-
get: (
|
|
1546
|
+
get: (n, e) => (...t) => j(e, he, ...t)
|
|
2750
1547
|
}
|
|
2751
|
-
),
|
|
1548
|
+
), F = (n) => p((e) => {
|
|
2752
1549
|
if (e.isBrowser()) {
|
|
2753
|
-
const t =
|
|
1550
|
+
const t = n(e);
|
|
2754
1551
|
if (t != null)
|
|
2755
|
-
return
|
|
1552
|
+
return C(t).render(e);
|
|
2756
1553
|
}
|
|
2757
1554
|
return () => {
|
|
2758
1555
|
};
|
|
2759
1556
|
});
|
|
2760
|
-
function
|
|
2761
|
-
src:
|
|
1557
|
+
function pn({
|
|
1558
|
+
src: n,
|
|
2762
1559
|
name: e,
|
|
2763
1560
|
width: t,
|
|
2764
|
-
height:
|
|
2765
|
-
sandbox:
|
|
2766
|
-
allow:
|
|
2767
|
-
referrerpolicy:
|
|
1561
|
+
height: r,
|
|
1562
|
+
sandbox: s,
|
|
1563
|
+
allow: o,
|
|
1564
|
+
referrerpolicy: i,
|
|
2768
1565
|
loading: l,
|
|
2769
|
-
iframeChild:
|
|
2770
|
-
onLoad:
|
|
2771
|
-
} = {}, ...
|
|
2772
|
-
return
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
t != null ?
|
|
1566
|
+
iframeChild: c,
|
|
1567
|
+
onLoad: a
|
|
1568
|
+
} = {}, ...d) {
|
|
1569
|
+
return ct.iframe(
|
|
1570
|
+
b.src(n),
|
|
1571
|
+
b.name(e),
|
|
1572
|
+
b.width(
|
|
1573
|
+
t != null ? _.map(t, String) : void 0
|
|
2777
1574
|
),
|
|
2778
|
-
|
|
2779
|
-
|
|
1575
|
+
b.height(
|
|
1576
|
+
r != null ? _.map(r, String) : void 0
|
|
2780
1577
|
),
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
const
|
|
2787
|
-
let
|
|
2788
|
-
const
|
|
2789
|
-
if (
|
|
2790
|
-
|
|
2791
|
-
const
|
|
2792
|
-
if (
|
|
2793
|
-
const
|
|
2794
|
-
if (
|
|
2795
|
-
const
|
|
2796
|
-
|
|
1578
|
+
b.sandbox(s),
|
|
1579
|
+
b.allow(o),
|
|
1580
|
+
b.referrerpolicy(i),
|
|
1581
|
+
c,
|
|
1582
|
+
F((m) => {
|
|
1583
|
+
const u = m.element;
|
|
1584
|
+
let h, f = !1;
|
|
1585
|
+
const y = () => {
|
|
1586
|
+
if (f) return;
|
|
1587
|
+
f = !0;
|
|
1588
|
+
const g = u.contentDocument;
|
|
1589
|
+
if (g && (a && a(u), d.length > 0)) {
|
|
1590
|
+
const w = g.body;
|
|
1591
|
+
if (w) {
|
|
1592
|
+
const fe = m.withElement(w);
|
|
1593
|
+
h = H(S(...d), fe);
|
|
2797
1594
|
}
|
|
2798
1595
|
}
|
|
2799
1596
|
};
|
|
2800
|
-
return l != null &&
|
|
2801
|
-
|
|
2802
|
-
}), (
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
1597
|
+
return l != null && _.on(l, (g) => {
|
|
1598
|
+
u.loading = g;
|
|
1599
|
+
}), (d.length > 0 || a) && (n || setTimeout(y, 0)), S(
|
|
1600
|
+
d.length > 0 || a ? D.load(y) : Fe,
|
|
1601
|
+
ce(() => {
|
|
1602
|
+
h && h(!1);
|
|
2806
1603
|
})
|
|
2807
1604
|
);
|
|
2808
1605
|
})
|
|
2809
1606
|
);
|
|
2810
1607
|
}
|
|
2811
|
-
const
|
|
2812
|
-
const
|
|
2813
|
-
return () =>
|
|
2814
|
-
}),
|
|
2815
|
-
mark:
|
|
1608
|
+
const mn = (n, e) => p((t) => {
|
|
1609
|
+
const r = t.makePortal(n), s = H(C(e), r);
|
|
1610
|
+
return () => s(!0);
|
|
1611
|
+
}), R = /* @__PURE__ */ new Map(), at = (n) => ({
|
|
1612
|
+
mark: ye(`Probe(${n.description})`),
|
|
2816
1613
|
create: ({ callback: e = () => {
|
|
2817
1614
|
}, timeout: t = 10 } = {}) => {
|
|
2818
|
-
const
|
|
2819
|
-
clearTimeout(
|
|
1615
|
+
const r = (l) => {
|
|
1616
|
+
clearTimeout(s), R.delete(n), e(l);
|
|
2820
1617
|
};
|
|
2821
|
-
if (
|
|
2822
|
-
throw new Error(`Probe already exists: ${
|
|
2823
|
-
const
|
|
2824
|
-
return
|
|
1618
|
+
if (R.has(n))
|
|
1619
|
+
throw new Error(`Probe already exists: ${n.description}`);
|
|
1620
|
+
const s = setTimeout(() => r("timeout"), t), o = { counter: 0, timeoutId: s };
|
|
1621
|
+
return R.set(n, o), {
|
|
2825
1622
|
value: () => {
|
|
2826
|
-
clearTimeout(
|
|
2827
|
-
const l =
|
|
2828
|
-
l != null && --l.counter === 0 &&
|
|
1623
|
+
clearTimeout(s);
|
|
1624
|
+
const l = R.get(n);
|
|
1625
|
+
l != null && --l.counter === 0 && r("resolved");
|
|
2829
1626
|
},
|
|
2830
|
-
dispose: () =>
|
|
2831
|
-
onUse: () =>
|
|
1627
|
+
dispose: () => r("disposed"),
|
|
1628
|
+
onUse: () => o.counter++
|
|
2832
1629
|
};
|
|
2833
1630
|
}
|
|
2834
|
-
}),
|
|
1631
|
+
}), gn = at(/* @__PURE__ */ Symbol("GlobalProbe"));
|
|
2835
1632
|
function bn({
|
|
2836
|
-
mode:
|
|
1633
|
+
mode: n,
|
|
2837
1634
|
delegatesFocus: e,
|
|
2838
1635
|
slotAssignment: t,
|
|
2839
|
-
clonable:
|
|
2840
|
-
serializable:
|
|
2841
|
-
}, ...
|
|
2842
|
-
return
|
|
2843
|
-
const l = { mode:
|
|
2844
|
-
e !== void 0 && (l.delegatesFocus = e), t !== void 0 && (l.slotAssignment = t),
|
|
2845
|
-
const
|
|
2846
|
-
return
|
|
1636
|
+
clonable: r,
|
|
1637
|
+
serializable: s
|
|
1638
|
+
}, ...o) {
|
|
1639
|
+
return F((i) => {
|
|
1640
|
+
const l = { mode: n };
|
|
1641
|
+
e !== void 0 && (l.delegatesFocus = e), t !== void 0 && (l.slotAssignment = t), r !== void 0 && (l.clonable = r), s !== void 0 && (l.serializable = s);
|
|
1642
|
+
const c = i.element.attachShadow(l), a = i.withElement(c), d = H(S(...o), a);
|
|
1643
|
+
return ce(() => d(!0));
|
|
2847
1644
|
});
|
|
2848
1645
|
}
|
|
2849
|
-
const
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2852
|
-
r
|
|
2853
|
-
|
|
2854
|
-
}
|
|
2855
|
-
|
|
2856
|
-
return
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
1646
|
+
const ut = (n, e) => {
|
|
1647
|
+
const t = p((r) => {
|
|
1648
|
+
const s = r.getStyle(n);
|
|
1649
|
+
return r.setStyle(n, e), (o) => {
|
|
1650
|
+
o && r.setStyle(n, s);
|
|
1651
|
+
};
|
|
1652
|
+
});
|
|
1653
|
+
return t.kind = "static-attr", t;
|
|
1654
|
+
}, dt = (n, e) => {
|
|
1655
|
+
const t = p((r) => {
|
|
1656
|
+
const s = r.getStyle(n), o = e.on((i) => r.setStyle(n, i));
|
|
1657
|
+
return (i) => {
|
|
1658
|
+
o(), i && r.setStyle(n, s);
|
|
1659
|
+
};
|
|
1660
|
+
});
|
|
1661
|
+
return t.kind = "dynamic-attr", t;
|
|
1662
|
+
}, U = (n, e) => B.is(e) ? dt(n, e) : ut(n, e), yn = new Proxy({}, {
|
|
2860
1663
|
/**
|
|
2861
1664
|
* Creates a renderable component for the specified `style` property.
|
|
2862
1665
|
*
|
|
@@ -2865,165 +1668,175 @@ const ns = (s, e) => L((t) => {
|
|
|
2865
1668
|
* @returns The renderable component for the specified attribute.
|
|
2866
1669
|
*
|
|
2867
1670
|
*/
|
|
2868
|
-
get: (
|
|
2869
|
-
}),
|
|
2870
|
-
const t = e.makeChildText(
|
|
2871
|
-
return (r) =>
|
|
2872
|
-
|
|
1671
|
+
get: (n, e) => e === "variable" ? (t, r) => U(t, r) : (t) => U(e, t)
|
|
1672
|
+
}), ht = (n) => p((e) => {
|
|
1673
|
+
const t = e.makeChildText(n);
|
|
1674
|
+
return (r) => t.clear(r);
|
|
1675
|
+
}), ft = (n) => p((e) => {
|
|
1676
|
+
const t = e.makeChildText(n.value), r = n.on((s) => t.setText(s));
|
|
1677
|
+
return (s) => {
|
|
1678
|
+
r(), t.clear(s);
|
|
2873
1679
|
};
|
|
2874
|
-
}), Tn = (
|
|
2875
|
-
const t =
|
|
1680
|
+
}), Tn = (n) => B.is(n) ? ft(n) : ht(n), Sn = (n) => p((e) => {
|
|
1681
|
+
const t = n(e);
|
|
2876
1682
|
return t == null ? () => {
|
|
2877
|
-
} :
|
|
2878
|
-
}),
|
|
1683
|
+
} : C(t).render(e);
|
|
1684
|
+
}), xn = (n) => F((e) => n(e.element)), wn = (n) => p((e) => {
|
|
2879
1685
|
if (e.isHeadlessDOM()) {
|
|
2880
|
-
const t =
|
|
1686
|
+
const t = n(e);
|
|
2881
1687
|
if (t)
|
|
2882
|
-
return
|
|
1688
|
+
return C(t).render(e);
|
|
2883
1689
|
}
|
|
2884
1690
|
return () => {
|
|
2885
1691
|
};
|
|
2886
1692
|
});
|
|
2887
1693
|
export {
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
1694
|
+
ze as Aria,
|
|
1695
|
+
$t as Async,
|
|
1696
|
+
Ye as Attr,
|
|
1697
|
+
on as BindChecked,
|
|
1698
|
+
tn as BindDate,
|
|
1699
|
+
nn as BindDateTime,
|
|
1700
|
+
rn as BindNumber,
|
|
1701
|
+
sn as BindText,
|
|
1702
|
+
T as BrowserContext,
|
|
1703
|
+
E as CLASS_PLACEHOLDER_ATTR,
|
|
1704
|
+
vn as Computed,
|
|
1705
|
+
Bt as Conjunction,
|
|
1706
|
+
cn as DOMNode,
|
|
1707
|
+
Xe as DataAttr,
|
|
1708
|
+
Cn as DisposalScope,
|
|
1709
|
+
ue as El,
|
|
1710
|
+
j as ElNS,
|
|
1711
|
+
En as ElementPosition,
|
|
1712
|
+
Fe as Empty,
|
|
1713
|
+
Dt as Ensure,
|
|
1714
|
+
It as EnsureAll,
|
|
1715
|
+
At as ForEach,
|
|
1716
|
+
S as Fragment,
|
|
1717
|
+
gn as GlobalProbe,
|
|
1718
|
+
Me as HYDRATION_ID_ATTR,
|
|
1719
|
+
yt as HeadlessAdapter,
|
|
1720
|
+
v as HeadlessContext,
|
|
1721
|
+
Ne as HeadlessElement,
|
|
1722
|
+
oe as HeadlessPortal,
|
|
1723
|
+
De as HeadlessText,
|
|
1724
|
+
pn as IFrame,
|
|
1725
|
+
kt as KeyedForEach,
|
|
1726
|
+
Pn as KeyedPosition,
|
|
1727
|
+
Ht as MapSignal,
|
|
1728
|
+
Nt as MapText,
|
|
1729
|
+
Ze as MathAttr,
|
|
1730
|
+
hn as MathEl,
|
|
1731
|
+
Mn as MemoryStore,
|
|
1732
|
+
Rt as NotEmpty,
|
|
1733
|
+
tt as OnChecked,
|
|
1734
|
+
ce as OnDispose,
|
|
1735
|
+
Ct as OneOf,
|
|
1736
|
+
Et as OneOfField,
|
|
1737
|
+
Pt as OneOfKind,
|
|
1738
|
+
Lt as OneOfTuple,
|
|
1739
|
+
Mt as OneOfType,
|
|
1740
|
+
Ot as OneOfValue,
|
|
1741
|
+
mn as Portal,
|
|
1742
|
+
On as Prop,
|
|
1743
|
+
Wt as Provide,
|
|
1744
|
+
Tr as ProviderNotFoundError,
|
|
1745
|
+
Ae as RenderingError,
|
|
1746
|
+
vt as Repeat,
|
|
1747
|
+
Qe as SVGAttr,
|
|
1748
|
+
un as SVGEl,
|
|
2940
1749
|
bn as ShadowRoot,
|
|
2941
|
-
|
|
2942
|
-
|
|
1750
|
+
Ln as Signal,
|
|
1751
|
+
_t as Task,
|
|
2943
1752
|
Tn as TextNode,
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
Qt as
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
1753
|
+
wt as Unless,
|
|
1754
|
+
Ft as Use,
|
|
1755
|
+
Kt as UseMany,
|
|
1756
|
+
Hn as Value,
|
|
1757
|
+
xt as When,
|
|
1758
|
+
F as WithBrowserCtx,
|
|
1759
|
+
Sn as WithCtx,
|
|
1760
|
+
xn as WithElement,
|
|
1761
|
+
wn as WithHeadlessCtx,
|
|
1762
|
+
Vt as WithProvider,
|
|
1763
|
+
jt as WithScope,
|
|
1764
|
+
V as _NODE_PLACEHOLDER_ATTR,
|
|
1765
|
+
we as _getSelfOrParentElement,
|
|
1766
|
+
te as _isElement,
|
|
1767
|
+
ne as _isFragment,
|
|
1768
|
+
xe as _makeGetter,
|
|
1769
|
+
Se as _makeSetter,
|
|
1770
|
+
$ as _removeDOMNode,
|
|
1771
|
+
ft as _signalText,
|
|
1772
|
+
ht as _staticText,
|
|
1773
|
+
Nn as animateSignal,
|
|
1774
|
+
Dn as animateSignals,
|
|
1775
|
+
Jt as aria,
|
|
1776
|
+
b as attr,
|
|
1777
|
+
In as bind,
|
|
1778
|
+
Rn as coalesce,
|
|
1779
|
+
_n as computed,
|
|
1780
|
+
$n as computedOf,
|
|
1781
|
+
Bn as computedOfAsync,
|
|
1782
|
+
jn as computedOfAsyncGenerator,
|
|
1783
|
+
Vn as computedRecord,
|
|
1784
|
+
Sr as createRenderKit,
|
|
1785
|
+
Wn as createRenderable,
|
|
1786
|
+
Fn as createSelector,
|
|
1787
|
+
Ut as dataAttr,
|
|
1788
|
+
Kn as delaySignal,
|
|
1789
|
+
ln as delegate,
|
|
1790
|
+
qn as effect,
|
|
1791
|
+
Gn as effectOf,
|
|
1792
|
+
nt as emit,
|
|
1793
|
+
en as emitChecked,
|
|
1794
|
+
x as emitTarget,
|
|
1795
|
+
rt as emitValue,
|
|
1796
|
+
it as emitValueAsDate,
|
|
1797
|
+
ot as emitValueAsDateTime,
|
|
1798
|
+
Qt as emitValueAsNullableDate,
|
|
1799
|
+
Zt as emitValueAsNullableDateTime,
|
|
1800
|
+
st as emitValueAsNumber,
|
|
1801
|
+
Un as endInterpolate,
|
|
1802
|
+
Jn as getCurrentScope,
|
|
1803
|
+
Yn as getParentScope,
|
|
1804
|
+
Xn as getScopeStack,
|
|
1805
|
+
St as getWindow,
|
|
1806
|
+
zn as guessInterpolate,
|
|
1807
|
+
ct as html,
|
|
1808
|
+
an as input,
|
|
1809
|
+
Qn as interpolateDate,
|
|
1810
|
+
Zn as interpolateNumber,
|
|
1811
|
+
er as interpolateString,
|
|
1812
|
+
tr as joinSignals,
|
|
1813
|
+
nr as localStorageProp,
|
|
1814
|
+
at as makeProbe,
|
|
1815
|
+
rr as makeProviderMark,
|
|
1816
|
+
fn as math,
|
|
1817
|
+
Xt as mathAttr,
|
|
1818
|
+
sr as merge,
|
|
1819
|
+
D as on,
|
|
1820
|
+
ir as popScope,
|
|
1821
|
+
or as previousSignal,
|
|
1822
|
+
lr as prop,
|
|
1823
|
+
cr as pushScope,
|
|
1824
|
+
gt as render,
|
|
1825
|
+
H as renderWithContext,
|
|
1826
|
+
C as renderableOfTNode,
|
|
1827
|
+
Tt as restoreTempoPlaceholders,
|
|
1828
|
+
bt as runHeadless,
|
|
1829
|
+
ar as scoped,
|
|
1830
|
+
zt as selectedClass,
|
|
1831
|
+
ur as sessionStorageProp,
|
|
1832
|
+
dr as signal,
|
|
1833
|
+
hr as slidingWindowSignal,
|
|
1834
|
+
fr as storedProp,
|
|
1835
|
+
pr as strictEquals,
|
|
1836
|
+
yn as style,
|
|
1837
|
+
dn as svg,
|
|
1838
|
+
Yt as svgAttr,
|
|
1839
|
+
mr as syncProp,
|
|
1840
|
+
gr as untracked,
|
|
1841
|
+
br as withScope
|
|
3029
1842
|
};
|