@manyducks.co/dolla 2.0.0-alpha.22 → 2.0.0-alpha.24

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.
@@ -1,63 +1,63 @@
1
- var wt = Object.defineProperty;
2
- var yt = (s, t, e) => t in s ? wt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var o = (s, t, e) => yt(s, typeof t != "symbol" ? t + "" : t, e);
4
- function ot(s) {
1
+ var Ot = Object.defineProperty;
2
+ var Pt = (s, t, e) => t in s ? Ot(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var o = (s, t, e) => Pt(s, typeof t != "symbol" ? t + "" : t, e);
4
+ function wt(s) {
5
5
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
6
6
  }
7
- var q = { exports: {} }, J;
8
- function Ct() {
9
- return J || (J = 1, function(s, t) {
7
+ var O = { exports: {} }, Q;
8
+ function Wt() {
9
+ return Q || (Q = 1, function(s, t) {
10
10
  Object.defineProperty(t, "__esModule", { value: !0 });
11
11
  var e = /* @__PURE__ */ function() {
12
- function l(c, h) {
13
- var d = [], f = !0, m = !1, v = void 0;
12
+ function a(l, h) {
13
+ var f = [], d = !0, m = !1, S = void 0;
14
14
  try {
15
- for (var S, _ = c[Symbol.iterator](); !(f = (S = _.next()).done) && (d.push(S.value), !(h && d.length === h)); f = !0) ;
15
+ for (var E, C = l[Symbol.iterator](); !(d = (E = C.next()).done) && (f.push(E.value), !(h && f.length === h)); d = !0) ;
16
16
  } catch (g) {
17
- m = !0, v = g;
17
+ m = !0, S = g;
18
18
  } finally {
19
19
  try {
20
- !f && _.return && _.return();
20
+ !d && C.return && C.return();
21
21
  } finally {
22
- if (m) throw v;
22
+ if (m) throw S;
23
23
  }
24
24
  }
25
- return d;
25
+ return f;
26
26
  }
27
- return function(c, h) {
28
- if (Array.isArray(c)) return c;
29
- if (Symbol.iterator in Object(c)) return l(c, h);
27
+ return function(l, h) {
28
+ if (Array.isArray(l)) return l;
29
+ if (Symbol.iterator in Object(l)) return a(l, h);
30
30
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
31
31
  };
32
- }(), n = function(l) {
33
- return l.reduce(function(c, h) {
34
- return 16 > h ? c + "0" + h.toString(16) : c + h.toString(16);
32
+ }(), n = function(a) {
33
+ return a.reduce(function(l, h) {
34
+ return 16 > h ? l + "0" + h.toString(16) : l + h.toString(16);
35
35
  }, "#");
36
- }, i = function(l, c, h) {
37
- var d = 0.5 > h ? h * (1 + c) : h + c - h * c, f = 2 * h - d, m = function(g, k, b) {
38
- var L = Math.round, w = 0 > b ? b + 1 : 1 < b ? b - 1 : b;
39
- return w = w < 1 / 6 ? g + 6 * (k - g) * w : w < 1 / 2 ? k : w < 2 / 3 ? g + 6 * (k - g) * (2 / 3 - w) : g, L(255 * w);
40
- }, v = m(f, d, l + 1 / 3), S = m(f, d, l), _ = m(f, d, l - 1 / 3);
41
- return [v, S, _];
42
- }, r = function(l, c, h, d) {
43
- var f = l % 1007 / 1007, m = function(g, k, b) {
44
- return g * (b - k) + k;
45
- }, v = m(f, c.min, c.max), S = m(f, h.min, h.max), _ = m(f, d.max, d.min);
46
- return [v, S, _];
47
- }, u = function(l) {
48
- return l.split("").reduce(function(c, h, d) {
49
- return c * h.charCodeAt(0) * d + 1;
36
+ }, r = function(a, l, h) {
37
+ var f = 0.5 > h ? h * (1 + l) : h + l - h * l, d = 2 * h - f, m = function(g, k, v) {
38
+ var j = Math.round, w = 0 > v ? v + 1 : 1 < v ? v - 1 : v;
39
+ return w = w < 1 / 6 ? g + 6 * (k - g) * w : w < 1 / 2 ? k : w < 2 / 3 ? g + 6 * (k - g) * (2 / 3 - w) : g, j(255 * w);
40
+ }, S = m(d, f, a + 1 / 3), E = m(d, f, a), C = m(d, f, a - 1 / 3);
41
+ return [S, E, C];
42
+ }, i = function(a, l, h, f) {
43
+ var d = a % 1007 / 1007, m = function(g, k, v) {
44
+ return g * (v - k) + k;
45
+ }, S = m(d, l.min, l.max), E = m(d, h.min, h.max), C = m(d, f.max, f.min);
46
+ return [S, E, C];
47
+ }, u = function(a) {
48
+ return a.split("").reduce(function(l, h, f) {
49
+ return l * h.charCodeAt(0) * f + 1;
50
50
  }, 1);
51
- }, a = function(l) {
52
- var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, _ = l.hashFunction, g = _ === void 0 ? u : _, k = l.scheme, b = k === void 0 ? "hex" : k, L = r(g(c), d, m, S), w = e(L, 3), H = w[0], z = w[1], Y = w[2], Z = i(H / 360, z, Y), gt = n(Z);
53
- return b === "hsl" ? [H, z, Y] : b === "rgb" ? Z : gt;
51
+ }, c = function(a) {
52
+ var l = a.str, h = a.hue, f = h === void 0 ? { min: 0, max: 360 } : h, d = a.sat, m = d === void 0 ? { min: 0.35, max: 0.65 } : d, S = a.light, E = S === void 0 ? { min: 0.3, max: 0.7 } : S, C = a.hashFunction, g = C === void 0 ? u : C, k = a.scheme, v = k === void 0 ? "hex" : k, j = i(g(l), f, m, E), w = e(j, 3), Y = w[0], Z = w[1], X = w[2], J = r(Y / 360, Z, X), Tt = n(J);
53
+ return v === "hsl" ? [Y, Z, X] : v === "rgb" ? J : Tt;
54
54
  };
55
- t.default = a, s.exports = t.default;
56
- }(q, q.exports)), q.exports;
55
+ t.default = c, s.exports = t.default;
56
+ }(O, O.exports)), O.exports;
57
57
  }
58
- var _t = Ct();
59
- const bt = /* @__PURE__ */ ot(_t);
60
- function M(s) {
58
+ var qt = Wt();
59
+ const Ut = /* @__PURE__ */ wt(qt);
60
+ function N(s) {
61
61
  const t = typeof s;
62
62
  switch (t) {
63
63
  case "undefined":
@@ -67,80 +67,106 @@ function M(s) {
67
67
  case "function":
68
68
  return /^\s*class\s+/.test(s.toString()) ? "class" : t;
69
69
  case "object":
70
- return s === null ? "null" : s instanceof Promise ? "promise" : Array.isArray(s) ? "array" : t;
70
+ return s === null ? "null" : s instanceof Promise ? "promise" : s instanceof Map ? "map" : s instanceof Set ? "set" : Array.isArray(s) ? "array" : t;
71
71
  default:
72
72
  return t;
73
73
  }
74
74
  }
75
- function O(s) {
75
+ function le(s, t) {
76
+ if (!s)
77
+ throw new TypeError(
78
+ F(s, t || "Failed assertion. Value is not truthy. Got type: %t, value: %v")
79
+ );
80
+ }
81
+ function V(s) {
76
82
  return Array.isArray(s);
77
83
  }
78
- function ut(...s) {
79
- const t = s[0], e = (n) => O(n) && n.every((i) => t(i));
84
+ function yt(...s) {
85
+ const t = s[0], e = (n) => V(n) && n.every((r) => t(r));
80
86
  return s.length < 2 ? e : e(s[1]);
81
87
  }
82
- function Jt(...s) {
83
- const t = s[0], e = E(s[2]) ? s[2] : "Expected an array of valid items. Got type: %t, value: %v", n = (i) => {
84
- if (O(i) && i.every((r) => t(r)))
88
+ function he(...s) {
89
+ const t = s[0], e = x(s[2]) ? s[2] : "Expected an array of valid items. Got type: %t, value: %v", n = (r) => {
90
+ if (V(r) && r.every((i) => t(i)))
85
91
  return !0;
86
- throw new TypeError(G(i, e));
92
+ throw new TypeError(F(r, e));
87
93
  };
88
94
  return s.length < 2 ? n : n(s[1]);
89
95
  }
90
- function E(s) {
96
+ function x(s) {
91
97
  return typeof s == "string";
92
98
  }
93
- function Qt(s, t) {
94
- if (E(s))
99
+ function fe(s, t) {
100
+ if (x(s))
95
101
  return !0;
96
- throw new TypeError(G(s, t ?? "Expected a string. Got type: %t, value: %v"));
102
+ throw new TypeError(F(s, t ?? "Expected a string. Got type: %t, value: %v"));
97
103
  }
98
- function A(s) {
99
- return typeof s == "function" && !kt(s);
104
+ function P(s) {
105
+ return typeof s == "function" && !Ft(s);
100
106
  }
101
- function vt(s) {
107
+ function _t(s) {
102
108
  return typeof s == "number" && !isNaN(s);
103
109
  }
104
- function kt(s) {
110
+ function Ft(s) {
105
111
  return typeof s == "function" && /^\s*class\s+/.test(s.toString());
106
112
  }
107
- function Xt(...s) {
108
- const t = s[0], e = E(s[2]) ? s[2] : `Expected instance of ${t.name}. Got type: %t, value: %v`, n = (i) => {
109
- if (i instanceof t)
113
+ function de(...s) {
114
+ const t = s[0], e = x(s[2]) ? s[2] : `Expected instance of ${t.name}. Got type: %t, value: %v`, n = (r) => {
115
+ if (r instanceof t)
110
116
  return !0;
111
- throw new TypeError(G(i, e));
117
+ throw new TypeError(F(r, e));
112
118
  };
113
119
  return s.length < 2 ? n : n(s[1]);
114
120
  }
115
- function U(s) {
116
- return s != null && typeof s == "object" && !O(s);
121
+ function Ct(s) {
122
+ return s != null && typeof s == "object" && !V(s);
117
123
  }
118
- function G(s, t) {
119
- var i;
120
- const e = M(s), n = ((i = s == null ? void 0 : s.toString) == null ? void 0 : i.call(s)) || String(s);
124
+ function F(s, t) {
125
+ var r;
126
+ const e = N(s), n = ((r = s == null ? void 0 : s.toString) == null ? void 0 : r.call(s)) || String(s);
121
127
  return t.replaceAll("%t", e).replaceAll("%v", n);
122
128
  }
123
- var I, Q;
124
- function St() {
125
- return Q || (Q = 1, I = function s(t, e) {
129
+ var I, tt;
130
+ function Lt() {
131
+ return tt || (tt = 1, I = function s(t, e) {
126
132
  if (t === e) return !0;
127
133
  if (t && e && typeof t == "object" && typeof e == "object") {
128
134
  if (t.constructor !== e.constructor) return !1;
129
- var n, i, r;
135
+ var n, r, i;
130
136
  if (Array.isArray(t)) {
131
137
  if (n = t.length, n != e.length) return !1;
132
- for (i = n; i-- !== 0; )
133
- if (!s(t[i], e[i])) return !1;
138
+ for (r = n; r-- !== 0; )
139
+ if (!s(t[r], e[r])) return !1;
140
+ return !0;
141
+ }
142
+ if (t instanceof Map && e instanceof Map) {
143
+ if (t.size !== e.size) return !1;
144
+ for (r of t.entries())
145
+ if (!e.has(r[0])) return !1;
146
+ for (r of t.entries())
147
+ if (!s(r[1], e.get(r[0]))) return !1;
148
+ return !0;
149
+ }
150
+ if (t instanceof Set && e instanceof Set) {
151
+ if (t.size !== e.size) return !1;
152
+ for (r of t.entries())
153
+ if (!e.has(r[0])) return !1;
154
+ return !0;
155
+ }
156
+ if (ArrayBuffer.isView(t) && ArrayBuffer.isView(e)) {
157
+ if (n = t.length, n != e.length) return !1;
158
+ for (r = n; r-- !== 0; )
159
+ if (t[r] !== e[r]) return !1;
134
160
  return !0;
135
161
  }
136
162
  if (t.constructor === RegExp) return t.source === e.source && t.flags === e.flags;
137
163
  if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === e.valueOf();
138
164
  if (t.toString !== Object.prototype.toString) return t.toString() === e.toString();
139
- if (r = Object.keys(t), n = r.length, n !== Object.keys(e).length) return !1;
140
- for (i = n; i-- !== 0; )
141
- if (!Object.prototype.hasOwnProperty.call(e, r[i])) return !1;
142
- for (i = n; i-- !== 0; ) {
143
- var u = r[i];
165
+ if (i = Object.keys(t), n = i.length, n !== Object.keys(e).length) return !1;
166
+ for (r = n; r-- !== 0; )
167
+ if (!Object.prototype.hasOwnProperty.call(e, i[r])) return !1;
168
+ for (r = n; r-- !== 0; ) {
169
+ var u = i[r];
144
170
  if (!s(t[u], e[u])) return !1;
145
171
  }
146
172
  return !0;
@@ -148,56 +174,66 @@ function St() {
148
174
  return t !== t && e !== e;
149
175
  }), I;
150
176
  }
151
- var xt = St();
152
- const Et = /* @__PURE__ */ ot(xt), $t = () => {
177
+ var jt = Lt();
178
+ const It = /* @__PURE__ */ wt(jt), Rt = () => {
153
179
  };
154
- function te(s, t) {
180
+ let R = 1;
181
+ function vt() {
182
+ return R = R % Number.MAX_SAFE_INTEGER + 1, R.toString(36) + Date.now().toString(36);
183
+ }
184
+ function bt(s, t) {
155
185
  return s === t;
156
186
  }
157
- function ee(s, t) {
187
+ function pe(s, t) {
158
188
  if (s === t) return !0;
159
- const e = M(s);
160
- if (e !== M(t))
189
+ const e = N(s);
190
+ if (e !== N(t))
161
191
  return !1;
162
- if (e === "object") {
163
- let n = 0;
164
- for (const i in s) {
165
- if (s[i] !== t[i]) return !1;
166
- n++;
167
- }
168
- return Object.keys(t).length === n;
169
- } else if (e === "array") {
170
- if (s.length !== t.length) return !1;
171
- for (let n = 0; n < s.length; n++)
172
- if (s[n] !== t[n]) return !1;
173
- return !0;
192
+ switch (e) {
193
+ case "object":
194
+ let n = 0;
195
+ for (const r in s) {
196
+ if (s[r] !== t[r]) return !1;
197
+ n++;
198
+ }
199
+ return Object.keys(t).length === n;
200
+ case "array":
201
+ if (s.length !== t.length) return !1;
202
+ for (let r = 0; r < s.length; r++)
203
+ if (s[r] !== t[r]) return !1;
204
+ return !0;
205
+ case "map":
206
+ if (s.size !== t.size) return !1;
207
+ for (const r of s.keys())
208
+ if (s[r] !== t[r]) return !1;
209
+ return !0;
210
+ case "set":
211
+ if (P(s.symmetricDifference))
212
+ return s.symmetricDifference(t).size === 0;
213
+ for (const r of s.keys())
214
+ if (s[r] !== t.get(r)) return !1;
215
+ return !0;
174
216
  }
175
217
  return !1;
176
218
  }
177
- const ne = Et;
178
- function Nt(s, t) {
219
+ const me = It;
220
+ function Gt(s, t) {
179
221
  const e = (n) => {
180
- const i = {};
181
- for (const r in n)
182
- s.includes(r) || (i[r] = n[r]);
183
- return i;
222
+ const r = {};
223
+ for (const i in n)
224
+ s.includes(i) || (r[i] = n[i]);
225
+ return r;
184
226
  };
185
227
  return t == null ? e : e(t);
186
228
  }
187
- function se() {
188
- if (typeof window < "u" && window.console)
189
- return window.console;
190
- if (typeof global < "u" && global.console)
191
- return global.console;
192
- }
193
- function Mt(s) {
194
- return bt({
229
+ function Dt(s) {
230
+ return Ut({
195
231
  str: s,
196
232
  sat: { min: 0.35, max: 0.55 },
197
233
  light: { min: 0.6, max: 0.6 }
198
234
  });
199
235
  }
200
- function ie(s) {
236
+ function ge(s) {
201
237
  if (s instanceof RegExp)
202
238
  return (n) => s.test(n);
203
239
  const t = {
@@ -205,21 +241,21 @@ function ie(s) {
205
241
  negative: []
206
242
  }, e = s.split(",").map((n) => n.trim()).filter((n) => n !== "");
207
243
  for (let n of e) {
208
- let i = "positive";
209
- n.startsWith("-") && (i = "negative", n = n.slice(1)), n === "*" ? t[i].push(function() {
244
+ let r = "positive";
245
+ n.startsWith("-") && (r = "negative", n = n.slice(1)), n === "*" ? t[r].push(function() {
210
246
  return !0;
211
- }) : n.endsWith("*") ? t[i].push(function(r) {
212
- return r.startsWith(n.slice(0, n.length - 1));
213
- }) : t[i].push(function(r) {
214
- return r === n;
247
+ }) : n.endsWith("*") ? t[r].push(function(i) {
248
+ return i.startsWith(n.slice(0, n.length - 1));
249
+ }) : t[r].push(function(i) {
250
+ return i === n;
215
251
  });
216
252
  }
217
253
  return function(n) {
218
- const { positive: i, negative: r } = t;
219
- return !(r.some((u) => u(n)) || i.length > 0 && !i.some((u) => u(n)));
254
+ const { positive: r, negative: i } = t;
255
+ return !(i.some((u) => u(n)) || r.length > 0 && !r.some((u) => u(n)));
220
256
  };
221
257
  }
222
- const P = {
258
+ const T = Symbol.for("DollaState"), D = Symbol.for("DollaSettableState"), St = Symbol.for("DollaRef"), kt = Symbol.for("DollaMarkup"), b = Symbol.for("DollaMarkupElement"), W = {
223
259
  watcherCount: 0,
224
260
  increment() {
225
261
  this.watcherCount++, this._log();
@@ -234,7 +270,7 @@ const P = {
234
270
  console.log(
235
271
  `%c[DOLLA_DEV_DEBUG] %c${this._label}%c%c%c`,
236
272
  "color:#e44c4c;font-weight:bold",
237
- `color:${Mt(this._label)};font-weight:bold`,
273
+ `color:${Dt(this._label)};font-weight:bold`,
238
274
  "color:#777",
239
275
  "color:#aaa",
240
276
  "color:#777",
@@ -242,39 +278,36 @@ const P = {
242
278
  ), this._timeout = null;
243
279
  }, 200));
244
280
  }
245
- }, T = Symbol("State"), B = Symbol("SettableState"), at = Symbol("Ref");
281
+ };
246
282
  function p(s) {
247
283
  return (s == null ? void 0 : s[T]) === !0;
248
284
  }
249
- function D(s) {
250
- return (s == null ? void 0 : s[B]) === !0;
285
+ function B(s) {
286
+ return (s == null ? void 0 : s[D]) === !0;
251
287
  }
252
- function lt(s) {
253
- return (s == null ? void 0 : s[at]) === !0;
288
+ function Et(s) {
289
+ return (s == null ? void 0 : s[St]) === !0;
254
290
  }
255
- function At(s) {
291
+ function Bt(s) {
256
292
  return p(s) ? s.get() : s;
257
293
  }
258
- function W(s) {
259
- return D(s) ? new F(s) : p(s) ? s : new F({
294
+ function L(s) {
295
+ return B(s) ? new q(s) : p(s) ? s : new q({
260
296
  get() {
261
297
  return s;
262
298
  },
263
299
  watch(t, e = {}) {
264
- return e != null && e.lazy || t(s), $t;
300
+ return e != null && e.lazy || t(s), Rt;
265
301
  }
266
302
  });
267
303
  }
268
- class N {
304
+ class z {
269
305
  constructor(t, e) {
270
306
  o(this, "value");
271
307
  o(this, "watchers", []);
272
- o(this, "equals", N.defaultEquals);
308
+ o(this, "equals", bt);
273
309
  this.value = t, e != null && e.equals && (this.equals = e.equals);
274
310
  }
275
- static defaultEquals(t, e) {
276
- return t === e;
277
- }
278
311
  get() {
279
312
  return this.value;
280
313
  }
@@ -290,18 +323,18 @@ class N {
290
323
  }
291
324
  }
292
325
  watch(t, e) {
293
- return this.watchers.push(t), e != null && e.lazy || t(this.value), P.increment(), () => {
326
+ return this.watchers.push(t), e != null && e.lazy || t(this.value), W.increment(), () => {
294
327
  const n = this.watchers.indexOf(t);
295
- n > -1 && this.watchers.splice(n, 1), P.decrement();
328
+ n > -1 && this.watchers.splice(n, 1), W.decrement();
296
329
  };
297
330
  }
298
331
  }
299
- var et;
300
- et = T;
301
- class F {
332
+ var st;
333
+ st = T;
334
+ class q {
302
335
  constructor(t) {
303
336
  // Instances will pass isState() with this symbol
304
- o(this, et, !0);
337
+ o(this, st, !0);
305
338
  o(this, "__value");
306
339
  if (t == null)
307
340
  throw new TypeError("Value is null");
@@ -314,17 +347,17 @@ class F {
314
347
  return this.__value.watch(t, e);
315
348
  }
316
349
  }
317
- function R(s, t) {
318
- const e = new N(s, t);
319
- return [new F(e), (i) => e.set(i)];
350
+ function G(s, t) {
351
+ const e = new z(s, t);
352
+ return [new q(e), (r) => e.set(r)];
320
353
  }
321
- var nt, st;
322
- st = T, nt = B;
323
- class Vt {
354
+ var rt, it;
355
+ it = T, rt = D;
356
+ class zt {
324
357
  constructor(t) {
325
358
  // Instances will pass isState() and isSettableState() with these symbols
326
- o(this, st, !0);
327
- o(this, nt, !0);
359
+ o(this, it, !0);
360
+ o(this, rt, !0);
328
361
  o(this, "__value");
329
362
  if (t == null)
330
363
  throw new TypeError("Value is null");
@@ -340,29 +373,29 @@ class Vt {
340
373
  return this.__value.watch(t, e);
341
374
  }
342
375
  }
343
- function re(s, t) {
344
- return new Vt(new N(s, t));
376
+ function we(s, t) {
377
+ return new zt(new z(s, t));
345
378
  }
346
- function oe(s, t) {
379
+ function ye(s, t) {
347
380
  return {
348
381
  [T]: !0,
349
- [B]: !0,
382
+ [D]: !0,
350
383
  get: s.get.bind(s),
351
384
  watch: s.watch.bind(s),
352
385
  set: t
353
386
  };
354
387
  }
355
- function ue(s, t) {
388
+ function _e(s, t) {
356
389
  return function(n) {
357
- const i = s.get();
358
- let r;
359
- typeof n == "function" ? r = n(i) : r = n, t(r, i);
390
+ const r = s.get();
391
+ let i;
392
+ typeof n == "function" ? i = n(r) : i = n, t(i, r);
360
393
  };
361
394
  }
362
- const X = Symbol("EMPTY");
363
- class Ot {
395
+ const et = Symbol("EMPTY");
396
+ class Kt {
364
397
  constructor(t, e, n) {
365
- o(this, "equals", N.defaultEquals);
398
+ o(this, "equals", bt);
366
399
  /**
367
400
  * Array of states this holder's value is derived from.
368
401
  */
@@ -390,7 +423,7 @@ class Ot {
390
423
  /**
391
424
  * The current value as returned from `fn` (may be a State)
392
425
  */
393
- o(this, "value", X);
426
+ o(this, "value", et);
394
427
  /**
395
428
  * The current unwrapped value.
396
429
  */
@@ -399,7 +432,7 @@ class Ot {
399
432
  * When value is a State, this function will stop watching its value.
400
433
  */
401
434
  o(this, "stopWatchingCurrentValue");
402
- this.sources = t.map(W), this.fn = e, n != null && n.equals && (this.equals = n.equals), this.previousSourceValues = new Array(t.length).fill(X, 0, t.length);
435
+ this.sources = t.map(L), this.fn = e, n != null && n.equals && (this.equals = n.equals), this.previousSourceValues = new Array(t.length).fill(et, 0, t.length);
403
436
  }
404
437
  /*==========================*\
405
438
  || "Public" methods ||
@@ -410,8 +443,8 @@ class Ot {
410
443
  watch(t, e) {
411
444
  this.isWatchingSources || this.startWatchingSources();
412
445
  const n = this.watchers;
413
- return n.push(t), e != null && e.lazy || t(this.rawValue), P.increment(), () => {
414
- n.splice(n.indexOf(t), 1), this.isWatchingSources && n.length === 0 && this.stopWatchingSources(), P.decrement();
446
+ return n.push(t), e != null && e.lazy || t(this.rawValue), W.increment(), () => {
447
+ n.splice(n.indexOf(t), 1), this.isWatchingSources && n.length === 0 && this.stopWatchingSources(), W.decrement();
415
448
  };
416
449
  }
417
450
  /*==========================*\
@@ -423,26 +456,26 @@ class Ot {
423
456
  }
424
457
  update() {
425
458
  const t = this.sources, e = this.previousSourceValues;
426
- let n = !1, i;
427
- for (let r = 0; r < t.length; r++)
428
- i = t[r].get(), !n && !this.equals(i, e[r]) && (n = !0), e[r] = i;
459
+ let n = !1, r;
460
+ for (let i = 0; i < t.length; i++)
461
+ r = t[i].get(), !n && !this.equals(r, e[i]) && (n = !0), e[i] = r;
429
462
  n && this.setValue(this.fn(...e));
430
463
  }
431
464
  getValue() {
432
465
  return this.isWatchingSources || this.update(), this.rawValue;
433
466
  }
434
467
  setValue(t) {
435
- this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = t, this.rawValue = At(t), this.isWatchingSources && p(t) ? this.stopWatchingCurrentValue = t.watch((e) => {
468
+ this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = t, this.rawValue = Bt(t), this.isWatchingSources && p(t) ? this.stopWatchingCurrentValue = t.watch((e) => {
436
469
  this.rawValue = e, this.notify(e);
437
470
  }) : this.notify(this.rawValue);
438
471
  }
439
472
  startWatchingSources() {
440
473
  const t = this.previousSourceValues;
441
474
  for (let n = 0; n < this.sources.length; n++)
442
- this.sourceWatcher.watch([this.sources[n]], (i) => {
443
- if (t[n] = i, this.isWatchingSources) {
444
- const r = this.fn(...t);
445
- this.equals(r, this.value) || this.setValue(r);
475
+ this.sourceWatcher.watch([this.sources[n]], (r) => {
476
+ if (t[n] = r, this.isWatchingSources) {
477
+ const i = this.fn(...t);
478
+ this.equals(i, this.value) || this.setValue(i);
446
479
  }
447
480
  });
448
481
  this.isWatchingSources = !0;
@@ -453,17 +486,17 @@ class Ot {
453
486
  this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
454
487
  }
455
488
  }
456
- function Tt(s, t, e) {
457
- const n = new Ot(s, t, e);
458
- return new F(n);
489
+ function Ht(s, t, e) {
490
+ const n = new Kt(s, t, e);
491
+ return new q(n);
459
492
  }
460
- var it, rt;
461
- rt = at, it = T;
462
- class qt {
493
+ var ot, ut;
494
+ ut = St, ot = T;
495
+ class Yt {
463
496
  constructor(t) {
464
497
  // Instances will pass isRef() and isState() with these symbols
465
- o(this, rt, !0);
466
- o(this, it, !0);
498
+ o(this, ut, !0);
499
+ o(this, ot, !0);
467
500
  o(this, "__value");
468
501
  this.__value = t;
469
502
  }
@@ -480,8 +513,8 @@ class qt {
480
513
  this.__value.set(t);
481
514
  }
482
515
  }
483
- function ae() {
484
- return new qt(new N(void 0));
516
+ function Ce() {
517
+ return new Yt(new z(void 0));
485
518
  }
486
519
  function K() {
487
520
  const s = [];
@@ -489,11 +522,11 @@ function K() {
489
522
  watch(t, e) {
490
523
  if (t.length === 0)
491
524
  throw new TypeError("Expected at least one state to watch.");
492
- t = t.map(W);
525
+ t = t.map(L);
493
526
  let n;
494
- return t.length > 1 ? n = Tt(t, e).watch(() => null) : n = t[0].watch(e), s.push(n), () => {
495
- let i = s.indexOf(n);
496
- i > -1 && s.splice(i, 1), n();
527
+ return t.length > 1 ? n = Ht(t, e).watch(() => null) : n = t[0].watch(e), s.push(n), () => {
528
+ let r = s.indexOf(n);
529
+ r > -1 && s.splice(r, 1), n();
497
530
  };
498
531
  },
499
532
  stopAll() {
@@ -502,18 +535,21 @@ function K() {
502
535
  }
503
536
  };
504
537
  }
505
- function Pt(s) {
506
- for (var t, e, n = arguments, i = 1, r = "", u = "", a = [0], l = function(d) {
507
- i === 1 && (d || (r = r.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(d ? n[d] : r) : i === 3 && (d || r) ? (a[1] = d ? n[d] : r, i = 2) : i === 2 && r === "..." && d ? a[2] = Object.assign(a[2] || {}, n[d]) : i === 2 && r && !d ? (a[2] = a[2] || {})[r] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[e] = d ? r ? r + n[d] : n[d] : r, i = 6) : (d || r) && (a[2][e] += d ? r + n[d] : r)), r = "";
508
- }, c = 0; c < s.length; c++) {
509
- c && (i === 1 && l(), l(c));
510
- for (var h = 0; h < s[c].length; h++) t = s[c][h], i === 1 ? t === "<" ? (l(), a = [a, "", null], i = 3) : r += t : i === 4 ? r === "--" && t === ">" ? (i = 1, r = "") : r = t + r[0] : u ? t === u ? u = "" : r += t : t === '"' || t === "'" ? u = t : t === ">" ? (l(), i = 1) : i && (t === "=" ? (i = 5, e = r, r = "") : t === "/" && (i < 5 || s[c][h + 1] === ">") ? (l(), i === 3 && (a = a[0]), i = a, (a = a[0]).push(this.apply(null, i.slice(1))), i = 0) : t === " " || t === " " || t === `
511
- ` || t === "\r" ? (l(), i = 2) : r += t), i === 3 && r === "!--" && (i = 4, a = a[0]);
538
+ function Zt(s) {
539
+ for (var t, e, n = arguments, r = 1, i = "", u = "", c = [0], a = function(f) {
540
+ r === 1 && (f || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(f ? n[f] : i) : r === 3 && (f || i) ? (c[1] = f ? n[f] : i, r = 2) : r === 2 && i === "..." && f ? c[2] = Object.assign(c[2] || {}, n[f]) : r === 2 && i && !f ? (c[2] = c[2] || {})[i] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[e] = f ? i ? i + n[f] : n[f] : i, r = 6) : (f || i) && (c[2][e] += f ? i + n[f] : i)), i = "";
541
+ }, l = 0; l < s.length; l++) {
542
+ l && (r === 1 && a(), a(l));
543
+ for (var h = 0; h < s[l].length; h++) t = s[l][h], r === 1 ? t === "<" ? (a(), c = [c, "", null], r = 3) : i += t : r === 4 ? i === "--" && t === ">" ? (r = 1, i = "") : i = t + i[0] : u ? t === u ? u = "" : i += t : t === '"' || t === "'" ? u = t : t === ">" ? (a(), r = 1) : r && (t === "=" ? (r = 5, e = i, i = "") : t === "/" && (r < 5 || s[l][h + 1] === ">") ? (a(), r === 3 && (c = c[0]), r = c, (c = c[0]).push(this.apply(null, r.slice(1))), r = 0) : t === " " || t === " " || t === `
544
+ ` || t === "\r" ? (a(), r = 2) : i += t), r === 3 && i === "!--" && (r = 4, c = c[0]);
512
545
  }
513
- return l(), a.length > 2 ? a.slice(1) : a[1];
546
+ return a(), c.length > 2 ? c.slice(1) : c[1];
514
547
  }
515
- class Ft {
548
+ var at;
549
+ at = b;
550
+ class Xt {
516
551
  constructor(t) {
552
+ o(this, at, !0);
517
553
  o(this, "node");
518
554
  o(this, "endNode");
519
555
  o(this, "$predicate");
@@ -524,7 +560,7 @@ class Ft {
524
560
  o(this, "elementContext");
525
561
  o(this, "initialUpdateHappened", !1);
526
562
  o(this, "previousValue");
527
- this.$predicate = t.$predicate, this.thenContent = t.thenContent ? V(t.thenContent) : void 0, this.elseContent = t.elseContent ? V(t.elseContent) : void 0, this.elementContext = t.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Conditional"), this.endNode = document.createComment("/Conditional")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
563
+ this.$predicate = t.$predicate, this.thenContent = t.thenContent ? A(t.thenContent) : void 0, this.elseContent = t.elseContent ? A(t.elseContent) : void 0, this.elementContext = t.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Conditional"), this.endNode = document.createComment("/Conditional")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
528
564
  }
529
565
  get isMounted() {
530
566
  return this.node.parentNode != null;
@@ -537,8 +573,8 @@ class Ft {
537
573
  unmount(t = !1) {
538
574
  var e, n;
539
575
  this.stopCallback && (this.stopCallback(), this.stopCallback = void 0);
540
- for (const i of this.connectedContent)
541
- i.unmount(t);
576
+ for (const r of this.connectedContent)
577
+ r.unmount(t);
542
578
  this.connectedContent = [], this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode));
543
579
  }
544
580
  update(t) {
@@ -546,44 +582,41 @@ class Ft {
546
582
  for (const n of this.connectedContent)
547
583
  n.unmount(!1);
548
584
  if (this.connectedContent = [], this.node.parentNode != null) {
549
- t && this.thenContent ? this.connectedContent = C(this.elementContext, this.thenContent) : !t && this.elseContent && (this.connectedContent = C(this.elementContext, this.elseContent));
585
+ t && this.thenContent ? this.connectedContent = _(this.elementContext, this.thenContent) : !t && this.elseContent && (this.connectedContent = _(this.elementContext, this.elseContent));
550
586
  for (let n = 0; n < this.connectedContent.length; n++) {
551
- const i = this.connectedContent[n], r = ((e = this.connectedContent[n - 1]) == null ? void 0 : e.node) ?? this.node;
552
- i.mount(this.node.parentNode, r);
587
+ const r = this.connectedContent[n], i = ((e = this.connectedContent[n - 1]) == null ? void 0 : e.node) ?? this.node;
588
+ r.mount(this.node.parentNode, i);
553
589
  }
554
590
  this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Conditional (${t ? "truthy" : "falsy"})`);
555
591
  }
556
592
  }
557
593
  }
558
- const Ut = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
559
- let ct = (s = 21) => {
560
- let t = "", e = crypto.getRandomValues(new Uint8Array(s |= 0));
561
- for (; s--; )
562
- t += Ut[e[s] & 63];
563
- return t;
564
- };
565
- const Wt = (s) => /^on[A-Z]/.test(s);
566
- class jt {
567
- constructor({ tag: t, props: e, children: n, elementContext: i }) {
594
+ const Jt = (s) => /^on[A-Z]/.test(s);
595
+ var ct;
596
+ ct = b;
597
+ class Qt {
598
+ constructor({ tag: t, props: e, children: n, elementContext: r }) {
599
+ o(this, ct, !0);
568
600
  o(this, "node");
569
601
  o(this, "props");
570
602
  o(this, "children");
571
603
  o(this, "stopCallbacks", []);
572
604
  o(this, "elementContext");
573
- o(this, "uniqueId", ct());
605
+ o(this, "uniqueId", vt());
606
+ o(this, "_batchWrite");
574
607
  // Track the ref so we can nullify it on unmount.
575
608
  o(this, "ref");
576
609
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
577
610
  o(this, "canClickAway", !1);
578
- if (i = { ...i }, t.toLowerCase() === "svg" && (i.isSVG = !0), i.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", t) : this.node = document.createElement(t), i.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), e.ref)
579
- if (lt(e.ref))
580
- this.ref = e.ref;
611
+ if (r = { ...r }, this._batchWrite = r.root.batch.write.bind(r.root.batch), t.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", t) : this.node = document.createElement(t), r.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), e.ref)
612
+ if (Et(e.ref))
613
+ this.ref = e.ref, this.ref.node = this.node;
581
614
  else
582
615
  throw new Error("Expected ref to be a Ref object. Got: " + e.ref);
583
616
  this.props = {
584
- ...Nt(["ref", "class", "className"], e),
617
+ ...Gt(["ref", "class", "className"], e),
585
618
  class: e.className ?? e.class
586
- }, this.children = n ? C(i, n) : [], this.elementContext = i;
619
+ }, this.children = n ? _(r, n) : [], this.elementContext = r;
587
620
  }
588
621
  get isMounted() {
589
622
  return this.node.parentNode != null;
@@ -596,7 +629,7 @@ class jt {
596
629
  n.mount(this.node);
597
630
  this.applyProps(this.node, this.props), this.props.style && this.applyStyles(this.node, this.props.style, this.stopCallbacks), this.props.class && this.applyClasses(this.node, this.props.class, this.stopCallbacks);
598
631
  }
599
- t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), this.ref && (this.ref.node = this.node), setTimeout(() => {
632
+ t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), setTimeout(() => {
600
633
  this.canClickAway = !0;
601
634
  }, 0);
602
635
  }
@@ -605,7 +638,7 @@ class jt {
605
638
  if (this.isMounted) {
606
639
  for (const n of this.children)
607
640
  n.unmount(!0);
608
- this.ref && (this.ref.node = void 0), t || (e = this.node.parentNode) == null || e.removeChild(this.node), this.canClickAway = !1;
641
+ t || (e = this.node.parentNode) == null || e.removeChild(this.node), this.ref && (this.ref.node = void 0), this.canClickAway = !1;
609
642
  for (const n of this.stopCallbacks)
610
643
  n();
611
644
  this.stopCallbacks = [];
@@ -614,81 +647,80 @@ class jt {
614
647
  getUpdateKey(t, e) {
615
648
  return `${this.uniqueId}:${t}:${e}`;
616
649
  }
650
+ _mutate(t, e) {
651
+ this.isMounted ? this._batchWrite(t, e) : t();
652
+ }
617
653
  attachProp(t, e, n) {
618
654
  p(t) ? this.stopCallbacks.push(
619
- t.watch((i) => {
620
- this.elementContext.root.batch.write(() => {
621
- e(i);
622
- }, n);
655
+ t.watch((r) => {
656
+ this._mutate(() => e(r), n);
623
657
  })
624
- ) : this.elementContext.root.batch.write(() => {
625
- e(t);
626
- }, n);
658
+ ) : this._mutate(() => e(t), n);
627
659
  }
628
660
  applyProps(t, e) {
629
661
  for (const n in e) {
630
- const i = e[n];
662
+ const r = e[n];
631
663
  if (n === "attributes") {
632
- const r = i;
633
- for (const u in r)
664
+ const i = r;
665
+ for (const u in i)
634
666
  this.attachProp(
635
- r[u],
636
- (a) => {
637
- a == null ? t.removeAttribute(u) : t.setAttribute(u, String(a));
667
+ i[u],
668
+ (c) => {
669
+ c == null ? t.removeAttribute(u) : t.setAttribute(u, String(c));
638
670
  },
639
671
  this.getUpdateKey("attr", u)
640
672
  );
641
673
  } else if (n === "eventListeners") {
642
- const r = i;
643
- for (const u in r) {
644
- const a = p(i) ? (l) => i.get()(l) : i;
645
- t.addEventListener(u, a), this.stopCallbacks.push(() => {
646
- t.removeEventListener(u, a);
674
+ const i = r;
675
+ for (const u in i) {
676
+ const c = p(r) ? (a) => r.get()(a) : r;
677
+ t.addEventListener(u, c), this.stopCallbacks.push(() => {
678
+ t.removeEventListener(u, c);
647
679
  });
648
680
  }
649
681
  } else if (n === "onClickOutside" || n === "onclickoutside") {
650
- const r = (a) => {
651
- this.canClickAway && !t.contains(a.target) && (p(i) ? i.get()(a) : i(a));
682
+ const i = (c) => {
683
+ this.canClickAway && !t.contains(c.target) && (p(r) ? r.get()(c) : r(c));
652
684
  }, u = { capture: !0 };
653
- window.addEventListener("click", r, u), this.stopCallbacks.push(() => {
654
- window.removeEventListener("click", r, u);
685
+ window.addEventListener("click", i, u), this.stopCallbacks.push(() => {
686
+ window.removeEventListener("click", i, u);
655
687
  });
656
688
  } else if (n === "$$value") {
657
- if (!D(i))
658
- throw new TypeError(`$$value attribute must be a settable state. Got: ${i}`);
689
+ if (!B(r))
690
+ throw new TypeError(`$$value attribute must be a settable state. Got: ${r}`);
659
691
  this.attachProp(
660
- i,
692
+ r,
661
693
  (u) => {
662
694
  u == null ? t.value = "" : t.value = String(u);
663
695
  },
664
696
  this.getUpdateKey("attr", "value")
665
697
  );
666
- const r = (u) => {
667
- const a = Lt(i.get(), u.currentTarget.value);
668
- i.set(a);
698
+ const i = (u) => {
699
+ const c = te(r.get(), u.currentTarget.value);
700
+ r.set(c);
669
701
  };
670
- t.addEventListener("input", r), this.stopCallbacks.push(() => {
671
- t.removeEventListener("input", r);
702
+ t.addEventListener("input", i), this.stopCallbacks.push(() => {
703
+ t.removeEventListener("input", i);
672
704
  });
673
- } else if (Wt(n)) {
674
- const r = n.slice(2).toLowerCase(), u = p(i) ? (a) => i.get()(a) : i;
675
- t.addEventListener(r, u), this.stopCallbacks.push(() => {
676
- t.removeEventListener(r, u);
705
+ } else if (Jt(n)) {
706
+ const i = n.slice(2).toLowerCase(), u = p(r) ? (c) => r.get()(c) : r;
707
+ t.addEventListener(i, u), this.stopCallbacks.push(() => {
708
+ t.removeEventListener(i, u);
677
709
  });
678
710
  } else if (n.includes("-"))
679
711
  this.attachProp(
680
- i,
681
- (r) => {
682
- r == null ? t.removeAttribute(n) : t.setAttribute(n, String(r));
712
+ r,
713
+ (i) => {
714
+ i == null ? t.removeAttribute(n) : t.setAttribute(n, String(i));
683
715
  },
684
716
  this.getUpdateKey("attr", n)
685
717
  );
686
- else if (!It.includes(n))
718
+ else if (!ee.includes(n))
687
719
  if (this.elementContext.isSVG)
688
720
  this.attachProp(
689
- i,
690
- (r) => {
691
- r != null ? t.setAttribute(n, String(e[n])) : t.removeAttribute(n);
721
+ r,
722
+ (i) => {
723
+ i != null ? t.setAttribute(n, String(e[n])) : t.removeAttribute(n);
692
724
  },
693
725
  this.getUpdateKey("attr", n)
694
726
  );
@@ -697,27 +729,27 @@ class jt {
697
729
  case "contentEditable":
698
730
  case "value":
699
731
  this.attachProp(
700
- i,
701
- (r) => {
702
- t[n] = String(r);
732
+ r,
733
+ (i) => {
734
+ t[n] = String(i);
703
735
  },
704
736
  this.getUpdateKey("prop", n)
705
737
  );
706
738
  break;
707
739
  case "for":
708
740
  this.attachProp(
709
- i,
710
- (r) => {
711
- t.htmlFor = r;
741
+ r,
742
+ (i) => {
743
+ t.htmlFor = i;
712
744
  },
713
745
  this.getUpdateKey("prop", "htmlFor")
714
746
  );
715
747
  break;
716
748
  case "checked":
717
749
  this.attachProp(
718
- i,
719
- (r) => {
720
- t.checked = r, r ? t.setAttribute("checked", "") : t.removeAttribute("checked");
750
+ r,
751
+ (i) => {
752
+ t.checked = i, i ? t.setAttribute("checked", "") : t.removeAttribute("checked");
721
753
  },
722
754
  this.getUpdateKey("prop", "checked")
723
755
  );
@@ -728,31 +760,31 @@ class jt {
728
760
  case "translate":
729
761
  case "type":
730
762
  case "title": {
731
- const r = n.toLowerCase();
763
+ const i = n.toLowerCase();
732
764
  this.attachProp(
733
- i,
765
+ r,
734
766
  (u) => {
735
- u == null ? t.removeAttribute(r) : t.setAttribute(r, String(u));
767
+ u == null ? t.removeAttribute(i) : t.setAttribute(i, String(u));
736
768
  },
737
- this.getUpdateKey("attr", r)
769
+ this.getUpdateKey("attr", i)
738
770
  );
739
771
  break;
740
772
  }
741
773
  case "autocomplete":
742
774
  case "autocapitalize":
743
775
  this.attachProp(
744
- i,
745
- (r) => {
746
- typeof r == "string" ? t.autocomplete = r : r ? t.autocomplete = "on" : t.autocomplete = "off";
776
+ r,
777
+ (i) => {
778
+ typeof i == "string" ? t.autocomplete = i : i ? t.autocomplete = "on" : t.autocomplete = "off";
747
779
  },
748
780
  this.getUpdateKey("prop", n)
749
781
  );
750
782
  break;
751
783
  default: {
752
784
  this.attachProp(
753
- i,
754
- (r) => {
755
- t[n] = r;
785
+ r,
786
+ (i) => {
787
+ t[n] = i;
756
788
  },
757
789
  this.getUpdateKey("prop", n)
758
790
  );
@@ -762,110 +794,113 @@ class jt {
762
794
  }
763
795
  }
764
796
  applyStyles(t, e, n) {
765
- const i = [];
797
+ const r = [];
766
798
  if (p(e)) {
767
- let r;
768
- const u = e.watch((a) => {
769
- this.elementContext.root.batch.write(
799
+ let i;
800
+ const u = e.watch((c) => {
801
+ this._mutate(
770
802
  () => {
771
- A(r) && r(), t.style.cssText = "", r = this.applyStyles(t, a, n);
803
+ P(i) && i(), t.style.cssText = "", i = this.applyStyles(t, c, n);
772
804
  },
773
805
  this.getUpdateKey("styles", "*")
774
806
  );
775
807
  });
776
- n.push(u), i.push(u);
808
+ n.push(u), r.push(u);
777
809
  } else {
778
- const r = dt(e);
779
- for (const u in r) {
780
- const { value: a, priority: l } = r[u];
781
- if (p(a)) {
782
- const c = a.watch((h) => {
783
- this.elementContext.root.batch.write(() => {
784
- h ? t.style.setProperty(u, String(h), l) : t.style.removeProperty(u);
810
+ const i = Mt(e);
811
+ for (const u in i) {
812
+ const { value: c, priority: a } = i[u];
813
+ if (p(c)) {
814
+ const l = c.watch((h) => {
815
+ this._mutate(() => {
816
+ h ? t.style.setProperty(u, String(h), a) : t.style.removeProperty(u);
785
817
  });
786
818
  });
787
- n.push(c), i.push(c);
788
- } else a != null && t.style.setProperty(u, String(a));
819
+ n.push(l), r.push(l);
820
+ } else c != null && t.style.setProperty(u, String(c));
789
821
  }
790
822
  }
791
823
  return function() {
792
- for (const u of i)
824
+ for (const u of r)
793
825
  u(), n.splice(n.indexOf(u), 1);
794
826
  };
795
827
  }
796
828
  applyClasses(t, e, n) {
797
- const i = [];
829
+ const r = [];
798
830
  if (p(e)) {
799
- let r;
800
- const u = e.watch((a) => {
801
- this.elementContext.root.batch.write(
831
+ let i;
832
+ const u = e.watch((c) => {
833
+ this._mutate(
802
834
  () => {
803
- A(r) && r(), t.removeAttribute("class"), r = this.applyClasses(t, a, n);
835
+ P(i) && i(), t.removeAttribute("class"), i = this.applyClasses(t, c, n);
804
836
  },
805
837
  this.getUpdateKey("attr", "class")
806
838
  );
807
839
  });
808
- n.push(u), i.push(u);
840
+ n.push(u), r.push(u);
809
841
  } else {
810
- const r = ht(e);
811
- for (const u in r) {
812
- const a = r[u];
813
- if (p(a)) {
814
- const l = a.watch((c) => {
815
- this.elementContext.root.batch.write(() => {
816
- c ? t.classList.add(u) : t.classList.remove(u);
842
+ const i = xt(e);
843
+ for (const u in i) {
844
+ const c = i[u];
845
+ if (p(c)) {
846
+ const a = c.watch((l) => {
847
+ this._mutate(() => {
848
+ l ? t.classList.add(u) : t.classList.remove(u);
817
849
  });
818
850
  });
819
- n.push(l), i.push(l);
820
- } else a && t.classList.add(u);
851
+ n.push(a), r.push(a);
852
+ } else c && t.classList.add(u);
821
853
  }
822
854
  }
823
855
  return function() {
824
- for (const u of i)
856
+ for (const u of r)
825
857
  u(), n.splice(n.indexOf(u), 1);
826
858
  };
827
859
  }
828
860
  }
829
- function ht(s) {
861
+ function xt(s) {
830
862
  let t = {};
831
- if (E(s)) {
863
+ if (x(s)) {
832
864
  const e = s.split(" ");
833
865
  for (const n of e)
834
866
  t[n] = !0;
835
- } else U(s) ? Object.assign(t, s) : Array.isArray(s) && Array.from(s).filter(Boolean).forEach((e) => {
836
- Object.assign(t, ht(e));
867
+ } else Ct(s) ? Object.assign(t, s) : Array.isArray(s) && Array.from(s).filter(Boolean).forEach((e) => {
868
+ Object.assign(t, xt(e));
837
869
  });
838
870
  return delete t.undefined, t;
839
871
  }
840
- function dt(s) {
872
+ function Mt(s) {
841
873
  let t = {};
842
- if (E(s)) {
874
+ if (x(s)) {
843
875
  const e = s.split(";").filter((n) => n.trim() !== "");
844
876
  for (const n of e) {
845
- const [i, r] = n.split(":"), u = {
846
- value: r
877
+ const [r, i] = n.split(":"), u = {
878
+ value: i
847
879
  };
848
- r.includes("!important") ? (u.priority = "important", u.value = r.replace("!important", "").trim()) : u.value = r.trim(), t[tt(i.trim())] = u;
880
+ i.includes("!important") ? (u.priority = "important", u.value = i.replace("!important", "").trim()) : u.value = i.trim(), t[nt(r.trim())] = u;
849
881
  }
850
882
  }
851
- if (U(s))
883
+ if (Ct(s))
852
884
  for (const e in s)
853
- e.startsWith("--") ? t[e] = { value: s[e] } : t[tt(e)] = { value: s[e] };
885
+ e.startsWith("--") ? t[e] = { value: s[e] } : t[nt(e)] = { value: s[e] };
854
886
  else Array.isArray(s) && Array.from(s).filter((e) => e != null).forEach((e) => {
855
- Object.assign(t, dt(e));
887
+ Object.assign(t, Mt(e));
856
888
  });
857
889
  return t;
858
890
  }
859
- function tt(s) {
891
+ function nt(s) {
860
892
  return s.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, e) => (e ? "-" : "") + t.toLowerCase());
861
893
  }
862
- function Lt(s, t) {
894
+ function te(s, t) {
863
895
  const e = typeof s;
864
896
  return e === "string" ? String(t) : e === "number" ? Number(t) : e === "boolean" ? !!t : t;
865
897
  }
866
- const It = ["ref", "children", "class", "style", "data"];
867
- class Rt {
898
+ const ee = ["ref", "children", "class", "style", "data"];
899
+ var lt;
900
+ lt = b;
901
+ class ne {
868
902
  constructor({ states: t, renderFn: e, elementContext: n }) {
903
+ o(this, lt, !0);
869
904
  o(this, "node");
870
905
  o(this, "endNode");
871
906
  o(this, "connectedViews", []);
@@ -874,20 +909,20 @@ class Rt {
874
909
  o(this, "observerControls");
875
910
  o(this, "watcher", K());
876
911
  this.elementContext = n, this.renderFn = e, this.node = document.createComment("Observer"), this.endNode = document.createComment("/Observer");
877
- let i;
912
+ let r;
878
913
  this.observerControls = {
879
914
  start: () => {
880
- i == null && (i = this.watcher.watch(t, (...r) => {
881
- const u = this.renderFn(...r);
882
- if (!mt(u))
883
- throw console.error(u), new TypeError(
884
- `Observer received invalid value to render. Got type: ${M(u)}, value: ${u}`
915
+ r == null && (r = this.watcher.watch(t, (...i) => {
916
+ let u = this.renderFn(...i);
917
+ if (!Vt(u))
918
+ throw console.error(u, i), new TypeError(
919
+ `Observer received invalid value to render. Got type: ${N(u)}, value: ${u}`
885
920
  );
886
921
  Array.isArray(u) ? this.update(...u) : this.update(u);
887
922
  }));
888
923
  },
889
924
  stop: () => {
890
- i != null && (i(), i = void 0);
925
+ r != null && (r(), r = void 0);
891
926
  }
892
927
  };
893
928
  }
@@ -907,63 +942,59 @@ class Rt {
907
942
  (e = this.connectedViews.pop()) == null || e.unmount(t);
908
943
  }
909
944
  update(...t) {
910
- var n, i;
945
+ var n, r;
911
946
  if (this.cleanup(!1), t == null || !this.isMounted)
912
947
  return;
913
- const e = t.map((r) => ft(r) ? r : $(r) ? x(C(this.elementContext, r)) : x(C(this.elementContext, V(r))));
914
- for (const r of e) {
948
+ const e = t.map((i) => Nt(i) ? i : $(i) ? M(_(this.elementContext, i)) : M(_(this.elementContext, A(i))));
949
+ for (const i of e) {
915
950
  const u = ((n = this.connectedViews.at(-1)) == null ? void 0 : n.node) || this.node;
916
- r.mount(this.node.parentNode, u), this.connectedViews.push(r);
951
+ i.mount(this.node.parentNode, u), this.connectedViews.push(i);
917
952
  }
918
953
  if (this.elementContext.root.getEnv() === "development") {
919
- const r = (i = this.connectedViews.at(-1)) == null ? void 0 : i.node;
920
- this.endNode.previousSibling !== r && this.node.parentNode.insertBefore(this.endNode, (r == null ? void 0 : r.nextSibling) ?? null);
954
+ const i = (r = this.connectedViews.at(-1)) == null ? void 0 : r.node;
955
+ this.endNode.previousSibling !== i && this.node.parentNode.insertBefore(this.endNode, (i == null ? void 0 : i.nextSibling) ?? null);
921
956
  }
922
957
  }
923
958
  }
924
- class Gt {
959
+ var ht;
960
+ ht = b;
961
+ class $t {
925
962
  constructor(t) {
926
- o(this, "node");
927
- o(this, "endNode");
928
- o(this, "$children");
963
+ o(this, ht, !0);
964
+ o(this, "node", document.createTextNode(""));
965
+ o(this, "isMounted", !1);
966
+ o(this, "elements");
967
+ o(this, "children", []);
929
968
  o(this, "stopCallback");
930
- o(this, "mountedChildren", []);
931
- o(this, "elementContext");
932
- this.$children = t.$children, this.elementContext = t.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Outlet"), this.endNode = document.createComment("/Outlet")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
933
- }
934
- get isMounted() {
935
- var t;
936
- return ((t = this.node) == null ? void 0 : t.parentNode) != null;
969
+ this.elements = t;
937
970
  }
938
971
  mount(t, e) {
939
- this.isMounted || (t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), this.stopCallback = this.$children.watch((n) => {
972
+ this.isMounted || (this.isMounted = !0, t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), p(this.elements) ? this.stopCallback = this.elements.watch((n) => {
940
973
  this.update(n);
941
- }));
974
+ }) : this.update(this.children));
942
975
  }
943
976
  unmount(t = !1) {
944
- var e;
945
977
  if (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted) {
946
- for (const n of this.mountedChildren)
947
- n.unmount(t);
948
- this.mountedChildren = [], (e = this.endNode.parentNode) == null || e.removeChild(this.endNode);
978
+ for (const e of this.children)
979
+ e.unmount(t);
980
+ this.children = [], this.isMounted = !1;
949
981
  }
950
982
  }
951
983
  update(t) {
952
- var e, n, i;
953
- for (const r of this.mountedChildren)
954
- r.unmount(!1);
955
- for (let r = 0; r < t.length; r++) {
956
- const u = t[r], a = r > 0 ? t[r] : void 0;
957
- u.mount(this.node.parentElement, a == null ? void 0 : a.node);
984
+ for (const e of this.children)
985
+ e.unmount(!1);
986
+ for (let e = 0; e < t.length; e++) {
987
+ const n = t[e], r = e > 0 ? t[e] : void 0;
988
+ n.mount(this.node.parentElement, r == null ? void 0 : r.node);
958
989
  }
959
- this.mountedChildren = t, this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Outlet (${t.length} ${t.length === 1 ? "child" : "children"})`, (i = this.node.parentElement) == null || i.insertBefore(
960
- this.endNode,
961
- ((n = (e = this.mountedChildren[this.mountedChildren.length - 1]) == null ? void 0 : e.node) == null ? void 0 : n.nextSibling) ?? null
962
- ));
990
+ this.children = t;
963
991
  }
964
992
  }
965
- class Bt {
993
+ var ft;
994
+ ft = b;
995
+ class se {
966
996
  constructor(t) {
997
+ o(this, ft, !0);
967
998
  o(this, "config");
968
999
  o(this, "element");
969
1000
  this.config = t;
@@ -972,15 +1003,15 @@ class Bt {
972
1003
  return this.element ? this.element.isMounted : !1;
973
1004
  }
974
1005
  mount(t, e) {
975
- const { content: n, parent: i } = this.config;
976
- ft(n) ? this.element = n : $(n) ? this.element = x(C(this.config.elementContext, n)) : this.element = x(C(this.config.elementContext, V(n))), this.element.mount(i);
1006
+ const { content: n, parent: r } = this.config;
1007
+ Nt(n) ? this.element = n : $(n) ? this.element = M(_(this.config.elementContext, n)) : this.element = M(_(this.config.elementContext, A(n))), this.element.mount(r);
977
1008
  }
978
1009
  unmount(t = !1) {
979
1010
  var e;
980
1011
  (e = this.element) != null && e.isMounted && this.element.unmount(t);
981
1012
  }
982
1013
  }
983
- class Dt {
1014
+ class re {
984
1015
  constructor(t) {
985
1016
  o(this, "__view");
986
1017
  this.__view = t;
@@ -1015,8 +1046,8 @@ class Dt {
1015
1046
  for (; t.push(e.data), e.parent; )
1016
1047
  e = e.parent;
1017
1048
  const n = {};
1018
- for (const i of t.reverse())
1019
- Object.assign(n, i);
1049
+ for (const r of t.reverse())
1050
+ Object.assign(n, r);
1020
1051
  return n;
1021
1052
  }
1022
1053
  beforeMount(t) {
@@ -1036,11 +1067,11 @@ class Dt {
1036
1067
  if (n.isMounted)
1037
1068
  return n._watcher.watch(t, e);
1038
1069
  {
1039
- let i, r = !1;
1070
+ let r, i = !1;
1040
1071
  return n._onMountCallbacks.push(() => {
1041
- r || (i = n._watcher.watch(t, e));
1072
+ i || (r = n._watcher.watch(t, e));
1042
1073
  }), () => {
1043
- i != null && (r = !0, i());
1074
+ r != null && (i = !0, r());
1044
1075
  };
1045
1076
  }
1046
1077
  }
@@ -1048,9 +1079,12 @@ class Dt {
1048
1079
  return y("$outlet", { $children: this.__view._$children });
1049
1080
  }
1050
1081
  }
1051
- class j {
1052
- constructor(t, e, n, i = []) {
1053
- o(this, "uniqueId", ct());
1082
+ var dt;
1083
+ dt = b;
1084
+ const H = class H {
1085
+ constructor(t, e, n, r = []) {
1086
+ o(this, dt, !0);
1087
+ o(this, "uniqueId", vt());
1054
1088
  o(this, "_elementContext");
1055
1089
  o(this, "_logger");
1056
1090
  o(this, "_view");
@@ -1064,9 +1098,7 @@ class j {
1064
1098
  o(this, "_beforeUnmountCallbacks", []);
1065
1099
  o(this, "_onUnmountCallbacks", []);
1066
1100
  o(this, "isMounted", !1);
1067
- this._elementContext = { ...t, data: {}, parent: t }, this._logger = t.root.createLogger(e.name, { uid: this.uniqueId }), this._view = e, this._props = n;
1068
- const [r, u] = R(C(t, i));
1069
- this._$children = r, this._setChildren = u;
1101
+ this._elementContext = { ...t, data: {}, parent: t }, this._logger = t.root.createLogger(e.name, { uid: this.uniqueId }), this._view = e, this._props = n, [this._$children, this._setChildren] = G(_(t, r));
1070
1102
  }
1071
1103
  /*===============================*\
1072
1104
  || "Public" API ||
@@ -1093,14 +1125,14 @@ class j {
1093
1125
  this._watcher.stopAll();
1094
1126
  }
1095
1127
  setChildView(t) {
1096
- const e = new j(this._elementContext, t, {});
1128
+ const e = new H(this._elementContext, t, {});
1097
1129
  return this._setChildren([e]), e;
1098
1130
  }
1099
1131
  /*===============================*\
1100
1132
  || Internal ||
1101
1133
  \*===============================*/
1102
1134
  initialize() {
1103
- const t = new Dt(this);
1135
+ const t = new re(this);
1104
1136
  let e;
1105
1137
  try {
1106
1138
  e = this._view(this._props, t);
@@ -1108,23 +1140,27 @@ class j {
1108
1140
  throw n instanceof Error && this._logger.crash(n), n;
1109
1141
  }
1110
1142
  if (e !== null) if (e instanceof Node)
1111
- this._element = x(C(this._elementContext, y("$node", { value: e })));
1112
- else if ($(e) || ut($, e))
1113
- this._element = x(C(this._elementContext, e));
1143
+ this._element = M(_(this._elementContext, y("$node", { value: e })));
1144
+ else if ($(e) || yt($, e))
1145
+ this._element = M(_(this._elementContext, e));
1114
1146
  else if (p(e))
1115
- this._element = x(
1116
- C(this._elementContext, y("$observer", { states: [e], renderFn: (n) => n }))
1147
+ this._element = M(
1148
+ _(this._elementContext, y("$observer", { states: [e], renderFn: (n) => n }))
1117
1149
  );
1118
1150
  else {
1119
1151
  const n = new TypeError(
1120
- `Expected '${this._view.name}' function to return a DOM node, Markup element, Readable or null. Got: ${M(e)}`
1152
+ `Expected '${this._view.name}' function to return a DOM node, Markup element, Readable or null. Got: ${N(e)}`
1121
1153
  );
1122
1154
  this._logger.crash(n);
1123
1155
  }
1124
1156
  }
1125
- }
1126
- class Kt {
1127
- constructor({ elementContext: t, $items: e, renderFn: n, keyFn: i }) {
1157
+ };
1158
+ let U = H;
1159
+ var pt;
1160
+ pt = b;
1161
+ class ie {
1162
+ constructor({ elementContext: t, $items: e, renderFn: n, keyFn: r }) {
1163
+ o(this, pt, !0);
1128
1164
  o(this, "node");
1129
1165
  o(this, "endNode");
1130
1166
  o(this, "$items");
@@ -1133,7 +1169,7 @@ class Kt {
1133
1169
  o(this, "elementContext");
1134
1170
  o(this, "renderFn");
1135
1171
  o(this, "keyFn");
1136
- this.elementContext = t, this.$items = e, this.renderFn = n, this.keyFn = i, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
1172
+ this.elementContext = t, this.$items = e, this.renderFn = n, this.keyFn = r, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
1137
1173
  }
1138
1174
  get isMounted() {
1139
1175
  return this.node.parentNode != null;
@@ -1153,56 +1189,59 @@ class Kt {
1153
1189
  this.connectedItems = [];
1154
1190
  }
1155
1191
  _update(t) {
1156
- var r, u, a;
1192
+ var i, u, c;
1157
1193
  if (t.length === 0 || !this.isMounted)
1158
1194
  return this._cleanup(!1);
1159
1195
  const e = [];
1160
1196
  let n = 0;
1161
- for (const l of t)
1197
+ for (const a of t)
1162
1198
  e.push({
1163
- key: this.keyFn(l, n),
1164
- value: l,
1199
+ key: this.keyFn(a, n),
1200
+ value: a,
1165
1201
  index: n++
1166
1202
  });
1167
- const i = [];
1168
- for (const l of this.connectedItems)
1169
- e.find((h) => h.key === l.key) || l.element.unmount(!1);
1170
- for (const l of e) {
1171
- const c = this.connectedItems.find((h) => h.key === l.key);
1172
- if (c)
1173
- c.setValue(l.value), c.setIndex(l.index), i[l.index] = c;
1203
+ const r = [];
1204
+ for (const a of this.connectedItems)
1205
+ e.find((h) => h.key === a.key) || a.element.unmount(!1);
1206
+ for (const a of e) {
1207
+ const l = this.connectedItems.find((h) => h.key === a.key);
1208
+ if (l)
1209
+ l.setValue(a.value), l.setIndex(a.index), r[a.index] = l;
1174
1210
  else {
1175
- const [h, d] = R(l.value), [f, m] = R(l.index);
1176
- i[l.index] = {
1177
- key: l.key,
1211
+ const [h, f] = G(a.value), [d, m] = G(a.index);
1212
+ r[a.index] = {
1213
+ key: a.key,
1178
1214
  $value: h,
1179
- setValue: d,
1180
- $index: f,
1215
+ setValue: f,
1216
+ $index: d,
1181
1217
  setIndex: m,
1182
- element: new j(this.elementContext, Ht, {
1218
+ element: new U(this.elementContext, oe, {
1183
1219
  $value: h,
1184
- $index: f,
1220
+ $index: d,
1185
1221
  renderFn: this.renderFn
1186
1222
  })
1187
1223
  };
1188
1224
  }
1189
1225
  }
1190
- for (let l = 0; l < i.length; l++) {
1191
- const c = i[l], h = ((r = i[l - 1]) == null ? void 0 : r.element.node) ?? this.node;
1192
- c.element.mount(this.node.parentNode, h);
1226
+ for (let a = 0; a < r.length; a++) {
1227
+ const l = r[a], h = ((i = r[a - 1]) == null ? void 0 : i.element.node) ?? this.node;
1228
+ l.element.mount(this.node.parentNode, h);
1193
1229
  }
1194
- if (this.connectedItems = i, this.elementContext.root.getEnv() === "development") {
1195
- this.node.textContent = `Repeat (${i.length} item${i.length === 1 ? "" : "s"})`;
1196
- const l = ((u = i.at(-1)) == null ? void 0 : u.element.node) ?? this.node;
1197
- (a = this.node.parentNode) == null || a.insertBefore(this.endNode, l.nextSibling);
1230
+ if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
1231
+ this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
1232
+ const a = ((u = r.at(-1)) == null ? void 0 : u.element.node) ?? this.node;
1233
+ (c = this.node.parentNode) == null || c.insertBefore(this.endNode, a.nextSibling);
1198
1234
  }
1199
1235
  }
1200
1236
  }
1201
- function Ht({ $value: s, $index: t, renderFn: e }, n) {
1237
+ function oe({ $value: s, $index: t, renderFn: e }, n) {
1202
1238
  return e(s, t, n);
1203
1239
  }
1204
- class zt {
1240
+ var mt;
1241
+ mt = b;
1242
+ class ue {
1205
1243
  constructor({ value: t }) {
1244
+ o(this, mt, !0);
1206
1245
  o(this, "node", document.createTextNode(""));
1207
1246
  o(this, "value", "");
1208
1247
  o(this, "stopCallback");
@@ -1224,20 +1263,20 @@ class zt {
1224
1263
  }
1225
1264
  }
1226
1265
  function $(s) {
1227
- return U(s) && (typeof s.type == "string" || typeof s.type == "function") && Array.isArray(s.children);
1266
+ return (s == null ? void 0 : s[kt]) === !0;
1228
1267
  }
1229
- function ft(s) {
1230
- return U(s) && A(s.connect) && A(s.disconnect);
1268
+ function Nt(s) {
1269
+ return (s == null ? void 0 : s[b]) === !0;
1231
1270
  }
1232
- function V(s) {
1233
- return O(s) || (s = [s]), s.flat(1 / 0).filter((t) => t != null && t !== !1).map((t) => {
1271
+ function A(s) {
1272
+ return V(s) || (s = [s]), s.flat(1 / 0).filter((t) => t != null && t !== !1).map((t) => {
1234
1273
  if (t instanceof Node)
1235
1274
  return y("$node", { value: t });
1236
- if (t instanceof pt)
1275
+ if (t instanceof At)
1237
1276
  return y("$node", { value: t.node });
1238
1277
  if ($(t))
1239
1278
  return t;
1240
- if (E(t) || vt(t))
1279
+ if (x(t) || _t(t))
1241
1280
  return y("$text", { value: t });
1242
1281
  if (p(t))
1243
1282
  return y("$observer", {
@@ -1248,40 +1287,44 @@ function V(s) {
1248
1287
  });
1249
1288
  }
1250
1289
  function y(s, t, ...e) {
1251
- return t != null && Yt(t), {
1290
+ return t != null && ae(t), {
1291
+ [kt]: !0,
1252
1292
  type: s,
1253
1293
  props: t,
1254
- children: V(e)
1294
+ children: A(e)
1255
1295
  };
1256
1296
  }
1257
- function Yt(s) {
1258
- if (s.ref && !lt(s.ref))
1297
+ function ae(s) {
1298
+ if (s.ref && !Et(s.ref))
1259
1299
  throw console.warn(s.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${s.ref}`);
1260
1300
  for (const t in s)
1261
1301
  if (t.startsWith("$$") && s[t] !== void 0) {
1262
- if (!D(s[t]))
1302
+ if (!B(s[t]))
1263
1303
  throw new TypeError(`Prop '${t}' is named as a SettableState but value is not. Got: ${s[t]}`);
1264
1304
  } else if (t.startsWith("$") && s[t] !== void 0 && !p(s[t]))
1265
1305
  throw new TypeError(`Prop '${t}' is named as a State but value is not. Got: ${s[t]}`);
1266
1306
  }
1267
- const le = Pt.bind(y);
1268
- function ce(s, t, e) {
1269
- const n = W(s);
1307
+ const ve = Zt.bind(y);
1308
+ function be(s, t, e) {
1309
+ const n = L(s);
1270
1310
  return y("$cond", {
1271
1311
  $predicate: n,
1272
1312
  thenContent: t,
1273
1313
  elseContent: e
1274
1314
  });
1275
1315
  }
1276
- function he(s, t, e) {
1277
- const n = W(s);
1316
+ function Se(s, t, e) {
1317
+ const n = L(s);
1278
1318
  return y("$repeat", { $items: n, keyFn: t, renderFn: e });
1279
1319
  }
1280
- function de(s, t) {
1320
+ function ke(s, t) {
1281
1321
  return y("$portal", { parent: s, content: t });
1282
1322
  }
1283
- class pt {
1323
+ var gt;
1324
+ gt = b;
1325
+ class At {
1284
1326
  constructor(t) {
1327
+ o(this, gt, !0);
1285
1328
  o(this, "node");
1286
1329
  this.node = t;
1287
1330
  }
@@ -1295,67 +1338,64 @@ class pt {
1295
1338
  this.node.parentNode && this.node.parentNode.removeChild(this.node);
1296
1339
  }
1297
1340
  }
1298
- function C(s, t) {
1299
- return (O(t) ? t : [t]).map((n) => {
1300
- if (A(n.type))
1301
- return new j(s, n.type, n.props, n.children);
1302
- if (E(n.type))
1341
+ function _(s, t) {
1342
+ return (V(t) ? t : [t]).map((n) => {
1343
+ if (P(n.type))
1344
+ return new U(s, n.type, n.props, n.children);
1345
+ if (x(n.type))
1303
1346
  switch (n.type) {
1304
1347
  case "$node": {
1305
- const i = n.props;
1306
- return new pt(i.value);
1348
+ const r = n.props;
1349
+ return new At(r.value);
1307
1350
  }
1308
1351
  case "$text": {
1309
- const i = n.props;
1310
- return new zt({
1311
- value: i.value
1352
+ const r = n.props;
1353
+ return new ue({
1354
+ value: r.value
1312
1355
  });
1313
1356
  }
1314
1357
  case "$cond": {
1315
- const i = n.props;
1316
- return new Ft({
1317
- $predicate: i.$predicate,
1318
- thenContent: i.thenContent,
1319
- elseContent: i.elseContent,
1358
+ const r = n.props;
1359
+ return new Xt({
1360
+ $predicate: r.$predicate,
1361
+ thenContent: r.thenContent,
1362
+ elseContent: r.elseContent,
1320
1363
  elementContext: s
1321
1364
  });
1322
1365
  }
1323
1366
  case "$repeat": {
1324
- const i = n.props;
1325
- return new Kt({
1326
- $items: i.$items,
1327
- keyFn: i.keyFn,
1328
- renderFn: i.renderFn,
1367
+ const r = n.props;
1368
+ return new ie({
1369
+ $items: r.$items,
1370
+ keyFn: r.keyFn,
1371
+ renderFn: r.renderFn,
1329
1372
  elementContext: s
1330
1373
  });
1331
1374
  }
1332
1375
  case "$observer": {
1333
- const i = n.props;
1334
- return new Rt({
1335
- states: i.states,
1336
- renderFn: i.renderFn,
1376
+ const r = n.props;
1377
+ return new ne({
1378
+ states: r.states,
1379
+ renderFn: r.renderFn,
1337
1380
  elementContext: s
1338
1381
  });
1339
1382
  }
1340
1383
  case "$outlet": {
1341
- const i = n.props;
1342
- return new Gt({
1343
- $children: i.$children,
1344
- elementContext: s
1345
- });
1384
+ const r = n.props;
1385
+ return new $t(r.$children);
1346
1386
  }
1347
1387
  case "$portal": {
1348
- const i = n.props;
1349
- return new Bt({
1350
- content: i.content,
1351
- parent: i.parent,
1388
+ const r = n.props;
1389
+ return new se({
1390
+ content: r.content,
1391
+ parent: r.parent,
1352
1392
  elementContext: s
1353
1393
  });
1354
1394
  }
1355
1395
  default:
1356
1396
  if (n.type.startsWith("$"))
1357
1397
  throw new Error(`Unknown markup type: ${n.type}`);
1358
- return new jt({
1398
+ return new Qt({
1359
1399
  tag: n.type,
1360
1400
  props: n.props ?? {},
1361
1401
  children: n.children,
@@ -1366,77 +1406,48 @@ function C(s, t) {
1366
1406
  throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
1367
1407
  });
1368
1408
  }
1369
- function x(s) {
1370
- if (s.length === 1)
1371
- return s[0];
1372
- const t = document.createComment("Fragment");
1373
- let e = !1;
1374
- return {
1375
- get node() {
1376
- return t;
1377
- },
1378
- get isMounted() {
1379
- return e;
1380
- },
1381
- mount(n, i) {
1382
- var r;
1383
- n.insertBefore(t, i || null);
1384
- for (const u of s) {
1385
- const a = ((r = s[s.length - 1]) == null ? void 0 : r.node) ?? t;
1386
- u.mount(n, a);
1387
- }
1388
- e = !0;
1389
- },
1390
- unmount(n) {
1391
- if (e) {
1392
- for (const i of s)
1393
- i.unmount(!0);
1394
- t.remove();
1395
- }
1396
- e = !1;
1397
- }
1398
- };
1409
+ function M(s) {
1410
+ return s.length === 1 ? s[0] : new $t(s);
1399
1411
  }
1400
- function mt(s) {
1401
- return s == null || s === !1 || typeof s == "string" || typeof s == "number" || $(s) || p(s) || ut(mt, s);
1412
+ function Vt(s) {
1413
+ return s == null || s === !1 || x(s) || _t(s) || $(s) || p(s) || yt(Vt, s);
1402
1414
  }
1403
- function fe(s, t) {
1415
+ function Ee(s, t) {
1404
1416
  return t.outlet();
1405
1417
  }
1406
1418
  export {
1407
- C as A,
1408
- ue as B,
1409
- te as C,
1410
- ne as D,
1411
- de as E,
1412
- he as F,
1413
- fe as P,
1414
- j as V,
1415
- R as a,
1416
- Et as b,
1417
- ce as c,
1418
- Tt as d,
1419
- A as e,
1420
- E as f,
1421
- Qt as g,
1422
- le as h,
1423
- U as i,
1424
- Jt as j,
1425
- K as k,
1426
- ie as l,
1427
- re as m,
1428
- oe as n,
1429
- W as o,
1430
- ae as p,
1431
- lt as q,
1432
- Xt as r,
1433
- ee as s,
1434
- M as t,
1435
- y as u,
1436
- At as v,
1437
- se as w,
1438
- $t as x,
1439
- Mt as y,
1440
- x as z
1419
+ _ as A,
1420
+ _e as B,
1421
+ bt as C,
1422
+ ke as D,
1423
+ Se as E,
1424
+ Ee as P,
1425
+ U as V,
1426
+ G as a,
1427
+ x as b,
1428
+ be as c,
1429
+ Ht as d,
1430
+ me as e,
1431
+ P as f,
1432
+ fe as g,
1433
+ ve as h,
1434
+ Ct as i,
1435
+ he as j,
1436
+ le as k,
1437
+ K as l,
1438
+ ge as m,
1439
+ we as n,
1440
+ ye as o,
1441
+ L as p,
1442
+ Ce as q,
1443
+ Et as r,
1444
+ pe as s,
1445
+ N as t,
1446
+ de as u,
1447
+ Bt as v,
1448
+ y as w,
1449
+ Rt as x,
1450
+ Dt as y,
1451
+ M as z
1441
1452
  };
1442
- //# sourceMappingURL=passthrough-CrReqVVB.js.map
1453
+ //# sourceMappingURL=passthrough-BeKX_qRr.js.map