@hot-page/fun 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,705 @@
1
+ const te = globalThis, U = te.trustedTypes, ne = U ? U.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pe = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, fe = "?" + C, Se = `<${fe}>`, E = document, P = () => E.createComment(""), R = (e) => e === null || typeof e != "object" && typeof e != "function", re = Array.isArray, Ee = (e) => re(e) || typeof e?.[Symbol.iterator] == "function", G = `[
2
+ \f\r]`, W = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ue = /-->/g, ce = />/g, x = RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ae = /'/g, le = /"/g, me = /^(?:script|style|textarea|title)$/i, ve = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), nt = ve(1), ut = ve(2), H = Symbol.for("lit-noChange"), w = Symbol.for("lit-nothing"), he = /* @__PURE__ */ new WeakMap(), T = E.createTreeWalker(E, 129);
4
+ function Ae(e, t) {
5
+ if (!re(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
6
+ return ne !== void 0 ? ne.createHTML(t) : t;
7
+ }
8
+ const Ie = (e, t) => {
9
+ const r = e.length - 1, s = [];
10
+ let o, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = W;
11
+ for (let h = 0; h < r; h++) {
12
+ const n = e[h];
13
+ let u, d, c = -1, v = 0;
14
+ for (; v < n.length && (a.lastIndex = v, d = a.exec(n), d !== null); ) v = a.lastIndex, a === W ? d[1] === "!--" ? a = ue : d[1] !== void 0 ? a = ce : d[2] !== void 0 ? (me.test(d[2]) && (o = RegExp("</" + d[2], "g")), a = x) : d[3] !== void 0 && (a = x) : a === x ? d[0] === ">" ? (a = o ?? W, c = -1) : d[1] === void 0 ? c = -2 : (c = a.lastIndex - d[2].length, u = d[1], a = d[3] === void 0 ? x : d[3] === '"' ? le : ae) : a === le || a === ae ? a = x : a === ue || a === ce ? a = W : (a = x, o = void 0);
15
+ const m = a === x && e[h + 1].startsWith("/>") ? " " : "";
16
+ i += a === W ? n + Se : c >= 0 ? (s.push(u), n.slice(0, c) + pe + n.slice(c) + C + m) : n + C + (c === -2 ? h : m);
17
+ }
18
+ return [Ae(e, i + (e[r] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
19
+ };
20
+ class k {
21
+ constructor({ strings: t, _$litType$: r }, s) {
22
+ let o;
23
+ this.parts = [];
24
+ let i = 0, a = 0;
25
+ const h = t.length - 1, n = this.parts, [u, d] = Ie(t, r);
26
+ if (this.el = k.createElement(u, s), T.currentNode = this.el.content, r === 2 || r === 3) {
27
+ const c = this.el.content.firstChild;
28
+ c.replaceWith(...c.childNodes);
29
+ }
30
+ for (; (o = T.nextNode()) !== null && n.length < h; ) {
31
+ if (o.nodeType === 1) {
32
+ if (o.hasAttributes()) for (const c of o.getAttributeNames()) if (c.endsWith(pe)) {
33
+ const v = d[a++], m = o.getAttribute(c).split(C), _ = /([.?@])?(.*)/.exec(v);
34
+ n.push({ type: 1, index: i, name: _[2], strings: m, ctor: _[1] === "." ? Oe : _[1] === "?" ? We : _[1] === "@" ? Me : B }), o.removeAttribute(c);
35
+ } else c.startsWith(C) && (n.push({ type: 6, index: i }), o.removeAttribute(c));
36
+ if (me.test(o.tagName)) {
37
+ const c = o.textContent.split(C), v = c.length - 1;
38
+ if (v > 0) {
39
+ o.textContent = U ? U.emptyScript : "";
40
+ for (let m = 0; m < v; m++) o.append(c[m], P()), T.nextNode(), n.push({ type: 2, index: ++i });
41
+ o.append(c[v], P());
42
+ }
43
+ }
44
+ } else if (o.nodeType === 8) if (o.data === fe) n.push({ type: 2, index: i });
45
+ else {
46
+ let c = -1;
47
+ for (; (c = o.data.indexOf(C, c + 1)) !== -1; ) n.push({ type: 7, index: i }), c += C.length - 1;
48
+ }
49
+ i++;
50
+ }
51
+ }
52
+ static createElement(t, r) {
53
+ const s = E.createElement("template");
54
+ return s.innerHTML = t, s;
55
+ }
56
+ }
57
+ function b(e, t, r = e, s) {
58
+ if (t === H) return t;
59
+ let o = s !== void 0 ? r._$Co?.[s] : r._$Cl;
60
+ const i = R(t) ? void 0 : t._$litDirective$;
61
+ return o?.constructor !== i && (o?._$AO?.(!1), i === void 0 ? o = void 0 : (o = new i(e), o._$AT(e, r, s)), s !== void 0 ? (r._$Co ??= [])[s] = o : r._$Cl = o), o !== void 0 && (t = b(e, o._$AS(e, t.values), o, s)), t;
62
+ }
63
+ class be {
64
+ constructor(t, r) {
65
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = r;
66
+ }
67
+ get parentNode() {
68
+ return this._$AM.parentNode;
69
+ }
70
+ get _$AU() {
71
+ return this._$AM._$AU;
72
+ }
73
+ u(t) {
74
+ const { el: { content: r }, parts: s } = this._$AD, o = (t?.creationScope ?? E).importNode(r, !0);
75
+ T.currentNode = o;
76
+ let i = T.nextNode(), a = 0, h = 0, n = s[0];
77
+ for (; n !== void 0; ) {
78
+ if (a === n.index) {
79
+ let u;
80
+ n.type === 2 ? u = new L(i, i.nextSibling, this, t) : n.type === 1 ? u = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (u = new Pe(i, this, t)), this._$AV.push(u), n = s[++h];
81
+ }
82
+ a !== n?.index && (i = T.nextNode(), a++);
83
+ }
84
+ return T.currentNode = E, o;
85
+ }
86
+ p(t) {
87
+ let r = 0;
88
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, r), r += s.strings.length - 2) : s._$AI(t[r])), r++;
89
+ }
90
+ }
91
+ class L {
92
+ get _$AU() {
93
+ return this._$AM?._$AU ?? this._$Cv;
94
+ }
95
+ constructor(t, r, s, o) {
96
+ this.type = 2, this._$AH = w, this._$AN = void 0, this._$AA = t, this._$AB = r, this._$AM = s, this.options = o, this._$Cv = o?.isConnected ?? !0;
97
+ }
98
+ get parentNode() {
99
+ let t = this._$AA.parentNode;
100
+ const r = this._$AM;
101
+ return r !== void 0 && t?.nodeType === 11 && (t = r.parentNode), t;
102
+ }
103
+ get startNode() {
104
+ return this._$AA;
105
+ }
106
+ get endNode() {
107
+ return this._$AB;
108
+ }
109
+ _$AI(t, r = this) {
110
+ t = b(this, t, r), R(t) ? t === w || t == null || t === "" ? (this._$AH !== w && this._$AR(), this._$AH = w) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ee(t) ? this.k(t) : this._(t);
111
+ }
112
+ O(t) {
113
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
114
+ }
115
+ T(t) {
116
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
117
+ }
118
+ _(t) {
119
+ this._$AH !== w && R(this._$AH) ? this._$AA.nextSibling.data = t : this.T(E.createTextNode(t)), this._$AH = t;
120
+ }
121
+ $(t) {
122
+ const { values: r, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(Ae(s.h, s.h[0]), this.options)), s);
123
+ if (this._$AH?._$AD === o) this._$AH.p(r);
124
+ else {
125
+ const i = new be(o, this), a = i.u(this.options);
126
+ i.p(r), this.T(a), this._$AH = i;
127
+ }
128
+ }
129
+ _$AC(t) {
130
+ let r = he.get(t.strings);
131
+ return r === void 0 && he.set(t.strings, r = new k(t)), r;
132
+ }
133
+ k(t) {
134
+ re(this._$AH) || (this._$AH = [], this._$AR());
135
+ const r = this._$AH;
136
+ let s, o = 0;
137
+ for (const i of t) o === r.length ? r.push(s = new L(this.O(P()), this.O(P()), this, this.options)) : s = r[o], s._$AI(i), o++;
138
+ o < r.length && (this._$AR(s && s._$AB.nextSibling, o), r.length = o);
139
+ }
140
+ _$AR(t = this._$AA.nextSibling, r) {
141
+ for (this._$AP?.(!1, !0, r); t !== this._$AB; ) {
142
+ const s = t.nextSibling;
143
+ t.remove(), t = s;
144
+ }
145
+ }
146
+ setConnected(t) {
147
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
148
+ }
149
+ }
150
+ class B {
151
+ get tagName() {
152
+ return this.element.tagName;
153
+ }
154
+ get _$AU() {
155
+ return this._$AM._$AU;
156
+ }
157
+ constructor(t, r, s, o, i) {
158
+ this.type = 1, this._$AH = w, this._$AN = void 0, this.element = t, this.name = r, this._$AM = o, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = w;
159
+ }
160
+ _$AI(t, r = this, s, o) {
161
+ const i = this.strings;
162
+ let a = !1;
163
+ if (i === void 0) t = b(this, t, r, 0), a = !R(t) || t !== this._$AH && t !== H, a && (this._$AH = t);
164
+ else {
165
+ const h = t;
166
+ let n, u;
167
+ for (t = i[0], n = 0; n < i.length - 1; n++) u = b(this, h[s + n], r, n), u === H && (u = this._$AH[n]), a ||= !R(u) || u !== this._$AH[n], u === w ? t = w : t !== w && (t += (u ?? "") + i[n + 1]), this._$AH[n] = u;
168
+ }
169
+ a && !o && this.j(t);
170
+ }
171
+ j(t) {
172
+ t === w ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
173
+ }
174
+ }
175
+ class Oe extends B {
176
+ constructor() {
177
+ super(...arguments), this.type = 3;
178
+ }
179
+ j(t) {
180
+ this.element[this.name] = t === w ? void 0 : t;
181
+ }
182
+ }
183
+ class We extends B {
184
+ constructor() {
185
+ super(...arguments), this.type = 4;
186
+ }
187
+ j(t) {
188
+ this.element.toggleAttribute(this.name, !!t && t !== w);
189
+ }
190
+ }
191
+ class Me extends B {
192
+ constructor(t, r, s, o, i) {
193
+ super(t, r, s, o, i), this.type = 5;
194
+ }
195
+ _$AI(t, r = this) {
196
+ if ((t = b(this, t, r, 0) ?? w) === H) return;
197
+ const s = this._$AH, o = t === w && s !== w || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== w && (s === w || o);
198
+ o && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
199
+ }
200
+ handleEvent(t) {
201
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
202
+ }
203
+ }
204
+ class Pe {
205
+ constructor(t, r, s) {
206
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = s;
207
+ }
208
+ get _$AU() {
209
+ return this._$AM._$AU;
210
+ }
211
+ _$AI(t) {
212
+ b(this, t);
213
+ }
214
+ }
215
+ const Re = te.litHtmlPolyfillSupport;
216
+ Re?.(k, L), (te.litHtmlVersions ??= []).push("3.3.1");
217
+ const He = (e, t, r) => {
218
+ const s = t;
219
+ let o = s._$litPart$;
220
+ return o === void 0 && (s._$litPart$ = o = new L(t.insertBefore(P(), null), null, void 0, {})), o._$AI(e), o;
221
+ };
222
+ var ke = Object.defineProperty, Le = (e, t, r) => t in e ? ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, K = (e, t, r) => (Le(e, typeof t != "symbol" ? t + "" : t, r), r), Ve = (e, t, r) => {
223
+ if (!t.has(e))
224
+ throw TypeError("Cannot " + r);
225
+ }, Y = (e, t) => {
226
+ if (Object(t) !== t)
227
+ throw TypeError('Cannot use the "in" operator on this value');
228
+ return e.has(t);
229
+ }, D = (e, t, r) => {
230
+ if (t.has(e))
231
+ throw TypeError("Cannot add the same private member more than once");
232
+ t instanceof WeakSet ? t.add(e) : t.set(e, r);
233
+ }, de = (e, t, r) => (Ve(e, t, "access private method"), r);
234
+ function we(e, t) {
235
+ return Object.is(e, t);
236
+ }
237
+ let A = null, M = !1, q = 1;
238
+ const j = /* @__PURE__ */ Symbol("SIGNAL");
239
+ function I(e) {
240
+ const t = A;
241
+ return A = e, t;
242
+ }
243
+ function De() {
244
+ return A;
245
+ }
246
+ function qe() {
247
+ return M;
248
+ }
249
+ const se = {
250
+ version: 0,
251
+ lastCleanEpoch: 0,
252
+ dirty: !1,
253
+ producerNode: void 0,
254
+ producerLastReadVersion: void 0,
255
+ producerIndexOfThis: void 0,
256
+ nextProducerIndex: 0,
257
+ liveConsumerNode: void 0,
258
+ liveConsumerIndexOfThis: void 0,
259
+ consumerAllowSignalWrites: !1,
260
+ consumerIsAlwaysLive: !1,
261
+ producerMustRecompute: () => !1,
262
+ producerRecomputeValue: () => {
263
+ },
264
+ consumerMarkedDirty: () => {
265
+ },
266
+ consumerOnSignalRead: () => {
267
+ }
268
+ };
269
+ function F(e) {
270
+ if (M)
271
+ throw new Error(
272
+ typeof ngDevMode < "u" && ngDevMode ? "Assertion error: signal read during notification phase" : ""
273
+ );
274
+ if (A === null)
275
+ return;
276
+ A.consumerOnSignalRead(e);
277
+ const t = A.nextProducerIndex++;
278
+ if (O(A), t < A.producerNode.length && A.producerNode[t] !== e && X(A)) {
279
+ const r = A.producerNode[t];
280
+ Z(r, A.producerIndexOfThis[t]);
281
+ }
282
+ A.producerNode[t] !== e && (A.producerNode[t] = e, A.producerIndexOfThis[t] = X(A) ? ge(e, A, t) : 0), A.producerLastReadVersion[t] = e.version;
283
+ }
284
+ function Ue() {
285
+ q++;
286
+ }
287
+ function $e(e) {
288
+ if (!(!e.dirty && e.lastCleanEpoch === q)) {
289
+ if (!e.producerMustRecompute(e) && !ze(e)) {
290
+ e.dirty = !1, e.lastCleanEpoch = q;
291
+ return;
292
+ }
293
+ e.producerRecomputeValue(e), e.dirty = !1, e.lastCleanEpoch = q;
294
+ }
295
+ }
296
+ function _e(e) {
297
+ if (e.liveConsumerNode === void 0)
298
+ return;
299
+ const t = M;
300
+ M = !0;
301
+ try {
302
+ for (const r of e.liveConsumerNode)
303
+ r.dirty || Be(r);
304
+ } finally {
305
+ M = t;
306
+ }
307
+ }
308
+ function je() {
309
+ return A?.consumerAllowSignalWrites !== !1;
310
+ }
311
+ function Be(e) {
312
+ var t;
313
+ e.dirty = !0, _e(e), (t = e.consumerMarkedDirty) == null || t.call(e.wrapper ?? e);
314
+ }
315
+ function Fe(e) {
316
+ return e && (e.nextProducerIndex = 0), I(e);
317
+ }
318
+ function Ze(e, t) {
319
+ if (I(t), !(!e || e.producerNode === void 0 || e.producerIndexOfThis === void 0 || e.producerLastReadVersion === void 0)) {
320
+ if (X(e))
321
+ for (let r = e.nextProducerIndex; r < e.producerNode.length; r++)
322
+ Z(e.producerNode[r], e.producerIndexOfThis[r]);
323
+ for (; e.producerNode.length > e.nextProducerIndex; )
324
+ e.producerNode.pop(), e.producerLastReadVersion.pop(), e.producerIndexOfThis.pop();
325
+ }
326
+ }
327
+ function ze(e) {
328
+ O(e);
329
+ for (let t = 0; t < e.producerNode.length; t++) {
330
+ const r = e.producerNode[t], s = e.producerLastReadVersion[t];
331
+ if (s !== r.version || ($e(r), s !== r.version))
332
+ return !0;
333
+ }
334
+ return !1;
335
+ }
336
+ function ge(e, t, r) {
337
+ var s;
338
+ if (oe(e), O(e), e.liveConsumerNode.length === 0) {
339
+ (s = e.watched) == null || s.call(e.wrapper);
340
+ for (let o = 0; o < e.producerNode.length; o++)
341
+ e.producerIndexOfThis[o] = ge(e.producerNode[o], e, o);
342
+ }
343
+ return e.liveConsumerIndexOfThis.push(r), e.liveConsumerNode.push(t) - 1;
344
+ }
345
+ function Z(e, t) {
346
+ var r;
347
+ if (oe(e), O(e), typeof ngDevMode < "u" && ngDevMode && t >= e.liveConsumerNode.length)
348
+ throw new Error(
349
+ `Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`
350
+ );
351
+ if (e.liveConsumerNode.length === 1) {
352
+ (r = e.unwatched) == null || r.call(e.wrapper);
353
+ for (let o = 0; o < e.producerNode.length; o++)
354
+ Z(e.producerNode[o], e.producerIndexOfThis[o]);
355
+ }
356
+ const s = e.liveConsumerNode.length - 1;
357
+ if (e.liveConsumerNode[t] = e.liveConsumerNode[s], e.liveConsumerIndexOfThis[t] = e.liveConsumerIndexOfThis[s], e.liveConsumerNode.length--, e.liveConsumerIndexOfThis.length--, t < e.liveConsumerNode.length) {
358
+ const o = e.liveConsumerIndexOfThis[t], i = e.liveConsumerNode[t];
359
+ O(i), i.producerIndexOfThis[o] = t;
360
+ }
361
+ }
362
+ function X(e) {
363
+ var t;
364
+ return e.consumerIsAlwaysLive || (((t = e?.liveConsumerNode) == null ? void 0 : t.length) ?? 0) > 0;
365
+ }
366
+ function O(e) {
367
+ e.producerNode ?? (e.producerNode = []), e.producerIndexOfThis ?? (e.producerIndexOfThis = []), e.producerLastReadVersion ?? (e.producerLastReadVersion = []);
368
+ }
369
+ function oe(e) {
370
+ e.liveConsumerNode ?? (e.liveConsumerNode = []), e.liveConsumerIndexOfThis ?? (e.liveConsumerIndexOfThis = []);
371
+ }
372
+ function ye(e) {
373
+ if ($e(e), F(e), e.value === ee)
374
+ throw e.error;
375
+ return e.value;
376
+ }
377
+ function Ge(e) {
378
+ const t = Object.create(Ke);
379
+ t.computation = e;
380
+ const r = () => ye(t);
381
+ return r[j] = t, r;
382
+ }
383
+ const J = /* @__PURE__ */ Symbol("UNSET"), Q = /* @__PURE__ */ Symbol("COMPUTING"), ee = /* @__PURE__ */ Symbol("ERRORED"), Ke = {
384
+ ...se,
385
+ value: J,
386
+ dirty: !0,
387
+ error: null,
388
+ equal: we,
389
+ producerMustRecompute(e) {
390
+ return e.value === J || e.value === Q;
391
+ },
392
+ producerRecomputeValue(e) {
393
+ if (e.value === Q)
394
+ throw new Error("Detected cycle in computations.");
395
+ const t = e.value;
396
+ e.value = Q;
397
+ const r = Fe(e);
398
+ let s, o = !1;
399
+ try {
400
+ s = e.computation.call(e.wrapper), o = t !== J && t !== ee && e.equal.call(e.wrapper, t, s);
401
+ } catch (i) {
402
+ s = ee, e.error = i;
403
+ } finally {
404
+ Ze(e, r);
405
+ }
406
+ if (o) {
407
+ e.value = t;
408
+ return;
409
+ }
410
+ e.value = s, e.version++;
411
+ }
412
+ };
413
+ function Ye() {
414
+ throw new Error();
415
+ }
416
+ let Je = Ye;
417
+ function Qe() {
418
+ Je();
419
+ }
420
+ function Xe(e) {
421
+ const t = Object.create(rt);
422
+ t.value = e;
423
+ const r = () => (F(t), t.value);
424
+ return r[j] = t, r;
425
+ }
426
+ function et() {
427
+ return F(this), this.value;
428
+ }
429
+ function tt(e, t) {
430
+ je() || Qe(), e.equal.call(e.wrapper, e.value, t) || (e.value = t, st(e));
431
+ }
432
+ const rt = {
433
+ ...se,
434
+ equal: we,
435
+ value: void 0
436
+ };
437
+ function st(e) {
438
+ e.version++, Ue(), _e(e);
439
+ }
440
+ const $ = Symbol("node");
441
+ var S;
442
+ ((e) => {
443
+ var t, r, s, o;
444
+ class i {
445
+ constructor(n, u = {}) {
446
+ D(this, r), K(this, t);
447
+ const c = Xe(n)[j];
448
+ if (this[$] = c, c.wrapper = this, u) {
449
+ const v = u.equals;
450
+ v && (c.equal = v), c.watched = u[e.subtle.watched], c.unwatched = u[e.subtle.unwatched];
451
+ }
452
+ }
453
+ get() {
454
+ if (!(0, e.isState)(this))
455
+ throw new TypeError("Wrong receiver type for Signal.State.prototype.get");
456
+ return et.call(this[$]);
457
+ }
458
+ set(n) {
459
+ if (!(0, e.isState)(this))
460
+ throw new TypeError("Wrong receiver type for Signal.State.prototype.set");
461
+ if (qe())
462
+ throw new Error("Writes to signals not permitted during Watcher callback");
463
+ const u = this[$];
464
+ tt(u, n);
465
+ }
466
+ }
467
+ t = $, r = /* @__PURE__ */ new WeakSet(), e.isState = (h) => typeof h == "object" && Y(r, h), e.State = i;
468
+ class a {
469
+ // Create a Signal which evaluates to the value returned by the callback.
470
+ // Callback is called with this signal as the parameter.
471
+ constructor(n, u) {
472
+ D(this, o), K(this, s);
473
+ const c = Ge(n)[j];
474
+ if (c.consumerAllowSignalWrites = !0, this[$] = c, c.wrapper = this, u) {
475
+ const v = u.equals;
476
+ v && (c.equal = v), c.watched = u[e.subtle.watched], c.unwatched = u[e.subtle.unwatched];
477
+ }
478
+ }
479
+ get() {
480
+ if (!(0, e.isComputed)(this))
481
+ throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");
482
+ return ye(this[$]);
483
+ }
484
+ }
485
+ s = $, o = /* @__PURE__ */ new WeakSet(), e.isComputed = (h) => typeof h == "object" && Y(o, h), e.Computed = a, ((h) => {
486
+ var n, u, d, c;
487
+ function v(f) {
488
+ let p, l = null;
489
+ try {
490
+ l = I(null), p = f();
491
+ } finally {
492
+ I(l);
493
+ }
494
+ return p;
495
+ }
496
+ h.untrack = v;
497
+ function m(f) {
498
+ var p;
499
+ if (!(0, e.isComputed)(f) && !(0, e.isWatcher)(f))
500
+ throw new TypeError("Called introspectSources without a Computed or Watcher argument");
501
+ return ((p = f[$].producerNode) == null ? void 0 : p.map((l) => l.wrapper)) ?? [];
502
+ }
503
+ h.introspectSources = m;
504
+ function _(f) {
505
+ var p;
506
+ if (!(0, e.isComputed)(f) && !(0, e.isState)(f))
507
+ throw new TypeError("Called introspectSinks without a Signal argument");
508
+ return ((p = f[$].liveConsumerNode) == null ? void 0 : p.map((l) => l.wrapper)) ?? [];
509
+ }
510
+ h.introspectSinks = _;
511
+ function N(f) {
512
+ if (!(0, e.isComputed)(f) && !(0, e.isState)(f))
513
+ throw new TypeError("Called hasSinks without a Signal argument");
514
+ const p = f[$].liveConsumerNode;
515
+ return p ? p.length > 0 : !1;
516
+ }
517
+ h.hasSinks = N;
518
+ function g(f) {
519
+ if (!(0, e.isComputed)(f) && !(0, e.isWatcher)(f))
520
+ throw new TypeError("Called hasSources without a Computed or Watcher argument");
521
+ const p = f[$].producerNode;
522
+ return p ? p.length > 0 : !1;
523
+ }
524
+ h.hasSources = g;
525
+ class z {
526
+ // When a (recursive) source of Watcher is written to, call this callback,
527
+ // if it hasn't already been called since the last `watch` call.
528
+ // No signals may be read or written during the notify.
529
+ constructor(p) {
530
+ D(this, u), D(this, d), K(this, n);
531
+ let l = Object.create(se);
532
+ l.wrapper = this, l.consumerMarkedDirty = p, l.consumerIsAlwaysLive = !0, l.consumerAllowSignalWrites = !1, l.producerNode = [], this[$] = l;
533
+ }
534
+ // Add these signals to the Watcher's set, and set the watcher to run its
535
+ // notify callback next time any signal in the set (or one of its dependencies) changes.
536
+ // Can be called with no arguments just to reset the "notified" state, so that
537
+ // the notify callback will be invoked again.
538
+ watch(...p) {
539
+ if (!(0, e.isWatcher)(this))
540
+ throw new TypeError("Called unwatch without Watcher receiver");
541
+ de(this, d, c).call(this, p);
542
+ const l = this[$];
543
+ l.dirty = !1;
544
+ const y = I(l);
545
+ for (const V of p)
546
+ F(V[$]);
547
+ I(y);
548
+ }
549
+ // Remove these signals from the watched set (e.g., for an effect which is disposed)
550
+ unwatch(...p) {
551
+ if (!(0, e.isWatcher)(this))
552
+ throw new TypeError("Called unwatch without Watcher receiver");
553
+ de(this, d, c).call(this, p);
554
+ const l = this[$];
555
+ O(l);
556
+ for (let y = l.producerNode.length - 1; y >= 0; y--)
557
+ if (p.includes(l.producerNode[y].wrapper)) {
558
+ Z(l.producerNode[y], l.producerIndexOfThis[y]);
559
+ const V = l.producerNode.length - 1;
560
+ if (l.producerNode[y] = l.producerNode[V], l.producerIndexOfThis[y] = l.producerIndexOfThis[V], l.producerNode.length--, l.producerIndexOfThis.length--, l.nextProducerIndex--, y < l.producerNode.length) {
561
+ const Te = l.producerIndexOfThis[y], ie = l.producerNode[y];
562
+ oe(ie), ie.liveConsumerIndexOfThis[Te] = y;
563
+ }
564
+ }
565
+ }
566
+ // Returns the set of computeds in the Watcher's set which are still yet
567
+ // to be re-evaluated
568
+ getPending() {
569
+ if (!(0, e.isWatcher)(this))
570
+ throw new TypeError("Called getPending without Watcher receiver");
571
+ return this[$].producerNode.filter((l) => l.dirty).map((l) => l.wrapper);
572
+ }
573
+ }
574
+ n = $, u = /* @__PURE__ */ new WeakSet(), d = /* @__PURE__ */ new WeakSet(), c = function(f) {
575
+ for (const p of f)
576
+ if (!(0, e.isComputed)(p) && !(0, e.isState)(p))
577
+ throw new TypeError("Called watch/unwatch without a Computed or State argument");
578
+ }, e.isWatcher = (f) => Y(u, f), h.Watcher = z;
579
+ function xe() {
580
+ var f;
581
+ return (f = De()) == null ? void 0 : f.wrapper;
582
+ }
583
+ h.currentComputed = xe, h.watched = Symbol("watched"), h.unwatched = Symbol("unwatched");
584
+ })(e.subtle || (e.subtle = {}));
585
+ })(S || (S = {}));
586
+ const ot = /* @__PURE__ */ new Set(["internals", "effect", "styleProps"]);
587
+ function it(e) {
588
+ return `--${e.replaceAll(/([a-z0-9])([A-Z])/g, "$1-$2").replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase()}`;
589
+ }
590
+ function ct(e, t, r) {
591
+ const { setup: s, attributes: o, styles: i } = Ce(e, t, r);
592
+ Ne({ setup: s, attributes: o, styles: i, useShadow: !1 });
593
+ }
594
+ function at(e, t, r) {
595
+ const { setup: s, attributes: o, styles: i } = Ce(e, t, r);
596
+ Ne({ setup: s, attributes: o, styles: i, useShadow: !0 });
597
+ }
598
+ function Ce(e, t, r) {
599
+ return typeof e == "function" ? { setup: e } : typeof e == "string" ? { styles: e, setup: t } : typeof t == "function" ? { attributes: e, setup: t } : { attributes: e, styles: t, setup: r };
600
+ }
601
+ const lt = (e) => new S.State(e);
602
+ function Ne(e) {
603
+ const {
604
+ setup: t,
605
+ tagName: r,
606
+ attributes: s = [],
607
+ useShadow: o = !0,
608
+ formAssociated: i = !1,
609
+ styles: a
610
+ } = e, h = r ?? t.name.replaceAll(/([a-z0-9])([A-Z])/g, "$1-$2").replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
611
+ if (!h.includes("-"))
612
+ throw new Error(`Function ${t.name} must include at least one capital letter to be converted to a valid custom element name`);
613
+ if (customElements.get(h))
614
+ throw new Error(`Custom element with name ${h} already defined`);
615
+ for (const u of s)
616
+ if (ot.has(u))
617
+ throw new Error(`Attribute name "${u}" conflicts with a reserved context property.`);
618
+ let n;
619
+ a !== void 0 && (n = new CSSStyleSheet(), o ? n.replaceSync(a) : (n.replaceSync(`@scope (${h}) { ${a} }`), document.adoptedStyleSheets = [
620
+ ...document.adoptedStyleSheets,
621
+ n
622
+ ])), customElements.define(h, class extends HTMLElement {
623
+ #e;
624
+ #t;
625
+ #s = [];
626
+ #r = [];
627
+ #o = /* @__PURE__ */ new Map();
628
+ static get observedAttributes() {
629
+ return s;
630
+ }
631
+ static get formAssociated() {
632
+ return i;
633
+ }
634
+ constructor() {
635
+ super(), o && this.attachShadow({ mode: "open" }), n && this.shadowRoot && (this.shadowRoot.adoptedStyleSheets = [
636
+ ...this.shadowRoot.adoptedStyleSheets,
637
+ n
638
+ ]);
639
+ const u = {
640
+ internals: this.attachInternals(),
641
+ effect: (m) => {
642
+ this.#s.push(m);
643
+ },
644
+ styleProps: (m) => {
645
+ for (const _ in m) {
646
+ const N = m[_], g = it(_);
647
+ N === null ? this.style.removeProperty(g) : this.style.setProperty(g, String(N));
648
+ }
649
+ }
650
+ };
651
+ s.forEach((m) => {
652
+ const _ = new S.State(this.getAttribute(m), {
653
+ equals: (g, z) => g === z
654
+ });
655
+ this.#o.set(m, _), u[m] = _, Object.defineProperty(this, m, {
656
+ get() {
657
+ return _.get();
658
+ },
659
+ set(g) {
660
+ if (g !== null && typeof g != "string")
661
+ throw new TypeError(`Attribute "${m}" only accepts strings or null, got ${typeof g}.`);
662
+ _.set(g);
663
+ },
664
+ enumerable: !0,
665
+ configurable: !0
666
+ });
667
+ const N = new S.subtle.Watcher(() => {
668
+ queueMicrotask(() => {
669
+ const g = _.get();
670
+ g === null ? this.removeAttribute(m) : this.setAttribute(m, g), N.watch();
671
+ });
672
+ });
673
+ N.watch(_);
674
+ });
675
+ const d = t.call(this, u);
676
+ this.#e = new S.Computed(() => d());
677
+ const c = () => He(this.#e.get(), o ? this.shadowRoot : this);
678
+ let v = !1;
679
+ this.#t = new S.subtle.Watcher(() => {
680
+ v || (v = !0, queueMicrotask(() => {
681
+ v = !1, c(), this.#t.watch();
682
+ }));
683
+ }), this.#t.watch(this.#e), c();
684
+ }
685
+ connectedCallback() {
686
+ this.#t.watch(this.#e), this.#r = this.#s.map((u) => u()).filter(
687
+ (u) => typeof u == "function"
688
+ );
689
+ }
690
+ disconnectedCallback() {
691
+ this.#t.unwatch(this.#e), this.#r.forEach((u) => u()), this.#r = [];
692
+ }
693
+ attributeChangedCallback(u, d, c) {
694
+ this.#o.get(u)?.set(c);
695
+ }
696
+ });
697
+ }
698
+ export {
699
+ Ne as define,
700
+ nt as html,
701
+ ct as lightElement,
702
+ at as shadowElement,
703
+ lt as state,
704
+ ut as svg
705
+ };